[Scummvm-cvs-logs] scummvm master -> 350210dd90b134112378573827a8c309210cf9f9

Strangerke Strangerke at scummvm.org
Mon Jul 29 21:11:27 CEST 2013


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

Summary:
a44263a513 MORTEVIELLE: Original source code
8e1b26507b MORTEVIELLE: Make ptoc happy
854bd08a80 MORTEVIELLE: Initial ptoc output
55c2a098d4 MORTEVIELLE: Ran astyle over generated files
3ae3dbd10a MORTEVIELLE: Rename *.h -> *.cpp where they really belong
b462cbb5f0 MORTEVIELLE: Plug the engine into makefiles
a32594fa0d MORTEVIELLE: integer -> int
3e77d34628 MORTEVIELLE: Register engine at engines.mk
3c6f644244 MORTEVIELLE: real -> float
3390d178c5 MORTEVIELLE: Transformed some array to C arrays
28904f0d01 MORTEVIELLE: str* -> Common::String
f752caa2f7 MORTEVIELLE: Converted more arrays into C style arrays
e4adfbbb8b MORTEVIELLE: Add namespace and standard header
48fa2eba64 MORTEVIELLE: Add an an include for string, move boolean to bool
3dfbb24e9b MORTEVIELLE: rename namespace
fc695e518e MORTEVIELLE: Add header files
7d03d1fe4e MORTEVIELLE: Start including header files
25f08ad0bd MORTEVIELLE: fix several old includes
004935b016 MORTEVIELLE: use bool instead of boolean
2ffc1fd85e MORTEVIELLE: Fix some errors by including str.h
bc51e86114 MORTEVIELLE: Fix several errors, add some includes
5fa968449c MORTEVIELLE: Enlarge two arrays in order to fix pascal access
d8b28221d5 MORTEVIELLE: Fix some more errors by adding includes
3c6329ef6e MORTEVIELLE: long_int -> float
c580ad126e MORTEVIELLE: COnvert more arrays and data types
76c0701575 MORTEVIELLE: More compilation fixes
ab09fdc069 MORTEVIELLE: Converted remaining varying_string instances to Common::String
0708b0b0da MORTEVIELLE: Fixed variable usage in var_mor.h and var_mor.cpp
1ad0ded898 MORTEVIELLE: cardinal -> uint
dd64a3962b MORTEVIELLE: Compilation fixes and extern prefixes to header file method declarations
dcd1b5c604 MORTEVIELLE: Compilation fixes based on adding appropriate #include files
aeff6055e0 MORTEVIELLE: Further bugfixes to include files and added includes
7376893968 MORTEVIELLE: Replaced all set::of forms with proper C if statements
d1a2a7a8b5 MORTEVIELLE: More addition of needed #include lines and other compilation fixes
eb6d9e56c1 MORTEVIELLE: Converted some of the file accesses to use Common::File
70984b8d6e MORTEVIELLE: Converted string() usage to Common::String
5483930c47 MORTEVIELLE: More compilation fixes
c6fb8d6361 MORTEVIELLE: Lots of compilation fixes
03e7aecf12 MORTEVIELLE: Added stubs for remaining functions needed by the project
e6b0e592ec MORTEVIELLE: Added stub engine implementation. Engine is now compilable.
df496a179a MORTEVIELLE: Fix data loading in chartex method
c800051851 MORTEVIELLE: Add a couple of detection entries
b56d4a90ee MORTEVIELLE: Bugfix for loading data in chartex()
1b2215e2ec MORTEVIELLE: Bugfix for loading data in charpal()
3b77567fd5 MORTEVIELLE: Bugfix for loading data in charge_cfiph()
1f0ffd8299 MORTEVIELLE: Add some comments with translated strings
1ae3a52cd2 MORTEVIELLE: Reimplemented the zzuul assembly routine in C code
635d9b3b90 MORTEVIELLE: Reimplemented the loading of cfiec.mor more cleanly
b70bed24f9 MORTEVIELLE: Fixed some compiler warnings
91412dce33 MORTEVIELLE: Cleaned up the init_nbrepm method
55acfe2bea MORTEVIELLE: Bugfix for loading data in init_lieu method
b689eec4d8 MORTEVIELLE: Correct loading of the text data index, and fixed decoding of text lines
bc32861ec0 MORTEVIELLE: Initialise graphics, and hardcode game mode to EGA graphics with mouse enabled
6535e88046 MORTEVIELLE: Fix character indexing in writeg()
07cce9cb94 MORTEVIELLE: New create_mortdat project to create a mort.dat data file
5d9b9f1085 MORTEVIELLE: Implemented loading of the font data, and rewrote drawing routines to use it.
65a9f7a83d MORTEVIELLE: Change mem array to be 640Kb, and correct segment offsets using the array
3215d824c4 MORTEVIELLE: Converted memw[] usage to use mem[] array with endian macros
92d60a29ed MORTEVIELLE: Fixed compiler warning
deaaf4dd5e MORTEVIELLE: Fix memory offsets in rest of the places
80a1325445 MORTEVIELLE: Fixed loading in chardes() method
79eae88fac MORTEVIELLE: Fix data loading in charani() method
1b8304742d MORTEVIELLE: Beginnings of code for picture decoding
e6e544ccd4 MORTEVIELLE: Implemented more of the image decompression code
42349ae7a1 MORTEVIELLE: Bugfixes for image decoding.
22ef8502b4 MORTEVIELLE: Implemented the remaining image decoding mode 11
58825d6f57 MORTEVIELLE: Completed the diag() method used in image decoding.
a5d26d3858 MORTEVIELLE: Implemented a screen surface class to hold all the graphics functionality.
d15612fa64 MORTEVIELLE: Fix remaining issues when decoding first image
b93cc84604 MORTEVIELLE: Added an optimised drawBox routine
cc6dba127d MORTEVIELLE: Correct horizontal display of images
d93ebf71f1 MORTEVIELLE: Create a basic palette manager class
b5e84ec75c MORTEVIELLE: Implemented a basic event handler.
ca77e3137b MORTEVIELLE: Properly handle image offsets when drawing images
070200a4d7 MORTEVIELLE: Fix decoding glitch in the first image
d4802b3f17 MORTEVIELLE: Give generic variables in image decoder proper names
02724f7ff4 MORTEVIELLE: Added needed palette remapping to drawPicture()
8c5e72534d MORTEVIELLE: Implement ScreenSurface::fillBox method
ecb6f23107 MORTEVIELLE: Fix the calculation in the animof method
e88b9512f6 MORTEVIELLE: Started some notes of the original memory map
a306753e32 MORTEVIELLE: Fix another graphic glitch in the image decoder
9a9e55d82a MORTEVIELLE: Fix seeking in chardes and charani
93821e8399 MORTEVIELLE: Reduce the decoding lookup buffer sizes
2bf0bca24a MORTEVIELLE: Add ScreenSurface::clearScreen method
c2b0166cc7 MORTEVIELLE: Fix savegame loading to allow to read from the data folder
134df7330d MORTEVIELLE: Fix loading of data in charge_bruit5()
882a17869c MORTEVIELLE: Fixed data reading in adzon()
5d7775593e MORTEVIELLE: Correct ScreenSurface::fillBox to use the passed colour
d9777a8062 MORTEVIELLE: Changed deprecated warnings to use debugC instead
471ada77a7 MORTEVIELLE: Set up default mouse cursor
8a2d928547 MORTEVIELLE: Expand on the mouse/keyboard handling code
b884c8bd3c MORTEVIELLE: Fix compiler warnings and added assert
0634f9a69c MORTEVIELLE: Added explicit quit checks to the main game loops
913249aa2e MORTEVIELLE: Correctly handle keyboard keys for moving mouse
7855329805 MORTEVIELLE: Fix display of action tabs
f9e9754016 MORTEVIELLE: Formatting fixes for game menu display
d5326e6fa3 MORTEVIELLE: More game menu formatting fixes
56ff300cc8 MORTEVIELLE: Restore background area when a menu is removed
6a3d03d630 MORTEVIELLE: Formatting fix for savegame list
90343ce7c9 MORTEVIELLE: Remove old drive boot sector read code in game startup.
8ce8442a13 MORTEVIELLE: Fix conversion of string to integer in room changes
20feeb0d03 MORTEVIELLE: Properly implement get_random_number method
27ff523c16 MORTEVIELLE: Added missing variable to savegame synchronization
d0de28c156 MORTEVIELLE: Merge the _mouseButtons and clic variables
d0319b1d6c MORTEVIELLE: Bugfix for image block decoding method #0
7e481e2d43 MORTEVIELLE: Fix for displaying savegame menus correctly
0b5eec09a2 MORTEVIELLE: Fix some string indexing
bcc573c6d1 MORTEVIELLE: Changed readclock() method to use ScummVM functionality
8cf581cf7e MORTEVIELLE: Correct synchronisation of savegame data
fad0768a70 MORTEVIELLE: Change float parameters in chardes/charani to int32
b2144322d7 MORTEVIELLE: Bugfixes for saving/loading savegames
9030ff1bf6 MORTEVIELLE: Visual fix for the inventory menu
26c8f5d39a MORTEVIELLE: Add extra parenthesis to defines for operation safety
418a78ab46 MORTEVIELLE: Fix sizes of several arrays
ece9de0b37 MORTEVIELLE: Added extra quit checks to event loops
81bcc9ff3f MORTEVIELLE: Converted the demus assembly code to C++
c68f2ff4ff MORTEVIELLE: Fix for erasing alert dialogs when done
1d4ea4862f MORTEVIELLE: Creation of a tool to extract game strings
35e1987da3 MORTEVIELLE: Minor bugfixes to string extraction tool
e67da8a533 MORTEVIELLE: In progress implementation of PC Speaker music player
a5143fb1a7 MORTEVIELLE: Replace timer chip frequency values with a constant
e57bdb46e1 MORTEVIELLE: Merged mort.cpp into mortevielle.cpp, and split up intro from main game
394883a5c6 MORTEVIELLE: Moved the game detection entries to detection_tables.h
86582b5c79 MORTEVIELLE: Implemented ScummVM savegame functionality with metadata
3056ea9668 MORTEVIELLE: Renamed main loop methods, along with quit/end/lose variables
af8933892d MORTEVIELLE: Added list of static executable strings to create_mortdat tool
ba3aedaeac MORTEVIELLE: Added support for using the static string list added to mort.dat
946142741b MORTEVIELLE: Removed text screen output, and fixed copyright to display on title screen.
c0ad988f1c MORTEVIELLE: Removed redundant gfx functions, and moved others into ScreenSurface class.
26e67c4de0 MORTEVIELLE: Removed boite() stab and remap calls to ScreenSurface::drawBox
ccacc08159 MORTEVIELLE: Fixed English strings for F3 and F8
5e86c7c430 MORTEVIELLE: Fixed the F3/F8 box width to adjust to the text size
c92e34877a MORTEVIELLE: Replace old calls to afff to use new decode/drawPicture methods
597ddc1b4d MORTEVIELLE: Added CHECK_QUIT to afdes() event loop
4d1a59db62 MORTEVIELLE: Add comments to the deprecated s_char method
fc7ce54c74 MORTEVIELLE: Replaced all box() calls with ScreenSurface::fillBox
92bc850416 MORTEVIELLE: Removed unused clear_box() and fill_box(), and renamed fillBox to fillRect
b269c8811a MORTEVIELLE: Removed all the code that was commented out in the original source
d79dc3baff MORTEVIELLE: Remove more code that had been commented out in the original source
f78ac771e3 MORTEVIELLE: Remove all the overlay comments
922c4d8244 MORTEVIELLE: Removed all the remaining text mode function stubs
0992a9592f MORTEVIELLE: Replaced stub calls to mortevielle_exit with Engine::quitGame
0a497bdd9e MORTEVIELLE: Moved DROITE() into the ScreenSurface class
9dbe5659c8 MORTEVIELLE: Convert menu code to a class
449aefa932 MORTEVIELLE: Converted menu functions into it's own class
b1d60ae77f MORTEVIELLE: Convert f3/f8 dialog, alert dialog, and ques dialogs into classes
8ffa0f9b15 MORTEVIELLE: Fix the 'You Are Alone' to be properly justified with English text
58a67ed11b TOOLS: Add header files to create_mortdat, remove second parameter
7d03b094b5 TOOL: Use a define for output name
6e7445cde0 TOOLS: Add ingame text.
3ef19ad8c1 TOOLS: Mortevielle - Remove extra spaces in one of the words
b6fa7e07cf MORTEVIELLE: Start cleaning taffich.cpp
87fe13ff09 MORTEVIELLE: Rename mouse functions, various formatting fixes
45553de16d MORTEVIELLE: Some more code formatting in mouse
8458a8bf66 MORTEVIELLE: Apply coding conventions to actions.cpp
efafc08884 MORTEVIELLE: rename verbs and associated opcodes, use enum for opcodes
5f0f24c898 MORTEVIELLE: Some more cleanup, renaming, plus a couple of crash fixes in deline and writeg
d6ee8f088a MORTEVIELLE: Rename some more variables and functions
6c2e662731 MORTEVIELLE: Some more code formatting, rename sonoff
d5718f6a31 MORTEVIELLE: Rename Alert functions
38e11b6ce0 MORTEVIELLE: Rename F3F8 functions, rename everything related to Graphical Device
ef42231f01 MORTEVIELLE: Rename graphical mode constants
c0697ec3a0 MORTEVIELLE: remove pred and succ
ab90fae676 MORTEVIELLE: various cleanup and renaming
2f4671a2df MORTEVIELLE: Add detection for another French version
a3ae21f14a MORTEVIELLE: Fix a bug in decodeAlertDetails
0e5637c524 MORTEVIELLE: cleanup decodeAlertDetails, rename parameters and variables
49422afea1 MORTEVIELLE: Fix questions display when entering hidden passage
f9666f4e30 MORTEVIELLE: rename variables in Ques::show(), fix remaining glitches
32ba785f4a MORTEVIELLE: Changed some char fields in sav_chaine to byte
3a0a48c0a5 MORTEVIELLE: Convert some more char types to byte
f382f7adc6 MORTEVIELLE: remove a couple of GOTOs
d6b76bbe31 MORTEVIELLE: Fix protection skip and avoid instant exit
1cce0754ef MORTEVIELLE: Some more cleanup, add alternate file names used by german and alternate french versions
d1420c9739 MORTEVIELLE: clean up while statements using separate 'not'
14f8c2954d MORTEVIELLE: Rename remaining Menu enums, rename _staticStrings into _engineStrings as a preliminar work on an English D
cc85fd239a MORTEVIELLE: First "English" version.
6e8a50c873 MORTEVIELLE: Start removing deline() and delig
d22862201b MORTEVIELLE: Rename arrays used by menu
2634bee7c6 MORTEVIELLE: clean up deline()
36e0e8ab05 MORTEVIELLE: remove error messages uselessly loaded
87ccfb4677 TOOLS: Mortevielle - Add missing heading space for several sentences used in menus, in the English version
bb5175c156 MORTEVIELLE: Rename menu entry type erroneously named
bdd4f4897b MORTEVIELLE: Use 0-based array instead of 1-based for menu constants, some renaming
5df9ccde63 MORTEVIELLE: Rename remaining opcodes, remove a couple of GOTOs
97de41b56e MORTEVIELLE: Fix bug, this is a "in [1, 2]" in the original code
9751829d27 MORTEVIELLE: Double check all "in []" statements, fix a couple of errors
be68aada86 MORTEVIELLE: silent several warning reported by cppCheck
7ebfcb1d97 MORTEVIELLE: Silent the remaining errors reported by CppCheck
f2e8b4dc04 MORTEVIELLE: Replace an 1-based array by a 0-based one
0f82bab350 MORTEVIELLE: Add braces, silenting some GCC warnings
e81636fe50 MORTEVIELLE: Silent a bunch of GCC warnings and errors
7155d01025 MORTEVIELLE: Start renaming globals
b67858b3d4 MORTEVIELLE: rename more globals and constants, remove t_nhom usage
81049d8d96 MORTEVIELLE: Rename more globals
db48f9812f MORTEVIELLE: Refactor KnowledgeCheck
b781caf0bd MORTEVIELLE: Properly remove protection checks
55701268d3 MORTEVIELLE: Rename some variables and functions related to 'Search' action
8c808d2068 MORTEVIELLE: Replaced mort.dat with latest generated dat file
6146e5d745 MORTEVIELLE: Start using place names (as enums) instead of magic values
69f762182d MORTEVIELLE: rename variables and functions related to random number generation
802d87998e MORTEVIELLE: rename several globals
fb4563a29d MORTEVIELLE: Rename some more functions and globals
03ed514820 MORTEVIELLE: Properly implement transparency when drawing images
07956b0aa9 MORTEVIELLE: Bugfixes for correctly displaying people present in a room
d0a9014cd4 MORTEVIELLE: Bugfix to ignore previous mouse click when waiting in tkey1
ba1a5b286e MORTEVIELLE: Added extra width to the Self menu for the English version
7056467e14 MORTEVIELLE: Some more renaming
f43e55c9f6 MORTEVIELLE: Remove useless variables from gameLoaded()
8ae1e9e450 MORTEVIELLE: Some more renaming and refactoring
a2bfb13215 MORTEVIELLE: Rename some more functions
c539a3b9ec MORTEVIELLE: some more renaming, match menu item size in setText()
a5507be8a8 MORTEVIELLE: Some more renaming. Move globals to the  MortevielleEngine class
fcf07e01b8 MORTEVIELLE: Move (and rename) some more globals to MortevielleEngine
d31a85aa14 MORTEVIELLE: Fix crash in chartex method for French version
4a86ef81f0 MORTEVIELLE: Some more renaming, fix a couple of GCC warnings
149e9367de MORTEVIELLE: Remove global variable zuul
db92a1bc3e MORTEVIELLE: Fix regression due to uninitialized variable, move remaining global booleans
a0cf7e7454 MORTEVIELLE: Move some more globals, get rid of some others
32a842bf7b MORTEVIELLE: regroup several files
c3e81b1b91 MORTEVIELLE: Merge prog and mor files
6e1cc8b6d9 MORTEVIELLE: Move opcode functions to MortevielleEngine class
46a972af95 MORTEVIELLE: Some more renaming
305f8fa147 MORTEVIELLE: move  couple of functions to menu class, more renaming
6fdd5355dc MORTEVIELLE: Remove extre usage of g_vm
56d571fec4 MORTEVIELLE: get rid of several magic values, introduce SpeechManager, some more renaming
5e489f433e MORTEVIELLE: More renaming and moving
2392e52193 MORTEVIELLE: Some more renaming
a47323aec2 MORTEVIELLE: More renaming
e4df49dfb8 MORTEVIELLE: Some more renaming
d9c78dec0c MORTEVIELLE: Remove some useless g_vm uses, some more renaming
e3c16a1799 MORTEVIELLE: Some more renaming
c989aa0df1 MORTEVIELLE: Remove dead code related to messint (display of loading message between rooms)
bd5aa76c80 MORTEVIELLE: Some more renaming
6774c15896 MORTEVIELLE: Some more renaming, introduce MouseHandler
7eabd1e5b8 MORTEVIELLE: Refactor mouse class
00664fd0e9 MORTEVIELLE: Fix regression
bf8083f2aa MORTEVIELLE: More renaming
56a7427466 MORTEVIELLE: More renaming
4d28d0963f MORTEVIELLE: Rename more globals and move functions to MortevielleEngine. Remove ovd1 files.
e296271d62 MORTEVIELLE: More renaming
b6d198d127 MORTEVIELLE: More renaming
b63857195d MORTEVIELLE: More renaming
2f0fd01184 MORTEVIELLE: More renaming, add a piece of code to improve CGA/EGA switching
75fcdfac0f MORTEVIELLE: Move functions out of mor.cpp
3dce1becd7 MORTEVIELLE: Get rid of mor.cpp
19798a23b3 MORTEVIELLE: More renaming and refactoring
4db87a5f47 MORTEVIELLE: rename some constants
2a91308490 MORTEVIELLE: rename Rect
9dfee9c811 MORTEVIELLE: Fix regression in previous commit
edbeb905b2 MORTEVIELLE: Remove trailing spaces
5b4327a81c MORTEVIELLE: Fix invert in Dep menu. Still a bit short due to Inventory width too small. Also add some ingame same/load 
8b065c2521 MORTEVIELLE: Enlarge Inventory menu display to match Depl menu.
a42a928241 MORTEVIELLE: Remove var_mor
2c49c3e66a MORTEVIELLE: Start adding German DOS version
7ad0997082 MORTEVIELLE: Start updating tools to add support to German DOS version
18ebc66cfd MORTEVIELLE: Get rid of the hardcoded size of _cfiecBuffer
37391a7477 MORTEVIELLE: Modify copyright string to include 1987.
c0f86412e7 MORTEVIELLE: Fix regression in 4edc3bff94b4cb27b32f46a4934bf486ab834e1c
6b096df397 MORTEVIELLE: Fix regression in 2c73b82b8ee95f9809af5e0d9893245f2c57247e
5604a4693c MORTEVIELLE: Some renaming
b6aa4110f6 TOOLS: Translate a couple of strings used in Mortevielle English
1888970421 MORTEVIELLE: Fix recurrent Valgrind warnings (thanks DrMcCoy for reporting)
1688911fcf MORTEVIELLE: Initialize some more variables
d290ebe830 MORTEVIELLE: Initialize some more variables
e7aa754dac MORTEVIELLE: Fix a couple of Valgrind warnings
b504a566ee MORTEVIELLE: Get rid of some magic values
b6fc1fe31f MORTEVIELLE: Some renaming
9488222929 Merge branch 'master' of github.com:scummvm/scummvm into mortevielle
0782835e6b MORTEVIELLE: Fix merge
e2b939888b MORTEVIELLE: Some more renaming
b06701e104 MORTEVIELLE: Some more renaming
ef7681aa81 MORTEVIELLE: Remove dead code.
dd3e3a4062 MORTEVIELLE: More renaming
9486525bcd MORTEVIELLE: rework _openObjects use, rename resetOpenObjects
30e60969c2 MORTEVIELLE: Some more renaming
85a83ae51b MORTEVIELLE: More renaming
87d9769009 MORTEVIELLE:Add initial English translation
f74600b50c MORTEVIELLE: Some renaming, remove useless variables, add debugger
4646c9eb99 MORTEVIELLE: Add new DAT file containing initial English translation
0a296783a4 MORTEVIELLE: Add two debug functions required to check the English translation
15b0e969b2 MORTEVIELLE: Fix minor glitches in DAT file
80047631fc MORTEVIELLE: Integrate translations fixes.
923729069f MORTEVIELLE: remove a magic value, initialize the last bytes of cfiecBuffer
872f4e5e9f MORTEVIELLE: Remove CHECK_QUIT macros
47067b23c3 MORTEVIELLE: Replace g_vm in Menu
861af32fff MORTEVIELLE: Replace g_vm in ScreenSurface
418890e859 MORTEVIELLE: Replace g_vm in MouseHandler
2811607dd7 MORTEVIELLE: Replace g_vm in TextHandler
266c8cb08c MORTEVIELLE: Replace g_vm in SoundManager
2e40ebae6f MORTEVIELLE: Replace g_vm in SpeechManager
de4874412c MORTEVIELLE: Remove some useless g_vm
7a7d812e74 MORTEVIELLE: Introduce DialogManager and get rid of static functions
8b923043b6 MORTEVIELLE: Use _vm instead of g_vm in DialogManager
b5fd4e44be Merge branch 'master' of https://github.com/scummvm/scummvm into mortevielle
0ce3b91a9c MORTEVIELLE: Remove useless static
79d5bbc1b8 MORTEVIELLE: Fix compilation
feda6e9b2b MORTEVIELLE: Move misc functions from Mortevielle to Utils
9294cd2277 MORTEVIELLE: Remove 2 useless functions
0366de430b MORTEVIELLE: Rename displayStatusInDescriptionBar()
358c2770c5 MORTEVIELLE: Rename displayStatusArrow()
234af13011 MORTEVIELLE: Some more renaming, introduce MENU_NONE constant
e04e2452ce MORTEVIELLE: Get rid of some magic values
c76d176809 MORTEVIELLE: More renaming
b7035ad475 MORTEVIELLE: Fix compilation of music code
1912c4a844 MORTEVIELLE: Fix access to free'ed memory
313f06e53b MORTEVIELLE: Fix memory leak with the _screenSurface
e857c95cb5 Merge pull request #1 from criezy/mortevielle
7505b97b03 MORTEVIELLE: Some renaming GfxSurface
0be08ea2c8 MORTEVIELLE: Some more renaming in GfxSurface
8042348744 MORTEVIELLE: The German version now starts with broken texts
26f5ed607f MORTEVIELLE: Fix extraction tool to handle German DOS version
2cb2ac25b9 TOOL: Remove obsolete comments in extract_mort
4c73b9158f MORTEVIELLE: Fix text decryption in German version
3d92d1e99d MORTEVIELLE: Some renaming in Utils
e8a7493241 MORTEVIELLE: Add German translation in the DAT file
ca3396970c MORTEVIELLE: Update misc files to include mort.dat
1bd1a8ab61 MORTEVIELLE: Remove unused const
5d56de9c76 MORTEVIELLE: Some renaming in Mortevielle.h
175a13e65a MORTEVIELLE: Fixed ifdef header guard naming
a6b1d4a8b5 MORTEVIELLE: Fix some typos identified by wjp
e2b192b839 MORTEVIELLE: Add missing eol character in devtool usage message
dcb2f69bbf MORTEVIELLE: Convert non-ASCII characters to their octal value
84a13eab01 MORTEVIELLE: Fix typo in English text
5e5e8a9c57 MORTEVIELLE: Changed savegames to use the game target to generate filenames
0a91aee2f7 Merge pull request #2 from criezy/mortevielle
44e62709bb DEVTOOLS: Moved implementation of create_mortdat File class from the header file
552b04f4fd MORTEVIELLE: Improve German engine texts
da57665c01 MORTEVIELLE: Some renaming in intro functions
3b4f4f41b4 MORTEVIELLE: Enlarge F3/F8 dialog
3004c27e8a MORTEVIELLE: Enlarge box around screens in order to avoid to display a line of the picture below the border
2105acfb97 MORTEVIELLE: Modify some more boxes
541697fe8d MORTEVIELLE: Constify an array in actions, reduce the scope of some variables
7b044ea75b MORTEVIELLE: Replace some British words by US ones
0bc631aa93 MORTEVIELLE: Constify an array in graphics, reduce the scope of some variables
be03a9c92b MORTEVIELLE: Fix formatting glitch
e4a9b71b8f MORTEVIELLE: Use width and height provided by Graphics::Surface
c8b35de0a9 MORTEVIELLE: Rename menu constant
8462eb7cfb MORTEVIELLE: Reorder includes
cf6f2ed85d MORTEVIELLE: Fix define name in Mortevielle.h
0b70159f9f TOOLS: Janitorial: remove trailing spaces in extract_mort
c87881a22b MORTEVIELLE: Constify 3 more arrays
dcea5f433c MORTEVIELLE: Simplify the way skip info is computed, as pointed by LordHoto
536fcb96b3 MORTEVIELLE: Fix glitch detected by criezy
4f8ac0b337 MORTEVIELLE: Add a safeguard in Copy()
ef93530026 MORTEVIELLE: Fix glitch in constant name. Thanks to LordHoto for pointing it out
b831332595 MORTEVIELLE: Removed redundant mouse drawing code
34e556e5f9 MORTEVIELLE: Little refactoring of decryptNextChar()
bd7a381d7d MORTEVIELLE: Reorder some functions in mortevielle.h
48bd13a719 MORTEVIELLE: Some more renaming
7fef5f0995 MORTEVIELLE: Simplify drawString code
abc3177c7d MORTEVIELLE: Get rid of magic value 0x7000
7d26f5cc3d MORTEVIELLE: Get rid of magic value 0x6000
590edf7de3 MORTEVIELLE: Get rid of magic value 0x5000
fb448d7d64 MORTEVIELLE: Make use of _mem more homogeneous, fix a couple of errors in phoneme handling
54459f383a MORTEVIELLE: Get rid of some more magic values
e572194960 MORTEVIELLE: Remove dead code, update comment
7926ab440d MORTEVIELLE: Remove one more magic value, simplify draw()
a086170d50 MORTEVIELLE: Remove constants previously used by the mouse code
6e0588abf5 MORTEVIELLE: Get rid of the last remaining magic values used with _mem
dd1d81acb3 MORTEVIELLE: Fix invalid read size in music code
43a5ed614e MORTEVIELLE: Fix some more invalid read sizes
ecb62e26c1 MORTEVIELLE: Use kAdrPictureComp in displayCGAPattern
60856680d2 MORTEVIELLE: Simplify loadDesFile and loadAniFile
d989394211 MORTEVIELLE: rename variable name not following naming conventions
b6e74961c2 MORTEVIELLE: Fix glitch in one of the head display functions
4c66d381d2 MORTEVIELLE: Fix another glitch in the head display functions
273a163d83 MORTEVIELLE: Fix Wait and Sleep alerts
1d3b2db375 MORTEVIELLE: Remove _msg array
631ed56ba6 MORTEVIELLE: Janitorial: Misc cosmetic changes
54d33bea2c MORTEVIELLE: Some more renaming
ba78fcbe74 MORTEVIELLE: Clarify a part of taffich
aca4d01628 MORTEVIELLE: Some more renaming
392ab0e9ab MORTEVIELLE: Improve question cheat in debugger
b1389f85ec MORTEVIELLE: Renaming fields and functions related to the number of answers per character
2955347cd7 MORTEVIELLE: Get rid of phaz, Fix an uninitialized variable in setRandomPresenceRoom9
628cd26487 MORTEVIELLE: Give a better name to kAdrDecBuffer
14aa4b7a93 MORTEVIELLE: Remove useless constant, rename another one
3f21318cea MORTEVIELLE: Remove useless define
a38d437b47 MORTEVIELLE: Start working on displayPicture, misc renaming and refactoring
c4237ed81a MORTEVIELLE: Move Current Picture out of _mem buffer, some renaming
c07c3f0a13 MORTEVIELLE: Remove unused code from the original compression scheme
2c0a99bbe1 MORTEVIELLE: Fix box height when searching
5858f82564 MORTEVIELLE: Fix the German 2nd intro screen (original bug)
917af38269 MORTEVIELLE: Remove the check on German for the intro filename by using an alternate filename in loading code
825b29fa53 MORTEVIELLE: Use a specific buffer instead of _mem for the right frame
d9757e985c MORTEVIELLE: Use variable size for _rightFramePict in order to handle the different sizes of the Amiga and Atari version
fd467658ac MORTEVIELLE: Use a specific buffer instead of _mem for the animations
0e59907b9b MORTEVIELLE: Use a specific buffer instead of _mem for noise5 file
62eae32277 MORTEVIELLE: Remove another use of _mem
0af5305a8a MORTEVIELLE: Remove another use of _mem
93fe1c60d2 MORTEVIELLE: Use heap allocation in GfxSurface::decode, remove one use of swap
eb1164539d MORTEVIELLE: Remove remaining macros, start refactoring menus, modify the way _cfiphBuffer is read/written
477a90f93e DEVTOOLS: Add support to another DOS executable for Mortevielle
350210dd90 Merge pull request #347 from Strangerke/mortevielle


Commit: a44263a513b7483ceebe9f6add4bd1a4fb030787
    https://github.com/scummvm/scummvm/commit/a44263a513b7483ceebe9f6add4bd1a4fb030787
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:09-07:00

Commit Message:
MORTEVIELLE: Original source code

Changed paths:
  A engines/mortevielle/original/0/ACTIONS.PAS
  A engines/mortevielle/original/0/AFF.COM
  A engines/mortevielle/original/0/AFFAMS.COM
  A engines/mortevielle/original/0/AFFEGA.COM
  A engines/mortevielle/original/0/AFFHER.COM
  A engines/mortevielle/original/0/AFFICH.COM
  A engines/mortevielle/original/0/AFFTAN.COM
  A engines/mortevielle/original/0/ALERT.PAS
  A engines/mortevielle/original/0/AS.PAS
  A engines/mortevielle/original/0/AXX.MOR
  A engines/mortevielle/original/0/AZZ.MOR
  A engines/mortevielle/original/0/BMOR.MOR
  A engines/mortevielle/original/0/BOITE.COM
  A engines/mortevielle/original/0/BOITE.PAS
  A engines/mortevielle/original/0/BRUIT5
  A engines/mortevielle/original/0/BRUITS
  A engines/mortevielle/original/0/CFIEC.MOR
  A engines/mortevielle/original/0/CFIPH.MOR
  A engines/mortevielle/original/0/CGA.COM
  A engines/mortevielle/original/0/CHARDES.COM
  A engines/mortevielle/original/0/CHARECR.COM
  A engines/mortevielle/original/0/CXX.MOR
  A engines/mortevielle/original/0/DEBUG.PAS
  A engines/mortevielle/original/0/DEC.MOR
  A engines/mortevielle/original/0/DECOMP.COM
  A engines/mortevielle/original/0/DECPASP.COM
  A engines/mortevielle/original/0/DEMUS.COM
  A engines/mortevielle/original/0/DEMUS2.COM
  A engines/mortevielle/original/0/DETECT.PAS
  A engines/mortevielle/original/0/DISK.PAS
  A engines/mortevielle/original/0/DIVAF.COM
  A engines/mortevielle/original/0/DON.MOR
  A engines/mortevielle/original/0/DROITE.PAS
  A engines/mortevielle/original/0/DXX.MOR
  A engines/mortevielle/original/0/DZZ.MOR
  A engines/mortevielle/original/0/ECRIHEXA.PAS
  A engines/mortevielle/original/0/FXX.MOR
  A engines/mortevielle/original/0/KEYBOARD.PAS
  A engines/mortevielle/original/0/LEVEL15.PAS
  A engines/mortevielle/original/0/LITPH4.COM
  A engines/mortevielle/original/0/MENU.PAS
  A engines/mortevielle/original/0/MENUFR.MOR
  A engines/mortevielle/original/0/MOR.PAS
  A engines/mortevielle/original/0/MOR2.PAS
  A engines/mortevielle/original/0/MORT.000
  A engines/mortevielle/original/0/MORT.001
  A engines/mortevielle/original/0/MORT.002
  A engines/mortevielle/original/0/MORT.003
  A engines/mortevielle/original/0/MORT.004
  A engines/mortevielle/original/0/MORT.005
  A engines/mortevielle/original/0/MORT.006
  A engines/mortevielle/original/0/MORT.COM
  A engines/mortevielle/original/0/MORT.IMG
  A engines/mortevielle/original/0/MORT.PAS
  A engines/mortevielle/original/0/MOUSE.PAS
  A engines/mortevielle/original/0/MUSINT.COM
  A engines/mortevielle/original/0/MUSINT2.COM
  A engines/mortevielle/original/0/MXX.MOR
  A engines/mortevielle/original/0/NEWMENU.PAS
  A engines/mortevielle/original/0/OUTTEXT.PAS
  A engines/mortevielle/original/0/OVD1.PAS
  A engines/mortevielle/original/0/PAROLE.PAS
  A engines/mortevielle/original/0/PAROLE2.PAS
  A engines/mortevielle/original/0/PHBRUI.MOR
  A engines/mortevielle/original/0/PHINT.COM
  A engines/mortevielle/original/0/PHINT2.COM
  A engines/mortevielle/original/0/PHINTBAK.COM
  A engines/mortevielle/original/0/PHINTCOM.COM
  A engines/mortevielle/original/0/PHINTDEF.COM
  A engines/mortevielle/original/0/PHINTGM.COM
  A engines/mortevielle/original/0/PHINTUK.COM
  A engines/mortevielle/original/0/PLXX.MOR
  A engines/mortevielle/original/0/PROG.PAS
  A engines/mortevielle/original/0/PUTPIX.COM
  A engines/mortevielle/original/0/QUES.PAS
  A engines/mortevielle/original/0/REUS.COM
  A engines/mortevielle/original/0/REUSINT.COM
  A engines/mortevielle/original/0/SAUVECR.COM
  A engines/mortevielle/original/0/SAV0.MOR
  A engines/mortevielle/original/0/SAV1.MOR
  A engines/mortevielle/original/0/SAV2.MOR
  A engines/mortevielle/original/0/SAV3.MOR
  A engines/mortevielle/original/0/SAV4.MOR
  A engines/mortevielle/original/0/SONMUS.MOR
  A engines/mortevielle/original/0/SPRINT.PAS
  A engines/mortevielle/original/0/TABLE.PAS
  A engines/mortevielle/original/0/TAFFICH.PAS
  A engines/mortevielle/original/0/TEST.COM
  A engines/mortevielle/original/0/TESTPROT.PAS
  A engines/mortevielle/original/0/TXX.INP
  A engines/mortevielle/original/0/TXX.NTP
  A engines/mortevielle/original/0/VAR.MOR
  A engines/mortevielle/original/0/ZUUL.COM
  A engines/mortevielle/original/1/AFF.COM
  A engines/mortevielle/original/1/AFFAMS.COM
  A engines/mortevielle/original/1/AFFEGA.COM
  A engines/mortevielle/original/1/AFFHER.COM
  A engines/mortevielle/original/1/AFFICH.COM
  A engines/mortevielle/original/1/AFFTAN.COM
  A engines/mortevielle/original/1/AXX.MOR
  A engines/mortevielle/original/1/AZZ.MOR
  A engines/mortevielle/original/1/BMOR.MOR
  A engines/mortevielle/original/1/BOITE.COM
  A engines/mortevielle/original/1/CFIEC.MOR
  A engines/mortevielle/original/1/CFIPH.MOR
  A engines/mortevielle/original/1/CGA.COM
  A engines/mortevielle/original/1/CHARDES.COM
  A engines/mortevielle/original/1/CHARECR.COM
  A engines/mortevielle/original/1/CXX.MOR
  A engines/mortevielle/original/1/DEC.MOR
  A engines/mortevielle/original/1/DECOMP.COM
  A engines/mortevielle/original/1/DECPASP.COM
  A engines/mortevielle/original/1/DEMUS.COM
  A engines/mortevielle/original/1/DEMUS2.COM
  A engines/mortevielle/original/1/DIVAF.COM
  A engines/mortevielle/original/1/DXX.MOR
  A engines/mortevielle/original/1/DZZ.MOR
  A engines/mortevielle/original/1/FXX.MOR
  A engines/mortevielle/original/1/LITPH4.COM
  A engines/mortevielle/original/1/MENUFR.MOR
  A engines/mortevielle/original/1/MORT.000
  A engines/mortevielle/original/1/MORT.001
  A engines/mortevielle/original/1/MORT.002
  A engines/mortevielle/original/1/MORT.003
  A engines/mortevielle/original/1/MORT.004
  A engines/mortevielle/original/1/MORT.005
  A engines/mortevielle/original/1/MORT.006
  A engines/mortevielle/original/1/MORT.COM
  A engines/mortevielle/original/1/MORT.ZIP
  A engines/mortevielle/original/1/MUSINT.COM
  A engines/mortevielle/original/1/MUSINT2.COM
  A engines/mortevielle/original/1/MXX.MOR
  A engines/mortevielle/original/1/PHBRUI.MOR
  A engines/mortevielle/original/1/PHINT.COM
  A engines/mortevielle/original/1/PHINT2.COM
  A engines/mortevielle/original/1/PHINTBAK.COM
  A engines/mortevielle/original/1/PHINTCOM.COM
  A engines/mortevielle/original/1/PHINTDEF.COM
  A engines/mortevielle/original/1/PHINTGM.COM
  A engines/mortevielle/original/1/PHINTUK.COM
  A engines/mortevielle/original/1/PLXX.MOR
  A engines/mortevielle/original/1/PUTPIX.COM
  A engines/mortevielle/original/1/REUS.COM
  A engines/mortevielle/original/1/REUSINT.COM
  A engines/mortevielle/original/1/SAUVECR.COM
  A engines/mortevielle/original/1/SAV0.MOR
  A engines/mortevielle/original/1/SAV1.MOR
  A engines/mortevielle/original/1/SAV2.MOR
  A engines/mortevielle/original/1/SAV3.MOR
  A engines/mortevielle/original/1/SONMUS.MOR
  A engines/mortevielle/original/1/TEST.COM
  A engines/mortevielle/original/1/ZUUL.COM
  A engines/mortevielle/original/2/AFF.COM
  A engines/mortevielle/original/2/AFFAMS.ASM
  A engines/mortevielle/original/2/AFFAMS.COM
  A engines/mortevielle/original/2/AFFEGA.ASM
  A engines/mortevielle/original/2/AFFEGA.COM
  A engines/mortevielle/original/2/AFFHER.ASM
  A engines/mortevielle/original/2/AFFHER.COM
  A engines/mortevielle/original/2/AFFICH.ASM
  A engines/mortevielle/original/2/AFFICH.COM
  A engines/mortevielle/original/2/AFFTAN.ASM
  A engines/mortevielle/original/2/AFFTAN.COM
  A engines/mortevielle/original/2/BOITE.ASM
  A engines/mortevielle/original/2/BOITE.COM
  A engines/mortevielle/original/2/CGA.ASM
  A engines/mortevielle/original/2/CGA.COM
  A engines/mortevielle/original/2/CHARDES.COM
  A engines/mortevielle/original/2/CHARECR.ASM
  A engines/mortevielle/original/2/CHARECR.COM
  A engines/mortevielle/original/2/CLEARMEM.ASM
  A engines/mortevielle/original/2/DECOMP.ASM
  A engines/mortevielle/original/2/DECOMP.COM
  A engines/mortevielle/original/2/DECPASP.COM
  A engines/mortevielle/original/2/DEMUS.ASM
  A engines/mortevielle/original/2/DEMUS.COM
  A engines/mortevielle/original/2/DEMUS2.ASM
  A engines/mortevielle/original/2/DEMUS2.COM
  A engines/mortevielle/original/2/DIVAF.ASM
  A engines/mortevielle/original/2/DIVAF.COM
  A engines/mortevielle/original/2/LITPH4.ASM
  A engines/mortevielle/original/2/LITPH4.COM
  A engines/mortevielle/original/2/LITPH6.ASM
  A engines/mortevielle/original/2/MUSINT.ASM
  A engines/mortevielle/original/2/MUSINT.COM
  A engines/mortevielle/original/2/MUSINT2.ASM
  A engines/mortevielle/original/2/MUSINT2.COM
  A engines/mortevielle/original/2/PHINT.ASM
  A engines/mortevielle/original/2/PHINT.COM
  A engines/mortevielle/original/2/PHINT2.ASM
  A engines/mortevielle/original/2/PHINT2.COM
  A engines/mortevielle/original/2/PHINTBAK.ASM
  A engines/mortevielle/original/2/PHINTBAK.COM
  A engines/mortevielle/original/2/PHINTCOM.COM
  A engines/mortevielle/original/2/PHINTDEF.ASM
  A engines/mortevielle/original/2/PHINTDEF.COM
  A engines/mortevielle/original/2/PHINTGM.ASM
  A engines/mortevielle/original/2/PHINTGM.COM
  A engines/mortevielle/original/2/PHINTUK.ASM
  A engines/mortevielle/original/2/PHINTUK.COM
  A engines/mortevielle/original/2/PUTPIX.ASM
  A engines/mortevielle/original/2/PUTPIX.COM
  A engines/mortevielle/original/2/REUS.ASM
  A engines/mortevielle/original/2/REUS.COM
  A engines/mortevielle/original/2/REUSINT.ASM
  A engines/mortevielle/original/2/REUSINT.COM
  A engines/mortevielle/original/2/SAUVECR.ASM
  A engines/mortevielle/original/2/SAUVECR.COM
  A engines/mortevielle/original/2/TEST.ASM
  A engines/mortevielle/original/2/TEST.COM
  A engines/mortevielle/original/2/ZUUL.ASM
  A engines/mortevielle/original/2/ZUUL.COM
  A engines/mortevielle/original/3/AXX
  A engines/mortevielle/original/3/AXX.MOR
  A engines/mortevielle/original/3/AZZ
  A engines/mortevielle/original/3/AZZ.MOR
  A engines/mortevielle/original/3/BMOR.MOR
  A engines/mortevielle/original/3/BRUIT1
  A engines/mortevielle/original/3/BRUIT2
  A engines/mortevielle/original/3/BRUIT3
  A engines/mortevielle/original/3/BRUIT4
  A engines/mortevielle/original/3/BRUIT5
  A engines/mortevielle/original/3/BRUITS
  A engines/mortevielle/original/3/CFIEC.MOR
  A engines/mortevielle/original/3/CFIPH.MOR
  A engines/mortevielle/original/3/CGA.MOR
  A engines/mortevielle/original/3/CHAI.MOR
  A engines/mortevielle/original/3/DEC.MOR
  A engines/mortevielle/original/3/DON.MOR
  A engines/mortevielle/original/3/DXX
  A engines/mortevielle/original/3/DXX.MOR
  A engines/mortevielle/original/3/DZZ.MOR
  A engines/mortevielle/original/3/DZZFRA
  A engines/mortevielle/original/3/FXX.MOR
  A engines/mortevielle/original/3/MENU.MOR
  A engines/mortevielle/original/3/MORT.000
  A engines/mortevielle/original/3/MORT.001
  A engines/mortevielle/original/3/MORT.002
  A engines/mortevielle/original/3/MORT.003
  A engines/mortevielle/original/3/MORT.004
  A engines/mortevielle/original/3/MORT.005
  A engines/mortevielle/original/3/MORT.006
  A engines/mortevielle/original/3/MORT.007
  A engines/mortevielle/original/3/MORT.COM
  A engines/mortevielle/original/3/MUSC.MOR
  A engines/mortevielle/original/3/MXX.MOR
  A engines/mortevielle/original/3/PHBRUI.MOR
  A engines/mortevielle/original/3/PLXX.MOR
  A engines/mortevielle/original/3/SAUV.MOR
  A engines/mortevielle/original/3/SONMUS.MOR
  A engines/mortevielle/original/3/TFXX.MOR
  A engines/mortevielle/original/3/TXX.MOR
  A engines/mortevielle/original/3/TXX.NTI



diff --git a/engines/mortevielle/original/0/ACTIONS.PAS b/engines/mortevielle/original/0/ACTIONS.PAS
new file mode 100644
index 0000000..fd940b3
--- /dev/null
+++ b/engines/mortevielle/original/0/ACTIONS.PAS
@@ -0,0 +1,1373 @@
+(* NIVEAU 4 *)
+const stouinon = '[2][ ][OUI][NON]';
+
+overlay procedure taller;
+label 2;
+var
+ mx,cx,cy: integer;
+begin
+ if (s.mlieu= 26) and (msg[4]= depl[6]) then
+ begin
+  s.mlieu:= 15;
+  caff:= s.mlieu;
+  afdes(0);
+  repon(2,s.mlieu);
+ end;
+ if (s.mlieu= 15) and (msg[4]= depl[6]) then
+ begin
+  if not syn then ecr3('aller');
+  tfleche;
+  if iesc then okdes:= false;
+  if (anyone) or (iesc) then exit;
+  tcoord(1);
+  if num= 0 then exit;
+  if num= 1 then
+  begin
+   s.mlieu:= 0;
+   tmlieu(0);
+  end
+  else
+   if num= 7 then
+   begin
+    s.mlieu:= 13;
+    tmlieu(13);
+   end
+   else
+    if num<> 6 then s.mlieu:= 26;
+  if (num> 1) and (num< 6) then ment:= num- 1;
+  if num> 7 then ment:= num- 3;
+  if num<> 6 then affrep else aldepl;
+  exit;
+ end;
+ tsort;
+ cx:= 0;
+ repeat
+  cx:= cx+ 1;
+ until depl[cx]= msg[4];
+ if s.mlieu= 19 then
+ begin
+  if cx= 1 then t1deva;
+  if cx= 2 then t1neig;
+  goto 2;
+ end;
+ if s.mlieu= 23 then
+ begin
+  if cx= 1 then t1deau;
+  if cx= 2 then t1derr;
+  goto 2;
+ end;
+ if (s.mlieu= 11) and (cx= 1) then cx:= 6;
+ if s.mlieu= 12 then
+ begin
+  if cx= 2 then cx:= 6;
+  if cx= 5 then cx:= 16;
+ end;
+ if (s.mlieu= 14) and (cx= 3) then cx:= 6;
+ if ((s.mlieu= 15) or (s.mlieu= 26)) and (cx= 4) then cx:= 6;
+ if (s.mlieu> 19) and (s.mlieu<> 26) then cx:= cx+ 10;
+ if (s.mlieu= 20) and (cx= 13) then cx:= 16;
+ if s.mlieu= 21 then
+ begin
+  if cx= 12 then cx:= 16 else
+  if cx> 13 then cx:= 15;
+ end;
+ if (s.mlieu= 22) and (cx> 14) then cx:= 15;
+ if (s.mlieu= 24) and (cx<> 17) then
+  if cx> 13 then cx:= 15;
+ if cx= 1 then s.mlieu:= 11 else
+ if cx= 2 then s.mlieu:= 12 else
+ if cx= 3 then s.mlieu:= 14 else
+ if cx= 4 then s.mlieu:= 15 else
+ if cx= 5 then cx:= 12;
+ if cx= 6 then cx:= 11;
+ if cx= 11 then t1sama else
+ if cx= 12 then t1deva else
+ if cx= 13 then s.mlieu:= 20 else
+ if cx= 14 then s.mlieu:= 24 else
+ if cx= 15 then t1neig else
+ if cx= 16 then t1derr else
+ if cx= 17 then
+ begin
+  if (s.ipuit<> 120) and (s.ipuit<> 140) then crep:= 997 else
+   if s.ipuit= 120 then crep:= 181 else
+    if s.conf> 80 then
+    begin
+     crep:= 1505;
+     tperd;
+    end
+    else
+    begin
+     s.mlieu:= 23;
+     affrep;
+    end;
+ end;
+ if (cx< 5) or (cx= 13) or (cx= 14) then affrep;
+ debloc(s.mlieu);
+2:
+ tmlieu(s.mlieu);
+end;
+
+overlay procedure tprendre;
+var
+ cx, cy, cz: integer;
+begin
+ if caff> 99 then
+ begin
+  cx:= caff;
+  avpoing(cx);
+  if crep<> 139 then
+  begin
+   if ipers> 0 then s.conf:= s.conf+ 3;
+   if obpart then
+   begin
+    if s.mlieu= 2 then s.iloic:= 0;
+    if s.mlieu= 13 then
+    begin
+     if s.iboul= caff then s.iboul:= 0;
+     if s.ibag= caff then s.ibag:= 0;
+    end;
+    if s.mlieu= 14 then s.icave:= 0;
+    if s.mlieu= 16 then s.icryp:= 0;
+    if s.mlieu= 17 then s.ivier:= 0;
+    if s.mlieu= 24 then s.ipuit:= 0;
+    mfouen;
+    obpart:= false;
+    affrep;
+   end
+   else
+   begin
+    tabdon[acha+ (pred(mchai)* 10)+ pred(cs)]:=0;
+    tsuiv;
+    dobj:= dobj+ 1;
+    if dobj> 6 then
+    begin
+     s.conf:= s.conf+ 2;
+     dobj:= 0;
+    end;
+   end;
+  end;
+  exit;
+ end;
+ if not syn then ecr3('prendre');
+ tfleche;
+ if (anyone) or (iesc) then exit;
+ if caff= 3 then
+ begin
+  tcoord(2);
+  if num= 1 then
+  begin
+   crep:= 152;
+   exit;
+  end;
+ end;
+ tcoord(5);
+ if (num= 0) or ((num= 1) and (s.mlieu= 16)) then
+ begin
+  tcoord(8);
+  if num<> 0 then
+  begin
+   if ipers> 0 then s.conf:= s.conf+ 3;
+   crep:= 997;
+   if (s.mlieu= 2) and (s.iloic<> 0) then avpoing(s.iloic);
+   if (s.mlieu=13) and (num=1) and (s.iboul<>0) then
+   begin
+    avpoing(s.iboul);
+    if (crep<> 997) and (crep<> 139) then aniof(2,7);
+   end;
+   if (s.mlieu=13) and (num=2) and (s.ibag<>0) then
+   begin
+    avpoing(s.ibag);
+    if (crep<> 997) and (crep<> 139) then aniof(2,6);
+   end;
+   if (s.mlieu= 14) and (s.icave<> 0) then
+   begin
+    avpoing(s.icave);
+    if (crep<> 997) and (crep<> 139) then aniof(2,2);
+   end;
+   if (s.mlieu= 16) and (s.icryp<> 0) then avpoing(s.icryp);
+   if (s.mlieu= 17) and (s.ivier<> 0) then
+   begin
+    avpoing(s.ivier);
+    if (crep<> 997) and (crep<> 139) then
+    begin
+     crep:= 182;
+     aniof(2,1);
+    end;
+   end;
+   if (s.mlieu= 24) and (s.ipuit<> 0) then
+   begin
+    avpoing(s.ipuit);
+    if (crep<> 997) and (crep<> 139) then aniof(2,1);
+   end;
+   if (crep<> 997) and (crep<> 182) and (crep<> 139) then crep:= 999;
+  end;
+ end
+ else
+ begin
+  if ((s.mlieu= 0) and (num= 3)) or ((s.mlieu= 1) and (num= 4))
+  or ((s.mlieu= 2) and (num= 1)) or ((s.mlieu= 4) and (num= 3))
+  or ((s.mlieu= 5) and (num= 6)) or ((s.mlieu= 6) and (num= 2))
+  or ((s.mlieu= 7) and (num= 6)) or ((s.mlieu= 8) and (num= 4))
+  or ((s.mlieu= 9) and (num= 4)) or ((s.mlieu= 10) and (num> 2))
+  or ((s.mlieu= 11) and (num= 7)) or ((s.mlieu= 12) and (num= 6))
+  or ((s.mlieu= 13) and (num> 4)) or ((s.mlieu> 13)
+  and (s.mlieu<> 23)) then crep:= 997 else
+  begin
+   if s.mlieu= 23 then
+   begin
+    crep:= 1504;
+    tperd;
+   end
+   else crep:= 120;
+  end;
+ end;
+end;
+
+overlay procedure tsprendre;
+var
+ cx,cy,cz: integer;
+begin
+ cx:= 0;
+ repeat
+  cx:= cx+ 1;
+ until invt[cx]= msg[4];
+ cz:= 0;
+ cy:= 0;
+ repeat
+  cy:= cy+ 1;
+  if ord(s.sjer[cy])<> 0 then cz:= cz+ 1;
+ until cz= cx;
+ cz:= ord(s.sjer[cy]);
+ s.sjer[cy]:= chr(0);
+ modinv;
+ avpoing(cz);
+ crep:= 998;
+ clsf2;
+end;
+
+overlay procedure tsoulever;
+label 1;
+var
+ cx: integer;
+begin
+ if not syn then ecr3('soulever');
+ tfleche;
+ if (anyone) or (iesc) then exit;
+ tcoord(3);
+ if num= 0 then
+ begin
+  tcoord(8);
+  if num<> 0 then
+  begin
+   if ipers> 0 then s.conf:= s.conf+ 1;
+   crep:= 997;
+   if (s.mlieu= 2) and (s.iloic<> 0) then treg(s.iloic);
+  end;
+  exit;
+ end;
+ if ipers> 0 then s.conf:= s.conf+ 1;
+ cx:= s.mlieu;
+ if s.mlieu= 16 then cx:= 14;
+ if s.mlieu= 19 then cx:= 15;
+ crep:= tabdon[asoul+(cx shl 3)+pred(num)];
+ if crep= 255 then crep:= 997;
+end;
+
+overlay procedure tlire;
+var
+ iaff: integer;
+begin
+ if caff> 99 then st4(caff) else
+ begin
+  if not syn then ecr3('lire');
+  tfleche;
+  if not (anyone) and not (iesc) then
+  begin
+   tcoord(4);
+   if num<> 0 then crep:= 107;
+  end;
+ end;
+end;
+
+overlay procedure tslire;
+begin
+ if s.derobj= 0 then crep:= 186 else st4(s.derobj);
+end;
+
+overlay procedure tregarder;
+var
+ cx: integer;
+begin
+ if caff> 99 then
+ begin
+  crep:= 103;
+  exit;
+ end;
+ if not syn then ecr3('regarder');
+ tfleche;
+ if (anyone) or (iesc) then exit;
+ tcoord(5);
+ if num= 0 then
+ begin
+  tcoord(8);
+  crep:= 131;
+  if num<> 0 then
+  begin
+   if s.mlieu= 13 then
+   begin
+    if num= 1 then
+    begin
+     crep:= 164;
+     if s.ibag<> 0 then treg(s.ibag) else
+      if s.iboul<> 0 then treg(s.iboul);
+    end
+    else
+    begin
+     crep:= 193;
+     if s.ibag<> 0 then treg(s.ibag);
+    end;
+   end;
+   if s.mlieu= 14 then
+   begin
+    crep:= 164;
+    if s.icave<> 0 then treg(s.icave);
+   end;
+   if s.mlieu= 17 then
+   begin
+    crep:= 174;
+    if s.ivier<> 0 then treg(s.ivier);
+   end;
+   if s.mlieu= 24 then
+   begin
+    crep:= 131;
+    if s.ipuit<> 0 then treg(s.ipuit);
+   end;
+  end;
+  exit;
+ end;
+ cx:= s.mlieu;
+ if s.mlieu= 20 then cx:= 17;
+ if (s.mlieu> 21) and (s.mlieu< 25) then cx:= cx- 4;
+ if s.mlieu= 26 then cx:= 21;
+ crep:= tabdon[arega+(cx*7)+pred(num)];
+ if (s.mlieu= 13) and (num= 8) then crep:= 126;
+ if s.mlieu= 19 then crep:= 103;
+ if crep= 255 then crep:= 131;
+ if (s.mlieu= 1) and (num= 1) then treg(144);
+ if (s.mlieu= 5) and (num= 3) then treg(147);
+ if (s.mlieu= 8) and (num= 3) then treg(149);
+ if (s.mlieu= 9) and (num= 2) then treg(30);
+ if (s.mlieu= 10) and (num= 3) then treg(31);
+end;
+
+overlay procedure tsregarder;
+begin
+ if s.derobj<> 0 then treg(s.derobj) else crep:= 186;
+end;
+
+overlay procedure tfouiller;
+const r:array[0..13] of byte=(123,104,123,131,131,123,104,131,123,123,106,123,123,107);
+var
+ cx: integer;
+begin
+ if caff> 99 then
+ begin
+  st7(caff);
+  exit;
+ end;
+ if not syn then ecr3('fouiller');
+ tfleche;
+ if (anyone or iesc) then exit;
+ if s.mlieu=23 then
+ begin
+  crep:= 1504;
+  tperd;
+  exit;
+ end;
+ tcoord(6);
+ if num= 0 then
+ begin
+  tcoord(7);
+  if num<>0 then
+  begin
+   cx:=0;
+   repeat
+    cx:=cx+1;
+   until (cx>6) or (num= ord(touv[cx]));
+   if num<>ord(touv[cx]) then crep:=187 else
+   begin
+    if ipers>0 then s.conf:= s.conf+3;
+    rechai(mchai);
+    if mchai<>0 then
+    begin
+     cs:=0;
+     is:=0;
+     fouil:=true;
+     mfoudi;
+     tsuiv;
+    end
+    else crep:=997;
+   end;
+  end
+  else
+  begin
+   tcoord(8);
+   crep:= 997;
+   if num<>0 then
+   begin
+    if ipers>0 then s.conf:=s.conf+3;
+    if (s.mlieu<>24) and (s.mlieu<>17) and (s.mlieu<>13) then
+    begin
+     if s.mlieu=2 then
+     begin
+      crep:= 123;
+      if s.iloic<>0 then treg(s.iloic);
+     end;
+     if s.mlieu=16 then
+     begin
+      crep:= 123;
+      if s.icryp<>0 then treg(s.icryp);
+     end;
+    end;
+   end;
+  end;
+ end
+ else
+ begin
+  if ipers>0 then s.conf:=s.conf+ 3;
+  crep:= 997;
+  if s.mlieu < 14 then crep:= r[s.mlieu];
+  if (s.mlieu= 3) and (num= 2) then crep:=162;
+  if (s.mlieu= 12) then
+  begin
+   if (num= 3) or (num= 4) then crep:=162;
+   if num= 5 then crep:= 159;
+  end;
+  if s.mlieu=19 then crep:=104;
+  if s.mlieu=16 then crep:=155;
+ end;
+end;
+
+overlay procedure tsfouiller;
+begin
+ if s.derobj<>0 then st7(s.derobj) else crep:= 186;
+end;
+
+overlay procedure touvrir;
+var
+ cx,haz:integer;
+begin
+ if not syn then ecr3('ouvrir');
+ if caff= 26 then
+ begin
+  if ment<> 0 then
+  begin
+   msg[4]:= entrer;
+   syn:= true;
+  end
+  else crep:= 997;
+  exit;
+ end;
+ if caff= 15 then
+ begin
+  aldepl;
+  exit;
+ end;
+ tfleche;
+ if (anyone) or (iesc) then exit;
+ tcoord(7);
+ if num<> 0 then
+ begin
+  if ipers> 0 then s.conf:= s.conf+ 2;
+  iouv:= iouv+ 1;
+  cx:= 0;
+  repeat
+   cx:= cx+ 1;
+  until (cx> 6) or (ord(touv[cx])= 0) or (ord(touv[cx])= num);
+  if ord(touv[cx])<> num then
+  begin
+   if not
+    (
+     ( (num= 3) and ((s.mlieu= 0) or (s.mlieu= 9) or (s.mlieu= 5) or (s.mlieu= 7)) )
+     or
+      ((num= 4) and ((s.mlieu= 1) or (s.mlieu= 2) or (s.mlieu= 6))) or
+      ((s.mlieu= 4) and (num= 5)) or
+      ((num= 6) and ((s.mlieu= 7) or (s.mlieu= 10) or
+                     (s.mlieu= 8) or (s.mlieu= 13))) or
+      ((s.mlieu= 8) and (num= 2)) or
+      ((s.mlieu= 12) and (num= 7))) then
+      begin
+         if ((s.mlieu> 10) and (s.mlieu< 14)) or
+          ((s.mlieu> 6) and (s.mlieu< 10)) or
+          (s.mlieu= 0) or (s.mlieu= 2) or (s.mlieu= 5) then
+          begin
+            haz:= hazard(1, 4);
+            if haz= 3 then parole(7, 9, 1);
+          end;
+        touv[cx]:= chr(num);
+        aniof(1,num);
+      end;
+   cx:= s.mlieu;
+   if s.mlieu= 16 then cx:= 14;
+   crep:= tabdon[aouvr+ (cx* 7)+ pred(num)];
+   if crep= 254 then crep:= 999;
+  end
+  else crep:= 18;
+ end;
+end;
+
+overlay procedure tmettre;
+var
+ quel: integer;
+ entre : boolean;
+ st : phrase;
+ str : str255;
+ i,tay : integer;
+begin
+ if s.derobj= 0 then
+ begin
+  crep:= 186;
+  exit;
+ end;
+ if not syn then ecr3('mettre');
+ tfleche;
+ if iesc then crep:= 998;
+ if (anyone) or (iesc) then exit;
+ tcoord(8);
+ if num<> 0 then
+ begin
+  crep:= 999;
+  if caff= 13 then
+  begin
+   if num= 1 then
+   begin
+    if s.iboul<> 0 then crep:= 188 else
+    begin
+     s.iboul:= s.derobj;
+     if s.derobj= 141 then aniof(1,7);
+    end;
+   end
+   else
+    if s.ibag<> 0 then crep:= 188 else
+    begin
+     s.ibag:= s.derobj;
+     if s.derobj= 159 then aniof(1,6);
+    end;
+  end;
+  if caff= 14 then
+   if s.icave<>0 then crep:= 188 else
+   begin
+    s.icave:= s.derobj;
+    if s.derobj= 151 then
+    begin
+     aniof(1,2);
+     aniof(1,1);
+     repon(2,165);
+     maivid;
+     parole(6, -9, 1);
+     quel:= do_alert(stouinon,1);
+     if quel=1 then begin
+                      deline(582,st,tay);
+                      i:= do_alert(delig,1);
+                      tesok:=False;
+                      entre:= ques;
+                      hide_mouse;
+                      hirs;
+                      dessine_rouleau;
+                      clsf2;
+                      clsf3;
+                      show_mouse;
+                      tinke;
+                      pendule;
+                      if ipers<>0 then affper(ipers)
+                                  else person;
+                      menu_aff;
+                      if entre then
+                         begin
+                           s.mlieu:= 17;
+                           tmlieu(17);
+                         end
+                        else
+                         begin
+                           tmlieu(s.mlieu);
+                           writepal(14);
+                           dessin(0);
+                           aniof(1,2);
+                           aniof(1,1);
+                           DeLine(577,st,tay);
+                           i:= do_alert(delig,1);
+                           aniof(2,1);
+                           crep:= 166;
+                         end;
+                      affrep;
+                    end
+               else begin
+                      aniof(2,1);
+                      crep:= 166;
+                      tesok:=True;
+                    end;
+     exit;
+    end;
+   end;
+  if caff= 16 then
+   if s.icryp= 0 then s.icryp:= s.derobj else crep:= 188;
+  if caff= 17 then
+   if s.ivier<>0 then crep:= 188 else
+    if s.derobj= 143 then
+    begin
+     s.ivier:= 143;
+     aniof(1,1);
+    end
+    else
+    begin
+     crep:= 1512;
+     tperd;
+    end;
+  if caff= 24 then
+   if s.ipuit<> 0 then crep:= 188 else
+    if (s.derobj= 140) or (s.derobj= 120) then
+    begin
+     s.ipuit:= s.derobj;
+     aniof(1,1);
+    end
+    else crep:= 185;
+  if crep<> 188 then maivid;
+ end;
+end;
+
+overlay procedure ttourner;
+var
+ quel: integer;
+begin
+ if caff> 99 then
+ begin
+  crep:= 149;
+  exit;
+ end;
+ if not syn then ecr3('tourner');
+ tfleche;
+ if (anyone) or (iesc) then exit;
+ tcoord(9);
+ if num<> 0 then
+ begin
+  crep:= 997;
+  if (s.mlieu= 13) and (s.ibag= 159) and (s.iboul= 141) then
+  begin
+   repon(2,167);
+   parole(7, 9, 1);
+   quel:= do_alert(stouinon,1);
+   if quel= 1 then solu:= true else crep:= 168;
+  end;
+  if (s.mlieu= 17) and (s.ivier= 143) then
+  begin
+   repon(2, 175);
+   clsf3;
+   parole(6, -9, 1);
+   quel:= do_alert(stouinon,1);
+   if quel= 1 then
+   begin
+    s.mlieu:= 16;
+    affrep;
+   end
+   else crep:= 176;
+  end;
+ end;
+end;
+
+overlay procedure tcacher;
+begin
+ if not syn then ecr3('se cacher');
+ tfleche;
+ if not (anyone) and not (iesc) then
+ begin
+  tcoord(10);
+  if num= 0 then cache:= false else
+  begin
+   cache:= true;
+   crep:= 999;
+  end;
+ end;
+end;
+
+overlay procedure tattacher;
+begin
+ if s.derobj= 0 then crep:= 186 else
+ begin
+  if not syn then ecr3('attacher');
+  tfleche;
+  if not (anyone) and not (iesc) then
+  begin
+   tcoord(8);
+   crep:= 997;
+   if (num<> 0) and (s.mlieu= 24) then
+   begin
+    crep:= 999;
+    if (s.derobj= 120) or (s.derobj= 140) then
+    begin
+     s.ipuit:= s.derobj;
+     aniof(1,1);
+    end
+    else crep:= 185;
+    maivid;
+   end;
+  end;
+ end;
+end;
+
+overlay procedure tfermer;
+var
+ cx,chai: integer;
+begin
+ if not syn then ecr3('fermer');
+ if caff< 26 then
+ begin
+  tfleche;
+  if iesc then crep:= 998;
+  if (anyone) or (iesc) then exit;
+  tcoord(7);
+  if num<> 0 then
+  begin
+   cx:= 0;
+   repeat
+    cx:= cx+ 1;
+   until (cx> 6) or (num= ord(touv[cx]));
+   if num= ord(touv[cx]) then
+   begin
+    aniof(2,num);
+    crep:= 998;
+    touv[cx]:= chr(0);
+    iouv:= iouv- 1;
+    if iouv< 0 then iouv:= 0;
+    chai:= 9999;
+    rechai(chai);
+    if mchai= chai then mchai:= 0;
+   end
+   else crep:= 187;
+  end;
+ end;
+ if caff= 26 then crep:= 999;
+end;
+
+overlay procedure tfrapper;
+var
+ l,p,haz: integer;
+begin
+ if not syn then ecr3('frapper');
+ if s.mlieu= 15 then
+ begin
+  l:= do_alert('[1][ | Avant, utilisez le menu DEP...][ok]',1);
+  exit;
+ end;
+ if s.mlieu< 25 then
+ begin
+  tfleche;
+  if not (anyone) and not (iesc) then
+   if (s.mlieu< 19) and (s.mlieu<> 15) then crep:= 133 else crep:= 997;
+  exit;
+ end;
+ if s.mlieu= 26 then
+ begin
+  haz:= (hazard(0, 8))- 4;
+  parole(11, haz, 1);
+  ecfren(p,haz,s.conf,ment);
+  l:= ment;
+  if l<> 0 then
+   if p<> -500 then
+   begin
+    if haz> p then crep:= 190 else
+    begin
+     becfren(l);
+     frap;
+    end;
+   end
+   else frap;
+  if ment= 8 then crep:= 190;
+ end;
+end;
+
+overlay procedure tposer;
+var
+ cx,chai: integer;
+begin
+ if not syn then ecr3('poser');
+ if s.derobj= 0 then crep:= 186 else
+ begin
+  if caff> 99 then
+  begin
+    crep:= 999;
+    ajchai;
+    if crep<> 192 then maivid;
+    exit;
+  end;
+  tfleche;
+  if (anyone) or (iesc) then exit;
+  tcoord(7);
+  crep:= 124;
+  if num<> 0 then
+  begin
+   rechai(chai);
+   if chai= 0 then crep:= 997 else
+   begin
+    cx:= 0;
+    repeat
+     cx:= cx+ 1;
+    until (cx> 6) or (num= ord(touv[cx]));
+    if num<> ord(touv[cx]) then crep:= 187 else
+    begin
+     mchai:= chai;
+     crep:= 999;
+    end;
+   end;
+  end
+  else
+  begin
+   tcoord(8);
+   if num<> 0 then
+   begin
+    crep:= 998;
+    if caff= 2 then
+     if s.iloic<> 0 then crep:= 188 else s.iloic:= s.derobj;
+    if caff= 13 then
+    begin
+     if num= 1 then
+     begin
+      if s.iboul<> 0 then crep:= 188 else s.iboul:= s.derobj;
+     end
+     else
+      if s.ibag<> 0 then crep:= 188 else s.ibag:= s.derobj;
+    end;
+    if caff= 16 then
+     if s.icryp<> 0 then crep:= 188 else s.icryp:= s.derobj;
+    if caff= 24 then crep:= 185;
+    if (caff= 14) or (caff= 17) then crep:= 124;
+   end
+   else
+   begin
+    crep:= 124;
+    if caff= 24 then
+    begin
+     tcoord(5);
+     if num<> 0 then crep:= 185;
+    end;
+   end;
+  end;
+  if caff= 23 then crep:= 185;
+  if (crep= 999) or (crep= 185) or (crep= 998) then
+  begin
+   if crep= 999 then ajchai;
+   if crep<> 192 then maivid;
+  end;
+ end;
+end;
+
+overlay procedure tecouter;
+var
+ l,p,haz,j,h,m: integer;
+begin
+ if s.mlieu<> 26 then crep:= 101 else
+ begin
+  if ipers<> 0 then s.conf:= s.conf+ 1;
+  ecfren(p,haz,s.conf,ment);
+  l:= ment;
+  if l<> 0 then
+   if p<> -500 then
+   begin
+    if haz> p then crep:= 101 else
+    begin
+     becfren(l);
+     calch(j,h,m);
+     haz:= hazard(1,100);
+     if (h>= 0) and (h< 8) then
+     begin
+      if haz> 30 then crep:= 101 else crep:= 178;
+     end
+     else
+      if haz> 70 then crep:= 101 else crep:= 178;
+    end;
+   end
+   else crep:= 178;
+ end;
+end;
+
+overlay procedure tmanger;
+var
+ j,h,m: integer;
+begin
+ if (s.mlieu> 15) and (s.mlieu< 26) then
+  crep:= 148
+ else
+ begin
+  tsort;
+  s.mlieu:= 10;
+  caff:= 10;
+  debloc(s.mlieu);
+  tmlieu(s.mlieu);
+  calch(j,h,m);
+  if (h= 12) or (h= 13) or (h= 19) then
+  begin
+   s.conf:= s.conf- (s.conf div 7);
+   if h= 12 then
+    if m= 0 then h:= 4 else h:= 3;
+   if (h= 13) or (h= 19) then
+    if m= 0 then h:= 2 else h:= 1;
+   jh:= jh+ h;
+   crep:= 135;
+   tinke;
+  end
+  else crep:= 134;
+ end;
+end;
+
+overlay procedure tentrer;
+var
+ x, z: integer;
+begin
+ if (s.mlieu= 21) or (s.mlieu= 22) then
+ begin
+  t1sama;
+  tmlieu(s.mlieu);
+ end
+ else
+  if s.mlieu= 15 then aldepl else
+   if ment= 0 then crep:= 997 else
+   begin
+    if (ment= 9) and (s.derobj<> 136) then
+    begin
+     crep:= 189;
+     s.teauto[8]:= '*';
+    end
+    else
+    begin
+     if not blo then t11(ment, z);
+     if z<> 0 then
+     begin
+      if (ment= 3) or (ment= 7) then crep:= 179 else
+      begin
+       x:= (hazard(0, 10))- 5;
+       parole(7, x, 1);
+       aniof(1,1);
+{       tkey(5,32000);}
+       tip(z,x);
+       s.conf:= s.conf+ 1;
+       s.mlieu:= 15;
+       msg[3]:= discut;
+       msg[4]:= disc[x];
+       syn:= true;
+       if ment= 9 then
+       begin
+        col:= true;
+        caff:= 70;
+        afdes(0);
+        repon(2,caff);
+       end
+       else col:= false;
+       debloc(ment);
+       ment:= 0;
+      end;
+     end
+     else
+     begin
+      x:= (hazard(0, 10))- 5;
+      parole(7, x, 1);
+      aniof(1,1);
+{      tkey(1,32000);}
+      s.mlieu:= ment;
+      affrep;
+      debloc(s.mlieu);
+      tmlieu(s.mlieu);
+      ment:= 0;
+      mpers:= 0;
+      ipers:= 0;
+     end;
+    end;
+   end;
+end;
+
+overlay procedure tdormir;
+const
+ m1= 'D‚sirez-vous vous r‚veiller?';
+var
+ z,j,h,m,quel: integer;
+begin
+ if (s.mlieu> 15) and (s.mlieu< 26) then
+ begin
+  crep:= 148;
+  exit;
+ end;
+ if s.mlieu <> 0 then
+ begin
+  tsort;
+  s.mlieu:= 0;
+  affrep;
+  afdes(0);
+  debloc(s.mlieu);
+  tmlieu(s.mlieu);
+ end;
+ clsf3;
+ clsf2;
+ ecrf2;
+ ecr2(m1);
+ calch(j,h,m);
+ repeat
+   if h< 8 then
+     begin
+       s.conf:= s.conf- (s.conf div 20);
+       z:= (7- h)* 2;
+       if m= 30 then z:= z- 1;
+       jh:= jh+ z;
+       h:= 7;
+     end;
+   jh:= jh+ 2;
+   h:= h+ 1;
+   if h> 23 then h:= 0;
+   tinke;
+   quel:= do_alert(stouinon,1);
+   anyone:= false;
+ until quel= 1;
+ crep:= 998;
+ num:= 0;
+end;
+
+overlay procedure tdefoncer;
+begin
+ if not syn then ecr3('d‚foncer');
+ if caff< 25 then tfleche;
+ if (not anyone) and (not iesc) then
+    if s.mlieu<> 26 then crep:= 997 else
+   begin
+     crep:= 143;
+     s.conf:= s.conf+ 2;
+   end;
+end;
+
+overlay procedure tsortir;
+var
+ lx: integer;
+begin
+ tsort;
+ crep:= 0;
+ if (s.mlieu= 19) or (s.mlieu= 21) or (s.mlieu= 22)
+ or (s.mlieu= 24) then crep:= 997 else
+ begin
+  if (s.mlieu< 16) or (s.mlieu= 26) then lx:= 10;
+  if (s.mlieu= 10) or (s.mlieu= 20) then lx:= 21;
+  if (s.mlieu< 10) or (s.mlieu= 13) then lx:= 15;
+  if s.mlieu= 16 then
+  begin
+   lx:= 17;
+   crep:= 176;
+  end;
+  if s.mlieu= 17 then t23coul(lx);
+  if s.mlieu= 23 then lx:= 24;
+  if crep<> 997 then s.mlieu:= lx;
+  caff:= lx;
+  if crep= 0 then crep:= lx;
+  debloc(lx);
+  tmlieu(lx);
+ end;
+end;
+
+overlay procedure tattendre;
+var
+ quel: integer;
+begin
+ mpers:= 0;
+ clsf3;
+ repeat
+   jh:= jh+ 1;
+   tinke;
+   if not blo then t11(s.mlieu, quel);
+   if (ipers<> 0) and (mpers= 0) then
+   begin
+     crep:= 998;
+     if (s.mlieu= 13) or (s.mlieu= 14) then cavegre;
+     if (s.mlieu> 0) and (s.mlieu< 10) then anyone:= true;
+     mpers:= ipers;
+     if not anyone then tinke;
+     exit;
+   end;
+   repon(2,102);
+   quel:= do_alert(stouinon,1);
+ until quel= 2;
+ crep:= 998;
+ if not anyone then tinke;
+end;
+
+overlay procedure tsonder;
+begin
+ if not syn then ecr3('sonder');
+ if caff< 27 then
+ begin
+  tfleche;
+  if not (anyone) and (not iesc) then crep:= 145;
+  num:= 0;
+ end;
+end;
+
+overlay procedure tparler;
+
+var
+                               te : array[1..46] of boolean;
+       ix, cy, cx, max, haz, suj, co,lig,icm,
+            i, tay, choi, x, y, c : integer;
+                              tou : char;
+                              lib : array[1..46] of string[40];
+                               st : phrase;
+                                f : boolean;
+
+
+begin
+ finfouil;
+ if col then suj:= 128 else
+  begin
+    cx:= 0;
+    repeat
+      cx:= cx+ 1;
+    until disc[cx]= msg[4];
+    caff:= 69+ cx;
+    afdes(0);
+    repon(2,caff);
+    suj:= caff+ 60;
+  end;
+ tkey1(false);
+ mennor;
+ hide_mouse;
+ hirs;
+ premtet;
+ sparl(0,suj);
+ hirs;
+ for ix:= 1 to 46 do te[ix]:= false;
+ for ix:=1 to 45 do
+     begin
+       DeLine(ix+c_tparler,st,tay);
+       lib[ix]:= delig;
+       for i:=tay to 40 do lib[ix]:=lib[ix]+' ';
+     end;
+ lib[46]:=lib[45];
+ lib[45]:=' ';
+ show_mouse;
+ repeat
+   choi:= 0;
+   icm:= 0;
+   co:= 0;
+   lig:= 0;
+   repeat
+     icm:= succ( icm );
+     putxy(co,lig);
+     if (s.teauto[icm]='*') then
+     if (te[icm]) then writetp(lib[icm],1)
+                  else writetp(lib[icm],0);
+     if icm=23 then begin
+                      lig:= 0;
+                      co:= 320;
+                    end
+               else lig:= lig + 8;
+   until icm=42;
+   putxy(320,176);
+   writetp(lib[46],0);
+   tou:= #0;
+   repeat
+     mov_mouse(f,tou);
+(*     if keypressed then read(kbd,tou);*)
+     read_pos_mouse(x,y,c);
+     x:= x *(3-res);
+     if x>319 then cx:= 41 else cx:= 1;
+     cy:= succ(y shr 3);                    { 0-199 => 1-25 }
+     if (cy>23) or ((cx=41) and (cy in [20..22])) then
+             begin
+               if choi<>0 then
+                  begin
+                    lig:= ((choi-1) mod 23) shl 3 ;
+                    if choi>23 then co:= 320 else co:= 0;
+                    putxy(co,lig);
+                    if te[choi] then writetp(lib[choi],0)
+                                else writetp(lib[choi],1);
+                    te[choi]:= not te[choi];
+                    choi:= 0;
+                  end;
+             end
+        else begin
+               ix:= cy;
+               if cx=41 then ix:= ix+23;
+               if ix<>choi then
+                  begin
+                    if choi<>0 then
+                       begin
+                         lig:= ((choi-1) mod 23) shl 3 ;
+                         if choi>23 then co:= 320 else co:= 0;
+                         putxy(co,lig);
+                         if te[choi] then writetp(lib[choi],0)
+                                     else writetp(lib[choi],1);
+                         te[choi]:= not te[choi];
+                       end;
+                    if (s.teauto[ix]='*') or (ix=46) then
+                       begin
+                         lig:= ((ix-1) mod 23) shl 3 ;
+                         if ix>23 then co:= 320 else co:= 0;
+                         putxy(co,lig);
+                         if te[ix] then writetp(lib[ix],0)
+                                   else writetp(lib[ix],1);
+                         te[ix]:= not te[ix];
+                         choi:= ix;
+                       end
+                      else choi:= 0;
+                  end;
+             end;
+   until (tou=#13) or ( ((c<>0) or clic) and (choi<>0));
+   clic:=false;
+   if choi<>46 then
+      begin
+        ix:= choi-1;
+        if col then
+           begin
+             col:= false;
+             s.mlieu:= 15;
+             if iouv> 0 then max:= 8 else max:= 4;
+             haz:= hazard(1,max);
+             if haz= 2 then suj:= 129 else
+                begin
+                  suj:= 138;
+                  s.conf:= s.conf+ (3* (s.conf div 10));
+                end;
+           end
+          else
+           if nbrep[caff- 69]< nbrepm[caff- 69] then
+           begin
+             suj:= tabdon[arep+ (ix shl 3)+ (caff- 70)];
+             s.conf:= s.conf+ tabdon[arcf+ ix];
+             nbrep[caff- 69]:= nbrep[caff- 69]+ 1;
+           end
+          else
+           begin
+             s.conf:= s.conf+ 3;
+             suj:= 139;
+           end;
+        hide_mouse;
+        hirs;
+        premtet;
+        sparl(0, suj);
+        show_mouse;
+        if (suj= 84) or (suj= 86) then
+           begin
+             s.pourc[5]:= '*';
+             s.teauto[7]:= '*';
+           end;
+        if (suj= 106) or (suj= 108) or (suj= 94) then
+           begin
+             for ix:= 29 to 31 do s.teauto[ix]:= '*';
+             s.pourc[7]:= '*';
+           end;
+        if suj= 70 then
+           begin
+             s.pourc[8]:= '*';
+             s.teauto[32]:= '*';
+           end;
+        hide_mouse;
+        hirs;
+        show_mouse;
+      end;
+    until (choi= 46) or (suj= 138);
+ if col then
+ begin
+  s.conf:= s.conf+ (3* (s.conf div 10));
+  hide_mouse;
+  hirs;
+  premtet;
+  sparl(0, 138);
+  show_mouse;
+  col:= false;
+  s.mlieu:= 15;
+ end;
+ ctrm:= 0;
+ hide_mouse;
+ hirs;
+ dessine_rouleau;
+ show_mouse;
+ affper(ipers);
+ tinke;
+ pendule;
+ affrep;
+(* chech;*)
+ tmlieu(s.mlieu);
+ clsf3;
+end;
+
+overlay procedure tsentir;
+begin
+ crep:= 119;
+ if caff< 26 then
+ begin
+  if not syn then ecr3('sentir');
+  tfleche;
+  if not (anyone) and not (iesc) then
+   if caff= 16 then crep:= 153;
+ end
+ else
+ if caff= 123 then crep:= 110;
+ num:= 0;
+end;
+
+overlay procedure tgratter;
+begin
+ crep:= 155;
+ if caff< 27 then
+ begin
+  if not syn then ecr3('gratter');
+  tfleche;
+ end;
+ num:= 0;
+end;
+
+(* NIVEAU 2 *)
+overlay procedure tmaj1;         { Le jeu est termin‚ !!! }
+begin
+ arret:= true;
+ tlu(13,152);
+ maivid;
+ clsf1;
+ clsf2;
+ clsf3;
+ repon(9,1509);
+ tkey1(false);
+ hide_mouse;
+ caff:= 70;
+ taffich;
+ hirs;
+ premtet;
+ sparl(0,141);
+ show_mouse;
+ clsf1;
+ repon(9,1509);
+ repon(2,142);
+ tkey1(false);
+ caff:= 32;
+ afdes(0);
+ repon(6,34);
+ repon(2,35);
+ musique(0);
+ tkey1(false);
+ messint(2036);
+ tkey1(false);
+ inzon;
+end;
+
+overlay procedure tencore;       { Perdu !!! }
+var
+ quel: integer;
+begin
+ clsf2;
+ musique(0);
+ tkey1(false);
+ maivid;
+ inzon;
+ dprog;
+ vh:= 10;
+ vm:= 0;
+ vj:= 0;
+ min:= 0;
+ heu:= 10;
+ jou:= 0;
+ repon(2,180);
+ quel:= do_alert(stouinon,1);
+ arret:= (quel<>1);
+end;
diff --git a/engines/mortevielle/original/0/AFF.COM b/engines/mortevielle/original/0/AFF.COM
new file mode 100644
index 0000000..d64d397
Binary files /dev/null and b/engines/mortevielle/original/0/AFF.COM differ
diff --git a/engines/mortevielle/original/0/AFFAMS.COM b/engines/mortevielle/original/0/AFFAMS.COM
new file mode 100644
index 0000000..577fd5a
Binary files /dev/null and b/engines/mortevielle/original/0/AFFAMS.COM differ
diff --git a/engines/mortevielle/original/0/AFFEGA.COM b/engines/mortevielle/original/0/AFFEGA.COM
new file mode 100644
index 0000000..6fd86b9
Binary files /dev/null and b/engines/mortevielle/original/0/AFFEGA.COM differ
diff --git a/engines/mortevielle/original/0/AFFHER.COM b/engines/mortevielle/original/0/AFFHER.COM
new file mode 100644
index 0000000..9f7be45
Binary files /dev/null and b/engines/mortevielle/original/0/AFFHER.COM differ
diff --git a/engines/mortevielle/original/0/AFFICH.COM b/engines/mortevielle/original/0/AFFICH.COM
new file mode 100644
index 0000000..22085db
Binary files /dev/null and b/engines/mortevielle/original/0/AFFICH.COM differ
diff --git a/engines/mortevielle/original/0/AFFTAN.COM b/engines/mortevielle/original/0/AFFTAN.COM
new file mode 100644
index 0000000..ac01221
Binary files /dev/null and b/engines/mortevielle/original/0/AFFTAN.COM differ
diff --git a/engines/mortevielle/original/0/ALERT.PAS b/engines/mortevielle/original/0/ALERT.PAS
new file mode 100644
index 0000000..6c0ba60
--- /dev/null
+++ b/engines/mortevielle/original/0/ALERT.PAS
@@ -0,0 +1,197 @@
+overlay function do_alert(str:str255; n:integer):integer;
+
+   const nligne=7;
+         coord: array[1..2,1..3] of integer
+               =( (150, 72, 103),
+                  (143, 107, 183) );
+   var coldep,esp,i,l,nbcase,quoi,ix:integer;
+       st, chaine:str255;
+       Limit: array[1..2,1..2]  of integer;
+       c,dumi:char;
+       s:array[1..2] of string[3];
+       cx,cy,cd,nbcol,nblig:integer;
+       touch,newaff,test,test1,test2,test3,dum : boolean;
+       cas : str30;
+
+     procedure decod(s:str255; var nbc,nbl,col : integer; var c : str255; var cs:str30);
+           var i,k : integer;
+               v : boolean;
+         begin
+           val(s[2],nbc,i);
+           c:= '';
+           nbl:= 0; i:= 5; k:= 0;
+           v:=True; col:=0;
+
+           while s[i]<>']' do
+             begin
+               c:=c+s[i];
+               if (s[i]='|') or (s[i+1]=']') then
+                  begin
+                    if k>col then col:=k;
+                    k:= 0;
+                    nbl:=nbl+1;
+                  end
+                else if s[i]<>' ' then v:=False;
+               i:=i+1;
+               k:=k+1;
+             end;
+           if v then begin
+                       c:='';
+                       col:=20;
+                     end
+                else begin
+                       c:=c+']';
+                       col:=col+6;
+                     end;
+           i:=i+1;
+           cs:=copy(s,i,30);
+           if res=2 then col:= col*6
+                    else col:= col*10;
+         end;
+
+     procedure posit(ji:integer);
+        begin
+          putxy(coldep + (40+esp) *pred(ji),98);
+        end;
+
+     procedure fait_boite(lidep,nli,tx:integer);
+          var x,y,xx,yy:integer;
+        begin
+          if tx>640 then tx:=640;
+          x:= 320- tx shr 1;
+          y:=pred(lidep) shl 3;
+          xx:=x+ tx;
+          yy:=y + nli shl 3;
+          box(15,Gd,x,y,xx,yy,255);
+          box(0,Gd,x,y+2,xx,y+4,255);
+          box(0,Gd,x,yy-4,xx,yy-2,255);
+        end;
+
+     procedure fait_choix(c:str30);
+          var i,l,x:integer;
+              ch:char;
+        begin
+          i:=1;
+          x:=coldep;
+          for l:=1 to nbcase do
+            begin
+              s[l]:='';
+              repeat
+                i:=i+1;
+                ch:=c[i];
+                s[l]:=s[l]+ch;
+              until c[i+1]=']';
+              i:=i+2;
+              while length(s[l])<3 do s[l]:=s[l]+' ';
+              putxy(x,98);
+              writeg(' '+s[l]+' ',0);
+              x:= x+esp+40;
+            end;
+        end;
+
+begin
+  (*debug('** do_alert **');*)
+  hide_mouse;
+  while keypressed do read(kbd,dumi);
+  clic:=false;
+  decod(str,nbcase,nblig,nbcol,chaine,cas);
+  sauvecr(50,succ(nligne) shl 4);
+
+  i:=0;
+  if chaine='' then
+    begin
+      fait_boite(10,5,nbcol);
+    end
+   else
+    begin
+      fait_boite(8,7,nbcol);
+      i:=0;
+      ywhere:=70;
+      repeat
+        cx:= 320;
+        st:= '';
+        while not (chaine[i+1] in [#124,#93]) do
+          begin
+            i:=i+1;
+            st:=st+chaine[i];
+            if res=2 then cx:=cx-3
+                     else cx:=cx-5;
+          end;
+        putxy(cx,ywhere);
+        ywhere:=ywhere+6;
+        writeg(st,4);
+        i:=i+1;
+      until chaine[i]=']';
+    end;
+  if nbcase=1 then esp:= nbcol- 40
+              else esp:= (nbcol-nbcase*40) shr 1;
+  coldep:=320-nbcol shr 1+esp shr 1;
+  fait_choix(cas);
+  limit[1,1]:=(coldep) shr 1*res;
+  limit[1,2]:=limit[1,1]+40;
+  if nbcase=1 then
+     begin
+       limit[2,1]:=limit[2,2];
+     end
+   else
+     begin
+       limit[2,1]:=(320+esp shr 1) shr 1*res;
+       limit[2,2]:=(limit[2,1])+40;
+     end;
+  show_mouse;
+  quoi:=0;
+  dum:=false;
+  repeat
+    dumi:=#255;
+    mov_mouse(dum,dumi);
+    cx:= X_S;
+    cy:= Y_S;
+    test:=(cy>95) and (cy<105);
+    newaff:=false;
+    if test then
+     begin
+       test1:=(cx>limit[1,1]) and (cx<limit[1,2]);
+       test2:=test1;
+       if nbcase>1 then test2:= test1 or ((cx>limit[2,1]) and (cx<limit[2,2]));
+       if test2 then
+        begin
+          newaff:=true;
+          if test1 then ix:=1
+                   else ix:=2;
+          if (ix<>quoi)  then
+           begin
+             hide_mouse;
+             if quoi<>0 then
+              begin
+                posit(quoi);
+                writeg(' '+s[quoi]+' ',0);
+              end;
+             posit(ix);
+             writeg(' '+s[ix]+' ',1);
+             quoi:=ix;
+             show_mouse;
+           end;
+        end;
+     end;
+    if (quoi<>0) and not newaff then
+     begin
+       hide_mouse;
+       posit(quoi);
+       writeg(' '+s[quoi]+' ',0);
+       quoi:=0;
+       show_mouse;
+     end;
+     test3:=(cy>95) and (cy<105) and (((cx>limit[1,1]) and (cx<limit[1,2]))
+                                   or ((cx>limit[2,1]) and (cx<limit[2,2])));
+  until clic;
+  clic:=false;
+  hide_mouse;
+  if not test3 then begin
+                  quoi:=n;
+                  posit(n);
+                  writeg(' '+s[n]+' ',1);
+                end;
+  charecr(50,succ(nligne) shl 4);
+  show_mouse;
+  do_alert:=quoi;
+end;
diff --git a/engines/mortevielle/original/0/AS.PAS b/engines/mortevielle/original/0/AS.PAS
new file mode 100644
index 0000000..cd407e1
--- /dev/null
+++ b/engines/mortevielle/original/0/AS.PAS
@@ -0,0 +1,17 @@
+(*---------------------------------------------------------------------------*)
+(*--------------------   PROCEDURES  EN  ASSEMBLEUR   -----------------------*)
+(*---------------------------------------------------------------------------*)
+
+procedure decomp(seg,dep:integer); external 'c:\mc\decomp.com';
+(* procedure affams(seg,dep,x,y:integer); external 'c:\mc\affams.com';
+ procedure affcga(seg,dep,x,y:integer); external 'c:\mc\cga.com';
+ procedure affega(seg,dep,x,y:integer); external 'c:\mc\affega.com';
+ procedure affher(seg,dep,x,y:integer); external 'c:\mc\affher.com';
+ procedure afftan(seg,dep,x,y:integer); external 'c:\mc\afftan.com';*)
+procedure afff(Gd,seg,dep,x,y:integer); external 'c:\mc\affich.com';
+procedure S_sauv(Gd,y,dy:integer);  external 'c:\mc\sauvecr.com';
+procedure S_char(Gd,y,dy:integer);  external 'c:\mc\charecr.com';
+procedure musyc(tb:tablint;nbseg,att:integer);  external 'c:\mc\reusint.com';
+procedure litph(t:tablint;typ,tempo:integer); external 'c:\mc\phint.com';
+procedure demus(Src, Dst, Tay : integer); external 'c:\mc\demus.com';
+procedure zzuul(ad,seg,tai:integer); external 'c:\mc\zuul.com';
diff --git a/engines/mortevielle/original/0/AXX.MOR b/engines/mortevielle/original/0/AXX.MOR
new file mode 100644
index 0000000..81954bd
Binary files /dev/null and b/engines/mortevielle/original/0/AXX.MOR differ
diff --git a/engines/mortevielle/original/0/AZZ.MOR b/engines/mortevielle/original/0/AZZ.MOR
new file mode 100644
index 0000000..55088f3
Binary files /dev/null and b/engines/mortevielle/original/0/AZZ.MOR differ
diff --git a/engines/mortevielle/original/0/BMOR.MOR b/engines/mortevielle/original/0/BMOR.MOR
new file mode 100644
index 0000000..51f3378
Binary files /dev/null and b/engines/mortevielle/original/0/BMOR.MOR differ
diff --git a/engines/mortevielle/original/0/BOITE.COM b/engines/mortevielle/original/0/BOITE.COM
new file mode 100644
index 0000000..e274143
Binary files /dev/null and b/engines/mortevielle/original/0/BOITE.COM differ
diff --git a/engines/mortevielle/original/0/BOITE.PAS b/engines/mortevielle/original/0/BOITE.PAS
new file mode 100644
index 0000000..d472de6
--- /dev/null
+++ b/engines/mortevielle/original/0/BOITE.PAS
@@ -0,0 +1,29 @@
+procedure boite(x,y,dx,dy,coul : integer);
+   var i : integer;
+      xi,yi,xo,yo : integer;
+ begin
+   (* debug('boite'); *)
+   hide_mouse;
+   if res=1 then
+      begin
+        x:= x shr 1;
+        dx:= dx shr 1;
+      end;
+   xi:=x; yi:=y; xo:=x; yo:=y;
+   for i:=0 to dx+dy do
+      begin
+        putpix(Gd,xi,yi,coul);
+        if xi=x+dx then begin
+                          if Gd<>cga then putpix(Gd,pred(xi),yi,coul);
+                          yi:=succ(yi);
+                        end
+                   else xi:=succ(xi);
+        putpix(Gd,xo,yo,coul);
+        if yo=y+dy then xo:=succ(xo)
+                   else begin
+                          if Gd<>cga then putpix(Gd,succ(xo),yo,coul);
+                          yo:=succ(yo);
+                        end;
+      end;
+   show_mouse;
+ end;
diff --git a/engines/mortevielle/original/0/BRUIT5 b/engines/mortevielle/original/0/BRUIT5
new file mode 100644
index 0000000..129a1b0
Binary files /dev/null and b/engines/mortevielle/original/0/BRUIT5 differ
diff --git a/engines/mortevielle/original/0/BRUITS b/engines/mortevielle/original/0/BRUITS
new file mode 100644
index 0000000..de1a5bb
Binary files /dev/null and b/engines/mortevielle/original/0/BRUITS differ
diff --git a/engines/mortevielle/original/0/CFIEC.MOR b/engines/mortevielle/original/0/CFIEC.MOR
new file mode 100644
index 0000000..2038c7c
Binary files /dev/null and b/engines/mortevielle/original/0/CFIEC.MOR differ
diff --git a/engines/mortevielle/original/0/CFIPH.MOR b/engines/mortevielle/original/0/CFIPH.MOR
new file mode 100644
index 0000000..a1493e8
Binary files /dev/null and b/engines/mortevielle/original/0/CFIPH.MOR differ
diff --git a/engines/mortevielle/original/0/CGA.COM b/engines/mortevielle/original/0/CGA.COM
new file mode 100644
index 0000000..5ed874a
Binary files /dev/null and b/engines/mortevielle/original/0/CGA.COM differ
diff --git a/engines/mortevielle/original/0/CHARDES.COM b/engines/mortevielle/original/0/CHARDES.COM
new file mode 100644
index 0000000..252d639
Binary files /dev/null and b/engines/mortevielle/original/0/CHARDES.COM differ
diff --git a/engines/mortevielle/original/0/CHARECR.COM b/engines/mortevielle/original/0/CHARECR.COM
new file mode 100644
index 0000000..6cb6bcf
Binary files /dev/null and b/engines/mortevielle/original/0/CHARECR.COM differ
diff --git a/engines/mortevielle/original/0/CXX.MOR b/engines/mortevielle/original/0/CXX.MOR
new file mode 100644
index 0000000..df5d947
Binary files /dev/null and b/engines/mortevielle/original/0/CXX.MOR differ
diff --git a/engines/mortevielle/original/0/DEBUG.PAS b/engines/mortevielle/original/0/DEBUG.PAS
new file mode 100644
index 0000000..509549a
--- /dev/null
+++ b/engines/mortevielle/original/0/DEBUG.PAS
@@ -0,0 +1,22 @@
+type str79 = string[79];
+
+var le_file : text;
+
+procedure init_debug;
+begin
+(* assign(le_file,'c:\usr\mort\temoin.mor');
+ rewrite(le_file);*)
+end;
+
+procedure out_debug;
+begin
+(*  close(le_file);*)
+end;
+
+procedure debug(l : str79);
+begin
+  (*port[$3DD]:=15;
+  gotoxy(1,10);
+  write(l);
+  writeln(le_file,l);*)
+end;
diff --git a/engines/mortevielle/original/0/DEC.MOR b/engines/mortevielle/original/0/DEC.MOR
new file mode 100644
index 0000000..01d5913
Binary files /dev/null and b/engines/mortevielle/original/0/DEC.MOR differ
diff --git a/engines/mortevielle/original/0/DECOMP.COM b/engines/mortevielle/original/0/DECOMP.COM
new file mode 100644
index 0000000..4489ceb
Binary files /dev/null and b/engines/mortevielle/original/0/DECOMP.COM differ
diff --git a/engines/mortevielle/original/0/DECPASP.COM b/engines/mortevielle/original/0/DECPASP.COM
new file mode 100644
index 0000000..326c26f
Binary files /dev/null and b/engines/mortevielle/original/0/DECPASP.COM differ
diff --git a/engines/mortevielle/original/0/DEMUS.COM b/engines/mortevielle/original/0/DEMUS.COM
new file mode 100644
index 0000000..97c1c6f
Binary files /dev/null and b/engines/mortevielle/original/0/DEMUS.COM differ
diff --git a/engines/mortevielle/original/0/DEMUS2.COM b/engines/mortevielle/original/0/DEMUS2.COM
new file mode 100644
index 0000000..97c1c6f
Binary files /dev/null and b/engines/mortevielle/original/0/DEMUS2.COM differ
diff --git a/engines/mortevielle/original/0/DETECT.PAS b/engines/mortevielle/original/0/DETECT.PAS
new file mode 100644
index 0000000..ec90368
--- /dev/null
+++ b/engines/mortevielle/original/0/DETECT.PAS
@@ -0,0 +1,19 @@
+function detect:integer;
+  const s:string[10]='1986 Amstr';
+  var i : integer;
+
+begin
+  Gd:=ega;
+  hirs;
+  mem[$a000:15920]:=37;
+  if mem[$a000:15920]<>37 then
+     begin
+       clrscr;
+       i:=1;
+       while (i<10) and (s[i]=chr(mem[$fc01:i])) do
+            i:=i+1;
+       if i>8 then Gd:=ams
+              else Gd:=cga;
+     end;
+  detect:=Gd
+end;
diff --git a/engines/mortevielle/original/0/DISK.PAS b/engines/mortevielle/original/0/DISK.PAS
new file mode 100644
index 0000000..22d7419
--- /dev/null
+++ b/engines/mortevielle/original/0/DISK.PAS
@@ -0,0 +1,77 @@
+
+procedure dem1;
+  var f:file;
+      k : integer;
+begin
+  { -- demande de disk 1 -- }
+  assign(f,'mort.005');
+  {$i-}
+  k:=ioresult;
+  reset(f);
+  while ioresult<>0 do
+   begin
+    show_mouse;
+    k:= do_alert(al_mess,1);
+    hide_mouse;
+    reset(f);
+   end;
+  close(f);
+end;
+
+procedure takesav(n:integer);
+  var   f : file;
+        i : integer;
+       st : string[10];
+begin
+  dem1;
+  { -- chargement du fichier 'sauve#n.mor' -- }
+  st:= 'sav'+chr(n+48)+'.mor';
+  assign(f,st);
+  reset(f,497);
+  blockread(f,s1,1);
+  if ioresult<>0 then
+     begin
+       i:=do_alert(err_mess,1);
+       halt;
+     end;
+  s:=s1;
+  for i:=0 to 389 do tabdon[i+acha]:=bufcha[i];
+  close(f);
+end;
+
+procedure ld_game;
+begin
+  hide_mouse;
+  maivid;
+  takesav(n);
+  { -- disquette 2 -- }
+  dem2;
+  { -- mises en place -- }
+  theure;
+  dprog;
+  antegame;
+  show_mouse;
+end;
+
+procedure sv_game;
+  var   f : file;
+        i : integer;
+begin
+  hide_mouse;
+  tmaj3;
+  dem1;
+  { -- sauvegarde du fichier 'sauve#n.mor' -- }
+  for i:=0 to 389 do bufcha[i]:=tabdon[i+acha];
+  s1:=s;
+  if s1.mlieu= 26 then s1.mlieu:= 15;
+  assign(f,'sav'+chr(n+48)+'.mor');
+  rewrite(f,497);
+  blockwrite(f,s1,1);
+  close(f);
+  dem2;
+  show_mouse;
+end;
+
+
+
+
diff --git a/engines/mortevielle/original/0/DIVAF.COM b/engines/mortevielle/original/0/DIVAF.COM
new file mode 100644
index 0000000..dc61b0c
Binary files /dev/null and b/engines/mortevielle/original/0/DIVAF.COM differ
diff --git a/engines/mortevielle/original/0/DON.MOR b/engines/mortevielle/original/0/DON.MOR
new file mode 100644
index 0000000..52c55b6
Binary files /dev/null and b/engines/mortevielle/original/0/DON.MOR differ
diff --git a/engines/mortevielle/original/0/DROITE.PAS b/engines/mortevielle/original/0/DROITE.PAS
new file mode 100644
index 0000000..9e44e6c
--- /dev/null
+++ b/engines/mortevielle/original/0/DROITE.PAS
@@ -0,0 +1,35 @@
+procedure droite( x, y, xx, yy, coul : integer );
+      var
+         step,i : integer;
+         a,b : real;
+         xr,yr,xro,yro : real;
+   begin
+     xr:=x; yr:=y; xro:=xx; yro:=yy;
+     (*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*)
+     if abs(y-yy) > abs(x-xx) then
+        begin
+          a:= (x-xx) / (y-yy);
+          b:= ( yr*xro - yro*xr) / (y-yy);
+          i:=y;
+          if y>yy then step:=-1
+                  else step:=1;
+          repeat
+            putpix(Gd, trunc(a*i+b), i, coul);
+            i:=i+step;
+          until i=yy;
+          (*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*)
+        end
+      else
+        begin
+          a:= (y-yy) / (x-xx);
+          b:= ((yro*xr) - (yr*xro)) / (x-xx);
+          i:=x;
+          if x>xx then step:=-1
+                  else step:=1;
+          repeat
+            putpix(Gd,i, trunc(a*i+b), coul);
+            i:=i+step;
+          until i=xx;
+          (*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*)
+        end;
+   end;
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/DXX.MOR b/engines/mortevielle/original/0/DXX.MOR
new file mode 100644
index 0000000..cc8f845
Binary files /dev/null and b/engines/mortevielle/original/0/DXX.MOR differ
diff --git a/engines/mortevielle/original/0/DZZ.MOR b/engines/mortevielle/original/0/DZZ.MOR
new file mode 100644
index 0000000..0b1df4e
Binary files /dev/null and b/engines/mortevielle/original/0/DZZ.MOR differ
diff --git a/engines/mortevielle/original/0/ECRIHEXA.PAS b/engines/mortevielle/original/0/ECRIHEXA.PAS
new file mode 100644
index 0000000..786d30a
--- /dev/null
+++ b/engines/mortevielle/original/0/ECRIHEXA.PAS
@@ -0,0 +1,29 @@
+procedure ecri1hexa(y:integer);
+begin
+  if y in [0..9] then write(y)
+                 else write(chr(y+55));
+end;
+
+
+procedure ecri_int(x:integer);
+begin
+  ecri1hexa(x shr 12);
+  ecri1hexa((x shr 8) mod 16);
+  ecri1hexa((x shr 4) mod 16);
+  ecri1hexa(x mod 16);
+end;
+
+procedure ecri_seg;
+  var c:char;
+begin
+  write('Segment programme => $');
+  ecri_int(Cseg);
+  writeln;
+  write('Segment donnees   => $');
+  ecri_int(Dseg);
+  writeln;
+  write('Segment pile      => $');
+  ecri_int(Sseg);
+  writeln;
+  read(kbd,c);
+end;
diff --git a/engines/mortevielle/original/0/FXX.MOR b/engines/mortevielle/original/0/FXX.MOR
new file mode 100644
index 0000000..f8f47bb
Binary files /dev/null and b/engines/mortevielle/original/0/FXX.MOR differ
diff --git a/engines/mortevielle/original/0/KEYBOARD.PAS b/engines/mortevielle/original/0/KEYBOARD.PAS
new file mode 100644
index 0000000..0fbd885
--- /dev/null
+++ b/engines/mortevielle/original/0/KEYBOARD.PAS
@@ -0,0 +1,48 @@
+function readkey : char;
+   var c : char;
+  begin
+    read(kbd,c);
+    readkey:= c;
+  end;
+
+function testou: integer;
+    var ch:char;
+  begin
+    read(kbd,ch);
+    case  ch  of
+              #19 : sonoff:= not sonoff;
+              #1,
+              #3,
+              #5  : begin
+                      newGd:= pred(ord(ch)) shr 1;
+                      testou:= 61;
+                      exit;
+                    end;
+              #8  : begin
+                      newGd:= Her;
+                      testou:= 61;
+                      exit;
+                    end;
+              #20 : begin
+                      newGd:= Tan;
+                      testou:= 61;
+                      exit;
+                    end;
+              #22 : if (c_zzz in [1,2]) then
+                       begin
+                         zzuul(adcfiec+161,0,1644);
+                         c_zzz:=succ(c_zzz);
+                         testou:=61;
+                         exit;
+                       end;
+              #27 : if keypressed then read(kbd,ch);
+      end;
+    testou:=ord(ch);
+  end;
+
+procedure teskbd;
+    var dum:integer;
+  begin
+    if keypressed then dum:=testou;
+  end;
+
diff --git a/engines/mortevielle/original/0/LEVEL15.PAS b/engines/mortevielle/original/0/LEVEL15.PAS
new file mode 100644
index 0000000..edaf955
--- /dev/null
+++ b/engines/mortevielle/original/0/LEVEL15.PAS
@@ -0,0 +1,176 @@
+
+(* NIVEAU 15 *)
+procedure copcha;
+  var i:integer;
+begin
+  i:= acha;
+  repeat
+    tabdon[i]:=tabdon[i+390];
+    i:=succ(i);
+  until i=acha +390;
+end;
+
+function Dans_rect( R : rectangle ): boolean;
+     var x, y, c : integer;
+   begin
+     read_pos_mouse(x,y,c);
+     with R do
+       if (x>x1) and
+          (x<x2) and
+          (y>y1) and
+          (y<y2) then Dans_rect:= True
+                 else Dans_rect:= False;
+   end;
+
+procedure OutBloc(n : integer; p : pattern; pal:t_nhom);
+     var i,j,ad : integer;
+   begin
+     ad:=n*404+$D700;
+     with p do
+       begin
+         memw[$6000:ad]:= tax;
+         memw[$6000:ad+2]:= tay;
+         ad:=ad+4;
+         for i:=1 to tax do
+           for j:=1 to tay do
+             mem[$6000:ad+pred(j)*tax+pred(i)]:= pal[n].hom[des[i,j]];
+       end;
+   end;
+
+
+procedure writepal(n:integer);
+   var   i : integer;
+       pal : t_nhom;
+
+ begin
+   case Gd of
+           tan,
+           ega,
+           ams : for i:=1 to 16 do
+                   begin
+                     mem[$7000:2*i]:= Tabpal[n,i].x;
+                     mem[$7000:succ(2*i)]:= Tabpal[n,i].y;
+                   end;
+           cga : begin
+                   pal:= palcga[n].a;
+                   if (n<89) then palette(palcga[n].p);
+                   for i:=0 to 15 do OutBloc(i, tpt[Pal[i].n],pal);
+                 end;
+   end;
+ end;
+
+
+procedure PictOut(seg,dep,x,y:integer);
+   begin
+     decomp(seg,dep);
+     if Gd=Her then
+        begin
+          mem[$7000:2]:=0;
+          mem[$7000:32]:=15;
+        end;
+     if (caff<>51) and (memw[$7000:$4138]>$100) then memw[$7000:$4138]:=$100;
+     afff(Gd,seg,dep,x,y);
+   end;
+
+procedure putxy(x,y:integer);
+begin
+  xwhere:=x;
+  ywhere:=y;
+end;
+(*
+function calad(x,y:integer):integer;
+   begin
+     calad:=pred(x)+320*pred(y)
+   end;
+  *)
+procedure sauvecr(y,dy:integer);
+  begin
+    hide_mouse;
+    S_sauv(Gd,y,dy);
+    show_mouse;
+  end;
+
+procedure charecr(y,dy:integer);
+  begin
+    hide_mouse;
+    S_char(Gd,y,dy);
+    show_mouse;
+  end;
+(*
+function peek(ad:integer):integer;
+begin
+  peek:=tabdon[ad];
+end;
+
+function peekw(ad:integer):integer;
+begin
+  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
+end;
+
+function peekl(ad:integer):real;
+begin
+  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
+end;
+
+
+procedure poke (ad,n:integer);
+begin
+  tabdon[ad]:=lo(n);
+end;
+  *)
+
+procedure adzon;
+     var f:file;
+         g:file of byte;
+         a:byte;
+         i:integer;
+   begin
+     assign(f,'don.mor');
+     reset(f,256);
+     blockread(f,tabdon,7);
+     close(f);
+     assign(f,'bmor.mor');
+     reset(f,1916);
+     blockread(f,tabdon[fleche],1);
+     (*i:=fleche;
+     repeat
+       read(g,a);
+       tabdon[i]:=a;
+       i:=succ(i);
+     until i=fleche + 1916;*)
+     close(f);
+     assign(f,'dec.mor');
+     reset(f,1664);
+     blockread(f,mem[$73A2:0],1);
+     (*i:=0;
+     repeat
+       read(g,a);
+       mem[$73A2:i]:=a;
+       i:=succ(i);
+     until eof(g);*)
+     close(f);
+   end;
+
+function animof (ouf,num:integer):integer;
+     var nani, aux : integer;
+   begin
+     nani:= mem[adani:1];
+     aux:= num;
+     if ouf<>1 then aux:= aux+nani;
+     animof:=nani shl 2 + 2+swap(memw[adani: aux shl 1]);
+     (*aux:= nani shl 2 + 2;
+     if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
+              else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
+     animof:=aux;*)
+   end;
+
+(*procedure affgd(offs,dep,x,y:integer);
+begin
+  case Gd of
+     Ams : affams(offs,dep,x,y);
+     Cga : affcga(offs,dep,x,y);
+     Ega : affega(offs,dep,x,y);
+     Her : affher(offs,dep,x,y);
+     Tan : afftan(offs,dep,x,y);
+  end;
+end;*)
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/LITPH4.COM b/engines/mortevielle/original/0/LITPH4.COM
new file mode 100644
index 0000000..f374940
Binary files /dev/null and b/engines/mortevielle/original/0/LITPH4.COM differ
diff --git a/engines/mortevielle/original/0/MENU.PAS b/engines/mortevielle/original/0/MENU.PAS
new file mode 100644
index 0000000..4323898
--- /dev/null
+++ b/engines/mortevielle/original/0/MENU.PAS
@@ -0,0 +1,294 @@
+(* NIVEAU 14*)
+
+overlay procedure menut(no : integer; nom: str30);
+     var h,l:byte;
+         s:str30;
+
+   begin
+     (* debug('menut'); *)
+     h:=hi(no);
+     l:=lo(no);
+     s:=nom;
+     if not tesok then
+        begin
+          clrscr;
+          halt;
+        end;
+     while length(s)<30 do s:=s+' ';
+     case h of
+           invent  :  if l<>7 then inv[l]:= ' '+s;
+           depla   :  dep[l]:= s;
+           action  :  act[l]:= s;
+           saction :  self[l]:= s;
+           discut  :  dis[l]:= s;
+        end;
+  end;
+
+overlay procedure menu_disable(no:integer);
+     var h,l:byte;
+   begin
+     (* debug('menu_disable'); *)
+     h:=hi(no);
+     l:=lo(no);
+     case h of
+           invent : begin
+                 if l>6 then begin
+                               inv[l][1]:='<';
+                               inv[l][22]:='>';
+                             end
+                        else inv[l][1]:='*';
+               end;
+           depla : dep[l][1]:='*';
+           action : act[l][1]:='*';
+           saction : self[l][1]:='*';
+           discut : dis[l][1]:='*';
+        end;
+   end;
+
+overlay procedure menu_enable(no:integer);
+     var h,l:byte;
+   begin
+     (* debug('menu_disable'); *)
+     h:=hi(no);
+     l:=lo(no);
+     case h of
+           invent : begin
+                      inv[l][1]:=' ';
+                      inv[l][22]:=' ';
+                    end;
+           depla : dep[l][1]:=' ';
+           action : act[l][1]:=' ';
+           saction : begin
+                       self[l][1]:=' ';
+                       self[l][1]:=' ';
+                     end;
+           discut : dis[l][1]:=' ';
+        end;
+   end;
+
+procedure menu_aff;
+     var
+         ind_tabl,k,col:integer;
+         c: char;
+         pt,x,y,color,msk,
+         num_letr: integer;
+   begin
+     (* debug('menu_aff'); *)
+     hide_mouse;
+     {if not tesok then
+        begin
+          clrscr;
+          halt;
+        end;}
+     box( 7, Gd, 0,0, 639,10, 255);
+     col:= 28*res;
+     if Gd = cga then color:=1
+                 else color:=9;
+     num_letr:=0;
+     repeat     (* lettre par lettre *)
+       num_letr:= num_letr +1;
+       ind_tabl:=0;
+       y:= 1;
+       repeat    (* colonne par colonne *)
+         k:=0;
+         x:= col;
+         repeat   (* ligne par ligne *)
+           msk:=$80;
+           for pt:=0 to 7 do
+            begin
+              if (lettres[num_letr,ind_tabl] and msk)<>0 then
+                 begin
+                   putpix(Gd,x+1,y+1,0);
+                   putpix(Gd,x,y+1,0);
+                   putpix(Gd,x,y,color);
+                 end;
+              msk:= msk shr 1;
+              x:=x +1;
+            end;
+           ind_tabl:=succ(ind_tabl);
+           k:=succ(k);
+         until k=3;
+         y:=y+1;
+       until (y=9);
+       col:=col+48*res;
+     until num_letr=6;
+     show_mouse;
+   end;
+
+
+procedure draw_menu;
+  begin
+    (* debug('draw_menu'); *)
+    menu_aff;
+    active_menu:=true;
+    msg4:=no_choice;
+    msg3:=no_choice;
+    choisi:=false;
+    clic:=false;
+    test0:=false;
+  end;
+
+procedure invers(ix:integer);
+     var s:string[23];
+   begin
+     (* debug('invers'); *)
+     if msg4=no_choice then exit;
+     putxy(don[msg3,1] shl 3,succ(lo(msg4)) shl 3);
+     case msg3 of
+                  1 : s:= inv[lo(msg4)];
+                  2 : s:= dep[lo(msg4)];
+                  3 : s:= act[lo(msg4)];
+                  4 : s:= self[lo(msg4)];
+                  5 : s:= dis[lo(msg4)];
+                  6 : s:= fic[lo(msg4)];
+                  7 : s:= fic[1]+' '+chr(48+lo(msg4));
+                  8 : if lo(msg4)=1 then s:=recom
+                              else s:= fic[2]+' '+chr(47+lo(msg4));
+          end;
+     if (s[1]<>'*') and (s[1]<>'<') then writeg(s,ix)
+                                    else msg4:=no_choice;
+   end;
+
+procedure util(x,y:integer);
+     var ymx, dxcar, xmn, xmx, ix:integer;
+   begin
+     (* debug('util'); *)
+     ymx:= don[msg3,4] shl 3+16;
+     dxcar:= don[msg3,3];
+     xmn:= don[msg3,1] shl 2*res;
+     if res=1 then ix:=5 else ix:=3;
+     xmx:= dxcar*ix*res+ xmn+ 2;
+     if (x>xmn) and (x<xmx) and (y<ymx) and (y>15) then
+             begin
+               ix:= pred(y shr 3)+ msg3 shl 8;
+               if ix<>msg4 then
+                 begin
+                   invers(1);
+                   msg4:=ix;
+                   invers(0);
+                 end;
+             end
+           else if msg4<>no_choice then
+                 begin
+                   invers(1);
+                   msg4:=no_choice;
+                 end;
+   end;
+
+procedure menu_down( ii :integer);
+     var cx, xcc:integer;
+         xco, nb_lig :integer;
+   begin
+     (* debug('menu_down'); *)
+     xco:=don[ii,1];
+     nb_lig:= don[ii,4];
+     hide_mouse;
+     sauvecr(10,succ(don[ii,2]) shl 1);
+     xco:= xco shl 3;
+     if res=1 then cx:=10 else cx:=6;
+     xcc:= xco+ (don[ii,3]*cx)+6;
+     box(15, Gd, xco,12, xcc, 10 + don[ii,2] shl 1, 255);
+     box(0, Gd, xcc, 12, xcc+4, 10 + don[ii,2] shl 1,255);
+     box(0,Gd,xco, 8 + don[ii,2] shl 1, xcc+4, 12 + don[ii,2] shl 1,255);
+     putxy(xco,16);
+     cx:=0;
+     repeat
+       cx:= succ(cx);
+       case ii of
+             1 : if inv[cx][1]<> '*' then writeg(inv[cx],4);
+             2 : if dep[cx][1]<> '*' then writeg(dep[cx],4);
+             3 : if act[cx][1]<> '*' then writeg(act[cx],4);
+             4 : if self[cx][1]<>'*' then writeg(self[cx],4);
+             5 : if dis[cx][1]<> '*' then writeg(dis[cx],4);
+             6 : writeg(fic[cx],4);
+             7 : writeg(fic[1]+' '+chr(48+cx),4);
+             8 : if cx=1 then writeg( recom,4)
+                         else writeg(fic[2]+' '+chr(47+cx),4);
+          end;
+       putxy(xco,ywhere+8)
+     until cx=nb_lig;
+     test0:=true;
+     show_mouse;
+   end;
+
+procedure menu_up(xx:integer);
+   begin
+     (* debug('menu_up'); *)
+     if test0 then
+       begin
+         charecr(10,succ(don[xx,2]) shl 1);
+         test0:=false;
+       end;
+   end;
+
+procedure erase_menu;
+  begin
+    (* debug('erase_menu'); *)
+    active_menu:=false;
+    clic:=false;
+    menu_up(msg3);
+  end;
+
+procedure mdn;
+       var x,y,c,a,ix:integer;
+           tes:boolean;
+   begin
+     (* debug('mdn'); *)
+     if not active_menu then exit;
+     x:=X_S; y:=Y_S;
+     if (not clic) then
+      begin
+        if (x=xprec) and
+           (y=yprec) then exit
+        else begin
+               xprec:=x;
+               yprec:=y;
+             end;
+        tes:=(y<11) and ((x in [28*res..28*res+24,76*res..76*res+24])
+                         or ((x>124*res) and (x<124*res+24))
+                         or ((x>172*res) and (x<172*res+24))
+                         or ((x>220*res) and (x<220*res+24))
+                         or ((x>268*res) and (x<268*res+24)));
+        if tes then
+           begin
+             if x<76*res then ix:=invent
+              else if x<124*res then ix:=depla
+               else if x<172*res then ix:=action
+                else if x<220*res then ix:=saction
+                 else if x<268*res then ix:=discut
+                  else ix:= fichier;
+             if (ix<>msg3) or (not test0) then
+              if not ((ix=fichier) and  (msg3 in [sauve, charge])) then
+                 begin
+                   menu_up(msg3);
+                   menu_down(ix);
+                   msg3:=ix;
+                   msg4:=no_choice;
+                 end;
+          end
+         else    { Not in the MenuTitle line }
+          begin
+            if (y>11) and (test0) then util(x,y);
+          end
+      end
+     else          (* il y a eu 'clic' *)
+     if (msg3=fichier) and (msg4<>no_choice) then
+       begin
+         clic:=false;
+         menu_up(msg3);
+         if lo(msg4)=1 then msg3:=7
+                   else msg3:=8;
+         menu_down(msg3);
+       end
+     else    (*  il y a eu clic sur un autre menu  *)
+       begin
+         choisi:=(test0) and (msg4<>no_choice);
+         menu_up(msg3);
+         msg[4]:=msg4;
+         msg[3]:=msg3;
+         msg3:=no_choice;
+         msg4:=no_choice;
+         clic:=false;
+       end;
+   end;
+
diff --git a/engines/mortevielle/original/0/MENUFR.MOR b/engines/mortevielle/original/0/MENUFR.MOR
new file mode 100644
index 0000000..d773958
Binary files /dev/null and b/engines/mortevielle/original/0/MENUFR.MOR differ
diff --git a/engines/mortevielle/original/0/MOR.PAS b/engines/mortevielle/original/0/MOR.PAS
new file mode 100644
index 0000000..7125524
--- /dev/null
+++ b/engines/mortevielle/original/0/MOR.PAS
@@ -0,0 +1,1445 @@
+(* Niveau 14 suite *)
+const
+ m1= 'quelqu''un entre, parait ‚tonn‚ mais ne dit rien';
+
+
+procedure testfi;
+   begin
+     if ioresult<> 0 then
+        begin
+          caff:= do_alert(err_mess,1);
+          halt;
+        end;
+   end;
+
+
+function readclock: integer;
+     var       r : registres;
+         s, m, h : integer;
+begin
+(* debug('readclock');*)
+  r.ax := $2C00;
+  intr($21,r);
+  with r do
+  begin
+    h:=cx shr 8;
+    m:=cx mod 256;
+    s:=dx shr 8;
+  end;
+  m:= m * 60;
+  h:= h* 3600;
+  readclock:= h+ m+ s;
+end;
+
+procedure modif(var nu: integer);
+begin
+ (* debug('modif'); *)
+ if nu= 26 then nu:= 25;
+ if (nu> 29) and (nu< 36) then nu:= nu- 4;
+ if (nu> 69) and (nu< 78) then nu:= nu- 37;
+ if (nu> 99) and (nu< 194) then nu:= nu- 59;
+ if (nu> 996) and (nu< 1000) then nu:= nu- 862;
+ if (nu> 1500) and (nu< 1507) then nu:= nu- 1363;
+ if (nu> 1507) and (nu< 1513) then nu:= nu- 1364;
+ if (nu> 1999) and (nu< 2002) then nu:= nu- 1851;
+ if nu= 2010 then nu:= 151;
+ if (nu> 2011) and (nu< 2025) then nu:= nu- 1860;
+ if nu= 2026 then nu:= 165;
+ if (nu> 2029) and (nu< 2037) then nu:= nu- 1864;
+ if (nu> 3000) and (nu< 3005) then nu:= nu- 2828;
+ if nu= 4100 then nu:= 177;
+ if nu= 4150 then nu:= 178;
+ if (nu> 4151) and (nu< 4156) then nu:= nu- 3973;
+ if nu= 4157 then nu:= 183;
+ if (nu= 4160) or (nu= 4161) then nu:= nu- 3976;
+end;
+
+
+procedure dessine(ad, x, y: integer);
+begin
+  (* debug('dessine'); *)
+  hide_mouse;
+  writepal(numpal);
+  PictOut(ad,0,x,y);
+  show_mouse;
+end;
+
+procedure dessine_rouleau;
+begin
+  (* debug('dessine_rouleau'); *)
+  writepal(89);
+  if gd=Her then
+     begin
+       mem[$7000:14]:=15;
+     end;
+  hide_mouse;
+  PictOut($73A2,0,0,0);
+  show_mouse;
+end;
+
+
+procedure text_color(c:integer);
+begin
+  color_txt:= c;
+end;
+
+(* NIVEAU 13 *)
+
+
+procedure text(x,y,nb,m: integer);
+   var st : phrase;
+       tay : integer;
+       co : integer;
+
+begin
+  (* debug('text'); *)
+  if res=1 then co:=10 else co:=6;
+  DeLine(m,st,tay);
+  if (y=182) and (tay*co>nb*6) then y:=176;
+  Afftex(st,x,y,nb,20,color_txt);
+end;
+
+procedure initouv;
+  var cx:integer;
+ begin
+   (* debug('initouv'); *)
+   for cx:= 1 to 7 do touv[cx]:= chr(0)
+ end;
+
+procedure ecrf1;
+begin
+  boite(0, 11, 512, 163, 15);           (* grand dessin *)
+end;
+
+procedure clsf1;
+  var i,j:integer;
+begin
+ (* debug('clsf1'); *)
+ hide_mouse;
+ box(0,Gd, 0,11, 514,175, 255);
+(* if Gd=ams then port[$3DD]:=15;
+ case Gd of
+         ams,
+         cga : begin
+                 for j:=0 to 63 do
+                    begin
+                      for i:=6 to 86 do
+                         begin
+                           mem[$B800:i*80+j]:=0;
+                           mem[$Ba00:i*80+j]:=0;
+                         end;
+                      mem[$b800:6960+j]:=0;
+                      mem[$ba00:400+j]:=0;
+                    end;
+               end;
+         ega : begin
+                 port[$3C4]:= 2;
+                 port[$3C5]:= 15;
+                 port[$3CE]:= 8;
+                 port[$3CF]:= 255;
+                 for j:=0 to 63 do
+                    for i:=11 to 174 do
+                       mem[$A000:i*80+j]:=0;
+               end;
+         tan : begin
+                 for j:=0 to 128 do
+                    begin
+                      for i:=3 to 43 do
+                         begin
+                           mem[$B800:i*160+j]:=0;
+                           mem[$Ba00:i*160+j]:=0;
+                           mem[$bc00:i*160+j]:=0;
+                           if i<>43 then mem[$be00:i*160+j]:=0;
+                         end;
+                      mem[$be00:320+j]:=0;
+                    end;
+               end;
+ end;
+ droite(256*res,11,256*res,175,0);*)
+ show_mouse;
+end;
+
+procedure clsf2;
+   var i,j:integer;
+begin
+ (* debug('clsf2'); *)
+ hide_mouse;
+ if f2_all then
+    begin
+      box(0,Gd,1,176,633,199,255);
+      boite(0,175,634,24,15);
+      f2_all:=false;
+    end
+  else
+    begin
+      box(0,Gd,1,176,633,190,255);
+      boite(0,175,634,15,15);
+    end;
+ show_mouse;
+end;
+
+procedure ecrf2;
+begin
+  (* debug('ecrf2'); *)
+  text_color(5);
+  (*boite(0,175,630,15,15);*)
+end;
+
+procedure ecr2(str: str255);
+  var tab : integer;
+      tlig : integer;
+begin
+ (* debug('ecr2 : '+str);*)
+ if res=1 then tab:=10 else tab:=6;
+ putxy(8,177);
+ tlig:=59+pred(res)*36;
+ if length(str)<tlig then writeg(str,5)
+  else if length(str)<tlig shl 1 then
+          begin
+            putxy(8,176);
+            writeg(copy(str,1,pred(tlig)),5);
+            putxy(8,182);
+            writeg(copy(str,tlig,tlig shl 1),5);
+          end
+   else begin
+          f2_all:=True;
+          clsf2;
+          putxy(8,176);
+          writeg(copy(str,1,pred(tlig)),5);
+          putxy(8,182);
+          writeg(copy(str,tlig,pred(tlig shl 1)),5);
+          putxy(8,190);
+          writeg(copy(str,tlig shl 1,tlig*3),5);
+        end;
+end;
+
+procedure clsf3;
+   var i,j:integer;
+begin
+  (* debug('clsf3'); *)
+  hide_mouse;
+  box(0,Gd,1,192,633,199,255);
+  boite(0,191,634,8,15);
+  show_mouse;
+end;
+
+procedure ecr3(text: str255);
+begin
+ (* debug('ecr3 : '+text);*)
+ clsf3;
+ putxy(8,192);
+ writeg(text,5);
+end;
+
+procedure ecrf6;
+begin
+  (* debug('ecrf6'); *)
+  text_color(5);
+  boite(62, 33, 363, 80, 15);
+end;
+
+procedure ecrf7;
+begin
+ text_color(4);
+{ draw_mode(2);
+ text_height(4*res);
+ text_style(normal);}
+end;
+
+procedure clsf10;
+  var co,cod : integer;
+      st : string[8];
+begin
+ (* debug('clsf10'); *)
+ hide_mouse;
+ if res=1 then
+    begin
+      co:=634;
+      cod:=534
+    end
+  else
+    begin
+      co:=600;
+      cod:=544;
+    end;
+ box(15,Gd, cod, 93, co, 98, 255);
+ if s.conf< 33 then st:='Cool'
+               else
+ if s.conf< 66 then st:=' Lourde '
+               else
+ if s.conf> 65 then st:='Malsaine';
+ if res=1 then co:=10 else co:=6;
+ co:= 574-co*length(st) shr 1;
+ putxy(co,92);
+ writeg(st,4);
+ if res=1 then co:=620 else co:=584;
+ box(15,Gd, 560, 24, co, 86, 255);
+(* rempli(69,12,32,5,255);*)
+ show_mouse;
+end;
+
+   procedure stop;
+     begin
+       clrscr;
+       hirs;
+       Gd:=ams;
+       hirs;
+       halt;
+     end;
+
+procedure paint_rect(x, y, dx, dy : integer);
+     var co:integer;
+   begin
+     (* debug('paint_rect'); *)
+     if gd=cga then co:= 3
+               else co:=11;
+     box(co,Gd,x,y,x+dx,y+dy,255);
+   end;
+
+function hazard(min,max: integer): integer;
+     var ha1: integer;
+         ha2: real;
+   begin
+     (* debug('hazard'); *)
+     ha2:= random;
+     ha1:= trunc(ha2*(max-min));
+     hazard:= min+ ha1;
+   end;
+
+procedure calch(var j,h,m: integer);
+var
+ th,nh: integer;
+begin
+(* debug('calch');*)
+ nh:= readclock;
+ th:= jh+ ((nh- mh) div t);
+ m:= ((th mod 2)+ vm)* 30;
+ h:= (th shr 1)+ vh;
+ if m= 60 then
+ begin
+  m:= 0;
+  h:= h+ 1;
+ end;
+ j:= (h div 24)+ vj;
+ h:= h- ((j- vj)* 24);
+end;
+
+procedure conv(x : integer; var y: integer);
+var
+ cx: integer;
+begin
+ (* debug('conv'); *)
+ cx:= 1;
+ y:= 128;
+ while cx< x do
+ begin
+  y:= y shr 1;
+  cx:= succ(cx);
+ end;
+end;
+
+(* NIVEAU 12 *)
+procedure okpas;
+begin
+  tesok:=True;
+end;
+
+procedure modobj(m: integer);
+var
+ str: phrase;
+ strp: str30;
+ i,tay: integer;
+begin
+ (* debug('modobj'); *)
+ strp:=' ';
+ if m<> 500 then
+    begin
+      DeLine(m- 501+ c_st41,str,tay);
+      strp:= delig;
+    end;
+ menut( invt[8], strp);
+ menu_disable( invt[8]);
+end;
+
+procedure modobj2(m: integer;t1,t2 : boolean);
+var
+ str: phrase;
+ strp: str30;
+ i,tay: integer;
+begin
+ (* debug('modobj'); *)
+  strp:=' ';
+ if t1 or t2 then okpas
+             else tesok:=False;;
+ if m<> 500 then
+    begin
+      DeLine(m- 501+ c_st41,str,tay);
+      strp:= delig;
+    end;
+ menut( invt[8], strp);
+ menu_disable( invt[8]);
+end;
+
+
+procedure repon(f,m: integer);
+var
+ str: str255;
+ str1: string[40];
+ st : phrase;
+ fic: text;
+ i, xco, dx, caspe, tay : integer;
+begin
+ (* debug('repon fenetre nø'+chr(f+48));*)
+ if (m> 499) and (m< 563) then
+ begin
+  DeLine( m-501+c_st41,st,tay);
+  if tay>(58+pred(res)*37) shl 1 then f2_all:= True
+                                 else f2_all:= False;
+  clsf2;
+  Afftex(st,8,176,85,3,5);
+ end
+ else
+ begin
+  modif(m);
+  if f= 8 then f:= 2;
+  if f= 1 then f:= 6;
+  if f= 2 then
+  begin
+   clsf2;
+   ecrf2;
+   text(8, 182, 103, m);
+   if (m= 68) or (m= 69) then s.teauto[40]:= '*';
+   if (m= 104) and (caff= 14) then
+   begin
+    s.teauto[36]:= '*';
+    if s.teauto[39]= '*' then
+    begin
+     s.pourc[3]:= '*';
+     s.teauto[38]:= '*';
+    end;
+   end;
+  end;
+  if f in [6,9] then
+  begin
+   DeLine(m,st,tay);
+   if f=6 then i:=4
+          else i:=5;
+   Afftex(st,80,40,60,25,i);
+   if m= 180 then s.pourc[6]:= '*';
+   if m= 179 then s.pourc[10]:= '*';
+  end;
+  if f= 7 then          (* messint *)
+  begin
+   ecrf7;
+   DeLine(m,st,tay);
+   if res=1 then
+      begin
+        xco:=252-tay*5;
+        caspe:= 100;
+        dx:= 80;
+      end
+    else
+      begin
+        xco:=252-tay*3;
+        caspe:= 144;
+        dx:=50;
+      end;
+   if tay<40 then Afftex(st,xco,86,dx,3,5)
+             else Afftex(st,caspe,86,dx,3,5);
+  end;
+ end;
+end;
+
+procedure f3f8;
+  var co:integer;
+begin
+  if res=1 then co:=107 else co:=64;
+  putxy(3,44);
+  writeg(f3,5);
+  ywhere:= 51;
+  writeg(f8,5);
+  boite(0,42,co,16,7);
+end;
+
+procedure t5(cx: integer);
+begin
+ (* debug('t5'); *)
+ if cx= 10 then blo:= false;
+ if cx<> 1 then
+ begin
+  bh1:= false;
+  bf1:= false;
+ end;
+ if cx<> 2 then bh2:= false;
+ if cx<> 4 then
+ begin
+  bh4:= false;
+  bf4:= false;
+ end;
+ if cx<> 5 then bh5:= false;
+ if cx<> 6 then bh6:= false;
+ if cx<> 8 then bh8:= false;
+ if cx<> 3 then bt3:= false;
+ if cx<> 7 then bt7:= false;
+ if cx<> 9 then bh9:= false;
+end;
+
+procedure affper(per: integer);
+var
+ cx: integer;
+begin
+ (* debug('affper'); *)
+ for cx:= 1 to 8 do menu_disable( disc[cx]);
+ clsf10;
+ if (per and 128)= 128 then
+ begin
+   putxy(560,24);
+   writeg('LEO',4);
+   menu_enable( disc[1]);
+ end;
+ if (per and 64)= 64 then
+ begin
+  putxy(560, 32);
+  writeg('PAT',4);
+  menu_enable( disc[2]);
+ end;
+ if (per and 32)= 32 then
+ begin
+  putxy(560, 40);
+  writeg('GUY',4);
+  menu_enable( disc[3]);
+ end;
+ if (per and 16)= 16 then
+ begin
+  putxy(560,48);
+  writeg('EVA',4);
+  menu_enable( disc[4]);
+ end;
+ if (per and 8)= 8 then
+ begin
+  putxy(560,56);
+  writeg('BOB',4);
+  menu_enable( disc[5]);
+ end;
+ if (per and 4)= 4 then
+ begin
+  putxy(560, 64);
+  writeg('LUC',4);
+  menu_enable( disc[6]);
+ end;
+ if (per and 2)= 2 then
+ begin
+  putxy(560, 72);
+  writeg('IDA',4);
+  menu_enable( disc[7]);
+ end;
+ if (per and 1)= 1 then
+ begin
+  putxy(560, 80);
+  writeg('MAX',4);
+  menu_enable( disc[8]);
+ end;
+ ipers:= per;
+end;
+
+overlay procedure choix(min,max: integer; var per: integer);
+var
+ i: boolean;
+ haz,cx,cy,cz: integer;
+ per2,cz2: long_integer;
+begin
+ (* debug('o0 choix'); *)
+ haz:= hazard(min,max);
+ if haz> 4 then
+ begin
+  haz:= 8- haz;
+  i:= true
+ end
+ else i:= false;
+ cx:= 0;
+ per:= 0;
+ while cx< haz do
+ begin
+  cy:= hazard(1,8);
+  conv(cy,cz);
+  if (per and cz)<> cz then
+  begin
+   cx:= cx+ 1;
+   per:= (per or cz);
+  end;
+ end;
+ if i then per:= 255- per;
+ i:= false;
+end;
+
+overlay procedure cpl1(var p: integer);
+var
+ j,h,m: integer;
+begin
+ (* debug('o0 cpl1'); *)
+ calch(j,h,m);
+ if (h> 7) or (h< 11) then p:= 25;
+ if (h> 10) and (h< 14) then p:= 35;
+ if (h> 13) and (h< 16) then p:= 50;
+ if (h> 15) and (h< 18) then p:= 5;
+ if (h> 17) and (h< 22) then p:= 35;
+ if (h> 21) and (h< 24) then p:= 50;
+ if (h>= 0) and (h< 8) then p:= 70;
+ mdn;
+end;
+
+overlay procedure cpl2(var p: integer);
+var
+ j,h,m: integer;
+begin
+ (* debug('o0 cpl2'); *)
+ calch(j,h,m);
+ if (h> 7) and (h< 11) then p:= -2;
+ if h= 11 then p:= 100;
+ if (h> 11) and (h< 23) then p:= 10;
+ if h= 23 then p:= 20;
+ if (h>= 0) and (h< 8) then p:= 50;
+end;
+
+overlay procedure cpl3(var p: integer);
+var
+ j,h,m: integer;
+begin
+ (* debug('o0 cpl3'); *)
+ calch(j,h,m);
+ if ((h> 8) and (h< 10)) or ((h> 19) and (h< 24)) then p:= 34;
+ if ((h> 9) and (h< 20)) or ((h>= 0) and (h< 9)) then p:= 0;
+end;
+
+overlay procedure cpl5(var p: integer);
+var
+ j,h,m: integer;
+begin
+ (* debug('o0 cpl5'); *)
+ calch(j,h,m);
+ if (h> 6) and (h< 10) then p:= 0;
+ if h= 10 then p:= 100;
+ if (h> 10) and (h< 24) then p:= 15;
+ if (h>= 0) and (h< 7) then p:= 50;
+end;
+
+overlay procedure cpl6(var p: integer);
+var
+ j,h,m: integer;
+begin
+ (* debug('o0 cpl6'); *)
+ calch(j,h,m);
+ if ((h> 7) and (h< 13)) or ((h> 17) and (h< 20)) then p:= -2;
+ if ((h> 12) and (h< 17)) or ((h> 19) and (h< 24)) then p:= 35;
+ if h= 17 then p:= 100;
+ if (h>= 0) and (h< 8) then p:= 60;
+end;
+
+procedure person;
+const
+ m1= 'Vous';
+ m2= 'ˆtes';
+ m3= 'SEUL';
+var
+ cf: integer;
+ str: str255;
+begin
+ (* debug('person'); *)
+ for cf:= 1 to 8 do menu_disable( disc[cf]);
+ clsf10;
+ putxy(560, 30);
+ writeg(m1,4);
+ putxy(560, 50);
+ writeg(m2,4);
+ putxy(560, 70);
+ writeg(m3,4);
+ ipers:= 0;
+end;
+
+procedure chlm(var per: integer);
+begin
+  (* debug('chlm'); *)
+  per:= hazard(1,2);
+  if per= 2 then per:= 128;
+end;
+
+procedure pendule;
+const
+ cv: array[1..2,1..12] of integer
+    =(( 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0),
+      (-5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6) );
+ x= 580;
+ y= 123;
+ rg= 9;
+var
+ h,co: integer;
+
+begin
+ (* debug('pendule'); *)
+ hide_mouse;
+ (*paint_rect(572,114,18,20);
+ paint_rect(577,114,6,20);*)
+ paint_rect(570,118,20,10);
+ paint_rect(578,114,6,18);
+ if Gd in [Cga,Her] then co:=0 else co:=1;
+ if min= 0 then droite(x shr 1*res, y, x shr 1*res, (y- rg), co)
+           else droite(x shr 1*res, y, x shr 1*res, (y+ rg), co);
+ h:= heu;
+ if h> 12 then h:= h- 12;
+ if h= 0 then h:= 12;
+ droite(x shr 1*res, y, (x+ cv[1, h]) shr 1*res, y+ cv[2, h], co);
+ show_mouse;
+ putxy( 568, 154);
+ if heu> 11 then writeg( 'PM ',1)
+            else writeg( 'AM ',1);
+ putxy( 550, 160);
+ if jou in [0..8] then writeg(chr(jou+49)+'& jour',1);
+end;
+
+(*************
+ * NIVEAU 11 *
+ *************)
+
+procedure debloc(l: integer);
+begin
+(* debug('debloc'); *)
+ num:= 0;
+ x:= 0;
+ y:= 0;
+ if (l<> 26) and (l<> 15) then t5(l);
+ mpers:= ipers;
+end;
+
+overlay procedure cpl10(var p,h: integer);
+var
+ j,m: integer;
+begin
+(* debug('o1 cpl10'); *)
+ calch(j,h,m);
+ if ((h> 7) and (h< 11)) or ((h> 11) and (h< 14))
+  or ((h> 18) and (h< 21)) then p:= 100;
+ if (h= 11) or ((h> 20) and (h< 24)) then p:= 45;
+ if ((h> 13) and (h< 17)) or (h= 18) then p:= 35;
+ if h= 17 then p:= 60;
+ if (h>= 0) and (h< 8) then p:= 5;
+end;
+
+overlay procedure cpl11(var p,h: integer);
+var
+ j,m: integer;
+begin
+(* debug('o1 cpl11'); *)
+ calch(j,h,m);
+ if ((h> 8) and (h< 12)) or ((h> 20) and (h< 24)) then p:= 25;
+ if ((h> 11) and (h< 14)) or ((h> 18) and (h< 21)) then p:= 5;
+ if (h> 13) and (h< 17) then p:= 55;
+ if (h> 16) and (h< 19) then p:= 45;
+ if (h>= 0) and (h< 9) then p:= 0;
+end;
+
+overlay procedure cpl12(var p: integer);
+var
+ j,h,m: integer;
+begin
+(* debug('o1 cpl12'); *)
+ calch(j,h,m);
+ if ((h> 8) and (h< 15)) or ((h> 16) and (h< 22)) then p:= 55;
+ if ((h> 14) and (h< 17)) or ((h> 21) and (h< 24)) then p:= 25;
+ if (h>= 0) and (h< 5) then p:= 0;
+ if (h> 4) and (h< 9) then p:= 15;
+end;
+
+overlay procedure cpl13(var p: integer);
+begin
+(* debug('o1 cpl13'); *)
+ p:= 0;
+end;
+
+overlay procedure cpl15(var p: integer);
+var
+ j,h,m: integer;
+begin
+(* debug('o1 cpl15'); *)
+ calch(j,h,m);
+ if (h> 7) and (h< 12) then p:= 25;
+ if (h> 11) and (h< 14) then p:= 0;
+ if (h> 13) and (h< 18) then p:= 10;
+ if (h> 17) and (h< 20) then p:= 55;
+ if (h> 19) and (h< 22) then p:= 5;
+ if (h> 21) and (h< 24) then p:= 15;
+ if (h>= 0) and (h< 8) then p:= -15;
+end;
+
+overlay procedure cpl20(var p,h: integer);
+var
+ j,m: integer;
+begin
+(* debug('o1 cpl20'); *)
+ calch(j,h,m);
+ if h= 10 then p:= 65;
+ if (h> 10) and (h< 21) then p:= 5;
+ if (h> 20) and (h< 24) then p:= -15;
+ if (h>= 0) and (h< 5) then p:= -300;
+ if (h> 4) and (h< 10) then p:= -5;
+end;
+
+overlay procedure quelq1(l: integer);
+var
+ per: integer;
+begin
+(* debug('o1 quelq1'); *)
+ per:= hazard(1,2);
+ if l= 1 then
+  if per= 1 then bh1:= true else bf1:= true;
+ if l= 4 then
+  if per= 1 then bh4:= true else bf4:= true;
+ ipers:= 10;
+end;
+
+overlay procedure quelq2;
+begin
+(* debug('o1 quelq2'); *)
+ if li= 2 then bh2:= true else bh9:= true;
+ ipers:= 10;
+end;
+
+overlay procedure quelq5;
+begin
+(* debug('o1 quelq5'); *)
+ bh5:= true;
+ ipers:= 10;
+end;
+
+overlay procedure quelq6(l: integer);
+var
+ per: integer;
+begin
+(* debug('o1 quelq6'); *)
+ if l= 6 then bh6:= true;
+ if l= 8 then bh8:= true;
+ ipers:= 10;
+end;
+
+overlay procedure quelq10(h: integer; var per: integer);
+var
+ min,max: integer;
+begin
+(* debug('o1 quelq10'); *)
+ if (h>= 0) and (h< 8) then chlm(per) else
+ begin
+  if (h> 7) and (h< 10) then
+  begin
+   min:= 5;
+   max:= 7;
+  end;
+  if (h> 9) and (h< 12) then
+  begin
+   min:= 1;
+   max:= 4;
+  end;
+  if ((h> 11) and (h< 15)) or ((h> 18) and (h< 21)) then
+  begin
+   min:= 6;
+   max:= 8;
+  end;
+  if ((h> 14) and (h< 19)) or ((h> 20) and (h< 24)) then
+  begin
+   min:= 1;
+   max:= 5;
+  end;
+  choix(min,max,per);
+ end;
+ affper(per);
+end;
+
+overlay procedure quelq11(h: integer; var per: integer);
+var
+ min,max: integer;
+begin
+(* debug('o1 quelq11'); *)
+ if (h>= 0) and (h< 8) then chlm(per) else
+ begin
+  if ((h> 7) and (h< 10)) or ((h>20) and (h< 24)) then
+  begin
+   min:= 1;
+   max:= 3;
+  end;
+  if ((h> 9) and (h< 12)) or ((h> 13) and (h< 19)) then
+  begin
+   min:= 1;
+   max:= 4;
+  end;
+  if ((h> 11) and (h< 14)) or ((h> 18) and (h< 21))then
+  begin
+   min:= 1;
+   max:= 2;
+  end;
+  choix(min,max,per);
+ end;
+ affper(per);
+end;
+
+overlay procedure quelq12(var per: integer);
+begin
+(* debug('o1 quelq12'); *)
+ chlm(per);
+ affper(per);
+end;
+
+overlay procedure quelq15(var per: integer);
+var
+ cx: integer;
+ test: boolean;
+
+begin
+(* debug('o1 quelq15'); *)
+ per:= 0;
+ if per= 0 then
+ begin
+   repeat
+     cx:= hazard(1,8);
+     test :=(((cx= 1) and (bh2 or bh9)) or
+             ((cx= 2) and bh8) or
+             ((cx= 3) and bh4) or
+             ((cx= 4) and bf4) or
+             ((cx= 5) and bh6) or
+             ((cx= 6) and bh1) or
+             ((cx= 7) and bf1) or
+             ((cx= 8) and bh5))
+  until not test;
+  conv(cx,per);
+  affper(per);
+ end;
+end;
+
+overlay procedure quelq20(h: integer; var per: integer);
+var
+ min,max: integer;
+begin
+(* debug('o1 quelq20'); *)
+ if ((h>= 0) and (h< 10)) or ((h> 18) and (h< 24)) then chlm(per)
+ else
+ begin
+  if (h> 9) and (h< 12) then
+  begin
+   min:= 3;
+   max:= 7;
+  end;
+  if (h> 11) and (h< 18) then
+  begin
+   min:= 1;
+   max:= 2;
+  end;
+  if h= 18 then
+  begin
+   min:= 2;
+   max:= 4;
+  end;
+  choix(min,max,per);
+ end;
+ affper(per);
+end;
+
+
+overlay procedure frap;
+var
+ j,h,m,haz: integer;
+begin
+(* debug('o1 frap'); *)
+ calch(j,h,m);
+ if (h>= 0) and (h< 8) then crep:= 190 else
+ begin
+  haz:= hazard(1,100);
+  if haz> 70 then crep:= 190 else crep:= 147;
+ end;
+end;
+
+overlay procedure nouvp(l: integer; var p: integer);
+begin
+(* debug('o1 nouvp'); *)
+ p:= 0;
+ if l= 1 then
+ begin
+  if bh1 then p:= 4;
+  if bf1 then p:= 2;
+ end;
+ if ((l= 2) and (bh2)) or ((l= 9) and (bh9)) then p:= 128;
+ if l= 4 then
+ begin
+  if bh4 then p:= 32;
+  if bf4 then p:= 16;
+ end;
+ if (l= 5) and (bh5) then p:= 1;
+ if (l= 6) and (bh6) then p:= 8;
+ if (l= 8) and (bh8) then p:= 64;
+ if ((l= 3) and (bt3)) or ((l= 7) and (bt7)) then p:= 9;
+ if p<> 9 then affper(p);
+end;
+
+
+
+overlay procedure tip(ip: integer; var cx: integer);
+begin
+(* debug('o1 tip'); *)
+ if ip= 128 then cx:= 1 else
+ if ip= 64  then cx:= 2 else
+ if ip= 32  then cx:= 3 else
+ if ip= 16  then cx:= 4 else
+ if ip= 8   then cx:= 5 else
+ if ip= 4   then cx:= 6 else
+ if ip= 2   then cx:= 7 else
+ if ip= 1   then cx:= 8;
+end;
+
+
+overlay procedure ecfren(var p,haz: integer; cf,l: integer);
+begin
+(* debug('o1 ecfren'); *)
+ if l= 0 then person;
+ p:= -500;
+ haz:= 0;
+ if ((l= 1) and (not bh1) and (not bf1))
+ or ((l= 4) and (not bh4) and (not bf4)) then cpl1(p);
+ if (l= 2) and (not bh2) and (not bh9) then cpl2(p);
+ if ((l= 3) and (not bt3)) or ((l= 7) and (not bt7)) then cpl3(p);
+ if (l= 5) and (not bh5) then cpl5(p);
+ if ((l= 6) and (not bh6)) or ((l= 8) and (not bh8)) then cpl6(p);
+ if (l= 9) and (not bh9) and (not bh2) then p:= 10;
+ if ((l= 2) and (bh9)) or ((l= 9) and (bh2)) then p:= -400;
+ if p<> -500 then
+ begin
+  p:= p+ cf;
+  haz:= hazard(1,100);
+ end;
+end;
+
+overlay procedure becfren(l: integer);
+var
+ haz: integer;
+begin
+(* debug('o1 becfren'); *)
+ if (l= 1) or (l= 4) then
+ begin
+  haz:= hazard(1,2);
+  if l= 1 then
+   if haz= 1 then bh1:= true else bf1:= true;
+  if l= 4 then
+   if haz= 1 then bh4:= true else bf4:= true;
+ end;
+ if l= 2 then bh2:= true else
+ if l= 3 then bt3:= true else
+ if l= 5 then bh5:= true else
+ if l= 6 then bh6:= true else
+ if l= 7 then bt7:= true else
+ if l= 8 then bh8:= true else
+ if l= 9 then bh9:= true;
+end;
+
+(* NIVEAU 10 *)
+procedure init_nbrepm;
+  const ipm: array[1..8] of byte
+            =(4,5,6,7,5,6,5,8);
+   var i : integer;
+begin
+(* debug('init_nbrepm'); *)
+  i:= 0;
+  repeat
+    i:= succ(i);
+    nbrepm[i]:= ipm[i];
+  until i=8;
+end;
+
+procedure phaz(var haz,p: integer; cf: integer);
+begin
+(* debug('phaz'); *)
+ p:= p+ cf;
+ haz:= hazard(1,100);
+end;
+
+overlay procedure inzon;
+var
+ cx: integer;
+begin
+(* debug('o2 inzon'); *)
+ copcha;
+ with s do
+ begin
+  ipre  := false;
+  derobj:= 0;
+  icave := 0;
+  iboul := 0;
+  ibag  := 0;
+  ipuit := 0;
+  ivier := 0;
+  iloic := 136;
+  icryp := 141;
+  conf  := hazard(4,10);
+  mlieu := 21;
+  for cx:= 2 to 6 do sjer[cx]:= chr(0);
+  sjer[1]:= chr(113);
+  heure:= chr(20);
+  for cx:= 1 to 10 do pourc[cx]:= ' ';
+  for cx:= 1 to 6 do teauto[cx]:= '*';
+  for cx:= 7 to 9 do teauto[cx]:= ' ';
+  for cx:= 10 to 28 do teauto[cx]:= '*';
+  for cx:= 29 to 42 do teauto[cx]:= ' ';
+  teauto[33]:= '*';
+ end;
+ for cx:= 1 to 8 do nbrep[cx]:= 0;
+ init_nbrepm;
+end;
+
+overlay procedure dprog;
+begin
+(* debug('o2 dprog'); *)
+ li:= 21;
+ (* jh:= t_settime(0);*)
+ jh:= 0;
+ if not s.ipre then blo:= true;
+ t:= ti1;
+ mh:= readclock;
+end;
+
+overlay procedure pl1(cf: integer);
+var
+ p, haz: integer;
+begin
+(* debug('o2 pl1'); *)
+ if ((li= 1) and (not bh1) and (not bf1))
+ or ((li= 4) and (not bh4) and (not bf4)) then
+ begin
+  cpl1(p);
+  phaz(haz,p,cf);
+  if haz> p then person else quelq1(li);
+ end;
+end;
+
+overlay procedure pl2(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl2'); *)
+ if not bh2 then
+ begin
+  cpl2(p);
+  phaz(haz,p,cf);
+  if haz> p then person else quelq2;
+ end;
+end;
+
+overlay procedure pl5(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl5'); *)
+ if not bh5 then
+ begin
+  cpl5(p);
+  phaz(haz,p,cf);
+  if haz> p then person else quelq5;
+ end;
+end;
+
+overlay procedure pl6(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl6'); *)
+ if ((li= 6) and (not bh6)) or ((li= 8) and (not bh8)) then
+ begin
+  cpl6(p);
+  phaz(haz,p,cf);
+  if haz> p then person else quelq6(li);
+ end;
+end;
+
+overlay procedure pl9(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl9'); *)
+ if not bh9 then
+ begin
+  cf:= -10;
+  phaz(haz,p,cf);
+  if haz> p then person else quelq2;
+ end;
+end;
+
+overlay procedure pl10(cf: integer);
+var
+ p,h,haz: integer;
+begin
+(* debug('o2 pl10'); *)
+ cpl10(p,h);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq10(h,p);
+end;
+
+overlay procedure pl11(cf: integer);
+var
+ p,h,haz: integer;
+begin
+(* debug('o2 pl11'); *)
+ cpl11(p,h);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq11(h,p);
+end;
+
+overlay procedure pl12(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl12'); *)
+ cpl12(p);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq12(p);
+end;
+
+overlay procedure pl13(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl13'); *)
+ cpl13(p);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq12(p);
+end;
+
+overlay procedure pl15(cf: integer);
+var
+ p,haz: integer;
+begin
+(* debug('o2 pl15'); *)
+ cpl15(p);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq15(p);
+end;
+
+overlay procedure pl20(cf: integer);
+var
+ p,h,haz: integer;
+begin
+(* debug('o2 pl20'); *)
+ cpl20(p,h);
+ phaz(haz,p,cf);
+ if haz> p then person else quelq20(h,p);
+end;
+
+overlay procedure t11(l11: integer; var a: integer);
+var
+ p,haz,h: integer;
+begin
+(* debug('o2 t11'); *)
+ ecfren(p,haz,s.conf,l11);
+ li:= l11;
+ if (l11> 0) and (l11< 10) then
+  if (p<> -500) then
+  begin
+   if (haz> p) then
+   begin
+    person;
+    a:= 0;
+   end
+   else
+   begin
+    becfren(li);
+    nouvp(li,a);
+   end;
+  end
+  else nouvp(li,a);
+ if l11> 9 then
+  if (l11> 15) and (l11<> 20) and (l11<> 26) then person else
+  begin
+   if l11= 10 then cpl10(p,h);
+   if l11= 11 then cpl11(p,h);
+   if l11= 12 then cpl12(p);
+   if (l11= 13) or (l11= 14) then cpl13(p);
+   if (l11= 15) or (l11= 26) then cpl15(p);
+   if l11= 20 then cpl20(p,h);
+   p:= p+ s.conf;
+   haz:= hazard(1,100);
+   if haz> p then
+   begin
+    person;
+    a:= 0;
+   end
+   else
+   begin
+    if l11= 10 then quelq10(h,p);
+    if l11= 11 then quelq11(h,p);
+    if (l11= 12) or (l11= 13) or (l11= 14) then quelq12(p);
+    if (l11= 15) or (l11= 26) then quelq15(p);
+    if l11= 20 then quelq20(h,p);
+    a:= p;
+   end;
+  end;
+end;
+
+overlay procedure cavegre;
+
+var
+ haz: integer;
+begin
+(* debug('cavegre'); *)
+ s.conf:= s.conf+ 2;
+ if s.conf> 69 then s.conf:= s.conf+ (s.conf div 10);
+ clsf3;
+ ecrf2;
+ ecr3(m1);
+ haz:= (hazard(0, 4))- 2;
+ parole(2, haz, 1);
+ for haz:=0 to 3000 do;
+ clsf3;
+ person;
+end;
+
+procedure writetp(s:str255;t:integer);
+begin
+  if res=2 then writeg(s,t)
+           else writeg(copy(s,1,25),t);
+end;
+
+procedure messint(nu: integer);
+begin
+(* debug('messint'); *)
+ clsf1;
+ clsf2;
+ clsf3;
+ decomp( $73A2, 1008);
+ memw[$7413:12]:= 80;
+ memw[$7413:14]:=  40;
+ writepal(90);
+ afff(Gd,$73A2, 1008,0,0);
+ afff(Gd,$73A2, 1008,0,70);
+ repon(7,nu);
+end;
+
+procedure aniof(ouf,num: integer);
+     var  ad, offset : integer;
+            c:char;
+   begin
+   (* debug('aniof'); *)
+     if (caff= 7) and ((num= 4) or (num= 5)) then exit;
+     if (caff= 10) and (num= 7) then num:= 6;
+     if (caff= 12) then if (num= 3) then num:= 4
+                                    else if (num= 4) then num:= 3;
+     ad:= adani;
+     offset:= animof(ouf,num);
+     decomp(ad,offset);
+     hide_mouse;
+     afff(Gd,ad,offset,0,12);
+     ecrf1;
+     show_mouse;
+   end;
+
+procedure musique(so: integer);
+var
+ i: boolean;
+ haz: integer;
+(* dep: array[1..5] of long_integer;*)
+begin
+(* debug('musique'); *)
+  if so= 0 then (*musik(0)*) begin end
+   else
+  if (prebru= 0) and (not s.ipre) then
+  begin
+   parole(10, 1, 1);
+   prebru:= prebru+ 1;
+  end
+  else
+  begin
+   i:= false;
+   if (s.mlieu= 19) or (s.mlieu= 21) or (s.mlieu= 22) then
+   begin
+    haz:= hazard(1,3);
+    if haz= 2 then
+    begin
+     haz:= hazard(2,4);
+     parole(9,haz,1);
+     i:= true;
+    end;
+   end;
+   if s.mlieu= 20 then
+   begin
+    haz:= hazard(1,2);
+    if haz= 1 then
+    begin
+     parole(8,1,1);
+     i:= true;
+    end;
+   end;
+   if s.mlieu= 24 then
+   begin
+    haz:= hazard(1,2);
+    if haz= 2 then
+    begin
+     parole(12,1,1);
+     i:= true;
+    end;
+   end;
+   if s.mlieu= 23 then
+   begin
+    parole(13,1,1);
+    i:= true;
+   end;
+   if not i then
+   begin
+   (* dep[1]:= 1416;
+    dep[2]:= 1512;
+    dep[3]:= 1692;
+    dep[4]:= 1884;
+    dep[5]:= 2046;
+    haz:= hazard(1,5);
+    musik(dep[haz]);*)
+    haz:= hazard(1,17);
+    parole(haz,1,2);
+   end;
+  end;
+end;
+
+(* NIVEAU 9 *)
+procedure dessin(ad:integer);
+var
+ cx: integer;
+begin
+(* debug('dessin'); *)
+ if ad<> 0 then dessine(ades,((ad mod 160)* 2),(ad div 160))
+           else
+ begin
+  clsf1;
+  if caff> 99 then
+  begin
+    dessine(ades,60,33);
+    boite(118, 32, 291, 121, 15);         (* cadre moyen *)
+  end
+  else
+   if caff> 69 then
+   begin
+    dessine(ades,112,48);             (* tˆtes *)
+    boite(222, 47, 155, 91, 15);
+   end
+   else
+   begin
+    dessine(ades,0,12);
+    ecrf1;
+    if (caff< 30) or (caff> 32) then
+    begin
+     for cx:= 1 to 6 do
+      if ord(touv[cx])<> 0 then aniof(1,ord(touv[cx]));
+     if caff= 13 then
+     begin
+      if s.iboul= 141 then aniof(1,7);
+      if s.ibag= 159 then aniof(1,6);
+     end;
+     if (caff= 14) and (s.icave= 151) then aniof(1,2);
+     if (caff= 17) and (s.ivier= 143) then aniof(1,1);
+     if (caff= 24) and (s.ipuit<> 0) then aniof(1,1);
+    end;
+    if caff< 26 then musique(1);
+   end;
+ end;
+end;
+
+
+
diff --git a/engines/mortevielle/original/0/MOR2.PAS b/engines/mortevielle/original/0/MOR2.PAS
new file mode 100644
index 0000000..f01b326
--- /dev/null
+++ b/engines/mortevielle/original/0/MOR2.PAS
@@ -0,0 +1,758 @@
+const  men : array[1..11] of integer
+             = ( scacher, attacher, defoncer, dormir,
+                 entrer,  fermer,   frapper,  manger,
+                 mettre,  ouvrir,   sortir );
+
+procedure tinke;
+const
+ m1= 'Mince! Vous entendez du bruit...';
+ d1= ' | Vous devriez avoir remarqu‚|       ';
+ d2= '% des indices...';
+ d3= '[';
+ d4= ']';
+ d5= '1';
+ d6= 'OK';
+var
+ cx,cy,haz,nh,cf,j,h,m,cd: integer;
+    stpo : string[3];
+      am : boolean;
+begin
+ anyone:= false;
+ calch(j,h,m);
+ if j<> jou then
+ begin
+  jou:= j;
+  cx:=0;
+  repeat
+    cx:=cx+1;
+    if nbrepm[cx]<> 0 then nbrepm[cx]:= nbrepm[cx]- 1;
+    nbrep[cx]:= 0;
+  until cx=8;
+ end;
+ if (h> heu) or ((h= 0) and (heu= 23)) then
+ begin
+  heu:= h;
+  min:= 0;
+  pendule;
+  cf:= 0;
+  for cx:= 1 to 10 do if s.pourc[cx]= '*' then cf:= cf+ 1;
+  if cf=10 then stpo:='10'
+           else stpo:=chr(cf+48);
+  stpou:= d3+ d5+ d4+ d3+ d1+ stpo+ '0'+ d2+ d4+ d3+ d6+ d4;
+ end;
+ if m> min then
+ begin
+  min:= 30;
+  pendule;
+ end;
+ if Y_S<12 then exit;
+ if not blo then
+ begin
+  if (h= 12) or ((h> 18) and (h< 21)) or ((h>= 0) and (h< 7)) then
+   t:= ti2 else t:= ti1;
+  cf:= s.conf;
+  if (cf> 33) and (cf< 66) then t:= t- (t div 3);
+  if cf> 65 then t:= t- ((t div 3)* 2);
+  nh:= readclock;
+  if (nh- mh)> t then
+  begin
+    am:= active_menu;
+    erase_menu;
+    jh:= jh+ ((nh- mh)div t);
+    mh:= nh;
+    case li of
+            1,4 : pl1(cf);
+              2 : pl2(cf);
+              5 : pl5(cf);
+            6,8 : pl6(cf);
+              9 : pl9(cf);
+             10 : pl10(cf);
+             11 : pl11(cf);
+             12 : pl12(cf);
+          13,14 : pl13(cf);
+          15,26 : pl15(cf);
+             20 : pl20(cf);
+        end;
+   if (mpers<> 0) and (ipers<> 10) then mpers:= ipers;
+   if (mpers= 0) and (ipers> 0) then
+    if (s.mlieu= 13) or (s.mlieu= 14) then cavegre else
+     if ipers= 10 then
+     begin
+      ipers:= 0;
+      if not brt then
+      begin
+       brt:= true;
+       hdb:= readclock;
+       haz:= hazard(1,5);
+       if haz< 5 then
+       begin
+        clsf3;
+        ecrf2;
+        ecr3(m1);
+        haz:= (hazard(0, 4))- 2;
+        parole(1, haz, 1);
+        clsf3;
+       end;
+      end;
+     end;
+    if am then draw_menu;
+  end;
+ end;
+ hfb:= readclock;
+ if (brt) and ((hfb- hdb)> 17) then
+ begin
+  nouvp(li,cx);
+  brt:= false;
+  hdb:= 0;
+  if (s.mlieu> 0) and (s.mlieu< 10) then anyone:= true;
+ end;
+end;
+
+procedure fenat(ans: char);
+  var coul : integer;
+begin
+  hide_mouse;
+  if Gd=cga then coul:=2
+            else if Gd=Her then coul:=1 else coul:=12;
+  affcar(Gd,306,193,coul,ord(ans));
+  boite(300, 191, 16, 8, 15);
+  show_mouse;
+end;
+
+
+(* NIVEAU 8 *)
+procedure afdes(ad: integer);
+begin
+  taffich;
+  dessin(ad);
+  okdes:= false;
+end;
+
+procedure tkey1(d: boolean);
+  var quest : boolean;
+      x,y,c:integer;
+      key : integer;
+begin
+ hide_mouse;
+ fenat('K');
+ while keypressed do key:=testou;
+ repeat
+   if d then tinke;
+   quest:=keypressed;
+   read_pos_mouse(x,y,c);
+ until quest or (c<>0) or (d and anyone);
+ if quest then key:=testou;
+ clic:=false;
+ show_mouse;
+end;
+
+procedure tmlieu(mli: integer);
+var
+ cx, j, i, tail : integer;
+           nomp : str30;
+             st : phrase;
+
+begin
+  if mli= 26 then mli:= 15;
+  i:=1;
+  while (i<8) and (v_lieu[i,mli]<>0)  do
+     begin
+       cx:=v_lieu[i,mli];
+       DeLine(cx+c_tmlieu,st,tail);
+       nomp:= delig;
+       while length(nomp)<30 do nomp:=nomp+' ';
+       menut( depl[i], nomp);
+       i:=i+1;
+     end;
+  nomp:= '*                   ';
+  for cx:= 7 downto i do menut( depl[cx], nomp);
+end;
+
+
+(* NIVEAU 7 *)
+procedure tlu(af,ob: integer);
+begin
+  caff:= 32;
+  afdes(0);
+  repon(6,ob+ 4000);
+  repon(2,999);
+  tkey1(true);
+  caff:= af;
+  msg[3]:= no_choice;
+  crep:= 998;
+end;
+
+procedure delin(n:integer);
+  var s:phrase;
+      t : integer;
+  begin
+    deline(n,s,t);
+  end;
+
+procedure affrep;
+begin
+  caff:= s.mlieu;
+  crep:= s.mlieu;
+end;
+
+procedure mfouen;
+
+var
+ cx: integer;
+begin
+ tmlieu(s.mlieu);
+ for cx:=1 to 11 do menu_enable( men[cx]);
+(* menu_enable( scacher);
+ menu_enable(menup, attacher);
+ menu_enable(menup, defoncer);
+ menu_enable(menup, dormir);
+ menu_enable(menup, entrer);
+ menu_enable(menup, fermer);
+ menu_enable(menup, frapper);
+ menu_enable(menup, manger);
+ menu_enable(menup, mettre);
+ menu_enable(menup, ouvrir);
+ menu_enable(menup, sortir);  *)
+ menut( sonder, ' sonder   ');
+ menut( soulever, ' soulever ');
+end;
+
+procedure atf3f8(var key: integer);
+ begin
+   repeat
+     key:= testou;
+   until (key=61) or (key=66);
+ end;
+
+(* NIVEAU 6 *)
+
+procedure tperd;
+var
+ cx: integer;
+begin
+ initouv;
+ ment:= 0;
+ iouv:= 0;
+ mchai:= 0;
+ mfouen;
+ if not blo then t11(21, cx);
+ perdu:= true;
+ clsf1;
+ boite( 60, 35, 400, 50, 15);
+ repon(9,crep);
+ clsf2;
+ clsf3;
+ col:= false;
+ syn:= false;
+ okdes:= false;
+end;
+
+procedure tsort;
+var
+ cx: integer;
+begin
+ if (iouv> 0) and (s.mlieu<> 0) then
+  if s.conf< 50 then s.conf:= s.conf+ 2
+                else s.conf:= s.conf+ (s.conf div 10);
+ for cx:= 1 to 7 do touv[cx]:= chr(0);
+ ment:= 0;
+ iouv:= 0;
+ mchai:= 0;
+ debloc(s.mlieu);
+end;
+
+procedure st4(ob: integer);
+begin
+ crep:= 997;
+ case ob of
+                114 : crep:=109;
+                110 : crep:=107;
+                158 : crep:=113;
+    152..156,150,
+    100,157,160,161 : tlu(caff,ob);
+ end;
+end;
+
+procedure cherjer(ob: integer; var d: boolean);
+var
+ cx: integer;
+begin
+ d:= false;
+ for cx:= 1 to 6 do d:=(d or (ord(s.sjer[cx])= ob));
+ if s.derobj= ob then d:= true;
+end;
+
+procedure st1sama;
+begin
+ s.mlieu:= 10;
+ affrep;
+end;
+
+procedure modinv;
+var
+ cx, cy, tay, i, r: integer;
+ nom: phrase;
+ nomp: str30;
+begin
+ cy:= 0;
+ for cx:=1 to 6 do
+  if s.sjer[cx]<> chr(0) then
+    begin
+      cy:= succ(cy);
+      r:= (ord(s.sjer[cx])+ 400);
+      DeLine(r-501+c_st41,nom,tay);
+      nomp:= delig;
+      menut( invt[cy], nomp);
+      menu_enable( invt[cx]);
+    end;
+ if cy<6 then
+    for cx:=cy+1 to 6 do
+      begin
+        menut( invt[cx], '                       ');
+        menu_disable( invt[cx]);
+      end;
+end;
+
+procedure sparl(adr, rep: long_integer);
+const haut: array[1..8] of integer
+           =(0,1,-3,6,-2,2,7,-1);
+var
+ key, ad, tay, repint : integer;
+           st : phrase;
+begin
+  repint:=trunc(rep);
+  hide_mouse;
+  DeLine( repint+c_paroles,st,tay);
+  Afftex(st,230,4,65,24,5);
+  f3f8;
+  (*boite(43,30,90,19,15);
+  gotoxy(7,5);
+  write('F3: Encore');
+  gotoxy(7,6);
+  write('F8: Stop');*)
+  key:= 0;
+  repeat
+    parole(repint, haut[caff- 69], 0);
+    atf3f8(key);
+  until key= 66;
+  hirs;
+  show_mouse;
+end;
+
+procedure finfouil;
+  begin
+    fouil:= false;
+    obpart:= false;
+    cs:= 0;
+    is:= 0;
+    mfouen;
+  end;
+
+procedure mfoudi;
+var
+ cx: integer;
+begin
+ for cx:= 1 to 7 do menu_disable( depl[cx]);
+ for cx:=1 to 11 do menu_disable( men[cx]);
+(* menu_disable(menup, scacher);
+ menu_disable(menup, attacher);
+ menu_disable(menup, defoncer);
+ menu_disable(menup, dormir);
+ menu_disable(menup, entrer);
+ menu_disable(menup, fermer);
+ menu_disable(menup, frapper);
+ menu_disable(menup, manger);
+ menu_disable(menup, mettre);
+ menu_disable(menup, ouvrir);
+ menu_disable(menup, sortir);  *)
+ menut( sonder, ' -SUITE- ');
+ menut( soulever, ' -STOP-  ');
+end;
+
+procedure mennor;
+begin
+ menu_up(msg[3]);
+end;
+
+procedure premtet;
+begin
+ dessine(ades, 10, 80);
+ boite(18, 79, 155, 91, 15);
+end;
+
+(* NIVEAU 5 *)
+procedure ajchai;
+  var cx,cy,lderobj: integer;
+
+begin
+  cy:= (acha+ pred(pred(mchai)* 10));
+  cx:= 0;
+  repeat
+   cx:= cx+ 1;
+  until (cx> 9) or (tabdon[cy+ cx]= 0);
+  if tabdon[cy+ cx]= 0 then
+    begin
+      lderobj:= s.derobj;
+      tabdon[cy+ cx]:=lderobj;
+    end
+    else crep:= 192;
+end;
+
+procedure ajjer(ob: integer);
+var
+ cx: integer;
+begin
+ cx:= 0;
+ repeat
+  cx:= cx+ 1;
+ until (cx> 5) or (ord(s.sjer[cx])= 0);
+ if ord(s.sjer[cx])= 0 then
+ begin
+  s.sjer[(cx)]:= chr(ob);
+  modinv;
+ end
+ else crep:= 139;
+end;
+
+procedure t1sama;  (* On entre dans le manoir *)
+var
+ j,h,m: integer;
+ d: boolean;
+begin
+ calch(j,h,m);
+ if (h< 5) and (s.mlieu> 18) then
+ begin
+  cherjer(137,d);
+  if not d then     (* On n'a pas les cl‚s et il est tard *)
+  begin
+    crep:= 1511;
+    tperd;
+  end
+  else st1sama;
+ end
+ else
+ if not s.ipre then     (* c'est votre premiŠre fois ? *)
+ begin
+  ipers:= 255;
+  affper(ipers);
+  caff:= 77;
+  afdes(0);
+  boite(223, 47, 155, 91, 15);
+  repon(2,33);
+  tkey1(false);
+  mennor;
+  hide_mouse;
+  hirs;
+  premtet;
+  sparl(0,140);
+  dessine_rouleau;
+  pendule;
+  show_mouse;
+  s.mlieu:= 0;
+  affrep;
+  t5(10);
+  if not blo then t11(0, m);
+  ipers:= 0;
+  mpers:= 0;
+  s.ipre:= true;
+  (*chech;*)
+ end
+ else  st1sama;
+end;
+
+procedure t1vier;
+begin
+ s.mlieu:= 17;
+ affrep;
+end;
+
+procedure t1neig;
+begin
+ inei:= inei+ 1;
+ if inei> 2 then
+ begin
+   crep:= 1506;
+   tperd;
+ end
+ else
+ begin
+   okdes:= true;
+   s.mlieu:= 19;
+   affrep;
+ end;
+end;
+
+procedure t1deva;
+begin
+ inei:= 0;
+ s.mlieu:= 21;
+ affrep;
+end;
+
+procedure t1derr;
+begin
+ s.mlieu := 22;
+ affrep;
+end;
+
+procedure t1deau;
+begin
+ crep := 1503;
+ tperd;
+end;
+
+procedure tctrm;
+begin
+ repon(2,(3000+ ctrm));
+ ctrm:= 0;
+end;
+
+
+procedure quelquun;
+label 1;
+var
+ haz,cx: integer;
+begin
+ if imen then erase_menu;
+ finfouil;
+ crep:= 997;
+1:
+ if not cache then
+ begin
+  if crep= 997 then crep:= 138;
+  repon(2,crep);
+  if crep= 138 then parole(5, 2, 1) else parole(4, 4, 1);
+  if iouv= 0 then s.conf:= s.conf+ 2 else
+   if s.conf< 50 then s.conf:= s.conf+ 4 else
+    s.conf:= s.conf+ (3* (s.conf div 10));
+  tsort;
+  tmlieu(15);
+  tip(ipers,cx);
+  caff:= 69+ cx;
+  crep:= caff;
+  msg[3]:= discut;
+  msg[4]:= disc[cx];
+  syn:= true;
+  col:= true;
+ end
+ else
+ begin
+  haz:= hazard(1, 3);
+  if haz= 2 then
+  begin
+   cache:= false;
+   crep:= 137;
+   goto 1;
+  end
+  else
+  begin
+   repon(2, 136);
+   haz:= (hazard(0, 4))- 2;
+   parole(3, haz, 1);
+   clsf2;
+   person;
+   debloc(21);
+   affrep;
+  end;
+ end;
+ if imen then draw_menu;
+end;
+
+procedure tsuiv;
+var
+ cx,tbcl: integer;
+ cl,cy: integer;
+begin
+ cy:= acha+ ((mchai- 1)* 10)- 1;
+ cx:= 0;
+ repeat
+  cx:= cx+ 1;
+  cs:= cs+ 1;
+  cl:= cy+ cs;
+  tbcl:= tabdon[cl];
+ until (tbcl <> 0) or (cs> 9);
+ if (tbcl <> 0) and (cs< 11) then
+ begin
+  is:= is+ 1;
+  caff:= tbcl;
+  crep:= caff+ 400;
+  if ipers<> 0 then s.conf:= s.conf+ 2;
+ end
+ else
+ begin
+  affrep;
+  finfouil;
+  if cx> 9 then crep:= 131;
+ end;
+end;
+
+procedure tfleche;
+var
+ qust : boolean;
+ touch : char;
+ dummy,cd,xmo,ymo: integer;
+begin
+ if num= 9999 then exit;
+ fenat(chr(152));
+ rect:= false;
+ repeat
+  touch:=#0;
+
+  repeat
+   mov_mouse(qust,touch);
+   if clic then rect:=(X_S<256*res) and (Y_S<176) and (Y_S>12);
+   tinke;
+  until (qust or rect or anyone);
+
+  if (qust and (touch=#67)) then dummy:=do_alert(stpou,1);
+ until ((touch=#59) or ((touch= #68) and (x<> 0) and (y<>0)) or
+       (anyone) or (rect));
+ if touch=#59 then iesc:= true;
+ if rect then
+   begin
+     x:=X_S;
+     y:=Y_S;
+   end;
+end;
+
+procedure tcoord(sx: integer);
+label 1;
+     var sy,ix,iy,cb,cy,ib: integer;
+         a, b, atdon : integer;
+
+   begin
+     num:= 0;
+     crep:= 999;
+     a:=0;
+     atdon:=amzon+3;
+     cy:= 0;
+     while cy<caff do
+        begin
+          a:=a+tabdon[atdon];
+          atdon:=atdon+4;
+          cy:= succ(cy);
+        end;
+(*     for cy:=0 to caff-1 do
+          a:=a+ tabdon[amzon+3+4*cy];
+     b:= peek(amzon+3+4*caff); *)
+     b:= tabdon[atdon];
+     if b= 0 then goto 1;
+     a:= a+ fleche;
+     cb:= 0;
+     for cy:= 0 to (sx-2) do
+      begin
+        ib:= tabdon[a+cb] shl 8+ tabdon[succ(a+ cb)] ;
+        cb:= cb+ (ib* 4)+ 2;
+      end;
+      ib:= tabdon[a+cb] shl 8+ tabdon[succ(a+ cb)] ;
+      if ib= 0 then goto 1;
+      cy:= 1;
+      repeat
+        cb:= cb+ 2;
+        sx:= tabdon[a+ cb] * res;
+        sy:= tabdon[succ(a+ cb)];
+        cb:= cb+ 2;
+        ix:= tabdon[a+ cb] * res;
+        iy:= tabdon[succ(a+ cb)];
+        cy:= cy+ 1;
+      until ((x>= sx) and (x<= ix) and (y>= sy) and (y<= iy))
+             or (cy> ib);
+      if (x>= sx) and (x<= ix) and (y>= sy) and (y<= iy)
+        then
+          begin
+            num:= cy- 1;
+            exit;
+          end;
+1:
+     crep:= 997;
+   end;
+
+
+procedure st7(ob: integer);
+begin
+ crep:= 183;
+ if (ob= 116) or (ob= 144) then crep:= 104;
+ if (ob= 126) or (ob= 111) then crep:= 108;
+ if ob= 132 then crep:= 111;
+ if ob= 142 then crep:= 112;
+ if crep= 183 then st4(ob);
+end;
+
+procedure treg(ob: integer);
+var
+ mdes: integer;
+begin
+ mdes:= caff;
+ caff:= ob;
+ if ((caff> 29) and (caff< 33)) or (caff= 144) or
+    (caff= 147) or (caff= 149) or (msg[4]= sregarder) then
+ begin
+  afdes(0);
+  if ((caff> 29) and (caff< 33)) then repon(2,caff) else repon(2,(caff+ 400));
+  tkey1(true);
+  caff:= mdes;
+  msg[3]:= 0;
+  crep:= 998;
+ end
+ else
+ begin
+  obpart:= true;
+  crep:= caff+ 400;
+  mfoudi;
+ end;
+end;
+
+procedure avpoing(var ob: integer);
+begin
+ crep:= 999;
+ if s.derobj<> 0 then ajjer(s.derobj);
+ if crep<> 139 then
+ begin
+  modobj(ob+ 400);
+  s.derobj:= ob;
+  ob:= 0;
+ end;
+end;
+
+procedure rechai(var ch: integer);
+var
+ cx: integer;
+begin
+ cx:= s.mlieu;
+ if s.mlieu= 16 then cx:= 14;
+ ch:= tabdon[achai+ (cx* 7)+ pred(num)];
+end;
+
+procedure t23coul(var l: integer);
+var
+ d: boolean;
+begin
+ cherjer(143,d);
+ l:= 14;
+ if not d then
+ begin
+  crep:= 1512;
+  tperd;
+ end;
+end;
+
+procedure maivid;
+begin
+ s.derobj:= 0;
+ modobj(500);
+end;
+
+procedure st13(ob: integer);
+begin
+ if (ob= 114) or (ob= 116) or (ob= 126) or (ob= 132) or
+ (ob= 111) or (ob= 106) or (ob= 102) or (ob= 100) or
+ (ob= 110) or (ob= 153) or (ob= 154) or (ob= 155) or
+ (ob= 156) or (ob= 157) or (ob= 144) or (ob= 158) or
+ (ob= 150) or (ob= 152) then crep:= 999 else crep:= 105;
+end;
+
+procedure aldepl;
+  var dummy:integer;
+begin
+  dummy:=do_alert('[1][Alors, utilisez le menu DEP...][ok]',1);
+end;
diff --git a/engines/mortevielle/original/0/MORT.000 b/engines/mortevielle/original/0/MORT.000
new file mode 100644
index 0000000..5d70cc5
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.000 differ
diff --git a/engines/mortevielle/original/0/MORT.001 b/engines/mortevielle/original/0/MORT.001
new file mode 100644
index 0000000..d646f33
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.001 differ
diff --git a/engines/mortevielle/original/0/MORT.002 b/engines/mortevielle/original/0/MORT.002
new file mode 100644
index 0000000..1756f54
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.002 differ
diff --git a/engines/mortevielle/original/0/MORT.003 b/engines/mortevielle/original/0/MORT.003
new file mode 100644
index 0000000..3e97c6e
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.003 differ
diff --git a/engines/mortevielle/original/0/MORT.004 b/engines/mortevielle/original/0/MORT.004
new file mode 100644
index 0000000..ab9f969
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.004 differ
diff --git a/engines/mortevielle/original/0/MORT.005 b/engines/mortevielle/original/0/MORT.005
new file mode 100644
index 0000000..d1ad3ca
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.005 differ
diff --git a/engines/mortevielle/original/0/MORT.006 b/engines/mortevielle/original/0/MORT.006
new file mode 100644
index 0000000..60dff2a
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.006 differ
diff --git a/engines/mortevielle/original/0/MORT.COM b/engines/mortevielle/original/0/MORT.COM
new file mode 100644
index 0000000..f39b611
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.COM differ
diff --git a/engines/mortevielle/original/0/MORT.IMG b/engines/mortevielle/original/0/MORT.IMG
new file mode 100644
index 0000000..5757cb2
Binary files /dev/null and b/engines/mortevielle/original/0/MORT.IMG differ
diff --git a/engines/mortevielle/original/0/MORT.PAS b/engines/mortevielle/original/0/MORT.PAS
new file mode 100644
index 0000000..6922b75
--- /dev/null
+++ b/engines/mortevielle/original/0/MORT.PAS
@@ -0,0 +1,120 @@
+program mortevielle;
+
+ {$v-}
+ {$k-}
+ {$x-}
+ {$c-}
+
+ {$i  var.mor   }         (* les variables *)
+ {$i  as        }         (* assembleur *)
+ {$i  keyboard  }         (* la gestion du clavier *)
+ {$i  mouse     }         (* la souris  *)
+ {$i  level15   }         (* les fonctions de base *)
+ {$i  droite    }         (* pour faire une droite *)
+ {$i  boite     }
+ {$i  sprint    }         (* l'affichage des textes *)
+ {$i  outtext   }         (* fonctions sup‚rieures d'affichage *)
+ {$i  parole    }         (* les fonctions de la parole *)
+ {$i  alert     }
+ {$i  parole2   }         (* les fonctions de la parole *)
+ (*  debug              le debugging *)
+ {$i  ques      }         (* les questions *)
+ {$i  menu      }         (* les fonctions du menu *)
+ {$i  mor       }         (* divers *)
+ {$i  taffich   }         (* chargement des dessins *)
+ {$i  ovd1      }         (* les fonctions sur disque 1 *)
+ {$i  mor2      }         (* divers *)
+ {$i  actions   }         (* les actions *)
+ {$i  prog      }         (* fonctions toplevel *)
+ {$i  disk      }         (* chargements et sauvegardes *)
+
+(*  ecrihexa            utilitaire *)
+
+procedure divers(np:integer;b:boolean);
+begin
+  teskbd;
+  repeat
+    parole(np, 0, 0);
+    atf3f8(key);
+    if newGd<>Gd then
+       begin
+         Gd:=newGd;
+         hirs;
+         aff50(b);
+       end;
+  until key= 66;
+end;
+
+(* NIVEAU 0 *)
+
+begin
+(*init_debug;*)
+(*  ecri_seg;*)
+  Gd:=Cga;
+  newGd:= Gd;
+  zuul:= False;
+  tesok:= False;
+  chartex;
+  charpal;
+  charge_cfiph;
+  charge_cfiec;
+  zzuul(adcfiec+161,0,1644);
+  c_zzz:= 1;
+  init_nbrepm;
+  init_mouse;
+(*  crep:=memw[$7f00:0];
+  memw[$7f00:0]:= crep+1;
+  if (memw[$7f00:0]<> crep+1) then
+     begin
+       hirs;
+       show_mouse;
+       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
+       clrscr;
+       halt;
+     end;
+  if (Dseg+$1000>adbruit5) then
+     begin
+       hirs;
+       show_mouse;
+       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
+       clrscr;
+       halt;
+     end;*)
+  init_lieu;
+  arret:= False;
+  sonoff:= False;
+  f2_all:= False;
+  textcolor(9);
+  teskbd;
+  dialpre;
+  newGd:= Gd;
+  teskbd;
+  if newGd<>Gd then Gd:=newGd;
+  hirs;
+  ades:= $7000;
+  aff50(false);
+  mlec:= 0;
+  divers(142,False);
+
+  ani50;
+  divers(143,True);
+  suite;
+  music;
+  adzon;
+  takesav(0);
+  if rech_cfiec then charge_cfiec;
+  for crep:=1 to c_zzz do zzuul(adcfiec+161,0,1644);
+  charge_bruit5;
+  init_menu;
+
+  theure;
+  dprog;
+  hirs;
+  dessine_rouleau;
+  show_mouse;
+  repeat tjouer until arret;
+  hide_mouse;
+  clrscr;
+(*out_debug;*)
+end.
+
diff --git a/engines/mortevielle/original/0/MOUSE.PAS b/engines/mortevielle/original/0/MOUSE.PAS
new file mode 100644
index 0000000..4f3b361
--- /dev/null
+++ b/engines/mortevielle/original/0/MOUSE.PAS
@@ -0,0 +1,431 @@
+const
+       m_arrow       = 0;
+       m_point_hand  = 1;
+
+var  int_m,
+     clic : boolean;
+
+     m_show,
+     X_S,
+     Y_S,
+     P_O_S,
+     mouse_shwn : integer;
+
+     S_S  : array[0..5,0..11] of integer;
+
+
+procedure init_mouse;
+  var i, j : integer;
+       reg : registres;
+begin
+  mouse_shwn:= 0;
+  X_S:= 0;
+  Y_S:= 0;
+  P_O_S:= 0;
+  (*int_m:= False;*)
+  clic:= False;
+  m_show:= m_arrow;
+  if (memw[0:$cc]=0) and (memw[0:$ce]=0) then int_m:= False;
+  if int_m then
+   begin
+    reg.ax:= 0;
+    intr($33,reg);
+    int_m:= (reg.ax=-1);
+    if int_m then
+      begin
+       with reg do
+         begin
+           ax:=4;
+           cx:=0;
+           dx:=0;
+         end;
+       intr($33,reg);
+     end;
+   end;
+end;
+
+(*procedure change_mouse( t : integer );
+begin
+  m_show:= t;
+end;*)
+
+(*procedure dessine_souris(xf,yf:integer);
+  var x, xx, y :integer;
+begin
+  case m_show of
+             m_arrow : begin
+                         affput(2,Gd,xf,yf,0,0);
+                       end;
+  end;
+end;  *)
+
+procedure hide_mouse;
+  var i,j,k,ps,ds:integer;
+      imp:boolean;
+begin
+  mouse_shwn := pred(mouse_shwn);
+  if mouse_shwn=0 then
+     begin
+       imp:= odd(Y_S);
+       j:=P_O_S;
+       case Gd of
+             cga : begin
+                     k:=0;
+                     j:=Y_S shr 1 * 80+ X_S shr 2;
+                     repeat
+                       memw[$b800:j]:=S_S[0,k];
+                       memw[$b800:j+2]:=S_S[1,k];
+                       memw[$ba00:j]:=S_S[2,k];
+                       memw[$ba00:j+2]:=S_S[3,k];
+                       j:=j+80;
+                       k:= succ(k);
+                     until k>=5;
+                   end;
+                ams : begin
+                        for i:=0 to 3 do
+                        begin
+                          port[$3DD]:= 1 shl i;
+                          k:=0;
+                          j:=P_O_S;
+                          repeat
+                            if imp then
+                              begin
+                                memw[$b800:j]:=S_S[i,k];
+                                j:=j+80-$2000;
+                              end
+                             else
+                              begin
+                                memw[$b800:j]:=S_S[i,k];
+                                j:=j+$2000;
+                              end;
+                            imp:=not imp;
+                            k:= succ(k);
+                          until k>=8;
+                        end;
+                      end;
+                ega : begin
+                        port[$3C4]:=2;
+                        port[$3CE]:=8;
+                        port[$3CF]:=255;
+                        i:= 0;
+                        repeat
+                          port[$3C5]:= 1 shl i;
+                          k:=0;
+                          j:=P_O_S;
+                          repeat
+                            ps:=mem[$A000:j];
+                            mem[$A000:j]:=lo(S_S[i,k]);
+                            ps:=mem[$A000:j+1];
+                            mem[$A000:j+1]:=hi(S_S[i,k]);
+                            j:=j+80;
+                            k:= succ(k);
+                          until k>=8;
+                          i:= i+1;
+                        until i=4;
+                      end;
+                her : begin
+                        j:= Y_S shr 1 *80+X_S shr 3;
+                        for i:=0 to 5 do
+                         begin
+                           for k:=0 to 3 do memw[$b000+k*$200:j]:=S_S[i,k];
+                           j:=j+80;
+                         end;
+                      end;
+                tan : begin
+                        j:= Y_S shr 2 *160+X_S shr 1;
+                        k:=0;
+                        repeat
+                          for i:=0 to 3 do
+                           begin
+                             memw[$b800+$200*i:j]:=S_S[k,i+k shl 2];
+                             memw[$b800+$200*i:j+2]:=S_S[k+3,i+k shl 2];
+                           end;
+                          j:=j+160;
+                          k:= succ(k);
+                        until k=3;
+                      end;
+
+       end;  (* case Gd *)
+     end;
+end;
+
+procedure show_mouse;
+  var i, j, k, l,
+      ps,ds : integer;
+      imp:boolean;
+      c : char;
+begin
+  mouse_shwn := mouse_shwn +1;
+  if mouse_shwn<>1 then exit;
+  j:=P_O_S;
+  imp:= odd(Y_S);
+  i:=X_S and 7;
+  case Gd of
+             cga : begin
+                     k:=0;
+                     j:=Y_S shr 1 * 80+ X_S shr 2;
+                     repeat
+                       S_S[0,k]:=memw[$b800:j];
+                       S_S[1,k]:=memw[$b800:j+2];
+                       S_S[2,k]:=memw[$ba00:j];
+                       S_S[3,k]:=memw[$ba00:j+2];
+                       j:=j+80;
+                       k:= succ(k);
+                     until k>=5;
+                   end;
+          ams : begin
+                  for i:=0 to 3 do
+                        begin
+                          j:=P_O_S;
+                          imp:= odd(Y_S);
+                          port[$3DE]:= i;
+                          k:=0;
+                          repeat
+                            if imp then
+                              begin
+                                S_S[i,k]:=memw[$b800:j];
+                                j:=j+80-$2000;
+                              end
+                             else
+                              begin
+                                S_S[i,k]:=memw[$b800:j];
+                                j:=j+$2000;
+                              end;
+                            imp:=not imp;
+                            k:= succ(k);
+                          until k>=8;
+                        end;
+                end;
+          ega : begin
+                  port[$3CE]:=4;
+                  l:= 0;
+                  repeat
+                    port[$3CF]:= l;
+                    k:=0;
+                    j:=P_O_S;
+                    repeat
+                      S_S[l,k]:= mem[$A000:j]+mem[$A000:succ(j)] shl 8;
+                      j:=j+80;
+                      k:= succ(k);
+                    until k>=8;
+                    l:= l+1;
+                  until l=4;
+                end;
+          her : begin
+                  j:= Y_S shr 1 *80+X_S shr 3;
+                  for i:=0 to 5 do
+                   begin
+                     for k:=0 to 3 do S_S[i,k]:=memw[$b000+k*$200:j];
+                     j:=j+80;
+                   end;
+                end;
+          tan : begin
+                  j:= Y_S shr 2*160+X_S shr 1;
+                  k:=0;
+                  repeat
+                    for i:=0 to 3 do
+                      begin
+                        S_S[k,i+k shl 2]:=memw[$b800+$200*i:j];
+                        S_S[k+3,i+k shl 2]:=memw[$b800+$200*i:j+2];
+                      end;
+                    j:=j+160;
+                    k:= succ(k);
+                  until k=3;
+                end;
+  end; (*  case Gd   *)
+  affput(2,Gd,X_S,Y_S,0,0);
+end;
+
+procedure pos_mouse(x,y : integer);
+  var reg:registres;
+begin
+  if x>314*res then x:=314*res
+           else if x<0 then x:=0;
+  if y>199 then y:=199
+           else if y<0 then y:=0;
+  if (x=X_S) and (y=Y_S) then exit;
+  if int_m then
+     begin
+       with reg do
+         begin
+           ax:=4;
+           cx:=x;
+           dx:=y;
+         end;
+       intr($33,reg);
+     end;
+  hide_mouse;
+  X_S:=x;
+  Y_S:=y;
+  case Gd of
+          ams : begin
+                  P_O_S:=(Y_S shr 1)*80+X_S shr 3+(Y_S and 1)*$2000;
+                end;
+          (*cga : begin
+                  P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
+                end;*)
+          ega : begin
+                  P_O_S:=Y_S*80+X_S shr 3;
+                end;
+  end; (*  case Gd   *)
+  show_mouse;
+end;
+
+procedure read_pos_mouse(var x,y,c:integer);
+   var reg:registres;
+begin
+  if int_m then
+     begin
+       reg.ax:=3;
+       intr($33,reg);
+       x:=reg.cx;
+       y:=reg.dx;
+       c:=reg.bx;
+     end
+    else
+     begin
+       c:=0;
+       x:=X_S;
+       y:=Y_S;
+     end;
+end;
+
+procedure mov_mouse(var funct : boolean; var key : char);
+     var p_key : boolean;
+         in1, in2 : char;
+         x,y,cx,cy,cd:integer;
+         reg:registres;
+   begin
+     if int_m then
+     begin
+       reg.ax:=3;
+       intr($33,reg);
+       x:=reg.cx;
+       y:=reg.dx;
+       cd:=reg.bx;
+       pos_mouse(x,y);
+       if cd<>0 then
+          begin
+            clic:=true;
+            exit;
+          end;
+     end;
+     funct:=false;
+     key:=#255;
+     p_key:=keypressed;
+     while p_key do
+        begin
+          read(kbd,in1);
+          read_pos_mouse(cx, cy, cd);
+          case upcase(in1) of
+                         '4' : cx:= cx - 8;
+                         '2' : cy:= cy + 8;
+                         '6' : cx:= cx + 8;
+                         '8' : cy:= cy - 8;
+                         '7' : begin
+                                 cy:=1;
+                                 cx:=1;
+                               end;
+                         '1' : begin
+                                 cx:=1;
+                                 cy:=190;
+                               end;
+                         '9' : begin
+                                 cx:=315*res;
+                                 cy:=1;
+                               end;
+                         '3' : begin
+                                 cy:=190;
+                                 cx:=315*res;
+                               end;
+                         '5' : begin
+                                 cy:=100;
+                                 cx:=155*res;
+                               end;
+                    ' ', #13 : begin
+                                 clic:=true;
+                                 exit;
+                               end;
+                         #27 : begin
+                                 p_key:=keypressed;
+                                 if p_key then
+                                    begin
+                                      read(kbd,in2);
+                                      case in2 of
+                                               'K' : cx:= pred(cx);
+                                               'P' : cy:= succ(cy);
+                                               'M' : cx:= cx + 2;
+                                               'H' : cy:= pred(cy);
+                                               ';'..'D' : begin
+                                                            funct:= true;
+                                                            key:=in2;
+                                                            exit;
+                                                          end;
+                                               'G' : begin
+                                                       cx:=cx-1;
+                                                       cy:=cy-1;
+                                                     end;
+                                               'I' : begin
+                                                       cx:=cx+1;
+                                                       cy:=cy-1;
+                                                     end;
+                                               'O' : begin
+                                                       cx:=cx-1;
+                                                       cy:=cy+1;
+                                                     end;
+                                               'Q' : begin
+                                                       cx:=cx+1;
+                                                       cy:=cy+1;
+                                                     end;
+                                            end; (* case *)
+                                    end;
+                               end;
+                         'I' : begin
+                                 cx:= res*32;
+                                 cy:= 8;
+                               end;
+                         'D' : begin
+                                 cx:= 80*res;
+                                 cy:= 8;
+                               end;
+                         'A' : begin
+                                 cx:= 126*res;
+                                 cy:= 8;
+                               end;
+                         'S' : begin
+                                 cx:= 174*res;
+                                 cy:= 8;
+                               end;
+                         'P' : begin
+                                 cx:= 222*res;
+                                 cy:= 8;
+                               end;
+                         'F' : begin
+                                 cx:= res*270;
+                                 cy:= 8;
+                               end;
+                         #19 : begin
+                                 sonoff:= not sonoff;
+                                 exit;
+                               end;
+                         #22 : begin
+                                 zuul:=True;
+                                 exit;
+                               end;
+                         #20 : begin           (* ^T => mode tandy *)
+                                 funct:= true;
+                                 key:= #9;
+                               end;
+                          #8 : begin           (* ^H => mode Hercule *)
+                                 funct:= true;
+                                 key:= #7;
+                               end;
+                    #1,#3,#5 : begin
+                                 funct:= true;
+                                 key:=in1;
+                               end;
+                end;
+          pos_mouse(cx, cy);
+          p_key:=keypressed;
+        end;
+   end;
diff --git a/engines/mortevielle/original/0/MUSINT.COM b/engines/mortevielle/original/0/MUSINT.COM
new file mode 100644
index 0000000..a8fd455
Binary files /dev/null and b/engines/mortevielle/original/0/MUSINT.COM differ
diff --git a/engines/mortevielle/original/0/MUSINT2.COM b/engines/mortevielle/original/0/MUSINT2.COM
new file mode 100644
index 0000000..9ef47df
Binary files /dev/null and b/engines/mortevielle/original/0/MUSINT2.COM differ
diff --git a/engines/mortevielle/original/0/MXX.MOR b/engines/mortevielle/original/0/MXX.MOR
new file mode 100644
index 0000000..73c732d
Binary files /dev/null and b/engines/mortevielle/original/0/MXX.MOR differ
diff --git a/engines/mortevielle/original/0/NEWMENU.PAS b/engines/mortevielle/original/0/NEWMENU.PAS
new file mode 100644
index 0000000..4acd4c4
--- /dev/null
+++ b/engines/mortevielle/original/0/NEWMENU.PAS
@@ -0,0 +1,336 @@
+const ams=0; cga=1; ega=2;
+      NbMenu=6;
+
+const newlet : array[0..29] of byte
+             = ( $00, $00, $00,
+                 $1F, $DC, $00,
+                 $0E, $00, $00,
+                 $0E, $78, $F8,
+                 $1F, $39, $DC,
+                 $1C, $73, $80,
+                 $38, $73, $B8,
+                 $7B, $FB, $E0,
+                 $00, $00, $00,
+                 $00, $00, $00 );
+
+     lettr_ang : array[1..6,0..23] of byte
+             = ((   (* Inv *)
+                  $1C, $00, $00,
+                  $08, $00, $00,
+                  $12, $C7, $70,
+                  $11, $22, $20,
+                  $22, $42, $40,
+                  $22, $42, $80,
+                  $EE, $C3, $00,
+                  $00, $00, $00 ),
+
+                (   (* Mov *)
+                  $30, $C0, $00,
+                  $11, $80, $00,
+                  $3B, $0E, $77,
+                  $2D, $12, $22,
+                  $42, $22, $24,
+                  $42, $24, $28,
+                  $C6, $38, $30,
+                  $00, $00, $00 ),
+
+                (   (* Act *)
+                  $02, $00, $20,
+                  $06, $00, $20,
+                  $0A, $1E, $F0,
+                  $12, $22, $40,
+                  $3E, $40, $80,
+                  $42, $44, $80,
+                  $EE, $38, $C0,
+                  $00, $00, $00 ),
+
+                (   (* Self *)
+                  $0F, $80, $E7,
+                  $10, $80, $49,
+                  $20, $38, $88,
+                  $1E, $44, $9C,
+                  $02, $F9, $10,
+                  $42, $81, $20,
+                  $FC, $E7, $70,
+                  $00, $00, $00 ),
+
+                (   (* Dis *)
+                  $3E, $10, $00,
+                  $11, $00, $00,
+                  $21, $63, $C0,
+                  $21, $24, $00,
+                  $42, $47, $00,
+                  $44, $40, $80,
+                  $F9, $DF, $00,
+                  $00, $00, $00 ),
+
+                (  (* File *)
+                  $1F, $C9, $80,
+                  $08, $40, $80,
+                  $12, $31, $1C,
+                  $1E, $11, $22,
+                  $24, $22, $3C,
+                  $20, $22, $40,
+                  $E0, $EE, $70,
+                  $00, $00, $00 ));
+
+     lettr_all : array[1..6,0..23] of byte
+             = ((   (* Inv *)
+                  $1C, $00, $00,
+                  $08, $00, $00,
+                  $12, $C7, $70,
+                  $11, $22, $20,
+                  $22, $42, $40,
+                  $22, $42, $80,
+                  $EE, $C3, $00,
+                  $00, $00, $00 ),
+
+                (   (* Dep *)
+                  $3E, $00, $00,
+                  $11, $00, $00,
+                  $21, $39, $70,
+                  $21, $44, $88,
+                  $42, $79, $10,
+                  $44, $81, $E0,
+                  $F8, $E2, $00,
+                  $00, $07, $00 ),
+
+                (   (* Akt *)
+                  $02, $18, $10,
+                  $0E, $08, $10,
+                  $0A, $13, $78,
+                  $12, $14, $20,
+                  $3E, $38, $40,
+                  $42, $24, $40,
+                  $EE, $EC, $60,
+                  $00, $00, $00 ),
+
+                (  (* Self *)
+                  $0F, $80, $E7,
+                  $10, $80, $49,
+                  $20, $38, $88,
+                  $1E, $44, $9C,
+                  $02, $F9, $10,
+                  $42, $81, $20,
+                  $FC, $E7, $70,
+                  $00, $00, $00 ),
+
+                (   (* Dis *)
+                  $3E, $10, $00,
+                  $11, $00, $00,
+                  $21, $63, $C0,
+                  $21, $24, $00,
+                  $42, $47, $00,
+                  $44, $40, $80,
+                  $F9, $DF, $00,
+                  $00, $00, $00 ),
+
+                (   (* Fic *)
+                  $1F, $C8, $00,
+                  $08, $40, $00,
+                  $12, $31, $E0,
+                  $1E, $12, $20,
+                  $24, $24, $00,
+                  $20, $24, $40,
+                  $E0, $E3, $80,
+                  $00, $00, $00 ));
+
+     lettr_fra : array[1..6,0..23] of byte
+             = ((   (* Inv *)
+                  $1C, $00, $00,
+                  $08, $00, $00,
+                  $12, $C7, $70,
+                  $11, $22, $20,
+                  $22, $42, $40,
+                  $22, $42, $80,
+                  $EE, $C3, $00,
+                  $00, $00, $00 ),
+
+                (   (* D‚p *)
+                  $3E, $0C, $00,
+                  $11, $10, $00,
+                  $21, $39, $70,
+                  $21, $44, $88,
+                  $42, $79, $10,
+                  $44, $81, $E0,
+                  $F8, $E2, $00,
+                  $00, $07, $00 ),
+
+                (   (* Act *)
+                  $02, $00, $20,
+                  $06, $00, $20,
+                  $0A, $1E, $F0,
+                  $12, $22, $40,
+                  $3E, $40, $80,
+                  $42, $44, $80,
+                  $EE, $38, $C0,
+                  $00, $00, $00 ),
+
+                (  (* Self *)
+                  $0F, $80, $E7,
+                  $10, $80, $49,
+                  $20, $38, $88,
+                  $1E, $44, $9C,
+                  $02, $F9, $10,
+                  $42, $81, $20,
+                  $FC, $E7, $70,
+                  $00, $00, $00 ),
+
+                (   (* Dis *)
+                  $3E, $10, $00,
+                  $11, $00, $00,
+                  $21, $63, $C0,
+                  $21, $24, $00,
+                  $42, $47, $00,
+                  $44, $40, $80,
+                  $F9, $DF, $00,
+                  $00, $00, $00 ),
+
+                (   (* Fic *)
+                  $1F, $C8, $00,
+                  $08, $40, $00,
+                  $12, $31, $E0,
+                  $1E, $12, $20,
+                  $24, $24, $00,
+                  $20, $24, $40,
+                  $E0, $E3, $80,
+                  $00, $00, $00 ));
+
+type registres = record
+                   ax, bx, cx, dx, bp, sp, di, si, ds, es, Flags : integer;
+                 end;
+
+var Gd, res,coul : integer;
+    lettres : array[1..6,0..23] of byte;
+
+procedure affput(Chx,Gd,x,y,coul,char:integer); external 'c:\usr\mort\asm\divaf.com';
+
+procedure affcar(Gd,x,y,coul,char:integer);
+begin
+  if res=1 then affput(1,Gd,(x shr 1),y,coul,char)
+           else affput(1,Gd,x,y,coul,char);
+end;
+
+procedure putpix(Gd,x,y,coul:integer);
+begin
+  affput(0,Gd,x,y,coul,0);
+end;
+
+procedure hirs;
+   var i,  j : integer;
+begin
+  case Gd of
+    cga :
+     begin
+       graphcolormode;
+       graphbackground(0);
+       Palette(1);
+     end;
+    ams :
+     begin
+       hires;
+       inline($B8/6/0/        (*  =>  mov ax, 6 *)
+              $CD/$10);       (*  =>  int 16   *)
+       port[$3D9]:=15;
+       port[$3DF]:=0;
+       port[$3DD]:=15;
+     end;
+    ega :
+     inline($B8 / 14 / 0 /     (*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs *)
+            $CD / $10);        (*  INT 16  *)
+  end;
+end;
+
+
+(* NIVEAU 14*)
+
+procedure init_menu;
+    var
+        f : file;
+  begin
+    assign(f,'c:\usr\mort\menuan.mor');
+    reset(f,144);
+    blockread(f,lettres,1);
+    close(f);
+  end;
+
+procedure save_menu;
+    var
+        f : file;
+  begin
+    assign(f,'c:\usr\mort\menual.mor');
+    rewrite(f,144);
+    blockwrite(f,lettr_all,1);
+    close(f);
+    assign(f,'c:\usr\mort\menuan.mor');
+    rewrite(f,144);
+    blockwrite(f,lettr_ang,1);
+    close(f);
+
+  end;
+
+
+(*---------------------------------------------------------------------------*)
+(*--------------------   PROCEDURES  EN  ASSEMBLEUR   -----------------------*)
+(*---------------------------------------------------------------------------*)
+
+procedure box(c,Gd,xo,yo,xi,yi,patt:integer);
+     external 'c:\usr\mort\asm\boite.com';
+
+
+procedure menu_aff;
+     var
+         ind_tabl,k,col:integer;
+         c: char;
+         pt,x,y,color,msk,
+         num_letr: integer;
+   begin
+     (* debug('menu_aff'); *)
+     box( 7, Gd, 0,0, 639,10, 255);
+     col:= 28*res;
+     if Gd = cga then color:=1
+                 else color:=11;
+     num_letr:=0;
+     repeat     (* lettre par lettre *)
+       num_letr:= num_letr +1;
+       ind_tabl:=0;
+       y:= 1;
+       repeat    (* colonne par colonne *)
+         k:=0;
+         x:= col;
+         repeat   (* ligne par ligne *)
+           msk:=$80;
+           for pt:=0 to 7 do
+            begin
+              if (lettres[num_letr,ind_tabl] and msk)<>0 then
+                 begin
+                   putpix(Gd,x+1,y+1,0);
+                   putpix(Gd,x,y+1,0);
+                   putpix(Gd,x,y,color);
+                 end;
+              msk:= msk shr 1;
+              x:=x +1;
+            end;
+           ind_tabl:=succ(ind_tabl);
+           k:=succ(k);
+         until k=3;
+         y:=y+1;
+       until (y=9);
+       col:=col+48*res;
+     until num_letr=6;
+   end;
+
+
+begin
+  gd:=ega;
+  res:=2;
+  init_menu;
+  repeat
+    hirs;
+    menu_aff;
+    gotoxy(1,20);
+    write('Enter new Gd : ');
+    readln(Gd);
+    if gd=cga then res:=1 else res:=2;
+  until gd>2;
+end.
diff --git a/engines/mortevielle/original/0/OUTTEXT.PAS b/engines/mortevielle/original/0/OUTTEXT.PAS
new file mode 100644
index 0000000..e5be32c
--- /dev/null
+++ b/engines/mortevielle/original/0/OUTTEXT.PAS
@@ -0,0 +1,189 @@
+var delig : str255;
+const
+               tabdr : array [0..31] of byte
+                     = (  32, 101, 115,  97, 114, 105, 110,
+                         117, 116, 111, 108,  13, 100,  99,
+                         112, 109,  46, 118, 130,  39, 102,
+                          98,  44, 113, 104, 103,  33,  76,
+                          85, 106,  30,  31 );
+
+
+               tab30 : array [0..31] of byte
+                     =(   69,  67,  74, 138, 133, 120,  77, 122,
+                         121,  68,  65,  63,  73,  80,  83,  82,
+                         156,  45,  58,  79,  49,  86,  78,  84,
+                          71,  81,  64,  66, 135,  34, 136,  91 );
+
+
+
+               tab31 : array [0..31] of byte
+                     = (  93,  47,  48,  53,  50,  70, 124,  75,
+                          72, 147, 140, 150, 151,  57,  56,  51,
+                         107, 139,  55,  89, 131,  37,  54,  88,
+                         119,   0,   0,   0,   0,   0,   0,   0 );
+
+procedure DeLine( num :integer ; var L:phrase ; var TL:integer );
+        var i,j,TS : integer;
+            let : char;
+             pS, k : byte;
+            the_end : boolean;
+        procedure cinq_huit( var c:char; var ind:integer; var pt:byte);
+             const rap : array[0..31] of char
+                 =( ',', ':', '@', '!', '?', '-', '‡',
+                    ' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
+                    '‹', 'Œ', '¢', #39, '“', '"', '—',
+                    '–', '0', '1', '2', '3', '4', '5',
+                    '6', '7', '8', '9');
+             var oct,ocd:integer;
+
+           begin    (* 5-8 *)
+             oct:=T_mot[ind];
+             oct:=(oct shl (16-pt)) shr (16-pt);
+             if pt<6 then
+                begin
+                  ind:=ind+1;
+                  oct:=oct shl (5-pt);
+                  pt:=pt+11;
+                  oct:=oct or (T_mot[ind] shr pt);
+                end
+              else
+                begin
+                  pt:=pt-5;
+                  oct:=oct shr pt;
+                end;
+
+             case oct of
+                          11 : begin
+                                 c:= '$';
+                                 The_end:= True;
+                               end;
+                       30,31 : begin
+                                 ocd:=T_mot[ind];
+                                 ocd:=(ocd shl (16-pt)) shr (16-pt);
+                                 if pt<6 then
+                                    begin
+                                      ind:=ind+1;
+                                      ocd:=ocd shl (5-pt);
+                                      pt:=pt+11;
+                                      ocd:=ocd or (T_mot[ind] shr pt);
+                                    end
+                                  else
+                                    begin
+                                      pt:=pt-5;
+                                      ocd:=ocd shr pt;
+                                    end;
+                                  if oct=30 then c:=chr(tab30[ocd])
+                                            else c:=chr(tab31[ocd]);
+                                  if c=#0 then
+                                     begin
+                                       The_end:=True;
+                                       c:='#';
+                                     end;
+                                end;
+                      else c:=chr(tabdr[oct]);
+                    end;
+           end;   (* 5-8 *)
+
+      begin   (* DETEX *)
+        (*debug('  => DeLine');*)
+        delig:='';
+        TS:= T_rec[num].indis;
+        pS:= T_rec[num].point;
+        i:=TS;
+        TL:=1;
+        j:=1;
+        k:=pS;
+        the_end:=False;
+        repeat
+          cinq_huit(let,i,k);
+          L[j]:=let;
+          if j<254 then delig:=delig+let;
+          j:=j+1;
+        until  the_end;
+        TL:=j-1;
+        if TL<255 then delig:=copy(delig,1,TL-1);    (* enleve le $ *)
+      end;    (* DETEX *)
+
+
+procedure afftex( Ch: phrase; x,y,dx,dy, typ : integer);
+    var the_end : boolean;
+        touch : char;
+        xf,yf : integer;
+        xc,yc : integer;
+        tab, p : integer;
+        s : string[255];
+        i,j,nt : integer;
+
+    function l_motsuiv(p:integer):integer;
+        var c:integer;
+      begin
+        c:=p;
+        while not (Ch[p] in [' ','$','@']) do p:=p+1;
+        l_motsuiv:=tab*(p-c);
+      end;
+
+  begin
+(*    debug('  .. Afftex');*)
+    putxy(x,y);
+    if res=1 then tab:=10 else tab:=6;
+    dx:= dx * 6;
+    dy:= dy * 6;
+    xc:= x;
+    yc:= y;
+    xf:= x+dx;
+    yf:= y+dy;
+    p:= 1;
+    the_end:=(Ch[p]='$');
+    s:='';
+    while not the_end do
+     begin
+      case Ch[p] of
+                  '@' : begin
+                          writeg(s,typ);
+                          s:='';
+                          p:=p+1;
+                          xc:=x;
+                          yc:=yc+6;
+                          putxy(xc,yc);
+                        end;
+                  ' ' : begin
+                          s:=s+' ';
+                          xc:=xc+tab;
+                          p:=p+1;
+                          if l_motsuiv(p)+xc > xf then
+                             begin
+                               writeg(s,typ);
+                               s:='';
+                               xc:=x;
+                               yc:=yc+6;
+                               if yc>yf then
+                                  begin
+                                    repeat until keypressed;
+                                    i:=y;
+                                    repeat
+                                      j:=x;
+                                      repeat
+                                        putxy(j,i);
+                                        writeg(' ',0);
+                                        j:=j+6;
+                                      until j>xf;
+                                      i:=i+6;
+                                    until i>yf;
+                                    yc:=y;
+                                  end;
+                               putxy(xc,yc);
+                             end;
+                        end;
+                  '$' : begin
+                          the_end:= True;
+                          writeg(s,typ);
+                        end;
+        else
+        begin
+          s:=s+Ch[p];
+          p:=p+1;
+          xc:=xc+tab;
+        end;
+      end;  (* case *)
+    end;
+ end;
diff --git a/engines/mortevielle/original/0/OVD1.PAS b/engines/mortevielle/original/0/OVD1.PAS
new file mode 100644
index 0000000..81e3c91
--- /dev/null
+++ b/engines/mortevielle/original/0/OVD1.PAS
@@ -0,0 +1,339 @@
+procedure dem2;
+  var f:file;
+      k:integer;
+begin
+  { -- demande de disk 2 -- }
+  while ioresult<>0 do;
+  assign(f,'mort.001');
+  {$i-}
+  reset(f);
+  while ioresult<>0 do
+   begin
+     show_mouse;
+     k:= do_alert(al_mess2,1);
+     hide_mouse;
+     reset(f);
+   end;
+  close(f);
+end;
+
+procedure ani50;
+  begin
+    crep:= animof(1,1);
+    PictOut(adani,crep,63,12);
+    crep:= animof(2,1);
+    PictOut(adani,crep,63,12);
+    f2_all:= (res=1);
+    repon(2, c_paroles+143);
+  end;
+
+(*overlay procedure apzuul;
+  begin
+    if (c_zzz=1) or (c_zzz=2) then
+     begin
+       zzuul(adcfiec+161,0,1644);
+       c_zzz:=succ(c_zzz);
+     end;
+  end;*)
+
+overlay procedure aff50(c:boolean);
+    var k:integer;
+  begin
+    caff:= 50;
+    maff:=0;
+    taffich;
+    dessine(ades,63,12);
+    if c then ani50
+         else repon(2, c_paroles+142);
+    f3f8;
+  end;
+
+overlay procedure init_menu;
+    var i, j, tai : integer;
+        st        : phrase;
+        f : file;
+  begin
+    assign(f,'menufr.mor');
+    {$i-}
+    reset(f,144);
+    blockread(f,lettres,1);
+    close(f);
+    { ----  Demande de changement de disquette  ---- }
+    dem2;
+
+
+    for i:= 1 to 8 do
+       inv[i]:= '*                     ';
+    inv[7]:= '< -*-*-*-*-*-*-*-*-*- ';
+    for i:= 1 to 7 do
+       dep[i]:= '*                       ';
+    i:= 1;
+    repeat
+      DeLine(i+c_action,st,tai);
+      act[i]:= delig + '          ';
+      if i<9 then
+         begin
+           if i<6 then
+              begin
+                DeLine(i+c_saction,st,tai);
+                self[i]:= delig + '       ';
+              end;
+           DeLine(i+c_dis,st,tai);
+           dis[i]:= delig+ ' ';
+         end;
+      i:= succ(i);
+    until i= 22;
+    for i:= 1 to 8 do
+      begin
+       disc[i]:=$500+i;
+       if i<8 then depl[i]:=$200+i;
+       invt[i]:=$100+i;
+       if i>6 then menu_disable(invt[i]);
+      end;
+    msg3:=no_choice;
+    msg4:=no_choice;
+    msg[3]:=no_choice;
+    msg[4]:=no_choice;
+    clic:=false;
+  end;
+
+
+overlay procedure charpal;
+   var f : file of tabdb;
+       ft : file of tfxx;
+       i,j,k : integer;
+       fb : file of byte;
+       b : byte;
+begin
+  assign(ft,'fxx.mor');
+  {$i-}
+  reset(ft);
+  if ioresult<>0 then
+           begin
+             caff:=do_alert(err_mess,1);
+             halt;
+           end;
+  read(ft,l);
+  close(ft);
+  assign(f,'plxx.mor');
+  reset(f);
+  for i:= 0 to 90 do read(f,tabpal[i]);
+  close(f);
+  assign(fb,  'cxx.mor');
+  reset(fb);
+  for j:=0 to 90 do
+    begin
+      read(fb,palcga[j].p);
+      for i:=0 to 15 do
+        with palcga[j].a[i] do
+          begin
+            read(fb,b);
+            n:=b shr 4;
+            hom[0]:= b shr 2 and 3;
+            hom[1]:= b and 3;
+          end;
+    end;
+  palcga[10].a[9]:= palcga[10].a[5];
+  for j:=0 to 14 do
+    begin
+      read(fb,tpt[j].tax);
+      read(fb,tpt[j].tay);
+      for i:=1 to 20 do
+        for k:=1 to 20 do
+          read(fb,tpt[j].des[i,k]);
+    end;
+  close(fb);
+end;
+
+overlay procedure chartex;
+  var i:integer;
+      FiByte:file;
+      s : phrase;
+begin
+(* debug('o3 chartex'); *)
+  i:=0;
+  assign(FiByte,'TXX.INP');
+  {$i-}
+  reset(FiByte);
+  blockread(FiByte,T_mot,125);
+  close(FiByte);
+  assign(sauv_T,'TXX.NTP');
+  reset(sauv_T);
+  repeat
+    read(sauv_T,T_rec[i]);
+    i:=i+1;
+  until eof(sauv_T);
+  close(sauv_T);
+  DeLine(578,s,i);
+  al_mess:= delig;
+  DeLine(579,s,i);
+  err_mess:= delig;
+  DeLine(580,s,i);
+  ind_mess:= delig;
+  DeLine(581,s,i);
+  al_mess2:= delig;
+end;
+
+overlay procedure dialpre;
+
+var
+ cy, tay  : integer;
+ st : phrase;
+ ix : real;
+ ch : char;
+
+begin
+ (* debug('o3 dialpre'); *)
+ cy:=0;
+ clrscr;
+ textcolor(9);
+ repeat
+   cy:= cy+1;
+   DeLine( cy+c_dialpre,st,tay);
+   gotoxy(40-tay div 2,wherey+1);
+   write(delig);
+ until cy=20;
+ ix:=0;
+ repeat
+   ix:= ix+1;
+ until (keypressed or (ix=5e5));
+ crep:= 998;
+ textcolor(1);
+ gotoxy(1,21); clreol;
+ gotoxy(1,23);
+ write('CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512');
+ gotoxy(12,24);
+ write('Ctrl       C      E            H             T           A');
+ repeat
+   read(kbd,ch);
+ until ch in [#1,#3,#5,#20,#8];
+ case ch of
+      #1,#3,#5 : Gd:= ord(ch) shr 1;
+            #8 : Gd:= Her;
+           #20 : Gd:= Tan;
+ end;
+ gotoxy(1,24);
+ clreol;
+ gotoxy(1,23);
+ clreol;
+ gotoxy(26,23);
+ write('Jeu au Clavier / … la Souris');
+ textcolor(4);
+ gotoxy(33,23); write('C');
+ gotoxy(48,23); write('S');
+ repeat
+   read(kbd,ch);
+ until upcase(ch) in ['C','S'];
+ int_m:= (upcase(ch)='S');
+end;
+
+overlay procedure init_lieu;
+ var
+   f_lieu : file of tab_mlieu;
+begin
+(* debug('o3 init_lieu'); *)
+  assign(f_lieu,'MXX.mor');
+  {$i-}
+  reset(f_lieu);
+  read(f_lieu,v_lieu);
+  close(f_lieu);
+end;
+
+
+overlay procedure music;
+ var
+       fic : file;
+         k : integer;
+       fin : boolean;
+        ch : char;
+        x,y : real;
+
+begin
+  (* debug('o3 music'); *)
+  if sonoff then exit;
+  rech_cfiec:= True;
+  assign(fic,'mort.img');
+  {$i-}
+  reset(fic);
+  blockread(fic,mem[$3800:0],500);
+  blockread(fic,mem[$47A0:0],123);
+  close(fic);
+  demus($3800,$5000,623);
+  addfix:= (tempo_mus-addv[1])/256;
+  cctable(tbi);
+
+  fin:=false;
+  k:=0;
+  repeat
+    fin:= keypressed;
+    musyc( tbi, 9958 , tempo_mus);
+    k:= k+1;
+    fin:= fin or keypressed or (k>=5);
+  until fin;
+  while keypressed do read(kbd,ch);
+end;
+
+
+overlay procedure charge_bruit5;
+     var f:file;
+   begin
+     assign(f,'bruit5');
+     {$i-}
+     reset(f);
+     if ioresult<>0 then
+     begin
+       caff:=do_alert(err_mess,1);
+       halt;
+     end;
+     blockread(f,mem[adbruit5:0],149);
+     (*blockread(f,mem[$5CB0:0],100);
+     blockread(f,mem[$3D1F:0],49);*)
+     close(f);
+   end;
+
+overlay procedure charge_cfiec;
+        var
+            f : file;
+      begin
+        assign(f,'cfiec.mor');
+       {$i-}
+        reset(f);
+        blockread(f,mem[adcfiec:0],511);
+        blockread(f,mem[adcfiec+4088:0],311);
+        close(f);
+        rech_cfiec:= False;
+      end;
+
+
+overlay procedure charge_cfiph;
+        var
+            f : file;
+      begin
+        assign(f,'cfiph.mor');
+        {$i-}
+        reset(f,256);
+        blockread(f,t_cph,50);
+        close(f);
+      end;
+
+
+overlay procedure suite;
+  var cpr:string[25];
+begin
+  hirs;
+  repon(7,2035);
+  caff:= 51;
+  taffich;
+  teskbd;
+  if newGd<>Gd then Gd:=newGd;
+  hirs;
+  dessine(ades,0,0);
+  gotoxy(20*pred(res)+8,24);
+  textcolor(7);
+  cpr:='COPYRIGHT 1989 : LANKHOR';
+  if gd in [Ega,Ams,Cga] then write(cpr)
+             else begin
+                    putxy(104+72*res,190);
+                    writeg(cpr,0);
+                  end;
+end;
diff --git a/engines/mortevielle/original/0/PAROLE.PAS b/engines/mortevielle/original/0/PAROLE.PAS
new file mode 100644
index 0000000..233f3bb
--- /dev/null
+++ b/engines/mortevielle/original/0/PAROLE.PAS
@@ -0,0 +1,415 @@
+
+   procedure spfrac(wor : integer);
+     begin
+       c3.rep:= wor shr 12;
+       if (typlec=0) and (c3.code<>9) then
+          if ((c3.code>4) and (c3.val<>20) and not (c3.rep in [3,6,9])) or
+             ((c3.code<5) and not (c3.val in [19,22]) and not (c3.rep in [4,9])) then
+             c3.rep:= c3.rep + 1;
+       c3.freq:= (wor shr 6) and 7;
+       c3.acc:= (wor shr 9) and 7;
+     end;
+
+   procedure charg_car;
+       var wor, int : integer;
+     begin
+       wor:= swap(memw[adword:ptr_word]);
+       int:= wor and $3F;
+       case int of
+                  60 : begin
+                         c3.val:= 32;  (*  " "  *)
+                         c3.code:= 9;
+                       end;
+                  61 : begin
+                         c3.val:= 46;  (*  "."  *)
+                         c3.code:= 9;
+                       end;
+                  62 : begin
+                         c3.val:= 35;  (*  "#"  *)
+                         c3.code:= 9;
+                       end;
+              22..47 : begin
+                         int:= int-22;
+                         c3.val:= int;
+                         c3.code:= typcon[int];
+                       end;
+              48..56 : begin
+                         c3.val:= int-22;
+                         c3.code:= 4;
+                       end;
+              14..21 : begin
+                         c3.val:= int;
+                         c3.code:= 6;
+                       end;
+               0..13 : begin
+                         c3.val:= int;
+                         c3.code:= 5;
+                       end;
+       end;
+       spfrac(wor);
+       ptr_word:= ptr_word+2;
+     end;
+
+
+   procedure entroct( o:byte);
+     begin
+       mem[adtroct:ptr_oct]:= o;
+       ptr_oct:= ptr_oct+1;
+     end;
+
+   procedure veracf(b:byte);
+     begin
+     end;
+
+overlay procedure cctable (var t:tablint);
+  var
+      k:integer;
+      tb : array[0..256] of real;
+
+   begin
+     Tb[0]:=0;
+     for k:=0 to 255 do
+     begin
+       Tb[k+1]:= addfix + Tb[k];
+       T[255-k]:=trunc(Tb[k])+1;
+     end;
+   end;
+
+overlay procedure regenbruit;
+        var
+            i,j : integer;
+      begin
+        i:= offsetb3+8590;
+        j:= 0;
+        repeat
+          t_cph[j]:=memw[adbruit3:i];
+          i:= i+2;
+          j:= j+1;
+        until i>= offsetb3+8790
+      end;
+
+overlay   procedure charge_son;
+        var
+            f : file;
+      begin
+        assign(f,'sonmus.mor');
+        reset(f);
+        blockread(f,mem[$7414:0],273);
+        (*blockread(f,mem[adson:0],300);
+        blockread(f,mem[adson+2400:0],245);*)
+        demus($7414,adson,273);
+        close(f);
+      end;
+
+overlay   procedure charge_phbruit;
+        var
+            f : file;
+      begin
+        assign(f,'phbrui.mor');
+        reset(f);
+        blockread(f,t_cph,3);
+        close(f);
+      end;
+
+overlay   procedure charge_bruit;
+        var
+            f : file;
+            j,i:integer;
+      begin
+        assign(f,'bruits');
+        reset(f);
+        blockread(f,mem[adbruit:0],250);
+        for i:=0 to 19013 do mem[adbruit:32000+i]:= mem[adbruit5:i];
+        blockread(f,mem[adbruit1:offsetb1],149);
+        close(f);
+      end;
+
+overlay   procedure trait_car;
+       var    d3 : byte;
+           d2, i : integer;
+     begin
+       case c2.code of
+                    9 : if (c2.val<>ord('#')) then for i:=0 to c2.rep do entroct(c2.val);
+
+                  5,6 : begin
+                          if c2.code=6 then d3:= tabdph[(c2.val - 14) shl 1]
+                                       else d3:= null;
+                          if (c1.code>=5) then
+                             begin
+                               veracf(c2.acc);
+                               if (c1.code=9) then
+                                  begin
+                                    entroct(4);
+                                    if d3=null then entroct(c2.val)
+                                               else entroct(d3);
+                                    entroct(22);
+                                  end;
+                             end;
+                          case (c2.rep) of
+                                        0 : begin
+                                              entroct(0);
+                                              entroct(c2.val);
+                                              if d3=null then if c3.code=9 then entroct(2)
+                                                                           else entroct(4)
+                                                         else if c3.code=9 then entroct(0)
+                                                                           else entroct(1);
+                                            end;
+                                    4,5,6 : begin
+                                              if c2.rep<>4 then
+                                                 begin
+                                                   i:= c2.rep-5;
+                                                   repeat
+                                                     i:= i-1;
+                                                     entroct(0);
+                                                     if d3=null then entroct(c2.val)
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   until i<0;
+                                                 end;
+                                              if d3=null then
+                                                 begin
+                                                   entroct(4);
+                                                   entroct(c2.val);
+                                                   entroct(0);
+                                                 end
+                                                else
+                                                 begin
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(3);
+                                                 end;
+                                            end;
+                                    7,8,9 : begin
+                                              if c2.rep<>7 then
+                                                 begin
+                                                   i:= c2.rep-8;
+                                                   repeat
+                                                     i:= i-1;
+                                                     entroct(0);
+                                                     if d3=null then entroct(c2.val)
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   until i<0;
+                                                 end;
+                                              if d3=null then
+                                                 begin
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(2);
+                                                 end
+                                                else
+                                                 begin
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(0);
+                                                 end;
+                                            end;
+                                    1,2,3 : begin
+                                              if c2.rep<>1 then
+                                                 begin
+                                                   i:= c2.rep-2;
+                                                   repeat
+                                                     i:= i-1;
+                                                     entroct(0);
+                                                     if d3=null then entroct(c2.val)
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   until i<0;
+                                                 end;
+                                              entroct(0);
+                                              entroct(c2.val);
+                                              if c3.code=9 then entroct(0)
+                                                           else entroct(1);
+                                            end;
+                          end;  (*  case  c2.rep  *)
+                        end;
+
+                  2,3 : begin
+                          d3:= c2.code+5;  (*  7 ou 8  => voyelle correspondante  *)
+                          if c1.code>4 then
+                             begin
+                               veracf(c2.acc);
+                               if c1.code=9 then
+                                  begin
+                                    entroct(4);
+                                    entroct(d3);
+                                    entroct(22);
+                                  end;
+                             end;
+                          i:=c2.rep;
+                          if i<>0 then
+                             begin
+                               repeat
+                                 i:=i-1;
+                                 entroct(0);
+                                 entroct(d3);
+                                 entroct(3);
+                               until i<=0;
+                             end;
+                          veracf(c3.acc);
+                          if c3.code=6 then
+                             begin
+                               entroct(4);
+                               entroct(tabdph[(c3.val-14) shl 1]);
+                               entroct(c2.val);
+                             end
+                            else
+                             begin
+                               entroct(4);
+                               if c3.val=4 then entroct(3)
+                                           else entroct(c3.val);
+                               entroct(c2.val);
+                             end;
+                        end;
+                  0,1 : begin
+                          veracf(c2.acc);
+                          case c3.code of
+                                       2 : d2:= 7;
+                                       3 : d2:= 8;
+                                       6 : d2:= tabdph[(c3.val-14) shl 1];
+                                       5 : d2:= c3.val;
+                                      else d2:=10;
+                          end;    (*  case  c3.code  *)
+                          d2:= d2 *26 + c2.val;
+                          if tnocon[d2]=0 then d3:=2
+                                          else d3:=6;
+                          if c2.rep>=5 then
+                             begin
+                               c2.rep:=c2.rep-5;
+                               d3:= 8-d3;         (*  echange 2 et 6  *)
+                             end;
+                          if c2.code=0 then
+                             begin
+                               i:=c2.rep;
+                               if i<>0 then
+                                  begin
+                                    repeat
+                                      i:=i-1;
+                                      entroct(d3);
+                                      entroct(c2.val);
+                                      entroct(3);
+                                    until i<=0;
+                                  end;
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(4);
+                             end
+                            else
+                             begin
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(3);
+                               i:=c2.rep;
+                               if i<>0 then
+                                  begin
+                                    repeat
+                                      i:=i-1;
+                                      entroct(d3);
+                                      entroct(c2.val);
+                                      entroct(4);
+                                    until i<=0;
+                                  end;
+                             end;
+                          if c3.code=9 then
+                             begin
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(5);
+                             end
+                            else
+                             if not (c3.code in [0..1,4]) then
+                                begin
+                                  veracf(c3.acc);
+                                  case (c3.code) of
+                                                 3 : d2:= 8;
+                                                 6 : d2:= tabdph[(c3.val-14) shl 1];
+                                                 5 : d2:= c3.val;
+                                                else d2:= 7;
+                                  end;  (*  case c3.code  *)
+                                  if d2=4 then d2:=3;
+                                  if intcon[c2.val]<>0 then c2.val:= c2.val+1;
+                                  if (c2.val=17) or (c2.val=18) then c2.val:=16;
+                                  entroct(4);
+                                  entroct(d2);
+                                  entroct(c2.val);
+                                end;
+                        end;
+                    4 : begin
+                          veracf(c2.acc);
+                          i:=c2.rep;
+                          if i<>0 then
+                             begin
+                               repeat
+                                 i:=i-1;
+                                 entroct(2);
+                                 entroct(c2.val);
+                                 entroct(3);
+                               until i<=0;
+                             end;
+                          entroct(2);
+                          entroct(c2.val);
+                          entroct(4);
+                          if c3.code=9 then
+                             begin
+                               entroct(2);
+                               entroct(c2.val);
+                               entroct(5);
+                             end
+                            else
+                             if not (c3.code in [0..1,4]) then
+                                begin
+                                  veracf(c3.acc);
+                                  case (c3.code) of
+                                                 3 : d2:= 8;
+                                                 6 : d2:= tabdph[(c3.val-14) shl 1];
+                                                 5 : d2:= c3.val;
+                                                else d2:= 7;
+                                  end;  (*  case c3.code  *)
+                                  if d2=4 then d2:=3;
+                                  if intcon[c2.val]<>0 then c2.val:= c2.val+1;
+                                  entroct(4);
+                                  entroct(d2);
+                                  entroct(tabdbc[(c2.val-26) shl 1+1]);
+                                end;
+                        end;
+       end;  (* case c2.code  *)
+     end;
+
+{overlay function testprot : boolean;
+var
+   regs : registres;
+ buffer : array[0..511] of char;
+  i,j,k : integer;
+     st : phrase;
+    tay : integer;
+   test : array[0..2] of boolean;
+const
+ chaine : array[0..7] of char
+        = (' ','M','A','S','T','E','R',' ');
+
+begin
+ test[0]:= false;test[1]:=false;test[2]:=false;k:=0;
+ with regs do
+ begin
+   while (test[k]=false) and (k<2) do
+   begin
+     k:=k+1;
+     ax:=0;intr(19,regs);
+     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+     intr(19,regs);
+     test[k]:=true;
+     tesok:= true;
+     i:=0;
+     while (test[k]) and (i<19) do
+      begin
+       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
+      end;
+      for j:=0 to 7 do
+       if buffer[j+504]<>chaine[j] then test[k]:=false;
+   end;
+ end;
+ testprot:=(test[1] or test[2]);
+end;
+}
+
diff --git a/engines/mortevielle/original/0/PAROLE2.PAS b/engines/mortevielle/original/0/PAROLE2.PAS
new file mode 100644
index 0000000..600206e
--- /dev/null
+++ b/engines/mortevielle/original/0/PAROLE2.PAS
@@ -0,0 +1,102 @@
+  procedure rot_chariot;
+     begin
+       c1:= c2;
+       c2:= c3;
+       with c3 do
+          begin
+            val:= 32;
+            code:= 9;
+          end;
+     end;
+
+   procedure init_chariot;
+     begin
+       with c3 do
+          begin
+            rep:= 0;
+            freq:= 0;
+            acc:= 0;
+          end;
+       rot_chariot;
+       rot_chariot;
+     end;
+
+
+procedure trait_ph;
+     const  deca : array[0..2] of integer
+                  =(300,30,40);
+   begin
+     ptr_tcph:= pred(num_ph);
+     ledeb:=swap(t_cph[ptr_tcph]) + deca[typlec];
+     lefin:=swap(t_cph[ptr_tcph+1]) + deca[typlec];
+     nb_word:= lefin - ledeb;
+     ptr_tcph:=ledeb shr 1;
+     ptr_word := 0;
+     repeat
+       memw[adword: ptr_word]:= t_cph[ptr_tcph];
+       ptr_word := ptr_word +2;
+       ptr_tcph := ptr_tcph+1;
+     until ptr_tcph>=lefin shr 1;
+
+     ptr_oct:= 0;
+     ptr_word:= 0;
+     init_chariot;
+
+     repeat
+       rot_chariot;
+       charg_car;
+       trait_car;
+     until ptr_word >= nb_word;
+
+     rot_chariot;
+     trait_car;
+     entroct(ord('#'));
+   end;
+
+
+
+   procedure parole(rep, ht, typ : integer);
+       var
+          savph:array[0..500] of integer;
+          i: integer;
+          tempo:integer;
+
+    begin
+      if sonoff then exit;
+      num_ph:= rep;
+      haut:= ht;
+      typlec:= typ;
+      if typlec<>0 then
+         begin
+           for i:=0 to 500 do savph[i]:=t_cph[i];
+           tempo:= tempo_bruit;
+         end
+                   else
+          if haut>5 then tempo:= tempo_f
+                    else tempo:= tempo_m;
+      addfix:= (tempo-addv[0])/256;
+      cctable(tbi);
+      case typ of
+              1 : begin
+                    charge_bruit;
+                    (*if zuul then zzuul(adbruit,0,1095);*)
+                    regenbruit;
+                  end;
+               2 : begin
+                    charge_son;
+                    charge_phbruit;
+                  end;
+      end;
+      trait_ph;
+      litph(Tbi,typ,tempo);
+      if typlec<>0 then
+         for i:=0 to 500 do
+            begin
+              t_cph[i]:=savph[i];
+              mlec:=typlec;
+            end;
+      writepal(numpal);
+    end;
+
+
+
diff --git a/engines/mortevielle/original/0/PHBRUI.MOR b/engines/mortevielle/original/0/PHBRUI.MOR
new file mode 100644
index 0000000..4b07358
Binary files /dev/null and b/engines/mortevielle/original/0/PHBRUI.MOR differ
diff --git a/engines/mortevielle/original/0/PHINT.COM b/engines/mortevielle/original/0/PHINT.COM
new file mode 100644
index 0000000..87ea93e
Binary files /dev/null and b/engines/mortevielle/original/0/PHINT.COM differ
diff --git a/engines/mortevielle/original/0/PHINT2.COM b/engines/mortevielle/original/0/PHINT2.COM
new file mode 100644
index 0000000..9d79eef
Binary files /dev/null and b/engines/mortevielle/original/0/PHINT2.COM differ
diff --git a/engines/mortevielle/original/0/PHINTBAK.COM b/engines/mortevielle/original/0/PHINTBAK.COM
new file mode 100644
index 0000000..0191fce
Binary files /dev/null and b/engines/mortevielle/original/0/PHINTBAK.COM differ
diff --git a/engines/mortevielle/original/0/PHINTCOM.COM b/engines/mortevielle/original/0/PHINTCOM.COM
new file mode 100644
index 0000000..0191fce
Binary files /dev/null and b/engines/mortevielle/original/0/PHINTCOM.COM differ
diff --git a/engines/mortevielle/original/0/PHINTDEF.COM b/engines/mortevielle/original/0/PHINTDEF.COM
new file mode 100644
index 0000000..b167519
Binary files /dev/null and b/engines/mortevielle/original/0/PHINTDEF.COM differ
diff --git a/engines/mortevielle/original/0/PHINTGM.COM b/engines/mortevielle/original/0/PHINTGM.COM
new file mode 100644
index 0000000..4ec9edd
Binary files /dev/null and b/engines/mortevielle/original/0/PHINTGM.COM differ
diff --git a/engines/mortevielle/original/0/PHINTUK.COM b/engines/mortevielle/original/0/PHINTUK.COM
new file mode 100644
index 0000000..d47dc09
Binary files /dev/null and b/engines/mortevielle/original/0/PHINTUK.COM differ
diff --git a/engines/mortevielle/original/0/PLXX.MOR b/engines/mortevielle/original/0/PLXX.MOR
new file mode 100644
index 0000000..e867b3b
Binary files /dev/null and b/engines/mortevielle/original/0/PLXX.MOR differ
diff --git a/engines/mortevielle/original/0/PROG.PAS b/engines/mortevielle/original/0/PROG.PAS
new file mode 100644
index 0000000..e81df0a
--- /dev/null
+++ b/engines/mortevielle/original/0/PROG.PAS
@@ -0,0 +1,346 @@
+overlay procedure change_Gd(nGd: integer);
+  var i : integer;
+begin
+  hide_mouse;
+  Gd:= nGd;
+  hirs;
+  init_mouse;
+  show_mouse;
+  dessine_rouleau;
+  tinke;
+  pendule;
+  if ipers<>0 then affper(ipers) else person;
+  clsf2;
+  clsf3;
+  maff:= 68;
+  afdes(0);
+  repon(2,crep);
+  menu_aff;
+end;
+
+overlay procedure antegame;
+var
+     cx : integer;
+   regs : registres;
+ buffer : array[0..511] of char;
+  i,j,k : integer;
+   test : array[0..2] of boolean;
+    g : array[0..7] of char;
+
+begin
+ hide_mouse;
+ imen:= false;
+ g[1]:='M';
+perdu:= True;
+ anyone:= false;
+okdes:= True;
+ test[0]:= false;
+ test[1]:=false;
+ g[0]:=#32;
+ col:= false;
+ tesok:= True;
+ test[2]:=false;
+ g[7]:=g[0];
+ g[2]:='A';
+ cache:= false;
+ brt:= false;
+ maff:= 68;
+ g[5]:='E';
+ mnumo:= 0;
+ prebru:= 0;
+ g[4]:='T';
+ x:= 0;
+ y:= 0;
+ num:= 0;
+ hdb:= 0;
+ hfb:= 0;
+ cs:= 0;
+ is:= 0;
+ k:= 0;
+ ment:= 0;
+syn:= True;
+fouil:= True;
+ mchai:= 0;
+ inei:= 0;
+ initouv;
+ g[3]:='S';
+ g[6]:='R';
+ iouv:= 0;
+ dobj:= 0;
+ affrep;
+ stpou:= ind_mess;
+ while (test[k]=false) and (k<2) do
+ begin
+   regs.ax:=0;
+   k:=succ(k);
+   intr(19,regs);
+   with regs do
+    begin
+      ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+      intr(19,regs);
+      test[k]:=not imen;
+      i:=0;
+      while (test[k]) and (i<19) do
+        begin
+          ax:=$0201;
+          syn:= false;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+          intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
+        end;
+        okdes:= false;
+        solu:= True;
+      for j:=0 to 7 do if buffer[j+504]<>g[j] then test[k]:=false;
+    end;
+   perdu:= False;
+   fouil:= false;
+ end;
+ person;
+ tinke;
+ pendule;
+ afdes(0);
+ repon(2,crep);
+ clsf3;
+ solu:= false;
+ tmlieu(s.mlieu);
+ modinv;
+ if s.derobj<> 0 then modobj2(s.derobj+ 400,test[1],test[2])
+                 else tesok:=test[1] or test[2];
+ show_mouse;
+end;
+
+
+(* NIVEAU 3 *)
+(* procedure PROGRAMME *)
+procedure tmaj3;
+var
+ j,h,m: integer;
+begin
+ calch(j,h,m);
+ if m= 30 then m:= 1;
+ h:= h+ (j* 24);
+ m:= m+ (h* 2);
+ s.heure:= chr(m);
+end;
+
+procedure tsitu;
+label 1,2;
+var
+ h,j,m: integer;
+begin
+ if not col then clsf2;
+ syn:= false;
+ iesc:= false;
+ if anyone then goto 1;
+ if brt then
+  if (msg[3]= depla) or (msg[4]= sortir) or (msg[4]= dormir) or
+     (msg[4]= manger) then
+  begin
+   ctrm:= 4;
+   goto 2;
+  end;
+ if msg[3]= depla      then taller;
+ if msg[3]= discut     then tparler;
+ if msg[3]= invent     then tsprendre;
+ if msg[4]= attacher   then tattacher;
+ if msg[4]= attendre   then tattendre;
+ if msg[4]= defoncer   then tdefoncer;
+ if msg[4]= dormir     then tdormir;
+ if msg[4]= ecouter    then tecouter;
+ if msg[4]= entrer     then tentrer;
+ if msg[4]= fermer     then tfermer;
+ if msg[4]= fouiller   then tfouiller;
+ if msg[4]= frapper    then tfrapper;
+ if msg[4]= gratter    then tgratter;
+ if msg[4]= lire       then tlire;
+ if msg[4]= manger     then tmanger;
+ if msg[4]= mettre     then tmettre;
+ if msg[4]= ouvrir     then touvrir;
+ if msg[4]= prendre    then tprendre;
+ if msg[4]= regarder   then tregarder;
+ if msg[4]= sentir     then tsentir;
+ if msg[4]= sonder     then tsonder;
+ if msg[4]= sortir     then tsortir;
+ if msg[4]= soulever   then tsoulever;
+ if msg[4]= tourner    then ttourner;
+ if msg[4]= scacher    then
+ begin
+  tcacher;
+  goto 1;
+ end;
+ if msg[4]= sfouiller  then tsfouiller;
+ if msg[4]= slire      then tslire;
+ if msg[4]= sposer     then tposer;
+ if msg[4]= sregarder  then tsregarder;
+ cache:= false;
+1:
+ if anyone then
+ begin
+  quelquun;
+  anyone:= false;
+  goto 2;
+ end;
+ calch(j,h,m);
+ if (((h= 12) or (h= 13) or (h= 19)) and (s.mlieu<> 10)) or
+ ((h> 0) and (h< 6) and (s.mlieu<> 0)) then s.conf:= s.conf+ 1;
+ if ((s.mlieu< 16) or (s.mlieu> 19)) and (s.mlieu<> 23)
+ and (s.mlieu<> 0) and (s.derobj<> 152) and (not perdu) then
+ begin
+  if (s.conf> 99) and (h> 8) and (h< 16) then
+  begin
+   crep:= 1501;
+   tperd;
+  end;
+  if (s.conf> 99) and (h> 0) and (h< 9) then
+  begin
+   crep:= 1508;
+   tperd;
+  end;
+  if (j> 1) and (h> 8) and (not perdu) then
+  begin
+   crep:= 1502;
+   tperd;
+  end;
+ end;
+2:
+ mennor;
+end;
+
+procedure sv_game(n:integer); forward;
+
+procedure ld_game(n:integer); forward;
+
+procedure tecran;
+ const  idem = 'Idem';
+        lim  = 20000 ;
+var
+ temps : integer;
+ inkey : char;
+ oo, funct : boolean;
+begin
+ clsf3;
+ oo:= false;
+ ctrm:= 0;
+ if not iesc then
+ begin
+   draw_menu;
+   imen:= true;
+   temps:= 0;
+   key:= 0;
+   funct:= False;
+   inkey:='.';
+
+   repeat
+     mdn;
+     tinke;
+     mov_mouse(funct,inkey);
+     temps:= temps+ 1;
+   until (choisi) or (temps > lim) or (funct) or (anyone);
+
+   erase_menu;
+   imen:= false;
+   if inkey in [#1,#3,#5,#7,#9] then
+      begin
+        change_Gd(pred(ord(inkey)) shr 1);
+        exit;
+      end;
+   if choisi and (msg[3]=sauve) then sv_game(msg[4] and 7);
+   if choisi and (msg[3]=charge) then ld_game(pred(msg[4] and 7));
+   if inkey= #67 then         (* F9 *)
+   begin
+     temps := do_alert(stpou,1);
+     exit;
+   end
+   else
+    if inkey= #63 then
+    begin
+     if (mnumo<> no_choice) and ((msg[3]= action) or (msg[3]= saction)) then
+     begin
+      msg[4]:= mnumo;
+      ecr3(idem);
+     end
+     else exit;
+    end
+    else
+     if inkey= #68 then
+     begin
+      if (x<> 0) and (y<> 0) then num:= 9999;
+      exit;
+     end;
+  end;
+  if inkey= #59 then
+  begin
+   arret:= true;
+   tmaj3;
+  end
+  else
+  begin
+   if (funct) and (inkey<> #63) then exit;
+   if temps> lim then
+   begin
+    repon(2,141);
+    if num= 9999 then num:= 0;
+   end
+   else
+   begin
+    mnumo:= msg[3];
+    if (msg[3]= action) or (msg[3]= saction) then mnumo:= msg[4];
+    if not anyone then
+    begin
+     if (fouil) or (obpart) then
+     begin
+       if Y_S< 12 then exit;
+      if (msg[4]= sonder) or (msg[4]= soulever) then
+      begin
+       oo:= true;
+       if (msg[4]= soulever) or (obpart) then
+       begin
+        finfouil;
+        caff:= s.mlieu;
+        crep:= 998;
+       end
+       else tsuiv;
+       mennor;
+      end;
+     end;
+    end;
+    repeat
+      if not oo then tsitu;
+      if (ctrm= 0) and (not perdu) and (not solu) then
+      begin
+        taffich;
+        if okdes then
+        begin
+          okdes:= false;
+          dessin(0);
+        end;
+        if (not syn) or (col) then repon(2,crep);
+      end;
+    until (not syn);
+   if ctrm<> 0 then tctrm;
+  end;
+ end;
+end;
+
+(* NIVEAU 1 *)
+
+procedure theure;
+begin
+ vj:= ord(s.heure);
+ vh:= vj mod 48;
+ vj:= vj div 48;
+ vm:= vh mod 2;
+ vh:= vh div 2;
+ heu:= vh;
+ if vm= 1 then min:= 30 else min:= 0;
+end;
+
+
+procedure tjouer;
+begin
+  antegame;
+  repeat
+    tecran
+  until (arret) or (solu) or (perdu);
+  if solu then tmaj1 else
+     if perdu then tencore;
+end;
+
diff --git a/engines/mortevielle/original/0/PUTPIX.COM b/engines/mortevielle/original/0/PUTPIX.COM
new file mode 100644
index 0000000..3e41fcd
Binary files /dev/null and b/engines/mortevielle/original/0/PUTPIX.COM differ
diff --git a/engines/mortevielle/original/0/QUES.PAS b/engines/mortevielle/original/0/QUES.PAS
new file mode 100644
index 0000000..aeb5299
--- /dev/null
+++ b/engines/mortevielle/original/0/QUES.PAS
@@ -0,0 +1,117 @@
+
+overlay function ques:boolean;
+   const ta : array[1..10] of integer
+             = ( 511, 516, 524, 531, 545,
+                 552, 559, 563, 570, 576);
+         OK : array[1..10] of integer
+            = ( 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 );
+
+   var q, func, test : boolean;
+       i,j,k,y,memk : integer;
+       tay , tmax : integer;
+       rep, prem, der : integer;
+       st : phrase;
+       key : char;
+       Coor : mult_rect;
+       Chaines : array[1..14] of str40;
+       compte : integer;
+
+begin
+  test:=False;
+  i:=0;
+  compte:= 0;
+
+  repeat
+    hide_mouse;
+    hirs;
+    show_mouse;
+    i:= i+1;
+    DeLine(ta[i],st,tay);
+    if res=1 then y:=29 else y:=23;
+    box(15,Gd,0,14,630,y,255);
+    Afftex(st,20,15,100,2,0);
+    if i<>10 then
+       begin
+         prem:= ta[i]+1;
+         der:= ta[i+1]-1;
+       end
+     else
+       begin
+         prem:= 503;
+         der:= 510;
+       end;
+    y:=35;
+    tmax:= 0;
+    memk:= 1;
+    for j:= prem to der do
+      begin
+        DeLine(j,st,tay);
+        if (tay>tmax) then tmax:= tay;
+        Afftex(st,100,y,100,1,0);
+        Chaines[memk]:= delig;
+        memk:= memk+1;
+        y:= y+8;
+      end;
+    for j:= 1 to succ(der-prem) do
+      begin
+      with Coor[j] do
+        begin
+          x1:= 45*res;
+          x2:= (tmax*3 + 55)*res;
+          y1:= 27 + j*8;
+          y2:= 34 + j*8;
+          Etat:= True;
+        end;
+        while length(Chaines[j] )<tmax do
+          begin
+            Chaines[j]:= Chaines[j] +' ';
+          end;
+      end;
+    Coor[j+1].Etat:= False;
+    if res=1 then rep:=10 else rep:=6;
+    boite(80, 33, 40+tmax*rep, (der-prem)*8+ 16, 15);
+    rep:= 0;
+    j:= 0;
+    memk:= 0;
+    repeat
+      clic:= false;
+      tesok:=false;
+      mov_mouse(func,key);
+      k:= 1;
+      while Coor[k].Etat and not Dans_rect(Coor[k]) do k:= k+1;
+      if Coor[k].Etat then
+         begin
+           if (memk<>0) and (memk<>k) then
+              begin
+                (*DeLine(T_rec[ta[i]+memk].indis,T_rec[ta[i]+memk].point,st,tay);*)
+                for j:= 1 to tmax do st[j]:= Chaines[memk][j];
+                st[1+tmax]:= '$';
+                Afftex(st,100,27+memk*8,100,1,0);
+              end;
+           if memk<>k then
+              begin
+                (*DeLine(T_rec[pred(prem)+k].indis,T_rec[pred(prem)+k].point,st,tay);*)
+                for j:= 1 to tmax do st[j]:= Chaines[k][j];
+                st[1+tmax]:= '$';
+                Afftex(st,100,27+k*8,100,1,1);
+                memk:= k;
+              end;
+         end
+       else
+         if memk<>0 then
+            begin
+              for j:= 1 to tmax do st[j]:= Chaines[memk][j];
+              st[1+tmax]:= '$';
+              Afftex(st,100,27+memk*8,100,1,0);
+              memk:=0;
+            end;
+    until (memk<>0) and clic;
+    if memk=OK[i] then compte:=compte+1
+                  else begin
+                         if i=5 then i:=i +1;
+                         if (i=7) or (i=8) then i:= 10;
+                       end;
+    if i=10 then q:= {testprot} true;
+  until i=10;
+  ques:= (compte=10) and q;
+end;
diff --git a/engines/mortevielle/original/0/REUS.COM b/engines/mortevielle/original/0/REUS.COM
new file mode 100644
index 0000000..44678b2
Binary files /dev/null and b/engines/mortevielle/original/0/REUS.COM differ
diff --git a/engines/mortevielle/original/0/REUSINT.COM b/engines/mortevielle/original/0/REUSINT.COM
new file mode 100644
index 0000000..638a7ba
Binary files /dev/null and b/engines/mortevielle/original/0/REUSINT.COM differ
diff --git a/engines/mortevielle/original/0/SAUVECR.COM b/engines/mortevielle/original/0/SAUVECR.COM
new file mode 100644
index 0000000..8e8d6c9
Binary files /dev/null and b/engines/mortevielle/original/0/SAUVECR.COM differ
diff --git a/engines/mortevielle/original/0/SAV0.MOR b/engines/mortevielle/original/0/SAV0.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/0/SAV0.MOR differ
diff --git a/engines/mortevielle/original/0/SAV1.MOR b/engines/mortevielle/original/0/SAV1.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/0/SAV1.MOR differ
diff --git a/engines/mortevielle/original/0/SAV2.MOR b/engines/mortevielle/original/0/SAV2.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/0/SAV2.MOR differ
diff --git a/engines/mortevielle/original/0/SAV3.MOR b/engines/mortevielle/original/0/SAV3.MOR
new file mode 100644
index 0000000..9df463e
Binary files /dev/null and b/engines/mortevielle/original/0/SAV3.MOR differ
diff --git a/engines/mortevielle/original/0/SAV4.MOR b/engines/mortevielle/original/0/SAV4.MOR
new file mode 100644
index 0000000..1813d55
Binary files /dev/null and b/engines/mortevielle/original/0/SAV4.MOR differ
diff --git a/engines/mortevielle/original/0/SONMUS.MOR b/engines/mortevielle/original/0/SONMUS.MOR
new file mode 100644
index 0000000..f9bc2a0
--- /dev/null
+++ b/engines/mortevielle/original/0/SONMUS.MOR
@@ -0,0 +1,9 @@
+ˆ™ˆˆ˜ˆ‡†w‡fw‡wˆˆˆˆ‰ˆŠˆ«‰»š¸‹§xˆhˆhˆˆˆxˆˆxˆˆ˜ˆˆˆˆxg‡v†h‡xxˆ‰ˆ‰‰™‡˜Šˆ‡‰ˆxw‡hWˆhxx¨˜Š˜™‰š›©«‹©‰ˆx†x‡x‡xˆh‡xˆhˆ˜‰x˜‰ww‡gvx‡x‡šˆ‰™™˜‰˜™‡ˆ˜xfˆvWwwxwˆŠ‡Šˆ©˜ºš«¸›¹ˆˆx‡ˆvywˆˆxˆˆˆxˆˆ˜ˆˆˆvwvvh‡h‡ˆ‰ˆˆ™‰ˆ™‰ˆˆ‰—xwˆuwx‡‡xš‰‰Š¸˜¹›©ºˆ»‡ˆx‡gxvxwˆ‡x‡x‡y‡‰˜Š‡˜xX…h†ˆ‡‰ˆ˜˜š¨zˆ©˜xˆ˜gh†vgg‡xv‰˜x¨‹‰š›«©š¹™˜x˜w†x‡hxˆ‰x˜‡ˆx‰‰˜ˆ˜xvfwggxˆx‡‰ˆ‰ˆŠ˜™ˆ‰—ˆwxgv‡xx‡‰Šˆ‰›‰ª©«¹Šº‰ˆˆˆwxeˆfxwˆˆxˆˆ‡ˆ˜™ˆŠxˆfwv†w˜ˆ‡y¨‰‰ˆ©¨‰ˆˆxwxvgvxvwx˜ˆ™y©šºŠË˜«©©xyˆˆvg‡gx‡˜ˆˆ˜ˆˆy˜‰ˆˆ‡hfhehv‰g‡˜yˆ˜ª‰ˆ©ˆ‡x‰vwˆxvx˜ˆˆš˜Š™»©«¨»˜ˆ˜ˆw‡†fhfwgˆ‰‡‰ˆ‡ˆ™‰ˆ™ˆˆwxgv‡ˆhˆy˜ˆš©˜ˆ©ˆ†hˆ†Vx‡ggh¨hˆš˜‹»š»z»™Š‰˜ˆˆx†eyv‡ˆ‰ˆˆˆ˜y—z˜‰‡yuˆUhW‡gx‡‰‡z¸‰‰™˜xw‰‡gˆˆ…ˆˆˆ†{‰©‹»»¹Šº˜yˆ‰—h‡xef‡hgy˜ˆxˆ‰ˆˆy©‡x™v‡gx†hˆˆ—y¨š§Š¨y…ˆ†xuˆwwgx‡hˆˆšº›¼¹›š¨ˆ‰ˆ©ˆy‡‡fX‡h‡Š‡‰‡Š–z‡‰‡‰wxVwgffˆˆxx™©ˆš˜xˆˆ‡†h¨ˆˆyˆ‡x—k—«Ê»º«˜‰—wšh˜‡wfgfVˆg‰x‰‰‡‰ˆˆˆ‰‰˜ˆˆ‡h†g˜x—xš¨ˆ™‰˜wx†wgx—fˆh‡xX™ˆ««Ë‹»˜šg¨ˆŠˆš‡x…iujwˆ‡‰‰—™i§ˆˆ‰i¦hfˆUxH–†xˆ˜ˆ™‰˜hˆ‡hˆˆ‰ˆ™˜‰g©Y¨›¹¼¸«ºh¨y—‡ˆ‡ˆugvfXxh†Šx¨ˆˆ‰‡ˆy¨y˜‰‡‡h†ˆvyˆˆˆ‰¨‰xy‡fxˆgxˆˆˆxxˆˆ‹¹«»‹¹Šyx¸‡‰ˆ™x‡ˆwggˆg‡y‰™y¦Šwh™‡z†‰vwvgeh˜xˆ‰¨‡xˆxgg™ˆ˜›¨™˜Šˆš˜›É›ª™©—x‰˜hˆwhwfggVg
 xvˆ¨y˜Š‡‰‡ˆºˆª‰¨y†ˆe‡‡ˆ†y˜x†i…wwh‡‡i˜‡‰ˆ‡š™ª¼˜¬¸ˆ¸ˆ—‰˜ˆˆˆyˆ‡Y˜Uxgh‡˜ˆ¨˜‰x—y·x¨ˆgˆgVfhxˆwˆ‡‡X‡whx‰˜‰»‰©{™‰¸¬›¹šËˆ¨z™f™yexexU†ggUh†X—y™ˆª‡y˜ª©›Éˆšˆuwg‡xwx‡vfˆWgvˆg—x›wˆ‹ˆª«º«¨¼˜©g¹‰x¸ywˆ–yw†hvVwgg‰ˆ™˜˜‰y˜ˆšš§ˆ–ˆeXfˆW‰†XVw‡Ui‰ˆx»˜ºŠ¹˜ÈŒ»»™¬¸‰˜k—x‡h†V‡gwVfVgTˆV‡x¹Š¨‰Š‰¸œÊ›È›¨v…h†XvheVWueVˆh‡xª‡˜¨‹¸«¼¼˜¼ˆºh™ˆªx…˜†i‡ˆx…ugeU˜U‰ˆ«x˜ˆ™x©º¹ŠºˆhtivVhˆUeWhVgy‰ˆ›™©Š©›¸¼ª¼¹»¨—š‡—‰˜VˆWvgwX„gfUUfvX˜Š˜š‰º‰«¼»»¼¸št{…Ug‡VeEuUFh†Wˆ™yŠˆ›©«Ì›Ë‹Él–k·‹y¶hˆj…y‡h…WeGeX•X™™ˆyšw˜‹Ê›¹¬§f˜WuVvhdUuWUy–‰y¹©‹‹·Ë|ÊÌȌƫ†x¨ˆx‡…f‡WfˆthUfTVUˆU‹‰ˆªªŠ»›ËËÌ›Êw¸†vWueUUUEFu…Xhˆˆˆ‰¨ª¬ÊÌ»œ¹˜Šg¸Š™z·Xx—wx—wvUfWTU˜Xh‰x¹ˆ‰º©›Ëº»ˆ©—XUxUFUVUEjˆfˆŠ¹w«šºË»Ü¸œ©¨xx‰‰—x˜Vuh–VwwweUf…E†wxh™©™¹¼¬»¬Ü‹»yˆˆ‡F†TUUETVehfˆxˆˆˆ¨­È¬Ük»¶k§Y¹›˜Š¨wˆx¥Y‡‡wVVeUE‡U…kˆŠ˜‹©©œ»¼™»¨™vV‡EUVTfUwgˆˆ‰›‡¼‡½»»Ì™¼…©g˜gªj†h˜Fw‡gg—W•H„XTX‡ex‰«˜ºÌ™¼ÌË»«¨ˆˆxvUTUdEEvUwWŠxh¨{¹½É͈¼µzujµ[¹¹x›…zw‡wyf‰eVguUWfV‰¨z§›ª›šË»›º»wf†WTE…EEh™UŠ©‰™iÉ›¹Í»»ŠÊW†wXµj™–g™ee›dx‰W§vExdF—Uˆ©˜¬ª»¼É¬Ìš»¨ˆˆˆVtEUETFwTX–y‡ˆª›¬Ë¼Ù«¸ˆwgx—k¸‹wŠ•Z†‰fy–zvgwWUvvU˜ˆw›‰©›»»»¹»¸Y§fdUeUEV‰uj‰ºh‹ˆš
 ÉœŲ̂¼¦xUxuY—y¦X‡f†huh¨‡x…VvVG…u‰©‰»¼¹«Ë«Ì‹¼˜ˆˆˆeTUEdD‡EhV˜yw›¨œ¼×ζÄZeV—WŠy¨ˆ†˜gx†X˜‡y˜uxhVugujuš‰º‰»º«º¼˜»†‡weEdFUgf‰gª©y§›™¼Ë¼Û‹¹ˆtVvXfxˆ†e‰gV‰‡gˆ˜z–wfˆeY‡W‹‰««É›¼ªº»‹»ˆˆ‡VdFTEDYD†Y©—h»xÙ­ÌÛ¸­µ‡EztX‰‡y‡w˜eX‰†W»v˜ˆ‡xfW†E‡x‰y»™‹»¹«È«¹w˜uXDVUUX—v[›ˆš{ˆ»Ì¼ÌÚˆˆˆˆ‡TT™UgewWfE¸xg˜¨h¨fŠ…g‰v‡›™«º›»»¨¼š»¸¨†™sITG4xE†U{—‰–‹¹¼ËÌË»¨¹uUvuY…ˆh†wY†…[ˆv«w™˜w‰†Uh–H‡z»§œ›«‡Ë›É‰xštTeUTWV§Uš{¸‰šºœÌ«Ý¨ˆˆˆˆ†…FtHexTWg†Jˆˆ‡z™ˆ‰x©vX™…Šš»º¨¼º‰‰Ìš˜ªˆutEV3ewFWv‹˜ˆŠ¹ŒËÍË˼ˆˆ…gU—U‡g…hUx†Uk§g‰«‡xŠf¨Ty…fŠ›¸jº»¦Œ©ÌŠ›¨geEeDtXˆV˜k¹—›šÊ«ÜÌȈˆˆˆˆˆduGTeFUUhfw‰w˜™™ˆ™Šy¦hi—ˆË‹›Ê»©¸‹«É›ˆˆ†WTD6TXvUw©yv»¨œÛËݘɈˆe†WV…WWtVxex·Wˆ¹j™¨z˜ˆ‡xU‰uxŠ©¸šÉ{—›»«yÈyeUDUEWˆ…h¸Œ¶Œ˜¼ËËͨˆˆˆˆˆˆeUvCuTXTwˆfy‡šˆ™™Šˆ§h‡w‹f»šË{ȼ†‹¼©«¸‰†VDuCTiufX·k¶lº«ÌÌͨ¨ˆˆˆ…VevUUTxTygˆwzºgª™ˆˆ‰ˆVgˆg…‹Éˆ»¹©‡Œ¼·|¸‹”GeDUH˜v—{»ˆš›»»Ì˜ˆˆˆˆˆ†FtEUDUFgVˆX˜›—Š‰¹y¨ˆ‡g‰—ˆ¨¼ª»»‹©k¼ºˆ»ˆˆ…DTSGWh„‹‡ª‡‹‹Ë©Í˘ȈˆuUXdXdUuWVg‹‡‡‹¸ˆ™‹‡yˆ†vvx†i›¸Œ§»—‰ŒÈ‹»‹¸ufTUDZxe™‹œ¥Œº‹Ë¼ËˆˆˆˆˆˆeTFTFeE‡T˜i•z˜Š˜ª˜x¹gˆvˆj¶œº‹»‹·z»{Ùœ¨ˆˆG„4ETwxhj¸[˜©§»Ë܇šˆY¥U…G„HTUwXU©‰‰ˆ©y©˜ˆ˜†xgT˜Xh«Æ
 Œ¹º‰‰«œÇŒÈ‹dkSUdj‡‡iœ˜hÌx‹¼Ê»˜ˆˆˆˆ…WDUEUDuWU‰vˆ‰¨yŠ©‰‰«‡ˆWŠ˜vŒ»¨»Ëª™šÌÇ‹ˆˆˆvUDEDy¦Gš¸{¦Z¹‹‹Ë̘Œ¨wUUWdUVuV…Y˜i©ˆŠ¨™‹·i˜hvVfyu‰ºŒ§œ¸‰ˆ»»Ê‹©¸UWdETj§Xw¬™Š™ºª¼ºÉˆˆˆˆ†uEUEUUeVvwY–h™ˆxºŠ‡›‰˜Vˆ†xh›¹»›Ì¨º¬Ë«¨ˆˆˆFTU5V¨X„«ÈˆxÊZ¹œ¼ºˆ«ˆ…UWDeFeVUˆˆ‡‹†‹¸ˆŠ¸‰ˆ–xVVvˆU‹»·»‹»ˆ©¼Éœ¨»ˆfWTUUy˜Uš˜ª·Šš›¼È›ˆˆˆˆeDETeTVhexW©W™ˆ‰‰‹¸‰¹˜˜VˆˆU‰©ºª¼Ì©»»ÌˆˆˆˆˆfCuEhwYw‰¸{w˜y»›È«›º…wTUTWTXTzˆxªŠ¸z¸z¹h¸i‡gdhXVX‹¹˜º¹¹š¬Êª¼{»eXv5uWˆZuŒ§ªˆ«Š¬º»˜ˆˆˆdeSXTUUVew‰ešv‹—x»©¸{ˆ˜VW‡vWŠÊ«›Ì˨¼Ü¸ˆˆˆˆˆdfDIªF—I»eˆ˜z©»¬ËWÉguEUDgTUWgˆyªª˜‹»ˆ¨ª‡ˆ—htWheeŠª‡»»ª‹›Ü›ªœ¹‡ggtEwZµFkƈˆ»¨»¼¸¨ˆˆˆcwDUEeUGghvy˜ˆ¨Šª‡¬˜©Š†fdxuXy»œ«¼Ê¹œÌ¼˜ˆˆˆˆˆUdFˆ•vh‹uxxx¸œ««Æ[¶UDeDWFfggˆ›ˆ»¸›šÊ‡«—‰—idWTxtHš˜‰«ªºšÌ̋ʼˆ…WuUUˆˆ†h‰ªh‹¸‹œÈ›ˆ‡˜deTDUGUVeI‡ˆˆŒ…ª¹Š»™ššˆuVTyUX‹ºš¼É»»¼Ìº©ˆˆˆˆˆEwF™tXhÇE©g·›º‹ØGÊuEe5WETXVˆˆˆË©»Š»˜Š»‡˜˜xtFgdVi©†»ª›¨›ÌÌ«Êȇ‡wEVW¨XuŠ¸Š…Œ¥¼Š»¨ˆˆ‡t5UCeUE„hˆˆˆˆˆ™»˜»ºŠ¨ŠuwTW‡Fˆ«¸¬È½‰¼¬Ú«˜ˆˆˆˆ†WuX¦Fe›UˆX˜kÈ‹Ë…{¶EdE5„Efˆˆˆˆˆ¼ºªÌxºŠ¸™‰‡uuE–TX¨—‹x»˜kÌ«Ì›¼¹ggvfTy•Xxˆ«…‹§¼˜¬Èˆˆˆ…TEDTFEUVˆˆˆ‰ˆªªšz»™‹©w†UU‡Eh©ª˜Ëȼš¬ÌË»ˆˆˆˆˆˆuwxfdzYuVªHºº««fºeDTTDeEx
 ˆˆˆˆ‹«¹»º©›¸‰¹x……UxeVhŠ—k¨©ª‹Ìˬ»Èˆˆˆ…EuyuXw¨y˜y¸‰¼§«™x§EEEDEDXUxˆˆˆˆŠ¹ªz«¨›š¨ˆvuWeV—‹™¹«¼¹œÌ½¹ˆˆˆˆˆˆˆ…V–Fei…Ze‡‹‰Š»©‡š…DTEFTWˆˆˆˆˆ¼¨Ë¹¨‹Éy‰¨‰…wHt…I†x¤»y»z̼«ÚšÉˆˆ‡fUgH–Vˆ|¸d¬ˆˆÊ˜­„ˆŠT4dUSwHe‡hˆˆ™ˆº™‰ª™š§x©wUW†W¦{ÉŠœÌ»¼ÍɈˆˆˆˆˆˆˆ†XuUF‰x„Wš†ˆŠ»še›TVDUFUxˆˆˆˆ‹¸¼©œ¸Š»w©˜˜W†XuW…X¨h¹˜º«¼»Üz»ˆˆˆ†WeUX…Vz™˜ˆy§¸Zˉ¸Y•UTD…TXuhuwˆ™h»¨ˆœ˜‰¹x˜ˆxX…X‡—™ª¸›Ì̬ËɈˆˆˆˆˆˆˆvFveHh‡wH…‰‡{ÅËX§‡TDdxE‡xˆˆˆº™»Ë©š»ˆŠ‡‡xvx…fxXvŠ–\¨¼»»¼Ì¸™˜ˆˆ†xdfU˜Tˆ‰©u›Wšˆª«Å\…UTUSxdxVˆWˆˆšŠx»›‡›·X‡ªx‡X¹w‹˜‹§»¼»ÌˆˆˆˆˆˆˆˆˆUVfUfW·Hf†v‹h»©‡š…ET…HVˆˆš‡›‰««›¹ªš‡ÉUi‡x‡fxˆW™J†ˆ«Ë»»Ì»¹y—ˆ‡XŠUUvhX…‹ˆx…˜h‰¹¨¼WµHTGsKVg—Wˆvˆ›˜‰›š˜y¨g‰zš†Š†»—i¨»{̼˺ˆˆˆˆˆˆˆˆˆhTFfEfˆX…„{e‹µµ‡¨GudY‡‡Š©™Šˆ»ªˆª¨ˆ‰ˆwwY©†gzgˆVˆXº©ÌšÌ›Ëˆ©f¨‡ˆh†Vuieˆw‰ˆu™VŠ˜™«…›ehEFV…Y•xˆXŠ™‡™™š‡˜x˜wŠº…‹ª‹…›˜œ¸ÌËˈˆˆˆˆˆˆˆˆˆeHTuEuW†gW–H™¹{Èw¨V†uX—™Š™¸ˆ˜›¹Š˜Œ†x‡yeˆ©xu¨wˆUx›…¼ÌÊ«Ê›¹wˆz–i§fF–IˆUx‰ˆT¸E™xÆŒ–h©UgE—H—X†wh‰‰™§‹—‰˜x†š‰¹ˆ¹Š™y¹kºŒÚ¼¸ˆˆˆˆˆˆˆˆˆˆFTEvDWX˜E‰Dºe¬§Êj«…™Ez¦{«ˆ™˜¨Š‰¨{•yw†uŠe›†‰u‰…wˆ‹‹ÊË«‰»—™X¸‰—zU‡EY‡ee¼D¶EˆZ…ºœ•iÈXTvy†v†xuhˆzxŠ›‡˜–x§Y¸‹µËˆ¬—Š»|ȼʈˆˆˆˆˆˆˆˆ
 ˆˆ…T5FTTXˆVUˆXxˆ»¬†¼¨‰V¸ˆ©Š¹y¨x¸h‰˜‡x·GˆU‹v˜ˆˆgŠ‡xŠ›Ê¼Ë©ËX«…XŠ¸ˆŠeweGfvVi¶VWf‡‰ˆ›ËGÌuxU˜hˆeˆ†X‰ˆhŠ–y–iˆwyº‰¹›šŠª§«¸Í¸»ˆˆˆˆˆˆˆˆˆˆˆeDCFuDeˆ‡Uxxˆˆ¨¼¨ŒØY©yº™‰ºˆv©wvz‡gˆV‡Xwy†‰˜xvš†[§¼»»¼Øxz¨ˆe¼‹˜†˜wTTˆTYUšeUh†h‰‹»‡¼–ˆu‰†ˆjfh—g†—j‡i§hW¨¨ˆŒªª‹›™¸ˆÌªË‹¨ˆˆˆˆˆˆˆˆˆ†eUS6eD„Xˆexˆˆˆˆ‰Ë‰Ì¹›‰«¨Š˜Šˆx‡wˆ‡w‡exV˜U¹h¹‡x‡‰g»›ÊŒÊ›—‰x‰†Œ¨›†™vUeGeUW‰evfxfŠ¨œ˜»¨©ušw‡xˆW§hvˆ˜g‰e˜Xˆ‰¨‹»©»ˆª{˜›¼‹Éšˆˆˆyˆˆx˜ˆegUDDF„FvˆuXˆˆˆˆ‹Ë¹¼»¸{¹›˜‰™‡whv‡–X‡ehf‡y†‰©ˆhˆ†™Š›¹Ì‰¼–g›w¸‹¹‹¨‡ˆeUUwUVgxUhU‡g›ŠÉ‰›ª–Z˜w…™hˆVz†ˆ†‰uˆx‰ˆ¨«»ª¹Š«k˜›©¼—Ȉˆh™ˆh‡š…WeUDD†UUXˆ…Wxˆˆˆˆ¼¸Ê¹Š«ª˜‰™ˆvx‡xwv‡W†xxf‰ˆ‰‰vx¸w›¸»ª«˜™WŠ¸ˆŠ«©šgˆtTxVuUyvuHhuY™¼¸©‹ºvˆˆ‡ˆˆ‰w†‰vˆ‡gXw—‰ˆš©»š¹™™ª˜™ª«ˆºˆxvz¶xˆ‹†fWeEFV…UX¨XUW‡ˆˆšÌ™Ì»ºi»ˆ˜‰¹gˆh—V‰W†V‰†Wh—ˆˆˆ©ˆˆ«—›¹¹‰©‰vš™˜Šº‹¸wˆuUV†Ue‡xVUuXg™«‹‰É‹ˆfˆzgªˆˆ‡‰vx†hˆx™†º{ª™»‰©Šºxºz¹ˆy˜hfŠ—wx˜xvWvVUWvVgh†fwWˆˆ››ËœË«¹ˆ©ˆŠ˜˜‡xˆgxuvwgxgwxˆ™†—Š˜š—«™¨‰ª†ˆx›¸ˆ«™¸˜h‡UuX…U‡if…eY„z¨{ÇŠ»ˆ‡x˜ˆ‰›uŠwh‡gx‡xy¸‰š˜º™¹y©Š©Š©™ˆ‰˜‡Vˆ˜x…Š‡wˆewUhfuXx†ggvgŠ™«º¬»»ˆ©ˆ˜Š¨yˆxg‡V†hvwhgˆ‡‰˜¨ˆšˆºˆœˆ¨™Š‡ˆ‰Š˜‰™‹˜ˆ‡xefwgew‡wuXehx‰˜©ª›˜‰‡‰†©ˆˆˆ‡v‡ˆg
 ˆ‰‰‰‹š™™«‰¨™™¹‹‡ºvˆx–Xvzvwˆxˆv‡fvVˆVxW˜X†h¥z©›¼¸¬¸¹ˆ‰ˆ©x™‡ˆf†ggVwwXxˆ–˜šˆ¨™ª›‡º‰©x˜‰w‰‰Š–Š˜™‡x†vV†‡vgˆ†hewfjˆš¹Šº¸†˜ˆˆˆ‰‰h—X‡hˆxx§ˆ›˜™™šš¨‰»ˆº‰šg˜f¨Fˆ†wwx˜†g‰eggxwfx©…X©eª‰šË¨œÈ™‡‰‡ŠwŠˆwvweguX†g‰ˆŠˆ©™™©ª›‰ºy«eºwˆˆˆ™xˆy˜wx‡Vvwh…hx¨ehuw…š‰º‰¼ˆ¨w˜yˆˆˆ—gˆvxxx‰ˆ‰©›ˆšš‰š™ª¸Š¹˜xxXvfw‡wfˆx‡xv‡Vgw‡wy‰™vyˆ‰˜«»¹»»™–x¨x‡x˜f‡fVgeX†f˜™‰Š‰ªŠªš¹©ª˜™‰h‰‡‰vš‡xxˆ§UˆW†Wwˆ…y‰‡Wgxˆw‹ºŠ›¹Š†ˆˆ˜xˆˆh††wˆv‰˜y©™˜™·™›‰«©‹©ˆ‡ˆfwwWgx…x‡‰†gxwVwˆx†Š©–ˆx™ˆ«‹Ê™»™—w‰ˆ‡xˆgfwUfvg†h‰ˆ™‰ªŠª›©ºš¹¨Š˜hxˆ‡wˆˆxhˆˆex…fvhˆ†xŠ—vgw‡h©‹Ê{ÊŠ‡xˆ‰wˆ˜gˆvhxwˆ‰x™¨Š‰™‰ªª‰Ê™©˜x‡VwgvW†‡gxˆ†wxwvwh˜ˆˆ«ˆˆ‰ˆ‰š©¬¸¹ªˆvˆ‡x‡‡‡Wfegewwvˆ˜š‰ª‹ªºšº›¨ª˜ˆ–ˆˆxvxx‡W—x…hwggwˆ‡x‰ˆ‡ghxw››ª«º™—w˜ˆg‰ˆwhˆfˆhˆ‡ˆ‰™˜‹‰šš»Š¹ª‰˜wˆUgvvWh‡†xwˆ‡Xˆfxhš‡‰ºˆ©xŠˆˆº‹º™«—ˆwx‡gˆwVheVuWˆvy™©¨›©‹»™»›¨ºˆ™x‡x†xfx†gxw†hwxgwyˆg‰˜x†xˆx‰º«©©ºwx‡‰v‰ˆ‡‡xvx†x†ˆy‰¸‰«Š™»šªš¨˜w‡Vf†wfwˆg‡wx…wˆgxx‰ˆš‰ºˆˆ˜˜i«˜Ëˆ›¨wxˆ†hˆwffefuxv‡‡ª‰©ššš›ºšº«©ˆ‰ˆvx†‡V‡wvvx‡‡XˆXwxˆxh™ˆ‡xˆ—‰ºªºš›ˆ‡iˆwx™xw‡hvv‡ˆX‰™˜š™¨›ª©ª‹¨˜xggexwwg‡xf‡wx…ˆˆgˆ™‰ˆ™ªšw‰˜‡‹¸‹¹›š˜uz†fxvwVvfvW‡‡h™šš˜ª¨›«ª¹«¹™˜i‡WyuˆVx†gwˆxvˆ‡Ww
 ‡ˆvˆš–x˜‰ˆ›š›¸Š©—w‰ˆw™xx‡gwgg‡xi¨™š™š™ªšª‰ªˆ‡whfwxwg†wwgwˆxhˆˆiˆˆ˜ˆ™©˜ˆ‰˜z™©«šŠ¸ˆvx‡X†whˆˆ¨™‰‰ˆ‡‡xw†‡ˆˆ†G¾ü¥,Úˆ…"|í¸jˆˆˆ‚1¼ìé†tʘ0DÞû1­íä"O̍¾í´sXˆˆ‹ŸÝE#TkìÅÌH¿í—F&•ˆÜû˜ƒ­¾íÈCHT½Ý•U%l¼‡68¦SHÚºˆ‡¸Æq—©«í¹‰ˆ'nžˆFLuVìʃCF¼½˜ˆƒCeEy¬¯—'%hr'ˆîÆR7Xœ§U¹¥Wˆˆ¹ì´T8XˆšÈëµthX«”T˜üÅ‚hÙÅR†»¸{ŽÍ¸4A‚Xèܝš76‰ˆ™¸É„bxÚÚ†‡w˜…tšç먊‡F#g‹ÚëË”U8Iœ›ˆxªˆtˆÙ‚‚DÈܪŒÜE#Tvˆj«‡WUˆˆWYͨS6z¼‡‡˜„bgˆËÍ»u6'ˆˆË™½½„E8Œ—uY¼ÞƒDHõC„íý2mÍFè3n¨ý„¼¨v,ªÉeÌ«"˜ü¢ÙØÁp­h6ÊÕ&›AHˆˆÍ%£6ŠíW?Îd%+î¦S¹ý°“ìì‡dxÉ5»ƒÅUxËëÒP®Ús1‰¼8<ͽÛ$"„ˆˆÜ¿¾x%"O¿FG¿­¨ÍÉ…4y똈ˆˆˆˆˆ8‹Èˆˆˆˆ‡R6Ç£b¨Ú×qr»W6ˆˆˆ¸vˆˆˆˆˆˆˆ¸XˆˆˆˆÈ‰»W8‰®ì¦3Œ›X½ß¹ˆ6$T‰é춄h8%ŒŒ©˜h‰‰X52„™¨L¾ÍÈU3erxëÌ­»H4Tì¨jŒ¼È†XŒe7H|½Éˆˆ…uF5J»È‰ˆsFˆ†xyFG[‹ª¨gzb%jÝœÌççQRX¨Dx®ëØssv¨ˆ—ŠÊÖCg¬Ú˜duˆˆ˜‹œ»Ù´rThF{ž¼‡3G‡¨ÊÌ·T'8xœÈÉ…uƒWºË¥dH˨†g˜¸„zºÉ”uŒ‰X™‹ËˆDvˆ¹‡T‹™¨»½ˆE8ˆƒ„¨êº…‡¨‡yˆˆ˜‡…˜¨ÛÄsw¹gxÊ¦ZŽz56x…DHÜ»‹ÉgCc›©‰­‡hXW„c‰ËÈ…©¸…[œÊÇ4T„™ÌÌŒ¨¸…Twˆxª•œ¨ˆ©ˆu¸TWˆ¨×„y¬¸uC{™w8›š‰h†…uh¹—‰ˆWDsyÛ§Tw‹Ê5IÊXk­‹hhVˆ˜¸Š«˜wWU|¼¸©š†wWZ¼„ˆ¨uttGª­œw‡†„tF˜´„‡ºØƒˆÌÉUeœ©ˆÌ‹˜GZ¨”‹ÚË´ŠÉÅ4{«Ø‡z‡‡ˆe
 UŒº·T‰˜V(}˜8Wˆvh¸¨„e˜UUŒÉ˜ˆ‹‰ˆ‰¼‡T&7Š™©ÉÍ•S8ËƃXȹ…ˆ©È2u‰ÉÉ—‰˜xv„™º¨‡Š™¨ui›ˆxXœhVUŠˆhœ¾‰UG˜„„w«¼ˆˆ˜h©„hx«ªˆ˜wW„E™Š­‹xweu†ˆÌÊ„eh¥„ŒÛÈTV‹˜X­›©˜ejˆˆ‰tuˆ˜™¬­¹75uˆ˜¸Ë”CWWe‹Ë˜T„ˆxI‰„T©É©˜xˆtgœˆ‡‹Œ¼˜j¨…xXj«ÉÙ¼›‡XHŠŠˆXšŒ¨ˆˆˆˆˆˆˆˆˆ‡VUjˆwhŠ„UH»©„4ˆ•„‡xˆµ…w˜¹ˆt7ˆˆˆˆ‰È…vˆˆˆœš©º¦ƒExÛ¹ŒËÉ•yš¸vi‹«ÈÈu‹xWˆˆ‰‡X¨T8hŠˆH‰¹†eFi»—g8w—…w¹©…vˆ»¨‰wX««…ˆ¸—ˆ‰¸»šŒË‡w‰‡XY›‰ª¸V†ˆ¹˜W‹VHl‹hH™ˆ‡w¸ˆˆ‹w7{ˆVH\­†F™¸˜‡GWx†™hx…uWy‰†…x˜ˆ…‰¨¦tˆhXŒª†HH‹ˆvÉØ„u™É–‰«É§u‡gˆÊ–ˆ™xuŠÌëÄdug˜ˆŒ­È†VŒŠXHx‰‡i¬©wxFTx»Ø†ˆuW59šˆ˜‰«…EX†‰ˆxhj‹ŠhXˆ‰ˆ¨˜ŠŠ¸¸gŒªHx¬œuh¼—v¸ÈÊ„fW†wŒ¨˜†ˆvXH˜†‰˜Èu…ˆ‡EhŠÊ˜eˆ‡H†z™¨¸hŠ˜xx{©FX‰ˆ˜x¼™š¨˜„u™¨©ˆ‡¨¨™…t˜·{œ‰·Ce‰xX–‡xhw†Šº§Ux™xx…†vhX™›ËÈTj›xfZ»ˆx‰Š¨˜¥uœ¨˜‡Š«xGˆ†˜hk«›¨EH‡gXX|ˆgXˆ††GJ¨•ˆÈÈ“„x¸ˆˆ«ˆVZ‹—ˆ‹˜†©Ëʃu¹ÆgŠÊÙµuˆˆ˜‡yºÇ…YŒ¨gDlŒ˜hxˆˆF›»‡©hxƒtÉ·u†x˜‡Œ‹whT‡‰ˆ»»…ˆG6…™É§wŒ¨hgˆ†WX‹˜‰˜ÈxˆehV{œ¹˜—t„GŠÌ˜†¸˜†‡x¨¥eŠ¨Ê»ƒD¸¤SfÛø£H½¹EB›Ì¸[½‡ˆFCy¬ÊÈXŒ¹W$}§7lœªW9¬¥eH«®z6Gš„VˆÊ»„U¹™‹ŠVHº„U¨ì¸…EiÈ…›ØæSceÈ»½‹UYÆrgÚ×Rƒ»è…T™¨VDhšˆˆš‹™h5wŠºÈŠˆuh¹¹…W¸ÈxœÛ…3u‰¨¼Î›Dj†ˆÈÜédWˆseËèƒS†¹Éu†ˆ˜UYË‡SStxÛȇ›¸TT™¹¨Dz¬ØVHœ‰G
 4‹‹ˆºÌ©d6GhŽº˜»ƒ…©º¨ˆš¸UXŒË¹ˆˆx¨vZ»¸‡‡…UG‰Œ¬Ø¸e„Uh¨˜†ºÈ¥f‹x4E|»¸z®…D8E‰ˆ¸é¸…fhº……ˆÈ•d©È¶x‹ˆHF‰ŠˆÉȃTHˆ›–¨ÚÈddH¸…x›Èɤtx¨ˆ‡Š¹ˆf|«ˆgttxx½‹¨UE…g˜ˆˆ†F™Ü‰t7h•uxØØ–ˆˆWSs—ÉÌÛ•gXUj›™¸‡††¹Ú»†gXTZËX«–™89˜•hÉÙˆux˜tu«ÉUYŒ¹WW……HI½ˆ›¸¶tˆx8{»ˆ¹»¼“eg¹ˆ‡¹¸˜‡xɇxy†H˜›œˆˆ‡‚TW‰¼œºˆ•u…hX…„v‰˜‹ŒˆWU……˜Ê»…eˆ·„w™˜˜Œ½¸Fg…v¸Ë«—ˆ¨‡x‰ˆYºˆ—ˆ§uf©Ø‡uxˆVYŽºgG‹ŠV&¼‡Xª»„D¸É—wwwwŒ¼‡Vk†E‰Ì·uFxuu˜¹¸xˆ™ˆ‰•†h¹¤sv©Èt|Û¸Tt‹¹ˆŒ˜†ˆh…u‰ˆ‡‰¬ÙT3Œ«WI­šV6{›uh˨…whŠ¨ˆ¸¸x‡eX»¸š˜Xhˆ‹Øˆy†dHœÍ™†ˆ¨„eˆÉtu‰¸È¦‡ggU…‰È¸†ux¸v‰‰˜wD‰šˆi«šwGG‰˜¹É‡†‰xY›‹©xg…‡˜È™ˆª¹EX¹XI˜EiË…dXš´…©È¸v†xxhŠš¨‡d‡˜¸egšÈwXŒ¹GyŒšEH™˜‰¹É·u‰¸Ueˆ¹¸‹«™gWuˆ‰‡«™‹¸GEˆ‡xY»…gh‰˜‰@Ðÿòû ð?üíÅþ ÿAþØ0¿Ð3#‰ßOü€óà_ôV‰ú€Óýÿ…ÿ2øû êÅ	ãä'Þþÿ *çWD[ÍdZÁ3Žü_ý=å‚ÆÝ\²\3ßòÛ9ÉSÏÚ3IG›#ÏÓ&¼ÛV•$lúM·kµ3HE¸¼ˆ—ºlÈtX‹ÌEÌ4›sˆD»§>ÄÝDÌ£W¥&ËÛÔ5TÌU|u|ÎT§<Ä:”–}„¾3º…—ˆ©H܈…{·DŠD™œØVkd·UTÍË„d7ȶvDÍËÉ”8·»wƒjiÛgDwˆË·G›¼·eThËV–IÌ™‡Uj‰»Gš‹·•H„k¹H™‹¶ŠWˆzªˆZ¨ˆx‡VW›ˆxŠ‰¹©eH»Z¦i†¹ith˜»‡˜»wŠe•h·—y‰‡x™f‰™‰ˆ¸x¶xV‡whwx‡wh›Íˆˆ„Xšd#6ˆ{£$ˆ‰›Ý¬îÖ1îS"ˆÈÝÝÛ"hÿë¹sB16íÎè4k¨B#Xˆ»ßüSJŠïÄ8
 ÎÛ»R‹¶YÈC†5Ìs6̆…3UzvXÍî—eSFÎÝÙˆˆˆƒWwvfxˆ†Bxˆˆ‰xÍìUiˈh—¬Ì§U¼ÉD‡UX¬¸C6™«·34hˆˆÜˆœËT|Ì̻Ȉˆ‡34‹ÍÜ–3C$H¬Êª™…CEi¼ÚŠºvUh¼»ÍݘUuCE‹Üܨs33Dk©«¸C5ˆˆ‰¬ÞܘUUy¼»É§C#5{ÎÝÊuFTEEYÍÜͨC37ŒÝÝÉSDUˆ¬Ìܨ„3#4jÍݶD#F›Í˺—UgxˆŠ¼ËÊx™¼»vewuDCFxª©‰†UW†gˆš»¼ª—hŠ›Ìº©wfTEy¨˜vy»¥DEx™ªˆŠÌº‰‰‡x™™««†UxxwfwˆfTVŠ¨‰»—UUX‹»¨‰¼˜f‰š¼Ë¹uVfx»Ë¨d3EUX»Ë¨wfuUX›»¨˜wˆ˜š©‰ˆugx›¼¼©uTEE™ª»¨hŠ©™‰™…TVŠª¼Ê—evegˆ‡w¬Ì¶C3gš»»ª‡UUˆ«Ë»˜xˆˆª˜vˆŠ»©vhš˜eUTD5j¼Ì§UEF‰½Í—Wšª…TW›Ì¨ˆ‰š‡Uhª™†gUEh»Ë™–Ugyªªˆ‡‰«‡vx›Ì¸uTUˆ˜™©š™©†DDG›»»‡eVx›º¹‡x™‰‰»Ê—UXˆ‡w‰»¨uDUUgŠ¼»ºxvUVz«¹‡x˜‡UX«»¹vVwšª™ˆˆwgxˆx‰™˜x†ˆˆ‹ª˜uDDU‡ŒÞþ¨ˆˆ‡sG¬R=ËÛ¿Ãì"X‹íî 5ÿÙƒ>ß²|‘ˆŒÿðŽþ(Í4RŽÄ(Çc$iUßùT"¿íʈƒwdV‰‚xˆÕÎÓJÉ‹Ýt“EE½³%‹Å"WˆŽë½³LÜ͹ˆ…4¬Ùƒ"%½»˜B$ŠÛ¼¸V¼¼îµt#[íÚB"6»ÝS#[©Þì•V¼Ì§"îÉVD4\Ýëc#|ÞÉ2GœÝës"$î“"JÞË…Dh‰½Ì¨›ÌTG…DGzˆ‡DUX›Íˆh¼Ìº‡TG‡vl¶3GŠ·{Ëš¨™»¼µDx˜x˜DEˆŒÈUV¬¹zÉg‹ÌÛtDiͦ2$D½Ë˜‡FŠÉ˜gxx˜˜Vy¼Ì…DE«¼¦z»š˜SG›ÍºTTHˆyÝÔ"EŠ¼Ëux›Ë‡Xy¹ˆ›Ì¦V«…TC5¼ÆC4‹ÞÙz¸S6½Éx«‡jË…D3|ÌÉTV«¹‰»¸UzÌ…DXˆš›ªt3H½Ë…V‰º—Š˜‰»…H©x‹¸CDG‹ÜÛxdV›¨WˆTkÌ·UXªˆˆxx©™«†eg›«–TW›ÌˉuTH¬Ì¥CHˆxˆˆfxšÍÈDEz
 ¹«Ì©«…3E‰Ë¸hwgŠš©ˆdDW«º˜‹º˜š…Dx›»ˆvfŠ˜‡wuXÌÇDfx¼Ì–fŠº˜eFVy¹‡g»—h‰˜Uz¼¸vh«¹ˆwveh‹™ˆwŠ¨dE{»—h¼·UzºeV‰™ˆˆuW¼ºvˆˆ‰»švUW›¸wˆ™w‡†Wˆ˜šˆx›©ˆUi›»¨exxˆ˜xˆueV‹»º‡W†Vh©©˜ˆ¬¹fwx‡‰™ˆ†wˆ‰‡eg‹Ë¨fgx‹»˜w‰˜‰eEy»º—Vx˜ˆº¹…Fˆ™ˆˆ™š¨eWˆˆx˜‰˜z»©uVˆvfŠª˜fhŠš¨™ˆ‡Wx˜ˆˆvfŠªª˜†VyºŒ]òOþ=ÈbøÓ/ç^òà®â½<àÿÑZô`±übç.³ýBùìˆ+Ùˆ„ÃÓ2WR,Jñ_RãÃ_¼"Þ’ñÎ6ì-0Ï–!³ëCò|·ú-Íø‚^¸ˆƒÐ’Q§Þ@Én’ÜTÄî1–ýÅÞ+…ÊZã–ÞS|Æ<ü¯Ã›ÏÙC͈ˆK#¼C2›ë"¸Í4ÙH¬å2]ý‚;ã»x»L·b&êB&„]EÜÞ†‰ï–;»˜ˆ„(Ö5Ô$ˆÈ;µM­•3®ûB]Y¼KÔl¶#;×2F»uºLÜ΄ü…x¹ˆˆUK”R&Í’7ŠµLdÌ»…5ßÕ3ǨÖmT½c2\µ#ˆºXµ½ËíEÎ܈jˆˆ†„‰U"KÌBX‹”ˆ[Ù‹’ký¤7{gÉGËB3œ“5z¸Y˜Í½åLìÙ‡˜ˆˆ……‡S#›©3x›ev½¦»4ŽÝSe˸œt|¤35«cFŒ–X¼ËÞ´½­ÊjˆˆˆW”ˆB)‰¦Dy¨UkÌ[´GÝËE<ˈÇG»T$H¹CX»…Z̽ëwØݵšˆˆuhf´2WxµFŠ—E¼·«eM¼ºSœÆ}t[´D5X˜4‹¹U{ÛÝË›ŒÝg¸ˆ…wuŠS3gˆ¥I¨„ZËz§e»Êš7ÌXÉE¬DEDYvF«•W‹Ýë»ÄÍÕ›˜ˆv‡EÆC4Yv§j˜E«¸ªwl[ª”|·‹µW¸CeDˆfX¹e–ŒÞÙÌWÝxʈˆI„Y´D4hv‹™uIº‹§ˆ¸Y¹I¬wÈx†—4eDˆf‰§YµÝÌԫ؛Ȉ…ˆEx”SFXeŒ¸EŠ˜»xœW[¤lÇ|h‹…e4uE—X™‡Š´ÍËíJË›·»††…Hh•CUwV¬¥W‰{¸ŠÈT‹H¼ˆ¹Y»dUCuG‡j˜ˆª¦Ì½ÙœÅÌXØfˆT‡h´Cueh»…ˆwºˆ¼¦F…Š¹‹•«¸TU4eX†‹x™©È›ÝlÌ{Ç\Ç[eWgŠt5efx¹‡…{¨‹ÊutY¨
 ©¸ˆ»†dU4fY‡‰Š¨œÅÈ½È…†—U‡gªT6Uwy‹‡Vª˜¬·Xs‹‡»ˆ|·W•5C…y‡˜ªˆÍ”¼«Í‰ÊxÊx”hv‰¨DEGw‰‹…X©™Ë…ˆ7™[Ȉ»…y„DCg¨x‹¸ŒË…¹Ì»»¸º¨‰G‡x™¥DDhwˆÇU‰Š«©itkUœ˜¸ÇU©e5C[ˆi«¨¼«¥kÚœ»«¸Š†J‡yªeSEvˆ‹¥Wˆ›¸˜—E¹FÊ™º†h—eDBº†šº‹º¼“œÈÛ›¼†©t™‡Š·UCHwx»Uwy¼†‹„Z–Y‹¬ˆvx‡fS4šx›©»šËE¼ŒÊ»ËX§w˜ˆ›…U4hhzÆgvŠÈgºE¨x•›ÊwhxvgSCšˆª«¸¬¸U©Í‹Ì¸hjyˆ˜¸UT7vˆ¼]ðÑòp"ÓñùOR?²/-Ðàì‘}ƒñôùÿ˜ˆˆˆ.…Ý/ÂÓ÷übêÃ×+
+ä	}.L­âÝüôPÐÌ#{ò7Ý*^¿æ
廤ɐN@$Öš=Ï9ßã]¸XÃBBZÒÕHè"îA}l½ŒÊê{˜äíõL숈ˆˆ[Cûm9„Ý„-ú4µÚº}rȈˆËÒŸì›ø…4Ä1Nä;ÈHNہ¿ä*Š†¥È!LRHĘ½ÎhîÚkˆ„zCË2Y£ˆ‰¼7þcŒ¬¨Nã$º"­˜‰Üø^¨ˆˆˆˆUR)–4[E]ÉÒ×3Û{¤¸17´ˆˆˆŠÏ¥ìû=˜ˆˆˆ2‰³GºFËm#ÝÄ;·ØH”"[Cˆ—‹Üí]®µØ…4vƒL„«„Œ×Ô-î³Ý]sºC4«4¬BÎڹ뉈†U†"9›W—:ËYVÌ«(ÕË4ƒUGˆˆˆˆýܾ˜ˆˆˆˆˆDE7Jtk™¨iª£¬ZUœ5SFU›WˆÞÌ´ì½¥4ÄLD3¨|†[Ú˶…Ë[ÕÜ•T3‡G¨j=îËŒ¨»ÕKEhCDS¼¤J{ªºceË}‡µ„H%¨ººµžÞËÙˆˆˆ†e‡3WDÊEˆµ|¤[[ÈŬdBEGxˆ‰¸ØÍ­nJ×»WEÅ6wi§¸Œ¼ÛSUYzkÉCBTUiW‹ÈέØ×nXdWyCDw‰¤5Ǽ§t½¹h̨e3FǻɮWÙœ|§È‡Ge—2Dw‹¥LÈÉj6µËˆ¸YD$Wˆˆˆ»^Í軍ɵ†k¶UHz‰Dfl¹£H[¨|D…4'ˆ‰Élةܼºº˜Hi”34fšØk«¨«X¶ËŒÌj„3*„gˆÜÄ]¼»©Zt‡ŠµSFV¼Ux¼ˆ”k;»…C©TEˆˆË\͵ìÌ̸ˆˆˆˆˆ2F¨´UzÅh6¤‰¼™‰…D3·z¼©Ì;¼Ú˜7¸™¬Çd7H›‰¼‹ÄŠ[YÉUTVb4†‹¹k¶KͬۨˆŠ»e3VˆÄekÄE&ÆÈ­Æ‹•GT[¹¼Ü»µ\Ú؈X‰g¥DD7‡Vg‹ˆ¹—[ªœvgf…C8z¸GˆÄ¾Í̸»ˆ½§ef­T˜x—uHu¥X¦†UUECˆˆÌÙªGÝܹFÚ–fUU3d8ÊÊy˜»j‰Ü›‡ª‰U4h»Ši·E­¼¦L˜U§Te»†gœ¦—Uf»ˆfxTCGˆˆˆ‹Ë¼›Lý˘ȈˆˆˆdUhvdHgdx·—……‹¨fxUÉ«vŠÄMÚÆdE‡‹¼hX™˜ºŠÈy[ˬfueeVY•#™¸ˆªƒÍ»›«»yËœ4hFh•XWSEY˜Zª‹©‡œÇ;˛̺jÌ©•Hº™©C5Xfxv•Wf˺ˆ»„‰…E—t:¥WH‰x̽ռ¼Í×TX»¨•j–S6©¸f…ThUw¨³HzȼÊ\
 ÛÉV¹ˆÉUSDTeV§ˆK‰Îyo*øn{¨ˆÎ/A´âõâþý·˜ñèQIááãóLûâ°â¶GˆˆˆˆÅîö>숈ˆˆˆ0þ0_BÁåälø)äCÂÓ"¾ˆˆˆîrOùÜLbó"ê3ï–[Èâ~¹[ˆK4Â|'‹Xˆž²ßâOÝ=[¹9Ê4»I*{r\Ã,ejÄxˆˆˆŽK~¢ÏôÍlyˆˆ:É-¹2="½Ò.Gw-sä6¸›Ì"~dݼv=‡=æ~æKŒ¹=[†¨Ds7R(“{»ŒÛÌ$÷3ÞɈ\qNä¨Ù+»Ê'mBŠDR7xˆˆˆÎÈí,Û¹´B¥\TŽÓ¼Þˆ…¸ˆˆCsE!XˆˆÇÛŒå(Ì´¼S2hˆŒÉÍFîí¨ˆˆˆˆˆ‚5!9vˆ·ì½äjÍWÜDs“\ä|J×ìØNËE¥C3¥#x¦\ÖÎÜ;ÍyÅK„µ1DSi̾ÝÕ͸ˆˆˆd23§2ÛzˆÌC=×<Ü›U¸3Ü2HˆÞÝͼº˜ˆˆyR"w[Æz|؃L{œ»¼·U4Ò8E4¨¹MªºÍ„jÉT:Ó\¬Ë»[T{WXÜ›¼µH‘uZlu”ŒIËÛy©Se‹dÎcKØf#EVkÛ¼»ÆÎB—µŒŒ…†4ˆ¸f»æS\šÍ‰­„ÆEUdK˸X‡Í$l¤¸‰Ec3Wˆˆˆˆ¹Û˾©Ü›µF4†|—»—[É"Î{º×†ET4c3hˆˆ¼èÎt݈TSE4žË¨§œ¸3ËŽ­Ç—§3Ub5DhˆˆÌîm숨tFX·XºhȵËŝ¹T…6F„CxˆˆˆˆÌ¾ÜÌÛU5Z{Ý„Lȳ%ºˆÜ†kÈHTCC3Gˆˆˆˆ½Ì«†{EM¼É™ÜV³UÌ|ƈ›•GydDDˆ5³z—ºÌ͵¼H­¶‹wÉ}D2ǽ›cEuEkX…;…MÇxSj¸½«Ì4ÞÉݘ¨ˆ96ÇÉzx¶”df4S\•Œˆ¨’8Gˆˆˆˆ¾¸ì½Ûe['œÈ¨I§Æ„„TTªF̺\“—Ct7™¤ìÊÙÍØx¥%kxÄWDWYÕuE´kÊÙ¾Bˆ{ƒEGUݹììÅ{…UØhTŒU\8„UY…»”»¸D˜uDDXˆˆ˜ÝÌØÚJ¥Ç«…uv¨Y…F¬y¸‹Œ”tWˆ—T‹¥Fd»Í¸‡G‰µVf2fé–xµlÛ‹Žvt8hšgÌ”›´¨˜Z†»X¼¨ew5©—eZ¤Ì–¹ÌgTdDD8½¼Ë¸ª¤d8Ì´‹Š¬Ä)¼ld]WÌŠ‰ÅËtcx„G½L™Ù›¨T$ˆD§eEt{Êl—»[ÊzŒÆØg„¸d‹ÜIiÛ¼¨TX–"d‡Xc‹Ü©´¸œ¼tkyØD
 SwTšÛ¬ºµ{ËFœÇC3CX¦¹ÈjÛظª‡ÊFÇf„Hx¼Ø{ÈËXtU­¦R3BFˆˆˆˆˆÌÌÇxœÊÇD‡jy½åÉˆy…„Œ—BETEED‡‹ØË«¶É‹xÈ4d${ÝìÏ"ðˆáüRà㥈‹_óèæ/#ð,~&òßN¹ˆˆ1Å´½òŒ£/"Ó8‹YóoSú…µa‹Mßœû˜ˆˆˆˆ9Â2¹/Rä[;4òZ*L×þ.Rs3HˆºëïNÃÓº<„á=:äîLÅ4¼<2c£Î]ÒH•J¤üMÎ˜ˆˆˆˆ&‚yxŒ[÷]Ø·Â¥GˆÊ¾cå]N[èÜi˜ÈˆˆˆA²LVkìåçHB´47ˆˆŒMûÄèm3FÜÞŒ’¤8RÕJ·ËÝθˆBš$!hˆŒ¼öÎœNR¹»tW[+¶ã"UfÃ[lßÄèk¸&BG5ˆ¹ß¿èˆ†FÅ¢+'kÕÙZ„6Èk‹Ö„­LÙÄ5swˆˆÜìU†lX;U‚…ͨèÝe4Ù·$EÜ†C—5mf¨ç†¬åÄÜ2&§#7ˆŒë­ÔˆHºw·„xEÄ«¾»‰¬KD\¸»¼2G%CÖÇÈ”]÷‹ÝÅ6m4%fÝ›¹ÍK´ÄÉÇT5…kv²\®KV~¸Î̤[6$ÆEUVHϼÝÉHºˆB43‰”‚hˆˆ‹ì»‰T¾¨ÕŒ$IÃxVÎÎéˆyˆˆtEDS"WˆÉÍ:Îæ[[¼YµSE6C«Ëʉ5ëìˁKJE#6·Í‡k­…ÍÌÔ…C$Ö¸\Ã\ÎÎTVÊ؈„5%D”‚†Wˆˆ¼Ê<­Ö4—•{ɇœÌÛˆˆY¤9+}–4Ê……l¼ºf‰F£½uEddjÜÍýÂ-ÝYjC8¼C;SÈÍ·ŒcdWÄlÈ£Xœv<ÊÌÍê:YÊŠˆ‚#DSZ‡ÝÚ(¼ÅGƒ…H“X—š«Þ›ºœäf½Éˆˆc<CUgc½zšÛ¸Ùd22TxˆˆÍ¤|¾»ëH“½j…dKµ”DTÊW^îÛ”³:R5SdXˆˆÝÝÞÇxeµeK‹lÃ58ÒL‡œiºj¦˜dW47ˆˆˆ¾ïì;yÈ[˜S78E©ËúGx³¶[ÌÍ¥44[$iF¦ŽlËÌƺ¨Cƒ3\ÝÞ벘}G¸ƒCJ6ËȉEƒE„ˆËßÜ¥T:´6ÃE\´‡ÜÌJCSD8ˆÏì¸(»ÃiÅ5K´œÉ‹hDUiEvϾèˆTur%¨8KżܻtwS$8ˆŒËíÍBkç\Ùd;Ì•»¥B5CHdˆ¾ü‡”$x3(Z›È̵‹e4„X¼í¹‡hÍ3¼¼K¾Èܘ‡eB!DˆˆÝÌíÌ:mS¬§$ft·‹µdETd{
 lÿ뻈RIA'©SŠÌÞ숕iRH3:Þí\ºR½„8Ì´|ŒÌ¨†32C(ˆˆŒï<ݸ-D#¨ƒL­ªÍLJteUµ=îܨˆˆ-3X†y‹ÛîÆDcECWXÞÞæKˆeŠb[d†Ê˼ØC25Dˆˆîü‰§”uSHUw‰Ê¼ÉY³4DhyÝÞ舅†#A4hˆˆŠÝÜh„5tFŒïϳя=Šó=\-Að>×&∈.öîiÉ…¸ˆ1ѽ'¿òÖV<=äïʈˆƒÕ'ĈºïOâÔ&S™®û퉈ˆˆ40äÕíOÒÕ5ˆˆˆˆïßʈˆˆ<1aåÍ¿ÄÄ%ˆˆˆîß鈈ˆBWïÉæS6%ˆˆˆî혈[PƒjâϛԓRˆˆˆˆŽÿ눈ˆƒ6ÅÍ9ÃQÔI“xˆˆ‰üËäí&ƒµg}<VÈâÛIDƒt›;’IÚìKËÍèg-E+„è[t3£ª(6ˆˆŒŸ½ß¨ˆˆRsÉ]<›âË]%xˆŽ®Þ숈3t´Í©èȈ!Fˆˆˆ®üÛÛ‚”#·È{ÌåèˆDqWˆˆŸïꈈu…"TeÚÙéAT”B8ˆŽÎëÍXm5WA3­ÚïÊ3\2C%xŠm|ü‹¿K•f at MœÝ똈C3T›K\ÕÝν‹“BW½é=î329HÜE9¨çï͘ˆ‚<F3Ò\Þœs%™µd&Gˆí®ÜŒDÌ<¹`YíˆÌ45¸s$8ˆˆ¾¾ÌȬ½[ƒ"¬Jƒ]؃ƒV6Kœ½ÎWºÍ؈‚-sI\Í×AF¦:¹Fi{Äîí݆{ˆˆ;¾«³"3U•uxˆˆîîɘˆˆS½ÍTiC5Ë”d8ˆ‹ìîä¹Øˆ4[1½©[‹h”S2WˆˆˆïËÛꈈXš‚4¬yi»138ˆˆˆŒíîŒIJ„qÝ×½•0Fˆˆ×¬Ýê]juZFÅ+ÜÛ4B33xˆ‰ä´Þ嬌ČD›è2íµ3VB‰½å5»Ôi¼ÙÜ9›ÍÈ…YR9D4¥œÄ5lÔ|µÊ݈Ê»¨rÅ4[ÌÞ“$MÄW…”ÜË˼ȜºC"”[îÝ“"7rW¤hŠ›ïÜتE…’ ÛÝïs#C£[Ãe®‹Üîǘ3%µSSÎþÉ3X¢$c„K»ÝëŠEG4™ÞÍʘ7WR42hˆŠÎÜÇìU656﮸C%TxBBž{½ÜÄkÃF4H¾ïɈ"\UxBS•Z¼Ê¥‡lÈEŒÿ|¨ˆˆƒ{C8‹†½Édh”<†¼ïͨˆ:—6…\¼x¨XUSsˆˆÿ쨈[ˆS7"-Ú[ºd3txˆˆÿùˆˆˆˆDF2$¼½Í¶2B
 HˆˆˆïýʈK¥&º£6ÄŠÌ´S2&ˆˆˆ¿ý똈ˆCy“\•uˆƒd45ˆˆˆ¯ùÞ¹Lˆ3d5¼ÈÌ$T33Xˆˆ¾ç¾œN¸4ØT<Ý»ˆV"C#xˆˆ®ä®|^iD¸w‹›½¹UB23{YÝÞÕ9Z\©'¸ŠÊ¼›ÜUs#1hŠîÝÓDh5§|›ÍŠÜªSXsH"T‹íîæSx#BZ\έܺƒgEFõþøˆˆ
¢x‰ùóëAŠñõÿÚ"òóý//5àðÃ-,LÞÿ˜ˆˆ[µâþÎLãñB>OÞ˜ˆˆˆ"Xë˜Îg3,ƒˆîäÍΨˆ‚TarÍÕ¾¼CÀbHŽ.,þóøˆˆˆ"Hp£Xß?ÈÁȽŸïšˆ‚興"KÐÐÕê*Iuˆˆßÿ˜ˆ„£“´^;NÁ3cL¬RFˆˆ‰ÿˆ8Î݈%d7ˆˆˆˆ_Ÿí˜ˆˆƒ=ÙäèSh7ˆˆˆˆÞ?^ìƹ‚,.߸ˆ‚hˆˆˆÝÿ]\l˜ˆ"¤(½ëÃÃq5&ˆˆŽüÛëteËBDä½…¸ž‰H0"hˆˆÜüÝsZDN®¤ÈƒQ¼4EC8ˆˆŽþÍ؈bP<Í}ܘQDYÓ4«i†èÌúMW«@)¾ØëÚH31tÓ:Ž\¼œÔÍRíAf½„þ˜43XˆˆïÝKÙE^TqIí=¼5ì’„5ˆ¿ëý˜ˆˆD øŒÍB僜4®¸ÙßÅsEGõíèÌ‚5!szÄi|ÌÎûÚˆˆ†0q·¿û8³H‹¹Ý¾öÙˆ„]ˆ2 Å‹¿ˆW5ÓTcˆŒï³ìœZ]JË€ÜË´"\k0Wˆˆˆ¿Þ÷Ȉˆ!¾ÓC\H43XŒ•}LÄeïý¨ˆˆCDÎÝIUBxŒeˆˆ—Šÿü¨ˆˆˆ0.þ¨EC5xˆŠŒè¹…¯üˆeÈ0C¬Ìéƒ!cˆˆŽêu¾íHN¹ˆˆ‚tAÿ£UˆˆˆˆëÙì³4Nþ¸ž¦3<¹C“s4xˆ¿ì¶l«S®é„‰UQ1GŽ¸fZ{§kïùˆˆ%yúÍS-e2ŒÍ»wBHˆïìd,Þg5ϘˆˆX‹ëVM‹ÎZÞˈˆ† '¿ýTc8ˆííŒÙ$ßùt%SýÛÈB7xˆìm¹ÕK™ÞÛˆƒ…9Ïý1chˆžßí¹ˆ@'¿û0É„½¾§­¤¥!HÿÙE²V‰fEÈÊ &ŽïT"³lÜÍÜÜ·˜Q_ÝÅ1Å…8n»ÍŽ4þăÄC8-Í»”¸Wˆîû³×[~><¹ˆˆ0jþÈ1DxˆßÞÙˆ‚ /þ¹3t5šmÌ–B‹1ˆˆÿý•dTļµÅC
 ‘XÝuSxˆû~þ˜ˆˆƒû´"ÈzÃ;›z“ìÔ<ÿû‚§i¬KÆ,²Û‚ˆˆˆ—Ý^Ý|ÜȈˆˆ CÞ¶S[Yx7ÝëîË…!QüìÅMET9冻64ˆˆë»¾¨k”Ý興ˆ2¾´2ˆˆ‹µýÞ½¸„4¿íƒ4·ƒ…½D^WÌCtŸìc8ÔGéÍ\¸J‚!ˆ—ˆˆŠìÜÍʼˆUƒ9Šé&TZ„3]§Í©È„G:ìT8îÇX[KÜDR1GˆíE¼ŽÝÇUʼ¨ˆB"+Ì4UWˆ·ÍìÎlf33¶ÏëJ,Ö+ÆŒlT43C|îSH5Ùݺ߸ˆ„R;Æ„XXÝÝØÍÌURSµÞfÔ4ÜX‡k½»…T…KË¢4j¾þÛW¹fT#%,ׇ™xÜ¹E¼YwYKLÅ…$\ëÉÙߨ†3t7‰L8{tíÜD^sR2„ÈíVŠ8´ÜÜËm؃BdUÜ"†5ˆÞÝìŒÈ…"Kx˳b'uMíÛSçUDnËsU4xÌÜbÅD"<»›‚;VËžîË£ÌZƒ<ée‚%È[íÛ£^vT\ÙÇTJhŠÊ媃Wc5ë˶F¸xÈý܈L…„"ÍT3#ˆˆˆßíÚ%ÒtEß»d+ÄTˆÝX·"“Sfî×Y3IwÌï݈†„5B}´4#ˆˆ½ßî§5XD•¾Û3‹Uf¾Ëe2‹–ç%SuhËßÛˆCuR˜N„Wˆˆ¾ÎüÉCCu͍»"Bµ§½xÊÈR[|kÍú"3e|©]ìÈAŠZ4iê26¼MÍî눃…3{»ÛA4Œ4]¼ÚZr­UܽÊB3E)ÝÎÕÌSTI‹kQC­Æì¼ì¦19D®–Ûb1mÄܝؚSŽw©ì¸<§lÌèTDuzºÖQ6NÊŽÊÕf3mB̽ÄD5~Í\ÙÄH4MרE×3$EÜ¥ÔÛxgž»¹Rè2%½ëÃ×Ëz2]–ESìs5®íÓŠ†5FmLj”½A%lÌŌܸk¾ÈwB:b#\ìÛYµWU<Ê……Ë×5žëÈ#¶DGíµbE£$kí½B͹»¼Ûd2$E5®ý‡RzEˆ›î„D‹U¹íiA&D‹Üë‡C7DeÜí½r=ÖºÇÌT"$fÅÈîÅT&…ÍÔ¾w4F´ØœÍ”Tƕ˽‡35Õ¶­ÞÈ„ܼÊHd4Csª¾Ù6cÖ|Ýl´23»½–»Ê…@Ì›½‹¸SbLÛÛÆDB›ÌxÆBD7]ۜݓ4\Ë»S‡US+ÌÝlÅXU,Û»•©VzUxÈ[¼…58ÝÌ’8…Zu†ì§}É…tˆV·DFwTÍ臺˜»‚l¸gZÈUC*Ý´ŠÇu³¼ËÆ3Ìt…H¾
 Ü©ÉDDKµGcK¹s+î»»˜Y¸%̹cI‡ˆ3ØŒÍ³†9͹B:ÚH„º‡‹Ö“4yVYU½—D¾ØZ¼»ÙrfTEGÈUT]ÎwŒÜ¶SVh…4ÍÅd;mÌxÌÇS[•G•ÅB<ÞºŒÌÄC$†DU¬´eX®ë»Ý´4:¨™d[´4w‡ÌÙÍÈd'Èu¦Y‡T4ÝéÅ­…V"‡wš­Ç5t­ìÈ^ÉDB‰tVKÊ#uŠËí¾¹UBYukÊÈESlÛ¼­†Er:uª‹ØC„[ÝÝÅÚDR%†wfÛS…ÝåÙTD¨ˆªÈCC<ݼèËTi$VW¼ÈDDLÞÞØYSE"wi¬Ü—4<ݽ܌”D1¹xŠ§V#hÎíÝÚ†5Agf­ÙG2XÜí»¸c5RXšÜÛF2HÍþ»É…D3$W»©U3ˆÎþÚº•6D+—‹É…"4Íü¨¼†Ux4ˆ[«¦4HÍîʼd3DBWŒÍ¶4DÍìËΈŠD3g©{”"6ˆíì¾ÇUD!IÜÍì4$lìÛ{µD3DIÜÝÖ"‰ííÞ¨XC3&«œÈ24ýì̦#CT8Þ½ÛB"‰Ü̼ÇDC‡DÌ‹yC4ŒîÞ̨dBC3¬ËÜcEŒÜÉ‹ÖdTV4ŠªÌR#xÜíÍÜ¥C43H¼Ý¥TKØ̬ÙU3DDKÍ݃#5ªÝÞì¨t3#(»ÝšÌt5Vx¬SE7ÎìÌcEEÍÛœÉ12$ˆˆè4„hÎÿÚˆˆtJÙˆˆˆS29¶Xt3xˆˆˆˆ½×ÍŽ†Î¹ˆˆRi‹ÈT1'EÍÙ™‡TÊEÛ½û«•E3™‹»Šf„8Ç[´H…eṲ́«eUUTidhCXˆˆ‹Ýí„UZ½î˜ˆB…5›”HsHƒ\ÛÜíÈXS\ÌÙˆˆƒ"IŠÌ—SC4ˆ¬ª©WËW̙̉º†kµx™¬˜c3DŒ¹©uCFˆ«½Ü¼Êˆd4˜«Š†©T‹ÌÖJdFŠÞÚˆ…!$4ˆ·Š¨ˆºŒÍ½Ûˆ‰t[»½…EB5x¹¼S38ˆœÍîÊË3UEÏ興ƒC#ˇU2XˆˆÍÝ´4XªÝÌËTeh§Vv˜iÌexfz…k”[µkÅY«»Ë»¼µy‡ewTXT¹xÌšª„Š…Z‚6TH¸•‹…¼·|µ‡iÍݹ¼eTHˆ…TDI¤[·U…EÛîèŒs\Ùˆˆ2"$k¬Ý¸E˜hÍÝÇB"5|íîÛe3E‡jËTD5½»Ë¸DÊxÜdxcLÅ9Æ6ˆ›ÌÇœ¥mÜȈˆ…"igËTe35ˆˆ˜xˆ¼˜˜Uuˆ½Þ†¨ˆˆ‡3"6‡ª…Dh‹ÍíÜÙDŠZܘˆƒ!6­ÝÜC53Œºˆd$ˆ‹îÜÌÈhs3uH»
 ‡ÊtV‡xœÍÝÇECF…WeETzªÎÜÌÈXÆ5«g«˜wºiÌT43js7eˆˆ¼Û…v‹íˆ3gY–S3EŒÍÌ«ƒ$T\ì»ÜSi†Îܸ…3Uy©wUS#hˆˆÍí«º›Ì¨¸23"hˆˆÛ›Ü˜Ì»Ý¨ˆƒ$…;î´42ˆŽîÄZƒ\ɽÅ3š‰Þʈˆc52*„‹·Wºd½ºÜ©ˆ¼e«SW3k¸›¹ˆ•¾Ù›B7U‹º™ˆD»«¼Ýµ‡2D2Ü‰ÇD…IÝìͧG¶7†CDBH¦œÝÍ«·DS8ÌÜË…gt½»ÌgS&…g˜TXd|»ÍܦŠ–{”4¤4f5ˆˆÎÜÜ™ˆ˜Txˆˆ«y·D¦DŠxªw†U˜evTz»½ÝËÌ…‰uUeV¹VºD›ˆÌ¨ºS5fY¸x¨EW«ÝØh…D½¬ì”D235{Ý̺‡4Vœ¸Uv‹Íî؈ˆCHx»–B3EŠª»´6™‹Ü¼ÝdVvz§W¦V¬¨ÍÉ‹µ#D6Èx†C8ˆŒÞé¬ÅjÊ›–S2$EyíÜìv‰3WxÌ–S#G‹ÞÞµxBlËÌ»”HC<ŽËÊ5d&ÖJÉhCGsµžÇÊš¹XÛ͘ˆS4"kf¬wVœµžæmÓ3vKÍ웶4vj†hCT#ˆˆ‰½ÝƒkGÎý‰¹S¬U»t33#xŒ™ökÔ*ÌŒüˆˆ#|Úßë32½Îí‡A·]þÜ¥5Xݽˆˆ43W¸ˆ½¥}ælìšÌC8Æ#È2Ž„ŒÇg‹ÆJØ"ltÎí̹S4×|예#•D\HD—ˆ¼Ü]ÞkÈ‚7«H¾cTƒYÞÞ«„!¥LÏØUR#GÙÞ£lRNÈδChˆˆîý“'‹ïþˆ…,ÌÝë“5”-ù5ì3ˆD3Yµ¾üyc®îúˆ%ŒüβSnítEH†g¸EUCEÍÞí·AXˆþï²""žïìˆQ„Jݼ†œÄƒ3\ïȈS1?Þʈ‚ ‹LþT„ˆˆËÏöLÒ&¸œÞȈƒ Fˆßîs#ˆˆÿý˜„™EÛˆˆˆ‚"E½ÛœR"8ˆˆŽ¼Ì2ÆUîßɈ‚*RßÖ«b"wˆéŒÔ\µÞví³¬2¹¬ÇM‚&@HˆŒ†ì5¸(ÉYìíç­3®¨˜ˆ‚W~þ΂2}ëï³u#¬5ÈGÈK×%cWÚÏéDRÍÞýµFsm鈈R“Wé7‹%ŒËÜÖ¸Kx&ÕTÚ›w&2XˆŽë6Rhˆÿü¹„%ʜʈˆˆev";ƒ:Ô4hˆˆÏ…É¢¼ÜÎÙ2D•Iì4…3LU›ŒÆœù[ÍCÍTܧjb=3~²]B-dÌÄ…[œ}ìx’†Š»(ECËÈë
 jE^ƽ³TE¹¬ØJ‚Ú=ä7²+„HˆˆˆÜË3ÆËß܈„DØ«¨ˆDèXä3hˆŒÕÌ‹ïZÛˆˆUÉDÃ!3\ïÈU!HˆˆþS4GŒïíØ‚MÆ<ÙE¤Ä[²T6îÚµ43^¬ª’4Êœÿ³I2Ž»ÞQ(xÞìƒ!~þû„míþA%(‹þ…´ÎÌï‚u®ŸèD¡HnÝ5˜wDîŒÛlØ»ˆˆˆˆ„5C$*ä&µˆ‰ý#…5yÝîÃ+Ã|︈Q$¹\éÔüîÚI¹DÌDC3XíKÙ!$«¾ëR2xˆŒýbÓ)ÎßꈈˆƒKMBÝǸV]î¼ÄrK¾Ýë”"X¼ÍTd!Wˆˆˆˆˆþ»Ç$—Þ興!tKï·T3"mÈß²;Q>ØŸä:³3x«Î„GR$˜ÝÝΚDw˜í˜ˆ‚H"ÎiÝC‚ˆˆÎ¾ÃC„]íÝ„UH™Ò#RKǼÌ9YËÚä;•+¼½èu¸dK¨zblÔyCX1x‰½ƒÌsÌÌÿE4[¼ÿcS#®íèˆR!8Ìݼ¨CFSØUÝ[„4ˆ:ìŒãÄ^þ˘…A7u§%Ç&ÞÖX©TD¼¦†lîK똈ˆˆˆcFA7SXˆˆˆŒ·¼»\ÌËÜ„ÍRlxyy¨‹r6£*•\”Z„ÎÚ¼Å9³<ÜX§ZͼÈC2fîëÈ!%hÏûÚA#T¾ÝݸzDj–ˬº…$17ºÞÙ{2#W­Û¼BdH¬Lî·ÝÅÛ•Uz5¾¹ˆˆTB#„5µkÇkí˜í4ˆ3:ܼÉGt6Ìk¹†™ˆ¼¸D„6º©¤SYFÞÞÛ§D¦6ÝDÚB|ǍÚ3TAI5ˆˆˆˆÞ‡Ý˜ÌÈx˜#ÝSδk„]ÈD‰¤725Hˆˆ‹…ˆˆ‹ìÍé4œfÍÉË“L·»ˆ‡c"yX›B5xˆÍ½Èu{ÉÎ鈂t;îÜÈTˆbJ3HDˆˆˆÛwÈfÍÎí¸ˆˆˆh¨ˆE”3‹DLCEUÉ«yœ—™ÛÄLÍjeFt6VÌ‹ÝȸkÚVƒ#b9¥¸­—ªCHWͬ݋ÊYºÊˆˆ„7#¾s«3U$‰hˆˆŠÍ¸½BÚ令d¬ˆˆˆˆ‚4hTˆˆˆœÍÊWY˨»Ì˜ºhÇXˆgˆe‚4“LÜ|¦D§¼íŒtDdCkº¬Í•xÇkvk…E¦]ÕKB&thˆ‰·Ì½î»Ùd«™ˆˆˆCb(ÚŒÅT$XV¬cHˆˆˆˆŽ×®Úݹˆˆˆ†¨"e$ˆZÊD–mì‹„43›ÞíÌT5ˆëˆˆC"¥#•XˆˆŒŒèMÖ\ԬȇX«HÈYØ]¸x2#C¼«ÌGÈDÛ4–5ºÌÃVDlÍÝÚËSvW«˜X¸5ŠT‹”
 ¾ë©DXy¼ÆRWˆˆì­c{ÛܨS33Uf½•j¦|˜ݥuC7X­ìÍ„G¨¬¨Cd!4ˆˆ§y˜ª¼Ýµ‹Uh„™T½žü¨‡"$LïÌ¥2#KœìD§CˆClÉÞÝÛd5TLí»“78ßéÉSC5H»¶‡sEhˆ›ïìÛ•ˆ¸…gB#CZÝ»¥SGËÍ܈SFºÎåZ¨EDx…hËyS3%ˆ‰Ù›ÌÇ­Ų̈ˆ†237tlx¼”U˜‡ÌÍÜÅ4SHÜܺ”GdŒÝÆT"#HˆÞîÛƒDW­Ì¨„"Wˆ‰¬¦™†ÌÌÞ눈"#3k¼Ý×xÍܸˆˆB$hheCF‹ÝþË„$XÞÛuREˆ›¦WˆˆÝÞˆˆ…S3Ud[ÈeW†h«¼Í•d4·ìÍÉ„D3zÌet!hˆˆ¼ÝÍ݉ËTUTkÛˆÊB5TZ·eT5ˆˆ‹ÞÜ•‡h½»ÌȈˆˆˆ„3RE™ˆCEˆ‹ÜË‹uLÜÞʈˆ4V™ªeU"6GˆˆˆˆŒÝȝ¹­Û¸ˆˆˆˆˆ3C#xTÜ3ixŠÌ΢š´W¸{§YÈUËIìCX":„Ïص3UKÞ„WBŒ1%xˆËüW̦X„ZD¹eeuX̩ܽ–“DCEVi•‹Õ;̾þ¨ˆˆˆtD…#D&ˆîÖUR5X¾í‹Ù2e8ÎËÞˆˆˆB3#«U\„kÝÆ]ÅL¶œÜθˆˆuS3EDX¼–…Tl¼ÌÉDC[º­Ì¹šˆ‰–˜‡z»[ØEs"UDÎʬ¸»´8tk–¼·hˆºØ›eC&¸mìuƒ"Œ›ÝÊ…E{ݺT34›ÞËËdy¹‰d„%Û„™5½ÍܹRET½ÍÌT‹‡ºd˜h¸½·›bWCK‡hV™XË[ÈŒÝ͸D24WÞ»Ç$ƒ7ÌËÈ5uYÇλ܉´"S)ÝœÜH¤GeÌBvCl»¼º˜­×Ã44{{݇d$¼œéYS9”¬´y¦{…Z˜†œË̃ZDŒØ¦CCX»ÎÕETmÛÌ”D2Ü¼¥DX…«”EWŒÜ̦C5«œÈT2E›ÞˆxCG¼ÞÌ˘h„jƒ8…k¦¥2L·Ï×iB%ˆ½ÝØ«Ûx†EuݹˆƒCˆîÙ{!HŒþìÈ"iJþ¸„!37̝Ûz͆»ƒ$T8È4–ˆîïÙˆC#ZË̳3„IÙDhU›Þë¼UY›™†c#DJ»º¼Ì»ÚSw4¨Hºh„Z¶H„Jˬܺ¹–Š¦UCLÊÏȈˆ…#6EU3ˆˆˆ»•xº¾ýÌ’%TÛŠ•X»Í¸…C"HxÝRg4hˆˆÌÝÞëY¤DGºWÅ3ÌyÞ•D"D‹ÆWdH½Þ܇uH¬Ê«28t¾íˈT7šˆ
 ´22Fˆ­•8ˆˆŒËÜcÜ­ÜˆD˜ŒÊˆˆˆ2"3XˆˆˆˆÞüÝ”wD™ftE¦4ºŒí‹ÙEDfe‡S3xˆœíËÜ‹ËȈˆ#USgw„KÜδ½ÔYTE24H‰‹Ì™–ÍÊ͵HR8¨©z¼œÜ˨ˆ36Cl”Œtˆh•E˜lÜȈ«…œR:î…JÃßé"ÎQ=þ’èÏúâ,ÿ°ÿ²=í0Nâ8ÿÐÿÃ.Þ_å#ßòîCÞý 
ýFÌÊÿ`?ÿ°ß9îsßò$ßÒ#»+ïç /øtº•,úý0ÜlöQþ±=ÞrI´,þÑßÔ¨¹C>ä#ÏÛ ¼¸¾ä@.îR¬|3Ú‚Oé‘&Þ˜Ûd%ÍÂ6Þ³4µMÞÓ¿±;øÌ;ç"èAMÚ(ýA=ì²MÙ!¾R>îÒïC̓3ö$ÿ¥2f¸Oö!MœcÏçéŠ{„‘.õýÍ1<ÓŸà‹ÿ1?ãJ£JÞû0îêTLVø üÂníþ!üå îËÔNïä¿ÞÒ2KLÒßþ@$ŸÎâ_ÝQL߆Ïþ0뜅7Üÿ žüs!ƒ}þ!¼û34ô«ØoÿB™íƒKÕrïëÈšÝèYÏìyG&_þ°í2œ3.ü0?ÿ Å9ÿàÿQÿƒ31zïàÿ¾EÙÄ=@Žþ}ëkÝStî .ÿ2L´Tÿ€õ@HÿSÿAÿ¹X2»Ë:Îñïþ£D-þ¾ì0?ÿ†0¾ÿàÿS9Ì„Y Xïäõoç,Ö ý3$¾Þé å!\ÿåC oÿÁÝBˆSïëÂ
+ÿØ!ÈÌã*þÖ]ÿø ÿë ÿÁCÏú"Wÿó"÷#cOû 'Ïþ"ÿ¶#ÞÒ Xßü%ßüƒÏñ:ÞíR"ÿù8äJÕ#ÿòßû“ ßô!nþ!ÅMÿP_ÿ@2NþRÉß´ 7ÿ ›ïÛB¯òÿÒ6ßÿ"«í wïãþ€$ï£>ý0^ÿa#$ÿ2BoÿÝÝÉ ŒÿA\ìÓDgÏë .ÿåˆ?ÿ ½Ï ßô‹ÿÂ&ÿíÿ"Þÿ²îú4ÞþÿüËÿT	îû -üýÏû=ïõ$<ÏÀ!Nßõ Nÿànïâ.ÿà½ÿä0<ÿ ïí3a+ÿàîÿ Ûü=Ýÿ1D½ý{;ÿV¿ñkýìďó _þÖ ~nù ^¿þV?òw¿ý)ïù!8TßèÞ ,ÿùrýáþþB}Ð,¼%XÿÐoýˆ» ,ÿR,ÿÀóÿÛ %ÿD¬ôÿÀÿø OäÞÅ ÿÀÝü"S<ÿ3ï–"NÿD#:ïû€ÿå <×¾Äïþÿ­7»0òÿø ä,ý‘þƒ¿ã>î0¼îcSªßêƒ/þ"+½ó"mþEÞîJ"mŸåZßë îä*}œü@ÿõ ¯äï4Pÿ ÿÂÒ*Ýí1OòîD÷,þ¸¸ÿEcÞ0O¢]Ñ8ÙìÁ6$ÿ쥲 ÿ ÏüÔHÿï”18ý[û!ܱÏçÊí3[Ñ›ÝÔoÔ$ÍÇßÆÄC-È^¸6|Ì!L¶ˆŽ½þ¤%è[Uæ$ŽQmîó6DÛÎ#3Ïã"¿‚8¯ÿ±íR\¬ßÈQ»ôHˆïî²|Æ%ÿë˜42ßA]ÿÓM;"{<,ÿë’AhŽþãÙ+Ë3ÿÊ{êˆ %ˆˆßü“K!Fÿü3ݘCCx¯ôNü„clÿ³Ëù+ùÇNÔ ô ]þ4ÿ¨‡10WŒý”´vï¢#Ì)ÿÔ#ÌC¿ý€E WïØ™9‚_ý32D„7ÿ7ç4¾é!2UGßýr]ƒïþ£#c"Îâ:Þýÿ%J±Gÿë{t!$ÿ{½¹29MÛs<Ó¿ê2BˆŒþ¿Ç@>þ́äJÒ"³ïá?ý—!R3ïâ;í™LüžÂJIþ¡"ýFïÒ½1HΫî’=‹ËäZSD7â+)è(ÿìRCCõ)ÞËÁÿú7ÿ÷Îßb$ï¹"X÷­^ø‹ÍŠ‚ßó'4ï¼ëA&ÞP¿þ¸ClïØ#UËoýËÜRê@luí
 íû0,ãNý¸ ÿÃÿàÿÂ-þP_øeþ£Ý‚{ïÓ Mÿã[Ë<ÖïòˆŸü5„îØB0ÿ’ _ÿ6ßùÈ=|þ0ÿâÿù4Ã!$ÿh%Ëí1^î!5Þ#ÝíBþRŸüˆë ¬ÿ‚ßýÇcæcˆÿýÿýþ^ÿã _ÿØPˆÿ±%ÝÿÂ<í¼2{ÿâ½ë¸Ü°ÿámïTë6´¿Ò nïá
ÿîÉ0
+þR¶‚Dßü xÿý X¿á)roÿÓ Oÿ±_Ýý¢",îoÿÙ@2&ŠþÜ#È>ýµ (í}3ïû” 6ÿý`ÌîaÞþ Lÿè„1ž¤ÞÞ >í2ÿÃ<#¼Îé NÿåýÃ(0hÿÐ.ü¨ÒßÃÿ&½Í¯ëp<.ÐïcïÙA¾à)^½ëGë®úm"ìLMÛëm´ßé&â<Þø ÎT#ÎÿÑ#Ù¾4ÏÀ:9ºBïðËþô$ÍÅÿü ­ÿ ,ü¹^ÓÏü‘ÿAìÔÍ4Žïû3ÈÌEíMÞ؃ Íÿp
„Iÿ‘û_ÿÙ„ 6ý¿ÿBÿÐ-‹"ÌÿÑ™CŒÿõ¬[ ‹ßø!ßÛˆ@-Âhÿ=íe_øg«’ÏÊXÿâ<íÚR ˆ‹ÿÂ8ÿ¸ º÷Ìb#Õü2'éîµ'íÛ4#!ˆˆÿõdk4jû'­bŒÿû@ÞÞÔ'¾x@%Ïÿ1%ÎnÒLÜ4 GÿÏ‘2ž¸2¯è%!çÏ€ä>2ÎþÈ MQŒ9ÏÙ½AÏ‚Ž¿³íþ12'üÙ+û–@ßÒDMÿã"þÕA$¿ÿÂÔå¯þ˜pmýS-ü(Çîȃ ÔMä?úÏÿYq'M¬UÜ\4ÿüi ŽSWÿã)‹þ˜2ÿÒxÿó'êÏêþ¸ÈÍõ-þþº2´þ![þ0*ßø"aMSIÅßô?þ>°?0+ôßÐçŸÃ/ÿ°ÿØ ,+ÿ XïäÊÿò»2$$onþtŒ[{ÿü +î÷ <ßý2ýb_ý3EÃ-äNÃ=YîPíþ°ïþ0ÿëXÿâ¬ÿóÎê#=Hÿ4¶ÈTïÎê -ìЏþä OÿÊ€ïø>ÿp at iÿüP#o#»ø.Ñ#ìÿÀÿ¸ %ÿû%ÿý˜ Oþ 6ïþ!!‹ù^Ülë73+’$ßýÓ ßþ`oëÒ#Ïþ” ?ÿÊ /ý2#ÛoõBÿöíÝ;ý;1þNÂ$åÛ8ÿý€ÿ#¿õ^Ò!TþA:ÿ÷ÿÈÿÐn»Ü¥Ä ÿÐÿú"ßÃÜŸÿÉ oø‘ïÄD^Ú4ë3#EØ.ÿÙ.öRŒïÛ$¸e5EpˆÿÍ”®² hÏó8ݦx2¶Îõ"ÿýÿ2ªNþɈ -ýqŽôÜDþc©c¿ÿ$‡¦E>Ó½Ïâ½Û1&ØïÞÈ…$|HÏûT½ÃOãEOñíåWþ7ÿýWe Žÿ ,îû!/ûŒ!#FÏÿ2ÿB$[í×® Å´IÝíÍé3§!ˆÿ
 ÛÔ;ä ÿ°voôêCE<âÿüˆÒmÎ1~ÿ3,ÞÓ~@Ïÿ¹	V˜1>¤¿ýBÿ²%#ì_幁$h½ïžÙ¼ûSœ¬Ös4!xÍSnÿëˆ!BèH{ÜÕï¢;ÞAÏüsS;ÈžÒ-îÃ1+íd"­mnþˆD™ ‰Žåîè ÿ´½Q^ý· .çšÿü¨A6ß1›ûþ0ÌSîxcQ¿ÚÔ%Ô	¾äÙÿ!r,ïAŒ8ìßÊ4l´9è=ÿÛ8þG·*ýí3XäIÍÿÛ‚0-îLAÏü(a.3ŸB…ê/ô
+´kšlõø$œ:Úë
+^þÉU:Cp?3ݍÓ'ÌaßÛb{Þ´GpOB3Þïéˆ0mݶ#ÿåwÌÇÍ /ÿ£]¡<잍é€\ïp¾g,Îì¥Í13ŠËI¾BíÿÅÌC½!ß ã”^#hÏÿ³¶@>W¾$ÿ13æÝ"Þ"U?þ‚<	õÿ:ø…@¾NóßÛøþ©‚ _üé h¾E9ÿü…5ßÒ#›^.üíX¿ð_òÏ@ÿî¡"ÓÏÒýIW’Þþ§„1W'ÂÎþÂyý<øÃÒþŠý MÌþîù… ;ÈþA$¾î#fïë4îûÌ øEBßü4 /ҏÑþªq/þV&þœ‚.Ìœ3Nþ¨‚Ì´ŒÊÌs¾-ÿB¿ìŽŠx#ÎÒŽBËh£þ2îý"TÎÕ$LÿDßþ³NþS ŸüR|þxßþÃü(Ïÿ¹@þÅOþ"ANëÄ#þë ~ÄS$îÀ¯ó¾Q•3Þ±C„þ4šdï²5AÿÕ";ì‚2~þÝ¢-ëƒ3×+g]þJH¥ä,<ïÊ8@þÝ"¿ö#Ƥ~½´ßUìßЮÌÔ Oîûˆ¬¼±BïÐ&ŽþãÄúDÆI¿@?ÿ2}ã4çNÖA+êß1µïäAÍßÇ!ßÆ“øê%!nWrO³H(oÿ¼`ÒKDOÿ¡!.þúƒÿ³oûD1XÈÿû2!ސ?þC„®?ó¯0	äoôK Ïñìÿԁï&hà>îü@þ—³î_ôŒ"?^üLÜê€ýÒm¬îÕMºCŽÿ‚ÏA2-ÏÅS&ß$äËݐ&ÿøƒHÓBXyÞóUNþ]ì­ý’c2:~÷UØ­Õ ¯t2HÏïÚp-#dGŸÿÅ_í1J(}옵 HŒÿ°/ÿK.Ú-âÿý‘þ“!'ïTK¢<ö17ü'ïÃà ßSÅ-ÿ¥Û€,²#Xÿ±!ïÐî;îÒßü0ÿÕ¹ˆS0‹ïñ¾ï@.ÿ 4ÎÿÉ2RU|´\ÿ˜ Oþƒ]D¾^ýUÝ¿÷ÿñ¦CÿX,Íê» ÎBˆïüR-û$%ïê´#ìî€þCµå­ 	Ô8ÿWÎã OÿDCD›ØCÿʇÿ"Û3MCeïÚ 'Üïù!";Èÿ예Œ4œîbŒMÿƒÜϗ݉Ú0hÿî²½‰Ìî·!ÿä-ƒÂ,3®ÿÓ‹ò»ýÛ€\þè(ûÁ8Ïÿ¹ %ÿùcèÒ<<ÿ*Ûü¼K"hßù£S,Û#Žßä #Ïÿ²^gtS¿üFMÝÃZÙÄ!Íþ"ÄLüBVÍü”*ÿâ«ÿR
 C*ïý ÿûRI\ļÜγ$Ez‹ÎñcmýAJ¬³DXÜÿQ3ŽîÄ"«é#˜d<ÚjW§^ÀãÏ	Õ»)ä‹W|K…}F{ŒØ0/þÈ ìèÙ"ûµe\ÙW„JdÕ„¶|LKš^,9˪8¨^G…-Ü3LÓ”å´FÛl-+Â^cN¸6L¯E&­ÜÃK/„µ´Æ¨tiƈÁìÅÁŽ®ªMGƒÙÈáä/áoÀÿ‘â'ùÓß\ýPïÂÊ#Î=+¦Ø.ūͲ΂L³ÕE"tKÃg∈¾RÍnšˆÎ¨ˆˆˆˆˆˆˆˆˆ‚2lƒ"hˆˆˆˆˆˆˆˆˆ‰yxµŒçÃÍÍGíÚˆ†L¨ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆCJ‹I33ŒBwˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆŒÔ«µÚų½æÈ]ÈÊ,u̘ˆˆˆˆˆˆˆˆˆˆ„Ȉˆˆ…¶¨…·,“¼¶²¹TÓ’ÚU²ÊC´>²ÒË”Õ'ÓʃX§ä³UˆˆÄˆˆˆŒHˆˆˆˆˆµ™ÛÛ•ÓCËÞ\•¼-b¸™åM$…̃›;V»ÉË££Õ¬âí.²§¸Øˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ„ȈˆY:Lƒ¢Í\4I‡t[H3ê=CÅŽ•»3ThÍLKcÊ9xˆµˆˆˆˆŠhˆˆˆˆˆˆˆˆˆEÉãT‹Î2Ö}‹È9âÝÕ^ŵ:“ÌÈãNƒã·xÉŠÃÉ»˜„Ã؈jˆˆˆˆˆˆˆ†¨ˆˆˆˆˆˆˆˆˆˆˆˆˆ‡˜bŸISLg–ƒ)xˆˆ‹^9HˆŽW<HˆˆˆˆˆˆˆˆˆŽ5µxˆŠhˆ‡Ê<FŽ*GŠ´ê/SÈFâgX¸÷ÖÚâÞ„ž5æ…>-ØI¸˜ˆˆ„È…µ¸Lˆˆˆ‡˜Z˜ˆˆyY;ÅŒ$ºSÔ2æ´uSœ¬ÁÂòÒØ·¹Ø[Ækâ^&k‡cKHé6Õ{<«Å)¼/uÌÆêr„µÏyˆ;£8DçädCL²Í8(5¥—‹XˆˆˆˆŒ‰ÃXÄÍG[ãËXJŽÒÞ2Ü]UÙ,ÒÞDÇ6ãÛ.B^(ð½T•<Rí6Å?‡·Âå˝æ\‚é.y;ºˆˆˆˆEÒ8Ä‹DÜÌ&Ò?sØ.\KNBäuÈ>E»cRÄ:òL#ÅL„ÕM6‹º£¹M¬Ev®=:„¼Å”—Åͬ<b“IÝå½yW囼YGËLY¸¸ÃV=ÕsVM8suË{=’äXļE²½MäµÃ»Ud;Ô½/¥¸Me.µÑգ͍£«ÂǬ4Ý-2ô=+â=‚ö²â…ÔÎ]MIÈ‚[ã¾7Ù-âµ3²ÜEh?—ËFÔN<Ý5‚­,Ù;,¸YÂœ(Ò\Cä;6ÓhÄŒJzvÛ]ÈÃJdÔÜØÛ6¢
 Í•\-Âò6´žDüƒÕy£ÔÖ×Ü[ˆ‡”³N¸bÇF½=3frfw¶Ìk#8cÈ]ÄÔ-¼Hµ³×‡½MӍSÜ>—ÖKÑÝ,Ò扷Z.9Ó8ÂÃ=3Û[Âj9ÔÖW¥|ٍ;ã˜Ë³]…õÅd;“Õl'„]±÷MÅMÇÆ]d“ÓªœI„¨•N,s±®[hVEhˆˆÙ|Kƒ¼[Ս8äœÃÊ+¢è-Ü=‘՝HEå®D^…ÅŒ¬L‰„Ɉˆˆ„ÇKYIÓt;,)jw«FSµÇY8[]K׌KG{¥ÕËfÒâ¼UãÌÈN9Uå=T<ÊÝ<H8š”lT‡ˆe»KuÍ(–´Ãçµ{<\Ì;‡Ì-ÃÛztT{´ÒœY”ÄkäÔ¦h­{Ƶ>#Õ\œYM#S}SÔ…D¤F——ˆˆˆˆÅk†ÄÈMËŒË=K‹—ÊÄŠ(”|[œ5¸Ö‰»‹L•>/=œ‹‹zL<\•¸[ˆiX…k+UYš[6ƒTÓI„«†˜Dh‹¹Ô‰JźtÒžhÙÖ׌J„º”ÌM^*ÒÌX’|“Ä]'´‰ƒÎE”’ÔË]:­U¸=kÈH|=lÅ™[{9”Ë›ƒU[Õ^Œ]ˆ³LNTw5=¤ÔDH9MƒØ.QȃÖhHĵ‹^:Å›^Iºlwlm,µËd‡¤UÄ\¨­5Ü6ÙMZÙ«EâΧ†µ¸´ÉU[kÈ8(³«{FuE;‹<Z”LF¼8³ØGÜ^Z¸H<ˆ}ÃÚl—N;Ç•ˆ•â¸<GÚUãŽ6¤D¥©I‚ÚkgX«—“º×u´8¼„Žx|‚;k©[Cæ.‹†«TżÈÌ»D¸[µª[U£KG{E|J‰5³µH¤Å¤‡Æ|l=y<œNv¤kæ»V´ˆM£ÌEL†J<ÈÈŒ,Y]\¬k£Ô–ÈÊxY·|L§¤Ã“¶´«:TL;{hKBuˆŒf[|KIZÉŠ”Ü|ÒÊ<ÅÈüWtYÅåluÜG¢[HflY´”â´´»=„˜=²æ{†ÃÅL³ëNc»<ÄžWä:Sªk´ì=Š<’Ùyy{HèM'„=eÈi;¨HU.C½8ňK³ÜH~,£Í/=>:Ä>X׍“·+‚ëhlLi¸Œ<Å=;º¾-µn5>[ÈĔջ—˜Lcƒ<u%Ò>4´>Y[¤ÕH•ˆ‹æ½K‹‰|uÉmÄÇ\½4Ä]N<L¤œFÅ=’Ú,”ºIÕl„ÄTä¸L4³¸ÆL“Õ=²ÞSä¼L³µƒæÔÍsÈ-FÖiˆl\¤Z”–U[ÉÔ…HVÕ›b­6ÒÞ%ѬGÕ\ÃôkX‹;âÝ\çKµÌ"LlXBî„â¤ãMé£ÇHñNDÙ§,ÕNÈœˆ„5ÌÃ)	ÒçTÈZ7’Xˆ
 ‹X§}\ۍ‰œ¼~NDÔKÚˆ9}ˆG"9Ç:2†¶©tˆŒM:­(Ï+»ã;ní,â‹NJÂí$ø€?êé žôN¸bꈈ#Þ8Áã.DÁlÂÅYÒŽÄGˆˆˆˆ‹Xˆ™ž%ŠhÞÄLÄ쓍·¹…K»AæµÂäšÚn;DTŽÌ;Á„̆\µ³ŒTÛu’»Â×·ÆÌ;]¼¸y‡T“ªãŒC,Ó»dƒT3ÄÊc˜VµŒmt‡ÄÄÄê˃´ŒÇã<„ÄÍZB¶×Ø’Ò¾‰”:-½ÔDMŒå¨C£¾XË-Âå²F[ÊÈžÄȈˆˆˆˆˆˆˆˆˆ-DscźÄE8cXiFŠÉ[…ÓjHˆŠÔŽ<h;UyKÌ+²fWˆŠœË¤Ê¥š×l»Ý+|,¥“µ®g”u4µKŠ(tÊ»ÓÕµâÍÔêkƒ¸=¶¹ˆ„„׸jsTWÌx“ZÉÓµ=̹ƒ,Ø}jSV»l…¢8c×,Rə¸u‰WFˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆËÛå¸Ä¾[ä‹ÃÔes\DÃ_:ÊTR³HX½©êHKi”™¥íͨw(w¾L˜ˆˆˆˆ„>(Ö»˜ˆy„ª[˜ˆˆˆˆˆˆˆwf[CˆK7%LTÈ<5xˆˆ‰x¦ˆŒÛ9s–…W‰‰DˆˆË:hˆˆˆˆˆˆˆ—›»´Úu؍֍(¼}³wW‹Hu•Ìäµ4Ò»Õ–w††w|l£xšË¾Iˆ=9yȼŸˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆJ+$$UÌ»hVLTUGÄÍÌ‹Kƒ„;wŽ¼Ü<CIH…\HºjDµ«º·½†­x²¨ièˆ$V]¤¶3šleTyÓ¨XˆŒÊÉÕÄÖ¹ÚX£«Xw¸ÙjdMc³3´„ê;ÄæSãÜ›{5ÈÍ•Èyu\'ÃÕ³ˆ9w×ăth{§¶Hƒ§f¬»Å=%Ý}Cy<Ûìµ´7ÕÜ=ÔÚˆˆˆ‡;LK:ÅÔE2GG„{–œˆ³5¦ŒY×̓Ö>6‹ˆÈÍe,´$º]ĵ…ÎvÔ]ÓÌŠ¼MeÄ«ˆ]5W<²œ*³yC¸=c½CãM”í=ÃÛLèMD§X´MMÍ=eK(…ƒ³§´šZ¸ØxÒ}Xê=Ø>›ÌUu?RÃt´Ì<4H¸ætR¹›Å²”K|¸ˆºXJ;uäÍL¨LËņ´Ý¹ˆƒØj„È[ˆˆIY(s‡+ˆKe¸Fs»Œ¤„œºÕY:Ø\\¹XÓ‡ŒÇN6µ.’Ê,³¼VÔ½t¹}\ºLŶ¤[•4fT¥³†‚»DÄj´ÈHX‹lé‹Åé;„[VÖ×ĶŒª…ƒs„Ú‡S‡mÉV„ÛÌÄk-ÕËw|·Ùy…´…²äSÓ]7´K‡ÓH(l{X˜KX
 ¹K<ƒŒ´Ù«¶KLµ®§è»¥Œ<ƺVÆ\ˆˆK7›5¤[+CYwĘ„•^D¦xǹ[ˆËy§}:³¼‹¶‹h´‡W|H™†V‰Ø¤™\ØÉj¨Ôh´Ç|gÅC“ZXX8ˆ©„³HGÄŽUÌMÛ©D´½uÅuÙÛGG\vÆu\EÄ“¨=‹·¼hÅ›…¶ZÔ½Kǽ[”HtºTÓª„¤\XEEG\|Š¥yDƒ\lÙ‹Ej;µk™Í^¼\£N*쨈ˆ‡WªZ¨LbfE£¤“”‹XxˆUYX»µ´­«>,…ÍJZˆÇ×f•µK´©U×H¦:v»Ù‹h\Ö»T‹LËʃ‡IbÄh•Ü(U-e—5µžWÙzµË.GË…ÖŒ”˜YãJ—Wd“¨³›S̈ÙMg†–•Œ›™\ÇÌ<µ<‚ÌGÙœtTEC‹M¤©sÓ<HKFÇËÝF46ˆˆ›¾åËHĝÕÍȈ‡˜ˆˆu¹ˆˆˆ…uDdG}c[8uM6—…xšÊlX—¸•¶Ë¸ÈTÅ{¸˜U•ºˆ‡SU§¼K½‰©4ÔŽ†ºÅxĸ˜†;Uš—…tš&h;¬G§Œ‹\u\‰ÕÕ·›”ªWˇ—ZÔ˜”ZD·F»=\Mˆštµh˜ŒÌ‹Œ…“¶‡æÊKyÈFBZ;›·x“Ã)C¨NËÍH5DUµ{–Ý[ÃkŒ\ê¬Ö†˜K†ŒÇ‰ˆy„ÄS…YHHHˆ•vEHmzjF»liyºMzŒ¸ŒY¤Uؙֈ6tL‡Ãº[hÆ‹\[LH¼½–IeŒ†ÓÄk„‰8³[CÄz´{dš\[lzXØ[Ê{„œ‰‹X¸ºÄ¤¤˜vXSœ«ÕySÈlG·ŒÈØx•[HÕÆÙ·ÊyUS„ˆÕÌW³BCT·Ì¹k‰8cµEÇmvªDµÈ­jÎ]ØMX¨ÔÈ”ÌLˆˆˆvXJHIT¤f‡G‡WtÄ»X•UÄÉŽXËhÄk™[ˆi¨µXC¸\”É<UµvÇØL„ÈŒ´ÆlEÙ|ĸETµx‰‰ˆš¨Š©™…Ex—gw™ˆ†Yƒ#ÍÚ¸~•"\kÉˆ‚?B|åBÜuS(Nä1\ÜüxˆˆÓˆˆˆ‹ÿü$ÕbZÞ؈ˆ6'¹0(ˆˆ‹í罫#8îܸ˜„7I2ë8%ÚÆÍEU|“9L»Iì…C8‚Z|M<ç‚(ŽìÔŠG,Õ…KïEÅ“6®çC$ÞI¤r՝–\þŽÙqƒ¬S"Wˆ›‰×Ýd4^õXkWtš¼¼Í¶™ˆˆ†tVkÛ’278‹ÕDDÜ%ˆˆŒHºÙ×Î{cSŒ¥¤ÈÌE2IÜ­½B\ڍ‹Û˜eD¾å‹5Ké#"HˆˆˆˆïÛ&F=Ü„¤|ÎÅ$Û}êerkÎdW¶4»'ä›ÆH
 ¦†‰…9Q–Ü3tˆˆ¼Üd4×<Ü;¬åÌ8¬ôE3DÎû×Ëè'S{į́„TR'2‹zUÖ}ï‡B*Ã]UÔÜ:RÞÞ݈xCŒœs†=¸ÖF#T¤]Ør{ä^Cs¶¼CÆîø4&]ÄXRH{éDK]¤{lG¼ÓºmÈWC­]£#*׈hÔîôè=²¬rTŒÄT­eÛCtG%cìÓÚ#KZÊï$ÝäXš5UÿVD=ÕÅÍ‚EÌ-Ã<b·uüdí$Â9D‰é:jÓBˆßÌ©½5GêfbX«Ï–çƒ}ù~Ûˆ…*²NËÈXä½4x¿Å1•ÍÌ¡KÜT[e}ÉKÃÝ¹Ú G–˜¦~ì¸ü3ÂWF’?æVâ$Ë4IFŽíÏÂïÌ… É4¿Ê,ÜÇ=’߈ق$üB¸$èŽé+ÊÇ‹^ˆ‚î!Nî—BÛ^âîM…WEßÄÏÍs+Ô1O&ïÇQShµÿ°Íä@G‹½ÉþA|þ¨<"Jíïþ¸ÝŠˆˆì˜C…fCÐŒøø”†2ˆ‹íDÞÔTÜ@ûC#ïÕn˜ ýSïÙj…=ÙT=õ,ß¡xˆˆˆÙwïñÞÕt¾Ó2¾Á>þȈKa^é€-ý¨3L%.þ +ۍT»D-çˆÈßÈÒUŽòÿô£LáÿãC®H·MÂ+ü ÍM‰ˆˆþ$*®Ûoù /ÿŧqx?Ò_”5ü²ê_ä¯ðDþQEVRÍÿÕ4SÍï!<ÿS,"%ßÿpœì¥M‚;tįÇ2Ë‘Hˆˆˆßó"ŽÃ³ÞDÿÁµMóîb,ÿɈˆ߸ˆ#ÒXÞÇXüÓݸ "¬Ý3â6ïðˆ‰¼ß³Bÿê Ξçi=<èÉP<þJ¼"4â6ŠÿüA:0ˆˆˆˆÍø'ŒÝ±GÿÙˆ‚4¿±ßþÄA™_ÍUü¨‚ XîõÏþ˜Pˆˆýÿ× 'ˆÏþ6OÉf ÿý‡b<ä%Xßäí2"XØõ"$ÿŽÐˆÿý!;þ2–!ìÿ¹#ÏþKèˆ( %ïþ¸=ˆXˆ¾ÿAwÿ˜1~^ÿ8¼¥#"DÍÏ÷8XŠäܝü!<\ø.B$΋íÇb£mïü¡Þþ¹ˆ+ŠÈ™©Õœ8è%ïOµC!mïô-,³Þ؈‚,QµŽüDj ì/ôË#ÌÜ» HïÒ∎û´+ïÔ1+ï²AÿÙ@:‚Ï Xÿý˜ˆŽ%ˆ¯ÿÂtÓFˆˆÿÙ‚èîèÈŒ0-SGíNûʈ<¾Ìø¨!#lÇØ]ýì-’Wˆÿù2'ˆˆÏÞúˆˆ*ËsËò
 Ý빩)í„;È\ݵ‹1WˆˆÜßöØ‚4Žÿé5m”"{;xï³ÿ¨‚ %ŒÞý4›Žõï°ŽaÎqÏÐ:íÓmïÞÈ3ÿÇÄNûÜBÞÅ ÝþÛÿÒK&å16ˆˆ¿ÝÍéˆ ϼk®ìˆˆ"OXô¼Û† ãMä,E¾Ä"\þÔ#&Eßý HˆˆŽÿë2³"«Þü*ØÑ"%HÍÞݽ¸… ,ÿ¢þ¨ˆPˆˆïþt¼ 4|Ûá9ÿü˜ˆ@hŒÿû˜‚ ]8ˆÿù„ 5Ëî멨ƒ!¯ÀGÏÞúÒX¾ë¬ÕCFK%¹=ÿʸ`Äÿý:#Ýfÿ¨ÜR½.ҏýùˆ‚(NÜüµÜ1"ÓxÿŠî0{ÿö ï”)ü˜ˆ iSìÌ…[ÞR6ïÒø´ß¼1hˆˆßçìÏ(ÿê zí3›îâë„@
+ßã<ù	þ逴ïþ¨ˆ€­Ãßó_ÀˆŒVˆþü¤'ŒÂ"*ìÿóÓ.Roÿн†ë˜ƒ,W~â'ˆÿò#î3\Œ%ŸÞÿå#WˆïþŠ’ß7¾Úˆ1ýˆ!#«EïüUNB4WŽÿÜ#CkšLÿû„±!XîßTI²/°DÝß숈шˆˆÿý˜ %ˆï£Žùˆ!ý3„ØNþ1õÿÜ興+ÛR½þ¹ˆxþÌÒ4ÿ¹€XŠ~ÿê„%xÿ%›,ÿÔWïö¶ž¸AWŒóßû‘,Ü’[«íÙ>–MÖïŒé]Q•hÏÿ#Ž±#îÓT/ùŒ‘(’*ÿQ3¤ßùÝ-ý -7ÿNþ¨ˆŒÕË\ïé1b.éˆÏÿ²~ÿ 5ÿÐ
ä¿ÑIÿýƒîúˆßä.þ ßðÖ? /þCÝ ˆïþ¸ ÿ %¾öì±!]ÿöNÿbä Ký(R\ÿû˜ %­Þè¿4¢ ŸýS
÷,•Þ^íË£Ìج@ýSƒ${ÿü@ÿü¡½ýá0(ÿ:Ïÿ¸‚ ÏùB^ÿ#6¯þ=B̾¢RȺTÎýƒ'Þ§¨ííˆd ÿƒ4^ãGû0?ñÈïü˜ˆ]0'ˆŽ¿þ@ÿ±=ÿÛ$1ÿ FÿÙ„´»Xÿý’ÐÅ$ÿÐt#ÜÉB*î?üTӍBhçÞí’¬
+þ!9ïåB'ŽþB"Ïÿ¸ˆˆˆ„ 6ˆïþ±_þ ¼ÿùˆ5 8Tˆÿ˘ˆ… ˆïþ,µM¶ˆÿý+‘ˆïõSNÖë0!ŸÞÓ,ÙBÉ1WïþQŽåBxˆÿýD¿{\g|ûˆ ˆŽÅNü¨€‚_÷}ÿäÅ1ïü³ Nwƒ_•þÂïü0GG/ÿ (žÿ@ÿϹ )ÿø–ï"GŽÿâÚÈ0%ˆßÿ˜SÛâíÞûÜùyÿüCs{œÆŽþíƒH­´=øsÂJÀFˆÿý•3µÕ 'ˆÿêÈ$ê`xˆþîÙ,"4¾þcÞÀ!8ïë"_e行WÌ?Ù$²xžÎë<û3–!%ÿä"³´OÃNíÜT -ÿèˆ.!F‹þSoÈo¹R!íÞȈBWˆˆÿý’¡!™tÏþ^ˆ èÃQmþÏ£é"aGÿý˜Ë$xÿÙ#ßÏÌÿ«ÄUÝÊ‚\ÞLëqÁ!xˆÿÄ"~Ÿ³ZSÖÔ^5%íîPß}ã¯Òö!­ïè€Îb’GÿØ"LíA+øÓlaÿü )ëÿ؈ Eþ]„žŽ˜‚ ªþܽ˜2xþåØÊ„@{û¼3Íû¤HŸÿÓ#ýólÿû”5]‚08ŽþÞ!ÎHŸýNÛƒ@ˆˆÌÿÙˆ‚,€#Œ¿ÿ˜ˆ@|¡#ÍïøˆÃHXŽßüCC“4hÇïD}^}‚_ïëA5÷- Gþå\²€Ý3‡…{üNяþK2þï0ÅmüÏý˜ˆ”#éïëTOÿ´ßÿEÓ0©"h‹¯ÿ¹€’‚89ïî1-xÊÇ-ÈÓ(2Žß¦³#ÎëNʃíú y®áQ7ÿý‘lýªø—F‹ÿü˜ˆˆ %Þµ½Þ¹„"Wß^üȈPWˆïëˆc HˆŽý¾ÚA2œÌϳt)ßR]8ÎÿÚƒ ÷/ü¸ÊC at X‹ÿû3Î 2HÍ4ïþ¸‚dßü ÿò ì[þ®ˆ5B$ÍÿêKc Xû2ÎÿZ<ÒÍäºcíC8îB$NÞ’<Å<þÙƒj2Gþžùˆ r¯ä*ÿÓ!üÑ$žÅÿÛ„3-Ó“$ßÒ½©"Žÿ³(ïLp7ÿÄ-þ"!ŒLûÞæxCB"»ïäÙ¸… $ü2Ïþ ο Xÿî¶b#‹“XŒÿûB³WŒý<þÈ…1†îè£íBÃ1½RhûÿÉR†– LÿDî·DÆ£Lÿû$¥OpxÿIÓ?ER5ÿÙˆLÞÑ%ﳎPDhÜW)ÿëˆ %þ¯ÿ˜F ‹üßÿ˜€
 g­ò%|ÿû˜€ÿòïþˆAWÿðîý×ÁHÓWŠÿü¨!zý$ßì˘@lÿ£ÿÛˆ€XØÏüÙLBWˆŽÿ눈1xŽØî쨈€XˆþÚí¸ˆXþëˆ1ÛGŒÿéˆ o€$hïü¢Äx¿ÿɈìË>ýü£/Û”KÕ½õØP ‹\æßÎȈ -·Ùß;ŒQíÖhˆŽÿ×N”3lÒVÎxíþË2]´Ãÿüyƒ#1—Ý„ŽÝ%XS?þ"8ˆ?ÿÃMìOܐ#$hüŸ£Ë 4TíÿƒB,í xüØþPÎ7ù 'íU;üþ˜€^½ßã8… h¿ò‰3æŸû5ƒÎFßÿ˜ >î÷ܯÐßÿˆ!²ÎÑÿì@xÿý“í¯Q	Œÿ ?ÿØ‹ÿüü0ˆÿق興Ïÿ¹ ®øHˆŸÿØ-¥!"Wˆÿý˜¦8ˆÿù 'ÿüþ¿èB#YÍÿøˆ .í¿B!ßý¨ %ˆŽéœþ¨„ ¸,Ç6Ÿÿ؁<"Ü'¯ïé0þÅ´oÿÙPˆÿ[ßþ˜#½ïå%Cê'2k”ßó߈ˆp7‰ÿÓIÝŽ’!ˆÿý”M¨0hÞÛM츬@!hˆÿšë¼#ÛV,ƒƒ•ßùˆÿý˜1óÖ!=üÍgOµÍQ)¿þ¸-BÔ4{üÿ˜#rÂGÿýsÍÓµ>ÿ’KÚ‚l$Ÿÿ,êJ„ FˆóÇ-ÿmÙ„ÁB#TŒþ*Õ´øP*ôßâÜ.ø‡!lçý¸Q½{ãˆÏû3R+ÿ2f$ÏÂ4R¯ÿÀžmÉ‚ Xÿ!Aÿ!~ÿè#^ÿƒ#ßõ$.ï“ F‹ÿòRï½Së&þ (ÿüQÂÿý CŸþ„Qxë5í_úHží¢%Ïÿ¹ŽÅÏýˆˆ „í³$<ÿû@Q5Íýßë@
¡iÛßû¹‡ ˆˆØßý¸„ ^ÿÕÈÎB*ˆˆÿÙˆ‚ XˆûˆÞc¾Ü¹HMýeÎR]Œ³‹Ïã#²<2nÞ_똀XÞ„nîêˆx¦ˆÿÙˆ#ñˆˆ¾ÿÔ"ÿ Kê邾;FbHˆÿý@ì,T"?TÍíÛ ïPLmžÄ׳ŽÃ2ƒ?ÿʁHWïHËïˆ!\ÂhÿÙˆ ;ƒhˆˆÿý˜ˆˆˆ‹íÿ¹F¤ WÈÿóÛ„l@þ¤åè½û Œßô³²HÛ¹nB²~ä"AXŸÿ _•iëV[Ø%ÿÒ5Ê$âýŠ¤1'ÿákÝûÔ¸3ý„æC#ˆïþ¸ 
ÞïR!*ïúùG3
 íۍì"W£7DØïÔì$ì1¨5cTÙ¾ó2!¾þDü¡CΆ<2{ÿüwBÛBˆÿ2ÏüUb"ïôÞ¼è€-BÌ‚OÿÊ3#Rø1¿è})C¨<íÐ-Û!HÞ6Ý=ü¨ˆ ˆüSÏÔ3·S¯ëÉû…R±ˆßø3ÝÜÉ0hùKîFHþ¿þÄ0XÿK̃¶H1#¿ÁOÿS#+¢;ÿ¸2CÜ¿$Xÿü¹ˆˆCnýØNÚ0>ç[ÿ=ÎÄ8û}õ>¿ÔBC"ˆþ‡lÞ܃û`H£V<è×½ÁÞë€ß1_ë3Ì¡(ÌÎÌKÔOôŒü®ì!‹Ì%ãú}D[Žú`~ÿëÏÓ"NÏô`8ÎÞÙ Ë&ÿR$^Ø^¯é4ƒ"&ÝãÿùR (ïÞ‘ßý]€>ïÀïå¼!B%‹ë®þ3'ã<Íë ,Í„˜7î½°Ÿÿ”°Œïû^ÚG!7Þïæ*A"\»5Ëß7ïÊ…%XˆÿZŒü†lÿÖ2¾¤S®ïâÜËÉ’xýn<³C"nï¸c-Ó3Õ(%ïþ1[ÝÄxŽÿ–»CHb)ÚŽýÄ2=ëqWÞûìzTH254ýt;íw)¾þÄQ"Oþ‚&LÿÃ5ƒ„=’4JþÝ£ÍÆIȼÖ)„S^‚Dîî3»¬ËC4xÏô5"ÎSLYÆ…ÕA;ØL»ûRL´ŠcyÝé5˜½í1&Ìí²©»Úr\¤½t«¶H´:Ú<v„\ÖM¥7ÞÄt4•I¼›œ“MÕXÈDw‚Më…X™ªv¼§µFDÆ{”8©wØœT»œÊVh½¼W˜©šuH͇82¾ÌéE3»„|…Ù|£µZ³TDlí¨Üe¹wCc$ÞÅj›†XC¤¼¹Ešdziy»»XmÖ4CD¾¼ÙR;Ȥ†{ÝÌ£"ZÛª!Ýî¥"M¦WS‹ÍÜTE¶3hÞÉ—C$›z¸gœ¼ÖF›ÈU3F¸ÍÛ¤5u›Ë…y‡Š˜U‰xwhŠ½ˆyÅT7‡hºÍ¤Dº»¤5‰ÝÜc$EkÛÆI»ÆˆZÆCG™»¬Èf˜SIy­Ü©4Ex†HŒy½Í«4U4›º…ZÛ»”4E»©»¹˜·UC'ÍÛ¼x¶Tx•vih¼Ë©t4G¬ÌyÌ»t$9EÍÊik̹CTD¬Ø»§wvˆeg«ˆË»¶DFS|ÌÈw«§TYˆºvG‹¼¹dEWÌÉFŠ¬wUEjš¹›{Ë„ET‹ª¦‡›¨–‡Eˆ›˜ª¼˜dEDz««ºË•UWˆ‡fk¹¼¦h…F¸ˆk‰¼…U…xx·ˆ¼É†UUas de 404

+; - chaque addresse est le deplacement dans le segment 600
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/SPRINT.PAS b/engines/mortevielle/original/0/SPRINT.PAS
new file mode 100644
index 0000000..1275ebc
--- /dev/null
+++ b/engines/mortevielle/original/0/SPRINT.PAS
@@ -0,0 +1,50 @@
+procedure fill_box(x,y,dx:integer);
+begin
+  box(15,Gd,pred(x) shl 3, pred(y) shl 3, pred(x+dx) shl 3, y shl 3, 255);
+end;
+
+procedure clear_box(x,y,dx:integer);
+begin
+  box(0,Gd,pred(x) shl 3, pred(y) shl 3, pred(x+dx) shl 3, y shl 3, 255);
+end;
+
+procedure writeg(l:str255;c:integer);
+
+ var i, x, xo, yo : integer;
+     cecr : integer;
+     t:boolean;
+begin
+(*  debug('writeg : '+l);*)
+
+  if l='' then exit;
+  hide_mouse;
+  xo:=xwhere;
+  yo:=ywhere;
+  if res=2 then i:=6
+           else i:=10;
+  x:=xo+i*length(l);
+  case c of
+          1,3  : begin
+                   cecr:=0;
+                   box(15,Gd,xo,yo,x,yo+7,255)
+                 end;
+             4 : begin
+                   cecr:=0;
+                 end;
+             5 : begin
+                   cecr:=15;
+                 end;
+           0,2 : begin
+                   cecr:=15;
+                   box(0,Gd,xo,yo,x,yo+7,255);
+                 end;
+  end;
+  xo:=xo+1;
+  yo:=yo+1;
+  for x:=1 to length(l) do
+     begin
+       affcar(Gd,xo,yo,cecr,ord(l[x]));
+       xo:=xo+i;
+     end;
+  show_mouse;
+end;
diff --git a/engines/mortevielle/original/0/TABLE.PAS b/engines/mortevielle/original/0/TABLE.PAS
new file mode 100644
index 0000000..8373fce
--- /dev/null
+++ b/engines/mortevielle/original/0/TABLE.PAS
@@ -0,0 +1,42 @@
+var
+    indis, valfix,evol : integer;
+    un_huit:real;
+
+overlay procedure ctable(indis,valfix:integer);
+
+  var x,y : real;
+      Tb:array[0..255] of real;
+      k:integer;
+
+begin
+{-----------------------------------------------------------------------------}
+{                           CALCUL DE LA TABLE                                }
+{-----------------------------------------------------------------------------}
+(*  coef:=un_huit;*)
+  x:= freq0/indis;
+  Tb[0]:= indis;
+
+  for k:= 1 to 255 do
+     begin
+(*       if valfix=0 then
+          begin
+            x:=x*coef;
+            coef:= coef * (1 + ln(evol));
+            if evol<>1 then
+               begin
+               end;
+          end
+         else*)
+       x:= x+ valfix;
+       Tb[k]:=freq0/x;
+       y:=freq0/x - trunc(freq0/x);
+       if (y>0.5) then Tb[k]:=Tb[k]+1;
+
+     end;
+
+  for k:=0 to 255 do
+     begin
+       Tbi[k]:=trunc(Tb[k]);
+     end;
+
+end;
diff --git a/engines/mortevielle/original/0/TAFFICH.PAS b/engines/mortevielle/original/0/TAFFICH.PAS
new file mode 100644
index 0000000..2bf6601
--- /dev/null
+++ b/engines/mortevielle/original/0/TAFFICH.PAS
@@ -0,0 +1,214 @@
+procedure chardes( nom : str11; passe : long_integer; long : integer);
+     var i, p, l : integer;
+         b : byte;
+         f : file;
+   begin
+     (* debug('chardes'); *)
+     assign(f,nom);
+     {$i-}
+     reset(f);
+     testfi;
+     p:= 0;
+     while passe>127 do
+       begin
+         p:=p+1;
+         passe:=passe-128;
+       end;
+     if p<>0 then seek(f,p);
+     p:= trunc(passe);
+     l:= long+p;
+     i:= 0;
+     while l>0 do
+       begin
+         blockread(f,mem[$6000:i],1);
+         testfi;
+         l:= l-128;
+         i:= i+128;
+       end;
+     close(f);
+     for i:=p to long+p do mem[$7000:i-p]:=mem[$6000:i];
+     {$i+}
+   end;
+
+procedure charani( nom : str11; passe : long_integer; long : integer);
+     var i, p, l : integer;
+         b : byte;
+         f : file;
+   begin
+     (* debug('charani'); *)
+     assign(f,nom);
+     {$i-}
+     reset(f);
+     testfi;
+     p:= 0;
+     while passe>127 do
+       begin
+         passe:=passe-128;
+         p:=p+1;
+       end;
+     if p<>0 then seek(f,p);
+     p:= trunc(passe);
+     l:=long+p;
+     i:= 0;
+     while l>0 do
+       begin
+         blockread(f,mem[$6000:i],1);
+         testfi;
+         l:=l-128;
+         i:=i+128;
+       end;
+     close(f);
+     for i:=p to long+p do mem[$7314:i-p]:=mem[$6000:i];
+     {$i+}
+   end;
+
+procedure taffich;
+   const tran1 : array[136..140] of byte
+               = ( 121, 121, 138, 139, 120 );
+         tran2 : array[153..161] of byte
+               = ( 150, 150, 152, 152, 100,
+                   110, 159, 100, 100 );
+   var
+      i, m, a, b, cx, handle,
+      npal : integer;
+      lgt, lhandle           : long_integer;
+      nom                    : str11;
+      PalH,k,j : integer;
+      Alllum : array[0..15] of integer;
+
+begin
+ a:= caff;
+ if a in [153..161] then a:= tran2[a]
+                    else if a in [136..140] then a:= tran1[a];
+ b:= a;
+ if maff= a then exit;
+ if a= 16 then
+ begin
+  s.pourc[9]:= '*';
+  s.teauto[42]:= '*';
+ end;
+ if a= 20 then
+ begin
+  s.teauto[39]:= '*';
+  if s.teauto[36]= '*' then
+  begin
+   s.pourc[3]:= '*';
+   s.teauto[38]:= '*';
+  end;
+ end;
+ if a= 24 then s.teauto[37]:= '*';
+ if a= 30 then s.teauto[9]:= '*';
+ if a= 31 then
+ begin
+  s.pourc[4]:= '*';
+  s.teauto[35]:= '*';
+ end;
+ if a= 118 then s.teauto[41]:= '*';
+ if a= 143 then s.pourc[1]:= '*';
+ if a= 150 then s.teauto[34]:= '*';
+ if a= 151 then s.pourc[2]:= '*';
+ okdes:= true;
+ hide_mouse;
+ lgt:= 0;
+ if ((a<>50) and (a<>51)) then
+   begin
+     m:= a+ 2000;
+     if (m> 2001) and (m< 2010) then m:= 2001;
+     if m= 2011 then m:= 2010;
+     if a= 32 then m:= 2034;
+     if (a= 17) and (maff= 14) then m:= 2018;
+     if a> 99 then
+       if (is= 1) or (is= 0) then m:= 2031 else m:= 2032;
+     if ((a> 69) and (a< 80)) or (a= 30) or (a= 31) or (a= 144)
+       or (a= 147) or (a= 149) then m:= 2030;
+     if ((a< 27) and (((maff> 69) and (not s.ipre)) or (maff> 99)))
+       or ((maff> 29) and (maff< 33)) then m:= 2033;
+     messint(m);
+     maff:= a;
+     if a= 159 then a:= 86 else
+      if a> 140 then a:= a- 67 else
+       if a> 137 then a:= a- 66 else
+        if a> 99 then a:= a- 64 else
+         if a> 69 then a:= a- 42 else
+          if a> 29 then a:= a- 5 else
+           if a= 26 then a:= 24 else
+            if a> 18 then a:= a- 1;
+     npal:= a;
+     for cx:= 0 to (a- 1) do lgt:= lgt+l[cx];
+     handle:=l[a];
+     nom:= 'DXX.mor';
+   end
+ else
+   begin
+     nom:= 'DZZ.mor';
+     handle:= l[87];
+     if a= 51 then
+        begin
+          lgt:= handle;
+          handle:= l[88];
+        end;
+     maff:= a;
+     npal:= a+37;
+   end;
+ chardes(nom,lgt,handle);
+ if Gd=Her then
+    begin
+      for i:=0 to 15 do
+         begin
+           PalH:=memw[$7000:succ(i) shl 1];
+           Alllum[i]:=PalH and 15 + PalH shr 12 and 15 + PalH shr 8 and 15;
+         end;
+      for i:=0 to 15 do
+         begin
+           k:=0;
+           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
+           mem[$7000:2+k shl 1]:= Rang[i];
+           Alllum[k]:=-1;
+         end;
+    end;
+ numpal:=npal;
+ writepal(npal);
+
+ if (b< 15) or (b= 16) or (b= 17) or (b= 24) or (b= 26) or (b= 50) then
+    begin
+      lgt:= 0;
+      if (b< 15) or (b= 16) or (b= 17) or (b= 24) or (b= 26) then
+         begin
+           if b= 26 then b:= 18 else
+              if b= 24 then b:= 17 else
+                 if b> 15 then b:= b- 1;
+           for cx:= 0 to (b- 1) do lgt:= lgt+ l[cx+89];
+           handle:=l[b+89];
+           nom:= 'AXX.mor';
+         end
+       else
+         if b= 50 then
+            begin
+              nom:= 'AZZ.mor';
+              handle:= 1260;
+            end;
+      charani(nom,lgt,handle);
+    end;
+ show_mouse;
+ if (a< 27) and ((maff< 27) or (s.mlieu= 15)) and (msg[4]<> entrer) then
+    begin
+      if (a= 13) or (a= 14) then person
+                            else if not blo then t11(s.mlieu, cx);
+      mpers:=  0;
+    end;
+end;
+
+(*    begin
+      for i:=0 to 15 do
+         begin
+           PalH:=memw[$7000:succ(i) shl 1];
+           Alllum[i]:=PalH and 15 + PalH shr 4 and 15 + PalH shr 8 and 15;
+         end;
+      for i:=0 to 15 do
+         begin
+           k:=0;
+           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
+           mem[$7000:2+k shl 1]:= Rang[i];
+           Alllum[k]:=-1;
+         end;
+    end;*)
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/TEST.COM b/engines/mortevielle/original/0/TEST.COM
new file mode 100644
index 0000000..1171cfb
Binary files /dev/null and b/engines/mortevielle/original/0/TEST.COM differ
diff --git a/engines/mortevielle/original/0/TESTPROT.PAS b/engines/mortevielle/original/0/TESTPROT.PAS
new file mode 100644
index 0000000..d158bfe
--- /dev/null
+++ b/engines/mortevielle/original/0/TESTPROT.PAS
@@ -0,0 +1,45 @@
+{$i var.mor}
+function testprot : boolean;
+var
+ regs : registers;
+ buffer : array[0..511] of char;
+ i,j,k : integer;
+ test : array[0..2] of boolean;
+ chaine : array[0..7] of char;
+begin
+ test[0]:=false;test[1]:=false;test[2]:=false;k:=0;
+ chaine[0]:=' ';
+ chaine[1]:='M';
+ chaine[2]:='A';
+ chaine[3]:='S';
+ chaine[4]:='T';
+ chaine[5]:='E';
+ chaine[6]:='R';
+ chaine[7]:=' ';
+ with regs do
+  begin
+   while (test[k]=false) and (k<2) do
+    begin
+     k:=k+1;
+     ax:=0;intr(19,regs);
+     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+     intr(19,regs);
+     test[k]:=true;
+     i:=0;
+     while (test[k]) and (i<19) do
+      begin
+       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
+      end;
+      for j:=0 to 7 do
+       if buffer[j+504]<>chaine[j] then test[k]:=false;
+    end;
+  end;
+ testprot:=(test[1] or test[2]);
+end;
+
+
+
+BEGIN
+WRIteLN(testprot);
+END.
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/TXX.INP b/engines/mortevielle/original/0/TXX.INP
new file mode 100644
index 0000000..755117e
Binary files /dev/null and b/engines/mortevielle/original/0/TXX.INP differ
diff --git a/engines/mortevielle/original/0/TXX.NTP b/engines/mortevielle/original/0/TXX.NTP
new file mode 100644
index 0000000..04fa8c5
Binary files /dev/null and b/engines/mortevielle/original/0/TXX.NTP differ
diff --git a/engines/mortevielle/original/0/VAR.MOR b/engines/mortevielle/original/0/VAR.MOR
new file mode 100644
index 0000000..d88528d
--- /dev/null
+++ b/engines/mortevielle/original/0/VAR.MOR
@@ -0,0 +1,481 @@
+
+(*         Constantes, Types et Variables pour le
+
+              M A N O I R   DE   M O R T E V I E L L E
+
+                                                    ( version Nov 1988
+                                                             +
+                                                  musique & paroles Oct 88 )
+                                                                             *)
+
+
+(*---------------------------------------------------------------------------*)
+(*-------------------------   CONSTANTES   ----------------------------------*)
+(*---------------------------------------------------------------------------*)
+
+const
+       freq0 = 1.19318e6;
+
+       seg_syst = $6FED;
+       segmou   = $6F00;
+       segdon   = $6C00;
+       adani    = $7314;
+       adword   = $4000;
+       adtroct  = $406B;
+       adcfiec  = $4300;
+       adbruit  = $5CB0;(*2C00;*)
+       adbruit1 = $6924;(*3874;*)
+       adbruit2 = $6B30;(*3A80;*)
+       adbruit3 = $6BA6;(*3AF6;*)
+       adbruit5 = $3B50;
+       adson    = $5CB0;(*2C00;*)
+       adson2   = $60B0;(*3000;*)
+       offsetb1 = 6;
+       offsetb2 = 4;
+       offsetb3 = 6;
+
+       null = 255;
+
+       tempo_mus   = 71;
+       tempo_bruit = 78;
+       tempo_f     = 80;
+       tempo_m     = 89;
+
+       ti1 = 410;
+       ti2 = 250;
+       Maxti = 7975;
+       Maxtd = 600;
+       Max_rect = 14;
+
+       ams  = 0;
+       cga  = 1;
+       ega  = 2;
+       her  = 3;
+       tan  = 4;
+
+       c_repon   =    0;
+       c_st41    =  186;
+       c_tparler =  247;
+       c_paroles =  292;
+       c_tmlieu  =  435;
+       c_dialpre =  456;
+       c_action  =  476;
+       c_saction =  497;
+       c_dis     =  502;
+       c_fin     =  510;    {  =>   n'existe pas  ; si !! }
+
+       arega  =     0;
+       asoul  =   154;
+       aouvr  =   282;
+       achai  =   387;
+       acha   =   492;
+       arcf   =  1272;
+       arep   =  1314;
+       amzon  =  1650;
+       fleche =  1758;
+
+       no_choice = 0;
+       invent    = 1;
+       depla     = 2;
+       action    = 3;
+       saction   = 4;
+       discut    = 5;
+       fichier   = 6;
+       sauve     = 7;
+       charge    = 8;
+
+       attacher= $301;
+       attendre= $302;
+       defoncer= $303;
+       dormir  = $304;
+       ecouter = $305;
+       entrer  = $306;
+       fermer  = $307;
+       fouiller= $308;
+       frapper = $309;
+       gratter = $30A;
+       lire    = $30B;
+       manger  = $30C;
+       mettre  = $30D;
+       ouvrir  = $30E;
+       prendre = $30F;
+       regarder= $310;
+       sentir  = $311;
+       sonder  = $312;
+       sortir  = $313;
+       soulever= $314;
+       tourner = $315;
+
+       scacher  = $401;
+       sfouiller= $402;
+       slire    = $403;
+       sposer   = $404;
+       sregarder= $405;
+
+         tabdbc : array[0..17] of byte
+                 =(7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9);
+         tabdph : array[0..15] of byte
+                 =(0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10);
+         typcon : array[0..25] of byte
+                 =(0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3);
+         intcon : array[0..25] of byte
+                 =(1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
+         tnocon : array[0..363] of byte
+                 =(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0);
+
+
+     don :array[1..8,1..4] of byte
+               =(( 7, 37, 22,  8),
+                 (19, 33, 23,  7),
+                 (31, 89, 10, 21),
+                 (43, 25, 11,  5),
+                 (55, 37,  5,  8),
+                 (64, 13, 11,  2),
+                 (62, 22, 13,  4),
+                 (62, 25, 13,  5));
+
+     fic : array[1..2] of string[11]
+           = ( ' Sauvegarde',
+               ' Chargement' );
+
+     addv : array[0..1] of byte
+          = (8,8);
+
+     recom =' Recommence  ';
+
+            f3 = 'F3: Encore';
+            f8 = 'F8: Suite';
+
+         Max_patt = 20;
+
+
+        Rang : array[0..15] of byte
+             =(15,14,11,7,13,12,10,6,9,5,3,1,2,4,8,0);
+
+
+(*---------------------------------------------------------------------------*)
+(*--------------------------------   TYPES   --------------------------------*)
+(*---------------------------------------------------------------------------*)
+
+type   path_chars   =  string[11];
+       long_integer =  real;
+       str255       =  string[255];
+       str125       =  string[125];
+       str30        =  string[30];
+       str11        =  string[11];
+       fichier_byte =  file of byte;
+       sav_chaine   =  record
+                         conf : integer;
+                         pourc : array[0..10] of char;
+                        teauto : array[0..42] of char;
+                          sjer : array[0..30] of char;
+                        mlieu,iboul,ibag,icave,ivier,ipuit : integer;
+                        derobj,iloic,icryp : integer;
+                         ipre : boolean;
+                        heure : char;
+                     end;
+    registres = record
+                  ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
+                end;
+     phrase = array [1..1410] of char;
+     tabint = array [0..Maxti] of integer;
+        ind = record
+                indis : integer;
+                point : byte
+              end;
+     tabind = array [0..Maxtd] of ind;
+
+     tab_mlieu = array[1..7,0..24] of byte;
+
+        table = array[0..255] of real;
+      tablint = array[0..255] of integer;
+
+         word = integer;
+      chariot = record
+                  val,
+                  code,
+                  acc,
+                  freq,
+                  rep :integer;
+                end;
+
+   doublet = record
+               x,y:byte;
+             end;
+     tabdb = array[1..16] of doublet;
+     tfxx  = array[0..107] of integer;
+     rectangle = record
+                   x1, x2, y1, y2 : integer;
+                   Etat : boolean;
+                 end;
+
+     mult_rect = array[1..Max_rect] of rectangle;
+     str40 = string[40];
+
+        pattern = record
+                    tay, tax : byte;
+                    des : array[1..Max_patt, 1..Max_patt] of byte;
+                  end;
+
+
+         nhom = record
+                  n : byte;   (* numero entre 0 et 32 *)
+                  hom : array[0..3] of byte;
+                end;
+
+         t_nhom = array[0..15] of nhom;
+
+         t_pcga = record
+                    p : byte;
+                    a : t_nhom;
+                  end;
+
+         pal_cga = array[0..90] of t_pcga;
+
+
+(*---------------------------------------------------------------------------*)
+(*------------------------------   VARIABLES   ------------------------------*)
+(*---------------------------------------------------------------------------*)
+
+var
+     blo,
+     bh1,
+     bf1,
+     bh2,
+     bh4,
+     bf4,
+     bh5,
+     bh6,
+     bh8,
+     bt3,
+     bt7,
+     bh9,
+
+     sonoff,
+     main,
+     choisi,
+     test0,
+     f2_all,
+     imen,
+     cache,
+     iesc,
+     perdu,
+     col,
+     syn,
+     fouil,
+     zuul,
+     tesok,
+     obpart,
+     okdes,
+     solu,
+     arret,
+     anyone,
+     brt,
+     rect,
+     rech_cfiec,
+     active_menu : boolean;
+
+
+     x,
+     y,
+     t,
+     vj,
+     li,
+     vh,
+     vm,
+     jh,
+     mh,
+     cs,
+     Gd,                (*  Gd = graph device  *)
+     hdb,
+     hfb,
+     heu,
+     jou,
+     key,
+     min,
+     num,
+     max,
+     res,
+     ment,
+     haut,
+     caff,
+     maff,
+     crep,
+     ades,
+     iouv,
+     inei,
+     ctrm,
+     dobj,
+     msg3,
+     msg4,
+     mlec,
+     newGd,
+     c_zzz,
+     mchai,
+     menup,
+     ipers,
+     ledeb,
+     lefin,
+     mpers,
+     mnumo,
+     xprec,
+     yprec,
+     perdep,
+     prebru,
+     typlec,
+     num_ph,
+     xwhere,
+     ywhere,
+     numpal,
+     lderobj,
+     nb_word,
+     ptr_oct,
+     k_tempo,
+     ptr_tcph,
+     ptr_word,
+     color_txt : integer;
+
+    t_cph  : array[0..6400] of integer;
+    tabdon : array[0..4000] of byte;
+ (*   t_dxx  : array[0..121] of integer;*)
+    stpou  : str125;                             (* donne le % d'indices *)
+    is     : byte;
+    mode   : char;
+    ficdes : fichier_byte;
+   al_mess,
+  err_mess,
+  ind_mess,
+  al_mess2 : str125;
+
+      invt,
+     nbrep,
+    nbrepm,
+      disc : array[1..8] of integer;
+       msg : array [0..4] of integer;
+      depl : array[1..7] of integer;
+      inv  : array[1..8] of string[22];
+      dep  : array[1..7] of string[23];
+      act  : array[1..21] of string[10];
+      self : array[1..5] of string[11];
+      dis  : array[1..8] of string[5];
+      touv : array[1..7] of char;
+      s,s1 : sav_chaine;
+    bufcha : array[0..390] of byte;
+
+   lettres : array[1..6,0..23] of byte;
+
+    PalHer : array[0..15] of byte;
+
+         T_mot : tabint;
+     Tay_Tchar : integer;
+         T_rec : tabind;
+        Sauv_T : file of ind;
+        FiByte : file;
+        v_lieu : tab_mlieu;
+             l : tfxx;
+           Tbi : tablint;
+    c1, c2, c3 : chariot;
+        addfix : real;
+        palsav : pal_cga;
+        Tabpal : array[0..90] of tabdb;
+        palcga : pal_cga;
+           tpt : array [0..14] of pattern;
+
+
+
+(*---------------------------------------------------------------------------*)
+(*--------------------   PROCEDURES  ET  FONCTIONS   ------------------------*)
+(*---------------------------------------------------------------------------*)
+
+procedure box(c,Gd,xo,yo,xi,yi,patt:integer); external 'c:\mc\boite.com';
+
+procedure hirs;
+const tandy:array[0..13] of byte
+           =(113,80,90,14,63,6,50,56,2,3,6,7,0,0);
+      herc:array[0..12] of byte
+        =(50,40,41,9,103,3,100,100,2,3,0,0,0);
+   var i, j : integer;
+begin
+  case Gd of
+    cga :
+     begin
+       graphcolormode;
+       graphbackground(0);
+       Palette(1);
+       res:=1;
+     end;
+    ams :
+     begin
+       hires;
+       inline($B8/6/0/        (*  =>  mov ax,6 *)
+              $CD/$10);       (*  =>  int 16   *)
+       port[$3D9]:=15;
+       port[$3DF]:=0;
+       port[$3DD]:=15;
+       res:=2;
+     end;
+    ega :
+     begin
+       inline($B8 / 14 / 0 /     (*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs *)
+              $CD / $10);        (*  INT 16  *)
+       res:=2;
+     end;
+    her :
+     begin
+       port[$3BF]:=3;
+       port[$3B8]:=2;
+       for i:=0 to 12 do
+       begin
+         port[$3B4]:=i;
+         port[$3B5]:=herc[i];
+       end;
+       inline($FC/$B9/$00/$80/$B8/$00/$B0/$8E/$C0/$31/$FF/$31/$C0/$F3/$AB);
+       port[$3B8]:=10;
+       res:=2;
+     end;
+    tan :
+     begin
+       port[$3D8]:=0;
+       port[$3DA]:=3;
+       port[$3DE]:=$14;
+       for i:=0 to 13 do
+         begin
+           port[$3D4]:=i;
+           port[$3D5]:=tandy[i];
+         end;
+       port[$3DA]:=2;
+       port[$3DE]:=0;
+       port[$3D8]:=port[$3D8] or 11 and $EF;
+       port[$3Dd]:=port[$3Dd] or 1;
+       port[$3DF]:=port[$3DF] or $c0;
+       box(0,gd,0,0,640,200,255);
+       res:=1;
+     end;
+  end;
+end;
+
+procedure affput(Chx,Gd,x,y,coul,char:integer);external 'c:\mc\divaf.com';
+
+procedure affcar(Gd,x,y,coul,char:integer);
+begin
+  if res=1 then affput(1,Gd,(x shr 1),y,coul,char)
+           else affput(1,Gd,x,y,coul,char);
+end;
+
+procedure putpix(Gd,x,y,coul:integer);
+begin
+  affput(0,Gd,x,y,coul,0);
+end;
diff --git a/engines/mortevielle/original/0/ZUUL.COM b/engines/mortevielle/original/0/ZUUL.COM
new file mode 100644
index 0000000..4436635
Binary files /dev/null and b/engines/mortevielle/original/0/ZUUL.COM differ
diff --git a/engines/mortevielle/original/1/AFF.COM b/engines/mortevielle/original/1/AFF.COM
new file mode 100644
index 0000000..d64d397
Binary files /dev/null and b/engines/mortevielle/original/1/AFF.COM differ
diff --git a/engines/mortevielle/original/1/AFFAMS.COM b/engines/mortevielle/original/1/AFFAMS.COM
new file mode 100644
index 0000000..577fd5a
Binary files /dev/null and b/engines/mortevielle/original/1/AFFAMS.COM differ
diff --git a/engines/mortevielle/original/1/AFFEGA.COM b/engines/mortevielle/original/1/AFFEGA.COM
new file mode 100644
index 0000000..6fd86b9
Binary files /dev/null and b/engines/mortevielle/original/1/AFFEGA.COM differ
diff --git a/engines/mortevielle/original/1/AFFHER.COM b/engines/mortevielle/original/1/AFFHER.COM
new file mode 100644
index 0000000..9f7be45
Binary files /dev/null and b/engines/mortevielle/original/1/AFFHER.COM differ
diff --git a/engines/mortevielle/original/1/AFFICH.COM b/engines/mortevielle/original/1/AFFICH.COM
new file mode 100644
index 0000000..22085db
Binary files /dev/null and b/engines/mortevielle/original/1/AFFICH.COM differ
diff --git a/engines/mortevielle/original/1/AFFTAN.COM b/engines/mortevielle/original/1/AFFTAN.COM
new file mode 100644
index 0000000..ac01221
Binary files /dev/null and b/engines/mortevielle/original/1/AFFTAN.COM differ
diff --git a/engines/mortevielle/original/1/AXX.MOR b/engines/mortevielle/original/1/AXX.MOR
new file mode 100644
index 0000000..81954bd
Binary files /dev/null and b/engines/mortevielle/original/1/AXX.MOR differ
diff --git a/engines/mortevielle/original/1/AZZ.MOR b/engines/mortevielle/original/1/AZZ.MOR
new file mode 100644
index 0000000..55088f3
Binary files /dev/null and b/engines/mortevielle/original/1/AZZ.MOR differ
diff --git a/engines/mortevielle/original/1/BMOR.MOR b/engines/mortevielle/original/1/BMOR.MOR
new file mode 100644
index 0000000..51f3378
Binary files /dev/null and b/engines/mortevielle/original/1/BMOR.MOR differ
diff --git a/engines/mortevielle/original/1/BOITE.COM b/engines/mortevielle/original/1/BOITE.COM
new file mode 100644
index 0000000..e274143
Binary files /dev/null and b/engines/mortevielle/original/1/BOITE.COM differ
diff --git a/engines/mortevielle/original/1/CFIEC.MOR b/engines/mortevielle/original/1/CFIEC.MOR
new file mode 100644
index 0000000..2038c7c
Binary files /dev/null and b/engines/mortevielle/original/1/CFIEC.MOR differ
diff --git a/engines/mortevielle/original/1/CFIPH.MOR b/engines/mortevielle/original/1/CFIPH.MOR
new file mode 100644
index 0000000..a1493e8
Binary files /dev/null and b/engines/mortevielle/original/1/CFIPH.MOR differ
diff --git a/engines/mortevielle/original/1/CGA.COM b/engines/mortevielle/original/1/CGA.COM
new file mode 100644
index 0000000..5ed874a
Binary files /dev/null and b/engines/mortevielle/original/1/CGA.COM differ
diff --git a/engines/mortevielle/original/1/CHARDES.COM b/engines/mortevielle/original/1/CHARDES.COM
new file mode 100644
index 0000000..252d639
Binary files /dev/null and b/engines/mortevielle/original/1/CHARDES.COM differ
diff --git a/engines/mortevielle/original/1/CHARECR.COM b/engines/mortevielle/original/1/CHARECR.COM
new file mode 100644
index 0000000..6cb6bcf
Binary files /dev/null and b/engines/mortevielle/original/1/CHARECR.COM differ
diff --git a/engines/mortevielle/original/1/CXX.MOR b/engines/mortevielle/original/1/CXX.MOR
new file mode 100644
index 0000000..df5d947
Binary files /dev/null and b/engines/mortevielle/original/1/CXX.MOR differ
diff --git a/engines/mortevielle/original/1/DEC.MOR b/engines/mortevielle/original/1/DEC.MOR
new file mode 100644
index 0000000..01d5913
Binary files /dev/null and b/engines/mortevielle/original/1/DEC.MOR differ
diff --git a/engines/mortevielle/original/1/DECOMP.COM b/engines/mortevielle/original/1/DECOMP.COM
new file mode 100644
index 0000000..4489ceb
Binary files /dev/null and b/engines/mortevielle/original/1/DECOMP.COM differ
diff --git a/engines/mortevielle/original/1/DECPASP.COM b/engines/mortevielle/original/1/DECPASP.COM
new file mode 100644
index 0000000..326c26f
Binary files /dev/null and b/engines/mortevielle/original/1/DECPASP.COM differ
diff --git a/engines/mortevielle/original/1/DEMUS.COM b/engines/mortevielle/original/1/DEMUS.COM
new file mode 100644
index 0000000..97c1c6f
Binary files /dev/null and b/engines/mortevielle/original/1/DEMUS.COM differ
diff --git a/engines/mortevielle/original/1/DEMUS2.COM b/engines/mortevielle/original/1/DEMUS2.COM
new file mode 100644
index 0000000..97c1c6f
Binary files /dev/null and b/engines/mortevielle/original/1/DEMUS2.COM differ
diff --git a/engines/mortevielle/original/1/DIVAF.COM b/engines/mortevielle/original/1/DIVAF.COM
new file mode 100644
index 0000000..dc61b0c
Binary files /dev/null and b/engines/mortevielle/original/1/DIVAF.COM differ
diff --git a/engines/mortevielle/original/1/DXX.MOR b/engines/mortevielle/original/1/DXX.MOR
new file mode 100644
index 0000000..cc8f845
Binary files /dev/null and b/engines/mortevielle/original/1/DXX.MOR differ
diff --git a/engines/mortevielle/original/1/DZZ.MOR b/engines/mortevielle/original/1/DZZ.MOR
new file mode 100644
index 0000000..0b1df4e
Binary files /dev/null and b/engines/mortevielle/original/1/DZZ.MOR differ
diff --git a/engines/mortevielle/original/1/FXX.MOR b/engines/mortevielle/original/1/FXX.MOR
new file mode 100644
index 0000000..f8f47bb
Binary files /dev/null and b/engines/mortevielle/original/1/FXX.MOR differ
diff --git a/engines/mortevielle/original/1/LITPH4.COM b/engines/mortevielle/original/1/LITPH4.COM
new file mode 100644
index 0000000..f374940
Binary files /dev/null and b/engines/mortevielle/original/1/LITPH4.COM differ
diff --git a/engines/mortevielle/original/1/MENUFR.MOR b/engines/mortevielle/original/1/MENUFR.MOR
new file mode 100644
index 0000000..d773958
Binary files /dev/null and b/engines/mortevielle/original/1/MENUFR.MOR differ
diff --git a/engines/mortevielle/original/1/MORT.000 b/engines/mortevielle/original/1/MORT.000
new file mode 100644
index 0000000..5d70cc5
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.000 differ
diff --git a/engines/mortevielle/original/1/MORT.001 b/engines/mortevielle/original/1/MORT.001
new file mode 100644
index 0000000..d646f33
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.001 differ
diff --git a/engines/mortevielle/original/1/MORT.002 b/engines/mortevielle/original/1/MORT.002
new file mode 100644
index 0000000..1756f54
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.002 differ
diff --git a/engines/mortevielle/original/1/MORT.003 b/engines/mortevielle/original/1/MORT.003
new file mode 100644
index 0000000..3e97c6e
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.003 differ
diff --git a/engines/mortevielle/original/1/MORT.004 b/engines/mortevielle/original/1/MORT.004
new file mode 100644
index 0000000..ab9f969
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.004 differ
diff --git a/engines/mortevielle/original/1/MORT.005 b/engines/mortevielle/original/1/MORT.005
new file mode 100644
index 0000000..d1ad3ca
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.005 differ
diff --git a/engines/mortevielle/original/1/MORT.006 b/engines/mortevielle/original/1/MORT.006
new file mode 100644
index 0000000..60dff2a
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.006 differ
diff --git a/engines/mortevielle/original/1/MORT.COM b/engines/mortevielle/original/1/MORT.COM
new file mode 100644
index 0000000..f39b611
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.COM differ
diff --git a/engines/mortevielle/original/1/MORT.ZIP b/engines/mortevielle/original/1/MORT.ZIP
new file mode 100644
index 0000000..307df35
Binary files /dev/null and b/engines/mortevielle/original/1/MORT.ZIP differ
diff --git a/engines/mortevielle/original/1/MUSINT.COM b/engines/mortevielle/original/1/MUSINT.COM
new file mode 100644
index 0000000..a8fd455
Binary files /dev/null and b/engines/mortevielle/original/1/MUSINT.COM differ
diff --git a/engines/mortevielle/original/1/MUSINT2.COM b/engines/mortevielle/original/1/MUSINT2.COM
new file mode 100644
index 0000000..9ef47df
Binary files /dev/null and b/engines/mortevielle/original/1/MUSINT2.COM differ
diff --git a/engines/mortevielle/original/1/MXX.MOR b/engines/mortevielle/original/1/MXX.MOR
new file mode 100644
index 0000000..73c732d
Binary files /dev/null and b/engines/mortevielle/original/1/MXX.MOR differ
diff --git a/engines/mortevielle/original/1/PHBRUI.MOR b/engines/mortevielle/original/1/PHBRUI.MOR
new file mode 100644
index 0000000..4b07358
Binary files /dev/null and b/engines/mortevielle/original/1/PHBRUI.MOR differ
diff --git a/engines/mortevielle/original/1/PHINT.COM b/engines/mortevielle/original/1/PHINT.COM
new file mode 100644
index 0000000..87ea93e
Binary files /dev/null and b/engines/mortevielle/original/1/PHINT.COM differ
diff --git a/engines/mortevielle/original/1/PHINT2.COM b/engines/mortevielle/original/1/PHINT2.COM
new file mode 100644
index 0000000..9d79eef
Binary files /dev/null and b/engines/mortevielle/original/1/PHINT2.COM differ
diff --git a/engines/mortevielle/original/1/PHINTBAK.COM b/engines/mortevielle/original/1/PHINTBAK.COM
new file mode 100644
index 0000000..0191fce
Binary files /dev/null and b/engines/mortevielle/original/1/PHINTBAK.COM differ
diff --git a/engines/mortevielle/original/1/PHINTCOM.COM b/engines/mortevielle/original/1/PHINTCOM.COM
new file mode 100644
index 0000000..0191fce
Binary files /dev/null and b/engines/mortevielle/original/1/PHINTCOM.COM differ
diff --git a/engines/mortevielle/original/1/PHINTDEF.COM b/engines/mortevielle/original/1/PHINTDEF.COM
new file mode 100644
index 0000000..b167519
Binary files /dev/null and b/engines/mortevielle/original/1/PHINTDEF.COM differ
diff --git a/engines/mortevielle/original/1/PHINTGM.COM b/engines/mortevielle/original/1/PHINTGM.COM
new file mode 100644
index 0000000..4ec9edd
Binary files /dev/null and b/engines/mortevielle/original/1/PHINTGM.COM differ
diff --git a/engines/mortevielle/original/1/PHINTUK.COM b/engines/mortevielle/original/1/PHINTUK.COM
new file mode 100644
index 0000000..d47dc09
Binary files /dev/null and b/engines/mortevielle/original/1/PHINTUK.COM differ
diff --git a/engines/mortevielle/original/1/PLXX.MOR b/engines/mortevielle/original/1/PLXX.MOR
new file mode 100644
index 0000000..e867b3b
Binary files /dev/null and b/engines/mortevielle/original/1/PLXX.MOR differ
diff --git a/engines/mortevielle/original/1/PUTPIX.COM b/engines/mortevielle/original/1/PUTPIX.COM
new file mode 100644
index 0000000..3e41fcd
Binary files /dev/null and b/engines/mortevielle/original/1/PUTPIX.COM differ
diff --git a/engines/mortevielle/original/1/REUS.COM b/engines/mortevielle/original/1/REUS.COM
new file mode 100644
index 0000000..44678b2
Binary files /dev/null and b/engines/mortevielle/original/1/REUS.COM differ
diff --git a/engines/mortevielle/original/1/REUSINT.COM b/engines/mortevielle/original/1/REUSINT.COM
new file mode 100644
index 0000000..638a7ba
Binary files /dev/null and b/engines/mortevielle/original/1/REUSINT.COM differ
diff --git a/engines/mortevielle/original/1/SAUVECR.COM b/engines/mortevielle/original/1/SAUVECR.COM
new file mode 100644
index 0000000..8e8d6c9
Binary files /dev/null and b/engines/mortevielle/original/1/SAUVECR.COM differ
diff --git a/engines/mortevielle/original/1/SAV0.MOR b/engines/mortevielle/original/1/SAV0.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/1/SAV0.MOR differ
diff --git a/engines/mortevielle/original/1/SAV1.MOR b/engines/mortevielle/original/1/SAV1.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/1/SAV1.MOR differ
diff --git a/engines/mortevielle/original/1/SAV2.MOR b/engines/mortevielle/original/1/SAV2.MOR
new file mode 100644
index 0000000..0e2297b
Binary files /dev/null and b/engines/mortevielle/original/1/SAV2.MOR differ
diff --git a/engines/mortevielle/original/1/SAV3.MOR b/engines/mortevielle/original/1/SAV3.MOR
new file mode 100644
index 0000000..9df463e
Binary files /dev/null and b/engines/mortevielle/original/1/SAV3.MOR differ
diff --git a/engines/mortevielle/original/1/SONMUS.MOR b/engines/mortevielle/original/1/SONMUS.MOR
new file mode 100644
index 0000000..f9bc2a0
--- /dev/null
+++ b/engines/mortevielle/original/1/SONMUS.MOR
@@ -0,0 +1,9 @@
+ˆ™ˆˆ˜ˆ‡†w‡fw‡wˆˆˆˆ‰ˆŠˆ«‰»š¸‹§xˆhˆhˆˆˆxˆˆxˆˆ˜ˆˆˆˆxg‡v†h‡xxˆ‰ˆ‰‰™‡˜Šˆ‡‰ˆxw‡hWˆhxx¨˜Š˜™‰š›©«‹©‰ˆx†x‡x‡xˆh‡xˆhˆ˜‰x˜‰ww‡gvx‡x‡šˆ‰™™˜‰˜™‡ˆ˜xfˆvWwwxwˆŠ‡Šˆ©˜ºš«¸›¹ˆˆx‡ˆvywˆˆxˆˆˆxˆˆ˜ˆˆˆvwvvh‡h‡ˆ‰ˆˆ™‰ˆ™‰ˆˆ‰—xwˆuwx‡‡xš‰‰Š¸˜¹›©ºˆ»‡ˆx‡gxvxwˆ‡x‡x‡y‡‰˜Š‡˜xX…h†ˆ‡‰ˆ˜˜š¨zˆ©˜xˆ˜gh†vgg‡xv‰˜x¨‹‰š›«©š¹™˜x˜w†x‡hxˆ‰x˜‡ˆx‰‰˜ˆ˜xvfwggxˆx‡‰ˆ‰ˆŠ˜™ˆ‰—ˆwxgv‡xx‡‰Šˆ‰›‰ª©«¹Šº‰ˆˆˆwxeˆfxwˆˆxˆˆ‡ˆ˜™ˆŠxˆfwv†w˜ˆ‡y¨‰‰ˆ©¨‰ˆˆxwxvgvxvwx˜ˆ™y©šºŠË˜«©©xyˆˆvg‡gx‡˜ˆˆ˜ˆˆy˜‰ˆˆ‡hfhehv‰g‡˜yˆ˜ª‰ˆ©ˆ‡x‰vwˆxvx˜ˆˆš˜Š™»©«¨»˜ˆ˜ˆw‡†fhfwgˆ‰‡‰ˆ‡ˆ™‰ˆ™ˆˆwxgv‡ˆhˆy˜ˆš©˜ˆ©ˆ†hˆ†Vx‡ggh¨hˆš˜‹»š»z»™Š‰˜ˆˆx†eyv‡ˆ‰ˆˆˆ˜y—z˜‰‡yuˆUhW‡gx‡‰‡z¸‰‰™˜xw‰‡gˆˆ…ˆˆˆ†{‰©‹»»¹Šº˜yˆ‰—h‡xef‡hgy˜ˆxˆ‰ˆˆy©‡x™v‡gx†hˆˆ—y¨š§Š¨y…ˆ†xuˆwwgx‡hˆˆšº›¼¹›š¨ˆ‰ˆ©ˆy‡‡fX‡h‡Š‡‰‡Š–z‡‰‡‰wxVwgffˆˆxx™©ˆš˜xˆˆ‡†h¨ˆˆyˆ‡x—k—«Ê»º«˜‰—wšh˜‡wfgfVˆg‰x‰‰‡‰ˆˆˆ‰‰˜ˆˆ‡h†g˜x—xš¨ˆ™‰˜wx†wgx—fˆh‡xX™ˆ««Ë‹»˜šg¨ˆŠˆš‡x…iujwˆ‡‰‰—™i§ˆˆ‰i¦hfˆUxH–†xˆ˜ˆ™‰˜hˆ‡hˆˆ‰ˆ™˜‰g©Y¨›¹¼¸«ºh¨y—‡ˆ‡ˆugvfXxh†Šx¨ˆˆ‰‡ˆy¨y˜‰‡‡h†ˆvyˆˆˆ‰¨‰xy‡fxˆgxˆˆˆxxˆˆ‹¹«»‹¹Šyx¸‡‰ˆ™x‡ˆwggˆg‡y‰™y¦Šwh™‡z†‰vwvgeh˜xˆ‰¨‡xˆxgg™ˆ˜›¨™˜Šˆš˜›É›ª™©—x‰˜hˆwhwfggVg
 xvˆ¨y˜Š‡‰‡ˆºˆª‰¨y†ˆe‡‡ˆ†y˜x†i…wwh‡‡i˜‡‰ˆ‡š™ª¼˜¬¸ˆ¸ˆ—‰˜ˆˆˆyˆ‡Y˜Uxgh‡˜ˆ¨˜‰x—y·x¨ˆgˆgVfhxˆwˆ‡‡X‡whx‰˜‰»‰©{™‰¸¬›¹šËˆ¨z™f™yexexU†ggUh†X—y™ˆª‡y˜ª©›Éˆšˆuwg‡xwx‡vfˆWgvˆg—x›wˆ‹ˆª«º«¨¼˜©g¹‰x¸ywˆ–yw†hvVwgg‰ˆ™˜˜‰y˜ˆšš§ˆ–ˆeXfˆW‰†XVw‡Ui‰ˆx»˜ºŠ¹˜ÈŒ»»™¬¸‰˜k—x‡h†V‡gwVfVgTˆV‡x¹Š¨‰Š‰¸œÊ›È›¨v…h†XvheVWueVˆh‡xª‡˜¨‹¸«¼¼˜¼ˆºh™ˆªx…˜†i‡ˆx…ugeU˜U‰ˆ«x˜ˆ™x©º¹ŠºˆhtivVhˆUeWhVgy‰ˆ›™©Š©›¸¼ª¼¹»¨—š‡—‰˜VˆWvgwX„gfUUfvX˜Š˜š‰º‰«¼»»¼¸št{…Ug‡VeEuUFh†Wˆ™yŠˆ›©«Ì›Ë‹Él–k·‹y¶hˆj…y‡h…WeGeX•X™™ˆyšw˜‹Ê›¹¬§f˜WuVvhdUuWUy–‰y¹©‹‹·Ë|ÊÌȌƫ†x¨ˆx‡…f‡WfˆthUfTVUˆU‹‰ˆªªŠ»›ËËÌ›Êw¸†vWueUUUEFu…Xhˆˆˆ‰¨ª¬ÊÌ»œ¹˜Šg¸Š™z·Xx—wx—wvUfWTU˜Xh‰x¹ˆ‰º©›Ëº»ˆ©—XUxUFUVUEjˆfˆŠ¹w«šºË»Ü¸œ©¨xx‰‰—x˜Vuh–VwwweUf…E†wxh™©™¹¼¬»¬Ü‹»yˆˆ‡F†TUUETVehfˆxˆˆˆ¨­È¬Ük»¶k§Y¹›˜Š¨wˆx¥Y‡‡wVVeUE‡U…kˆŠ˜‹©©œ»¼™»¨™vV‡EUVTfUwgˆˆ‰›‡¼‡½»»Ì™¼…©g˜gªj†h˜Fw‡gg—W•H„XTX‡ex‰«˜ºÌ™¼ÌË»«¨ˆˆxvUTUdEEvUwWŠxh¨{¹½É͈¼µzujµ[¹¹x›…zw‡wyf‰eVguUWfV‰¨z§›ª›šË»›º»wf†WTE…EEh™UŠ©‰™iÉ›¹Í»»ŠÊW†wXµj™–g™ee›dx‰W§vExdF—Uˆ©˜¬ª»¼É¬Ìš»¨ˆˆˆVtEUETFwTX–y‡ˆª›¬Ë¼Ù«¸ˆwgx—k¸‹wŠ•Z†‰fy–zvgwWUvvU˜ˆw›‰©›»»»¹»¸Y§fdUeUEV‰uj‰ºh‹ˆš
 ÉœŲ̂¼¦xUxuY—y¦X‡f†huh¨‡x…VvVG…u‰©‰»¼¹«Ë«Ì‹¼˜ˆˆˆeTUEdD‡EhV˜yw›¨œ¼×ζÄZeV—WŠy¨ˆ†˜gx†X˜‡y˜uxhVugujuš‰º‰»º«º¼˜»†‡weEdFUgf‰gª©y§›™¼Ë¼Û‹¹ˆtVvXfxˆ†e‰gV‰‡gˆ˜z–wfˆeY‡W‹‰««É›¼ªº»‹»ˆˆ‡VdFTEDYD†Y©—h»xÙ­ÌÛ¸­µ‡EztX‰‡y‡w˜eX‰†W»v˜ˆ‡xfW†E‡x‰y»™‹»¹«È«¹w˜uXDVUUX—v[›ˆš{ˆ»Ì¼ÌÚˆˆˆˆ‡TT™UgewWfE¸xg˜¨h¨fŠ…g‰v‡›™«º›»»¨¼š»¸¨†™sITG4xE†U{—‰–‹¹¼ËÌË»¨¹uUvuY…ˆh†wY†…[ˆv«w™˜w‰†Uh–H‡z»§œ›«‡Ë›É‰xštTeUTWV§Uš{¸‰šºœÌ«Ý¨ˆˆˆˆ†…FtHexTWg†Jˆˆ‡z™ˆ‰x©vX™…Šš»º¨¼º‰‰Ìš˜ªˆutEV3ewFWv‹˜ˆŠ¹ŒËÍË˼ˆˆ…gU—U‡g…hUx†Uk§g‰«‡xŠf¨Ty…fŠ›¸jº»¦Œ©ÌŠ›¨geEeDtXˆV˜k¹—›šÊ«ÜÌȈˆˆˆˆˆduGTeFUUhfw‰w˜™™ˆ™Šy¦hi—ˆË‹›Ê»©¸‹«É›ˆˆ†WTD6TXvUw©yv»¨œÛËݘɈˆe†WV…WWtVxex·Wˆ¹j™¨z˜ˆ‡xU‰uxŠ©¸šÉ{—›»«yÈyeUDUEWˆ…h¸Œ¶Œ˜¼ËËͨˆˆˆˆˆˆeUvCuTXTwˆfy‡šˆ™™Šˆ§h‡w‹f»šË{ȼ†‹¼©«¸‰†VDuCTiufX·k¶lº«ÌÌͨ¨ˆˆˆ…VevUUTxTygˆwzºgª™ˆˆ‰ˆVgˆg…‹Éˆ»¹©‡Œ¼·|¸‹”GeDUH˜v—{»ˆš›»»Ì˜ˆˆˆˆˆ†FtEUDUFgVˆX˜›—Š‰¹y¨ˆ‡g‰—ˆ¨¼ª»»‹©k¼ºˆ»ˆˆ…DTSGWh„‹‡ª‡‹‹Ë©Í˘ȈˆuUXdXdUuWVg‹‡‡‹¸ˆ™‹‡yˆ†vvx†i›¸Œ§»—‰ŒÈ‹»‹¸ufTUDZxe™‹œ¥Œº‹Ë¼ËˆˆˆˆˆˆeTFTFeE‡T˜i•z˜Š˜ª˜x¹gˆvˆj¶œº‹»‹·z»{Ùœ¨ˆˆG„4ETwxhj¸[˜©§»Ë܇šˆY¥U…G„HTUwXU©‰‰ˆ©y©˜ˆ˜†xgT˜Xh«Æ
 Œ¹º‰‰«œÇŒÈ‹dkSUdj‡‡iœ˜hÌx‹¼Ê»˜ˆˆˆˆ…WDUEUDuWU‰vˆ‰¨yŠ©‰‰«‡ˆWŠ˜vŒ»¨»Ëª™šÌÇ‹ˆˆˆvUDEDy¦Gš¸{¦Z¹‹‹Ë̘Œ¨wUUWdUVuV…Y˜i©ˆŠ¨™‹·i˜hvVfyu‰ºŒ§œ¸‰ˆ»»Ê‹©¸UWdETj§Xw¬™Š™ºª¼ºÉˆˆˆˆ†uEUEUUeVvwY–h™ˆxºŠ‡›‰˜Vˆ†xh›¹»›Ì¨º¬Ë«¨ˆˆˆFTU5V¨X„«ÈˆxÊZ¹œ¼ºˆ«ˆ…UWDeFeVUˆˆ‡‹†‹¸ˆŠ¸‰ˆ–xVVvˆU‹»·»‹»ˆ©¼Éœ¨»ˆfWTUUy˜Uš˜ª·Šš›¼È›ˆˆˆˆeDETeTVhexW©W™ˆ‰‰‹¸‰¹˜˜VˆˆU‰©ºª¼Ì©»»ÌˆˆˆˆˆfCuEhwYw‰¸{w˜y»›È«›º…wTUTWTXTzˆxªŠ¸z¸z¹h¸i‡gdhXVX‹¹˜º¹¹š¬Êª¼{»eXv5uWˆZuŒ§ªˆ«Š¬º»˜ˆˆˆdeSXTUUVew‰ešv‹—x»©¸{ˆ˜VW‡vWŠÊ«›Ì˨¼Ü¸ˆˆˆˆˆdfDIªF—I»eˆ˜z©»¬ËWÉguEUDgTUWgˆyªª˜‹»ˆ¨ª‡ˆ—htWheeŠª‡»»ª‹›Ü›ªœ¹‡ggtEwZµFkƈˆ»¨»¼¸¨ˆˆˆcwDUEeUGghvy˜ˆ¨Šª‡¬˜©Š†fdxuXy»œ«¼Ê¹œÌ¼˜ˆˆˆˆˆUdFˆ•vh‹uxxx¸œ««Æ[¶UDeDWFfggˆ›ˆ»¸›šÊ‡«—‰—idWTxtHš˜‰«ªºšÌ̋ʼˆ…WuUUˆˆ†h‰ªh‹¸‹œÈ›ˆ‡˜deTDUGUVeI‡ˆˆŒ…ª¹Š»™ššˆuVTyUX‹ºš¼É»»¼Ìº©ˆˆˆˆˆEwF™tXhÇE©g·›º‹ØGÊuEe5WETXVˆˆˆË©»Š»˜Š»‡˜˜xtFgdVi©†»ª›¨›ÌÌ«Êȇ‡wEVW¨XuŠ¸Š…Œ¥¼Š»¨ˆˆ‡t5UCeUE„hˆˆˆˆˆ™»˜»ºŠ¨ŠuwTW‡Fˆ«¸¬È½‰¼¬Ú«˜ˆˆˆˆ†WuX¦Fe›UˆX˜kÈ‹Ë…{¶EdE5„Efˆˆˆˆˆ¼ºªÌxºŠ¸™‰‡uuE–TX¨—‹x»˜kÌ«Ì›¼¹ggvfTy•Xxˆ«…‹§¼˜¬Èˆˆˆ…TEDTFEUVˆˆˆ‰ˆªªšz»™‹©w†UU‡Eh©ª˜Ëȼš¬ÌË»ˆˆˆˆˆˆuwxfdzYuVªHºº««fºeDTTDeEx
 ˆˆˆˆ‹«¹»º©›¸‰¹x……UxeVhŠ—k¨©ª‹Ìˬ»Èˆˆˆ…EuyuXw¨y˜y¸‰¼§«™x§EEEDEDXUxˆˆˆˆŠ¹ªz«¨›š¨ˆvuWeV—‹™¹«¼¹œÌ½¹ˆˆˆˆˆˆˆ…V–Fei…Ze‡‹‰Š»©‡š…DTEFTWˆˆˆˆˆ¼¨Ë¹¨‹Éy‰¨‰…wHt…I†x¤»y»z̼«ÚšÉˆˆ‡fUgH–Vˆ|¸d¬ˆˆÊ˜­„ˆŠT4dUSwHe‡hˆˆ™ˆº™‰ª™š§x©wUW†W¦{ÉŠœÌ»¼ÍɈˆˆˆˆˆˆˆ†XuUF‰x„Wš†ˆŠ»še›TVDUFUxˆˆˆˆ‹¸¼©œ¸Š»w©˜˜W†XuW…X¨h¹˜º«¼»Üz»ˆˆˆ†WeUX…Vz™˜ˆy§¸Zˉ¸Y•UTD…TXuhuwˆ™h»¨ˆœ˜‰¹x˜ˆxX…X‡—™ª¸›Ì̬ËɈˆˆˆˆˆˆˆvFveHh‡wH…‰‡{ÅËX§‡TDdxE‡xˆˆˆº™»Ë©š»ˆŠ‡‡xvx…fxXvŠ–\¨¼»»¼Ì¸™˜ˆˆ†xdfU˜Tˆ‰©u›Wšˆª«Å\…UTUSxdxVˆWˆˆšŠx»›‡›·X‡ªx‡X¹w‹˜‹§»¼»ÌˆˆˆˆˆˆˆˆˆUVfUfW·Hf†v‹h»©‡š…ET…HVˆˆš‡›‰««›¹ªš‡ÉUi‡x‡fxˆW™J†ˆ«Ë»»Ì»¹y—ˆ‡XŠUUvhX…‹ˆx…˜h‰¹¨¼WµHTGsKVg—Wˆvˆ›˜‰›š˜y¨g‰zš†Š†»—i¨»{̼˺ˆˆˆˆˆˆˆˆˆhTFfEfˆX…„{e‹µµ‡¨GudY‡‡Š©™Šˆ»ªˆª¨ˆ‰ˆwwY©†gzgˆVˆXº©ÌšÌ›Ëˆ©f¨‡ˆh†Vuieˆw‰ˆu™VŠ˜™«…›ehEFV…Y•xˆXŠ™‡™™š‡˜x˜wŠº…‹ª‹…›˜œ¸ÌËˈˆˆˆˆˆˆˆˆˆeHTuEuW†gW–H™¹{Èw¨V†uX—™Š™¸ˆ˜›¹Š˜Œ†x‡yeˆ©xu¨wˆUx›…¼ÌÊ«Ê›¹wˆz–i§fF–IˆUx‰ˆT¸E™xÆŒ–h©UgE—H—X†wh‰‰™§‹—‰˜x†š‰¹ˆ¹Š™y¹kºŒÚ¼¸ˆˆˆˆˆˆˆˆˆˆFTEvDWX˜E‰Dºe¬§Êj«…™Ez¦{«ˆ™˜¨Š‰¨{•yw†uŠe›†‰u‰…wˆ‹‹ÊË«‰»—™X¸‰—zU‡EY‡ee¼D¶EˆZ…ºœ•iÈXTvy†v†xuhˆzxŠ›‡˜–x§Y¸‹µËˆ¬—Š»|ȼʈˆˆˆˆˆˆˆˆ
 ˆˆ…T5FTTXˆVUˆXxˆ»¬†¼¨‰V¸ˆ©Š¹y¨x¸h‰˜‡x·GˆU‹v˜ˆˆgŠ‡xŠ›Ê¼Ë©ËX«…XŠ¸ˆŠeweGfvVi¶VWf‡‰ˆ›ËGÌuxU˜hˆeˆ†X‰ˆhŠ–y–iˆwyº‰¹›šŠª§«¸Í¸»ˆˆˆˆˆˆˆˆˆˆˆeDCFuDeˆ‡Uxxˆˆ¨¼¨ŒØY©yº™‰ºˆv©wvz‡gˆV‡Xwy†‰˜xvš†[§¼»»¼Øxz¨ˆe¼‹˜†˜wTTˆTYUšeUh†h‰‹»‡¼–ˆu‰†ˆjfh—g†—j‡i§hW¨¨ˆŒªª‹›™¸ˆÌªË‹¨ˆˆˆˆˆˆˆˆˆ†eUS6eD„Xˆexˆˆˆˆ‰Ë‰Ì¹›‰«¨Š˜Šˆx‡wˆ‡w‡exV˜U¹h¹‡x‡‰g»›ÊŒÊ›—‰x‰†Œ¨›†™vUeGeUW‰evfxfŠ¨œ˜»¨©ušw‡xˆW§hvˆ˜g‰e˜Xˆ‰¨‹»©»ˆª{˜›¼‹Éšˆˆˆyˆˆx˜ˆegUDDF„FvˆuXˆˆˆˆ‹Ë¹¼»¸{¹›˜‰™‡whv‡–X‡ehf‡y†‰©ˆhˆ†™Š›¹Ì‰¼–g›w¸‹¹‹¨‡ˆeUUwUVgxUhU‡g›ŠÉ‰›ª–Z˜w…™hˆVz†ˆ†‰uˆx‰ˆ¨«»ª¹Š«k˜›©¼—Ȉˆh™ˆh‡š…WeUDD†UUXˆ…Wxˆˆˆˆ¼¸Ê¹Š«ª˜‰™ˆvx‡xwv‡W†xxf‰ˆ‰‰vx¸w›¸»ª«˜™WŠ¸ˆŠ«©šgˆtTxVuUyvuHhuY™¼¸©‹ºvˆˆ‡ˆˆ‰w†‰vˆ‡gXw—‰ˆš©»š¹™™ª˜™ª«ˆºˆxvz¶xˆ‹†fWeEFV…UX¨XUW‡ˆˆšÌ™Ì»ºi»ˆ˜‰¹gˆh—V‰W†V‰†Wh—ˆˆˆ©ˆˆ«—›¹¹‰©‰vš™˜Šº‹¸wˆuUV†Ue‡xVUuXg™«‹‰É‹ˆfˆzgªˆˆ‡‰vx†hˆx™†º{ª™»‰©Šºxºz¹ˆy˜hfŠ—wx˜xvWvVUWvVgh†fwWˆˆ››ËœË«¹ˆ©ˆŠ˜˜‡xˆgxuvwgxgwxˆ™†—Š˜š—«™¨‰ª†ˆx›¸ˆ«™¸˜h‡UuX…U‡if…eY„z¨{ÇŠ»ˆ‡x˜ˆ‰›uŠwh‡gx‡xy¸‰š˜º™¹y©Š©Š©™ˆ‰˜‡Vˆ˜x…Š‡wˆewUhfuXx†ggvgŠ™«º¬»»ˆ©ˆ˜Š¨yˆxg‡V†hvwhgˆ‡‰˜¨ˆšˆºˆœˆ¨™Š‡ˆ‰Š˜‰™‹˜ˆ‡xefwgew‡wuXehx‰˜©ª›˜‰‡‰†©ˆˆˆ‡v‡ˆg
 ˆ‰‰‰‹š™™«‰¨™™¹‹‡ºvˆx–Xvzvwˆxˆv‡fvVˆVxW˜X†h¥z©›¼¸¬¸¹ˆ‰ˆ©x™‡ˆf†ggVwwXxˆ–˜šˆ¨™ª›‡º‰©x˜‰w‰‰Š–Š˜™‡x†vV†‡vgˆ†hewfjˆš¹Šº¸†˜ˆˆˆ‰‰h—X‡hˆxx§ˆ›˜™™šš¨‰»ˆº‰šg˜f¨Fˆ†wwx˜†g‰eggxwfx©…X©eª‰šË¨œÈ™‡‰‡ŠwŠˆwvweguX†g‰ˆŠˆ©™™©ª›‰ºy«eºwˆˆˆ™xˆy˜wx‡Vvwh…hx¨ehuw…š‰º‰¼ˆ¨w˜yˆˆˆ—gˆvxxx‰ˆ‰©›ˆšš‰š™ª¸Š¹˜xxXvfw‡wfˆx‡xv‡Vgw‡wy‰™vyˆ‰˜«»¹»»™–x¨x‡x˜f‡fVgeX†f˜™‰Š‰ªŠªš¹©ª˜™‰h‰‡‰vš‡xxˆ§UˆW†Wwˆ…y‰‡Wgxˆw‹ºŠ›¹Š†ˆˆ˜xˆˆh††wˆv‰˜y©™˜™·™›‰«©‹©ˆ‡ˆfwwWgx…x‡‰†gxwVwˆx†Š©–ˆx™ˆ«‹Ê™»™—w‰ˆ‡xˆgfwUfvg†h‰ˆ™‰ªŠª›©ºš¹¨Š˜hxˆ‡wˆˆxhˆˆex…fvhˆ†xŠ—vgw‡h©‹Ê{ÊŠ‡xˆ‰wˆ˜gˆvhxwˆ‰x™¨Š‰™‰ªª‰Ê™©˜x‡VwgvW†‡gxˆ†wxwvwh˜ˆˆ«ˆˆ‰ˆ‰š©¬¸¹ªˆvˆ‡x‡‡‡Wfegewwvˆ˜š‰ª‹ªºšº›¨ª˜ˆ–ˆˆxvxx‡W—x…hwggwˆ‡x‰ˆ‡ghxw››ª«º™—w˜ˆg‰ˆwhˆfˆhˆ‡ˆ‰™˜‹‰šš»Š¹ª‰˜wˆUgvvWh‡†xwˆ‡Xˆfxhš‡‰ºˆ©xŠˆˆº‹º™«—ˆwx‡gˆwVheVuWˆvy™©¨›©‹»™»›¨ºˆ™x‡x†xfx†gxw†hwxgwyˆg‰˜x†xˆx‰º«©©ºwx‡‰v‰ˆ‡‡xvx†x†ˆy‰¸‰«Š™»šªš¨˜w‡Vf†wfwˆg‡wx…wˆgxx‰ˆš‰ºˆˆ˜˜i«˜Ëˆ›¨wxˆ†hˆwffefuxv‡‡ª‰©ššš›ºšº«©ˆ‰ˆvx†‡V‡wvvx‡‡XˆXwxˆxh™ˆ‡xˆ—‰ºªºš›ˆ‡iˆwx™xw‡hvv‡ˆX‰™˜š™¨›ª©ª‹¨˜xggexwwg‡xf‡wx…ˆˆgˆ™‰ˆ™ªšw‰˜‡‹¸‹¹›š˜uz†fxvwVvfvW‡‡h™šš˜ª¨›«ª¹«¹™˜i‡WyuˆVx†gwˆxvˆ‡Ww
 ‡ˆvˆš–x˜‰ˆ›š›¸Š©—w‰ˆw™xx‡gwgg‡xi¨™š™š™ªšª‰ªˆ‡whfwxwg†wwgwˆxhˆˆiˆˆ˜ˆ™©˜ˆ‰˜z™©«šŠ¸ˆvx‡X†whˆˆ¨™‰‰ˆ‡‡xw†‡ˆˆ†G¾ü¥,Úˆ…"|í¸jˆˆˆ‚1¼ìé†tʘ0DÞû1­íä"O̍¾í´sXˆˆ‹ŸÝE#TkìÅÌH¿í—F&•ˆÜû˜ƒ­¾íÈCHT½Ý•U%l¼‡68¦SHÚºˆ‡¸Æq—©«í¹‰ˆ'nžˆFLuVìʃCF¼½˜ˆƒCeEy¬¯—'%hr'ˆîÆR7Xœ§U¹¥Wˆˆ¹ì´T8XˆšÈëµthX«”T˜üÅ‚hÙÅR†»¸{ŽÍ¸4A‚Xèܝš76‰ˆ™¸É„bxÚÚ†‡w˜…tšç먊‡F#g‹ÚëË”U8Iœ›ˆxªˆtˆÙ‚‚DÈܪŒÜE#Tvˆj«‡WUˆˆWYͨS6z¼‡‡˜„bgˆËÍ»u6'ˆˆË™½½„E8Œ—uY¼ÞƒDHõC„íý2mÍFè3n¨ý„¼¨v,ªÉeÌ«"˜ü¢ÙØÁp­h6ÊÕ&›AHˆˆÍ%£6ŠíW?Îd%+î¦S¹ý°“ìì‡dxÉ5»ƒÅUxËëÒP®Ús1‰¼8<ͽÛ$"„ˆˆÜ¿¾x%"O¿FG¿­¨ÍÉ…4y똈ˆˆˆˆˆ8‹Èˆˆˆˆ‡R6Ç£b¨Ú×qr»W6ˆˆˆ¸vˆˆˆˆˆˆˆ¸XˆˆˆˆÈ‰»W8‰®ì¦3Œ›X½ß¹ˆ6$T‰é춄h8%ŒŒ©˜h‰‰X52„™¨L¾ÍÈU3erxëÌ­»H4Tì¨jŒ¼È†XŒe7H|½Éˆˆ…uF5J»È‰ˆsFˆ†xyFG[‹ª¨gzb%jÝœÌççQRX¨Dx®ëØssv¨ˆ—ŠÊÖCg¬Ú˜duˆˆ˜‹œ»Ù´rThF{ž¼‡3G‡¨ÊÌ·T'8xœÈÉ…uƒWºË¥dH˨†g˜¸„zºÉ”uŒ‰X™‹ËˆDvˆ¹‡T‹™¨»½ˆE8ˆƒ„¨êº…‡¨‡yˆˆ˜‡…˜¨ÛÄsw¹gxÊ¦ZŽz56x…DHÜ»‹ÉgCc›©‰­‡hXW„c‰ËÈ…©¸…[œÊÇ4T„™ÌÌŒ¨¸…Twˆxª•œ¨ˆ©ˆu¸TWˆ¨×„y¬¸uC{™w8›š‰h†…uh¹—‰ˆWDsyÛ§Tw‹Ê5IÊXk­‹hhVˆ˜¸Š«˜wWU|¼¸©š†wWZ¼„ˆ¨uttGª­œw‡†„tF˜´„‡ºØƒˆÌÉUeœ©ˆÌ‹˜GZ¨”‹ÚË´ŠÉÅ4{«Ø‡z‡‡ˆe
 UŒº·T‰˜V(}˜8Wˆvh¸¨„e˜UUŒÉ˜ˆ‹‰ˆ‰¼‡T&7Š™©ÉÍ•S8ËƃXȹ…ˆ©È2u‰ÉÉ—‰˜xv„™º¨‡Š™¨ui›ˆxXœhVUŠˆhœ¾‰UG˜„„w«¼ˆˆ˜h©„hx«ªˆ˜wW„E™Š­‹xweu†ˆÌÊ„eh¥„ŒÛÈTV‹˜X­›©˜ejˆˆ‰tuˆ˜™¬­¹75uˆ˜¸Ë”CWWe‹Ë˜T„ˆxI‰„T©É©˜xˆtgœˆ‡‹Œ¼˜j¨…xXj«ÉÙ¼›‡XHŠŠˆXšŒ¨ˆˆˆˆˆˆˆˆˆ‡VUjˆwhŠ„UH»©„4ˆ•„‡xˆµ…w˜¹ˆt7ˆˆˆˆ‰È…vˆˆˆœš©º¦ƒExÛ¹ŒËÉ•yš¸vi‹«ÈÈu‹xWˆˆ‰‡X¨T8hŠˆH‰¹†eFi»—g8w—…w¹©…vˆ»¨‰wX««…ˆ¸—ˆ‰¸»šŒË‡w‰‡XY›‰ª¸V†ˆ¹˜W‹VHl‹hH™ˆ‡w¸ˆˆ‹w7{ˆVH\­†F™¸˜‡GWx†™hx…uWy‰†…x˜ˆ…‰¨¦tˆhXŒª†HH‹ˆvÉØ„u™É–‰«É§u‡gˆÊ–ˆ™xuŠÌëÄdug˜ˆŒ­È†VŒŠXHx‰‡i¬©wxFTx»Ø†ˆuW59šˆ˜‰«…EX†‰ˆxhj‹ŠhXˆ‰ˆ¨˜ŠŠ¸¸gŒªHx¬œuh¼—v¸ÈÊ„fW†wŒ¨˜†ˆvXH˜†‰˜Èu…ˆ‡EhŠÊ˜eˆ‡H†z™¨¸hŠ˜xx{©FX‰ˆ˜x¼™š¨˜„u™¨©ˆ‡¨¨™…t˜·{œ‰·Ce‰xX–‡xhw†Šº§Ux™xx…†vhX™›ËÈTj›xfZ»ˆx‰Š¨˜¥uœ¨˜‡Š«xGˆ†˜hk«›¨EH‡gXX|ˆgXˆ††GJ¨•ˆÈÈ“„x¸ˆˆ«ˆVZ‹—ˆ‹˜†©Ëʃu¹ÆgŠÊÙµuˆˆ˜‡yºÇ…YŒ¨gDlŒ˜hxˆˆF›»‡©hxƒtÉ·u†x˜‡Œ‹whT‡‰ˆ»»…ˆG6…™É§wŒ¨hgˆ†WX‹˜‰˜ÈxˆehV{œ¹˜—t„GŠÌ˜†¸˜†‡x¨¥eŠ¨Ê»ƒD¸¤SfÛø£H½¹EB›Ì¸[½‡ˆFCy¬ÊÈXŒ¹W$}§7lœªW9¬¥eH«®z6Gš„VˆÊ»„U¹™‹ŠVHº„U¨ì¸…EiÈ…›ØæSceÈ»½‹UYÆrgÚ×Rƒ»è…T™¨VDhšˆˆš‹™h5wŠºÈŠˆuh¹¹…W¸ÈxœÛ…3u‰¨¼Î›Dj†ˆÈÜédWˆseËèƒS†¹Éu†ˆ˜UYË‡SStxÛȇ›¸TT™¹¨Dz¬ØVHœ‰G
 4‹‹ˆºÌ©d6GhŽº˜»ƒ…©º¨ˆš¸UXŒË¹ˆˆx¨vZ»¸‡‡…UG‰Œ¬Ø¸e„Uh¨˜†ºÈ¥f‹x4E|»¸z®…D8E‰ˆ¸é¸…fhº……ˆÈ•d©È¶x‹ˆHF‰ŠˆÉȃTHˆ›–¨ÚÈddH¸…x›Èɤtx¨ˆ‡Š¹ˆf|«ˆgttxx½‹¨UE…g˜ˆˆ†F™Ü‰t7h•uxØØ–ˆˆWSs—ÉÌÛ•gXUj›™¸‡††¹Ú»†gXTZËX«–™89˜•hÉÙˆux˜tu«ÉUYŒ¹WW……HI½ˆ›¸¶tˆx8{»ˆ¹»¼“eg¹ˆ‡¹¸˜‡xɇxy†H˜›œˆˆ‡‚TW‰¼œºˆ•u…hX…„v‰˜‹ŒˆWU……˜Ê»…eˆ·„w™˜˜Œ½¸Fg…v¸Ë«—ˆ¨‡x‰ˆYºˆ—ˆ§uf©Ø‡uxˆVYŽºgG‹ŠV&¼‡Xª»„D¸É—wwwwŒ¼‡Vk†E‰Ì·uFxuu˜¹¸xˆ™ˆ‰•†h¹¤sv©Èt|Û¸Tt‹¹ˆŒ˜†ˆh…u‰ˆ‡‰¬ÙT3Œ«WI­šV6{›uh˨…whŠ¨ˆ¸¸x‡eX»¸š˜Xhˆ‹Øˆy†dHœÍ™†ˆ¨„eˆÉtu‰¸È¦‡ggU…‰È¸†ux¸v‰‰˜wD‰šˆi«šwGG‰˜¹É‡†‰xY›‹©xg…‡˜È™ˆª¹EX¹XI˜EiË…dXš´…©È¸v†xxhŠš¨‡d‡˜¸egšÈwXŒ¹GyŒšEH™˜‰¹É·u‰¸Ueˆ¹¸‹«™gWuˆ‰‡«™‹¸GEˆ‡xY»…gh‰˜‰@Ðÿòû ð?üíÅþ ÿAþØ0¿Ð3#‰ßOü€óà_ôV‰ú€Óýÿ…ÿ2øû êÅ	ãä'Þþÿ *çWD[ÍdZÁ3Žü_ý=å‚ÆÝ\²\3ßòÛ9ÉSÏÚ3IG›#ÏÓ&¼ÛV•$lúM·kµ3HE¸¼ˆ—ºlÈtX‹ÌEÌ4›sˆD»§>ÄÝDÌ£W¥&ËÛÔ5TÌU|u|ÎT§<Ä:”–}„¾3º…—ˆ©H܈…{·DŠD™œØVkd·UTÍË„d7ȶvDÍËÉ”8·»wƒjiÛgDwˆË·G›¼·eThËV–IÌ™‡Uj‰»Gš‹·•H„k¹H™‹¶ŠWˆzªˆZ¨ˆx‡VW›ˆxŠ‰¹©eH»Z¦i†¹ith˜»‡˜»wŠe•h·—y‰‡x™f‰™‰ˆ¸x¶xV‡whwx‡wh›Íˆˆ„Xšd#6ˆ{£$ˆ‰›Ý¬îÖ1îS"ˆÈÝÝÛ"hÿë¹sB16íÎè4k¨B#Xˆ»ßüSJŠïÄ8
 ÎÛ»R‹¶YÈC†5Ìs6̆…3UzvXÍî—eSFÎÝÙˆˆˆƒWwvfxˆ†Bxˆˆ‰xÍìUiˈh—¬Ì§U¼ÉD‡UX¬¸C6™«·34hˆˆÜˆœËT|Ì̻Ȉˆ‡34‹ÍÜ–3C$H¬Êª™…CEi¼ÚŠºvUh¼»ÍݘUuCE‹Üܨs33Dk©«¸C5ˆˆ‰¬ÞܘUUy¼»É§C#5{ÎÝÊuFTEEYÍÜͨC37ŒÝÝÉSDUˆ¬Ìܨ„3#4jÍݶD#F›Í˺—UgxˆŠ¼ËÊx™¼»vewuDCFxª©‰†UW†gˆš»¼ª—hŠ›Ìº©wfTEy¨˜vy»¥DEx™ªˆŠÌº‰‰‡x™™««†UxxwfwˆfTVŠ¨‰»—UUX‹»¨‰¼˜f‰š¼Ë¹uVfx»Ë¨d3EUX»Ë¨wfuUX›»¨˜wˆ˜š©‰ˆugx›¼¼©uTEE™ª»¨hŠ©™‰™…TVŠª¼Ê—evegˆ‡w¬Ì¶C3gš»»ª‡UUˆ«Ë»˜xˆˆª˜vˆŠ»©vhš˜eUTD5j¼Ì§UEF‰½Í—Wšª…TW›Ì¨ˆ‰š‡Uhª™†gUEh»Ë™–Ugyªªˆ‡‰«‡vx›Ì¸uTUˆ˜™©š™©†DDG›»»‡eVx›º¹‡x™‰‰»Ê—UXˆ‡w‰»¨uDUUgŠ¼»ºxvUVz«¹‡x˜‡UX«»¹vVwšª™ˆˆwgxˆx‰™˜x†ˆˆ‹ª˜uDDU‡ŒÞþ¨ˆˆ‡sG¬R=ËÛ¿Ãì"X‹íî 5ÿÙƒ>ß²|‘ˆŒÿðŽþ(Í4RŽÄ(Çc$iUßùT"¿íʈƒwdV‰‚xˆÕÎÓJÉ‹Ýt“EE½³%‹Å"WˆŽë½³LÜ͹ˆ…4¬Ùƒ"%½»˜B$ŠÛ¼¸V¼¼îµt#[íÚB"6»ÝS#[©Þì•V¼Ì§"îÉVD4\Ýëc#|ÞÉ2GœÝës"$î“"JÞË…Dh‰½Ì¨›ÌTG…DGzˆ‡DUX›Íˆh¼Ìº‡TG‡vl¶3GŠ·{Ëš¨™»¼µDx˜x˜DEˆŒÈUV¬¹zÉg‹ÌÛtDiͦ2$D½Ë˜‡FŠÉ˜gxx˜˜Vy¼Ì…DE«¼¦z»š˜SG›ÍºTTHˆyÝÔ"EŠ¼Ëux›Ë‡Xy¹ˆ›Ì¦V«…TC5¼ÆC4‹ÞÙz¸S6½Éx«‡jË…D3|ÌÉTV«¹‰»¸UzÌ…DXˆš›ªt3H½Ë…V‰º—Š˜‰»…H©x‹¸CDG‹ÜÛxdV›¨WˆTkÌ·UXªˆˆxx©™«†eg›«–TW›ÌˉuTH¬Ì¥CHˆxˆˆfxšÍÈDEz
 ¹«Ì©«…3E‰Ë¸hwgŠš©ˆdDW«º˜‹º˜š…Dx›»ˆvfŠ˜‡wuXÌÇDfx¼Ì–fŠº˜eFVy¹‡g»—h‰˜Uz¼¸vh«¹ˆwveh‹™ˆwŠ¨dE{»—h¼·UzºeV‰™ˆˆuW¼ºvˆˆ‰»švUW›¸wˆ™w‡†Wˆ˜šˆx›©ˆUi›»¨exxˆ˜xˆueV‹»º‡W†Vh©©˜ˆ¬¹fwx‡‰™ˆ†wˆ‰‡eg‹Ë¨fgx‹»˜w‰˜‰eEy»º—Vx˜ˆº¹…Fˆ™ˆˆ™š¨eWˆˆx˜‰˜z»©uVˆvfŠª˜fhŠš¨™ˆ‡Wx˜ˆˆvfŠªª˜†VyºŒ]òOþ=ÈbøÓ/ç^òà®â½<àÿÑZô`±übç.³ýBùìˆ+Ùˆ„ÃÓ2WR,Jñ_RãÃ_¼"Þ’ñÎ6ì-0Ï–!³ëCò|·ú-Íø‚^¸ˆƒÐ’Q§Þ@Én’ÜTÄî1–ýÅÞ+…ÊZã–ÞS|Æ<ü¯Ã›ÏÙC͈ˆK#¼C2›ë"¸Í4ÙH¬å2]ý‚;ã»x»L·b&êB&„]EÜÞ†‰ï–;»˜ˆ„(Ö5Ô$ˆÈ;µM­•3®ûB]Y¼KÔl¶#;×2F»uºLÜ΄ü…x¹ˆˆUK”R&Í’7ŠµLdÌ»…5ßÕ3ǨÖmT½c2\µ#ˆºXµ½ËíEÎ܈jˆˆ†„‰U"KÌBX‹”ˆ[Ù‹’ký¤7{gÉGËB3œ“5z¸Y˜Í½åLìÙ‡˜ˆˆ……‡S#›©3x›ev½¦»4ŽÝSe˸œt|¤35«cFŒ–X¼ËÞ´½­ÊjˆˆˆW”ˆB)‰¦Dy¨UkÌ[´GÝËE<ˈÇG»T$H¹CX»…Z̽ëwØݵšˆˆuhf´2WxµFŠ—E¼·«eM¼ºSœÆ}t[´D5X˜4‹¹U{ÛÝË›ŒÝg¸ˆ…wuŠS3gˆ¥I¨„ZËz§e»Êš7ÌXÉE¬DEDYvF«•W‹Ýë»ÄÍÕ›˜ˆv‡EÆC4Yv§j˜E«¸ªwl[ª”|·‹µW¸CeDˆfX¹e–ŒÞÙÌWÝxʈˆI„Y´D4hv‹™uIº‹§ˆ¸Y¹I¬wÈx†—4eDˆf‰§YµÝÌԫ؛Ȉ…ˆEx”SFXeŒ¸EŠ˜»xœW[¤lÇ|h‹…e4uE—X™‡Š´ÍËíJË›·»††…Hh•CUwV¬¥W‰{¸ŠÈT‹H¼ˆ¹Y»dUCuG‡j˜ˆª¦Ì½ÙœÅÌXØfˆT‡h´Cueh»…ˆwºˆ¼¦F…Š¹‹•«¸TU4eX†‹x™©È›ÝlÌ{Ç\Ç[eWgŠt5efx¹‡…{¨‹ÊutY¨
 ©¸ˆ»†dU4fY‡‰Š¨œÅÈ½È…†—U‡gªT6Uwy‹‡Vª˜¬·Xs‹‡»ˆ|·W•5C…y‡˜ªˆÍ”¼«Í‰ÊxÊx”hv‰¨DEGw‰‹…X©™Ë…ˆ7™[Ȉ»…y„DCg¨x‹¸ŒË…¹Ì»»¸º¨‰G‡x™¥DDhwˆÇU‰Š«©itkUœ˜¸ÇU©e5C[ˆi«¨¼«¥kÚœ»«¸Š†J‡yªeSEvˆ‹¥Wˆ›¸˜—E¹FÊ™º†h—eDBº†šº‹º¼“œÈÛ›¼†©t™‡Š·UCHwx»Uwy¼†‹„Z–Y‹¬ˆvx‡fS4šx›©»šËE¼ŒÊ»ËX§w˜ˆ›…U4hhzÆgvŠÈgºE¨x•›ÊwhxvgSCšˆª«¸¬¸U©Í‹Ì¸hjyˆ˜¸UT7vˆ¼]ðÑòp"ÓñùOR?²/-Ðàì‘}ƒñôùÿ˜ˆˆˆ.…Ý/ÂÓ÷übêÃ×+
+ä	}.L­âÝüôPÐÌ#{ò7Ý*^¿æ
廤ɐN@$Öš=Ï9ßã]¸XÃBBZÒÕHè"îA}l½ŒÊê{˜äíõL숈ˆˆ[Cûm9„Ý„-ú4µÚº}rȈˆËÒŸì›ø…4Ä1Nä;ÈHNہ¿ä*Š†¥È!LRHĘ½ÎhîÚkˆ„zCË2Y£ˆ‰¼7þcŒ¬¨Nã$º"­˜‰Üø^¨ˆˆˆˆUR)–4[E]ÉÒ×3Û{¤¸17´ˆˆˆŠÏ¥ìû=˜ˆˆˆ2‰³GºFËm#ÝÄ;·ØH”"[Cˆ—‹Üí]®µØ…4vƒL„«„Œ×Ô-î³Ý]sºC4«4¬BÎڹ뉈†U†"9›W—:ËYVÌ«(ÕË4ƒUGˆˆˆˆýܾ˜ˆˆˆˆˆDE7Jtk™¨iª£¬ZUœ5SFU›WˆÞÌ´ì½¥4ÄLD3¨|†[Ú˶…Ë[ÕÜ•T3‡G¨j=îËŒ¨»ÕKEhCDS¼¤J{ªºceË}‡µ„H%¨ººµžÞËÙˆˆˆ†e‡3WDÊEˆµ|¤[[ÈŬdBEGxˆ‰¸ØÍ­nJ×»WEÅ6wi§¸Œ¼ÛSUYzkÉCBTUiW‹ÈέØ×nXdWyCDw‰¤5Ǽ§t½¹h̨e3FǻɮWÙœ|§È‡Ge—2Dw‹¥LÈÉj6µËˆ¸YD$Wˆˆˆ»^Í軍ɵ†k¶UHz‰Dfl¹£H[¨|D…4'ˆ‰Élةܼºº˜Hi”34fšØk«¨«X¶ËŒÌj„3*„gˆÜÄ]¼»©Zt‡ŠµSFV¼Ux¼ˆ”k;»…C©TEˆˆË\͵ìÌ̸ˆˆˆˆˆ2F¨´UzÅh6¤‰¼™‰…D3·z¼©Ì;¼Ú˜7¸™¬Çd7H›‰¼‹ÄŠ[YÉUTVb4†‹¹k¶KͬۨˆŠ»e3VˆÄekÄE&ÆÈ­Æ‹•GT[¹¼Ü»µ\Ú؈X‰g¥DD7‡Vg‹ˆ¹—[ªœvgf…C8z¸GˆÄ¾Í̸»ˆ½§ef­T˜x—uHu¥X¦†UUECˆˆÌÙªGÝܹFÚ–fUU3d8ÊÊy˜»j‰Ü›‡ª‰U4h»Ši·E­¼¦L˜U§Te»†gœ¦—Uf»ˆfxTCGˆˆˆ‹Ë¼›Lý˘ȈˆˆˆdUhvdHgdx·—……‹¨fxUÉ«vŠÄMÚÆdE‡‹¼hX™˜ºŠÈy[ˬfueeVY•#™¸ˆªƒÍ»›«»yËœ4hFh•XWSEY˜Zª‹©‡œÇ;˛̺jÌ©•Hº™©C5Xfxv•Wf˺ˆ»„‰…E—t:¥WH‰x̽ռ¼Í×TX»¨•j–S6©¸f…ThUw¨³HzȼÊ\
 ÛÉV¹ˆÉUSDTeV§ˆK‰Îyo*øn{¨ˆÎ/A´âõâþý·˜ñèQIááãóLûâ°â¶GˆˆˆˆÅîö>숈ˆˆˆ0þ0_BÁåälø)äCÂÓ"¾ˆˆˆîrOùÜLbó"ê3ï–[Èâ~¹[ˆK4Â|'‹Xˆž²ßâOÝ=[¹9Ê4»I*{r\Ã,ejÄxˆˆˆŽK~¢ÏôÍlyˆˆ:É-¹2="½Ò.Gw-sä6¸›Ì"~dݼv=‡=æ~æKŒ¹=[†¨Ds7R(“{»ŒÛÌ$÷3ÞɈ\qNä¨Ù+»Ê'mBŠDR7xˆˆˆÎÈí,Û¹´B¥\TŽÓ¼Þˆ…¸ˆˆCsE!XˆˆÇÛŒå(Ì´¼S2hˆŒÉÍFîí¨ˆˆˆˆˆ‚5!9vˆ·ì½äjÍWÜDs“\ä|J×ìØNËE¥C3¥#x¦\ÖÎÜ;ÍyÅK„µ1DSi̾ÝÕ͸ˆˆˆd23§2ÛzˆÌC=×<Ü›U¸3Ü2HˆÞÝͼº˜ˆˆyR"w[Æz|؃L{œ»¼·U4Ò8E4¨¹MªºÍ„jÉT:Ó\¬Ë»[T{WXÜ›¼µH‘uZlu”ŒIËÛy©Se‹dÎcKØf#EVkÛ¼»ÆÎB—µŒŒ…†4ˆ¸f»æS\šÍ‰­„ÆEUdK˸X‡Í$l¤¸‰Ec3Wˆˆˆˆ¹Û˾©Ü›µF4†|—»—[É"Î{º×†ET4c3hˆˆ¼èÎt݈TSE4žË¨§œ¸3ËŽ­Ç—§3Ub5DhˆˆÌîm숨tFX·XºhȵËŝ¹T…6F„CxˆˆˆˆÌ¾ÜÌÛU5Z{Ý„Lȳ%ºˆÜ†kÈHTCC3Gˆˆˆˆ½Ì«†{EM¼É™ÜV³UÌ|ƈ›•GydDDˆ5³z—ºÌ͵¼H­¶‹wÉ}D2ǽ›cEuEkX…;…MÇxSj¸½«Ì4ÞÉݘ¨ˆ96ÇÉzx¶”df4S\•Œˆ¨’8Gˆˆˆˆ¾¸ì½Ûe['œÈ¨I§Æ„„TTªF̺\“—Ct7™¤ìÊÙÍØx¥%kxÄWDWYÕuE´kÊÙ¾Bˆ{ƒEGUݹììÅ{…UØhTŒU\8„UY…»”»¸D˜uDDXˆˆ˜ÝÌØÚJ¥Ç«…uv¨Y…F¬y¸‹Œ”tWˆ—T‹¥Fd»Í¸‡G‰µVf2fé–xµlÛ‹Žvt8hšgÌ”›´¨˜Z†»X¼¨ew5©—eZ¤Ì–¹ÌgTdDD8½¼Ë¸ª¤d8Ì´‹Š¬Ä)¼ld]WÌŠ‰ÅËtcx„G½L™Ù›¨T$ˆD§eEt{Êl—»[ÊzŒÆØg„¸d‹ÜIiÛ¼¨TX–"d‡Xc‹Ü©´¸œ¼tkyØD
 SwTšÛ¬ºµ{ËFœÇC3CX¦¹ÈjÛظª‡ÊFÇf„Hx¼Ø{ÈËXtU­¦R3BFˆˆˆˆˆÌÌÇxœÊÇD‡jy½åÉˆy…„Œ—BETEED‡‹ØË«¶É‹xÈ4d${ÝìÏ"ðˆáüRà㥈‹_óèæ/#ð,~&òßN¹ˆˆ1Å´½òŒ£/"Ó8‹YóoSú…µa‹Mßœû˜ˆˆˆˆ9Â2¹/Rä[;4òZ*L×þ.Rs3HˆºëïNÃÓº<„á=:äîLÅ4¼<2c£Î]ÒH•J¤üMÎ˜ˆˆˆˆ&‚yxŒ[÷]Ø·Â¥GˆÊ¾cå]N[èÜi˜ÈˆˆˆA²LVkìåçHB´47ˆˆŒMûÄèm3FÜÞŒ’¤8RÕJ·ËÝθˆBš$!hˆŒ¼öÎœNR¹»tW[+¶ã"UfÃ[lßÄèk¸&BG5ˆ¹ß¿èˆ†FÅ¢+'kÕÙZ„6Èk‹Ö„­LÙÄ5swˆˆÜìU†lX;U‚…ͨèÝe4Ù·$EÜ†C—5mf¨ç†¬åÄÜ2&§#7ˆŒë­ÔˆHºw·„xEÄ«¾»‰¬KD\¸»¼2G%CÖÇÈ”]÷‹ÝÅ6m4%fÝ›¹ÍK´ÄÉÇT5…kv²\®KV~¸Î̤[6$ÆEUVHϼÝÉHºˆB43‰”‚hˆˆ‹ì»‰T¾¨ÕŒ$IÃxVÎÎéˆyˆˆtEDS"WˆÉÍ:Îæ[[¼YµSE6C«Ëʉ5ëìˁKJE#6·Í‡k­…ÍÌÔ…C$Ö¸\Ã\ÎÎTVÊ؈„5%D”‚†Wˆˆ¼Ê<­Ö4—•{ɇœÌÛˆˆY¤9+}–4Ê……l¼ºf‰F£½uEddjÜÍýÂ-ÝYjC8¼C;SÈÍ·ŒcdWÄlÈ£Xœv<ÊÌÍê:YÊŠˆ‚#DSZ‡ÝÚ(¼ÅGƒ…H“X—š«Þ›ºœäf½Éˆˆc<CUgc½zšÛ¸Ùd22TxˆˆÍ¤|¾»ëH“½j…dKµ”DTÊW^îÛ”³:R5SdXˆˆÝÝÞÇxeµeK‹lÃ58ÒL‡œiºj¦˜dW47ˆˆˆ¾ïì;yÈ[˜S78E©ËúGx³¶[ÌÍ¥44[$iF¦ŽlËÌƺ¨Cƒ3\ÝÞ벘}G¸ƒCJ6ËȉEƒE„ˆËßÜ¥T:´6ÃE\´‡ÜÌJCSD8ˆÏì¸(»ÃiÅ5K´œÉ‹hDUiEvϾèˆTur%¨8KżܻtwS$8ˆŒËíÍBkç\Ùd;Ì•»¥B5CHdˆ¾ü‡”$x3(Z›È̵‹e4„X¼í¹‡hÍ3¼¼K¾Èܘ‡eB!DˆˆÝÌíÌ:mS¬§$ft·‹µdETd{
 lÿ뻈RIA'©SŠÌÞ숕iRH3:Þí\ºR½„8Ì´|ŒÌ¨†32C(ˆˆŒï<ݸ-D#¨ƒL­ªÍLJteUµ=îܨˆˆ-3X†y‹ÛîÆDcECWXÞÞæKˆeŠb[d†Ê˼ØC25Dˆˆîü‰§”uSHUw‰Ê¼ÉY³4DhyÝÞ舅†#A4hˆˆŠÝÜh„5tFŒïϳя=Šó=\-Að>×&∈.öîiÉ…¸ˆ1ѽ'¿òÖV<=äïʈˆƒÕ'ĈºïOâÔ&S™®û퉈ˆˆ40äÕíOÒÕ5ˆˆˆˆïßʈˆˆ<1aåÍ¿ÄÄ%ˆˆˆîß鈈ˆBWïÉæS6%ˆˆˆî혈[PƒjâϛԓRˆˆˆˆŽÿ눈ˆƒ6ÅÍ9ÃQÔI“xˆˆ‰üËäí&ƒµg}<VÈâÛIDƒt›;’IÚìKËÍèg-E+„è[t3£ª(6ˆˆŒŸ½ß¨ˆˆRsÉ]<›âË]%xˆŽ®Þ숈3t´Í©èȈ!Fˆˆˆ®üÛÛ‚”#·È{ÌåèˆDqWˆˆŸïꈈu…"TeÚÙéAT”B8ˆŽÎëÍXm5WA3­ÚïÊ3\2C%xŠm|ü‹¿K•f at MœÝ똈C3T›K\ÕÝν‹“BW½é=î329HÜE9¨çï͘ˆ‚<F3Ò\Þœs%™µd&Gˆí®ÜŒDÌ<¹`YíˆÌ45¸s$8ˆˆ¾¾ÌȬ½[ƒ"¬Jƒ]؃ƒV6Kœ½ÎWºÍ؈‚-sI\Í×AF¦:¹Fi{Äîí݆{ˆˆ;¾«³"3U•uxˆˆîîɘˆˆS½ÍTiC5Ë”d8ˆ‹ìîä¹Øˆ4[1½©[‹h”S2WˆˆˆïËÛꈈXš‚4¬yi»138ˆˆˆŒíîŒIJ„qÝ×½•0Fˆˆ×¬Ýê]juZFÅ+ÜÛ4B33xˆ‰ä´Þ嬌ČD›è2íµ3VB‰½å5»Ôi¼ÙÜ9›ÍÈ…YR9D4¥œÄ5lÔ|µÊ݈Ê»¨rÅ4[ÌÞ“$MÄW…”ÜË˼ȜºC"”[îÝ“"7rW¤hŠ›ïÜتE…’ ÛÝïs#C£[Ãe®‹Üîǘ3%µSSÎþÉ3X¢$c„K»ÝëŠEG4™ÞÍʘ7WR42hˆŠÎÜÇìU656﮸C%TxBBž{½ÜÄkÃF4H¾ïɈ"\UxBS•Z¼Ê¥‡lÈEŒÿ|¨ˆˆƒ{C8‹†½Édh”<†¼ïͨˆ:—6…\¼x¨XUSsˆˆÿ쨈[ˆS7"-Ú[ºd3txˆˆÿùˆˆˆˆDF2$¼½Í¶2B
 HˆˆˆïýʈK¥&º£6ÄŠÌ´S2&ˆˆˆ¿ý똈ˆCy“\•uˆƒd45ˆˆˆ¯ùÞ¹Lˆ3d5¼ÈÌ$T33Xˆˆ¾ç¾œN¸4ØT<Ý»ˆV"C#xˆˆ®ä®|^iD¸w‹›½¹UB23{YÝÞÕ9Z\©'¸ŠÊ¼›ÜUs#1hŠîÝÓDh5§|›ÍŠÜªSXsH"T‹íîæSx#BZ\έܺƒgEFõþøˆˆ
¢x‰ùóëAŠñõÿÚ"òóý//5àðÃ-,LÞÿ˜ˆˆ[µâþÎLãñB>OÞ˜ˆˆˆ"Xë˜Îg3,ƒˆîäÍΨˆ‚TarÍÕ¾¼CÀbHŽ.,þóøˆˆˆ"Hp£Xß?ÈÁȽŸïšˆ‚興"KÐÐÕê*Iuˆˆßÿ˜ˆ„£“´^;NÁ3cL¬RFˆˆ‰ÿˆ8Î݈%d7ˆˆˆˆ_Ÿí˜ˆˆƒ=ÙäèSh7ˆˆˆˆÞ?^ìƹ‚,.߸ˆ‚hˆˆˆÝÿ]\l˜ˆ"¤(½ëÃÃq5&ˆˆŽüÛëteËBDä½…¸ž‰H0"hˆˆÜüÝsZDN®¤ÈƒQ¼4EC8ˆˆŽþÍ؈bP<Í}ܘQDYÓ4«i†èÌúMW«@)¾ØëÚH31tÓ:Ž\¼œÔÍRíAf½„þ˜43XˆˆïÝKÙE^TqIí=¼5ì’„5ˆ¿ëý˜ˆˆD øŒÍB僜4®¸ÙßÅsEGõíèÌ‚5!szÄi|ÌÎûÚˆˆ†0q·¿û8³H‹¹Ý¾öÙˆ„]ˆ2 Å‹¿ˆW5ÓTcˆŒï³ìœZ]JË€ÜË´"\k0Wˆˆˆ¿Þ÷Ȉˆ!¾ÓC\H43XŒ•}LÄeïý¨ˆˆCDÎÝIUBxŒeˆˆ—Šÿü¨ˆˆˆ0.þ¨EC5xˆŠŒè¹…¯üˆeÈ0C¬Ìéƒ!cˆˆŽêu¾íHN¹ˆˆ‚tAÿ£UˆˆˆˆëÙì³4Nþ¸ž¦3<¹C“s4xˆ¿ì¶l«S®é„‰UQ1GŽ¸fZ{§kïùˆˆ%yúÍS-e2ŒÍ»wBHˆïìd,Þg5ϘˆˆX‹ëVM‹ÎZÞˈˆ† '¿ýTc8ˆííŒÙ$ßùt%SýÛÈB7xˆìm¹ÕK™ÞÛˆƒ…9Ïý1chˆžßí¹ˆ@'¿û0É„½¾§­¤¥!HÿÙE²V‰fEÈÊ &ŽïT"³lÜÍÜÜ·˜Q_ÝÅ1Å…8n»ÍŽ4þăÄC8-Í»”¸Wˆîû³×[~><¹ˆˆ0jþÈ1DxˆßÞÙˆ‚ /þ¹3t5šmÌ–B‹1ˆˆÿý•dTļµÅC
 ‘XÝuSxˆû~þ˜ˆˆƒû´"ÈzÃ;›z“ìÔ<ÿû‚§i¬KÆ,²Û‚ˆˆˆ—Ý^Ý|ÜȈˆˆ CÞ¶S[Yx7ÝëîË…!QüìÅMET9冻64ˆˆë»¾¨k”Ý興ˆ2¾´2ˆˆ‹µýÞ½¸„4¿íƒ4·ƒ…½D^WÌCtŸìc8ÔGéÍ\¸J‚!ˆ—ˆˆŠìÜÍʼˆUƒ9Šé&TZ„3]§Í©È„G:ìT8îÇX[KÜDR1GˆíE¼ŽÝÇUʼ¨ˆB"+Ì4UWˆ·ÍìÎlf33¶ÏëJ,Ö+ÆŒlT43C|îSH5Ùݺ߸ˆ„R;Æ„XXÝÝØÍÌURSµÞfÔ4ÜX‡k½»…T…KË¢4j¾þÛW¹fT#%,ׇ™xÜ¹E¼YwYKLÅ…$\ëÉÙߨ†3t7‰L8{tíÜD^sR2„ÈíVŠ8´ÜÜËm؃BdUÜ"†5ˆÞÝìŒÈ…"Kx˳b'uMíÛSçUDnËsU4xÌÜbÅD"<»›‚;VËžîË£ÌZƒ<ée‚%È[íÛ£^vT\ÙÇTJhŠÊ媃Wc5ë˶F¸xÈý܈L…„"ÍT3#ˆˆˆßíÚ%ÒtEß»d+ÄTˆÝX·"“Sfî×Y3IwÌï݈†„5B}´4#ˆˆ½ßî§5XD•¾Û3‹Uf¾Ëe2‹–ç%SuhËßÛˆCuR˜N„Wˆˆ¾ÎüÉCCu͍»"Bµ§½xÊÈR[|kÍú"3e|©]ìÈAŠZ4iê26¼MÍî눃…3{»ÛA4Œ4]¼ÚZr­UܽÊB3E)ÝÎÕÌSTI‹kQC­Æì¼ì¦19D®–Ûb1mÄܝؚSŽw©ì¸<§lÌèTDuzºÖQ6NÊŽÊÕf3mB̽ÄD5~Í\ÙÄH4MרE×3$EÜ¥ÔÛxgž»¹Rè2%½ëÃ×Ëz2]–ESìs5®íÓŠ†5FmLj”½A%lÌŌܸk¾ÈwB:b#\ìÛYµWU<Ê……Ë×5žëÈ#¶DGíµbE£$kí½B͹»¼Ûd2$E5®ý‡RzEˆ›î„D‹U¹íiA&D‹Üë‡C7DeÜí½r=ÖºÇÌT"$fÅÈîÅT&…ÍÔ¾w4F´ØœÍ”Tƕ˽‡35Õ¶­ÞÈ„ܼÊHd4Csª¾Ù6cÖ|Ýl´23»½–»Ê…@Ì›½‹¸SbLÛÛÆDB›ÌxÆBD7]ۜݓ4\Ë»S‡US+ÌÝlÅXU,Û»•©VzUxÈ[¼…58ÝÌ’8…Zu†ì§}É…tˆV·DFwTÍ臺˜»‚l¸gZÈUC*Ý´ŠÇu³¼ËÆ3Ìt…H¾
 Ü©ÉDDKµGcK¹s+î»»˜Y¸%̹cI‡ˆ3ØŒÍ³†9͹B:ÚH„º‡‹Ö“4yVYU½—D¾ØZ¼»ÙrfTEGÈUT]ÎwŒÜ¶SVh…4ÍÅd;mÌxÌÇS[•G•ÅB<ÞºŒÌÄC$†DU¬´eX®ë»Ý´4:¨™d[´4w‡ÌÙÍÈd'Èu¦Y‡T4ÝéÅ­…V"‡wš­Ç5t­ìÈ^ÉDB‰tVKÊ#uŠËí¾¹UBYukÊÈESlÛ¼­†Er:uª‹ØC„[ÝÝÅÚDR%†wfÛS…ÝåÙTD¨ˆªÈCC<ݼèËTi$VW¼ÈDDLÞÞØYSE"wi¬Ü—4<ݽ܌”D1¹xŠ§V#hÎíÝÚ†5Agf­ÙG2XÜí»¸c5RXšÜÛF2HÍþ»É…D3$W»©U3ˆÎþÚº•6D+—‹É…"4Íü¨¼†Ux4ˆ[«¦4HÍîʼd3DBWŒÍ¶4DÍìËΈŠD3g©{”"6ˆíì¾ÇUD!IÜÍì4$lìÛ{µD3DIÜÝÖ"‰ííÞ¨XC3&«œÈ24ýì̦#CT8Þ½ÛB"‰Ü̼ÇDC‡DÌ‹yC4ŒîÞ̨dBC3¬ËÜcEŒÜÉ‹ÖdTV4ŠªÌR#xÜíÍÜ¥C43H¼Ý¥TKØ̬ÙU3DDKÍ݃#5ªÝÞì¨t3#(»ÝšÌt5Vx¬SE7ÎìÌcEEÍÛœÉ12$ˆˆè4„hÎÿÚˆˆtJÙˆˆˆS29¶Xt3xˆˆˆˆ½×ÍŽ†Î¹ˆˆRi‹ÈT1'EÍÙ™‡TÊEÛ½û«•E3™‹»Šf„8Ç[´H…eṲ́«eUUTidhCXˆˆ‹Ýí„UZ½î˜ˆB…5›”HsHƒ\ÛÜíÈXS\ÌÙˆˆƒ"IŠÌ—SC4ˆ¬ª©WËW̙̉º†kµx™¬˜c3DŒ¹©uCFˆ«½Ü¼Êˆd4˜«Š†©T‹ÌÖJdFŠÞÚˆ…!$4ˆ·Š¨ˆºŒÍ½Ûˆ‰t[»½…EB5x¹¼S38ˆœÍîÊË3UEÏ興ƒC#ˇU2XˆˆÍÝ´4XªÝÌËTeh§Vv˜iÌexfz…k”[µkÅY«»Ë»¼µy‡ewTXT¹xÌšª„Š…Z‚6TH¸•‹…¼·|µ‡iÍݹ¼eTHˆ…TDI¤[·U…EÛîèŒs\Ùˆˆ2"$k¬Ý¸E˜hÍÝÇB"5|íîÛe3E‡jËTD5½»Ë¸DÊxÜdxcLÅ9Æ6ˆ›ÌÇœ¥mÜȈˆ…"igËTe35ˆˆ˜xˆ¼˜˜Uuˆ½Þ†¨ˆˆ‡3"6‡ª…Dh‹ÍíÜÙDŠZܘˆƒ!6­ÝÜC53Œºˆd$ˆ‹îÜÌÈhs3uH»
 ‡ÊtV‡xœÍÝÇECF…WeETzªÎÜÌÈXÆ5«g«˜wºiÌT43js7eˆˆ¼Û…v‹íˆ3gY–S3EŒÍÌ«ƒ$T\ì»ÜSi†Îܸ…3Uy©wUS#hˆˆÍí«º›Ì¨¸23"hˆˆÛ›Ü˜Ì»Ý¨ˆƒ$…;î´42ˆŽîÄZƒ\ɽÅ3š‰Þʈˆc52*„‹·Wºd½ºÜ©ˆ¼e«SW3k¸›¹ˆ•¾Ù›B7U‹º™ˆD»«¼Ýµ‡2D2Ü‰ÇD…IÝìͧG¶7†CDBH¦œÝÍ«·DS8ÌÜË…gt½»ÌgS&…g˜TXd|»ÍܦŠ–{”4¤4f5ˆˆÎÜÜ™ˆ˜Txˆˆ«y·D¦DŠxªw†U˜evTz»½ÝËÌ…‰uUeV¹VºD›ˆÌ¨ºS5fY¸x¨EW«ÝØh…D½¬ì”D235{Ý̺‡4Vœ¸Uv‹Íî؈ˆCHx»–B3EŠª»´6™‹Ü¼ÝdVvz§W¦V¬¨ÍÉ‹µ#D6Èx†C8ˆŒÞé¬ÅjÊ›–S2$EyíÜìv‰3WxÌ–S#G‹ÞÞµxBlËÌ»”HC<ŽËÊ5d&ÖJÉhCGsµžÇÊš¹XÛ͘ˆS4"kf¬wVœµžæmÓ3vKÍ웶4vj†hCT#ˆˆ‰½ÝƒkGÎý‰¹S¬U»t33#xŒ™ökÔ*ÌŒüˆˆ#|Úßë32½Îí‡A·]þÜ¥5Xݽˆˆ43W¸ˆ½¥}ælìšÌC8Æ#È2Ž„ŒÇg‹ÆJØ"ltÎí̹S4×|예#•D\HD—ˆ¼Ü]ÞkÈ‚7«H¾cTƒYÞÞ«„!¥LÏØUR#GÙÞ£lRNÈδChˆˆîý“'‹ïþˆ…,ÌÝë“5”-ù5ì3ˆD3Yµ¾üyc®îúˆ%ŒüβSnítEH†g¸EUCEÍÞí·AXˆþï²""žïìˆQ„Jݼ†œÄƒ3\ïȈS1?Þʈ‚ ‹LþT„ˆˆËÏöLÒ&¸œÞȈƒ Fˆßîs#ˆˆÿý˜„™EÛˆˆˆ‚"E½ÛœR"8ˆˆŽ¼Ì2ÆUîßɈ‚*RßÖ«b"wˆéŒÔ\µÞví³¬2¹¬ÇM‚&@HˆŒ†ì5¸(ÉYìíç­3®¨˜ˆ‚W~þ΂2}ëï³u#¬5ÈGÈK×%cWÚÏéDRÍÞýµFsm鈈R“Wé7‹%ŒËÜÖ¸Kx&ÕTÚ›w&2XˆŽë6Rhˆÿü¹„%ʜʈˆˆev";ƒ:Ô4hˆˆÏ…É¢¼ÜÎÙ2D•Iì4…3LU›ŒÆœù[ÍCÍTܧjb=3~²]B-dÌÄ…[œ}ìx’†Š»(ECËÈë
 jE^ƽ³TE¹¬ØJ‚Ú=ä7²+„HˆˆˆÜË3ÆËß܈„DØ«¨ˆDèXä3hˆŒÕÌ‹ïZÛˆˆUÉDÃ!3\ïÈU!HˆˆþS4GŒïíØ‚MÆ<ÙE¤Ä[²T6îÚµ43^¬ª’4Êœÿ³I2Ž»ÞQ(xÞìƒ!~þû„míþA%(‹þ…´ÎÌï‚u®ŸèD¡HnÝ5˜wDîŒÛlØ»ˆˆˆˆ„5C$*ä&µˆ‰ý#…5yÝîÃ+Ã|︈Q$¹\éÔüîÚI¹DÌDC3XíKÙ!$«¾ëR2xˆŒýbÓ)ÎßꈈˆƒKMBÝǸV]î¼ÄrK¾Ýë”"X¼ÍTd!Wˆˆˆˆˆþ»Ç$—Þ興!tKï·T3"mÈß²;Q>ØŸä:³3x«Î„GR$˜ÝÝΚDw˜í˜ˆ‚H"ÎiÝC‚ˆˆÎ¾ÃC„]íÝ„UH™Ò#RKǼÌ9YËÚä;•+¼½èu¸dK¨zblÔyCX1x‰½ƒÌsÌÌÿE4[¼ÿcS#®íèˆR!8Ìݼ¨CFSØUÝ[„4ˆ:ìŒãÄ^þ˘…A7u§%Ç&ÞÖX©TD¼¦†lîK똈ˆˆˆcFA7SXˆˆˆŒ·¼»\ÌËÜ„ÍRlxyy¨‹r6£*•\”Z„ÎÚ¼Å9³<ÜX§ZͼÈC2fîëÈ!%hÏûÚA#T¾ÝݸzDj–ˬº…$17ºÞÙ{2#W­Û¼BdH¬Lî·ÝÅÛ•Uz5¾¹ˆˆTB#„5µkÇkí˜í4ˆ3:ܼÉGt6Ìk¹†™ˆ¼¸D„6º©¤SYFÞÞÛ§D¦6ÝDÚB|ǍÚ3TAI5ˆˆˆˆÞ‡Ý˜ÌÈx˜#ÝSδk„]ÈD‰¤725Hˆˆ‹…ˆˆ‹ìÍé4œfÍÉË“L·»ˆ‡c"yX›B5xˆÍ½Èu{ÉÎ鈂t;îÜÈTˆbJ3HDˆˆˆÛwÈfÍÎí¸ˆˆˆh¨ˆE”3‹DLCEUÉ«yœ—™ÛÄLÍjeFt6VÌ‹ÝȸkÚVƒ#b9¥¸­—ªCHWͬ݋ÊYºÊˆˆ„7#¾s«3U$‰hˆˆŠÍ¸½BÚ令d¬ˆˆˆˆ‚4hTˆˆˆœÍÊWY˨»Ì˜ºhÇXˆgˆe‚4“LÜ|¦D§¼íŒtDdCkº¬Í•xÇkvk…E¦]ÕKB&thˆ‰·Ì½î»Ùd«™ˆˆˆCb(ÚŒÅT$XV¬cHˆˆˆˆŽ×®Úݹˆˆˆ†¨"e$ˆZÊD–mì‹„43›ÞíÌT5ˆëˆˆC"¥#•XˆˆŒŒèMÖ\ԬȇX«HÈYØ]¸x2#C¼«ÌGÈDÛ4–5ºÌÃVDlÍÝÚËSvW«˜X¸5ŠT‹”
 ¾ë©DXy¼ÆRWˆˆì­c{ÛܨS33Uf½•j¦|˜ݥuC7X­ìÍ„G¨¬¨Cd!4ˆˆ§y˜ª¼Ýµ‹Uh„™T½žü¨‡"$LïÌ¥2#KœìD§CˆClÉÞÝÛd5TLí»“78ßéÉSC5H»¶‡sEhˆ›ïìÛ•ˆ¸…gB#CZÝ»¥SGËÍ܈SFºÎåZ¨EDx…hËyS3%ˆ‰Ù›ÌÇ­Ų̈ˆ†237tlx¼”U˜‡ÌÍÜÅ4SHÜܺ”GdŒÝÆT"#HˆÞîÛƒDW­Ì¨„"Wˆ‰¬¦™†ÌÌÞ눈"#3k¼Ý×xÍܸˆˆB$hheCF‹ÝþË„$XÞÛuREˆ›¦WˆˆÝÞˆˆ…S3Ud[ÈeW†h«¼Í•d4·ìÍÉ„D3zÌet!hˆˆ¼ÝÍ݉ËTUTkÛˆÊB5TZ·eT5ˆˆ‹ÞÜ•‡h½»ÌȈˆˆˆ„3RE™ˆCEˆ‹ÜË‹uLÜÞʈˆ4V™ªeU"6GˆˆˆˆŒÝȝ¹­Û¸ˆˆˆˆˆ3C#xTÜ3ixŠÌ΢š´W¸{§YÈUËIìCX":„Ïص3UKÞ„WBŒ1%xˆËüW̦X„ZD¹eeuX̩ܽ–“DCEVi•‹Õ;̾þ¨ˆˆˆtD…#D&ˆîÖUR5X¾í‹Ù2e8ÎËÞˆˆˆB3#«U\„kÝÆ]ÅL¶œÜθˆˆuS3EDX¼–…Tl¼ÌÉDC[º­Ì¹šˆ‰–˜‡z»[ØEs"UDÎʬ¸»´8tk–¼·hˆºØ›eC&¸mìuƒ"Œ›ÝÊ…E{ݺT34›ÞËËdy¹‰d„%Û„™5½ÍܹRET½ÍÌT‹‡ºd˜h¸½·›bWCK‡hV™XË[ÈŒÝ͸D24WÞ»Ç$ƒ7ÌËÈ5uYÇλ܉´"S)ÝœÜH¤GeÌBvCl»¼º˜­×Ã44{{݇d$¼œéYS9”¬´y¦{…Z˜†œË̃ZDŒØ¦CCX»ÎÕETmÛÌ”D2Ü¼¥DX…«”EWŒÜ̦C5«œÈT2E›ÞˆxCG¼ÞÌ˘h„jƒ8…k¦¥2L·Ï×iB%ˆ½ÝØ«Ûx†EuݹˆƒCˆîÙ{!HŒþìÈ"iJþ¸„!37̝Ûz͆»ƒ$T8È4–ˆîïÙˆC#ZË̳3„IÙDhU›Þë¼UY›™†c#DJ»º¼Ì»ÚSw4¨Hºh„Z¶H„Jˬܺ¹–Š¦UCLÊÏȈˆ…#6EU3ˆˆˆ»•xº¾ýÌ’%TÛŠ•X»Í¸…C"HxÝRg4hˆˆÌÝÞëY¤DGºWÅ3ÌyÞ•D"D‹ÆWdH½Þ܇uH¬Ê«28t¾íˈT7šˆ
 ´22Fˆ­•8ˆˆŒËÜcÜ­ÜˆD˜ŒÊˆˆˆ2"3XˆˆˆˆÞüÝ”wD™ftE¦4ºŒí‹ÙEDfe‡S3xˆœíËÜ‹ËȈˆ#USgw„KÜδ½ÔYTE24H‰‹Ì™–ÍÊ͵HR8¨©z¼œÜ˨ˆ36Cl”Œtˆh•E˜lÜȈ«…œR:î…JÃßé"ÎQ=þ’èÏúâ,ÿ°ÿ²=í0Nâ8ÿÐÿÃ.Þ_å#ßòîCÞý 
ýFÌÊÿ`?ÿ°ß9îsßò$ßÒ#»+ïç /øtº•,úý0ÜlöQþ±=ÞrI´,þÑßÔ¨¹C>ä#ÏÛ ¼¸¾ä@.îR¬|3Ú‚Oé‘&Þ˜Ûd%ÍÂ6Þ³4µMÞÓ¿±;øÌ;ç"èAMÚ(ýA=ì²MÙ!¾R>îÒïC̓3ö$ÿ¥2f¸Oö!MœcÏçéŠ{„‘.õýÍ1<ÓŸà‹ÿ1?ãJ£JÞû0îêTLVø üÂníþ!üå îËÔNïä¿ÞÒ2KLÒßþ@$ŸÎâ_ÝQL߆Ïþ0뜅7Üÿ žüs!ƒ}þ!¼û34ô«ØoÿB™íƒKÕrïëÈšÝèYÏìyG&_þ°í2œ3.ü0?ÿ Å9ÿàÿQÿƒ31zïàÿ¾EÙÄ=@Žþ}ëkÝStî .ÿ2L´Tÿ€õ@HÿSÿAÿ¹X2»Ë:Îñïþ£D-þ¾ì0?ÿ†0¾ÿàÿS9Ì„Y Xïäõoç,Ö ý3$¾Þé å!\ÿåC oÿÁÝBˆSïëÂ
+ÿØ!ÈÌã*þÖ]ÿø ÿë ÿÁCÏú"Wÿó"÷#cOû 'Ïþ"ÿ¶#ÞÒ Xßü%ßüƒÏñ:ÞíR"ÿù8äJÕ#ÿòßû“ ßô!nþ!ÅMÿP_ÿ@2NþRÉß´ 7ÿ ›ïÛB¯òÿÒ6ßÿ"«í wïãþ€$ï£>ý0^ÿa#$ÿ2BoÿÝÝÉ ŒÿA\ìÓDgÏë .ÿåˆ?ÿ ½Ï ßô‹ÿÂ&ÿíÿ"Þÿ²îú4ÞþÿüËÿT	îû -üýÏû=ïõ$<ÏÀ!Nßõ Nÿànïâ.ÿà½ÿä0<ÿ ïí3a+ÿàîÿ Ûü=Ýÿ1D½ý{;ÿV¿ñkýìďó _þÖ ~nù ^¿þV?òw¿ý)ïù!8TßèÞ ,ÿùrýáþþB}Ð,¼%XÿÐoýˆ» ,ÿR,ÿÀóÿÛ %ÿD¬ôÿÀÿø OäÞÅ ÿÀÝü"S<ÿ3ï–"NÿD#:ïû€ÿå <×¾Äïþÿ­7»0òÿø ä,ý‘þƒ¿ã>î0¼îcSªßêƒ/þ"+½ó"mþEÞîJ"mŸåZßë îä*}œü@ÿõ ¯äï4Pÿ ÿÂÒ*Ýí1OòîD÷,þ¸¸ÿEcÞ0O¢]Ñ8ÙìÁ6$ÿ쥲 ÿ ÏüÔHÿï”18ý[û!ܱÏçÊí3[Ñ›ÝÔoÔ$ÍÇßÆÄC-È^¸6|Ì!L¶ˆŽ½þ¤%è[Uæ$ŽQmîó6DÛÎ#3Ïã"¿‚8¯ÿ±íR\¬ßÈQ»ôHˆïî²|Æ%ÿë˜42ßA]ÿÓM;"{<,ÿë’AhŽþãÙ+Ë3ÿÊ{êˆ %ˆˆßü“K!Fÿü3ݘCCx¯ôNü„clÿ³Ëù+ùÇNÔ ô ]þ4ÿ¨‡10WŒý”´vï¢#Ì)ÿÔ#ÌC¿ý€E WïØ™9‚_ý32D„7ÿ7ç4¾é!2UGßýr]ƒïþ£#c"Îâ:Þýÿ%J±Gÿë{t!$ÿ{½¹29MÛs<Ó¿ê2BˆŒþ¿Ç@>þ́äJÒ"³ïá?ý—!R3ïâ;í™LüžÂJIþ¡"ýFïÒ½1HΫî’=‹ËäZSD7â+)è(ÿìRCCõ)ÞËÁÿú7ÿ÷Îßb$ï¹"X÷­^ø‹ÍŠ‚ßó'4ï¼ëA&ÞP¿þ¸ClïØ#UËoýËÜRê@luí
 íû0,ãNý¸ ÿÃÿàÿÂ-þP_øeþ£Ý‚{ïÓ Mÿã[Ë<ÖïòˆŸü5„îØB0ÿ’ _ÿ6ßùÈ=|þ0ÿâÿù4Ã!$ÿh%Ëí1^î!5Þ#ÝíBþRŸüˆë ¬ÿ‚ßýÇcæcˆÿýÿýþ^ÿã _ÿØPˆÿ±%ÝÿÂ<í¼2{ÿâ½ë¸Ü°ÿámïTë6´¿Ò nïá
ÿîÉ0
+þR¶‚Dßü xÿý X¿á)roÿÓ Oÿ±_Ýý¢",îoÿÙ@2&ŠþÜ#È>ýµ (í}3ïû” 6ÿý`ÌîaÞþ Lÿè„1ž¤ÞÞ >í2ÿÃ<#¼Îé NÿåýÃ(0hÿÐ.ü¨ÒßÃÿ&½Í¯ëp<.ÐïcïÙA¾à)^½ëGë®úm"ìLMÛëm´ßé&â<Þø ÎT#ÎÿÑ#Ù¾4ÏÀ:9ºBïðËþô$ÍÅÿü ­ÿ ,ü¹^ÓÏü‘ÿAìÔÍ4Žïû3ÈÌEíMÞ؃ Íÿp
„Iÿ‘û_ÿÙ„ 6ý¿ÿBÿÐ-‹"ÌÿÑ™CŒÿõ¬[ ‹ßø!ßÛˆ@-Âhÿ=íe_øg«’ÏÊXÿâ<íÚR ˆ‹ÿÂ8ÿ¸ º÷Ìb#Õü2'éîµ'íÛ4#!ˆˆÿõdk4jû'­bŒÿû@ÞÞÔ'¾x@%Ïÿ1%ÎnÒLÜ4 GÿÏ‘2ž¸2¯è%!çÏ€ä>2ÎþÈ MQŒ9ÏÙ½AÏ‚Ž¿³íþ12'üÙ+û–@ßÒDMÿã"þÕA$¿ÿÂÔå¯þ˜pmýS-ü(Çîȃ ÔMä?úÏÿYq'M¬UÜ\4ÿüi ŽSWÿã)‹þ˜2ÿÒxÿó'êÏêþ¸ÈÍõ-þþº2´þ![þ0*ßø"aMSIÅßô?þ>°?0+ôßÐçŸÃ/ÿ°ÿØ ,+ÿ XïäÊÿò»2$$onþtŒ[{ÿü +î÷ <ßý2ýb_ý3EÃ-äNÃ=YîPíþ°ïþ0ÿëXÿâ¬ÿóÎê#=Hÿ4¶ÈTïÎê -ìЏþä OÿÊ€ïø>ÿp at iÿüP#o#»ø.Ñ#ìÿÀÿ¸ %ÿû%ÿý˜ Oþ 6ïþ!!‹ù^Ülë73+’$ßýÓ ßþ`oëÒ#Ïþ” ?ÿÊ /ý2#ÛoõBÿöíÝ;ý;1þNÂ$åÛ8ÿý€ÿ#¿õ^Ò!TþA:ÿ÷ÿÈÿÐn»Ü¥Ä ÿÐÿú"ßÃÜŸÿÉ oø‘ïÄD^Ú4ë3#EØ.ÿÙ.öRŒïÛ$¸e5EpˆÿÍ”®² hÏó8ݦx2¶Îõ"ÿýÿ2ªNþɈ -ýqŽôÜDþc©c¿ÿ$‡¦E>Ó½Ïâ½Û1&ØïÞÈ…$|HÏûT½ÃOãEOñíåWþ7ÿýWe Žÿ ,îû!/ûŒ!#FÏÿ2ÿB$[í×® Å´IÝíÍé3§!ˆÿ
 ÛÔ;ä ÿ°voôêCE<âÿüˆÒmÎ1~ÿ3,ÞÓ~@Ïÿ¹	V˜1>¤¿ýBÿ²%#ì_幁$h½ïžÙ¼ûSœ¬Ös4!xÍSnÿëˆ!BèH{ÜÕï¢;ÞAÏüsS;ÈžÒ-îÃ1+íd"­mnþˆD™ ‰Žåîè ÿ´½Q^ý· .çšÿü¨A6ß1›ûþ0ÌSîxcQ¿ÚÔ%Ô	¾äÙÿ!r,ïAŒ8ìßÊ4l´9è=ÿÛ8þG·*ýí3XäIÍÿÛ‚0-îLAÏü(a.3ŸB…ê/ô
+´kšlõø$œ:Úë
+^þÉU:Cp?3ݍÓ'ÌaßÛb{Þ´GpOB3Þïéˆ0mݶ#ÿåwÌÇÍ /ÿ£]¡<잍é€\ïp¾g,Îì¥Í13ŠËI¾BíÿÅÌC½!ß ã”^#hÏÿ³¶@>W¾$ÿ13æÝ"Þ"U?þ‚<	õÿ:ø…@¾NóßÛøþ©‚ _üé h¾E9ÿü…5ßÒ#›^.üíX¿ð_òÏ@ÿî¡"ÓÏÒýIW’Þþ§„1W'ÂÎþÂyý<øÃÒþŠý MÌþîù… ;ÈþA$¾î#fïë4îûÌ øEBßü4 /ҏÑþªq/þV&þœ‚.Ìœ3Nþ¨‚Ì´ŒÊÌs¾-ÿB¿ìŽŠx#ÎÒŽBËh£þ2îý"TÎÕ$LÿDßþ³NþS ŸüR|þxßþÃü(Ïÿ¹@þÅOþ"ANëÄ#þë ~ÄS$îÀ¯ó¾Q•3Þ±C„þ4šdï²5AÿÕ";ì‚2~þÝ¢-ëƒ3×+g]þJH¥ä,<ïÊ8@þÝ"¿ö#Ƥ~½´ßUìßЮÌÔ Oîûˆ¬¼±BïÐ&ŽþãÄúDÆI¿@?ÿ2}ã4çNÖA+êß1µïäAÍßÇ!ßÆ“øê%!nWrO³H(oÿ¼`ÒKDOÿ¡!.þúƒÿ³oûD1XÈÿû2!ސ?þC„®?ó¯0	äoôK Ïñìÿԁï&hà>îü@þ—³î_ôŒ"?^üLÜê€ýÒm¬îÕMºCŽÿ‚ÏA2-ÏÅS&ß$äËݐ&ÿøƒHÓBXyÞóUNþ]ì­ý’c2:~÷UØ­Õ ¯t2HÏïÚp-#dGŸÿÅ_í1J(}옵 HŒÿ°/ÿK.Ú-âÿý‘þ“!'ïTK¢<ö17ü'ïÃà ßSÅ-ÿ¥Û€,²#Xÿ±!ïÐî;îÒßü0ÿÕ¹ˆS0‹ïñ¾ï@.ÿ 4ÎÿÉ2RU|´\ÿ˜ Oþƒ]D¾^ýUÝ¿÷ÿñ¦CÿX,Íê» ÎBˆïüR-û$%ïê´#ìî€þCµå­ 	Ô8ÿWÎã OÿDCD›ØCÿʇÿ"Û3MCeïÚ 'Üïù!";Èÿ예Œ4œîbŒMÿƒÜϗ݉Ú0hÿî²½‰Ìî·!ÿä-ƒÂ,3®ÿÓ‹ò»ýÛ€\þè(ûÁ8Ïÿ¹ %ÿùcèÒ<<ÿ*Ûü¼K"hßù£S,Û#Žßä #Ïÿ²^gtS¿üFMÝÃZÙÄ!Íþ"ÄLüBVÍü”*ÿâ«ÿR
 C*ïý ÿûRI\ļÜγ$Ez‹ÎñcmýAJ¬³DXÜÿQ3ŽîÄ"«é#˜d<ÚjW§^ÀãÏ	Õ»)ä‹W|K…}F{ŒØ0/þÈ ìèÙ"ûµe\ÙW„JdÕ„¶|LKš^,9˪8¨^G…-Ü3LÓ”å´FÛl-+Â^cN¸6L¯E&­ÜÃK/„µ´Æ¨tiƈÁìÅÁŽ®ªMGƒÙÈáä/áoÀÿ‘â'ùÓß\ýPïÂÊ#Î=+¦Ø.ūͲ΂L³ÕE"tKÃg∈¾RÍnšˆÎ¨ˆˆˆˆˆˆˆˆˆ‚2lƒ"hˆˆˆˆˆˆˆˆˆ‰yxµŒçÃÍÍGíÚˆ†L¨ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆCJ‹I33ŒBwˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆŒÔ«µÚų½æÈ]ÈÊ,u̘ˆˆˆˆˆˆˆˆˆˆ„Ȉˆˆ…¶¨…·,“¼¶²¹TÓ’ÚU²ÊC´>²ÒË”Õ'ÓʃX§ä³UˆˆÄˆˆˆŒHˆˆˆˆˆµ™ÛÛ•ÓCËÞ\•¼-b¸™åM$…̃›;V»ÉË££Õ¬âí.²§¸Øˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ„ȈˆY:Lƒ¢Í\4I‡t[H3ê=CÅŽ•»3ThÍLKcÊ9xˆµˆˆˆˆŠhˆˆˆˆˆˆˆˆˆEÉãT‹Î2Ö}‹È9âÝÕ^ŵ:“ÌÈãNƒã·xÉŠÃÉ»˜„Ã؈jˆˆˆˆˆˆˆ†¨ˆˆˆˆˆˆˆˆˆˆˆˆˆ‡˜bŸISLg–ƒ)xˆˆ‹^9HˆŽW<HˆˆˆˆˆˆˆˆˆŽ5µxˆŠhˆ‡Ê<FŽ*GŠ´ê/SÈFâgX¸÷ÖÚâÞ„ž5æ…>-ØI¸˜ˆˆ„È…µ¸Lˆˆˆ‡˜Z˜ˆˆyY;ÅŒ$ºSÔ2æ´uSœ¬ÁÂòÒØ·¹Ø[Ækâ^&k‡cKHé6Õ{<«Å)¼/uÌÆêr„µÏyˆ;£8DçädCL²Í8(5¥—‹XˆˆˆˆŒ‰ÃXÄÍG[ãËXJŽÒÞ2Ü]UÙ,ÒÞDÇ6ãÛ.B^(ð½T•<Rí6Å?‡·Âå˝æ\‚é.y;ºˆˆˆˆEÒ8Ä‹DÜÌ&Ò?sØ.\KNBäuÈ>E»cRÄ:òL#ÅL„ÕM6‹º£¹M¬Ev®=:„¼Å”—Åͬ<b“IÝå½yW囼YGËLY¸¸ÃV=ÕsVM8suË{=’äXļE²½MäµÃ»Ud;Ô½/¥¸Me.µÑգ͍£«ÂǬ4Ý-2ô=+â=‚ö²â…ÔÎ]MIÈ‚[ã¾7Ù-âµ3²ÜEh?—ËFÔN<Ý5‚­,Ù;,¸YÂœ(Ò\Cä;6ÓhÄŒJzvÛ]ÈÃJdÔÜØÛ6¢
 Í•\-Âò6´žDüƒÕy£ÔÖ×Ü[ˆ‡”³N¸bÇF½=3frfw¶Ìk#8cÈ]ÄÔ-¼Hµ³×‡½MӍSÜ>—ÖKÑÝ,Ò扷Z.9Ó8ÂÃ=3Û[Âj9ÔÖW¥|ٍ;ã˜Ë³]…õÅd;“Õl'„]±÷MÅMÇÆ]d“ÓªœI„¨•N,s±®[hVEhˆˆÙ|Kƒ¼[Ս8äœÃÊ+¢è-Ü=‘՝HEå®D^…ÅŒ¬L‰„Ɉˆˆ„ÇKYIÓt;,)jw«FSµÇY8[]K׌KG{¥ÕËfÒâ¼UãÌÈN9Uå=T<ÊÝ<H8š”lT‡ˆe»KuÍ(–´Ãçµ{<\Ì;‡Ì-ÃÛztT{´ÒœY”ÄkäÔ¦h­{Ƶ>#Õ\œYM#S}SÔ…D¤F——ˆˆˆˆÅk†ÄÈMËŒË=K‹—ÊÄŠ(”|[œ5¸Ö‰»‹L•>/=œ‹‹zL<\•¸[ˆiX…k+UYš[6ƒTÓI„«†˜Dh‹¹Ô‰JźtÒžhÙÖ׌J„º”ÌM^*ÒÌX’|“Ä]'´‰ƒÎE”’ÔË]:­U¸=kÈH|=lÅ™[{9”Ë›ƒU[Õ^Œ]ˆ³LNTw5=¤ÔDH9MƒØ.QȃÖhHĵ‹^:Å›^Iºlwlm,µËd‡¤UÄ\¨­5Ü6ÙMZÙ«EâΧ†µ¸´ÉU[kÈ8(³«{FuE;‹<Z”LF¼8³ØGÜ^Z¸H<ˆ}ÃÚl—N;Ç•ˆ•â¸<GÚUãŽ6¤D¥©I‚ÚkgX«—“º×u´8¼„Žx|‚;k©[Cæ.‹†«TżÈÌ»D¸[µª[U£KG{E|J‰5³µH¤Å¤‡Æ|l=y<œNv¤kæ»V´ˆM£ÌEL†J<ÈÈŒ,Y]\¬k£Ô–ÈÊxY·|L§¤Ã“¶´«:TL;{hKBuˆŒf[|KIZÉŠ”Ü|ÒÊ<ÅÈüWtYÅåluÜG¢[HflY´”â´´»=„˜=²æ{†ÃÅL³ëNc»<ÄžWä:Sªk´ì=Š<’Ùyy{HèM'„=eÈi;¨HU.C½8ňK³ÜH~,£Í/=>:Ä>X׍“·+‚ëhlLi¸Œ<Å=;º¾-µn5>[ÈĔջ—˜Lcƒ<u%Ò>4´>Y[¤ÕH•ˆ‹æ½K‹‰|uÉmÄÇ\½4Ä]N<L¤œFÅ=’Ú,”ºIÕl„ÄTä¸L4³¸ÆL“Õ=²ÞSä¼L³µƒæÔÍsÈ-FÖiˆl\¤Z”–U[ÉÔ…HVÕ›b­6ÒÞ%ѬGÕ\ÃôkX‹;âÝ\çKµÌ"LlXBî„â¤ãMé£ÇHñNDÙ§,ÕNÈœˆ„5ÌÃ)	ÒçTÈZ7’Xˆ
 ‹X§}\ۍ‰œ¼~NDÔKÚˆ9}ˆG"9Ç:2†¶©tˆŒM:­(Ï+»ã;ní,â‹NJÂí$ø€?êé žôN¸bꈈ#Þ8Áã.DÁlÂÅYÒŽÄGˆˆˆˆ‹Xˆ™ž%ŠhÞÄLÄ쓍·¹…K»AæµÂäšÚn;DTŽÌ;Á„̆\µ³ŒTÛu’»Â×·ÆÌ;]¼¸y‡T“ªãŒC,Ó»dƒT3ÄÊc˜VµŒmt‡ÄÄÄê˃´ŒÇã<„ÄÍZB¶×Ø’Ò¾‰”:-½ÔDMŒå¨C£¾XË-Âå²F[ÊÈžÄȈˆˆˆˆˆˆˆˆˆ-DscźÄE8cXiFŠÉ[…ÓjHˆŠÔŽ<h;UyKÌ+²fWˆŠœË¤Ê¥š×l»Ý+|,¥“µ®g”u4µKŠ(tÊ»ÓÕµâÍÔêkƒ¸=¶¹ˆ„„׸jsTWÌx“ZÉÓµ=̹ƒ,Ø}jSV»l…¢8c×,Rə¸u‰WFˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆËÛå¸Ä¾[ä‹ÃÔes\DÃ_:ÊTR³HX½©êHKi”™¥íͨw(w¾L˜ˆˆˆˆ„>(Ö»˜ˆy„ª[˜ˆˆˆˆˆˆˆwf[CˆK7%LTÈ<5xˆˆ‰x¦ˆŒÛ9s–…W‰‰DˆˆË:hˆˆˆˆˆˆˆ—›»´Úu؍֍(¼}³wW‹Hu•Ìäµ4Ò»Õ–w††w|l£xšË¾Iˆ=9yȼŸˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆJ+$$UÌ»hVLTUGÄÍÌ‹Kƒ„;wŽ¼Ü<CIH…\HºjDµ«º·½†­x²¨ièˆ$V]¤¶3šleTyÓ¨XˆŒÊÉÕÄÖ¹ÚX£«Xw¸ÙjdMc³3´„ê;ÄæSãÜ›{5ÈÍ•Èyu\'ÃÕ³ˆ9w×ăth{§¶Hƒ§f¬»Å=%Ý}Cy<Ûìµ´7ÕÜ=ÔÚˆˆˆ‡;LK:ÅÔE2GG„{–œˆ³5¦ŒY×̓Ö>6‹ˆÈÍe,´$º]ĵ…ÎvÔ]ÓÌŠ¼MeÄ«ˆ]5W<²œ*³yC¸=c½CãM”í=ÃÛLèMD§X´MMÍ=eK(…ƒ³§´šZ¸ØxÒ}Xê=Ø>›ÌUu?RÃt´Ì<4H¸ætR¹›Å²”K|¸ˆºXJ;uäÍL¨LËņ´Ý¹ˆƒØj„È[ˆˆIY(s‡+ˆKe¸Fs»Œ¤„œºÕY:Ø\\¹XÓ‡ŒÇN6µ.’Ê,³¼VÔ½t¹}\ºLŶ¤[•4fT¥³†‚»DÄj´ÈHX‹lé‹Åé;„[VÖ×ĶŒª…ƒs„Ú‡S‡mÉV„ÛÌÄk-ÕËw|·Ùy…´…²äSÓ]7´K‡ÓH(l{X˜KX
 ¹K<ƒŒ´Ù«¶KLµ®§è»¥Œ<ƺVÆ\ˆˆK7›5¤[+CYwĘ„•^D¦xǹ[ˆËy§}:³¼‹¶‹h´‡W|H™†V‰Ø¤™\ØÉj¨Ôh´Ç|gÅC“ZXX8ˆ©„³HGÄŽUÌMÛ©D´½uÅuÙÛGG\vÆu\EÄ“¨=‹·¼hÅ›…¶ZÔ½Kǽ[”HtºTÓª„¤\XEEG\|Š¥yDƒ\lÙ‹Ej;µk™Í^¼\£N*쨈ˆ‡WªZ¨LbfE£¤“”‹XxˆUYX»µ´­«>,…ÍJZˆÇ×f•µK´©U×H¦:v»Ù‹h\Ö»T‹LËʃ‡IbÄh•Ü(U-e—5µžWÙzµË.GË…ÖŒ”˜YãJ—Wd“¨³›S̈ÙMg†–•Œ›™\ÇÌ<µ<‚ÌGÙœtTEC‹M¤©sÓ<HKFÇËÝF46ˆˆ›¾åËHĝÕÍȈ‡˜ˆˆu¹ˆˆˆ…uDdG}c[8uM6—…xšÊlX—¸•¶Ë¸ÈTÅ{¸˜U•ºˆ‡SU§¼K½‰©4ÔŽ†ºÅxĸ˜†;Uš—…tš&h;¬G§Œ‹\u\‰ÕÕ·›”ªWˇ—ZÔ˜”ZD·F»=\Mˆštµh˜ŒÌ‹Œ…“¶‡æÊKyÈFBZ;›·x“Ã)C¨NËÍH5DUµ{–Ý[ÃkŒ\ê¬Ö†˜K†ŒÇ‰ˆy„ÄS…YHHHˆ•vEHmzjF»liyºMzŒ¸ŒY¤Uؙֈ6tL‡Ãº[hÆ‹\[LH¼½–IeŒ†ÓÄk„‰8³[CÄz´{dš\[lzXØ[Ê{„œ‰‹X¸ºÄ¤¤˜vXSœ«ÕySÈlG·ŒÈØx•[HÕÆÙ·ÊyUS„ˆÕÌW³BCT·Ì¹k‰8cµEÇmvªDµÈ­jÎ]ØMX¨ÔÈ”ÌLˆˆˆvXJHIT¤f‡G‡WtÄ»X•UÄÉŽXËhÄk™[ˆi¨µXC¸\”É<UµvÇØL„ÈŒ´ÆlEÙ|ĸETµx‰‰ˆš¨Š©™…Ex—gw™ˆ†Yƒ#ÍÚ¸~•"\kÉˆ‚?B|åBÜuS(Nä1\ÜüxˆˆÓˆˆˆ‹ÿü$ÕbZÞ؈ˆ6'¹0(ˆˆ‹í罫#8îܸ˜„7I2ë8%ÚÆÍEU|“9L»Iì…C8‚Z|M<ç‚(ŽìÔŠG,Õ…KïEÅ“6®çC$ÞI¤r՝–\þŽÙqƒ¬S"Wˆ›‰×Ýd4^õXkWtš¼¼Í¶™ˆˆ†tVkÛ’278‹ÕDDÜ%ˆˆŒHºÙ×Î{cSŒ¥¤ÈÌE2IÜ­½B\ڍ‹Û˜eD¾å‹5Ké#"HˆˆˆˆïÛ&F=Ü„¤|ÎÅ$Û}êerkÎdW¶4»'ä›ÆH
 ¦†‰…9Q–Ü3tˆˆ¼Üd4×<Ü;¬åÌ8¬ôE3DÎû×Ëè'S{į́„TR'2‹zUÖ}ï‡B*Ã]UÔÜ:RÞÞ݈xCŒœs†=¸ÖF#T¤]Ør{ä^Cs¶¼CÆîø4&]ÄXRH{éDK]¤{lG¼ÓºmÈWC­]£#*׈hÔîôè=²¬rTŒÄT­eÛCtG%cìÓÚ#KZÊï$ÝäXš5UÿVD=ÕÅÍ‚EÌ-Ã<b·uüdí$Â9D‰é:jÓBˆßÌ©½5GêfbX«Ï–çƒ}ù~Ûˆ…*²NËÈXä½4x¿Å1•ÍÌ¡KÜT[e}ÉKÃÝ¹Ú G–˜¦~ì¸ü3ÂWF’?æVâ$Ë4IFŽíÏÂïÌ… É4¿Ê,ÜÇ=’߈ق$üB¸$èŽé+ÊÇ‹^ˆ‚î!Nî—BÛ^âîM…WEßÄÏÍs+Ô1O&ïÇQShµÿ°Íä@G‹½ÉþA|þ¨<"Jíïþ¸ÝŠˆˆì˜C…fCÐŒøø”†2ˆ‹íDÞÔTÜ@ûC#ïÕn˜ ýSïÙj…=ÙT=õ,ß¡xˆˆˆÙwïñÞÕt¾Ó2¾Á>þȈKa^é€-ý¨3L%.þ +ۍT»D-çˆÈßÈÒUŽòÿô£LáÿãC®H·MÂ+ü ÍM‰ˆˆþ$*®Ûoù /ÿŧqx?Ò_”5ü²ê_ä¯ðDþQEVRÍÿÕ4SÍï!<ÿS,"%ßÿpœì¥M‚;tįÇ2Ë‘Hˆˆˆßó"ŽÃ³ÞDÿÁµMóîb,ÿɈˆ߸ˆ#ÒXÞÇXüÓݸ "¬Ý3â6ïðˆ‰¼ß³Bÿê Ξçi=<èÉP<þJ¼"4â6ŠÿüA:0ˆˆˆˆÍø'ŒÝ±GÿÙˆ‚4¿±ßþÄA™_ÍUü¨‚ XîõÏþ˜Pˆˆýÿ× 'ˆÏþ6OÉf ÿý‡b<ä%Xßäí2"XØõ"$ÿŽÐˆÿý!;þ2–!ìÿ¹#ÏþKèˆ( %ïþ¸=ˆXˆ¾ÿAwÿ˜1~^ÿ8¼¥#"DÍÏ÷8XŠäܝü!<\ø.B$΋íÇb£mïü¡Þþ¹ˆ+ŠÈ™©Õœ8è%ïOµC!mïô-,³Þ؈‚,QµŽüDj ì/ôË#ÌÜ» HïÒ∎û´+ïÔ1+ï²AÿÙ@:‚Ï Xÿý˜ˆŽ%ˆ¯ÿÂtÓFˆˆÿÙ‚èîèÈŒ0-SGíNûʈ<¾Ìø¨!#lÇØ]ýì-’Wˆÿù2'ˆˆÏÞúˆˆ*ËsËò
 Ý빩)í„;È\ݵ‹1WˆˆÜßöØ‚4Žÿé5m”"{;xï³ÿ¨‚ %ŒÞý4›Žõï°ŽaÎqÏÐ:íÓmïÞÈ3ÿÇÄNûÜBÞÅ ÝþÛÿÒK&å16ˆˆ¿ÝÍéˆ ϼk®ìˆˆ"OXô¼Û† ãMä,E¾Ä"\þÔ#&Eßý HˆˆŽÿë2³"«Þü*ØÑ"%HÍÞݽ¸… ,ÿ¢þ¨ˆPˆˆïþt¼ 4|Ûá9ÿü˜ˆ@hŒÿû˜‚ ]8ˆÿù„ 5Ëî멨ƒ!¯ÀGÏÞúÒX¾ë¬ÕCFK%¹=ÿʸ`Äÿý:#Ýfÿ¨ÜR½.ҏýùˆ‚(NÜüµÜ1"ÓxÿŠî0{ÿö ï”)ü˜ˆ iSìÌ…[ÞR6ïÒø´ß¼1hˆˆßçìÏ(ÿê zí3›îâë„@
+ßã<ù	þ逴ïþ¨ˆ€­Ãßó_ÀˆŒVˆþü¤'ŒÂ"*ìÿóÓ.Roÿн†ë˜ƒ,W~â'ˆÿò#î3\Œ%ŸÞÿå#WˆïþŠ’ß7¾Úˆ1ýˆ!#«EïüUNB4WŽÿÜ#CkšLÿû„±!XîßTI²/°DÝß숈шˆˆÿý˜ %ˆï£Žùˆ!ý3„ØNþ1õÿÜ興+ÛR½þ¹ˆxþÌÒ4ÿ¹€XŠ~ÿê„%xÿ%›,ÿÔWïö¶ž¸AWŒóßû‘,Ü’[«íÙ>–MÖïŒé]Q•hÏÿ#Ž±#îÓT/ùŒ‘(’*ÿQ3¤ßùÝ-ý -7ÿNþ¨ˆŒÕË\ïé1b.éˆÏÿ²~ÿ 5ÿÐ
ä¿ÑIÿýƒîúˆßä.þ ßðÖ? /þCÝ ˆïþ¸ ÿ %¾öì±!]ÿöNÿbä Ký(R\ÿû˜ %­Þè¿4¢ ŸýS
÷,•Þ^íË£Ìج@ýSƒ${ÿü@ÿü¡½ýá0(ÿ:Ïÿ¸‚ ÏùB^ÿ#6¯þ=B̾¢RȺTÎýƒ'Þ§¨ííˆd ÿƒ4^ãGû0?ñÈïü˜ˆ]0'ˆŽ¿þ@ÿ±=ÿÛ$1ÿ FÿÙ„´»Xÿý’ÐÅ$ÿÐt#ÜÉB*î?üTӍBhçÞí’¬
+þ!9ïåB'ŽþB"Ïÿ¸ˆˆˆ„ 6ˆïþ±_þ ¼ÿùˆ5 8Tˆÿ˘ˆ… ˆïþ,µM¶ˆÿý+‘ˆïõSNÖë0!ŸÞÓ,ÙBÉ1WïþQŽåBxˆÿýD¿{\g|ûˆ ˆŽÅNü¨€‚_÷}ÿäÅ1ïü³ Nwƒ_•þÂïü0GG/ÿ (žÿ@ÿϹ )ÿø–ï"GŽÿâÚÈ0%ˆßÿ˜SÛâíÞûÜùyÿüCs{œÆŽþíƒH­´=øsÂJÀFˆÿý•3µÕ 'ˆÿêÈ$ê`xˆþîÙ,"4¾þcÞÀ!8ïë"_e行WÌ?Ù$²xžÎë<û3–!%ÿä"³´OÃNíÜT -ÿèˆ.!F‹þSoÈo¹R!íÞȈBWˆˆÿý’¡!™tÏþ^ˆ èÃQmþÏ£é"aGÿý˜Ë$xÿÙ#ßÏÌÿ«ÄUÝÊ‚\ÞLëqÁ!xˆÿÄ"~Ÿ³ZSÖÔ^5%íîPß}ã¯Òö!­ïè€Îb’GÿØ"LíA+øÓlaÿü )ëÿ؈ Eþ]„žŽ˜‚ ªþܽ˜2xþåØÊ„@{û¼3Íû¤HŸÿÓ#ýólÿû”5]‚08ŽþÞ!ÎHŸýNÛƒ@ˆˆÌÿÙˆ‚,€#Œ¿ÿ˜ˆ@|¡#ÍïøˆÃHXŽßüCC“4hÇïD}^}‚_ïëA5÷- Gþå\²€Ý3‡…{üNяþK2þï0ÅmüÏý˜ˆ”#éïëTOÿ´ßÿEÓ0©"h‹¯ÿ¹€’‚89ïî1-xÊÇ-ÈÓ(2Žß¦³#ÎëNʃíú y®áQ7ÿý‘lýªø—F‹ÿü˜ˆˆ %Þµ½Þ¹„"Wß^üȈPWˆïëˆc HˆŽý¾ÚA2œÌϳt)ßR]8ÎÿÚƒ ÷/ü¸ÊC at X‹ÿû3Î 2HÍ4ïþ¸‚dßü ÿò ì[þ®ˆ5B$ÍÿêKc Xû2ÎÿZ<ÒÍäºcíC8îB$NÞ’<Å<þÙƒj2Gþžùˆ r¯ä*ÿÓ!üÑ$žÅÿÛ„3-Ó“$ßÒ½©"Žÿ³(ïLp7ÿÄ-þ"!ŒLûÞæxCB"»ïäÙ¸… $ü2Ïþ ο Xÿî¶b#‹“XŒÿûB³WŒý<þÈ…1†îè£íBÃ1½RhûÿÉR†– LÿDî·DÆ£Lÿû$¥OpxÿIÓ?ER5ÿÙˆLÞÑ%ﳎPDhÜW)ÿëˆ %þ¯ÿ˜F ‹üßÿ˜€
 g­ò%|ÿû˜€ÿòïþˆAWÿðîý×ÁHÓWŠÿü¨!zý$ßì˘@lÿ£ÿÛˆ€XØÏüÙLBWˆŽÿ눈1xŽØî쨈€XˆþÚí¸ˆXþëˆ1ÛGŒÿéˆ o€$hïü¢Äx¿ÿɈìË>ýü£/Û”KÕ½õØP ‹\æßÎȈ -·Ùß;ŒQíÖhˆŽÿ×N”3lÒVÎxíþË2]´Ãÿüyƒ#1—Ý„ŽÝ%XS?þ"8ˆ?ÿÃMìOܐ#$hüŸ£Ë 4TíÿƒB,í xüØþPÎ7ù 'íU;üþ˜€^½ßã8… h¿ò‰3æŸû5ƒÎFßÿ˜ >î÷ܯÐßÿˆ!²ÎÑÿì@xÿý“í¯Q	Œÿ ?ÿØ‹ÿüü0ˆÿق興Ïÿ¹ ®øHˆŸÿØ-¥!"Wˆÿý˜¦8ˆÿù 'ÿüþ¿èB#YÍÿøˆ .í¿B!ßý¨ %ˆŽéœþ¨„ ¸,Ç6Ÿÿ؁<"Ü'¯ïé0þÅ´oÿÙPˆÿ[ßþ˜#½ïå%Cê'2k”ßó߈ˆp7‰ÿÓIÝŽ’!ˆÿý”M¨0hÞÛM츬@!hˆÿšë¼#ÛV,ƒƒ•ßùˆÿý˜1óÖ!=üÍgOµÍQ)¿þ¸-BÔ4{üÿ˜#rÂGÿýsÍÓµ>ÿ’KÚ‚l$Ÿÿ,êJ„ FˆóÇ-ÿmÙ„ÁB#TŒþ*Õ´øP*ôßâÜ.ø‡!lçý¸Q½{ãˆÏû3R+ÿ2f$ÏÂ4R¯ÿÀžmÉ‚ Xÿ!Aÿ!~ÿè#^ÿƒ#ßõ$.ï“ F‹ÿòRï½Së&þ (ÿüQÂÿý CŸþ„Qxë5í_úHží¢%Ïÿ¹ŽÅÏýˆˆ „í³$<ÿû@Q5Íýßë@
¡iÛßû¹‡ ˆˆØßý¸„ ^ÿÕÈÎB*ˆˆÿÙˆ‚ XˆûˆÞc¾Ü¹HMýeÎR]Œ³‹Ïã#²<2nÞ_똀XÞ„nîêˆx¦ˆÿÙˆ#ñˆˆ¾ÿÔ"ÿ Kê邾;FbHˆÿý@ì,T"?TÍíÛ ïPLmžÄ׳ŽÃ2ƒ?ÿʁHWïHËïˆ!\ÂhÿÙˆ ;ƒhˆˆÿý˜ˆˆˆ‹íÿ¹F¤ WÈÿóÛ„l@þ¤åè½û Œßô³²HÛ¹nB²~ä"AXŸÿ _•iëV[Ø%ÿÒ5Ê$âýŠ¤1'ÿákÝûÔ¸3ý„æC#ˆïþ¸ 
ÞïR!*ïúùG3
 íۍì"W£7DØïÔì$ì1¨5cTÙ¾ó2!¾þDü¡CΆ<2{ÿüwBÛBˆÿ2ÏüUb"ïôÞ¼è€-BÌ‚OÿÊ3#Rø1¿è})C¨<íÐ-Û!HÞ6Ý=ü¨ˆ ˆüSÏÔ3·S¯ëÉû…R±ˆßø3ÝÜÉ0hùKîFHþ¿þÄ0XÿK̃¶H1#¿ÁOÿS#+¢;ÿ¸2CÜ¿$Xÿü¹ˆˆCnýØNÚ0>ç[ÿ=ÎÄ8û}õ>¿ÔBC"ˆþ‡lÞ܃û`H£V<è×½ÁÞë€ß1_ë3Ì¡(ÌÎÌKÔOôŒü®ì!‹Ì%ãú}D[Žú`~ÿëÏÓ"NÏô`8ÎÞÙ Ë&ÿR$^Ø^¯é4ƒ"&ÝãÿùR (ïÞ‘ßý]€>ïÀïå¼!B%‹ë®þ3'ã<Íë ,Í„˜7î½°Ÿÿ”°Œïû^ÚG!7Þïæ*A"\»5Ëß7ïÊ…%XˆÿZŒü†lÿÖ2¾¤S®ïâÜËÉ’xýn<³C"nï¸c-Ó3Õ(%ïþ1[ÝÄxŽÿ–»CHb)ÚŽýÄ2=ëqWÞûìzTH254ýt;íw)¾þÄQ"Oþ‚&LÿÃ5ƒ„=’4JþÝ£ÍÆIȼÖ)„S^‚Dîî3»¬ËC4xÏô5"ÎSLYÆ…ÕA;ØL»ûRL´ŠcyÝé5˜½í1&Ìí²©»Úr\¤½t«¶H´:Ú<v„\ÖM¥7ÞÄt4•I¼›œ“MÕXÈDw‚Më…X™ªv¼§µFDÆ{”8©wØœT»œÊVh½¼W˜©šuH͇82¾ÌéE3»„|…Ù|£µZ³TDlí¨Üe¹wCc$ÞÅj›†XC¤¼¹Ešdziy»»XmÖ4CD¾¼ÙR;Ȥ†{ÝÌ£"ZÛª!Ýî¥"M¦WS‹ÍÜTE¶3hÞÉ—C$›z¸gœ¼ÖF›ÈU3F¸ÍÛ¤5u›Ë…y‡Š˜U‰xwhŠ½ˆyÅT7‡hºÍ¤Dº»¤5‰ÝÜc$EkÛÆI»ÆˆZÆCG™»¬Èf˜SIy­Ü©4Ex†HŒy½Í«4U4›º…ZÛ»”4E»©»¹˜·UC'ÍÛ¼x¶Tx•vih¼Ë©t4G¬ÌyÌ»t$9EÍÊik̹CTD¬Ø»§wvˆeg«ˆË»¶DFS|ÌÈw«§TYˆºvG‹¼¹dEWÌÉFŠ¬wUEjš¹›{Ë„ET‹ª¦‡›¨–‡Eˆ›˜ª¼˜dEDz««ºË•UWˆ‡fk¹¼¦h…F¸ˆk‰¼…U…xx·ˆ¼É†UUas de 404

+; - chaque addresse est le deplacement dans le segment 600
\ No newline at end of file
diff --git a/engines/mortevielle/original/1/TEST.COM b/engines/mortevielle/original/1/TEST.COM
new file mode 100644
index 0000000..1171cfb
Binary files /dev/null and b/engines/mortevielle/original/1/TEST.COM differ
diff --git a/engines/mortevielle/original/1/ZUUL.COM b/engines/mortevielle/original/1/ZUUL.COM
new file mode 100644
index 0000000..4436635
Binary files /dev/null and b/engines/mortevielle/original/1/ZUUL.COM differ
diff --git a/engines/mortevielle/original/2/AFF.COM b/engines/mortevielle/original/2/AFF.COM
new file mode 100644
index 0000000..d64d397
Binary files /dev/null and b/engines/mortevielle/original/2/AFF.COM differ
diff --git a/engines/mortevielle/original/2/AFFAMS.ASM b/engines/mortevielle/original/2/AFFAMS.ASM
new file mode 100644
index 0000000..79bdafe
--- /dev/null
+++ b/engines/mortevielle/original/2/AFFAMS.ASM
@@ -0,0 +1,310 @@
+title affiche_le_dessin
+
+prog segment para
+       assume CS:prog
+affich proc near           ; pile appel :
+                                       ; Retour
+                                       ; y affichage
+                                       ; x affichage
+                                       ; offset dessin
+                                       ; segment dessin
+
+
+       aff: push ds                  ; sauve DS
+            push bp                  ; sauve BP
+            mov bp,sp
+            push bp                  ; sauve SP
+            sub sp,112h              ; 112h octets de locales
+
+
+
+; transfert de la palette dans les locales en [BP-64] :
+
+            mov ax,7000h
+            mov ds,ax                ; DS = segment de la palette
+            mov si,2                 ; SI = deplacement de la palette
+            push ss
+            pop es                   ; ES = destination : locales sur la pile
+            mov di,bp
+            sub di,64                ; DI = offset dest.
+            mov cx,16                ; 16 mots de palette
+            cld
+          rep movsw                  ; transfert
+
+            mov si,4138h
+            mov ax,[si]
+            mov [bp-258],ax
+            mov ax,[si+2]
+            mov [bp-260],ax
+            mov ax,[si+4]
+            add [bp+8],ax
+            mov ax,[si+6]
+            add [bp+6],ax
+
+            mov ax,[bp+12]
+            mov ds,ax                ; DS = segment du fichier dessin
+            xor ah,ah
+            mov si,[bp+10]           ; offset dessin
+            mov al,[si]
+            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
+            mov si,[bp+10]           ; offset dessin
+            mov bx,16
+            mov [bp-142],bx          ; par d‚faut
+            or al,al
+            jz aff00
+            mov bl,[si+2]            ; nø de couleur du masque
+            mov [bp-142],bx
+
+     aff00: mov ax,6000h
+            mov es,ax                ; ES = segment du dessin decompresse
+    datpal:
+            mov ax,[bp+6]      ; Y
+            shr ax,1           ; Y/2 lignes paires a afficher
+            mov bx,80
+            mul bx             ; 80 octets par lignes
+            mov bx,[bp+8]      ; X
+            shl bx,1           ; 2*X car un point du dessin pour deux pixels
+            mov [bp+8],bx
+            mov cl,3
+            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
+            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
+            mov [bp-100],ax    ; Oct_dep en bp-100
+            mov [bp-102],dx    ; 0 si affichage courant sur ligne paire,
+                               ; 1 si affichage sur ligne impaire
+
+            mov ax,[bp+6]      ; Y
+            and ax,1           ; masque l'imparite de Y
+            jz prem_lig_paire
+            inc word ptr [bp-102]    ; 1 car premier affichage sur ligne impaire
+            mov ax,2000h
+            add [bp-100],ax          ; memoire video pour lignes impaires
+prem_lig_paire:              ; calcul du point d‚part [bp-106] :
+                             ; poi_dep est un octet tel que le seul bit a 1
+                             ; soit la position du premier pixel d'affichage
+            mov ax,[bp+8]
+            and ax,7         ; reste de la div de X par 8
+            mov cl,al
+            mov bx,80h       ; 1000 0000b position par defaut pour une
+                             ; division par 8 entiere
+            shr bx,cl
+            mov [bp-106],bx
+
+            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
+            neg ax                   ; nbre de points pour le 1er octet .
+            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
+            mov [bp-108],ax
+
+            xor ax,ax                
+            mov [bp-110],ax          ; cmpt y
+            mov [bp-114],ax          ; init
+
+debut_lig:  mov si,[bp-114]
+            mov ax,si
+            add ax,320
+            mov [bp-114],ax
+
+            mov cx,[bp-108]          ; Nombre de point(s) a afficher
+                                     ; vaut 4 lorsque tout l'octet va etre afficher
+                                     ;      3 lorsque les 6 bits de droite vont etre re-afficher
+                                     ;      2 lorsque les 4 bits de droite vont etre re-afficher
+                                     ;      1 lorsque les 2 bits de droite vont etre re-afficher
+            xor ax,ax
+            mov [bp-112],ax        ; compteur en x
+            mov ax,[bp-106]        ; AX := masque ecran
+            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
+            mov dx,di
+            call litbyte
+            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
+            or bx,bx
+            jz lig_paire
+            dec word ptr [bp-102]  ; la ligne suivante sera impaire
+            sub dx,2000h
+            add dx,80              ; DX = octet du debut de la ligne suivante
+            jmp sui2
+lig_paire:
+            inc word ptr [bp-102]
+            add dx,2000h
+sui2:
+            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
+            jmp un
+
+     aff01: shr al,1
+            jmp siutd
+
+un:                                ; 1er bit/pixel du point
+            mov dl,es:[si]         ; no de couleur du point dans la palette
+            and dl,15
+            cmp dl,[bp-142]
+            je aff01
+            shl dl,1
+            xor dh,dh
+            push si
+            mov si,dx
+            mov dx,[bp+si-64]      ; DL => 1ere couleur
+                                   ; DH => 2nde couleur
+            pop si
+
+            mov ah,al              ; AL masque positif, AH masque negatif
+            not ah
+
+            test dl,1              ; Bit BLEU
+            jz deux1
+            or [bp-246],al
+            jmp deux
+     deux1: and [bp-246],ah
+
+      deux: test dl,2              ; Bit VERT
+            jz trois1
+            or [bp-248],al
+            jmp trois
+    trois1: and [bp-248],ah
+
+     trois: test dl,4              ; Bit ROUGE
+            jz quatre1
+            or [bp-250],al
+            jmp quatre
+   quatre1: and [bp-250],ah
+
+    quatre: test dl,8              ; Bit INTENSITE
+            jz siute1
+            or [bp-252],al
+            jmp siute
+    siute1: and [bp-252],ah
+     siute: shr al,1                 ; 2nd bit/pixel du point
+                                     ; decalage du masque
+            mov ah,al
+            not ah
+
+            test dh,1              ; Bit BLEU
+            jz deud1
+            or [bp-246],al
+            jmp deud
+     deud1: and [bp-246],ah
+
+      deud: test dh,2              ; Bit VERT
+            jz troid1
+            or [bp-248],al
+            jmp troid
+    troid1: and [bp-248],ah
+
+     troid: test dh,4              ; Bit ROUGE
+            jz quatrd1
+            or [bp-250],al
+            jmp quatrd
+   quatrd1: and [bp-250],ah
+
+    quatrd: test dh,8              ; Bit INTENSITE
+            jz siutd1
+            or [bp-252],al
+            jmp siutd
+    siutd1: and [bp-252],ah
+
+     siutd: shr al,1                 ; decalage du masque
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+            inc si
+            mov dx,[bp-112]
+            cmp dx,[bp-258]
+            loopnz i_un              ; boucle tant que cx<>0 et compteur x < taix
+            jmp svte
+
+i_un:       jmp un
+
+inter_un:   add dx,4
+            cmp dx,[bp-258]
+            jc tani
+clb:        call litbyte
+            jmp un
+tani:       mov dl,[bp-140]
+            or dl,dl
+            jnz clb
+annul:      xor dx,dx
+            mov [bp-246],dx
+            mov [bp-248],dx
+            mov [bp-250],dx
+            mov [bp-252],dx
+            jmp un
+inter_deb:  jmp debut_lig
+
+svte:                                ; affichage de l'octet precedement calcule .
+                                     ; les masques B, V, R et I sont stoque dans
+                                     ; les locales en BP-246, 248, 250 et 252
+            mov cx,4           ; 4 plans couleur
+            mov ax,80h         ; prepare le masque pour l'octet suivant
+            push cx            ; sauvegarde des registres utilises pour l'affichage
+            push ax
+            push es
+            mov ax,0B800h      
+            mov es,ax          ; segment video
+
+            mov dx,3DDh        ; registre de selectiondes couleurs
+
+            mov al,1
+            out dx,al          ; selecte BLEU
+            mov cl,[bp-246]
+            mov es:[di],cl     ; affiche
+
+            inc al
+            out dx,al          ; selecte ROUGE
+            mov cl,[bp-248]
+            mov es:[di],cl
+
+            shl al,1
+            out dx,al          ; selecte VERT
+            mov cx,[bp-250]
+            mov es:[di],cl
+
+            shl al,1
+            out dx,ax          ; selecte INTENSITE
+            mov cl,[bp-252]
+            mov es:[di],cl
+
+            pop es             ; Affichage termine . Restaure les registres
+            pop ax
+            pop cx
+            inc di                  ; octet video suivant
+            mov dx,[bp-112]
+            cmp dx,[bp-258]
+            jc inter_un
+            inc word ptr [bp-110]
+            mov dx,[bp-110]
+            cmp dx,[bp-260]
+            jc inter_deb
+
+            mov sp,bp
+            pop bp
+            pop ds
+            ret 8
+
+affich endp
+litbyte proc near
+            push es
+            push ax
+            push dx
+            mov ax,0b800h
+            mov es,ax
+            mov dx,3DEh
+            mov al,0
+            out dx,al
+            mov ah,es:[di]
+            mov [bp-246],ah
+            inc ax
+            out dx,al
+            mov ah,es:[di]
+            mov [bp-248],ah
+            inc ax
+            out dx,al
+            mov ah,es:[di]
+            mov [bp-250],ah
+            inc ax
+            out dx,al
+            mov ah,es:[di]
+            mov [bp-252],ah
+            pop dx
+            pop ax
+            pop es
+            ret
+litbyte endp
+prog ends
+     end aff
+
+;******************************************************************************
diff --git a/engines/mortevielle/original/2/AFFAMS.COM b/engines/mortevielle/original/2/AFFAMS.COM
new file mode 100644
index 0000000..577fd5a
Binary files /dev/null and b/engines/mortevielle/original/2/AFFAMS.COM differ
diff --git a/engines/mortevielle/original/2/AFFEGA.ASM b/engines/mortevielle/original/2/AFFEGA.ASM
new file mode 100644
index 0000000..e9320e3
--- /dev/null
+++ b/engines/mortevielle/original/2/AFFEGA.ASM
@@ -0,0 +1,305 @@
+title affiche_le_dessin_sur_ega_low
+
+prog segment para
+       assume CS:prog
+affich proc near
+; --------------------------------------------------------------------------
+; Pile durant la proc affega :
+;                       [bp+ 4] Retour
+;                       [bp+ 6] y affichage
+;                       [bp+ 8] x affichage
+;                       [bp+10] offset dessin
+;                       [bp+12] segment dessin
+; --------------------------------------------------------------------------
+       aff: push ds                  ; sauve DS
+            push bp                  ; sauve BP
+            mov bp,sp
+            push bp                  ; sauve SP
+            sub sp,112h              ; 112h octets de locales
+
+            mov dx,3CEh      ; 3CFh pointe sur le Bit mask register
+            mov al,8
+            OUT dx,al
+
+            mov dx,3C4h      ; 3C5h pointe sur le Map mask register
+            mov al,2
+            OUT dx,al
+
+
+; --------------------------------------------------------------------------
+;      Calculs sur les variables d'adresse absolue  7000h:xxxx
+; --------------------------------------------------------------------------
+
+; transfert de la palette dans les locales en [BP-64] :
+
+            mov ax,7000h
+            mov ds,ax                ; DS = segment de la palette
+            mov si,2                 ; SI = deplacement de la palette
+            push ss
+            pop es                   ; ES = destination : locales sur la pile
+            mov di,bp
+            sub di,64                ; DI = offset dest.
+            mov cx,16                ; 16 mots de palette
+            cld
+          rep movsw                  ; transfert
+
+            mov si,4138h
+            mov ax,[si]
+            mov [bp-258],ax
+            mov ax,[si+2]
+            mov [bp-260],ax
+
+; additionne les coordonnees relatives dans les parametres de passage :
+
+            mov ax,[si+4]
+            add [bp+8],ax
+            mov ax,[si+6]
+            add [bp+6],ax
+
+; --------------------------------------------------------------------------
+;      Calculs sur les variables d'adresse relative [segment : offset]
+; --------------------------------------------------------------------------
+
+            mov ax,[bp+12]
+            mov ds,ax                ; DS = segment du fichier dessin
+            xor ah,ah
+            mov si,[bp+10]           ; offset dessin
+            mov al,[si]
+            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
+
+            mov bx,16
+            mov [bp-142],bx          ; par d‚faut
+            or al,al
+            jz aff00
+            mov bl,[si+2]            ; nø de couleur du masque
+            mov [bp-142],bx
+
+     aff00: mov ax,[bp+6]      ; Y
+            mov bx,80
+            mul bx             ; 80 octets par lignes
+            mov bx,[bp+8]      ; X
+            shl bx,1           ; 2*X car un point du dessin pour deux pixels
+            mov [bp+8],bx
+            mov cl,3
+            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
+            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
+            mov [bp-100],ax    ; Oct_dep en bp-100
+
+            mov ax,6000h
+            mov es,ax                ; ES = segment du dessin decompresse
+            mov ax,0A000h
+            mov ds,ax                ; DS = segment de la memoire video
+
+;-----------------------------------------------------------------------------
+;  - Calcul du point d‚part [bp-106] : poi_dep est un octet tel que le seul
+;     bit a 1 soit la position du premier pixel d'affichage
+;-----------------------------------------------------------------------------
+
+            mov ax,[bp+8]
+            and ax,7         ; reste de la div de X par 8
+            mov cl,al
+            mov bx,80h       ; 1000 0000b position par defaut pour une
+                             ; division par 8 entiere
+            shr bx,cl
+            mov [bp-106],bx
+
+            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
+            neg ax                   ; nbre de points pour le 1er octet .
+            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
+            mov [bp-108],ax
+
+            xor ax,ax
+            mov [bp-114],ax          ; init
+            mov [bp-110],ax          ; cmpt y
+
+debut_lig:  mov si,[bp-114]
+            mov ax,si
+            add ax,320
+            mov [bp-114],ax
+
+            mov cx,[bp-108]    ; Nombre de point(s) a afficher
+                               ; vaut 4 lorsque tout l'octet va etre afficher
+                               ;      3 pour les 6 bits de droite
+                               ;      2 pour les 4 bits de droite
+                               ;      1 pour les 2 bits de droite
+
+            xor ax,ax
+            mov [bp-112],ax        ; compteur en x
+            mov ax,[bp-100]
+            mov di,ax
+            add ax,80
+            mov [bp-100],ax
+            mov ax,[bp-106]        ; masque binaire tournant
+
+un1:
+            xor dx,dx
+            mov [bp-246],dx
+            mov [bp-248],dx
+            mov [bp-250],dx
+            mov [bp-252],dx
+            xor bx,bx
+            jmp un
+
+     aff01: shr al,1
+            pop di
+            jmp siutd
+
+        un: push di
+            mov di,es:[si]         ; 1er bit/pixel du point =
+            and di,15              ; no de couleur du point dans la palette
+            cmp di,[bp-142]
+            jz aff01
+            shl di,1
+            mov dx,[bp+di-64]      ; DL => 1ere couleur
+                                   ; DH => 2nde couleur
+            pop di
+
+            or bl,al
+
+            test dl,1              ; Bit BLEU
+            jz deux
+            or [bp-246],al
+
+      deux: test dl,2              ; Bit VERT
+            jz trois
+            or [bp-248],al
+
+     trois: test dl,4              ; Bit ROUGE
+            jz quatre
+            or [bp-250],al
+
+    quatre: test dl,8              ; Bit INTENSITE
+            jz siute
+            or [bp-252],al
+     siute: shr al,1                 ; 2nd bit/pixel du point
+                                     ; decalage du masque
+            or bl,al
+
+            test dh,1              ; Bit BLEU
+            jz deud
+            or [bp-246],al
+
+      deud: test dh,2              ; Bit VERT
+            jz troid
+            or [bp-248],al
+
+     troid: test dh,4              ; Bit ROUGE
+            jz quatrd
+            or [bp-250],al
+
+    quatrd: test dh,8              ; Bit INTENSITE
+            jz siutd
+            or [bp-252],al
+
+     siutd: shr al,1                 ; decalage du masque
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+            inc si
+            mov dx,[bp-112]
+            cmp dx,[bp-258]
+            loopnz un      ; boucle tant que cx<>0 et compteur x < taix
+
+     ; affichage de l'octet precedement calcule .
+     ; les masques B, V, R et I sont stoques dans
+     ; les locales en BP-246, 248, 250 et 252
+     ; Le masque Noir est en BL
+
+            mov dx,3C5h      ; Selecte toutes les couleurs
+            mov bh,dl
+            mov al,15
+            out dx,al
+            mov dl,0CFh      ; Bit mask Noir
+            mov al,bl
+            out dx,al
+            mov al,[di]
+            xor al,al
+            mov [di],al
+
+            ;mov dx,3C5h        ; registre de selection des couleurs
+            xchg bh,dl
+            mov al,1
+            out dx,al          ; selecte BLEU
+
+            mov al,[bp-246]
+            ;mov dl,0CFh
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            ;mov dx,3C5h        ; registre de selection des couleurs
+            xchg bh,dl
+            mov al,2
+            out dx,al          ; selecte VERT
+
+            mov al,[bp-248]
+            ;mov dl,0CFh
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            ;mov dx,3C5h        ; registre de selection des couleurs
+            xchg bh,dl
+            mov al,4
+            out dx,al          ; selecte ROUGE
+
+            mov al,[bp-250]
+            ;mov dl,0CFh
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            ;mov dx,3C5h        ; registre de selection des couleurs
+            xchg bh,dl
+            mov al,8
+            out dx,al          ; selecte INTENSITE
+
+            mov al,[bp-252]
+            ;mov dl,0CFh
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+
+            mov ax,80h         ; prepare le masque pour l'octet suivant
+            mov cx,4
+            inc di                  ; octet video suivant
+            mov dx,[bp-112]
+            cmp dx,[bp-258]
+            jc inter_un
+            inc word ptr [bp-110]
+            mov dx,[bp-110]
+            cmp dx,[bp-260]
+            jc inter_deb
+
+            mov dx,3CFh
+            mov al,255
+            out dx,al
+            mov dl,0C5h
+            out dx,al
+
+            mov sp,bp
+            pop bp
+            pop ds
+            ret 8
+
+inter_deb:  jmp debut_lig
+ inter_un: jmp un1
+
+affich endp
+
+PROG ENDS
+     END aff
+
+
+
diff --git a/engines/mortevielle/original/2/AFFEGA.COM b/engines/mortevielle/original/2/AFFEGA.COM
new file mode 100644
index 0000000..6fd86b9
Binary files /dev/null and b/engines/mortevielle/original/2/AFFEGA.COM differ
diff --git a/engines/mortevielle/original/2/AFFHER.ASM b/engines/mortevielle/original/2/AFFHER.ASM
new file mode 100644
index 0000000..e1b3eb1
--- /dev/null
+++ b/engines/mortevielle/original/2/AFFHER.ASM
@@ -0,0 +1,245 @@
+title affiche_le_dessin_sur_hercule
+
+prog segment para
+       assume CS:prog
+affich proc near
+; --------------------------------------------------------------------------
+; Pile durant la proc affega :
+;                       [bp+ 4] Retour
+;                       [bp+ 6] y affichage
+;                       [bp+ 8] x affichage
+;                       [bp+10] offset dessin
+;                       [bp+12] segment dessin
+; Variables locales :
+;                [bp- 100] octet de deplacement du debut de la ligne courante
+;                [bp- 102] nombre a ajouter donnant la ligne de dessous
+;                [bp- 104] masque de d‚but de ligne
+;                [bp- 106] cl de d‚but de ligne
+;                [bp- 110] compteur relatif en y
+;                [bp- 112] compteur relatif en x
+;                [bp- 114] indice dans le dessin source
+;                [bp- 120] compteur absolu en y
+;                [bp- 122] compteur absolu en x
+;                [bp- 130] taille en y du dessin
+;                [bp- 132] taille en x du dessin
+;                [bp- 140] bool = est un dessin ? (./animation)
+;                [bp- 142] numero du masque
+; --------------------------------------------------------------------------
+       aff: push ds                  ; sauve DS
+            push bp                  ; sauve BP
+            mov bp,sp
+            push bp                  ; sauve SP
+            sub sp,112h              ; 112h octets de locales
+
+
+; --------------------------------------------------------------------------
+;      Calculs sur les variables d'adresse absolue  7000h:xxxx
+; --------------------------------------------------------------------------
+
+; transfert de la palette dans les locales en [BP-64] :
+
+            mov ax,7000h
+            mov ds,ax                ; DS = segment de la palette
+            mov si,2                 ; SI = deplacement de la palette
+            push ss
+            pop es                   ; ES = destination : locales sur la pile
+            mov di,bp
+            sub di,64                ; DI = offset dest.
+            mov cx,16                ; 16 bytes de palette
+      tr01:
+            mov al,[si]
+            inc si
+            inc si
+            mov es:[di],al
+            inc di
+            loop tr01
+
+            mov si,4138h
+            mov ax,[si]              ; taille x
+            mov [bp-132],ax
+            mov ax,[si+2]            ; taille y
+            mov [bp-130],ax
+
+; additionne les coordonnees relatives dans les parametres de passage :
+
+            mov ax,[si+4]
+            add [bp+8],ax
+            mov ax,[si+6]
+            ;shl ax,1
+            add [bp+6],ax
+
+; --------------------------------------------------------------------------
+;      Calculs sur les variables d'adresse relative [segment : offset]
+; --------------------------------------------------------------------------
+
+            mov ax,[bp+12]
+            mov ds,ax                ; DS = segment du fichier dessin
+            xor ah,ah
+            mov si,[bp+10]           ; offset dessin
+            mov al,[si]
+            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
+
+            mov bx,16
+            mov [bp-142],bx          ; par d‚faut
+            or al,al
+            jz aff00
+            mov bl,[si+2]            ; nø de couleur du masque
+            mov [bp-142],bx
+
+     aff00: mov ax,[bp+6]      ; Y
+            shr ax,1
+            shr ax,1
+            mov bx,160
+            mul bx             ; Y div 4 * 160
+            mov bx,ax
+            mov ax,[bp+6]      ; Y
+            and ax,3
+            mov cx,2000h
+            mul cx
+            add ax,bx
+            mov bx,[bp+8]      ; X
+            mov cl,2
+            shr bx,cl          ; X div 4 car 4 points par octets
+            add ax,bx          ; AX contient l'off du premier octet d'affichage
+                               ; dans le segment video
+            mov [bp-100],ax    ; Oct_dep en bp-100
+            mov di,ax
+
+            mov cx,[bp+8]      ; X
+            and cx,3
+            neg cx
+            add cx,3
+            shl cx,1
+            mov [bp-106],cl
+            mov al,3
+            shl al,cl
+            not al
+            mov [bp-104],al
+
+            mov ax,6000h
+            mov es,ax                ; ES = segment du dessin decompresse
+            mov ax,0B000h
+            mov ds,ax                ; DS = segment de la memoire video
+
+            xor ax,ax
+            mov [bp-110],ax          ; cmpt y
+            mov [bp-114],ax          ; offset source
+
+            mov ax,[bp+6]
+            mov [bp-120],ax
+            mov ax,[bp+8]
+            mov [bp-122],ax
+
+debut_lig:
+            call calcaddlig
+            mov ax,[bp-114]
+            mov si,ax
+            add ax,320
+            mov [bp-114],ax
+
+            xor bx,bx
+            mov [bp-112],bx        ; compteur en x
+            mov cl,[bp-106]        ; decalage pixels dans byte
+            mov ch,[bp-104]        ; masque noir
+
+un1:
+            mov al,[di]
+            add di,dx
+            mov ah,[di]
+            sub di,dx
+
+un:
+            mov bl,es:[si]         ; 1er bit/pixel du point =
+            inc si
+            and bx,15              ; no de couleur du point dans la palette
+            cmp bl,[bp-142]
+            je nonaff
+            push si
+            mov si,bx
+            mov bl,[bp+si-64]
+            pop si
+            and al,ch
+            and ah,ch
+            mov bh,bl
+            and bl,3
+            shl bl,cl
+            or al,bl
+            shr bh,1
+            shr bh,1
+            shl bh,cl
+            or ah,bh
+
+    nonaff: or cl,cl
+            jz outoct
+            dec cl
+            dec cl
+            ror ch,1
+            ror ch,1
+
+     siutd:
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+
+            mov bx,[bp-112]
+            cmp bx,[bp-132]
+            jc un
+            inc word ptr [bp-110]
+            mov bx,[bp-110]
+            cmp bx,[bp-130]
+            jc inter_deb
+
+            mov sp,bp
+            pop bp
+            pop ds
+            ret 8
+
+     ; affichage de l'octet precedement calcule .
+     outoct:
+            mov [di],al
+            ;mov al,[bp-120]
+            ;and al,3
+            ;jz nonaff2l
+            add di,dx
+            mov [di],ah
+            inc di                  ; octet video suivant
+            mov ah,[di]
+            sub di,dx
+            ;jmp aff2l
+  nonaff2l: ;inc di
+     aff2l: mov al,[di]
+            mov ch,3Fh
+            mov cl,6
+            jmp siutd
+
+inter_deb:  mov di,[bp-100]
+            add di,dx
+            inc word ptr [bp-120]
+            ;mov al,[bp-120]
+            ;and al,3
+            ;cmp al,1
+            ;je s1l
+            call calcaddlig
+            add di,dx
+            inc word ptr [bp-120]
+       s1l: mov [bp-100],di
+            jmp debut_lig
+
+affich endp
+calcaddlig proc near
+      mov dx,[bp-120]
+      and dx,3
+      cmp dx,3
+      je sub6000h
+      mov dx,2000h
+      ret
+sub6000h:
+      mov dx,6000h
+      neg dx
+      add dx,80
+      ret
+calcaddlig endp
+
+PROG ENDS
+     END aff
+
+
+
diff --git a/engines/mortevielle/original/2/AFFHER.COM b/engines/mortevielle/original/2/AFFHER.COM
new file mode 100644
index 0000000..9f7be45
Binary files /dev/null and b/engines/mortevielle/original/2/AFFHER.COM differ
diff --git a/engines/mortevielle/original/2/AFFICH.ASM b/engines/mortevielle/original/2/AFFICH.ASM
new file mode 100644
index 0000000..bb04274
--- /dev/null
+++ b/engines/mortevielle/original/2/AFFICH.ASM
@@ -0,0 +1,1060 @@
+title affiche_le_dessin
+
+; Pile : [bp]    = old bp
+;        [bp+2]  = old ds
+;        [bp+4]  = ret
+;        [bp+6]  = y affichage
+;        [bp+8]  = x affichage
+;        [bp+10] = offset dessin
+;        [bp+12] = segment dessin
+;        [bp+14] = Gd
+
+PROG segment para
+       assume CS:prog
+affich proc near
+
+
+       aff: push ds                  ; sauve DS
+            push bp                  ; sauve BP
+            mov bp,sp
+            push bp                  ; sauve SP
+            sub sp,112h              ; 112h octets de locales
+
+            mov ax,[bp+14]           ; Graph Device
+            or ax,ax
+            jz Gdams
+            dec ax
+            jz Gdcga
+            dec ax
+            jz Gdega
+            dec ax
+            jz Gdher
+            dec ax
+            jz Gdtan
+            jmp fin
+
+  Gdams: jmp ams01
+  Gdcga: jmp cga01
+  Gdega: jmp ega01
+  Gdher: jmp her01
+  Gdtan: jmp tan01
+
+
+     ams01: call trpal
+            call trtaycoor
+            call trvarrel
+            mov bx,[bp+8]      ; X
+            shl bx,1           ; 2*X car un point du dessin pour deux pixels
+            mov [bp+8],bx
+            mov cl,3
+            call calc01
+            call calcpoidep
+     ams03:
+     ams04:                  ; calcul du point d‚part [bp-106] :
+                             ; poi_dep est un octet tel que le seul bit a 1
+                             ; soit la position du premier pixel d'affichage
+            mov ax,[bp+8]
+            and ax,7         ; reste de la div de X par 8
+            mov cl,al
+            mov bx,80h       ; 1000 0000b position par defaut pour une
+                             ; division par 8 entiere
+            shr bx,cl
+            mov [bp-106],bx
+
+            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
+            neg ax                   ; nbre de points pour le 1er octet .
+            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
+            mov [bp-108],ax
+
+
+    ams05:  call deblig
+
+            mov ax,[bp-106]        ; AX := masque ecran
+            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
+            mov dx,di
+            call amslit
+            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
+            or bx,bx
+            jz ams06
+            dec word ptr [bp-102]  ; la ligne suivante sera impaire
+            sub dx,2000h
+            add dx,80              ; DX = octet du debut de la ligne suivante
+            jmp ams07
+ams06:
+            inc word ptr [bp-102]
+            add dx,2000h
+ams07:
+            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
+            jmp ams09
+
+     ams08: shr al,1
+            jmp ams25
+
+ams09:                                ; 1er bit/pixel du point
+            mov dl,es:[si]         ; no de couleur du point dans la palette
+            and dl,15
+            cmp dl,[bp-142]
+            je ams08
+            shl dl,1
+            xor dh,dh
+            push si
+            mov si,dx
+            mov dx,[bp+si-64]      ; DL => 1ere couleur
+                                   ; DH => 2nde couleur
+            pop si
+
+            mov ah,al              ; AL masque positif, AH masque negatif
+            not ah
+
+            test dl,1              ; Bit BLEU
+            jz ams10
+            or [bp-246],al
+            jmp ams15
+     ams10: and [bp-246],ah
+
+     ams15: test dl,2              ; Bit VERT
+            jz ams11
+            or [bp-248],al
+            jmp ams14
+     ams11: and [bp-248],ah
+
+     ams14: test dl,4              ; Bit ROUGE
+            jz ams12
+            or [bp-250],al
+            jmp ams13
+     ams12: and [bp-250],ah
+
+     ams13: test dl,8              ; Bit INTENSITE
+            jz ams16
+            or [bp-252],al
+            jmp ams17
+     ams16: and [bp-252],ah
+     ams17: shr al,1                 ; 2nd bit/pixel du point
+                                     ; decalage du masque
+            mov ah,al
+            not ah
+
+            test dh,1              ; Bit BLEU
+            jz ams18
+            or [bp-246],al
+            jmp ams19
+     ams18: and [bp-246],ah
+
+     ams19: test dh,2              ; Bit VERT
+            jz ams20
+            or [bp-248],al
+            jmp ams21
+     ams20: and [bp-248],ah
+
+     ams21: test dh,4              ; Bit ROUGE
+            jz ams22
+            or [bp-250],al
+            jmp ams23
+     ams22: and [bp-250],ah
+
+     ams23: test dh,8              ; Bit INTENSITE
+            jz ams24
+            or [bp-252],al
+            jmp ams25
+     ams24: and [bp-252],ah
+
+     ams25: shr al,1                 ; decalage du masque
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+            inc si
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            loopnz ams26              ; boucle tant que cx<>0 et compteur x < taix
+            jmp ams27
+
+     ams26: jmp ams09
+
+ams28:      add dx,4
+            cmp dx,[bp-132]
+            jc ams30
+ams29:      call amslit
+            jmp ams09
+ams30:      mov dl,[bp-140]
+            or dl,dl
+            jnz ams29
+ams31:
+            call annul
+            jmp ams09
+     ams32: jmp ams05
+
+     ams27:                     ; affichage de l'octet precedement calcule .
+                                ; les masques B, V, R et I sont stoque dans
+                                ; les locales en BP-246, 248, 250 et 252
+            mov cx,4           ; 4 plans couleur
+            mov ax,80h         ; prepare le masque pour l'octet suivant
+            push cx            ; sauvegarde des registres utilises pour l'affichage
+            push ax
+            push ds
+            mov ax,0B800h
+            mov ds,ax          ; segment video
+
+            mov dx,3DDh        ; registre de selectiondes couleurs
+
+            mov al,1
+            out dx,al          ; selecte BLEU
+            mov cl,[bp-246]
+            mov [di],cl     ; affiche
+
+            inc al
+            out dx,al          ; selecte ROUGE
+            mov cl,[bp-248]
+            mov [di],cl
+
+            shl al,1
+            out dx,al          ; selecte VERT
+            mov cx,[bp-250]
+            mov [di],cl
+
+            shl al,1
+            out dx,ax          ; selecte INTENSITE
+            mov cl,[bp-252]
+            mov [di],cl
+
+            pop ds             ; Affichage termine . Restaure les registres
+            pop ax
+            pop cx
+            inc di                  ; octet video suivant
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            jc ams28
+            inc word ptr [bp-110]
+            mov dx,[bp-110]
+            cmp dx,[bp-130]
+            jc ams32
+            jmp fin
+
+; --------------------------------------------------------------------------
+;      			affichage sur CGA
+; --------------------------------------------------------------------------
+
+     cga01: ;push ds                  ; sauve DS
+            ;push es                  ; sauve ES
+            mov ax,7000h
+            mov ds,ax                ; DS = segment de la palette
+
+; calcul des addresses des motifs :
+; - a partir de 6CE40 h et par pas de 404
+; - chaque addresse est le deplacement dans le segment 6000h
+; - bp-64 : nø15,   bp-62 : nø14,   ... ,   bp-34 : nø0
+
+            mov cx,16
+            mov bx,404;
+     cga02: mov ax,cx
+            dec ax
+            mov di,ax
+            mul bx
+            add ax,0D700h
+            shl di,1
+            add di,34
+            neg di
+            mov [bp+di],ax
+            loop cga02
+
+            call trtaycoor
+            call trvarrel
+            mov cl,2
+            call calc01
+
+            mov ax,[bp+8]
+            and ax,3         ; reste de la div de X par 4
+                                     ; 4 - ( X mod 4 )  =
+            neg ax                   ; nbre de points pour le 1er octet .
+            add ax,4                 ; 4 points/couleurs par octets
+            mov [bp-108],ax
+
+
+     cga05: call deblig
+
+            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
+            mov dx,di
+            call cgalit
+            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
+            or bx,bx
+            jz cga07
+            dec word ptr [bp-102]  ; la ligne suivante sera impaire
+            sub dx,2000h
+            add dx,80              ; DX = octet du debut de la ligne suivante
+            jmp cga08
+
+cga06:
+            jmp cga14
+
+cga07:
+            inc word ptr [bp-102]
+            add dx,2000h
+cga08:
+            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
+
+cga09:                             ; 1er bit/pixel du point
+            mov dl,es:[si]         ; no de couleur du point dans la palette
+            cmp dl,[bp-142]
+            je cga06
+
+; - bp-64 : nø15,   bp-62 : nø14,   ... ,   bp-34 : nø0
+
+            push ax
+            push si
+            xor dh,dh
+            shl dx,1
+            mov si,dx
+            add si,34
+            neg si
+            mov ax,[bp+si]
+            mov si,ax              ; offset du bon bloc
+            xor bx,bx
+            mov ax,[bp-112]        ; cmpt x
+            mov dx,es:[si]            ; tax du bloc
+     cga10: cmp ax,dx
+            jc cga11
+            sub ax,dx
+            jmp cga10
+     cga11: mov bx,ax
+            add si,2
+            mov dx,es:[si]            ; tay du bloc
+            mov ax,[bp-110]        ; cmpt y
+     cga12: cmp ax,dx
+            jc cga13
+            sub ax,dx
+            jmp cga12
+     cga13: mov dx,es:[si-2]          ; y * tax
+            mul dx
+            add bx,ax
+            add si,2
+
+            mov dl,es:[bx+si]         ; et enfin : la couleur
+            xor dh,dh
+            pop si
+            pop ax
+            push cx
+            dec cx
+            shl cx,1
+            shl dx,cl              ; ATTENTION Superbe !!!!!
+            mov bx,3
+            shl bx,cl
+            not bl                 ; DL masque positif, BL masque negatif
+            pop cx
+            and [bp-246],bl
+            or [bp-246],dl
+
+     cga14:
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+            inc si
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            loopnz cga15              ; boucle tant que cx<>0 et compteur x < taix
+            jmp cga21
+
+cga15:      jmp cga09
+
+cga16:      add dx,4
+            cmp dx,[bp-132]
+            jc cga18
+cga17:      call cgalit
+            jmp cga09
+cga18:      mov dl,[bp-140]
+            or dl,dl
+            jnz cga17
+cga19:      xor dx,dx
+            mov [bp-246],dx
+            jmp cga09
+cga20:      jmp cga05
+
+cga21:                             ; affichage de l'octet precedement calcule .
+            push ds
+            mov ax,0B800h
+            mov ds,ax              ; segment video
+
+            mov al,[bp-246]
+            mov [di],al            ; affiche
+
+            pop ds                 ; Affichage termine .
+            inc di                 ; octet video suivant
+            mov cx,4
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            jc cga16
+            inc word ptr [bp-110]
+            mov dx,[bp-110]
+            cmp dx,[bp-130]
+            jc cga20
+            jmp fin
+
+; --------------------------------------------------------------------------
+;                       affichage sur EGA
+; --------------------------------------------------------------------------
+     ega01:
+            mov dx,3CEh      ; 3CFh pointe sur le Bit mask register
+            mov al,8
+            OUT dx,al
+
+            mov dx,3C4h      ; 3C5h pointe sur le Map mask register
+            mov al,2
+            OUT dx,al
+
+            call trpal
+            call trtaycoor
+            call trvarrel
+
+            mov ax,[bp+6]      ; Y
+            mov bx,80
+            mul bx             ; 80 octets par lignes
+            mov bx,[bp+8]      ; X
+            shl bx,1           ; 2*X car un point du dessin pour deux pixels
+            mov [bp+8],bx
+            mov cl,3
+            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
+            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
+            mov [bp-100],ax    ; Oct_dep en bp-100
+
+            mov ax,0A000h
+            mov ds,ax                ; DS = segment de la memoire video
+
+            call calcpoidep
+
+            xor ax,ax
+            mov [bp-114],ax          ; init
+            mov [bp-110],ax          ; cmpt y
+
+     ega02: call deblig
+
+            mov ax,[bp-100]
+            mov di,ax
+            add ax,80
+            mov [bp-100],ax
+            mov ax,[bp-106]        ; masque binaire tournant
+
+     ega03: call annul
+            xor bx,bx
+            jmp ega04
+
+     ega05: shr al,1
+            pop di
+            jmp ega06
+
+     ega04: push di
+            mov di,es:[si]         ; 1er bit/pixel du point =
+            and di,15              ; no de couleur du point dans la palette
+            cmp di,[bp-142]
+            jz ega05
+            shl di,1
+            mov dx,[bp+di-64]      ; DL => 1ere couleur
+                                   ; DH => 2nde couleur
+            pop di
+
+            or bl,al
+
+            test dl,1              ; Bit BLEU
+            jz ega07
+            or [bp-246],al
+
+     ega07: test dl,2              ; Bit VERT
+            jz ega08
+            or [bp-248],al
+
+     ega08: test dl,4              ; Bit ROUGE
+            jz ega09
+            or [bp-250],al
+
+     ega09: test dl,8              ; Bit INTENSITE
+            jz ega10
+            or [bp-252],al
+     ega10: shr al,1                 ; 2nd bit/pixel du point
+                                     ; decalage du masque
+            or bl,al
+
+            test dh,1              ; Bit BLEU
+            jz ega11
+            or [bp-246],al
+
+     ega11: test dh,2              ; Bit VERT
+            jz ega12
+            or [bp-248],al
+
+     ega12: test dh,4              ; Bit ROUGE
+            jz ega13
+            or [bp-250],al
+
+     ega13: test dh,8              ; Bit INTENSITE
+            jz ega06
+            or [bp-252],al
+
+     ega06: shr al,1                 ; decalage du masque
+            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
+            inc si
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            loopnz ega04      ; boucle tant que cx<>0 et compteur x < taix
+
+     ; affichage de l'octet precedement calcule .
+     ; les masques B, V, R et I sont stoques dans
+     ; les locales en BP-246, 248, 250 et 252
+     ; Le masque Noir est en BL
+
+            mov dx,3C5h      ; Selecte toutes les couleurs
+            mov bh,dl
+            mov al,15
+            out dx,al
+            mov dl,0CFh      ; Bit mask Noir
+            mov al,bl
+            out dx,al
+            mov al,[di]
+            xor al,al
+            mov [di],al
+
+            xchg bh,dl
+            mov al,1
+            out dx,al          ; selecte BLEU
+
+            mov al,[bp-246]
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            xchg bh,dl
+            mov al,2
+            out dx,al          ; selecte VERT
+
+            mov al,[bp-248]
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            xchg bh,dl
+            mov al,4
+            out dx,al          ; selecte ROUGE
+
+            mov al,[bp-250]
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+            xchg bh,dl
+            mov al,8
+            out dx,al          ; selecte INTENSITE
+
+            mov al,[bp-252]
+            xchg bh,dl
+            out dx,al
+
+            mov al,[di]
+            mov al,0FFh
+            mov [di],al     ; affiche
+
+
+            mov ax,80h         ; prepare le masque pour l'octet suivant
+            mov cx,4
+            inc di                  ; octet video suivant
+            mov dx,[bp-112]
+            cmp dx,[bp-132]
+            jc ega14
+            inc word ptr [bp-110]
+            mov dx,[bp-110]
+            cmp dx,[bp-130]
+            jc ega15
+
+            mov dx,3CFh
+            mov al,255
+            out dx,al
+            mov dl,0C5h
+            out dx,al
+
+            jmp fin
+
+     ega15: jmp ega02
+     ega14: jmp ega03
+
+; --------------------------------------------------------------------------
+;                       affichage sur TANDY
+; --------------------------------------------------------------------------
+; Variables locales :
+;                [bp- 100] octet de deplacement du debut de la ligne courante
+;                [bp- 110] compteur relatif en y
+;                [bp- 112] compteur relatif en x
+;                [bp- 114] indice dans le dessin source
+;                [bp- 120] compteur absolu en y
+;                [bp- 122] compteur absolu en x
+;                [bp- 142] numero du masque
+;                [bp- 250] couleur de l'octet a effacer
+; --------------------------------------------------------------------------
+     tan01: call trpal
+            call trtaycoor
+            call trvarrel
+
+            mov ax,[bp+6]      ; Y
+            shr ax,1
+            shr ax,1
+            mov bx,160
+            mul bx             ; Y div 4 * 160
+            mov bx,ax
+            mov ax,[bp+6]      ; Y
+            and ax,3
+            mov cx,2000h
+            mul cx
+            add ax,bx
+            mov bx,[bp+8]      ; X
+            shr bx,1           ; X div 2 car 2 pixels par octets
+            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
+            mov [bp-100],ax    ; Oct_dep en bp-100
+
+            mov ax,0B800h
+            mov ds,ax                ; DS = segment de la memoire video
+
+            xor ax,ax
+            mov [bp-110],ax          ; cmpt y
+            mov [bp-114],ax          ; offset source
+            mov [bp-108],ax          ; compatibilite avec proc deblig
+
+            mov ax,[bp+6]
+            mov [bp-120],ax
+            mov ax,[bp+8]
+            mov [bp-122],ax
+
+    tan02:  call deblig
+
+            mov bx,[bp-100]
+            mov di,bx
+            inc word ptr [bp-120]
+            mov ax,[bp-120]
+            and ax,3
+            je tan03
+            add bx,2000h
+            jmp tan04
+     tan03: sub bx,6000h
+            add bx,160
+     tan04: mov [bp-100],bx
+
+     tan05: xor dx,dx
+            mov [bp-250],dx
+            xor bx,bx
+            jmp tan07
+
+     tan06: pop di
+            mov al,[di]
+            jmp tan08
+
+     tan07: mov cl,4
+            push di
+            mov di,es:[si]         ; 1er bit/pixel du point =
+            and di,15              ; no de couleur du point dans la palette
+            cmp di,[bp-142]
+            jz tan06
+            shl di,1
+            mov dx,[bp+di-64]      ; DL => 1ere couleur
+            pop di
+            xor al,al
+            mov al,dl
+            shl dh,cl
+            add al,dh
+            mov [bp-250],al


Commit: 8e1b26507b149db5529903820dc7dca89d81aa1c
    https://github.com/scummvm/scummvm/commit/8e1b26507b149db5529903820dc7dca89d81aa1c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:10-07:00

Commit Message:
MORTEVIELLE: Make ptoc happy

Changed paths:
  R engines/mortevielle/original/0/ACTIONS.PAS
  R engines/mortevielle/original/0/AFF.COM
  R engines/mortevielle/original/0/AFFAMS.COM
  R engines/mortevielle/original/0/AFFEGA.COM
  R engines/mortevielle/original/0/AFFHER.COM
  R engines/mortevielle/original/0/AFFICH.COM
  R engines/mortevielle/original/0/AFFTAN.COM
  R engines/mortevielle/original/0/ALERT.PAS
  R engines/mortevielle/original/0/AS.PAS
  R engines/mortevielle/original/0/AXX.MOR
  R engines/mortevielle/original/0/AZZ.MOR
  R engines/mortevielle/original/0/BMOR.MOR
  R engines/mortevielle/original/0/BOITE.COM
  R engines/mortevielle/original/0/BOITE.PAS
  R engines/mortevielle/original/0/BRUIT5
  R engines/mortevielle/original/0/BRUITS
  R engines/mortevielle/original/0/CFIEC.MOR
  R engines/mortevielle/original/0/CFIPH.MOR
  R engines/mortevielle/original/0/CGA.COM
  R engines/mortevielle/original/0/CHARDES.COM
  R engines/mortevielle/original/0/CHARECR.COM
  R engines/mortevielle/original/0/CXX.MOR
  R engines/mortevielle/original/0/DEBUG.PAS
  R engines/mortevielle/original/0/DEC.MOR
  R engines/mortevielle/original/0/DECOMP.COM
  R engines/mortevielle/original/0/DECPASP.COM
  R engines/mortevielle/original/0/DEMUS.COM
  R engines/mortevielle/original/0/DEMUS2.COM
  R engines/mortevielle/original/0/DETECT.PAS
  R engines/mortevielle/original/0/DISK.PAS
  R engines/mortevielle/original/0/DIVAF.COM
  R engines/mortevielle/original/0/DON.MOR
  R engines/mortevielle/original/0/DROITE.PAS
  R engines/mortevielle/original/0/DXX.MOR
  R engines/mortevielle/original/0/DZZ.MOR
  R engines/mortevielle/original/0/ECRIHEXA.PAS
  R engines/mortevielle/original/0/FXX.MOR
  R engines/mortevielle/original/0/KEYBOARD.PAS
  R engines/mortevielle/original/0/LEVEL15.PAS
  R engines/mortevielle/original/0/LITPH4.COM
  R engines/mortevielle/original/0/MENU.PAS
  R engines/mortevielle/original/0/MENUFR.MOR
  R engines/mortevielle/original/0/MOR.PAS
  R engines/mortevielle/original/0/MOR2.PAS
  R engines/mortevielle/original/0/MORT.000
  R engines/mortevielle/original/0/MORT.001
  R engines/mortevielle/original/0/MORT.002
  R engines/mortevielle/original/0/MORT.003
  R engines/mortevielle/original/0/MORT.004
  R engines/mortevielle/original/0/MORT.005
  R engines/mortevielle/original/0/MORT.006
  R engines/mortevielle/original/0/MORT.COM
  R engines/mortevielle/original/0/MORT.IMG
  R engines/mortevielle/original/0/MORT.PAS
  R engines/mortevielle/original/0/MOUSE.PAS
  R engines/mortevielle/original/0/MUSINT.COM
  R engines/mortevielle/original/0/MUSINT2.COM
  R engines/mortevielle/original/0/MXX.MOR
  R engines/mortevielle/original/0/NEWMENU.PAS
  R engines/mortevielle/original/0/OUTTEXT.PAS
  R engines/mortevielle/original/0/OVD1.PAS
  R engines/mortevielle/original/0/PAROLE.PAS
  R engines/mortevielle/original/0/PAROLE2.PAS
  R engines/mortevielle/original/0/PHBRUI.MOR
  R engines/mortevielle/original/0/PHINT.COM
  R engines/mortevielle/original/0/PHINT2.COM
  R engines/mortevielle/original/0/PHINTBAK.COM
  R engines/mortevielle/original/0/PHINTCOM.COM
  R engines/mortevielle/original/0/PHINTDEF.COM
  R engines/mortevielle/original/0/PHINTGM.COM
  R engines/mortevielle/original/0/PHINTUK.COM
  R engines/mortevielle/original/0/PLXX.MOR
  R engines/mortevielle/original/0/PROG.PAS
  R engines/mortevielle/original/0/PUTPIX.COM
  R engines/mortevielle/original/0/QUES.PAS
  R engines/mortevielle/original/0/REUS.COM
  R engines/mortevielle/original/0/REUSINT.COM
  R engines/mortevielle/original/0/SAUVECR.COM
  R engines/mortevielle/original/0/SAV0.MOR
  R engines/mortevielle/original/0/SAV1.MOR
  R engines/mortevielle/original/0/SAV2.MOR
  R engines/mortevielle/original/0/SAV3.MOR
  R engines/mortevielle/original/0/SAV4.MOR
  R engines/mortevielle/original/0/SONMUS.MOR
  R engines/mortevielle/original/0/SPRINT.PAS
  R engines/mortevielle/original/0/TABLE.PAS
  R engines/mortevielle/original/0/TAFFICH.PAS
  R engines/mortevielle/original/0/TEST.COM
  R engines/mortevielle/original/0/TESTPROT.PAS
  R engines/mortevielle/original/0/TXX.INP
  R engines/mortevielle/original/0/TXX.NTP
  R engines/mortevielle/original/0/VAR.MOR
  R engines/mortevielle/original/0/ZUUL.COM
  R engines/mortevielle/original/1/AFF.COM
  R engines/mortevielle/original/1/AFFAMS.COM
  R engines/mortevielle/original/1/AFFEGA.COM
  R engines/mortevielle/original/1/AFFHER.COM
  R engines/mortevielle/original/1/AFFICH.COM
  R engines/mortevielle/original/1/AFFTAN.COM
  R engines/mortevielle/original/1/AXX.MOR
  R engines/mortevielle/original/1/AZZ.MOR
  R engines/mortevielle/original/1/BMOR.MOR
  R engines/mortevielle/original/1/BOITE.COM
  R engines/mortevielle/original/1/CFIEC.MOR
  R engines/mortevielle/original/1/CFIPH.MOR
  R engines/mortevielle/original/1/CGA.COM
  R engines/mortevielle/original/1/CHARDES.COM
  R engines/mortevielle/original/1/CHARECR.COM
  R engines/mortevielle/original/1/CXX.MOR
  R engines/mortevielle/original/1/DEC.MOR
  R engines/mortevielle/original/1/DECOMP.COM
  R engines/mortevielle/original/1/DECPASP.COM
  R engines/mortevielle/original/1/DEMUS.COM
  R engines/mortevielle/original/1/DEMUS2.COM
  R engines/mortevielle/original/1/DIVAF.COM
  R engines/mortevielle/original/1/DXX.MOR
  R engines/mortevielle/original/1/DZZ.MOR
  R engines/mortevielle/original/1/FXX.MOR
  R engines/mortevielle/original/1/LITPH4.COM
  R engines/mortevielle/original/1/MENUFR.MOR
  R engines/mortevielle/original/1/MORT.000
  R engines/mortevielle/original/1/MORT.001
  R engines/mortevielle/original/1/MORT.002
  R engines/mortevielle/original/1/MORT.003
  R engines/mortevielle/original/1/MORT.004
  R engines/mortevielle/original/1/MORT.005
  R engines/mortevielle/original/1/MORT.006
  R engines/mortevielle/original/1/MORT.COM
  R engines/mortevielle/original/1/MORT.ZIP
  R engines/mortevielle/original/1/MUSINT.COM
  R engines/mortevielle/original/1/MUSINT2.COM
  R engines/mortevielle/original/1/MXX.MOR
  R engines/mortevielle/original/1/PHBRUI.MOR
  R engines/mortevielle/original/1/PHINT.COM
  R engines/mortevielle/original/1/PHINT2.COM
  R engines/mortevielle/original/1/PHINTBAK.COM
  R engines/mortevielle/original/1/PHINTCOM.COM
  R engines/mortevielle/original/1/PHINTDEF.COM
  R engines/mortevielle/original/1/PHINTGM.COM
  R engines/mortevielle/original/1/PHINTUK.COM
  R engines/mortevielle/original/1/PLXX.MOR
  R engines/mortevielle/original/1/PUTPIX.COM
  R engines/mortevielle/original/1/REUS.COM
  R engines/mortevielle/original/1/REUSINT.COM
  R engines/mortevielle/original/1/SAUVECR.COM
  R engines/mortevielle/original/1/SAV0.MOR
  R engines/mortevielle/original/1/SAV1.MOR
  R engines/mortevielle/original/1/SAV2.MOR
  R engines/mortevielle/original/1/SAV3.MOR
  R engines/mortevielle/original/1/SONMUS.MOR
  R engines/mortevielle/original/1/TEST.COM
  R engines/mortevielle/original/1/ZUUL.COM
  R engines/mortevielle/original/2/AFF.COM
  R engines/mortevielle/original/2/AFFAMS.ASM
  R engines/mortevielle/original/2/AFFAMS.COM
  R engines/mortevielle/original/2/AFFEGA.ASM
  R engines/mortevielle/original/2/AFFEGA.COM
  R engines/mortevielle/original/2/AFFHER.ASM
  R engines/mortevielle/original/2/AFFHER.COM
  R engines/mortevielle/original/2/AFFICH.ASM
  R engines/mortevielle/original/2/AFFICH.COM
  R engines/mortevielle/original/2/AFFTAN.ASM
  R engines/mortevielle/original/2/AFFTAN.COM
  R engines/mortevielle/original/2/BOITE.ASM
  R engines/mortevielle/original/2/BOITE.COM
  R engines/mortevielle/original/2/CGA.ASM
  R engines/mortevielle/original/2/CGA.COM
  R engines/mortevielle/original/2/CHARDES.COM
  R engines/mortevielle/original/2/CHARECR.ASM
  R engines/mortevielle/original/2/CHARECR.COM
  R engines/mortevielle/original/2/CLEARMEM.ASM
  R engines/mortevielle/original/2/DECOMP.ASM
  R engines/mortevielle/original/2/DECOMP.COM
  R engines/mortevielle/original/2/DECPASP.COM
  R engines/mortevielle/original/2/DEMUS.ASM
  R engines/mortevielle/original/2/DEMUS.COM
  R engines/mortevielle/original/2/DEMUS2.ASM
  R engines/mortevielle/original/2/DEMUS2.COM
  R engines/mortevielle/original/2/DIVAF.ASM
  R engines/mortevielle/original/2/DIVAF.COM
  R engines/mortevielle/original/2/LITPH4.ASM
  R engines/mortevielle/original/2/LITPH4.COM
  R engines/mortevielle/original/2/LITPH6.ASM
  R engines/mortevielle/original/2/MUSINT.ASM
  R engines/mortevielle/original/2/MUSINT.COM
  R engines/mortevielle/original/2/MUSINT2.ASM
  R engines/mortevielle/original/2/MUSINT2.COM
  R engines/mortevielle/original/2/PHINT.ASM
  R engines/mortevielle/original/2/PHINT.COM
  R engines/mortevielle/original/2/PHINT2.ASM
  R engines/mortevielle/original/2/PHINT2.COM
  R engines/mortevielle/original/2/PHINTBAK.ASM
  R engines/mortevielle/original/2/PHINTBAK.COM
  R engines/mortevielle/original/2/PHINTCOM.COM
  R engines/mortevielle/original/2/PHINTDEF.ASM
  R engines/mortevielle/original/2/PHINTDEF.COM
  R engines/mortevielle/original/2/PHINTGM.ASM
  R engines/mortevielle/original/2/PHINTGM.COM
  R engines/mortevielle/original/2/PHINTUK.ASM
  R engines/mortevielle/original/2/PHINTUK.COM
  R engines/mortevielle/original/2/PUTPIX.ASM
  R engines/mortevielle/original/2/PUTPIX.COM
  R engines/mortevielle/original/2/REUS.ASM
  R engines/mortevielle/original/2/REUS.COM
  R engines/mortevielle/original/2/REUSINT.ASM
  R engines/mortevielle/original/2/REUSINT.COM
  R engines/mortevielle/original/2/SAUVECR.ASM
  R engines/mortevielle/original/2/SAUVECR.COM
  R engines/mortevielle/original/2/TEST.ASM
  R engines/mortevielle/original/2/TEST.COM
  R engines/mortevielle/original/2/ZUUL.ASM
  R engines/mortevielle/original/2/ZUUL.COM
  R engines/mortevielle/original/3/AXX
  R engines/mortevielle/original/3/AXX.MOR
  R engines/mortevielle/original/3/AZZ
  R engines/mortevielle/original/3/AZZ.MOR
  R engines/mortevielle/original/3/BMOR.MOR
  R engines/mortevielle/original/3/BRUIT1
  R engines/mortevielle/original/3/BRUIT2
  R engines/mortevielle/original/3/BRUIT3
  R engines/mortevielle/original/3/BRUIT4
  R engines/mortevielle/original/3/BRUIT5
  R engines/mortevielle/original/3/BRUITS
  R engines/mortevielle/original/3/CFIEC.MOR
  R engines/mortevielle/original/3/CFIPH.MOR
  R engines/mortevielle/original/3/CGA.MOR
  R engines/mortevielle/original/3/CHAI.MOR
  R engines/mortevielle/original/3/DEC.MOR
  R engines/mortevielle/original/3/DON.MOR
  R engines/mortevielle/original/3/DXX
  R engines/mortevielle/original/3/DXX.MOR
  R engines/mortevielle/original/3/DZZ.MOR
  R engines/mortevielle/original/3/DZZFRA
  R engines/mortevielle/original/3/FXX.MOR
  R engines/mortevielle/original/3/MENU.MOR
  R engines/mortevielle/original/3/MORT.000
  R engines/mortevielle/original/3/MORT.001
  R engines/mortevielle/original/3/MORT.002
  R engines/mortevielle/original/3/MORT.003
  R engines/mortevielle/original/3/MORT.004
  R engines/mortevielle/original/3/MORT.005
  R engines/mortevielle/original/3/MORT.006
  R engines/mortevielle/original/3/MORT.007
  R engines/mortevielle/original/3/MORT.COM
  R engines/mortevielle/original/3/MUSC.MOR
  R engines/mortevielle/original/3/MXX.MOR
  R engines/mortevielle/original/3/PHBRUI.MOR
  R engines/mortevielle/original/3/PLXX.MOR
  R engines/mortevielle/original/3/SAUV.MOR
  R engines/mortevielle/original/3/SONMUS.MOR
  R engines/mortevielle/original/3/TFXX.MOR
  R engines/mortevielle/original/3/TXX.MOR
  R engines/mortevielle/original/3/TXX.NTI



diff --git a/engines/mortevielle/original/0/ACTIONS.PAS b/engines/mortevielle/original/0/ACTIONS.PAS
deleted file mode 100644
index fd940b3..0000000
--- a/engines/mortevielle/original/0/ACTIONS.PAS
+++ /dev/null
@@ -1,1373 +0,0 @@
-(* NIVEAU 4 *)
-const stouinon = '[2][ ][OUI][NON]';
-
-overlay procedure taller;
-label 2;
-var
- mx,cx,cy: integer;
-begin
- if (s.mlieu= 26) and (msg[4]= depl[6]) then
- begin
-  s.mlieu:= 15;
-  caff:= s.mlieu;
-  afdes(0);
-  repon(2,s.mlieu);
- end;
- if (s.mlieu= 15) and (msg[4]= depl[6]) then
- begin
-  if not syn then ecr3('aller');
-  tfleche;
-  if iesc then okdes:= false;
-  if (anyone) or (iesc) then exit;
-  tcoord(1);
-  if num= 0 then exit;
-  if num= 1 then
-  begin
-   s.mlieu:= 0;
-   tmlieu(0);
-  end
-  else
-   if num= 7 then
-   begin
-    s.mlieu:= 13;
-    tmlieu(13);
-   end
-   else
-    if num<> 6 then s.mlieu:= 26;
-  if (num> 1) and (num< 6) then ment:= num- 1;
-  if num> 7 then ment:= num- 3;
-  if num<> 6 then affrep else aldepl;
-  exit;
- end;
- tsort;
- cx:= 0;
- repeat
-  cx:= cx+ 1;
- until depl[cx]= msg[4];
- if s.mlieu= 19 then
- begin
-  if cx= 1 then t1deva;
-  if cx= 2 then t1neig;
-  goto 2;
- end;
- if s.mlieu= 23 then
- begin
-  if cx= 1 then t1deau;
-  if cx= 2 then t1derr;
-  goto 2;
- end;
- if (s.mlieu= 11) and (cx= 1) then cx:= 6;
- if s.mlieu= 12 then
- begin
-  if cx= 2 then cx:= 6;
-  if cx= 5 then cx:= 16;
- end;
- if (s.mlieu= 14) and (cx= 3) then cx:= 6;
- if ((s.mlieu= 15) or (s.mlieu= 26)) and (cx= 4) then cx:= 6;
- if (s.mlieu> 19) and (s.mlieu<> 26) then cx:= cx+ 10;
- if (s.mlieu= 20) and (cx= 13) then cx:= 16;
- if s.mlieu= 21 then
- begin
-  if cx= 12 then cx:= 16 else
-  if cx> 13 then cx:= 15;
- end;
- if (s.mlieu= 22) and (cx> 14) then cx:= 15;
- if (s.mlieu= 24) and (cx<> 17) then
-  if cx> 13 then cx:= 15;
- if cx= 1 then s.mlieu:= 11 else
- if cx= 2 then s.mlieu:= 12 else
- if cx= 3 then s.mlieu:= 14 else
- if cx= 4 then s.mlieu:= 15 else
- if cx= 5 then cx:= 12;
- if cx= 6 then cx:= 11;
- if cx= 11 then t1sama else
- if cx= 12 then t1deva else
- if cx= 13 then s.mlieu:= 20 else
- if cx= 14 then s.mlieu:= 24 else
- if cx= 15 then t1neig else
- if cx= 16 then t1derr else
- if cx= 17 then
- begin
-  if (s.ipuit<> 120) and (s.ipuit<> 140) then crep:= 997 else
-   if s.ipuit= 120 then crep:= 181 else
-    if s.conf> 80 then
-    begin
-     crep:= 1505;
-     tperd;
-    end
-    else
-    begin
-     s.mlieu:= 23;
-     affrep;
-    end;
- end;
- if (cx< 5) or (cx= 13) or (cx= 14) then affrep;
- debloc(s.mlieu);
-2:
- tmlieu(s.mlieu);
-end;
-
-overlay procedure tprendre;
-var
- cx, cy, cz: integer;
-begin
- if caff> 99 then
- begin
-  cx:= caff;
-  avpoing(cx);
-  if crep<> 139 then
-  begin
-   if ipers> 0 then s.conf:= s.conf+ 3;
-   if obpart then
-   begin
-    if s.mlieu= 2 then s.iloic:= 0;
-    if s.mlieu= 13 then
-    begin
-     if s.iboul= caff then s.iboul:= 0;
-     if s.ibag= caff then s.ibag:= 0;
-    end;
-    if s.mlieu= 14 then s.icave:= 0;
-    if s.mlieu= 16 then s.icryp:= 0;
-    if s.mlieu= 17 then s.ivier:= 0;
-    if s.mlieu= 24 then s.ipuit:= 0;
-    mfouen;
-    obpart:= false;
-    affrep;
-   end
-   else
-   begin
-    tabdon[acha+ (pred(mchai)* 10)+ pred(cs)]:=0;
-    tsuiv;
-    dobj:= dobj+ 1;
-    if dobj> 6 then
-    begin
-     s.conf:= s.conf+ 2;
-     dobj:= 0;
-    end;
-   end;
-  end;
-  exit;
- end;
- if not syn then ecr3('prendre');
- tfleche;
- if (anyone) or (iesc) then exit;
- if caff= 3 then
- begin
-  tcoord(2);
-  if num= 1 then
-  begin
-   crep:= 152;
-   exit;
-  end;
- end;
- tcoord(5);
- if (num= 0) or ((num= 1) and (s.mlieu= 16)) then
- begin
-  tcoord(8);
-  if num<> 0 then
-  begin
-   if ipers> 0 then s.conf:= s.conf+ 3;
-   crep:= 997;
-   if (s.mlieu= 2) and (s.iloic<> 0) then avpoing(s.iloic);
-   if (s.mlieu=13) and (num=1) and (s.iboul<>0) then
-   begin
-    avpoing(s.iboul);
-    if (crep<> 997) and (crep<> 139) then aniof(2,7);
-   end;
-   if (s.mlieu=13) and (num=2) and (s.ibag<>0) then
-   begin
-    avpoing(s.ibag);
-    if (crep<> 997) and (crep<> 139) then aniof(2,6);
-   end;
-   if (s.mlieu= 14) and (s.icave<> 0) then
-   begin
-    avpoing(s.icave);
-    if (crep<> 997) and (crep<> 139) then aniof(2,2);
-   end;
-   if (s.mlieu= 16) and (s.icryp<> 0) then avpoing(s.icryp);
-   if (s.mlieu= 17) and (s.ivier<> 0) then
-   begin
-    avpoing(s.ivier);
-    if (crep<> 997) and (crep<> 139) then
-    begin
-     crep:= 182;
-     aniof(2,1);
-    end;
-   end;
-   if (s.mlieu= 24) and (s.ipuit<> 0) then
-   begin
-    avpoing(s.ipuit);
-    if (crep<> 997) and (crep<> 139) then aniof(2,1);
-   end;
-   if (crep<> 997) and (crep<> 182) and (crep<> 139) then crep:= 999;
-  end;
- end
- else
- begin
-  if ((s.mlieu= 0) and (num= 3)) or ((s.mlieu= 1) and (num= 4))
-  or ((s.mlieu= 2) and (num= 1)) or ((s.mlieu= 4) and (num= 3))
-  or ((s.mlieu= 5) and (num= 6)) or ((s.mlieu= 6) and (num= 2))
-  or ((s.mlieu= 7) and (num= 6)) or ((s.mlieu= 8) and (num= 4))
-  or ((s.mlieu= 9) and (num= 4)) or ((s.mlieu= 10) and (num> 2))
-  or ((s.mlieu= 11) and (num= 7)) or ((s.mlieu= 12) and (num= 6))
-  or ((s.mlieu= 13) and (num> 4)) or ((s.mlieu> 13)
-  and (s.mlieu<> 23)) then crep:= 997 else
-  begin
-   if s.mlieu= 23 then
-   begin
-    crep:= 1504;
-    tperd;
-   end
-   else crep:= 120;
-  end;
- end;
-end;
-
-overlay procedure tsprendre;
-var
- cx,cy,cz: integer;
-begin
- cx:= 0;
- repeat
-  cx:= cx+ 1;
- until invt[cx]= msg[4];
- cz:= 0;
- cy:= 0;
- repeat
-  cy:= cy+ 1;
-  if ord(s.sjer[cy])<> 0 then cz:= cz+ 1;
- until cz= cx;
- cz:= ord(s.sjer[cy]);
- s.sjer[cy]:= chr(0);
- modinv;
- avpoing(cz);
- crep:= 998;
- clsf2;
-end;
-
-overlay procedure tsoulever;
-label 1;
-var
- cx: integer;
-begin
- if not syn then ecr3('soulever');
- tfleche;
- if (anyone) or (iesc) then exit;
- tcoord(3);
- if num= 0 then
- begin
-  tcoord(8);
-  if num<> 0 then
-  begin
-   if ipers> 0 then s.conf:= s.conf+ 1;
-   crep:= 997;
-   if (s.mlieu= 2) and (s.iloic<> 0) then treg(s.iloic);
-  end;
-  exit;
- end;
- if ipers> 0 then s.conf:= s.conf+ 1;
- cx:= s.mlieu;
- if s.mlieu= 16 then cx:= 14;
- if s.mlieu= 19 then cx:= 15;
- crep:= tabdon[asoul+(cx shl 3)+pred(num)];
- if crep= 255 then crep:= 997;
-end;
-
-overlay procedure tlire;
-var
- iaff: integer;
-begin
- if caff> 99 then st4(caff) else
- begin
-  if not syn then ecr3('lire');
-  tfleche;
-  if not (anyone) and not (iesc) then
-  begin
-   tcoord(4);
-   if num<> 0 then crep:= 107;
-  end;
- end;
-end;
-
-overlay procedure tslire;
-begin
- if s.derobj= 0 then crep:= 186 else st4(s.derobj);
-end;
-
-overlay procedure tregarder;
-var
- cx: integer;
-begin
- if caff> 99 then
- begin
-  crep:= 103;
-  exit;
- end;
- if not syn then ecr3('regarder');
- tfleche;
- if (anyone) or (iesc) then exit;
- tcoord(5);
- if num= 0 then
- begin
-  tcoord(8);
-  crep:= 131;
-  if num<> 0 then
-  begin
-   if s.mlieu= 13 then
-   begin
-    if num= 1 then
-    begin
-     crep:= 164;
-     if s.ibag<> 0 then treg(s.ibag) else
-      if s.iboul<> 0 then treg(s.iboul);
-    end
-    else
-    begin
-     crep:= 193;
-     if s.ibag<> 0 then treg(s.ibag);
-    end;
-   end;
-   if s.mlieu= 14 then
-   begin
-    crep:= 164;
-    if s.icave<> 0 then treg(s.icave);
-   end;
-   if s.mlieu= 17 then
-   begin
-    crep:= 174;
-    if s.ivier<> 0 then treg(s.ivier);
-   end;
-   if s.mlieu= 24 then
-   begin
-    crep:= 131;
-    if s.ipuit<> 0 then treg(s.ipuit);
-   end;
-  end;
-  exit;
- end;
- cx:= s.mlieu;
- if s.mlieu= 20 then cx:= 17;
- if (s.mlieu> 21) and (s.mlieu< 25) then cx:= cx- 4;
- if s.mlieu= 26 then cx:= 21;
- crep:= tabdon[arega+(cx*7)+pred(num)];
- if (s.mlieu= 13) and (num= 8) then crep:= 126;
- if s.mlieu= 19 then crep:= 103;
- if crep= 255 then crep:= 131;
- if (s.mlieu= 1) and (num= 1) then treg(144);
- if (s.mlieu= 5) and (num= 3) then treg(147);
- if (s.mlieu= 8) and (num= 3) then treg(149);
- if (s.mlieu= 9) and (num= 2) then treg(30);
- if (s.mlieu= 10) and (num= 3) then treg(31);
-end;
-
-overlay procedure tsregarder;
-begin
- if s.derobj<> 0 then treg(s.derobj) else crep:= 186;
-end;
-
-overlay procedure tfouiller;
-const r:array[0..13] of byte=(123,104,123,131,131,123,104,131,123,123,106,123,123,107);
-var
- cx: integer;
-begin
- if caff> 99 then
- begin
-  st7(caff);
-  exit;
- end;
- if not syn then ecr3('fouiller');
- tfleche;
- if (anyone or iesc) then exit;
- if s.mlieu=23 then
- begin
-  crep:= 1504;
-  tperd;
-  exit;
- end;
- tcoord(6);
- if num= 0 then
- begin
-  tcoord(7);
-  if num<>0 then
-  begin
-   cx:=0;
-   repeat
-    cx:=cx+1;
-   until (cx>6) or (num= ord(touv[cx]));
-   if num<>ord(touv[cx]) then crep:=187 else
-   begin
-    if ipers>0 then s.conf:= s.conf+3;
-    rechai(mchai);
-    if mchai<>0 then
-    begin
-     cs:=0;
-     is:=0;
-     fouil:=true;
-     mfoudi;
-     tsuiv;
-    end
-    else crep:=997;
-   end;
-  end
-  else
-  begin
-   tcoord(8);
-   crep:= 997;
-   if num<>0 then
-   begin
-    if ipers>0 then s.conf:=s.conf+3;
-    if (s.mlieu<>24) and (s.mlieu<>17) and (s.mlieu<>13) then
-    begin
-     if s.mlieu=2 then
-     begin
-      crep:= 123;
-      if s.iloic<>0 then treg(s.iloic);
-     end;
-     if s.mlieu=16 then
-     begin
-      crep:= 123;
-      if s.icryp<>0 then treg(s.icryp);
-     end;
-    end;
-   end;
-  end;
- end
- else
- begin
-  if ipers>0 then s.conf:=s.conf+ 3;
-  crep:= 997;
-  if s.mlieu < 14 then crep:= r[s.mlieu];
-  if (s.mlieu= 3) and (num= 2) then crep:=162;
-  if (s.mlieu= 12) then
-  begin
-   if (num= 3) or (num= 4) then crep:=162;
-   if num= 5 then crep:= 159;
-  end;
-  if s.mlieu=19 then crep:=104;
-  if s.mlieu=16 then crep:=155;
- end;
-end;
-
-overlay procedure tsfouiller;
-begin
- if s.derobj<>0 then st7(s.derobj) else crep:= 186;
-end;
-
-overlay procedure touvrir;
-var
- cx,haz:integer;
-begin
- if not syn then ecr3('ouvrir');
- if caff= 26 then
- begin
-  if ment<> 0 then
-  begin
-   msg[4]:= entrer;
-   syn:= true;
-  end
-  else crep:= 997;
-  exit;
- end;
- if caff= 15 then
- begin
-  aldepl;
-  exit;
- end;
- tfleche;
- if (anyone) or (iesc) then exit;
- tcoord(7);
- if num<> 0 then
- begin
-  if ipers> 0 then s.conf:= s.conf+ 2;
-  iouv:= iouv+ 1;
-  cx:= 0;
-  repeat
-   cx:= cx+ 1;
-  until (cx> 6) or (ord(touv[cx])= 0) or (ord(touv[cx])= num);
-  if ord(touv[cx])<> num then
-  begin
-   if not
-    (
-     ( (num= 3) and ((s.mlieu= 0) or (s.mlieu= 9) or (s.mlieu= 5) or (s.mlieu= 7)) )
-     or
-      ((num= 4) and ((s.mlieu= 1) or (s.mlieu= 2) or (s.mlieu= 6))) or
-      ((s.mlieu= 4) and (num= 5)) or
-      ((num= 6) and ((s.mlieu= 7) or (s.mlieu= 10) or
-                     (s.mlieu= 8) or (s.mlieu= 13))) or
-      ((s.mlieu= 8) and (num= 2)) or
-      ((s.mlieu= 12) and (num= 7))) then
-      begin
-         if ((s.mlieu> 10) and (s.mlieu< 14)) or
-          ((s.mlieu> 6) and (s.mlieu< 10)) or
-          (s.mlieu= 0) or (s.mlieu= 2) or (s.mlieu= 5) then
-          begin
-            haz:= hazard(1, 4);
-            if haz= 3 then parole(7, 9, 1);
-          end;
-        touv[cx]:= chr(num);
-        aniof(1,num);
-      end;
-   cx:= s.mlieu;
-   if s.mlieu= 16 then cx:= 14;
-   crep:= tabdon[aouvr+ (cx* 7)+ pred(num)];
-   if crep= 254 then crep:= 999;
-  end
-  else crep:= 18;
- end;
-end;
-
-overlay procedure tmettre;
-var
- quel: integer;
- entre : boolean;
- st : phrase;
- str : str255;
- i,tay : integer;
-begin
- if s.derobj= 0 then
- begin
-  crep:= 186;
-  exit;
- end;
- if not syn then ecr3('mettre');
- tfleche;
- if iesc then crep:= 998;
- if (anyone) or (iesc) then exit;
- tcoord(8);
- if num<> 0 then
- begin
-  crep:= 999;
-  if caff= 13 then
-  begin
-   if num= 1 then
-   begin
-    if s.iboul<> 0 then crep:= 188 else
-    begin
-     s.iboul:= s.derobj;
-     if s.derobj= 141 then aniof(1,7);
-    end;
-   end
-   else
-    if s.ibag<> 0 then crep:= 188 else
-    begin
-     s.ibag:= s.derobj;
-     if s.derobj= 159 then aniof(1,6);
-    end;
-  end;
-  if caff= 14 then
-   if s.icave<>0 then crep:= 188 else
-   begin
-    s.icave:= s.derobj;
-    if s.derobj= 151 then
-    begin
-     aniof(1,2);
-     aniof(1,1);
-     repon(2,165);
-     maivid;
-     parole(6, -9, 1);
-     quel:= do_alert(stouinon,1);
-     if quel=1 then begin
-                      deline(582,st,tay);
-                      i:= do_alert(delig,1);
-                      tesok:=False;
-                      entre:= ques;
-                      hide_mouse;
-                      hirs;
-                      dessine_rouleau;
-                      clsf2;
-                      clsf3;
-                      show_mouse;
-                      tinke;
-                      pendule;
-                      if ipers<>0 then affper(ipers)
-                                  else person;
-                      menu_aff;
-                      if entre then
-                         begin
-                           s.mlieu:= 17;
-                           tmlieu(17);
-                         end
-                        else
-                         begin
-                           tmlieu(s.mlieu);
-                           writepal(14);
-                           dessin(0);
-                           aniof(1,2);
-                           aniof(1,1);
-                           DeLine(577,st,tay);
-                           i:= do_alert(delig,1);
-                           aniof(2,1);
-                           crep:= 166;
-                         end;
-                      affrep;
-                    end
-               else begin
-                      aniof(2,1);
-                      crep:= 166;
-                      tesok:=True;
-                    end;
-     exit;
-    end;
-   end;
-  if caff= 16 then
-   if s.icryp= 0 then s.icryp:= s.derobj else crep:= 188;
-  if caff= 17 then
-   if s.ivier<>0 then crep:= 188 else
-    if s.derobj= 143 then
-    begin
-     s.ivier:= 143;
-     aniof(1,1);
-    end
-    else
-    begin
-     crep:= 1512;
-     tperd;
-    end;
-  if caff= 24 then
-   if s.ipuit<> 0 then crep:= 188 else
-    if (s.derobj= 140) or (s.derobj= 120) then
-    begin
-     s.ipuit:= s.derobj;
-     aniof(1,1);
-    end
-    else crep:= 185;
-  if crep<> 188 then maivid;
- end;
-end;
-
-overlay procedure ttourner;
-var
- quel: integer;
-begin
- if caff> 99 then
- begin
-  crep:= 149;
-  exit;
- end;
- if not syn then ecr3('tourner');
- tfleche;
- if (anyone) or (iesc) then exit;
- tcoord(9);
- if num<> 0 then
- begin
-  crep:= 997;
-  if (s.mlieu= 13) and (s.ibag= 159) and (s.iboul= 141) then
-  begin
-   repon(2,167);
-   parole(7, 9, 1);
-   quel:= do_alert(stouinon,1);
-   if quel= 1 then solu:= true else crep:= 168;
-  end;
-  if (s.mlieu= 17) and (s.ivier= 143) then
-  begin
-   repon(2, 175);
-   clsf3;
-   parole(6, -9, 1);
-   quel:= do_alert(stouinon,1);
-   if quel= 1 then
-   begin
-    s.mlieu:= 16;
-    affrep;
-   end
-   else crep:= 176;
-  end;
- end;
-end;
-
-overlay procedure tcacher;
-begin
- if not syn then ecr3('se cacher');
- tfleche;
- if not (anyone) and not (iesc) then
- begin
-  tcoord(10);
-  if num= 0 then cache:= false else
-  begin
-   cache:= true;
-   crep:= 999;
-  end;
- end;
-end;
-
-overlay procedure tattacher;
-begin
- if s.derobj= 0 then crep:= 186 else
- begin
-  if not syn then ecr3('attacher');
-  tfleche;
-  if not (anyone) and not (iesc) then
-  begin
-   tcoord(8);
-   crep:= 997;
-   if (num<> 0) and (s.mlieu= 24) then
-   begin
-    crep:= 999;
-    if (s.derobj= 120) or (s.derobj= 140) then
-    begin
-     s.ipuit:= s.derobj;
-     aniof(1,1);
-    end
-    else crep:= 185;
-    maivid;
-   end;
-  end;
- end;
-end;
-
-overlay procedure tfermer;
-var
- cx,chai: integer;
-begin
- if not syn then ecr3('fermer');
- if caff< 26 then
- begin
-  tfleche;
-  if iesc then crep:= 998;
-  if (anyone) or (iesc) then exit;
-  tcoord(7);
-  if num<> 0 then
-  begin
-   cx:= 0;
-   repeat
-    cx:= cx+ 1;
-   until (cx> 6) or (num= ord(touv[cx]));
-   if num= ord(touv[cx]) then
-   begin
-    aniof(2,num);
-    crep:= 998;
-    touv[cx]:= chr(0);
-    iouv:= iouv- 1;
-    if iouv< 0 then iouv:= 0;
-    chai:= 9999;
-    rechai(chai);
-    if mchai= chai then mchai:= 0;
-   end
-   else crep:= 187;
-  end;
- end;
- if caff= 26 then crep:= 999;
-end;
-
-overlay procedure tfrapper;
-var
- l,p,haz: integer;
-begin
- if not syn then ecr3('frapper');
- if s.mlieu= 15 then
- begin
-  l:= do_alert('[1][ | Avant, utilisez le menu DEP...][ok]',1);
-  exit;
- end;
- if s.mlieu< 25 then
- begin
-  tfleche;
-  if not (anyone) and not (iesc) then
-   if (s.mlieu< 19) and (s.mlieu<> 15) then crep:= 133 else crep:= 997;
-  exit;
- end;
- if s.mlieu= 26 then
- begin
-  haz:= (hazard(0, 8))- 4;
-  parole(11, haz, 1);
-  ecfren(p,haz,s.conf,ment);
-  l:= ment;
-  if l<> 0 then
-   if p<> -500 then
-   begin
-    if haz> p then crep:= 190 else
-    begin
-     becfren(l);
-     frap;
-    end;
-   end
-   else frap;
-  if ment= 8 then crep:= 190;
- end;
-end;
-
-overlay procedure tposer;
-var
- cx,chai: integer;
-begin
- if not syn then ecr3('poser');
- if s.derobj= 0 then crep:= 186 else
- begin
-  if caff> 99 then
-  begin
-    crep:= 999;
-    ajchai;
-    if crep<> 192 then maivid;
-    exit;
-  end;
-  tfleche;
-  if (anyone) or (iesc) then exit;
-  tcoord(7);
-  crep:= 124;
-  if num<> 0 then
-  begin
-   rechai(chai);
-   if chai= 0 then crep:= 997 else
-   begin
-    cx:= 0;
-    repeat
-     cx:= cx+ 1;
-    until (cx> 6) or (num= ord(touv[cx]));
-    if num<> ord(touv[cx]) then crep:= 187 else
-    begin
-     mchai:= chai;
-     crep:= 999;
-    end;
-   end;
-  end
-  else
-  begin
-   tcoord(8);
-   if num<> 0 then
-   begin
-    crep:= 998;
-    if caff= 2 then
-     if s.iloic<> 0 then crep:= 188 else s.iloic:= s.derobj;
-    if caff= 13 then
-    begin
-     if num= 1 then
-     begin
-      if s.iboul<> 0 then crep:= 188 else s.iboul:= s.derobj;
-     end
-     else
-      if s.ibag<> 0 then crep:= 188 else s.ibag:= s.derobj;
-    end;
-    if caff= 16 then
-     if s.icryp<> 0 then crep:= 188 else s.icryp:= s.derobj;
-    if caff= 24 then crep:= 185;
-    if (caff= 14) or (caff= 17) then crep:= 124;
-   end
-   else
-   begin
-    crep:= 124;
-    if caff= 24 then
-    begin
-     tcoord(5);
-     if num<> 0 then crep:= 185;
-    end;
-   end;
-  end;
-  if caff= 23 then crep:= 185;
-  if (crep= 999) or (crep= 185) or (crep= 998) then
-  begin
-   if crep= 999 then ajchai;
-   if crep<> 192 then maivid;
-  end;
- end;
-end;
-
-overlay procedure tecouter;
-var
- l,p,haz,j,h,m: integer;
-begin
- if s.mlieu<> 26 then crep:= 101 else
- begin
-  if ipers<> 0 then s.conf:= s.conf+ 1;
-  ecfren(p,haz,s.conf,ment);
-  l:= ment;
-  if l<> 0 then
-   if p<> -500 then
-   begin
-    if haz> p then crep:= 101 else
-    begin
-     becfren(l);
-     calch(j,h,m);
-     haz:= hazard(1,100);
-     if (h>= 0) and (h< 8) then
-     begin
-      if haz> 30 then crep:= 101 else crep:= 178;
-     end
-     else
-      if haz> 70 then crep:= 101 else crep:= 178;
-    end;
-   end
-   else crep:= 178;
- end;
-end;
-
-overlay procedure tmanger;
-var
- j,h,m: integer;
-begin
- if (s.mlieu> 15) and (s.mlieu< 26) then
-  crep:= 148
- else
- begin
-  tsort;
-  s.mlieu:= 10;
-  caff:= 10;
-  debloc(s.mlieu);
-  tmlieu(s.mlieu);
-  calch(j,h,m);
-  if (h= 12) or (h= 13) or (h= 19) then
-  begin
-   s.conf:= s.conf- (s.conf div 7);
-   if h= 12 then
-    if m= 0 then h:= 4 else h:= 3;
-   if (h= 13) or (h= 19) then
-    if m= 0 then h:= 2 else h:= 1;
-   jh:= jh+ h;
-   crep:= 135;
-   tinke;
-  end
-  else crep:= 134;
- end;
-end;
-
-overlay procedure tentrer;
-var
- x, z: integer;
-begin
- if (s.mlieu= 21) or (s.mlieu= 22) then
- begin
-  t1sama;
-  tmlieu(s.mlieu);
- end
- else
-  if s.mlieu= 15 then aldepl else
-   if ment= 0 then crep:= 997 else
-   begin
-    if (ment= 9) and (s.derobj<> 136) then
-    begin
-     crep:= 189;
-     s.teauto[8]:= '*';
-    end
-    else
-    begin
-     if not blo then t11(ment, z);
-     if z<> 0 then
-     begin
-      if (ment= 3) or (ment= 7) then crep:= 179 else
-      begin
-       x:= (hazard(0, 10))- 5;
-       parole(7, x, 1);
-       aniof(1,1);
-{       tkey(5,32000);}
-       tip(z,x);
-       s.conf:= s.conf+ 1;
-       s.mlieu:= 15;
-       msg[3]:= discut;
-       msg[4]:= disc[x];
-       syn:= true;
-       if ment= 9 then
-       begin
-        col:= true;
-        caff:= 70;
-        afdes(0);
-        repon(2,caff);
-       end
-       else col:= false;
-       debloc(ment);
-       ment:= 0;
-      end;
-     end
-     else
-     begin
-      x:= (hazard(0, 10))- 5;
-      parole(7, x, 1);
-      aniof(1,1);
-{      tkey(1,32000);}
-      s.mlieu:= ment;
-      affrep;
-      debloc(s.mlieu);
-      tmlieu(s.mlieu);
-      ment:= 0;
-      mpers:= 0;
-      ipers:= 0;
-     end;
-    end;
-   end;
-end;
-
-overlay procedure tdormir;
-const
- m1= 'D‚sirez-vous vous r‚veiller?';
-var
- z,j,h,m,quel: integer;
-begin
- if (s.mlieu> 15) and (s.mlieu< 26) then
- begin
-  crep:= 148;
-  exit;
- end;
- if s.mlieu <> 0 then
- begin
-  tsort;
-  s.mlieu:= 0;
-  affrep;
-  afdes(0);
-  debloc(s.mlieu);
-  tmlieu(s.mlieu);
- end;
- clsf3;
- clsf2;
- ecrf2;
- ecr2(m1);
- calch(j,h,m);
- repeat
-   if h< 8 then
-     begin
-       s.conf:= s.conf- (s.conf div 20);
-       z:= (7- h)* 2;
-       if m= 30 then z:= z- 1;
-       jh:= jh+ z;
-       h:= 7;
-     end;
-   jh:= jh+ 2;
-   h:= h+ 1;
-   if h> 23 then h:= 0;
-   tinke;
-   quel:= do_alert(stouinon,1);
-   anyone:= false;
- until quel= 1;
- crep:= 998;
- num:= 0;
-end;
-
-overlay procedure tdefoncer;
-begin
- if not syn then ecr3('d‚foncer');
- if caff< 25 then tfleche;
- if (not anyone) and (not iesc) then
-    if s.mlieu<> 26 then crep:= 997 else
-   begin
-     crep:= 143;
-     s.conf:= s.conf+ 2;
-   end;
-end;
-
-overlay procedure tsortir;
-var
- lx: integer;
-begin
- tsort;
- crep:= 0;
- if (s.mlieu= 19) or (s.mlieu= 21) or (s.mlieu= 22)
- or (s.mlieu= 24) then crep:= 997 else
- begin
-  if (s.mlieu< 16) or (s.mlieu= 26) then lx:= 10;
-  if (s.mlieu= 10) or (s.mlieu= 20) then lx:= 21;
-  if (s.mlieu< 10) or (s.mlieu= 13) then lx:= 15;
-  if s.mlieu= 16 then
-  begin
-   lx:= 17;
-   crep:= 176;
-  end;
-  if s.mlieu= 17 then t23coul(lx);
-  if s.mlieu= 23 then lx:= 24;
-  if crep<> 997 then s.mlieu:= lx;
-  caff:= lx;
-  if crep= 0 then crep:= lx;
-  debloc(lx);
-  tmlieu(lx);
- end;
-end;
-
-overlay procedure tattendre;
-var
- quel: integer;
-begin
- mpers:= 0;
- clsf3;
- repeat
-   jh:= jh+ 1;
-   tinke;
-   if not blo then t11(s.mlieu, quel);
-   if (ipers<> 0) and (mpers= 0) then
-   begin
-     crep:= 998;
-     if (s.mlieu= 13) or (s.mlieu= 14) then cavegre;
-     if (s.mlieu> 0) and (s.mlieu< 10) then anyone:= true;
-     mpers:= ipers;
-     if not anyone then tinke;
-     exit;
-   end;
-   repon(2,102);
-   quel:= do_alert(stouinon,1);
- until quel= 2;
- crep:= 998;
- if not anyone then tinke;
-end;
-
-overlay procedure tsonder;
-begin
- if not syn then ecr3('sonder');
- if caff< 27 then
- begin
-  tfleche;
-  if not (anyone) and (not iesc) then crep:= 145;
-  num:= 0;
- end;
-end;
-
-overlay procedure tparler;
-
-var
-                               te : array[1..46] of boolean;
-       ix, cy, cx, max, haz, suj, co,lig,icm,
-            i, tay, choi, x, y, c : integer;
-                              tou : char;
-                              lib : array[1..46] of string[40];
-                               st : phrase;
-                                f : boolean;
-
-
-begin
- finfouil;
- if col then suj:= 128 else
-  begin
-    cx:= 0;
-    repeat
-      cx:= cx+ 1;
-    until disc[cx]= msg[4];
-    caff:= 69+ cx;
-    afdes(0);
-    repon(2,caff);
-    suj:= caff+ 60;
-  end;
- tkey1(false);
- mennor;
- hide_mouse;
- hirs;
- premtet;
- sparl(0,suj);
- hirs;
- for ix:= 1 to 46 do te[ix]:= false;
- for ix:=1 to 45 do
-     begin
-       DeLine(ix+c_tparler,st,tay);
-       lib[ix]:= delig;
-       for i:=tay to 40 do lib[ix]:=lib[ix]+' ';
-     end;
- lib[46]:=lib[45];
- lib[45]:=' ';
- show_mouse;
- repeat
-   choi:= 0;
-   icm:= 0;
-   co:= 0;
-   lig:= 0;
-   repeat
-     icm:= succ( icm );
-     putxy(co,lig);
-     if (s.teauto[icm]='*') then
-     if (te[icm]) then writetp(lib[icm],1)
-                  else writetp(lib[icm],0);
-     if icm=23 then begin
-                      lig:= 0;
-                      co:= 320;
-                    end
-               else lig:= lig + 8;
-   until icm=42;
-   putxy(320,176);
-   writetp(lib[46],0);
-   tou:= #0;
-   repeat
-     mov_mouse(f,tou);
-(*     if keypressed then read(kbd,tou);*)
-     read_pos_mouse(x,y,c);
-     x:= x *(3-res);
-     if x>319 then cx:= 41 else cx:= 1;
-     cy:= succ(y shr 3);                    { 0-199 => 1-25 }
-     if (cy>23) or ((cx=41) and (cy in [20..22])) then
-             begin
-               if choi<>0 then
-                  begin
-                    lig:= ((choi-1) mod 23) shl 3 ;
-                    if choi>23 then co:= 320 else co:= 0;
-                    putxy(co,lig);
-                    if te[choi] then writetp(lib[choi],0)
-                                else writetp(lib[choi],1);
-                    te[choi]:= not te[choi];
-                    choi:= 0;
-                  end;
-             end
-        else begin
-               ix:= cy;
-               if cx=41 then ix:= ix+23;
-               if ix<>choi then
-                  begin
-                    if choi<>0 then
-                       begin
-                         lig:= ((choi-1) mod 23) shl 3 ;
-                         if choi>23 then co:= 320 else co:= 0;
-                         putxy(co,lig);
-                         if te[choi] then writetp(lib[choi],0)
-                                     else writetp(lib[choi],1);
-                         te[choi]:= not te[choi];
-                       end;
-                    if (s.teauto[ix]='*') or (ix=46) then
-                       begin
-                         lig:= ((ix-1) mod 23) shl 3 ;
-                         if ix>23 then co:= 320 else co:= 0;
-                         putxy(co,lig);
-                         if te[ix] then writetp(lib[ix],0)
-                                   else writetp(lib[ix],1);
-                         te[ix]:= not te[ix];
-                         choi:= ix;
-                       end
-                      else choi:= 0;
-                  end;
-             end;
-   until (tou=#13) or ( ((c<>0) or clic) and (choi<>0));
-   clic:=false;
-   if choi<>46 then
-      begin
-        ix:= choi-1;
-        if col then
-           begin
-             col:= false;
-             s.mlieu:= 15;
-             if iouv> 0 then max:= 8 else max:= 4;
-             haz:= hazard(1,max);
-             if haz= 2 then suj:= 129 else
-                begin
-                  suj:= 138;
-                  s.conf:= s.conf+ (3* (s.conf div 10));
-                end;
-           end
-          else
-           if nbrep[caff- 69]< nbrepm[caff- 69] then
-           begin
-             suj:= tabdon[arep+ (ix shl 3)+ (caff- 70)];
-             s.conf:= s.conf+ tabdon[arcf+ ix];
-             nbrep[caff- 69]:= nbrep[caff- 69]+ 1;
-           end
-          else
-           begin
-             s.conf:= s.conf+ 3;
-             suj:= 139;
-           end;
-        hide_mouse;
-        hirs;
-        premtet;
-        sparl(0, suj);
-        show_mouse;
-        if (suj= 84) or (suj= 86) then
-           begin
-             s.pourc[5]:= '*';
-             s.teauto[7]:= '*';
-           end;
-        if (suj= 106) or (suj= 108) or (suj= 94) then
-           begin
-             for ix:= 29 to 31 do s.teauto[ix]:= '*';
-             s.pourc[7]:= '*';
-           end;
-        if suj= 70 then
-           begin
-             s.pourc[8]:= '*';
-             s.teauto[32]:= '*';
-           end;
-        hide_mouse;
-        hirs;
-        show_mouse;
-      end;
-    until (choi= 46) or (suj= 138);
- if col then
- begin
-  s.conf:= s.conf+ (3* (s.conf div 10));
-  hide_mouse;
-  hirs;
-  premtet;
-  sparl(0, 138);
-  show_mouse;
-  col:= false;
-  s.mlieu:= 15;
- end;
- ctrm:= 0;
- hide_mouse;
- hirs;
- dessine_rouleau;
- show_mouse;
- affper(ipers);
- tinke;
- pendule;
- affrep;
-(* chech;*)
- tmlieu(s.mlieu);
- clsf3;
-end;
-
-overlay procedure tsentir;
-begin
- crep:= 119;
- if caff< 26 then
- begin
-  if not syn then ecr3('sentir');
-  tfleche;
-  if not (anyone) and not (iesc) then
-   if caff= 16 then crep:= 153;
- end
- else
- if caff= 123 then crep:= 110;
- num:= 0;
-end;
-
-overlay procedure tgratter;
-begin
- crep:= 155;
- if caff< 27 then
- begin
-  if not syn then ecr3('gratter');
-  tfleche;
- end;
- num:= 0;
-end;
-
-(* NIVEAU 2 *)
-overlay procedure tmaj1;         { Le jeu est termin‚ !!! }
-begin
- arret:= true;
- tlu(13,152);
- maivid;
- clsf1;
- clsf2;
- clsf3;
- repon(9,1509);
- tkey1(false);
- hide_mouse;
- caff:= 70;
- taffich;
- hirs;
- premtet;
- sparl(0,141);
- show_mouse;
- clsf1;
- repon(9,1509);
- repon(2,142);
- tkey1(false);
- caff:= 32;
- afdes(0);
- repon(6,34);
- repon(2,35);
- musique(0);
- tkey1(false);
- messint(2036);
- tkey1(false);
- inzon;
-end;
-
-overlay procedure tencore;       { Perdu !!! }
-var
- quel: integer;
-begin
- clsf2;
- musique(0);
- tkey1(false);
- maivid;
- inzon;
- dprog;
- vh:= 10;
- vm:= 0;
- vj:= 0;
- min:= 0;
- heu:= 10;
- jou:= 0;
- repon(2,180);
- quel:= do_alert(stouinon,1);
- arret:= (quel<>1);
-end;
diff --git a/engines/mortevielle/original/0/AFF.COM b/engines/mortevielle/original/0/AFF.COM
deleted file mode 100644
index d64d397..0000000
Binary files a/engines/mortevielle/original/0/AFF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/AFFAMS.COM b/engines/mortevielle/original/0/AFFAMS.COM
deleted file mode 100644
index 577fd5a..0000000
Binary files a/engines/mortevielle/original/0/AFFAMS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/AFFEGA.COM b/engines/mortevielle/original/0/AFFEGA.COM
deleted file mode 100644
index 6fd86b9..0000000
Binary files a/engines/mortevielle/original/0/AFFEGA.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/AFFHER.COM b/engines/mortevielle/original/0/AFFHER.COM
deleted file mode 100644
index 9f7be45..0000000
Binary files a/engines/mortevielle/original/0/AFFHER.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/AFFICH.COM b/engines/mortevielle/original/0/AFFICH.COM
deleted file mode 100644
index 22085db..0000000
Binary files a/engines/mortevielle/original/0/AFFICH.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/AFFTAN.COM b/engines/mortevielle/original/0/AFFTAN.COM
deleted file mode 100644
index ac01221..0000000
Binary files a/engines/mortevielle/original/0/AFFTAN.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/ALERT.PAS b/engines/mortevielle/original/0/ALERT.PAS
deleted file mode 100644
index 6c0ba60..0000000
--- a/engines/mortevielle/original/0/ALERT.PAS
+++ /dev/null
@@ -1,197 +0,0 @@
-overlay function do_alert(str:str255; n:integer):integer;
-
-   const nligne=7;
-         coord: array[1..2,1..3] of integer
-               =( (150, 72, 103),
-                  (143, 107, 183) );
-   var coldep,esp,i,l,nbcase,quoi,ix:integer;
-       st, chaine:str255;
-       Limit: array[1..2,1..2]  of integer;
-       c,dumi:char;
-       s:array[1..2] of string[3];
-       cx,cy,cd,nbcol,nblig:integer;
-       touch,newaff,test,test1,test2,test3,dum : boolean;
-       cas : str30;
-
-     procedure decod(s:str255; var nbc,nbl,col : integer; var c : str255; var cs:str30);
-           var i,k : integer;
-               v : boolean;
-         begin
-           val(s[2],nbc,i);
-           c:= '';
-           nbl:= 0; i:= 5; k:= 0;
-           v:=True; col:=0;
-
-           while s[i]<>']' do
-             begin
-               c:=c+s[i];
-               if (s[i]='|') or (s[i+1]=']') then
-                  begin
-                    if k>col then col:=k;
-                    k:= 0;
-                    nbl:=nbl+1;
-                  end
-                else if s[i]<>' ' then v:=False;
-               i:=i+1;
-               k:=k+1;
-             end;
-           if v then begin
-                       c:='';
-                       col:=20;
-                     end
-                else begin
-                       c:=c+']';
-                       col:=col+6;
-                     end;
-           i:=i+1;
-           cs:=copy(s,i,30);
-           if res=2 then col:= col*6
-                    else col:= col*10;
-         end;
-
-     procedure posit(ji:integer);
-        begin
-          putxy(coldep + (40+esp) *pred(ji),98);
-        end;
-
-     procedure fait_boite(lidep,nli,tx:integer);
-          var x,y,xx,yy:integer;
-        begin
-          if tx>640 then tx:=640;
-          x:= 320- tx shr 1;
-          y:=pred(lidep) shl 3;
-          xx:=x+ tx;
-          yy:=y + nli shl 3;
-          box(15,Gd,x,y,xx,yy,255);
-          box(0,Gd,x,y+2,xx,y+4,255);
-          box(0,Gd,x,yy-4,xx,yy-2,255);
-        end;
-
-     procedure fait_choix(c:str30);
-          var i,l,x:integer;
-              ch:char;
-        begin
-          i:=1;
-          x:=coldep;
-          for l:=1 to nbcase do
-            begin
-              s[l]:='';
-              repeat
-                i:=i+1;
-                ch:=c[i];
-                s[l]:=s[l]+ch;
-              until c[i+1]=']';
-              i:=i+2;
-              while length(s[l])<3 do s[l]:=s[l]+' ';
-              putxy(x,98);
-              writeg(' '+s[l]+' ',0);
-              x:= x+esp+40;
-            end;
-        end;
-
-begin
-  (*debug('** do_alert **');*)
-  hide_mouse;
-  while keypressed do read(kbd,dumi);
-  clic:=false;
-  decod(str,nbcase,nblig,nbcol,chaine,cas);
-  sauvecr(50,succ(nligne) shl 4);
-
-  i:=0;
-  if chaine='' then
-    begin
-      fait_boite(10,5,nbcol);
-    end
-   else
-    begin
-      fait_boite(8,7,nbcol);
-      i:=0;
-      ywhere:=70;
-      repeat
-        cx:= 320;
-        st:= '';
-        while not (chaine[i+1] in [#124,#93]) do
-          begin
-            i:=i+1;
-            st:=st+chaine[i];
-            if res=2 then cx:=cx-3
-                     else cx:=cx-5;
-          end;
-        putxy(cx,ywhere);
-        ywhere:=ywhere+6;
-        writeg(st,4);
-        i:=i+1;
-      until chaine[i]=']';
-    end;
-  if nbcase=1 then esp:= nbcol- 40
-              else esp:= (nbcol-nbcase*40) shr 1;
-  coldep:=320-nbcol shr 1+esp shr 1;
-  fait_choix(cas);
-  limit[1,1]:=(coldep) shr 1*res;
-  limit[1,2]:=limit[1,1]+40;
-  if nbcase=1 then
-     begin
-       limit[2,1]:=limit[2,2];
-     end
-   else
-     begin
-       limit[2,1]:=(320+esp shr 1) shr 1*res;
-       limit[2,2]:=(limit[2,1])+40;
-     end;
-  show_mouse;
-  quoi:=0;
-  dum:=false;
-  repeat
-    dumi:=#255;
-    mov_mouse(dum,dumi);
-    cx:= X_S;
-    cy:= Y_S;
-    test:=(cy>95) and (cy<105);
-    newaff:=false;
-    if test then
-     begin
-       test1:=(cx>limit[1,1]) and (cx<limit[1,2]);
-       test2:=test1;
-       if nbcase>1 then test2:= test1 or ((cx>limit[2,1]) and (cx<limit[2,2]));
-       if test2 then
-        begin
-          newaff:=true;
-          if test1 then ix:=1
-                   else ix:=2;
-          if (ix<>quoi)  then
-           begin
-             hide_mouse;
-             if quoi<>0 then
-              begin
-                posit(quoi);
-                writeg(' '+s[quoi]+' ',0);
-              end;
-             posit(ix);
-             writeg(' '+s[ix]+' ',1);
-             quoi:=ix;
-             show_mouse;
-           end;
-        end;
-     end;
-    if (quoi<>0) and not newaff then
-     begin
-       hide_mouse;
-       posit(quoi);
-       writeg(' '+s[quoi]+' ',0);
-       quoi:=0;
-       show_mouse;
-     end;
-     test3:=(cy>95) and (cy<105) and (((cx>limit[1,1]) and (cx<limit[1,2]))
-                                   or ((cx>limit[2,1]) and (cx<limit[2,2])));
-  until clic;
-  clic:=false;
-  hide_mouse;
-  if not test3 then begin
-                  quoi:=n;
-                  posit(n);
-                  writeg(' '+s[n]+' ',1);
-                end;
-  charecr(50,succ(nligne) shl 4);
-  show_mouse;
-  do_alert:=quoi;
-end;
diff --git a/engines/mortevielle/original/0/AS.PAS b/engines/mortevielle/original/0/AS.PAS
deleted file mode 100644
index cd407e1..0000000
--- a/engines/mortevielle/original/0/AS.PAS
+++ /dev/null
@@ -1,17 +0,0 @@
-(*---------------------------------------------------------------------------*)
-(*--------------------   PROCEDURES  EN  ASSEMBLEUR   -----------------------*)
-(*---------------------------------------------------------------------------*)
-
-procedure decomp(seg,dep:integer); external 'c:\mc\decomp.com';
-(* procedure affams(seg,dep,x,y:integer); external 'c:\mc\affams.com';
- procedure affcga(seg,dep,x,y:integer); external 'c:\mc\cga.com';
- procedure affega(seg,dep,x,y:integer); external 'c:\mc\affega.com';
- procedure affher(seg,dep,x,y:integer); external 'c:\mc\affher.com';
- procedure afftan(seg,dep,x,y:integer); external 'c:\mc\afftan.com';*)
-procedure afff(Gd,seg,dep,x,y:integer); external 'c:\mc\affich.com';
-procedure S_sauv(Gd,y,dy:integer);  external 'c:\mc\sauvecr.com';
-procedure S_char(Gd,y,dy:integer);  external 'c:\mc\charecr.com';
-procedure musyc(tb:tablint;nbseg,att:integer);  external 'c:\mc\reusint.com';
-procedure litph(t:tablint;typ,tempo:integer); external 'c:\mc\phint.com';
-procedure demus(Src, Dst, Tay : integer); external 'c:\mc\demus.com';
-procedure zzuul(ad,seg,tai:integer); external 'c:\mc\zuul.com';
diff --git a/engines/mortevielle/original/0/AXX.MOR b/engines/mortevielle/original/0/AXX.MOR
deleted file mode 100644
index 81954bd..0000000
Binary files a/engines/mortevielle/original/0/AXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/AZZ.MOR b/engines/mortevielle/original/0/AZZ.MOR
deleted file mode 100644
index 55088f3..0000000
Binary files a/engines/mortevielle/original/0/AZZ.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/BMOR.MOR b/engines/mortevielle/original/0/BMOR.MOR
deleted file mode 100644
index 51f3378..0000000
Binary files a/engines/mortevielle/original/0/BMOR.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/BOITE.COM b/engines/mortevielle/original/0/BOITE.COM
deleted file mode 100644
index e274143..0000000
Binary files a/engines/mortevielle/original/0/BOITE.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/BOITE.PAS b/engines/mortevielle/original/0/BOITE.PAS
deleted file mode 100644
index d472de6..0000000
--- a/engines/mortevielle/original/0/BOITE.PAS
+++ /dev/null
@@ -1,29 +0,0 @@
-procedure boite(x,y,dx,dy,coul : integer);
-   var i : integer;
-      xi,yi,xo,yo : integer;
- begin
-   (* debug('boite'); *)
-   hide_mouse;
-   if res=1 then
-      begin
-        x:= x shr 1;
-        dx:= dx shr 1;
-      end;
-   xi:=x; yi:=y; xo:=x; yo:=y;
-   for i:=0 to dx+dy do
-      begin
-        putpix(Gd,xi,yi,coul);
-        if xi=x+dx then begin
-                          if Gd<>cga then putpix(Gd,pred(xi),yi,coul);
-                          yi:=succ(yi);
-                        end
-                   else xi:=succ(xi);
-        putpix(Gd,xo,yo,coul);
-        if yo=y+dy then xo:=succ(xo)
-                   else begin
-                          if Gd<>cga then putpix(Gd,succ(xo),yo,coul);
-                          yo:=succ(yo);
-                        end;
-      end;
-   show_mouse;
- end;
diff --git a/engines/mortevielle/original/0/BRUIT5 b/engines/mortevielle/original/0/BRUIT5
deleted file mode 100644
index 129a1b0..0000000
Binary files a/engines/mortevielle/original/0/BRUIT5 and /dev/null differ
diff --git a/engines/mortevielle/original/0/BRUITS b/engines/mortevielle/original/0/BRUITS
deleted file mode 100644
index de1a5bb..0000000
Binary files a/engines/mortevielle/original/0/BRUITS and /dev/null differ
diff --git a/engines/mortevielle/original/0/CFIEC.MOR b/engines/mortevielle/original/0/CFIEC.MOR
deleted file mode 100644
index 2038c7c..0000000
Binary files a/engines/mortevielle/original/0/CFIEC.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/CFIPH.MOR b/engines/mortevielle/original/0/CFIPH.MOR
deleted file mode 100644
index a1493e8..0000000
Binary files a/engines/mortevielle/original/0/CFIPH.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/CGA.COM b/engines/mortevielle/original/0/CGA.COM
deleted file mode 100644
index 5ed874a..0000000
Binary files a/engines/mortevielle/original/0/CGA.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/CHARDES.COM b/engines/mortevielle/original/0/CHARDES.COM
deleted file mode 100644
index 252d639..0000000
Binary files a/engines/mortevielle/original/0/CHARDES.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/CHARECR.COM b/engines/mortevielle/original/0/CHARECR.COM
deleted file mode 100644
index 6cb6bcf..0000000
Binary files a/engines/mortevielle/original/0/CHARECR.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/CXX.MOR b/engines/mortevielle/original/0/CXX.MOR
deleted file mode 100644
index df5d947..0000000
Binary files a/engines/mortevielle/original/0/CXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/DEBUG.PAS b/engines/mortevielle/original/0/DEBUG.PAS
deleted file mode 100644
index 509549a..0000000
--- a/engines/mortevielle/original/0/DEBUG.PAS
+++ /dev/null
@@ -1,22 +0,0 @@
-type str79 = string[79];
-
-var le_file : text;
-
-procedure init_debug;
-begin
-(* assign(le_file,'c:\usr\mort\temoin.mor');
- rewrite(le_file);*)
-end;
-
-procedure out_debug;
-begin
-(*  close(le_file);*)
-end;
-
-procedure debug(l : str79);
-begin
-  (*port[$3DD]:=15;
-  gotoxy(1,10);
-  write(l);
-  writeln(le_file,l);*)
-end;
diff --git a/engines/mortevielle/original/0/DEC.MOR b/engines/mortevielle/original/0/DEC.MOR
deleted file mode 100644
index 01d5913..0000000
Binary files a/engines/mortevielle/original/0/DEC.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/DECOMP.COM b/engines/mortevielle/original/0/DECOMP.COM
deleted file mode 100644
index 4489ceb..0000000
Binary files a/engines/mortevielle/original/0/DECOMP.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/DECPASP.COM b/engines/mortevielle/original/0/DECPASP.COM
deleted file mode 100644
index 326c26f..0000000
Binary files a/engines/mortevielle/original/0/DECPASP.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/DEMUS.COM b/engines/mortevielle/original/0/DEMUS.COM
deleted file mode 100644
index 97c1c6f..0000000
Binary files a/engines/mortevielle/original/0/DEMUS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/DEMUS2.COM b/engines/mortevielle/original/0/DEMUS2.COM
deleted file mode 100644
index 97c1c6f..0000000
Binary files a/engines/mortevielle/original/0/DEMUS2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/DETECT.PAS b/engines/mortevielle/original/0/DETECT.PAS
deleted file mode 100644
index ec90368..0000000
--- a/engines/mortevielle/original/0/DETECT.PAS
+++ /dev/null
@@ -1,19 +0,0 @@
-function detect:integer;
-  const s:string[10]='1986 Amstr';
-  var i : integer;
-
-begin
-  Gd:=ega;
-  hirs;
-  mem[$a000:15920]:=37;
-  if mem[$a000:15920]<>37 then
-     begin
-       clrscr;
-       i:=1;
-       while (i<10) and (s[i]=chr(mem[$fc01:i])) do
-            i:=i+1;
-       if i>8 then Gd:=ams
-              else Gd:=cga;
-     end;
-  detect:=Gd
-end;
diff --git a/engines/mortevielle/original/0/DISK.PAS b/engines/mortevielle/original/0/DISK.PAS
deleted file mode 100644
index 22d7419..0000000
--- a/engines/mortevielle/original/0/DISK.PAS
+++ /dev/null
@@ -1,77 +0,0 @@
-
-procedure dem1;
-  var f:file;
-      k : integer;
-begin
-  { -- demande de disk 1 -- }
-  assign(f,'mort.005');
-  {$i-}
-  k:=ioresult;
-  reset(f);
-  while ioresult<>0 do
-   begin
-    show_mouse;
-    k:= do_alert(al_mess,1);
-    hide_mouse;
-    reset(f);
-   end;
-  close(f);
-end;
-
-procedure takesav(n:integer);
-  var   f : file;
-        i : integer;
-       st : string[10];
-begin
-  dem1;
-  { -- chargement du fichier 'sauve#n.mor' -- }
-  st:= 'sav'+chr(n+48)+'.mor';
-  assign(f,st);
-  reset(f,497);
-  blockread(f,s1,1);
-  if ioresult<>0 then
-     begin
-       i:=do_alert(err_mess,1);
-       halt;
-     end;
-  s:=s1;
-  for i:=0 to 389 do tabdon[i+acha]:=bufcha[i];
-  close(f);
-end;
-
-procedure ld_game;
-begin
-  hide_mouse;
-  maivid;
-  takesav(n);
-  { -- disquette 2 -- }
-  dem2;
-  { -- mises en place -- }
-  theure;
-  dprog;
-  antegame;
-  show_mouse;
-end;
-
-procedure sv_game;
-  var   f : file;
-        i : integer;
-begin
-  hide_mouse;
-  tmaj3;
-  dem1;
-  { -- sauvegarde du fichier 'sauve#n.mor' -- }
-  for i:=0 to 389 do bufcha[i]:=tabdon[i+acha];
-  s1:=s;
-  if s1.mlieu= 26 then s1.mlieu:= 15;
-  assign(f,'sav'+chr(n+48)+'.mor');
-  rewrite(f,497);
-  blockwrite(f,s1,1);
-  close(f);
-  dem2;
-  show_mouse;
-end;
-
-
-
-
diff --git a/engines/mortevielle/original/0/DIVAF.COM b/engines/mortevielle/original/0/DIVAF.COM
deleted file mode 100644
index dc61b0c..0000000
Binary files a/engines/mortevielle/original/0/DIVAF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/DON.MOR b/engines/mortevielle/original/0/DON.MOR
deleted file mode 100644
index 52c55b6..0000000
Binary files a/engines/mortevielle/original/0/DON.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/DROITE.PAS b/engines/mortevielle/original/0/DROITE.PAS
deleted file mode 100644
index 9e44e6c..0000000
--- a/engines/mortevielle/original/0/DROITE.PAS
+++ /dev/null
@@ -1,35 +0,0 @@
-procedure droite( x, y, xx, yy, coul : integer );
-      var
-         step,i : integer;
-         a,b : real;
-         xr,yr,xro,yro : real;
-   begin
-     xr:=x; yr:=y; xro:=xx; yro:=yy;
-     (*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*)
-     if abs(y-yy) > abs(x-xx) then
-        begin
-          a:= (x-xx) / (y-yy);
-          b:= ( yr*xro - yro*xr) / (y-yy);
-          i:=y;
-          if y>yy then step:=-1
-                  else step:=1;
-          repeat
-            putpix(Gd, trunc(a*i+b), i, coul);
-            i:=i+step;
-          until i=yy;
-          (*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*)
-        end
-      else
-        begin
-          a:= (y-yy) / (x-xx);
-          b:= ((yro*xr) - (yr*xro)) / (x-xx);
-          i:=x;
-          if x>xx then step:=-1
-                  else step:=1;
-          repeat
-            putpix(Gd,i, trunc(a*i+b), coul);
-            i:=i+step;
-          until i=xx;
-          (*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*)
-        end;
-   end;
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/DXX.MOR b/engines/mortevielle/original/0/DXX.MOR
deleted file mode 100644
index cc8f845..0000000
Binary files a/engines/mortevielle/original/0/DXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/DZZ.MOR b/engines/mortevielle/original/0/DZZ.MOR
deleted file mode 100644
index 0b1df4e..0000000
Binary files a/engines/mortevielle/original/0/DZZ.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/ECRIHEXA.PAS b/engines/mortevielle/original/0/ECRIHEXA.PAS
deleted file mode 100644
index 786d30a..0000000
--- a/engines/mortevielle/original/0/ECRIHEXA.PAS
+++ /dev/null
@@ -1,29 +0,0 @@
-procedure ecri1hexa(y:integer);
-begin
-  if y in [0..9] then write(y)
-                 else write(chr(y+55));
-end;
-
-
-procedure ecri_int(x:integer);
-begin
-  ecri1hexa(x shr 12);
-  ecri1hexa((x shr 8) mod 16);
-  ecri1hexa((x shr 4) mod 16);
-  ecri1hexa(x mod 16);
-end;
-
-procedure ecri_seg;
-  var c:char;
-begin
-  write('Segment programme => $');
-  ecri_int(Cseg);
-  writeln;
-  write('Segment donnees   => $');
-  ecri_int(Dseg);
-  writeln;
-  write('Segment pile      => $');
-  ecri_int(Sseg);
-  writeln;
-  read(kbd,c);
-end;
diff --git a/engines/mortevielle/original/0/FXX.MOR b/engines/mortevielle/original/0/FXX.MOR
deleted file mode 100644
index f8f47bb..0000000
Binary files a/engines/mortevielle/original/0/FXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/KEYBOARD.PAS b/engines/mortevielle/original/0/KEYBOARD.PAS
deleted file mode 100644
index 0fbd885..0000000
--- a/engines/mortevielle/original/0/KEYBOARD.PAS
+++ /dev/null
@@ -1,48 +0,0 @@
-function readkey : char;
-   var c : char;
-  begin
-    read(kbd,c);
-    readkey:= c;
-  end;
-
-function testou: integer;
-    var ch:char;
-  begin
-    read(kbd,ch);
-    case  ch  of
-              #19 : sonoff:= not sonoff;
-              #1,
-              #3,
-              #5  : begin
-                      newGd:= pred(ord(ch)) shr 1;
-                      testou:= 61;
-                      exit;
-                    end;
-              #8  : begin
-                      newGd:= Her;
-                      testou:= 61;
-                      exit;
-                    end;
-              #20 : begin
-                      newGd:= Tan;
-                      testou:= 61;
-                      exit;
-                    end;
-              #22 : if (c_zzz in [1,2]) then
-                       begin
-                         zzuul(adcfiec+161,0,1644);
-                         c_zzz:=succ(c_zzz);
-                         testou:=61;
-                         exit;
-                       end;
-              #27 : if keypressed then read(kbd,ch);
-      end;
-    testou:=ord(ch);
-  end;
-
-procedure teskbd;
-    var dum:integer;
-  begin
-    if keypressed then dum:=testou;
-  end;
-
diff --git a/engines/mortevielle/original/0/LEVEL15.PAS b/engines/mortevielle/original/0/LEVEL15.PAS
deleted file mode 100644
index edaf955..0000000
--- a/engines/mortevielle/original/0/LEVEL15.PAS
+++ /dev/null
@@ -1,176 +0,0 @@
-
-(* NIVEAU 15 *)
-procedure copcha;
-  var i:integer;
-begin
-  i:= acha;
-  repeat
-    tabdon[i]:=tabdon[i+390];
-    i:=succ(i);
-  until i=acha +390;
-end;
-
-function Dans_rect( R : rectangle ): boolean;
-     var x, y, c : integer;
-   begin
-     read_pos_mouse(x,y,c);
-     with R do
-       if (x>x1) and
-          (x<x2) and
-          (y>y1) and
-          (y<y2) then Dans_rect:= True
-                 else Dans_rect:= False;
-   end;
-
-procedure OutBloc(n : integer; p : pattern; pal:t_nhom);
-     var i,j,ad : integer;
-   begin
-     ad:=n*404+$D700;
-     with p do
-       begin
-         memw[$6000:ad]:= tax;
-         memw[$6000:ad+2]:= tay;
-         ad:=ad+4;
-         for i:=1 to tax do
-           for j:=1 to tay do
-             mem[$6000:ad+pred(j)*tax+pred(i)]:= pal[n].hom[des[i,j]];
-       end;
-   end;
-
-
-procedure writepal(n:integer);
-   var   i : integer;
-       pal : t_nhom;
-
- begin
-   case Gd of
-           tan,
-           ega,
-           ams : for i:=1 to 16 do
-                   begin
-                     mem[$7000:2*i]:= Tabpal[n,i].x;
-                     mem[$7000:succ(2*i)]:= Tabpal[n,i].y;
-                   end;
-           cga : begin
-                   pal:= palcga[n].a;
-                   if (n<89) then palette(palcga[n].p);
-                   for i:=0 to 15 do OutBloc(i, tpt[Pal[i].n],pal);
-                 end;
-   end;
- end;
-
-
-procedure PictOut(seg,dep,x,y:integer);
-   begin
-     decomp(seg,dep);
-     if Gd=Her then
-        begin
-          mem[$7000:2]:=0;
-          mem[$7000:32]:=15;
-        end;
-     if (caff<>51) and (memw[$7000:$4138]>$100) then memw[$7000:$4138]:=$100;
-     afff(Gd,seg,dep,x,y);
-   end;
-
-procedure putxy(x,y:integer);
-begin
-  xwhere:=x;
-  ywhere:=y;
-end;
-(*
-function calad(x,y:integer):integer;
-   begin
-     calad:=pred(x)+320*pred(y)
-   end;
-  *)
-procedure sauvecr(y,dy:integer);
-  begin
-    hide_mouse;
-    S_sauv(Gd,y,dy);
-    show_mouse;
-  end;
-
-procedure charecr(y,dy:integer);
-  begin
-    hide_mouse;
-    S_char(Gd,y,dy);
-    show_mouse;
-  end;
-(*
-function peek(ad:integer):integer;
-begin
-  peek:=tabdon[ad];
-end;
-
-function peekw(ad:integer):integer;
-begin
-  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
-end;
-
-function peekl(ad:integer):real;
-begin
-  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
-end;
-
-
-procedure poke (ad,n:integer);
-begin
-  tabdon[ad]:=lo(n);
-end;
-  *)
-
-procedure adzon;
-     var f:file;
-         g:file of byte;
-         a:byte;
-         i:integer;
-   begin
-     assign(f,'don.mor');
-     reset(f,256);
-     blockread(f,tabdon,7);
-     close(f);
-     assign(f,'bmor.mor');
-     reset(f,1916);
-     blockread(f,tabdon[fleche],1);
-     (*i:=fleche;
-     repeat
-       read(g,a);
-       tabdon[i]:=a;
-       i:=succ(i);
-     until i=fleche + 1916;*)
-     close(f);
-     assign(f,'dec.mor');
-     reset(f,1664);
-     blockread(f,mem[$73A2:0],1);
-     (*i:=0;
-     repeat
-       read(g,a);
-       mem[$73A2:i]:=a;
-       i:=succ(i);
-     until eof(g);*)
-     close(f);
-   end;
-
-function animof (ouf,num:integer):integer;
-     var nani, aux : integer;
-   begin
-     nani:= mem[adani:1];
-     aux:= num;
-     if ouf<>1 then aux:= aux+nani;
-     animof:=nani shl 2 + 2+swap(memw[adani: aux shl 1]);
-     (*aux:= nani shl 2 + 2;
-     if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
-              else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
-     animof:=aux;*)
-   end;
-
-(*procedure affgd(offs,dep,x,y:integer);
-begin
-  case Gd of
-     Ams : affams(offs,dep,x,y);
-     Cga : affcga(offs,dep,x,y);
-     Ega : affega(offs,dep,x,y);
-     Her : affher(offs,dep,x,y);
-     Tan : afftan(offs,dep,x,y);
-  end;
-end;*)
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/LITPH4.COM b/engines/mortevielle/original/0/LITPH4.COM
deleted file mode 100644
index f374940..0000000
Binary files a/engines/mortevielle/original/0/LITPH4.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/MENU.PAS b/engines/mortevielle/original/0/MENU.PAS
deleted file mode 100644
index 4323898..0000000
--- a/engines/mortevielle/original/0/MENU.PAS
+++ /dev/null
@@ -1,294 +0,0 @@
-(* NIVEAU 14*)
-
-overlay procedure menut(no : integer; nom: str30);
-     var h,l:byte;
-         s:str30;
-
-   begin
-     (* debug('menut'); *)
-     h:=hi(no);
-     l:=lo(no);
-     s:=nom;
-     if not tesok then
-        begin
-          clrscr;
-          halt;
-        end;
-     while length(s)<30 do s:=s+' ';
-     case h of
-           invent  :  if l<>7 then inv[l]:= ' '+s;
-           depla   :  dep[l]:= s;
-           action  :  act[l]:= s;
-           saction :  self[l]:= s;
-           discut  :  dis[l]:= s;
-        end;
-  end;
-
-overlay procedure menu_disable(no:integer);
-     var h,l:byte;
-   begin
-     (* debug('menu_disable'); *)
-     h:=hi(no);
-     l:=lo(no);
-     case h of
-           invent : begin
-                 if l>6 then begin
-                               inv[l][1]:='<';
-                               inv[l][22]:='>';
-                             end
-                        else inv[l][1]:='*';
-               end;
-           depla : dep[l][1]:='*';
-           action : act[l][1]:='*';
-           saction : self[l][1]:='*';
-           discut : dis[l][1]:='*';
-        end;
-   end;
-
-overlay procedure menu_enable(no:integer);
-     var h,l:byte;
-   begin
-     (* debug('menu_disable'); *)
-     h:=hi(no);
-     l:=lo(no);
-     case h of
-           invent : begin
-                      inv[l][1]:=' ';
-                      inv[l][22]:=' ';
-                    end;
-           depla : dep[l][1]:=' ';
-           action : act[l][1]:=' ';
-           saction : begin
-                       self[l][1]:=' ';
-                       self[l][1]:=' ';
-                     end;
-           discut : dis[l][1]:=' ';
-        end;
-   end;
-
-procedure menu_aff;
-     var
-         ind_tabl,k,col:integer;
-         c: char;
-         pt,x,y,color,msk,
-         num_letr: integer;
-   begin
-     (* debug('menu_aff'); *)
-     hide_mouse;
-     {if not tesok then
-        begin
-          clrscr;
-          halt;
-        end;}
-     box( 7, Gd, 0,0, 639,10, 255);
-     col:= 28*res;
-     if Gd = cga then color:=1
-                 else color:=9;
-     num_letr:=0;
-     repeat     (* lettre par lettre *)
-       num_letr:= num_letr +1;
-       ind_tabl:=0;
-       y:= 1;
-       repeat    (* colonne par colonne *)
-         k:=0;
-         x:= col;
-         repeat   (* ligne par ligne *)
-           msk:=$80;
-           for pt:=0 to 7 do
-            begin
-              if (lettres[num_letr,ind_tabl] and msk)<>0 then
-                 begin
-                   putpix(Gd,x+1,y+1,0);
-                   putpix(Gd,x,y+1,0);
-                   putpix(Gd,x,y,color);
-                 end;
-              msk:= msk shr 1;
-              x:=x +1;
-            end;
-           ind_tabl:=succ(ind_tabl);
-           k:=succ(k);
-         until k=3;
-         y:=y+1;
-       until (y=9);
-       col:=col+48*res;
-     until num_letr=6;
-     show_mouse;
-   end;
-
-
-procedure draw_menu;
-  begin
-    (* debug('draw_menu'); *)
-    menu_aff;
-    active_menu:=true;
-    msg4:=no_choice;
-    msg3:=no_choice;
-    choisi:=false;
-    clic:=false;
-    test0:=false;
-  end;
-
-procedure invers(ix:integer);
-     var s:string[23];
-   begin
-     (* debug('invers'); *)
-     if msg4=no_choice then exit;
-     putxy(don[msg3,1] shl 3,succ(lo(msg4)) shl 3);
-     case msg3 of
-                  1 : s:= inv[lo(msg4)];
-                  2 : s:= dep[lo(msg4)];
-                  3 : s:= act[lo(msg4)];
-                  4 : s:= self[lo(msg4)];
-                  5 : s:= dis[lo(msg4)];
-                  6 : s:= fic[lo(msg4)];
-                  7 : s:= fic[1]+' '+chr(48+lo(msg4));
-                  8 : if lo(msg4)=1 then s:=recom
-                              else s:= fic[2]+' '+chr(47+lo(msg4));
-          end;
-     if (s[1]<>'*') and (s[1]<>'<') then writeg(s,ix)
-                                    else msg4:=no_choice;
-   end;
-
-procedure util(x,y:integer);
-     var ymx, dxcar, xmn, xmx, ix:integer;
-   begin
-     (* debug('util'); *)
-     ymx:= don[msg3,4] shl 3+16;
-     dxcar:= don[msg3,3];
-     xmn:= don[msg3,1] shl 2*res;
-     if res=1 then ix:=5 else ix:=3;
-     xmx:= dxcar*ix*res+ xmn+ 2;
-     if (x>xmn) and (x<xmx) and (y<ymx) and (y>15) then
-             begin
-               ix:= pred(y shr 3)+ msg3 shl 8;
-               if ix<>msg4 then
-                 begin
-                   invers(1);
-                   msg4:=ix;
-                   invers(0);
-                 end;
-             end
-           else if msg4<>no_choice then
-                 begin
-                   invers(1);
-                   msg4:=no_choice;
-                 end;
-   end;
-
-procedure menu_down( ii :integer);
-     var cx, xcc:integer;
-         xco, nb_lig :integer;
-   begin
-     (* debug('menu_down'); *)
-     xco:=don[ii,1];
-     nb_lig:= don[ii,4];
-     hide_mouse;
-     sauvecr(10,succ(don[ii,2]) shl 1);
-     xco:= xco shl 3;
-     if res=1 then cx:=10 else cx:=6;
-     xcc:= xco+ (don[ii,3]*cx)+6;
-     box(15, Gd, xco,12, xcc, 10 + don[ii,2] shl 1, 255);
-     box(0, Gd, xcc, 12, xcc+4, 10 + don[ii,2] shl 1,255);
-     box(0,Gd,xco, 8 + don[ii,2] shl 1, xcc+4, 12 + don[ii,2] shl 1,255);
-     putxy(xco,16);
-     cx:=0;
-     repeat
-       cx:= succ(cx);
-       case ii of
-             1 : if inv[cx][1]<> '*' then writeg(inv[cx],4);
-             2 : if dep[cx][1]<> '*' then writeg(dep[cx],4);
-             3 : if act[cx][1]<> '*' then writeg(act[cx],4);
-             4 : if self[cx][1]<>'*' then writeg(self[cx],4);
-             5 : if dis[cx][1]<> '*' then writeg(dis[cx],4);
-             6 : writeg(fic[cx],4);
-             7 : writeg(fic[1]+' '+chr(48+cx),4);
-             8 : if cx=1 then writeg( recom,4)
-                         else writeg(fic[2]+' '+chr(47+cx),4);
-          end;
-       putxy(xco,ywhere+8)
-     until cx=nb_lig;
-     test0:=true;
-     show_mouse;
-   end;
-
-procedure menu_up(xx:integer);
-   begin
-     (* debug('menu_up'); *)
-     if test0 then
-       begin
-         charecr(10,succ(don[xx,2]) shl 1);
-         test0:=false;
-       end;
-   end;
-
-procedure erase_menu;
-  begin
-    (* debug('erase_menu'); *)
-    active_menu:=false;
-    clic:=false;
-    menu_up(msg3);
-  end;
-
-procedure mdn;
-       var x,y,c,a,ix:integer;
-           tes:boolean;
-   begin
-     (* debug('mdn'); *)
-     if not active_menu then exit;
-     x:=X_S; y:=Y_S;
-     if (not clic) then
-      begin
-        if (x=xprec) and
-           (y=yprec) then exit
-        else begin
-               xprec:=x;
-               yprec:=y;
-             end;
-        tes:=(y<11) and ((x in [28*res..28*res+24,76*res..76*res+24])
-                         or ((x>124*res) and (x<124*res+24))
-                         or ((x>172*res) and (x<172*res+24))
-                         or ((x>220*res) and (x<220*res+24))
-                         or ((x>268*res) and (x<268*res+24)));
-        if tes then
-           begin
-             if x<76*res then ix:=invent
-              else if x<124*res then ix:=depla
-               else if x<172*res then ix:=action
-                else if x<220*res then ix:=saction
-                 else if x<268*res then ix:=discut
-                  else ix:= fichier;
-             if (ix<>msg3) or (not test0) then
-              if not ((ix=fichier) and  (msg3 in [sauve, charge])) then
-                 begin
-                   menu_up(msg3);
-                   menu_down(ix);
-                   msg3:=ix;
-                   msg4:=no_choice;
-                 end;
-          end
-         else    { Not in the MenuTitle line }
-          begin
-            if (y>11) and (test0) then util(x,y);
-          end
-      end
-     else          (* il y a eu 'clic' *)
-     if (msg3=fichier) and (msg4<>no_choice) then
-       begin
-         clic:=false;
-         menu_up(msg3);
-         if lo(msg4)=1 then msg3:=7
-                   else msg3:=8;
-         menu_down(msg3);
-       end
-     else    (*  il y a eu clic sur un autre menu  *)
-       begin
-         choisi:=(test0) and (msg4<>no_choice);
-         menu_up(msg3);
-         msg[4]:=msg4;
-         msg[3]:=msg3;
-         msg3:=no_choice;
-         msg4:=no_choice;
-         clic:=false;
-       end;
-   end;
-
diff --git a/engines/mortevielle/original/0/MENUFR.MOR b/engines/mortevielle/original/0/MENUFR.MOR
deleted file mode 100644
index d773958..0000000
Binary files a/engines/mortevielle/original/0/MENUFR.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/MOR.PAS b/engines/mortevielle/original/0/MOR.PAS
deleted file mode 100644
index 7125524..0000000
--- a/engines/mortevielle/original/0/MOR.PAS
+++ /dev/null
@@ -1,1445 +0,0 @@
-(* Niveau 14 suite *)
-const
- m1= 'quelqu''un entre, parait ‚tonn‚ mais ne dit rien';
-
-
-procedure testfi;
-   begin
-     if ioresult<> 0 then
-        begin
-          caff:= do_alert(err_mess,1);
-          halt;
-        end;
-   end;
-
-
-function readclock: integer;
-     var       r : registres;
-         s, m, h : integer;
-begin
-(* debug('readclock');*)
-  r.ax := $2C00;
-  intr($21,r);
-  with r do
-  begin
-    h:=cx shr 8;
-    m:=cx mod 256;
-    s:=dx shr 8;
-  end;
-  m:= m * 60;
-  h:= h* 3600;
-  readclock:= h+ m+ s;
-end;
-
-procedure modif(var nu: integer);
-begin
- (* debug('modif'); *)
- if nu= 26 then nu:= 25;
- if (nu> 29) and (nu< 36) then nu:= nu- 4;
- if (nu> 69) and (nu< 78) then nu:= nu- 37;
- if (nu> 99) and (nu< 194) then nu:= nu- 59;
- if (nu> 996) and (nu< 1000) then nu:= nu- 862;
- if (nu> 1500) and (nu< 1507) then nu:= nu- 1363;
- if (nu> 1507) and (nu< 1513) then nu:= nu- 1364;
- if (nu> 1999) and (nu< 2002) then nu:= nu- 1851;
- if nu= 2010 then nu:= 151;
- if (nu> 2011) and (nu< 2025) then nu:= nu- 1860;
- if nu= 2026 then nu:= 165;
- if (nu> 2029) and (nu< 2037) then nu:= nu- 1864;
- if (nu> 3000) and (nu< 3005) then nu:= nu- 2828;
- if nu= 4100 then nu:= 177;
- if nu= 4150 then nu:= 178;
- if (nu> 4151) and (nu< 4156) then nu:= nu- 3973;
- if nu= 4157 then nu:= 183;
- if (nu= 4160) or (nu= 4161) then nu:= nu- 3976;
-end;
-
-
-procedure dessine(ad, x, y: integer);
-begin
-  (* debug('dessine'); *)
-  hide_mouse;
-  writepal(numpal);
-  PictOut(ad,0,x,y);
-  show_mouse;
-end;
-
-procedure dessine_rouleau;
-begin
-  (* debug('dessine_rouleau'); *)
-  writepal(89);
-  if gd=Her then
-     begin
-       mem[$7000:14]:=15;
-     end;
-  hide_mouse;
-  PictOut($73A2,0,0,0);
-  show_mouse;
-end;
-
-
-procedure text_color(c:integer);
-begin
-  color_txt:= c;
-end;
-
-(* NIVEAU 13 *)
-
-
-procedure text(x,y,nb,m: integer);
-   var st : phrase;
-       tay : integer;
-       co : integer;
-
-begin
-  (* debug('text'); *)
-  if res=1 then co:=10 else co:=6;
-  DeLine(m,st,tay);
-  if (y=182) and (tay*co>nb*6) then y:=176;
-  Afftex(st,x,y,nb,20,color_txt);
-end;
-
-procedure initouv;
-  var cx:integer;
- begin
-   (* debug('initouv'); *)
-   for cx:= 1 to 7 do touv[cx]:= chr(0)
- end;
-
-procedure ecrf1;
-begin
-  boite(0, 11, 512, 163, 15);           (* grand dessin *)
-end;
-
-procedure clsf1;
-  var i,j:integer;
-begin
- (* debug('clsf1'); *)
- hide_mouse;
- box(0,Gd, 0,11, 514,175, 255);
-(* if Gd=ams then port[$3DD]:=15;
- case Gd of
-         ams,
-         cga : begin
-                 for j:=0 to 63 do
-                    begin
-                      for i:=6 to 86 do
-                         begin
-                           mem[$B800:i*80+j]:=0;
-                           mem[$Ba00:i*80+j]:=0;
-                         end;
-                      mem[$b800:6960+j]:=0;
-                      mem[$ba00:400+j]:=0;
-                    end;
-               end;
-         ega : begin
-                 port[$3C4]:= 2;
-                 port[$3C5]:= 15;
-                 port[$3CE]:= 8;
-                 port[$3CF]:= 255;
-                 for j:=0 to 63 do
-                    for i:=11 to 174 do
-                       mem[$A000:i*80+j]:=0;
-               end;
-         tan : begin
-                 for j:=0 to 128 do
-                    begin
-                      for i:=3 to 43 do
-                         begin
-                           mem[$B800:i*160+j]:=0;
-                           mem[$Ba00:i*160+j]:=0;
-                           mem[$bc00:i*160+j]:=0;
-                           if i<>43 then mem[$be00:i*160+j]:=0;
-                         end;
-                      mem[$be00:320+j]:=0;
-                    end;
-               end;
- end;
- droite(256*res,11,256*res,175,0);*)
- show_mouse;
-end;
-
-procedure clsf2;
-   var i,j:integer;
-begin
- (* debug('clsf2'); *)
- hide_mouse;
- if f2_all then
-    begin
-      box(0,Gd,1,176,633,199,255);
-      boite(0,175,634,24,15);
-      f2_all:=false;
-    end
-  else
-    begin
-      box(0,Gd,1,176,633,190,255);
-      boite(0,175,634,15,15);
-    end;
- show_mouse;
-end;
-
-procedure ecrf2;
-begin
-  (* debug('ecrf2'); *)
-  text_color(5);
-  (*boite(0,175,630,15,15);*)
-end;
-
-procedure ecr2(str: str255);
-  var tab : integer;
-      tlig : integer;
-begin
- (* debug('ecr2 : '+str);*)
- if res=1 then tab:=10 else tab:=6;
- putxy(8,177);
- tlig:=59+pred(res)*36;
- if length(str)<tlig then writeg(str,5)
-  else if length(str)<tlig shl 1 then
-          begin
-            putxy(8,176);
-            writeg(copy(str,1,pred(tlig)),5);
-            putxy(8,182);
-            writeg(copy(str,tlig,tlig shl 1),5);
-          end
-   else begin
-          f2_all:=True;
-          clsf2;
-          putxy(8,176);
-          writeg(copy(str,1,pred(tlig)),5);
-          putxy(8,182);
-          writeg(copy(str,tlig,pred(tlig shl 1)),5);
-          putxy(8,190);
-          writeg(copy(str,tlig shl 1,tlig*3),5);
-        end;
-end;
-
-procedure clsf3;
-   var i,j:integer;
-begin
-  (* debug('clsf3'); *)
-  hide_mouse;
-  box(0,Gd,1,192,633,199,255);
-  boite(0,191,634,8,15);
-  show_mouse;
-end;
-
-procedure ecr3(text: str255);
-begin
- (* debug('ecr3 : '+text);*)
- clsf3;
- putxy(8,192);
- writeg(text,5);
-end;
-
-procedure ecrf6;
-begin
-  (* debug('ecrf6'); *)
-  text_color(5);
-  boite(62, 33, 363, 80, 15);
-end;
-
-procedure ecrf7;
-begin
- text_color(4);
-{ draw_mode(2);
- text_height(4*res);
- text_style(normal);}
-end;
-
-procedure clsf10;
-  var co,cod : integer;
-      st : string[8];
-begin
- (* debug('clsf10'); *)
- hide_mouse;
- if res=1 then
-    begin
-      co:=634;
-      cod:=534
-    end
-  else
-    begin
-      co:=600;
-      cod:=544;
-    end;
- box(15,Gd, cod, 93, co, 98, 255);
- if s.conf< 33 then st:='Cool'
-               else
- if s.conf< 66 then st:=' Lourde '
-               else
- if s.conf> 65 then st:='Malsaine';
- if res=1 then co:=10 else co:=6;
- co:= 574-co*length(st) shr 1;
- putxy(co,92);
- writeg(st,4);
- if res=1 then co:=620 else co:=584;
- box(15,Gd, 560, 24, co, 86, 255);
-(* rempli(69,12,32,5,255);*)
- show_mouse;
-end;
-
-   procedure stop;
-     begin
-       clrscr;
-       hirs;
-       Gd:=ams;
-       hirs;
-       halt;
-     end;
-
-procedure paint_rect(x, y, dx, dy : integer);
-     var co:integer;
-   begin
-     (* debug('paint_rect'); *)
-     if gd=cga then co:= 3
-               else co:=11;
-     box(co,Gd,x,y,x+dx,y+dy,255);
-   end;
-
-function hazard(min,max: integer): integer;
-     var ha1: integer;
-         ha2: real;
-   begin
-     (* debug('hazard'); *)
-     ha2:= random;
-     ha1:= trunc(ha2*(max-min));
-     hazard:= min+ ha1;
-   end;
-
-procedure calch(var j,h,m: integer);
-var
- th,nh: integer;
-begin
-(* debug('calch');*)
- nh:= readclock;
- th:= jh+ ((nh- mh) div t);
- m:= ((th mod 2)+ vm)* 30;
- h:= (th shr 1)+ vh;
- if m= 60 then
- begin
-  m:= 0;
-  h:= h+ 1;
- end;
- j:= (h div 24)+ vj;
- h:= h- ((j- vj)* 24);
-end;
-
-procedure conv(x : integer; var y: integer);
-var
- cx: integer;
-begin
- (* debug('conv'); *)
- cx:= 1;
- y:= 128;
- while cx< x do
- begin
-  y:= y shr 1;
-  cx:= succ(cx);
- end;
-end;
-
-(* NIVEAU 12 *)
-procedure okpas;
-begin
-  tesok:=True;
-end;
-
-procedure modobj(m: integer);
-var
- str: phrase;
- strp: str30;
- i,tay: integer;
-begin
- (* debug('modobj'); *)
- strp:=' ';
- if m<> 500 then
-    begin
-      DeLine(m- 501+ c_st41,str,tay);
-      strp:= delig;
-    end;
- menut( invt[8], strp);
- menu_disable( invt[8]);
-end;
-
-procedure modobj2(m: integer;t1,t2 : boolean);
-var
- str: phrase;
- strp: str30;
- i,tay: integer;
-begin
- (* debug('modobj'); *)
-  strp:=' ';
- if t1 or t2 then okpas
-             else tesok:=False;;
- if m<> 500 then
-    begin
-      DeLine(m- 501+ c_st41,str,tay);
-      strp:= delig;
-    end;
- menut( invt[8], strp);
- menu_disable( invt[8]);
-end;
-
-
-procedure repon(f,m: integer);
-var
- str: str255;
- str1: string[40];
- st : phrase;
- fic: text;
- i, xco, dx, caspe, tay : integer;
-begin
- (* debug('repon fenetre nø'+chr(f+48));*)
- if (m> 499) and (m< 563) then
- begin
-  DeLine( m-501+c_st41,st,tay);
-  if tay>(58+pred(res)*37) shl 1 then f2_all:= True
-                                 else f2_all:= False;
-  clsf2;
-  Afftex(st,8,176,85,3,5);
- end
- else
- begin
-  modif(m);
-  if f= 8 then f:= 2;
-  if f= 1 then f:= 6;
-  if f= 2 then
-  begin
-   clsf2;
-   ecrf2;
-   text(8, 182, 103, m);
-   if (m= 68) or (m= 69) then s.teauto[40]:= '*';
-   if (m= 104) and (caff= 14) then
-   begin
-    s.teauto[36]:= '*';
-    if s.teauto[39]= '*' then
-    begin
-     s.pourc[3]:= '*';
-     s.teauto[38]:= '*';
-    end;
-   end;
-  end;
-  if f in [6,9] then
-  begin
-   DeLine(m,st,tay);
-   if f=6 then i:=4
-          else i:=5;
-   Afftex(st,80,40,60,25,i);
-   if m= 180 then s.pourc[6]:= '*';
-   if m= 179 then s.pourc[10]:= '*';
-  end;
-  if f= 7 then          (* messint *)
-  begin
-   ecrf7;
-   DeLine(m,st,tay);
-   if res=1 then
-      begin
-        xco:=252-tay*5;
-        caspe:= 100;
-        dx:= 80;
-      end
-    else
-      begin
-        xco:=252-tay*3;
-        caspe:= 144;
-        dx:=50;
-      end;
-   if tay<40 then Afftex(st,xco,86,dx,3,5)
-             else Afftex(st,caspe,86,dx,3,5);
-  end;
- end;
-end;
-
-procedure f3f8;
-  var co:integer;
-begin
-  if res=1 then co:=107 else co:=64;
-  putxy(3,44);
-  writeg(f3,5);
-  ywhere:= 51;
-  writeg(f8,5);
-  boite(0,42,co,16,7);
-end;
-
-procedure t5(cx: integer);
-begin
- (* debug('t5'); *)
- if cx= 10 then blo:= false;
- if cx<> 1 then
- begin
-  bh1:= false;
-  bf1:= false;
- end;
- if cx<> 2 then bh2:= false;
- if cx<> 4 then
- begin
-  bh4:= false;
-  bf4:= false;
- end;
- if cx<> 5 then bh5:= false;
- if cx<> 6 then bh6:= false;
- if cx<> 8 then bh8:= false;
- if cx<> 3 then bt3:= false;
- if cx<> 7 then bt7:= false;
- if cx<> 9 then bh9:= false;
-end;
-
-procedure affper(per: integer);
-var
- cx: integer;
-begin
- (* debug('affper'); *)
- for cx:= 1 to 8 do menu_disable( disc[cx]);
- clsf10;
- if (per and 128)= 128 then
- begin
-   putxy(560,24);
-   writeg('LEO',4);
-   menu_enable( disc[1]);
- end;
- if (per and 64)= 64 then
- begin
-  putxy(560, 32);
-  writeg('PAT',4);
-  menu_enable( disc[2]);
- end;
- if (per and 32)= 32 then
- begin
-  putxy(560, 40);
-  writeg('GUY',4);
-  menu_enable( disc[3]);
- end;
- if (per and 16)= 16 then
- begin
-  putxy(560,48);
-  writeg('EVA',4);
-  menu_enable( disc[4]);
- end;
- if (per and 8)= 8 then
- begin
-  putxy(560,56);
-  writeg('BOB',4);
-  menu_enable( disc[5]);
- end;
- if (per and 4)= 4 then
- begin
-  putxy(560, 64);
-  writeg('LUC',4);
-  menu_enable( disc[6]);
- end;
- if (per and 2)= 2 then
- begin
-  putxy(560, 72);
-  writeg('IDA',4);
-  menu_enable( disc[7]);
- end;
- if (per and 1)= 1 then
- begin
-  putxy(560, 80);
-  writeg('MAX',4);
-  menu_enable( disc[8]);
- end;
- ipers:= per;
-end;
-
-overlay procedure choix(min,max: integer; var per: integer);
-var
- i: boolean;
- haz,cx,cy,cz: integer;
- per2,cz2: long_integer;
-begin
- (* debug('o0 choix'); *)
- haz:= hazard(min,max);
- if haz> 4 then
- begin
-  haz:= 8- haz;
-  i:= true
- end
- else i:= false;
- cx:= 0;
- per:= 0;
- while cx< haz do
- begin
-  cy:= hazard(1,8);
-  conv(cy,cz);
-  if (per and cz)<> cz then
-  begin
-   cx:= cx+ 1;
-   per:= (per or cz);
-  end;
- end;
- if i then per:= 255- per;
- i:= false;
-end;
-
-overlay procedure cpl1(var p: integer);
-var
- j,h,m: integer;
-begin
- (* debug('o0 cpl1'); *)
- calch(j,h,m);
- if (h> 7) or (h< 11) then p:= 25;
- if (h> 10) and (h< 14) then p:= 35;
- if (h> 13) and (h< 16) then p:= 50;
- if (h> 15) and (h< 18) then p:= 5;
- if (h> 17) and (h< 22) then p:= 35;
- if (h> 21) and (h< 24) then p:= 50;
- if (h>= 0) and (h< 8) then p:= 70;
- mdn;
-end;
-
-overlay procedure cpl2(var p: integer);
-var
- j,h,m: integer;
-begin
- (* debug('o0 cpl2'); *)
- calch(j,h,m);
- if (h> 7) and (h< 11) then p:= -2;
- if h= 11 then p:= 100;
- if (h> 11) and (h< 23) then p:= 10;
- if h= 23 then p:= 20;
- if (h>= 0) and (h< 8) then p:= 50;
-end;
-
-overlay procedure cpl3(var p: integer);
-var
- j,h,m: integer;
-begin
- (* debug('o0 cpl3'); *)
- calch(j,h,m);
- if ((h> 8) and (h< 10)) or ((h> 19) and (h< 24)) then p:= 34;
- if ((h> 9) and (h< 20)) or ((h>= 0) and (h< 9)) then p:= 0;
-end;
-
-overlay procedure cpl5(var p: integer);
-var
- j,h,m: integer;
-begin
- (* debug('o0 cpl5'); *)
- calch(j,h,m);
- if (h> 6) and (h< 10) then p:= 0;
- if h= 10 then p:= 100;
- if (h> 10) and (h< 24) then p:= 15;
- if (h>= 0) and (h< 7) then p:= 50;
-end;
-
-overlay procedure cpl6(var p: integer);
-var
- j,h,m: integer;
-begin
- (* debug('o0 cpl6'); *)
- calch(j,h,m);
- if ((h> 7) and (h< 13)) or ((h> 17) and (h< 20)) then p:= -2;
- if ((h> 12) and (h< 17)) or ((h> 19) and (h< 24)) then p:= 35;
- if h= 17 then p:= 100;
- if (h>= 0) and (h< 8) then p:= 60;
-end;
-
-procedure person;
-const
- m1= 'Vous';
- m2= 'ˆtes';
- m3= 'SEUL';
-var
- cf: integer;
- str: str255;
-begin
- (* debug('person'); *)
- for cf:= 1 to 8 do menu_disable( disc[cf]);
- clsf10;
- putxy(560, 30);
- writeg(m1,4);
- putxy(560, 50);
- writeg(m2,4);
- putxy(560, 70);
- writeg(m3,4);
- ipers:= 0;
-end;
-
-procedure chlm(var per: integer);
-begin
-  (* debug('chlm'); *)
-  per:= hazard(1,2);
-  if per= 2 then per:= 128;
-end;
-
-procedure pendule;
-const
- cv: array[1..2,1..12] of integer
-    =(( 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0),
-      (-5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6) );
- x= 580;
- y= 123;
- rg= 9;
-var
- h,co: integer;
-
-begin
- (* debug('pendule'); *)
- hide_mouse;
- (*paint_rect(572,114,18,20);
- paint_rect(577,114,6,20);*)
- paint_rect(570,118,20,10);
- paint_rect(578,114,6,18);
- if Gd in [Cga,Her] then co:=0 else co:=1;
- if min= 0 then droite(x shr 1*res, y, x shr 1*res, (y- rg), co)
-           else droite(x shr 1*res, y, x shr 1*res, (y+ rg), co);
- h:= heu;
- if h> 12 then h:= h- 12;
- if h= 0 then h:= 12;
- droite(x shr 1*res, y, (x+ cv[1, h]) shr 1*res, y+ cv[2, h], co);
- show_mouse;
- putxy( 568, 154);
- if heu> 11 then writeg( 'PM ',1)
-            else writeg( 'AM ',1);
- putxy( 550, 160);
- if jou in [0..8] then writeg(chr(jou+49)+'& jour',1);
-end;
-
-(*************
- * NIVEAU 11 *
- *************)
-
-procedure debloc(l: integer);
-begin
-(* debug('debloc'); *)
- num:= 0;
- x:= 0;
- y:= 0;
- if (l<> 26) and (l<> 15) then t5(l);
- mpers:= ipers;
-end;
-
-overlay procedure cpl10(var p,h: integer);
-var
- j,m: integer;
-begin
-(* debug('o1 cpl10'); *)
- calch(j,h,m);
- if ((h> 7) and (h< 11)) or ((h> 11) and (h< 14))
-  or ((h> 18) and (h< 21)) then p:= 100;
- if (h= 11) or ((h> 20) and (h< 24)) then p:= 45;
- if ((h> 13) and (h< 17)) or (h= 18) then p:= 35;
- if h= 17 then p:= 60;
- if (h>= 0) and (h< 8) then p:= 5;
-end;
-
-overlay procedure cpl11(var p,h: integer);
-var
- j,m: integer;
-begin
-(* debug('o1 cpl11'); *)
- calch(j,h,m);
- if ((h> 8) and (h< 12)) or ((h> 20) and (h< 24)) then p:= 25;
- if ((h> 11) and (h< 14)) or ((h> 18) and (h< 21)) then p:= 5;
- if (h> 13) and (h< 17) then p:= 55;
- if (h> 16) and (h< 19) then p:= 45;
- if (h>= 0) and (h< 9) then p:= 0;
-end;
-
-overlay procedure cpl12(var p: integer);
-var
- j,h,m: integer;
-begin
-(* debug('o1 cpl12'); *)
- calch(j,h,m);
- if ((h> 8) and (h< 15)) or ((h> 16) and (h< 22)) then p:= 55;
- if ((h> 14) and (h< 17)) or ((h> 21) and (h< 24)) then p:= 25;
- if (h>= 0) and (h< 5) then p:= 0;
- if (h> 4) and (h< 9) then p:= 15;
-end;
-
-overlay procedure cpl13(var p: integer);
-begin
-(* debug('o1 cpl13'); *)
- p:= 0;
-end;
-
-overlay procedure cpl15(var p: integer);
-var
- j,h,m: integer;
-begin
-(* debug('o1 cpl15'); *)
- calch(j,h,m);
- if (h> 7) and (h< 12) then p:= 25;
- if (h> 11) and (h< 14) then p:= 0;
- if (h> 13) and (h< 18) then p:= 10;
- if (h> 17) and (h< 20) then p:= 55;
- if (h> 19) and (h< 22) then p:= 5;
- if (h> 21) and (h< 24) then p:= 15;
- if (h>= 0) and (h< 8) then p:= -15;
-end;
-
-overlay procedure cpl20(var p,h: integer);
-var
- j,m: integer;
-begin
-(* debug('o1 cpl20'); *)
- calch(j,h,m);
- if h= 10 then p:= 65;
- if (h> 10) and (h< 21) then p:= 5;
- if (h> 20) and (h< 24) then p:= -15;
- if (h>= 0) and (h< 5) then p:= -300;
- if (h> 4) and (h< 10) then p:= -5;
-end;
-
-overlay procedure quelq1(l: integer);
-var
- per: integer;
-begin
-(* debug('o1 quelq1'); *)
- per:= hazard(1,2);
- if l= 1 then
-  if per= 1 then bh1:= true else bf1:= true;
- if l= 4 then
-  if per= 1 then bh4:= true else bf4:= true;
- ipers:= 10;
-end;
-
-overlay procedure quelq2;
-begin
-(* debug('o1 quelq2'); *)
- if li= 2 then bh2:= true else bh9:= true;
- ipers:= 10;
-end;
-
-overlay procedure quelq5;
-begin
-(* debug('o1 quelq5'); *)
- bh5:= true;
- ipers:= 10;
-end;
-
-overlay procedure quelq6(l: integer);
-var
- per: integer;
-begin
-(* debug('o1 quelq6'); *)
- if l= 6 then bh6:= true;
- if l= 8 then bh8:= true;
- ipers:= 10;
-end;
-
-overlay procedure quelq10(h: integer; var per: integer);
-var
- min,max: integer;
-begin
-(* debug('o1 quelq10'); *)
- if (h>= 0) and (h< 8) then chlm(per) else
- begin
-  if (h> 7) and (h< 10) then
-  begin
-   min:= 5;
-   max:= 7;
-  end;
-  if (h> 9) and (h< 12) then
-  begin
-   min:= 1;
-   max:= 4;
-  end;
-  if ((h> 11) and (h< 15)) or ((h> 18) and (h< 21)) then
-  begin
-   min:= 6;
-   max:= 8;
-  end;
-  if ((h> 14) and (h< 19)) or ((h> 20) and (h< 24)) then
-  begin
-   min:= 1;
-   max:= 5;
-  end;
-  choix(min,max,per);
- end;
- affper(per);
-end;
-
-overlay procedure quelq11(h: integer; var per: integer);
-var
- min,max: integer;
-begin
-(* debug('o1 quelq11'); *)
- if (h>= 0) and (h< 8) then chlm(per) else
- begin
-  if ((h> 7) and (h< 10)) or ((h>20) and (h< 24)) then
-  begin
-   min:= 1;
-   max:= 3;
-  end;
-  if ((h> 9) and (h< 12)) or ((h> 13) and (h< 19)) then
-  begin
-   min:= 1;
-   max:= 4;
-  end;
-  if ((h> 11) and (h< 14)) or ((h> 18) and (h< 21))then
-  begin
-   min:= 1;
-   max:= 2;
-  end;
-  choix(min,max,per);
- end;
- affper(per);
-end;
-
-overlay procedure quelq12(var per: integer);
-begin
-(* debug('o1 quelq12'); *)
- chlm(per);
- affper(per);
-end;
-
-overlay procedure quelq15(var per: integer);
-var
- cx: integer;
- test: boolean;
-
-begin
-(* debug('o1 quelq15'); *)
- per:= 0;
- if per= 0 then
- begin
-   repeat
-     cx:= hazard(1,8);
-     test :=(((cx= 1) and (bh2 or bh9)) or
-             ((cx= 2) and bh8) or
-             ((cx= 3) and bh4) or
-             ((cx= 4) and bf4) or
-             ((cx= 5) and bh6) or
-             ((cx= 6) and bh1) or
-             ((cx= 7) and bf1) or
-             ((cx= 8) and bh5))
-  until not test;
-  conv(cx,per);
-  affper(per);
- end;
-end;
-
-overlay procedure quelq20(h: integer; var per: integer);
-var
- min,max: integer;
-begin
-(* debug('o1 quelq20'); *)
- if ((h>= 0) and (h< 10)) or ((h> 18) and (h< 24)) then chlm(per)
- else
- begin
-  if (h> 9) and (h< 12) then
-  begin
-   min:= 3;
-   max:= 7;
-  end;
-  if (h> 11) and (h< 18) then
-  begin
-   min:= 1;
-   max:= 2;
-  end;
-  if h= 18 then
-  begin
-   min:= 2;
-   max:= 4;
-  end;
-  choix(min,max,per);
- end;
- affper(per);
-end;
-
-
-overlay procedure frap;
-var
- j,h,m,haz: integer;
-begin
-(* debug('o1 frap'); *)
- calch(j,h,m);
- if (h>= 0) and (h< 8) then crep:= 190 else
- begin
-  haz:= hazard(1,100);
-  if haz> 70 then crep:= 190 else crep:= 147;
- end;
-end;
-
-overlay procedure nouvp(l: integer; var p: integer);
-begin
-(* debug('o1 nouvp'); *)
- p:= 0;
- if l= 1 then
- begin
-  if bh1 then p:= 4;
-  if bf1 then p:= 2;
- end;
- if ((l= 2) and (bh2)) or ((l= 9) and (bh9)) then p:= 128;
- if l= 4 then
- begin
-  if bh4 then p:= 32;
-  if bf4 then p:= 16;
- end;
- if (l= 5) and (bh5) then p:= 1;
- if (l= 6) and (bh6) then p:= 8;
- if (l= 8) and (bh8) then p:= 64;
- if ((l= 3) and (bt3)) or ((l= 7) and (bt7)) then p:= 9;
- if p<> 9 then affper(p);
-end;
-
-
-
-overlay procedure tip(ip: integer; var cx: integer);
-begin
-(* debug('o1 tip'); *)
- if ip= 128 then cx:= 1 else
- if ip= 64  then cx:= 2 else
- if ip= 32  then cx:= 3 else
- if ip= 16  then cx:= 4 else
- if ip= 8   then cx:= 5 else
- if ip= 4   then cx:= 6 else
- if ip= 2   then cx:= 7 else
- if ip= 1   then cx:= 8;
-end;
-
-
-overlay procedure ecfren(var p,haz: integer; cf,l: integer);
-begin
-(* debug('o1 ecfren'); *)
- if l= 0 then person;
- p:= -500;
- haz:= 0;
- if ((l= 1) and (not bh1) and (not bf1))
- or ((l= 4) and (not bh4) and (not bf4)) then cpl1(p);
- if (l= 2) and (not bh2) and (not bh9) then cpl2(p);
- if ((l= 3) and (not bt3)) or ((l= 7) and (not bt7)) then cpl3(p);
- if (l= 5) and (not bh5) then cpl5(p);
- if ((l= 6) and (not bh6)) or ((l= 8) and (not bh8)) then cpl6(p);
- if (l= 9) and (not bh9) and (not bh2) then p:= 10;
- if ((l= 2) and (bh9)) or ((l= 9) and (bh2)) then p:= -400;
- if p<> -500 then
- begin
-  p:= p+ cf;
-  haz:= hazard(1,100);
- end;
-end;
-
-overlay procedure becfren(l: integer);
-var
- haz: integer;
-begin
-(* debug('o1 becfren'); *)
- if (l= 1) or (l= 4) then
- begin
-  haz:= hazard(1,2);
-  if l= 1 then
-   if haz= 1 then bh1:= true else bf1:= true;
-  if l= 4 then
-   if haz= 1 then bh4:= true else bf4:= true;
- end;
- if l= 2 then bh2:= true else
- if l= 3 then bt3:= true else
- if l= 5 then bh5:= true else
- if l= 6 then bh6:= true else
- if l= 7 then bt7:= true else
- if l= 8 then bh8:= true else
- if l= 9 then bh9:= true;
-end;
-
-(* NIVEAU 10 *)
-procedure init_nbrepm;
-  const ipm: array[1..8] of byte
-            =(4,5,6,7,5,6,5,8);
-   var i : integer;
-begin
-(* debug('init_nbrepm'); *)
-  i:= 0;
-  repeat
-    i:= succ(i);
-    nbrepm[i]:= ipm[i];
-  until i=8;
-end;
-
-procedure phaz(var haz,p: integer; cf: integer);
-begin
-(* debug('phaz'); *)
- p:= p+ cf;
- haz:= hazard(1,100);
-end;
-
-overlay procedure inzon;
-var
- cx: integer;
-begin
-(* debug('o2 inzon'); *)
- copcha;
- with s do
- begin
-  ipre  := false;
-  derobj:= 0;
-  icave := 0;
-  iboul := 0;
-  ibag  := 0;
-  ipuit := 0;
-  ivier := 0;
-  iloic := 136;
-  icryp := 141;
-  conf  := hazard(4,10);
-  mlieu := 21;
-  for cx:= 2 to 6 do sjer[cx]:= chr(0);
-  sjer[1]:= chr(113);
-  heure:= chr(20);
-  for cx:= 1 to 10 do pourc[cx]:= ' ';
-  for cx:= 1 to 6 do teauto[cx]:= '*';
-  for cx:= 7 to 9 do teauto[cx]:= ' ';
-  for cx:= 10 to 28 do teauto[cx]:= '*';
-  for cx:= 29 to 42 do teauto[cx]:= ' ';
-  teauto[33]:= '*';
- end;
- for cx:= 1 to 8 do nbrep[cx]:= 0;
- init_nbrepm;
-end;
-
-overlay procedure dprog;
-begin
-(* debug('o2 dprog'); *)
- li:= 21;
- (* jh:= t_settime(0);*)
- jh:= 0;
- if not s.ipre then blo:= true;
- t:= ti1;
- mh:= readclock;
-end;
-
-overlay procedure pl1(cf: integer);
-var
- p, haz: integer;
-begin
-(* debug('o2 pl1'); *)
- if ((li= 1) and (not bh1) and (not bf1))
- or ((li= 4) and (not bh4) and (not bf4)) then
- begin
-  cpl1(p);
-  phaz(haz,p,cf);
-  if haz> p then person else quelq1(li);
- end;
-end;
-
-overlay procedure pl2(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl2'); *)
- if not bh2 then
- begin
-  cpl2(p);
-  phaz(haz,p,cf);
-  if haz> p then person else quelq2;
- end;
-end;
-
-overlay procedure pl5(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl5'); *)
- if not bh5 then
- begin
-  cpl5(p);
-  phaz(haz,p,cf);
-  if haz> p then person else quelq5;
- end;
-end;
-
-overlay procedure pl6(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl6'); *)
- if ((li= 6) and (not bh6)) or ((li= 8) and (not bh8)) then
- begin
-  cpl6(p);
-  phaz(haz,p,cf);
-  if haz> p then person else quelq6(li);
- end;
-end;
-
-overlay procedure pl9(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl9'); *)
- if not bh9 then
- begin
-  cf:= -10;
-  phaz(haz,p,cf);
-  if haz> p then person else quelq2;
- end;
-end;
-
-overlay procedure pl10(cf: integer);
-var
- p,h,haz: integer;
-begin
-(* debug('o2 pl10'); *)
- cpl10(p,h);
- phaz(haz,p,cf);
- if haz> p then person else quelq10(h,p);
-end;
-
-overlay procedure pl11(cf: integer);
-var
- p,h,haz: integer;
-begin
-(* debug('o2 pl11'); *)
- cpl11(p,h);
- phaz(haz,p,cf);
- if haz> p then person else quelq11(h,p);
-end;
-
-overlay procedure pl12(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl12'); *)
- cpl12(p);
- phaz(haz,p,cf);
- if haz> p then person else quelq12(p);
-end;
-
-overlay procedure pl13(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl13'); *)
- cpl13(p);
- phaz(haz,p,cf);
- if haz> p then person else quelq12(p);
-end;
-
-overlay procedure pl15(cf: integer);
-var
- p,haz: integer;
-begin
-(* debug('o2 pl15'); *)
- cpl15(p);
- phaz(haz,p,cf);
- if haz> p then person else quelq15(p);
-end;
-
-overlay procedure pl20(cf: integer);
-var
- p,h,haz: integer;
-begin
-(* debug('o2 pl20'); *)
- cpl20(p,h);
- phaz(haz,p,cf);
- if haz> p then person else quelq20(h,p);
-end;
-
-overlay procedure t11(l11: integer; var a: integer);
-var
- p,haz,h: integer;
-begin
-(* debug('o2 t11'); *)
- ecfren(p,haz,s.conf,l11);
- li:= l11;
- if (l11> 0) and (l11< 10) then
-  if (p<> -500) then
-  begin
-   if (haz> p) then
-   begin
-    person;
-    a:= 0;
-   end
-   else
-   begin
-    becfren(li);
-    nouvp(li,a);
-   end;
-  end
-  else nouvp(li,a);
- if l11> 9 then
-  if (l11> 15) and (l11<> 20) and (l11<> 26) then person else
-  begin
-   if l11= 10 then cpl10(p,h);
-   if l11= 11 then cpl11(p,h);
-   if l11= 12 then cpl12(p);
-   if (l11= 13) or (l11= 14) then cpl13(p);
-   if (l11= 15) or (l11= 26) then cpl15(p);
-   if l11= 20 then cpl20(p,h);
-   p:= p+ s.conf;
-   haz:= hazard(1,100);
-   if haz> p then
-   begin
-    person;
-    a:= 0;
-   end
-   else
-   begin
-    if l11= 10 then quelq10(h,p);
-    if l11= 11 then quelq11(h,p);
-    if (l11= 12) or (l11= 13) or (l11= 14) then quelq12(p);
-    if (l11= 15) or (l11= 26) then quelq15(p);
-    if l11= 20 then quelq20(h,p);
-    a:= p;
-   end;
-  end;
-end;
-
-overlay procedure cavegre;
-
-var
- haz: integer;
-begin
-(* debug('cavegre'); *)
- s.conf:= s.conf+ 2;
- if s.conf> 69 then s.conf:= s.conf+ (s.conf div 10);
- clsf3;
- ecrf2;
- ecr3(m1);
- haz:= (hazard(0, 4))- 2;
- parole(2, haz, 1);
- for haz:=0 to 3000 do;
- clsf3;
- person;
-end;
-
-procedure writetp(s:str255;t:integer);
-begin
-  if res=2 then writeg(s,t)
-           else writeg(copy(s,1,25),t);
-end;
-
-procedure messint(nu: integer);
-begin
-(* debug('messint'); *)
- clsf1;
- clsf2;
- clsf3;
- decomp( $73A2, 1008);
- memw[$7413:12]:= 80;
- memw[$7413:14]:=  40;
- writepal(90);
- afff(Gd,$73A2, 1008,0,0);
- afff(Gd,$73A2, 1008,0,70);
- repon(7,nu);
-end;
-
-procedure aniof(ouf,num: integer);
-     var  ad, offset : integer;
-            c:char;
-   begin
-   (* debug('aniof'); *)
-     if (caff= 7) and ((num= 4) or (num= 5)) then exit;
-     if (caff= 10) and (num= 7) then num:= 6;
-     if (caff= 12) then if (num= 3) then num:= 4
-                                    else if (num= 4) then num:= 3;
-     ad:= adani;
-     offset:= animof(ouf,num);
-     decomp(ad,offset);
-     hide_mouse;
-     afff(Gd,ad,offset,0,12);
-     ecrf1;
-     show_mouse;
-   end;
-
-procedure musique(so: integer);
-var
- i: boolean;
- haz: integer;
-(* dep: array[1..5] of long_integer;*)
-begin
-(* debug('musique'); *)
-  if so= 0 then (*musik(0)*) begin end
-   else
-  if (prebru= 0) and (not s.ipre) then
-  begin
-   parole(10, 1, 1);
-   prebru:= prebru+ 1;
-  end
-  else
-  begin
-   i:= false;
-   if (s.mlieu= 19) or (s.mlieu= 21) or (s.mlieu= 22) then
-   begin
-    haz:= hazard(1,3);
-    if haz= 2 then
-    begin
-     haz:= hazard(2,4);
-     parole(9,haz,1);
-     i:= true;
-    end;
-   end;
-   if s.mlieu= 20 then
-   begin
-    haz:= hazard(1,2);
-    if haz= 1 then
-    begin
-     parole(8,1,1);
-     i:= true;
-    end;
-   end;
-   if s.mlieu= 24 then
-   begin
-    haz:= hazard(1,2);
-    if haz= 2 then
-    begin
-     parole(12,1,1);
-     i:= true;
-    end;
-   end;
-   if s.mlieu= 23 then
-   begin
-    parole(13,1,1);
-    i:= true;
-   end;
-   if not i then
-   begin
-   (* dep[1]:= 1416;
-    dep[2]:= 1512;
-    dep[3]:= 1692;
-    dep[4]:= 1884;
-    dep[5]:= 2046;
-    haz:= hazard(1,5);
-    musik(dep[haz]);*)
-    haz:= hazard(1,17);
-    parole(haz,1,2);
-   end;
-  end;
-end;
-
-(* NIVEAU 9 *)
-procedure dessin(ad:integer);
-var
- cx: integer;
-begin
-(* debug('dessin'); *)
- if ad<> 0 then dessine(ades,((ad mod 160)* 2),(ad div 160))
-           else
- begin
-  clsf1;
-  if caff> 99 then
-  begin
-    dessine(ades,60,33);
-    boite(118, 32, 291, 121, 15);         (* cadre moyen *)
-  end
-  else
-   if caff> 69 then
-   begin
-    dessine(ades,112,48);             (* tˆtes *)
-    boite(222, 47, 155, 91, 15);
-   end
-   else
-   begin
-    dessine(ades,0,12);
-    ecrf1;
-    if (caff< 30) or (caff> 32) then
-    begin
-     for cx:= 1 to 6 do
-      if ord(touv[cx])<> 0 then aniof(1,ord(touv[cx]));
-     if caff= 13 then
-     begin
-      if s.iboul= 141 then aniof(1,7);
-      if s.ibag= 159 then aniof(1,6);
-     end;
-     if (caff= 14) and (s.icave= 151) then aniof(1,2);
-     if (caff= 17) and (s.ivier= 143) then aniof(1,1);
-     if (caff= 24) and (s.ipuit<> 0) then aniof(1,1);
-    end;
-    if caff< 26 then musique(1);
-   end;
- end;
-end;
-
-
-
diff --git a/engines/mortevielle/original/0/MOR2.PAS b/engines/mortevielle/original/0/MOR2.PAS
deleted file mode 100644
index f01b326..0000000
--- a/engines/mortevielle/original/0/MOR2.PAS
+++ /dev/null
@@ -1,758 +0,0 @@
-const  men : array[1..11] of integer
-             = ( scacher, attacher, defoncer, dormir,
-                 entrer,  fermer,   frapper,  manger,
-                 mettre,  ouvrir,   sortir );
-
-procedure tinke;
-const
- m1= 'Mince! Vous entendez du bruit...';
- d1= ' | Vous devriez avoir remarqu‚|       ';
- d2= '% des indices...';
- d3= '[';
- d4= ']';
- d5= '1';
- d6= 'OK';
-var
- cx,cy,haz,nh,cf,j,h,m,cd: integer;
-    stpo : string[3];
-      am : boolean;
-begin
- anyone:= false;
- calch(j,h,m);
- if j<> jou then
- begin
-  jou:= j;
-  cx:=0;
-  repeat
-    cx:=cx+1;
-    if nbrepm[cx]<> 0 then nbrepm[cx]:= nbrepm[cx]- 1;
-    nbrep[cx]:= 0;
-  until cx=8;
- end;
- if (h> heu) or ((h= 0) and (heu= 23)) then
- begin
-  heu:= h;
-  min:= 0;
-  pendule;
-  cf:= 0;
-  for cx:= 1 to 10 do if s.pourc[cx]= '*' then cf:= cf+ 1;
-  if cf=10 then stpo:='10'
-           else stpo:=chr(cf+48);
-  stpou:= d3+ d5+ d4+ d3+ d1+ stpo+ '0'+ d2+ d4+ d3+ d6+ d4;
- end;
- if m> min then
- begin
-  min:= 30;
-  pendule;
- end;
- if Y_S<12 then exit;
- if not blo then
- begin
-  if (h= 12) or ((h> 18) and (h< 21)) or ((h>= 0) and (h< 7)) then
-   t:= ti2 else t:= ti1;
-  cf:= s.conf;
-  if (cf> 33) and (cf< 66) then t:= t- (t div 3);
-  if cf> 65 then t:= t- ((t div 3)* 2);
-  nh:= readclock;
-  if (nh- mh)> t then
-  begin
-    am:= active_menu;
-    erase_menu;
-    jh:= jh+ ((nh- mh)div t);
-    mh:= nh;
-    case li of
-            1,4 : pl1(cf);
-              2 : pl2(cf);
-              5 : pl5(cf);
-            6,8 : pl6(cf);
-              9 : pl9(cf);
-             10 : pl10(cf);
-             11 : pl11(cf);
-             12 : pl12(cf);
-          13,14 : pl13(cf);
-          15,26 : pl15(cf);
-             20 : pl20(cf);
-        end;
-   if (mpers<> 0) and (ipers<> 10) then mpers:= ipers;
-   if (mpers= 0) and (ipers> 0) then
-    if (s.mlieu= 13) or (s.mlieu= 14) then cavegre else
-     if ipers= 10 then
-     begin
-      ipers:= 0;
-      if not brt then
-      begin
-       brt:= true;
-       hdb:= readclock;
-       haz:= hazard(1,5);
-       if haz< 5 then
-       begin
-        clsf3;
-        ecrf2;
-        ecr3(m1);
-        haz:= (hazard(0, 4))- 2;
-        parole(1, haz, 1);
-        clsf3;
-       end;
-      end;
-     end;
-    if am then draw_menu;
-  end;
- end;
- hfb:= readclock;
- if (brt) and ((hfb- hdb)> 17) then
- begin
-  nouvp(li,cx);
-  brt:= false;
-  hdb:= 0;
-  if (s.mlieu> 0) and (s.mlieu< 10) then anyone:= true;
- end;
-end;
-
-procedure fenat(ans: char);
-  var coul : integer;
-begin
-  hide_mouse;
-  if Gd=cga then coul:=2
-            else if Gd=Her then coul:=1 else coul:=12;
-  affcar(Gd,306,193,coul,ord(ans));
-  boite(300, 191, 16, 8, 15);
-  show_mouse;
-end;
-
-
-(* NIVEAU 8 *)
-procedure afdes(ad: integer);
-begin
-  taffich;
-  dessin(ad);
-  okdes:= false;
-end;
-
-procedure tkey1(d: boolean);
-  var quest : boolean;
-      x,y,c:integer;
-      key : integer;
-begin
- hide_mouse;
- fenat('K');
- while keypressed do key:=testou;
- repeat
-   if d then tinke;
-   quest:=keypressed;
-   read_pos_mouse(x,y,c);
- until quest or (c<>0) or (d and anyone);
- if quest then key:=testou;
- clic:=false;
- show_mouse;
-end;
-
-procedure tmlieu(mli: integer);
-var
- cx, j, i, tail : integer;
-           nomp : str30;
-             st : phrase;
-
-begin
-  if mli= 26 then mli:= 15;
-  i:=1;
-  while (i<8) and (v_lieu[i,mli]<>0)  do
-     begin
-       cx:=v_lieu[i,mli];
-       DeLine(cx+c_tmlieu,st,tail);
-       nomp:= delig;
-       while length(nomp)<30 do nomp:=nomp+' ';
-       menut( depl[i], nomp);
-       i:=i+1;
-     end;
-  nomp:= '*                   ';
-  for cx:= 7 downto i do menut( depl[cx], nomp);
-end;
-
-
-(* NIVEAU 7 *)
-procedure tlu(af,ob: integer);
-begin
-  caff:= 32;
-  afdes(0);
-  repon(6,ob+ 4000);
-  repon(2,999);
-  tkey1(true);
-  caff:= af;
-  msg[3]:= no_choice;
-  crep:= 998;
-end;
-
-procedure delin(n:integer);
-  var s:phrase;
-      t : integer;
-  begin
-    deline(n,s,t);
-  end;
-
-procedure affrep;
-begin
-  caff:= s.mlieu;
-  crep:= s.mlieu;
-end;
-
-procedure mfouen;
-
-var
- cx: integer;
-begin
- tmlieu(s.mlieu);
- for cx:=1 to 11 do menu_enable( men[cx]);
-(* menu_enable( scacher);
- menu_enable(menup, attacher);
- menu_enable(menup, defoncer);
- menu_enable(menup, dormir);
- menu_enable(menup, entrer);
- menu_enable(menup, fermer);
- menu_enable(menup, frapper);
- menu_enable(menup, manger);
- menu_enable(menup, mettre);
- menu_enable(menup, ouvrir);
- menu_enable(menup, sortir);  *)
- menut( sonder, ' sonder   ');
- menut( soulever, ' soulever ');
-end;
-
-procedure atf3f8(var key: integer);
- begin
-   repeat
-     key:= testou;
-   until (key=61) or (key=66);
- end;
-
-(* NIVEAU 6 *)
-
-procedure tperd;
-var
- cx: integer;
-begin
- initouv;
- ment:= 0;
- iouv:= 0;
- mchai:= 0;
- mfouen;
- if not blo then t11(21, cx);
- perdu:= true;
- clsf1;
- boite( 60, 35, 400, 50, 15);
- repon(9,crep);
- clsf2;
- clsf3;
- col:= false;
- syn:= false;
- okdes:= false;
-end;
-
-procedure tsort;
-var
- cx: integer;
-begin
- if (iouv> 0) and (s.mlieu<> 0) then
-  if s.conf< 50 then s.conf:= s.conf+ 2
-                else s.conf:= s.conf+ (s.conf div 10);
- for cx:= 1 to 7 do touv[cx]:= chr(0);
- ment:= 0;
- iouv:= 0;
- mchai:= 0;
- debloc(s.mlieu);
-end;
-
-procedure st4(ob: integer);
-begin
- crep:= 997;
- case ob of
-                114 : crep:=109;
-                110 : crep:=107;
-                158 : crep:=113;
-    152..156,150,
-    100,157,160,161 : tlu(caff,ob);
- end;
-end;
-
-procedure cherjer(ob: integer; var d: boolean);
-var
- cx: integer;
-begin
- d:= false;
- for cx:= 1 to 6 do d:=(d or (ord(s.sjer[cx])= ob));
- if s.derobj= ob then d:= true;
-end;
-
-procedure st1sama;
-begin
- s.mlieu:= 10;
- affrep;
-end;
-
-procedure modinv;
-var
- cx, cy, tay, i, r: integer;
- nom: phrase;
- nomp: str30;
-begin
- cy:= 0;
- for cx:=1 to 6 do
-  if s.sjer[cx]<> chr(0) then
-    begin
-      cy:= succ(cy);
-      r:= (ord(s.sjer[cx])+ 400);
-      DeLine(r-501+c_st41,nom,tay);
-      nomp:= delig;
-      menut( invt[cy], nomp);
-      menu_enable( invt[cx]);
-    end;
- if cy<6 then
-    for cx:=cy+1 to 6 do
-      begin
-        menut( invt[cx], '                       ');
-        menu_disable( invt[cx]);
-      end;
-end;
-
-procedure sparl(adr, rep: long_integer);
-const haut: array[1..8] of integer
-           =(0,1,-3,6,-2,2,7,-1);
-var
- key, ad, tay, repint : integer;
-           st : phrase;
-begin
-  repint:=trunc(rep);
-  hide_mouse;
-  DeLine( repint+c_paroles,st,tay);
-  Afftex(st,230,4,65,24,5);
-  f3f8;
-  (*boite(43,30,90,19,15);
-  gotoxy(7,5);
-  write('F3: Encore');
-  gotoxy(7,6);
-  write('F8: Stop');*)
-  key:= 0;
-  repeat
-    parole(repint, haut[caff- 69], 0);
-    atf3f8(key);
-  until key= 66;
-  hirs;
-  show_mouse;
-end;
-
-procedure finfouil;
-  begin
-    fouil:= false;
-    obpart:= false;
-    cs:= 0;
-    is:= 0;
-    mfouen;
-  end;
-
-procedure mfoudi;
-var
- cx: integer;
-begin
- for cx:= 1 to 7 do menu_disable( depl[cx]);
- for cx:=1 to 11 do menu_disable( men[cx]);
-(* menu_disable(menup, scacher);
- menu_disable(menup, attacher);
- menu_disable(menup, defoncer);
- menu_disable(menup, dormir);
- menu_disable(menup, entrer);
- menu_disable(menup, fermer);
- menu_disable(menup, frapper);
- menu_disable(menup, manger);
- menu_disable(menup, mettre);
- menu_disable(menup, ouvrir);
- menu_disable(menup, sortir);  *)
- menut( sonder, ' -SUITE- ');
- menut( soulever, ' -STOP-  ');
-end;
-
-procedure mennor;
-begin
- menu_up(msg[3]);
-end;
-
-procedure premtet;
-begin
- dessine(ades, 10, 80);
- boite(18, 79, 155, 91, 15);
-end;
-
-(* NIVEAU 5 *)
-procedure ajchai;
-  var cx,cy,lderobj: integer;
-
-begin
-  cy:= (acha+ pred(pred(mchai)* 10));
-  cx:= 0;
-  repeat
-   cx:= cx+ 1;
-  until (cx> 9) or (tabdon[cy+ cx]= 0);
-  if tabdon[cy+ cx]= 0 then
-    begin
-      lderobj:= s.derobj;
-      tabdon[cy+ cx]:=lderobj;
-    end
-    else crep:= 192;
-end;
-
-procedure ajjer(ob: integer);
-var
- cx: integer;
-begin
- cx:= 0;
- repeat
-  cx:= cx+ 1;
- until (cx> 5) or (ord(s.sjer[cx])= 0);
- if ord(s.sjer[cx])= 0 then
- begin
-  s.sjer[(cx)]:= chr(ob);
-  modinv;
- end
- else crep:= 139;
-end;
-
-procedure t1sama;  (* On entre dans le manoir *)
-var
- j,h,m: integer;
- d: boolean;
-begin
- calch(j,h,m);
- if (h< 5) and (s.mlieu> 18) then
- begin
-  cherjer(137,d);
-  if not d then     (* On n'a pas les cl‚s et il est tard *)
-  begin
-    crep:= 1511;
-    tperd;
-  end
-  else st1sama;
- end
- else
- if not s.ipre then     (* c'est votre premiŠre fois ? *)
- begin
-  ipers:= 255;
-  affper(ipers);
-  caff:= 77;
-  afdes(0);
-  boite(223, 47, 155, 91, 15);
-  repon(2,33);
-  tkey1(false);
-  mennor;
-  hide_mouse;
-  hirs;
-  premtet;
-  sparl(0,140);
-  dessine_rouleau;
-  pendule;
-  show_mouse;
-  s.mlieu:= 0;
-  affrep;
-  t5(10);
-  if not blo then t11(0, m);
-  ipers:= 0;
-  mpers:= 0;
-  s.ipre:= true;
-  (*chech;*)
- end
- else  st1sama;
-end;
-
-procedure t1vier;
-begin
- s.mlieu:= 17;
- affrep;
-end;
-
-procedure t1neig;
-begin
- inei:= inei+ 1;
- if inei> 2 then
- begin
-   crep:= 1506;
-   tperd;
- end
- else
- begin
-   okdes:= true;
-   s.mlieu:= 19;
-   affrep;
- end;
-end;
-
-procedure t1deva;
-begin
- inei:= 0;
- s.mlieu:= 21;
- affrep;
-end;
-
-procedure t1derr;
-begin
- s.mlieu := 22;
- affrep;
-end;
-
-procedure t1deau;
-begin
- crep := 1503;
- tperd;
-end;
-
-procedure tctrm;
-begin
- repon(2,(3000+ ctrm));
- ctrm:= 0;
-end;
-
-
-procedure quelquun;
-label 1;
-var
- haz,cx: integer;
-begin
- if imen then erase_menu;
- finfouil;
- crep:= 997;
-1:
- if not cache then
- begin
-  if crep= 997 then crep:= 138;
-  repon(2,crep);
-  if crep= 138 then parole(5, 2, 1) else parole(4, 4, 1);
-  if iouv= 0 then s.conf:= s.conf+ 2 else
-   if s.conf< 50 then s.conf:= s.conf+ 4 else
-    s.conf:= s.conf+ (3* (s.conf div 10));
-  tsort;
-  tmlieu(15);
-  tip(ipers,cx);
-  caff:= 69+ cx;
-  crep:= caff;
-  msg[3]:= discut;
-  msg[4]:= disc[cx];
-  syn:= true;
-  col:= true;
- end
- else
- begin
-  haz:= hazard(1, 3);
-  if haz= 2 then
-  begin
-   cache:= false;
-   crep:= 137;
-   goto 1;
-  end
-  else
-  begin
-   repon(2, 136);
-   haz:= (hazard(0, 4))- 2;
-   parole(3, haz, 1);
-   clsf2;
-   person;
-   debloc(21);
-   affrep;
-  end;
- end;
- if imen then draw_menu;
-end;
-
-procedure tsuiv;
-var
- cx,tbcl: integer;
- cl,cy: integer;
-begin
- cy:= acha+ ((mchai- 1)* 10)- 1;
- cx:= 0;
- repeat
-  cx:= cx+ 1;
-  cs:= cs+ 1;
-  cl:= cy+ cs;
-  tbcl:= tabdon[cl];
- until (tbcl <> 0) or (cs> 9);
- if (tbcl <> 0) and (cs< 11) then
- begin
-  is:= is+ 1;
-  caff:= tbcl;
-  crep:= caff+ 400;
-  if ipers<> 0 then s.conf:= s.conf+ 2;
- end
- else
- begin
-  affrep;
-  finfouil;
-  if cx> 9 then crep:= 131;
- end;
-end;
-
-procedure tfleche;
-var
- qust : boolean;
- touch : char;
- dummy,cd,xmo,ymo: integer;
-begin
- if num= 9999 then exit;
- fenat(chr(152));
- rect:= false;
- repeat
-  touch:=#0;
-
-  repeat
-   mov_mouse(qust,touch);
-   if clic then rect:=(X_S<256*res) and (Y_S<176) and (Y_S>12);
-   tinke;
-  until (qust or rect or anyone);
-
-  if (qust and (touch=#67)) then dummy:=do_alert(stpou,1);
- until ((touch=#59) or ((touch= #68) and (x<> 0) and (y<>0)) or
-       (anyone) or (rect));
- if touch=#59 then iesc:= true;
- if rect then
-   begin
-     x:=X_S;
-     y:=Y_S;
-   end;
-end;
-
-procedure tcoord(sx: integer);
-label 1;
-     var sy,ix,iy,cb,cy,ib: integer;
-         a, b, atdon : integer;
-
-   begin
-     num:= 0;
-     crep:= 999;
-     a:=0;
-     atdon:=amzon+3;
-     cy:= 0;
-     while cy<caff do
-        begin
-          a:=a+tabdon[atdon];
-          atdon:=atdon+4;
-          cy:= succ(cy);
-        end;
-(*     for cy:=0 to caff-1 do
-          a:=a+ tabdon[amzon+3+4*cy];
-     b:= peek(amzon+3+4*caff); *)
-     b:= tabdon[atdon];
-     if b= 0 then goto 1;
-     a:= a+ fleche;
-     cb:= 0;
-     for cy:= 0 to (sx-2) do
-      begin
-        ib:= tabdon[a+cb] shl 8+ tabdon[succ(a+ cb)] ;
-        cb:= cb+ (ib* 4)+ 2;
-      end;
-      ib:= tabdon[a+cb] shl 8+ tabdon[succ(a+ cb)] ;
-      if ib= 0 then goto 1;
-      cy:= 1;
-      repeat
-        cb:= cb+ 2;
-        sx:= tabdon[a+ cb] * res;
-        sy:= tabdon[succ(a+ cb)];
-        cb:= cb+ 2;
-        ix:= tabdon[a+ cb] * res;
-        iy:= tabdon[succ(a+ cb)];
-        cy:= cy+ 1;
-      until ((x>= sx) and (x<= ix) and (y>= sy) and (y<= iy))
-             or (cy> ib);
-      if (x>= sx) and (x<= ix) and (y>= sy) and (y<= iy)
-        then
-          begin
-            num:= cy- 1;
-            exit;
-          end;
-1:
-     crep:= 997;
-   end;
-
-
-procedure st7(ob: integer);
-begin
- crep:= 183;
- if (ob= 116) or (ob= 144) then crep:= 104;
- if (ob= 126) or (ob= 111) then crep:= 108;
- if ob= 132 then crep:= 111;
- if ob= 142 then crep:= 112;
- if crep= 183 then st4(ob);
-end;
-
-procedure treg(ob: integer);
-var
- mdes: integer;
-begin
- mdes:= caff;
- caff:= ob;
- if ((caff> 29) and (caff< 33)) or (caff= 144) or
-    (caff= 147) or (caff= 149) or (msg[4]= sregarder) then
- begin
-  afdes(0);
-  if ((caff> 29) and (caff< 33)) then repon(2,caff) else repon(2,(caff+ 400));
-  tkey1(true);
-  caff:= mdes;
-  msg[3]:= 0;
-  crep:= 998;
- end
- else
- begin
-  obpart:= true;
-  crep:= caff+ 400;
-  mfoudi;
- end;
-end;
-
-procedure avpoing(var ob: integer);
-begin
- crep:= 999;
- if s.derobj<> 0 then ajjer(s.derobj);
- if crep<> 139 then
- begin
-  modobj(ob+ 400);
-  s.derobj:= ob;
-  ob:= 0;
- end;
-end;
-
-procedure rechai(var ch: integer);
-var
- cx: integer;
-begin
- cx:= s.mlieu;
- if s.mlieu= 16 then cx:= 14;
- ch:= tabdon[achai+ (cx* 7)+ pred(num)];
-end;
-
-procedure t23coul(var l: integer);
-var
- d: boolean;
-begin
- cherjer(143,d);
- l:= 14;
- if not d then
- begin
-  crep:= 1512;
-  tperd;
- end;
-end;
-
-procedure maivid;
-begin
- s.derobj:= 0;
- modobj(500);
-end;
-
-procedure st13(ob: integer);
-begin
- if (ob= 114) or (ob= 116) or (ob= 126) or (ob= 132) or
- (ob= 111) or (ob= 106) or (ob= 102) or (ob= 100) or
- (ob= 110) or (ob= 153) or (ob= 154) or (ob= 155) or
- (ob= 156) or (ob= 157) or (ob= 144) or (ob= 158) or
- (ob= 150) or (ob= 152) then crep:= 999 else crep:= 105;
-end;
-
-procedure aldepl;
-  var dummy:integer;
-begin
-  dummy:=do_alert('[1][Alors, utilisez le menu DEP...][ok]',1);
-end;
diff --git a/engines/mortevielle/original/0/MORT.000 b/engines/mortevielle/original/0/MORT.000
deleted file mode 100644
index 5d70cc5..0000000
Binary files a/engines/mortevielle/original/0/MORT.000 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.001 b/engines/mortevielle/original/0/MORT.001
deleted file mode 100644
index d646f33..0000000
Binary files a/engines/mortevielle/original/0/MORT.001 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.002 b/engines/mortevielle/original/0/MORT.002
deleted file mode 100644
index 1756f54..0000000
Binary files a/engines/mortevielle/original/0/MORT.002 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.003 b/engines/mortevielle/original/0/MORT.003
deleted file mode 100644
index 3e97c6e..0000000
Binary files a/engines/mortevielle/original/0/MORT.003 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.004 b/engines/mortevielle/original/0/MORT.004
deleted file mode 100644
index ab9f969..0000000
Binary files a/engines/mortevielle/original/0/MORT.004 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.005 b/engines/mortevielle/original/0/MORT.005
deleted file mode 100644
index d1ad3ca..0000000
Binary files a/engines/mortevielle/original/0/MORT.005 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.006 b/engines/mortevielle/original/0/MORT.006
deleted file mode 100644
index 60dff2a..0000000
Binary files a/engines/mortevielle/original/0/MORT.006 and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.COM b/engines/mortevielle/original/0/MORT.COM
deleted file mode 100644
index f39b611..0000000
Binary files a/engines/mortevielle/original/0/MORT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.IMG b/engines/mortevielle/original/0/MORT.IMG
deleted file mode 100644
index 5757cb2..0000000
Binary files a/engines/mortevielle/original/0/MORT.IMG and /dev/null differ
diff --git a/engines/mortevielle/original/0/MORT.PAS b/engines/mortevielle/original/0/MORT.PAS
deleted file mode 100644
index 6922b75..0000000
--- a/engines/mortevielle/original/0/MORT.PAS
+++ /dev/null
@@ -1,120 +0,0 @@
-program mortevielle;
-
- {$v-}
- {$k-}
- {$x-}
- {$c-}
-
- {$i  var.mor   }         (* les variables *)
- {$i  as        }         (* assembleur *)
- {$i  keyboard  }         (* la gestion du clavier *)
- {$i  mouse     }         (* la souris  *)
- {$i  level15   }         (* les fonctions de base *)
- {$i  droite    }         (* pour faire une droite *)
- {$i  boite     }
- {$i  sprint    }         (* l'affichage des textes *)
- {$i  outtext   }         (* fonctions sup‚rieures d'affichage *)
- {$i  parole    }         (* les fonctions de la parole *)
- {$i  alert     }
- {$i  parole2   }         (* les fonctions de la parole *)
- (*  debug              le debugging *)
- {$i  ques      }         (* les questions *)
- {$i  menu      }         (* les fonctions du menu *)
- {$i  mor       }         (* divers *)
- {$i  taffich   }         (* chargement des dessins *)
- {$i  ovd1      }         (* les fonctions sur disque 1 *)
- {$i  mor2      }         (* divers *)
- {$i  actions   }         (* les actions *)
- {$i  prog      }         (* fonctions toplevel *)
- {$i  disk      }         (* chargements et sauvegardes *)
-
-(*  ecrihexa            utilitaire *)
-
-procedure divers(np:integer;b:boolean);
-begin
-  teskbd;
-  repeat
-    parole(np, 0, 0);
-    atf3f8(key);
-    if newGd<>Gd then
-       begin
-         Gd:=newGd;
-         hirs;
-         aff50(b);
-       end;
-  until key= 66;
-end;
-
-(* NIVEAU 0 *)
-
-begin
-(*init_debug;*)
-(*  ecri_seg;*)
-  Gd:=Cga;
-  newGd:= Gd;
-  zuul:= False;
-  tesok:= False;
-  chartex;
-  charpal;
-  charge_cfiph;
-  charge_cfiec;
-  zzuul(adcfiec+161,0,1644);
-  c_zzz:= 1;
-  init_nbrepm;
-  init_mouse;
-(*  crep:=memw[$7f00:0];
-  memw[$7f00:0]:= crep+1;
-  if (memw[$7f00:0]<> crep+1) then
-     begin
-       hirs;
-       show_mouse;
-       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
-       clrscr;
-       halt;
-     end;
-  if (Dseg+$1000>adbruit5) then
-     begin
-       hirs;
-       show_mouse;
-       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
-       clrscr;
-       halt;
-     end;*)
-  init_lieu;
-  arret:= False;
-  sonoff:= False;
-  f2_all:= False;
-  textcolor(9);
-  teskbd;
-  dialpre;
-  newGd:= Gd;
-  teskbd;
-  if newGd<>Gd then Gd:=newGd;
-  hirs;
-  ades:= $7000;
-  aff50(false);
-  mlec:= 0;
-  divers(142,False);
-
-  ani50;
-  divers(143,True);
-  suite;
-  music;
-  adzon;
-  takesav(0);
-  if rech_cfiec then charge_cfiec;
-  for crep:=1 to c_zzz do zzuul(adcfiec+161,0,1644);
-  charge_bruit5;
-  init_menu;
-
-  theure;
-  dprog;
-  hirs;
-  dessine_rouleau;
-  show_mouse;
-  repeat tjouer until arret;
-  hide_mouse;
-  clrscr;
-(*out_debug;*)
-end.
-
diff --git a/engines/mortevielle/original/0/MOUSE.PAS b/engines/mortevielle/original/0/MOUSE.PAS
deleted file mode 100644
index 4f3b361..0000000
--- a/engines/mortevielle/original/0/MOUSE.PAS
+++ /dev/null
@@ -1,431 +0,0 @@
-const
-       m_arrow       = 0;
-       m_point_hand  = 1;
-
-var  int_m,
-     clic : boolean;
-
-     m_show,
-     X_S,
-     Y_S,
-     P_O_S,
-     mouse_shwn : integer;
-
-     S_S  : array[0..5,0..11] of integer;
-
-
-procedure init_mouse;
-  var i, j : integer;
-       reg : registres;
-begin
-  mouse_shwn:= 0;
-  X_S:= 0;
-  Y_S:= 0;
-  P_O_S:= 0;
-  (*int_m:= False;*)
-  clic:= False;
-  m_show:= m_arrow;
-  if (memw[0:$cc]=0) and (memw[0:$ce]=0) then int_m:= False;
-  if int_m then
-   begin
-    reg.ax:= 0;
-    intr($33,reg);
-    int_m:= (reg.ax=-1);
-    if int_m then
-      begin
-       with reg do
-         begin
-           ax:=4;
-           cx:=0;
-           dx:=0;
-         end;
-       intr($33,reg);
-     end;
-   end;
-end;
-
-(*procedure change_mouse( t : integer );
-begin
-  m_show:= t;
-end;*)
-
-(*procedure dessine_souris(xf,yf:integer);
-  var x, xx, y :integer;
-begin
-  case m_show of
-             m_arrow : begin
-                         affput(2,Gd,xf,yf,0,0);
-                       end;
-  end;
-end;  *)
-
-procedure hide_mouse;
-  var i,j,k,ps,ds:integer;
-      imp:boolean;
-begin
-  mouse_shwn := pred(mouse_shwn);
-  if mouse_shwn=0 then
-     begin
-       imp:= odd(Y_S);
-       j:=P_O_S;
-       case Gd of
-             cga : begin
-                     k:=0;
-                     j:=Y_S shr 1 * 80+ X_S shr 2;
-                     repeat
-                       memw[$b800:j]:=S_S[0,k];
-                       memw[$b800:j+2]:=S_S[1,k];
-                       memw[$ba00:j]:=S_S[2,k];
-                       memw[$ba00:j+2]:=S_S[3,k];
-                       j:=j+80;
-                       k:= succ(k);
-                     until k>=5;
-                   end;
-                ams : begin
-                        for i:=0 to 3 do
-                        begin
-                          port[$3DD]:= 1 shl i;
-                          k:=0;
-                          j:=P_O_S;
-                          repeat
-                            if imp then
-                              begin
-                                memw[$b800:j]:=S_S[i,k];
-                                j:=j+80-$2000;
-                              end
-                             else
-                              begin
-                                memw[$b800:j]:=S_S[i,k];
-                                j:=j+$2000;
-                              end;
-                            imp:=not imp;
-                            k:= succ(k);
-                          until k>=8;
-                        end;
-                      end;
-                ega : begin
-                        port[$3C4]:=2;
-                        port[$3CE]:=8;
-                        port[$3CF]:=255;
-                        i:= 0;
-                        repeat
-                          port[$3C5]:= 1 shl i;
-                          k:=0;
-                          j:=P_O_S;
-                          repeat
-                            ps:=mem[$A000:j];
-                            mem[$A000:j]:=lo(S_S[i,k]);
-                            ps:=mem[$A000:j+1];
-                            mem[$A000:j+1]:=hi(S_S[i,k]);
-                            j:=j+80;
-                            k:= succ(k);
-                          until k>=8;
-                          i:= i+1;
-                        until i=4;
-                      end;
-                her : begin
-                        j:= Y_S shr 1 *80+X_S shr 3;
-                        for i:=0 to 5 do
-                         begin
-                           for k:=0 to 3 do memw[$b000+k*$200:j]:=S_S[i,k];
-                           j:=j+80;
-                         end;
-                      end;
-                tan : begin
-                        j:= Y_S shr 2 *160+X_S shr 1;
-                        k:=0;
-                        repeat
-                          for i:=0 to 3 do
-                           begin
-                             memw[$b800+$200*i:j]:=S_S[k,i+k shl 2];
-                             memw[$b800+$200*i:j+2]:=S_S[k+3,i+k shl 2];
-                           end;
-                          j:=j+160;
-                          k:= succ(k);
-                        until k=3;
-                      end;
-
-       end;  (* case Gd *)
-     end;
-end;
-
-procedure show_mouse;
-  var i, j, k, l,
-      ps,ds : integer;
-      imp:boolean;
-      c : char;
-begin
-  mouse_shwn := mouse_shwn +1;
-  if mouse_shwn<>1 then exit;
-  j:=P_O_S;
-  imp:= odd(Y_S);
-  i:=X_S and 7;
-  case Gd of
-             cga : begin
-                     k:=0;
-                     j:=Y_S shr 1 * 80+ X_S shr 2;
-                     repeat
-                       S_S[0,k]:=memw[$b800:j];
-                       S_S[1,k]:=memw[$b800:j+2];
-                       S_S[2,k]:=memw[$ba00:j];
-                       S_S[3,k]:=memw[$ba00:j+2];
-                       j:=j+80;
-                       k:= succ(k);
-                     until k>=5;
-                   end;
-          ams : begin
-                  for i:=0 to 3 do
-                        begin
-                          j:=P_O_S;
-                          imp:= odd(Y_S);
-                          port[$3DE]:= i;
-                          k:=0;
-                          repeat
-                            if imp then
-                              begin
-                                S_S[i,k]:=memw[$b800:j];
-                                j:=j+80-$2000;
-                              end
-                             else
-                              begin
-                                S_S[i,k]:=memw[$b800:j];
-                                j:=j+$2000;
-                              end;
-                            imp:=not imp;
-                            k:= succ(k);
-                          until k>=8;
-                        end;
-                end;
-          ega : begin
-                  port[$3CE]:=4;
-                  l:= 0;
-                  repeat
-                    port[$3CF]:= l;
-                    k:=0;
-                    j:=P_O_S;
-                    repeat
-                      S_S[l,k]:= mem[$A000:j]+mem[$A000:succ(j)] shl 8;
-                      j:=j+80;
-                      k:= succ(k);
-                    until k>=8;
-                    l:= l+1;
-                  until l=4;
-                end;
-          her : begin
-                  j:= Y_S shr 1 *80+X_S shr 3;
-                  for i:=0 to 5 do
-                   begin
-                     for k:=0 to 3 do S_S[i,k]:=memw[$b000+k*$200:j];
-                     j:=j+80;
-                   end;
-                end;
-          tan : begin
-                  j:= Y_S shr 2*160+X_S shr 1;
-                  k:=0;
-                  repeat
-                    for i:=0 to 3 do
-                      begin
-                        S_S[k,i+k shl 2]:=memw[$b800+$200*i:j];
-                        S_S[k+3,i+k shl 2]:=memw[$b800+$200*i:j+2];
-                      end;
-                    j:=j+160;
-                    k:= succ(k);
-                  until k=3;
-                end;
-  end; (*  case Gd   *)
-  affput(2,Gd,X_S,Y_S,0,0);
-end;
-
-procedure pos_mouse(x,y : integer);
-  var reg:registres;
-begin
-  if x>314*res then x:=314*res
-           else if x<0 then x:=0;
-  if y>199 then y:=199
-           else if y<0 then y:=0;
-  if (x=X_S) and (y=Y_S) then exit;
-  if int_m then
-     begin
-       with reg do
-         begin
-           ax:=4;
-           cx:=x;
-           dx:=y;
-         end;
-       intr($33,reg);
-     end;
-  hide_mouse;
-  X_S:=x;
-  Y_S:=y;
-  case Gd of
-          ams : begin
-                  P_O_S:=(Y_S shr 1)*80+X_S shr 3+(Y_S and 1)*$2000;
-                end;
-          (*cga : begin
-                  P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
-                end;*)
-          ega : begin
-                  P_O_S:=Y_S*80+X_S shr 3;
-                end;
-  end; (*  case Gd   *)
-  show_mouse;
-end;
-
-procedure read_pos_mouse(var x,y,c:integer);
-   var reg:registres;
-begin
-  if int_m then
-     begin
-       reg.ax:=3;
-       intr($33,reg);
-       x:=reg.cx;
-       y:=reg.dx;
-       c:=reg.bx;
-     end
-    else
-     begin
-       c:=0;
-       x:=X_S;
-       y:=Y_S;
-     end;
-end;
-
-procedure mov_mouse(var funct : boolean; var key : char);
-     var p_key : boolean;
-         in1, in2 : char;
-         x,y,cx,cy,cd:integer;
-         reg:registres;
-   begin
-     if int_m then
-     begin
-       reg.ax:=3;
-       intr($33,reg);
-       x:=reg.cx;
-       y:=reg.dx;
-       cd:=reg.bx;
-       pos_mouse(x,y);
-       if cd<>0 then
-          begin
-            clic:=true;
-            exit;
-          end;
-     end;
-     funct:=false;
-     key:=#255;
-     p_key:=keypressed;
-     while p_key do
-        begin
-          read(kbd,in1);
-          read_pos_mouse(cx, cy, cd);
-          case upcase(in1) of
-                         '4' : cx:= cx - 8;
-                         '2' : cy:= cy + 8;
-                         '6' : cx:= cx + 8;
-                         '8' : cy:= cy - 8;
-                         '7' : begin
-                                 cy:=1;
-                                 cx:=1;
-                               end;
-                         '1' : begin
-                                 cx:=1;
-                                 cy:=190;
-                               end;
-                         '9' : begin
-                                 cx:=315*res;
-                                 cy:=1;
-                               end;
-                         '3' : begin
-                                 cy:=190;
-                                 cx:=315*res;
-                               end;
-                         '5' : begin
-                                 cy:=100;
-                                 cx:=155*res;
-                               end;
-                    ' ', #13 : begin
-                                 clic:=true;
-                                 exit;
-                               end;
-                         #27 : begin
-                                 p_key:=keypressed;
-                                 if p_key then
-                                    begin
-                                      read(kbd,in2);
-                                      case in2 of
-                                               'K' : cx:= pred(cx);
-                                               'P' : cy:= succ(cy);
-                                               'M' : cx:= cx + 2;
-                                               'H' : cy:= pred(cy);
-                                               ';'..'D' : begin
-                                                            funct:= true;
-                                                            key:=in2;
-                                                            exit;
-                                                          end;
-                                               'G' : begin
-                                                       cx:=cx-1;
-                                                       cy:=cy-1;
-                                                     end;
-                                               'I' : begin
-                                                       cx:=cx+1;
-                                                       cy:=cy-1;
-                                                     end;
-                                               'O' : begin
-                                                       cx:=cx-1;
-                                                       cy:=cy+1;
-                                                     end;
-                                               'Q' : begin
-                                                       cx:=cx+1;
-                                                       cy:=cy+1;
-                                                     end;
-                                            end; (* case *)
-                                    end;
-                               end;
-                         'I' : begin
-                                 cx:= res*32;
-                                 cy:= 8;
-                               end;
-                         'D' : begin
-                                 cx:= 80*res;
-                                 cy:= 8;
-                               end;
-                         'A' : begin
-                                 cx:= 126*res;
-                                 cy:= 8;
-                               end;
-                         'S' : begin
-                                 cx:= 174*res;
-                                 cy:= 8;
-                               end;
-                         'P' : begin
-                                 cx:= 222*res;
-                                 cy:= 8;
-                               end;
-                         'F' : begin
-                                 cx:= res*270;
-                                 cy:= 8;
-                               end;
-                         #19 : begin
-                                 sonoff:= not sonoff;
-                                 exit;
-                               end;
-                         #22 : begin
-                                 zuul:=True;
-                                 exit;
-                               end;
-                         #20 : begin           (* ^T => mode tandy *)
-                                 funct:= true;
-                                 key:= #9;
-                               end;
-                          #8 : begin           (* ^H => mode Hercule *)
-                                 funct:= true;
-                                 key:= #7;
-                               end;
-                    #1,#3,#5 : begin
-                                 funct:= true;
-                                 key:=in1;
-                               end;
-                end;
-          pos_mouse(cx, cy);
-          p_key:=keypressed;
-        end;
-   end;
diff --git a/engines/mortevielle/original/0/MUSINT.COM b/engines/mortevielle/original/0/MUSINT.COM
deleted file mode 100644
index a8fd455..0000000
Binary files a/engines/mortevielle/original/0/MUSINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/MUSINT2.COM b/engines/mortevielle/original/0/MUSINT2.COM
deleted file mode 100644
index 9ef47df..0000000
Binary files a/engines/mortevielle/original/0/MUSINT2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/MXX.MOR b/engines/mortevielle/original/0/MXX.MOR
deleted file mode 100644
index 73c732d..0000000
Binary files a/engines/mortevielle/original/0/MXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/NEWMENU.PAS b/engines/mortevielle/original/0/NEWMENU.PAS
deleted file mode 100644
index 4acd4c4..0000000
--- a/engines/mortevielle/original/0/NEWMENU.PAS
+++ /dev/null
@@ -1,336 +0,0 @@
-const ams=0; cga=1; ega=2;
-      NbMenu=6;
-
-const newlet : array[0..29] of byte
-             = ( $00, $00, $00,
-                 $1F, $DC, $00,
-                 $0E, $00, $00,
-                 $0E, $78, $F8,
-                 $1F, $39, $DC,
-                 $1C, $73, $80,
-                 $38, $73, $B8,
-                 $7B, $FB, $E0,
-                 $00, $00, $00,
-                 $00, $00, $00 );
-
-     lettr_ang : array[1..6,0..23] of byte
-             = ((   (* Inv *)
-                  $1C, $00, $00,
-                  $08, $00, $00,
-                  $12, $C7, $70,
-                  $11, $22, $20,
-                  $22, $42, $40,
-                  $22, $42, $80,
-                  $EE, $C3, $00,
-                  $00, $00, $00 ),
-
-                (   (* Mov *)
-                  $30, $C0, $00,
-                  $11, $80, $00,
-                  $3B, $0E, $77,
-                  $2D, $12, $22,
-                  $42, $22, $24,
-                  $42, $24, $28,
-                  $C6, $38, $30,
-                  $00, $00, $00 ),
-
-                (   (* Act *)
-                  $02, $00, $20,
-                  $06, $00, $20,
-                  $0A, $1E, $F0,
-                  $12, $22, $40,
-                  $3E, $40, $80,
-                  $42, $44, $80,
-                  $EE, $38, $C0,
-                  $00, $00, $00 ),
-
-                (   (* Self *)
-                  $0F, $80, $E7,
-                  $10, $80, $49,
-                  $20, $38, $88,
-                  $1E, $44, $9C,
-                  $02, $F9, $10,
-                  $42, $81, $20,
-                  $FC, $E7, $70,
-                  $00, $00, $00 ),
-
-                (   (* Dis *)
-                  $3E, $10, $00,
-                  $11, $00, $00,
-                  $21, $63, $C0,
-                  $21, $24, $00,
-                  $42, $47, $00,
-                  $44, $40, $80,
-                  $F9, $DF, $00,
-                  $00, $00, $00 ),
-
-                (  (* File *)
-                  $1F, $C9, $80,
-                  $08, $40, $80,
-                  $12, $31, $1C,
-                  $1E, $11, $22,
-                  $24, $22, $3C,
-                  $20, $22, $40,
-                  $E0, $EE, $70,
-                  $00, $00, $00 ));
-
-     lettr_all : array[1..6,0..23] of byte
-             = ((   (* Inv *)
-                  $1C, $00, $00,
-                  $08, $00, $00,
-                  $12, $C7, $70,
-                  $11, $22, $20,
-                  $22, $42, $40,
-                  $22, $42, $80,
-                  $EE, $C3, $00,
-                  $00, $00, $00 ),
-
-                (   (* Dep *)
-                  $3E, $00, $00,
-                  $11, $00, $00,
-                  $21, $39, $70,
-                  $21, $44, $88,
-                  $42, $79, $10,
-                  $44, $81, $E0,
-                  $F8, $E2, $00,
-                  $00, $07, $00 ),
-
-                (   (* Akt *)
-                  $02, $18, $10,
-                  $0E, $08, $10,
-                  $0A, $13, $78,
-                  $12, $14, $20,
-                  $3E, $38, $40,
-                  $42, $24, $40,
-                  $EE, $EC, $60,
-                  $00, $00, $00 ),
-
-                (  (* Self *)
-                  $0F, $80, $E7,
-                  $10, $80, $49,
-                  $20, $38, $88,
-                  $1E, $44, $9C,
-                  $02, $F9, $10,
-                  $42, $81, $20,
-                  $FC, $E7, $70,
-                  $00, $00, $00 ),
-
-                (   (* Dis *)
-                  $3E, $10, $00,
-                  $11, $00, $00,
-                  $21, $63, $C0,
-                  $21, $24, $00,
-                  $42, $47, $00,
-                  $44, $40, $80,
-                  $F9, $DF, $00,
-                  $00, $00, $00 ),
-
-                (   (* Fic *)
-                  $1F, $C8, $00,
-                  $08, $40, $00,
-                  $12, $31, $E0,
-                  $1E, $12, $20,
-                  $24, $24, $00,
-                  $20, $24, $40,
-                  $E0, $E3, $80,
-                  $00, $00, $00 ));
-
-     lettr_fra : array[1..6,0..23] of byte
-             = ((   (* Inv *)
-                  $1C, $00, $00,
-                  $08, $00, $00,
-                  $12, $C7, $70,
-                  $11, $22, $20,
-                  $22, $42, $40,
-                  $22, $42, $80,
-                  $EE, $C3, $00,
-                  $00, $00, $00 ),
-
-                (   (* D‚p *)
-                  $3E, $0C, $00,
-                  $11, $10, $00,
-                  $21, $39, $70,
-                  $21, $44, $88,
-                  $42, $79, $10,
-                  $44, $81, $E0,
-                  $F8, $E2, $00,
-                  $00, $07, $00 ),
-
-                (   (* Act *)
-                  $02, $00, $20,
-                  $06, $00, $20,
-                  $0A, $1E, $F0,
-                  $12, $22, $40,
-                  $3E, $40, $80,
-                  $42, $44, $80,
-                  $EE, $38, $C0,
-                  $00, $00, $00 ),
-
-                (  (* Self *)
-                  $0F, $80, $E7,
-                  $10, $80, $49,
-                  $20, $38, $88,
-                  $1E, $44, $9C,
-                  $02, $F9, $10,
-                  $42, $81, $20,
-                  $FC, $E7, $70,
-                  $00, $00, $00 ),
-
-                (   (* Dis *)
-                  $3E, $10, $00,
-                  $11, $00, $00,
-                  $21, $63, $C0,
-                  $21, $24, $00,
-                  $42, $47, $00,
-                  $44, $40, $80,
-                  $F9, $DF, $00,
-                  $00, $00, $00 ),
-
-                (   (* Fic *)
-                  $1F, $C8, $00,
-                  $08, $40, $00,
-                  $12, $31, $E0,
-                  $1E, $12, $20,
-                  $24, $24, $00,
-                  $20, $24, $40,
-                  $E0, $E3, $80,
-                  $00, $00, $00 ));
-
-type registres = record
-                   ax, bx, cx, dx, bp, sp, di, si, ds, es, Flags : integer;
-                 end;
-
-var Gd, res,coul : integer;
-    lettres : array[1..6,0..23] of byte;
-
-procedure affput(Chx,Gd,x,y,coul,char:integer); external 'c:\usr\mort\asm\divaf.com';
-
-procedure affcar(Gd,x,y,coul,char:integer);
-begin
-  if res=1 then affput(1,Gd,(x shr 1),y,coul,char)
-           else affput(1,Gd,x,y,coul,char);
-end;
-
-procedure putpix(Gd,x,y,coul:integer);
-begin
-  affput(0,Gd,x,y,coul,0);
-end;
-
-procedure hirs;
-   var i,  j : integer;
-begin
-  case Gd of
-    cga :
-     begin
-       graphcolormode;
-       graphbackground(0);
-       Palette(1);
-     end;
-    ams :
-     begin
-       hires;
-       inline($B8/6/0/        (*  =>  mov ax, 6 *)
-              $CD/$10);       (*  =>  int 16   *)
-       port[$3D9]:=15;
-       port[$3DF]:=0;
-       port[$3DD]:=15;
-     end;
-    ega :
-     inline($B8 / 14 / 0 /     (*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs *)
-            $CD / $10);        (*  INT 16  *)
-  end;
-end;
-
-
-(* NIVEAU 14*)
-
-procedure init_menu;
-    var
-        f : file;
-  begin
-    assign(f,'c:\usr\mort\menuan.mor');
-    reset(f,144);
-    blockread(f,lettres,1);
-    close(f);
-  end;
-
-procedure save_menu;
-    var
-        f : file;
-  begin
-    assign(f,'c:\usr\mort\menual.mor');
-    rewrite(f,144);
-    blockwrite(f,lettr_all,1);
-    close(f);
-    assign(f,'c:\usr\mort\menuan.mor');
-    rewrite(f,144);
-    blockwrite(f,lettr_ang,1);
-    close(f);
-
-  end;
-
-
-(*---------------------------------------------------------------------------*)
-(*--------------------   PROCEDURES  EN  ASSEMBLEUR   -----------------------*)
-(*---------------------------------------------------------------------------*)
-
-procedure box(c,Gd,xo,yo,xi,yi,patt:integer);
-     external 'c:\usr\mort\asm\boite.com';
-
-
-procedure menu_aff;
-     var
-         ind_tabl,k,col:integer;
-         c: char;
-         pt,x,y,color,msk,
-         num_letr: integer;
-   begin
-     (* debug('menu_aff'); *)
-     box( 7, Gd, 0,0, 639,10, 255);
-     col:= 28*res;
-     if Gd = cga then color:=1
-                 else color:=11;
-     num_letr:=0;
-     repeat     (* lettre par lettre *)
-       num_letr:= num_letr +1;
-       ind_tabl:=0;
-       y:= 1;
-       repeat    (* colonne par colonne *)
-         k:=0;
-         x:= col;
-         repeat   (* ligne par ligne *)
-           msk:=$80;
-           for pt:=0 to 7 do
-            begin
-              if (lettres[num_letr,ind_tabl] and msk)<>0 then
-                 begin
-                   putpix(Gd,x+1,y+1,0);
-                   putpix(Gd,x,y+1,0);
-                   putpix(Gd,x,y,color);
-                 end;
-              msk:= msk shr 1;
-              x:=x +1;
-            end;
-           ind_tabl:=succ(ind_tabl);
-           k:=succ(k);
-         until k=3;
-         y:=y+1;
-       until (y=9);
-       col:=col+48*res;
-     until num_letr=6;
-   end;
-
-
-begin
-  gd:=ega;
-  res:=2;
-  init_menu;
-  repeat
-    hirs;
-    menu_aff;
-    gotoxy(1,20);
-    write('Enter new Gd : ');
-    readln(Gd);
-    if gd=cga then res:=1 else res:=2;
-  until gd>2;
-end.
diff --git a/engines/mortevielle/original/0/OUTTEXT.PAS b/engines/mortevielle/original/0/OUTTEXT.PAS
deleted file mode 100644
index e5be32c..0000000
--- a/engines/mortevielle/original/0/OUTTEXT.PAS
+++ /dev/null
@@ -1,189 +0,0 @@
-var delig : str255;
-const
-               tabdr : array [0..31] of byte
-                     = (  32, 101, 115,  97, 114, 105, 110,
-                         117, 116, 111, 108,  13, 100,  99,
-                         112, 109,  46, 118, 130,  39, 102,
-                          98,  44, 113, 104, 103,  33,  76,
-                          85, 106,  30,  31 );
-
-
-               tab30 : array [0..31] of byte
-                     =(   69,  67,  74, 138, 133, 120,  77, 122,
-                         121,  68,  65,  63,  73,  80,  83,  82,
-                         156,  45,  58,  79,  49,  86,  78,  84,
-                          71,  81,  64,  66, 135,  34, 136,  91 );
-
-
-
-               tab31 : array [0..31] of byte
-                     = (  93,  47,  48,  53,  50,  70, 124,  75,
-                          72, 147, 140, 150, 151,  57,  56,  51,
-                         107, 139,  55,  89, 131,  37,  54,  88,
-                         119,   0,   0,   0,   0,   0,   0,   0 );
-
-procedure DeLine( num :integer ; var L:phrase ; var TL:integer );
-        var i,j,TS : integer;
-            let : char;
-             pS, k : byte;
-            the_end : boolean;
-        procedure cinq_huit( var c:char; var ind:integer; var pt:byte);
-             const rap : array[0..31] of char
-                 =( ',', ':', '@', '!', '?', '-', '‡',
-                    ' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
-                    '‹', 'Œ', '¢', #39, '“', '"', '—',
-                    '–', '0', '1', '2', '3', '4', '5',
-                    '6', '7', '8', '9');
-             var oct,ocd:integer;
-
-           begin    (* 5-8 *)
-             oct:=T_mot[ind];
-             oct:=(oct shl (16-pt)) shr (16-pt);
-             if pt<6 then
-                begin
-                  ind:=ind+1;
-                  oct:=oct shl (5-pt);
-                  pt:=pt+11;
-                  oct:=oct or (T_mot[ind] shr pt);
-                end
-              else
-                begin
-                  pt:=pt-5;
-                  oct:=oct shr pt;
-                end;
-
-             case oct of
-                          11 : begin
-                                 c:= '$';
-                                 The_end:= True;
-                               end;
-                       30,31 : begin
-                                 ocd:=T_mot[ind];
-                                 ocd:=(ocd shl (16-pt)) shr (16-pt);
-                                 if pt<6 then
-                                    begin
-                                      ind:=ind+1;
-                                      ocd:=ocd shl (5-pt);
-                                      pt:=pt+11;
-                                      ocd:=ocd or (T_mot[ind] shr pt);
-                                    end
-                                  else
-                                    begin
-                                      pt:=pt-5;
-                                      ocd:=ocd shr pt;
-                                    end;
-                                  if oct=30 then c:=chr(tab30[ocd])
-                                            else c:=chr(tab31[ocd]);
-                                  if c=#0 then
-                                     begin
-                                       The_end:=True;
-                                       c:='#';
-                                     end;
-                                end;
-                      else c:=chr(tabdr[oct]);
-                    end;
-           end;   (* 5-8 *)
-
-      begin   (* DETEX *)
-        (*debug('  => DeLine');*)
-        delig:='';
-        TS:= T_rec[num].indis;
-        pS:= T_rec[num].point;
-        i:=TS;
-        TL:=1;
-        j:=1;
-        k:=pS;
-        the_end:=False;
-        repeat
-          cinq_huit(let,i,k);
-          L[j]:=let;
-          if j<254 then delig:=delig+let;
-          j:=j+1;
-        until  the_end;
-        TL:=j-1;
-        if TL<255 then delig:=copy(delig,1,TL-1);    (* enleve le $ *)
-      end;    (* DETEX *)
-
-
-procedure afftex( Ch: phrase; x,y,dx,dy, typ : integer);
-    var the_end : boolean;
-        touch : char;
-        xf,yf : integer;
-        xc,yc : integer;
-        tab, p : integer;
-        s : string[255];
-        i,j,nt : integer;
-
-    function l_motsuiv(p:integer):integer;
-        var c:integer;
-      begin
-        c:=p;
-        while not (Ch[p] in [' ','$','@']) do p:=p+1;
-        l_motsuiv:=tab*(p-c);
-      end;
-
-  begin
-(*    debug('  .. Afftex');*)
-    putxy(x,y);
-    if res=1 then tab:=10 else tab:=6;
-    dx:= dx * 6;
-    dy:= dy * 6;
-    xc:= x;
-    yc:= y;
-    xf:= x+dx;
-    yf:= y+dy;
-    p:= 1;
-    the_end:=(Ch[p]='$');
-    s:='';
-    while not the_end do
-     begin
-      case Ch[p] of
-                  '@' : begin
-                          writeg(s,typ);
-                          s:='';
-                          p:=p+1;
-                          xc:=x;
-                          yc:=yc+6;
-                          putxy(xc,yc);
-                        end;
-                  ' ' : begin
-                          s:=s+' ';
-                          xc:=xc+tab;
-                          p:=p+1;
-                          if l_motsuiv(p)+xc > xf then
-                             begin
-                               writeg(s,typ);
-                               s:='';
-                               xc:=x;
-                               yc:=yc+6;
-                               if yc>yf then
-                                  begin
-                                    repeat until keypressed;
-                                    i:=y;
-                                    repeat
-                                      j:=x;
-                                      repeat
-                                        putxy(j,i);
-                                        writeg(' ',0);
-                                        j:=j+6;
-                                      until j>xf;
-                                      i:=i+6;
-                                    until i>yf;
-                                    yc:=y;
-                                  end;
-                               putxy(xc,yc);
-                             end;
-                        end;
-                  '$' : begin
-                          the_end:= True;
-                          writeg(s,typ);
-                        end;
-        else
-        begin
-          s:=s+Ch[p];
-          p:=p+1;
-          xc:=xc+tab;
-        end;
-      end;  (* case *)
-    end;
- end;
diff --git a/engines/mortevielle/original/0/OVD1.PAS b/engines/mortevielle/original/0/OVD1.PAS
deleted file mode 100644
index 81e3c91..0000000
--- a/engines/mortevielle/original/0/OVD1.PAS
+++ /dev/null
@@ -1,339 +0,0 @@
-procedure dem2;
-  var f:file;
-      k:integer;
-begin
-  { -- demande de disk 2 -- }
-  while ioresult<>0 do;
-  assign(f,'mort.001');
-  {$i-}
-  reset(f);
-  while ioresult<>0 do
-   begin
-     show_mouse;
-     k:= do_alert(al_mess2,1);
-     hide_mouse;
-     reset(f);
-   end;
-  close(f);
-end;
-
-procedure ani50;
-  begin
-    crep:= animof(1,1);
-    PictOut(adani,crep,63,12);
-    crep:= animof(2,1);
-    PictOut(adani,crep,63,12);
-    f2_all:= (res=1);
-    repon(2, c_paroles+143);
-  end;
-
-(*overlay procedure apzuul;
-  begin
-    if (c_zzz=1) or (c_zzz=2) then
-     begin
-       zzuul(adcfiec+161,0,1644);
-       c_zzz:=succ(c_zzz);
-     end;
-  end;*)
-
-overlay procedure aff50(c:boolean);
-    var k:integer;
-  begin
-    caff:= 50;
-    maff:=0;
-    taffich;
-    dessine(ades,63,12);
-    if c then ani50
-         else repon(2, c_paroles+142);
-    f3f8;
-  end;
-
-overlay procedure init_menu;
-    var i, j, tai : integer;
-        st        : phrase;
-        f : file;
-  begin
-    assign(f,'menufr.mor');
-    {$i-}
-    reset(f,144);
-    blockread(f,lettres,1);
-    close(f);
-    { ----  Demande de changement de disquette  ---- }
-    dem2;
-
-
-    for i:= 1 to 8 do
-       inv[i]:= '*                     ';
-    inv[7]:= '< -*-*-*-*-*-*-*-*-*- ';
-    for i:= 1 to 7 do
-       dep[i]:= '*                       ';
-    i:= 1;
-    repeat
-      DeLine(i+c_action,st,tai);
-      act[i]:= delig + '          ';
-      if i<9 then
-         begin
-           if i<6 then
-              begin
-                DeLine(i+c_saction,st,tai);
-                self[i]:= delig + '       ';
-              end;
-           DeLine(i+c_dis,st,tai);
-           dis[i]:= delig+ ' ';
-         end;
-      i:= succ(i);
-    until i= 22;
-    for i:= 1 to 8 do
-      begin
-       disc[i]:=$500+i;
-       if i<8 then depl[i]:=$200+i;
-       invt[i]:=$100+i;
-       if i>6 then menu_disable(invt[i]);
-      end;
-    msg3:=no_choice;
-    msg4:=no_choice;
-    msg[3]:=no_choice;
-    msg[4]:=no_choice;
-    clic:=false;
-  end;
-
-
-overlay procedure charpal;
-   var f : file of tabdb;
-       ft : file of tfxx;
-       i,j,k : integer;
-       fb : file of byte;
-       b : byte;
-begin
-  assign(ft,'fxx.mor');
-  {$i-}
-  reset(ft);
-  if ioresult<>0 then
-           begin
-             caff:=do_alert(err_mess,1);
-             halt;
-           end;
-  read(ft,l);
-  close(ft);
-  assign(f,'plxx.mor');
-  reset(f);
-  for i:= 0 to 90 do read(f,tabpal[i]);
-  close(f);
-  assign(fb,  'cxx.mor');
-  reset(fb);
-  for j:=0 to 90 do
-    begin
-      read(fb,palcga[j].p);
-      for i:=0 to 15 do
-        with palcga[j].a[i] do
-          begin
-            read(fb,b);
-            n:=b shr 4;
-            hom[0]:= b shr 2 and 3;
-            hom[1]:= b and 3;
-          end;
-    end;
-  palcga[10].a[9]:= palcga[10].a[5];
-  for j:=0 to 14 do
-    begin
-      read(fb,tpt[j].tax);
-      read(fb,tpt[j].tay);
-      for i:=1 to 20 do
-        for k:=1 to 20 do
-          read(fb,tpt[j].des[i,k]);
-    end;
-  close(fb);
-end;
-
-overlay procedure chartex;
-  var i:integer;
-      FiByte:file;
-      s : phrase;
-begin
-(* debug('o3 chartex'); *)
-  i:=0;
-  assign(FiByte,'TXX.INP');
-  {$i-}
-  reset(FiByte);
-  blockread(FiByte,T_mot,125);
-  close(FiByte);
-  assign(sauv_T,'TXX.NTP');
-  reset(sauv_T);
-  repeat
-    read(sauv_T,T_rec[i]);
-    i:=i+1;
-  until eof(sauv_T);
-  close(sauv_T);
-  DeLine(578,s,i);
-  al_mess:= delig;
-  DeLine(579,s,i);
-  err_mess:= delig;
-  DeLine(580,s,i);
-  ind_mess:= delig;
-  DeLine(581,s,i);
-  al_mess2:= delig;
-end;
-
-overlay procedure dialpre;
-
-var
- cy, tay  : integer;
- st : phrase;
- ix : real;
- ch : char;
-
-begin
- (* debug('o3 dialpre'); *)
- cy:=0;
- clrscr;
- textcolor(9);
- repeat
-   cy:= cy+1;
-   DeLine( cy+c_dialpre,st,tay);
-   gotoxy(40-tay div 2,wherey+1);
-   write(delig);
- until cy=20;
- ix:=0;
- repeat
-   ix:= ix+1;
- until (keypressed or (ix=5e5));
- crep:= 998;
- textcolor(1);
- gotoxy(1,21); clreol;
- gotoxy(1,23);
- write('CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512');
- gotoxy(12,24);
- write('Ctrl       C      E            H             T           A');
- repeat
-   read(kbd,ch);
- until ch in [#1,#3,#5,#20,#8];
- case ch of
-      #1,#3,#5 : Gd:= ord(ch) shr 1;
-            #8 : Gd:= Her;
-           #20 : Gd:= Tan;
- end;
- gotoxy(1,24);
- clreol;
- gotoxy(1,23);
- clreol;
- gotoxy(26,23);
- write('Jeu au Clavier / … la Souris');
- textcolor(4);
- gotoxy(33,23); write('C');
- gotoxy(48,23); write('S');
- repeat
-   read(kbd,ch);
- until upcase(ch) in ['C','S'];
- int_m:= (upcase(ch)='S');
-end;
-
-overlay procedure init_lieu;
- var
-   f_lieu : file of tab_mlieu;
-begin
-(* debug('o3 init_lieu'); *)
-  assign(f_lieu,'MXX.mor');
-  {$i-}
-  reset(f_lieu);
-  read(f_lieu,v_lieu);
-  close(f_lieu);
-end;
-
-
-overlay procedure music;
- var
-       fic : file;
-         k : integer;
-       fin : boolean;
-        ch : char;
-        x,y : real;
-
-begin
-  (* debug('o3 music'); *)
-  if sonoff then exit;
-  rech_cfiec:= True;
-  assign(fic,'mort.img');
-  {$i-}
-  reset(fic);
-  blockread(fic,mem[$3800:0],500);
-  blockread(fic,mem[$47A0:0],123);
-  close(fic);
-  demus($3800,$5000,623);
-  addfix:= (tempo_mus-addv[1])/256;
-  cctable(tbi);
-
-  fin:=false;
-  k:=0;
-  repeat
-    fin:= keypressed;
-    musyc( tbi, 9958 , tempo_mus);
-    k:= k+1;
-    fin:= fin or keypressed or (k>=5);
-  until fin;
-  while keypressed do read(kbd,ch);
-end;
-
-
-overlay procedure charge_bruit5;
-     var f:file;
-   begin
-     assign(f,'bruit5');
-     {$i-}
-     reset(f);
-     if ioresult<>0 then
-     begin
-       caff:=do_alert(err_mess,1);
-       halt;
-     end;
-     blockread(f,mem[adbruit5:0],149);
-     (*blockread(f,mem[$5CB0:0],100);
-     blockread(f,mem[$3D1F:0],49);*)
-     close(f);
-   end;
-
-overlay procedure charge_cfiec;
-        var
-            f : file;
-      begin
-        assign(f,'cfiec.mor');
-       {$i-}
-        reset(f);
-        blockread(f,mem[adcfiec:0],511);
-        blockread(f,mem[adcfiec+4088:0],311);
-        close(f);
-        rech_cfiec:= False;
-      end;
-
-
-overlay procedure charge_cfiph;
-        var
-            f : file;
-      begin
-        assign(f,'cfiph.mor');
-        {$i-}
-        reset(f,256);
-        blockread(f,t_cph,50);
-        close(f);
-      end;
-
-
-overlay procedure suite;
-  var cpr:string[25];
-begin
-  hirs;
-  repon(7,2035);
-  caff:= 51;
-  taffich;
-  teskbd;
-  if newGd<>Gd then Gd:=newGd;
-  hirs;
-  dessine(ades,0,0);
-  gotoxy(20*pred(res)+8,24);
-  textcolor(7);
-  cpr:='COPYRIGHT 1989 : LANKHOR';
-  if gd in [Ega,Ams,Cga] then write(cpr)
-             else begin
-                    putxy(104+72*res,190);
-                    writeg(cpr,0);
-                  end;
-end;
diff --git a/engines/mortevielle/original/0/PAROLE.PAS b/engines/mortevielle/original/0/PAROLE.PAS
deleted file mode 100644
index 233f3bb..0000000
--- a/engines/mortevielle/original/0/PAROLE.PAS
+++ /dev/null
@@ -1,415 +0,0 @@
-
-   procedure spfrac(wor : integer);
-     begin
-       c3.rep:= wor shr 12;
-       if (typlec=0) and (c3.code<>9) then
-          if ((c3.code>4) and (c3.val<>20) and not (c3.rep in [3,6,9])) or
-             ((c3.code<5) and not (c3.val in [19,22]) and not (c3.rep in [4,9])) then
-             c3.rep:= c3.rep + 1;
-       c3.freq:= (wor shr 6) and 7;
-       c3.acc:= (wor shr 9) and 7;
-     end;
-
-   procedure charg_car;
-       var wor, int : integer;
-     begin
-       wor:= swap(memw[adword:ptr_word]);
-       int:= wor and $3F;
-       case int of
-                  60 : begin
-                         c3.val:= 32;  (*  " "  *)
-                         c3.code:= 9;
-                       end;
-                  61 : begin
-                         c3.val:= 46;  (*  "."  *)
-                         c3.code:= 9;
-                       end;
-                  62 : begin
-                         c3.val:= 35;  (*  "#"  *)
-                         c3.code:= 9;
-                       end;
-              22..47 : begin
-                         int:= int-22;
-                         c3.val:= int;
-                         c3.code:= typcon[int];
-                       end;
-              48..56 : begin
-                         c3.val:= int-22;
-                         c3.code:= 4;
-                       end;
-              14..21 : begin
-                         c3.val:= int;
-                         c3.code:= 6;
-                       end;
-               0..13 : begin
-                         c3.val:= int;
-                         c3.code:= 5;
-                       end;
-       end;
-       spfrac(wor);
-       ptr_word:= ptr_word+2;
-     end;
-
-
-   procedure entroct( o:byte);
-     begin
-       mem[adtroct:ptr_oct]:= o;
-       ptr_oct:= ptr_oct+1;
-     end;
-
-   procedure veracf(b:byte);
-     begin
-     end;
-
-overlay procedure cctable (var t:tablint);
-  var
-      k:integer;
-      tb : array[0..256] of real;
-
-   begin
-     Tb[0]:=0;
-     for k:=0 to 255 do
-     begin
-       Tb[k+1]:= addfix + Tb[k];
-       T[255-k]:=trunc(Tb[k])+1;
-     end;
-   end;
-
-overlay procedure regenbruit;
-        var
-            i,j : integer;
-      begin
-        i:= offsetb3+8590;
-        j:= 0;
-        repeat
-          t_cph[j]:=memw[adbruit3:i];
-          i:= i+2;
-          j:= j+1;
-        until i>= offsetb3+8790
-      end;
-
-overlay   procedure charge_son;
-        var
-            f : file;
-      begin
-        assign(f,'sonmus.mor');
-        reset(f);
-        blockread(f,mem[$7414:0],273);
-        (*blockread(f,mem[adson:0],300);
-        blockread(f,mem[adson+2400:0],245);*)
-        demus($7414,adson,273);
-        close(f);
-      end;
-
-overlay   procedure charge_phbruit;
-        var
-            f : file;
-      begin
-        assign(f,'phbrui.mor');
-        reset(f);
-        blockread(f,t_cph,3);
-        close(f);
-      end;
-
-overlay   procedure charge_bruit;
-        var
-            f : file;
-            j,i:integer;
-      begin
-        assign(f,'bruits');
-        reset(f);
-        blockread(f,mem[adbruit:0],250);
-        for i:=0 to 19013 do mem[adbruit:32000+i]:= mem[adbruit5:i];
-        blockread(f,mem[adbruit1:offsetb1],149);
-        close(f);
-      end;
-
-overlay   procedure trait_car;
-       var    d3 : byte;
-           d2, i : integer;
-     begin
-       case c2.code of
-                    9 : if (c2.val<>ord('#')) then for i:=0 to c2.rep do entroct(c2.val);
-
-                  5,6 : begin
-                          if c2.code=6 then d3:= tabdph[(c2.val - 14) shl 1]
-                                       else d3:= null;
-                          if (c1.code>=5) then
-                             begin
-                               veracf(c2.acc);
-                               if (c1.code=9) then
-                                  begin
-                                    entroct(4);
-                                    if d3=null then entroct(c2.val)
-                                               else entroct(d3);
-                                    entroct(22);
-                                  end;
-                             end;
-                          case (c2.rep) of
-                                        0 : begin
-                                              entroct(0);
-                                              entroct(c2.val);
-                                              if d3=null then if c3.code=9 then entroct(2)
-                                                                           else entroct(4)
-                                                         else if c3.code=9 then entroct(0)
-                                                                           else entroct(1);
-                                            end;
-                                    4,5,6 : begin
-                                              if c2.rep<>4 then
-                                                 begin
-                                                   i:= c2.rep-5;
-                                                   repeat
-                                                     i:= i-1;
-                                                     entroct(0);
-                                                     if d3=null then entroct(c2.val)
-                                                                else entroct(d3);
-                                                     entroct(3);
-                                                   until i<0;
-                                                 end;
-                                              if d3=null then
-                                                 begin
-                                                   entroct(4);
-                                                   entroct(c2.val);
-                                                   entroct(0);
-                                                 end
-                                                else
-                                                 begin
-                                                   entroct(0);
-                                                   entroct(c2.val);
-                                                   entroct(3);
-                                                 end;
-                                            end;
-                                    7,8,9 : begin
-                                              if c2.rep<>7 then
-                                                 begin
-                                                   i:= c2.rep-8;
-                                                   repeat
-                                                     i:= i-1;
-                                                     entroct(0);
-                                                     if d3=null then entroct(c2.val)
-                                                                else entroct(d3);
-                                                     entroct(3);
-                                                   until i<0;
-                                                 end;
-                                              if d3=null then
-                                                 begin
-                                                   entroct(0);
-                                                   entroct(c2.val);
-                                                   entroct(2);
-                                                 end
-                                                else
-                                                 begin
-                                                   entroct(0);
-                                                   entroct(c2.val);
-                                                   entroct(0);
-                                                 end;
-                                            end;
-                                    1,2,3 : begin
-                                              if c2.rep<>1 then
-                                                 begin
-                                                   i:= c2.rep-2;
-                                                   repeat
-                                                     i:= i-1;
-                                                     entroct(0);
-                                                     if d3=null then entroct(c2.val)
-                                                                else entroct(d3);
-                                                     entroct(3);
-                                                   until i<0;
-                                                 end;
-                                              entroct(0);
-                                              entroct(c2.val);
-                                              if c3.code=9 then entroct(0)
-                                                           else entroct(1);
-                                            end;
-                          end;  (*  case  c2.rep  *)
-                        end;
-
-                  2,3 : begin
-                          d3:= c2.code+5;  (*  7 ou 8  => voyelle correspondante  *)
-                          if c1.code>4 then
-                             begin
-                               veracf(c2.acc);
-                               if c1.code=9 then
-                                  begin
-                                    entroct(4);
-                                    entroct(d3);
-                                    entroct(22);
-                                  end;
-                             end;
-                          i:=c2.rep;
-                          if i<>0 then
-                             begin
-                               repeat
-                                 i:=i-1;
-                                 entroct(0);
-                                 entroct(d3);
-                                 entroct(3);
-                               until i<=0;
-                             end;
-                          veracf(c3.acc);
-                          if c3.code=6 then
-                             begin
-                               entroct(4);
-                               entroct(tabdph[(c3.val-14) shl 1]);
-                               entroct(c2.val);
-                             end
-                            else
-                             begin
-                               entroct(4);
-                               if c3.val=4 then entroct(3)
-                                           else entroct(c3.val);
-                               entroct(c2.val);
-                             end;
-                        end;
-                  0,1 : begin
-                          veracf(c2.acc);
-                          case c3.code of
-                                       2 : d2:= 7;
-                                       3 : d2:= 8;
-                                       6 : d2:= tabdph[(c3.val-14) shl 1];
-                                       5 : d2:= c3.val;
-                                      else d2:=10;
-                          end;    (*  case  c3.code  *)
-                          d2:= d2 *26 + c2.val;
-                          if tnocon[d2]=0 then d3:=2
-                                          else d3:=6;
-                          if c2.rep>=5 then
-                             begin
-                               c2.rep:=c2.rep-5;
-                               d3:= 8-d3;         (*  echange 2 et 6  *)
-                             end;
-                          if c2.code=0 then
-                             begin
-                               i:=c2.rep;
-                               if i<>0 then
-                                  begin
-                                    repeat
-                                      i:=i-1;
-                                      entroct(d3);
-                                      entroct(c2.val);
-                                      entroct(3);
-                                    until i<=0;
-                                  end;
-                               entroct(d3);
-                               entroct(c2.val);
-                               entroct(4);
-                             end
-                            else
-                             begin
-                               entroct(d3);
-                               entroct(c2.val);
-                               entroct(3);
-                               i:=c2.rep;
-                               if i<>0 then
-                                  begin
-                                    repeat
-                                      i:=i-1;
-                                      entroct(d3);
-                                      entroct(c2.val);
-                                      entroct(4);
-                                    until i<=0;
-                                  end;
-                             end;
-                          if c3.code=9 then
-                             begin
-                               entroct(d3);
-                               entroct(c2.val);
-                               entroct(5);
-                             end
-                            else
-                             if not (c3.code in [0..1,4]) then
-                                begin
-                                  veracf(c3.acc);
-                                  case (c3.code) of
-                                                 3 : d2:= 8;
-                                                 6 : d2:= tabdph[(c3.val-14) shl 1];
-                                                 5 : d2:= c3.val;
-                                                else d2:= 7;
-                                  end;  (*  case c3.code  *)
-                                  if d2=4 then d2:=3;
-                                  if intcon[c2.val]<>0 then c2.val:= c2.val+1;
-                                  if (c2.val=17) or (c2.val=18) then c2.val:=16;
-                                  entroct(4);
-                                  entroct(d2);
-                                  entroct(c2.val);
-                                end;
-                        end;
-                    4 : begin
-                          veracf(c2.acc);
-                          i:=c2.rep;
-                          if i<>0 then
-                             begin
-                               repeat
-                                 i:=i-1;
-                                 entroct(2);
-                                 entroct(c2.val);
-                                 entroct(3);
-                               until i<=0;
-                             end;
-                          entroct(2);
-                          entroct(c2.val);
-                          entroct(4);
-                          if c3.code=9 then
-                             begin
-                               entroct(2);
-                               entroct(c2.val);
-                               entroct(5);
-                             end
-                            else
-                             if not (c3.code in [0..1,4]) then
-                                begin
-                                  veracf(c3.acc);
-                                  case (c3.code) of
-                                                 3 : d2:= 8;
-                                                 6 : d2:= tabdph[(c3.val-14) shl 1];
-                                                 5 : d2:= c3.val;
-                                                else d2:= 7;
-                                  end;  (*  case c3.code  *)
-                                  if d2=4 then d2:=3;
-                                  if intcon[c2.val]<>0 then c2.val:= c2.val+1;
-                                  entroct(4);
-                                  entroct(d2);
-                                  entroct(tabdbc[(c2.val-26) shl 1+1]);
-                                end;
-                        end;
-       end;  (* case c2.code  *)
-     end;
-
-{overlay function testprot : boolean;
-var
-   regs : registres;
- buffer : array[0..511] of char;
-  i,j,k : integer;
-     st : phrase;
-    tay : integer;
-   test : array[0..2] of boolean;
-const
- chaine : array[0..7] of char
-        = (' ','M','A','S','T','E','R',' ');
-
-begin
- test[0]:= false;test[1]:=false;test[2]:=false;k:=0;
- with regs do
- begin
-   while (test[k]=false) and (k<2) do
-   begin
-     k:=k+1;
-     ax:=0;intr(19,regs);
-     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-     intr(19,regs);
-     test[k]:=true;
-     tesok:= true;
-     i:=0;
-     while (test[k]) and (i<19) do
-      begin
-       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
-      end;
-      for j:=0 to 7 do
-       if buffer[j+504]<>chaine[j] then test[k]:=false;
-   end;
- end;
- testprot:=(test[1] or test[2]);
-end;
-}
-
diff --git a/engines/mortevielle/original/0/PAROLE2.PAS b/engines/mortevielle/original/0/PAROLE2.PAS
deleted file mode 100644
index 600206e..0000000
--- a/engines/mortevielle/original/0/PAROLE2.PAS
+++ /dev/null
@@ -1,102 +0,0 @@
-  procedure rot_chariot;
-     begin
-       c1:= c2;
-       c2:= c3;
-       with c3 do
-          begin
-            val:= 32;
-            code:= 9;
-          end;
-     end;
-
-   procedure init_chariot;
-     begin
-       with c3 do
-          begin
-            rep:= 0;
-            freq:= 0;
-            acc:= 0;
-          end;
-       rot_chariot;
-       rot_chariot;
-     end;
-
-
-procedure trait_ph;
-     const  deca : array[0..2] of integer
-                  =(300,30,40);
-   begin
-     ptr_tcph:= pred(num_ph);
-     ledeb:=swap(t_cph[ptr_tcph]) + deca[typlec];
-     lefin:=swap(t_cph[ptr_tcph+1]) + deca[typlec];
-     nb_word:= lefin - ledeb;
-     ptr_tcph:=ledeb shr 1;
-     ptr_word := 0;
-     repeat
-       memw[adword: ptr_word]:= t_cph[ptr_tcph];
-       ptr_word := ptr_word +2;
-       ptr_tcph := ptr_tcph+1;
-     until ptr_tcph>=lefin shr 1;
-
-     ptr_oct:= 0;
-     ptr_word:= 0;
-     init_chariot;
-
-     repeat
-       rot_chariot;
-       charg_car;
-       trait_car;
-     until ptr_word >= nb_word;
-
-     rot_chariot;
-     trait_car;
-     entroct(ord('#'));
-   end;
-
-
-
-   procedure parole(rep, ht, typ : integer);
-       var
-          savph:array[0..500] of integer;
-          i: integer;
-          tempo:integer;
-
-    begin
-      if sonoff then exit;
-      num_ph:= rep;
-      haut:= ht;
-      typlec:= typ;
-      if typlec<>0 then
-         begin
-           for i:=0 to 500 do savph[i]:=t_cph[i];
-           tempo:= tempo_bruit;
-         end
-                   else
-          if haut>5 then tempo:= tempo_f
-                    else tempo:= tempo_m;
-      addfix:= (tempo-addv[0])/256;
-      cctable(tbi);
-      case typ of
-              1 : begin
-                    charge_bruit;
-                    (*if zuul then zzuul(adbruit,0,1095);*)
-                    regenbruit;
-                  end;
-               2 : begin
-                    charge_son;
-                    charge_phbruit;
-                  end;
-      end;
-      trait_ph;
-      litph(Tbi,typ,tempo);
-      if typlec<>0 then
-         for i:=0 to 500 do
-            begin
-              t_cph[i]:=savph[i];
-              mlec:=typlec;
-            end;
-      writepal(numpal);
-    end;
-
-
-
diff --git a/engines/mortevielle/original/0/PHBRUI.MOR b/engines/mortevielle/original/0/PHBRUI.MOR
deleted file mode 100644
index 4b07358..0000000
Binary files a/engines/mortevielle/original/0/PHBRUI.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINT.COM b/engines/mortevielle/original/0/PHINT.COM
deleted file mode 100644
index 87ea93e..0000000
Binary files a/engines/mortevielle/original/0/PHINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINT2.COM b/engines/mortevielle/original/0/PHINT2.COM
deleted file mode 100644
index 9d79eef..0000000
Binary files a/engines/mortevielle/original/0/PHINT2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINTBAK.COM b/engines/mortevielle/original/0/PHINTBAK.COM
deleted file mode 100644
index 0191fce..0000000
Binary files a/engines/mortevielle/original/0/PHINTBAK.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINTCOM.COM b/engines/mortevielle/original/0/PHINTCOM.COM
deleted file mode 100644
index 0191fce..0000000
Binary files a/engines/mortevielle/original/0/PHINTCOM.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINTDEF.COM b/engines/mortevielle/original/0/PHINTDEF.COM
deleted file mode 100644
index b167519..0000000
Binary files a/engines/mortevielle/original/0/PHINTDEF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINTGM.COM b/engines/mortevielle/original/0/PHINTGM.COM
deleted file mode 100644
index 4ec9edd..0000000
Binary files a/engines/mortevielle/original/0/PHINTGM.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PHINTUK.COM b/engines/mortevielle/original/0/PHINTUK.COM
deleted file mode 100644
index d47dc09..0000000
Binary files a/engines/mortevielle/original/0/PHINTUK.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/PLXX.MOR b/engines/mortevielle/original/0/PLXX.MOR
deleted file mode 100644
index e867b3b..0000000
Binary files a/engines/mortevielle/original/0/PLXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/PROG.PAS b/engines/mortevielle/original/0/PROG.PAS
deleted file mode 100644
index e81df0a..0000000
--- a/engines/mortevielle/original/0/PROG.PAS
+++ /dev/null
@@ -1,346 +0,0 @@
-overlay procedure change_Gd(nGd: integer);
-  var i : integer;
-begin
-  hide_mouse;
-  Gd:= nGd;
-  hirs;
-  init_mouse;
-  show_mouse;
-  dessine_rouleau;
-  tinke;
-  pendule;
-  if ipers<>0 then affper(ipers) else person;
-  clsf2;
-  clsf3;
-  maff:= 68;
-  afdes(0);
-  repon(2,crep);
-  menu_aff;
-end;
-
-overlay procedure antegame;
-var
-     cx : integer;
-   regs : registres;
- buffer : array[0..511] of char;
-  i,j,k : integer;
-   test : array[0..2] of boolean;
-    g : array[0..7] of char;
-
-begin
- hide_mouse;
- imen:= false;
- g[1]:='M';
-perdu:= True;
- anyone:= false;
-okdes:= True;
- test[0]:= false;
- test[1]:=false;
- g[0]:=#32;
- col:= false;
- tesok:= True;
- test[2]:=false;
- g[7]:=g[0];
- g[2]:='A';
- cache:= false;
- brt:= false;
- maff:= 68;
- g[5]:='E';
- mnumo:= 0;
- prebru:= 0;
- g[4]:='T';
- x:= 0;
- y:= 0;
- num:= 0;
- hdb:= 0;
- hfb:= 0;
- cs:= 0;
- is:= 0;
- k:= 0;
- ment:= 0;
-syn:= True;
-fouil:= True;
- mchai:= 0;
- inei:= 0;
- initouv;
- g[3]:='S';
- g[6]:='R';
- iouv:= 0;
- dobj:= 0;
- affrep;
- stpou:= ind_mess;
- while (test[k]=false) and (k<2) do
- begin
-   regs.ax:=0;
-   k:=succ(k);
-   intr(19,regs);
-   with regs do
-    begin
-      ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-      intr(19,regs);
-      test[k]:=not imen;
-      i:=0;
-      while (test[k]) and (i<19) do
-        begin
-          ax:=$0201;
-          syn:= false;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-          intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
-        end;
-        okdes:= false;
-        solu:= True;
-      for j:=0 to 7 do if buffer[j+504]<>g[j] then test[k]:=false;
-    end;
-   perdu:= False;
-   fouil:= false;
- end;
- person;
- tinke;
- pendule;
- afdes(0);
- repon(2,crep);
- clsf3;
- solu:= false;
- tmlieu(s.mlieu);
- modinv;
- if s.derobj<> 0 then modobj2(s.derobj+ 400,test[1],test[2])
-                 else tesok:=test[1] or test[2];
- show_mouse;
-end;
-
-
-(* NIVEAU 3 *)
-(* procedure PROGRAMME *)
-procedure tmaj3;
-var
- j,h,m: integer;
-begin
- calch(j,h,m);
- if m= 30 then m:= 1;
- h:= h+ (j* 24);
- m:= m+ (h* 2);
- s.heure:= chr(m);
-end;
-
-procedure tsitu;
-label 1,2;
-var
- h,j,m: integer;
-begin
- if not col then clsf2;
- syn:= false;
- iesc:= false;
- if anyone then goto 1;
- if brt then
-  if (msg[3]= depla) or (msg[4]= sortir) or (msg[4]= dormir) or
-     (msg[4]= manger) then
-  begin
-   ctrm:= 4;
-   goto 2;
-  end;
- if msg[3]= depla      then taller;
- if msg[3]= discut     then tparler;
- if msg[3]= invent     then tsprendre;
- if msg[4]= attacher   then tattacher;
- if msg[4]= attendre   then tattendre;
- if msg[4]= defoncer   then tdefoncer;
- if msg[4]= dormir     then tdormir;
- if msg[4]= ecouter    then tecouter;
- if msg[4]= entrer     then tentrer;
- if msg[4]= fermer     then tfermer;
- if msg[4]= fouiller   then tfouiller;
- if msg[4]= frapper    then tfrapper;
- if msg[4]= gratter    then tgratter;
- if msg[4]= lire       then tlire;
- if msg[4]= manger     then tmanger;
- if msg[4]= mettre     then tmettre;
- if msg[4]= ouvrir     then touvrir;
- if msg[4]= prendre    then tprendre;
- if msg[4]= regarder   then tregarder;
- if msg[4]= sentir     then tsentir;
- if msg[4]= sonder     then tsonder;
- if msg[4]= sortir     then tsortir;
- if msg[4]= soulever   then tsoulever;
- if msg[4]= tourner    then ttourner;
- if msg[4]= scacher    then
- begin
-  tcacher;
-  goto 1;
- end;
- if msg[4]= sfouiller  then tsfouiller;
- if msg[4]= slire      then tslire;
- if msg[4]= sposer     then tposer;
- if msg[4]= sregarder  then tsregarder;
- cache:= false;
-1:
- if anyone then
- begin
-  quelquun;
-  anyone:= false;
-  goto 2;
- end;
- calch(j,h,m);
- if (((h= 12) or (h= 13) or (h= 19)) and (s.mlieu<> 10)) or
- ((h> 0) and (h< 6) and (s.mlieu<> 0)) then s.conf:= s.conf+ 1;
- if ((s.mlieu< 16) or (s.mlieu> 19)) and (s.mlieu<> 23)
- and (s.mlieu<> 0) and (s.derobj<> 152) and (not perdu) then
- begin
-  if (s.conf> 99) and (h> 8) and (h< 16) then
-  begin
-   crep:= 1501;
-   tperd;
-  end;
-  if (s.conf> 99) and (h> 0) and (h< 9) then
-  begin
-   crep:= 1508;
-   tperd;
-  end;
-  if (j> 1) and (h> 8) and (not perdu) then
-  begin
-   crep:= 1502;
-   tperd;
-  end;
- end;
-2:
- mennor;
-end;
-
-procedure sv_game(n:integer); forward;
-
-procedure ld_game(n:integer); forward;
-
-procedure tecran;
- const  idem = 'Idem';
-        lim  = 20000 ;
-var
- temps : integer;
- inkey : char;
- oo, funct : boolean;
-begin
- clsf3;
- oo:= false;
- ctrm:= 0;
- if not iesc then
- begin
-   draw_menu;
-   imen:= true;
-   temps:= 0;
-   key:= 0;
-   funct:= False;
-   inkey:='.';
-
-   repeat
-     mdn;
-     tinke;
-     mov_mouse(funct,inkey);
-     temps:= temps+ 1;
-   until (choisi) or (temps > lim) or (funct) or (anyone);
-
-   erase_menu;
-   imen:= false;
-   if inkey in [#1,#3,#5,#7,#9] then
-      begin
-        change_Gd(pred(ord(inkey)) shr 1);
-        exit;
-      end;
-   if choisi and (msg[3]=sauve) then sv_game(msg[4] and 7);
-   if choisi and (msg[3]=charge) then ld_game(pred(msg[4] and 7));
-   if inkey= #67 then         (* F9 *)
-   begin
-     temps := do_alert(stpou,1);
-     exit;
-   end
-   else
-    if inkey= #63 then
-    begin
-     if (mnumo<> no_choice) and ((msg[3]= action) or (msg[3]= saction)) then
-     begin
-      msg[4]:= mnumo;
-      ecr3(idem);
-     end
-     else exit;
-    end
-    else
-     if inkey= #68 then
-     begin
-      if (x<> 0) and (y<> 0) then num:= 9999;
-      exit;
-     end;
-  end;
-  if inkey= #59 then
-  begin
-   arret:= true;
-   tmaj3;
-  end
-  else
-  begin
-   if (funct) and (inkey<> #63) then exit;
-   if temps> lim then
-   begin
-    repon(2,141);
-    if num= 9999 then num:= 0;
-   end
-   else
-   begin
-    mnumo:= msg[3];
-    if (msg[3]= action) or (msg[3]= saction) then mnumo:= msg[4];
-    if not anyone then
-    begin
-     if (fouil) or (obpart) then
-     begin
-       if Y_S< 12 then exit;
-      if (msg[4]= sonder) or (msg[4]= soulever) then
-      begin
-       oo:= true;
-       if (msg[4]= soulever) or (obpart) then
-       begin
-        finfouil;
-        caff:= s.mlieu;
-        crep:= 998;
-       end
-       else tsuiv;
-       mennor;
-      end;
-     end;
-    end;
-    repeat
-      if not oo then tsitu;
-      if (ctrm= 0) and (not perdu) and (not solu) then
-      begin
-        taffich;
-        if okdes then
-        begin
-          okdes:= false;
-          dessin(0);
-        end;
-        if (not syn) or (col) then repon(2,crep);
-      end;
-    until (not syn);
-   if ctrm<> 0 then tctrm;
-  end;
- end;
-end;
-
-(* NIVEAU 1 *)
-
-procedure theure;
-begin
- vj:= ord(s.heure);
- vh:= vj mod 48;
- vj:= vj div 48;
- vm:= vh mod 2;
- vh:= vh div 2;
- heu:= vh;
- if vm= 1 then min:= 30 else min:= 0;
-end;
-
-
-procedure tjouer;
-begin
-  antegame;
-  repeat
-    tecran
-  until (arret) or (solu) or (perdu);
-  if solu then tmaj1 else
-     if perdu then tencore;
-end;
-
diff --git a/engines/mortevielle/original/0/PUTPIX.COM b/engines/mortevielle/original/0/PUTPIX.COM
deleted file mode 100644
index 3e41fcd..0000000
Binary files a/engines/mortevielle/original/0/PUTPIX.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/QUES.PAS b/engines/mortevielle/original/0/QUES.PAS
deleted file mode 100644
index aeb5299..0000000
--- a/engines/mortevielle/original/0/QUES.PAS
+++ /dev/null
@@ -1,117 +0,0 @@
-
-overlay function ques:boolean;
-   const ta : array[1..10] of integer
-             = ( 511, 516, 524, 531, 545,
-                 552, 559, 563, 570, 576);
-         OK : array[1..10] of integer
-            = ( 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 );
-
-   var q, func, test : boolean;
-       i,j,k,y,memk : integer;
-       tay , tmax : integer;
-       rep, prem, der : integer;
-       st : phrase;
-       key : char;
-       Coor : mult_rect;
-       Chaines : array[1..14] of str40;
-       compte : integer;
-
-begin
-  test:=False;
-  i:=0;
-  compte:= 0;
-
-  repeat
-    hide_mouse;
-    hirs;
-    show_mouse;
-    i:= i+1;
-    DeLine(ta[i],st,tay);
-    if res=1 then y:=29 else y:=23;
-    box(15,Gd,0,14,630,y,255);
-    Afftex(st,20,15,100,2,0);
-    if i<>10 then
-       begin
-         prem:= ta[i]+1;
-         der:= ta[i+1]-1;
-       end
-     else
-       begin
-         prem:= 503;
-         der:= 510;
-       end;
-    y:=35;
-    tmax:= 0;
-    memk:= 1;
-    for j:= prem to der do
-      begin
-        DeLine(j,st,tay);
-        if (tay>tmax) then tmax:= tay;
-        Afftex(st,100,y,100,1,0);
-        Chaines[memk]:= delig;
-        memk:= memk+1;
-        y:= y+8;
-      end;
-    for j:= 1 to succ(der-prem) do
-      begin
-      with Coor[j] do
-        begin
-          x1:= 45*res;
-          x2:= (tmax*3 + 55)*res;
-          y1:= 27 + j*8;
-          y2:= 34 + j*8;
-          Etat:= True;
-        end;
-        while length(Chaines[j] )<tmax do
-          begin
-            Chaines[j]:= Chaines[j] +' ';
-          end;
-      end;
-    Coor[j+1].Etat:= False;
-    if res=1 then rep:=10 else rep:=6;
-    boite(80, 33, 40+tmax*rep, (der-prem)*8+ 16, 15);
-    rep:= 0;
-    j:= 0;
-    memk:= 0;
-    repeat
-      clic:= false;
-      tesok:=false;
-      mov_mouse(func,key);
-      k:= 1;
-      while Coor[k].Etat and not Dans_rect(Coor[k]) do k:= k+1;
-      if Coor[k].Etat then
-         begin
-           if (memk<>0) and (memk<>k) then
-              begin
-                (*DeLine(T_rec[ta[i]+memk].indis,T_rec[ta[i]+memk].point,st,tay);*)
-                for j:= 1 to tmax do st[j]:= Chaines[memk][j];
-                st[1+tmax]:= '$';
-                Afftex(st,100,27+memk*8,100,1,0);
-              end;
-           if memk<>k then
-              begin
-                (*DeLine(T_rec[pred(prem)+k].indis,T_rec[pred(prem)+k].point,st,tay);*)
-                for j:= 1 to tmax do st[j]:= Chaines[k][j];
-                st[1+tmax]:= '$';
-                Afftex(st,100,27+k*8,100,1,1);
-                memk:= k;
-              end;
-         end
-       else
-         if memk<>0 then
-            begin
-              for j:= 1 to tmax do st[j]:= Chaines[memk][j];
-              st[1+tmax]:= '$';
-              Afftex(st,100,27+memk*8,100,1,0);
-              memk:=0;
-            end;
-    until (memk<>0) and clic;
-    if memk=OK[i] then compte:=compte+1
-                  else begin
-                         if i=5 then i:=i +1;
-                         if (i=7) or (i=8) then i:= 10;
-                       end;
-    if i=10 then q:= {testprot} true;
-  until i=10;
-  ques:= (compte=10) and q;
-end;
diff --git a/engines/mortevielle/original/0/REUS.COM b/engines/mortevielle/original/0/REUS.COM
deleted file mode 100644
index 44678b2..0000000
Binary files a/engines/mortevielle/original/0/REUS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/REUSINT.COM b/engines/mortevielle/original/0/REUSINT.COM
deleted file mode 100644
index 638a7ba..0000000
Binary files a/engines/mortevielle/original/0/REUSINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAUVECR.COM b/engines/mortevielle/original/0/SAUVECR.COM
deleted file mode 100644
index 8e8d6c9..0000000
Binary files a/engines/mortevielle/original/0/SAUVECR.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAV0.MOR b/engines/mortevielle/original/0/SAV0.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/0/SAV0.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAV1.MOR b/engines/mortevielle/original/0/SAV1.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/0/SAV1.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAV2.MOR b/engines/mortevielle/original/0/SAV2.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/0/SAV2.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAV3.MOR b/engines/mortevielle/original/0/SAV3.MOR
deleted file mode 100644
index 9df463e..0000000
Binary files a/engines/mortevielle/original/0/SAV3.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/SAV4.MOR b/engines/mortevielle/original/0/SAV4.MOR
deleted file mode 100644
index 1813d55..0000000
Binary files a/engines/mortevielle/original/0/SAV4.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/0/SONMUS.MOR b/engines/mortevielle/original/0/SONMUS.MOR
deleted file mode 100644
index f9bc2a0..0000000
--- a/engines/mortevielle/original/0/SONMUS.MOR
+++ /dev/null
@@ -1,9 +0,0 @@
-ˆ™ˆˆ˜ˆ‡†w‡fw‡wˆˆˆˆ‰ˆŠˆ«‰»š¸‹§xˆhˆhˆˆˆxˆˆxˆˆ˜ˆˆˆˆxg‡v†h‡xxˆ‰ˆ‰‰™‡˜Šˆ‡‰ˆxw‡hWˆhxx¨˜Š˜™‰š›©«‹©‰ˆx†x‡x‡xˆh‡xˆhˆ˜‰x˜‰ww‡gvx‡x‡šˆ‰™™˜‰˜™‡ˆ˜xfˆvWwwxwˆŠ‡Šˆ©˜ºš«¸›¹ˆˆx‡ˆvywˆˆxˆˆˆxˆˆ˜ˆˆˆvwvvh‡h‡ˆ‰ˆˆ™‰ˆ™‰ˆˆ‰—xwˆuwx‡‡xš‰‰Š¸˜¹›©ºˆ»‡ˆx‡gxvxwˆ‡x‡x‡y‡‰˜Š‡˜xX…h†ˆ‡‰ˆ˜˜š¨zˆ©˜xˆ˜gh†vgg‡xv‰˜x¨‹‰š›«©š¹™˜x˜w†x‡hxˆ‰x˜‡ˆx‰‰˜ˆ˜xvfwggxˆx‡‰ˆ‰ˆŠ˜™ˆ‰—ˆwxgv‡xx‡‰Šˆ‰›‰ª©«¹Šº‰ˆˆˆwxeˆfxwˆˆxˆˆ‡ˆ˜™ˆŠxˆfwv†w˜ˆ‡y¨‰‰ˆ©¨‰ˆˆxwxvgvxvwx˜ˆ™y©šºŠË˜«©©xyˆˆvg‡gx‡˜ˆˆ˜ˆˆy˜‰ˆˆ‡hfhehv‰g‡˜yˆ˜ª‰ˆ©ˆ‡x‰vwˆxvx˜ˆˆš˜Š™»©«¨»˜ˆ˜ˆw‡†fhfwgˆ‰‡‰ˆ‡ˆ™‰ˆ™ˆˆwxgv‡ˆhˆy˜ˆš©˜ˆ©ˆ†hˆ†Vx‡ggh¨hˆš˜‹»š»z»™Š‰˜ˆˆx†eyv‡ˆ‰ˆˆˆ˜y—z˜‰‡yuˆUhW‡gx‡‰‡z¸‰‰™˜xw‰‡gˆˆ…ˆˆˆ†{‰©‹»»¹Šº˜yˆ‰—h‡xef‡hgy˜ˆxˆ‰ˆˆy©‡x™v‡gx†hˆˆ—y¨š§Š¨y…ˆ†xuˆwwgx‡hˆˆšº›¼¹›š¨ˆ‰ˆ©ˆy‡‡fX‡h‡Š‡‰‡Š–z‡‰‡‰wxVwgffˆˆxx™©ˆš˜xˆˆ‡†h¨ˆˆyˆ‡x—k—«Ê»º«˜‰—wšh˜‡wfgfVˆg‰x‰‰‡‰ˆˆˆ‰‰˜ˆˆ‡h†g˜x—xš¨ˆ™‰˜wx†wgx—fˆh‡xX™ˆ««Ë‹»˜šg¨ˆŠˆš‡x…iujwˆ‡‰‰—™i§ˆˆ‰i¦hfˆUxH–†xˆ˜ˆ™‰˜hˆ‡hˆˆ‰ˆ™˜‰g©Y¨›¹¼¸«ºh¨y—‡ˆ‡ˆugvfXxh†Šx¨ˆˆ‰‡ˆy¨y˜‰‡‡h†ˆvyˆˆˆ‰¨‰xy‡fxˆgxˆˆˆxxˆˆ‹¹«»‹¹Šyx¸‡‰ˆ™x‡ˆwggˆg‡y‰™y¦Šwh™‡z†‰vwvgeh˜xˆ‰¨‡xˆxgg™ˆ˜›¨™˜Šˆš˜›É›ª™©—x‰˜hˆwhwfggVg
 xvˆ¨y˜Š‡‰‡ˆºˆª‰¨y†ˆe‡‡ˆ†y˜x†i…wwh‡‡i˜‡‰ˆ‡š™ª¼˜¬¸ˆ¸ˆ—‰˜ˆˆˆyˆ‡Y˜Uxgh‡˜ˆ¨˜‰x—y·x¨ˆgˆgVfhxˆwˆ‡‡X‡whx‰˜‰»‰©{™‰¸¬›¹šËˆ¨z™f™yexexU†ggUh†X—y™ˆª‡y˜ª©›Éˆšˆuwg‡xwx‡vfˆWgvˆg—x›wˆ‹ˆª«º«¨¼˜©g¹‰x¸ywˆ–yw†hvVwgg‰ˆ™˜˜‰y˜ˆšš§ˆ–ˆeXfˆW‰†XVw‡Ui‰ˆx»˜ºŠ¹˜ÈŒ»»™¬¸‰˜k—x‡h†V‡gwVfVgTˆV‡x¹Š¨‰Š‰¸œÊ›È›¨v…h†XvheVWueVˆh‡xª‡˜¨‹¸«¼¼˜¼ˆºh™ˆªx…˜†i‡ˆx…ugeU˜U‰ˆ«x˜ˆ™x©º¹ŠºˆhtivVhˆUeWhVgy‰ˆ›™©Š©›¸¼ª¼¹»¨—š‡—‰˜VˆWvgwX„gfUUfvX˜Š˜š‰º‰«¼»»¼¸št{…Ug‡VeEuUFh†Wˆ™yŠˆ›©«Ì›Ë‹Él–k·‹y¶hˆj…y‡h…WeGeX•X™™ˆyšw˜‹Ê›¹¬§f˜WuVvhdUuWUy–‰y¹©‹‹·Ë|ÊÌȌƫ†x¨ˆx‡…f‡WfˆthUfTVUˆU‹‰ˆªªŠ»›ËËÌ›Êw¸†vWueUUUEFu…Xhˆˆˆ‰¨ª¬ÊÌ»œ¹˜Šg¸Š™z·Xx—wx—wvUfWTU˜Xh‰x¹ˆ‰º©›Ëº»ˆ©—XUxUFUVUEjˆfˆŠ¹w«šºË»Ü¸œ©¨xx‰‰—x˜Vuh–VwwweUf…E†wxh™©™¹¼¬»¬Ü‹»yˆˆ‡F†TUUETVehfˆxˆˆˆ¨­È¬Ük»¶k§Y¹›˜Š¨wˆx¥Y‡‡wVVeUE‡U…kˆŠ˜‹©©œ»¼™»¨™vV‡EUVTfUwgˆˆ‰›‡¼‡½»»Ì™¼…©g˜gªj†h˜Fw‡gg—W•H„XTX‡ex‰«˜ºÌ™¼ÌË»«¨ˆˆxvUTUdEEvUwWŠxh¨{¹½É͈¼µzujµ[¹¹x›…zw‡wyf‰eVguUWfV‰¨z§›ª›šË»›º»wf†WTE…EEh™UŠ©‰™iÉ›¹Í»»ŠÊW†wXµj™–g™ee›dx‰W§vExdF—Uˆ©˜¬ª»¼É¬Ìš»¨ˆˆˆVtEUETFwTX–y‡ˆª›¬Ë¼Ù«¸ˆwgx—k¸‹wŠ•Z†‰fy–zvgwWUvvU˜ˆw›‰©›»»»¹»¸Y§fdUeUEV‰uj‰ºh‹ˆš
 ÉœŲ̂¼¦xUxuY—y¦X‡f†huh¨‡x…VvVG…u‰©‰»¼¹«Ë«Ì‹¼˜ˆˆˆeTUEdD‡EhV˜yw›¨œ¼×ζÄZeV—WŠy¨ˆ†˜gx†X˜‡y˜uxhVugujuš‰º‰»º«º¼˜»†‡weEdFUgf‰gª©y§›™¼Ë¼Û‹¹ˆtVvXfxˆ†e‰gV‰‡gˆ˜z–wfˆeY‡W‹‰««É›¼ªº»‹»ˆˆ‡VdFTEDYD†Y©—h»xÙ­ÌÛ¸­µ‡EztX‰‡y‡w˜eX‰†W»v˜ˆ‡xfW†E‡x‰y»™‹»¹«È«¹w˜uXDVUUX—v[›ˆš{ˆ»Ì¼ÌÚˆˆˆˆ‡TT™UgewWfE¸xg˜¨h¨fŠ…g‰v‡›™«º›»»¨¼š»¸¨†™sITG4xE†U{—‰–‹¹¼ËÌË»¨¹uUvuY…ˆh†wY†…[ˆv«w™˜w‰†Uh–H‡z»§œ›«‡Ë›É‰xštTeUTWV§Uš{¸‰šºœÌ«Ý¨ˆˆˆˆ†…FtHexTWg†Jˆˆ‡z™ˆ‰x©vX™…Šš»º¨¼º‰‰Ìš˜ªˆutEV3ewFWv‹˜ˆŠ¹ŒËÍË˼ˆˆ…gU—U‡g…hUx†Uk§g‰«‡xŠf¨Ty…fŠ›¸jº»¦Œ©ÌŠ›¨geEeDtXˆV˜k¹—›šÊ«ÜÌȈˆˆˆˆˆduGTeFUUhfw‰w˜™™ˆ™Šy¦hi—ˆË‹›Ê»©¸‹«É›ˆˆ†WTD6TXvUw©yv»¨œÛËݘɈˆe†WV…WWtVxex·Wˆ¹j™¨z˜ˆ‡xU‰uxŠ©¸šÉ{—›»«yÈyeUDUEWˆ…h¸Œ¶Œ˜¼ËËͨˆˆˆˆˆˆeUvCuTXTwˆfy‡šˆ™™Šˆ§h‡w‹f»šË{ȼ†‹¼©«¸‰†VDuCTiufX·k¶lº«ÌÌͨ¨ˆˆˆ…VevUUTxTygˆwzºgª™ˆˆ‰ˆVgˆg…‹Éˆ»¹©‡Œ¼·|¸‹”GeDUH˜v—{»ˆš›»»Ì˜ˆˆˆˆˆ†FtEUDUFgVˆX˜›—Š‰¹y¨ˆ‡g‰—ˆ¨¼ª»»‹©k¼ºˆ»ˆˆ…DTSGWh„‹‡ª‡‹‹Ë©Í˘ȈˆuUXdXdUuWVg‹‡‡‹¸ˆ™‹‡yˆ†vvx†i›¸Œ§»—‰ŒÈ‹»‹¸ufTUDZxe™‹œ¥Œº‹Ë¼ËˆˆˆˆˆˆeTFTFeE‡T˜i•z˜Š˜ª˜x¹gˆvˆj¶œº‹»‹·z»{Ùœ¨ˆˆG„4ETwxhj¸[˜©§»Ë܇šˆY¥U…G„HTUwXU©‰‰ˆ©y©˜ˆ˜†xgT˜Xh«Æ
 Œ¹º‰‰«œÇŒÈ‹dkSUdj‡‡iœ˜hÌx‹¼Ê»˜ˆˆˆˆ…WDUEUDuWU‰vˆ‰¨yŠ©‰‰«‡ˆWŠ˜vŒ»¨»Ëª™šÌÇ‹ˆˆˆvUDEDy¦Gš¸{¦Z¹‹‹Ë̘Œ¨wUUWdUVuV…Y˜i©ˆŠ¨™‹·i˜hvVfyu‰ºŒ§œ¸‰ˆ»»Ê‹©¸UWdETj§Xw¬™Š™ºª¼ºÉˆˆˆˆ†uEUEUUeVvwY–h™ˆxºŠ‡›‰˜Vˆ†xh›¹»›Ì¨º¬Ë«¨ˆˆˆFTU5V¨X„«ÈˆxÊZ¹œ¼ºˆ«ˆ…UWDeFeVUˆˆ‡‹†‹¸ˆŠ¸‰ˆ–xVVvˆU‹»·»‹»ˆ©¼Éœ¨»ˆfWTUUy˜Uš˜ª·Šš›¼È›ˆˆˆˆeDETeTVhexW©W™ˆ‰‰‹¸‰¹˜˜VˆˆU‰©ºª¼Ì©»»ÌˆˆˆˆˆfCuEhwYw‰¸{w˜y»›È«›º…wTUTWTXTzˆxªŠ¸z¸z¹h¸i‡gdhXVX‹¹˜º¹¹š¬Êª¼{»eXv5uWˆZuŒ§ªˆ«Š¬º»˜ˆˆˆdeSXTUUVew‰ešv‹—x»©¸{ˆ˜VW‡vWŠÊ«›Ì˨¼Ü¸ˆˆˆˆˆdfDIªF—I»eˆ˜z©»¬ËWÉguEUDgTUWgˆyªª˜‹»ˆ¨ª‡ˆ—htWheeŠª‡»»ª‹›Ü›ªœ¹‡ggtEwZµFkƈˆ»¨»¼¸¨ˆˆˆcwDUEeUGghvy˜ˆ¨Šª‡¬˜©Š†fdxuXy»œ«¼Ê¹œÌ¼˜ˆˆˆˆˆUdFˆ•vh‹uxxx¸œ««Æ[¶UDeDWFfggˆ›ˆ»¸›šÊ‡«—‰—idWTxtHš˜‰«ªºšÌ̋ʼˆ…WuUUˆˆ†h‰ªh‹¸‹œÈ›ˆ‡˜deTDUGUVeI‡ˆˆŒ…ª¹Š»™ššˆuVTyUX‹ºš¼É»»¼Ìº©ˆˆˆˆˆEwF™tXhÇE©g·›º‹ØGÊuEe5WETXVˆˆˆË©»Š»˜Š»‡˜˜xtFgdVi©†»ª›¨›ÌÌ«Êȇ‡wEVW¨XuŠ¸Š…Œ¥¼Š»¨ˆˆ‡t5UCeUE„hˆˆˆˆˆ™»˜»ºŠ¨ŠuwTW‡Fˆ«¸¬È½‰¼¬Ú«˜ˆˆˆˆ†WuX¦Fe›UˆX˜kÈ‹Ë…{¶EdE5„Efˆˆˆˆˆ¼ºªÌxºŠ¸™‰‡uuE–TX¨—‹x»˜kÌ«Ì›¼¹ggvfTy•Xxˆ«…‹§¼˜¬Èˆˆˆ…TEDTFEUVˆˆˆ‰ˆªªšz»™‹©w†UU‡Eh©ª˜Ëȼš¬ÌË»ˆˆˆˆˆˆuwxfdzYuVªHºº««fºeDTTDeEx
 ˆˆˆˆ‹«¹»º©›¸‰¹x……UxeVhŠ—k¨©ª‹Ìˬ»Èˆˆˆ…EuyuXw¨y˜y¸‰¼§«™x§EEEDEDXUxˆˆˆˆŠ¹ªz«¨›š¨ˆvuWeV—‹™¹«¼¹œÌ½¹ˆˆˆˆˆˆˆ…V–Fei…Ze‡‹‰Š»©‡š…DTEFTWˆˆˆˆˆ¼¨Ë¹¨‹Éy‰¨‰…wHt…I†x¤»y»z̼«ÚšÉˆˆ‡fUgH–Vˆ|¸d¬ˆˆÊ˜­„ˆŠT4dUSwHe‡hˆˆ™ˆº™‰ª™š§x©wUW†W¦{ÉŠœÌ»¼ÍɈˆˆˆˆˆˆˆ†XuUF‰x„Wš†ˆŠ»še›TVDUFUxˆˆˆˆ‹¸¼©œ¸Š»w©˜˜W†XuW…X¨h¹˜º«¼»Üz»ˆˆˆ†WeUX…Vz™˜ˆy§¸Zˉ¸Y•UTD…TXuhuwˆ™h»¨ˆœ˜‰¹x˜ˆxX…X‡—™ª¸›Ì̬ËɈˆˆˆˆˆˆˆvFveHh‡wH…‰‡{ÅËX§‡TDdxE‡xˆˆˆº™»Ë©š»ˆŠ‡‡xvx…fxXvŠ–\¨¼»»¼Ì¸™˜ˆˆ†xdfU˜Tˆ‰©u›Wšˆª«Å\…UTUSxdxVˆWˆˆšŠx»›‡›·X‡ªx‡X¹w‹˜‹§»¼»ÌˆˆˆˆˆˆˆˆˆUVfUfW·Hf†v‹h»©‡š…ET…HVˆˆš‡›‰««›¹ªš‡ÉUi‡x‡fxˆW™J†ˆ«Ë»»Ì»¹y—ˆ‡XŠUUvhX…‹ˆx…˜h‰¹¨¼WµHTGsKVg—Wˆvˆ›˜‰›š˜y¨g‰zš†Š†»—i¨»{̼˺ˆˆˆˆˆˆˆˆˆhTFfEfˆX…„{e‹µµ‡¨GudY‡‡Š©™Šˆ»ªˆª¨ˆ‰ˆwwY©†gzgˆVˆXº©ÌšÌ›Ëˆ©f¨‡ˆh†Vuieˆw‰ˆu™VŠ˜™«…›ehEFV…Y•xˆXŠ™‡™™š‡˜x˜wŠº…‹ª‹…›˜œ¸ÌËˈˆˆˆˆˆˆˆˆˆeHTuEuW†gW–H™¹{Èw¨V†uX—™Š™¸ˆ˜›¹Š˜Œ†x‡yeˆ©xu¨wˆUx›…¼ÌÊ«Ê›¹wˆz–i§fF–IˆUx‰ˆT¸E™xÆŒ–h©UgE—H—X†wh‰‰™§‹—‰˜x†š‰¹ˆ¹Š™y¹kºŒÚ¼¸ˆˆˆˆˆˆˆˆˆˆFTEvDWX˜E‰Dºe¬§Êj«…™Ez¦{«ˆ™˜¨Š‰¨{•yw†uŠe›†‰u‰…wˆ‹‹ÊË«‰»—™X¸‰—zU‡EY‡ee¼D¶EˆZ…ºœ•iÈXTvy†v†xuhˆzxŠ›‡˜–x§Y¸‹µËˆ¬—Š»|ȼʈˆˆˆˆˆˆˆˆ
 ˆˆ…T5FTTXˆVUˆXxˆ»¬†¼¨‰V¸ˆ©Š¹y¨x¸h‰˜‡x·GˆU‹v˜ˆˆgŠ‡xŠ›Ê¼Ë©ËX«…XŠ¸ˆŠeweGfvVi¶VWf‡‰ˆ›ËGÌuxU˜hˆeˆ†X‰ˆhŠ–y–iˆwyº‰¹›šŠª§«¸Í¸»ˆˆˆˆˆˆˆˆˆˆˆeDCFuDeˆ‡Uxxˆˆ¨¼¨ŒØY©yº™‰ºˆv©wvz‡gˆV‡Xwy†‰˜xvš†[§¼»»¼Øxz¨ˆe¼‹˜†˜wTTˆTYUšeUh†h‰‹»‡¼–ˆu‰†ˆjfh—g†—j‡i§hW¨¨ˆŒªª‹›™¸ˆÌªË‹¨ˆˆˆˆˆˆˆˆˆ†eUS6eD„Xˆexˆˆˆˆ‰Ë‰Ì¹›‰«¨Š˜Šˆx‡wˆ‡w‡exV˜U¹h¹‡x‡‰g»›ÊŒÊ›—‰x‰†Œ¨›†™vUeGeUW‰evfxfŠ¨œ˜»¨©ušw‡xˆW§hvˆ˜g‰e˜Xˆ‰¨‹»©»ˆª{˜›¼‹Éšˆˆˆyˆˆx˜ˆegUDDF„FvˆuXˆˆˆˆ‹Ë¹¼»¸{¹›˜‰™‡whv‡–X‡ehf‡y†‰©ˆhˆ†™Š›¹Ì‰¼–g›w¸‹¹‹¨‡ˆeUUwUVgxUhU‡g›ŠÉ‰›ª–Z˜w…™hˆVz†ˆ†‰uˆx‰ˆ¨«»ª¹Š«k˜›©¼—Ȉˆh™ˆh‡š…WeUDD†UUXˆ…Wxˆˆˆˆ¼¸Ê¹Š«ª˜‰™ˆvx‡xwv‡W†xxf‰ˆ‰‰vx¸w›¸»ª«˜™WŠ¸ˆŠ«©šgˆtTxVuUyvuHhuY™¼¸©‹ºvˆˆ‡ˆˆ‰w†‰vˆ‡gXw—‰ˆš©»š¹™™ª˜™ª«ˆºˆxvz¶xˆ‹†fWeEFV…UX¨XUW‡ˆˆšÌ™Ì»ºi»ˆ˜‰¹gˆh—V‰W†V‰†Wh—ˆˆˆ©ˆˆ«—›¹¹‰©‰vš™˜Šº‹¸wˆuUV†Ue‡xVUuXg™«‹‰É‹ˆfˆzgªˆˆ‡‰vx†hˆx™†º{ª™»‰©Šºxºz¹ˆy˜hfŠ—wx˜xvWvVUWvVgh†fwWˆˆ››ËœË«¹ˆ©ˆŠ˜˜‡xˆgxuvwgxgwxˆ™†—Š˜š—«™¨‰ª†ˆx›¸ˆ«™¸˜h‡UuX…U‡if…eY„z¨{ÇŠ»ˆ‡x˜ˆ‰›uŠwh‡gx‡xy¸‰š˜º™¹y©Š©Š©™ˆ‰˜‡Vˆ˜x…Š‡wˆewUhfuXx†ggvgŠ™«º¬»»ˆ©ˆ˜Š¨yˆxg‡V†hvwhgˆ‡‰˜¨ˆšˆºˆœˆ¨™Š‡ˆ‰Š˜‰™‹˜ˆ‡xefwgew‡wuXehx‰˜©ª›˜‰‡‰†©ˆˆˆ‡v‡ˆg
 ˆ‰‰‰‹š™™«‰¨™™¹‹‡ºvˆx–Xvzvwˆxˆv‡fvVˆVxW˜X†h¥z©›¼¸¬¸¹ˆ‰ˆ©x™‡ˆf†ggVwwXxˆ–˜šˆ¨™ª›‡º‰©x˜‰w‰‰Š–Š˜™‡x†vV†‡vgˆ†hewfjˆš¹Šº¸†˜ˆˆˆ‰‰h—X‡hˆxx§ˆ›˜™™šš¨‰»ˆº‰šg˜f¨Fˆ†wwx˜†g‰eggxwfx©…X©eª‰šË¨œÈ™‡‰‡ŠwŠˆwvweguX†g‰ˆŠˆ©™™©ª›‰ºy«eºwˆˆˆ™xˆy˜wx‡Vvwh…hx¨ehuw…š‰º‰¼ˆ¨w˜yˆˆˆ—gˆvxxx‰ˆ‰©›ˆšš‰š™ª¸Š¹˜xxXvfw‡wfˆx‡xv‡Vgw‡wy‰™vyˆ‰˜«»¹»»™–x¨x‡x˜f‡fVgeX†f˜™‰Š‰ªŠªš¹©ª˜™‰h‰‡‰vš‡xxˆ§UˆW†Wwˆ…y‰‡Wgxˆw‹ºŠ›¹Š†ˆˆ˜xˆˆh††wˆv‰˜y©™˜™·™›‰«©‹©ˆ‡ˆfwwWgx…x‡‰†gxwVwˆx†Š©–ˆx™ˆ«‹Ê™»™—w‰ˆ‡xˆgfwUfvg†h‰ˆ™‰ªŠª›©ºš¹¨Š˜hxˆ‡wˆˆxhˆˆex…fvhˆ†xŠ—vgw‡h©‹Ê{ÊŠ‡xˆ‰wˆ˜gˆvhxwˆ‰x™¨Š‰™‰ªª‰Ê™©˜x‡VwgvW†‡gxˆ†wxwvwh˜ˆˆ«ˆˆ‰ˆ‰š©¬¸¹ªˆvˆ‡x‡‡‡Wfegewwvˆ˜š‰ª‹ªºšº›¨ª˜ˆ–ˆˆxvxx‡W—x…hwggwˆ‡x‰ˆ‡ghxw››ª«º™—w˜ˆg‰ˆwhˆfˆhˆ‡ˆ‰™˜‹‰šš»Š¹ª‰˜wˆUgvvWh‡†xwˆ‡Xˆfxhš‡‰ºˆ©xŠˆˆº‹º™«—ˆwx‡gˆwVheVuWˆvy™©¨›©‹»™»›¨ºˆ™x‡x†xfx†gxw†hwxgwyˆg‰˜x†xˆx‰º«©©ºwx‡‰v‰ˆ‡‡xvx†x†ˆy‰¸‰«Š™»šªš¨˜w‡Vf†wfwˆg‡wx…wˆgxx‰ˆš‰ºˆˆ˜˜i«˜Ëˆ›¨wxˆ†hˆwffefuxv‡‡ª‰©ššš›ºšº«©ˆ‰ˆvx†‡V‡wvvx‡‡XˆXwxˆxh™ˆ‡xˆ—‰ºªºš›ˆ‡iˆwx™xw‡hvv‡ˆX‰™˜š™¨›ª©ª‹¨˜xggexwwg‡xf‡wx…ˆˆgˆ™‰ˆ™ªšw‰˜‡‹¸‹¹›š˜uz†fxvwVvfvW‡‡h™šš˜ª¨›«ª¹«¹™˜i‡WyuˆVx†gwˆxvˆ‡Ww
 ‡ˆvˆš–x˜‰ˆ›š›¸Š©—w‰ˆw™xx‡gwgg‡xi¨™š™š™ªšª‰ªˆ‡whfwxwg†wwgwˆxhˆˆiˆˆ˜ˆ™©˜ˆ‰˜z™©«šŠ¸ˆvx‡X†whˆˆ¨™‰‰ˆ‡‡xw†‡ˆˆ†G¾ü¥,Úˆ…"|í¸jˆˆˆ‚1¼ìé†tʘ0DÞû1­íä"O̍¾í´sXˆˆ‹ŸÝE#TkìÅÌH¿í—F&•ˆÜû˜ƒ­¾íÈCHT½Ý•U%l¼‡68¦SHÚºˆ‡¸Æq—©«í¹‰ˆ'nžˆFLuVìʃCF¼½˜ˆƒCeEy¬¯—'%hr'ˆîÆR7Xœ§U¹¥Wˆˆ¹ì´T8XˆšÈëµthX«”T˜üÅ‚hÙÅR†»¸{ŽÍ¸4A‚Xèܝš76‰ˆ™¸É„bxÚÚ†‡w˜…tšç먊‡F#g‹ÚëË”U8Iœ›ˆxªˆtˆÙ‚‚DÈܪŒÜE#Tvˆj«‡WUˆˆWYͨS6z¼‡‡˜„bgˆËÍ»u6'ˆˆË™½½„E8Œ—uY¼ÞƒDHõC„íý2mÍFè3n¨ý„¼¨v,ªÉeÌ«"˜ü¢ÙØÁp­h6ÊÕ&›AHˆˆÍ%£6ŠíW?Îd%+î¦S¹ý°“ìì‡dxÉ5»ƒÅUxËëÒP®Ús1‰¼8<ͽÛ$"„ˆˆÜ¿¾x%"O¿FG¿­¨ÍÉ…4y똈ˆˆˆˆˆ8‹Èˆˆˆˆ‡R6Ç£b¨Ú×qr»W6ˆˆˆ¸vˆˆˆˆˆˆˆ¸XˆˆˆˆÈ‰»W8‰®ì¦3Œ›X½ß¹ˆ6$T‰é춄h8%ŒŒ©˜h‰‰X52„™¨L¾ÍÈU3erxëÌ­»H4Tì¨jŒ¼È†XŒe7H|½Éˆˆ…uF5J»È‰ˆsFˆ†xyFG[‹ª¨gzb%jÝœÌççQRX¨Dx®ëØssv¨ˆ—ŠÊÖCg¬Ú˜duˆˆ˜‹œ»Ù´rThF{ž¼‡3G‡¨ÊÌ·T'8xœÈÉ…uƒWºË¥dH˨†g˜¸„zºÉ”uŒ‰X™‹ËˆDvˆ¹‡T‹™¨»½ˆE8ˆƒ„¨êº…‡¨‡yˆˆ˜‡…˜¨ÛÄsw¹gxÊ¦ZŽz56x…DHÜ»‹ÉgCc›©‰­‡hXW„c‰ËÈ…©¸…[œÊÇ4T„™ÌÌŒ¨¸…Twˆxª•œ¨ˆ©ˆu¸TWˆ¨×„y¬¸uC{™w8›š‰h†…uh¹—‰ˆWDsyÛ§Tw‹Ê5IÊXk­‹hhVˆ˜¸Š«˜wWU|¼¸©š†wWZ¼„ˆ¨uttGª­œw‡†„tF˜´„‡ºØƒˆÌÉUeœ©ˆÌ‹˜GZ¨”‹ÚË´ŠÉÅ4{«Ø‡z‡‡ˆe
 UŒº·T‰˜V(}˜8Wˆvh¸¨„e˜UUŒÉ˜ˆ‹‰ˆ‰¼‡T&7Š™©ÉÍ•S8ËƃXȹ…ˆ©È2u‰ÉÉ—‰˜xv„™º¨‡Š™¨ui›ˆxXœhVUŠˆhœ¾‰UG˜„„w«¼ˆˆ˜h©„hx«ªˆ˜wW„E™Š­‹xweu†ˆÌÊ„eh¥„ŒÛÈTV‹˜X­›©˜ejˆˆ‰tuˆ˜™¬­¹75uˆ˜¸Ë”CWWe‹Ë˜T„ˆxI‰„T©É©˜xˆtgœˆ‡‹Œ¼˜j¨…xXj«ÉÙ¼›‡XHŠŠˆXšŒ¨ˆˆˆˆˆˆˆˆˆ‡VUjˆwhŠ„UH»©„4ˆ•„‡xˆµ…w˜¹ˆt7ˆˆˆˆ‰È…vˆˆˆœš©º¦ƒExÛ¹ŒËÉ•yš¸vi‹«ÈÈu‹xWˆˆ‰‡X¨T8hŠˆH‰¹†eFi»—g8w—…w¹©…vˆ»¨‰wX««…ˆ¸—ˆ‰¸»šŒË‡w‰‡XY›‰ª¸V†ˆ¹˜W‹VHl‹hH™ˆ‡w¸ˆˆ‹w7{ˆVH\­†F™¸˜‡GWx†™hx…uWy‰†…x˜ˆ…‰¨¦tˆhXŒª†HH‹ˆvÉØ„u™É–‰«É§u‡gˆÊ–ˆ™xuŠÌëÄdug˜ˆŒ­È†VŒŠXHx‰‡i¬©wxFTx»Ø†ˆuW59šˆ˜‰«…EX†‰ˆxhj‹ŠhXˆ‰ˆ¨˜ŠŠ¸¸gŒªHx¬œuh¼—v¸ÈÊ„fW†wŒ¨˜†ˆvXH˜†‰˜Èu…ˆ‡EhŠÊ˜eˆ‡H†z™¨¸hŠ˜xx{©FX‰ˆ˜x¼™š¨˜„u™¨©ˆ‡¨¨™…t˜·{œ‰·Ce‰xX–‡xhw†Šº§Ux™xx…†vhX™›ËÈTj›xfZ»ˆx‰Š¨˜¥uœ¨˜‡Š«xGˆ†˜hk«›¨EH‡gXX|ˆgXˆ††GJ¨•ˆÈÈ“„x¸ˆˆ«ˆVZ‹—ˆ‹˜†©Ëʃu¹ÆgŠÊÙµuˆˆ˜‡yºÇ…YŒ¨gDlŒ˜hxˆˆF›»‡©hxƒtÉ·u†x˜‡Œ‹whT‡‰ˆ»»…ˆG6…™É§wŒ¨hgˆ†WX‹˜‰˜ÈxˆehV{œ¹˜—t„GŠÌ˜†¸˜†‡x¨¥eŠ¨Ê»ƒD¸¤SfÛø£H½¹EB›Ì¸[½‡ˆFCy¬ÊÈXŒ¹W$}§7lœªW9¬¥eH«®z6Gš„VˆÊ»„U¹™‹ŠVHº„U¨ì¸…EiÈ…›ØæSceÈ»½‹UYÆrgÚ×Rƒ»è…T™¨VDhšˆˆš‹™h5wŠºÈŠˆuh¹¹…W¸ÈxœÛ…3u‰¨¼Î›Dj†ˆÈÜédWˆseËèƒS†¹Éu†ˆ˜UYË‡SStxÛȇ›¸TT™¹¨Dz¬ØVHœ‰G
 4‹‹ˆºÌ©d6GhŽº˜»ƒ…©º¨ˆš¸UXŒË¹ˆˆx¨vZ»¸‡‡…UG‰Œ¬Ø¸e„Uh¨˜†ºÈ¥f‹x4E|»¸z®…D8E‰ˆ¸é¸…fhº……ˆÈ•d©È¶x‹ˆHF‰ŠˆÉȃTHˆ›–¨ÚÈddH¸…x›Èɤtx¨ˆ‡Š¹ˆf|«ˆgttxx½‹¨UE…g˜ˆˆ†F™Ü‰t7h•uxØØ–ˆˆWSs—ÉÌÛ•gXUj›™¸‡††¹Ú»†gXTZËX«–™89˜•hÉÙˆux˜tu«ÉUYŒ¹WW……HI½ˆ›¸¶tˆx8{»ˆ¹»¼“eg¹ˆ‡¹¸˜‡xɇxy†H˜›œˆˆ‡‚TW‰¼œºˆ•u…hX…„v‰˜‹ŒˆWU……˜Ê»…eˆ·„w™˜˜Œ½¸Fg…v¸Ë«—ˆ¨‡x‰ˆYºˆ—ˆ§uf©Ø‡uxˆVYŽºgG‹ŠV&¼‡Xª»„D¸É—wwwwŒ¼‡Vk†E‰Ì·uFxuu˜¹¸xˆ™ˆ‰•†h¹¤sv©Èt|Û¸Tt‹¹ˆŒ˜†ˆh…u‰ˆ‡‰¬ÙT3Œ«WI­šV6{›uh˨…whŠ¨ˆ¸¸x‡eX»¸š˜Xhˆ‹Øˆy†dHœÍ™†ˆ¨„eˆÉtu‰¸È¦‡ggU…‰È¸†ux¸v‰‰˜wD‰šˆi«šwGG‰˜¹É‡†‰xY›‹©xg…‡˜È™ˆª¹EX¹XI˜EiË…dXš´…©È¸v†xxhŠš¨‡d‡˜¸egšÈwXŒ¹GyŒšEH™˜‰¹É·u‰¸Ueˆ¹¸‹«™gWuˆ‰‡«™‹¸GEˆ‡xY»…gh‰˜‰@Ðÿòû ð?üíÅþ ÿAþØ0¿Ð3#‰ßOü€óà_ôV‰ú€Óýÿ…ÿ2øû êÅ	ãä'Þþÿ *çWD[ÍdZÁ3Žü_ý=å‚ÆÝ\²\3ßòÛ9ÉSÏÚ3IG›#ÏÓ&¼ÛV•$lúM·kµ3HE¸¼ˆ—ºlÈtX‹ÌEÌ4›sˆD»§>ÄÝDÌ£W¥&ËÛÔ5TÌU|u|ÎT§<Ä:”–}„¾3º…—ˆ©H܈…{·DŠD™œØVkd·UTÍË„d7ȶvDÍËÉ”8·»wƒjiÛgDwˆË·G›¼·eThËV–IÌ™‡Uj‰»Gš‹·•H„k¹H™‹¶ŠWˆzªˆZ¨ˆx‡VW›ˆxŠ‰¹©eH»Z¦i†¹ith˜»‡˜»wŠe•h·—y‰‡x™f‰™‰ˆ¸x¶xV‡whwx‡wh›Íˆˆ„Xšd#6ˆ{£$ˆ‰›Ý¬îÖ1îS"ˆÈÝÝÛ"hÿë¹sB16íÎè4k¨B#Xˆ»ßüSJŠïÄ8
 ÎÛ»R‹¶YÈC†5Ìs6̆…3UzvXÍî—eSFÎÝÙˆˆˆƒWwvfxˆ†Bxˆˆ‰xÍìUiˈh—¬Ì§U¼ÉD‡UX¬¸C6™«·34hˆˆÜˆœËT|Ì̻Ȉˆ‡34‹ÍÜ–3C$H¬Êª™…CEi¼ÚŠºvUh¼»ÍݘUuCE‹Üܨs33Dk©«¸C5ˆˆ‰¬ÞܘUUy¼»É§C#5{ÎÝÊuFTEEYÍÜͨC37ŒÝÝÉSDUˆ¬Ìܨ„3#4jÍݶD#F›Í˺—UgxˆŠ¼ËÊx™¼»vewuDCFxª©‰†UW†gˆš»¼ª—hŠ›Ìº©wfTEy¨˜vy»¥DEx™ªˆŠÌº‰‰‡x™™««†UxxwfwˆfTVŠ¨‰»—UUX‹»¨‰¼˜f‰š¼Ë¹uVfx»Ë¨d3EUX»Ë¨wfuUX›»¨˜wˆ˜š©‰ˆugx›¼¼©uTEE™ª»¨hŠ©™‰™…TVŠª¼Ê—evegˆ‡w¬Ì¶C3gš»»ª‡UUˆ«Ë»˜xˆˆª˜vˆŠ»©vhš˜eUTD5j¼Ì§UEF‰½Í—Wšª…TW›Ì¨ˆ‰š‡Uhª™†gUEh»Ë™–Ugyªªˆ‡‰«‡vx›Ì¸uTUˆ˜™©š™©†DDG›»»‡eVx›º¹‡x™‰‰»Ê—UXˆ‡w‰»¨uDUUgŠ¼»ºxvUVz«¹‡x˜‡UX«»¹vVwšª™ˆˆwgxˆx‰™˜x†ˆˆ‹ª˜uDDU‡ŒÞþ¨ˆˆ‡sG¬R=ËÛ¿Ãì"X‹íî 5ÿÙƒ>ß²|‘ˆŒÿðŽþ(Í4RŽÄ(Çc$iUßùT"¿íʈƒwdV‰‚xˆÕÎÓJÉ‹Ýt“EE½³%‹Å"WˆŽë½³LÜ͹ˆ…4¬Ùƒ"%½»˜B$ŠÛ¼¸V¼¼îµt#[íÚB"6»ÝS#[©Þì•V¼Ì§"îÉVD4\Ýëc#|ÞÉ2GœÝës"$î“"JÞË…Dh‰½Ì¨›ÌTG…DGzˆ‡DUX›Íˆh¼Ìº‡TG‡vl¶3GŠ·{Ëš¨™»¼µDx˜x˜DEˆŒÈUV¬¹zÉg‹ÌÛtDiͦ2$D½Ë˜‡FŠÉ˜gxx˜˜Vy¼Ì…DE«¼¦z»š˜SG›ÍºTTHˆyÝÔ"EŠ¼Ëux›Ë‡Xy¹ˆ›Ì¦V«…TC5¼ÆC4‹ÞÙz¸S6½Éx«‡jË…D3|ÌÉTV«¹‰»¸UzÌ…DXˆš›ªt3H½Ë…V‰º—Š˜‰»…H©x‹¸CDG‹ÜÛxdV›¨WˆTkÌ·UXªˆˆxx©™«†eg›«–TW›ÌˉuTH¬Ì¥CHˆxˆˆfxšÍÈDEz
 ¹«Ì©«…3E‰Ë¸hwgŠš©ˆdDW«º˜‹º˜š…Dx›»ˆvfŠ˜‡wuXÌÇDfx¼Ì–fŠº˜eFVy¹‡g»—h‰˜Uz¼¸vh«¹ˆwveh‹™ˆwŠ¨dE{»—h¼·UzºeV‰™ˆˆuW¼ºvˆˆ‰»švUW›¸wˆ™w‡†Wˆ˜šˆx›©ˆUi›»¨exxˆ˜xˆueV‹»º‡W†Vh©©˜ˆ¬¹fwx‡‰™ˆ†wˆ‰‡eg‹Ë¨fgx‹»˜w‰˜‰eEy»º—Vx˜ˆº¹…Fˆ™ˆˆ™š¨eWˆˆx˜‰˜z»©uVˆvfŠª˜fhŠš¨™ˆ‡Wx˜ˆˆvfŠªª˜†VyºŒ]òOþ=ÈbøÓ/ç^òà®â½<àÿÑZô`±übç.³ýBùìˆ+Ùˆ„ÃÓ2WR,Jñ_RãÃ_¼"Þ’ñÎ6ì-0Ï–!³ëCò|·ú-Íø‚^¸ˆƒÐ’Q§Þ@Én’ÜTÄî1–ýÅÞ+…ÊZã–ÞS|Æ<ü¯Ã›ÏÙC͈ˆK#¼C2›ë"¸Í4ÙH¬å2]ý‚;ã»x»L·b&êB&„]EÜÞ†‰ï–;»˜ˆ„(Ö5Ô$ˆÈ;µM­•3®ûB]Y¼KÔl¶#;×2F»uºLÜ΄ü…x¹ˆˆUK”R&Í’7ŠµLdÌ»…5ßÕ3ǨÖmT½c2\µ#ˆºXµ½ËíEÎ܈jˆˆ†„‰U"KÌBX‹”ˆ[Ù‹’ký¤7{gÉGËB3œ“5z¸Y˜Í½åLìÙ‡˜ˆˆ……‡S#›©3x›ev½¦»4ŽÝSe˸œt|¤35«cFŒ–X¼ËÞ´½­ÊjˆˆˆW”ˆB)‰¦Dy¨UkÌ[´GÝËE<ˈÇG»T$H¹CX»…Z̽ëwØݵšˆˆuhf´2WxµFŠ—E¼·«eM¼ºSœÆ}t[´D5X˜4‹¹U{ÛÝË›ŒÝg¸ˆ…wuŠS3gˆ¥I¨„ZËz§e»Êš7ÌXÉE¬DEDYvF«•W‹Ýë»ÄÍÕ›˜ˆv‡EÆC4Yv§j˜E«¸ªwl[ª”|·‹µW¸CeDˆfX¹e–ŒÞÙÌWÝxʈˆI„Y´D4hv‹™uIº‹§ˆ¸Y¹I¬wÈx†—4eDˆf‰§YµÝÌԫ؛Ȉ…ˆEx”SFXeŒ¸EŠ˜»xœW[¤lÇ|h‹…e4uE—X™‡Š´ÍËíJË›·»††…Hh•CUwV¬¥W‰{¸ŠÈT‹H¼ˆ¹Y»dUCuG‡j˜ˆª¦Ì½ÙœÅÌXØfˆT‡h´Cueh»…ˆwºˆ¼¦F…Š¹‹•«¸TU4eX†‹x™©È›ÝlÌ{Ç\Ç[eWgŠt5efx¹‡…{¨‹ÊutY¨
 ©¸ˆ»†dU4fY‡‰Š¨œÅÈ½È…†—U‡gªT6Uwy‹‡Vª˜¬·Xs‹‡»ˆ|·W•5C…y‡˜ªˆÍ”¼«Í‰ÊxÊx”hv‰¨DEGw‰‹…X©™Ë…ˆ7™[Ȉ»…y„DCg¨x‹¸ŒË…¹Ì»»¸º¨‰G‡x™¥DDhwˆÇU‰Š«©itkUœ˜¸ÇU©e5C[ˆi«¨¼«¥kÚœ»«¸Š†J‡yªeSEvˆ‹¥Wˆ›¸˜—E¹FÊ™º†h—eDBº†šº‹º¼“œÈÛ›¼†©t™‡Š·UCHwx»Uwy¼†‹„Z–Y‹¬ˆvx‡fS4šx›©»šËE¼ŒÊ»ËX§w˜ˆ›…U4hhzÆgvŠÈgºE¨x•›ÊwhxvgSCšˆª«¸¬¸U©Í‹Ì¸hjyˆ˜¸UT7vˆ¼]ðÑòp"ÓñùOR?²/-Ðàì‘}ƒñôùÿ˜ˆˆˆ.…Ý/ÂÓ÷übêÃ×+
-ä	}.L­âÝüôPÐÌ#{ò7Ý*^¿æ
廤ɐN@$Öš=Ï9ßã]¸XÃBBZÒÕHè"îA}l½ŒÊê{˜äíõL숈ˆˆ[Cûm9„Ý„-ú4µÚº}rȈˆËÒŸì›ø…4Ä1Nä;ÈHNہ¿ä*Š†¥È!LRHĘ½ÎhîÚkˆ„zCË2Y£ˆ‰¼7þcŒ¬¨Nã$º"­˜‰Üø^¨ˆˆˆˆUR)–4[E]ÉÒ×3Û{¤¸17´ˆˆˆŠÏ¥ìû=˜ˆˆˆ2‰³GºFËm#ÝÄ;·ØH”"[Cˆ—‹Üí]®µØ…4vƒL„«„Œ×Ô-î³Ý]sºC4«4¬BÎڹ뉈†U†"9›W—:ËYVÌ«(ÕË4ƒUGˆˆˆˆýܾ˜ˆˆˆˆˆDE7Jtk™¨iª£¬ZUœ5SFU›WˆÞÌ´ì½¥4ÄLD3¨|†[Ú˶…Ë[ÕÜ•T3‡G¨j=îËŒ¨»ÕKEhCDS¼¤J{ªºceË}‡µ„H%¨ººµžÞËÙˆˆˆ†e‡3WDÊEˆµ|¤[[ÈŬdBEGxˆ‰¸ØÍ­nJ×»WEÅ6wi§¸Œ¼ÛSUYzkÉCBTUiW‹ÈέØ×nXdWyCDw‰¤5Ǽ§t½¹h̨e3FǻɮWÙœ|§È‡Ge—2Dw‹¥LÈÉj6µËˆ¸YD$Wˆˆˆ»^Í軍ɵ†k¶UHz‰Dfl¹£H[¨|D…4'ˆ‰Élةܼºº˜Hi”34fšØk«¨«X¶ËŒÌj„3*„gˆÜÄ]¼»©Zt‡ŠµSFV¼Ux¼ˆ”k;»…C©TEˆˆË\͵ìÌ̸ˆˆˆˆˆ2F¨´UzÅh6¤‰¼™‰…D3·z¼©Ì;¼Ú˜7¸™¬Çd7H›‰¼‹ÄŠ[YÉUTVb4†‹¹k¶KͬۨˆŠ»e3VˆÄekÄE&ÆÈ­Æ‹•GT[¹¼Ü»µ\Ú؈X‰g¥DD7‡Vg‹ˆ¹—[ªœvgf…C8z¸GˆÄ¾Í̸»ˆ½§ef­T˜x—uHu¥X¦†UUECˆˆÌÙªGÝܹFÚ–fUU3d8ÊÊy˜»j‰Ü›‡ª‰U4h»Ši·E­¼¦L˜U§Te»†gœ¦—Uf»ˆfxTCGˆˆˆ‹Ë¼›Lý˘ȈˆˆˆdUhvdHgdx·—……‹¨fxUÉ«vŠÄMÚÆdE‡‹¼hX™˜ºŠÈy[ˬfueeVY•#™¸ˆªƒÍ»›«»yËœ4hFh•XWSEY˜Zª‹©‡œÇ;˛̺jÌ©•Hº™©C5Xfxv•Wf˺ˆ»„‰…E—t:¥WH‰x̽ռ¼Í×TX»¨•j–S6©¸f…ThUw¨³HzȼÊ\
 ÛÉV¹ˆÉUSDTeV§ˆK‰Îyo*øn{¨ˆÎ/A´âõâþý·˜ñèQIááãóLûâ°â¶GˆˆˆˆÅîö>숈ˆˆˆ0þ0_BÁåälø)äCÂÓ"¾ˆˆˆîrOùÜLbó"ê3ï–[Èâ~¹[ˆK4Â|'‹Xˆž²ßâOÝ=[¹9Ê4»I*{r\Ã,ejÄxˆˆˆŽK~¢ÏôÍlyˆˆ:É-¹2="½Ò.Gw-sä6¸›Ì"~dݼv=‡=æ~æKŒ¹=[†¨Ds7R(“{»ŒÛÌ$÷3ÞɈ\qNä¨Ù+»Ê'mBŠDR7xˆˆˆÎÈí,Û¹´B¥\TŽÓ¼Þˆ…¸ˆˆCsE!XˆˆÇÛŒå(Ì´¼S2hˆŒÉÍFîí¨ˆˆˆˆˆ‚5!9vˆ·ì½äjÍWÜDs“\ä|J×ìØNËE¥C3¥#x¦\ÖÎÜ;ÍyÅK„µ1DSi̾ÝÕ͸ˆˆˆd23§2ÛzˆÌC=×<Ü›U¸3Ü2HˆÞÝͼº˜ˆˆyR"w[Æz|؃L{œ»¼·U4Ò8E4¨¹MªºÍ„jÉT:Ó\¬Ë»[T{WXÜ›¼µH‘uZlu”ŒIËÛy©Se‹dÎcKØf#EVkÛ¼»ÆÎB—µŒŒ…†4ˆ¸f»æS\šÍ‰­„ÆEUdK˸X‡Í$l¤¸‰Ec3Wˆˆˆˆ¹Û˾©Ü›µF4†|—»—[É"Î{º×†ET4c3hˆˆ¼èÎt݈TSE4žË¨§œ¸3ËŽ­Ç—§3Ub5DhˆˆÌîm숨tFX·XºhȵËŝ¹T…6F„CxˆˆˆˆÌ¾ÜÌÛU5Z{Ý„Lȳ%ºˆÜ†kÈHTCC3Gˆˆˆˆ½Ì«†{EM¼É™ÜV³UÌ|ƈ›•GydDDˆ5³z—ºÌ͵¼H­¶‹wÉ}D2ǽ›cEuEkX…;…MÇxSj¸½«Ì4ÞÉݘ¨ˆ96ÇÉzx¶”df4S\•Œˆ¨’8Gˆˆˆˆ¾¸ì½Ûe['œÈ¨I§Æ„„TTªF̺\“—Ct7™¤ìÊÙÍØx¥%kxÄWDWYÕuE´kÊÙ¾Bˆ{ƒEGUݹììÅ{…UØhTŒU\8„UY…»”»¸D˜uDDXˆˆ˜ÝÌØÚJ¥Ç«…uv¨Y…F¬y¸‹Œ”tWˆ—T‹¥Fd»Í¸‡G‰µVf2fé–xµlÛ‹Žvt8hšgÌ”›´¨˜Z†»X¼¨ew5©—eZ¤Ì–¹ÌgTdDD8½¼Ë¸ª¤d8Ì´‹Š¬Ä)¼ld]WÌŠ‰ÅËtcx„G½L™Ù›¨T$ˆD§eEt{Êl—»[ÊzŒÆØg„¸d‹ÜIiÛ¼¨TX–"d‡Xc‹Ü©´¸œ¼tkyØD
 SwTšÛ¬ºµ{ËFœÇC3CX¦¹ÈjÛظª‡ÊFÇf„Hx¼Ø{ÈËXtU­¦R3BFˆˆˆˆˆÌÌÇxœÊÇD‡jy½åÉˆy…„Œ—BETEED‡‹ØË«¶É‹xÈ4d${ÝìÏ"ðˆáüRà㥈‹_óèæ/#ð,~&òßN¹ˆˆ1Å´½òŒ£/"Ó8‹YóoSú…µa‹Mßœû˜ˆˆˆˆ9Â2¹/Rä[;4òZ*L×þ.Rs3HˆºëïNÃÓº<„á=:äîLÅ4¼<2c£Î]ÒH•J¤üMÎ˜ˆˆˆˆ&‚yxŒ[÷]Ø·Â¥GˆÊ¾cå]N[èÜi˜ÈˆˆˆA²LVkìåçHB´47ˆˆŒMûÄèm3FÜÞŒ’¤8RÕJ·ËÝθˆBš$!hˆŒ¼öÎœNR¹»tW[+¶ã"UfÃ[lßÄèk¸&BG5ˆ¹ß¿èˆ†FÅ¢+'kÕÙZ„6Èk‹Ö„­LÙÄ5swˆˆÜìU†lX;U‚…ͨèÝe4Ù·$EÜ†C—5mf¨ç†¬åÄÜ2&§#7ˆŒë­ÔˆHºw·„xEÄ«¾»‰¬KD\¸»¼2G%CÖÇÈ”]÷‹ÝÅ6m4%fÝ›¹ÍK´ÄÉÇT5…kv²\®KV~¸Î̤[6$ÆEUVHϼÝÉHºˆB43‰”‚hˆˆ‹ì»‰T¾¨ÕŒ$IÃxVÎÎéˆyˆˆtEDS"WˆÉÍ:Îæ[[¼YµSE6C«Ëʉ5ëìˁKJE#6·Í‡k­…ÍÌÔ…C$Ö¸\Ã\ÎÎTVÊ؈„5%D”‚†Wˆˆ¼Ê<­Ö4—•{ɇœÌÛˆˆY¤9+}–4Ê……l¼ºf‰F£½uEddjÜÍýÂ-ÝYjC8¼C;SÈÍ·ŒcdWÄlÈ£Xœv<ÊÌÍê:YÊŠˆ‚#DSZ‡ÝÚ(¼ÅGƒ…H“X—š«Þ›ºœäf½Éˆˆc<CUgc½zšÛ¸Ùd22TxˆˆÍ¤|¾»ëH“½j…dKµ”DTÊW^îÛ”³:R5SdXˆˆÝÝÞÇxeµeK‹lÃ58ÒL‡œiºj¦˜dW47ˆˆˆ¾ïì;yÈ[˜S78E©ËúGx³¶[ÌÍ¥44[$iF¦ŽlËÌƺ¨Cƒ3\ÝÞ벘}G¸ƒCJ6ËȉEƒE„ˆËßÜ¥T:´6ÃE\´‡ÜÌJCSD8ˆÏì¸(»ÃiÅ5K´œÉ‹hDUiEvϾèˆTur%¨8KżܻtwS$8ˆŒËíÍBkç\Ùd;Ì•»¥B5CHdˆ¾ü‡”$x3(Z›È̵‹e4„X¼í¹‡hÍ3¼¼K¾Èܘ‡eB!DˆˆÝÌíÌ:mS¬§$ft·‹µdETd{
 lÿ뻈RIA'©SŠÌÞ숕iRH3:Þí\ºR½„8Ì´|ŒÌ¨†32C(ˆˆŒï<ݸ-D#¨ƒL­ªÍLJteUµ=îܨˆˆ-3X†y‹ÛîÆDcECWXÞÞæKˆeŠb[d†Ê˼ØC25Dˆˆîü‰§”uSHUw‰Ê¼ÉY³4DhyÝÞ舅†#A4hˆˆŠÝÜh„5tFŒïϳя=Šó=\-Að>×&∈.öîiÉ…¸ˆ1ѽ'¿òÖV<=äïʈˆƒÕ'ĈºïOâÔ&S™®û퉈ˆˆ40äÕíOÒÕ5ˆˆˆˆïßʈˆˆ<1aåÍ¿ÄÄ%ˆˆˆîß鈈ˆBWïÉæS6%ˆˆˆî혈[PƒjâϛԓRˆˆˆˆŽÿ눈ˆƒ6ÅÍ9ÃQÔI“xˆˆ‰üËäí&ƒµg}<VÈâÛIDƒt›;’IÚìKËÍèg-E+„è[t3£ª(6ˆˆŒŸ½ß¨ˆˆRsÉ]<›âË]%xˆŽ®Þ숈3t´Í©èȈ!Fˆˆˆ®üÛÛ‚”#·È{ÌåèˆDqWˆˆŸïꈈu…"TeÚÙéAT”B8ˆŽÎëÍXm5WA3­ÚïÊ3\2C%xŠm|ü‹¿K•f at MœÝ똈C3T›K\ÕÝν‹“BW½é=î329HÜE9¨çï͘ˆ‚<F3Ò\Þœs%™µd&Gˆí®ÜŒDÌ<¹`YíˆÌ45¸s$8ˆˆ¾¾ÌȬ½[ƒ"¬Jƒ]؃ƒV6Kœ½ÎWºÍ؈‚-sI\Í×AF¦:¹Fi{Äîí݆{ˆˆ;¾«³"3U•uxˆˆîîɘˆˆS½ÍTiC5Ë”d8ˆ‹ìîä¹Øˆ4[1½©[‹h”S2WˆˆˆïËÛꈈXš‚4¬yi»138ˆˆˆŒíîŒIJ„qÝ×½•0Fˆˆ×¬Ýê]juZFÅ+ÜÛ4B33xˆ‰ä´Þ嬌ČD›è2íµ3VB‰½å5»Ôi¼ÙÜ9›ÍÈ…YR9D4¥œÄ5lÔ|µÊ݈Ê»¨rÅ4[ÌÞ“$MÄW…”ÜË˼ȜºC"”[îÝ“"7rW¤hŠ›ïÜتE…’ ÛÝïs#C£[Ãe®‹Üîǘ3%µSSÎþÉ3X¢$c„K»ÝëŠEG4™ÞÍʘ7WR42hˆŠÎÜÇìU656﮸C%TxBBž{½ÜÄkÃF4H¾ïɈ"\UxBS•Z¼Ê¥‡lÈEŒÿ|¨ˆˆƒ{C8‹†½Édh”<†¼ïͨˆ:—6…\¼x¨XUSsˆˆÿ쨈[ˆS7"-Ú[ºd3txˆˆÿùˆˆˆˆDF2$¼½Í¶2B
 HˆˆˆïýʈK¥&º£6ÄŠÌ´S2&ˆˆˆ¿ý똈ˆCy“\•uˆƒd45ˆˆˆ¯ùÞ¹Lˆ3d5¼ÈÌ$T33Xˆˆ¾ç¾œN¸4ØT<Ý»ˆV"C#xˆˆ®ä®|^iD¸w‹›½¹UB23{YÝÞÕ9Z\©'¸ŠÊ¼›ÜUs#1hŠîÝÓDh5§|›ÍŠÜªSXsH"T‹íîæSx#BZ\έܺƒgEFõþøˆˆ
¢x‰ùóëAŠñõÿÚ"òóý//5àðÃ-,LÞÿ˜ˆˆ[µâþÎLãñB>OÞ˜ˆˆˆ"Xë˜Îg3,ƒˆîäÍΨˆ‚TarÍÕ¾¼CÀbHŽ.,þóøˆˆˆ"Hp£Xß?ÈÁȽŸïšˆ‚興"KÐÐÕê*Iuˆˆßÿ˜ˆ„£“´^;NÁ3cL¬RFˆˆ‰ÿˆ8Î݈%d7ˆˆˆˆ_Ÿí˜ˆˆƒ=ÙäèSh7ˆˆˆˆÞ?^ìƹ‚,.߸ˆ‚hˆˆˆÝÿ]\l˜ˆ"¤(½ëÃÃq5&ˆˆŽüÛëteËBDä½…¸ž‰H0"hˆˆÜüÝsZDN®¤ÈƒQ¼4EC8ˆˆŽþÍ؈bP<Í}ܘQDYÓ4«i†èÌúMW«@)¾ØëÚH31tÓ:Ž\¼œÔÍRíAf½„þ˜43XˆˆïÝKÙE^TqIí=¼5ì’„5ˆ¿ëý˜ˆˆD øŒÍB僜4®¸ÙßÅsEGõíèÌ‚5!szÄi|ÌÎûÚˆˆ†0q·¿û8³H‹¹Ý¾öÙˆ„]ˆ2 Å‹¿ˆW5ÓTcˆŒï³ìœZ]JË€ÜË´"\k0Wˆˆˆ¿Þ÷Ȉˆ!¾ÓC\H43XŒ•}LÄeïý¨ˆˆCDÎÝIUBxŒeˆˆ—Šÿü¨ˆˆˆ0.þ¨EC5xˆŠŒè¹…¯üˆeÈ0C¬Ìéƒ!cˆˆŽêu¾íHN¹ˆˆ‚tAÿ£UˆˆˆˆëÙì³4Nþ¸ž¦3<¹C“s4xˆ¿ì¶l«S®é„‰UQ1GŽ¸fZ{§kïùˆˆ%yúÍS-e2ŒÍ»wBHˆïìd,Þg5ϘˆˆX‹ëVM‹ÎZÞˈˆ† '¿ýTc8ˆííŒÙ$ßùt%SýÛÈB7xˆìm¹ÕK™ÞÛˆƒ…9Ïý1chˆžßí¹ˆ@'¿û0É„½¾§­¤¥!HÿÙE²V‰fEÈÊ &ŽïT"³lÜÍÜÜ·˜Q_ÝÅ1Å…8n»ÍŽ4þăÄC8-Í»”¸Wˆîû³×[~><¹ˆˆ0jþÈ1DxˆßÞÙˆ‚ /þ¹3t5šmÌ–B‹1ˆˆÿý•dTļµÅC
 ‘XÝuSxˆû~þ˜ˆˆƒû´"ÈzÃ;›z“ìÔ<ÿû‚§i¬KÆ,²Û‚ˆˆˆ—Ý^Ý|ÜȈˆˆ CÞ¶S[Yx7ÝëîË…!QüìÅMET9冻64ˆˆë»¾¨k”Ý興ˆ2¾´2ˆˆ‹µýÞ½¸„4¿íƒ4·ƒ…½D^WÌCtŸìc8ÔGéÍ\¸J‚!ˆ—ˆˆŠìÜÍʼˆUƒ9Šé&TZ„3]§Í©È„G:ìT8îÇX[KÜDR1GˆíE¼ŽÝÇUʼ¨ˆB"+Ì4UWˆ·ÍìÎlf33¶ÏëJ,Ö+ÆŒlT43C|îSH5Ùݺ߸ˆ„R;Æ„XXÝÝØÍÌURSµÞfÔ4ÜX‡k½»…T…KË¢4j¾þÛW¹fT#%,ׇ™xÜ¹E¼YwYKLÅ…$\ëÉÙߨ†3t7‰L8{tíÜD^sR2„ÈíVŠ8´ÜÜËm؃BdUÜ"†5ˆÞÝìŒÈ…"Kx˳b'uMíÛSçUDnËsU4xÌÜbÅD"<»›‚;VËžîË£ÌZƒ<ée‚%È[íÛ£^vT\ÙÇTJhŠÊ媃Wc5ë˶F¸xÈý܈L…„"ÍT3#ˆˆˆßíÚ%ÒtEß»d+ÄTˆÝX·"“Sfî×Y3IwÌï݈†„5B}´4#ˆˆ½ßî§5XD•¾Û3‹Uf¾Ëe2‹–ç%SuhËßÛˆCuR˜N„Wˆˆ¾ÎüÉCCu͍»"Bµ§½xÊÈR[|kÍú"3e|©]ìÈAŠZ4iê26¼MÍî눃…3{»ÛA4Œ4]¼ÚZr­UܽÊB3E)ÝÎÕÌSTI‹kQC­Æì¼ì¦19D®–Ûb1mÄܝؚSŽw©ì¸<§lÌèTDuzºÖQ6NÊŽÊÕf3mB̽ÄD5~Í\ÙÄH4MרE×3$EÜ¥ÔÛxgž»¹Rè2%½ëÃ×Ëz2]–ESìs5®íÓŠ†5FmLj”½A%lÌŌܸk¾ÈwB:b#\ìÛYµWU<Ê……Ë×5žëÈ#¶DGíµbE£$kí½B͹»¼Ûd2$E5®ý‡RzEˆ›î„D‹U¹íiA&D‹Üë‡C7DeÜí½r=ÖºÇÌT"$fÅÈîÅT&…ÍÔ¾w4F´ØœÍ”Tƕ˽‡35Õ¶­ÞÈ„ܼÊHd4Csª¾Ù6cÖ|Ýl´23»½–»Ê…@Ì›½‹¸SbLÛÛÆDB›ÌxÆBD7]ۜݓ4\Ë»S‡US+ÌÝlÅXU,Û»•©VzUxÈ[¼…58ÝÌ’8…Zu†ì§}É…tˆV·DFwTÍ臺˜»‚l¸gZÈUC*Ý´ŠÇu³¼ËÆ3Ìt…H¾
 Ü©ÉDDKµGcK¹s+î»»˜Y¸%̹cI‡ˆ3ØŒÍ³†9͹B:ÚH„º‡‹Ö“4yVYU½—D¾ØZ¼»ÙrfTEGÈUT]ÎwŒÜ¶SVh…4ÍÅd;mÌxÌÇS[•G•ÅB<ÞºŒÌÄC$†DU¬´eX®ë»Ý´4:¨™d[´4w‡ÌÙÍÈd'Èu¦Y‡T4ÝéÅ­…V"‡wš­Ç5t­ìÈ^ÉDB‰tVKÊ#uŠËí¾¹UBYukÊÈESlÛ¼­†Er:uª‹ØC„[ÝÝÅÚDR%†wfÛS…ÝåÙTD¨ˆªÈCC<ݼèËTi$VW¼ÈDDLÞÞØYSE"wi¬Ü—4<ݽ܌”D1¹xŠ§V#hÎíÝÚ†5Agf­ÙG2XÜí»¸c5RXšÜÛF2HÍþ»É…D3$W»©U3ˆÎþÚº•6D+—‹É…"4Íü¨¼†Ux4ˆ[«¦4HÍîʼd3DBWŒÍ¶4DÍìËΈŠD3g©{”"6ˆíì¾ÇUD!IÜÍì4$lìÛ{µD3DIÜÝÖ"‰ííÞ¨XC3&«œÈ24ýì̦#CT8Þ½ÛB"‰Ü̼ÇDC‡DÌ‹yC4ŒîÞ̨dBC3¬ËÜcEŒÜÉ‹ÖdTV4ŠªÌR#xÜíÍÜ¥C43H¼Ý¥TKØ̬ÙU3DDKÍ݃#5ªÝÞì¨t3#(»ÝšÌt5Vx¬SE7ÎìÌcEEÍÛœÉ12$ˆˆè4„hÎÿÚˆˆtJÙˆˆˆS29¶Xt3xˆˆˆˆ½×ÍŽ†Î¹ˆˆRi‹ÈT1'EÍÙ™‡TÊEÛ½û«•E3™‹»Šf„8Ç[´H…eṲ́«eUUTidhCXˆˆ‹Ýí„UZ½î˜ˆB…5›”HsHƒ\ÛÜíÈXS\ÌÙˆˆƒ"IŠÌ—SC4ˆ¬ª©WËW̙̉º†kµx™¬˜c3DŒ¹©uCFˆ«½Ü¼Êˆd4˜«Š†©T‹ÌÖJdFŠÞÚˆ…!$4ˆ·Š¨ˆºŒÍ½Ûˆ‰t[»½…EB5x¹¼S38ˆœÍîÊË3UEÏ興ƒC#ˇU2XˆˆÍÝ´4XªÝÌËTeh§Vv˜iÌexfz…k”[µkÅY«»Ë»¼µy‡ewTXT¹xÌšª„Š…Z‚6TH¸•‹…¼·|µ‡iÍݹ¼eTHˆ…TDI¤[·U…EÛîèŒs\Ùˆˆ2"$k¬Ý¸E˜hÍÝÇB"5|íîÛe3E‡jËTD5½»Ë¸DÊxÜdxcLÅ9Æ6ˆ›ÌÇœ¥mÜȈˆ…"igËTe35ˆˆ˜xˆ¼˜˜Uuˆ½Þ†¨ˆˆ‡3"6‡ª…Dh‹ÍíÜÙDŠZܘˆƒ!6­ÝÜC53Œºˆd$ˆ‹îÜÌÈhs3uH»
 ‡ÊtV‡xœÍÝÇECF…WeETzªÎÜÌÈXÆ5«g«˜wºiÌT43js7eˆˆ¼Û…v‹íˆ3gY–S3EŒÍÌ«ƒ$T\ì»ÜSi†Îܸ…3Uy©wUS#hˆˆÍí«º›Ì¨¸23"hˆˆÛ›Ü˜Ì»Ý¨ˆƒ$…;î´42ˆŽîÄZƒ\ɽÅ3š‰Þʈˆc52*„‹·Wºd½ºÜ©ˆ¼e«SW3k¸›¹ˆ•¾Ù›B7U‹º™ˆD»«¼Ýµ‡2D2Ü‰ÇD…IÝìͧG¶7†CDBH¦œÝÍ«·DS8ÌÜË…gt½»ÌgS&…g˜TXd|»ÍܦŠ–{”4¤4f5ˆˆÎÜÜ™ˆ˜Txˆˆ«y·D¦DŠxªw†U˜evTz»½ÝËÌ…‰uUeV¹VºD›ˆÌ¨ºS5fY¸x¨EW«ÝØh…D½¬ì”D235{Ý̺‡4Vœ¸Uv‹Íî؈ˆCHx»–B3EŠª»´6™‹Ü¼ÝdVvz§W¦V¬¨ÍÉ‹µ#D6Èx†C8ˆŒÞé¬ÅjÊ›–S2$EyíÜìv‰3WxÌ–S#G‹ÞÞµxBlËÌ»”HC<ŽËÊ5d&ÖJÉhCGsµžÇÊš¹XÛ͘ˆS4"kf¬wVœµžæmÓ3vKÍ웶4vj†hCT#ˆˆ‰½ÝƒkGÎý‰¹S¬U»t33#xŒ™ökÔ*ÌŒüˆˆ#|Úßë32½Îí‡A·]þÜ¥5Xݽˆˆ43W¸ˆ½¥}ælìšÌC8Æ#È2Ž„ŒÇg‹ÆJØ"ltÎí̹S4×|예#•D\HD—ˆ¼Ü]ÞkÈ‚7«H¾cTƒYÞÞ«„!¥LÏØUR#GÙÞ£lRNÈδChˆˆîý“'‹ïþˆ…,ÌÝë“5”-ù5ì3ˆD3Yµ¾üyc®îúˆ%ŒüβSnítEH†g¸EUCEÍÞí·AXˆþï²""žïìˆQ„Jݼ†œÄƒ3\ïȈS1?Þʈ‚ ‹LþT„ˆˆËÏöLÒ&¸œÞȈƒ Fˆßîs#ˆˆÿý˜„™EÛˆˆˆ‚"E½ÛœR"8ˆˆŽ¼Ì2ÆUîßɈ‚*RßÖ«b"wˆéŒÔ\µÞví³¬2¹¬ÇM‚&@HˆŒ†ì5¸(ÉYìíç­3®¨˜ˆ‚W~þ΂2}ëï³u#¬5ÈGÈK×%cWÚÏéDRÍÞýµFsm鈈R“Wé7‹%ŒËÜÖ¸Kx&ÕTÚ›w&2XˆŽë6Rhˆÿü¹„%ʜʈˆˆev";ƒ:Ô4hˆˆÏ…É¢¼ÜÎÙ2D•Iì4…3LU›ŒÆœù[ÍCÍTܧjb=3~²]B-dÌÄ…[œ}ìx’†Š»(ECËÈë
 jE^ƽ³TE¹¬ØJ‚Ú=ä7²+„HˆˆˆÜË3ÆËß܈„DØ«¨ˆDèXä3hˆŒÕÌ‹ïZÛˆˆUÉDÃ!3\ïÈU!HˆˆþS4GŒïíØ‚MÆ<ÙE¤Ä[²T6îÚµ43^¬ª’4Êœÿ³I2Ž»ÞQ(xÞìƒ!~þû„míþA%(‹þ…´ÎÌï‚u®ŸèD¡HnÝ5˜wDîŒÛlØ»ˆˆˆˆ„5C$*ä&µˆ‰ý#…5yÝîÃ+Ã|︈Q$¹\éÔüîÚI¹DÌDC3XíKÙ!$«¾ëR2xˆŒýbÓ)ÎßꈈˆƒKMBÝǸV]î¼ÄrK¾Ýë”"X¼ÍTd!Wˆˆˆˆˆþ»Ç$—Þ興!tKï·T3"mÈß²;Q>ØŸä:³3x«Î„GR$˜ÝÝΚDw˜í˜ˆ‚H"ÎiÝC‚ˆˆÎ¾ÃC„]íÝ„UH™Ò#RKǼÌ9YËÚä;•+¼½èu¸dK¨zblÔyCX1x‰½ƒÌsÌÌÿE4[¼ÿcS#®íèˆR!8Ìݼ¨CFSØUÝ[„4ˆ:ìŒãÄ^þ˘…A7u§%Ç&ÞÖX©TD¼¦†lîK똈ˆˆˆcFA7SXˆˆˆŒ·¼»\ÌËÜ„ÍRlxyy¨‹r6£*•\”Z„ÎÚ¼Å9³<ÜX§ZͼÈC2fîëÈ!%hÏûÚA#T¾ÝݸzDj–ˬº…$17ºÞÙ{2#W­Û¼BdH¬Lî·ÝÅÛ•Uz5¾¹ˆˆTB#„5µkÇkí˜í4ˆ3:ܼÉGt6Ìk¹†™ˆ¼¸D„6º©¤SYFÞÞÛ§D¦6ÝDÚB|ǍÚ3TAI5ˆˆˆˆÞ‡Ý˜ÌÈx˜#ÝSδk„]ÈD‰¤725Hˆˆ‹…ˆˆ‹ìÍé4œfÍÉË“L·»ˆ‡c"yX›B5xˆÍ½Èu{ÉÎ鈂t;îÜÈTˆbJ3HDˆˆˆÛwÈfÍÎí¸ˆˆˆh¨ˆE”3‹DLCEUÉ«yœ—™ÛÄLÍjeFt6VÌ‹ÝȸkÚVƒ#b9¥¸­—ªCHWͬ݋ÊYºÊˆˆ„7#¾s«3U$‰hˆˆŠÍ¸½BÚ令d¬ˆˆˆˆ‚4hTˆˆˆœÍÊWY˨»Ì˜ºhÇXˆgˆe‚4“LÜ|¦D§¼íŒtDdCkº¬Í•xÇkvk…E¦]ÕKB&thˆ‰·Ì½î»Ùd«™ˆˆˆCb(ÚŒÅT$XV¬cHˆˆˆˆŽ×®Úݹˆˆˆ†¨"e$ˆZÊD–mì‹„43›ÞíÌT5ˆëˆˆC"¥#•XˆˆŒŒèMÖ\ԬȇX«HÈYØ]¸x2#C¼«ÌGÈDÛ4–5ºÌÃVDlÍÝÚËSvW«˜X¸5ŠT‹”
 ¾ë©DXy¼ÆRWˆˆì­c{ÛܨS33Uf½•j¦|˜ݥuC7X­ìÍ„G¨¬¨Cd!4ˆˆ§y˜ª¼Ýµ‹Uh„™T½žü¨‡"$LïÌ¥2#KœìD§CˆClÉÞÝÛd5TLí»“78ßéÉSC5H»¶‡sEhˆ›ïìÛ•ˆ¸…gB#CZÝ»¥SGËÍ܈SFºÎåZ¨EDx…hËyS3%ˆ‰Ù›ÌÇ­Ų̈ˆ†237tlx¼”U˜‡ÌÍÜÅ4SHÜܺ”GdŒÝÆT"#HˆÞîÛƒDW­Ì¨„"Wˆ‰¬¦™†ÌÌÞ눈"#3k¼Ý×xÍܸˆˆB$hheCF‹ÝþË„$XÞÛuREˆ›¦WˆˆÝÞˆˆ…S3Ud[ÈeW†h«¼Í•d4·ìÍÉ„D3zÌet!hˆˆ¼ÝÍ݉ËTUTkÛˆÊB5TZ·eT5ˆˆ‹ÞÜ•‡h½»ÌȈˆˆˆ„3RE™ˆCEˆ‹ÜË‹uLÜÞʈˆ4V™ªeU"6GˆˆˆˆŒÝȝ¹­Û¸ˆˆˆˆˆ3C#xTÜ3ixŠÌ΢š´W¸{§YÈUËIìCX":„Ïص3UKÞ„WBŒ1%xˆËüW̦X„ZD¹eeuX̩ܽ–“DCEVi•‹Õ;̾þ¨ˆˆˆtD…#D&ˆîÖUR5X¾í‹Ù2e8ÎËÞˆˆˆB3#«U\„kÝÆ]ÅL¶œÜθˆˆuS3EDX¼–…Tl¼ÌÉDC[º­Ì¹šˆ‰–˜‡z»[ØEs"UDÎʬ¸»´8tk–¼·hˆºØ›eC&¸mìuƒ"Œ›ÝÊ…E{ݺT34›ÞËËdy¹‰d„%Û„™5½ÍܹRET½ÍÌT‹‡ºd˜h¸½·›bWCK‡hV™XË[ÈŒÝ͸D24WÞ»Ç$ƒ7ÌËÈ5uYÇλ܉´"S)ÝœÜH¤GeÌBvCl»¼º˜­×Ã44{{݇d$¼œéYS9”¬´y¦{…Z˜†œË̃ZDŒØ¦CCX»ÎÕETmÛÌ”D2Ü¼¥DX…«”EWŒÜ̦C5«œÈT2E›ÞˆxCG¼ÞÌ˘h„jƒ8…k¦¥2L·Ï×iB%ˆ½ÝØ«Ûx†EuݹˆƒCˆîÙ{!HŒþìÈ"iJþ¸„!37̝Ûz͆»ƒ$T8È4–ˆîïÙˆC#ZË̳3„IÙDhU›Þë¼UY›™†c#DJ»º¼Ì»ÚSw4¨Hºh„Z¶H„Jˬܺ¹–Š¦UCLÊÏȈˆ…#6EU3ˆˆˆ»•xº¾ýÌ’%TÛŠ•X»Í¸…C"HxÝRg4hˆˆÌÝÞëY¤DGºWÅ3ÌyÞ•D"D‹ÆWdH½Þ܇uH¬Ê«28t¾íˈT7šˆ
 ´22Fˆ­•8ˆˆŒËÜcÜ­ÜˆD˜ŒÊˆˆˆ2"3XˆˆˆˆÞüÝ”wD™ftE¦4ºŒí‹ÙEDfe‡S3xˆœíËÜ‹ËȈˆ#USgw„KÜδ½ÔYTE24H‰‹Ì™–ÍÊ͵HR8¨©z¼œÜ˨ˆ36Cl”Œtˆh•E˜lÜȈ«…œR:î…JÃßé"ÎQ=þ’èÏúâ,ÿ°ÿ²=í0Nâ8ÿÐÿÃ.Þ_å#ßòîCÞý 
ýFÌÊÿ`?ÿ°ß9îsßò$ßÒ#»+ïç /øtº•,úý0ÜlöQþ±=ÞrI´,þÑßÔ¨¹C>ä#ÏÛ ¼¸¾ä@.îR¬|3Ú‚Oé‘&Þ˜Ûd%ÍÂ6Þ³4µMÞÓ¿±;øÌ;ç"èAMÚ(ýA=ì²MÙ!¾R>îÒïC̓3ö$ÿ¥2f¸Oö!MœcÏçéŠ{„‘.õýÍ1<ÓŸà‹ÿ1?ãJ£JÞû0îêTLVø üÂníþ!üå îËÔNïä¿ÞÒ2KLÒßþ@$ŸÎâ_ÝQL߆Ïþ0뜅7Üÿ žüs!ƒ}þ!¼û34ô«ØoÿB™íƒKÕrïëÈšÝèYÏìyG&_þ°í2œ3.ü0?ÿ Å9ÿàÿQÿƒ31zïàÿ¾EÙÄ=@Žþ}ëkÝStî .ÿ2L´Tÿ€õ@HÿSÿAÿ¹X2»Ë:Îñïþ£D-þ¾ì0?ÿ†0¾ÿàÿS9Ì„Y Xïäõoç,Ö ý3$¾Þé å!\ÿåC oÿÁÝBˆSïëÂ
-ÿØ!ÈÌã*þÖ]ÿø ÿë ÿÁCÏú"Wÿó"÷#cOû 'Ïþ"ÿ¶#ÞÒ Xßü%ßüƒÏñ:ÞíR"ÿù8äJÕ#ÿòßû“ ßô!nþ!ÅMÿP_ÿ@2NþRÉß´ 7ÿ ›ïÛB¯òÿÒ6ßÿ"«í wïãþ€$ï£>ý0^ÿa#$ÿ2BoÿÝÝÉ ŒÿA\ìÓDgÏë .ÿåˆ?ÿ ½Ï ßô‹ÿÂ&ÿíÿ"Þÿ²îú4ÞþÿüËÿT	îû -üýÏû=ïõ$<ÏÀ!Nßõ Nÿànïâ.ÿà½ÿä0<ÿ ïí3a+ÿàîÿ Ûü=Ýÿ1D½ý{;ÿV¿ñkýìďó _þÖ ~nù ^¿þV?òw¿ý)ïù!8TßèÞ ,ÿùrýáþþB}Ð,¼%XÿÐoýˆ» ,ÿR,ÿÀóÿÛ %ÿD¬ôÿÀÿø OäÞÅ ÿÀÝü"S<ÿ3ï–"NÿD#:ïû€ÿå <×¾Äïþÿ­7»0òÿø ä,ý‘þƒ¿ã>î0¼îcSªßêƒ/þ"+½ó"mþEÞîJ"mŸåZßë îä*}œü@ÿõ ¯äï4Pÿ ÿÂÒ*Ýí1OòîD÷,þ¸¸ÿEcÞ0O¢]Ñ8ÙìÁ6$ÿ쥲 ÿ ÏüÔHÿï”18ý[û!ܱÏçÊí3[Ñ›ÝÔoÔ$ÍÇßÆÄC-È^¸6|Ì!L¶ˆŽ½þ¤%è[Uæ$ŽQmîó6DÛÎ#3Ïã"¿‚8¯ÿ±íR\¬ßÈQ»ôHˆïî²|Æ%ÿë˜42ßA]ÿÓM;"{<,ÿë’AhŽþãÙ+Ë3ÿÊ{êˆ %ˆˆßü“K!Fÿü3ݘCCx¯ôNü„clÿ³Ëù+ùÇNÔ ô ]þ4ÿ¨‡10WŒý”´vï¢#Ì)ÿÔ#ÌC¿ý€E WïØ™9‚_ý32D„7ÿ7ç4¾é!2UGßýr]ƒïþ£#c"Îâ:Þýÿ%J±Gÿë{t!$ÿ{½¹29MÛs<Ó¿ê2BˆŒþ¿Ç@>þ́äJÒ"³ïá?ý—!R3ïâ;í™LüžÂJIþ¡"ýFïÒ½1HΫî’=‹ËäZSD7â+)è(ÿìRCCõ)ÞËÁÿú7ÿ÷Îßb$ï¹"X÷­^ø‹ÍŠ‚ßó'4ï¼ëA&ÞP¿þ¸ClïØ#UËoýËÜRê@luí
 íû0,ãNý¸ ÿÃÿàÿÂ-þP_øeþ£Ý‚{ïÓ Mÿã[Ë<ÖïòˆŸü5„îØB0ÿ’ _ÿ6ßùÈ=|þ0ÿâÿù4Ã!$ÿh%Ëí1^î!5Þ#ÝíBþRŸüˆë ¬ÿ‚ßýÇcæcˆÿýÿýþ^ÿã _ÿØPˆÿ±%ÝÿÂ<í¼2{ÿâ½ë¸Ü°ÿámïTë6´¿Ò nïá
ÿîÉ0
-þR¶‚Dßü xÿý X¿á)roÿÓ Oÿ±_Ýý¢",îoÿÙ@2&ŠþÜ#È>ýµ (í}3ïû” 6ÿý`ÌîaÞþ Lÿè„1ž¤ÞÞ >í2ÿÃ<#¼Îé NÿåýÃ(0hÿÐ.ü¨ÒßÃÿ&½Í¯ëp<.ÐïcïÙA¾à)^½ëGë®úm"ìLMÛëm´ßé&â<Þø ÎT#ÎÿÑ#Ù¾4ÏÀ:9ºBïðËþô$ÍÅÿü ­ÿ ,ü¹^ÓÏü‘ÿAìÔÍ4Žïû3ÈÌEíMÞ؃ Íÿp
„Iÿ‘û_ÿÙ„ 6ý¿ÿBÿÐ-‹"ÌÿÑ™CŒÿõ¬[ ‹ßø!ßÛˆ@-Âhÿ=íe_øg«’ÏÊXÿâ<íÚR ˆ‹ÿÂ8ÿ¸ º÷Ìb#Õü2'éîµ'íÛ4#!ˆˆÿõdk4jû'­bŒÿû@ÞÞÔ'¾x@%Ïÿ1%ÎnÒLÜ4 GÿÏ‘2ž¸2¯è%!çÏ€ä>2ÎþÈ MQŒ9ÏÙ½AÏ‚Ž¿³íþ12'üÙ+û–@ßÒDMÿã"þÕA$¿ÿÂÔå¯þ˜pmýS-ü(Çîȃ ÔMä?úÏÿYq'M¬UÜ\4ÿüi ŽSWÿã)‹þ˜2ÿÒxÿó'êÏêþ¸ÈÍõ-þþº2´þ![þ0*ßø"aMSIÅßô?þ>°?0+ôßÐçŸÃ/ÿ°ÿØ ,+ÿ XïäÊÿò»2$$onþtŒ[{ÿü +î÷ <ßý2ýb_ý3EÃ-äNÃ=YîPíþ°ïþ0ÿëXÿâ¬ÿóÎê#=Hÿ4¶ÈTïÎê -ìЏþä OÿÊ€ïø>ÿp at iÿüP#o#»ø.Ñ#ìÿÀÿ¸ %ÿû%ÿý˜ Oþ 6ïþ!!‹ù^Ülë73+’$ßýÓ ßþ`oëÒ#Ïþ” ?ÿÊ /ý2#ÛoõBÿöíÝ;ý;1þNÂ$åÛ8ÿý€ÿ#¿õ^Ò!TþA:ÿ÷ÿÈÿÐn»Ü¥Ä ÿÐÿú"ßÃÜŸÿÉ oø‘ïÄD^Ú4ë3#EØ.ÿÙ.öRŒïÛ$¸e5EpˆÿÍ”®² hÏó8ݦx2¶Îõ"ÿýÿ2ªNþɈ -ýqŽôÜDþc©c¿ÿ$‡¦E>Ó½Ïâ½Û1&ØïÞÈ…$|HÏûT½ÃOãEOñíåWþ7ÿýWe Žÿ ,îû!/ûŒ!#FÏÿ2ÿB$[í×® Å´IÝíÍé3§!ˆÿ
 ÛÔ;ä ÿ°voôêCE<âÿüˆÒmÎ1~ÿ3,ÞÓ~@Ïÿ¹	V˜1>¤¿ýBÿ²%#ì_幁$h½ïžÙ¼ûSœ¬Ös4!xÍSnÿëˆ!BèH{ÜÕï¢;ÞAÏüsS;ÈžÒ-îÃ1+íd"­mnþˆD™ ‰Žåîè ÿ´½Q^ý· .çšÿü¨A6ß1›ûþ0ÌSîxcQ¿ÚÔ%Ô	¾äÙÿ!r,ïAŒ8ìßÊ4l´9è=ÿÛ8þG·*ýí3XäIÍÿÛ‚0-îLAÏü(a.3ŸB…ê/ô
-´kšlõø$œ:Úë
-^þÉU:Cp?3ݍÓ'ÌaßÛb{Þ´GpOB3Þïéˆ0mݶ#ÿåwÌÇÍ /ÿ£]¡<잍é€\ïp¾g,Îì¥Í13ŠËI¾BíÿÅÌC½!ß ã”^#hÏÿ³¶@>W¾$ÿ13æÝ"Þ"U?þ‚<	õÿ:ø…@¾NóßÛøþ©‚ _üé h¾E9ÿü…5ßÒ#›^.üíX¿ð_òÏ@ÿî¡"ÓÏÒýIW’Þþ§„1W'ÂÎþÂyý<øÃÒþŠý MÌþîù… ;ÈþA$¾î#fïë4îûÌ øEBßü4 /ҏÑþªq/þV&þœ‚.Ìœ3Nþ¨‚Ì´ŒÊÌs¾-ÿB¿ìŽŠx#ÎÒŽBËh£þ2îý"TÎÕ$LÿDßþ³NþS ŸüR|þxßþÃü(Ïÿ¹@þÅOþ"ANëÄ#þë ~ÄS$îÀ¯ó¾Q•3Þ±C„þ4šdï²5AÿÕ";ì‚2~þÝ¢-ëƒ3×+g]þJH¥ä,<ïÊ8@þÝ"¿ö#Ƥ~½´ßUìßЮÌÔ Oîûˆ¬¼±BïÐ&ŽþãÄúDÆI¿@?ÿ2}ã4çNÖA+êß1µïäAÍßÇ!ßÆ“øê%!nWrO³H(oÿ¼`ÒKDOÿ¡!.þúƒÿ³oûD1XÈÿû2!ސ?þC„®?ó¯0	äoôK Ïñìÿԁï&hà>îü@þ—³î_ôŒ"?^üLÜê€ýÒm¬îÕMºCŽÿ‚ÏA2-ÏÅS&ß$äËݐ&ÿøƒHÓBXyÞóUNþ]ì­ý’c2:~÷UØ­Õ ¯t2HÏïÚp-#dGŸÿÅ_í1J(}옵 HŒÿ°/ÿK.Ú-âÿý‘þ“!'ïTK¢<ö17ü'ïÃà ßSÅ-ÿ¥Û€,²#Xÿ±!ïÐî;îÒßü0ÿÕ¹ˆS0‹ïñ¾ï@.ÿ 4ÎÿÉ2RU|´\ÿ˜ Oþƒ]D¾^ýUÝ¿÷ÿñ¦CÿX,Íê» ÎBˆïüR-û$%ïê´#ìî€þCµå­ 	Ô8ÿWÎã OÿDCD›ØCÿʇÿ"Û3MCeïÚ 'Üïù!";Èÿ예Œ4œîbŒMÿƒÜϗ݉Ú0hÿî²½‰Ìî·!ÿä-ƒÂ,3®ÿÓ‹ò»ýÛ€\þè(ûÁ8Ïÿ¹ %ÿùcèÒ<<ÿ*Ûü¼K"hßù£S,Û#Žßä #Ïÿ²^gtS¿üFMÝÃZÙÄ!Íþ"ÄLüBVÍü”*ÿâ«ÿR
 C*ïý ÿûRI\ļÜγ$Ez‹ÎñcmýAJ¬³DXÜÿQ3ŽîÄ"«é#˜d<ÚjW§^ÀãÏ	Õ»)ä‹W|K…}F{ŒØ0/þÈ ìèÙ"ûµe\ÙW„JdÕ„¶|LKš^,9˪8¨^G…-Ü3LÓ”å´FÛl-+Â^cN¸6L¯E&­ÜÃK/„µ´Æ¨tiƈÁìÅÁŽ®ªMGƒÙÈáä/áoÀÿ‘â'ùÓß\ýPïÂÊ#Î=+¦Ø.ūͲ΂L³ÕE"tKÃg∈¾RÍnšˆÎ¨ˆˆˆˆˆˆˆˆˆ‚2lƒ"hˆˆˆˆˆˆˆˆˆ‰yxµŒçÃÍÍGíÚˆ†L¨ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆCJ‹I33ŒBwˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆŒÔ«µÚų½æÈ]ÈÊ,u̘ˆˆˆˆˆˆˆˆˆˆ„Ȉˆˆ…¶¨…·,“¼¶²¹TÓ’ÚU²ÊC´>²ÒË”Õ'ÓʃX§ä³UˆˆÄˆˆˆŒHˆˆˆˆˆµ™ÛÛ•ÓCËÞ\•¼-b¸™åM$…̃›;V»ÉË££Õ¬âí.²§¸Øˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ„ȈˆY:Lƒ¢Í\4I‡t[H3ê=CÅŽ•»3ThÍLKcÊ9xˆµˆˆˆˆŠhˆˆˆˆˆˆˆˆˆEÉãT‹Î2Ö}‹È9âÝÕ^ŵ:“ÌÈãNƒã·xÉŠÃÉ»˜„Ã؈jˆˆˆˆˆˆˆ†¨ˆˆˆˆˆˆˆˆˆˆˆˆˆ‡˜bŸISLg–ƒ)xˆˆ‹^9HˆŽW<HˆˆˆˆˆˆˆˆˆŽ5µxˆŠhˆ‡Ê<FŽ*GŠ´ê/SÈFâgX¸÷ÖÚâÞ„ž5æ…>-ØI¸˜ˆˆ„È…µ¸Lˆˆˆ‡˜Z˜ˆˆyY;ÅŒ$ºSÔ2æ´uSœ¬ÁÂòÒØ·¹Ø[Ækâ^&k‡cKHé6Õ{<«Å)¼/uÌÆêr„µÏyˆ;£8DçädCL²Í8(5¥—‹XˆˆˆˆŒ‰ÃXÄÍG[ãËXJŽÒÞ2Ü]UÙ,ÒÞDÇ6ãÛ.B^(ð½T•<Rí6Å?‡·Âå˝æ\‚é.y;ºˆˆˆˆEÒ8Ä‹DÜÌ&Ò?sØ.\KNBäuÈ>E»cRÄ:òL#ÅL„ÕM6‹º£¹M¬Ev®=:„¼Å”—Åͬ<b“IÝå½yW囼YGËLY¸¸ÃV=ÕsVM8suË{=’äXļE²½MäµÃ»Ud;Ô½/¥¸Me.µÑգ͍£«ÂǬ4Ý-2ô=+â=‚ö²â…ÔÎ]MIÈ‚[ã¾7Ù-âµ3²ÜEh?—ËFÔN<Ý5‚­,Ù;,¸YÂœ(Ò\Cä;6ÓhÄŒJzvÛ]ÈÃJdÔÜØÛ6¢
 Í•\-Âò6´žDüƒÕy£ÔÖ×Ü[ˆ‡”³N¸bÇF½=3frfw¶Ìk#8cÈ]ÄÔ-¼Hµ³×‡½MӍSÜ>—ÖKÑÝ,Ò扷Z.9Ó8ÂÃ=3Û[Âj9ÔÖW¥|ٍ;ã˜Ë³]…õÅd;“Õl'„]±÷MÅMÇÆ]d“ÓªœI„¨•N,s±®[hVEhˆˆÙ|Kƒ¼[Ս8äœÃÊ+¢è-Ü=‘՝HEå®D^…ÅŒ¬L‰„Ɉˆˆ„ÇKYIÓt;,)jw«FSµÇY8[]K׌KG{¥ÕËfÒâ¼UãÌÈN9Uå=T<ÊÝ<H8š”lT‡ˆe»KuÍ(–´Ãçµ{<\Ì;‡Ì-ÃÛztT{´ÒœY”ÄkäÔ¦h­{Ƶ>#Õ\œYM#S}SÔ…D¤F——ˆˆˆˆÅk†ÄÈMËŒË=K‹—ÊÄŠ(”|[œ5¸Ö‰»‹L•>/=œ‹‹zL<\•¸[ˆiX…k+UYš[6ƒTÓI„«†˜Dh‹¹Ô‰JźtÒžhÙÖ׌J„º”ÌM^*ÒÌX’|“Ä]'´‰ƒÎE”’ÔË]:­U¸=kÈH|=lÅ™[{9”Ë›ƒU[Õ^Œ]ˆ³LNTw5=¤ÔDH9MƒØ.QȃÖhHĵ‹^:Å›^Iºlwlm,µËd‡¤UÄ\¨­5Ü6ÙMZÙ«EâΧ†µ¸´ÉU[kÈ8(³«{FuE;‹<Z”LF¼8³ØGÜ^Z¸H<ˆ}ÃÚl—N;Ç•ˆ•â¸<GÚUãŽ6¤D¥©I‚ÚkgX«—“º×u´8¼„Žx|‚;k©[Cæ.‹†«TżÈÌ»D¸[µª[U£KG{E|J‰5³µH¤Å¤‡Æ|l=y<œNv¤kæ»V´ˆM£ÌEL†J<ÈÈŒ,Y]\¬k£Ô–ÈÊxY·|L§¤Ã“¶´«:TL;{hKBuˆŒf[|KIZÉŠ”Ü|ÒÊ<ÅÈüWtYÅåluÜG¢[HflY´”â´´»=„˜=²æ{†ÃÅL³ëNc»<ÄžWä:Sªk´ì=Š<’Ùyy{HèM'„=eÈi;¨HU.C½8ňK³ÜH~,£Í/=>:Ä>X׍“·+‚ëhlLi¸Œ<Å=;º¾-µn5>[ÈĔջ—˜Lcƒ<u%Ò>4´>Y[¤ÕH•ˆ‹æ½K‹‰|uÉmÄÇ\½4Ä]N<L¤œFÅ=’Ú,”ºIÕl„ÄTä¸L4³¸ÆL“Õ=²ÞSä¼L³µƒæÔÍsÈ-FÖiˆl\¤Z”–U[ÉÔ…HVÕ›b­6ÒÞ%ѬGÕ\ÃôkX‹;âÝ\çKµÌ"LlXBî„â¤ãMé£ÇHñNDÙ§,ÕNÈœˆ„5ÌÃ)	ÒçTÈZ7’Xˆ
 ‹X§}\ۍ‰œ¼~NDÔKÚˆ9}ˆG"9Ç:2†¶©tˆŒM:­(Ï+»ã;ní,â‹NJÂí$ø€?êé žôN¸bꈈ#Þ8Áã.DÁlÂÅYÒŽÄGˆˆˆˆ‹Xˆ™ž%ŠhÞÄLÄ쓍·¹…K»AæµÂäšÚn;DTŽÌ;Á„̆\µ³ŒTÛu’»Â×·ÆÌ;]¼¸y‡T“ªãŒC,Ó»dƒT3ÄÊc˜VµŒmt‡ÄÄÄê˃´ŒÇã<„ÄÍZB¶×Ø’Ò¾‰”:-½ÔDMŒå¨C£¾XË-Âå²F[ÊÈžÄȈˆˆˆˆˆˆˆˆˆ-DscźÄE8cXiFŠÉ[…ÓjHˆŠÔŽ<h;UyKÌ+²fWˆŠœË¤Ê¥š×l»Ý+|,¥“µ®g”u4µKŠ(tÊ»ÓÕµâÍÔêkƒ¸=¶¹ˆ„„׸jsTWÌx“ZÉÓµ=̹ƒ,Ø}jSV»l…¢8c×,Rə¸u‰WFˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆËÛå¸Ä¾[ä‹ÃÔes\DÃ_:ÊTR³HX½©êHKi”™¥íͨw(w¾L˜ˆˆˆˆ„>(Ö»˜ˆy„ª[˜ˆˆˆˆˆˆˆwf[CˆK7%LTÈ<5xˆˆ‰x¦ˆŒÛ9s–…W‰‰DˆˆË:hˆˆˆˆˆˆˆ—›»´Úu؍֍(¼}³wW‹Hu•Ìäµ4Ò»Õ–w††w|l£xšË¾Iˆ=9yȼŸˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆJ+$$UÌ»hVLTUGÄÍÌ‹Kƒ„;wŽ¼Ü<CIH…\HºjDµ«º·½†­x²¨ièˆ$V]¤¶3šleTyÓ¨XˆŒÊÉÕÄÖ¹ÚX£«Xw¸ÙjdMc³3´„ê;ÄæSãÜ›{5ÈÍ•Èyu\'ÃÕ³ˆ9w×ăth{§¶Hƒ§f¬»Å=%Ý}Cy<Ûìµ´7ÕÜ=ÔÚˆˆˆ‡;LK:ÅÔE2GG„{–œˆ³5¦ŒY×̓Ö>6‹ˆÈÍe,´$º]ĵ…ÎvÔ]ÓÌŠ¼MeÄ«ˆ]5W<²œ*³yC¸=c½CãM”í=ÃÛLèMD§X´MMÍ=eK(…ƒ³§´šZ¸ØxÒ}Xê=Ø>›ÌUu?RÃt´Ì<4H¸ætR¹›Å²”K|¸ˆºXJ;uäÍL¨LËņ´Ý¹ˆƒØj„È[ˆˆIY(s‡+ˆKe¸Fs»Œ¤„œºÕY:Ø\\¹XÓ‡ŒÇN6µ.’Ê,³¼VÔ½t¹}\ºLŶ¤[•4fT¥³†‚»DÄj´ÈHX‹lé‹Åé;„[VÖ×ĶŒª…ƒs„Ú‡S‡mÉV„ÛÌÄk-ÕËw|·Ùy…´…²äSÓ]7´K‡ÓH(l{X˜KX
 ¹K<ƒŒ´Ù«¶KLµ®§è»¥Œ<ƺVÆ\ˆˆK7›5¤[+CYwĘ„•^D¦xǹ[ˆËy§}:³¼‹¶‹h´‡W|H™†V‰Ø¤™\ØÉj¨Ôh´Ç|gÅC“ZXX8ˆ©„³HGÄŽUÌMÛ©D´½uÅuÙÛGG\vÆu\EÄ“¨=‹·¼hÅ›…¶ZÔ½Kǽ[”HtºTÓª„¤\XEEG\|Š¥yDƒ\lÙ‹Ej;µk™Í^¼\£N*쨈ˆ‡WªZ¨LbfE£¤“”‹XxˆUYX»µ´­«>,…ÍJZˆÇ×f•µK´©U×H¦:v»Ù‹h\Ö»T‹LËʃ‡IbÄh•Ü(U-e—5µžWÙzµË.GË…ÖŒ”˜YãJ—Wd“¨³›S̈ÙMg†–•Œ›™\ÇÌ<µ<‚ÌGÙœtTEC‹M¤©sÓ<HKFÇËÝF46ˆˆ›¾åËHĝÕÍȈ‡˜ˆˆu¹ˆˆˆ…uDdG}c[8uM6—…xšÊlX—¸•¶Ë¸ÈTÅ{¸˜U•ºˆ‡SU§¼K½‰©4ÔŽ†ºÅxĸ˜†;Uš—…tš&h;¬G§Œ‹\u\‰ÕÕ·›”ªWˇ—ZÔ˜”ZD·F»=\Mˆštµh˜ŒÌ‹Œ…“¶‡æÊKyÈFBZ;›·x“Ã)C¨NËÍH5DUµ{–Ý[ÃkŒ\ê¬Ö†˜K†ŒÇ‰ˆy„ÄS…YHHHˆ•vEHmzjF»liyºMzŒ¸ŒY¤Uؙֈ6tL‡Ãº[hÆ‹\[LH¼½–IeŒ†ÓÄk„‰8³[CÄz´{dš\[lzXØ[Ê{„œ‰‹X¸ºÄ¤¤˜vXSœ«ÕySÈlG·ŒÈØx•[HÕÆÙ·ÊyUS„ˆÕÌW³BCT·Ì¹k‰8cµEÇmvªDµÈ­jÎ]ØMX¨ÔÈ”ÌLˆˆˆvXJHIT¤f‡G‡WtÄ»X•UÄÉŽXËhÄk™[ˆi¨µXC¸\”É<UµvÇØL„ÈŒ´ÆlEÙ|ĸETµx‰‰ˆš¨Š©™…Ex—gw™ˆ†Yƒ#ÍÚ¸~•"\kÉˆ‚?B|åBÜuS(Nä1\ÜüxˆˆÓˆˆˆ‹ÿü$ÕbZÞ؈ˆ6'¹0(ˆˆ‹í罫#8îܸ˜„7I2ë8%ÚÆÍEU|“9L»Iì…C8‚Z|M<ç‚(ŽìÔŠG,Õ…KïEÅ“6®çC$ÞI¤r՝–\þŽÙqƒ¬S"Wˆ›‰×Ýd4^õXkWtš¼¼Í¶™ˆˆ†tVkÛ’278‹ÕDDÜ%ˆˆŒHºÙ×Î{cSŒ¥¤ÈÌE2IÜ­½B\ڍ‹Û˜eD¾å‹5Ké#"HˆˆˆˆïÛ&F=Ü„¤|ÎÅ$Û}êerkÎdW¶4»'ä›ÆH
 ¦†‰…9Q–Ü3tˆˆ¼Üd4×<Ü;¬åÌ8¬ôE3DÎû×Ëè'S{į́„TR'2‹zUÖ}ï‡B*Ã]UÔÜ:RÞÞ݈xCŒœs†=¸ÖF#T¤]Ør{ä^Cs¶¼CÆîø4&]ÄXRH{éDK]¤{lG¼ÓºmÈWC­]£#*׈hÔîôè=²¬rTŒÄT­eÛCtG%cìÓÚ#KZÊï$ÝäXš5UÿVD=ÕÅÍ‚EÌ-Ã<b·uüdí$Â9D‰é:jÓBˆßÌ©½5GêfbX«Ï–çƒ}ù~Ûˆ…*²NËÈXä½4x¿Å1•ÍÌ¡KÜT[e}ÉKÃÝ¹Ú G–˜¦~ì¸ü3ÂWF’?æVâ$Ë4IFŽíÏÂïÌ… É4¿Ê,ÜÇ=’߈ق$üB¸$èŽé+ÊÇ‹^ˆ‚î!Nî—BÛ^âîM…WEßÄÏÍs+Ô1O&ïÇQShµÿ°Íä@G‹½ÉþA|þ¨<"Jíïþ¸ÝŠˆˆì˜C…fCÐŒøø”†2ˆ‹íDÞÔTÜ@ûC#ïÕn˜ ýSïÙj…=ÙT=õ,ß¡xˆˆˆÙwïñÞÕt¾Ó2¾Á>þȈKa^é€-ý¨3L%.þ +ۍT»D-çˆÈßÈÒUŽòÿô£LáÿãC®H·MÂ+ü ÍM‰ˆˆþ$*®Ûoù /ÿŧqx?Ò_”5ü²ê_ä¯ðDþQEVRÍÿÕ4SÍï!<ÿS,"%ßÿpœì¥M‚;tįÇ2Ë‘Hˆˆˆßó"ŽÃ³ÞDÿÁµMóîb,ÿɈˆ߸ˆ#ÒXÞÇXüÓݸ "¬Ý3â6ïðˆ‰¼ß³Bÿê Ξçi=<èÉP<þJ¼"4â6ŠÿüA:0ˆˆˆˆÍø'ŒÝ±GÿÙˆ‚4¿±ßþÄA™_ÍUü¨‚ XîõÏþ˜Pˆˆýÿ× 'ˆÏþ6OÉf ÿý‡b<ä%Xßäí2"XØõ"$ÿŽÐˆÿý!;þ2–!ìÿ¹#ÏþKèˆ( %ïþ¸=ˆXˆ¾ÿAwÿ˜1~^ÿ8¼¥#"DÍÏ÷8XŠäܝü!<\ø.B$΋íÇb£mïü¡Þþ¹ˆ+ŠÈ™©Õœ8è%ïOµC!mïô-,³Þ؈‚,QµŽüDj ì/ôË#ÌÜ» HïÒ∎û´+ïÔ1+ï²AÿÙ@:‚Ï Xÿý˜ˆŽ%ˆ¯ÿÂtÓFˆˆÿÙ‚èîèÈŒ0-SGíNûʈ<¾Ìø¨!#lÇØ]ýì-’Wˆÿù2'ˆˆÏÞúˆˆ*ËsËò
 Ý빩)í„;È\ݵ‹1WˆˆÜßöØ‚4Žÿé5m”"{;xï³ÿ¨‚ %ŒÞý4›Žõï°ŽaÎqÏÐ:íÓmïÞÈ3ÿÇÄNûÜBÞÅ ÝþÛÿÒK&å16ˆˆ¿ÝÍéˆ ϼk®ìˆˆ"OXô¼Û† ãMä,E¾Ä"\þÔ#&Eßý HˆˆŽÿë2³"«Þü*ØÑ"%HÍÞݽ¸… ,ÿ¢þ¨ˆPˆˆïþt¼ 4|Ûá9ÿü˜ˆ@hŒÿû˜‚ ]8ˆÿù„ 5Ëî멨ƒ!¯ÀGÏÞúÒX¾ë¬ÕCFK%¹=ÿʸ`Äÿý:#Ýfÿ¨ÜR½.ҏýùˆ‚(NÜüµÜ1"ÓxÿŠî0{ÿö ï”)ü˜ˆ iSìÌ…[ÞR6ïÒø´ß¼1hˆˆßçìÏ(ÿê zí3›îâë„@
-ßã<ù	þ逴ïþ¨ˆ€­Ãßó_ÀˆŒVˆþü¤'ŒÂ"*ìÿóÓ.Roÿн†ë˜ƒ,W~â'ˆÿò#î3\Œ%ŸÞÿå#WˆïþŠ’ß7¾Úˆ1ýˆ!#«EïüUNB4WŽÿÜ#CkšLÿû„±!XîßTI²/°DÝß숈шˆˆÿý˜ %ˆï£Žùˆ!ý3„ØNþ1õÿÜ興+ÛR½þ¹ˆxþÌÒ4ÿ¹€XŠ~ÿê„%xÿ%›,ÿÔWïö¶ž¸AWŒóßû‘,Ü’[«íÙ>–MÖïŒé]Q•hÏÿ#Ž±#îÓT/ùŒ‘(’*ÿQ3¤ßùÝ-ý -7ÿNþ¨ˆŒÕË\ïé1b.éˆÏÿ²~ÿ 5ÿÐ
ä¿ÑIÿýƒîúˆßä.þ ßðÖ? /þCÝ ˆïþ¸ ÿ %¾öì±!]ÿöNÿbä Ký(R\ÿû˜ %­Þè¿4¢ ŸýS
÷,•Þ^íË£Ìج@ýSƒ${ÿü@ÿü¡½ýá0(ÿ:Ïÿ¸‚ ÏùB^ÿ#6¯þ=B̾¢RȺTÎýƒ'Þ§¨ííˆd ÿƒ4^ãGû0?ñÈïü˜ˆ]0'ˆŽ¿þ@ÿ±=ÿÛ$1ÿ FÿÙ„´»Xÿý’ÐÅ$ÿÐt#ÜÉB*î?üTӍBhçÞí’¬
-þ!9ïåB'ŽþB"Ïÿ¸ˆˆˆ„ 6ˆïþ±_þ ¼ÿùˆ5 8Tˆÿ˘ˆ… ˆïþ,µM¶ˆÿý+‘ˆïõSNÖë0!ŸÞÓ,ÙBÉ1WïþQŽåBxˆÿýD¿{\g|ûˆ ˆŽÅNü¨€‚_÷}ÿäÅ1ïü³ Nwƒ_•þÂïü0GG/ÿ (žÿ@ÿϹ )ÿø–ï"GŽÿâÚÈ0%ˆßÿ˜SÛâíÞûÜùyÿüCs{œÆŽþíƒH­´=øsÂJÀFˆÿý•3µÕ 'ˆÿêÈ$ê`xˆþîÙ,"4¾þcÞÀ!8ïë"_e行WÌ?Ù$²xžÎë<û3–!%ÿä"³´OÃNíÜT -ÿèˆ.!F‹þSoÈo¹R!íÞȈBWˆˆÿý’¡!™tÏþ^ˆ èÃQmþÏ£é"aGÿý˜Ë$xÿÙ#ßÏÌÿ«ÄUÝÊ‚\ÞLëqÁ!xˆÿÄ"~Ÿ³ZSÖÔ^5%íîPß}ã¯Òö!­ïè€Îb’GÿØ"LíA+øÓlaÿü )ëÿ؈ Eþ]„žŽ˜‚ ªþܽ˜2xþåØÊ„@{û¼3Íû¤HŸÿÓ#ýólÿû”5]‚08ŽþÞ!ÎHŸýNÛƒ@ˆˆÌÿÙˆ‚,€#Œ¿ÿ˜ˆ@|¡#ÍïøˆÃHXŽßüCC“4hÇïD}^}‚_ïëA5÷- Gþå\²€Ý3‡…{üNяþK2þï0ÅmüÏý˜ˆ”#éïëTOÿ´ßÿEÓ0©"h‹¯ÿ¹€’‚89ïî1-xÊÇ-ÈÓ(2Žß¦³#ÎëNʃíú y®áQ7ÿý‘lýªø—F‹ÿü˜ˆˆ %Þµ½Þ¹„"Wß^üȈPWˆïëˆc HˆŽý¾ÚA2œÌϳt)ßR]8ÎÿÚƒ ÷/ü¸ÊC at X‹ÿû3Î 2HÍ4ïþ¸‚dßü ÿò ì[þ®ˆ5B$ÍÿêKc Xû2ÎÿZ<ÒÍäºcíC8îB$NÞ’<Å<þÙƒj2Gþžùˆ r¯ä*ÿÓ!üÑ$žÅÿÛ„3-Ó“$ßÒ½©"Žÿ³(ïLp7ÿÄ-þ"!ŒLûÞæxCB"»ïäÙ¸… $ü2Ïþ ο Xÿî¶b#‹“XŒÿûB³WŒý<þÈ…1†îè£íBÃ1½RhûÿÉR†– LÿDî·DÆ£Lÿû$¥OpxÿIÓ?ER5ÿÙˆLÞÑ%ﳎPDhÜW)ÿëˆ %þ¯ÿ˜F ‹üßÿ˜€
 g­ò%|ÿû˜€ÿòïþˆAWÿðîý×ÁHÓWŠÿü¨!zý$ßì˘@lÿ£ÿÛˆ€XØÏüÙLBWˆŽÿ눈1xŽØî쨈€XˆþÚí¸ˆXþëˆ1ÛGŒÿéˆ o€$hïü¢Äx¿ÿɈìË>ýü£/Û”KÕ½õØP ‹\æßÎȈ -·Ùß;ŒQíÖhˆŽÿ×N”3lÒVÎxíþË2]´Ãÿüyƒ#1—Ý„ŽÝ%XS?þ"8ˆ?ÿÃMìOܐ#$hüŸ£Ë 4TíÿƒB,í xüØþPÎ7ù 'íU;üþ˜€^½ßã8… h¿ò‰3æŸû5ƒÎFßÿ˜ >î÷ܯÐßÿˆ!²ÎÑÿì@xÿý“í¯Q	Œÿ ?ÿØ‹ÿüü0ˆÿق興Ïÿ¹ ®øHˆŸÿØ-¥!"Wˆÿý˜¦8ˆÿù 'ÿüþ¿èB#YÍÿøˆ .í¿B!ßý¨ %ˆŽéœþ¨„ ¸,Ç6Ÿÿ؁<"Ü'¯ïé0þÅ´oÿÙPˆÿ[ßþ˜#½ïå%Cê'2k”ßó߈ˆp7‰ÿÓIÝŽ’!ˆÿý”M¨0hÞÛM츬@!hˆÿšë¼#ÛV,ƒƒ•ßùˆÿý˜1óÖ!=üÍgOµÍQ)¿þ¸-BÔ4{üÿ˜#rÂGÿýsÍÓµ>ÿ’KÚ‚l$Ÿÿ,êJ„ FˆóÇ-ÿmÙ„ÁB#TŒþ*Õ´øP*ôßâÜ.ø‡!lçý¸Q½{ãˆÏû3R+ÿ2f$ÏÂ4R¯ÿÀžmÉ‚ Xÿ!Aÿ!~ÿè#^ÿƒ#ßõ$.ï“ F‹ÿòRï½Së&þ (ÿüQÂÿý CŸþ„Qxë5í_úHží¢%Ïÿ¹ŽÅÏýˆˆ „í³$<ÿû@Q5Íýßë@
¡iÛßû¹‡ ˆˆØßý¸„ ^ÿÕÈÎB*ˆˆÿÙˆ‚ XˆûˆÞc¾Ü¹HMýeÎR]Œ³‹Ïã#²<2nÞ_똀XÞ„nîêˆx¦ˆÿÙˆ#ñˆˆ¾ÿÔ"ÿ Kê邾;FbHˆÿý@ì,T"?TÍíÛ ïPLmžÄ׳ŽÃ2ƒ?ÿʁHWïHËïˆ!\ÂhÿÙˆ ;ƒhˆˆÿý˜ˆˆˆ‹íÿ¹F¤ WÈÿóÛ„l@þ¤åè½û Œßô³²HÛ¹nB²~ä"AXŸÿ _•iëV[Ø%ÿÒ5Ê$âýŠ¤1'ÿákÝûÔ¸3ý„æC#ˆïþ¸ 
ÞïR!*ïúùG3
 íۍì"W£7DØïÔì$ì1¨5cTÙ¾ó2!¾þDü¡CΆ<2{ÿüwBÛBˆÿ2ÏüUb"ïôÞ¼è€-BÌ‚OÿÊ3#Rø1¿è})C¨<íÐ-Û!HÞ6Ý=ü¨ˆ ˆüSÏÔ3·S¯ëÉû…R±ˆßø3ÝÜÉ0hùKîFHþ¿þÄ0XÿK̃¶H1#¿ÁOÿS#+¢;ÿ¸2CÜ¿$Xÿü¹ˆˆCnýØNÚ0>ç[ÿ=ÎÄ8û}õ>¿ÔBC"ˆþ‡lÞ܃û`H£V<è×½ÁÞë€ß1_ë3Ì¡(ÌÎÌKÔOôŒü®ì!‹Ì%ãú}D[Žú`~ÿëÏÓ"NÏô`8ÎÞÙ Ë&ÿR$^Ø^¯é4ƒ"&ÝãÿùR (ïÞ‘ßý]€>ïÀïå¼!B%‹ë®þ3'ã<Íë ,Í„˜7î½°Ÿÿ”°Œïû^ÚG!7Þïæ*A"\»5Ëß7ïÊ…%XˆÿZŒü†lÿÖ2¾¤S®ïâÜËÉ’xýn<³C"nï¸c-Ó3Õ(%ïþ1[ÝÄxŽÿ–»CHb)ÚŽýÄ2=ëqWÞûìzTH254ýt;íw)¾þÄQ"Oþ‚&LÿÃ5ƒ„=’4JþÝ£ÍÆIȼÖ)„S^‚Dîî3»¬ËC4xÏô5"ÎSLYÆ…ÕA;ØL»ûRL´ŠcyÝé5˜½í1&Ìí²©»Úr\¤½t«¶H´:Ú<v„\ÖM¥7ÞÄt4•I¼›œ“MÕXÈDw‚Më…X™ªv¼§µFDÆ{”8©wØœT»œÊVh½¼W˜©šuH͇82¾ÌéE3»„|…Ù|£µZ³TDlí¨Üe¹wCc$ÞÅj›†XC¤¼¹Ešdziy»»XmÖ4CD¾¼ÙR;Ȥ†{ÝÌ£"ZÛª!Ýî¥"M¦WS‹ÍÜTE¶3hÞÉ—C$›z¸gœ¼ÖF›ÈU3F¸ÍÛ¤5u›Ë…y‡Š˜U‰xwhŠ½ˆyÅT7‡hºÍ¤Dº»¤5‰ÝÜc$EkÛÆI»ÆˆZÆCG™»¬Èf˜SIy­Ü©4Ex†HŒy½Í«4U4›º…ZÛ»”4E»©»¹˜·UC'ÍÛ¼x¶Tx•vih¼Ë©t4G¬ÌyÌ»t$9EÍÊik̹CTD¬Ø»§wvˆeg«ˆË»¶DFS|ÌÈw«§TYˆºvG‹¼¹dEWÌÉFŠ¬wUEjš¹›{Ë„ET‹ª¦‡›¨–‡Eˆ›˜ª¼˜dEDz««ºË•UWˆ‡fk¹¼¦h…F¸ˆk‰¼…U…xx·ˆ¼É†UUas de 404

-; - chaque addresse est le deplacement dans le segment 600
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/SPRINT.PAS b/engines/mortevielle/original/0/SPRINT.PAS
deleted file mode 100644
index 1275ebc..0000000
--- a/engines/mortevielle/original/0/SPRINT.PAS
+++ /dev/null
@@ -1,50 +0,0 @@
-procedure fill_box(x,y,dx:integer);
-begin
-  box(15,Gd,pred(x) shl 3, pred(y) shl 3, pred(x+dx) shl 3, y shl 3, 255);
-end;
-
-procedure clear_box(x,y,dx:integer);
-begin
-  box(0,Gd,pred(x) shl 3, pred(y) shl 3, pred(x+dx) shl 3, y shl 3, 255);
-end;
-
-procedure writeg(l:str255;c:integer);
-
- var i, x, xo, yo : integer;
-     cecr : integer;
-     t:boolean;
-begin
-(*  debug('writeg : '+l);*)
-
-  if l='' then exit;
-  hide_mouse;
-  xo:=xwhere;
-  yo:=ywhere;
-  if res=2 then i:=6
-           else i:=10;
-  x:=xo+i*length(l);
-  case c of
-          1,3  : begin
-                   cecr:=0;
-                   box(15,Gd,xo,yo,x,yo+7,255)
-                 end;
-             4 : begin
-                   cecr:=0;
-                 end;
-             5 : begin
-                   cecr:=15;
-                 end;
-           0,2 : begin
-                   cecr:=15;
-                   box(0,Gd,xo,yo,x,yo+7,255);
-                 end;
-  end;
-  xo:=xo+1;
-  yo:=yo+1;
-  for x:=1 to length(l) do
-     begin
-       affcar(Gd,xo,yo,cecr,ord(l[x]));
-       xo:=xo+i;
-     end;
-  show_mouse;
-end;
diff --git a/engines/mortevielle/original/0/TABLE.PAS b/engines/mortevielle/original/0/TABLE.PAS
deleted file mode 100644
index 8373fce..0000000
--- a/engines/mortevielle/original/0/TABLE.PAS
+++ /dev/null
@@ -1,42 +0,0 @@
-var
-    indis, valfix,evol : integer;
-    un_huit:real;
-
-overlay procedure ctable(indis,valfix:integer);
-
-  var x,y : real;
-      Tb:array[0..255] of real;
-      k:integer;
-
-begin
-{-----------------------------------------------------------------------------}
-{                           CALCUL DE LA TABLE                                }
-{-----------------------------------------------------------------------------}
-(*  coef:=un_huit;*)
-  x:= freq0/indis;
-  Tb[0]:= indis;
-
-  for k:= 1 to 255 do
-     begin
-(*       if valfix=0 then
-          begin
-            x:=x*coef;
-            coef:= coef * (1 + ln(evol));
-            if evol<>1 then
-               begin
-               end;
-          end
-         else*)
-       x:= x+ valfix;
-       Tb[k]:=freq0/x;
-       y:=freq0/x - trunc(freq0/x);
-       if (y>0.5) then Tb[k]:=Tb[k]+1;
-
-     end;
-
-  for k:=0 to 255 do
-     begin
-       Tbi[k]:=trunc(Tb[k]);
-     end;
-
-end;
diff --git a/engines/mortevielle/original/0/TAFFICH.PAS b/engines/mortevielle/original/0/TAFFICH.PAS
deleted file mode 100644
index 2bf6601..0000000
--- a/engines/mortevielle/original/0/TAFFICH.PAS
+++ /dev/null
@@ -1,214 +0,0 @@
-procedure chardes( nom : str11; passe : long_integer; long : integer);
-     var i, p, l : integer;
-         b : byte;
-         f : file;
-   begin
-     (* debug('chardes'); *)
-     assign(f,nom);
-     {$i-}
-     reset(f);
-     testfi;
-     p:= 0;
-     while passe>127 do
-       begin
-         p:=p+1;
-         passe:=passe-128;
-       end;
-     if p<>0 then seek(f,p);
-     p:= trunc(passe);
-     l:= long+p;
-     i:= 0;
-     while l>0 do
-       begin
-         blockread(f,mem[$6000:i],1);
-         testfi;
-         l:= l-128;
-         i:= i+128;
-       end;
-     close(f);
-     for i:=p to long+p do mem[$7000:i-p]:=mem[$6000:i];
-     {$i+}
-   end;
-
-procedure charani( nom : str11; passe : long_integer; long : integer);
-     var i, p, l : integer;
-         b : byte;
-         f : file;
-   begin
-     (* debug('charani'); *)
-     assign(f,nom);
-     {$i-}
-     reset(f);
-     testfi;
-     p:= 0;
-     while passe>127 do
-       begin
-         passe:=passe-128;
-         p:=p+1;
-       end;
-     if p<>0 then seek(f,p);
-     p:= trunc(passe);
-     l:=long+p;
-     i:= 0;
-     while l>0 do
-       begin
-         blockread(f,mem[$6000:i],1);
-         testfi;
-         l:=l-128;
-         i:=i+128;
-       end;
-     close(f);
-     for i:=p to long+p do mem[$7314:i-p]:=mem[$6000:i];
-     {$i+}
-   end;
-
-procedure taffich;
-   const tran1 : array[136..140] of byte
-               = ( 121, 121, 138, 139, 120 );
-         tran2 : array[153..161] of byte
-               = ( 150, 150, 152, 152, 100,
-                   110, 159, 100, 100 );
-   var
-      i, m, a, b, cx, handle,
-      npal : integer;
-      lgt, lhandle           : long_integer;
-      nom                    : str11;
-      PalH,k,j : integer;
-      Alllum : array[0..15] of integer;
-
-begin
- a:= caff;
- if a in [153..161] then a:= tran2[a]
-                    else if a in [136..140] then a:= tran1[a];
- b:= a;
- if maff= a then exit;
- if a= 16 then
- begin
-  s.pourc[9]:= '*';
-  s.teauto[42]:= '*';
- end;
- if a= 20 then
- begin
-  s.teauto[39]:= '*';
-  if s.teauto[36]= '*' then
-  begin
-   s.pourc[3]:= '*';
-   s.teauto[38]:= '*';
-  end;
- end;
- if a= 24 then s.teauto[37]:= '*';
- if a= 30 then s.teauto[9]:= '*';
- if a= 31 then
- begin
-  s.pourc[4]:= '*';
-  s.teauto[35]:= '*';
- end;
- if a= 118 then s.teauto[41]:= '*';
- if a= 143 then s.pourc[1]:= '*';
- if a= 150 then s.teauto[34]:= '*';
- if a= 151 then s.pourc[2]:= '*';
- okdes:= true;
- hide_mouse;
- lgt:= 0;
- if ((a<>50) and (a<>51)) then
-   begin
-     m:= a+ 2000;
-     if (m> 2001) and (m< 2010) then m:= 2001;
-     if m= 2011 then m:= 2010;
-     if a= 32 then m:= 2034;
-     if (a= 17) and (maff= 14) then m:= 2018;
-     if a> 99 then
-       if (is= 1) or (is= 0) then m:= 2031 else m:= 2032;
-     if ((a> 69) and (a< 80)) or (a= 30) or (a= 31) or (a= 144)
-       or (a= 147) or (a= 149) then m:= 2030;
-     if ((a< 27) and (((maff> 69) and (not s.ipre)) or (maff> 99)))
-       or ((maff> 29) and (maff< 33)) then m:= 2033;
-     messint(m);
-     maff:= a;
-     if a= 159 then a:= 86 else
-      if a> 140 then a:= a- 67 else
-       if a> 137 then a:= a- 66 else
-        if a> 99 then a:= a- 64 else
-         if a> 69 then a:= a- 42 else
-          if a> 29 then a:= a- 5 else
-           if a= 26 then a:= 24 else
-            if a> 18 then a:= a- 1;
-     npal:= a;
-     for cx:= 0 to (a- 1) do lgt:= lgt+l[cx];
-     handle:=l[a];
-     nom:= 'DXX.mor';
-   end
- else
-   begin
-     nom:= 'DZZ.mor';
-     handle:= l[87];
-     if a= 51 then
-        begin
-          lgt:= handle;
-          handle:= l[88];
-        end;
-     maff:= a;
-     npal:= a+37;
-   end;
- chardes(nom,lgt,handle);
- if Gd=Her then
-    begin
-      for i:=0 to 15 do
-         begin
-           PalH:=memw[$7000:succ(i) shl 1];
-           Alllum[i]:=PalH and 15 + PalH shr 12 and 15 + PalH shr 8 and 15;
-         end;
-      for i:=0 to 15 do
-         begin
-           k:=0;
-           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
-           mem[$7000:2+k shl 1]:= Rang[i];
-           Alllum[k]:=-1;
-         end;
-    end;
- numpal:=npal;
- writepal(npal);
-
- if (b< 15) or (b= 16) or (b= 17) or (b= 24) or (b= 26) or (b= 50) then
-    begin
-      lgt:= 0;
-      if (b< 15) or (b= 16) or (b= 17) or (b= 24) or (b= 26) then
-         begin
-           if b= 26 then b:= 18 else
-              if b= 24 then b:= 17 else
-                 if b> 15 then b:= b- 1;
-           for cx:= 0 to (b- 1) do lgt:= lgt+ l[cx+89];
-           handle:=l[b+89];
-           nom:= 'AXX.mor';
-         end
-       else
-         if b= 50 then
-            begin
-              nom:= 'AZZ.mor';
-              handle:= 1260;
-            end;
-      charani(nom,lgt,handle);
-    end;
- show_mouse;
- if (a< 27) and ((maff< 27) or (s.mlieu= 15)) and (msg[4]<> entrer) then
-    begin
-      if (a= 13) or (a= 14) then person
-                            else if not blo then t11(s.mlieu, cx);
-      mpers:=  0;
-    end;
-end;
-
-(*    begin
-      for i:=0 to 15 do
-         begin
-           PalH:=memw[$7000:succ(i) shl 1];
-           Alllum[i]:=PalH and 15 + PalH shr 4 and 15 + PalH shr 8 and 15;
-         end;
-      for i:=0 to 15 do
-         begin
-           k:=0;
-           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
-           mem[$7000:2+k shl 1]:= Rang[i];
-           Alllum[k]:=-1;
-         end;
-    end;*)
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/TEST.COM b/engines/mortevielle/original/0/TEST.COM
deleted file mode 100644
index 1171cfb..0000000
Binary files a/engines/mortevielle/original/0/TEST.COM and /dev/null differ
diff --git a/engines/mortevielle/original/0/TESTPROT.PAS b/engines/mortevielle/original/0/TESTPROT.PAS
deleted file mode 100644
index d158bfe..0000000
--- a/engines/mortevielle/original/0/TESTPROT.PAS
+++ /dev/null
@@ -1,45 +0,0 @@
-{$i var.mor}
-function testprot : boolean;
-var
- regs : registers;
- buffer : array[0..511] of char;
- i,j,k : integer;
- test : array[0..2] of boolean;
- chaine : array[0..7] of char;
-begin
- test[0]:=false;test[1]:=false;test[2]:=false;k:=0;
- chaine[0]:=' ';
- chaine[1]:='M';
- chaine[2]:='A';
- chaine[3]:='S';
- chaine[4]:='T';
- chaine[5]:='E';
- chaine[6]:='R';
- chaine[7]:=' ';
- with regs do
-  begin
-   while (test[k]=false) and (k<2) do
-    begin
-     k:=k+1;
-     ax:=0;intr(19,regs);
-     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-     intr(19,regs);
-     test[k]:=true;
-     i:=0;
-     while (test[k]) and (i<19) do
-      begin
-       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
-      end;
-      for j:=0 to 7 do
-       if buffer[j+504]<>chaine[j] then test[k]:=false;
-    end;
-  end;
- testprot:=(test[1] or test[2]);
-end;
-
-
-
-BEGIN
-WRIteLN(testprot);
-END.
\ No newline at end of file
diff --git a/engines/mortevielle/original/0/TXX.INP b/engines/mortevielle/original/0/TXX.INP
deleted file mode 100644
index 755117e..0000000
Binary files a/engines/mortevielle/original/0/TXX.INP and /dev/null differ
diff --git a/engines/mortevielle/original/0/TXX.NTP b/engines/mortevielle/original/0/TXX.NTP
deleted file mode 100644
index 04fa8c5..0000000
Binary files a/engines/mortevielle/original/0/TXX.NTP and /dev/null differ
diff --git a/engines/mortevielle/original/0/VAR.MOR b/engines/mortevielle/original/0/VAR.MOR
deleted file mode 100644
index d88528d..0000000
--- a/engines/mortevielle/original/0/VAR.MOR
+++ /dev/null
@@ -1,481 +0,0 @@
-
-(*         Constantes, Types et Variables pour le
-
-              M A N O I R   DE   M O R T E V I E L L E
-
-                                                    ( version Nov 1988
-                                                             +
-                                                  musique & paroles Oct 88 )
-                                                                             *)
-
-
-(*---------------------------------------------------------------------------*)
-(*-------------------------   CONSTANTES   ----------------------------------*)
-(*---------------------------------------------------------------------------*)
-
-const
-       freq0 = 1.19318e6;
-
-       seg_syst = $6FED;
-       segmou   = $6F00;
-       segdon   = $6C00;
-       adani    = $7314;
-       adword   = $4000;
-       adtroct  = $406B;
-       adcfiec  = $4300;
-       adbruit  = $5CB0;(*2C00;*)
-       adbruit1 = $6924;(*3874;*)
-       adbruit2 = $6B30;(*3A80;*)
-       adbruit3 = $6BA6;(*3AF6;*)
-       adbruit5 = $3B50;
-       adson    = $5CB0;(*2C00;*)
-       adson2   = $60B0;(*3000;*)
-       offsetb1 = 6;
-       offsetb2 = 4;
-       offsetb3 = 6;
-
-       null = 255;
-
-       tempo_mus   = 71;
-       tempo_bruit = 78;
-       tempo_f     = 80;
-       tempo_m     = 89;
-
-       ti1 = 410;
-       ti2 = 250;
-       Maxti = 7975;
-       Maxtd = 600;
-       Max_rect = 14;
-
-       ams  = 0;
-       cga  = 1;
-       ega  = 2;
-       her  = 3;
-       tan  = 4;
-
-       c_repon   =    0;
-       c_st41    =  186;
-       c_tparler =  247;
-       c_paroles =  292;
-       c_tmlieu  =  435;
-       c_dialpre =  456;
-       c_action  =  476;
-       c_saction =  497;
-       c_dis     =  502;
-       c_fin     =  510;    {  =>   n'existe pas  ; si !! }
-
-       arega  =     0;
-       asoul  =   154;
-       aouvr  =   282;
-       achai  =   387;
-       acha   =   492;
-       arcf   =  1272;
-       arep   =  1314;
-       amzon  =  1650;
-       fleche =  1758;
-
-       no_choice = 0;
-       invent    = 1;
-       depla     = 2;
-       action    = 3;
-       saction   = 4;
-       discut    = 5;
-       fichier   = 6;
-       sauve     = 7;
-       charge    = 8;
-
-       attacher= $301;
-       attendre= $302;
-       defoncer= $303;
-       dormir  = $304;
-       ecouter = $305;
-       entrer  = $306;
-       fermer  = $307;
-       fouiller= $308;
-       frapper = $309;
-       gratter = $30A;
-       lire    = $30B;
-       manger  = $30C;
-       mettre  = $30D;
-       ouvrir  = $30E;
-       prendre = $30F;
-       regarder= $310;
-       sentir  = $311;
-       sonder  = $312;
-       sortir  = $313;
-       soulever= $314;
-       tourner = $315;
-
-       scacher  = $401;
-       sfouiller= $402;
-       slire    = $403;
-       sposer   = $404;
-       sregarder= $405;
-
-         tabdbc : array[0..17] of byte
-                 =(7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9);
-         tabdph : array[0..15] of byte
-                 =(0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10);
-         typcon : array[0..25] of byte
-                 =(0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3);
-         intcon : array[0..25] of byte
-                 =(1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
-         tnocon : array[0..363] of byte
-                 =(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
-                   0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0);
-
-
-     don :array[1..8,1..4] of byte
-               =(( 7, 37, 22,  8),
-                 (19, 33, 23,  7),
-                 (31, 89, 10, 21),
-                 (43, 25, 11,  5),
-                 (55, 37,  5,  8),
-                 (64, 13, 11,  2),
-                 (62, 22, 13,  4),
-                 (62, 25, 13,  5));
-
-     fic : array[1..2] of string[11]
-           = ( ' Sauvegarde',
-               ' Chargement' );
-
-     addv : array[0..1] of byte
-          = (8,8);
-
-     recom =' Recommence  ';
-
-            f3 = 'F3: Encore';
-            f8 = 'F8: Suite';
-
-         Max_patt = 20;
-
-
-        Rang : array[0..15] of byte
-             =(15,14,11,7,13,12,10,6,9,5,3,1,2,4,8,0);
-
-
-(*---------------------------------------------------------------------------*)
-(*--------------------------------   TYPES   --------------------------------*)
-(*---------------------------------------------------------------------------*)
-
-type   path_chars   =  string[11];
-       long_integer =  real;
-       str255       =  string[255];
-       str125       =  string[125];
-       str30        =  string[30];
-       str11        =  string[11];
-       fichier_byte =  file of byte;
-       sav_chaine   =  record
-                         conf : integer;
-                         pourc : array[0..10] of char;
-                        teauto : array[0..42] of char;
-                          sjer : array[0..30] of char;
-                        mlieu,iboul,ibag,icave,ivier,ipuit : integer;
-                        derobj,iloic,icryp : integer;
-                         ipre : boolean;
-                        heure : char;
-                     end;
-    registres = record
-                  ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
-                end;
-     phrase = array [1..1410] of char;
-     tabint = array [0..Maxti] of integer;
-        ind = record
-                indis : integer;
-                point : byte
-              end;
-     tabind = array [0..Maxtd] of ind;
-
-     tab_mlieu = array[1..7,0..24] of byte;
-
-        table = array[0..255] of real;
-      tablint = array[0..255] of integer;
-
-         word = integer;
-      chariot = record
-                  val,
-                  code,
-                  acc,
-                  freq,
-                  rep :integer;
-                end;
-
-   doublet = record
-               x,y:byte;
-             end;
-     tabdb = array[1..16] of doublet;
-     tfxx  = array[0..107] of integer;
-     rectangle = record
-                   x1, x2, y1, y2 : integer;
-                   Etat : boolean;
-                 end;
-
-     mult_rect = array[1..Max_rect] of rectangle;
-     str40 = string[40];
-
-        pattern = record
-                    tay, tax : byte;
-                    des : array[1..Max_patt, 1..Max_patt] of byte;
-                  end;
-
-
-         nhom = record
-                  n : byte;   (* numero entre 0 et 32 *)
-                  hom : array[0..3] of byte;
-                end;
-
-         t_nhom = array[0..15] of nhom;
-
-         t_pcga = record
-                    p : byte;
-                    a : t_nhom;
-                  end;
-
-         pal_cga = array[0..90] of t_pcga;
-
-
-(*---------------------------------------------------------------------------*)
-(*------------------------------   VARIABLES   ------------------------------*)
-(*---------------------------------------------------------------------------*)
-
-var
-     blo,
-     bh1,
-     bf1,
-     bh2,
-     bh4,
-     bf4,
-     bh5,
-     bh6,
-     bh8,
-     bt3,
-     bt7,
-     bh9,
-
-     sonoff,
-     main,
-     choisi,
-     test0,
-     f2_all,
-     imen,
-     cache,
-     iesc,
-     perdu,
-     col,
-     syn,
-     fouil,
-     zuul,
-     tesok,
-     obpart,
-     okdes,
-     solu,
-     arret,
-     anyone,
-     brt,
-     rect,
-     rech_cfiec,
-     active_menu : boolean;
-
-
-     x,
-     y,
-     t,
-     vj,
-     li,
-     vh,
-     vm,
-     jh,
-     mh,
-     cs,
-     Gd,                (*  Gd = graph device  *)
-     hdb,
-     hfb,
-     heu,
-     jou,
-     key,
-     min,
-     num,
-     max,
-     res,
-     ment,
-     haut,
-     caff,
-     maff,
-     crep,
-     ades,
-     iouv,
-     inei,
-     ctrm,
-     dobj,
-     msg3,
-     msg4,
-     mlec,
-     newGd,
-     c_zzz,
-     mchai,
-     menup,
-     ipers,
-     ledeb,
-     lefin,
-     mpers,
-     mnumo,
-     xprec,
-     yprec,
-     perdep,
-     prebru,
-     typlec,
-     num_ph,
-     xwhere,
-     ywhere,
-     numpal,
-     lderobj,
-     nb_word,
-     ptr_oct,
-     k_tempo,
-     ptr_tcph,
-     ptr_word,
-     color_txt : integer;
-
-    t_cph  : array[0..6400] of integer;
-    tabdon : array[0..4000] of byte;
- (*   t_dxx  : array[0..121] of integer;*)
-    stpou  : str125;                             (* donne le % d'indices *)
-    is     : byte;
-    mode   : char;
-    ficdes : fichier_byte;
-   al_mess,
-  err_mess,
-  ind_mess,
-  al_mess2 : str125;
-
-      invt,
-     nbrep,
-    nbrepm,
-      disc : array[1..8] of integer;
-       msg : array [0..4] of integer;
-      depl : array[1..7] of integer;
-      inv  : array[1..8] of string[22];
-      dep  : array[1..7] of string[23];
-      act  : array[1..21] of string[10];
-      self : array[1..5] of string[11];
-      dis  : array[1..8] of string[5];
-      touv : array[1..7] of char;
-      s,s1 : sav_chaine;
-    bufcha : array[0..390] of byte;
-
-   lettres : array[1..6,0..23] of byte;
-
-    PalHer : array[0..15] of byte;
-
-         T_mot : tabint;
-     Tay_Tchar : integer;
-         T_rec : tabind;
-        Sauv_T : file of ind;
-        FiByte : file;
-        v_lieu : tab_mlieu;
-             l : tfxx;
-           Tbi : tablint;
-    c1, c2, c3 : chariot;
-        addfix : real;
-        palsav : pal_cga;
-        Tabpal : array[0..90] of tabdb;
-        palcga : pal_cga;
-           tpt : array [0..14] of pattern;
-
-
-
-(*---------------------------------------------------------------------------*)
-(*--------------------   PROCEDURES  ET  FONCTIONS   ------------------------*)
-(*---------------------------------------------------------------------------*)
-
-procedure box(c,Gd,xo,yo,xi,yi,patt:integer); external 'c:\mc\boite.com';
-
-procedure hirs;
-const tandy:array[0..13] of byte
-           =(113,80,90,14,63,6,50,56,2,3,6,7,0,0);
-      herc:array[0..12] of byte
-        =(50,40,41,9,103,3,100,100,2,3,0,0,0);
-   var i, j : integer;
-begin
-  case Gd of
-    cga :
-     begin
-       graphcolormode;
-       graphbackground(0);
-       Palette(1);
-       res:=1;
-     end;
-    ams :
-     begin
-       hires;
-       inline($B8/6/0/        (*  =>  mov ax,6 *)
-              $CD/$10);       (*  =>  int 16   *)
-       port[$3D9]:=15;
-       port[$3DF]:=0;
-       port[$3DD]:=15;
-       res:=2;
-     end;
-    ega :
-     begin
-       inline($B8 / 14 / 0 /     (*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs *)
-              $CD / $10);        (*  INT 16  *)
-       res:=2;
-     end;
-    her :
-     begin
-       port[$3BF]:=3;
-       port[$3B8]:=2;
-       for i:=0 to 12 do
-       begin
-         port[$3B4]:=i;
-         port[$3B5]:=herc[i];
-       end;
-       inline($FC/$B9/$00/$80/$B8/$00/$B0/$8E/$C0/$31/$FF/$31/$C0/$F3/$AB);
-       port[$3B8]:=10;
-       res:=2;
-     end;
-    tan :
-     begin
-       port[$3D8]:=0;
-       port[$3DA]:=3;
-       port[$3DE]:=$14;
-       for i:=0 to 13 do
-         begin
-           port[$3D4]:=i;
-           port[$3D5]:=tandy[i];
-         end;
-       port[$3DA]:=2;
-       port[$3DE]:=0;
-       port[$3D8]:=port[$3D8] or 11 and $EF;
-       port[$3Dd]:=port[$3Dd] or 1;
-       port[$3DF]:=port[$3DF] or $c0;
-       box(0,gd,0,0,640,200,255);
-       res:=1;
-     end;
-  end;
-end;
-
-procedure affput(Chx,Gd,x,y,coul,char:integer);external 'c:\mc\divaf.com';
-
-procedure affcar(Gd,x,y,coul,char:integer);
-begin
-  if res=1 then affput(1,Gd,(x shr 1),y,coul,char)
-           else affput(1,Gd,x,y,coul,char);
-end;
-
-procedure putpix(Gd,x,y,coul:integer);
-begin
-  affput(0,Gd,x,y,coul,0);
-end;
diff --git a/engines/mortevielle/original/0/ZUUL.COM b/engines/mortevielle/original/0/ZUUL.COM
deleted file mode 100644
index 4436635..0000000
Binary files a/engines/mortevielle/original/0/ZUUL.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFF.COM b/engines/mortevielle/original/1/AFF.COM
deleted file mode 100644
index d64d397..0000000
Binary files a/engines/mortevielle/original/1/AFF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFFAMS.COM b/engines/mortevielle/original/1/AFFAMS.COM
deleted file mode 100644
index 577fd5a..0000000
Binary files a/engines/mortevielle/original/1/AFFAMS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFFEGA.COM b/engines/mortevielle/original/1/AFFEGA.COM
deleted file mode 100644
index 6fd86b9..0000000
Binary files a/engines/mortevielle/original/1/AFFEGA.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFFHER.COM b/engines/mortevielle/original/1/AFFHER.COM
deleted file mode 100644
index 9f7be45..0000000
Binary files a/engines/mortevielle/original/1/AFFHER.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFFICH.COM b/engines/mortevielle/original/1/AFFICH.COM
deleted file mode 100644
index 22085db..0000000
Binary files a/engines/mortevielle/original/1/AFFICH.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AFFTAN.COM b/engines/mortevielle/original/1/AFFTAN.COM
deleted file mode 100644
index ac01221..0000000
Binary files a/engines/mortevielle/original/1/AFFTAN.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/AXX.MOR b/engines/mortevielle/original/1/AXX.MOR
deleted file mode 100644
index 81954bd..0000000
Binary files a/engines/mortevielle/original/1/AXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/AZZ.MOR b/engines/mortevielle/original/1/AZZ.MOR
deleted file mode 100644
index 55088f3..0000000
Binary files a/engines/mortevielle/original/1/AZZ.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/BMOR.MOR b/engines/mortevielle/original/1/BMOR.MOR
deleted file mode 100644
index 51f3378..0000000
Binary files a/engines/mortevielle/original/1/BMOR.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/BOITE.COM b/engines/mortevielle/original/1/BOITE.COM
deleted file mode 100644
index e274143..0000000
Binary files a/engines/mortevielle/original/1/BOITE.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/CFIEC.MOR b/engines/mortevielle/original/1/CFIEC.MOR
deleted file mode 100644
index 2038c7c..0000000
Binary files a/engines/mortevielle/original/1/CFIEC.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/CFIPH.MOR b/engines/mortevielle/original/1/CFIPH.MOR
deleted file mode 100644
index a1493e8..0000000
Binary files a/engines/mortevielle/original/1/CFIPH.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/CGA.COM b/engines/mortevielle/original/1/CGA.COM
deleted file mode 100644
index 5ed874a..0000000
Binary files a/engines/mortevielle/original/1/CGA.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/CHARDES.COM b/engines/mortevielle/original/1/CHARDES.COM
deleted file mode 100644
index 252d639..0000000
Binary files a/engines/mortevielle/original/1/CHARDES.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/CHARECR.COM b/engines/mortevielle/original/1/CHARECR.COM
deleted file mode 100644
index 6cb6bcf..0000000
Binary files a/engines/mortevielle/original/1/CHARECR.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/CXX.MOR b/engines/mortevielle/original/1/CXX.MOR
deleted file mode 100644
index df5d947..0000000
Binary files a/engines/mortevielle/original/1/CXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/DEC.MOR b/engines/mortevielle/original/1/DEC.MOR
deleted file mode 100644
index 01d5913..0000000
Binary files a/engines/mortevielle/original/1/DEC.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/DECOMP.COM b/engines/mortevielle/original/1/DECOMP.COM
deleted file mode 100644
index 4489ceb..0000000
Binary files a/engines/mortevielle/original/1/DECOMP.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/DECPASP.COM b/engines/mortevielle/original/1/DECPASP.COM
deleted file mode 100644
index 326c26f..0000000
Binary files a/engines/mortevielle/original/1/DECPASP.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/DEMUS.COM b/engines/mortevielle/original/1/DEMUS.COM
deleted file mode 100644
index 97c1c6f..0000000
Binary files a/engines/mortevielle/original/1/DEMUS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/DEMUS2.COM b/engines/mortevielle/original/1/DEMUS2.COM
deleted file mode 100644
index 97c1c6f..0000000
Binary files a/engines/mortevielle/original/1/DEMUS2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/DIVAF.COM b/engines/mortevielle/original/1/DIVAF.COM
deleted file mode 100644
index dc61b0c..0000000
Binary files a/engines/mortevielle/original/1/DIVAF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/DXX.MOR b/engines/mortevielle/original/1/DXX.MOR
deleted file mode 100644
index cc8f845..0000000
Binary files a/engines/mortevielle/original/1/DXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/DZZ.MOR b/engines/mortevielle/original/1/DZZ.MOR
deleted file mode 100644
index 0b1df4e..0000000
Binary files a/engines/mortevielle/original/1/DZZ.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/FXX.MOR b/engines/mortevielle/original/1/FXX.MOR
deleted file mode 100644
index f8f47bb..0000000
Binary files a/engines/mortevielle/original/1/FXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/LITPH4.COM b/engines/mortevielle/original/1/LITPH4.COM
deleted file mode 100644
index f374940..0000000
Binary files a/engines/mortevielle/original/1/LITPH4.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/MENUFR.MOR b/engines/mortevielle/original/1/MENUFR.MOR
deleted file mode 100644
index d773958..0000000
Binary files a/engines/mortevielle/original/1/MENUFR.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.000 b/engines/mortevielle/original/1/MORT.000
deleted file mode 100644
index 5d70cc5..0000000
Binary files a/engines/mortevielle/original/1/MORT.000 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.001 b/engines/mortevielle/original/1/MORT.001
deleted file mode 100644
index d646f33..0000000
Binary files a/engines/mortevielle/original/1/MORT.001 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.002 b/engines/mortevielle/original/1/MORT.002
deleted file mode 100644
index 1756f54..0000000
Binary files a/engines/mortevielle/original/1/MORT.002 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.003 b/engines/mortevielle/original/1/MORT.003
deleted file mode 100644
index 3e97c6e..0000000
Binary files a/engines/mortevielle/original/1/MORT.003 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.004 b/engines/mortevielle/original/1/MORT.004
deleted file mode 100644
index ab9f969..0000000
Binary files a/engines/mortevielle/original/1/MORT.004 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.005 b/engines/mortevielle/original/1/MORT.005
deleted file mode 100644
index d1ad3ca..0000000
Binary files a/engines/mortevielle/original/1/MORT.005 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.006 b/engines/mortevielle/original/1/MORT.006
deleted file mode 100644
index 60dff2a..0000000
Binary files a/engines/mortevielle/original/1/MORT.006 and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.COM b/engines/mortevielle/original/1/MORT.COM
deleted file mode 100644
index f39b611..0000000
Binary files a/engines/mortevielle/original/1/MORT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/MORT.ZIP b/engines/mortevielle/original/1/MORT.ZIP
deleted file mode 100644
index 307df35..0000000
Binary files a/engines/mortevielle/original/1/MORT.ZIP and /dev/null differ
diff --git a/engines/mortevielle/original/1/MUSINT.COM b/engines/mortevielle/original/1/MUSINT.COM
deleted file mode 100644
index a8fd455..0000000
Binary files a/engines/mortevielle/original/1/MUSINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/MUSINT2.COM b/engines/mortevielle/original/1/MUSINT2.COM
deleted file mode 100644
index 9ef47df..0000000
Binary files a/engines/mortevielle/original/1/MUSINT2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/MXX.MOR b/engines/mortevielle/original/1/MXX.MOR
deleted file mode 100644
index 73c732d..0000000
Binary files a/engines/mortevielle/original/1/MXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHBRUI.MOR b/engines/mortevielle/original/1/PHBRUI.MOR
deleted file mode 100644
index 4b07358..0000000
Binary files a/engines/mortevielle/original/1/PHBRUI.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINT.COM b/engines/mortevielle/original/1/PHINT.COM
deleted file mode 100644
index 87ea93e..0000000
Binary files a/engines/mortevielle/original/1/PHINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINT2.COM b/engines/mortevielle/original/1/PHINT2.COM
deleted file mode 100644
index 9d79eef..0000000
Binary files a/engines/mortevielle/original/1/PHINT2.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINTBAK.COM b/engines/mortevielle/original/1/PHINTBAK.COM
deleted file mode 100644
index 0191fce..0000000
Binary files a/engines/mortevielle/original/1/PHINTBAK.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINTCOM.COM b/engines/mortevielle/original/1/PHINTCOM.COM
deleted file mode 100644
index 0191fce..0000000
Binary files a/engines/mortevielle/original/1/PHINTCOM.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINTDEF.COM b/engines/mortevielle/original/1/PHINTDEF.COM
deleted file mode 100644
index b167519..0000000
Binary files a/engines/mortevielle/original/1/PHINTDEF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINTGM.COM b/engines/mortevielle/original/1/PHINTGM.COM
deleted file mode 100644
index 4ec9edd..0000000
Binary files a/engines/mortevielle/original/1/PHINTGM.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PHINTUK.COM b/engines/mortevielle/original/1/PHINTUK.COM
deleted file mode 100644
index d47dc09..0000000
Binary files a/engines/mortevielle/original/1/PHINTUK.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/PLXX.MOR b/engines/mortevielle/original/1/PLXX.MOR
deleted file mode 100644
index e867b3b..0000000
Binary files a/engines/mortevielle/original/1/PLXX.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/PUTPIX.COM b/engines/mortevielle/original/1/PUTPIX.COM
deleted file mode 100644
index 3e41fcd..0000000
Binary files a/engines/mortevielle/original/1/PUTPIX.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/REUS.COM b/engines/mortevielle/original/1/REUS.COM
deleted file mode 100644
index 44678b2..0000000
Binary files a/engines/mortevielle/original/1/REUS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/REUSINT.COM b/engines/mortevielle/original/1/REUSINT.COM
deleted file mode 100644
index 638a7ba..0000000
Binary files a/engines/mortevielle/original/1/REUSINT.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/SAUVECR.COM b/engines/mortevielle/original/1/SAUVECR.COM
deleted file mode 100644
index 8e8d6c9..0000000
Binary files a/engines/mortevielle/original/1/SAUVECR.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/SAV0.MOR b/engines/mortevielle/original/1/SAV0.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/1/SAV0.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/SAV1.MOR b/engines/mortevielle/original/1/SAV1.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/1/SAV1.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/SAV2.MOR b/engines/mortevielle/original/1/SAV2.MOR
deleted file mode 100644
index 0e2297b..0000000
Binary files a/engines/mortevielle/original/1/SAV2.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/SAV3.MOR b/engines/mortevielle/original/1/SAV3.MOR
deleted file mode 100644
index 9df463e..0000000
Binary files a/engines/mortevielle/original/1/SAV3.MOR and /dev/null differ
diff --git a/engines/mortevielle/original/1/SONMUS.MOR b/engines/mortevielle/original/1/SONMUS.MOR
deleted file mode 100644
index f9bc2a0..0000000
--- a/engines/mortevielle/original/1/SONMUS.MOR
+++ /dev/null
@@ -1,9 +0,0 @@
-ˆ™ˆˆ˜ˆ‡†w‡fw‡wˆˆˆˆ‰ˆŠˆ«‰»š¸‹§xˆhˆhˆˆˆxˆˆxˆˆ˜ˆˆˆˆxg‡v†h‡xxˆ‰ˆ‰‰™‡˜Šˆ‡‰ˆxw‡hWˆhxx¨˜Š˜™‰š›©«‹©‰ˆx†x‡x‡xˆh‡xˆhˆ˜‰x˜‰ww‡gvx‡x‡šˆ‰™™˜‰˜™‡ˆ˜xfˆvWwwxwˆŠ‡Šˆ©˜ºš«¸›¹ˆˆx‡ˆvywˆˆxˆˆˆxˆˆ˜ˆˆˆvwvvh‡h‡ˆ‰ˆˆ™‰ˆ™‰ˆˆ‰—xwˆuwx‡‡xš‰‰Š¸˜¹›©ºˆ»‡ˆx‡gxvxwˆ‡x‡x‡y‡‰˜Š‡˜xX…h†ˆ‡‰ˆ˜˜š¨zˆ©˜xˆ˜gh†vgg‡xv‰˜x¨‹‰š›«©š¹™˜x˜w†x‡hxˆ‰x˜‡ˆx‰‰˜ˆ˜xvfwggxˆx‡‰ˆ‰ˆŠ˜™ˆ‰—ˆwxgv‡xx‡‰Šˆ‰›‰ª©«¹Šº‰ˆˆˆwxeˆfxwˆˆxˆˆ‡ˆ˜™ˆŠxˆfwv†w˜ˆ‡y¨‰‰ˆ©¨‰ˆˆxwxvgvxvwx˜ˆ™y©šºŠË˜«©©xyˆˆvg‡gx‡˜ˆˆ˜ˆˆy˜‰ˆˆ‡hfhehv‰g‡˜yˆ˜ª‰ˆ©ˆ‡x‰vwˆxvx˜ˆˆš˜Š™»©«¨»˜ˆ˜ˆw‡†fhfwgˆ‰‡‰ˆ‡ˆ™‰ˆ™ˆˆwxgv‡ˆhˆy˜ˆš©˜ˆ©ˆ†hˆ†Vx‡ggh¨hˆš˜‹»š»z»™Š‰˜ˆˆx†eyv‡ˆ‰ˆˆˆ˜y—z˜‰‡yuˆUhW‡gx‡‰‡z¸‰‰™˜xw‰‡gˆˆ…ˆˆˆ†{‰©‹»»¹Šº˜yˆ‰—h‡xef‡hgy˜ˆxˆ‰ˆˆy©‡x™v‡gx†hˆˆ—y¨š§Š¨y…ˆ†xuˆwwgx‡hˆˆšº›¼¹›š¨ˆ‰ˆ©ˆy‡‡fX‡h‡Š‡‰‡Š–z‡‰‡‰wxVwgffˆˆxx™©ˆš˜xˆˆ‡†h¨ˆˆyˆ‡x—k—«Ê»º«˜‰—wšh˜‡wfgfVˆg‰x‰‰‡‰ˆˆˆ‰‰˜ˆˆ‡h†g˜x—xš¨ˆ™‰˜wx†wgx—fˆh‡xX™ˆ««Ë‹»˜šg¨ˆŠˆš‡x…iujwˆ‡‰‰—™i§ˆˆ‰i¦hfˆUxH–†xˆ˜ˆ™‰˜hˆ‡hˆˆ‰ˆ™˜‰g©Y¨›¹¼¸«ºh¨y—‡ˆ‡ˆugvfXxh†Šx¨ˆˆ‰‡ˆy¨y˜‰‡‡h†ˆvyˆˆˆ‰¨‰xy‡fxˆgxˆˆˆxxˆˆ‹¹«»‹¹Šyx¸‡‰ˆ™x‡ˆwggˆg‡y‰™y¦Šwh™‡z†‰vwvgeh˜xˆ‰¨‡xˆxgg™ˆ˜›¨™˜Šˆš˜›É›ª™©—x‰˜hˆwhwfggVg
 xvˆ¨y˜Š‡‰‡ˆºˆª‰¨y†ˆe‡‡ˆ†y˜x†i…wwh‡‡i˜‡‰ˆ‡š™ª¼˜¬¸ˆ¸ˆ—‰˜ˆˆˆyˆ‡Y˜Uxgh‡˜ˆ¨˜‰x—y·x¨ˆgˆgVfhxˆwˆ‡‡X‡whx‰˜‰»‰©{™‰¸¬›¹šËˆ¨z™f™yexexU†ggUh†X—y™ˆª‡y˜ª©›Éˆšˆuwg‡xwx‡vfˆWgvˆg—x›wˆ‹ˆª«º«¨¼˜©g¹‰x¸ywˆ–yw†hvVwgg‰ˆ™˜˜‰y˜ˆšš§ˆ–ˆeXfˆW‰†XVw‡Ui‰ˆx»˜ºŠ¹˜ÈŒ»»™¬¸‰˜k—x‡h†V‡gwVfVgTˆV‡x¹Š¨‰Š‰¸œÊ›È›¨v…h†XvheVWueVˆh‡xª‡˜¨‹¸«¼¼˜¼ˆºh™ˆªx…˜†i‡ˆx…ugeU˜U‰ˆ«x˜ˆ™x©º¹ŠºˆhtivVhˆUeWhVgy‰ˆ›™©Š©›¸¼ª¼¹»¨—š‡—‰˜VˆWvgwX„gfUUfvX˜Š˜š‰º‰«¼»»¼¸št{…Ug‡VeEuUFh†Wˆ™yŠˆ›©«Ì›Ë‹Él–k·‹y¶hˆj…y‡h…WeGeX•X™™ˆyšw˜‹Ê›¹¬§f˜WuVvhdUuWUy–‰y¹©‹‹·Ë|ÊÌȌƫ†x¨ˆx‡…f‡WfˆthUfTVUˆU‹‰ˆªªŠ»›ËËÌ›Êw¸†vWueUUUEFu…Xhˆˆˆ‰¨ª¬ÊÌ»œ¹˜Šg¸Š™z·Xx—wx—wvUfWTU˜Xh‰x¹ˆ‰º©›Ëº»ˆ©—XUxUFUVUEjˆfˆŠ¹w«šºË»Ü¸œ©¨xx‰‰—x˜Vuh–VwwweUf…E†wxh™©™¹¼¬»¬Ü‹»yˆˆ‡F†TUUETVehfˆxˆˆˆ¨­È¬Ük»¶k§Y¹›˜Š¨wˆx¥Y‡‡wVVeUE‡U…kˆŠ˜‹©©œ»¼™»¨™vV‡EUVTfUwgˆˆ‰›‡¼‡½»»Ì™¼…©g˜gªj†h˜Fw‡gg—W•H„XTX‡ex‰«˜ºÌ™¼ÌË»«¨ˆˆxvUTUdEEvUwWŠxh¨{¹½É͈¼µzujµ[¹¹x›…zw‡wyf‰eVguUWfV‰¨z§›ª›šË»›º»wf†WTE…EEh™UŠ©‰™iÉ›¹Í»»ŠÊW†wXµj™–g™ee›dx‰W§vExdF—Uˆ©˜¬ª»¼É¬Ìš»¨ˆˆˆVtEUETFwTX–y‡ˆª›¬Ë¼Ù«¸ˆwgx—k¸‹wŠ•Z†‰fy–zvgwWUvvU˜ˆw›‰©›»»»¹»¸Y§fdUeUEV‰uj‰ºh‹ˆš
 ÉœŲ̂¼¦xUxuY—y¦X‡f†huh¨‡x…VvVG…u‰©‰»¼¹«Ë«Ì‹¼˜ˆˆˆeTUEdD‡EhV˜yw›¨œ¼×ζÄZeV—WŠy¨ˆ†˜gx†X˜‡y˜uxhVugujuš‰º‰»º«º¼˜»†‡weEdFUgf‰gª©y§›™¼Ë¼Û‹¹ˆtVvXfxˆ†e‰gV‰‡gˆ˜z–wfˆeY‡W‹‰««É›¼ªº»‹»ˆˆ‡VdFTEDYD†Y©—h»xÙ­ÌÛ¸­µ‡EztX‰‡y‡w˜eX‰†W»v˜ˆ‡xfW†E‡x‰y»™‹»¹«È«¹w˜uXDVUUX—v[›ˆš{ˆ»Ì¼ÌÚˆˆˆˆ‡TT™UgewWfE¸xg˜¨h¨fŠ…g‰v‡›™«º›»»¨¼š»¸¨†™sITG4xE†U{—‰–‹¹¼ËÌË»¨¹uUvuY…ˆh†wY†…[ˆv«w™˜w‰†Uh–H‡z»§œ›«‡Ë›É‰xštTeUTWV§Uš{¸‰šºœÌ«Ý¨ˆˆˆˆ†…FtHexTWg†Jˆˆ‡z™ˆ‰x©vX™…Šš»º¨¼º‰‰Ìš˜ªˆutEV3ewFWv‹˜ˆŠ¹ŒËÍË˼ˆˆ…gU—U‡g…hUx†Uk§g‰«‡xŠf¨Ty…fŠ›¸jº»¦Œ©ÌŠ›¨geEeDtXˆV˜k¹—›šÊ«ÜÌȈˆˆˆˆˆduGTeFUUhfw‰w˜™™ˆ™Šy¦hi—ˆË‹›Ê»©¸‹«É›ˆˆ†WTD6TXvUw©yv»¨œÛËݘɈˆe†WV…WWtVxex·Wˆ¹j™¨z˜ˆ‡xU‰uxŠ©¸šÉ{—›»«yÈyeUDUEWˆ…h¸Œ¶Œ˜¼ËËͨˆˆˆˆˆˆeUvCuTXTwˆfy‡šˆ™™Šˆ§h‡w‹f»šË{ȼ†‹¼©«¸‰†VDuCTiufX·k¶lº«ÌÌͨ¨ˆˆˆ…VevUUTxTygˆwzºgª™ˆˆ‰ˆVgˆg…‹Éˆ»¹©‡Œ¼·|¸‹”GeDUH˜v—{»ˆš›»»Ì˜ˆˆˆˆˆ†FtEUDUFgVˆX˜›—Š‰¹y¨ˆ‡g‰—ˆ¨¼ª»»‹©k¼ºˆ»ˆˆ…DTSGWh„‹‡ª‡‹‹Ë©Í˘ȈˆuUXdXdUuWVg‹‡‡‹¸ˆ™‹‡yˆ†vvx†i›¸Œ§»—‰ŒÈ‹»‹¸ufTUDZxe™‹œ¥Œº‹Ë¼ËˆˆˆˆˆˆeTFTFeE‡T˜i•z˜Š˜ª˜x¹gˆvˆj¶œº‹»‹·z»{Ùœ¨ˆˆG„4ETwxhj¸[˜©§»Ë܇šˆY¥U…G„HTUwXU©‰‰ˆ©y©˜ˆ˜†xgT˜Xh«Æ
 Œ¹º‰‰«œÇŒÈ‹dkSUdj‡‡iœ˜hÌx‹¼Ê»˜ˆˆˆˆ…WDUEUDuWU‰vˆ‰¨yŠ©‰‰«‡ˆWŠ˜vŒ»¨»Ëª™šÌÇ‹ˆˆˆvUDEDy¦Gš¸{¦Z¹‹‹Ë̘Œ¨wUUWdUVuV…Y˜i©ˆŠ¨™‹·i˜hvVfyu‰ºŒ§œ¸‰ˆ»»Ê‹©¸UWdETj§Xw¬™Š™ºª¼ºÉˆˆˆˆ†uEUEUUeVvwY–h™ˆxºŠ‡›‰˜Vˆ†xh›¹»›Ì¨º¬Ë«¨ˆˆˆFTU5V¨X„«ÈˆxÊZ¹œ¼ºˆ«ˆ…UWDeFeVUˆˆ‡‹†‹¸ˆŠ¸‰ˆ–xVVvˆU‹»·»‹»ˆ©¼Éœ¨»ˆfWTUUy˜Uš˜ª·Šš›¼È›ˆˆˆˆeDETeTVhexW©W™ˆ‰‰‹¸‰¹˜˜VˆˆU‰©ºª¼Ì©»»ÌˆˆˆˆˆfCuEhwYw‰¸{w˜y»›È«›º…wTUTWTXTzˆxªŠ¸z¸z¹h¸i‡gdhXVX‹¹˜º¹¹š¬Êª¼{»eXv5uWˆZuŒ§ªˆ«Š¬º»˜ˆˆˆdeSXTUUVew‰ešv‹—x»©¸{ˆ˜VW‡vWŠÊ«›Ì˨¼Ü¸ˆˆˆˆˆdfDIªF—I»eˆ˜z©»¬ËWÉguEUDgTUWgˆyªª˜‹»ˆ¨ª‡ˆ—htWheeŠª‡»»ª‹›Ü›ªœ¹‡ggtEwZµFkƈˆ»¨»¼¸¨ˆˆˆcwDUEeUGghvy˜ˆ¨Šª‡¬˜©Š†fdxuXy»œ«¼Ê¹œÌ¼˜ˆˆˆˆˆUdFˆ•vh‹uxxx¸œ««Æ[¶UDeDWFfggˆ›ˆ»¸›šÊ‡«—‰—idWTxtHš˜‰«ªºšÌ̋ʼˆ…WuUUˆˆ†h‰ªh‹¸‹œÈ›ˆ‡˜deTDUGUVeI‡ˆˆŒ…ª¹Š»™ššˆuVTyUX‹ºš¼É»»¼Ìº©ˆˆˆˆˆEwF™tXhÇE©g·›º‹ØGÊuEe5WETXVˆˆˆË©»Š»˜Š»‡˜˜xtFgdVi©†»ª›¨›ÌÌ«Êȇ‡wEVW¨XuŠ¸Š…Œ¥¼Š»¨ˆˆ‡t5UCeUE„hˆˆˆˆˆ™»˜»ºŠ¨ŠuwTW‡Fˆ«¸¬È½‰¼¬Ú«˜ˆˆˆˆ†WuX¦Fe›UˆX˜kÈ‹Ë…{¶EdE5„Efˆˆˆˆˆ¼ºªÌxºŠ¸™‰‡uuE–TX¨—‹x»˜kÌ«Ì›¼¹ggvfTy•Xxˆ«…‹§¼˜¬Èˆˆˆ…TEDTFEUVˆˆˆ‰ˆªªšz»™‹©w†UU‡Eh©ª˜Ëȼš¬ÌË»ˆˆˆˆˆˆuwxfdzYuVªHºº««fºeDTTDeEx
 ˆˆˆˆ‹«¹»º©›¸‰¹x……UxeVhŠ—k¨©ª‹Ìˬ»Èˆˆˆ…EuyuXw¨y˜y¸‰¼§«™x§EEEDEDXUxˆˆˆˆŠ¹ªz«¨›š¨ˆvuWeV—‹™¹«¼¹œÌ½¹ˆˆˆˆˆˆˆ…V–Fei…Ze‡‹‰Š»©‡š…DTEFTWˆˆˆˆˆ¼¨Ë¹¨‹Éy‰¨‰…wHt…I†x¤»y»z̼«ÚšÉˆˆ‡fUgH–Vˆ|¸d¬ˆˆÊ˜­„ˆŠT4dUSwHe‡hˆˆ™ˆº™‰ª™š§x©wUW†W¦{ÉŠœÌ»¼ÍɈˆˆˆˆˆˆˆ†XuUF‰x„Wš†ˆŠ»še›TVDUFUxˆˆˆˆ‹¸¼©œ¸Š»w©˜˜W†XuW…X¨h¹˜º«¼»Üz»ˆˆˆ†WeUX…Vz™˜ˆy§¸Zˉ¸Y•UTD…TXuhuwˆ™h»¨ˆœ˜‰¹x˜ˆxX…X‡—™ª¸›Ì̬ËɈˆˆˆˆˆˆˆvFveHh‡wH…‰‡{ÅËX§‡TDdxE‡xˆˆˆº™»Ë©š»ˆŠ‡‡xvx…fxXvŠ–\¨¼»»¼Ì¸™˜ˆˆ†xdfU˜Tˆ‰©u›Wšˆª«Å\…UTUSxdxVˆWˆˆšŠx»›‡›·X‡ªx‡X¹w‹˜‹§»¼»ÌˆˆˆˆˆˆˆˆˆUVfUfW·Hf†v‹h»©‡š…ET…HVˆˆš‡›‰««›¹ªš‡ÉUi‡x‡fxˆW™J†ˆ«Ë»»Ì»¹y—ˆ‡XŠUUvhX…‹ˆx…˜h‰¹¨¼WµHTGsKVg—Wˆvˆ›˜‰›š˜y¨g‰zš†Š†»—i¨»{̼˺ˆˆˆˆˆˆˆˆˆhTFfEfˆX…„{e‹µµ‡¨GudY‡‡Š©™Šˆ»ªˆª¨ˆ‰ˆwwY©†gzgˆVˆXº©ÌšÌ›Ëˆ©f¨‡ˆh†Vuieˆw‰ˆu™VŠ˜™«…›ehEFV…Y•xˆXŠ™‡™™š‡˜x˜wŠº…‹ª‹…›˜œ¸ÌËˈˆˆˆˆˆˆˆˆˆeHTuEuW†gW–H™¹{Èw¨V†uX—™Š™¸ˆ˜›¹Š˜Œ†x‡yeˆ©xu¨wˆUx›…¼ÌÊ«Ê›¹wˆz–i§fF–IˆUx‰ˆT¸E™xÆŒ–h©UgE—H—X†wh‰‰™§‹—‰˜x†š‰¹ˆ¹Š™y¹kºŒÚ¼¸ˆˆˆˆˆˆˆˆˆˆFTEvDWX˜E‰Dºe¬§Êj«…™Ez¦{«ˆ™˜¨Š‰¨{•yw†uŠe›†‰u‰…wˆ‹‹ÊË«‰»—™X¸‰—zU‡EY‡ee¼D¶EˆZ…ºœ•iÈXTvy†v†xuhˆzxŠ›‡˜–x§Y¸‹µËˆ¬—Š»|ȼʈˆˆˆˆˆˆˆˆ
 ˆˆ…T5FTTXˆVUˆXxˆ»¬†¼¨‰V¸ˆ©Š¹y¨x¸h‰˜‡x·GˆU‹v˜ˆˆgŠ‡xŠ›Ê¼Ë©ËX«…XŠ¸ˆŠeweGfvVi¶VWf‡‰ˆ›ËGÌuxU˜hˆeˆ†X‰ˆhŠ–y–iˆwyº‰¹›šŠª§«¸Í¸»ˆˆˆˆˆˆˆˆˆˆˆeDCFuDeˆ‡Uxxˆˆ¨¼¨ŒØY©yº™‰ºˆv©wvz‡gˆV‡Xwy†‰˜xvš†[§¼»»¼Øxz¨ˆe¼‹˜†˜wTTˆTYUšeUh†h‰‹»‡¼–ˆu‰†ˆjfh—g†—j‡i§hW¨¨ˆŒªª‹›™¸ˆÌªË‹¨ˆˆˆˆˆˆˆˆˆ†eUS6eD„Xˆexˆˆˆˆ‰Ë‰Ì¹›‰«¨Š˜Šˆx‡wˆ‡w‡exV˜U¹h¹‡x‡‰g»›ÊŒÊ›—‰x‰†Œ¨›†™vUeGeUW‰evfxfŠ¨œ˜»¨©ušw‡xˆW§hvˆ˜g‰e˜Xˆ‰¨‹»©»ˆª{˜›¼‹Éšˆˆˆyˆˆx˜ˆegUDDF„FvˆuXˆˆˆˆ‹Ë¹¼»¸{¹›˜‰™‡whv‡–X‡ehf‡y†‰©ˆhˆ†™Š›¹Ì‰¼–g›w¸‹¹‹¨‡ˆeUUwUVgxUhU‡g›ŠÉ‰›ª–Z˜w…™hˆVz†ˆ†‰uˆx‰ˆ¨«»ª¹Š«k˜›©¼—Ȉˆh™ˆh‡š…WeUDD†UUXˆ…Wxˆˆˆˆ¼¸Ê¹Š«ª˜‰™ˆvx‡xwv‡W†xxf‰ˆ‰‰vx¸w›¸»ª«˜™WŠ¸ˆŠ«©šgˆtTxVuUyvuHhuY™¼¸©‹ºvˆˆ‡ˆˆ‰w†‰vˆ‡gXw—‰ˆš©»š¹™™ª˜™ª«ˆºˆxvz¶xˆ‹†fWeEFV…UX¨XUW‡ˆˆšÌ™Ì»ºi»ˆ˜‰¹gˆh—V‰W†V‰†Wh—ˆˆˆ©ˆˆ«—›¹¹‰©‰vš™˜Šº‹¸wˆuUV†Ue‡xVUuXg™«‹‰É‹ˆfˆzgªˆˆ‡‰vx†hˆx™†º{ª™»‰©Šºxºz¹ˆy˜hfŠ—wx˜xvWvVUWvVgh†fwWˆˆ››ËœË«¹ˆ©ˆŠ˜˜‡xˆgxuvwgxgwxˆ™†—Š˜š—«™¨‰ª†ˆx›¸ˆ«™¸˜h‡UuX…U‡if…eY„z¨{ÇŠ»ˆ‡x˜ˆ‰›uŠwh‡gx‡xy¸‰š˜º™¹y©Š©Š©™ˆ‰˜‡Vˆ˜x…Š‡wˆewUhfuXx†ggvgŠ™«º¬»»ˆ©ˆ˜Š¨yˆxg‡V†hvwhgˆ‡‰˜¨ˆšˆºˆœˆ¨™Š‡ˆ‰Š˜‰™‹˜ˆ‡xefwgew‡wuXehx‰˜©ª›˜‰‡‰†©ˆˆˆ‡v‡ˆg
 ˆ‰‰‰‹š™™«‰¨™™¹‹‡ºvˆx–Xvzvwˆxˆv‡fvVˆVxW˜X†h¥z©›¼¸¬¸¹ˆ‰ˆ©x™‡ˆf†ggVwwXxˆ–˜šˆ¨™ª›‡º‰©x˜‰w‰‰Š–Š˜™‡x†vV†‡vgˆ†hewfjˆš¹Šº¸†˜ˆˆˆ‰‰h—X‡hˆxx§ˆ›˜™™šš¨‰»ˆº‰šg˜f¨Fˆ†wwx˜†g‰eggxwfx©…X©eª‰šË¨œÈ™‡‰‡ŠwŠˆwvweguX†g‰ˆŠˆ©™™©ª›‰ºy«eºwˆˆˆ™xˆy˜wx‡Vvwh…hx¨ehuw…š‰º‰¼ˆ¨w˜yˆˆˆ—gˆvxxx‰ˆ‰©›ˆšš‰š™ª¸Š¹˜xxXvfw‡wfˆx‡xv‡Vgw‡wy‰™vyˆ‰˜«»¹»»™–x¨x‡x˜f‡fVgeX†f˜™‰Š‰ªŠªš¹©ª˜™‰h‰‡‰vš‡xxˆ§UˆW†Wwˆ…y‰‡Wgxˆw‹ºŠ›¹Š†ˆˆ˜xˆˆh††wˆv‰˜y©™˜™·™›‰«©‹©ˆ‡ˆfwwWgx…x‡‰†gxwVwˆx†Š©–ˆx™ˆ«‹Ê™»™—w‰ˆ‡xˆgfwUfvg†h‰ˆ™‰ªŠª›©ºš¹¨Š˜hxˆ‡wˆˆxhˆˆex…fvhˆ†xŠ—vgw‡h©‹Ê{ÊŠ‡xˆ‰wˆ˜gˆvhxwˆ‰x™¨Š‰™‰ªª‰Ê™©˜x‡VwgvW†‡gxˆ†wxwvwh˜ˆˆ«ˆˆ‰ˆ‰š©¬¸¹ªˆvˆ‡x‡‡‡Wfegewwvˆ˜š‰ª‹ªºšº›¨ª˜ˆ–ˆˆxvxx‡W—x…hwggwˆ‡x‰ˆ‡ghxw››ª«º™—w˜ˆg‰ˆwhˆfˆhˆ‡ˆ‰™˜‹‰šš»Š¹ª‰˜wˆUgvvWh‡†xwˆ‡Xˆfxhš‡‰ºˆ©xŠˆˆº‹º™«—ˆwx‡gˆwVheVuWˆvy™©¨›©‹»™»›¨ºˆ™x‡x†xfx†gxw†hwxgwyˆg‰˜x†xˆx‰º«©©ºwx‡‰v‰ˆ‡‡xvx†x†ˆy‰¸‰«Š™»šªš¨˜w‡Vf†wfwˆg‡wx…wˆgxx‰ˆš‰ºˆˆ˜˜i«˜Ëˆ›¨wxˆ†hˆwffefuxv‡‡ª‰©ššš›ºšº«©ˆ‰ˆvx†‡V‡wvvx‡‡XˆXwxˆxh™ˆ‡xˆ—‰ºªºš›ˆ‡iˆwx™xw‡hvv‡ˆX‰™˜š™¨›ª©ª‹¨˜xggexwwg‡xf‡wx…ˆˆgˆ™‰ˆ™ªšw‰˜‡‹¸‹¹›š˜uz†fxvwVvfvW‡‡h™šš˜ª¨›«ª¹«¹™˜i‡WyuˆVx†gwˆxvˆ‡Ww
 ‡ˆvˆš–x˜‰ˆ›š›¸Š©—w‰ˆw™xx‡gwgg‡xi¨™š™š™ªšª‰ªˆ‡whfwxwg†wwgwˆxhˆˆiˆˆ˜ˆ™©˜ˆ‰˜z™©«šŠ¸ˆvx‡X†whˆˆ¨™‰‰ˆ‡‡xw†‡ˆˆ†G¾ü¥,Úˆ…"|í¸jˆˆˆ‚1¼ìé†tʘ0DÞû1­íä"O̍¾í´sXˆˆ‹ŸÝE#TkìÅÌH¿í—F&•ˆÜû˜ƒ­¾íÈCHT½Ý•U%l¼‡68¦SHÚºˆ‡¸Æq—©«í¹‰ˆ'nžˆFLuVìʃCF¼½˜ˆƒCeEy¬¯—'%hr'ˆîÆR7Xœ§U¹¥Wˆˆ¹ì´T8XˆšÈëµthX«”T˜üÅ‚hÙÅR†»¸{ŽÍ¸4A‚Xèܝš76‰ˆ™¸É„bxÚÚ†‡w˜…tšç먊‡F#g‹ÚëË”U8Iœ›ˆxªˆtˆÙ‚‚DÈܪŒÜE#Tvˆj«‡WUˆˆWYͨS6z¼‡‡˜„bgˆËÍ»u6'ˆˆË™½½„E8Œ—uY¼ÞƒDHõC„íý2mÍFè3n¨ý„¼¨v,ªÉeÌ«"˜ü¢ÙØÁp­h6ÊÕ&›AHˆˆÍ%£6ŠíW?Îd%+î¦S¹ý°“ìì‡dxÉ5»ƒÅUxËëÒP®Ús1‰¼8<ͽÛ$"„ˆˆÜ¿¾x%"O¿FG¿­¨ÍÉ…4y똈ˆˆˆˆˆ8‹Èˆˆˆˆ‡R6Ç£b¨Ú×qr»W6ˆˆˆ¸vˆˆˆˆˆˆˆ¸XˆˆˆˆÈ‰»W8‰®ì¦3Œ›X½ß¹ˆ6$T‰é춄h8%ŒŒ©˜h‰‰X52„™¨L¾ÍÈU3erxëÌ­»H4Tì¨jŒ¼È†XŒe7H|½Éˆˆ…uF5J»È‰ˆsFˆ†xyFG[‹ª¨gzb%jÝœÌççQRX¨Dx®ëØssv¨ˆ—ŠÊÖCg¬Ú˜duˆˆ˜‹œ»Ù´rThF{ž¼‡3G‡¨ÊÌ·T'8xœÈÉ…uƒWºË¥dH˨†g˜¸„zºÉ”uŒ‰X™‹ËˆDvˆ¹‡T‹™¨»½ˆE8ˆƒ„¨êº…‡¨‡yˆˆ˜‡…˜¨ÛÄsw¹gxÊ¦ZŽz56x…DHÜ»‹ÉgCc›©‰­‡hXW„c‰ËÈ…©¸…[œÊÇ4T„™ÌÌŒ¨¸…Twˆxª•œ¨ˆ©ˆu¸TWˆ¨×„y¬¸uC{™w8›š‰h†…uh¹—‰ˆWDsyÛ§Tw‹Ê5IÊXk­‹hhVˆ˜¸Š«˜wWU|¼¸©š†wWZ¼„ˆ¨uttGª­œw‡†„tF˜´„‡ºØƒˆÌÉUeœ©ˆÌ‹˜GZ¨”‹ÚË´ŠÉÅ4{«Ø‡z‡‡ˆe
 UŒº·T‰˜V(}˜8Wˆvh¸¨„e˜UUŒÉ˜ˆ‹‰ˆ‰¼‡T&7Š™©ÉÍ•S8ËƃXȹ…ˆ©È2u‰ÉÉ—‰˜xv„™º¨‡Š™¨ui›ˆxXœhVUŠˆhœ¾‰UG˜„„w«¼ˆˆ˜h©„hx«ªˆ˜wW„E™Š­‹xweu†ˆÌÊ„eh¥„ŒÛÈTV‹˜X­›©˜ejˆˆ‰tuˆ˜™¬­¹75uˆ˜¸Ë”CWWe‹Ë˜T„ˆxI‰„T©É©˜xˆtgœˆ‡‹Œ¼˜j¨…xXj«ÉÙ¼›‡XHŠŠˆXšŒ¨ˆˆˆˆˆˆˆˆˆ‡VUjˆwhŠ„UH»©„4ˆ•„‡xˆµ…w˜¹ˆt7ˆˆˆˆ‰È…vˆˆˆœš©º¦ƒExÛ¹ŒËÉ•yš¸vi‹«ÈÈu‹xWˆˆ‰‡X¨T8hŠˆH‰¹†eFi»—g8w—…w¹©…vˆ»¨‰wX««…ˆ¸—ˆ‰¸»šŒË‡w‰‡XY›‰ª¸V†ˆ¹˜W‹VHl‹hH™ˆ‡w¸ˆˆ‹w7{ˆVH\­†F™¸˜‡GWx†™hx…uWy‰†…x˜ˆ…‰¨¦tˆhXŒª†HH‹ˆvÉØ„u™É–‰«É§u‡gˆÊ–ˆ™xuŠÌëÄdug˜ˆŒ­È†VŒŠXHx‰‡i¬©wxFTx»Ø†ˆuW59šˆ˜‰«…EX†‰ˆxhj‹ŠhXˆ‰ˆ¨˜ŠŠ¸¸gŒªHx¬œuh¼—v¸ÈÊ„fW†wŒ¨˜†ˆvXH˜†‰˜Èu…ˆ‡EhŠÊ˜eˆ‡H†z™¨¸hŠ˜xx{©FX‰ˆ˜x¼™š¨˜„u™¨©ˆ‡¨¨™…t˜·{œ‰·Ce‰xX–‡xhw†Šº§Ux™xx…†vhX™›ËÈTj›xfZ»ˆx‰Š¨˜¥uœ¨˜‡Š«xGˆ†˜hk«›¨EH‡gXX|ˆgXˆ††GJ¨•ˆÈÈ“„x¸ˆˆ«ˆVZ‹—ˆ‹˜†©Ëʃu¹ÆgŠÊÙµuˆˆ˜‡yºÇ…YŒ¨gDlŒ˜hxˆˆF›»‡©hxƒtÉ·u†x˜‡Œ‹whT‡‰ˆ»»…ˆG6…™É§wŒ¨hgˆ†WX‹˜‰˜ÈxˆehV{œ¹˜—t„GŠÌ˜†¸˜†‡x¨¥eŠ¨Ê»ƒD¸¤SfÛø£H½¹EB›Ì¸[½‡ˆFCy¬ÊÈXŒ¹W$}§7lœªW9¬¥eH«®z6Gš„VˆÊ»„U¹™‹ŠVHº„U¨ì¸…EiÈ…›ØæSceÈ»½‹UYÆrgÚ×Rƒ»è…T™¨VDhšˆˆš‹™h5wŠºÈŠˆuh¹¹…W¸ÈxœÛ…3u‰¨¼Î›Dj†ˆÈÜédWˆseËèƒS†¹Éu†ˆ˜UYË‡SStxÛȇ›¸TT™¹¨Dz¬ØVHœ‰G
 4‹‹ˆºÌ©d6GhŽº˜»ƒ…©º¨ˆš¸UXŒË¹ˆˆx¨vZ»¸‡‡…UG‰Œ¬Ø¸e„Uh¨˜†ºÈ¥f‹x4E|»¸z®…D8E‰ˆ¸é¸…fhº……ˆÈ•d©È¶x‹ˆHF‰ŠˆÉȃTHˆ›–¨ÚÈddH¸…x›Èɤtx¨ˆ‡Š¹ˆf|«ˆgttxx½‹¨UE…g˜ˆˆ†F™Ü‰t7h•uxØØ–ˆˆWSs—ÉÌÛ•gXUj›™¸‡††¹Ú»†gXTZËX«–™89˜•hÉÙˆux˜tu«ÉUYŒ¹WW……HI½ˆ›¸¶tˆx8{»ˆ¹»¼“eg¹ˆ‡¹¸˜‡xɇxy†H˜›œˆˆ‡‚TW‰¼œºˆ•u…hX…„v‰˜‹ŒˆWU……˜Ê»…eˆ·„w™˜˜Œ½¸Fg…v¸Ë«—ˆ¨‡x‰ˆYºˆ—ˆ§uf©Ø‡uxˆVYŽºgG‹ŠV&¼‡Xª»„D¸É—wwwwŒ¼‡Vk†E‰Ì·uFxuu˜¹¸xˆ™ˆ‰•†h¹¤sv©Èt|Û¸Tt‹¹ˆŒ˜†ˆh…u‰ˆ‡‰¬ÙT3Œ«WI­šV6{›uh˨…whŠ¨ˆ¸¸x‡eX»¸š˜Xhˆ‹Øˆy†dHœÍ™†ˆ¨„eˆÉtu‰¸È¦‡ggU…‰È¸†ux¸v‰‰˜wD‰šˆi«šwGG‰˜¹É‡†‰xY›‹©xg…‡˜È™ˆª¹EX¹XI˜EiË…dXš´…©È¸v†xxhŠš¨‡d‡˜¸egšÈwXŒ¹GyŒšEH™˜‰¹É·u‰¸Ueˆ¹¸‹«™gWuˆ‰‡«™‹¸GEˆ‡xY»…gh‰˜‰@Ðÿòû ð?üíÅþ ÿAþØ0¿Ð3#‰ßOü€óà_ôV‰ú€Óýÿ…ÿ2øû êÅ	ãä'Þþÿ *çWD[ÍdZÁ3Žü_ý=å‚ÆÝ\²\3ßòÛ9ÉSÏÚ3IG›#ÏÓ&¼ÛV•$lúM·kµ3HE¸¼ˆ—ºlÈtX‹ÌEÌ4›sˆD»§>ÄÝDÌ£W¥&ËÛÔ5TÌU|u|ÎT§<Ä:”–}„¾3º…—ˆ©H܈…{·DŠD™œØVkd·UTÍË„d7ȶvDÍËÉ”8·»wƒjiÛgDwˆË·G›¼·eThËV–IÌ™‡Uj‰»Gš‹·•H„k¹H™‹¶ŠWˆzªˆZ¨ˆx‡VW›ˆxŠ‰¹©eH»Z¦i†¹ith˜»‡˜»wŠe•h·—y‰‡x™f‰™‰ˆ¸x¶xV‡whwx‡wh›Íˆˆ„Xšd#6ˆ{£$ˆ‰›Ý¬îÖ1îS"ˆÈÝÝÛ"hÿë¹sB16íÎè4k¨B#Xˆ»ßüSJŠïÄ8
 ÎÛ»R‹¶YÈC†5Ìs6̆…3UzvXÍî—eSFÎÝÙˆˆˆƒWwvfxˆ†Bxˆˆ‰xÍìUiˈh—¬Ì§U¼ÉD‡UX¬¸C6™«·34hˆˆÜˆœËT|Ì̻Ȉˆ‡34‹ÍÜ–3C$H¬Êª™…CEi¼ÚŠºvUh¼»ÍݘUuCE‹Üܨs33Dk©«¸C5ˆˆ‰¬ÞܘUUy¼»É§C#5{ÎÝÊuFTEEYÍÜͨC37ŒÝÝÉSDUˆ¬Ìܨ„3#4jÍݶD#F›Í˺—UgxˆŠ¼ËÊx™¼»vewuDCFxª©‰†UW†gˆš»¼ª—hŠ›Ìº©wfTEy¨˜vy»¥DEx™ªˆŠÌº‰‰‡x™™««†UxxwfwˆfTVŠ¨‰»—UUX‹»¨‰¼˜f‰š¼Ë¹uVfx»Ë¨d3EUX»Ë¨wfuUX›»¨˜wˆ˜š©‰ˆugx›¼¼©uTEE™ª»¨hŠ©™‰™…TVŠª¼Ê—evegˆ‡w¬Ì¶C3gš»»ª‡UUˆ«Ë»˜xˆˆª˜vˆŠ»©vhš˜eUTD5j¼Ì§UEF‰½Í—Wšª…TW›Ì¨ˆ‰š‡Uhª™†gUEh»Ë™–Ugyªªˆ‡‰«‡vx›Ì¸uTUˆ˜™©š™©†DDG›»»‡eVx›º¹‡x™‰‰»Ê—UXˆ‡w‰»¨uDUUgŠ¼»ºxvUVz«¹‡x˜‡UX«»¹vVwšª™ˆˆwgxˆx‰™˜x†ˆˆ‹ª˜uDDU‡ŒÞþ¨ˆˆ‡sG¬R=ËÛ¿Ãì"X‹íî 5ÿÙƒ>ß²|‘ˆŒÿðŽþ(Í4RŽÄ(Çc$iUßùT"¿íʈƒwdV‰‚xˆÕÎÓJÉ‹Ýt“EE½³%‹Å"WˆŽë½³LÜ͹ˆ…4¬Ùƒ"%½»˜B$ŠÛ¼¸V¼¼îµt#[íÚB"6»ÝS#[©Þì•V¼Ì§"îÉVD4\Ýëc#|ÞÉ2GœÝës"$î“"JÞË…Dh‰½Ì¨›ÌTG…DGzˆ‡DUX›Íˆh¼Ìº‡TG‡vl¶3GŠ·{Ëš¨™»¼µDx˜x˜DEˆŒÈUV¬¹zÉg‹ÌÛtDiͦ2$D½Ë˜‡FŠÉ˜gxx˜˜Vy¼Ì…DE«¼¦z»š˜SG›ÍºTTHˆyÝÔ"EŠ¼Ëux›Ë‡Xy¹ˆ›Ì¦V«…TC5¼ÆC4‹ÞÙz¸S6½Éx«‡jË…D3|ÌÉTV«¹‰»¸UzÌ…DXˆš›ªt3H½Ë…V‰º—Š˜‰»…H©x‹¸CDG‹ÜÛxdV›¨WˆTkÌ·UXªˆˆxx©™«†eg›«–TW›ÌˉuTH¬Ì¥CHˆxˆˆfxšÍÈDEz
 ¹«Ì©«…3E‰Ë¸hwgŠš©ˆdDW«º˜‹º˜š…Dx›»ˆvfŠ˜‡wuXÌÇDfx¼Ì–fŠº˜eFVy¹‡g»—h‰˜Uz¼¸vh«¹ˆwveh‹™ˆwŠ¨dE{»—h¼·UzºeV‰™ˆˆuW¼ºvˆˆ‰»švUW›¸wˆ™w‡†Wˆ˜šˆx›©ˆUi›»¨exxˆ˜xˆueV‹»º‡W†Vh©©˜ˆ¬¹fwx‡‰™ˆ†wˆ‰‡eg‹Ë¨fgx‹»˜w‰˜‰eEy»º—Vx˜ˆº¹…Fˆ™ˆˆ™š¨eWˆˆx˜‰˜z»©uVˆvfŠª˜fhŠš¨™ˆ‡Wx˜ˆˆvfŠªª˜†VyºŒ]òOþ=ÈbøÓ/ç^òà®â½<àÿÑZô`±übç.³ýBùìˆ+Ùˆ„ÃÓ2WR,Jñ_RãÃ_¼"Þ’ñÎ6ì-0Ï–!³ëCò|·ú-Íø‚^¸ˆƒÐ’Q§Þ@Én’ÜTÄî1–ýÅÞ+…ÊZã–ÞS|Æ<ü¯Ã›ÏÙC͈ˆK#¼C2›ë"¸Í4ÙH¬å2]ý‚;ã»x»L·b&êB&„]EÜÞ†‰ï–;»˜ˆ„(Ö5Ô$ˆÈ;µM­•3®ûB]Y¼KÔl¶#;×2F»uºLÜ΄ü…x¹ˆˆUK”R&Í’7ŠµLdÌ»…5ßÕ3ǨÖmT½c2\µ#ˆºXµ½ËíEÎ܈jˆˆ†„‰U"KÌBX‹”ˆ[Ù‹’ký¤7{gÉGËB3œ“5z¸Y˜Í½åLìÙ‡˜ˆˆ……‡S#›©3x›ev½¦»4ŽÝSe˸œt|¤35«cFŒ–X¼ËÞ´½­ÊjˆˆˆW”ˆB)‰¦Dy¨UkÌ[´GÝËE<ˈÇG»T$H¹CX»…Z̽ëwØݵšˆˆuhf´2WxµFŠ—E¼·«eM¼ºSœÆ}t[´D5X˜4‹¹U{ÛÝË›ŒÝg¸ˆ…wuŠS3gˆ¥I¨„ZËz§e»Êš7ÌXÉE¬DEDYvF«•W‹Ýë»ÄÍÕ›˜ˆv‡EÆC4Yv§j˜E«¸ªwl[ª”|·‹µW¸CeDˆfX¹e–ŒÞÙÌWÝxʈˆI„Y´D4hv‹™uIº‹§ˆ¸Y¹I¬wÈx†—4eDˆf‰§YµÝÌԫ؛Ȉ…ˆEx”SFXeŒ¸EŠ˜»xœW[¤lÇ|h‹…e4uE—X™‡Š´ÍËíJË›·»††…Hh•CUwV¬¥W‰{¸ŠÈT‹H¼ˆ¹Y»dUCuG‡j˜ˆª¦Ì½ÙœÅÌXØfˆT‡h´Cueh»…ˆwºˆ¼¦F…Š¹‹•«¸TU4eX†‹x™©È›ÝlÌ{Ç\Ç[eWgŠt5efx¹‡…{¨‹ÊutY¨
 ©¸ˆ»†dU4fY‡‰Š¨œÅÈ½È…†—U‡gªT6Uwy‹‡Vª˜¬·Xs‹‡»ˆ|·W•5C…y‡˜ªˆÍ”¼«Í‰ÊxÊx”hv‰¨DEGw‰‹…X©™Ë…ˆ7™[Ȉ»…y„DCg¨x‹¸ŒË…¹Ì»»¸º¨‰G‡x™¥DDhwˆÇU‰Š«©itkUœ˜¸ÇU©e5C[ˆi«¨¼«¥kÚœ»«¸Š†J‡yªeSEvˆ‹¥Wˆ›¸˜—E¹FÊ™º†h—eDBº†šº‹º¼“œÈÛ›¼†©t™‡Š·UCHwx»Uwy¼†‹„Z–Y‹¬ˆvx‡fS4šx›©»šËE¼ŒÊ»ËX§w˜ˆ›…U4hhzÆgvŠÈgºE¨x•›ÊwhxvgSCšˆª«¸¬¸U©Í‹Ì¸hjyˆ˜¸UT7vˆ¼]ðÑòp"ÓñùOR?²/-Ðàì‘}ƒñôùÿ˜ˆˆˆ.…Ý/ÂÓ÷übêÃ×+
-ä	}.L­âÝüôPÐÌ#{ò7Ý*^¿æ
廤ɐN@$Öš=Ï9ßã]¸XÃBBZÒÕHè"îA}l½ŒÊê{˜äíõL숈ˆˆ[Cûm9„Ý„-ú4µÚº}rȈˆËÒŸì›ø…4Ä1Nä;ÈHNہ¿ä*Š†¥È!LRHĘ½ÎhîÚkˆ„zCË2Y£ˆ‰¼7þcŒ¬¨Nã$º"­˜‰Üø^¨ˆˆˆˆUR)–4[E]ÉÒ×3Û{¤¸17´ˆˆˆŠÏ¥ìû=˜ˆˆˆ2‰³GºFËm#ÝÄ;·ØH”"[Cˆ—‹Üí]®µØ…4vƒL„«„Œ×Ô-î³Ý]sºC4«4¬BÎڹ뉈†U†"9›W—:ËYVÌ«(ÕË4ƒUGˆˆˆˆýܾ˜ˆˆˆˆˆDE7Jtk™¨iª£¬ZUœ5SFU›WˆÞÌ´ì½¥4ÄLD3¨|†[Ú˶…Ë[ÕÜ•T3‡G¨j=îËŒ¨»ÕKEhCDS¼¤J{ªºceË}‡µ„H%¨ººµžÞËÙˆˆˆ†e‡3WDÊEˆµ|¤[[ÈŬdBEGxˆ‰¸ØÍ­nJ×»WEÅ6wi§¸Œ¼ÛSUYzkÉCBTUiW‹ÈέØ×nXdWyCDw‰¤5Ǽ§t½¹h̨e3FǻɮWÙœ|§È‡Ge—2Dw‹¥LÈÉj6µËˆ¸YD$Wˆˆˆ»^Í軍ɵ†k¶UHz‰Dfl¹£H[¨|D…4'ˆ‰Élةܼºº˜Hi”34fšØk«¨«X¶ËŒÌj„3*„gˆÜÄ]¼»©Zt‡ŠµSFV¼Ux¼ˆ”k;»…C©TEˆˆË\͵ìÌ̸ˆˆˆˆˆ2F¨´UzÅh6¤‰¼™‰…D3·z¼©Ì;¼Ú˜7¸™¬Çd7H›‰¼‹ÄŠ[YÉUTVb4†‹¹k¶KͬۨˆŠ»e3VˆÄekÄE&ÆÈ­Æ‹•GT[¹¼Ü»µ\Ú؈X‰g¥DD7‡Vg‹ˆ¹—[ªœvgf…C8z¸GˆÄ¾Í̸»ˆ½§ef­T˜x—uHu¥X¦†UUECˆˆÌÙªGÝܹFÚ–fUU3d8ÊÊy˜»j‰Ü›‡ª‰U4h»Ši·E­¼¦L˜U§Te»†gœ¦—Uf»ˆfxTCGˆˆˆ‹Ë¼›Lý˘ȈˆˆˆdUhvdHgdx·—……‹¨fxUÉ«vŠÄMÚÆdE‡‹¼hX™˜ºŠÈy[ˬfueeVY•#™¸ˆªƒÍ»›«»yËœ4hFh•XWSEY˜Zª‹©‡œÇ;˛̺jÌ©•Hº™©C5Xfxv•Wf˺ˆ»„‰…E—t:¥WH‰x̽ռ¼Í×TX»¨•j–S6©¸f…ThUw¨³HzȼÊ\
 ÛÉV¹ˆÉUSDTeV§ˆK‰Îyo*øn{¨ˆÎ/A´âõâþý·˜ñèQIááãóLûâ°â¶GˆˆˆˆÅîö>숈ˆˆˆ0þ0_BÁåälø)äCÂÓ"¾ˆˆˆîrOùÜLbó"ê3ï–[Èâ~¹[ˆK4Â|'‹Xˆž²ßâOÝ=[¹9Ê4»I*{r\Ã,ejÄxˆˆˆŽK~¢ÏôÍlyˆˆ:É-¹2="½Ò.Gw-sä6¸›Ì"~dݼv=‡=æ~æKŒ¹=[†¨Ds7R(“{»ŒÛÌ$÷3ÞɈ\qNä¨Ù+»Ê'mBŠDR7xˆˆˆÎÈí,Û¹´B¥\TŽÓ¼Þˆ…¸ˆˆCsE!XˆˆÇÛŒå(Ì´¼S2hˆŒÉÍFîí¨ˆˆˆˆˆ‚5!9vˆ·ì½äjÍWÜDs“\ä|J×ìØNËE¥C3¥#x¦\ÖÎÜ;ÍyÅK„µ1DSi̾ÝÕ͸ˆˆˆd23§2ÛzˆÌC=×<Ü›U¸3Ü2HˆÞÝͼº˜ˆˆyR"w[Æz|؃L{œ»¼·U4Ò8E4¨¹MªºÍ„jÉT:Ó\¬Ë»[T{WXÜ›¼µH‘uZlu”ŒIËÛy©Se‹dÎcKØf#EVkÛ¼»ÆÎB—µŒŒ…†4ˆ¸f»æS\šÍ‰­„ÆEUdK˸X‡Í$l¤¸‰Ec3Wˆˆˆˆ¹Û˾©Ü›µF4†|—»—[É"Î{º×†ET4c3hˆˆ¼èÎt݈TSE4žË¨§œ¸3ËŽ­Ç—§3Ub5DhˆˆÌîm숨tFX·XºhȵËŝ¹T…6F„CxˆˆˆˆÌ¾ÜÌÛU5Z{Ý„Lȳ%ºˆÜ†kÈHTCC3Gˆˆˆˆ½Ì«†{EM¼É™ÜV³UÌ|ƈ›•GydDDˆ5³z—ºÌ͵¼H­¶‹wÉ}D2ǽ›cEuEkX…;…MÇxSj¸½«Ì4ÞÉݘ¨ˆ96ÇÉzx¶”df4S\•Œˆ¨’8Gˆˆˆˆ¾¸ì½Ûe['œÈ¨I§Æ„„TTªF̺\“—Ct7™¤ìÊÙÍØx¥%kxÄWDWYÕuE´kÊÙ¾Bˆ{ƒEGUݹììÅ{…UØhTŒU\8„UY…»”»¸D˜uDDXˆˆ˜ÝÌØÚJ¥Ç«…uv¨Y…F¬y¸‹Œ”tWˆ—T‹¥Fd»Í¸‡G‰µVf2fé–xµlÛ‹Žvt8hšgÌ”›´¨˜Z†»X¼¨ew5©—eZ¤Ì–¹ÌgTdDD8½¼Ë¸ª¤d8Ì´‹Š¬Ä)¼ld]WÌŠ‰ÅËtcx„G½L™Ù›¨T$ˆD§eEt{Êl—»[ÊzŒÆØg„¸d‹ÜIiÛ¼¨TX–"d‡Xc‹Ü©´¸œ¼tkyØD
 SwTšÛ¬ºµ{ËFœÇC3CX¦¹ÈjÛظª‡ÊFÇf„Hx¼Ø{ÈËXtU­¦R3BFˆˆˆˆˆÌÌÇxœÊÇD‡jy½åÉˆy…„Œ—BETEED‡‹ØË«¶É‹xÈ4d${ÝìÏ"ðˆáüRà㥈‹_óèæ/#ð,~&òßN¹ˆˆ1Å´½òŒ£/"Ó8‹YóoSú…µa‹Mßœû˜ˆˆˆˆ9Â2¹/Rä[;4òZ*L×þ.Rs3HˆºëïNÃÓº<„á=:äîLÅ4¼<2c£Î]ÒH•J¤üMÎ˜ˆˆˆˆ&‚yxŒ[÷]Ø·Â¥GˆÊ¾cå]N[èÜi˜ÈˆˆˆA²LVkìåçHB´47ˆˆŒMûÄèm3FÜÞŒ’¤8RÕJ·ËÝθˆBš$!hˆŒ¼öÎœNR¹»tW[+¶ã"UfÃ[lßÄèk¸&BG5ˆ¹ß¿èˆ†FÅ¢+'kÕÙZ„6Èk‹Ö„­LÙÄ5swˆˆÜìU†lX;U‚…ͨèÝe4Ù·$EÜ†C—5mf¨ç†¬åÄÜ2&§#7ˆŒë­ÔˆHºw·„xEÄ«¾»‰¬KD\¸»¼2G%CÖÇÈ”]÷‹ÝÅ6m4%fÝ›¹ÍK´ÄÉÇT5…kv²\®KV~¸Î̤[6$ÆEUVHϼÝÉHºˆB43‰”‚hˆˆ‹ì»‰T¾¨ÕŒ$IÃxVÎÎéˆyˆˆtEDS"WˆÉÍ:Îæ[[¼YµSE6C«Ëʉ5ëìˁKJE#6·Í‡k­…ÍÌÔ…C$Ö¸\Ã\ÎÎTVÊ؈„5%D”‚†Wˆˆ¼Ê<­Ö4—•{ɇœÌÛˆˆY¤9+}–4Ê……l¼ºf‰F£½uEddjÜÍýÂ-ÝYjC8¼C;SÈÍ·ŒcdWÄlÈ£Xœv<ÊÌÍê:YÊŠˆ‚#DSZ‡ÝÚ(¼ÅGƒ…H“X—š«Þ›ºœäf½Éˆˆc<CUgc½zšÛ¸Ùd22TxˆˆÍ¤|¾»ëH“½j…dKµ”DTÊW^îÛ”³:R5SdXˆˆÝÝÞÇxeµeK‹lÃ58ÒL‡œiºj¦˜dW47ˆˆˆ¾ïì;yÈ[˜S78E©ËúGx³¶[ÌÍ¥44[$iF¦ŽlËÌƺ¨Cƒ3\ÝÞ벘}G¸ƒCJ6ËȉEƒE„ˆËßÜ¥T:´6ÃE\´‡ÜÌJCSD8ˆÏì¸(»ÃiÅ5K´œÉ‹hDUiEvϾèˆTur%¨8KżܻtwS$8ˆŒËíÍBkç\Ùd;Ì•»¥B5CHdˆ¾ü‡”$x3(Z›È̵‹e4„X¼í¹‡hÍ3¼¼K¾Èܘ‡eB!DˆˆÝÌíÌ:mS¬§$ft·‹µdETd{
 lÿ뻈RIA'©SŠÌÞ숕iRH3:Þí\ºR½„8Ì´|ŒÌ¨†32C(ˆˆŒï<ݸ-D#¨ƒL­ªÍLJteUµ=îܨˆˆ-3X†y‹ÛîÆDcECWXÞÞæKˆeŠb[d†Ê˼ØC25Dˆˆîü‰§”uSHUw‰Ê¼ÉY³4DhyÝÞ舅†#A4hˆˆŠÝÜh„5tFŒïϳя=Šó=\-Að>×&∈.öîiÉ…¸ˆ1ѽ'¿òÖV<=äïʈˆƒÕ'ĈºïOâÔ&S™®û퉈ˆˆ40äÕíOÒÕ5ˆˆˆˆïßʈˆˆ<1aåÍ¿ÄÄ%ˆˆˆîß鈈ˆBWïÉæS6%ˆˆˆî혈[PƒjâϛԓRˆˆˆˆŽÿ눈ˆƒ6ÅÍ9ÃQÔI“xˆˆ‰üËäí&ƒµg}<VÈâÛIDƒt›;’IÚìKËÍèg-E+„è[t3£ª(6ˆˆŒŸ½ß¨ˆˆRsÉ]<›âË]%xˆŽ®Þ숈3t´Í©èȈ!Fˆˆˆ®üÛÛ‚”#·È{ÌåèˆDqWˆˆŸïꈈu…"TeÚÙéAT”B8ˆŽÎëÍXm5WA3­ÚïÊ3\2C%xŠm|ü‹¿K•f at MœÝ똈C3T›K\ÕÝν‹“BW½é=î329HÜE9¨çï͘ˆ‚<F3Ò\Þœs%™µd&Gˆí®ÜŒDÌ<¹`YíˆÌ45¸s$8ˆˆ¾¾ÌȬ½[ƒ"¬Jƒ]؃ƒV6Kœ½ÎWºÍ؈‚-sI\Í×AF¦:¹Fi{Äîí݆{ˆˆ;¾«³"3U•uxˆˆîîɘˆˆS½ÍTiC5Ë”d8ˆ‹ìîä¹Øˆ4[1½©[‹h”S2WˆˆˆïËÛꈈXš‚4¬yi»138ˆˆˆŒíîŒIJ„qÝ×½•0Fˆˆ×¬Ýê]juZFÅ+ÜÛ4B33xˆ‰ä´Þ嬌ČD›è2íµ3VB‰½å5»Ôi¼ÙÜ9›ÍÈ…YR9D4¥œÄ5lÔ|µÊ݈Ê»¨rÅ4[ÌÞ“$MÄW…”ÜË˼ȜºC"”[îÝ“"7rW¤hŠ›ïÜتE…’ ÛÝïs#C£[Ãe®‹Üîǘ3%µSSÎþÉ3X¢$c„K»ÝëŠEG4™ÞÍʘ7WR42hˆŠÎÜÇìU656﮸C%TxBBž{½ÜÄkÃF4H¾ïɈ"\UxBS•Z¼Ê¥‡lÈEŒÿ|¨ˆˆƒ{C8‹†½Édh”<†¼ïͨˆ:—6…\¼x¨XUSsˆˆÿ쨈[ˆS7"-Ú[ºd3txˆˆÿùˆˆˆˆDF2$¼½Í¶2B
 HˆˆˆïýʈK¥&º£6ÄŠÌ´S2&ˆˆˆ¿ý똈ˆCy“\•uˆƒd45ˆˆˆ¯ùÞ¹Lˆ3d5¼ÈÌ$T33Xˆˆ¾ç¾œN¸4ØT<Ý»ˆV"C#xˆˆ®ä®|^iD¸w‹›½¹UB23{YÝÞÕ9Z\©'¸ŠÊ¼›ÜUs#1hŠîÝÓDh5§|›ÍŠÜªSXsH"T‹íîæSx#BZ\έܺƒgEFõþøˆˆ
¢x‰ùóëAŠñõÿÚ"òóý//5àðÃ-,LÞÿ˜ˆˆ[µâþÎLãñB>OÞ˜ˆˆˆ"Xë˜Îg3,ƒˆîäÍΨˆ‚TarÍÕ¾¼CÀbHŽ.,þóøˆˆˆ"Hp£Xß?ÈÁȽŸïšˆ‚興"KÐÐÕê*Iuˆˆßÿ˜ˆ„£“´^;NÁ3cL¬RFˆˆ‰ÿˆ8Î݈%d7ˆˆˆˆ_Ÿí˜ˆˆƒ=ÙäèSh7ˆˆˆˆÞ?^ìƹ‚,.߸ˆ‚hˆˆˆÝÿ]\l˜ˆ"¤(½ëÃÃq5&ˆˆŽüÛëteËBDä½…¸ž‰H0"hˆˆÜüÝsZDN®¤ÈƒQ¼4EC8ˆˆŽþÍ؈bP<Í}ܘQDYÓ4«i†èÌúMW«@)¾ØëÚH31tÓ:Ž\¼œÔÍRíAf½„þ˜43XˆˆïÝKÙE^TqIí=¼5ì’„5ˆ¿ëý˜ˆˆD øŒÍB僜4®¸ÙßÅsEGõíèÌ‚5!szÄi|ÌÎûÚˆˆ†0q·¿û8³H‹¹Ý¾öÙˆ„]ˆ2 Å‹¿ˆW5ÓTcˆŒï³ìœZ]JË€ÜË´"\k0Wˆˆˆ¿Þ÷Ȉˆ!¾ÓC\H43XŒ•}LÄeïý¨ˆˆCDÎÝIUBxŒeˆˆ—Šÿü¨ˆˆˆ0.þ¨EC5xˆŠŒè¹…¯üˆeÈ0C¬Ìéƒ!cˆˆŽêu¾íHN¹ˆˆ‚tAÿ£UˆˆˆˆëÙì³4Nþ¸ž¦3<¹C“s4xˆ¿ì¶l«S®é„‰UQ1GŽ¸fZ{§kïùˆˆ%yúÍS-e2ŒÍ»wBHˆïìd,Þg5ϘˆˆX‹ëVM‹ÎZÞˈˆ† '¿ýTc8ˆííŒÙ$ßùt%SýÛÈB7xˆìm¹ÕK™ÞÛˆƒ…9Ïý1chˆžßí¹ˆ@'¿û0É„½¾§­¤¥!HÿÙE²V‰fEÈÊ &ŽïT"³lÜÍÜÜ·˜Q_ÝÅ1Å…8n»ÍŽ4þăÄC8-Í»”¸Wˆîû³×[~><¹ˆˆ0jþÈ1DxˆßÞÙˆ‚ /þ¹3t5šmÌ–B‹1ˆˆÿý•dTļµÅC
 ‘XÝuSxˆû~þ˜ˆˆƒû´"ÈzÃ;›z“ìÔ<ÿû‚§i¬KÆ,²Û‚ˆˆˆ—Ý^Ý|ÜȈˆˆ CÞ¶S[Yx7ÝëîË…!QüìÅMET9冻64ˆˆë»¾¨k”Ý興ˆ2¾´2ˆˆ‹µýÞ½¸„4¿íƒ4·ƒ…½D^WÌCtŸìc8ÔGéÍ\¸J‚!ˆ—ˆˆŠìÜÍʼˆUƒ9Šé&TZ„3]§Í©È„G:ìT8îÇX[KÜDR1GˆíE¼ŽÝÇUʼ¨ˆB"+Ì4UWˆ·ÍìÎlf33¶ÏëJ,Ö+ÆŒlT43C|îSH5Ùݺ߸ˆ„R;Æ„XXÝÝØÍÌURSµÞfÔ4ÜX‡k½»…T…KË¢4j¾þÛW¹fT#%,ׇ™xÜ¹E¼YwYKLÅ…$\ëÉÙߨ†3t7‰L8{tíÜD^sR2„ÈíVŠ8´ÜÜËm؃BdUÜ"†5ˆÞÝìŒÈ…"Kx˳b'uMíÛSçUDnËsU4xÌÜbÅD"<»›‚;VËžîË£ÌZƒ<ée‚%È[íÛ£^vT\ÙÇTJhŠÊ媃Wc5ë˶F¸xÈý܈L…„"ÍT3#ˆˆˆßíÚ%ÒtEß»d+ÄTˆÝX·"“Sfî×Y3IwÌï݈†„5B}´4#ˆˆ½ßî§5XD•¾Û3‹Uf¾Ëe2‹–ç%SuhËßÛˆCuR˜N„Wˆˆ¾ÎüÉCCu͍»"Bµ§½xÊÈR[|kÍú"3e|©]ìÈAŠZ4iê26¼MÍî눃…3{»ÛA4Œ4]¼ÚZr­UܽÊB3E)ÝÎÕÌSTI‹kQC­Æì¼ì¦19D®–Ûb1mÄܝؚSŽw©ì¸<§lÌèTDuzºÖQ6NÊŽÊÕf3mB̽ÄD5~Í\ÙÄH4MרE×3$EÜ¥ÔÛxgž»¹Rè2%½ëÃ×Ëz2]–ESìs5®íÓŠ†5FmLj”½A%lÌŌܸk¾ÈwB:b#\ìÛYµWU<Ê……Ë×5žëÈ#¶DGíµbE£$kí½B͹»¼Ûd2$E5®ý‡RzEˆ›î„D‹U¹íiA&D‹Üë‡C7DeÜí½r=ÖºÇÌT"$fÅÈîÅT&…ÍÔ¾w4F´ØœÍ”Tƕ˽‡35Õ¶­ÞÈ„ܼÊHd4Csª¾Ù6cÖ|Ýl´23»½–»Ê…@Ì›½‹¸SbLÛÛÆDB›ÌxÆBD7]ۜݓ4\Ë»S‡US+ÌÝlÅXU,Û»•©VzUxÈ[¼…58ÝÌ’8…Zu†ì§}É…tˆV·DFwTÍ臺˜»‚l¸gZÈUC*Ý´ŠÇu³¼ËÆ3Ìt…H¾
 Ü©ÉDDKµGcK¹s+î»»˜Y¸%̹cI‡ˆ3ØŒÍ³†9͹B:ÚH„º‡‹Ö“4yVYU½—D¾ØZ¼»ÙrfTEGÈUT]ÎwŒÜ¶SVh…4ÍÅd;mÌxÌÇS[•G•ÅB<ÞºŒÌÄC$†DU¬´eX®ë»Ý´4:¨™d[´4w‡ÌÙÍÈd'Èu¦Y‡T4ÝéÅ­…V"‡wš­Ç5t­ìÈ^ÉDB‰tVKÊ#uŠËí¾¹UBYukÊÈESlÛ¼­†Er:uª‹ØC„[ÝÝÅÚDR%†wfÛS…ÝåÙTD¨ˆªÈCC<ݼèËTi$VW¼ÈDDLÞÞØYSE"wi¬Ü—4<ݽ܌”D1¹xŠ§V#hÎíÝÚ†5Agf­ÙG2XÜí»¸c5RXšÜÛF2HÍþ»É…D3$W»©U3ˆÎþÚº•6D+—‹É…"4Íü¨¼†Ux4ˆ[«¦4HÍîʼd3DBWŒÍ¶4DÍìËΈŠD3g©{”"6ˆíì¾ÇUD!IÜÍì4$lìÛ{µD3DIÜÝÖ"‰ííÞ¨XC3&«œÈ24ýì̦#CT8Þ½ÛB"‰Ü̼ÇDC‡DÌ‹yC4ŒîÞ̨dBC3¬ËÜcEŒÜÉ‹ÖdTV4ŠªÌR#xÜíÍÜ¥C43H¼Ý¥TKØ̬ÙU3DDKÍ݃#5ªÝÞì¨t3#(»ÝšÌt5Vx¬SE7ÎìÌcEEÍÛœÉ12$ˆˆè4„hÎÿÚˆˆtJÙˆˆˆS29¶Xt3xˆˆˆˆ½×ÍŽ†Î¹ˆˆRi‹ÈT1'EÍÙ™‡TÊEÛ½û«•E3™‹»Šf„8Ç[´H…eṲ́«eUUTidhCXˆˆ‹Ýí„UZ½î˜ˆB…5›”HsHƒ\ÛÜíÈXS\ÌÙˆˆƒ"IŠÌ—SC4ˆ¬ª©WËW̙̉º†kµx™¬˜c3DŒ¹©uCFˆ«½Ü¼Êˆd4˜«Š†©T‹ÌÖJdFŠÞÚˆ…!$4ˆ·Š¨ˆºŒÍ½Ûˆ‰t[»½…EB5x¹¼S38ˆœÍîÊË3UEÏ興ƒC#ˇU2XˆˆÍÝ´4XªÝÌËTeh§Vv˜iÌexfz…k”[µkÅY«»Ë»¼µy‡ewTXT¹xÌšª„Š…Z‚6TH¸•‹…¼·|µ‡iÍݹ¼eTHˆ…TDI¤[·U…EÛîèŒs\Ùˆˆ2"$k¬Ý¸E˜hÍÝÇB"5|íîÛe3E‡jËTD5½»Ë¸DÊxÜdxcLÅ9Æ6ˆ›ÌÇœ¥mÜȈˆ…"igËTe35ˆˆ˜xˆ¼˜˜Uuˆ½Þ†¨ˆˆ‡3"6‡ª…Dh‹ÍíÜÙDŠZܘˆƒ!6­ÝÜC53Œºˆd$ˆ‹îÜÌÈhs3uH»
 ‡ÊtV‡xœÍÝÇECF…WeETzªÎÜÌÈXÆ5«g«˜wºiÌT43js7eˆˆ¼Û…v‹íˆ3gY–S3EŒÍÌ«ƒ$T\ì»ÜSi†Îܸ…3Uy©wUS#hˆˆÍí«º›Ì¨¸23"hˆˆÛ›Ü˜Ì»Ý¨ˆƒ$…;î´42ˆŽîÄZƒ\ɽÅ3š‰Þʈˆc52*„‹·Wºd½ºÜ©ˆ¼e«SW3k¸›¹ˆ•¾Ù›B7U‹º™ˆD»«¼Ýµ‡2D2Ü‰ÇD…IÝìͧG¶7†CDBH¦œÝÍ«·DS8ÌÜË…gt½»ÌgS&…g˜TXd|»ÍܦŠ–{”4¤4f5ˆˆÎÜÜ™ˆ˜Txˆˆ«y·D¦DŠxªw†U˜evTz»½ÝËÌ…‰uUeV¹VºD›ˆÌ¨ºS5fY¸x¨EW«ÝØh…D½¬ì”D235{Ý̺‡4Vœ¸Uv‹Íî؈ˆCHx»–B3EŠª»´6™‹Ü¼ÝdVvz§W¦V¬¨ÍÉ‹µ#D6Èx†C8ˆŒÞé¬ÅjÊ›–S2$EyíÜìv‰3WxÌ–S#G‹ÞÞµxBlËÌ»”HC<ŽËÊ5d&ÖJÉhCGsµžÇÊš¹XÛ͘ˆS4"kf¬wVœµžæmÓ3vKÍ웶4vj†hCT#ˆˆ‰½ÝƒkGÎý‰¹S¬U»t33#xŒ™ökÔ*ÌŒüˆˆ#|Úßë32½Îí‡A·]þÜ¥5Xݽˆˆ43W¸ˆ½¥}ælìšÌC8Æ#È2Ž„ŒÇg‹ÆJØ"ltÎí̹S4×|예#•D\HD—ˆ¼Ü]ÞkÈ‚7«H¾cTƒYÞÞ«„!¥LÏØUR#GÙÞ£lRNÈδChˆˆîý“'‹ïþˆ…,ÌÝë“5”-ù5ì3ˆD3Yµ¾üyc®îúˆ%ŒüβSnítEH†g¸EUCEÍÞí·AXˆþï²""žïìˆQ„Jݼ†œÄƒ3\ïȈS1?Þʈ‚ ‹LþT„ˆˆËÏöLÒ&¸œÞȈƒ Fˆßîs#ˆˆÿý˜„™EÛˆˆˆ‚"E½ÛœR"8ˆˆŽ¼Ì2ÆUîßɈ‚*RßÖ«b"wˆéŒÔ\µÞví³¬2¹¬ÇM‚&@HˆŒ†ì5¸(ÉYìíç­3®¨˜ˆ‚W~þ΂2}ëï³u#¬5ÈGÈK×%cWÚÏéDRÍÞýµFsm鈈R“Wé7‹%ŒËÜÖ¸Kx&ÕTÚ›w&2XˆŽë6Rhˆÿü¹„%ʜʈˆˆev";ƒ:Ô4hˆˆÏ…É¢¼ÜÎÙ2D•Iì4…3LU›ŒÆœù[ÍCÍTܧjb=3~²]B-dÌÄ…[œ}ìx’†Š»(ECËÈë
 jE^ƽ³TE¹¬ØJ‚Ú=ä7²+„HˆˆˆÜË3ÆËß܈„DØ«¨ˆDèXä3hˆŒÕÌ‹ïZÛˆˆUÉDÃ!3\ïÈU!HˆˆþS4GŒïíØ‚MÆ<ÙE¤Ä[²T6îÚµ43^¬ª’4Êœÿ³I2Ž»ÞQ(xÞìƒ!~þû„míþA%(‹þ…´ÎÌï‚u®ŸèD¡HnÝ5˜wDîŒÛlØ»ˆˆˆˆ„5C$*ä&µˆ‰ý#…5yÝîÃ+Ã|︈Q$¹\éÔüîÚI¹DÌDC3XíKÙ!$«¾ëR2xˆŒýbÓ)ÎßꈈˆƒKMBÝǸV]î¼ÄrK¾Ýë”"X¼ÍTd!Wˆˆˆˆˆþ»Ç$—Þ興!tKï·T3"mÈß²;Q>ØŸä:³3x«Î„GR$˜ÝÝΚDw˜í˜ˆ‚H"ÎiÝC‚ˆˆÎ¾ÃC„]íÝ„UH™Ò#RKǼÌ9YËÚä;•+¼½èu¸dK¨zblÔyCX1x‰½ƒÌsÌÌÿE4[¼ÿcS#®íèˆR!8Ìݼ¨CFSØUÝ[„4ˆ:ìŒãÄ^þ˘…A7u§%Ç&ÞÖX©TD¼¦†lîK똈ˆˆˆcFA7SXˆˆˆŒ·¼»\ÌËÜ„ÍRlxyy¨‹r6£*•\”Z„ÎÚ¼Å9³<ÜX§ZͼÈC2fîëÈ!%hÏûÚA#T¾ÝݸzDj–ˬº…$17ºÞÙ{2#W­Û¼BdH¬Lî·ÝÅÛ•Uz5¾¹ˆˆTB#„5µkÇkí˜í4ˆ3:ܼÉGt6Ìk¹†™ˆ¼¸D„6º©¤SYFÞÞÛ§D¦6ÝDÚB|ǍÚ3TAI5ˆˆˆˆÞ‡Ý˜ÌÈx˜#ÝSδk„]ÈD‰¤725Hˆˆ‹…ˆˆ‹ìÍé4œfÍÉË“L·»ˆ‡c"yX›B5xˆÍ½Èu{ÉÎ鈂t;îÜÈTˆbJ3HDˆˆˆÛwÈfÍÎí¸ˆˆˆh¨ˆE”3‹DLCEUÉ«yœ—™ÛÄLÍjeFt6VÌ‹ÝȸkÚVƒ#b9¥¸­—ªCHWͬ݋ÊYºÊˆˆ„7#¾s«3U$‰hˆˆŠÍ¸½BÚ令d¬ˆˆˆˆ‚4hTˆˆˆœÍÊWY˨»Ì˜ºhÇXˆgˆe‚4“LÜ|¦D§¼íŒtDdCkº¬Í•xÇkvk…E¦]ÕKB&thˆ‰·Ì½î»Ùd«™ˆˆˆCb(ÚŒÅT$XV¬cHˆˆˆˆŽ×®Úݹˆˆˆ†¨"e$ˆZÊD–mì‹„43›ÞíÌT5ˆëˆˆC"¥#•XˆˆŒŒèMÖ\ԬȇX«HÈYØ]¸x2#C¼«ÌGÈDÛ4–5ºÌÃVDlÍÝÚËSvW«˜X¸5ŠT‹”
 ¾ë©DXy¼ÆRWˆˆì­c{ÛܨS33Uf½•j¦|˜ݥuC7X­ìÍ„G¨¬¨Cd!4ˆˆ§y˜ª¼Ýµ‹Uh„™T½žü¨‡"$LïÌ¥2#KœìD§CˆClÉÞÝÛd5TLí»“78ßéÉSC5H»¶‡sEhˆ›ïìÛ•ˆ¸…gB#CZÝ»¥SGËÍ܈SFºÎåZ¨EDx…hËyS3%ˆ‰Ù›ÌÇ­Ų̈ˆ†237tlx¼”U˜‡ÌÍÜÅ4SHÜܺ”GdŒÝÆT"#HˆÞîÛƒDW­Ì¨„"Wˆ‰¬¦™†ÌÌÞ눈"#3k¼Ý×xÍܸˆˆB$hheCF‹ÝþË„$XÞÛuREˆ›¦WˆˆÝÞˆˆ…S3Ud[ÈeW†h«¼Í•d4·ìÍÉ„D3zÌet!hˆˆ¼ÝÍ݉ËTUTkÛˆÊB5TZ·eT5ˆˆ‹ÞÜ•‡h½»ÌȈˆˆˆ„3RE™ˆCEˆ‹ÜË‹uLÜÞʈˆ4V™ªeU"6GˆˆˆˆŒÝȝ¹­Û¸ˆˆˆˆˆ3C#xTÜ3ixŠÌ΢š´W¸{§YÈUËIìCX":„Ïص3UKÞ„WBŒ1%xˆËüW̦X„ZD¹eeuX̩ܽ–“DCEVi•‹Õ;̾þ¨ˆˆˆtD…#D&ˆîÖUR5X¾í‹Ù2e8ÎËÞˆˆˆB3#«U\„kÝÆ]ÅL¶œÜθˆˆuS3EDX¼–…Tl¼ÌÉDC[º­Ì¹šˆ‰–˜‡z»[ØEs"UDÎʬ¸»´8tk–¼·hˆºØ›eC&¸mìuƒ"Œ›ÝÊ…E{ݺT34›ÞËËdy¹‰d„%Û„™5½ÍܹRET½ÍÌT‹‡ºd˜h¸½·›bWCK‡hV™XË[ÈŒÝ͸D24WÞ»Ç$ƒ7ÌËÈ5uYÇλ܉´"S)ÝœÜH¤GeÌBvCl»¼º˜­×Ã44{{݇d$¼œéYS9”¬´y¦{…Z˜†œË̃ZDŒØ¦CCX»ÎÕETmÛÌ”D2Ü¼¥DX…«”EWŒÜ̦C5«œÈT2E›ÞˆxCG¼ÞÌ˘h„jƒ8…k¦¥2L·Ï×iB%ˆ½ÝØ«Ûx†EuݹˆƒCˆîÙ{!HŒþìÈ"iJþ¸„!37̝Ûz͆»ƒ$T8È4–ˆîïÙˆC#ZË̳3„IÙDhU›Þë¼UY›™†c#DJ»º¼Ì»ÚSw4¨Hºh„Z¶H„Jˬܺ¹–Š¦UCLÊÏȈˆ…#6EU3ˆˆˆ»•xº¾ýÌ’%TÛŠ•X»Í¸…C"HxÝRg4hˆˆÌÝÞëY¤DGºWÅ3ÌyÞ•D"D‹ÆWdH½Þ܇uH¬Ê«28t¾íˈT7šˆ
 ´22Fˆ­•8ˆˆŒËÜcÜ­ÜˆD˜ŒÊˆˆˆ2"3XˆˆˆˆÞüÝ”wD™ftE¦4ºŒí‹ÙEDfe‡S3xˆœíËÜ‹ËȈˆ#USgw„KÜδ½ÔYTE24H‰‹Ì™–ÍÊ͵HR8¨©z¼œÜ˨ˆ36Cl”Œtˆh•E˜lÜȈ«…œR:î…JÃßé"ÎQ=þ’èÏúâ,ÿ°ÿ²=í0Nâ8ÿÐÿÃ.Þ_å#ßòîCÞý 
ýFÌÊÿ`?ÿ°ß9îsßò$ßÒ#»+ïç /øtº•,úý0ÜlöQþ±=ÞrI´,þÑßÔ¨¹C>ä#ÏÛ ¼¸¾ä@.îR¬|3Ú‚Oé‘&Þ˜Ûd%ÍÂ6Þ³4µMÞÓ¿±;øÌ;ç"èAMÚ(ýA=ì²MÙ!¾R>îÒïC̓3ö$ÿ¥2f¸Oö!MœcÏçéŠ{„‘.õýÍ1<ÓŸà‹ÿ1?ãJ£JÞû0îêTLVø üÂníþ!üå îËÔNïä¿ÞÒ2KLÒßþ@$ŸÎâ_ÝQL߆Ïþ0뜅7Üÿ žüs!ƒ}þ!¼û34ô«ØoÿB™íƒKÕrïëÈšÝèYÏìyG&_þ°í2œ3.ü0?ÿ Å9ÿàÿQÿƒ31zïàÿ¾EÙÄ=@Žþ}ëkÝStî .ÿ2L´Tÿ€õ@HÿSÿAÿ¹X2»Ë:Îñïþ£D-þ¾ì0?ÿ†0¾ÿàÿS9Ì„Y Xïäõoç,Ö ý3$¾Þé å!\ÿåC oÿÁÝBˆSïëÂ
-ÿØ!ÈÌã*þÖ]ÿø ÿë ÿÁCÏú"Wÿó"÷#cOû 'Ïþ"ÿ¶#ÞÒ Xßü%ßüƒÏñ:ÞíR"ÿù8äJÕ#ÿòßû“ ßô!nþ!ÅMÿP_ÿ@2NþRÉß´ 7ÿ ›ïÛB¯òÿÒ6ßÿ"«í wïãþ€$ï£>ý0^ÿa#$ÿ2BoÿÝÝÉ ŒÿA\ìÓDgÏë .ÿåˆ?ÿ ½Ï ßô‹ÿÂ&ÿíÿ"Þÿ²îú4ÞþÿüËÿT	îû -üýÏû=ïõ$<ÏÀ!Nßõ Nÿànïâ.ÿà½ÿä0<ÿ ïí3a+ÿàîÿ Ûü=Ýÿ1D½ý{;ÿV¿ñkýìďó _þÖ ~nù ^¿þV?òw¿ý)ïù!8TßèÞ ,ÿùrýáþþB}Ð,¼%XÿÐoýˆ» ,ÿR,ÿÀóÿÛ %ÿD¬ôÿÀÿø OäÞÅ ÿÀÝü"S<ÿ3ï–"NÿD#:ïû€ÿå <×¾Äïþÿ­7»0òÿø ä,ý‘þƒ¿ã>î0¼îcSªßêƒ/þ"+½ó"mþEÞîJ"mŸåZßë îä*}œü@ÿõ ¯äï4Pÿ ÿÂÒ*Ýí1OòîD÷,þ¸¸ÿEcÞ0O¢]Ñ8ÙìÁ6$ÿ쥲 ÿ ÏüÔHÿï”18ý[û!ܱÏçÊí3[Ñ›ÝÔoÔ$ÍÇßÆÄC-È^¸6|Ì!L¶ˆŽ½þ¤%è[Uæ$ŽQmîó6DÛÎ#3Ïã"¿‚8¯ÿ±íR\¬ßÈQ»ôHˆïî²|Æ%ÿë˜42ßA]ÿÓM;"{<,ÿë’AhŽþãÙ+Ë3ÿÊ{êˆ %ˆˆßü“K!Fÿü3ݘCCx¯ôNü„clÿ³Ëù+ùÇNÔ ô ]þ4ÿ¨‡10WŒý”´vï¢#Ì)ÿÔ#ÌC¿ý€E WïØ™9‚_ý32D„7ÿ7ç4¾é!2UGßýr]ƒïþ£#c"Îâ:Þýÿ%J±Gÿë{t!$ÿ{½¹29MÛs<Ó¿ê2BˆŒþ¿Ç@>þ́äJÒ"³ïá?ý—!R3ïâ;í™LüžÂJIþ¡"ýFïÒ½1HΫî’=‹ËäZSD7â+)è(ÿìRCCõ)ÞËÁÿú7ÿ÷Îßb$ï¹"X÷­^ø‹ÍŠ‚ßó'4ï¼ëA&ÞP¿þ¸ClïØ#UËoýËÜRê@luí
 íû0,ãNý¸ ÿÃÿàÿÂ-þP_øeþ£Ý‚{ïÓ Mÿã[Ë<ÖïòˆŸü5„îØB0ÿ’ _ÿ6ßùÈ=|þ0ÿâÿù4Ã!$ÿh%Ëí1^î!5Þ#ÝíBþRŸüˆë ¬ÿ‚ßýÇcæcˆÿýÿýþ^ÿã _ÿØPˆÿ±%ÝÿÂ<í¼2{ÿâ½ë¸Ü°ÿámïTë6´¿Ò nïá
ÿîÉ0
-þR¶‚Dßü xÿý X¿á)roÿÓ Oÿ±_Ýý¢",îoÿÙ@2&ŠþÜ#È>ýµ (í}3ïû” 6ÿý`ÌîaÞþ Lÿè„1ž¤ÞÞ >í2ÿÃ<#¼Îé NÿåýÃ(0hÿÐ.ü¨ÒßÃÿ&½Í¯ëp<.ÐïcïÙA¾à)^½ëGë®úm"ìLMÛëm´ßé&â<Þø ÎT#ÎÿÑ#Ù¾4ÏÀ:9ºBïðËþô$ÍÅÿü ­ÿ ,ü¹^ÓÏü‘ÿAìÔÍ4Žïû3ÈÌEíMÞ؃ Íÿp
„Iÿ‘û_ÿÙ„ 6ý¿ÿBÿÐ-‹"ÌÿÑ™CŒÿõ¬[ ‹ßø!ßÛˆ@-Âhÿ=íe_øg«’ÏÊXÿâ<íÚR ˆ‹ÿÂ8ÿ¸ º÷Ìb#Õü2'éîµ'íÛ4#!ˆˆÿõdk4jû'­bŒÿû@ÞÞÔ'¾x@%Ïÿ1%ÎnÒLÜ4 GÿÏ‘2ž¸2¯è%!çÏ€ä>2ÎþÈ MQŒ9ÏÙ½AÏ‚Ž¿³íþ12'üÙ+û–@ßÒDMÿã"þÕA$¿ÿÂÔå¯þ˜pmýS-ü(Çîȃ ÔMä?úÏÿYq'M¬UÜ\4ÿüi ŽSWÿã)‹þ˜2ÿÒxÿó'êÏêþ¸ÈÍõ-þþº2´þ![þ0*ßø"aMSIÅßô?þ>°?0+ôßÐçŸÃ/ÿ°ÿØ ,+ÿ XïäÊÿò»2$$onþtŒ[{ÿü +î÷ <ßý2ýb_ý3EÃ-äNÃ=YîPíþ°ïþ0ÿëXÿâ¬ÿóÎê#=Hÿ4¶ÈTïÎê -ìЏþä OÿÊ€ïø>ÿp at iÿüP#o#»ø.Ñ#ìÿÀÿ¸ %ÿû%ÿý˜ Oþ 6ïþ!!‹ù^Ülë73+’$ßýÓ ßþ`oëÒ#Ïþ” ?ÿÊ /ý2#ÛoõBÿöíÝ;ý;1þNÂ$åÛ8ÿý€ÿ#¿õ^Ò!TþA:ÿ÷ÿÈÿÐn»Ü¥Ä ÿÐÿú"ßÃÜŸÿÉ oø‘ïÄD^Ú4ë3#EØ.ÿÙ.öRŒïÛ$¸e5EpˆÿÍ”®² hÏó8ݦx2¶Îõ"ÿýÿ2ªNþɈ -ýqŽôÜDþc©c¿ÿ$‡¦E>Ó½Ïâ½Û1&ØïÞÈ…$|HÏûT½ÃOãEOñíåWþ7ÿýWe Žÿ ,îû!/ûŒ!#FÏÿ2ÿB$[í×® Å´IÝíÍé3§!ˆÿ
 ÛÔ;ä ÿ°voôêCE<âÿüˆÒmÎ1~ÿ3,ÞÓ~@Ïÿ¹	V˜1>¤¿ýBÿ²%#ì_幁$h½ïžÙ¼ûSœ¬Ös4!xÍSnÿëˆ!BèH{ÜÕï¢;ÞAÏüsS;ÈžÒ-îÃ1+íd"­mnþˆD™ ‰Žåîè ÿ´½Q^ý· .çšÿü¨A6ß1›ûþ0ÌSîxcQ¿ÚÔ%Ô	¾äÙÿ!r,ïAŒ8ìßÊ4l´9è=ÿÛ8þG·*ýí3XäIÍÿÛ‚0-îLAÏü(a.3ŸB…ê/ô
-´kšlõø$œ:Úë
-^þÉU:Cp?3ݍÓ'ÌaßÛb{Þ´GpOB3Þïéˆ0mݶ#ÿåwÌÇÍ /ÿ£]¡<잍é€\ïp¾g,Îì¥Í13ŠËI¾BíÿÅÌC½!ß ã”^#hÏÿ³¶@>W¾$ÿ13æÝ"Þ"U?þ‚<	õÿ:ø…@¾NóßÛøþ©‚ _üé h¾E9ÿü…5ßÒ#›^.üíX¿ð_òÏ@ÿî¡"ÓÏÒýIW’Þþ§„1W'ÂÎþÂyý<øÃÒþŠý MÌþîù… ;ÈþA$¾î#fïë4îûÌ øEBßü4 /ҏÑþªq/þV&þœ‚.Ìœ3Nþ¨‚Ì´ŒÊÌs¾-ÿB¿ìŽŠx#ÎÒŽBËh£þ2îý"TÎÕ$LÿDßþ³NþS ŸüR|þxßþÃü(Ïÿ¹@þÅOþ"ANëÄ#þë ~ÄS$îÀ¯ó¾Q•3Þ±C„þ4šdï²5AÿÕ";ì‚2~þÝ¢-ëƒ3×+g]þJH¥ä,<ïÊ8@þÝ"¿ö#Ƥ~½´ßUìßЮÌÔ Oîûˆ¬¼±BïÐ&ŽþãÄúDÆI¿@?ÿ2}ã4çNÖA+êß1µïäAÍßÇ!ßÆ“øê%!nWrO³H(oÿ¼`ÒKDOÿ¡!.þúƒÿ³oûD1XÈÿû2!ސ?þC„®?ó¯0	äoôK Ïñìÿԁï&hà>îü@þ—³î_ôŒ"?^üLÜê€ýÒm¬îÕMºCŽÿ‚ÏA2-ÏÅS&ß$äËݐ&ÿøƒHÓBXyÞóUNþ]ì­ý’c2:~÷UØ­Õ ¯t2HÏïÚp-#dGŸÿÅ_í1J(}옵 HŒÿ°/ÿK.Ú-âÿý‘þ“!'ïTK¢<ö17ü'ïÃà ßSÅ-ÿ¥Û€,²#Xÿ±!ïÐî;îÒßü0ÿÕ¹ˆS0‹ïñ¾ï@.ÿ 4ÎÿÉ2RU|´\ÿ˜ Oþƒ]D¾^ýUÝ¿÷ÿñ¦CÿX,Íê» ÎBˆïüR-û$%ïê´#ìî€þCµå­ 	Ô8ÿWÎã OÿDCD›ØCÿʇÿ"Û3MCeïÚ 'Üïù!";Èÿ예Œ4œîbŒMÿƒÜϗ݉Ú0hÿî²½‰Ìî·!ÿä-ƒÂ,3®ÿÓ‹ò»ýÛ€\þè(ûÁ8Ïÿ¹ %ÿùcèÒ<<ÿ*Ûü¼K"hßù£S,Û#Žßä #Ïÿ²^gtS¿üFMÝÃZÙÄ!Íþ"ÄLüBVÍü”*ÿâ«ÿR
 C*ïý ÿûRI\ļÜγ$Ez‹ÎñcmýAJ¬³DXÜÿQ3ŽîÄ"«é#˜d<ÚjW§^ÀãÏ	Õ»)ä‹W|K…}F{ŒØ0/þÈ ìèÙ"ûµe\ÙW„JdÕ„¶|LKš^,9˪8¨^G…-Ü3LÓ”å´FÛl-+Â^cN¸6L¯E&­ÜÃK/„µ´Æ¨tiƈÁìÅÁŽ®ªMGƒÙÈáä/áoÀÿ‘â'ùÓß\ýPïÂÊ#Î=+¦Ø.ūͲ΂L³ÕE"tKÃg∈¾RÍnšˆÎ¨ˆˆˆˆˆˆˆˆˆ‚2lƒ"hˆˆˆˆˆˆˆˆˆ‰yxµŒçÃÍÍGíÚˆ†L¨ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆCJ‹I33ŒBwˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆŒÔ«µÚų½æÈ]ÈÊ,u̘ˆˆˆˆˆˆˆˆˆˆ„Ȉˆˆ…¶¨…·,“¼¶²¹TÓ’ÚU²ÊC´>²ÒË”Õ'ÓʃX§ä³UˆˆÄˆˆˆŒHˆˆˆˆˆµ™ÛÛ•ÓCËÞ\•¼-b¸™åM$…̃›;V»ÉË££Õ¬âí.²§¸Øˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ„ȈˆY:Lƒ¢Í\4I‡t[H3ê=CÅŽ•»3ThÍLKcÊ9xˆµˆˆˆˆŠhˆˆˆˆˆˆˆˆˆEÉãT‹Î2Ö}‹È9âÝÕ^ŵ:“ÌÈãNƒã·xÉŠÃÉ»˜„Ã؈jˆˆˆˆˆˆˆ†¨ˆˆˆˆˆˆˆˆˆˆˆˆˆ‡˜bŸISLg–ƒ)xˆˆ‹^9HˆŽW<HˆˆˆˆˆˆˆˆˆŽ5µxˆŠhˆ‡Ê<FŽ*GŠ´ê/SÈFâgX¸÷ÖÚâÞ„ž5æ…>-ØI¸˜ˆˆ„È…µ¸Lˆˆˆ‡˜Z˜ˆˆyY;ÅŒ$ºSÔ2æ´uSœ¬ÁÂòÒØ·¹Ø[Ækâ^&k‡cKHé6Õ{<«Å)¼/uÌÆêr„µÏyˆ;£8DçädCL²Í8(5¥—‹XˆˆˆˆŒ‰ÃXÄÍG[ãËXJŽÒÞ2Ü]UÙ,ÒÞDÇ6ãÛ.B^(ð½T•<Rí6Å?‡·Âå˝æ\‚é.y;ºˆˆˆˆEÒ8Ä‹DÜÌ&Ò?sØ.\KNBäuÈ>E»cRÄ:òL#ÅL„ÕM6‹º£¹M¬Ev®=:„¼Å”—Åͬ<b“IÝå½yW囼YGËLY¸¸ÃV=ÕsVM8suË{=’äXļE²½MäµÃ»Ud;Ô½/¥¸Me.µÑգ͍£«ÂǬ4Ý-2ô=+â=‚ö²â…ÔÎ]MIÈ‚[ã¾7Ù-âµ3²ÜEh?—ËFÔN<Ý5‚­,Ù;,¸YÂœ(Ò\Cä;6ÓhÄŒJzvÛ]ÈÃJdÔÜØÛ6¢
 Í•\-Âò6´žDüƒÕy£ÔÖ×Ü[ˆ‡”³N¸bÇF½=3frfw¶Ìk#8cÈ]ÄÔ-¼Hµ³×‡½MӍSÜ>—ÖKÑÝ,Ò扷Z.9Ó8ÂÃ=3Û[Âj9ÔÖW¥|ٍ;ã˜Ë³]…õÅd;“Õl'„]±÷MÅMÇÆ]d“ÓªœI„¨•N,s±®[hVEhˆˆÙ|Kƒ¼[Ս8äœÃÊ+¢è-Ü=‘՝HEå®D^…ÅŒ¬L‰„Ɉˆˆ„ÇKYIÓt;,)jw«FSµÇY8[]K׌KG{¥ÕËfÒâ¼UãÌÈN9Uå=T<ÊÝ<H8š”lT‡ˆe»KuÍ(–´Ãçµ{<\Ì;‡Ì-ÃÛztT{´ÒœY”ÄkäÔ¦h­{Ƶ>#Õ\œYM#S}SÔ…D¤F——ˆˆˆˆÅk†ÄÈMËŒË=K‹—ÊÄŠ(”|[œ5¸Ö‰»‹L•>/=œ‹‹zL<\•¸[ˆiX…k+UYš[6ƒTÓI„«†˜Dh‹¹Ô‰JźtÒžhÙÖ׌J„º”ÌM^*ÒÌX’|“Ä]'´‰ƒÎE”’ÔË]:­U¸=kÈH|=lÅ™[{9”Ë›ƒU[Õ^Œ]ˆ³LNTw5=¤ÔDH9MƒØ.QȃÖhHĵ‹^:Å›^Iºlwlm,µËd‡¤UÄ\¨­5Ü6ÙMZÙ«EâΧ†µ¸´ÉU[kÈ8(³«{FuE;‹<Z”LF¼8³ØGÜ^Z¸H<ˆ}ÃÚl—N;Ç•ˆ•â¸<GÚUãŽ6¤D¥©I‚ÚkgX«—“º×u´8¼„Žx|‚;k©[Cæ.‹†«TżÈÌ»D¸[µª[U£KG{E|J‰5³µH¤Å¤‡Æ|l=y<œNv¤kæ»V´ˆM£ÌEL†J<ÈÈŒ,Y]\¬k£Ô–ÈÊxY·|L§¤Ã“¶´«:TL;{hKBuˆŒf[|KIZÉŠ”Ü|ÒÊ<ÅÈüWtYÅåluÜG¢[HflY´”â´´»=„˜=²æ{†ÃÅL³ëNc»<ÄžWä:Sªk´ì=Š<’Ùyy{HèM'„=eÈi;¨HU.C½8ňK³ÜH~,£Í/=>:Ä>X׍“·+‚ëhlLi¸Œ<Å=;º¾-µn5>[ÈĔջ—˜Lcƒ<u%Ò>4´>Y[¤ÕH•ˆ‹æ½K‹‰|uÉmÄÇ\½4Ä]N<L¤œFÅ=’Ú,”ºIÕl„ÄTä¸L4³¸ÆL“Õ=²ÞSä¼L³µƒæÔÍsÈ-FÖiˆl\¤Z”–U[ÉÔ…HVÕ›b­6ÒÞ%ѬGÕ\ÃôkX‹;âÝ\çKµÌ"LlXBî„â¤ãMé£ÇHñNDÙ§,ÕNÈœˆ„5ÌÃ)	ÒçTÈZ7’Xˆ
 ‹X§}\ۍ‰œ¼~NDÔKÚˆ9}ˆG"9Ç:2†¶©tˆŒM:­(Ï+»ã;ní,â‹NJÂí$ø€?êé žôN¸bꈈ#Þ8Áã.DÁlÂÅYÒŽÄGˆˆˆˆ‹Xˆ™ž%ŠhÞÄLÄ쓍·¹…K»AæµÂäšÚn;DTŽÌ;Á„̆\µ³ŒTÛu’»Â×·ÆÌ;]¼¸y‡T“ªãŒC,Ó»dƒT3ÄÊc˜VµŒmt‡ÄÄÄê˃´ŒÇã<„ÄÍZB¶×Ø’Ò¾‰”:-½ÔDMŒå¨C£¾XË-Âå²F[ÊÈžÄȈˆˆˆˆˆˆˆˆˆ-DscźÄE8cXiFŠÉ[…ÓjHˆŠÔŽ<h;UyKÌ+²fWˆŠœË¤Ê¥š×l»Ý+|,¥“µ®g”u4µKŠ(tÊ»ÓÕµâÍÔêkƒ¸=¶¹ˆ„„׸jsTWÌx“ZÉÓµ=̹ƒ,Ø}jSV»l…¢8c×,Rə¸u‰WFˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆËÛå¸Ä¾[ä‹ÃÔes\DÃ_:ÊTR³HX½©êHKi”™¥íͨw(w¾L˜ˆˆˆˆ„>(Ö»˜ˆy„ª[˜ˆˆˆˆˆˆˆwf[CˆK7%LTÈ<5xˆˆ‰x¦ˆŒÛ9s–…W‰‰DˆˆË:hˆˆˆˆˆˆˆ—›»´Úu؍֍(¼}³wW‹Hu•Ìäµ4Ò»Õ–w††w|l£xšË¾Iˆ=9yȼŸˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆJ+$$UÌ»hVLTUGÄÍÌ‹Kƒ„;wŽ¼Ü<CIH…\HºjDµ«º·½†­x²¨ièˆ$V]¤¶3šleTyÓ¨XˆŒÊÉÕÄÖ¹ÚX£«Xw¸ÙjdMc³3´„ê;ÄæSãÜ›{5ÈÍ•Èyu\'ÃÕ³ˆ9w×ăth{§¶Hƒ§f¬»Å=%Ý}Cy<Ûìµ´7ÕÜ=ÔÚˆˆˆ‡;LK:ÅÔE2GG„{–œˆ³5¦ŒY×̓Ö>6‹ˆÈÍe,´$º]ĵ…ÎvÔ]ÓÌŠ¼MeÄ«ˆ]5W<²œ*³yC¸=c½CãM”í=ÃÛLèMD§X´MMÍ=eK(…ƒ³§´šZ¸ØxÒ}Xê=Ø>›ÌUu?RÃt´Ì<4H¸ætR¹›Å²”K|¸ˆºXJ;uäÍL¨LËņ´Ý¹ˆƒØj„È[ˆˆIY(s‡+ˆKe¸Fs»Œ¤„œºÕY:Ø\\¹XÓ‡ŒÇN6µ.’Ê,³¼VÔ½t¹}\ºLŶ¤[•4fT¥³†‚»DÄj´ÈHX‹lé‹Åé;„[VÖ×ĶŒª…ƒs„Ú‡S‡mÉV„ÛÌÄk-ÕËw|·Ùy…´…²äSÓ]7´K‡ÓH(l{X˜KX
 ¹K<ƒŒ´Ù«¶KLµ®§è»¥Œ<ƺVÆ\ˆˆK7›5¤[+CYwĘ„•^D¦xǹ[ˆËy§}:³¼‹¶‹h´‡W|H™†V‰Ø¤™\ØÉj¨Ôh´Ç|gÅC“ZXX8ˆ©„³HGÄŽUÌMÛ©D´½uÅuÙÛGG\vÆu\EÄ“¨=‹·¼hÅ›…¶ZÔ½Kǽ[”HtºTÓª„¤\XEEG\|Š¥yDƒ\lÙ‹Ej;µk™Í^¼\£N*쨈ˆ‡WªZ¨LbfE£¤“”‹XxˆUYX»µ´­«>,…ÍJZˆÇ×f•µK´©U×H¦:v»Ù‹h\Ö»T‹LËʃ‡IbÄh•Ü(U-e—5µžWÙzµË.GË…ÖŒ”˜YãJ—Wd“¨³›S̈ÙMg†–•Œ›™\ÇÌ<µ<‚ÌGÙœtTEC‹M¤©sÓ<HKFÇËÝF46ˆˆ›¾åËHĝÕÍȈ‡˜ˆˆu¹ˆˆˆ…uDdG}c[8uM6—…xšÊlX—¸•¶Ë¸ÈTÅ{¸˜U•ºˆ‡SU§¼K½‰©4ÔŽ†ºÅxĸ˜†;Uš—…tš&h;¬G§Œ‹\u\‰ÕÕ·›”ªWˇ—ZÔ˜”ZD·F»=\Mˆštµh˜ŒÌ‹Œ…“¶‡æÊKyÈFBZ;›·x“Ã)C¨NËÍH5DUµ{–Ý[ÃkŒ\ê¬Ö†˜K†ŒÇ‰ˆy„ÄS…YHHHˆ•vEHmzjF»liyºMzŒ¸ŒY¤Uؙֈ6tL‡Ãº[hÆ‹\[LH¼½–IeŒ†ÓÄk„‰8³[CÄz´{dš\[lzXØ[Ê{„œ‰‹X¸ºÄ¤¤˜vXSœ«ÕySÈlG·ŒÈØx•[HÕÆÙ·ÊyUS„ˆÕÌW³BCT·Ì¹k‰8cµEÇmvªDµÈ­jÎ]ØMX¨ÔÈ”ÌLˆˆˆvXJHIT¤f‡G‡WtÄ»X•UÄÉŽXËhÄk™[ˆi¨µXC¸\”É<UµvÇØL„ÈŒ´ÆlEÙ|ĸETµx‰‰ˆš¨Š©™…Ex—gw™ˆ†Yƒ#ÍÚ¸~•"\kÉˆ‚?B|åBÜuS(Nä1\ÜüxˆˆÓˆˆˆ‹ÿü$ÕbZÞ؈ˆ6'¹0(ˆˆ‹í罫#8îܸ˜„7I2ë8%ÚÆÍEU|“9L»Iì…C8‚Z|M<ç‚(ŽìÔŠG,Õ…KïEÅ“6®çC$ÞI¤r՝–\þŽÙqƒ¬S"Wˆ›‰×Ýd4^õXkWtš¼¼Í¶™ˆˆ†tVkÛ’278‹ÕDDÜ%ˆˆŒHºÙ×Î{cSŒ¥¤ÈÌE2IÜ­½B\ڍ‹Û˜eD¾å‹5Ké#"HˆˆˆˆïÛ&F=Ü„¤|ÎÅ$Û}êerkÎdW¶4»'ä›ÆH
 ¦†‰…9Q–Ü3tˆˆ¼Üd4×<Ü;¬åÌ8¬ôE3DÎû×Ëè'S{į́„TR'2‹zUÖ}ï‡B*Ã]UÔÜ:RÞÞ݈xCŒœs†=¸ÖF#T¤]Ør{ä^Cs¶¼CÆîø4&]ÄXRH{éDK]¤{lG¼ÓºmÈWC­]£#*׈hÔîôè=²¬rTŒÄT­eÛCtG%cìÓÚ#KZÊï$ÝäXš5UÿVD=ÕÅÍ‚EÌ-Ã<b·uüdí$Â9D‰é:jÓBˆßÌ©½5GêfbX«Ï–çƒ}ù~Ûˆ…*²NËÈXä½4x¿Å1•ÍÌ¡KÜT[e}ÉKÃÝ¹Ú G–˜¦~ì¸ü3ÂWF’?æVâ$Ë4IFŽíÏÂïÌ… É4¿Ê,ÜÇ=’߈ق$üB¸$èŽé+ÊÇ‹^ˆ‚î!Nî—BÛ^âîM…WEßÄÏÍs+Ô1O&ïÇQShµÿ°Íä@G‹½ÉþA|þ¨<"Jíïþ¸ÝŠˆˆì˜C…fCÐŒøø”†2ˆ‹íDÞÔTÜ@ûC#ïÕn˜ ýSïÙj…=ÙT=õ,ß¡xˆˆˆÙwïñÞÕt¾Ó2¾Á>þȈKa^é€-ý¨3L%.þ +ۍT»D-çˆÈßÈÒUŽòÿô£LáÿãC®H·MÂ+ü ÍM‰ˆˆþ$*®Ûoù /ÿŧqx?Ò_”5ü²ê_ä¯ðDþQEVRÍÿÕ4SÍï!<ÿS,"%ßÿpœì¥M‚;tįÇ2Ë‘Hˆˆˆßó"ŽÃ³ÞDÿÁµMóîb,ÿɈˆ߸ˆ#ÒXÞÇXüÓݸ "¬Ý3â6ïðˆ‰¼ß³Bÿê Ξçi=<èÉP<þJ¼"4â6ŠÿüA:0ˆˆˆˆÍø'ŒÝ±GÿÙˆ‚4¿±ßþÄA™_ÍUü¨‚ XîõÏþ˜Pˆˆýÿ× 'ˆÏþ6OÉf ÿý‡b<ä%Xßäí2"XØõ"$ÿŽÐˆÿý!;þ2–!ìÿ¹#ÏþKèˆ( %ïþ¸=ˆXˆ¾ÿAwÿ˜1~^ÿ8¼¥#"DÍÏ÷8XŠäܝü!<\ø.B$΋íÇb£mïü¡Þþ¹ˆ+ŠÈ™©Õœ8è%ïOµC!mïô-,³Þ؈‚,QµŽüDj ì/ôË#ÌÜ» HïÒ∎û´+ïÔ1+ï²AÿÙ@:‚Ï Xÿý˜ˆŽ%ˆ¯ÿÂtÓFˆˆÿÙ‚èîèÈŒ0-SGíNûʈ<¾Ìø¨!#lÇØ]ýì-’Wˆÿù2'ˆˆÏÞúˆˆ*ËsËò
 Ý빩)í„;È\ݵ‹1WˆˆÜßöØ‚4Žÿé5m”"{;xï³ÿ¨‚ %ŒÞý4›Žõï°ŽaÎqÏÐ:íÓmïÞÈ3ÿÇÄNûÜBÞÅ ÝþÛÿÒK&å16ˆˆ¿ÝÍéˆ ϼk®ìˆˆ"OXô¼Û† ãMä,E¾Ä"\þÔ#&Eßý HˆˆŽÿë2³"«Þü*ØÑ"%HÍÞݽ¸… ,ÿ¢þ¨ˆPˆˆïþt¼ 4|Ûá9ÿü˜ˆ@hŒÿû˜‚ ]8ˆÿù„ 5Ëî멨ƒ!¯ÀGÏÞúÒX¾ë¬ÕCFK%¹=ÿʸ`Äÿý:#Ýfÿ¨ÜR½.ҏýùˆ‚(NÜüµÜ1"ÓxÿŠî0{ÿö ï”)ü˜ˆ iSìÌ…[ÞR6ïÒø´ß¼1hˆˆßçìÏ(ÿê zí3›îâë„@
-ßã<ù	þ逴ïþ¨ˆ€­Ãßó_ÀˆŒVˆþü¤'ŒÂ"*ìÿóÓ.Roÿн†ë˜ƒ,W~â'ˆÿò#î3\Œ%ŸÞÿå#WˆïþŠ’ß7¾Úˆ1ýˆ!#«EïüUNB4WŽÿÜ#CkšLÿû„±!XîßTI²/°DÝß숈шˆˆÿý˜ %ˆï£Žùˆ!ý3„ØNþ1õÿÜ興+ÛR½þ¹ˆxþÌÒ4ÿ¹€XŠ~ÿê„%xÿ%›,ÿÔWïö¶ž¸AWŒóßû‘,Ü’[«íÙ>–MÖïŒé]Q•hÏÿ#Ž±#îÓT/ùŒ‘(’*ÿQ3¤ßùÝ-ý -7ÿNþ¨ˆŒÕË\ïé1b.éˆÏÿ²~ÿ 5ÿÐ
ä¿ÑIÿýƒîúˆßä.þ ßðÖ? /þCÝ ˆïþ¸ ÿ %¾öì±!]ÿöNÿbä Ký(R\ÿû˜ %­Þè¿4¢ ŸýS
÷,•Þ^íË£Ìج@ýSƒ${ÿü@ÿü¡½ýá0(ÿ:Ïÿ¸‚ ÏùB^ÿ#6¯þ=B̾¢RȺTÎýƒ'Þ§¨ííˆd ÿƒ4^ãGû0?ñÈïü˜ˆ]0'ˆŽ¿þ@ÿ±=ÿÛ$1ÿ FÿÙ„´»Xÿý’ÐÅ$ÿÐt#ÜÉB*î?üTӍBhçÞí’¬
-þ!9ïåB'ŽþB"Ïÿ¸ˆˆˆ„ 6ˆïþ±_þ ¼ÿùˆ5 8Tˆÿ˘ˆ… ˆïþ,µM¶ˆÿý+‘ˆïõSNÖë0!ŸÞÓ,ÙBÉ1WïþQŽåBxˆÿýD¿{\g|ûˆ ˆŽÅNü¨€‚_÷}ÿäÅ1ïü³ Nwƒ_•þÂïü0GG/ÿ (žÿ@ÿϹ )ÿø–ï"GŽÿâÚÈ0%ˆßÿ˜SÛâíÞûÜùyÿüCs{œÆŽþíƒH­´=øsÂJÀFˆÿý•3µÕ 'ˆÿêÈ$ê`xˆþîÙ,"4¾þcÞÀ!8ïë"_e行WÌ?Ù$²xžÎë<û3–!%ÿä"³´OÃNíÜT -ÿèˆ.!F‹þSoÈo¹R!íÞȈBWˆˆÿý’¡!™tÏþ^ˆ èÃQmþÏ£é"aGÿý˜Ë$xÿÙ#ßÏÌÿ«ÄUÝÊ‚\ÞLëqÁ!xˆÿÄ"~Ÿ³ZSÖÔ^5%íîPß}ã¯Òö!­ïè€Îb’GÿØ"LíA+øÓlaÿü )ëÿ؈ Eþ]„žŽ˜‚ ªþܽ˜2xþåØÊ„@{û¼3Íû¤HŸÿÓ#ýólÿû”5]‚08ŽþÞ!ÎHŸýNÛƒ@ˆˆÌÿÙˆ‚,€#Œ¿ÿ˜ˆ@|¡#ÍïøˆÃHXŽßüCC“4hÇïD}^}‚_ïëA5÷- Gþå\²€Ý3‡…{üNяþK2þï0ÅmüÏý˜ˆ”#éïëTOÿ´ßÿEÓ0©"h‹¯ÿ¹€’‚89ïî1-xÊÇ-ÈÓ(2Žß¦³#ÎëNʃíú y®áQ7ÿý‘lýªø—F‹ÿü˜ˆˆ %Þµ½Þ¹„"Wß^üȈPWˆïëˆc HˆŽý¾ÚA2œÌϳt)ßR]8ÎÿÚƒ ÷/ü¸ÊC at X‹ÿû3Î 2HÍ4ïþ¸‚dßü ÿò ì[þ®ˆ5B$ÍÿêKc Xû2ÎÿZ<ÒÍäºcíC8îB$NÞ’<Å<þÙƒj2Gþžùˆ r¯ä*ÿÓ!üÑ$žÅÿÛ„3-Ó“$ßÒ½©"Žÿ³(ïLp7ÿÄ-þ"!ŒLûÞæxCB"»ïäÙ¸… $ü2Ïþ ο Xÿî¶b#‹“XŒÿûB³WŒý<þÈ…1†îè£íBÃ1½RhûÿÉR†– LÿDî·DÆ£Lÿû$¥OpxÿIÓ?ER5ÿÙˆLÞÑ%ﳎPDhÜW)ÿëˆ %þ¯ÿ˜F ‹üßÿ˜€
 g­ò%|ÿû˜€ÿòïþˆAWÿðîý×ÁHÓWŠÿü¨!zý$ßì˘@lÿ£ÿÛˆ€XØÏüÙLBWˆŽÿ눈1xŽØî쨈€XˆþÚí¸ˆXþëˆ1ÛGŒÿéˆ o€$hïü¢Äx¿ÿɈìË>ýü£/Û”KÕ½õØP ‹\æßÎȈ -·Ùß;ŒQíÖhˆŽÿ×N”3lÒVÎxíþË2]´Ãÿüyƒ#1—Ý„ŽÝ%XS?þ"8ˆ?ÿÃMìOܐ#$hüŸ£Ë 4TíÿƒB,í xüØþPÎ7ù 'íU;üþ˜€^½ßã8… h¿ò‰3æŸû5ƒÎFßÿ˜ >î÷ܯÐßÿˆ!²ÎÑÿì@xÿý“í¯Q	Œÿ ?ÿØ‹ÿüü0ˆÿق興Ïÿ¹ ®øHˆŸÿØ-¥!"Wˆÿý˜¦8ˆÿù 'ÿüþ¿èB#YÍÿøˆ .í¿B!ßý¨ %ˆŽéœþ¨„ ¸,Ç6Ÿÿ؁<"Ü'¯ïé0þÅ´oÿÙPˆÿ[ßþ˜#½ïå%Cê'2k”ßó߈ˆp7‰ÿÓIÝŽ’!ˆÿý”M¨0hÞÛM츬@!hˆÿšë¼#ÛV,ƒƒ•ßùˆÿý˜1óÖ!=üÍgOµÍQ)¿þ¸-BÔ4{üÿ˜#rÂGÿýsÍÓµ>ÿ’KÚ‚l$Ÿÿ,êJ„ FˆóÇ-ÿmÙ„ÁB#TŒþ*Õ´øP*ôßâÜ.ø‡!lçý¸Q½{ãˆÏû3R+ÿ2f$ÏÂ4R¯ÿÀžmÉ‚ Xÿ!Aÿ!~ÿè#^ÿƒ#ßõ$.ï“ F‹ÿòRï½Së&þ (ÿüQÂÿý CŸþ„Qxë5í_úHží¢%Ïÿ¹ŽÅÏýˆˆ „í³$<ÿû@Q5Íýßë@
¡iÛßû¹‡ ˆˆØßý¸„ ^ÿÕÈÎB*ˆˆÿÙˆ‚ XˆûˆÞc¾Ü¹HMýeÎR]Œ³‹Ïã#²<2nÞ_똀XÞ„nîêˆx¦ˆÿÙˆ#ñˆˆ¾ÿÔ"ÿ Kê邾;FbHˆÿý@ì,T"?TÍíÛ ïPLmžÄ׳ŽÃ2ƒ?ÿʁHWïHËïˆ!\ÂhÿÙˆ ;ƒhˆˆÿý˜ˆˆˆ‹íÿ¹F¤ WÈÿóÛ„l@þ¤åè½û Œßô³²HÛ¹nB²~ä"AXŸÿ _•iëV[Ø%ÿÒ5Ê$âýŠ¤1'ÿákÝûÔ¸3ý„æC#ˆïþ¸ 
ÞïR!*ïúùG3
 íۍì"W£7DØïÔì$ì1¨5cTÙ¾ó2!¾þDü¡CΆ<2{ÿüwBÛBˆÿ2ÏüUb"ïôÞ¼è€-BÌ‚OÿÊ3#Rø1¿è})C¨<íÐ-Û!HÞ6Ý=ü¨ˆ ˆüSÏÔ3·S¯ëÉû…R±ˆßø3ÝÜÉ0hùKîFHþ¿þÄ0XÿK̃¶H1#¿ÁOÿS#+¢;ÿ¸2CÜ¿$Xÿü¹ˆˆCnýØNÚ0>ç[ÿ=ÎÄ8û}õ>¿ÔBC"ˆþ‡lÞ܃û`H£V<è×½ÁÞë€ß1_ë3Ì¡(ÌÎÌKÔOôŒü®ì!‹Ì%ãú}D[Žú`~ÿëÏÓ"NÏô`8ÎÞÙ Ë&ÿR$^Ø^¯é4ƒ"&ÝãÿùR (ïÞ‘ßý]€>ïÀïå¼!B%‹ë®þ3'ã<Íë ,Í„˜7î½°Ÿÿ”°Œïû^ÚG!7Þïæ*A"\»5Ëß7ïÊ…%XˆÿZŒü†lÿÖ2¾¤S®ïâÜËÉ’xýn<³C"nï¸c-Ó3Õ(%ïþ1[ÝÄxŽÿ–»CHb)ÚŽýÄ2=ëqWÞûìzTH254ýt;íw)¾þÄQ"Oþ‚&LÿÃ5ƒ„=’4JþÝ£ÍÆIȼÖ)„S^‚Dîî3»¬ËC4xÏô5"ÎSLYÆ…ÕA;ØL»ûRL´ŠcyÝé5˜½í1&Ìí²©»Úr\¤½t«¶H´:Ú<v„\ÖM¥7ÞÄt4•I¼›œ“MÕXÈDw‚Më…X™ªv¼§µFDÆ{”8©wØœT»œÊVh½¼W˜©šuH͇82¾ÌéE3»„|…Ù|£µZ³TDlí¨Üe¹wCc$ÞÅj›†XC¤¼¹Ešdziy»»XmÖ4CD¾¼ÙR;Ȥ†{ÝÌ£"ZÛª!Ýî¥"M¦WS‹ÍÜTE¶3hÞÉ—C$›z¸gœ¼ÖF›ÈU3F¸ÍÛ¤5u›Ë…y‡Š˜U‰xwhŠ½ˆyÅT7‡hºÍ¤Dº»¤5‰ÝÜc$EkÛÆI»ÆˆZÆCG™»¬Èf˜SIy­Ü©4Ex†HŒy½Í«4U4›º…ZÛ»”4E»©»¹˜·UC'ÍÛ¼x¶Tx•vih¼Ë©t4G¬ÌyÌ»t$9EÍÊik̹CTD¬Ø»§wvˆeg«ˆË»¶DFS|ÌÈw«§TYˆºvG‹¼¹dEWÌÉFŠ¬wUEjš¹›{Ë„ET‹ª¦‡›¨–‡Eˆ›˜ª¼˜dEDz««ºË•UWˆ‡fk¹¼¦h…F¸ˆk‰¼…U…xx·ˆ¼É†UUas de 404

-; - chaque addresse est le deplacement dans le segment 600
\ No newline at end of file
diff --git a/engines/mortevielle/original/1/TEST.COM b/engines/mortevielle/original/1/TEST.COM
deleted file mode 100644
index 1171cfb..0000000
Binary files a/engines/mortevielle/original/1/TEST.COM and /dev/null differ
diff --git a/engines/mortevielle/original/1/ZUUL.COM b/engines/mortevielle/original/1/ZUUL.COM
deleted file mode 100644
index 4436635..0000000
Binary files a/engines/mortevielle/original/1/ZUUL.COM and /dev/null differ
diff --git a/engines/mortevielle/original/2/AFF.COM b/engines/mortevielle/original/2/AFF.COM
deleted file mode 100644
index d64d397..0000000
Binary files a/engines/mortevielle/original/2/AFF.COM and /dev/null differ
diff --git a/engines/mortevielle/original/2/AFFAMS.ASM b/engines/mortevielle/original/2/AFFAMS.ASM
deleted file mode 100644
index 79bdafe..0000000
--- a/engines/mortevielle/original/2/AFFAMS.ASM
+++ /dev/null
@@ -1,310 +0,0 @@
-title affiche_le_dessin
-
-prog segment para
-       assume CS:prog
-affich proc near           ; pile appel :
-                                       ; Retour
-                                       ; y affichage
-                                       ; x affichage
-                                       ; offset dessin
-                                       ; segment dessin
-
-
-       aff: push ds                  ; sauve DS
-            push bp                  ; sauve BP
-            mov bp,sp
-            push bp                  ; sauve SP
-            sub sp,112h              ; 112h octets de locales
-
-
-
-; transfert de la palette dans les locales en [BP-64] :
-
-            mov ax,7000h
-            mov ds,ax                ; DS = segment de la palette
-            mov si,2                 ; SI = deplacement de la palette
-            push ss
-            pop es                   ; ES = destination : locales sur la pile
-            mov di,bp
-            sub di,64                ; DI = offset dest.
-            mov cx,16                ; 16 mots de palette
-            cld
-          rep movsw                  ; transfert
-
-            mov si,4138h
-            mov ax,[si]
-            mov [bp-258],ax
-            mov ax,[si+2]
-            mov [bp-260],ax
-            mov ax,[si+4]
-            add [bp+8],ax
-            mov ax,[si+6]
-            add [bp+6],ax
-
-            mov ax,[bp+12]
-            mov ds,ax                ; DS = segment du fichier dessin
-            xor ah,ah
-            mov si,[bp+10]           ; offset dessin
-            mov al,[si]
-            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
-            mov si,[bp+10]           ; offset dessin
-            mov bx,16
-            mov [bp-142],bx          ; par d‚faut
-            or al,al
-            jz aff00
-            mov bl,[si+2]            ; nø de couleur du masque
-            mov [bp-142],bx
-
-     aff00: mov ax,6000h
-            mov es,ax                ; ES = segment du dessin decompresse
-    datpal:
-            mov ax,[bp+6]      ; Y
-            shr ax,1           ; Y/2 lignes paires a afficher
-            mov bx,80
-            mul bx             ; 80 octets par lignes
-            mov bx,[bp+8]      ; X
-            shl bx,1           ; 2*X car un point du dessin pour deux pixels
-            mov [bp+8],bx
-            mov cl,3
-            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
-            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
-            mov [bp-100],ax    ; Oct_dep en bp-100
-            mov [bp-102],dx    ; 0 si affichage courant sur ligne paire,
-                               ; 1 si affichage sur ligne impaire
-
-            mov ax,[bp+6]      ; Y
-            and ax,1           ; masque l'imparite de Y
-            jz prem_lig_paire
-            inc word ptr [bp-102]    ; 1 car premier affichage sur ligne impaire
-            mov ax,2000h
-            add [bp-100],ax          ; memoire video pour lignes impaires
-prem_lig_paire:              ; calcul du point d‚part [bp-106] :
-                             ; poi_dep est un octet tel que le seul bit a 1
-                             ; soit la position du premier pixel d'affichage
-            mov ax,[bp+8]
-            and ax,7         ; reste de la div de X par 8
-            mov cl,al
-            mov bx,80h       ; 1000 0000b position par defaut pour une
-                             ; division par 8 entiere
-            shr bx,cl
-            mov [bp-106],bx
-
-            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
-            neg ax                   ; nbre de points pour le 1er octet .
-            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
-            mov [bp-108],ax
-
-            xor ax,ax                
-            mov [bp-110],ax          ; cmpt y
-            mov [bp-114],ax          ; init
-
-debut_lig:  mov si,[bp-114]
-            mov ax,si
-            add ax,320
-            mov [bp-114],ax
-
-            mov cx,[bp-108]          ; Nombre de point(s) a afficher
-                                     ; vaut 4 lorsque tout l'octet va etre afficher
-                                     ;      3 lorsque les 6 bits de droite vont etre re-afficher
-                                     ;      2 lorsque les 4 bits de droite vont etre re-afficher
-                                     ;      1 lorsque les 2 bits de droite vont etre re-afficher
-            xor ax,ax
-            mov [bp-112],ax        ; compteur en x
-            mov ax,[bp-106]        ; AX := masque ecran
-            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
-            mov dx,di
-            call litbyte
-            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
-            or bx,bx
-            jz lig_paire
-            dec word ptr [bp-102]  ; la ligne suivante sera impaire
-            sub dx,2000h
-            add dx,80              ; DX = octet du debut de la ligne suivante
-            jmp sui2
-lig_paire:
-            inc word ptr [bp-102]
-            add dx,2000h
-sui2:
-            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
-            jmp un
-
-     aff01: shr al,1
-            jmp siutd
-
-un:                                ; 1er bit/pixel du point
-            mov dl,es:[si]         ; no de couleur du point dans la palette
-            and dl,15
-            cmp dl,[bp-142]
-            je aff01
-            shl dl,1
-            xor dh,dh
-            push si
-            mov si,dx
-            mov dx,[bp+si-64]      ; DL => 1ere couleur
-                                   ; DH => 2nde couleur
-            pop si
-
-            mov ah,al              ; AL masque positif, AH masque negatif
-            not ah
-
-            test dl,1              ; Bit BLEU
-            jz deux1
-            or [bp-246],al
-            jmp deux
-     deux1: and [bp-246],ah
-
-      deux: test dl,2              ; Bit VERT
-            jz trois1
-            or [bp-248],al
-            jmp trois
-    trois1: and [bp-248],ah
-
-     trois: test dl,4              ; Bit ROUGE
-            jz quatre1
-            or [bp-250],al
-            jmp quatre
-   quatre1: and [bp-250],ah
-
-    quatre: test dl,8              ; Bit INTENSITE
-            jz siute1
-            or [bp-252],al
-            jmp siute
-    siute1: and [bp-252],ah
-     siute: shr al,1                 ; 2nd bit/pixel du point
-                                     ; decalage du masque
-            mov ah,al
-            not ah
-
-            test dh,1              ; Bit BLEU
-            jz deud1
-            or [bp-246],al
-            jmp deud
-     deud1: and [bp-246],ah
-
-      deud: test dh,2              ; Bit VERT
-            jz troid1
-            or [bp-248],al
-            jmp troid
-    troid1: and [bp-248],ah
-
-     troid: test dh,4              ; Bit ROUGE
-            jz quatrd1
-            or [bp-250],al
-            jmp quatrd
-   quatrd1: and [bp-250],ah
-
-    quatrd: test dh,8              ; Bit INTENSITE
-            jz siutd1
-            or [bp-252],al
-            jmp siutd
-    siutd1: and [bp-252],ah
-
-     siutd: shr al,1                 ; decalage du masque
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-            inc si
-            mov dx,[bp-112]
-            cmp dx,[bp-258]
-            loopnz i_un              ; boucle tant que cx<>0 et compteur x < taix
-            jmp svte
-
-i_un:       jmp un
-
-inter_un:   add dx,4
-            cmp dx,[bp-258]
-            jc tani
-clb:        call litbyte
-            jmp un
-tani:       mov dl,[bp-140]
-            or dl,dl
-            jnz clb
-annul:      xor dx,dx
-            mov [bp-246],dx
-            mov [bp-248],dx
-            mov [bp-250],dx
-            mov [bp-252],dx
-            jmp un
-inter_deb:  jmp debut_lig
-
-svte:                                ; affichage de l'octet precedement calcule .
-                                     ; les masques B, V, R et I sont stoque dans
-                                     ; les locales en BP-246, 248, 250 et 252
-            mov cx,4           ; 4 plans couleur
-            mov ax,80h         ; prepare le masque pour l'octet suivant
-            push cx            ; sauvegarde des registres utilises pour l'affichage
-            push ax
-            push es
-            mov ax,0B800h      
-            mov es,ax          ; segment video
-
-            mov dx,3DDh        ; registre de selectiondes couleurs
-
-            mov al,1
-            out dx,al          ; selecte BLEU
-            mov cl,[bp-246]
-            mov es:[di],cl     ; affiche
-
-            inc al
-            out dx,al          ; selecte ROUGE
-            mov cl,[bp-248]
-            mov es:[di],cl
-
-            shl al,1
-            out dx,al          ; selecte VERT
-            mov cx,[bp-250]
-            mov es:[di],cl
-
-            shl al,1
-            out dx,ax          ; selecte INTENSITE
-            mov cl,[bp-252]
-            mov es:[di],cl
-
-            pop es             ; Affichage termine . Restaure les registres
-            pop ax
-            pop cx
-            inc di                  ; octet video suivant
-            mov dx,[bp-112]
-            cmp dx,[bp-258]
-            jc inter_un
-            inc word ptr [bp-110]
-            mov dx,[bp-110]
-            cmp dx,[bp-260]
-            jc inter_deb
-
-            mov sp,bp
-            pop bp
-            pop ds
-            ret 8
-
-affich endp
-litbyte proc near
-            push es
-            push ax
-            push dx
-            mov ax,0b800h
-            mov es,ax
-            mov dx,3DEh
-            mov al,0
-            out dx,al
-            mov ah,es:[di]
-            mov [bp-246],ah
-            inc ax
-            out dx,al
-            mov ah,es:[di]
-            mov [bp-248],ah
-            inc ax
-            out dx,al
-            mov ah,es:[di]
-            mov [bp-250],ah
-            inc ax
-            out dx,al
-            mov ah,es:[di]
-            mov [bp-252],ah
-            pop dx
-            pop ax
-            pop es
-            ret
-litbyte endp
-prog ends
-     end aff
-
-;******************************************************************************
diff --git a/engines/mortevielle/original/2/AFFAMS.COM b/engines/mortevielle/original/2/AFFAMS.COM
deleted file mode 100644
index 577fd5a..0000000
Binary files a/engines/mortevielle/original/2/AFFAMS.COM and /dev/null differ
diff --git a/engines/mortevielle/original/2/AFFEGA.ASM b/engines/mortevielle/original/2/AFFEGA.ASM
deleted file mode 100644
index e9320e3..0000000
--- a/engines/mortevielle/original/2/AFFEGA.ASM
+++ /dev/null
@@ -1,305 +0,0 @@
-title affiche_le_dessin_sur_ega_low
-
-prog segment para
-       assume CS:prog
-affich proc near
-; --------------------------------------------------------------------------
-; Pile durant la proc affega :
-;                       [bp+ 4] Retour
-;                       [bp+ 6] y affichage
-;                       [bp+ 8] x affichage
-;                       [bp+10] offset dessin
-;                       [bp+12] segment dessin
-; --------------------------------------------------------------------------
-       aff: push ds                  ; sauve DS
-            push bp                  ; sauve BP
-            mov bp,sp
-            push bp                  ; sauve SP
-            sub sp,112h              ; 112h octets de locales
-
-            mov dx,3CEh      ; 3CFh pointe sur le Bit mask register
-            mov al,8
-            OUT dx,al
-
-            mov dx,3C4h      ; 3C5h pointe sur le Map mask register
-            mov al,2
-            OUT dx,al
-
-
-; --------------------------------------------------------------------------
-;      Calculs sur les variables d'adresse absolue  7000h:xxxx
-; --------------------------------------------------------------------------
-
-; transfert de la palette dans les locales en [BP-64] :
-
-            mov ax,7000h
-            mov ds,ax                ; DS = segment de la palette
-            mov si,2                 ; SI = deplacement de la palette
-            push ss
-            pop es                   ; ES = destination : locales sur la pile
-            mov di,bp
-            sub di,64                ; DI = offset dest.
-            mov cx,16                ; 16 mots de palette
-            cld
-          rep movsw                  ; transfert
-
-            mov si,4138h
-            mov ax,[si]
-            mov [bp-258],ax
-            mov ax,[si+2]
-            mov [bp-260],ax
-
-; additionne les coordonnees relatives dans les parametres de passage :
-
-            mov ax,[si+4]
-            add [bp+8],ax
-            mov ax,[si+6]
-            add [bp+6],ax
-
-; --------------------------------------------------------------------------
-;      Calculs sur les variables d'adresse relative [segment : offset]
-; --------------------------------------------------------------------------
-
-            mov ax,[bp+12]
-            mov ds,ax                ; DS = segment du fichier dessin
-            xor ah,ah
-            mov si,[bp+10]           ; offset dessin
-            mov al,[si]
-            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
-
-            mov bx,16
-            mov [bp-142],bx          ; par d‚faut
-            or al,al
-            jz aff00
-            mov bl,[si+2]            ; nø de couleur du masque
-            mov [bp-142],bx
-
-     aff00: mov ax,[bp+6]      ; Y
-            mov bx,80
-            mul bx             ; 80 octets par lignes
-            mov bx,[bp+8]      ; X
-            shl bx,1           ; 2*X car un point du dessin pour deux pixels
-            mov [bp+8],bx
-            mov cl,3
-            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
-            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
-            mov [bp-100],ax    ; Oct_dep en bp-100
-
-            mov ax,6000h
-            mov es,ax                ; ES = segment du dessin decompresse
-            mov ax,0A000h
-            mov ds,ax                ; DS = segment de la memoire video
-
-;-----------------------------------------------------------------------------
-;  - Calcul du point d‚part [bp-106] : poi_dep est un octet tel que le seul
-;     bit a 1 soit la position du premier pixel d'affichage
-;-----------------------------------------------------------------------------
-
-            mov ax,[bp+8]
-            and ax,7         ; reste de la div de X par 8
-            mov cl,al
-            mov bx,80h       ; 1000 0000b position par defaut pour une
-                             ; division par 8 entiere
-            shr bx,cl
-            mov [bp-106],bx
-
-            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
-            neg ax                   ; nbre de points pour le 1er octet .
-            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
-            mov [bp-108],ax
-
-            xor ax,ax
-            mov [bp-114],ax          ; init
-            mov [bp-110],ax          ; cmpt y
-
-debut_lig:  mov si,[bp-114]
-            mov ax,si
-            add ax,320
-            mov [bp-114],ax
-
-            mov cx,[bp-108]    ; Nombre de point(s) a afficher
-                               ; vaut 4 lorsque tout l'octet va etre afficher
-                               ;      3 pour les 6 bits de droite
-                               ;      2 pour les 4 bits de droite
-                               ;      1 pour les 2 bits de droite
-
-            xor ax,ax
-            mov [bp-112],ax        ; compteur en x
-            mov ax,[bp-100]
-            mov di,ax
-            add ax,80
-            mov [bp-100],ax
-            mov ax,[bp-106]        ; masque binaire tournant
-
-un1:
-            xor dx,dx
-            mov [bp-246],dx
-            mov [bp-248],dx
-            mov [bp-250],dx
-            mov [bp-252],dx
-            xor bx,bx
-            jmp un
-
-     aff01: shr al,1
-            pop di
-            jmp siutd
-
-        un: push di
-            mov di,es:[si]         ; 1er bit/pixel du point =
-            and di,15              ; no de couleur du point dans la palette
-            cmp di,[bp-142]
-            jz aff01
-            shl di,1
-            mov dx,[bp+di-64]      ; DL => 1ere couleur
-                                   ; DH => 2nde couleur
-            pop di
-
-            or bl,al
-
-            test dl,1              ; Bit BLEU
-            jz deux
-            or [bp-246],al
-
-      deux: test dl,2              ; Bit VERT
-            jz trois
-            or [bp-248],al
-
-     trois: test dl,4              ; Bit ROUGE
-            jz quatre
-            or [bp-250],al
-
-    quatre: test dl,8              ; Bit INTENSITE
-            jz siute
-            or [bp-252],al
-     siute: shr al,1                 ; 2nd bit/pixel du point
-                                     ; decalage du masque
-            or bl,al
-
-            test dh,1              ; Bit BLEU
-            jz deud
-            or [bp-246],al
-
-      deud: test dh,2              ; Bit VERT
-            jz troid
-            or [bp-248],al
-
-     troid: test dh,4              ; Bit ROUGE
-            jz quatrd
-            or [bp-250],al
-
-    quatrd: test dh,8              ; Bit INTENSITE
-            jz siutd
-            or [bp-252],al
-
-     siutd: shr al,1                 ; decalage du masque
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-            inc si
-            mov dx,[bp-112]
-            cmp dx,[bp-258]
-            loopnz un      ; boucle tant que cx<>0 et compteur x < taix
-
-     ; affichage de l'octet precedement calcule .
-     ; les masques B, V, R et I sont stoques dans
-     ; les locales en BP-246, 248, 250 et 252
-     ; Le masque Noir est en BL
-
-            mov dx,3C5h      ; Selecte toutes les couleurs
-            mov bh,dl
-            mov al,15
-            out dx,al
-            mov dl,0CFh      ; Bit mask Noir
-            mov al,bl
-            out dx,al
-            mov al,[di]
-            xor al,al
-            mov [di],al
-
-            ;mov dx,3C5h        ; registre de selection des couleurs
-            xchg bh,dl
-            mov al,1
-            out dx,al          ; selecte BLEU
-
-            mov al,[bp-246]
-            ;mov dl,0CFh
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            ;mov dx,3C5h        ; registre de selection des couleurs
-            xchg bh,dl
-            mov al,2
-            out dx,al          ; selecte VERT
-
-            mov al,[bp-248]
-            ;mov dl,0CFh
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            ;mov dx,3C5h        ; registre de selection des couleurs
-            xchg bh,dl
-            mov al,4
-            out dx,al          ; selecte ROUGE
-
-            mov al,[bp-250]
-            ;mov dl,0CFh
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            ;mov dx,3C5h        ; registre de selection des couleurs
-            xchg bh,dl
-            mov al,8
-            out dx,al          ; selecte INTENSITE
-
-            mov al,[bp-252]
-            ;mov dl,0CFh
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-
-            mov ax,80h         ; prepare le masque pour l'octet suivant
-            mov cx,4
-            inc di                  ; octet video suivant
-            mov dx,[bp-112]
-            cmp dx,[bp-258]
-            jc inter_un
-            inc word ptr [bp-110]
-            mov dx,[bp-110]
-            cmp dx,[bp-260]
-            jc inter_deb
-
-            mov dx,3CFh
-            mov al,255
-            out dx,al
-            mov dl,0C5h
-            out dx,al
-
-            mov sp,bp
-            pop bp
-            pop ds
-            ret 8
-
-inter_deb:  jmp debut_lig
- inter_un: jmp un1
-
-affich endp
-
-PROG ENDS
-     END aff
-
-
-
diff --git a/engines/mortevielle/original/2/AFFEGA.COM b/engines/mortevielle/original/2/AFFEGA.COM
deleted file mode 100644
index 6fd86b9..0000000
Binary files a/engines/mortevielle/original/2/AFFEGA.COM and /dev/null differ
diff --git a/engines/mortevielle/original/2/AFFHER.ASM b/engines/mortevielle/original/2/AFFHER.ASM
deleted file mode 100644
index e1b3eb1..0000000
--- a/engines/mortevielle/original/2/AFFHER.ASM
+++ /dev/null
@@ -1,245 +0,0 @@
-title affiche_le_dessin_sur_hercule
-
-prog segment para
-       assume CS:prog
-affich proc near
-; --------------------------------------------------------------------------
-; Pile durant la proc affega :
-;                       [bp+ 4] Retour
-;                       [bp+ 6] y affichage
-;                       [bp+ 8] x affichage
-;                       [bp+10] offset dessin
-;                       [bp+12] segment dessin
-; Variables locales :
-;                [bp- 100] octet de deplacement du debut de la ligne courante
-;                [bp- 102] nombre a ajouter donnant la ligne de dessous
-;                [bp- 104] masque de d‚but de ligne
-;                [bp- 106] cl de d‚but de ligne
-;                [bp- 110] compteur relatif en y
-;                [bp- 112] compteur relatif en x
-;                [bp- 114] indice dans le dessin source
-;                [bp- 120] compteur absolu en y
-;                [bp- 122] compteur absolu en x
-;                [bp- 130] taille en y du dessin
-;                [bp- 132] taille en x du dessin
-;                [bp- 140] bool = est un dessin ? (./animation)
-;                [bp- 142] numero du masque
-; --------------------------------------------------------------------------
-       aff: push ds                  ; sauve DS
-            push bp                  ; sauve BP
-            mov bp,sp
-            push bp                  ; sauve SP
-            sub sp,112h              ; 112h octets de locales
-
-
-; --------------------------------------------------------------------------
-;      Calculs sur les variables d'adresse absolue  7000h:xxxx
-; --------------------------------------------------------------------------
-
-; transfert de la palette dans les locales en [BP-64] :
-
-            mov ax,7000h
-            mov ds,ax                ; DS = segment de la palette
-            mov si,2                 ; SI = deplacement de la palette
-            push ss
-            pop es                   ; ES = destination : locales sur la pile
-            mov di,bp
-            sub di,64                ; DI = offset dest.
-            mov cx,16                ; 16 bytes de palette
-      tr01:
-            mov al,[si]
-            inc si
-            inc si
-            mov es:[di],al
-            inc di
-            loop tr01
-
-            mov si,4138h
-            mov ax,[si]              ; taille x
-            mov [bp-132],ax
-            mov ax,[si+2]            ; taille y
-            mov [bp-130],ax
-
-; additionne les coordonnees relatives dans les parametres de passage :
-
-            mov ax,[si+4]
-            add [bp+8],ax
-            mov ax,[si+6]
-            ;shl ax,1
-            add [bp+6],ax
-
-; --------------------------------------------------------------------------
-;      Calculs sur les variables d'adresse relative [segment : offset]
-; --------------------------------------------------------------------------
-
-            mov ax,[bp+12]
-            mov ds,ax                ; DS = segment du fichier dessin
-            xor ah,ah
-            mov si,[bp+10]           ; offset dessin
-            mov al,[si]
-            mov [bp-140],ax          ; 0 = dessin ; 1 = animation
-
-            mov bx,16
-            mov [bp-142],bx          ; par d‚faut
-            or al,al
-            jz aff00
-            mov bl,[si+2]            ; nø de couleur du masque
-            mov [bp-142],bx
-
-     aff00: mov ax,[bp+6]      ; Y
-            shr ax,1
-            shr ax,1
-            mov bx,160
-            mul bx             ; Y div 4 * 160
-            mov bx,ax
-            mov ax,[bp+6]      ; Y
-            and ax,3
-            mov cx,2000h
-            mul cx
-            add ax,bx
-            mov bx,[bp+8]      ; X
-            mov cl,2
-            shr bx,cl          ; X div 4 car 4 points par octets
-            add ax,bx          ; AX contient l'off du premier octet d'affichage
-                               ; dans le segment video
-            mov [bp-100],ax    ; Oct_dep en bp-100
-            mov di,ax
-
-            mov cx,[bp+8]      ; X
-            and cx,3
-            neg cx
-            add cx,3
-            shl cx,1
-            mov [bp-106],cl
-            mov al,3
-            shl al,cl
-            not al
-            mov [bp-104],al
-
-            mov ax,6000h
-            mov es,ax                ; ES = segment du dessin decompresse
-            mov ax,0B000h
-            mov ds,ax                ; DS = segment de la memoire video
-
-            xor ax,ax
-            mov [bp-110],ax          ; cmpt y
-            mov [bp-114],ax          ; offset source
-
-            mov ax,[bp+6]
-            mov [bp-120],ax
-            mov ax,[bp+8]
-            mov [bp-122],ax
-
-debut_lig:
-            call calcaddlig
-            mov ax,[bp-114]
-            mov si,ax
-            add ax,320
-            mov [bp-114],ax
-
-            xor bx,bx
-            mov [bp-112],bx        ; compteur en x
-            mov cl,[bp-106]        ; decalage pixels dans byte
-            mov ch,[bp-104]        ; masque noir
-
-un1:
-            mov al,[di]
-            add di,dx
-            mov ah,[di]
-            sub di,dx
-
-un:
-            mov bl,es:[si]         ; 1er bit/pixel du point =
-            inc si
-            and bx,15              ; no de couleur du point dans la palette
-            cmp bl,[bp-142]
-            je nonaff
-            push si
-            mov si,bx
-            mov bl,[bp+si-64]
-            pop si
-            and al,ch
-            and ah,ch
-            mov bh,bl
-            and bl,3
-            shl bl,cl
-            or al,bl
-            shr bh,1
-            shr bh,1
-            shl bh,cl
-            or ah,bh
-
-    nonaff: or cl,cl
-            jz outoct
-            dec cl
-            dec cl
-            ror ch,1
-            ror ch,1
-
-     siutd:
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-
-            mov bx,[bp-112]
-            cmp bx,[bp-132]
-            jc un
-            inc word ptr [bp-110]
-            mov bx,[bp-110]
-            cmp bx,[bp-130]
-            jc inter_deb
-
-            mov sp,bp
-            pop bp
-            pop ds
-            ret 8
-
-     ; affichage de l'octet precedement calcule .
-     outoct:
-            mov [di],al
-            ;mov al,[bp-120]
-            ;and al,3
-            ;jz nonaff2l
-            add di,dx
-            mov [di],ah
-            inc di                  ; octet video suivant
-            mov ah,[di]
-            sub di,dx
-            ;jmp aff2l
-  nonaff2l: ;inc di
-     aff2l: mov al,[di]
-            mov ch,3Fh
-            mov cl,6
-            jmp siutd
-
-inter_deb:  mov di,[bp-100]
-            add di,dx
-            inc word ptr [bp-120]
-            ;mov al,[bp-120]
-            ;and al,3
-            ;cmp al,1
-            ;je s1l
-            call calcaddlig
-            add di,dx
-            inc word ptr [bp-120]
-       s1l: mov [bp-100],di
-            jmp debut_lig
-
-affich endp
-calcaddlig proc near
-      mov dx,[bp-120]
-      and dx,3
-      cmp dx,3
-      je sub6000h
-      mov dx,2000h
-      ret
-sub6000h:
-      mov dx,6000h
-      neg dx
-      add dx,80
-      ret
-calcaddlig endp
-
-PROG ENDS
-     END aff
-
-
-
diff --git a/engines/mortevielle/original/2/AFFHER.COM b/engines/mortevielle/original/2/AFFHER.COM
deleted file mode 100644
index 9f7be45..0000000
Binary files a/engines/mortevielle/original/2/AFFHER.COM and /dev/null differ
diff --git a/engines/mortevielle/original/2/AFFICH.ASM b/engines/mortevielle/original/2/AFFICH.ASM
deleted file mode 100644
index bb04274..0000000
--- a/engines/mortevielle/original/2/AFFICH.ASM
+++ /dev/null
@@ -1,1060 +0,0 @@
-title affiche_le_dessin
-
-; Pile : [bp]    = old bp
-;        [bp+2]  = old ds
-;        [bp+4]  = ret
-;        [bp+6]  = y affichage
-;        [bp+8]  = x affichage
-;        [bp+10] = offset dessin
-;        [bp+12] = segment dessin
-;        [bp+14] = Gd
-
-PROG segment para
-       assume CS:prog
-affich proc near
-
-
-       aff: push ds                  ; sauve DS
-            push bp                  ; sauve BP
-            mov bp,sp
-            push bp                  ; sauve SP
-            sub sp,112h              ; 112h octets de locales
-
-            mov ax,[bp+14]           ; Graph Device
-            or ax,ax
-            jz Gdams
-            dec ax
-            jz Gdcga
-            dec ax
-            jz Gdega
-            dec ax
-            jz Gdher
-            dec ax
-            jz Gdtan
-            jmp fin
-
-  Gdams: jmp ams01
-  Gdcga: jmp cga01
-  Gdega: jmp ega01
-  Gdher: jmp her01
-  Gdtan: jmp tan01
-
-
-     ams01: call trpal
-            call trtaycoor
-            call trvarrel
-            mov bx,[bp+8]      ; X
-            shl bx,1           ; 2*X car un point du dessin pour deux pixels
-            mov [bp+8],bx
-            mov cl,3
-            call calc01
-            call calcpoidep
-     ams03:
-     ams04:                  ; calcul du point d‚part [bp-106] :
-                             ; poi_dep est un octet tel que le seul bit a 1
-                             ; soit la position du premier pixel d'affichage
-            mov ax,[bp+8]
-            and ax,7         ; reste de la div de X par 8
-            mov cl,al
-            mov bx,80h       ; 1000 0000b position par defaut pour une
-                             ; division par 8 entiere
-            shr bx,cl
-            mov [bp-106],bx
-
-            shr ax,1                 ; 4 - ( X mod 8 ) div 2 =
-            neg ax                   ; nbre de points pour le 1er octet .
-            add ax,4                 ; 4 points/couleurs par octets (8 pixels)
-            mov [bp-108],ax
-
-
-    ams05:  call deblig
-
-            mov ax,[bp-106]        ; AX := masque ecran
-            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
-            mov dx,di
-            call amslit
-            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
-            or bx,bx
-            jz ams06
-            dec word ptr [bp-102]  ; la ligne suivante sera impaire
-            sub dx,2000h
-            add dx,80              ; DX = octet du debut de la ligne suivante
-            jmp ams07
-ams06:
-            inc word ptr [bp-102]
-            add dx,2000h
-ams07:
-            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
-            jmp ams09
-
-     ams08: shr al,1
-            jmp ams25
-
-ams09:                                ; 1er bit/pixel du point
-            mov dl,es:[si]         ; no de couleur du point dans la palette
-            and dl,15
-            cmp dl,[bp-142]
-            je ams08
-            shl dl,1
-            xor dh,dh
-            push si
-            mov si,dx
-            mov dx,[bp+si-64]      ; DL => 1ere couleur
-                                   ; DH => 2nde couleur
-            pop si
-
-            mov ah,al              ; AL masque positif, AH masque negatif
-            not ah
-
-            test dl,1              ; Bit BLEU
-            jz ams10
-            or [bp-246],al
-            jmp ams15
-     ams10: and [bp-246],ah
-
-     ams15: test dl,2              ; Bit VERT
-            jz ams11
-            or [bp-248],al
-            jmp ams14
-     ams11: and [bp-248],ah
-
-     ams14: test dl,4              ; Bit ROUGE
-            jz ams12
-            or [bp-250],al
-            jmp ams13
-     ams12: and [bp-250],ah
-
-     ams13: test dl,8              ; Bit INTENSITE
-            jz ams16
-            or [bp-252],al
-            jmp ams17
-     ams16: and [bp-252],ah
-     ams17: shr al,1                 ; 2nd bit/pixel du point
-                                     ; decalage du masque
-            mov ah,al
-            not ah
-
-            test dh,1              ; Bit BLEU
-            jz ams18
-            or [bp-246],al
-            jmp ams19
-     ams18: and [bp-246],ah
-
-     ams19: test dh,2              ; Bit VERT
-            jz ams20
-            or [bp-248],al
-            jmp ams21
-     ams20: and [bp-248],ah
-
-     ams21: test dh,4              ; Bit ROUGE
-            jz ams22
-            or [bp-250],al
-            jmp ams23
-     ams22: and [bp-250],ah
-
-     ams23: test dh,8              ; Bit INTENSITE
-            jz ams24
-            or [bp-252],al
-            jmp ams25
-     ams24: and [bp-252],ah
-
-     ams25: shr al,1                 ; decalage du masque
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-            inc si
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            loopnz ams26              ; boucle tant que cx<>0 et compteur x < taix
-            jmp ams27
-
-     ams26: jmp ams09
-
-ams28:      add dx,4
-            cmp dx,[bp-132]
-            jc ams30
-ams29:      call amslit
-            jmp ams09
-ams30:      mov dl,[bp-140]
-            or dl,dl
-            jnz ams29
-ams31:
-            call annul
-            jmp ams09
-     ams32: jmp ams05
-
-     ams27:                     ; affichage de l'octet precedement calcule .
-                                ; les masques B, V, R et I sont stoque dans
-                                ; les locales en BP-246, 248, 250 et 252
-            mov cx,4           ; 4 plans couleur
-            mov ax,80h         ; prepare le masque pour l'octet suivant
-            push cx            ; sauvegarde des registres utilises pour l'affichage
-            push ax
-            push ds
-            mov ax,0B800h
-            mov ds,ax          ; segment video
-
-            mov dx,3DDh        ; registre de selectiondes couleurs
-
-            mov al,1
-            out dx,al          ; selecte BLEU
-            mov cl,[bp-246]
-            mov [di],cl     ; affiche
-
-            inc al
-            out dx,al          ; selecte ROUGE
-            mov cl,[bp-248]
-            mov [di],cl
-
-            shl al,1
-            out dx,al          ; selecte VERT
-            mov cx,[bp-250]
-            mov [di],cl
-
-            shl al,1
-            out dx,ax          ; selecte INTENSITE
-            mov cl,[bp-252]
-            mov [di],cl
-
-            pop ds             ; Affichage termine . Restaure les registres
-            pop ax
-            pop cx
-            inc di                  ; octet video suivant
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            jc ams28
-            inc word ptr [bp-110]
-            mov dx,[bp-110]
-            cmp dx,[bp-130]
-            jc ams32
-            jmp fin
-
-; --------------------------------------------------------------------------
-;      			affichage sur CGA
-; --------------------------------------------------------------------------
-
-     cga01: ;push ds                  ; sauve DS
-            ;push es                  ; sauve ES
-            mov ax,7000h
-            mov ds,ax                ; DS = segment de la palette
-
-; calcul des addresses des motifs :
-; - a partir de 6CE40 h et par pas de 404
-; - chaque addresse est le deplacement dans le segment 6000h
-; - bp-64 : nø15,   bp-62 : nø14,   ... ,   bp-34 : nø0
-
-            mov cx,16
-            mov bx,404;
-     cga02: mov ax,cx
-            dec ax
-            mov di,ax
-            mul bx
-            add ax,0D700h
-            shl di,1
-            add di,34
-            neg di
-            mov [bp+di],ax
-            loop cga02
-
-            call trtaycoor
-            call trvarrel
-            mov cl,2
-            call calc01
-
-            mov ax,[bp+8]
-            and ax,3         ; reste de la div de X par 4
-                                     ; 4 - ( X mod 4 )  =
-            neg ax                   ; nbre de points pour le 1er octet .
-            add ax,4                 ; 4 points/couleurs par octets
-            mov [bp-108],ax
-
-
-     cga05: call deblig
-
-            mov di,[bp-100]        ; DI := offset dans mem video de l'octet de debut de ligne
-            mov dx,di
-            call cgalit
-            mov bx,[bp-102]        ; booleen = ligne courante paire/impaire
-            or bx,bx
-            jz cga07
-            dec word ptr [bp-102]  ; la ligne suivante sera impaire
-            sub dx,2000h
-            add dx,80              ; DX = octet du debut de la ligne suivante
-            jmp cga08
-
-cga06:
-            jmp cga14
-
-cga07:
-            inc word ptr [bp-102]
-            add dx,2000h
-cga08:
-            mov [bp-100],dx        ; DX = octet du debut de la ligne suivante
-
-cga09:                             ; 1er bit/pixel du point
-            mov dl,es:[si]         ; no de couleur du point dans la palette
-            cmp dl,[bp-142]
-            je cga06
-
-; - bp-64 : nø15,   bp-62 : nø14,   ... ,   bp-34 : nø0
-
-            push ax
-            push si
-            xor dh,dh
-            shl dx,1
-            mov si,dx
-            add si,34
-            neg si
-            mov ax,[bp+si]
-            mov si,ax              ; offset du bon bloc
-            xor bx,bx
-            mov ax,[bp-112]        ; cmpt x
-            mov dx,es:[si]            ; tax du bloc
-     cga10: cmp ax,dx
-            jc cga11
-            sub ax,dx
-            jmp cga10
-     cga11: mov bx,ax
-            add si,2
-            mov dx,es:[si]            ; tay du bloc
-            mov ax,[bp-110]        ; cmpt y
-     cga12: cmp ax,dx
-            jc cga13
-            sub ax,dx
-            jmp cga12
-     cga13: mov dx,es:[si-2]          ; y * tax
-            mul dx
-            add bx,ax
-            add si,2
-
-            mov dl,es:[bx+si]         ; et enfin : la couleur
-            xor dh,dh
-            pop si
-            pop ax
-            push cx
-            dec cx
-            shl cx,1
-            shl dx,cl              ; ATTENTION Superbe !!!!!
-            mov bx,3
-            shl bx,cl
-            not bl                 ; DL masque positif, BL masque negatif
-            pop cx
-            and [bp-246],bl
-            or [bp-246],dl
-
-     cga14:
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-            inc si
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            loopnz cga15              ; boucle tant que cx<>0 et compteur x < taix
-            jmp cga21
-
-cga15:      jmp cga09
-
-cga16:      add dx,4
-            cmp dx,[bp-132]
-            jc cga18
-cga17:      call cgalit
-            jmp cga09
-cga18:      mov dl,[bp-140]
-            or dl,dl
-            jnz cga17
-cga19:      xor dx,dx
-            mov [bp-246],dx
-            jmp cga09
-cga20:      jmp cga05
-
-cga21:                             ; affichage de l'octet precedement calcule .
-            push ds
-            mov ax,0B800h
-            mov ds,ax              ; segment video
-
-            mov al,[bp-246]
-            mov [di],al            ; affiche
-
-            pop ds                 ; Affichage termine .
-            inc di                 ; octet video suivant
-            mov cx,4
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            jc cga16
-            inc word ptr [bp-110]
-            mov dx,[bp-110]
-            cmp dx,[bp-130]
-            jc cga20
-            jmp fin
-
-; --------------------------------------------------------------------------
-;                       affichage sur EGA
-; --------------------------------------------------------------------------
-     ega01:
-            mov dx,3CEh      ; 3CFh pointe sur le Bit mask register
-            mov al,8
-            OUT dx,al
-
-            mov dx,3C4h      ; 3C5h pointe sur le Map mask register
-            mov al,2
-            OUT dx,al
-
-            call trpal
-            call trtaycoor
-            call trvarrel
-
-            mov ax,[bp+6]      ; Y
-            mov bx,80
-            mul bx             ; 80 octets par lignes
-            mov bx,[bp+8]      ; X
-            shl bx,1           ; 2*X car un point du dessin pour deux pixels
-            mov [bp+8],bx
-            mov cl,3
-            shr bx,cl          ; BX := X div 8 , car 8 pixels par octet
-            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
-            mov [bp-100],ax    ; Oct_dep en bp-100
-
-            mov ax,0A000h
-            mov ds,ax                ; DS = segment de la memoire video
-
-            call calcpoidep
-
-            xor ax,ax
-            mov [bp-114],ax          ; init
-            mov [bp-110],ax          ; cmpt y
-
-     ega02: call deblig
-
-            mov ax,[bp-100]
-            mov di,ax
-            add ax,80
-            mov [bp-100],ax
-            mov ax,[bp-106]        ; masque binaire tournant
-
-     ega03: call annul
-            xor bx,bx
-            jmp ega04
-
-     ega05: shr al,1
-            pop di
-            jmp ega06
-
-     ega04: push di
-            mov di,es:[si]         ; 1er bit/pixel du point =
-            and di,15              ; no de couleur du point dans la palette
-            cmp di,[bp-142]
-            jz ega05
-            shl di,1
-            mov dx,[bp+di-64]      ; DL => 1ere couleur
-                                   ; DH => 2nde couleur
-            pop di
-
-            or bl,al
-
-            test dl,1              ; Bit BLEU
-            jz ega07
-            or [bp-246],al
-
-     ega07: test dl,2              ; Bit VERT
-            jz ega08
-            or [bp-248],al
-
-     ega08: test dl,4              ; Bit ROUGE
-            jz ega09
-            or [bp-250],al
-
-     ega09: test dl,8              ; Bit INTENSITE
-            jz ega10
-            or [bp-252],al
-     ega10: shr al,1                 ; 2nd bit/pixel du point
-                                     ; decalage du masque
-            or bl,al
-
-            test dh,1              ; Bit BLEU
-            jz ega11
-            or [bp-246],al
-
-     ega11: test dh,2              ; Bit VERT
-            jz ega12
-            or [bp-248],al
-
-     ega12: test dh,4              ; Bit ROUGE
-            jz ega13
-            or [bp-250],al
-
-     ega13: test dh,8              ; Bit INTENSITE
-            jz ega06
-            or [bp-252],al
-
-     ega06: shr al,1                 ; decalage du masque
-            inc word ptr [bp-112]    ; compteur x:= compteur x + 1
-            inc si
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            loopnz ega04      ; boucle tant que cx<>0 et compteur x < taix
-
-     ; affichage de l'octet precedement calcule .
-     ; les masques B, V, R et I sont stoques dans
-     ; les locales en BP-246, 248, 250 et 252
-     ; Le masque Noir est en BL
-
-            mov dx,3C5h      ; Selecte toutes les couleurs
-            mov bh,dl
-            mov al,15
-            out dx,al
-            mov dl,0CFh      ; Bit mask Noir
-            mov al,bl
-            out dx,al
-            mov al,[di]
-            xor al,al
-            mov [di],al
-
-            xchg bh,dl
-            mov al,1
-            out dx,al          ; selecte BLEU
-
-            mov al,[bp-246]
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            xchg bh,dl
-            mov al,2
-            out dx,al          ; selecte VERT
-
-            mov al,[bp-248]
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            xchg bh,dl
-            mov al,4
-            out dx,al          ; selecte ROUGE
-
-            mov al,[bp-250]
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-            xchg bh,dl
-            mov al,8
-            out dx,al          ; selecte INTENSITE
-
-            mov al,[bp-252]
-            xchg bh,dl
-            out dx,al
-
-            mov al,[di]
-            mov al,0FFh
-            mov [di],al     ; affiche
-
-
-            mov ax,80h         ; prepare le masque pour l'octet suivant
-            mov cx,4
-            inc di                  ; octet video suivant
-            mov dx,[bp-112]
-            cmp dx,[bp-132]
-            jc ega14
-            inc word ptr [bp-110]
-            mov dx,[bp-110]
-            cmp dx,[bp-130]
-            jc ega15
-
-            mov dx,3CFh
-            mov al,255
-            out dx,al
-            mov dl,0C5h
-            out dx,al
-
-            jmp fin
-
-     ega15: jmp ega02
-     ega14: jmp ega03
-
-; --------------------------------------------------------------------------
-;                       affichage sur TANDY
-; --------------------------------------------------------------------------
-; Variables locales :
-;                [bp- 100] octet de deplacement du debut de la ligne courante
-;                [bp- 110] compteur relatif en y
-;                [bp- 112] compteur relatif en x
-;                [bp- 114] indice dans le dessin source
-;                [bp- 120] compteur absolu en y
-;                [bp- 122] compteur absolu en x
-;                [bp- 142] numero du masque
-;                [bp- 250] couleur de l'octet a effacer
-; --------------------------------------------------------------------------
-     tan01: call trpal
-            call trtaycoor
-            call trvarrel
-
-            mov ax,[bp+6]      ; Y
-            shr ax,1
-            shr ax,1
-            mov bx,160
-            mul bx             ; Y div 4 * 160
-            mov bx,ax
-            mov ax,[bp+6]      ; Y
-            and ax,3
-            mov cx,2000h
-            mul cx
-            add ax,bx
-            mov bx,[bp+8]      ; X
-            shr bx,1           ; X div 2 car 2 pixels par octets
-            add ax,bx          ; AX contient l'offset du premier octet d'affichage dans le segment video
-            mov [bp-100],ax    ; Oct_dep en bp-100
-
-            mov ax,0B800h
-            mov ds,ax                ; DS = segment de la memoire video
-
-            xor ax,ax
-            mov [bp-110],ax          ; cmpt y
-            mov [bp-114],ax          ; offset source
-            mov [bp-108],ax          ; compatibilite avec proc deblig
-
-            mov ax,[bp+6]
-            mov [bp-120],ax
-            mov ax,[bp+8]
-            mov [bp-122],ax
-
-    tan02:  call deblig
-
-            mov bx,[bp-100]
-            mov di,bx
-            inc word ptr [bp-120]
-            mov ax,[bp-120]
-            and ax,3
-            je tan03
-            add bx,2000h
-            jmp tan04
-     tan03: sub bx,6000h
-            add bx,160
-     tan04: mov [bp-100],bx
-
-     tan05: xor dx,dx
-            mov [bp-250],dx
-            xor bx,bx
-            jmp tan07
-
-     tan06: pop di
-            mov al,[di]
-            jmp tan08
-
-     tan07: mov cl,4
-            push di
-            mov di,es:[si]         ; 1er bit/pixel du point =
-            and di,15              ; no de couleur du point dans la palette
-            cmp di,[bp-142]
-            jz tan06
-            shl di,1
-            mov dx,[bp+di-64]      ; DL => 1ere couleur
-            pop di
-            xor al,al
-            mov al,dl
-            shl dh,cl
-            add al,dh
-            mov [bp-250],al


Commit: 854bd08a80fbd17e6dbf993904e0723d2f0b33e2
    https://github.com/scummvm/scummvm/commit/854bd08a80fbd17e6dbf993904e0723d2f0b33e2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:12-07:00

Commit Message:
MORTEVIELLE: Initial ptoc output

Changed paths:
  A engines/mortevielle/actions.h
  A engines/mortevielle/alert.h
  A engines/mortevielle/boite.h
  A engines/mortevielle/disk.h
  A engines/mortevielle/droite.h
  A engines/mortevielle/keyboard.h
  A engines/mortevielle/level15.h
  A engines/mortevielle/menu.h
  A engines/mortevielle/mor.h
  A engines/mortevielle/mor2.h
  A engines/mortevielle/mort.cpp
  A engines/mortevielle/mouse.h
  A engines/mortevielle/outtext.h
  A engines/mortevielle/ovd1.h
  A engines/mortevielle/parole.h
  A engines/mortevielle/parole2.h
  A engines/mortevielle/prog.h
  A engines/mortevielle/ques.h
  A engines/mortevielle/sprint.h
  A engines/mortevielle/taffich.h
  A engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
new file mode 100644
index 0000000..fd4ae2e
--- /dev/null
+++ b/engines/mortevielle/actions.h
@@ -0,0 +1,1372 @@
+/* NIVEAU 4 */
+const char stouinon[] = "[2][ ][OUI][NON]";
+
+/* overlay */ void taller()
+
+{
+ integer mx,cx,cy;
+
+ if ((s.mlieu== 26) && (msg[4]== depl[6])) 
+ {
+  s.mlieu= 15;
+  caff= s.mlieu;
+  afdes(0);
+  repon(2,s.mlieu);
+ }
+ if ((s.mlieu== 15) && (msg[4]== depl[6])) 
+ {
+  if (! syn)  ecr3("aller");
+  tfleche();
+  if (iesc)  okdes= false;
+  if ((anyone) || (iesc))  return;
+  tcoord(1);
+  if (num== 0)  return;
+  if (num== 1) 
+  {
+   s.mlieu= 0;
+   tmlieu(0);
+  }
+  else
+   if (num== 7) 
+   {
+    s.mlieu= 13;
+    tmlieu(13);
+   }
+   else
+    if (num!= 6)  s.mlieu= 26;
+  if ((num> 1) && (num< 6))  ment= num- 1;
+  if (num> 7)  ment= num- 3;
+  if (num!= 6)  affrep(); else aldepl();
+  return;
+ }
+ tsort();
+ cx= 0;
+ do {
+  cx= cx+ 1;
+ } while (!(depl[cx]== msg[4]));
+ if (s.mlieu== 19) 
+ {
+  if (cx== 1)  t1deva();
+  if (cx== 2)  t1neig();
+  goto L2;
+ }
+ if (s.mlieu== 23) 
+ {
+  if (cx== 1)  t1deau();
+  if (cx== 2)  t1derr();
+  goto L2;
+ }
+ if ((s.mlieu== 11) && (cx== 1))  cx= 6;
+ if (s.mlieu== 12) 
+ {
+  if (cx== 2)  cx= 6;
+  if (cx== 5)  cx= 16;
+ }
+ if ((s.mlieu== 14) && (cx== 3))  cx= 6;
+ if (((s.mlieu== 15) || (s.mlieu== 26)) && (cx== 4))  cx= 6;
+ if ((s.mlieu> 19) && (s.mlieu!= 26))  cx= cx+ 10;
+ if ((s.mlieu== 20) && (cx== 13))  cx= 16;
+ if (s.mlieu== 21) 
+ {
+  if (cx== 12)  cx= 16; else
+  if (cx> 13)  cx= 15;
+ }
+ if ((s.mlieu== 22) && (cx> 14))  cx= 15;
+ if ((s.mlieu== 24) && (cx!= 17)) 
+  if (cx> 13)  cx= 15;
+ if (cx== 1)  s.mlieu= 11; else
+ if (cx== 2)  s.mlieu= 12; else
+ if (cx== 3)  s.mlieu= 14; else
+ if (cx== 4)  s.mlieu= 15; else
+ if (cx== 5)  cx= 12;
+ if (cx== 6)  cx= 11;
+ if (cx== 11)  t1sama(); else
+ if (cx== 12)  t1deva(); else
+ if (cx== 13)  s.mlieu= 20; else
+ if (cx== 14)  s.mlieu= 24; else
+ if (cx== 15)  t1neig(); else
+ if (cx== 16)  t1derr(); else
+ if (cx== 17) 
+ {
+  if ((s.ipuit!= 120) && (s.ipuit!= 140))  crep= 997; else
+   if (s.ipuit== 120)  crep= 181; else
+    if (s.conf> 80) 
+    {
+     crep= 1505;
+     tperd();
+    }
+    else
+    {
+     s.mlieu= 23;
+     affrep();
+    }
+ }
+ if ((cx< 5) || (cx== 13) || (cx== 14))  affrep();
+ debloc(s.mlieu);
+L2:
+ tmlieu(s.mlieu);
+}
+
+/* overlay */ void tprendre()
+{
+ integer cx, cy, cz;
+
+ if (caff> 99) 
+ {
+  cx= caff;
+  avpoing(cx);
+  if (crep!= 139) 
+  {
+   if (ipers> 0)  s.conf= s.conf+ 3;
+   if (obpart) 
+   {
+    if (s.mlieu== 2)  s.iloic= 0;
+    if (s.mlieu== 13) 
+    {
+     if (s.iboul== caff)  s.iboul= 0;
+     if (s.ibag== caff)  s.ibag= 0;
+    }
+    if (s.mlieu== 14)  s.icave= 0;
+    if (s.mlieu== 16)  s.icryp= 0;
+    if (s.mlieu== 17)  s.ivier= 0;
+    if (s.mlieu== 24)  s.ipuit= 0;
+    mfouen();
+    obpart= false;
+    affrep();
+   }
+   else
+   {
+    tabdon[acha+ (pred(integer,mchai)* 10)+ pred(integer,cs)]=0;
+    tsuiv();
+    dobj= dobj+ 1;
+    if (dobj> 6) 
+    {
+     s.conf= s.conf+ 2;
+     dobj= 0;
+    }
+   }
+  }
+  return;
+ }
+ if (! syn)  ecr3("prendre");
+ tfleche();
+ if ((anyone) || (iesc))  return;
+ if (caff== 3) 
+ {
+  tcoord(2);
+  if (num== 1) 
+  {
+   crep= 152;
+   return;
+  }
+ }
+ tcoord(5);
+ if ((num== 0) || ((num== 1) && (s.mlieu== 16))) 
+ {
+  tcoord(8);
+  if (num!= 0) 
+  {
+   if (ipers> 0)  s.conf= s.conf+ 3;
+   crep= 997;
+   if ((s.mlieu== 2) && (s.iloic!= 0))  avpoing(s.iloic);
+   if ((s.mlieu==13) && (num==1) && (s.iboul!=0)) 
+   {
+    avpoing(s.iboul);
+    if ((crep!= 997) && (crep!= 139))  aniof(2,7);
+   }
+   if ((s.mlieu==13) && (num==2) && (s.ibag!=0)) 
+   {
+    avpoing(s.ibag);
+    if ((crep!= 997) && (crep!= 139))  aniof(2,6);
+   }
+   if ((s.mlieu== 14) && (s.icave!= 0)) 
+   {
+    avpoing(s.icave);
+    if ((crep!= 997) && (crep!= 139))  aniof(2,2);
+   }
+   if ((s.mlieu== 16) && (s.icryp!= 0))  avpoing(s.icryp);
+   if ((s.mlieu== 17) && (s.ivier!= 0)) 
+   {
+    avpoing(s.ivier);
+    if ((crep!= 997) && (crep!= 139)) 
+    {
+     crep= 182;
+     aniof(2,1);
+    }
+   }
+   if ((s.mlieu== 24) && (s.ipuit!= 0)) 
+   {
+    avpoing(s.ipuit);
+    if ((crep!= 997) && (crep!= 139))  aniof(2,1);
+   }
+   if ((crep!= 997) && (crep!= 182) && (crep!= 139))  crep= 999;
+  }
+ }
+ else
+ {
+  if (((s.mlieu== 0) && (num== 3)) || ((s.mlieu== 1) && (num== 4))
+  || ((s.mlieu== 2) && (num== 1)) || ((s.mlieu== 4) && (num== 3))
+  || ((s.mlieu== 5) && (num== 6)) || ((s.mlieu== 6) && (num== 2))
+  || ((s.mlieu== 7) && (num== 6)) || ((s.mlieu== 8) && (num== 4))
+  || ((s.mlieu== 9) && (num== 4)) || ((s.mlieu== 10) && (num> 2))
+  || ((s.mlieu== 11) && (num== 7)) || ((s.mlieu== 12) && (num== 6))
+  || ((s.mlieu== 13) && (num> 4)) || ((s.mlieu> 13)
+  && (s.mlieu!= 23)))  crep= 997; else
+  {
+   if (s.mlieu== 23) 
+   {
+    crep= 1504;
+    tperd();
+   }
+   else crep= 120;
+  }
+ }
+}
+
+/* overlay */ void tsprendre()
+{
+ integer cx,cy,cz;
+
+ cx= 0;
+ do {
+  cx= cx+ 1;
+ } while (!(invt[cx]== msg[4]));
+ cz= 0;
+ cy= 0;
+ do {
+  cy= cy+ 1;
+  if (ord(s.sjer[cy])!= 0)  cz= cz+ 1;
+ } while (!(cz== cx));
+ cz= ord(s.sjer[cy]);
+ s.sjer[cy]= chr(0);
+ modinv();
+ avpoing(cz);
+ crep= 998;
+ clsf2();
+}
+
+/* overlay */ void tsoulever()
+
+{
+ integer cx;
+
+ if (! syn)  ecr3("soulever");
+ tfleche();
+ if ((anyone) || (iesc))  return;
+ tcoord(3);
+ if (num== 0) 
+ {
+  tcoord(8);
+  if (num!= 0) 
+  {
+   if (ipers> 0)  s.conf= s.conf+ 1;
+   crep= 997;
+   if ((s.mlieu== 2) && (s.iloic!= 0))  treg(s.iloic);
+  }
+  return;
+ }
+ if (ipers> 0)  s.conf= s.conf+ 1;
+ cx= s.mlieu;
+ if (s.mlieu== 16)  cx= 14;
+ if (s.mlieu== 19)  cx= 15;
+ crep= tabdon[asoul+(cx << 3)+pred(integer,num)];
+ if (crep== 255)  crep= 997;
+}
+
+/* overlay */ void tlire()
+{
+ integer iaff;
+
+ if (caff> 99)  st4(caff); else
+ {
+  if (! syn)  ecr3("lire");
+  tfleche();
+  if (! (anyone) && ! (iesc)) 
+  {
+   tcoord(4);
+   if (num!= 0)  crep= 107;
+  }
+ }
+}
+
+/* overlay */ void tslire()
+{
+ if (s.derobj== 0)  crep= 186; else st4(s.derobj);
+}
+
+/* overlay */ void tregarder()
+{
+ integer cx;
+
+ if (caff> 99) 
+ {
+  crep= 103;
+  return;
+ }
+ if (! syn)  ecr3("regarder");
+ tfleche();
+ if ((anyone) || (iesc))  return;
+ tcoord(5);
+ if (num== 0) 
+ {
+  tcoord(8);
+  crep= 131;
+  if (num!= 0) 
+  {
+   if (s.mlieu== 13) 
+   {
+    if (num== 1) 
+    {
+     crep= 164;
+     if (s.ibag!= 0)  treg(s.ibag); else
+      if (s.iboul!= 0)  treg(s.iboul);
+    }
+    else
+    {
+     crep= 193;
+     if (s.ibag!= 0)  treg(s.ibag);
+    }
+   }
+   if (s.mlieu== 14) 
+   {
+    crep= 164;
+    if (s.icave!= 0)  treg(s.icave);
+   }
+   if (s.mlieu== 17) 
+   {
+    crep= 174;
+    if (s.ivier!= 0)  treg(s.ivier);
+   }
+   if (s.mlieu== 24) 
+   {
+    crep= 131;
+    if (s.ipuit!= 0)  treg(s.ipuit);
+   }
+  }
+  return;
+ }
+ cx= s.mlieu;
+ if (s.mlieu== 20)  cx= 17;
+ if ((s.mlieu> 21) && (s.mlieu< 25))  cx= cx- 4;
+ if (s.mlieu== 26)  cx= 21;
+ crep= tabdon[arega+(cx*7)+pred(integer,num)];
+ if ((s.mlieu== 13) && (num== 8))  crep= 126;
+ if (s.mlieu== 19)  crep= 103;
+ if (crep== 255)  crep= 131;
+ if ((s.mlieu== 1) && (num== 1))  treg(144);
+ if ((s.mlieu== 5) && (num== 3))  treg(147);
+ if ((s.mlieu== 8) && (num== 3))  treg(149);
+ if ((s.mlieu== 9) && (num== 2))  treg(30);
+ if ((s.mlieu== 10) && (num== 3))  treg(31);
+}
+
+/* overlay */ void tsregarder()
+{
+ if (s.derobj!= 0)  treg(s.derobj); else crep= 186;
+}
+
+/* overlay */ void tfouiller()
+{
+      const array<0,13,byte> r = {{123,104,123,131,131,123,104,131,123,123,106,123,123,107}};
+ integer cx;
+
+ if (caff> 99) 
+ {
+  st7(caff);
+  return;
+ }
+ if (! syn)  ecr3("fouiller");
+ tfleche();
+ if (anyone || iesc)  return;
+ if (s.mlieu==23) 
+ {
+  crep= 1504;
+  tperd();
+  return;
+ }
+ tcoord(6);
+ if (num== 0) 
+ {
+  tcoord(7);
+  if (num!=0) 
+  {
+   cx=0;
+   do {
+    cx=cx+1;
+   } while (!((cx>6) || (num== ord(touv[cx]))));
+   if (num!=ord(touv[cx]))  crep=187; else
+   {
+    if (ipers>0)  s.conf= s.conf+3;
+    rechai(mchai);
+    if (mchai!=0) 
+    {
+     cs=0;
+     is=0;
+     fouil=true;
+     mfoudi();
+     tsuiv();
+    }
+    else crep=997;
+   }
+  }
+  else
+  {
+   tcoord(8);
+   crep= 997;
+   if (num!=0) 
+   {
+    if (ipers>0)  s.conf=s.conf+3;
+    if ((s.mlieu!=24) && (s.mlieu!=17) && (s.mlieu!=13)) 
+    {
+     if (s.mlieu==2) 
+     {
+      crep= 123;
+      if (s.iloic!=0)  treg(s.iloic);
+     }
+     if (s.mlieu==16) 
+     {
+      crep= 123;
+      if (s.icryp!=0)  treg(s.icryp);
+     }
+    }
+   }
+  }
+ }
+ else
+ {
+  if (ipers>0)  s.conf=s.conf+ 3;
+  crep= 997;
+  if (s.mlieu < 14)  crep= r[s.mlieu];
+  if ((s.mlieu== 3) && (num== 2))  crep=162;
+  if (s.mlieu== 12) 
+  {
+   if ((num== 3) || (num== 4))  crep=162;
+   if (num== 5)  crep= 159;
+  }
+  if (s.mlieu==19)  crep=104;
+  if (s.mlieu==16)  crep=155;
+ }
+}
+
+/* overlay */ void tsfouiller()
+{
+ if (s.derobj!=0)  st7(s.derobj); else crep= 186;
+}
+
+/* overlay */ void touvrir()
+{
+ integer cx,haz;
+
+ if (! syn)  ecr3("ouvrir");
+ if (caff== 26) 
+ {
+  if (ment!= 0) 
+  {
+   msg[4]= entrer;
+   syn= true;
+  }
+  else crep= 997;
+  return;
+ }
+ if (caff== 15) 
+ {
+  aldepl();
+  return;
+ }
+ tfleche();
+ if ((anyone) || (iesc))  return;
+ tcoord(7);
+ if (num!= 0) 
+ {
+  if (ipers> 0)  s.conf= s.conf+ 2;
+  iouv= iouv+ 1;
+  cx= 0;
+  do {
+   cx= cx+ 1;
+  } while (!((cx> 6) || (ord(touv[cx])== 0) || (ord(touv[cx])== num)));
+  if (ord(touv[cx])!= num) 
+  {
+   if (!
+    (
+     ( (num== 3) && ((s.mlieu== 0) || (s.mlieu== 9) || (s.mlieu== 5) || (s.mlieu== 7)) )
+     ||
+      ((num== 4) && ((s.mlieu== 1) || (s.mlieu== 2) || (s.mlieu== 6))) ||
+      ((s.mlieu== 4) && (num== 5)) ||
+      ((num== 6) && ((s.mlieu== 7) || (s.mlieu== 10) ||
+                     (s.mlieu== 8) || (s.mlieu== 13))) ||
+      ((s.mlieu== 8) && (num== 2)) ||
+      ((s.mlieu== 12) && (num== 7)))) 
+      {
+         if (((s.mlieu> 10) && (s.mlieu< 14)) ||
+          ((s.mlieu> 6) && (s.mlieu< 10)) ||
+          (s.mlieu== 0) || (s.mlieu== 2) || (s.mlieu== 5)) 
+          {
+            haz= hazard(1, 4);
+            if (haz== 3)  parole(7, 9, 1);
+          }
+        touv[cx]= chr(num);
+        aniof(1,num);
+      }
+   cx= s.mlieu;
+   if (s.mlieu== 16)  cx= 14;
+   crep= tabdon[aouvr+ (cx* 7)+ pred(integer,num)];
+   if (crep== 254)  crep= 999;
+  }
+  else crep= 18;
+ }
+}
+
+/* overlay */ void tmettre()
+{
+ integer quel;
+ boolean entre;
+ phrase st;
+ str255 str_;
+ integer i,tay;
+
+ if (s.derobj== 0) 
+ {
+  crep= 186;
+  return;
+ }
+ if (! syn)  ecr3("mettre");
+ tfleche();
+ if (iesc)  crep= 998;
+ if ((anyone) || (iesc))  return;
+ tcoord(8);
+ if (num!= 0) 
+ {
+  crep= 999;
+  if (caff== 13) 
+  {
+   if (num== 1) 
+   {
+    if (s.iboul!= 0)  crep= 188; else
+    {
+     s.iboul= s.derobj;
+     if (s.derobj== 141)  aniof(1,7);
+    }
+   }
+   else
+    if (s.ibag!= 0)  crep= 188; else
+    {
+     s.ibag= s.derobj;
+     if (s.derobj== 159)  aniof(1,6);
+    }
+  }
+  if (caff== 14) 
+   if (s.icave!=0)  crep= 188; else
+   {
+    s.icave= s.derobj;
+    if (s.derobj== 151) 
+    {
+     aniof(1,2);
+     aniof(1,1);
+     repon(2,165);
+     maivid();
+     parole(6, -9, 1);
+     quel= do_alert(stouinon,1);
+     if (quel==1)  {
+                      deline(582,st,tay);
+                      i= do_alert(delig,1);
+                      tesok=false;
+                      entre= ques();
+                      hide_mouse();
+                      hirs();
+                      dessine_rouleau();
+                      clsf2();
+                      clsf3();
+                      show_mouse();
+                      tinke();
+                      pendule();
+                      if (ipers!=0)  affper(ipers);
+                                  else person();
+                      menu_aff();
+                      if (entre) 
+                         {
+                           s.mlieu= 17;
+                           tmlieu(17);
+                         }
+                        else
+                         {
+                           tmlieu(s.mlieu);
+                           writepal(14);
+                           dessin(0);
+                           aniof(1,2);
+                           aniof(1,1);
+                           deline(577,st,tay);
+                           i= do_alert(delig,1);
+                           aniof(2,1);
+                           crep= 166;
+                         }
+                      affrep();
+                    }
+               else {
+                      aniof(2,1);
+                      crep= 166;
+                      tesok=true;
+                    }
+     return;
+    }
+   }
+  if (caff== 16) 
+   if (s.icryp== 0)  s.icryp= s.derobj; else crep= 188;
+  if (caff== 17) 
+   if (s.ivier!=0)  crep= 188; else
+    if (s.derobj== 143) 
+    {
+     s.ivier= 143;
+     aniof(1,1);
+    }
+    else
+    {
+     crep= 1512;
+     tperd();
+    }
+  if (caff== 24) 
+   if (s.ipuit!= 0)  crep= 188; else
+    if ((s.derobj== 140) || (s.derobj== 120)) 
+    {
+     s.ipuit= s.derobj;
+     aniof(1,1);
+    }
+    else crep= 185;
+  if (crep!= 188)  maivid();
+ }
+}
+
+/* overlay */ void ttourner()
+{
+ integer quel;
+
+ if (caff> 99) 
+ {
+  crep= 149;
+  return;
+ }
+ if (! syn)  ecr3("tourner");
+ tfleche();
+ if ((anyone) || (iesc))  return;
+ tcoord(9);
+ if (num!= 0) 
+ {
+  crep= 997;
+  if ((s.mlieu== 13) && (s.ibag== 159) && (s.iboul== 141)) 
+  {
+   repon(2,167);
+   parole(7, 9, 1);
+   quel= do_alert(stouinon,1);
+   if (quel== 1)  solu= true; else crep= 168;
+  }
+  if ((s.mlieu== 17) && (s.ivier== 143)) 
+  {
+   repon(2, 175);
+   clsf3();
+   parole(6, -9, 1);
+   quel= do_alert(stouinon,1);
+   if (quel== 1) 
+   {
+    s.mlieu= 16;
+    affrep();
+   }
+   else crep= 176;
+  }
+ }
+}
+
+/* overlay */ void tcacher()
+{
+ if (! syn)  ecr3("se cacher");
+ tfleche();
+ if (! (anyone) && ! (iesc)) 
+ {
+  tcoord(10);
+  if (num== 0)  cache= false; else
+  {
+   cache= true;
+   crep= 999;
+  }
+ }
+}
+
+/* overlay */ void tattacher()
+{
+ if (s.derobj== 0)  crep= 186; else
+ {
+  if (! syn)  ecr3("attacher");
+  tfleche();
+  if (! (anyone) && ! (iesc)) 
+  {
+   tcoord(8);
+   crep= 997;
+   if ((num!= 0) && (s.mlieu== 24)) 
+   {
+    crep= 999;
+    if ((s.derobj== 120) || (s.derobj== 140)) 
+    {
+     s.ipuit= s.derobj;
+     aniof(1,1);
+    }
+    else crep= 185;
+    maivid();
+   }
+  }
+ }
+}
+
+/* overlay */ void tfermer()
+{
+ integer cx,chai;
+
+ if (! syn)  ecr3("fermer");
+ if (caff< 26) 
+ {
+  tfleche();
+  if (iesc)  crep= 998;
+  if ((anyone) || (iesc))  return;
+  tcoord(7);
+  if (num!= 0) 
+  {
+   cx= 0;
+   do {
+    cx= cx+ 1;
+   } while (!((cx> 6) || (num== ord(touv[cx]))));
+   if (num== ord(touv[cx])) 
+   {
+    aniof(2,num);
+    crep= 998;
+    touv[cx]= chr(0);
+    iouv= iouv- 1;
+    if (iouv< 0)  iouv= 0;
+    chai= 9999;
+    rechai(chai);
+    if (mchai== chai)  mchai= 0;
+   }
+   else crep= 187;
+  }
+ }
+ if (caff== 26)  crep= 999;
+}
+
+/* overlay */ void tfrapper()
+{
+ integer l,p,haz;
+
+ if (! syn)  ecr3("frapper");
+ if (s.mlieu== 15) 
+ {
+  l= do_alert("[1][ | Avant, utilisez le menu DEP...][ok]",1);
+  return;
+ }
+ if (s.mlieu< 25) 
+ {
+  tfleche();
+  if (! (anyone) && ! (iesc)) 
+   if ((s.mlieu< 19) && (s.mlieu!= 15))  crep= 133; else crep= 997;
+  return;
+ }
+ if (s.mlieu== 26) 
+ {
+  haz= (hazard(0, 8))- 4;
+  parole(11, haz, 1);
+  ecfren(p,haz,s.conf,ment);
+  l= ment;
+  if (l!= 0) 
+   if (p!= -500) 
+   {
+    if (haz> p)  crep= 190; else
+    {
+     becfren(l);
+     frap();
+    }
+   }
+   else frap();
+  if (ment== 8)  crep= 190;
+ }
+}
+
+/* overlay */ void tposer()
+{
+ integer cx,chai;
+
+ if (! syn)  ecr3("poser");
+ if (s.derobj== 0)  crep= 186; else
+ {
+  if (caff> 99) 
+  {
+    crep= 999;
+    ajchai();
+    if (crep!= 192)  maivid();
+    return;
+  }
+  tfleche();
+  if ((anyone) || (iesc))  return;
+  tcoord(7);
+  crep= 124;
+  if (num!= 0) 
+  {
+   rechai(chai);
+   if (chai== 0)  crep= 997; else
+   {
+    cx= 0;
+    do {
+     cx= cx+ 1;
+    } while (!((cx> 6) || (num== ord(touv[cx]))));
+    if (num!= ord(touv[cx]))  crep= 187; else
+    {
+     mchai= chai;
+     crep= 999;
+    }
+   }
+  }
+  else
+  {
+   tcoord(8);
+   if (num!= 0) 
+   {
+    crep= 998;
+    if (caff== 2) 
+     if (s.iloic!= 0)  crep= 188; else s.iloic= s.derobj;
+    if (caff== 13) 
+    {
+     if (num== 1) 
+     {
+      if (s.iboul!= 0)  crep= 188; else s.iboul= s.derobj;
+     }
+     else
+      if (s.ibag!= 0)  crep= 188; else s.ibag= s.derobj;
+    }
+    if (caff== 16) 
+     if (s.icryp!= 0)  crep= 188; else s.icryp= s.derobj;
+    if (caff== 24)  crep= 185;
+    if ((caff== 14) || (caff== 17))  crep= 124;
+   }
+   else
+   {
+    crep= 124;
+    if (caff== 24) 
+    {
+     tcoord(5);
+     if (num!= 0)  crep= 185;
+    }
+   }
+  }
+  if (caff== 23)  crep= 185;
+  if ((crep== 999) || (crep== 185) || (crep== 998)) 
+  {
+   if (crep== 999)  ajchai();
+   if (crep!= 192)  maivid();
+  }
+ }
+}
+
+/* overlay */ void tecouter()
+{
+ integer l,p,haz,j,h,m;
+
+ if (s.mlieu!= 26)  crep= 101; else
+ {
+  if (ipers!= 0)  s.conf= s.conf+ 1;
+  ecfren(p,haz,s.conf,ment);
+  l= ment;
+  if (l!= 0) 
+   if (p!= -500) 
+   {
+    if (haz> p)  crep= 101; else
+    {
+     becfren(l);
+     calch(j,h,m);
+     haz= hazard(1,100);
+     if ((h>= 0) && (h< 8)) 
+     {
+      if (haz> 30)  crep= 101; else crep= 178;
+     }
+     else
+      if (haz> 70)  crep= 101; else crep= 178;
+    }
+   }
+   else crep= 178;
+ }
+}
+
+/* overlay */ void tmanger()
+{
+ integer j,h,m;
+
+ if ((s.mlieu> 15) && (s.mlieu< 26)) 
+  crep= 148;
+ else
+ {
+  tsort();
+  s.mlieu= 10;
+  caff= 10;
+  debloc(s.mlieu);
+  tmlieu(s.mlieu);
+  calch(j,h,m);
+  if ((h== 12) || (h== 13) || (h== 19)) 
+  {
+   s.conf= s.conf- (s.conf / 7);
+   if (h== 12) 
+    if (m== 0)  h= 4; else h= 3;
+   if ((h== 13) || (h== 19)) 
+    if (m== 0)  h= 2; else h= 1;
+   jh= jh+ h;
+   crep= 135;
+   tinke();
+  }
+  else crep= 134;
+ }
+}
+
+/* overlay */ void tentrer()
+{
+ integer x, z;
+
+ if ((s.mlieu== 21) || (s.mlieu== 22)) 
+ {
+  t1sama();
+  tmlieu(s.mlieu);
+ }
+ else
+  if (s.mlieu== 15)  aldepl(); else
+   if (ment== 0)  crep= 997; else
+   {
+    if ((ment== 9) && (s.derobj!= 136)) 
+    {
+     crep= 189;
+     s.teauto[8]= '*';
+    }
+    else
+    {
+     if (! blo)  t11(ment, z);
+     if (z!= 0) 
+     {
+      if ((ment== 3) || (ment== 7))  crep= 179; else
+      {
+       x= (hazard(0, 10))- 5;
+       parole(7, x, 1);
+       aniof(1,1);
+/*       tkey(5,32000);*/
+       tip(z,x);
+       s.conf= s.conf+ 1;
+       s.mlieu= 15;
+       msg[3]= discut;
+       msg[4]= disc[x];
+       syn= true;
+       if (ment== 9) 
+       {
+        col= true;
+        caff= 70;
+        afdes(0);
+        repon(2,caff);
+       }
+       else col= false;
+       debloc(ment);
+       ment= 0;
+      }
+     }
+     else
+     {
+      x= (hazard(0, 10))- 5;
+      parole(7, x, 1);
+      aniof(1,1);
+/*      tkey(1,32000);*/
+      s.mlieu= ment;
+      affrep();
+      debloc(s.mlieu);
+      tmlieu(s.mlieu);
+      ment= 0;
+      mpers= 0;
+      ipers= 0;
+     }
+    }
+   }
+}
+
+/* overlay */ void tdormir()
+{
+ const char m1[] = "D‚sirez-vous vous r‚veiller?";
+ integer z,j,h,m,quel;
+
+ if ((s.mlieu> 15) && (s.mlieu< 26)) 
+ {
+  crep= 148;
+  return;
+ }
+ if (s.mlieu != 0) 
+ {
+  tsort();
+  s.mlieu= 0;
+  affrep();
+  afdes(0);
+  debloc(s.mlieu);
+  tmlieu(s.mlieu);
+ }
+ clsf3();
+ clsf2();
+ ecrf2();
+ ecr2(m1);
+ calch(j,h,m);
+ do {
+   if (h< 8) 
+     {
+       s.conf= s.conf- (s.conf / 20);
+       z= (7- h)* 2;
+       if (m== 30)  z= z- 1;
+       jh= jh+ z;
+       h= 7;
+     }
+   jh= jh+ 2;
+   h= h+ 1;
+   if (h> 23)  h= 0;
+   tinke();
+   quel= do_alert(stouinon,1);
+   anyone= false;
+ } while (!(quel== 1));
+ crep= 998;
+ num= 0;
+}
+
+/* overlay */ void tdefoncer()
+{
+ if (! syn)  ecr3("d‚foncer");
+ if (caff< 25)  tfleche();
+ if ((! anyone) && (! iesc)) 
+    if (s.mlieu!= 26)  crep= 997; else
+   {
+     crep= 143;
+     s.conf= s.conf+ 2;
+   }
+}
+
+/* overlay */ void tsortir()
+{
+ integer lx;
+
+ tsort();
+ crep= 0;
+ if ((s.mlieu== 19) || (s.mlieu== 21) || (s.mlieu== 22)
+ || (s.mlieu== 24))  crep= 997; else
+ {
+  if ((s.mlieu< 16) || (s.mlieu== 26))  lx= 10;
+  if ((s.mlieu== 10) || (s.mlieu== 20))  lx= 21;
+  if ((s.mlieu< 10) || (s.mlieu== 13))  lx= 15;
+  if (s.mlieu== 16) 
+  {
+   lx= 17;
+   crep= 176;
+  }
+  if (s.mlieu== 17)  t23coul(lx);
+  if (s.mlieu== 23)  lx= 24;
+  if (crep!= 997)  s.mlieu= lx;
+  caff= lx;
+  if (crep== 0)  crep= lx;
+  debloc(lx);
+  tmlieu(lx);
+ }
+}
+
+/* overlay */ void tattendre()
+{
+ integer quel;
+
+ mpers= 0;
+ clsf3();
+ do {
+   jh= jh+ 1;
+   tinke();
+   if (! blo)  t11(s.mlieu, quel);
+   if ((ipers!= 0) && (mpers== 0)) 
+   {
+     crep= 998;
+     if ((s.mlieu== 13) || (s.mlieu== 14))  cavegre();
+     if ((s.mlieu> 0) && (s.mlieu< 10))  anyone= true;
+     mpers= ipers;
+     if (! anyone)  tinke();
+     return;
+   }
+   repon(2,102);
+   quel= do_alert(stouinon,1);
+ } while (!(quel== 2));
+ crep= 998;
+ if (! anyone)  tinke();
+}
+
+/* overlay */ void tsonder()
+{
+ if (! syn)  ecr3("sonder");
+ if (caff< 27) 
+ {
+  tfleche();
+  if (! (anyone) && (! iesc))  crep= 145;
+  num= 0;
+ }
+}
+
+/* overlay */ void tparler()
+
+{
+                               array<1,46,boolean> te;
+       integer ix, cy, cx, max, haz, suj, co,lig,icm,
+            i, tay, choi, x, y, c;
+                              char tou;
+                              array<1,46,varying_string<40> > lib;
+                               phrase st;
+                                boolean f;
+
+
+
+ finfouil();
+ if (col)  suj= 128; else
+  {
+    cx= 0;
+    do {
+      cx= cx+ 1;
+    } while (!(disc[cx]== msg[4]));
+    caff= 69+ cx;
+    afdes(0);
+    repon(2,caff);
+    suj= caff+ 60;
+  }
+ tkey1(false);
+ mennor();
+ hide_mouse();
+ hirs();
+ premtet();
+ sparl(0,suj);
+ hirs();
+ for( ix= 1; ix <= 46; ix ++) te[ix]= false;
+ for( ix=1; ix <= 45; ix ++)
+     {
+       deline(ix+c_tparler,st,tay);
+       lib[ix]= delig;
+       for( i=tay; i <= 40; i ++) lib[ix]=lib[ix]+' ';
+     }
+ lib[46]=lib[45];
+ lib[45]=' ';
+ show_mouse();
+ do {
+   choi= 0;
+   icm= 0;
+   co= 0;
+   lig= 0;
+   do {
+     icm= succ(integer, icm );
+     putxy(co,lig);
+     if (s.teauto[icm]=='*') 
+     if (te[icm])  writetp(lib[icm],1);
+                  else writetp(lib[icm],0);
+     if (icm==23)  {
+                      lig= 0;
+                      co= 320;
+                    }
+               else lig= lig + 8;
+   } while (!(icm==42));
+   putxy(320,176);
+   writetp(lib[46],0);
+   tou= '\0';
+   do {
+     mov_mouse(f,tou);
+/*     if keypressed then read(kbd,tou);*/
+     read_pos_mouse(x,y,c);
+     x= x *(3-res);
+     if (x>319)  cx= 41; else cx= 1;
+     cy= succ(integer,(cardinal)y >> 3);                    /* 0-199 => 1-25 */
+     if ((cy>23) || ((cx==41) && (set::of(range(20,22), eos).has(cy)))) 
+             {
+               if (choi!=0) 
+                  {
+                    lig= ((choi-1) % 23) << 3;
+                    if (choi>23)  co= 320; else co= 0;
+                    putxy(co,lig);
+                    if (te[choi])  writetp(lib[choi],0);
+                                else writetp(lib[choi],1);
+                    te[choi]= ! te[choi];
+                    choi= 0;
+                  }
+             }
+        else {
+               ix= cy;
+               if (cx==41)  ix= ix+23;
+               if (ix!=choi) 
+                  {
+                    if (choi!=0) 
+                       {
+                         lig= ((choi-1) % 23) << 3;
+                         if (choi>23)  co= 320; else co= 0;
+                         putxy(co,lig);
+                         if (te[choi])  writetp(lib[choi],0);
+                                     else writetp(lib[choi],1);
+                         te[choi]= ! te[choi];
+                       }
+                    if ((s.teauto[ix]=='*') || (ix==46)) 
+                       {
+                         lig= ((ix-1) % 23) << 3;
+                         if (ix>23)  co= 320; else co= 0;
+                         putxy(co,lig);
+                         if (te[ix])  writetp(lib[ix],0);
+                                   else writetp(lib[ix],1);
+                         te[ix]= ! te[ix];
+                         choi= ix;
+                       }
+                      else choi= 0;
+                  }
+             }
+   } while (!((tou=='\15') || ( ((c!=0) || clic) && (choi!=0))));
+   clic=false;
+   if (choi!=46) 
+      {
+        ix= choi-1;
+        if (col) 
+           {
+             col= false;
+             s.mlieu= 15;
+             if (iouv> 0)  max= 8; else max= 4;
+             haz= hazard(1,max);
+             if (haz== 2)  suj= 129; else
+                {
+                  suj= 138;
+                  s.conf= s.conf+ (3* (s.conf / 10));
+                }
+           }
+          else
+           if (nbrep[caff- 69]< nbrepm[caff- 69]) 
+           {
+             suj= tabdon[arep+ (ix << 3)+ (caff- 70)];
+             s.conf= s.conf+ tabdon[arcf+ ix];
+             nbrep[caff- 69]= nbrep[caff- 69]+ 1;
+           }
+          else
+           {
+             s.conf= s.conf+ 3;
+             suj= 139;
+           }
+        hide_mouse();
+        hirs();
+        premtet();
+        sparl(0, suj);
+        show_mouse();
+        if ((suj== 84) || (suj== 86)) 
+           {
+             s.pourc[5]= '*';
+             s.teauto[7]= '*';
+           }
+        if ((suj== 106) || (suj== 108) || (suj== 94)) 
+           {
+             for( ix= 29; ix <= 31; ix ++) s.teauto[ix]= '*';
+             s.pourc[7]= '*';
+           }
+        if (suj== 70) 
+           {
+             s.pourc[8]= '*';
+             s.teauto[32]= '*';
+           }
+        hide_mouse();
+        hirs();
+        show_mouse();
+      }
+    } while (!((choi== 46) || (suj== 138)));
+ if (col) 
+ {
+  s.conf= s.conf+ (3* (s.conf / 10));
+  hide_mouse();
+  hirs();
+  premtet();
+  sparl(0, 138);
+  show_mouse();
+  col= false;
+  s.mlieu= 15;
+ }
+ ctrm= 0;
+ hide_mouse();
+ hirs();
+ dessine_rouleau();
+ show_mouse();
+ affper(ipers);
+ tinke();
+ pendule();
+ affrep();
+/* chech;*/
+ tmlieu(s.mlieu);
+ clsf3();
+}
+
+/* overlay */ void tsentir()
+{
+ crep= 119;
+ if (caff< 26) 
+ {
+  if (! syn)  ecr3("sentir");
+  tfleche();
+  if (! (anyone) && ! (iesc)) 
+   if (caff== 16)  crep= 153;
+ }
+ else
+ if (caff== 123)  crep= 110;
+ num= 0;
+}
+
+/* overlay */ void tgratter()
+{
+ crep= 155;
+ if (caff< 27) 
+ {
+  if (! syn)  ecr3("gratter");
+  tfleche();
+ }
+ num= 0;
+}
+
+/* NIVEAU 2 */
+/* overlay */ void tmaj1()             /* Le jeu est termin‚ !!! */
+{
+ arret= true;
+ tlu(13,152);
+ maivid();
+ clsf1();
+ clsf2();
+ clsf3();
+ repon(9,1509);
+ tkey1(false);
+ hide_mouse();
+ caff= 70;
+ taffich();
+ hirs();
+ premtet();
+ sparl(0,141);
+ show_mouse();
+ clsf1();
+ repon(9,1509);
+ repon(2,142);
+ tkey1(false);
+ caff= 32;
+ afdes(0);
+ repon(6,34);
+ repon(2,35);
+ musique(0);
+ tkey1(false);
+ messint(2036);
+ tkey1(false);
+ inzon();
+}
+
+/* overlay */ void tencore()           /* Perdu !!! */
+{
+ integer quel;
+
+ clsf2();
+ musique(0);
+ tkey1(false);
+ maivid();
+ inzon();
+ dprog();
+ vh= 10;
+ vm= 0;
+ vj= 0;
+ min= 0;
+ heu= 10;
+ jou= 0;
+ repon(2,180);
+ quel= do_alert(stouinon,1);
+ arret= (quel!=1);
+}
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
new file mode 100644
index 0000000..c3a45fe
--- /dev/null
+++ b/engines/mortevielle/alert.h
@@ -0,0 +1,214 @@
+/* overlay */ integer do_alert(str255 str_, integer n);
+
+
+const integer nligne = 7;
+const matrix<1,2,1,3,integer> coord
+      = {{ {{150, 72, 103}},
+         {{143, 107, 183}} }};
+
+
+
+static void decod(str255 s, integer& nbc,integer& nbl,integer& col, str255& c, str30& cs)
+    {
+          integer i,k;
+          boolean v;
+
+      val(s[2],nbc,i);
+      c= "";
+      nbl= 0; i= 5; k= 0;
+      v=true; col=0;
+
+      while (s[i]!=']') 
+        {
+          c=c+s[i];
+          if ((s[i]=='|') || (s[i+1]==']')) 
+             {
+               if (k>col)  col=k;
+               k= 0;
+               nbl=nbl+1;
+             }
+           else if (s[i]!=' ')  v=false;
+          i=i+1;
+          k=k+1;
+        }
+      if (v)  {
+                  c="";
+                  col=20;
+                }
+           else {
+                  c=c+']';
+                  col=col+6;
+                }
+      i=i+1;
+      cs=copy(s,i,30);
+      if (res==2)  col= col*6;
+               else col= col*10;
+    }
+
+
+
+static void posit(integer ji, integer& coldep, integer& esp)
+   {
+     putxy(coldep + (40+esp) *pred(integer,ji),98);
+   }
+
+
+
+static void fait_boite(integer lidep,integer nli,integer tx)
+   {
+         integer x,y,xx,yy;
+
+     if (tx>640)  tx=640;
+     x= 320- ((cardinal)tx >> 1);
+     y=pred(integer,lidep) << 3;
+     xx=x+ tx;
+     yy=y + (nli << 3);
+     box(15,gd,x,y,xx,yy,255);
+     box(0,gd,x,y+2,xx,y+4,255);
+     box(0,gd,x,yy-4,xx,yy-2,255);
+   }
+
+
+
+static void fait_choix(str30 c, integer& coldep, integer& nbcase, array<1,2,varying_string<3> >& s, integer& esp)
+   {
+         integer i,l,x;
+         char ch;
+
+     i=1;
+     x=coldep;
+     for( l=1; l <= nbcase; l ++)
+       {
+         s[l]="";
+         do {
+           i=i+1;
+           ch=c[i];
+           s[l]=s[l]+ch;
+         } while (!(c[i+1]==']'));
+         i=i+2;
+         while (length(s[l])<3)  s[l]=s[l]+' ';
+         putxy(x,98);
+         writeg(string(' ')+s[l]+' ',0);
+         x= x+esp+40;
+       }
+   }
+
+              integer do_alert(str255 str_, integer n)
+{
+       integer coldep,esp,i,l,nbcase,quoi,ix;
+       str255 st, chaine;
+       matrix<1,2,1,2,integer> limit;
+       char c,dumi;
+       array<1,2,varying_string<3> > s;
+       integer cx,cy,cd,nbcol,nblig;
+       boolean touch,newaff,test,test1,test2,test3,dum;
+       str30 cas;
+
+
+  /*debug('** do_alert **');*/
+  integer do_alert_result;
+  hide_mouse();
+  while (keypressed())  input >> kbd >> dumi;
+  clic=false;
+  decod(str_,nbcase,nblig,nbcol,chaine,cas);
+  sauvecr(50,succ(integer,nligne) << 4);
+
+  i=0;
+  if (chaine=="") 
+    {
+      fait_boite(10,5,nbcol);
+    }
+   else
+    {
+      fait_boite(8,7,nbcol);
+      i=0;
+      ywhere=70;
+      do {
+        cx= 320;
+        st= "";
+        while (! (set::of('\174','\135', eos).has(chaine[i+1]))) 
+          {
+            i=i+1;
+            st=st+chaine[i];
+            if (res==2)  cx=cx-3;
+                     else cx=cx-5;
+          }
+        putxy(cx,ywhere);
+        ywhere=ywhere+6;
+        writeg(st,4);
+        i=i+1;
+      } while (!(chaine[i]==']'));
+    }
+  if (nbcase==1)  esp= nbcol- 40;
+              else esp= (cardinal)(nbcol-nbcase*40) >> 1;
+  coldep=320-((cardinal)nbcol >> 1)+((cardinal)esp >> 1);
+  fait_choix(cas, coldep, nbcase, s, esp);
+  limit[1][1]=((cardinal)(coldep) >> 1)*res;
+  limit[1][2]=limit[1][1]+40;
+  if (nbcase==1) 
+     {
+       limit[2][1]=limit[2][2];
+     }
+   else
+     {
+       limit[2][1]=((cardinal)(320+((cardinal)esp >> 1)) >> 1)*res;
+       limit[2][2]=(limit[2][1])+40;
+     }
+  show_mouse();
+  quoi=0;
+  dum=false;
+  do {
+    dumi='\377';
+    mov_mouse(dum,dumi);
+    cx= x_s;
+    cy= y_s;
+    test=(cy>95) && (cy<105);
+    newaff=false;
+    if (test) 
+     {
+       test1=(cx>limit[1][1]) && (cx<limit[1][2]);
+       test2=test1;
+       if (nbcase>1)  test2= test1 || ((cx>limit[2][1]) && (cx<limit[2][2]));
+       if (test2) 
+        {
+          newaff=true;
+          if (test1)  ix=1;
+                   else ix=2;
+          if (ix!=quoi)  
+           {
+             hide_mouse();
+             if (quoi!=0) 
+              {
+                posit(quoi, coldep, esp);
+                writeg(string(' ')+s[quoi]+' ',0);
+              }
+             posit(ix, coldep, esp);
+             writeg(string(' ')+s[ix]+' ',1);
+             quoi=ix;
+             show_mouse();
+           }
+        }
+     }
+    if ((quoi!=0) && ! newaff) 
+     {
+       hide_mouse();
+       posit(quoi, coldep, esp);
+       writeg(string(' ')+s[quoi]+' ',0);
+       quoi=0;
+       show_mouse();
+     }
+     test3=(cy>95) && (cy<105) && (((cx>limit[1][1]) && (cx<limit[1][2]))
+                                   || ((cx>limit[2][1]) && (cx<limit[2][2])));
+  } while (!clic);
+  clic=false;
+  hide_mouse();
+  if (! test3)  {
+                  quoi=n;
+                  posit(n, coldep, esp);
+                  writeg(string(' ')+s[n]+' ',1);
+                }
+  charecr(50,succ(integer,nligne) << 4);
+  show_mouse();
+  do_alert_result=quoi;
+  return do_alert_result;
+}
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
new file mode 100644
index 0000000..0819490
--- /dev/null
+++ b/engines/mortevielle/boite.h
@@ -0,0 +1,30 @@
+void boite(integer x,integer y,integer dx,integer dy,integer coul)
+ {
+       integer i;
+      integer xi,yi,xo,yo;
+
+   /* debug('boite'); */
+   hide_mouse();
+   if (res==1) 
+      {
+        x= (cardinal)x >> 1;
+        dx= (cardinal)dx >> 1;
+      }
+   xi=x; yi=y; xo=x; yo=y;
+   for( i=0; i <= dx+dy; i ++)
+      {
+        putpix(gd,xi,yi,coul);
+        if (xi==x+dx)  {
+                          if (gd!=cga)  putpix(gd,pred(integer,xi),yi,coul);
+                          yi=succ(integer,yi);
+                        }
+                   else xi=succ(integer,xi);
+        putpix(gd,xo,yo,coul);
+        if (yo==y+dy)  xo=succ(integer,xo);
+                   else {
+                          if (gd!=cga)  putpix(gd,succ(integer,xo),yo,coul);
+                          yo=succ(integer,yo);
+                        }
+      }
+   show_mouse();
+ }
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
new file mode 100644
index 0000000..28a2dbe
--- /dev/null
+++ b/engines/mortevielle/disk.h
@@ -0,0 +1,80 @@
+
+void dem1()
+{
+      untyped_file f;
+      integer k;
+
+  /* -- demande de disk 1 -- */
+  assign(f,"mort.005");
+  /*$i-*/
+  k=ioresult;
+  reset(f);
+  while (ioresult!=0) 
+   {
+    show_mouse();
+    k= do_alert(al_mess,1);
+    hide_mouse();
+    reset(f);
+   }
+  close(f);
+}
+
+void takesav(integer n)
+{
+        untyped_file f;
+        integer i;
+       varying_string<10> st;
+
+  dem1();
+  /* -- chargement du fichier 'sauve#n.mor' -- */
+  st= string("sav")+chr(n+48)+".mor";
+  assign(f,st);
+  reset(f,497);
+  blockread(f,s1,1);
+  if (ioresult!=0) 
+     {
+       i=do_alert(err_mess,1);
+       exit(0);
+     }
+  s=s1;
+  for( i=0; i <= 389; i ++) tabdon[i+acha]=bufcha[i];
+  close(f);
+}
+
+void ld_game(integer n)
+{
+  hide_mouse();
+  maivid();
+  takesav(n);
+  /* -- disquette 2 -- */
+  dem2();
+  /* -- mises en place -- */
+  theure();
+  dprog();
+  antegame();
+  show_mouse();
+}
+
+void sv_game(integer n)
+{
+        untyped_file f;
+        integer i;
+
+  hide_mouse();
+  tmaj3();
+  dem1();
+  /* -- sauvegarde du fichier 'sauve#n.mor' -- */
+  for( i=0; i <= 389; i ++) bufcha[i]=tabdon[i+acha];
+  s1=s;
+  if (s1.mlieu== 26)  s1.mlieu= 15;
+  assign(f,string("sav")+chr(n+48)+".mor");
+  rewrite(f,497);
+  blockwrite(f,s1,1);
+  close(f);
+  dem2();
+  show_mouse();
+}
+
+
+
+
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
new file mode 100644
index 0000000..7dd029e
--- /dev/null
+++ b/engines/mortevielle/droite.h
@@ -0,0 +1,35 @@
+void droite( integer x, integer y, integer xx, integer yy, integer coul )
+   {
+         integer step,i;
+         real a,b;
+         real xr,yr,xro,yro;
+
+     xr=x; yr=y; xro=xx; yro=yy;
+     /*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
+     if (abs(y-yy) > abs(x-xx)) 
+        {
+          a= (real)((x-xx)) / (y-yy);
+          b= ( yr*xro - yro*xr) / (y-yy);
+          i=y;
+          if (y>yy)  step=-1;
+                  else step=1;
+          do {
+            putpix(gd, trunc(a*i+b), i, coul);
+            i=i+step;
+          } while (!(i==yy));
+          /*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
+        }
+      else
+        {
+          a= (real)((y-yy)) / (x-xx);
+          b= ((yro*xr) - (yr*xro)) / (x-xx);
+          i=x;
+          if (x>xx)  step=-1;
+                  else step=1;
+          do {
+            putpix(gd,i, trunc(a*i+b), coul);
+            i=i+step;
+          } while (!(i==xx));
+          /*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
+        }
+   }
\ No newline at end of file
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
new file mode 100644
index 0000000..9f8423a
--- /dev/null
+++ b/engines/mortevielle/keyboard.h
@@ -0,0 +1,59 @@
+char readkey1()
+  {
+       char c;
+
+    char readkey1_result;
+    input >> kbd >> c;
+    readkey1_result= c;
+    return readkey1_result;
+  }
+
+integer testou()
+  {
+        char ch;
+
+    integer testou_result;
+    input >> kbd >> ch;
+    switch  (ch)  {
+              case '\23' : sonoff= ! sonoff; break;
+              case '\1':
+              case '\3':
+              case '\5'  : {
+                      newgd= (cardinal)pred(integer,ord(ch)) >> 1;
+                      testou_result= 61;
+                      return testou_result;
+                    }
+                    break;
+              case '\10'  : {
+                      newgd= her;
+                      testou_result= 61;
+                      return testou_result;
+                    }
+                    break;
+              case '\24' : {
+                      newgd= tan;
+                      testou_result= 61;
+                      return testou_result;
+                    }
+                    break;
+              case '\26' : if (set::of(1,2, eos).has(c_zzz)) 
+                       {
+                         zzuul(adcfiec+161,0,1644);
+                         c_zzz=succ(integer,c_zzz);
+                         testou_result=61;
+                         return testou_result;
+                       }
+                       break;
+              case '\33' : if (keypressed())  input >> kbd >> ch; break;
+      }
+    testou_result=ord(ch);
+    return testou_result;
+  }
+
+void teskbd()
+  {
+        integer dum;
+
+    if (keypressed())  dum=testou();
+  }
+
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
new file mode 100644
index 0000000..be92e8d
--- /dev/null
+++ b/engines/mortevielle/level15.h
@@ -0,0 +1,186 @@
+
+/* NIVEAU 15 */
+void copcha()
+{
+      integer i;
+
+  i= acha;
+  do {
+    tabdon[i]=tabdon[i+390];
+    i=succ(integer,i);
+  } while (!(i==acha +390));
+}
+
+boolean dans_rect( rectangle r )
+   {
+         integer x, y, c;
+
+     boolean dans_rect_result;
+     read_pos_mouse(x,y,c);
+       if ((x>r.x1) &&
+          (x<r.x2) &&
+          (y>r.y1) &&
+          (y<r.y2))  dans_rect_result= true;
+                 else dans_rect_result= false;
+     return dans_rect_result;
+   }
+
+void outbloc(integer n, pattern p, t_nhom pal)
+   {
+         integer i,j,ad;
+
+     ad=n*404+0xd700;
+       {
+         memw[0x6000+ad]= p.tax;
+         memw[0x6000+ad+2]= p.tay;
+         ad=ad+4;
+         for( i=1; i <= p.tax; i ++)
+           for( j=1; j <= p.tay; j ++)
+             mem[0x6000+ad+pred(integer,j)*p.tax+pred(integer,i)]= pal[n].hom[p.des[i][j]];
+       }
+   }
+
+
+void writepal(integer n)
+ {
+         integer i;
+       t_nhom pal;
+
+
+   switch (gd) {
+           case tan:
+           case ega:
+           case ams : for( i=1; i <= 16; i ++)
+                   {
+                     mem[0x7000+2*i]= tabpal[n][i].x;
+                     mem[0x7000+succ(integer,2*i)]= tabpal[n][i].y;
+                   }
+                   break;
+           case cga : {
+                   pal= palcga[n].a;
+                   if (n<89)  palette(palcga[n].p);
+                   for( i=0; i <= 15; i ++) outbloc(i, tpt[pal[i].n],pal);
+                 }
+                 break;
+   }
+ }
+
+
+void pictout(integer seg,integer dep,integer x,integer y)
+   {
+     decomp(seg,dep);
+     if (gd==her) 
+        {
+          mem[0x7000+2]=0;
+          mem[0x7000+32]=15;
+        }
+     if ((caff!=51) && (memw[0x7000+0x4138]>0x100))  memw[0x7000+0x4138]=0x100;
+     afff(gd,seg,dep,x,y);
+   }
+
+void putxy(integer x,integer y)
+{
+  xwhere=x;
+  ywhere=y;
+}
+/*
+function calad(x,y:integer):integer;
+   begin
+     calad:=pred(x)+320*pred(y)
+   end;
+  */
+void sauvecr(integer y,integer dy)
+  {
+    hide_mouse();
+    s_sauv(gd,y,dy);
+    show_mouse();
+  }
+
+void charecr(integer y,integer dy)
+  {
+    hide_mouse();
+    s_char(gd,y,dy);
+    show_mouse();
+  }
+/*
+function peek(ad:integer):integer;
+begin
+  peek:=tabdon[ad];
+end;
+
+function peekw(ad:integer):integer;
+begin
+  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
+end;
+
+function peekl(ad:integer):real;
+begin
+  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
+end;
+
+
+procedure poke (ad,n:integer);
+begin
+  tabdon[ad]:=lo(n);
+end;
+  */
+
+void adzon()
+   {
+         untyped_file f;
+         file<byte> g;
+         byte a;
+         integer i;
+
+     assign(f,"don.mor");
+     reset(f,256);
+     blockread(f,tabdon,7);
+     close(f);
+     assign(f,"bmor.mor");
+     reset(f,1916);
+     blockread(f,tabdon[fleche],1);
+     /*i:=fleche;
+     repeat
+       read(g,a);
+       tabdon[i]:=a;
+       i:=succ(i);
+     until i=fleche + 1916;*/
+     close(f);
+     assign(f,"dec.mor");
+     reset(f,1664);
+     blockread(f,mem[0x73a2+0],1);
+     /*i:=0;
+     repeat
+       read(g,a);
+       mem[$73A2:i]:=a;
+       i:=succ(i);
+     until eof(g);*/
+     close(f);
+   }
+
+integer animof (integer ouf,integer num)
+   {
+         integer nani, aux;
+
+     integer animof_result;
+     nani= mem[adani+1];
+     aux= num;
+     if (ouf!=1)  aux= aux+nani;
+     animof_result=(nani << 2) + 2+swap(memw[adani+ (aux << 1)]);
+     /*aux:= nani shl 2 + 2;
+     if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
+              else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
+     animof:=aux;*/
+     return animof_result;
+   }
+
+/*procedure affgd(offs,dep,x,y:integer);
+begin
+  case Gd of
+     Ams : affams(offs,dep,x,y);
+     Cga : affcga(offs,dep,x,y);
+     Ega : affega(offs,dep,x,y);
+     Her : affher(offs,dep,x,y);
+     Tan : afftan(offs,dep,x,y);
+  end;
+end;*/
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
new file mode 100644
index 0000000..9256182
--- /dev/null
+++ b/engines/mortevielle/menu.h
@@ -0,0 +1,306 @@
+/* NIVEAU 14*/
+
+/* overlay */ void menut(integer no, str30 nom)
+   {
+         byte h,l;
+         str30 s;
+
+
+     /* debug('menut'); */
+     h=hi(no);
+     l=lo(no);
+     s=nom;
+     if (! tesok) 
+        {
+          clrscr;
+          exit(0);
+        }
+     while (length(s)<30)  s=s+' ';
+     switch (h) {
+           case invent  :  if (l!=7)  inv[l]= string(' ')+s; break;
+           case depla   :  dep[l]= s; break;
+           case action  :  act[l]= s; break;
+           case saction :  self_[l]= s; break;
+           case discut  :  dis[l]= s; break;
+        }
+   }
+
+/* overlay */ void menu_disable(integer no)
+   {
+         byte h,l;
+
+     /* debug('menu_disable'); */
+     h=hi(no);
+     l=lo(no);
+     switch (h) {
+           case invent : {
+                 if (l>6)  {
+                               inv[l][1]='<';
+                               inv[l][22]='>';
+                             }
+                        else inv[l][1]='*';
+               }
+               break;
+           case depla : dep[l][1]='*'; break;
+           case action : act[l][1]='*'; break;
+           case saction : self_[l][1]='*'; break;
+           case discut : dis[l][1]='*'; break;
+        }
+   }
+
+/* overlay */ void menu_enable(integer no)
+   {
+         byte h,l;
+
+     /* debug('menu_disable'); */
+     h=hi(no);
+     l=lo(no);
+     switch (h) {
+           case invent : {
+                      inv[l][1]=' ';
+                      inv[l][22]=' ';
+                    }
+                    break;
+           case depla : dep[l][1]=' '; break;
+           case action : act[l][1]=' '; break;
+           case saction : {
+                       self_[l][1]=' ';
+                       self_[l][1]=' ';
+                     }
+                     break;
+           case discut : dis[l][1]=' '; break;
+        }
+   }
+
+void menu_aff()
+   {
+         integer ind_tabl,k,col;
+         char c;
+         integer pt,x,y,color,msk,
+         num_letr;
+
+     /* debug('menu_aff'); */
+     hide_mouse();
+     /*if not tesok then
+        begin
+          clrscr;
+          halt;
+        end;*/
+     box( 7, gd, 0,0, 639,10, 255);
+     col= 28*res;
+     if (gd == cga)  color=1;
+                 else color=9;
+     num_letr=0;
+     do {       /* lettre par lettre */
+       num_letr= num_letr +1;
+       ind_tabl=0;
+       y= 1;
+       do {      /* colonne par colonne */
+         k=0;
+         x= col;
+         do {     /* ligne par ligne */
+           msk=0x80;
+           for( pt=0; pt <= 7; pt ++)
+            {
+              if ((lettres[num_letr][ind_tabl] & msk)!=0) 
+                 {
+                   putpix(gd,x+1,y+1,0);
+                   putpix(gd,x,y+1,0);
+                   putpix(gd,x,y,color);
+                 }
+              msk= (cardinal)msk >> 1;
+              x=x +1;
+            }
+           ind_tabl=succ(integer,ind_tabl);
+           k=succ(integer,k);
+         } while (!(k==3));
+         y=y+1;
+       } while (!(y==9));
+       col=col+48*res;
+     } while (!(num_letr==6));
+     show_mouse();
+   }
+
+
+void draw_menu()
+  {
+    /* debug('draw_menu'); */
+    menu_aff();
+    active_menu=true;
+    msg4=no_choice;
+    msg3=no_choice;
+    choisi=false;
+    clic=false;
+    test0=false;
+  }
+
+void invers(integer ix)
+   {
+         varying_string<23> s;
+
+     /* debug('invers'); */
+     if (msg4==no_choice)  return;
+     putxy(don[msg3][1] << 3,succ(void,lo(msg4)) << 3);
+     switch (msg3) {
+                  case 1 : s= inv[lo(msg4)]; break;
+                  case 2 : s= dep[lo(msg4)]; break;
+                  case 3 : s= act[lo(msg4)]; break;
+                  case 4 : s= self_[lo(msg4)]; break;
+                  case 5 : s= dis[lo(msg4)]; break;
+                  case 6 : s= fic[lo(msg4)]; break;
+                  case 7 : s= fic[1]+' '+chr(48+lo(msg4)); break;
+                  case 8 : if (lo(msg4)==1)  s=recom;
+                              else s= fic[2]+' '+chr(47+lo(msg4));
+                              break;
+          }
+     if ((s[1]!='*') && (s[1]!='<'))  writeg(s,ix);
+                                    else msg4=no_choice;
+   }
+
+void util(integer x,integer y)
+   {
+         integer ymx, dxcar, xmn, xmx, ix;
+
+     /* debug('util'); */
+     ymx= (don[msg3][4] << 3)+16;
+     dxcar= don[msg3][3];
+     xmn= (don[msg3][1] << 2)*res;
+     if (res==1)  ix=5; else ix=3;
+     xmx= dxcar*ix*res+ xmn+ 2;
+     if ((x>xmn) && (x<xmx) && (y<ymx) && (y>15)) 
+             {
+               ix= pred(integer,(cardinal)y >> 3)+ (msg3 << 8);
+               if (ix!=msg4) 
+                 {
+                   invers(1);
+                   msg4=ix;
+                   invers(0);
+                 }
+             }
+           else if (msg4!=no_choice) 
+                 {
+                   invers(1);
+                   msg4=no_choice;
+                 }
+   }
+
+void menu_down( integer ii)
+   {
+         integer cx, xcc;
+         integer xco, nb_lig;
+
+     /* debug('menu_down'); */
+     xco=don[ii][1];
+     nb_lig= don[ii][4];
+     hide_mouse();
+     sauvecr(10,succ(byte,don[ii][2]) << 1);
+     xco= xco << 3;
+     if (res==1)  cx=10; else cx=6;
+     xcc= xco+ (don[ii][3]*cx)+6;
+     box(15, gd, xco,12, xcc, 10 + (don[ii][2] << 1), 255);
+     box(0, gd, xcc, 12, xcc+4, 10 + (don[ii][2] << 1),255);
+     box(0,gd,xco, 8 + (don[ii][2] << 1), xcc+4, 12 + (don[ii][2] << 1),255);
+     putxy(xco,16);
+     cx=0;
+     do {
+       cx= succ(integer,cx);
+       switch (ii) {
+             case 1 : if (inv[cx][1]!= '*')  writeg(inv[cx],4); break;
+             case 2 : if (dep[cx][1]!= '*')  writeg(dep[cx],4); break;
+             case 3 : if (act[cx][1]!= '*')  writeg(act[cx],4); break;
+             case 4 : if (self_[cx][1]!='*')  writeg(self_[cx],4); break;
+             case 5 : if (dis[cx][1]!= '*')  writeg(dis[cx],4); break;
+             case 6 : writeg(fic[cx],4); break;
+             case 7 : writeg(fic[1]+' '+chr(48+cx),4); break;
+             case 8 : if (cx==1)  writeg( recom,4);
+                         else writeg(fic[2]+' '+chr(47+cx),4);
+                         break;
+          }
+       putxy(xco,ywhere+8);
+     } while (!(cx==nb_lig));
+     test0=true;
+     show_mouse();
+   }
+
+void menu_up(integer xx)
+   {
+     /* debug('menu_up'); */
+     if (test0) 
+       {
+         charecr(10,succ(byte,don[xx][2]) << 1);
+         test0=false;
+       }
+   }
+
+void erase_menu()
+  {
+    /* debug('erase_menu'); */
+    active_menu=false;
+    clic=false;
+    menu_up(msg3);
+  }
+
+void mdn()
+   {
+           integer x,y,c,a,ix;
+           boolean tes;
+
+     /* debug('mdn'); */
+     if (! active_menu)  return;
+     x=x_s; y=y_s;
+     if (! clic) 
+      {
+        if ((x==xprec) &&
+           (y==yprec))  return;
+        else {
+               xprec=x;
+               yprec=y;
+             }
+        tes=(y<11) && ((set::of(range(28*res,28*res+24),range(76*res,76*res+24), eos).has(x))
+                         || ((x>124*res) && (x<124*res+24))
+                         || ((x>172*res) && (x<172*res+24))
+                         || ((x>220*res) && (x<220*res+24))
+                         || ((x>268*res) && (x<268*res+24)));
+        if (tes) 
+           {
+             if (x<76*res)  ix=invent;
+              else if (x<124*res)  ix=depla;
+               else if (x<172*res)  ix=action;
+                else if (x<220*res)  ix=saction;
+                 else if (x<268*res)  ix=discut;
+                  else ix= fichier;
+             if ((ix!=msg3) || (! test0)) 
+              if (! ((ix==fichier) &&  (set::of(sauve, charge, eos).has(msg3)))) 
+                 {
+                   menu_up(msg3);
+                   menu_down(ix);
+                   msg3=ix;
+                   msg4=no_choice;
+                 }
+          }
+         else    /* Not in the MenuTitle line */
+          {
+            if ((y>11) && (test0))  util(x,y);
+          }
+      }
+     else          /* il y a eu 'clic' */
+     if ((msg3==fichier) && (msg4!=no_choice)) 
+       {
+         clic=false;
+         menu_up(msg3);
+         if (lo(msg4)==1)  msg3=7;
+                   else msg3=8;
+         menu_down(msg3);
+       }
+     else    /*  il y a eu clic sur un autre menu  */
+       {
+         choisi=(test0) && (msg4!=no_choice);
+         menu_up(msg3);
+         msg[4]=msg4;
+         msg[3]=msg3;
+         msg3=no_choice;
+         msg4=no_choice;
+         clic=false;
+       }
+   }
+
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
new file mode 100644
index 0000000..a4fe1e1
--- /dev/null
+++ b/engines/mortevielle/mor.h
@@ -0,0 +1,1457 @@
+/* Niveau 14 suite */
+const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
+
+
+void testfi()
+   {
+     if (ioresult!= 0) 
+        {
+          caff= do_alert(err_mess,1);
+          exit(0);
+        }
+   }
+
+
+integer readclock()
+{
+               registres r;
+         integer s, m, h;
+
+/* debug('readclock');*/
+  integer readclock_result;
+  r.ax = 0x2c00;
+  intr(0x21,r);
+  {
+    h=(cardinal)r.cx >> 8;
+    m=r.cx % 256;
+    s=(cardinal)r.dx >> 8;
+  }
+  m= m * 60;
+  h= h* 3600;
+  readclock_result= h+ m+ s;
+  return readclock_result;
+}
+
+void modif(integer& nu)
+{
+ /* debug('modif'); */
+ if (nu== 26)  nu= 25;
+ if ((nu> 29) && (nu< 36))  nu= nu- 4;
+ if ((nu> 69) && (nu< 78))  nu= nu- 37;
+ if ((nu> 99) && (nu< 194))  nu= nu- 59;
+ if ((nu> 996) && (nu< 1000))  nu= nu- 862;
+ if ((nu> 1500) && (nu< 1507))  nu= nu- 1363;
+ if ((nu> 1507) && (nu< 1513))  nu= nu- 1364;
+ if ((nu> 1999) && (nu< 2002))  nu= nu- 1851;
+ if (nu== 2010)  nu= 151;
+ if ((nu> 2011) && (nu< 2025))  nu= nu- 1860;
+ if (nu== 2026)  nu= 165;
+ if ((nu> 2029) && (nu< 2037))  nu= nu- 1864;
+ if ((nu> 3000) && (nu< 3005))  nu= nu- 2828;
+ if (nu== 4100)  nu= 177;
+ if (nu== 4150)  nu= 178;
+ if ((nu> 4151) && (nu< 4156))  nu= nu- 3973;
+ if (nu== 4157)  nu= 183;
+ if ((nu== 4160) || (nu== 4161))  nu= nu- 3976;
+}
+
+
+void dessine(integer ad, integer x, integer y)
+{
+  /* debug('dessine'); */
+  hide_mouse();
+  writepal(numpal);
+  pictout(ad,0,x,y);
+  show_mouse();
+}
+
+void dessine_rouleau()
+{
+  /* debug('dessine_rouleau'); */
+  writepal(89);
+  if (gd==her) 
+     {
+       mem[0x7000+14]=15;
+     }
+  hide_mouse();
+  pictout(0x73a2,0,0,0);
+  show_mouse();
+}
+
+
+void text_color(integer c)
+{
+  color_txt= c;
+}
+
+/* NIVEAU 13 */
+
+
+void text1(integer x,integer y,integer nb,integer m)
+{
+       phrase st;
+       integer tay;
+       integer co;
+
+
+  /* debug('text'); */
+  if (res==1)  co=10; else co=6;
+  deline(m,st,tay);
+  if ((y==182) && (tay*co>nb*6))  y=176;
+  afftex(st,x,y,nb,20,color_txt);
+}
+
+void initouv()
+ {
+      integer cx;
+
+   /* debug('initouv'); */
+   for( cx= 1; cx <= 7; cx ++) touv[cx]= chr(0);
+ }
+
+void ecrf1()
+{
+  boite(0, 11, 512, 163, 15);           /* grand dessin */
+}
+
+void clsf1()
+{
+      integer i,j;
+
+ /* debug('clsf1'); */
+ hide_mouse();
+ box(0,gd, 0,11, 514,175, 255);
+/* if Gd=ams then port[$3DD]:=15;
+ case Gd of
+         ams,
+         cga : begin
+                 for j:=0 to 63 do
+                    begin
+                      for i:=6 to 86 do
+                         begin
+                           mem[$B800:i*80+j]:=0;
+                           mem[$Ba00:i*80+j]:=0;
+                         end;
+                      mem[$b800:6960+j]:=0;
+                      mem[$ba00:400+j]:=0;
+                    end;
+               end;
+         ega : begin
+                 port[$3C4]:= 2;
+                 port[$3C5]:= 15;
+                 port[$3CE]:= 8;
+                 port[$3CF]:= 255;
+                 for j:=0 to 63 do
+                    for i:=11 to 174 do
+                       mem[$A000:i*80+j]:=0;
+               end;
+         tan : begin
+                 for j:=0 to 128 do
+                    begin
+                      for i:=3 to 43 do
+                         begin
+                           mem[$B800:i*160+j]:=0;
+                           mem[$Ba00:i*160+j]:=0;
+                           mem[$bc00:i*160+j]:=0;
+                           if i<>43 then mem[$be00:i*160+j]:=0;
+                         end;
+                      mem[$be00:320+j]:=0;
+                    end;
+               end;
+ end;
+ droite(256*res,11,256*res,175,0);*/
+ show_mouse();
+}
+
+void clsf2()
+{
+       integer i,j;
+
+ /* debug('clsf2'); */
+ hide_mouse();
+ if (f2_all) 
+    {
+      box(0,gd,1,176,633,199,255);
+      boite(0,175,634,24,15);
+      f2_all=false;
+    }
+  else
+    {
+      box(0,gd,1,176,633,190,255);
+      boite(0,175,634,15,15);
+    }
+ show_mouse();
+}
+
+void ecrf2()
+{
+  /* debug('ecrf2'); */
+  text_color(5);
+  /*boite(0,175,630,15,15);*/
+}
+
+void ecr2(str255 str_)
+{
+      integer tab;
+      integer tlig;
+
+ /* debug('ecr2 : '+str_);*/
+ if (res==1)  tab=10; else tab=6;
+ putxy(8,177);
+ tlig=59+pred(integer,res)*36;
+ if (length(str_)<tlig)  writeg(str_,5);
+  else if (length(str_)<(tlig << 1)) 
+          {
+            putxy(8,176);
+            writeg(copy(str_,1,pred(integer,tlig)),5);
+            putxy(8,182);
+            writeg(copy(str_,tlig,tlig << 1),5);
+          }
+   else {
+          f2_all=true;
+          clsf2();
+          putxy(8,176);
+          writeg(copy(str_,1,pred(integer,tlig)),5);
+          putxy(8,182);
+          writeg(copy(str_,tlig,pred(integer,tlig << 1)),5);
+          putxy(8,190);
+          writeg(copy(str_,tlig << 1,tlig*3),5);
+        }
+}
+
+void clsf3()
+{
+       integer i,j;
+
+  /* debug('clsf3'); */
+  hide_mouse();
+  box(0,gd,1,192,633,199,255);
+  boite(0,191,634,8,15);
+  show_mouse();
+}
+
+void ecr3(str255 text)
+{
+ /* debug('ecr3 : '+text);*/
+ clsf3();
+ putxy(8,192);
+ writeg(text,5);
+}
+
+void ecrf6()
+{
+  /* debug('ecrf6'); */
+  text_color(5);
+  boite(62, 33, 363, 80, 15);
+}
+
+void ecrf7()
+{
+ text_color(4);
+/* draw_mode(2);
+ text_height(4*res);
+ text_style(normal);*/
+}
+
+void clsf10()
+{
+      integer co,cod;
+      varying_string<8> st;
+
+ /* debug('clsf10'); */
+ hide_mouse();
+ if (res==1) 
+    {
+      co=634;
+      cod=534;
+    }
+  else
+    {
+      co=600;
+      cod=544;
+    }
+ box(15,gd, cod, 93, co, 98, 255);
+ if (s.conf< 33)  st="Cool";
+               else
+ if (s.conf< 66)  st=" Lourde ";
+               else
+ if (s.conf> 65)  st="Malsaine";
+ if (res==1)  co=10; else co=6;
+ co= 574-((cardinal)co*length(st) >> 1);
+ putxy(co,92);
+ writeg(st,4);
+ if (res==1)  co=620; else co=584;
+ box(15,gd, 560, 24, co, 86, 255);
+/* rempli(69,12,32,5,255);*/
+ show_mouse();
+}
+
+   void stop()
+     {
+       clrscr;
+       hirs();
+       gd=ams;
+       hirs();
+       exit(0);
+     }
+
+void paint_rect(integer x, integer y, integer dx, integer dy)
+   {
+         integer co;
+
+     /* debug('paint_rect'); */
+     if (gd==cga)  co= 3;
+               else co=11;
+     box(co,gd,x,y,x+dx,y+dy,255);
+   }
+
+integer hazard(integer min,integer max)
+   {
+         integer ha1;
+         real ha2;
+
+     /* debug('hazard'); */
+     integer hazard_result;
+     ha2= Random();
+     ha1= trunc(ha2*(max-min));
+     hazard_result= min+ ha1;
+     return hazard_result;
+   }
+
+void calch(integer& j,integer& h,integer& m)
+{
+ integer th,nh;
+
+/* debug('calch');*/
+ nh= readclock();
+ th= jh+ ((nh- mh) / t);
+ m= ((th % 2)+ vm)* 30;
+ h= ((cardinal)th >> 1)+ vh;
+ if (m== 60) 
+ {
+  m= 0;
+  h= h+ 1;
+ }
+ j= (h / 24)+ vj;
+ h= h- ((j- vj)* 24);
+}
+
+void conv(integer x, integer& y)
+{
+ integer cx;
+
+ /* debug('conv'); */
+ cx= 1;
+ y= 128;
+ while (cx< x) 
+ {
+  y= (cardinal)y >> 1;
+  cx= succ(integer,cx);
+ }
+}
+
+/* NIVEAU 12 */
+void okpas()
+{
+  tesok=true;
+}
+
+void modobj(integer m)
+{
+ phrase str_;
+ str30 strp;
+ integer i,tay;
+
+ /* debug('modobj'); */
+ strp=' ';
+ if (m!= 500) 
+    {
+      deline(m- 501+ c_st41,str_,tay);
+      strp= delig;
+    }
+ menut( invt[8], strp);
+ menu_disable( invt[8]);
+}
+
+void modobj2(integer m,boolean t1,boolean t2)
+{
+ phrase str_;
+ str30 strp;
+ integer i,tay;
+
+ /* debug('modobj'); */
+  strp=' ';
+ if (t1 || t2)  okpas();
+             else tesok=false;;
+ if (m!= 500) 
+    {
+      deline(m- 501+ c_st41,str_,tay);
+      strp= delig;
+    }
+ menut( invt[8], strp);
+ menu_disable( invt[8]);
+}
+
+
+void repon(integer f,integer m)
+{
+ str255 str_;
+ varying_string<40> str1;
+ phrase st;
+ text1 fic;
+ integer i, xco, dx, caspe, tay;
+
+ /* debug('repon fenetre nø'+chr(f+48));*/
+ if ((m> 499) && (m< 563)) 
+ {
+  deline( m-501+c_st41,st,tay);
+  if (tay>((58+pred(integer,res)*37) << 1))  f2_all= true;
+                                 else f2_all= false;
+  clsf2();
+  afftex(st,8,176,85,3,5);
+ }
+ else
+ {
+  modif(m);
+  if (f== 8)  f= 2;
+  if (f== 1)  f= 6;
+  if (f== 2) 
+  {
+   clsf2();
+   ecrf2();
+   text1(8, 182, 103, m);
+   if ((m== 68) || (m== 69))  s.teauto[40]= '*';
+   if ((m== 104) && (caff== 14)) 
+   {
+    s.teauto[36]= '*';
+    if (s.teauto[39]== '*') 
+    {
+     s.pourc[3]= '*';
+     s.teauto[38]= '*';
+    }
+   }
+  }
+  if (set::of(6,9, eos).has(f)) 
+  {
+   deline(m,st,tay);
+   if (f==6)  i=4;
+          else i=5;
+   afftex(st,80,40,60,25,i);
+   if (m== 180)  s.pourc[6]= '*';
+   if (m== 179)  s.pourc[10]= '*';
+  }
+  if (f== 7)            /* messint */
+  {
+   ecrf7();
+   deline(m,st,tay);
+   if (res==1) 
+      {
+        xco=252-tay*5;
+        caspe= 100;
+        dx= 80;
+      }
+    else
+      {
+        xco=252-tay*3;
+        caspe= 144;
+        dx=50;
+      }
+   if (tay<40)  afftex(st,xco,86,dx,3,5);
+             else afftex(st,caspe,86,dx,3,5);
+  }
+ }
+}
+
+void f3f8()
+{
+      integer co;
+
+  if (res==1)  co=107; else co=64;
+  putxy(3,44);
+  writeg(f3,5);
+  ywhere= 51;
+  writeg(f8,5);
+  boite(0,42,co,16,7);
+}
+
+void t5(integer cx)
+{
+ /* debug('t5'); */
+ if (cx== 10)  blo= false;
+ if (cx!= 1) 
+ {
+  bh1= false;
+  bf1= false;
+ }
+ if (cx!= 2)  bh2= false;
+ if (cx!= 4) 
+ {
+  bh4= false;
+  bf4= false;
+ }
+ if (cx!= 5)  bh5= false;
+ if (cx!= 6)  bh6= false;
+ if (cx!= 8)  bh8= false;
+ if (cx!= 3)  bt3= false;
+ if (cx!= 7)  bt7= false;
+ if (cx!= 9)  bh9= false;
+}
+
+void affper(integer per)
+{
+ integer cx;
+
+ /* debug('affper'); */
+ for( cx= 1; cx <= 8; cx ++) menu_disable( disc[cx]);
+ clsf10();
+ if ((per & 128)== 128) 
+ {
+   putxy(560,24);
+   writeg("LEO",4);
+   menu_enable( disc[1]);
+ }
+ if ((per & 64)== 64) 
+ {
+  putxy(560, 32);
+  writeg("PAT",4);
+  menu_enable( disc[2]);
+ }
+ if ((per & 32)== 32) 
+ {
+  putxy(560, 40);
+  writeg("GUY",4);
+  menu_enable( disc[3]);
+ }
+ if ((per & 16)== 16) 
+ {
+  putxy(560,48);
+  writeg("EVA",4);
+  menu_enable( disc[4]);
+ }
+ if ((per & 8)== 8) 
+ {
+  putxy(560,56);
+  writeg("BOB",4);
+  menu_enable( disc[5]);
+ }
+ if ((per & 4)== 4) 
+ {
+  putxy(560, 64);
+  writeg("LUC",4);
+  menu_enable( disc[6]);
+ }
+ if ((per & 2)== 2) 
+ {
+  putxy(560, 72);
+  writeg("IDA",4);
+  menu_enable( disc[7]);
+ }
+ if ((per & 1)== 1) 
+ {
+  putxy(560, 80);
+  writeg("MAX",4);
+  menu_enable( disc[8]);
+ }
+ ipers= per;
+}
+
+/* overlay */ void choix(integer min,integer max, integer& per)
+{
+ boolean i;
+ integer haz,cx,cy,cz;
+ long_integer per2,cz2;
+
+ /* debug('o0 choix'); */
+ haz= hazard(min,max);
+ if (haz> 4) 
+ {
+  haz= 8- haz;
+  i= true;
+ }
+ else i= false;
+ cx= 0;
+ per= 0;
+ while (cx< haz) 
+ {
+  cy= hazard(1,8);
+  conv(cy,cz);
+  if ((per & cz)!= cz) 
+  {
+   cx= cx+ 1;
+   per= (per | cz);
+  }
+ }
+ if (i)  per= 255- per;
+ i= false;
+}
+
+/* overlay */ void cpl1(integer& p)
+{
+ integer j,h,m;
+
+ /* debug('o0 cpl1'); */
+ calch(j,h,m);
+ if ((h> 7) || (h< 11))  p= 25;
+ if ((h> 10) && (h< 14))  p= 35;
+ if ((h> 13) && (h< 16))  p= 50;
+ if ((h> 15) && (h< 18))  p= 5;
+ if ((h> 17) && (h< 22))  p= 35;
+ if ((h> 21) && (h< 24))  p= 50;
+ if ((h>= 0) && (h< 8))  p= 70;
+ mdn();
+}
+
+/* overlay */ void cpl2(integer& p)
+{
+ integer j,h,m;
+
+ /* debug('o0 cpl2'); */
+ calch(j,h,m);
+ if ((h> 7) && (h< 11))  p= -2;
+ if (h== 11)  p= 100;
+ if ((h> 11) && (h< 23))  p= 10;
+ if (h== 23)  p= 20;
+ if ((h>= 0) && (h< 8))  p= 50;
+}
+
+/* overlay */ void cpl3(integer& p)
+{
+ integer j,h,m;
+
+ /* debug('o0 cpl3'); */
+ calch(j,h,m);
+ if (((h> 8) && (h< 10)) || ((h> 19) && (h< 24)))  p= 34;
+ if (((h> 9) && (h< 20)) || ((h>= 0) && (h< 9)))  p= 0;
+}
+
+/* overlay */ void cpl5(integer& p)
+{
+ integer j,h,m;
+
+ /* debug('o0 cpl5'); */
+ calch(j,h,m);
+ if ((h> 6) && (h< 10))  p= 0;
+ if (h== 10)  p= 100;
+ if ((h> 10) && (h< 24))  p= 15;
+ if ((h>= 0) && (h< 7))  p= 50;
+}
+
+/* overlay */ void cpl6(integer& p)
+{
+ integer j,h,m;
+
+ /* debug('o0 cpl6'); */
+ calch(j,h,m);
+ if (((h> 7) && (h< 13)) || ((h> 17) && (h< 20)))  p= -2;
+ if (((h> 12) && (h< 17)) || ((h> 19) && (h< 24)))  p= 35;
+ if (h== 17)  p= 100;
+ if ((h>= 0) && (h< 8))  p= 60;
+}
+
+void person()
+{
+ const char m1[] = "Vous";
+ const char m2[] = "ˆtes";
+ const char m3[] = "SEUL";
+ integer cf;
+ str255 str_;
+
+ /* debug('person'); */
+ for( cf= 1; cf <= 8; cf ++) menu_disable( disc[cf]);
+ clsf10();
+ putxy(560, 30);
+ writeg(m1,4);
+ putxy(560, 50);
+ writeg(m2,4);
+ putxy(560, 70);
+ writeg(m3,4);
+ ipers= 0;
+}
+
+void chlm(integer& per)
+{
+  /* debug('chlm'); */
+  per= hazard(1,2);
+  if (per== 2)  per= 128;
+}
+
+void pendule()
+{
+ const matrix<1,2,1,12,integer> cv
+    = {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
+      {{-5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}} }};
+ const integer x = 580;
+ const integer y = 123;
+ const integer rg = 9;
+ integer h,co;
+
+
+ /* debug('pendule'); */
+ hide_mouse();
+ /*paint_rect(572,114,18,20);
+ paint_rect(577,114,6,20);*/
+ paint_rect(570,118,20,10);
+ paint_rect(578,114,6,18);
+ if (set::of(cga,her, eos).has(gd))  co=0; else co=1;
+ if (min== 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y- rg), co);
+           else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y+ rg), co);
+ h= heu;
+ if (h> 12)  h= h- 12;
+ if (h== 0)  h= 12;
+ droite(((cardinal)x >> 1)*res, y, ((cardinal)(x+ cv[1][h]) >> 1)*res, y+ cv[2][h], co);
+ show_mouse();
+ putxy( 568, 154);
+ if (heu> 11)  writeg( "PM ",1);
+            else writeg( "AM ",1);
+ putxy( 550, 160);
+ if (set::of(range(0,8), eos).has(jou))  writeg(string(chr(jou+49))+"& jour",1);
+}
+
+/*************
+ * NIVEAU 11 *
+ *************/
+
+void debloc(integer l)
+{
+/* debug('debloc'); */
+ num= 0;
+ x= 0;
+ y= 0;
+ if ((l!= 26) && (l!= 15))  t5(l);
+ mpers= ipers;
+}
+
+/* overlay */ void cpl10(integer& p,integer& h)
+{
+ integer j,m;
+
+/* debug('o1 cpl10'); */
+ calch(j,h,m);
+ if (((h> 7) && (h< 11)) || ((h> 11) && (h< 14))
+  || ((h> 18) && (h< 21)))  p= 100;
+ if ((h== 11) || ((h> 20) && (h< 24)))  p= 45;
+ if (((h> 13) && (h< 17)) || (h== 18))  p= 35;
+ if (h== 17)  p= 60;
+ if ((h>= 0) && (h< 8))  p= 5;
+}
+
+/* overlay */ void cpl11(integer& p,integer& h)
+{
+ integer j,m;
+
+/* debug('o1 cpl11'); */
+ calch(j,h,m);
+ if (((h> 8) && (h< 12)) || ((h> 20) && (h< 24)))  p= 25;
+ if (((h> 11) && (h< 14)) || ((h> 18) && (h< 21)))  p= 5;
+ if ((h> 13) && (h< 17))  p= 55;
+ if ((h> 16) && (h< 19))  p= 45;
+ if ((h>= 0) && (h< 9))  p= 0;
+}
+
+/* overlay */ void cpl12(integer& p)
+{
+ integer j,h,m;
+
+/* debug('o1 cpl12'); */
+ calch(j,h,m);
+ if (((h> 8) && (h< 15)) || ((h> 16) && (h< 22)))  p= 55;
+ if (((h> 14) && (h< 17)) || ((h> 21) && (h< 24)))  p= 25;
+ if ((h>= 0) && (h< 5))  p= 0;
+ if ((h> 4) && (h< 9))  p= 15;
+}
+
+/* overlay */ void cpl13(integer& p)
+{
+/* debug('o1 cpl13'); */
+ p= 0;
+}
+
+/* overlay */ void cpl15(integer& p)
+{
+ integer j,h,m;
+
+/* debug('o1 cpl15'); */
+ calch(j,h,m);
+ if ((h> 7) && (h< 12))  p= 25;
+ if ((h> 11) && (h< 14))  p= 0;
+ if ((h> 13) && (h< 18))  p= 10;
+ if ((h> 17) && (h< 20))  p= 55;
+ if ((h> 19) && (h< 22))  p= 5;
+ if ((h> 21) && (h< 24))  p= 15;
+ if ((h>= 0) && (h< 8))  p= -15;
+}
+
+/* overlay */ void cpl20(integer& p,integer& h)
+{
+ integer j,m;
+
+/* debug('o1 cpl20'); */
+ calch(j,h,m);
+ if (h== 10)  p= 65;
+ if ((h> 10) && (h< 21))  p= 5;
+ if ((h> 20) && (h< 24))  p= -15;
+ if ((h>= 0) && (h< 5))  p= -300;
+ if ((h> 4) && (h< 10))  p= -5;
+}
+
+/* overlay */ void quelq1(integer l)
+{
+ integer per;
+
+/* debug('o1 quelq1'); */
+ per= hazard(1,2);
+ if (l== 1) 
+  if (per== 1)  bh1= true; else bf1= true;
+ if (l== 4) 
+  if (per== 1)  bh4= true; else bf4= true;
+ ipers= 10;
+}
+
+/* overlay */ void quelq2()
+{
+/* debug('o1 quelq2'); */
+ if (li== 2)  bh2= true; else bh9= true;
+ ipers= 10;
+}
+
+/* overlay */ void quelq5()
+{
+/* debug('o1 quelq5'); */
+ bh5= true;
+ ipers= 10;
+}
+
+/* overlay */ void quelq6(integer l)
+{
+ integer per;
+
+/* debug('o1 quelq6'); */
+ if (l== 6)  bh6= true;
+ if (l== 8)  bh8= true;
+ ipers= 10;
+}
+
+/* overlay */ void quelq10(integer h, integer& per)
+{
+ integer min,max;
+
+/* debug('o1 quelq10'); */
+ if ((h>= 0) && (h< 8))  chlm(per); else
+ {
+  if ((h> 7) && (h< 10)) 
+  {
+   min= 5;
+   max= 7;
+  }
+  if ((h> 9) && (h< 12)) 
+  {
+   min= 1;
+   max= 4;
+  }
+  if (((h> 11) && (h< 15)) || ((h> 18) && (h< 21))) 
+  {
+   min= 6;
+   max= 8;
+  }
+  if (((h> 14) && (h< 19)) || ((h> 20) && (h< 24))) 
+  {
+   min= 1;
+   max= 5;
+  }
+  choix(min,max,per);
+ }
+ affper(per);
+}
+
+/* overlay */ void quelq11(integer h, integer& per)
+{
+ integer min,max;
+
+/* debug('o1 quelq11'); */
+ if ((h>= 0) && (h< 8))  chlm(per); else
+ {
+  if (((h> 7) && (h< 10)) || ((h>20) && (h< 24))) 
+  {
+   min= 1;
+   max= 3;
+  }
+  if (((h> 9) && (h< 12)) || ((h> 13) && (h< 19))) 
+  {
+   min= 1;
+   max= 4;
+  }
+  if (((h> 11) && (h< 14)) || ((h> 18) && (h< 21)))
+  {
+   min= 1;
+   max= 2;
+  }
+  choix(min,max,per);
+ }
+ affper(per);
+}
+
+/* overlay */ void quelq12(integer& per)
+{
+/* debug('o1 quelq12'); */
+ chlm(per);
+ affper(per);
+}
+
+/* overlay */ void quelq15(integer& per)
+{
+ integer cx;
+ boolean test;
+
+
+/* debug('o1 quelq15'); */
+ per= 0;
+ if (per== 0) 
+ {
+   do {
+     cx= hazard(1,8);
+     test =(((cx== 1) && (bh2 || bh9)) ||
+             ((cx== 2) && bh8) ||
+             ((cx== 3) && bh4) ||
+             ((cx== 4) && bf4) ||
+             ((cx== 5) && bh6) ||
+             ((cx== 6) && bh1) ||
+             ((cx== 7) && bf1) ||
+             ((cx== 8) && bh5));
+  } while (!(! test));
+  conv(cx,per);
+  affper(per);
+ }
+}
+
+/* overlay */ void quelq20(integer h, integer& per)
+{
+ integer min,max;
+
+/* debug('o1 quelq20'); */
+ if (((h>= 0) && (h< 10)) || ((h> 18) && (h< 24)))  chlm(per);
+ else
+ {
+  if ((h> 9) && (h< 12)) 
+  {
+   min= 3;
+   max= 7;
+  }
+  if ((h> 11) && (h< 18)) 
+  {
+   min= 1;
+   max= 2;
+  }
+  if (h== 18) 
+  {
+   min= 2;
+   max= 4;
+  }
+  choix(min,max,per);
+ }
+ affper(per);
+}
+
+
+/* overlay */void frap()
+{
+ integer j,h,m,haz;
+
+/* debug('o1 frap'); */
+ calch(j,h,m);
+ if ((h>= 0) && (h< 8))  crep= 190; else
+ {
+  haz= hazard(1,100);
+  if (haz> 70)  crep= 190; else crep= 147;
+ }
+}
+
+/* overlay */ void nouvp(integer l, integer& p)
+{
+/* debug('o1 nouvp'); */
+ p= 0;
+ if (l== 1) 
+ {
+  if (bh1)  p= 4;
+  if (bf1)  p= 2;
+ }
+ if (((l== 2) && (bh2)) || ((l== 9) && (bh9)))  p= 128;
+ if (l== 4) 
+ {
+  if (bh4)  p= 32;
+  if (bf4)  p= 16;
+ }
+ if ((l== 5) && (bh5))  p= 1;
+ if ((l== 6) && (bh6))  p= 8;
+ if ((l== 8) && (bh8))  p= 64;
+ if (((l== 3) && (bt3)) || ((l== 7) && (bt7)))  p= 9;
+ if (p!= 9)  affper(p);
+}
+
+
+
+/* overlay */ void tip(integer ip, integer& cx)
+{
+/* debug('o1 tip'); */
+ if (ip== 128)  cx= 1; else
+ if (ip== 64)   cx= 2; else
+ if (ip== 32)   cx= 3; else
+ if (ip== 16)   cx= 4; else
+ if (ip== 8)    cx= 5; else
+ if (ip== 4)    cx= 6; else
+ if (ip== 2)    cx= 7; else
+ if (ip== 1)    cx= 8;
+}
+
+
+/* overlay */ void ecfren(integer& p,integer& haz, integer cf,integer l)
+{
+/* debug('o1 ecfren'); */
+ if (l== 0)  person();
+ p= -500;
+ haz= 0;
+ if (((l== 1) && (! bh1) && (! bf1))
+ || ((l== 4) && (! bh4) && (! bf4)))  cpl1(p);
+ if ((l== 2) && (! bh2) && (! bh9))  cpl2(p);
+ if (((l== 3) && (! bt3)) || ((l== 7) && (! bt7)))  cpl3(p);
+ if ((l== 5) && (! bh5))  cpl5(p);
+ if (((l== 6) && (! bh6)) || ((l== 8) && (! bh8)))  cpl6(p);
+ if ((l== 9) && (! bh9) && (! bh2))  p= 10;
+ if (((l== 2) && (bh9)) || ((l== 9) && (bh2)))  p= -400;
+ if (p!= -500) 
+ {
+  p= p+ cf;
+  haz= hazard(1,100);
+ }
+}
+
+/* overlay */ void becfren(integer l)
+{
+ integer haz;
+
+/* debug('o1 becfren'); */
+ if ((l== 1) || (l== 4)) 
+ {
+  haz= hazard(1,2);
+  if (l== 1) 
+   if (haz== 1)  bh1= true; else bf1= true;
+  if (l== 4) 
+   if (haz== 1)  bh4= true; else bf4= true;
+ }
+ if (l== 2)  bh2= true; else
+ if (l== 3)  bt3= true; else
+ if (l== 5)  bh5= true; else
+ if (l== 6)  bh6= true; else
+ if (l== 7)  bt7= true; else
+ if (l== 8)  bh8= true; else
+ if (l== 9)  bh9= true;
+}
+
+/* NIVEAU 10 */
+void init_nbrepm()
+{
+        const array<1,8,byte> ipm
+            = {{4,5,6,7,5,6,5,8}};
+       integer i;
+
+/* debug('init_nbrepm'); */
+  i= 0;
+  do {
+    i= succ(integer,i);
+    nbrepm[i]= ipm[i];
+  } while (!(i==8));
+}
+
+void phaz(integer& haz,integer& p, integer cf)
+{
+/* debug('phaz'); */
+ p= p+ cf;
+ haz= hazard(1,100);
+}
+
+/* overlay */ void inzon()
+{
+ integer cx;
+
+/* debug('o2 inzon'); */
+ copcha();
+ {
+  s.ipre  = false;
+  s.derobj= 0;
+  s.icave = 0;
+  s.iboul = 0;
+  s.ibag  = 0;
+  s.ipuit = 0;
+  s.ivier = 0;
+  s.iloic = 136;
+  s.icryp = 141;
+  s.conf  = hazard(4,10);
+  s.mlieu = 21;
+  for( cx= 2; cx <= 6; cx ++) s.sjer[cx]= chr(0);
+  s.sjer[1]= chr(113);
+  s.heure= chr(20);
+  for( cx= 1; cx <= 10; cx ++) s.pourc[cx]= ' ';
+  for( cx= 1; cx <= 6; cx ++) s.teauto[cx]= '*';
+  for( cx= 7; cx <= 9; cx ++) s.teauto[cx]= ' ';
+  for( cx= 10; cx <= 28; cx ++) s.teauto[cx]= '*';
+  for( cx= 29; cx <= 42; cx ++) s.teauto[cx]= ' ';
+  s.teauto[33]= '*';
+ }
+ for( cx= 1; cx <= 8; cx ++) nbrep[cx]= 0;
+ init_nbrepm();
+}
+
+/* overlay */ void dprog()
+{
+/* debug('o2 dprog'); */
+ li= 21;
+ /* jh:= t_settime(0);*/
+ jh= 0;
+ if (! s.ipre)  blo= true;
+ t= ti1;
+ mh= readclock();
+}
+
+/* overlay */ void pl1(integer cf)
+{
+ integer p, haz;
+
+/* debug('o2 pl1'); */
+ if (((li== 1) && (! bh1) && (! bf1))
+ || ((li== 4) && (! bh4) && (! bf4))) 
+ {
+  cpl1(p);
+  phaz(haz,p,cf);
+  if (haz> p)  person(); else quelq1(li);
+ }
+}
+
+/* overlay */ void pl2(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl2'); */
+ if (! bh2) 
+ {
+  cpl2(p);
+  phaz(haz,p,cf);
+  if (haz> p)  person(); else quelq2();
+ }
+}
+
+/* overlay */ void pl5(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl5'); */
+ if (! bh5) 
+ {
+  cpl5(p);
+  phaz(haz,p,cf);
+  if (haz> p)  person(); else quelq5();
+ }
+}
+
+/* overlay */ void pl6(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl6'); */
+ if (((li== 6) && (! bh6)) || ((li== 8) && (! bh8))) 
+ {
+  cpl6(p);
+  phaz(haz,p,cf);
+  if (haz> p)  person(); else quelq6(li);
+ }
+}
+
+/* overlayi */ void pl9(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl9'); */
+ if (! bh9) 
+ {
+  cf= -10;
+  phaz(haz,p,cf);
+  if (haz> p)  person(); else quelq2();
+ }
+}
+
+/* overlayi */ void pl10(integer cf)
+{
+ integer p,h,haz;
+
+/* debug('o2 pl10'); */
+ cpl10(p,h);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq10(h,p);
+}
+
+/* overlay */ void pl11(integer cf)
+{
+ integer p,h,haz;
+
+/* debug('o2 pl11'); */
+ cpl11(p,h);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq11(h,p);
+}
+
+/* overlay */ void pl12(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl12'); */
+ cpl12(p);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq12(p);
+}
+
+/* overlay */ void pl13(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl13'); */
+ cpl13(p);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq12(p);
+}
+
+/* overlay */ void pl15(integer cf)
+{
+ integer p,haz;
+
+/* debug('o2 pl15'); */
+ cpl15(p);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq15(p);
+}
+
+/* overlay */ void pl20(integer cf)
+{
+ integer p,h,haz;
+
+/* debug('o2 pl20'); */
+ cpl20(p,h);
+ phaz(haz,p,cf);
+ if (haz> p)  person(); else quelq20(h,p);
+}
+
+/* overlay */ void t11(integer l11, integer& a)
+{
+ integer p,haz,h;
+
+/* debug('o2 t11'); */
+ ecfren(p,haz,s.conf,l11);
+ li= l11;
+ if ((l11> 0) && (l11< 10)) 
+  if (p!= -500) 
+  {
+   if (haz> p) 
+   {
+    person();
+    a= 0;
+   }
+   else
+   {
+    becfren(li);
+    nouvp(li,a);
+   }
+  }
+  else nouvp(li,a);
+ if (l11> 9) 
+  if ((l11> 15) && (l11!= 20) && (l11!= 26))  person(); else
+  {
+   if (l11== 10)  cpl10(p,h);
+   if (l11== 11)  cpl11(p,h);
+   if (l11== 12)  cpl12(p);
+   if ((l11== 13) || (l11== 14))  cpl13(p);
+   if ((l11== 15) || (l11== 26))  cpl15(p);
+   if (l11== 20)  cpl20(p,h);
+   p= p+ s.conf;
+   haz= hazard(1,100);
+   if (haz> p) 
+   {
+    person();
+    a= 0;
+   }
+   else
+   {
+    if (l11== 10)  quelq10(h,p);
+    if (l11== 11)  quelq11(h,p);
+    if ((l11== 12) || (l11== 13) || (l11== 14))  quelq12(p);
+    if ((l11== 15) || (l11== 26))  quelq15(p);
+    if (l11== 20)  quelq20(h,p);
+    a= p;
+   }
+  }
+}
+
+/* overlay */ void cavegre()
+
+{
+ integer haz;
+
+/* debug('cavegre'); */
+ s.conf= s.conf+ 2;
+ if (s.conf> 69)  s.conf= s.conf+ (s.conf / 10);
+ clsf3();
+ ecrf2();
+ ecr3(m1);
+ haz= (hazard(0, 4))- 2;
+ parole(2, haz, 1);
+ for( haz=0; haz <= 3000; haz ++);
+ clsf3();
+ person();
+}
+
+void writetp(str255 s,integer t)
+{
+  if (res==2)  writeg(s,t);
+           else writeg(copy(s,1,25),t);
+}
+
+void messint(integer nu)
+{
+/* debug('messint'); */
+ clsf1();
+ clsf2();
+ clsf3();
+ decomp( 0x73a2, 1008);
+ memw[0x7413+12]= 80;
+ memw[0x7413+14]=  40;
+ writepal(90);
+ afff(gd,0x73a2, 1008,0,0);
+ afff(gd,0x73a2, 1008,0,70);
+ repon(7,nu);
+}
+
+void aniof(integer ouf,integer num)
+   {
+          integer ad, offset;
+            char c;
+
+   /* debug('aniof'); */
+     if ((caff== 7) && ((num== 4) || (num== 5)))  return;
+     if ((caff== 10) && (num== 7))  num= 6;
+     if (caff== 12)  if (num== 3)  num= 4;
+                                    else if (num== 4)  num= 3;
+     ad= adani;
+     offset= animof(ouf,num);
+     decomp(ad,offset);
+     hide_mouse();
+     afff(gd,ad,offset,0,12);
+     ecrf1();
+     show_mouse();
+   }
+
+void musique(integer so)
+{
+ boolean i;
+ integer haz;
+/* dep: array[1..5] of long_integer;*/
+
+/* debug('musique'); */
+  if (so== 0)   /*musik(0)*/ {; }
+   else
+  if ((prebru== 0) && (! s.ipre)) 
+  {
+   parole(10, 1, 1);
+   prebru= prebru+ 1;
+  }
+  else
+  {
+   i= false;
+   if ((s.mlieu== 19) || (s.mlieu== 21) || (s.mlieu== 22)) 
+   {
+    haz= hazard(1,3);
+    if (haz== 2) 
+    {
+     haz= hazard(2,4);
+     parole(9,haz,1);
+     i= true;
+    }
+   }
+   if (s.mlieu== 20) 
+   {
+    haz= hazard(1,2);
+    if (haz== 1) 
+    {
+     parole(8,1,1);
+     i= true;
+    }
+   }
+   if (s.mlieu== 24) 
+   {
+    haz= hazard(1,2);
+    if (haz== 2) 
+    {
+     parole(12,1,1);
+     i= true;
+    }
+   }
+   if (s.mlieu== 23) 
+   {
+    parole(13,1,1);
+    i= true;
+   }
+   if (! i) 
+   {
+   /* dep[1]:= 1416;
+    dep[2]:= 1512;
+    dep[3]:= 1692;
+    dep[4]:= 1884;
+    dep[5]:= 2046;
+    haz:= hazard(1,5);
+    musik(dep[haz]);*/
+    haz= hazard(1,17);
+    parole(haz,1,2);
+   }
+  }
+}
+
+/* NIVEAU 9 */
+void dessin(integer ad)
+{
+ integer cx;
+
+/* debug('dessin'); */
+ if (ad!= 0)  dessine(ades,((ad % 160)* 2),(ad / 160));
+           else
+ {
+  clsf1();
+  if (caff> 99) 
+  {
+    dessine(ades,60,33);
+    boite(118, 32, 291, 121, 15);         /* cadre moyen */
+  }
+  else
+   if (caff> 69) 
+   {
+    dessine(ades,112,48);             /* tˆtes */
+    boite(222, 47, 155, 91, 15);
+   }
+   else
+   {
+    dessine(ades,0,12);
+    ecrf1();
+    if ((caff< 30) || (caff> 32)) 
+    {
+     for( cx= 1; cx <= 6; cx ++)
+      if (ord(touv[cx])!= 0)  aniof(1,ord(touv[cx]));
+     if (caff== 13) 
+     {
+      if (s.iboul== 141)  aniof(1,7);
+      if (s.ibag== 159)  aniof(1,6);
+     }
+     if ((caff== 14) && (s.icave== 151))  aniof(1,2);
+     if ((caff== 17) && (s.ivier== 143))  aniof(1,1);
+     if ((caff== 24) && (s.ipuit!= 0))  aniof(1,1);
+    }
+    if (caff< 26)  musique(1);
+   }
+ }
+}
+
+
+
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
new file mode 100644
index 0000000..8edf601
--- /dev/null
+++ b/engines/mortevielle/mor2.h
@@ -0,0 +1,764 @@
+const array<1,11,integer> men
+      = {{ scacher, attacher, defoncer, dormir,
+          entrer,  fermer,   frapper,  manger,
+          mettre,  ouvrir,   sortir }};
+
+void tinke()
+{
+ const char m1[] = "Mince! Vous entendez du bruit...";
+ const char d1[] = " | Vous devriez avoir remarqu‚|       ";
+ const char d2[] = "% des indices...";
+ const char d3 = '[';
+ const char d4 = ']';
+ const char d5 = '1';
+ const char d6[] = "OK";
+ integer cx,cy,haz,nh,cf,j,h,m,cd;
+    varying_string<3> stpo;
+      boolean am;
+
+ anyone= false;
+ calch(j,h,m);
+ if (j!= jou) 
+ {
+  jou= j;
+  cx=0;
+  do {
+    cx=cx+1;
+    if (nbrepm[cx]!= 0)  nbrepm[cx]= nbrepm[cx]- 1;
+    nbrep[cx]= 0;
+  } while (!(cx==8));
+ }
+ if ((h> heu) || ((h== 0) && (heu== 23))) 
+ {
+  heu= h;
+  min= 0;
+  pendule();
+  cf= 0;
+  for( cx= 1; cx <= 10; cx ++) if (s.pourc[cx]== '*')  cf= cf+ 1;
+  if (cf==10)  stpo="10";
+           else stpo=chr(cf+48);
+  stpou= string(d3)+ d5+ d4+ d3+ d1+ stpo+ '0'+ d2+ d4+ d3+ d6+ d4;
+ }
+ if (m> min) 
+ {
+  min= 30;
+  pendule();
+ }
+ if (y_s<12)  return;
+ if (! blo) 
+ {
+  if ((h== 12) || ((h> 18) && (h< 21)) || ((h>= 0) && (h< 7))) 
+   t= ti2; else t= ti1;
+  cf= s.conf;
+  if ((cf> 33) && (cf< 66))  t= t- (t / 3);
+  if (cf> 65)  t= t- ((t / 3)* 2);
+  nh= readclock();
+  if ((nh- mh)> t) 
+  {
+    am= active_menu;
+    erase_menu();
+    jh= jh+ ((nh- mh)/ t);
+    mh= nh;
+    switch (li) {
+            case 1:case 4 : pl1(cf); break;
+              case 2 : pl2(cf); break;
+              case 5 : pl5(cf); break;
+            case 6:case 8 : pl6(cf); break;
+              case 9 : pl9(cf); break;
+             case 10 : pl10(cf); break;
+             case 11 : pl11(cf); break;
+             case 12 : pl12(cf); break;
+          case 13:case 14 : pl13(cf); break;
+          case 15:case 26 : pl15(cf); break;
+             case 20 : pl20(cf); break;
+        }
+   if ((mpers!= 0) && (ipers!= 10))  mpers= ipers;
+   if ((mpers== 0) && (ipers> 0)) 
+    if ((s.mlieu== 13) || (s.mlieu== 14))  cavegre(); else
+     if (ipers== 10) 
+     {
+      ipers= 0;
+      if (! brt) 
+      {
+       brt= true;
+       hdb= readclock();
+       haz= hazard(1,5);
+       if (haz< 5) 
+       {
+        clsf3();
+        ecrf2();
+        ecr3(m1);
+        haz= (hazard(0, 4))- 2;
+        parole(1, haz, 1);
+        clsf3();
+       }
+      }
+     }
+    if (am)  draw_menu();
+  }
+ }
+ hfb= readclock();
+ if ((brt) && ((hfb- hdb)> 17)) 
+ {
+  nouvp(li,cx);
+  brt= false;
+  hdb= 0;
+  if ((s.mlieu> 0) && (s.mlieu< 10))  anyone= true;
+ }
+}
+
+void fenat(char ans)
+{
+      integer coul;
+
+  hide_mouse();
+  if (gd==cga)  coul=2;
+            else if (gd==her)  coul=1; else coul=12;
+  affcar(gd,306,193,coul,ord(ans));
+  boite(300, 191, 16, 8, 15);
+  show_mouse();
+}
+
+
+/* NIVEAU 8 */
+void afdes(integer ad)
+{
+  taffich();
+  dessin(ad);
+  okdes= false;
+}
+
+void tkey1(boolean d)
+{
+      boolean quest;
+      integer x,y,c;
+      integer key;
+
+ hide_mouse();
+ fenat('K');
+ while (keypressed())  key=testou();
+ do {
+   if (d)  tinke();
+   quest=keypressed();
+   read_pos_mouse(x,y,c);
+ } while (!(quest || (c!=0) || (d && anyone)));
+ if (quest)  key=testou();
+ clic=false;
+ show_mouse();
+}
+
+void tmlieu(integer mli)
+{
+ integer cx, j, i, tail;
+           str30 nomp;
+             phrase st;
+
+
+  if (mli== 26)  mli= 15;
+  i=1;
+  while ((i<8) && (v_lieu[i][mli]!=0))  
+     {
+       cx=v_lieu[i][mli];
+       deline(cx+c_tmlieu,st,tail);
+       nomp= delig;
+       while (length(nomp)<30)  nomp=nomp+' ';
+       menut( depl[i], nomp);
+       i=i+1;
+     }
+  nomp= "*                   ";
+  for( cx= 7; cx >= i; cx --) menut( depl[cx], nomp);
+}
+
+
+/* NIVEAU 7 */
+void tlu(integer af,integer ob)
+{
+  caff= 32;
+  afdes(0);
+  repon(6,ob+ 4000);
+  repon(2,999);
+  tkey1(true);
+  caff= af;
+  msg[3]= no_choice;
+  crep= 998;
+}
+
+void delin(integer n)
+  {
+      phrase s;
+      integer t;
+
+    deline(n,s,t);
+  }
+
+void affrep()
+{
+  caff= s.mlieu;
+  crep= s.mlieu;
+}
+
+void mfouen()
+
+{
+ integer cx;
+
+ tmlieu(s.mlieu);
+ for( cx=1; cx <= 11; cx ++) menu_enable( men[cx]);
+/* menu_enable( scacher);
+ menu_enable(menup, attacher);
+ menu_enable(menup, defoncer);
+ menu_enable(menup, dormir);
+ menu_enable(menup, entrer);
+ menu_enable(menup, fermer);
+ menu_enable(menup, frapper);
+ menu_enable(menup, manger);
+ menu_enable(menup, mettre);
+ menu_enable(menup, ouvrir);
+ menu_enable(menup, sortir);  */
+ menut( sonder, " sonder   ");
+ menut( soulever, " soulever ");
+}
+
+void atf3f8(integer& key)
+ {
+   do {
+     key= testou();
+   } while (!((key==61) || (key==66)));
+ }
+
+/* NIVEAU 6 */
+
+void tperd()
+{
+ integer cx;
+
+ initouv();
+ ment= 0;
+ iouv= 0;
+ mchai= 0;
+ mfouen();
+ if (! blo)  t11(21, cx);
+ perdu= true;
+ clsf1();
+ boite( 60, 35, 400, 50, 15);
+ repon(9,crep);
+ clsf2();
+ clsf3();
+ col= false;
+ syn= false;
+ okdes= false;
+}
+
+void tsort()
+{
+ integer cx;
+
+ if ((iouv> 0) && (s.mlieu!= 0)) 
+  if (s.conf< 50)  s.conf= s.conf+ 2;
+                else s.conf= s.conf+ (s.conf / 10);
+ for( cx= 1; cx <= 7; cx ++) touv[cx]= chr(0);
+ ment= 0;
+ iouv= 0;
+ mchai= 0;
+ debloc(s.mlieu);
+}
+
+void st4(integer ob)
+{
+ crep= 997;
+ switch (ob) {
+                case 114 : crep=109; break;
+                case 110 : crep=107; break;
+                case 158 : crep=113; break;
+    case RANGE_5(152,156):case 150:
+    case 100:case 157:case 160:case 161 : tlu(caff,ob);
+    break;
+ }
+}
+
+void cherjer(integer ob, boolean& d)
+{
+ integer cx;
+
+ d= false;
+ for( cx= 1; cx <= 6; cx ++) d=(d || (ord(s.sjer[cx])== ob));
+ if (s.derobj== ob)  d= true;
+}
+
+void st1sama()
+{
+ s.mlieu= 10;
+ affrep();
+}
+
+void modinv()
+{
+ integer cx, cy, tay, i, r;
+ phrase nom;
+ str30 nomp;
+
+ cy= 0;
+ for( cx=1; cx <= 6; cx ++)
+  if (s.sjer[cx]!= chr(0)) 
+    {
+      cy= succ(integer,cy);
+      r= (ord(s.sjer[cx])+ 400);
+      deline(r-501+c_st41,nom,tay);
+      nomp= delig;
+      menut( invt[cy], nomp);
+      menu_enable( invt[cx]);
+    }
+ if (cy<6) 
+    for( cx=cy+1; cx <= 6; cx ++)
+      {
+        menut( invt[cx], "                       ");
+        menu_disable( invt[cx]);
+      }
+}
+
+void sparl(long_integer adr, long_integer rep)
+{
+      const array<1,8,integer> haut
+           = {{0,1,-3,6,-2,2,7,-1}};
+ integer key, ad, tay, repint;
+           phrase st;
+
+  repint=trunc(rep);
+  hide_mouse();
+  deline( repint+c_paroles,st,tay);
+  afftex(st,230,4,65,24,5);
+  f3f8();
+  /*boite(43,30,90,19,15);
+  gotoxy(7,5);
+  write('F3: Encore');
+  gotoxy(7,6);
+  write('F8: Stop');*/
+  key= 0;
+  do {
+    parole(repint, haut[caff- 69], 0);
+    atf3f8(key);
+  } while (!(key== 66));
+  hirs();
+  show_mouse();
+}
+
+void finfouil()
+  {
+    fouil= false;
+    obpart= false;
+    cs= 0;
+    is= 0;
+    mfouen();
+  }
+
+void mfoudi()
+{
+ integer cx;
+
+ for( cx= 1; cx <= 7; cx ++) menu_disable( depl[cx]);
+ for( cx=1; cx <= 11; cx ++) menu_disable( men[cx]);
+/* menu_disable(menup, scacher);
+ menu_disable(menup, attacher);
+ menu_disable(menup, defoncer);
+ menu_disable(menup, dormir);
+ menu_disable(menup, entrer);
+ menu_disable(menup, fermer);
+ menu_disable(menup, frapper);
+ menu_disable(menup, manger);
+ menu_disable(menup, mettre);
+ menu_disable(menup, ouvrir);
+ menu_disable(menup, sortir);  */
+ menut( sonder, " -SUITE- ");
+ menut( soulever, " -STOP-  ");
+}
+
+void mennor()
+{
+ menu_up(msg[3]);
+}
+
+void premtet()
+{
+ dessine(ades, 10, 80);
+ boite(18, 79, 155, 91, 15);
+}
+
+/* NIVEAU 5 */
+void ajchai()
+{
+      integer cx,cy,lderobj;
+
+
+  cy= (acha+ pred(integer,pred(integer,mchai)* 10));
+  cx= 0;
+  do {
+   cx= cx+ 1;
+  } while (!((cx> 9) || (tabdon[cy+ cx]== 0)));
+  if (tabdon[cy+ cx]== 0) 
+    {
+      lderobj= s.derobj;
+      tabdon[cy+ cx]=lderobj;
+    }
+    else crep= 192;
+}
+
+void ajjer(integer ob)
+{
+ integer cx;
+
+ cx= 0;
+ do {
+  cx= cx+ 1;
+ } while (!((cx> 5) || (ord(s.sjer[cx])== 0)));
+ if (ord(s.sjer[cx])== 0) 
+ {
+  s.sjer[(cx)]= chr(ob);
+  modinv();
+ }
+ else crep= 139;
+}
+
+void t1sama()      /* On entre dans le manoir */
+{
+ integer j,h,m;
+ boolean d;
+
+ calch(j,h,m);
+ if ((h< 5) && (s.mlieu> 18)) 
+ {
+  cherjer(137,d);
+  if (! d)          /* On n'a pas les cl‚s et il est tard */
+  {
+    crep= 1511;
+    tperd();
+  }
+  else st1sama();
+ }
+ else
+ if (! s.ipre)          /* c'est votre premiŠre fois ? */
+ {
+  ipers= 255;
+  affper(ipers);
+  caff= 77;
+  afdes(0);
+  boite(223, 47, 155, 91, 15);
+  repon(2,33);
+  tkey1(false);
+  mennor();
+  hide_mouse();
+  hirs();
+  premtet();
+  sparl(0,140);
+  dessine_rouleau();
+  pendule();
+  show_mouse();
+  s.mlieu= 0;
+  affrep();
+  t5(10);
+  if (! blo)  t11(0, m);
+  ipers= 0;
+  mpers= 0;
+  s.ipre= true;
+  /*chech;*/
+ }
+ else  st1sama();
+}
+
+void t1vier()
+{
+ s.mlieu= 17;
+ affrep();
+}
+
+void t1neig()
+{
+ inei= inei+ 1;
+ if (inei> 2) 
+ {
+   crep= 1506;
+   tperd();
+ }
+ else
+ {
+   okdes= true;
+   s.mlieu= 19;
+   affrep();
+ }
+}
+
+void t1deva()
+{
+ inei= 0;
+ s.mlieu= 21;
+ affrep();
+}
+
+void t1derr()
+{
+ s.mlieu = 22;
+ affrep();
+}
+
+void t1deau()
+{
+ crep = 1503;
+ tperd();
+}
+
+void tctrm()
+{
+ repon(2,(3000+ ctrm));
+ ctrm= 0;
+}
+
+
+void quelquun()
+
+{
+ integer haz,cx;
+
+ if (imen)  erase_menu();
+ finfouil();
+ crep= 997;
+L1:
+ if (! cache) 
+ {
+  if (crep== 997)  crep= 138;
+  repon(2,crep);
+  if (crep== 138)  parole(5, 2, 1); else parole(4, 4, 1);
+  if (iouv== 0)  s.conf= s.conf+ 2; else
+   if (s.conf< 50)  s.conf= s.conf+ 4; else
+    s.conf= s.conf+ (3* (s.conf / 10));
+  tsort();
+  tmlieu(15);
+  tip(ipers,cx);
+  caff= 69+ cx;
+  crep= caff;
+  msg[3]= discut;
+  msg[4]= disc[cx];
+  syn= true;
+  col= true;
+ }
+ else
+ {
+  haz= hazard(1, 3);
+  if (haz== 2) 
+  {
+   cache= false;
+   crep= 137;
+   goto L1;
+  }
+  else
+  {
+   repon(2, 136);
+   haz= (hazard(0, 4))- 2;
+   parole(3, haz, 1);
+   clsf2();
+   person();
+   debloc(21);
+   affrep();
+  }
+ }
+ if (imen)  draw_menu();
+}
+
+void tsuiv()
+{
+ integer cx,tbcl;
+ integer cl,cy;
+
+ cy= acha+ ((mchai- 1)* 10)- 1;
+ cx= 0;
+ do {
+  cx= cx+ 1;
+  cs= cs+ 1;
+  cl= cy+ cs;
+  tbcl= tabdon[cl];
+ } while (!((tbcl != 0) || (cs> 9)));
+ if ((tbcl != 0) && (cs< 11)) 
+ {
+  is= is+ 1;
+  caff= tbcl;
+  crep= caff+ 400;
+  if (ipers!= 0)  s.conf= s.conf+ 2;
+ }
+ else
+ {
+  affrep();
+  finfouil();
+  if (cx> 9)  crep= 131;
+ }
+}
+
+void tfleche()
+{
+ boolean qust;
+ char touch;
+ integer dummy,cd,xmo,ymo;
+
+ if (num== 9999)  return;
+ fenat(chr(152));
+ rect= false;
+ do {
+  touch='\0';
+
+  do {
+   mov_mouse(qust,touch);
+   if (clic)  rect=(x_s<256*res) && (y_s<176) && (y_s>12);
+   tinke();
+  } while (!(qust || rect || anyone));
+
+  if (qust && (touch=='\103'))  dummy=do_alert(stpou,1);
+ } while (!((touch=='\73') || ((touch== '\104') && (x!= 0) && (y!=0)) ||
+       (anyone) || (rect)));
+ if (touch=='\73')  iesc= true;
+ if (rect) 
+   {
+     x=x_s;
+     y=y_s;
+   }
+}
+
+void tcoord(integer sx)
+
+   {
+         integer sy,ix,iy,cb,cy,ib;
+         integer a, b, atdon;
+
+
+     num= 0;
+     crep= 999;
+     a=0;
+     atdon=amzon+3;
+     cy= 0;
+     while (cy<caff) 
+        {
+          a=a+tabdon[atdon];
+          atdon=atdon+4;
+          cy= succ(integer,cy);
+        }
+/*     for cy:=0 to caff-1 do
+          a:=a+ tabdon[amzon+3+4*cy];
+     b:= peek(amzon+3+4*caff); */
+     b= tabdon[atdon];
+     if (b== 0)  goto L1;
+     a= a+ fleche;
+     cb= 0;
+     for( cy= 0; cy <= (sx-2); cy ++)
+      {
+        ib= (tabdon[a+cb] << 8)+ tabdon[succ(integer,a+ cb)];
+        cb= cb+ (ib* 4)+ 2;
+      }
+      ib= (tabdon[a+cb] << 8)+ tabdon[succ(integer,a+ cb)];
+      if (ib== 0)  goto L1;
+      cy= 1;
+      do {
+        cb= cb+ 2;
+        sx= tabdon[a+ cb] * res;
+        sy= tabdon[succ(integer,a+ cb)];
+        cb= cb+ 2;
+        ix= tabdon[a+ cb] * res;
+        iy= tabdon[succ(integer,a+ cb)];
+        cy= cy+ 1;
+      } while (!(((x>= sx) && (x<= ix) && (y>= sy) && (y<= iy))
+             || (cy> ib)));
+      if ((x>= sx) && (x<= ix) && (y>= sy) && (y<= iy))
+
+          {
+            num= cy- 1;
+            return;
+          }
+L1:
+     crep= 997;
+   }
+
+
+void st7(integer ob)
+{
+ crep= 183;
+ if ((ob== 116) || (ob== 144))  crep= 104;
+ if ((ob== 126) || (ob== 111))  crep= 108;
+ if (ob== 132)  crep= 111;
+ if (ob== 142)  crep= 112;
+ if (crep== 183)  st4(ob);
+}
+
+void treg(integer ob)
+{
+ integer mdes;
+
+ mdes= caff;
+ caff= ob;
+ if (((caff> 29) && (caff< 33)) || (caff== 144) ||
+    (caff== 147) || (caff== 149) || (msg[4]== sregarder)) 
+ {
+  afdes(0);
+  if ((caff> 29) && (caff< 33))  repon(2,caff); else repon(2,(caff+ 400));
+  tkey1(true);
+  caff= mdes;
+  msg[3]= 0;
+  crep= 998;
+ }
+ else
+ {
+  obpart= true;
+  crep= caff+ 400;
+  mfoudi();
+ }
+}
+
+void avpoing(integer& ob)
+{
+ crep= 999;
+ if (s.derobj!= 0)  ajjer(s.derobj);
+ if (crep!= 139) 
+ {
+  modobj(ob+ 400);
+  s.derobj= ob;
+  ob= 0;
+ }
+}
+
+void rechai(integer& ch)
+{
+ integer cx;
+
+ cx= s.mlieu;
+ if (s.mlieu== 16)  cx= 14;
+ ch= tabdon[achai+ (cx* 7)+ pred(integer,num)];
+}
+
+void t23coul(integer& l)
+{
+ boolean d;
+
+ cherjer(143,d);
+ l= 14;
+ if (! d) 
+ {
+  crep= 1512;
+  tperd();
+ }
+}
+
+void maivid()
+{
+ s.derobj= 0;
+ modobj(500);
+}
+
+void st13(integer ob)
+{
+ if ((ob== 114) || (ob== 116) || (ob== 126) || (ob== 132) ||
+ (ob== 111) || (ob== 106) || (ob== 102) || (ob== 100) ||
+ (ob== 110) || (ob== 153) || (ob== 154) || (ob== 155) ||
+ (ob== 156) || (ob== 157) || (ob== 144) || (ob== 158) ||
+ (ob== 150) || (ob== 152))  crep= 999; else crep= 105;
+}
+
+void aldepl()
+{
+      integer dummy;
+
+  dummy=do_alert("[1][Alors, utilisez le menu DEP...][ok]",1);
+}
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
new file mode 100644
index 0000000..1fbd91c
--- /dev/null
+++ b/engines/mortevielle/mort.cpp
@@ -0,0 +1,124 @@
+#include "ptoc.h"
+
+
+
+ /*$v-*/
+ /*$k-*/
+ /*$x-*/
+ /*$c-*/
+
+#include "var_mor.h"          /* les variables */
+#include "keyboard.h"          /* la gestion du clavier */
+#include "mouse.h"          /* la souris  */
+#include "level15.h"          /* les fonctions de base */
+#include "droite.h"          /* pour faire une droite */
+#include "boite.h"
+#include "sprint.h"          /* l'affichage des textes */
+#include "outtext.h"          /* fonctions sup‚rieures d'affichage */
+#include "parole.h"          /* les fonctions de la parole */
+#include "alert.h"
+#include "parole2.h"          /* les fonctions de la parole */
+ /*  debug              le debugging */
+#include "ques.h"          /* les questions */
+#include "menu.h"          /* les fonctions du menu */
+#include "mor.h"          /* divers */
+#include "taffich.h"          /* chargement des dessins */
+#include "ovd1.h"          /* les fonctions sur disque 1 */
+#include "mor2.h"          /* divers */
+#include "actions.h"          /* les actions */
+#include "prog.h"          /* fonctions toplevel */
+#include "disk.h"          /* chargements et sauvegardes */
+
+/*  ecrihexa            utilitaire */
+
+void divers(integer np,boolean b)
+{
+  teskbd();
+  do {
+    parole(np, 0, 0);
+    atf3f8(key);
+    if (newgd!=gd) 
+       {
+         gd=newgd;
+         hirs();
+         aff50(b);
+       }
+  } while (!(key== 66));
+}
+
+/* NIVEAU 0 */
+
+int main(int argc, const char* argv[])
+{
+/*init_debug;*/
+/*  ecri_seg;*/
+  pio_initialize(argc, argv);
+  gd=cga;
+  newgd= gd;
+  zuul= false;
+  tesok= false;
+  chartex();
+  charpal();
+  charge_cfiph();
+  charge_cfiec();
+  zzuul(adcfiec+161,0,1644);
+  c_zzz= 1;
+  init_nbrepm();
+  init_mouse();
+/*  crep:=memw[$7f00:0];
+  memw[$7f00:0]:= crep+1;
+  if (memw[$7f00:0]<> crep+1) then
+     begin
+       hirs;
+       show_mouse;
+       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
+       clrscr;
+       halt;
+     end;
+  if (Dseg+$1000>adbruit5) then
+     begin
+       hirs;
+       show_mouse;
+       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
+       clrscr;
+       halt;
+     end;*/
+  init_lieu();
+  arret= false;
+  sonoff= false;
+  f2_all= false;
+  textcolor(9);
+  teskbd();
+  dialpre();
+  newgd= gd;
+  teskbd();
+  if (newgd!=gd)  gd=newgd;
+  hirs();
+  ades= 0x7000;
+  aff50(false);
+  mlec= 0;
+  divers(142,false);
+
+  ani50();
+  divers(143,true);
+  suite();
+  music();
+  adzon();
+  takesav(0);
+  if (rech_cfiec)  charge_cfiec();
+  for( crep=1; crep <= c_zzz; crep ++) zzuul(adcfiec+161,0,1644);
+  charge_bruit5();
+  init_menu();
+
+  theure();
+  dprog();
+  hirs();
+  dessine_rouleau();
+  show_mouse();
+  do { tjouer(); } while (!arret);
+  hide_mouse();
+  clrscr;
+/*out_debug;*/
+  return EXIT_SUCCESS;
+}
+
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
new file mode 100644
index 0000000..3f250d9
--- /dev/null
+++ b/engines/mortevielle/mouse.h
@@ -0,0 +1,469 @@
+const integer m_arrow = 0;
+const integer m_point_hand = 1;
+
+boolean int_m,
+clic;
+
+integer m_show,
+x_s,
+y_s,
+p_o_s,
+mouse_shwn;
+
+matrix<0,5,0,11,integer> s_s;
+
+
+void init_mouse()
+{
+      integer i, j;
+       registres reg;
+
+  mouse_shwn= 0;
+  x_s= 0;
+  y_s= 0;
+  p_o_s= 0;
+  /*int_m:= False;*/
+  clic= false;
+  m_show= m_arrow;
+  if ((memw[0xcc]==0) && (memw[0xce]==0))  int_m= false;
+  if (int_m) 
+   {
+    reg.ax= 0;
+    intr(0x33,reg);
+    int_m= (reg.ax==-1);
+    if (int_m) 
+      {
+         {
+           reg.ax=4;
+           reg.cx=0;
+           reg.dx=0;
+         }
+       intr(0x33,reg);
+     }
+   }
+}
+
+/*procedure change_mouse( t : integer );
+begin
+  m_show:= t;
+end;*/
+
+/*procedure dessine_souris(xf,yf:integer);
+  var x, xx, y :integer;
+begin
+  case m_show of
+             m_arrow : begin
+                         affput(2,Gd,xf,yf,0,0);
+                       end;
+  end;
+end;  */
+
+void hide_mouse()
+{
+      integer i,j,k,ps,ds;
+      boolean imp;
+
+  mouse_shwn = pred(integer,mouse_shwn);
+  if (mouse_shwn==0) 
+     {
+       imp= odd(y_s);
+       j=p_o_s;
+       switch (gd) {
+             case cga : {
+                     k=0;
+                     j=((cardinal)y_s >> 1) * 80+ ((cardinal)x_s >> 2);
+                     do {
+                       memw[0xb000+j]=s_s[0][k];
+                       memw[0xb800+j+2]=s_s[1][k];
+                       memw[0xba00+j]=s_s[2][k];
+                       memw[0xba00+j+2]=s_s[3][k];
+                       j=j+80;
+                       k= succ(integer,k);
+                     } while (!(k>=5));
+                   }
+                   break;
+                case ams : {
+                        for( i=0; i <= 3; i ++)
+                        {
+                          port[0x3dd]= 1 << i;
+                          k=0;
+                          j=p_o_s;
+                          do {
+                            if (imp) 
+                              {
+                                memw[0xb800+j]=s_s[i][k];
+                                j=j+80-0x2000;
+                              }
+                             else
+                              {
+                                memw[0xb800+j]=s_s[i][k];
+                                j=j+0x2000;
+                              }
+                            imp=! imp;
+                            k= succ(integer,k);
+                          } while (!(k>=8));
+                        }
+                      }
+                      break;
+                case ega : {
+                        port[0x3c4]=2;
+                        port[0x3ce]=8;
+                        port[0x3cf]=255;
+                        i= 0;
+                        do {
+                          port[0x3c5]= 1 << i;
+                          k=0;
+                          j=p_o_s;
+                          do {
+                            ps=mem[0xa000+j];
+                            mem[0xa000+j]=lo(s_s[i][k]);
+                            ps=mem[0xa000+j+1];
+                            mem[0xa000+j+1]=hi(s_s[i][k]);
+                            j=j+80;
+                            k= succ(integer,k);
+                          } while (!(k>=8));
+                          i= i+1;
+                        } while (!(i==4));
+                      }
+                      break;
+                case her : {
+                        j= ((cardinal)y_s >> 1) *80+((cardinal)x_s >> 3);
+                        for( i=0; i <= 5; i ++)
+                         {
+                           for( k=0; k <= 3; k ++) memw[0xb000+k*0x200+j]=s_s[i][k];
+                           j=j+80;
+                         }
+                      }
+                      break;
+                case tan : {
+                        j= ((cardinal)y_s >> 2) *160+((cardinal)x_s >> 1);
+                        k=0;
+                        do {
+                          for( i=0; i <= 3; i ++)
+                           {
+                             memw[0xb800+0x200*i+j]=s_s[k][i+(k << 2)];
+                             memw[0xb800+0x200*i+j+2]=s_s[k+3][i+(k << 2)];
+                           }
+                          j=j+160;
+                          k= succ(integer,k);
+                        } while (!(k==3));
+                      }
+                      break;
+
+       }     /* case Gd */
+     }
+}
+
+void show_mouse()
+{
+      integer i, j, k, l,
+      ps,ds;
+      boolean imp;
+      char c;
+
+  mouse_shwn = mouse_shwn +1;
+  if (mouse_shwn!=1)  return;
+  j=p_o_s;
+  imp= odd(y_s);
+  i=x_s & 7;
+  switch (gd) {
+             case cga : {
+                     k=0;
+                     j=((cardinal)y_s >> 1) * 80+ ((cardinal)x_s >> 2);
+                     do {
+                       s_s[0][k]=memw[0xb800+j];
+                       s_s[1][k]=memw[0xb800+j+2];
+                       s_s[2][k]=memw[0xba00+j];
+                       s_s[3][k]=memw[0xba00+j+2];
+                       j=j+80;
+                       k= succ(integer,k);
+                     } while (!(k>=5));
+                   }
+                   break;
+          case ams : {
+                  for( i=0; i <= 3; i ++)
+                        {
+                          j=p_o_s;
+                          imp= odd(y_s);
+                          port[0x3de]= i;
+                          k=0;
+                          do {
+                            if (imp) 
+                              {
+                                s_s[i][k]=memw[0xb800+j];
+                                j=j+80-0x2000;
+                              }
+                             else
+                              {
+                                s_s[i][k]=memw[0xb800+j];
+                                j=j+0x2000;
+                              }
+                            imp=! imp;
+                            k= succ(integer,k);
+                          } while (!(k>=8));
+                        }
+                }
+                break;
+          case ega : {
+                  port[0x3ce]=4;
+                  l= 0;
+                  do {
+                    port[0x3cf]= l;
+                    k=0;
+                    j=p_o_s;
+                    do {
+                      s_s[l][k]= mem[0xa000+j]+(mem[0xa000+succ(integer,j)] << 8);
+                      j=j+80;
+                      k= succ(integer,k);
+                    } while (!(k>=8));
+                    l= l+1;
+                  } while (!(l==4));
+                }
+                break;
+          case her : {
+                  j= ((cardinal)y_s >> 1) *80+((cardinal)x_s >> 3);
+                  for( i=0; i <= 5; i ++)
+                   {
+                     for( k=0; k <= 3; k ++) s_s[i][k]=memw[0xb000+k*0x200+j];
+                     j=j+80;
+                   }
+                }
+                break;
+          case tan : {
+                  j= ((cardinal)y_s >> 2)*160+((cardinal)x_s >> 1);
+                  k=0;
+                  do {
+                    for( i=0; i <= 3; i ++)
+                      {
+                        s_s[k][i+(k << 2)]=memw[0xb800+0x200*i+j];
+                        s_s[k+3][i+(k << 2)]=memw[0xb800+0x200*i+j+2];
+                      }
+                    j=j+160;
+                    k= succ(integer,k);
+                  } while (!(k==3));
+                }
+                break;
+  }    /*  case Gd   */
+  affput(2,gd,x_s,y_s,0,0);
+}
+
+void pos_mouse(integer x,integer y)
+{
+      registres reg;
+
+  if (x>314*res)  x=314*res;
+           else if (x<0)  x=0;
+  if (y>199)  y=199;
+           else if (y<0)  y=0;
+  if ((x==x_s) && (y==y_s))  return;
+  if (int_m) 
+     {
+         {
+           reg.ax=4;
+           reg.cx=x;
+           reg.dx=y;
+         }
+       intr(0x33,reg);
+     }
+  hide_mouse();
+  x_s=x;
+  y_s=y;
+  switch (gd) {
+          case ams : {
+                  p_o_s=((cardinal)y_s >> 1)*80+((cardinal)x_s >> 3)+(y_s & 1)*0x2000;
+                }
+                break;
+          /*cga : begin
+                  P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
+                end;*/
+          case ega : {
+                  p_o_s=y_s*80+((cardinal)x_s >> 3);
+                }
+                break;
+  }    /*  case Gd   */
+  show_mouse();
+}
+
+void read_pos_mouse(integer& x,integer& y,integer& c)
+{
+       registres reg;
+
+  if (int_m) 
+     {
+       reg.ax=3;
+       intr(0x33,reg);
+       x=reg.cx;
+       y=reg.dx;
+       c=reg.bx;
+     }
+    else
+     {
+       c=0;
+       x=x_s;
+       y=y_s;
+     }
+}
+
+void mov_mouse(boolean& funct, char& key)
+   {
+         boolean p_key;
+         char in1, in2;
+         integer x,y,cx,cy,cd;
+         registres reg;
+
+     if (int_m) 
+     {
+       reg.ax=3;
+       intr(0x33,reg);
+       x=reg.cx;
+       y=reg.dx;
+       cd=reg.bx;
+       pos_mouse(x,y);
+       if (cd!=0) 
+          {
+            clic=true;
+            return;
+          }
+     }
+     funct=false;
+     key='\377';
+     p_key=keypressed();
+     while (p_key) 
+        {
+          input >> kbd >> in1;
+          read_pos_mouse(cx, cy, cd);
+          switch (upcase(in1)) {
+                         case '4' : cx= cx - 8; break;
+                         case '2' : cy= cy + 8; break;
+                         case '6' : cx= cx + 8; break;
+                         case '8' : cy= cy - 8; break;
+                         case '7' : {
+                                 cy=1;
+                                 cx=1;
+                               }
+                               break;
+                         case '1' : {
+                                 cx=1;
+                                 cy=190;
+                               }
+                               break;
+                         case '9' : {
+                                 cx=315*res;
+                                 cy=1;
+                               }
+                               break;
+                         case '3' : {
+                                 cy=190;
+                                 cx=315*res;
+                               }
+                               break;
+                         case '5' : {
+                                 cy=100;
+                                 cx=155*res;
+                               }
+                               break;
+                    case ' ': case '\15' : {
+                                 clic=true;
+                                 return;
+                               }
+                               break;
+                         case '\33' : {
+                                 p_key=keypressed();
+                                 if (p_key) 
+                                    {
+                                      input >> kbd >> in2;
+                                      switch (in2) {
+                                               case 'K' : cx= pred(integer,cx); break;
+                                               case 'P' : cy= succ(integer,cy); break;
+                                               case 'M' : cx= cx + 2; break;
+                                               case 'H' : cy= pred(integer,cy); break;
+                                               case RANGE_10(';','D') : {
+                                                            funct= true;
+                                                            key=in2;
+                                                            return;
+                                                          }
+                                                          break;
+                                               case 'G' : {
+                                                       cx=cx-1;
+                                                       cy=cy-1;
+                                                     }
+                                                     break;
+                                               case 'I' : {
+                                                       cx=cx+1;
+                                                       cy=cy-1;
+                                                     }
+                                                     break;
+                                               case 'O' : {
+                                                       cx=cx-1;
+                                                       cy=cy+1;
+                                                     }
+                                                     break;
+                                               case 'Q' : {
+                                                       cx=cx+1;
+                                                       cy=cy+1;
+                                                     }
+                                                     break;
+                                            }    /* case */
+                                    }
+                               }
+                               break;
+                         case 'I' : {
+                                 cx= res*32;
+                                 cy= 8;
+                               }
+                               break;
+                         case 'D' : {
+                                 cx= 80*res;
+                                 cy= 8;
+                               }
+                               break;
+                         case 'A' : {
+                                 cx= 126*res;
+                                 cy= 8;
+                               }
+                               break;
+                         case 'S' : {
+                                 cx= 174*res;
+                                 cy= 8;
+                               }
+                               break;
+                         case 'P' : {
+                                 cx= 222*res;
+                                 cy= 8;
+                               }
+                               break;
+                         case 'F' : {
+                                 cx= res*270;
+                                 cy= 8;
+                               }
+                               break;
+                         case '\23' : {
+                                 sonoff= ! sonoff;
+                                 return;
+                               }
+                               break;
+                         case '\26' : {
+                                 zuul=true;
+                                 return;
+                               }
+                               break;
+                         case '\24' : {           /* ^T => mode tandy */
+                                 funct= true;
+                                 key= '\11';
+                               }
+                               break;
+                          case '\10' : {           /* ^H => mode Hercule */
+                                 funct= true;
+                                 key= '\7';
+                               }
+                               break;
+                    case '\1':case '\3':case '\5' : {
+                                 funct= true;
+                                 key=in1;
+                               }
+                               break;
+                }
+          pos_mouse(cx, cy);
+          p_key=keypressed();
+        }
+   }
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
new file mode 100644
index 0000000..5bd4fd2
--- /dev/null
+++ b/engines/mortevielle/outtext.h
@@ -0,0 +1,205 @@
+str255 delig;
+const array<0,31,byte> tabdr
+      = {{  32, 101, 115,  97, 114, 105, 110,
+          117, 116, 111, 108,  13, 100,  99,
+          112, 109,  46, 118, 130,  39, 102,
+           98,  44, 113, 104, 103,  33,  76,
+           85, 106,  30,  31 }};
+
+
+const array<0,31,byte> tab30
+      = {{   69,  67,  74, 138, 133, 120,  77, 122,
+          121,  68,  65,  63,  73,  80,  83,  82,
+          156,  45,  58,  79,  49,  86,  78,  84,
+           71,  81,  64,  66, 135,  34, 136,  91 }};
+
+
+
+const array<0,31,byte> tab31
+      = {{  93,  47,  48,  53,  50,  70, 124,  75,
+           72, 147, 140, 150, 151,  57,  56,  51,
+          107, 139,  55,  89, 131,  37,  54,  88,
+          119,   0,   0,   0,   0,   0,   0,   0 }};
+
+void deline( integer num , phrase& l , integer& tl );
+
+static void cinq_huit( char& c, integer& ind, byte& pt, boolean& the_end)
+   {
+           const array<0,31,char> rap
+         = {{ ',', ':', '@', '!', '?', '-', '‡',
+            ' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
+            '‹', 'Œ', '¢', '\47', '“', '"', '—',
+            '–', '0', '1', '2', '3', '4', '5',
+            '6', '7', '8', '9'}};
+         integer oct,ocd;
+
+            /* 5-8 */
+     oct=t_mot[ind];
+     oct=(cardinal)(oct << (16-pt)) >> (16-pt);
+     if (pt<6) 
+        {
+          ind=ind+1;
+          oct=oct << (5-pt);
+          pt=pt+11;
+          oct=oct | ((cardinal)t_mot[ind] >> pt);
+        }
+      else
+        {
+          pt=pt-5;
+          oct=(cardinal)oct >> pt;
+        }
+
+     switch (oct) {
+                  case 11 : {
+                         c= '$';
+                         the_end= true;
+                       }
+                       break;
+               case 30:case 31 : {
+                         ocd=t_mot[ind];
+                         ocd=(cardinal)(ocd << (16-pt)) >> (16-pt);
+                         if (pt<6) 
+                            {
+                              ind=ind+1;
+                              ocd=ocd << (5-pt);
+                              pt=pt+11;
+                              ocd=ocd | ((cardinal)t_mot[ind] >> pt);
+                            }
+                          else
+                            {
+                              pt=pt-5;
+                              ocd=(cardinal)ocd >> pt;
+                            }
+                          if (oct==30)  c=chr(tab30[ocd]);
+                                    else c=chr(tab31[ocd]);
+                          if (c=='\0') 
+                             {
+                               the_end=true;
+                               c='#';
+                             }
+                        }
+                        break;
+              default: c=chr(tabdr[oct]);
+            }
+   }              /* 5-8 */
+
+void deline( integer num , phrase& l , integer& tl )
+      {
+            integer i,j,ts;
+            char let;
+             byte ps, k;
+            boolean the_end;
+
+              /* DETEX */
+        /*debug('  => DeLine');*/
+        delig="";
+        ts= t_rec[num].indis;
+        ps= t_rec[num].point;
+        i=ts;
+        tl=1;
+        j=1;
+        k=ps;
+        the_end=false;
+        do {
+          cinq_huit(let,i,k, the_end);
+          l[j]=let;
+          if (j<254)  delig=delig+let;
+          j=j+1;
+        } while  (!the_end);
+        tl=j-1;
+        if (tl<255)  delig=copy(delig,1,tl-1);       /* enleve le $ */
+      }       /* DETEX */
+
+
+void afftex( phrase ch, integer x,integer y,integer dx,integer dy, integer typ);
+
+
+static integer l_motsuiv(integer p, phrase& ch, integer& tab)
+  {
+        integer c;
+
+    integer l_motsuiv_result;
+    c=p;
+    while (! (set::of(' ','$','@', eos).has(ch[p])))  p=p+1;
+    l_motsuiv_result=tab*(p-c);
+    return l_motsuiv_result;
+  }
+
+void afftex( phrase ch, integer x,integer y,integer dx,integer dy, integer typ)
+  {
+        boolean the_end;
+        char touch;
+        integer xf,yf;
+        integer xc,yc;
+        integer tab, p;
+        varying_string<255> s;
+        integer i,j,nt;
+
+
+/*    debug('  .. Afftex');*/
+    putxy(x,y);
+    if (res==1)  tab=10; else tab=6;
+    dx= dx * 6;
+    dy= dy * 6;
+    xc= x;
+    yc= y;
+    xf= x+dx;
+    yf= y+dy;
+    p= 1;
+    the_end=(ch[p]=='$');
+    s="";
+    while (! the_end) 
+     {
+      switch (ch[p]) {
+                  case '@' : {
+                          writeg(s,typ);
+                          s="";
+                          p=p+1;
+                          xc=x;
+                          yc=yc+6;
+                          putxy(xc,yc);
+                        }
+                        break;
+                  case ' ' : {
+                          s=s+' ';
+                          xc=xc+tab;
+                          p=p+1;
+                          if (l_motsuiv(p, ch, tab)+xc > xf) 
+                             {
+                               writeg(s,typ);
+                               s="";
+                               xc=x;
+                               yc=yc+6;
+                               if (yc>yf) 
+                                  {
+                                    do {; } while (!keypressed());
+                                    i=y;
+                                    do {
+                                      j=x;
+                                      do {
+                                        putxy(j,i);
+                                        writeg(" ",0);
+                                        j=j+6;
+                                      } while (!(j>xf));
+                                      i=i+6;
+                                    } while (!(i>yf));
+                                    yc=y;
+                                  }
+                               putxy(xc,yc);
+                             }
+                        }
+                        break;
+                  case '$' : {
+                          the_end= true;
+                          writeg(s,typ);
+                        }
+                        break;
+        default:
+        {
+          s=s+ch[p];
+          p=p+1;
+          xc=xc+tab;
+        }
+      }     /* case */
+    }
+  }
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
new file mode 100644
index 0000000..b2f5f79
--- /dev/null
+++ b/engines/mortevielle/ovd1.h
@@ -0,0 +1,347 @@
+void dem2()
+{
+      untyped_file f;
+      integer k;
+
+  /* -- demande de disk 2 -- */
+  while (ioresult!=0);
+  assign(f,"mort.001");
+  /*$i-*/
+  reset(f);
+  while (ioresult!=0) 
+   {
+     show_mouse();
+     k= do_alert(al_mess2,1);
+     hide_mouse();
+     reset(f);
+   }
+  close(f);
+}
+
+void ani50()
+  {
+    crep= animof(1,1);
+    pictout(adani,crep,63,12);
+    crep= animof(2,1);
+    pictout(adani,crep,63,12);
+    f2_all= (res==1);
+    repon(2, c_paroles+143);
+  }
+
+/*overlay procedure apzuul;
+  begin
+    if (c_zzz=1) or (c_zzz=2) then
+     begin
+       zzuul(adcfiec+161,0,1644);
+       c_zzz:=succ(c_zzz);
+     end;
+  end;*/
+
+/* overlay */ void aff50(boolean c)
+  {
+        integer k;
+
+    caff= 50;
+    maff=0;
+    taffich();
+    dessine(ades,63,12);
+    if (c)  ani50();
+         else repon(2, c_paroles+142);
+    f3f8();
+  }
+
+/* overlay */ void init_menu()
+  {
+        integer i, j, tai;
+        phrase st;
+        untyped_file f;
+
+    assign(f,"menufr.mor");
+    /*$i-*/
+    reset(f,144);
+    blockread(f,lettres,1);
+    close(f);
+    /* ----  Demande de changement de disquette  ---- */
+    dem2();
+
+
+    for( i= 1; i <= 8; i ++)
+       inv[i]= "*                     ";
+    inv[7]= "< -*-*-*-*-*-*-*-*-*- ";
+    for( i= 1; i <= 7; i ++)
+       dep[i]= "*                       ";
+    i= 1;
+    do {
+      deline(i+c_action,st,tai);
+      act[i]= delig + "          ";
+      if (i<9) 
+         {
+           if (i<6) 
+              {
+                deline(i+c_saction,st,tai);
+                self_[i]= delig + "       ";
+              }
+           deline(i+c_dis,st,tai);
+           dis[i]= delig+ ' ';
+         }
+      i= succ(integer,i);
+    } while (!(i== 22));
+    for( i= 1; i <= 8; i ++)
+      {
+       disc[i]=0x500+i;
+       if (i<8)  depl[i]=0x200+i;
+       invt[i]=0x100+i;
+       if (i>6)  menu_disable(invt[i]);
+      }
+    msg3=no_choice;
+    msg4=no_choice;
+    msg[3]=no_choice;
+    msg[4]=no_choice;
+    clic=false;
+  }
+
+
+/* overlay */ void charpal()
+{
+       file<tabdb> f;
+       file<tfxx> ft;
+       integer i,j,k;
+       file<byte> fb;
+       byte b;
+
+  assign(ft,"fxx.mor");
+  /*$i-*/
+  reset(ft);
+  if (ioresult!=0) 
+           {
+             caff=do_alert(err_mess,1);
+             exit(0);
+           }
+  ft >> l;
+  close(ft);
+  assign(f,"plxx.mor");
+  reset(f);
+  for( i= 0; i <= 90; i ++) f >> tabpal[i];
+  close(f);
+  assign(fb,  "cxx.mor");
+  reset(fb);
+  for( j=0; j <= 90; j ++)
+    {
+      fb >> palcga[j].p;
+      for( i=0; i <= 15; i ++)
+        {
+            nhom& with = palcga[j].a[i]; 
+
+            fb >> b;
+            with.n=(cardinal)b >> 4;
+            with.hom[0]= ((cardinal)b >> 2) & 3;
+            with.hom[1]= b & 3;
+        }
+    }
+  palcga[10].a[9]= palcga[10].a[5];
+  for( j=0; j <= 14; j ++)
+    {
+      fb >> tpt[j].tax;
+      fb >> tpt[j].tay;
+      for( i=1; i <= 20; i ++)
+        for( k=1; k <= 20; k ++)
+          fb >> tpt[j].des[i][k];
+    }
+  close(fb);
+}
+
+/* overlay */ void chartex()
+{
+      integer i;
+      untyped_file fibyte;
+      phrase s;
+
+/* debug('o3 chartex'); */
+  i=0;
+  assign(fibyte,"TXX.INP");
+  /*$i-*/
+  reset(fibyte);
+  blockread(fibyte,t_mot,125);
+  close(fibyte);
+  assign(sauv_t,"TXX.NTP");
+  reset(sauv_t);
+  do {
+    sauv_t >> t_rec[i];
+    i=i+1;
+  } while (!(eof(sauv_t)));
+  close(sauv_t);
+  deline(578,s,i);
+  al_mess= delig;
+  deline(579,s,i);
+  err_mess= delig;
+  deline(580,s,i);
+  ind_mess= delig;
+  deline(581,s,i);
+  al_mess2= delig;
+}
+
+/* overlay */ void dialpre()
+
+{
+ integer cy, tay;
+ phrase st;
+ real ix;
+ char ch;
+
+
+ /* debug('o3 dialpre'); */
+ cy=0;
+ clrscr;
+ textcolor(9);
+ do {
+   cy= cy+1;
+   deline( cy+c_dialpre,st,tay);
+   gotoxy(40-tay / 2,wherey+1);
+   output << delig;
+ } while (!(cy==20));
+ ix=0;
+ do {
+   ix= ix+1;
+ } while (!(keypressed() | (ix==5e5)));
+ crep= 998;
+ textcolor(1);
+ gotoxy(1,21); clreol;
+ gotoxy(1,23);
+ output << "CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512";
+ gotoxy(12,24);
+ output << "Ctrl       C      E            H             T           A";
+ do {
+   input >> kbd >> ch;
+ } while (!(set::of('\1','\3','\5','\24','\10', eos).has(ch)));
+ switch (ch) {
+      case '\1':case '\3':case '\5' : gd= (cardinal)ord(ch) >> 1; break;
+            case '\10' : gd= her; break;
+           case '\24' : gd= tan; break;
+ }
+ gotoxy(1,24);
+ clreol;
+ gotoxy(1,23);
+ clreol;
+ gotoxy(26,23);
+ output << "Jeu au Clavier / … la Souris";
+ textcolor(4);
+ gotoxy(33,23); output << 'C';
+ gotoxy(48,23); output << 'S';
+ do {
+   input >> kbd >> ch;
+ } while (!(set::of('C','S', eos).has(upcase(ch))));
+ int_m= (upcase(ch)=='S');
+}
+
+/* overlay */ void init_lieu()
+{
+   file<tab_mlieu> f_lieu;
+
+/* debug('o3 init_lieu'); */
+  assign(f_lieu,"MXX.mor");
+  /*$i-*/
+  reset(f_lieu);
+  f_lieu >> v_lieu;
+  close(f_lieu);
+}
+
+
+/* overlay */ void music()
+{
+       untyped_file fic;
+         integer k;
+       boolean fin;
+        char ch;
+        real x,y;
+
+
+  /* debug('o3 music'); */
+  if (sonoff)  return;
+  rech_cfiec= true;
+  assign(fic,"mort.img");
+  /*$i-*/
+  reset(fic);
+  blockread(fic,mem[0x3800+0],500);
+  blockread(fic,mem[0x47a0+0],123);
+  close(fic);
+  demus(0x3800,0x5000,623);
+  addfix= (real)((tempo_mus-addv[1]))/256;
+  cctable(tbi);
+
+  fin=false;
+  k=0;
+  do {
+    fin= keypressed();
+    musyc( tbi, 9958 , tempo_mus);
+    k= k+1;
+    fin= fin | keypressed() | (k>=5);
+  } while (!fin);
+  while (keypressed())  input >> kbd >> ch;
+}
+
+
+/* overlay */ void charge_bruit5()
+   {
+         untyped_file f;
+
+     assign(f,"bruit5");
+     /*$i-*/
+     reset(f);
+     if (ioresult!=0) 
+     {
+       caff=do_alert(err_mess,1);
+       exit(0);
+     }
+     blockread(f,mem[adbruit5+0],149);
+     /*blockread(f,mem[$5CB0:0],100);
+     blockread(f,mem[$3D1F:0],49);*/
+     close(f);
+   }
+
+/* overlay */ void charge_cfiec()
+      {
+            untyped_file f;
+
+        assign(f,"cfiec.mor");
+       /*$i-*/
+        reset(f);
+        blockread(f,mem[adcfiec+0],511);
+        blockread(f,mem[adcfiec+4088+0],311);
+        close(f);
+        rech_cfiec= false;
+      }
+
+
+/* overlay */ void charge_cfiph()
+      {
+            untyped_file f;
+
+        assign(f,"cfiph.mor");
+        /*$i-*/
+        reset(f,256);
+        blockread(f,t_cph,50);
+        close(f);
+      }
+
+
+/* overlay */ void suite()
+{
+      varying_string<25> cpr;
+
+  hirs();
+  repon(7,2035);
+  caff= 51;
+  taffich();
+  teskbd();
+  if (newgd!=gd)  gd=newgd;
+  hirs();
+  dessine(ades,0,0);
+  gotoxy(20*pred(integer,res)+8,24);
+  textcolor(7);
+  cpr="COPYRIGHT 1989 : LANKHOR";
+  if (set::of(ega,ams,cga, eos).has(gd))  output << cpr;
+             else {
+                    putxy(104+72*res,190);
+                    writeg(cpr,0);
+                  }
+}
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
new file mode 100644
index 0000000..0630c9b
--- /dev/null
+++ b/engines/mortevielle/parole.h
@@ -0,0 +1,432 @@
+
+   void spfrac(integer wor)
+     {
+       c3.rep= (cardinal)wor >> 12;
+       if ((typlec==0) && (c3.code!=9)) 
+          if (((c3.code>4) && (c3.val!=20) && ! (set::of(3,6,9, eos).has(c3.rep))) ||
+             ((c3.code<5) && ! (set::of(19,22, eos).has(c3.val)) && ! (set::of(4,9, eos).has(c3.rep)))) 
+             c3.rep= c3.rep + 1;
+       c3.freq= ((cardinal)wor >> 6) & 7;
+       c3.acc= ((cardinal)wor >> 9) & 7;
+     }
+
+   void charg_car()
+     {
+           integer wor, int_;
+
+       wor= swap(memw[adword+ptr_word]);
+       int_= wor & 0x3f;
+       switch (int_) {
+                  case 60 : {
+                         c3.val= 32;   /*  " "  */
+                         c3.code= 9;
+                       }
+                       break;
+                  case 61 : {
+                         c3.val= 46;   /*  "."  */
+                         c3.code= 9;
+                       }
+                       break;
+                  case 62 : {
+                         c3.val= 35;   /*  "#"  */
+                         c3.code= 9;
+                       }
+                       break;
+              case RANGE_26(22,47) : {
+                         int_= int_-22;
+                         c3.val= int_;
+                         c3.code= typcon[int_];
+                       }
+                       break;
+              case RANGE_9(48,56) : {
+                         c3.val= int_-22;
+                         c3.code= 4;
+                       }
+                       break;
+              case RANGE_8(14,21) : {
+                         c3.val= int_;
+                         c3.code= 6;
+                       }
+                       break;
+               case RANGE_14(0,13) : {
+                         c3.val= int_;
+                         c3.code= 5;
+                       }
+                       break;
+       }
+       spfrac(wor);
+       ptr_word= ptr_word+2;
+     }
+
+
+   void entroct( byte o)
+     {
+       mem[adtroct+ptr_oct]= o;
+       ptr_oct= ptr_oct+1;
+     }
+
+   void veracf(byte b)
+     {;
+     }
+
+/* overlay */ void cctable (tablint& t)
+   {
+      integer k;
+      array<0,256,real> tb;
+
+
+     tb[0]=0;
+     for( k=0; k <= 255; k ++)
+     {
+       tb[k+1]= addfix + tb[k];
+       t[255-k]=trunc(tb[k])+1;
+     }
+   }
+
+/* overlay */ void regenbruit()
+      {
+            integer i,j;
+
+        i= offsetb3+8590;
+        j= 0;
+        do {
+          t_cph[j]=memw[adbruit3+i];
+          i= i+2;
+          j= j+1;
+        } while (!(i>= offsetb3+8790));
+      }
+
+/* overlay */   void charge_son()
+      {
+            untyped_file f;
+
+        assign(f,"sonmus.mor");
+        reset(f);
+        blockread(f,mem[0x7414+0],273);
+        /*blockread(f,mem[adson+0],300);
+        blockread(f,mem[adson+2400+0],245);*/
+        demus(0x7414,adson,273);
+        close(f);
+      }
+
+/* overlay */   void charge_phbruit()
+      {
+            untyped_file f;
+
+        assign(f,"phbrui.mor");
+        reset(f);
+        blockread(f,t_cph,3);
+        close(f);
+      }
+
+/* overlay */   void charge_bruit()
+      {
+            untyped_file f;
+            integer j,i;
+
+        assign(f,"bruits");
+        reset(f);
+        blockread(f,mem[adbruit+0],250);
+        for( i=0; i <= 19013; i ++) mem[adbruit+32000+i]= mem[adbruit5+i];
+        blockread(f,mem[adbruit1+offsetb1],149);
+        close(f);
+      }
+
+/* overlay */   void trait_car()
+     {
+              byte d3;
+           integer d2, i;
+
+       switch (c2.code) {
+                    case 9 : if (c2.val!=ord('#'))  for( i=0; i <= c2.rep; i ++) entroct(c2.val); break;
+
+                  case 5:case 6 : {
+                          if (c2.code==6)  d3= tabdph[(c2.val - 14) << 1];
+                                       else d3= null;
+                          if (c1.code>=5) 
+                             {
+                               veracf(c2.acc);
+                               if (c1.code==9) 
+                                  {
+                                    entroct(4);
+                                    if (d3==null)  entroct(c2.val);
+                                               else entroct(d3);
+                                    entroct(22);
+                                  }
+                             }
+                          switch (c2.rep) {
+                                        case 0 : {
+                                              entroct(0);
+                                              entroct(c2.val);
+                                              if (d3==null)  if (c3.code==9)  entroct(2);
+                                                                           else entroct(4);
+                                                         else if (c3.code==9)  entroct(0);
+                                                                           else entroct(1);
+                                            }
+                                            break;
+                                    case 4:case 5:case 6 : {
+                                              if (c2.rep!=4) 
+                                                 {
+                                                   i= c2.rep-5;
+                                                   do {
+                                                     i= i-1;
+                                                     entroct(0);
+                                                     if (d3==null)  entroct(c2.val);
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   } while (!(i<0));
+                                                 }
+                                              if (d3==null) 
+                                                 {
+                                                   entroct(4);
+                                                   entroct(c2.val);
+                                                   entroct(0);
+                                                 }
+                                                else
+                                                 {
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(3);
+                                                 }
+                                            }
+                                            break;
+                                    case 7:case 8:case 9 : {
+                                              if (c2.rep!=7) 
+                                                 {
+                                                   i= c2.rep-8;
+                                                   do {
+                                                     i= i-1;
+                                                     entroct(0);
+                                                     if (d3==null)  entroct(c2.val);
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   } while (!(i<0));
+                                                 }
+                                              if (d3==null) 
+                                                 {
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(2);
+                                                 }
+                                                else
+                                                 {
+                                                   entroct(0);
+                                                   entroct(c2.val);
+                                                   entroct(0);
+                                                 }
+                                            }
+                                            break;
+                                    case 1:case 2:case 3 : {
+                                              if (c2.rep!=1) 
+                                                 {
+                                                   i= c2.rep-2;
+                                                   do {
+                                                     i= i-1;
+                                                     entroct(0);
+                                                     if (d3==null)  entroct(c2.val);
+                                                                else entroct(d3);
+                                                     entroct(3);
+                                                   } while (!(i<0));
+                                                 }
+                                              entroct(0);
+                                              entroct(c2.val);
+                                              if (c3.code==9)  entroct(0);
+                                                           else entroct(1);
+                                            }
+                                            break;
+                          }     /*  case  c2.rep  */
+                        }
+                        break;
+
+                  case 2:case 3 : {
+                          d3= c2.code+5;   /*  7 ou 8  => voyelle correspondante  */
+                          if (c1.code>4) 
+                             {
+                               veracf(c2.acc);
+                               if (c1.code==9) 
+                                  {
+                                    entroct(4);
+                                    entroct(d3);
+                                    entroct(22);
+                                  }
+                             }
+                          i=c2.rep;
+                          if (i!=0) 
+                             {
+                               do {
+                                 i=i-1;
+                                 entroct(0);
+                                 entroct(d3);
+                                 entroct(3);
+                               } while (!(i<=0));
+                             }
+                          veracf(c3.acc);
+                          if (c3.code==6) 
+                             {
+                               entroct(4);
+                               entroct(tabdph[(c3.val-14) << 1]);
+                               entroct(c2.val);
+                             }
+                            else
+                             {
+                               entroct(4);
+                               if (c3.val==4)  entroct(3);
+                                           else entroct(c3.val);
+                               entroct(c2.val);
+                             }
+                        }
+                        break;
+                  case 0:case 1 : {
+                          veracf(c2.acc);
+                          switch (c3.code) {
+                                       case 2 : d2= 7; break;
+                                       case 3 : d2= 8; break;
+                                       case 6 : d2= tabdph[(c3.val-14) << 1]; break;
+                                       case 5 : d2= c3.val; break;
+                                      default: d2=10;
+                          }       /*  case  c3.code  */
+                          d2= d2 *26 + c2.val;
+                          if (tnocon[d2]==0)  d3=2;
+                                          else d3=6;
+                          if (c2.rep>=5) 
+                             {
+                               c2.rep=c2.rep-5;
+                               d3= 8-d3;          /*  echange 2 et 6  */
+                             }
+                          if (c2.code==0) 
+                             {
+                               i=c2.rep;
+                               if (i!=0) 
+                                  {
+                                    do {
+                                      i=i-1;
+                                      entroct(d3);
+                                      entroct(c2.val);
+                                      entroct(3);
+                                    } while (!(i<=0));
+                                  }
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(4);
+                             }
+                            else
+                             {
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(3);
+                               i=c2.rep;
+                               if (i!=0) 
+                                  {
+                                    do {
+                                      i=i-1;
+                                      entroct(d3);
+                                      entroct(c2.val);
+                                      entroct(4);
+                                    } while (!(i<=0));
+                                  }
+                             }
+                          if (c3.code==9) 
+                             {
+                               entroct(d3);
+                               entroct(c2.val);
+                               entroct(5);
+                             }
+                            else
+                             if (! (set::of(range(0,1),4, eos).has(c3.code))) 
+                                {
+                                  veracf(c3.acc);
+                                  switch (c3.code) {
+                                                 case 3 : d2= 8; break;
+                                                 case 6 : d2= tabdph[(c3.val-14) << 1]; break;
+                                                 case 5 : d2= c3.val; break;
+                                                default: d2= 7;
+                                  }     /*  case c3.code  */
+                                  if (d2==4)  d2=3;
+                                  if (intcon[c2.val]!=0)  c2.val= c2.val+1;
+                                  if ((c2.val==17) || (c2.val==18))  c2.val=16;
+                                  entroct(4);
+                                  entroct(d2);
+                                  entroct(c2.val);
+                                }
+                        }
+                        break;
+                    case 4 : {
+                          veracf(c2.acc);
+                          i=c2.rep;
+                          if (i!=0) 
+                             {
+                               do {
+                                 i=i-1;
+                                 entroct(2);
+                                 entroct(c2.val);
+                                 entroct(3);
+                               } while (!(i<=0));
+                             }
+                          entroct(2);
+                          entroct(c2.val);
+                          entroct(4);
+                          if (c3.code==9) 
+                             {
+                               entroct(2);
+                               entroct(c2.val);
+                               entroct(5);
+                             }
+                            else
+                             if (! (set::of(range(0,1),4, eos).has(c3.code))) 
+                                {
+                                  veracf(c3.acc);
+                                  switch (c3.code) {
+                                                 case 3 : d2= 8; break;
+                                                 case 6 : d2= tabdph[(c3.val-14) << 1]; break;
+                                                 case 5 : d2= c3.val; break;
+                                                default: d2= 7;
+                                  }     /*  case c3.code  */
+                                  if (d2==4)  d2=3;
+                                  if (intcon[c2.val]!=0)  c2.val= c2.val+1;
+                                  entroct(4);
+                                  entroct(d2);
+                                  entroct(tabdbc[((c2.val-26) << 1)+1]);
+                                }
+                        }
+                        break;
+       }     /* case c2.code  */
+     }
+
+/*overlay function testprot : boolean;
+var
+   regs : registres;
+ buffer : array[0..511] of char;
+  i,j,k : integer;
+     st : phrase;
+    tay : integer;
+   test : array[0..2] of boolean;
+const
+ chaine : array[0..7] of char
+        = (' ','M','A','S','T','E','R',' ');
+
+begin
+ test[0]:= false;test[1]:=false;test[2]:=false;k:=0;
+ with regs do
+ begin
+   while (test[k]=false) and (k<2) do
+   begin
+     k:=k+1;
+     ax:=0;intr(19,regs);
+     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+     intr(19,regs);
+     test[k]:=true;
+     tesok:= true;
+     i:=0;
+     while (test[k]) and (i<19) do
+      begin
+       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
+       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
+      end;
+      for j:=0 to 7 do
+       if buffer[j+504]<>chaine[j] then test[k]:=false;
+   end;
+ end;
+ testprot:=(test[1] or test[2]);
+end;
+*/
+
diff --git a/engines/mortevielle/parole2.h b/engines/mortevielle/parole2.h
new file mode 100644
index 0000000..6cdaa3e
--- /dev/null
+++ b/engines/mortevielle/parole2.h
@@ -0,0 +1,103 @@
+  void rot_chariot()
+     {
+       c1= c2;
+       c2= c3;
+          {
+            c3.val= 32;
+            c3.code= 9;
+          }
+     }
+
+   void init_chariot()
+     {
+          {
+            c3.rep= 0;
+            c3.freq= 0;
+            c3.acc= 0;
+          }
+       rot_chariot();
+       rot_chariot();
+     }
+
+
+void trait_ph()
+   {
+            const array<0,2,integer> deca
+                  = {{300,30,40}};
+
+     ptr_tcph= pred(integer,num_ph);
+     ledeb=swap(t_cph[ptr_tcph]) + deca[typlec];
+     lefin=swap(t_cph[ptr_tcph+1]) + deca[typlec];
+     nb_word= lefin - ledeb;
+     ptr_tcph=(cardinal)ledeb >> 1;
+     ptr_word = 0;
+     do {
+       memw[adword+ ptr_word]= t_cph[ptr_tcph];
+       ptr_word = ptr_word +2;
+       ptr_tcph = ptr_tcph+1;
+     } while (!(ptr_tcph>=((cardinal)lefin >> 1)));
+
+     ptr_oct= 0;
+     ptr_word= 0;
+     init_chariot();
+
+     do {
+       rot_chariot();
+       charg_car();
+       trait_car();
+     } while (!(ptr_word >= nb_word));
+
+     rot_chariot();
+     trait_car();
+     entroct(ord('#'));
+   }
+
+
+
+   void parole(integer rep, integer ht, integer typ)
+    {
+          array<0,500,integer> savph;
+          integer i;
+          integer tempo;
+
+
+      if (sonoff)  return;
+      num_ph= rep;
+      haut= ht;
+      typlec= typ;
+      if (typlec!=0) 
+         {
+           for( i=0; i <= 500; i ++) savph[i]=t_cph[i];
+           tempo= tempo_bruit;
+         }
+                   else
+          if (haut>5)  tempo= tempo_f;
+                    else tempo= tempo_m;
+      addfix= (real)((tempo-addv[0]))/256;
+      cctable(tbi);
+      switch (typ) {
+              case 1 : {
+                    charge_bruit();
+                    /*if zuul then zzuul(adbruit,0,1095);*/
+                    regenbruit();
+                  }
+                  break;
+               case 2 : {
+                    charge_son();
+                    charge_phbruit();
+                  }
+                  break;
+      }
+      trait_ph();
+      litph(tbi,typ,tempo);
+      if (typlec!=0) 
+         for( i=0; i <= 500; i ++)
+            {
+              t_cph[i]=savph[i];
+              mlec=typlec;
+            }
+      writepal(numpal);
+    }
+
+
+
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
new file mode 100644
index 0000000..a3ba189
--- /dev/null
+++ b/engines/mortevielle/prog.h
@@ -0,0 +1,346 @@
+/* overlay */ void change_gd(integer ngd)
+{
+      integer i;
+
+  hide_mouse();
+  gd= ngd;
+  hirs();
+  init_mouse();
+  show_mouse();
+  dessine_rouleau();
+  tinke();
+  pendule();
+  if (ipers!=0)  affper(ipers); else person();
+  clsf2();
+  clsf3();
+  maff= 68;
+  afdes(0);
+  repon(2,crep);
+  menu_aff();
+}
+
+/* overlay */ void antegame()
+{
+     integer cx;
+   registres regs;
+ array<0,511,char> buffer;
+  integer i,j,k;
+   array<0,2,boolean> test;
+    array<0,7,char> g;
+
+
+ hide_mouse();
+ imen= false;
+ g[1]='M';
+perdu= true;
+ anyone= false;
+okdes= true;
+ test[0]= false;
+ test[1]=false;
+ g[0]='\40';
+ col= false;
+ tesok= true;
+ test[2]=false;
+ g[7]=g[0];
+ g[2]='A';
+ cache= false;
+ brt= false;
+ maff= 68;
+ g[5]='E';
+ mnumo= 0;
+ prebru= 0;
+ g[4]='T';
+ x= 0;
+ y= 0;
+ num= 0;
+ hdb= 0;
+ hfb= 0;
+ cs= 0;
+ is= 0;
+ k= 0;
+ ment= 0;
+syn= true;
+fouil= true;
+ mchai= 0;
+ inei= 0;
+ initouv();
+ g[3]='S';
+ g[6]='R';
+ iouv= 0;
+ dobj= 0;
+ affrep();
+ stpou= ind_mess;
+ while ((test[k]==false) && (k<2)) 
+ {
+   regs.ax=0;
+   k=succ(integer,k);
+   intr(19,regs);
+    {
+      regs.ax=0x201;regs.cx=0x1;regs.dx=0x100+k-1;regs.es=seg(buffer);regs.bx=ofs(buffer);
+      intr(19,regs);
+      test[k]=! imen;
+      i=0;
+      while ((test[k]) && (i<19)) 
+        {
+          regs.ax=0x201;
+          syn= false;regs.cx=0x2700+i;regs.dx=0x100+k-1;regs.es=seg(buffer);regs.bx=ofs(buffer);
+          intr(19,regs);if (lo(regs.flags) % 2==1)  test[k]=false;i=i+1;
+        }
+        okdes= false;
+        solu= true;
+      for( j=0; j <= 7; j ++) if (buffer[j+504]!=g[j])  test[k]=false;
+    }
+   perdu= false;
+   fouil= false;
+ }
+ person();
+ tinke();
+ pendule();
+ afdes(0);
+ repon(2,crep);
+ clsf3();
+ solu= false;
+ tmlieu(s.mlieu);
+ modinv();
+ if (s.derobj!= 0)  modobj2(s.derobj+ 400,test[1],test[2]);
+                 else tesok=test[1] || test[2];
+ show_mouse();
+}
+
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+void tmaj3()
+{
+ integer j,h,m;
+
+ calch(j,h,m);
+ if (m== 30)  m= 1;
+ h= h+ (j* 24);
+ m= m+ (h* 2);
+ s.heure= chr(m);
+}
+
+void tsitu()
+
+{
+ integer h,j,m;
+
+ if (! col)  clsf2();
+ syn= false;
+ iesc= false;
+ if (anyone)  goto L1;
+ if (brt) 
+  if ((msg[3]== depla) || (msg[4]== sortir) || (msg[4]== dormir) ||
+     (msg[4]== manger)) 
+  {
+   ctrm= 4;
+   goto L2;
+  }
+ if (msg[3]== depla)       taller();
+ if (msg[3]== discut)      tparler();
+ if (msg[3]== invent)      tsprendre();
+ if (msg[4]== attacher)    tattacher();
+ if (msg[4]== attendre)    tattendre();
+ if (msg[4]== defoncer)    tdefoncer();
+ if (msg[4]== dormir)      tdormir();
+ if (msg[4]== ecouter)     tecouter();
+ if (msg[4]== entrer)      tentrer();
+ if (msg[4]== fermer)      tfermer();
+ if (msg[4]== fouiller)    tfouiller();
+ if (msg[4]== frapper)     tfrapper();
+ if (msg[4]== gratter)     tgratter();
+ if (msg[4]== lire)        tlire();
+ if (msg[4]== manger)      tmanger();
+ if (msg[4]== mettre)      tmettre();
+ if (msg[4]== ouvrir)      touvrir();
+ if (msg[4]== prendre)     tprendre();
+ if (msg[4]== regarder)    tregarder();
+ if (msg[4]== sentir)      tsentir();
+ if (msg[4]== sonder)      tsonder();
+ if (msg[4]== sortir)      tsortir();
+ if (msg[4]== soulever)    tsoulever();
+ if (msg[4]== tourner)     ttourner();
+ if (msg[4]== scacher)    
+ {
+  tcacher();
+  goto L1;
+ }
+ if (msg[4]== sfouiller)   tsfouiller();
+ if (msg[4]== slire)       tslire();
+ if (msg[4]== sposer)      tposer();
+ if (msg[4]== sregarder)   tsregarder();
+ cache= false;
+L1:
+ if (anyone) 
+ {
+  quelquun();
+  anyone= false;
+  goto L2;
+ }
+ calch(j,h,m);
+ if ((((h== 12) || (h== 13) || (h== 19)) && (s.mlieu!= 10)) ||
+ ((h> 0) && (h< 6) && (s.mlieu!= 0)))  s.conf= s.conf+ 1;
+ if (((s.mlieu< 16) || (s.mlieu> 19)) && (s.mlieu!= 23)
+ && (s.mlieu!= 0) && (s.derobj!= 152) && (! perdu)) 
+ {
+  if ((s.conf> 99) && (h> 8) && (h< 16)) 
+  {
+   crep= 1501;
+   tperd();
+  }
+  if ((s.conf> 99) && (h> 0) && (h< 9)) 
+  {
+   crep= 1508;
+   tperd();
+  }
+  if ((j> 1) && (h> 8) && (! perdu)) 
+  {
+   crep= 1502;
+   tperd();
+  }
+ }
+L2:
+ mennor();
+}
+
+void sv_game(integer n); 
+
+void ld_game(integer n); 
+
+void tecran()
+{
+        const char idem[] = "Idem";
+        const integer lim = 20000;
+ integer temps;
+ char inkey;
+ boolean oo, funct;
+
+ clsf3();
+ oo= false;
+ ctrm= 0;
+ if (! iesc) 
+ {
+   draw_menu();
+   imen= true;
+   temps= 0;
+   key= 0;
+   funct= false;
+   inkey='.';
+
+   do {
+     mdn();
+     tinke();
+     mov_mouse(funct,inkey);
+     temps= temps+ 1;
+   } while (!((choisi) || (temps > lim) || (funct) || (anyone)));
+
+   erase_menu();
+   imen= false;
+   if (set::of('\1','\3','\5','\7','\11', eos).has(inkey)) 
+      {
+        change_gd((cardinal)pred(integer,ord(inkey)) >> 1);
+        return;
+      }
+   if (choisi && (msg[3]==sauve))  sv_game(msg[4] & 7);
+   if (choisi && (msg[3]==charge))  ld_game(pred(integer,msg[4] & 7));
+   if (inkey== '\103')          /* F9 */
+   {
+     temps = do_alert(stpou,1);
+     return;
+   }
+   else
+    if (inkey== '\77') 
+    {
+     if ((mnumo!= no_choice) && ((msg[3]== action) || (msg[3]== saction))) 
+     {
+      msg[4]= mnumo;
+      ecr3(idem);
+     }
+     else return;
+    }
+    else
+     if (inkey== '\104') 
+     {
+      if ((x!= 0) && (y!= 0))  num= 9999;
+      return;
+     }
+  }
+  if (inkey== '\73') 
+  {
+   arret= true;
+   tmaj3();
+  }
+  else
+  {
+   if ((funct) && (inkey!= '\77'))  return;
+   if (temps> lim) 
+   {
+    repon(2,141);
+    if (num== 9999)  num= 0;
+   }
+   else
+   {
+    mnumo= msg[3];
+    if ((msg[3]== action) || (msg[3]== saction))  mnumo= msg[4];
+    if (! anyone) 
+    {
+     if ((fouil) || (obpart)) 
+     {
+       if (y_s< 12)  return;
+      if ((msg[4]== sonder) || (msg[4]== soulever)) 
+      {
+       oo= true;
+       if ((msg[4]== soulever) || (obpart)) 
+       {
+        finfouil();
+        caff= s.mlieu;
+        crep= 998;
+       }
+       else tsuiv();
+       mennor();
+      }
+     }
+    }
+    do {
+      if (! oo)  tsitu();
+      if ((ctrm== 0) && (! perdu) && (! solu)) 
+      {
+        taffich();
+        if (okdes) 
+        {
+          okdes= false;
+          dessin(0);
+        }
+        if ((! syn) || (col))  repon(2,crep);
+      }
+    } while (!(! syn));
+   if (ctrm!= 0)  tctrm();
+  }
+ }
+}
+
+/* NIVEAU 1 */
+
+void theure()
+{
+ vj= ord(s.heure);
+ vh= vj % 48;
+ vj= vj / 48;
+ vm= vh % 2;
+ vh= vh / 2;
+ heu= vh;
+ if (vm== 1)  min= 30; else min= 0;
+}
+
+
+void tjouer()
+{
+  antegame();
+  do {
+    tecran();
+  } while (!((arret) || (solu) || (perdu)));
+  if (solu)  tmaj1(); else
+     if (perdu)  tencore();
+}
+
diff --git a/engines/mortevielle/ques.h b/engines/mortevielle/ques.h
new file mode 100644
index 0000000..66584d5
--- /dev/null
+++ b/engines/mortevielle/ques.h
@@ -0,0 +1,121 @@
+
+/* overlay */ boolean ques()
+{
+         const array<1,10,integer> ta
+             = {{ 511, 516, 524, 531, 545,
+                 552, 559, 563, 570, 576}};
+         const array<1,10,integer> ok
+            = {{ 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }};
+
+       boolean q, func, test;
+       integer i,j,k,y,memk;
+       integer tay , tmax;
+       integer rep, prem, der;
+       phrase st;
+       char key;
+       mult_rect coor;
+       array<1,14,str40> chaines;
+       integer compte;
+
+
+  boolean ques_result;
+  test=false;
+  i=0;
+  compte= 0;
+
+  do {
+    hide_mouse();
+    hirs();
+    show_mouse();
+    i= i+1;
+    deline(ta[i],st,tay);
+    if (res==1)  y=29; else y=23;
+    box(15,gd,0,14,630,y,255);
+    afftex(st,20,15,100,2,0);
+    if (i!=10) 
+       {
+         prem= ta[i]+1;
+         der= ta[i+1]-1;
+       }
+     else
+       {
+         prem= 503;
+         der= 510;
+       }
+    y=35;
+    tmax= 0;
+    memk= 1;
+    for( j= prem; j <= der; j ++)
+      {
+        deline(j,st,tay);
+        if (tay>tmax)  tmax= tay;
+        afftex(st,100,y,100,1,0);
+        chaines[memk]= delig;
+        memk= memk+1;
+        y= y+8;
+      }
+    for( j= 1; j <= succ(integer,der-prem); j ++)
+      {
+      {
+          rectangle& with = coor[j]; 
+
+          with.x1= 45*res;
+          with.x2= (tmax*3 + 55)*res;
+          with.y1= 27 + j*8;
+          with.y2= 34 + j*8;
+          with.etat= true;
+      }
+        while (length(chaines[j] )<tmax) 
+          {
+            chaines[j]= chaines[j] +' ';
+          }
+      }
+    coor[j+1].etat= false;
+    if (res==1)  rep=10; else rep=6;
+    boite(80, 33, 40+tmax*rep, (der-prem)*8+ 16, 15);
+    rep= 0;
+    j= 0;
+    memk= 0;
+    do {
+      clic= false;
+      tesok=false;
+      mov_mouse(func,key);
+      k= 1;
+      while (coor[k].etat && ! dans_rect(coor[k]))  k= k+1;
+      if (coor[k].etat) 
+         {
+           if ((memk!=0) && (memk!=k)) 
+              {
+                /*DeLine(T_rec[ta[i]+memk].indis,T_rec[ta[i]+memk].point,st,tay);*/
+                for( j= 1; j <= tmax; j ++) st[j]= chaines[memk][j];
+                st[1+tmax]= '$';
+                afftex(st,100,27+memk*8,100,1,0);
+              }
+           if (memk!=k) 
+              {
+                /*DeLine(T_rec[pred(prem)+k].indis,T_rec[pred(prem)+k].point,st,tay);*/
+                for( j= 1; j <= tmax; j ++) st[j]= chaines[k][j];
+                st[1+tmax]= '$';
+                afftex(st,100,27+k*8,100,1,1);
+                memk= k;
+              }
+         }
+       else
+         if (memk!=0) 
+            {
+              for( j= 1; j <= tmax; j ++) st[j]= chaines[memk][j];
+              st[1+tmax]= '$';
+              afftex(st,100,27+memk*8,100,1,0);
+              memk=0;
+            }
+    } while (!((memk!=0) && clic));
+    if (memk==ok[i])  compte=compte+1;
+                  else {
+                         if (i==5)  i=i +1;
+                         if ((i==7) || (i==8))  i= 10;
+                       }
+    if (i==10)  q=   /*testprot*/ true;
+  } while (!(i==10));
+  ques_result= (compte==10) && q;
+  return ques_result;
+}
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
new file mode 100644
index 0000000..b54e2ba
--- /dev/null
+++ b/engines/mortevielle/sprint.h
@@ -0,0 +1,55 @@
+void fill_box(integer x,integer y,integer dx)
+{
+  box(15,gd,pred(integer,x) << 3, pred(integer,y) << 3, pred(integer,x+dx) << 3, y << 3, 255);
+}
+
+void clear_box(integer x,integer y,integer dx)
+{
+  box(0,gd,pred(integer,x) << 3, pred(integer,y) << 3, pred(integer,x+dx) << 3, y << 3, 255);
+}
+
+void writeg(str255 l,integer c)
+
+{
+     integer i, x, xo, yo;
+     integer cecr;
+     boolean t;
+
+/*  debug('writeg : '+l);*/
+
+  if (l=="")  return;
+  hide_mouse();
+  xo=xwhere;
+  yo=ywhere;
+  if (res==2)  i=6;
+           else i=10;
+  x=xo+i*length(l);
+  switch (c) {
+          case 1:case 3  : {
+                   cecr=0;
+                   box(15,gd,xo,yo,x,yo+7,255);
+                 }
+                 break;
+             case 4 : {
+                   cecr=0;
+                 }
+                 break;
+             case 5 : {
+                   cecr=15;
+                 }
+                 break;
+           case 0:case 2 : {
+                   cecr=15;
+                   box(0,gd,xo,yo,x,yo+7,255);
+                 }
+                 break;
+  }
+  xo=xo+1;
+  yo=yo+1;
+  for( x=1; x <= length(l); x ++)
+     {
+       affcar(gd,xo,yo,cecr,ord(l[x]));
+       xo=xo+i;
+     }
+  show_mouse();
+}
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
new file mode 100644
index 0000000..8f8cb1e
--- /dev/null
+++ b/engines/mortevielle/taffich.h
@@ -0,0 +1,216 @@
+void chardes( str11 nom, long_integer passe, integer long_)
+   {
+         integer i, p, l;
+         byte b;
+         untyped_file f;
+
+     /* debug('chardes'); */
+     assign(f,nom);
+     /*$i-*/
+     reset(f);
+     testfi();
+     p= 0;
+     while (passe>127) 
+       {
+         p=p+1;
+         passe=passe-128;
+       }
+     if (p!=0)  seek(f,p);
+     p= trunc(passe);
+     l= long_+p;
+     i= 0;
+     while (l>0) 
+       {
+         blockread(f,mem[0x6000+i],1);
+         testfi();
+         l= l-128;
+         i= i+128;
+       }
+     close(f);
+     for( i=p; i <= long_+p; i ++) mem[0x7000+i-p]=mem[0x6000+i];
+     /*$i+*/
+   }
+
+void charani( str11 nom, long_integer passe, integer long_)
+   {
+         integer i, p, l;
+         byte b;
+         untyped_file f;
+
+     /* debug('charani'); */
+     assign(f,nom);
+     /*$i-*/
+     reset(f);
+     testfi();
+     p= 0;
+     while (passe>127) 
+       {
+         passe=passe-128;
+         p=p+1;
+       }
+     if (p!=0)  seek(f,p);
+     p= trunc(passe);
+     l=long_+p;
+     i= 0;
+     while (l>0) 
+       {
+         blockread(f,mem[0x6000+i],1);
+         testfi();
+         l=l-128;
+         i=i+128;
+       }
+     close(f);
+     for( i=p; i <= long_+p; i ++) mem[0x7314+i-p]=mem[0x6000+i];
+     /*$i+*/
+   }
+
+void taffich()
+{
+         const array<136,140,byte> tran1
+               = {{ 121, 121, 138, 139, 120 }};
+         const array<153,161,byte> tran2
+               = {{ 150, 150, 152, 152, 100,
+                   110, 159, 100, 100 }};
+      integer i, m, a, b, cx, handle,
+      npal;
+      long_integer lgt, lhandle;
+      str11 nom;
+      integer palh,k,j;
+      array<0,15,integer> alllum;
+
+
+ a= caff;
+ if (set::of(range(153,161), eos).has(a))  a= tran2[a];
+                    else if (set::of(range(136,140), eos).has(a))  a= tran1[a];
+ b= a;
+ if (maff== a)  return;
+ if (a== 16) 
+ {
+  s.pourc[9]= '*';
+  s.teauto[42]= '*';
+ }
+ if (a== 20) 
+ {
+  s.teauto[39]= '*';
+  if (s.teauto[36]== '*') 
+  {
+   s.pourc[3]= '*';
+   s.teauto[38]= '*';
+  }
+ }
+ if (a== 24)  s.teauto[37]= '*';
+ if (a== 30)  s.teauto[9]= '*';
+ if (a== 31) 
+ {
+  s.pourc[4]= '*';
+  s.teauto[35]= '*';
+ }
+ if (a== 118)  s.teauto[41]= '*';
+ if (a== 143)  s.pourc[1]= '*';
+ if (a== 150)  s.teauto[34]= '*';
+ if (a== 151)  s.pourc[2]= '*';
+ okdes= true;
+ hide_mouse();
+ lgt= 0;
+ if ((a!=50) && (a!=51)) 
+   {
+     m= a+ 2000;
+     if ((m> 2001) && (m< 2010))  m= 2001;
+     if (m== 2011)  m= 2010;
+     if (a== 32)  m= 2034;
+     if ((a== 17) && (maff== 14))  m= 2018;
+     if (a> 99) 
+       if ((is== 1) || (is== 0))  m= 2031; else m= 2032;
+     if (((a> 69) && (a< 80)) || (a== 30) || (a== 31) || (a== 144)
+       || (a== 147) || (a== 149))  m= 2030;
+     if (((a< 27) && (((maff> 69) && (! s.ipre)) || (maff> 99)))
+       || ((maff> 29) && (maff< 33)))  m= 2033;
+     messint(m);
+     maff= a;
+     if (a== 159)  a= 86; else
+      if (a> 140)  a= a- 67; else
+       if (a> 137)  a= a- 66; else
+        if (a> 99)  a= a- 64; else
+         if (a> 69)  a= a- 42; else
+          if (a> 29)  a= a- 5; else
+           if (a== 26)  a= 24; else
+            if (a> 18)  a= a- 1;
+     npal= a;
+     for( cx= 0; cx <= (a- 1); cx ++) lgt= lgt+l[cx];
+     handle=l[a];
+     nom= "DXX.mor";
+   }
+ else
+   {
+     nom= "DZZ.mor";
+     handle= l[87];
+     if (a== 51) 
+        {
+          lgt= handle;
+          handle= l[88];
+        }
+     maff= a;
+     npal= a+37;
+   }
+ chardes(nom,lgt,handle);
+ if (gd==her) 
+    {
+      for( i=0; i <= 15; i ++)
+         {
+           palh=memw[0x7000+(succ(integer,i) << 1)];
+           alllum[i]=(palh & 15) + (((cardinal)palh >> 12) & 15) + (((cardinal)palh >> 8) & 15);
+         }
+      for( i=0; i <= 15; i ++)
+         {
+           k=0;
+           for( j=0; j <= 15; j ++) if (alllum[j]>alllum[k])  k=j;
+           mem[0x7000+2+(k << 1)]= rang[i];
+           alllum[k]=-1;
+         }
+    }
+ numpal=npal;
+ writepal(npal);
+
+ if ((b< 15) || (b== 16) || (b== 17) || (b== 24) || (b== 26) || (b== 50)) 
+    {
+      lgt= 0;
+      if ((b< 15) || (b== 16) || (b== 17) || (b== 24) || (b== 26)) 
+         {
+           if (b== 26)  b= 18; else
+              if (b== 24)  b= 17; else
+                 if (b> 15)  b= b- 1;
+           for( cx= 0; cx <= (b- 1); cx ++) lgt= lgt+ l[cx+89];
+           handle=l[b+89];
+           nom= "AXX.mor";
+         }
+       else
+         if (b== 50) 
+            {
+              nom= "AZZ.mor";
+              handle= 1260;
+            }
+      charani(nom,lgt,handle);
+    }
+ show_mouse();
+ if ((a< 27) && ((maff< 27) || (s.mlieu== 15)) && (msg[4]!= entrer)) 
+    {
+      if ((a== 13) || (a== 14))  person();
+                            else if (! blo)  t11(s.mlieu, cx);
+      mpers=  0;
+    }
+}
+
+/*    begin
+      for i:=0 to 15 do
+         begin
+           PalH:=memw[$7000:succ(i) shl 1];
+           Alllum[i]:=PalH and 15 + PalH shr 4 and 15 + PalH shr 8 and 15;
+         end;
+      for i:=0 to 15 do
+         begin
+           k:=0;
+           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
+           mem[$7000:2+k shl 1]:= Rang[i];
+           Alllum[k]:=-1;
+         end;
+    end;*/
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
new file mode 100644
index 0000000..c1881be
--- /dev/null
+++ b/engines/mortevielle/var_mor.h
@@ -0,0 +1,485 @@
+
+/*         Constantes, Types et Variables pour le
+
+              M A N O I R   DE   M O R T E V I E L L E
+
+                                                    ( version Nov 1988
+                                                             +
+                                                  musique & paroles Oct 88 )
+                                                                             */
+
+
+/*---------------------------------------------------------------------------*/
+/*-------------------------   CONSTANTES   ----------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+const real freq0 = 1.19318e6;
+
+const integer seg_syst = 0x6fed;
+const integer segmou = 0x6f00;
+const integer segdon = 0x6c00;
+const integer adani = 0x7314;
+const integer adword = 0x4000;
+const integer adtroct = 0x406b;
+const integer adcfiec = 0x4300;
+const integer adbruit = 0x5cb0;/*2C00;*/
+const integer adbruit1 = 0x6924;/*3874;*/
+const integer adbruit2 = 0x6b30;/*3A80;*/
+const integer adbruit3 = 0x6ba6;/*3AF6;*/
+const integer adbruit5 = 0x3b50;
+const integer adson = 0x5cb0;/*2C00;*/
+const integer adson2 = 0x60b0;/*3000;*/
+const integer offsetb1 = 6;
+const integer offsetb2 = 4;
+const integer offsetb3 = 6;
+
+const integer null = 255;
+
+const integer tempo_mus = 71;
+const integer tempo_bruit = 78;
+const integer tempo_f = 80;
+const integer tempo_m = 89;
+
+const integer ti1 = 410;
+const integer ti2 = 250;
+const integer maxti = 7975;
+const integer maxtd = 600;
+const integer max_rect = 14;
+
+const integer ams = 0;
+const integer cga = 1;
+const integer ega = 2;
+const integer her = 3;
+const integer tan = 4;
+
+const integer c_repon = 0;
+const integer c_st41 = 186;
+const integer c_tparler = 247;
+const integer c_paroles = 292;
+const integer c_tmlieu = 435;
+const integer c_dialpre = 456;
+const integer c_action = 476;
+const integer c_saction = 497;
+const integer c_dis = 502;
+const integer c_fin = 510;    /*  =>   n'existe pas  ; si !! */
+
+const integer arega = 0;
+const integer asoul = 154;
+const integer aouvr = 282;
+const integer achai = 387;
+const integer acha = 492;
+const integer arcf = 1272;
+const integer arep = 1314;
+const integer amzon = 1650;
+const integer fleche = 1758;
+
+const integer no_choice = 0;
+const integer invent = 1;
+const integer depla = 2;
+const integer action = 3;
+const integer saction = 4;
+const integer discut = 5;
+const integer fichier = 6;
+const integer sauve = 7;
+const integer charge = 8;
+
+const integer attacher = 0x301;
+const integer attendre = 0x302;
+const integer defoncer = 0x303;
+const integer dormir = 0x304;
+const integer ecouter = 0x305;
+const integer entrer = 0x306;
+const integer fermer = 0x307;
+const integer fouiller = 0x308;
+const integer frapper = 0x309;
+const integer gratter = 0x30a;
+const integer lire = 0x30b;
+const integer manger = 0x30c;
+const integer mettre = 0x30d;
+const integer ouvrir = 0x30e;
+const integer prendre = 0x30f;
+const integer regarder = 0x310;
+const integer sentir = 0x311;
+const integer sonder = 0x312;
+const integer sortir = 0x313;
+const integer soulever = 0x314;
+const integer tourner = 0x315;
+
+const integer scacher = 0x401;
+const integer sfouiller = 0x402;
+const integer slire = 0x403;
+const integer sposer = 0x404;
+const integer sregarder = 0x405;
+
+  const array<0,17,byte> tabdbc
+          = {{7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9}};
+  const array<0,15,byte> tabdph
+          = {{0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10}};
+  const array<0,25,byte> typcon
+          = {{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}};
+  const array<0,25,byte> intcon
+          = {{1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}};
+  const array<0,363,byte> tnocon
+          = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+            0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0}};
+
+
+const matrix<1,8,1,4,byte> don
+        = {{{{ 7, 37, 22,  8}},
+          {{19, 33, 23,  7}},
+          {{31, 89, 10, 21}},
+          {{43, 25, 11,  5}},
+          {{55, 37,  5,  8}},
+          {{64, 13, 11,  2}},
+          {{62, 22, 13,  4}},
+          {{62, 25, 13,  5}}}};
+
+const array<1,2,varying_string<11> > fic
+    = {{ " Sauvegarde",
+        " Chargement" }};
+
+const array<0,1,byte> addv
+   = {{8,8}};
+
+const char recom[] = " Recommence  ";
+
+     const char f3[] = "F3: Encore";
+     const char f8[] = "F8: Suite";
+
+  const integer max_patt = 20;
+
+
+ const array<0,15,byte> rang
+      = {{15,14,11,7,13,12,10,6,9,5,3,1,2,4,8,0}};
+
+
+/*---------------------------------------------------------------------------*/
+/*--------------------------------   TYPES   --------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+typedef varying_string<11> path_chars;
+typedef real long_integer;
+typedef varying_string<255> str255;
+typedef varying_string<125> str125;
+typedef varying_string<30> str30;
+typedef varying_string<11> str11;
+typedef file<byte> fichier_byte;
+struct sav_chaine {
+                  integer conf;
+                  array<0,10,char> pourc;
+                 array<0,42,char> teauto;
+                   array<0,30,char> sjer;
+                 integer mlieu,iboul,ibag,icave,ivier,ipuit;
+                 integer derobj,iloic,icryp;
+                  boolean ipre;
+                 char heure;
+};
+struct registres {
+           integer ax,bx,cx,dx,bp,si,di,ds,es,flags;
+};
+typedef array<1,1410,char> phrase;
+typedef array<0,maxti,integer> tabint;
+ struct ind {
+         integer indis;
+         byte point;
+ };
+typedef array<0,maxtd,ind> tabind;
+
+typedef matrix<1,7,0,24,byte> tab_mlieu;
+
+ typedef array<0,255,real> table;
+typedef array<0,255,integer> tablint;
+
+  typedef integer word1;
+struct chariot {
+           integer val,
+           code,
+           acc,
+           freq,
+           rep;
+};
+
+struct doublet {
+        byte x,y;
+};
+typedef array<1,16,doublet> tabdb;
+typedef array<0,107,integer> tfxx;
+struct rectangle {
+            integer x1, x2, y1, y2;
+            boolean etat;
+};
+
+typedef array<1,max_rect,rectangle> mult_rect;
+typedef varying_string<40> str40;
+
+ struct pattern {
+             byte tay, tax;
+             matrix<1,max_patt, 1,max_patt,byte> des;
+ };
+
+
+  struct nhom {
+           byte n;     /* numero entre 0 et 32 */
+           array<0,3,byte> hom;
+  };
+
+  typedef array<0,15,nhom> t_nhom;
+
+  struct t_pcga {
+             byte p;
+             t_nhom a;
+  };
+
+  typedef array<0,90,t_pcga> pal_cga;
+
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------   VARIABLES   ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+boolean blo,
+bh1,
+bf1,
+bh2,
+bh4,
+bf4,
+bh5,
+bh6,
+bh8,
+bt3,
+bt7,
+bh9,
+
+sonoff,
+main1,
+choisi,
+test0,
+f2_all,
+imen,
+cache,
+iesc,
+perdu,
+col,
+syn,
+fouil,
+zuul,
+tesok,
+obpart,
+okdes,
+solu,
+arret,
+anyone,
+brt,
+rect,
+rech_cfiec,
+active_menu;
+
+
+integer x,
+y,
+t,
+vj,
+li,
+vh,
+vm,
+jh,
+mh,
+cs,
+gd,                /*  Gd = graph device  */
+hdb,
+hfb,
+heu,
+jou,
+key,
+min,
+num,
+max,
+res,
+ment,
+haut,
+caff,
+maff,
+crep,
+ades,
+iouv,
+inei,
+ctrm,
+dobj,
+msg3,
+msg4,
+mlec,
+newgd,
+c_zzz,
+mchai,
+menup,
+ipers,
+ledeb,
+lefin,
+mpers,
+mnumo,
+xprec,
+yprec,
+perdep,
+prebru,
+typlec,
+num_ph,
+xwhere,
+ywhere,
+numpal,
+lderobj,
+nb_word,
+ptr_oct,
+k_tempo,
+ptr_tcph,
+ptr_word,
+color_txt;
+
+array<0,6400,integer> t_cph;
+array<0,4000,byte> tabdon;
+/*   t_dxx  : array[0..121] of integer;*/
+str125 stpou;                               /* donne le % d'indices */
+byte is;
+char mode;
+fichier_byte ficdes;
+str125 al_mess,
+err_mess,
+ind_mess,
+al_mess2;
+
+ array<1,8,integer> invt,
+nbrep,
+nbrepm,
+ disc;
+  array<0,4,integer> msg;
+ array<1,7,integer> depl;
+ array<1,8,varying_string<22> > inv;
+ array<1,7,varying_string<23> > dep;
+ array<1,21,varying_string<10> > act;
+ array<1,5,varying_string<11> > self_;
+ array<1,8,varying_string<5> > dis;
+ array<1,7,char> touv;
+ sav_chaine s,s1;
+array<0,390,byte> bufcha;
+
+matrix<1,6,0,23,byte> lettres;
+
+array<0,15,byte> palher;
+
+    tabint t_mot;
+integer tay_tchar;
+    tabind t_rec;
+   file<ind> sauv_t;
+   untyped_file fibyte;
+   tab_mlieu v_lieu;
+        tfxx l;
+      tablint tbi;
+chariot c1, c2, c3;
+   real addfix;
+   pal_cga palsav;
+   array<0,90,tabdb> tabpal;
+   pal_cga palcga;
+      array<0,14,pattern> tpt;
+
+
+
+/*---------------------------------------------------------------------------*/
+/*--------------------   PROCEDURES  ET  FONCTIONS   ------------------------*/
+/*---------------------------------------------------------------------------*/
+
+/* procedure box(c,Gd,xo,yo,xi,yi,patt:integer); external 'c:\mc\boite.com'; */
+
+void hirs()
+{
+      const array<0,13,byte> tandy
+           = {{113,80,90,14,63,6,50,56,2,3,6,7,0,0}};
+      const array<0,12,byte> herc
+        = {{50,40,41,9,103,3,100,100,2,3,0,0,0}};
+       integer i, j;
+
+  switch (gd) {
+    case cga :
+     {
+       graphcolormode;
+       graphbackground(0);
+       palette(1);
+       res=1;
+     }
+     break;
+    case ams :
+     {
+       hires;
+       inline_((real)(0xb8)/6/0/        /*  =>  mov ax,6 */
+              0xcd/0x10);       /*  =>  int 16   */
+       port[0x3d9]=15;
+       port[0x3df]=0;
+       port[0x3dd]=15;
+       res=2;
+     }
+     break;
+    case ega :
+     {
+       inline_((real)(0xb8) / 14 / 0 /     /*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs */
+              0xcd / 0x10);        /*  INT 16  */
+       res=2;
+     }
+     break;
+    case her :
+     {
+       port[0x3bf]=3;
+       port[0x3b8]=2;
+       for( i=0; i <= 12; i ++)
+       {
+         port[0x3b4]=i;
+         port[0x3b5]=herc[i];
+       }
+       inline_((real)(0xfc)/0xb9/0/0x80/0xb8/0/0xb0/0x8e/0xc0/0x31/0xff/0x31/0xc0/0xf3/0xab);
+       port[0x3b8]=10;
+       res=2;
+     }
+     break;
+    case tan :
+     {
+       port[0x3d8]=0;
+       port[0x3da]=3;
+       port[0x3de]=0x14;
+       for( i=0; i <= 13; i ++)
+         {
+           port[0x3d4]=i;
+           port[0x3d5]=tandy[i];
+         }
+       port[0x3da]=2;
+       port[0x3de]=0;
+       port[0x3d8]=port[0x3d8] | (11 & 0xef);
+       port[0x3dd]=port[0x3dd] | 1;
+       port[0x3df]=port[0x3df] | 0xc0;
+       box(0,gd,0,0,640,200,255);
+       res=1;
+     }
+     break;
+  }
+}
+
+/* procedure affput(Chx,Gd,x,y,coul,char:integer); external 'c:\mc\divaf.com'; */
+
+void affcar(integer gd,integer x,integer y,integer coul,integer char)
+{
+  if (res==1)  affput(1,gd,((cardinal)x >> 1),y,coul,char);
+           else affput(1,gd,x,y,coul,char);
+}
+
+void putpix(integer gd,integer x,integer y,integer coul)
+{
+  affput(0,gd,x,y,coul,0);
+}


Commit: 55c2a098d46545f5b6a1a750d209139fba3578bf
    https://github.com/scummvm/scummvm/commit/55c2a098d46545f5b6a1a750d209139fba3578bf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:13-07:00

Commit Message:
MORTEVIELLE: Ran astyle over generated files

Changed paths:
    engines/mortevielle/actions.h
    engines/mortevielle/alert.h
    engines/mortevielle/boite.h
    engines/mortevielle/disk.h
    engines/mortevielle/droite.h
    engines/mortevielle/keyboard.h
    engines/mortevielle/level15.h
    engines/mortevielle/menu.h
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.h
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.h
    engines/mortevielle/parole.h
    engines/mortevielle/parole2.h
    engines/mortevielle/prog.h
    engines/mortevielle/ques.h
    engines/mortevielle/sprint.h
    engines/mortevielle/taffich.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index fd4ae2e..1dd3abe 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -1,1372 +1,1193 @@
 /* NIVEAU 4 */
 const char stouinon[] = "[2][ ][OUI][NON]";
 
-/* overlay */ void taller()
+/* overlay */
+void taller()
 
 {
- integer mx,cx,cy;
+	integer mx, cx, cy;
 
- if ((s.mlieu== 26) && (msg[4]== depl[6])) 
- {
-  s.mlieu= 15;
-  caff= s.mlieu;
-  afdes(0);
-  repon(2,s.mlieu);
- }
- if ((s.mlieu== 15) && (msg[4]== depl[6])) 
- {
-  if (! syn)  ecr3("aller");
-  tfleche();
-  if (iesc)  okdes= false;
-  if ((anyone) || (iesc))  return;
-  tcoord(1);
-  if (num== 0)  return;
-  if (num== 1) 
-  {
-   s.mlieu= 0;
-   tmlieu(0);
-  }
-  else
-   if (num== 7) 
-   {
-    s.mlieu= 13;
-    tmlieu(13);
-   }
-   else
-    if (num!= 6)  s.mlieu= 26;
-  if ((num> 1) && (num< 6))  ment= num- 1;
-  if (num> 7)  ment= num- 3;
-  if (num!= 6)  affrep(); else aldepl();
-  return;
- }
- tsort();
- cx= 0;
- do {
-  cx= cx+ 1;
- } while (!(depl[cx]== msg[4]));
- if (s.mlieu== 19) 
- {
-  if (cx== 1)  t1deva();
-  if (cx== 2)  t1neig();
-  goto L2;
- }
- if (s.mlieu== 23) 
- {
-  if (cx== 1)  t1deau();
-  if (cx== 2)  t1derr();
-  goto L2;
- }
- if ((s.mlieu== 11) && (cx== 1))  cx= 6;
- if (s.mlieu== 12) 
- {
-  if (cx== 2)  cx= 6;
-  if (cx== 5)  cx= 16;
- }
- if ((s.mlieu== 14) && (cx== 3))  cx= 6;
- if (((s.mlieu== 15) || (s.mlieu== 26)) && (cx== 4))  cx= 6;
- if ((s.mlieu> 19) && (s.mlieu!= 26))  cx= cx+ 10;
- if ((s.mlieu== 20) && (cx== 13))  cx= 16;
- if (s.mlieu== 21) 
- {
-  if (cx== 12)  cx= 16; else
-  if (cx> 13)  cx= 15;
- }
- if ((s.mlieu== 22) && (cx> 14))  cx= 15;
- if ((s.mlieu== 24) && (cx!= 17)) 
-  if (cx> 13)  cx= 15;
- if (cx== 1)  s.mlieu= 11; else
- if (cx== 2)  s.mlieu= 12; else
- if (cx== 3)  s.mlieu= 14; else
- if (cx== 4)  s.mlieu= 15; else
- if (cx== 5)  cx= 12;
- if (cx== 6)  cx= 11;
- if (cx== 11)  t1sama(); else
- if (cx== 12)  t1deva(); else
- if (cx== 13)  s.mlieu= 20; else
- if (cx== 14)  s.mlieu= 24; else
- if (cx== 15)  t1neig(); else
- if (cx== 16)  t1derr(); else
- if (cx== 17) 
- {
-  if ((s.ipuit!= 120) && (s.ipuit!= 140))  crep= 997; else
-   if (s.ipuit== 120)  crep= 181; else
-    if (s.conf> 80) 
-    {
-     crep= 1505;
-     tperd();
-    }
-    else
-    {
-     s.mlieu= 23;
-     affrep();
-    }
- }
- if ((cx< 5) || (cx== 13) || (cx== 14))  affrep();
- debloc(s.mlieu);
+	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
+		s.mlieu = 15;
+		caff = s.mlieu;
+		afdes(0);
+		repon(2, s.mlieu);
+	}
+	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
+		if (! syn)  ecr3("aller");
+		tfleche();
+		if (iesc)  okdes = false;
+		if ((anyone) || (iesc))  return;
+		tcoord(1);
+		if (num == 0)  return;
+		if (num == 1) {
+			s.mlieu = 0;
+			tmlieu(0);
+		} else if (num == 7) {
+			s.mlieu = 13;
+			tmlieu(13);
+		} else if (num != 6)  s.mlieu = 26;
+		if ((num > 1) && (num < 6))  ment = num - 1;
+		if (num > 7)  ment = num - 3;
+		if (num != 6)  affrep();
+		else aldepl();
+		return;
+	}
+	tsort();
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!(depl[cx] == msg[4]));
+	if (s.mlieu == 19) {
+		if (cx == 1)  t1deva();
+		if (cx == 2)  t1neig();
+		goto L2;
+	}
+	if (s.mlieu == 23) {
+		if (cx == 1)  t1deau();
+		if (cx == 2)  t1derr();
+		goto L2;
+	}
+	if ((s.mlieu == 11) && (cx == 1))  cx = 6;
+	if (s.mlieu == 12) {
+		if (cx == 2)  cx = 6;
+		if (cx == 5)  cx = 16;
+	}
+	if ((s.mlieu == 14) && (cx == 3))  cx = 6;
+	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))  cx = 6;
+	if ((s.mlieu > 19) && (s.mlieu != 26))  cx = cx + 10;
+	if ((s.mlieu == 20) && (cx == 13))  cx = 16;
+	if (s.mlieu == 21) {
+		if (cx == 12)  cx = 16;
+		else if (cx > 13)  cx = 15;
+	}
+	if ((s.mlieu == 22) && (cx > 14))  cx = 15;
+	if ((s.mlieu == 24) && (cx != 17))
+		if (cx > 13)  cx = 15;
+	if (cx == 1)  s.mlieu = 11;
+	else if (cx == 2)  s.mlieu = 12;
+	else if (cx == 3)  s.mlieu = 14;
+	else if (cx == 4)  s.mlieu = 15;
+	else if (cx == 5)  cx = 12;
+	if (cx == 6)  cx = 11;
+	if (cx == 11)  t1sama();
+	else if (cx == 12)  t1deva();
+	else if (cx == 13)  s.mlieu = 20;
+	else if (cx == 14)  s.mlieu = 24;
+	else if (cx == 15)  t1neig();
+	else if (cx == 16)  t1derr();
+	else if (cx == 17) {
+		if ((s.ipuit != 120) && (s.ipuit != 140))  crep = 997;
+		else if (s.ipuit == 120)  crep = 181;
+		else if (s.conf > 80) {
+			crep = 1505;
+			tperd();
+		} else {
+			s.mlieu = 23;
+			affrep();
+		}
+	}
+	if ((cx < 5) || (cx == 13) || (cx == 14))  affrep();
+	debloc(s.mlieu);
 L2:
- tmlieu(s.mlieu);
+	tmlieu(s.mlieu);
 }
 
-/* overlay */ void tprendre()
-{
- integer cx, cy, cz;
+/* overlay */ void tprendre() {
+	integer cx, cy, cz;
 
- if (caff> 99) 
- {
-  cx= caff;
-  avpoing(cx);
-  if (crep!= 139) 
-  {
-   if (ipers> 0)  s.conf= s.conf+ 3;
-   if (obpart) 
-   {
-    if (s.mlieu== 2)  s.iloic= 0;
-    if (s.mlieu== 13) 
-    {
-     if (s.iboul== caff)  s.iboul= 0;
-     if (s.ibag== caff)  s.ibag= 0;
-    }
-    if (s.mlieu== 14)  s.icave= 0;
-    if (s.mlieu== 16)  s.icryp= 0;
-    if (s.mlieu== 17)  s.ivier= 0;
-    if (s.mlieu== 24)  s.ipuit= 0;
-    mfouen();
-    obpart= false;
-    affrep();
-   }
-   else
-   {
-    tabdon[acha+ (pred(integer,mchai)* 10)+ pred(integer,cs)]=0;
-    tsuiv();
-    dobj= dobj+ 1;
-    if (dobj> 6) 
-    {
-     s.conf= s.conf+ 2;
-     dobj= 0;
-    }
-   }
-  }
-  return;
- }
- if (! syn)  ecr3("prendre");
- tfleche();
- if ((anyone) || (iesc))  return;
- if (caff== 3) 
- {
-  tcoord(2);
-  if (num== 1) 
-  {
-   crep= 152;
-   return;
-  }
- }
- tcoord(5);
- if ((num== 0) || ((num== 1) && (s.mlieu== 16))) 
- {
-  tcoord(8);
-  if (num!= 0) 
-  {
-   if (ipers> 0)  s.conf= s.conf+ 3;
-   crep= 997;
-   if ((s.mlieu== 2) && (s.iloic!= 0))  avpoing(s.iloic);
-   if ((s.mlieu==13) && (num==1) && (s.iboul!=0)) 
-   {
-    avpoing(s.iboul);
-    if ((crep!= 997) && (crep!= 139))  aniof(2,7);
-   }
-   if ((s.mlieu==13) && (num==2) && (s.ibag!=0)) 
-   {
-    avpoing(s.ibag);
-    if ((crep!= 997) && (crep!= 139))  aniof(2,6);
-   }
-   if ((s.mlieu== 14) && (s.icave!= 0)) 
-   {
-    avpoing(s.icave);
-    if ((crep!= 997) && (crep!= 139))  aniof(2,2);
-   }
-   if ((s.mlieu== 16) && (s.icryp!= 0))  avpoing(s.icryp);
-   if ((s.mlieu== 17) && (s.ivier!= 0)) 
-   {
-    avpoing(s.ivier);
-    if ((crep!= 997) && (crep!= 139)) 
-    {
-     crep= 182;
-     aniof(2,1);
-    }
-   }
-   if ((s.mlieu== 24) && (s.ipuit!= 0)) 
-   {
-    avpoing(s.ipuit);
-    if ((crep!= 997) && (crep!= 139))  aniof(2,1);
-   }
-   if ((crep!= 997) && (crep!= 182) && (crep!= 139))  crep= 999;
-  }
- }
- else
- {
-  if (((s.mlieu== 0) && (num== 3)) || ((s.mlieu== 1) && (num== 4))
-  || ((s.mlieu== 2) && (num== 1)) || ((s.mlieu== 4) && (num== 3))
-  || ((s.mlieu== 5) && (num== 6)) || ((s.mlieu== 6) && (num== 2))
-  || ((s.mlieu== 7) && (num== 6)) || ((s.mlieu== 8) && (num== 4))
-  || ((s.mlieu== 9) && (num== 4)) || ((s.mlieu== 10) && (num> 2))
-  || ((s.mlieu== 11) && (num== 7)) || ((s.mlieu== 12) && (num== 6))
-  || ((s.mlieu== 13) && (num> 4)) || ((s.mlieu> 13)
-  && (s.mlieu!= 23)))  crep= 997; else
-  {
-   if (s.mlieu== 23) 
-   {
-    crep= 1504;
-    tperd();
-   }
-   else crep= 120;
-  }
- }
+	if (caff > 99) {
+		cx = caff;
+		avpoing(cx);
+		if (crep != 139) {
+			if (ipers > 0)  s.conf = s.conf + 3;
+			if (obpart) {
+				if (s.mlieu == 2)  s.iloic = 0;
+				if (s.mlieu == 13) {
+					if (s.iboul == caff)  s.iboul = 0;
+					if (s.ibag == caff)  s.ibag = 0;
+				}
+				if (s.mlieu == 14)  s.icave = 0;
+				if (s.mlieu == 16)  s.icryp = 0;
+				if (s.mlieu == 17)  s.ivier = 0;
+				if (s.mlieu == 24)  s.ipuit = 0;
+				mfouen();
+				obpart = false;
+				affrep();
+			} else {
+				tabdon[acha + (pred(integer, mchai) * 10) + pred(integer, cs)] = 0;
+				tsuiv();
+				dobj = dobj + 1;
+				if (dobj > 6) {
+					s.conf = s.conf + 2;
+					dobj = 0;
+				}
+			}
+		}
+		return;
+	}
+	if (! syn)  ecr3("prendre");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	if (caff == 3) {
+		tcoord(2);
+		if (num == 1) {
+			crep = 152;
+			return;
+		}
+	}
+	tcoord(5);
+	if ((num == 0) || ((num == 1) && (s.mlieu == 16))) {
+		tcoord(8);
+		if (num != 0) {
+			if (ipers > 0)  s.conf = s.conf + 3;
+			crep = 997;
+			if ((s.mlieu == 2) && (s.iloic != 0))  avpoing(s.iloic);
+			if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) {
+				avpoing(s.iboul);
+				if ((crep != 997) && (crep != 139))  aniof(2, 7);
+			}
+			if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) {
+				avpoing(s.ibag);
+				if ((crep != 997) && (crep != 139))  aniof(2, 6);
+			}
+			if ((s.mlieu == 14) && (s.icave != 0)) {
+				avpoing(s.icave);
+				if ((crep != 997) && (crep != 139))  aniof(2, 2);
+			}
+			if ((s.mlieu == 16) && (s.icryp != 0))  avpoing(s.icryp);
+			if ((s.mlieu == 17) && (s.ivier != 0)) {
+				avpoing(s.ivier);
+				if ((crep != 997) && (crep != 139)) {
+					crep = 182;
+					aniof(2, 1);
+				}
+			}
+			if ((s.mlieu == 24) && (s.ipuit != 0)) {
+				avpoing(s.ipuit);
+				if ((crep != 997) && (crep != 139))  aniof(2, 1);
+			}
+			if ((crep != 997) && (crep != 182) && (crep != 139))  crep = 999;
+		}
+	} else {
+		if (((s.mlieu == 0) && (num == 3)) || ((s.mlieu == 1) && (num == 4))
+		        || ((s.mlieu == 2) && (num == 1)) || ((s.mlieu == 4) && (num == 3))
+		        || ((s.mlieu == 5) && (num == 6)) || ((s.mlieu == 6) && (num == 2))
+		        || ((s.mlieu == 7) && (num == 6)) || ((s.mlieu == 8) && (num == 4))
+		        || ((s.mlieu == 9) && (num == 4)) || ((s.mlieu == 10) && (num > 2))
+		        || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
+		        || ((s.mlieu == 13) && (num > 4)) || ((s.mlieu > 13)
+		                && (s.mlieu != 23)))  crep = 997;
+		else {
+			if (s.mlieu == 23) {
+				crep = 1504;
+				tperd();
+			} else crep = 120;
+		}
+	}
 }
 
-/* overlay */ void tsprendre()
-{
- integer cx,cy,cz;
+/* overlay */ void tsprendre() {
+	integer cx, cy, cz;
 
- cx= 0;
- do {
-  cx= cx+ 1;
- } while (!(invt[cx]== msg[4]));
- cz= 0;
- cy= 0;
- do {
-  cy= cy+ 1;
-  if (ord(s.sjer[cy])!= 0)  cz= cz+ 1;
- } while (!(cz== cx));
- cz= ord(s.sjer[cy]);
- s.sjer[cy]= chr(0);
- modinv();
- avpoing(cz);
- crep= 998;
- clsf2();
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!(invt[cx] == msg[4]));
+	cz = 0;
+	cy = 0;
+	do {
+		cy = cy + 1;
+		if (ord(s.sjer[cy]) != 0)  cz = cz + 1;
+	} while (!(cz == cx));
+	cz = ord(s.sjer[cy]);
+	s.sjer[cy] = chr(0);
+	modinv();
+	avpoing(cz);
+	crep = 998;
+	clsf2();
 }
 
 /* overlay */ void tsoulever()
 
 {
- integer cx;
+	integer cx;
 
- if (! syn)  ecr3("soulever");
- tfleche();
- if ((anyone) || (iesc))  return;
- tcoord(3);
- if (num== 0) 
- {
-  tcoord(8);
-  if (num!= 0) 
-  {
-   if (ipers> 0)  s.conf= s.conf+ 1;
-   crep= 997;
-   if ((s.mlieu== 2) && (s.iloic!= 0))  treg(s.iloic);
-  }
-  return;
- }
- if (ipers> 0)  s.conf= s.conf+ 1;
- cx= s.mlieu;
- if (s.mlieu== 16)  cx= 14;
- if (s.mlieu== 19)  cx= 15;
- crep= tabdon[asoul+(cx << 3)+pred(integer,num)];
- if (crep== 255)  crep= 997;
+	if (! syn)  ecr3("soulever");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(3);
+	if (num == 0) {
+		tcoord(8);
+		if (num != 0) {
+			if (ipers > 0)  s.conf = s.conf + 1;
+			crep = 997;
+			if ((s.mlieu == 2) && (s.iloic != 0))  treg(s.iloic);
+		}
+		return;
+	}
+	if (ipers > 0)  s.conf = s.conf + 1;
+	cx = s.mlieu;
+	if (s.mlieu == 16)  cx = 14;
+	if (s.mlieu == 19)  cx = 15;
+	crep = tabdon[asoul + (cx << 3) + pred(integer, num)];
+	if (crep == 255)  crep = 997;
 }
 
-/* overlay */ void tlire()
-{
- integer iaff;
+/* overlay */ void tlire() {
+	integer iaff;
 
- if (caff> 99)  st4(caff); else
- {
-  if (! syn)  ecr3("lire");
-  tfleche();
-  if (! (anyone) && ! (iesc)) 
-  {
-   tcoord(4);
-   if (num!= 0)  crep= 107;
-  }
- }
+	if (caff > 99)  st4(caff);
+	else {
+		if (! syn)  ecr3("lire");
+		tfleche();
+		if (!(anyone) && !(iesc)) {
+			tcoord(4);
+			if (num != 0)  crep = 107;
+		}
+	}
 }
 
-/* overlay */ void tslire()
-{
- if (s.derobj== 0)  crep= 186; else st4(s.derobj);
+/* overlay */ void tslire() {
+	if (s.derobj == 0)  crep = 186;
+	else st4(s.derobj);
 }
 
-/* overlay */ void tregarder()
-{
- integer cx;
+/* overlay */ void tregarder() {
+	integer cx;
 
- if (caff> 99) 
- {
-  crep= 103;
-  return;
- }
- if (! syn)  ecr3("regarder");
- tfleche();
- if ((anyone) || (iesc))  return;
- tcoord(5);
- if (num== 0) 
- {
-  tcoord(8);
-  crep= 131;
-  if (num!= 0) 
-  {
-   if (s.mlieu== 13) 
-   {
-    if (num== 1) 
-    {
-     crep= 164;
-     if (s.ibag!= 0)  treg(s.ibag); else
-      if (s.iboul!= 0)  treg(s.iboul);
-    }
-    else
-    {
-     crep= 193;
-     if (s.ibag!= 0)  treg(s.ibag);
-    }
-   }
-   if (s.mlieu== 14) 
-   {
-    crep= 164;
-    if (s.icave!= 0)  treg(s.icave);
-   }
-   if (s.mlieu== 17) 
-   {
-    crep= 174;
-    if (s.ivier!= 0)  treg(s.ivier);
-   }
-   if (s.mlieu== 24) 
-   {
-    crep= 131;
-    if (s.ipuit!= 0)  treg(s.ipuit);
-   }
-  }
-  return;
- }
- cx= s.mlieu;
- if (s.mlieu== 20)  cx= 17;
- if ((s.mlieu> 21) && (s.mlieu< 25))  cx= cx- 4;
- if (s.mlieu== 26)  cx= 21;
- crep= tabdon[arega+(cx*7)+pred(integer,num)];
- if ((s.mlieu== 13) && (num== 8))  crep= 126;
- if (s.mlieu== 19)  crep= 103;
- if (crep== 255)  crep= 131;
- if ((s.mlieu== 1) && (num== 1))  treg(144);
- if ((s.mlieu== 5) && (num== 3))  treg(147);
- if ((s.mlieu== 8) && (num== 3))  treg(149);
- if ((s.mlieu== 9) && (num== 2))  treg(30);
- if ((s.mlieu== 10) && (num== 3))  treg(31);
+	if (caff > 99) {
+		crep = 103;
+		return;
+	}
+	if (! syn)  ecr3("regarder");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(5);
+	if (num == 0) {
+		tcoord(8);
+		crep = 131;
+		if (num != 0) {
+			if (s.mlieu == 13) {
+				if (num == 1) {
+					crep = 164;
+					if (s.ibag != 0)  treg(s.ibag);
+					else if (s.iboul != 0)  treg(s.iboul);
+				} else {
+					crep = 193;
+					if (s.ibag != 0)  treg(s.ibag);
+				}
+			}
+			if (s.mlieu == 14) {
+				crep = 164;
+				if (s.icave != 0)  treg(s.icave);
+			}
+			if (s.mlieu == 17) {
+				crep = 174;
+				if (s.ivier != 0)  treg(s.ivier);
+			}
+			if (s.mlieu == 24) {
+				crep = 131;
+				if (s.ipuit != 0)  treg(s.ipuit);
+			}
+		}
+		return;
+	}
+	cx = s.mlieu;
+	if (s.mlieu == 20)  cx = 17;
+	if ((s.mlieu > 21) && (s.mlieu < 25))  cx = cx - 4;
+	if (s.mlieu == 26)  cx = 21;
+	crep = tabdon[arega + (cx * 7) + pred(integer, num)];
+	if ((s.mlieu == 13) && (num == 8))  crep = 126;
+	if (s.mlieu == 19)  crep = 103;
+	if (crep == 255)  crep = 131;
+	if ((s.mlieu == 1) && (num == 1))  treg(144);
+	if ((s.mlieu == 5) && (num == 3))  treg(147);
+	if ((s.mlieu == 8) && (num == 3))  treg(149);
+	if ((s.mlieu == 9) && (num == 2))  treg(30);
+	if ((s.mlieu == 10) && (num == 3))  treg(31);
 }
 
-/* overlay */ void tsregarder()
-{
- if (s.derobj!= 0)  treg(s.derobj); else crep= 186;
+/* overlay */ void tsregarder() {
+	if (s.derobj != 0)  treg(s.derobj);
+	else crep = 186;
 }
 
-/* overlay */ void tfouiller()
-{
-      const array<0,13,byte> r = {{123,104,123,131,131,123,104,131,123,123,106,123,123,107}};
- integer cx;
+/* overlay */ void tfouiller() {
+	const array<0, 13, byte> r = {{123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107}};
+	integer cx;
 
- if (caff> 99) 
- {
-  st7(caff);
-  return;
- }
- if (! syn)  ecr3("fouiller");
- tfleche();
- if (anyone || iesc)  return;
- if (s.mlieu==23) 
- {
-  crep= 1504;
-  tperd();
-  return;
- }
- tcoord(6);
- if (num== 0) 
- {
-  tcoord(7);
-  if (num!=0) 
-  {
-   cx=0;
-   do {
-    cx=cx+1;
-   } while (!((cx>6) || (num== ord(touv[cx]))));
-   if (num!=ord(touv[cx]))  crep=187; else
-   {
-    if (ipers>0)  s.conf= s.conf+3;
-    rechai(mchai);
-    if (mchai!=0) 
-    {
-     cs=0;
-     is=0;
-     fouil=true;
-     mfoudi();
-     tsuiv();
-    }
-    else crep=997;
-   }
-  }
-  else
-  {
-   tcoord(8);
-   crep= 997;
-   if (num!=0) 
-   {
-    if (ipers>0)  s.conf=s.conf+3;
-    if ((s.mlieu!=24) && (s.mlieu!=17) && (s.mlieu!=13)) 
-    {
-     if (s.mlieu==2) 
-     {
-      crep= 123;
-      if (s.iloic!=0)  treg(s.iloic);
-     }
-     if (s.mlieu==16) 
-     {
-      crep= 123;
-      if (s.icryp!=0)  treg(s.icryp);
-     }
-    }
-   }
-  }
- }
- else
- {
-  if (ipers>0)  s.conf=s.conf+ 3;
-  crep= 997;
-  if (s.mlieu < 14)  crep= r[s.mlieu];
-  if ((s.mlieu== 3) && (num== 2))  crep=162;
-  if (s.mlieu== 12) 
-  {
-   if ((num== 3) || (num== 4))  crep=162;
-   if (num== 5)  crep= 159;
-  }
-  if (s.mlieu==19)  crep=104;
-  if (s.mlieu==16)  crep=155;
- }
+	if (caff > 99) {
+		st7(caff);
+		return;
+	}
+	if (! syn)  ecr3("fouiller");
+	tfleche();
+	if (anyone || iesc)  return;
+	if (s.mlieu == 23) {
+		crep = 1504;
+		tperd();
+		return;
+	}
+	tcoord(6);
+	if (num == 0) {
+		tcoord(7);
+		if (num != 0) {
+			cx = 0;
+			do {
+				cx = cx + 1;
+			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			if (num != ord(touv[cx]))  crep = 187;
+			else {
+				if (ipers > 0)  s.conf = s.conf + 3;
+				rechai(mchai);
+				if (mchai != 0) {
+					cs = 0;
+					is = 0;
+					fouil = true;
+					mfoudi();
+					tsuiv();
+				} else crep = 997;
+			}
+		} else {
+			tcoord(8);
+			crep = 997;
+			if (num != 0) {
+				if (ipers > 0)  s.conf = s.conf + 3;
+				if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) {
+					if (s.mlieu == 2) {
+						crep = 123;
+						if (s.iloic != 0)  treg(s.iloic);
+					}
+					if (s.mlieu == 16) {
+						crep = 123;
+						if (s.icryp != 0)  treg(s.icryp);
+					}
+				}
+			}
+		}
+	} else {
+		if (ipers > 0)  s.conf = s.conf + 3;
+		crep = 997;
+		if (s.mlieu < 14)  crep = r[s.mlieu];
+		if ((s.mlieu == 3) && (num == 2))  crep = 162;
+		if (s.mlieu == 12) {
+			if ((num == 3) || (num == 4))  crep = 162;
+			if (num == 5)  crep = 159;
+		}
+		if (s.mlieu == 19)  crep = 104;
+		if (s.mlieu == 16)  crep = 155;
+	}
 }
 
-/* overlay */ void tsfouiller()
-{
- if (s.derobj!=0)  st7(s.derobj); else crep= 186;
+/* overlay */ void tsfouiller() {
+	if (s.derobj != 0)  st7(s.derobj);
+	else crep = 186;
 }
 
-/* overlay */ void touvrir()
-{
- integer cx,haz;
+/* overlay */ void touvrir() {
+	integer cx, haz;
 
- if (! syn)  ecr3("ouvrir");
- if (caff== 26) 
- {
-  if (ment!= 0) 
-  {
-   msg[4]= entrer;
-   syn= true;
-  }
-  else crep= 997;
-  return;
- }
- if (caff== 15) 
- {
-  aldepl();
-  return;
- }
- tfleche();
- if ((anyone) || (iesc))  return;
- tcoord(7);
- if (num!= 0) 
- {
-  if (ipers> 0)  s.conf= s.conf+ 2;
-  iouv= iouv+ 1;
-  cx= 0;
-  do {
-   cx= cx+ 1;
-  } while (!((cx> 6) || (ord(touv[cx])== 0) || (ord(touv[cx])== num)));
-  if (ord(touv[cx])!= num) 
-  {
-   if (!
-    (
-     ( (num== 3) && ((s.mlieu== 0) || (s.mlieu== 9) || (s.mlieu== 5) || (s.mlieu== 7)) )
-     ||
-      ((num== 4) && ((s.mlieu== 1) || (s.mlieu== 2) || (s.mlieu== 6))) ||
-      ((s.mlieu== 4) && (num== 5)) ||
-      ((num== 6) && ((s.mlieu== 7) || (s.mlieu== 10) ||
-                     (s.mlieu== 8) || (s.mlieu== 13))) ||
-      ((s.mlieu== 8) && (num== 2)) ||
-      ((s.mlieu== 12) && (num== 7)))) 
-      {
-         if (((s.mlieu> 10) && (s.mlieu< 14)) ||
-          ((s.mlieu> 6) && (s.mlieu< 10)) ||
-          (s.mlieu== 0) || (s.mlieu== 2) || (s.mlieu== 5)) 
-          {
-            haz= hazard(1, 4);
-            if (haz== 3)  parole(7, 9, 1);
-          }
-        touv[cx]= chr(num);
-        aniof(1,num);
-      }
-   cx= s.mlieu;
-   if (s.mlieu== 16)  cx= 14;
-   crep= tabdon[aouvr+ (cx* 7)+ pred(integer,num)];
-   if (crep== 254)  crep= 999;
-  }
-  else crep= 18;
- }
+	if (! syn)  ecr3("ouvrir");
+	if (caff == 26) {
+		if (ment != 0) {
+			msg[4] = entrer;
+			syn = true;
+		} else crep = 997;
+		return;
+	}
+	if (caff == 15) {
+		aldepl();
+		return;
+	}
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(7);
+	if (num != 0) {
+		if (ipers > 0)  s.conf = s.conf + 2;
+		iouv = iouv + 1;
+		cx = 0;
+		do {
+			cx = cx + 1;
+		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
+		if (ord(touv[cx]) != num) {
+			if (!
+			        (
+			            ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
+			            ||
+			            ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6))) ||
+			            ((s.mlieu == 4) && (num == 5)) ||
+			            ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) ||
+			                            (s.mlieu == 8) || (s.mlieu == 13))) ||
+			            ((s.mlieu == 8) && (num == 2)) ||
+			            ((s.mlieu == 12) && (num == 7)))) {
+				if (((s.mlieu > 10) && (s.mlieu < 14)) ||
+				        ((s.mlieu > 6) && (s.mlieu < 10)) ||
+				        (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
+					haz = hazard(1, 4);
+					if (haz == 3)  parole(7, 9, 1);
+				}
+				touv[cx] = chr(num);
+				aniof(1, num);
+			}
+			cx = s.mlieu;
+			if (s.mlieu == 16)  cx = 14;
+			crep = tabdon[aouvr + (cx * 7) + pred(integer, num)];
+			if (crep == 254)  crep = 999;
+		} else crep = 18;
+	}
 }
 
-/* overlay */ void tmettre()
-{
- integer quel;
- boolean entre;
- phrase st;
- str255 str_;
- integer i,tay;
+/* overlay */ void tmettre() {
+	integer quel;
+	boolean entre;
+	phrase st;
+	str255 str_;
+	integer i, tay;
 
- if (s.derobj== 0) 
- {
-  crep= 186;
-  return;
- }
- if (! syn)  ecr3("mettre");
- tfleche();
- if (iesc)  crep= 998;
- if ((anyone) || (iesc))  return;
- tcoord(8);
- if (num!= 0) 
- {
-  crep= 999;
-  if (caff== 13) 
-  {
-   if (num== 1) 
-   {
-    if (s.iboul!= 0)  crep= 188; else
-    {
-     s.iboul= s.derobj;
-     if (s.derobj== 141)  aniof(1,7);
-    }
-   }
-   else
-    if (s.ibag!= 0)  crep= 188; else
-    {
-     s.ibag= s.derobj;
-     if (s.derobj== 159)  aniof(1,6);
-    }
-  }
-  if (caff== 14) 
-   if (s.icave!=0)  crep= 188; else
-   {
-    s.icave= s.derobj;
-    if (s.derobj== 151) 
-    {
-     aniof(1,2);
-     aniof(1,1);
-     repon(2,165);
-     maivid();
-     parole(6, -9, 1);
-     quel= do_alert(stouinon,1);
-     if (quel==1)  {
-                      deline(582,st,tay);
-                      i= do_alert(delig,1);
-                      tesok=false;
-                      entre= ques();
-                      hide_mouse();
-                      hirs();
-                      dessine_rouleau();
-                      clsf2();
-                      clsf3();
-                      show_mouse();
-                      tinke();
-                      pendule();
-                      if (ipers!=0)  affper(ipers);
-                                  else person();
-                      menu_aff();
-                      if (entre) 
-                         {
-                           s.mlieu= 17;
-                           tmlieu(17);
-                         }
-                        else
-                         {
-                           tmlieu(s.mlieu);
-                           writepal(14);
-                           dessin(0);
-                           aniof(1,2);
-                           aniof(1,1);
-                           deline(577,st,tay);
-                           i= do_alert(delig,1);
-                           aniof(2,1);
-                           crep= 166;
-                         }
-                      affrep();
-                    }
-               else {
-                      aniof(2,1);
-                      crep= 166;
-                      tesok=true;
-                    }
-     return;
-    }
-   }
-  if (caff== 16) 
-   if (s.icryp== 0)  s.icryp= s.derobj; else crep= 188;
-  if (caff== 17) 
-   if (s.ivier!=0)  crep= 188; else
-    if (s.derobj== 143) 
-    {
-     s.ivier= 143;
-     aniof(1,1);
-    }
-    else
-    {
-     crep= 1512;
-     tperd();
-    }
-  if (caff== 24) 
-   if (s.ipuit!= 0)  crep= 188; else
-    if ((s.derobj== 140) || (s.derobj== 120)) 
-    {
-     s.ipuit= s.derobj;
-     aniof(1,1);
-    }
-    else crep= 185;
-  if (crep!= 188)  maivid();
- }
+	if (s.derobj == 0) {
+		crep = 186;
+		return;
+	}
+	if (! syn)  ecr3("mettre");
+	tfleche();
+	if (iesc)  crep = 998;
+	if ((anyone) || (iesc))  return;
+	tcoord(8);
+	if (num != 0) {
+		crep = 999;
+		if (caff == 13) {
+			if (num == 1) {
+				if (s.iboul != 0)  crep = 188;
+				else {
+					s.iboul = s.derobj;
+					if (s.derobj == 141)  aniof(1, 7);
+				}
+			} else if (s.ibag != 0)  crep = 188;
+			else {
+				s.ibag = s.derobj;
+				if (s.derobj == 159)  aniof(1, 6);
+			}
+		}
+		if (caff == 14)
+			if (s.icave != 0)  crep = 188;
+			else {
+				s.icave = s.derobj;
+				if (s.derobj == 151) {
+					aniof(1, 2);
+					aniof(1, 1);
+					repon(2, 165);
+					maivid();
+					parole(6, -9, 1);
+					quel = do_alert(stouinon, 1);
+					if (quel == 1)  {
+						deline(582, st, tay);
+						i = do_alert(delig, 1);
+						tesok = false;
+						entre = ques();
+						hide_mouse();
+						hirs();
+						dessine_rouleau();
+						clsf2();
+						clsf3();
+						show_mouse();
+						tinke();
+						pendule();
+						if (ipers != 0)  affper(ipers);
+						else person();
+						menu_aff();
+						if (entre) {
+							s.mlieu = 17;
+							tmlieu(17);
+						} else {
+							tmlieu(s.mlieu);
+							writepal(14);
+							dessin(0);
+							aniof(1, 2);
+							aniof(1, 1);
+							deline(577, st, tay);
+							i = do_alert(delig, 1);
+							aniof(2, 1);
+							crep = 166;
+						}
+						affrep();
+					} else {
+						aniof(2, 1);
+						crep = 166;
+						tesok = true;
+					}
+					return;
+				}
+			}
+		if (caff == 16)
+			if (s.icryp == 0)  s.icryp = s.derobj;
+			else crep = 188;
+		if (caff == 17)
+			if (s.ivier != 0)  crep = 188;
+			else if (s.derobj == 143) {
+				s.ivier = 143;
+				aniof(1, 1);
+			} else {
+				crep = 1512;
+				tperd();
+			}
+		if (caff == 24)
+			if (s.ipuit != 0)  crep = 188;
+			else if ((s.derobj == 140) || (s.derobj == 120)) {
+				s.ipuit = s.derobj;
+				aniof(1, 1);
+			} else crep = 185;
+		if (crep != 188)  maivid();
+	}
 }
 
-/* overlay */ void ttourner()
-{
- integer quel;
+/* overlay */ void ttourner() {
+	integer quel;
 
- if (caff> 99) 
- {
-  crep= 149;
-  return;
- }
- if (! syn)  ecr3("tourner");
- tfleche();
- if ((anyone) || (iesc))  return;
- tcoord(9);
- if (num!= 0) 
- {
-  crep= 997;
-  if ((s.mlieu== 13) && (s.ibag== 159) && (s.iboul== 141)) 
-  {
-   repon(2,167);
-   parole(7, 9, 1);
-   quel= do_alert(stouinon,1);
-   if (quel== 1)  solu= true; else crep= 168;
-  }
-  if ((s.mlieu== 17) && (s.ivier== 143)) 
-  {
-   repon(2, 175);
-   clsf3();
-   parole(6, -9, 1);
-   quel= do_alert(stouinon,1);
-   if (quel== 1) 
-   {
-    s.mlieu= 16;
-    affrep();
-   }
-   else crep= 176;
-  }
- }
+	if (caff > 99) {
+		crep = 149;
+		return;
+	}
+	if (! syn)  ecr3("tourner");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(9);
+	if (num != 0) {
+		crep = 997;
+		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
+			repon(2, 167);
+			parole(7, 9, 1);
+			quel = do_alert(stouinon, 1);
+			if (quel == 1)  solu = true;
+			else crep = 168;
+		}
+		if ((s.mlieu == 17) && (s.ivier == 143)) {
+			repon(2, 175);
+			clsf3();
+			parole(6, -9, 1);
+			quel = do_alert(stouinon, 1);
+			if (quel == 1) {
+				s.mlieu = 16;
+				affrep();
+			} else crep = 176;
+		}
+	}
 }
 
-/* overlay */ void tcacher()
-{
- if (! syn)  ecr3("se cacher");
- tfleche();
- if (! (anyone) && ! (iesc)) 
- {
-  tcoord(10);
-  if (num== 0)  cache= false; else
-  {
-   cache= true;
-   crep= 999;
-  }
- }
+/* overlay */ void tcacher() {
+	if (! syn)  ecr3("se cacher");
+	tfleche();
+	if (!(anyone) && !(iesc)) {
+		tcoord(10);
+		if (num == 0)  cache = false;
+		else {
+			cache = true;
+			crep = 999;
+		}
+	}
 }
 
-/* overlay */ void tattacher()
-{
- if (s.derobj== 0)  crep= 186; else
- {
-  if (! syn)  ecr3("attacher");
-  tfleche();
-  if (! (anyone) && ! (iesc)) 
-  {
-   tcoord(8);
-   crep= 997;
-   if ((num!= 0) && (s.mlieu== 24)) 
-   {
-    crep= 999;
-    if ((s.derobj== 120) || (s.derobj== 140)) 
-    {
-     s.ipuit= s.derobj;
-     aniof(1,1);
-    }
-    else crep= 185;
-    maivid();
-   }
-  }
- }
+/* overlay */ void tattacher() {
+	if (s.derobj == 0)  crep = 186;
+	else {
+		if (! syn)  ecr3("attacher");
+		tfleche();
+		if (!(anyone) && !(iesc)) {
+			tcoord(8);
+			crep = 997;
+			if ((num != 0) && (s.mlieu == 24)) {
+				crep = 999;
+				if ((s.derobj == 120) || (s.derobj == 140)) {
+					s.ipuit = s.derobj;
+					aniof(1, 1);
+				} else crep = 185;
+				maivid();
+			}
+		}
+	}
 }
 
-/* overlay */ void tfermer()
-{
- integer cx,chai;
+/* overlay */ void tfermer() {
+	integer cx, chai;
 
- if (! syn)  ecr3("fermer");
- if (caff< 26) 
- {
-  tfleche();
-  if (iesc)  crep= 998;
-  if ((anyone) || (iesc))  return;
-  tcoord(7);
-  if (num!= 0) 
-  {
-   cx= 0;
-   do {
-    cx= cx+ 1;
-   } while (!((cx> 6) || (num== ord(touv[cx]))));
-   if (num== ord(touv[cx])) 
-   {
-    aniof(2,num);
-    crep= 998;
-    touv[cx]= chr(0);
-    iouv= iouv- 1;
-    if (iouv< 0)  iouv= 0;
-    chai= 9999;
-    rechai(chai);
-    if (mchai== chai)  mchai= 0;
-   }
-   else crep= 187;
-  }
- }
- if (caff== 26)  crep= 999;
+	if (! syn)  ecr3("fermer");
+	if (caff < 26) {
+		tfleche();
+		if (iesc)  crep = 998;
+		if ((anyone) || (iesc))  return;
+		tcoord(7);
+		if (num != 0) {
+			cx = 0;
+			do {
+				cx = cx + 1;
+			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			if (num == ord(touv[cx])) {
+				aniof(2, num);
+				crep = 998;
+				touv[cx] = chr(0);
+				iouv = iouv - 1;
+				if (iouv < 0)  iouv = 0;
+				chai = 9999;
+				rechai(chai);
+				if (mchai == chai)  mchai = 0;
+			} else crep = 187;
+		}
+	}
+	if (caff == 26)  crep = 999;
 }
 
-/* overlay */ void tfrapper()
-{
- integer l,p,haz;
+/* overlay */ void tfrapper() {
+	integer l, p, haz;
 
- if (! syn)  ecr3("frapper");
- if (s.mlieu== 15) 
- {
-  l= do_alert("[1][ | Avant, utilisez le menu DEP...][ok]",1);
-  return;
- }
- if (s.mlieu< 25) 
- {
-  tfleche();
-  if (! (anyone) && ! (iesc)) 
-   if ((s.mlieu< 19) && (s.mlieu!= 15))  crep= 133; else crep= 997;
-  return;
- }
- if (s.mlieu== 26) 
- {
-  haz= (hazard(0, 8))- 4;
-  parole(11, haz, 1);
-  ecfren(p,haz,s.conf,ment);
-  l= ment;
-  if (l!= 0) 
-   if (p!= -500) 
-   {
-    if (haz> p)  crep= 190; else
-    {
-     becfren(l);
-     frap();
-    }
-   }
-   else frap();
-  if (ment== 8)  crep= 190;
- }
+	if (! syn)  ecr3("frapper");
+	if (s.mlieu == 15) {
+		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);
+		return;
+	}
+	if (s.mlieu < 25) {
+		tfleche();
+		if (!(anyone) && !(iesc))
+			if ((s.mlieu < 19) && (s.mlieu != 15))  crep = 133;
+			else crep = 997;
+		return;
+	}
+	if (s.mlieu == 26) {
+		haz = (hazard(0, 8)) - 4;
+		parole(11, haz, 1);
+		ecfren(p, haz, s.conf, ment);
+		l = ment;
+		if (l != 0)
+			if (p != -500) {
+				if (haz > p)  crep = 190;
+				else {
+					becfren(l);
+					frap();
+				}
+			} else frap();
+		if (ment == 8)  crep = 190;
+	}
 }
 
-/* overlay */ void tposer()
-{
- integer cx,chai;
+/* overlay */ void tposer() {
+	integer cx, chai;
 
- if (! syn)  ecr3("poser");
- if (s.derobj== 0)  crep= 186; else
- {
-  if (caff> 99) 
-  {
-    crep= 999;
-    ajchai();
-    if (crep!= 192)  maivid();
-    return;
-  }
-  tfleche();
-  if ((anyone) || (iesc))  return;
-  tcoord(7);
-  crep= 124;
-  if (num!= 0) 
-  {
-   rechai(chai);
-   if (chai== 0)  crep= 997; else
-   {
-    cx= 0;
-    do {
-     cx= cx+ 1;
-    } while (!((cx> 6) || (num== ord(touv[cx]))));
-    if (num!= ord(touv[cx]))  crep= 187; else
-    {
-     mchai= chai;
-     crep= 999;
-    }
-   }
-  }
-  else
-  {
-   tcoord(8);
-   if (num!= 0) 
-   {
-    crep= 998;
-    if (caff== 2) 
-     if (s.iloic!= 0)  crep= 188; else s.iloic= s.derobj;
-    if (caff== 13) 
-    {
-     if (num== 1) 
-     {
-      if (s.iboul!= 0)  crep= 188; else s.iboul= s.derobj;
-     }
-     else
-      if (s.ibag!= 0)  crep= 188; else s.ibag= s.derobj;
-    }
-    if (caff== 16) 
-     if (s.icryp!= 0)  crep= 188; else s.icryp= s.derobj;
-    if (caff== 24)  crep= 185;
-    if ((caff== 14) || (caff== 17))  crep= 124;
-   }
-   else
-   {
-    crep= 124;
-    if (caff== 24) 
-    {
-     tcoord(5);
-     if (num!= 0)  crep= 185;
-    }
-   }
-  }
-  if (caff== 23)  crep= 185;
-  if ((crep== 999) || (crep== 185) || (crep== 998)) 
-  {
-   if (crep== 999)  ajchai();
-   if (crep!= 192)  maivid();
-  }
- }
+	if (! syn)  ecr3("poser");
+	if (s.derobj == 0)  crep = 186;
+	else {
+		if (caff > 99) {
+			crep = 999;
+			ajchai();
+			if (crep != 192)  maivid();
+			return;
+		}
+		tfleche();
+		if ((anyone) || (iesc))  return;
+		tcoord(7);
+		crep = 124;
+		if (num != 0) {
+			rechai(chai);
+			if (chai == 0)  crep = 997;
+			else {
+				cx = 0;
+				do {
+					cx = cx + 1;
+				} while (!((cx > 6) || (num == ord(touv[cx]))));
+				if (num != ord(touv[cx]))  crep = 187;
+				else {
+					mchai = chai;
+					crep = 999;
+				}
+			}
+		} else {
+			tcoord(8);
+			if (num != 0) {
+				crep = 998;
+				if (caff == 2)
+					if (s.iloic != 0)  crep = 188;
+					else s.iloic = s.derobj;
+				if (caff == 13) {
+					if (num == 1) {
+						if (s.iboul != 0)  crep = 188;
+						else s.iboul = s.derobj;
+					} else if (s.ibag != 0)  crep = 188;
+					else s.ibag = s.derobj;
+				}
+				if (caff == 16)
+					if (s.icryp != 0)  crep = 188;
+					else s.icryp = s.derobj;
+				if (caff == 24)  crep = 185;
+				if ((caff == 14) || (caff == 17))  crep = 124;
+			} else {
+				crep = 124;
+				if (caff == 24) {
+					tcoord(5);
+					if (num != 0)  crep = 185;
+				}
+			}
+		}
+		if (caff == 23)  crep = 185;
+		if ((crep == 999) || (crep == 185) || (crep == 998)) {
+			if (crep == 999)  ajchai();
+			if (crep != 192)  maivid();
+		}
+	}
 }
 
-/* overlay */ void tecouter()
-{
- integer l,p,haz,j,h,m;
+/* overlay */ void tecouter() {
+	integer l, p, haz, j, h, m;
 
- if (s.mlieu!= 26)  crep= 101; else
- {
-  if (ipers!= 0)  s.conf= s.conf+ 1;
-  ecfren(p,haz,s.conf,ment);
-  l= ment;
-  if (l!= 0) 
-   if (p!= -500) 
-   {
-    if (haz> p)  crep= 101; else
-    {
-     becfren(l);
-     calch(j,h,m);
-     haz= hazard(1,100);
-     if ((h>= 0) && (h< 8)) 
-     {
-      if (haz> 30)  crep= 101; else crep= 178;
-     }
-     else
-      if (haz> 70)  crep= 101; else crep= 178;
-    }
-   }
-   else crep= 178;
- }
+	if (s.mlieu != 26)  crep = 101;
+	else {
+		if (ipers != 0)  s.conf = s.conf + 1;
+		ecfren(p, haz, s.conf, ment);
+		l = ment;
+		if (l != 0)
+			if (p != -500) {
+				if (haz > p)  crep = 101;
+				else {
+					becfren(l);
+					calch(j, h, m);
+					haz = hazard(1, 100);
+					if ((h >= 0) && (h < 8)) {
+						if (haz > 30)  crep = 101;
+						else crep = 178;
+					} else if (haz > 70)  crep = 101;
+					else crep = 178;
+				}
+			} else crep = 178;
+	}
 }
 
-/* overlay */ void tmanger()
-{
- integer j,h,m;
+/* overlay */ void tmanger() {
+	integer j, h, m;
 
- if ((s.mlieu> 15) && (s.mlieu< 26)) 
-  crep= 148;
- else
- {
-  tsort();
-  s.mlieu= 10;
-  caff= 10;
-  debloc(s.mlieu);
-  tmlieu(s.mlieu);
-  calch(j,h,m);
-  if ((h== 12) || (h== 13) || (h== 19)) 
-  {
-   s.conf= s.conf- (s.conf / 7);
-   if (h== 12) 
-    if (m== 0)  h= 4; else h= 3;
-   if ((h== 13) || (h== 19)) 
-    if (m== 0)  h= 2; else h= 1;
-   jh= jh+ h;
-   crep= 135;
-   tinke();
-  }
-  else crep= 134;
- }
+	if ((s.mlieu > 15) && (s.mlieu < 26))
+		crep = 148;
+	else {
+		tsort();
+		s.mlieu = 10;
+		caff = 10;
+		debloc(s.mlieu);
+		tmlieu(s.mlieu);
+		calch(j, h, m);
+		if ((h == 12) || (h == 13) || (h == 19)) {
+			s.conf = s.conf - (s.conf / 7);
+			if (h == 12)
+				if (m == 0)  h = 4;
+				else h = 3;
+			if ((h == 13) || (h == 19))
+				if (m == 0)  h = 2;
+				else h = 1;
+			jh = jh + h;
+			crep = 135;
+			tinke();
+		} else crep = 134;
+	}
 }
 
-/* overlay */ void tentrer()
-{
- integer x, z;
+/* overlay */ void tentrer() {
+	integer x, z;
 
- if ((s.mlieu== 21) || (s.mlieu== 22)) 
- {
-  t1sama();
-  tmlieu(s.mlieu);
- }
- else
-  if (s.mlieu== 15)  aldepl(); else
-   if (ment== 0)  crep= 997; else
-   {
-    if ((ment== 9) && (s.derobj!= 136)) 
-    {
-     crep= 189;
-     s.teauto[8]= '*';
-    }
-    else
-    {
-     if (! blo)  t11(ment, z);
-     if (z!= 0) 
-     {
-      if ((ment== 3) || (ment== 7))  crep= 179; else
-      {
-       x= (hazard(0, 10))- 5;
-       parole(7, x, 1);
-       aniof(1,1);
-/*       tkey(5,32000);*/
-       tip(z,x);
-       s.conf= s.conf+ 1;
-       s.mlieu= 15;
-       msg[3]= discut;
-       msg[4]= disc[x];
-       syn= true;
-       if (ment== 9) 
-       {
-        col= true;
-        caff= 70;
-        afdes(0);
-        repon(2,caff);
-       }
-       else col= false;
-       debloc(ment);
-       ment= 0;
-      }
-     }
-     else
-     {
-      x= (hazard(0, 10))- 5;
-      parole(7, x, 1);
-      aniof(1,1);
-/*      tkey(1,32000);*/
-      s.mlieu= ment;
-      affrep();
-      debloc(s.mlieu);
-      tmlieu(s.mlieu);
-      ment= 0;
-      mpers= 0;
-      ipers= 0;
-     }
-    }
-   }
+	if ((s.mlieu == 21) || (s.mlieu == 22)) {
+		t1sama();
+		tmlieu(s.mlieu);
+	} else if (s.mlieu == 15)  aldepl();
+	else if (ment == 0)  crep = 997;
+	else {
+		if ((ment == 9) && (s.derobj != 136)) {
+			crep = 189;
+			s.teauto[8] = '*';
+		} else {
+			if (! blo)  t11(ment, z);
+			if (z != 0) {
+				if ((ment == 3) || (ment == 7))  crep = 179;
+				else {
+					x = (hazard(0, 10)) - 5;
+					parole(7, x, 1);
+					aniof(1, 1);
+					/*       tkey(5,32000);*/
+					tip(z, x);
+					s.conf = s.conf + 1;
+					s.mlieu = 15;
+					msg[3] = discut;
+					msg[4] = disc[x];
+					syn = true;
+					if (ment == 9) {
+						col = true;
+						caff = 70;
+						afdes(0);
+						repon(2, caff);
+					} else col = false;
+					debloc(ment);
+					ment = 0;
+				}
+			} else {
+				x = (hazard(0, 10)) - 5;
+				parole(7, x, 1);
+				aniof(1, 1);
+				/*      tkey(1,32000);*/
+				s.mlieu = ment;
+				affrep();
+				debloc(s.mlieu);
+				tmlieu(s.mlieu);
+				ment = 0;
+				mpers = 0;
+				ipers = 0;
+			}
+		}
+	}
 }
 
-/* overlay */ void tdormir()
-{
- const char m1[] = "D‚sirez-vous vous r‚veiller?";
- integer z,j,h,m,quel;
+/* overlay */ void tdormir() {
+	const char m1[] = "D‚sirez-vous vous r‚veiller?";
+	integer z, j, h, m, quel;
 
- if ((s.mlieu> 15) && (s.mlieu< 26)) 
- {
-  crep= 148;
-  return;
- }
- if (s.mlieu != 0) 
- {
-  tsort();
-  s.mlieu= 0;
-  affrep();
-  afdes(0);
-  debloc(s.mlieu);
-  tmlieu(s.mlieu);
- }
- clsf3();
- clsf2();
- ecrf2();
- ecr2(m1);
- calch(j,h,m);
- do {
-   if (h< 8) 
-     {
-       s.conf= s.conf- (s.conf / 20);
-       z= (7- h)* 2;
-       if (m== 30)  z= z- 1;
-       jh= jh+ z;
-       h= 7;
-     }
-   jh= jh+ 2;
-   h= h+ 1;
-   if (h> 23)  h= 0;
-   tinke();
-   quel= do_alert(stouinon,1);
-   anyone= false;
- } while (!(quel== 1));
- crep= 998;
- num= 0;
+	if ((s.mlieu > 15) && (s.mlieu < 26)) {
+		crep = 148;
+		return;
+	}
+	if (s.mlieu != 0) {
+		tsort();
+		s.mlieu = 0;
+		affrep();
+		afdes(0);
+		debloc(s.mlieu);
+		tmlieu(s.mlieu);
+	}
+	clsf3();
+	clsf2();
+	ecrf2();
+	ecr2(m1);
+	calch(j, h, m);
+	do {
+		if (h < 8) {
+			s.conf = s.conf - (s.conf / 20);
+			z = (7 - h) * 2;
+			if (m == 30)  z = z - 1;
+			jh = jh + z;
+			h = 7;
+		}
+		jh = jh + 2;
+		h = h + 1;
+		if (h > 23)  h = 0;
+		tinke();
+		quel = do_alert(stouinon, 1);
+		anyone = false;
+	} while (!(quel == 1));
+	crep = 998;
+	num = 0;
 }
 
-/* overlay */ void tdefoncer()
-{
- if (! syn)  ecr3("d‚foncer");
- if (caff< 25)  tfleche();
- if ((! anyone) && (! iesc)) 
-    if (s.mlieu!= 26)  crep= 997; else
-   {
-     crep= 143;
-     s.conf= s.conf+ 2;
-   }
+/* overlay */ void tdefoncer() {
+	if (! syn)  ecr3("d‚foncer");
+	if (caff < 25)  tfleche();
+	if ((! anyone) && (! iesc))
+		if (s.mlieu != 26)  crep = 997;
+		else {
+			crep = 143;
+			s.conf = s.conf + 2;
+		}
 }
 
-/* overlay */ void tsortir()
-{
- integer lx;
+/* overlay */ void tsortir() {
+	integer lx;
 
- tsort();
- crep= 0;
- if ((s.mlieu== 19) || (s.mlieu== 21) || (s.mlieu== 22)
- || (s.mlieu== 24))  crep= 997; else
- {
-  if ((s.mlieu< 16) || (s.mlieu== 26))  lx= 10;
-  if ((s.mlieu== 10) || (s.mlieu== 20))  lx= 21;
-  if ((s.mlieu< 10) || (s.mlieu== 13))  lx= 15;
-  if (s.mlieu== 16) 
-  {
-   lx= 17;
-   crep= 176;
-  }
-  if (s.mlieu== 17)  t23coul(lx);
-  if (s.mlieu== 23)  lx= 24;
-  if (crep!= 997)  s.mlieu= lx;
-  caff= lx;
-  if (crep== 0)  crep= lx;
-  debloc(lx);
-  tmlieu(lx);
- }
+	tsort();
+	crep = 0;
+	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)
+	        || (s.mlieu == 24))  crep = 997;
+	else {
+		if ((s.mlieu < 16) || (s.mlieu == 26))  lx = 10;
+		if ((s.mlieu == 10) || (s.mlieu == 20))  lx = 21;
+		if ((s.mlieu < 10) || (s.mlieu == 13))  lx = 15;
+		if (s.mlieu == 16) {
+			lx = 17;
+			crep = 176;
+		}
+		if (s.mlieu == 17)  t23coul(lx);
+		if (s.mlieu == 23)  lx = 24;
+		if (crep != 997)  s.mlieu = lx;
+		caff = lx;
+		if (crep == 0)  crep = lx;
+		debloc(lx);
+		tmlieu(lx);
+	}
 }
 
-/* overlay */ void tattendre()
-{
- integer quel;
+/* overlay */ void tattendre() {
+	integer quel;
 
- mpers= 0;
- clsf3();
- do {
-   jh= jh+ 1;
-   tinke();
-   if (! blo)  t11(s.mlieu, quel);
-   if ((ipers!= 0) && (mpers== 0)) 
-   {
-     crep= 998;
-     if ((s.mlieu== 13) || (s.mlieu== 14))  cavegre();
-     if ((s.mlieu> 0) && (s.mlieu< 10))  anyone= true;
-     mpers= ipers;
-     if (! anyone)  tinke();
-     return;
-   }
-   repon(2,102);
-   quel= do_alert(stouinon,1);
- } while (!(quel== 2));
- crep= 998;
- if (! anyone)  tinke();
+	mpers = 0;
+	clsf3();
+	do {
+		jh = jh + 1;
+		tinke();
+		if (! blo)  t11(s.mlieu, quel);
+		if ((ipers != 0) && (mpers == 0)) {
+			crep = 998;
+			if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
+			if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+			mpers = ipers;
+			if (! anyone)  tinke();
+			return;
+		}
+		repon(2, 102);
+		quel = do_alert(stouinon, 1);
+	} while (!(quel == 2));
+	crep = 998;
+	if (! anyone)  tinke();
 }
 
-/* overlay */ void tsonder()
-{
- if (! syn)  ecr3("sonder");
- if (caff< 27) 
- {
-  tfleche();
-  if (! (anyone) && (! iesc))  crep= 145;
-  num= 0;
- }
+/* overlay */ void tsonder() {
+	if (! syn)  ecr3("sonder");
+	if (caff < 27) {
+		tfleche();
+		if (!(anyone) && (! iesc))  crep = 145;
+		num = 0;
+	}
 }
 
 /* overlay */ void tparler()
 
 {
-                               array<1,46,boolean> te;
-       integer ix, cy, cx, max, haz, suj, co,lig,icm,
-            i, tay, choi, x, y, c;
-                              char tou;
-                              array<1,46,varying_string<40> > lib;
-                               phrase st;
-                                boolean f;
+	array<1, 46, boolean> te;
+	integer ix, cy, cx, max, haz, suj, co, lig, icm,
+	        i, tay, choi, x, y, c;
+	char tou;
+	array<1, 46, varying_string<40> > lib;
+	phrase st;
+	boolean f;
 
 
 
- finfouil();
- if (col)  suj= 128; else
-  {
-    cx= 0;
-    do {
-      cx= cx+ 1;
-    } while (!(disc[cx]== msg[4]));
-    caff= 69+ cx;
-    afdes(0);
-    repon(2,caff);
-    suj= caff+ 60;
-  }
- tkey1(false);
- mennor();
- hide_mouse();
- hirs();
- premtet();
- sparl(0,suj);
- hirs();
- for( ix= 1; ix <= 46; ix ++) te[ix]= false;
- for( ix=1; ix <= 45; ix ++)
-     {
-       deline(ix+c_tparler,st,tay);
-       lib[ix]= delig;
-       for( i=tay; i <= 40; i ++) lib[ix]=lib[ix]+' ';
-     }
- lib[46]=lib[45];
- lib[45]=' ';
- show_mouse();
- do {
-   choi= 0;
-   icm= 0;
-   co= 0;
-   lig= 0;
-   do {
-     icm= succ(integer, icm );
-     putxy(co,lig);
-     if (s.teauto[icm]=='*') 
-     if (te[icm])  writetp(lib[icm],1);
-                  else writetp(lib[icm],0);
-     if (icm==23)  {
-                      lig= 0;
-                      co= 320;
-                    }
-               else lig= lig + 8;
-   } while (!(icm==42));
-   putxy(320,176);
-   writetp(lib[46],0);
-   tou= '\0';
-   do {
-     mov_mouse(f,tou);
-/*     if keypressed then read(kbd,tou);*/
-     read_pos_mouse(x,y,c);
-     x= x *(3-res);
-     if (x>319)  cx= 41; else cx= 1;
-     cy= succ(integer,(cardinal)y >> 3);                    /* 0-199 => 1-25 */
-     if ((cy>23) || ((cx==41) && (set::of(range(20,22), eos).has(cy)))) 
-             {
-               if (choi!=0) 
-                  {
-                    lig= ((choi-1) % 23) << 3;
-                    if (choi>23)  co= 320; else co= 0;
-                    putxy(co,lig);
-                    if (te[choi])  writetp(lib[choi],0);
-                                else writetp(lib[choi],1);
-                    te[choi]= ! te[choi];
-                    choi= 0;
-                  }
-             }
-        else {
-               ix= cy;
-               if (cx==41)  ix= ix+23;
-               if (ix!=choi) 
-                  {
-                    if (choi!=0) 
-                       {
-                         lig= ((choi-1) % 23) << 3;
-                         if (choi>23)  co= 320; else co= 0;
-                         putxy(co,lig);
-                         if (te[choi])  writetp(lib[choi],0);
-                                     else writetp(lib[choi],1);
-                         te[choi]= ! te[choi];
-                       }
-                    if ((s.teauto[ix]=='*') || (ix==46)) 
-                       {
-                         lig= ((ix-1) % 23) << 3;
-                         if (ix>23)  co= 320; else co= 0;
-                         putxy(co,lig);
-                         if (te[ix])  writetp(lib[ix],0);
-                                   else writetp(lib[ix],1);
-                         te[ix]= ! te[ix];
-                         choi= ix;
-                       }
-                      else choi= 0;
-                  }
-             }
-   } while (!((tou=='\15') || ( ((c!=0) || clic) && (choi!=0))));
-   clic=false;
-   if (choi!=46) 
-      {
-        ix= choi-1;
-        if (col) 
-           {
-             col= false;
-             s.mlieu= 15;
-             if (iouv> 0)  max= 8; else max= 4;
-             haz= hazard(1,max);
-             if (haz== 2)  suj= 129; else
-                {
-                  suj= 138;
-                  s.conf= s.conf+ (3* (s.conf / 10));
-                }
-           }
-          else
-           if (nbrep[caff- 69]< nbrepm[caff- 69]) 
-           {
-             suj= tabdon[arep+ (ix << 3)+ (caff- 70)];
-             s.conf= s.conf+ tabdon[arcf+ ix];
-             nbrep[caff- 69]= nbrep[caff- 69]+ 1;
-           }
-          else
-           {
-             s.conf= s.conf+ 3;
-             suj= 139;
-           }
-        hide_mouse();
-        hirs();
-        premtet();
-        sparl(0, suj);
-        show_mouse();
-        if ((suj== 84) || (suj== 86)) 
-           {
-             s.pourc[5]= '*';
-             s.teauto[7]= '*';
-           }
-        if ((suj== 106) || (suj== 108) || (suj== 94)) 
-           {
-             for( ix= 29; ix <= 31; ix ++) s.teauto[ix]= '*';
-             s.pourc[7]= '*';
-           }
-        if (suj== 70) 
-           {
-             s.pourc[8]= '*';
-             s.teauto[32]= '*';
-           }
-        hide_mouse();
-        hirs();
-        show_mouse();
-      }
-    } while (!((choi== 46) || (suj== 138)));
- if (col) 
- {
-  s.conf= s.conf+ (3* (s.conf / 10));
-  hide_mouse();
-  hirs();
-  premtet();
-  sparl(0, 138);
-  show_mouse();
-  col= false;
-  s.mlieu= 15;
- }
- ctrm= 0;
- hide_mouse();
- hirs();
- dessine_rouleau();
- show_mouse();
- affper(ipers);
- tinke();
- pendule();
- affrep();
-/* chech;*/
- tmlieu(s.mlieu);
- clsf3();
+	finfouil();
+	if (col)  suj = 128;
+	else {
+		cx = 0;
+		do {
+			cx = cx + 1;
+		} while (!(disc[cx] == msg[4]));
+		caff = 69 + cx;
+		afdes(0);
+		repon(2, caff);
+		suj = caff + 60;
+	}
+	tkey1(false);
+	mennor();
+	hide_mouse();
+	hirs();
+	premtet();
+	sparl(0, suj);
+	hirs();
+	for (ix = 1; ix <= 46; ix ++) te[ix] = false;
+	for (ix = 1; ix <= 45; ix ++) {
+		deline(ix + c_tparler, st, tay);
+		lib[ix] = delig;
+		for (i = tay; i <= 40; i ++) lib[ix] = lib[ix] + ' ';
+	}
+	lib[46] = lib[45];
+	lib[45] = ' ';
+	show_mouse();
+	do {
+		choi = 0;
+		icm = 0;
+		co = 0;
+		lig = 0;
+		do {
+			icm = succ(integer, icm);
+			putxy(co, lig);
+			if (s.teauto[icm] == '*')
+				if (te[icm])  writetp(lib[icm], 1);
+				else writetp(lib[icm], 0);
+			if (icm == 23)  {
+				lig = 0;
+				co = 320;
+			} else lig = lig + 8;
+		} while (!(icm == 42));
+		putxy(320, 176);
+		writetp(lib[46], 0);
+		tou = '\0';
+		do {
+			mov_mouse(f, tou);
+			/*     if keypressed then read(kbd,tou);*/
+			read_pos_mouse(x, y, c);
+			x = x * (3 - res);
+			if (x > 319)  cx = 41;
+			else cx = 1;
+			cy = succ(integer, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
+			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
+				if (choi != 0) {
+					lig = ((choi - 1) % 23) << 3;
+					if (choi > 23)  co = 320;
+					else co = 0;
+					putxy(co, lig);
+					if (te[choi])  writetp(lib[choi], 0);
+					else writetp(lib[choi], 1);
+					te[choi] = ! te[choi];
+					choi = 0;
+				}
+			} else {
+				ix = cy;
+				if (cx == 41)  ix = ix + 23;
+				if (ix != choi) {
+					if (choi != 0) {
+						lig = ((choi - 1) % 23) << 3;
+						if (choi > 23)  co = 320;
+						else co = 0;
+						putxy(co, lig);
+						if (te[choi])  writetp(lib[choi], 0);
+						else writetp(lib[choi], 1);
+						te[choi] = ! te[choi];
+					}
+					if ((s.teauto[ix] == '*') || (ix == 46)) {
+						lig = ((ix - 1) % 23) << 3;
+						if (ix > 23)  co = 320;
+						else co = 0;
+						putxy(co, lig);
+						if (te[ix])  writetp(lib[ix], 0);
+						else writetp(lib[ix], 1);
+						te[ix] = ! te[ix];
+						choi = ix;
+					} else choi = 0;
+				}
+			}
+		} while (!((tou == '\15') || (((c != 0) || clic) && (choi != 0))));
+		clic = false;
+		if (choi != 46) {
+			ix = choi - 1;
+			if (col) {
+				col = false;
+				s.mlieu = 15;
+				if (iouv > 0)  max = 8;
+				else max = 4;
+				haz = hazard(1, max);
+				if (haz == 2)  suj = 129;
+				else {
+					suj = 138;
+					s.conf = s.conf + (3 * (s.conf / 10));
+				}
+			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
+				suj = tabdon[arep + (ix << 3) + (caff - 70)];
+				s.conf = s.conf + tabdon[arcf + ix];
+				nbrep[caff - 69] = nbrep[caff - 69] + 1;
+			} else {
+				s.conf = s.conf + 3;
+				suj = 139;
+			}
+			hide_mouse();
+			hirs();
+			premtet();
+			sparl(0, suj);
+			show_mouse();
+			if ((suj == 84) || (suj == 86)) {
+				s.pourc[5] = '*';
+				s.teauto[7] = '*';
+			}
+			if ((suj == 106) || (suj == 108) || (suj == 94)) {
+				for (ix = 29; ix <= 31; ix ++) s.teauto[ix] = '*';
+				s.pourc[7] = '*';
+			}
+			if (suj == 70) {
+				s.pourc[8] = '*';
+				s.teauto[32] = '*';
+			}
+			hide_mouse();
+			hirs();
+			show_mouse();
+		}
+	} while (!((choi == 46) || (suj == 138)));
+	if (col) {
+		s.conf = s.conf + (3 * (s.conf / 10));
+		hide_mouse();
+		hirs();
+		premtet();
+		sparl(0, 138);
+		show_mouse();
+		col = false;
+		s.mlieu = 15;
+	}
+	ctrm = 0;
+	hide_mouse();
+	hirs();
+	dessine_rouleau();
+	show_mouse();
+	affper(ipers);
+	tinke();
+	pendule();
+	affrep();
+	/* chech;*/
+	tmlieu(s.mlieu);
+	clsf3();
 }
 
-/* overlay */ void tsentir()
-{
- crep= 119;
- if (caff< 26) 
- {
-  if (! syn)  ecr3("sentir");
-  tfleche();
-  if (! (anyone) && ! (iesc)) 
-   if (caff== 16)  crep= 153;
- }
- else
- if (caff== 123)  crep= 110;
- num= 0;
+/* overlay */ void tsentir() {
+	crep = 119;
+	if (caff < 26) {
+		if (! syn)  ecr3("sentir");
+		tfleche();
+		if (!(anyone) && !(iesc))
+			if (caff == 16)  crep = 153;
+	} else if (caff == 123)  crep = 110;
+	num = 0;
 }
 
-/* overlay */ void tgratter()
-{
- crep= 155;
- if (caff< 27) 
- {
-  if (! syn)  ecr3("gratter");
-  tfleche();
- }
- num= 0;
+/* overlay */ void tgratter() {
+	crep = 155;
+	if (caff < 27) {
+		if (! syn)  ecr3("gratter");
+		tfleche();
+	}
+	num = 0;
 }
 
 /* NIVEAU 2 */
-/* overlay */ void tmaj1()             /* Le jeu est termin‚ !!! */
-{
- arret= true;
- tlu(13,152);
- maivid();
- clsf1();
- clsf2();
- clsf3();
- repon(9,1509);
- tkey1(false);
- hide_mouse();
- caff= 70;
- taffich();
- hirs();
- premtet();
- sparl(0,141);
- show_mouse();
- clsf1();
- repon(9,1509);
- repon(2,142);
- tkey1(false);
- caff= 32;
- afdes(0);
- repon(6,34);
- repon(2,35);
- musique(0);
- tkey1(false);
- messint(2036);
- tkey1(false);
- inzon();
+/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */
+	arret = true;
+	tlu(13, 152);
+	maivid();
+	clsf1();
+	clsf2();
+	clsf3();
+	repon(9, 1509);
+	tkey1(false);
+	hide_mouse();
+	caff = 70;
+	taffich();
+	hirs();
+	premtet();
+	sparl(0, 141);
+	show_mouse();
+	clsf1();
+	repon(9, 1509);
+	repon(2, 142);
+	tkey1(false);
+	caff = 32;
+	afdes(0);
+	repon(6, 34);
+	repon(2, 35);
+	musique(0);
+	tkey1(false);
+	messint(2036);
+	tkey1(false);
+	inzon();
 }
 
-/* overlay */ void tencore()           /* Perdu !!! */
-{
- integer quel;
+/* overlay */ void tencore() {         /* Perdu !!! */
+	integer quel;
 
- clsf2();
- musique(0);
- tkey1(false);
- maivid();
- inzon();
- dprog();
- vh= 10;
- vm= 0;
- vj= 0;
- min= 0;
- heu= 10;
- jou= 0;
- repon(2,180);
- quel= do_alert(stouinon,1);
- arret= (quel!=1);
+	clsf2();
+	musique(0);
+	tkey1(false);
+	maivid();
+	inzon();
+	dprog();
+	vh = 10;
+	vm = 0;
+	vj = 0;
+	min = 0;
+	heu = 10;
+	jou = 0;
+	repon(2, 180);
+	quel = do_alert(stouinon, 1);
+	arret = (quel != 1);
 }
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
index c3a45fe..d059fc3 100644
--- a/engines/mortevielle/alert.h
+++ b/engines/mortevielle/alert.h
@@ -2,213 +2,196 @@
 
 
 const integer nligne = 7;
-const matrix<1,2,1,3,integer> coord
-      = {{ {{150, 72, 103}},
-         {{143, 107, 183}} }};
-
-
-
-static void decod(str255 s, integer& nbc,integer& nbl,integer& col, str255& c, str30& cs)
-    {
-          integer i,k;
-          boolean v;
-
-      val(s[2],nbc,i);
-      c= "";
-      nbl= 0; i= 5; k= 0;
-      v=true; col=0;
-
-      while (s[i]!=']') 
-        {
-          c=c+s[i];
-          if ((s[i]=='|') || (s[i+1]==']')) 
-             {
-               if (k>col)  col=k;
-               k= 0;
-               nbl=nbl+1;
-             }
-           else if (s[i]!=' ')  v=false;
-          i=i+1;
-          k=k+1;
-        }
-      if (v)  {
-                  c="";
-                  col=20;
-                }
-           else {
-                  c=c+']';
-                  col=col+6;
-                }
-      i=i+1;
-      cs=copy(s,i,30);
-      if (res==2)  col= col*6;
-               else col= col*10;
-    }
-
-
-
-static void posit(integer ji, integer& coldep, integer& esp)
-   {
-     putxy(coldep + (40+esp) *pred(integer,ji),98);
-   }
-
-
-
-static void fait_boite(integer lidep,integer nli,integer tx)
-   {
-         integer x,y,xx,yy;
-
-     if (tx>640)  tx=640;
-     x= 320- ((cardinal)tx >> 1);
-     y=pred(integer,lidep) << 3;
-     xx=x+ tx;
-     yy=y + (nli << 3);
-     box(15,gd,x,y,xx,yy,255);
-     box(0,gd,x,y+2,xx,y+4,255);
-     box(0,gd,x,yy-4,xx,yy-2,255);
-   }
-
-
-
-static void fait_choix(str30 c, integer& coldep, integer& nbcase, array<1,2,varying_string<3> >& s, integer& esp)
-   {
-         integer i,l,x;
-         char ch;
-
-     i=1;
-     x=coldep;
-     for( l=1; l <= nbcase; l ++)
-       {
-         s[l]="";
-         do {
-           i=i+1;
-           ch=c[i];
-           s[l]=s[l]+ch;
-         } while (!(c[i+1]==']'));
-         i=i+2;
-         while (length(s[l])<3)  s[l]=s[l]+' ';
-         putxy(x,98);
-         writeg(string(' ')+s[l]+' ',0);
-         x= x+esp+40;
-       }
-   }
-
-              integer do_alert(str255 str_, integer n)
-{
-       integer coldep,esp,i,l,nbcase,quoi,ix;
-       str255 st, chaine;
-       matrix<1,2,1,2,integer> limit;
-       char c,dumi;
-       array<1,2,varying_string<3> > s;
-       integer cx,cy,cd,nbcol,nblig;
-       boolean touch,newaff,test,test1,test2,test3,dum;
-       str30 cas;
-
-
-  /*debug('** do_alert **');*/
-  integer do_alert_result;
-  hide_mouse();
-  while (keypressed())  input >> kbd >> dumi;
-  clic=false;
-  decod(str_,nbcase,nblig,nbcol,chaine,cas);
-  sauvecr(50,succ(integer,nligne) << 4);
-
-  i=0;
-  if (chaine=="") 
-    {
-      fait_boite(10,5,nbcol);
-    }
-   else
-    {
-      fait_boite(8,7,nbcol);
-      i=0;
-      ywhere=70;
-      do {
-        cx= 320;
-        st= "";
-        while (! (set::of('\174','\135', eos).has(chaine[i+1]))) 
-          {
-            i=i+1;
-            st=st+chaine[i];
-            if (res==2)  cx=cx-3;
-                     else cx=cx-5;
-          }
-        putxy(cx,ywhere);
-        ywhere=ywhere+6;
-        writeg(st,4);
-        i=i+1;
-      } while (!(chaine[i]==']'));
-    }
-  if (nbcase==1)  esp= nbcol- 40;
-              else esp= (cardinal)(nbcol-nbcase*40) >> 1;
-  coldep=320-((cardinal)nbcol >> 1)+((cardinal)esp >> 1);
-  fait_choix(cas, coldep, nbcase, s, esp);
-  limit[1][1]=((cardinal)(coldep) >> 1)*res;
-  limit[1][2]=limit[1][1]+40;
-  if (nbcase==1) 
-     {
-       limit[2][1]=limit[2][2];
-     }
-   else
-     {
-       limit[2][1]=((cardinal)(320+((cardinal)esp >> 1)) >> 1)*res;
-       limit[2][2]=(limit[2][1])+40;
-     }
-  show_mouse();
-  quoi=0;
-  dum=false;
-  do {
-    dumi='\377';
-    mov_mouse(dum,dumi);
-    cx= x_s;
-    cy= y_s;
-    test=(cy>95) && (cy<105);
-    newaff=false;
-    if (test) 
-     {
-       test1=(cx>limit[1][1]) && (cx<limit[1][2]);
-       test2=test1;
-       if (nbcase>1)  test2= test1 || ((cx>limit[2][1]) && (cx<limit[2][2]));
-       if (test2) 
-        {
-          newaff=true;
-          if (test1)  ix=1;
-                   else ix=2;
-          if (ix!=quoi)  
-           {
-             hide_mouse();
-             if (quoi!=0) 
-              {
-                posit(quoi, coldep, esp);
-                writeg(string(' ')+s[quoi]+' ',0);
-              }
-             posit(ix, coldep, esp);
-             writeg(string(' ')+s[ix]+' ',1);
-             quoi=ix;
-             show_mouse();
-           }
-        }
-     }
-    if ((quoi!=0) && ! newaff) 
-     {
-       hide_mouse();
-       posit(quoi, coldep, esp);
-       writeg(string(' ')+s[quoi]+' ',0);
-       quoi=0;
-       show_mouse();
-     }
-     test3=(cy>95) && (cy<105) && (((cx>limit[1][1]) && (cx<limit[1][2]))
-                                   || ((cx>limit[2][1]) && (cx<limit[2][2])));
-  } while (!clic);
-  clic=false;
-  hide_mouse();
-  if (! test3)  {
-                  quoi=n;
-                  posit(n, coldep, esp);
-                  writeg(string(' ')+s[n]+' ',1);
-                }
-  charecr(50,succ(integer,nligne) << 4);
-  show_mouse();
-  do_alert_result=quoi;
-  return do_alert_result;
+const matrix<1, 2, 1, 3, integer> coord
+= {{ {{150, 72, 103}},
+		{{143, 107, 183}}
+	}
+};
+
+
+
+static void decod(str255 s, integer &nbc, integer &nbl, integer &col, str255 &c, str30 &cs) {
+	integer i, k;
+	boolean v;
+
+	val(s[2], nbc, i);
+	c = "";
+	nbl = 0;
+	i = 5;
+	k = 0;
+	v = true;
+	col = 0;
+
+	while (s[i] != ']') {
+		c = c + s[i];
+		if ((s[i] == '|') || (s[i + 1] == ']')) {
+			if (k > col)  col = k;
+			k = 0;
+			nbl = nbl + 1;
+		} else if (s[i] != ' ')  v = false;
+		i = i + 1;
+		k = k + 1;
+	}
+	if (v)  {
+		c = "";
+		col = 20;
+	} else {
+		c = c + ']';
+		col = col + 6;
+	}
+	i = i + 1;
+	cs = copy(s, i, 30);
+	if (res == 2)  col = col * 6;
+	else col = col * 10;
+}
+
+
+
+static void posit(integer ji, integer &coldep, integer &esp) {
+	putxy(coldep + (40 + esp) *pred(integer, ji), 98);
+}
+
+
+
+static void fait_boite(integer lidep, integer nli, integer tx) {
+	integer x, y, xx, yy;
+
+	if (tx > 640)  tx = 640;
+	x = 320 - ((cardinal)tx >> 1);
+	y = pred(integer, lidep) << 3;
+	xx = x + tx;
+	yy = y + (nli << 3);
+	box(15, gd, x, y, xx, yy, 255);
+	box(0, gd, x, y + 2, xx, y + 4, 255);
+	box(0, gd, x, yy - 4, xx, yy - 2, 255);
+}
+
+
+
+static void fait_choix(str30 c, integer &coldep, integer &nbcase, array<1, 2, varying_string<3> > &s, integer &esp) {
+	integer i, l, x;
+	char ch;
+
+	i = 1;
+	x = coldep;
+	for (l = 1; l <= nbcase; l ++) {
+		s[l] = "";
+		do {
+			i = i + 1;
+			ch = c[i];
+			s[l] = s[l] + ch;
+		} while (!(c[i + 1] == ']'));
+		i = i + 2;
+		while (length(s[l]) < 3)  s[l] = s[l] + ' ';
+		putxy(x, 98);
+		writeg(string(' ') + s[l] + ' ', 0);
+		x = x + esp + 40;
+	}
+}
+
+integer do_alert(str255 str_, integer n) {
+	integer coldep, esp, i, l, nbcase, quoi, ix;
+	str255 st, chaine;
+	matrix<1, 2, 1, 2, integer> limit;
+	char c, dumi;
+	array<1, 2, varying_string<3> > s;
+	integer cx, cy, cd, nbcol, nblig;
+	boolean touch, newaff, test, test1, test2, test3, dum;
+	str30 cas;
+
+
+	/*debug('** do_alert **');*/
+	integer do_alert_result;
+	hide_mouse();
+	while (keypressed())  input >> kbd >> dumi;
+	clic = false;
+	decod(str_, nbcase, nblig, nbcol, chaine, cas);
+	sauvecr(50, succ(integer, nligne) << 4);
+
+	i = 0;
+	if (chaine == "") {
+		fait_boite(10, 5, nbcol);
+	} else {
+		fait_boite(8, 7, nbcol);
+		i = 0;
+		ywhere = 70;
+		do {
+			cx = 320;
+			st = "";
+			while (!(set::of('\174', '\135', eos).has(chaine[i + 1]))) {
+				i = i + 1;
+				st = st + chaine[i];
+				if (res == 2)  cx = cx - 3;
+				else cx = cx - 5;
+			}
+			putxy(cx, ywhere);
+			ywhere = ywhere + 6;
+			writeg(st, 4);
+			i = i + 1;
+		} while (!(chaine[i] == ']'));
+	}
+	if (nbcase == 1)  esp = nbcol - 40;
+	else esp = (cardinal)(nbcol - nbcase * 40) >> 1;
+	coldep = 320 - ((cardinal)nbcol >> 1) + ((cardinal)esp >> 1);
+	fait_choix(cas, coldep, nbcase, s, esp);
+	limit[1][1] = ((cardinal)(coldep) >> 1) * res;
+	limit[1][2] = limit[1][1] + 40;
+	if (nbcase == 1) {
+		limit[2][1] = limit[2][2];
+	} else {
+		limit[2][1] = ((cardinal)(320 + ((cardinal)esp >> 1)) >> 1) * res;
+		limit[2][2] = (limit[2][1]) + 40;
+	}
+	show_mouse();
+	quoi = 0;
+	dum = false;
+	do {
+		dumi = '\377';
+		mov_mouse(dum, dumi);
+		cx = x_s;
+		cy = y_s;
+		test = (cy > 95) && (cy < 105);
+		newaff = false;
+		if (test) {
+			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
+			test2 = test1;
+			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
+			if (test2) {
+				newaff = true;
+				if (test1)  ix = 1;
+				else ix = 2;
+				if (ix != quoi) {
+					hide_mouse();
+					if (quoi != 0) {
+						posit(quoi, coldep, esp);
+						writeg(string(' ') + s[quoi] + ' ', 0);
+					}
+					posit(ix, coldep, esp);
+					writeg(string(' ') + s[ix] + ' ', 1);
+					quoi = ix;
+					show_mouse();
+				}
+			}
+		}
+		if ((quoi != 0) && ! newaff) {
+			hide_mouse();
+			posit(quoi, coldep, esp);
+			writeg(string(' ') + s[quoi] + ' ', 0);
+			quoi = 0;
+			show_mouse();
+		}
+		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
+		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
+	} while (!clic);
+	clic = false;
+	hide_mouse();
+	if (! test3)  {
+		quoi = n;
+		posit(n, coldep, esp);
+		writeg(string(' ') + s[n] + ' ', 1);
+	}
+	charecr(50, succ(integer, nligne) << 4);
+	show_mouse();
+	do_alert_result = quoi;
+	return do_alert_result;
 }
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
index 0819490..4120f73 100644
--- a/engines/mortevielle/boite.h
+++ b/engines/mortevielle/boite.h
@@ -1,30 +1,29 @@
-void boite(integer x,integer y,integer dx,integer dy,integer coul)
- {
-       integer i;
-      integer xi,yi,xo,yo;
+void boite(integer x, integer y, integer dx, integer dy, integer coul) {
+	integer i;
+	integer xi, yi, xo, yo;
 
-   /* debug('boite'); */
-   hide_mouse();
-   if (res==1) 
-      {
-        x= (cardinal)x >> 1;
-        dx= (cardinal)dx >> 1;
-      }
-   xi=x; yi=y; xo=x; yo=y;
-   for( i=0; i <= dx+dy; i ++)
-      {
-        putpix(gd,xi,yi,coul);
-        if (xi==x+dx)  {
-                          if (gd!=cga)  putpix(gd,pred(integer,xi),yi,coul);
-                          yi=succ(integer,yi);
-                        }
-                   else xi=succ(integer,xi);
-        putpix(gd,xo,yo,coul);
-        if (yo==y+dy)  xo=succ(integer,xo);
-                   else {
-                          if (gd!=cga)  putpix(gd,succ(integer,xo),yo,coul);
-                          yo=succ(integer,yo);
-                        }
-      }
-   show_mouse();
- }
+	/* debug('boite'); */
+	hide_mouse();
+	if (res == 1) {
+		x = (cardinal)x >> 1;
+		dx = (cardinal)dx >> 1;
+	}
+	xi = x;
+	yi = y;
+	xo = x;
+	yo = y;
+	for (i = 0; i <= dx + dy; i ++) {
+		putpix(gd, xi, yi, coul);
+		if (xi == x + dx)  {
+			if (gd != cga)  putpix(gd, pred(integer, xi), yi, coul);
+			yi = succ(integer, yi);
+		} else xi = succ(integer, xi);
+		putpix(gd, xo, yo, coul);
+		if (yo == y + dy)  xo = succ(integer, xo);
+		else {
+			if (gd != cga)  putpix(gd, succ(integer, xo), yo, coul);
+			yo = succ(integer, yo);
+		}
+	}
+	show_mouse();
+}
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
index 28a2dbe..517d408 100644
--- a/engines/mortevielle/disk.h
+++ b/engines/mortevielle/disk.h
@@ -1,78 +1,72 @@
 
-void dem1()
-{
-      untyped_file f;
-      integer k;
+void dem1() {
+	untyped_file f;
+	integer k;
 
-  /* -- demande de disk 1 -- */
-  assign(f,"mort.005");
-  /*$i-*/
-  k=ioresult;
-  reset(f);
-  while (ioresult!=0) 
-   {
-    show_mouse();
-    k= do_alert(al_mess,1);
-    hide_mouse();
-    reset(f);
-   }
-  close(f);
+	/* -- demande de disk 1 -- */
+	assign(f, "mort.005");
+	/*$i-*/
+	k = ioresult;
+	reset(f);
+	while (ioresult != 0) {
+		show_mouse();
+		k = do_alert(al_mess, 1);
+		hide_mouse();
+		reset(f);
+	}
+	close(f);
 }
 
-void takesav(integer n)
-{
-        untyped_file f;
-        integer i;
-       varying_string<10> st;
+void takesav(integer n) {
+	untyped_file f;
+	integer i;
+	varying_string<10> st;
 
-  dem1();
-  /* -- chargement du fichier 'sauve#n.mor' -- */
-  st= string("sav")+chr(n+48)+".mor";
-  assign(f,st);
-  reset(f,497);
-  blockread(f,s1,1);
-  if (ioresult!=0) 
-     {
-       i=do_alert(err_mess,1);
-       exit(0);
-     }
-  s=s1;
-  for( i=0; i <= 389; i ++) tabdon[i+acha]=bufcha[i];
-  close(f);
+	dem1();
+	/* -- chargement du fichier 'sauve#n.mor' -- */
+	st = string("sav") + chr(n + 48) + ".mor";
+	assign(f, st);
+	reset(f, 497);
+	blockread(f, s1, 1);
+	if (ioresult != 0) {
+		i = do_alert(err_mess, 1);
+		exit(0);
+	}
+	s = s1;
+	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
+	close(f);
 }
 
-void ld_game(integer n)
-{
-  hide_mouse();
-  maivid();
-  takesav(n);
-  /* -- disquette 2 -- */
-  dem2();
-  /* -- mises en place -- */
-  theure();
-  dprog();
-  antegame();
-  show_mouse();
+void ld_game(integer n) {
+	hide_mouse();
+	maivid();
+	takesav(n);
+	/* -- disquette 2 -- */
+	dem2();
+	/* -- mises en place -- */
+	theure();
+	dprog();
+	antegame();
+	show_mouse();
 }
 
-void sv_game(integer n)
-{
-        untyped_file f;
-        integer i;
+void sv_game(integer n) {
+	untyped_file f;
+	integer i;
 
-  hide_mouse();
-  tmaj3();
-  dem1();
-  /* -- sauvegarde du fichier 'sauve#n.mor' -- */
-  for( i=0; i <= 389; i ++) bufcha[i]=tabdon[i+acha];
-  s1=s;
-  if (s1.mlieu== 26)  s1.mlieu= 15;
-  assign(f,string("sav")+chr(n+48)+".mor");
-  rewrite(f,497);
-  blockwrite(f,s1,1);
-  close(f);
-  dem2();
-  show_mouse();
+	hide_mouse();
+	tmaj3();
+	dem1();
+	/* -- sauvegarde du fichier 'sauve#n.mor' -- */
+	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
+	s1 = s;
+	if (s1.mlieu == 26)  s1.mlieu = 15;
+	assign(f, string("sav") + chr(n + 48) + ".mor");
+	rewrite(f, 497);
+	blockwrite(f, s1, 1);
+	close(f);
+	dem2();
+	show_mouse();
 }
 
 
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
index 7dd029e..8d254a4 100644
--- a/engines/mortevielle/droite.h
+++ b/engines/mortevielle/droite.h
@@ -1,35 +1,34 @@
-void droite( integer x, integer y, integer xx, integer yy, integer coul )
-   {
-         integer step,i;
-         real a,b;
-         real xr,yr,xro,yro;
+void droite(integer x, integer y, integer xx, integer yy, integer coul) {
+	integer step, i;
+	real a, b;
+	real xr, yr, xro, yro;
 
-     xr=x; yr=y; xro=xx; yro=yy;
-     /*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
-     if (abs(y-yy) > abs(x-xx)) 
-        {
-          a= (real)((x-xx)) / (y-yy);
-          b= ( yr*xro - yro*xr) / (y-yy);
-          i=y;
-          if (y>yy)  step=-1;
-                  else step=1;
-          do {
-            putpix(gd, trunc(a*i+b), i, coul);
-            i=i+step;
-          } while (!(i==yy));
-          /*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
-        }
-      else
-        {
-          a= (real)((y-yy)) / (x-xx);
-          b= ((yro*xr) - (yr*xro)) / (x-xx);
-          i=x;
-          if (x>xx)  step=-1;
-                  else step=1;
-          do {
-            putpix(gd,i, trunc(a*i+b), coul);
-            i=i+step;
-          } while (!(i==xx));
-          /*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
-        }
-   }
\ No newline at end of file
+	xr = x;
+	yr = y;
+	xro = xx;
+	yro = yy;
+	/*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
+	if (abs(y - yy) > abs(x - xx)) {
+		a = (real)((x - xx)) / (y - yy);
+		b = (yr * xro - yro * xr) / (y - yy);
+		i = y;
+		if (y > yy)  step = -1;
+		else step = 1;
+		do {
+			putpix(gd, trunc(a * i + b), i, coul);
+			i = i + step;
+		} while (!(i == yy));
+		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
+	} else {
+		a = (real)((y - yy)) / (x - xx);
+		b = ((yro * xr) - (yr * xro)) / (x - xx);
+		i = x;
+		if (x > xx)  step = -1;
+		else step = 1;
+		do {
+			putpix(gd, i, trunc(a * i + b), coul);
+			i = i + step;
+		} while (!(i == xx));
+		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
+	}
+}
\ No newline at end of file
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
index 9f8423a..b450e07 100644
--- a/engines/mortevielle/keyboard.h
+++ b/engines/mortevielle/keyboard.h
@@ -1,59 +1,60 @@
-char readkey1()
-  {
-       char c;
+char readkey1() {
+	char c;
 
-    char readkey1_result;
-    input >> kbd >> c;
-    readkey1_result= c;
-    return readkey1_result;
-  }
+	char readkey1_result;
+	input >> kbd >> c;
+	readkey1_result = c;
+	return readkey1_result;
+}
 
-integer testou()
-  {
-        char ch;
+integer testou() {
+	char ch;
 
-    integer testou_result;
-    input >> kbd >> ch;
-    switch  (ch)  {
-              case '\23' : sonoff= ! sonoff; break;
-              case '\1':
-              case '\3':
-              case '\5'  : {
-                      newgd= (cardinal)pred(integer,ord(ch)) >> 1;
-                      testou_result= 61;
-                      return testou_result;
-                    }
-                    break;
-              case '\10'  : {
-                      newgd= her;
-                      testou_result= 61;
-                      return testou_result;
-                    }
-                    break;
-              case '\24' : {
-                      newgd= tan;
-                      testou_result= 61;
-                      return testou_result;
-                    }
-                    break;
-              case '\26' : if (set::of(1,2, eos).has(c_zzz)) 
-                       {
-                         zzuul(adcfiec+161,0,1644);
-                         c_zzz=succ(integer,c_zzz);
-                         testou_result=61;
-                         return testou_result;
-                       }
-                       break;
-              case '\33' : if (keypressed())  input >> kbd >> ch; break;
-      }
-    testou_result=ord(ch);
-    return testou_result;
-  }
+	integer testou_result;
+	input >> kbd >> ch;
+	switch (ch)  {
+	case '\23' :
+		sonoff = ! sonoff;
+		break;
+	case '\1':
+	case '\3':
+	case '\5'  : {
+		newgd = (cardinal)pred(integer, ord(ch)) >> 1;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\10'  : {
+		newgd = her;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\24' : {
+		newgd = tan;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\26' :
+		if (set::of(1, 2, eos).has(c_zzz)) {
+			zzuul(adcfiec + 161, 0, 1644);
+			c_zzz = succ(integer, c_zzz);
+			testou_result = 61;
+			return testou_result;
+		}
+		break;
+	case '\33' :
+		if (keypressed())  input >> kbd >> ch;
+		break;
+	}
+	testou_result = ord(ch);
+	return testou_result;
+}
 
-void teskbd()
-  {
-        integer dum;
+void teskbd() {
+	integer dum;
 
-    if (keypressed())  dum=testou();
-  }
+	if (keypressed())  dum = testou();
+}
 
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index be92e8d..2c9b8cd 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -1,87 +1,80 @@
 
 /* NIVEAU 15 */
-void copcha()
-{
-      integer i;
-
-  i= acha;
-  do {
-    tabdon[i]=tabdon[i+390];
-    i=succ(integer,i);
-  } while (!(i==acha +390));
+void copcha() {
+	integer i;
+
+	i = acha;
+	do {
+		tabdon[i] = tabdon[i + 390];
+		i = succ(integer, i);
+	} while (!(i == acha + 390));
 }
 
-boolean dans_rect( rectangle r )
-   {
-         integer x, y, c;
-
-     boolean dans_rect_result;
-     read_pos_mouse(x,y,c);
-       if ((x>r.x1) &&
-          (x<r.x2) &&
-          (y>r.y1) &&
-          (y<r.y2))  dans_rect_result= true;
-                 else dans_rect_result= false;
-     return dans_rect_result;
-   }
-
-void outbloc(integer n, pattern p, t_nhom pal)
-   {
-         integer i,j,ad;
-
-     ad=n*404+0xd700;
-       {
-         memw[0x6000+ad]= p.tax;
-         memw[0x6000+ad+2]= p.tay;
-         ad=ad+4;
-         for( i=1; i <= p.tax; i ++)
-           for( j=1; j <= p.tay; j ++)
-             mem[0x6000+ad+pred(integer,j)*p.tax+pred(integer,i)]= pal[n].hom[p.des[i][j]];
-       }
-   }
-
-
-void writepal(integer n)
- {
-         integer i;
-       t_nhom pal;
-
-
-   switch (gd) {
-           case tan:
-           case ega:
-           case ams : for( i=1; i <= 16; i ++)
-                   {
-                     mem[0x7000+2*i]= tabpal[n][i].x;
-                     mem[0x7000+succ(integer,2*i)]= tabpal[n][i].y;
-                   }
-                   break;
-           case cga : {
-                   pal= palcga[n].a;
-                   if (n<89)  palette(palcga[n].p);
-                   for( i=0; i <= 15; i ++) outbloc(i, tpt[pal[i].n],pal);
-                 }
-                 break;
-   }
- }
-
-
-void pictout(integer seg,integer dep,integer x,integer y)
-   {
-     decomp(seg,dep);
-     if (gd==her) 
-        {
-          mem[0x7000+2]=0;
-          mem[0x7000+32]=15;
-        }
-     if ((caff!=51) && (memw[0x7000+0x4138]>0x100))  memw[0x7000+0x4138]=0x100;
-     afff(gd,seg,dep,x,y);
-   }
-
-void putxy(integer x,integer y)
-{
-  xwhere=x;
-  ywhere=y;
+boolean dans_rect(rectangle r) {
+	integer x, y, c;
+
+	boolean dans_rect_result;
+	read_pos_mouse(x, y, c);
+	if ((x > r.x1) &&
+	        (x < r.x2) &&
+	        (y > r.y1) &&
+	        (y < r.y2))  dans_rect_result = true;
+	else dans_rect_result = false;
+	return dans_rect_result;
+}
+
+void outbloc(integer n, pattern p, t_nhom pal) {
+	integer i, j, ad;
+
+	ad = n * 404 + 0xd700;
+	{
+		memw[0x6000 + ad] = p.tax;
+		memw[0x6000 + ad + 2] = p.tay;
+		ad = ad + 4;
+		for (i = 1; i <= p.tax; i ++)
+			for (j = 1; j <= p.tay; j ++)
+				mem[0x6000 + ad + pred(integer, j)*p.tax + pred(integer, i)] = pal[n].hom[p.des[i][j]];
+	}
+}
+
+
+void writepal(integer n) {
+	integer i;
+	t_nhom pal;
+
+
+	switch (gd) {
+	case tan:
+	case ega:
+	case ams :
+		for (i = 1; i <= 16; i ++) {
+			mem[0x7000 + 2 * i] = tabpal[n][i].x;
+			mem[0x7000 + succ(integer, 2 * i)] = tabpal[n][i].y;
+		}
+		break;
+	case cga : {
+		pal = palcga[n].a;
+		if (n < 89)  palette(palcga[n].p);
+		for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
+	}
+	break;
+	}
+}
+
+
+void pictout(integer seg, integer dep, integer x, integer y) {
+	decomp(seg, dep);
+	if (gd == her) {
+		mem[0x7000 + 2] = 0;
+		mem[0x7000 + 32] = 15;
+	}
+	if ((caff != 51) && (memw[0x7000 + 0x4138] > 0x100))  memw[0x7000 + 0x4138] = 0x100;
+	afff(gd, seg, dep, x, y);
+}
+
+void putxy(integer x, integer y) {
+	xwhere = x;
+	ywhere = y;
 }
 /*
 function calad(x,y:integer):integer;
@@ -89,19 +82,17 @@ function calad(x,y:integer):integer;
      calad:=pred(x)+320*pred(y)
    end;
   */
-void sauvecr(integer y,integer dy)
-  {
-    hide_mouse();
-    s_sauv(gd,y,dy);
-    show_mouse();
-  }
-
-void charecr(integer y,integer dy)
-  {
-    hide_mouse();
-    s_char(gd,y,dy);
-    show_mouse();
-  }
+void sauvecr(integer y, integer dy) {
+	hide_mouse();
+	s_sauv(gd, y, dy);
+	show_mouse();
+}
+
+void charecr(integer y, integer dy) {
+	hide_mouse();
+	s_char(gd, y, dy);
+	show_mouse();
+}
 /*
 function peek(ad:integer):integer;
 begin
@@ -125,54 +116,52 @@ begin
 end;
   */
 
-void adzon()
-   {
-         untyped_file f;
-         file<byte> g;
-         byte a;
-         integer i;
-
-     assign(f,"don.mor");
-     reset(f,256);
-     blockread(f,tabdon,7);
-     close(f);
-     assign(f,"bmor.mor");
-     reset(f,1916);
-     blockread(f,tabdon[fleche],1);
-     /*i:=fleche;
-     repeat
-       read(g,a);
-       tabdon[i]:=a;
-       i:=succ(i);
-     until i=fleche + 1916;*/
-     close(f);
-     assign(f,"dec.mor");
-     reset(f,1664);
-     blockread(f,mem[0x73a2+0],1);
-     /*i:=0;
-     repeat
-       read(g,a);
-       mem[$73A2:i]:=a;
-       i:=succ(i);
-     until eof(g);*/
-     close(f);
-   }
-
-integer animof (integer ouf,integer num)
-   {
-         integer nani, aux;
-
-     integer animof_result;
-     nani= mem[adani+1];
-     aux= num;
-     if (ouf!=1)  aux= aux+nani;
-     animof_result=(nani << 2) + 2+swap(memw[adani+ (aux << 1)]);
-     /*aux:= nani shl 2 + 2;
-     if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
-              else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
-     animof:=aux;*/
-     return animof_result;
-   }
+void adzon() {
+	untyped_file f;
+	file<byte> g;
+	byte a;
+	integer i;
+
+	assign(f, "don.mor");
+	reset(f, 256);
+	blockread(f, tabdon, 7);
+	close(f);
+	assign(f, "bmor.mor");
+	reset(f, 1916);
+	blockread(f, tabdon[fleche], 1);
+	/*i:=fleche;
+	repeat
+	  read(g,a);
+	  tabdon[i]:=a;
+	  i:=succ(i);
+	until i=fleche + 1916;*/
+	close(f);
+	assign(f, "dec.mor");
+	reset(f, 1664);
+	blockread(f, mem[0x73a2 + 0], 1);
+	/*i:=0;
+	repeat
+	  read(g,a);
+	  mem[$73A2:i]:=a;
+	  i:=succ(i);
+	until eof(g);*/
+	close(f);
+}
+
+integer animof(integer ouf, integer num) {
+	integer nani, aux;
+
+	integer animof_result;
+	nani = mem[adani + 1];
+	aux = num;
+	if (ouf != 1)  aux = aux + nani;
+	animof_result = (nani << 2) + 2 + swap(memw[adani + (aux << 1)]);
+	/*aux:= nani shl 2 + 2;
+	if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
+	         else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
+	animof:=aux;*/
+	return animof_result;
+}
 
 /*procedure affgd(offs,dep,x,y:integer);
 begin
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 9256182..691ef7c 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -1,306 +1,334 @@
 /* NIVEAU 14*/
 
-/* overlay */ void menut(integer no, str30 nom)
-   {
-         byte h,l;
-         str30 s;
+/* overlay */ void menut(integer no, str30 nom) {
+	byte h, l;
+	str30 s;
 
 
-     /* debug('menut'); */
-     h=hi(no);
-     l=lo(no);
-     s=nom;
-     if (! tesok) 
-        {
-          clrscr;
-          exit(0);
-        }
-     while (length(s)<30)  s=s+' ';
-     switch (h) {
-           case invent  :  if (l!=7)  inv[l]= string(' ')+s; break;
-           case depla   :  dep[l]= s; break;
-           case action  :  act[l]= s; break;
-           case saction :  self_[l]= s; break;
-           case discut  :  dis[l]= s; break;
-        }
-   }
+	/* debug('menut'); */
+	h = hi(no);
+	l = lo(no);
+	s = nom;
+	if (! tesok) {
+		clrscr;
+		exit(0);
+	}
+	while (length(s) < 30)  s = s + ' ';
+	switch (h) {
+	case invent  :
+		if (l != 7)  inv[l] = string(' ') + s;
+		break;
+	case depla   :
+		dep[l] = s;
+		break;
+	case action  :
+		act[l] = s;
+		break;
+	case saction :
+		self_[l] = s;
+		break;
+	case discut  :
+		dis[l] = s;
+		break;
+	}
+}
 
-/* overlay */ void menu_disable(integer no)
-   {
-         byte h,l;
+/* overlay */ void menu_disable(integer no) {
+	byte h, l;
 
-     /* debug('menu_disable'); */
-     h=hi(no);
-     l=lo(no);
-     switch (h) {
-           case invent : {
-                 if (l>6)  {
-                               inv[l][1]='<';
-                               inv[l][22]='>';
-                             }
-                        else inv[l][1]='*';
-               }
-               break;
-           case depla : dep[l][1]='*'; break;
-           case action : act[l][1]='*'; break;
-           case saction : self_[l][1]='*'; break;
-           case discut : dis[l][1]='*'; break;
-        }
-   }
+	/* debug('menu_disable'); */
+	h = hi(no);
+	l = lo(no);
+	switch (h) {
+	case invent : {
+		if (l > 6)  {
+			inv[l][1] = '<';
+			inv[l][22] = '>';
+		} else inv[l][1] = '*';
+	}
+	break;
+	case depla :
+		dep[l][1] = '*';
+		break;
+	case action :
+		act[l][1] = '*';
+		break;
+	case saction :
+		self_[l][1] = '*';
+		break;
+	case discut :
+		dis[l][1] = '*';
+		break;
+	}
+}
 
-/* overlay */ void menu_enable(integer no)
-   {
-         byte h,l;
+/* overlay */ void menu_enable(integer no) {
+	byte h, l;
 
-     /* debug('menu_disable'); */
-     h=hi(no);
-     l=lo(no);
-     switch (h) {
-           case invent : {
-                      inv[l][1]=' ';
-                      inv[l][22]=' ';
-                    }
-                    break;
-           case depla : dep[l][1]=' '; break;
-           case action : act[l][1]=' '; break;
-           case saction : {
-                       self_[l][1]=' ';
-                       self_[l][1]=' ';
-                     }
-                     break;
-           case discut : dis[l][1]=' '; break;
-        }
-   }
+	/* debug('menu_disable'); */
+	h = hi(no);
+	l = lo(no);
+	switch (h) {
+	case invent : {
+		inv[l][1] = ' ';
+		inv[l][22] = ' ';
+	}
+	break;
+	case depla :
+		dep[l][1] = ' ';
+		break;
+	case action :
+		act[l][1] = ' ';
+		break;
+	case saction : {
+		self_[l][1] = ' ';
+		self_[l][1] = ' ';
+	}
+	break;
+	case discut :
+		dis[l][1] = ' ';
+		break;
+	}
+}
 
-void menu_aff()
-   {
-         integer ind_tabl,k,col;
-         char c;
-         integer pt,x,y,color,msk,
-         num_letr;
+void menu_aff() {
+	integer ind_tabl, k, col;
+	char c;
+	integer pt, x, y, color, msk,
+	        num_letr;
 
-     /* debug('menu_aff'); */
-     hide_mouse();
-     /*if not tesok then
-        begin
-          clrscr;
-          halt;
-        end;*/
-     box( 7, gd, 0,0, 639,10, 255);
-     col= 28*res;
-     if (gd == cga)  color=1;
-                 else color=9;
-     num_letr=0;
-     do {       /* lettre par lettre */
-       num_letr= num_letr +1;
-       ind_tabl=0;
-       y= 1;
-       do {      /* colonne par colonne */
-         k=0;
-         x= col;
-         do {     /* ligne par ligne */
-           msk=0x80;
-           for( pt=0; pt <= 7; pt ++)
-            {
-              if ((lettres[num_letr][ind_tabl] & msk)!=0) 
-                 {
-                   putpix(gd,x+1,y+1,0);
-                   putpix(gd,x,y+1,0);
-                   putpix(gd,x,y,color);
-                 }
-              msk= (cardinal)msk >> 1;
-              x=x +1;
-            }
-           ind_tabl=succ(integer,ind_tabl);
-           k=succ(integer,k);
-         } while (!(k==3));
-         y=y+1;
-       } while (!(y==9));
-       col=col+48*res;
-     } while (!(num_letr==6));
-     show_mouse();
-   }
+	/* debug('menu_aff'); */
+	hide_mouse();
+	/*if not tesok then
+	   begin
+	     clrscr;
+	     halt;
+	   end;*/
+	box(7, gd, 0, 0, 639, 10, 255);
+	col = 28 * res;
+	if (gd == cga)  color = 1;
+	else color = 9;
+	num_letr = 0;
+	do {       /* lettre par lettre */
+		num_letr = num_letr + 1;
+		ind_tabl = 0;
+		y = 1;
+		do {      /* colonne par colonne */
+			k = 0;
+			x = col;
+			do {     /* ligne par ligne */
+				msk = 0x80;
+				for (pt = 0; pt <= 7; pt ++) {
+					if ((lettres[num_letr][ind_tabl] & msk) != 0) {
+						putpix(gd, x + 1, y + 1, 0);
+						putpix(gd, x, y + 1, 0);
+						putpix(gd, x, y, color);
+					}
+					msk = (cardinal)msk >> 1;
+					x = x + 1;
+				}
+				ind_tabl = succ(integer, ind_tabl);
+				k = succ(integer, k);
+			} while (!(k == 3));
+			y = y + 1;
+		} while (!(y == 9));
+		col = col + 48 * res;
+	} while (!(num_letr == 6));
+	show_mouse();
+}
 
 
-void draw_menu()
-  {
-    /* debug('draw_menu'); */
-    menu_aff();
-    active_menu=true;
-    msg4=no_choice;
-    msg3=no_choice;
-    choisi=false;
-    clic=false;
-    test0=false;
-  }
+void draw_menu() {
+	/* debug('draw_menu'); */
+	menu_aff();
+	active_menu = true;
+	msg4 = no_choice;
+	msg3 = no_choice;
+	choisi = false;
+	clic = false;
+	test0 = false;
+}
 
-void invers(integer ix)
-   {
-         varying_string<23> s;
+void invers(integer ix) {
+	varying_string<23> s;
 
-     /* debug('invers'); */
-     if (msg4==no_choice)  return;
-     putxy(don[msg3][1] << 3,succ(void,lo(msg4)) << 3);
-     switch (msg3) {
-                  case 1 : s= inv[lo(msg4)]; break;
-                  case 2 : s= dep[lo(msg4)]; break;
-                  case 3 : s= act[lo(msg4)]; break;
-                  case 4 : s= self_[lo(msg4)]; break;
-                  case 5 : s= dis[lo(msg4)]; break;
-                  case 6 : s= fic[lo(msg4)]; break;
-                  case 7 : s= fic[1]+' '+chr(48+lo(msg4)); break;
-                  case 8 : if (lo(msg4)==1)  s=recom;
-                              else s= fic[2]+' '+chr(47+lo(msg4));
-                              break;
-          }
-     if ((s[1]!='*') && (s[1]!='<'))  writeg(s,ix);
-                                    else msg4=no_choice;
-   }
+	/* debug('invers'); */
+	if (msg4 == no_choice)  return;
+	putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
+	switch (msg3) {
+	case 1 :
+		s = inv[lo(msg4)];
+		break;
+	case 2 :
+		s = dep[lo(msg4)];
+		break;
+	case 3 :
+		s = act[lo(msg4)];
+		break;
+	case 4 :
+		s = self_[lo(msg4)];
+		break;
+	case 5 :
+		s = dis[lo(msg4)];
+		break;
+	case 6 :
+		s = fic[lo(msg4)];
+		break;
+	case 7 :
+		s = fic[1] + ' ' + chr(48 + lo(msg4));
+		break;
+	case 8 :
+		if (lo(msg4) == 1)  s = recom;
+		else s = fic[2] + ' ' + chr(47 + lo(msg4));
+		break;
+	}
+	if ((s[1] != '*') && (s[1] != '<'))  writeg(s, ix);
+	else msg4 = no_choice;
+}
 
-void util(integer x,integer y)
-   {
-         integer ymx, dxcar, xmn, xmx, ix;
+void util(integer x, integer y) {
+	integer ymx, dxcar, xmn, xmx, ix;
 
-     /* debug('util'); */
-     ymx= (don[msg3][4] << 3)+16;
-     dxcar= don[msg3][3];
-     xmn= (don[msg3][1] << 2)*res;
-     if (res==1)  ix=5; else ix=3;
-     xmx= dxcar*ix*res+ xmn+ 2;
-     if ((x>xmn) && (x<xmx) && (y<ymx) && (y>15)) 
-             {
-               ix= pred(integer,(cardinal)y >> 3)+ (msg3 << 8);
-               if (ix!=msg4) 
-                 {
-                   invers(1);
-                   msg4=ix;
-                   invers(0);
-                 }
-             }
-           else if (msg4!=no_choice) 
-                 {
-                   invers(1);
-                   msg4=no_choice;
-                 }
-   }
+	/* debug('util'); */
+	ymx = (don[msg3][4] << 3) + 16;
+	dxcar = don[msg3][3];
+	xmn = (don[msg3][1] << 2) * res;
+	if (res == 1)  ix = 5;
+	else ix = 3;
+	xmx = dxcar * ix * res + xmn + 2;
+	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
+		ix = pred(integer, (cardinal)y >> 3) + (msg3 << 8);
+		if (ix != msg4) {
+			invers(1);
+			msg4 = ix;
+			invers(0);
+		}
+	} else if (msg4 != no_choice) {
+		invers(1);
+		msg4 = no_choice;
+	}
+}
 
-void menu_down( integer ii)
-   {
-         integer cx, xcc;
-         integer xco, nb_lig;
+void menu_down(integer ii) {
+	integer cx, xcc;
+	integer xco, nb_lig;
 
-     /* debug('menu_down'); */
-     xco=don[ii][1];
-     nb_lig= don[ii][4];
-     hide_mouse();
-     sauvecr(10,succ(byte,don[ii][2]) << 1);
-     xco= xco << 3;
-     if (res==1)  cx=10; else cx=6;
-     xcc= xco+ (don[ii][3]*cx)+6;
-     box(15, gd, xco,12, xcc, 10 + (don[ii][2] << 1), 255);
-     box(0, gd, xcc, 12, xcc+4, 10 + (don[ii][2] << 1),255);
-     box(0,gd,xco, 8 + (don[ii][2] << 1), xcc+4, 12 + (don[ii][2] << 1),255);
-     putxy(xco,16);
-     cx=0;
-     do {
-       cx= succ(integer,cx);
-       switch (ii) {
-             case 1 : if (inv[cx][1]!= '*')  writeg(inv[cx],4); break;
-             case 2 : if (dep[cx][1]!= '*')  writeg(dep[cx],4); break;
-             case 3 : if (act[cx][1]!= '*')  writeg(act[cx],4); break;
-             case 4 : if (self_[cx][1]!='*')  writeg(self_[cx],4); break;
-             case 5 : if (dis[cx][1]!= '*')  writeg(dis[cx],4); break;
-             case 6 : writeg(fic[cx],4); break;
-             case 7 : writeg(fic[1]+' '+chr(48+cx),4); break;
-             case 8 : if (cx==1)  writeg( recom,4);
-                         else writeg(fic[2]+' '+chr(47+cx),4);
-                         break;
-          }
-       putxy(xco,ywhere+8);
-     } while (!(cx==nb_lig));
-     test0=true;
-     show_mouse();
-   }
+	/* debug('menu_down'); */
+	xco = don[ii][1];
+	nb_lig = don[ii][4];
+	hide_mouse();
+	sauvecr(10, succ(byte, don[ii][2]) << 1);
+	xco = xco << 3;
+	if (res == 1)  cx = 10;
+	else cx = 6;
+	xcc = xco + (don[ii][3] * cx) + 6;
+	box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
+	box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
+	box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
+	putxy(xco, 16);
+	cx = 0;
+	do {
+		cx = succ(integer, cx);
+		switch (ii) {
+		case 1 :
+			if (inv[cx][1] != '*')  writeg(inv[cx], 4);
+			break;
+		case 2 :
+			if (dep[cx][1] != '*')  writeg(dep[cx], 4);
+			break;
+		case 3 :
+			if (act[cx][1] != '*')  writeg(act[cx], 4);
+			break;
+		case 4 :
+			if (self_[cx][1] != '*')  writeg(self_[cx], 4);
+			break;
+		case 5 :
+			if (dis[cx][1] != '*')  writeg(dis[cx], 4);
+			break;
+		case 6 :
+			writeg(fic[cx], 4);
+			break;
+		case 7 :
+			writeg(fic[1] + ' ' + chr(48 + cx), 4);
+			break;
+		case 8 :
+			if (cx == 1)  writeg(recom, 4);
+			else writeg(fic[2] + ' ' + chr(47 + cx), 4);
+			break;
+		}
+		putxy(xco, ywhere + 8);
+	} while (!(cx == nb_lig));
+	test0 = true;
+	show_mouse();
+}
 
-void menu_up(integer xx)
-   {
-     /* debug('menu_up'); */
-     if (test0) 
-       {
-         charecr(10,succ(byte,don[xx][2]) << 1);
-         test0=false;
-       }
-   }
+void menu_up(integer xx) {
+	/* debug('menu_up'); */
+	if (test0) {
+		charecr(10, succ(byte, don[xx][2]) << 1);
+		test0 = false;
+	}
+}
 
-void erase_menu()
-  {
-    /* debug('erase_menu'); */
-    active_menu=false;
-    clic=false;
-    menu_up(msg3);
-  }
+void erase_menu() {
+	/* debug('erase_menu'); */
+	active_menu = false;
+	clic = false;
+	menu_up(msg3);
+}
 
-void mdn()
-   {
-           integer x,y,c,a,ix;
-           boolean tes;
+void mdn() {
+	integer x, y, c, a, ix;
+	boolean tes;
 
-     /* debug('mdn'); */
-     if (! active_menu)  return;
-     x=x_s; y=y_s;
-     if (! clic) 
-      {
-        if ((x==xprec) &&
-           (y==yprec))  return;
-        else {
-               xprec=x;
-               yprec=y;
-             }
-        tes=(y<11) && ((set::of(range(28*res,28*res+24),range(76*res,76*res+24), eos).has(x))
-                         || ((x>124*res) && (x<124*res+24))
-                         || ((x>172*res) && (x<172*res+24))
-                         || ((x>220*res) && (x<220*res+24))
-                         || ((x>268*res) && (x<268*res+24)));
-        if (tes) 
-           {
-             if (x<76*res)  ix=invent;
-              else if (x<124*res)  ix=depla;
-               else if (x<172*res)  ix=action;
-                else if (x<220*res)  ix=saction;
-                 else if (x<268*res)  ix=discut;
-                  else ix= fichier;
-             if ((ix!=msg3) || (! test0)) 
-              if (! ((ix==fichier) &&  (set::of(sauve, charge, eos).has(msg3)))) 
-                 {
-                   menu_up(msg3);
-                   menu_down(ix);
-                   msg3=ix;
-                   msg4=no_choice;
-                 }
-          }
-         else    /* Not in the MenuTitle line */
-          {
-            if ((y>11) && (test0))  util(x,y);
-          }
-      }
-     else          /* il y a eu 'clic' */
-     if ((msg3==fichier) && (msg4!=no_choice)) 
-       {
-         clic=false;
-         menu_up(msg3);
-         if (lo(msg4)==1)  msg3=7;
-                   else msg3=8;
-         menu_down(msg3);
-       }
-     else    /*  il y a eu clic sur un autre menu  */
-       {
-         choisi=(test0) && (msg4!=no_choice);
-         menu_up(msg3);
-         msg[4]=msg4;
-         msg[3]=msg3;
-         msg3=no_choice;
-         msg4=no_choice;
-         clic=false;
-       }
-   }
+	/* debug('mdn'); */
+	if (! active_menu)  return;
+	x = x_s;
+	y = y_s;
+	if (! clic) {
+		if ((x == xprec) &&
+		        (y == yprec))  return;
+		else {
+			xprec = x;
+			yprec = y;
+		}
+		tes = (y < 11) && ((set::of(range(28 * res, 28 * res + 24), range(76 * res, 76 * res + 24), eos).has(x))
+		                   || ((x > 124 * res) && (x < 124 * res + 24))
+		                   || ((x > 172 * res) && (x < 172 * res + 24))
+		                   || ((x > 220 * res) && (x < 220 * res + 24))
+		                   || ((x > 268 * res) && (x < 268 * res + 24)));
+		if (tes) {
+			if (x < 76 * res)  ix = invent;
+			else if (x < 124 * res)  ix = depla;
+			else if (x < 172 * res)  ix = action;
+			else if (x < 220 * res)  ix = saction;
+			else if (x < 268 * res)  ix = discut;
+			else ix = fichier;
+			if ((ix != msg3) || (! test0))
+				if (!((ix == fichier) && (set::of(sauve, charge, eos).has(msg3)))) {
+					menu_up(msg3);
+					menu_down(ix);
+					msg3 = ix;
+					msg4 = no_choice;
+				}
+		} else { /* Not in the MenuTitle line */
+			if ((y > 11) && (test0))  util(x, y);
+		}
+	} else        /* il y a eu 'clic' */
+		if ((msg3 == fichier) && (msg4 != no_choice)) {
+			clic = false;
+			menu_up(msg3);
+			if (lo(msg4) == 1)  msg3 = 7;
+			else msg3 = 8;
+			menu_down(msg3);
+		} else { /*  il y a eu clic sur un autre menu  */
+			choisi = (test0) && (msg4 != no_choice);
+			menu_up(msg3);
+			msg[4] = msg4;
+			msg[3] = msg3;
+			msg3 = no_choice;
+			msg4 = no_choice;
+			clic = false;
+		}
+}
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index a4fe1e1..fd4e2f5 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -2,1455 +2,1309 @@
 const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
 
 
-void testfi()
-   {
-     if (ioresult!= 0) 
-        {
-          caff= do_alert(err_mess,1);
-          exit(0);
-        }
-   }
-
-
-integer readclock()
-{
-               registres r;
-         integer s, m, h;
-
-/* debug('readclock');*/
-  integer readclock_result;
-  r.ax = 0x2c00;
-  intr(0x21,r);
-  {
-    h=(cardinal)r.cx >> 8;
-    m=r.cx % 256;
-    s=(cardinal)r.dx >> 8;
-  }
-  m= m * 60;
-  h= h* 3600;
-  readclock_result= h+ m+ s;
-  return readclock_result;
-}
-
-void modif(integer& nu)
-{
- /* debug('modif'); */
- if (nu== 26)  nu= 25;
- if ((nu> 29) && (nu< 36))  nu= nu- 4;
- if ((nu> 69) && (nu< 78))  nu= nu- 37;
- if ((nu> 99) && (nu< 194))  nu= nu- 59;
- if ((nu> 996) && (nu< 1000))  nu= nu- 862;
- if ((nu> 1500) && (nu< 1507))  nu= nu- 1363;
- if ((nu> 1507) && (nu< 1513))  nu= nu- 1364;
- if ((nu> 1999) && (nu< 2002))  nu= nu- 1851;
- if (nu== 2010)  nu= 151;
- if ((nu> 2011) && (nu< 2025))  nu= nu- 1860;
- if (nu== 2026)  nu= 165;
- if ((nu> 2029) && (nu< 2037))  nu= nu- 1864;
- if ((nu> 3000) && (nu< 3005))  nu= nu- 2828;
- if (nu== 4100)  nu= 177;
- if (nu== 4150)  nu= 178;
- if ((nu> 4151) && (nu< 4156))  nu= nu- 3973;
- if (nu== 4157)  nu= 183;
- if ((nu== 4160) || (nu== 4161))  nu= nu- 3976;
-}
-
-
-void dessine(integer ad, integer x, integer y)
-{
-  /* debug('dessine'); */
-  hide_mouse();
-  writepal(numpal);
-  pictout(ad,0,x,y);
-  show_mouse();
-}
-
-void dessine_rouleau()
-{
-  /* debug('dessine_rouleau'); */
-  writepal(89);
-  if (gd==her) 
-     {
-       mem[0x7000+14]=15;
-     }
-  hide_mouse();
-  pictout(0x73a2,0,0,0);
-  show_mouse();
-}
-
-
-void text_color(integer c)
-{
-  color_txt= c;
+void testfi() {
+	if (ioresult != 0) {
+		caff = do_alert(err_mess, 1);
+		exit(0);
+	}
+}
+
+
+integer readclock() {
+	registres r;
+	integer s, m, h;
+
+	/* debug('readclock');*/
+	integer readclock_result;
+	r.ax = 0x2c00;
+	intr(0x21, r);
+	{
+		h = (cardinal)r.cx >> 8;
+		m = r.cx % 256;
+		s = (cardinal)r.dx >> 8;
+	}
+	m = m * 60;
+	h = h * 3600;
+	readclock_result = h + m + s;
+	return readclock_result;
+}
+
+void modif(integer &nu) {
+	/* debug('modif'); */
+	if (nu == 26)  nu = 25;
+	if ((nu > 29) && (nu < 36))  nu = nu - 4;
+	if ((nu > 69) && (nu < 78))  nu = nu - 37;
+	if ((nu > 99) && (nu < 194))  nu = nu - 59;
+	if ((nu > 996) && (nu < 1000))  nu = nu - 862;
+	if ((nu > 1500) && (nu < 1507))  nu = nu - 1363;
+	if ((nu > 1507) && (nu < 1513))  nu = nu - 1364;
+	if ((nu > 1999) && (nu < 2002))  nu = nu - 1851;
+	if (nu == 2010)  nu = 151;
+	if ((nu > 2011) && (nu < 2025))  nu = nu - 1860;
+	if (nu == 2026)  nu = 165;
+	if ((nu > 2029) && (nu < 2037))  nu = nu - 1864;
+	if ((nu > 3000) && (nu < 3005))  nu = nu - 2828;
+	if (nu == 4100)  nu = 177;
+	if (nu == 4150)  nu = 178;
+	if ((nu > 4151) && (nu < 4156))  nu = nu - 3973;
+	if (nu == 4157)  nu = 183;
+	if ((nu == 4160) || (nu == 4161))  nu = nu - 3976;
+}
+
+
+void dessine(integer ad, integer x, integer y) {
+	/* debug('dessine'); */
+	hide_mouse();
+	writepal(numpal);
+	pictout(ad, 0, x, y);
+	show_mouse();
+}
+
+void dessine_rouleau() {
+	/* debug('dessine_rouleau'); */
+	writepal(89);
+	if (gd == her) {
+		mem[0x7000 + 14] = 15;
+	}
+	hide_mouse();
+	pictout(0x73a2, 0, 0, 0);
+	show_mouse();
+}
+
+
+void text_color(integer c) {
+	color_txt = c;
 }
 
 /* NIVEAU 13 */
 
 
-void text1(integer x,integer y,integer nb,integer m)
-{
-       phrase st;
-       integer tay;
-       integer co;
-
-
-  /* debug('text'); */
-  if (res==1)  co=10; else co=6;
-  deline(m,st,tay);
-  if ((y==182) && (tay*co>nb*6))  y=176;
-  afftex(st,x,y,nb,20,color_txt);
-}
-
-void initouv()
- {
-      integer cx;
-
-   /* debug('initouv'); */
-   for( cx= 1; cx <= 7; cx ++) touv[cx]= chr(0);
- }
-
-void ecrf1()
-{
-  boite(0, 11, 512, 163, 15);           /* grand dessin */
-}
-
-void clsf1()
-{
-      integer i,j;
-
- /* debug('clsf1'); */
- hide_mouse();
- box(0,gd, 0,11, 514,175, 255);
-/* if Gd=ams then port[$3DD]:=15;
- case Gd of
-         ams,
-         cga : begin
-                 for j:=0 to 63 do
-                    begin
-                      for i:=6 to 86 do
-                         begin
-                           mem[$B800:i*80+j]:=0;
-                           mem[$Ba00:i*80+j]:=0;
-                         end;
-                      mem[$b800:6960+j]:=0;
-                      mem[$ba00:400+j]:=0;
-                    end;
-               end;
-         ega : begin
-                 port[$3C4]:= 2;
-                 port[$3C5]:= 15;
-                 port[$3CE]:= 8;
-                 port[$3CF]:= 255;
-                 for j:=0 to 63 do
-                    for i:=11 to 174 do
-                       mem[$A000:i*80+j]:=0;
-               end;
-         tan : begin
-                 for j:=0 to 128 do
-                    begin
-                      for i:=3 to 43 do
-                         begin
-                           mem[$B800:i*160+j]:=0;
-                           mem[$Ba00:i*160+j]:=0;
-                           mem[$bc00:i*160+j]:=0;
-                           if i<>43 then mem[$be00:i*160+j]:=0;
-                         end;
-                      mem[$be00:320+j]:=0;
-                    end;
-               end;
- end;
- droite(256*res,11,256*res,175,0);*/
- show_mouse();
-}
-
-void clsf2()
-{
-       integer i,j;
-
- /* debug('clsf2'); */
- hide_mouse();
- if (f2_all) 
-    {
-      box(0,gd,1,176,633,199,255);
-      boite(0,175,634,24,15);
-      f2_all=false;
-    }
-  else
-    {
-      box(0,gd,1,176,633,190,255);
-      boite(0,175,634,15,15);
-    }
- show_mouse();
-}
-
-void ecrf2()
-{
-  /* debug('ecrf2'); */
-  text_color(5);
-  /*boite(0,175,630,15,15);*/
-}
-
-void ecr2(str255 str_)
-{
-      integer tab;
-      integer tlig;
-
- /* debug('ecr2 : '+str_);*/
- if (res==1)  tab=10; else tab=6;
- putxy(8,177);
- tlig=59+pred(integer,res)*36;
- if (length(str_)<tlig)  writeg(str_,5);
-  else if (length(str_)<(tlig << 1)) 
-          {
-            putxy(8,176);
-            writeg(copy(str_,1,pred(integer,tlig)),5);
-            putxy(8,182);
-            writeg(copy(str_,tlig,tlig << 1),5);
-          }
-   else {
-          f2_all=true;
-          clsf2();
-          putxy(8,176);
-          writeg(copy(str_,1,pred(integer,tlig)),5);
-          putxy(8,182);
-          writeg(copy(str_,tlig,pred(integer,tlig << 1)),5);
-          putxy(8,190);
-          writeg(copy(str_,tlig << 1,tlig*3),5);
-        }
-}
-
-void clsf3()
-{
-       integer i,j;
-
-  /* debug('clsf3'); */
-  hide_mouse();
-  box(0,gd,1,192,633,199,255);
-  boite(0,191,634,8,15);
-  show_mouse();
-}
-
-void ecr3(str255 text)
-{
- /* debug('ecr3 : '+text);*/
- clsf3();
- putxy(8,192);
- writeg(text,5);
-}
-
-void ecrf6()
-{
-  /* debug('ecrf6'); */
-  text_color(5);
-  boite(62, 33, 363, 80, 15);
-}
-
-void ecrf7()
-{
- text_color(4);
-/* draw_mode(2);
- text_height(4*res);
- text_style(normal);*/
-}
-
-void clsf10()
-{
-      integer co,cod;
-      varying_string<8> st;
-
- /* debug('clsf10'); */
- hide_mouse();
- if (res==1) 
-    {
-      co=634;
-      cod=534;
-    }
-  else
-    {
-      co=600;
-      cod=544;
-    }
- box(15,gd, cod, 93, co, 98, 255);
- if (s.conf< 33)  st="Cool";
-               else
- if (s.conf< 66)  st=" Lourde ";
-               else
- if (s.conf> 65)  st="Malsaine";
- if (res==1)  co=10; else co=6;
- co= 574-((cardinal)co*length(st) >> 1);
- putxy(co,92);
- writeg(st,4);
- if (res==1)  co=620; else co=584;
- box(15,gd, 560, 24, co, 86, 255);
-/* rempli(69,12,32,5,255);*/
- show_mouse();
-}
-
-   void stop()
-     {
-       clrscr;
-       hirs();
-       gd=ams;
-       hirs();
-       exit(0);
-     }
-
-void paint_rect(integer x, integer y, integer dx, integer dy)
-   {
-         integer co;
-
-     /* debug('paint_rect'); */
-     if (gd==cga)  co= 3;
-               else co=11;
-     box(co,gd,x,y,x+dx,y+dy,255);
-   }
-
-integer hazard(integer min,integer max)
-   {
-         integer ha1;
-         real ha2;
-
-     /* debug('hazard'); */
-     integer hazard_result;
-     ha2= Random();
-     ha1= trunc(ha2*(max-min));
-     hazard_result= min+ ha1;
-     return hazard_result;
-   }
-
-void calch(integer& j,integer& h,integer& m)
-{
- integer th,nh;
-
-/* debug('calch');*/
- nh= readclock();
- th= jh+ ((nh- mh) / t);
- m= ((th % 2)+ vm)* 30;
- h= ((cardinal)th >> 1)+ vh;
- if (m== 60) 
- {
-  m= 0;
-  h= h+ 1;
- }
- j= (h / 24)+ vj;
- h= h- ((j- vj)* 24);
-}
-
-void conv(integer x, integer& y)
-{
- integer cx;
-
- /* debug('conv'); */
- cx= 1;
- y= 128;
- while (cx< x) 
- {
-  y= (cardinal)y >> 1;
-  cx= succ(integer,cx);
- }
+void text1(integer x, integer y, integer nb, integer m) {
+	phrase st;
+	integer tay;
+	integer co;
+
+
+	/* debug('text'); */
+	if (res == 1)  co = 10;
+	else co = 6;
+	deline(m, st, tay);
+	if ((y == 182) && (tay * co > nb * 6))  y = 176;
+	afftex(st, x, y, nb, 20, color_txt);
+}
+
+void initouv() {
+	integer cx;
+
+	/* debug('initouv'); */
+	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+}
+
+void ecrf1() {
+	boite(0, 11, 512, 163, 15);           /* grand dessin */
+}
+
+void clsf1() {
+	integer i, j;
+
+	/* debug('clsf1'); */
+	hide_mouse();
+	box(0, gd, 0, 11, 514, 175, 255);
+	/* if Gd=ams then port[$3DD]:=15;
+	 case Gd of
+	         ams,
+	         cga : begin
+	                 for j:=0 to 63 do
+	                    begin
+	                      for i:=6 to 86 do
+	                         begin
+	                           mem[$B800:i*80+j]:=0;
+	                           mem[$Ba00:i*80+j]:=0;
+	                         end;
+	                      mem[$b800:6960+j]:=0;
+	                      mem[$ba00:400+j]:=0;
+	                    end;
+	               end;
+	         ega : begin
+	                 port[$3C4]:= 2;
+	                 port[$3C5]:= 15;
+	                 port[$3CE]:= 8;
+	                 port[$3CF]:= 255;
+	                 for j:=0 to 63 do
+	                    for i:=11 to 174 do
+	                       mem[$A000:i*80+j]:=0;
+	               end;
+	         tan : begin
+	                 for j:=0 to 128 do
+	                    begin
+	                      for i:=3 to 43 do
+	                         begin
+	                           mem[$B800:i*160+j]:=0;
+	                           mem[$Ba00:i*160+j]:=0;
+	                           mem[$bc00:i*160+j]:=0;
+	                           if i<>43 then mem[$be00:i*160+j]:=0;
+	                         end;
+	                      mem[$be00:320+j]:=0;
+	                    end;
+	               end;
+	 end;
+	 droite(256*res,11,256*res,175,0);*/
+	show_mouse();
+}
+
+void clsf2() {
+	integer i, j;
+
+	/* debug('clsf2'); */
+	hide_mouse();
+	if (f2_all) {
+		box(0, gd, 1, 176, 633, 199, 255);
+		boite(0, 175, 634, 24, 15);
+		f2_all = false;
+	} else {
+		box(0, gd, 1, 176, 633, 190, 255);
+		boite(0, 175, 634, 15, 15);
+	}
+	show_mouse();
+}
+
+void ecrf2() {
+	/* debug('ecrf2'); */
+	text_color(5);
+	/*boite(0,175,630,15,15);*/
+}
+
+void ecr2(str255 str_) {
+	integer tab;
+	integer tlig;
+
+	/* debug('ecr2 : '+str_);*/
+	if (res == 1)  tab = 10;
+	else tab = 6;
+	putxy(8, 177);
+	tlig = 59 + pred(integer, res) * 36;
+	if (length(str_) < tlig)  writeg(str_, 5);
+	else if (length(str_) < (tlig << 1)) {
+		putxy(8, 176);
+		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		putxy(8, 182);
+		writeg(copy(str_, tlig, tlig << 1), 5);
+	} else {
+		f2_all = true;
+		clsf2();
+		putxy(8, 176);
+		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		putxy(8, 182);
+		writeg(copy(str_, tlig, pred(integer, tlig << 1)), 5);
+		putxy(8, 190);
+		writeg(copy(str_, tlig << 1, tlig * 3), 5);
+	}
+}
+
+void clsf3() {
+	integer i, j;
+
+	/* debug('clsf3'); */
+	hide_mouse();
+	box(0, gd, 1, 192, 633, 199, 255);
+	boite(0, 191, 634, 8, 15);
+	show_mouse();
+}
+
+void ecr3(str255 text) {
+	/* debug('ecr3 : '+text);*/
+	clsf3();
+	putxy(8, 192);
+	writeg(text, 5);
+}
+
+void ecrf6() {
+	/* debug('ecrf6'); */
+	text_color(5);
+	boite(62, 33, 363, 80, 15);
+}
+
+void ecrf7() {
+	text_color(4);
+	/* draw_mode(2);
+	 text_height(4*res);
+	 text_style(normal);*/
+}
+
+void clsf10() {
+	integer co, cod;
+	varying_string<8> st;
+
+	/* debug('clsf10'); */
+	hide_mouse();
+	if (res == 1) {
+		co = 634;
+		cod = 534;
+	} else {
+		co = 600;
+		cod = 544;
+	}
+	box(15, gd, cod, 93, co, 98, 255);
+	if (s.conf < 33)  st = "Cool";
+	else if (s.conf < 66)  st = " Lourde ";
+	else if (s.conf > 65)  st = "Malsaine";
+	if (res == 1)  co = 10;
+	else co = 6;
+	co = 574 - ((cardinal)co * length(st) >> 1);
+	putxy(co, 92);
+	writeg(st, 4);
+	if (res == 1)  co = 620;
+	else co = 584;
+	box(15, gd, 560, 24, co, 86, 255);
+	/* rempli(69,12,32,5,255);*/
+	show_mouse();
+}
+
+void stop() {
+	clrscr;
+	hirs();
+	gd = ams;
+	hirs();
+	exit(0);
+}
+
+void paint_rect(integer x, integer y, integer dx, integer dy) {
+	integer co;
+
+	/* debug('paint_rect'); */
+	if (gd == cga)  co = 3;
+	else co = 11;
+	box(co, gd, x, y, x + dx, y + dy, 255);
+}
+
+integer hazard(integer min, integer max) {
+	integer ha1;
+	real ha2;
+
+	/* debug('hazard'); */
+	integer hazard_result;
+	ha2 = Random();
+	ha1 = trunc(ha2 * (max - min));
+	hazard_result = min + ha1;
+	return hazard_result;
+}
+
+void calch(integer &j, integer &h, integer &m) {
+	integer th, nh;
+
+	/* debug('calch');*/
+	nh = readclock();
+	th = jh + ((nh - mh) / t);
+	m = ((th % 2) + vm) * 30;
+	h = ((cardinal)th >> 1) + vh;
+	if (m == 60) {
+		m = 0;
+		h = h + 1;
+	}
+	j = (h / 24) + vj;
+	h = h - ((j - vj) * 24);
+}
+
+void conv(integer x, integer &y) {
+	integer cx;
+
+	/* debug('conv'); */
+	cx = 1;
+	y = 128;
+	while (cx < x) {
+		y = (cardinal)y >> 1;
+		cx = succ(integer, cx);
+	}
 }
 
 /* NIVEAU 12 */
-void okpas()
-{
-  tesok=true;
-}
-
-void modobj(integer m)
-{
- phrase str_;
- str30 strp;
- integer i,tay;
-
- /* debug('modobj'); */
- strp=' ';
- if (m!= 500) 
-    {
-      deline(m- 501+ c_st41,str_,tay);
-      strp= delig;
-    }
- menut( invt[8], strp);
- menu_disable( invt[8]);
-}
-
-void modobj2(integer m,boolean t1,boolean t2)
-{
- phrase str_;
- str30 strp;
- integer i,tay;
-
- /* debug('modobj'); */
-  strp=' ';
- if (t1 || t2)  okpas();
-             else tesok=false;;
- if (m!= 500) 
-    {
-      deline(m- 501+ c_st41,str_,tay);
-      strp= delig;
-    }
- menut( invt[8], strp);
- menu_disable( invt[8]);
-}
-
-
-void repon(integer f,integer m)
-{
- str255 str_;
- varying_string<40> str1;
- phrase st;
- text1 fic;
- integer i, xco, dx, caspe, tay;
-
- /* debug('repon fenetre nø'+chr(f+48));*/
- if ((m> 499) && (m< 563)) 
- {
-  deline( m-501+c_st41,st,tay);
-  if (tay>((58+pred(integer,res)*37) << 1))  f2_all= true;
-                                 else f2_all= false;
-  clsf2();
-  afftex(st,8,176,85,3,5);
- }
- else
- {
-  modif(m);
-  if (f== 8)  f= 2;
-  if (f== 1)  f= 6;
-  if (f== 2) 
-  {
-   clsf2();
-   ecrf2();
-   text1(8, 182, 103, m);
-   if ((m== 68) || (m== 69))  s.teauto[40]= '*';
-   if ((m== 104) && (caff== 14)) 
-   {
-    s.teauto[36]= '*';
-    if (s.teauto[39]== '*') 
-    {
-     s.pourc[3]= '*';
-     s.teauto[38]= '*';
-    }
-   }
-  }
-  if (set::of(6,9, eos).has(f)) 
-  {
-   deline(m,st,tay);
-   if (f==6)  i=4;
-          else i=5;
-   afftex(st,80,40,60,25,i);
-   if (m== 180)  s.pourc[6]= '*';
-   if (m== 179)  s.pourc[10]= '*';
-  }
-  if (f== 7)            /* messint */
-  {
-   ecrf7();
-   deline(m,st,tay);
-   if (res==1) 
-      {
-        xco=252-tay*5;
-        caspe= 100;
-        dx= 80;
-      }
-    else
-      {
-        xco=252-tay*3;
-        caspe= 144;
-        dx=50;
-      }
-   if (tay<40)  afftex(st,xco,86,dx,3,5);
-             else afftex(st,caspe,86,dx,3,5);
-  }
- }
-}
-
-void f3f8()
-{
-      integer co;
-
-  if (res==1)  co=107; else co=64;
-  putxy(3,44);
-  writeg(f3,5);
-  ywhere= 51;
-  writeg(f8,5);
-  boite(0,42,co,16,7);
-}
-
-void t5(integer cx)
-{
- /* debug('t5'); */
- if (cx== 10)  blo= false;
- if (cx!= 1) 
- {
-  bh1= false;
-  bf1= false;
- }
- if (cx!= 2)  bh2= false;
- if (cx!= 4) 
- {
-  bh4= false;
-  bf4= false;
- }
- if (cx!= 5)  bh5= false;
- if (cx!= 6)  bh6= false;
- if (cx!= 8)  bh8= false;
- if (cx!= 3)  bt3= false;
- if (cx!= 7)  bt7= false;
- if (cx!= 9)  bh9= false;
-}
-
-void affper(integer per)
-{
- integer cx;
-
- /* debug('affper'); */
- for( cx= 1; cx <= 8; cx ++) menu_disable( disc[cx]);
- clsf10();
- if ((per & 128)== 128) 
- {
-   putxy(560,24);
-   writeg("LEO",4);
-   menu_enable( disc[1]);
- }
- if ((per & 64)== 64) 
- {
-  putxy(560, 32);
-  writeg("PAT",4);
-  menu_enable( disc[2]);
- }
- if ((per & 32)== 32) 
- {
-  putxy(560, 40);
-  writeg("GUY",4);
-  menu_enable( disc[3]);
- }
- if ((per & 16)== 16) 
- {
-  putxy(560,48);
-  writeg("EVA",4);
-  menu_enable( disc[4]);
- }
- if ((per & 8)== 8) 
- {
-  putxy(560,56);
-  writeg("BOB",4);
-  menu_enable( disc[5]);
- }
- if ((per & 4)== 4) 
- {
-  putxy(560, 64);
-  writeg("LUC",4);
-  menu_enable( disc[6]);
- }
- if ((per & 2)== 2) 
- {
-  putxy(560, 72);
-  writeg("IDA",4);
-  menu_enable( disc[7]);
- }
- if ((per & 1)== 1) 
- {
-  putxy(560, 80);
-  writeg("MAX",4);
-  menu_enable( disc[8]);
- }
- ipers= per;
-}
-
-/* overlay */ void choix(integer min,integer max, integer& per)
-{
- boolean i;
- integer haz,cx,cy,cz;
- long_integer per2,cz2;
-
- /* debug('o0 choix'); */
- haz= hazard(min,max);
- if (haz> 4) 
- {
-  haz= 8- haz;
-  i= true;
- }
- else i= false;
- cx= 0;
- per= 0;
- while (cx< haz) 
- {
-  cy= hazard(1,8);
-  conv(cy,cz);
-  if ((per & cz)!= cz) 
-  {
-   cx= cx+ 1;
-   per= (per | cz);
-  }
- }
- if (i)  per= 255- per;
- i= false;
-}
-
-/* overlay */ void cpl1(integer& p)
-{
- integer j,h,m;
-
- /* debug('o0 cpl1'); */
- calch(j,h,m);
- if ((h> 7) || (h< 11))  p= 25;
- if ((h> 10) && (h< 14))  p= 35;
- if ((h> 13) && (h< 16))  p= 50;
- if ((h> 15) && (h< 18))  p= 5;
- if ((h> 17) && (h< 22))  p= 35;
- if ((h> 21) && (h< 24))  p= 50;
- if ((h>= 0) && (h< 8))  p= 70;
- mdn();
-}
-
-/* overlay */ void cpl2(integer& p)
-{
- integer j,h,m;
-
- /* debug('o0 cpl2'); */
- calch(j,h,m);
- if ((h> 7) && (h< 11))  p= -2;
- if (h== 11)  p= 100;
- if ((h> 11) && (h< 23))  p= 10;
- if (h== 23)  p= 20;
- if ((h>= 0) && (h< 8))  p= 50;
-}
-
-/* overlay */ void cpl3(integer& p)
-{
- integer j,h,m;
-
- /* debug('o0 cpl3'); */
- calch(j,h,m);
- if (((h> 8) && (h< 10)) || ((h> 19) && (h< 24)))  p= 34;
- if (((h> 9) && (h< 20)) || ((h>= 0) && (h< 9)))  p= 0;
-}
-
-/* overlay */ void cpl5(integer& p)
-{
- integer j,h,m;
-
- /* debug('o0 cpl5'); */
- calch(j,h,m);
- if ((h> 6) && (h< 10))  p= 0;
- if (h== 10)  p= 100;
- if ((h> 10) && (h< 24))  p= 15;
- if ((h>= 0) && (h< 7))  p= 50;
-}
-
-/* overlay */ void cpl6(integer& p)
-{
- integer j,h,m;
-
- /* debug('o0 cpl6'); */
- calch(j,h,m);
- if (((h> 7) && (h< 13)) || ((h> 17) && (h< 20)))  p= -2;
- if (((h> 12) && (h< 17)) || ((h> 19) && (h< 24)))  p= 35;
- if (h== 17)  p= 100;
- if ((h>= 0) && (h< 8))  p= 60;
-}
-
-void person()
-{
- const char m1[] = "Vous";
- const char m2[] = "ˆtes";
- const char m3[] = "SEUL";
- integer cf;
- str255 str_;
-
- /* debug('person'); */
- for( cf= 1; cf <= 8; cf ++) menu_disable( disc[cf]);
- clsf10();
- putxy(560, 30);
- writeg(m1,4);
- putxy(560, 50);
- writeg(m2,4);
- putxy(560, 70);
- writeg(m3,4);
- ipers= 0;
-}
-
-void chlm(integer& per)
-{
-  /* debug('chlm'); */
-  per= hazard(1,2);
-  if (per== 2)  per= 128;
-}
-
-void pendule()
-{
- const matrix<1,2,1,12,integer> cv
-    = {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
-      {{-5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}} }};
- const integer x = 580;
- const integer y = 123;
- const integer rg = 9;
- integer h,co;
-
-
- /* debug('pendule'); */
- hide_mouse();
- /*paint_rect(572,114,18,20);
- paint_rect(577,114,6,20);*/
- paint_rect(570,118,20,10);
- paint_rect(578,114,6,18);
- if (set::of(cga,her, eos).has(gd))  co=0; else co=1;
- if (min== 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y- rg), co);
-           else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y+ rg), co);
- h= heu;
- if (h> 12)  h= h- 12;
- if (h== 0)  h= 12;
- droite(((cardinal)x >> 1)*res, y, ((cardinal)(x+ cv[1][h]) >> 1)*res, y+ cv[2][h], co);
- show_mouse();
- putxy( 568, 154);
- if (heu> 11)  writeg( "PM ",1);
-            else writeg( "AM ",1);
- putxy( 550, 160);
- if (set::of(range(0,8), eos).has(jou))  writeg(string(chr(jou+49))+"& jour",1);
+void okpas() {
+	tesok = true;
+}
+
+void modobj(integer m) {
+	phrase str_;
+	str30 strp;
+	integer i, tay;
+
+	/* debug('modobj'); */
+	strp = ' ';
+	if (m != 500) {
+		deline(m - 501 + c_st41, str_, tay);
+		strp = delig;
+	}
+	menut(invt[8], strp);
+	menu_disable(invt[8]);
+}
+
+void modobj2(integer m, boolean t1, boolean t2) {
+	phrase str_;
+	str30 strp;
+	integer i, tay;
+
+	/* debug('modobj'); */
+	strp = ' ';
+	if (t1 || t2)  okpas();
+	else tesok = false;;
+	if (m != 500) {
+		deline(m - 501 + c_st41, str_, tay);
+		strp = delig;
+	}
+	menut(invt[8], strp);
+	menu_disable(invt[8]);
+}
+
+
+void repon(integer f, integer m) {
+	str255 str_;
+	varying_string<40> str1;
+	phrase st;
+	text1 fic;
+	integer i, xco, dx, caspe, tay;
+
+	/* debug('repon fenetre nø'+chr(f+48));*/
+	if ((m > 499) && (m < 563)) {
+		deline(m - 501 + c_st41, st, tay);
+		if (tay > ((58 + pred(integer, res) * 37) << 1))  f2_all = true;
+		else f2_all = false;
+		clsf2();
+		afftex(st, 8, 176, 85, 3, 5);
+	} else {
+		modif(m);
+		if (f == 8)  f = 2;
+		if (f == 1)  f = 6;
+		if (f == 2) {
+			clsf2();
+			ecrf2();
+			text1(8, 182, 103, m);
+			if ((m == 68) || (m == 69))  s.teauto[40] = '*';
+			if ((m == 104) && (caff == 14)) {
+				s.teauto[36] = '*';
+				if (s.teauto[39] == '*') {
+					s.pourc[3] = '*';
+					s.teauto[38] = '*';
+				}
+			}
+		}
+		if (set::of(6, 9, eos).has(f)) {
+			deline(m, st, tay);
+			if (f == 6)  i = 4;
+			else i = 5;
+			afftex(st, 80, 40, 60, 25, i);
+			if (m == 180)  s.pourc[6] = '*';
+			if (m == 179)  s.pourc[10] = '*';
+		}
+		if (f == 7) {         /* messint */
+			ecrf7();
+			deline(m, st, tay);
+			if (res == 1) {
+				xco = 252 - tay * 5;
+				caspe = 100;
+				dx = 80;
+			} else {
+				xco = 252 - tay * 3;
+				caspe = 144;
+				dx = 50;
+			}
+			if (tay < 40)  afftex(st, xco, 86, dx, 3, 5);
+			else afftex(st, caspe, 86, dx, 3, 5);
+		}
+	}
+}
+
+void f3f8() {
+	integer co;
+
+	if (res == 1)  co = 107;
+	else co = 64;
+	putxy(3, 44);
+	writeg(f3, 5);
+	ywhere = 51;
+	writeg(f8, 5);
+	boite(0, 42, co, 16, 7);
+}
+
+void t5(integer cx) {
+	/* debug('t5'); */
+	if (cx == 10)  blo = false;
+	if (cx != 1) {
+		bh1 = false;
+		bf1 = false;
+	}
+	if (cx != 2)  bh2 = false;
+	if (cx != 4) {
+		bh4 = false;
+		bf4 = false;
+	}
+	if (cx != 5)  bh5 = false;
+	if (cx != 6)  bh6 = false;
+	if (cx != 8)  bh8 = false;
+	if (cx != 3)  bt3 = false;
+	if (cx != 7)  bt7 = false;
+	if (cx != 9)  bh9 = false;
+}
+
+void affper(integer per) {
+	integer cx;
+
+	/* debug('affper'); */
+	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
+	clsf10();
+	if ((per & 128) == 128) {
+		putxy(560, 24);
+		writeg("LEO", 4);
+		menu_enable(disc[1]);
+	}
+	if ((per & 64) == 64) {
+		putxy(560, 32);
+		writeg("PAT", 4);
+		menu_enable(disc[2]);
+	}
+	if ((per & 32) == 32) {
+		putxy(560, 40);
+		writeg("GUY", 4);
+		menu_enable(disc[3]);
+	}
+	if ((per & 16) == 16) {
+		putxy(560, 48);
+		writeg("EVA", 4);
+		menu_enable(disc[4]);
+	}
+	if ((per & 8) == 8) {
+		putxy(560, 56);
+		writeg("BOB", 4);
+		menu_enable(disc[5]);
+	}
+	if ((per & 4) == 4) {
+		putxy(560, 64);
+		writeg("LUC", 4);
+		menu_enable(disc[6]);
+	}
+	if ((per & 2) == 2) {
+		putxy(560, 72);
+		writeg("IDA", 4);
+		menu_enable(disc[7]);
+	}
+	if ((per & 1) == 1) {
+		putxy(560, 80);
+		writeg("MAX", 4);
+		menu_enable(disc[8]);
+	}
+	ipers = per;
+}
+
+/* overlay */ void choix(integer min, integer max, integer &per) {
+	boolean i;
+	integer haz, cx, cy, cz;
+	long_integer per2, cz2;
+
+	/* debug('o0 choix'); */
+	haz = hazard(min, max);
+	if (haz > 4) {
+		haz = 8 - haz;
+		i = true;
+	} else i = false;
+	cx = 0;
+	per = 0;
+	while (cx < haz) {
+		cy = hazard(1, 8);
+		conv(cy, cz);
+		if ((per & cz) != cz) {
+			cx = cx + 1;
+			per = (per | cz);
+		}
+	}
+	if (i)  per = 255 - per;
+	i = false;
+}
+
+/* overlay */ void cpl1(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl1'); */
+	calch(j, h, m);
+	if ((h > 7) || (h < 11))  p = 25;
+	if ((h > 10) && (h < 14))  p = 35;
+	if ((h > 13) && (h < 16))  p = 50;
+	if ((h > 15) && (h < 18))  p = 5;
+	if ((h > 17) && (h < 22))  p = 35;
+	if ((h > 21) && (h < 24))  p = 50;
+	if ((h >= 0) && (h < 8))  p = 70;
+	mdn();
+}
+
+/* overlay */ void cpl2(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl2'); */
+	calch(j, h, m);
+	if ((h > 7) && (h < 11))  p = -2;
+	if (h == 11)  p = 100;
+	if ((h > 11) && (h < 23))  p = 10;
+	if (h == 23)  p = 20;
+	if ((h >= 0) && (h < 8))  p = 50;
+}
+
+/* overlay */ void cpl3(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl3'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))  p = 34;
+	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
+}
+
+/* overlay */ void cpl5(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl5'); */
+	calch(j, h, m);
+	if ((h > 6) && (h < 10))  p = 0;
+	if (h == 10)  p = 100;
+	if ((h > 10) && (h < 24))  p = 15;
+	if ((h >= 0) && (h < 7))  p = 50;
+}
+
+/* overlay */ void cpl6(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl6'); */
+	calch(j, h, m);
+	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))  p = -2;
+	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))  p = 35;
+	if (h == 17)  p = 100;
+	if ((h >= 0) && (h < 8))  p = 60;
+}
+
+void person() {
+	const char m1[] = "Vous";
+	const char m2[] = "ˆtes";
+	const char m3[] = "SEUL";
+	integer cf;
+	str255 str_;
+
+	/* debug('person'); */
+	for (cf = 1; cf <= 8; cf ++) menu_disable(disc[cf]);
+	clsf10();
+	putxy(560, 30);
+	writeg(m1, 4);
+	putxy(560, 50);
+	writeg(m2, 4);
+	putxy(560, 70);
+	writeg(m3, 4);
+	ipers = 0;
+}
+
+void chlm(integer &per) {
+	/* debug('chlm'); */
+	per = hazard(1, 2);
+	if (per == 2)  per = 128;
+}
+
+void pendule() {
+	const matrix<1, 2, 1, 12, integer> cv
+	= {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
+			{{ -5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}}
+		}
+	};
+	const integer x = 580;
+	const integer y = 123;
+	const integer rg = 9;
+	integer h, co;
+
+
+	/* debug('pendule'); */
+	hide_mouse();
+	/*paint_rect(572,114,18,20);
+	paint_rect(577,114,6,20);*/
+	paint_rect(570, 118, 20, 10);
+	paint_rect(578, 114, 6, 18);
+	if (set::of(cga, her, eos).has(gd))  co = 0;
+	else co = 1;
+	if (min == 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y - rg), co);
+	else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y + rg), co);
+	h = heu;
+	if (h > 12)  h = h - 12;
+	if (h == 0)  h = 12;
+	droite(((cardinal)x >> 1)*res, y, ((cardinal)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	show_mouse();
+	putxy(568, 154);
+	if (heu > 11)  writeg("PM ", 1);
+	else writeg("AM ", 1);
+	putxy(550, 160);
+	if (set::of(range(0, 8), eos).has(jou))  writeg(string(chr(jou + 49)) + "& jour", 1);
 }
 
 /*************
  * NIVEAU 11 *
  *************/
 
-void debloc(integer l)
-{
-/* debug('debloc'); */
- num= 0;
- x= 0;
- y= 0;
- if ((l!= 26) && (l!= 15))  t5(l);
- mpers= ipers;
+void debloc(integer l) {
+	/* debug('debloc'); */
+	num = 0;
+	x = 0;
+	y = 0;
+	if ((l != 26) && (l != 15))  t5(l);
+	mpers = ipers;
 }
 
-/* overlay */ void cpl10(integer& p,integer& h)
-{
- integer j,m;
+/* overlay */ void cpl10(integer &p, integer &h) {
+	integer j, m;
 
-/* debug('o1 cpl10'); */
- calch(j,h,m);
- if (((h> 7) && (h< 11)) || ((h> 11) && (h< 14))
-  || ((h> 18) && (h< 21)))  p= 100;
- if ((h== 11) || ((h> 20) && (h< 24)))  p= 45;
- if (((h> 13) && (h< 17)) || (h== 18))  p= 35;
- if (h== 17)  p= 60;
- if ((h>= 0) && (h< 8))  p= 5;
+	/* debug('o1 cpl10'); */
+	calch(j, h, m);
+	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14))
+	        || ((h > 18) && (h < 21)))  p = 100;
+	if ((h == 11) || ((h > 20) && (h < 24)))  p = 45;
+	if (((h > 13) && (h < 17)) || (h == 18))  p = 35;
+	if (h == 17)  p = 60;
+	if ((h >= 0) && (h < 8))  p = 5;
 }
 
-/* overlay */ void cpl11(integer& p,integer& h)
-{
- integer j,m;
-
-/* debug('o1 cpl11'); */
- calch(j,h,m);
- if (((h> 8) && (h< 12)) || ((h> 20) && (h< 24)))  p= 25;
- if (((h> 11) && (h< 14)) || ((h> 18) && (h< 21)))  p= 5;
- if ((h> 13) && (h< 17))  p= 55;
- if ((h> 16) && (h< 19))  p= 45;
- if ((h>= 0) && (h< 9))  p= 0;
-}
-
-/* overlay */ void cpl12(integer& p)
-{
- integer j,h,m;
-
-/* debug('o1 cpl12'); */
- calch(j,h,m);
- if (((h> 8) && (h< 15)) || ((h> 16) && (h< 22)))  p= 55;
- if (((h> 14) && (h< 17)) || ((h> 21) && (h< 24)))  p= 25;
- if ((h>= 0) && (h< 5))  p= 0;
- if ((h> 4) && (h< 9))  p= 15;
-}
-
-/* overlay */ void cpl13(integer& p)
-{
-/* debug('o1 cpl13'); */
- p= 0;
-}
-
-/* overlay */ void cpl15(integer& p)
-{
- integer j,h,m;
+/* overlay */ void cpl11(integer &p, integer &h) {
+	integer j, m;
 
-/* debug('o1 cpl15'); */
- calch(j,h,m);
- if ((h> 7) && (h< 12))  p= 25;
- if ((h> 11) && (h< 14))  p= 0;
- if ((h> 13) && (h< 18))  p= 10;
- if ((h> 17) && (h< 20))  p= 55;
- if ((h> 19) && (h< 22))  p= 5;
- if ((h> 21) && (h< 24))  p= 15;
- if ((h>= 0) && (h< 8))  p= -15;
-}
-
-/* overlay */ void cpl20(integer& p,integer& h)
-{
- integer j,m;
-
-/* debug('o1 cpl20'); */
- calch(j,h,m);
- if (h== 10)  p= 65;
- if ((h> 10) && (h< 21))  p= 5;
- if ((h> 20) && (h< 24))  p= -15;
- if ((h>= 0) && (h< 5))  p= -300;
- if ((h> 4) && (h< 10))  p= -5;
-}
-
-/* overlay */ void quelq1(integer l)
-{
- integer per;
-
-/* debug('o1 quelq1'); */
- per= hazard(1,2);
- if (l== 1) 
-  if (per== 1)  bh1= true; else bf1= true;
- if (l== 4) 
-  if (per== 1)  bh4= true; else bf4= true;
- ipers= 10;
-}
-
-/* overlay */ void quelq2()
-{
-/* debug('o1 quelq2'); */
- if (li== 2)  bh2= true; else bh9= true;
- ipers= 10;
-}
-
-/* overlay */ void quelq5()
-{
-/* debug('o1 quelq5'); */
- bh5= true;
- ipers= 10;
-}
-
-/* overlay */ void quelq6(integer l)
-{
- integer per;
-
-/* debug('o1 quelq6'); */
- if (l== 6)  bh6= true;
- if (l== 8)  bh8= true;
- ipers= 10;
-}
-
-/* overlay */ void quelq10(integer h, integer& per)
-{
- integer min,max;
-
-/* debug('o1 quelq10'); */
- if ((h>= 0) && (h< 8))  chlm(per); else
- {
-  if ((h> 7) && (h< 10)) 
-  {
-   min= 5;
-   max= 7;
-  }
-  if ((h> 9) && (h< 12)) 
-  {
-   min= 1;
-   max= 4;
-  }
-  if (((h> 11) && (h< 15)) || ((h> 18) && (h< 21))) 
-  {
-   min= 6;
-   max= 8;
-  }
-  if (((h> 14) && (h< 19)) || ((h> 20) && (h< 24))) 
-  {
-   min= 1;
-   max= 5;
-  }
-  choix(min,max,per);
- }
- affper(per);
-}
-
-/* overlay */ void quelq11(integer h, integer& per)
-{
- integer min,max;
-
-/* debug('o1 quelq11'); */
- if ((h>= 0) && (h< 8))  chlm(per); else
- {
-  if (((h> 7) && (h< 10)) || ((h>20) && (h< 24))) 
-  {
-   min= 1;
-   max= 3;
-  }
-  if (((h> 9) && (h< 12)) || ((h> 13) && (h< 19))) 
-  {
-   min= 1;
-   max= 4;
-  }
-  if (((h> 11) && (h< 14)) || ((h> 18) && (h< 21)))
-  {
-   min= 1;
-   max= 2;
-  }
-  choix(min,max,per);
- }
- affper(per);
-}
-
-/* overlay */ void quelq12(integer& per)
-{
-/* debug('o1 quelq12'); */
- chlm(per);
- affper(per);
-}
-
-/* overlay */ void quelq15(integer& per)
-{
- integer cx;
- boolean test;
-
-
-/* debug('o1 quelq15'); */
- per= 0;
- if (per== 0) 
- {
-   do {
-     cx= hazard(1,8);
-     test =(((cx== 1) && (bh2 || bh9)) ||
-             ((cx== 2) && bh8) ||
-             ((cx== 3) && bh4) ||
-             ((cx== 4) && bf4) ||
-             ((cx== 5) && bh6) ||
-             ((cx== 6) && bh1) ||
-             ((cx== 7) && bf1) ||
-             ((cx== 8) && bh5));
-  } while (!(! test));
-  conv(cx,per);
-  affper(per);
- }
-}
-
-/* overlay */ void quelq20(integer h, integer& per)
-{
- integer min,max;
-
-/* debug('o1 quelq20'); */
- if (((h>= 0) && (h< 10)) || ((h> 18) && (h< 24)))  chlm(per);
- else
- {
-  if ((h> 9) && (h< 12)) 
-  {
-   min= 3;
-   max= 7;
-  }
-  if ((h> 11) && (h< 18)) 
-  {
-   min= 1;
-   max= 2;
-  }
-  if (h== 18) 
-  {
-   min= 2;
-   max= 4;
-  }
-  choix(min,max,per);
- }
- affper(per);
-}
-
-
-/* overlay */void frap()
-{
- integer j,h,m,haz;
-
-/* debug('o1 frap'); */
- calch(j,h,m);
- if ((h>= 0) && (h< 8))  crep= 190; else
- {
-  haz= hazard(1,100);
-  if (haz> 70)  crep= 190; else crep= 147;
- }
-}
-
-/* overlay */ void nouvp(integer l, integer& p)
-{
-/* debug('o1 nouvp'); */
- p= 0;
- if (l== 1) 
- {
-  if (bh1)  p= 4;
-  if (bf1)  p= 2;
- }
- if (((l== 2) && (bh2)) || ((l== 9) && (bh9)))  p= 128;
- if (l== 4) 
- {
-  if (bh4)  p= 32;
-  if (bf4)  p= 16;
- }
- if ((l== 5) && (bh5))  p= 1;
- if ((l== 6) && (bh6))  p= 8;
- if ((l== 8) && (bh8))  p= 64;
- if (((l== 3) && (bt3)) || ((l== 7) && (bt7)))  p= 9;
- if (p!= 9)  affper(p);
-}
-
-
-
-/* overlay */ void tip(integer ip, integer& cx)
-{
-/* debug('o1 tip'); */
- if (ip== 128)  cx= 1; else
- if (ip== 64)   cx= 2; else
- if (ip== 32)   cx= 3; else
- if (ip== 16)   cx= 4; else
- if (ip== 8)    cx= 5; else
- if (ip== 4)    cx= 6; else
- if (ip== 2)    cx= 7; else
- if (ip== 1)    cx= 8;
-}
-
-
-/* overlay */ void ecfren(integer& p,integer& haz, integer cf,integer l)
-{
-/* debug('o1 ecfren'); */
- if (l== 0)  person();
- p= -500;
- haz= 0;
- if (((l== 1) && (! bh1) && (! bf1))
- || ((l== 4) && (! bh4) && (! bf4)))  cpl1(p);
- if ((l== 2) && (! bh2) && (! bh9))  cpl2(p);
- if (((l== 3) && (! bt3)) || ((l== 7) && (! bt7)))  cpl3(p);
- if ((l== 5) && (! bh5))  cpl5(p);
- if (((l== 6) && (! bh6)) || ((l== 8) && (! bh8)))  cpl6(p);
- if ((l== 9) && (! bh9) && (! bh2))  p= 10;
- if (((l== 2) && (bh9)) || ((l== 9) && (bh2)))  p= -400;
- if (p!= -500) 
- {
-  p= p+ cf;
-  haz= hazard(1,100);
- }
-}
-
-/* overlay */ void becfren(integer l)
-{
- integer haz;
-
-/* debug('o1 becfren'); */
- if ((l== 1) || (l== 4)) 
- {
-  haz= hazard(1,2);
-  if (l== 1) 
-   if (haz== 1)  bh1= true; else bf1= true;
-  if (l== 4) 
-   if (haz== 1)  bh4= true; else bf4= true;
- }
- if (l== 2)  bh2= true; else
- if (l== 3)  bt3= true; else
- if (l== 5)  bh5= true; else
- if (l== 6)  bh6= true; else
- if (l== 7)  bt7= true; else
- if (l== 8)  bh8= true; else
- if (l== 9)  bh9= true;
+	/* debug('o1 cpl11'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))  p = 25;
+	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))  p = 5;
+	if ((h > 13) && (h < 17))  p = 55;
+	if ((h > 16) && (h < 19))  p = 45;
+	if ((h >= 0) && (h < 9))  p = 0;
+}
+
+/* overlay */ void cpl12(integer &p) {
+	integer j, h, m;
+
+	/* debug('o1 cpl12'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))  p = 55;
+	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))  p = 25;
+	if ((h >= 0) && (h < 5))  p = 0;
+	if ((h > 4) && (h < 9))  p = 15;
+}
+
+/* overlay */ void cpl13(integer &p) {
+	/* debug('o1 cpl13'); */
+	p = 0;
+}
+
+/* overlay */ void cpl15(integer &p) {
+	integer j, h, m;
+
+	/* debug('o1 cpl15'); */
+	calch(j, h, m);
+	if ((h > 7) && (h < 12))  p = 25;
+	if ((h > 11) && (h < 14))  p = 0;
+	if ((h > 13) && (h < 18))  p = 10;
+	if ((h > 17) && (h < 20))  p = 55;
+	if ((h > 19) && (h < 22))  p = 5;
+	if ((h > 21) && (h < 24))  p = 15;
+	if ((h >= 0) && (h < 8))  p = -15;
+}
+
+/* overlay */ void cpl20(integer &p, integer &h) {
+	integer j, m;
+
+	/* debug('o1 cpl20'); */
+	calch(j, h, m);
+	if (h == 10)  p = 65;
+	if ((h > 10) && (h < 21))  p = 5;
+	if ((h > 20) && (h < 24))  p = -15;
+	if ((h >= 0) && (h < 5))  p = -300;
+	if ((h > 4) && (h < 10))  p = -5;
+}
+
+/* overlay */ void quelq1(integer l) {
+	integer per;
+
+	/* debug('o1 quelq1'); */
+	per = hazard(1, 2);
+	if (l == 1)
+		if (per == 1)  bh1 = true;
+		else bf1 = true;
+	if (l == 4)
+		if (per == 1)  bh4 = true;
+		else bf4 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq2() {
+	/* debug('o1 quelq2'); */
+	if (li == 2)  bh2 = true;
+	else bh9 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq5() {
+	/* debug('o1 quelq5'); */
+	bh5 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq6(integer l) {
+	integer per;
+
+	/* debug('o1 quelq6'); */
+	if (l == 6)  bh6 = true;
+	if (l == 8)  bh8 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq10(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq10'); */
+	if ((h >= 0) && (h < 8))  chlm(per);
+	else {
+		if ((h > 7) && (h < 10)) {
+			min = 5;
+			max = 7;
+		}
+		if ((h > 9) && (h < 12)) {
+			min = 1;
+			max = 4;
+		}
+		if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
+			min = 6;
+			max = 8;
+		}
+		if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
+			min = 1;
+			max = 5;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+/* overlay */ void quelq11(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq11'); */
+	if ((h >= 0) && (h < 8))  chlm(per);
+	else {
+		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
+			min = 1;
+			max = 3;
+		}
+		if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
+			min = 1;
+			max = 4;
+		}
+		if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
+			min = 1;
+			max = 2;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+/* overlay */ void quelq12(integer &per) {
+	/* debug('o1 quelq12'); */
+	chlm(per);
+	affper(per);
+}
+
+/* overlay */ void quelq15(integer &per) {
+	integer cx;
+	boolean test;
+
+
+	/* debug('o1 quelq15'); */
+	per = 0;
+	if (per == 0) {
+		do {
+			cx = hazard(1, 8);
+			test = (((cx == 1) && (bh2 || bh9)) ||
+			        ((cx == 2) && bh8) ||
+			        ((cx == 3) && bh4) ||
+			        ((cx == 4) && bf4) ||
+			        ((cx == 5) && bh6) ||
+			        ((cx == 6) && bh1) ||
+			        ((cx == 7) && bf1) ||
+			        ((cx == 8) && bh5));
+		} while (!(! test));
+		conv(cx, per);
+		affper(per);
+	}
+}
+
+/* overlay */ void quelq20(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq20'); */
+	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
+	else {
+		if ((h > 9) && (h < 12)) {
+			min = 3;
+			max = 7;
+		}
+		if ((h > 11) && (h < 18)) {
+			min = 1;
+			max = 2;
+		}
+		if (h == 18) {
+			min = 2;
+			max = 4;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+
+/* overlay */void frap() {
+	integer j, h, m, haz;
+
+	/* debug('o1 frap'); */
+	calch(j, h, m);
+	if ((h >= 0) && (h < 8))  crep = 190;
+	else {
+		haz = hazard(1, 100);
+		if (haz > 70)  crep = 190;
+		else crep = 147;
+	}
+}
+
+/* overlay */ void nouvp(integer l, integer &p) {
+	/* debug('o1 nouvp'); */
+	p = 0;
+	if (l == 1) {
+		if (bh1)  p = 4;
+		if (bf1)  p = 2;
+	}
+	if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))  p = 128;
+	if (l == 4) {
+		if (bh4)  p = 32;
+		if (bf4)  p = 16;
+	}
+	if ((l == 5) && (bh5))  p = 1;
+	if ((l == 6) && (bh6))  p = 8;
+	if ((l == 8) && (bh8))  p = 64;
+	if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))  p = 9;
+	if (p != 9)  affper(p);
+}
+
+
+
+/* overlay */ void tip(integer ip, integer &cx) {
+	/* debug('o1 tip'); */
+	if (ip == 128)  cx = 1;
+	else if (ip == 64)   cx = 2;
+	else if (ip == 32)   cx = 3;
+	else if (ip == 16)   cx = 4;
+	else if (ip == 8)    cx = 5;
+	else if (ip == 4)    cx = 6;
+	else if (ip == 2)    cx = 7;
+	else if (ip == 1)    cx = 8;
+}
+
+
+/* overlay */ void ecfren(integer &p, integer &haz, integer cf, integer l) {
+	/* debug('o1 ecfren'); */
+	if (l == 0)  person();
+	p = -500;
+	haz = 0;
+	if (((l == 1) && (! bh1) && (! bf1))
+	        || ((l == 4) && (! bh4) && (! bf4)))  cpl1(p);
+	if ((l == 2) && (! bh2) && (! bh9))  cpl2(p);
+	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))  cpl3(p);
+	if ((l == 5) && (! bh5))  cpl5(p);
+	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))  cpl6(p);
+	if ((l == 9) && (! bh9) && (! bh2))  p = 10;
+	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))  p = -400;
+	if (p != -500) {
+		p = p + cf;
+		haz = hazard(1, 100);
+	}
+}
+
+/* overlay */ void becfren(integer l) {
+	integer haz;
+
+	/* debug('o1 becfren'); */
+	if ((l == 1) || (l == 4)) {
+		haz = hazard(1, 2);
+		if (l == 1)
+			if (haz == 1)  bh1 = true;
+			else bf1 = true;
+		if (l == 4)
+			if (haz == 1)  bh4 = true;
+			else bf4 = true;
+	}
+	if (l == 2)  bh2 = true;
+	else if (l == 3)  bt3 = true;
+	else if (l == 5)  bh5 = true;
+	else if (l == 6)  bh6 = true;
+	else if (l == 7)  bt7 = true;
+	else if (l == 8)  bh8 = true;
+	else if (l == 9)  bh9 = true;
 }
 
 /* NIVEAU 10 */
-void init_nbrepm()
-{
-        const array<1,8,byte> ipm
-            = {{4,5,6,7,5,6,5,8}};
-       integer i;
-
-/* debug('init_nbrepm'); */
-  i= 0;
-  do {
-    i= succ(integer,i);
-    nbrepm[i]= ipm[i];
-  } while (!(i==8));
-}
-
-void phaz(integer& haz,integer& p, integer cf)
-{
-/* debug('phaz'); */
- p= p+ cf;
- haz= hazard(1,100);
-}
-
-/* overlay */ void inzon()
-{
- integer cx;
-
-/* debug('o2 inzon'); */
- copcha();
- {
-  s.ipre  = false;
-  s.derobj= 0;
-  s.icave = 0;
-  s.iboul = 0;
-  s.ibag  = 0;
-  s.ipuit = 0;
-  s.ivier = 0;
-  s.iloic = 136;
-  s.icryp = 141;
-  s.conf  = hazard(4,10);
-  s.mlieu = 21;
-  for( cx= 2; cx <= 6; cx ++) s.sjer[cx]= chr(0);
-  s.sjer[1]= chr(113);
-  s.heure= chr(20);
-  for( cx= 1; cx <= 10; cx ++) s.pourc[cx]= ' ';
-  for( cx= 1; cx <= 6; cx ++) s.teauto[cx]= '*';
-  for( cx= 7; cx <= 9; cx ++) s.teauto[cx]= ' ';
-  for( cx= 10; cx <= 28; cx ++) s.teauto[cx]= '*';
-  for( cx= 29; cx <= 42; cx ++) s.teauto[cx]= ' ';
-  s.teauto[33]= '*';
- }
- for( cx= 1; cx <= 8; cx ++) nbrep[cx]= 0;
- init_nbrepm();
-}
-
-/* overlay */ void dprog()
-{
-/* debug('o2 dprog'); */
- li= 21;
- /* jh:= t_settime(0);*/
- jh= 0;
- if (! s.ipre)  blo= true;
- t= ti1;
- mh= readclock();
-}
-
-/* overlay */ void pl1(integer cf)
-{
- integer p, haz;
-
-/* debug('o2 pl1'); */
- if (((li== 1) && (! bh1) && (! bf1))
- || ((li== 4) && (! bh4) && (! bf4))) 
- {
-  cpl1(p);
-  phaz(haz,p,cf);
-  if (haz> p)  person(); else quelq1(li);
- }
-}
-
-/* overlay */ void pl2(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl2'); */
- if (! bh2) 
- {
-  cpl2(p);
-  phaz(haz,p,cf);
-  if (haz> p)  person(); else quelq2();
- }
-}
-
-/* overlay */ void pl5(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl5'); */
- if (! bh5) 
- {
-  cpl5(p);
-  phaz(haz,p,cf);
-  if (haz> p)  person(); else quelq5();
- }
-}
-
-/* overlay */ void pl6(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl6'); */
- if (((li== 6) && (! bh6)) || ((li== 8) && (! bh8))) 
- {
-  cpl6(p);
-  phaz(haz,p,cf);
-  if (haz> p)  person(); else quelq6(li);
- }
-}
-
-/* overlayi */ void pl9(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl9'); */
- if (! bh9) 
- {
-  cf= -10;
-  phaz(haz,p,cf);
-  if (haz> p)  person(); else quelq2();
- }
-}
-
-/* overlayi */ void pl10(integer cf)
-{
- integer p,h,haz;
-
-/* debug('o2 pl10'); */
- cpl10(p,h);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq10(h,p);
-}
-
-/* overlay */ void pl11(integer cf)
-{
- integer p,h,haz;
-
-/* debug('o2 pl11'); */
- cpl11(p,h);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq11(h,p);
-}
-
-/* overlay */ void pl12(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl12'); */
- cpl12(p);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq12(p);
-}
-
-/* overlay */ void pl13(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl13'); */
- cpl13(p);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq12(p);
-}
-
-/* overlay */ void pl15(integer cf)
-{
- integer p,haz;
-
-/* debug('o2 pl15'); */
- cpl15(p);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq15(p);
-}
-
-/* overlay */ void pl20(integer cf)
-{
- integer p,h,haz;
-
-/* debug('o2 pl20'); */
- cpl20(p,h);
- phaz(haz,p,cf);
- if (haz> p)  person(); else quelq20(h,p);
-}
-
-/* overlay */ void t11(integer l11, integer& a)
-{
- integer p,haz,h;
-
-/* debug('o2 t11'); */
- ecfren(p,haz,s.conf,l11);
- li= l11;
- if ((l11> 0) && (l11< 10)) 
-  if (p!= -500) 
-  {
-   if (haz> p) 
-   {
-    person();
-    a= 0;
-   }
-   else
-   {
-    becfren(li);
-    nouvp(li,a);
-   }
-  }
-  else nouvp(li,a);
- if (l11> 9) 
-  if ((l11> 15) && (l11!= 20) && (l11!= 26))  person(); else
-  {
-   if (l11== 10)  cpl10(p,h);
-   if (l11== 11)  cpl11(p,h);
-   if (l11== 12)  cpl12(p);
-   if ((l11== 13) || (l11== 14))  cpl13(p);
-   if ((l11== 15) || (l11== 26))  cpl15(p);
-   if (l11== 20)  cpl20(p,h);
-   p= p+ s.conf;
-   haz= hazard(1,100);
-   if (haz> p) 
-   {
-    person();
-    a= 0;
-   }
-   else
-   {
-    if (l11== 10)  quelq10(h,p);
-    if (l11== 11)  quelq11(h,p);
-    if ((l11== 12) || (l11== 13) || (l11== 14))  quelq12(p);
-    if ((l11== 15) || (l11== 26))  quelq15(p);
-    if (l11== 20)  quelq20(h,p);
-    a= p;
-   }
-  }
+void init_nbrepm() {
+	const array<1, 8, byte> ipm
+	= {{4, 5, 6, 7, 5, 6, 5, 8}};
+	integer i;
+
+	/* debug('init_nbrepm'); */
+	i = 0;
+	do {
+		i = succ(integer, i);
+		nbrepm[i] = ipm[i];
+	} while (!(i == 8));
+}
+
+void phaz(integer &haz, integer &p, integer cf) {
+	/* debug('phaz'); */
+	p = p + cf;
+	haz = hazard(1, 100);
+}
+
+/* overlay */ void inzon() {
+	integer cx;
+
+	/* debug('o2 inzon'); */
+	copcha();
+	{
+		s.ipre  = false;
+		s.derobj = 0;
+		s.icave = 0;
+		s.iboul = 0;
+		s.ibag  = 0;
+		s.ipuit = 0;
+		s.ivier = 0;
+		s.iloic = 136;
+		s.icryp = 141;
+		s.conf  = hazard(4, 10);
+		s.mlieu = 21;
+		for (cx = 2; cx <= 6; cx ++) s.sjer[cx] = chr(0);
+		s.sjer[1] = chr(113);
+		s.heure = chr(20);
+		for (cx = 1; cx <= 10; cx ++) s.pourc[cx] = ' ';
+		for (cx = 1; cx <= 6; cx ++) s.teauto[cx] = '*';
+		for (cx = 7; cx <= 9; cx ++) s.teauto[cx] = ' ';
+		for (cx = 10; cx <= 28; cx ++) s.teauto[cx] = '*';
+		for (cx = 29; cx <= 42; cx ++) s.teauto[cx] = ' ';
+		s.teauto[33] = '*';
+	}
+	for (cx = 1; cx <= 8; cx ++) nbrep[cx] = 0;
+	init_nbrepm();
+}
+
+/* overlay */ void dprog() {
+	/* debug('o2 dprog'); */
+	li = 21;
+	/* jh:= t_settime(0);*/
+	jh = 0;
+	if (! s.ipre)  blo = true;
+	t = ti1;
+	mh = readclock();
+}
+
+/* overlay */ void pl1(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl1'); */
+	if (((li == 1) && (! bh1) && (! bf1))
+	        || ((li == 4) && (! bh4) && (! bf4))) {
+		cpl1(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq1(li);
+	}
+}
+
+/* overlay */ void pl2(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl2'); */
+	if (! bh2) {
+		cpl2(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq2();
+	}
+}
+
+/* overlay */ void pl5(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl5'); */
+	if (! bh5) {
+		cpl5(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq5();
+	}
+}
+
+/* overlay */ void pl6(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl6'); */
+	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
+		cpl6(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq6(li);
+	}
+}
+
+/* overlayi */ void pl9(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl9'); */
+	if (! bh9) {
+		cf = -10;
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq2();
+	}
+}
+
+/* overlayi */ void pl10(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl10'); */
+	cpl10(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq10(h, p);
+}
+
+/* overlay */ void pl11(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl11'); */
+	cpl11(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq11(h, p);
+}
+
+/* overlay */ void pl12(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl12'); */
+	cpl12(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq12(p);
+}
+
+/* overlay */ void pl13(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl13'); */
+	cpl13(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq12(p);
+}
+
+/* overlay */ void pl15(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl15'); */
+	cpl15(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq15(p);
+}
+
+/* overlay */ void pl20(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl20'); */
+	cpl20(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq20(h, p);
+}
+
+/* overlay */ void t11(integer l11, integer &a) {
+	integer p, haz, h;
+
+	/* debug('o2 t11'); */
+	ecfren(p, haz, s.conf, l11);
+	li = l11;
+	if ((l11 > 0) && (l11 < 10))
+		if (p != -500) {
+			if (haz > p) {
+				person();
+				a = 0;
+			} else {
+				becfren(li);
+				nouvp(li, a);
+			}
+		} else nouvp(li, a);
+	if (l11 > 9)
+		if ((l11 > 15) && (l11 != 20) && (l11 != 26))  person();
+		else {
+			if (l11 == 10)  cpl10(p, h);
+			if (l11 == 11)  cpl11(p, h);
+			if (l11 == 12)  cpl12(p);
+			if ((l11 == 13) || (l11 == 14))  cpl13(p);
+			if ((l11 == 15) || (l11 == 26))  cpl15(p);
+			if (l11 == 20)  cpl20(p, h);
+			p = p + s.conf;
+			haz = hazard(1, 100);
+			if (haz > p) {
+				person();
+				a = 0;
+			} else {
+				if (l11 == 10)  quelq10(h, p);
+				if (l11 == 11)  quelq11(h, p);
+				if ((l11 == 12) || (l11 == 13) || (l11 == 14))  quelq12(p);
+				if ((l11 == 15) || (l11 == 26))  quelq15(p);
+				if (l11 == 20)  quelq20(h, p);
+				a = p;
+			}
+		}
 }
 
 /* overlay */ void cavegre()
 
 {
- integer haz;
-
-/* debug('cavegre'); */
- s.conf= s.conf+ 2;
- if (s.conf> 69)  s.conf= s.conf+ (s.conf / 10);
- clsf3();
- ecrf2();
- ecr3(m1);
- haz= (hazard(0, 4))- 2;
- parole(2, haz, 1);
- for( haz=0; haz <= 3000; haz ++);
- clsf3();
- person();
-}
-
-void writetp(str255 s,integer t)
-{
-  if (res==2)  writeg(s,t);
-           else writeg(copy(s,1,25),t);
-}
-
-void messint(integer nu)
-{
-/* debug('messint'); */
- clsf1();
- clsf2();
- clsf3();
- decomp( 0x73a2, 1008);
- memw[0x7413+12]= 80;
- memw[0x7413+14]=  40;
- writepal(90);
- afff(gd,0x73a2, 1008,0,0);
- afff(gd,0x73a2, 1008,0,70);
- repon(7,nu);
-}
-
-void aniof(integer ouf,integer num)
-   {
-          integer ad, offset;
-            char c;
-
-   /* debug('aniof'); */
-     if ((caff== 7) && ((num== 4) || (num== 5)))  return;
-     if ((caff== 10) && (num== 7))  num= 6;
-     if (caff== 12)  if (num== 3)  num= 4;
-                                    else if (num== 4)  num= 3;
-     ad= adani;
-     offset= animof(ouf,num);
-     decomp(ad,offset);
-     hide_mouse();
-     afff(gd,ad,offset,0,12);
-     ecrf1();
-     show_mouse();
-   }
-
-void musique(integer so)
-{
- boolean i;
- integer haz;
-/* dep: array[1..5] of long_integer;*/
-
-/* debug('musique'); */
-  if (so== 0)   /*musik(0)*/ {; }
-   else
-  if ((prebru== 0) && (! s.ipre)) 
-  {
-   parole(10, 1, 1);
-   prebru= prebru+ 1;
-  }
-  else
-  {
-   i= false;
-   if ((s.mlieu== 19) || (s.mlieu== 21) || (s.mlieu== 22)) 
-   {
-    haz= hazard(1,3);
-    if (haz== 2) 
-    {
-     haz= hazard(2,4);
-     parole(9,haz,1);
-     i= true;
-    }
-   }
-   if (s.mlieu== 20) 
-   {
-    haz= hazard(1,2);
-    if (haz== 1) 
-    {
-     parole(8,1,1);
-     i= true;
-    }
-   }
-   if (s.mlieu== 24) 
-   {
-    haz= hazard(1,2);
-    if (haz== 2) 
-    {
-     parole(12,1,1);
-     i= true;
-    }
-   }
-   if (s.mlieu== 23) 
-   {
-    parole(13,1,1);
-    i= true;
-   }
-   if (! i) 
-   {
-   /* dep[1]:= 1416;
-    dep[2]:= 1512;
-    dep[3]:= 1692;
-    dep[4]:= 1884;
-    dep[5]:= 2046;
-    haz:= hazard(1,5);
-    musik(dep[haz]);*/
-    haz= hazard(1,17);
-    parole(haz,1,2);
-   }
-  }
+	integer haz;
+
+	/* debug('cavegre'); */
+	s.conf = s.conf + 2;
+	if (s.conf > 69)  s.conf = s.conf + (s.conf / 10);
+	clsf3();
+	ecrf2();
+	ecr3(m1);
+	haz = (hazard(0, 4)) - 2;
+	parole(2, haz, 1);
+	for (haz = 0; haz <= 3000; haz ++);
+	clsf3();
+	person();
+}
+
+void writetp(str255 s, integer t) {
+	if (res == 2)  writeg(s, t);
+	else writeg(copy(s, 1, 25), t);
+}
+
+void messint(integer nu) {
+	/* debug('messint'); */
+	clsf1();
+	clsf2();
+	clsf3();
+	decomp(0x73a2, 1008);
+	memw[0x7413 + 12] = 80;
+	memw[0x7413 + 14] =  40;
+	writepal(90);
+	afff(gd, 0x73a2, 1008, 0, 0);
+	afff(gd, 0x73a2, 1008, 0, 70);
+	repon(7, nu);
+}
+
+void aniof(integer ouf, integer num) {
+	integer ad, offset;
+	char c;
+
+	/* debug('aniof'); */
+	if ((caff == 7) && ((num == 4) || (num == 5)))  return;
+	if ((caff == 10) && (num == 7))  num = 6;
+	if (caff == 12)  if (num == 3)  num = 4;
+		else if (num == 4)  num = 3;
+	ad = adani;
+	offset = animof(ouf, num);
+	decomp(ad, offset);
+	hide_mouse();
+	afff(gd, ad, offset, 0, 12);
+	ecrf1();
+	show_mouse();
+}
+
+void musique(integer so) {
+	boolean i;
+	integer haz;
+	/* dep: array[1..5] of long_integer;*/
+
+	/* debug('musique'); */
+	if (so == 0) { /*musik(0)*/
+		;
+	} else if ((prebru == 0) && (! s.ipre)) {
+		parole(10, 1, 1);
+		prebru = prebru + 1;
+	} else {
+		i = false;
+		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
+			haz = hazard(1, 3);
+			if (haz == 2) {
+				haz = hazard(2, 4);
+				parole(9, haz, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 20) {
+			haz = hazard(1, 2);
+			if (haz == 1) {
+				parole(8, 1, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 24) {
+			haz = hazard(1, 2);
+			if (haz == 2) {
+				parole(12, 1, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 23) {
+			parole(13, 1, 1);
+			i = true;
+		}
+		if (! i) {
+			/* dep[1]:= 1416;
+			 dep[2]:= 1512;
+			 dep[3]:= 1692;
+			 dep[4]:= 1884;
+			 dep[5]:= 2046;
+			 haz:= hazard(1,5);
+			 musik(dep[haz]);*/
+			haz = hazard(1, 17);
+			parole(haz, 1, 2);
+		}
+	}
 }
 
 /* NIVEAU 9 */
-void dessin(integer ad)
-{
- integer cx;
-
-/* debug('dessin'); */
- if (ad!= 0)  dessine(ades,((ad % 160)* 2),(ad / 160));
-           else
- {
-  clsf1();
-  if (caff> 99) 
-  {
-    dessine(ades,60,33);
-    boite(118, 32, 291, 121, 15);         /* cadre moyen */
-  }
-  else
-   if (caff> 69) 
-   {
-    dessine(ades,112,48);             /* tˆtes */
-    boite(222, 47, 155, 91, 15);
-   }
-   else
-   {
-    dessine(ades,0,12);
-    ecrf1();
-    if ((caff< 30) || (caff> 32)) 
-    {
-     for( cx= 1; cx <= 6; cx ++)
-      if (ord(touv[cx])!= 0)  aniof(1,ord(touv[cx]));
-     if (caff== 13) 
-     {
-      if (s.iboul== 141)  aniof(1,7);
-      if (s.ibag== 159)  aniof(1,6);
-     }
-     if ((caff== 14) && (s.icave== 151))  aniof(1,2);
-     if ((caff== 17) && (s.ivier== 143))  aniof(1,1);
-     if ((caff== 24) && (s.ipuit!= 0))  aniof(1,1);
-    }
-    if (caff< 26)  musique(1);
-   }
- }
+void dessin(integer ad) {
+	integer cx;
+
+	/* debug('dessin'); */
+	if (ad != 0)  dessine(ades, ((ad % 160) * 2), (ad / 160));
+	else {
+		clsf1();
+		if (caff > 99) {
+			dessine(ades, 60, 33);
+			boite(118, 32, 291, 121, 15);         /* cadre moyen */
+		} else if (caff > 69) {
+			dessine(ades, 112, 48);           /* tˆtes */
+			boite(222, 47, 155, 91, 15);
+		} else {
+			dessine(ades, 0, 12);
+			ecrf1();
+			if ((caff < 30) || (caff > 32)) {
+				for (cx = 1; cx <= 6; cx ++)
+					if (ord(touv[cx]) != 0)  aniof(1, ord(touv[cx]));
+				if (caff == 13) {
+					if (s.iboul == 141)  aniof(1, 7);
+					if (s.ibag == 159)  aniof(1, 6);
+				}
+				if ((caff == 14) && (s.icave == 151))  aniof(1, 2);
+				if ((caff == 17) && (s.ivier == 143))  aniof(1, 1);
+				if ((caff == 24) && (s.ipuit != 0))  aniof(1, 1);
+			}
+			if (caff < 26)  musique(1);
+		}
+	}
 }
 
 
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 8edf601..734cb48 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -1,764 +1,728 @@
-const array<1,11,integer> men
-      = {{ scacher, attacher, defoncer, dormir,
-          entrer,  fermer,   frapper,  manger,
-          mettre,  ouvrir,   sortir }};
-
-void tinke()
-{
- const char m1[] = "Mince! Vous entendez du bruit...";
- const char d1[] = " | Vous devriez avoir remarqu‚|       ";
- const char d2[] = "% des indices...";
- const char d3 = '[';
- const char d4 = ']';
- const char d5 = '1';
- const char d6[] = "OK";
- integer cx,cy,haz,nh,cf,j,h,m,cd;
-    varying_string<3> stpo;
-      boolean am;
-
- anyone= false;
- calch(j,h,m);
- if (j!= jou) 
- {
-  jou= j;
-  cx=0;
-  do {
-    cx=cx+1;
-    if (nbrepm[cx]!= 0)  nbrepm[cx]= nbrepm[cx]- 1;
-    nbrep[cx]= 0;
-  } while (!(cx==8));
- }
- if ((h> heu) || ((h== 0) && (heu== 23))) 
- {
-  heu= h;
-  min= 0;
-  pendule();
-  cf= 0;
-  for( cx= 1; cx <= 10; cx ++) if (s.pourc[cx]== '*')  cf= cf+ 1;
-  if (cf==10)  stpo="10";
-           else stpo=chr(cf+48);
-  stpou= string(d3)+ d5+ d4+ d3+ d1+ stpo+ '0'+ d2+ d4+ d3+ d6+ d4;
- }
- if (m> min) 
- {
-  min= 30;
-  pendule();
- }
- if (y_s<12)  return;
- if (! blo) 
- {
-  if ((h== 12) || ((h> 18) && (h< 21)) || ((h>= 0) && (h< 7))) 
-   t= ti2; else t= ti1;
-  cf= s.conf;
-  if ((cf> 33) && (cf< 66))  t= t- (t / 3);
-  if (cf> 65)  t= t- ((t / 3)* 2);
-  nh= readclock();
-  if ((nh- mh)> t) 
-  {
-    am= active_menu;
-    erase_menu();
-    jh= jh+ ((nh- mh)/ t);
-    mh= nh;
-    switch (li) {
-            case 1:case 4 : pl1(cf); break;
-              case 2 : pl2(cf); break;
-              case 5 : pl5(cf); break;
-            case 6:case 8 : pl6(cf); break;
-              case 9 : pl9(cf); break;
-             case 10 : pl10(cf); break;
-             case 11 : pl11(cf); break;
-             case 12 : pl12(cf); break;
-          case 13:case 14 : pl13(cf); break;
-          case 15:case 26 : pl15(cf); break;
-             case 20 : pl20(cf); break;
-        }
-   if ((mpers!= 0) && (ipers!= 10))  mpers= ipers;
-   if ((mpers== 0) && (ipers> 0)) 
-    if ((s.mlieu== 13) || (s.mlieu== 14))  cavegre(); else
-     if (ipers== 10) 
-     {
-      ipers= 0;
-      if (! brt) 
-      {
-       brt= true;
-       hdb= readclock();
-       haz= hazard(1,5);
-       if (haz< 5) 
-       {
-        clsf3();
-        ecrf2();
-        ecr3(m1);
-        haz= (hazard(0, 4))- 2;
-        parole(1, haz, 1);
-        clsf3();
-       }
-      }
-     }
-    if (am)  draw_menu();
-  }
- }
- hfb= readclock();
- if ((brt) && ((hfb- hdb)> 17)) 
- {
-  nouvp(li,cx);
-  brt= false;
-  hdb= 0;
-  if ((s.mlieu> 0) && (s.mlieu< 10))  anyone= true;
- }
-}
-
-void fenat(char ans)
-{
-      integer coul;
-
-  hide_mouse();
-  if (gd==cga)  coul=2;
-            else if (gd==her)  coul=1; else coul=12;
-  affcar(gd,306,193,coul,ord(ans));
-  boite(300, 191, 16, 8, 15);
-  show_mouse();
+const array<1, 11, integer> men
+= {{
+		scacher, attacher, defoncer, dormir,
+		entrer,  fermer,   frapper,  manger,
+		mettre,  ouvrir,   sortir
+	}
+};
+
+void tinke() {
+	const char m1[] = "Mince! Vous entendez du bruit...";
+	const char d1[] = " | Vous devriez avoir remarqu‚|       ";
+	const char d2[] = "% des indices...";
+	const char d3 = '[';
+	const char d4 = ']';
+	const char d5 = '1';
+	const char d6[] = "OK";
+	integer cx, cy, haz, nh, cf, j, h, m, cd;
+	varying_string<3> stpo;
+	boolean am;
+
+	anyone = false;
+	calch(j, h, m);
+	if (j != jou) {
+		jou = j;
+		cx = 0;
+		do {
+			cx = cx + 1;
+			if (nbrepm[cx] != 0)  nbrepm[cx] = nbrepm[cx] - 1;
+			nbrep[cx] = 0;
+		} while (!(cx == 8));
+	}
+	if ((h > heu) || ((h == 0) && (heu == 23))) {
+		heu = h;
+		min = 0;
+		pendule();
+		cf = 0;
+		for (cx = 1; cx <= 10; cx ++) if (s.pourc[cx] == '*')  cf = cf + 1;
+		if (cf == 10)  stpo = "10";
+		else stpo = chr(cf + 48);
+		stpou = string(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
+	}
+	if (m > min) {
+		min = 30;
+		pendule();
+	}
+	if (y_s < 12)  return;
+	if (! blo) {
+		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
+			t = ti2;
+		else t = ti1;
+		cf = s.conf;
+		if ((cf > 33) && (cf < 66))  t = t - (t / 3);
+		if (cf > 65)  t = t - ((t / 3) * 2);
+		nh = readclock();
+		if ((nh - mh) > t) {
+			am = active_menu;
+			erase_menu();
+			jh = jh + ((nh - mh) / t);
+			mh = nh;
+			switch (li) {
+			case 1:
+			case 4 :
+				pl1(cf);
+				break;
+			case 2 :
+				pl2(cf);
+				break;
+			case 5 :
+				pl5(cf);
+				break;
+			case 6:
+			case 8 :
+				pl6(cf);
+				break;
+			case 9 :
+				pl9(cf);
+				break;
+			case 10 :
+				pl10(cf);
+				break;
+			case 11 :
+				pl11(cf);
+				break;
+			case 12 :
+				pl12(cf);
+				break;
+			case 13:
+			case 14 :
+				pl13(cf);
+				break;
+			case 15:
+			case 26 :
+				pl15(cf);
+				break;
+			case 20 :
+				pl20(cf);
+				break;
+			}
+			if ((mpers != 0) && (ipers != 10))  mpers = ipers;
+			if ((mpers == 0) && (ipers > 0))
+				if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
+				else if (ipers == 10) {
+					ipers = 0;
+					if (! brt) {
+						brt = true;
+						hdb = readclock();
+						haz = hazard(1, 5);
+						if (haz < 5) {
+							clsf3();
+							ecrf2();
+							ecr3(m1);
+							haz = (hazard(0, 4)) - 2;
+							parole(1, haz, 1);
+							clsf3();
+						}
+					}
+				}
+			if (am)  draw_menu();
+		}
+	}
+	hfb = readclock();
+	if ((brt) && ((hfb - hdb) > 17)) {
+		nouvp(li, cx);
+		brt = false;
+		hdb = 0;
+		if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+	}
+}
+
+void fenat(char ans) {
+	integer coul;
+
+	hide_mouse();
+	if (gd == cga)  coul = 2;
+	else if (gd == her)  coul = 1;
+	else coul = 12;
+	affcar(gd, 306, 193, coul, ord(ans));
+	boite(300, 191, 16, 8, 15);
+	show_mouse();
 }
 
 
 /* NIVEAU 8 */
-void afdes(integer ad)
-{
-  taffich();
-  dessin(ad);
-  okdes= false;
-}
-
-void tkey1(boolean d)
-{
-      boolean quest;
-      integer x,y,c;
-      integer key;
-
- hide_mouse();
- fenat('K');
- while (keypressed())  key=testou();
- do {
-   if (d)  tinke();
-   quest=keypressed();
-   read_pos_mouse(x,y,c);
- } while (!(quest || (c!=0) || (d && anyone)));
- if (quest)  key=testou();
- clic=false;
- show_mouse();
-}
-
-void tmlieu(integer mli)
-{
- integer cx, j, i, tail;
-           str30 nomp;
-             phrase st;
-
-
-  if (mli== 26)  mli= 15;
-  i=1;
-  while ((i<8) && (v_lieu[i][mli]!=0))  
-     {
-       cx=v_lieu[i][mli];
-       deline(cx+c_tmlieu,st,tail);
-       nomp= delig;
-       while (length(nomp)<30)  nomp=nomp+' ';
-       menut( depl[i], nomp);
-       i=i+1;
-     }
-  nomp= "*                   ";
-  for( cx= 7; cx >= i; cx --) menut( depl[cx], nomp);
+void afdes(integer ad) {
+	taffich();
+	dessin(ad);
+	okdes = false;
+}
+
+void tkey1(boolean d) {
+	boolean quest;
+	integer x, y, c;
+	integer key;
+
+	hide_mouse();
+	fenat('K');
+	while (keypressed())  key = testou();
+	do {
+		if (d)  tinke();
+		quest = keypressed();
+		read_pos_mouse(x, y, c);
+	} while (!(quest || (c != 0) || (d && anyone)));
+	if (quest)  key = testou();
+	clic = false;
+	show_mouse();
+}
+
+void tmlieu(integer mli) {
+	integer cx, j, i, tail;
+	str30 nomp;
+	phrase st;
+
+
+	if (mli == 26)  mli = 15;
+	i = 1;
+	while ((i < 8) && (v_lieu[i][mli] != 0)) {
+		cx = v_lieu[i][mli];
+		deline(cx + c_tmlieu, st, tail);
+		nomp = delig;
+		while (length(nomp) < 30)  nomp = nomp + ' ';
+		menut(depl[i], nomp);
+		i = i + 1;
+	}
+	nomp = "*                   ";
+	for (cx = 7; cx >= i; cx --) menut(depl[cx], nomp);
 }
 
 
 /* NIVEAU 7 */
-void tlu(integer af,integer ob)
-{
-  caff= 32;
-  afdes(0);
-  repon(6,ob+ 4000);
-  repon(2,999);
-  tkey1(true);
-  caff= af;
-  msg[3]= no_choice;
-  crep= 998;
+void tlu(integer af, integer ob) {
+	caff = 32;
+	afdes(0);
+	repon(6, ob + 4000);
+	repon(2, 999);
+	tkey1(true);
+	caff = af;
+	msg[3] = no_choice;
+	crep = 998;
 }
 
-void delin(integer n)
-  {
-      phrase s;
-      integer t;
+void delin(integer n) {
+	phrase s;
+	integer t;
 
-    deline(n,s,t);
-  }
+	deline(n, s, t);
+}
 
-void affrep()
-{
-  caff= s.mlieu;
-  crep= s.mlieu;
+void affrep() {
+	caff = s.mlieu;
+	crep = s.mlieu;
 }
 
 void mfouen()
 
 {
- integer cx;
-
- tmlieu(s.mlieu);
- for( cx=1; cx <= 11; cx ++) menu_enable( men[cx]);
-/* menu_enable( scacher);
- menu_enable(menup, attacher);
- menu_enable(menup, defoncer);
- menu_enable(menup, dormir);
- menu_enable(menup, entrer);
- menu_enable(menup, fermer);
- menu_enable(menup, frapper);
- menu_enable(menup, manger);
- menu_enable(menup, mettre);
- menu_enable(menup, ouvrir);
- menu_enable(menup, sortir);  */
- menut( sonder, " sonder   ");
- menut( soulever, " soulever ");
-}
-
-void atf3f8(integer& key)
- {
-   do {
-     key= testou();
-   } while (!((key==61) || (key==66)));
- }
+	integer cx;
 
-/* NIVEAU 6 */
-
-void tperd()
-{
- integer cx;
-
- initouv();
- ment= 0;
- iouv= 0;
- mchai= 0;
- mfouen();
- if (! blo)  t11(21, cx);
- perdu= true;
- clsf1();
- boite( 60, 35, 400, 50, 15);
- repon(9,crep);
- clsf2();
- clsf3();
- col= false;
- syn= false;
- okdes= false;
-}
-
-void tsort()
-{
- integer cx;
-
- if ((iouv> 0) && (s.mlieu!= 0)) 
-  if (s.conf< 50)  s.conf= s.conf+ 2;
-                else s.conf= s.conf+ (s.conf / 10);
- for( cx= 1; cx <= 7; cx ++) touv[cx]= chr(0);
- ment= 0;
- iouv= 0;
- mchai= 0;
- debloc(s.mlieu);
+	tmlieu(s.mlieu);
+	for (cx = 1; cx <= 11; cx ++) menu_enable(men[cx]);
+	/* menu_enable( scacher);
+	 menu_enable(menup, attacher);
+	 menu_enable(menup, defoncer);
+	 menu_enable(menup, dormir);
+	 menu_enable(menup, entrer);
+	 menu_enable(menup, fermer);
+	 menu_enable(menup, frapper);
+	 menu_enable(menup, manger);
+	 menu_enable(menup, mettre);
+	 menu_enable(menup, ouvrir);
+	 menu_enable(menup, sortir);  */
+	menut(sonder, " sonder   ");
+	menut(soulever, " soulever ");
 }
 
-void st4(integer ob)
-{
- crep= 997;
- switch (ob) {
-                case 114 : crep=109; break;
-                case 110 : crep=107; break;
-                case 158 : crep=113; break;
-    case RANGE_5(152,156):case 150:
-    case 100:case 157:case 160:case 161 : tlu(caff,ob);
-    break;
- }
-}
-
-void cherjer(integer ob, boolean& d)
-{
- integer cx;
-
- d= false;
- for( cx= 1; cx <= 6; cx ++) d=(d || (ord(s.sjer[cx])== ob));
- if (s.derobj== ob)  d= true;
+void atf3f8(integer &key) {
+	do {
+		key = testou();
+	} while (!((key == 61) || (key == 66)));
 }
 
-void st1sama()
-{
- s.mlieu= 10;
- affrep();
-}
-
-void modinv()
-{
- integer cx, cy, tay, i, r;
- phrase nom;
- str30 nomp;
-
- cy= 0;
- for( cx=1; cx <= 6; cx ++)
-  if (s.sjer[cx]!= chr(0)) 
-    {
-      cy= succ(integer,cy);
-      r= (ord(s.sjer[cx])+ 400);
-      deline(r-501+c_st41,nom,tay);
-      nomp= delig;
-      menut( invt[cy], nomp);
-      menu_enable( invt[cx]);
-    }
- if (cy<6) 
-    for( cx=cy+1; cx <= 6; cx ++)
-      {
-        menut( invt[cx], "                       ");
-        menu_disable( invt[cx]);
-      }
-}
-
-void sparl(long_integer adr, long_integer rep)
-{
-      const array<1,8,integer> haut
-           = {{0,1,-3,6,-2,2,7,-1}};
- integer key, ad, tay, repint;
-           phrase st;
-
-  repint=trunc(rep);
-  hide_mouse();
-  deline( repint+c_paroles,st,tay);
-  afftex(st,230,4,65,24,5);
-  f3f8();
-  /*boite(43,30,90,19,15);
-  gotoxy(7,5);
-  write('F3: Encore');
-  gotoxy(7,6);
-  write('F8: Stop');*/
-  key= 0;
-  do {
-    parole(repint, haut[caff- 69], 0);
-    atf3f8(key);
-  } while (!(key== 66));
-  hirs();
-  show_mouse();
-}
-
-void finfouil()
-  {
-    fouil= false;
-    obpart= false;
-    cs= 0;
-    is= 0;
-    mfouen();
-  }
-
-void mfoudi()
-{
- integer cx;
-
- for( cx= 1; cx <= 7; cx ++) menu_disable( depl[cx]);
- for( cx=1; cx <= 11; cx ++) menu_disable( men[cx]);
-/* menu_disable(menup, scacher);
- menu_disable(menup, attacher);
- menu_disable(menup, defoncer);
- menu_disable(menup, dormir);
- menu_disable(menup, entrer);
- menu_disable(menup, fermer);
- menu_disable(menup, frapper);
- menu_disable(menup, manger);
- menu_disable(menup, mettre);
- menu_disable(menup, ouvrir);
- menu_disable(menup, sortir);  */
- menut( sonder, " -SUITE- ");
- menut( soulever, " -STOP-  ");
-}
-
-void mennor()
-{
- menu_up(msg[3]);
-}
+/* NIVEAU 6 */
 
-void premtet()
-{
- dessine(ades, 10, 80);
- boite(18, 79, 155, 91, 15);
+void tperd() {
+	integer cx;
+
+	initouv();
+	ment = 0;
+	iouv = 0;
+	mchai = 0;
+	mfouen();
+	if (! blo)  t11(21, cx);
+	perdu = true;
+	clsf1();
+	boite(60, 35, 400, 50, 15);
+	repon(9, crep);
+	clsf2();
+	clsf3();
+	col = false;
+	syn = false;
+	okdes = false;
+}
+
+void tsort() {
+	integer cx;
+
+	if ((iouv > 0) && (s.mlieu != 0))
+		if (s.conf < 50)  s.conf = s.conf + 2;
+		else s.conf = s.conf + (s.conf / 10);
+	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+	ment = 0;
+	iouv = 0;
+	mchai = 0;
+	debloc(s.mlieu);
+}
+
+void st4(integer ob) {
+	crep = 997;
+	switch (ob) {
+	case 114 :
+		crep = 109;
+		break;
+	case 110 :
+		crep = 107;
+		break;
+	case 158 :
+		crep = 113;
+		break;
+	case RANGE_5(152, 156):
+	case 150:
+	case 100:
+	case 157:
+	case 160:
+	case 161 :
+		tlu(caff, ob);
+		break;
+	}
+}
+
+void cherjer(integer ob, boolean &d) {
+	integer cx;
+
+	d = false;
+	for (cx = 1; cx <= 6; cx ++) d = (d || (ord(s.sjer[cx]) == ob));
+	if (s.derobj == ob)  d = true;
+}
+
+void st1sama() {
+	s.mlieu = 10;
+	affrep();
+}
+
+void modinv() {
+	integer cx, cy, tay, i, r;
+	phrase nom;
+	str30 nomp;
+
+	cy = 0;
+	for (cx = 1; cx <= 6; cx ++)
+		if (s.sjer[cx] != chr(0)) {
+			cy = succ(integer, cy);
+			r = (ord(s.sjer[cx]) + 400);
+			deline(r - 501 + c_st41, nom, tay);
+			nomp = delig;
+			menut(invt[cy], nomp);
+			menu_enable(invt[cx]);
+		}
+	if (cy < 6)
+		for (cx = cy + 1; cx <= 6; cx ++) {
+			menut(invt[cx], "                       ");
+			menu_disable(invt[cx]);
+		}
+}
+
+void sparl(long_integer adr, long_integer rep) {
+	const array<1, 8, integer> haut
+	= {{0, 1, -3, 6, -2, 2, 7, -1}};
+	integer key, ad, tay, repint;
+	phrase st;
+
+	repint = trunc(rep);
+	hide_mouse();
+	deline(repint + c_paroles, st, tay);
+	afftex(st, 230, 4, 65, 24, 5);
+	f3f8();
+	/*boite(43,30,90,19,15);
+	gotoxy(7,5);
+	write('F3: Encore');
+	gotoxy(7,6);
+	write('F8: Stop');*/
+	key = 0;
+	do {
+		parole(repint, haut[caff - 69], 0);
+		atf3f8(key);
+	} while (!(key == 66));
+	hirs();
+	show_mouse();
+}
+
+void finfouil() {
+	fouil = false;
+	obpart = false;
+	cs = 0;
+	is = 0;
+	mfouen();
+}
+
+void mfoudi() {
+	integer cx;
+
+	for (cx = 1; cx <= 7; cx ++) menu_disable(depl[cx]);
+	for (cx = 1; cx <= 11; cx ++) menu_disable(men[cx]);
+	/* menu_disable(menup, scacher);
+	 menu_disable(menup, attacher);
+	 menu_disable(menup, defoncer);
+	 menu_disable(menup, dormir);
+	 menu_disable(menup, entrer);
+	 menu_disable(menup, fermer);
+	 menu_disable(menup, frapper);
+	 menu_disable(menup, manger);
+	 menu_disable(menup, mettre);
+	 menu_disable(menup, ouvrir);
+	 menu_disable(menup, sortir);  */
+	menut(sonder, " -SUITE- ");
+	menut(soulever, " -STOP-  ");
+}
+
+void mennor() {
+	menu_up(msg[3]);
+}
+
+void premtet() {
+	dessine(ades, 10, 80);
+	boite(18, 79, 155, 91, 15);
 }
 
 /* NIVEAU 5 */
-void ajchai()
-{
-      integer cx,cy,lderobj;
-
-
-  cy= (acha+ pred(integer,pred(integer,mchai)* 10));
-  cx= 0;
-  do {
-   cx= cx+ 1;
-  } while (!((cx> 9) || (tabdon[cy+ cx]== 0)));
-  if (tabdon[cy+ cx]== 0) 
-    {
-      lderobj= s.derobj;
-      tabdon[cy+ cx]=lderobj;
-    }
-    else crep= 192;
+void ajchai() {
+	integer cx, cy, lderobj;
+
+
+	cy = (acha + pred(integer, pred(integer, mchai) * 10));
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
+	if (tabdon[cy + cx] == 0) {
+		lderobj = s.derobj;
+		tabdon[cy + cx] = lderobj;
+	} else crep = 192;
+}
+
+void ajjer(integer ob) {
+	integer cx;
+
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
+	if (ord(s.sjer[cx]) == 0) {
+		s.sjer[(cx)] = chr(ob);
+		modinv();
+	} else crep = 139;
+}
+
+void t1sama() {    /* On entre dans le manoir */
+	integer j, h, m;
+	boolean d;
+
+	calch(j, h, m);
+	if ((h < 5) && (s.mlieu > 18)) {
+		cherjer(137, d);
+		if (! d) {        /* On n'a pas les cl‚s et il est tard */
+			crep = 1511;
+			tperd();
+		} else st1sama();
+	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */
+		ipers = 255;
+		affper(ipers);
+		caff = 77;
+		afdes(0);
+		boite(223, 47, 155, 91, 15);
+		repon(2, 33);
+		tkey1(false);
+		mennor();
+		hide_mouse();
+		hirs();
+		premtet();
+		sparl(0, 140);
+		dessine_rouleau();
+		pendule();
+		show_mouse();
+		s.mlieu = 0;
+		affrep();
+		t5(10);
+		if (! blo)  t11(0, m);
+		ipers = 0;
+		mpers = 0;
+		s.ipre = true;
+		/*chech;*/
+	} else  st1sama();
+}
+
+void t1vier() {
+	s.mlieu = 17;
+	affrep();
+}
+
+void t1neig() {
+	inei = inei + 1;
+	if (inei > 2) {
+		crep = 1506;
+		tperd();
+	} else {
+		okdes = true;
+		s.mlieu = 19;
+		affrep();
+	}
+}
+
+void t1deva() {
+	inei = 0;
+	s.mlieu = 21;
+	affrep();
+}
+
+void t1derr() {
+	s.mlieu = 22;
+	affrep();
+}
+
+void t1deau() {
+	crep = 1503;
+	tperd();
+}
+
+void tctrm() {
+	repon(2, (3000 + ctrm));
+	ctrm = 0;
 }
 
-void ajjer(integer ob)
-{
- integer cx;
-
- cx= 0;
- do {
-  cx= cx+ 1;
- } while (!((cx> 5) || (ord(s.sjer[cx])== 0)));
- if (ord(s.sjer[cx])== 0) 
- {
-  s.sjer[(cx)]= chr(ob);
-  modinv();
- }
- else crep= 139;
-}
 
-void t1sama()      /* On entre dans le manoir */
-{
- integer j,h,m;
- boolean d;
-
- calch(j,h,m);
- if ((h< 5) && (s.mlieu> 18)) 
- {
-  cherjer(137,d);
-  if (! d)          /* On n'a pas les cl‚s et il est tard */
-  {
-    crep= 1511;
-    tperd();
-  }
-  else st1sama();
- }
- else
- if (! s.ipre)          /* c'est votre premiŠre fois ? */
- {
-  ipers= 255;
-  affper(ipers);
-  caff= 77;
-  afdes(0);
-  boite(223, 47, 155, 91, 15);
-  repon(2,33);
-  tkey1(false);
-  mennor();
-  hide_mouse();
-  hirs();
-  premtet();
-  sparl(0,140);
-  dessine_rouleau();
-  pendule();
-  show_mouse();
-  s.mlieu= 0;
-  affrep();
-  t5(10);
-  if (! blo)  t11(0, m);
-  ipers= 0;
-  mpers= 0;
-  s.ipre= true;
-  /*chech;*/
- }
- else  st1sama();
-}
-
-void t1vier()
-{
- s.mlieu= 17;
- affrep();
-}
-
-void t1neig()
-{
- inei= inei+ 1;
- if (inei> 2) 
- {
-   crep= 1506;
-   tperd();
- }
- else
- {
-   okdes= true;
-   s.mlieu= 19;
-   affrep();
- }
-}
-
-void t1deva()
-{
- inei= 0;
- s.mlieu= 21;
- affrep();
-}
-
-void t1derr()
-{
- s.mlieu = 22;
- affrep();
-}
+void quelquun()
 
-void t1deau()
 {
- crep = 1503;
- tperd();
-}
+	integer haz, cx;
 
-void tctrm()
-{
- repon(2,(3000+ ctrm));
- ctrm= 0;
+	if (imen)  erase_menu();
+	finfouil();
+	crep = 997;
+L1:
+	if (! cache) {
+		if (crep == 997)  crep = 138;
+		repon(2, crep);
+		if (crep == 138)  parole(5, 2, 1);
+		else parole(4, 4, 1);
+		if (iouv == 0)  s.conf = s.conf + 2;
+		else if (s.conf < 50)  s.conf = s.conf + 4;
+		else
+			s.conf = s.conf + (3 * (s.conf / 10));
+		tsort();
+		tmlieu(15);
+		tip(ipers, cx);
+		caff = 69 + cx;
+		crep = caff;
+		msg[3] = discut;
+		msg[4] = disc[cx];
+		syn = true;
+		col = true;
+	} else {
+		haz = hazard(1, 3);
+		if (haz == 2) {
+			cache = false;
+			crep = 137;
+			goto L1;
+		} else {
+			repon(2, 136);
+			haz = (hazard(0, 4)) - 2;
+			parole(3, haz, 1);
+			clsf2();
+			person();
+			debloc(21);
+			affrep();
+		}
+	}
+	if (imen)  draw_menu();
+}
+
+void tsuiv() {
+	integer cx, tbcl;
+	integer cl, cy;
+
+	cy = acha + ((mchai - 1) * 10) - 1;
+	cx = 0;
+	do {
+		cx = cx + 1;
+		cs = cs + 1;
+		cl = cy + cs;
+		tbcl = tabdon[cl];
+	} while (!((tbcl != 0) || (cs > 9)));
+	if ((tbcl != 0) && (cs < 11)) {
+		is = is + 1;
+		caff = tbcl;
+		crep = caff + 400;
+		if (ipers != 0)  s.conf = s.conf + 2;
+	} else {
+		affrep();
+		finfouil();
+		if (cx > 9)  crep = 131;
+	}
+}
+
+void tfleche() {
+	boolean qust;
+	char touch;
+	integer dummy, cd, xmo, ymo;
+
+	if (num == 9999)  return;
+	fenat(chr(152));
+	rect = false;
+	do {
+		touch = '\0';
+
+		do {
+			mov_mouse(qust, touch);
+			if (clic)  rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
+			tinke();
+		} while (!(qust || rect || anyone));
+
+		if (qust && (touch == '\103'))  dummy = do_alert(stpou, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) ||
+	           (anyone) || (rect)));
+	if (touch == '\73')  iesc = true;
+	if (rect) {
+		x = x_s;
+		y = y_s;
+	}
 }
 
-
-void quelquun()
+void tcoord(integer sx)
 
 {
- integer haz,cx;
-
- if (imen)  erase_menu();
- finfouil();
- crep= 997;
+	integer sy, ix, iy, cb, cy, ib;
+	integer a, b, atdon;
+
+
+	num = 0;
+	crep = 999;
+	a = 0;
+	atdon = amzon + 3;
+	cy = 0;
+	while (cy < caff) {
+		a = a + tabdon[atdon];
+		atdon = atdon + 4;
+		cy = succ(integer, cy);
+	}
+	/*     for cy:=0 to caff-1 do
+	          a:=a+ tabdon[amzon+3+4*cy];
+	     b:= peek(amzon+3+4*caff); */
+	b = tabdon[atdon];
+	if (b == 0)  goto L1;
+	a = a + fleche;
+	cb = 0;
+	for (cy = 0; cy <= (sx - 2); cy ++) {
+		ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+		cb = cb + (ib * 4) + 2;
+	}
+	ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+	if (ib == 0)  goto L1;
+	cy = 1;
+	do {
+		cb = cb + 2;
+		sx = tabdon[a + cb] * res;
+		sy = tabdon[succ(integer, a + cb)];
+		cb = cb + 2;
+		ix = tabdon[a + cb] * res;
+		iy = tabdon[succ(integer, a + cb)];
+		cy = cy + 1;
+	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
+	           || (cy > ib)));
+	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
+
+	{
+		num = cy - 1;
+		return;
+	}
 L1:
- if (! cache) 
- {
-  if (crep== 997)  crep= 138;
-  repon(2,crep);
-  if (crep== 138)  parole(5, 2, 1); else parole(4, 4, 1);
-  if (iouv== 0)  s.conf= s.conf+ 2; else
-   if (s.conf< 50)  s.conf= s.conf+ 4; else
-    s.conf= s.conf+ (3* (s.conf / 10));
-  tsort();
-  tmlieu(15);
-  tip(ipers,cx);
-  caff= 69+ cx;
-  crep= caff;
-  msg[3]= discut;
-  msg[4]= disc[cx];
-  syn= true;
-  col= true;
- }
- else
- {
-  haz= hazard(1, 3);
-  if (haz== 2) 
-  {
-   cache= false;
-   crep= 137;
-   goto L1;
-  }
-  else
-  {
-   repon(2, 136);
-   haz= (hazard(0, 4))- 2;
-   parole(3, haz, 1);
-   clsf2();
-   person();
-   debloc(21);
-   affrep();
-  }
- }
- if (imen)  draw_menu();
-}
-
-void tsuiv()
-{
- integer cx,tbcl;
- integer cl,cy;
-
- cy= acha+ ((mchai- 1)* 10)- 1;
- cx= 0;
- do {
-  cx= cx+ 1;
-  cs= cs+ 1;
-  cl= cy+ cs;
-  tbcl= tabdon[cl];
- } while (!((tbcl != 0) || (cs> 9)));
- if ((tbcl != 0) && (cs< 11)) 
- {
-  is= is+ 1;
-  caff= tbcl;
-  crep= caff+ 400;
-  if (ipers!= 0)  s.conf= s.conf+ 2;
- }
- else
- {
-  affrep();
-  finfouil();
-  if (cx> 9)  crep= 131;
- }
-}
-
-void tfleche()
-{
- boolean qust;
- char touch;
- integer dummy,cd,xmo,ymo;
-
- if (num== 9999)  return;
- fenat(chr(152));
- rect= false;
- do {
-  touch='\0';
-
-  do {
-   mov_mouse(qust,touch);
-   if (clic)  rect=(x_s<256*res) && (y_s<176) && (y_s>12);
-   tinke();
-  } while (!(qust || rect || anyone));
-
-  if (qust && (touch=='\103'))  dummy=do_alert(stpou,1);
- } while (!((touch=='\73') || ((touch== '\104') && (x!= 0) && (y!=0)) ||
-       (anyone) || (rect)));
- if (touch=='\73')  iesc= true;
- if (rect) 
-   {
-     x=x_s;
-     y=y_s;
-   }
+	crep = 997;
 }
 
-void tcoord(integer sx)
 
-   {
-         integer sy,ix,iy,cb,cy,ib;
-         integer a, b, atdon;
-
-
-     num= 0;
-     crep= 999;
-     a=0;
-     atdon=amzon+3;
-     cy= 0;
-     while (cy<caff) 
-        {
-          a=a+tabdon[atdon];
-          atdon=atdon+4;
-          cy= succ(integer,cy);
-        }
-/*     for cy:=0 to caff-1 do
-          a:=a+ tabdon[amzon+3+4*cy];
-     b:= peek(amzon+3+4*caff); */
-     b= tabdon[atdon];
-     if (b== 0)  goto L1;
-     a= a+ fleche;
-     cb= 0;
-     for( cy= 0; cy <= (sx-2); cy ++)
-      {
-        ib= (tabdon[a+cb] << 8)+ tabdon[succ(integer,a+ cb)];
-        cb= cb+ (ib* 4)+ 2;
-      }
-      ib= (tabdon[a+cb] << 8)+ tabdon[succ(integer,a+ cb)];
-      if (ib== 0)  goto L1;
-      cy= 1;
-      do {
-        cb= cb+ 2;
-        sx= tabdon[a+ cb] * res;
-        sy= tabdon[succ(integer,a+ cb)];
-        cb= cb+ 2;
-        ix= tabdon[a+ cb] * res;
-        iy= tabdon[succ(integer,a+ cb)];
-        cy= cy+ 1;
-      } while (!(((x>= sx) && (x<= ix) && (y>= sy) && (y<= iy))
-             || (cy> ib)));
-      if ((x>= sx) && (x<= ix) && (y>= sy) && (y<= iy))
-
-          {
-            num= cy- 1;
-            return;
-          }
-L1:
-     crep= 997;
-   }
+void st7(integer ob) {
+	crep = 183;
+	if ((ob == 116) || (ob == 144))  crep = 104;
+	if ((ob == 126) || (ob == 111))  crep = 108;
+	if (ob == 132)  crep = 111;
+	if (ob == 142)  crep = 112;
+	if (crep == 183)  st4(ob);
+}
 
+void treg(integer ob) {
+	integer mdes;
 
-void st7(integer ob)
-{
- crep= 183;
- if ((ob== 116) || (ob== 144))  crep= 104;
- if ((ob== 126) || (ob== 111))  crep= 108;
- if (ob== 132)  crep= 111;
- if (ob== 142)  crep= 112;
- if (crep== 183)  st4(ob);
+	mdes = caff;
+	caff = ob;
+	if (((caff > 29) && (caff < 33)) || (caff == 144) ||
+	        (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
+		afdes(0);
+		if ((caff > 29) && (caff < 33))  repon(2, caff);
+		else repon(2, (caff + 400));
+		tkey1(true);
+		caff = mdes;
+		msg[3] = 0;
+		crep = 998;
+	} else {
+		obpart = true;
+		crep = caff + 400;
+		mfoudi();
+	}
 }
 
-void treg(integer ob)
-{
- integer mdes;
-
- mdes= caff;
- caff= ob;
- if (((caff> 29) && (caff< 33)) || (caff== 144) ||
-    (caff== 147) || (caff== 149) || (msg[4]== sregarder)) 
- {
-  afdes(0);
-  if ((caff> 29) && (caff< 33))  repon(2,caff); else repon(2,(caff+ 400));
-  tkey1(true);
-  caff= mdes;
-  msg[3]= 0;
-  crep= 998;
- }
- else
- {
-  obpart= true;
-  crep= caff+ 400;
-  mfoudi();
- }
-}
-
-void avpoing(integer& ob)
-{
- crep= 999;
- if (s.derobj!= 0)  ajjer(s.derobj);
- if (crep!= 139) 
- {
-  modobj(ob+ 400);
-  s.derobj= ob;
-  ob= 0;
- }
+void avpoing(integer &ob) {
+	crep = 999;
+	if (s.derobj != 0)  ajjer(s.derobj);
+	if (crep != 139) {
+		modobj(ob + 400);
+		s.derobj = ob;
+		ob = 0;
+	}
 }
 
-void rechai(integer& ch)
-{
- integer cx;
+void rechai(integer &ch) {
+	integer cx;
 
- cx= s.mlieu;
- if (s.mlieu== 16)  cx= 14;
- ch= tabdon[achai+ (cx* 7)+ pred(integer,num)];
+	cx = s.mlieu;
+	if (s.mlieu == 16)  cx = 14;
+	ch = tabdon[achai + (cx * 7) + pred(integer, num)];
 }
 
-void t23coul(integer& l)
-{
- boolean d;
+void t23coul(integer &l) {
+	boolean d;
 
- cherjer(143,d);
- l= 14;
- if (! d) 
- {
-  crep= 1512;
-  tperd();
- }
+	cherjer(143, d);
+	l = 14;
+	if (! d) {
+		crep = 1512;
+		tperd();
+	}
 }
 
-void maivid()
-{
- s.derobj= 0;
- modobj(500);
+void maivid() {
+	s.derobj = 0;
+	modobj(500);
 }
 
-void st13(integer ob)
-{
- if ((ob== 114) || (ob== 116) || (ob== 126) || (ob== 132) ||
- (ob== 111) || (ob== 106) || (ob== 102) || (ob== 100) ||
- (ob== 110) || (ob== 153) || (ob== 154) || (ob== 155) ||
- (ob== 156) || (ob== 157) || (ob== 144) || (ob== 158) ||
- (ob== 150) || (ob== 152))  crep= 999; else crep= 105;
+void st13(integer ob) {
+	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
+	        (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
+	        (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
+	        (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
+	        (ob == 150) || (ob == 152))  crep = 999;
+	else crep = 105;
 }
 
-void aldepl()
-{
-      integer dummy;
+void aldepl() {
+	integer dummy;
 
-  dummy=do_alert("[1][Alors, utilisez le menu DEP...][ok]",1);
+	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
 }
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 1fbd91c..7d5f33c 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -2,10 +2,10 @@
 
 
 
- /*$v-*/
- /*$k-*/
- /*$x-*/
- /*$c-*/
+/*$v-*/
+/*$k-*/
+/*$x-*/
+/*$c-*/
 
 #include "var_mor.h"          /* les variables */
 #include "keyboard.h"          /* la gestion du clavier */
@@ -18,7 +18,7 @@
 #include "parole.h"          /* les fonctions de la parole */
 #include "alert.h"
 #include "parole2.h"          /* les fonctions de la parole */
- /*  debug              le debugging */
+/*  debug              le debugging */
 #include "ques.h"          /* les questions */
 #include "menu.h"          /* les fonctions du menu */
 #include "mor.h"          /* divers */
@@ -31,94 +31,93 @@
 
 /*  ecrihexa            utilitaire */
 
-void divers(integer np,boolean b)
-{
-  teskbd();
-  do {
-    parole(np, 0, 0);
-    atf3f8(key);
-    if (newgd!=gd) 
-       {
-         gd=newgd;
-         hirs();
-         aff50(b);
-       }
-  } while (!(key== 66));
+void divers(integer np, boolean b) {
+	teskbd();
+	do {
+		parole(np, 0, 0);
+		atf3f8(key);
+		if (newgd != gd) {
+			gd = newgd;
+			hirs();
+			aff50(b);
+		}
+	} while (!(key == 66));
 }
 
 /* NIVEAU 0 */
 
-int main(int argc, const char* argv[])
-{
-/*init_debug;*/
-/*  ecri_seg;*/
-  pio_initialize(argc, argv);
-  gd=cga;
-  newgd= gd;
-  zuul= false;
-  tesok= false;
-  chartex();
-  charpal();
-  charge_cfiph();
-  charge_cfiec();
-  zzuul(adcfiec+161,0,1644);
-  c_zzz= 1;
-  init_nbrepm();
-  init_mouse();
-/*  crep:=memw[$7f00:0];
-  memw[$7f00:0]:= crep+1;
-  if (memw[$7f00:0]<> crep+1) then
-     begin
-       hirs;
-       show_mouse;
-       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
-       clrscr;
-       halt;
-     end;
-  if (Dseg+$1000>adbruit5) then
-     begin
-       hirs;
-       show_mouse;
-       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
-       clrscr;
-       halt;
-     end;*/
-  init_lieu();
-  arret= false;
-  sonoff= false;
-  f2_all= false;
-  textcolor(9);
-  teskbd();
-  dialpre();
-  newgd= gd;
-  teskbd();
-  if (newgd!=gd)  gd=newgd;
-  hirs();
-  ades= 0x7000;
-  aff50(false);
-  mlec= 0;
-  divers(142,false);
+int main(int argc, const char *argv[]) {
+	/*init_debug;*/
+	/*  ecri_seg;*/
+	pio_initialize(argc, argv);
+	gd = cga;
+	newgd = gd;
+	zuul = false;
+	tesok = false;
+	chartex();
+	charpal();
+	charge_cfiph();
+	charge_cfiec();
+	zzuul(adcfiec + 161, 0, 1644);
+	c_zzz = 1;
+	init_nbrepm();
+	init_mouse();
+	/*  crep:=memw[$7f00:0];
+	  memw[$7f00:0]:= crep+1;
+	  if (memw[$7f00:0]<> crep+1) then
+	     begin
+	       hirs;
+	       show_mouse;
+	       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
+	       clrscr;
+	       halt;
+	     end;
+	  if (Dseg+$1000>adbruit5) then
+	     begin
+	       hirs;
+	       show_mouse;
+	       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
+	       clrscr;
+	       halt;
+	     end;*/
+	init_lieu();
+	arret = false;
+	sonoff = false;
+	f2_all = false;
+	textcolor(9);
+	teskbd();
+	dialpre();
+	newgd = gd;
+	teskbd();
+	if (newgd != gd)  gd = newgd;
+	hirs();
+	ades = 0x7000;
+	aff50(false);
+	mlec = 0;
+	divers(142, false);
 
-  ani50();
-  divers(143,true);
-  suite();
-  music();
-  adzon();
-  takesav(0);
-  if (rech_cfiec)  charge_cfiec();
-  for( crep=1; crep <= c_zzz; crep ++) zzuul(adcfiec+161,0,1644);
-  charge_bruit5();
-  init_menu();
+	ani50();
+	divers(143, true);
+	suite();
+	music();
+	adzon();
+	takesav(0);
+	if (rech_cfiec)  charge_cfiec();
+	for (crep = 1; crep <= c_zzz; crep ++) zzuul(adcfiec + 161, 0, 1644);
+	charge_bruit5();
+	init_menu();
 
-  theure();
-  dprog();
-  hirs();
-  dessine_rouleau();
-  show_mouse();
-  do { tjouer(); } while (!arret);
-  hide_mouse();
-  clrscr;
-/*out_debug;*/
-  return EXIT_SUCCESS;
+	theure();
+	dprog();
+	hirs();
+	dessine_rouleau();
+	show_mouse();
+	do {
+		tjouer();
+	} while (!arret);
+	hide_mouse();
+	clrscr;
+	/*out_debug;*/
+	return EXIT_SUCCESS;
 }
 
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 3f250d9..d1de4b7 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -2,45 +2,42 @@ const integer m_arrow = 0;
 const integer m_point_hand = 1;
 
 boolean int_m,
-clic;
+        clic;
 
 integer m_show,
-x_s,
-y_s,
-p_o_s,
-mouse_shwn;
+        x_s,
+        y_s,
+        p_o_s,
+        mouse_shwn;
 
-matrix<0,5,0,11,integer> s_s;
+matrix<0, 5, 0, 11, integer> s_s;
 
 
-void init_mouse()
-{
-      integer i, j;
-       registres reg;
+void init_mouse() {
+	integer i, j;
+	registres reg;
 
-  mouse_shwn= 0;
-  x_s= 0;
-  y_s= 0;
-  p_o_s= 0;
-  /*int_m:= False;*/
-  clic= false;
-  m_show= m_arrow;
-  if ((memw[0xcc]==0) && (memw[0xce]==0))  int_m= false;
-  if (int_m) 
-   {
-    reg.ax= 0;
-    intr(0x33,reg);
-    int_m= (reg.ax==-1);
-    if (int_m) 
-      {
-         {
-           reg.ax=4;
-           reg.cx=0;
-           reg.dx=0;
-         }
-       intr(0x33,reg);
-     }
-   }
+	mouse_shwn = 0;
+	x_s = 0;
+	y_s = 0;
+	p_o_s = 0;
+	/*int_m:= False;*/
+	clic = false;
+	m_show = m_arrow;
+	if ((memw[0xcc] == 0) && (memw[0xce] == 0))  int_m = false;
+	if (int_m) {
+		reg.ax = 0;
+		intr(0x33, reg);
+		int_m = (reg.ax == -1);
+		if (int_m) {
+			{
+				reg.ax = 4;
+				reg.cx = 0;
+				reg.dx = 0;
+			}
+			intr(0x33, reg);
+		}
+	}
 }
 
 /*procedure change_mouse( t : integer );
@@ -58,412 +55,405 @@ begin
   end;
 end;  */
 
-void hide_mouse()
-{
-      integer i,j,k,ps,ds;
-      boolean imp;
+void hide_mouse() {
+	integer i, j, k, ps, ds;
+	boolean imp;
 
-  mouse_shwn = pred(integer,mouse_shwn);
-  if (mouse_shwn==0) 
-     {
-       imp= odd(y_s);
-       j=p_o_s;
-       switch (gd) {
-             case cga : {
-                     k=0;
-                     j=((cardinal)y_s >> 1) * 80+ ((cardinal)x_s >> 2);
-                     do {
-                       memw[0xb000+j]=s_s[0][k];
-                       memw[0xb800+j+2]=s_s[1][k];
-                       memw[0xba00+j]=s_s[2][k];
-                       memw[0xba00+j+2]=s_s[3][k];
-                       j=j+80;
-                       k= succ(integer,k);
-                     } while (!(k>=5));
-                   }
-                   break;
-                case ams : {
-                        for( i=0; i <= 3; i ++)
-                        {
-                          port[0x3dd]= 1 << i;
-                          k=0;
-                          j=p_o_s;
-                          do {
-                            if (imp) 
-                              {
-                                memw[0xb800+j]=s_s[i][k];
-                                j=j+80-0x2000;
-                              }
-                             else
-                              {
-                                memw[0xb800+j]=s_s[i][k];
-                                j=j+0x2000;
-                              }
-                            imp=! imp;
-                            k= succ(integer,k);
-                          } while (!(k>=8));
-                        }
-                      }
-                      break;
-                case ega : {
-                        port[0x3c4]=2;
-                        port[0x3ce]=8;
-                        port[0x3cf]=255;
-                        i= 0;
-                        do {
-                          port[0x3c5]= 1 << i;
-                          k=0;
-                          j=p_o_s;
-                          do {
-                            ps=mem[0xa000+j];
-                            mem[0xa000+j]=lo(s_s[i][k]);
-                            ps=mem[0xa000+j+1];
-                            mem[0xa000+j+1]=hi(s_s[i][k]);
-                            j=j+80;
-                            k= succ(integer,k);
-                          } while (!(k>=8));
-                          i= i+1;
-                        } while (!(i==4));
-                      }
-                      break;
-                case her : {
-                        j= ((cardinal)y_s >> 1) *80+((cardinal)x_s >> 3);
-                        for( i=0; i <= 5; i ++)
-                         {
-                           for( k=0; k <= 3; k ++) memw[0xb000+k*0x200+j]=s_s[i][k];
-                           j=j+80;
-                         }
-                      }
-                      break;
-                case tan : {
-                        j= ((cardinal)y_s >> 2) *160+((cardinal)x_s >> 1);
-                        k=0;
-                        do {
-                          for( i=0; i <= 3; i ++)
-                           {
-                             memw[0xb800+0x200*i+j]=s_s[k][i+(k << 2)];
-                             memw[0xb800+0x200*i+j+2]=s_s[k+3][i+(k << 2)];
-                           }
-                          j=j+160;
-                          k= succ(integer,k);
-                        } while (!(k==3));
-                      }
-                      break;
+	mouse_shwn = pred(integer, mouse_shwn);
+	if (mouse_shwn == 0) {
+		imp = odd(y_s);
+		j = p_o_s;
+		switch (gd) {
+		case cga : {
+			k = 0;
+			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+			do {
+				memw[0xb000 + j] = s_s[0][k];
+				memw[0xb800 + j + 2] = s_s[1][k];
+				memw[0xba00 + j] = s_s[2][k];
+				memw[0xba00 + j + 2] = s_s[3][k];
+				j = j + 80;
+				k = succ(integer, k);
+			} while (!(k >= 5));
+		}
+		break;
+		case ams : {
+			for (i = 0; i <= 3; i ++) {
+				port[0x3dd] = 1 << i;
+				k = 0;
+				j = p_o_s;
+				do {
+					if (imp) {
+						memw[0xb800 + j] = s_s[i][k];
+						j = j + 80 - 0x2000;
+					} else {
+						memw[0xb800 + j] = s_s[i][k];
+						j = j + 0x2000;
+					}
+					imp = ! imp;
+					k = succ(integer, k);
+				} while (!(k >= 8));
+			}
+		}
+		break;
+		case ega : {
+			port[0x3c4] = 2;
+			port[0x3ce] = 8;
+			port[0x3cf] = 255;
+			i = 0;
+			do {
+				port[0x3c5] = 1 << i;
+				k = 0;
+				j = p_o_s;
+				do {
+					ps = mem[0xa000 + j];
+					mem[0xa000 + j] = lo(s_s[i][k]);
+					ps = mem[0xa000 + j + 1];
+					mem[0xa000 + j + 1] = hi(s_s[i][k]);
+					j = j + 80;
+					k = succ(integer, k);
+				} while (!(k >= 8));
+				i = i + 1;
+			} while (!(i == 4));
+		}
+		break;
+		case her : {
+			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+			for (i = 0; i <= 5; i ++) {
+				for (k = 0; k <= 3; k ++) memw[0xb000 + k * 0x200 + j] = s_s[i][k];
+				j = j + 80;
+			}
+		}
+		break;
+		case tan : {
+			j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+			k = 0;
+			do {
+				for (i = 0; i <= 3; i ++) {
+					memw[0xb800 + 0x200 * i + j] = s_s[k][i + (k << 2)];
+					memw[0xb800 + 0x200 * i + j + 2] = s_s[k + 3][i + (k << 2)];
+				}
+				j = j + 160;
+				k = succ(integer, k);
+			} while (!(k == 3));
+		}
+		break;
 
-       }     /* case Gd */
-     }
+		}     /* case Gd */
+	}
 }
 
-void show_mouse()
-{
-      integer i, j, k, l,
-      ps,ds;
-      boolean imp;
-      char c;
+void show_mouse() {
+	integer i, j, k, l,
+	        ps, ds;
+	boolean imp;
+	char c;
 
-  mouse_shwn = mouse_shwn +1;
-  if (mouse_shwn!=1)  return;
-  j=p_o_s;
-  imp= odd(y_s);
-  i=x_s & 7;
-  switch (gd) {
-             case cga : {
-                     k=0;
-                     j=((cardinal)y_s >> 1) * 80+ ((cardinal)x_s >> 2);
-                     do {
-                       s_s[0][k]=memw[0xb800+j];
-                       s_s[1][k]=memw[0xb800+j+2];
-                       s_s[2][k]=memw[0xba00+j];
-                       s_s[3][k]=memw[0xba00+j+2];
-                       j=j+80;
-                       k= succ(integer,k);
-                     } while (!(k>=5));
-                   }
-                   break;
-          case ams : {
-                  for( i=0; i <= 3; i ++)
-                        {
-                          j=p_o_s;
-                          imp= odd(y_s);
-                          port[0x3de]= i;
-                          k=0;
-                          do {
-                            if (imp) 
-                              {
-                                s_s[i][k]=memw[0xb800+j];
-                                j=j+80-0x2000;
-                              }
-                             else
-                              {
-                                s_s[i][k]=memw[0xb800+j];
-                                j=j+0x2000;
-                              }
-                            imp=! imp;
-                            k= succ(integer,k);
-                          } while (!(k>=8));
-                        }
-                }
-                break;
-          case ega : {
-                  port[0x3ce]=4;
-                  l= 0;
-                  do {
-                    port[0x3cf]= l;
-                    k=0;
-                    j=p_o_s;
-                    do {
-                      s_s[l][k]= mem[0xa000+j]+(mem[0xa000+succ(integer,j)] << 8);
-                      j=j+80;
-                      k= succ(integer,k);
-                    } while (!(k>=8));
-                    l= l+1;
-                  } while (!(l==4));
-                }
-                break;
-          case her : {
-                  j= ((cardinal)y_s >> 1) *80+((cardinal)x_s >> 3);
-                  for( i=0; i <= 5; i ++)
-                   {
-                     for( k=0; k <= 3; k ++) s_s[i][k]=memw[0xb000+k*0x200+j];
-                     j=j+80;
-                   }
-                }
-                break;
-          case tan : {
-                  j= ((cardinal)y_s >> 2)*160+((cardinal)x_s >> 1);
-                  k=0;
-                  do {
-                    for( i=0; i <= 3; i ++)
-                      {
-                        s_s[k][i+(k << 2)]=memw[0xb800+0x200*i+j];
-                        s_s[k+3][i+(k << 2)]=memw[0xb800+0x200*i+j+2];
-                      }
-                    j=j+160;
-                    k= succ(integer,k);
-                  } while (!(k==3));
-                }
-                break;
-  }    /*  case Gd   */
-  affput(2,gd,x_s,y_s,0,0);
+	mouse_shwn = mouse_shwn + 1;
+	if (mouse_shwn != 1)  return;
+	j = p_o_s;
+	imp = odd(y_s);
+	i = x_s & 7;
+	switch (gd) {
+	case cga : {
+		k = 0;
+		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+		do {
+			s_s[0][k] = memw[0xb800 + j];
+			s_s[1][k] = memw[0xb800 + j + 2];
+			s_s[2][k] = memw[0xba00 + j];
+			s_s[3][k] = memw[0xba00 + j + 2];
+			j = j + 80;
+			k = succ(integer, k);
+		} while (!(k >= 5));
+	}
+	break;
+	case ams : {
+		for (i = 0; i <= 3; i ++) {
+			j = p_o_s;
+			imp = odd(y_s);
+			port[0x3de] = i;
+			k = 0;
+			do {
+				if (imp) {
+					s_s[i][k] = memw[0xb800 + j];
+					j = j + 80 - 0x2000;
+				} else {
+					s_s[i][k] = memw[0xb800 + j];
+					j = j + 0x2000;
+				}
+				imp = ! imp;
+				k = succ(integer, k);
+			} while (!(k >= 8));
+		}
+	}
+	break;
+	case ega : {
+		port[0x3ce] = 4;
+		l = 0;
+		do {
+			port[0x3cf] = l;
+			k = 0;
+			j = p_o_s;
+			do {
+				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(integer, j)] << 8);
+				j = j + 80;
+				k = succ(integer, k);
+			} while (!(k >= 8));
+			l = l + 1;
+		} while (!(l == 4));
+	}
+	break;
+	case her : {
+		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+		for (i = 0; i <= 5; i ++) {
+			for (k = 0; k <= 3; k ++) s_s[i][k] = memw[0xb000 + k * 0x200 + j];
+			j = j + 80;
+		}
+	}
+	break;
+	case tan : {
+		j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+		k = 0;
+		do {
+			for (i = 0; i <= 3; i ++) {
+				s_s[k][i + (k << 2)] = memw[0xb800 + 0x200 * i + j];
+				s_s[k + 3][i + (k << 2)] = memw[0xb800 + 0x200 * i + j + 2];
+			}
+			j = j + 160;
+			k = succ(integer, k);
+		} while (!(k == 3));
+	}
+	break;
+	}    /*  case Gd   */
+	affput(2, gd, x_s, y_s, 0, 0);
 }
 
-void pos_mouse(integer x,integer y)
-{
-      registres reg;
+void pos_mouse(integer x, integer y) {
+	registres reg;
 
-  if (x>314*res)  x=314*res;
-           else if (x<0)  x=0;
-  if (y>199)  y=199;
-           else if (y<0)  y=0;
-  if ((x==x_s) && (y==y_s))  return;
-  if (int_m) 
-     {
-         {
-           reg.ax=4;
-           reg.cx=x;
-           reg.dx=y;
-         }
-       intr(0x33,reg);
-     }
-  hide_mouse();
-  x_s=x;
-  y_s=y;
-  switch (gd) {
-          case ams : {
-                  p_o_s=((cardinal)y_s >> 1)*80+((cardinal)x_s >> 3)+(y_s & 1)*0x2000;
-                }
-                break;
-          /*cga : begin
-                  P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
-                end;*/
-          case ega : {
-                  p_o_s=y_s*80+((cardinal)x_s >> 3);
-                }
-                break;
-  }    /*  case Gd   */
-  show_mouse();
+	if (x > 314 * res)  x = 314 * res;
+	else if (x < 0)  x = 0;
+	if (y > 199)  y = 199;
+	else if (y < 0)  y = 0;
+	if ((x == x_s) && (y == y_s))  return;
+	if (int_m) {
+		{
+			reg.ax = 4;
+			reg.cx = x;
+			reg.dx = y;
+		}
+		intr(0x33, reg);
+	}
+	hide_mouse();
+	x_s = x;
+	y_s = y;
+	switch (gd) {
+	case ams : {
+		p_o_s = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3) + (y_s & 1) * 0x2000;
+	}
+	break;
+	/*cga : begin
+	        P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
+	      end;*/
+	case ega : {
+		p_o_s = y_s * 80 + ((cardinal)x_s >> 3);
+	}
+	break;
+	}    /*  case Gd   */
+	show_mouse();
 }
 
-void read_pos_mouse(integer& x,integer& y,integer& c)
-{
-       registres reg;
+void read_pos_mouse(integer &x, integer &y, integer &c) {
+	registres reg;
 
-  if (int_m) 
-     {
-       reg.ax=3;
-       intr(0x33,reg);
-       x=reg.cx;
-       y=reg.dx;
-       c=reg.bx;
-     }
-    else
-     {
-       c=0;
-       x=x_s;
-       y=y_s;
-     }
+	if (int_m) {
+		reg.ax = 3;
+		intr(0x33, reg);
+		x = reg.cx;
+		y = reg.dx;
+		c = reg.bx;
+	} else {
+		c = 0;
+		x = x_s;
+		y = y_s;
+	}
 }
 
-void mov_mouse(boolean& funct, char& key)
-   {
-         boolean p_key;
-         char in1, in2;
-         integer x,y,cx,cy,cd;
-         registres reg;
+void mov_mouse(boolean &funct, char &key) {
+	boolean p_key;
+	char in1, in2;
+	integer x, y, cx, cy, cd;
+	registres reg;
 
-     if (int_m) 
-     {
-       reg.ax=3;
-       intr(0x33,reg);
-       x=reg.cx;
-       y=reg.dx;
-       cd=reg.bx;
-       pos_mouse(x,y);
-       if (cd!=0) 
-          {
-            clic=true;
-            return;
-          }
-     }
-     funct=false;
-     key='\377';
-     p_key=keypressed();
-     while (p_key) 
-        {
-          input >> kbd >> in1;
-          read_pos_mouse(cx, cy, cd);
-          switch (upcase(in1)) {
-                         case '4' : cx= cx - 8; break;
-                         case '2' : cy= cy + 8; break;
-                         case '6' : cx= cx + 8; break;
-                         case '8' : cy= cy - 8; break;
-                         case '7' : {
-                                 cy=1;
-                                 cx=1;
-                               }
-                               break;
-                         case '1' : {
-                                 cx=1;
-                                 cy=190;
-                               }
-                               break;
-                         case '9' : {
-                                 cx=315*res;
-                                 cy=1;
-                               }
-                               break;
-                         case '3' : {
-                                 cy=190;
-                                 cx=315*res;
-                               }
-                               break;
-                         case '5' : {
-                                 cy=100;
-                                 cx=155*res;
-                               }
-                               break;
-                    case ' ': case '\15' : {
-                                 clic=true;
-                                 return;
-                               }
-                               break;
-                         case '\33' : {
-                                 p_key=keypressed();
-                                 if (p_key) 
-                                    {
-                                      input >> kbd >> in2;
-                                      switch (in2) {
-                                               case 'K' : cx= pred(integer,cx); break;
-                                               case 'P' : cy= succ(integer,cy); break;
-                                               case 'M' : cx= cx + 2; break;
-                                               case 'H' : cy= pred(integer,cy); break;
-                                               case RANGE_10(';','D') : {
-                                                            funct= true;
-                                                            key=in2;
-                                                            return;
-                                                          }
-                                                          break;
-                                               case 'G' : {
-                                                       cx=cx-1;
-                                                       cy=cy-1;
-                                                     }
-                                                     break;
-                                               case 'I' : {
-                                                       cx=cx+1;
-                                                       cy=cy-1;
-                                                     }
-                                                     break;
-                                               case 'O' : {
-                                                       cx=cx-1;
-                                                       cy=cy+1;
-                                                     }
-                                                     break;
-                                               case 'Q' : {
-                                                       cx=cx+1;
-                                                       cy=cy+1;
-                                                     }
-                                                     break;
-                                            }    /* case */
-                                    }
-                               }
-                               break;
-                         case 'I' : {
-                                 cx= res*32;
-                                 cy= 8;
-                               }
-                               break;
-                         case 'D' : {
-                                 cx= 80*res;
-                                 cy= 8;
-                               }
-                               break;
-                         case 'A' : {
-                                 cx= 126*res;
-                                 cy= 8;
-                               }
-                               break;
-                         case 'S' : {
-                                 cx= 174*res;
-                                 cy= 8;
-                               }
-                               break;
-                         case 'P' : {
-                                 cx= 222*res;
-                                 cy= 8;
-                               }
-                               break;
-                         case 'F' : {
-                                 cx= res*270;
-                                 cy= 8;
-                               }
-                               break;
-                         case '\23' : {
-                                 sonoff= ! sonoff;
-                                 return;
-                               }
-                               break;
-                         case '\26' : {
-                                 zuul=true;
-                                 return;
-                               }
-                               break;
-                         case '\24' : {           /* ^T => mode tandy */
-                                 funct= true;
-                                 key= '\11';
-                               }
-                               break;
-                          case '\10' : {           /* ^H => mode Hercule */
-                                 funct= true;
-                                 key= '\7';
-                               }
-                               break;
-                    case '\1':case '\3':case '\5' : {
-                                 funct= true;
-                                 key=in1;
-                               }
-                               break;
-                }
-          pos_mouse(cx, cy);
-          p_key=keypressed();
-        }
-   }
+	if (int_m) {
+		reg.ax = 3;
+		intr(0x33, reg);
+		x = reg.cx;
+		y = reg.dx;
+		cd = reg.bx;
+		pos_mouse(x, y);
+		if (cd != 0) {
+			clic = true;
+			return;
+		}
+	}
+	funct = false;
+	key = '\377';
+	p_key = keypressed();
+	while (p_key) {
+		input >> kbd >> in1;
+		read_pos_mouse(cx, cy, cd);
+		switch (upcase(in1)) {
+		case '4' :
+			cx = cx - 8;
+			break;
+		case '2' :
+			cy = cy + 8;
+			break;
+		case '6' :
+			cx = cx + 8;
+			break;
+		case '8' :
+			cy = cy - 8;
+			break;
+		case '7' : {
+			cy = 1;
+			cx = 1;
+		}
+		break;
+		case '1' : {
+			cx = 1;
+			cy = 190;
+		}
+		break;
+		case '9' : {
+			cx = 315 * res;
+			cy = 1;
+		}
+		break;
+		case '3' : {
+			cy = 190;
+			cx = 315 * res;
+		}
+		break;
+		case '5' : {
+			cy = 100;
+			cx = 155 * res;
+		}
+		break;
+		case ' ':
+		case '\15' : {
+			clic = true;
+			return;
+		}
+		break;
+		case '\33' : {
+			p_key = keypressed();
+			if (p_key) {
+				input >> kbd >> in2;
+				switch (in2) {
+				case 'K' :
+					cx = pred(integer, cx);
+					break;
+				case 'P' :
+					cy = succ(integer, cy);
+					break;
+				case 'M' :
+					cx = cx + 2;
+					break;
+				case 'H' :
+					cy = pred(integer, cy);
+					break;
+				case RANGE_10(';', 'D') : {
+					funct = true;
+					key = in2;
+					return;
+				}
+				break;
+				case 'G' : {
+					cx = cx - 1;
+					cy = cy - 1;
+				}
+				break;
+				case 'I' : {
+					cx = cx + 1;
+					cy = cy - 1;
+				}
+				break;
+				case 'O' : {
+					cx = cx - 1;
+					cy = cy + 1;
+				}
+				break;
+				case 'Q' : {
+					cx = cx + 1;
+					cy = cy + 1;
+				}
+				break;
+				}    /* case */
+			}
+		}
+		break;
+		case 'I' : {
+			cx = res * 32;
+			cy = 8;
+		}
+		break;
+		case 'D' : {
+			cx = 80 * res;
+			cy = 8;
+		}
+		break;
+		case 'A' : {
+			cx = 126 * res;
+			cy = 8;
+		}
+		break;
+		case 'S' : {
+			cx = 174 * res;
+			cy = 8;
+		}
+		break;
+		case 'P' : {
+			cx = 222 * res;
+			cy = 8;
+		}
+		break;
+		case 'F' : {
+			cx = res * 270;
+			cy = 8;
+		}
+		break;
+		case '\23' : {
+			sonoff = ! sonoff;
+			return;
+		}
+		break;
+		case '\26' : {
+			zuul = true;
+			return;
+		}
+		break;
+		case '\24' : {           /* ^T => mode tandy */
+			funct = true;
+			key = '\11';
+		}
+		break;
+		case '\10' : {           /* ^H => mode Hercule */
+			funct = true;
+			key = '\7';
+		}
+		break;
+		case '\1':
+		case '\3':
+		case '\5' : {
+			funct = true;
+			key = in1;
+		}
+		break;
+		}
+		pos_mouse(cx, cy);
+		p_key = keypressed();
+	}
+}
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 5bd4fd2..7c8f1c9 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -1,205 +1,206 @@
 str255 delig;
-const array<0,31,byte> tabdr
-      = {{  32, 101, 115,  97, 114, 105, 110,
-          117, 116, 111, 108,  13, 100,  99,
-          112, 109,  46, 118, 130,  39, 102,
-           98,  44, 113, 104, 103,  33,  76,
-           85, 106,  30,  31 }};
-
-
-const array<0,31,byte> tab30
-      = {{   69,  67,  74, 138, 133, 120,  77, 122,
-          121,  68,  65,  63,  73,  80,  83,  82,
-          156,  45,  58,  79,  49,  86,  78,  84,
-           71,  81,  64,  66, 135,  34, 136,  91 }};
-
-
-
-const array<0,31,byte> tab31
-      = {{  93,  47,  48,  53,  50,  70, 124,  75,
-           72, 147, 140, 150, 151,  57,  56,  51,
-          107, 139,  55,  89, 131,  37,  54,  88,
-          119,   0,   0,   0,   0,   0,   0,   0 }};
-
-void deline( integer num , phrase& l , integer& tl );
-
-static void cinq_huit( char& c, integer& ind, byte& pt, boolean& the_end)
-   {
-           const array<0,31,char> rap
-         = {{ ',', ':', '@', '!', '?', '-', '‡',
-            ' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
-            '‹', 'Œ', '¢', '\47', '“', '"', '—',
-            '–', '0', '1', '2', '3', '4', '5',
-            '6', '7', '8', '9'}};
-         integer oct,ocd;
-
-            /* 5-8 */
-     oct=t_mot[ind];
-     oct=(cardinal)(oct << (16-pt)) >> (16-pt);
-     if (pt<6) 
-        {
-          ind=ind+1;
-          oct=oct << (5-pt);
-          pt=pt+11;
-          oct=oct | ((cardinal)t_mot[ind] >> pt);
-        }
-      else
-        {
-          pt=pt-5;
-          oct=(cardinal)oct >> pt;
-        }
-
-     switch (oct) {
-                  case 11 : {
-                         c= '$';
-                         the_end= true;
-                       }
-                       break;
-               case 30:case 31 : {
-                         ocd=t_mot[ind];
-                         ocd=(cardinal)(ocd << (16-pt)) >> (16-pt);
-                         if (pt<6) 
-                            {
-                              ind=ind+1;
-                              ocd=ocd << (5-pt);
-                              pt=pt+11;
-                              ocd=ocd | ((cardinal)t_mot[ind] >> pt);
-                            }
-                          else
-                            {
-                              pt=pt-5;
-                              ocd=(cardinal)ocd >> pt;
-                            }
-                          if (oct==30)  c=chr(tab30[ocd]);
-                                    else c=chr(tab31[ocd]);
-                          if (c=='\0') 
-                             {
-                               the_end=true;
-                               c='#';
-                             }
-                        }
-                        break;
-              default: c=chr(tabdr[oct]);
-            }
-   }              /* 5-8 */
-
-void deline( integer num , phrase& l , integer& tl )
-      {
-            integer i,j,ts;
-            char let;
-             byte ps, k;
-            boolean the_end;
-
-              /* DETEX */
-        /*debug('  => DeLine');*/
-        delig="";
-        ts= t_rec[num].indis;
-        ps= t_rec[num].point;
-        i=ts;
-        tl=1;
-        j=1;
-        k=ps;
-        the_end=false;
-        do {
-          cinq_huit(let,i,k, the_end);
-          l[j]=let;
-          if (j<254)  delig=delig+let;
-          j=j+1;
-        } while  (!the_end);
-        tl=j-1;
-        if (tl<255)  delig=copy(delig,1,tl-1);       /* enleve le $ */
-      }       /* DETEX */
-
-
-void afftex( phrase ch, integer x,integer y,integer dx,integer dy, integer typ);
-
-
-static integer l_motsuiv(integer p, phrase& ch, integer& tab)
-  {
-        integer c;
-
-    integer l_motsuiv_result;
-    c=p;
-    while (! (set::of(' ','$','@', eos).has(ch[p])))  p=p+1;
-    l_motsuiv_result=tab*(p-c);
-    return l_motsuiv_result;
-  }
-
-void afftex( phrase ch, integer x,integer y,integer dx,integer dy, integer typ)
-  {
-        boolean the_end;
-        char touch;
-        integer xf,yf;
-        integer xc,yc;
-        integer tab, p;
-        varying_string<255> s;
-        integer i,j,nt;
-
-
-/*    debug('  .. Afftex');*/
-    putxy(x,y);
-    if (res==1)  tab=10; else tab=6;
-    dx= dx * 6;
-    dy= dy * 6;
-    xc= x;
-    yc= y;
-    xf= x+dx;
-    yf= y+dy;
-    p= 1;
-    the_end=(ch[p]=='$');
-    s="";
-    while (! the_end) 
-     {
-      switch (ch[p]) {
-                  case '@' : {
-                          writeg(s,typ);
-                          s="";
-                          p=p+1;
-                          xc=x;
-                          yc=yc+6;
-                          putxy(xc,yc);
-                        }
-                        break;
-                  case ' ' : {
-                          s=s+' ';
-                          xc=xc+tab;
-                          p=p+1;
-                          if (l_motsuiv(p, ch, tab)+xc > xf) 
-                             {
-                               writeg(s,typ);
-                               s="";
-                               xc=x;
-                               yc=yc+6;
-                               if (yc>yf) 
-                                  {
-                                    do {; } while (!keypressed());
-                                    i=y;
-                                    do {
-                                      j=x;
-                                      do {
-                                        putxy(j,i);
-                                        writeg(" ",0);
-                                        j=j+6;
-                                      } while (!(j>xf));
-                                      i=i+6;
-                                    } while (!(i>yf));
-                                    yc=y;
-                                  }
-                               putxy(xc,yc);
-                             }
-                        }
-                        break;
-                  case '$' : {
-                          the_end= true;
-                          writeg(s,typ);
-                        }
-                        break;
-        default:
-        {
-          s=s+ch[p];
-          p=p+1;
-          xc=xc+tab;
-        }
-      }     /* case */
-    }
-  }
+const array<0, 31, byte> tabdr
+= {{
+		32, 101, 115,  97, 114, 105, 110,
+		117, 116, 111, 108,  13, 100,  99,
+		112, 109,  46, 118, 130,  39, 102,
+		98,  44, 113, 104, 103,  33,  76,
+		85, 106,  30,  31
+	}
+};
+
+
+const array<0, 31, byte> tab30
+= {{
+		69,  67,  74, 138, 133, 120,  77, 122,
+		121,  68,  65,  63,  73,  80,  83,  82,
+		156,  45,  58,  79,  49,  86,  78,  84,
+		71,  81,  64,  66, 135,  34, 136,  91
+	}
+};
+
+
+
+const array<0, 31, byte> tab31
+= {{
+		93,  47,  48,  53,  50,  70, 124,  75,
+		72, 147, 140, 150, 151,  57,  56,  51,
+		107, 139,  55,  89, 131,  37,  54,  88,
+		119,   0,   0,   0,   0,   0,   0,   0
+	}
+};
+
+void deline(integer num , phrase &l , integer &tl);
+
+static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
+	const array<0, 31, char> rap
+	= {{ ',', ':', '@', '!', '?', '-', '‡',
+			' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
+			'‹', 'Œ', '¢', '\47', '“', '"', '—',
+			'–', '0', '1', '2', '3', '4', '5',
+			'6', '7', '8', '9'
+		}
+	};
+	integer oct, ocd;
+
+	/* 5-8 */
+	oct = t_mot[ind];
+	oct = (cardinal)(oct << (16 - pt)) >> (16 - pt);
+	if (pt < 6) {
+		ind = ind + 1;
+		oct = oct << (5 - pt);
+		pt = pt + 11;
+		oct = oct | ((cardinal)t_mot[ind] >> pt);
+	} else {
+		pt = pt - 5;
+		oct = (cardinal)oct >> pt;
+	}
+
+	switch (oct) {
+	case 11 : {
+		c = '$';
+		the_end = true;
+	}
+	break;
+	case 30:
+	case 31 : {
+		ocd = t_mot[ind];
+		ocd = (cardinal)(ocd << (16 - pt)) >> (16 - pt);
+		if (pt < 6) {
+			ind = ind + 1;
+			ocd = ocd << (5 - pt);
+			pt = pt + 11;
+			ocd = ocd | ((cardinal)t_mot[ind] >> pt);
+		} else {
+			pt = pt - 5;
+			ocd = (cardinal)ocd >> pt;
+		}
+		if (oct == 30)  c = chr(tab30[ocd]);
+		else c = chr(tab31[ocd]);
+		if (c == '\0') {
+			the_end = true;
+			c = '#';
+		}
+	}
+	break;
+	default:
+		c = chr(tabdr[oct]);
+	}
+}              /* 5-8 */
+
+void deline(integer num , phrase &l , integer &tl) {
+	integer i, j, ts;
+	char let;
+	byte ps, k;
+	boolean the_end;
+
+	/* DETEX */
+	/*debug('  => DeLine');*/
+	delig = "";
+	ts = t_rec[num].indis;
+	ps = t_rec[num].point;
+	i = ts;
+	tl = 1;
+	j = 1;
+	k = ps;
+	the_end = false;
+	do {
+		cinq_huit(let, i, k, the_end);
+		l[j] = let;
+		if (j < 254)  delig = delig + let;
+		j = j + 1;
+	} while (!the_end);
+	tl = j - 1;
+	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */
+}       /* DETEX */
+
+
+void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ);
+
+
+static integer l_motsuiv(integer p, phrase &ch, integer &tab) {
+	integer c;
+
+	integer l_motsuiv_result;
+	c = p;
+	while (!(set::of(' ', '$', '@', eos).has(ch[p])))  p = p + 1;
+	l_motsuiv_result = tab * (p - c);
+	return l_motsuiv_result;
+}
+
+void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ) {
+	boolean the_end;
+	char touch;
+	integer xf, yf;
+	integer xc, yc;
+	integer tab, p;
+	varying_string<255> s;
+	integer i, j, nt;
+
+
+	/*    debug('  .. Afftex');*/
+	putxy(x, y);
+	if (res == 1)  tab = 10;
+	else tab = 6;
+	dx = dx * 6;
+	dy = dy * 6;
+	xc = x;
+	yc = y;
+	xf = x + dx;
+	yf = y + dy;
+	p = 1;
+	the_end = (ch[p] == '$');
+	s = "";
+	while (! the_end) {
+		switch (ch[p]) {
+		case '@' : {
+			writeg(s, typ);
+			s = "";
+			p = p + 1;
+			xc = x;
+			yc = yc + 6;
+			putxy(xc, yc);
+		}
+		break;
+		case ' ' : {
+			s = s + ' ';
+			xc = xc + tab;
+			p = p + 1;
+			if (l_motsuiv(p, ch, tab) + xc > xf) {
+				writeg(s, typ);
+				s = "";
+				xc = x;
+				yc = yc + 6;
+				if (yc > yf) {
+					do {
+						;
+					} while (!keypressed());
+					i = y;
+					do {
+						j = x;
+						do {
+							putxy(j, i);
+							writeg(" ", 0);
+							j = j + 6;
+						} while (!(j > xf));
+						i = i + 6;
+					} while (!(i > yf));
+					yc = y;
+				}
+				putxy(xc, yc);
+			}
+		}
+		break;
+		case '$' : {
+			the_end = true;
+			writeg(s, typ);
+		}
+		break;
+		default: {
+			s = s + ch[p];
+			p = p + 1;
+			xc = xc + tab;
+		}
+		}     /* case */
+	}
+}
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index b2f5f79..d40f8d3 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -1,32 +1,29 @@
-void dem2()
-{
-      untyped_file f;
-      integer k;
-
-  /* -- demande de disk 2 -- */
-  while (ioresult!=0);
-  assign(f,"mort.001");
-  /*$i-*/
-  reset(f);
-  while (ioresult!=0) 
-   {
-     show_mouse();
-     k= do_alert(al_mess2,1);
-     hide_mouse();
-     reset(f);
-   }
-  close(f);
+void dem2() {
+	untyped_file f;
+	integer k;
+
+	/* -- demande de disk 2 -- */
+	while (ioresult != 0);
+	assign(f, "mort.001");
+	/*$i-*/
+	reset(f);
+	while (ioresult != 0) {
+		show_mouse();
+		k = do_alert(al_mess2, 1);
+		hide_mouse();
+		reset(f);
+	}
+	close(f);
 }
 
-void ani50()
-  {
-    crep= animof(1,1);
-    pictout(adani,crep,63,12);
-    crep= animof(2,1);
-    pictout(adani,crep,63,12);
-    f2_all= (res==1);
-    repon(2, c_paroles+143);
-  }
+void ani50() {
+	crep = animof(1, 1);
+	pictout(adani, crep, 63, 12);
+	crep = animof(2, 1);
+	pictout(adani, crep, 63, 12);
+	f2_all = (res == 1);
+	repon(2, c_paroles + 143);
+}
 
 /*overlay procedure apzuul;
   begin
@@ -37,311 +34,304 @@ void ani50()
      end;
   end;*/
 
-/* overlay */ void aff50(boolean c)
-  {
-        integer k;
-
-    caff= 50;
-    maff=0;
-    taffich();
-    dessine(ades,63,12);
-    if (c)  ani50();
-         else repon(2, c_paroles+142);
-    f3f8();
-  }
-
-/* overlay */ void init_menu()
-  {
-        integer i, j, tai;
-        phrase st;
-        untyped_file f;
-
-    assign(f,"menufr.mor");
-    /*$i-*/
-    reset(f,144);
-    blockread(f,lettres,1);
-    close(f);
-    /* ----  Demande de changement de disquette  ---- */
-    dem2();
-
-
-    for( i= 1; i <= 8; i ++)
-       inv[i]= "*                     ";
-    inv[7]= "< -*-*-*-*-*-*-*-*-*- ";
-    for( i= 1; i <= 7; i ++)
-       dep[i]= "*                       ";
-    i= 1;
-    do {
-      deline(i+c_action,st,tai);
-      act[i]= delig + "          ";
-      if (i<9) 
-         {
-           if (i<6) 
-              {
-                deline(i+c_saction,st,tai);
-                self_[i]= delig + "       ";
-              }
-           deline(i+c_dis,st,tai);
-           dis[i]= delig+ ' ';
-         }
-      i= succ(integer,i);
-    } while (!(i== 22));
-    for( i= 1; i <= 8; i ++)
-      {
-       disc[i]=0x500+i;
-       if (i<8)  depl[i]=0x200+i;
-       invt[i]=0x100+i;
-       if (i>6)  menu_disable(invt[i]);
-      }
-    msg3=no_choice;
-    msg4=no_choice;
-    msg[3]=no_choice;
-    msg[4]=no_choice;
-    clic=false;
-  }


Commit: 3ae3dbd10a44170909820670ee8d65c5a68e2047
    https://github.com/scummvm/scummvm/commit/3ae3dbd10a44170909820670ee8d65c5a68e2047
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:14-07:00

Commit Message:
MORTEVIELLE: Rename *.h -> *.cpp where they really belong

Changed paths:
  A engines/mortevielle/actions.cpp
  A engines/mortevielle/alert.cpp
  A engines/mortevielle/boite.cpp
  A engines/mortevielle/disk.cpp
  A engines/mortevielle/droite.cpp
  A engines/mortevielle/keyboard.cpp
  A engines/mortevielle/level15.cpp
  A engines/mortevielle/menu.cpp
  A engines/mortevielle/mor.cpp
  A engines/mortevielle/mor2.cpp
  A engines/mortevielle/mouse.cpp
  A engines/mortevielle/outtext.cpp
  A engines/mortevielle/ovd1.cpp
  A engines/mortevielle/parole.cpp
  A engines/mortevielle/parole2.cpp
  A engines/mortevielle/prog.cpp
  A engines/mortevielle/ques.cpp
  A engines/mortevielle/sprint.cpp
  A engines/mortevielle/taffich.cpp
  A engines/mortevielle/var_mor.cpp
  R engines/mortevielle/actions.h
  R engines/mortevielle/alert.h
  R engines/mortevielle/boite.h
  R engines/mortevielle/disk.h
  R engines/mortevielle/droite.h
  R engines/mortevielle/keyboard.h
  R engines/mortevielle/level15.h
  R engines/mortevielle/menu.h
  R engines/mortevielle/mor.h
  R engines/mortevielle/mor2.h
  R engines/mortevielle/mouse.h
  R engines/mortevielle/outtext.h
  R engines/mortevielle/ovd1.h
  R engines/mortevielle/parole.h
  R engines/mortevielle/parole2.h
  R engines/mortevielle/prog.h
  R engines/mortevielle/ques.h
  R engines/mortevielle/sprint.h
  R engines/mortevielle/taffich.h
  R engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
new file mode 100644
index 0000000..1dd3abe
--- /dev/null
+++ b/engines/mortevielle/actions.cpp
@@ -0,0 +1,1193 @@
+/* NIVEAU 4 */
+const char stouinon[] = "[2][ ][OUI][NON]";
+
+/* overlay */
+void taller()
+
+{
+	integer mx, cx, cy;
+
+	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
+		s.mlieu = 15;
+		caff = s.mlieu;
+		afdes(0);
+		repon(2, s.mlieu);
+	}
+	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
+		if (! syn)  ecr3("aller");
+		tfleche();
+		if (iesc)  okdes = false;
+		if ((anyone) || (iesc))  return;
+		tcoord(1);
+		if (num == 0)  return;
+		if (num == 1) {
+			s.mlieu = 0;
+			tmlieu(0);
+		} else if (num == 7) {
+			s.mlieu = 13;
+			tmlieu(13);
+		} else if (num != 6)  s.mlieu = 26;
+		if ((num > 1) && (num < 6))  ment = num - 1;
+		if (num > 7)  ment = num - 3;
+		if (num != 6)  affrep();
+		else aldepl();
+		return;
+	}
+	tsort();
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!(depl[cx] == msg[4]));
+	if (s.mlieu == 19) {
+		if (cx == 1)  t1deva();
+		if (cx == 2)  t1neig();
+		goto L2;
+	}
+	if (s.mlieu == 23) {
+		if (cx == 1)  t1deau();
+		if (cx == 2)  t1derr();
+		goto L2;
+	}
+	if ((s.mlieu == 11) && (cx == 1))  cx = 6;
+	if (s.mlieu == 12) {
+		if (cx == 2)  cx = 6;
+		if (cx == 5)  cx = 16;
+	}
+	if ((s.mlieu == 14) && (cx == 3))  cx = 6;
+	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))  cx = 6;
+	if ((s.mlieu > 19) && (s.mlieu != 26))  cx = cx + 10;
+	if ((s.mlieu == 20) && (cx == 13))  cx = 16;
+	if (s.mlieu == 21) {
+		if (cx == 12)  cx = 16;
+		else if (cx > 13)  cx = 15;
+	}
+	if ((s.mlieu == 22) && (cx > 14))  cx = 15;
+	if ((s.mlieu == 24) && (cx != 17))
+		if (cx > 13)  cx = 15;
+	if (cx == 1)  s.mlieu = 11;
+	else if (cx == 2)  s.mlieu = 12;
+	else if (cx == 3)  s.mlieu = 14;
+	else if (cx == 4)  s.mlieu = 15;
+	else if (cx == 5)  cx = 12;
+	if (cx == 6)  cx = 11;
+	if (cx == 11)  t1sama();
+	else if (cx == 12)  t1deva();
+	else if (cx == 13)  s.mlieu = 20;
+	else if (cx == 14)  s.mlieu = 24;
+	else if (cx == 15)  t1neig();
+	else if (cx == 16)  t1derr();
+	else if (cx == 17) {
+		if ((s.ipuit != 120) && (s.ipuit != 140))  crep = 997;
+		else if (s.ipuit == 120)  crep = 181;
+		else if (s.conf > 80) {
+			crep = 1505;
+			tperd();
+		} else {
+			s.mlieu = 23;
+			affrep();
+		}
+	}
+	if ((cx < 5) || (cx == 13) || (cx == 14))  affrep();
+	debloc(s.mlieu);
+L2:
+	tmlieu(s.mlieu);
+}
+
+/* overlay */ void tprendre() {
+	integer cx, cy, cz;
+
+	if (caff > 99) {
+		cx = caff;
+		avpoing(cx);
+		if (crep != 139) {
+			if (ipers > 0)  s.conf = s.conf + 3;
+			if (obpart) {
+				if (s.mlieu == 2)  s.iloic = 0;
+				if (s.mlieu == 13) {
+					if (s.iboul == caff)  s.iboul = 0;
+					if (s.ibag == caff)  s.ibag = 0;
+				}
+				if (s.mlieu == 14)  s.icave = 0;
+				if (s.mlieu == 16)  s.icryp = 0;
+				if (s.mlieu == 17)  s.ivier = 0;
+				if (s.mlieu == 24)  s.ipuit = 0;
+				mfouen();
+				obpart = false;
+				affrep();
+			} else {
+				tabdon[acha + (pred(integer, mchai) * 10) + pred(integer, cs)] = 0;
+				tsuiv();
+				dobj = dobj + 1;
+				if (dobj > 6) {
+					s.conf = s.conf + 2;
+					dobj = 0;
+				}
+			}
+		}
+		return;
+	}
+	if (! syn)  ecr3("prendre");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	if (caff == 3) {
+		tcoord(2);
+		if (num == 1) {
+			crep = 152;
+			return;
+		}
+	}
+	tcoord(5);
+	if ((num == 0) || ((num == 1) && (s.mlieu == 16))) {
+		tcoord(8);
+		if (num != 0) {
+			if (ipers > 0)  s.conf = s.conf + 3;
+			crep = 997;
+			if ((s.mlieu == 2) && (s.iloic != 0))  avpoing(s.iloic);
+			if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) {
+				avpoing(s.iboul);
+				if ((crep != 997) && (crep != 139))  aniof(2, 7);
+			}
+			if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) {
+				avpoing(s.ibag);
+				if ((crep != 997) && (crep != 139))  aniof(2, 6);
+			}
+			if ((s.mlieu == 14) && (s.icave != 0)) {
+				avpoing(s.icave);
+				if ((crep != 997) && (crep != 139))  aniof(2, 2);
+			}
+			if ((s.mlieu == 16) && (s.icryp != 0))  avpoing(s.icryp);
+			if ((s.mlieu == 17) && (s.ivier != 0)) {
+				avpoing(s.ivier);
+				if ((crep != 997) && (crep != 139)) {
+					crep = 182;
+					aniof(2, 1);
+				}
+			}
+			if ((s.mlieu == 24) && (s.ipuit != 0)) {
+				avpoing(s.ipuit);
+				if ((crep != 997) && (crep != 139))  aniof(2, 1);
+			}
+			if ((crep != 997) && (crep != 182) && (crep != 139))  crep = 999;
+		}
+	} else {
+		if (((s.mlieu == 0) && (num == 3)) || ((s.mlieu == 1) && (num == 4))
+		        || ((s.mlieu == 2) && (num == 1)) || ((s.mlieu == 4) && (num == 3))
+		        || ((s.mlieu == 5) && (num == 6)) || ((s.mlieu == 6) && (num == 2))
+		        || ((s.mlieu == 7) && (num == 6)) || ((s.mlieu == 8) && (num == 4))
+		        || ((s.mlieu == 9) && (num == 4)) || ((s.mlieu == 10) && (num > 2))
+		        || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
+		        || ((s.mlieu == 13) && (num > 4)) || ((s.mlieu > 13)
+		                && (s.mlieu != 23)))  crep = 997;
+		else {
+			if (s.mlieu == 23) {
+				crep = 1504;
+				tperd();
+			} else crep = 120;
+		}
+	}
+}
+
+/* overlay */ void tsprendre() {
+	integer cx, cy, cz;
+
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!(invt[cx] == msg[4]));
+	cz = 0;
+	cy = 0;
+	do {
+		cy = cy + 1;
+		if (ord(s.sjer[cy]) != 0)  cz = cz + 1;
+	} while (!(cz == cx));
+	cz = ord(s.sjer[cy]);
+	s.sjer[cy] = chr(0);
+	modinv();
+	avpoing(cz);
+	crep = 998;
+	clsf2();
+}
+
+/* overlay */ void tsoulever()
+
+{
+	integer cx;
+
+	if (! syn)  ecr3("soulever");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(3);
+	if (num == 0) {
+		tcoord(8);
+		if (num != 0) {
+			if (ipers > 0)  s.conf = s.conf + 1;
+			crep = 997;
+			if ((s.mlieu == 2) && (s.iloic != 0))  treg(s.iloic);
+		}
+		return;
+	}
+	if (ipers > 0)  s.conf = s.conf + 1;
+	cx = s.mlieu;
+	if (s.mlieu == 16)  cx = 14;
+	if (s.mlieu == 19)  cx = 15;
+	crep = tabdon[asoul + (cx << 3) + pred(integer, num)];
+	if (crep == 255)  crep = 997;
+}
+
+/* overlay */ void tlire() {
+	integer iaff;
+
+	if (caff > 99)  st4(caff);
+	else {
+		if (! syn)  ecr3("lire");
+		tfleche();
+		if (!(anyone) && !(iesc)) {
+			tcoord(4);
+			if (num != 0)  crep = 107;
+		}
+	}
+}
+
+/* overlay */ void tslire() {
+	if (s.derobj == 0)  crep = 186;
+	else st4(s.derobj);
+}
+
+/* overlay */ void tregarder() {
+	integer cx;
+
+	if (caff > 99) {
+		crep = 103;
+		return;
+	}
+	if (! syn)  ecr3("regarder");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(5);
+	if (num == 0) {
+		tcoord(8);
+		crep = 131;
+		if (num != 0) {
+			if (s.mlieu == 13) {
+				if (num == 1) {
+					crep = 164;
+					if (s.ibag != 0)  treg(s.ibag);
+					else if (s.iboul != 0)  treg(s.iboul);
+				} else {
+					crep = 193;
+					if (s.ibag != 0)  treg(s.ibag);
+				}
+			}
+			if (s.mlieu == 14) {
+				crep = 164;
+				if (s.icave != 0)  treg(s.icave);
+			}
+			if (s.mlieu == 17) {
+				crep = 174;
+				if (s.ivier != 0)  treg(s.ivier);
+			}
+			if (s.mlieu == 24) {
+				crep = 131;
+				if (s.ipuit != 0)  treg(s.ipuit);
+			}
+		}
+		return;
+	}
+	cx = s.mlieu;
+	if (s.mlieu == 20)  cx = 17;
+	if ((s.mlieu > 21) && (s.mlieu < 25))  cx = cx - 4;
+	if (s.mlieu == 26)  cx = 21;
+	crep = tabdon[arega + (cx * 7) + pred(integer, num)];
+	if ((s.mlieu == 13) && (num == 8))  crep = 126;
+	if (s.mlieu == 19)  crep = 103;
+	if (crep == 255)  crep = 131;
+	if ((s.mlieu == 1) && (num == 1))  treg(144);
+	if ((s.mlieu == 5) && (num == 3))  treg(147);
+	if ((s.mlieu == 8) && (num == 3))  treg(149);
+	if ((s.mlieu == 9) && (num == 2))  treg(30);
+	if ((s.mlieu == 10) && (num == 3))  treg(31);
+}
+
+/* overlay */ void tsregarder() {
+	if (s.derobj != 0)  treg(s.derobj);
+	else crep = 186;
+}
+
+/* overlay */ void tfouiller() {
+	const array<0, 13, byte> r = {{123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107}};
+	integer cx;
+
+	if (caff > 99) {
+		st7(caff);
+		return;
+	}
+	if (! syn)  ecr3("fouiller");
+	tfleche();
+	if (anyone || iesc)  return;
+	if (s.mlieu == 23) {
+		crep = 1504;
+		tperd();
+		return;
+	}
+	tcoord(6);
+	if (num == 0) {
+		tcoord(7);
+		if (num != 0) {
+			cx = 0;
+			do {
+				cx = cx + 1;
+			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			if (num != ord(touv[cx]))  crep = 187;
+			else {
+				if (ipers > 0)  s.conf = s.conf + 3;
+				rechai(mchai);
+				if (mchai != 0) {
+					cs = 0;
+					is = 0;
+					fouil = true;
+					mfoudi();
+					tsuiv();
+				} else crep = 997;
+			}
+		} else {
+			tcoord(8);
+			crep = 997;
+			if (num != 0) {
+				if (ipers > 0)  s.conf = s.conf + 3;
+				if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) {
+					if (s.mlieu == 2) {
+						crep = 123;
+						if (s.iloic != 0)  treg(s.iloic);
+					}
+					if (s.mlieu == 16) {
+						crep = 123;
+						if (s.icryp != 0)  treg(s.icryp);
+					}
+				}
+			}
+		}
+	} else {
+		if (ipers > 0)  s.conf = s.conf + 3;
+		crep = 997;
+		if (s.mlieu < 14)  crep = r[s.mlieu];
+		if ((s.mlieu == 3) && (num == 2))  crep = 162;
+		if (s.mlieu == 12) {
+			if ((num == 3) || (num == 4))  crep = 162;
+			if (num == 5)  crep = 159;
+		}
+		if (s.mlieu == 19)  crep = 104;
+		if (s.mlieu == 16)  crep = 155;
+	}
+}
+
+/* overlay */ void tsfouiller() {
+	if (s.derobj != 0)  st7(s.derobj);
+	else crep = 186;
+}
+
+/* overlay */ void touvrir() {
+	integer cx, haz;
+
+	if (! syn)  ecr3("ouvrir");
+	if (caff == 26) {
+		if (ment != 0) {
+			msg[4] = entrer;
+			syn = true;
+		} else crep = 997;
+		return;
+	}
+	if (caff == 15) {
+		aldepl();
+		return;
+	}
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(7);
+	if (num != 0) {
+		if (ipers > 0)  s.conf = s.conf + 2;
+		iouv = iouv + 1;
+		cx = 0;
+		do {
+			cx = cx + 1;
+		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
+		if (ord(touv[cx]) != num) {
+			if (!
+			        (
+			            ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
+			            ||
+			            ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6))) ||
+			            ((s.mlieu == 4) && (num == 5)) ||
+			            ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) ||
+			                            (s.mlieu == 8) || (s.mlieu == 13))) ||
+			            ((s.mlieu == 8) && (num == 2)) ||
+			            ((s.mlieu == 12) && (num == 7)))) {
+				if (((s.mlieu > 10) && (s.mlieu < 14)) ||
+				        ((s.mlieu > 6) && (s.mlieu < 10)) ||
+				        (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
+					haz = hazard(1, 4);
+					if (haz == 3)  parole(7, 9, 1);
+				}
+				touv[cx] = chr(num);
+				aniof(1, num);
+			}
+			cx = s.mlieu;
+			if (s.mlieu == 16)  cx = 14;
+			crep = tabdon[aouvr + (cx * 7) + pred(integer, num)];
+			if (crep == 254)  crep = 999;
+		} else crep = 18;
+	}
+}
+
+/* overlay */ void tmettre() {
+	integer quel;
+	boolean entre;
+	phrase st;
+	str255 str_;
+	integer i, tay;
+
+	if (s.derobj == 0) {
+		crep = 186;
+		return;
+	}
+	if (! syn)  ecr3("mettre");
+	tfleche();
+	if (iesc)  crep = 998;
+	if ((anyone) || (iesc))  return;
+	tcoord(8);
+	if (num != 0) {
+		crep = 999;
+		if (caff == 13) {
+			if (num == 1) {
+				if (s.iboul != 0)  crep = 188;
+				else {
+					s.iboul = s.derobj;
+					if (s.derobj == 141)  aniof(1, 7);
+				}
+			} else if (s.ibag != 0)  crep = 188;
+			else {
+				s.ibag = s.derobj;
+				if (s.derobj == 159)  aniof(1, 6);
+			}
+		}
+		if (caff == 14)
+			if (s.icave != 0)  crep = 188;
+			else {
+				s.icave = s.derobj;
+				if (s.derobj == 151) {
+					aniof(1, 2);
+					aniof(1, 1);
+					repon(2, 165);
+					maivid();
+					parole(6, -9, 1);
+					quel = do_alert(stouinon, 1);
+					if (quel == 1)  {
+						deline(582, st, tay);
+						i = do_alert(delig, 1);
+						tesok = false;
+						entre = ques();
+						hide_mouse();
+						hirs();
+						dessine_rouleau();
+						clsf2();
+						clsf3();
+						show_mouse();
+						tinke();
+						pendule();
+						if (ipers != 0)  affper(ipers);
+						else person();
+						menu_aff();
+						if (entre) {
+							s.mlieu = 17;
+							tmlieu(17);
+						} else {
+							tmlieu(s.mlieu);
+							writepal(14);
+							dessin(0);
+							aniof(1, 2);
+							aniof(1, 1);
+							deline(577, st, tay);
+							i = do_alert(delig, 1);
+							aniof(2, 1);
+							crep = 166;
+						}
+						affrep();
+					} else {
+						aniof(2, 1);
+						crep = 166;
+						tesok = true;
+					}
+					return;
+				}
+			}
+		if (caff == 16)
+			if (s.icryp == 0)  s.icryp = s.derobj;
+			else crep = 188;
+		if (caff == 17)
+			if (s.ivier != 0)  crep = 188;
+			else if (s.derobj == 143) {
+				s.ivier = 143;
+				aniof(1, 1);
+			} else {
+				crep = 1512;
+				tperd();
+			}
+		if (caff == 24)
+			if (s.ipuit != 0)  crep = 188;
+			else if ((s.derobj == 140) || (s.derobj == 120)) {
+				s.ipuit = s.derobj;
+				aniof(1, 1);
+			} else crep = 185;
+		if (crep != 188)  maivid();
+	}
+}
+
+/* overlay */ void ttourner() {
+	integer quel;
+
+	if (caff > 99) {
+		crep = 149;
+		return;
+	}
+	if (! syn)  ecr3("tourner");
+	tfleche();
+	if ((anyone) || (iesc))  return;
+	tcoord(9);
+	if (num != 0) {
+		crep = 997;
+		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
+			repon(2, 167);
+			parole(7, 9, 1);
+			quel = do_alert(stouinon, 1);
+			if (quel == 1)  solu = true;
+			else crep = 168;
+		}
+		if ((s.mlieu == 17) && (s.ivier == 143)) {
+			repon(2, 175);
+			clsf3();
+			parole(6, -9, 1);
+			quel = do_alert(stouinon, 1);
+			if (quel == 1) {
+				s.mlieu = 16;
+				affrep();
+			} else crep = 176;
+		}
+	}
+}
+
+/* overlay */ void tcacher() {
+	if (! syn)  ecr3("se cacher");
+	tfleche();
+	if (!(anyone) && !(iesc)) {
+		tcoord(10);
+		if (num == 0)  cache = false;
+		else {
+			cache = true;
+			crep = 999;
+		}
+	}
+}
+
+/* overlay */ void tattacher() {
+	if (s.derobj == 0)  crep = 186;
+	else {
+		if (! syn)  ecr3("attacher");
+		tfleche();
+		if (!(anyone) && !(iesc)) {
+			tcoord(8);
+			crep = 997;
+			if ((num != 0) && (s.mlieu == 24)) {
+				crep = 999;
+				if ((s.derobj == 120) || (s.derobj == 140)) {
+					s.ipuit = s.derobj;
+					aniof(1, 1);
+				} else crep = 185;
+				maivid();
+			}
+		}
+	}
+}
+
+/* overlay */ void tfermer() {
+	integer cx, chai;
+
+	if (! syn)  ecr3("fermer");
+	if (caff < 26) {
+		tfleche();
+		if (iesc)  crep = 998;
+		if ((anyone) || (iesc))  return;
+		tcoord(7);
+		if (num != 0) {
+			cx = 0;
+			do {
+				cx = cx + 1;
+			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			if (num == ord(touv[cx])) {
+				aniof(2, num);
+				crep = 998;
+				touv[cx] = chr(0);
+				iouv = iouv - 1;
+				if (iouv < 0)  iouv = 0;
+				chai = 9999;
+				rechai(chai);
+				if (mchai == chai)  mchai = 0;
+			} else crep = 187;
+		}
+	}
+	if (caff == 26)  crep = 999;
+}
+
+/* overlay */ void tfrapper() {
+	integer l, p, haz;
+
+	if (! syn)  ecr3("frapper");
+	if (s.mlieu == 15) {
+		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);
+		return;
+	}
+	if (s.mlieu < 25) {
+		tfleche();
+		if (!(anyone) && !(iesc))
+			if ((s.mlieu < 19) && (s.mlieu != 15))  crep = 133;
+			else crep = 997;
+		return;
+	}
+	if (s.mlieu == 26) {
+		haz = (hazard(0, 8)) - 4;
+		parole(11, haz, 1);
+		ecfren(p, haz, s.conf, ment);
+		l = ment;
+		if (l != 0)
+			if (p != -500) {
+				if (haz > p)  crep = 190;
+				else {
+					becfren(l);
+					frap();
+				}
+			} else frap();
+		if (ment == 8)  crep = 190;
+	}
+}
+
+/* overlay */ void tposer() {
+	integer cx, chai;
+
+	if (! syn)  ecr3("poser");
+	if (s.derobj == 0)  crep = 186;
+	else {
+		if (caff > 99) {
+			crep = 999;
+			ajchai();
+			if (crep != 192)  maivid();
+			return;
+		}
+		tfleche();
+		if ((anyone) || (iesc))  return;
+		tcoord(7);
+		crep = 124;
+		if (num != 0) {
+			rechai(chai);
+			if (chai == 0)  crep = 997;
+			else {
+				cx = 0;
+				do {
+					cx = cx + 1;
+				} while (!((cx > 6) || (num == ord(touv[cx]))));
+				if (num != ord(touv[cx]))  crep = 187;
+				else {
+					mchai = chai;
+					crep = 999;
+				}
+			}
+		} else {
+			tcoord(8);
+			if (num != 0) {
+				crep = 998;
+				if (caff == 2)
+					if (s.iloic != 0)  crep = 188;
+					else s.iloic = s.derobj;
+				if (caff == 13) {
+					if (num == 1) {
+						if (s.iboul != 0)  crep = 188;
+						else s.iboul = s.derobj;
+					} else if (s.ibag != 0)  crep = 188;
+					else s.ibag = s.derobj;
+				}
+				if (caff == 16)
+					if (s.icryp != 0)  crep = 188;
+					else s.icryp = s.derobj;
+				if (caff == 24)  crep = 185;
+				if ((caff == 14) || (caff == 17))  crep = 124;
+			} else {
+				crep = 124;
+				if (caff == 24) {
+					tcoord(5);
+					if (num != 0)  crep = 185;
+				}
+			}
+		}
+		if (caff == 23)  crep = 185;
+		if ((crep == 999) || (crep == 185) || (crep == 998)) {
+			if (crep == 999)  ajchai();
+			if (crep != 192)  maivid();
+		}
+	}
+}
+
+/* overlay */ void tecouter() {
+	integer l, p, haz, j, h, m;
+
+	if (s.mlieu != 26)  crep = 101;
+	else {
+		if (ipers != 0)  s.conf = s.conf + 1;
+		ecfren(p, haz, s.conf, ment);
+		l = ment;
+		if (l != 0)
+			if (p != -500) {
+				if (haz > p)  crep = 101;
+				else {
+					becfren(l);
+					calch(j, h, m);
+					haz = hazard(1, 100);
+					if ((h >= 0) && (h < 8)) {
+						if (haz > 30)  crep = 101;
+						else crep = 178;
+					} else if (haz > 70)  crep = 101;
+					else crep = 178;
+				}
+			} else crep = 178;
+	}
+}
+
+/* overlay */ void tmanger() {
+	integer j, h, m;
+
+	if ((s.mlieu > 15) && (s.mlieu < 26))
+		crep = 148;
+	else {
+		tsort();
+		s.mlieu = 10;
+		caff = 10;
+		debloc(s.mlieu);
+		tmlieu(s.mlieu);
+		calch(j, h, m);
+		if ((h == 12) || (h == 13) || (h == 19)) {
+			s.conf = s.conf - (s.conf / 7);
+			if (h == 12)
+				if (m == 0)  h = 4;
+				else h = 3;
+			if ((h == 13) || (h == 19))
+				if (m == 0)  h = 2;
+				else h = 1;
+			jh = jh + h;
+			crep = 135;
+			tinke();
+		} else crep = 134;
+	}
+}
+
+/* overlay */ void tentrer() {
+	integer x, z;
+
+	if ((s.mlieu == 21) || (s.mlieu == 22)) {
+		t1sama();
+		tmlieu(s.mlieu);
+	} else if (s.mlieu == 15)  aldepl();
+	else if (ment == 0)  crep = 997;
+	else {
+		if ((ment == 9) && (s.derobj != 136)) {
+			crep = 189;
+			s.teauto[8] = '*';
+		} else {
+			if (! blo)  t11(ment, z);
+			if (z != 0) {
+				if ((ment == 3) || (ment == 7))  crep = 179;
+				else {
+					x = (hazard(0, 10)) - 5;
+					parole(7, x, 1);
+					aniof(1, 1);
+					/*       tkey(5,32000);*/
+					tip(z, x);
+					s.conf = s.conf + 1;
+					s.mlieu = 15;
+					msg[3] = discut;
+					msg[4] = disc[x];
+					syn = true;
+					if (ment == 9) {
+						col = true;
+						caff = 70;
+						afdes(0);
+						repon(2, caff);
+					} else col = false;
+					debloc(ment);
+					ment = 0;
+				}
+			} else {
+				x = (hazard(0, 10)) - 5;
+				parole(7, x, 1);
+				aniof(1, 1);
+				/*      tkey(1,32000);*/
+				s.mlieu = ment;
+				affrep();
+				debloc(s.mlieu);
+				tmlieu(s.mlieu);
+				ment = 0;
+				mpers = 0;
+				ipers = 0;
+			}
+		}
+	}
+}
+
+/* overlay */ void tdormir() {
+	const char m1[] = "D‚sirez-vous vous r‚veiller?";
+	integer z, j, h, m, quel;
+
+	if ((s.mlieu > 15) && (s.mlieu < 26)) {
+		crep = 148;
+		return;
+	}
+	if (s.mlieu != 0) {
+		tsort();
+		s.mlieu = 0;
+		affrep();
+		afdes(0);
+		debloc(s.mlieu);
+		tmlieu(s.mlieu);
+	}
+	clsf3();
+	clsf2();
+	ecrf2();
+	ecr2(m1);
+	calch(j, h, m);
+	do {
+		if (h < 8) {
+			s.conf = s.conf - (s.conf / 20);
+			z = (7 - h) * 2;
+			if (m == 30)  z = z - 1;
+			jh = jh + z;
+			h = 7;
+		}
+		jh = jh + 2;
+		h = h + 1;
+		if (h > 23)  h = 0;
+		tinke();
+		quel = do_alert(stouinon, 1);
+		anyone = false;
+	} while (!(quel == 1));
+	crep = 998;
+	num = 0;
+}
+
+/* overlay */ void tdefoncer() {
+	if (! syn)  ecr3("d‚foncer");
+	if (caff < 25)  tfleche();
+	if ((! anyone) && (! iesc))
+		if (s.mlieu != 26)  crep = 997;
+		else {
+			crep = 143;
+			s.conf = s.conf + 2;
+		}
+}
+
+/* overlay */ void tsortir() {
+	integer lx;
+
+	tsort();
+	crep = 0;
+	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)
+	        || (s.mlieu == 24))  crep = 997;
+	else {
+		if ((s.mlieu < 16) || (s.mlieu == 26))  lx = 10;
+		if ((s.mlieu == 10) || (s.mlieu == 20))  lx = 21;
+		if ((s.mlieu < 10) || (s.mlieu == 13))  lx = 15;
+		if (s.mlieu == 16) {
+			lx = 17;
+			crep = 176;
+		}
+		if (s.mlieu == 17)  t23coul(lx);
+		if (s.mlieu == 23)  lx = 24;
+		if (crep != 997)  s.mlieu = lx;
+		caff = lx;
+		if (crep == 0)  crep = lx;
+		debloc(lx);
+		tmlieu(lx);
+	}
+}
+
+/* overlay */ void tattendre() {
+	integer quel;
+
+	mpers = 0;
+	clsf3();
+	do {
+		jh = jh + 1;
+		tinke();
+		if (! blo)  t11(s.mlieu, quel);
+		if ((ipers != 0) && (mpers == 0)) {
+			crep = 998;
+			if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
+			if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+			mpers = ipers;
+			if (! anyone)  tinke();
+			return;
+		}
+		repon(2, 102);
+		quel = do_alert(stouinon, 1);
+	} while (!(quel == 2));
+	crep = 998;
+	if (! anyone)  tinke();
+}
+
+/* overlay */ void tsonder() {
+	if (! syn)  ecr3("sonder");
+	if (caff < 27) {
+		tfleche();
+		if (!(anyone) && (! iesc))  crep = 145;
+		num = 0;
+	}
+}
+
+/* overlay */ void tparler()
+
+{
+	array<1, 46, boolean> te;
+	integer ix, cy, cx, max, haz, suj, co, lig, icm,
+	        i, tay, choi, x, y, c;
+	char tou;
+	array<1, 46, varying_string<40> > lib;
+	phrase st;
+	boolean f;
+
+
+
+	finfouil();
+	if (col)  suj = 128;
+	else {
+		cx = 0;
+		do {
+			cx = cx + 1;
+		} while (!(disc[cx] == msg[4]));
+		caff = 69 + cx;
+		afdes(0);
+		repon(2, caff);
+		suj = caff + 60;
+	}
+	tkey1(false);
+	mennor();
+	hide_mouse();
+	hirs();
+	premtet();
+	sparl(0, suj);
+	hirs();
+	for (ix = 1; ix <= 46; ix ++) te[ix] = false;
+	for (ix = 1; ix <= 45; ix ++) {
+		deline(ix + c_tparler, st, tay);
+		lib[ix] = delig;
+		for (i = tay; i <= 40; i ++) lib[ix] = lib[ix] + ' ';
+	}
+	lib[46] = lib[45];
+	lib[45] = ' ';
+	show_mouse();
+	do {
+		choi = 0;
+		icm = 0;
+		co = 0;
+		lig = 0;
+		do {
+			icm = succ(integer, icm);
+			putxy(co, lig);
+			if (s.teauto[icm] == '*')
+				if (te[icm])  writetp(lib[icm], 1);
+				else writetp(lib[icm], 0);
+			if (icm == 23)  {
+				lig = 0;
+				co = 320;
+			} else lig = lig + 8;
+		} while (!(icm == 42));
+		putxy(320, 176);
+		writetp(lib[46], 0);
+		tou = '\0';
+		do {
+			mov_mouse(f, tou);
+			/*     if keypressed then read(kbd,tou);*/
+			read_pos_mouse(x, y, c);
+			x = x * (3 - res);
+			if (x > 319)  cx = 41;
+			else cx = 1;
+			cy = succ(integer, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
+			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
+				if (choi != 0) {
+					lig = ((choi - 1) % 23) << 3;
+					if (choi > 23)  co = 320;
+					else co = 0;
+					putxy(co, lig);
+					if (te[choi])  writetp(lib[choi], 0);
+					else writetp(lib[choi], 1);
+					te[choi] = ! te[choi];
+					choi = 0;
+				}
+			} else {
+				ix = cy;
+				if (cx == 41)  ix = ix + 23;
+				if (ix != choi) {
+					if (choi != 0) {
+						lig = ((choi - 1) % 23) << 3;
+						if (choi > 23)  co = 320;
+						else co = 0;
+						putxy(co, lig);
+						if (te[choi])  writetp(lib[choi], 0);
+						else writetp(lib[choi], 1);
+						te[choi] = ! te[choi];
+					}
+					if ((s.teauto[ix] == '*') || (ix == 46)) {
+						lig = ((ix - 1) % 23) << 3;
+						if (ix > 23)  co = 320;
+						else co = 0;
+						putxy(co, lig);
+						if (te[ix])  writetp(lib[ix], 0);
+						else writetp(lib[ix], 1);
+						te[ix] = ! te[ix];
+						choi = ix;
+					} else choi = 0;
+				}
+			}
+		} while (!((tou == '\15') || (((c != 0) || clic) && (choi != 0))));
+		clic = false;
+		if (choi != 46) {
+			ix = choi - 1;
+			if (col) {
+				col = false;
+				s.mlieu = 15;
+				if (iouv > 0)  max = 8;
+				else max = 4;
+				haz = hazard(1, max);
+				if (haz == 2)  suj = 129;
+				else {
+					suj = 138;
+					s.conf = s.conf + (3 * (s.conf / 10));
+				}
+			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
+				suj = tabdon[arep + (ix << 3) + (caff - 70)];
+				s.conf = s.conf + tabdon[arcf + ix];
+				nbrep[caff - 69] = nbrep[caff - 69] + 1;
+			} else {
+				s.conf = s.conf + 3;
+				suj = 139;
+			}
+			hide_mouse();
+			hirs();
+			premtet();
+			sparl(0, suj);
+			show_mouse();
+			if ((suj == 84) || (suj == 86)) {
+				s.pourc[5] = '*';
+				s.teauto[7] = '*';
+			}
+			if ((suj == 106) || (suj == 108) || (suj == 94)) {
+				for (ix = 29; ix <= 31; ix ++) s.teauto[ix] = '*';
+				s.pourc[7] = '*';
+			}
+			if (suj == 70) {
+				s.pourc[8] = '*';
+				s.teauto[32] = '*';
+			}
+			hide_mouse();
+			hirs();
+			show_mouse();
+		}
+	} while (!((choi == 46) || (suj == 138)));
+	if (col) {
+		s.conf = s.conf + (3 * (s.conf / 10));
+		hide_mouse();
+		hirs();
+		premtet();
+		sparl(0, 138);
+		show_mouse();
+		col = false;
+		s.mlieu = 15;
+	}
+	ctrm = 0;
+	hide_mouse();
+	hirs();
+	dessine_rouleau();
+	show_mouse();
+	affper(ipers);
+	tinke();
+	pendule();
+	affrep();
+	/* chech;*/
+	tmlieu(s.mlieu);
+	clsf3();
+}
+
+/* overlay */ void tsentir() {
+	crep = 119;
+	if (caff < 26) {
+		if (! syn)  ecr3("sentir");
+		tfleche();
+		if (!(anyone) && !(iesc))
+			if (caff == 16)  crep = 153;
+	} else if (caff == 123)  crep = 110;
+	num = 0;
+}
+
+/* overlay */ void tgratter() {
+	crep = 155;
+	if (caff < 27) {
+		if (! syn)  ecr3("gratter");
+		tfleche();
+	}
+	num = 0;
+}
+
+/* NIVEAU 2 */
+/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */
+	arret = true;
+	tlu(13, 152);
+	maivid();
+	clsf1();
+	clsf2();
+	clsf3();
+	repon(9, 1509);
+	tkey1(false);
+	hide_mouse();
+	caff = 70;
+	taffich();
+	hirs();
+	premtet();
+	sparl(0, 141);
+	show_mouse();
+	clsf1();
+	repon(9, 1509);
+	repon(2, 142);
+	tkey1(false);
+	caff = 32;
+	afdes(0);
+	repon(6, 34);
+	repon(2, 35);
+	musique(0);
+	tkey1(false);
+	messint(2036);
+	tkey1(false);
+	inzon();
+}
+
+/* overlay */ void tencore() {         /* Perdu !!! */
+	integer quel;
+
+	clsf2();
+	musique(0);
+	tkey1(false);
+	maivid();
+	inzon();
+	dprog();
+	vh = 10;
+	vm = 0;
+	vj = 0;
+	min = 0;
+	heu = 10;
+	jou = 0;
+	repon(2, 180);
+	quel = do_alert(stouinon, 1);
+	arret = (quel != 1);
+}
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
deleted file mode 100644
index 1dd3abe..0000000
--- a/engines/mortevielle/actions.h
+++ /dev/null
@@ -1,1193 +0,0 @@
-/* NIVEAU 4 */
-const char stouinon[] = "[2][ ][OUI][NON]";
-
-/* overlay */
-void taller()
-
-{
-	integer mx, cx, cy;
-
-	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
-		s.mlieu = 15;
-		caff = s.mlieu;
-		afdes(0);
-		repon(2, s.mlieu);
-	}
-	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
-		if (! syn)  ecr3("aller");
-		tfleche();
-		if (iesc)  okdes = false;
-		if ((anyone) || (iesc))  return;
-		tcoord(1);
-		if (num == 0)  return;
-		if (num == 1) {
-			s.mlieu = 0;
-			tmlieu(0);
-		} else if (num == 7) {
-			s.mlieu = 13;
-			tmlieu(13);
-		} else if (num != 6)  s.mlieu = 26;
-		if ((num > 1) && (num < 6))  ment = num - 1;
-		if (num > 7)  ment = num - 3;
-		if (num != 6)  affrep();
-		else aldepl();
-		return;
-	}
-	tsort();
-	cx = 0;
-	do {
-		cx = cx + 1;
-	} while (!(depl[cx] == msg[4]));
-	if (s.mlieu == 19) {
-		if (cx == 1)  t1deva();
-		if (cx == 2)  t1neig();
-		goto L2;
-	}
-	if (s.mlieu == 23) {
-		if (cx == 1)  t1deau();
-		if (cx == 2)  t1derr();
-		goto L2;
-	}
-	if ((s.mlieu == 11) && (cx == 1))  cx = 6;
-	if (s.mlieu == 12) {
-		if (cx == 2)  cx = 6;
-		if (cx == 5)  cx = 16;
-	}
-	if ((s.mlieu == 14) && (cx == 3))  cx = 6;
-	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))  cx = 6;
-	if ((s.mlieu > 19) && (s.mlieu != 26))  cx = cx + 10;
-	if ((s.mlieu == 20) && (cx == 13))  cx = 16;
-	if (s.mlieu == 21) {
-		if (cx == 12)  cx = 16;
-		else if (cx > 13)  cx = 15;
-	}
-	if ((s.mlieu == 22) && (cx > 14))  cx = 15;
-	if ((s.mlieu == 24) && (cx != 17))
-		if (cx > 13)  cx = 15;
-	if (cx == 1)  s.mlieu = 11;
-	else if (cx == 2)  s.mlieu = 12;
-	else if (cx == 3)  s.mlieu = 14;
-	else if (cx == 4)  s.mlieu = 15;
-	else if (cx == 5)  cx = 12;
-	if (cx == 6)  cx = 11;
-	if (cx == 11)  t1sama();
-	else if (cx == 12)  t1deva();
-	else if (cx == 13)  s.mlieu = 20;
-	else if (cx == 14)  s.mlieu = 24;
-	else if (cx == 15)  t1neig();
-	else if (cx == 16)  t1derr();
-	else if (cx == 17) {
-		if ((s.ipuit != 120) && (s.ipuit != 140))  crep = 997;
-		else if (s.ipuit == 120)  crep = 181;
-		else if (s.conf > 80) {
-			crep = 1505;
-			tperd();
-		} else {
-			s.mlieu = 23;
-			affrep();
-		}
-	}
-	if ((cx < 5) || (cx == 13) || (cx == 14))  affrep();
-	debloc(s.mlieu);
-L2:
-	tmlieu(s.mlieu);
-}
-
-/* overlay */ void tprendre() {
-	integer cx, cy, cz;
-
-	if (caff > 99) {
-		cx = caff;
-		avpoing(cx);
-		if (crep != 139) {
-			if (ipers > 0)  s.conf = s.conf + 3;
-			if (obpart) {
-				if (s.mlieu == 2)  s.iloic = 0;
-				if (s.mlieu == 13) {
-					if (s.iboul == caff)  s.iboul = 0;
-					if (s.ibag == caff)  s.ibag = 0;
-				}
-				if (s.mlieu == 14)  s.icave = 0;
-				if (s.mlieu == 16)  s.icryp = 0;
-				if (s.mlieu == 17)  s.ivier = 0;
-				if (s.mlieu == 24)  s.ipuit = 0;
-				mfouen();
-				obpart = false;
-				affrep();
-			} else {
-				tabdon[acha + (pred(integer, mchai) * 10) + pred(integer, cs)] = 0;
-				tsuiv();
-				dobj = dobj + 1;
-				if (dobj > 6) {
-					s.conf = s.conf + 2;
-					dobj = 0;
-				}
-			}
-		}
-		return;
-	}
-	if (! syn)  ecr3("prendre");
-	tfleche();
-	if ((anyone) || (iesc))  return;
-	if (caff == 3) {
-		tcoord(2);
-		if (num == 1) {
-			crep = 152;
-			return;
-		}
-	}
-	tcoord(5);
-	if ((num == 0) || ((num == 1) && (s.mlieu == 16))) {
-		tcoord(8);
-		if (num != 0) {
-			if (ipers > 0)  s.conf = s.conf + 3;
-			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))  avpoing(s.iloic);
-			if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) {
-				avpoing(s.iboul);
-				if ((crep != 997) && (crep != 139))  aniof(2, 7);
-			}
-			if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) {
-				avpoing(s.ibag);
-				if ((crep != 997) && (crep != 139))  aniof(2, 6);
-			}
-			if ((s.mlieu == 14) && (s.icave != 0)) {
-				avpoing(s.icave);
-				if ((crep != 997) && (crep != 139))  aniof(2, 2);
-			}
-			if ((s.mlieu == 16) && (s.icryp != 0))  avpoing(s.icryp);
-			if ((s.mlieu == 17) && (s.ivier != 0)) {
-				avpoing(s.ivier);
-				if ((crep != 997) && (crep != 139)) {
-					crep = 182;
-					aniof(2, 1);
-				}
-			}
-			if ((s.mlieu == 24) && (s.ipuit != 0)) {
-				avpoing(s.ipuit);
-				if ((crep != 997) && (crep != 139))  aniof(2, 1);
-			}
-			if ((crep != 997) && (crep != 182) && (crep != 139))  crep = 999;
-		}
-	} else {
-		if (((s.mlieu == 0) && (num == 3)) || ((s.mlieu == 1) && (num == 4))
-		        || ((s.mlieu == 2) && (num == 1)) || ((s.mlieu == 4) && (num == 3))
-		        || ((s.mlieu == 5) && (num == 6)) || ((s.mlieu == 6) && (num == 2))
-		        || ((s.mlieu == 7) && (num == 6)) || ((s.mlieu == 8) && (num == 4))
-		        || ((s.mlieu == 9) && (num == 4)) || ((s.mlieu == 10) && (num > 2))
-		        || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
-		        || ((s.mlieu == 13) && (num > 4)) || ((s.mlieu > 13)
-		                && (s.mlieu != 23)))  crep = 997;
-		else {
-			if (s.mlieu == 23) {
-				crep = 1504;
-				tperd();
-			} else crep = 120;
-		}
-	}
-}
-
-/* overlay */ void tsprendre() {
-	integer cx, cy, cz;
-
-	cx = 0;
-	do {
-		cx = cx + 1;
-	} while (!(invt[cx] == msg[4]));
-	cz = 0;
-	cy = 0;
-	do {
-		cy = cy + 1;
-		if (ord(s.sjer[cy]) != 0)  cz = cz + 1;
-	} while (!(cz == cx));
-	cz = ord(s.sjer[cy]);
-	s.sjer[cy] = chr(0);
-	modinv();
-	avpoing(cz);
-	crep = 998;
-	clsf2();
-}
-
-/* overlay */ void tsoulever()
-
-{
-	integer cx;
-
-	if (! syn)  ecr3("soulever");
-	tfleche();
-	if ((anyone) || (iesc))  return;
-	tcoord(3);
-	if (num == 0) {
-		tcoord(8);
-		if (num != 0) {
-			if (ipers > 0)  s.conf = s.conf + 1;
-			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))  treg(s.iloic);
-		}
-		return;
-	}
-	if (ipers > 0)  s.conf = s.conf + 1;
-	cx = s.mlieu;
-	if (s.mlieu == 16)  cx = 14;
-	if (s.mlieu == 19)  cx = 15;
-	crep = tabdon[asoul + (cx << 3) + pred(integer, num)];
-	if (crep == 255)  crep = 997;
-}
-
-/* overlay */ void tlire() {
-	integer iaff;
-
-	if (caff > 99)  st4(caff);
-	else {
-		if (! syn)  ecr3("lire");
-		tfleche();
-		if (!(anyone) && !(iesc)) {
-			tcoord(4);
-			if (num != 0)  crep = 107;
-		}
-	}
-}
-
-/* overlay */ void tslire() {
-	if (s.derobj == 0)  crep = 186;
-	else st4(s.derobj);
-}
-
-/* overlay */ void tregarder() {
-	integer cx;
-
-	if (caff > 99) {
-		crep = 103;
-		return;
-	}
-	if (! syn)  ecr3("regarder");
-	tfleche();
-	if ((anyone) || (iesc))  return;
-	tcoord(5);
-	if (num == 0) {
-		tcoord(8);
-		crep = 131;
-		if (num != 0) {
-			if (s.mlieu == 13) {
-				if (num == 1) {
-					crep = 164;
-					if (s.ibag != 0)  treg(s.ibag);
-					else if (s.iboul != 0)  treg(s.iboul);
-				} else {
-					crep = 193;
-					if (s.ibag != 0)  treg(s.ibag);
-				}
-			}
-			if (s.mlieu == 14) {
-				crep = 164;
-				if (s.icave != 0)  treg(s.icave);
-			}
-			if (s.mlieu == 17) {
-				crep = 174;
-				if (s.ivier != 0)  treg(s.ivier);
-			}
-			if (s.mlieu == 24) {
-				crep = 131;
-				if (s.ipuit != 0)  treg(s.ipuit);
-			}
-		}
-		return;
-	}
-	cx = s.mlieu;
-	if (s.mlieu == 20)  cx = 17;
-	if ((s.mlieu > 21) && (s.mlieu < 25))  cx = cx - 4;
-	if (s.mlieu == 26)  cx = 21;
-	crep = tabdon[arega + (cx * 7) + pred(integer, num)];
-	if ((s.mlieu == 13) && (num == 8))  crep = 126;
-	if (s.mlieu == 19)  crep = 103;
-	if (crep == 255)  crep = 131;
-	if ((s.mlieu == 1) && (num == 1))  treg(144);
-	if ((s.mlieu == 5) && (num == 3))  treg(147);
-	if ((s.mlieu == 8) && (num == 3))  treg(149);
-	if ((s.mlieu == 9) && (num == 2))  treg(30);
-	if ((s.mlieu == 10) && (num == 3))  treg(31);
-}
-
-/* overlay */ void tsregarder() {
-	if (s.derobj != 0)  treg(s.derobj);
-	else crep = 186;
-}
-
-/* overlay */ void tfouiller() {
-	const array<0, 13, byte> r = {{123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107}};
-	integer cx;
-
-	if (caff > 99) {
-		st7(caff);
-		return;
-	}
-	if (! syn)  ecr3("fouiller");
-	tfleche();
-	if (anyone || iesc)  return;
-	if (s.mlieu == 23) {
-		crep = 1504;
-		tperd();
-		return;
-	}
-	tcoord(6);
-	if (num == 0) {
-		tcoord(7);
-		if (num != 0) {
-			cx = 0;
-			do {
-				cx = cx + 1;
-			} while (!((cx > 6) || (num == ord(touv[cx]))));
-			if (num != ord(touv[cx]))  crep = 187;
-			else {
-				if (ipers > 0)  s.conf = s.conf + 3;
-				rechai(mchai);
-				if (mchai != 0) {
-					cs = 0;
-					is = 0;
-					fouil = true;
-					mfoudi();
-					tsuiv();
-				} else crep = 997;
-			}
-		} else {
-			tcoord(8);
-			crep = 997;
-			if (num != 0) {
-				if (ipers > 0)  s.conf = s.conf + 3;
-				if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) {
-					if (s.mlieu == 2) {
-						crep = 123;
-						if (s.iloic != 0)  treg(s.iloic);
-					}
-					if (s.mlieu == 16) {
-						crep = 123;
-						if (s.icryp != 0)  treg(s.icryp);
-					}
-				}
-			}
-		}
-	} else {
-		if (ipers > 0)  s.conf = s.conf + 3;
-		crep = 997;
-		if (s.mlieu < 14)  crep = r[s.mlieu];
-		if ((s.mlieu == 3) && (num == 2))  crep = 162;
-		if (s.mlieu == 12) {
-			if ((num == 3) || (num == 4))  crep = 162;
-			if (num == 5)  crep = 159;
-		}
-		if (s.mlieu == 19)  crep = 104;
-		if (s.mlieu == 16)  crep = 155;
-	}
-}
-
-/* overlay */ void tsfouiller() {
-	if (s.derobj != 0)  st7(s.derobj);
-	else crep = 186;
-}
-
-/* overlay */ void touvrir() {
-	integer cx, haz;
-
-	if (! syn)  ecr3("ouvrir");
-	if (caff == 26) {
-		if (ment != 0) {
-			msg[4] = entrer;
-			syn = true;
-		} else crep = 997;
-		return;
-	}
-	if (caff == 15) {
-		aldepl();
-		return;
-	}
-	tfleche();
-	if ((anyone) || (iesc))  return;
-	tcoord(7);
-	if (num != 0) {
-		if (ipers > 0)  s.conf = s.conf + 2;
-		iouv = iouv + 1;
-		cx = 0;
-		do {
-			cx = cx + 1;
-		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
-		if (ord(touv[cx]) != num) {
-			if (!
-			        (
-			            ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
-			            ||
-			            ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6))) ||
-			            ((s.mlieu == 4) && (num == 5)) ||
-			            ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) ||
-			                            (s.mlieu == 8) || (s.mlieu == 13))) ||
-			            ((s.mlieu == 8) && (num == 2)) ||
-			            ((s.mlieu == 12) && (num == 7)))) {
-				if (((s.mlieu > 10) && (s.mlieu < 14)) ||
-				        ((s.mlieu > 6) && (s.mlieu < 10)) ||
-				        (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
-					haz = hazard(1, 4);
-					if (haz == 3)  parole(7, 9, 1);
-				}
-				touv[cx] = chr(num);
-				aniof(1, num);
-			}
-			cx = s.mlieu;
-			if (s.mlieu == 16)  cx = 14;
-			crep = tabdon[aouvr + (cx * 7) + pred(integer, num)];
-			if (crep == 254)  crep = 999;
-		} else crep = 18;
-	}
-}
-
-/* overlay */ void tmettre() {
-	integer quel;
-	boolean entre;
-	phrase st;
-	str255 str_;
-	integer i, tay;
-
-	if (s.derobj == 0) {
-		crep = 186;
-		return;
-	}
-	if (! syn)  ecr3("mettre");
-	tfleche();
-	if (iesc)  crep = 998;
-	if ((anyone) || (iesc))  return;
-	tcoord(8);
-	if (num != 0) {
-		crep = 999;
-		if (caff == 13) {
-			if (num == 1) {
-				if (s.iboul != 0)  crep = 188;
-				else {
-					s.iboul = s.derobj;
-					if (s.derobj == 141)  aniof(1, 7);
-				}
-			} else if (s.ibag != 0)  crep = 188;
-			else {
-				s.ibag = s.derobj;
-				if (s.derobj == 159)  aniof(1, 6);
-			}
-		}
-		if (caff == 14)
-			if (s.icave != 0)  crep = 188;
-			else {
-				s.icave = s.derobj;
-				if (s.derobj == 151) {
-					aniof(1, 2);
-					aniof(1, 1);
-					repon(2, 165);
-					maivid();
-					parole(6, -9, 1);
-					quel = do_alert(stouinon, 1);
-					if (quel == 1)  {
-						deline(582, st, tay);
-						i = do_alert(delig, 1);
-						tesok = false;
-						entre = ques();
-						hide_mouse();
-						hirs();
-						dessine_rouleau();
-						clsf2();
-						clsf3();
-						show_mouse();
-						tinke();
-						pendule();
-						if (ipers != 0)  affper(ipers);
-						else person();
-						menu_aff();
-						if (entre) {
-							s.mlieu = 17;
-							tmlieu(17);
-						} else {
-							tmlieu(s.mlieu);
-							writepal(14);
-							dessin(0);
-							aniof(1, 2);
-							aniof(1, 1);
-							deline(577, st, tay);
-							i = do_alert(delig, 1);
-							aniof(2, 1);
-							crep = 166;
-						}
-						affrep();
-					} else {
-						aniof(2, 1);
-						crep = 166;
-						tesok = true;
-					}
-					return;
-				}
-			}
-		if (caff == 16)
-			if (s.icryp == 0)  s.icryp = s.derobj;
-			else crep = 188;
-		if (caff == 17)
-			if (s.ivier != 0)  crep = 188;
-			else if (s.derobj == 143) {
-				s.ivier = 143;
-				aniof(1, 1);
-			} else {
-				crep = 1512;
-				tperd();
-			}
-		if (caff == 24)
-			if (s.ipuit != 0)  crep = 188;
-			else if ((s.derobj == 140) || (s.derobj == 120)) {
-				s.ipuit = s.derobj;
-				aniof(1, 1);
-			} else crep = 185;
-		if (crep != 188)  maivid();
-	}
-}
-
-/* overlay */ void ttourner() {
-	integer quel;
-
-	if (caff > 99) {
-		crep = 149;
-		return;
-	}
-	if (! syn)  ecr3("tourner");
-	tfleche();
-	if ((anyone) || (iesc))  return;
-	tcoord(9);
-	if (num != 0) {
-		crep = 997;
-		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
-			repon(2, 167);
-			parole(7, 9, 1);
-			quel = do_alert(stouinon, 1);
-			if (quel == 1)  solu = true;
-			else crep = 168;
-		}
-		if ((s.mlieu == 17) && (s.ivier == 143)) {
-			repon(2, 175);
-			clsf3();
-			parole(6, -9, 1);
-			quel = do_alert(stouinon, 1);
-			if (quel == 1) {
-				s.mlieu = 16;
-				affrep();
-			} else crep = 176;
-		}
-	}
-}
-
-/* overlay */ void tcacher() {
-	if (! syn)  ecr3("se cacher");
-	tfleche();
-	if (!(anyone) && !(iesc)) {
-		tcoord(10);
-		if (num == 0)  cache = false;
-		else {
-			cache = true;
-			crep = 999;
-		}
-	}
-}
-
-/* overlay */ void tattacher() {
-	if (s.derobj == 0)  crep = 186;
-	else {
-		if (! syn)  ecr3("attacher");
-		tfleche();
-		if (!(anyone) && !(iesc)) {
-			tcoord(8);
-			crep = 997;
-			if ((num != 0) && (s.mlieu == 24)) {
-				crep = 999;
-				if ((s.derobj == 120) || (s.derobj == 140)) {
-					s.ipuit = s.derobj;
-					aniof(1, 1);
-				} else crep = 185;
-				maivid();
-			}
-		}
-	}
-}
-
-/* overlay */ void tfermer() {
-	integer cx, chai;
-
-	if (! syn)  ecr3("fermer");
-	if (caff < 26) {
-		tfleche();
-		if (iesc)  crep = 998;
-		if ((anyone) || (iesc))  return;
-		tcoord(7);
-		if (num != 0) {
-			cx = 0;
-			do {
-				cx = cx + 1;
-			} while (!((cx > 6) || (num == ord(touv[cx]))));
-			if (num == ord(touv[cx])) {
-				aniof(2, num);
-				crep = 998;
-				touv[cx] = chr(0);
-				iouv = iouv - 1;
-				if (iouv < 0)  iouv = 0;
-				chai = 9999;
-				rechai(chai);
-				if (mchai == chai)  mchai = 0;
-			} else crep = 187;
-		}
-	}
-	if (caff == 26)  crep = 999;
-}
-
-/* overlay */ void tfrapper() {
-	integer l, p, haz;
-
-	if (! syn)  ecr3("frapper");
-	if (s.mlieu == 15) {
-		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);
-		return;
-	}
-	if (s.mlieu < 25) {
-		tfleche();
-		if (!(anyone) && !(iesc))
-			if ((s.mlieu < 19) && (s.mlieu != 15))  crep = 133;
-			else crep = 997;
-		return;
-	}
-	if (s.mlieu == 26) {
-		haz = (hazard(0, 8)) - 4;
-		parole(11, haz, 1);
-		ecfren(p, haz, s.conf, ment);
-		l = ment;
-		if (l != 0)
-			if (p != -500) {
-				if (haz > p)  crep = 190;
-				else {
-					becfren(l);
-					frap();
-				}
-			} else frap();
-		if (ment == 8)  crep = 190;
-	}
-}
-
-/* overlay */ void tposer() {
-	integer cx, chai;
-
-	if (! syn)  ecr3("poser");
-	if (s.derobj == 0)  crep = 186;
-	else {
-		if (caff > 99) {
-			crep = 999;
-			ajchai();
-			if (crep != 192)  maivid();
-			return;
-		}
-		tfleche();
-		if ((anyone) || (iesc))  return;
-		tcoord(7);
-		crep = 124;
-		if (num != 0) {
-			rechai(chai);
-			if (chai == 0)  crep = 997;
-			else {
-				cx = 0;
-				do {
-					cx = cx + 1;
-				} while (!((cx > 6) || (num == ord(touv[cx]))));
-				if (num != ord(touv[cx]))  crep = 187;
-				else {
-					mchai = chai;
-					crep = 999;
-				}
-			}
-		} else {
-			tcoord(8);
-			if (num != 0) {
-				crep = 998;
-				if (caff == 2)
-					if (s.iloic != 0)  crep = 188;
-					else s.iloic = s.derobj;
-				if (caff == 13) {
-					if (num == 1) {
-						if (s.iboul != 0)  crep = 188;
-						else s.iboul = s.derobj;
-					} else if (s.ibag != 0)  crep = 188;
-					else s.ibag = s.derobj;
-				}
-				if (caff == 16)
-					if (s.icryp != 0)  crep = 188;
-					else s.icryp = s.derobj;
-				if (caff == 24)  crep = 185;
-				if ((caff == 14) || (caff == 17))  crep = 124;
-			} else {
-				crep = 124;
-				if (caff == 24) {
-					tcoord(5);
-					if (num != 0)  crep = 185;
-				}
-			}
-		}
-		if (caff == 23)  crep = 185;
-		if ((crep == 999) || (crep == 185) || (crep == 998)) {
-			if (crep == 999)  ajchai();
-			if (crep != 192)  maivid();
-		}
-	}
-}
-
-/* overlay */ void tecouter() {
-	integer l, p, haz, j, h, m;
-
-	if (s.mlieu != 26)  crep = 101;
-	else {
-		if (ipers != 0)  s.conf = s.conf + 1;
-		ecfren(p, haz, s.conf, ment);
-		l = ment;
-		if (l != 0)
-			if (p != -500) {
-				if (haz > p)  crep = 101;
-				else {
-					becfren(l);
-					calch(j, h, m);
-					haz = hazard(1, 100);
-					if ((h >= 0) && (h < 8)) {
-						if (haz > 30)  crep = 101;
-						else crep = 178;
-					} else if (haz > 70)  crep = 101;
-					else crep = 178;
-				}
-			} else crep = 178;
-	}
-}
-
-/* overlay */ void tmanger() {
-	integer j, h, m;
-
-	if ((s.mlieu > 15) && (s.mlieu < 26))
-		crep = 148;
-	else {
-		tsort();
-		s.mlieu = 10;
-		caff = 10;
-		debloc(s.mlieu);
-		tmlieu(s.mlieu);
-		calch(j, h, m);
-		if ((h == 12) || (h == 13) || (h == 19)) {
-			s.conf = s.conf - (s.conf / 7);
-			if (h == 12)
-				if (m == 0)  h = 4;
-				else h = 3;
-			if ((h == 13) || (h == 19))
-				if (m == 0)  h = 2;
-				else h = 1;
-			jh = jh + h;
-			crep = 135;
-			tinke();
-		} else crep = 134;
-	}
-}
-
-/* overlay */ void tentrer() {
-	integer x, z;
-
-	if ((s.mlieu == 21) || (s.mlieu == 22)) {
-		t1sama();
-		tmlieu(s.mlieu);
-	} else if (s.mlieu == 15)  aldepl();
-	else if (ment == 0)  crep = 997;
-	else {
-		if ((ment == 9) && (s.derobj != 136)) {
-			crep = 189;
-			s.teauto[8] = '*';
-		} else {
-			if (! blo)  t11(ment, z);
-			if (z != 0) {
-				if ((ment == 3) || (ment == 7))  crep = 179;
-				else {
-					x = (hazard(0, 10)) - 5;
-					parole(7, x, 1);
-					aniof(1, 1);
-					/*       tkey(5,32000);*/
-					tip(z, x);
-					s.conf = s.conf + 1;
-					s.mlieu = 15;
-					msg[3] = discut;
-					msg[4] = disc[x];
-					syn = true;
-					if (ment == 9) {
-						col = true;
-						caff = 70;
-						afdes(0);
-						repon(2, caff);
-					} else col = false;
-					debloc(ment);
-					ment = 0;
-				}
-			} else {
-				x = (hazard(0, 10)) - 5;
-				parole(7, x, 1);
-				aniof(1, 1);
-				/*      tkey(1,32000);*/
-				s.mlieu = ment;
-				affrep();
-				debloc(s.mlieu);
-				tmlieu(s.mlieu);
-				ment = 0;
-				mpers = 0;
-				ipers = 0;
-			}
-		}
-	}
-}
-
-/* overlay */ void tdormir() {
-	const char m1[] = "D‚sirez-vous vous r‚veiller?";
-	integer z, j, h, m, quel;
-
-	if ((s.mlieu > 15) && (s.mlieu < 26)) {
-		crep = 148;
-		return;
-	}
-	if (s.mlieu != 0) {
-		tsort();
-		s.mlieu = 0;
-		affrep();
-		afdes(0);
-		debloc(s.mlieu);
-		tmlieu(s.mlieu);
-	}
-	clsf3();
-	clsf2();
-	ecrf2();
-	ecr2(m1);
-	calch(j, h, m);
-	do {
-		if (h < 8) {
-			s.conf = s.conf - (s.conf / 20);
-			z = (7 - h) * 2;
-			if (m == 30)  z = z - 1;
-			jh = jh + z;
-			h = 7;
-		}
-		jh = jh + 2;
-		h = h + 1;
-		if (h > 23)  h = 0;
-		tinke();
-		quel = do_alert(stouinon, 1);
-		anyone = false;
-	} while (!(quel == 1));
-	crep = 998;
-	num = 0;
-}
-
-/* overlay */ void tdefoncer() {
-	if (! syn)  ecr3("d‚foncer");
-	if (caff < 25)  tfleche();
-	if ((! anyone) && (! iesc))
-		if (s.mlieu != 26)  crep = 997;
-		else {
-			crep = 143;
-			s.conf = s.conf + 2;
-		}
-}
-
-/* overlay */ void tsortir() {
-	integer lx;
-
-	tsort();
-	crep = 0;
-	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)
-	        || (s.mlieu == 24))  crep = 997;
-	else {
-		if ((s.mlieu < 16) || (s.mlieu == 26))  lx = 10;
-		if ((s.mlieu == 10) || (s.mlieu == 20))  lx = 21;
-		if ((s.mlieu < 10) || (s.mlieu == 13))  lx = 15;
-		if (s.mlieu == 16) {
-			lx = 17;
-			crep = 176;
-		}
-		if (s.mlieu == 17)  t23coul(lx);
-		if (s.mlieu == 23)  lx = 24;
-		if (crep != 997)  s.mlieu = lx;
-		caff = lx;
-		if (crep == 0)  crep = lx;
-		debloc(lx);
-		tmlieu(lx);
-	}
-}
-
-/* overlay */ void tattendre() {
-	integer quel;
-
-	mpers = 0;
-	clsf3();
-	do {
-		jh = jh + 1;
-		tinke();
-		if (! blo)  t11(s.mlieu, quel);
-		if ((ipers != 0) && (mpers == 0)) {
-			crep = 998;
-			if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
-			if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
-			mpers = ipers;
-			if (! anyone)  tinke();
-			return;
-		}
-		repon(2, 102);
-		quel = do_alert(stouinon, 1);
-	} while (!(quel == 2));
-	crep = 998;
-	if (! anyone)  tinke();
-}
-
-/* overlay */ void tsonder() {
-	if (! syn)  ecr3("sonder");
-	if (caff < 27) {
-		tfleche();
-		if (!(anyone) && (! iesc))  crep = 145;
-		num = 0;
-	}
-}
-
-/* overlay */ void tparler()
-
-{
-	array<1, 46, boolean> te;
-	integer ix, cy, cx, max, haz, suj, co, lig, icm,
-	        i, tay, choi, x, y, c;
-	char tou;
-	array<1, 46, varying_string<40> > lib;
-	phrase st;
-	boolean f;
-
-
-
-	finfouil();
-	if (col)  suj = 128;
-	else {
-		cx = 0;
-		do {
-			cx = cx + 1;
-		} while (!(disc[cx] == msg[4]));
-		caff = 69 + cx;
-		afdes(0);
-		repon(2, caff);
-		suj = caff + 60;
-	}
-	tkey1(false);
-	mennor();
-	hide_mouse();
-	hirs();
-	premtet();
-	sparl(0, suj);
-	hirs();
-	for (ix = 1; ix <= 46; ix ++) te[ix] = false;
-	for (ix = 1; ix <= 45; ix ++) {
-		deline(ix + c_tparler, st, tay);
-		lib[ix] = delig;
-		for (i = tay; i <= 40; i ++) lib[ix] = lib[ix] + ' ';
-	}
-	lib[46] = lib[45];
-	lib[45] = ' ';
-	show_mouse();
-	do {
-		choi = 0;
-		icm = 0;
-		co = 0;
-		lig = 0;
-		do {
-			icm = succ(integer, icm);
-			putxy(co, lig);
-			if (s.teauto[icm] == '*')
-				if (te[icm])  writetp(lib[icm], 1);
-				else writetp(lib[icm], 0);
-			if (icm == 23)  {
-				lig = 0;
-				co = 320;
-			} else lig = lig + 8;
-		} while (!(icm == 42));
-		putxy(320, 176);
-		writetp(lib[46], 0);
-		tou = '\0';
-		do {
-			mov_mouse(f, tou);
-			/*     if keypressed then read(kbd,tou);*/
-			read_pos_mouse(x, y, c);
-			x = x * (3 - res);
-			if (x > 319)  cx = 41;
-			else cx = 1;
-			cy = succ(integer, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
-			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
-				if (choi != 0) {
-					lig = ((choi - 1) % 23) << 3;
-					if (choi > 23)  co = 320;
-					else co = 0;
-					putxy(co, lig);
-					if (te[choi])  writetp(lib[choi], 0);
-					else writetp(lib[choi], 1);
-					te[choi] = ! te[choi];
-					choi = 0;
-				}
-			} else {
-				ix = cy;
-				if (cx == 41)  ix = ix + 23;
-				if (ix != choi) {
-					if (choi != 0) {
-						lig = ((choi - 1) % 23) << 3;
-						if (choi > 23)  co = 320;
-						else co = 0;
-						putxy(co, lig);
-						if (te[choi])  writetp(lib[choi], 0);
-						else writetp(lib[choi], 1);
-						te[choi] = ! te[choi];
-					}
-					if ((s.teauto[ix] == '*') || (ix == 46)) {
-						lig = ((ix - 1) % 23) << 3;
-						if (ix > 23)  co = 320;
-						else co = 0;
-						putxy(co, lig);
-						if (te[ix])  writetp(lib[ix], 0);
-						else writetp(lib[ix], 1);
-						te[ix] = ! te[ix];
-						choi = ix;
-					} else choi = 0;
-				}
-			}
-		} while (!((tou == '\15') || (((c != 0) || clic) && (choi != 0))));
-		clic = false;
-		if (choi != 46) {
-			ix = choi - 1;
-			if (col) {
-				col = false;
-				s.mlieu = 15;
-				if (iouv > 0)  max = 8;
-				else max = 4;
-				haz = hazard(1, max);
-				if (haz == 2)  suj = 129;
-				else {
-					suj = 138;
-					s.conf = s.conf + (3 * (s.conf / 10));
-				}
-			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
-				suj = tabdon[arep + (ix << 3) + (caff - 70)];
-				s.conf = s.conf + tabdon[arcf + ix];
-				nbrep[caff - 69] = nbrep[caff - 69] + 1;
-			} else {
-				s.conf = s.conf + 3;
-				suj = 139;
-			}
-			hide_mouse();
-			hirs();
-			premtet();
-			sparl(0, suj);
-			show_mouse();
-			if ((suj == 84) || (suj == 86)) {
-				s.pourc[5] = '*';
-				s.teauto[7] = '*';
-			}
-			if ((suj == 106) || (suj == 108) || (suj == 94)) {
-				for (ix = 29; ix <= 31; ix ++) s.teauto[ix] = '*';
-				s.pourc[7] = '*';
-			}
-			if (suj == 70) {
-				s.pourc[8] = '*';
-				s.teauto[32] = '*';
-			}
-			hide_mouse();
-			hirs();
-			show_mouse();
-		}
-	} while (!((choi == 46) || (suj == 138)));
-	if (col) {
-		s.conf = s.conf + (3 * (s.conf / 10));
-		hide_mouse();
-		hirs();
-		premtet();
-		sparl(0, 138);
-		show_mouse();
-		col = false;
-		s.mlieu = 15;
-	}
-	ctrm = 0;
-	hide_mouse();
-	hirs();
-	dessine_rouleau();
-	show_mouse();
-	affper(ipers);
-	tinke();
-	pendule();
-	affrep();
-	/* chech;*/
-	tmlieu(s.mlieu);
-	clsf3();
-}
-
-/* overlay */ void tsentir() {
-	crep = 119;
-	if (caff < 26) {
-		if (! syn)  ecr3("sentir");
-		tfleche();
-		if (!(anyone) && !(iesc))
-			if (caff == 16)  crep = 153;
-	} else if (caff == 123)  crep = 110;
-	num = 0;
-}
-
-/* overlay */ void tgratter() {
-	crep = 155;
-	if (caff < 27) {
-		if (! syn)  ecr3("gratter");
-		tfleche();
-	}
-	num = 0;
-}
-
-/* NIVEAU 2 */
-/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */
-	arret = true;
-	tlu(13, 152);
-	maivid();
-	clsf1();
-	clsf2();
-	clsf3();
-	repon(9, 1509);
-	tkey1(false);
-	hide_mouse();
-	caff = 70;
-	taffich();
-	hirs();
-	premtet();
-	sparl(0, 141);
-	show_mouse();
-	clsf1();
-	repon(9, 1509);
-	repon(2, 142);
-	tkey1(false);
-	caff = 32;
-	afdes(0);
-	repon(6, 34);
-	repon(2, 35);
-	musique(0);
-	tkey1(false);
-	messint(2036);
-	tkey1(false);
-	inzon();
-}
-
-/* overlay */ void tencore() {         /* Perdu !!! */
-	integer quel;
-
-	clsf2();
-	musique(0);
-	tkey1(false);
-	maivid();
-	inzon();
-	dprog();
-	vh = 10;
-	vm = 0;
-	vj = 0;
-	min = 0;
-	heu = 10;
-	jou = 0;
-	repon(2, 180);
-	quel = do_alert(stouinon, 1);
-	arret = (quel != 1);
-}
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
new file mode 100644
index 0000000..d059fc3
--- /dev/null
+++ b/engines/mortevielle/alert.cpp
@@ -0,0 +1,197 @@
+/* overlay */ integer do_alert(str255 str_, integer n);
+
+
+const integer nligne = 7;
+const matrix<1, 2, 1, 3, integer> coord
+= {{ {{150, 72, 103}},
+		{{143, 107, 183}}
+	}
+};
+
+
+
+static void decod(str255 s, integer &nbc, integer &nbl, integer &col, str255 &c, str30 &cs) {
+	integer i, k;
+	boolean v;
+
+	val(s[2], nbc, i);
+	c = "";
+	nbl = 0;
+	i = 5;
+	k = 0;
+	v = true;
+	col = 0;
+
+	while (s[i] != ']') {
+		c = c + s[i];
+		if ((s[i] == '|') || (s[i + 1] == ']')) {
+			if (k > col)  col = k;
+			k = 0;
+			nbl = nbl + 1;
+		} else if (s[i] != ' ')  v = false;
+		i = i + 1;
+		k = k + 1;
+	}
+	if (v)  {
+		c = "";
+		col = 20;
+	} else {
+		c = c + ']';
+		col = col + 6;
+	}
+	i = i + 1;
+	cs = copy(s, i, 30);
+	if (res == 2)  col = col * 6;
+	else col = col * 10;
+}
+
+
+
+static void posit(integer ji, integer &coldep, integer &esp) {
+	putxy(coldep + (40 + esp) *pred(integer, ji), 98);
+}
+
+
+
+static void fait_boite(integer lidep, integer nli, integer tx) {
+	integer x, y, xx, yy;
+
+	if (tx > 640)  tx = 640;
+	x = 320 - ((cardinal)tx >> 1);
+	y = pred(integer, lidep) << 3;
+	xx = x + tx;
+	yy = y + (nli << 3);
+	box(15, gd, x, y, xx, yy, 255);
+	box(0, gd, x, y + 2, xx, y + 4, 255);
+	box(0, gd, x, yy - 4, xx, yy - 2, 255);
+}
+
+
+
+static void fait_choix(str30 c, integer &coldep, integer &nbcase, array<1, 2, varying_string<3> > &s, integer &esp) {
+	integer i, l, x;
+	char ch;
+
+	i = 1;
+	x = coldep;
+	for (l = 1; l <= nbcase; l ++) {
+		s[l] = "";
+		do {
+			i = i + 1;
+			ch = c[i];
+			s[l] = s[l] + ch;
+		} while (!(c[i + 1] == ']'));
+		i = i + 2;
+		while (length(s[l]) < 3)  s[l] = s[l] + ' ';
+		putxy(x, 98);
+		writeg(string(' ') + s[l] + ' ', 0);
+		x = x + esp + 40;
+	}
+}
+
+integer do_alert(str255 str_, integer n) {
+	integer coldep, esp, i, l, nbcase, quoi, ix;
+	str255 st, chaine;
+	matrix<1, 2, 1, 2, integer> limit;
+	char c, dumi;
+	array<1, 2, varying_string<3> > s;
+	integer cx, cy, cd, nbcol, nblig;
+	boolean touch, newaff, test, test1, test2, test3, dum;
+	str30 cas;
+
+
+	/*debug('** do_alert **');*/
+	integer do_alert_result;
+	hide_mouse();
+	while (keypressed())  input >> kbd >> dumi;
+	clic = false;
+	decod(str_, nbcase, nblig, nbcol, chaine, cas);
+	sauvecr(50, succ(integer, nligne) << 4);
+
+	i = 0;
+	if (chaine == "") {
+		fait_boite(10, 5, nbcol);
+	} else {
+		fait_boite(8, 7, nbcol);
+		i = 0;
+		ywhere = 70;
+		do {
+			cx = 320;
+			st = "";
+			while (!(set::of('\174', '\135', eos).has(chaine[i + 1]))) {
+				i = i + 1;
+				st = st + chaine[i];
+				if (res == 2)  cx = cx - 3;
+				else cx = cx - 5;
+			}
+			putxy(cx, ywhere);
+			ywhere = ywhere + 6;
+			writeg(st, 4);
+			i = i + 1;
+		} while (!(chaine[i] == ']'));
+	}
+	if (nbcase == 1)  esp = nbcol - 40;
+	else esp = (cardinal)(nbcol - nbcase * 40) >> 1;
+	coldep = 320 - ((cardinal)nbcol >> 1) + ((cardinal)esp >> 1);
+	fait_choix(cas, coldep, nbcase, s, esp);
+	limit[1][1] = ((cardinal)(coldep) >> 1) * res;
+	limit[1][2] = limit[1][1] + 40;
+	if (nbcase == 1) {
+		limit[2][1] = limit[2][2];
+	} else {
+		limit[2][1] = ((cardinal)(320 + ((cardinal)esp >> 1)) >> 1) * res;
+		limit[2][2] = (limit[2][1]) + 40;
+	}
+	show_mouse();
+	quoi = 0;
+	dum = false;
+	do {
+		dumi = '\377';
+		mov_mouse(dum, dumi);
+		cx = x_s;
+		cy = y_s;
+		test = (cy > 95) && (cy < 105);
+		newaff = false;
+		if (test) {
+			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
+			test2 = test1;
+			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
+			if (test2) {
+				newaff = true;
+				if (test1)  ix = 1;
+				else ix = 2;
+				if (ix != quoi) {
+					hide_mouse();
+					if (quoi != 0) {
+						posit(quoi, coldep, esp);
+						writeg(string(' ') + s[quoi] + ' ', 0);
+					}
+					posit(ix, coldep, esp);
+					writeg(string(' ') + s[ix] + ' ', 1);
+					quoi = ix;
+					show_mouse();
+				}
+			}
+		}
+		if ((quoi != 0) && ! newaff) {
+			hide_mouse();
+			posit(quoi, coldep, esp);
+			writeg(string(' ') + s[quoi] + ' ', 0);
+			quoi = 0;
+			show_mouse();
+		}
+		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
+		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
+	} while (!clic);
+	clic = false;
+	hide_mouse();
+	if (! test3)  {
+		quoi = n;
+		posit(n, coldep, esp);
+		writeg(string(' ') + s[n] + ' ', 1);
+	}
+	charecr(50, succ(integer, nligne) << 4);
+	show_mouse();
+	do_alert_result = quoi;
+	return do_alert_result;
+}
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
deleted file mode 100644
index d059fc3..0000000
--- a/engines/mortevielle/alert.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/* overlay */ integer do_alert(str255 str_, integer n);
-
-
-const integer nligne = 7;
-const matrix<1, 2, 1, 3, integer> coord
-= {{ {{150, 72, 103}},
-		{{143, 107, 183}}
-	}
-};
-
-
-
-static void decod(str255 s, integer &nbc, integer &nbl, integer &col, str255 &c, str30 &cs) {
-	integer i, k;
-	boolean v;
-
-	val(s[2], nbc, i);
-	c = "";
-	nbl = 0;
-	i = 5;
-	k = 0;
-	v = true;
-	col = 0;
-
-	while (s[i] != ']') {
-		c = c + s[i];
-		if ((s[i] == '|') || (s[i + 1] == ']')) {
-			if (k > col)  col = k;
-			k = 0;
-			nbl = nbl + 1;
-		} else if (s[i] != ' ')  v = false;
-		i = i + 1;
-		k = k + 1;
-	}
-	if (v)  {
-		c = "";
-		col = 20;
-	} else {
-		c = c + ']';
-		col = col + 6;
-	}
-	i = i + 1;
-	cs = copy(s, i, 30);
-	if (res == 2)  col = col * 6;
-	else col = col * 10;
-}
-
-
-
-static void posit(integer ji, integer &coldep, integer &esp) {
-	putxy(coldep + (40 + esp) *pred(integer, ji), 98);
-}
-
-
-
-static void fait_boite(integer lidep, integer nli, integer tx) {
-	integer x, y, xx, yy;
-
-	if (tx > 640)  tx = 640;
-	x = 320 - ((cardinal)tx >> 1);
-	y = pred(integer, lidep) << 3;
-	xx = x + tx;
-	yy = y + (nli << 3);
-	box(15, gd, x, y, xx, yy, 255);
-	box(0, gd, x, y + 2, xx, y + 4, 255);
-	box(0, gd, x, yy - 4, xx, yy - 2, 255);
-}
-
-
-
-static void fait_choix(str30 c, integer &coldep, integer &nbcase, array<1, 2, varying_string<3> > &s, integer &esp) {
-	integer i, l, x;
-	char ch;
-
-	i = 1;
-	x = coldep;
-	for (l = 1; l <= nbcase; l ++) {
-		s[l] = "";
-		do {
-			i = i + 1;
-			ch = c[i];
-			s[l] = s[l] + ch;
-		} while (!(c[i + 1] == ']'));
-		i = i + 2;
-		while (length(s[l]) < 3)  s[l] = s[l] + ' ';
-		putxy(x, 98);
-		writeg(string(' ') + s[l] + ' ', 0);
-		x = x + esp + 40;
-	}
-}
-
-integer do_alert(str255 str_, integer n) {
-	integer coldep, esp, i, l, nbcase, quoi, ix;
-	str255 st, chaine;
-	matrix<1, 2, 1, 2, integer> limit;
-	char c, dumi;
-	array<1, 2, varying_string<3> > s;
-	integer cx, cy, cd, nbcol, nblig;
-	boolean touch, newaff, test, test1, test2, test3, dum;
-	str30 cas;
-
-
-	/*debug('** do_alert **');*/
-	integer do_alert_result;
-	hide_mouse();
-	while (keypressed())  input >> kbd >> dumi;
-	clic = false;
-	decod(str_, nbcase, nblig, nbcol, chaine, cas);
-	sauvecr(50, succ(integer, nligne) << 4);
-
-	i = 0;
-	if (chaine == "") {
-		fait_boite(10, 5, nbcol);
-	} else {
-		fait_boite(8, 7, nbcol);
-		i = 0;
-		ywhere = 70;
-		do {
-			cx = 320;
-			st = "";
-			while (!(set::of('\174', '\135', eos).has(chaine[i + 1]))) {
-				i = i + 1;
-				st = st + chaine[i];
-				if (res == 2)  cx = cx - 3;
-				else cx = cx - 5;
-			}
-			putxy(cx, ywhere);
-			ywhere = ywhere + 6;
-			writeg(st, 4);
-			i = i + 1;
-		} while (!(chaine[i] == ']'));
-	}
-	if (nbcase == 1)  esp = nbcol - 40;
-	else esp = (cardinal)(nbcol - nbcase * 40) >> 1;
-	coldep = 320 - ((cardinal)nbcol >> 1) + ((cardinal)esp >> 1);
-	fait_choix(cas, coldep, nbcase, s, esp);
-	limit[1][1] = ((cardinal)(coldep) >> 1) * res;
-	limit[1][2] = limit[1][1] + 40;
-	if (nbcase == 1) {
-		limit[2][1] = limit[2][2];
-	} else {
-		limit[2][1] = ((cardinal)(320 + ((cardinal)esp >> 1)) >> 1) * res;
-		limit[2][2] = (limit[2][1]) + 40;
-	}
-	show_mouse();
-	quoi = 0;
-	dum = false;
-	do {
-		dumi = '\377';
-		mov_mouse(dum, dumi);
-		cx = x_s;
-		cy = y_s;
-		test = (cy > 95) && (cy < 105);
-		newaff = false;
-		if (test) {
-			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
-			test2 = test1;
-			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
-			if (test2) {
-				newaff = true;
-				if (test1)  ix = 1;
-				else ix = 2;
-				if (ix != quoi) {
-					hide_mouse();
-					if (quoi != 0) {
-						posit(quoi, coldep, esp);
-						writeg(string(' ') + s[quoi] + ' ', 0);
-					}
-					posit(ix, coldep, esp);
-					writeg(string(' ') + s[ix] + ' ', 1);
-					quoi = ix;
-					show_mouse();
-				}
-			}
-		}
-		if ((quoi != 0) && ! newaff) {
-			hide_mouse();
-			posit(quoi, coldep, esp);
-			writeg(string(' ') + s[quoi] + ' ', 0);
-			quoi = 0;
-			show_mouse();
-		}
-		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
-		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
-	} while (!clic);
-	clic = false;
-	hide_mouse();
-	if (! test3)  {
-		quoi = n;
-		posit(n, coldep, esp);
-		writeg(string(' ') + s[n] + ' ', 1);
-	}
-	charecr(50, succ(integer, nligne) << 4);
-	show_mouse();
-	do_alert_result = quoi;
-	return do_alert_result;
-}
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
new file mode 100644
index 0000000..4120f73
--- /dev/null
+++ b/engines/mortevielle/boite.cpp
@@ -0,0 +1,29 @@
+void boite(integer x, integer y, integer dx, integer dy, integer coul) {
+	integer i;
+	integer xi, yi, xo, yo;
+
+	/* debug('boite'); */
+	hide_mouse();
+	if (res == 1) {
+		x = (cardinal)x >> 1;
+		dx = (cardinal)dx >> 1;
+	}
+	xi = x;
+	yi = y;
+	xo = x;
+	yo = y;
+	for (i = 0; i <= dx + dy; i ++) {
+		putpix(gd, xi, yi, coul);
+		if (xi == x + dx)  {
+			if (gd != cga)  putpix(gd, pred(integer, xi), yi, coul);
+			yi = succ(integer, yi);
+		} else xi = succ(integer, xi);
+		putpix(gd, xo, yo, coul);
+		if (yo == y + dy)  xo = succ(integer, xo);
+		else {
+			if (gd != cga)  putpix(gd, succ(integer, xo), yo, coul);
+			yo = succ(integer, yo);
+		}
+	}
+	show_mouse();
+}
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
deleted file mode 100644
index 4120f73..0000000
--- a/engines/mortevielle/boite.h
+++ /dev/null
@@ -1,29 +0,0 @@
-void boite(integer x, integer y, integer dx, integer dy, integer coul) {
-	integer i;
-	integer xi, yi, xo, yo;
-
-	/* debug('boite'); */
-	hide_mouse();
-	if (res == 1) {
-		x = (cardinal)x >> 1;
-		dx = (cardinal)dx >> 1;
-	}
-	xi = x;
-	yi = y;
-	xo = x;
-	yo = y;
-	for (i = 0; i <= dx + dy; i ++) {
-		putpix(gd, xi, yi, coul);
-		if (xi == x + dx)  {
-			if (gd != cga)  putpix(gd, pred(integer, xi), yi, coul);
-			yi = succ(integer, yi);
-		} else xi = succ(integer, xi);
-		putpix(gd, xo, yo, coul);
-		if (yo == y + dy)  xo = succ(integer, xo);
-		else {
-			if (gd != cga)  putpix(gd, succ(integer, xo), yo, coul);
-			yo = succ(integer, yo);
-		}
-	}
-	show_mouse();
-}
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
new file mode 100644
index 0000000..517d408
--- /dev/null
+++ b/engines/mortevielle/disk.cpp
@@ -0,0 +1,74 @@
+
+void dem1() {
+	untyped_file f;
+	integer k;
+
+	/* -- demande de disk 1 -- */
+	assign(f, "mort.005");
+	/*$i-*/
+	k = ioresult;
+	reset(f);
+	while (ioresult != 0) {
+		show_mouse();
+		k = do_alert(al_mess, 1);
+		hide_mouse();
+		reset(f);
+	}
+	close(f);
+}
+
+void takesav(integer n) {
+	untyped_file f;
+	integer i;
+	varying_string<10> st;
+
+	dem1();
+	/* -- chargement du fichier 'sauve#n.mor' -- */
+	st = string("sav") + chr(n + 48) + ".mor";
+	assign(f, st);
+	reset(f, 497);
+	blockread(f, s1, 1);
+	if (ioresult != 0) {
+		i = do_alert(err_mess, 1);
+		exit(0);
+	}
+	s = s1;
+	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
+	close(f);
+}
+
+void ld_game(integer n) {
+	hide_mouse();
+	maivid();
+	takesav(n);
+	/* -- disquette 2 -- */
+	dem2();
+	/* -- mises en place -- */
+	theure();
+	dprog();
+	antegame();
+	show_mouse();
+}
+
+void sv_game(integer n) {
+	untyped_file f;
+	integer i;
+
+	hide_mouse();
+	tmaj3();
+	dem1();
+	/* -- sauvegarde du fichier 'sauve#n.mor' -- */
+	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
+	s1 = s;
+	if (s1.mlieu == 26)  s1.mlieu = 15;
+	assign(f, string("sav") + chr(n + 48) + ".mor");
+	rewrite(f, 497);
+	blockwrite(f, s1, 1);
+	close(f);
+	dem2();
+	show_mouse();
+}
+
+
+
+
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
deleted file mode 100644
index 517d408..0000000
--- a/engines/mortevielle/disk.h
+++ /dev/null
@@ -1,74 +0,0 @@
-
-void dem1() {
-	untyped_file f;
-	integer k;
-
-	/* -- demande de disk 1 -- */
-	assign(f, "mort.005");
-	/*$i-*/
-	k = ioresult;
-	reset(f);
-	while (ioresult != 0) {
-		show_mouse();
-		k = do_alert(al_mess, 1);
-		hide_mouse();
-		reset(f);
-	}
-	close(f);
-}
-
-void takesav(integer n) {
-	untyped_file f;
-	integer i;
-	varying_string<10> st;
-
-	dem1();
-	/* -- chargement du fichier 'sauve#n.mor' -- */
-	st = string("sav") + chr(n + 48) + ".mor";
-	assign(f, st);
-	reset(f, 497);
-	blockread(f, s1, 1);
-	if (ioresult != 0) {
-		i = do_alert(err_mess, 1);
-		exit(0);
-	}
-	s = s1;
-	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
-	close(f);
-}
-
-void ld_game(integer n) {
-	hide_mouse();
-	maivid();
-	takesav(n);
-	/* -- disquette 2 -- */
-	dem2();
-	/* -- mises en place -- */
-	theure();
-	dprog();
-	antegame();
-	show_mouse();
-}
-
-void sv_game(integer n) {
-	untyped_file f;
-	integer i;
-
-	hide_mouse();
-	tmaj3();
-	dem1();
-	/* -- sauvegarde du fichier 'sauve#n.mor' -- */
-	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
-	s1 = s;
-	if (s1.mlieu == 26)  s1.mlieu = 15;
-	assign(f, string("sav") + chr(n + 48) + ".mor");
-	rewrite(f, 497);
-	blockwrite(f, s1, 1);
-	close(f);
-	dem2();
-	show_mouse();
-}
-
-
-
-
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
new file mode 100644
index 0000000..8d254a4
--- /dev/null
+++ b/engines/mortevielle/droite.cpp
@@ -0,0 +1,34 @@
+void droite(integer x, integer y, integer xx, integer yy, integer coul) {
+	integer step, i;
+	real a, b;
+	real xr, yr, xro, yro;
+
+	xr = x;
+	yr = y;
+	xro = xx;
+	yro = yy;
+	/*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
+	if (abs(y - yy) > abs(x - xx)) {
+		a = (real)((x - xx)) / (y - yy);
+		b = (yr * xro - yro * xr) / (y - yy);
+		i = y;
+		if (y > yy)  step = -1;
+		else step = 1;
+		do {
+			putpix(gd, trunc(a * i + b), i, coul);
+			i = i + step;
+		} while (!(i == yy));
+		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
+	} else {
+		a = (real)((y - yy)) / (x - xx);
+		b = ((yro * xr) - (yr * xro)) / (x - xx);
+		i = x;
+		if (x > xx)  step = -1;
+		else step = 1;
+		do {
+			putpix(gd, i, trunc(a * i + b), coul);
+			i = i + step;
+		} while (!(i == xx));
+		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
+	}
+}
\ No newline at end of file
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
deleted file mode 100644
index 8d254a4..0000000
--- a/engines/mortevielle/droite.h
+++ /dev/null
@@ -1,34 +0,0 @@
-void droite(integer x, integer y, integer xx, integer yy, integer coul) {
-	integer step, i;
-	real a, b;
-	real xr, yr, xro, yro;
-
-	xr = x;
-	yr = y;
-	xro = xx;
-	yro = yy;
-	/*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
-	if (abs(y - yy) > abs(x - xx)) {
-		a = (real)((x - xx)) / (y - yy);
-		b = (yr * xro - yro * xr) / (y - yy);
-		i = y;
-		if (y > yy)  step = -1;
-		else step = 1;
-		do {
-			putpix(gd, trunc(a * i + b), i, coul);
-			i = i + step;
-		} while (!(i == yy));
-		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
-	} else {
-		a = (real)((y - yy)) / (x - xx);
-		b = ((yro * xr) - (yr * xro)) / (x - xx);
-		i = x;
-		if (x > xx)  step = -1;
-		else step = 1;
-		do {
-			putpix(gd, i, trunc(a * i + b), coul);
-			i = i + step;
-		} while (!(i == xx));
-		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
-	}
-}
\ No newline at end of file
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
new file mode 100644
index 0000000..b450e07
--- /dev/null
+++ b/engines/mortevielle/keyboard.cpp
@@ -0,0 +1,60 @@
+char readkey1() {
+	char c;
+
+	char readkey1_result;
+	input >> kbd >> c;
+	readkey1_result = c;
+	return readkey1_result;
+}
+
+integer testou() {
+	char ch;
+
+	integer testou_result;
+	input >> kbd >> ch;
+	switch (ch)  {
+	case '\23' :
+		sonoff = ! sonoff;
+		break;
+	case '\1':
+	case '\3':
+	case '\5'  : {
+		newgd = (cardinal)pred(integer, ord(ch)) >> 1;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\10'  : {
+		newgd = her;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\24' : {
+		newgd = tan;
+		testou_result = 61;
+		return testou_result;
+	}
+	break;
+	case '\26' :
+		if (set::of(1, 2, eos).has(c_zzz)) {
+			zzuul(adcfiec + 161, 0, 1644);
+			c_zzz = succ(integer, c_zzz);
+			testou_result = 61;
+			return testou_result;
+		}
+		break;
+	case '\33' :
+		if (keypressed())  input >> kbd >> ch;
+		break;
+	}
+	testou_result = ord(ch);
+	return testou_result;
+}
+
+void teskbd() {
+	integer dum;
+
+	if (keypressed())  dum = testou();
+}
+
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
deleted file mode 100644
index b450e07..0000000
--- a/engines/mortevielle/keyboard.h
+++ /dev/null
@@ -1,60 +0,0 @@
-char readkey1() {
-	char c;
-
-	char readkey1_result;
-	input >> kbd >> c;
-	readkey1_result = c;
-	return readkey1_result;
-}
-
-integer testou() {
-	char ch;
-
-	integer testou_result;
-	input >> kbd >> ch;
-	switch (ch)  {
-	case '\23' :
-		sonoff = ! sonoff;
-		break;
-	case '\1':
-	case '\3':
-	case '\5'  : {
-		newgd = (cardinal)pred(integer, ord(ch)) >> 1;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	case '\10'  : {
-		newgd = her;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	case '\24' : {
-		newgd = tan;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	case '\26' :
-		if (set::of(1, 2, eos).has(c_zzz)) {
-			zzuul(adcfiec + 161, 0, 1644);
-			c_zzz = succ(integer, c_zzz);
-			testou_result = 61;
-			return testou_result;
-		}
-		break;
-	case '\33' :
-		if (keypressed())  input >> kbd >> ch;
-		break;
-	}
-	testou_result = ord(ch);
-	return testou_result;
-}
-
-void teskbd() {
-	integer dum;
-
-	if (keypressed())  dum = testou();
-}
-
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
new file mode 100644
index 0000000..2c9b8cd
--- /dev/null
+++ b/engines/mortevielle/level15.cpp
@@ -0,0 +1,175 @@
+
+/* NIVEAU 15 */
+void copcha() {
+	integer i;
+
+	i = acha;
+	do {
+		tabdon[i] = tabdon[i + 390];
+		i = succ(integer, i);
+	} while (!(i == acha + 390));
+}
+
+boolean dans_rect(rectangle r) {
+	integer x, y, c;
+
+	boolean dans_rect_result;
+	read_pos_mouse(x, y, c);
+	if ((x > r.x1) &&
+	        (x < r.x2) &&
+	        (y > r.y1) &&
+	        (y < r.y2))  dans_rect_result = true;
+	else dans_rect_result = false;
+	return dans_rect_result;
+}
+
+void outbloc(integer n, pattern p, t_nhom pal) {
+	integer i, j, ad;
+
+	ad = n * 404 + 0xd700;
+	{
+		memw[0x6000 + ad] = p.tax;
+		memw[0x6000 + ad + 2] = p.tay;
+		ad = ad + 4;
+		for (i = 1; i <= p.tax; i ++)
+			for (j = 1; j <= p.tay; j ++)
+				mem[0x6000 + ad + pred(integer, j)*p.tax + pred(integer, i)] = pal[n].hom[p.des[i][j]];
+	}
+}
+
+
+void writepal(integer n) {
+	integer i;
+	t_nhom pal;
+
+
+	switch (gd) {
+	case tan:
+	case ega:
+	case ams :
+		for (i = 1; i <= 16; i ++) {
+			mem[0x7000 + 2 * i] = tabpal[n][i].x;
+			mem[0x7000 + succ(integer, 2 * i)] = tabpal[n][i].y;
+		}
+		break;
+	case cga : {
+		pal = palcga[n].a;
+		if (n < 89)  palette(palcga[n].p);
+		for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
+	}
+	break;
+	}
+}
+
+
+void pictout(integer seg, integer dep, integer x, integer y) {
+	decomp(seg, dep);
+	if (gd == her) {
+		mem[0x7000 + 2] = 0;
+		mem[0x7000 + 32] = 15;
+	}
+	if ((caff != 51) && (memw[0x7000 + 0x4138] > 0x100))  memw[0x7000 + 0x4138] = 0x100;
+	afff(gd, seg, dep, x, y);
+}
+
+void putxy(integer x, integer y) {
+	xwhere = x;
+	ywhere = y;
+}
+/*
+function calad(x,y:integer):integer;
+   begin
+     calad:=pred(x)+320*pred(y)
+   end;
+  */
+void sauvecr(integer y, integer dy) {
+	hide_mouse();
+	s_sauv(gd, y, dy);
+	show_mouse();
+}
+
+void charecr(integer y, integer dy) {
+	hide_mouse();
+	s_char(gd, y, dy);
+	show_mouse();
+}
+/*
+function peek(ad:integer):integer;
+begin
+  peek:=tabdon[ad];
+end;
+
+function peekw(ad:integer):integer;
+begin
+  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
+end;
+
+function peekl(ad:integer):real;
+begin
+  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
+end;
+
+
+procedure poke (ad,n:integer);
+begin
+  tabdon[ad]:=lo(n);
+end;
+  */
+
+void adzon() {
+	untyped_file f;
+	file<byte> g;
+	byte a;
+	integer i;
+
+	assign(f, "don.mor");
+	reset(f, 256);
+	blockread(f, tabdon, 7);
+	close(f);
+	assign(f, "bmor.mor");
+	reset(f, 1916);
+	blockread(f, tabdon[fleche], 1);
+	/*i:=fleche;
+	repeat
+	  read(g,a);
+	  tabdon[i]:=a;
+	  i:=succ(i);
+	until i=fleche + 1916;*/
+	close(f);
+	assign(f, "dec.mor");
+	reset(f, 1664);
+	blockread(f, mem[0x73a2 + 0], 1);
+	/*i:=0;
+	repeat
+	  read(g,a);
+	  mem[$73A2:i]:=a;
+	  i:=succ(i);
+	until eof(g);*/
+	close(f);
+}
+
+integer animof(integer ouf, integer num) {
+	integer nani, aux;
+
+	integer animof_result;
+	nani = mem[adani + 1];
+	aux = num;
+	if (ouf != 1)  aux = aux + nani;
+	animof_result = (nani << 2) + 2 + swap(memw[adani + (aux << 1)]);
+	/*aux:= nani shl 2 + 2;
+	if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
+	         else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
+	animof:=aux;*/
+	return animof_result;
+}
+
+/*procedure affgd(offs,dep,x,y:integer);
+begin
+  case Gd of
+     Ams : affams(offs,dep,x,y);
+     Cga : affcga(offs,dep,x,y);
+     Ega : affega(offs,dep,x,y);
+     Her : affher(offs,dep,x,y);
+     Tan : afftan(offs,dep,x,y);
+  end;
+end;*/
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
deleted file mode 100644
index 2c9b8cd..0000000
--- a/engines/mortevielle/level15.h
+++ /dev/null
@@ -1,175 +0,0 @@
-
-/* NIVEAU 15 */
-void copcha() {
-	integer i;
-
-	i = acha;
-	do {
-		tabdon[i] = tabdon[i + 390];
-		i = succ(integer, i);
-	} while (!(i == acha + 390));
-}
-
-boolean dans_rect(rectangle r) {
-	integer x, y, c;
-
-	boolean dans_rect_result;
-	read_pos_mouse(x, y, c);
-	if ((x > r.x1) &&
-	        (x < r.x2) &&
-	        (y > r.y1) &&
-	        (y < r.y2))  dans_rect_result = true;
-	else dans_rect_result = false;
-	return dans_rect_result;
-}
-
-void outbloc(integer n, pattern p, t_nhom pal) {
-	integer i, j, ad;
-
-	ad = n * 404 + 0xd700;
-	{
-		memw[0x6000 + ad] = p.tax;
-		memw[0x6000 + ad + 2] = p.tay;
-		ad = ad + 4;
-		for (i = 1; i <= p.tax; i ++)
-			for (j = 1; j <= p.tay; j ++)
-				mem[0x6000 + ad + pred(integer, j)*p.tax + pred(integer, i)] = pal[n].hom[p.des[i][j]];
-	}
-}
-
-
-void writepal(integer n) {
-	integer i;
-	t_nhom pal;
-
-
-	switch (gd) {
-	case tan:
-	case ega:
-	case ams :
-		for (i = 1; i <= 16; i ++) {
-			mem[0x7000 + 2 * i] = tabpal[n][i].x;
-			mem[0x7000 + succ(integer, 2 * i)] = tabpal[n][i].y;
-		}
-		break;
-	case cga : {
-		pal = palcga[n].a;
-		if (n < 89)  palette(palcga[n].p);
-		for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
-	}
-	break;
-	}
-}
-
-
-void pictout(integer seg, integer dep, integer x, integer y) {
-	decomp(seg, dep);
-	if (gd == her) {
-		mem[0x7000 + 2] = 0;
-		mem[0x7000 + 32] = 15;
-	}
-	if ((caff != 51) && (memw[0x7000 + 0x4138] > 0x100))  memw[0x7000 + 0x4138] = 0x100;
-	afff(gd, seg, dep, x, y);
-}
-
-void putxy(integer x, integer y) {
-	xwhere = x;
-	ywhere = y;
-}
-/*
-function calad(x,y:integer):integer;
-   begin
-     calad:=pred(x)+320*pred(y)
-   end;
-  */
-void sauvecr(integer y, integer dy) {
-	hide_mouse();
-	s_sauv(gd, y, dy);
-	show_mouse();
-}
-
-void charecr(integer y, integer dy) {
-	hide_mouse();
-	s_char(gd, y, dy);
-	show_mouse();
-}
-/*
-function peek(ad:integer):integer;
-begin
-  peek:=tabdon[ad];
-end;
-
-function peekw(ad:integer):integer;
-begin
-  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
-end;
-
-function peekl(ad:integer):real;
-begin
-  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
-end;
-
-
-procedure poke (ad,n:integer);
-begin
-  tabdon[ad]:=lo(n);
-end;
-  */
-
-void adzon() {
-	untyped_file f;
-	file<byte> g;
-	byte a;
-	integer i;
-
-	assign(f, "don.mor");
-	reset(f, 256);
-	blockread(f, tabdon, 7);
-	close(f);
-	assign(f, "bmor.mor");
-	reset(f, 1916);
-	blockread(f, tabdon[fleche], 1);
-	/*i:=fleche;
-	repeat
-	  read(g,a);
-	  tabdon[i]:=a;
-	  i:=succ(i);
-	until i=fleche + 1916;*/
-	close(f);
-	assign(f, "dec.mor");
-	reset(f, 1664);
-	blockread(f, mem[0x73a2 + 0], 1);
-	/*i:=0;
-	repeat
-	  read(g,a);
-	  mem[$73A2:i]:=a;
-	  i:=succ(i);
-	until eof(g);*/
-	close(f);
-}
-
-integer animof(integer ouf, integer num) {
-	integer nani, aux;
-
-	integer animof_result;
-	nani = mem[adani + 1];
-	aux = num;
-	if (ouf != 1)  aux = aux + nani;
-	animof_result = (nani << 2) + 2 + swap(memw[adani + (aux << 1)]);
-	/*aux:= nani shl 2 + 2;
-	if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
-	         else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
-	animof:=aux;*/
-	return animof_result;
-}
-
-/*procedure affgd(offs,dep,x,y:integer);
-begin
-  case Gd of
-     Ams : affams(offs,dep,x,y);
-     Cga : affcga(offs,dep,x,y);
-     Ega : affega(offs,dep,x,y);
-     Her : affher(offs,dep,x,y);
-     Tan : afftan(offs,dep,x,y);
-  end;
-end;*/
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
new file mode 100644
index 0000000..691ef7c
--- /dev/null
+++ b/engines/mortevielle/menu.cpp
@@ -0,0 +1,334 @@
+/* NIVEAU 14*/
+
+/* overlay */ void menut(integer no, str30 nom) {
+	byte h, l;
+	str30 s;
+
+
+	/* debug('menut'); */
+	h = hi(no);
+	l = lo(no);
+	s = nom;
+	if (! tesok) {
+		clrscr;
+		exit(0);
+	}
+	while (length(s) < 30)  s = s + ' ';
+	switch (h) {
+	case invent  :
+		if (l != 7)  inv[l] = string(' ') + s;
+		break;
+	case depla   :
+		dep[l] = s;
+		break;
+	case action  :
+		act[l] = s;
+		break;
+	case saction :
+		self_[l] = s;
+		break;
+	case discut  :
+		dis[l] = s;
+		break;
+	}
+}
+
+/* overlay */ void menu_disable(integer no) {
+	byte h, l;
+
+	/* debug('menu_disable'); */
+	h = hi(no);
+	l = lo(no);
+	switch (h) {
+	case invent : {
+		if (l > 6)  {
+			inv[l][1] = '<';
+			inv[l][22] = '>';
+		} else inv[l][1] = '*';
+	}
+	break;
+	case depla :
+		dep[l][1] = '*';
+		break;
+	case action :
+		act[l][1] = '*';
+		break;
+	case saction :
+		self_[l][1] = '*';
+		break;
+	case discut :
+		dis[l][1] = '*';
+		break;
+	}
+}
+
+/* overlay */ void menu_enable(integer no) {
+	byte h, l;
+
+	/* debug('menu_disable'); */
+	h = hi(no);
+	l = lo(no);
+	switch (h) {
+	case invent : {
+		inv[l][1] = ' ';
+		inv[l][22] = ' ';
+	}
+	break;
+	case depla :
+		dep[l][1] = ' ';
+		break;
+	case action :
+		act[l][1] = ' ';
+		break;
+	case saction : {
+		self_[l][1] = ' ';
+		self_[l][1] = ' ';
+	}
+	break;
+	case discut :
+		dis[l][1] = ' ';
+		break;
+	}
+}
+
+void menu_aff() {
+	integer ind_tabl, k, col;
+	char c;
+	integer pt, x, y, color, msk,
+	        num_letr;
+
+	/* debug('menu_aff'); */
+	hide_mouse();
+	/*if not tesok then
+	   begin
+	     clrscr;
+	     halt;
+	   end;*/
+	box(7, gd, 0, 0, 639, 10, 255);
+	col = 28 * res;
+	if (gd == cga)  color = 1;
+	else color = 9;
+	num_letr = 0;
+	do {       /* lettre par lettre */
+		num_letr = num_letr + 1;
+		ind_tabl = 0;
+		y = 1;
+		do {      /* colonne par colonne */
+			k = 0;
+			x = col;
+			do {     /* ligne par ligne */
+				msk = 0x80;
+				for (pt = 0; pt <= 7; pt ++) {
+					if ((lettres[num_letr][ind_tabl] & msk) != 0) {
+						putpix(gd, x + 1, y + 1, 0);
+						putpix(gd, x, y + 1, 0);
+						putpix(gd, x, y, color);
+					}
+					msk = (cardinal)msk >> 1;
+					x = x + 1;
+				}
+				ind_tabl = succ(integer, ind_tabl);
+				k = succ(integer, k);
+			} while (!(k == 3));
+			y = y + 1;
+		} while (!(y == 9));
+		col = col + 48 * res;
+	} while (!(num_letr == 6));
+	show_mouse();
+}
+
+
+void draw_menu() {
+	/* debug('draw_menu'); */
+	menu_aff();
+	active_menu = true;
+	msg4 = no_choice;
+	msg3 = no_choice;
+	choisi = false;
+	clic = false;
+	test0 = false;
+}
+
+void invers(integer ix) {
+	varying_string<23> s;
+
+	/* debug('invers'); */
+	if (msg4 == no_choice)  return;
+	putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
+	switch (msg3) {
+	case 1 :
+		s = inv[lo(msg4)];
+		break;
+	case 2 :
+		s = dep[lo(msg4)];
+		break;
+	case 3 :
+		s = act[lo(msg4)];
+		break;
+	case 4 :
+		s = self_[lo(msg4)];
+		break;
+	case 5 :
+		s = dis[lo(msg4)];
+		break;
+	case 6 :
+		s = fic[lo(msg4)];
+		break;
+	case 7 :
+		s = fic[1] + ' ' + chr(48 + lo(msg4));
+		break;
+	case 8 :
+		if (lo(msg4) == 1)  s = recom;
+		else s = fic[2] + ' ' + chr(47 + lo(msg4));
+		break;
+	}
+	if ((s[1] != '*') && (s[1] != '<'))  writeg(s, ix);
+	else msg4 = no_choice;
+}
+
+void util(integer x, integer y) {
+	integer ymx, dxcar, xmn, xmx, ix;
+
+	/* debug('util'); */
+	ymx = (don[msg3][4] << 3) + 16;
+	dxcar = don[msg3][3];
+	xmn = (don[msg3][1] << 2) * res;
+	if (res == 1)  ix = 5;
+	else ix = 3;
+	xmx = dxcar * ix * res + xmn + 2;
+	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
+		ix = pred(integer, (cardinal)y >> 3) + (msg3 << 8);
+		if (ix != msg4) {
+			invers(1);
+			msg4 = ix;
+			invers(0);
+		}
+	} else if (msg4 != no_choice) {
+		invers(1);
+		msg4 = no_choice;
+	}
+}
+
+void menu_down(integer ii) {
+	integer cx, xcc;
+	integer xco, nb_lig;
+
+	/* debug('menu_down'); */
+	xco = don[ii][1];
+	nb_lig = don[ii][4];
+	hide_mouse();
+	sauvecr(10, succ(byte, don[ii][2]) << 1);
+	xco = xco << 3;
+	if (res == 1)  cx = 10;
+	else cx = 6;
+	xcc = xco + (don[ii][3] * cx) + 6;
+	box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
+	box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
+	box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
+	putxy(xco, 16);
+	cx = 0;
+	do {
+		cx = succ(integer, cx);
+		switch (ii) {
+		case 1 :
+			if (inv[cx][1] != '*')  writeg(inv[cx], 4);
+			break;
+		case 2 :
+			if (dep[cx][1] != '*')  writeg(dep[cx], 4);
+			break;
+		case 3 :
+			if (act[cx][1] != '*')  writeg(act[cx], 4);
+			break;
+		case 4 :
+			if (self_[cx][1] != '*')  writeg(self_[cx], 4);
+			break;
+		case 5 :
+			if (dis[cx][1] != '*')  writeg(dis[cx], 4);
+			break;
+		case 6 :
+			writeg(fic[cx], 4);
+			break;
+		case 7 :
+			writeg(fic[1] + ' ' + chr(48 + cx), 4);
+			break;
+		case 8 :
+			if (cx == 1)  writeg(recom, 4);
+			else writeg(fic[2] + ' ' + chr(47 + cx), 4);
+			break;
+		}
+		putxy(xco, ywhere + 8);
+	} while (!(cx == nb_lig));
+	test0 = true;
+	show_mouse();
+}
+
+void menu_up(integer xx) {
+	/* debug('menu_up'); */
+	if (test0) {
+		charecr(10, succ(byte, don[xx][2]) << 1);
+		test0 = false;
+	}
+}
+
+void erase_menu() {
+	/* debug('erase_menu'); */
+	active_menu = false;
+	clic = false;
+	menu_up(msg3);
+}
+
+void mdn() {
+	integer x, y, c, a, ix;
+	boolean tes;
+
+	/* debug('mdn'); */
+	if (! active_menu)  return;
+	x = x_s;
+	y = y_s;
+	if (! clic) {
+		if ((x == xprec) &&
+		        (y == yprec))  return;
+		else {
+			xprec = x;
+			yprec = y;
+		}
+		tes = (y < 11) && ((set::of(range(28 * res, 28 * res + 24), range(76 * res, 76 * res + 24), eos).has(x))
+		                   || ((x > 124 * res) && (x < 124 * res + 24))
+		                   || ((x > 172 * res) && (x < 172 * res + 24))
+		                   || ((x > 220 * res) && (x < 220 * res + 24))
+		                   || ((x > 268 * res) && (x < 268 * res + 24)));
+		if (tes) {
+			if (x < 76 * res)  ix = invent;
+			else if (x < 124 * res)  ix = depla;
+			else if (x < 172 * res)  ix = action;
+			else if (x < 220 * res)  ix = saction;
+			else if (x < 268 * res)  ix = discut;
+			else ix = fichier;
+			if ((ix != msg3) || (! test0))
+				if (!((ix == fichier) && (set::of(sauve, charge, eos).has(msg3)))) {
+					menu_up(msg3);
+					menu_down(ix);
+					msg3 = ix;
+					msg4 = no_choice;
+				}
+		} else { /* Not in the MenuTitle line */
+			if ((y > 11) && (test0))  util(x, y);
+		}
+	} else        /* il y a eu 'clic' */
+		if ((msg3 == fichier) && (msg4 != no_choice)) {
+			clic = false;
+			menu_up(msg3);
+			if (lo(msg4) == 1)  msg3 = 7;
+			else msg3 = 8;
+			menu_down(msg3);
+		} else { /*  il y a eu clic sur un autre menu  */
+			choisi = (test0) && (msg4 != no_choice);
+			menu_up(msg3);
+			msg[4] = msg4;
+			msg[3] = msg3;
+			msg3 = no_choice;
+			msg4 = no_choice;
+			clic = false;
+		}
+}
+
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
deleted file mode 100644
index 691ef7c..0000000
--- a/engines/mortevielle/menu.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/* NIVEAU 14*/
-
-/* overlay */ void menut(integer no, str30 nom) {
-	byte h, l;
-	str30 s;
-
-
-	/* debug('menut'); */
-	h = hi(no);
-	l = lo(no);
-	s = nom;
-	if (! tesok) {
-		clrscr;
-		exit(0);
-	}
-	while (length(s) < 30)  s = s + ' ';
-	switch (h) {
-	case invent  :
-		if (l != 7)  inv[l] = string(' ') + s;
-		break;
-	case depla   :
-		dep[l] = s;
-		break;
-	case action  :
-		act[l] = s;
-		break;
-	case saction :
-		self_[l] = s;
-		break;
-	case discut  :
-		dis[l] = s;
-		break;
-	}
-}
-
-/* overlay */ void menu_disable(integer no) {
-	byte h, l;
-
-	/* debug('menu_disable'); */
-	h = hi(no);
-	l = lo(no);
-	switch (h) {
-	case invent : {
-		if (l > 6)  {
-			inv[l][1] = '<';
-			inv[l][22] = '>';
-		} else inv[l][1] = '*';
-	}
-	break;
-	case depla :
-		dep[l][1] = '*';
-		break;
-	case action :
-		act[l][1] = '*';
-		break;
-	case saction :
-		self_[l][1] = '*';
-		break;
-	case discut :
-		dis[l][1] = '*';
-		break;
-	}
-}
-
-/* overlay */ void menu_enable(integer no) {
-	byte h, l;
-
-	/* debug('menu_disable'); */
-	h = hi(no);
-	l = lo(no);
-	switch (h) {
-	case invent : {
-		inv[l][1] = ' ';
-		inv[l][22] = ' ';
-	}
-	break;
-	case depla :
-		dep[l][1] = ' ';
-		break;
-	case action :
-		act[l][1] = ' ';
-		break;
-	case saction : {
-		self_[l][1] = ' ';
-		self_[l][1] = ' ';
-	}
-	break;
-	case discut :
-		dis[l][1] = ' ';
-		break;
-	}
-}
-
-void menu_aff() {
-	integer ind_tabl, k, col;
-	char c;
-	integer pt, x, y, color, msk,
-	        num_letr;
-
-	/* debug('menu_aff'); */
-	hide_mouse();
-	/*if not tesok then
-	   begin
-	     clrscr;
-	     halt;
-	   end;*/
-	box(7, gd, 0, 0, 639, 10, 255);
-	col = 28 * res;
-	if (gd == cga)  color = 1;
-	else color = 9;
-	num_letr = 0;
-	do {       /* lettre par lettre */
-		num_letr = num_letr + 1;
-		ind_tabl = 0;
-		y = 1;
-		do {      /* colonne par colonne */
-			k = 0;
-			x = col;
-			do {     /* ligne par ligne */
-				msk = 0x80;
-				for (pt = 0; pt <= 7; pt ++) {
-					if ((lettres[num_letr][ind_tabl] & msk) != 0) {
-						putpix(gd, x + 1, y + 1, 0);
-						putpix(gd, x, y + 1, 0);
-						putpix(gd, x, y, color);
-					}
-					msk = (cardinal)msk >> 1;
-					x = x + 1;
-				}
-				ind_tabl = succ(integer, ind_tabl);
-				k = succ(integer, k);
-			} while (!(k == 3));
-			y = y + 1;
-		} while (!(y == 9));
-		col = col + 48 * res;
-	} while (!(num_letr == 6));
-	show_mouse();
-}
-
-
-void draw_menu() {
-	/* debug('draw_menu'); */
-	menu_aff();
-	active_menu = true;
-	msg4 = no_choice;
-	msg3 = no_choice;
-	choisi = false;
-	clic = false;
-	test0 = false;
-}
-
-void invers(integer ix) {
-	varying_string<23> s;
-
-	/* debug('invers'); */
-	if (msg4 == no_choice)  return;
-	putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
-	switch (msg3) {
-	case 1 :
-		s = inv[lo(msg4)];
-		break;
-	case 2 :
-		s = dep[lo(msg4)];
-		break;
-	case 3 :
-		s = act[lo(msg4)];
-		break;
-	case 4 :
-		s = self_[lo(msg4)];
-		break;
-	case 5 :
-		s = dis[lo(msg4)];
-		break;
-	case 6 :
-		s = fic[lo(msg4)];
-		break;
-	case 7 :
-		s = fic[1] + ' ' + chr(48 + lo(msg4));
-		break;
-	case 8 :
-		if (lo(msg4) == 1)  s = recom;
-		else s = fic[2] + ' ' + chr(47 + lo(msg4));
-		break;
-	}
-	if ((s[1] != '*') && (s[1] != '<'))  writeg(s, ix);
-	else msg4 = no_choice;
-}
-
-void util(integer x, integer y) {
-	integer ymx, dxcar, xmn, xmx, ix;
-
-	/* debug('util'); */
-	ymx = (don[msg3][4] << 3) + 16;
-	dxcar = don[msg3][3];
-	xmn = (don[msg3][1] << 2) * res;
-	if (res == 1)  ix = 5;
-	else ix = 3;
-	xmx = dxcar * ix * res + xmn + 2;
-	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = pred(integer, (cardinal)y >> 3) + (msg3 << 8);
-		if (ix != msg4) {
-			invers(1);
-			msg4 = ix;
-			invers(0);
-		}
-	} else if (msg4 != no_choice) {
-		invers(1);
-		msg4 = no_choice;
-	}
-}
-
-void menu_down(integer ii) {
-	integer cx, xcc;
-	integer xco, nb_lig;
-
-	/* debug('menu_down'); */
-	xco = don[ii][1];
-	nb_lig = don[ii][4];
-	hide_mouse();
-	sauvecr(10, succ(byte, don[ii][2]) << 1);
-	xco = xco << 3;
-	if (res == 1)  cx = 10;
-	else cx = 6;
-	xcc = xco + (don[ii][3] * cx) + 6;
-	box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
-	box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
-	box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
-	putxy(xco, 16);
-	cx = 0;
-	do {
-		cx = succ(integer, cx);
-		switch (ii) {
-		case 1 :
-			if (inv[cx][1] != '*')  writeg(inv[cx], 4);
-			break;
-		case 2 :
-			if (dep[cx][1] != '*')  writeg(dep[cx], 4);
-			break;
-		case 3 :
-			if (act[cx][1] != '*')  writeg(act[cx], 4);
-			break;
-		case 4 :
-			if (self_[cx][1] != '*')  writeg(self_[cx], 4);
-			break;
-		case 5 :
-			if (dis[cx][1] != '*')  writeg(dis[cx], 4);
-			break;
-		case 6 :
-			writeg(fic[cx], 4);
-			break;
-		case 7 :
-			writeg(fic[1] + ' ' + chr(48 + cx), 4);
-			break;
-		case 8 :
-			if (cx == 1)  writeg(recom, 4);
-			else writeg(fic[2] + ' ' + chr(47 + cx), 4);
-			break;
-		}
-		putxy(xco, ywhere + 8);
-	} while (!(cx == nb_lig));
-	test0 = true;
-	show_mouse();
-}
-
-void menu_up(integer xx) {
-	/* debug('menu_up'); */
-	if (test0) {
-		charecr(10, succ(byte, don[xx][2]) << 1);
-		test0 = false;
-	}
-}
-
-void erase_menu() {
-	/* debug('erase_menu'); */
-	active_menu = false;
-	clic = false;
-	menu_up(msg3);
-}
-
-void mdn() {
-	integer x, y, c, a, ix;
-	boolean tes;
-
-	/* debug('mdn'); */
-	if (! active_menu)  return;
-	x = x_s;
-	y = y_s;
-	if (! clic) {
-		if ((x == xprec) &&
-		        (y == yprec))  return;
-		else {
-			xprec = x;
-			yprec = y;
-		}
-		tes = (y < 11) && ((set::of(range(28 * res, 28 * res + 24), range(76 * res, 76 * res + 24), eos).has(x))
-		                   || ((x > 124 * res) && (x < 124 * res + 24))
-		                   || ((x > 172 * res) && (x < 172 * res + 24))
-		                   || ((x > 220 * res) && (x < 220 * res + 24))
-		                   || ((x > 268 * res) && (x < 268 * res + 24)));
-		if (tes) {
-			if (x < 76 * res)  ix = invent;
-			else if (x < 124 * res)  ix = depla;
-			else if (x < 172 * res)  ix = action;
-			else if (x < 220 * res)  ix = saction;
-			else if (x < 268 * res)  ix = discut;
-			else ix = fichier;
-			if ((ix != msg3) || (! test0))
-				if (!((ix == fichier) && (set::of(sauve, charge, eos).has(msg3)))) {
-					menu_up(msg3);
-					menu_down(ix);
-					msg3 = ix;
-					msg4 = no_choice;
-				}
-		} else { /* Not in the MenuTitle line */
-			if ((y > 11) && (test0))  util(x, y);
-		}
-	} else        /* il y a eu 'clic' */
-		if ((msg3 == fichier) && (msg4 != no_choice)) {
-			clic = false;
-			menu_up(msg3);
-			if (lo(msg4) == 1)  msg3 = 7;
-			else msg3 = 8;
-			menu_down(msg3);
-		} else { /*  il y a eu clic sur un autre menu  */
-			choisi = (test0) && (msg4 != no_choice);
-			menu_up(msg3);
-			msg[4] = msg4;
-			msg[3] = msg3;
-			msg3 = no_choice;
-			msg4 = no_choice;
-			clic = false;
-		}
-}
-
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
new file mode 100644
index 0000000..fd4e2f5
--- /dev/null
+++ b/engines/mortevielle/mor.cpp
@@ -0,0 +1,1311 @@
+/* Niveau 14 suite */
+const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
+
+
+void testfi() {
+	if (ioresult != 0) {
+		caff = do_alert(err_mess, 1);
+		exit(0);
+	}
+}
+
+
+integer readclock() {
+	registres r;
+	integer s, m, h;
+
+	/* debug('readclock');*/
+	integer readclock_result;
+	r.ax = 0x2c00;
+	intr(0x21, r);
+	{
+		h = (cardinal)r.cx >> 8;
+		m = r.cx % 256;
+		s = (cardinal)r.dx >> 8;
+	}
+	m = m * 60;
+	h = h * 3600;
+	readclock_result = h + m + s;
+	return readclock_result;
+}
+
+void modif(integer &nu) {
+	/* debug('modif'); */
+	if (nu == 26)  nu = 25;
+	if ((nu > 29) && (nu < 36))  nu = nu - 4;
+	if ((nu > 69) && (nu < 78))  nu = nu - 37;
+	if ((nu > 99) && (nu < 194))  nu = nu - 59;
+	if ((nu > 996) && (nu < 1000))  nu = nu - 862;
+	if ((nu > 1500) && (nu < 1507))  nu = nu - 1363;
+	if ((nu > 1507) && (nu < 1513))  nu = nu - 1364;
+	if ((nu > 1999) && (nu < 2002))  nu = nu - 1851;
+	if (nu == 2010)  nu = 151;
+	if ((nu > 2011) && (nu < 2025))  nu = nu - 1860;
+	if (nu == 2026)  nu = 165;
+	if ((nu > 2029) && (nu < 2037))  nu = nu - 1864;
+	if ((nu > 3000) && (nu < 3005))  nu = nu - 2828;
+	if (nu == 4100)  nu = 177;
+	if (nu == 4150)  nu = 178;
+	if ((nu > 4151) && (nu < 4156))  nu = nu - 3973;
+	if (nu == 4157)  nu = 183;
+	if ((nu == 4160) || (nu == 4161))  nu = nu - 3976;
+}
+
+
+void dessine(integer ad, integer x, integer y) {
+	/* debug('dessine'); */
+	hide_mouse();
+	writepal(numpal);
+	pictout(ad, 0, x, y);
+	show_mouse();
+}
+
+void dessine_rouleau() {
+	/* debug('dessine_rouleau'); */
+	writepal(89);
+	if (gd == her) {
+		mem[0x7000 + 14] = 15;
+	}
+	hide_mouse();
+	pictout(0x73a2, 0, 0, 0);
+	show_mouse();
+}
+
+
+void text_color(integer c) {
+	color_txt = c;
+}
+
+/* NIVEAU 13 */
+
+
+void text1(integer x, integer y, integer nb, integer m) {
+	phrase st;
+	integer tay;
+	integer co;
+
+
+	/* debug('text'); */
+	if (res == 1)  co = 10;
+	else co = 6;
+	deline(m, st, tay);
+	if ((y == 182) && (tay * co > nb * 6))  y = 176;
+	afftex(st, x, y, nb, 20, color_txt);
+}
+
+void initouv() {
+	integer cx;
+
+	/* debug('initouv'); */
+	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+}
+
+void ecrf1() {
+	boite(0, 11, 512, 163, 15);           /* grand dessin */
+}
+
+void clsf1() {
+	integer i, j;
+
+	/* debug('clsf1'); */
+	hide_mouse();
+	box(0, gd, 0, 11, 514, 175, 255);
+	/* if Gd=ams then port[$3DD]:=15;
+	 case Gd of
+	         ams,
+	         cga : begin
+	                 for j:=0 to 63 do
+	                    begin
+	                      for i:=6 to 86 do
+	                         begin
+	                           mem[$B800:i*80+j]:=0;
+	                           mem[$Ba00:i*80+j]:=0;
+	                         end;
+	                      mem[$b800:6960+j]:=0;
+	                      mem[$ba00:400+j]:=0;
+	                    end;
+	               end;
+	         ega : begin
+	                 port[$3C4]:= 2;
+	                 port[$3C5]:= 15;
+	                 port[$3CE]:= 8;
+	                 port[$3CF]:= 255;
+	                 for j:=0 to 63 do
+	                    for i:=11 to 174 do
+	                       mem[$A000:i*80+j]:=0;
+	               end;
+	         tan : begin
+	                 for j:=0 to 128 do
+	                    begin
+	                      for i:=3 to 43 do
+	                         begin
+	                           mem[$B800:i*160+j]:=0;
+	                           mem[$Ba00:i*160+j]:=0;
+	                           mem[$bc00:i*160+j]:=0;
+	                           if i<>43 then mem[$be00:i*160+j]:=0;
+	                         end;
+	                      mem[$be00:320+j]:=0;
+	                    end;
+	               end;
+	 end;
+	 droite(256*res,11,256*res,175,0);*/
+	show_mouse();
+}
+
+void clsf2() {
+	integer i, j;
+
+	/* debug('clsf2'); */
+	hide_mouse();
+	if (f2_all) {
+		box(0, gd, 1, 176, 633, 199, 255);
+		boite(0, 175, 634, 24, 15);
+		f2_all = false;
+	} else {
+		box(0, gd, 1, 176, 633, 190, 255);
+		boite(0, 175, 634, 15, 15);
+	}
+	show_mouse();
+}
+
+void ecrf2() {
+	/* debug('ecrf2'); */
+	text_color(5);
+	/*boite(0,175,630,15,15);*/
+}
+
+void ecr2(str255 str_) {
+	integer tab;
+	integer tlig;
+
+	/* debug('ecr2 : '+str_);*/
+	if (res == 1)  tab = 10;
+	else tab = 6;
+	putxy(8, 177);
+	tlig = 59 + pred(integer, res) * 36;
+	if (length(str_) < tlig)  writeg(str_, 5);
+	else if (length(str_) < (tlig << 1)) {
+		putxy(8, 176);
+		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		putxy(8, 182);
+		writeg(copy(str_, tlig, tlig << 1), 5);
+	} else {
+		f2_all = true;
+		clsf2();
+		putxy(8, 176);
+		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		putxy(8, 182);
+		writeg(copy(str_, tlig, pred(integer, tlig << 1)), 5);
+		putxy(8, 190);
+		writeg(copy(str_, tlig << 1, tlig * 3), 5);
+	}
+}
+
+void clsf3() {
+	integer i, j;
+
+	/* debug('clsf3'); */
+	hide_mouse();
+	box(0, gd, 1, 192, 633, 199, 255);
+	boite(0, 191, 634, 8, 15);
+	show_mouse();
+}
+
+void ecr3(str255 text) {
+	/* debug('ecr3 : '+text);*/
+	clsf3();
+	putxy(8, 192);
+	writeg(text, 5);
+}
+
+void ecrf6() {
+	/* debug('ecrf6'); */
+	text_color(5);
+	boite(62, 33, 363, 80, 15);
+}
+
+void ecrf7() {
+	text_color(4);
+	/* draw_mode(2);
+	 text_height(4*res);
+	 text_style(normal);*/
+}
+
+void clsf10() {
+	integer co, cod;
+	varying_string<8> st;
+
+	/* debug('clsf10'); */
+	hide_mouse();
+	if (res == 1) {
+		co = 634;
+		cod = 534;
+	} else {
+		co = 600;
+		cod = 544;
+	}
+	box(15, gd, cod, 93, co, 98, 255);
+	if (s.conf < 33)  st = "Cool";
+	else if (s.conf < 66)  st = " Lourde ";
+	else if (s.conf > 65)  st = "Malsaine";
+	if (res == 1)  co = 10;
+	else co = 6;
+	co = 574 - ((cardinal)co * length(st) >> 1);
+	putxy(co, 92);
+	writeg(st, 4);
+	if (res == 1)  co = 620;
+	else co = 584;
+	box(15, gd, 560, 24, co, 86, 255);
+	/* rempli(69,12,32,5,255);*/
+	show_mouse();
+}
+
+void stop() {
+	clrscr;
+	hirs();
+	gd = ams;
+	hirs();
+	exit(0);
+}
+
+void paint_rect(integer x, integer y, integer dx, integer dy) {
+	integer co;
+
+	/* debug('paint_rect'); */
+	if (gd == cga)  co = 3;
+	else co = 11;
+	box(co, gd, x, y, x + dx, y + dy, 255);
+}
+
+integer hazard(integer min, integer max) {
+	integer ha1;
+	real ha2;
+
+	/* debug('hazard'); */
+	integer hazard_result;
+	ha2 = Random();
+	ha1 = trunc(ha2 * (max - min));
+	hazard_result = min + ha1;
+	return hazard_result;
+}
+
+void calch(integer &j, integer &h, integer &m) {
+	integer th, nh;
+
+	/* debug('calch');*/
+	nh = readclock();
+	th = jh + ((nh - mh) / t);
+	m = ((th % 2) + vm) * 30;
+	h = ((cardinal)th >> 1) + vh;
+	if (m == 60) {
+		m = 0;
+		h = h + 1;
+	}
+	j = (h / 24) + vj;
+	h = h - ((j - vj) * 24);
+}
+
+void conv(integer x, integer &y) {
+	integer cx;
+
+	/* debug('conv'); */
+	cx = 1;
+	y = 128;
+	while (cx < x) {
+		y = (cardinal)y >> 1;
+		cx = succ(integer, cx);
+	}
+}
+
+/* NIVEAU 12 */
+void okpas() {
+	tesok = true;
+}
+
+void modobj(integer m) {
+	phrase str_;
+	str30 strp;
+	integer i, tay;
+
+	/* debug('modobj'); */
+	strp = ' ';
+	if (m != 500) {
+		deline(m - 501 + c_st41, str_, tay);
+		strp = delig;
+	}
+	menut(invt[8], strp);
+	menu_disable(invt[8]);
+}
+
+void modobj2(integer m, boolean t1, boolean t2) {
+	phrase str_;
+	str30 strp;
+	integer i, tay;
+
+	/* debug('modobj'); */
+	strp = ' ';
+	if (t1 || t2)  okpas();
+	else tesok = false;;
+	if (m != 500) {
+		deline(m - 501 + c_st41, str_, tay);
+		strp = delig;
+	}
+	menut(invt[8], strp);
+	menu_disable(invt[8]);
+}
+
+
+void repon(integer f, integer m) {
+	str255 str_;
+	varying_string<40> str1;
+	phrase st;
+	text1 fic;
+	integer i, xco, dx, caspe, tay;
+
+	/* debug('repon fenetre nø'+chr(f+48));*/
+	if ((m > 499) && (m < 563)) {
+		deline(m - 501 + c_st41, st, tay);
+		if (tay > ((58 + pred(integer, res) * 37) << 1))  f2_all = true;
+		else f2_all = false;
+		clsf2();
+		afftex(st, 8, 176, 85, 3, 5);
+	} else {
+		modif(m);
+		if (f == 8)  f = 2;
+		if (f == 1)  f = 6;
+		if (f == 2) {
+			clsf2();
+			ecrf2();
+			text1(8, 182, 103, m);
+			if ((m == 68) || (m == 69))  s.teauto[40] = '*';
+			if ((m == 104) && (caff == 14)) {
+				s.teauto[36] = '*';
+				if (s.teauto[39] == '*') {
+					s.pourc[3] = '*';
+					s.teauto[38] = '*';
+				}
+			}
+		}
+		if (set::of(6, 9, eos).has(f)) {
+			deline(m, st, tay);
+			if (f == 6)  i = 4;
+			else i = 5;
+			afftex(st, 80, 40, 60, 25, i);
+			if (m == 180)  s.pourc[6] = '*';
+			if (m == 179)  s.pourc[10] = '*';
+		}
+		if (f == 7) {         /* messint */
+			ecrf7();
+			deline(m, st, tay);
+			if (res == 1) {
+				xco = 252 - tay * 5;
+				caspe = 100;
+				dx = 80;
+			} else {
+				xco = 252 - tay * 3;
+				caspe = 144;
+				dx = 50;
+			}
+			if (tay < 40)  afftex(st, xco, 86, dx, 3, 5);
+			else afftex(st, caspe, 86, dx, 3, 5);
+		}
+	}
+}
+
+void f3f8() {
+	integer co;
+
+	if (res == 1)  co = 107;
+	else co = 64;
+	putxy(3, 44);
+	writeg(f3, 5);
+	ywhere = 51;
+	writeg(f8, 5);
+	boite(0, 42, co, 16, 7);
+}
+
+void t5(integer cx) {
+	/* debug('t5'); */
+	if (cx == 10)  blo = false;
+	if (cx != 1) {
+		bh1 = false;
+		bf1 = false;
+	}
+	if (cx != 2)  bh2 = false;
+	if (cx != 4) {
+		bh4 = false;
+		bf4 = false;
+	}
+	if (cx != 5)  bh5 = false;
+	if (cx != 6)  bh6 = false;
+	if (cx != 8)  bh8 = false;
+	if (cx != 3)  bt3 = false;
+	if (cx != 7)  bt7 = false;
+	if (cx != 9)  bh9 = false;
+}
+
+void affper(integer per) {
+	integer cx;
+
+	/* debug('affper'); */
+	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
+	clsf10();
+	if ((per & 128) == 128) {
+		putxy(560, 24);
+		writeg("LEO", 4);
+		menu_enable(disc[1]);
+	}
+	if ((per & 64) == 64) {
+		putxy(560, 32);
+		writeg("PAT", 4);
+		menu_enable(disc[2]);
+	}
+	if ((per & 32) == 32) {
+		putxy(560, 40);
+		writeg("GUY", 4);
+		menu_enable(disc[3]);
+	}
+	if ((per & 16) == 16) {
+		putxy(560, 48);
+		writeg("EVA", 4);
+		menu_enable(disc[4]);
+	}
+	if ((per & 8) == 8) {
+		putxy(560, 56);
+		writeg("BOB", 4);
+		menu_enable(disc[5]);
+	}
+	if ((per & 4) == 4) {
+		putxy(560, 64);
+		writeg("LUC", 4);
+		menu_enable(disc[6]);
+	}
+	if ((per & 2) == 2) {
+		putxy(560, 72);
+		writeg("IDA", 4);
+		menu_enable(disc[7]);
+	}
+	if ((per & 1) == 1) {
+		putxy(560, 80);
+		writeg("MAX", 4);
+		menu_enable(disc[8]);
+	}
+	ipers = per;
+}
+
+/* overlay */ void choix(integer min, integer max, integer &per) {
+	boolean i;
+	integer haz, cx, cy, cz;
+	long_integer per2, cz2;
+
+	/* debug('o0 choix'); */
+	haz = hazard(min, max);
+	if (haz > 4) {
+		haz = 8 - haz;
+		i = true;
+	} else i = false;
+	cx = 0;
+	per = 0;
+	while (cx < haz) {
+		cy = hazard(1, 8);
+		conv(cy, cz);
+		if ((per & cz) != cz) {
+			cx = cx + 1;
+			per = (per | cz);
+		}
+	}
+	if (i)  per = 255 - per;
+	i = false;
+}
+
+/* overlay */ void cpl1(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl1'); */
+	calch(j, h, m);
+	if ((h > 7) || (h < 11))  p = 25;
+	if ((h > 10) && (h < 14))  p = 35;
+	if ((h > 13) && (h < 16))  p = 50;
+	if ((h > 15) && (h < 18))  p = 5;
+	if ((h > 17) && (h < 22))  p = 35;
+	if ((h > 21) && (h < 24))  p = 50;
+	if ((h >= 0) && (h < 8))  p = 70;
+	mdn();
+}
+
+/* overlay */ void cpl2(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl2'); */
+	calch(j, h, m);
+	if ((h > 7) && (h < 11))  p = -2;
+	if (h == 11)  p = 100;
+	if ((h > 11) && (h < 23))  p = 10;
+	if (h == 23)  p = 20;
+	if ((h >= 0) && (h < 8))  p = 50;
+}
+
+/* overlay */ void cpl3(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl3'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))  p = 34;
+	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
+}
+
+/* overlay */ void cpl5(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl5'); */
+	calch(j, h, m);
+	if ((h > 6) && (h < 10))  p = 0;
+	if (h == 10)  p = 100;
+	if ((h > 10) && (h < 24))  p = 15;
+	if ((h >= 0) && (h < 7))  p = 50;
+}
+
+/* overlay */ void cpl6(integer &p) {
+	integer j, h, m;
+
+	/* debug('o0 cpl6'); */
+	calch(j, h, m);
+	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))  p = -2;
+	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))  p = 35;
+	if (h == 17)  p = 100;
+	if ((h >= 0) && (h < 8))  p = 60;
+}
+
+void person() {
+	const char m1[] = "Vous";
+	const char m2[] = "ˆtes";
+	const char m3[] = "SEUL";
+	integer cf;
+	str255 str_;
+
+	/* debug('person'); */
+	for (cf = 1; cf <= 8; cf ++) menu_disable(disc[cf]);
+	clsf10();
+	putxy(560, 30);
+	writeg(m1, 4);
+	putxy(560, 50);
+	writeg(m2, 4);
+	putxy(560, 70);
+	writeg(m3, 4);
+	ipers = 0;
+}
+
+void chlm(integer &per) {
+	/* debug('chlm'); */
+	per = hazard(1, 2);
+	if (per == 2)  per = 128;
+}
+
+void pendule() {
+	const matrix<1, 2, 1, 12, integer> cv
+	= {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
+			{{ -5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}}
+		}
+	};
+	const integer x = 580;
+	const integer y = 123;
+	const integer rg = 9;
+	integer h, co;
+
+
+	/* debug('pendule'); */
+	hide_mouse();
+	/*paint_rect(572,114,18,20);
+	paint_rect(577,114,6,20);*/
+	paint_rect(570, 118, 20, 10);
+	paint_rect(578, 114, 6, 18);
+	if (set::of(cga, her, eos).has(gd))  co = 0;
+	else co = 1;
+	if (min == 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y - rg), co);
+	else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y + rg), co);
+	h = heu;
+	if (h > 12)  h = h - 12;
+	if (h == 0)  h = 12;
+	droite(((cardinal)x >> 1)*res, y, ((cardinal)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	show_mouse();
+	putxy(568, 154);
+	if (heu > 11)  writeg("PM ", 1);
+	else writeg("AM ", 1);
+	putxy(550, 160);
+	if (set::of(range(0, 8), eos).has(jou))  writeg(string(chr(jou + 49)) + "& jour", 1);
+}
+
+/*************
+ * NIVEAU 11 *
+ *************/
+
+void debloc(integer l) {
+	/* debug('debloc'); */
+	num = 0;
+	x = 0;
+	y = 0;
+	if ((l != 26) && (l != 15))  t5(l);
+	mpers = ipers;
+}
+
+/* overlay */ void cpl10(integer &p, integer &h) {
+	integer j, m;
+
+	/* debug('o1 cpl10'); */
+	calch(j, h, m);
+	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14))
+	        || ((h > 18) && (h < 21)))  p = 100;
+	if ((h == 11) || ((h > 20) && (h < 24)))  p = 45;
+	if (((h > 13) && (h < 17)) || (h == 18))  p = 35;
+	if (h == 17)  p = 60;
+	if ((h >= 0) && (h < 8))  p = 5;
+}
+
+/* overlay */ void cpl11(integer &p, integer &h) {
+	integer j, m;
+
+	/* debug('o1 cpl11'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))  p = 25;
+	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))  p = 5;
+	if ((h > 13) && (h < 17))  p = 55;
+	if ((h > 16) && (h < 19))  p = 45;
+	if ((h >= 0) && (h < 9))  p = 0;
+}
+
+/* overlay */ void cpl12(integer &p) {
+	integer j, h, m;
+
+	/* debug('o1 cpl12'); */
+	calch(j, h, m);
+	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))  p = 55;
+	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))  p = 25;
+	if ((h >= 0) && (h < 5))  p = 0;
+	if ((h > 4) && (h < 9))  p = 15;
+}
+
+/* overlay */ void cpl13(integer &p) {
+	/* debug('o1 cpl13'); */
+	p = 0;
+}
+
+/* overlay */ void cpl15(integer &p) {
+	integer j, h, m;
+
+	/* debug('o1 cpl15'); */
+	calch(j, h, m);
+	if ((h > 7) && (h < 12))  p = 25;
+	if ((h > 11) && (h < 14))  p = 0;
+	if ((h > 13) && (h < 18))  p = 10;
+	if ((h > 17) && (h < 20))  p = 55;
+	if ((h > 19) && (h < 22))  p = 5;
+	if ((h > 21) && (h < 24))  p = 15;
+	if ((h >= 0) && (h < 8))  p = -15;
+}
+
+/* overlay */ void cpl20(integer &p, integer &h) {
+	integer j, m;
+
+	/* debug('o1 cpl20'); */
+	calch(j, h, m);
+	if (h == 10)  p = 65;
+	if ((h > 10) && (h < 21))  p = 5;
+	if ((h > 20) && (h < 24))  p = -15;
+	if ((h >= 0) && (h < 5))  p = -300;
+	if ((h > 4) && (h < 10))  p = -5;
+}
+
+/* overlay */ void quelq1(integer l) {
+	integer per;
+
+	/* debug('o1 quelq1'); */
+	per = hazard(1, 2);
+	if (l == 1)
+		if (per == 1)  bh1 = true;
+		else bf1 = true;
+	if (l == 4)
+		if (per == 1)  bh4 = true;
+		else bf4 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq2() {
+	/* debug('o1 quelq2'); */
+	if (li == 2)  bh2 = true;
+	else bh9 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq5() {
+	/* debug('o1 quelq5'); */
+	bh5 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq6(integer l) {
+	integer per;
+
+	/* debug('o1 quelq6'); */
+	if (l == 6)  bh6 = true;
+	if (l == 8)  bh8 = true;
+	ipers = 10;
+}
+
+/* overlay */ void quelq10(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq10'); */
+	if ((h >= 0) && (h < 8))  chlm(per);
+	else {
+		if ((h > 7) && (h < 10)) {
+			min = 5;
+			max = 7;
+		}
+		if ((h > 9) && (h < 12)) {
+			min = 1;
+			max = 4;
+		}
+		if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
+			min = 6;
+			max = 8;
+		}
+		if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
+			min = 1;
+			max = 5;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+/* overlay */ void quelq11(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq11'); */
+	if ((h >= 0) && (h < 8))  chlm(per);
+	else {
+		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
+			min = 1;
+			max = 3;
+		}
+		if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
+			min = 1;
+			max = 4;
+		}
+		if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
+			min = 1;
+			max = 2;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+/* overlay */ void quelq12(integer &per) {
+	/* debug('o1 quelq12'); */
+	chlm(per);
+	affper(per);
+}
+
+/* overlay */ void quelq15(integer &per) {
+	integer cx;
+	boolean test;
+
+
+	/* debug('o1 quelq15'); */
+	per = 0;
+	if (per == 0) {
+		do {
+			cx = hazard(1, 8);
+			test = (((cx == 1) && (bh2 || bh9)) ||
+			        ((cx == 2) && bh8) ||
+			        ((cx == 3) && bh4) ||
+			        ((cx == 4) && bf4) ||
+			        ((cx == 5) && bh6) ||
+			        ((cx == 6) && bh1) ||
+			        ((cx == 7) && bf1) ||
+			        ((cx == 8) && bh5));
+		} while (!(! test));
+		conv(cx, per);
+		affper(per);
+	}
+}
+
+/* overlay */ void quelq20(integer h, integer &per) {
+	integer min, max;
+
+	/* debug('o1 quelq20'); */
+	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
+	else {
+		if ((h > 9) && (h < 12)) {
+			min = 3;
+			max = 7;
+		}
+		if ((h > 11) && (h < 18)) {
+			min = 1;
+			max = 2;
+		}
+		if (h == 18) {
+			min = 2;
+			max = 4;
+		}
+		choix(min, max, per);
+	}
+	affper(per);
+}
+
+
+/* overlay */void frap() {
+	integer j, h, m, haz;
+
+	/* debug('o1 frap'); */
+	calch(j, h, m);
+	if ((h >= 0) && (h < 8))  crep = 190;
+	else {
+		haz = hazard(1, 100);
+		if (haz > 70)  crep = 190;
+		else crep = 147;
+	}
+}
+
+/* overlay */ void nouvp(integer l, integer &p) {
+	/* debug('o1 nouvp'); */
+	p = 0;
+	if (l == 1) {
+		if (bh1)  p = 4;
+		if (bf1)  p = 2;
+	}
+	if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))  p = 128;
+	if (l == 4) {
+		if (bh4)  p = 32;
+		if (bf4)  p = 16;
+	}
+	if ((l == 5) && (bh5))  p = 1;
+	if ((l == 6) && (bh6))  p = 8;
+	if ((l == 8) && (bh8))  p = 64;
+	if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))  p = 9;
+	if (p != 9)  affper(p);
+}
+
+
+
+/* overlay */ void tip(integer ip, integer &cx) {
+	/* debug('o1 tip'); */
+	if (ip == 128)  cx = 1;
+	else if (ip == 64)   cx = 2;
+	else if (ip == 32)   cx = 3;
+	else if (ip == 16)   cx = 4;
+	else if (ip == 8)    cx = 5;
+	else if (ip == 4)    cx = 6;
+	else if (ip == 2)    cx = 7;
+	else if (ip == 1)    cx = 8;
+}
+
+
+/* overlay */ void ecfren(integer &p, integer &haz, integer cf, integer l) {
+	/* debug('o1 ecfren'); */
+	if (l == 0)  person();
+	p = -500;
+	haz = 0;
+	if (((l == 1) && (! bh1) && (! bf1))
+	        || ((l == 4) && (! bh4) && (! bf4)))  cpl1(p);
+	if ((l == 2) && (! bh2) && (! bh9))  cpl2(p);
+	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))  cpl3(p);
+	if ((l == 5) && (! bh5))  cpl5(p);
+	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))  cpl6(p);
+	if ((l == 9) && (! bh9) && (! bh2))  p = 10;
+	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))  p = -400;
+	if (p != -500) {
+		p = p + cf;
+		haz = hazard(1, 100);
+	}
+}
+
+/* overlay */ void becfren(integer l) {
+	integer haz;
+
+	/* debug('o1 becfren'); */
+	if ((l == 1) || (l == 4)) {
+		haz = hazard(1, 2);
+		if (l == 1)
+			if (haz == 1)  bh1 = true;
+			else bf1 = true;
+		if (l == 4)
+			if (haz == 1)  bh4 = true;
+			else bf4 = true;
+	}
+	if (l == 2)  bh2 = true;
+	else if (l == 3)  bt3 = true;
+	else if (l == 5)  bh5 = true;
+	else if (l == 6)  bh6 = true;
+	else if (l == 7)  bt7 = true;
+	else if (l == 8)  bh8 = true;
+	else if (l == 9)  bh9 = true;
+}
+
+/* NIVEAU 10 */
+void init_nbrepm() {
+	const array<1, 8, byte> ipm
+	= {{4, 5, 6, 7, 5, 6, 5, 8}};
+	integer i;
+
+	/* debug('init_nbrepm'); */
+	i = 0;
+	do {
+		i = succ(integer, i);
+		nbrepm[i] = ipm[i];
+	} while (!(i == 8));
+}
+
+void phaz(integer &haz, integer &p, integer cf) {
+	/* debug('phaz'); */
+	p = p + cf;
+	haz = hazard(1, 100);
+}
+
+/* overlay */ void inzon() {
+	integer cx;
+
+	/* debug('o2 inzon'); */
+	copcha();
+	{
+		s.ipre  = false;
+		s.derobj = 0;
+		s.icave = 0;
+		s.iboul = 0;
+		s.ibag  = 0;
+		s.ipuit = 0;
+		s.ivier = 0;
+		s.iloic = 136;
+		s.icryp = 141;
+		s.conf  = hazard(4, 10);
+		s.mlieu = 21;
+		for (cx = 2; cx <= 6; cx ++) s.sjer[cx] = chr(0);
+		s.sjer[1] = chr(113);
+		s.heure = chr(20);
+		for (cx = 1; cx <= 10; cx ++) s.pourc[cx] = ' ';
+		for (cx = 1; cx <= 6; cx ++) s.teauto[cx] = '*';
+		for (cx = 7; cx <= 9; cx ++) s.teauto[cx] = ' ';
+		for (cx = 10; cx <= 28; cx ++) s.teauto[cx] = '*';
+		for (cx = 29; cx <= 42; cx ++) s.teauto[cx] = ' ';
+		s.teauto[33] = '*';
+	}
+	for (cx = 1; cx <= 8; cx ++) nbrep[cx] = 0;
+	init_nbrepm();
+}
+
+/* overlay */ void dprog() {
+	/* debug('o2 dprog'); */
+	li = 21;
+	/* jh:= t_settime(0);*/
+	jh = 0;
+	if (! s.ipre)  blo = true;
+	t = ti1;
+	mh = readclock();
+}
+
+/* overlay */ void pl1(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl1'); */
+	if (((li == 1) && (! bh1) && (! bf1))
+	        || ((li == 4) && (! bh4) && (! bf4))) {
+		cpl1(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq1(li);
+	}
+}
+
+/* overlay */ void pl2(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl2'); */
+	if (! bh2) {
+		cpl2(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq2();
+	}
+}
+
+/* overlay */ void pl5(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl5'); */
+	if (! bh5) {
+		cpl5(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq5();
+	}
+}
+
+/* overlay */ void pl6(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl6'); */
+	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
+		cpl6(p);
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq6(li);
+	}
+}
+
+/* overlayi */ void pl9(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl9'); */
+	if (! bh9) {
+		cf = -10;
+		phaz(haz, p, cf);
+		if (haz > p)  person();
+		else quelq2();
+	}
+}
+
+/* overlayi */ void pl10(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl10'); */
+	cpl10(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq10(h, p);
+}
+
+/* overlay */ void pl11(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl11'); */
+	cpl11(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq11(h, p);
+}
+
+/* overlay */ void pl12(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl12'); */
+	cpl12(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq12(p);
+}
+
+/* overlay */ void pl13(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl13'); */
+	cpl13(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq12(p);
+}
+
+/* overlay */ void pl15(integer cf) {
+	integer p, haz;
+
+	/* debug('o2 pl15'); */
+	cpl15(p);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq15(p);
+}
+
+/* overlay */ void pl20(integer cf) {
+	integer p, h, haz;
+
+	/* debug('o2 pl20'); */
+	cpl20(p, h);
+	phaz(haz, p, cf);
+	if (haz > p)  person();
+	else quelq20(h, p);
+}
+
+/* overlay */ void t11(integer l11, integer &a) {
+	integer p, haz, h;
+
+	/* debug('o2 t11'); */
+	ecfren(p, haz, s.conf, l11);
+	li = l11;
+	if ((l11 > 0) && (l11 < 10))
+		if (p != -500) {
+			if (haz > p) {
+				person();
+				a = 0;
+			} else {
+				becfren(li);
+				nouvp(li, a);
+			}
+		} else nouvp(li, a);
+	if (l11 > 9)
+		if ((l11 > 15) && (l11 != 20) && (l11 != 26))  person();
+		else {
+			if (l11 == 10)  cpl10(p, h);
+			if (l11 == 11)  cpl11(p, h);
+			if (l11 == 12)  cpl12(p);
+			if ((l11 == 13) || (l11 == 14))  cpl13(p);
+			if ((l11 == 15) || (l11 == 26))  cpl15(p);
+			if (l11 == 20)  cpl20(p, h);
+			p = p + s.conf;
+			haz = hazard(1, 100);
+			if (haz > p) {
+				person();
+				a = 0;
+			} else {
+				if (l11 == 10)  quelq10(h, p);
+				if (l11 == 11)  quelq11(h, p);
+				if ((l11 == 12) || (l11 == 13) || (l11 == 14))  quelq12(p);
+				if ((l11 == 15) || (l11 == 26))  quelq15(p);
+				if (l11 == 20)  quelq20(h, p);
+				a = p;
+			}
+		}
+}
+
+/* overlay */ void cavegre()
+
+{
+	integer haz;
+
+	/* debug('cavegre'); */
+	s.conf = s.conf + 2;
+	if (s.conf > 69)  s.conf = s.conf + (s.conf / 10);
+	clsf3();
+	ecrf2();
+	ecr3(m1);
+	haz = (hazard(0, 4)) - 2;
+	parole(2, haz, 1);
+	for (haz = 0; haz <= 3000; haz ++);
+	clsf3();
+	person();
+}
+
+void writetp(str255 s, integer t) {
+	if (res == 2)  writeg(s, t);
+	else writeg(copy(s, 1, 25), t);
+}
+
+void messint(integer nu) {
+	/* debug('messint'); */
+	clsf1();
+	clsf2();
+	clsf3();
+	decomp(0x73a2, 1008);
+	memw[0x7413 + 12] = 80;
+	memw[0x7413 + 14] =  40;
+	writepal(90);
+	afff(gd, 0x73a2, 1008, 0, 0);
+	afff(gd, 0x73a2, 1008, 0, 70);
+	repon(7, nu);
+}
+
+void aniof(integer ouf, integer num) {
+	integer ad, offset;
+	char c;
+
+	/* debug('aniof'); */
+	if ((caff == 7) && ((num == 4) || (num == 5)))  return;
+	if ((caff == 10) && (num == 7))  num = 6;
+	if (caff == 12)  if (num == 3)  num = 4;
+		else if (num == 4)  num = 3;
+	ad = adani;
+	offset = animof(ouf, num);
+	decomp(ad, offset);
+	hide_mouse();
+	afff(gd, ad, offset, 0, 12);
+	ecrf1();
+	show_mouse();
+}
+
+void musique(integer so) {
+	boolean i;
+	integer haz;
+	/* dep: array[1..5] of long_integer;*/
+
+	/* debug('musique'); */
+	if (so == 0) { /*musik(0)*/
+		;
+	} else if ((prebru == 0) && (! s.ipre)) {
+		parole(10, 1, 1);
+		prebru = prebru + 1;
+	} else {
+		i = false;
+		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
+			haz = hazard(1, 3);
+			if (haz == 2) {
+				haz = hazard(2, 4);
+				parole(9, haz, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 20) {
+			haz = hazard(1, 2);
+			if (haz == 1) {
+				parole(8, 1, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 24) {
+			haz = hazard(1, 2);
+			if (haz == 2) {
+				parole(12, 1, 1);
+				i = true;
+			}
+		}
+		if (s.mlieu == 23) {
+			parole(13, 1, 1);
+			i = true;
+		}
+		if (! i) {
+			/* dep[1]:= 1416;
+			 dep[2]:= 1512;
+			 dep[3]:= 1692;
+			 dep[4]:= 1884;
+			 dep[5]:= 2046;
+			 haz:= hazard(1,5);
+			 musik(dep[haz]);*/
+			haz = hazard(1, 17);
+			parole(haz, 1, 2);
+		}
+	}
+}
+
+/* NIVEAU 9 */
+void dessin(integer ad) {
+	integer cx;
+
+	/* debug('dessin'); */
+	if (ad != 0)  dessine(ades, ((ad % 160) * 2), (ad / 160));
+	else {
+		clsf1();
+		if (caff > 99) {
+			dessine(ades, 60, 33);
+			boite(118, 32, 291, 121, 15);         /* cadre moyen */
+		} else if (caff > 69) {
+			dessine(ades, 112, 48);           /* tˆtes */
+			boite(222, 47, 155, 91, 15);
+		} else {
+			dessine(ades, 0, 12);
+			ecrf1();
+			if ((caff < 30) || (caff > 32)) {
+				for (cx = 1; cx <= 6; cx ++)
+					if (ord(touv[cx]) != 0)  aniof(1, ord(touv[cx]));
+				if (caff == 13) {
+					if (s.iboul == 141)  aniof(1, 7);
+					if (s.ibag == 159)  aniof(1, 6);
+				}
+				if ((caff == 14) && (s.icave == 151))  aniof(1, 2);
+				if ((caff == 17) && (s.ivier == 143))  aniof(1, 1);
+				if ((caff == 24) && (s.ipuit != 0))  aniof(1, 1);
+			}
+			if (caff < 26)  musique(1);
+		}
+	}
+}
+
+
+
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
deleted file mode 100644
index fd4e2f5..0000000
--- a/engines/mortevielle/mor.h
+++ /dev/null
@@ -1,1311 +0,0 @@
-/* Niveau 14 suite */
-const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
-
-
-void testfi() {
-	if (ioresult != 0) {
-		caff = do_alert(err_mess, 1);
-		exit(0);
-	}
-}
-
-
-integer readclock() {
-	registres r;
-	integer s, m, h;
-
-	/* debug('readclock');*/
-	integer readclock_result;
-	r.ax = 0x2c00;
-	intr(0x21, r);
-	{
-		h = (cardinal)r.cx >> 8;
-		m = r.cx % 256;
-		s = (cardinal)r.dx >> 8;
-	}
-	m = m * 60;
-	h = h * 3600;
-	readclock_result = h + m + s;
-	return readclock_result;
-}
-
-void modif(integer &nu) {
-	/* debug('modif'); */
-	if (nu == 26)  nu = 25;
-	if ((nu > 29) && (nu < 36))  nu = nu - 4;
-	if ((nu > 69) && (nu < 78))  nu = nu - 37;
-	if ((nu > 99) && (nu < 194))  nu = nu - 59;
-	if ((nu > 996) && (nu < 1000))  nu = nu - 862;
-	if ((nu > 1500) && (nu < 1507))  nu = nu - 1363;
-	if ((nu > 1507) && (nu < 1513))  nu = nu - 1364;
-	if ((nu > 1999) && (nu < 2002))  nu = nu - 1851;
-	if (nu == 2010)  nu = 151;
-	if ((nu > 2011) && (nu < 2025))  nu = nu - 1860;
-	if (nu == 2026)  nu = 165;
-	if ((nu > 2029) && (nu < 2037))  nu = nu - 1864;
-	if ((nu > 3000) && (nu < 3005))  nu = nu - 2828;
-	if (nu == 4100)  nu = 177;
-	if (nu == 4150)  nu = 178;
-	if ((nu > 4151) && (nu < 4156))  nu = nu - 3973;
-	if (nu == 4157)  nu = 183;
-	if ((nu == 4160) || (nu == 4161))  nu = nu - 3976;
-}
-
-
-void dessine(integer ad, integer x, integer y) {
-	/* debug('dessine'); */
-	hide_mouse();
-	writepal(numpal);
-	pictout(ad, 0, x, y);
-	show_mouse();
-}
-
-void dessine_rouleau() {
-	/* debug('dessine_rouleau'); */
-	writepal(89);
-	if (gd == her) {
-		mem[0x7000 + 14] = 15;
-	}
-	hide_mouse();
-	pictout(0x73a2, 0, 0, 0);
-	show_mouse();
-}
-
-
-void text_color(integer c) {
-	color_txt = c;
-}
-
-/* NIVEAU 13 */
-
-
-void text1(integer x, integer y, integer nb, integer m) {
-	phrase st;
-	integer tay;
-	integer co;
-
-
-	/* debug('text'); */
-	if (res == 1)  co = 10;
-	else co = 6;
-	deline(m, st, tay);
-	if ((y == 182) && (tay * co > nb * 6))  y = 176;
-	afftex(st, x, y, nb, 20, color_txt);
-}
-
-void initouv() {
-	integer cx;
-
-	/* debug('initouv'); */
-	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
-}
-
-void ecrf1() {
-	boite(0, 11, 512, 163, 15);           /* grand dessin */
-}
-
-void clsf1() {
-	integer i, j;
-
-	/* debug('clsf1'); */
-	hide_mouse();
-	box(0, gd, 0, 11, 514, 175, 255);
-	/* if Gd=ams then port[$3DD]:=15;
-	 case Gd of
-	         ams,
-	         cga : begin
-	                 for j:=0 to 63 do
-	                    begin
-	                      for i:=6 to 86 do
-	                         begin
-	                           mem[$B800:i*80+j]:=0;
-	                           mem[$Ba00:i*80+j]:=0;
-	                         end;
-	                      mem[$b800:6960+j]:=0;
-	                      mem[$ba00:400+j]:=0;
-	                    end;
-	               end;
-	         ega : begin
-	                 port[$3C4]:= 2;
-	                 port[$3C5]:= 15;
-	                 port[$3CE]:= 8;
-	                 port[$3CF]:= 255;
-	                 for j:=0 to 63 do
-	                    for i:=11 to 174 do
-	                       mem[$A000:i*80+j]:=0;
-	               end;
-	         tan : begin
-	                 for j:=0 to 128 do
-	                    begin
-	                      for i:=3 to 43 do
-	                         begin
-	                           mem[$B800:i*160+j]:=0;
-	                           mem[$Ba00:i*160+j]:=0;
-	                           mem[$bc00:i*160+j]:=0;
-	                           if i<>43 then mem[$be00:i*160+j]:=0;
-	                         end;
-	                      mem[$be00:320+j]:=0;
-	                    end;
-	               end;
-	 end;
-	 droite(256*res,11,256*res,175,0);*/
-	show_mouse();
-}
-
-void clsf2() {
-	integer i, j;
-
-	/* debug('clsf2'); */
-	hide_mouse();
-	if (f2_all) {
-		box(0, gd, 1, 176, 633, 199, 255);
-		boite(0, 175, 634, 24, 15);
-		f2_all = false;
-	} else {
-		box(0, gd, 1, 176, 633, 190, 255);
-		boite(0, 175, 634, 15, 15);
-	}
-	show_mouse();
-}
-
-void ecrf2() {
-	/* debug('ecrf2'); */
-	text_color(5);
-	/*boite(0,175,630,15,15);*/
-}
-
-void ecr2(str255 str_) {
-	integer tab;
-	integer tlig;
-
-	/* debug('ecr2 : '+str_);*/
-	if (res == 1)  tab = 10;
-	else tab = 6;
-	putxy(8, 177);
-	tlig = 59 + pred(integer, res) * 36;
-	if (length(str_) < tlig)  writeg(str_, 5);
-	else if (length(str_) < (tlig << 1)) {
-		putxy(8, 176);
-		writeg(copy(str_, 1, pred(integer, tlig)), 5);
-		putxy(8, 182);
-		writeg(copy(str_, tlig, tlig << 1), 5);
-	} else {
-		f2_all = true;
-		clsf2();
-		putxy(8, 176);
-		writeg(copy(str_, 1, pred(integer, tlig)), 5);
-		putxy(8, 182);
-		writeg(copy(str_, tlig, pred(integer, tlig << 1)), 5);
-		putxy(8, 190);
-		writeg(copy(str_, tlig << 1, tlig * 3), 5);
-	}
-}
-
-void clsf3() {
-	integer i, j;
-
-	/* debug('clsf3'); */
-	hide_mouse();
-	box(0, gd, 1, 192, 633, 199, 255);
-	boite(0, 191, 634, 8, 15);
-	show_mouse();
-}
-
-void ecr3(str255 text) {
-	/* debug('ecr3 : '+text);*/
-	clsf3();
-	putxy(8, 192);
-	writeg(text, 5);
-}
-
-void ecrf6() {
-	/* debug('ecrf6'); */
-	text_color(5);
-	boite(62, 33, 363, 80, 15);
-}
-
-void ecrf7() {
-	text_color(4);
-	/* draw_mode(2);
-	 text_height(4*res);
-	 text_style(normal);*/
-}
-
-void clsf10() {
-	integer co, cod;
-	varying_string<8> st;
-
-	/* debug('clsf10'); */
-	hide_mouse();
-	if (res == 1) {
-		co = 634;
-		cod = 534;
-	} else {
-		co = 600;
-		cod = 544;
-	}
-	box(15, gd, cod, 93, co, 98, 255);
-	if (s.conf < 33)  st = "Cool";
-	else if (s.conf < 66)  st = " Lourde ";
-	else if (s.conf > 65)  st = "Malsaine";
-	if (res == 1)  co = 10;
-	else co = 6;
-	co = 574 - ((cardinal)co * length(st) >> 1);
-	putxy(co, 92);
-	writeg(st, 4);
-	if (res == 1)  co = 620;
-	else co = 584;
-	box(15, gd, 560, 24, co, 86, 255);
-	/* rempli(69,12,32,5,255);*/
-	show_mouse();
-}
-
-void stop() {
-	clrscr;
-	hirs();
-	gd = ams;
-	hirs();
-	exit(0);
-}
-
-void paint_rect(integer x, integer y, integer dx, integer dy) {
-	integer co;
-
-	/* debug('paint_rect'); */
-	if (gd == cga)  co = 3;
-	else co = 11;
-	box(co, gd, x, y, x + dx, y + dy, 255);
-}
-
-integer hazard(integer min, integer max) {
-	integer ha1;
-	real ha2;
-
-	/* debug('hazard'); */
-	integer hazard_result;
-	ha2 = Random();
-	ha1 = trunc(ha2 * (max - min));
-	hazard_result = min + ha1;
-	return hazard_result;
-}
-
-void calch(integer &j, integer &h, integer &m) {
-	integer th, nh;
-
-	/* debug('calch');*/
-	nh = readclock();
-	th = jh + ((nh - mh) / t);
-	m = ((th % 2) + vm) * 30;
-	h = ((cardinal)th >> 1) + vh;
-	if (m == 60) {
-		m = 0;
-		h = h + 1;
-	}
-	j = (h / 24) + vj;
-	h = h - ((j - vj) * 24);
-}
-
-void conv(integer x, integer &y) {
-	integer cx;
-
-	/* debug('conv'); */
-	cx = 1;
-	y = 128;
-	while (cx < x) {
-		y = (cardinal)y >> 1;
-		cx = succ(integer, cx);
-	}
-}
-
-/* NIVEAU 12 */
-void okpas() {
-	tesok = true;
-}
-
-void modobj(integer m) {
-	phrase str_;
-	str30 strp;
-	integer i, tay;
-
-	/* debug('modobj'); */
-	strp = ' ';
-	if (m != 500) {
-		deline(m - 501 + c_st41, str_, tay);
-		strp = delig;
-	}
-	menut(invt[8], strp);
-	menu_disable(invt[8]);
-}
-
-void modobj2(integer m, boolean t1, boolean t2) {
-	phrase str_;
-	str30 strp;
-	integer i, tay;
-
-	/* debug('modobj'); */
-	strp = ' ';
-	if (t1 || t2)  okpas();
-	else tesok = false;;
-	if (m != 500) {
-		deline(m - 501 + c_st41, str_, tay);
-		strp = delig;
-	}
-	menut(invt[8], strp);
-	menu_disable(invt[8]);
-}
-
-
-void repon(integer f, integer m) {
-	str255 str_;
-	varying_string<40> str1;
-	phrase st;
-	text1 fic;
-	integer i, xco, dx, caspe, tay;
-
-	/* debug('repon fenetre nø'+chr(f+48));*/
-	if ((m > 499) && (m < 563)) {
-		deline(m - 501 + c_st41, st, tay);
-		if (tay > ((58 + pred(integer, res) * 37) << 1))  f2_all = true;
-		else f2_all = false;
-		clsf2();
-		afftex(st, 8, 176, 85, 3, 5);
-	} else {
-		modif(m);
-		if (f == 8)  f = 2;
-		if (f == 1)  f = 6;
-		if (f == 2) {
-			clsf2();
-			ecrf2();
-			text1(8, 182, 103, m);
-			if ((m == 68) || (m == 69))  s.teauto[40] = '*';
-			if ((m == 104) && (caff == 14)) {
-				s.teauto[36] = '*';
-				if (s.teauto[39] == '*') {
-					s.pourc[3] = '*';
-					s.teauto[38] = '*';
-				}
-			}
-		}
-		if (set::of(6, 9, eos).has(f)) {
-			deline(m, st, tay);
-			if (f == 6)  i = 4;
-			else i = 5;
-			afftex(st, 80, 40, 60, 25, i);
-			if (m == 180)  s.pourc[6] = '*';
-			if (m == 179)  s.pourc[10] = '*';
-		}
-		if (f == 7) {         /* messint */
-			ecrf7();
-			deline(m, st, tay);
-			if (res == 1) {
-				xco = 252 - tay * 5;
-				caspe = 100;
-				dx = 80;
-			} else {
-				xco = 252 - tay * 3;
-				caspe = 144;
-				dx = 50;
-			}
-			if (tay < 40)  afftex(st, xco, 86, dx, 3, 5);
-			else afftex(st, caspe, 86, dx, 3, 5);
-		}
-	}
-}
-
-void f3f8() {
-	integer co;
-
-	if (res == 1)  co = 107;
-	else co = 64;
-	putxy(3, 44);
-	writeg(f3, 5);
-	ywhere = 51;
-	writeg(f8, 5);
-	boite(0, 42, co, 16, 7);
-}
-
-void t5(integer cx) {
-	/* debug('t5'); */
-	if (cx == 10)  blo = false;
-	if (cx != 1) {
-		bh1 = false;
-		bf1 = false;
-	}
-	if (cx != 2)  bh2 = false;
-	if (cx != 4) {
-		bh4 = false;
-		bf4 = false;
-	}
-	if (cx != 5)  bh5 = false;
-	if (cx != 6)  bh6 = false;
-	if (cx != 8)  bh8 = false;
-	if (cx != 3)  bt3 = false;
-	if (cx != 7)  bt7 = false;
-	if (cx != 9)  bh9 = false;
-}
-
-void affper(integer per) {
-	integer cx;
-
-	/* debug('affper'); */
-	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
-	clsf10();
-	if ((per & 128) == 128) {
-		putxy(560, 24);
-		writeg("LEO", 4);
-		menu_enable(disc[1]);
-	}
-	if ((per & 64) == 64) {
-		putxy(560, 32);
-		writeg("PAT", 4);
-		menu_enable(disc[2]);
-	}
-	if ((per & 32) == 32) {
-		putxy(560, 40);
-		writeg("GUY", 4);
-		menu_enable(disc[3]);
-	}
-	if ((per & 16) == 16) {
-		putxy(560, 48);
-		writeg("EVA", 4);
-		menu_enable(disc[4]);
-	}
-	if ((per & 8) == 8) {
-		putxy(560, 56);
-		writeg("BOB", 4);
-		menu_enable(disc[5]);
-	}
-	if ((per & 4) == 4) {
-		putxy(560, 64);
-		writeg("LUC", 4);
-		menu_enable(disc[6]);
-	}
-	if ((per & 2) == 2) {
-		putxy(560, 72);
-		writeg("IDA", 4);
-		menu_enable(disc[7]);
-	}
-	if ((per & 1) == 1) {
-		putxy(560, 80);
-		writeg("MAX", 4);
-		menu_enable(disc[8]);
-	}
-	ipers = per;
-}
-
-/* overlay */ void choix(integer min, integer max, integer &per) {
-	boolean i;
-	integer haz, cx, cy, cz;
-	long_integer per2, cz2;
-
-	/* debug('o0 choix'); */
-	haz = hazard(min, max);
-	if (haz > 4) {
-		haz = 8 - haz;
-		i = true;
-	} else i = false;
-	cx = 0;
-	per = 0;
-	while (cx < haz) {
-		cy = hazard(1, 8);
-		conv(cy, cz);
-		if ((per & cz) != cz) {
-			cx = cx + 1;
-			per = (per | cz);
-		}
-	}
-	if (i)  per = 255 - per;
-	i = false;
-}
-
-/* overlay */ void cpl1(integer &p) {
-	integer j, h, m;
-
-	/* debug('o0 cpl1'); */
-	calch(j, h, m);
-	if ((h > 7) || (h < 11))  p = 25;
-	if ((h > 10) && (h < 14))  p = 35;
-	if ((h > 13) && (h < 16))  p = 50;
-	if ((h > 15) && (h < 18))  p = 5;
-	if ((h > 17) && (h < 22))  p = 35;
-	if ((h > 21) && (h < 24))  p = 50;
-	if ((h >= 0) && (h < 8))  p = 70;
-	mdn();
-}
-
-/* overlay */ void cpl2(integer &p) {
-	integer j, h, m;
-
-	/* debug('o0 cpl2'); */
-	calch(j, h, m);
-	if ((h > 7) && (h < 11))  p = -2;
-	if (h == 11)  p = 100;
-	if ((h > 11) && (h < 23))  p = 10;
-	if (h == 23)  p = 20;
-	if ((h >= 0) && (h < 8))  p = 50;
-}
-
-/* overlay */ void cpl3(integer &p) {
-	integer j, h, m;
-
-	/* debug('o0 cpl3'); */
-	calch(j, h, m);
-	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))  p = 34;
-	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
-}
-
-/* overlay */ void cpl5(integer &p) {
-	integer j, h, m;
-
-	/* debug('o0 cpl5'); */
-	calch(j, h, m);
-	if ((h > 6) && (h < 10))  p = 0;
-	if (h == 10)  p = 100;
-	if ((h > 10) && (h < 24))  p = 15;
-	if ((h >= 0) && (h < 7))  p = 50;
-}
-
-/* overlay */ void cpl6(integer &p) {
-	integer j, h, m;
-
-	/* debug('o0 cpl6'); */
-	calch(j, h, m);
-	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))  p = -2;
-	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))  p = 35;
-	if (h == 17)  p = 100;
-	if ((h >= 0) && (h < 8))  p = 60;
-}
-
-void person() {
-	const char m1[] = "Vous";
-	const char m2[] = "ˆtes";
-	const char m3[] = "SEUL";
-	integer cf;
-	str255 str_;
-
-	/* debug('person'); */
-	for (cf = 1; cf <= 8; cf ++) menu_disable(disc[cf]);
-	clsf10();
-	putxy(560, 30);
-	writeg(m1, 4);
-	putxy(560, 50);
-	writeg(m2, 4);
-	putxy(560, 70);
-	writeg(m3, 4);
-	ipers = 0;
-}
-
-void chlm(integer &per) {
-	/* debug('chlm'); */
-	per = hazard(1, 2);
-	if (per == 2)  per = 128;
-}
-
-void pendule() {
-	const matrix<1, 2, 1, 12, integer> cv
-	= {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
-			{{ -5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}}
-		}
-	};
-	const integer x = 580;
-	const integer y = 123;
-	const integer rg = 9;
-	integer h, co;
-
-
-	/* debug('pendule'); */
-	hide_mouse();
-	/*paint_rect(572,114,18,20);
-	paint_rect(577,114,6,20);*/
-	paint_rect(570, 118, 20, 10);
-	paint_rect(578, 114, 6, 18);
-	if (set::of(cga, her, eos).has(gd))  co = 0;
-	else co = 1;
-	if (min == 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y - rg), co);
-	else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y + rg), co);
-	h = heu;
-	if (h > 12)  h = h - 12;
-	if (h == 0)  h = 12;
-	droite(((cardinal)x >> 1)*res, y, ((cardinal)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
-	show_mouse();
-	putxy(568, 154);
-	if (heu > 11)  writeg("PM ", 1);
-	else writeg("AM ", 1);
-	putxy(550, 160);
-	if (set::of(range(0, 8), eos).has(jou))  writeg(string(chr(jou + 49)) + "& jour", 1);
-}
-
-/*************
- * NIVEAU 11 *
- *************/
-
-void debloc(integer l) {
-	/* debug('debloc'); */
-	num = 0;
-	x = 0;
-	y = 0;
-	if ((l != 26) && (l != 15))  t5(l);
-	mpers = ipers;
-}
-
-/* overlay */ void cpl10(integer &p, integer &h) {
-	integer j, m;
-
-	/* debug('o1 cpl10'); */
-	calch(j, h, m);
-	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14))
-	        || ((h > 18) && (h < 21)))  p = 100;
-	if ((h == 11) || ((h > 20) && (h < 24)))  p = 45;
-	if (((h > 13) && (h < 17)) || (h == 18))  p = 35;
-	if (h == 17)  p = 60;
-	if ((h >= 0) && (h < 8))  p = 5;
-}
-
-/* overlay */ void cpl11(integer &p, integer &h) {
-	integer j, m;
-
-	/* debug('o1 cpl11'); */
-	calch(j, h, m);
-	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))  p = 25;
-	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))  p = 5;
-	if ((h > 13) && (h < 17))  p = 55;
-	if ((h > 16) && (h < 19))  p = 45;
-	if ((h >= 0) && (h < 9))  p = 0;
-}
-
-/* overlay */ void cpl12(integer &p) {
-	integer j, h, m;
-
-	/* debug('o1 cpl12'); */
-	calch(j, h, m);
-	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))  p = 55;
-	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))  p = 25;
-	if ((h >= 0) && (h < 5))  p = 0;
-	if ((h > 4) && (h < 9))  p = 15;
-}
-
-/* overlay */ void cpl13(integer &p) {
-	/* debug('o1 cpl13'); */
-	p = 0;
-}
-
-/* overlay */ void cpl15(integer &p) {
-	integer j, h, m;
-
-	/* debug('o1 cpl15'); */
-	calch(j, h, m);
-	if ((h > 7) && (h < 12))  p = 25;
-	if ((h > 11) && (h < 14))  p = 0;
-	if ((h > 13) && (h < 18))  p = 10;
-	if ((h > 17) && (h < 20))  p = 55;
-	if ((h > 19) && (h < 22))  p = 5;
-	if ((h > 21) && (h < 24))  p = 15;
-	if ((h >= 0) && (h < 8))  p = -15;
-}
-
-/* overlay */ void cpl20(integer &p, integer &h) {
-	integer j, m;
-
-	/* debug('o1 cpl20'); */
-	calch(j, h, m);
-	if (h == 10)  p = 65;
-	if ((h > 10) && (h < 21))  p = 5;
-	if ((h > 20) && (h < 24))  p = -15;
-	if ((h >= 0) && (h < 5))  p = -300;
-	if ((h > 4) && (h < 10))  p = -5;
-}
-
-/* overlay */ void quelq1(integer l) {
-	integer per;
-
-	/* debug('o1 quelq1'); */
-	per = hazard(1, 2);
-	if (l == 1)
-		if (per == 1)  bh1 = true;
-		else bf1 = true;
-	if (l == 4)
-		if (per == 1)  bh4 = true;
-		else bf4 = true;
-	ipers = 10;
-}
-
-/* overlay */ void quelq2() {
-	/* debug('o1 quelq2'); */
-	if (li == 2)  bh2 = true;
-	else bh9 = true;
-	ipers = 10;
-}
-
-/* overlay */ void quelq5() {
-	/* debug('o1 quelq5'); */
-	bh5 = true;
-	ipers = 10;
-}
-
-/* overlay */ void quelq6(integer l) {
-	integer per;
-
-	/* debug('o1 quelq6'); */
-	if (l == 6)  bh6 = true;
-	if (l == 8)  bh8 = true;
-	ipers = 10;
-}
-
-/* overlay */ void quelq10(integer h, integer &per) {
-	integer min, max;
-
-	/* debug('o1 quelq10'); */
-	if ((h >= 0) && (h < 8))  chlm(per);
-	else {
-		if ((h > 7) && (h < 10)) {
-			min = 5;
-			max = 7;
-		}
-		if ((h > 9) && (h < 12)) {
-			min = 1;
-			max = 4;
-		}
-		if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
-			min = 6;
-			max = 8;
-		}
-		if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
-			min = 1;
-			max = 5;
-		}
-		choix(min, max, per);
-	}
-	affper(per);
-}
-
-/* overlay */ void quelq11(integer h, integer &per) {
-	integer min, max;
-
-	/* debug('o1 quelq11'); */
-	if ((h >= 0) && (h < 8))  chlm(per);
-	else {
-		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
-			min = 1;
-			max = 3;
-		}
-		if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
-			min = 1;
-			max = 4;
-		}
-		if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
-			min = 1;
-			max = 2;
-		}
-		choix(min, max, per);
-	}
-	affper(per);
-}
-
-/* overlay */ void quelq12(integer &per) {
-	/* debug('o1 quelq12'); */
-	chlm(per);
-	affper(per);
-}
-
-/* overlay */ void quelq15(integer &per) {
-	integer cx;
-	boolean test;
-
-
-	/* debug('o1 quelq15'); */
-	per = 0;
-	if (per == 0) {
-		do {
-			cx = hazard(1, 8);
-			test = (((cx == 1) && (bh2 || bh9)) ||
-			        ((cx == 2) && bh8) ||
-			        ((cx == 3) && bh4) ||
-			        ((cx == 4) && bf4) ||
-			        ((cx == 5) && bh6) ||
-			        ((cx == 6) && bh1) ||
-			        ((cx == 7) && bf1) ||
-			        ((cx == 8) && bh5));
-		} while (!(! test));
-		conv(cx, per);
-		affper(per);
-	}
-}
-
-/* overlay */ void quelq20(integer h, integer &per) {
-	integer min, max;
-
-	/* debug('o1 quelq20'); */
-	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
-	else {
-		if ((h > 9) && (h < 12)) {
-			min = 3;
-			max = 7;
-		}
-		if ((h > 11) && (h < 18)) {
-			min = 1;
-			max = 2;
-		}
-		if (h == 18) {
-			min = 2;
-			max = 4;
-		}
-		choix(min, max, per);
-	}
-	affper(per);
-}
-
-
-/* overlay */void frap() {
-	integer j, h, m, haz;
-
-	/* debug('o1 frap'); */
-	calch(j, h, m);
-	if ((h >= 0) && (h < 8))  crep = 190;
-	else {
-		haz = hazard(1, 100);
-		if (haz > 70)  crep = 190;
-		else crep = 147;
-	}
-}
-
-/* overlay */ void nouvp(integer l, integer &p) {
-	/* debug('o1 nouvp'); */
-	p = 0;
-	if (l == 1) {
-		if (bh1)  p = 4;
-		if (bf1)  p = 2;
-	}
-	if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))  p = 128;
-	if (l == 4) {
-		if (bh4)  p = 32;
-		if (bf4)  p = 16;
-	}
-	if ((l == 5) && (bh5))  p = 1;
-	if ((l == 6) && (bh6))  p = 8;
-	if ((l == 8) && (bh8))  p = 64;
-	if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))  p = 9;
-	if (p != 9)  affper(p);
-}
-
-
-
-/* overlay */ void tip(integer ip, integer &cx) {
-	/* debug('o1 tip'); */
-	if (ip == 128)  cx = 1;
-	else if (ip == 64)   cx = 2;
-	else if (ip == 32)   cx = 3;
-	else if (ip == 16)   cx = 4;
-	else if (ip == 8)    cx = 5;
-	else if (ip == 4)    cx = 6;
-	else if (ip == 2)    cx = 7;
-	else if (ip == 1)    cx = 8;
-}
-
-
-/* overlay */ void ecfren(integer &p, integer &haz, integer cf, integer l) {
-	/* debug('o1 ecfren'); */
-	if (l == 0)  person();
-	p = -500;
-	haz = 0;
-	if (((l == 1) && (! bh1) && (! bf1))
-	        || ((l == 4) && (! bh4) && (! bf4)))  cpl1(p);
-	if ((l == 2) && (! bh2) && (! bh9))  cpl2(p);
-	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))  cpl3(p);
-	if ((l == 5) && (! bh5))  cpl5(p);
-	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))  cpl6(p);
-	if ((l == 9) && (! bh9) && (! bh2))  p = 10;
-	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))  p = -400;
-	if (p != -500) {
-		p = p + cf;
-		haz = hazard(1, 100);
-	}
-}
-
-/* overlay */ void becfren(integer l) {
-	integer haz;
-
-	/* debug('o1 becfren'); */
-	if ((l == 1) || (l == 4)) {
-		haz = hazard(1, 2);
-		if (l == 1)
-			if (haz == 1)  bh1 = true;
-			else bf1 = true;
-		if (l == 4)
-			if (haz == 1)  bh4 = true;
-			else bf4 = true;
-	}
-	if (l == 2)  bh2 = true;
-	else if (l == 3)  bt3 = true;
-	else if (l == 5)  bh5 = true;
-	else if (l == 6)  bh6 = true;
-	else if (l == 7)  bt7 = true;
-	else if (l == 8)  bh8 = true;
-	else if (l == 9)  bh9 = true;
-}
-
-/* NIVEAU 10 */
-void init_nbrepm() {
-	const array<1, 8, byte> ipm
-	= {{4, 5, 6, 7, 5, 6, 5, 8}};
-	integer i;
-
-	/* debug('init_nbrepm'); */
-	i = 0;
-	do {
-		i = succ(integer, i);
-		nbrepm[i] = ipm[i];
-	} while (!(i == 8));
-}
-
-void phaz(integer &haz, integer &p, integer cf) {
-	/* debug('phaz'); */
-	p = p + cf;
-	haz = hazard(1, 100);
-}
-
-/* overlay */ void inzon() {
-	integer cx;
-
-	/* debug('o2 inzon'); */
-	copcha();
-	{
-		s.ipre  = false;
-		s.derobj = 0;
-		s.icave = 0;
-		s.iboul = 0;
-		s.ibag  = 0;
-		s.ipuit = 0;
-		s.ivier = 0;
-		s.iloic = 136;
-		s.icryp = 141;
-		s.conf  = hazard(4, 10);
-		s.mlieu = 21;
-		for (cx = 2; cx <= 6; cx ++) s.sjer[cx] = chr(0);
-		s.sjer[1] = chr(113);
-		s.heure = chr(20);
-		for (cx = 1; cx <= 10; cx ++) s.pourc[cx] = ' ';
-		for (cx = 1; cx <= 6; cx ++) s.teauto[cx] = '*';
-		for (cx = 7; cx <= 9; cx ++) s.teauto[cx] = ' ';
-		for (cx = 10; cx <= 28; cx ++) s.teauto[cx] = '*';
-		for (cx = 29; cx <= 42; cx ++) s.teauto[cx] = ' ';
-		s.teauto[33] = '*';
-	}
-	for (cx = 1; cx <= 8; cx ++) nbrep[cx] = 0;
-	init_nbrepm();
-}
-
-/* overlay */ void dprog() {
-	/* debug('o2 dprog'); */
-	li = 21;
-	/* jh:= t_settime(0);*/
-	jh = 0;
-	if (! s.ipre)  blo = true;
-	t = ti1;
-	mh = readclock();
-}
-
-/* overlay */ void pl1(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl1'); */
-	if (((li == 1) && (! bh1) && (! bf1))
-	        || ((li == 4) && (! bh4) && (! bf4))) {
-		cpl1(p);
-		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq1(li);
-	}
-}
-
-/* overlay */ void pl2(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl2'); */
-	if (! bh2) {
-		cpl2(p);
-		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq2();
-	}
-}
-
-/* overlay */ void pl5(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl5'); */
-	if (! bh5) {
-		cpl5(p);
-		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq5();
-	}
-}
-
-/* overlay */ void pl6(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl6'); */
-	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
-		cpl6(p);
-		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq6(li);
-	}
-}
-
-/* overlayi */ void pl9(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl9'); */
-	if (! bh9) {
-		cf = -10;
-		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq2();
-	}
-}
-
-/* overlayi */ void pl10(integer cf) {
-	integer p, h, haz;
-
-	/* debug('o2 pl10'); */
-	cpl10(p, h);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq10(h, p);
-}
-
-/* overlay */ void pl11(integer cf) {
-	integer p, h, haz;
-
-	/* debug('o2 pl11'); */
-	cpl11(p, h);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq11(h, p);
-}
-
-/* overlay */ void pl12(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl12'); */
-	cpl12(p);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq12(p);
-}
-
-/* overlay */ void pl13(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl13'); */
-	cpl13(p);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq12(p);
-}
-
-/* overlay */ void pl15(integer cf) {
-	integer p, haz;
-
-	/* debug('o2 pl15'); */
-	cpl15(p);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq15(p);
-}
-
-/* overlay */ void pl20(integer cf) {
-	integer p, h, haz;
-
-	/* debug('o2 pl20'); */
-	cpl20(p, h);
-	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq20(h, p);
-}
-
-/* overlay */ void t11(integer l11, integer &a) {
-	integer p, haz, h;
-
-	/* debug('o2 t11'); */
-	ecfren(p, haz, s.conf, l11);
-	li = l11;
-	if ((l11 > 0) && (l11 < 10))
-		if (p != -500) {
-			if (haz > p) {
-				person();
-				a = 0;
-			} else {
-				becfren(li);
-				nouvp(li, a);
-			}
-		} else nouvp(li, a);
-	if (l11 > 9)
-		if ((l11 > 15) && (l11 != 20) && (l11 != 26))  person();
-		else {
-			if (l11 == 10)  cpl10(p, h);
-			if (l11 == 11)  cpl11(p, h);
-			if (l11 == 12)  cpl12(p);
-			if ((l11 == 13) || (l11 == 14))  cpl13(p);
-			if ((l11 == 15) || (l11 == 26))  cpl15(p);
-			if (l11 == 20)  cpl20(p, h);
-			p = p + s.conf;
-			haz = hazard(1, 100);
-			if (haz > p) {
-				person();
-				a = 0;
-			} else {
-				if (l11 == 10)  quelq10(h, p);
-				if (l11 == 11)  quelq11(h, p);
-				if ((l11 == 12) || (l11 == 13) || (l11 == 14))  quelq12(p);
-				if ((l11 == 15) || (l11 == 26))  quelq15(p);
-				if (l11 == 20)  quelq20(h, p);
-				a = p;
-			}
-		}
-}
-
-/* overlay */ void cavegre()
-
-{
-	integer haz;
-
-	/* debug('cavegre'); */
-	s.conf = s.conf + 2;
-	if (s.conf > 69)  s.conf = s.conf + (s.conf / 10);
-	clsf3();
-	ecrf2();
-	ecr3(m1);
-	haz = (hazard(0, 4)) - 2;
-	parole(2, haz, 1);
-	for (haz = 0; haz <= 3000; haz ++);
-	clsf3();
-	person();
-}
-
-void writetp(str255 s, integer t) {
-	if (res == 2)  writeg(s, t);
-	else writeg(copy(s, 1, 25), t);
-}
-
-void messint(integer nu) {
-	/* debug('messint'); */
-	clsf1();
-	clsf2();
-	clsf3();
-	decomp(0x73a2, 1008);
-	memw[0x7413 + 12] = 80;
-	memw[0x7413 + 14] =  40;
-	writepal(90);
-	afff(gd, 0x73a2, 1008, 0, 0);
-	afff(gd, 0x73a2, 1008, 0, 70);
-	repon(7, nu);
-}
-
-void aniof(integer ouf, integer num) {
-	integer ad, offset;
-	char c;
-
-	/* debug('aniof'); */
-	if ((caff == 7) && ((num == 4) || (num == 5)))  return;
-	if ((caff == 10) && (num == 7))  num = 6;
-	if (caff == 12)  if (num == 3)  num = 4;
-		else if (num == 4)  num = 3;
-	ad = adani;
-	offset = animof(ouf, num);
-	decomp(ad, offset);
-	hide_mouse();
-	afff(gd, ad, offset, 0, 12);
-	ecrf1();
-	show_mouse();
-}
-
-void musique(integer so) {
-	boolean i;
-	integer haz;
-	/* dep: array[1..5] of long_integer;*/
-
-	/* debug('musique'); */
-	if (so == 0) { /*musik(0)*/
-		;
-	} else if ((prebru == 0) && (! s.ipre)) {
-		parole(10, 1, 1);
-		prebru = prebru + 1;
-	} else {
-		i = false;
-		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
-			haz = hazard(1, 3);
-			if (haz == 2) {
-				haz = hazard(2, 4);
-				parole(9, haz, 1);
-				i = true;
-			}
-		}
-		if (s.mlieu == 20) {
-			haz = hazard(1, 2);
-			if (haz == 1) {
-				parole(8, 1, 1);
-				i = true;
-			}
-		}
-		if (s.mlieu == 24) {
-			haz = hazard(1, 2);
-			if (haz == 2) {
-				parole(12, 1, 1);
-				i = true;
-			}
-		}
-		if (s.mlieu == 23) {
-			parole(13, 1, 1);
-			i = true;
-		}
-		if (! i) {
-			/* dep[1]:= 1416;
-			 dep[2]:= 1512;
-			 dep[3]:= 1692;
-			 dep[4]:= 1884;
-			 dep[5]:= 2046;
-			 haz:= hazard(1,5);
-			 musik(dep[haz]);*/
-			haz = hazard(1, 17);
-			parole(haz, 1, 2);
-		}
-	}
-}
-
-/* NIVEAU 9 */
-void dessin(integer ad) {
-	integer cx;
-
-	/* debug('dessin'); */
-	if (ad != 0)  dessine(ades, ((ad % 160) * 2), (ad / 160));
-	else {
-		clsf1();
-		if (caff > 99) {
-			dessine(ades, 60, 33);
-			boite(118, 32, 291, 121, 15);         /* cadre moyen */
-		} else if (caff > 69) {
-			dessine(ades, 112, 48);           /* tˆtes */
-			boite(222, 47, 155, 91, 15);
-		} else {
-			dessine(ades, 0, 12);
-			ecrf1();
-			if ((caff < 30) || (caff > 32)) {
-				for (cx = 1; cx <= 6; cx ++)
-					if (ord(touv[cx]) != 0)  aniof(1, ord(touv[cx]));
-				if (caff == 13) {
-					if (s.iboul == 141)  aniof(1, 7);
-					if (s.ibag == 159)  aniof(1, 6);
-				}
-				if ((caff == 14) && (s.icave == 151))  aniof(1, 2);
-				if ((caff == 17) && (s.ivier == 143))  aniof(1, 1);
-				if ((caff == 24) && (s.ipuit != 0))  aniof(1, 1);
-			}
-			if (caff < 26)  musique(1);
-		}
-	}
-}
-
-
-
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
new file mode 100644
index 0000000..734cb48
--- /dev/null
+++ b/engines/mortevielle/mor2.cpp
@@ -0,0 +1,728 @@
+const array<1, 11, integer> men
+= {{
+		scacher, attacher, defoncer, dormir,
+		entrer,  fermer,   frapper,  manger,
+		mettre,  ouvrir,   sortir
+	}
+};
+
+void tinke() {
+	const char m1[] = "Mince! Vous entendez du bruit...";
+	const char d1[] = " | Vous devriez avoir remarqu‚|       ";
+	const char d2[] = "% des indices...";
+	const char d3 = '[';
+	const char d4 = ']';
+	const char d5 = '1';
+	const char d6[] = "OK";
+	integer cx, cy, haz, nh, cf, j, h, m, cd;
+	varying_string<3> stpo;
+	boolean am;
+
+	anyone = false;
+	calch(j, h, m);
+	if (j != jou) {
+		jou = j;
+		cx = 0;
+		do {
+			cx = cx + 1;
+			if (nbrepm[cx] != 0)  nbrepm[cx] = nbrepm[cx] - 1;
+			nbrep[cx] = 0;
+		} while (!(cx == 8));
+	}
+	if ((h > heu) || ((h == 0) && (heu == 23))) {
+		heu = h;
+		min = 0;
+		pendule();
+		cf = 0;
+		for (cx = 1; cx <= 10; cx ++) if (s.pourc[cx] == '*')  cf = cf + 1;
+		if (cf == 10)  stpo = "10";
+		else stpo = chr(cf + 48);
+		stpou = string(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
+	}
+	if (m > min) {
+		min = 30;
+		pendule();
+	}
+	if (y_s < 12)  return;
+	if (! blo) {
+		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
+			t = ti2;
+		else t = ti1;
+		cf = s.conf;
+		if ((cf > 33) && (cf < 66))  t = t - (t / 3);
+		if (cf > 65)  t = t - ((t / 3) * 2);
+		nh = readclock();
+		if ((nh - mh) > t) {
+			am = active_menu;
+			erase_menu();
+			jh = jh + ((nh - mh) / t);
+			mh = nh;
+			switch (li) {
+			case 1:
+			case 4 :
+				pl1(cf);
+				break;
+			case 2 :
+				pl2(cf);
+				break;
+			case 5 :
+				pl5(cf);
+				break;
+			case 6:
+			case 8 :
+				pl6(cf);
+				break;
+			case 9 :
+				pl9(cf);
+				break;
+			case 10 :
+				pl10(cf);
+				break;
+			case 11 :
+				pl11(cf);
+				break;
+			case 12 :
+				pl12(cf);
+				break;
+			case 13:
+			case 14 :
+				pl13(cf);
+				break;
+			case 15:
+			case 26 :
+				pl15(cf);
+				break;
+			case 20 :
+				pl20(cf);
+				break;
+			}
+			if ((mpers != 0) && (ipers != 10))  mpers = ipers;
+			if ((mpers == 0) && (ipers > 0))
+				if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
+				else if (ipers == 10) {
+					ipers = 0;
+					if (! brt) {
+						brt = true;
+						hdb = readclock();
+						haz = hazard(1, 5);
+						if (haz < 5) {
+							clsf3();
+							ecrf2();
+							ecr3(m1);
+							haz = (hazard(0, 4)) - 2;
+							parole(1, haz, 1);
+							clsf3();
+						}
+					}
+				}
+			if (am)  draw_menu();
+		}
+	}
+	hfb = readclock();
+	if ((brt) && ((hfb - hdb) > 17)) {
+		nouvp(li, cx);
+		brt = false;
+		hdb = 0;
+		if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+	}
+}
+
+void fenat(char ans) {
+	integer coul;
+
+	hide_mouse();
+	if (gd == cga)  coul = 2;
+	else if (gd == her)  coul = 1;
+	else coul = 12;
+	affcar(gd, 306, 193, coul, ord(ans));
+	boite(300, 191, 16, 8, 15);
+	show_mouse();
+}
+
+
+/* NIVEAU 8 */
+void afdes(integer ad) {
+	taffich();
+	dessin(ad);
+	okdes = false;
+}
+
+void tkey1(boolean d) {
+	boolean quest;
+	integer x, y, c;
+	integer key;
+
+	hide_mouse();
+	fenat('K');
+	while (keypressed())  key = testou();
+	do {
+		if (d)  tinke();
+		quest = keypressed();
+		read_pos_mouse(x, y, c);
+	} while (!(quest || (c != 0) || (d && anyone)));
+	if (quest)  key = testou();
+	clic = false;
+	show_mouse();
+}
+
+void tmlieu(integer mli) {
+	integer cx, j, i, tail;
+	str30 nomp;
+	phrase st;
+
+
+	if (mli == 26)  mli = 15;
+	i = 1;
+	while ((i < 8) && (v_lieu[i][mli] != 0)) {
+		cx = v_lieu[i][mli];
+		deline(cx + c_tmlieu, st, tail);
+		nomp = delig;
+		while (length(nomp) < 30)  nomp = nomp + ' ';
+		menut(depl[i], nomp);
+		i = i + 1;
+	}
+	nomp = "*                   ";
+	for (cx = 7; cx >= i; cx --) menut(depl[cx], nomp);
+}
+
+
+/* NIVEAU 7 */
+void tlu(integer af, integer ob) {
+	caff = 32;
+	afdes(0);
+	repon(6, ob + 4000);
+	repon(2, 999);
+	tkey1(true);
+	caff = af;
+	msg[3] = no_choice;
+	crep = 998;
+}
+
+void delin(integer n) {
+	phrase s;
+	integer t;
+
+	deline(n, s, t);
+}
+
+void affrep() {
+	caff = s.mlieu;
+	crep = s.mlieu;
+}
+
+void mfouen()
+
+{
+	integer cx;
+
+	tmlieu(s.mlieu);
+	for (cx = 1; cx <= 11; cx ++) menu_enable(men[cx]);
+	/* menu_enable( scacher);
+	 menu_enable(menup, attacher);
+	 menu_enable(menup, defoncer);
+	 menu_enable(menup, dormir);
+	 menu_enable(menup, entrer);
+	 menu_enable(menup, fermer);
+	 menu_enable(menup, frapper);
+	 menu_enable(menup, manger);
+	 menu_enable(menup, mettre);
+	 menu_enable(menup, ouvrir);
+	 menu_enable(menup, sortir);  */
+	menut(sonder, " sonder   ");
+	menut(soulever, " soulever ");
+}
+
+void atf3f8(integer &key) {
+	do {
+		key = testou();
+	} while (!((key == 61) || (key == 66)));
+}
+
+/* NIVEAU 6 */
+
+void tperd() {
+	integer cx;
+
+	initouv();
+	ment = 0;
+	iouv = 0;
+	mchai = 0;
+	mfouen();
+	if (! blo)  t11(21, cx);
+	perdu = true;
+	clsf1();
+	boite(60, 35, 400, 50, 15);
+	repon(9, crep);
+	clsf2();
+	clsf3();
+	col = false;
+	syn = false;
+	okdes = false;
+}
+
+void tsort() {
+	integer cx;
+
+	if ((iouv > 0) && (s.mlieu != 0))
+		if (s.conf < 50)  s.conf = s.conf + 2;
+		else s.conf = s.conf + (s.conf / 10);
+	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+	ment = 0;
+	iouv = 0;
+	mchai = 0;
+	debloc(s.mlieu);
+}
+
+void st4(integer ob) {
+	crep = 997;
+	switch (ob) {
+	case 114 :
+		crep = 109;
+		break;
+	case 110 :
+		crep = 107;
+		break;
+	case 158 :
+		crep = 113;
+		break;
+	case RANGE_5(152, 156):
+	case 150:
+	case 100:
+	case 157:
+	case 160:
+	case 161 :
+		tlu(caff, ob);
+		break;
+	}
+}
+
+void cherjer(integer ob, boolean &d) {
+	integer cx;
+
+	d = false;
+	for (cx = 1; cx <= 6; cx ++) d = (d || (ord(s.sjer[cx]) == ob));
+	if (s.derobj == ob)  d = true;
+}
+
+void st1sama() {
+	s.mlieu = 10;
+	affrep();
+}
+
+void modinv() {
+	integer cx, cy, tay, i, r;
+	phrase nom;
+	str30 nomp;
+
+	cy = 0;
+	for (cx = 1; cx <= 6; cx ++)
+		if (s.sjer[cx] != chr(0)) {
+			cy = succ(integer, cy);
+			r = (ord(s.sjer[cx]) + 400);
+			deline(r - 501 + c_st41, nom, tay);
+			nomp = delig;
+			menut(invt[cy], nomp);
+			menu_enable(invt[cx]);
+		}
+	if (cy < 6)
+		for (cx = cy + 1; cx <= 6; cx ++) {
+			menut(invt[cx], "                       ");
+			menu_disable(invt[cx]);
+		}
+}
+
+void sparl(long_integer adr, long_integer rep) {
+	const array<1, 8, integer> haut
+	= {{0, 1, -3, 6, -2, 2, 7, -1}};
+	integer key, ad, tay, repint;
+	phrase st;
+
+	repint = trunc(rep);
+	hide_mouse();
+	deline(repint + c_paroles, st, tay);
+	afftex(st, 230, 4, 65, 24, 5);
+	f3f8();
+	/*boite(43,30,90,19,15);
+	gotoxy(7,5);
+	write('F3: Encore');
+	gotoxy(7,6);
+	write('F8: Stop');*/
+	key = 0;
+	do {
+		parole(repint, haut[caff - 69], 0);
+		atf3f8(key);
+	} while (!(key == 66));
+	hirs();
+	show_mouse();
+}
+
+void finfouil() {
+	fouil = false;
+	obpart = false;
+	cs = 0;
+	is = 0;
+	mfouen();
+}
+
+void mfoudi() {
+	integer cx;
+
+	for (cx = 1; cx <= 7; cx ++) menu_disable(depl[cx]);
+	for (cx = 1; cx <= 11; cx ++) menu_disable(men[cx]);
+	/* menu_disable(menup, scacher);
+	 menu_disable(menup, attacher);
+	 menu_disable(menup, defoncer);
+	 menu_disable(menup, dormir);
+	 menu_disable(menup, entrer);
+	 menu_disable(menup, fermer);
+	 menu_disable(menup, frapper);
+	 menu_disable(menup, manger);
+	 menu_disable(menup, mettre);
+	 menu_disable(menup, ouvrir);
+	 menu_disable(menup, sortir);  */
+	menut(sonder, " -SUITE- ");
+	menut(soulever, " -STOP-  ");
+}
+
+void mennor() {
+	menu_up(msg[3]);
+}
+
+void premtet() {
+	dessine(ades, 10, 80);
+	boite(18, 79, 155, 91, 15);
+}
+
+/* NIVEAU 5 */
+void ajchai() {
+	integer cx, cy, lderobj;
+
+
+	cy = (acha + pred(integer, pred(integer, mchai) * 10));
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
+	if (tabdon[cy + cx] == 0) {
+		lderobj = s.derobj;
+		tabdon[cy + cx] = lderobj;
+	} else crep = 192;
+}
+
+void ajjer(integer ob) {
+	integer cx;
+
+	cx = 0;
+	do {
+		cx = cx + 1;
+	} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
+	if (ord(s.sjer[cx]) == 0) {
+		s.sjer[(cx)] = chr(ob);
+		modinv();
+	} else crep = 139;
+}
+
+void t1sama() {    /* On entre dans le manoir */
+	integer j, h, m;
+	boolean d;
+
+	calch(j, h, m);
+	if ((h < 5) && (s.mlieu > 18)) {
+		cherjer(137, d);
+		if (! d) {        /* On n'a pas les cl‚s et il est tard */
+			crep = 1511;
+			tperd();
+		} else st1sama();
+	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */
+		ipers = 255;
+		affper(ipers);
+		caff = 77;
+		afdes(0);
+		boite(223, 47, 155, 91, 15);
+		repon(2, 33);
+		tkey1(false);
+		mennor();
+		hide_mouse();
+		hirs();
+		premtet();
+		sparl(0, 140);
+		dessine_rouleau();
+		pendule();
+		show_mouse();
+		s.mlieu = 0;
+		affrep();
+		t5(10);
+		if (! blo)  t11(0, m);
+		ipers = 0;
+		mpers = 0;
+		s.ipre = true;
+		/*chech;*/
+	} else  st1sama();
+}
+
+void t1vier() {
+	s.mlieu = 17;
+	affrep();
+}
+
+void t1neig() {
+	inei = inei + 1;
+	if (inei > 2) {
+		crep = 1506;
+		tperd();
+	} else {
+		okdes = true;
+		s.mlieu = 19;
+		affrep();
+	}
+}
+
+void t1deva() {
+	inei = 0;
+	s.mlieu = 21;
+	affrep();
+}
+
+void t1derr() {
+	s.mlieu = 22;
+	affrep();
+}
+
+void t1deau() {
+	crep = 1503;
+	tperd();
+}
+
+void tctrm() {
+	repon(2, (3000 + ctrm));
+	ctrm = 0;
+}
+
+
+void quelquun()
+
+{
+	integer haz, cx;
+
+	if (imen)  erase_menu();
+	finfouil();
+	crep = 997;
+L1:
+	if (! cache) {
+		if (crep == 997)  crep = 138;
+		repon(2, crep);
+		if (crep == 138)  parole(5, 2, 1);
+		else parole(4, 4, 1);
+		if (iouv == 0)  s.conf = s.conf + 2;
+		else if (s.conf < 50)  s.conf = s.conf + 4;
+		else
+			s.conf = s.conf + (3 * (s.conf / 10));
+		tsort();
+		tmlieu(15);
+		tip(ipers, cx);
+		caff = 69 + cx;
+		crep = caff;
+		msg[3] = discut;
+		msg[4] = disc[cx];
+		syn = true;
+		col = true;
+	} else {
+		haz = hazard(1, 3);
+		if (haz == 2) {
+			cache = false;
+			crep = 137;
+			goto L1;
+		} else {
+			repon(2, 136);
+			haz = (hazard(0, 4)) - 2;
+			parole(3, haz, 1);
+			clsf2();
+			person();
+			debloc(21);
+			affrep();
+		}
+	}
+	if (imen)  draw_menu();
+}
+
+void tsuiv() {
+	integer cx, tbcl;
+	integer cl, cy;
+
+	cy = acha + ((mchai - 1) * 10) - 1;
+	cx = 0;
+	do {
+		cx = cx + 1;
+		cs = cs + 1;
+		cl = cy + cs;
+		tbcl = tabdon[cl];
+	} while (!((tbcl != 0) || (cs > 9)));
+	if ((tbcl != 0) && (cs < 11)) {
+		is = is + 1;
+		caff = tbcl;
+		crep = caff + 400;
+		if (ipers != 0)  s.conf = s.conf + 2;
+	} else {
+		affrep();
+		finfouil();
+		if (cx > 9)  crep = 131;
+	}
+}
+
+void tfleche() {
+	boolean qust;
+	char touch;
+	integer dummy, cd, xmo, ymo;
+
+	if (num == 9999)  return;
+	fenat(chr(152));
+	rect = false;
+	do {
+		touch = '\0';
+
+		do {
+			mov_mouse(qust, touch);
+			if (clic)  rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
+			tinke();
+		} while (!(qust || rect || anyone));
+
+		if (qust && (touch == '\103'))  dummy = do_alert(stpou, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) ||
+	           (anyone) || (rect)));
+	if (touch == '\73')  iesc = true;
+	if (rect) {
+		x = x_s;
+		y = y_s;
+	}
+}
+
+void tcoord(integer sx)
+
+{
+	integer sy, ix, iy, cb, cy, ib;
+	integer a, b, atdon;
+
+
+	num = 0;
+	crep = 999;
+	a = 0;
+	atdon = amzon + 3;
+	cy = 0;
+	while (cy < caff) {
+		a = a + tabdon[atdon];
+		atdon = atdon + 4;
+		cy = succ(integer, cy);
+	}
+	/*     for cy:=0 to caff-1 do
+	          a:=a+ tabdon[amzon+3+4*cy];
+	     b:= peek(amzon+3+4*caff); */
+	b = tabdon[atdon];
+	if (b == 0)  goto L1;
+	a = a + fleche;
+	cb = 0;
+	for (cy = 0; cy <= (sx - 2); cy ++) {
+		ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+		cb = cb + (ib * 4) + 2;
+	}
+	ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+	if (ib == 0)  goto L1;
+	cy = 1;
+	do {
+		cb = cb + 2;
+		sx = tabdon[a + cb] * res;
+		sy = tabdon[succ(integer, a + cb)];
+		cb = cb + 2;
+		ix = tabdon[a + cb] * res;
+		iy = tabdon[succ(integer, a + cb)];
+		cy = cy + 1;
+	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
+	           || (cy > ib)));
+	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
+
+	{
+		num = cy - 1;
+		return;
+	}
+L1:
+	crep = 997;
+}
+
+
+void st7(integer ob) {
+	crep = 183;
+	if ((ob == 116) || (ob == 144))  crep = 104;
+	if ((ob == 126) || (ob == 111))  crep = 108;
+	if (ob == 132)  crep = 111;
+	if (ob == 142)  crep = 112;
+	if (crep == 183)  st4(ob);
+}
+
+void treg(integer ob) {
+	integer mdes;
+
+	mdes = caff;
+	caff = ob;
+	if (((caff > 29) && (caff < 33)) || (caff == 144) ||
+	        (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
+		afdes(0);
+		if ((caff > 29) && (caff < 33))  repon(2, caff);
+		else repon(2, (caff + 400));
+		tkey1(true);
+		caff = mdes;
+		msg[3] = 0;
+		crep = 998;
+	} else {
+		obpart = true;
+		crep = caff + 400;
+		mfoudi();
+	}
+}
+
+void avpoing(integer &ob) {
+	crep = 999;
+	if (s.derobj != 0)  ajjer(s.derobj);
+	if (crep != 139) {
+		modobj(ob + 400);
+		s.derobj = ob;
+		ob = 0;
+	}
+}
+
+void rechai(integer &ch) {
+	integer cx;
+
+	cx = s.mlieu;
+	if (s.mlieu == 16)  cx = 14;
+	ch = tabdon[achai + (cx * 7) + pred(integer, num)];
+}
+
+void t23coul(integer &l) {
+	boolean d;
+
+	cherjer(143, d);
+	l = 14;
+	if (! d) {
+		crep = 1512;
+		tperd();
+	}
+}
+
+void maivid() {
+	s.derobj = 0;
+	modobj(500);
+}
+
+void st13(integer ob) {
+	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
+	        (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
+	        (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
+	        (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
+	        (ob == 150) || (ob == 152))  crep = 999;
+	else crep = 105;
+}
+
+void aldepl() {
+	integer dummy;
+
+	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
+}
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
deleted file mode 100644
index 734cb48..0000000
--- a/engines/mortevielle/mor2.h
+++ /dev/null
@@ -1,728 +0,0 @@
-const array<1, 11, integer> men
-= {{
-		scacher, attacher, defoncer, dormir,
-		entrer,  fermer,   frapper,  manger,
-		mettre,  ouvrir,   sortir
-	}
-};
-
-void tinke() {
-	const char m1[] = "Mince! Vous entendez du bruit...";
-	const char d1[] = " | Vous devriez avoir remarqu‚|       ";
-	const char d2[] = "% des indices...";
-	const char d3 = '[';
-	const char d4 = ']';
-	const char d5 = '1';
-	const char d6[] = "OK";
-	integer cx, cy, haz, nh, cf, j, h, m, cd;
-	varying_string<3> stpo;
-	boolean am;
-
-	anyone = false;
-	calch(j, h, m);
-	if (j != jou) {
-		jou = j;
-		cx = 0;
-		do {
-			cx = cx + 1;
-			if (nbrepm[cx] != 0)  nbrepm[cx] = nbrepm[cx] - 1;
-			nbrep[cx] = 0;
-		} while (!(cx == 8));
-	}
-	if ((h > heu) || ((h == 0) && (heu == 23))) {
-		heu = h;
-		min = 0;
-		pendule();
-		cf = 0;
-		for (cx = 1; cx <= 10; cx ++) if (s.pourc[cx] == '*')  cf = cf + 1;
-		if (cf == 10)  stpo = "10";
-		else stpo = chr(cf + 48);
-		stpou = string(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
-	}
-	if (m > min) {
-		min = 30;
-		pendule();
-	}
-	if (y_s < 12)  return;
-	if (! blo) {
-		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
-			t = ti2;
-		else t = ti1;
-		cf = s.conf;
-		if ((cf > 33) && (cf < 66))  t = t - (t / 3);
-		if (cf > 65)  t = t - ((t / 3) * 2);
-		nh = readclock();
-		if ((nh - mh) > t) {
-			am = active_menu;
-			erase_menu();
-			jh = jh + ((nh - mh) / t);
-			mh = nh;
-			switch (li) {
-			case 1:
-			case 4 :
-				pl1(cf);
-				break;
-			case 2 :
-				pl2(cf);
-				break;
-			case 5 :
-				pl5(cf);
-				break;
-			case 6:
-			case 8 :
-				pl6(cf);
-				break;
-			case 9 :
-				pl9(cf);
-				break;
-			case 10 :
-				pl10(cf);
-				break;
-			case 11 :
-				pl11(cf);
-				break;
-			case 12 :
-				pl12(cf);
-				break;
-			case 13:
-			case 14 :
-				pl13(cf);
-				break;
-			case 15:
-			case 26 :
-				pl15(cf);
-				break;
-			case 20 :
-				pl20(cf);
-				break;
-			}
-			if ((mpers != 0) && (ipers != 10))  mpers = ipers;
-			if ((mpers == 0) && (ipers > 0))
-				if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
-				else if (ipers == 10) {
-					ipers = 0;
-					if (! brt) {
-						brt = true;
-						hdb = readclock();
-						haz = hazard(1, 5);
-						if (haz < 5) {
-							clsf3();
-							ecrf2();
-							ecr3(m1);
-							haz = (hazard(0, 4)) - 2;
-							parole(1, haz, 1);
-							clsf3();
-						}
-					}
-				}
-			if (am)  draw_menu();
-		}
-	}
-	hfb = readclock();
-	if ((brt) && ((hfb - hdb) > 17)) {
-		nouvp(li, cx);
-		brt = false;
-		hdb = 0;
-		if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
-	}
-}
-
-void fenat(char ans) {
-	integer coul;
-
-	hide_mouse();
-	if (gd == cga)  coul = 2;
-	else if (gd == her)  coul = 1;
-	else coul = 12;
-	affcar(gd, 306, 193, coul, ord(ans));
-	boite(300, 191, 16, 8, 15);
-	show_mouse();
-}
-
-
-/* NIVEAU 8 */
-void afdes(integer ad) {
-	taffich();
-	dessin(ad);
-	okdes = false;
-}
-
-void tkey1(boolean d) {
-	boolean quest;
-	integer x, y, c;
-	integer key;
-
-	hide_mouse();
-	fenat('K');
-	while (keypressed())  key = testou();
-	do {
-		if (d)  tinke();
-		quest = keypressed();
-		read_pos_mouse(x, y, c);
-	} while (!(quest || (c != 0) || (d && anyone)));
-	if (quest)  key = testou();
-	clic = false;
-	show_mouse();
-}
-
-void tmlieu(integer mli) {
-	integer cx, j, i, tail;
-	str30 nomp;
-	phrase st;
-
-
-	if (mli == 26)  mli = 15;
-	i = 1;
-	while ((i < 8) && (v_lieu[i][mli] != 0)) {
-		cx = v_lieu[i][mli];
-		deline(cx + c_tmlieu, st, tail);
-		nomp = delig;
-		while (length(nomp) < 30)  nomp = nomp + ' ';
-		menut(depl[i], nomp);
-		i = i + 1;
-	}
-	nomp = "*                   ";
-	for (cx = 7; cx >= i; cx --) menut(depl[cx], nomp);
-}
-
-
-/* NIVEAU 7 */
-void tlu(integer af, integer ob) {
-	caff = 32;
-	afdes(0);
-	repon(6, ob + 4000);
-	repon(2, 999);
-	tkey1(true);
-	caff = af;
-	msg[3] = no_choice;
-	crep = 998;
-}
-
-void delin(integer n) {
-	phrase s;
-	integer t;
-
-	deline(n, s, t);
-}
-
-void affrep() {
-	caff = s.mlieu;
-	crep = s.mlieu;
-}
-
-void mfouen()
-
-{
-	integer cx;
-
-	tmlieu(s.mlieu);
-	for (cx = 1; cx <= 11; cx ++) menu_enable(men[cx]);
-	/* menu_enable( scacher);
-	 menu_enable(menup, attacher);
-	 menu_enable(menup, defoncer);
-	 menu_enable(menup, dormir);
-	 menu_enable(menup, entrer);
-	 menu_enable(menup, fermer);
-	 menu_enable(menup, frapper);
-	 menu_enable(menup, manger);
-	 menu_enable(menup, mettre);
-	 menu_enable(menup, ouvrir);
-	 menu_enable(menup, sortir);  */
-	menut(sonder, " sonder   ");
-	menut(soulever, " soulever ");
-}
-
-void atf3f8(integer &key) {
-	do {
-		key = testou();
-	} while (!((key == 61) || (key == 66)));
-}
-
-/* NIVEAU 6 */
-
-void tperd() {
-	integer cx;
-
-	initouv();
-	ment = 0;
-	iouv = 0;
-	mchai = 0;
-	mfouen();
-	if (! blo)  t11(21, cx);
-	perdu = true;
-	clsf1();
-	boite(60, 35, 400, 50, 15);
-	repon(9, crep);
-	clsf2();
-	clsf3();
-	col = false;
-	syn = false;
-	okdes = false;
-}
-
-void tsort() {
-	integer cx;
-
-	if ((iouv > 0) && (s.mlieu != 0))
-		if (s.conf < 50)  s.conf = s.conf + 2;
-		else s.conf = s.conf + (s.conf / 10);
-	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
-	ment = 0;
-	iouv = 0;
-	mchai = 0;
-	debloc(s.mlieu);
-}
-
-void st4(integer ob) {
-	crep = 997;
-	switch (ob) {
-	case 114 :
-		crep = 109;
-		break;
-	case 110 :
-		crep = 107;
-		break;
-	case 158 :
-		crep = 113;
-		break;
-	case RANGE_5(152, 156):
-	case 150:
-	case 100:
-	case 157:
-	case 160:
-	case 161 :
-		tlu(caff, ob);
-		break;
-	}
-}
-
-void cherjer(integer ob, boolean &d) {
-	integer cx;
-
-	d = false;
-	for (cx = 1; cx <= 6; cx ++) d = (d || (ord(s.sjer[cx]) == ob));
-	if (s.derobj == ob)  d = true;
-}
-
-void st1sama() {
-	s.mlieu = 10;
-	affrep();
-}
-
-void modinv() {
-	integer cx, cy, tay, i, r;
-	phrase nom;
-	str30 nomp;
-
-	cy = 0;
-	for (cx = 1; cx <= 6; cx ++)
-		if (s.sjer[cx] != chr(0)) {
-			cy = succ(integer, cy);
-			r = (ord(s.sjer[cx]) + 400);
-			deline(r - 501 + c_st41, nom, tay);
-			nomp = delig;
-			menut(invt[cy], nomp);
-			menu_enable(invt[cx]);
-		}
-	if (cy < 6)
-		for (cx = cy + 1; cx <= 6; cx ++) {
-			menut(invt[cx], "                       ");
-			menu_disable(invt[cx]);
-		}
-}
-
-void sparl(long_integer adr, long_integer rep) {
-	const array<1, 8, integer> haut
-	= {{0, 1, -3, 6, -2, 2, 7, -1}};
-	integer key, ad, tay, repint;
-	phrase st;
-
-	repint = trunc(rep);
-	hide_mouse();
-	deline(repint + c_paroles, st, tay);
-	afftex(st, 230, 4, 65, 24, 5);
-	f3f8();
-	/*boite(43,30,90,19,15);
-	gotoxy(7,5);
-	write('F3: Encore');
-	gotoxy(7,6);
-	write('F8: Stop');*/
-	key = 0;
-	do {
-		parole(repint, haut[caff - 69], 0);
-		atf3f8(key);
-	} while (!(key == 66));
-	hirs();
-	show_mouse();
-}
-
-void finfouil() {
-	fouil = false;
-	obpart = false;
-	cs = 0;
-	is = 0;
-	mfouen();
-}
-
-void mfoudi() {
-	integer cx;
-
-	for (cx = 1; cx <= 7; cx ++) menu_disable(depl[cx]);
-	for (cx = 1; cx <= 11; cx ++) menu_disable(men[cx]);
-	/* menu_disable(menup, scacher);
-	 menu_disable(menup, attacher);
-	 menu_disable(menup, defoncer);
-	 menu_disable(menup, dormir);
-	 menu_disable(menup, entrer);
-	 menu_disable(menup, fermer);
-	 menu_disable(menup, frapper);
-	 menu_disable(menup, manger);
-	 menu_disable(menup, mettre);
-	 menu_disable(menup, ouvrir);
-	 menu_disable(menup, sortir);  */
-	menut(sonder, " -SUITE- ");
-	menut(soulever, " -STOP-  ");
-}
-
-void mennor() {
-	menu_up(msg[3]);
-}
-
-void premtet() {
-	dessine(ades, 10, 80);
-	boite(18, 79, 155, 91, 15);
-}
-
-/* NIVEAU 5 */
-void ajchai() {
-	integer cx, cy, lderobj;
-
-
-	cy = (acha + pred(integer, pred(integer, mchai) * 10));
-	cx = 0;
-	do {
-		cx = cx + 1;
-	} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
-	if (tabdon[cy + cx] == 0) {
-		lderobj = s.derobj;
-		tabdon[cy + cx] = lderobj;
-	} else crep = 192;
-}
-
-void ajjer(integer ob) {
-	integer cx;
-
-	cx = 0;
-	do {
-		cx = cx + 1;
-	} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
-	if (ord(s.sjer[cx]) == 0) {
-		s.sjer[(cx)] = chr(ob);
-		modinv();
-	} else crep = 139;
-}
-
-void t1sama() {    /* On entre dans le manoir */
-	integer j, h, m;
-	boolean d;
-
-	calch(j, h, m);
-	if ((h < 5) && (s.mlieu > 18)) {
-		cherjer(137, d);
-		if (! d) {        /* On n'a pas les cl‚s et il est tard */
-			crep = 1511;
-			tperd();
-		} else st1sama();
-	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */
-		ipers = 255;
-		affper(ipers);
-		caff = 77;
-		afdes(0);
-		boite(223, 47, 155, 91, 15);
-		repon(2, 33);
-		tkey1(false);
-		mennor();
-		hide_mouse();
-		hirs();
-		premtet();
-		sparl(0, 140);
-		dessine_rouleau();
-		pendule();
-		show_mouse();
-		s.mlieu = 0;
-		affrep();
-		t5(10);
-		if (! blo)  t11(0, m);
-		ipers = 0;
-		mpers = 0;
-		s.ipre = true;
-		/*chech;*/
-	} else  st1sama();
-}
-
-void t1vier() {
-	s.mlieu = 17;
-	affrep();
-}
-
-void t1neig() {
-	inei = inei + 1;
-	if (inei > 2) {
-		crep = 1506;
-		tperd();
-	} else {
-		okdes = true;
-		s.mlieu = 19;
-		affrep();
-	}
-}
-
-void t1deva() {
-	inei = 0;
-	s.mlieu = 21;
-	affrep();
-}
-
-void t1derr() {
-	s.mlieu = 22;
-	affrep();
-}
-
-void t1deau() {
-	crep = 1503;
-	tperd();
-}
-
-void tctrm() {
-	repon(2, (3000 + ctrm));
-	ctrm = 0;
-}
-
-
-void quelquun()
-
-{
-	integer haz, cx;
-
-	if (imen)  erase_menu();
-	finfouil();
-	crep = 997;
-L1:
-	if (! cache) {
-		if (crep == 997)  crep = 138;
-		repon(2, crep);
-		if (crep == 138)  parole(5, 2, 1);
-		else parole(4, 4, 1);
-		if (iouv == 0)  s.conf = s.conf + 2;
-		else if (s.conf < 50)  s.conf = s.conf + 4;
-		else
-			s.conf = s.conf + (3 * (s.conf / 10));
-		tsort();
-		tmlieu(15);
-		tip(ipers, cx);
-		caff = 69 + cx;
-		crep = caff;
-		msg[3] = discut;
-		msg[4] = disc[cx];
-		syn = true;
-		col = true;
-	} else {
-		haz = hazard(1, 3);
-		if (haz == 2) {
-			cache = false;
-			crep = 137;
-			goto L1;
-		} else {
-			repon(2, 136);
-			haz = (hazard(0, 4)) - 2;
-			parole(3, haz, 1);
-			clsf2();
-			person();
-			debloc(21);
-			affrep();
-		}
-	}
-	if (imen)  draw_menu();
-}
-
-void tsuiv() {
-	integer cx, tbcl;
-	integer cl, cy;
-
-	cy = acha + ((mchai - 1) * 10) - 1;
-	cx = 0;
-	do {
-		cx = cx + 1;
-		cs = cs + 1;
-		cl = cy + cs;
-		tbcl = tabdon[cl];
-	} while (!((tbcl != 0) || (cs > 9)));
-	if ((tbcl != 0) && (cs < 11)) {
-		is = is + 1;
-		caff = tbcl;
-		crep = caff + 400;
-		if (ipers != 0)  s.conf = s.conf + 2;
-	} else {
-		affrep();
-		finfouil();
-		if (cx > 9)  crep = 131;
-	}
-}
-
-void tfleche() {
-	boolean qust;
-	char touch;
-	integer dummy, cd, xmo, ymo;
-
-	if (num == 9999)  return;
-	fenat(chr(152));
-	rect = false;
-	do {
-		touch = '\0';
-
-		do {
-			mov_mouse(qust, touch);
-			if (clic)  rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
-			tinke();
-		} while (!(qust || rect || anyone));
-
-		if (qust && (touch == '\103'))  dummy = do_alert(stpou, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) ||
-	           (anyone) || (rect)));
-	if (touch == '\73')  iesc = true;
-	if (rect) {
-		x = x_s;
-		y = y_s;
-	}
-}
-
-void tcoord(integer sx)
-
-{
-	integer sy, ix, iy, cb, cy, ib;
-	integer a, b, atdon;
-
-
-	num = 0;
-	crep = 999;
-	a = 0;
-	atdon = amzon + 3;
-	cy = 0;
-	while (cy < caff) {
-		a = a + tabdon[atdon];
-		atdon = atdon + 4;
-		cy = succ(integer, cy);
-	}
-	/*     for cy:=0 to caff-1 do
-	          a:=a+ tabdon[amzon+3+4*cy];
-	     b:= peek(amzon+3+4*caff); */
-	b = tabdon[atdon];
-	if (b == 0)  goto L1;
-	a = a + fleche;
-	cb = 0;
-	for (cy = 0; cy <= (sx - 2); cy ++) {
-		ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
-		cb = cb + (ib * 4) + 2;
-	}
-	ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
-	if (ib == 0)  goto L1;
-	cy = 1;
-	do {
-		cb = cb + 2;
-		sx = tabdon[a + cb] * res;
-		sy = tabdon[succ(integer, a + cb)];
-		cb = cb + 2;
-		ix = tabdon[a + cb] * res;
-		iy = tabdon[succ(integer, a + cb)];
-		cy = cy + 1;
-	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
-	           || (cy > ib)));
-	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
-
-	{
-		num = cy - 1;
-		return;
-	}
-L1:
-	crep = 997;
-}
-
-
-void st7(integer ob) {
-	crep = 183;
-	if ((ob == 116) || (ob == 144))  crep = 104;
-	if ((ob == 126) || (ob == 111))  crep = 108;
-	if (ob == 132)  crep = 111;
-	if (ob == 142)  crep = 112;
-	if (crep == 183)  st4(ob);
-}
-
-void treg(integer ob) {
-	integer mdes;
-
-	mdes = caff;
-	caff = ob;
-	if (((caff > 29) && (caff < 33)) || (caff == 144) ||
-	        (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
-		afdes(0);
-		if ((caff > 29) && (caff < 33))  repon(2, caff);
-		else repon(2, (caff + 400));
-		tkey1(true);
-		caff = mdes;
-		msg[3] = 0;
-		crep = 998;
-	} else {
-		obpart = true;
-		crep = caff + 400;
-		mfoudi();
-	}
-}
-
-void avpoing(integer &ob) {
-	crep = 999;
-	if (s.derobj != 0)  ajjer(s.derobj);
-	if (crep != 139) {
-		modobj(ob + 400);
-		s.derobj = ob;
-		ob = 0;
-	}
-}
-
-void rechai(integer &ch) {
-	integer cx;
-
-	cx = s.mlieu;
-	if (s.mlieu == 16)  cx = 14;
-	ch = tabdon[achai + (cx * 7) + pred(integer, num)];
-}
-
-void t23coul(integer &l) {
-	boolean d;
-
-	cherjer(143, d);
-	l = 14;
-	if (! d) {
-		crep = 1512;
-		tperd();
-	}
-}
-
-void maivid() {
-	s.derobj = 0;
-	modobj(500);
-}
-
-void st13(integer ob) {
-	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
-	        (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
-	        (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
-	        (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
-	        (ob == 150) || (ob == 152))  crep = 999;
-	else crep = 105;
-}
-
-void aldepl() {
-	integer dummy;
-
-	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
-}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
new file mode 100644
index 0000000..d1de4b7
--- /dev/null
+++ b/engines/mortevielle/mouse.cpp
@@ -0,0 +1,459 @@
+const integer m_arrow = 0;
+const integer m_point_hand = 1;
+
+boolean int_m,
+        clic;
+
+integer m_show,
+        x_s,
+        y_s,
+        p_o_s,
+        mouse_shwn;
+
+matrix<0, 5, 0, 11, integer> s_s;
+
+
+void init_mouse() {
+	integer i, j;
+	registres reg;
+
+	mouse_shwn = 0;
+	x_s = 0;
+	y_s = 0;
+	p_o_s = 0;
+	/*int_m:= False;*/
+	clic = false;
+	m_show = m_arrow;
+	if ((memw[0xcc] == 0) && (memw[0xce] == 0))  int_m = false;
+	if (int_m) {
+		reg.ax = 0;
+		intr(0x33, reg);
+		int_m = (reg.ax == -1);
+		if (int_m) {
+			{
+				reg.ax = 4;
+				reg.cx = 0;
+				reg.dx = 0;
+			}
+			intr(0x33, reg);
+		}
+	}
+}
+
+/*procedure change_mouse( t : integer );
+begin
+  m_show:= t;
+end;*/
+
+/*procedure dessine_souris(xf,yf:integer);
+  var x, xx, y :integer;
+begin
+  case m_show of
+             m_arrow : begin
+                         affput(2,Gd,xf,yf,0,0);
+                       end;
+  end;
+end;  */
+
+void hide_mouse() {
+	integer i, j, k, ps, ds;
+	boolean imp;
+
+	mouse_shwn = pred(integer, mouse_shwn);
+	if (mouse_shwn == 0) {
+		imp = odd(y_s);
+		j = p_o_s;
+		switch (gd) {
+		case cga : {
+			k = 0;
+			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+			do {
+				memw[0xb000 + j] = s_s[0][k];
+				memw[0xb800 + j + 2] = s_s[1][k];
+				memw[0xba00 + j] = s_s[2][k];
+				memw[0xba00 + j + 2] = s_s[3][k];
+				j = j + 80;
+				k = succ(integer, k);
+			} while (!(k >= 5));
+		}
+		break;
+		case ams : {
+			for (i = 0; i <= 3; i ++) {
+				port[0x3dd] = 1 << i;
+				k = 0;
+				j = p_o_s;
+				do {
+					if (imp) {
+						memw[0xb800 + j] = s_s[i][k];
+						j = j + 80 - 0x2000;
+					} else {
+						memw[0xb800 + j] = s_s[i][k];
+						j = j + 0x2000;
+					}
+					imp = ! imp;
+					k = succ(integer, k);
+				} while (!(k >= 8));
+			}
+		}
+		break;
+		case ega : {
+			port[0x3c4] = 2;
+			port[0x3ce] = 8;
+			port[0x3cf] = 255;
+			i = 0;
+			do {
+				port[0x3c5] = 1 << i;
+				k = 0;
+				j = p_o_s;
+				do {
+					ps = mem[0xa000 + j];
+					mem[0xa000 + j] = lo(s_s[i][k]);
+					ps = mem[0xa000 + j + 1];
+					mem[0xa000 + j + 1] = hi(s_s[i][k]);
+					j = j + 80;
+					k = succ(integer, k);
+				} while (!(k >= 8));
+				i = i + 1;
+			} while (!(i == 4));
+		}
+		break;
+		case her : {
+			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+			for (i = 0; i <= 5; i ++) {
+				for (k = 0; k <= 3; k ++) memw[0xb000 + k * 0x200 + j] = s_s[i][k];
+				j = j + 80;
+			}
+		}
+		break;
+		case tan : {
+			j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+			k = 0;
+			do {
+				for (i = 0; i <= 3; i ++) {
+					memw[0xb800 + 0x200 * i + j] = s_s[k][i + (k << 2)];
+					memw[0xb800 + 0x200 * i + j + 2] = s_s[k + 3][i + (k << 2)];
+				}
+				j = j + 160;
+				k = succ(integer, k);
+			} while (!(k == 3));
+		}
+		break;
+
+		}     /* case Gd */
+	}
+}
+
+void show_mouse() {
+	integer i, j, k, l,
+	        ps, ds;
+	boolean imp;
+	char c;
+
+	mouse_shwn = mouse_shwn + 1;
+	if (mouse_shwn != 1)  return;
+	j = p_o_s;
+	imp = odd(y_s);
+	i = x_s & 7;
+	switch (gd) {
+	case cga : {
+		k = 0;
+		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+		do {
+			s_s[0][k] = memw[0xb800 + j];
+			s_s[1][k] = memw[0xb800 + j + 2];
+			s_s[2][k] = memw[0xba00 + j];
+			s_s[3][k] = memw[0xba00 + j + 2];
+			j = j + 80;
+			k = succ(integer, k);
+		} while (!(k >= 5));
+	}
+	break;
+	case ams : {
+		for (i = 0; i <= 3; i ++) {
+			j = p_o_s;
+			imp = odd(y_s);
+			port[0x3de] = i;
+			k = 0;
+			do {
+				if (imp) {
+					s_s[i][k] = memw[0xb800 + j];
+					j = j + 80 - 0x2000;
+				} else {
+					s_s[i][k] = memw[0xb800 + j];
+					j = j + 0x2000;
+				}
+				imp = ! imp;
+				k = succ(integer, k);
+			} while (!(k >= 8));
+		}
+	}
+	break;
+	case ega : {
+		port[0x3ce] = 4;
+		l = 0;
+		do {
+			port[0x3cf] = l;
+			k = 0;
+			j = p_o_s;
+			do {
+				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(integer, j)] << 8);
+				j = j + 80;
+				k = succ(integer, k);
+			} while (!(k >= 8));
+			l = l + 1;
+		} while (!(l == 4));
+	}
+	break;
+	case her : {
+		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+		for (i = 0; i <= 5; i ++) {
+			for (k = 0; k <= 3; k ++) s_s[i][k] = memw[0xb000 + k * 0x200 + j];
+			j = j + 80;
+		}
+	}
+	break;
+	case tan : {
+		j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+		k = 0;
+		do {
+			for (i = 0; i <= 3; i ++) {
+				s_s[k][i + (k << 2)] = memw[0xb800 + 0x200 * i + j];
+				s_s[k + 3][i + (k << 2)] = memw[0xb800 + 0x200 * i + j + 2];
+			}
+			j = j + 160;
+			k = succ(integer, k);
+		} while (!(k == 3));
+	}
+	break;
+	}    /*  case Gd   */
+	affput(2, gd, x_s, y_s, 0, 0);
+}
+
+void pos_mouse(integer x, integer y) {
+	registres reg;
+
+	if (x > 314 * res)  x = 314 * res;
+	else if (x < 0)  x = 0;
+	if (y > 199)  y = 199;
+	else if (y < 0)  y = 0;
+	if ((x == x_s) && (y == y_s))  return;
+	if (int_m) {
+		{
+			reg.ax = 4;
+			reg.cx = x;
+			reg.dx = y;
+		}
+		intr(0x33, reg);
+	}
+	hide_mouse();
+	x_s = x;
+	y_s = y;
+	switch (gd) {
+	case ams : {
+		p_o_s = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3) + (y_s & 1) * 0x2000;
+	}
+	break;
+	/*cga : begin
+	        P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
+	      end;*/
+	case ega : {
+		p_o_s = y_s * 80 + ((cardinal)x_s >> 3);
+	}
+	break;
+	}    /*  case Gd   */
+	show_mouse();
+}
+
+void read_pos_mouse(integer &x, integer &y, integer &c) {
+	registres reg;
+
+	if (int_m) {
+		reg.ax = 3;
+		intr(0x33, reg);
+		x = reg.cx;
+		y = reg.dx;
+		c = reg.bx;
+	} else {
+		c = 0;
+		x = x_s;
+		y = y_s;
+	}
+}
+
+void mov_mouse(boolean &funct, char &key) {
+	boolean p_key;
+	char in1, in2;
+	integer x, y, cx, cy, cd;
+	registres reg;
+
+	if (int_m) {
+		reg.ax = 3;
+		intr(0x33, reg);
+		x = reg.cx;
+		y = reg.dx;
+		cd = reg.bx;
+		pos_mouse(x, y);
+		if (cd != 0) {
+			clic = true;
+			return;
+		}
+	}
+	funct = false;
+	key = '\377';
+	p_key = keypressed();
+	while (p_key) {
+		input >> kbd >> in1;
+		read_pos_mouse(cx, cy, cd);
+		switch (upcase(in1)) {
+		case '4' :
+			cx = cx - 8;
+			break;
+		case '2' :
+			cy = cy + 8;
+			break;
+		case '6' :
+			cx = cx + 8;
+			break;
+		case '8' :
+			cy = cy - 8;
+			break;
+		case '7' : {
+			cy = 1;
+			cx = 1;
+		}
+		break;
+		case '1' : {
+			cx = 1;
+			cy = 190;
+		}
+		break;
+		case '9' : {
+			cx = 315 * res;
+			cy = 1;
+		}
+		break;
+		case '3' : {
+			cy = 190;
+			cx = 315 * res;
+		}
+		break;
+		case '5' : {
+			cy = 100;
+			cx = 155 * res;
+		}
+		break;
+		case ' ':
+		case '\15' : {
+			clic = true;
+			return;
+		}
+		break;
+		case '\33' : {
+			p_key = keypressed();
+			if (p_key) {
+				input >> kbd >> in2;
+				switch (in2) {
+				case 'K' :
+					cx = pred(integer, cx);
+					break;
+				case 'P' :
+					cy = succ(integer, cy);
+					break;
+				case 'M' :
+					cx = cx + 2;
+					break;
+				case 'H' :
+					cy = pred(integer, cy);
+					break;
+				case RANGE_10(';', 'D') : {
+					funct = true;
+					key = in2;
+					return;
+				}
+				break;
+				case 'G' : {
+					cx = cx - 1;
+					cy = cy - 1;
+				}
+				break;
+				case 'I' : {
+					cx = cx + 1;
+					cy = cy - 1;
+				}
+				break;
+				case 'O' : {
+					cx = cx - 1;
+					cy = cy + 1;
+				}
+				break;
+				case 'Q' : {
+					cx = cx + 1;
+					cy = cy + 1;
+				}
+				break;
+				}    /* case */
+			}
+		}
+		break;
+		case 'I' : {
+			cx = res * 32;
+			cy = 8;
+		}
+		break;
+		case 'D' : {
+			cx = 80 * res;
+			cy = 8;
+		}
+		break;
+		case 'A' : {
+			cx = 126 * res;
+			cy = 8;
+		}
+		break;
+		case 'S' : {
+			cx = 174 * res;
+			cy = 8;
+		}
+		break;
+		case 'P' : {
+			cx = 222 * res;
+			cy = 8;
+		}
+		break;
+		case 'F' : {
+			cx = res * 270;
+			cy = 8;
+		}
+		break;
+		case '\23' : {
+			sonoff = ! sonoff;
+			return;
+		}
+		break;
+		case '\26' : {
+			zuul = true;
+			return;
+		}
+		break;
+		case '\24' : {           /* ^T => mode tandy */
+			funct = true;
+			key = '\11';
+		}
+		break;
+		case '\10' : {           /* ^H => mode Hercule */
+			funct = true;
+			key = '\7';
+		}
+		break;
+		case '\1':
+		case '\3':
+		case '\5' : {
+			funct = true;
+			key = in1;
+		}
+		break;
+		}
+		pos_mouse(cx, cy);
+		p_key = keypressed();
+	}
+}
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
deleted file mode 100644
index d1de4b7..0000000
--- a/engines/mortevielle/mouse.h
+++ /dev/null
@@ -1,459 +0,0 @@
-const integer m_arrow = 0;
-const integer m_point_hand = 1;
-
-boolean int_m,
-        clic;
-
-integer m_show,
-        x_s,
-        y_s,
-        p_o_s,
-        mouse_shwn;
-
-matrix<0, 5, 0, 11, integer> s_s;
-
-
-void init_mouse() {
-	integer i, j;
-	registres reg;
-
-	mouse_shwn = 0;
-	x_s = 0;
-	y_s = 0;
-	p_o_s = 0;
-	/*int_m:= False;*/
-	clic = false;
-	m_show = m_arrow;
-	if ((memw[0xcc] == 0) && (memw[0xce] == 0))  int_m = false;
-	if (int_m) {
-		reg.ax = 0;
-		intr(0x33, reg);
-		int_m = (reg.ax == -1);
-		if (int_m) {
-			{
-				reg.ax = 4;
-				reg.cx = 0;
-				reg.dx = 0;
-			}
-			intr(0x33, reg);
-		}
-	}
-}
-
-/*procedure change_mouse( t : integer );
-begin
-  m_show:= t;
-end;*/
-
-/*procedure dessine_souris(xf,yf:integer);
-  var x, xx, y :integer;
-begin
-  case m_show of
-             m_arrow : begin
-                         affput(2,Gd,xf,yf,0,0);
-                       end;
-  end;
-end;  */
-
-void hide_mouse() {
-	integer i, j, k, ps, ds;
-	boolean imp;
-
-	mouse_shwn = pred(integer, mouse_shwn);
-	if (mouse_shwn == 0) {
-		imp = odd(y_s);
-		j = p_o_s;
-		switch (gd) {
-		case cga : {
-			k = 0;
-			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
-			do {
-				memw[0xb000 + j] = s_s[0][k];
-				memw[0xb800 + j + 2] = s_s[1][k];
-				memw[0xba00 + j] = s_s[2][k];
-				memw[0xba00 + j + 2] = s_s[3][k];
-				j = j + 80;
-				k = succ(integer, k);
-			} while (!(k >= 5));
-		}
-		break;
-		case ams : {
-			for (i = 0; i <= 3; i ++) {
-				port[0x3dd] = 1 << i;
-				k = 0;
-				j = p_o_s;
-				do {
-					if (imp) {
-						memw[0xb800 + j] = s_s[i][k];
-						j = j + 80 - 0x2000;
-					} else {
-						memw[0xb800 + j] = s_s[i][k];
-						j = j + 0x2000;
-					}
-					imp = ! imp;
-					k = succ(integer, k);
-				} while (!(k >= 8));
-			}
-		}
-		break;
-		case ega : {
-			port[0x3c4] = 2;
-			port[0x3ce] = 8;
-			port[0x3cf] = 255;
-			i = 0;
-			do {
-				port[0x3c5] = 1 << i;
-				k = 0;
-				j = p_o_s;
-				do {
-					ps = mem[0xa000 + j];
-					mem[0xa000 + j] = lo(s_s[i][k]);
-					ps = mem[0xa000 + j + 1];
-					mem[0xa000 + j + 1] = hi(s_s[i][k]);
-					j = j + 80;
-					k = succ(integer, k);
-				} while (!(k >= 8));
-				i = i + 1;
-			} while (!(i == 4));
-		}
-		break;
-		case her : {
-			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
-			for (i = 0; i <= 5; i ++) {
-				for (k = 0; k <= 3; k ++) memw[0xb000 + k * 0x200 + j] = s_s[i][k];
-				j = j + 80;
-			}
-		}
-		break;
-		case tan : {
-			j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
-			k = 0;
-			do {
-				for (i = 0; i <= 3; i ++) {
-					memw[0xb800 + 0x200 * i + j] = s_s[k][i + (k << 2)];
-					memw[0xb800 + 0x200 * i + j + 2] = s_s[k + 3][i + (k << 2)];
-				}
-				j = j + 160;
-				k = succ(integer, k);
-			} while (!(k == 3));
-		}
-		break;
-
-		}     /* case Gd */
-	}
-}
-
-void show_mouse() {
-	integer i, j, k, l,
-	        ps, ds;
-	boolean imp;
-	char c;
-
-	mouse_shwn = mouse_shwn + 1;
-	if (mouse_shwn != 1)  return;
-	j = p_o_s;
-	imp = odd(y_s);
-	i = x_s & 7;
-	switch (gd) {
-	case cga : {
-		k = 0;
-		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
-		do {
-			s_s[0][k] = memw[0xb800 + j];
-			s_s[1][k] = memw[0xb800 + j + 2];
-			s_s[2][k] = memw[0xba00 + j];
-			s_s[3][k] = memw[0xba00 + j + 2];
-			j = j + 80;
-			k = succ(integer, k);
-		} while (!(k >= 5));
-	}
-	break;
-	case ams : {
-		for (i = 0; i <= 3; i ++) {
-			j = p_o_s;
-			imp = odd(y_s);
-			port[0x3de] = i;
-			k = 0;
-			do {
-				if (imp) {
-					s_s[i][k] = memw[0xb800 + j];
-					j = j + 80 - 0x2000;
-				} else {
-					s_s[i][k] = memw[0xb800 + j];
-					j = j + 0x2000;
-				}
-				imp = ! imp;
-				k = succ(integer, k);
-			} while (!(k >= 8));
-		}
-	}
-	break;
-	case ega : {
-		port[0x3ce] = 4;
-		l = 0;
-		do {
-			port[0x3cf] = l;
-			k = 0;
-			j = p_o_s;
-			do {
-				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(integer, j)] << 8);
-				j = j + 80;
-				k = succ(integer, k);
-			} while (!(k >= 8));
-			l = l + 1;
-		} while (!(l == 4));
-	}
-	break;
-	case her : {
-		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
-		for (i = 0; i <= 5; i ++) {
-			for (k = 0; k <= 3; k ++) s_s[i][k] = memw[0xb000 + k * 0x200 + j];
-			j = j + 80;
-		}
-	}
-	break;
-	case tan : {
-		j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
-		k = 0;
-		do {
-			for (i = 0; i <= 3; i ++) {
-				s_s[k][i + (k << 2)] = memw[0xb800 + 0x200 * i + j];
-				s_s[k + 3][i + (k << 2)] = memw[0xb800 + 0x200 * i + j + 2];
-			}
-			j = j + 160;
-			k = succ(integer, k);
-		} while (!(k == 3));
-	}
-	break;
-	}    /*  case Gd   */
-	affput(2, gd, x_s, y_s, 0, 0);
-}
-
-void pos_mouse(integer x, integer y) {
-	registres reg;
-
-	if (x > 314 * res)  x = 314 * res;
-	else if (x < 0)  x = 0;
-	if (y > 199)  y = 199;
-	else if (y < 0)  y = 0;
-	if ((x == x_s) && (y == y_s))  return;
-	if (int_m) {
-		{
-			reg.ax = 4;
-			reg.cx = x;
-			reg.dx = y;
-		}
-		intr(0x33, reg);
-	}
-	hide_mouse();
-	x_s = x;
-	y_s = y;
-	switch (gd) {
-	case ams : {
-		p_o_s = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3) + (y_s & 1) * 0x2000;
-	}
-	break;
-	/*cga : begin
-	        P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
-	      end;*/
-	case ega : {
-		p_o_s = y_s * 80 + ((cardinal)x_s >> 3);
-	}
-	break;
-	}    /*  case Gd   */
-	show_mouse();
-}
-
-void read_pos_mouse(integer &x, integer &y, integer &c) {
-	registres reg;
-
-	if (int_m) {
-		reg.ax = 3;
-		intr(0x33, reg);
-		x = reg.cx;
-		y = reg.dx;
-		c = reg.bx;
-	} else {
-		c = 0;
-		x = x_s;
-		y = y_s;
-	}
-}
-
-void mov_mouse(boolean &funct, char &key) {
-	boolean p_key;
-	char in1, in2;
-	integer x, y, cx, cy, cd;
-	registres reg;
-
-	if (int_m) {
-		reg.ax = 3;
-		intr(0x33, reg);
-		x = reg.cx;
-		y = reg.dx;
-		cd = reg.bx;
-		pos_mouse(x, y);
-		if (cd != 0) {
-			clic = true;
-			return;
-		}
-	}
-	funct = false;
-	key = '\377';
-	p_key = keypressed();
-	while (p_key) {
-		input >> kbd >> in1;
-		read_pos_mouse(cx, cy, cd);
-		switch (upcase(in1)) {
-		case '4' :
-			cx = cx - 8;
-			break;
-		case '2' :
-			cy = cy + 8;
-			break;
-		case '6' :
-			cx = cx + 8;
-			break;
-		case '8' :
-			cy = cy - 8;
-			break;
-		case '7' : {
-			cy = 1;
-			cx = 1;
-		}
-		break;
-		case '1' : {
-			cx = 1;
-			cy = 190;
-		}
-		break;
-		case '9' : {
-			cx = 315 * res;
-			cy = 1;
-		}
-		break;
-		case '3' : {
-			cy = 190;
-			cx = 315 * res;
-		}
-		break;
-		case '5' : {
-			cy = 100;
-			cx = 155 * res;
-		}
-		break;
-		case ' ':
-		case '\15' : {
-			clic = true;
-			return;
-		}
-		break;
-		case '\33' : {
-			p_key = keypressed();
-			if (p_key) {
-				input >> kbd >> in2;
-				switch (in2) {
-				case 'K' :
-					cx = pred(integer, cx);
-					break;
-				case 'P' :
-					cy = succ(integer, cy);
-					break;
-				case 'M' :
-					cx = cx + 2;
-					break;
-				case 'H' :
-					cy = pred(integer, cy);
-					break;
-				case RANGE_10(';', 'D') : {
-					funct = true;
-					key = in2;
-					return;
-				}
-				break;
-				case 'G' : {
-					cx = cx - 1;
-					cy = cy - 1;
-				}
-				break;
-				case 'I' : {
-					cx = cx + 1;
-					cy = cy - 1;
-				}
-				break;
-				case 'O' : {
-					cx = cx - 1;
-					cy = cy + 1;
-				}
-				break;
-				case 'Q' : {
-					cx = cx + 1;
-					cy = cy + 1;
-				}
-				break;
-				}    /* case */
-			}
-		}
-		break;
-		case 'I' : {
-			cx = res * 32;
-			cy = 8;
-		}
-		break;
-		case 'D' : {
-			cx = 80 * res;
-			cy = 8;
-		}
-		break;
-		case 'A' : {
-			cx = 126 * res;
-			cy = 8;
-		}
-		break;
-		case 'S' : {
-			cx = 174 * res;
-			cy = 8;
-		}
-		break;
-		case 'P' : {
-			cx = 222 * res;
-			cy = 8;
-		}
-		break;
-		case 'F' : {
-			cx = res * 270;
-			cy = 8;
-		}
-		break;
-		case '\23' : {
-			sonoff = ! sonoff;
-			return;
-		}
-		break;
-		case '\26' : {
-			zuul = true;
-			return;
-		}
-		break;
-		case '\24' : {           /* ^T => mode tandy */
-			funct = true;
-			key = '\11';
-		}
-		break;
-		case '\10' : {           /* ^H => mode Hercule */
-			funct = true;
-			key = '\7';
-		}
-		break;
-		case '\1':
-		case '\3':
-		case '\5' : {
-			funct = true;
-			key = in1;
-		}
-		break;
-		}
-		pos_mouse(cx, cy);
-		p_key = keypressed();
-	}
-}
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
new file mode 100644
index 0000000..7c8f1c9
--- /dev/null
+++ b/engines/mortevielle/outtext.cpp
@@ -0,0 +1,206 @@
+str255 delig;
+const array<0, 31, byte> tabdr
+= {{
+		32, 101, 115,  97, 114, 105, 110,
+		117, 116, 111, 108,  13, 100,  99,
+		112, 109,  46, 118, 130,  39, 102,
+		98,  44, 113, 104, 103,  33,  76,
+		85, 106,  30,  31
+	}
+};
+
+
+const array<0, 31, byte> tab30
+= {{
+		69,  67,  74, 138, 133, 120,  77, 122,
+		121,  68,  65,  63,  73,  80,  83,  82,
+		156,  45,  58,  79,  49,  86,  78,  84,
+		71,  81,  64,  66, 135,  34, 136,  91
+	}
+};
+
+
+
+const array<0, 31, byte> tab31
+= {{
+		93,  47,  48,  53,  50,  70, 124,  75,
+		72, 147, 140, 150, 151,  57,  56,  51,
+		107, 139,  55,  89, 131,  37,  54,  88,
+		119,   0,   0,   0,   0,   0,   0,   0
+	}
+};
+
+void deline(integer num , phrase &l , integer &tl);
+
+static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
+	const array<0, 31, char> rap
+	= {{ ',', ':', '@', '!', '?', '-', '‡',
+			' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
+			'‹', 'Œ', '¢', '\47', '“', '"', '—',
+			'–', '0', '1', '2', '3', '4', '5',
+			'6', '7', '8', '9'
+		}
+	};
+	integer oct, ocd;
+
+	/* 5-8 */
+	oct = t_mot[ind];
+	oct = (cardinal)(oct << (16 - pt)) >> (16 - pt);
+	if (pt < 6) {
+		ind = ind + 1;
+		oct = oct << (5 - pt);
+		pt = pt + 11;
+		oct = oct | ((cardinal)t_mot[ind] >> pt);
+	} else {
+		pt = pt - 5;
+		oct = (cardinal)oct >> pt;
+	}
+
+	switch (oct) {
+	case 11 : {
+		c = '$';
+		the_end = true;
+	}
+	break;
+	case 30:
+	case 31 : {
+		ocd = t_mot[ind];
+		ocd = (cardinal)(ocd << (16 - pt)) >> (16 - pt);
+		if (pt < 6) {
+			ind = ind + 1;
+			ocd = ocd << (5 - pt);
+			pt = pt + 11;
+			ocd = ocd | ((cardinal)t_mot[ind] >> pt);
+		} else {
+			pt = pt - 5;
+			ocd = (cardinal)ocd >> pt;
+		}
+		if (oct == 30)  c = chr(tab30[ocd]);
+		else c = chr(tab31[ocd]);
+		if (c == '\0') {
+			the_end = true;
+			c = '#';
+		}
+	}
+	break;
+	default:
+		c = chr(tabdr[oct]);
+	}
+}              /* 5-8 */
+
+void deline(integer num , phrase &l , integer &tl) {
+	integer i, j, ts;
+	char let;
+	byte ps, k;
+	boolean the_end;
+
+	/* DETEX */
+	/*debug('  => DeLine');*/
+	delig = "";
+	ts = t_rec[num].indis;
+	ps = t_rec[num].point;
+	i = ts;
+	tl = 1;
+	j = 1;
+	k = ps;
+	the_end = false;
+	do {
+		cinq_huit(let, i, k, the_end);
+		l[j] = let;
+		if (j < 254)  delig = delig + let;
+		j = j + 1;
+	} while (!the_end);
+	tl = j - 1;
+	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */
+}       /* DETEX */
+
+
+void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ);
+
+
+static integer l_motsuiv(integer p, phrase &ch, integer &tab) {
+	integer c;
+
+	integer l_motsuiv_result;
+	c = p;
+	while (!(set::of(' ', '$', '@', eos).has(ch[p])))  p = p + 1;
+	l_motsuiv_result = tab * (p - c);
+	return l_motsuiv_result;
+}
+
+void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ) {
+	boolean the_end;
+	char touch;
+	integer xf, yf;
+	integer xc, yc;
+	integer tab, p;
+	varying_string<255> s;
+	integer i, j, nt;
+
+
+	/*    debug('  .. Afftex');*/
+	putxy(x, y);
+	if (res == 1)  tab = 10;
+	else tab = 6;
+	dx = dx * 6;
+	dy = dy * 6;
+	xc = x;
+	yc = y;
+	xf = x + dx;
+	yf = y + dy;
+	p = 1;
+	the_end = (ch[p] == '$');
+	s = "";
+	while (! the_end) {
+		switch (ch[p]) {
+		case '@' : {
+			writeg(s, typ);
+			s = "";
+			p = p + 1;
+			xc = x;
+			yc = yc + 6;
+			putxy(xc, yc);
+		}
+		break;
+		case ' ' : {
+			s = s + ' ';
+			xc = xc + tab;
+			p = p + 1;
+			if (l_motsuiv(p, ch, tab) + xc > xf) {
+				writeg(s, typ);
+				s = "";
+				xc = x;
+				yc = yc + 6;
+				if (yc > yf) {
+					do {
+						;
+					} while (!keypressed());
+					i = y;
+					do {
+						j = x;
+						do {
+							putxy(j, i);
+							writeg(" ", 0);
+							j = j + 6;
+						} while (!(j > xf));
+						i = i + 6;
+					} while (!(i > yf));
+					yc = y;
+				}
+				putxy(xc, yc);
+			}
+		}
+		break;
+		case '$' : {
+			the_end = true;
+			writeg(s, typ);
+		}
+		break;
+		default: {
+			s = s + ch[p];
+			p = p + 1;
+			xc = xc + tab;
+		}
+		}     /* case */
+	}
+}
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
deleted file mode 100644
index 7c8f1c9..0000000
--- a/engines/mortevielle/outtext.h
+++ /dev/null
@@ -1,206 +0,0 @@
-str255 delig;
-const array<0, 31, byte> tabdr
-= {{
-		32, 101, 115,  97, 114, 105, 110,
-		117, 116, 111, 108,  13, 100,  99,
-		112, 109,  46, 118, 130,  39, 102,
-		98,  44, 113, 104, 103,  33,  76,
-		85, 106,  30,  31
-	}
-};
-
-
-const array<0, 31, byte> tab30
-= {{
-		69,  67,  74, 138, 133, 120,  77, 122,
-		121,  68,  65,  63,  73,  80,  83,  82,
-		156,  45,  58,  79,  49,  86,  78,  84,
-		71,  81,  64,  66, 135,  34, 136,  91
-	}
-};
-
-
-
-const array<0, 31, byte> tab31
-= {{
-		93,  47,  48,  53,  50,  70, 124,  75,
-		72, 147, 140, 150, 151,  57,  56,  51,
-		107, 139,  55,  89, 131,  37,  54,  88,
-		119,   0,   0,   0,   0,   0,   0,   0
-	}
-};
-
-void deline(integer num , phrase &l , integer &tl);
-
-static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
-	const array<0, 31, char> rap
-	= {{ ',', ':', '@', '!', '?', '-', '‡',
-			' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
-			'‹', 'Œ', '¢', '\47', '“', '"', '—',
-			'–', '0', '1', '2', '3', '4', '5',
-			'6', '7', '8', '9'
-		}
-	};
-	integer oct, ocd;
-
-	/* 5-8 */
-	oct = t_mot[ind];
-	oct = (cardinal)(oct << (16 - pt)) >> (16 - pt);
-	if (pt < 6) {
-		ind = ind + 1;
-		oct = oct << (5 - pt);
-		pt = pt + 11;
-		oct = oct | ((cardinal)t_mot[ind] >> pt);
-	} else {
-		pt = pt - 5;
-		oct = (cardinal)oct >> pt;
-	}
-
-	switch (oct) {
-	case 11 : {
-		c = '$';
-		the_end = true;
-	}
-	break;
-	case 30:
-	case 31 : {
-		ocd = t_mot[ind];
-		ocd = (cardinal)(ocd << (16 - pt)) >> (16 - pt);
-		if (pt < 6) {
-			ind = ind + 1;
-			ocd = ocd << (5 - pt);
-			pt = pt + 11;
-			ocd = ocd | ((cardinal)t_mot[ind] >> pt);
-		} else {
-			pt = pt - 5;
-			ocd = (cardinal)ocd >> pt;
-		}
-		if (oct == 30)  c = chr(tab30[ocd]);
-		else c = chr(tab31[ocd]);
-		if (c == '\0') {
-			the_end = true;
-			c = '#';
-		}
-	}
-	break;
-	default:
-		c = chr(tabdr[oct]);
-	}
-}              /* 5-8 */
-
-void deline(integer num , phrase &l , integer &tl) {
-	integer i, j, ts;
-	char let;
-	byte ps, k;
-	boolean the_end;
-
-	/* DETEX */
-	/*debug('  => DeLine');*/
-	delig = "";
-	ts = t_rec[num].indis;
-	ps = t_rec[num].point;
-	i = ts;
-	tl = 1;
-	j = 1;
-	k = ps;
-	the_end = false;
-	do {
-		cinq_huit(let, i, k, the_end);
-		l[j] = let;
-		if (j < 254)  delig = delig + let;
-		j = j + 1;
-	} while (!the_end);
-	tl = j - 1;
-	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */
-}       /* DETEX */
-
-
-void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ);
-
-
-static integer l_motsuiv(integer p, phrase &ch, integer &tab) {
-	integer c;
-
-	integer l_motsuiv_result;
-	c = p;
-	while (!(set::of(' ', '$', '@', eos).has(ch[p])))  p = p + 1;
-	l_motsuiv_result = tab * (p - c);
-	return l_motsuiv_result;
-}
-
-void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ) {
-	boolean the_end;
-	char touch;
-	integer xf, yf;
-	integer xc, yc;
-	integer tab, p;
-	varying_string<255> s;
-	integer i, j, nt;
-
-
-	/*    debug('  .. Afftex');*/
-	putxy(x, y);
-	if (res == 1)  tab = 10;
-	else tab = 6;
-	dx = dx * 6;
-	dy = dy * 6;
-	xc = x;
-	yc = y;
-	xf = x + dx;
-	yf = y + dy;
-	p = 1;
-	the_end = (ch[p] == '$');
-	s = "";
-	while (! the_end) {
-		switch (ch[p]) {
-		case '@' : {
-			writeg(s, typ);
-			s = "";
-			p = p + 1;
-			xc = x;
-			yc = yc + 6;
-			putxy(xc, yc);
-		}
-		break;
-		case ' ' : {
-			s = s + ' ';
-			xc = xc + tab;
-			p = p + 1;
-			if (l_motsuiv(p, ch, tab) + xc > xf) {
-				writeg(s, typ);
-				s = "";
-				xc = x;
-				yc = yc + 6;
-				if (yc > yf) {
-					do {
-						;
-					} while (!keypressed());
-					i = y;
-					do {
-						j = x;
-						do {
-							putxy(j, i);
-							writeg(" ", 0);
-							j = j + 6;
-						} while (!(j > xf));
-						i = i + 6;
-					} while (!(i > yf));
-					yc = y;
-				}
-				putxy(xc, yc);
-			}
-		}
-		break;
-		case '$' : {
-			the_end = true;
-			writeg(s, typ);
-		}
-		break;
-		default: {
-			s = s + ch[p];
-			p = p + 1;
-			xc = xc + tab;
-		}
-		}     /* case */
-	}
-}
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
new file mode 100644
index 0000000..d40f8d3
--- /dev/null
+++ b/engines/mortevielle/ovd1.cpp
@@ -0,0 +1,337 @@
+void dem2() {
+	untyped_file f;
+	integer k;
+
+	/* -- demande de disk 2 -- */
+	while (ioresult != 0);
+	assign(f, "mort.001");
+	/*$i-*/
+	reset(f);
+	while (ioresult != 0) {
+		show_mouse();
+		k = do_alert(al_mess2, 1);
+		hide_mouse();
+		reset(f);
+	}
+	close(f);
+}
+
+void ani50() {
+	crep = animof(1, 1);
+	pictout(adani, crep, 63, 12);
+	crep = animof(2, 1);
+	pictout(adani, crep, 63, 12);
+	f2_all = (res == 1);
+	repon(2, c_paroles + 143);
+}
+
+/*overlay procedure apzuul;
+  begin
+    if (c_zzz=1) or (c_zzz=2) then
+     begin
+       zzuul(adcfiec+161,0,1644);
+       c_zzz:=succ(c_zzz);
+     end;
+  end;*/
+
+/* overlay */ void aff50(boolean c) {
+	integer k;
+
+	caff = 50;
+	maff = 0;
+	taffich();
+	dessine(ades, 63, 12);
+	if (c)  ani50();
+	else repon(2, c_paroles + 142);
+	f3f8();
+}
+
+/* overlay */ void init_menu() {
+	integer i, j, tai;
+	phrase st;
+	untyped_file f;
+
+	assign(f, "menufr.mor");
+	/*$i-*/
+	reset(f, 144);
+	blockread(f, lettres, 1);
+	close(f);
+	/* ----  Demande de changement de disquette  ---- */
+	dem2();
+
+
+	for (i = 1; i <= 8; i ++)
+		inv[i] = "*                     ";
+	inv[7] = "< -*-*-*-*-*-*-*-*-*- ";
+	for (i = 1; i <= 7; i ++)
+		dep[i] = "*                       ";
+	i = 1;
+	do {
+		deline(i + c_action, st, tai);
+		act[i] = delig + "          ";
+		if (i < 9) {
+			if (i < 6) {
+				deline(i + c_saction, st, tai);
+				self_[i] = delig + "       ";
+			}
+			deline(i + c_dis, st, tai);
+			dis[i] = delig + ' ';
+		}
+		i = succ(integer, i);
+	} while (!(i == 22));
+	for (i = 1; i <= 8; i ++) {
+		disc[i] = 0x500 + i;
+		if (i < 8)  depl[i] = 0x200 + i;
+		invt[i] = 0x100 + i;
+		if (i > 6)  menu_disable(invt[i]);
+	}
+	msg3 = no_choice;
+	msg4 = no_choice;
+	msg[3] = no_choice;
+	msg[4] = no_choice;
+	clic = false;
+}
+
+
+/* overlay */ void charpal() {
+	file<tabdb> f;
+	file<tfxx> ft;
+	integer i, j, k;
+	file<byte> fb;
+	byte b;
+
+	assign(ft, "fxx.mor");
+	/*$i-*/
+	reset(ft);
+	if (ioresult != 0) {
+		caff = do_alert(err_mess, 1);
+		exit(0);
+	}
+	ft >> l;
+	close(ft);
+	assign(f, "plxx.mor");
+	reset(f);
+	for (i = 0; i <= 90; i ++) f >> tabpal[i];
+	close(f);
+	assign(fb,  "cxx.mor");
+	reset(fb);
+	for (j = 0; j <= 90; j ++) {
+		fb >> palcga[j].p;
+		for (i = 0; i <= 15; i ++) {
+			nhom &with = palcga[j].a[i];
+
+			fb >> b;
+			with.n = (cardinal)b >> 4;
+			with.hom[0] = ((cardinal)b >> 2) & 3;
+			with.hom[1] = b & 3;
+		}
+	}
+	palcga[10].a[9] = palcga[10].a[5];
+	for (j = 0; j <= 14; j ++) {
+		fb >> tpt[j].tax;
+		fb >> tpt[j].tay;
+		for (i = 1; i <= 20; i ++)
+			for (k = 1; k <= 20; k ++)
+				fb >> tpt[j].des[i][k];
+	}
+	close(fb);
+}
+
+/* overlay */ void chartex() {
+	integer i;
+	untyped_file fibyte;
+	phrase s;
+
+	/* debug('o3 chartex'); */
+	i = 0;
+	assign(fibyte, "TXX.INP");
+	/*$i-*/
+	reset(fibyte);
+	blockread(fibyte, t_mot, 125);
+	close(fibyte);
+	assign(sauv_t, "TXX.NTP");
+	reset(sauv_t);
+	do {
+		sauv_t >> t_rec[i];
+		i = i + 1;
+	} while (!(eof(sauv_t)));
+	close(sauv_t);
+	deline(578, s, i);
+	al_mess = delig;
+	deline(579, s, i);
+	err_mess = delig;
+	deline(580, s, i);
+	ind_mess = delig;
+	deline(581, s, i);
+	al_mess2 = delig;
+}
+
+/* overlay */ void dialpre()
+
+{
+	integer cy, tay;
+	phrase st;
+	real ix;
+	char ch;
+
+
+	/* debug('o3 dialpre'); */
+	cy = 0;
+	clrscr;
+	textcolor(9);
+	do {
+		cy = cy + 1;
+		deline(cy + c_dialpre, st, tay);
+		gotoxy(40 - tay / 2, wherey + 1);
+		output << delig;
+	} while (!(cy == 20));
+	ix = 0;
+	do {
+		ix = ix + 1;
+	} while (!(keypressed() | (ix == 5e5)));
+	crep = 998;
+	textcolor(1);
+	gotoxy(1, 21);
+	clreol;
+	gotoxy(1, 23);
+	output << "CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512";
+	gotoxy(12, 24);
+	output << "Ctrl       C      E            H             T           A";
+	do {
+		input >> kbd >> ch;
+	} while (!(set::of('\1', '\3', '\5', '\24', '\10', eos).has(ch)));
+	switch (ch) {
+	case '\1':
+	case '\3':
+	case '\5' :
+		gd = (cardinal)ord(ch) >> 1;
+		break;
+	case '\10' :
+		gd = her;
+		break;
+	case '\24' :
+		gd = tan;
+		break;
+	}
+	gotoxy(1, 24);
+	clreol;
+	gotoxy(1, 23);
+	clreol;
+	gotoxy(26, 23);
+	output << "Jeu au Clavier / … la Souris";
+	textcolor(4);
+	gotoxy(33, 23);
+	output << 'C';
+	gotoxy(48, 23);
+	output << 'S';
+	do {
+		input >> kbd >> ch;
+	} while (!(set::of('C', 'S', eos).has(upcase(ch))));
+	int_m = (upcase(ch) == 'S');
+}
+
+/* overlay */ void init_lieu() {
+	file<tab_mlieu> f_lieu;
+
+	/* debug('o3 init_lieu'); */
+	assign(f_lieu, "MXX.mor");
+	/*$i-*/
+	reset(f_lieu);
+	f_lieu >> v_lieu;
+	close(f_lieu);
+}
+
+
+/* overlay */ void music() {
+	untyped_file fic;
+	integer k;


Commit: b462cbb5f00f1cd2bdab0f8bb9b5364eb5e1d9e8
    https://github.com/scummvm/scummvm/commit/b462cbb5f00f1cd2bdab0f8bb9b5364eb5e1d9e8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:16-07:00

Commit Message:
MORTEVIELLE: Plug the engine into makefiles

Changed paths:
  A engines/mortevielle/module.mk
    base/plugins.cpp
    configure



diff --git a/base/plugins.cpp b/base/plugins.cpp
index db8a5d8..1c4e6f1 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -139,6 +139,9 @@ public:
 		#if PLUGIN_ENABLED_STATIC(MOHAWK)
 		LINK_PLUGIN(MOHAWK)
 		#endif
+		#if PLUGIN_ENABLED_STATIC(MORTEVIELLE)
+		LINK_PLUGIN(MORTEVIELLE)
+		#endif
 		#if PLUGIN_ENABLED_STATIC(PARALLACTION)
 		LINK_PLUGIN(PARALLACTION)
 		#endif
diff --git a/configure b/configure
index 82620f3..7a557df 100755
--- a/configure
+++ b/configure
@@ -101,6 +101,7 @@ add_engine lastexpress "The Last Express" no
 add_engine lure "Lure of the Temptress" yes
 add_engine made "MADE" yes
 add_engine mohawk "Mohawk" yes "cstime myst riven"
+add_engine mortevielle "Mortevielle" no
 add_engine cstime "Where in Time is Carmen Sandiego?" no
 add_engine riven "Riven: The Sequel to Myst" no
 add_engine myst "Myst" no
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
new file mode 100644
index 0000000..6569d70
--- /dev/null
+++ b/engines/mortevielle/module.mk
@@ -0,0 +1,32 @@
+MODULE := engines/mortevielle
+ 
+MODULE_OBJS := \
+	actions.o \
+	alert.o \
+	boite.o \
+	disk.o \
+	droite.o \
+	keyboard.o \
+	level15.o \
+	menu.o \
+	mor.o \
+	mor2.o \
+	mort.o \
+	mouse.o \
+	outtext.o \
+	ovd1.o \
+	parole.o \
+	parole2.o \
+	prog.o \
+	ques.o \
+	sprint.o \
+	taffich.o \
+	var_mor.o
+ 
+# This module can be built as a plugin
+ifeq ($(ENABLE_MORTEVIELLE), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+ 
+# Include common rules 
+include $(srcdir)/rules.mk


Commit: a32594fa0d8f6001870e3b68cc82f93993408134
    https://github.com/scummvm/scummvm/commit/a32594fa0d8f6001870e3b68cc82f93993408134
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:17-07:00

Commit Message:
MORTEVIELLE: integer -> int

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1dd3abe..83ad8d4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -5,7 +5,7 @@ const char stouinon[] = "[2][ ][OUI][NON]";
 void taller()
 
 {
-	integer mx, cx, cy;
+	int mx, cx, cy;
 
 	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
 		s.mlieu = 15;
@@ -94,7 +94,7 @@ L2:
 }
 
 /* overlay */ void tprendre() {
-	integer cx, cy, cz;
+	int cx, cy, cz;
 
 	if (caff > 99) {
 		cx = caff;
@@ -115,7 +115,7 @@ L2:
 				obpart = false;
 				affrep();
 			} else {
-				tabdon[acha + (pred(integer, mchai) * 10) + pred(integer, cs)] = 0;
+				tabdon[acha + (pred(int, mchai) * 10) + pred(int, cs)] = 0;
 				tsuiv();
 				dobj = dobj + 1;
 				if (dobj > 6) {
@@ -188,7 +188,7 @@ L2:
 }
 
 /* overlay */ void tsprendre() {
-	integer cx, cy, cz;
+	int cx, cy, cz;
 
 	cx = 0;
 	do {
@@ -211,7 +211,7 @@ L2:
 /* overlay */ void tsoulever()
 
 {
-	integer cx;
+	int cx;
 
 	if (! syn)  ecr3("soulever");
 	tfleche();
@@ -230,12 +230,12 @@ L2:
 	cx = s.mlieu;
 	if (s.mlieu == 16)  cx = 14;
 	if (s.mlieu == 19)  cx = 15;
-	crep = tabdon[asoul + (cx << 3) + pred(integer, num)];
+	crep = tabdon[asoul + (cx << 3) + pred(int, num)];
 	if (crep == 255)  crep = 997;
 }
 
 /* overlay */ void tlire() {
-	integer iaff;
+	int iaff;
 
 	if (caff > 99)  st4(caff);
 	else {
@@ -254,7 +254,7 @@ L2:
 }
 
 /* overlay */ void tregarder() {
-	integer cx;
+	int cx;
 
 	if (caff > 99) {
 		crep = 103;
@@ -297,7 +297,7 @@ L2:
 	if (s.mlieu == 20)  cx = 17;
 	if ((s.mlieu > 21) && (s.mlieu < 25))  cx = cx - 4;
 	if (s.mlieu == 26)  cx = 21;
-	crep = tabdon[arega + (cx * 7) + pred(integer, num)];
+	crep = tabdon[arega + (cx * 7) + pred(int, num)];
 	if ((s.mlieu == 13) && (num == 8))  crep = 126;
 	if (s.mlieu == 19)  crep = 103;
 	if (crep == 255)  crep = 131;
@@ -315,7 +315,7 @@ L2:
 
 /* overlay */ void tfouiller() {
 	const array<0, 13, byte> r = {{123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107}};
-	integer cx;
+	int cx;
 
 	if (caff > 99) {
 		st7(caff);
@@ -386,7 +386,7 @@ L2:
 }
 
 /* overlay */ void touvrir() {
-	integer cx, haz;
+	int cx, haz;
 
 	if (! syn)  ecr3("ouvrir");
 	if (caff == 26) {
@@ -432,18 +432,18 @@ L2:
 			}
 			cx = s.mlieu;
 			if (s.mlieu == 16)  cx = 14;
-			crep = tabdon[aouvr + (cx * 7) + pred(integer, num)];
+			crep = tabdon[aouvr + (cx * 7) + pred(int, num)];
 			if (crep == 254)  crep = 999;
 		} else crep = 18;
 	}
 }
 
 /* overlay */ void tmettre() {
-	integer quel;
+	int quel;
 	boolean entre;
 	phrase st;
 	str255 str_;
-	integer i, tay;
+	int i, tay;
 
 	if (s.derobj == 0) {
 		crep = 186;
@@ -542,7 +542,7 @@ L2:
 }
 
 /* overlay */ void ttourner() {
-	integer quel;
+	int quel;
 
 	if (caff > 99) {
 		crep = 149;
@@ -608,7 +608,7 @@ L2:
 }
 
 /* overlay */ void tfermer() {
-	integer cx, chai;
+	int cx, chai;
 
 	if (! syn)  ecr3("fermer");
 	if (caff < 26) {
@@ -637,7 +637,7 @@ L2:
 }
 
 /* overlay */ void tfrapper() {
-	integer l, p, haz;
+	int l, p, haz;
 
 	if (! syn)  ecr3("frapper");
 	if (s.mlieu == 15) {
@@ -669,7 +669,7 @@ L2:
 }
 
 /* overlay */ void tposer() {
-	integer cx, chai;
+	int cx, chai;
 
 	if (! syn)  ecr3("poser");
 	if (s.derobj == 0)  crep = 186;
@@ -734,7 +734,7 @@ L2:
 }
 
 /* overlay */ void tecouter() {
-	integer l, p, haz, j, h, m;
+	int l, p, haz, j, h, m;
 
 	if (s.mlieu != 26)  crep = 101;
 	else {
@@ -759,7 +759,7 @@ L2:
 }
 
 /* overlay */ void tmanger() {
-	integer j, h, m;
+	int j, h, m;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26))
 		crep = 148;
@@ -786,7 +786,7 @@ L2:
 }
 
 /* overlay */ void tentrer() {
-	integer x, z;
+	int x, z;
 
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
 		t1sama();
@@ -840,7 +840,7 @@ L2:
 
 /* overlay */ void tdormir() {
 	const char m1[] = "D‚sirez-vous vous r‚veiller?";
-	integer z, j, h, m, quel;
+	int z, j, h, m, quel;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
 		crep = 148;
@@ -890,7 +890,7 @@ L2:
 }
 
 /* overlay */ void tsortir() {
-	integer lx;
+	int lx;
 
 	tsort();
 	crep = 0;
@@ -915,7 +915,7 @@ L2:
 }
 
 /* overlay */ void tattendre() {
-	integer quel;
+	int quel;
 
 	mpers = 0;
 	clsf3();
@@ -951,7 +951,7 @@ L2:
 
 {
 	array<1, 46, boolean> te;
-	integer ix, cy, cx, max, haz, suj, co, lig, icm,
+	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
 	char tou;
 	array<1, 46, varying_string<40> > lib;
@@ -994,7 +994,7 @@ L2:
 		co = 0;
 		lig = 0;
 		do {
-			icm = succ(integer, icm);
+			icm = succ(int, icm);
 			putxy(co, lig);
 			if (s.teauto[icm] == '*')
 				if (te[icm])  writetp(lib[icm], 1);
@@ -1014,7 +1014,7 @@ L2:
 			x = x * (3 - res);
 			if (x > 319)  cx = 41;
 			else cx = 1;
-			cy = succ(integer, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
+			cy = succ(int, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
 			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
@@ -1173,7 +1173,7 @@ L2:
 }
 
 /* overlay */ void tencore() {         /* Perdu !!! */
-	integer quel;
+	int quel;
 
 	clsf2();
 	musique(0);
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index d059fc3..cec339e 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -1,8 +1,8 @@
-/* overlay */ integer do_alert(str255 str_, integer n);
+/* overlay */ int do_alert(str255 str_, int n);
 
 
-const integer nligne = 7;
-const matrix<1, 2, 1, 3, integer> coord
+const int nligne = 7;
+const matrix<1, 2, 1, 3, int> coord
 = {{ {{150, 72, 103}},
 		{{143, 107, 183}}
 	}
@@ -10,8 +10,8 @@ const matrix<1, 2, 1, 3, integer> coord
 
 
 
-static void decod(str255 s, integer &nbc, integer &nbl, integer &col, str255 &c, str30 &cs) {
-	integer i, k;
+static void decod(str255 s, int &nbc, int &nbl, int &col, str255 &c, str30 &cs) {
+	int i, k;
 	boolean v;
 
 	val(s[2], nbc, i);
@@ -47,18 +47,18 @@ static void decod(str255 s, integer &nbc, integer &nbl, integer &col, str255 &c,
 
 
 
-static void posit(integer ji, integer &coldep, integer &esp) {
-	putxy(coldep + (40 + esp) *pred(integer, ji), 98);
+static void posit(int ji, int &coldep, int &esp) {
+	putxy(coldep + (40 + esp) *pred(int, ji), 98);
 }
 
 
 
-static void fait_boite(integer lidep, integer nli, integer tx) {
-	integer x, y, xx, yy;
+static void fait_boite(int lidep, int nli, int tx) {
+	int x, y, xx, yy;
 
 	if (tx > 640)  tx = 640;
 	x = 320 - ((cardinal)tx >> 1);
-	y = pred(integer, lidep) << 3;
+	y = pred(int, lidep) << 3;
 	xx = x + tx;
 	yy = y + (nli << 3);
 	box(15, gd, x, y, xx, yy, 255);
@@ -68,8 +68,8 @@ static void fait_boite(integer lidep, integer nli, integer tx) {
 
 
 
-static void fait_choix(str30 c, integer &coldep, integer &nbcase, array<1, 2, varying_string<3> > &s, integer &esp) {
-	integer i, l, x;
+static void fait_choix(str30 c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp) {
+	int i, l, x;
 	char ch;
 
 	i = 1;
@@ -89,24 +89,24 @@ static void fait_choix(str30 c, integer &coldep, integer &nbcase, array<1, 2, va
 	}
 }
 
-integer do_alert(str255 str_, integer n) {
-	integer coldep, esp, i, l, nbcase, quoi, ix;
+int do_alert(str255 str_, int n) {
+	int coldep, esp, i, l, nbcase, quoi, ix;
 	str255 st, chaine;
-	matrix<1, 2, 1, 2, integer> limit;
+	matrix<1, 2, 1, 2, int> limit;
 	char c, dumi;
 	array<1, 2, varying_string<3> > s;
-	integer cx, cy, cd, nbcol, nblig;
+	int cx, cy, cd, nbcol, nblig;
 	boolean touch, newaff, test, test1, test2, test3, dum;
 	str30 cas;
 
 
 	/*debug('** do_alert **');*/
-	integer do_alert_result;
+	int do_alert_result;
 	hide_mouse();
 	while (keypressed())  input >> kbd >> dumi;
 	clic = false;
 	decod(str_, nbcase, nblig, nbcol, chaine, cas);
-	sauvecr(50, succ(integer, nligne) << 4);
+	sauvecr(50, succ(int, nligne) << 4);
 
 	i = 0;
 	if (chaine == "") {
@@ -190,7 +190,7 @@ integer do_alert(str255 str_, integer n) {
 		posit(n, coldep, esp);
 		writeg(string(' ') + s[n] + ' ', 1);
 	}
-	charecr(50, succ(integer, nligne) << 4);
+	charecr(50, succ(int, nligne) << 4);
 	show_mouse();
 	do_alert_result = quoi;
 	return do_alert_result;
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index 4120f73..d1ebe4d 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -1,6 +1,6 @@
-void boite(integer x, integer y, integer dx, integer dy, integer coul) {
-	integer i;
-	integer xi, yi, xo, yo;
+void boite(int x, int y, int dx, int dy, int coul) {
+	int i;
+	int xi, yi, xo, yo;
 
 	/* debug('boite'); */
 	hide_mouse();
@@ -15,14 +15,14 @@ void boite(integer x, integer y, integer dx, integer dy, integer coul) {
 	for (i = 0; i <= dx + dy; i ++) {
 		putpix(gd, xi, yi, coul);
 		if (xi == x + dx)  {
-			if (gd != cga)  putpix(gd, pred(integer, xi), yi, coul);
-			yi = succ(integer, yi);
-		} else xi = succ(integer, xi);
+			if (gd != cga)  putpix(gd, pred(int, xi), yi, coul);
+			yi = succ(int, yi);
+		} else xi = succ(int, xi);
 		putpix(gd, xo, yo, coul);
-		if (yo == y + dy)  xo = succ(integer, xo);
+		if (yo == y + dy)  xo = succ(int, xo);
 		else {
-			if (gd != cga)  putpix(gd, succ(integer, xo), yo, coul);
-			yo = succ(integer, yo);
+			if (gd != cga)  putpix(gd, succ(int, xo), yo, coul);
+			yo = succ(int, yo);
 		}
 	}
 	show_mouse();
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 517d408..0e458a5 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -1,7 +1,7 @@
 
 void dem1() {
 	untyped_file f;
-	integer k;
+	int k;
 
 	/* -- demande de disk 1 -- */
 	assign(f, "mort.005");
@@ -17,9 +17,9 @@ void dem1() {
 	close(f);
 }
 
-void takesav(integer n) {
+void takesav(int n) {
 	untyped_file f;
-	integer i;
+	int i;
 	varying_string<10> st;
 
 	dem1();
@@ -37,7 +37,7 @@ void takesav(integer n) {
 	close(f);
 }
 
-void ld_game(integer n) {
+void ld_game(int n) {
 	hide_mouse();
 	maivid();
 	takesav(n);
@@ -50,9 +50,9 @@ void ld_game(integer n) {
 	show_mouse();
 }
 
-void sv_game(integer n) {
+void sv_game(int n) {
 	untyped_file f;
-	integer i;
+	int i;
 
 	hide_mouse();
 	tmaj3();
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 8d254a4..0ad212d 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -1,5 +1,5 @@
-void droite(integer x, integer y, integer xx, integer yy, integer coul) {
-	integer step, i;
+void droite(int x, int y, int xx, int yy, int coul) {
+	int step, i;
 	real a, b;
 	real xr, yr, xro, yro;
 
@@ -31,4 +31,4 @@ void droite(integer x, integer y, integer xx, integer yy, integer coul) {
 		} while (!(i == xx));
 		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
 	}
-}
\ No newline at end of file
+}
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index b450e07..199d438 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -7,10 +7,10 @@ char readkey1() {
 	return readkey1_result;
 }
 
-integer testou() {
+int testou() {
 	char ch;
 
-	integer testou_result;
+	int testou_result;
 	input >> kbd >> ch;
 	switch (ch)  {
 	case '\23' :
@@ -19,7 +19,7 @@ integer testou() {
 	case '\1':
 	case '\3':
 	case '\5'  : {
-		newgd = (cardinal)pred(integer, ord(ch)) >> 1;
+		newgd = (cardinal)pred(int, ord(ch)) >> 1;
 		testou_result = 61;
 		return testou_result;
 	}
@@ -39,7 +39,7 @@ integer testou() {
 	case '\26' :
 		if (set::of(1, 2, eos).has(c_zzz)) {
 			zzuul(adcfiec + 161, 0, 1644);
-			c_zzz = succ(integer, c_zzz);
+			c_zzz = succ(int, c_zzz);
 			testou_result = 61;
 			return testou_result;
 		}
@@ -53,7 +53,7 @@ integer testou() {
 }
 
 void teskbd() {
-	integer dum;
+	int dum;
 
 	if (keypressed())  dum = testou();
 }
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 2c9b8cd..35de7f4 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -1,17 +1,17 @@
 
 /* NIVEAU 15 */
 void copcha() {
-	integer i;
+	int i;
 
 	i = acha;
 	do {
 		tabdon[i] = tabdon[i + 390];
-		i = succ(integer, i);
+		i = succ(int, i);
 	} while (!(i == acha + 390));
 }
 
 boolean dans_rect(rectangle r) {
-	integer x, y, c;
+	int x, y, c;
 
 	boolean dans_rect_result;
 	read_pos_mouse(x, y, c);
@@ -23,8 +23,8 @@ boolean dans_rect(rectangle r) {
 	return dans_rect_result;
 }
 
-void outbloc(integer n, pattern p, t_nhom pal) {
-	integer i, j, ad;
+void outbloc(int n, pattern p, t_nhom pal) {
+	int i, j, ad;
 
 	ad = n * 404 + 0xd700;
 	{
@@ -33,13 +33,13 @@ void outbloc(integer n, pattern p, t_nhom pal) {
 		ad = ad + 4;
 		for (i = 1; i <= p.tax; i ++)
 			for (j = 1; j <= p.tay; j ++)
-				mem[0x6000 + ad + pred(integer, j)*p.tax + pred(integer, i)] = pal[n].hom[p.des[i][j]];
+				mem[0x6000 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
 	}
 }
 
 
-void writepal(integer n) {
-	integer i;
+void writepal(int n) {
+	int i;
 	t_nhom pal;
 
 
@@ -49,7 +49,7 @@ void writepal(integer n) {
 	case ams :
 		for (i = 1; i <= 16; i ++) {
 			mem[0x7000 + 2 * i] = tabpal[n][i].x;
-			mem[0x7000 + succ(integer, 2 * i)] = tabpal[n][i].y;
+			mem[0x7000 + succ(int, 2 * i)] = tabpal[n][i].y;
 		}
 		break;
 	case cga : {
@@ -62,7 +62,7 @@ void writepal(integer n) {
 }
 
 
-void pictout(integer seg, integer dep, integer x, integer y) {
+void pictout(int seg, int dep, int x, int y) {
 	decomp(seg, dep);
 	if (gd == her) {
 		mem[0x7000 + 2] = 0;
@@ -72,45 +72,45 @@ void pictout(integer seg, integer dep, integer x, integer y) {
 	afff(gd, seg, dep, x, y);
 }
 
-void putxy(integer x, integer y) {
+void putxy(int x, int y) {
 	xwhere = x;
 	ywhere = y;
 }
 /*
-function calad(x,y:integer):integer;
+function calad(x,y:int):int;
    begin
      calad:=pred(x)+320*pred(y)
    end;
   */
-void sauvecr(integer y, integer dy) {
+void sauvecr(int y, int dy) {
 	hide_mouse();
 	s_sauv(gd, y, dy);
 	show_mouse();
 }
 
-void charecr(integer y, integer dy) {
+void charecr(int y, int dy) {
 	hide_mouse();
 	s_char(gd, y, dy);
 	show_mouse();
 }
 /*
-function peek(ad:integer):integer;
+function peek(ad:int):int;
 begin
   peek:=tabdon[ad];
 end;
 
-function peekw(ad:integer):integer;
+function peekw(ad:int):int;
 begin
   peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
 end;
 
-function peekl(ad:integer):real;
+function peekl(ad:int):real;
 begin
   peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
 end;
 
 
-procedure poke (ad,n:integer);
+procedure poke (ad,n:int);
 begin
   tabdon[ad]:=lo(n);
 end;
@@ -120,7 +120,7 @@ void adzon() {
 	untyped_file f;
 	file<byte> g;
 	byte a;
-	integer i;
+	int i;
 
 	assign(f, "don.mor");
 	reset(f, 256);
@@ -148,10 +148,10 @@ void adzon() {
 	close(f);
 }
 
-integer animof(integer ouf, integer num) {
-	integer nani, aux;
+int animof(int ouf, int num) {
+	int nani, aux;
 
-	integer animof_result;
+	int animof_result;
 	nani = mem[adani + 1];
 	aux = num;
 	if (ouf != 1)  aux = aux + nani;
@@ -163,7 +163,7 @@ integer animof(integer ouf, integer num) {
 	return animof_result;
 }
 
-/*procedure affgd(offs,dep,x,y:integer);
+/*procedure affgd(offs,dep,x,y:int);
 begin
   case Gd of
      Ams : affams(offs,dep,x,y);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 691ef7c..9018414 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -1,6 +1,6 @@
 /* NIVEAU 14*/
 
-/* overlay */ void menut(integer no, str30 nom) {
+/* overlay */ void menut(int no, str30 nom) {
 	byte h, l;
 	str30 s;
 
@@ -33,7 +33,7 @@
 	}
 }
 
-/* overlay */ void menu_disable(integer no) {
+/* overlay */ void menu_disable(int no) {
 	byte h, l;
 
 	/* debug('menu_disable'); */
@@ -62,7 +62,7 @@
 	}
 }
 
-/* overlay */ void menu_enable(integer no) {
+/* overlay */ void menu_enable(int no) {
 	byte h, l;
 
 	/* debug('menu_disable'); */
@@ -92,9 +92,9 @@
 }
 
 void menu_aff() {
-	integer ind_tabl, k, col;
+	int ind_tabl, k, col;
 	char c;
-	integer pt, x, y, color, msk,
+	int pt, x, y, color, msk,
 	        num_letr;
 
 	/* debug('menu_aff'); */
@@ -127,8 +127,8 @@ void menu_aff() {
 					msk = (cardinal)msk >> 1;
 					x = x + 1;
 				}
-				ind_tabl = succ(integer, ind_tabl);
-				k = succ(integer, k);
+				ind_tabl = succ(int, ind_tabl);
+				k = succ(int, k);
 			} while (!(k == 3));
 			y = y + 1;
 		} while (!(y == 9));
@@ -149,7 +149,7 @@ void draw_menu() {
 	test0 = false;
 }
 
-void invers(integer ix) {
+void invers(int ix) {
 	varying_string<23> s;
 
 	/* debug('invers'); */
@@ -186,8 +186,8 @@ void invers(integer ix) {
 	else msg4 = no_choice;
 }
 
-void util(integer x, integer y) {
-	integer ymx, dxcar, xmn, xmx, ix;
+void util(int x, int y) {
+	int ymx, dxcar, xmn, xmx, ix;
 
 	/* debug('util'); */
 	ymx = (don[msg3][4] << 3) + 16;
@@ -197,7 +197,7 @@ void util(integer x, integer y) {
 	else ix = 3;
 	xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = pred(integer, (cardinal)y >> 3) + (msg3 << 8);
+		ix = pred(int, (cardinal)y >> 3) + (msg3 << 8);
 		if (ix != msg4) {
 			invers(1);
 			msg4 = ix;
@@ -209,9 +209,9 @@ void util(integer x, integer y) {
 	}
 }
 
-void menu_down(integer ii) {
-	integer cx, xcc;
-	integer xco, nb_lig;
+void menu_down(int ii) {
+	int cx, xcc;
+	int xco, nb_lig;
 
 	/* debug('menu_down'); */
 	xco = don[ii][1];
@@ -228,7 +228,7 @@ void menu_down(integer ii) {
 	putxy(xco, 16);
 	cx = 0;
 	do {
-		cx = succ(integer, cx);
+		cx = succ(int, cx);
 		switch (ii) {
 		case 1 :
 			if (inv[cx][1] != '*')  writeg(inv[cx], 4);
@@ -262,7 +262,7 @@ void menu_down(integer ii) {
 	show_mouse();
 }
 
-void menu_up(integer xx) {
+void menu_up(int xx) {
 	/* debug('menu_up'); */
 	if (test0) {
 		charecr(10, succ(byte, don[xx][2]) << 1);
@@ -278,7 +278,7 @@ void erase_menu() {
 }
 
 void mdn() {
-	integer x, y, c, a, ix;
+	int x, y, c, a, ix;
 	boolean tes;
 
 	/* debug('mdn'); */
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index fd4e2f5..cee4e31 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -10,12 +10,12 @@ void testfi() {
 }
 
 
-integer readclock() {
+int readclock() {
 	registres r;
-	integer s, m, h;
+	int s, m, h;
 
 	/* debug('readclock');*/
-	integer readclock_result;
+	int readclock_result;
 	r.ax = 0x2c00;
 	intr(0x21, r);
 	{
@@ -29,7 +29,7 @@ integer readclock() {
 	return readclock_result;
 }
 
-void modif(integer &nu) {
+void modif(int &nu) {
 	/* debug('modif'); */
 	if (nu == 26)  nu = 25;
 	if ((nu > 29) && (nu < 36))  nu = nu - 4;
@@ -52,7 +52,7 @@ void modif(integer &nu) {
 }
 
 
-void dessine(integer ad, integer x, integer y) {
+void dessine(int ad, int x, int y) {
 	/* debug('dessine'); */
 	hide_mouse();
 	writepal(numpal);
@@ -72,17 +72,17 @@ void dessine_rouleau() {
 }
 
 
-void text_color(integer c) {
+void text_color(int c) {
 	color_txt = c;
 }
 
 /* NIVEAU 13 */
 
 
-void text1(integer x, integer y, integer nb, integer m) {
+void text1(int x, int y, int nb, int m) {
 	phrase st;
-	integer tay;
-	integer co;
+	int tay;
+	int co;
 
 
 	/* debug('text'); */
@@ -94,7 +94,7 @@ void text1(integer x, integer y, integer nb, integer m) {
 }
 
 void initouv() {
-	integer cx;
+	int cx;
 
 	/* debug('initouv'); */
 	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
@@ -105,7 +105,7 @@ void ecrf1() {
 }
 
 void clsf1() {
-	integer i, j;
+	int i, j;
 
 	/* debug('clsf1'); */
 	hide_mouse();
@@ -153,7 +153,7 @@ void clsf1() {
 }
 
 void clsf2() {
-	integer i, j;
+	int i, j;
 
 	/* debug('clsf2'); */
 	hide_mouse();
@@ -175,34 +175,34 @@ void ecrf2() {
 }
 
 void ecr2(str255 str_) {
-	integer tab;
-	integer tlig;
+	int tab;
+	int tlig;
 
 	/* debug('ecr2 : '+str_);*/
 	if (res == 1)  tab = 10;
 	else tab = 6;
 	putxy(8, 177);
-	tlig = 59 + pred(integer, res) * 36;
+	tlig = 59 + pred(int, res) * 36;
 	if (length(str_) < tlig)  writeg(str_, 5);
 	else if (length(str_) < (tlig << 1)) {
 		putxy(8, 176);
-		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		writeg(copy(str_, 1, pred(int, tlig)), 5);
 		putxy(8, 182);
 		writeg(copy(str_, tlig, tlig << 1), 5);
 	} else {
 		f2_all = true;
 		clsf2();
 		putxy(8, 176);
-		writeg(copy(str_, 1, pred(integer, tlig)), 5);
+		writeg(copy(str_, 1, pred(int, tlig)), 5);
 		putxy(8, 182);
-		writeg(copy(str_, tlig, pred(integer, tlig << 1)), 5);
+		writeg(copy(str_, tlig, pred(int, tlig << 1)), 5);
 		putxy(8, 190);
 		writeg(copy(str_, tlig << 1, tlig * 3), 5);
 	}
 }
 
 void clsf3() {
-	integer i, j;
+	int i, j;
 
 	/* debug('clsf3'); */
 	hide_mouse();
@@ -232,7 +232,7 @@ void ecrf7() {
 }
 
 void clsf10() {
-	integer co, cod;
+	int co, cod;
 	varying_string<8> st;
 
 	/* debug('clsf10'); */
@@ -268,8 +268,8 @@ void stop() {
 	exit(0);
 }
 
-void paint_rect(integer x, integer y, integer dx, integer dy) {
-	integer co;
+void paint_rect(int x, int y, int dx, int dy) {
+	int co;
 
 	/* debug('paint_rect'); */
 	if (gd == cga)  co = 3;
@@ -277,20 +277,20 @@ void paint_rect(integer x, integer y, integer dx, integer dy) {
 	box(co, gd, x, y, x + dx, y + dy, 255);
 }
 
-integer hazard(integer min, integer max) {
-	integer ha1;
+int hazard(int min, int max) {
+	int ha1;
 	real ha2;
 
 	/* debug('hazard'); */
-	integer hazard_result;
+	int hazard_result;
 	ha2 = Random();
 	ha1 = trunc(ha2 * (max - min));
 	hazard_result = min + ha1;
 	return hazard_result;
 }
 
-void calch(integer &j, integer &h, integer &m) {
-	integer th, nh;
+void calch(int &j, int &h, int &m) {
+	int th, nh;
 
 	/* debug('calch');*/
 	nh = readclock();
@@ -305,15 +305,15 @@ void calch(integer &j, integer &h, integer &m) {
 	h = h - ((j - vj) * 24);
 }
 
-void conv(integer x, integer &y) {
-	integer cx;
+void conv(int x, int &y) {
+	int cx;
 
 	/* debug('conv'); */
 	cx = 1;
 	y = 128;
 	while (cx < x) {
 		y = (cardinal)y >> 1;
-		cx = succ(integer, cx);
+		cx = succ(int, cx);
 	}
 }
 
@@ -322,10 +322,10 @@ void okpas() {
 	tesok = true;
 }
 
-void modobj(integer m) {
+void modobj(int m) {
 	phrase str_;
 	str30 strp;
-	integer i, tay;
+	int i, tay;
 
 	/* debug('modobj'); */
 	strp = ' ';
@@ -337,10 +337,10 @@ void modobj(integer m) {
 	menu_disable(invt[8]);
 }
 
-void modobj2(integer m, boolean t1, boolean t2) {
+void modobj2(int m, boolean t1, boolean t2) {
 	phrase str_;
 	str30 strp;
-	integer i, tay;
+	int i, tay;
 
 	/* debug('modobj'); */
 	strp = ' ';
@@ -355,17 +355,17 @@ void modobj2(integer m, boolean t1, boolean t2) {
 }
 
 
-void repon(integer f, integer m) {
+void repon(int f, int m) {
 	str255 str_;
 	varying_string<40> str1;
 	phrase st;
 	text1 fic;
-	integer i, xco, dx, caspe, tay;
+	int i, xco, dx, caspe, tay;
 
 	/* debug('repon fenetre nø'+chr(f+48));*/
 	if ((m > 499) && (m < 563)) {
 		deline(m - 501 + c_st41, st, tay);
-		if (tay > ((58 + pred(integer, res) * 37) << 1))  f2_all = true;
+		if (tay > ((58 + pred(int, res) * 37) << 1))  f2_all = true;
 		else f2_all = false;
 		clsf2();
 		afftex(st, 8, 176, 85, 3, 5);
@@ -413,7 +413,7 @@ void repon(integer f, integer m) {
 }
 
 void f3f8() {
-	integer co;
+	int co;
 
 	if (res == 1)  co = 107;
 	else co = 64;
@@ -424,7 +424,7 @@ void f3f8() {
 	boite(0, 42, co, 16, 7);
 }
 
-void t5(integer cx) {
+void t5(int cx) {
 	/* debug('t5'); */
 	if (cx == 10)  blo = false;
 	if (cx != 1) {
@@ -444,8 +444,8 @@ void t5(integer cx) {
 	if (cx != 9)  bh9 = false;
 }
 
-void affper(integer per) {
-	integer cx;
+void affper(int per) {
+	int cx;
 
 	/* debug('affper'); */
 	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
@@ -493,10 +493,10 @@ void affper(integer per) {
 	ipers = per;
 }
 
-/* overlay */ void choix(integer min, integer max, integer &per) {
+/* overlay */ void choix(int min, int max, int &per) {
 	boolean i;
-	integer haz, cx, cy, cz;
-	long_integer per2, cz2;
+	int haz, cx, cy, cz;
+	long_int per2, cz2;
 
 	/* debug('o0 choix'); */
 	haz = hazard(min, max);
@@ -518,8 +518,8 @@ void affper(integer per) {
 	i = false;
 }
 
-/* overlay */ void cpl1(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl1(int &p) {
+	int j, h, m;
 
 	/* debug('o0 cpl1'); */
 	calch(j, h, m);
@@ -533,8 +533,8 @@ void affper(integer per) {
 	mdn();
 }
 
-/* overlay */ void cpl2(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl2(int &p) {
+	int j, h, m;
 
 	/* debug('o0 cpl2'); */
 	calch(j, h, m);
@@ -545,8 +545,8 @@ void affper(integer per) {
 	if ((h >= 0) && (h < 8))  p = 50;
 }
 
-/* overlay */ void cpl3(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl3(int &p) {
+	int j, h, m;
 
 	/* debug('o0 cpl3'); */
 	calch(j, h, m);
@@ -554,8 +554,8 @@ void affper(integer per) {
 	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
 }
 
-/* overlay */ void cpl5(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl5(int &p) {
+	int j, h, m;
 
 	/* debug('o0 cpl5'); */
 	calch(j, h, m);
@@ -565,8 +565,8 @@ void affper(integer per) {
 	if ((h >= 0) && (h < 7))  p = 50;
 }
 
-/* overlay */ void cpl6(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl6(int &p) {
+	int j, h, m;
 
 	/* debug('o0 cpl6'); */
 	calch(j, h, m);
@@ -580,7 +580,7 @@ void person() {
 	const char m1[] = "Vous";
 	const char m2[] = "ˆtes";
 	const char m3[] = "SEUL";
-	integer cf;
+	int cf;
 	str255 str_;
 
 	/* debug('person'); */
@@ -595,22 +595,22 @@ void person() {
 	ipers = 0;
 }
 
-void chlm(integer &per) {
+void chlm(int &per) {
 	/* debug('chlm'); */
 	per = hazard(1, 2);
 	if (per == 2)  per = 128;
 }
 
 void pendule() {
-	const matrix<1, 2, 1, 12, integer> cv
+	const matrix<1, 2, 1, 12, int> cv
 	= {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
 			{{ -5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}}
 		}
 	};
-	const integer x = 580;
-	const integer y = 123;
-	const integer rg = 9;
-	integer h, co;
+	const int x = 580;
+	const int y = 123;
+	const int rg = 9;
+	int h, co;
 
 
 	/* debug('pendule'); */
@@ -639,7 +639,7 @@ void pendule() {
  * NIVEAU 11 *
  *************/
 
-void debloc(integer l) {
+void debloc(int l) {
 	/* debug('debloc'); */
 	num = 0;
 	x = 0;
@@ -648,8 +648,8 @@ void debloc(integer l) {
 	mpers = ipers;
 }
 
-/* overlay */ void cpl10(integer &p, integer &h) {
-	integer j, m;
+/* overlay */ void cpl10(int &p, int &h) {
+	int j, m;
 
 	/* debug('o1 cpl10'); */
 	calch(j, h, m);
@@ -661,8 +661,8 @@ void debloc(integer l) {
 	if ((h >= 0) && (h < 8))  p = 5;
 }
 
-/* overlay */ void cpl11(integer &p, integer &h) {
-	integer j, m;
+/* overlay */ void cpl11(int &p, int &h) {
+	int j, m;
 
 	/* debug('o1 cpl11'); */
 	calch(j, h, m);
@@ -673,8 +673,8 @@ void debloc(integer l) {
 	if ((h >= 0) && (h < 9))  p = 0;
 }
 
-/* overlay */ void cpl12(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl12(int &p) {
+	int j, h, m;
 
 	/* debug('o1 cpl12'); */
 	calch(j, h, m);
@@ -684,13 +684,13 @@ void debloc(integer l) {
 	if ((h > 4) && (h < 9))  p = 15;
 }
 
-/* overlay */ void cpl13(integer &p) {
+/* overlay */ void cpl13(int &p) {
 	/* debug('o1 cpl13'); */
 	p = 0;
 }
 
-/* overlay */ void cpl15(integer &p) {
-	integer j, h, m;
+/* overlay */ void cpl15(int &p) {
+	int j, h, m;
 
 	/* debug('o1 cpl15'); */
 	calch(j, h, m);
@@ -703,8 +703,8 @@ void debloc(integer l) {
 	if ((h >= 0) && (h < 8))  p = -15;
 }
 
-/* overlay */ void cpl20(integer &p, integer &h) {
-	integer j, m;
+/* overlay */ void cpl20(int &p, int &h) {
+	int j, m;
 
 	/* debug('o1 cpl20'); */
 	calch(j, h, m);
@@ -715,8 +715,8 @@ void debloc(integer l) {
 	if ((h > 4) && (h < 10))  p = -5;
 }
 
-/* overlay */ void quelq1(integer l) {
-	integer per;
+/* overlay */ void quelq1(int l) {
+	int per;
 
 	/* debug('o1 quelq1'); */
 	per = hazard(1, 2);
@@ -742,8 +742,8 @@ void debloc(integer l) {
 	ipers = 10;
 }
 
-/* overlay */ void quelq6(integer l) {
-	integer per;
+/* overlay */ void quelq6(int l) {
+	int per;
 
 	/* debug('o1 quelq6'); */
 	if (l == 6)  bh6 = true;
@@ -751,8 +751,8 @@ void debloc(integer l) {
 	ipers = 10;
 }
 
-/* overlay */ void quelq10(integer h, integer &per) {
-	integer min, max;
+/* overlay */ void quelq10(int h, int &per) {
+	int min, max;
 
 	/* debug('o1 quelq10'); */
 	if ((h >= 0) && (h < 8))  chlm(per);
@@ -778,8 +778,8 @@ void debloc(integer l) {
 	affper(per);
 }
 
-/* overlay */ void quelq11(integer h, integer &per) {
-	integer min, max;
+/* overlay */ void quelq11(int h, int &per) {
+	int min, max;
 
 	/* debug('o1 quelq11'); */
 	if ((h >= 0) && (h < 8))  chlm(per);
@@ -801,14 +801,14 @@ void debloc(integer l) {
 	affper(per);
 }
 
-/* overlay */ void quelq12(integer &per) {
+/* overlay */ void quelq12(int &per) {
 	/* debug('o1 quelq12'); */
 	chlm(per);
 	affper(per);
 }
 
-/* overlay */ void quelq15(integer &per) {
-	integer cx;
+/* overlay */ void quelq15(int &per) {
+	int cx;
 	boolean test;
 
 
@@ -831,8 +831,8 @@ void debloc(integer l) {
 	}
 }
 
-/* overlay */ void quelq20(integer h, integer &per) {
-	integer min, max;
+/* overlay */ void quelq20(int h, int &per) {
+	int min, max;
 
 	/* debug('o1 quelq20'); */
 	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
@@ -856,7 +856,7 @@ void debloc(integer l) {
 
 
 /* overlay */void frap() {
-	integer j, h, m, haz;
+	int j, h, m, haz;
 
 	/* debug('o1 frap'); */
 	calch(j, h, m);
@@ -868,7 +868,7 @@ void debloc(integer l) {
 	}
 }
 
-/* overlay */ void nouvp(integer l, integer &p) {
+/* overlay */ void nouvp(int l, int &p) {
 	/* debug('o1 nouvp'); */
 	p = 0;
 	if (l == 1) {
@@ -889,7 +889,7 @@ void debloc(integer l) {
 
 
 
-/* overlay */ void tip(integer ip, integer &cx) {
+/* overlay */ void tip(int ip, int &cx) {
 	/* debug('o1 tip'); */
 	if (ip == 128)  cx = 1;
 	else if (ip == 64)   cx = 2;
@@ -902,7 +902,7 @@ void debloc(integer l) {
 }
 
 
-/* overlay */ void ecfren(integer &p, integer &haz, integer cf, integer l) {
+/* overlay */ void ecfren(int &p, int &haz, int cf, int l) {
 	/* debug('o1 ecfren'); */
 	if (l == 0)  person();
 	p = -500;
@@ -921,8 +921,8 @@ void debloc(integer l) {
 	}
 }
 
-/* overlay */ void becfren(integer l) {
-	integer haz;
+/* overlay */ void becfren(int l) {
+	int haz;
 
 	/* debug('o1 becfren'); */
 	if ((l == 1) || (l == 4)) {
@@ -947,24 +947,24 @@ void debloc(integer l) {
 void init_nbrepm() {
 	const array<1, 8, byte> ipm
 	= {{4, 5, 6, 7, 5, 6, 5, 8}};
-	integer i;
+	int i;
 
 	/* debug('init_nbrepm'); */
 	i = 0;
 	do {
-		i = succ(integer, i);
+		i = succ(int, i);
 		nbrepm[i] = ipm[i];
 	} while (!(i == 8));
 }
 
-void phaz(integer &haz, integer &p, integer cf) {
+void phaz(int &haz, int &p, int cf) {
 	/* debug('phaz'); */
 	p = p + cf;
 	haz = hazard(1, 100);
 }
 
 /* overlay */ void inzon() {
-	integer cx;
+	int cx;
 
 	/* debug('o2 inzon'); */
 	copcha();
@@ -1004,8 +1004,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	mh = readclock();
 }
 
-/* overlay */ void pl1(integer cf) {
-	integer p, haz;
+/* overlay */ void pl1(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl1'); */
 	if (((li == 1) && (! bh1) && (! bf1))
@@ -1017,8 +1017,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	}
 }
 
-/* overlay */ void pl2(integer cf) {
-	integer p, haz;
+/* overlay */ void pl2(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl2'); */
 	if (! bh2) {
@@ -1029,8 +1029,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	}
 }
 
-/* overlay */ void pl5(integer cf) {
-	integer p, haz;
+/* overlay */ void pl5(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl5'); */
 	if (! bh5) {
@@ -1041,8 +1041,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	}
 }
 
-/* overlay */ void pl6(integer cf) {
-	integer p, haz;
+/* overlay */ void pl6(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl6'); */
 	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
@@ -1053,8 +1053,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	}
 }
 
-/* overlayi */ void pl9(integer cf) {
-	integer p, haz;
+/* overlayi */ void pl9(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl9'); */
 	if (! bh9) {
@@ -1065,8 +1065,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	}
 }
 
-/* overlayi */ void pl10(integer cf) {
-	integer p, h, haz;
+/* overlayi */ void pl10(int cf) {
+	int p, h, haz;
 
 	/* debug('o2 pl10'); */
 	cpl10(p, h);
@@ -1075,8 +1075,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq10(h, p);
 }
 
-/* overlay */ void pl11(integer cf) {
-	integer p, h, haz;
+/* overlay */ void pl11(int cf) {
+	int p, h, haz;
 
 	/* debug('o2 pl11'); */
 	cpl11(p, h);
@@ -1085,8 +1085,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq11(h, p);
 }
 
-/* overlay */ void pl12(integer cf) {
-	integer p, haz;
+/* overlay */ void pl12(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl12'); */
 	cpl12(p);
@@ -1095,8 +1095,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq12(p);
 }
 
-/* overlay */ void pl13(integer cf) {
-	integer p, haz;
+/* overlay */ void pl13(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl13'); */
 	cpl13(p);
@@ -1105,8 +1105,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq12(p);
 }
 
-/* overlay */ void pl15(integer cf) {
-	integer p, haz;
+/* overlay */ void pl15(int cf) {
+	int p, haz;
 
 	/* debug('o2 pl15'); */
 	cpl15(p);
@@ -1115,8 +1115,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq15(p);
 }
 
-/* overlay */ void pl20(integer cf) {
-	integer p, h, haz;
+/* overlay */ void pl20(int cf) {
+	int p, h, haz;
 
 	/* debug('o2 pl20'); */
 	cpl20(p, h);
@@ -1125,8 +1125,8 @@ void phaz(integer &haz, integer &p, integer cf) {
 	else quelq20(h, p);
 }
 
-/* overlay */ void t11(integer l11, integer &a) {
-	integer p, haz, h;
+/* overlay */ void t11(int l11, int &a) {
+	int p, haz, h;
 
 	/* debug('o2 t11'); */
 	ecfren(p, haz, s.conf, l11);
@@ -1169,7 +1169,7 @@ void phaz(integer &haz, integer &p, integer cf) {
 /* overlay */ void cavegre()
 
 {
-	integer haz;
+	int haz;
 
 	/* debug('cavegre'); */
 	s.conf = s.conf + 2;
@@ -1184,12 +1184,12 @@ void phaz(integer &haz, integer &p, integer cf) {
 	person();
 }
 
-void writetp(str255 s, integer t) {
+void writetp(str255 s, int t) {
 	if (res == 2)  writeg(s, t);
 	else writeg(copy(s, 1, 25), t);
 }
 
-void messint(integer nu) {
+void messint(int nu) {
 	/* debug('messint'); */
 	clsf1();
 	clsf2();
@@ -1203,8 +1203,8 @@ void messint(integer nu) {
 	repon(7, nu);
 }
 
-void aniof(integer ouf, integer num) {
-	integer ad, offset;
+void aniof(int ouf, int num) {
+	int ad, offset;
 	char c;
 
 	/* debug('aniof'); */
@@ -1221,10 +1221,10 @@ void aniof(integer ouf, integer num) {
 	show_mouse();
 }
 
-void musique(integer so) {
+void musique(int so) {
 	boolean i;
-	integer haz;
-	/* dep: array[1..5] of long_integer;*/
+	int haz;
+	/* dep: array[1..5] of long_int;*/
 
 	/* debug('musique'); */
 	if (so == 0) { /*musik(0)*/
@@ -1275,8 +1275,8 @@ void musique(integer so) {
 }
 
 /* NIVEAU 9 */
-void dessin(integer ad) {
-	integer cx;
+void dessin(int ad) {
+	int cx;
 
 	/* debug('dessin'); */
 	if (ad != 0)  dessine(ades, ((ad % 160) * 2), (ad / 160));
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 734cb48..48db49b 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -1,4 +1,4 @@
-const array<1, 11, integer> men
+const array<1, 11, int> men
 = {{
 		scacher, attacher, defoncer, dormir,
 		entrer,  fermer,   frapper,  manger,
@@ -14,7 +14,7 @@ void tinke() {
 	const char d4 = ']';
 	const char d5 = '1';
 	const char d6[] = "OK";
-	integer cx, cy, haz, nh, cf, j, h, m, cd;
+	int cx, cy, haz, nh, cf, j, h, m, cd;
 	varying_string<3> stpo;
 	boolean am;
 
@@ -128,7 +128,7 @@ void tinke() {
 }
 
 void fenat(char ans) {
-	integer coul;
+	int coul;
 
 	hide_mouse();
 	if (gd == cga)  coul = 2;
@@ -141,7 +141,7 @@ void fenat(char ans) {
 
 
 /* NIVEAU 8 */
-void afdes(integer ad) {
+void afdes(int ad) {
 	taffich();
 	dessin(ad);
 	okdes = false;
@@ -149,8 +149,8 @@ void afdes(integer ad) {
 
 void tkey1(boolean d) {
 	boolean quest;
-	integer x, y, c;
-	integer key;
+	int x, y, c;
+	int key;
 
 	hide_mouse();
 	fenat('K');
@@ -165,8 +165,8 @@ void tkey1(boolean d) {
 	show_mouse();
 }
 
-void tmlieu(integer mli) {
-	integer cx, j, i, tail;
+void tmlieu(int mli) {
+	int cx, j, i, tail;
 	str30 nomp;
 	phrase st;
 
@@ -187,7 +187,7 @@ void tmlieu(integer mli) {
 
 
 /* NIVEAU 7 */
-void tlu(integer af, integer ob) {
+void tlu(int af, int ob) {
 	caff = 32;
 	afdes(0);
 	repon(6, ob + 4000);
@@ -198,9 +198,9 @@ void tlu(integer af, integer ob) {
 	crep = 998;
 }
 
-void delin(integer n) {
+void delin(int n) {
 	phrase s;
-	integer t;
+	int t;
 
 	deline(n, s, t);
 }
@@ -213,7 +213,7 @@ void affrep() {
 void mfouen()
 
 {
-	integer cx;
+	int cx;
 
 	tmlieu(s.mlieu);
 	for (cx = 1; cx <= 11; cx ++) menu_enable(men[cx]);
@@ -232,7 +232,7 @@ void mfouen()
 	menut(soulever, " soulever ");
 }
 
-void atf3f8(integer &key) {
+void atf3f8(int &key) {
 	do {
 		key = testou();
 	} while (!((key == 61) || (key == 66)));
@@ -241,7 +241,7 @@ void atf3f8(integer &key) {
 /* NIVEAU 6 */
 
 void tperd() {
-	integer cx;
+	int cx;
 
 	initouv();
 	ment = 0;
@@ -261,7 +261,7 @@ void tperd() {
 }
 
 void tsort() {
-	integer cx;
+	int cx;
 
 	if ((iouv > 0) && (s.mlieu != 0))
 		if (s.conf < 50)  s.conf = s.conf + 2;
@@ -273,7 +273,7 @@ void tsort() {
 	debloc(s.mlieu);
 }
 
-void st4(integer ob) {
+void st4(int ob) {
 	crep = 997;
 	switch (ob) {
 	case 114 :
@@ -296,8 +296,8 @@ void st4(integer ob) {
 	}
 }
 
-void cherjer(integer ob, boolean &d) {
-	integer cx;
+void cherjer(int ob, boolean &d) {
+	int cx;
 
 	d = false;
 	for (cx = 1; cx <= 6; cx ++) d = (d || (ord(s.sjer[cx]) == ob));
@@ -310,14 +310,14 @@ void st1sama() {
 }
 
 void modinv() {
-	integer cx, cy, tay, i, r;
+	int cx, cy, tay, i, r;
 	phrase nom;
 	str30 nomp;
 
 	cy = 0;
 	for (cx = 1; cx <= 6; cx ++)
 		if (s.sjer[cx] != chr(0)) {
-			cy = succ(integer, cy);
+			cy = succ(int, cy);
 			r = (ord(s.sjer[cx]) + 400);
 			deline(r - 501 + c_st41, nom, tay);
 			nomp = delig;
@@ -331,10 +331,10 @@ void modinv() {
 		}
 }
 
-void sparl(long_integer adr, long_integer rep) {
-	const array<1, 8, integer> haut
+void sparl(long_int adr, long_int rep) {
+	const array<1, 8, int> haut
 	= {{0, 1, -3, 6, -2, 2, 7, -1}};
-	integer key, ad, tay, repint;
+	int key, ad, tay, repint;
 	phrase st;
 
 	repint = trunc(rep);
@@ -365,7 +365,7 @@ void finfouil() {
 }
 
 void mfoudi() {
-	integer cx;
+	int cx;
 
 	for (cx = 1; cx <= 7; cx ++) menu_disable(depl[cx]);
 	for (cx = 1; cx <= 11; cx ++) menu_disable(men[cx]);
@@ -395,10 +395,10 @@ void premtet() {
 
 /* NIVEAU 5 */
 void ajchai() {
-	integer cx, cy, lderobj;
+	int cx, cy, lderobj;
 
 
-	cy = (acha + pred(integer, pred(integer, mchai) * 10));
+	cy = (acha + pred(int, pred(int, mchai) * 10));
 	cx = 0;
 	do {
 		cx = cx + 1;
@@ -409,8 +409,8 @@ void ajchai() {
 	} else crep = 192;
 }
 
-void ajjer(integer ob) {
-	integer cx;
+void ajjer(int ob) {
+	int cx;
 
 	cx = 0;
 	do {
@@ -423,7 +423,7 @@ void ajjer(integer ob) {
 }
 
 void t1sama() {    /* On entre dans le manoir */
-	integer j, h, m;
+	int j, h, m;
 	boolean d;
 
 	calch(j, h, m);
@@ -502,7 +502,7 @@ void tctrm() {
 void quelquun()
 
 {
-	integer haz, cx;
+	int haz, cx;
 
 	if (imen)  erase_menu();
 	finfouil();
@@ -546,8 +546,8 @@ L1:
 }
 
 void tsuiv() {
-	integer cx, tbcl;
-	integer cl, cy;
+	int cx, tbcl;
+	int cl, cy;
 
 	cy = acha + ((mchai - 1) * 10) - 1;
 	cx = 0;
@@ -572,7 +572,7 @@ void tsuiv() {
 void tfleche() {
 	boolean qust;
 	char touch;
-	integer dummy, cd, xmo, ymo;
+	int dummy, cd, xmo, ymo;
 
 	if (num == 9999)  return;
 	fenat(chr(152));
@@ -596,11 +596,11 @@ void tfleche() {
 	}
 }
 
-void tcoord(integer sx)
+void tcoord(int sx)
 
 {
-	integer sy, ix, iy, cb, cy, ib;
-	integer a, b, atdon;
+	int sy, ix, iy, cb, cy, ib;
+	int a, b, atdon;
 
 
 	num = 0;
@@ -611,7 +611,7 @@ void tcoord(integer sx)
 	while (cy < caff) {
 		a = a + tabdon[atdon];
 		atdon = atdon + 4;
-		cy = succ(integer, cy);
+		cy = succ(int, cy);
 	}
 	/*     for cy:=0 to caff-1 do
 	          a:=a+ tabdon[amzon+3+4*cy];
@@ -621,19 +621,19 @@ void tcoord(integer sx)
 	a = a + fleche;
 	cb = 0;
 	for (cy = 0; cy <= (sx - 2); cy ++) {
-		ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+		ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
 		cb = cb + (ib * 4) + 2;
 	}
-	ib = (tabdon[a + cb] << 8) + tabdon[succ(integer, a + cb)];
+	ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
 	if (ib == 0)  goto L1;
 	cy = 1;
 	do {
 		cb = cb + 2;
 		sx = tabdon[a + cb] * res;
-		sy = tabdon[succ(integer, a + cb)];
+		sy = tabdon[succ(int, a + cb)];
 		cb = cb + 2;
 		ix = tabdon[a + cb] * res;
-		iy = tabdon[succ(integer, a + cb)];
+		iy = tabdon[succ(int, a + cb)];
 		cy = cy + 1;
 	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
 	           || (cy > ib)));
@@ -648,7 +648,7 @@ L1:
 }
 
 
-void st7(integer ob) {
+void st7(int ob) {
 	crep = 183;
 	if ((ob == 116) || (ob == 144))  crep = 104;
 	if ((ob == 126) || (ob == 111))  crep = 108;
@@ -657,8 +657,8 @@ void st7(integer ob) {
 	if (crep == 183)  st4(ob);
 }
 
-void treg(integer ob) {
-	integer mdes;
+void treg(int ob) {
+	int mdes;
 
 	mdes = caff;
 	caff = ob;
@@ -678,7 +678,7 @@ void treg(integer ob) {
 	}
 }
 
-void avpoing(integer &ob) {
+void avpoing(int &ob) {
 	crep = 999;
 	if (s.derobj != 0)  ajjer(s.derobj);
 	if (crep != 139) {
@@ -688,15 +688,15 @@ void avpoing(integer &ob) {
 	}
 }
 
-void rechai(integer &ch) {
-	integer cx;
+void rechai(int &ch) {
+	int cx;
 
 	cx = s.mlieu;
 	if (s.mlieu == 16)  cx = 14;
-	ch = tabdon[achai + (cx * 7) + pred(integer, num)];
+	ch = tabdon[achai + (cx * 7) + pred(int, num)];
 }
 
-void t23coul(integer &l) {
+void t23coul(int &l) {
 	boolean d;
 
 	cherjer(143, d);
@@ -712,7 +712,7 @@ void maivid() {
 	modobj(500);
 }
 
-void st13(integer ob) {
+void st13(int ob) {
 	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
 	        (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
 	        (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
@@ -722,7 +722,7 @@ void st13(integer ob) {
 }
 
 void aldepl() {
-	integer dummy;
+	int dummy;
 
 	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
 }
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 7d5f33c..c9e1d25 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -31,7 +31,7 @@
 
 /*  ecrihexa            utilitaire */
 
-void divers(integer np, boolean b) {
+void divers(int np, boolean b) {
 	teskbd();
 	do {
 		parole(np, 0, 0);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d1de4b7..9ce1788 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -1,20 +1,20 @@
-const integer m_arrow = 0;
-const integer m_point_hand = 1;
+const int m_arrow = 0;
+const int m_point_hand = 1;
 
 boolean int_m,
         clic;
 
-integer m_show,
+int m_show,
         x_s,
         y_s,
         p_o_s,
         mouse_shwn;
 
-matrix<0, 5, 0, 11, integer> s_s;
+matrix<0, 5, 0, 11, int> s_s;
 
 
 void init_mouse() {
-	integer i, j;
+	int i, j;
 	registres reg;
 
 	mouse_shwn = 0;
@@ -40,13 +40,13 @@ void init_mouse() {
 	}
 }
 
-/*procedure change_mouse( t : integer );
+/*procedure change_mouse( t : int );
 begin
   m_show:= t;
 end;*/
 
-/*procedure dessine_souris(xf,yf:integer);
-  var x, xx, y :integer;
+/*procedure dessine_souris(xf,yf:int);
+  var x, xx, y :int;
 begin
   case m_show of
              m_arrow : begin
@@ -56,10 +56,10 @@ begin
 end;  */
 
 void hide_mouse() {
-	integer i, j, k, ps, ds;
+	int i, j, k, ps, ds;
 	boolean imp;
 
-	mouse_shwn = pred(integer, mouse_shwn);
+	mouse_shwn = pred(int, mouse_shwn);
 	if (mouse_shwn == 0) {
 		imp = odd(y_s);
 		j = p_o_s;
@@ -73,7 +73,7 @@ void hide_mouse() {
 				memw[0xba00 + j] = s_s[2][k];
 				memw[0xba00 + j + 2] = s_s[3][k];
 				j = j + 80;
-				k = succ(integer, k);
+				k = succ(int, k);
 			} while (!(k >= 5));
 		}
 		break;
@@ -91,7 +91,7 @@ void hide_mouse() {
 						j = j + 0x2000;
 					}
 					imp = ! imp;
-					k = succ(integer, k);
+					k = succ(int, k);
 				} while (!(k >= 8));
 			}
 		}
@@ -111,7 +111,7 @@ void hide_mouse() {
 					ps = mem[0xa000 + j + 1];
 					mem[0xa000 + j + 1] = hi(s_s[i][k]);
 					j = j + 80;
-					k = succ(integer, k);
+					k = succ(int, k);
 				} while (!(k >= 8));
 				i = i + 1;
 			} while (!(i == 4));
@@ -134,7 +134,7 @@ void hide_mouse() {
 					memw[0xb800 + 0x200 * i + j + 2] = s_s[k + 3][i + (k << 2)];
 				}
 				j = j + 160;
-				k = succ(integer, k);
+				k = succ(int, k);
 			} while (!(k == 3));
 		}
 		break;
@@ -144,7 +144,7 @@ void hide_mouse() {
 }
 
 void show_mouse() {
-	integer i, j, k, l,
+	int i, j, k, l,
 	        ps, ds;
 	boolean imp;
 	char c;
@@ -164,7 +164,7 @@ void show_mouse() {
 			s_s[2][k] = memw[0xba00 + j];
 			s_s[3][k] = memw[0xba00 + j + 2];
 			j = j + 80;
-			k = succ(integer, k);
+			k = succ(int, k);
 		} while (!(k >= 5));
 	}
 	break;
@@ -183,7 +183,7 @@ void show_mouse() {
 					j = j + 0x2000;
 				}
 				imp = ! imp;
-				k = succ(integer, k);
+				k = succ(int, k);
 			} while (!(k >= 8));
 		}
 	}
@@ -196,9 +196,9 @@ void show_mouse() {
 			k = 0;
 			j = p_o_s;
 			do {
-				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(integer, j)] << 8);
+				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(int, j)] << 8);
 				j = j + 80;
-				k = succ(integer, k);
+				k = succ(int, k);
 			} while (!(k >= 8));
 			l = l + 1;
 		} while (!(l == 4));
@@ -221,7 +221,7 @@ void show_mouse() {
 				s_s[k + 3][i + (k << 2)] = memw[0xb800 + 0x200 * i + j + 2];
 			}
 			j = j + 160;
-			k = succ(integer, k);
+			k = succ(int, k);
 		} while (!(k == 3));
 	}
 	break;
@@ -229,7 +229,7 @@ void show_mouse() {
 	affput(2, gd, x_s, y_s, 0, 0);
 }
 
-void pos_mouse(integer x, integer y) {
+void pos_mouse(int x, int y) {
 	registres reg;
 
 	if (x > 314 * res)  x = 314 * res;
@@ -264,7 +264,7 @@ void pos_mouse(integer x, integer y) {
 	show_mouse();
 }
 
-void read_pos_mouse(integer &x, integer &y, integer &c) {
+void read_pos_mouse(int &x, int &y, int &c) {
 	registres reg;
 
 	if (int_m) {
@@ -283,7 +283,7 @@ void read_pos_mouse(integer &x, integer &y, integer &c) {
 void mov_mouse(boolean &funct, char &key) {
 	boolean p_key;
 	char in1, in2;
-	integer x, y, cx, cy, cd;
+	int x, y, cx, cy, cd;
 	registres reg;
 
 	if (int_m) {
@@ -354,16 +354,16 @@ void mov_mouse(boolean &funct, char &key) {
 				input >> kbd >> in2;
 				switch (in2) {
 				case 'K' :
-					cx = pred(integer, cx);
+					cx = pred(int, cx);
 					break;
 				case 'P' :
-					cy = succ(integer, cy);
+					cy = succ(int, cy);
 					break;
 				case 'M' :
 					cx = cx + 2;
 					break;
 				case 'H' :
-					cy = pred(integer, cy);
+					cy = pred(int, cy);
 					break;
 				case RANGE_10(';', 'D') : {
 					funct = true;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 7c8f1c9..ec77287 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -30,9 +30,9 @@ const array<0, 31, byte> tab31
 	}
 };
 
-void deline(integer num , phrase &l , integer &tl);
+void deline(int num , phrase &l , int &tl);
 
-static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
+static void cinq_huit(char &c, int &ind, byte &pt, boolean &the_end) {
 	const array<0, 31, char> rap
 	= {{ ',', ':', '@', '!', '?', '-', '‡',
 			' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
@@ -41,7 +41,7 @@ static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
 			'6', '7', '8', '9'
 		}
 	};
-	integer oct, ocd;
+	int oct, ocd;
 
 	/* 5-8 */
 	oct = t_mot[ind];
@@ -88,8 +88,8 @@ static void cinq_huit(char &c, integer &ind, byte &pt, boolean &the_end) {
 	}
 }              /* 5-8 */
 
-void deline(integer num , phrase &l , integer &tl) {
-	integer i, j, ts;
+void deline(int num , phrase &l , int &tl) {
+	int i, j, ts;
 	char let;
 	byte ps, k;
 	boolean the_end;
@@ -115,27 +115,27 @@ void deline(integer num , phrase &l , integer &tl) {
 }       /* DETEX */
 
 
-void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ);
+void afftex(phrase ch, int x, int y, int dx, int dy, int typ);
 
 
-static integer l_motsuiv(integer p, phrase &ch, integer &tab) {
-	integer c;
+static int l_motsuiv(int p, phrase &ch, int &tab) {
+	int c;
 
-	integer l_motsuiv_result;
+	int l_motsuiv_result;
 	c = p;
 	while (!(set::of(' ', '$', '@', eos).has(ch[p])))  p = p + 1;
 	l_motsuiv_result = tab * (p - c);
 	return l_motsuiv_result;
 }
 
-void afftex(phrase ch, integer x, integer y, integer dx, integer dy, integer typ) {
+void afftex(phrase ch, int x, int y, int dx, int dy, int typ) {
 	boolean the_end;
 	char touch;
-	integer xf, yf;
-	integer xc, yc;
-	integer tab, p;
+	int xf, yf;
+	int xc, yc;
+	int tab, p;
 	varying_string<255> s;
-	integer i, j, nt;
+	int i, j, nt;
 
 
 	/*    debug('  .. Afftex');*/
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index d40f8d3..c238427 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -1,6 +1,6 @@
 void dem2() {
 	untyped_file f;
-	integer k;
+	int k;
 
 	/* -- demande de disk 2 -- */
 	while (ioresult != 0);
@@ -35,7 +35,7 @@ void ani50() {
   end;*/
 
 /* overlay */ void aff50(boolean c) {
-	integer k;
+	int k;
 
 	caff = 50;
 	maff = 0;
@@ -47,7 +47,7 @@ void ani50() {
 }
 
 /* overlay */ void init_menu() {
-	integer i, j, tai;
+	int i, j, tai;
 	phrase st;
 	untyped_file f;
 
@@ -77,7 +77,7 @@ void ani50() {
 			deline(i + c_dis, st, tai);
 			dis[i] = delig + ' ';
 		}
-		i = succ(integer, i);
+		i = succ(int, i);
 	} while (!(i == 22));
 	for (i = 1; i <= 8; i ++) {
 		disc[i] = 0x500 + i;
@@ -96,7 +96,7 @@ void ani50() {
 /* overlay */ void charpal() {
 	file<tabdb> f;
 	file<tfxx> ft;
-	integer i, j, k;
+	int i, j, k;
 	file<byte> fb;
 	byte b;
 
@@ -138,7 +138,7 @@ void ani50() {
 }
 
 /* overlay */ void chartex() {
-	integer i;
+	int i;
 	untyped_file fibyte;
 	phrase s;
 
@@ -169,7 +169,7 @@ void ani50() {
 /* overlay */ void dialpre()
 
 {
-	integer cy, tay;
+	int cy, tay;
 	phrase st;
 	real ix;
 	char ch;
@@ -244,7 +244,7 @@ void ani50() {
 
 /* overlay */ void music() {
 	untyped_file fic;
-	integer k;
+	int k;
 	boolean fin;
 	char ch;
 	real x, y;
@@ -326,7 +326,7 @@ void ani50() {
 	if (newgd != gd)  gd = newgd;
 	hirs();
 	dessine(ades, 0, 0);
-	gotoxy(20 * pred(integer, res) + 8, 24);
+	gotoxy(20 * pred(int, res) + 8, 24);
 	textcolor(7);
 	cpr = "COPYRIGHT 1989 : LANKHOR";
 	if (set::of(ega, ams, cga, eos).has(gd))  output << cpr;
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 3b777c3..42a46e1 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -1,5 +1,5 @@
 
-void spfrac(integer wor) {
+void spfrac(int wor) {
 	c3.rep = (cardinal)wor >> 12;
 	if ((typlec == 0) && (c3.code != 9))
 		if (((c3.code > 4) && (c3.val != 20) && !(set::of(3, 6, 9, eos).has(c3.rep))) ||
@@ -10,7 +10,7 @@ void spfrac(integer wor) {
 }
 
 void charg_car() {
-	integer wor, int_;
+	int wor, int_;
 
 	wor = swap(memw[adword + ptr_word]);
 	int_ = wor & 0x3f;
@@ -67,7 +67,7 @@ void veracf(byte b) {
 }
 
 /* overlay */ void cctable(tablint &t) {
-	integer k;
+	int k;
 	array<0, 256, real> tb;
 
 
@@ -79,7 +79,7 @@ void veracf(byte b) {
 }
 
 /* overlay */ void regenbruit() {
-	integer i, j;
+	int i, j;
 
 	i = offsetb3 + 8590;
 	j = 0;
@@ -113,7 +113,7 @@ void veracf(byte b) {
 
 /* overlay */   void charge_bruit() {
 	untyped_file f;
-	integer j, i;
+	int j, i;
 
 	assign(f, "bruits");
 	reset(f);
@@ -125,7 +125,7 @@ void veracf(byte b) {
 
 /* overlay */   void trait_car() {
 	byte d3;
-	integer d2, i;
+	int d2, i;
 
 	switch (c2.code) {
 	case 9 :
@@ -388,9 +388,9 @@ void veracf(byte b) {
 var
    regs : registres;
  buffer : array[0..511] of char;
-  i,j,k : integer;
+  i,j,k : int;
      st : phrase;
-    tay : integer;
+    tay : int;
    test : array[0..2] of boolean;
 const
  chaine : array[0..7] of char
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 07ac757..02ec4fb 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -19,10 +19,10 @@ void init_chariot() {
 
 
 void trait_ph() {
-	const array<0, 2, integer> deca
+	const array<0, 2, int> deca
 	= {{300, 30, 40}};
 
-	ptr_tcph = pred(integer, num_ph);
+	ptr_tcph = pred(int, num_ph);
 	ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
 	lefin = swap(t_cph[ptr_tcph + 1]) + deca[typlec];
 	nb_word = lefin - ledeb;
@@ -51,10 +51,10 @@ void trait_ph() {
 
 
 
-void parole(integer rep, integer ht, integer typ) {
-	array<0, 500, integer> savph;
-	integer i;
-	integer tempo;
+void parole(int rep, int ht, int typ) {
+	array<0, 500, int> savph;
+	int i;
+	int tempo;
 
 
 	if (sonoff)  return;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 7bdea5b..62dc99f 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -1,5 +1,5 @@
-/* overlay */ void change_gd(integer ngd) {
-	integer i;
+/* overlay */ void change_gd(int ngd) {
+	int i;
 
 	hide_mouse();
 	gd = ngd;
@@ -20,10 +20,10 @@
 }
 
 /* overlay */ void antegame() {
-	integer cx;
+	int cx;
 	registres regs;
 	array<0, 511, char> buffer;
-	integer i, j, k;
+	int i, j, k;
 	array<0, 2, boolean> test;
 	array<0, 7, char> g;
 
@@ -71,7 +71,7 @@
 	stpou = ind_mess;
 	while ((test[k] == false) && (k < 2)) {
 		regs.ax = 0;
-		k = succ(integer, k);
+		k = succ(int, k);
 		intr(19, regs);
 		{
 			regs.ax = 0x201;
@@ -118,7 +118,7 @@
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
 void tmaj3() {
-	integer j, h, m;
+	int j, h, m;
 
 	calch(j, h, m);
 	if (m == 30)  m = 1;
@@ -130,7 +130,7 @@ void tmaj3() {
 void tsitu()
 
 {
-	integer h, j, m;
+	int h, j, m;
 
 	if (! col)  clsf2();
 	syn = false;
@@ -203,14 +203,14 @@ L2:
 	mennor();
 }
 
-void sv_game(integer n);
+void sv_game(int n);
 
-void ld_game(integer n);
+void ld_game(int n);
 
 void tecran() {
 	const char idem[] = "Idem";
-	const integer lim = 20000;
-	integer temps;
+	const int lim = 20000;
+	int temps;
 	char inkey;
 	boolean oo, funct;
 
@@ -235,11 +235,11 @@ void tecran() {
 		erase_menu();
 		imen = false;
 		if (set::of('\1', '\3', '\5', '\7', '\11', eos).has(inkey)) {
-			change_gd((cardinal)pred(integer, ord(inkey)) >> 1);
+			change_gd((cardinal)pred(int, ord(inkey)) >> 1);
 			return;
 		}
 		if (choisi && (msg[3] == sauve))  sv_game(msg[4] & 7);
-		if (choisi && (msg[3] == charge))  ld_game(pred(integer, msg[4] & 7));
+		if (choisi && (msg[3] == charge))  ld_game(pred(int, msg[4] & 7));
 		if (inkey == '\103') {       /* F9 */
 			temps = do_alert(stpou, 1);
 			return;
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 87d0c87..6f7a05e 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -1,23 +1,23 @@
 
 /* overlay */ boolean ques() {
-	const array<1, 10, integer> ta
+	const array<1, 10, int> ta
 	= {{
 			511, 516, 524, 531, 545,
 			552, 559, 563, 570, 576
 		}
 	};
-	const array<1, 10, integer> ok
+	const array<1, 10, int> ok
 	= {{ 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }};
 
 	boolean q, func, test;
-	integer i, j, k, y, memk;
-	integer tay , tmax;
-	integer rep, prem, der;
+	int i, j, k, y, memk;
+	int tay , tmax;
+	int rep, prem, der;
 	phrase st;
 	char key;
 	mult_rect coor;
 	array<1, 14, str40> chaines;
-	integer compte;
+	int compte;
 
 
 	boolean ques_result;
@@ -53,7 +53,7 @@
 			memk = memk + 1;
 			y = y + 8;
 		}
-		for (j = 1; j <= succ(integer, der - prem); j ++) {
+		for (j = 1; j <= succ(int, der - prem); j ++) {
 			{
 				rectangle &with = coor[j];
 
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 854fdd6..bdb0a1b 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -1,16 +1,16 @@
-void fill_box(integer x, integer y, integer dx) {
-	box(15, gd, pred(integer, x) << 3, pred(integer, y) << 3, pred(integer, x + dx) << 3, y << 3, 255);
+void fill_box(int x, int y, int dx) {
+	box(15, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
 }
 
-void clear_box(integer x, integer y, integer dx) {
-	box(0, gd, pred(integer, x) << 3, pred(integer, y) << 3, pred(integer, x + dx) << 3, y << 3, 255);
+void clear_box(int x, int y, int dx) {
+	box(0, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
 }
 
-void writeg(str255 l, integer c)
+void writeg(str255 l, int c)
 
 {
-	integer i, x, xo, yo;
-	integer cecr;
+	int i, x, xo, yo;
+	int cecr;
 	boolean t;
 
 	/*  debug('writeg : '+l);*/
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 0020311..d1e447d 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -1,5 +1,5 @@
-void chardes(str11 nom, long_integer passe, integer long_) {
-	integer i, p, l;
+void chardes(str11 nom, long_int passe, int long_) {
+	int i, p, l;
 	byte b;
 	untyped_file f;
 
@@ -28,8 +28,8 @@ void chardes(str11 nom, long_integer passe, integer long_) {
 	/*$i+*/
 }
 
-void charani(str11 nom, long_integer passe, integer long_) {
-	integer i, p, l;
+void charani(str11 nom, long_int passe, int long_) {
+	int i, p, l;
 	byte b;
 	untyped_file f;
 
@@ -67,12 +67,12 @@ void taffich() {
 			110, 159, 100, 100
 		}
 	};
-	integer i, m, a, b, cx, handle,
+	int i, m, a, b, cx, handle,
 	        npal;
-	long_integer lgt, lhandle;
+	long_int lgt, lhandle;
 	str11 nom;
-	integer palh, k, j;
-	array<0, 15, integer> alllum;
+	int palh, k, j;
+	array<0, 15, int> alllum;
 
 
 	a = caff;
@@ -144,7 +144,7 @@ void taffich() {
 	chardes(nom, lgt, handle);
 	if (gd == her) {
 		for (i = 0; i <= 15; i ++) {
-			palh = memw[0x7000 + (succ(integer, i) << 1)];
+			palh = memw[0x7000 + (succ(int, i) << 1)];
 			alllum[i] = (palh & 15) + (((cardinal)palh >> 12) & 15) + (((cardinal)palh >> 8) & 15);
 		}
 		for (i = 0; i <= 15; i ++) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index bdc6b59..d0edc2e 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -15,101 +15,101 @@
 
 const real freq0 = 1.19318e6;
 
-const integer seg_syst = 0x6fed;
-const integer segmou = 0x6f00;
-const integer segdon = 0x6c00;
-const integer adani = 0x7314;
-const integer adword = 0x4000;
-const integer adtroct = 0x406b;
-const integer adcfiec = 0x4300;
-const integer adbruit = 0x5cb0;/*2C00;*/
-const integer adbruit1 = 0x6924;/*3874;*/
-const integer adbruit2 = 0x6b30;/*3A80;*/
-const integer adbruit3 = 0x6ba6;/*3AF6;*/
-const integer adbruit5 = 0x3b50;
-const integer adson = 0x5cb0;/*2C00;*/
-const integer adson2 = 0x60b0;/*3000;*/
-const integer offsetb1 = 6;
-const integer offsetb2 = 4;
-const integer offsetb3 = 6;
-
-const integer null = 255;
-
-const integer tempo_mus = 71;
-const integer tempo_bruit = 78;
-const integer tempo_f = 80;
-const integer tempo_m = 89;
-
-const integer ti1 = 410;
-const integer ti2 = 250;
-const integer maxti = 7975;
-const integer maxtd = 600;
-const integer max_rect = 14;
-
-const integer ams = 0;
-const integer cga = 1;
-const integer ega = 2;
-const integer her = 3;
-const integer tan = 4;
-
-const integer c_repon = 0;
-const integer c_st41 = 186;
-const integer c_tparler = 247;
-const integer c_paroles = 292;
-const integer c_tmlieu = 435;
-const integer c_dialpre = 456;
-const integer c_action = 476;
-const integer c_saction = 497;
-const integer c_dis = 502;
-const integer c_fin = 510;    /*  =>   n'existe pas  ; si !! */
-
-const integer arega = 0;
-const integer asoul = 154;
-const integer aouvr = 282;
-const integer achai = 387;
-const integer acha = 492;
-const integer arcf = 1272;
-const integer arep = 1314;
-const integer amzon = 1650;
-const integer fleche = 1758;
-
-const integer no_choice = 0;
-const integer invent = 1;
-const integer depla = 2;
-const integer action = 3;
-const integer saction = 4;
-const integer discut = 5;
-const integer fichier = 6;
-const integer sauve = 7;
-const integer charge = 8;
-
-const integer attacher = 0x301;
-const integer attendre = 0x302;
-const integer defoncer = 0x303;
-const integer dormir = 0x304;
-const integer ecouter = 0x305;
-const integer entrer = 0x306;
-const integer fermer = 0x307;
-const integer fouiller = 0x308;
-const integer frapper = 0x309;
-const integer gratter = 0x30a;
-const integer lire = 0x30b;
-const integer manger = 0x30c;
-const integer mettre = 0x30d;
-const integer ouvrir = 0x30e;
-const integer prendre = 0x30f;
-const integer regarder = 0x310;
-const integer sentir = 0x311;
-const integer sonder = 0x312;
-const integer sortir = 0x313;
-const integer soulever = 0x314;
-const integer tourner = 0x315;
-
-const integer scacher = 0x401;
-const integer sfouiller = 0x402;
-const integer slire = 0x403;
-const integer sposer = 0x404;
-const integer sregarder = 0x405;
+const int seg_syst = 0x6fed;
+const int segmou = 0x6f00;
+const int segdon = 0x6c00;
+const int adani = 0x7314;
+const int adword = 0x4000;
+const int adtroct = 0x406b;
+const int adcfiec = 0x4300;
+const int adbruit = 0x5cb0;/*2C00;*/
+const int adbruit1 = 0x6924;/*3874;*/
+const int adbruit2 = 0x6b30;/*3A80;*/
+const int adbruit3 = 0x6ba6;/*3AF6;*/
+const int adbruit5 = 0x3b50;
+const int adson = 0x5cb0;/*2C00;*/
+const int adson2 = 0x60b0;/*3000;*/
+const int offsetb1 = 6;
+const int offsetb2 = 4;
+const int offsetb3 = 6;
+
+const int null = 255;
+
+const int tempo_mus = 71;
+const int tempo_bruit = 78;
+const int tempo_f = 80;
+const int tempo_m = 89;
+
+const int ti1 = 410;
+const int ti2 = 250;
+const int maxti = 7975;
+const int maxtd = 600;
+const int max_rect = 14;
+
+const int ams = 0;
+const int cga = 1;
+const int ega = 2;
+const int her = 3;
+const int tan = 4;
+
+const int c_repon = 0;
+const int c_st41 = 186;
+const int c_tparler = 247;
+const int c_paroles = 292;
+const int c_tmlieu = 435;
+const int c_dialpre = 456;
+const int c_action = 476;
+const int c_saction = 497;
+const int c_dis = 502;
+const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
+
+const int arega = 0;
+const int asoul = 154;
+const int aouvr = 282;
+const int achai = 387;
+const int acha = 492;
+const int arcf = 1272;
+const int arep = 1314;
+const int amzon = 1650;
+const int fleche = 1758;
+
+const int no_choice = 0;
+const int invent = 1;
+const int depla = 2;
+const int action = 3;
+const int saction = 4;
+const int discut = 5;
+const int fichier = 6;
+const int sauve = 7;
+const int charge = 8;
+
+const int attacher = 0x301;
+const int attendre = 0x302;
+const int defoncer = 0x303;
+const int dormir = 0x304;
+const int ecouter = 0x305;
+const int entrer = 0x306;
+const int fermer = 0x307;
+const int fouiller = 0x308;
+const int frapper = 0x309;
+const int gratter = 0x30a;
+const int lire = 0x30b;
+const int manger = 0x30c;
+const int mettre = 0x30d;
+const int ouvrir = 0x30e;
+const int prendre = 0x30f;
+const int regarder = 0x310;
+const int sentir = 0x311;
+const int sonder = 0x312;
+const int sortir = 0x313;
+const int soulever = 0x314;
+const int tourner = 0x315;
+
+const int scacher = 0x401;
+const int sfouiller = 0x402;
+const int slire = 0x403;
+const int sposer = 0x404;
+const int sregarder = 0x405;
 
 const array<0, 17, byte> tabdbc
 = {{7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9}};
@@ -165,7 +165,7 @@ const char recom[] = " Recommence  ";
 const char f3[] = "F3: Encore";
 const char f8[] = "F8: Suite";
 
-const integer max_patt = 20;
+const int max_patt = 20;
 
 
 const array<0, 15, byte> rang
@@ -177,29 +177,29 @@ const array<0, 15, byte> rang
 /*---------------------------------------------------------------------------*/
 
 typedef varying_string<11> path_chars;
-typedef real long_integer;
+typedef real long_int;
 typedef varying_string<255> str255;
 typedef varying_string<125> str125;
 typedef varying_string<30> str30;
 typedef varying_string<11> str11;
 typedef file<byte> fichier_byte;
 struct sav_chaine {
-	integer conf;
+	int conf;
 	array<0, 10, char> pourc;
 	array<0, 42, char> teauto;
 	array<0, 30, char> sjer;
-	integer mlieu, iboul, ibag, icave, ivier, ipuit;
-	integer derobj, iloic, icryp;
+	int mlieu, iboul, ibag, icave, ivier, ipuit;
+	int derobj, iloic, icryp;
 	boolean ipre;
 	char heure;
 };
 struct registres {
-	integer ax, bx, cx, dx, bp, si, di, ds, es, flags;
+	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
 };
 typedef array<1, 1410, char> phrase;
-typedef array<0, maxti, integer> tabint;
+typedef array<0, maxti, int> tabint;
 struct ind {
-	integer indis;
+	int indis;
 	byte point;
 };
 typedef array<0, maxtd, ind> tabind;
@@ -207,11 +207,11 @@ typedef array<0, maxtd, ind> tabind;
 typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
 
 typedef array<0, 255, real> table;
-typedef array<0, 255, integer> tablint;
+typedef array<0, 255, int> tablint;
 
-typedef integer word1;
+typedef int word1;
 struct chariot {
-	integer val,
+	int val,
 	        code,
 	        acc,
 	        freq,
@@ -222,9 +222,9 @@ struct doublet {
 	byte x, y;
 };
 typedef array<1, 16, doublet> tabdb;
-typedef array<0, 107, integer> tfxx;
+typedef array<0, 107, int> tfxx;
 struct rectangle {
-	integer x1, x2, y1, y2;
+	int x1, x2, y1, y2;
 	boolean etat;
 };
 
@@ -294,7 +294,7 @@ boolean blo,
         active_menu;
 
 
-integer x,
+int x,
         y,
         t,
         vj,
@@ -353,9 +353,9 @@ integer x,
         ptr_word,
         color_txt;
 
-array<0, 6400, integer> t_cph;
+array<0, 6400, int> t_cph;
 array<0, 4000, byte> tabdon;
-/*   t_dxx  : array[0..121] of integer;*/
+/*   t_dxx  : array[0..121] of int;*/
 str125 stpou;                               /* donne le % d'indices */
 byte is;
 char mode;
@@ -365,12 +365,12 @@ str125 al_mess,
        ind_mess,
        al_mess2;
 
-array<1, 8, integer> invt,
+array<1, 8, int> invt,
       nbrep,
       nbrepm,
       disc;
-array<0, 4, integer> msg;
-array<1, 7, integer> depl;
+array<0, 4, int> msg;
+array<1, 7, int> depl;
 array<1, 8, varying_string<22> > inv;
 array<1, 7, varying_string<23> > dep;
 array<1, 21, varying_string<10> > act;
@@ -385,7 +385,7 @@ matrix<1, 6, 0, 23, byte> lettres;
 array<0, 15, byte> palher;
 
 tabint t_mot;
-integer tay_tchar;
+int tay_tchar;
 tabind t_rec;
 file<ind> sauv_t;
 untyped_file fibyte;
@@ -405,14 +405,14 @@ array<0, 14, pattern> tpt;
 /*--------------------   PROCEDURES  ET  FONCTIONS   ------------------------*/
 /*---------------------------------------------------------------------------*/
 
-/* procedure box(c,Gd,xo,yo,xi,yi,patt:integer); external 'c:\mc\boite.com'; */
+/* procedure box(c,Gd,xo,yo,xi,yi,patt:int); external 'c:\mc\boite.com'; */
 
 void hirs() {
 	const array<0, 13, byte> tandy
 	= {{113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0}};
 	const array<0, 12, byte> herc
 	= {{50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0}};
-	integer i, j;
+	int i, j;
 
 	switch (gd) {
 	case cga : {
@@ -470,13 +470,13 @@ void hirs() {
 	}
 }
 
-/* procedure affput(Chx,Gd,x,y,coul,char:integer); external 'c:\mc\divaf.com'; */
+/* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */
 
-void affcar(integer gd, integer x, integer y, integer coul, integer char) {
+void affcar(int gd, int x, int y, int coul, int char) {
 	if (res == 1)  affput(1, gd, ((cardinal)x >> 1), y, coul, char);
 	else affput(1, gd, x, y, coul, char);
 }
 
-void putpix(integer gd, integer x, integer y, integer coul) {
+void putpix(int gd, int x, int y, int coul) {
 	affput(0, gd, x, y, coul, 0);
 }


Commit: 3e77d346281fddfd17640ab0198e067838e54113
    https://github.com/scummvm/scummvm/commit/3e77d346281fddfd17640ab0198e067838e54113
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:18-07:00

Commit Message:
MORTEVIELLE: Register engine at engines.mk

Changed paths:
    engines/engines.mk
    engines/mortevielle/module.mk



diff --git a/engines/engines.mk b/engines/engines.mk
index 9939506..ec5845d 100644
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@ -125,6 +125,11 @@ DEFINES += -DENABLE_RIVEN
 endif
 endif
 
+ifdef ENABLE_MORTEVIELLE
+DEFINES += -DENABLE_MORTEVIELLE=$(ENABLE_MORTEVIELLE)
+MODULES += engines/mortevielle
+endif
+
 ifdef ENABLE_PARALLACTION
 DEFINES += -DENABLE_PARALLACTION=$(ENABLE_PARALLACTION)
 MODULES += engines/parallaction
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 6569d70..3213d15 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -1,5 +1,5 @@
 MODULE := engines/mortevielle
- 
+
 MODULE_OBJS := \
 	actions.o \
 	alert.o \
@@ -22,11 +22,11 @@ MODULE_OBJS := \
 	sprint.o \
 	taffich.o \
 	var_mor.o
- 
+
 # This module can be built as a plugin
 ifeq ($(ENABLE_MORTEVIELLE), DYNAMIC_PLUGIN)
 PLUGIN := 1
 endif
- 
+
 # Include common rules 
 include $(srcdir)/rules.mk


Commit: 3c6f644244a4b33fb3b03e70ac9db95f38b9b88e
    https://github.com/scummvm/scummvm/commit/3c6f644244a4b33fb3b03e70ac9db95f38b9b88e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:20-07:00

Commit Message:
MORTEVIELLE: real -> float

Changed paths:
    engines/mortevielle/droite.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 0ad212d..20899ce 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -1,7 +1,7 @@
 void droite(int x, int y, int xx, int yy, int coul) {
 	int step, i;
-	real a, b;
-	real xr, yr, xro, yro;
+	float a, b;
+	float xr, yr, xro, yro;
 
 	xr = x;
 	yr = y;
@@ -9,7 +9,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 	yro = yy;
 	/*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
 	if (abs(y - yy) > abs(x - xx)) {
-		a = (real)((x - xx)) / (y - yy);
+		a = (float)((x - xx)) / (y - yy);
 		b = (yr * xro - yro * xr) / (y - yy);
 		i = y;
 		if (y > yy)  step = -1;
@@ -20,7 +20,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		} while (!(i == yy));
 		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
 	} else {
-		a = (real)((y - yy)) / (x - xx);
+		a = (float)((y - yy)) / (x - xx);
 		b = ((yro * xr) - (yr * xro)) / (x - xx);
 		i = x;
 		if (x > xx)  step = -1;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index cee4e31..1ec2332 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -279,7 +279,7 @@ void paint_rect(int x, int y, int dx, int dy) {
 
 int hazard(int min, int max) {
 	int ha1;
-	real ha2;
+    float ha2;
 
 	/* debug('hazard'); */
 	int hazard_result;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index c238427..8545fae 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -171,7 +171,7 @@ void ani50() {
 {
 	int cy, tay;
 	phrase st;
-	real ix;
+	float ix;
 	char ch;
 
 
@@ -247,7 +247,7 @@ void ani50() {
 	int k;
 	boolean fin;
 	char ch;
-	real x, y;
+	float x, y;
 
 
 	/* debug('o3 music'); */
@@ -260,7 +260,7 @@ void ani50() {
 	blockread(fic, mem[0x47a0 + 0], 123);
 	close(fic);
 	demus(0x3800, 0x5000, 623);
-	addfix = (real)((tempo_mus - addv[1])) / 256;
+	addfix = (float)((tempo_mus - addv[1])) / 256;
 	cctable(tbi);
 
 	fin = false;
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 42a46e1..03940f5 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -68,7 +68,7 @@ void veracf(byte b) {
 
 /* overlay */ void cctable(tablint &t) {
 	int k;
-	array<0, 256, real> tb;
+	array<0, 256, float> tb;
 
 
 	tb[0] = 0;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 02ec4fb..eec9798 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -66,7 +66,7 @@ void parole(int rep, int ht, int typ) {
 		tempo = tempo_bruit;
 	} else if (haut > 5)  tempo = tempo_f;
 	else tempo = tempo_m;
-	addfix = (real)((tempo - addv[0])) / 256;
+	addfix = (float)((tempo - addv[0])) / 256;
 	cctable(tbi);
 	switch (typ) {
 	case 1 : {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index d0edc2e..ffd7dcb 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -13,7 +13,7 @@
 /*-------------------------   CONSTANTES   ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-const real freq0 = 1.19318e6;
+const float freq0 = 1.19318e6;
 
 const int seg_syst = 0x6fed;
 const int segmou = 0x6f00;
@@ -177,7 +177,7 @@ const array<0, 15, byte> rang
 /*---------------------------------------------------------------------------*/
 
 typedef varying_string<11> path_chars;
-typedef real long_int;
+typedef float long_int;
 typedef varying_string<255> str255;
 typedef varying_string<125> str125;
 typedef varying_string<30> str30;
@@ -206,7 +206,7 @@ typedef array<0, maxtd, ind> tabind;
 
 typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
 
-typedef array<0, 255, real> table;
+typedef array<0, 255, float> table;
 typedef array<0, 255, int> tablint;
 
 typedef int word1;
@@ -393,7 +393,7 @@ tab_mlieu v_lieu;
 tfxx l;
 tablint tbi;
 chariot c1, c2, c3;
-real addfix;
+float addfix;
 pal_cga palsav;
 array<0, 90, tabdb> tabpal;
 pal_cga palcga;
@@ -424,7 +424,7 @@ void hirs() {
 	break;
 	case ams : {
 		hires;
-		inline_((real)(0xb8) / 6 / 0 /   /*  =>  mov ax,6 */
+		inline_((float)(0xb8) / 6 / 0 /   /*  =>  mov ax,6 */
 		        0xcd / 0x10);     /*  =>  int 16   */
 		port[0x3d9] = 15;
 		port[0x3df] = 0;
@@ -433,7 +433,7 @@ void hirs() {
 	}
 	break;
 	case ega : {
-		inline_((real)(0xb8) / 14 / 0 /     /*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs */
+		inline_((float)(0xb8) / 14 / 0 /     /*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs */
 		        0xcd / 0x10);        /*  INT 16  */
 		res = 2;
 	}
@@ -445,7 +445,7 @@ void hirs() {
 			port[0x3b4] = i;
 			port[0x3b5] = herc[i];
 		}
-		inline_((real)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
+		inline_((float)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
 		port[0x3b8] = 10;
 		res = 2;
 	}


Commit: 3390d178c5dbf7186089fe95f48a75588779ab4c
    https://github.com/scummvm/scummvm/commit/3390d178c5dbf7186089fe95f48a75588779ab4c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:21-07:00

Commit Message:
MORTEVIELLE: Transformed some array to C arrays

Changed paths:
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index ffd7dcb..0fb4eb0 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -111,16 +111,11 @@ const int slire = 0x403;
 const int sposer = 0x404;
 const int sregarder = 0x405;
 
-const array<0, 17, byte> tabdbc
-= {{7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9}};
-const array<0, 15, byte> tabdph
-= {{0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10}};
-const array<0, 25, byte> typcon
-= {{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}};
-const array<0, 25, byte> intcon
-= {{1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}};
-const array<0, 363, byte> tnocon
-= {{
+const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte tnocon[364] = {
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -135,7 +130,6 @@ const array<0, 363, byte> tnocon
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-	}
 };
 
 
@@ -168,8 +162,7 @@ const char f8[] = "F8: Suite";
 const int max_patt = 20;
 
 
-const array<0, 15, byte> rang
-= {{15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0}};
+const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
 
 /*---------------------------------------------------------------------------*/
@@ -185,9 +178,9 @@ typedef varying_string<11> str11;
 typedef file<byte> fichier_byte;
 struct sav_chaine {
 	int conf;
-	array<0, 10, char> pourc;
-	array<0, 42, char> teauto;
-	array<0, 30, char> sjer;
+	char pourc[11];
+	char teauto[43];
+	char sjer[31];
 	int mlieu, iboul, ibag, icave, ivier, ipuit;
 	int derobj, iloic, icryp;
 	boolean ipre;
@@ -197,7 +190,6 @@ struct registres {
 	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
 };
 typedef array<1, 1410, char> phrase;
-typedef array<0, maxti, int> tabint;
 struct ind {
 	int indis;
 	byte point;
@@ -206,9 +198,6 @@ typedef array<0, maxtd, ind> tabind;
 
 typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
 
-typedef array<0, 255, float> table;
-typedef array<0, 255, int> tablint;
-
 typedef int word1;
 struct chariot {
 	int val,
@@ -222,7 +211,6 @@ struct doublet {
 	byte x, y;
 };
 typedef array<1, 16, doublet> tabdb;
-typedef array<0, 107, int> tfxx;
 struct rectangle {
 	int x1, x2, y1, y2;
 	boolean etat;
@@ -384,14 +372,14 @@ matrix<1, 6, 0, 23, byte> lettres;
 
 array<0, 15, byte> palher;
 
-tabint t_mot;
+int t_mot[maxti + 1];
 int tay_tchar;
 tabind t_rec;
 file<ind> sauv_t;
 untyped_file fibyte;
 tab_mlieu v_lieu;
-tfxx l;
-tablint tbi;
+int l[108];
+int tbi[256];
 chariot c1, c2, c3;
 float addfix;
 pal_cga palsav;
@@ -408,10 +396,8 @@ array<0, 14, pattern> tpt;
 /* procedure box(c,Gd,xo,yo,xi,yi,patt:int); external 'c:\mc\boite.com'; */
 
 void hirs() {
-	const array<0, 13, byte> tandy
-	= {{113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0}};
-	const array<0, 12, byte> herc
-	= {{50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0}};
+	const byte tandy[14] = {113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0};
+	const byte herc[13] = {50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0};
 	int i, j;
 
 	switch (gd) {


Commit: 28904f0d01510c309cfa9ef4b60bbaa745d78aad
    https://github.com/scummvm/scummvm/commit/28904f0d01510c309cfa9ef4b60bbaa745d78aad
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:22-07:00

Commit Message:
MORTEVIELLE: str* -> Common::String

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 83ad8d4..bdb4827 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -442,7 +442,7 @@ L2:
 	int quel;
 	boolean entre;
 	phrase st;
-	str255 str_;
+	Common::String str_;
 	int i, tay;
 
 	if (s.derobj == 0) {
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index cec339e..f1c69ef 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -1,4 +1,4 @@
-/* overlay */ int do_alert(str255 str_, int n);
+/* overlay */ int do_alert(Common::String str_, int n);
 
 
 const int nligne = 7;
@@ -10,7 +10,7 @@ const matrix<1, 2, 1, 3, int> coord
 
 
 
-static void decod(str255 s, int &nbc, int &nbl, int &col, str255 &c, str30 &cs) {
+static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
 	int i, k;
 	boolean v;
 
@@ -68,7 +68,7 @@ static void fait_boite(int lidep, int nli, int tx) {
 
 
 
-static void fait_choix(str30 c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp) {
+static void fait_choix(Common::String c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp) {
 	int i, l, x;
 	char ch;
 
@@ -89,15 +89,15 @@ static void fait_choix(str30 c, int &coldep, int &nbcase, array<1, 2, varying_st
 	}
 }
 
-int do_alert(str255 str_, int n) {
+int do_alert(Common::String str_, int n) {
 	int coldep, esp, i, l, nbcase, quoi, ix;
-	str255 st, chaine;
+	Common::String st, chaine;
 	matrix<1, 2, 1, 2, int> limit;
 	char c, dumi;
 	array<1, 2, varying_string<3> > s;
 	int cx, cy, cd, nbcol, nblig;
 	boolean touch, newaff, test, test1, test2, test3, dum;
-	str30 cas;
+	Common::String cas;
 
 
 	/*debug('** do_alert **');*/
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 9018414..cd72d7b 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -1,8 +1,8 @@
 /* NIVEAU 14*/
 
-/* overlay */ void menut(int no, str30 nom) {
+/* overlay */ void menut(int no, Common::String nom) {
 	byte h, l;
-	str30 s;
+	Common::String s;
 
 
 	/* debug('menut'); */
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 1ec2332..f32ca96 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -174,7 +174,7 @@ void ecrf2() {
 	/*boite(0,175,630,15,15);*/
 }
 
-void ecr2(str255 str_) {
+void ecr2(Common::String str_) {
 	int tab;
 	int tlig;
 
@@ -211,7 +211,7 @@ void clsf3() {
 	show_mouse();
 }
 
-void ecr3(str255 text) {
+void ecr3(Common::String text) {
 	/* debug('ecr3 : '+text);*/
 	clsf3();
 	putxy(8, 192);
@@ -324,7 +324,7 @@ void okpas() {
 
 void modobj(int m) {
 	phrase str_;
-	str30 strp;
+	Common::String strp;
 	int i, tay;
 
 	/* debug('modobj'); */
@@ -339,7 +339,7 @@ void modobj(int m) {
 
 void modobj2(int m, boolean t1, boolean t2) {
 	phrase str_;
-	str30 strp;
+	Common::String strp;
 	int i, tay;
 
 	/* debug('modobj'); */
@@ -356,7 +356,7 @@ void modobj2(int m, boolean t1, boolean t2) {
 
 
 void repon(int f, int m) {
-	str255 str_;
+	Common::String str_;
 	varying_string<40> str1;
 	phrase st;
 	text1 fic;
@@ -581,7 +581,7 @@ void person() {
 	const char m2[] = "ˆtes";
 	const char m3[] = "SEUL";
 	int cf;
-	str255 str_;
+	Common::String str_;
 
 	/* debug('person'); */
 	for (cf = 1; cf <= 8; cf ++) menu_disable(disc[cf]);
@@ -1184,7 +1184,7 @@ void phaz(int &haz, int &p, int cf) {
 	person();
 }
 
-void writetp(str255 s, int t) {
+void writetp(Common::String s, int t) {
 	if (res == 2)  writeg(s, t);
 	else writeg(copy(s, 1, 25), t);
 }
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 48db49b..d4bb50b 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -167,7 +167,7 @@ void tkey1(boolean d) {
 
 void tmlieu(int mli) {
 	int cx, j, i, tail;
-	str30 nomp;
+	Common::String nomp;
 	phrase st;
 
 
@@ -312,7 +312,7 @@ void st1sama() {
 void modinv() {
 	int cx, cy, tay, i, r;
 	phrase nom;
-	str30 nomp;
+	Common::String nomp;
 
 	cy = 0;
 	for (cx = 1; cx <= 6; cx ++)
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index ec77287..7c50423 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -1,4 +1,4 @@
-str255 delig;
+Common::String delig;
 const array<0, 31, byte> tabdr
 = {{
 		32, 101, 115,  97, 114, 105, 110,
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 6f7a05e..b109340 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -16,7 +16,7 @@
 	phrase st;
 	char key;
 	mult_rect coor;
-	array<1, 14, str40> chaines;
+	array<1, 14, Common::String> chaines;
 	int compte;
 
 
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index bdb0a1b..d0b1e7c 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -6,7 +6,7 @@ void clear_box(int x, int y, int dx) {
 	box(0, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
 }
 
-void writeg(str255 l, int c)
+void writeg(Common::String l, int c)
 
 {
 	int i, x, xo, yo;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index d1e447d..fad09df 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -1,4 +1,4 @@
-void chardes(str11 nom, long_int passe, int long_) {
+void chardes(Common::String nom, long_int passe, int long_) {
 	int i, p, l;
 	byte b;
 	untyped_file f;
@@ -28,7 +28,7 @@ void chardes(str11 nom, long_int passe, int long_) {
 	/*$i+*/
 }
 
-void charani(str11 nom, long_int passe, int long_) {
+void charani(Common::String nom, long_int passe, int long_) {
 	int i, p, l;
 	byte b;
 	untyped_file f;
@@ -70,7 +70,7 @@ void taffich() {
 	int i, m, a, b, cx, handle,
 	        npal;
 	long_int lgt, lhandle;
-	str11 nom;
+	Common::String nom;
 	int palh, k, j;
 	array<0, 15, int> alllum;
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0fb4eb0..fa897f5 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -169,12 +169,7 @@ const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-typedef varying_string<11> path_chars;
 typedef float long_int;
-typedef varying_string<255> str255;
-typedef varying_string<125> str125;
-typedef varying_string<30> str30;
-typedef varying_string<11> str11;
 typedef file<byte> fichier_byte;
 struct sav_chaine {
 	int conf;
@@ -217,7 +212,6 @@ struct rectangle {
 };
 
 typedef array<1, max_rect, rectangle> mult_rect;
-typedef varying_string<40> str40;
 
 struct pattern {
 	byte tay, tax;
@@ -344,11 +338,11 @@ int x,
 array<0, 6400, int> t_cph;
 array<0, 4000, byte> tabdon;
 /*   t_dxx  : array[0..121] of int;*/
-str125 stpou;                               /* donne le % d'indices */
+Common::String stpou;                               /* donne le % d'indices */
 byte is;
 char mode;
 fichier_byte ficdes;
-str125 al_mess,
+Common::String al_mess,
        err_mess,
        ind_mess,
        al_mess2;


Commit: f752caa2f70e3feb7caac1f851da331af3510955
    https://github.com/scummvm/scummvm/commit/f752caa2f70e3feb7caac1f851da331af3510955
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:24-07:00

Commit Message:
MORTEVIELLE: Converted more arrays into C style arrays

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index bdb4827..712a114 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -2,9 +2,7 @@
 const char stouinon[] = "[2][ ][OUI][NON]";
 
 /* overlay */
-void taller()
-
-{
+void taller() {
 	int mx, cx, cy;
 
 	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
@@ -314,7 +312,7 @@ L2:
 }
 
 /* overlay */ void tfouiller() {
-	const array<0, 13, byte> r = {{123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107}};
+	const byte[14] r = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 	int cx;
 
 	if (caff > 99) {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 7c50423..4975185 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -1,45 +1,38 @@
 Common::String delig;
-const array<0, 31, byte> tabdr
-= {{
-		32, 101, 115,  97, 114, 105, 110,
-		117, 116, 111, 108,  13, 100,  99,
-		112, 109,  46, 118, 130,  39, 102,
-		98,  44, 113, 104, 103,  33,  76,
-		85, 106,  30,  31
-	}
+const byte tabdr[32] = {
+	32, 101, 115,  97, 114, 105, 110,
+	117, 116, 111, 108,  13, 100,  99,
+	112, 109,  46, 118, 130,  39, 102,
+	98,  44, 113, 104, 103,  33,  76,
+	85, 106,  30,  31
 };
 
 
-const array<0, 31, byte> tab30
-= {{
-		69,  67,  74, 138, 133, 120,  77, 122,
-		121,  68,  65,  63,  73,  80,  83,  82,
-		156,  45,  58,  79,  49,  86,  78,  84,
-		71,  81,  64,  66, 135,  34, 136,  91
-	}
+const byte tab30[32] = {
+	69,  67,  74, 138, 133, 120,  77, 122,
+	121,  68,  65,  63,  73,  80,  83,  82,
+	156,  45,  58,  79,  49,  86,  78,  84,
+	71,  81,  64,  66, 135,  34, 136,  91
 };
 
 
 
-const array<0, 31, byte> tab31
-= {{
-		93,  47,  48,  53,  50,  70, 124,  75,
-		72, 147, 140, 150, 151,  57,  56,  51,
-		107, 139,  55,  89, 131,  37,  54,  88,
-		119,   0,   0,   0,   0,   0,   0,   0
-	}
+const byte tab31[32]= {
+	93,  47,  48,  53,  50,  70, 124,  75,
+	72, 147, 140, 150, 151,  57,  56,  51,
+	107, 139,  55,  89, 131,  37,  54,  88,
+	119,   0,   0,   0,   0,   0,   0,   0
 };
 
 void deline(int num , phrase &l , int &tl);
 
 static void cinq_huit(char &c, int &ind, byte &pt, boolean &the_end) {
-	const array<0, 31, char> rap
-	= {{ ',', ':', '@', '!', '?', '-', '‡',
-			' ', '…', 'ƒ', '‚', 'Š', 'ˆ', '/',
-			'‹', 'Œ', '¢', '\47', '“', '"', '—',
-			'–', '0', '1', '2', '3', '4', '5',
-			'6', '7', '8', '9'
-		}
+	const unsigned char rap[32] = { 
+		',', ':', '@', '!', '?', '-', '\207',
+		'\240', '\205', '\203', '\202', '\212', '\210', '/',
+		'\213', '\214', '\242', '\047', '\223', '"', '\227',
+		'\226', '0', '1', '2', '3', '4', '5',
+		'6', '7', '8', '9'
 	};
 	int oct, ocd;
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 03940f5..082b53e 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -68,7 +68,7 @@ void veracf(byte b) {
 
 /* overlay */ void cctable(tablint &t) {
 	int k;
-	array<0, 256, float> tb;
+	float tb[257];
 
 
 	tb[0] = 0;
@@ -383,42 +383,3 @@ void veracf(byte b) {
 	break;
 	}     /* case c2.code  */
 }
-
-/*overlay function testprot : boolean;
-var
-   regs : registres;
- buffer : array[0..511] of char;
-  i,j,k : int;
-     st : phrase;
-    tay : int;
-   test : array[0..2] of boolean;
-const
- chaine : array[0..7] of char
-        = (' ','M','A','S','T','E','R',' ');
-
-begin
- test[0]:= false;test[1]:=false;test[2]:=false;k:=0;
- with regs do
- begin
-   while (test[k]=false) and (k<2) do
-   begin
-     k:=k+1;
-     ax:=0;intr(19,regs);
-     ax:=$0201;cx:=$0001;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-     intr(19,regs);
-     test[k]:=true;
-     tesok:= true;
-     i:=0;
-     while (test[k]) and (i<19) do
-      begin
-       ax:=$0201;cx:=$2700+i;dx:=$0100+k-1;es:=seg(buffer);bx:=ofs(buffer);
-       intr(19,regs);if lo(flags) mod 2=1 then test[k]:=false;i:=i+1;
-      end;
-      for j:=0 to 7 do
-       if buffer[j+504]<>chaine[j] then test[k]:=false;
-   end;
- end;
- testprot:=(test[1] or test[2]);
-end;
-*/
-
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index eec9798..1b894ff 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -19,8 +19,7 @@ void init_chariot() {
 
 
 void trait_ph() {
-	const array<0, 2, int> deca
-	= {{300, 30, 40}};
+	const int deca[3] = {300, 30, 40};
 
 	ptr_tcph = pred(int, num_ph);
 	ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
@@ -52,7 +51,7 @@ void trait_ph() {
 
 
 void parole(int rep, int ht, int typ) {
-	array<0, 500, int> savph;
+	int savph[501];
 	int i;
 	int tempo;
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 62dc99f..fd909a3 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -22,10 +22,10 @@
 /* overlay */ void antegame() {
 	int cx;
 	registres regs;
-	array<0, 511, char> buffer;
+	char buffer[512];
 	int i, j, k;
-	array<0, 2, boolean> test;
-	array<0, 7, char> g;
+	boolean test[3];
+	char g[8];
 
 
 	hide_mouse();
@@ -36,7 +36,7 @@
 	okdes = true;
 	test[0] = false;
 	test[1] = false;
-	g[0] = '\40';
+	g[0] = '\040';
 	col = false;
 	tesok = true;
 	test[2] = false;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index fad09df..058af87 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -72,7 +72,7 @@ void taffich() {
 	long_int lgt, lhandle;
 	Common::String nom;
 	int palh, k, j;
-	array<0, 15, int> alllum;
+	int alllum[16];
 
 
 	a = caff;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index fa897f5..e245781 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -151,8 +151,7 @@ const array<1, 2, varying_string<11> > fic
 	}
 };
 
-const array<0, 1, byte> addv
-= {{8, 8}};
+const byte addv[2] = {8, 8};
 
 const char recom[] = " Recommence  ";
 
@@ -221,19 +220,14 @@ struct pattern {
 
 struct nhom {
 	byte n;     /* numero entre 0 et 32 */
-	array<0, 3, byte> hom;
+	byte hom[4];
 };
 
-typedef array<0, 15, nhom> t_nhom;
-
 struct t_pcga {
 	byte p;
-	t_nhom a;
+	nhom a[16];
 };
 
-typedef array<0, 90, t_pcga> pal_cga;
-
-
 /*---------------------------------------------------------------------------*/
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -335,8 +329,8 @@ int x,
         ptr_word,
         color_txt;
 
-array<0, 6400, int> t_cph;
-array<0, 4000, byte> tabdon;
+int t_cph[6401];
+byte tabdon[4001];
 /*   t_dxx  : array[0..121] of int;*/
 Common::String stpou;                               /* donne le % d'indices */
 byte is;
@@ -351,7 +345,7 @@ array<1, 8, int> invt,
       nbrep,
       nbrepm,
       disc;
-array<0, 4, int> msg;
+int msg[5];
 array<1, 7, int> depl;
 array<1, 8, varying_string<22> > inv;
 array<1, 7, varying_string<23> > dep;
@@ -360,11 +354,11 @@ array<1, 5, varying_string<11> > self_;
 array<1, 8, varying_string<5> > dis;
 array<1, 7, char> touv;
 sav_chaine s, s1;
-array<0, 390, byte> bufcha;
+byte bufcha[391];
 
 matrix<1, 6, 0, 23, byte> lettres;
 
-array<0, 15, byte> palher;
+byte palher[16];
 
 int t_mot[maxti + 1];
 int tay_tchar;
@@ -376,10 +370,10 @@ int l[108];
 int tbi[256];
 chariot c1, c2, c3;
 float addfix;
-pal_cga palsav;
+t_pcga palsav[91];
 array<0, 90, tabdb> tabpal;
-pal_cga palcga;
-array<0, 14, pattern> tpt;
+t_pcga palcga[91];
+pattern tpt[15];
 
 
 


Commit: e4adfbbb8b59afce4b9b7e4707dad4c77a91be06
    https://github.com/scummvm/scummvm/commit/e4adfbbb8b59afce4b9b7e4707dad4c77a91be06
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:25-07:00

Commit Message:
MORTEVIELLE: Add namespace and standard header

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 712a114..e03a7a1 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 /* NIVEAU 4 */
 const char stouinon[] = "[2][ ][OUI][NON]";
 
@@ -1189,3 +1218,5 @@ L2:
 	quel = do_alert(stouinon, 1);
 	arret = (quel != 1);
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index f1c69ef..8372c2f 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 /* overlay */ int do_alert(Common::String str_, int n);
 
 
@@ -195,3 +224,5 @@ int do_alert(Common::String str_, int n) {
 	do_alert_result = quoi;
 	return do_alert_result;
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index d1ebe4d..20deae4 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void boite(int x, int y, int dx, int dy, int coul) {
 	int i;
 	int xi, yi, xo, yo;
@@ -27,3 +56,5 @@ void boite(int x, int y, int dx, int dy, int coul) {
 	}
 	show_mouse();
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 0e458a5..e81e905 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -1,3 +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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
 
 void dem1() {
 	untyped_file f;
@@ -69,6 +97,4 @@ void sv_game(int n) {
 	show_mouse();
 }
 
-
-
-
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 20899ce..fcdfaed 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void droite(int x, int y, int xx, int yy, int coul) {
 	int step, i;
 	float a, b;
@@ -32,3 +61,5 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
 	}
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 199d438..f1d514b 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 char readkey1() {
 	char c;
 
@@ -58,3 +87,4 @@ void teskbd() {
 	if (keypressed())  dum = testou();
 }
 
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 35de7f4..ce41c37 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -1,3 +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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
 
 /* NIVEAU 15 */
 void copcha() {
@@ -173,3 +201,5 @@ begin
      Tan : afftan(offs,dep,x,y);
   end;
 end;*/
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index cd72d7b..655e635 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 /* NIVEAU 14*/
 
 /* overlay */ void menut(int no, Common::String nom) {
@@ -332,3 +361,4 @@ void mdn() {
 		}
 }
 
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index f32ca96..4129b24 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 /* Niveau 14 suite */
 const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
 
@@ -1307,5 +1336,4 @@ void dessin(int ad) {
 	}
 }
 
-
-
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index d4bb50b..cff21a5 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 const array<1, 11, int> men
 = {{
 		scacher, attacher, defoncer, dormir,
@@ -726,3 +755,5 @@ void aldepl() {
 
 	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index c9e1d25..5ed621f 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -1,6 +1,33 @@
-#include "ptoc.h"
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
 
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "ptoc.h"
 
+namespace MORTEVIELLE {
 
 /*$v-*/
 /*$k-*/
@@ -121,3 +148,4 @@ int main(int argc, const char *argv[]) {
 	return EXIT_SUCCESS;
 }
 
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 9ce1788..a2102b6 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 const int m_arrow = 0;
 const int m_point_hand = 1;
 
@@ -457,3 +486,5 @@ void mov_mouse(boolean &funct, char &key) {
 		p_key = keypressed();
 	}
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 4975185..b2ef115 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 Common::String delig;
 const byte tabdr[32] = {
 	32, 101, 115,  97, 114, 105, 110,
@@ -197,3 +226,5 @@ void afftex(phrase ch, int x, int y, int dx, int dy, int typ) {
 		}     /* case */
 	}
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 8545fae..f8c7baf 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void dem2() {
 	untyped_file f;
 	int k;
@@ -335,3 +364,5 @@ void ani50() {
 		writeg(cpr, 0);
 	}
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 082b53e..63ede52 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -1,3 +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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
 
 void spfrac(int wor) {
 	c3.rep = (cardinal)wor >> 12;
@@ -383,3 +411,5 @@ void veracf(byte b) {
 	break;
 	}     /* case c2.code  */
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 1b894ff..c7516d1 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void rot_chariot() {
 	c1 = c2;
 	c2 = c3;
@@ -90,5 +119,4 @@ void parole(int rep, int ht, int typ) {
 	writepal(numpal);
 }
 
-
-
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index fd909a3..b08be5c 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 /* overlay */ void change_gd(int ngd) {
 	int i;
 
@@ -317,3 +346,4 @@ void tjouer() {
 	else if (perdu)  tencore();
 }
 
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index b109340..40a6e87 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -1,3 +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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
 
 /* overlay */ boolean ques() {
 	const array<1, 10, int> ta
@@ -111,3 +139,5 @@
 	ques_result = (compte == 10) && q;
 	return ques_result;
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index d0b1e7c..2723d91 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void fill_box(int x, int y, int dx) {
 	box(15, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
 }
@@ -52,3 +81,5 @@ void writeg(Common::String l, int c)
 	}
 	show_mouse();
 }
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 058af87..8e4562e 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -1,3 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
+
 void chardes(Common::String nom, long_int passe, int long_) {
 	int i, p, l;
 	byte b;
@@ -194,3 +223,5 @@ void taffich() {
            Alllum[k]:=-1;
          end;
     end;*/
+
+} // End of namespace MORTEVIELLE
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index e245781..027dfb2 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -1,3 +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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+namespace MORTEVIELLE {
 
 /*         Constantes, Types et Variables pour le
 
@@ -454,3 +482,5 @@ void affcar(int gd, int x, int y, int coul, int char) {
 void putpix(int gd, int x, int y, int coul) {
 	affput(0, gd, x, y, coul, 0);
 }
+
+} // End of namespace MORTEVIELLE


Commit: 48fa2eba64b7c3bf7c7674d19f4477979c79b462
    https://github.com/scummvm/scummvm/commit/48fa2eba64b7c3bf7c7674d19f4477979c79b462
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:26-07:00

Commit Message:
MORTEVIELLE: Add an an include for string, move boolean to bool

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 8372c2f..43ea6c0 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 /* overlay */ int do_alert(Common::String str_, int n);
@@ -41,7 +43,7 @@ const matrix<1, 2, 1, 3, int> coord
 
 static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
 	int i, k;
-	boolean v;
+	bool v;
 
 	val(s[2], nbc, i);
 	c = "";
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 655e635..54d8804 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 /* NIVEAU 14*/
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4129b24..ba99ffc 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 /* Niveau 14 suite */
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index cff21a5..bc14b61 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -45,7 +45,7 @@ void tinke() {
 	const char d6[] = "OK";
 	int cx, cy, haz, nh, cf, j, h, m, cd;
 	varying_string<3> stpo;
-	boolean am;
+	bool am;
 
 	anyone = false;
 	calch(j, h, m);
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index b2ef115..ec7fabd 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -114,7 +114,7 @@ void deline(int num , phrase &l , int &tl) {
 	int i, j, ts;
 	char let;
 	byte ps, k;
-	boolean the_end;
+	bool the_end;
 
 	/* DETEX */
 	/*debug('  => DeLine');*/
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index b08be5c..baf5883 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -53,7 +53,7 @@ namespace MORTEVIELLE {
 	registres regs;
 	char buffer[512];
 	int i, j, k;
-	boolean test[3];
+	bool test[3];
 	char g[8];
 
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 40a6e87..86567f5 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 /* overlay */ boolean ques() {
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 2723d91..03e6040 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 void fill_box(int x, int y, int dx) {
@@ -40,7 +42,7 @@ void writeg(Common::String l, int c)
 {
 	int i, x, xo, yo;
 	int cecr;
-	boolean t;
+	bool t;
 
 	/*  debug('writeg : '+l);*/
 
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 8e4562e..d6fcdfd 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 void chardes(Common::String nom, long_int passe, int long_) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 027dfb2..b4c17e6 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+
 namespace MORTEVIELLE {
 
 /*         Constantes, Types et Variables pour le


Commit: 3dfbb24e9bee2acd0b8083bd94f6ef5cac9042b8
    https://github.com/scummvm/scummvm/commit/3dfbb24e9bee2acd0b8083bd94f6ef5cac9042b8
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:28-07:00

Commit Message:
MORTEVIELLE: rename namespace

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index e03a7a1..6ad0cc0 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* NIVEAU 4 */
 const char stouinon[] = "[2][ ][OUI][NON]";
@@ -1219,4 +1219,4 @@ L2:
 	arret = (quel != 1);
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 43ea6c0..345867f 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* overlay */ int do_alert(Common::String str_, int n);
 
@@ -227,4 +227,4 @@ int do_alert(Common::String str_, int n) {
 	return do_alert_result;
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index 20deae4..cc3230d 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void boite(int x, int y, int dx, int dy, int coul) {
 	int i;
@@ -57,4 +57,4 @@ void boite(int x, int y, int dx, int dy, int coul) {
 	show_mouse();
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index e81e905..a88f63a 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void dem1() {
 	untyped_file f;
@@ -97,4 +97,4 @@ void sv_game(int n) {
 	show_mouse();
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index fcdfaed..312ed69 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void droite(int x, int y, int xx, int yy, int coul) {
 	int step, i;
@@ -62,4 +62,4 @@ void droite(int x, int y, int xx, int yy, int coul) {
 	}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index f1d514b..20fb38c 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 char readkey1() {
 	char c;
@@ -87,4 +87,4 @@ void teskbd() {
 	if (keypressed())  dum = testou();
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index ce41c37..2da371b 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* NIVEAU 15 */
 void copcha() {
@@ -202,4 +202,4 @@ begin
   end;
 end;*/
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 54d8804..97b0cfc 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* NIVEAU 14*/
 
@@ -363,4 +363,4 @@ void mdn() {
 		}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ba99ffc..a0aad53 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* Niveau 14 suite */
 const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
@@ -1338,4 +1338,4 @@ void dessin(int ad) {
 	}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index bc14b61..94fcfde 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 const array<1, 11, int> men
 = {{
@@ -756,4 +756,4 @@ void aldepl() {
 	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 5ed621f..928804b 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -27,7 +27,7 @@
 
 #include "ptoc.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /*$v-*/
 /*$k-*/
@@ -148,4 +148,4 @@ int main(int argc, const char *argv[]) {
 	return EXIT_SUCCESS;
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index a2102b6..6f4eaa2 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 const int m_arrow = 0;
 const int m_point_hand = 1;
@@ -487,4 +487,4 @@ void mov_mouse(boolean &funct, char &key) {
 	}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index ec7fabd..0474219 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 Common::String delig;
 const byte tabdr[32] = {
@@ -227,4 +227,4 @@ void afftex(phrase ch, int x, int y, int dx, int dy, int typ) {
 	}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index f8c7baf..608b429 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void dem2() {
 	untyped_file f;
@@ -365,4 +365,4 @@ void ani50() {
 	}
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 63ede52..bfa36b0 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void spfrac(int wor) {
 	c3.rep = (cardinal)wor >> 12;
@@ -412,4 +412,4 @@ void veracf(byte b) {
 	}     /* case c2.code  */
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index c7516d1..90e9495 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void rot_chariot() {
 	c1 = c2;
@@ -119,4 +119,4 @@ void parole(int rep, int ht, int typ) {
 	writepal(numpal);
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index baf5883..4344869 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -25,7 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* overlay */ void change_gd(int ngd) {
 	int i;
@@ -346,4 +346,4 @@ void tjouer() {
 	else if (perdu)  tencore();
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 86567f5..583221c 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /* overlay */ boolean ques() {
 	const array<1, 10, int> ta
@@ -142,4 +142,4 @@ namespace MORTEVIELLE {
 	return ques_result;
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 03e6040..a72ef12 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void fill_box(int x, int y, int dx) {
 	box(15, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
@@ -84,4 +84,4 @@ void writeg(Common::String l, int c)
 	show_mouse();
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index d6fcdfd..eab78c8 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 void chardes(Common::String nom, long_int passe, int long_) {
 	int i, p, l;
@@ -226,4 +226,4 @@ void taffich() {
          end;
     end;*/
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index b4c17e6..25a8c59 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -27,7 +27,7 @@
 
 #include "common/str.h"
 
-namespace MORTEVIELLE {
+namespace Mortevielle {
 
 /*         Constantes, Types et Variables pour le
 
@@ -485,4 +485,4 @@ void putpix(int gd, int x, int y, int coul) {
 	affput(0, gd, x, y, coul, 0);
 }
 
-} // End of namespace MORTEVIELLE
+} // End of namespace Mortevielle


Commit: fc695e518e0cf379f5540440dd88752a223d9cf0
    https://github.com/scummvm/scummvm/commit/fc695e518e0cf379f5540440dd88752a223d9cf0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:29-07:00

Commit Message:
MORTEVIELLE: Add header files

Changed paths:
  A engines/mortevielle/actions.h
  A engines/mortevielle/alert.h
  A engines/mortevielle/boite.h
  A engines/mortevielle/disk.h
  A engines/mortevielle/droite.h
  A engines/mortevielle/keyboard.h
  A engines/mortevielle/level15.h
  A engines/mortevielle/menu.h
  A engines/mortevielle/mor.h
  A engines/mortevielle/mor2.h
  A engines/mortevielle/mort.h
  A engines/mortevielle/mouse.h
  A engines/mortevielle/outtext.h
  A engines/mortevielle/ovd1.h
  A engines/mortevielle/parole.h
  A engines/mortevielle/parole2.h
  A engines/mortevielle/prog.h
  A engines/mortevielle/ques.h
  A engines/mortevielle/sprint.h
  A engines/mortevielle/taffich.h
  A engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
new file mode 100644
index 0000000..690de1d
--- /dev/null
+++ b/engines/mortevielle/actions.h
@@ -0,0 +1,68 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_ACTIONS_H
+#define MORTEVIELLE_ACTIONS_H
+
+namespace Mortevielle {
+
+/* NIVEAU 4 */
+void taller();
+void tprendre();
+void tsprendre();
+void tsoulever();
+void tlire();
+void tslire();
+void tregarder();
+void tsregarder();
+void tfouiller();
+void tsfouiller();
+void touvrir();
+void tmettre();
+void ttourner();
+void tcacher();
+void tattacher();
+void tfermer();
+void tfrapper();
+void tposer();
+void tecouter();
+void tmanger();
+void tentrer();
+void tdormir();
+void tdefoncer();
+void tsortir();
+void tattendre();
+void tsonder();
+void tparler();
+void tsentir();
+void tgratter();
+/* NIVEAU 2 */
+void tmaj1();
+void tencore();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
new file mode 100644
index 0000000..2335131
--- /dev/null
+++ b/engines/mortevielle/alert.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_ALERT_H
+#define MORTEVIELLE_ALERT_H
+
+namespace Mortevielle {
+
+int do_alert(Common::String str_, int n);
+void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
+static void posit(int ji, int &coldep, int &esp);
+static void fait_boite(int lidep, int nli, int tx);
+static void fait_choix(Common::String c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp);
+int do_alert(Common::String str_, int n);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
new file mode 100644
index 0000000..d0e7b0e
--- /dev/null
+++ b/engines/mortevielle/boite.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_BOITE_H
+#define MORTEVIELLE_BOITE_H
+
+namespace Mortevielle {
+
+void boite(int x, int y, int dx, int dy, int coul);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
new file mode 100644
index 0000000..464c3b7
--- /dev/null
+++ b/engines/mortevielle/disk.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_DISK_H
+#define MORTEVIELLE_DISK_H
+
+namespace Mortevielle {
+
+void dem1();
+void takesav(int n);
+void ld_game(int n);
+void sv_game(int n);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
new file mode 100644
index 0000000..73ed30d
--- /dev/null
+++ b/engines/mortevielle/droite.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_DROITE_H
+#define MORTEVIELLE_DROITE_H
+
+namespace Mortevielle {
+
+void droite(int x, int y, int xx, int yy, int coul);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
new file mode 100644
index 0000000..fbef23f
--- /dev/null
+++ b/engines/mortevielle/keyboard.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_KEYBOARD_H
+#define MORTEVIELLE_KEYBOARD_H
+
+namespace Mortevielle {
+
+char readkey1();
+int testou();
+void teskbd();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
new file mode 100644
index 0000000..73a9d3f
--- /dev/null
+++ b/engines/mortevielle/level15.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_LEVEL15_H
+#define MORTEVIELLE_LEVEL15_H
+
+namespace Mortevielle {
+
+/* NIVEAU 15 */
+void copcha();
+bool dans_rect(rectangle r);
+void outbloc(int n, pattern p, t_nhom pal);
+void writepal(int n);
+void pictout(int seg, int dep, int x, int y);
+void putxy(int x, int y);
+// int calad(int x, int y);
+void sauvecr(int y, int dy);
+void charecr(int y, int dy);
+// int peek(int ad);
+// int peekw(int ad);
+// real peekl(int ad);
+// void procedure poke(int ad, int n);
+void adzon();
+int animof(int ouf, int num);
+// void affgd(int offs, int dep, int x, int y);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
new file mode 100644
index 0000000..451e9671
--- /dev/null
+++ b/engines/mortevielle/menu.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_MENU_H
+#define MORTEVIELLE_MENU_H
+
+namespace Mortevielle {
+
+/* NIVEAU 14*/
+void menut(int no, Common::String nom);
+void menu_disable(int no);
+void menu_enable(int no);
+void menu_aff();
+void draw_menu();
+void invers(int ix);
+void util(int x, int y);
+void menu_down(int ii);
+void menu_up(int xx);
+void erase_menu();
+void mdn();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
new file mode 100644
index 0000000..1211d21
--- /dev/null
+++ b/engines/mortevielle/mor.h
@@ -0,0 +1,125 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_MOR_H
+#define MORTEVIELLE_MOR_H
+
+namespace Mortevielle {
+
+/* Niveau 14 suite */
+void testfi();
+int readclock();
+void modif(int &nu);
+void dessine(int ad, int x, int y);
+void dessine_rouleau();
+void text_color(int c);
+/* NIVEAU 13 */
+void text1(int x, int y, int nb, int m);
+void initouv();
+void ecrf1();
+void clsf1();
+void clsf2();
+void ecrf2();
+void ecr2(Common::String str_);
+void clsf3();
+void ecr3(Common::String text);
+void ecrf6();
+void ecrf7();
+void clsf10();
+void stop();
+void paint_rect(int x, int y, int dx, int dy);
+int hazard(int min, int max);
+void calch(int &j, int &h, int &m);
+void conv(int x, int &y);
+/* NIVEAU 12 */
+void okpas();
+void modobj(int m);
+void modobj2(int m, boolean t1, boolean t2);
+void repon(int f, int m);
+void f3f8();
+void t5(int cx);
+void affper(int per);
+void choix(int min, int max, int &per);
+void cpl1(int &p);
+void cpl2(int &p);
+void cpl3(int &p);
+void cpl5(int &p);
+void cpl6(int &p);
+void person();
+void chlm(int &per);
+void pendule();
+/*************
+ * NIVEAU 11 *
+ *************/
+void debloc(int l);
+void cpl10(int &p, int &h);
+void cpl11(int &p, int &h);
+void cpl12(int &p);
+void cpl13(int &p);
+void cpl15(int &p);
+void cpl20(int &p, int &h);
+void quelq1(int l);
+void quelq2();
+void quelq5();
+void quelq6(int l);
+void quelq10(int h, int &per);
+void quelq11(int h, int &per);
+void quelq12(int &per);
+void quelq15(int &per);
+void quelq20(int h, int &per);
+void frap();
+void nouvp(int l, int &p);
+void tip(int ip, int &cx);
+void ecfren(int &p, int &haz, int cf, int l);
+void becfren(int l);
+/* NIVEAU 10 */
+void init_nbrepm();
+void phaz(int &haz, int &p, int cf);
+void inzon();
+void dprog();
+void pl1(int cf);
+void pl2(int cf);
+void pl5(int cf);
+void pl6(int cf);
+void pl9(int cf);
+void pl10(int cf);
+void pl11(int cf);
+void pl12(int cf);
+void pl13(int cf);
+void pl15(int cf);
+void pl20(int cf);
+void t11(int l11, int &a);
+void cavegre();
+void writetp(Common::String s, int t);
+void messint(int nu);
+void aniof(int ouf, int num);
+void musique(int so);
+/* NIVEAU 9 */
+void dessin(int ad);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
new file mode 100644
index 0000000..bad4332
--- /dev/null
+++ b/engines/mortevielle/mor2.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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_MOR2_H
+#define MORTEVIELLE_MOR2_H
+
+namespace Mortevielle {
+
+void tinke();
+void fenat(char ans);
+/* NIVEAU 8 */
+void afdes(int ad);
+void tkey1(bool d);
+void tmlieu(int mli);
+/* NIVEAU 7 */
+void tlu(int af, int ob);
+void delin(int n);
+void affrep();
+void mfouen()
+void atf3f8(int &key);
+/* NIVEAU 6 */
+void tperd();
+void tsort();
+void st4(int ob);
+void cherjer(int ob, boolean &d);
+void st1sama();
+void modinv();
+void sparl(long_int adr, long_int rep);
+void finfouil();
+void mfoudi();
+void mennor();
+void premtet();
+/* NIVEAU 5 */
+void ajchai();
+void ajjer(int ob);
+void t1sama();
+void t1vier();
+void t1neig();
+void t1deva();
+void t1derr();
+void t1deau();
+void tctrm();
+void quelquun();
+void tsuiv();
+void tfleche();
+void tcoord(int sx);
+void st7(int ob);
+void treg(int ob);
+void avpoing(int &ob);
+void rechai(int &ch);
+void t23coul(int &l);
+void maivid();
+void st13(int ob);
+void aldepl();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
new file mode 100644
index 0000000..0b78deb
--- /dev/null
+++ b/engines/mortevielle/mort.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_MORT_H
+#define MORTEVIELLE_MORT_H
+
+namespace Mortevielle {
+
+void divers(int np, bool b);
+/* NIVEAU 0 */
+int main(int argc, const char *argv[]);
+} // End of namespace Mortevielle
+
+#endif
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
new file mode 100644
index 0000000..62fdf1b
--- /dev/null
+++ b/engines/mortevielle/mouse.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_MOUSE_H
+#define MORTEVIELLE_MOUSE_H
+
+namespace Mortevielle {
+
+void init_mouse();
+//void change_mouse(int t);
+//void dessine_souris(int xf, int yf);
+void hide_mouse();
+void show_mouse();
+void pos_mouse(int x, int y);
+void read_pos_mouse(int &x, int &y, int &c);
+void mov_mouse(boolean &funct, char &key);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
new file mode 100644
index 0000000..fcf4822
--- /dev/null
+++ b/engines/mortevielle/outtext.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_OUTTEXT_H
+#define MORTEVIELLE_OUTTEXT_H
+
+namespace Mortevielle {
+
+static void cinq_huit(char &c, int &ind, byte &pt, boolean &the_end);
+void deline(int num , phrase &l , int &tl);
+static int l_motsuiv(int p, phrase &ch, int &tab);
+void afftex(phrase ch, int x, int y, int dx, int dy, int typ);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
new file mode 100644
index 0000000..339ee69
--- /dev/null
+++ b/engines/mortevielle/ovd1.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_OVD1_H
+#define MORTEVIELLE_OVD1_H
+
+namespace Mortevielle {
+
+void dem2();
+void ani50();
+//void apzuul();
+void aff50(boolean c);
+void init_menu();
+void charpal();
+void chartex();
+void dialpre();
+void init_lieu();
+void music();
+void charge_bruit5();
+void charge_cfiec();
+void charge_cfiph();
+void suite();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
new file mode 100644
index 0000000..b0282e1
--- /dev/null
+++ b/engines/mortevielle/parole.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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_PAROLE_H
+#define MORTEVIELLE_PAROLE_H
+
+namespace Mortevielle {
+
+void spfrac(int wor);
+void charg_car();
+void entroct(byte o);
+void veracf(byte b);
+void cctable(tablint &t);
+void regenbruit();
+void charge_son();
+void charge_phbruit();
+void charge_bruit();
+void trait_car();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/parole2.h b/engines/mortevielle/parole2.h
new file mode 100644
index 0000000..ed7108f
--- /dev/null
+++ b/engines/mortevielle/parole2.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_PAROLE2_H
+#define MORTEVIELLE_PAROLE2_H
+
+namespace Mortevielle {
+
+void rot_chariot();
+void init_chariot();
+void trait_ph();
+void parole(int rep, int ht, int typ);
+
+} // End of namespace Mortevielle
+
+#endif
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
new file mode 100644
index 0000000..4fccca4
--- /dev/null
+++ b/engines/mortevielle/prog.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_PROG_H
+#define MORTEVIELLE_PROG_H
+
+namespace Mortevielle {
+
+void change_gd(int ngd);
+void antegame();
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+void tmaj3();
+void tsitu();
+void tecran();
+
+/* NIVEAU 1 */
+void theure();
+void tjouer();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/ques.h b/engines/mortevielle/ques.h
new file mode 100644
index 0000000..f748d3e
--- /dev/null
+++ b/engines/mortevielle/ques.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_QUES_H
+#define MORTEVIELLE_QUES_H
+
+#include "common/str.h"
+
+namespace Mortevielle {
+
+bool ques();
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
new file mode 100644
index 0000000..42259f0
--- /dev/null
+++ b/engines/mortevielle/sprint.h
@@ -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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_SPRINT_H
+#define MORTEVIELLE_SPRINT_H
+
+#include "common/str.h"
+
+namespace Mortevielle {
+
+void fill_box(int x, int y, int dx);
+void clear_box(int x, int y, int dx);
+void writeg(Common::String l, int c);
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
new file mode 100644
index 0000000..ccc64bf
--- /dev/null
+++ b/engines/mortevielle/taffich.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_TAFFICH_H
+#define MORTEVIELLE_TAFFICH_H
+
+#include "common/str.h"
+
+namespace Mortevielle {
+
+void chardes(Common::String nom, long_int passe, int long_);
+void charani(Common::String nom, long_int passe, int long_);
+void taffich();
+} // End of namespace Mortevielle
+
+#endif
\ No newline at end of file
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
new file mode 100644
index 0000000..86bb296
--- /dev/null
+++ b/engines/mortevielle/var_mor.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_VAR_H
+#define MORTEVIELLE_VAR_H
+
+namespace Mortevielle {
+
+/*---------------------------------------------------------------------------*/
+/*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
+/*---------------------------------------------------------------------------*/
+
+void hirs();
+void affcar(int gd, int x, int y, int coul, int char);
+void putpix(int gd, int x, int y, int coul);
+
+} // End of namespace Mortevielle
+
+#endif


Commit: 7d03d1fe4ec88c2cfdf78481364f57c6b5acc660
    https://github.com/scummvm/scummvm/commit/7d03d1fe4ec88c2cfdf78481364f57c6b5acc660
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:30-07:00

Commit Message:
MORTEVIELLE: Start including header files

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6ad0cc0..54f3972 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/actions.h"
+
 namespace Mortevielle {
 
 /* NIVEAU 4 */
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 345867f..6142713 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/alert.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index cc3230d..cfda996 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/boite.h"
+
 namespace Mortevielle {
 
 void boite(int x, int y, int dx, int dy, int coul) {
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index a88f63a..a18bdd8 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/disk.h"
+
 namespace Mortevielle {
 
 void dem1() {
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 312ed69..3f582e8 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/droite.h"
+
 namespace Mortevielle {
 
 void droite(int x, int y, int xx, int yy, int coul) {
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 20fb38c..cce1bde 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/keyboard.h"
+
 namespace Mortevielle {
 
 char readkey1() {
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 2da371b..c7a8344 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/level15.h"
+
 namespace Mortevielle {
 
 /* NIVEAU 15 */
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 97b0cfc..f91eda1 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/menu.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a0aad53..bf417db 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mor.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 94fcfde..6963776 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mor2.h"
+
 namespace Mortevielle {
 
 const array<1, 11, int> men
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 928804b..28562c7 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mort.h"
 #include "ptoc.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 6f4eaa2..e894e08 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mouse.h"
+
 namespace Mortevielle {
 
 const int m_arrow = 0;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 0474219..072fe5c 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/outtext.h"
+
 namespace Mortevielle {
 
 Common::String delig;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 608b429..d18af48 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/ovd1.h"
+
 namespace Mortevielle {
 
 void dem2() {
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index bfa36b0..3f92d78 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/parole.h"
+
 namespace Mortevielle {
 
 void spfrac(int wor) {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 90e9495..8685feb 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/parole2.h"
+
 namespace Mortevielle {
 
 void rot_chariot() {
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 4344869..9ff2b66 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -25,6 +25,8 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/prog.h"
+
 namespace Mortevielle {
 
 /* overlay */ void change_gd(int ngd) {
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 583221c..4080453 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/ques.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index a72ef12..92ff49f 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/sprint.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index eab78c8..df55807 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/taffich.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 25a8c59..c2ce4b3 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/var_mor.h"
 #include "common/str.h"
 
 namespace Mortevielle {


Commit: 25f08ad0bd010a8b3aa76402e1bd9f0748d208c9
    https://github.com/scummvm/scummvm/commit/25f08ad0bd010a8b3aa76402e1bd9f0748d208c9
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:31-07:00

Commit Message:
MORTEVIELLE: fix several old includes

Changed paths:
    engines/mortevielle/mort.cpp



diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 28562c7..2d4f127 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -25,40 +25,34 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "mortevielle/mort.h"
 #include "ptoc.h"
 
-namespace Mortevielle {
-
-/*$v-*/
-/*$k-*/
-/*$x-*/
-/*$c-*/
-
-#include "var_mor.h"          /* les variables */
-#include "keyboard.h"          /* la gestion du clavier */
-#include "mouse.h"          /* la souris  */
-#include "level15.h"          /* les fonctions de base */
-#include "droite.h"          /* pour faire une droite */
-#include "boite.h"
-#include "sprint.h"          /* l'affichage des textes */
-#include "outtext.h"          /* fonctions sup‚rieures d'affichage */
-#include "parole.h"          /* les fonctions de la parole */
-#include "alert.h"
-#include "parole2.h"          /* les fonctions de la parole */
+#include "mortevielle/mort.h"
+#include "mortevielle/var_mor.h"          /* les variables */
+#include "mortevielle/keyboard.h"          /* la gestion du clavier */
+#include "mortevielle/mouse.h"          /* la souris  */
+#include "mortevielle/level15.h"          /* les fonctions de base */
+#include "mortevielle/droite.h"          /* pour faire une droite */
+#include "mortevielle/boite.h"
+#include "mortevielle/sprint.h"          /* l'affichage des textes */
+#include "mortevielle/outtext.h"          /* fonctions sup‚rieures d'affichage */
+#include "mortevielle/parole.h"          /* les fonctions de la parole */
+#include "mortevielle/alert.h"
+#include "mortevielle/parole2.h"          /* les fonctions de la parole */
 /*  debug              le debugging */
-#include "ques.h"          /* les questions */
-#include "menu.h"          /* les fonctions du menu */
-#include "mor.h"          /* divers */
-#include "taffich.h"          /* chargement des dessins */
-#include "ovd1.h"          /* les fonctions sur disque 1 */
-#include "mor2.h"          /* divers */
-#include "actions.h"          /* les actions */
-#include "prog.h"          /* fonctions toplevel */
-#include "disk.h"          /* chargements et sauvegardes */
-
+#include "mortevielle/ques.h"          /* les questions */
+#include "mortevielle/menu.h"          /* les fonctions du menu */
+#include "mortevielle/mor.h"          /* divers */
+#include "mortevielle/taffich.h"          /* chargement des dessins */
+#include "mortevielle/ovd1.h"          /* les fonctions sur disque 1 */
+#include "mortevielle/mor2.h"          /* divers */
+#include "mortevielle/actions.h"          /* les actions */
+#include "mortevielle/prog.h"          /* fonctions toplevel */
+#include "mortevielle/disk.h"          /* chargements et sauvegardes */
 /*  ecrihexa            utilitaire */
 
+namespace Mortevielle {
+
 void divers(int np, boolean b) {
 	teskbd();
 	do {


Commit: 004935b0166cdaeba468c11e8a37969393fe9007
    https://github.com/scummvm/scummvm/commit/004935b0166cdaeba468c11e8a37969393fe9007
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:34-07:00

Commit Message:
MORTEVIELLE: use bool instead of boolean

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 54f3972..27598fe 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -469,7 +469,7 @@ L2:
 
 /* overlay */ void tmettre() {
 	int quel;
-	boolean entre;
+	bool entre;
 	phrase st;
 	Common::String str_;
 	int i, tay;
@@ -979,13 +979,13 @@ L2:
 /* overlay */ void tparler()
 
 {
-	array<1, 46, boolean> te;
+	array<1, 46, bool> te;
 	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
 	char tou;
 	array<1, 46, varying_string<40> > lib;
 	phrase st;
-	boolean f;
+	bool f;
 
 
 
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 6142713..1d5901b 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -128,7 +128,7 @@ int do_alert(Common::String str_, int n) {
 	char c, dumi;
 	array<1, 2, varying_string<3> > s;
 	int cx, cy, cd, nbcol, nblig;
-	boolean touch, newaff, test, test1, test2, test3, dum;
+	bool touch, newaff, test, test1, test2, test3, dum;
 	Common::String cas;
 
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index c7a8344..6f5f001 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -40,10 +40,10 @@ void copcha() {
 	} while (!(i == acha + 390));
 }
 
-boolean dans_rect(rectangle r) {
+bool dans_rect(rectangle r) {
 	int x, y, c;
 
-	boolean dans_rect_result;
+	bool dans_rect_result;
 	read_pos_mouse(x, y, c);
 	if ((x > r.x1) &&
 	        (x < r.x2) &&
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index f91eda1..8278327 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -311,7 +311,7 @@ void erase_menu() {
 
 void mdn() {
 	int x, y, c, a, ix;
-	boolean tes;
+	bool tes;
 
 	/* debug('mdn'); */
 	if (! active_menu)  return;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index bf417db..5b80588 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -369,7 +369,7 @@ void modobj(int m) {
 	menu_disable(invt[8]);
 }
 
-void modobj2(int m, boolean t1, boolean t2) {
+void modobj2(int m, bool t1, bool t2) {
 	phrase str_;
 	Common::String strp;
 	int i, tay;
@@ -526,7 +526,7 @@ void affper(int per) {
 }
 
 /* overlay */ void choix(int min, int max, int &per) {
-	boolean i;
+	bool i;
 	int haz, cx, cy, cz;
 	long_int per2, cz2;
 
@@ -841,7 +841,7 @@ void debloc(int l) {
 
 /* overlay */ void quelq15(int &per) {
 	int cx;
-	boolean test;
+	bool test;
 
 
 	/* debug('o1 quelq15'); */
@@ -1254,7 +1254,7 @@ void aniof(int ouf, int num) {
 }
 
 void musique(int so) {
-	boolean i;
+	bool i;
 	int haz;
 	/* dep: array[1..5] of long_int;*/
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 1211d21..82f8004 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -58,7 +58,7 @@ void conv(int x, int &y);
 /* NIVEAU 12 */
 void okpas();
 void modobj(int m);
-void modobj2(int m, boolean t1, boolean t2);
+void modobj2(int m, bool t1, bool t2);
 void repon(int f, int m);
 void f3f8();
 void t5(int cx);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 6963776..45146c1 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -178,8 +178,8 @@ void afdes(int ad) {
 	okdes = false;
 }
 
-void tkey1(boolean d) {
-	boolean quest;
+void tkey1(bool d) {
+	bool quest;
 	int x, y, c;
 	int key;
 
@@ -327,7 +327,7 @@ void st4(int ob) {
 	}
 }
 
-void cherjer(int ob, boolean &d) {
+void cherjer(int ob, bool &d) {
 	int cx;
 
 	d = false;
@@ -455,7 +455,7 @@ void ajjer(int ob) {
 
 void t1sama() {    /* On entre dans le manoir */
 	int j, h, m;
-	boolean d;
+	bool d;
 
 	calch(j, h, m);
 	if ((h < 5) && (s.mlieu > 18)) {
@@ -601,7 +601,7 @@ void tsuiv() {
 }
 
 void tfleche() {
-	boolean qust;
+	bool qust;
 	char touch;
 	int dummy, cd, xmo, ymo;
 
@@ -728,7 +728,7 @@ void rechai(int &ch) {
 }
 
 void t23coul(int &l) {
-	boolean d;
+	bool d;
 
 	cherjer(143, d);
 	l = 14;
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index bad4332..46181c5 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -46,7 +46,7 @@ void atf3f8(int &key);
 void tperd();
 void tsort();
 void st4(int ob);
-void cherjer(int ob, boolean &d);
+void cherjer(int ob, bool &d);
 void st1sama();
 void modinv();
 void sparl(long_int adr, long_int rep);
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 2d4f127..2555b83 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -53,7 +53,7 @@
 
 namespace Mortevielle {
 
-void divers(int np, boolean b) {
+void divers(int np, bool b) {
 	teskbd();
 	do {
 		parole(np, 0, 0);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index e894e08..8b4fcaa 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -32,7 +32,7 @@ namespace Mortevielle {
 const int m_arrow = 0;
 const int m_point_hand = 1;
 
-boolean int_m,
+bool int_m,
         clic;
 
 int m_show,
@@ -88,7 +88,7 @@ end;  */
 
 void hide_mouse() {
 	int i, j, k, ps, ds;
-	boolean imp;
+	bool imp;
 
 	mouse_shwn = pred(int, mouse_shwn);
 	if (mouse_shwn == 0) {
@@ -177,7 +177,7 @@ void hide_mouse() {
 void show_mouse() {
 	int i, j, k, l,
 	        ps, ds;
-	boolean imp;
+	bool imp;
 	char c;
 
 	mouse_shwn = mouse_shwn + 1;
@@ -311,8 +311,8 @@ void read_pos_mouse(int &x, int &y, int &c) {
 	}
 }
 
-void mov_mouse(boolean &funct, char &key) {
-	boolean p_key;
+void mov_mouse(bool &funct, char &key) {
+	bool p_key;
 	char in1, in2;
 	int x, y, cx, cy, cd;
 	registres reg;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 62fdf1b..90fe91e 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -37,7 +37,7 @@ void hide_mouse();
 void show_mouse();
 void pos_mouse(int x, int y);
 void read_pos_mouse(int &x, int &y, int &c);
-void mov_mouse(boolean &funct, char &key);
+void mov_mouse(bool &funct, char &key);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 072fe5c..749bc13 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -57,7 +57,7 @@ const byte tab31[32]= {
 
 void deline(int num , phrase &l , int &tl);
 
-static void cinq_huit(char &c, int &ind, byte &pt, boolean &the_end) {
+static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 	const unsigned char rap[32] = { 
 		',', ':', '@', '!', '?', '-', '\207',
 		'\240', '\205', '\203', '\202', '\212', '\210', '/',
@@ -153,7 +153,7 @@ static int l_motsuiv(int p, phrase &ch, int &tab) {
 }
 
 void afftex(phrase ch, int x, int y, int dx, int dy, int typ) {
-	boolean the_end;
+	bool the_end;
 	char touch;
 	int xf, yf;
 	int xc, yc;
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index fcf4822..b9a239b 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-static void cinq_huit(char &c, int &ind, byte &pt, boolean &the_end);
+static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
 void deline(int num , phrase &l , int &tl);
 static int l_motsuiv(int p, phrase &ch, int &tab);
 void afftex(phrase ch, int x, int y, int dx, int dy, int typ);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index d18af48..570d548 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -65,7 +65,7 @@ void ani50() {
      end;
   end;*/
 
-/* overlay */ void aff50(boolean c) {
+/* overlay */ void aff50(bool c) {
 	int k;
 
 	caff = 50;
@@ -276,7 +276,7 @@ void ani50() {
 /* overlay */ void music() {
 	untyped_file fic;
 	int k;
-	boolean fin;
+	bool fin;
 	char ch;
 	float x, y;
 
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 339ee69..4cad37c 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -33,7 +33,7 @@ namespace Mortevielle {
 void dem2();
 void ani50();
 //void apzuul();
-void aff50(boolean c);
+void aff50(bool c);
 void init_menu();
 void charpal();
 void chartex();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 9ff2b66..ddf9e4d 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -243,7 +243,7 @@ void tecran() {
 	const int lim = 20000;
 	int temps;
 	char inkey;
-	boolean oo, funct;
+	bool oo, funct;
 
 	clsf3();
 	oo = false;
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 4080453..a802516 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-/* overlay */ boolean ques() {
+/* overlay */ bool ques() {
 	const array<1, 10, int> ta
 	= {{
 			511, 516, 524, 531, 545,
@@ -40,7 +40,7 @@ namespace Mortevielle {
 	const array<1, 10, int> ok
 	= {{ 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }};
 
-	boolean q, func, test;
+	bool q, func, test;
 	int i, j, k, y, memk;
 	int tay , tmax;
 	int rep, prem, der;
@@ -51,7 +51,7 @@ namespace Mortevielle {
 	int compte;
 
 
-	boolean ques_result;
+	bool ques_result;
 	test = false;
 	i = 0;
 	compte = 0;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index c2ce4b3..2f99287 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -208,7 +208,7 @@ struct sav_chaine {
 	char sjer[31];
 	int mlieu, iboul, ibag, icave, ivier, ipuit;
 	int derobj, iloic, icryp;
-	boolean ipre;
+	bool ipre;
 	char heure;
 };
 struct registres {
@@ -238,7 +238,7 @@ struct doublet {
 typedef array<1, 16, doublet> tabdb;
 struct rectangle {
 	int x1, x2, y1, y2;
-	boolean etat;
+	bool etat;
 };
 
 typedef array<1, max_rect, rectangle> mult_rect;
@@ -263,7 +263,7 @@ struct t_pcga {
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-boolean blo,
+bool blo,
         bh1,
         bf1,
         bh2,


Commit: 2ffc1fd85e75bf52a0a7b5fbcf37a4667386e77f
    https://github.com/scummvm/scummvm/commit/2ffc1fd85e75bf52a0a7b5fbcf37a4667386e77f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:36-07:00

Commit Message:
MORTEVIELLE: Fix some errors by including str.h

Changed paths:
    engines/mortevielle/alert.h
    engines/mortevielle/menu.h
    engines/mortevielle/mor.h
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
index 2335131..6c66a20 100644
--- a/engines/mortevielle/alert.h
+++ b/engines/mortevielle/alert.h
@@ -28,6 +28,8 @@
 #ifndef MORTEVIELLE_ALERT_H
 #define MORTEVIELLE_ALERT_H
 
+#include "common/str.h"
+
 namespace Mortevielle {
 
 int do_alert(Common::String str_, int n);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 451e9671..2b548a2 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -28,6 +28,8 @@
 #ifndef MORTEVIELLE_MENU_H
 #define MORTEVIELLE_MENU_H
 
+#include "common/str.h"
+
 namespace Mortevielle {
 
 /* NIVEAU 14*/
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 82f8004..88e718b 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -28,6 +28,8 @@
 #ifndef MORTEVIELLE_MOR_H
 #define MORTEVIELLE_MOR_H
 
+#include "common/str.h"
+
 namespace Mortevielle {
 
 /* Niveau 14 suite */
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 749bc13..13dd824 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/outtext.h"
+#include "common/str.h"
 
 namespace Mortevielle {
 


Commit: bc51e86114def08b3f10e0eb8d169d4af91a0e86
    https://github.com/scummvm/scummvm/commit/bc51e86114def08b3f10e0eb8d169d4af91a0e86
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:37-07:00

Commit Message:
MORTEVIELLE: Fix several errors, add some includes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.h
    engines/mortevielle/boite.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 27598fe..6e28c17 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -26,6 +26,8 @@
  */
 
 #include "mortevielle/actions.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mor2.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
index 6c66a20..6419e81 100644
--- a/engines/mortevielle/alert.h
+++ b/engines/mortevielle/alert.h
@@ -33,7 +33,7 @@
 namespace Mortevielle {
 
 int do_alert(Common::String str_, int n);
-void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
+static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
 static void posit(int ji, int &coldep, int &esp);
 static void fait_boite(int lidep, int nli, int tx);
 static void fait_choix(Common::String c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp);
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index cfda996..0a37cc7 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -26,6 +26,8 @@
  */
 
 #include "mortevielle/boite.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 3f582e8..9def04a 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/droite.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 6f5f001..42219ee 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/level15.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 46181c5..adfbff9 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -40,7 +40,7 @@ void tmlieu(int mli);
 void tlu(int af, int ob);
 void delin(int n);
 void affrep();
-void mfouen()
+void mfouen();
 void atf3f8(int &key);
 /* NIVEAU 6 */
 void tperd();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index ddf9e4d..08b63fe 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mor2.h"
 #include "mortevielle/prog.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index a802516..8ea4e4c 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -31,14 +31,8 @@
 namespace Mortevielle {
 
 /* overlay */ bool ques() {
-	const array<1, 10, int> ta
-	= {{
-			511, 516, 524, 531, 545,
-			552, 559, 563, 570, 576
-		}
-	};
-	const array<1, 10, int> ok
-	= {{ 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 }};
+	const int ta[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
+	const int ok[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
 	bool q, func, test;
 	int i, j, k, y, memk;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 92ff49f..6209b08 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
 #include "common/str.h"
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 2f99287..25789e2 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -30,390 +30,10 @@
 
 namespace Mortevielle {
 
-/*         Constantes, Types et Variables pour le
-
-              M A N O I R   DE   M O R T E V I E L L E
-
-                                                    ( version Nov 1988
-                                                             +
-                                                  musique & paroles Oct 88 )
-                                                                             */
-
-
-/*---------------------------------------------------------------------------*/
-/*-------------------------   CONSTANTES   ----------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-const float freq0 = 1.19318e6;
-
-const int seg_syst = 0x6fed;
-const int segmou = 0x6f00;
-const int segdon = 0x6c00;
-const int adani = 0x7314;
-const int adword = 0x4000;
-const int adtroct = 0x406b;
-const int adcfiec = 0x4300;
-const int adbruit = 0x5cb0;/*2C00;*/
-const int adbruit1 = 0x6924;/*3874;*/
-const int adbruit2 = 0x6b30;/*3A80;*/
-const int adbruit3 = 0x6ba6;/*3AF6;*/
-const int adbruit5 = 0x3b50;
-const int adson = 0x5cb0;/*2C00;*/
-const int adson2 = 0x60b0;/*3000;*/
-const int offsetb1 = 6;
-const int offsetb2 = 4;
-const int offsetb3 = 6;
-
-const int null = 255;
-
-const int tempo_mus = 71;
-const int tempo_bruit = 78;
-const int tempo_f = 80;
-const int tempo_m = 89;
-
-const int ti1 = 410;
-const int ti2 = 250;
-const int maxti = 7975;
-const int maxtd = 600;
-const int max_rect = 14;
-
-const int ams = 0;
-const int cga = 1;
-const int ega = 2;
-const int her = 3;
-const int tan = 4;
-
-const int c_repon = 0;
-const int c_st41 = 186;
-const int c_tparler = 247;
-const int c_paroles = 292;
-const int c_tmlieu = 435;
-const int c_dialpre = 456;
-const int c_action = 476;
-const int c_saction = 497;
-const int c_dis = 502;
-const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
-
-const int arega = 0;
-const int asoul = 154;
-const int aouvr = 282;
-const int achai = 387;
-const int acha = 492;
-const int arcf = 1272;
-const int arep = 1314;
-const int amzon = 1650;
-const int fleche = 1758;
-
-const int no_choice = 0;
-const int invent = 1;
-const int depla = 2;
-const int action = 3;
-const int saction = 4;
-const int discut = 5;
-const int fichier = 6;
-const int sauve = 7;
-const int charge = 8;
-
-const int attacher = 0x301;
-const int attendre = 0x302;
-const int defoncer = 0x303;
-const int dormir = 0x304;
-const int ecouter = 0x305;
-const int entrer = 0x306;
-const int fermer = 0x307;
-const int fouiller = 0x308;
-const int frapper = 0x309;
-const int gratter = 0x30a;
-const int lire = 0x30b;
-const int manger = 0x30c;
-const int mettre = 0x30d;
-const int ouvrir = 0x30e;
-const int prendre = 0x30f;
-const int regarder = 0x310;
-const int sentir = 0x311;
-const int sonder = 0x312;
-const int sortir = 0x313;
-const int soulever = 0x314;
-const int tourner = 0x315;
-
-const int scacher = 0x401;
-const int sfouiller = 0x402;
-const int slire = 0x403;
-const int sposer = 0x404;
-const int sregarder = 0x405;
-
-const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
-const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
-const byte tnocon[364] = {
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-
-const matrix<1, 8, 1, 4, byte> don
-= {{{{ 7, 37, 22,  8}},
-		{{19, 33, 23,  7}},
-		{{31, 89, 10, 21}},
-		{{43, 25, 11,  5}},
-		{{55, 37,  5,  8}},
-		{{64, 13, 11,  2}},
-		{{62, 22, 13,  4}},
-		{{62, 25, 13,  5}}
-	}
-};
-
-const array<1, 2, varying_string<11> > fic
-= {{ " Sauvegarde",
-		" Chargement"
-	}
-};
-
-const byte addv[2] = {8, 8};
-
-const char recom[] = " Recommence  ";
-
-const char f3[] = "F3: Encore";
-const char f8[] = "F8: Suite";
-
-const int max_patt = 20;
-
-
-const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
-
-
 /*---------------------------------------------------------------------------*/
-/*--------------------------------   TYPES   --------------------------------*/
+/*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
 /*---------------------------------------------------------------------------*/
 
-typedef float long_int;
-typedef file<byte> fichier_byte;
-struct sav_chaine {
-	int conf;
-	char pourc[11];
-	char teauto[43];
-	char sjer[31];
-	int mlieu, iboul, ibag, icave, ivier, ipuit;
-	int derobj, iloic, icryp;
-	bool ipre;
-	char heure;
-};
-struct registres {
-	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
-};
-typedef array<1, 1410, char> phrase;
-struct ind {
-	int indis;
-	byte point;
-};
-typedef array<0, maxtd, ind> tabind;
-
-typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
-
-typedef int word1;
-struct chariot {
-	int val,
-	        code,
-	        acc,
-	        freq,
-	        rep;
-};
-
-struct doublet {
-	byte x, y;
-};
-typedef array<1, 16, doublet> tabdb;
-struct rectangle {
-	int x1, x2, y1, y2;
-	bool etat;
-};
-
-typedef array<1, max_rect, rectangle> mult_rect;
-
-struct pattern {
-	byte tay, tax;
-	matrix<1, max_patt, 1, max_patt, byte> des;
-};
-
-
-struct nhom {
-	byte n;     /* numero entre 0 et 32 */
-	byte hom[4];
-};
-
-struct t_pcga {
-	byte p;
-	nhom a[16];
-};
-
-/*---------------------------------------------------------------------------*/
-/*------------------------------   VARIABLES   ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-bool blo,
-        bh1,
-        bf1,
-        bh2,
-        bh4,
-        bf4,
-        bh5,
-        bh6,
-        bh8,
-        bt3,
-        bt7,
-        bh9,
-
-        sonoff,
-        main1,
-        choisi,
-        test0,
-        f2_all,
-        imen,
-        cache,
-        iesc,
-        perdu,
-        col,
-        syn,
-        fouil,
-        zuul,
-        tesok,
-        obpart,
-        okdes,
-        solu,
-        arret,
-        anyone,
-        brt,
-        rect,
-        rech_cfiec,
-        active_menu;
-
-
-int x,
-        y,
-        t,
-        vj,
-        li,
-        vh,
-        vm,
-        jh,
-        mh,
-        cs,
-        gd,                /*  Gd = graph device  */
-        hdb,
-        hfb,
-        heu,
-        jou,
-        key,
-        min,
-        num,
-        max,
-        res,
-        ment,
-        haut,
-        caff,
-        maff,
-        crep,
-        ades,
-        iouv,
-        inei,
-        ctrm,
-        dobj,
-        msg3,
-        msg4,
-        mlec,
-        newgd,
-        c_zzz,
-        mchai,
-        menup,
-        ipers,
-        ledeb,
-        lefin,
-        mpers,
-        mnumo,
-        xprec,
-        yprec,
-        perdep,
-        prebru,
-        typlec,
-        num_ph,
-        xwhere,
-        ywhere,
-        numpal,
-        lderobj,
-        nb_word,
-        ptr_oct,
-        k_tempo,
-        ptr_tcph,
-        ptr_word,
-        color_txt;
-
-int t_cph[6401];
-byte tabdon[4001];
-/*   t_dxx  : array[0..121] of int;*/
-Common::String stpou;                               /* donne le % d'indices */
-byte is;
-char mode;
-fichier_byte ficdes;
-Common::String al_mess,
-       err_mess,
-       ind_mess,
-       al_mess2;
-
-array<1, 8, int> invt,
-      nbrep,
-      nbrepm,
-      disc;
-int msg[5];
-array<1, 7, int> depl;
-array<1, 8, varying_string<22> > inv;
-array<1, 7, varying_string<23> > dep;
-array<1, 21, varying_string<10> > act;
-array<1, 5, varying_string<11> > self_;
-array<1, 8, varying_string<5> > dis;
-array<1, 7, char> touv;
-sav_chaine s, s1;
-byte bufcha[391];
-
-matrix<1, 6, 0, 23, byte> lettres;
-
-byte palher[16];
-
-int t_mot[maxti + 1];
-int tay_tchar;
-tabind t_rec;
-file<ind> sauv_t;
-untyped_file fibyte;
-tab_mlieu v_lieu;
-int l[108];
-int tbi[256];
-chariot c1, c2, c3;
-float addfix;
-t_pcga palsav[91];
-array<0, 90, tabdb> tabpal;
-t_pcga palcga[91];
-pattern tpt[15];
-
-
-
-/*---------------------------------------------------------------------------*/
-/*--------------------   PROCEDURES  ET  FONCTIONS   ------------------------*/
-/*---------------------------------------------------------------------------*/
-
-/* procedure box(c,Gd,xo,yo,xi,yi,patt:int); external 'c:\mc\boite.com'; */
-
 void hirs() {
 	const byte tandy[14] = {113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0};
 	const byte herc[13] = {50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0};
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 86bb296..4a526a3 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -28,8 +28,388 @@
 #ifndef MORTEVIELLE_VAR_H
 #define MORTEVIELLE_VAR_H
 
+#include "common/str.h"
+
 namespace Mortevielle {
 
+/*         Constantes, Types et Variables pour le
+
+              M A N O I R   DE   M O R T E V I E L L E
+
+                                                    ( version Nov 1988
+                                                             +
+                                                  musique & paroles Oct 88 )
+                                                                             */
+
+
+/*---------------------------------------------------------------------------*/
+/*-------------------------   CONSTANTES   ----------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+const float freq0 = 1.19318e6;
+
+const int seg_syst = 0x6fed;
+const int segmou = 0x6f00;
+const int segdon = 0x6c00;
+const int adani = 0x7314;
+const int adword = 0x4000;
+const int adtroct = 0x406b;
+const int adcfiec = 0x4300;
+const int adbruit = 0x5cb0;/*2C00;*/
+const int adbruit1 = 0x6924;/*3874;*/
+const int adbruit2 = 0x6b30;/*3A80;*/
+const int adbruit3 = 0x6ba6;/*3AF6;*/
+const int adbruit5 = 0x3b50;
+const int adson = 0x5cb0;/*2C00;*/
+const int adson2 = 0x60b0;/*3000;*/
+const int offsetb1 = 6;
+const int offsetb2 = 4;
+const int offsetb3 = 6;
+
+const int null = 255;
+
+const int tempo_mus = 71;
+const int tempo_bruit = 78;
+const int tempo_f = 80;
+const int tempo_m = 89;
+
+const int ti1 = 410;
+const int ti2 = 250;
+const int maxti = 7975;
+const int maxtd = 600;
+const int max_rect = 14;
+
+const int ams = 0;
+const int cga = 1;
+const int ega = 2;
+const int her = 3;
+const int tan = 4;
+
+const int c_repon = 0;
+const int c_st41 = 186;
+const int c_tparler = 247;
+const int c_paroles = 292;
+const int c_tmlieu = 435;
+const int c_dialpre = 456;
+const int c_action = 476;
+const int c_saction = 497;
+const int c_dis = 502;
+const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
+
+const int arega = 0;
+const int asoul = 154;
+const int aouvr = 282;
+const int achai = 387;
+const int acha = 492;
+const int arcf = 1272;
+const int arep = 1314;
+const int amzon = 1650;
+const int fleche = 1758;
+
+const int no_choice = 0;
+const int invent = 1;
+const int depla = 2;
+const int action = 3;
+const int saction = 4;
+const int discut = 5;
+const int fichier = 6;
+const int sauve = 7;
+const int charge = 8;
+
+const int attacher = 0x301;
+const int attendre = 0x302;
+const int defoncer = 0x303;
+const int dormir = 0x304;
+const int ecouter = 0x305;
+const int entrer = 0x306;
+const int fermer = 0x307;
+const int fouiller = 0x308;
+const int frapper = 0x309;
+const int gratter = 0x30a;
+const int lire = 0x30b;
+const int manger = 0x30c;
+const int mettre = 0x30d;
+const int ouvrir = 0x30e;
+const int prendre = 0x30f;
+const int regarder = 0x310;
+const int sentir = 0x311;
+const int sonder = 0x312;
+const int sortir = 0x313;
+const int soulever = 0x314;
+const int tourner = 0x315;
+
+const int scacher = 0x401;
+const int sfouiller = 0x402;
+const int slire = 0x403;
+const int sposer = 0x404;
+const int sregarder = 0x405;
+
+const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte tnocon[364] = {
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+
+const matrix<1, 8, 1, 4, byte> don
+= {{{{ 7, 37, 22,  8}},
+		{{19, 33, 23,  7}},
+		{{31, 89, 10, 21}},
+		{{43, 25, 11,  5}},
+		{{55, 37,  5,  8}},
+		{{64, 13, 11,  2}},
+		{{62, 22, 13,  4}},
+		{{62, 25, 13,  5}}
+	}
+};
+
+const array<1, 2, varying_string<11> > fic
+= {{ " Sauvegarde",
+		" Chargement"
+	}
+};
+
+const byte addv[2] = {8, 8};
+
+const char recom[] = " Recommence  ";
+
+const char f3[] = "F3: Encore";
+const char f8[] = "F8: Suite";
+
+const int max_patt = 20;
+
+
+const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+
+
+/*---------------------------------------------------------------------------*/
+/*--------------------------------   TYPES   --------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+typedef float long_int;
+typedef file<byte> fichier_byte;
+struct sav_chaine {
+	int conf;
+	char pourc[11];
+	char teauto[43];
+	char sjer[31];
+	int mlieu, iboul, ibag, icave, ivier, ipuit;
+	int derobj, iloic, icryp;
+	bool ipre;
+	char heure;
+};
+struct registres {
+	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
+};
+typedef char[1410] phrase;
+struct ind {
+	int indis;
+	byte point;
+};
+typedef ind[maxtd + 1] tabind;
+
+typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
+
+typedef int word1;
+struct chariot {
+	int val,
+	        code,
+	        acc,
+	        freq,
+	        rep;
+};
+
+struct doublet {
+	byte x, y;
+};
+
+typedef doublet[16] tabdb;
+
+struct rectangle {
+	int x1, x2, y1, y2;
+	bool etat;
+};
+
+typedef rectangle[max_rect] mult_rect;
+
+struct pattern {
+	byte tay, tax;
+	matrix<1, max_patt, 1, max_patt, byte> des;
+};
+
+
+struct nhom {
+	byte n;     /* numero entre 0 et 32 */
+	byte hom[4];
+};
+
+struct t_pcga {
+	byte p;
+	nhom a[16];
+};
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------   VARIABLES   ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+bool blo,
+        bh1,
+        bf1,
+        bh2,
+        bh4,
+        bf4,
+        bh5,
+        bh6,
+        bh8,
+        bt3,
+        bt7,
+        bh9,
+
+        sonoff,
+        main1,
+        choisi,
+        test0,
+        f2_all,
+        imen,
+        cache,
+        iesc,
+        perdu,
+        col,
+        syn,
+        fouil,
+        zuul,
+        tesok,
+        obpart,
+        okdes,
+        solu,
+        arret,
+        anyone,
+        brt,
+        rect,
+        rech_cfiec,
+        active_menu;
+
+
+int x,
+        y,
+        t,
+        vj,
+        li,
+        vh,
+        vm,
+        jh,
+        mh,
+        cs,
+        gd,                /*  Gd = graph device  */
+        hdb,
+        hfb,
+        heu,
+        jou,
+        key,
+        min,
+        num,
+        max,
+        res,
+        ment,
+        haut,
+        caff,
+        maff,
+        crep,
+        ades,
+        iouv,
+        inei,
+        ctrm,
+        dobj,
+        msg3,
+        msg4,
+        mlec,
+        newgd,
+        c_zzz,
+        mchai,
+        menup,
+        ipers,
+        ledeb,
+        lefin,
+        mpers,
+        mnumo,
+        xprec,
+        yprec,
+        perdep,
+        prebru,
+        typlec,
+        num_ph,
+        xwhere,
+        ywhere,
+        numpal,
+        lderobj,
+        nb_word,
+        ptr_oct,
+        k_tempo,
+        ptr_tcph,
+        ptr_word,
+        color_txt;
+
+int t_cph[6401];
+byte tabdon[4001];
+/*   t_dxx  : array[0..121] of int;*/
+Common::String stpou;                               /* donne le % d'indices */
+byte is;
+char mode;
+fichier_byte ficdes;
+Common::String al_mess,
+       err_mess,
+       ind_mess,
+       al_mess2;
+
+int invt[8];
+int nbrep[8];
+int nbrepm[8];
+int disc[8]
+int msg[5];
+int depl[7];
+array<1, 8, varying_string<22> > inv;
+array<1, 7, varying_string<23> > dep;
+array<1, 21, varying_string<10> > act;
+array<1, 5, varying_string<11> > self_;
+array<1, 8, varying_string<5> > dis;
+char touv[7];
+sav_chaine s, s1;
+byte bufcha[391];
+
+matrix<1, 6, 0, 23, byte> lettres;
+
+byte palher[16];
+
+int t_mot[maxti + 1];
+int tay_tchar;
+tabind t_rec;
+file<ind> sauv_t;
+untyped_file fibyte;
+tab_mlieu v_lieu;
+int l[108];
+int tbi[256];
+chariot c1, c2, c3;
+float addfix;
+t_pcga palsav[91];
+tabdb tabpal[91];
+t_pcga palcga[91];
+pattern tpt[15];
+
 /*---------------------------------------------------------------------------*/
 /*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
 /*---------------------------------------------------------------------------*/


Commit: 5fa968449c6196d2ee7f61fcfe08d1ef18acf7b1
    https://github.com/scummvm/scummvm/commit/5fa968449c6196d2ee7f61fcfe08d1ef18acf7b1
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:38-07:00

Commit Message:
MORTEVIELLE: Enlarge two arrays in order to fix pascal access

Changed paths:
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 8ea4e4c..9a1280c 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -31,8 +31,8 @@
 namespace Mortevielle {
 
 /* overlay */ bool ques() {
-	const int ta[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
-	const int ok[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
+	const int ta[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
+	const int ok[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
 	bool q, func, test;
 	int i, j, k, y, memk;


Commit: d8b28221d5a4cca35ae9a60baae698558f2af2fe
    https://github.com/scummvm/scummvm/commit/d8b28221d5a4cca35ae9a60baae698558f2af2fe
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:18:40-07:00

Commit Message:
MORTEVIELLE: Fix some more errors by adding includes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6e28c17..4370947 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -26,8 +26,12 @@
  */
 
 #include "mortevielle/actions.h"
+#include "mortevielle/alert.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 5b80588..eca3021 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -25,7 +25,10 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/alert.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/outtext.h"
+#include "mortevielle/var_mor.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 13dd824..f474766 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/outtext.h"
+#include "mortevielle/var_mor.h"
 #include "common/str.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index b9a239b..27f9c6c 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -28,6 +28,8 @@
 #ifndef MORTEVIELLE_OUTTEXT_H
 #define MORTEVIELLE_OUTTEXT_H
 
+#include "mortevielle/var_mor.h"
+
 namespace Mortevielle {
 
 static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 570d548..dbb0977 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/ovd1.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 9a1280c..db44ce3 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
 #include "common/str.h"
 


Commit: 3c6329ef6ef4105eade8562a3d00245c71da3407
    https://github.com/scummvm/scummvm/commit/3c6329ef6ef4105eade8562a3d00245c71da3407
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:41-07:00

Commit Message:
MORTEVIELLE: long_int -> float

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/taffich.cpp
    engines/mortevielle/taffich.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index eca3021..e55b4ed 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -531,7 +531,7 @@ void affper(int per) {
 /* overlay */ void choix(int min, int max, int &per) {
 	bool i;
 	int haz, cx, cy, cz;
-	long_int per2, cz2;
+	float per2, cz2;
 
 	/* debug('o0 choix'); */
 	haz = hazard(min, max);
@@ -1259,7 +1259,7 @@ void aniof(int ouf, int num) {
 void musique(int so) {
 	bool i;
 	int haz;
-	/* dep: array[1..5] of long_int;*/
+	/* dep: array[1..5] of float;*/
 
 	/* debug('musique'); */
 	if (so == 0) { /*musik(0)*/
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 45146c1..dea21bd 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -362,7 +362,7 @@ void modinv() {
 		}
 }
 
-void sparl(long_int adr, long_int rep) {
+void sparl(float adr, float rep) {
 	const array<1, 8, int> haut
 	= {{0, 1, -3, 6, -2, 2, 7, -1}};
 	int key, ad, tay, repint;
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index adfbff9..a1732a1 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -49,7 +49,7 @@ void st4(int ob);
 void cherjer(int ob, bool &d);
 void st1sama();
 void modinv();
-void sparl(long_int adr, long_int rep);
+void sparl(float adr, float rep);
 void finfouil();
 void mfoudi();
 void mennor();
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index df55807..0a19301 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-void chardes(Common::String nom, long_int passe, int long_) {
+void chardes(Common::String nom, float passe, int long_) {
 	int i, p, l;
 	byte b;
 	untyped_file f;
@@ -60,7 +60,7 @@ void chardes(Common::String nom, long_int passe, int long_) {
 	/*$i+*/
 }
 
-void charani(Common::String nom, long_int passe, int long_) {
+void charani(Common::String nom, float passe, int long_) {
 	int i, p, l;
 	byte b;
 	untyped_file f;
@@ -101,7 +101,7 @@ void taffich() {
 	};
 	int i, m, a, b, cx, handle,
 	        npal;
-	long_int lgt, lhandle;
+	float lgt, lhandle;
 	Common::String nom;
 	int palh, k, j;
 	int alllum[16];
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
index ccc64bf..41f0612 100644
--- a/engines/mortevielle/taffich.h
+++ b/engines/mortevielle/taffich.h
@@ -32,9 +32,9 @@
 
 namespace Mortevielle {
 
-void chardes(Common::String nom, long_int passe, int long_);
-void charani(Common::String nom, long_int passe, int long_);
+void chardes(Common::String nom, float passe, int long_);
+void charani(Common::String nom, float passe, int long_);
 void taffich();
 } // End of namespace Mortevielle
 
-#endif
\ No newline at end of file
+#endif
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 4a526a3..42f95d5 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -201,7 +201,6 @@ const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-typedef float long_int;
 typedef file<byte> fichier_byte;
 struct sav_chaine {
 	int conf;


Commit: c580ad126edd0f75bc614fafd81998a4647f112e
    https://github.com/scummvm/scummvm/commit/c580ad126edd0f75bc614fafd81998a4647f112e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:42-07:00

Commit Message:
MORTEVIELLE: COnvert more arrays and data types

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 4370947..25d9af0 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -476,7 +476,7 @@ L2:
 /* overlay */ void tmettre() {
 	int quel;
 	bool entre;
-	phrase st;
+	char st[1410];
 	Common::String str_;
 	int i, tay;
 
@@ -990,7 +990,7 @@ L2:
 	        i, tay, choi, x, y, c;
 	char tou;
 	array<1, 46, varying_string<40> > lib;
-	phrase st;
+	char st[1410];
 	bool f;
 
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 8278327..d790bf2 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -182,7 +182,7 @@ void draw_menu() {
 }
 
 void invers(int ix) {
-	varying_string<23> s;
+	Common::String s;
 
 	/* debug('invers'); */
 	if (msg4 == no_choice)  return;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e55b4ed..ea57e20 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -115,7 +115,7 @@ void text_color(int c) {
 
 
 void text1(int x, int y, int nb, int m) {
-	phrase st;
+	char st[1410];
 	int tay;
 	int co;
 
@@ -358,7 +358,7 @@ void okpas() {
 }
 
 void modobj(int m) {
-	phrase str_;
+	char str_[1410];
 	Common::String strp;
 	int i, tay;
 
@@ -373,7 +373,7 @@ void modobj(int m) {
 }
 
 void modobj2(int m, bool t1, bool t2) {
-	phrase str_;
+	char str_[1410];
 	Common::String strp;
 	int i, tay;
 
@@ -393,7 +393,7 @@ void modobj2(int m, bool t1, bool t2) {
 void repon(int f, int m) {
 	Common::String str_;
 	varying_string<40> str1;
-	phrase st;
+	char st[1410];
 	text1 fic;
 	int i, xco, dx, caspe, tay;
 
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index dea21bd..7fc280a 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -199,7 +199,7 @@ void tkey1(bool d) {
 void tmlieu(int mli) {
 	int cx, j, i, tail;
 	Common::String nomp;
-	phrase st;
+	char st[1410];
 
 
 	if (mli == 26)  mli = 15;
@@ -230,7 +230,7 @@ void tlu(int af, int ob) {
 }
 
 void delin(int n) {
-	phrase s;
+	char s[1410];
 	int t;
 
 	deline(n, s, t);
@@ -342,7 +342,7 @@ void st1sama() {
 
 void modinv() {
 	int cx, cy, tay, i, r;
-	phrase nom;
+	char nom[1410];
 	Common::String nomp;
 
 	cy = 0;
@@ -366,7 +366,7 @@ void sparl(float adr, float rep) {
 	const array<1, 8, int> haut
 	= {{0, 1, -3, 6, -2, 2, 7, -1}};
 	int key, ad, tay, repint;
-	phrase st;
+	char st[1410];
 
 	repint = trunc(rep);
 	hide_mouse();
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index f474766..1137f90 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -57,7 +57,7 @@ const byte tab31[32]= {
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
-void deline(int num , phrase &l , int &tl);
+void deline(int num , char *l , int &tl);
 
 static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 	const unsigned char rap[32] = { 
@@ -114,7 +114,7 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 	}
 }              /* 5-8 */
 
-void deline(int num , phrase &l , int &tl) {
+void deline(int num , char *l , int &tl) {
 	int i, j, ts;
 	char let;
 	byte ps, k;
@@ -141,10 +141,10 @@ void deline(int num , phrase &l , int &tl) {
 }       /* DETEX */
 
 
-void afftex(phrase ch, int x, int y, int dx, int dy, int typ);
+void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 
-static int l_motsuiv(int p, phrase &ch, int &tab) {
+static int l_motsuiv(int p, char *ch, int &tab) {
 	int c;
 
 	int l_motsuiv_result;
@@ -154,7 +154,7 @@ static int l_motsuiv(int p, phrase &ch, int &tab) {
 	return l_motsuiv_result;
 }
 
-void afftex(phrase ch, int x, int y, int dx, int dy, int typ) {
+void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	bool the_end;
 	char touch;
 	int xf, yf;
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 27f9c6c..14ef8c6 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -33,9 +33,9 @@
 namespace Mortevielle {
 
 static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
-void deline(int num , phrase &l , int &tl);
-static int l_motsuiv(int p, phrase &ch, int &tab);
-void afftex(phrase ch, int x, int y, int dx, int dy, int typ);
+void deline(int num , char *l , int &tl);
+static int l_motsuiv(int p, char *ch, int &tab);
+void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index dbb0977..ab669e1 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -80,7 +80,7 @@ void ani50() {
 
 /* overlay */ void init_menu() {
 	int i, j, tai;
-	phrase st;
+	char st[1410];
 	untyped_file f;
 
 	assign(f, "menufr.mor");
@@ -172,7 +172,7 @@ void ani50() {
 /* overlay */ void chartex() {
 	int i;
 	untyped_file fibyte;
-	phrase s;
+	char s[1410];
 
 	/* debug('o3 chartex'); */
 	i = 0;
@@ -202,7 +202,7 @@ void ani50() {
 
 {
 	int cy, tay;
-	phrase st;
+	char st[1410];
 	float ix;
 	char ch;
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index db44ce3..50490df 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -39,7 +39,7 @@ namespace Mortevielle {
 	int i, j, k, y, memk;
 	int tay , tmax;
 	int rep, prem, der;
-	phrase st;
+	char st[1410];
 	char key;
 	mult_rect coor;
 	array<1, 14, Common::String> chaines;
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 42f95d5..44a78e1 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -166,22 +166,22 @@ const byte tnocon[364] = {
 };
 
 
-const matrix<1, 8, 1, 4, byte> don
-= {{{{ 7, 37, 22,  8}},
-		{{19, 33, 23,  7}},
-		{{31, 89, 10, 21}},
-		{{43, 25, 11,  5}},
-		{{55, 37,  5,  8}},
-		{{64, 13, 11,  2}},
-		{{62, 22, 13,  4}},
-		{{62, 25, 13,  5}}
-	}
+const byte don[9][5] = {
+	{ 0,  0,  0,  0, 0},
+	{ 0,  7, 37, 22,  8},
+	{0,  19, 33, 23,  7},
+	{0,  31, 89, 10, 21},
+	{0,  43, 25, 11,  5},
+	{0,  55, 37,  5,  8},
+	{0,  64, 13, 11,  2},
+	{0,  62, 22, 13,  4},
+	{0,  62, 25, 13,  5}
 };
 
-const array<1, 2, varying_string<11> > fic
-= {{ " Sauvegarde",
-		" Chargement"
-	}
+const char *fic[3] = {
+	"", 
+	" Sauvegarde",
+	 " Chargement"
 };
 
 const byte addv[2] = {8, 8};
@@ -201,7 +201,6 @@ const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-typedef file<byte> fichier_byte;
 struct sav_chaine {
 	int conf;
 	char pourc[11];
@@ -215,7 +214,7 @@ struct sav_chaine {
 struct registres {
 	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
 };
-typedef char[1410] phrase;
+
 struct ind {
 	int indis;
 	byte point;
@@ -369,7 +368,6 @@ byte tabdon[4001];
 Common::String stpou;                               /* donne le % d'indices */
 byte is;
 char mode;
-fichier_byte ficdes;
 Common::String al_mess,
        err_mess,
        ind_mess,


Commit: 76c0701575d0c3e5a3f4182e67ff858d2274ac55
    https://github.com/scummvm/scummvm/commit/76c0701575d0c3e5a3f4182e67ff858d2274ac55
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:18:44-07:00

Commit Message:
MORTEVIELLE: More compilation fixes

Changed paths:
    engines/mortevielle/alert.h
    engines/mortevielle/ques.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
index 6419e81..4c53b14 100644
--- a/engines/mortevielle/alert.h
+++ b/engines/mortevielle/alert.h
@@ -33,10 +33,6 @@
 namespace Mortevielle {
 
 int do_alert(Common::String str_, int n);
-static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
-static void posit(int ji, int &coldep, int &esp);
-static void fait_boite(int lidep, int nli, int tx);
-static void fait_choix(Common::String c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp);
 int do_alert(Common::String str_, int n);
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 50490df..d52d89e 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -41,7 +41,7 @@ namespace Mortevielle {
 	int rep, prem, der;
 	char st[1410];
 	char key;
-	mult_rect coor;
+	rectangle coor[max_rect];
 	array<1, 14, Common::String> chaines;
 	int compte;
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 25789e2..34c1607 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -97,9 +97,9 @@ void hirs() {
 
 /* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */
 
-void affcar(int gd, int x, int y, int coul, int char) {
-	if (res == 1)  affput(1, gd, ((cardinal)x >> 1), y, coul, char);
-	else affput(1, gd, x, y, coul, char);
+void affcar(int gd, int x, int y, int coul, int chr) {
+	if (res == 1)  affput(1, gd, ((cardinal)x >> 1), y, coul, chr);
+	else affput(1, gd, x, y, coul, chr);
 }
 
 void putpix(int gd, int x, int y, int coul) {
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 44a78e1..f912789 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -219,9 +219,6 @@ struct ind {
 	int indis;
 	byte point;
 };
-typedef ind[maxtd + 1] tabind;
-
-typedef matrix<1, 7, 0, 24, byte> tab_mlieu;
 
 typedef int word1;
 struct chariot {
@@ -236,18 +233,14 @@ struct doublet {
 	byte x, y;
 };
 
-typedef doublet[16] tabdb;
-
 struct rectangle {
 	int x1, x2, y1, y2;
 	bool etat;
 };
 
-typedef rectangle[max_rect] mult_rect;
-
 struct pattern {
 	byte tay, tax;
-	matrix<1, max_patt, 1, max_patt, byte> des;
+	byte des[max_patt+1][max_patt+1];
 };
 
 
@@ -376,34 +369,34 @@ Common::String al_mess,
 int invt[8];
 int nbrep[8];
 int nbrepm[8];
-int disc[8]
+int disc[8];
 int msg[5];
 int depl[7];
-array<1, 8, varying_string<22> > inv;
-array<1, 7, varying_string<23> > dep;
-array<1, 21, varying_string<10> > act;
-array<1, 5, varying_string<11> > self_;
-array<1, 8, varying_string<5> > dis;
+Common::String inv[9];
+Common::String dep[8];
+Common::String act[22];
+Common::String self_[6];
+Common::String dis[9];
 char touv[7];
 sav_chaine s, s1;
 byte bufcha[391];
 
-matrix<1, 6, 0, 23, byte> lettres;
+byte lettres[7][24];
 
 byte palher[16];
 
 int t_mot[maxti + 1];
 int tay_tchar;
-tabind t_rec;
-file<ind> sauv_t;
-untyped_file fibyte;
-tab_mlieu v_lieu;
+ind t_rec[maxtd + 1];
+//file<ind> sauv_t;
+//untyped_file fibyte;
+byte v_lieu[8][25];
 int l[108];
 int tbi[256];
 chariot c1, c2, c3;
 float addfix;
 t_pcga palsav[91];
-tabdb tabpal[91];
+doublet tabpal[91][16];
 t_pcga palcga[91];
 pattern tpt[15];
 
@@ -412,7 +405,7 @@ pattern tpt[15];
 /*---------------------------------------------------------------------------*/
 
 void hirs();
-void affcar(int gd, int x, int y, int coul, int char);
+void affcar(int gd, int x, int y, int coul, int chr);
 void putpix(int gd, int x, int y, int coul);
 
 } // End of namespace Mortevielle


Commit: ab09fdc069cc7b860d5ebb7fcae08a9604922ccd
    https://github.com/scummvm/scummvm/commit/ab09fdc069cc7b860d5ebb7fcae08a9604922ccd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:45-07:00

Commit Message:
MORTEVIELLE: Converted remaining varying_string instances to Common::String

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 25d9af0..ab3481d 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -989,7 +989,7 @@ L2:
 	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
 	char tou;
-	array<1, 46, varying_string<40> > lib;
+	Common::String lib[47];
 	char st[1410];
 	bool f;
 
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 1d5901b..ec7c5f0 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -100,7 +100,7 @@ static void fait_boite(int lidep, int nli, int tx) {
 
 
 
-static void fait_choix(Common::String c, int &coldep, int &nbcase, array<1, 2, varying_string<3> > &s, int &esp) {
+static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String[] &s, int &esp) {
 	int i, l, x;
 	char ch;
 
@@ -126,7 +126,7 @@ int do_alert(Common::String str_, int n) {
 	Common::String st, chaine;
 	matrix<1, 2, 1, 2, int> limit;
 	char c, dumi;
-	array<1, 2, varying_string<3> > s;
+	Common::String s[3];
 	int cx, cy, cd, nbcol, nblig;
 	bool touch, newaff, test, test1, test2, test3, dum;
 	Common::String cas;
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index a18bdd8..89d01c5 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -50,7 +50,7 @@ void dem1() {
 void takesav(int n) {
 	untyped_file f;
 	int i;
-	varying_string<10> st;
+	Common::String st;
 
 	dem1();
 	/* -- chargement du fichier 'sauve#n.mor' -- */
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ea57e20..083187e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -268,7 +268,7 @@ void ecrf7() {
 
 void clsf10() {
 	int co, cod;
-	varying_string<8> st;
+	Common::String st;
 
 	/* debug('clsf10'); */
 	hide_mouse();
@@ -392,7 +392,7 @@ void modobj2(int m, bool t1, bool t2) {
 
 void repon(int f, int m) {
 	Common::String str_;
-	varying_string<40> str1;
+	Common::String str1;
 	char st[1410];
 	text1 fic;
 	int i, xco, dx, caspe, tay;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 7fc280a..d41f480 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -46,7 +46,7 @@ void tinke() {
 	const char d5 = '1';
 	const char d6[] = "OK";
 	int cx, cy, haz, nh, cf, j, h, m, cd;
-	varying_string<3> stpo;
+	Common::String stpo;
 	bool am;
 
 	anyone = false;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 1137f90..8414969 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -160,7 +160,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	int xf, yf;
 	int xc, yc;
 	int tab, p;
-	varying_string<255> s;
+	Common::String s;
 	int i, j, nt;
 
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index ab669e1..5198d7f 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -348,7 +348,7 @@ void ani50() {
 
 
 /* overlay */ void suite() {
-	varying_string<25> cpr;
+	Common::String cpr;
 
 	hirs();
 	repon(7, 2035);
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index d52d89e..870f8b7 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -42,7 +42,7 @@ namespace Mortevielle {
 	char st[1410];
 	char key;
 	rectangle coor[max_rect];
-	array<1, 14, Common::String> chaines;
+	Common::String chaines[15];
 	int compte;
 
 


Commit: 0708b0b0daa2220485a2b9d5b03f84ef6cd05325
    https://github.com/scummvm/scummvm/commit/0708b0b0daa2220485a2b9d5b03f84ef6cd05325
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:46-07:00

Commit Message:
MORTEVIELLE: Fixed variable usage in var_mor.h and var_mor.cpp

Changed paths:
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index d41f480..b6c3ee9 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/mor2.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 8b4fcaa..0a00cc3 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/mouse.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 34c1607..89ebda4 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -31,6 +31,205 @@
 namespace Mortevielle {
 
 /*---------------------------------------------------------------------------*/
+/*------------------------------   CONSTANTS   ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte tnocon[364] = {
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+
+const byte don[9][5] = {
+	{ 0,  0,  0,  0, 0},
+	{ 0,  7, 37, 22,  8},
+	{0,  19, 33, 23,  7},
+	{0,  31, 89, 10, 21},
+	{0,  43, 25, 11,  5},
+	{0,  55, 37,  5,  8},
+	{0,  64, 13, 11,  2},
+	{0,  62, 22, 13,  4},
+	{0,  62, 25, 13,  5}
+};
+
+const char *fic[3] = {
+	"", 
+	" Sauvegarde",
+	 " Chargement"
+};
+
+const byte addv[2] = {8, 8};
+
+const char recom[] = " Recommence  ";
+
+const char f3[] = "F3: Encore";
+const char f8[] = "F8: Suite";
+
+const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------   VARIABLES   ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+bool blo,
+        bh1,
+        bf1,
+        bh2,
+        bh4,
+        bf4,
+        bh5,
+        bh6,
+        bh8,
+        bt3,
+        bt7,
+        bh9,
+
+        sonoff,
+        main1,
+        choisi,
+        test0,
+        f2_all,
+        imen,
+        cache,
+        iesc,
+        perdu,
+        col,
+        syn,
+        fouil,
+        zuul,
+        tesok,
+        obpart,
+        okdes,
+        solu,
+        arret,
+        anyone,
+        brt,
+        rect,
+        rech_cfiec,
+        active_menu;
+
+
+int x,
+        y,
+        t,
+        vj,
+        li,
+        vh,
+        vm,
+        jh,
+        mh,
+        cs,
+        gd,                /*  Gd = graph device  */
+        hdb,
+        hfb,
+        heu,
+        jou,
+        key,
+        min,
+        num,
+        max,
+        res,
+        ment,
+        haut,
+        caff,
+        maff,
+        crep,
+        ades,
+        iouv,
+        inei,
+        ctrm,
+        dobj,
+        msg3,
+        msg4,
+        mlec,
+        newgd,
+        c_zzz,
+        mchai,
+        menup,
+        ipers,
+        ledeb,
+        lefin,
+        mpers,
+        mnumo,
+        xprec,
+        yprec,
+        perdep,
+        prebru,
+        typlec,
+        num_ph,
+        xwhere,
+        ywhere,
+        numpal,
+        lderobj,
+        nb_word,
+        ptr_oct,
+        k_tempo,
+        ptr_tcph,
+        ptr_word,
+        color_txt;
+
+int t_cph[6401];
+byte tabdon[4001];
+/*   t_dxx  : array[0..121] of int;*/
+Common::String stpou;                               /* donne le % d'indices */
+byte is;
+char mode;
+Common::String al_mess,
+       err_mess,
+       ind_mess,
+       al_mess2;
+
+int invt[8];
+int nbrep[8];
+int nbrepm[8];
+int disc[8];
+int msg[5];
+int depl[7];
+Common::String inv[9];
+Common::String dep[8];
+Common::String act[22];
+Common::String self_[6];
+Common::String dis[9];
+char touv[7];
+sav_chaine s, s1;
+byte bufcha[391];
+
+byte lettres[7][24];
+
+byte palher[16];
+
+int t_mot[maxti + 1];
+int tay_tchar;
+ind t_rec[maxtd + 1];
+//file<ind> sauv_t;
+//untyped_file fibyte;
+byte v_lieu[8][25];
+int l[108];
+int tbi[256];
+chariot c1, c2, c3;
+float addfix;
+t_pcga palsav[91];
+doublet tabpal[91][16];
+t_pcga palcga[91];
+pattern tpt[15];
+
+/*---------------------------------------------------------------------------*/
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
 /*---------------------------------------------------------------------------*/
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index f912789..59d98fe 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -43,7 +43,7 @@ namespace Mortevielle {
 
 
 /*---------------------------------------------------------------------------*/
-/*-------------------------   CONSTANTES   ----------------------------------*/
+/*-------------------------    CONSTANTS   ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 const float freq0 = 1.19318e6;
@@ -79,12 +79,6 @@ const int maxti = 7975;
 const int maxtd = 600;
 const int max_rect = 14;
 
-const int ams = 0;
-const int cga = 1;
-const int ega = 2;
-const int her = 3;
-const int tan = 4;
-
 const int c_repon = 0;
 const int c_st41 = 186;
 const int c_tparler = 247;
@@ -144,57 +138,26 @@ const int slire = 0x403;
 const int sposer = 0x404;
 const int sregarder = 0x405;
 
-const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
-const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
-const byte tnocon[364] = {
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-
-const byte don[9][5] = {
-	{ 0,  0,  0,  0, 0},
-	{ 0,  7, 37, 22,  8},
-	{0,  19, 33, 23,  7},
-	{0,  31, 89, 10, 21},
-	{0,  43, 25, 11,  5},
-	{0,  55, 37,  5,  8},
-	{0,  64, 13, 11,  2},
-	{0,  62, 22, 13,  4},
-	{0,  62, 25, 13,  5}
-};
+const int max_patt = 20;
 
-const char *fic[3] = {
-	"", 
-	" Sauvegarde",
-	 " Chargement"
-};
+extern const byte tabdbc[18];
+extern const byte tabdph[16];
+extern const byte typcon[26];
+extern const byte intcon[26];
+extern const byte tnocon[364];
 
-const byte addv[2] = {8, 8};
+extern const byte don[9][5];
 
-const char recom[] = " Recommence  ";
+extern const char *fic[3];
 
-const char f3[] = "F3: Encore";
-const char f8[] = "F8: Suite";
+extern const byte addv[2];
 
-const int max_patt = 20;
+extern const char recom[];
 
+extern const char f3[];
+extern const char f8[];
 
-const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+extern const byte rang[16];
 
 
 /*---------------------------------------------------------------------------*/
@@ -255,10 +218,16 @@ struct t_pcga {
 };
 
 /*---------------------------------------------------------------------------*/
+/*------------------------------     ENUMS     ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+enum GraphicModes { ams = 0, cga = 1, ega = 2, her = 3, tan = 4 };
+
+/*---------------------------------------------------------------------------*/
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool blo,
+extern bool blo,
         bh1,
         bf1,
         bh2,
@@ -296,7 +265,7 @@ bool blo,
         active_menu;
 
 
-int x,
+extern int x,
         y,
         t,
         vj,
@@ -355,50 +324,50 @@ int x,
         ptr_word,
         color_txt;
 
-int t_cph[6401];
-byte tabdon[4001];
+extern int t_cph[6401];
+extern byte tabdon[4001];
 /*   t_dxx  : array[0..121] of int;*/
-Common::String stpou;                               /* donne le % d'indices */
-byte is;
-char mode;
-Common::String al_mess,
+extern Common::String stpou;                               /* donne le % d'indices */
+extern byte is;
+extern char mode;
+extern Common::String al_mess,
        err_mess,
        ind_mess,
        al_mess2;
 
-int invt[8];
-int nbrep[8];
-int nbrepm[8];
-int disc[8];
-int msg[5];
-int depl[7];
-Common::String inv[9];
-Common::String dep[8];
-Common::String act[22];
-Common::String self_[6];
-Common::String dis[9];
-char touv[7];
-sav_chaine s, s1;
-byte bufcha[391];
-
-byte lettres[7][24];
-
-byte palher[16];
-
-int t_mot[maxti + 1];
-int tay_tchar;
-ind t_rec[maxtd + 1];
+extern int invt[8];
+extern int nbrep[8];
+extern int nbrepm[8];
+extern int disc[8];
+extern int msg[5];
+extern int depl[7];
+extern Common::String inv[9];
+extern Common::String dep[8];
+extern Common::String act[22];
+extern Common::String self_[6];
+extern Common::String dis[9];
+extern char touv[7];
+extern sav_chaine s, s1;
+extern byte bufcha[391];
+
+extern byte lettres[7][24];
+
+extern byte palher[16];
+
+extern int t_mot[maxti + 1];
+extern int tay_tchar;
+extern ind t_rec[maxtd + 1];
 //file<ind> sauv_t;
 //untyped_file fibyte;
-byte v_lieu[8][25];
-int l[108];
-int tbi[256];
-chariot c1, c2, c3;
-float addfix;
-t_pcga palsav[91];
-doublet tabpal[91][16];
-t_pcga palcga[91];
-pattern tpt[15];
+extern byte v_lieu[8][25];
+extern int l[108];
+extern int tbi[256];
+extern chariot c1, c2, c3;
+extern float addfix;
+extern t_pcga palsav[91];
+extern doublet tabpal[91][16];
+extern t_pcga palcga[91];
+extern pattern tpt[15];
 
 /*---------------------------------------------------------------------------*/
 /*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/


Commit: 1ad0ded8983d3c977bc5de2311de4a3b04f7e976
    https://github.com/scummvm/scummvm/commit/1ad0ded8983d3c977bc5de2311de4a3b04f7e976
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:48-07:00

Commit Message:
MORTEVIELLE: cardinal -> uint

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index ab3481d..ddfd432 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1049,7 +1049,7 @@ L2:
 			x = x * (3 - res);
 			if (x > 319)  cx = 41;
 			else cx = 1;
-			cy = succ(int, (cardinal)y >> 3);                  /* 0-199 => 1-25 */
+			cy = succ(int, (uint)y >> 3);                  /* 0-199 => 1-25 */
 			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index ec7c5f0..c939da6 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -89,7 +89,7 @@ static void fait_boite(int lidep, int nli, int tx) {
 	int x, y, xx, yy;
 
 	if (tx > 640)  tx = 640;
-	x = 320 - ((cardinal)tx >> 1);
+	x = 320 - ((uint)tx >> 1);
 	y = pred(int, lidep) << 3;
 	xx = x + tx;
 	yy = y + (nli << 3);
@@ -163,15 +163,15 @@ int do_alert(Common::String str_, int n) {
 		} while (!(chaine[i] == ']'));
 	}
 	if (nbcase == 1)  esp = nbcol - 40;
-	else esp = (cardinal)(nbcol - nbcase * 40) >> 1;
-	coldep = 320 - ((cardinal)nbcol >> 1) + ((cardinal)esp >> 1);
+	else esp = (uint)(nbcol - nbcase * 40) >> 1;
+	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
 	fait_choix(cas, coldep, nbcase, s, esp);
-	limit[1][1] = ((cardinal)(coldep) >> 1) * res;
+	limit[1][1] = ((uint)(coldep) >> 1) * res;
 	limit[1][2] = limit[1][1] + 40;
 	if (nbcase == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((cardinal)(320 + ((cardinal)esp >> 1)) >> 1) * res;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
 	show_mouse();
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index 0a37cc7..0a3b5da 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -38,8 +38,8 @@ void boite(int x, int y, int dx, int dy, int coul) {
 	/* debug('boite'); */
 	hide_mouse();
 	if (res == 1) {
-		x = (cardinal)x >> 1;
-		dx = (cardinal)dx >> 1;
+		x = (uint)x >> 1;
+		dx = (uint)dx >> 1;
 	}
 	xi = x;
 	yi = y;
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index cce1bde..ddb78cb 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -50,7 +50,7 @@ int testou() {
 	case '\1':
 	case '\3':
 	case '\5'  : {
-		newgd = (cardinal)pred(int, ord(ch)) >> 1;
+		newgd = (uint)pred(int, ord(ch)) >> 1;
 		testou_result = 61;
 		return testou_result;
 	}
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index d790bf2..e00d8b9 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -156,7 +156,7 @@ void menu_aff() {
 						putpix(gd, x, y + 1, 0);
 						putpix(gd, x, y, color);
 					}
-					msk = (cardinal)msk >> 1;
+					msk = (uint)msk >> 1;
 					x = x + 1;
 				}
 				ind_tabl = succ(int, ind_tabl);
@@ -229,7 +229,7 @@ void util(int x, int y) {
 	else ix = 3;
 	xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = pred(int, (cardinal)y >> 3) + (msg3 << 8);
+		ix = pred(int, (uint)y >> 3) + (msg3 << 8);
 		if (ix != msg4) {
 			invers(1);
 			msg4 = ix;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 083187e..75add66 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -54,9 +54,9 @@ int readclock() {
 	r.ax = 0x2c00;
 	intr(0x21, r);
 	{
-		h = (cardinal)r.cx >> 8;
+		h = (uint)r.cx >> 8;
 		m = r.cx % 256;
-		s = (cardinal)r.dx >> 8;
+		s = (uint)r.dx >> 8;
 	}
 	m = m * 60;
 	h = h * 3600;
@@ -285,7 +285,7 @@ void clsf10() {
 	else if (s.conf > 65)  st = "Malsaine";
 	if (res == 1)  co = 10;
 	else co = 6;
-	co = 574 - ((cardinal)co * length(st) >> 1);
+	co = 574 - ((uint)co * length(st) >> 1);
 	putxy(co, 92);
 	writeg(st, 4);
 	if (res == 1)  co = 620;
@@ -331,7 +331,7 @@ void calch(int &j, int &h, int &m) {
 	nh = readclock();
 	th = jh + ((nh - mh) / t);
 	m = ((th % 2) + vm) * 30;
-	h = ((cardinal)th >> 1) + vh;
+	h = ((uint)th >> 1) + vh;
 	if (m == 60) {
 		m = 0;
 		h = h + 1;
@@ -347,7 +347,7 @@ void conv(int x, int &y) {
 	cx = 1;
 	y = 128;
 	while (cx < x) {
-		y = (cardinal)y >> 1;
+		y = (uint)y >> 1;
 		cx = succ(int, cx);
 	}
 }
@@ -656,12 +656,12 @@ void pendule() {
 	paint_rect(578, 114, 6, 18);
 	if (set::of(cga, her, eos).has(gd))  co = 0;
 	else co = 1;
-	if (min == 0)  droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y - rg), co);
-	else droite(((cardinal)x >> 1)*res, y, ((cardinal)x >> 1)*res, (y + rg), co);
+	if (min == 0)  droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
+	else droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
 	h = heu;
 	if (h > 12)  h = h - 12;
 	if (h == 0)  h = 12;
-	droite(((cardinal)x >> 1)*res, y, ((cardinal)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
 	show_mouse();
 	putxy(568, 154);
 	if (heu > 11)  writeg("PM ", 1);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 0a00cc3..791920f 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -98,7 +98,7 @@ void hide_mouse() {
 		switch (gd) {
 		case cga : {
 			k = 0;
-			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
 				memw[0xb000 + j] = s_s[0][k];
 				memw[0xb800 + j + 2] = s_s[1][k];
@@ -150,7 +150,7 @@ void hide_mouse() {
 		}
 		break;
 		case her : {
-			j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; i ++) {
 				for (k = 0; k <= 3; k ++) memw[0xb000 + k * 0x200 + j] = s_s[i][k];
 				j = j + 80;
@@ -158,7 +158,7 @@ void hide_mouse() {
 		}
 		break;
 		case tan : {
-			j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 			k = 0;
 			do {
 				for (i = 0; i <= 3; i ++) {
@@ -189,7 +189,7 @@ void show_mouse() {
 	switch (gd) {
 	case cga : {
 		k = 0;
-		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 2);
+		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
 			s_s[0][k] = memw[0xb800 + j];
 			s_s[1][k] = memw[0xb800 + j + 2];
@@ -237,7 +237,7 @@ void show_mouse() {
 	}
 	break;
 	case her : {
-		j = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3);
+		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; i ++) {
 			for (k = 0; k <= 3; k ++) s_s[i][k] = memw[0xb000 + k * 0x200 + j];
 			j = j + 80;
@@ -245,7 +245,7 @@ void show_mouse() {
 	}
 	break;
 	case tan : {
-		j = ((cardinal)y_s >> 2) * 160 + ((cardinal)x_s >> 1);
+		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 		k = 0;
 		do {
 			for (i = 0; i <= 3; i ++) {
@@ -282,14 +282,14 @@ void pos_mouse(int x, int y) {
 	y_s = y;
 	switch (gd) {
 	case ams : {
-		p_o_s = ((cardinal)y_s >> 1) * 80 + ((cardinal)x_s >> 3) + (y_s & 1) * 0x2000;
+		p_o_s = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3) + (y_s & 1) * 0x2000;
 	}
 	break;
 	/*cga : begin
 	        P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
 	      end;*/
 	case ega : {
-		p_o_s = y_s * 80 + ((cardinal)x_s >> 3);
+		p_o_s = y_s * 80 + ((uint)x_s >> 3);
 	}
 	break;
 	}    /*  case Gd   */
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 8414969..adb0942 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -71,15 +71,15 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 
 	/* 5-8 */
 	oct = t_mot[ind];
-	oct = (cardinal)(oct << (16 - pt)) >> (16 - pt);
+	oct = (uint)(oct << (16 - pt)) >> (16 - pt);
 	if (pt < 6) {
 		ind = ind + 1;
 		oct = oct << (5 - pt);
 		pt = pt + 11;
-		oct = oct | ((cardinal)t_mot[ind] >> pt);
+		oct = oct | ((uint)t_mot[ind] >> pt);
 	} else {
 		pt = pt - 5;
-		oct = (cardinal)oct >> pt;
+		oct = (uint)oct >> pt;
 	}
 
 	switch (oct) {
@@ -91,15 +91,15 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 	case 30:
 	case 31 : {
 		ocd = t_mot[ind];
-		ocd = (cardinal)(ocd << (16 - pt)) >> (16 - pt);
+		ocd = (uint)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
 			ind = ind + 1;
 			ocd = ocd << (5 - pt);
 			pt = pt + 11;
-			ocd = ocd | ((cardinal)t_mot[ind] >> pt);
+			ocd = ocd | ((uint)t_mot[ind] >> pt);
 		} else {
 			pt = pt - 5;
-			ocd = (cardinal)ocd >> pt;
+			ocd = (uint)ocd >> pt;
 		}
 		if (oct == 30)  c = chr(tab30[ocd]);
 		else c = chr(tab31[ocd]);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 5198d7f..0985544 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -153,8 +153,8 @@ void ani50() {
 			nhom &with = palcga[j].a[i];
 
 			fb >> b;
-			with.n = (cardinal)b >> 4;
-			with.hom[0] = ((cardinal)b >> 2) & 3;
+			with.n = (uint)b >> 4;
+			with.hom[0] = ((uint)b >> 2) & 3;
 			with.hom[1] = b & 3;
 		}
 	}
@@ -236,7 +236,7 @@ void ani50() {
 	case '\1':
 	case '\3':
 	case '\5' :
-		gd = (cardinal)ord(ch) >> 1;
+		gd = (uint)ord(ch) >> 1;
 		break;
 	case '\10' :
 		gd = her;
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 3f92d78..c2c9222 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -30,13 +30,13 @@
 namespace Mortevielle {
 
 void spfrac(int wor) {
-	c3.rep = (cardinal)wor >> 12;
+	c3.rep = (uint)wor >> 12;
 	if ((typlec == 0) && (c3.code != 9))
 		if (((c3.code > 4) && (c3.val != 20) && !(set::of(3, 6, 9, eos).has(c3.rep))) ||
 		        ((c3.code < 5) && !(set::of(19, 22, eos).has(c3.val)) && !(set::of(4, 9, eos).has(c3.rep))))
 			c3.rep = c3.rep + 1;
-	c3.freq = ((cardinal)wor >> 6) & 7;
-	c3.acc = ((cardinal)wor >> 9) & 7;
+	c3.freq = ((uint)wor >> 6) & 7;
+	c3.acc = ((uint)wor >> 9) & 7;
 }
 
 void charg_car() {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 8685feb..ead9576 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -56,13 +56,13 @@ void trait_ph() {
 	ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
 	lefin = swap(t_cph[ptr_tcph + 1]) + deca[typlec];
 	nb_word = lefin - ledeb;
-	ptr_tcph = (cardinal)ledeb >> 1;
+	ptr_tcph = (uint)ledeb >> 1;
 	ptr_word = 0;
 	do {
 		memw[adword + ptr_word] = t_cph[ptr_tcph];
 		ptr_word = ptr_word + 2;
 		ptr_tcph = ptr_tcph + 1;
-	} while (!(ptr_tcph >= ((cardinal)lefin >> 1)));
+	} while (!(ptr_tcph >= ((uint)lefin >> 1)));
 
 	ptr_oct = 0;
 	ptr_word = 0;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 08b63fe..42977c4 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -267,7 +267,7 @@ void tecran() {
 		erase_menu();
 		imen = false;
 		if (set::of('\1', '\3', '\5', '\7', '\11', eos).has(inkey)) {
-			change_gd((cardinal)pred(int, ord(inkey)) >> 1);
+			change_gd((uint)pred(int, ord(inkey)) >> 1);
 			return;
 		}
 		if (choisi && (msg[3] == sauve))  sv_game(msg[4] & 7);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 0a19301..6a937e2 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -177,7 +177,7 @@ void taffich() {
 	if (gd == her) {
 		for (i = 0; i <= 15; i ++) {
 			palh = memw[0x7000 + (succ(int, i) << 1)];
-			alllum[i] = (palh & 15) + (((cardinal)palh >> 12) & 15) + (((cardinal)palh >> 8) & 15);
+			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (i = 0; i <= 15; i ++) {
 			k = 0;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 89ebda4..9bd43be 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -297,7 +297,7 @@ void hirs() {
 /* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */
 
 void affcar(int gd, int x, int y, int coul, int chr) {
-	if (res == 1)  affput(1, gd, ((cardinal)x >> 1), y, coul, chr);
+	if (res == 1)  affput(1, gd, ((uint)x >> 1), y, coul, chr);
 	else affput(1, gd, x, y, coul, chr);
 }
 


Commit: dd64a3962b1bc1fa6f079cae0cec8ecb706fd05b
    https://github.com/scummvm/scummvm/commit/dd64a3962b1bc1fa6f079cae0cec8ecb706fd05b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:49-07:00

Commit Message:
MORTEVIELLE: Compilation fixes and extern prefixes to header file method declarations

Changed paths:
    engines/mortevielle/actions.h
    engines/mortevielle/alert.cpp
    engines/mortevielle/alert.h
    engines/mortevielle/boite.h
    engines/mortevielle/disk.h
    engines/mortevielle/droite.h
    engines/mortevielle/keyboard.h
    engines/mortevielle/level15.h
    engines/mortevielle/menu.h
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.h
    engines/mortevielle/mort.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.h
    engines/mortevielle/parole.h
    engines/mortevielle/parole2.h
    engines/mortevielle/prog.h
    engines/mortevielle/ques.h
    engines/mortevielle/sprint.h
    engines/mortevielle/taffich.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index 690de1d..904a58d 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -31,38 +31,38 @@
 namespace Mortevielle {
 
 /* NIVEAU 4 */
-void taller();
-void tprendre();
-void tsprendre();
-void tsoulever();
-void tlire();
-void tslire();
-void tregarder();
-void tsregarder();
-void tfouiller();
-void tsfouiller();
-void touvrir();
-void tmettre();
-void ttourner();
-void tcacher();
-void tattacher();
-void tfermer();
-void tfrapper();
-void tposer();
-void tecouter();
-void tmanger();
-void tentrer();
-void tdormir();
-void tdefoncer();
-void tsortir();
-void tattendre();
-void tsonder();
-void tparler();
-void tsentir();
-void tgratter();
+extern void taller();
+extern void tprendre();
+extern void tsprendre();
+extern void tsoulever();
+extern void tlire();
+extern void tslire();
+extern void tregarder();
+extern void tsregarder();
+extern void tfouiller();
+extern void tsfouiller();
+extern void touvrir();
+extern void tmettre();
+extern void ttourner();
+extern void tcacher();
+extern void tattacher();
+extern void tfermer();
+extern void tfrapper();
+extern void tposer();
+extern void tecouter();
+extern void tmanger();
+extern void tentrer();
+extern void tdormir();
+extern void tdefoncer();
+extern void tsortir();
+extern void tattendre();
+extern void tsonder();
+extern void tparler();
+extern void tsentir();
+extern void tgratter();
 /* NIVEAU 2 */
-void tmaj1();
-void tencore();
+extern void tmaj1();
+extern void tencore();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index c939da6..45c1b35 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -25,8 +25,9 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "mortevielle/alert.h"
 #include "common/str.h"
+#include "mortevielle/alert.h"
+#include "mortevielle/level15.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
index 4c53b14..f7a9e7d 100644
--- a/engines/mortevielle/alert.h
+++ b/engines/mortevielle/alert.h
@@ -32,8 +32,8 @@
 
 namespace Mortevielle {
 
-int do_alert(Common::String str_, int n);
-int do_alert(Common::String str_, int n);
+extern int do_alert(Common::String str_, int n);
+extern int do_alert(Common::String str_, int n);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
index d0e7b0e..d4a1d1e 100644
--- a/engines/mortevielle/boite.h
+++ b/engines/mortevielle/boite.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-void boite(int x, int y, int dx, int dy, int coul);
+extern void boite(int x, int y, int dx, int dy, int coul);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
index 464c3b7..06df8e0 100644
--- a/engines/mortevielle/disk.h
+++ b/engines/mortevielle/disk.h
@@ -30,10 +30,10 @@
 
 namespace Mortevielle {
 
-void dem1();
-void takesav(int n);
-void ld_game(int n);
-void sv_game(int n);
+extern void dem1();
+extern void takesav(int n);
+extern void ld_game(int n);
+extern void sv_game(int n);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
index 73ed30d..6017f48 100644
--- a/engines/mortevielle/droite.h
+++ b/engines/mortevielle/droite.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-void droite(int x, int y, int xx, int yy, int coul);
+extern void droite(int x, int y, int xx, int yy, int coul);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
index fbef23f..7b2510f 100644
--- a/engines/mortevielle/keyboard.h
+++ b/engines/mortevielle/keyboard.h
@@ -30,9 +30,9 @@
 
 namespace Mortevielle {
 
-char readkey1();
-int testou();
-void teskbd();
+extern char readkey1();
+extern int testou();
+extern void teskbd();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index 73a9d3f..aee94c9 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -28,25 +28,27 @@
 #ifndef MORTEVIELLE_LEVEL15_H
 #define MORTEVIELLE_LEVEL15_H
 
+#include "mortevielle/var_mor.h"
+
 namespace Mortevielle {
 
 /* NIVEAU 15 */
-void copcha();
-bool dans_rect(rectangle r);
-void outbloc(int n, pattern p, t_nhom pal);
-void writepal(int n);
-void pictout(int seg, int dep, int x, int y);
-void putxy(int x, int y);
-// int calad(int x, int y);
-void sauvecr(int y, int dy);
-void charecr(int y, int dy);
-// int peek(int ad);
-// int peekw(int ad);
-// real peekl(int ad);
-// void procedure poke(int ad, int n);
-void adzon();
-int animof(int ouf, int num);
-// void affgd(int offs, int dep, int x, int y);
+extern void copcha();
+extern bool dans_rect(rectangle r);
+extern void outbloc(int n, pattern p, t_nhom pal);
+extern void writepal(int n);
+extern void pictout(int seg, int dep, int x, int y);
+extern void putxy(int x, int y);
+// extern int calad(int x, int y);
+extern void sauvecr(int y, int dy);
+extern void charecr(int y, int dy);
+// extern int peek(int ad);
+// extern int peekw(int ad);
+// extern real peekl(int ad);
+// extern void procedure poke(int ad, int n);
+extern void adzon();
+extern int animof(int ouf, int num);
+// extern void affgd(int offs, int dep, int x, int y);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 2b548a2..1ea6931 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -33,17 +33,17 @@
 namespace Mortevielle {
 
 /* NIVEAU 14*/
-void menut(int no, Common::String nom);
-void menu_disable(int no);
-void menu_enable(int no);
-void menu_aff();
-void draw_menu();
-void invers(int ix);
-void util(int x, int y);
-void menu_down(int ii);
-void menu_up(int xx);
-void erase_menu();
-void mdn();
+extern void menut(int no, Common::String nom);
+extern void menu_disable(int no);
+extern void menu_enable(int no);
+extern void menu_aff();
+extern void draw_menu();
+extern void invers(int ix);
+extern void util(int x, int y);
+extern void menu_down(int ii);
+extern void menu_up(int xx);
+extern void erase_menu();
+extern void mdn();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 88e718b..cabc3c4 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -33,95 +33,95 @@
 namespace Mortevielle {
 
 /* Niveau 14 suite */
-void testfi();
-int readclock();
-void modif(int &nu);
-void dessine(int ad, int x, int y);
-void dessine_rouleau();
-void text_color(int c);
+extern void testfi();
+extern int readclock();
+extern void modif(int &nu);
+extern void dessine(int ad, int x, int y);
+extern void dessine_rouleau();
+extern void text_color(int c);
 /* NIVEAU 13 */
-void text1(int x, int y, int nb, int m);
-void initouv();
-void ecrf1();
-void clsf1();
-void clsf2();
-void ecrf2();
-void ecr2(Common::String str_);
-void clsf3();
-void ecr3(Common::String text);
-void ecrf6();
-void ecrf7();
-void clsf10();
-void stop();
-void paint_rect(int x, int y, int dx, int dy);
-int hazard(int min, int max);
-void calch(int &j, int &h, int &m);
-void conv(int x, int &y);
+extern void text1(int x, int y, int nb, int m);
+extern void initouv();
+extern void ecrf1();
+extern void clsf1();
+extern void clsf2();
+extern void ecrf2();
+extern void ecr2(Common::String str_);
+extern void clsf3();
+extern void ecr3(Common::String text);
+extern void ecrf6();
+extern void ecrf7();
+extern void clsf10();
+extern void stop();
+extern void paint_rect(int x, int y, int dx, int dy);
+extern int hazard(int min, int max);
+extern void calch(int &j, int &h, int &m);
+extern void conv(int x, int &y);
 /* NIVEAU 12 */
-void okpas();
-void modobj(int m);
-void modobj2(int m, bool t1, bool t2);
-void repon(int f, int m);
-void f3f8();
-void t5(int cx);
-void affper(int per);
-void choix(int min, int max, int &per);
-void cpl1(int &p);
-void cpl2(int &p);
-void cpl3(int &p);
-void cpl5(int &p);
-void cpl6(int &p);
-void person();
-void chlm(int &per);
-void pendule();
+extern void okpas();
+extern void modobj(int m);
+extern void modobj2(int m, bool t1, bool t2);
+extern void repon(int f, int m);
+extern void f3f8();
+extern void t5(int cx);
+extern void affper(int per);
+extern void choix(int min, int max, int &per);
+extern void cpl1(int &p);
+extern void cpl2(int &p);
+extern void cpl3(int &p);
+extern void cpl5(int &p);
+extern void cpl6(int &p);
+extern void person();
+extern void chlm(int &per);
+extern void pendule();
 /*************
  * NIVEAU 11 *
  *************/
-void debloc(int l);
-void cpl10(int &p, int &h);
-void cpl11(int &p, int &h);
-void cpl12(int &p);
-void cpl13(int &p);
-void cpl15(int &p);
-void cpl20(int &p, int &h);
-void quelq1(int l);
-void quelq2();
-void quelq5();
-void quelq6(int l);
-void quelq10(int h, int &per);
-void quelq11(int h, int &per);
-void quelq12(int &per);
-void quelq15(int &per);
-void quelq20(int h, int &per);
-void frap();
-void nouvp(int l, int &p);
-void tip(int ip, int &cx);
-void ecfren(int &p, int &haz, int cf, int l);
-void becfren(int l);
+extern void debloc(int l);
+extern void cpl10(int &p, int &h);
+extern void cpl11(int &p, int &h);
+extern void cpl12(int &p);
+extern void cpl13(int &p);
+extern void cpl15(int &p);
+extern void cpl20(int &p, int &h);
+extern void quelq1(int l);
+extern void quelq2();
+extern void quelq5();
+extern void quelq6(int l);
+extern void quelq10(int h, int &per);
+extern void quelq11(int h, int &per);
+extern void quelq12(int &per);
+extern void quelq15(int &per);
+extern void quelq20(int h, int &per);
+extern void frap();
+extern void nouvp(int l, int &p);
+extern void tip(int ip, int &cx);
+extern void ecfren(int &p, int &haz, int cf, int l);
+extern void becfren(int l);
 /* NIVEAU 10 */
-void init_nbrepm();
-void phaz(int &haz, int &p, int cf);
-void inzon();
-void dprog();
-void pl1(int cf);
-void pl2(int cf);
-void pl5(int cf);
-void pl6(int cf);
-void pl9(int cf);
-void pl10(int cf);
-void pl11(int cf);
-void pl12(int cf);
-void pl13(int cf);
-void pl15(int cf);
-void pl20(int cf);
-void t11(int l11, int &a);
-void cavegre();
-void writetp(Common::String s, int t);
-void messint(int nu);
-void aniof(int ouf, int num);
-void musique(int so);
+extern void init_nbrepm();
+extern void phaz(int &haz, int &p, int cf);
+extern void inzon();
+extern void dprog();
+extern void pl1(int cf);
+extern void pl2(int cf);
+extern void pl5(int cf);
+extern void pl6(int cf);
+extern void pl9(int cf);
+extern void pl10(int cf);
+extern void pl11(int cf);
+extern void pl12(int cf);
+extern void pl13(int cf);
+extern void pl15(int cf);
+extern void pl20(int cf);
+extern void t11(int l11, int &a);
+extern void cavegre();
+extern void writetp(Common::String s, int t);
+extern void messint(int nu);
+extern void aniof(int ouf, int num);
+extern void musique(int so);
 /* NIVEAU 9 */
-void dessin(int ad);
+extern void dessin(int ad);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index a1732a1..6668d54 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -30,52 +30,52 @@
 
 namespace Mortevielle {
 
-void tinke();
-void fenat(char ans);
+extern void tinke();
+extern void fenat(char ans);
 /* NIVEAU 8 */
-void afdes(int ad);
-void tkey1(bool d);
-void tmlieu(int mli);
+extern void afdes(int ad);
+extern void tkey1(bool d);
+extern void tmlieu(int mli);
 /* NIVEAU 7 */
-void tlu(int af, int ob);
-void delin(int n);
-void affrep();
-void mfouen();
-void atf3f8(int &key);
+extern void tlu(int af, int ob);
+extern void delin(int n);
+extern void affrep();
+extern void mfouen();
+extern void atf3f8(int &key);
 /* NIVEAU 6 */
-void tperd();
-void tsort();
-void st4(int ob);
-void cherjer(int ob, bool &d);
-void st1sama();
-void modinv();
-void sparl(float adr, float rep);
-void finfouil();
-void mfoudi();
-void mennor();
-void premtet();
+extern void tperd();
+extern void tsort();
+extern void st4(int ob);
+extern void cherjer(int ob, bool &d);
+extern void st1sama();
+extern void modinv();
+extern void sparl(float adr, float rep);
+extern void finfouil();
+extern void mfoudi();
+extern void mennor();
+extern void premtet();
 /* NIVEAU 5 */
-void ajchai();
-void ajjer(int ob);
-void t1sama();
-void t1vier();
-void t1neig();
-void t1deva();
-void t1derr();
-void t1deau();
-void tctrm();
-void quelquun();
-void tsuiv();
-void tfleche();
-void tcoord(int sx);
-void st7(int ob);
-void treg(int ob);
-void avpoing(int &ob);
-void rechai(int &ch);
-void t23coul(int &l);
-void maivid();
-void st13(int ob);
-void aldepl();
+extern void ajchai();
+extern void ajjer(int ob);
+extern void t1sama();
+extern void t1vier();
+extern void t1neig();
+extern void t1deva();
+extern void t1derr();
+extern void t1deau();
+extern void tctrm();
+extern void quelquun();
+extern void tsuiv();
+extern void tfleche();
+extern void tcoord(int sx);
+extern void st7(int ob);
+extern void treg(int ob);
+extern void avpoing(int &ob);
+extern void rechai(int &ch);
+extern void t23coul(int &l);
+extern void maivid();
+extern void st13(int ob);
+extern void aldepl();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
index 0b78deb..fa42288 100644
--- a/engines/mortevielle/mort.h
+++ b/engines/mortevielle/mort.h
@@ -30,9 +30,9 @@
 
 namespace Mortevielle {
 
-void divers(int np, bool b);
+extern void divers(int np, bool b);
 /* NIVEAU 0 */
-int main(int argc, const char *argv[]);
+extern int main(int argc, const char *argv[]);
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 791920f..a6b1768 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -336,7 +336,7 @@ void mov_mouse(bool &funct, char &key) {
 	while (p_key) {
 		input >> kbd >> in1;
 		read_pos_mouse(cx, cy, cd);
-		switch (upcase(in1)) {
+		switch (toupper(in1)) {
 		case '4' :
 			cx = cx - 8;
 			break;
@@ -382,6 +382,13 @@ void mov_mouse(bool &funct, char &key) {
 		break;
 		case '\33' : {
 			p_key = keypressed();
+
+			if ((p_key >= ';') && (p_key <= 'D')) {
+				funct = true;
+				key = in2;
+				return;
+			}
+
 			if (p_key) {
 				input >> kbd >> in2;
 				switch (in2) {
@@ -397,12 +404,6 @@ void mov_mouse(bool &funct, char &key) {
 				case 'H' :
 					cy = pred(int, cy);
 					break;
-				case RANGE_10(';', 'D') : {
-					funct = true;
-					key = in2;
-					return;
-				}
-				break;
 				case 'G' : {
 					cx = cx - 1;
 					cy = cy - 1;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 90fe91e..33fd280 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -31,13 +31,13 @@
 namespace Mortevielle {
 
 void init_mouse();
-//void change_mouse(int t);
-//void dessine_souris(int xf, int yf);
-void hide_mouse();
-void show_mouse();
-void pos_mouse(int x, int y);
-void read_pos_mouse(int &x, int &y, int &c);
-void mov_mouse(bool &funct, char &key);
+//extern void change_mouse(int t);
+//extern void dessine_souris(int xf, int yf);
+extern void hide_mouse();
+extern void show_mouse();
+extern void pos_mouse(int x, int y);
+extern void read_pos_mouse(int &x, int &y, int &c);
+extern void mov_mouse(bool &funct, char &key);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 14ef8c6..45b5745 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -32,10 +32,10 @@
 
 namespace Mortevielle {
 
-static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
-void deline(int num , char *l , int &tl);
-static int l_motsuiv(int p, char *ch, int &tab);
-void afftex(char *ch, int x, int y, int dx, int dy, int typ);
+//static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
+extern void deline(int num , char *l , int &tl);
+//static int l_motsuiv(int p, char *ch, int &tab);
+extern void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 4cad37c..96239ed 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -30,20 +30,20 @@
 
 namespace Mortevielle {
 
-void dem2();
-void ani50();
-//void apzuul();
-void aff50(bool c);
-void init_menu();
-void charpal();
-void chartex();
-void dialpre();
-void init_lieu();
-void music();
-void charge_bruit5();
-void charge_cfiec();
-void charge_cfiph();
-void suite();
+extern void dem2();
+extern void ani50();
+//extern void apzuul();
+extern void aff50(bool c);
+extern void init_menu();
+extern void charpal();
+extern void chartex();
+extern void dialpre();
+extern void init_lieu();
+extern void music();
+extern void charge_bruit5();
+extern void charge_cfiec();
+extern void charge_cfiph();
+extern void suite();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
index b0282e1..daea40c 100644
--- a/engines/mortevielle/parole.h
+++ b/engines/mortevielle/parole.h
@@ -30,16 +30,16 @@
 
 namespace Mortevielle {
 
-void spfrac(int wor);
-void charg_car();
-void entroct(byte o);
-void veracf(byte b);
-void cctable(tablint &t);
-void regenbruit();
-void charge_son();
-void charge_phbruit();
-void charge_bruit();
-void trait_car();
+extern void spfrac(int wor);
+extern void charg_car();
+extern void entroct(byte o);
+extern void veracf(byte b);
+extern void cctable(tablint &t);
+extern void regenbruit();
+extern void charge_son();
+extern void charge_phbruit();
+extern void charge_bruit();
+extern void trait_car();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/parole2.h b/engines/mortevielle/parole2.h
index ed7108f..01cf277 100644
--- a/engines/mortevielle/parole2.h
+++ b/engines/mortevielle/parole2.h
@@ -30,10 +30,10 @@
 
 namespace Mortevielle {
 
-void rot_chariot();
-void init_chariot();
-void trait_ph();
-void parole(int rep, int ht, int typ);
+extern void rot_chariot();
+extern void init_chariot();
+extern void trait_ph();
+extern void parole(int rep, int ht, int typ);
 
 } // End of namespace Mortevielle
 
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
index 4fccca4..fbcd92f 100644
--- a/engines/mortevielle/prog.h
+++ b/engines/mortevielle/prog.h
@@ -30,18 +30,18 @@
 
 namespace Mortevielle {
 
-void change_gd(int ngd);
-void antegame();
+extern void change_gd(int ngd);
+extern void antegame();
 
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
-void tmaj3();
-void tsitu();
-void tecran();
+extern void tmaj3();
+extern void tsitu();
+extern void tecran();
 
 /* NIVEAU 1 */
-void theure();
-void tjouer();
+extern void theure();
+extern void tjouer();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/ques.h b/engines/mortevielle/ques.h
index f748d3e..7260bfa 100644
--- a/engines/mortevielle/ques.h
+++ b/engines/mortevielle/ques.h
@@ -32,7 +32,7 @@
 
 namespace Mortevielle {
 
-bool ques();
+extern bool ques();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
index 42259f0..8484214 100644
--- a/engines/mortevielle/sprint.h
+++ b/engines/mortevielle/sprint.h
@@ -32,8 +32,9 @@
 
 namespace Mortevielle {
 
-void fill_box(int x, int y, int dx);
-void clear_box(int x, int y, int dx);
-void writeg(Common::String l, int c);
+extern void fill_box(int x, int y, int dx);
+extern void clear_box(int x, int y, int dx);
+extern void writeg(Common::String l, int c);
+
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
index 41f0612..bea3c09 100644
--- a/engines/mortevielle/taffich.h
+++ b/engines/mortevielle/taffich.h
@@ -32,9 +32,10 @@
 
 namespace Mortevielle {
 
-void chardes(Common::String nom, float passe, int long_);
-void charani(Common::String nom, float passe, int long_);
-void taffich();
+extern void chardes(Common::String nom, float passe, int long_);
+extern void charani(Common::String nom, float passe, int long_);
+extern void taffich();
+
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 59d98fe..6b4ae2f 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -41,6 +41,12 @@ namespace Mortevielle {
                                                   musique & paroles Oct 88 )
                                                                              */
 
+/*---------------------------------------------------------------------------*/
+/*-------------------------     DEFINES    ----------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+#define pred(type, v) (v - 1)
+#define succ(type, v) (v + 1)
 
 /*---------------------------------------------------------------------------*/
 /*-------------------------    CONSTANTS   ----------------------------------*/


Commit: dcd1b5c604c4d409ac92e188e3fbb239f735ae55
    https://github.com/scummvm/scummvm/commit/dcd1b5c604c4d409ac92e188e3fbb239f735ae55
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:50-07:00

Commit Message:
MORTEVIELLE: Compilation fixes based on adding appropriate #include files

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/parole.h
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index ddfd432..146542a 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/scummsys.h"
 #include "mortevielle/actions.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/mor.h"
@@ -349,7 +350,7 @@ L2:
 }
 
 /* overlay */ void tfouiller() {
-	const byte[14] r = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
+	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 	int cx;
 
 	if (caff > 99) {
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 45c1b35..1c7ae91 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -101,23 +101,23 @@ static void fait_boite(int lidep, int nli, int tx) {
 
 
 
-static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String[] &s, int &esp) {
+static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String *&str, int &esp) {
 	int i, l, x;
 	char ch;
 
 	i = 1;
 	x = coldep;
 	for (l = 1; l <= nbcase; l ++) {
-		s[l] = "";
+		str[l] = "";
 		do {
 			i = i + 1;
 			ch = c[i];
-			s[l] = s[l] + ch;
+			str[l] = str[l] + ch;
 		} while (!(c[i + 1] == ']'));
 		i = i + 2;
-		while (length(s[l]) < 3)  s[l] = s[l] + ' ';
+		while (length(str[l]) < 3)  str[l] = str[l] + ' ';
 		putxy(x, 98);
-		writeg(string(' ') + s[l] + ' ', 0);
+		writeg(string(' ') + str[l] + ' ', 0);
 		x = x + esp + 40;
 	}
 }
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index ddb78cb..44af522 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/keyboard.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index e00d8b9..69fc651 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -25,8 +25,11 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "mortevielle/menu.h"
+#include "common/scummsys.h"
 #include "common/str.h"
+#include "common/textconsole.h"
+#include "mortevielle/menu.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
@@ -43,7 +46,7 @@ namespace Mortevielle {
 	s = nom;
 	if (! tesok) {
 		clrscr;
-		exit(0);
+		mortevielle_exit(0);
 	}
 	while (length(s) < 30)  s = s + ' ';
 	switch (h) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 75add66..195c626 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -25,11 +25,12 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+#include "common/textconsole.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/var_mor.h"
-#include "common/str.h"
 
 namespace Mortevielle {
 
@@ -40,7 +41,7 @@ const char m1[] = "quelqu'un entre, parait 
 void testfi() {
 	if (ioresult != 0) {
 		caff = do_alert(err_mess, 1);
-		exit(0);
+		mortevielle_exit(0);
 	}
 }
 
@@ -300,7 +301,7 @@ void stop() {
 	hirs();
 	gd = ams;
 	hirs();
-	exit(0);
+	mortevielle_exit(0);
 }
 
 void paint_rect(int x, int y, int dx, int dy) {
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
index daea40c..a1467dc 100644
--- a/engines/mortevielle/parole.h
+++ b/engines/mortevielle/parole.h
@@ -28,6 +28,8 @@
 #ifndef MORTEVIELLE_PAROLE_H
 #define MORTEVIELLE_PAROLE_H
 
+#include "common/scummsys.h"
+
 namespace Mortevielle {
 
 extern void spfrac(int wor);
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index ead9576..b5079f9 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/parole2.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 42977c4..f7f1e0e 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -27,6 +27,7 @@
 
 #include "mortevielle/mor2.h"
 #include "mortevielle/prog.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 6209b08..9df1a18 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -25,9 +25,10 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
-#include "common/str.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 6b4ae2f..fa25962 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -47,6 +47,10 @@ namespace Mortevielle {
 
 #define pred(type, v) (v - 1)
 #define succ(type, v) (v + 1)
+#define ord(v) ((int) v)
+
+// TODO: Replace with a cleaner shutdown mechanism
+#define mortevielle_exit(ret) error("Exit the game")
 
 /*---------------------------------------------------------------------------*/
 /*-------------------------    CONSTANTS   ----------------------------------*/


Commit: aeff6055e01796b3381564b078b4cb66fe8d6a64
    https://github.com/scummvm/scummvm/commit/aeff6055e01796b3381564b078b4cb66fe8d6a64
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:52-07:00

Commit Message:
MORTEVIELLE: Further bugfixes to include files and added includes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.h
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 146542a..359857e 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -986,7 +986,7 @@ L2:
 /* overlay */ void tparler()
 
 {
-	array<1, 46, bool> te;
+	bool te[47];
 	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
 	char tou;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index b6c3ee9..50d1245 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -27,6 +27,8 @@
 
 #include "mortevielle/mor2.h"
 #include "mortevielle/var_mor.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 33fd280..2a22d04 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -30,6 +30,8 @@
 
 namespace Mortevielle {
 
+extern bool clic;
+
 void init_mouse();
 //extern void change_mouse(int t);
 //extern void dessine_souris(int xf, int yf);
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 45b5745..ad69ca9 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -32,6 +32,8 @@
 
 namespace Mortevielle {
 
+extern Common::String delig;
+
 //static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
 extern void deline(int num , char *l , int &tl);
 //static int l_motsuiv(int p, char *ch, int &tab);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 6a937e2..85b2157 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -25,8 +25,9 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "mortevielle/taffich.h"
 #include "common/str.h"
+#include "mortevielle/taffich.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index fa25962..88b42a8 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -49,8 +49,9 @@ namespace Mortevielle {
 #define succ(type, v) (v + 1)
 #define ord(v) ((int) v)
 
-// TODO: Replace with a cleaner shutdown mechanism
+// TODO: Replace the following with proper implementations
 #define mortevielle_exit(ret) error("Exit the game")
+#define clrscr {}
 
 /*---------------------------------------------------------------------------*/
 /*-------------------------    CONSTANTS   ----------------------------------*/
@@ -222,6 +223,8 @@ struct nhom {
 	byte hom[4];
 };
 
+typedef nhom t_nhom[16];
+
 struct t_pcga {
 	byte p;
 	nhom a[16];


Commit: 73768939684fcc0bf567a9a4830c0e0b7b335ea5
    https://github.com/scummvm/scummvm/commit/73768939684fcc0bf567a9a4830c0e0b7b335ea5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:53-07:00

Commit Message:
MORTEVIELLE: Replaced all set::of forms with proper C if statements

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 359857e..ff986a9 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1051,7 +1051,7 @@ L2:
 			if (x > 319)  cx = 41;
 			else cx = 1;
 			cy = succ(int, (uint)y >> 3);                  /* 0-199 => 1-25 */
-			if ((cy > 23) || ((cx == 41) && (set::of(range(20, 22), eos).has(cy)))) {
+			if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
 					if (choi > 23)  co = 320;
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 1c7ae91..d003ccb 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -151,7 +151,7 @@ int do_alert(Common::String str_, int n) {
 		do {
 			cx = 320;
 			st = "";
-			while (!(set::of('\174', '\135', eos).has(chaine[i + 1]))) {
+			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
 				i = i + 1;
 				st = st + chaine[i];
 				if (res == 2)  cx = cx - 3;
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 44af522..701f99c 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -69,7 +69,7 @@ int testou() {
 	}
 	break;
 	case '\26' :
-		if (set::of(1, 2, eos).has(c_zzz)) {
+		if ((c_zzz == 1) && (c_zzz == 2)) {
 			zzuul(adcfiec + 161, 0, 1644);
 			c_zzz = succ(int, c_zzz);
 			testou_result = 61;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 69fc651..df40856 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -327,7 +327,8 @@ void mdn() {
 			xprec = x;
 			yprec = y;
 		}
-		tes = (y < 11) && ((set::of(range(28 * res, 28 * res + 24), range(76 * res, 76 * res + 24), eos).has(x))
+		tes = (y < 11) && ((x >= (28 * res) && x <= (28 * res + 24)) 
+						   || (x >= (76 * res) && x <= (76 * res + 24))
 		                   || ((x > 124 * res) && (x < 124 * res + 24))
 		                   || ((x > 172 * res) && (x < 172 * res + 24))
 		                   || ((x > 220 * res) && (x < 220 * res + 24))
@@ -340,7 +341,7 @@ void mdn() {
 			else if (x < 268 * res)  ix = discut;
 			else ix = fichier;
 			if ((ix != msg3) || (! test0))
-				if (!((ix == fichier) && (set::of(sauve, charge, eos).has(msg3)))) {
+				if (!((ix == fichier) && ((msg3 == sauve) || (msg3 == charge)))) {
 					menu_up(msg3);
 					menu_down(ix);
 					msg3 = ix;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 195c626..f8454e6 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -422,7 +422,7 @@ void repon(int f, int m) {
 				}
 			}
 		}
-		if (set::of(6, 9, eos).has(f)) {
+		if ((f >= 6) && (f <= 9)) {
 			deline(m, st, tay);
 			if (f == 6)  i = 4;
 			else i = 5;
@@ -655,7 +655,8 @@ void pendule() {
 	paint_rect(577,114,6,20);*/
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
-	if (set::of(cga, her, eos).has(gd))  co = 0;
+	if ((gd == cga) || (gd == her))
+		co = 0;
 	else co = 1;
 	if (min == 0)  droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
 	else droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
@@ -668,7 +669,8 @@ void pendule() {
 	if (heu > 11)  writeg("PM ", 1);
 	else writeg("AM ", 1);
 	putxy(550, 160);
-	if (set::of(range(0, 8), eos).has(jou))  writeg(string(chr(jou + 49)) + "& jour", 1);
+	if ((jou >= 0) && (jou <= 8))
+		writeg(string(chr(jou + 49)) + "& jour", 1);
 }
 
 /*************
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index adb0942..ba0c956 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -149,7 +149,8 @@ static int l_motsuiv(int p, char *ch, int &tab) {
 
 	int l_motsuiv_result;
 	c = p;
-	while (!(set::of(' ', '$', '@', eos).has(ch[p])))  p = p + 1;
+	while ((ch[p] != ' ') && (ch[p] != '$') && (ch[p] != '@'))
+		++p;
 	l_motsuiv_result = tab * (p - c);
 	return l_motsuiv_result;
 }
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 0985544..906600f 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -231,7 +231,7 @@ void ani50() {
 	output << "Ctrl       C      E            H             T           A";
 	do {
 		input >> kbd >> ch;
-	} while (!(set::of('\1', '\3', '\5', '\24', '\10', eos).has(ch)));
+	} while ((ch != '\1') && (ch != '\3') && (ch != '\5') && (ch != '\24') && (ch != '\10'));
 	switch (ch) {
 	case '\1':
 	case '\3':
@@ -258,7 +258,7 @@ void ani50() {
 	output << 'S';
 	do {
 		input >> kbd >> ch;
-	} while (!(set::of('C', 'S', eos).has(upcase(ch))));
+	} while ((ch != 'C') && (ch != 'S'));
 	int_m = (upcase(ch) == 'S');
 }
 
@@ -361,7 +361,8 @@ void ani50() {
 	gotoxy(20 * pred(int, res) + 8, 24);
 	textcolor(7);
 	cpr = "COPYRIGHT 1989 : LANKHOR";
-	if (set::of(ega, ams, cga, eos).has(gd))  output << cpr;
+	if ((gd == ega) || (gd == ams) || (gd == cga))
+		output << cpr;
 	else {
 		putxy(104 + 72 * res, 190);
 		writeg(cpr, 0);
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index c2c9222..6c8f598 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -32,8 +32,8 @@ namespace Mortevielle {
 void spfrac(int wor) {
 	c3.rep = (uint)wor >> 12;
 	if ((typlec == 0) && (c3.code != 9))
-		if (((c3.code > 4) && (c3.val != 20) && !(set::of(3, 6, 9, eos).has(c3.rep))) ||
-		        ((c3.code < 5) && !(set::of(19, 22, eos).has(c3.val)) && !(set::of(4, 9, eos).has(c3.rep))))
+		if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
+				((c3.code < 5) && ((c3.rep != 19) && (c3.rep != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
 			c3.rep = c3.rep + 1;
 	c3.freq = ((uint)wor >> 6) & 7;
 	c3.acc = ((uint)wor >> 9) & 7;
@@ -346,7 +346,7 @@ void veracf(byte b) {
 			entroct(d3);
 			entroct(c2.val);
 			entroct(5);
-		} else if (!(set::of(range(0, 1), 4, eos).has(c3.code))) {
+		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
 			veracf(c3.acc);
 			switch (c3.code) {
 			case 3 :
@@ -388,7 +388,7 @@ void veracf(byte b) {
 			entroct(2);
 			entroct(c2.val);
 			entroct(5);
-		} else if (!(set::of(range(0, 1), 4, eos).has(c3.code))) {
+		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
 			veracf(c3.acc);
 			switch (c3.code) {
 			case 3 :
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index f7f1e0e..d5004cd 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -267,7 +267,7 @@ void tecran() {
 
 		erase_menu();
 		imen = false;
-		if (set::of('\1', '\3', '\5', '\7', '\11', eos).has(inkey)) {
+		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
 			change_gd((uint)pred(int, ord(inkey)) >> 1);
 			return;
 		}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 85b2157..6d6df69 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -109,8 +109,10 @@ void taffich() {
 
 
 	a = caff;
-	if (set::of(range(153, 161), eos).has(a))  a = tran2[a];
-	else if (set::of(range(136, 140), eos).has(a))  a = tran1[a];
+	if ((a >= 153) && (a <= 161))
+		a = tran2[a];
+	else if ((a >= 136) && (a <= 140))
+		a = tran1[a];
 	b = a;
 	if (maff == a)  return;
 	if (a == 16) {


Commit: d1a2a7a8b5c9a38bb29d47cec60a414b9bbc0733
    https://github.com/scummvm/scummvm/commit/d1a2a7a8b5c9a38bb29d47cec60a414b9bbc0733
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:54-07:00

Commit Message:
MORTEVIELLE: More addition of needed #include lines and other compilation fixes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index ff986a9..b9626b3 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -28,10 +28,12 @@
 #include "common/scummsys.h"
 #include "mortevielle/actions.h"
 #include "mortevielle/alert.h"
+#include "mortevielle/level15.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
+#include "mortevielle/parole2.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index d003ccb..c35ba4f 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -28,6 +28,7 @@
 #include "common/str.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/mouse.h"
 
 namespace Mortevielle {
 
@@ -35,12 +36,12 @@ namespace Mortevielle {
 
 
 const int nligne = 7;
-const matrix<1, 2, 1, 3, int> coord
-= {{ {{150, 72, 103}},
-		{{143, 107, 183}}
-	}
-};
 
+const int coord[3][4] = {
+	{0, 0, 0, 0},
+	{0, 150, 72, 103),
+	{0, 143, 107, 183}
+};
 
 
 static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
@@ -115,7 +116,7 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
 			str[l] = str[l] + ch;
 		} while (!(c[i + 1] == ']'));
 		i = i + 2;
-		while (length(str[l]) < 3)  str[l] = str[l] + ' ';
+		while (str[l].size() < 3)  str[l] = str[l] + ' ';
 		putxy(x, 98);
 		writeg(string(' ') + str[l] + ' ', 0);
 		x = x + esp + 40;
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 42219ee..e7a9c21 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -27,6 +27,7 @@
 
 #include "mortevielle/level15.h"
 #include "mortevielle/var_mor.h"
+#include "mortevielle/mouse.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index df40856..083a16d 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -28,7 +28,9 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 #include "common/textconsole.h"
+#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -48,7 +50,7 @@ namespace Mortevielle {
 		clrscr;
 		mortevielle_exit(0);
 	}
-	while (length(s) < 30)  s = s + ' ';
+	while (s.size() < 30)  s = s + ' ';
 	switch (h) {
 	case invent  :
 		if (l != 7)  inv[l] = string(' ') + s;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index f8454e6..b4e3fb3 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -28,8 +28,14 @@
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
+#include "mortevielle/boite.h"
+#include "mortevielle/droite.h
+#include "mortevielle/level15.h"
+#include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
+#include "mortevielle/parole2.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -219,8 +225,8 @@ void ecr2(Common::String str_) {
 	else tab = 6;
 	putxy(8, 177);
 	tlig = 59 + pred(int, res) * 36;
-	if (length(str_) < tlig)  writeg(str_, 5);
-	else if (length(str_) < (tlig << 1)) {
+	if (str_.size() < tlig)  writeg(str_, 5);
+	else if (str_.size() < (tlig << 1)) {
 		putxy(8, 176);
 		writeg(copy(str_, 1, pred(int, tlig)), 5);
 		putxy(8, 182);
@@ -286,7 +292,7 @@ void clsf10() {
 	else if (s.conf > 65)  st = "Malsaine";
 	if (res == 1)  co = 10;
 	else co = 6;
-	co = 574 - ((uint)co * length(st) >> 1);
+	co = 574 - ((uint)co * st.size() >> 1);
 	putxy(co, 92);
 	writeg(st, 4);
 	if (res == 1)  co = 620;
@@ -638,10 +644,10 @@ void chlm(int &per) {
 }
 
 void pendule() {
-	const matrix<1, 2, 1, 12, int> cv
-	= {{{{ 5,  8, 10,  8,  5,  0, -5,  -8, -10,  -8,  -5,   0}},
-			{{ -5, -3,  0,  3,  5,  6,  5,   3,   0,  -3,  -5,  -6}}
-		}
+	const int cv[3][13] = {
+		{ 0,  0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0 },
+		{ 0,  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
+		{ 0, -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
 	};
 	const int x = 580;
 	const int y = 123;
@@ -983,8 +989,7 @@ void debloc(int l) {
 
 /* NIVEAU 10 */
 void init_nbrepm() {
-	const array<1, 8, byte> ipm
-	= {{4, 5, 6, 7, 5, 6, 5, 8}};
+	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 	int i;
 
 	/* debug('init_nbrepm'); */
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 50d1245..9b9fa68 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -26,9 +26,15 @@
  */
 
 #include "mortevielle/mor2.h"
+#include "mortevielle/alert.h"
+#include "mortevielle/boite.h"
 #include "mortevielle/var_mor.h"
+#include "mortevielle/menu.h"
+#include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
+#include "mortevielle/parole2.h"
+#include "mortevielle/taffich.h"
 
 namespace Mortevielle {
 
@@ -211,7 +217,7 @@ void tmlieu(int mli) {
 		cx = v_lieu[i][mli];
 		deline(cx + c_tmlieu, st, tail);
 		nomp = delig;
-		while (length(nomp) < 30)  nomp = nomp + ' ';
+		while (nomp.size() < 30)  nomp = nomp + ' ';
 		menut(depl[i], nomp);
 		i = i + 1;
 	}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index a6b1768..708865e 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -42,7 +42,7 @@ int m_show,
         p_o_s,
         mouse_shwn;
 
-matrix<0, 5, 0, 11, int> s_s;
+int s_s[12][6];
 
 
 void init_mouse() {
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 2a22d04..0923c71 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -32,6 +32,12 @@ namespace Mortevielle {
 
 extern bool clic;
 
+extern int m_show,
+        x_s,
+        y_s,
+        p_o_s,
+        mouse_shwn;
+
 void init_mouse();
 //extern void change_mouse(int t);
 //extern void dessine_souris(int xf, int yf);
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index ba0c956..6ec3f89 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/outtext.h"
+#include "mortevielle/level15.h"
 #include "mortevielle/var_mor.h"
 #include "common/str.h"
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index d5004cd..d7f95f4 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -25,9 +25,13 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/actions.h"
+#include "mortevielle/menu.h"
+#include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/prog.h"
 #include "mortevielle/var_mor.h"
+#include "mortevielle/mouse.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 870f8b7..2a200fb 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
 #include "common/str.h"
@@ -89,7 +90,7 @@ namespace Mortevielle {
 				with.y2 = 34 + j * 8;
 				with.etat = true;
 			}
-			while (length(chaines[j]) < tmax) {
+			while (chaines[j].size() < tmax) {
 				chaines[j] = chaines[j] + ' ';
 			}
 		}
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 9df1a18..406d7bc 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -55,7 +55,7 @@ void writeg(Common::String l, int c)
 	yo = ywhere;
 	if (res == 2)  i = 6;
 	else i = 10;
-	x = xo + i * length(l);
+	x = xo + i * l.size();
 	switch (c) {
 	case 1:
 	case 3  : {
@@ -80,7 +80,7 @@ void writeg(Common::String l, int c)
 	}
 	xo = xo + 1;
 	yo = yo + 1;
-	for (x = 1; x <= length(l); x ++) {
+	for (x = 1; x <= l.size(); x ++) {
 		affcar(gd, xo, yo, cecr, ord(l[x]));
 		xo = xo + i;
 	}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 6d6df69..6969cf6 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "common/str.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 88b42a8..4f8e0fe 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -48,6 +48,10 @@ namespace Mortevielle {
 #define pred(type, v) (v - 1)
 #define succ(type, v) (v + 1)
 #define ord(v) ((int) v)
+#define chr(v) ((char) v)
+#define lo(v) (v & 0xff)
+#define hi(v) ((v >> 8) & 0xff)
+#define odd(v) ((v % 2) == 1)
 
 // TODO: Replace the following with proper implementations
 #define mortevielle_exit(ret) error("Exit the game")


Commit: eb6d9e56c1115cb2e503732f4b3333565d35067f
    https://github.com/scummvm/scummvm/commit/eb6d9e56c1115cb2e503732f4b3333565d35067f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:55-07:00

Commit Message:
MORTEVIELLE: Converted some of the file accesses to use Common::File

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index c35ba4f..1a13567 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -39,7 +39,7 @@ const int nligne = 7;
 
 const int coord[3][4] = {
 	{0, 0, 0, 0},
-	{0, 150, 72, 103),
+	{0, 150, 72, 103},
 	{0, 143, 107, 183}
 };
 
@@ -126,7 +126,7 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
 int do_alert(Common::String str_, int n) {
 	int coldep, esp, i, l, nbcase, quoi, ix;
 	Common::String st, chaine;
-	matrix<1, 2, 1, 2, int> limit;
+	int limit[3][3];
 	char c, dumi;
 	Common::String s[3];
 	int cx, cy, cd, nbcol, nblig;
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 89d01c5..daf25d2 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -25,17 +25,25 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
+#include "common/system.h"
+#include "common/savefile.h"
+#include "common/serializer.h"
 #include "mortevielle/disk.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
+/**
+ * Ensure disk 1 data is available
+ */
 void dem1() {
-	untyped_file f;
 	int k;
 
-	/* -- demande de disk 1 -- */
+/* Deprecated in ScummVM
+	// -- demande de disk 1 --
 	assign(f, "mort.005");
-	/*$i-*/
+	//*$i-*
 	k = ioresult;
 	reset(f);
 	while (ioresult != 0) {
@@ -45,26 +53,47 @@ void dem1() {
 		reset(f);
 	}
 	close(f);
+	*/
+}
+
+static void sync_save(Common::Serializer &sz) {
+	sz.syncAsSint16LE(s1.conf);
+	sz.syncBytes((byte *)&s1.pourc[0], 11);
+	sz.syncBytes((byte *)&s1.teauto[0], 43);
+	sz.syncBytes((byte *)&s1.sjer[0], 31);
+	sz.syncAsSint16LE(s1.mlieu);
+	sz.syncAsSint16LE(s1.iboul);
+	sz.syncAsSint16LE(s1.ibag);
+	sz.syncAsSint16LE(s1.icave);
+	sz.syncAsSint16LE(s1.ivier);
+	sz.syncAsSint16LE(s1.ipuit);
+	sz.syncAsSint16LE(s1.derobj);
+	sz.syncAsSint16LE(s1.iloic);
+	sz.syncAsSint16LE(s1.icryp);
+	sz.syncAsSint16LE(s1.ipre);
+	sz.syncAsSint16LE(s1.heure);
 }
 
 void takesav(int n) {
-	untyped_file f;
 	int i;
 	Common::String st;
 
 	dem1();
-	/* -- chargement du fichier 'sauve#n.mor' -- */
-	st = string("sav") + chr(n + 48) + ".mor";
-	assign(f, st);
-	reset(f, 497);
-	blockread(f, s1, 1);
-	if (ioresult != 0) {
+	// -- Load the file  'sauve#n.mor'
+		Common::String saveName = Common::String::format("sav%d.mor", n);
+	Common::InSaveFile *f = g_system->getSaveManager().openForLoading(st);
+
+	Common::Serializer sz(f, NULL);
+	sync_save(sz);
+
+	if (f.err()) {
 		i = do_alert(err_mess, 1);
-		exit(0);
+		mortevielle_exit(0);
 	}
 	s = s1;
 	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
-	close(f);
+
+	delete f;	
 }
 
 void ld_game(int n) {
@@ -81,7 +110,7 @@ void ld_game(int n) {
 }
 
 void sv_game(int n) {
-	untyped_file f;
+	Common::OutSaveFile *f;
 	int i;
 
 	hide_mouse();
@@ -91,10 +120,16 @@ void sv_game(int n) {
 	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
 	s1 = s;
 	if (s1.mlieu == 26)  s1.mlieu = 15;
-	assign(f, string("sav") + chr(n + 48) + ".mor");
-	rewrite(f, 497);
-	blockwrite(f, s1, 1);
-	close(f);
+	
+	Common::String saveName = Common::String::format("sav%d.mor", n);
+	f = g_system->getSaveFileManager().openForSaving(saveName);
+
+	Common::Serializer sz(NULL, f);
+	sync_save(sz);
+
+	f->finalize();
+	delete f;
+
 	dem2();
 	show_mouse();
 }
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index e7a9c21..b655b7a 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
@@ -149,35 +150,37 @@ end;
   */
 
 void adzon() {
-	untyped_file f;
-	file<byte> g;
+	Common::File f;
+//	Common::File g;
 	byte a;
 	int i;
 
-	assign(f, "don.mor");
-	reset(f, 256);
-	blockread(f, tabdon, 7);
-	close(f);
-	assign(f, "bmor.mor");
-	reset(f, 1916);
-	blockread(f, tabdon[fleche], 1);
+	if (!f.open("don.mor"))
+		error("Missing file - don.mor");
+	f.read(tabdon, 7);
+	f.close();
+
+	if (!f.open("bmor.mor"))
+		error("Missing file - bmor.mor");
+	f.read(&tabdon[fleche], 1);
 	/*i:=fleche;
 	repeat
 	  read(g,a);
 	  tabdon[i]:=a;
 	  i:=succ(i);
 	until i=fleche + 1916;*/
-	close(f);
-	assign(f, "dec.mor");
-	reset(f, 1664);
-	blockread(f, mem[0x73a2 + 0], 1);
+	f.close();
+
+	if (!f.open("dec.mor"))
+		error("Missing files - dec.moir");
+	f.read(mem[0x73a2 + 0], 1);
 	/*i:=0;
 	repeat
 	  read(g,a);
 	  mem[$73A2:i]:=a;
 	  i:=succ(i);
 	until eof(g);*/
-	close(f);
+	f.close();
 }
 
 int animof(int ouf, int num) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index b4e3fb3..2938834 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -29,7 +29,7 @@
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/boite.h"
-#include "mortevielle/droite.h
+#include "mortevielle/droite.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9b9fa68..bdf207f 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -325,7 +325,11 @@ void st4(int ob) {
 	case 158 :
 		crep = 113;
 		break;
-	case RANGE_5(152, 156):
+	case 152:
+	case 153:
+	case 154:
+	case 155:
+	case 156:
 	case 150:
 	case 100:
 	case 157:
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 906600f..1a73b34 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -25,19 +25,22 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
 #include "mortevielle/ovd1.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
 void dem2() {
+	/* Deprecated check for disk 2
+
 	untyped_file f;
 	int k;
 
-	/* -- demande de disk 2 -- */
+	// -- demande de disk 2 --
 	while (ioresult != 0);
 	assign(f, "mort.001");
-	/*$i-*/
+	//$i-
 	reset(f);
 	while (ioresult != 0) {
 		show_mouse();
@@ -46,6 +49,7 @@ void dem2() {
 		reset(f);
 	}
 	close(f);
+	*/
 }
 
 void ani50() {
@@ -81,13 +85,14 @@ void ani50() {
 /* overlay */ void init_menu() {
 	int i, j, tai;
 	char st[1410];
-	untyped_file f;
+	Common::File f;
+
+	if (!f.open("menufr.mor"))
+		error("Missing file - menufr.mor");
+
+	f.read(lettres, 7 * 24);
+	f.close();
 
-	assign(f, "menufr.mor");
-	/*$i-*/
-	reset(f, 144);
-	blockread(f, lettres, 1);
-	close(f);
 	/* ----  Demande de changement de disquette  ---- */
 	dem2();
 
@@ -171,15 +176,16 @@ void ani50() {
 
 /* overlay */ void chartex() {
 	int i;
-	untyped_file fibyte;
+	Common::File fibyte;
 	char s[1410];
 
 	/* debug('o3 chartex'); */
 	i = 0;
-	assign(fibyte, "TXX.INP");
-	/*$i-*/
-	reset(fibyte);
-	blockread(fibyte, t_mot, 125);
+	if (!fibyte.open("TXX.INP"))
+		error("missing file - TXX.INP");
+
+	fibyte.read(&t_mot, 125);
+
 	close(fibyte);
 	assign(sauv_t, "TXX.NTP");
 	reset(sauv_t);
@@ -275,7 +281,7 @@ void ani50() {
 
 
 /* overlay */ void music() {
-	untyped_file fic;
+	Common::File fic;
 	int k;
 	bool fin;
 	char ch;
@@ -285,12 +291,14 @@ void ani50() {
 	/* debug('o3 music'); */
 	if (sonoff)  return;
 	rech_cfiec = true;
-	assign(fic, "mort.img");
-	/*$i-*/
-	reset(fic);
-	blockread(fic, mem[0x3800 + 0], 500);
-	blockread(fic, mem[0x47a0 + 0], 123);
-	close(fic);
+	
+	if (!f.open("mort.img"))
+		error("Missing file - mort.img");
+
+	fic.read(mem[0x3800 + 0], 500);
+	fic.read(mem[0x47a0 + 0], 123);
+	f.close();
+
 	demus(0x3800, 0x5000, 623);
 	addfix = (float)((tempo_mus - addv[1])) / 256;
 	cctable(tbi);
@@ -308,41 +316,39 @@ void ani50() {
 
 
 /* overlay */ void charge_bruit5() {
-	untyped_file f;
+	Common::File f;
 
-	assign(f, "bruit5");
-	/*$i-*/
-	reset(f);
-	if (ioresult != 0) {
-		caff = do_alert(err_mess, 1);
-		exit(0);
-	}
-	blockread(f, mem[adbruit5 + 0], 149);
+	if (!f.open("bruit5"))
+		error("Missing file - bruit5");
+
+	f.read(mem[adbruit5 + 0], 149);
 	/*blockread(f,mem[$5CB0:0],100);
 	blockread(f,mem[$3D1F:0],49);*/
-	close(f);
+	f.close();
 }
 
 /* overlay */ void charge_cfiec() {
-	untyped_file f;
+	Common::File f;
+
+	if (!f.open("cfiec.mor"))
+		error("Missing file - cfiec.mor");
 
-	assign(f, "cfiec.mor");
 	/*$i-*/
-	reset(f);
-	blockread(f, mem[adcfiec + 0], 511);
-	blockread(f, mem[adcfiec + 4088 + 0], 311);
-	close(f);
+	f.read(mem[adcfiec + 0], 511);
+	f.read(mem[adcfiec + 4088 + 0], 311);
+	f.close();
+
 	rech_cfiec = false;
 }
 
 
 /* overlay */ void charge_cfiph() {
-	untyped_file f;
+	Common::File f;
 
-	assign(f, "cfiph.mor");
-	/*$i-*/
-	reset(f, 256);
-	blockread(f, t_cph, 50);
+	if (!f.open("cfiph.mor"))
+		error("Missing file - cfiph.mor");
+
+	f.read(t_cph, 50);
 	close(f);
 }
 
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 6969cf6..1a20a1b 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
 #include "common/str.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/taffich.h"
@@ -35,29 +36,31 @@ namespace Mortevielle {
 void chardes(Common::String nom, float passe, int long_) {
 	int i, p, l;
 	byte b;
-	untyped_file f;
+	Common::File f;
 
 	/* debug('chardes'); */
-	assign(f, nom);
-	/*$i-*/
-	reset(f);
+	if (!f.open(nom))
+		error("Missing file %s", nom.c_str());
+
 	testfi();
 	p = 0;
 	while (passe > 127) {
 		p = p + 1;
 		passe = passe - 128;
 	}
-	if (p != 0)  seek(f, p);
+	if (p != 0)
+		f.seek(p);
 	p = trunc(passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		blockread(f, mem[0x6000 + i], 1);
+		f.read(mem[0x6000 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
 	}
-	close(f);
+	f.close();
+
 	for (i = p; i <= long_ + p; i ++) mem[0x7000 + i - p] = mem[0x6000 + i];
 	/*$i+*/
 }
@@ -65,31 +68,33 @@ void chardes(Common::String nom, float passe, int long_) {
 void charani(Common::String nom, float passe, int long_) {
 	int i, p, l;
 	byte b;
-	untyped_file f;
+	Common::File f;
 
 	/* debug('charani'); */
-	assign(f, nom);
-	/*$i-*/
-	reset(f);
+	if (!f.open(nom))
+		error("Missing file - %s", nom.c_str());
+
 	testfi();
 	p = 0;
 	while (passe > 127) {
 		passe = passe - 128;
 		p = p + 1;
 	}
-	if (p != 0)  seek(f, p);
+	if (p != 0)
+		f.seek(p);
+
 	p = trunc(passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		blockread(f, mem[0x6000 + i], 1);
+		f.read(mem[0x6000 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
 	}
-	close(f);
+	f.close();
+
 	for (i = p; i <= long_ + p; i ++) mem[0x7314 + i - p] = mem[0x6000 + i];
-	/*$i+*/
 }
 
 void taffich() {


Commit: 70984b8d6e4e50736e9c461db2f845479e6188a8
    https://github.com/scummvm/scummvm/commit/70984b8d6e4e50736e9c461db2f845479e6188a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:57-07:00

Commit Message:
MORTEVIELLE: Converted string() usage to Common::String

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 1a13567..c088502 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -118,7 +118,12 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
 		i = i + 2;
 		while (str[l].size() < 3)  str[l] = str[l] + ' ';
 		putxy(x, 98);
-		writeg(string(' ') + str[l] + ' ', 0);
+
+		Common::String tmp(" ");
+		tmp += str[l];
+		tmp += " ";
+
+		writeg(tmp, 0);
 		x = x + esp + 40;
 	}
 }
@@ -198,10 +203,19 @@ int do_alert(Common::String str_, int n) {
 					hide_mouse();
 					if (quoi != 0) {
 						posit(quoi, coldep, esp);
-						writeg(string(' ') + s[quoi] + ' ', 0);
+
+						Common::String tmp(" ");
+						tmp += s[quoi];
+						tmp += " ";
+						writeg(tmp, 0);
 					}
 					posit(ix, coldep, esp);
-					writeg(string(' ') + s[ix] + ' ', 1);
+
+					Common::String tmp2 = " ";
+					tmp2 += s[ix];
+					tmp2 += " ";
+					writeg(tmp2, 1);
+
 					quoi = ix;
 					show_mouse();
 				}
@@ -210,7 +224,12 @@ int do_alert(Common::String str_, int n) {
 		if ((quoi != 0) && ! newaff) {
 			hide_mouse();
 			posit(quoi, coldep, esp);
-			writeg(string(' ') + s[quoi] + ' ', 0);
+
+			Common::String tmp3(" ");
+			tmp3 += s[quoi];
+			tmp3 += " ";
+			writeg(tmp3, 0);
+
 			quoi = 0;
 			show_mouse();
 		}
@@ -222,7 +241,10 @@ int do_alert(Common::String str_, int n) {
 	if (! test3)  {
 		quoi = n;
 		posit(n, coldep, esp);
-		writeg(string(' ') + s[n] + ' ', 1);
+		Common::String tmp4(" ");
+		tmp4 += s[n];
+		tmp4 += " ";
+		writeg(tmp4, 1);
 	}
 	charecr(50, succ(int, nligne) << 4);
 	show_mouse();
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 083a16d..412ab55 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -53,7 +53,10 @@ namespace Mortevielle {
 	while (s.size() < 30)  s = s + ' ';
 	switch (h) {
 	case invent  :
-		if (l != 7)  inv[l] = string(' ') + s;
+		if (l != 7) {
+			inv[l] = s;
+			inv[l].insertChar(' ', 0);
+		}
 		break;
 	case depla   :
 		dep[l] = s;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 2938834..83cd359 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -675,8 +675,11 @@ void pendule() {
 	if (heu > 11)  writeg("PM ", 1);
 	else writeg("AM ", 1);
 	putxy(550, 160);
-	if ((jou >= 0) && (jou <= 8))
-		writeg(string(chr(jou + 49)) + "& jour", 1);
+	if ((jou >= 0) && (jou <= 8)) {
+		Common::String tmp("& jour");
+		tmp.insertChar((char)(jou + 49), 0);
+		writeg(tmp, 1);
+	}
 }
 
 /*************
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index bdf207f..3a89593 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -77,7 +77,8 @@ void tinke() {
 		for (cx = 1; cx <= 10; cx ++) if (s.pourc[cx] == '*')  cf = cf + 1;
 		if (cf == 10)  stpo = "10";
 		else stpo = chr(cf + 48);
-		stpou = string(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
+
+		stpou = Common::String(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
 	}
 	if (m > min) {
 		min = 30;


Commit: 5483930c47afbc3697b5ab397edf741a7587322e
    https://github.com/scummvm/scummvm/commit/5483930c47afbc3697b5ab397edf741a7587322e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:18:58-07:00

Commit Message:
MORTEVIELLE: More compilation fixes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/boite.h
    engines/mortevielle/disk.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/sprint.h
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b9626b3..8e4a5fe 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -33,6 +33,7 @@
 #include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
+#include "mortevielle/ques.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/var_mor.h"
 
@@ -43,7 +44,8 @@ const char stouinon[] = "[2][ ][OUI][NON]";
 
 /* overlay */
 void taller() {
-	int mx, cx, cy;
+	//int mx, cx, cy;
+	int cx;
 
 	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
 		s.mlieu = 15;
@@ -132,7 +134,8 @@ L2:
 }
 
 /* overlay */ void tprendre() {
-	int cx, cy, cz;
+	//int cx, cy, cz;
+	int cx;
 
 	if (caff > 99) {
 		cx = caff;
@@ -273,7 +276,7 @@ L2:
 }
 
 /* overlay */ void tlire() {
-	int iaff;
+//	int iaff;
 
 	if (caff > 99)  st4(caff);
 	else {
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index c088502..4ba287d 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -29,6 +29,7 @@
 #include "mortevielle/alert.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/sprint.h"
 
 namespace Mortevielle {
 
@@ -48,7 +49,10 @@ static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 	int i, k;
 	bool v;
 
-	val(s[2], nbc, i);
+	//val(s[2], nbc, i);
+	sscanf(s.c_str() + 1, "%d", nbc);
+	i = 0;
+
 	c = "";
 	nbl = 0;
 	i = 5;
@@ -102,7 +106,7 @@ static void fait_boite(int lidep, int nli, int tx) {
 
 
 
-static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String *&str, int &esp) {
+static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String[3] &str, int &esp) {
 	int i, l, x;
 	char ch;
 
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
index d4a1d1e..bff3e82 100644
--- a/engines/mortevielle/boite.h
+++ b/engines/mortevielle/boite.h
@@ -32,5 +32,6 @@ namespace Mortevielle {
 
 extern void boite(int x, int y, int dx, int dy, int coul);
 
+
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index daf25d2..0c19bdd 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -29,7 +29,10 @@
 #include "common/system.h"
 #include "common/savefile.h"
 #include "common/serializer.h"
+#include "mortevielle/alert.h"
+#include "mortevielle/ovd1.h"
 #include "mortevielle/disk.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index b655b7a..882bea5 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -27,8 +27,8 @@
 
 #include "common/file.h"
 #include "mortevielle/level15.h"
-#include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 412ab55..2a05576 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -31,6 +31,7 @@
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -82,22 +83,22 @@ namespace Mortevielle {
 	switch (h) {
 	case invent : {
 		if (l > 6)  {
-			inv[l][1] = '<';
-			inv[l][22] = '>';
-		} else inv[l][1] = '*';
+			inv[l].setChar('<', 1);
+			inv[l].setChar('>', 22);
+		} else inv[l].setChar('*', 1);
 	}
 	break;
 	case depla :
-		dep[l][1] = '*';
+		dep[l].setChar('*', 1);
 		break;
 	case action :
-		act[l][1] = '*';
+		act[l].setChar('*', 1);
 		break;
 	case saction :
-		self_[l][1] = '*';
+		self_[l].setChar('*', 1);
 		break;
 	case discut :
-		dis[l][1] = '*';
+		dis[l].setChar('*', 1);
 		break;
 	}
 }
@@ -110,30 +111,30 @@ namespace Mortevielle {
 	l = lo(no);
 	switch (h) {
 	case invent : {
-		inv[l][1] = ' ';
-		inv[l][22] = ' ';
+		inv[l].setChar(' ', 1);
+		inv[l].setChar(' ', 22);
 	}
 	break;
 	case depla :
-		dep[l][1] = ' ';
+		dep[l].setChar(' ', 1);
 		break;
 	case action :
-		act[l][1] = ' ';
+		act[l].setChar(' ', 1);
 		break;
 	case saction : {
-		self_[l][1] = ' ';
-		self_[l][1] = ' ';
+		self_[l].setChar(' ', 1);
+		self_[l].setChar(' ', 1);
 	}
 	break;
 	case discut :
-		dis[l][1] = ' ';
+		dis[l].setChar(' ', 1);
 		break;
 	}
 }
 
 void menu_aff() {
 	int ind_tabl, k, col;
-	char c;
+//	char c;
 	int pt, x, y, color, msk,
 	        num_letr;
 
@@ -237,7 +238,7 @@ void util(int x, int y) {
 	else ix = 3;
 	xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = pred(int, (uint)y >> 3) + (msg3 << 8);
+		ix = pred(int, ((uint)y >> 3)) + (msg3 << 8);
 		if (ix != msg4) {
 			invers(1);
 			msg4 = ix;
@@ -318,7 +319,8 @@ void erase_menu() {
 }
 
 void mdn() {
-	int x, y, c, a, ix;
+	//int x, y, c, a, ix;
+	int x, y, ix;
 	bool tes;
 
 	/* debug('mdn'); */
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 83cd359..39a45d4 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -36,6 +36,7 @@
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/parole2.h"
+#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -43,6 +44,8 @@ namespace Mortevielle {
 /* Niveau 14 suite */
 const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
 
+// For ScummVM, we need to do check for file errors where we do the file access
+const int ioresult = 0;
 
 void testfi() {
 	if (ioresult != 0) {
@@ -225,8 +228,8 @@ void ecr2(Common::String str_) {
 	else tab = 6;
 	putxy(8, 177);
 	tlig = 59 + pred(int, res) * 36;
-	if (str_.size() < tlig)  writeg(str_, 5);
-	else if (str_.size() < (tlig << 1)) {
+	if ((int)str_.size() < tlig)  writeg(str_, 5);
+	else if ((int)str_.size() < (tlig << 1)) {
 		putxy(8, 176);
 		writeg(copy(str_, 1, pred(int, tlig)), 5);
 		putxy(8, 182);
@@ -237,7 +240,7 @@ void ecr2(Common::String str_) {
 		putxy(8, 176);
 		writeg(copy(str_, 1, pred(int, tlig)), 5);
 		putxy(8, 182);
-		writeg(copy(str_, tlig, pred(int, tlig << 1)), 5);
+		writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
 		putxy(8, 190);
 		writeg(copy(str_, tlig << 1, tlig * 3), 5);
 	}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 3a89593..649d770 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -28,22 +28,21 @@
 #include "mortevielle/mor2.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/boite.h"
-#include "mortevielle/var_mor.h"
+#include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/taffich.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
-const array<1, 11, int> men
-= {{
-		scacher, attacher, defoncer, dormir,
+const int men[12] = { 0,
+		scacher, attacher, defoncer, dormir, 
 		entrer,  fermer,   frapper,  manger,
 		mettre,  ouvrir,   sortir
-	}
 };
 
 void tinke() {
@@ -377,8 +376,7 @@ void modinv() {
 }
 
 void sparl(float adr, float rep) {
-	const array<1, 8, int> haut
-	= {{0, 1, -3, 6, -2, 2, 7, -1}};
+	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
 	int key, ad, tay, repint;
 	char st[1410];
 
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 2555b83..68eb217 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -25,8 +25,6 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "ptoc.h"
-
 #include "mortevielle/mort.h"
 #include "mortevielle/var_mor.h"          /* les variables */
 #include "mortevielle/keyboard.h"          /* la gestion du clavier */
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 6ec3f89..08fb9db 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -27,6 +27,7 @@
 
 #include "mortevielle/outtext.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 #include "common/str.h"
 
@@ -59,14 +60,15 @@ const byte tab31[32]= {
 };
 
 void deline(int num , char *l , int &tl);
+typedef unsigned char uchar;
 
 static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
-	const unsigned char rap[32] = { 
-		',', ':', '@', '!', '?', '-', '\207',
-		'\240', '\205', '\203', '\202', '\212', '\210', '/',
-		'\213', '\214', '\242', '\047', '\223', '"', '\227',
-		'\226', '0', '1', '2', '3', '4', '5',
-		'6', '7', '8', '9'
+	const uchar rap[32] = { 
+		(uchar)',', (uchar)':', (uchar)'@', (uchar)'!', (uchar)'?', (uchar)'-', (uchar)'\207',
+		(uchar)'\240', (uchar)'\205', (uchar)'\203', (uchar)'\202', (uchar)'\212', (uchar)'\210', (uchar)'/',
+		(uchar)'\213', (uchar)'\214', (uchar)'\242', (uchar)'\047', (uchar)'\223', (uchar)'"', (uchar)'\227',
+		(uchar)'\226', (uchar)'0', (uchar)'1', (uchar)'2', (uchar)'3', (uchar)'4', (uchar)'5',
+		(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
 	};
 	int oct, ocd;
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 1a73b34..d34a6ee 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -26,11 +26,19 @@
  */
 
 #include "common/file.h"
+#include "mortevielle/alert.h"
+#include "mortevielle/level15.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
+#include "mortevielle/traffich.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
+// For ScummVM, we need to do check for file errors where we do the file access
+const int ioresult = 0;
+
 void dem2() {
 	/* Deprecated check for disk 2
 
@@ -142,7 +150,7 @@ void ani50() {
 	reset(ft);
 	if (ioresult != 0) {
 		caff = do_alert(err_mess, 1);
-		exit(0);
+		mortevielle_exit(0);
 	}
 	ft >> l;
 	close(ft);
@@ -176,24 +184,27 @@ void ani50() {
 
 /* overlay */ void chartex() {
 	int i;
-	Common::File fibyte;
+	Common::File f;
 	char s[1410];
 
 	/* debug('o3 chartex'); */
 	i = 0;
-	if (!fibyte.open("TXX.INP"))
-		error("missing file - TXX.INP");
+	if (!f.open("TXX.INP"))
+		error("Missing file - TXX.INP");
 
-	fibyte.read(&t_mot, 125);
+	f.read(&t_mot, 125);
+	f.close();
 
-	close(fibyte);
-	assign(sauv_t, "TXX.NTP");
-	reset(sauv_t);
+	if (!f.open("TXX.NTP"))
+		error("Missing file - TXX.NTP");
 	do {
-		sauv_t >> t_rec[i];
+		t_rec[i].indis = f.readSint16LE();
+		t_rec[i].point = f.readByte();
+
 		i = i + 1;
-	} while (!(eof(sauv_t)));
-	close(sauv_t);
+	} while (!f.eos());
+	f.close();
+
 	deline(578, s, i);
 	al_mess = delig;
 	deline(579, s, i);
@@ -265,7 +276,7 @@ void ani50() {
 	do {
 		input >> kbd >> ch;
 	} while ((ch != 'C') && (ch != 'S'));
-	int_m = (upcase(ch) == 'S');
+	int_m = (toupper(ch) == 'S');
 }
 
 /* overlay */ void init_lieu() {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index b5079f9..22ed01c 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/parole2.h"
+#include "mortevielle/parole.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index d7f95f4..3366e56 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -26,10 +26,12 @@
  */
 
 #include "mortevielle/actions.h"
+#include "mortevielle/alert.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/prog.h"
+#include "mortevielle/traffich.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 2a200fb..4ee0342 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -25,10 +25,12 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/str.h"
+#include "mortevielle/boite.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
-#include "common/str.h"
+#include "mortevielle/sprint.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 406d7bc..374ac24 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "common/str.h"
+#include "common/textconsole.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
@@ -87,4 +88,9 @@ void writeg(Common::String l, int c)
 	show_mouse();
 }
 
+void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
+	warning("TODO: box method not yet implemented");
+}
+
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
index 8484214..60614bf 100644
--- a/engines/mortevielle/sprint.h
+++ b/engines/mortevielle/sprint.h
@@ -35,6 +35,7 @@ namespace Mortevielle {
 extern void fill_box(int x, int y, int dx);
 extern void clear_box(int x, int y, int dx);
 extern void writeg(Common::String l, int c);
+extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1a20a1b..d98a600 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -27,6 +27,7 @@
 
 #include "common/file.h"
 #include "common/str.h"
+#include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
@@ -98,14 +99,9 @@ void charani(Common::String nom, float passe, int long_) {
 }
 
 void taffich() {
-	const array<136, 140, byte> tran1
-	= {{ 121, 121, 138, 139, 120 }};
-	const array<153, 161, byte> tran2
-	= {{
-			150, 150, 152, 152, 100,
-			110, 159, 100, 100
-		}
-	};
+	byte tran1[] = { 121, 121, 138, 139, 120 };	// array<136, 140, byte>
+	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };	// array<153, 161, byte>
+
 	int i, m, a, b, cx, handle,
 	        npal;
 	float lgt, lhandle;
@@ -116,9 +112,9 @@ void taffich() {
 
 	a = caff;
 	if ((a >= 153) && (a <= 161))
-		a = tran2[a];
+		a = tran2[a - 153];
 	else if ((a >= 136) && (a <= 140))
-		a = tran1[a];
+		a = tran1[a - 136];
 	b = a;
 	if (maff == a)  return;
 	if (a == 16) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9bd43be..8ab06e8 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -25,8 +25,10 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
-#include "mortevielle/var_mor.h"
 #include "common/str.h"
+#include "common/textconsole.h"
+#include "mortevielle/sprint.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
@@ -248,11 +250,13 @@ void hirs() {
 	break;
 	case ams : {
 		hires;
-		inline_((float)(0xb8) / 6 / 0 /   /*  =>  mov ax,6 */
-		        0xcd / 0x10);     /*  =>  int 16   */
+		/* 
+		inline_((float)(0xb8) / 6 / 0 / //  =>  mov ax,6
+		        0xcd / 0x10);			//  =>  int 16
 		port[0x3d9] = 15;
 		port[0x3df] = 0;
 		port[0x3dd] = 15;
+		*/
 		res = 2;
 	}
 	break;
@@ -295,6 +299,9 @@ void hirs() {
 }
 
 /* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */
+void affput(int Chx, int Gd, int x, int y, int coul, int char_) {
+	warning("TODO: Implement affput");
+}
 
 void affcar(int gd, int x, int y, int coul, int chr) {
 	if (res == 1)  affput(1, gd, ((uint)x >> 1), y, coul, chr);
@@ -305,4 +312,27 @@ void putpix(int gd, int x, int y, int coul) {
 	affput(0, gd, x, y, coul, 0);
 }
 
+/**
+ * Returns a substring of the given string
+ * @param s		Source string
+ * @param idx	Starting index (1 based)
+ * @param size	Number of characters to return
+ */
+Common::String copy(const Common::String &s, int idx, size_t size) {
+	// Copy the substring into a temporary buffer
+	char *tmp = new char[size + 1];
+	strncpy(tmp, s.c_str() + idx - 1, size);
+	tmp[size] = '\0';
+
+	Common::String result(tmp);
+	delete tmp;
+	return result;
+}
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------     STUBS     ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+int port[0xfff];
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 4f8e0fe..fe0c3c5 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -51,12 +51,9 @@ namespace Mortevielle {
 #define chr(v) ((char) v)
 #define lo(v) (v & 0xff)
 #define hi(v) ((v >> 8) & 0xff)
+#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
 #define odd(v) ((v % 2) == 1)
 
-// TODO: Replace the following with proper implementations
-#define mortevielle_exit(ret) error("Exit the game")
-#define clrscr {}
-
 /*---------------------------------------------------------------------------*/
 /*-------------------------    CONSTANTS   ----------------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -393,6 +390,23 @@ extern pattern tpt[15];
 void hirs();
 void affcar(int gd, int x, int y, int coul, int chr);
 void putpix(int gd, int x, int y, int coul);
+Common::String copy(const Common::String &s, int idx, size_t size);
+void Val(const Common::String &s, int &V, int Code);
+void affput(int Chx, int Gd, int x, int y, int coul, int char_);
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------     STUBS     ------------------------------*/
+/*---------------------------------------------------------------------------*/
+// TODO: Replace the following with proper implementations, or refactor out the code using them
+
+extern int port[0xfff];
+
+#define hires {}
+
+#define mortevielle_exit(ret) error("Exit the game")
+// Text screen functions not relevant for ScummVM
+#define clrscr {}
+#define gotoxy(x,y) {}
 
 } // End of namespace Mortevielle
 


Commit: c6fb8d6361e3788d1846646e0bcb5c8b9048e1d9
    https://github.com/scummvm/scummvm/commit/c6fb8d6361e3788d1846646e0bcb5c8b9048e1d9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:00-07:00

Commit Message:
MORTEVIELLE: Lots of compilation fixes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/sprint.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 8e4a5fe..5b420fb 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -29,12 +29,14 @@
 #include "mortevielle/actions.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
 #include "mortevielle/parole2.h"
+#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -827,7 +829,7 @@ L2:
 }
 
 /* overlay */ void tentrer() {
-	int x, z;
+	int x, z = 0;
 
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
 		t1sama();
@@ -931,7 +933,7 @@ L2:
 }
 
 /* overlay */ void tsortir() {
-	int lx;
+	int lx = 0;
 
 	tsort();
 	crep = 0;
@@ -1055,7 +1057,7 @@ L2:
 			x = x * (3 - res);
 			if (x > 319)  cx = 41;
 			else cx = 1;
-			cy = succ(int, (uint)y >> 3);                  /* 0-199 => 1-25 */
+			cy = succ(int, ((uint)y >> 3));                  /* 0-199 => 1-25 */
 			if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 4ba287d..5f35e6e 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -106,7 +106,7 @@ static void fait_boite(int lidep, int nli, int tx) {
 
 
 
-static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String[3] &str, int &esp) {
+static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String *str, int &esp) {
 	int i, l, x;
 	char ch;
 
@@ -176,7 +176,7 @@ int do_alert(Common::String str_, int n) {
 	if (nbcase == 1)  esp = nbcol - 40;
 	else esp = (uint)(nbcol - nbcase * 40) >> 1;
 	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
-	fait_choix(cas, coldep, nbcase, s, esp);
+	fait_choix(cas, coldep, nbcase, &s[0], esp);
 	limit[1][1] = ((uint)(coldep) >> 1) * res;
 	limit[1][2] = limit[1][1] + 40;
 	if (nbcase == 1) {
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 0c19bdd..e2b1b9a 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -30,9 +30,12 @@
 #include "common/savefile.h"
 #include "common/serializer.h"
 #include "mortevielle/alert.h"
-#include "mortevielle/ovd1.h"
 #include "mortevielle/disk.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/ovd1.h"
+#include "mortevielle/prog.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -41,9 +44,9 @@ namespace Mortevielle {
  * Ensure disk 1 data is available
  */
 void dem1() {
+/* Deprecated in ScummVM
 	int k;
 
-/* Deprecated in ScummVM
 	// -- demande de disk 1 --
 	assign(f, "mort.005");
 	//*$i-*
@@ -83,13 +86,13 @@ void takesav(int n) {
 
 	dem1();
 	// -- Load the file  'sauve#n.mor'
-		Common::String saveName = Common::String::format("sav%d.mor", n);
-	Common::InSaveFile *f = g_system->getSaveManager().openForLoading(st);
+	Common::String saveName = Common::String::format("sav%d.mor", n);
+	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(saveName);
 
 	Common::Serializer sz(f, NULL);
 	sync_save(sz);
 
-	if (f.err()) {
+	if (f->err()) {
 		i = do_alert(err_mess, 1);
 		mortevielle_exit(0);
 	}
@@ -125,7 +128,7 @@ void sv_game(int n) {
 	if (s1.mlieu == 26)  s1.mlieu = 15;
 	
 	Common::String saveName = Common::String::format("sav%d.mor", n);
-	f = g_system->getSaveFileManager().openForSaving(saveName);
+	f = g_system->getSavefileManager()->openForSaving(saveName);
 
 	Common::Serializer sz(NULL, f);
 	sync_save(sz);
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 9def04a..54d788b 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -47,7 +47,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		if (y > yy)  step = -1;
 		else step = 1;
 		do {
-			putpix(gd, trunc(a * i + b), i, coul);
+			putpix(gd, abs((int)(a * i + b)), i, coul);
 			i = i + step;
 		} while (!(i == yy));
 		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
@@ -58,7 +58,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		if (x > xx)  step = -1;
 		else step = 1;
 		do {
-			putpix(gd, i, trunc(a * i + b), coul);
+			putpix(gd, i, abs((int)(a * i + b)), coul);
 			i = i + step;
 		} while (!(i == xx));
 		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 882bea5..a2d5432 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -86,7 +86,8 @@ void writepal(int n) {
 		}
 		break;
 	case cga : {
-		pal = palcga[n].a;
+		warning("TODO: If this code is needed, resolve the incompatible types");
+//		pal = palcga[n].a;
 		if (n < 89)  palette(palcga[n].p);
 		for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
 	}
@@ -152,8 +153,8 @@ end;
 void adzon() {
 	Common::File f;
 //	Common::File g;
-	byte a;
-	int i;
+//	byte a;
+//	int i;
 
 	if (!f.open("don.mor"))
 		error("Missing file - don.mor");
@@ -173,7 +174,7 @@ void adzon() {
 
 	if (!f.open("dec.mor"))
 		error("Missing files - dec.moir");
-	f.read(mem[0x73a2 + 0], 1);
+	f.read(&mem[0x73a2 + 0], 1);
 	/*i:=0;
 	repeat
 	  read(g,a);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 39a45d4..6518f20 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -329,7 +329,7 @@ int hazard(int min, int max) {
 	/* debug('hazard'); */
 	int hazard_result;
 	ha2 = Random();
-	ha1 = trunc(ha2 * (max - min));
+	ha1 = abs((int)(ha2 * (max - min)));
 	hazard_result = min + ha1;
 	return hazard_result;
 }
@@ -404,7 +404,7 @@ void repon(int f, int m) {
 	Common::String str_;
 	Common::String str1;
 	char st[1410];
-	text1 fic;
+//	text1 fic;
 	int i, xco, dx, caspe, tay;
 
 	/* debug('repon fenetre nø'+chr(f+48));*/
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 649d770..42f679a 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -53,7 +53,7 @@ void tinke() {
 	const char d4 = ']';
 	const char d5 = '1';
 	const char d6[] = "OK";
-	int cx, cy, haz, nh, cf, j, h, m, cd;
+	int cx, haz, nh, cf, j, h, m;
 	Common::String stpo;
 	bool am;
 
@@ -380,7 +380,7 @@ void sparl(float adr, float rep) {
 	int key, ad, tay, repint;
 	char st[1410];
 
-	repint = trunc(rep);
+	repint = abs((int)rep);
 	hide_mouse();
 	deline(repint + c_paroles, st, tay);
 	afftex(st, 230, 4, 65, 24, 5);
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 68eb217..f3b0ac7 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -69,7 +69,7 @@ void divers(int np, bool b) {
 int main(int argc, const char *argv[]) {
 	/*init_debug;*/
 	/*  ecri_seg;*/
-	pio_initialize(argc, argv);
+	//pio_initialize(argc, argv);
 	gd = cga;
 	newgd = gd;
 	zuul = false;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 708865e..926a7bf 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -46,7 +46,7 @@ int s_s[12][6];
 
 
 void init_mouse() {
-	int i, j;
+//	int i, j;
 	registres reg;
 
 	mouse_shwn = 0;
@@ -88,7 +88,7 @@ begin
 end;  */
 
 void hide_mouse() {
-	int i, j, k, ps, ds;
+	int i, j, k, ps;;
 	bool imp;
 
 	mouse_shwn = pred(int, mouse_shwn);
@@ -176,10 +176,8 @@ void hide_mouse() {
 }
 
 void show_mouse() {
-	int i, j, k, l,
-	        ps, ds;
+	int i, j, k, l;
 	bool imp;
-	char c;
 
 	mouse_shwn = mouse_shwn + 1;
 	if (mouse_shwn != 1)  return;
@@ -383,7 +381,7 @@ void mov_mouse(bool &funct, char &key) {
 		case '\33' : {
 			p_key = keypressed();
 
-			if ((p_key >= ';') && (p_key <= 'D')) {
+			if ((in2 >= ';') && (in2 <= 'D')) {
 				funct = true;
 				key = in2;
 				return;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 0923c71..a981d52 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-extern bool clic;
+extern bool clic, int_m;
 
 extern int m_show,
         x_s,
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 08fb9db..6048efb 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -62,7 +62,8 @@ const byte tab31[32]= {
 void deline(int num , char *l , int &tl);
 typedef unsigned char uchar;
 
-static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
+static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
+/*
 	const uchar rap[32] = { 
 		(uchar)',', (uchar)':', (uchar)'@', (uchar)'!', (uchar)'?', (uchar)'-', (uchar)'\207',
 		(uchar)'\240', (uchar)'\205', (uchar)'\203', (uchar)'\202', (uchar)'\212', (uchar)'\210', (uchar)'/',
@@ -70,16 +71,17 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 		(uchar)'\226', (uchar)'0', (uchar)'1', (uchar)'2', (uchar)'3', (uchar)'4', (uchar)'5',
 		(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
 	};
+*/
 	int oct, ocd;
 
 	/* 5-8 */
-	oct = t_mot[ind];
+	oct = t_mot[idx];
 	oct = (uint)(oct << (16 - pt)) >> (16 - pt);
 	if (pt < 6) {
-		ind = ind + 1;
+		idx = idx + 1;
 		oct = oct << (5 - pt);
 		pt = pt + 11;
-		oct = oct | ((uint)t_mot[ind] >> pt);
+		oct = oct | ((uint)t_mot[idx] >> pt);
 	} else {
 		pt = pt - 5;
 		oct = (uint)oct >> pt;
@@ -93,13 +95,13 @@ static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end) {
 	break;
 	case 30:
 	case 31 : {
-		ocd = t_mot[ind];
+		ocd = t_mot[idx];
 		ocd = (uint)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
-			ind = ind + 1;
+			idx = idx + 1;
 			ocd = ocd << (5 - pt);
 			pt = pt + 11;
-			ocd = ocd | ((uint)t_mot[ind] >> pt);
+			ocd = ocd | ((uint)t_mot[idx] >> pt);
 		} else {
 			pt = pt - 5;
 			ocd = (uint)ocd >> pt;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index d34a6ee..b30acea 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -27,11 +27,15 @@
 
 #include "common/file.h"
 #include "mortevielle/alert.h"
+#include "mortevielle/keyboard.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
-#include "mortevielle/traffich.h"
+#include "mortevielle/parole.h"
+#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -79,8 +83,6 @@ void ani50() {
   end;*/
 
 /* overlay */ void aff50(bool c) {
-	int k;
-
 	caff = 50;
 	maff = 0;
 	taffich();
@@ -91,7 +93,7 @@ void ani50() {
 }
 
 /* overlay */ void init_menu() {
-	int i, j, tai;
+	int i, tai;
 	char st[1410];
 	Common::File f;
 
@@ -139,33 +141,33 @@ void ani50() {
 
 
 /* overlay */ void charpal() {
-	file<tabdb> f;
-	file<tfxx> ft;
+	Common::File f;		// tabdb records
+	Common::File ft;	// tfxx
 	int i, j, k;
-	file<byte> fb;
+	Common::File fb;	// byte values
 	byte b;
 
-	assign(ft, "fxx.mor");
-	/*$i-*/
-	reset(ft);
-	if (ioresult != 0) {
-		caff = do_alert(err_mess, 1);
-		mortevielle_exit(0);
-	}
-	ft >> l;
-	close(ft);
-	assign(f, "plxx.mor");
-	reset(f);
-	for (i = 0; i <= 90; i ++) f >> tabpal[i];
-	close(f);
-	assign(fb,  "cxx.mor");
-	reset(fb);
+	if (!ft.open("fxx.mor"))
+		error("Missing file - fxx.mor");
+	for (int i = 1; i < 108; ++i)
+		l[i] = ft.readSint16LE();
+	ft.close();
+
+	if (!f.open("plxx.mor"))
+		error("Missing file - plxx.mor");
+	for (i = 0; i <= 90; i ++) 
+		tabpal[i] = f.readSint16LE();
+	f.close();
+	
+	if (!fb.open("cxx.mor"))
+		error("Missing file - cxx.mor");
+
 	for (j = 0; j <= 90; j ++) {
-		fb >> palcga[j].p;
+		palcga[j].p = fb.readByte();
 		for (i = 0; i <= 15; i ++) {
 			nhom &with = palcga[j].a[i];
 
-			fb >> b;
+			b = fb.readByte();
 			with.n = (uint)b >> 4;
 			with.hom[0] = ((uint)b >> 2) & 3;
 			with.hom[1] = b & 3;
@@ -173,13 +175,13 @@ void ani50() {
 	}
 	palcga[10].a[9] = palcga[10].a[5];
 	for (j = 0; j <= 14; j ++) {
-		fb >> tpt[j].tax;
-		fb >> tpt[j].tay;
+		tpt[j].tax = fb.readByte();
+		tpt[j].tay = fb.readByte();
 		for (i = 1; i <= 20; i ++)
 			for (k = 1; k <= 20; k ++)
-				fb >> tpt[j].des[i][k];
+				tpt[j].des[i][k] = fb.readByte();
 	}
-	close(fb);
+	fb.close();
 }
 
 /* overlay */ void chartex() {
@@ -243,9 +245,9 @@ void ani50() {
 	gotoxy(1, 21);
 	clreol;
 	gotoxy(1, 23);
-	output << "CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512";
+	output("CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512");
 	gotoxy(12, 24);
-	output << "Ctrl       C      E            H             T           A";
+	output("Ctrl       C      E            H             T           A");
 	do {
 		input >> kbd >> ch;
 	} while ((ch != '\1') && (ch != '\3') && (ch != '\5') && (ch != '\24') && (ch != '\10'));
@@ -267,12 +269,12 @@ void ani50() {
 	gotoxy(1, 23);
 	clreol;
 	gotoxy(26, 23);
-	output << "Jeu au Clavier / … la Souris";
+	output("Jeu au Clavier / … la Souris");
 	textcolor(4);
 	gotoxy(33, 23);
-	output << 'C';
+	output("C");
 	gotoxy(48, 23);
-	output << 'S';
+	output("S");
 	do {
 		input >> kbd >> ch;
 	} while ((ch != 'C') && (ch != 'S'));
@@ -280,14 +282,16 @@ void ani50() {
 }
 
 /* overlay */ void init_lieu() {
-	file<tab_mlieu> f_lieu;
+	Common::File f_lieu;	// tab_mlieu
 
 	/* debug('o3 init_lieu'); */
-	assign(f_lieu, "MXX.mor");
-	/*$i-*/
-	reset(f_lieu);
-	f_lieu >> v_lieu;
-	close(f_lieu);
+	if (!f_lieu.open("MXX.mor"))
+		error("Missing file - MXX.mor");
+
+	for (int i = 1; i < 8; ++i)
+		f_lieu.read(&v_lieu[i][1], 24);
+
+	f.close();
 }
 
 
@@ -306,8 +310,8 @@ void ani50() {
 	if (!f.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(mem[0x3800 + 0], 500);
-	fic.read(mem[0x47a0 + 0], 123);
+	fic.read(&mem[0x3800 + 0], 500);
+	fic.read(&mem[0x47a0 + 0], 123);
 	f.close();
 
 	demus(0x3800, 0x5000, 623);
@@ -332,7 +336,7 @@ void ani50() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(mem[adbruit5 + 0], 149);
+	f.read(&mem[adbruit5 + 0], 149);
 	/*blockread(f,mem[$5CB0:0],100);
 	blockread(f,mem[$3D1F:0],49);*/
 	f.close();
@@ -345,8 +349,8 @@ void ani50() {
 		error("Missing file - cfiec.mor");
 
 	/*$i-*/
-	f.read(mem[adcfiec + 0], 511);
-	f.read(mem[adcfiec + 4088 + 0], 311);
+	f.read(&mem[adcfiec + 0], 511);
+	f.read(&mem[adcfiec + 4088 + 0], 311);
 	f.close();
 
 	rech_cfiec = false;
@@ -360,7 +364,7 @@ void ani50() {
 		error("Missing file - cfiph.mor");
 
 	f.read(t_cph, 50);
-	close(f);
+	f.close();
 }
 
 
@@ -379,7 +383,7 @@ void ani50() {
 	textcolor(7);
 	cpr = "COPYRIGHT 1989 : LANKHOR";
 	if ((gd == ega) || (gd == ams) || (gd == cga))
-		output << cpr;
+		output(cpr);
 	else {
 		putxy(104 + 72 * res, 190);
 		writeg(cpr, 0);
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 6c8f598..4a3734f 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -35,6 +35,8 @@ void spfrac(int wor) {
 		if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
 				((c3.code < 5) && ((c3.rep != 19) && (c3.rep != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
 			c3.rep = c3.rep + 1;
+		}
+
 	c3.freq = ((uint)wor >> 6) & 7;
 	c3.acc = ((uint)wor >> 9) & 7;
 }
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
index a1467dc..4168187 100644
--- a/engines/mortevielle/parole.h
+++ b/engines/mortevielle/parole.h
@@ -29,6 +29,7 @@
 #define MORTEVIELLE_PAROLE_H
 
 #include "common/scummsys.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 3366e56..e493e76 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -31,7 +31,7 @@
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/prog.h"
-#include "mortevielle/traffich.h"
+#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
 
@@ -116,8 +116,8 @@ namespace Mortevielle {
 			regs.ax = 0x201;
 			regs.cx = 0x1;
 			regs.dx = 0x100 + k - 1;
-			regs.es = seg(buffer);
-			regs.bx = ofs(buffer);
+			//regs.es = seg(buffer);
+			//regs.bx = ofs(buffer);
 			intr(19, regs);
 			test[k] = ! imen;
 			i = 0;
@@ -126,8 +126,8 @@ namespace Mortevielle {
 				syn = false;
 				regs.cx = 0x2700 + i;
 				regs.dx = 0x100 + k - 1;
-				regs.es = seg(buffer);
-				regs.bx = ofs(buffer);
+				//regs.es = seg(buffer);
+				//regs.bx = ofs(buffer);
 				intr(19, regs);
 				if (lo(regs.flags) % 2 == 1)  test[k] = false;
 				i = i + 1;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 374ac24..0523651 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -88,9 +88,4 @@ void writeg(Common::String l, int c)
 	show_mouse();
 }
 
-void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
-	warning("TODO: box method not yet implemented");
-}
-
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
index 60614bf..8484214 100644
--- a/engines/mortevielle/sprint.h
+++ b/engines/mortevielle/sprint.h
@@ -35,7 +35,6 @@ namespace Mortevielle {
 extern void fill_box(int x, int y, int dx);
 extern void clear_box(int x, int y, int dx);
 extern void writeg(Common::String l, int c);
-extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 8ab06e8..f92202c 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -334,5 +334,55 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 /*---------------------------------------------------------------------------*/
 
 int port[0xfff];
+byte mem[0xffff];
+int memw[0xffff];
+int wherey;
+
+void gotoxy(int x, int y) {
+}
+void textcolor(int c) {
+}
+void output(const Common::String &s) {
+}
+void intr(int intNum, registres &regs) {
+}
+
+void palette(int v1) {
+	warning("TODO: s_sauv");
+}
+
+// (* external 'c:\mc\charecr.com'; *)
+void s_char(int Gd, int y, int dy) {
+		warning("TODO: s_char");
+}
+
+// (* external 'c:\mc\sauvecr.com'; *)
+void s_sauv(int Gd, int y, int dy) {
+	warning("TODO: s_sauv");
+}
+
+// (* external 'c:\mc\boite.com'; *)
+void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
+	warning("TODO: box method not yet implemented");
+}
+
+// (* external 'c:\mc\zuul.com'; *)
+void zzuul(int ad, int seg, int tai) {
+	warning("TODO: zzuul");
+}
+
+// (* external 'c:\mc\decomp.com'; *)
+void decomp(int seg, int dep) {
+	warning("TODO: decomp");
+}
+
+// (* external 'c:\mc\affich.com'; *)
+void afff(int Gd, int seg, int dep, int x, int y) {
+	warning("TODO: afff");
+}
+// (* external 'c:\mc\reusint.com'; *)
+void musyc(tablint &tb, int nbseg, int att) {
+	warning("TODO: musyc");
+}
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index fe0c3c5..4cb40ca 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -231,6 +231,10 @@ struct t_pcga {
 	nhom a[16];
 };
 
+typedef int tablint[256];
+typedef doublet tabdb[17];
+typedef int tfxx[108];
+
 /*---------------------------------------------------------------------------*/
 /*------------------------------     ENUMS     ------------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -400,13 +404,37 @@ void affput(int Chx, int Gd, int x, int y, int coul, int char_);
 // TODO: Replace the following with proper implementations, or refactor out the code using them
 
 extern int port[0xfff];
+extern byte mem[0xffff];
+extern int memw[0xffff];
 
 #define hires {}
-
 #define mortevielle_exit(ret) error("Exit the game")
+
 // Text screen functions not relevant for ScummVM
 #define clrscr {}
-#define gotoxy(x,y) {}
+#define clreol {}
+extern void gotoxy(int x, int y);
+extern void textcolor(int c);
+extern void output(const Common::String &s);
+extern int wherey;
+
+extern void palette(int v1);
+extern void intr(int intNum, registres &regs);
+
+// (* external 'c:\mc\charecr.com'; *)
+extern void s_char(int Gd, int y, int dy);
+// (* external 'c:\mc\sauvecr.com'; *)
+extern void s_sauv(int Gd, int y, int dy);
+// (* external 'c:\mc\boite.com'; *)
+extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
+// (* external 'c:\mc\zuul.com'; *)
+extern void zzuul(int ad, int seg, int tai); 
+// (* external 'c:\mc\decomp.com'; *)
+extern void decomp(int seg, int dep); 
+// (* external 'c:\mc\affich.com'; *)
+extern void afff(int Gd, int seg, int dep, int x, int y); 
+// (* external 'c:\mc\reusint.com'; *)
+extern void musyc(tablint &tb, int nbseg, int att);  
 
 } // End of namespace Mortevielle
 


Commit: 03e7aecf12e3a8f21d2610b3675bed2fd7f31da6
    https://github.com/scummvm/scummvm/commit/03e7aecf12e3a8f21d2610b3675bed2fd7f31da6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:01-07:00

Commit Message:
MORTEVIELLE: Added stubs for remaining functions needed by the project

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 5f35e6e..804e0f4 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -133,20 +133,23 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
 }
 
 int do_alert(Common::String str_, int n) {
-	int coldep, esp, i, l, nbcase, quoi, ix;
+	int coldep, esp, i, nbcase, quoi, ix;
 	Common::String st, chaine;
 	int limit[3][3];
-	char c, dumi;
+	char dumi;
 	Common::String s[3];
-	int cx, cy, cd, nbcol, nblig;
-	bool touch, newaff, test, test1, test2, test3, dum;
+	int cx, cy, nbcol, nblig;
+	bool newaff, test, test1, test2, test3, dum;
 	Common::String cas;
 
 
 	/*debug('** do_alert **');*/
+	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 	int do_alert_result;
 	hide_mouse();
-	while (keypressed())  input >> kbd >> dumi;
+	while (keypressed())
+		dumi = get_ch();	// input >> kbd >> dumi;
+
 	clic = false;
 	decod(str_, nbcase, nblig, nbcol, chaine, cas);
 	sauvecr(50, succ(int, nligne) << 4);
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 701f99c..992a268 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -34,7 +34,7 @@ char readkey1() {
 	char c;
 
 	char readkey1_result;
-	input >> kbd >> c;
+	c = get_ch();	// input >> kbd >> c;
 	readkey1_result = c;
 	return readkey1_result;
 }
@@ -43,7 +43,7 @@ int testou() {
 	char ch;
 
 	int testou_result;
-	input >> kbd >> ch;
+	ch = get_ch();	// input >> kbd >> ch;
 	switch (ch)  {
 	case '\23' :
 		sonoff = ! sonoff;
@@ -77,7 +77,7 @@ int testou() {
 		}
 		break;
 	case '\33' :
-		if (keypressed())  input >> kbd >> ch;
+		if (keypressed())  ch = get_ch();	// input >> kbd >> ch;
 		break;
 	}
 	testou_result = ord(ch);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 6518f20..556c7b4 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -150,7 +150,7 @@ void ecrf1() {
 }
 
 void clsf1() {
-	int i, j;
+//	int i, j;
 
 	/* debug('clsf1'); */
 	hide_mouse();
@@ -198,7 +198,7 @@ void clsf1() {
 }
 
 void clsf2() {
-	int i, j;
+//	int i, j;
 
 	/* debug('clsf2'); */
 	hide_mouse();
@@ -247,7 +247,7 @@ void ecr2(Common::String str_) {
 }
 
 void clsf3() {
-	int i, j;
+//	int i, j;
 
 	/* debug('clsf3'); */
 	hide_mouse();
@@ -323,15 +323,8 @@ void paint_rect(int x, int y, int dx, int dy) {
 }
 
 int hazard(int min, int max) {
-	int ha1;
-    float ha2;
-
 	/* debug('hazard'); */
-	int hazard_result;
-	ha2 = Random();
-	ha1 = abs((int)(ha2 * (max - min)));
-	hazard_result = min + ha1;
-	return hazard_result;
+	return get_random_number(min, max);
 }
 
 void calch(int &j, int &h, int &m) {
@@ -370,7 +363,7 @@ void okpas() {
 void modobj(int m) {
 	char str_[1410];
 	Common::String strp;
-	int i, tay;
+	int tay;
 
 	/* debug('modobj'); */
 	strp = ' ';
@@ -385,7 +378,7 @@ void modobj(int m) {
 void modobj2(int m, bool t1, bool t2) {
 	char str_[1410];
 	Common::String strp;
-	int i, tay;
+	int tay;
 
 	/* debug('modobj'); */
 	strp = ' ';
@@ -541,7 +534,6 @@ void affper(int per) {
 /* overlay */ void choix(int min, int max, int &per) {
 	bool i;
 	int haz, cx, cy, cz;
-	float per2, cz2;
 
 	/* debug('o0 choix'); */
 	haz = hazard(min, max);
@@ -793,8 +785,6 @@ void debloc(int l) {
 }
 
 /* overlay */ void quelq6(int l) {
-	int per;
-
 	/* debug('o1 quelq6'); */
 	if (l == 6)  bh6 = true;
 	if (l == 8)  bh8 = true;
@@ -802,7 +792,7 @@ void debloc(int l) {
 }
 
 /* overlay */ void quelq10(int h, int &per) {
-	int min, max;
+	int min = 0, max = 0;
 
 	/* debug('o1 quelq10'); */
 	if ((h >= 0) && (h < 8))  chlm(per);
@@ -829,7 +819,7 @@ void debloc(int l) {
 }
 
 /* overlay */ void quelq11(int h, int &per) {
-	int min, max;
+	int min = 0, max = 0;
 
 	/* debug('o1 quelq11'); */
 	if ((h >= 0) && (h < 8))  chlm(per);
@@ -882,7 +872,7 @@ void debloc(int l) {
 }
 
 /* overlay */ void quelq20(int h, int &per) {
-	int min, max;
+	int min = 0, max = 0;
 
 	/* debug('o1 quelq20'); */
 	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
@@ -1175,7 +1165,7 @@ void phaz(int &haz, int &p, int cf) {
 }
 
 /* overlay */ void t11(int l11, int &a) {
-	int p, haz, h;
+	int p, haz, h = 0;
 
 	/* debug('o2 t11'); */
 	ecfren(p, haz, s.conf, l11);
@@ -1254,7 +1244,6 @@ void messint(int nu) {
 
 void aniof(int ouf, int num) {
 	int ad, offset;
-	char c;
 
 	/* debug('aniof'); */
 	if ((caff == 7) && ((num == 4) || (num == 5)))  return;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 42f679a..c650002 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -206,7 +206,7 @@ void tkey1(bool d) {
 }
 
 void tmlieu(int mli) {
-	int cx, j, i, tail;
+	int cx, i, tail;
 	Common::String nomp;
 	char st[1410];
 
@@ -354,7 +354,7 @@ void st1sama() {
 }
 
 void modinv() {
-	int cx, cy, tay, i, r;
+	int cx, cy, tay, r;
 	char nom[1410];
 	Common::String nomp;
 
@@ -377,7 +377,7 @@ void modinv() {
 
 void sparl(float adr, float rep) {
 	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
-	int key, ad, tay, repint;
+	int key, tay, repint;
 	char st[1410];
 
 	repint = abs((int)rep);
@@ -615,7 +615,7 @@ void tsuiv() {
 void tfleche() {
 	bool qust;
 	char touch;
-	int dummy, cd, xmo, ymo;
+	int dummy;
 
 	if (num == 9999)  return;
 	fenat(chr(152));
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 926a7bf..1aaea06 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -332,7 +332,7 @@ void mov_mouse(bool &funct, char &key) {
 	key = '\377';
 	p_key = keypressed();
 	while (p_key) {
-		input >> kbd >> in1;
+		in1 = get_ch();	// input >> kbd >> in1;
 		read_pos_mouse(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4' :
@@ -381,48 +381,49 @@ void mov_mouse(bool &funct, char &key) {
 		case '\33' : {
 			p_key = keypressed();
 
-			if ((in2 >= ';') && (in2 <= 'D')) {
-				funct = true;
-				key = in2;
-				return;
-			}
-
 			if (p_key) {
-				input >> kbd >> in2;
-				switch (in2) {
-				case 'K' :
-					cx = pred(int, cx);
+				in2 = get_ch();	// input >> kbd >> in2;
+
+				if ((in2 >= ';') && (in2 <= 'D')) {
+					funct = true;
+					key = in2;
+					return;
+				} else {
+					switch (in2) {
+					case 'K' :
+						cx = pred(int, cx);
+						break;
+					case 'P' :
+						cy = succ(int, cy);
+						break;
+					case 'M' :
+						cx = cx + 2;
+						break;
+					case 'H' :
+						cy = pred(int, cy);
+						break;
+					case 'G' : {
+						cx = cx - 1;
+						cy = cy - 1;
+					}
 					break;
-				case 'P' :
-					cy = succ(int, cy);
+					case 'I' : {
+						cx = cx + 1;
+						cy = cy - 1;
+					}
 					break;
-				case 'M' :
-					cx = cx + 2;
+					case 'O' : {
+						cx = cx - 1;
+						cy = cy + 1;
+					}
 					break;
-				case 'H' :
-					cy = pred(int, cy);
+					case 'Q' : {
+						cx = cx + 1;
+						cy = cy + 1;
+					}
 					break;
-				case 'G' : {
-					cx = cx - 1;
-					cy = cy - 1;
-				}
-				break;
-				case 'I' : {
-					cx = cx + 1;
-					cy = cy - 1;
-				}
-				break;
-				case 'O' : {
-					cx = cx - 1;
-					cy = cy + 1;
-				}
-				break;
-				case 'Q' : {
-					cx = cx + 1;
-					cy = cy + 1;
+					}    /* case */
 				}
-				break;
-				}    /* case */
 			}
 		}
 		break;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 6048efb..c9bdcc7 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -162,12 +162,11 @@ static int l_motsuiv(int p, char *ch, int &tab) {
 
 void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	bool the_end;
-	char touch;
 	int xf, yf;
 	int xc, yc;
 	int tab, p;
 	Common::String s;
-	int i, j, nt;
+	int i, j;
 
 
 	/*    debug('  .. Afftex');*/
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index b30acea..e33f3e4 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -35,6 +35,7 @@
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
 #include "mortevielle/parole.h"
+#include "mortevielle/sprint.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
@@ -155,8 +156,12 @@ void ani50() {
 
 	if (!f.open("plxx.mor"))
 		error("Missing file - plxx.mor");
-	for (i = 0; i <= 90; i ++) 
-		tabpal[i] = f.readSint16LE();
+	for (i = 0; i <= 90; ++i) {
+		for (j = 1; j <= 16; ++j) {
+			tabpal[i][j].x = f.readByte();
+			tabpal[i][j].y = f.readByte();
+		}
+	}
 	f.close();
 	
 	if (!fb.open("cxx.mor"))
@@ -234,7 +239,7 @@ void ani50() {
 		cy = cy + 1;
 		deline(cy + c_dialpre, st, tay);
 		gotoxy(40 - tay / 2, wherey + 1);
-		output << delig;
+		output(delig);
 	} while (!(cy == 20));
 	ix = 0;
 	do {
@@ -249,7 +254,7 @@ void ani50() {
 	gotoxy(12, 24);
 	output("Ctrl       C      E            H             T           A");
 	do {
-		input >> kbd >> ch;
+		ch = get_ch();	// input >> kbd >> ch;
 	} while ((ch != '\1') && (ch != '\3') && (ch != '\5') && (ch != '\24') && (ch != '\10'));
 	switch (ch) {
 	case '\1':
@@ -276,7 +281,7 @@ void ani50() {
 	gotoxy(48, 23);
 	output("S");
 	do {
-		input >> kbd >> ch;
+		ch = get_ch();	// input >> kbd >> ch;
 	} while ((ch != 'C') && (ch != 'S'));
 	int_m = (toupper(ch) == 'S');
 }
@@ -291,7 +296,7 @@ void ani50() {
 	for (int i = 1; i < 8; ++i)
 		f_lieu.read(&v_lieu[i][1], 24);
 
-	f.close();
+	f_lieu.close();
 }
 
 
@@ -300,19 +305,19 @@ void ani50() {
 	int k;
 	bool fin;
 	char ch;
-	float x, y;
+//	float x, y;
 
 
 	/* debug('o3 music'); */
 	if (sonoff)  return;
 	rech_cfiec = true;
 	
-	if (!f.open("mort.img"))
+	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
 	fic.read(&mem[0x3800 + 0], 500);
 	fic.read(&mem[0x47a0 + 0], 123);
-	f.close();
+	fic.close();
 
 	demus(0x3800, 0x5000, 623);
 	addfix = (float)((tempo_mus - addv[1])) / 256;
@@ -326,7 +331,7 @@ void ani50() {
 		k = k + 1;
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
-	while (keypressed())  input >> kbd >> ch;
+	while (keypressed())  ch = get_ch();	// input >> kbd >> ch;
 }
 
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 4a3734f..3c78b04 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
 #include "mortevielle/parole.h"
 
 namespace Mortevielle {
@@ -46,44 +47,40 @@ void charg_car() {
 
 	wor = swap(memw[adword + ptr_word]);
 	int_ = wor & 0x3f;
-	switch (int_) {
-	case 60 : {
-		c3.val = 32;  /*  " "  */
-		c3.code = 9;
-	}
-	break;
-	case 61 : {
-		c3.val = 46;  /*  "."  */
-		c3.code = 9;
-	}
-	break;
-	case 62 : {
-		c3.val = 35;  /*  "#"  */
-		c3.code = 9;
-	}
-	break;
-	case RANGE_26(22, 47) : {
+
+	if ((int_ >= 0) && (int_ <= 13)) {
+		c3.val = int_;
+		c3.code = 5;
+	} else if ((int_ >= 14) && (int_ <= 21)) {
+		c3.val = int_;
+		c3.code = 6;
+	} else if ((int_ >= 22) && (int_ <= 47)) {
 		int_ = int_ - 22;
 		c3.val = int_;
 		c3.code = typcon[int_];
-	}
-	break;
-	case RANGE_9(48, 56) : {
+	} else if ((int_ >= 48) && (int_ <= 56)) {
 		c3.val = int_ - 22;
 		c3.code = 4;
+	} else {
+		switch (int_) {
+		case 60 : {
+			c3.val = 32;  /*  " "  */
+			c3.code = 9;
+		}
+		break;
+		case 61 : {
+			c3.val = 46;  /*  "."  */
+			c3.code = 9;
+		}
+		break;
+		case 62 : {
+			c3.val = 35;  /*  "#"  */
+			c3.code = 9;
+		}
+		break;
+		}
 	}
-	break;
-	case RANGE_8(14, 21) : {
-		c3.val = int_;
-		c3.code = 6;
-	}
-	break;
-	case RANGE_14(0, 13) : {
-		c3.val = int_;
-		c3.code = 5;
-	}
-	break;
-	}
+
 	spfrac(wor);
 	ptr_word = ptr_word + 2;
 }
@@ -106,7 +103,7 @@ void veracf(byte b) {
 	tb[0] = 0;
 	for (k = 0; k <= 255; k ++) {
 		tb[k + 1] = addfix + tb[k];
-		t[255 - k] = trunc(tb[k]) + 1;
+		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
 
@@ -123,36 +120,42 @@ void veracf(byte b) {
 }
 
 /* overlay */   void charge_son() {
-	untyped_file f;
+	Common::File f;
 
-	assign(f, "sonmus.mor");
-	reset(f);
-	blockread(f, mem[0x7414 + 0], 273);
+	if (!f.open("sonmus.mor"))
+		error("Missing file - sonmus.mor");
+	
+	f.read(&mem[0x7414 + 0], 273);
 	/*blockread(f,mem[adson+0],300);
 	blockread(f,mem[adson+2400+0],245);*/
 	demus(0x7414, adson, 273);
-	close(f);
+	f.close();
 }
 
 /* overlay */   void charge_phbruit() {
-	untyped_file f;
+	Common::File f;
 
-	assign(f, "phbrui.mor");
-	reset(f);
-	blockread(f, t_cph, 3);
-	close(f);
+	if (!f.open("phbrui.mor"))
+		error("Missing file - phbrui.mor");
+
+	for (int i = 1; i <= 3; ++i)
+		t_cph[i] = f.readSint16LE();
+
+	f.close();
 }
 
 /* overlay */   void charge_bruit() {
-	untyped_file f;
-	int j, i;
+	Common::File f;
+	int i;
 
-	assign(f, "bruits");
-	reset(f);
-	blockread(f, mem[adbruit + 0], 250);
+	if (!f.open("bruits"))
+		error("Missing file - bruits");
+
+	f.read(&mem[adbruit + 0], 250);
 	for (i = 0; i <= 19013; i ++) mem[adbruit + 32000 + i] = mem[adbruit5 + i];
-	blockread(f, mem[adbruit1 + offsetb1], 149);
-	close(f);
+	f.read(&mem[adbruit1 + offsetb1], 149);
+
+	f.close();
 }
 
 /* overlay */   void trait_car() {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 22ed01c..be8c17b 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/level15.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/parole.h"
 #include "mortevielle/var_mor.h"
@@ -64,7 +65,7 @@ void trait_ph() {
 		memw[adword + ptr_word] = t_cph[ptr_tcph];
 		ptr_word = ptr_word + 2;
 		ptr_tcph = ptr_tcph + 1;
-	} while (!(ptr_tcph >= ((uint)lefin >> 1)));
+	} while (!(ptr_tcph >= (int)((uint)lefin >> 1)));
 
 	ptr_oct = 0;
 	ptr_word = 0;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index e493e76..760560e 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -38,8 +38,6 @@
 namespace Mortevielle {
 
 /* overlay */ void change_gd(int ngd) {
-	int i;
-
 	hide_mouse();
 	gd = ngd;
 	hirs();
@@ -59,7 +57,6 @@ namespace Mortevielle {
 }
 
 /* overlay */ void antegame() {
-	int cx;
 	registres regs;
 	char buffer[512];
 	int i, j, k;
@@ -249,9 +246,9 @@ void ld_game(int n);
 void tecran() {
 	const char idem[] = "Idem";
 	const int lim = 20000;
-	int temps;
-	char inkey;
-	bool oo, funct;
+	int temps = 0;
+	char inkey = '\0';
+	bool oo, funct = 0;
 
 	clsf3();
 	oo = false;
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 4ee0342..c9154ac 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -27,6 +27,7 @@
 
 #include "common/str.h"
 #include "mortevielle/boite.h"
+#include "mortevielle/level15.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
@@ -92,7 +93,7 @@ namespace Mortevielle {
 				with.y2 = 34 + j * 8;
 				with.etat = true;
 			}
-			while (chaines[j].size() < tmax) {
+			while ((int)chaines[j].size() < tmax) {
 				chaines[j] = chaines[j] + ' ';
 			}
 		}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index d98a600..3cde8eb 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -27,6 +27,7 @@
 
 #include "common/file.h"
 #include "common/str.h"
+#include "mortevielle/level15.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/taffich.h"
@@ -36,7 +37,7 @@ namespace Mortevielle {
 
 void chardes(Common::String nom, float passe, int long_) {
 	int i, p, l;
-	byte b;
+//	byte b;
 	Common::File f;
 
 	/* debug('chardes'); */
@@ -51,11 +52,11 @@ void chardes(Common::String nom, float passe, int long_) {
 	}
 	if (p != 0)
 		f.seek(p);
-	p = trunc(passe);
+	p = abs((int)passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(mem[0x6000 + i], 1);
+		f.read(&mem[0x6000 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
@@ -68,7 +69,7 @@ void chardes(Common::String nom, float passe, int long_) {
 
 void charani(Common::String nom, float passe, int long_) {
 	int i, p, l;
-	byte b;
+//	byte b;
 	Common::File f;
 
 	/* debug('charani'); */
@@ -84,11 +85,11 @@ void charani(Common::String nom, float passe, int long_) {
 	if (p != 0)
 		f.seek(p);
 
-	p = trunc(passe);
+	p = abs((int)passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(mem[0x6000 + i], 1);
+		f.read(&mem[0x6000 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index f92202c..33ddfe6 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -227,7 +227,7 @@ int tbi[256];
 chariot c1, c2, c3;
 float addfix;
 t_pcga palsav[91];
-doublet tabpal[91][16];
+doublet tabpal[91][17];
 t_pcga palcga[91];
 pattern tpt[15];
 
@@ -238,7 +238,7 @@ pattern tpt[15];
 void hirs() {
 	const byte tandy[14] = {113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0};
 	const byte herc[13] = {50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0};
-	int i, j;
+	int i;
 
 	switch (gd) {
 	case cga : {
@@ -261,8 +261,10 @@ void hirs() {
 	}
 	break;
 	case ega : {
-		inline_((float)(0xb8) / 14 / 0 /     /*  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs */
-		        0xcd / 0x10);        /*  INT 16  */
+		/*
+		inline_((float)(0xb8) / 14 / 0 /     //  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs
+		        0xcd / 0x10);				//   INT 16
+		*/
 		res = 2;
 	}
 	break;
@@ -273,7 +275,9 @@ void hirs() {
 			port[0x3b4] = i;
 			port[0x3b5] = herc[i];
 		}
+		/*
 		inline_((float)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
+		*/
 		port[0x3b8] = 10;
 		res = 2;
 	}
@@ -344,9 +348,24 @@ void textcolor(int c) {
 }
 void output(const Common::String &s) {
 }
+void graphbackground(int c) {
+}
+
 void intr(int intNum, registres &regs) {
 }
 
+int get_random_number(int minval, int maxval) {
+	// TODO: Replace with a proper random source in the engine
+	return minval;
+}
+
+bool keypressed() {
+	return false;	// Hardcoded currently for no keypress pending
+}
+char get_ch() {
+	return '\0';	// hardcoded currently for no keypress
+}
+
 void palette(int v1) {
 	warning("TODO: s_sauv");
 }
@@ -380,9 +399,20 @@ void decomp(int seg, int dep) {
 void afff(int Gd, int seg, int dep, int x, int y) {
 	warning("TODO: afff");
 }
+
 // (* external 'c:\mc\reusint.com'; *)
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
 
+// (* external 'c:\mc\demus.com'; *)
+void demus(int Src, int Dst, int Tay) {
+	warning("TODO: demus");
+}
+
+// (* external 'c:\mc\phint.com'; *)
+void litph(tablint &t, int typ, int tempo) {
+	warning("TODO: litph");
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 4cb40ca..4427bc0 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -383,7 +383,7 @@ extern int tbi[256];
 extern chariot c1, c2, c3;
 extern float addfix;
 extern t_pcga palsav[91];
-extern doublet tabpal[91][16];
+extern doublet tabpal[91][17];
 extern t_pcga palcga[91];
 extern pattern tpt[15];
 
@@ -413,13 +413,20 @@ extern int memw[0xffff];
 // Text screen functions not relevant for ScummVM
 #define clrscr {}
 #define clreol {}
+#define graphcolormode {}
 extern void gotoxy(int x, int y);
 extern void textcolor(int c);
 extern void output(const Common::String &s);
+extern void graphbackground(int c);
 extern int wherey;
 
+// Stubs for input functions
+extern bool keypressed();
+extern char get_ch();
+
 extern void palette(int v1);
 extern void intr(int intNum, registres &regs);
+extern int get_random_number(int minval, int maxval);
 
 // (* external 'c:\mc\charecr.com'; *)
 extern void s_char(int Gd, int y, int dy);
@@ -435,6 +442,10 @@ extern void decomp(int seg, int dep);
 extern void afff(int Gd, int seg, int dep, int x, int y); 
 // (* external 'c:\mc\reusint.com'; *)
 extern void musyc(tablint &tb, int nbseg, int att);  
+// (* external 'c:\mc\demus.com'; *)
+extern void demus(int Src, int Dst, int Tay);
+// (* external 'c:\mc\phint.com'; *)
+extern void litph(tablint &t, int typ, int tempo); 
 
 } // End of namespace Mortevielle
 


Commit: e6b0e592ec3cfd5746ab6a110c5b83116f2e68fa
    https://github.com/scummvm/scummvm/commit/e6b0e592ec3cfd5746ab6a110c5b83116f2e68fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:02-07:00

Commit Message:
MORTEVIELLE: Added stub engine implementation. Engine is now compilable.

Changed paths:
  A engines/mortevielle/detection.cpp
  A engines/mortevielle/detection_tables.h
  A engines/mortevielle/mortevielle.cpp
  A engines/mortevielle/mortevielle.h
    engines/mortevielle/module.mk
    engines/mortevielle/mort.cpp
    engines/mortevielle/mort.h



diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
new file mode 100644
index 0000000..df8a6df
--- /dev/null
+++ b/engines/mortevielle/detection.cpp
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public 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 "base/plugins.h"
+#include "engines/advancedDetector.h"
+
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/detection_tables.h"
+
+namespace Mortevielle {
+uint32 MortevielleEngine::getGameFlags() const { return _gameDescription->flags; }
+}
+
+static const PlainGameDescriptor MortevielleGame[] = {
+	{"mortevielle", "Mortville Manor"},
+	{0, 0}
+};
+
+class MortevielleMetaEngine : public AdvancedMetaEngine {
+public:
+	MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::gameDescriptions, sizeof(ADGameDescription), 
+		MortevielleGame) {
+	}
+	virtual const char *getName() const {
+		return "Mortevielle";
+	}
+
+	virtual const char *getOriginalCopyright() const {
+		return "Mortville Manor (C) 1988 Lankhor";
+	}
+
+	virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+	virtual bool hasFeature(MetaEngineFeature f) const;
+};
+
+bool MortevielleMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+	if (desc) {
+		*engine = new Mortevielle::MortevielleEngine(syst, desc);
+	}
+	return desc != 0;
+}
+
+bool MortevielleMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return false; 
+}
+
+#if PLUGIN_ENABLED_DYNAMIC(MORTEVIELLE)
+	REGISTER_PLUGIN_DYNAMIC(MORTEVIELLE, PLUGIN_TYPE_ENGINE, MortevielleMetaEngine);
+#else
+	REGISTER_PLUGIN_STATIC(MORTEVIELLE, PLUGIN_TYPE_ENGINE, MortevielleMetaEngine);
+#endif
diff --git a/engines/mortevielle/detection_tables.h b/engines/mortevielle/detection_tables.h
new file mode 100644
index 0000000..4ea062b
--- /dev/null
+++ b/engines/mortevielle/detection_tables.h
@@ -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.
+ *
+ */
+
+namespace Mortevielle {
+
+static const ADGameDescription gameDescriptions[] = {
+	{
+		"mortevielle",
+		"",
+		AD_ENTRY1s("mortvielle.txt", "d41d8cd98f00b204e9800998ecf8427e", 0),
+		Common::FR_FRA,
+		Common::kPlatformPC,
+		ADGF_UNSTABLE,
+		GUIO1(GUIO_NOASPECT)
+	},
+	AD_TABLE_END_MARKER
+};
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 3213d15..50ec3f0 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS := \
 	actions.o \
 	alert.o \
 	boite.o \
+	detection.o \
 	disk.o \
 	droite.o \
 	keyboard.o \
@@ -12,6 +13,7 @@ MODULE_OBJS := \
 	mor.o \
 	mor2.o \
 	mort.o \
+	mortevielle.o \
 	mouse.o \
 	outtext.o \
 	ovd1.o \
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index f3b0ac7..3a4df46 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -66,7 +66,7 @@ void divers(int np, bool b) {
 
 /* NIVEAU 0 */
 
-int main(int argc, const char *argv[]) {
+int mortevielle_main(int argc, const char *argv[]) {
 	/*init_debug;*/
 	/*  ecri_seg;*/
 	//pio_initialize(argc, argv);
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
index fa42288..8523774 100644
--- a/engines/mortevielle/mort.h
+++ b/engines/mortevielle/mort.h
@@ -32,7 +32,8 @@ namespace Mortevielle {
 
 extern void divers(int np, bool b);
 /* NIVEAU 0 */
-extern int main(int argc, const char *argv[]);
+extern int mortevielle_main(int argc, const char *argv[]);
+
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
new file mode 100644
index 0000000..dd93555
--- /dev/null
+++ b/engines/mortevielle/mortevielle.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mort.h"
+
+namespace Mortevielle {
+
+MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
+		Engine(system), _gameDescription(gameDesc) {
+}
+
+MortevielleEngine::~MortevielleEngine() {
+}
+
+bool MortevielleEngine::hasFeature(EngineFeature f) const {
+	return false;
+}
+
+Common::Error MortevielleEngine::run() {
+	// Dispatch to the game's main routine
+	const char *argv[] = { "" };
+	mortevielle_main(1, argv);
+
+	return Common::kNoError;
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
new file mode 100644
index 0000000..406f8fe
--- /dev/null
+++ b/engines/mortevielle/mortevielle.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public 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 MORTEVIELLE_H
+#define MORTEVIELLE_H
+
+#include "engines/advancedDetector.h"
+#include "engines/engine.h"
+#include "common/error.h"
+
+namespace Mortevielle {
+
+enum {
+	kMortevielleCore = 1 << 0
+};
+
+#define SCREEN_WIDTH 320
+#define SCREEN_HEIGHT 200
+
+class MortevielleEngine : public Engine {
+private:
+	const ADGameDescription *_gameDescription;
+public:
+	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
+	~MortevielleEngine();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual Common::Error run();
+
+	uint32 getGameFlags() const;
+};
+
+extern MortevielleEngine *g_vm;
+
+} // End of namespace Mortevielle
+
+#endif


Commit: df496a179a5f1ea5a9b95c448511d99457d5a91b
    https://github.com/scummvm/scummvm/commit/df496a179a5f1ea5a9b95c448511d99457d5a91b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:04-07:00

Commit Message:
MORTEVIELLE: Fix data loading in chartex method

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index e33f3e4..3c532d0 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -199,7 +199,9 @@ void ani50() {
 	if (!f.open("TXX.INP"))
 		error("Missing file - TXX.INP");
 
-	f.read(&t_mot, 125);
+	for (int i = 0; i < 125; ++i)
+		t_mot[i] = f.readSint16LE();
+
 	f.close();
 
 	if (!f.open("TXX.NTP"))


Commit: c8000518518f6b221bea8751af1bba6e18f9afaa
    https://github.com/scummvm/scummvm/commit/c8000518518f6b221bea8751af1bba6e18f9afaa
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:19:05-07:00

Commit Message:
MORTEVIELLE: Add a couple of detection entries

Changed paths:
    engines/mortevielle/detection.cpp



diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index df8a6df..53d4292 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -35,17 +35,49 @@ static const PlainGameDescriptor MortevielleGame[] = {
 	{0, 0}
 };
 
+static const ADGameDescription MortevielleGameDescriptions[] = {
+	{
+		"mortevielle",
+		"",
+		{
+			{"menufr.mor", 0, "e413f36b9e14eef16130adc347a9391f", 144},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
+		Common::FR_FRA,
+		Common::kPlatformPC,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+	{
+		"mortevielle",
+		"",
+		{
+			{"menual.mor", 0, "792aea282b07a1d74c4a4abeabc90c19", 144},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
+		Common::DE_DEU,
+		Common::kPlatformPC,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+	AD_TABLE_END_MARKER
+};
+
 class MortevielleMetaEngine : public AdvancedMetaEngine {
 public:
-	MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::gameDescriptions, sizeof(ADGameDescription), 
+	MortevielleMetaEngine() : AdvancedMetaEngine(MortevielleGameDescriptions, sizeof(ADGameDescription), 
 		MortevielleGame) {
+		_md5Bytes = 512;
+		_singleid = "mortevielle";
 	}
 	virtual const char *getName() const {
 		return "Mortevielle";
 	}
 
 	virtual const char *getOriginalCopyright() const {
-		return "Mortville Manor (C) 1988 Lankhor";
+		return "Mortville Manor (C) 1988-89 Lankhor";
 	}
 
 	virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;


Commit: b56d4a90ee65e2c05e1a9398da49594c472528c5
    https://github.com/scummvm/scummvm/commit/b56d4a90ee65e2c05e1a9398da49594c472528c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:10-07:00

Commit Message:
MORTEVIELLE: Bugfix for loading data in chartex()

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 3c532d0..99b2e28 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -199,19 +199,22 @@ void ani50() {
 	if (!f.open("TXX.INP"))
 		error("Missing file - TXX.INP");
 
-	for (int i = 0; i < 125; ++i)
+	assert(f.size() <= (maxti * 2));
+	for (i = 0; i < f.size() / 2; ++i)
 		t_mot[i] = f.readSint16LE();
 
 	f.close();
 
 	if (!f.open("TXX.NTP"))
 		error("Missing file - TXX.NTP");
-	do {
+	
+	assert(f.size() <= (maxtd * 4));
+	for (i = 0; i < (f.size() + 3) / 4; ++i) {
 		t_rec[i].indis = f.readSint16LE();
 		t_rec[i].point = f.readByte();
+		f.readByte();
+	}
 
-		i = i + 1;
-	} while (!f.eos());
 	f.close();
 
 	deline(578, s, i);


Commit: 1b2215e2ecd5b6030508f38d0f29b75a031c0891
    https://github.com/scummvm/scummvm/commit/1b2215e2ecd5b6030508f38d0f29b75a031c0891
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:11-07:00

Commit Message:
MORTEVIELLE: Bugfix for loading data in charpal()

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 99b2e28..751a099 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -150,7 +150,7 @@ void ani50() {
 
 	if (!ft.open("fxx.mor"))
 		error("Missing file - fxx.mor");
-	for (int i = 1; i < 108; ++i)
+	for (int i = 0; i < 108; ++i)
 		l[i] = ft.readSint16LE();
 	ft.close();
 


Commit: 3b77567fd53324c36681458fca83e23f74c4b112
    https://github.com/scummvm/scummvm/commit/3b77567fd53324c36681458fca83e23f74c4b112
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:13-07:00

Commit Message:
MORTEVIELLE: Bugfix for loading data in charge_cfiph()

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 751a099..6d17fcc 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -373,7 +373,9 @@ void ani50() {
 	if (!f.open("cfiph.mor"))
 		error("Missing file - cfiph.mor");
 
-	f.read(t_cph, 50);
+	for (int i = 0; i < (f.size() / 2); ++i)
+		t_cph[i] = f.readSint16LE();
+
 	f.close();
 }
 


Commit: 1f0ffd8299cc2de81cf50685df1a08ccc4dd47dd
    https://github.com/scummvm/scummvm/commit/1f0ffd8299cc2de81cf50685df1a08ccc4dd47dd
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:19:14-07:00

Commit Message:
MORTEVIELLE: Add some comments with translated strings

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/boite.cpp
    engines/mortevielle/disk.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5b420fb..81042c4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,7 +42,7 @@
 namespace Mortevielle {
 
 /* NIVEAU 4 */
-const char stouinon[] = "[2][ ][OUI][NON]";
+const char stouinon[] = "[2][ ][OUI][NON]";   //Translation: [2] [ ] [YES] [NO]
 
 /* overlay */
 void taller() {
@@ -56,7 +56,7 @@ void taller() {
 		repon(2, s.mlieu);
 	}
 	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
-		if (! syn)  ecr3("aller");
+		if (! syn)  ecr3("aller");                //Translation: Go to
 		tfleche();
 		if (iesc)  okdes = false;
 		if ((anyone) || (iesc))  return;
@@ -169,7 +169,7 @@ L2:
 		}
 		return;
 	}
-	if (! syn)  ecr3("prendre");
+	if (! syn)  ecr3("prendre");                 //Translation: Take
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	if (caff == 3) {
@@ -256,7 +256,7 @@ L2:
 {
 	int cx;
 
-	if (! syn)  ecr3("soulever");
+	if (! syn)  ecr3("soulever");                //Translation: Lift
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(3);
@@ -282,7 +282,7 @@ L2:
 
 	if (caff > 99)  st4(caff);
 	else {
-		if (! syn)  ecr3("lire");
+		if (! syn)  ecr3("lire");                //Translation: Read
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(4);
@@ -303,7 +303,7 @@ L2:
 		crep = 103;
 		return;
 	}
-	if (! syn)  ecr3("regarder");
+	if (! syn)  ecr3("regarder");            //Translation: Look
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(5);
@@ -364,7 +364,7 @@ L2:
 		st7(caff);
 		return;
 	}
-	if (! syn)  ecr3("fouiller");
+	if (! syn)  ecr3("fouiller");            //Translation: Search
 	tfleche();
 	if (anyone || iesc)  return;
 	if (s.mlieu == 23) {
@@ -431,7 +431,7 @@ L2:
 /* overlay */ void touvrir() {
 	int cx, haz;
 
-	if (! syn)  ecr3("ouvrir");
+	if (! syn)  ecr3("ouvrir");                  //Translation: Open
 	if (caff == 26) {
 		if (ment != 0) {
 			msg[4] = entrer;
@@ -492,7 +492,7 @@ L2:
 		crep = 186;
 		return;
 	}
-	if (! syn)  ecr3("mettre");
+	if (! syn)  ecr3("mettre");               //Translation: Put
 	tfleche();
 	if (iesc)  crep = 998;
 	if ((anyone) || (iesc))  return;
@@ -591,7 +591,7 @@ L2:
 		crep = 149;
 		return;
 	}
-	if (! syn)  ecr3("tourner");
+	if (! syn)  ecr3("tourner");             //Translation: Turn
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(9);
@@ -618,7 +618,7 @@ L2:
 }
 
 /* overlay */ void tcacher() {
-	if (! syn)  ecr3("se cacher");
+	if (! syn)  ecr3("se cacher");             //Translation: Hide self
 	tfleche();
 	if (!(anyone) && !(iesc)) {
 		tcoord(10);
@@ -633,7 +633,7 @@ L2:
 /* overlay */ void tattacher() {
 	if (s.derobj == 0)  crep = 186;
 	else {
-		if (! syn)  ecr3("attacher");
+		if (! syn)  ecr3("attacher");           //Translation: Tie
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(8);
@@ -653,7 +653,7 @@ L2:
 /* overlay */ void tfermer() {
 	int cx, chai;
 
-	if (! syn)  ecr3("fermer");
+	if (! syn)  ecr3("fermer");              //Translation: Close
 	if (caff < 26) {
 		tfleche();
 		if (iesc)  crep = 998;
@@ -682,9 +682,9 @@ L2:
 /* overlay */ void tfrapper() {
 	int l, p, haz;
 
-	if (! syn)  ecr3("frapper");
+	if (! syn)  ecr3("frapper");          //Translation: Hit
 	if (s.mlieu == 15) {
-		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);
+		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);  //Translation: [1] [ | Before, use the DEP menu...] [Ok]
 		return;
 	}
 	if (s.mlieu < 25) {
@@ -882,7 +882,7 @@ L2:
 }
 
 /* overlay */ void tdormir() {
-	const char m1[] = "D‚sirez-vous vous r‚veiller?";
+	const char m1[] = "D‚sirez-vous vous r‚veiller?";       //Translation: Do you want to wake up?
 	int z, j, h, m, quel;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
@@ -922,7 +922,7 @@ L2:
 }
 
 /* overlay */ void tdefoncer() {
-	if (! syn)  ecr3("d‚foncer");
+	if (! syn)  ecr3("d‚foncer");                     //Translation: Smash
 	if (caff < 25)  tfleche();
 	if ((! anyone) && (! iesc))
 		if (s.mlieu != 26)  crep = 997;
@@ -982,7 +982,7 @@ L2:
 }
 
 /* overlay */ void tsonder() {
-	if (! syn)  ecr3("sonder");
+	if (! syn)  ecr3("sonder");            //Translation: Probe
 	if (caff < 27) {
 		tfleche();
 		if (!(anyone) && (! iesc))  crep = 145;
@@ -1166,7 +1166,7 @@ L2:
 /* overlay */ void tsentir() {
 	crep = 119;
 	if (caff < 26) {
-		if (! syn)  ecr3("sentir");
+		if (! syn)  ecr3("sentir");        //Translation: Smell
 		tfleche();
 		if (!(anyone) && !(iesc))
 			if (caff == 16)  crep = 153;
@@ -1177,14 +1177,14 @@ L2:
 /* overlay */ void tgratter() {
 	crep = 155;
 	if (caff < 27) {
-		if (! syn)  ecr3("gratter");
+		if (! syn)  ecr3("gratter");       //Translation: Scratch
 		tfleche();
 	}
 	num = 0;
 }
 
 /* NIVEAU 2 */
-/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */
+/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */   //Translation: The game is over!!!
 	arret = true;
 	tlu(13, 152);
 	maivid();
@@ -1215,7 +1215,7 @@ L2:
 	inzon();
 }
 
-/* overlay */ void tencore() {         /* Perdu !!! */
+/* overlay */ void tencore() {         /* Perdu !!! */         //Translation: You lost!
 	int quel;
 
 	clsf2();
diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index 0a3b5da..6e29769 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -31,6 +31,7 @@
 
 namespace Mortevielle {
 
+//Translation: box()
 void boite(int x, int y, int dx, int dy, int coul) {
 	int i;
 	int xi, yi, xo, yo;
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index e2b1b9a..8a889f2 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -47,7 +47,7 @@ void dem1() {
 /* Deprecated in ScummVM
 	int k;
 
-	// -- demande de disk 1 --
+	// -- demande de disk 1 --           //Translation: Ask for disk #1
 	assign(f, "mort.005");
 	//*$i-*
 	k = ioresult;
@@ -106,9 +106,9 @@ void ld_game(int n) {
 	hide_mouse();
 	maivid();
 	takesav(n);
-	/* -- disquette 2 -- */
+	/* -- disquette 2 -- */                    //Translation: Floppy #2
 	dem2();
-	/* -- mises en place -- */
+	/* -- mises en place -- */                 //Translation: Initialization
 	theure();
 	dprog();
 	antegame();
@@ -122,7 +122,7 @@ void sv_game(int n) {
 	hide_mouse();
 	tmaj3();
 	dem1();
-	/* -- sauvegarde du fichier 'sauve#n.mor' -- */
+	/* -- sauvegarde du fichier 'sauve#n.mor' -- */               //Translation: save file 'sauve%d.mor'
 	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
 	s1 = s;
 	if (s1.mlieu == 26)  s1.mlieu = 15;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 556c7b4..47430ba 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -42,7 +42,7 @@
 namespace Mortevielle {
 
 /* Niveau 14 suite */
-const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";
+const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";       //Translation: Someone enters, looks surised, but says nothing
 
 // For ScummVM, we need to do check for file errors where we do the file access
 const int ioresult = 0;
@@ -146,7 +146,7 @@ void initouv() {
 }
 
 void ecrf1() {
-	boite(0, 11, 512, 163, 15);           /* grand dessin */
+	boite(0, 11, 512, 163, 15);           /* grand dessin */         //Translation: Large drawing
 }
 
 void clsf1() {
@@ -614,9 +614,9 @@ void affper(int per) {
 }
 
 void person() {
-	const char m1[] = "Vous";
-	const char m2[] = "ˆtes";
-	const char m3[] = "SEUL";
+	const char m1[] = "Vous"; //Translation: You
+	const char m2[] = "ˆtes"; //Translation: are
+	const char m3[] = "SEUL"; //Translation: ALONE
 	int cf;
 	Common::String str_;
 
@@ -671,7 +671,7 @@ void pendule() {
 	else writeg("AM ", 1);
 	putxy(550, 160);
 	if ((jou >= 0) && (jou <= 8)) {
-		Common::String tmp("& jour");
+		Common::String tmp("& jour");                 //Translation: Day
 		tmp.insertChar((char)(jou + 49), 0);
 		writeg(tmp, 1);
 	}
@@ -1322,9 +1322,9 @@ void dessin(int ad) {
 		clsf1();
 		if (caff > 99) {
 			dessine(ades, 60, 33);
-			boite(118, 32, 291, 121, 15);         /* cadre moyen */
+			boite(118, 32, 291, 121, 15);         /* cadre moyen */          //Translation: Medium box
 		} else if (caff > 69) {
-			dessine(ades, 112, 48);           /* tˆtes */
+			dessine(ades, 112, 48);           /* tˆtes */                    //Translation: Heads
 			boite(222, 47, 155, 91, 15);
 		} else {
 			dessine(ades, 0, 12);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c650002..1c2936d 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -46,9 +46,9 @@ const int men[12] = { 0,
 };
 
 void tinke() {
-	const char m1[] = "Mince! Vous entendez du bruit...";
-	const char d1[] = " | Vous devriez avoir remarqu‚|       ";
-	const char d2[] = "% des indices...";
+	const char m1[] = "Mince! Vous entendez du bruit...";       //Translation: Gosh! You hear some noise...
+	const char d1[] = " | Vous devriez avoir remarqu‚|       "; //Translation: You should have noticed
+	const char d2[] = "% des indices...";                       //Translation: %s of hints
 	const char d3 = '[';
 	const char d4 = ']';
 	const char d5 = '1';
@@ -465,18 +465,18 @@ void ajjer(int ob) {
 	} else crep = 139;
 }
 
-void t1sama() {    /* On entre dans le manoir */
+void t1sama() {    /* On entre dans le manoir */                 //Translation: Entering manor
 	int j, h, m;
 	bool d;
 
 	calch(j, h, m);
 	if ((h < 5) && (s.mlieu > 18)) {
 		cherjer(137, d);
-		if (! d) {        /* On n'a pas les cl‚s et il est tard */
+		if (! d) {        /* On n'a pas les cl‚s et il est tard */   //Translation: You don't have the keys, and it's late
 			crep = 1511;
 			tperd();
 		} else st1sama();
-	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */
+	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */   //Translation: Is it your first time?
 		ipers = 255;
 		affper(ipers);
 		caff = 77;
@@ -767,7 +767,7 @@ void st13(int ob) {
 void aldepl() {
 	int dummy;
 
-	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);
+	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);       //Translation: [1] [So, use the DEP menu] [Ok]
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 3a4df46..5975bde 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -26,28 +26,28 @@
  */
 
 #include "mortevielle/mort.h"
-#include "mortevielle/var_mor.h"          /* les variables */
-#include "mortevielle/keyboard.h"          /* la gestion du clavier */
-#include "mortevielle/mouse.h"          /* la souris  */
-#include "mortevielle/level15.h"          /* les fonctions de base */
-#include "mortevielle/droite.h"          /* pour faire une droite */
-#include "mortevielle/boite.h"
-#include "mortevielle/sprint.h"          /* l'affichage des textes */
-#include "mortevielle/outtext.h"          /* fonctions sup‚rieures d'affichage */
-#include "mortevielle/parole.h"          /* les fonctions de la parole */
+#include "mortevielle/var_mor.h"          /* les variables */                       //Translation: Variables
+#include "mortevielle/keyboard.h"          /* la gestion du clavier */              //Translation: Keyboard manager
+#include "mortevielle/mouse.h"          /* la souris  */                            //Translation: Mouse
+#include "mortevielle/level15.h"          /* les fonctions de base */               //Translation: Lowlevel functions
+#include "mortevielle/droite.h"          /* pour faire une droite */                //Translation: Display a lign
+#include "mortevielle/boite.h"                                                      //Translation: Box
+#include "mortevielle/sprint.h"          /* l'affichage des textes */               //Translation: Display texts
+#include "mortevielle/outtext.h"          /* fonctions sup‚rieures d'affichage */   //Translation: Highlevel display functions
+#include "mortevielle/parole.h"          /* les fonctions de la parole */           //Translation: Speech functions
 #include "mortevielle/alert.h"
-#include "mortevielle/parole2.h"          /* les fonctions de la parole */
-/*  debug              le debugging */
-#include "mortevielle/ques.h"          /* les questions */
-#include "mortevielle/menu.h"          /* les fonctions du menu */
-#include "mortevielle/mor.h"          /* divers */
-#include "mortevielle/taffich.h"          /* chargement des dessins */
-#include "mortevielle/ovd1.h"          /* les fonctions sur disque 1 */
-#include "mortevielle/mor2.h"          /* divers */
-#include "mortevielle/actions.h"          /* les actions */
-#include "mortevielle/prog.h"          /* fonctions toplevel */
-#include "mortevielle/disk.h"          /* chargements et sauvegardes */
-/*  ecrihexa            utilitaire */
+#include "mortevielle/parole2.h"          /* les fonctions de la parole */          //Translation: Speech functions
+/*  debug              le debugging */                                              //Translation: Debugger
+#include "mortevielle/ques.h"          /* les questions */                          //Translation: Questions
+#include "mortevielle/menu.h"          /* les fonctions du menu */                  //Translation: Menu functions
+#include "mortevielle/mor.h"          /* divers */                                  //Translation: Misc
+#include "mortevielle/taffich.h"          /* chargement des dessins */              //Translation: pictures loader
+#include "mortevielle/ovd1.h"          /* les fonctions sur disque 1 */             //Translation: Disk functions
+#include "mortevielle/mor2.h"          /* divers */                                 //Translation: Misc
+#include "mortevielle/actions.h"          /* les actions */                         //Translation: Actions
+#include "mortevielle/prog.h"          /* fonctions toplevel */                     //Translation: toplevel functions
+#include "mortevielle/disk.h"          /* chargements et sauvegardes */             //Translation: Load/Save
+/*  ecrihexa            utilitaire */                                               //Translation: Toolbox
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index c9bdcc7..e70ee10 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -142,7 +142,7 @@ void deline(int num , char *l , int &tl) {
 		j = j + 1;
 	} while (!the_end);
 	tl = j - 1;
-	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */
+	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */ //Translation: Remove '$'
 }       /* DETEX */
 
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 6d17fcc..cc09408 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -104,7 +104,7 @@ void ani50() {
 	f.read(lettres, 7 * 24);
 	f.close();
 
-	/* ----  Demande de changement de disquette  ---- */
+	// Ask to swap floppy
 	dem2();
 
 
@@ -279,6 +279,7 @@ void ani50() {
 	gotoxy(1, 23);
 	clreol;
 	gotoxy(26, 23);
+	// "Play using keyboard / ... mouse"
 	output("Jeu au Clavier / … la Souris");
 	textcolor(4);
 	gotoxy(33, 23);
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 3c78b04..fa71a1e 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -148,7 +148,7 @@ void veracf(byte b) {
 	Common::File f;
 	int i;
 
-	if (!f.open("bruits"))
+	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
 	f.read(&mem[adbruit + 0], 250);
@@ -263,7 +263,7 @@ void veracf(byte b) {
 
 	case 2:
 	case 3 : {
-		d3 = c2.code + 5; /*  7 ou 8  => voyelle correspondante  */
+		d3 = c2.code + 5; /*  7 ou 8  => voyelle correspondante  */ //Translation: Corresponding vowel
 		if (c1.code > 4) {
 			veracf(c2.acc);
 			if (c1.code == 9) {
@@ -318,7 +318,7 @@ void veracf(byte b) {
 		else d3 = 6;
 		if (c2.rep >= 5) {
 			c2.rep = c2.rep - 5;
-			d3 = 8 - d3;       /*  echange 2 et 6  */
+			d3 = 8 - d3;       /*  echange 2 et 6  */    //Translation: swap 2 and 6
 		}
 		if (c2.code == 0) {
 			i = c2.rep;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 760560e..236e785 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -178,38 +178,38 @@ void tsitu()
 			ctrm = 4;
 			goto L2;
 		}
-	if (msg[3] == depla)       taller();
-	if (msg[3] == discut)      tparler();
-	if (msg[3] == invent)      tsprendre();
-	if (msg[4] == attacher)    tattacher();
-	if (msg[4] == attendre)    tattendre();
-	if (msg[4] == defoncer)    tdefoncer();
-	if (msg[4] == dormir)      tdormir();
-	if (msg[4] == ecouter)     tecouter();
-	if (msg[4] == entrer)      tentrer();
-	if (msg[4] == fermer)      tfermer();
-	if (msg[4] == fouiller)    tfouiller();
-	if (msg[4] == frapper)     tfrapper();
-	if (msg[4] == gratter)     tgratter();
-	if (msg[4] == lire)        tlire();
-	if (msg[4] == manger)      tmanger();
-	if (msg[4] == mettre)      tmettre();
-	if (msg[4] == ouvrir)      touvrir();
-	if (msg[4] == prendre)     tprendre();
-	if (msg[4] == regarder)    tregarder();
-	if (msg[4] == sentir)      tsentir();
-	if (msg[4] == sonder)      tsonder();
-	if (msg[4] == sortir)      tsortir();
-	if (msg[4] == soulever)    tsoulever();
-	if (msg[4] == tourner)     ttourner();
-	if (msg[4] == scacher) {
+	if (msg[3] == depla)       taller();    //Translation: go to
+	if (msg[3] == discut)      tparler();   //Translation: talk
+	if (msg[3] == invent)      tsprendre(); //Translation: inventory/take
+	if (msg[4] == attacher)    tattacher(); //Translation: tie
+	if (msg[4] == attendre)    tattendre(); //Translation: wait
+	if (msg[4] == defoncer)    tdefoncer(); //Translation: smash
+	if (msg[4] == dormir)      tdormir();   //Translation: sleep
+	if (msg[4] == ecouter)     tecouter();  //Translation: listen
+	if (msg[4] == entrer)      tentrer();   //Translation: enter
+	if (msg[4] == fermer)      tfermer();   //Translation: close
+	if (msg[4] == fouiller)    tfouiller(); //Translation: search
+	if (msg[4] == frapper)     tfrapper();  //Translation: hit
+	if (msg[4] == gratter)     tgratter();  //Translation: scratch
+	if (msg[4] == lire)        tlire();     //Translation: read
+	if (msg[4] == manger)      tmanger();   //Translation: eat
+	if (msg[4] == mettre)      tmettre();   //Translation: put
+	if (msg[4] == ouvrir)      touvrir();   //Translation: open
+	if (msg[4] == prendre)     tprendre();  //Translation: take
+	if (msg[4] == regarder)    tregarder(); //Translation: look
+	if (msg[4] == sentir)      tsentir();   //Translation: smell
+	if (msg[4] == sonder)      tsonder();   //Translation: probe
+	if (msg[4] == sortir)      tsortir();   //Translation: exit
+	if (msg[4] == soulever)    tsoulever(); //Translation: lift
+	if (msg[4] == tourner)     ttourner();  //Translation: turn
+	if (msg[4] == scacher) {                //Translation: hide
 		tcacher();
 		goto L1;
 	}
-	if (msg[4] == sfouiller)   tsfouiller();
-	if (msg[4] == slire)       tslire();
-	if (msg[4] == sposer)      tposer();
-	if (msg[4] == sregarder)   tsregarder();
+	if (msg[4] == sfouiller)   tsfouiller();//Translation: search 
+	if (msg[4] == slire)       tslire();    //Translation: read
+	if (msg[4] == sposer)      tposer();    //Translation: put
+	if (msg[4] == sregarder)   tsregarder();//Translation: look
 	cache = false;
 L1:
 	if (anyone) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 33ddfe6..1a4a88e 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -72,16 +72,16 @@ const byte don[9][5] = {
 
 const char *fic[3] = {
 	"", 
-	" Sauvegarde",
-	 " Chargement"
+	" Sauvegarde",  // Translation: "Save"
+	 " Chargement"  // Translation: "Load"
 };
 
 const byte addv[2] = {8, 8};
 
-const char recom[] = " Recommence  ";
+const char recom[] = " Recommence  "; // Translation: "Restart"
 
-const char f3[] = "F3: Encore";
-const char f8[] = "F8: Suite";
+const char f3[] = "F3: Encore";       // Translation: "F3: More"
+const char f8[] = "F8: Suite";        // Translation: "F8: Next"
 
 const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
@@ -189,7 +189,7 @@ int x,
 int t_cph[6401];
 byte tabdon[4001];
 /*   t_dxx  : array[0..121] of int;*/
-Common::String stpou;                               /* donne le % d'indices */
+Common::String stpou;               /* donne le % d'indices */ //Translation: "Provides the % of hints"
 byte is;
 char mode;
 Common::String al_mess,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 4427bc0..5fda6ae 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -32,6 +32,9 @@
 
 namespace Mortevielle {
 
+// Constants, types and variables used by Mortville Manor.
+// version Nov.'88, Music and speech Oct.'88
+
 /*         Constantes, Types et Variables pour le
 
               M A N O I R   DE   M O R T E V I E L L E
@@ -100,7 +103,7 @@ const int c_dialpre = 456;
 const int c_action = 476;
 const int c_saction = 497;
 const int c_dis = 502;
-const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
+const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */ // Translation: "=> doesn't exist ; yes !!" 
 
 const int arega = 0;
 const int asoul = 154;
@@ -345,7 +348,7 @@ extern int x,
 extern int t_cph[6401];
 extern byte tabdon[4001];
 /*   t_dxx  : array[0..121] of int;*/
-extern Common::String stpou;                               /* donne le % d'indices */
+extern Common::String stpou;            /* donne le % d'indices */  // Translation: "provides the % of hints"
 extern byte is;
 extern char mode;
 extern Common::String al_mess,


Commit: 1ae3a52cd2f39ba09377302762e8ae3ce5e5b2c8
    https://github.com/scummvm/scummvm/commit/1ae3a52cd2f39ba09377302762e8ae3ce5e5b2c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:15-07:00

Commit Message:
MORTEVIELLE: Reimplemented the zzuul assembly routine in C code

Changed paths:
  A engines/mortevielle/asm.cpp
  A engines/mortevielle/asm.h
    engines/mortevielle/module.mk



diff --git a/engines/mortevielle/asm.cpp b/engines/mortevielle/asm.cpp
new file mode 100644
index 0000000..2d057a3
--- /dev/null
+++ b/engines/mortevielle/asm.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "common/scummsys.h"
+
+namespace Mortevielle {
+
+/**
+ * Decodes a number of 64 byte blocks
+ * @param pStart	Start of data
+ * @param count		Number of 64 byte blocks
+ */
+void zzuul(byte *pStart, int count) {
+	while (count-- > 0) {
+		for (int idx = 0; idx < 64; ++pStart, ++idx) {
+			uint16 v = ((*pStart - 0x80) << 1) + 0x80;
+
+			if (v & 0x8000)
+				*pStart = 0;
+			else if (v & 0xff00)
+				*pStart = 0xff;
+			else 
+				*pStart = (byte)v;
+		}
+	}
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/asm.h b/engines/mortevielle/asm.h
new file mode 100644
index 0000000..11793b3
--- /dev/null
+++ b/engines/mortevielle/asm.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_ASM_H
+#define MORTEVIELLE_ASM_H
+
+namespace Mortevielle {
+
+extern void zzuul(byte *pStart, int count);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 50ec3f0..21cb025 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/mortevielle
 MODULE_OBJS := \
 	actions.o \
 	alert.o \
+	asm.o \
 	boite.o \
 	detection.o \
 	disk.o \


Commit: 635d9b3b90fbb17b73c75344c24f2d4318c5ad84
    https://github.com/scummvm/scummvm/commit/635d9b3b90fbb17b73c75344c24f2d4318c5ad84
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:17-07:00

Commit Message:
MORTEVIELLE: Reimplemented the loading of cfiec.mor more cleanly

This includes changing the absolute memory address loading to an array buffer, and changing calls to the zzuul method to use the reimplemented version.

Changed paths:
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 992a268..dae117e 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -27,6 +27,7 @@
 
 #include "mortevielle/keyboard.h"
 #include "mortevielle/var_mor.h"
+#include "mortevielle/asm.h"
 
 namespace Mortevielle {
 
@@ -70,7 +71,7 @@ int testou() {
 	break;
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
-			zzuul(adcfiec + 161, 0, 1644);
+			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			c_zzz = succ(int, c_zzz);
 			testou_result = 61;
 			return testou_result;
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 5975bde..ea8cbcb 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -27,6 +27,7 @@
 
 #include "mortevielle/mort.h"
 #include "mortevielle/var_mor.h"          /* les variables */                       //Translation: Variables
+#include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"          /* la gestion du clavier */              //Translation: Keyboard manager
 #include "mortevielle/mouse.h"          /* la souris  */                            //Translation: Mouse
 #include "mortevielle/level15.h"          /* les fonctions de base */               //Translation: Lowlevel functions
@@ -78,7 +79,7 @@ int mortevielle_main(int argc, const char *argv[]) {
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
-	zzuul(adcfiec + 161, 0, 1644);
+	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	c_zzz = 1;
 	init_nbrepm();
 	init_mouse();
@@ -123,7 +124,8 @@ int mortevielle_main(int argc, const char *argv[]) {
 	adzon();
 	takesav(0);
 	if (rech_cfiec)  charge_cfiec();
-	for (crep = 1; crep <= c_zzz; crep ++) zzuul(adcfiec + 161, 0, 1644);
+	for (crep = 1; crep <= c_zzz; crep ++) 
+		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	charge_bruit5();
 	init_menu();
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index cc09408..6400463 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -359,9 +359,7 @@ void ani50() {
 	if (!f.open("cfiec.mor"))
 		error("Missing file - cfiec.mor");
 
-	/*$i-*/
-	f.read(&mem[adcfiec + 0], 511);
-	f.read(&mem[adcfiec + 4088 + 0], 311);
+	f.read(&adcfiec[0], 822 * 128);
 	f.close();
 
 	rech_cfiec = false;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 1a4a88e..a017e55 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -231,6 +231,8 @@ doublet tabpal[91][17];
 t_pcga palcga[91];
 pattern tpt[15];
 
+byte adcfiec[(4088 * 16) + (311 * 0x80)];
+
 /*---------------------------------------------------------------------------*/
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
 /*---------------------------------------------------------------------------*/
@@ -385,11 +387,6 @@ void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
 	warning("TODO: box method not yet implemented");
 }
 
-// (* external 'c:\mc\zuul.com'; *)
-void zzuul(int ad, int seg, int tai) {
-	warning("TODO: zzuul");
-}
-
 // (* external 'c:\mc\decomp.com'; *)
 void decomp(int seg, int dep) {
 	warning("TODO: decomp");
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5fda6ae..c75fc78 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -32,9 +32,6 @@
 
 namespace Mortevielle {
 
-// Constants, types and variables used by Mortville Manor.
-// version Nov.'88, Music and speech Oct.'88
-
 /*         Constantes, Types et Variables pour le
 
               M A N O I R   DE   M O R T E V I E L L E
@@ -69,7 +66,6 @@ const int segdon = 0x6c00;
 const int adani = 0x7314;
 const int adword = 0x4000;
 const int adtroct = 0x406b;
-const int adcfiec = 0x4300;
 const int adbruit = 0x5cb0;/*2C00;*/
 const int adbruit1 = 0x6924;/*3874;*/
 const int adbruit2 = 0x6b30;/*3A80;*/
@@ -103,7 +99,7 @@ const int c_dialpre = 456;
 const int c_action = 476;
 const int c_saction = 497;
 const int c_dis = 502;
-const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */ // Translation: "=> doesn't exist ; yes !!" 
+const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
 
 const int arega = 0;
 const int asoul = 154;
@@ -174,7 +170,6 @@ extern const char f8[];
 
 extern const byte rang[16];
 
-
 /*---------------------------------------------------------------------------*/
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -348,7 +343,7 @@ extern int x,
 extern int t_cph[6401];
 extern byte tabdon[4001];
 /*   t_dxx  : array[0..121] of int;*/
-extern Common::String stpou;            /* donne le % d'indices */  // Translation: "provides the % of hints"
+extern Common::String stpou;                               /* donne le % d'indices */
 extern byte is;
 extern char mode;
 extern Common::String al_mess,
@@ -390,6 +385,8 @@ extern doublet tabpal[91][17];
 extern t_pcga palcga[91];
 extern pattern tpt[15];
 
+extern byte adcfiec[822 * 128];
+
 /*---------------------------------------------------------------------------*/
 /*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -437,8 +434,6 @@ extern void s_char(int Gd, int y, int dy);
 extern void s_sauv(int Gd, int y, int dy);
 // (* external 'c:\mc\boite.com'; *)
 extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
-// (* external 'c:\mc\zuul.com'; *)
-extern void zzuul(int ad, int seg, int tai); 
 // (* external 'c:\mc\decomp.com'; *)
 extern void decomp(int seg, int dep); 
 // (* external 'c:\mc\affich.com'; *)


Commit: b70bed24f9cae8bf2c22e4e87ff26fe52b0e9252
    https://github.com/scummvm/scummvm/commit/b70bed24f9cae8bf2c22e4e87ff26fe52b0e9252
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:18-07:00

Commit Message:
MORTEVIELLE: Fixed some compiler warnings

Changed paths:
    engines/mortevielle/sprint.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 0523651..b35bff9 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -45,8 +45,7 @@ void writeg(Common::String l, int c)
 
 {
 	int i, x, xo, yo;
-	int cecr;
-	bool t;
+	int cecr = 0;
 
 	/*  debug('writeg : '+l);*/
 
@@ -81,7 +80,7 @@ void writeg(Common::String l, int c)
 	}
 	xo = xo + 1;
 	yo = yo + 1;
-	for (x = 1; x <= l.size(); x ++) {
+	for (x = 1; x <= (int)l.size(); x ++) {
 		affcar(gd, xo, yo, cecr, ord(l[x]));
 		xo = xo + i;
 	}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 3cde8eb..1a126d0 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -105,7 +105,7 @@ void taffich() {
 
 	int i, m, a, b, cx, handle,
 	        npal;
-	float lgt, lhandle;
+	float lgt;
 	Common::String nom;
 	int palh, k, j;
 	int alllum[16];


Commit: 91412dce33d854f29d8a6535523c9835528bf85e
    https://github.com/scummvm/scummvm/commit/91412dce33d854f29d8a6535523c9835528bf85e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:19-07:00

Commit Message:
MORTEVIELLE: Cleaned up the init_nbrepm method

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 47430ba..bfb8655 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -989,11 +989,8 @@ void init_nbrepm() {
 	int i;
 
 	/* debug('init_nbrepm'); */
-	i = 0;
-	do {
-		i = succ(int, i);
-		nbrepm[i] = ipm[i];
-	} while (!(i == 8));
+	for (int idx = 0; idx < 9; ++idx)
+		nbrepm[idx] = ipm[idx];
 }
 
 void phaz(int &haz, int &p, int cf) {


Commit: 55acfe2bea243dce3f4d09872614596fd5e8445e
    https://github.com/scummvm/scummvm/commit/55acfe2bea243dce3f4d09872614596fd5e8445e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:20-07:00

Commit Message:
MORTEVIELLE: Bugfix for loading data in init_lieu method

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 6400463..eb0bd8b 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -300,7 +300,8 @@ void ani50() {
 		error("Missing file - MXX.mor");
 
 	for (int i = 1; i < 8; ++i)
-		f_lieu.read(&v_lieu[i][1], 24);
+		for (int j = 0; j < 25; ++j)
+			v_lieu[i][j] = f_lieu.readByte(); 
 
 	f_lieu.close();
 }


Commit: b689eec4d8dd432e2dab1ff0d297ea5b5e4eb6c1
    https://github.com/scummvm/scummvm/commit/b689eec4d8dd432e2dab1ff0d297ea5b5e4eb6c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:22-07:00

Commit Message:
MORTEVIELLE: Correct loading of the text data index, and fixed decoding of text lines

Changed paths:
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e70ee10..b42aa48 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -72,11 +72,11 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
 	};
 */
-	int oct, ocd;
+	uint16 oct, ocd;
 
 	/* 5-8 */
 	oct = t_mot[idx];
-	oct = (uint)(oct << (16 - pt)) >> (16 - pt);
+	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
 	if (pt < 6) {
 		idx = idx + 1;
 		oct = oct << (5 - pt);
@@ -96,7 +96,7 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	case 30:
 	case 31 : {
 		ocd = t_mot[idx];
-		ocd = (uint)(ocd << (16 - pt)) >> (16 - pt);
+		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
 			idx = idx + 1;
 			ocd = ocd << (5 - pt);
@@ -119,7 +119,10 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	}
 }              /* 5-8 */
 
-void deline(int num , char *l , int &tl) {
+/**
+ * Decode and extract the line with the given Id
+ */
+void deline(int num, char *l , int &tl) {
 	int i, j, ts;
 	char let;
 	byte ps, k;
@@ -142,7 +145,8 @@ void deline(int num , char *l , int &tl) {
 		j = j + 1;
 	} while (!the_end);
 	tl = j - 1;
-	if (tl < 255)  delig = copy(delig, 1, tl - 1); /* enleve le $ */ //Translation: Remove '$'
+	if (tl < 255)
+		delig.deleteLastChar();		// Remove trailing '$'
 }       /* DETEX */
 
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index eb0bd8b..4eb990c 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -201,18 +201,17 @@ void ani50() {
 
 	assert(f.size() <= (maxti * 2));
 	for (i = 0; i < f.size() / 2; ++i)
-		t_mot[i] = f.readSint16LE();
+		t_mot[i] = f.readUint16LE();
 
 	f.close();
 
 	if (!f.open("TXX.NTP"))
 		error("Missing file - TXX.NTP");
 	
-	assert(f.size() <= (maxtd * 4));
-	for (i = 0; i < (f.size() + 3) / 4; ++i) {
+	assert(f.size() <= (maxtd * 3));
+	for (i = 0; i < (f.size() / 3); ++i) {
 		t_rec[i].indis = f.readSint16LE();
 		t_rec[i].point = f.readByte();
-		f.readByte();
 	}
 
 	f.close();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index a017e55..0d3f88d 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/debug.h"
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "mortevielle/sprint.h"
@@ -216,7 +217,7 @@ byte lettres[7][24];
 
 byte palher[16];
 
-int t_mot[maxti + 1];
+uint16 t_mot[maxti + 1];
 int tay_tchar;
 ind t_rec[maxtd + 1];
 //file<ind> sauv_t;
@@ -349,6 +350,7 @@ void gotoxy(int x, int y) {
 void textcolor(int c) {
 }
 void output(const Common::String &s) {
+	debug(s.c_str());
 }
 void graphbackground(int c) {
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index c75fc78..63d3112 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -370,7 +370,7 @@ extern byte lettres[7][24];
 
 extern byte palher[16];
 
-extern int t_mot[maxti + 1];
+extern uint16 t_mot[maxti + 1];
 extern int tay_tchar;
 extern ind t_rec[maxtd + 1];
 //file<ind> sauv_t;


Commit: bc32861ec0cd6875e231e53a976955b649aa1665
    https://github.com/scummvm/scummvm/commit/bc32861ec0cd6875e231e53a976955b649aa1665
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:23-07:00

Commit Message:
MORTEVIELLE: Initialise graphics, and hardcode game mode to EGA graphics with mouse enabled

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index dd93555..68b8dbe 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "engines/util.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mort.h"
 
@@ -37,6 +38,9 @@ bool MortevielleEngine::hasFeature(EngineFeature f) const {
 }
 
 Common::Error MortevielleEngine::run() {
+	// Initialise graphics mode
+	initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true);
+
 	// Dispatch to the game's main routine
 	const char *argv[] = { "" };
 	mortevielle_main(1, argv);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 406f8fe..14bee28 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -33,8 +33,8 @@ enum {
 	kMortevielleCore = 1 << 0
 };
 
-#define SCREEN_WIDTH 320
-#define SCREEN_HEIGHT 200
+#define SCREEN_WIDTH 640
+#define SCREEN_HEIGHT 400
 
 class MortevielleEngine : public Engine {
 private:
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 4eb990c..a1a47a2 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -232,7 +232,7 @@ void ani50() {
 	int cy, tay;
 	char st[1410];
 	float ix;
-	char ch;
+//	char ch;
 
 
 	/* debug('o3 dialpre'); */
@@ -257,6 +257,8 @@ void ani50() {
 	output("CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512");
 	gotoxy(12, 24);
 	output("Ctrl       C      E            H             T           A");
+
+/*
 	do {
 		ch = get_ch();	// input >> kbd >> ch;
 	} while ((ch != '\1') && (ch != '\3') && (ch != '\5') && (ch != '\24') && (ch != '\10'));
@@ -272,7 +274,10 @@ void ani50() {
 	case '\24' :
 		gd = tan;
 		break;
-	}
+	}*/
+	// Hardcode display mode to EGA
+	gd = ega;
+
 	gotoxy(1, 24);
 	clreol;
 	gotoxy(1, 23);
@@ -285,10 +290,13 @@ void ani50() {
 	output("C");
 	gotoxy(48, 23);
 	output("S");
+	/*
 	do {
 		ch = get_ch();	// input >> kbd >> ch;
 	} while ((ch != 'C') && (ch != 'S'));
 	int_m = (toupper(ch) == 'S');
+	*/
+	int_m = true;
 }
 
 /* overlay */ void init_lieu() {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0d3f88d..a8b10c1 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -239,6 +239,8 @@ byte adcfiec[(4088 * 16) + (311 * 0x80)];
 /*---------------------------------------------------------------------------*/
 
 void hirs() {
+	/* Deprecated set graphics 
+
 	const byte tandy[14] = {113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0};
 	const byte herc[13] = {50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0};
 	int i;
@@ -253,21 +255,19 @@ void hirs() {
 	break;
 	case ams : {
 		hires;
-		/* 
-		inline_((float)(0xb8) / 6 / 0 / //  =>  mov ax,6
-		        0xcd / 0x10);			//  =>  int 16
+		//inline_((float)(0xb8) / 6 / 0 / //  =>  mov ax,6
+		//        0xcd / 0x10);			//  =>  int 16
 		port[0x3d9] = 15;
 		port[0x3df] = 0;
 		port[0x3dd] = 15;
-		*/
+
 		res = 2;
 	}
 	break;
 	case ega : {
-		/*
-		inline_((float)(0xb8) / 14 / 0 /     //  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs
-		        0xcd / 0x10);				//   INT 16
-		*/
+		//inline_((float)(0xb8) / 14 / 0 /     //  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs
+		//        0xcd / 0x10);				//   INT 16
+
 		res = 2;
 	}
 	break;
@@ -278,9 +278,9 @@ void hirs() {
 			port[0x3b4] = i;
 			port[0x3b5] = herc[i];
 		}
-		/*
-		inline_((float)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
-		*/
+
+		//inline_((float)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
+
 		port[0x3b8] = 10;
 		res = 2;
 	}
@@ -303,6 +303,7 @@ void hirs() {
 	}
 	break;
 	}
+	*/
 }
 
 /* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */


Commit: 6535e88046bbf46d3f792deca67062de653708c2
    https://github.com/scummvm/scummvm/commit/6535e88046bbf46d3f792deca67062de653708c2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:24-07:00

Commit Message:
MORTEVIELLE: Fix character indexing in writeg()

Changed paths:
    engines/mortevielle/sprint.cpp



diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index b35bff9..e6a172b 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -81,7 +81,7 @@ void writeg(Common::String l, int c)
 	xo = xo + 1;
 	yo = yo + 1;
 	for (x = 1; x <= (int)l.size(); x ++) {
-		affcar(gd, xo, yo, cecr, ord(l[x]));
+		affcar(gd, xo, yo, cecr, ord(l[x - 1]));
 		xo = xo + i;
 	}
 	show_mouse();


Commit: 07cce9cb94ce75fa3189e897661036486dd57bae
    https://github.com/scummvm/scummvm/commit/07cce9cb94ce75fa3189e897661036486dd57bae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:26-07:00

Commit Message:
MORTEVIELLE: New create_mortdat project to create a mort.dat data file

At the moment, this extracts needed font data from the mort.com executable.

Changed paths:
  A devtools/create_mortdat/create_mortdat.cpp
  A devtools/create_mortdat/module.mk
  A dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
new file mode 100644
index 0000000..62b8180
--- /dev/null
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -0,0 +1,152 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This is a utility for extracting needed resource data from different language
+ * version of the Lure of the Temptress lure.exe executable files into a new file
+ * lure.dat - this file is required for the ScummVM  Lure of the Temptress module
+ * to work properly
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/endian.h"
+
+enum AccessMode {
+	kFileReadMode = 1,
+	kFileWriteMode = 2
+};
+
+class File {
+private:
+	FILE *f;
+public:
+	bool open(const char *filename, AccessMode mode = kFileReadMode) {
+		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
+		return (f != NULL);
+	}
+	void close() {
+		fclose(f);
+		f = NULL;
+	}
+	int seek(int32 offset, int whence = SEEK_SET) {
+		return fseek(f, offset, whence);
+	}
+	long read(void *buffer, int len) {
+		return fread(buffer, 1, len, f);
+	}
+	void write(const void *buffer, int len) {
+		fwrite(buffer, 1, len, f);
+	}
+	byte readByte() {
+		byte v;
+		read(&v, sizeof(byte));
+		return v;
+	}
+	uint16 readWord() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_LE_16(v);
+	}
+	uint32 readLong() {
+		uint32 v;
+		read(&v, sizeof(uint32));
+		return FROM_LE_32(v);
+	}
+	void writeByte(byte v) {
+		write(&v, sizeof(byte));
+	}
+	void writeWord(uint16 v) {
+		uint16 vTemp = TO_LE_16(v);
+		write(&vTemp, sizeof(uint16));
+	}
+	void writeLong(uint32 v) {
+		uint32 vTemp = TO_LE_32(v);
+		write(&vTemp, sizeof(uint32));
+	}
+	uint32 pos() {
+		return ftell(f);
+	}
+};
+
+File outputFile, mortCom;
+
+/*-------------------------------------------------------------------------*/
+
+#define VERSION_MAJOR 1
+#define VERSION_MINOR 0
+
+void openOutputFile(const char *outFilename) {
+	outputFile.open(outFilename, kFileWriteMode);
+
+	// Write header
+	outputFile.write("mort", 4);
+	outputFile.writeByte(VERSION_MAJOR);
+	outputFile.writeByte(VERSION_MINOR);
+}
+
+void process() {
+	byte checkBuffer[7];
+	byte fontBuffer[121 * 6];
+
+	// Move to just prior the font data and verify that we're reading the known mort.com
+	mortCom.seek(0x36b0);
+	mortCom.read(checkBuffer, 7);
+
+	if ((checkBuffer[0] != 0x59) || (checkBuffer[1] != 0x5B) || (checkBuffer[2] != 0x58) ||
+		(checkBuffer[3] != 0xC3) || (checkBuffer[4] != 0xE8) || (checkBuffer[5] != 0xD6) ||
+		(checkBuffer[6] != 0x02)) {
+		printf("Invalid mort.com input file");
+		exit(0);
+	}
+
+	// Read in the data
+	mortCom.read(fontBuffer, 121 * 6);
+
+	// Write out a section header to the output file and the font data
+	char fontHeader[4] = { 'F', 'O', 'N', 'T' };
+	outputFile.write(fontHeader, 4);
+	outputFile.write(fontBuffer, 121 * 6);
+}
+
+int main(int argc, char *argv[]) {
+	if (argc != 3) {
+		printf("Format: input_filename output_filename\n", argv[0]);
+		exit(0);
+	}
+
+	mortCom.open(argv[1], kFileReadMode);
+	openOutputFile(argv[2]);
+
+	process();
+
+	mortCom.close();
+	outputFile.close();
+}
diff --git a/devtools/create_mortdat/module.mk b/devtools/create_mortdat/module.mk
new file mode 100644
index 0000000..86b14d8
--- /dev/null
+++ b/devtools/create_mortdat/module.mk
@@ -0,0 +1,11 @@
+
+MODULE := devtools/create_mortdat
+
+MODULE_OBJS := \
+	create_mortdat.o \
+
+# Set the name of the executable
+TOOL_EXECUTABLE := create_mortdat
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
new file mode 100644
index 0000000..ce4e5bb
Binary files /dev/null and b/dists/engine-data/mort.dat differ


Commit: 5d9b9f10850bda9f3a3a755dd65c2fe4a6ccb1dd
    https://github.com/scummvm/scummvm/commit/5d9b9f10850bda9f3a3a755dd65c2fe4a6ccb1dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:27-07:00

Commit Message:
MORTEVIELLE: Implemented loading of the font data, and rewrote drawing routines to use it.

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    dists/engine-data/mort.dat
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 62b8180..aa7da01 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -107,7 +107,7 @@ void openOutputFile(const char *outFilename) {
 	outputFile.open(outFilename, kFileWriteMode);
 
 	// Write header
-	outputFile.write("mort", 4);
+	outputFile.write("MORT", 4);
 	outputFile.writeByte(VERSION_MAJOR);
 	outputFile.writeByte(VERSION_MINOR);
 }
@@ -132,7 +132,9 @@ void process() {
 
 	// Write out a section header to the output file and the font data
 	char fontHeader[4] = { 'F', 'O', 'N', 'T' };
-	outputFile.write(fontHeader, 4);
+	outputFile.write(fontHeader, 4);	// Section Id
+	outputFile.writeWord(121 * 6);		// Section size
+
 	outputFile.write(fontBuffer, 121 * 6);
 }
 
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index ce4e5bb..ebfb8a8 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 68b8dbe..43534a6 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -20,14 +20,22 @@
  *
  */
 
+#include "common/system.h"
 #include "engines/util.h"
+#include "engines/engine.h"
+#include "graphics/palette.h"
+#include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mort.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
+MortevielleEngine *g_vm;
+
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
 		Engine(system), _gameDescription(gameDesc) {
+	g_vm = this;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -37,10 +45,136 @@ bool MortevielleEngine::hasFeature(EngineFeature f) const {
 	return false;
 }
 
-Common::Error MortevielleEngine::run() {
+Common::ErrorCode MortevielleEngine::initialise() {
 	// Initialise graphics mode
 	initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true);
 
+	// Set up an intermediate screen surface
+	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
+
+	// Set the screen mode
+	gd = ega;
+	res = 2;
+
+	// Load the mort.dat resource
+	return loadMortDat();
+}
+
+/**
+ * Loads the contents of the Mort.dat data file
+ */
+Common::ErrorCode MortevielleEngine::loadMortDat() {
+	Common::File f;
+
+	// Open the mort.dat file
+	if (!f.open(MORT_DAT)) {
+		GUIErrorMessage("Could not locate Mort.dat file");
+		return Common::kReadingFailed;
+	}
+
+	// Validate the data file header
+	char fileId[4];
+	f.read(fileId, 4);
+	if (strncmp(fileId, "MORT", 4) != 0) {
+		GUIErrorMessage("The located mort.dat data file is invalid");
+		return Common::kReadingFailed;
+	}
+
+	// Check the version
+	if (f.readByte() < MORT_DAT_REQUIRED_VERSION) {
+		GUIErrorMessage("The located mort.dat data file is too a version");
+		return Common::kReadingFailed;
+	}
+	f.readByte();		// Minor version
+
+	// Loop to load resources from the data file
+	while (f.pos() < f.size()) {
+		// Get the Id and size of the next resource
+		char dataType[4];
+		int dataSize;
+		f.read(dataType, 4);
+		dataSize = f.readUint16LE();
+
+		if (!strncmp(dataType, "FONT", 4)) {
+			// Font resource
+			assert(dataSize == (FONT_NUM_CHARS * FONT_HEIGHT));
+			f.read(_fontData, FONT_NUM_CHARS * FONT_HEIGHT);
+		} else {
+			// Unknown section
+			f.skip(dataSize);
+		}
+	}
+
+	f.close();
+	return Common::kNoError;
+}
+
+/*-------------------------------------------------------------------------*/
+
+/**
+ * Update the physical screen
+ */
+void MortevielleEngine::updateScreen() {
+	g_system->copyRectToScreen((const byte *)_screenSurface.getBasePtr(0, 0), 
+		SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+	g_system->updateScreen();
+}
+/**
+ * Draws a character at the specified co-ordinates
+ * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
+ *		simulate the original 640x200 surface, all Y values have to be doubled
+ */
+void MortevielleEngine::writeCharacter(const Common::Point &pt, unsigned char ch, 
+		int palIndex, Graphics::Surface *surface) {
+	if (surface == NULL)
+		surface = &_screenSurface;
+
+	// Get the start of the character to use
+	assert((ch >= ' ') && (ch <= (unsigned char)(32 + FONT_NUM_CHARS)));
+	const byte *charData = &_fontData[((int)ch - 32) * FONT_HEIGHT];
+
+	// Loop through decoding each character's data
+	for (int yp = 0; yp < FONT_HEIGHT; ++yp) {
+		byte *lineP = (byte *)surface->getBasePtr(pt.x, (pt.y + yp) * 2);
+		byte byteVal = *charData++;
+
+		for (int xp = 0; xp < 8; ++xp, ++lineP, byteVal <<= 1) {
+			if (byteVal & 0x80) {
+				*lineP = palIndex;
+				*(lineP + SCREEN_WIDTH) = palIndex;
+			}
+		}
+	}
+}
+
+/**
+ * Sets a single pixel at the specified co-ordinates
+ * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
+ *		simulate the original 640x200 surface, all Y values have to be doubled
+ */
+void MortevielleEngine::setPixel(const Common::Point &pt, int palIndex, 
+		Graphics::Surface *surface) {
+	if (surface == NULL)
+		surface = &_screenSurface;
+
+	byte *destP = (byte *)surface->getBasePtr(pt.x, pt.y * 2);
+	*destP = palIndex;
+	*(destP + SCREEN_WIDTH) = palIndex;
+}
+
+
+/*-------------------------------------------------------------------------*/
+
+Common::Error MortevielleEngine::run() {
+	// Initialise the game
+	Common::ErrorCode err = initialise();
+	if (err != Common::kNoError)
+		return err;
+
+	// TODO: Remove once palette loading is correctly done
+	uint32 white = 0xffffffff;
+	g_system->getPaletteManager()->setPalette((const byte *)&white, 15, 1);
+
 	// Dispatch to the game's main routine
 	const char *argv[] = { "" };
 	mortevielle_main(1, argv);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 14bee28..b9d8265 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -23,9 +23,12 @@
 #ifndef MORTEVIELLE_H
 #define MORTEVIELLE_H
 
+#include "common/file.h"
+#include "common/rect.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
 #include "common/error.h"
+#include "graphics/surface.h"
 
 namespace Mortevielle {
 
@@ -35,17 +38,34 @@ enum {
 
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
+#define MORT_DAT_REQUIRED_VERSION 1
+#define MORT_DAT "mort.dat"
+
+#define FONT_WIDTH 8
+#define FONT_HEIGHT 6
+#define FONT_NUM_CHARS 121
 
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
+
+	Common::ErrorCode initialise();
+	Common::ErrorCode loadMortDat();
+	void loadFont(Common::File &f);
+public:
+	Graphics::Surface _screenSurface;
+	byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
 	virtual bool hasFeature(EngineFeature f) const;
 	virtual Common::Error run();
-
 	uint32 getGameFlags() const;
+
+	void updateScreen();
+	void writeCharacter(const Common::Point &pt,
+		unsigned char ch, int palIndex, Graphics::Surface *surface = NULL);
+	void setPixel(const Common::Point &pt, int palIndex, Graphics::Surface *surface = NULL);
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 1aaea06..d78b458 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/rect.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
 
@@ -256,7 +257,7 @@ void show_mouse() {
 	}
 	break;
 	}    /*  case Gd   */
-	affput(2, gd, x_s, y_s, 0, 0);
+	affput(Common::Point(x_s, y_s), 0, 0);
 }
 
 void pos_mouse(int x, int y) {
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index a1a47a2..3aa942c 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -275,8 +275,6 @@ void ani50() {
 		gd = tan;
 		break;
 	}*/
-	// Hardcode display mode to EGA
-	gd = ega;
 
 	gotoxy(1, 24);
 	clreol;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index e6a172b..67bd3ab 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -27,6 +27,7 @@
 
 #include "common/str.h"
 #include "common/textconsole.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
@@ -85,6 +86,9 @@ void writeg(Common::String l, int c)
 		xo = xo + i;
 	}
 	show_mouse();
+
+	// TODO: Move screen updates to main loop once constructed
+	g_vm->updateScreen();
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index a8b10c1..e07a735 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -28,6 +28,7 @@
 #include "common/debug.h"
 #include "common/str.h"
 #include "common/textconsole.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
@@ -306,18 +307,25 @@ void hirs() {
 	*/
 }
 
-/* procedure affput(Chx,Gd,x,y,coul,char:int); external 'c:\mc\divaf.com'; */
-void affput(int Chx, int Gd, int x, int y, int coul, int char_) {
-	warning("TODO: Implement affput");
+/**
+ * Draws either a single pixel or a character to the screen
+ */
+void affput(const Common::Point &pt, int palIndex, int ch) {
+	if (ch == 0)
+		g_vm->setPixel(pt, palIndex);
+	else
+		g_vm->writeCharacter(pt, ch, palIndex);
 }
 
 void affcar(int gd, int x, int y, int coul, int chr) {
-	if (res == 1)  affput(1, gd, ((uint)x >> 1), y, coul, chr);
-	else affput(1, gd, x, y, coul, chr);
+	if (res == 1)  
+		affput(Common::Point(((uint)x >> 1), y), coul, chr);
+	else 
+		affput(Common::Point(x, y), coul, chr);
 }
 
 void putpix(int gd, int x, int y, int coul) {
-	affput(0, gd, x, y, coul, 0);
+	affput(Common::Point(x, y), coul, 0);
 }
 
 /**
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 63d3112..f9c29e2 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -28,6 +28,7 @@
 #ifndef MORTEVIELLE_VAR_H
 #define MORTEVIELLE_VAR_H
 
+#include "common/rect.h"
 #include "common/str.h"
 
 namespace Mortevielle {
@@ -396,7 +397,7 @@ void affcar(int gd, int x, int y, int coul, int chr);
 void putpix(int gd, int x, int y, int coul);
 Common::String copy(const Common::String &s, int idx, size_t size);
 void Val(const Common::String &s, int &V, int Code);
-void affput(int Chx, int Gd, int x, int y, int coul, int char_);
+void affput(const Common::Point &pt, int palIndex, int ch);
 
 /*---------------------------------------------------------------------------*/
 /*------------------------------     STUBS     ------------------------------*/


Commit: 65a9f7a83d95661f2dd02f7bd3314649ba883a5b
    https://github.com/scummvm/scummvm/commit/65a9f7a83d95661f2dd02f7bd3314649ba883a5b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:28-07:00

Commit Message:
MORTEVIELLE: Change mem array to be 640Kb, and correct segment offsets using the array

Changed paths:
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index a2d5432..5195e7c 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -66,7 +66,7 @@ void outbloc(int n, pattern p, t_nhom pal) {
 		ad = ad + 4;
 		for (i = 1; i <= p.tax; i ++)
 			for (j = 1; j <= p.tay; j ++)
-				mem[0x6000 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
+				mem[0x6000 * 16 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
 	}
 }
 
@@ -81,8 +81,8 @@ void writepal(int n) {
 	case ega:
 	case ams :
 		for (i = 1; i <= 16; i ++) {
-			mem[0x7000 + 2 * i] = tabpal[n][i].x;
-			mem[0x7000 + succ(int, 2 * i)] = tabpal[n][i].y;
+			mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x;
+			mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y;
 		}
 		break;
 	case cga : {
@@ -99,8 +99,8 @@ void writepal(int n) {
 void pictout(int seg, int dep, int x, int y) {
 	decomp(seg, dep);
 	if (gd == her) {
-		mem[0x7000 + 2] = 0;
-		mem[0x7000 + 32] = 15;
+		mem[0x7000 * 16 + 2] = 0;
+		mem[0x7000 * 16 + 32] = 15;
 	}
 	if ((caff != 51) && (memw[0x7000 + 0x4138] > 0x100))  memw[0x7000 + 0x4138] = 0x100;
 	afff(gd, seg, dep, x, y);
@@ -174,7 +174,7 @@ void adzon() {
 
 	if (!f.open("dec.mor"))
 		error("Missing files - dec.moir");
-	f.read(&mem[0x73a2 + 0], 1);
+	f.read(&mem[0x73a2 * 16 + 0], 1);
 	/*i:=0;
 	repeat
 	  read(g,a);
@@ -188,7 +188,7 @@ int animof(int ouf, int num) {
 	int nani, aux;
 
 	int animof_result;
-	nani = mem[adani + 1];
+	nani = mem[adani * 16 + 1];
 	aux = num;
 	if (ouf != 1)  aux = aux + nani;
 	animof_result = (nani << 2) + 2 + swap(memw[adani + (aux << 1)]);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index bfb8655..4af3967 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -109,7 +109,7 @@ void dessine_rouleau() {
 	/* debug('dessine_rouleau'); */
 	writepal(89);
 	if (gd == her) {
-		mem[0x7000 + 14] = 15;
+		mem[0x7000 * 16 + 14] = 15;
 	}
 	hide_mouse();
 	pictout(0x73a2, 0, 0, 0);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d78b458..1ae0441 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -139,10 +139,10 @@ void hide_mouse() {
 				k = 0;
 				j = p_o_s;
 				do {
-					ps = mem[0xa000 + j];
-					mem[0xa000 + j] = lo(s_s[i][k]);
-					ps = mem[0xa000 + j + 1];
-					mem[0xa000 + j + 1] = hi(s_s[i][k]);
+					ps = mem[0xa000 * 16 + j];
+					mem[0xa000 * 16 + j] = lo(s_s[i][k]);
+					ps = mem[0xa000 * 16 + j + 1];
+					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j = j + 80;
 					k = succ(int, k);
 				} while (!(k >= 8));
@@ -227,7 +227,7 @@ void show_mouse() {
 			k = 0;
 			j = p_o_s;
 			do {
-				s_s[l][k] = mem[0xa000 + j] + (mem[0xa000 + succ(int, j)] << 8);
+				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 + succ(int, j)] << 8);
 				j = j + 80;
 				k = succ(int, k);
 			} while (!(k >= 8));
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 3aa942c..89dde41 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -327,8 +327,8 @@ void ani50() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&mem[0x3800 + 0], 500);
-	fic.read(&mem[0x47a0 + 0], 123);
+	fic.read(&mem[0x3800 * 16 + 0], 500);
+	fic.read(&mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
 	demus(0x3800, 0x5000, 623);
@@ -353,7 +353,7 @@ void ani50() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&mem[adbruit5 + 0], 149);
+	f.read(&mem[adbruit5 * 16 + 0], 149);
 	/*blockread(f,mem[$5CB0:0],100);
 	blockread(f,mem[$3D1F:0],49);*/
 	f.close();
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index fa71a1e..7f8476d 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -87,7 +87,7 @@ void charg_car() {
 
 
 void entroct(byte o) {
-	mem[adtroct + ptr_oct] = o;
+	mem[adtroct * 16 + ptr_oct] = o;
 	ptr_oct = ptr_oct + 1;
 }
 
@@ -125,9 +125,9 @@ void veracf(byte b) {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 	
-	f.read(&mem[0x7414 + 0], 273);
-	/*blockread(f,mem[adson+0],300);
-	blockread(f,mem[adson+2400+0],245);*/
+	f.read(&mem[0x7414 * 16 + 0], 273);
+	/*blockread(f,mem[adson * 16+0],300);
+	blockread(f,mem[adson * 16+2400+0],245);*/
 	demus(0x7414, adson, 273);
 	f.close();
 }
@@ -151,9 +151,9 @@ void veracf(byte b) {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&mem[adbruit + 0], 250);
-	for (i = 0; i <= 19013; i ++) mem[adbruit + 32000 + i] = mem[adbruit5 + i];
-	f.read(&mem[adbruit1 + offsetb1], 149);
+	f.read(&mem[adbruit * 16 + 0], 250);
+	for (i = 0; i <= 19013; i ++) mem[adbruit * 16 + 32000 + i] = mem[adbruit5 + i];
+	f.read(&mem[adbruit1 * 16 + offsetb1], 149);
 
 	f.close();
 }
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1a126d0..449e003 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -56,14 +56,14 @@ void chardes(Common::String nom, float passe, int long_) {
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(&mem[0x6000 + i], 1);
+		f.read(&mem[0x6000 * 16 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7000 + i - p] = mem[0x6000 + i];
+	for (i = p; i <= long_ + p; i ++) mem[0x7000 * 16 + i - p] = mem[0x6000 + i];
 	/*$i+*/
 }
 
@@ -89,14 +89,14 @@ void charani(Common::String nom, float passe, int long_) {
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(&mem[0x6000 + i], 1);
+		f.read(&mem[0x6000 * 16 + i], 1);
 		testfi();
 		l = l - 128;
 		i = i + 128;
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7314 + i - p] = mem[0x6000 + i];
+	for (i = p; i <= long_ + p; i ++) mem[0x7314 * 16 + i - p] = mem[0x6000 + i];
 }
 
 void taffich() {
@@ -188,7 +188,7 @@ void taffich() {
 		for (i = 0; i <= 15; i ++) {
 			k = 0;
 			for (j = 0; j <= 15; j ++) if (alllum[j] > alllum[k])  k = j;
-			mem[0x7000 + 2 + (k << 1)] = rang[i];
+			mem[0x7000 * 16 + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index e07a735..589a0bb 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -350,7 +350,7 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 /*---------------------------------------------------------------------------*/
 
 int port[0xfff];
-byte mem[0xffff];
+byte mem[65536 * 16];
 int memw[0xffff];
 int wherey;
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index f9c29e2..fbd324b 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -405,7 +405,7 @@ void affput(const Common::Point &pt, int palIndex, int ch);
 // TODO: Replace the following with proper implementations, or refactor out the code using them
 
 extern int port[0xfff];
-extern byte mem[0xffff];
+extern byte mem[65536 * 16];
 extern int memw[0xffff];
 
 #define hires {}


Commit: 3215d824c4f355f8f80339cd42ae9f85fc65b4d8
    https://github.com/scummvm/scummvm/commit/3215d824c4f355f8f80339cd42ae9f85fc65b4d8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:30-07:00

Commit Message:
MORTEVIELLE: Converted memw[] usage to use mem[] array with endian macros

This is better for now, since mem and memw share the same memory space.

Changed paths:
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 5195e7c..bd908b4 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -61,8 +61,8 @@ void outbloc(int n, pattern p, t_nhom pal) {
 
 	ad = n * 404 + 0xd700;
 	{
-		memw[0x6000 + ad] = p.tax;
-		memw[0x6000 + ad + 2] = p.tay;
+		WRITE_LE_UINT16(&mem[0x6000 + ad], p.tax);
+		WRITE_LE_UINT16(&mem[0x6000 + ad + 2], p.tay);
 		ad = ad + 4;
 		for (i = 1; i <= p.tax; i ++)
 			for (j = 1; j <= p.tay; j ++)
@@ -102,7 +102,8 @@ void pictout(int seg, int dep, int x, int y) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
-	if ((caff != 51) && (memw[0x7000 + 0x4138] > 0x100))  memw[0x7000 + 0x4138] = 0x100;
+	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&mem[0x7000 + 0x4138], 0x100);
 	afff(gd, seg, dep, x, y);
 }
 
@@ -191,10 +192,10 @@ int animof(int ouf, int num) {
 	nani = mem[adani * 16 + 1];
 	aux = num;
 	if (ouf != 1)  aux = aux + nani;
-	animof_result = (nani << 2) + 2 + swap(memw[adani + (aux << 1)]);
+	animof_result = (nani << 2) + 2 + swap(READ_LE_UINT16(&mem[adani + (aux << 1)]));
 	/*aux:= nani shl 2 + 2;
-	if ouf=1 then aux:= aux+ swap(memw[adani: num shl 1])
-	         else aux:= aux+ swap(memw[adani: (nani+num) shl 1]);
+	if ouf=1 then aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: num shl 1])
+	         else aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: (nani+num) shl 1]);
 	animof:=aux;*/
 	return animof_result;
 }
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4af3967..ede69a5 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/endian.h"
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
@@ -1231,8 +1232,8 @@ void messint(int nu) {
 	clsf2();
 	clsf3();
 	decomp(0x73a2, 1008);
-	memw[0x7413 + 12] = 80;
-	memw[0x7413 + 14] =  40;
+	WRITE_LE_UINT16(&mem[0x7413 + 12], 80);
+	WRITE_LE_UINT16(&mem[0x7413 + 14], 40);
 	writepal(90);
 	afff(gd, 0x73a2, 1008, 0, 0);
 	afff(gd, 0x73a2, 1008, 0, 70);
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index ea8cbcb..9b05196 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -83,9 +83,9 @@ int mortevielle_main(int argc, const char *argv[]) {
 	c_zzz = 1;
 	init_nbrepm();
 	init_mouse();
-	/*  crep:=memw[$7f00:0];
-	  memw[$7f00:0]:= crep+1;
-	  if (memw[$7f00:0]<> crep+1) then
+	/*  crep:=WRITE_LE_UINT16(&mem[$7f00:0];
+	  WRITE_LE_UINT16(&mem[$7f00:0]:= crep+1;
+	  if (WRITE_LE_UINT16(&mem[$7f00:0]<> crep+1) then
 	     begin
 	       hirs;
 	       show_mouse;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 1ae0441..e7eb225 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/endian.h"
 #include "common/rect.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
@@ -57,7 +58,7 @@ void init_mouse() {
 	/*int_m:= False;*/
 	clic = false;
 	m_show = m_arrow;
-	if ((memw[0xcc] == 0) && (memw[0xce] == 0))  int_m = false;
+	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))  int_m = false;
 	if (int_m) {
 		reg.ax = 0;
 		intr(0x33, reg);
@@ -101,10 +102,10 @@ void hide_mouse() {
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
-				memw[0xb000 + j] = s_s[0][k];
-				memw[0xb800 + j + 2] = s_s[1][k];
-				memw[0xba00 + j] = s_s[2][k];
-				memw[0xba00 + j + 2] = s_s[3][k];
+				WRITE_LE_UINT16(&mem[0xb000 + j], s_s[0][k]);
+				WRITE_LE_UINT16(&mem[0xb800 + j + 2], s_s[1][k]);
+				WRITE_LE_UINT16(&mem[0xba00 + j], s_s[2][k]);
+				WRITE_LE_UINT16(&mem[0xba00 + j + 2], s_s[3][k]);
 				j = j + 80;
 				k = succ(int, k);
 			} while (!(k >= 5));
@@ -117,10 +118,10 @@ void hide_mouse() {
 				j = p_o_s;
 				do {
 					if (imp) {
-						memw[0xb800 + j] = s_s[i][k];
+						WRITE_LE_UINT16(&mem[0xb800 + j], s_s[i][k]);
 						j = j + 80 - 0x2000;
 					} else {
-						memw[0xb800 + j] = s_s[i][k];
+						WRITE_LE_UINT16(&mem[0xb800 + j], s_s[i][k]);
 						j = j + 0x2000;
 					}
 					imp = ! imp;
@@ -153,7 +154,8 @@ void hide_mouse() {
 		case her : {
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; i ++) {
-				for (k = 0; k <= 3; k ++) memw[0xb000 + k * 0x200 + j] = s_s[i][k];
+				for (k = 0; k <= 3; k ++) 
+					WRITE_LE_UINT16(&mem[0xb000 + k * 0x200 + j], s_s[i][k]);
 				j = j + 80;
 			}
 		}
@@ -163,8 +165,8 @@ void hide_mouse() {
 			k = 0;
 			do {
 				for (i = 0; i <= 3; i ++) {
-					memw[0xb800 + 0x200 * i + j] = s_s[k][i + (k << 2)];
-					memw[0xb800 + 0x200 * i + j + 2] = s_s[k + 3][i + (k << 2)];
+					WRITE_LE_UINT16(&mem[0xb800 + 0x200 * i + j], s_s[k][i + (k << 2)]);
+					WRITE_LE_UINT16(&mem[0xb800 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j = j + 160;
 				k = succ(int, k);
@@ -190,10 +192,10 @@ void show_mouse() {
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
-			s_s[0][k] = memw[0xb800 + j];
-			s_s[1][k] = memw[0xb800 + j + 2];
-			s_s[2][k] = memw[0xba00 + j];
-			s_s[3][k] = memw[0xba00 + j + 2];
+			s_s[0][k] = READ_LE_UINT16(&mem[0xb800 + j]);
+			s_s[1][k] = READ_LE_UINT16(&mem[0xb800 + j + 2]);
+			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 + j]);
+			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 + j + 2]);
 			j = j + 80;
 			k = succ(int, k);
 		} while (!(k >= 5));
@@ -207,10 +209,10 @@ void show_mouse() {
 			k = 0;
 			do {
 				if (imp) {
-					s_s[i][k] = memw[0xb800 + j];
+					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 + j]);
 					j = j + 80 - 0x2000;
 				} else {
-					s_s[i][k] = memw[0xb800 + j];
+					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 + j]);
 					j = j + 0x2000;
 				}
 				imp = ! imp;
@@ -238,7 +240,8 @@ void show_mouse() {
 	case her : {
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; i ++) {
-			for (k = 0; k <= 3; k ++) s_s[i][k] = memw[0xb000 + k * 0x200 + j];
+			for (k = 0; k <= 3; k ++)
+				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 + k * 0x200 + j]);
 			j = j + 80;
 		}
 	}
@@ -248,8 +251,8 @@ void show_mouse() {
 		k = 0;
 		do {
 			for (i = 0; i <= 3; i ++) {
-				s_s[k][i + (k << 2)] = memw[0xb800 + 0x200 * i + j];
-				s_s[k + 3][i + (k << 2)] = memw[0xb800 + 0x200 * i + j + 2];
+				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 + 0x200 * i + j]);
+				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 + 0x200 * i + j + 2]);
 			}
 			j = j + 160;
 			k = succ(int, k);
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 7f8476d..76d6c9a 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -45,7 +45,7 @@ void spfrac(int wor) {
 void charg_car() {
 	int wor, int_;
 
-	wor = swap(memw[adword + ptr_word]);
+	wor = swap(READ_LE_UINT16(&mem[adword + ptr_word]));
 	int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -113,7 +113,7 @@ void veracf(byte b) {
 	i = offsetb3 + 8590;
 	j = 0;
 	do {
-		t_cph[j] = memw[adbruit3 + i];
+		t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
 		i = i + 2;
 		j = j + 1;
 	} while (!(i >= offsetb3 + 8790));
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index be8c17b..cba5588 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/endian.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/parole.h"
@@ -62,7 +63,7 @@ void trait_ph() {
 	ptr_tcph = (uint)ledeb >> 1;
 	ptr_word = 0;
 	do {
-		memw[adword + ptr_word] = t_cph[ptr_tcph];
+		WRITE_LE_UINT16(&mem[adword + ptr_word], t_cph[ptr_tcph]);
 		ptr_word = ptr_word + 2;
 		ptr_tcph = ptr_tcph + 1;
 	} while (!(ptr_tcph >= (int)((uint)lefin >> 1)));
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 449e003..1cb0f76 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -182,7 +182,7 @@ void taffich() {
 	chardes(nom, lgt, handle);
 	if (gd == her) {
 		for (i = 0; i <= 15; i ++) {
-			palh = memw[0x7000 + (succ(int, i) << 1)];
+			palh = READ_LE_UINT16(&mem[0x7000 + (succ(int, i) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (i = 0; i <= 15; i ++) {
@@ -221,7 +221,7 @@ void taffich() {
 /*    begin
       for i:=0 to 15 do
          begin
-           PalH:=memw[$7000:succ(i) shl 1];
+           PalH:=WRITE_LE_UINT16(&mem[$7000:succ(i) shl 1];
            Alllum[i]:=PalH and 15 + PalH shr 4 and 15 + PalH shr 8 and 15;
          end;
       for i:=0 to 15 do
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 589a0bb..5166f20 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -351,7 +351,6 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 
 int port[0xfff];
 byte mem[65536 * 16];
-int memw[0xffff];
 int wherey;
 
 void gotoxy(int x, int y) {
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index fbd324b..16ab044 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -406,7 +406,6 @@ void affput(const Common::Point &pt, int palIndex, int ch);
 
 extern int port[0xfff];
 extern byte mem[65536 * 16];
-extern int memw[0xffff];
 
 #define hires {}
 #define mortevielle_exit(ret) error("Exit the game")


Commit: 92d60a29ed23a4653a8390d21587e9646b49dfd3
    https://github.com/scummvm/scummvm/commit/92d60a29ed23a4653a8390d21587e9646b49dfd3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:31-07:00

Commit Message:
MORTEVIELLE: Fixed compiler warning

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ede69a5..e9366b0 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -987,7 +987,6 @@ void debloc(int l) {
 /* NIVEAU 10 */
 void init_nbrepm() {
 	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
-	int i;
 
 	/* debug('init_nbrepm'); */
 	for (int idx = 0; idx < 9; ++idx)


Commit: deaaf4dd5e3de18c3e2bb312603ddbbcff0eb714
    https://github.com/scummvm/scummvm/commit/deaaf4dd5e3de18c3e2bb312603ddbbcff0eb714
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2012-04-05T23:19:32-07:00

Commit Message:
MORTEVIELLE: Fix memory offsets in rest of the places

Changed paths:
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index bd908b4..d7193bf 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -61,8 +61,8 @@ void outbloc(int n, pattern p, t_nhom pal) {
 
 	ad = n * 404 + 0xd700;
 	{
-		WRITE_LE_UINT16(&mem[0x6000 + ad], p.tax);
-		WRITE_LE_UINT16(&mem[0x6000 + ad + 2], p.tay);
+		WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
+		WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
 		ad = ad + 4;
 		for (i = 1; i <= p.tax; i ++)
 			for (j = 1; j <= p.tay; j ++)
@@ -102,8 +102,8 @@ void pictout(int seg, int dep, int x, int y) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
-	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&mem[0x7000 + 0x4138], 0x100);
+	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
 	afff(gd, seg, dep, x, y);
 }
 
@@ -192,7 +192,7 @@ int animof(int ouf, int num) {
 	nani = mem[adani * 16 + 1];
 	aux = num;
 	if (ouf != 1)  aux = aux + nani;
-	animof_result = (nani << 2) + 2 + swap(READ_LE_UINT16(&mem[adani + (aux << 1)]));
+	animof_result = (nani << 2) + 2 + swap(READ_LE_UINT16(&mem[adani * 16 + (aux << 1)]));
 	/*aux:= nani shl 2 + 2;
 	if ouf=1 then aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: num shl 1])
 	         else aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: (nani+num) shl 1]);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e9366b0..373a800 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1231,8 +1231,8 @@ void messint(int nu) {
 	clsf2();
 	clsf3();
 	decomp(0x73a2, 1008);
-	WRITE_LE_UINT16(&mem[0x7413 + 12], 80);
-	WRITE_LE_UINT16(&mem[0x7413 + 14], 40);
+	WRITE_LE_UINT16(&mem[0x7413 * 16 + 12], 80);
+	WRITE_LE_UINT16(&mem[0x7413 * 16 + 14], 40);
 	writepal(90);
 	afff(gd, 0x73a2, 1008, 0, 0);
 	afff(gd, 0x73a2, 1008, 0, 70);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index e7eb225..2fc6e10 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -102,10 +102,10 @@ void hide_mouse() {
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
-				WRITE_LE_UINT16(&mem[0xb000 + j], s_s[0][k]);
-				WRITE_LE_UINT16(&mem[0xb800 + j + 2], s_s[1][k]);
-				WRITE_LE_UINT16(&mem[0xba00 + j], s_s[2][k]);
-				WRITE_LE_UINT16(&mem[0xba00 + j + 2], s_s[3][k]);
+				WRITE_LE_UINT16(&mem[0xb000 * 16 + j], s_s[0][k]);
+				WRITE_LE_UINT16(&mem[0xb800 * 16 + j + 2], s_s[1][k]);
+				WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
+				WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j = j + 80;
 				k = succ(int, k);
 			} while (!(k >= 5));
@@ -118,10 +118,10 @@ void hide_mouse() {
 				j = p_o_s;
 				do {
 					if (imp) {
-						WRITE_LE_UINT16(&mem[0xb800 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
 						j = j + 80 - 0x2000;
 					} else {
-						WRITE_LE_UINT16(&mem[0xb800 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
 						j = j + 0x2000;
 					}
 					imp = ! imp;
@@ -155,7 +155,7 @@ void hide_mouse() {
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; i ++) {
 				for (k = 0; k <= 3; k ++) 
-					WRITE_LE_UINT16(&mem[0xb000 + k * 0x200 + j], s_s[i][k]);
+					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j = j + 80;
 			}
 		}
@@ -165,8 +165,8 @@ void hide_mouse() {
 			k = 0;
 			do {
 				for (i = 0; i <= 3; i ++) {
-					WRITE_LE_UINT16(&mem[0xb800 + 0x200 * i + j], s_s[k][i + (k << 2)]);
-					WRITE_LE_UINT16(&mem[0xb800 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
+					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
+					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j = j + 160;
 				k = succ(int, k);
@@ -192,10 +192,10 @@ void show_mouse() {
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
-			s_s[0][k] = READ_LE_UINT16(&mem[0xb800 + j]);
-			s_s[1][k] = READ_LE_UINT16(&mem[0xb800 + j + 2]);
-			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 + j]);
-			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 + j + 2]);
+			s_s[0][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
+			s_s[1][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j + 2]);
+			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
+			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
 			j = j + 80;
 			k = succ(int, k);
 		} while (!(k >= 5));
@@ -209,10 +209,10 @@ void show_mouse() {
 			k = 0;
 			do {
 				if (imp) {
-					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 + j]);
+					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
 					j = j + 80 - 0x2000;
 				} else {
-					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 + j]);
+					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
 					j = j + 0x2000;
 				}
 				imp = ! imp;
@@ -229,7 +229,7 @@ void show_mouse() {
 			k = 0;
 			j = p_o_s;
 			do {
-				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 + succ(int, j)] << 8);
+				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 * 16 + succ(int, j)] << 8);
 				j = j + 80;
 				k = succ(int, k);
 			} while (!(k >= 8));
@@ -241,7 +241,7 @@ void show_mouse() {
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; i ++) {
 			for (k = 0; k <= 3; k ++)
-				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 + k * 0x200 + j]);
+				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j]);
 			j = j + 80;
 		}
 	}
@@ -251,8 +251,8 @@ void show_mouse() {
 		k = 0;
 		do {
 			for (i = 0; i <= 3; i ++) {
-				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 + 0x200 * i + j]);
-				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 + 0x200 * i + j + 2]);
+				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
+				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
 			j = j + 160;
 			k = succ(int, k);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1cb0f76..619cf7a 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -63,7 +63,7 @@ void chardes(Common::String nom, float passe, int long_) {
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7000 * 16 + i - p] = mem[0x6000 + i];
+	for (i = p; i <= long_ + p; i ++) mem[0x7000 * 16 + i - p] = mem[0x6000 * 16 + i];
 	/*$i+*/
 }
 
@@ -96,7 +96,7 @@ void charani(Common::String nom, float passe, int long_) {
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7314 * 16 + i - p] = mem[0x6000 + i];
+	for (i = p; i <= long_ + p; i ++) mem[0x7314 * 16 + i - p] = mem[0x6000 * 16 + i];
 }
 
 void taffich() {
@@ -182,7 +182,7 @@ void taffich() {
 	chardes(nom, lgt, handle);
 	if (gd == her) {
 		for (i = 0; i <= 15; i ++) {
-			palh = READ_LE_UINT16(&mem[0x7000 + (succ(int, i) << 1)]);
+			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (i = 0; i <= 15; i ++) {


Commit: 80a1325445fe77d1153e1eb3b44271194237cee0
    https://github.com/scummvm/scummvm/commit/80a1325445fe77d1153e1eb3b44271194237cee0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:34-07:00

Commit Message:
MORTEVIELLE: Fixed loading in chardes() method

Changed paths:
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 619cf7a..8e8e3de 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -56,14 +56,15 @@ void chardes(Common::String nom, float passe, int long_) {
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(&mem[0x6000 * 16 + i], 1);
+		f.read(&mem[0x6000 * 16 + i], 128);
 		testfi();
 		l = l - 128;
 		i = i + 128;
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7000 * 16 + i - p] = mem[0x6000 * 16 + i];
+	for (i = p; i <= long_ + p; i ++) 
+		mem[0x7000 * 16 + i - p] = mem[0x6000 * 16 + i];
 	/*$i+*/
 }
 


Commit: 79eae88fac7c7fedd585e118ce6eb2b9394e1622
    https://github.com/scummvm/scummvm/commit/79eae88fac7c7fedd585e118ce6eb2b9394e1622
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:35-07:00

Commit Message:
MORTEVIELLE: Fix data loading in charani() method

Changed paths:
    engines/mortevielle/level15.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index d7193bf..86319e0 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "common/file.h"
+#include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
@@ -97,6 +98,10 @@ void writepal(int n) {
 
 
 void pictout(int seg, int dep, int x, int y) {
+	GfxSurface surface;
+	surface.decode(&mem[0x7000 * 16]);
+
+warning("TODO: complete picture decoding");
 	decomp(seg, dep);
 	if (gd == her) {
 		mem[0x7000 * 16 + 2] = 0;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 8e8e3de..78eccbb 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -90,7 +90,7 @@ void charani(Common::String nom, float passe, int long_) {
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
-		f.read(&mem[0x6000 * 16 + i], 1);
+		f.read(&mem[0x6000 * 16 + i], 128);
 		testfi();
 		l = l - 128;
 		i = i + 128;


Commit: 1b8304742d1a464f77ed8b945fc6e0db41636751
    https://github.com/scummvm/scummvm/commit/1b8304742d1a464f77ed8b945fc6e0db41636751
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:36-07:00

Commit Message:
MORTEVIELLE: Beginnings of code for picture decoding

Changed paths:
  A engines/mortevielle/graphics.cpp
  A engines/mortevielle/graphics.h
    engines/mortevielle/level15.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mort.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
new file mode 100644
index 0000000..3df9001
--- /dev/null
+++ b/engines/mortevielle/graphics.cpp
@@ -0,0 +1,261 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public 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 "mortevielle/graphics.h"
+
+namespace Mortevielle {
+
+#define INCR_TAIX { if (_xSize & 1) ++_xSize; }
+
+void GfxSurface::decode(const byte *pSrc) {
+	_width = _height = 0;
+	_var1 = *pSrc++;
+	_entryCount = *pSrc++;
+	pSrc += 2;
+
+	if (!_var1)
+		pSrc += 30;
+
+	// First run through the data to calculate starting offsets
+	const byte *p = pSrc;
+	int xOffset = 0xffff, yOffset = 0xffff;
+
+	for (int idx = 0; idx < _entryCount; ++idx) {
+		_xp = READ_BE_UINT16(p + 4);
+		if (_xp < xOffset)
+			_xOffset = _xp;
+
+		_yp = READ_BE_UINT16(p + 6);
+		if (_yp < _yOffset)
+			_yOffset = _yp;
+
+		// Move to next entry
+		int size = READ_BE_UINT16(p) + READ_BE_UINT16(p + 2);
+		if ((size % 2) == 1)
+			++size;
+
+		p += size + 14;
+	}
+
+	// Temporary output buffer
+	byte outputBuffer[65536];
+	byte *pDest = &outputBuffer[0];
+	const byte *pSrcStart = pSrc;
+
+	byte table4140[256];
+	byte table7110[256];
+
+	// Main processing loop
+	do {
+		_var4 = READ_BE_UINT16(pSrc);
+		_var6 = READ_BE_UINT16(pSrc + 2);
+		_xp = READ_BE_UINT16(pSrc + 4) - _xOffset;
+		_yp = READ_BE_UINT16(pSrc + 6) - _yOffset;
+		pSrc += 8;
+
+		_varC = READ_BE_UINT16(pSrc);
+		_xSize = READ_BE_UINT16(pSrc + 2) + 1;
+		_ySize = READ_BE_UINT16(pSrc + 4) + 1;
+		majTtxTty();
+
+		_var15 = _var18 = 0;
+
+		int decomIndex = 0;
+		if (_varC >> 8) {
+			// Build up reference table
+			int tableOffset = 0;
+
+			if (_varC & 1) {
+				do {
+					_var12 = desanalyse(pSrc);
+					_var14 = desanalyse(pSrc);
+
+					int savedVar15 = _var15;
+					int savedVar18 = _var18;
+					
+					do {
+						const byte *pTemp = pSrc;
+						_var15 = savedVar15;
+						_var18 = savedVar18;
+
+						assert(_var14 < 256);
+						for (int idx = 0; idx < _var14; ++idx, ++tableOffset)
+							table4140[tableOffset] = suiv(pTemp);
+					} while (--_var12 > 0);
+				} while (_var18 < (_var4 - 1));
+
+			} else {
+				assert(_var4 < 256);
+				for (int idx = 0; idx < _var4; ++idx)
+					table4140[idx] = suiv(pSrc);
+			}
+
+			if (_var15) {
+				++pSrc;
+				_var15 = 0;
+			}
+			if ((_var4 + _var6) & 1)
+				++pSrc;
+
+			tableOffset = 0;
+			_var18 = 0;
+
+			if (_varC & 2) {
+				do {
+					_var12 = desanalyse(pSrc);
+					_var18 = _var14 = desanalyse(pSrc);
+					if (_var15 & 1) {
+						++pSrc;
+						++_var18;
+						_var15 = 0;
+					}
+
+					const byte *pStart = pSrc;
+					do {
+						pSrc = pStart;
+						for (int idx = 0; idx < _var14; ++idx) {
+							table7110[tableOffset++] = *pSrc++;
+						}
+					} while (--_var12 > 0);
+				} while (_var18 < (_var6 - 1));
+			} else {
+				assert(_var6 < 256);
+				for (int idx = 0; idx < _var4; ++idx)
+					table7110[idx] = *pSrc++;
+			}
+
+			if (_var15)
+				++pSrc;
+
+			pSrcStart = pSrc;
+			pDest = &outputBuffer[_yp * SCREEN_WIDTH + _xp];
+			pSrc = &table7110[0];
+			_var1A = _var18 = _var15 = 0;
+			decomIndex = _varC;
+		}
+
+		// Main decompression switch
+		switch (decomIndex) {
+		case 0:
+			// Draw rect at pos
+			pDest = &outputBuffer[_yp * SCREEN_WIDTH + _xp];
+			pSrcStart = pSrc;
+			INCR_TAIX;
+			
+			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += SCREEN_WIDTH) {
+				byte *pDestLine = pDest;
+				for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
+					*pDestLine++ = suiv(pSrc);
+				}
+			}
+
+			pSrc = pSrcStart + _var4 + ((_var4 & 1) ? 1 : 0);
+			break;
+
+		case 1:
+			// Draw rect alternating left to right, right to left
+			INCR_TAIX;
+			for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+				if (yCtr % 2) {
+					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
+						*pDest++ = suiv(pSrc);
+					}
+				} else {
+					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
+						*--pDest = suiv(pSrc);
+					}
+				}
+				pDest += SCREEN_WIDTH;
+			}
+			break;
+
+		case 2:
+			// Draw rect alternating top to bottom, bottom to top
+			INCR_TAIX;
+			for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
+				if (xCtr % 2) {
+					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += SCREEN_WIDTH) {
+						*pDest = suiv(pSrc);
+					}
+				} else {
+					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest -= SCREEN_WIDTH) {
+						*pDest = suiv(pSrc);
+					}
+				}
+				++pDest;
+			}
+			break;
+
+		case 3:
+			// Draw horizontal line?
+			_var1C = 2;
+			horizontal(pSrc, pDest);
+			break;
+		}
+
+		pSrc = pSrcStart;
+	} while (--_entryCount > 0);
+}
+
+void GfxSurface::majTtxTty() {
+	if (!_yp)
+		_width += _xSize;
+
+	if (!_xp)
+		_height += _ySize;
+}
+
+byte GfxSurface::suiv(const byte *&pSrc) {
+	int v = *pSrc;
+	if (_var15) {
+		++pSrc;
+		++_var18;
+		_var15 = 0;
+		return v & 0xf;
+	} else {
+		_var15 = ~(v >> 8);
+		return v >> 4;
+	}
+}
+
+int GfxSurface::desanalyse(const byte *&pSrc) {
+	int total = 0;
+	int v = suiv(pSrc);
+	if (!v) {
+		int v2;
+		do {
+			v2 = suiv(pSrc);
+		} while (v2 == 15);
+
+		total *= 15;
+		v = suiv(pSrc);
+	}
+
+	total += v;
+	return total;
+}
+
+void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest) {
+
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
new file mode 100644
index 0000000..d3f64a0
--- /dev/null
+++ b/engines/mortevielle/graphics.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 MORTEVIELLE_GRAPHICS_H
+#define MORTEVIELLE_GRAPHICS_H
+
+#include "graphics/surface.h"
+#include "mortevielle/mortevielle.h"
+
+namespace Mortevielle {
+
+class GfxSurface: public Graphics::Surface {
+private:
+	int _var1;
+	int _entryCount;
+	int _var4, _var6;
+	int _xp, _yp;
+	int _varC, _xSize, _ySize, _var12;
+	int _var14, _var15, _var18, _var1A;
+	int _var1C, _var1E, _var20, _var22;
+	int _var24, _var26, _var28;
+	int _width, _height;
+	int _xOffset, _yOffset;
+
+	void majTtxTty();
+	byte suiv(const byte *&pSrc);
+	int desanalyse(const byte *&pSrc);
+	void horizontal(const byte *&pSrc, byte *&pDest);
+public:
+	void decode(const byte *pSrc);
+};
+
+} // End of namespace Mortevielle
+
+#endif
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 86319e0..073b93f 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -98,10 +98,11 @@ void writepal(int n) {
 
 
 void pictout(int seg, int dep, int x, int y) {
+#ifdef DEBUG
 	GfxSurface surface;
 	surface.decode(&mem[0x7000 * 16]);
+#endif
 
-warning("TODO: complete picture decoding");
 	decomp(seg, dep);
 	if (gd == her) {
 		mem[0x7000 * 16 + 2] = 0;
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 21cb025..327c4ba 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS := \
 	detection.o \
 	disk.o \
 	droite.o \
+	graphics.o \
 	keyboard.o \
 	level15.o \
 	menu.o \
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index 9b05196..e24e9b5 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -71,7 +71,7 @@ int mortevielle_main(int argc, const char *argv[]) {
 	/*init_debug;*/
 	/*  ecri_seg;*/
 	//pio_initialize(argc, argv);
-	gd = cga;
+	gd = ega;
 	newgd = gd;
 	zuul = false;
 	tesok = false;


Commit: e6e544ccd4994f4e7863299f91060afa7ac5417d
    https://github.com/scummvm/scummvm/commit/e6e544ccd4994f4e7863299f91060afa7ac5417d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:37-07:00

Commit Message:
MORTEVIELLE: Implemented more of the image decompression code

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3df9001..9b06972 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -25,11 +25,13 @@
 namespace Mortevielle {
 
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
+#define DEFAULT_WIDTH 320
+#define BUFFER_SIZE 8192
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;
 	_var1 = *pSrc++;
-	_entryCount = *pSrc++;
+	int entryCount = *pSrc++;
 	pSrc += 2;
 
 	if (!_var1)
@@ -37,11 +39,12 @@ void GfxSurface::decode(const byte *pSrc) {
 
 	// First run through the data to calculate starting offsets
 	const byte *p = pSrc;
-	int xOffset = 0xffff, yOffset = 0xffff;
+	_xOffset = _yOffset = 0xffff;
 
-	for (int idx = 0; idx < _entryCount; ++idx) {
+	assert(entryCount > 0);
+	for (int idx = 0; idx < entryCount; ++idx) {
 		_xp = READ_BE_UINT16(p + 4);
-		if (_xp < xOffset)
+		if (_xp < _xOffset)
 			_xOffset = _xp;
 
 		_yp = READ_BE_UINT16(p + 6);
@@ -60,131 +63,146 @@ void GfxSurface::decode(const byte *pSrc) {
 	byte outputBuffer[65536];
 	byte *pDest = &outputBuffer[0];
 	const byte *pSrcStart = pSrc;
+	const byte *pLookup = NULL;
 
-	byte table4140[256];
-	byte table7110[256];
+	byte lookupTable[BUFFER_SIZE];
+	byte srcBuffer[BUFFER_SIZE];
 
 	// Main processing loop
 	do {
-		_var4 = READ_BE_UINT16(pSrc);
-		_var6 = READ_BE_UINT16(pSrc + 2);
+		int lookupBytes = READ_BE_UINT16(pSrc);
+		int srcSize = READ_BE_UINT16(pSrc + 2);
 		_xp = READ_BE_UINT16(pSrc + 4) - _xOffset;
 		_yp = READ_BE_UINT16(pSrc + 6) - _yOffset;
 		pSrc += 8;
 
-		_varC = READ_BE_UINT16(pSrc);
+		int decomCode = READ_BE_UINT16(pSrc);
 		_xSize = READ_BE_UINT16(pSrc + 2) + 1;
 		_ySize = READ_BE_UINT16(pSrc + 4) + 1;
 		majTtxTty();
+		
+		pSrc += 6;
+		pDest = &outputBuffer[0];
 
-		_var15 = _var18 = 0;
+		_var18 = 0;
+		_nibbleFlag = false;
 
 		int decomIndex = 0;
-		if (_varC >> 8) {
+		if (decomCode >> 8) {
 			// Build up reference table
 			int tableOffset = 0;
 
-			if (_varC & 1) {
+			if (decomCode & 1) {
+				// Handle decompression of the pattern lookup table
 				do {
 					_var12 = desanalyse(pSrc);
 					_var14 = desanalyse(pSrc);
 
-					int savedVar15 = _var15;
+					bool savedVar15 = _nibbleFlag;
 					int savedVar18 = _var18;
 					
 					do {
 						const byte *pTemp = pSrc;
-						_var15 = savedVar15;
+						_nibbleFlag = savedVar15;
 						_var18 = savedVar18;
 
 						assert(_var14 < 256);
 						for (int idx = 0; idx < _var14; ++idx, ++tableOffset)
-							table4140[tableOffset] = suiv(pTemp);
+							assert(tableOffset < BUFFER_SIZE);
+							lookupTable[tableOffset] = suiv(pTemp);
 					} while (--_var12 > 0);
-				} while (_var18 < (_var4 - 1));
+				} while (_var18 < (lookupBytes - 1));
 
 			} else {
-				assert(_var4 < 256);
-				for (int idx = 0; idx < _var4; ++idx)
-					table4140[idx] = suiv(pSrc);
+				assert(lookupBytes < BUFFER_SIZE);
+				for (int idx = 0; idx < (lookupBytes * 2); ++idx)
+					lookupTable[idx] = suiv(pSrc);
 			}
 
-			if (_var15) {
+			if (_nibbleFlag) {
 				++pSrc;
-				_var15 = 0;
+				_nibbleFlag = false;
 			}
-			if ((_var4 + _var6) & 1)
+			if ((lookupBytes + srcSize) & 1)
 				++pSrc;
 
 			tableOffset = 0;
 			_var18 = 0;
 
-			if (_varC & 2) {
+			if (decomCode & 2) {
+				// Handle decompression of the temporary source buffer
 				do {
 					_var12 = desanalyse(pSrc);
-					_var18 = _var14 = desanalyse(pSrc);
-					if (_var15 & 1) {
+					_var14 = desanalyse(pSrc);
+					_var18 += _var14;
+
+					if (_nibbleFlag) {
 						++pSrc;
 						++_var18;
-						_var15 = 0;
+						_nibbleFlag = false;
 					}
 
 					const byte *pStart = pSrc;
 					do {
 						pSrc = pStart;
 						for (int idx = 0; idx < _var14; ++idx) {
-							table7110[tableOffset++] = *pSrc++;
+							assert(tableOffset < BUFFER_SIZE);
+							srcBuffer[tableOffset++] = *pSrc++;
 						}
 					} while (--_var12 > 0);
-				} while (_var18 < (_var6 - 1));
+				} while (_var18 < (srcSize - 1));
 			} else {
-				assert(_var6 < 256);
-				for (int idx = 0; idx < _var4; ++idx)
-					table7110[idx] = *pSrc++;
+				assert(srcSize < BUFFER_SIZE);
+				for (int idx = 0; idx < srcSize; ++idx)
+					srcBuffer[idx] = *pSrc++;
 			}
 
-			if (_var15)
+			if (_nibbleFlag)
 				++pSrc;
 
+			// Switch over to using the decompressed source and lookup buffers
 			pSrcStart = pSrc;
-			pDest = &outputBuffer[_yp * SCREEN_WIDTH + _xp];
-			pSrc = &table7110[0];
-			_var1A = _var18 = _var15 = 0;
-			decomIndex = _varC;
+			pDest = &outputBuffer[_yp * DEFAULT_WIDTH + _xp];
+			pSrc = &srcBuffer[0];
+			pLookup = &lookupTable[0] - 1;
+
+			_lookupValue = _var18 = 0;
+			_nibbleFlag = false;
+			decomIndex = decomCode >> 8;
 		}
 
 		// Main decompression switch
 		switch (decomIndex) {
 		case 0:
 			// Draw rect at pos
-			pDest = &outputBuffer[_yp * SCREEN_WIDTH + _xp];
+			pDest = &outputBuffer[_yp * DEFAULT_WIDTH + _xp];
 			pSrcStart = pSrc;
 			INCR_TAIX;
 			
-			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += SCREEN_WIDTH) {
+			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 				byte *pDestLine = pDest;
 				for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
 					*pDestLine++ = suiv(pSrc);
 				}
 			}
 
-			pSrc = pSrcStart + _var4 + ((_var4 & 1) ? 1 : 0);
+			pSrc = pSrcStart + lookupBytes + ((lookupBytes & 1) ? 1 : 0);
 			break;
 
 		case 1:
 			// Draw rect alternating left to right, right to left
 			INCR_TAIX;
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
-				if (yCtr % 2) {
+				if ((yCtr % 2) == 0) {
 					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-						*pDest++ = suiv(pSrc);
+						*pDest++ = csuiv(pSrc, pLookup);
 					}
 				} else {
 					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-						*--pDest = suiv(pSrc);
+						*--pDest = csuiv(pSrc, pLookup);
 					}
 				}
-				pDest += SCREEN_WIDTH;
+				pDest += DEFAULT_WIDTH;
 			}
 			break;
 
@@ -193,12 +211,12 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
 				if (xCtr % 2) {
-					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += SCREEN_WIDTH) {
-						*pDest = suiv(pSrc);
+					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
+						*pDest = csuiv(pSrc, pLookup);
 					}
 				} else {
-					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest -= SCREEN_WIDTH) {
-						*pDest = suiv(pSrc);
+					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest -= DEFAULT_WIDTH) {
+						*pDest = csuiv(pSrc, pLookup);
 					}
 				}
 				++pDest;
@@ -206,14 +224,141 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 3:
-			// Draw horizontal line?
-			_var1C = 2;
-			horizontal(pSrc, pDest);
+			// Draw horizontal area?
+			_thickness = 2;
+			horizontal(pSrc, pDest, pLookup);
+			break;
+
+		case 4:
+			// Draw vertical area?
+			_thickness = 2;
+			vertical(pSrc, pDest, pLookup);
+			break;
+
+		case 5:
+			_thickness = 3;
+			horizontal(pSrc, pDest, pLookup);
+			break;
+
+		case 6:
+			_thickness = 4;
+			vertical(pSrc, pDest, pLookup);
+			break;
+
+		case 7:
+			// Draw box
+			INCR_TAIX;
+			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
+				byte *pDestLine = pDest;
+				for (int xCtr = 0; xCtr < _xSize; ++xCtr, ++pDestLine)
+					*pDestLine++ = csuiv(pSrc, pLookup);
+			}
+			break;
+
+		case 8:
+			// Draw box
+			for (int xCtr = 0; xCtr < _xSize; ++xCtr, ++pDest) {
+				byte *pDestLine = pDest;
+				for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDestLine += DEFAULT_WIDTH)
+					*pDestLine = csuiv(pSrc, pLookup);
+			}
+			break;
+
+		case 9:
+			_thickness = 4;
+			horizontal(pSrc, pDest, pLookup);
+			break;
+
+		case 10:
+			_thickness = 6;
+			horizontal(pSrc, pDest, pLookup);
+			break;
+
+		case 11:
+			warning("TODO: Switch 11");
+			break;
+
+		case 12:
+			INCR_TAIX;
+			_thickness = _var22 = 1;
+			_var1E = 320;
+			_var20 = _ySize;
+			_var24 = _xSize;
+			diag();
+			break;
+
+		case 13:
+			INCR_TAIX;
+			_thickness = _xSize;
+			_var1E = 1;
+			_var20 = _xSize;
+			_var22 = 320;
+			_var24 = _ySize;
+			diag();
+			break;
+
+		case 14:
+			_thickness = _var1E = 1;
+			_var20 = _xSize;
+			_var22 = 320;
+			_var24 = _ySize;
+			diag();
+			break;
+
+		case 15:
+			INCR_TAIX;
+			_thickness = 2;
+			_var1E = 320;
+			_var20 = _ySize;
+			_var22 = 1;
+			_var24 = _xSize;
+			diag();
+			break;
+
+		case 16:
+			_thickness = 3;
+			_var1E = 1;
+			_var20 = _xSize;
+			_var22 = 320;
+			_var24 = _ySize;
+			diag();
+			break;
+
+		case 17:
+			INCR_TAIX;
+			_thickness = 3;
+			_var1E = 320;
+			_var20 = _ySize;
+			_var22 = 1;
+			_var24 = _xSize;
+			diag();
+			break;
+
+		case 18:
+			INCR_TAIX;
+			_thickness = 5;
+			_var1E = 320;
+			_var20 = _ySize;
+			_var22 = 1;
+			_var24 = _xSize;
+			diag();
 			break;
 		}
 
 		pSrc = pSrcStart;
-	} while (--_entryCount > 0);
+	} while (--entryCount > 0);
+
+	// At this point, the outputBuffer has the data for the image. The pitch is
+	// 320 pixels, the _xOffset and _yOffset represent the top left of the image data,
+	// and the _xSize and _ySize fields indicate the image size
+	create(_xOffset + _xSize, _yOffset + _ySize, Graphics::PixelFormat::createFormatCLUT8());
+
+	for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+		const byte *copySrc = &outputBuffer[yCtr * DEFAULT_WIDTH];
+		byte *copyDest = (byte *)getBasePtr(_xOffset, yCtr + _yOffset);
+
+		Common::copy(copySrc, copySrc + _xSize, copyDest);
+	}
 }
 
 void GfxSurface::majTtxTty() {
@@ -226,24 +371,41 @@ void GfxSurface::majTtxTty() {
 
 byte GfxSurface::suiv(const byte *&pSrc) {
 	int v = *pSrc;
-	if (_var15) {
+	if (_nibbleFlag) {
 		++pSrc;
 		++_var18;
-		_var15 = 0;
+		_nibbleFlag = false;
 		return v & 0xf;
 	} else {
-		_var15 = ~(v >> 8);
+		_nibbleFlag = !_nibbleFlag;
 		return v >> 4;
 	}
 }
 
+byte GfxSurface::csuiv(const byte *&pSrc, const byte *&pLookup) {
+	assert(pLookup);
+
+	while (!_lookupValue) {
+		int v;
+		do {
+			v = suiv(pSrc) & 0xff;
+			_lookupValue += v;
+		} while (v == 0xf);
+		++pLookup;
+	}
+
+	--_lookupValue;
+	return *pLookup;
+}
+
 int GfxSurface::desanalyse(const byte *&pSrc) {
 	int total = 0;
 	int v = suiv(pSrc);
-	if (!v) {
+	if (v == 15) {
 		int v2;
 		do {
 			v2 = suiv(pSrc);
+			total += v2;
 		} while (v2 == 15);
 
 		total *= 15;
@@ -254,8 +416,151 @@ int GfxSurface::desanalyse(const byte *&pSrc) {
 	return total;
 }
 
-void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest) {
+void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
+	INCR_TAIX;
+	byte *pDestEnd = pDest + (_ySize - 1) * DEFAULT_WIDTH + _xSize;
+
+	for (;;) {
+		// If position is past end point, then skip this line
+		if (((_thickness - 1) * DEFAULT_WIDTH) + pDest >= pDestEnd) {
+			if (--_thickness == 0) break;
+			continue;
+		}
+		
+		bool continueFlag = false;
+		do {
+			for (int xIndex = 0; xIndex < _xSize; ++xIndex, ++pDest) {
+				if ((xIndex % 2) == 0) {
+					// Write out vertical slice top to bottom
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest += DEFAULT_WIDTH)
+						*pDest = csuiv(pSrc, pLookup);
+				} else {
+					// Write out vertical slice bottom to top
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest -= DEFAULT_WIDTH)
+						*pDest = csuiv(pSrc, pLookup);
+				}
+			}
+
+			if ((_xSize % 2) == 0) {
+				int blockSize = _thickness * DEFAULT_WIDTH;
+				pDest += blockSize;
+				blockSize -= DEFAULT_WIDTH;
+
+				if (pDestEnd < (pDest + blockSize)) {
+					do {
+						if (--_thickness == 0)
+							return;
+					} while ((pDest + (_thickness - 1) * DEFAULT_WIDTH) >= pDestEnd);
+				}
+			} else {
+				while ((pDest + (_thickness - 1) * DEFAULT_WIDTH) >= pDestEnd) {
+					if (--_thickness == 0)
+						return;
+				}
+			}
+
+			for (int xIndex = 0; xIndex < _xSize; ++xIndex, --pDest) {
+				if ((xIndex % 2) == 0) {
+					// Write out vertical slice top to bottom
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest += DEFAULT_WIDTH)
+						*pDest = csuiv(pSrc, pLookup);
+				} else {
+					// Write out vertical slice top to bottom
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest -= DEFAULT_WIDTH)
+						*pDest = csuiv(pSrc, pLookup);
+				}
+			}
+
+			if ((_xSize % 2) == 1) {
+				++pDest;
+
+				if ((pDest + (_thickness - 1) * DEFAULT_WIDTH) < pDestEnd) {
+					continueFlag = true;
+					break;
+				}
+			} else {
+				pDest += _thickness * DEFAULT_WIDTH + 1;
+				continueFlag = true;
+				break;
+			}
+
+			++pDest;
+		} while (((_thickness - 1) * DEFAULT_WIDTH + pDest) < pDestEnd);
+
+		if (continueFlag)
+			continue;
+
+		// Move to next line
+		if (--_thickness == 0)
+			break;
+	}
+}
+
+void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
+//	byte *pDestEnd = pDest + (_ySize - 1) * DEFAULT_WIDTH + _xSize;
+	int var28 = 0;
+
+	for (;;) {
+		// Reduce thickness as necessary
+		while ((var28 + _thickness) >= _xSize) {
+			if (--_thickness == 0)
+				return;
+		}
+
+		// Loop
+		for (int idx = 0; idx < _thickness; ++idx) {
+			if ((idx % 2) == 0) {
+				if (idx > 0)
+					pDest -= DEFAULT_WIDTH;
+
+				// Write out horizontal slice left to right
+				var28 += _thickness;
+				for (int xIndex = 0; xIndex < _thickness; ++xIndex) 
+					*pDest++ = suiv(pSrc);
+			} else {
+				// Write out horizontal slice right to left
+				pDest += DEFAULT_WIDTH;
+				var28 -= _thickness;
+				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
+					*pDest-- = csuiv(pSrc, pLookup);
+			}
+		}
+		if ((_thickness % 2) == 0) {
+			pDest += _thickness;
+			var28 += _thickness;
+		}
+
+		// Reduce thickness as necessary
+		while ((var28 + _thickness) < _xSize) {
+			if (--_thickness == 0)
+				return;
+		}
+
+		for (int yIndex = 0; yIndex < _ySize; ++yIndex) {
+			if ((yIndex % 2) == 0) {
+				if (yIndex > 0)
+					pDest -= DEFAULT_WIDTH;
+
+				// Draw horizontal slice
+				var28 += _thickness;
+
+				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
+					*pDest++ = suiv(pSrc);
+			} else {
+				pDest -= DEFAULT_WIDTH;
+				var28 -= _thickness;
+
+				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
+					*pDest-- = csuiv(pSrc, pLookup);
+			}
+		}
+	}
+}
 
+void GfxSurface::diag() {
+	// The diag method in the original source doesn't seem to have any exit point,
+	// which if the case, means the routine may not be used by the game
+	error("Non-exitable method diag() called");
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index d3f64a0..4e7db30 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -31,20 +31,22 @@ namespace Mortevielle {
 class GfxSurface: public Graphics::Surface {
 private:
 	int _var1;
-	int _entryCount;
-	int _var4, _var6;
 	int _xp, _yp;
-	int _varC, _xSize, _ySize, _var12;
-	int _var14, _var15, _var18, _var1A;
-	int _var1C, _var1E, _var20, _var22;
-	int _var24, _var26, _var28;
+	int _xSize, _ySize, _var12;
+	int _var14, _var18, _lookupValue;
+	bool _nibbleFlag;
+	int _thickness, _var1E, _var20, _var22;
+	int _var24, _var26;
 	int _width, _height;
 	int _xOffset, _yOffset;
 
 	void majTtxTty();
 	byte suiv(const byte *&pSrc);
+	byte csuiv(const byte *&pSrc, const byte *&pLookup);
 	int desanalyse(const byte *&pSrc);
-	void horizontal(const byte *&pSrc, byte *&pDest);
+	void horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
+	void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
+	void diag();
 public:
 	void decode(const byte *pSrc);
 };
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b9d8265..0e72090 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -33,7 +33,8 @@
 namespace Mortevielle {
 
 enum {
-	kMortevielleCore = 1 << 0
+	kMortevielleCore = 1 << 0,
+	kMortevielleGraphics = 1 << 1
 };
 
 #define SCREEN_WIDTH 640


Commit: 42349ae7a1696332c7a29609e9e1b43ca653c4eb
    https://github.com/scummvm/scummvm/commit/42349ae7a1696332c7a29609e9e1b43ca653c4eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:39-07:00

Commit Message:
MORTEVIELLE: Bugfixes for image decoding.

Decoding types 1 and 7 are now working, so the first scene is partially decoding correctly.

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 9b06972..86cce5d 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -25,7 +25,7 @@
 namespace Mortevielle {
 
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
-#define DEFAULT_WIDTH 320
+#define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
 #define BUFFER_SIZE 8192
 
 void GfxSurface::decode(const byte *pSrc) {
@@ -98,18 +98,20 @@ void GfxSurface::decode(const byte *pSrc) {
 					_var12 = desanalyse(pSrc);
 					_var14 = desanalyse(pSrc);
 
-					bool savedVar15 = _nibbleFlag;
+					const byte *pSrcSaved = pSrc;
+					bool savedNibbleFlag = _nibbleFlag;
 					int savedVar18 = _var18;
 					
 					do {
-						const byte *pTemp = pSrc;
-						_nibbleFlag = savedVar15;
+						pSrc = pSrcSaved;
+						_nibbleFlag = savedNibbleFlag;
 						_var18 = savedVar18;
 
 						assert(_var14 < 256);
-						for (int idx = 0; idx < _var14; ++idx, ++tableOffset)
+						for (int idx = 0; idx < _var14; ++idx, ++tableOffset) {
 							assert(tableOffset < BUFFER_SIZE);
-							lookupTable[tableOffset] = suiv(pTemp);
+							lookupTable[tableOffset] = suiv(pSrc);
+						}
 					} while (--_var12 > 0);
 				} while (_var18 < (lookupBytes - 1));
 
@@ -190,7 +192,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 1:
-			// Draw rect alternating left to right, right to left
+			// Draw rect using horizontal lines alternating left to right, then right to left
 			INCR_TAIX;
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
 				if ((yCtr % 2) == 0) {
@@ -246,11 +248,11 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 7:
-			// Draw box
+			// Draw rect using horizontal lines left to right
 			INCR_TAIX;
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 				byte *pDestLine = pDest;
-				for (int xCtr = 0; xCtr < _xSize; ++xCtr, ++pDestLine)
+				for (int xCtr = 0; xCtr < _xSize; ++xCtr)
 					*pDestLine++ = csuiv(pSrc, pLookup);
 			}
 			break;
@@ -348,16 +350,15 @@ void GfxSurface::decode(const byte *pSrc) {
 		pSrc = pSrcStart;
 	} while (--entryCount > 0);
 
-	// At this point, the outputBuffer has the data for the image. The pitch is
-	// 320 pixels, the _xOffset and _yOffset represent the top left of the image data,
-	// and the _xSize and _ySize fields indicate the image size
-	create(_xOffset + _xSize, _yOffset + _ySize, Graphics::PixelFormat::createFormatCLUT8());
+	// At this point, the outputBuffer has the data for the image. Initialise the surface
+	// with the calculated size for the full image, and copy the lines to the surface
+	create(_xOffset + _width, _yOffset + _height, Graphics::PixelFormat::createFormatCLUT8());
 
-	for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+	for (int yCtr = 0; yCtr < _height; ++yCtr) {
 		const byte *copySrc = &outputBuffer[yCtr * DEFAULT_WIDTH];
 		byte *copyDest = (byte *)getBasePtr(_xOffset, yCtr + _yOffset);
 
-		Common::copy(copySrc, copySrc + _xSize, copyDest);
+		Common::copy(copySrc, copySrc + _width, copyDest);
 	}
 }
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 073b93f..7e1f47d 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/system.h"
 #include "common/file.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
@@ -101,6 +102,11 @@ void pictout(int seg, int dep, int x, int y) {
 #ifdef DEBUG
 	GfxSurface surface;
 	surface.decode(&mem[0x7000 * 16]);
+
+	g_system->copyRectToScreen((const byte *)surface.pixels, surface.pitch, 0, 0,
+		surface.w, surface.h);
+	g_system->updateScreen();
+
 #endif
 
 	decomp(seg, dep);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 43534a6..bba22f1 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -172,8 +172,10 @@ Common::Error MortevielleEngine::run() {
 		return err;
 
 	// TODO: Remove once palette loading is correctly done
-	uint32 white = 0xffffffff;
-	g_system->getPaletteManager()->setPalette((const byte *)&white, 15, 1);
+	for (int idx = 0; idx < 16; ++idx) {
+		uint32 c = 0x111111 * idx;
+		g_system->getPaletteManager()->setPalette((const byte *)&c, idx, 1);
+	}
 
 	// Dispatch to the game's main routine
 	const char *argv[] = { "" };


Commit: 22ef8502b4fb768dc232c34c8071e54327033aee
    https://github.com/scummvm/scummvm/commit/22ef8502b4fb768dc232c34c8071e54327033aee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:40-07:00

Commit Message:
MORTEVIELLE: Implemented the remaining image decoding mode 11

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 86cce5d..f0dfdd2 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -212,7 +212,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			// Draw rect alternating top to bottom, bottom to top
 			INCR_TAIX;
 			for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-				if (xCtr % 2) {
+				if ((xCtr % 2) == 0) {
 					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 						*pDest = csuiv(pSrc, pLookup);
 					}
@@ -277,7 +277,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 11:
-			warning("TODO: Switch 11");
+			decom11(pSrc, pDest, pLookup);
 			break;
 
 		case 12:
@@ -430,11 +430,16 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 		
 		bool continueFlag = false;
 		do {
-			for (int xIndex = 0; xIndex < _xSize; ++xIndex, ++pDest) {
+			for (int xIndex = 0; xIndex < _xSize; ++xIndex) {
 				if ((xIndex % 2) == 0) {
+					if (xIndex != 0)
+						++pDest;
+
 					// Write out vertical slice top to bottom
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest += DEFAULT_WIDTH)
 						*pDest = csuiv(pSrc, pLookup);
+
+					++pDest;
 				} else {
 					// Write out vertical slice bottom to top
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest -= DEFAULT_WIDTH)
@@ -558,6 +563,110 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 	}
 }
 
+void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
+	int var26 = 0, var28 = 0;
+	_var1E = DEFAULT_WIDTH;
+	_var22 = -1;
+	--_xSize;
+	--_ySize;
+
+	int areaNum = 0;
+	while (areaNum != -1) {
+		switch (areaNum) {
+		case 0:
+			*pDest = csuiv(pSrc, pLookup);
+			areaNum = 1;
+			break;
+
+		case 1:
+			increments(pDest);
+
+			if (!var28) {
+				NIH();
+				NIV();
+
+				if (var26 == _ySize) {
+					increments(pDest);
+					++var28;
+				} else {
+					++var26;
+				}
+
+				*++pDest = csuiv(pSrc, pLookup);
+				areaNum = 2;
+			} else if (var26 != _ySize) {
+				++var26;
+				--var28;
+				areaNum = 0;
+			} else {
+				NIH();
+				NIV();
+				increments(pDest);
+				++var28;
+
+				*++pDest = csuiv(pSrc, pLookup);
+
+				if (var28 == _xSize) {
+					areaNum = -1;
+				} else {
+					areaNum = 2;
+				}
+			}
+			break;
+
+		case 2:
+			increments(pDest);
+
+			if (!var26) {
+				NIH();
+				NIV();
+
+				if (var28 == _xSize) {
+					increments(pDest);
+					++var26;
+				} else {
+					++var28;
+				}
+
+				pDest += DEFAULT_WIDTH;
+				areaNum = 0;
+			} else if (var28 != _xSize) {
+				++var28;
+				--var26;
+
+				*pDest = csuiv(pSrc, pLookup);
+				areaNum = 2;
+			} else {
+				pDest += DEFAULT_WIDTH;
+				++var26;
+				NIH();
+				NIV();
+				increments(pDest);
+
+				*pDest = csuiv(pSrc, pLookup);
+
+				if (var26 == _ySize)
+					areaNum = -1;
+				else
+					areaNum = 1;
+			}
+			break;
+		}
+	}
+}
+
+void GfxSurface::increments(byte *&pDest) {
+	pDest += _var22 + _var1E;
+}
+
+void GfxSurface::NIH() {
+	_var22 = -_var22;
+}
+
+void GfxSurface::NIV() {
+	_var1E = -_var1E;
+}
+
 void GfxSurface::diag() {
 	// The diag method in the original source doesn't seem to have any exit point,
 	// which if the case, means the routine may not be used by the game
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 4e7db30..0c322df 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -36,7 +36,7 @@ private:
 	int _var14, _var18, _lookupValue;
 	bool _nibbleFlag;
 	int _thickness, _var1E, _var20, _var22;
-	int _var24, _var26;
+	int _var24;
 	int _width, _height;
 	int _xOffset, _yOffset;
 
@@ -46,6 +46,10 @@ private:
 	int desanalyse(const byte *&pSrc);
 	void horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
+	void decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
+	void increments(byte *&pDest);
+	void NIH();
+	void NIV();
 	void diag();
 public:
 	void decode(const byte *pSrc);


Commit: 58825d6f575d0d9c33d6817f5bc37e74243b96cd
    https://github.com/scummvm/scummvm/commit/58825d6f575d0d9c33d6817f5bc37e74243b96cd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:41-07:00

Commit Message:
MORTEVIELLE: Completed the diag() method used in image decoding.

The first image now completely decodes.

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index f0dfdd2..2d09b6b 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -286,7 +286,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var1E = 320;
 			_var20 = _ySize;
 			_var24 = _xSize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 13:
@@ -296,7 +296,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _xSize;
 			_var22 = 320;
 			_var24 = _ySize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 14:
@@ -304,7 +304,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _xSize;
 			_var22 = 320;
 			_var24 = _ySize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 15:
@@ -314,7 +314,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _ySize;
 			_var22 = 1;
 			_var24 = _xSize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 16:
@@ -323,7 +323,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _xSize;
 			_var22 = 320;
 			_var24 = _ySize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 17:
@@ -333,7 +333,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _ySize;
 			_var22 = 1;
 			_var24 = _xSize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 18:
@@ -343,7 +343,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			_var20 = _ySize;
 			_var22 = 1;
 			_var24 = _xSize;
-			diag();
+			diag(pSrc, pDest, pLookup);
 			break;
 		}
 
@@ -655,6 +655,87 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 	}
 }
 
+void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
+	int var26 = 0, var28 = 0;
+	--_var24;
+
+	while (!TFP(var26)) {
+		for (;;) {
+			NIH();
+			for (int idx = 0; idx <= _thickness; ++idx) {
+				*pDest = csuiv(pSrc, pLookup);
+				NIH();
+				increments(pDest);
+			}
+
+			NIV();
+			pDest += _var1E;
+
+			for (int idx = 0; idx <= _thickness; ++idx) {
+				*pDest = csuiv(pSrc, pLookup);
+				NIH();
+				increments(pDest);
+			}
+			
+			NIH();
+			NIV();
+			increments(pDest);
+
+			++var28;
+			if (_var24 < (var28 + 1)) {
+				TF1(pDest, var26);
+				break;
+			}
+
+			pDest += _var22;
+			if (_var24 < (var28 + 1)) {
+				TF2(pSrc, pDest, pLookup, var26);
+				break;
+			}
+		}
+
+		if (TFP(var26))
+			return;
+
+		for (;;) {
+			for (int idx = 0; idx <= _thickness; ++idx) {
+				*pDest = csuiv(pSrc, pLookup);
+				NIH();
+				increments(pDest);
+			}
+
+			NIV();
+
+			for (int idx = 0; idx <= _thickness; ++idx) {
+				*pDest = csuiv(pSrc, pLookup);
+				NIH();
+				increments(pDest);
+			}
+			
+			NIH();
+			NIV();
+			increments(pDest);
+
+			if (--var28 == 0) {
+				TF1(pDest, var26);
+				NIH();
+				break;
+			} else {
+				pDest += _var22;
+				
+				if (--var28 == 0) {
+					TF2(pSrc, pDest, pLookup, var26);
+					NIH();
+					break;
+				}
+			} 
+
+			NIH();
+		}
+	}
+}
+
+
 void GfxSurface::increments(byte *&pDest) {
 	pDest += _var22 + _var1E;
 }
@@ -667,10 +748,30 @@ void GfxSurface::NIV() {
 	_var1E = -_var1E;
 }
 
-void GfxSurface::diag() {
-	// The diag method in the original source doesn't seem to have any exit point,
-	// which if the case, means the routine may not be used by the game
-	error("Non-exitable method diag() called");
+bool GfxSurface::TFP(int v) {
+	int diff = _var20 - v;
+	if (!diff)
+		// Time to finish loop in outer method
+		return true;
+
+	if (diff < (_thickness + 1))
+		_thickness = diff - 1;
+
+	return false;
+}
+
+void GfxSurface::TF1(byte *&pDest, int &v) {
+	v += _thickness + 1;
+	pDest += (_thickness + 1) * _var1E;
+}
+
+void GfxSurface::TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v) {
+	v += _thickness + 1;
+
+	for (int idx = 0; idx <= _thickness; ++idx) {
+		*pDest = csuiv(pSrc, pLookup);
+		pDest += _var1E;
+	}
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 0c322df..ce11fd8 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -47,10 +47,13 @@ private:
 	void horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
+	void diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void increments(byte *&pDest);
 	void NIH();
 	void NIV();
-	void diag();
+	bool TFP(int v);
+	void TF1(byte *&pDest, int &v);
+	void TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v);
 public:
 	void decode(const byte *pSrc);
 };


Commit: a5d26d385881d45b45a7bf3eacc6a4b1b21627bd
    https://github.com/scummvm/scummvm/commit/a5d26d385881d45b45a7bf3eacc6a4b1b21627bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:43-07:00

Commit Message:
MORTEVIELLE: Implemented a screen surface class to hold all the graphics functionality.

This includes moving the already created pixel and character functions into it, as well as a new method for drawing decoded graphic images.

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/level15.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/sprint.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 2d09b6b..5099504 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -20,10 +20,21 @@
  *
  */
 
+#include "common/endian.h"
+#include "common/system.h"
 #include "mortevielle/graphics.h"
+#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
+/*-------------------------------------------------------------------------*
+ * Image decoding
+ * 
+ * The code in this section is responsible for decoding image resources.
+ * Images are broken down into rectangular sections, which can use one
+ * of 18 different encoding methods.
+ *-------------------------------------------------------------------------*/
+
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
 #define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
 #define BUFFER_SIZE 8192
@@ -774,4 +785,137 @@ void GfxSurface::TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int
 	}
 }
 
+/*-------------------------------------------------------------------------*/
+
+GfxSurface::~GfxSurface() {
+	free();
+}
+
+/*-------------------------------------------------------------------------*
+ * Screen surface
+ *-------------------------------------------------------------------------*/
+
+/**
+ * Called to populate the font data from the passed file
+ */
+void ScreenSurface::readFontData(Common::File &f, int dataSize) {
+	assert(dataSize == (FONT_NUM_CHARS * FONT_HEIGHT));
+	f.read(_fontData, FONT_NUM_CHARS * FONT_HEIGHT);
+}
+
+/**
+ * Returns a graphics surface representing a subset of the screen. The affected area
+ * is also marked as dirty
+ */
+Graphics::Surface ScreenSurface::lockArea(const Common::Rect &bounds) {
+	_dirtyRects.push_back(bounds);
+
+	Graphics::Surface s;
+	s.pixels = getBasePtr(bounds.left, bounds.top);
+	s.pitch = pitch;
+	s.w = bounds.width();
+	s.h = bounds.height();
+
+	return s;
+}
+
+/**
+ * Updates the affected areas of the surface to the underlying physical screen
+ */
+void ScreenSurface::updateScreen() {
+	// Iterate through copying dirty areas to the screen
+	for (Common::List<Common::Rect>::iterator i = _dirtyRects.begin(); i != _dirtyRects.end(); ++i) {
+		Common::Rect r = *i;
+		g_system->copyRectToScreen((const byte *)getBasePtr(r.left, r.top), pitch, 
+			r.left, r.top, r.width(), r.height());
+	}
+	_dirtyRects.clear();
+
+	// Update the screen
+	g_system->updateScreen();
+}
+
+/**
+ * Draws a decoded picture on the screen
+ * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
+ *		simulate the original 640x200 surface, all Y values have to be doubled.
+ *		Also, image resources are stored at 320x200, so when drawn onto the screen every
+ *		other column is interpolated.
+ */
+void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
+	// Lock the affected area of the surface to write to
+	Graphics::Surface destSurface = lockArea(Common::Rect(x, y, 
+		x + surface.w * 2, y + surface.h * 2));
+
+	// Loop through writing 
+	for (int yp = 0; yp < surface.h; ++yp) {
+		if (((y + yp) < 0) || ((y + yp) >= 200))
+			continue;
+
+		const byte *pSrc = (const byte *)surface.getBasePtr(0, yp);
+		byte *pDest = (byte *)destSurface.getBasePtr(0, yp * 2);
+
+		for (int xp = 0; xp < surface.w; ++xp, ++pSrc) {
+			// Draw pixel from source image
+			*pDest = *pSrc;
+			*(pDest + SCREEN_WIDTH) = *pSrc;
+			++pDest;
+
+			// TODO: I'm not sure what algorithm the original uses to calculate
+			// which pixel to use on the alternate columns, so for now I'm doing
+			// a simple output of null values. This should be revisited once we've
+			// got the palette loading so we can compare palettes. In fact, the 
+			// original had the alternate columns very noticablely striped. With
+			// the larger 256 colour palette, it may be worthwhile to offer a 
+			// better blended graphics mode as an option.
+			*pDest = 0;
+			*(pDest + SCREEN_WIDTH) = 0;
+			++pDest;
+		}
+	}
+
+	// TODO: Remove this once we have a proper game loop
+	updateScreen();
+}
+
+/**
+ * Draws a character at the specified co-ordinates
+ * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
+ *		simulate the original 640x200 surface, all Y values have to be doubled
+ */
+void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex) {
+	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, 
+		pt.x + FONT_WIDTH, (pt.y + FONT_HEIGHT) * 2));
+
+	// Get the start of the character to use
+	assert((ch >= ' ') && (ch <= (unsigned char)(32 + FONT_NUM_CHARS)));
+	const byte *charData = &_fontData[((int)ch - 32) * FONT_HEIGHT];
+
+	// Loop through decoding each character's data
+	for (int yp = 0; yp < FONT_HEIGHT; ++yp) {
+		byte *lineP = (byte *)destSurface.getBasePtr(0, yp * 2);
+		byte byteVal = *charData++;
+
+		for (int xp = 0; xp < FONT_WIDTH; ++xp, ++lineP, byteVal <<= 1) {
+			if (byteVal & 0x80) {
+				*lineP = palIndex;
+				*(lineP + SCREEN_WIDTH) = palIndex;
+			}
+		}
+	}
+}
+
+/**
+ * Sets a single pixel at the specified co-ordinates
+ * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
+ *		simulate the original 640x200 surface, all Y values have to be doubled
+ */
+void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
+	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, pt.x + 1, (pt.y + 1) * 2));
+
+	byte *destP = (byte *)destSurface.pixels;
+	*destP = palIndex;
+	*(destP + SCREEN_WIDTH) = palIndex;
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index ce11fd8..c733cbc 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -23,11 +23,17 @@
 #ifndef MORTEVIELLE_GRAPHICS_H
 #define MORTEVIELLE_GRAPHICS_H
 
+#include "common/file.h"
+#include "common/list.h"
+#include "common/rect.h"
 #include "graphics/surface.h"
-#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
+#define FONT_WIDTH 8
+#define FONT_HEIGHT 6
+#define FONT_NUM_CHARS 121
+
 class GfxSurface: public Graphics::Surface {
 private:
 	int _var1;
@@ -55,9 +61,26 @@ private:
 	void TF1(byte *&pDest, int &v);
 	void TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v);
 public:
+	~GfxSurface();
+
 	void decode(const byte *pSrc);
 };
 
+class ScreenSurface: public Graphics::Surface {
+private:
+	Common::List<Common::Rect> _dirtyRects;
+	byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
+public:
+	void readFontData(Common::File &f, int dataSize);
+	Graphics::Surface lockArea(const Common::Rect &bounds);
+	void updateScreen();
+	void drawPicture(GfxSurface &surface, int x, int y);
+	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
+
+	// TODO: Refactor code to remove this method, for increased performance
+	void setPixel(const Common::Point &pt, int palIndex);
+};
+
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 7e1f47d..8b8dbcf 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -29,6 +29,7 @@
 #include "common/file.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
 
@@ -99,15 +100,8 @@ void writepal(int n) {
 
 
 void pictout(int seg, int dep, int x, int y) {
-#ifdef DEBUG
 	GfxSurface surface;
-	surface.decode(&mem[0x7000 * 16]);
-
-	g_system->copyRectToScreen((const byte *)surface.pixels, surface.pitch, 0, 0,
-		surface.w, surface.h);
-	g_system->updateScreen();
-
-#endif
+	surface.decode(&mem[seg * 16 + dep]);
 
 	decomp(seg, dep);
 	if (gd == her) {
@@ -116,7 +110,7 @@ void pictout(int seg, int dep, int x, int y) {
 	}
 	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
 		WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
-	afff(gd, seg, dep, x, y);
+	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
 
 void putxy(int x, int y) {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index bba22f1..cdeb412 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -97,8 +97,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 
 		if (!strncmp(dataType, "FONT", 4)) {
 			// Font resource
-			assert(dataSize == (FONT_NUM_CHARS * FONT_HEIGHT));
-			f.read(_fontData, FONT_NUM_CHARS * FONT_HEIGHT);
+			_screenSurface.readFontData(f, dataSize);
 		} else {
 			// Unknown section
 			f.skip(dataSize);
@@ -111,60 +110,6 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 
 /*-------------------------------------------------------------------------*/
 
-/**
- * Update the physical screen
- */
-void MortevielleEngine::updateScreen() {
-	g_system->copyRectToScreen((const byte *)_screenSurface.getBasePtr(0, 0), 
-		SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
-	g_system->updateScreen();
-}
-/**
- * Draws a character at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
- *		simulate the original 640x200 surface, all Y values have to be doubled
- */
-void MortevielleEngine::writeCharacter(const Common::Point &pt, unsigned char ch, 
-		int palIndex, Graphics::Surface *surface) {
-	if (surface == NULL)
-		surface = &_screenSurface;
-
-	// Get the start of the character to use
-	assert((ch >= ' ') && (ch <= (unsigned char)(32 + FONT_NUM_CHARS)));
-	const byte *charData = &_fontData[((int)ch - 32) * FONT_HEIGHT];
-
-	// Loop through decoding each character's data
-	for (int yp = 0; yp < FONT_HEIGHT; ++yp) {
-		byte *lineP = (byte *)surface->getBasePtr(pt.x, (pt.y + yp) * 2);
-		byte byteVal = *charData++;
-
-		for (int xp = 0; xp < 8; ++xp, ++lineP, byteVal <<= 1) {
-			if (byteVal & 0x80) {
-				*lineP = palIndex;
-				*(lineP + SCREEN_WIDTH) = palIndex;
-			}
-		}
-	}
-}
-
-/**
- * Sets a single pixel at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
- *		simulate the original 640x200 surface, all Y values have to be doubled
- */
-void MortevielleEngine::setPixel(const Common::Point &pt, int palIndex, 
-		Graphics::Surface *surface) {
-	if (surface == NULL)
-		surface = &_screenSurface;
-
-	byte *destP = (byte *)surface->getBasePtr(pt.x, pt.y * 2);
-	*destP = palIndex;
-	*(destP + SCREEN_WIDTH) = palIndex;
-}
-
-
-/*-------------------------------------------------------------------------*/
-
 Common::Error MortevielleEngine::run() {
 	// Initialise the game
 	Common::ErrorCode err = initialise();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0e72090..bcd6f66 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -29,6 +29,7 @@
 #include "engines/engine.h"
 #include "common/error.h"
 #include "graphics/surface.h"
+#include "mortevielle/graphics.h"
 
 namespace Mortevielle {
 
@@ -42,10 +43,6 @@ enum {
 #define MORT_DAT_REQUIRED_VERSION 1
 #define MORT_DAT "mort.dat"
 
-#define FONT_WIDTH 8
-#define FONT_HEIGHT 6
-#define FONT_NUM_CHARS 121
-
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
@@ -54,19 +51,13 @@ private:
 	Common::ErrorCode loadMortDat();
 	void loadFont(Common::File &f);
 public:
-	Graphics::Surface _screenSurface;
-	byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
+	ScreenSurface _screenSurface;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
 	virtual bool hasFeature(EngineFeature f) const;
 	virtual Common::Error run();
 	uint32 getGameFlags() const;
-
-	void updateScreen();
-	void writeCharacter(const Common::Point &pt,
-		unsigned char ch, int palIndex, Graphics::Surface *surface = NULL);
-	void setPixel(const Common::Point &pt, int palIndex, Graphics::Surface *surface = NULL);
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 67bd3ab..027d747 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -88,7 +88,7 @@ void writeg(Common::String l, int c)
 	show_mouse();
 
 	// TODO: Move screen updates to main loop once constructed
-	g_vm->updateScreen();
+	g_vm->_screenSurface.updateScreen();
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 5166f20..5cca06f 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -312,9 +312,9 @@ void hirs() {
  */
 void affput(const Common::Point &pt, int palIndex, int ch) {
 	if (ch == 0)
-		g_vm->setPixel(pt, palIndex);
+		g_vm->_screenSurface.setPixel(pt, palIndex);
 	else
-		g_vm->writeCharacter(pt, ch, palIndex);
+		g_vm->_screenSurface.writeCharacter(pt, ch, palIndex);
 }
 
 void affcar(int gd, int x, int y, int coul, int chr) {


Commit: d15612fa644a454952c2c26353c7b38e307c19f2
    https://github.com/scummvm/scummvm/commit/d15612fa644a454952c2c26353c7b38e307c19f2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:44-07:00

Commit Message:
MORTEVIELLE: Fix remaining issues when decoding first image

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 5099504..4be270f 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -72,6 +72,8 @@ void GfxSurface::decode(const byte *pSrc) {
 
 	// Temporary output buffer
 	byte outputBuffer[65536];
+	Common::fill(&outputBuffer[0], &outputBuffer[65536], 0);
+
 	byte *pDest = &outputBuffer[0];
 	const byte *pSrcStart = pSrc;
 	const byte *pLookup = NULL;
@@ -80,7 +82,7 @@ void GfxSurface::decode(const byte *pSrc) {
 	byte srcBuffer[BUFFER_SIZE];
 
 	// Main processing loop
-	do {
+	for (int entryIndex = 0; entryIndex < entryCount; ++entryIndex) {
 		int lookupBytes = READ_BE_UINT16(pSrc);
 		int srcSize = READ_BE_UINT16(pSrc + 2);
 		_xp = READ_BE_UINT16(pSrc + 4) - _xOffset;
@@ -228,7 +230,8 @@ void GfxSurface::decode(const byte *pSrc) {
 						*pDest = csuiv(pSrc, pLookup);
 					}
 				} else {
-					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest -= DEFAULT_WIDTH) {
+					for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+						pDest -= DEFAULT_WIDTH;
 						*pDest = csuiv(pSrc, pLookup);
 					}
 				}
@@ -293,8 +296,8 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		case 12:
 			INCR_TAIX;
-			_thickness = _var22 = 1;
-			_var1E = 320;
+			_thickness = _xInc = 1;
+			_yInc = DEFAULT_WIDTH;
 			_var20 = _ySize;
 			_var24 = _xSize;
 			diag(pSrc, pDest, pLookup);
@@ -303,17 +306,17 @@ void GfxSurface::decode(const byte *pSrc) {
 		case 13:
 			INCR_TAIX;
 			_thickness = _xSize;
-			_var1E = 1;
+			_yInc = 1;
 			_var20 = _xSize;
-			_var22 = 320;
+			_xInc = DEFAULT_WIDTH;
 			_var24 = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 14:
-			_thickness = _var1E = 1;
+			_thickness = _yInc = 1;
 			_var20 = _xSize;
-			_var22 = 320;
+			_xInc = DEFAULT_WIDTH;
 			_var24 = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
@@ -321,18 +324,18 @@ void GfxSurface::decode(const byte *pSrc) {
 		case 15:
 			INCR_TAIX;
 			_thickness = 2;
-			_var1E = 320;
+			_yInc = DEFAULT_WIDTH;
 			_var20 = _ySize;
-			_var22 = 1;
+			_xInc = 1;
 			_var24 = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 16:
 			_thickness = 3;
-			_var1E = 1;
+			_yInc = 1;
 			_var20 = _xSize;
-			_var22 = 320;
+			_xInc = DEFAULT_WIDTH;
 			_var24 = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
@@ -340,9 +343,9 @@ void GfxSurface::decode(const byte *pSrc) {
 		case 17:
 			INCR_TAIX;
 			_thickness = 3;
-			_var1E = 320;
+			_yInc = DEFAULT_WIDTH;
 			_var20 = _ySize;
-			_var22 = 1;
+			_xInc = 1;
 			_var24 = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
@@ -350,16 +353,18 @@ void GfxSurface::decode(const byte *pSrc) {
 		case 18:
 			INCR_TAIX;
 			_thickness = 5;
-			_var1E = 320;
+			_yInc = DEFAULT_WIDTH;
 			_var20 = _ySize;
-			_var22 = 1;
+			_xInc = 1;
 			_var24 = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 		}
 
 		pSrc = pSrcStart;
-	} while (--entryCount > 0);
+		debugC(1, kMortevielleGraphics, "Decoding image block %d position %d,%d size %d,%d method %d",
+			entryIndex + 1, _xp, _yp, _width, _height, decomIndex);
+	}
 
 	// At this point, the outputBuffer has the data for the image. Initialise the surface
 	// with the calculated size for the full image, and copy the lines to the surface
@@ -519,65 +524,66 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 
 	for (;;) {
 		// Reduce thickness as necessary
-		while ((var28 + _thickness) >= _xSize) {
+		while ((var28 + _thickness) > _xSize) {
 			if (--_thickness == 0)
 				return;
 		}
 
 		// Loop
-		for (int idx = 0; idx < _thickness; ++idx) {
-			if ((idx % 2) == 0) {
-				if (idx > 0)
-					pDest -= DEFAULT_WIDTH;
+		for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+			if ((yCtr % 2) == 0) {
+				if (yCtr > 0)
+					pDest += DEFAULT_WIDTH;
 
-				// Write out horizontal slice left to right
 				var28 += _thickness;
-				for (int xIndex = 0; xIndex < _thickness; ++xIndex) 
-					*pDest++ = suiv(pSrc);
+				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
+					*pDest++ = csuiv(pSrc, pLookup);
 			} else {
-				// Write out horizontal slice right to left
 				pDest += DEFAULT_WIDTH;
 				var28 -= _thickness;
-				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
-					*pDest-- = csuiv(pSrc, pLookup);
+				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
+					*--pDest = csuiv(pSrc, pLookup);
 			}
 		}
-		if ((_thickness % 2) == 0) {
+		if ((_ySize % 2) == 0) {
 			pDest += _thickness;
 			var28 += _thickness;
 		}
-
-		// Reduce thickness as necessary
-		while ((var28 + _thickness) < _xSize) {
+		
+		while (_xSize < (var28 + _thickness)) {
 			if (--_thickness == 0)
 				return;
 		}
 
-		for (int yIndex = 0; yIndex < _ySize; ++yIndex) {
-			if ((yIndex % 2) == 0) {
-				if (yIndex > 0)
+		// Loop
+		for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
+			if ((yCtr % 2) == 0) {
+				if (yCtr > 0)
 					pDest -= DEFAULT_WIDTH;
 
-				// Draw horizontal slice
 				var28 += _thickness;
 
-				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
-					*pDest++ = suiv(pSrc);
+				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
+					*pDest++ = csuiv(pSrc, pLookup);
 			} else {
 				pDest -= DEFAULT_WIDTH;
 				var28 -= _thickness;
 
-				for (int xIndex = 0; xIndex < _thickness; ++xIndex)
-					*pDest-- = csuiv(pSrc, pLookup);
+				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
+					*--pDest = csuiv(pSrc, pLookup);
 			}
+		}				
+		if ((_ySize % 2) == 0) {
+			pDest += _thickness;
+			var28 += _thickness;
 		}
 	}
 }
 
 void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 	int var26 = 0, var28 = 0;
-	_var1E = DEFAULT_WIDTH;
-	_var22 = -1;
+	_yInc = DEFAULT_WIDTH;
+	_xInc = -1;
 	--_xSize;
 	--_ySize;
 
@@ -680,7 +686,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			}
 
 			NIV();
-			pDest += _var1E;
+			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = csuiv(pSrc, pLookup);
@@ -698,7 +704,8 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 				break;
 			}
 
-			pDest += _var22;
+			pDest += _xInc;
+			++var28;
 			if (_var24 < (var28 + 1)) {
 				TF2(pSrc, pDest, pLookup, var26);
 				break;
@@ -706,7 +713,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 		}
 
 		if (TFP(var26))
-			return;
+			break;
 
 		for (;;) {
 			for (int idx = 0; idx <= _thickness; ++idx) {
@@ -716,6 +723,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			}
 
 			NIV();
+			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = csuiv(pSrc, pLookup);
@@ -732,7 +740,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 				NIH();
 				break;
 			} else {
-				pDest += _var22;
+				pDest += _xInc;
 				
 				if (--var28 == 0) {
 					TF2(pSrc, pDest, pLookup, var26);
@@ -748,15 +756,15 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 
 
 void GfxSurface::increments(byte *&pDest) {
-	pDest += _var22 + _var1E;
+	pDest += _xInc + _yInc;
 }
 
 void GfxSurface::NIH() {
-	_var22 = -_var22;
+	_xInc = -_xInc;
 }
 
 void GfxSurface::NIV() {
-	_var1E = -_var1E;
+	_yInc = -_yInc;
 }
 
 bool GfxSurface::TFP(int v) {
@@ -773,7 +781,7 @@ bool GfxSurface::TFP(int v) {
 
 void GfxSurface::TF1(byte *&pDest, int &v) {
 	v += _thickness + 1;
-	pDest += (_thickness + 1) * _var1E;
+	pDest += (_thickness + 1) * _yInc;
 }
 
 void GfxSurface::TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v) {
@@ -781,7 +789,7 @@ void GfxSurface::TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int
 
 	for (int idx = 0; idx <= _thickness; ++idx) {
 		*pDest = csuiv(pSrc, pLookup);
-		pDest += _var1E;
+		pDest += _yInc;
 	}
 }
 
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index c733cbc..8f21cde 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -41,7 +41,7 @@ private:
 	int _xSize, _ySize, _var12;
 	int _var14, _var18, _lookupValue;
 	bool _nibbleFlag;
-	int _thickness, _var1E, _var20, _var22;
+	int _thickness, _yInc, _var20, _xInc;
 	int _var24;
 	int _width, _height;
 	int _xOffset, _yOffset;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index cdeb412..c302bfe 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/system.h"
+#include "common/debug-channels.h"
 #include "engines/util.h"
 #include "engines/engine.h"
 #include "graphics/palette.h"
@@ -49,6 +50,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Initialise graphics mode
 	initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true);
 
+	// Set debug channels
+	DebugMan.addDebugChannel(kMortevielleCore, "core", "Core debugging");
+	DebugMan.addDebugChannel(kMortevielleGraphics, "graphics", "Graphics debugging");
+
 	// Set up an intermediate screen surface
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 


Commit: b93cc84604d60b1503f2c26248e82b738aa13cb6
    https://github.com/scummvm/scummvm/commit/b93cc84604d60b1503f2c26248e82b738aa13cb6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:45-07:00

Commit Message:
MORTEVIELLE: Added an optimised drawBox routine

Changed paths:
    engines/mortevielle/boite.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h



diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index 6e29769..e2b8200 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -25,41 +25,17 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/textconsole.h"
 #include "mortevielle/boite.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/var_mor.h"
+#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
 //Translation: box()
 void boite(int x, int y, int dx, int dy, int coul) {
-	int i;
-	int xi, yi, xo, yo;
+	warning("TODO: boite is deprecated in favour of ScreenSurface::drawBox");
 
-	/* debug('boite'); */
-	hide_mouse();
-	if (res == 1) {
-		x = (uint)x >> 1;
-		dx = (uint)dx >> 1;
-	}
-	xi = x;
-	yi = y;
-	xo = x;
-	yo = y;
-	for (i = 0; i <= dx + dy; i ++) {
-		putpix(gd, xi, yi, coul);
-		if (xi == x + dx)  {
-			if (gd != cga)  putpix(gd, pred(int, xi), yi, coul);
-			yi = succ(int, yi);
-		} else xi = succ(int, xi);
-		putpix(gd, xo, yo, coul);
-		if (yo == y + dy)  xo = succ(int, xo);
-		else {
-			if (gd != cga)  putpix(gd, succ(int, xo), yo, coul);
-			yo = succ(int, yo);
-		}
-	}
-	show_mouse();
+	g_vm->_screenSurface.drawBox(x, y, dx, dy, coul);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 4be270f..851e5df 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -24,6 +24,8 @@
 #include "common/system.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/mortevielle.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
@@ -819,6 +821,7 @@ Graphics::Surface ScreenSurface::lockArea(const Common::Rect &bounds) {
 	_dirtyRects.push_back(bounds);
 
 	Graphics::Surface s;
+	s.format = format;
 	s.pixels = getBasePtr(bounds.left, bounds.top);
 	s.pitch = pitch;
 	s.w = bounds.width();
@@ -845,8 +848,8 @@ void ScreenSurface::updateScreen() {
 
 /**
  * Draws a decoded picture on the screen
- * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
- *		simulate the original 640x200 surface, all Y values have to be doubled.
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ *		simulate the original 640x400 surface, all Y values have to be doubled.
  *		Also, image resources are stored at 320x200, so when drawn onto the screen every
  *		other column is interpolated.
  */
@@ -888,8 +891,8 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 
 /**
  * Draws a character at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
- *		simulate the original 640x200 surface, all Y values have to be doubled
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, 
@@ -914,9 +917,33 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
 }
 
 /**
+ * Draws a box at the specified position and size
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ *		simulate the original 640x400 surface, all Y values have to be doubled
+ */
+void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
+	if (res == 1) {
+		x = (uint)x >> 1;
+		dx = (uint)dx >> 1;
+	}
+
+	Graphics::Surface destSurface = lockArea(Common::Rect(x, y * 2, x + dx, (y + dy) * 2));
+
+	destSurface.hLine(0, 0, dx, col);
+	destSurface.hLine(0, 1, dx, col);
+	destSurface.hLine(0, destSurface.h - 1, dx, col);
+	destSurface.hLine(0, destSurface.h - 2, dx, col);
+	destSurface.vLine(0, 2, destSurface.h - 3, col);
+	destSurface.vLine(1, 2, destSurface.h - 3, col);
+	destSurface.vLine(dx - 1, 2, destSurface.h - 3, col);
+	destSurface.vLine(dx - 2, 2, destSurface.h - 3, col);
+}
+
+
+/**
  * Sets a single pixel at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x200 surface to 
- *		simulate the original 640x200 surface, all Y values have to be doubled
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, pt.x + 1, (pt.y + 1) * 2));
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 8f21cde..78c1637 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -76,7 +76,7 @@ public:
 	void updateScreen();
 	void drawPicture(GfxSurface &surface, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
-
+	void drawBox(int x, int y, int dx, int dy, int col);
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
 };


Commit: cc6dba127da6076136981acb744a9488c3dc9420
    https://github.com/scummvm/scummvm/commit/cc6dba127da6076136981acb744a9488c3dc9420
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:46-07:00

Commit Message:
MORTEVIELLE: Correct horizontal display of images

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 851e5df..d7ed056 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -848,15 +848,17 @@ void ScreenSurface::updateScreen() {
 
 /**
  * Draws a decoded picture on the screen
- * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		- Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled.
- *		Also, image resources are stored at 320x200, so when drawn onto the screen every
+ *		- Image resources are stored at 320x200, so when drawn onto the screen every
  *		other column is interpolated.
+ *		- Because the original game supported 320 width resolutions, the X coordinate
+ *		also needs to be doubled for EGA mode
  */
 void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 	// Lock the affected area of the surface to write to
-	Graphics::Surface destSurface = lockArea(Common::Rect(x, y, 
-		x + surface.w * 2, y + surface.h * 2));
+	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y, 
+		(x + surface.w) * 2, y + surface.h * 2));
 
 	// Loop through writing 
 	for (int yp = 0; yp < surface.h; ++yp) {


Commit: d93ebf71f1d24c9c6d199e63199e299934875ff3
    https://github.com/scummvm/scummvm/commit/d93ebf71f1d24c9c6d199e63199e299934875ff3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:48-07:00

Commit Message:
MORTEVIELLE: Create a basic palette manager class

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index d7ed056..8e4ad33 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -22,6 +22,7 @@
 
 #include "common/endian.h"
 #include "common/system.h"
+#include "graphics/palette.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
@@ -30,6 +31,52 @@
 namespace Mortevielle {
 
 /*-------------------------------------------------------------------------*
+ * Palette Manager 
+ * 
+ *-------------------------------------------------------------------------*/
+
+/**
+ * Set palette entries from the 64 colour available EGA palette
+ */
+void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
+	assert((idx + size) <= 16);
+
+	// Build up the EGA palette
+	byte egaPalette[64 * 3];
+
+	byte *p = &egaPalette[0];
+	for (int i = 0; i < 64; i++) {
+		*p++ = (i >> 2 & 1) * 42 + (i >> 5 & 1) * 21;
+		*p++ = (i >> 1 & 1) * 42 + (i >> 4 & 1) * 21;
+		*p++ = (i      & 1) * 42 + (i >> 3 & 1) * 21;
+    }
+
+	// Loop through setting palette colours based on the passed indexes
+	for (; size > 0; --size, ++idx) {
+		int palIndex = palette[idx];
+		assert(palIndex < 64);
+
+		const byte *pRgb = (const byte *)&egaPalette[palIndex];
+		g_system->getPaletteManager()->setPalette(pRgb, idx, 1);
+	}
+}
+
+/**
+ * Set the default EGA palette
+ */
+void PaletteManager::setDefaultPalette() {
+/*
+	int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 7, 20, 56, 57, 58, 59, 60, 61, 62, 63 };
+	setPalette(defaultPalette, 0, 16);
+*/
+	// TODO: Replace with proper palette
+	for (int idx = 0; idx < 16; ++idx) {
+		uint32 c = 0x111111 * idx;
+		g_system->getPaletteManager()->setPalette((const byte *)&c, idx, 1);
+	}
+}
+
+/*-------------------------------------------------------------------------*
  * Image decoding
  * 
  * The code in this section is responsible for decoding image resources.
@@ -939,6 +986,9 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
 	destSurface.vLine(1, 2, destSurface.h - 3, col);
 	destSurface.vLine(dx - 1, 2, destSurface.h - 3, col);
 	destSurface.vLine(dx - 2, 2, destSurface.h - 3, col);
+
+	// TODO: Remove this once we have a proper game loop
+	updateScreen();
 }
 
 
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 78c1637..f5c2207 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -30,6 +30,12 @@
 
 namespace Mortevielle {
 
+class PaletteManager {
+public:
+	void setPalette(const int *palette, uint idx, uint size);
+	void setDefaultPalette();
+};
+
 #define FONT_WIDTH 8
 #define FONT_HEIGHT 6
 #define FONT_NUM_CHARS 121
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index c302bfe..8346c3f 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -121,11 +121,8 @@ Common::Error MortevielleEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-	// TODO: Remove once palette loading is correctly done
-	for (int idx = 0; idx < 16; ++idx) {
-		uint32 c = 0x111111 * idx;
-		g_system->getPaletteManager()->setPalette((const byte *)&c, idx, 1);
-	}
+	// Set default palette
+	_paletteManager.setDefaultPalette();
 
 	// Dispatch to the game's main routine
 	const char *argv[] = { "" };
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index bcd6f66..816a436 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -52,6 +52,7 @@ private:
 	void loadFont(Common::File &f);
 public:
 	ScreenSurface _screenSurface;
+	PaletteManager _paletteManager;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();


Commit: b5e84ec75c3501f7bc29c8807747cc742eabb989
    https://github.com/scummvm/scummvm/commit/b5e84ec75c3501f7bc29c8807747cc742eabb989
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:49-07:00

Commit Message:
MORTEVIELLE: Implemented a basic event handler.

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mort.cpp
    engines/mortevielle/mort.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 8e4ad33..e6035bb 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -66,7 +66,7 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
  */
 void PaletteManager::setDefaultPalette() {
 /*
-	int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 7, 20, 56, 57, 58, 59, 60, 61, 62, 63 };
+	int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63 };
 	setPalette(defaultPalette, 0, 16);
 */
 	// TODO: Replace with proper palette
@@ -933,9 +933,6 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 			++pDest;
 		}
 	}
-
-	// TODO: Remove this once we have a proper game loop
-	updateScreen();
 }
 
 /**
@@ -986,9 +983,6 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
 	destSurface.vLine(1, 2, destSurface.h - 3, col);
 	destSurface.vLine(dx - 1, 2, destSurface.h - 3, col);
 	destSurface.vLine(dx - 2, 2, destSurface.h - 3, col);
-
-	// TODO: Remove this once we have a proper game loop
-	updateScreen();
 }
 
 
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index dae117e..4eba4c4 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -49,6 +49,7 @@ int testou() {
 	case '\23' :
 		sonoff = ! sonoff;
 		break;
+	/* Prevent changing graphics mode
 	case '\1':
 	case '\3':
 	case '\5'  : {
@@ -69,6 +70,7 @@ int testou() {
 		return testou_result;
 	}
 	break;
+	*/
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 1c2936d..2f07936 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -31,6 +31,7 @@
 #include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/parole2.h"
@@ -275,6 +276,7 @@ void mfouen()
 void atf3f8(int &key) {
 	do {
 		key = testou();
+		CHECK_QUIT;
 	} while (!((key == 61) || (key == 66)));
 }
 
@@ -394,6 +396,7 @@ void sparl(float adr, float rep) {
 	do {
 		parole(repint, haut[caff - 69], 0);
 		atf3f8(key);
+		CHECK_QUIT;
 	} while (!(key == 66));
 	hirs();
 	show_mouse();
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index e24e9b5..fc592f9 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -26,6 +26,7 @@
  */
 
 #include "mortevielle/mort.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/var_mor.h"          /* les variables */                       //Translation: Variables
 #include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"          /* la gestion du clavier */              //Translation: Keyboard manager
@@ -57,6 +58,8 @@ void divers(int np, bool b) {
 	do {
 		parole(np, 0, 0);
 		atf3f8(key);
+		CHECK_QUIT;
+
 		if (newgd != gd) {
 			gd = newgd;
 			hirs();
@@ -67,7 +70,7 @@ void divers(int np, bool b) {
 
 /* NIVEAU 0 */
 
-int mortevielle_main(int argc, const char *argv[]) {
+void mortevielle_main() {
 	/*init_debug;*/
 	/*  ecri_seg;*/
 	//pio_initialize(argc, argv);
@@ -116,9 +119,12 @@ int mortevielle_main(int argc, const char *argv[]) {
 	aff50(false);
 	mlec = 0;
 	divers(142, false);
+	CHECK_QUIT;
 
 	ani50();
 	divers(143, true);
+	CHECK_QUIT;
+
 	suite();
 	music();
 	adzon();
@@ -137,10 +143,6 @@ int mortevielle_main(int argc, const char *argv[]) {
 	do {
 		tjouer();
 	} while (!arret);
-	hide_mouse();
-	clrscr;
-	/*out_debug;*/
-	return EXIT_SUCCESS;
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
index 8523774..d313e32 100644
--- a/engines/mortevielle/mort.h
+++ b/engines/mortevielle/mort.h
@@ -32,7 +32,7 @@ namespace Mortevielle {
 
 extern void divers(int np, bool b);
 /* NIVEAU 0 */
-extern int mortevielle_main(int argc, const char *argv[]);
+extern void mortevielle_main();
 
 } // End of namespace Mortevielle
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8346c3f..6797a7e 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -28,6 +28,7 @@
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mort.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -37,6 +38,7 @@ MortevielleEngine *g_vm;
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
 		Engine(system), _gameDescription(gameDesc) {
 	g_vm = this;
+	_lastGameFrame = 0;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -113,6 +115,78 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 	return Common::kNoError;
 }
 
+bool MortevielleEngine::keyPressed() {
+	// Check for any pending key presses
+	handleEvents();
+
+	// Check if it's time to draw the next frame
+	if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
+		_lastGameFrame = g_system->getMillis();
+	
+		g_vm->_screenSurface.updateScreen();
+	}
+
+	// Delay briefly to keep CPU usage down
+	g_system->delayMillis(5);
+
+	// Return if there are any pending key presses
+	return !_keypresses.empty(); 
+}
+
+int MortevielleEngine::getChar() {
+	// If there isn't any pending keypress, wait until there is
+	while (!shouldQuit() && _keypresses.empty()) {
+		keypressed();
+	}
+
+	// Return the top keypress
+	return shouldQuit() ? 0 : _keypresses.pop();
+}
+
+bool MortevielleEngine::handleEvents() {
+	Common::Event event;
+	if (!g_system->getEventManager()->pollEvent(event))
+		return false;
+
+	switch (event.type) {
+	case Common::EVENT_LBUTTONDOWN:
+	case Common::EVENT_LBUTTONUP:
+	case Common::EVENT_RBUTTONDOWN:
+	case Common::EVENT_RBUTTONUP:
+	case Common::EVENT_MBUTTONDOWN:
+	case Common::EVENT_MBUTTONUP:
+	case Common::EVENT_MOUSEMOVE:
+		x_s = event.mouse.x;
+		y_s = event.mouse.y;
+		break;
+
+	case Common::EVENT_KEYDOWN:
+		addKeypress(event);
+		break;
+	default:
+		break;
+	}
+
+	return true;
+}
+
+/**
+ * Add the specified key to the event queue
+ */
+void MortevielleEngine::addKeypress(Common::Event &evt) {
+	// Check for control keypresses
+	if (evt.kbd.hasFlags(Common::KBD_CTRL) && (evt.kbd.keycode >= Common::KEYCODE_a) &&
+			(evt.kbd.keycode <= Common::KEYCODE_z)) {
+		_keypresses.push(evt.kbd.keycode - Common::KEYCODE_a + 1);
+		return;
+	}
+
+	// Handle function keys
+	if ((evt.kbd.keycode >= Common::KEYCODE_F1) && (evt.kbd.keycode <= Common::KEYCODE_F12)) {
+		_keypresses.push(59 + evt.kbd.keycode - Common::KEYCODE_F1);
+	}
+}
+
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
@@ -125,8 +199,7 @@ Common::Error MortevielleEngine::run() {
 	_paletteManager.setDefaultPalette();
 
 	// Dispatch to the game's main routine
-	const char *argv[] = { "" };
-	mortevielle_main(1, argv);
+	mortevielle_main();
 
 	return Common::kNoError;
 }
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 816a436..c00561d 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -23,8 +23,10 @@
 #ifndef MORTEVIELLE_H
 #define MORTEVIELLE_H
 
+#include "common/events.h"
 #include "common/file.h"
 #include "common/rect.h"
+#include "common/stack.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
 #include "common/error.h"
@@ -42,14 +44,19 @@ enum {
 #define SCREEN_HEIGHT 400
 #define MORT_DAT_REQUIRED_VERSION 1
 #define MORT_DAT "mort.dat"
+#define GAME_FRAME_DELAY (1000 / 50)
 
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
+	Common::Stack<int> _keypresses;
+	uint32 _lastGameFrame;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
 	void loadFont(Common::File &f);
+	bool handleEvents();
+	void addKeypress(Common::Event &evt);
 public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
@@ -59,10 +66,15 @@ public:
 	virtual bool hasFeature(EngineFeature f) const;
 	virtual Common::Error run();
 	uint32 getGameFlags() const;
+
+	bool keyPressed();
+	int getChar();
 };
 
 extern MortevielleEngine *g_vm;
 
+#define CHECK_QUIT if (g_vm->shouldQuit()) { return; }
+
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 89dde41..50d7e0f 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -246,9 +246,10 @@ void ani50() {
 		output(delig);
 	} while (!(cy == 20));
 	ix = 0;
-	do {
+/*	do {
 		ix = ix + 1;
 	} while (!(keypressed() | (ix == 5e5)));
+*/
 	crep = 998;
 	textcolor(1);
 	gotoxy(1, 21);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 5cca06f..1b742a7 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -372,10 +372,10 @@ int get_random_number(int minval, int maxval) {
 }
 
 bool keypressed() {
-	return false;	// Hardcoded currently for no keypress pending
+	return g_vm->keyPressed();
 }
 char get_ch() {
-	return '\0';	// hardcoded currently for no keypress
+	return g_vm->getChar();
 }
 
 void palette(int v1) {


Commit: ca77e3137bcf7edd5b85fd79a9f2e6630a99a752
    https://github.com/scummvm/scummvm/commit/ca77e3137bcf7edd5b85fd79a9f2e6630a99a752
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:50-07:00

Commit Message:
MORTEVIELLE: Properly handle image offsets when drawing images

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e6035bb..64e1256 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -46,9 +46,9 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
 
 	byte *p = &egaPalette[0];
 	for (int i = 0; i < 64; i++) {
-		*p++ = (i >> 2 & 1) * 42 + (i >> 5 & 1) * 21;
-		*p++ = (i >> 1 & 1) * 42 + (i >> 4 & 1) * 21;
-		*p++ = (i      & 1) * 42 + (i >> 3 & 1) * 21;
+		*p++ = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
+		*p++ = (i >> 1 & 1) * 0xaa + (i >> 4 & 1) * 0x55;
+		*p++ = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
     }
 
 	// Loop through setting palette colours based on the passed indexes
@@ -56,7 +56,7 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
 		int palIndex = palette[idx];
 		assert(palIndex < 64);
 
-		const byte *pRgb = (const byte *)&egaPalette[palIndex];
+		const byte *pRgb = (const byte *)&egaPalette[palIndex * 3];
 		g_system->getPaletteManager()->setPalette(pRgb, idx, 1);
 	}
 }
@@ -65,15 +65,8 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
  * Set the default EGA palette
  */
 void PaletteManager::setDefaultPalette() {
-/*
 	int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63 };
 	setPalette(defaultPalette, 0, 16);
-*/
-	// TODO: Replace with proper palette
-	for (int idx = 0; idx < 16; ++idx) {
-		uint32 c = 0x111111 * idx;
-		g_system->getPaletteManager()->setPalette((const byte *)&c, idx, 1);
-	}
 }
 
 /*-------------------------------------------------------------------------*
@@ -86,7 +79,7 @@ void PaletteManager::setDefaultPalette() {
 
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
 #define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
-#define BUFFER_SIZE 8192
+#define BUFFER_SIZE 65536
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;
@@ -99,17 +92,17 @@ void GfxSurface::decode(const byte *pSrc) {
 
 	// First run through the data to calculate starting offsets
 	const byte *p = pSrc;
-	_xOffset = _yOffset = 0xffff;
+	_offset.x = _offset.y = 999;
 
 	assert(entryCount > 0);
 	for (int idx = 0; idx < entryCount; ++idx) {
 		_xp = READ_BE_UINT16(p + 4);
-		if (_xp < _xOffset)
-			_xOffset = _xp;
+		if (_xp < _offset.x)
+			_offset.x = _xp;
 
 		_yp = READ_BE_UINT16(p + 6);
-		if (_yp < _yOffset)
-			_yOffset = _yp;
+		if (_yp < _offset.y)
+			_offset.y = _yp;
 
 		// Move to next entry
 		int size = READ_BE_UINT16(p) + READ_BE_UINT16(p + 2);
@@ -134,8 +127,8 @@ void GfxSurface::decode(const byte *pSrc) {
 	for (int entryIndex = 0; entryIndex < entryCount; ++entryIndex) {
 		int lookupBytes = READ_BE_UINT16(pSrc);
 		int srcSize = READ_BE_UINT16(pSrc + 2);
-		_xp = READ_BE_UINT16(pSrc + 4) - _xOffset;
-		_yp = READ_BE_UINT16(pSrc + 6) - _yOffset;
+		_xp = READ_BE_UINT16(pSrc + 4) - _offset.x;
+		_yp = READ_BE_UINT16(pSrc + 6) - _offset.y;
 		pSrc += 8;
 
 		int decomCode = READ_BE_UINT16(pSrc);
@@ -169,7 +162,6 @@ void GfxSurface::decode(const byte *pSrc) {
 						_nibbleFlag = savedNibbleFlag;
 						_var18 = savedVar18;
 
-						assert(_var14 < 256);
 						for (int idx = 0; idx < _var14; ++idx, ++tableOffset) {
 							assert(tableOffset < BUFFER_SIZE);
 							lookupTable[tableOffset] = suiv(pSrc);
@@ -416,12 +408,12 @@ void GfxSurface::decode(const byte *pSrc) {
 	}
 
 	// At this point, the outputBuffer has the data for the image. Initialise the surface
-	// with the calculated size for the full image, and copy the lines to the surface
-	create(_xOffset + _width, _yOffset + _height, Graphics::PixelFormat::createFormatCLUT8());
+	// with the calculated size, and copy the lines to the surface
+	create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
 
 	for (int yCtr = 0; yCtr < _height; ++yCtr) {
 		const byte *copySrc = &outputBuffer[yCtr * DEFAULT_WIDTH];
-		byte *copyDest = (byte *)getBasePtr(_xOffset, yCtr + _yOffset);
+		byte *copyDest = (byte *)getBasePtr(0, yCtr);
 
 		Common::copy(copySrc, copySrc + _width, copyDest);
 	}
@@ -903,9 +895,13 @@ void ScreenSurface::updateScreen() {
  *		also needs to be doubled for EGA mode
  */
 void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
+	// Adjust the draw position by the draw offset
+	x += surface._offset.x;
+	y += surface._offset.y;
+
 	// Lock the affected area of the surface to write to
-	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y, 
-		(x + surface.w) * 2, y + surface.h * 2));
+	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y * 2, 
+		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Loop through writing 
 	for (int yp = 0; yp < surface.h; ++yp) {
@@ -933,6 +929,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 			++pDest;
 		}
 	}
+	g_vm->_screenSurface.updateScreen();
 }
 
 /**
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index f5c2207..ec6a19e 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -50,7 +50,6 @@ private:
 	int _thickness, _yInc, _var20, _xInc;
 	int _var24;
 	int _width, _height;
-	int _xOffset, _yOffset;
 
 	void majTtxTty();
 	byte suiv(const byte *&pSrc);
@@ -67,6 +66,9 @@ private:
 	void TF1(byte *&pDest, int &v);
 	void TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v);
 public:
+	// Specifies offset when drawing the image
+	Common::Point _offset;
+public:
 	~GfxSurface();
 
 	void decode(const byte *pSrc);


Commit: 070200a4d7f61335181e46f5eefb8dcbe72b4a05
    https://github.com/scummvm/scummvm/commit/070200a4d7f61335181e46f5eefb8dcbe72b4a05
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:52-07:00

Commit Message:
MORTEVIELLE: Fix decoding glitch in the first image

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 64e1256..95988d3 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -499,8 +499,10 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 					++pDest;
 				} else {
 					// Write out vertical slice bottom to top
-					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest -= DEFAULT_WIDTH)
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex) {
+						pDest -= DEFAULT_WIDTH;
 						*pDest = csuiv(pSrc, pLookup);
+					}
 				}
 			}
 
@@ -529,8 +531,10 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 						*pDest = csuiv(pSrc, pLookup);
 				} else {
 					// Write out vertical slice top to bottom
-					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest -= DEFAULT_WIDTH)
+					for (int yIndex = 0; yIndex < _thickness; ++yIndex) {
+						pDest -= DEFAULT_WIDTH;
 						*pDest = csuiv(pSrc, pLookup);
+					}
 				}
 			}
 


Commit: d4802b3f17432ec13c63fccf80c51611a95be804
    https://github.com/scummvm/scummvm/commit/d4802b3f17432ec13c63fccf80c51611a95be804
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:53-07:00

Commit Message:
MORTEVIELLE: Give generic variables in image decoder proper names

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 95988d3..dda2974 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -83,11 +83,11 @@ void PaletteManager::setDefaultPalette() {
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;
-	_var1 = *pSrc++;
+	bool offsetFlag = *pSrc++ == 0;
 	int entryCount = *pSrc++;
 	pSrc += 2;
 
-	if (!_var1)
+	if (offsetFlag)
 		pSrc += 30;
 
 	// First run through the data to calculate starting offsets
@@ -139,7 +139,7 @@ void GfxSurface::decode(const byte *pSrc) {
 		pSrc += 6;
 		pDest = &outputBuffer[0];
 
-		_var18 = 0;
+		_lookupIndex = 0;
 		_nibbleFlag = false;
 
 		int decomIndex = 0;
@@ -150,24 +150,24 @@ void GfxSurface::decode(const byte *pSrc) {
 			if (decomCode & 1) {
 				// Handle decompression of the pattern lookup table
 				do {
-					_var12 = desanalyse(pSrc);
-					_var14 = desanalyse(pSrc);
+					int outerCount = desanalyse(pSrc);
+					int innerCount = desanalyse(pSrc);
 
 					const byte *pSrcSaved = pSrc;
 					bool savedNibbleFlag = _nibbleFlag;
-					int savedVar18 = _var18;
+					int savedLookupIndex = _lookupIndex;
 					
 					do {
 						pSrc = pSrcSaved;
 						_nibbleFlag = savedNibbleFlag;
-						_var18 = savedVar18;
+						_lookupIndex = savedLookupIndex;
 
-						for (int idx = 0; idx < _var14; ++idx, ++tableOffset) {
+						for (int idx = 0; idx < innerCount; ++idx, ++tableOffset) {
 							assert(tableOffset < BUFFER_SIZE);
 							lookupTable[tableOffset] = suiv(pSrc);
 						}
-					} while (--_var12 > 0);
-				} while (_var18 < (lookupBytes - 1));
+					} while (--outerCount > 0);
+				} while (_lookupIndex < (lookupBytes - 1));
 
 			} else {
 				assert(lookupBytes < BUFFER_SIZE);
@@ -183,30 +183,30 @@ void GfxSurface::decode(const byte *pSrc) {
 				++pSrc;
 
 			tableOffset = 0;
-			_var18 = 0;
+			_lookupIndex = 0;
 
 			if (decomCode & 2) {
 				// Handle decompression of the temporary source buffer
 				do {
-					_var12 = desanalyse(pSrc);
-					_var14 = desanalyse(pSrc);
-					_var18 += _var14;
+					int outerCount = desanalyse(pSrc);
+					int innerCount = desanalyse(pSrc);
+					_lookupIndex += innerCount;
 
 					if (_nibbleFlag) {
 						++pSrc;
-						++_var18;
+						++_lookupIndex;
 						_nibbleFlag = false;
 					}
 
 					const byte *pStart = pSrc;
 					do {
 						pSrc = pStart;
-						for (int idx = 0; idx < _var14; ++idx) {
+						for (int idx = 0; idx < innerCount; ++idx) {
 							assert(tableOffset < BUFFER_SIZE);
 							srcBuffer[tableOffset++] = *pSrc++;
 						}
-					} while (--_var12 > 0);
-				} while (_var18 < (srcSize - 1));
+					} while (--outerCount > 0);
+				} while (_lookupIndex < (srcSize - 1));
 			} else {
 				assert(srcSize < BUFFER_SIZE);
 				for (int idx = 0; idx < srcSize; ++idx)
@@ -222,7 +222,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			pSrc = &srcBuffer[0];
 			pLookup = &lookupTable[0] - 1;
 
-			_lookupValue = _var18 = 0;
+			_lookupValue = _lookupIndex = 0;
 			_nibbleFlag = false;
 			decomIndex = decomCode >> 8;
 		}
@@ -339,8 +339,8 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			_thickness = _xInc = 1;
 			_yInc = DEFAULT_WIDTH;
-			_var20 = _ySize;
-			_var24 = _xSize;
+			_yEnd = _ySize;
+			_xEnd = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
@@ -348,17 +348,17 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			_thickness = _xSize;
 			_yInc = 1;
-			_var20 = _xSize;
+			_yEnd = _xSize;
 			_xInc = DEFAULT_WIDTH;
-			_var24 = _ySize;
+			_xEnd = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 14:
 			_thickness = _yInc = 1;
-			_var20 = _xSize;
+			_yEnd = _xSize;
 			_xInc = DEFAULT_WIDTH;
-			_var24 = _ySize;
+			_xEnd = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
@@ -366,18 +366,18 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			_thickness = 2;
 			_yInc = DEFAULT_WIDTH;
-			_var20 = _ySize;
+			_yEnd = _ySize;
 			_xInc = 1;
-			_var24 = _xSize;
+			_xEnd = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
 		case 16:
 			_thickness = 3;
 			_yInc = 1;
-			_var20 = _xSize;
+			_yEnd = _xSize;
 			_xInc = DEFAULT_WIDTH;
-			_var24 = _ySize;
+			_xEnd = _ySize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
@@ -385,9 +385,9 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			_thickness = 3;
 			_yInc = DEFAULT_WIDTH;
-			_var20 = _ySize;
+			_yEnd = _ySize;
 			_xInc = 1;
-			_var24 = _xSize;
+			_xEnd = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 
@@ -395,9 +395,9 @@ void GfxSurface::decode(const byte *pSrc) {
 			INCR_TAIX;
 			_thickness = 5;
 			_yInc = DEFAULT_WIDTH;
-			_var20 = _ySize;
+			_yEnd = _ySize;
 			_xInc = 1;
-			_var24 = _xSize;
+			_xEnd = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
 		}
@@ -431,7 +431,7 @@ byte GfxSurface::suiv(const byte *&pSrc) {
 	int v = *pSrc;
 	if (_nibbleFlag) {
 		++pSrc;
-		++_var18;
+		++_lookupIndex;
 		_nibbleFlag = false;
 		return v & 0xf;
 	} else {
@@ -564,12 +564,11 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 }
 
 void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
-//	byte *pDestEnd = pDest + (_ySize - 1) * DEFAULT_WIDTH + _xSize;
-	int var28 = 0;
+	int drawIndex = 0;
 
 	for (;;) {
 		// Reduce thickness as necessary
-		while ((var28 + _thickness) > _xSize) {
+		while ((drawIndex + _thickness) > _xSize) {
 			if (--_thickness == 0)
 				return;
 		}
@@ -580,22 +579,22 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				if (yCtr > 0)
 					pDest += DEFAULT_WIDTH;
 
-				var28 += _thickness;
+				drawIndex += _thickness;
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
 					*pDest++ = csuiv(pSrc, pLookup);
 			} else {
 				pDest += DEFAULT_WIDTH;
-				var28 -= _thickness;
+				drawIndex -= _thickness;
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
 					*--pDest = csuiv(pSrc, pLookup);
 			}
 		}
 		if ((_ySize % 2) == 0) {
 			pDest += _thickness;
-			var28 += _thickness;
+			drawIndex += _thickness;
 		}
 		
-		while (_xSize < (var28 + _thickness)) {
+		while (_xSize < (drawIndex + _thickness)) {
 			if (--_thickness == 0)
 				return;
 		}
@@ -606,13 +605,13 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				if (yCtr > 0)
 					pDest -= DEFAULT_WIDTH;
 
-				var28 += _thickness;
+				drawIndex += _thickness;
 
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
 					*pDest++ = csuiv(pSrc, pLookup);
 			} else {
 				pDest -= DEFAULT_WIDTH;
-				var28 -= _thickness;
+				drawIndex -= _thickness;
 
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
 					*--pDest = csuiv(pSrc, pLookup);
@@ -620,13 +619,13 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 		}				
 		if ((_ySize % 2) == 0) {
 			pDest += _thickness;
-			var28 += _thickness;
+			drawIndex += _thickness;
 		}
 	}
 }
 
 void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
-	int var26 = 0, var28 = 0;
+	int yPos = 0, drawIndex = 0;
 	_yInc = DEFAULT_WIDTH;
 	_xInc = -1;
 	--_xSize;
@@ -643,32 +642,32 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 		case 1:
 			increments(pDest);
 
-			if (!var28) {
+			if (!drawIndex) {
 				NIH();
 				NIV();
 
-				if (var26 == _ySize) {
+				if (yPos == _ySize) {
 					increments(pDest);
-					++var28;
+					++drawIndex;
 				} else {
-					++var26;
+					++yPos;
 				}
 
 				*++pDest = csuiv(pSrc, pLookup);
 				areaNum = 2;
-			} else if (var26 != _ySize) {
-				++var26;
-				--var28;
+			} else if (yPos != _ySize) {
+				++yPos;
+				--drawIndex;
 				areaNum = 0;
 			} else {
 				NIH();
 				NIV();
 				increments(pDest);
-				++var28;
+				++drawIndex;
 
 				*++pDest = csuiv(pSrc, pLookup);
 
-				if (var28 == _xSize) {
+				if (drawIndex == _xSize) {
 					areaNum = -1;
 				} else {
 					areaNum = 2;
@@ -679,35 +678,35 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 		case 2:
 			increments(pDest);
 
-			if (!var26) {
+			if (!yPos) {
 				NIH();
 				NIV();
 
-				if (var28 == _xSize) {
+				if (drawIndex == _xSize) {
 					increments(pDest);
-					++var26;
+					++yPos;
 				} else {
-					++var28;
+					++drawIndex;
 				}
 
 				pDest += DEFAULT_WIDTH;
 				areaNum = 0;
-			} else if (var28 != _xSize) {
-				++var28;
-				--var26;
+			} else if (drawIndex != _xSize) {
+				++drawIndex;
+				--yPos;
 
 				*pDest = csuiv(pSrc, pLookup);
 				areaNum = 2;
 			} else {
 				pDest += DEFAULT_WIDTH;
-				++var26;
+				++yPos;
 				NIH();
 				NIV();
 				increments(pDest);
 
 				*pDest = csuiv(pSrc, pLookup);
 
-				if (var26 == _ySize)
+				if (yPos == _ySize)
 					areaNum = -1;
 				else
 					areaNum = 1;
@@ -718,10 +717,10 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 }
 
 void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
-	int var26 = 0, var28 = 0;
-	--_var24;
+	int diagIndex = 0, drawIndex = 0;
+	--_xEnd;
 
-	while (!TFP(var26)) {
+	while (!TFP(diagIndex)) {
 		for (;;) {
 			NIH();
 			for (int idx = 0; idx <= _thickness; ++idx) {
@@ -743,21 +742,21 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			NIV();
 			increments(pDest);
 
-			++var28;
-			if (_var24 < (var28 + 1)) {
-				TF1(pDest, var26);
+			++drawIndex;
+			if (_xEnd < (drawIndex + 1)) {
+				TF1(pDest, diagIndex);
 				break;
 			}
 
 			pDest += _xInc;
-			++var28;
-			if (_var24 < (var28 + 1)) {
-				TF2(pSrc, pDest, pLookup, var26);
+			++drawIndex;
+			if (_xEnd < (drawIndex + 1)) {
+				TF2(pSrc, pDest, pLookup, diagIndex);
 				break;
 			}
 		}
 
-		if (TFP(var26))
+		if (TFP(diagIndex))
 			break;
 
 		for (;;) {
@@ -780,15 +779,15 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			NIV();
 			increments(pDest);
 
-			if (--var28 == 0) {
-				TF1(pDest, var26);
+			if (--drawIndex == 0) {
+				TF1(pDest, diagIndex);
 				NIH();
 				break;
 			} else {
 				pDest += _xInc;
 				
-				if (--var28 == 0) {
-					TF2(pSrc, pDest, pLookup, var26);
+				if (--drawIndex == 0) {
+					TF2(pSrc, pDest, pLookup, diagIndex);
 					NIH();
 					break;
 				}
@@ -813,7 +812,7 @@ void GfxSurface::NIV() {
 }
 
 bool GfxSurface::TFP(int v) {
-	int diff = _var20 - v;
+	int diff = _yEnd - v;
 	if (!diff)
 		// Time to finish loop in outer method
 		return true;
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index ec6a19e..f3d0985 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -42,13 +42,12 @@ public:
 
 class GfxSurface: public Graphics::Surface {
 private:
-	int _var1;
 	int _xp, _yp;
 	int _xSize, _ySize, _var12;
-	int _var14, _var18, _lookupValue;
+	int _var14, _lookupIndex, _lookupValue;
 	bool _nibbleFlag;
-	int _thickness, _yInc, _var20, _xInc;
-	int _var24;
+	int _thickness;
+	int _yInc, _yEnd, _xInc, _xEnd;
 	int _width, _height;
 
 	void majTtxTty();


Commit: 02724f7ff4a65dee615dc9acfc4f8cfca41d561a
    https://github.com/scummvm/scummvm/commit/02724f7ff4a65dee615dc9acfc4f8cfca41d561a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:54-07:00

Commit Message:
MORTEVIELLE: Added needed palette remapping to drawPicture()

The remapping allows the first image to now display using the correct colours.

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index dda2974..44bd58d 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -892,8 +892,8 @@ void ScreenSurface::updateScreen() {
  * Draws a decoded picture on the screen
  * @remarks		- Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled.
- *		- Image resources are stored at 320x200, so when drawn onto the screen every
- *		other column is interpolated.
+ *		- Image resources are stored at 320x200, so when drawn onto the screen a single pixel
+ *		from the source image is drawn using the two pixels at the given index in the palette map
  *		- Because the original game supported 320 width resolutions, the X coordinate
  *		also needs to be doubled for EGA mode
  */
@@ -906,6 +906,9 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y * 2, 
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
+	// Get a lookup for the palette mapping
+	const byte *paletteMap = &mem[0x7000 * 16 + 2];
+
 	// Loop through writing 
 	for (int yp = 0; yp < surface.h; ++yp) {
 		if (((y + yp) < 0) || ((y + yp) >= 200))
@@ -915,20 +918,14 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		byte *pDest = (byte *)destSurface.getBasePtr(0, yp * 2);
 
 		for (int xp = 0; xp < surface.w; ++xp, ++pSrc) {
-			// Draw pixel from source image
-			*pDest = *pSrc;
-			*(pDest + SCREEN_WIDTH) = *pSrc;
+			// Draw the pixel using the specified index in the palette map
+			*pDest = paletteMap[*pSrc * 2];
+			*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2];
 			++pDest;
 
-			// TODO: I'm not sure what algorithm the original uses to calculate
-			// which pixel to use on the alternate columns, so for now I'm doing
-			// a simple output of null values. This should be revisited once we've
-			// got the palette loading so we can compare palettes. In fact, the 
-			// original had the alternate columns very noticablely striped. With
-			// the larger 256 colour palette, it may be worthwhile to offer a 
-			// better blended graphics mode as an option.
-			*pDest = 0;
-			*(pDest + SCREEN_WIDTH) = 0;
+			// Use the secondary mapping value to draw the secondary column pixel
+			*pDest = paletteMap[*pSrc * 2 + 1];
+			*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2 + 1];
 			++pDest;
 		}
 	}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 8b8dbcf..42e4393 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -103,7 +103,6 @@ void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&mem[seg * 16 + dep]);
 
-	decomp(seg, dep);
 	if (gd == her) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 1b742a7..0b004a1 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -399,7 +399,7 @@ void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
 
 // (* external 'c:\mc\decomp.com'; *)
 void decomp(int seg, int dep) {
-	warning("TODO: decomp");
+	warning("TODO: decomp deprecated in faovur of GfxSurface::decode");
 }
 
 // (* external 'c:\mc\affich.com'; *)


Commit: 8c5e72534d6d3a318a5f2c1ef90864b51eea6c97
    https://github.com/scummvm/scummvm/commit/8c5e72534d6d3a318a5f2c1ef90864b51eea6c97
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:56-07:00

Commit Message:
MORTEVIELLE: Implement ScreenSurface::fillBox method

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 44bd58d..0c2872f 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -982,6 +982,22 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
 	destSurface.vLine(dx - 2, 2, destSurface.h - 3, col);
 }
 
+/**
+ * Fills an area with the specified colour
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ *		simulate the original 640x400 surface, all Y values have to be doubled
+ */
+void ScreenSurface::fillBox(int colour, const Common::Rect &bounds, int patt) {
+	Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2,
+		bounds.right, bounds.bottom * 2));
+	
+	// Fill the area
+	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), 0);
+
+	// TODO: Figure out what effect patterns of other than '0xff' have
+	if (patt != 0xff)
+		warning("TODO: Figure out operation of ScreenSurface::box when pattern is %xh", patt);
+}
 
 /**
  * Sets a single pixel at the specified co-ordinates
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index f3d0985..4f3956b 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -84,6 +84,8 @@ public:
 	void drawPicture(GfxSurface &surface, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
+	void fillBox(int colour, const Common::Rect &bounds, int patt);
+
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
 };
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0b004a1..2b20173 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -394,7 +394,8 @@ void s_sauv(int Gd, int y, int dy) {
 
 // (* external 'c:\mc\boite.com'; *)
 void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
-	warning("TODO: box method not yet implemented");
+	warning("TODO: box deprecated in favour of GfxSurface::fillBox");
+	g_vm->_screenSurface.fillBox(c, Common::Rect(xo, yo, xi, yi), patt);
 }
 
 // (* external 'c:\mc\decomp.com'; *)


Commit: ecb6f2310798ebfbbf80a96deae096884f98b1d5
    https://github.com/scummvm/scummvm/commit/ecb6f2310798ebfbbf80a96deae096884f98b1d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:57-07:00

Commit Message:
MORTEVIELLE: Fix the calculation in the animof method

Changed paths:
    engines/mortevielle/level15.cpp



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 42e4393..9243426 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -190,6 +190,9 @@ void adzon() {
 	f.close();
 }
 
+/**
+ * Returns the offset within the compressed image data resource of the desired image
+ */
 int animof(int ouf, int num) {
 	int nani, aux;
 
@@ -197,11 +200,8 @@ int animof(int ouf, int num) {
 	nani = mem[adani * 16 + 1];
 	aux = num;
 	if (ouf != 1)  aux = aux + nani;
-	animof_result = (nani << 2) + 2 + swap(READ_LE_UINT16(&mem[adani * 16 + (aux << 1)]));
-	/*aux:= nani shl 2 + 2;
-	if ouf=1 then aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: num shl 1])
-	         else aux:= aux+ swap(WRITE_LE_UINT16(&mem[adani: (nani+num) shl 1]);
-	animof:=aux;*/
+	animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
+
 	return animof_result;
 }
 


Commit: e88b9512f619cb9a7e1e6fe97b57bb00ea1f2e8b
    https://github.com/scummvm/scummvm/commit/e88b9512f619cb9a7e1e6fe97b57bb00ea1f2e8b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:58-07:00

Commit Message:
MORTEVIELLE: Started some notes of the original memory map

Changed paths:
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 16ab044..a96329f 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -43,6 +43,21 @@ namespace Mortevielle {
                                                                              */
 
 /*---------------------------------------------------------------------------*/
+/*-------------------           MEMORY  MAP          ------------------------*/
+/*---------------------------------------------------------------------------*/
+/* The following is a list of physical addresses in memory currently used
+ * by the game.
+ *
+ * Address
+ * -------
+ * 6000:0 - Decompressed current image
+ * 7000:0+ - Compressed images
+ * 7000:2 - 16 words representing palette map
+ * 7000:4138 - width, height, x/y offset of decoded image
+ */
+
+
+/*---------------------------------------------------------------------------*/
 /*-------------------------     DEFINES    ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
@@ -411,7 +426,7 @@ extern byte mem[65536 * 16];
 #define mortevielle_exit(ret) error("Exit the game")
 
 // Text screen functions not relevant for ScummVM
-#define clrscr {}
+#define clrscr { warning("ClrScr"); }
 #define clreol {}
 #define graphcolormode {}
 extern void gotoxy(int x, int y);


Commit: a306753e32afb7f3c55efa6ee925a6d485979820
    https://github.com/scummvm/scummvm/commit/a306753e32afb7f3c55efa6ee925a6d485979820
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:19:59-07:00

Commit Message:
MORTEVIELLE: Fix another graphic glitch in the image decoder

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 0c2872f..44b5921 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -264,7 +264,6 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		case 2:
 			// Draw rect alternating top to bottom, bottom to top
-			INCR_TAIX;
 			for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
 				if ((xCtr % 2) == 0) {
 					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
@@ -929,7 +928,6 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 			++pDest;
 		}
 	}
-	g_vm->_screenSurface.updateScreen();
 }
 
 /**


Commit: 9a9e55d82a0949f16d715dfcf40aadea9088cca6
    https://github.com/scummvm/scummvm/commit/9a9e55d82a0949f16d715dfcf40aadea9088cca6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:01-07:00

Commit Message:
MORTEVIELLE: Fix seeking in chardes and charani

Changed paths:
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 78eccbb..77733b8 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -51,7 +51,7 @@ void chardes(Common::String nom, float passe, int long_) {
 		passe = passe - 128;
 	}
 	if (p != 0)
-		f.seek(p);
+		f.seek(p * 0x80);
 	p = abs((int)passe);
 	l = long_ + p;
 	i = 0;
@@ -84,7 +84,7 @@ void charani(Common::String nom, float passe, int long_) {
 		p = p + 1;
 	}
 	if (p != 0)
-		f.seek(p);
+		f.seek(p * 0x80);
 
 	p = abs((int)passe);
 	l = long_ + p;


Commit: 93821e8399747dfbd7bb632518a378625eee3916
    https://github.com/scummvm/scummvm/commit/93821e8399747dfbd7bb632518a378625eee3916
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:02-07:00

Commit Message:
MORTEVIELLE: Reduce the decoding lookup buffer sizes

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 44b5921..89fd123 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -79,7 +79,7 @@ void PaletteManager::setDefaultPalette() {
 
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
 #define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
-#define BUFFER_SIZE 65536
+#define BUFFER_SIZE 8192
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;


Commit: 2bf0bca24ada988234ea94b1787d7f70e156cc8c
    https://github.com/scummvm/scummvm/commit/2bf0bca24ada988234ea94b1787d7f70e156cc8c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:03-07:00

Commit Message:
MORTEVIELLE: Add ScreenSurface::clearScreen method

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 89fd123..0bc3b77 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -998,6 +998,14 @@ void ScreenSurface::fillBox(int colour, const Common::Rect &bounds, int patt) {
 }
 
 /**
+ * Clears the screen
+ */
+void ScreenSurface::clearScreen() {
+	Graphics::Surface destSurface = lockArea(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+	destSurface.fillRect(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0);
+}
+
+/**
  * Sets a single pixel at the specified co-ordinates
  * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 4f3956b..376b9e5 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -85,6 +85,7 @@ public:
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
 	void fillBox(int colour, const Common::Rect &bounds, int patt);
+	void clearScreen();
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 2b20173..301d089 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -240,71 +240,12 @@ byte adcfiec[(4088 * 16) + (311 * 0x80)];
 /*---------------------------------------------------------------------------*/
 
 void hirs() {
-	/* Deprecated set graphics 
-
-	const byte tandy[14] = {113, 80, 90, 14, 63, 6, 50, 56, 2, 3, 6, 7, 0, 0};
-	const byte herc[13] = {50, 40, 41, 9, 103, 3, 100, 100, 2, 3, 0, 0, 0};
-	int i;
-
-	switch (gd) {
-	case cga : {
-		graphcolormode;
-		graphbackground(0);
-		palette(1);
-		res = 1;
-	}
-	break;
-	case ams : {
-		hires;
-		//inline_((float)(0xb8) / 6 / 0 / //  =>  mov ax,6
-		//        0xcd / 0x10);			//  =>  int 16
-		port[0x3d9] = 15;
-		port[0x3df] = 0;
-		port[0x3dd] = 15;
-
-		res = 2;
-	}
-	break;
-	case ega : {
-		//inline_((float)(0xb8) / 14 / 0 /     //  MOV AX, 14   ; mode video 14 = 640*200 16 couleurs
-		//        0xcd / 0x10);				//   INT 16
-
-		res = 2;
-	}
-	break;
-	case her : {
-		port[0x3bf] = 3;
-		port[0x3b8] = 2;
-		for (i = 0; i <= 12; i ++) {
-			port[0x3b4] = i;
-			port[0x3b5] = herc[i];
-		}
-
-		//inline_((float)(0xfc) / 0xb9 / 0 / 0x80 / 0xb8 / 0 / 0xb0 / 0x8e / 0xc0 / 0x31 / 0xff / 0x31 / 0xc0 / 0xf3 / 0xab);
-
-		port[0x3b8] = 10;
-		res = 2;
-	}
-	break;
-	case tan : {
-		port[0x3d8] = 0;
-		port[0x3da] = 3;
-		port[0x3de] = 0x14;
-		for (i = 0; i <= 13; i ++) {
-			port[0x3d4] = i;
-			port[0x3d5] = tandy[i];
-		}
-		port[0x3da] = 2;
-		port[0x3de] = 0;
-		port[0x3d8] = port[0x3d8] | (11 & 0xef);
-		port[0x3dd] = port[0x3dd] | 1;
-		port[0x3df] = port[0x3df] | 0xc0;
-		box(0, gd, 0, 0, 640, 200, 255);
-		res = 1;
-	}
-	break;
-	}
-	*/
+	// Note: The original used this to set the graphics mode and clear the screen, both at
+	// the start of the game, and whenever the screen need to be cleared. As such, this
+	// method is deprecated in favour of clearing the screen
+	warning("TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
+
+	g_vm->_screenSurface.clearScreen();
 }
 
 /**


Commit: c2b0166cc7de0eadcf293e7aa125669d5e0d2cce
    https://github.com/scummvm/scummvm/commit/c2b0166cc7de0eadcf293e7aa125669d5e0d2cce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:04-07:00

Commit Message:
MORTEVIELLE: Fix savegame loading to allow to read from the data folder

This is needed so that the initial game state can be correctly read from slot 0.

Changed paths:
    engines/mortevielle/disk.cpp



diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 8a889f2..41868d4 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -87,19 +87,28 @@ void takesav(int n) {
 	dem1();
 	// -- Load the file  'sauve#n.mor'
 	Common::String saveName = Common::String::format("sav%d.mor", n);
-	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(saveName);
 
-	Common::Serializer sz(f, NULL);
-	sync_save(sz);
+	// Try loading first from the save area
+	Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(saveName);
+
+	// If not present, try loading from the program folder
+	Common::File f;
+	if (stream == NULL) {
+		if (!f.open(saveName))
+			error("Unable to open save file '%s'", saveName);
 
-	if (f->err()) {
-		i = do_alert(err_mess, 1);
-		mortevielle_exit(0);
+		stream = f.readStream(f.size());
+		f.close();
 	}
+
+	Common::Serializer sz(stream, NULL);
+	sync_save(sz);
+
 	s = s1;
 	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
 
-	delete f;	
+	// Close the stream
+	delete stream;	
 }
 
 void ld_game(int n) {


Commit: 134df7330dd5c1c4402431781cdc1c7e93bd8652
    https://github.com/scummvm/scummvm/commit/134df7330dd5c1c4402431781cdc1c7e93bd8652
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:06-07:00

Commit Message:
MORTEVIELLE: Fix loading of data in charge_bruit5()

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 50d7e0f..d671390 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -354,9 +354,7 @@ void ani50() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&mem[adbruit5 * 16 + 0], 149);
-	/*blockread(f,mem[$5CB0:0],100);
-	blockread(f,mem[$3D1F:0],49);*/
+	f.read(&mem[adbruit5 * 16 + 0], 149 * 128);
 	f.close();
 }
 


Commit: 882a17869c4353a38b09b4014e69458840e9a670
    https://github.com/scummvm/scummvm/commit/882a17869c4353a38b09b4014e69458840e9a670
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:07-07:00

Commit Message:
MORTEVIELLE: Fixed data reading in adzon()

Changed paths:
    engines/mortevielle/level15.cpp



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 9243426..b0ed953 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -158,35 +158,20 @@ end;
 
 void adzon() {
 	Common::File f;
-//	Common::File g;
-//	byte a;
-//	int i;
 
 	if (!f.open("don.mor"))
 		error("Missing file - don.mor");
-	f.read(tabdon, 7);
+	f.read(tabdon, 7 * 256);
 	f.close();
 
 	if (!f.open("bmor.mor"))
 		error("Missing file - bmor.mor");
-	f.read(&tabdon[fleche], 1);
-	/*i:=fleche;
-	repeat
-	  read(g,a);
-	  tabdon[i]:=a;
-	  i:=succ(i);
-	until i=fleche + 1916;*/
+	f.read(&tabdon[fleche], 1 * 1916);
 	f.close();
 
 	if (!f.open("dec.mor"))
-		error("Missing files - dec.moir");
-	f.read(&mem[0x73a2 * 16 + 0], 1);
-	/*i:=0;
-	repeat
-	  read(g,a);
-	  mem[$73A2:i]:=a;
-	  i:=succ(i);
-	until eof(g);*/
+		error("Missing file - dec.mor");
+	f.read(&mem[0x73a2 * 16 + 0], 1 * 1664);
 	f.close();
 }
 


Commit: 5d7775593eb4423712b36ef87723ac34d0674541
    https://github.com/scummvm/scummvm/commit/5d7775593eb4423712b36ef87723ac34d0674541
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:08-07:00

Commit Message:
MORTEVIELLE: Correct ScreenSurface::fillBox to use the passed colour

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 0bc3b77..f751bc2 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -990,7 +990,7 @@ void ScreenSurface::fillBox(int colour, const Common::Rect &bounds, int patt) {
 		bounds.right, bounds.bottom * 2));
 	
 	// Fill the area
-	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), 0);
+	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), colour);
 
 	// TODO: Figure out what effect patterns of other than '0xff' have
 	if (patt != 0xff)


Commit: d9777a8062349ea9234e9dc6a647f4013c7ca785
    https://github.com/scummvm/scummvm/commit/d9777a8062349ea9234e9dc6a647f4013c7ca785
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:10-07:00

Commit Message:
MORTEVIELLE: Changed deprecated warnings to use debugC instead

Changed paths:
    engines/mortevielle/boite.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
index e2b8200..7072085 100644
--- a/engines/mortevielle/boite.cpp
+++ b/engines/mortevielle/boite.cpp
@@ -33,7 +33,7 @@ namespace Mortevielle {
 
 //Translation: box()
 void boite(int x, int y, int dx, int dy, int coul) {
-	warning("TODO: boite is deprecated in favour of ScreenSurface::drawBox");
+	debugC(1, kMortevielleCore, "TODO: boite is deprecated in favour of ScreenSurface::drawBox");
 
 	g_vm->_screenSurface.drawBox(x, y, dx, dy, coul);
 }
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index f751bc2..2759599 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -402,7 +402,7 @@ void GfxSurface::decode(const byte *pSrc) {
 		}
 
 		pSrc = pSrcStart;
-		debugC(1, kMortevielleGraphics, "Decoding image block %d position %d,%d size %d,%d method %d",
+		debugC(2, kMortevielleGraphics, "Decoding image block %d position %d,%d size %d,%d method %d",
 			entryIndex + 1, _xp, _yp, _width, _height, decomIndex);
 	}
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 301d089..9de3d94 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -243,7 +243,7 @@ void hirs() {
 	// Note: The original used this to set the graphics mode and clear the screen, both at
 	// the start of the game, and whenever the screen need to be cleared. As such, this
 	// method is deprecated in favour of clearing the screen
-	warning("TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
+	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
 
 	g_vm->_screenSurface.clearScreen();
 }
@@ -335,13 +335,13 @@ void s_sauv(int Gd, int y, int dy) {
 
 // (* external 'c:\mc\boite.com'; *)
 void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
-	warning("TODO: box deprecated in favour of GfxSurface::fillBox");
+	debugC(1, kMortevielleCore, "TODO: box deprecated in favour of GfxSurface::fillBox");
 	g_vm->_screenSurface.fillBox(c, Common::Rect(xo, yo, xi, yi), patt);
 }
 
 // (* external 'c:\mc\decomp.com'; *)
 void decomp(int seg, int dep) {
-	warning("TODO: decomp deprecated in faovur of GfxSurface::decode");
+	debugC(1, kMortevielleCore, "TODO: decomp deprecated in faovur of GfxSurface::decode");
 }
 
 // (* external 'c:\mc\affich.com'; *)


Commit: 471ada77a79d2f7def3b27d6b73b45c4a9ae392a
    https://github.com/scummvm/scummvm/commit/471ada77a79d2f7def3b27d6b73b45c4a9ae392a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:11-07:00

Commit Message:
MORTEVIELLE: Set up default mouse cursor

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



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6797a7e..97d36e9 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -24,6 +24,7 @@
 #include "common/debug-channels.h"
 #include "engines/util.h"
 #include "engines/engine.h"
+#include "graphics/cursorman.h"
 #include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
@@ -64,7 +65,17 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	res = 2;
 
 	// Load the mort.dat resource
-	return loadMortDat();
+	Common::ErrorCode result = loadMortDat();
+	if (result != Common::kNoError)
+		return result;
+
+	// Set default EGA palette
+	_paletteManager.setDefaultPalette();
+
+	// Setup the mouse cursor
+	initMouse();
+
+	return Common::kNoError;
 }
 
 /**
@@ -187,6 +198,33 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
 	}
 }
 
+static byte CURSOR_ARROW_DATA[16 * 16] = {
+	0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+/**
+ * Initialise the mouse
+ */
+void MortevielleEngine::initMouse() {
+	CursorMan.replaceCursor(CURSOR_ARROW_DATA, 16, 16, 0, 0, 0xff);
+	CursorMan.showMouse(true);
+}
+
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
@@ -195,9 +233,6 @@ Common::Error MortevielleEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-	// Set default palette
-	_paletteManager.setDefaultPalette();
-
 	// Dispatch to the game's main routine
 	mortevielle_main();
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c00561d..2ea48c6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -57,6 +57,7 @@ private:
 	void loadFont(Common::File &f);
 	bool handleEvents();
 	void addKeypress(Common::Event &evt);
+	void initMouse();
 public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;


Commit: 8a2d9285478815e07aa13cd561b9836e25c8fc05
    https://github.com/scummvm/scummvm/commit/8a2d9285478815e07aa13cd561b9836e25c8fc05
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:13-07:00

Commit Message:
MORTEVIELLE: Expand on the mouse/keyboard handling code

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 97d36e9..0e6db54 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -40,6 +40,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 		Engine(system), _gameDescription(gameDesc) {
 	g_vm = this;
 	_lastGameFrame = 0;
+	_mouseButtons = 0;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -164,11 +165,19 @@ bool MortevielleEngine::handleEvents() {
 	case Common::EVENT_LBUTTONUP:
 	case Common::EVENT_RBUTTONDOWN:
 	case Common::EVENT_RBUTTONUP:
-	case Common::EVENT_MBUTTONDOWN:
-	case Common::EVENT_MBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
+		_mousePos = event.mouse;
 		x_s = event.mouse.x;
 		y_s = event.mouse.y;
+
+		if (event.type == Common::EVENT_LBUTTONDOWN)
+			_mouseButtons |= 1;
+		else if (event.type == Common::EVENT_LBUTTONUP)
+			_mouseButtons &= ~1;
+		else if (event.type == Common::EVENT_RBUTTONDOWN)
+			_mouseButtons |= 2;
+		else if (event.type == Common::EVENT_RBUTTONUP)
+			_mouseButtons &= ~2;
 		break;
 
 	case Common::EVENT_KEYDOWN:
@@ -182,20 +191,57 @@ bool MortevielleEngine::handleEvents() {
 }
 
 /**
- * Add the specified key to the event queue
+ * Add the specified key to the pending keypress stack
  */
 void MortevielleEngine::addKeypress(Common::Event &evt) {
-	// Check for control keypresses
-	if (evt.kbd.hasFlags(Common::KBD_CTRL) && (evt.kbd.keycode >= Common::KEYCODE_a) &&
-			(evt.kbd.keycode <= Common::KEYCODE_z)) {
-		_keypresses.push(evt.kbd.keycode - Common::KEYCODE_a + 1);
-		return;
+	// Character to add
+	char ch = evt.kbd.ascii;
+
+	// Handle alphabetic keys
+	if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
+		if (evt.kbd.hasFlags(Common::KBD_CTRL)) 
+			ch = evt.kbd.keycode - Common::KEYCODE_a + 1;
+		else
+			ch = evt.kbd.keycode - Common::KEYCODE_a + 'A';
+	} else if ((evt.kbd.keycode >= Common::KEYCODE_F1) && (evt.kbd.keycode <= Common::KEYCODE_F12)) {
+		// Handle function keys
+		ch = 59 + evt.kbd.keycode - Common::KEYCODE_F1;
+	} else {
+		// Series of special cases
+		switch (evt.kbd.keycode) {
+		case Common::KEYCODE_KP4:
+		case Common::KEYCODE_LEFT:
+			ch = '4';
+		case Common::KEYCODE_KP2:
+		case Common::KEYCODE_DOWN:
+			ch = '2';
+		case Common::KEYCODE_KP6:
+		case Common::KEYCODE_RIGHT:
+			ch = '6';
+		case Common::KEYCODE_KP8:
+		case Common::KEYCODE_UP:
+			ch = '8';
+		case Common::KEYCODE_KP7:
+			ch = '7';
+		case Common::KEYCODE_KP1:
+			ch = '1';
+		case Common::KEYCODE_KP9:
+			ch = '9';
+		case Common::KEYCODE_KP3:
+			ch = '3';
+		case Common::KEYCODE_KP5:
+			ch = '5';
+		case Common::KEYCODE_RETURN:
+			ch = '\13';
+		case Common::KEYCODE_ESCAPE:
+			ch = '\33';
+		default:
+			break;
+		}
 	}
 
-	// Handle function keys
-	if ((evt.kbd.keycode >= Common::KEYCODE_F1) && (evt.kbd.keycode <= Common::KEYCODE_F12)) {
-		_keypresses.push(59 + evt.kbd.keycode - Common::KEYCODE_F1);
-	}
+	if (ch != 0)
+		_keypresses.push(ch);
 }
 
 static byte CURSOR_ARROW_DATA[16 * 16] = {
@@ -225,6 +271,10 @@ void MortevielleEngine::initMouse() {
 	CursorMan.showMouse(true);
 }
 
+void MortevielleEngine::setMousePos(const Common::Point &pt) {
+	_mousePos = pt;
+}
+
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 2ea48c6..3010ae8 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -51,6 +51,8 @@ private:
 	const ADGameDescription *_gameDescription;
 	Common::Stack<int> _keypresses;
 	uint32 _lastGameFrame;
+	int _mouseButtons;
+	Common::Point _mousePos;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
@@ -70,6 +72,9 @@ public:
 
 	bool keyPressed();
 	int getChar();
+	Common::Point getMousePos() const { return _mousePos; }
+	void setMousePos(const Common::Point &pt);
+	int getMouseButtons() const { return _mouseButtons; }
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2fc6e10..2ea8434 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -28,6 +28,7 @@
 #include "common/endian.h"
 #include "common/rect.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -271,67 +272,28 @@ void pos_mouse(int x, int y) {
 	if (y > 199)  y = 199;
 	else if (y < 0)  y = 0;
 	if ((x == x_s) && (y == y_s))  return;
-	if (int_m) {
-		{
-			reg.ax = 4;
-			reg.cx = x;
-			reg.dx = y;
-		}
-		intr(0x33, reg);
-	}
-	hide_mouse();
-	x_s = x;
-	y_s = y;
-	switch (gd) {
-	case ams : {
-		p_o_s = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3) + (y_s & 1) * 0x2000;
-	}
-	break;
-	/*cga : begin
-	        P_O_S:=(Y_S shr 1)*80+X_S shr 2+(Y_S and 1)*$2000;
-	      end;*/
-	case ega : {
-		p_o_s = y_s * 80 + ((uint)x_s >> 3);
-	}
-	break;
-	}    /*  case Gd   */
-	show_mouse();
+
+	// Set the new position
+	g_vm->setMousePos(Common::Point(x, y));
 }
 
 void read_pos_mouse(int &x, int &y, int &c) {
-	registres reg;
-
-	if (int_m) {
-		reg.ax = 3;
-		intr(0x33, reg);
-		x = reg.cx;
-		y = reg.dx;
-		c = reg.bx;
-	} else {
-		c = 0;
-		x = x_s;
-		y = y_s;
-	}
+	x = g_vm->getMousePos().x;
+	y = g_vm->getMousePos().y;
+	c = g_vm->getMouseButtons();
 }
 
 void mov_mouse(bool &funct, char &key) {
 	bool p_key;
 	char in1, in2;
 	int x, y, cx, cy, cd;
-	registres reg;
 
-	if (int_m) {
-		reg.ax = 3;
-		intr(0x33, reg);
-		x = reg.cx;
-		y = reg.dx;
-		cd = reg.bx;
-		pos_mouse(x, y);
-		if (cd != 0) {
-			clic = true;
-			return;
-		}
+	// If mouse button clicked, return it
+	if (g_vm->getMouseButtons() != 0) {
+		clic = true;
+		return;
 	}
+
 	funct = false;
 	key = '\377';
 	p_key = keypressed();


Commit: b884c8bd3cf41714a5ee2ae4ef2acebdad11a08e
    https://github.com/scummvm/scummvm/commit/b884c8bd3cf41714a5ee2ae4ef2acebdad11a08e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:14-07:00

Commit Message:
MORTEVIELLE: Fix compiler warnings and added assert

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 2759599..ee9c632 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1011,6 +1011,7 @@ void ScreenSurface::clearScreen() {
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
+	assert((pt.x >= 0) && (pt.y >= 0) && (pt.x <= SCREEN_WIDTH) && (pt.y <= SCREEN_ORIG_HEIGHT));
 	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, pt.x + 1, (pt.y + 1) * 2));
 
 	byte *destP = (byte *)destSurface.pixels;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 3010ae8..0555f30 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -42,6 +42,7 @@ enum {
 
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
+#define SCREEN_ORIG_HEIGHT 200
 #define MORT_DAT_REQUIRED_VERSION 1
 #define MORT_DAT "mort.dat"
 #define GAME_FRAME_DELAY (1000 / 50)
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2ea8434..04b6c11 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -265,8 +265,6 @@ void show_mouse() {
 }
 
 void pos_mouse(int x, int y) {
-	registres reg;
-
 	if (x > 314 * res)  x = 314 * res;
 	else if (x < 0)  x = 0;
 	if (y > 199)  y = 199;
@@ -286,7 +284,7 @@ void read_pos_mouse(int &x, int &y, int &c) {
 void mov_mouse(bool &funct, char &key) {
 	bool p_key;
 	char in1, in2;
-	int x, y, cx, cy, cd;
+	int cx, cy, cd;
 
 	// If mouse button clicked, return it
 	if (g_vm->getMouseButtons() != 0) {


Commit: 0634f9a69cad8886720bfb0ecd4f886055d4d218
    https://github.com/scummvm/scummvm/commit/0634f9a69cad8886720bfb0ecd4f886055d4d218
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:15-07:00

Commit Message:
MORTEVIELLE: Added explicit quit checks to the main game loops

Changed paths:
    engines/mortevielle/mort.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
index fc592f9..766ae3c 100644
--- a/engines/mortevielle/mort.cpp
+++ b/engines/mortevielle/mort.cpp
@@ -142,6 +142,7 @@ void mortevielle_main() {
 	show_mouse();
 	do {
 		tjouer();
+		CHECK_QUIT;
 	} while (!arret);
 }
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 04b6c11..e79086e 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -295,7 +295,10 @@ void mov_mouse(bool &funct, char &key) {
 	funct = false;
 	key = '\377';
 	p_key = keypressed();
+
 	while (p_key) {
+		CHECK_QUIT;
+
 		in1 = get_ch();	// input >> kbd >> in1;
 		read_pos_mouse(cx, cy, cd);
 		switch (toupper(in1)) {
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 236e785..4161521 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -30,6 +30,7 @@
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/prog.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
@@ -265,6 +266,7 @@ void tecran() {
 			mdn();
 			tinke();
 			mov_mouse(funct, inkey);
+			CHECK_QUIT;
 			temps = temps + 1;
 		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
 
@@ -348,6 +350,7 @@ void tjouer() {
 	antegame();
 	do {
 		tecran();
+		CHECK_QUIT;
 	} while (!((arret) || (solu) || (perdu)));
 	if (solu)  tmaj1();
 	else if (perdu)  tencore();


Commit: 913249aa2e01f46be327890f12774f6823d23f7a
    https://github.com/scummvm/scummvm/commit/913249aa2e01f46be327890f12774f6823d23f7a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:17-07:00

Commit Message:
MORTEVIELLE: Correctly handle keyboard keys for moving mouse

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 0e6db54..f3ad468 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -155,6 +155,11 @@ int MortevielleEngine::getChar() {
 	return shouldQuit() ? 0 : _keypresses.pop();
 }
 
+/**
+ * Handle pending events
+ * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
+ * the mouse Y position is divided by 2 to keep the game thinking the Y goes from 0 - 199
+ */
 bool MortevielleEngine::handleEvents() {
 	Common::Event event;
 	if (!g_system->getEventManager()->pollEvent(event))
@@ -166,9 +171,9 @@ bool MortevielleEngine::handleEvents() {
 	case Common::EVENT_RBUTTONDOWN:
 	case Common::EVENT_RBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
-		_mousePos = event.mouse;
+		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
 		x_s = event.mouse.x;
-		y_s = event.mouse.y;
+		y_s = event.mouse.y / 2;
 
 		if (event.type == Common::EVENT_LBUTTONDOWN)
 			_mouseButtons |= 1;
@@ -212,29 +217,40 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
 		case Common::KEYCODE_KP4:
 		case Common::KEYCODE_LEFT:
 			ch = '4';
+			break;
 		case Common::KEYCODE_KP2:
 		case Common::KEYCODE_DOWN:
 			ch = '2';
+			break;
 		case Common::KEYCODE_KP6:
 		case Common::KEYCODE_RIGHT:
 			ch = '6';
+			break;
 		case Common::KEYCODE_KP8:
 		case Common::KEYCODE_UP:
 			ch = '8';
+			break;
 		case Common::KEYCODE_KP7:
 			ch = '7';
+			break;
 		case Common::KEYCODE_KP1:
 			ch = '1';
+			break;
 		case Common::KEYCODE_KP9:
 			ch = '9';
+			break;
 		case Common::KEYCODE_KP3:
 			ch = '3';
+			break;
 		case Common::KEYCODE_KP5:
 			ch = '5';
+			break;
 		case Common::KEYCODE_RETURN:
 			ch = '\13';
+			break;
 		case Common::KEYCODE_ESCAPE:
 			ch = '\33';
+			break;
 		default:
 			break;
 		}
@@ -271,8 +287,21 @@ void MortevielleEngine::initMouse() {
 	CursorMan.showMouse(true);
 }
 
+/**
+ * Sets the mouse position
+ * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
+ * the mouse Y position is doubled to convert from 0-199 to 0-399
+ */
 void MortevielleEngine::setMousePos(const Common::Point &pt) {
-	_mousePos = pt;
+	// Adjust the passed position from simulated 640x200 to 640x400 co-ordinates
+	Common::Point newPoint(pt.x, (pt.y == 199) ? 399 : pt.y * 2);
+
+	if (newPoint != _mousePos)
+		// Warp the mouse to the new position
+		g_system->warpMouse(newPoint.x, newPoint.y);
+
+	// Save the new position
+	_mousePos = newPoint;
 }
 
 /*-------------------------------------------------------------------------*/
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index e79086e..2e94528 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -286,20 +286,22 @@ void mov_mouse(bool &funct, char &key) {
 	char in1, in2;
 	int cx, cy, cd;
 
+	// Set defaults and check pending events
+	funct = false;
+	key = '\377';
+	p_key = keypressed();
+
 	// If mouse button clicked, return it
 	if (g_vm->getMouseButtons() != 0) {
 		clic = true;
 		return;
 	}
 
-	funct = false;
-	key = '\377';
-	p_key = keypressed();
-
+	// Handle any pending keypresses
 	while (p_key) {
 		CHECK_QUIT;
 
-		in1 = get_ch();	// input >> kbd >> in1;
+		in1 = get_ch();
 		read_pos_mouse(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4' :
@@ -349,7 +351,7 @@ void mov_mouse(bool &funct, char &key) {
 			p_key = keypressed();
 
 			if (p_key) {
-				in2 = get_ch();	// input >> kbd >> in2;
+				in2 = get_ch();
 
 				if ((in2 >= ';') && (in2 <= 'D')) {
 					funct = true;


Commit: 785532980596186523745f8747ddce014389e379
    https://github.com/scummvm/scummvm/commit/785532980596186523745f8747ddce014389e379
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:18-07:00

Commit Message:
MORTEVIELLE: Fix display of action tabs

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 2a05576..8c6561e 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -160,7 +160,7 @@ void menu_aff() {
 			do {     /* ligne par ligne */
 				msk = 0x80;
 				for (pt = 0; pt <= 7; pt ++) {
-					if ((lettres[num_letr][ind_tabl] & msk) != 0) {
+					if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
 						putpix(gd, x + 1, y + 1, 0);
 						putpix(gd, x, y + 1, 0);
 						putpix(gd, x, y, color);


Commit: f9e9754016fb6c741910292dc34c5f71937e113c
    https://github.com/scummvm/scummvm/commit/f9e9754016fb6c741910292dc34c5f71937e113c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:19-07:00

Commit Message:
MORTEVIELLE: Formatting fixes for game menu display

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 8c6561e..a433720 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -51,7 +51,7 @@ namespace Mortevielle {
 		clrscr;
 		mortevielle_exit(0);
 	}
-	while (s.size() < 30)  s = s + ' ';
+	while (s.size() < 20)  s = s + ' ';
 	switch (h) {
 	case invent  :
 		if (l != 7) {
@@ -83,22 +83,22 @@ namespace Mortevielle {
 	switch (h) {
 	case invent : {
 		if (l > 6)  {
-			inv[l].setChar('<', 1);
-			inv[l].setChar('>', 22);
+			inv[l].setChar('<', 0);
+			inv[l].setChar('>', 21);
 		} else inv[l].setChar('*', 1);
 	}
 	break;
 	case depla :
-		dep[l].setChar('*', 1);
+		dep[l].setChar('*', 0);
 		break;
 	case action :
-		act[l].setChar('*', 1);
+		act[l].setChar('*', 0);
 		break;
 	case saction :
-		self_[l].setChar('*', 1);
+		self_[l].setChar('*', 0);
 		break;
 	case discut :
-		dis[l].setChar('*', 1);
+		dis[l].setChar('*', 0);
 		break;
 	}
 }
@@ -111,23 +111,23 @@ namespace Mortevielle {
 	l = lo(no);
 	switch (h) {
 	case invent : {
-		inv[l].setChar(' ', 1);
-		inv[l].setChar(' ', 22);
+		inv[l].setChar(' ', 0);
+		inv[l].setChar(' ', 21);
 	}
 	break;
 	case depla :
-		dep[l].setChar(' ', 1);
+		dep[l].setChar(' ', 0);
 		break;
 	case action :
-		act[l].setChar(' ', 1);
+		act[l].setChar(' ', 0);
 		break;
 	case saction : {
-		self_[l].setChar(' ', 1);
-		self_[l].setChar(' ', 1);
+		self_[l].setChar(' ', 0);
+		self_[l].setChar(' ', 0);
 	}
 	break;
 	case discut :
-		dis[l].setChar(' ', 1);
+		dis[l].setChar(' ', 0);
 		break;
 	}
 }


Commit: d5326e6fa321e0ccb0db79b685f8fb86966cc98d
    https://github.com/scummvm/scummvm/commit/d5326e6fa321e0ccb0db79b685f8fb86966cc98d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:21-07:00

Commit Message:
MORTEVIELLE: More game menu formatting fixes

Changed paths:
    engines/mortevielle/mor2.cpp
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 2f07936..4b8a9ae 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -218,7 +218,7 @@ void tmlieu(int mli) {
 		cx = v_lieu[i][mli];
 		deline(cx + c_tmlieu, st, tail);
 		nomp = delig;
-		while (nomp.size() < 30)  nomp = nomp + ' ';
+		while (nomp.size() < 20)  nomp = nomp + ' ';
 		menut(depl[i], nomp);
 		i = i + 1;
 	}
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index d671390..f019376 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -116,11 +116,16 @@ void ani50() {
 	i = 1;
 	do {
 		deline(i + c_action, st, tai);
-		act[i] = delig + "          ";
+		act[i] = delig;
+		while (act[i].size() < 10)
+			act[i] += ' ';
+
 		if (i < 9) {
 			if (i < 6) {
 				deline(i + c_saction, st, tai);
-				self_[i] = delig + "       ";
+				self_[i] = delig;
+				while (self_[i].size() < 10)
+					self_[i] += ' ';
 			}
 			deline(i + c_dis, st, tai);
 			dis[i] = delig + ' ';


Commit: 56ff300cc86f7b012a1d36072b39f482ff8f9ab5
    https://github.com/scummvm/scummvm/commit/56ff300cc86f7b012a1d36072b39f482ff8f9ab5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:22-07:00

Commit Message:
MORTEVIELLE: Restore background area when a menu is removed

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a433720..11c7c34 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -30,6 +30,7 @@
 #include "common/textconsole.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
@@ -255,6 +256,11 @@ void menu_down(int ii) {
 	int xco, nb_lig;
 
 	/* debug('menu_down'); */
+
+	// Make a copy of the current screen surface for later restore
+	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
+
+	// Draw the menu
 	xco = don[ii][1];
 	nb_lig = don[ii][4];
 	hide_mouse();
@@ -307,6 +313,18 @@ void menu_up(int xx) {
 	/* debug('menu_up'); */
 	if (test0) {
 		charecr(10, succ(byte, don[xx][2]) << 1);
+
+		/* Restore the background area */
+		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
+
+		// Get a pointer to the source and destination of the area to restore
+		const byte *pSrc = (const byte *)g_vm->_backgroundSurface.getBasePtr(0, 10);
+		Graphics::Surface destArea = g_vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
+		byte *pDest = (byte *)destArea.getBasePtr(0, 0);
+
+		// Copy the data
+		Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest);
+
 		test0 = false;
 	}
 }
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0555f30..9974d1c 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -64,6 +64,7 @@ private:
 public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
+	GfxSurface _backgroundSurface;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9de3d94..444d9c6 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -319,8 +319,16 @@ char get_ch() {
 	return g_vm->getChar();
 }
 
+/**
+ * Restore a screen sectio
+ */
+void s_sauv(int Gd, int y, int dy) {
+	// Note: May no longer be necessary, since the backgorund restore code 
+	// is being handled slightly differently now in the menu_up() method
+}
+
 void palette(int v1) {
-	warning("TODO: s_sauv");
+	warning("TODO: palette");
 }
 
 // (* external 'c:\mc\charecr.com'; *)
@@ -328,11 +336,6 @@ void s_char(int Gd, int y, int dy) {
 		warning("TODO: s_char");
 }
 
-// (* external 'c:\mc\sauvecr.com'; *)
-void s_sauv(int Gd, int y, int dy) {
-	warning("TODO: s_sauv");
-}
-
 // (* external 'c:\mc\boite.com'; *)
 void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
 	debugC(1, kMortevielleCore, "TODO: box deprecated in favour of GfxSurface::fillBox");


Commit: 6a3d03d63045d4e2b28a3840dce2ec9b83438ee4
    https://github.com/scummvm/scummvm/commit/6a3d03d63045d4e2b28a3840dce2ec9b83438ee4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:23-07:00

Commit Message:
MORTEVIELLE: Formatting fix for savegame list

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 11c7c34..b14aacf 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -295,12 +295,22 @@ void menu_down(int ii) {
 		case 6 :
 			writeg(fic[cx], 4);
 			break;
-		case 7 :
-			writeg(fic[1] + ' ' + chr(48 + cx), 4);
+		case 7 : {
+			Common::String s = fic[1];
+			s += ' ';
+			s += (char)(48 + cx);
+			writeg(s, 4);
 			break;
+		}
 		case 8 :
-			if (cx == 1)  writeg(recom, 4);
-			else writeg(fic[2] + ' ' + chr(47 + cx), 4);
+			if (cx == 1)
+				writeg(recom, 4);
+			else {
+				Common::String s = fic[2];
+				s += ' ';
+				s += (char)(47 + cx);
+				writeg(s, 4);
+			}
 			break;
 		}
 		putxy(xco, ywhere + 8);


Commit: 90343ce7c9cc53cf85a9ef78882e25af83b5862b
    https://github.com/scummvm/scummvm/commit/90343ce7c9cc53cf85a9ef78882e25af83b5862b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:24-07:00

Commit Message:
MORTEVIELLE: Remove old drive boot sector read code in game startup.

I presume that this may have been part of original game copy protection.

Changed paths:
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 4161521..41d72b5 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -58,9 +58,7 @@ namespace Mortevielle {
 }
 
 /* overlay */ void antegame() {
-	registres regs;
-	char buffer[512];
-	int i, j, k;
+	int k;
 	bool test[3];
 	char g[8];
 
@@ -107,33 +105,14 @@ namespace Mortevielle {
 	affrep();
 	stpou = ind_mess;
 	while ((test[k] == false) && (k < 2)) {
-		regs.ax = 0;
-		k = succ(int, k);
-		intr(19, regs);
-		{
-			regs.ax = 0x201;
-			regs.cx = 0x1;
-			regs.dx = 0x100 + k - 1;
-			//regs.es = seg(buffer);
-			//regs.bx = ofs(buffer);
-			intr(19, regs);
-			test[k] = ! imen;
-			i = 0;
-			while ((test[k]) && (i < 19)) {
-				regs.ax = 0x201;
-				syn = false;
-				regs.cx = 0x2700 + i;
-				regs.dx = 0x100 + k - 1;
-				//regs.es = seg(buffer);
-				//regs.bx = ofs(buffer);
-				intr(19, regs);
-				if (lo(regs.flags) % 2 == 1)  test[k] = false;
-				i = i + 1;
-			}
-			okdes = false;
-			solu = true;
-			for (j = 0; j <= 7; j ++) if (buffer[j + 504] != g[j])  test[k] = false;
-		}
+		++k;
+
+		// Original read in the boot sector here of each drive and did some calculations -
+		// presumably for copy protection. This has been replaced with hardcoded success
+		test[k] = true;
+
+		okdes = false;
+		solu = true;
 		perdu = false;
 		fouil = false;
 	}


Commit: 8ce8442a1361d7acfe9800eed2fae2ddfc5a59c6
    https://github.com/scummvm/scummvm/commit/8ce8442a1361d7acfe9800eed2fae2ddfc5a59c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:26-07:00

Commit Message:
MORTEVIELLE: Fix conversion of string to integer in room changes

Changed paths:
    engines/mortevielle/alert.cpp



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 804e0f4..3617036 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -50,7 +50,7 @@ static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 	bool v;
 
 	//val(s[2], nbc, i);
-	sscanf(s.c_str() + 1, "%d", nbc);
+	nbc = atoi(s.c_str() + 1);
 	i = 0;
 
 	c = "";


Commit: 20feeb0d03b408f9c1534ddefd9af3dedf12f0d9
    https://github.com/scummvm/scummvm/commit/20feeb0d03b408f9c1534ddefd9af3dedf12f0d9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:27-07:00

Commit Message:
MORTEVIELLE: Properly implement get_random_number method

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f3ad468..bdb5b71 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -37,7 +37,7 @@ namespace Mortevielle {
 MortevielleEngine *g_vm;
 
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
-		Engine(system), _gameDescription(gameDesc) {
+		Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle") {
 	g_vm = this;
 	_lastGameFrame = 0;
 	_mouseButtons = 0;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 9974d1c..b0e7343 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -25,6 +25,7 @@
 
 #include "common/events.h"
 #include "common/file.h"
+#include "common/random.h"
 #include "common/rect.h"
 #include "common/stack.h"
 #include "engines/advancedDetector.h"
@@ -65,6 +66,7 @@ public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
 	GfxSurface _backgroundSurface;
+	Common::RandomSource _randomSource;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 444d9c6..92f20a4 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -307,9 +307,11 @@ void graphbackground(int c) {
 void intr(int intNum, registres &regs) {
 }
 
+/**
+ * Get a random number between two values
+ */
 int get_random_number(int minval, int maxval) {
-	// TODO: Replace with a proper random source in the engine
-	return minval;
+	return g_vm->_randomSource.getRandomNumber(maxval - minval) + minval;
 }
 
 bool keypressed() {


Commit: 27ff523c166556c1cbe955c24b7609736eda0aca
    https://github.com/scummvm/scummvm/commit/27ff523c166556c1cbe955c24b7609736eda0aca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:28-07:00

Commit Message:
MORTEVIELLE: Added missing variable to savegame synchronization

Changed paths:
    engines/mortevielle/disk.cpp



diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index 41868d4..a22c8f4 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -62,6 +62,9 @@ void dem1() {
 	*/
 }
 
+/**
+ * Handle saving or loading savegame data
+ */
 static void sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(s1.conf);
 	sz.syncBytes((byte *)&s1.pourc[0], 11);
@@ -78,6 +81,8 @@ static void sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(s1.icryp);
 	sz.syncAsSint16LE(s1.ipre);
 	sz.syncAsSint16LE(s1.heure);
+
+	sz.syncBytes(bufcha, 390);
 }
 
 void takesav(int n) {


Commit: d0de28c1562056aef8a4910e2d7dad024470516c
    https://github.com/scummvm/scummvm/commit/d0de28c1562056aef8a4910e2d7dad024470516c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:30-07:00

Commit Message:
MORTEVIELLE: Merge the _mouseButtons and clic variables

The original separate implementation was causing problems with the mouse click variable remaining set too long.

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 81042c4..9c1a6b7 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -32,6 +32,7 @@
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
@@ -1094,8 +1095,8 @@ L2:
 					} else choi = 0;
 				}
 			}
-		} while (!((tou == '\15') || (((c != 0) || clic) && (choi != 0))));
-		clic = false;
+		} while (!((tou == '\15') || (((c != 0) || g_vm->getMouseClick()) && (choi != 0))));
+		g_vm->setMouseClick(false);
 		if (choi != 46) {
 			ix = choi - 1;
 			if (col) {
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 3617036..6a380b2 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -28,6 +28,7 @@
 #include "common/str.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/sprint.h"
 
@@ -150,7 +151,7 @@ int do_alert(Common::String str_, int n) {
 	while (keypressed())
 		dumi = get_ch();	// input >> kbd >> dumi;
 
-	clic = false;
+	g_vm->setMouseClick(false);
 	decod(str_, nbcase, nblig, nbcol, chaine, cas);
 	sauvecr(50, succ(int, nligne) << 4);
 
@@ -242,8 +243,8 @@ int do_alert(Common::String str_, int n) {
 		}
 		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
 		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
-	} while (!clic);
-	clic = false;
+	} while (!g_vm->getMouseClick());
+	g_vm->setMouseClick(false);
 	hide_mouse();
 	if (! test3)  {
 		quoi = n;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index ee9c632..034a60c 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -79,7 +79,7 @@ void PaletteManager::setDefaultPalette() {
 
 #define INCR_TAIX { if (_xSize & 1) ++_xSize; }
 #define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
-#define BUFFER_SIZE 8192
+#define BUFFER_SIZE 40000
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index b14aacf..f24062a 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -187,7 +187,7 @@ void draw_menu() {
 	msg4 = no_choice;
 	msg3 = no_choice;
 	choisi = false;
-	clic = false;
+	g_vm->setMouseClick(false);
 	test0 = false;
 }
 
@@ -342,7 +342,7 @@ void menu_up(int xx) {
 void erase_menu() {
 	/* debug('erase_menu'); */
 	active_menu = false;
-	clic = false;
+	g_vm->setMouseClick(false);
 	menu_up(msg3);
 }
 
@@ -355,7 +355,7 @@ void mdn() {
 	if (! active_menu)  return;
 	x = x_s;
 	y = y_s;
-	if (! clic) {
+	if (!g_vm->getMouseClick()) {
 		if ((x == xprec) &&
 		        (y == yprec))  return;
 		else {
@@ -385,21 +385,26 @@ void mdn() {
 		} else { /* Not in the MenuTitle line */
 			if ((y > 11) && (test0))  util(x, y);
 		}
-	} else        /* il y a eu 'clic' */
+	} else        /* There was a click */
 		if ((msg3 == fichier) && (msg4 != no_choice)) {
-			clic = false;
+			// Another menu to be displayed
+			g_vm->setMouseClick(false);
 			menu_up(msg3);
 			if (lo(msg4) == 1)  msg3 = 7;
 			else msg3 = 8;
 			menu_down(msg3);
-		} else { /*  il y a eu clic sur un autre menu  */
+
+			g_vm->setMouseClick(false);
+		} else { 
+			//  A menu was clicked on
 			choisi = (test0) && (msg4 != no_choice);
 			menu_up(msg3);
 			msg[4] = msg4;
 			msg[3] = msg3;
 			msg3 = no_choice;
 			msg4 = no_choice;
-			clic = false;
+
+			g_vm->setMouseClick(false);
 		}
 }
 
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 4b8a9ae..1c27ef3 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -202,7 +202,7 @@ void tkey1(bool d) {
 		read_pos_mouse(x, y, c);
 	} while (!(quest || (c != 0) || (d && anyone)));
 	if (quest)  key = testou();
-	clic = false;
+	g_vm->setMouseClick(false);
 	show_mouse();
 }
 
@@ -628,7 +628,8 @@ void tfleche() {
 
 		do {
 			mov_mouse(qust, touch);
-			if (clic)  rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
+			if (g_vm->getMouseClick())
+				rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
 			tinke();
 		} while (!(qust || rect || anyone));
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index bdb5b71..88a3ecd 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -40,7 +40,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 		Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle") {
 	g_vm = this;
 	_lastGameFrame = 0;
-	_mouseButtons = 0;
+	_mouseClick = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -168,21 +168,15 @@ bool MortevielleEngine::handleEvents() {
 	switch (event.type) {
 	case Common::EVENT_LBUTTONDOWN:
 	case Common::EVENT_LBUTTONUP:
-	case Common::EVENT_RBUTTONDOWN:
-	case Common::EVENT_RBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
 		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
 		x_s = event.mouse.x;
 		y_s = event.mouse.y / 2;
 
 		if (event.type == Common::EVENT_LBUTTONDOWN)
-			_mouseButtons |= 1;
+			_mouseClick = true;
 		else if (event.type == Common::EVENT_LBUTTONUP)
-			_mouseButtons &= ~1;
-		else if (event.type == Common::EVENT_RBUTTONDOWN)
-			_mouseButtons |= 2;
-		else if (event.type == Common::EVENT_RBUTTONUP)
-			_mouseButtons &= ~2;
+			_mouseClick = false;
 		break;
 
 	case Common::EVENT_KEYDOWN:
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b0e7343..4c755a1 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -53,7 +53,7 @@ private:
 	const ADGameDescription *_gameDescription;
 	Common::Stack<int> _keypresses;
 	uint32 _lastGameFrame;
-	int _mouseButtons;
+	bool _mouseClick;
 	Common::Point _mousePos;
 
 	Common::ErrorCode initialise();
@@ -78,7 +78,8 @@ public:
 	int getChar();
 	Common::Point getMousePos() const { return _mousePos; }
 	void setMousePos(const Common::Point &pt);
-	int getMouseButtons() const { return _mouseButtons; }
+	bool getMouseClick() const { return _mouseClick; }
+	void setMouseClick(bool v) { _mouseClick = v; }
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2e94528..98429cc 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -57,7 +57,7 @@ void init_mouse() {
 	y_s = 0;
 	p_o_s = 0;
 	/*int_m:= False;*/
-	clic = false;
+	g_vm->setMouseClick(false);
 	m_show = m_arrow;
 	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))  int_m = false;
 	if (int_m) {
@@ -278,7 +278,7 @@ void pos_mouse(int x, int y) {
 void read_pos_mouse(int &x, int &y, int &c) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
-	c = g_vm->getMouseButtons();
+	c = g_vm->getMouseClick() ? 1 : 0;
 }
 
 void mov_mouse(bool &funct, char &key) {
@@ -292,10 +292,8 @@ void mov_mouse(bool &funct, char &key) {
 	p_key = keypressed();
 
 	// If mouse button clicked, return it
-	if (g_vm->getMouseButtons() != 0) {
-		clic = true;
+	if (g_vm->getMouseClick())
 		return;
-	}
 
 	// Handle any pending keypresses
 	while (p_key) {
@@ -343,7 +341,7 @@ void mov_mouse(bool &funct, char &key) {
 		break;
 		case ' ':
 		case '\15' : {
-			clic = true;
+			g_vm->setMouseClick(true);
 			return;
 		}
 		break;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index a981d52..32fba04 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-extern bool clic, int_m;
+extern bool int_m;
 
 extern int m_show,
         x_s,
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index f019376..2837569 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -31,6 +31,7 @@
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
@@ -142,7 +143,7 @@ void ani50() {
 	msg4 = no_choice;
 	msg[3] = no_choice;
 	msg[4] = no_choice;
-	clic = false;
+	g_vm->setMouseClick(false);
 }
 
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index c9154ac..e7ae1b3 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -28,6 +28,7 @@
 #include "common/str.h"
 #include "mortevielle/boite.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
@@ -105,7 +106,7 @@ namespace Mortevielle {
 		j = 0;
 		memk = 0;
 		do {
-			clic = false;
+			g_vm->setMouseClick(false);
 			tesok = false;
 			mov_mouse(func, key);
 			k = 1;
@@ -130,7 +131,7 @@ namespace Mortevielle {
 				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				memk = 0;
 			}
-		} while (!((memk != 0) && clic));
+		} while (!((memk != 0) && g_vm->getMouseClick()));
 		if (memk == ok[i])  compte = compte + 1;
 		else {
 			if (i == 5)  i = i + 1;


Commit: d0319b1d6cc2f1d12e2786275927de23401889a6
    https://github.com/scummvm/scummvm/commit/d0319b1d6cc2f1d12e2786275927de23401889a6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:31-07:00

Commit Message:
MORTEVIELLE: Bugfix for image block decoding method #0

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 034a60c..3683afc 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -129,6 +129,7 @@ void GfxSurface::decode(const byte *pSrc) {
 		int srcSize = READ_BE_UINT16(pSrc + 2);
 		_xp = READ_BE_UINT16(pSrc + 4) - _offset.x;
 		_yp = READ_BE_UINT16(pSrc + 6) - _offset.y;
+		assert((_xp >= 0) && (_yp >= 0) && (_xp < SCREEN_WIDTH) && (_yp < SCREEN_ORIG_HEIGHT));
 		pSrc += 8;
 
 		int decomCode = READ_BE_UINT16(pSrc);
@@ -242,7 +243,7 @@ void GfxSurface::decode(const byte *pSrc) {
 				}
 			}
 
-			pSrc = pSrcStart + lookupBytes + ((lookupBytes & 1) ? 1 : 0);
+			pSrcStart += lookupBytes + ((lookupBytes & 1) ? 1 : 0);
 			break;
 
 		case 1:
@@ -399,6 +400,9 @@ void GfxSurface::decode(const byte *pSrc) {
 			_xEnd = _xSize;
 			diag(pSrc, pDest, pLookup);
 			break;
+
+		default:
+			error("Unknown decompression block type %d", decomIndex);
 		}
 
 		pSrc = pSrcStart;


Commit: 7e481e2d43e7cfc421949ad66ebc28b705501b2a
    https://github.com/scummvm/scummvm/commit/7e481e2d43e7cfc421949ad66ebc28b705501b2a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:32-07:00

Commit Message:
MORTEVIELLE: Fix for displaying savegame menus correctly

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index f24062a..819a2e7 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -217,15 +217,24 @@ void invers(int ix) {
 		s = fic[lo(msg4)];
 		break;
 	case 7 :
-		s = fic[1] + ' ' + chr(48 + lo(msg4));
+		s = fic[1];
+		s += ' ';
+		s += (char)(48 + lo(msg4));
 		break;
 	case 8 :
-		if (lo(msg4) == 1)  s = recom;
-		else s = fic[2] + ' ' + chr(47 + lo(msg4));
+		if (lo(msg4) == 1) {
+			s = recom;
+		} else {
+			s = fic[2];
+			s += ' ';
+			s += (char)(47 + lo(msg4));
+		}
 		break;
 	}
-	if ((s[1] != '*') && (s[1] != '<'))  writeg(s, ix);
-	else msg4 = no_choice;
+	if ((s[1] != '*') && (s[1] != '<'))
+		writeg(s, ix);
+	else
+		msg4 = no_choice;
 }
 
 void util(int x, int y) {


Commit: 0b5eec09a2bb30c0843062a1f5f04fd032f9406c
    https://github.com/scummvm/scummvm/commit/0b5eec09a2bb30c0843062a1f5f04fd032f9406c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:34-07:00

Commit Message:
MORTEVIELLE: Fix some string indexing

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 819a2e7..dc9e7e0 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -231,7 +231,7 @@ void invers(int ix) {
 		}
 		break;
 	}
-	if ((s[1] != '*') && (s[1] != '<'))
+	if ((s[0] != '*') && (s[0] != '<'))
 		writeg(s, ix);
 	else
 		msg4 = no_choice;
@@ -287,19 +287,19 @@ void menu_down(int ii) {
 		cx = succ(int, cx);
 		switch (ii) {
 		case 1 :
-			if (inv[cx][1] != '*')  writeg(inv[cx], 4);
+			if (inv[cx][0] != '*')  writeg(inv[cx], 4);
 			break;
 		case 2 :
-			if (dep[cx][1] != '*')  writeg(dep[cx], 4);
+			if (dep[cx][0] != '*')  writeg(dep[cx], 4);
 			break;
 		case 3 :
-			if (act[cx][1] != '*')  writeg(act[cx], 4);
+			if (act[cx][0] != '*')  writeg(act[cx], 4);
 			break;
 		case 4 :
-			if (self_[cx][1] != '*')  writeg(self_[cx], 4);
+			if (self_[cx][0] != '*')  writeg(self_[cx], 4);
 			break;
 		case 5 :
-			if (dis[cx][1] != '*')  writeg(dis[cx], 4);
+			if (dis[cx][0] != '*')  writeg(dis[cx], 4);
 			break;
 		case 6 :
 			writeg(fic[cx], 4);


Commit: bcc573c6d1521ff01cceb2b34c53005fe0f17b83
    https://github.com/scummvm/scummvm/commit/bcc573c6d1521ff01cceb2b34c53005fe0f17b83
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:35-07:00

Commit Message:
MORTEVIELLE: Changed readclock() method to use ScummVM functionality

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 373a800..17dd83a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -27,6 +27,7 @@
 
 #include "common/endian.h"
 #include "common/str.h"
+#include "common/system.h"
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
 #include "mortevielle/boite.h"
@@ -55,24 +56,19 @@ void testfi() {
 	}
 }
 
-
+/**
+ * Read the current system time
+ */
 int readclock() {
-	registres r;
-	int s, m, h;
+	int m, h;
 
 	/* debug('readclock');*/
-	int readclock_result;
-	r.ax = 0x2c00;
-	intr(0x21, r);
-	{
-		h = (uint)r.cx >> 8;
-		m = r.cx % 256;
-		s = (uint)r.dx >> 8;
-	}
-	m = m * 60;
-	h = h * 3600;
-	readclock_result = h + m + s;
-	return readclock_result;
+	TimeDate dateTime;
+	g_system->getTimeAndDate(dateTime);
+
+	m = dateTime.tm_min * 60;
+	h = dateTime.tm_hour * 3600;
+	return h + m + dateTime.tm_sec;
 }
 
 void modif(int &nu) {


Commit: 8cf581cf7ecc16b0230b5738e194e866cf596739
    https://github.com/scummvm/scummvm/commit/8cf581cf7ecc16b0230b5738e194e866cf596739
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:36-07:00

Commit Message:
MORTEVIELLE: Correct synchronisation of savegame data

Changed paths:
    engines/mortevielle/disk.cpp



diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index a22c8f4..e7c9801 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -79,8 +79,8 @@ static void sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(s1.derobj);
 	sz.syncAsSint16LE(s1.iloic);
 	sz.syncAsSint16LE(s1.icryp);
-	sz.syncAsSint16LE(s1.ipre);
-	sz.syncAsSint16LE(s1.heure);
+	sz.syncAsByte(s1.ipre);
+	sz.syncAsByte(s1.heure);
 
 	sz.syncBytes(bufcha, 390);
 }


Commit: fad0768a70b1a3c0059ca3c0d5554bb66f8b8852
    https://github.com/scummvm/scummvm/commit/fad0768a70b1a3c0059ca3c0d5554bb66f8b8852
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:37-07:00

Commit Message:
MORTEVIELLE: Change float parameters in chardes/charani to int32

The original used this to handle 32-bit values. So it's cleaner to use int32 explicitly.

Changed paths:
    engines/mortevielle/taffich.cpp
    engines/mortevielle/taffich.h



diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 77733b8..55fdbb7 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -35,7 +35,7 @@
 
 namespace Mortevielle {
 
-void chardes(Common::String nom, float passe, int long_) {
+void chardes(Common::String nom, int32 passe, int long_) {
 	int i, p, l;
 //	byte b;
 	Common::File f;
@@ -52,7 +52,7 @@ void chardes(Common::String nom, float passe, int long_) {
 	}
 	if (p != 0)
 		f.seek(p * 0x80);
-	p = abs((int)passe);
+	p = abs(passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
@@ -68,7 +68,7 @@ void chardes(Common::String nom, float passe, int long_) {
 	/*$i+*/
 }
 
-void charani(Common::String nom, float passe, int long_) {
+void charani(Common::String nom, int32 passe, int long_) {
 	int i, p, l;
 //	byte b;
 	Common::File f;
@@ -86,7 +86,7 @@ void charani(Common::String nom, float passe, int long_) {
 	if (p != 0)
 		f.seek(p * 0x80);
 
-	p = abs((int)passe);
+	p = abs(passe);
 	l = long_ + p;
 	i = 0;
 	while (l > 0) {
@@ -106,7 +106,7 @@ void taffich() {
 
 	int i, m, a, b, cx, handle,
 	        npal;
-	float lgt;
+	int32 lgt;
 	Common::String nom;
 	int palh, k, j;
 	int alllum[16];
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
index bea3c09..a6acce2 100644
--- a/engines/mortevielle/taffich.h
+++ b/engines/mortevielle/taffich.h
@@ -32,8 +32,8 @@
 
 namespace Mortevielle {
 
-extern void chardes(Common::String nom, float passe, int long_);
-extern void charani(Common::String nom, float passe, int long_);
+extern void chardes(Common::String nom, int32 passe, int long_);
+extern void charani(Common::String nom, int32 passe, int long_);
 extern void taffich();
 
 } // End of namespace Mortevielle


Commit: b2144322d77c2fa7a45b5c1dbbeec7f68be98160
    https://github.com/scummvm/scummvm/commit/b2144322d77c2fa7a45b5c1dbbeec7f68be98160
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:38-07:00

Commit Message:
MORTEVIELLE: Bugfixes for saving/loading savegames

Changed paths:
    engines/mortevielle/disk.cpp
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
index e7c9801..25bf7fa 100644
--- a/engines/mortevielle/disk.cpp
+++ b/engines/mortevielle/disk.cpp
@@ -82,7 +82,7 @@ static void sync_save(Common::Serializer &sz) {
 	sz.syncAsByte(s1.ipre);
 	sz.syncAsByte(s1.heure);
 
-	sz.syncBytes(bufcha, 390);
+	sz.syncBytes(bufcha, 391);
 }
 
 void takesav(int n) {
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 41d72b5..5f2fd3c 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -255,8 +255,10 @@ void tecran() {
 			change_gd((uint)pred(int, ord(inkey)) >> 1);
 			return;
 		}
-		if (choisi && (msg[3] == sauve))  sv_game(msg[4] & 7);
-		if (choisi && (msg[3] == charge))  ld_game(pred(int, msg[4] & 7));
+		if (choisi && (msg[3] == sauve))
+			sv_game(msg[4] & 7);
+		if (choisi && (msg[3] == charge))
+			ld_game((msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = do_alert(stpou, 1);
 			return;


Commit: 9030ff1bf6a571805cdbb0f8a203092eeba485ce
    https://github.com/scummvm/scummvm/commit/9030ff1bf6a571805cdbb0f8a203092eeba485ce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:40-07:00

Commit Message:
MORTEVIELLE: Visual fix for the inventory menu

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index dc9e7e0..9c50777 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -86,7 +86,7 @@ namespace Mortevielle {
 		if (l > 6)  {
 			inv[l].setChar('<', 0);
 			inv[l].setChar('>', 21);
-		} else inv[l].setChar('*', 1);
+		} else inv[l].setChar('*', 0);
 	}
 	break;
 	case depla :


Commit: 26c8f5d39a7572a7d015244f9000129fe395ef01
    https://github.com/scummvm/scummvm/commit/26c8f5d39a7572a7d015244f9000129fe395ef01
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:41-07:00

Commit Message:
MORTEVIELLE: Add extra parenthesis to defines for operation safety

Changed paths:
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a96329f..89f05f1 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -61,14 +61,14 @@ namespace Mortevielle {
 /*-------------------------     DEFINES    ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-#define pred(type, v) (v - 1)
-#define succ(type, v) (v + 1)
+#define pred(type, v) ((v) - 1)
+#define succ(type, v) ((v) + 1)
 #define ord(v) ((int) v)
 #define chr(v) ((char) v)
-#define lo(v) (v & 0xff)
-#define hi(v) ((v >> 8) & 0xff)
+#define lo(v) ((v) & 0xff)
+#define hi(v) (((v) >> 8) & 0xff)
 #define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
-#define odd(v) ((v % 2) == 1)
+#define odd(v) (((v) % 2) == 1)
 
 /*---------------------------------------------------------------------------*/
 /*-------------------------    CONSTANTS   ----------------------------------*/


Commit: 418a78ab461389b3fc79dd277cf7f62e882804a8
    https://github.com/scummvm/scummvm/commit/418a78ab461389b3fc79dd277cf7f62e882804a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:42-07:00

Commit Message:
MORTEVIELLE: Fix sizes of several arrays

Changed paths:
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 92f20a4..34dc742 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -199,18 +199,18 @@ Common::String al_mess,
        ind_mess,
        al_mess2;
 
-int invt[8];
-int nbrep[8];
-int nbrepm[8];
-int disc[8];
+int invt[9];
+int nbrep[9];
+int nbrepm[9];
+int disc[9];
 int msg[5];
-int depl[7];
+int depl[8];
 Common::String inv[9];
 Common::String dep[8];
 Common::String act[22];
-Common::String self_[6];
+Common::String self_[7];
 Common::String dis[9];
-char touv[7];
+char touv[8];
 sav_chaine s, s1;
 byte bufcha[391];
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 89f05f1..642ecef 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -367,18 +367,18 @@ extern Common::String al_mess,
        ind_mess,
        al_mess2;
 
-extern int invt[8];
-extern int nbrep[8];
-extern int nbrepm[8];
-extern int disc[8];
+extern int invt[9];
+extern int nbrep[9];
+extern int nbrepm[9];
+extern int disc[9];
 extern int msg[5];
-extern int depl[7];
+extern int depl[8];
 extern Common::String inv[9];
 extern Common::String dep[8];
 extern Common::String act[22];
-extern Common::String self_[6];
+extern Common::String self_[7];
 extern Common::String dis[9];
-extern char touv[7];
+extern char touv[8];
 extern sav_chaine s, s1;
 extern byte bufcha[391];
 


Commit: ece9de0b37193ee4f8568e4715e8a682ab144bdd
    https://github.com/scummvm/scummvm/commit/ece9de0b37193ee4f8568e4715e8a682ab144bdd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:44-07:00

Commit Message:
MORTEVIELLE: Added extra quit checks to event loops

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 9c1a6b7..7e51433 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1053,6 +1053,8 @@ L2:
 		tou = '\0';
 		do {
 			mov_mouse(f, tou);
+			CHECK_QUIT;
+
 			/*     if keypressed then read(kbd,tou);*/
 			read_pos_mouse(x, y, c);
 			x = x * (3 - res);
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 6a380b2..3895bad 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -195,6 +195,8 @@ int do_alert(Common::String str_, int n) {
 	do {
 		dumi = '\377';
 		mov_mouse(dum, dumi);
+		CHECK_QUIT0;
+
 		cx = x_s;
 		cy = y_s;
 		test = (cy > 95) && (cy < 105);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 1c27ef3..10fe6e9 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -628,6 +628,8 @@ void tfleche() {
 
 		do {
 			mov_mouse(qust, touch);
+			CHECK_QUIT;
+
 			if (g_vm->getMouseClick())
 				rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
 			tinke();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 4c755a1..75aaeda 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -85,6 +85,7 @@ public:
 extern MortevielleEngine *g_vm;
 
 #define CHECK_QUIT if (g_vm->shouldQuit()) { return; }
+#define CHECK_QUIT0 if (g_vm->shouldQuit()) { return 0; }
 
 } // End of namespace Mortevielle
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index e7ae1b3..a223e49 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -109,6 +109,8 @@ namespace Mortevielle {
 			g_vm->setMouseClick(false);
 			tesok = false;
 			mov_mouse(func, key);
+			CHECK_QUIT0;
+
 			k = 1;
 			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
 			if (coor[k].etat) {


Commit: 81bcc9ff3f26a79699dbd55f27bd762e18ee962c
    https://github.com/scummvm/scummvm/commit/81bcc9ff3f26a79699dbd55f27bd762e18ee962c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:45-07:00

Commit Message:
MORTEVIELLE: Converted the demus assembly code to C++

Changed paths:
  A engines/mortevielle/sound.cpp
  A engines/mortevielle/sound.h
    engines/mortevielle/module.mk
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 327c4ba..b977c25 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -23,6 +23,7 @@ MODULE_OBJS := \
 	parole2.o \
 	prog.o \
 	ques.o \
+	sound.o \
 	sprint.o \
 	taffich.o \
 	var_mor.o
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 2837569..3c23a62 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -36,6 +36,7 @@
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
 #include "mortevielle/parole.h"
+#include "mortevielle/sound.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
@@ -338,7 +339,7 @@ void ani50() {
 	fic.read(&mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	demus(0x3800, 0x5000, 623);
+	demus(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
 	addfix = (float)((tempo_mus - addv[1])) / 256;
 	cctable(tbi);
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 76d6c9a..768b021 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -27,6 +27,7 @@
 
 #include "common/file.h"
 #include "mortevielle/parole.h"
+#include "mortevielle/sound.h"
 
 namespace Mortevielle {
 
@@ -128,7 +129,7 @@ void veracf(byte b) {
 	f.read(&mem[0x7414 * 16 + 0], 273);
 	/*blockread(f,mem[adson * 16+0],300);
 	blockread(f,mem[adson * 16+2400+0],245);*/
-	demus(0x7414, adson, 273);
+	demus(&mem[0x7414 * 16], &mem[adson * 16], 273);
 	f.close();
 }
 
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
new file mode 100644
index 0000000..f2b70cf
--- /dev/null
+++ b/engines/mortevielle/sound.cpp
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "common/scummsys.h"
+#include "mortevielle/sound.h"
+
+namespace Mortevielle {
+
+const int tab[16] = { -96, -72, -48, -32, -20, -12, -8, -4, 0, 4, 8, 12, 20, 32, 48, 72 };
+
+/**
+ * Decode music data
+ */
+void demus(const byte *PSrc, byte *PDest, int NbreSeg) {
+	int seed = 128;
+	int v;
+
+	for (int idx1 = 0; idx1 < (NbreSeg * 2); ++idx1) {
+		for (int idx2 = 0; idx2 < 64; ++idx2) {
+			byte srcByte = *PSrc++;
+			v = tab[srcByte >> 4];
+			seed += v;
+			*PDest++ = seed & 0xff;
+
+			v = tab[srcByte & 0xf];
+			seed += v;
+			*PDest++ = seed & 0xff;
+		}
+	}
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
new file mode 100644
index 0000000..6e4f7b2
--- /dev/null
+++ b/engines/mortevielle/sound.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_SOUND_H
+#define MORTEVIELLE_SOUND_H
+
+namespace Mortevielle {
+
+extern void demus(const byte *PSrc, byte *PDest, int NbreSeg);
+
+} // End of namespace Mortevielle
+
+#endif
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 34dc742..38a374e 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -359,11 +359,6 @@ void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
 
-// (* external 'c:\mc\demus.com'; *)
-void demus(int Src, int Dst, int Tay) {
-	warning("TODO: demus");
-}
-
 // (* external 'c:\mc\phint.com'; *)
 void litph(tablint &t, int typ, int tempo) {
 	warning("TODO: litph");
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 642ecef..b8a18a1 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -50,6 +50,7 @@ namespace Mortevielle {
  *
  * Address
  * -------
+ * 5000:0 - Music data
  * 6000:0 - Decompressed current image
  * 7000:0+ - Compressed images
  * 7000:2 - 16 words representing palette map
@@ -455,8 +456,6 @@ extern void decomp(int seg, int dep);
 extern void afff(int Gd, int seg, int dep, int x, int y); 
 // (* external 'c:\mc\reusint.com'; *)
 extern void musyc(tablint &tb, int nbseg, int att);  
-// (* external 'c:\mc\demus.com'; *)
-extern void demus(int Src, int Dst, int Tay);
 // (* external 'c:\mc\phint.com'; *)
 extern void litph(tablint &t, int typ, int tempo); 
 


Commit: c68f2ff4ffa3293cf0531a4642ae162f430c4971
    https://github.com/scummvm/scummvm/commit/c68f2ff4ffa3293cf0531a4642ae162f430c4971
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:46-07:00

Commit Message:
MORTEVIELLE: Fix for erasing alert dialogs when done

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 3895bad..36a51b0 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -143,6 +143,8 @@ int do_alert(Common::String str_, int n) {
 	bool newaff, test, test1, test2, test3, dum;
 	Common::String cas;
 
+	// Make a copy of the current screen surface for later restore
+	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
 	/*debug('** do_alert **');*/
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
@@ -258,6 +260,10 @@ int do_alert(Common::String str_, int n) {
 	}
 	charecr(50, succ(int, nligne) << 4);
 	show_mouse();
+
+	/* Restore the background area */
+	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
+
 	do_alert_result = quoi;
 	return do_alert_result;
 }
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3683afc..3450d41 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -935,6 +935,23 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 }
 
 /**
+ * Copys a given surface to the given position
+ */
+void ScreenSurface::copyFrom(Graphics::Surface &src, int x, int y) {
+	Graphics::Surface destSurface = lockArea(Common::Rect(x, y, x + src.w, y + src.h));
+
+	// Loop through writing 
+	for (int yp = 0; yp < src.h; ++yp) {
+		if (((y + yp) < 0) || ((y + yp) >= SCREEN_HEIGHT))
+			continue;
+
+		const byte *pSrc = (const byte *)src.getBasePtr(0, yp);
+		byte *pDest = (byte *)getBasePtr(0, yp);
+		Common::copy(pSrc, pSrc + src.w, pDest);
+	}
+}
+
+/**
  * Draws a character at the specified co-ordinates
  * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 376b9e5..0b26546 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -82,6 +82,7 @@ public:
 	Graphics::Surface lockArea(const Common::Rect &bounds);
 	void updateScreen();
 	void drawPicture(GfxSurface &surface, int x, int y);
+	void copyFrom(Graphics::Surface &src, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
 	void fillBox(int colour, const Common::Rect &bounds, int patt);


Commit: 1d4ea4862fca85f899d76fc329f9dae9291f59c6
    https://github.com/scummvm/scummvm/commit/1d4ea4862fca85f899d76fc329f9dae9291f59c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:47-07:00

Commit Message:
MORTEVIELLE: Creation of a tool to extract game strings

Changed paths:
  A devtools/extract_mort/extract_mort.cpp
  A devtools/extract_mort/module.mk



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
new file mode 100644
index 0000000..9e56417
--- /dev/null
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -0,0 +1,373 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This is a utility for extracting needed resource data from different language
+ * version of the Lure of the Temptress lure.exe executable files into a new file
+ * lure.dat - this file is required for the ScummVM  Lure of the Temptress module
+ * to work properly
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/endian.h"
+
+enum AccessMode {
+	kFileReadMode = 1,
+	kFileWriteMode = 2
+};
+
+class File {
+private:
+	FILE *f;
+public:
+	bool open(const char *filename, AccessMode mode = kFileReadMode) {
+		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
+		return (f != NULL);
+	}
+	void close() {
+		fclose(f);
+		f = NULL;
+	}
+	int seek(int32 offset, int whence = SEEK_SET) {
+		return fseek(f, offset, whence);
+	}
+	long read(void *buffer, int len) {
+		return fread(buffer, 1, len, f);
+	}
+	void write(const void *buffer, int len) {
+		fwrite(buffer, 1, len, f);
+	}
+	byte readByte() {
+		byte v;
+		read(&v, sizeof(byte));
+		return v;
+	}
+	uint16 readWord() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_LE_16(v);
+	}
+	uint32 readLong() {
+		uint32 v;
+		read(&v, sizeof(uint32));
+		return FROM_LE_32(v);
+	}
+	void readString(char *sLine) {
+		while ((*sLine = readByte()) != '\n')
+			++sLine;
+
+		*sLine = '\0';
+	}
+	void writeByte(byte v) {
+		write(&v, sizeof(byte));
+	}
+	void writeWord(uint16 v) {
+		uint16 vTemp = TO_LE_16(v);
+		write(&vTemp, sizeof(uint16));
+	}
+	void writeLong(uint32 v) {
+		uint32 vTemp = TO_LE_32(v);
+		write(&vTemp, sizeof(uint32));
+	}
+	void writeString(const char *s) {
+		fprintf(f, "%s", s);
+	}
+	uint32 pos() {
+		return ftell(f);
+	}
+	uint32 size() {
+		int pos = ftell(f);
+		fseek (f, 0, SEEK_END);
+		int end = ftell (f);
+		fseek (f, pos, SEEK_SET);
+	
+		return end;
+	}
+};
+
+File textFile, txxInp, txxNtp;
+
+/*-------------------------------------------------------------------------*/
+
+#define BUFFER_SIZE 32768
+
+const byte tabdr[32] = {
+	32, 101, 115,  97, 114, 105, 110,
+	117, 116, 111, 108,  13, 100,  99,
+	112, 109,  46, 118, 130,  39, 102,
+	98,  44, 113, 104, 103,  33,  76,
+	85, 106,  30,  31
+};
+
+const byte tab30[32] = {
+	69,  67,  74, 138, 133, 120,  77, 122,
+	121,  68,  65,  63,  73,  80,  83,  82,
+	156,  45,  58,  79,  49,  86,  78,  84,
+	71,  81,  64,  66, 135,  34, 136,  91
+};
+
+const byte tab31[32]= {
+	93,  47,  48,  53,  50,  70, 124,  75,
+	72, 147, 140, 150, 151,  57,  56,  51,
+	107, 139,  55,  89, 131,  37,  54,  88,
+	119,   0,   0,   0,   0,   0,   0,   0
+};
+
+/**
+ * Extracts a single character from the game data
+ */
+static void extractCharacter(unsigned char &c, int &idx, int &pt, bool &the_end, const uint16 *strData) {
+	uint16 oct, ocd;
+
+	/* 5-8 */
+	oct = FROM_LE_16(strData[idx]);
+
+	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
+	if (pt < 6) {
+		idx = idx + 1;
+		oct = oct << (5 - pt);
+		pt = pt + 11;
+		oct = oct | (FROM_LE_16(strData[idx]) >> pt);
+	} else {
+		pt = pt - 5;
+		oct = (uint)oct >> pt;
+	}
+
+	switch (oct) {
+	case 11 : {
+		c = '$';
+		the_end = true;
+	}
+	break;
+	case 30:
+	case 31 : {
+		ocd = FROM_LE_16(strData[idx]);
+		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
+		if (pt < 6) {
+			idx = idx + 1;
+			ocd = ocd << (5 - pt);
+			pt = pt + 11;
+			ocd = ocd | (FROM_LE_16(strData[idx]) >> pt);
+		} else {
+			pt = pt - 5;
+			ocd = (uint)ocd >> pt;
+		}
+		if (oct == 30)
+			c = (char)tab30[ocd];
+		else
+			c = (char)tab31[ocd];
+
+		if (c == '\0') {
+			the_end = true;
+		}
+	}
+	break;
+	default:
+		c = (char)tabdr[oct];
+	}	
+}
+
+/**
+ * Puts a compressed 5-bit value into the string data buffer
+ */
+static void addCompressedValue(int oct, int &indis, int &point, uint16 *strData) {
+	// Write out the part of the value that fits into the current word
+	if (point < 5)
+		strData[indis] |= oct >> (5 - point);
+	else
+		strData[indis] |= oct << (point - 5);
+
+	// Handling of there's any overlap into the next word
+	if (point < 5) {
+		// Overlapping into next word
+		++indis;
+		
+		// Get the bits that fall into the next word and set it
+		int remainder = oct & ((1 << (5 - point)) - 1);
+		strData[indis] |= remainder << (16 - (5 - point));
+
+		point += -5 + 16;
+	} else {
+		point -= 5;
+		if (point == 0) {
+			point = 16;
+			++indis;
+		}
+	}
+}
+
+/**
+ * Compresses a single passed character and stores it in the compressed strings buffer
+ */
+static void compressCharacter(unsigned char ch, int &indis, int &point, uint16 *strData) {
+	if (ch == '$') {
+		// End of string
+		addCompressedValue(11, indis, point, strData);
+		return;
+	}
+
+	// Scan through the tabdr array for a match
+	for (int idx = 0; idx < 30; ++idx) {
+		if ((idx != 11) && (tabdr[idx] == ch)) {
+			addCompressedValue(idx, indis, point, strData);
+			return;
+		}
+	}
+
+	// Scan through the tab30 array
+	for (int idx = 0; idx < 32; ++idx) {
+		if (tab30[idx] == ch) {
+			addCompressedValue(30, indis, point, strData);
+			addCompressedValue(idx, indis, point, strData);
+			return;
+		}
+	}
+
+	// Scan through the tab31 array
+	for (int idx = 0; idx < 32; ++idx) {
+		if (tab31[idx] == ch) {
+			addCompressedValue(31, indis, point, strData);
+			addCompressedValue(idx, indis, point, strData);
+			return;
+		}
+	}
+
+	printf("Encountered invalid character '%c' when compressing strings\n", ch);
+	exit(1);
+}
+
+/**
+ * string extractor
+ */
+static void export_strings(const char *textFilename) {
+	char buffer[BUFFER_SIZE];
+	uint16 *strData;
+
+	// Open input and output files
+	txxInp.open("TXX.INP", kFileReadMode);
+	txxNtp.open("TXX.NTP", kFileReadMode);
+	textFile.open(textFilename, kFileWriteMode);
+
+	// Read all the compressed string data into a buffer
+	strData = (uint16 *)malloc(txxInp.size());
+	txxInp.read(strData, txxInp.size());
+
+	// Loop through getting each string
+	for (unsigned int strIndex = 0; strIndex < (txxNtp.size() / 3); ++strIndex) {
+		int indis = txxNtp.readWord();
+		int point = txxNtp.readByte();
+
+		// Extract the string
+		int charIndex = 0;
+		unsigned char ch;
+		bool endFlag = false;
+		do {
+			extractCharacter(ch, indis, point, endFlag, strData);
+			buffer[charIndex++] = ch;
+			if (ch == BUFFER_SIZE) {
+				printf("Extracted string exceeded allowed buffer size.\n");
+				exit(1);
+			}
+		} while (!endFlag);
+
+		// Write out the string
+		buffer[charIndex++] = '\n';
+		buffer[charIndex] = '\0';
+		textFile.writeString(buffer);
+	}
+
+	// Close the files and free the buffer
+	free(strData);
+	txxInp.close();
+	txxNtp.close();
+	textFile.close();
+}
+
+/**
+ * string importer
+ */
+static void import_strings(const char *textFilename) {
+	// Open input and output files
+	txxInp.open("TXX.INP", kFileWriteMode);
+	txxNtp.open("TXX.NTP", kFileWriteMode);
+	textFile.open(textFilename, kFileReadMode);
+
+	// Set up a buffer for the output compressed strings
+	uint16 strData[BUFFER_SIZE];
+	memset(strData, 0, BUFFER_SIZE);
+	char sLine[BUFFER_SIZE];
+
+	int indis = 0;
+	int point = 16;
+
+	while (textFile.pos() < textFile.size()) {
+		// Read in the next source line
+		textFile.readString(sLine);
+
+		// Write out the index entry for the string
+		txxNtp.writeWord(indis);
+		txxNtp.writeByte(point);
+
+		// Loop through writing out the characters to the compressed data buffer
+		char *s = sLine;
+		while (*s) {
+			compressCharacter(*s, indis, point, strData);
+			++s;
+		}
+	}
+
+	// Write out the compressed data
+	if (point != 16)
+		++indis;
+	txxInp.write(strData, indis);
+
+	// Close the files
+	txxInp.close();
+	txxNtp.close();
+	textFile.close();
+}
+
+
+int main(int argc, char *argv[]) {
+	if (argc != 3) {
+		printf("Format: %s export|import output_file\n", argv[0]);
+		printf("The program must be run from the directory with the Mortville Manor game files.\n");
+		exit(0);
+	}
+
+	// Do the processing
+	if (!strcmp(argv[1], "export"))
+		export_strings(argv[2]);
+	else if (!strcmp(argv[1], "import"))
+		import_strings(argv[2]);
+	else
+		printf("Unknown operation specified\n");
+}
diff --git a/devtools/extract_mort/module.mk b/devtools/extract_mort/module.mk
new file mode 100644
index 0000000..cbdcd25
--- /dev/null
+++ b/devtools/extract_mort/module.mk
@@ -0,0 +1,11 @@
+
+MODULE := devtools/extract_mort
+
+MODULE_OBJS := \
+	extract_mort.o \
+
+# Set the name of the executable
+TOOL_EXECUTABLE := extract_mort
+
+# Include common rules
+include $(srcdir)/rules.mk


Commit: 35e1987da34360add79232402341d3cb258b44d3
    https://github.com/scummvm/scummvm/commit/35e1987da34360add79232402341d3cb258b44d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:48-07:00

Commit Message:
MORTEVIELLE: Minor bugfixes to string extraction tool

Changed paths:
    devtools/extract_mort/extract_mort.cpp



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index 9e56417..192ea50 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -296,6 +296,9 @@ static void export_strings(const char *textFilename) {
 				printf("Extracted string exceeded allowed buffer size.\n");
 				exit(1);
 			}
+
+			if (indis >= (txxInp.size() / 2))
+				endFlag = true;
 		} while (!endFlag);
 
 		// Write out the string
@@ -347,7 +350,7 @@ static void import_strings(const char *textFilename) {
 	// Write out the compressed data
 	if (point != 16)
 		++indis;
-	txxInp.write(strData, indis);
+	txxInp.write(strData, indis * 2);
 
 	// Close the files
 	txxInp.close();


Commit: e67da8a53384b65af9fcfee288e7da48921f0693
    https://github.com/scummvm/scummvm/commit/e67da8a53384b65af9fcfee288e7da48921f0693
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:50-07:00

Commit Message:
MORTEVIELLE: In progress implementation of PC Speaker music player

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 88a3ecd..fde3d42 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -37,7 +37,8 @@ namespace Mortevielle {
 MortevielleEngine *g_vm;
 
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
-		Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle") {
+		Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle"),
+		_soundManager(_mixer) {
 	g_vm = this;
 	_lastGameFrame = 0;
 	_mouseClick = false;
@@ -298,6 +299,22 @@ void MortevielleEngine::setMousePos(const Common::Point &pt) {
 	_mousePos = newPoint;
 }
 
+/**
+ * Delay by a given amount
+ */
+void MortevielleEngine::delay(int amount) {
+	uint32 endTime = g_system->getMillis() + amount;
+
+	while (g_system->getMillis() < endTime) {
+		if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
+			_lastGameFrame = g_system->getMillis();
+			g_vm->_screenSurface.updateScreen();
+		}
+
+		g_system->delayMillis(10);
+	}
+}
+
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 75aaeda..86ec947 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -33,6 +33,7 @@
 #include "common/error.h"
 #include "graphics/surface.h"
 #include "mortevielle/graphics.h"
+#include "mortevielle/sound.h"
 
 namespace Mortevielle {
 
@@ -67,6 +68,7 @@ public:
 	PaletteManager _paletteManager;
 	GfxSurface _backgroundSurface;
 	Common::RandomSource _randomSource;
+	SoundManager _soundManager;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
@@ -80,6 +82,7 @@ public:
 	void setMousePos(const Common::Point &pt);
 	bool getMouseClick() const { return _mouseClick; }
 	void setMouseClick(bool v) { _mouseClick = v; }
+	void delay(int amount);
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 3c23a62..bfa6f47 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -339,7 +339,7 @@ void ani50() {
 	fic.read(&mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	demus(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
+	g_vm->_soundManager.demus(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
 	addfix = (float)((tempo_mus - addv[1])) / 256;
 	cctable(tbi);
 
@@ -347,7 +347,7 @@ void ani50() {
 	k = 0;
 	do {
 		fin = keypressed();
-		musyc(tbi, 9958 , tempo_mus);
+		g_vm->_soundManager.musyc(tbi, 9958 , tempo_mus);
 		k = k + 1;
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 768b021..ba43b59 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -28,6 +28,7 @@
 #include "common/file.h"
 #include "mortevielle/parole.h"
 #include "mortevielle/sound.h"
+#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
@@ -129,7 +130,7 @@ void veracf(byte b) {
 	f.read(&mem[0x7414 * 16 + 0], 273);
 	/*blockread(f,mem[adson * 16+0],300);
 	blockread(f,mem[adson * 16+2400+0],245);*/
-	demus(&mem[0x7414 * 16], &mem[adson * 16], 273);
+	g_vm->_soundManager.demus(&mem[0x7414 * 16], &mem[adson * 16], 273);
 	f.close();
 }
 
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index cba5588..e0aaf83 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -29,6 +29,8 @@
 #include "mortevielle/level15.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/parole.h"
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/sound.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -116,7 +118,7 @@ void parole(int rep, int ht, int typ) {
 	break;
 	}
 	trait_ph();
-	litph(tbi, typ, tempo);
+	g_vm->_soundManager.litph(tbi, typ, tempo);
 	if (typlec != 0)
 		for (i = 0; i <= 500; i ++) {
 			t_cph[i] = savph[i];
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index f2b70cf..08dbe0b 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -27,15 +27,125 @@
 
 #include "common/scummsys.h"
 #include "mortevielle/sound.h"
+#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
+/**
+ * Constructor
+ */
+PCSpeaker::PCSpeaker(int rate) {
+	_rate = rate;
+	_oscLength = 0;
+	_oscSamples = 0;
+	_remainingSamples = 0;
+	_volume = 255;
+}
+
+/**
+ * Destructor
+ */
+PCSpeaker::~PCSpeaker() {
+}
+
+/**
+ * Adds a new note to the queue of notes to be played.
+ */
+void PCSpeaker::play(int freq, uint32 length) {
+	assert((freq > 0) && (length > 0));
+	Common::StackLock lock(_mutex);
+
+	_pendingNotes.push(SpeakerNote(freq, length));
+}
+
+/**
+ * Stops the currently playing song
+ */
+void PCSpeaker::stop() {
+	Common::StackLock lock(_mutex);
+
+	_remainingSamples = 0;
+	_pendingNotes.clear();
+}
+
+void PCSpeaker::setVolume(byte volume) {
+	_volume = volume;
+}
+
+/**
+ * Return true if a song is currently playing
+ */
+bool PCSpeaker::isPlaying() const {
+	return !_pendingNotes.empty() || (_remainingSamples != 0);
+}
+
+/**
+ * Method used by the mixer to pull off pending samples to play
+ */
+int PCSpeaker::readBuffer(int16 *buffer, const int numSamples) {
+	Common::StackLock lock(_mutex);
+
+	int i;
+
+	for (i = 0; (_remainingSamples || !_pendingNotes.empty())  && (i < numSamples); i++) {
+		if (!_remainingSamples)
+			// Used up the current note, so queue the next one
+			dequeueNote();
+
+		buffer[i] = generateSquare(_oscSamples, _oscLength) * _volume;
+		if (_oscSamples++ >= _oscLength)
+			_oscSamples = 0;
+
+		_remainingSamples--;
+	}
+
+	// Clear the rest of the buffer
+	if (i < numSamples)
+		memset(buffer + i, 0, (numSamples - i) * sizeof(int16));
+
+	return numSamples;
+}
+
+/**
+ * Dequeues a note from the pending note list
+ */
+void PCSpeaker::dequeueNote() {
+	SpeakerNote note = _pendingNotes.pop();
+
+	_oscLength = _rate / note.freq;
+	_oscSamples = 0;
+	_remainingSamples = (_rate * note.length) / 1000000;
+	assert((_oscLength > 0) && (_remainingSamples > 0));
+}
+
+/**
+ * Support method for generating a square wave
+ */
+int8 PCSpeaker::generateSquare(uint32 x, uint32 oscLength) {
+	return (x < (oscLength / 2)) ? 127 : -128;
+}
+
+/*-------------------------------------------------------------------------*/
+
 const int tab[16] = { -96, -72, -48, -32, -20, -12, -8, -4, 0, 4, 8, 12, 20, 32, 48, 72 };
 
+SoundManager::SoundManager(Audio::Mixer *mixer) {
+	_mixer = mixer;
+	_speakerStream = new PCSpeaker(mixer->getOutputRate());
+	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
+							_speakerStream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
+}
+
+SoundManager::~SoundManager() {
+	_mixer->stopHandle(_speakerHandle);
+	delete _speakerStream;
+
+}
+
 /**
  * Decode music data
  */
-void demus(const byte *PSrc, byte *PDest, int NbreSeg) {
+void SoundManager::demus(const byte *PSrc, byte *PDest, int NbreSeg) {
 	int seed = 128;
 	int v;
 
@@ -53,4 +163,36 @@ void demus(const byte *PSrc, byte *PDest, int NbreSeg) {
 	}
 }
 
+void SoundManager::litph(tablint &t, int typ, int tempo) {
+	return;
+}
+
+void SoundManager::playNote(int frequency, int32 length) {
+	_speakerStream->play(frequency, length);
+}
+
+
+void SoundManager::musyc(tablint &tb, int nbseg, int att) {
+#ifdef DEBUG
+	const byte *pSrc = &mem[0x5000 * 16];
+	
+	// Convert the countdown amount to a tempo rate, and then to note length in microseconds
+	int tempo = 1193180 / att;
+	int length = 1000000 / tempo;
+
+	for (int noteIndex = 0; noteIndex < (nbseg * 16); ++noteIndex) {
+		int lookupValue = *pSrc++;
+		int noteCountdown = tb[lookupValue];
+		int noteFrequency = 1193180 / noteCountdown;
+
+		playNote(noteFrequency, length);
+	}
+
+	// Keep waiting until the song has been finished
+	while (_speakerStream->isPlaying() && !g_vm->shouldQuit()) {
+		g_vm->delay(10);
+	}
+#endif
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index 6e4f7b2..f089974 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -28,9 +28,83 @@
 #ifndef MORTEVIELLE_SOUND_H
 #define MORTEVIELLE_SOUND_H
 
+#include "audio/audiostream.h"
+#include "audio/mixer.h"
+#include "common/mutex.h"
+#include "common/queue.h"
+#include "mortevielle/var_mor.h"
+
 namespace Mortevielle {
 
-extern void demus(const byte *PSrc, byte *PDest, int NbreSeg);
+/**
+ * Structure used to store pending notes to play
+ */
+struct SpeakerNote {
+	int freq;
+	uint32 length;
+
+	SpeakerNote(int noteFreq, uint32 noteLength) {
+		freq = noteFreq;
+		length = noteLength;
+	}
+};
+	
+/**
+ * This is a modified PC Speaker class that allows the queueing of an entire song
+ * sequence one note at a time.
+ */
+class PCSpeaker : public Audio::AudioStream {
+private:
+	Common::Queue<SpeakerNote> _pendingNotes;
+	Common::Mutex _mutex;
+
+	int _rate;
+	uint32 _oscLength;
+	uint32 _oscSamples;
+	uint32 _remainingSamples;
+	uint32 _mixedSamples;
+	byte _volume;
+
+	void dequeueNote();
+protected:
+	static int8 generateSquare(uint32 x, uint32 oscLength);
+public:
+	PCSpeaker(int rate = 44100);
+	~PCSpeaker();
+
+	/** Play a note for length microseconds.
+	 */
+	void play(int freq, uint32 length);
+	/** Stop the currently playing sequence */
+	void stop();
+	/** Adjust the volume. */
+	void setVolume(byte volume);
+
+	bool isPlaying() const;
+
+	int readBuffer(int16 *buffer, const int numSamples);
+
+	bool isStereo() const	{ return false; }
+	bool endOfData() const	{ return false; }
+	bool endOfStream() const { return false; }
+	int getRate() const	{ return _rate; }
+};
+
+class SoundManager {
+private:
+	Audio::Mixer *_mixer;
+	PCSpeaker *_speakerStream;
+	Audio::SoundHandle _speakerHandle;
+public:
+	SoundManager(Audio::Mixer *mixer);
+	~SoundManager();
+
+	void playNote(int frequency, int32 length);
+
+	void demus(const byte *PSrc, byte *PDest, int NbreSeg);
+	void litph(tablint &t, int typ, int tempo);
+	void musyc(tablint &tb, int nbseg, int att);  
+};
 
 } // End of namespace Mortevielle
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 38a374e..bd43212 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -359,9 +359,4 @@ void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
 
-// (* external 'c:\mc\phint.com'; *)
-void litph(tablint &t, int typ, int tempo) {
-	warning("TODO: litph");
-}
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index b8a18a1..5d62e77 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -454,10 +454,6 @@ extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
 extern void decomp(int seg, int dep); 
 // (* external 'c:\mc\affich.com'; *)
 extern void afff(int Gd, int seg, int dep, int x, int y); 
-// (* external 'c:\mc\reusint.com'; *)
-extern void musyc(tablint &tb, int nbseg, int att);  
-// (* external 'c:\mc\phint.com'; *)
-extern void litph(tablint &t, int typ, int tempo); 
 
 } // End of namespace Mortevielle
 


Commit: a5143fb1a7fe4ea289f4e30902575ba9e665b102
    https://github.com/scummvm/scummvm/commit/a5143fb1a7fe4ea289f4e30902575ba9e665b102
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:51-07:00

Commit Message:
MORTEVIELLE: Replace timer chip frequency values with a constant

Changed paths:
    engines/mortevielle/sound.cpp



diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 08dbe0b..0a6e7e8 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -129,6 +129,9 @@ int8 PCSpeaker::generateSquare(uint32 x, uint32 oscLength) {
 
 const int tab[16] = { -96, -72, -48, -32, -20, -12, -8, -4, 0, 4, 8, 12, 20, 32, 48, 72 };
 
+// The PC timer chip works at a frequency of 1.19318Mhz
+#define TIMER_FREQUENCY 1193180
+
 SoundManager::SoundManager(Audio::Mixer *mixer) {
 	_mixer = mixer;
 	_speakerStream = new PCSpeaker(mixer->getOutputRate());
@@ -177,13 +180,13 @@ void SoundManager::musyc(tablint &tb, int nbseg, int att) {
 	const byte *pSrc = &mem[0x5000 * 16];
 	
 	// Convert the countdown amount to a tempo rate, and then to note length in microseconds
-	int tempo = 1193180 / att;
+	int tempo = TIMER_FREQUENCY / att;
 	int length = 1000000 / tempo;
 
 	for (int noteIndex = 0; noteIndex < (nbseg * 16); ++noteIndex) {
 		int lookupValue = *pSrc++;
 		int noteCountdown = tb[lookupValue];
-		int noteFrequency = 1193180 / noteCountdown;
+		int noteFrequency = TIMER_FREQUENCY / noteCountdown;
 
 		playNote(noteFrequency, length);
 	}


Commit: e57bdb46e1e36ca562fd80bbc21d0e44ba09d12e
    https://github.com/scummvm/scummvm/commit/e57bdb46e1e36ca562fd80bbc21d0e44ba09d12e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:52-07:00

Commit Message:
MORTEVIELLE: Merged mort.cpp into mortevielle.cpp, and split up intro from main game

Changed paths:
  R engines/mortevielle/mort.cpp
  R engines/mortevielle/mort.h
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index b977c25..2d16106 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -14,7 +14,6 @@ MODULE_OBJS := \
 	menu.o \
 	mor.o \
 	mor2.o \
-	mort.o \
 	mortevielle.o \
 	mouse.o \
 	outtext.o \
diff --git a/engines/mortevielle/mort.cpp b/engines/mortevielle/mort.cpp
deleted file mode 100644
index 766ae3c..0000000
--- a/engines/mortevielle/mort.cpp
+++ /dev/null
@@ -1,149 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/mort.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"          /* les variables */                       //Translation: Variables
-#include "mortevielle/asm.h"
-#include "mortevielle/keyboard.h"          /* la gestion du clavier */              //Translation: Keyboard manager
-#include "mortevielle/mouse.h"          /* la souris  */                            //Translation: Mouse
-#include "mortevielle/level15.h"          /* les fonctions de base */               //Translation: Lowlevel functions
-#include "mortevielle/droite.h"          /* pour faire une droite */                //Translation: Display a lign
-#include "mortevielle/boite.h"                                                      //Translation: Box
-#include "mortevielle/sprint.h"          /* l'affichage des textes */               //Translation: Display texts
-#include "mortevielle/outtext.h"          /* fonctions sup‚rieures d'affichage */   //Translation: Highlevel display functions
-#include "mortevielle/parole.h"          /* les fonctions de la parole */           //Translation: Speech functions
-#include "mortevielle/alert.h"
-#include "mortevielle/parole2.h"          /* les fonctions de la parole */          //Translation: Speech functions
-/*  debug              le debugging */                                              //Translation: Debugger
-#include "mortevielle/ques.h"          /* les questions */                          //Translation: Questions
-#include "mortevielle/menu.h"          /* les fonctions du menu */                  //Translation: Menu functions
-#include "mortevielle/mor.h"          /* divers */                                  //Translation: Misc
-#include "mortevielle/taffich.h"          /* chargement des dessins */              //Translation: pictures loader
-#include "mortevielle/ovd1.h"          /* les fonctions sur disque 1 */             //Translation: Disk functions
-#include "mortevielle/mor2.h"          /* divers */                                 //Translation: Misc
-#include "mortevielle/actions.h"          /* les actions */                         //Translation: Actions
-#include "mortevielle/prog.h"          /* fonctions toplevel */                     //Translation: toplevel functions
-#include "mortevielle/disk.h"          /* chargements et sauvegardes */             //Translation: Load/Save
-/*  ecrihexa            utilitaire */                                               //Translation: Toolbox
-
-namespace Mortevielle {
-
-void divers(int np, bool b) {
-	teskbd();
-	do {
-		parole(np, 0, 0);
-		atf3f8(key);
-		CHECK_QUIT;
-
-		if (newgd != gd) {
-			gd = newgd;
-			hirs();
-			aff50(b);
-		}
-	} while (!(key == 66));
-}
-
-/* NIVEAU 0 */
-
-void mortevielle_main() {
-	/*init_debug;*/
-	/*  ecri_seg;*/
-	//pio_initialize(argc, argv);
-	gd = ega;
-	newgd = gd;
-	zuul = false;
-	tesok = false;
-	chartex();
-	charpal();
-	charge_cfiph();
-	charge_cfiec();
-	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-	c_zzz = 1;
-	init_nbrepm();
-	init_mouse();
-	/*  crep:=WRITE_LE_UINT16(&mem[$7f00:0];
-	  WRITE_LE_UINT16(&mem[$7f00:0]:= crep+1;
-	  if (WRITE_LE_UINT16(&mem[$7f00:0]<> crep+1) then
-	     begin
-	       hirs;
-	       show_mouse;
-	       crep:=do_alert('[1][ 512 k  minimum requis  !!][OK]',1);
-	       clrscr;
-	       halt;
-	     end;
-	  if (Dseg+$1000>adbruit5) then
-	     begin
-	       hirs;
-	       show_mouse;
-	       crep:=do_alert('[1][ Il ne reste pas assez de |place m‚moire  !!][OK]',1);
-	       clrscr;
-	       halt;
-	     end;*/
-	init_lieu();
-	arret = false;
-	sonoff = false;
-	f2_all = false;
-	textcolor(9);
-	teskbd();
-	dialpre();
-	newgd = gd;
-	teskbd();
-	if (newgd != gd)  gd = newgd;
-	hirs();
-	ades = 0x7000;
-	aff50(false);
-	mlec = 0;
-	divers(142, false);
-	CHECK_QUIT;
-
-	ani50();
-	divers(143, true);
-	CHECK_QUIT;
-
-	suite();
-	music();
-	adzon();
-	takesav(0);
-	if (rech_cfiec)  charge_cfiec();
-	for (crep = 1; crep <= c_zzz; crep ++) 
-		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-	charge_bruit5();
-	init_menu();
-
-	theure();
-	dprog();
-	hirs();
-	dessine_rouleau();
-	show_mouse();
-	do {
-		tjouer();
-		CHECK_QUIT;
-	} while (!arret);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mort.h b/engines/mortevielle/mort.h
deleted file mode 100644
index d313e32..0000000
--- a/engines/mortevielle/mort.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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_MORT_H
-#define MORTEVIELLE_MORT_H
-
-namespace Mortevielle {
-
-extern void divers(int np, bool b);
-/* NIVEAU 0 */
-extern void mortevielle_main();
-
-} // End of namespace Mortevielle
-
-#endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index fde3d42..35d71c9 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -28,8 +28,16 @@
 #include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/mort.h"
+#include "mortevielle/asm.h"
+#include "mortevielle/disk.h"
+#include "mortevielle/keyboard.h"
+#include "mortevielle/level15.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/ovd1.h"
+#include "mortevielle/parole2.h"
+#include "mortevielle/prog.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -77,6 +85,36 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
+	/*init_debug;*/
+	/*  ecri_seg;*/
+	//pio_initialize(argc, argv);
+	gd = ega;
+	newgd = gd;
+	zuul = false;
+	tesok = false;
+	chartex();
+	charpal();
+	charge_cfiph();
+	charge_cfiec();
+	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	c_zzz = 1;
+	init_nbrepm();
+	init_mouse();
+
+	init_lieu();
+	arret = false;
+	sonoff = false;
+	f2_all = false;
+	textcolor(9);
+	teskbd();
+	dialpre();
+	newgd = gd;
+	teskbd();
+	if (newgd != gd)
+		gd = newgd;
+	hirs();
+	ades = 0x7000;
+
 	return Common::kNoError;
 }
 
@@ -323,10 +361,68 @@ Common::Error MortevielleEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-	// Dispatch to the game's main routine
-	mortevielle_main();
+	// Show the game introduction
+	showIntroduction();
+
+	adzon();
+	takesav(0);
+
+	mainGame();
 
 	return Common::kNoError;
 }
 
+/**
+ * Show the game introduction
+ */
+void MortevielleEngine::showIntroduction() {
+	aff50(false);
+	mlec = 0;
+	divers(142, false);
+	CHECK_QUIT;
+
+	ani50();
+	divers(143, true);
+	CHECK_QUIT;
+
+	suite();
+	music();
+}
+
+void MortevielleEngine::divers(int np, bool b) {
+	teskbd();
+	do {
+		parole(np, 0, 0);
+		atf3f8(key);
+		CHECK_QUIT;
+
+		if (newgd != gd) {
+			gd = newgd;
+			hirs();
+			aff50(b);
+		}
+	} while (!(key == 66));
+}
+
+/**
+ * Main game loop
+ */
+void MortevielleEngine::mainGame() {
+	if (rech_cfiec)  charge_cfiec();
+	for (crep = 1; crep <= c_zzz; crep ++) 
+		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	charge_bruit5();
+	init_menu();
+
+	theure();
+	dprog();
+	hirs();
+	dessine_rouleau();
+	show_mouse();
+	do {
+		tjouer();
+		CHECK_QUIT;
+	} while (!arret);
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 86ec947..863cbdb 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -63,6 +63,9 @@ private:
 	bool handleEvents();
 	void addKeypress(Common::Event &evt);
 	void initMouse();
+	void showIntroduction();
+	void mainGame();
+	void divers(int np, bool b);
 public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;


Commit: 394883a5c6516163480c3013e9a39e01f4475f7d
    https://github.com/scummvm/scummvm/commit/394883a5c6516163480c3013e9a39e01f4475f7d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:53-07:00

Commit Message:
MORTEVIELLE: Moved the game detection entries to detection_tables.h

Changed paths:
    engines/mortevielle/detection.cpp
    engines/mortevielle/detection_tables.h



diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 53d4292..ec0b016 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -35,39 +35,9 @@ static const PlainGameDescriptor MortevielleGame[] = {
 	{0, 0}
 };
 
-static const ADGameDescription MortevielleGameDescriptions[] = {
-	{
-		"mortevielle",
-		"",
-		{
-			{"menufr.mor", 0, "e413f36b9e14eef16130adc347a9391f", 144},
-			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
-			AD_LISTEND
-		},
-		Common::FR_FRA,
-		Common::kPlatformPC,
-		ADGF_NO_FLAGS,
-		GUIO0()
-	},
-	{
-		"mortevielle",
-		"",
-		{
-			{"menual.mor", 0, "792aea282b07a1d74c4a4abeabc90c19", 144},
-			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
-			AD_LISTEND
-		},
-		Common::DE_DEU,
-		Common::kPlatformPC,
-		ADGF_NO_FLAGS,
-		GUIO0()
-	},
-	AD_TABLE_END_MARKER
-};
-
 class MortevielleMetaEngine : public AdvancedMetaEngine {
 public:
-	MortevielleMetaEngine() : AdvancedMetaEngine(MortevielleGameDescriptions, sizeof(ADGameDescription), 
+	MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::MortevielleGameDescriptions, sizeof(ADGameDescription), 
 		MortevielleGame) {
 		_md5Bytes = 512;
 		_singleid = "mortevielle";
diff --git a/engines/mortevielle/detection_tables.h b/engines/mortevielle/detection_tables.h
index 4ea062b..7ceb40d 100644
--- a/engines/mortevielle/detection_tables.h
+++ b/engines/mortevielle/detection_tables.h
@@ -22,15 +22,32 @@
 
 namespace Mortevielle {
 
-static const ADGameDescription gameDescriptions[] = {
+static const ADGameDescription MortevielleGameDescriptions[] = {
 	{
 		"mortevielle",
 		"",
-		AD_ENTRY1s("mortvielle.txt", "d41d8cd98f00b204e9800998ecf8427e", 0),
+		{
+			{"menufr.mor", 0, "e413f36b9e14eef16130adc347a9391f", 144},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
 		Common::FR_FRA,
 		Common::kPlatformPC,
-		ADGF_UNSTABLE,
-		GUIO1(GUIO_NOASPECT)
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+	{
+		"mortevielle",
+		"",
+		{
+			{"menual.mor", 0, "792aea282b07a1d74c4a4abeabc90c19", 144},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
+		Common::DE_DEU,
+		Common::kPlatformPC,
+		ADGF_NO_FLAGS,
+		GUIO0()
 	},
 	AD_TABLE_END_MARKER
 };


Commit: 86582b5c79a9838857e8f42c1b7421016ccb4a9c
    https://github.com/scummvm/scummvm/commit/86582b5c79a9838857e8f42c1b7421016ccb4a9c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:55-07:00

Commit Message:
MORTEVIELLE: Implemented ScummVM savegame functionality with metadata

Changed paths:
  A engines/mortevielle/saveload.cpp
  A engines/mortevielle/saveload.h
  R engines/mortevielle/disk.cpp
  R engines/mortevielle/disk.h
    engines/mortevielle/detection.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/prog.h



diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index ec0b016..35e5cad 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -25,6 +25,7 @@
 
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/detection_tables.h"
+#include "mortevielle/saveload.h"
 
 namespace Mortevielle {
 uint32 MortevielleEngine::getGameFlags() const { return _gameDescription->flags; }
@@ -52,6 +53,9 @@ public:
 
 	virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
 	virtual bool hasFeature(MetaEngineFeature f) const;
+	virtual int getMaximumSaveSlot() const;
+	virtual SaveStateList listSaves(const char *target) const;
+	virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
 };
 
 bool MortevielleMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
@@ -62,9 +66,30 @@ bool MortevielleMetaEngine::createInstance(OSystem *syst, Engine **engine, const
 }
 
 bool MortevielleMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return false; 
+	switch (f) {
+	case kSupportsListSaves:
+	case kSupportsDeleteSave:
+	case kSupportsLoadingDuringStartup:
+	case kSavesSupportMetaInfo:
+	case kSavesSupportThumbnail:
+	case kSavesSupportCreationDate:
+		return true;
+	default:
+		return false;
+	}
+}
+
+int MortevielleMetaEngine::getMaximumSaveSlot() const { return 99; }
+
+SaveStateList MortevielleMetaEngine::listSaves(const char *target) const {
+	return Mortevielle::SavegameManager::listSaves(target);
 }
 
+SaveStateDescriptor MortevielleMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	return Mortevielle::SavegameManager::querySaveMetaInfos(slot);
+}
+
+
 #if PLUGIN_ENABLED_DYNAMIC(MORTEVIELLE)
 	REGISTER_PLUGIN_DYNAMIC(MORTEVIELLE, PLUGIN_TYPE_ENGINE, MortevielleMetaEngine);
 #else
diff --git a/engines/mortevielle/disk.cpp b/engines/mortevielle/disk.cpp
deleted file mode 100644
index 25bf7fa..0000000
--- a/engines/mortevielle/disk.cpp
+++ /dev/null
@@ -1,157 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/file.h"
-#include "common/system.h"
-#include "common/savefile.h"
-#include "common/serializer.h"
-#include "mortevielle/alert.h"
-#include "mortevielle/disk.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mor2.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/ovd1.h"
-#include "mortevielle/prog.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-/**
- * Ensure disk 1 data is available
- */
-void dem1() {
-/* Deprecated in ScummVM
-	int k;
-
-	// -- demande de disk 1 --           //Translation: Ask for disk #1
-	assign(f, "mort.005");
-	//*$i-*
-	k = ioresult;
-	reset(f);
-	while (ioresult != 0) {
-		show_mouse();
-		k = do_alert(al_mess, 1);
-		hide_mouse();
-		reset(f);
-	}
-	close(f);
-	*/
-}
-
-/**
- * Handle saving or loading savegame data
- */
-static void sync_save(Common::Serializer &sz) {
-	sz.syncAsSint16LE(s1.conf);
-	sz.syncBytes((byte *)&s1.pourc[0], 11);
-	sz.syncBytes((byte *)&s1.teauto[0], 43);
-	sz.syncBytes((byte *)&s1.sjer[0], 31);
-	sz.syncAsSint16LE(s1.mlieu);
-	sz.syncAsSint16LE(s1.iboul);
-	sz.syncAsSint16LE(s1.ibag);
-	sz.syncAsSint16LE(s1.icave);
-	sz.syncAsSint16LE(s1.ivier);
-	sz.syncAsSint16LE(s1.ipuit);
-	sz.syncAsSint16LE(s1.derobj);
-	sz.syncAsSint16LE(s1.iloic);
-	sz.syncAsSint16LE(s1.icryp);
-	sz.syncAsByte(s1.ipre);
-	sz.syncAsByte(s1.heure);
-
-	sz.syncBytes(bufcha, 391);
-}
-
-void takesav(int n) {
-	int i;
-	Common::String st;
-
-	dem1();
-	// -- Load the file  'sauve#n.mor'
-	Common::String saveName = Common::String::format("sav%d.mor", n);
-
-	// Try loading first from the save area
-	Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(saveName);
-
-	// If not present, try loading from the program folder
-	Common::File f;
-	if (stream == NULL) {
-		if (!f.open(saveName))
-			error("Unable to open save file '%s'", saveName);
-
-		stream = f.readStream(f.size());
-		f.close();
-	}
-
-	Common::Serializer sz(stream, NULL);
-	sync_save(sz);
-
-	s = s1;
-	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
-
-	// Close the stream
-	delete stream;	
-}
-
-void ld_game(int n) {
-	hide_mouse();
-	maivid();
-	takesav(n);
-	/* -- disquette 2 -- */                    //Translation: Floppy #2
-	dem2();
-	/* -- mises en place -- */                 //Translation: Initialization
-	theure();
-	dprog();
-	antegame();
-	show_mouse();
-}
-
-void sv_game(int n) {
-	Common::OutSaveFile *f;
-	int i;
-
-	hide_mouse();
-	tmaj3();
-	dem1();
-	/* -- sauvegarde du fichier 'sauve#n.mor' -- */               //Translation: save file 'sauve%d.mor'
-	for (i = 0; i <= 389; i ++) bufcha[i] = tabdon[i + acha];
-	s1 = s;
-	if (s1.mlieu == 26)  s1.mlieu = 15;
-	
-	Common::String saveName = Common::String::format("sav%d.mor", n);
-	f = g_system->getSavefileManager()->openForSaving(saveName);
-
-	Common::Serializer sz(NULL, f);
-	sync_save(sz);
-
-	f->finalize();
-	delete f;
-
-	dem2();
-	show_mouse();
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/disk.h b/engines/mortevielle/disk.h
deleted file mode 100644
index 06df8e0..0000000
--- a/engines/mortevielle/disk.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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_DISK_H
-#define MORTEVIELLE_DISK_H
-
-namespace Mortevielle {
-
-extern void dem1();
-extern void takesav(int n);
-extern void ld_game(int n);
-extern void sv_game(int n);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 2d16106..28c6c7f 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -6,7 +6,6 @@ MODULE_OBJS := \
 	asm.o \
 	boite.o \
 	detection.o \
-	disk.o \
 	droite.o \
 	graphics.o \
 	keyboard.o \
@@ -22,6 +21,7 @@ MODULE_OBJS := \
 	parole2.o \
 	prog.o \
 	ques.o \
+	saveload.o \
 	sound.o \
 	sprint.o \
 	taffich.o \
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 35d71c9..cbe2613 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/system.h"
+#include "common/config-manager.h"
 #include "common/debug-channels.h"
 #include "engines/util.h"
 #include "engines/engine.h"
@@ -28,16 +29,20 @@
 #include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
+#include "mortevielle/actions.h"
+#include "mortevielle/alert.h"
 #include "mortevielle/asm.h"
-#include "mortevielle/disk.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/ovd1.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/prog.h"
+#include "mortevielle/saveload.h"
+#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -50,15 +55,58 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	g_vm = this;
 	_lastGameFrame = 0;
 	_mouseClick = false;
+	_inMainGameLoop = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
 }
 
+/**
+ * Specifies whether the engine supports given features
+ */
 bool MortevielleEngine::hasFeature(EngineFeature f) const {
-	return false;
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsLoadingDuringRuntime) ||
+		(f == kSupportsSavingDuringRuntime);
+}
+
+/**
+ * Return true if a game can currently be loaded
+ */
+bool MortevielleEngine::canLoadGameStateCurrently() {
+	// Saving is only allowed in the main game event loop
+	return _inMainGameLoop;
 }
 
+/**
+ * Return true if a game can currently be saved
+ */
+bool MortevielleEngine::canSaveGameStateCurrently() {
+	// Loading is only allowed in the main game event loop
+	return _inMainGameLoop;
+}
+
+/**
+ * Load in a savegame at the specified slot number
+ */
+Common::Error MortevielleEngine::loadGameState(int slot) {
+	return _savegameManager.loadGame(slot);	
+}
+
+/**
+ * Save the current game
+ */
+Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &desc) {
+	if (slot == 0)
+		return Common::kWritingFailed;
+	
+	return _savegameManager.saveGame(slot, desc);
+}
+
+/**
+ * Initialise the game state
+ */
 Common::ErrorCode MortevielleEngine::initialise() {
 	// Initialise graphics mode
 	initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true);
@@ -361,12 +409,23 @@ Common::Error MortevielleEngine::run() {
 	if (err != Common::kNoError)
 		return err;
 
-	// Show the game introduction
-	showIntroduction();
+	// Check for a savegame
+	int loadSlot = 0;
+	if (ConfMan.hasKey("save_slot")) {
+		int gameToLoad = ConfMan.getInt("save_slot");
+		if (gameToLoad >= 1 && gameToLoad <= 999)
+			loadSlot = gameToLoad;
+	}
+
+	if (loadSlot == 0)
+		// Show the game introduction
+		showIntroduction();
 
+	// Either load the initial game state savegame, or the specified savegame number
 	adzon();
-	takesav(0);
+	_savegameManager.takesav(loadSlot);
 
+	// Run the main game loop
 	mainGame();
 
 	return Common::kNoError;
@@ -425,4 +484,116 @@ void MortevielleEngine::mainGame() {
 	} while (!arret);
 }
 
+/**
+ * This method handles repeatedly calling a sub-method to wait for a user action and then handling it
+ */
+void MortevielleEngine::tjouer() {
+	antegame();
+	do {
+		tecran();
+		CHECK_QUIT;
+	} while (!((arret) || (solu) || (perdu)));
+	if (solu)
+		tmaj1();
+	else if (perdu)
+		tencore();
+}
+
+/**
+ * Waits for the user to select an action, and then handles it
+ */
+void MortevielleEngine::tecran() {
+	const char idem[] = "Idem";
+	const int lim = 20000;
+	int temps = 0;
+	char inkey = '\0';
+	bool oo, funct = 0;
+
+	clsf3();
+	oo = false;
+	ctrm = 0;
+	if (! iesc) {
+		draw_menu();
+		imen = true;
+		temps = 0;
+		key = 0;
+		funct = false;
+		inkey = '.';
+
+		_inMainGameLoop = true;
+		do {
+			mdn();
+			tinke();
+			mov_mouse(funct, inkey);
+			CHECK_QUIT;
+			temps = temps + 1;
+		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
+		_inMainGameLoop = false;
+
+		erase_menu();
+		imen = false;
+		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
+			change_gd((uint)pred(int, ord(inkey)) >> 1);
+			return;
+		}
+		if (choisi && (msg[3] == sauve)) {
+			Common::String saveName = Common::String::format("Savegame #%d", msg[4] & 7);
+			g_vm->_savegameManager.saveGame(msg[4] & 7, saveName);
+		}
+		if (choisi && (msg[3] == charge))
+			g_vm->_savegameManager.loadGame((msg[4] & 7) - 1);
+		if (inkey == '\103') {       /* F9 */
+			temps = do_alert(stpou, 1);
+			return;
+		} else if (inkey == '\77') {
+			if ((mnumo != no_choice) && ((msg[3] == action) || (msg[3] == saction))) {
+				msg[4] = mnumo;
+				ecr3(idem);
+			} else return;
+		} else if (inkey == '\104') {
+			if ((x != 0) && (y != 0))  num = 9999;
+			return;
+		}
+	}
+	if (inkey == '\73') {
+		arret = true;
+		tmaj3();
+	} else {
+		if ((funct) && (inkey != '\77'))  return;
+		if (temps > lim) {
+			repon(2, 141);
+			if (num == 9999)  num = 0;
+		} else {
+			mnumo = msg[3];
+			if ((msg[3] == action) || (msg[3] == saction))  mnumo = msg[4];
+			if (! anyone) {
+				if ((fouil) || (obpart)) {
+					if (y_s < 12)  return;
+					if ((msg[4] == sonder) || (msg[4] == soulever)) {
+						oo = true;
+						if ((msg[4] == soulever) || (obpart)) {
+							finfouil();
+							caff = s.mlieu;
+							crep = 998;
+						} else tsuiv();
+						mennor();
+					}
+				}
+			}
+			do {
+				if (! oo)  tsitu();
+				if ((ctrm == 0) && (! perdu) && (! solu)) {
+					taffich();
+					if (okdes) {
+						okdes = false;
+						dessin(0);
+					}
+					if ((! syn) || (col))  repon(2, crep);
+				}
+			} while (!(! syn));
+			if (ctrm != 0)  tctrm();
+		}
+	}
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 863cbdb..6dad5a0 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -33,6 +33,7 @@
 #include "common/error.h"
 #include "graphics/surface.h"
 #include "mortevielle/graphics.h"
+#include "mortevielle/saveload.h"
 #include "mortevielle/sound.h"
 
 namespace Mortevielle {
@@ -56,6 +57,7 @@ private:
 	uint32 _lastGameFrame;
 	bool _mouseClick;
 	Common::Point _mousePos;
+	bool _inMainGameLoop;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
@@ -65,6 +67,8 @@ private:
 	void initMouse();
 	void showIntroduction();
 	void mainGame();
+	void tjouer();
+	void tecran();
 	void divers(int np, bool b);
 public:
 	ScreenSurface _screenSurface;
@@ -72,10 +76,15 @@ public:
 	GfxSurface _backgroundSurface;
 	Common::RandomSource _randomSource;
 	SoundManager _soundManager;
+	SavegameManager _savegameManager;
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
 	virtual bool hasFeature(EngineFeature f) const;
+	virtual bool canLoadGameStateCurrently();
+	virtual bool canSaveGameStateCurrently();
+	virtual Common::Error loadGameState(int slot);
+	virtual Common::Error saveGameState(int slot, const Common::String &desc);
 	virtual Common::Error run();
 	uint32 getGameFlags() const;
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 5f2fd3c..ba2c4de 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -219,100 +219,6 @@ L2:
 	mennor();
 }
 
-void sv_game(int n);
-
-void ld_game(int n);
-
-void tecran() {
-	const char idem[] = "Idem";
-	const int lim = 20000;
-	int temps = 0;
-	char inkey = '\0';
-	bool oo, funct = 0;
-
-	clsf3();
-	oo = false;
-	ctrm = 0;
-	if (! iesc) {
-		draw_menu();
-		imen = true;
-		temps = 0;
-		key = 0;
-		funct = false;
-		inkey = '.';
-
-		do {
-			mdn();
-			tinke();
-			mov_mouse(funct, inkey);
-			CHECK_QUIT;
-			temps = temps + 1;
-		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
-
-		erase_menu();
-		imen = false;
-		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			change_gd((uint)pred(int, ord(inkey)) >> 1);
-			return;
-		}
-		if (choisi && (msg[3] == sauve))
-			sv_game(msg[4] & 7);
-		if (choisi && (msg[3] == charge))
-			ld_game((msg[4] & 7) - 1);
-		if (inkey == '\103') {       /* F9 */
-			temps = do_alert(stpou, 1);
-			return;
-		} else if (inkey == '\77') {
-			if ((mnumo != no_choice) && ((msg[3] == action) || (msg[3] == saction))) {
-				msg[4] = mnumo;
-				ecr3(idem);
-			} else return;
-		} else if (inkey == '\104') {
-			if ((x != 0) && (y != 0))  num = 9999;
-			return;
-		}
-	}
-	if (inkey == '\73') {
-		arret = true;
-		tmaj3();
-	} else {
-		if ((funct) && (inkey != '\77'))  return;
-		if (temps > lim) {
-			repon(2, 141);
-			if (num == 9999)  num = 0;
-		} else {
-			mnumo = msg[3];
-			if ((msg[3] == action) || (msg[3] == saction))  mnumo = msg[4];
-			if (! anyone) {
-				if ((fouil) || (obpart)) {
-					if (y_s < 12)  return;
-					if ((msg[4] == sonder) || (msg[4] == soulever)) {
-						oo = true;
-						if ((msg[4] == soulever) || (obpart)) {
-							finfouil();
-							caff = s.mlieu;
-							crep = 998;
-						} else tsuiv();
-						mennor();
-					}
-				}
-			}
-			do {
-				if (! oo)  tsitu();
-				if ((ctrm == 0) && (! perdu) && (! solu)) {
-					taffich();
-					if (okdes) {
-						okdes = false;
-						dessin(0);
-					}
-					if ((! syn) || (col))  repon(2, crep);
-				}
-			} while (!(! syn));
-			if (ctrm != 0)  tctrm();
-		}
-	}
-}
-
 /* NIVEAU 1 */
 
 void theure() {
@@ -326,15 +232,4 @@ void theure() {
 	else min = 0;
 }
 
-
-void tjouer() {
-	antegame();
-	do {
-		tecran();
-		CHECK_QUIT;
-	} while (!((arret) || (solu) || (perdu)));
-	if (solu)  tmaj1();
-	else if (perdu)  tencore();
-}
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
index fbcd92f..f51b221 100644
--- a/engines/mortevielle/prog.h
+++ b/engines/mortevielle/prog.h
@@ -37,11 +37,9 @@ extern void antegame();
 /* procedure PROGRAMME */
 extern void tmaj3();
 extern void tsitu();
-extern void tecran();
 
 /* NIVEAU 1 */
 extern void theure();
-extern void tjouer();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
new file mode 100644
index 0000000..d0cd603
--- /dev/null
+++ b/engines/mortevielle/saveload.cpp
@@ -0,0 +1,318 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "common/file.h"
+#include "common/system.h"
+#include "mortevielle/alert.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mor2.h"
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/ovd1.h"
+#include "mortevielle/prog.h"
+#include "mortevielle/saveload.h"
+#include "mortevielle/var_mor.h"
+
+namespace Mortevielle {
+
+static const char SAVEGAME_ID[4] = { 'M', 'O', 'R', 'T' };
+
+Common::String SavegameManager::generateSaveName(int slotNumber) {
+	return Common::String::format("sav%d.mor", slotNumber);
+}
+
+/**
+ * Handle saving or loading savegame data
+ */
+void SavegameManager::sync_save(Common::Serializer &sz) {
+	sz.syncAsSint16LE(s1.conf);
+	sz.syncBytes((byte *)&s1.pourc[0], 11);
+	sz.syncBytes((byte *)&s1.teauto[0], 43);
+	sz.syncBytes((byte *)&s1.sjer[0], 31);
+	sz.syncAsSint16LE(s1.mlieu);
+	sz.syncAsSint16LE(s1.iboul);
+	sz.syncAsSint16LE(s1.ibag);
+	sz.syncAsSint16LE(s1.icave);
+	sz.syncAsSint16LE(s1.ivier);
+	sz.syncAsSint16LE(s1.ipuit);
+	sz.syncAsSint16LE(s1.derobj);
+	sz.syncAsSint16LE(s1.iloic);
+	sz.syncAsSint16LE(s1.icryp);
+	sz.syncAsByte(s1.ipre);
+	sz.syncAsByte(s1.heure);
+
+	sz.syncBytes(bufcha, 391);
+}
+
+/**
+ * Inner code for loading a saved game
+ */
+void SavegameManager::takesav(int n) {
+	int i;
+	Common::String st;
+
+	// -- Load the file
+	Common::String filename = generateSaveName(n);
+
+	// Try loading first from the save area
+	Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(filename);
+
+	// If not present, try loading from the program folder
+	Common::File f;
+	if (stream == NULL) {
+		if (!f.open(filename))
+			error("Unable to open save file '%s'", filename);
+
+		stream = f.readStream(f.size());
+		f.close();
+	}
+
+	// Check whether it's a ScummVM saved game
+	char buffer[4];
+	stream->read(buffer, 4);
+	if (!strncmp(&buffer[0], &SAVEGAME_ID[0], 4)) {
+		// Yes, it is, so skip over the savegame header
+		SavegameHeader header;
+		readSavegameHeader(stream, header);
+		delete header.thumbnail;
+	} else {
+		stream->seek(0);
+	}
+
+	// Read the game contents
+	Common::Serializer sz(stream, NULL);
+	sync_save(sz);
+
+	s = s1;
+	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
+
+	// Close the stream
+	delete stream;	
+}
+
+/**
+ * Load a saved game
+ */
+Common::Error SavegameManager::loadGame(int n) {
+	hide_mouse();
+	maivid();
+	takesav(n);
+	
+	/* Initialization */
+	theure();
+	dprog();
+	antegame();
+	show_mouse();
+	return Common::kNoError;
+}
+
+/**
+ * Save the game
+ */
+Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
+	Common::OutSaveFile *f;
+	int i;
+
+	hide_mouse();
+	tmaj3();
+	
+	for (i = 0; i <= 389; i ++)
+		bufcha[i] = tabdon[i + acha];
+	s1 = s;
+	if (s1.mlieu == 26)
+		s1.mlieu = 15;
+	
+	Common::String filename = generateSaveName(n);
+	f = g_system->getSavefileManager()->openForSaving(filename);
+
+	// Write out the savegame header
+	f->write(&SAVEGAME_ID[0], 4);
+
+	// Write out the header
+	SavegameHeader header;
+	writeSavegameHeader(f, saveName);
+
+	// Write out the savegame contents
+	Common::Serializer sz(NULL, f);
+	sync_save(sz);
+
+	// Close the save file
+	f->finalize();
+	delete f;
+
+	dem2();
+	show_mouse();
+	return Common::kNoError;
+}
+
+void SavegameManager::writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
+	// Write out a savegame header
+	out->writeByte(SAVEGAME_VERSION);
+
+	// Write savegame name
+	out->writeString(saveName);
+	out->writeByte(0);
+
+	// Get the active palette
+	uint8 thumbPalette[256 * 3];
+	g_system->getPaletteManager()->grabPalette(thumbPalette, 0, 256);
+
+	// Create a thumbnail and save it
+	Graphics::Surface *thumb = new Graphics::Surface();
+	Graphics::Surface s = g_vm->_screenSurface.lockArea(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+
+	::createThumbnail(thumb, (const byte *)s.pixels, SCREEN_WIDTH, SCREEN_HEIGHT, thumbPalette);
+	Graphics::saveThumbnail(*out, *thumb);
+	thumb->free();
+	delete thumb;
+
+	// Write out the save date/time
+	TimeDate td;
+	g_system->getTimeAndDate(td);
+	out->writeSint16LE(td.tm_year + 1900);
+	out->writeSint16LE(td.tm_mon + 1);
+	out->writeSint16LE(td.tm_mday);
+	out->writeSint16LE(td.tm_hour);
+	out->writeSint16LE(td.tm_min);
+}
+
+bool SavegameManager::readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header) {
+	header.thumbnail = NULL;
+
+	// Get the savegame version
+	header.version = in->readByte();
+
+	// Read in the save name
+	header.saveName.clear();
+	char ch;
+	while ((ch = (char)in->readByte()) != '\0')
+		header.saveName += ch;
+
+	// Get the thumbnail
+	header.thumbnail = Graphics::loadThumbnail(*in);
+	if (!header.thumbnail)
+		return false;
+
+	// Read in save date/time
+	header.saveYear = in->readSint16LE();
+	header.saveMonth = in->readSint16LE();
+	header.saveDay = in->readSint16LE();
+	header.saveHour = in->readSint16LE();
+	header.saveMinutes = in->readSint16LE();
+
+	return true;
+}
+
+SaveStateList SavegameManager::listSaves(const char *target) {
+	Common::String pattern = "sav*.mor";
+	Common::StringArray files = g_system->getSavefileManager()->listSavefiles(pattern);
+	sort(files.begin(), files.end());	// Sort (hopefully ensuring we are sorted numerically..)
+
+	SaveStateList saveList;
+	for (Common::StringArray::const_iterator file = files.begin(); file != files.end(); ++file) {
+		// Obtain the last 3 digits of the filename, since they correspond to the save slot
+		const Common::String &fname = *file;
+		int slotNumber = atoi(fname.c_str() + 3);
+
+		Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname);
+		if (in) {
+			// There can be two types of savegames: original interpreter savegames, and ScummVM savegames.
+			// Original interpreter savegames are 497 bytes, and still need to be supported because the
+			// initial game state is stored as a savegame
+			bool validFlag = false;
+			Common::String saveDescription;
+
+			char buffer[4];
+			in->read(buffer, 4);
+			if (!strncmp(&buffer[0], &SAVEGAME_ID[0], 4)) {
+				// ScummVm savegame. Read in the header to get the savegame name
+				SavegameHeader header;
+				validFlag = readSavegameHeader(in, header);
+				
+				if (validFlag) {
+					delete header.thumbnail;
+					saveDescription = header.saveName;
+				}
+			} else if (file->size() == 497) {
+				// Form an appropriate savegame name
+				saveDescription = (slotNumber == 0) ? "Initial game state" : 
+					Common::String::format("Savegame #%d", slotNumber);
+				validFlag = true;
+			}
+				
+			if (validFlag)
+				// Got a valid savegame
+				saveList.push_back(SaveStateDescriptor(slotNumber, saveDescription));
+
+			delete in;
+		}
+	}
+
+	return saveList;
+}
+
+SaveStateDescriptor SavegameManager::querySaveMetaInfos(int slot) {
+	Common::String fileName = Mortevielle::SavegameManager::generateSaveName(slot);
+	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
+	
+	if (f) {
+		// Check to see if it's a ScummVM savegame or not
+		char buffer[4];
+		f->read(buffer, 4);
+
+		bool hasHeader = !strncmp(&buffer[0], &SAVEGAME_ID[0], 4);
+
+		if (!hasHeader) {
+			// Original savegame perhaps?
+			delete f;
+
+			SaveStateDescriptor desc(slot, Common::String::format("Savegame #%d", slot));
+			desc.setDeletableFlag(slot != 0);
+			desc.setWriteProtectedFlag(slot == 0);
+			return desc;
+		} else {
+			// Get the savegame header information
+			SavegameHeader header;
+			readSavegameHeader(f, header);
+			delete f;
+
+			// Create the return descriptor
+			SaveStateDescriptor desc(slot, header.saveName);
+			desc.setDeletableFlag(true);
+			desc.setWriteProtectedFlag(false);
+			desc.setThumbnail(header.thumbnail);
+			desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay);
+			desc.setSaveTime(header.saveHour, header.saveMinutes);
+
+			return desc;
+		}
+	}
+	
+	return SaveStateDescriptor();
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
new file mode 100644
index 0000000..7f2edd8
--- /dev/null
+++ b/engines/mortevielle/saveload.h
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_SAVELOAD_H
+#define MORTEVIELLE_SAVELOAD_H
+
+#include "common/savefile.h"
+#include "common/serializer.h"
+#include "graphics/palette.h"
+#include "graphics/scaler.h"
+#include "graphics/thumbnail.h"
+
+#define SAVEGAME_VERSION 1
+
+namespace Mortevielle {
+
+struct SavegameHeader {
+	uint8 version;
+	Common::String saveName;
+	Graphics::Surface *thumbnail;
+	int saveYear, saveMonth, saveDay;
+	int saveHour, saveMinutes;
+	int totalFrames;
+};
+
+class SavegameManager {
+private:
+	void sync_save(Common::Serializer &sz);
+public:
+	void takesav(int n);
+	Common::Error loadGame(int n);
+	Common::Error saveGame(int n, const Common::String &saveName);
+
+	static void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
+	static bool readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header);
+	static Common::String generateSaveName(int slotNumber);
+	static SaveStateList listSaves(const char *target);
+	static SaveStateDescriptor querySaveMetaInfos(int slot);
+};
+
+} // End of namespace Mortevielle
+#endif


Commit: 3056ea9668241962d45827e2a3411a945906ffdb
    https://github.com/scummvm/scummvm/commit/3056ea9668241962d45827e2a3411a945906ffdb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:56-07:00

Commit Message:
MORTEVIELLE: Renamed main loop methods, along with quit/end/lose variables

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/actions.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/prog.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 7e51433..fe0e8f4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -602,7 +602,8 @@ L2:
 			repon(2, 167);
 			parole(7, 9, 1);
 			quel = do_alert(stouinon, 1);
-			if (quel == 1)  solu = true;
+			if (quel == 1)
+				g_vm->_endGame = true;
 			else crep = 168;
 		}
 		if ((s.mlieu == 17) && (s.ivier == 143)) {
@@ -1186,9 +1187,12 @@ L2:
 	num = 0;
 }
 
-/* NIVEAU 2 */
-/* overlay */ void tmaj1() {           /* Le jeu est termin‚ !!! */   //Translation: The game is over!!!
-	arret = true;
+/**
+ * The game is over
+ * @remarks	Originally called 'tmaj1'
+ */
+void MortevielleEngine::endGame() {
+	_quitGame = true;
 	tlu(13, 152);
 	maivid();
 	clsf1();
@@ -1218,7 +1222,11 @@ L2:
 	inzon();
 }
 
-/* overlay */ void tencore() {         /* Perdu !!! */         //Translation: You lost!
+/**
+ * You lost!
+ * @remarks	Originally called 'tencore'
+ */
+void MortevielleEngine::loseGame() {
 	int quel;
 
 	clsf2();
@@ -1235,7 +1243,7 @@ L2:
 	jou = 0;
 	repon(2, 180);
 	quel = do_alert(stouinon, 1);
-	arret = (quel != 1);
+	_quitGame = (quel != 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index 904a58d..196e5a5 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -61,8 +61,8 @@ extern void tparler();
 extern void tsentir();
 extern void tgratter();
 /* NIVEAU 2 */
-extern void tmaj1();
-extern void tencore();
+extern void endGame();
+extern void loseGame();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 10fe6e9..c71c850 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -290,8 +290,9 @@ void tperd() {
 	iouv = 0;
 	mchai = 0;
 	mfouen();
-	if (! blo)  t11(21, cx);
-	perdu = true;
+	if (!blo)
+		t11(21, cx);
+	g_vm->_loseGame = true;
 	clsf1();
 	boite(60, 35, 400, 50, 15);
 	repon(9, crep);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index cbe2613..eed4b51 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -56,6 +56,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_lastGameFrame = 0;
 	_mouseClick = false;
 	_inMainGameLoop = false;
+	_quitGame = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -150,7 +151,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	init_mouse();
 
 	init_lieu();
-	arret = false;
 	sonoff = false;
 	f2_all = false;
 	textcolor(9);
@@ -464,7 +464,8 @@ void MortevielleEngine::divers(int np, bool b) {
 }
 
 /**
- * Main game loop
+ * Main game loop. Handles potentially playing the game multiple times, such as if the player
+ * loses, and chooses to start playing the game again.
  */
 void MortevielleEngine::mainGame() {
 	if (rech_cfiec)  charge_cfiec();
@@ -478,31 +479,37 @@ void MortevielleEngine::mainGame() {
 	hirs();
 	dessine_rouleau();
 	show_mouse();
+
+	// Loop to play the game
 	do {
-		tjouer();
+		playGame();
 		CHECK_QUIT;
-	} while (!arret);
+	} while (!_quitGame);
 }
 
 /**
- * This method handles repeatedly calling a sub-method to wait for a user action and then handling it
+ * This method handles playing a loaded game
+ * @remarks	Originally called tojouer
  */
-void MortevielleEngine::tjouer() {
-	antegame();
+void MortevielleEngine::playGame() {
+	gameLoaded();
+
+	// Loop handling actions until the game has to be quit, or show the lose or end sequence
 	do {
-		tecran();
+		handleAction();
 		CHECK_QUIT;
-	} while (!((arret) || (solu) || (perdu)));
-	if (solu)
-		tmaj1();
-	else if (perdu)
-		tencore();
+	} while (!((_quitGame) || (_endGame) || (_loseGame)));
+	if (_endGame)
+		endGame();
+	else if (_loseGame)
+		loseGame();
 }
 
 /**
  * Waits for the user to select an action, and then handles it
+ * @remarks	Originally called tecran
  */
-void MortevielleEngine::tecran() {
+void MortevielleEngine::handleAction() {
 	const char idem[] = "Idem";
 	const int lim = 20000;
 	int temps = 0;
@@ -556,7 +563,7 @@ void MortevielleEngine::tecran() {
 		}
 	}
 	if (inkey == '\73') {
-		arret = true;
+		_quitGame = true;
 		tmaj3();
 	} else {
 		if ((funct) && (inkey != '\77'))  return;
@@ -582,7 +589,7 @@ void MortevielleEngine::tecran() {
 			}
 			do {
 				if (! oo)  tsitu();
-				if ((ctrm == 0) && (! perdu) && (! solu)) {
+				if ((ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
 					if (okdes) {
 						okdes = false;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6dad5a0..9ca8258 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -57,7 +57,7 @@ private:
 	uint32 _lastGameFrame;
 	bool _mouseClick;
 	Common::Point _mousePos;
-	bool _inMainGameLoop;
+	bool _inMainGameLoop;	// Flag when the main game loop is active
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
@@ -67,8 +67,8 @@ private:
 	void initMouse();
 	void showIntroduction();
 	void mainGame();
-	void tjouer();
-	void tecran();
+	void playGame();
+	void handleAction();
 	void divers(int np, bool b);
 public:
 	ScreenSurface _screenSurface;
@@ -77,6 +77,10 @@ public:
 	Common::RandomSource _randomSource;
 	SoundManager _soundManager;
 	SavegameManager _savegameManager;
+
+	bool _quitGame;			// Quit game flag. Originally called 'arret'
+	bool _endGame;			// End game flag. Originally called 'solu'
+	bool _loseGame;			// Lose game flag. Originally called 'perdu'
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
@@ -95,6 +99,10 @@ public:
 	bool getMouseClick() const { return _mouseClick; }
 	void setMouseClick(bool v) { _mouseClick = v; }
 	void delay(int amount);
+
+	void endGame();
+	void loseGame();
+	void gameLoaded();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index ba2c4de..9d8b8f9 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -57,7 +57,11 @@ namespace Mortevielle {
 	menu_aff();
 }
 
-/* overlay */ void antegame() {
+/**
+ * Called when a savegame has been loaded.
+ * @remarks	Originally called 'antegame'
+ */
+void MortevielleEngine::gameLoaded() {
 	int k;
 	bool test[3];
 	char g[8];
@@ -66,7 +70,7 @@ namespace Mortevielle {
 	hide_mouse();
 	imen = false;
 	g[1] = 'M';
-	perdu = true;
+	_loseGame = true;
 	anyone = false;
 	okdes = true;
 	test[0] = false;
@@ -112,8 +116,8 @@ namespace Mortevielle {
 		test[k] = true;
 
 		okdes = false;
-		solu = true;
-		perdu = false;
+		_endGame = true;
+		_loseGame = false;
 		fouil = false;
 	}
 	person();
@@ -122,7 +126,7 @@ namespace Mortevielle {
 	afdes(0);
 	repon(2, crep);
 	clsf3();
-	solu = false;
+	_endGame = false;
 	tmlieu(s.mlieu);
 	modinv();
 	if (s.derobj != 0)  modobj2(s.derobj + 400, test[1], test[2]);
@@ -201,7 +205,7 @@ L1:
 	if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) ||
 	        ((h > 0) && (h < 6) && (s.mlieu != 0)))  s.conf = s.conf + 1;
 	if (((s.mlieu < 16) || (s.mlieu > 19)) && (s.mlieu != 23)
-	        && (s.mlieu != 0) && (s.derobj != 152) && (! perdu)) {
+	        && (s.mlieu != 0) && (s.derobj != 152) && (!g_vm->_loseGame)) {
 		if ((s.conf > 99) && (h > 8) && (h < 16)) {
 			crep = 1501;
 			tperd();
@@ -210,7 +214,7 @@ L1:
 			crep = 1508;
 			tperd();
 		}
-		if ((j > 1) && (h > 8) && (! perdu)) {
+		if ((j > 1) && (h > 8) && (!g_vm->_loseGame)) {
 			crep = 1502;
 			tperd();
 		}
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
index f51b221..e88b943 100644
--- a/engines/mortevielle/prog.h
+++ b/engines/mortevielle/prog.h
@@ -31,7 +31,6 @@
 namespace Mortevielle {
 
 extern void change_gd(int ngd);
-extern void antegame();
 
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index d0cd603..4f37c28 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -125,7 +125,7 @@ Common::Error SavegameManager::loadGame(int n) {
 	/* Initialization */
 	theure();
 	dprog();
-	antegame();
+	g_vm->gameLoaded();
 	show_mouse();
 	return Common::kNoError;
 }
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index bd43212..5ace061 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -112,7 +112,6 @@ bool blo,
         imen,
         cache,
         iesc,
-        perdu,
         col,
         syn,
         fouil,
@@ -120,7 +119,6 @@ bool blo,
         tesok,
         obpart,
         okdes,
-        solu,
         arret,
         anyone,
         brt,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5d62e77..eea8994 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -281,7 +281,6 @@ extern bool blo,
         imen,
         cache,
         iesc,
-        perdu,
         col,
         syn,
         fouil,
@@ -289,8 +288,6 @@ extern bool blo,
         tesok,
         obpart,
         okdes,
-        solu,
-        arret,
         anyone,
         brt,
         rect,


Commit: af8933892da642d4cb2dde957fe1c2a3c45631ef
    https://github.com/scummvm/scummvm/commit/af8933892da642d4cb2dde957fe1c2a3c45631ef
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:57-07:00

Commit Message:
MORTEVIELLE: Added list of static executable strings to create_mortdat tool

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index aa7da01..773ddae 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -91,6 +91,9 @@ public:
 		uint32 vTemp = TO_LE_32(v);
 		write(&vTemp, sizeof(uint32));
 	}
+	void writeString(const char *s) {
+		write(s, strlen(s) + 1);
+	}
 	uint32 pos() {
 		return ftell(f);
 	}
@@ -112,7 +115,10 @@ void openOutputFile(const char *outFilename) {
 	outputFile.writeByte(VERSION_MINOR);
 }
 
-void process() {
+/**
+ * Write out the data for the font 
+ */
+void writeFontBlock() {
 	byte checkBuffer[7];
 	byte fontBuffer[121 * 6];
 
@@ -138,6 +144,162 @@ void process() {
 	outputFile.write(fontBuffer, 121 * 6);
 }
 
+void writeStaticStrings(const char **strings, int languageId) {
+	// Write out a section header 
+	char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
+	outputFile.write(sStaticStrings, 4);
+
+	// Figure out the block size
+	int blockSize = 1;
+	const char **s = &strings[0];
+	while (*s) {
+		blockSize += strlen(*s) + 1;
+		++s;
+	}
+
+	outputFile.writeWord(blockSize);
+
+	// Write out a byte indicating the language for this block
+	outputFile.writeByte(languageId);
+
+	// Write out each of the strings
+	s = &strings[0];
+	while (*s) {
+		outputFile.writeString(*s);
+		++s;
+	}
+}
+
+/**
+ * Write out the French strings previously hard-coded into the application
+ */
+void writeEnglishStaticStrings() {
+	const char *string_list[] =  {
+		"[2][ ][YES][NO]",
+		"Go to",
+		"Someone enters, looks surised, but says nothing",
+		"Cool",
+		" Lourde ",
+		"Malsaine",
+		"Idem",
+		"You",
+		"are",
+		"Alone",
+
+		"Gosh! You hear some noise...",
+		" | You should have noticed,   |       ",
+		"% of hints...",
+		"Do you want to wake up?",
+		"OK",
+		"", 
+		" Save",
+
+		" Load",
+		" Restart     ",
+		"F3: More",
+		"F8: Restart",
+		"Hide self",
+		"take",
+		" probe    ",
+		" raise    ",
+		" -SUITE- ",
+		" -STOP-  ",
+		"[1] [So, use the DEP menu] [Ok]",
+		"lift",
+		"read",
+
+		"look",
+		"search",
+		"open",
+		"put",
+		"turn",
+		"tie",
+		"close",
+		"hit",
+		"pose",
+		"smash",
+
+		"smell",
+		"scratch",
+		"probe",
+		"[1] [ | Before, use the DEP menu...] [Ok]",
+		"& day",
+		NULL
+	};
+
+	writeStaticStrings(string_list, 1);
+}
+
+/**
+ * Write out the French strings previously hard-coded into the application
+ */
+void writeFrenchStaticStrings() {
+	const char *string_list[] = {
+		"[2][ ][OUI][NON]",
+		"aller",
+		"quelqu'un entre, parait ‚tonn‚ mais ne dit rien",
+		"Cool",
+		" Lourde ",
+		"Malsaine",
+		"Idem",
+		"Vous",
+		"ˆtes",
+		"SEUL",
+
+		"Mince! Vous entendez du bruit...",
+		" | Vous devriez avoir remarqu‚|       ",
+		"% des indices...",
+		"D‚sirez-vous vous r‚veiller?",
+		"OK",
+		"", 
+		" Sauvegarde",
+
+		" Chargement",
+		" Recommence  ",
+		"F3: Encore",
+		"F8: Suite",
+		"se cacher",
+
+		"prendre",
+		" sonder   ",
+		"soulever",
+		" -SUITE- ",
+		" -STOP-  ",
+		"[1][Alors, utilisez le menu DEP...][ok]",
+		"soulever",
+		"lire",
+
+		"regarder",
+		"fouiller",
+		"ouvrir",
+		"mettre",
+		"tourner",
+		"attacher",
+		"fermer",
+		"frapper",
+		"poser",
+		"d‚foncer",
+
+		"sentir",
+		"gratter",
+		"sonder",
+		"[1][ | Avant, utilisez le menu DEP...][ok]",
+		"& jour",
+		NULL
+	};
+
+	writeStaticStrings(string_list, 0);
+}
+
+void process() {
+	writeFontBlock();
+	writeEnglishStaticStrings();
+	writeFrenchStaticStrings();
+}
+
+/**
+ * Main method
+ */
 int main(int argc, char *argv[]) {
 	if (argc != 3) {
 		printf("Format: input_filename output_filename\n", argv[0]);
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index ebfb8a8..8e0171f 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: ba3aedaeac16a56384ef05ea4f345a57e09b63ff
    https://github.com/scummvm/scummvm/commit/ba3aedaeac16a56384ef05ea4f345a57e09b63ff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:20:59-07:00

Commit Message:
MORTEVIELLE: Added support for using the static string list added to mort.dat

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/detection.cpp
    engines/mortevielle/detection_tables.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index fe0e8f4..cd3a7b0 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,9 +42,6 @@
 
 namespace Mortevielle {
 
-/* NIVEAU 4 */
-const char stouinon[] = "[2][ ][OUI][NON]";   //Translation: [2] [ ] [YES] [NO]
-
 /* overlay */
 void taller() {
 	//int mx, cx, cy;
@@ -57,7 +54,8 @@ void taller() {
 		repon(2, s.mlieu);
 	}
 	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
-		if (! syn)  ecr3("aller");                //Translation: Go to
+		if (!syn)
+			ecr3(g_vm->getString(S_GO_TO));
 		tfleche();
 		if (iesc)  okdes = false;
 		if ((anyone) || (iesc))  return;
@@ -170,7 +168,8 @@ L2:
 		}
 		return;
 	}
-	if (! syn)  ecr3("prendre");                 //Translation: Take
+	if (!syn)
+		ecr3(g_vm->getString(S_TAKE));
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	if (caff == 3) {
@@ -257,7 +256,8 @@ L2:
 {
 	int cx;
 
-	if (! syn)  ecr3("soulever");                //Translation: Lift
+	if (!syn)
+		ecr3(g_vm->getString(S_LIFT));
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(3);
@@ -283,11 +283,13 @@ L2:
 
 	if (caff > 99)  st4(caff);
 	else {
-		if (! syn)  ecr3("lire");                //Translation: Read
+		if (!syn)
+			ecr3(g_vm->getString(S_READ));
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(4);
-			if (num != 0)  crep = 107;
+			if (num != 0)
+				crep = 107;
 		}
 	}
 }
@@ -304,7 +306,8 @@ L2:
 		crep = 103;
 		return;
 	}
-	if (! syn)  ecr3("regarder");            //Translation: Look
+	if (!syn)
+		ecr3(g_vm->getString(S_LOOK));
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(5);
@@ -365,7 +368,8 @@ L2:
 		st7(caff);
 		return;
 	}
-	if (! syn)  ecr3("fouiller");            //Translation: Search
+	if (!syn)
+		ecr3(g_vm->getString(S_SEARCH));
 	tfleche();
 	if (anyone || iesc)  return;
 	if (s.mlieu == 23) {
@@ -432,7 +436,8 @@ L2:
 /* overlay */ void touvrir() {
 	int cx, haz;
 
-	if (! syn)  ecr3("ouvrir");                  //Translation: Open
+	if (!syn)
+		ecr3(g_vm->getString(S_OPEN));
 	if (caff == 26) {
 		if (ment != 0) {
 			msg[4] = entrer;
@@ -493,7 +498,8 @@ L2:
 		crep = 186;
 		return;
 	}
-	if (! syn)  ecr3("mettre");               //Translation: Put
+	if (!syn)
+		ecr3(g_vm->getString(S_PUT));
 	tfleche();
 	if (iesc)  crep = 998;
 	if ((anyone) || (iesc))  return;
@@ -523,7 +529,7 @@ L2:
 					repon(2, 165);
 					maivid();
 					parole(6, -9, 1);
-					quel = do_alert(stouinon, 1);
+					quel = do_alert(g_vm->getString(S_YES_NO), 1);
 					if (quel == 1)  {
 						deline(582, st, tay);
 						i = do_alert(delig, 1);
@@ -592,7 +598,8 @@ L2:
 		crep = 149;
 		return;
 	}
-	if (! syn)  ecr3("tourner");             //Translation: Turn
+	if (!syn)
+		ecr3(g_vm->getString(S_TURN));
 	tfleche();
 	if ((anyone) || (iesc))  return;
 	tcoord(9);
@@ -601,7 +608,7 @@ L2:
 		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
-			quel = do_alert(stouinon, 1);
+			quel = do_alert(g_vm->getString(S_YES_NO), 1);
 			if (quel == 1)
 				g_vm->_endGame = true;
 			else crep = 168;
@@ -610,7 +617,7 @@ L2:
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
-			quel = do_alert(stouinon, 1);
+			quel = do_alert(g_vm->getString(S_YES_NO), 1);
 			if (quel == 1) {
 				s.mlieu = 16;
 				affrep();
@@ -620,7 +627,8 @@ L2:
 }
 
 /* overlay */ void tcacher() {
-	if (! syn)  ecr3("se cacher");             //Translation: Hide self
+	if (!syn)
+		ecr3(g_vm->getString(S_HIDE_SELF));
 	tfleche();
 	if (!(anyone) && !(iesc)) {
 		tcoord(10);
@@ -635,7 +643,8 @@ L2:
 /* overlay */ void tattacher() {
 	if (s.derobj == 0)  crep = 186;
 	else {
-		if (! syn)  ecr3("attacher");           //Translation: Tie
+		if (!syn)
+			ecr3(g_vm->getString(S_TIE));
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(8);
@@ -655,7 +664,8 @@ L2:
 /* overlay */ void tfermer() {
 	int cx, chai;
 
-	if (! syn)  ecr3("fermer");              //Translation: Close
+	if (!syn)
+		ecr3(g_vm->getString(S_CLOSE));
 	if (caff < 26) {
 		tfleche();
 		if (iesc)  crep = 998;
@@ -684,9 +694,10 @@ L2:
 /* overlay */ void tfrapper() {
 	int l, p, haz;
 
-	if (! syn)  ecr3("frapper");          //Translation: Hit
+	if (!syn)
+		ecr3(g_vm->getString(S_HIT));
 	if (s.mlieu == 15) {
-		l = do_alert("[1][ | Avant, utilisez le menu DEP...][ok]", 1);  //Translation: [1] [ | Before, use the DEP menu...] [Ok]
+		l = do_alert(g_vm->getString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 	if (s.mlieu < 25) {
@@ -716,7 +727,8 @@ L2:
 /* overlay */ void tposer() {
 	int cx, chai;
 
-	if (! syn)  ecr3("poser");
+	if (!syn)
+		ecr3(g_vm->getString(S_POSE));
 	if (s.derobj == 0)  crep = 186;
 	else {
 		if (caff > 99) {
@@ -884,7 +896,6 @@ L2:
 }
 
 /* overlay */ void tdormir() {
-	const char m1[] = "D‚sirez-vous vous r‚veiller?";       //Translation: Do you want to wake up?
 	int z, j, h, m, quel;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
@@ -902,7 +913,7 @@ L2:
 	clsf3();
 	clsf2();
 	ecrf2();
-	ecr2(m1);
+	ecr2(g_vm->getString(S_WANT_TO_WAKE_UP));
 	calch(j, h, m);
 	do {
 		if (h < 8) {
@@ -916,7 +927,7 @@ L2:
 		h = h + 1;
 		if (h > 23)  h = 0;
 		tinke();
-		quel = do_alert(stouinon, 1);
+		quel = do_alert(g_vm->getString(S_YES_NO), 1);
 		anyone = false;
 	} while (!(quel == 1));
 	crep = 998;
@@ -924,7 +935,8 @@ L2:
 }
 
 /* overlay */ void tdefoncer() {
-	if (! syn)  ecr3("d‚foncer");                     //Translation: Smash
+	if (!syn)
+		ecr3(g_vm->getString(S_SMASH));
 	if (caff < 25)  tfleche();
 	if ((! anyone) && (! iesc))
 		if (s.mlieu != 26)  crep = 997;
@@ -977,14 +989,15 @@ L2:
 			return;
 		}
 		repon(2, 102);
-		quel = do_alert(stouinon, 1);
+		quel = do_alert(g_vm->getString(S_YES_NO), 1);
 	} while (!(quel == 2));
 	crep = 998;
 	if (! anyone)  tinke();
 }
 
 /* overlay */ void tsonder() {
-	if (! syn)  ecr3("sonder");            //Translation: Probe
+	if (!syn)
+		ecr3(g_vm->getString(S_PROBE2));
 	if (caff < 27) {
 		tfleche();
 		if (!(anyone) && (! iesc))  crep = 145;
@@ -1170,7 +1183,8 @@ L2:
 /* overlay */ void tsentir() {
 	crep = 119;
 	if (caff < 26) {
-		if (! syn)  ecr3("sentir");        //Translation: Smell
+		if (!syn)
+			ecr3(g_vm->getString(S_SMELL));
 		tfleche();
 		if (!(anyone) && !(iesc))
 			if (caff == 16)  crep = 153;
@@ -1181,7 +1195,8 @@ L2:
 /* overlay */ void tgratter() {
 	crep = 155;
 	if (caff < 27) {
-		if (! syn)  ecr3("gratter");       //Translation: Scratch
+		if (!syn)
+			ecr3(g_vm->getString(S_SCRATCH));
 		tfleche();
 	}
 	num = 0;
@@ -1242,7 +1257,7 @@ void MortevielleEngine::loseGame() {
 	heu = 10;
 	jou = 0;
 	repon(2, 180);
-	quel = do_alert(stouinon, 1);
+	quel = do_alert(g_vm->getString(S_YES_NO), 1);
 	_quitGame = (quel != 1);
 }
 
diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 35e5cad..5997b4c 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -29,6 +29,9 @@
 
 namespace Mortevielle {
 uint32 MortevielleEngine::getGameFlags() const { return _gameDescription->flags; }
+
+Common::Language MortevielleEngine::getLanguage() const { return _gameDescription->language; }
+
 }
 
 static const PlainGameDescriptor MortevielleGame[] = {
diff --git a/engines/mortevielle/detection_tables.h b/engines/mortevielle/detection_tables.h
index 7ceb40d..307d125 100644
--- a/engines/mortevielle/detection_tables.h
+++ b/engines/mortevielle/detection_tables.h
@@ -23,6 +23,7 @@
 namespace Mortevielle {
 
 static const ADGameDescription MortevielleGameDescriptions[] = {
+	// French
 	{
 		"mortevielle",
 		"",
@@ -36,6 +37,8 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
+
+	// German
 	{
 		"mortevielle",
 		"",
@@ -49,6 +52,23 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
+
+	// English. Note that this is technically the French version, but English strings in mort.dat
+	// will automatically replace all the French strings
+	{
+		"mortevielle",
+		"",
+		{
+			{"menufr.mor", 0, "e413f36b9e14eef16130adc347a9391f", 144},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
+		Common::EN_ANY,
+		Common::kPlatformPC,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+
 	AD_TABLE_END_MARKER
 };
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 9c50777..bc74a37 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -214,18 +214,18 @@ void invers(int ix) {
 		s = dis[lo(msg4)];
 		break;
 	case 6 :
-		s = fic[lo(msg4)];
+		s = g_vm->getString(S_SAVE_LOAD + lo(msg4));
 		break;
 	case 7 :
-		s = fic[1];
+		s = g_vm->getString(S_SAVE_LOAD + 1);
 		s += ' ';
 		s += (char)(48 + lo(msg4));
 		break;
 	case 8 :
 		if (lo(msg4) == 1) {
-			s = recom;
+			s = g_vm->getString(S_RESTART);
 		} else {
-			s = fic[2];
+			s = g_vm->getString(S_SAVE_LOAD + 2);
 			s += ' ';
 			s += (char)(47 + lo(msg4));
 		}
@@ -302,10 +302,10 @@ void menu_down(int ii) {
 			if (dis[cx][0] != '*')  writeg(dis[cx], 4);
 			break;
 		case 6 :
-			writeg(fic[cx], 4);
+			writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
 			break;
 		case 7 : {
-			Common::String s = fic[1];
+			Common::String s = g_vm->getString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
 			writeg(s, 4);
@@ -313,9 +313,9 @@ void menu_down(int ii) {
 		}
 		case 8 :
 			if (cx == 1)
-				writeg(recom, 4);
+				writeg(g_vm->getString(S_RESTART), 4);
 			else {
-				Common::String s = fic[2];
+				Common::String s = g_vm->getString(S_SAVE_LOAD + 2);
 				s += ' ';
 				s += (char)(47 + cx);
 				writeg(s, 4);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 17dd83a..ae303e9 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -35,6 +35,7 @@
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/parole2.h"
@@ -43,9 +44,6 @@
 
 namespace Mortevielle {
 
-/* Niveau 14 suite */
-const char m1[] = "quelqu'un entre, parait ‚tonn‚ mais ne dit rien";       //Translation: Someone enters, looks surised, but says nothing
-
 // For ScummVM, we need to do check for file errors where we do the file access
 const int ioresult = 0;
 
@@ -287,10 +285,14 @@ void clsf10() {
 		cod = 544;
 	}
 	box(15, gd, cod, 93, co, 98, 255);
-	if (s.conf < 33)  st = "Cool";
-	else if (s.conf < 66)  st = " Lourde ";
-	else if (s.conf > 65)  st = "Malsaine";
-	if (res == 1)  co = 10;
+	if (s.conf < 33)
+		st = g_vm->getString(S_COOL);
+	else if (s.conf < 66)
+		st = g_vm->getString(S_LOURDE);
+	else if (s.conf > 65)
+		st = g_vm->getString(S_MALSAINE);
+	if (res == 1)
+		co = 10;
 	else co = 6;
 	co = 574 - ((uint)co * st.size() >> 1);
 	putxy(co, 92);
@@ -453,9 +455,9 @@ void f3f8() {
 	if (res == 1)  co = 107;
 	else co = 64;
 	putxy(3, 44);
-	writeg(f3, 5);
+	writeg(g_vm->getString(S_F3), 5);
 	ywhere = 51;
-	writeg(f8, 5);
+	writeg(g_vm->getString(S_F8), 5);
 	boite(0, 42, co, 16, 7);
 }
 
@@ -610,22 +612,21 @@ void affper(int per) {
 	if ((h >= 0) && (h < 8))  p = 60;
 }
 
+/**
+ * Shows the you are alone message in the status area on the right hand side of the screen
+ */
 void person() {
-	const char m1[] = "Vous"; //Translation: You
-	const char m2[] = "ˆtes"; //Translation: are
-	const char m3[] = "SEUL"; //Translation: ALONE
-	int cf;
-	Common::String str_;
-
 	/* debug('person'); */
-	for (cf = 1; cf <= 8; cf ++) menu_disable(disc[cf]);
+	for (int cf = 1; cf <= 8; cf ++)
+		menu_disable(disc[cf]);
+
 	clsf10();
 	putxy(560, 30);
-	writeg(m1, 4);
+	writeg(g_vm->getString(S_YOU), 4);
 	putxy(560, 50);
-	writeg(m2, 4);
+	writeg(g_vm->getString(S_ARE), 4);
 	putxy(560, 70);
-	writeg(m3, 4);
+	writeg(g_vm->getString(S_ALONE), 4);
 	ipers = 0;
 }
 
@@ -668,7 +669,7 @@ void pendule() {
 	else writeg("AM ", 1);
 	putxy(550, 160);
 	if ((jou >= 0) && (jou <= 8)) {
-		Common::String tmp("& jour");                 //Translation: Day
+		Common::String tmp = g_vm->getString(S_DAY);
 		tmp.insertChar((char)(jou + 49), 0);
 		writeg(tmp, 1);
 	}
@@ -1208,7 +1209,7 @@ void phaz(int &haz, int &p, int cf) {
 	if (s.conf > 69)  s.conf = s.conf + (s.conf / 10);
 	clsf3();
 	ecrf2();
-	ecr3(m1);
+	ecr3(g_vm->getString(S_SOMEONE_ENTERS));
 	haz = (hazard(0, 4)) - 2;
 	parole(2, haz, 1);
 	for (haz = 0; haz <= 3000; haz ++);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c71c850..b8b76c1 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -47,13 +47,12 @@ const int men[12] = { 0,
 };
 
 void tinke() {
-	const char m1[] = "Mince! Vous entendez du bruit...";       //Translation: Gosh! You hear some noise...
-	const char d1[] = " | Vous devriez avoir remarqu‚|       "; //Translation: You should have noticed
-	const char d2[] = "% des indices...";                       //Translation: %s of hints
+	Common::String d1 = g_vm->getString(S_SHOULD_HAVE_NOTICED);
+	Common::String d2 = g_vm->getString(S_NUMBER_OF_HINTS);
 	const char d3 = '[';
 	const char d4 = ']';
 	const char d5 = '1';
-	const char d6[] = "OK";
+	Common::String d6 = g_vm->getString(S_OK);
 	int cx, haz, nh, cf, j, h, m;
 	Common::String stpo;
 	bool am;
@@ -78,7 +77,18 @@ void tinke() {
 		if (cf == 10)  stpo = "10";
 		else stpo = chr(cf + 48);
 
-		stpou = Common::String(d3) + d5 + d4 + d3 + d1 + stpo + '0' + d2 + d4 + d3 + d6 + d4;
+		stpou = Common::String(d3);
+		stpou += d5;
+		stpou += d4;
+		stpou += d3;
+		stpou += d1;
+		stpou += stpo;
+		stpou += '0';
+		stpou += d2;
+		stpou += d4;
+		stpou += d3;
+		stpou += d6;
+		stpou += d4;
 	}
 	if (m > min) {
 		min = 30;
@@ -149,7 +159,7 @@ void tinke() {
 						if (haz < 5) {
 							clsf3();
 							ecrf2();
-							ecr3(m1);
+							ecr3(g_vm->getString(S_HEAR_NOISE));
 							haz = (hazard(0, 4)) - 2;
 							parole(1, haz, 1);
 							clsf3();
@@ -269,8 +279,8 @@ void mfouen()
 	 menu_enable(menup, mettre);
 	 menu_enable(menup, ouvrir);
 	 menu_enable(menup, sortir);  */
-	menut(sonder, " sonder   ");
-	menut(soulever, " soulever ");
+	menut(sonder, g_vm->getString(S_PROBE));
+	menut(soulever, g_vm->getString(S_RAISE));
 }
 
 void atf3f8(int &key) {
@@ -427,8 +437,8 @@ void mfoudi() {
 	 menu_disable(menup, mettre);
 	 menu_disable(menup, ouvrir);
 	 menu_disable(menup, sortir);  */
-	menut(sonder, " -SUITE- ");
-	menut(soulever, " -STOP-  ");
+	menut(sonder, g_vm->getString(S_SUITE));
+	menut(soulever, g_vm->getString(S_STOP));
 }
 
 void mennor() {
@@ -774,7 +784,7 @@ void st13(int ob) {
 void aldepl() {
 	int dummy;
 
-	dummy = do_alert("[1][Alors, utilisez le menu DEP...][ok]", 1);       //Translation: [1] [So, use the DEP menu] [Ok]
+	dummy = do_alert(g_vm->getString(S_USE_DEP_MENU), 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index eed4b51..1fc20cf 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -204,16 +204,51 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 		if (!strncmp(dataType, "FONT", 4)) {
 			// Font resource
 			_screenSurface.readFontData(f, dataSize);
+		} else if (!strncmp(dataType, "SSTR", 4)) {
+			readStaticStrings(f, dataSize);
 		} else {
 			// Unknown section
 			f.skip(dataSize);
 		}
 	}
 
+	// Close the file
 	f.close();
+
+	assert(_staticStrings.size() > 0);
 	return Common::kNoError;
 }
 
+/**
+ * Read in a static strings block, and if the language matches, load up the static strings
+ */
+void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize) {
+	// Figure out what language Id is needed
+	byte desiredLanguageId = (getLanguage() == Common::EN_ANY) ? LANG_ENGLISH : LANG_FRENCH;
+
+	// Read in the language
+	byte languageId = f.readByte();
+	--dataSize;
+
+	// If the language isn't correct, then skip the entire block
+	if (languageId != desiredLanguageId) {
+		f.skip(dataSize);
+		return;
+	}
+
+	// Load in each of the strings
+	while (dataSize > 0) {
+		Common::String s;
+		char ch;
+		while ((ch = (char)f.readByte()) != '\0')
+			s += ch;
+		
+		_staticStrings.push_back(s);
+		dataSize -= s.size() + 1;
+	}
+	assert(dataSize == 0);
+}
+
 bool MortevielleEngine::keyPressed() {
 	// Check for any pending key presses
 	handleEvents();
@@ -510,7 +545,6 @@ void MortevielleEngine::playGame() {
  * @remarks	Originally called tecran
  */
 void MortevielleEngine::handleAction() {
-	const char idem[] = "Idem";
 	const int lim = 20000;
 	int temps = 0;
 	char inkey = '\0';
@@ -555,7 +589,7 @@ void MortevielleEngine::handleAction() {
 		} else if (inkey == '\77') {
 			if ((mnumo != no_choice) && ((msg[3] == action) || (msg[3] == saction))) {
 				msg[4] = mnumo;
-				ecr3(idem);
+				ecr3(g_vm->getString(S_IDEM));
 			} else return;
 		} else if (inkey == '\104') {
 			if ((x != 0) && (y != 0))  num = 9999;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 9ca8258..94640ba 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -38,11 +38,32 @@
 
 namespace Mortevielle {
 
+// Debug channels
 enum {
 	kMortevielleCore = 1 << 0,
 	kMortevielleGraphics = 1 << 1
 };
 
+// Game languages
+enum {
+	LANG_FRENCH = 0,
+	LANG_ENGLISH = 1
+};
+
+// Static string list
+enum {
+	S_YES_NO = 0, S_GO_TO = 1, S_SOMEONE_ENTERS = 2, S_COOL = 3, S_LOURDE = 4, 
+	S_MALSAINE = 5, S_IDEM = 6,	S_YOU = 7, S_ARE = 8, S_ALONE = 9,
+	S_HEAR_NOISE = 10, S_SHOULD_HAVE_NOTICED = 11, S_NUMBER_OF_HINTS = 12,
+	S_WANT_TO_WAKE_UP = 13, S_OK = 14, S_SAVE_LOAD = 15, S_RESTART = 18, S_F3 = 19, 
+	S_F8 = 20, S_HIDE_SELF = 21, S_TAKE = 22, S_PROBE = 23, S_RAISE = 24, S_SUITE = 25, 
+	S_STOP = 26, S_USE_DEP_MENU = 27, S_LIFT = 28, S_READ = 29, 
+	S_LOOK = 30, S_SEARCH = 31, S_OPEN = 32, S_PUT = 33, S_TURN = 34, S_TIE = 35, S_CLOSE = 36,
+	S_HIT = 37, S_POSE = 38, S_SMASH = 39,
+
+	S_SMELL = 40, S_SCRATCH = 41, S_PROBE2 = 42, S_BEFORE_USE_DEP_MENU = 43, S_DAY = 44
+};
+
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
 #define SCREEN_ORIG_HEIGHT 200
@@ -58,9 +79,11 @@ private:
 	bool _mouseClick;
 	Common::Point _mousePos;
 	bool _inMainGameLoop;	// Flag when the main game loop is active
+	Common::StringArray _staticStrings;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
+	void readStaticStrings(Common::File &f, int dataSize);
 	void loadFont(Common::File &f);
 	bool handleEvents();
 	void addKeypress(Common::Event &evt);
@@ -91,6 +114,7 @@ public:
 	virtual Common::Error saveGameState(int slot, const Common::String &desc);
 	virtual Common::Error run();
 	uint32 getGameFlags() const;
+	Common::Language getLanguage() const;
 
 	bool keyPressed();
 	int getChar();
@@ -99,6 +123,7 @@ public:
 	bool getMouseClick() const { return _mouseClick; }
 	void setMouseClick(bool v) { _mouseClick = v; }
 	void delay(int amount);
+	Common::String getString(int idx) const { return _staticStrings[idx]; }
 
 	void endGame();
 	void loseGame();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 5ace061..cd84b93 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -72,19 +72,8 @@ const byte don[9][5] = {
 	{0,  62, 25, 13,  5}
 };
 
-const char *fic[3] = {
-	"", 
-	" Sauvegarde",  // Translation: "Save"
-	 " Chargement"  // Translation: "Load"
-};
-
 const byte addv[2] = {8, 8};
 
-const char recom[] = " Recommence  "; // Translation: "Restart"
-
-const char f3[] = "F3: Encore";       // Translation: "F3: More"
-const char f8[] = "F8: Suite";        // Translation: "F8: Next"
-
 const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
 /*---------------------------------------------------------------------------*/
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index eea8994..2e2bf53 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -176,15 +176,8 @@ extern const byte tnocon[364];
 
 extern const byte don[9][5];
 
-extern const char *fic[3];
-
 extern const byte addv[2];
 
-extern const char recom[];
-
-extern const char f3[];
-extern const char f8[];
-
 extern const byte rang[16];
 
 /*---------------------------------------------------------------------------*/


Commit: 946142741b94abc8a410ded816ab1420b111302c
    https://github.com/scummvm/scummvm/commit/946142741b94abc8a410ded816ab1420b111302c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:00-07:00

Commit Message:
MORTEVIELLE: Removed text screen output, and fixed copyright to display on title screen.

Note: The original used Pascal text display functions to show the copyright on the title screen. To avoid a lot of code needing to be added for just that line, I'm using the existing graphic text display code. The resulting copyright text isn't identical to the original, but I consider it close enough.

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 1fc20cf..4cbc2b4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -479,7 +479,9 @@ void MortevielleEngine::showIntroduction() {
 	divers(143, true);
 	CHECK_QUIT;
 
+	// TODO: Once music is implemented, only use the below delay if music is turned off
 	suite();
+	delay(3000);
 	music();
 }
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index bfa6f47..8fb45b5 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -233,75 +233,13 @@ void ani50() {
 	al_mess2 = delig;
 }
 
-/* overlay */ void dialpre()
-
-{
-	int cy, tay;
-	char st[1410];
-	float ix;
-//	char ch;
-
-
+/**
+ * The original engine used this method to display a starting text screen letting the palyer
+ * select the graphics mode to use
+ */
+void dialpre() {
 	/* debug('o3 dialpre'); */
-	cy = 0;
-	clrscr;
-	textcolor(9);
-	do {
-		cy = cy + 1;
-		deline(cy + c_dialpre, st, tay);
-		gotoxy(40 - tay / 2, wherey + 1);
-		output(delig);
-	} while (!(cy == 20));
-	ix = 0;
-/*	do {
-		ix = ix + 1;
-	} while (!(keypressed() | (ix == 5e5)));
-*/
 	crep = 998;
-	textcolor(1);
-	gotoxy(1, 21);
-	clreol;
-	gotoxy(1, 23);
-	output("CARTE GRAPHIQUE      CGA    EGA    HERCULE/AT&T400    TANDY    AMSTRAD1512");
-	gotoxy(12, 24);
-	output("Ctrl       C      E            H             T           A");
-
-/*
-	do {
-		ch = get_ch();	// input >> kbd >> ch;
-	} while ((ch != '\1') && (ch != '\3') && (ch != '\5') && (ch != '\24') && (ch != '\10'));
-	switch (ch) {
-	case '\1':
-	case '\3':
-	case '\5' :
-		gd = (uint)ord(ch) >> 1;
-		break;
-	case '\10' :
-		gd = her;
-		break;
-	case '\24' :
-		gd = tan;
-		break;
-	}*/
-
-	gotoxy(1, 24);
-	clreol;
-	gotoxy(1, 23);
-	clreol;
-	gotoxy(26, 23);
-	// "Play using keyboard / ... mouse"
-	output("Jeu au Clavier / … la Souris");
-	textcolor(4);
-	gotoxy(33, 23);
-	output("C");
-	gotoxy(48, 23);
-	output("S");
-	/*
-	do {
-		ch = get_ch();	// input >> kbd >> ch;
-	} while ((ch != 'C') && (ch != 'S'));
-	int_m = (toupper(ch) == 'S');
-	*/
 	int_m = true;
 }
 
@@ -390,10 +328,7 @@ void ani50() {
 	f.close();
 }
 
-
-/* overlay */ void suite() {
-	Common::String cpr;
-
+void suite() {
 	hirs();
 	repon(7, 2035);
 	caff = 51;
@@ -402,15 +337,10 @@ void ani50() {
 	if (newgd != gd)  gd = newgd;
 	hirs();
 	dessine(ades, 0, 0);
-	gotoxy(20 * pred(int, res) + 8, 24);
-	textcolor(7);
-	cpr = "COPYRIGHT 1989 : LANKHOR";
-	if ((gd == ega) || (gd == ams) || (gd == cga))
-		output(cpr);
-	else {
-		putxy(104 + 72 * res, 190);
-		writeg(cpr, 0);
-	}
+
+	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
+	putxy(104 + 72 * res, 185);
+	writeg(cpr, 0);
 }
 
 } // End of namespace Mortevielle


Commit: c0ad988f1c9a3b5de0b522be51608acb567f635b
    https://github.com/scummvm/scummvm/commit/c0ad988f1c9a3b5de0b522be51608acb567f635b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:01-07:00

Commit Message:
MORTEVIELLE: Removed redundant gfx functions, and moved others into ScreenSurface class.

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/level15.cpp
    engines/mortevielle/level15.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/sprint.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index cd3a7b0..f3bc31b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1053,7 +1053,7 @@ L2:
 		lig = 0;
 		do {
 			icm = succ(int, icm);
-			putxy(co, lig);
+			g_vm->_screenSurface.putxy(co, lig);
 			if (s.teauto[icm] == '*')
 				if (te[icm])  writetp(lib[icm], 1);
 				else writetp(lib[icm], 0);
@@ -1062,7 +1062,7 @@ L2:
 				co = 320;
 			} else lig = lig + 8;
 		} while (!(icm == 42));
-		putxy(320, 176);
+		g_vm->_screenSurface.putxy(320, 176);
 		writetp(lib[46], 0);
 		tou = '\0';
 		do {
@@ -1080,7 +1080,7 @@ L2:
 					lig = ((choi - 1) % 23) << 3;
 					if (choi > 23)  co = 320;
 					else co = 0;
-					putxy(co, lig);
+					g_vm->_screenSurface.putxy(co, lig);
 					if (te[choi])  writetp(lib[choi], 0);
 					else writetp(lib[choi], 1);
 					te[choi] = ! te[choi];
@@ -1094,7 +1094,7 @@ L2:
 						lig = ((choi - 1) % 23) << 3;
 						if (choi > 23)  co = 320;
 						else co = 0;
-						putxy(co, lig);
+						g_vm->_screenSurface.putxy(co, lig);
 						if (te[choi])  writetp(lib[choi], 0);
 						else writetp(lib[choi], 1);
 						te[choi] = ! te[choi];
@@ -1103,7 +1103,7 @@ L2:
 						lig = ((ix - 1) % 23) << 3;
 						if (ix > 23)  co = 320;
 						else co = 0;
-						putxy(co, lig);
+						g_vm->_screenSurface.putxy(co, lig);
 						if (te[ix])  writetp(lib[ix], 0);
 						else writetp(lib[ix], 1);
 						te[ix] = ! te[ix];
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 36a51b0..73befd9 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -87,7 +87,7 @@ static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 
 
 static void posit(int ji, int &coldep, int &esp) {
-	putxy(coldep + (40 + esp) *pred(int, ji), 98);
+	g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
 }
 
 
@@ -122,13 +122,13 @@ static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::Strin
 		} while (!(c[i + 1] == ']'));
 		i = i + 2;
 		while (str[l].size() < 3)  str[l] = str[l] + ' ';
-		putxy(x, 98);
+		g_vm->_screenSurface.putxy(x, 98);
 
 		Common::String tmp(" ");
 		tmp += str[l];
 		tmp += " ";
 
-		writeg(tmp, 0);
+		g_vm->_screenSurface.writeg(tmp, 0);
 		x = x + esp + 40;
 	}
 }
@@ -163,7 +163,7 @@ int do_alert(Common::String str_, int n) {
 	} else {
 		fait_boite(8, 7, nbcol);
 		i = 0;
-		ywhere = 70;
+		g_vm->_screenSurface._textPos.y = 70;
 		do {
 			cx = 320;
 			st = "";
@@ -173,9 +173,9 @@ int do_alert(Common::String str_, int n) {
 				if (res == 2)  cx = cx - 3;
 				else cx = cx - 5;
 			}
-			putxy(cx, ywhere);
-			ywhere = ywhere + 6;
-			writeg(st, 4);
+			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
+			g_vm->_screenSurface._textPos.y += 6;
+			g_vm->_screenSurface.writeg(st, 4);
 			i = i + 1;
 		} while (!(chaine[i] == ']'));
 	}
@@ -219,14 +219,14 @@ int do_alert(Common::String str_, int n) {
 						Common::String tmp(" ");
 						tmp += s[quoi];
 						tmp += " ";
-						writeg(tmp, 0);
+						g_vm->_screenSurface.writeg(tmp, 0);
 					}
 					posit(ix, coldep, esp);
 
 					Common::String tmp2 = " ";
 					tmp2 += s[ix];
 					tmp2 += " ";
-					writeg(tmp2, 1);
+					g_vm->_screenSurface.writeg(tmp2, 1);
 
 					quoi = ix;
 					show_mouse();
@@ -240,7 +240,7 @@ int do_alert(Common::String str_, int n) {
 			Common::String tmp3(" ");
 			tmp3 += s[quoi];
 			tmp3 += " ";
-			writeg(tmp3, 0);
+			g_vm->_screenSurface.writeg(tmp3, 0);
 
 			quoi = 0;
 			show_mouse();
@@ -256,7 +256,7 @@ int do_alert(Common::String str_, int n) {
 		Common::String tmp4(" ");
 		tmp4 += s[n];
 		tmp4 += " ";
-		writeg(tmp4, 1);
+		g_vm->_screenSurface.writeg(tmp4, 1);
 	}
 	charecr(50, succ(int, nligne) << 4);
 	show_mouse();
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index 54d788b..c0a48a5 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -26,6 +26,8 @@
  */
 
 #include "mortevielle/droite.h"
+#include "mortevielle/graphics.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -47,7 +49,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		if (y > yy)  step = -1;
 		else step = 1;
 		do {
-			putpix(gd, abs((int)(a * i + b)), i, coul);
+			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
 			i = i + step;
 		} while (!(i == yy));
 		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
@@ -58,7 +60,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 		if (x > xx)  step = -1;
 		else step = 1;
 		do {
-			putpix(gd, i, abs((int)(a * i + b)), coul);
+			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
 			i = i + step;
 		} while (!(i == xx));
 		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3450d41..e9c8c1e 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1040,4 +1040,59 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
 	*(destP + SCREEN_WIDTH) = palIndex;
 }
 
+/**
+ * Write out a string
+ */
+void ScreenSurface::writeg(const Common::String &l, int c) {
+	int i, x;
+	Common::Point pt;
+	int cecr = 0;
+
+	/*  debug('writeg : '+l);*/
+
+	if (l == "")
+		return;
+	hide_mouse();
+	pt = _textPos;
+
+	if (res == 2)
+		i = 6;
+	else
+		i = 10;
+	x = pt.x + i * l.size();
+
+	switch (c) {
+	case 1:
+	case 3  : {
+		cecr = 0;
+		box(15, gd, pt.x, pt.y, x, pt.y + 7, 255);
+	}
+	break;
+	case 4 : {
+		cecr = 0;
+	}
+	break;
+	case 5 : {
+		cecr = 15;
+	}
+	break;
+	case 0:
+	case 2 : {
+		cecr = 15;
+		box(0, gd, pt.x, pt.y, x, pt.y + 7, 255);
+	}
+	break;
+	}
+	pt.x += 1;
+	pt.y += 1;
+	for (x = 1; x <= (int)l.size(); ++x) {
+		g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
+		pt.x += i;
+	}
+	show_mouse();
+
+	// TODO: Move screen updates to main loop once constructed
+	g_vm->_screenSurface.updateScreen();
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 0b26546..258f4cf 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -78,6 +78,8 @@ private:
 	Common::List<Common::Rect> _dirtyRects;
 	byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
 public:
+	Common::Point _textPos;		// Original called xwhere/ywhere
+public:
 	void readFontData(Common::File &f, int dataSize);
 	Graphics::Surface lockArea(const Common::Rect &bounds);
 	void updateScreen();
@@ -87,6 +89,8 @@ public:
 	void drawBox(int x, int y, int dx, int dy, int col);
 	void fillBox(int colour, const Common::Rect &bounds, int patt);
 	void clearScreen();
+	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
+	void writeg(const Common::String &l, int c);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index b0ed953..c017bf2 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -112,10 +112,6 @@ void pictout(int seg, int dep, int x, int y) {
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
 
-void putxy(int x, int y) {
-	xwhere = x;
-	ywhere = y;
-}
 /*
 function calad(x,y:int):int;
    begin
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index aee94c9..c3df5e5 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -38,7 +38,6 @@ extern bool dans_rect(rectangle r);
 extern void outbloc(int n, pattern p, t_nhom pal);
 extern void writepal(int n);
 extern void pictout(int seg, int dep, int x, int y);
-extern void putxy(int x, int y);
 // extern int calad(int x, int y);
 extern void sauvecr(int y, int dy);
 extern void charecr(int y, int dy);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index bc74a37..07626b3 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -162,9 +162,9 @@ void menu_aff() {
 				msk = 0x80;
 				for (pt = 0; pt <= 7; pt ++) {
 					if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
-						putpix(gd, x + 1, y + 1, 0);
-						putpix(gd, x, y + 1, 0);
-						putpix(gd, x, y, color);
+						g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
+						g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
+						g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
 					}
 					msk = (uint)msk >> 1;
 					x = x + 1;
@@ -196,7 +196,7 @@ void invers(int ix) {
 
 	/* debug('invers'); */
 	if (msg4 == no_choice)  return;
-	putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
+	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
 	case 1 :
 		s = inv[lo(msg4)];
@@ -232,7 +232,7 @@ void invers(int ix) {
 		break;
 	}
 	if ((s[0] != '*') && (s[0] != '<'))
-		writeg(s, ix);
+		g_vm->_screenSurface.writeg(s, ix);
 	else
 		msg4 = no_choice;
 }
@@ -281,48 +281,53 @@ void menu_down(int ii) {
 	box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
 	box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
 	box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
-	putxy(xco, 16);
+	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
 		cx = succ(int, cx);
 		switch (ii) {
 		case 1 :
-			if (inv[cx][0] != '*')  writeg(inv[cx], 4);
+			if (inv[cx][0] != '*')
+				g_vm->_screenSurface.writeg(inv[cx], 4);
 			break;
 		case 2 :
-			if (dep[cx][0] != '*')  writeg(dep[cx], 4);
+			if (dep[cx][0] != '*')
+				g_vm->_screenSurface.writeg(dep[cx], 4);
 			break;
 		case 3 :
-			if (act[cx][0] != '*')  writeg(act[cx], 4);
+			if (act[cx][0] != '*')
+				g_vm->_screenSurface.writeg(act[cx], 4);
 			break;
 		case 4 :
-			if (self_[cx][0] != '*')  writeg(self_[cx], 4);
+			if (self_[cx][0] != '*')
+				g_vm->_screenSurface.writeg(self_[cx], 4);
 			break;
 		case 5 :
-			if (dis[cx][0] != '*')  writeg(dis[cx], 4);
+			if (dis[cx][0] != '*')
+				g_vm->_screenSurface.writeg(dis[cx], 4);
 			break;
 		case 6 :
-			writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
+			g_vm->_screenSurface.writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
 			break;
 		case 7 : {
 			Common::String s = g_vm->getString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
-			writeg(s, 4);
+			g_vm->_screenSurface.writeg(s, 4);
 			break;
 		}
 		case 8 :
 			if (cx == 1)
-				writeg(g_vm->getString(S_RESTART), 4);
+				g_vm->_screenSurface.writeg(g_vm->getString(S_RESTART), 4);
 			else {
 				Common::String s = g_vm->getString(S_SAVE_LOAD + 2);
 				s += ' ';
 				s += (char)(47 + cx);
-				writeg(s, 4);
+				g_vm->_screenSurface.writeg(s, 4);
 			}
 			break;
 		}
-		putxy(xco, ywhere + 8);
+		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (!(cx == nb_lig));
 	test0 = true;
 	show_mouse();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ae303e9..8978731 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -221,23 +221,24 @@ void ecr2(Common::String str_) {
 	/* debug('ecr2 : '+str_);*/
 	if (res == 1)  tab = 10;
 	else tab = 6;
-	putxy(8, 177);
+	g_vm->_screenSurface.putxy(8, 177);
 	tlig = 59 + pred(int, res) * 36;
-	if ((int)str_.size() < tlig)  writeg(str_, 5);
+	if ((int)str_.size() < tlig)
+		g_vm->_screenSurface.writeg(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
-		putxy(8, 176);
-		writeg(copy(str_, 1, pred(int, tlig)), 5);
-		putxy(8, 182);
-		writeg(copy(str_, tlig, tlig << 1), 5);
+		g_vm->_screenSurface.putxy(8, 176);
+		g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+		g_vm->_screenSurface.putxy(8, 182);
+		g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
 	} else {
 		f2_all = true;
 		clsf2();
-		putxy(8, 176);
-		writeg(copy(str_, 1, pred(int, tlig)), 5);
-		putxy(8, 182);
-		writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
-		putxy(8, 190);
-		writeg(copy(str_, tlig << 1, tlig * 3), 5);
+		g_vm->_screenSurface.putxy(8, 176);
+		g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+		g_vm->_screenSurface.putxy(8, 182);
+		g_vm->_screenSurface.writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
+		g_vm->_screenSurface.putxy(8, 190);
+		g_vm->_screenSurface.writeg(copy(str_, tlig << 1, tlig * 3), 5);
 	}
 }
 
@@ -254,8 +255,8 @@ void clsf3() {
 void ecr3(Common::String text) {
 	/* debug('ecr3 : '+text);*/
 	clsf3();
-	putxy(8, 192);
-	writeg(text, 5);
+	g_vm->_screenSurface.putxy(8, 192);
+	g_vm->_screenSurface.writeg(text, 5);
 }
 
 void ecrf6() {
@@ -295,8 +296,8 @@ void clsf10() {
 		co = 10;
 	else co = 6;
 	co = 574 - ((uint)co * st.size() >> 1);
-	putxy(co, 92);
-	writeg(st, 4);
+	g_vm->_screenSurface.putxy(co, 92);
+	g_vm->_screenSurface.writeg(st, 4);
 	if (res == 1)  co = 620;
 	else co = 584;
 	box(15, gd, 560, 24, co, 86, 255);
@@ -454,10 +455,10 @@ void f3f8() {
 
 	if (res == 1)  co = 107;
 	else co = 64;
-	putxy(3, 44);
-	writeg(g_vm->getString(S_F3), 5);
-	ywhere = 51;
-	writeg(g_vm->getString(S_F8), 5);
+	g_vm->_screenSurface.putxy(3, 44);
+	g_vm->_screenSurface.writeg(g_vm->getString(S_F3), 5);
+	g_vm->_screenSurface._textPos.y = 51;
+	g_vm->_screenSurface.writeg(g_vm->getString(S_F8), 5);
 	boite(0, 42, co, 16, 7);
 }
 
@@ -488,43 +489,43 @@ void affper(int per) {
 	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
-		putxy(560, 24);
-		writeg("LEO", 4);
+		g_vm->_screenSurface.putxy(560, 24);
+		g_vm->_screenSurface.writeg("LEO", 4);
 		menu_enable(disc[1]);
 	}
 	if ((per & 64) == 64) {
-		putxy(560, 32);
-		writeg("PAT", 4);
+		g_vm->_screenSurface.putxy(560, 32);
+		g_vm->_screenSurface.writeg("PAT", 4);
 		menu_enable(disc[2]);
 	}
 	if ((per & 32) == 32) {
-		putxy(560, 40);
-		writeg("GUY", 4);
+		g_vm->_screenSurface.putxy(560, 40);
+		g_vm->_screenSurface.writeg("GUY", 4);
 		menu_enable(disc[3]);
 	}
 	if ((per & 16) == 16) {
-		putxy(560, 48);
-		writeg("EVA", 4);
+		g_vm->_screenSurface.putxy(560, 48);
+		g_vm->_screenSurface.writeg("EVA", 4);
 		menu_enable(disc[4]);
 	}
 	if ((per & 8) == 8) {
-		putxy(560, 56);
-		writeg("BOB", 4);
+		g_vm->_screenSurface.putxy(560, 56);
+		g_vm->_screenSurface.writeg("BOB", 4);
 		menu_enable(disc[5]);
 	}
 	if ((per & 4) == 4) {
-		putxy(560, 64);
-		writeg("LUC", 4);
+		g_vm->_screenSurface.putxy(560, 64);
+		g_vm->_screenSurface.writeg("LUC", 4);
 		menu_enable(disc[6]);
 	}
 	if ((per & 2) == 2) {
-		putxy(560, 72);
-		writeg("IDA", 4);
+		g_vm->_screenSurface.putxy(560, 72);
+		g_vm->_screenSurface.writeg("IDA", 4);
 		menu_enable(disc[7]);
 	}
 	if ((per & 1) == 1) {
-		putxy(560, 80);
-		writeg("MAX", 4);
+		g_vm->_screenSurface.putxy(560, 80);
+		g_vm->_screenSurface.writeg("MAX", 4);
 		menu_enable(disc[8]);
 	}
 	ipers = per;
@@ -621,12 +622,12 @@ void person() {
 		menu_disable(disc[cf]);
 
 	clsf10();
-	putxy(560, 30);
-	writeg(g_vm->getString(S_YOU), 4);
-	putxy(560, 50);
-	writeg(g_vm->getString(S_ARE), 4);
-	putxy(560, 70);
-	writeg(g_vm->getString(S_ALONE), 4);
+	g_vm->_screenSurface.putxy(560, 30);
+	g_vm->_screenSurface.writeg(g_vm->getString(S_YOU), 4);
+	g_vm->_screenSurface.putxy(560, 50);
+	g_vm->_screenSurface.writeg(g_vm->getString(S_ARE), 4);
+	g_vm->_screenSurface.putxy(560, 70);
+	g_vm->_screenSurface.writeg(g_vm->getString(S_ALONE), 4);
 	ipers = 0;
 }
 
@@ -664,14 +665,16 @@ void pendule() {
 	if (h == 0)  h = 12;
 	droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
 	show_mouse();
-	putxy(568, 154);
-	if (heu > 11)  writeg("PM ", 1);
-	else writeg("AM ", 1);
-	putxy(550, 160);
+	g_vm->_screenSurface.putxy(568, 154);
+	if (heu > 11)
+		g_vm->_screenSurface.writeg("PM ", 1);
+	else
+		g_vm->_screenSurface.writeg("AM ", 1);
+	g_vm->_screenSurface.putxy(550, 160);
 	if ((jou >= 0) && (jou <= 8)) {
 		Common::String tmp = g_vm->getString(S_DAY);
 		tmp.insertChar((char)(jou + 49), 0);
-		writeg(tmp, 1);
+		g_vm->_screenSurface.writeg(tmp, 1);
 	}
 }
 
@@ -1218,8 +1221,10 @@ void phaz(int &haz, int &p, int cf) {
 }
 
 void writetp(Common::String s, int t) {
-	if (res == 2)  writeg(s, t);
-	else writeg(copy(s, 1, 25), t);
+	if (res == 2)
+		g_vm->_screenSurface.writeg(s, t);
+	else
+		g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
 }
 
 void messint(int nu) {
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index b8b76c1..515fd83 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -182,10 +182,14 @@ void fenat(char ans) {
 	int coul;
 
 	hide_mouse();
-	if (gd == cga)  coul = 2;
-	else if (gd == her)  coul = 1;
-	else coul = 12;
-	affcar(gd, 306, 193, coul, ord(ans));
+	if (gd == cga)
+		coul = 2;
+	else if (gd == her)
+		coul = 1;
+	else
+		coul = 12;
+
+	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
 	boite(300, 191, 16, 8, 15);
 	show_mouse();
 }
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 98429cc..631be60 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -261,7 +261,6 @@ void show_mouse() {
 	}
 	break;
 	}    /*  case Gd   */
-	affput(Common::Point(x_s, y_s), 0, 0);
 }
 
 void pos_mouse(int x, int y) {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index b42aa48..e7d7551 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -26,7 +26,9 @@
  */
 
 #include "mortevielle/outtext.h"
+#include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 #include "common/str.h"
@@ -174,7 +176,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 
 
 	/*    debug('  .. Afftex');*/
-	putxy(x, y);
+	g_vm->_screenSurface.putxy(x, y);
 	if (res == 1)  tab = 10;
 	else tab = 6;
 	dx = dx * 6;
@@ -189,12 +191,12 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	while (! the_end) {
 		switch (ch[p]) {
 		case '@' : {
-			writeg(s, typ);
+			g_vm->_screenSurface.writeg(s, typ);
 			s = "";
 			p = p + 1;
 			xc = x;
 			yc = yc + 6;
-			putxy(xc, yc);
+			g_vm->_screenSurface.putxy(xc, yc);
 		}
 		break;
 		case ' ' : {
@@ -202,7 +204,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 			xc = xc + tab;
 			p = p + 1;
 			if (l_motsuiv(p, ch, tab) + xc > xf) {
-				writeg(s, typ);
+				g_vm->_screenSurface.writeg(s, typ);
 				s = "";
 				xc = x;
 				yc = yc + 6;
@@ -214,21 +216,21 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 					do {
 						j = x;
 						do {
-							putxy(j, i);
-							writeg(" ", 0);
+							g_vm->_screenSurface.putxy(j, i);
+							g_vm->_screenSurface.writeg(" ", 0);
 							j = j + 6;
 						} while (!(j > xf));
 						i = i + 6;
 					} while (!(i > yf));
 					yc = y;
 				}
-				putxy(xc, yc);
+				g_vm->_screenSurface.putxy(xc, yc);
 			}
 		}
 		break;
 		case '$' : {
 			the_end = true;
-			writeg(s, typ);
+			g_vm->_screenSurface.writeg(s, typ);
 		}
 		break;
 		default: {
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 8fb45b5..7deda53 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -339,8 +339,8 @@ void suite() {
 	dessine(ades, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	putxy(104 + 72 * res, 185);
-	writeg(cpr, 0);
+	g_vm->_screenSurface.putxy(104 + 72 * res, 185);
+	g_vm->_screenSurface.writeg(cpr, 0);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 027d747..6a52b2c 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -42,53 +42,4 @@ void clear_box(int x, int y, int dx) {
 	box(0, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
 }
 
-void writeg(Common::String l, int c)
-
-{
-	int i, x, xo, yo;
-	int cecr = 0;
-
-	/*  debug('writeg : '+l);*/
-
-	if (l == "")  return;
-	hide_mouse();
-	xo = xwhere;
-	yo = ywhere;
-	if (res == 2)  i = 6;
-	else i = 10;
-	x = xo + i * l.size();
-	switch (c) {
-	case 1:
-	case 3  : {
-		cecr = 0;
-		box(15, gd, xo, yo, x, yo + 7, 255);
-	}
-	break;
-	case 4 : {
-		cecr = 0;
-	}
-	break;
-	case 5 : {
-		cecr = 15;
-	}
-	break;
-	case 0:
-	case 2 : {
-		cecr = 15;
-		box(0, gd, xo, yo, x, yo + 7, 255);
-	}
-	break;
-	}
-	xo = xo + 1;
-	yo = yo + 1;
-	for (x = 1; x <= (int)l.size(); x ++) {
-		affcar(gd, xo, yo, cecr, ord(l[x - 1]));
-		xo = xo + i;
-	}
-	show_mouse();
-
-	// TODO: Move screen updates to main loop once constructed
-	g_vm->_screenSurface.updateScreen();
-}
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
index 8484214..09d5758 100644
--- a/engines/mortevielle/sprint.h
+++ b/engines/mortevielle/sprint.h
@@ -34,7 +34,6 @@ namespace Mortevielle {
 
 extern void fill_box(int x, int y, int dx);
 extern void clear_box(int x, int y, int dx);
-extern void writeg(Common::String l, int c);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index cd84b93..77da4a5 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -164,8 +164,6 @@ int x,
         prebru,
         typlec,
         num_ph,
-        xwhere,
-        ywhere,
         numpal,
         lderobj,
         nb_word,
@@ -236,27 +234,6 @@ void hirs() {
 }
 
 /**
- * Draws either a single pixel or a character to the screen
- */
-void affput(const Common::Point &pt, int palIndex, int ch) {
-	if (ch == 0)
-		g_vm->_screenSurface.setPixel(pt, palIndex);
-	else
-		g_vm->_screenSurface.writeCharacter(pt, ch, palIndex);
-}
-
-void affcar(int gd, int x, int y, int coul, int chr) {
-	if (res == 1)  
-		affput(Common::Point(((uint)x >> 1), y), coul, chr);
-	else 
-		affput(Common::Point(x, y), coul, chr);
-}
-
-void putpix(int gd, int x, int y, int coul) {
-	affput(Common::Point(x, y), coul, 0);
-}
-
-/**
  * Returns a substring of the given string
  * @param s		Source string
  * @param idx	Starting index (1 based)
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 2e2bf53..7399342 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -336,8 +336,6 @@ extern int x,
         prebru,
         typlec,
         num_ph,
-        xwhere,
-        ywhere,
         numpal,
         lderobj,
         nb_word,
@@ -399,11 +397,8 @@ extern byte adcfiec[822 * 128];
 /*---------------------------------------------------------------------------*/
 
 void hirs();
-void affcar(int gd, int x, int y, int coul, int chr);
-void putpix(int gd, int x, int y, int coul);
 Common::String copy(const Common::String &s, int idx, size_t size);
 void Val(const Common::String &s, int &V, int Code);
-void affput(const Common::Point &pt, int palIndex, int ch);
 
 /*---------------------------------------------------------------------------*/
 /*------------------------------     STUBS     ------------------------------*/


Commit: 26e67c4de0e3e791a3e8b5536912a40fe6f55bca
    https://github.com/scummvm/scummvm/commit/26e67c4de0e3e791a3e8b5536912a40fe6f55bca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:02-07:00

Commit Message:
MORTEVIELLE: Removed boite() stab and remap calls to ScreenSurface::drawBox

Changed paths:
  R engines/mortevielle/boite.cpp
  R engines/mortevielle/boite.h
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/boite.cpp b/engines/mortevielle/boite.cpp
deleted file mode 100644
index 7072085..0000000
--- a/engines/mortevielle/boite.cpp
+++ /dev/null
@@ -1,41 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/textconsole.h"
-#include "mortevielle/boite.h"
-#include "mortevielle/mortevielle.h"
-
-namespace Mortevielle {
-
-//Translation: box()
-void boite(int x, int y, int dx, int dy, int coul) {
-	debugC(1, kMortevielleCore, "TODO: boite is deprecated in favour of ScreenSurface::drawBox");
-
-	g_vm->_screenSurface.drawBox(x, y, dx, dy, coul);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/boite.h b/engines/mortevielle/boite.h
deleted file mode 100644
index bff3e82..0000000
--- a/engines/mortevielle/boite.h
+++ /dev/null
@@ -1,37 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_BOITE_H
-#define MORTEVIELLE_BOITE_H
-
-namespace Mortevielle {
-
-extern void boite(int x, int y, int dx, int dy, int coul);
-
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 28c6c7f..4d2072a 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -4,7 +4,6 @@ MODULE_OBJS := \
 	actions.o \
 	alert.o \
 	asm.o \
-	boite.o \
 	detection.o \
 	droite.o \
 	graphics.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 8978731..6e2d105 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -30,7 +30,6 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
-#include "mortevielle/boite.h"
 #include "mortevielle/droite.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
@@ -141,7 +140,8 @@ void initouv() {
 }
 
 void ecrf1() {
-	boite(0, 11, 512, 163, 15);           /* grand dessin */         //Translation: Large drawing
+	// Large drawing
+	g_vm->_screenSurface.drawBox(0, 11, 512, 163, 15);
 }
 
 void clsf1() {
@@ -199,11 +199,11 @@ void clsf2() {
 	hide_mouse();
 	if (f2_all) {
 		box(0, gd, 1, 176, 633, 199, 255);
-		boite(0, 175, 634, 24, 15);
+		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
 		f2_all = false;
 	} else {
 		box(0, gd, 1, 176, 633, 190, 255);
-		boite(0, 175, 634, 15, 15);
+		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
 	}
 	show_mouse();
 }
@@ -211,7 +211,7 @@ void clsf2() {
 void ecrf2() {
 	/* debug('ecrf2'); */
 	text_color(5);
-	/*boite(0,175,630,15,15);*/
+	/*g_vm->_screenSurface.drawBox(0,175,630,15,15);*/
 }
 
 void ecr2(Common::String str_) {
@@ -248,7 +248,7 @@ void clsf3() {
 	/* debug('clsf3'); */
 	hide_mouse();
 	box(0, gd, 1, 192, 633, 199, 255);
-	boite(0, 191, 634, 8, 15);
+	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
 	show_mouse();
 }
 
@@ -262,7 +262,7 @@ void ecr3(Common::String text) {
 void ecrf6() {
 	/* debug('ecrf6'); */
 	text_color(5);
-	boite(62, 33, 363, 80, 15);
+	g_vm->_screenSurface.drawBox(62, 33, 363, 80, 15);
 }
 
 void ecrf7() {
@@ -459,7 +459,7 @@ void f3f8() {
 	g_vm->_screenSurface.writeg(g_vm->getString(S_F3), 5);
 	g_vm->_screenSurface._textPos.y = 51;
 	g_vm->_screenSurface.writeg(g_vm->getString(S_F8), 5);
-	boite(0, 42, co, 16, 7);
+	g_vm->_screenSurface.drawBox(0, 42, co, 16, 7);
 }
 
 void t5(int cx) {
@@ -1321,10 +1321,10 @@ void dessin(int ad) {
 		clsf1();
 		if (caff > 99) {
 			dessine(ades, 60, 33);
-			boite(118, 32, 291, 121, 15);         /* cadre moyen */          //Translation: Medium box
+			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         /* cadre moyen */          //Translation: Medium box
 		} else if (caff > 69) {
 			dessine(ades, 112, 48);           /* tˆtes */                    //Translation: Heads
-			boite(222, 47, 155, 91, 15);
+			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
 			dessine(ades, 0, 12);
 			ecrf1();
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 515fd83..496ce64 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -27,7 +27,6 @@
 
 #include "mortevielle/mor2.h"
 #include "mortevielle/alert.h"
-#include "mortevielle/boite.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -190,7 +189,7 @@ void fenat(char ans) {
 		coul = 12;
 
 	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
-	boite(300, 191, 16, 8, 15);
+	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
 	show_mouse();
 }
 
@@ -308,7 +307,7 @@ void tperd() {
 		t11(21, cx);
 	g_vm->_loseGame = true;
 	clsf1();
-	boite(60, 35, 400, 50, 15);
+	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
 	repon(9, crep);
 	clsf2();
 	clsf3();
@@ -402,7 +401,7 @@ void sparl(float adr, float rep) {
 	deline(repint + c_paroles, st, tay);
 	afftex(st, 230, 4, 65, 24, 5);
 	f3f8();
-	/*boite(43,30,90,19,15);
+	/*g_vm->_screenSurface.drawBox(43,30,90,19,15);
 	gotoxy(7,5);
 	write('F3: Encore');
 	gotoxy(7,6);
@@ -451,7 +450,7 @@ void mennor() {
 
 void premtet() {
 	dessine(ades, 10, 80);
-	boite(18, 79, 155, 91, 15);
+	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 
 /* NIVEAU 5 */
@@ -499,7 +498,7 @@ void t1sama() {    /* On entre dans le manoir */                 //Translation:
 		affper(ipers);
 		caff = 77;
 		afdes(0);
-		boite(223, 47, 155, 91, 15);
+		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
 		tkey1(false);
 		mennor();
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index a223e49..924b378 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -26,7 +26,6 @@
  */
 
 #include "common/str.h"
-#include "mortevielle/boite.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
@@ -101,7 +100,7 @@ namespace Mortevielle {
 		coor[j + 1].etat = false;
 		if (res == 1)  rep = 10;
 		else rep = 6;
-		boite(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
+		g_vm->_screenSurface.drawBox(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
 		rep = 0;
 		j = 0;
 		memk = 0;


Commit: ccacc081598637e748176d4abbccaa9f6eeb3a4e
    https://github.com/scummvm/scummvm/commit/ccacc081598637e748176d4abbccaa9f6eeb3a4e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:04-07:00

Commit Message:
MORTEVIELLE: Fixed English strings for F3 and F8

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 773ddae..aff67dc 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -196,8 +196,8 @@ void writeEnglishStaticStrings() {
 
 		" Load",
 		" Restart     ",
-		"F3: More",
-		"F8: Restart",
+		"F3: Repeat",
+		"F8: Proceed",
 		"Hide self",
 		"take",
 		" probe    ",
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index 8e0171f..b2caafe 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: 5e86c7c4303bea7f368a3a58fe7df28e55bb19bb
    https://github.com/scummvm/scummvm/commit/5e86c7c4303bea7f368a3a58fe7df28e55bb19bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:05-07:00

Commit Message:
MORTEVIELLE: Fixed the F3/F8 box width to adjust to the text size

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e9c8c1e..ad42198 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1090,9 +1090,15 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 		pt.x += i;
 	}
 	show_mouse();
+}
+
+/**
+ * Gets the width in pixels of the specified string
+ */
+int ScreenSurface::getStringWidth(const Common::String &s) {
+	int charWidth = (res == 2) ? 6 : 10;
 
-	// TODO: Move screen updates to main loop once constructed
-	g_vm->_screenSurface.updateScreen();
+	return s.size() * charWidth;
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 258f4cf..b196fce 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -91,6 +91,7 @@ public:
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void writeg(const Common::String &l, int c);
+	int getStringWidth(const Common::String &s);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 6e2d105..ba480ce 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -451,15 +451,21 @@ void repon(int f, int m) {
 }
 
 void f3f8() {
-	int co;
+	Common::String f3 = g_vm->getString(S_F3);
+	Common::String f8 = g_vm->getString(S_F8);
 
-	if (res == 1)  co = 107;
-	else co = 64;
+	// Write the F3 and F8 text strings
 	g_vm->_screenSurface.putxy(3, 44);
-	g_vm->_screenSurface.writeg(g_vm->getString(S_F3), 5);
+	g_vm->_screenSurface.writeg(f3, 5);
 	g_vm->_screenSurface._textPos.y = 51;
-	g_vm->_screenSurface.writeg(g_vm->getString(S_F8), 5);
-	g_vm->_screenSurface.drawBox(0, 42, co, 16, 7);
+	g_vm->_screenSurface.writeg(f8, 5);
+
+	// Get the width of the written text strings
+	int f3Width = g_vm->_screenSurface.getStringWidth(f3);
+	int f8Width = g_vm->_screenSurface.getStringWidth(f8);
+
+	// Write out the bounding box
+	g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
 }
 
 void t5(int cx) {


Commit: c92e34877aa696de3e94fc4c3b980756e83d531e
    https://github.com/scummvm/scummvm/commit/c92e34877aa696de3e94fc4c3b980756e83d531e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:06-07:00

Commit Message:
MORTEVIELLE: Replace old calls to afff to use new decode/drawPicture methods

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ba480ce..dbecbc9 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1233,18 +1233,29 @@ void writetp(Common::String s, int t) {
 		g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
 }
 
+/**
+ * Shows the waiting message when changing scenes.
+ * @remarks	Because modern computesr are so much quicker. There's no point in showing
+ * a waiting message between scenes.
+ */
 void messint(int nu) {
-	/* debug('messint'); */
+	/*	Method is deprecated
 	clsf1();
 	clsf2();
 	clsf3();
-	decomp(0x73a2, 1008);
+
+	GfxSurface surface;
+	surface.decode(&mem[0x73a2 * 16 + 1008]);
+
 	WRITE_LE_UINT16(&mem[0x7413 * 16 + 12], 80);
 	WRITE_LE_UINT16(&mem[0x7413 * 16 + 14], 40);
 	writepal(90);
-	afff(gd, 0x73a2, 1008, 0, 0);
-	afff(gd, 0x73a2, 1008, 0, 70);
+
+	g_vm->_screenSurface.drawPicture(surface, 0, 0);
+	g_vm->_screenSurface.drawPicture(surface, 0, 70);
+
 	repon(7, nu);
+	*/
 }
 
 void aniof(int ouf, int num) {
@@ -1257,11 +1268,12 @@ void aniof(int ouf, int num) {
 		else if (num == 4)  num = 3;
 	ad = adani;
 	offset = animof(ouf, num);
-	decomp(ad, offset);
-	hide_mouse();
-	afff(gd, ad, offset, 0, 12);
+
+	GfxSurface surface;
+	surface.decode(&mem[ad * 16 + offset]);
+	g_vm->_screenSurface.drawPicture(surface, 0, 12);
+
 	ecrf1();
-	show_mouse();
 }
 
 void musique(int so) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 77da4a5..4872316 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -313,11 +313,6 @@ void decomp(int seg, int dep) {
 	debugC(1, kMortevielleCore, "TODO: decomp deprecated in faovur of GfxSurface::decode");
 }
 
-// (* external 'c:\mc\affich.com'; *)
-void afff(int Gd, int seg, int dep, int x, int y) {
-	warning("TODO: afff");
-}
-
 // (* external 'c:\mc\reusint.com'; *)
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 7399342..e0b0480 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -437,8 +437,6 @@ extern void s_sauv(int Gd, int y, int dy);
 extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
 // (* external 'c:\mc\decomp.com'; *)
 extern void decomp(int seg, int dep); 
-// (* external 'c:\mc\affich.com'; *)
-extern void afff(int Gd, int seg, int dep, int x, int y); 
 
 } // End of namespace Mortevielle
 


Commit: 597ddc1b4dc02e9fd6c0993d6bae42224ca68af5
    https://github.com/scummvm/scummvm/commit/597ddc1b4dc02e9fd6c0993d6bae42224ca68af5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:08-07:00

Commit Message:
MORTEVIELLE: Added CHECK_QUIT to afdes() event loop

Changed paths:
    engines/mortevielle/mor2.cpp



diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 496ce64..71546e9 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -213,6 +213,7 @@ void tkey1(bool d) {
 		if (d)  tinke();
 		quest = keypressed();
 		read_pos_mouse(x, y, c);
+		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && anyone)));
 	if (quest)  key = testou();
 	g_vm->setMouseClick(false);


Commit: 4d1a59db62603735e31a802ece5dc940fbbd3f66
    https://github.com/scummvm/scummvm/commit/4d1a59db62603735e31a802ece5dc940fbbd3f66
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:09-07:00

Commit Message:
MORTEVIELLE: Add comments to the deprecated s_char method

Changed paths:
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 4872316..9b735bd 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -297,9 +297,13 @@ void palette(int v1) {
 	warning("TODO: palette");
 }
 
-// (* external 'c:\mc\charecr.com'; *)
+/**
+ * Restore a screen area
+ * @remarks	Currently implemented differently in ScummVM, so this method is redundant.
+ * Original assembly was present in 'charecr.asm'
+ */
 void s_char(int Gd, int y, int dy) {
-		warning("TODO: s_char");
+	debugC(1, kMortevielleCore, "s_char called");
 }
 
 // (* external 'c:\mc\boite.com'; *)


Commit: fc7ce54c745986af664cb26a804b4ebe58102631
    https://github.com/scummvm/scummvm/commit/fc7ce54c745986af664cb26a804b4ebe58102631
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:10-07:00

Commit Message:
MORTEVIELLE: Replaced all box() calls with ScreenSurface::fillBox

Changed paths:
    engines/mortevielle/alert.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/sprint.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 73befd9..8f2ff4f 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -100,9 +100,9 @@ static void fait_boite(int lidep, int nli, int tx) {
 	y = pred(int, lidep) << 3;
 	xx = x + tx;
 	yy = y + (nli << 3);
-	box(15, gd, x, y, xx, yy, 255);
-	box(0, gd, x, y + 2, xx, y + 4, 255);
-	box(0, gd, x, yy - 4, xx, yy - 2, 255);
+	g_vm->_screenSurface.fillBox(15, Common::Rect(x, y, xx, yy));
+	g_vm->_screenSurface.fillBox(0, Common::Rect(x, y + 2, xx, y + 4));
+	g_vm->_screenSurface.fillBox(0, Common::Rect(x, yy - 4, xx, yy - 2));
 }
 
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index ad42198..3ac08cf 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1006,16 +1006,12 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
  * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
-void ScreenSurface::fillBox(int colour, const Common::Rect &bounds, int patt) {
+void ScreenSurface::fillBox(int colour, const Common::Rect &bounds) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2,
 		bounds.right, bounds.bottom * 2));
 	
 	// Fill the area
 	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), colour);
-
-	// TODO: Figure out what effect patterns of other than '0xff' have
-	if (patt != 0xff)
-		warning("TODO: Figure out operation of ScreenSurface::box when pattern is %xh", patt);
 }
 
 /**
@@ -1065,7 +1061,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	case 1:
 	case 3  : {
 		cecr = 0;
-		box(15, gd, pt.x, pt.y, x, pt.y + 7, 255);
+		g_vm->_screenSurface.fillBox(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 	}
 	break;
 	case 4 : {
@@ -1079,7 +1075,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	case 0:
 	case 2 : {
 		cecr = 15;
-		box(0, gd, pt.x, pt.y, x, pt.y + 7, 255);
+		g_vm->_screenSurface.fillBox(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 	}
 	break;
 	}
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index b196fce..38f2ac3 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -87,7 +87,7 @@ public:
 	void copyFrom(Graphics::Surface &src, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
-	void fillBox(int colour, const Common::Rect &bounds, int patt);
+	void fillBox(int colour, const Common::Rect &bounds);
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void writeg(const Common::String &l, int c);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 07626b3..71b0ccf 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -146,7 +146,7 @@ void menu_aff() {
 	     clrscr;
 	     halt;
 	   end;*/
-	box(7, gd, 0, 0, 639, 10, 255);
+	g_vm->_screenSurface.fillBox(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
 	if (gd == cga)  color = 1;
 	else color = 9;
@@ -278,9 +278,9 @@ void menu_down(int ii) {
 	if (res == 1)  cx = 10;
 	else cx = 6;
 	xcc = xco + (don[ii][3] * cx) + 6;
-	box(15, gd, xco, 12, xcc, 10 + (don[ii][2] << 1), 255);
-	box(0, gd, xcc, 12, xcc + 4, 10 + (don[ii][2] << 1), 255);
-	box(0, gd, xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1), 255);
+	g_vm->_screenSurface.fillBox(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
+	g_vm->_screenSurface.fillBox(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
+	g_vm->_screenSurface.fillBox(0, Common::Rect(xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1)));
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index dbecbc9..ea9012e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -149,7 +149,7 @@ void clsf1() {
 
 	/* debug('clsf1'); */
 	hide_mouse();
-	box(0, gd, 0, 11, 514, 175, 255);
+	g_vm->_screenSurface.fillBox(0, Common::Rect(0, 11, 514, 175));
 	/* if Gd=ams then port[$3DD]:=15;
 	 case Gd of
 	         ams,
@@ -198,11 +198,11 @@ void clsf2() {
 	/* debug('clsf2'); */
 	hide_mouse();
 	if (f2_all) {
-		box(0, gd, 1, 176, 633, 199, 255);
+		g_vm->_screenSurface.fillBox(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
 		f2_all = false;
 	} else {
-		box(0, gd, 1, 176, 633, 190, 255);
+		g_vm->_screenSurface.fillBox(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
 	}
 	show_mouse();
@@ -247,7 +247,7 @@ void clsf3() {
 
 	/* debug('clsf3'); */
 	hide_mouse();
-	box(0, gd, 1, 192, 633, 199, 255);
+	g_vm->_screenSurface.fillBox(0, Common::Rect(1, 192, 633, 199));
 	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
 	show_mouse();
 }
@@ -285,7 +285,7 @@ void clsf10() {
 		co = 600;
 		cod = 544;
 	}
-	box(15, gd, cod, 93, co, 98, 255);
+	g_vm->_screenSurface.fillBox(15, Common::Rect(cod, 93, co, 98));
 	if (s.conf < 33)
 		st = g_vm->getString(S_COOL);
 	else if (s.conf < 66)
@@ -300,7 +300,7 @@ void clsf10() {
 	g_vm->_screenSurface.writeg(st, 4);
 	if (res == 1)  co = 620;
 	else co = 584;
-	box(15, gd, 560, 24, co, 86, 255);
+	g_vm->_screenSurface.fillBox(15, Common::Rect(560, 24, co, 86));
 	/* rempli(69,12,32,5,255);*/
 	show_mouse();
 }
@@ -319,7 +319,7 @@ void paint_rect(int x, int y, int dx, int dy) {
 	/* debug('paint_rect'); */
 	if (gd == cga)  co = 3;
 	else co = 11;
-	box(co, gd, x, y, x + dx, y + dy, 255);
+	g_vm->_screenSurface.fillBox(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
 int hazard(int min, int max) {
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 924b378..5453500 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -63,7 +63,7 @@ namespace Mortevielle {
 		deline(ta[i], st, tay);
 		if (res == 1)  y = 29;
 		else y = 23;
-		box(15, gd, 0, 14, 630, y, 255);
+		g_vm->_screenSurface.fillBox(15, Common::Rect(0, 14, 630, y));
 		afftex(st, 20, 15, 100, 2, 0);
 		if (i != 10) {
 			prem = ta[i] + 1;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
index 6a52b2c..e6d0035 100644
--- a/engines/mortevielle/sprint.cpp
+++ b/engines/mortevielle/sprint.cpp
@@ -35,11 +35,13 @@
 namespace Mortevielle {
 
 void fill_box(int x, int y, int dx) {
-	box(15, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
+	g_vm->_screenSurface.fillBox(15, Common::Rect(pred(int, x) << 3, pred(int, y) << 3, 
+		pred(int, x + dx) << 3, y << 3));
 }
 
 void clear_box(int x, int y, int dx) {
-	box(0, gd, pred(int, x) << 3, pred(int, y) << 3, pred(int, x + dx) << 3, y << 3, 255);
+	g_vm->_screenSurface.fillBox(0, Common::Rect(pred(int, x) << 3, pred(int, y) << 3, 
+		pred(int, x + dx) << 3, y << 3));
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9b735bd..1fc18e7 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -306,17 +306,6 @@ void s_char(int Gd, int y, int dy) {
 	debugC(1, kMortevielleCore, "s_char called");
 }
 
-// (* external 'c:\mc\boite.com'; *)
-void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
-	debugC(1, kMortevielleCore, "TODO: box deprecated in favour of GfxSurface::fillBox");
-	g_vm->_screenSurface.fillBox(c, Common::Rect(xo, yo, xi, yi), patt);
-}
-
-// (* external 'c:\mc\decomp.com'; *)
-void decomp(int seg, int dep) {
-	debugC(1, kMortevielleCore, "TODO: decomp deprecated in faovur of GfxSurface::decode");
-}
-
 // (* external 'c:\mc\reusint.com'; *)
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index e0b0480..5f13a25 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -433,10 +433,6 @@ extern int get_random_number(int minval, int maxval);
 extern void s_char(int Gd, int y, int dy);
 // (* external 'c:\mc\sauvecr.com'; *)
 extern void s_sauv(int Gd, int y, int dy);
-// (* external 'c:\mc\boite.com'; *)
-extern void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt);
-// (* external 'c:\mc\decomp.com'; *)
-extern void decomp(int seg, int dep); 
 
 } // End of namespace Mortevielle
 


Commit: 92bc850416c1cff80287a2fb45033cec361fb3e2
    https://github.com/scummvm/scummvm/commit/92bc850416c1cff80287a2fb45033cec361fb3e2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:12-07:00

Commit Message:
MORTEVIELLE: Removed unused clear_box() and fill_box(), and renamed fillBox to fillRect

Changed paths:
  R engines/mortevielle/sprint.cpp
  R engines/mortevielle/sprint.h
    engines/mortevielle/alert.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 8f2ff4f..6eb7d5e 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -30,7 +30,6 @@
 #include "mortevielle/level15.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
-#include "mortevielle/sprint.h"
 
 namespace Mortevielle {
 
@@ -100,9 +99,9 @@ static void fait_boite(int lidep, int nli, int tx) {
 	y = pred(int, lidep) << 3;
 	xx = x + tx;
 	yy = y + (nli << 3);
-	g_vm->_screenSurface.fillBox(15, Common::Rect(x, y, xx, yy));
-	g_vm->_screenSurface.fillBox(0, Common::Rect(x, y + 2, xx, y + 4));
-	g_vm->_screenSurface.fillBox(0, Common::Rect(x, yy - 4, xx, yy - 2));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
 }
 
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3ac08cf..bdf6c86 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1006,7 +1006,7 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
  * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
-void ScreenSurface::fillBox(int colour, const Common::Rect &bounds) {
+void ScreenSurface::fillRect(int colour, const Common::Rect &bounds) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2,
 		bounds.right, bounds.bottom * 2));
 	
@@ -1061,7 +1061,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	case 1:
 	case 3  : {
 		cecr = 0;
-		g_vm->_screenSurface.fillBox(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		g_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 	}
 	break;
 	case 4 : {
@@ -1075,7 +1075,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	case 0:
 	case 2 : {
 		cecr = 15;
-		g_vm->_screenSurface.fillBox(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		g_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 	}
 	break;
 	}
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 38f2ac3..1daad57 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -87,7 +87,7 @@ public:
 	void copyFrom(Graphics::Surface &src, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
-	void fillBox(int colour, const Common::Rect &bounds);
+	void fillRect(int colour, const Common::Rect &bounds);
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void writeg(const Common::String &l, int c);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 71b0ccf..12ccbe3 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -32,7 +32,6 @@
 #include "mortevielle/menu.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
-#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -146,7 +145,7 @@ void menu_aff() {
 	     clrscr;
 	     halt;
 	   end;*/
-	g_vm->_screenSurface.fillBox(7, Common::Rect(0, 0, 639, 10));
+	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
 	if (gd == cga)  color = 1;
 	else color = 9;
@@ -278,9 +277,9 @@ void menu_down(int ii) {
 	if (res == 1)  cx = 10;
 	else cx = 6;
 	xcc = xco + (don[ii][3] * cx) + 6;
-	g_vm->_screenSurface.fillBox(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
-	g_vm->_screenSurface.fillBox(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
-	g_vm->_screenSurface.fillBox(0, Common::Rect(xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1)));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1)));
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 4d2072a..0688fd5 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -22,7 +22,6 @@ MODULE_OBJS := \
 	ques.o \
 	saveload.o \
 	sound.o \
-	sprint.o \
 	taffich.o \
 	var_mor.o
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ea9012e..2f48999 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -38,7 +38,6 @@
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/parole2.h"
-#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -149,7 +148,7 @@ void clsf1() {
 
 	/* debug('clsf1'); */
 	hide_mouse();
-	g_vm->_screenSurface.fillBox(0, Common::Rect(0, 11, 514, 175));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
 	/* if Gd=ams then port[$3DD]:=15;
 	 case Gd of
 	         ams,
@@ -198,11 +197,11 @@ void clsf2() {
 	/* debug('clsf2'); */
 	hide_mouse();
 	if (f2_all) {
-		g_vm->_screenSurface.fillBox(0, Common::Rect(1, 176, 633, 199));
+		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
 		f2_all = false;
 	} else {
-		g_vm->_screenSurface.fillBox(0, Common::Rect(1, 176, 633, 190));
+		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
 	}
 	show_mouse();
@@ -247,7 +246,7 @@ void clsf3() {
 
 	/* debug('clsf3'); */
 	hide_mouse();
-	g_vm->_screenSurface.fillBox(0, Common::Rect(1, 192, 633, 199));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
 	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
 	show_mouse();
 }
@@ -285,7 +284,7 @@ void clsf10() {
 		co = 600;
 		cod = 544;
 	}
-	g_vm->_screenSurface.fillBox(15, Common::Rect(cod, 93, co, 98));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
 	if (s.conf < 33)
 		st = g_vm->getString(S_COOL);
 	else if (s.conf < 66)
@@ -300,7 +299,7 @@ void clsf10() {
 	g_vm->_screenSurface.writeg(st, 4);
 	if (res == 1)  co = 620;
 	else co = 584;
-	g_vm->_screenSurface.fillBox(15, Common::Rect(560, 24, co, 86));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, co, 86));
 	/* rempli(69,12,32,5,255);*/
 	show_mouse();
 }
@@ -319,7 +318,7 @@ void paint_rect(int x, int y, int dx, int dy) {
 	/* debug('paint_rect'); */
 	if (gd == cga)  co = 3;
 	else co = 11;
-	g_vm->_screenSurface.fillBox(co, Common::Rect(x, y, x + dx, y + dy));
+	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
 int hazard(int min, int max) {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e7d7551..4f2cade 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -29,7 +29,6 @@
 #include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 #include "common/str.h"
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 7deda53..df79b72 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -37,7 +37,6 @@
 #include "mortevielle/ovd1.h"
 #include "mortevielle/parole.h"
 #include "mortevielle/sound.h"
-#include "mortevielle/sprint.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 5453500..1792195 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -31,7 +31,6 @@
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ques.h"
-#include "mortevielle/sprint.h"
 
 namespace Mortevielle {
 
@@ -63,7 +62,7 @@ namespace Mortevielle {
 		deline(ta[i], st, tay);
 		if (res == 1)  y = 29;
 		else y = 23;
-		g_vm->_screenSurface.fillBox(15, Common::Rect(0, 14, 630, y));
+		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, y));
 		afftex(st, 20, 15, 100, 2, 0);
 		if (i != 10) {
 			prem = ta[i] + 1;
diff --git a/engines/mortevielle/sprint.cpp b/engines/mortevielle/sprint.cpp
deleted file mode 100644
index e6d0035..0000000
--- a/engines/mortevielle/sprint.cpp
+++ /dev/null
@@ -1,47 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/str.h"
-#include "common/textconsole.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/sprint.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void fill_box(int x, int y, int dx) {
-	g_vm->_screenSurface.fillBox(15, Common::Rect(pred(int, x) << 3, pred(int, y) << 3, 
-		pred(int, x + dx) << 3, y << 3));
-}
-
-void clear_box(int x, int y, int dx) {
-	g_vm->_screenSurface.fillBox(0, Common::Rect(pred(int, x) << 3, pred(int, y) << 3, 
-		pred(int, x + dx) << 3, y << 3));
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/sprint.h b/engines/mortevielle/sprint.h
deleted file mode 100644
index 09d5758..0000000
--- a/engines/mortevielle/sprint.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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_SPRINT_H
-#define MORTEVIELLE_SPRINT_H
-
-#include "common/str.h"
-
-namespace Mortevielle {
-
-extern void fill_box(int x, int y, int dx);
-extern void clear_box(int x, int y, int dx);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 1fc18e7..7b61562 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -29,7 +29,6 @@
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/sprint.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {


Commit: b269c8811a3c6faf9a3221d664ba3098d6917ced
    https://github.com/scummvm/scummvm/commit/b269c8811a3c6faf9a3221d664ba3098d6917ced
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:13-07:00

Commit Message:
MORTEVIELLE: Removed all the code that was commented out in the original source

Changed paths:
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/ques.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 4eba4c4..a330a38 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -49,28 +49,6 @@ int testou() {
 	case '\23' :
 		sonoff = ! sonoff;
 		break;
-	/* Prevent changing graphics mode
-	case '\1':
-	case '\3':
-	case '\5'  : {
-		newgd = (uint)pred(int, ord(ch)) >> 1;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	case '\10'  : {
-		newgd = her;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	case '\24' : {
-		newgd = tan;
-		testou_result = 61;
-		return testou_result;
-	}
-	break;
-	*/
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index c017bf2..8d89767 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -112,12 +112,6 @@ void pictout(int seg, int dep, int x, int y) {
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
 
-/*
-function calad(x,y:int):int;
-   begin
-     calad:=pred(x)+320*pred(y)
-   end;
-  */
 void sauvecr(int y, int dy) {
 	hide_mouse();
 	s_sauv(gd, y, dy);
@@ -129,28 +123,6 @@ void charecr(int y, int dy) {
 	s_char(gd, y, dy);
 	show_mouse();
 }
-/*
-function peek(ad:int):int;
-begin
-  peek:=tabdon[ad];
-end;
-
-function peekw(ad:int):int;
-begin
-  peekw:=tabdon[ad] shl 8+tabdon[succ(ad)];
-end;
-
-function peekl(ad:int):real;
-begin
-  peekl:=tabdon[ad+3]+tabdon[ad+2] shl 8;
-end;
-
-
-procedure poke (ad,n:int);
-begin
-  tabdon[ad]:=lo(n);
-end;
-  */
 
 void adzon() {
 	Common::File f;
@@ -186,15 +158,4 @@ int animof(int ouf, int num) {
 	return animof_result;
 }
 
-/*procedure affgd(offs,dep,x,y:int);
-begin
-  case Gd of
-     Ams : affams(offs,dep,x,y);
-     Cga : affcga(offs,dep,x,y);
-     Ega : affega(offs,dep,x,y);
-     Her : affher(offs,dep,x,y);
-     Tan : afftan(offs,dep,x,y);
-  end;
-end;*/
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 2f48999..36e23bf 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -656,8 +656,7 @@ void pendule() {
 
 	/* debug('pendule'); */
 	hide_mouse();
-	/*paint_rect(572,114,18,20);
-	paint_rect(577,114,6,20);*/
+	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
 	if ((gd == cga) || (gd == her))
@@ -1238,23 +1237,7 @@ void writetp(Common::String s, int t) {
  * a waiting message between scenes.
  */
 void messint(int nu) {
-	/*	Method is deprecated
-	clsf1();
-	clsf2();
-	clsf3();
-
-	GfxSurface surface;
-	surface.decode(&mem[0x73a2 * 16 + 1008]);
-
-	WRITE_LE_UINT16(&mem[0x7413 * 16 + 12], 80);
-	WRITE_LE_UINT16(&mem[0x7413 * 16 + 14], 40);
-	writepal(90);
-
-	g_vm->_screenSurface.drawPicture(surface, 0, 0);
-	g_vm->_screenSurface.drawPicture(surface, 0, 70);
-
-	repon(7, nu);
-	*/
+	// Method is deprecated
 }
 
 void aniof(int ouf, int num) {
@@ -1278,7 +1261,6 @@ void aniof(int ouf, int num) {
 void musique(int so) {
 	bool i;
 	int haz;
-	/* dep: array[1..5] of float;*/
 
 	/* debug('musique'); */
 	if (so == 0) { /*musik(0)*/
@@ -1315,13 +1297,6 @@ void musique(int so) {
 			i = true;
 		}
 		if (! i) {
-			/* dep[1]:= 1416;
-			 dep[2]:= 1512;
-			 dep[3]:= 1692;
-			 dep[4]:= 1884;
-			 dep[5]:= 2046;
-			 haz:= hazard(1,5);
-			 musik(dep[haz]);*/
 			haz = hazard(1, 17);
 			parole(haz, 1, 2);
 		}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 71546e9..5d9d9b2 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -677,9 +677,7 @@ void tcoord(int sx)
 		atdon = atdon + 4;
 		cy = succ(int, cy);
 	}
-	/*     for cy:=0 to caff-1 do
-	          a:=a+ tabdon[amzon+3+4*cy];
-	     b:= peek(amzon+3+4*caff); */
+
 	b = tabdon[atdon];
 	if (b == 0)  goto L1;
 	a = a + fleche;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4cbc2b4..026f17d 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,9 +134,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	/*init_debug;*/
-	/*  ecri_seg;*/
-	//pio_initialize(argc, argv);
 	gd = ega;
 	newgd = gd;
 	zuul = false;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 631be60..51af36b 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -49,14 +49,13 @@ int s_s[12][6];
 
 
 void init_mouse() {
-//	int i, j;
 	registres reg;
 
 	mouse_shwn = 0;
 	x_s = 0;
 	y_s = 0;
 	p_o_s = 0;
-	/*int_m:= False;*/
+	
 	g_vm->setMouseClick(false);
 	m_show = m_arrow;
 	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))  int_m = false;
@@ -75,21 +74,6 @@ void init_mouse() {
 	}
 }
 
-/*procedure change_mouse( t : int );
-begin
-  m_show:= t;
-end;*/
-
-/*procedure dessine_souris(xf,yf:int);
-  var x, xx, y :int;
-begin
-  case m_show of
-             m_arrow : begin
-                         affput(2,Gd,xf,yf,0,0);
-                       end;
-  end;
-end;  */
-
 void hide_mouse() {
 	int i, j, k, ps;;
 	bool imp;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index df79b72..6650dd0 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -45,25 +45,11 @@ namespace Mortevielle {
 // For ScummVM, we need to do check for file errors where we do the file access
 const int ioresult = 0;
 
+/**
+ * Check for disk 2 being in the drive
+ */
 void dem2() {
-	/* Deprecated check for disk 2
-
-	untyped_file f;
-	int k;
-
-	// -- demande de disk 2 --
-	while (ioresult != 0);
-	assign(f, "mort.001");
-	//$i-
-	reset(f);
-	while (ioresult != 0) {
-		show_mouse();
-		k = do_alert(al_mess2, 1);
-		hide_mouse();
-		reset(f);
-	}
-	close(f);
-	*/
+	// Deprecated under ScummVM
 }
 
 void ani50() {
@@ -75,15 +61,6 @@ void ani50() {
 	repon(2, c_paroles + 143);
 }
 
-/*overlay procedure apzuul;
-  begin
-    if (c_zzz=1) or (c_zzz=2) then
-     begin
-       zzuul(adcfiec+161,0,1644);
-       c_zzz:=succ(c_zzz);
-     end;
-  end;*/
-
 /* overlay */ void aff50(bool c) {
 	caff = 50;
 	maff = 0;
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index ba43b59..2a89841 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -128,8 +128,7 @@ void veracf(byte b) {
 		error("Missing file - sonmus.mor");
 	
 	f.read(&mem[0x7414 * 16 + 0], 273);
-	/*blockread(f,mem[adson * 16+0],300);
-	blockread(f,mem[adson * 16+2400+0],245);*/
+
 	g_vm->_soundManager.demus(&mem[0x7414 * 16], &mem[adson * 16], 273);
 	f.close();
 }
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index 1792195..aadedbd 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -113,13 +113,11 @@ namespace Mortevielle {
 			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
 			if (coor[k].etat) {
 				if ((memk != 0) && (memk != k)) {
-					/*DeLine(T_rec[ta[i]+memk].indis,T_rec[ta[i]+memk].point,st,tay);*/
 					for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
 					st[1 + tmax] = '$';
 					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				}
 				if (memk != k) {
-					/*DeLine(T_rec[pred(prem)+k].indis,T_rec[pred(prem)+k].point,st,tay);*/
 					for (j = 1; j <= tmax; j ++) st[j] = chaines[k][j];
 					st[1 + tmax] = '$';
 					afftex(st, 100, 27 + k * 8, 100, 1, 1);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 7b61562..5c72961 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -174,7 +174,7 @@ int x,
 
 int t_cph[6401];
 byte tabdon[4001];
-/*   t_dxx  : array[0..121] of int;*/
+
 Common::String stpou;               /* donne le % d'indices */ //Translation: "Provides the % of hints"
 byte is;
 char mode;


Commit: d79dc3baffb4c33f73a188343ac747ab7839dcc9
    https://github.com/scummvm/scummvm/commit/d79dc3baffb4c33f73a188343ac747ab7839dcc9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:14-07:00

Commit Message:
MORTEVIELLE: Remove more code that had been commented out in the original source

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/droite.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index f3bc31b..adcb17b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -862,7 +862,7 @@ L2:
 					x = (hazard(0, 10)) - 5;
 					parole(7, x, 1);
 					aniof(1, 1);
-					/*       tkey(5,32000);*/
+					
 					tip(z, x);
 					s.conf = s.conf + 1;
 					s.mlieu = 15;
@@ -882,7 +882,7 @@ L2:
 				x = (hazard(0, 10)) - 5;
 				parole(7, x, 1);
 				aniof(1, 1);
-				/*      tkey(1,32000);*/
+				
 				s.mlieu = ment;
 				affrep();
 				debloc(s.mlieu);
@@ -1069,7 +1069,6 @@ L2:
 			mov_mouse(f, tou);
 			CHECK_QUIT;
 
-			/*     if keypressed then read(kbd,tou);*/
 			read_pos_mouse(x, y, c);
 			x = x * (3 - res);
 			if (x > 319)  cx = 41;
diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
index c0a48a5..fc52ff7 100644
--- a/engines/mortevielle/droite.cpp
+++ b/engines/mortevielle/droite.cpp
@@ -41,7 +41,7 @@ void droite(int x, int y, int xx, int yy, int coul) {
 	yr = y;
 	xro = xx;
 	yro = yy;
-	/*writeln(le_file,'(',x:4,',',y:4,') ==> (',xx:4,',',yy:4,')');*/
+	
 	if (abs(y - yy) > abs(x - xx)) {
 		a = (float)((x - xx)) / (y - yy);
 		b = (yr * xro - yro * xr) / (y - yy);
@@ -52,7 +52,6 @@ void droite(int x, int y, int xx, int yy, int coul) {
 			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
 			i = i + step;
 		} while (!(i == yy));
-		/*writeln(le_file,'X == ',a:3:3,' * Y + ',b:3:3);*/
 	} else {
 		a = (float)((y - yy)) / (x - xx);
 		b = ((yro * xr) - (yr * xro)) / (x - xx);
@@ -63,7 +62,6 @@ void droite(int x, int y, int xx, int yy, int coul) {
 			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
 			i = i + step;
 		} while (!(i == xx));
-		/*writeln(le_file,'Y == ',a:3:3,' * X + ',b:3:3);*/
 	}
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 36e23bf..2d4df26 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -144,50 +144,10 @@ void ecrf1() {
 }
 
 void clsf1() {
-//	int i, j;
-
 	/* debug('clsf1'); */
 	hide_mouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
-	/* if Gd=ams then port[$3DD]:=15;
-	 case Gd of
-	         ams,
-	         cga : begin
-	                 for j:=0 to 63 do
-	                    begin
-	                      for i:=6 to 86 do
-	                         begin
-	                           mem[$B800:i*80+j]:=0;
-	                           mem[$Ba00:i*80+j]:=0;
-	                         end;
-	                      mem[$b800:6960+j]:=0;
-	                      mem[$ba00:400+j]:=0;
-	                    end;
-	               end;
-	         ega : begin
-	                 port[$3C4]:= 2;
-	                 port[$3C5]:= 15;
-	                 port[$3CE]:= 8;
-	                 port[$3CF]:= 255;
-	                 for j:=0 to 63 do
-	                    for i:=11 to 174 do
-	                       mem[$A000:i*80+j]:=0;
-	               end;
-	         tan : begin
-	                 for j:=0 to 128 do
-	                    begin
-	                      for i:=3 to 43 do
-	                         begin
-	                           mem[$B800:i*160+j]:=0;
-	                           mem[$Ba00:i*160+j]:=0;
-	                           mem[$bc00:i*160+j]:=0;
-	                           if i<>43 then mem[$be00:i*160+j]:=0;
-	                         end;
-	                      mem[$be00:320+j]:=0;
-	                    end;
-	               end;
-	 end;
-	 droite(256*res,11,256*res,175,0);*/
+
 	show_mouse();
 }
 
@@ -208,9 +168,7 @@ void clsf2() {
 }
 
 void ecrf2() {
-	/* debug('ecrf2'); */
 	text_color(5);
-	/*g_vm->_screenSurface.drawBox(0,175,630,15,15);*/
 }
 
 void ecr2(Common::String str_) {
@@ -266,9 +224,6 @@ void ecrf6() {
 
 void ecrf7() {
 	text_color(4);
-	/* draw_mode(2);
-	 text_height(4*res);
-	 text_style(normal);*/
 }
 
 void clsf10() {
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 5d9d9b2..5d33175 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -402,11 +402,7 @@ void sparl(float adr, float rep) {
 	deline(repint + c_paroles, st, tay);
 	afftex(st, 230, 4, 65, 24, 5);
 	f3f8();
-	/*g_vm->_screenSurface.drawBox(43,30,90,19,15);
-	gotoxy(7,5);
-	write('F3: Encore');
-	gotoxy(7,6);
-	write('F8: Stop');*/
+	
 	key = 0;
 	do {
 		parole(repint, haut[caff - 69], 0);
@@ -428,19 +424,11 @@ void finfouil() {
 void mfoudi() {
 	int cx;
 
-	for (cx = 1; cx <= 7; cx ++) menu_disable(depl[cx]);
-	for (cx = 1; cx <= 11; cx ++) menu_disable(men[cx]);
-	/* menu_disable(menup, scacher);
-	 menu_disable(menup, attacher);
-	 menu_disable(menup, defoncer);
-	 menu_disable(menup, dormir);
-	 menu_disable(menup, entrer);
-	 menu_disable(menup, fermer);
-	 menu_disable(menup, frapper);
-	 menu_disable(menup, manger);
-	 menu_disable(menup, mettre);
-	 menu_disable(menup, ouvrir);
-	 menu_disable(menup, sortir);  */
+	for (cx = 1; cx <= 7; cx ++) 
+		menu_disable(depl[cx]);
+	for (cx = 1; cx <= 11; cx ++)
+		menu_disable(men[cx]);
+
 	menut(sonder, g_vm->getString(S_SUITE));
 	menut(soulever, g_vm->getString(S_STOP));
 }
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 55fdbb7..a9f727a 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -219,19 +219,4 @@ void taffich() {
 	}
 }
 
-/*    begin
-      for i:=0 to 15 do
-         begin
-           PalH:=WRITE_LE_UINT16(&mem[$7000:succ(i) shl 1];
-           Alllum[i]:=PalH and 15 + PalH shr 4 and 15 + PalH shr 8 and 15;
-         end;
-      for i:=0 to 15 do
-         begin
-           k:=0;
-           for j:=0 to 15 do if Alllum[j]>Alllum[k] then k:=j;
-           mem[$7000:2+k shl 1]:= Rang[i];
-           Alllum[k]:=-1;
-         end;
-    end;*/
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5f13a25..a872af1 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -347,7 +347,7 @@ extern int x,
 
 extern int t_cph[6401];
 extern byte tabdon[4001];
-/*   t_dxx  : array[0..121] of int;*/
+
 extern Common::String stpou;                               /* donne le % d'indices */
 extern byte is;
 extern char mode;


Commit: f78ac771e321fee3a852f50c87d79c3d9eb687cd
    https://github.com/scummvm/scummvm/commit/f78ac771e321fee3a852f50c87d79c3d9eb687cd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:15-07:00

Commit Message:
MORTEVIELLE: Remove all the overlay comments

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/alert.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/ques.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index adcb17b..5b2f437 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,7 +42,7 @@
 
 namespace Mortevielle {
 
-/* overlay */
+
 void taller() {
 	//int mx, cx, cy;
 	int cx;
@@ -134,7 +134,7 @@ L2:
 	tmlieu(s.mlieu);
 }
 
-/* overlay */ void tprendre() {
+void tprendre() {
 	//int cx, cy, cz;
 	int cx;
 
@@ -230,7 +230,7 @@ L2:
 	}
 }
 
-/* overlay */ void tsprendre() {
+void tsprendre() {
 	int cx, cy, cz;
 
 	cx = 0;
@@ -251,7 +251,7 @@ L2:
 	clsf2();
 }
 
-/* overlay */ void tsoulever()
+void tsoulever()
 
 {
 	int cx;
@@ -278,7 +278,7 @@ L2:
 	if (crep == 255)  crep = 997;
 }
 
-/* overlay */ void tlire() {
+void tlire() {
 //	int iaff;
 
 	if (caff > 99)  st4(caff);
@@ -294,12 +294,12 @@ L2:
 	}
 }
 
-/* overlay */ void tslire() {
+void tslire() {
 	if (s.derobj == 0)  crep = 186;
 	else st4(s.derobj);
 }
 
-/* overlay */ void tregarder() {
+void tregarder() {
 	int cx;
 
 	if (caff > 99) {
@@ -355,12 +355,12 @@ L2:
 	if ((s.mlieu == 10) && (num == 3))  treg(31);
 }
 
-/* overlay */ void tsregarder() {
+void tsregarder() {
 	if (s.derobj != 0)  treg(s.derobj);
 	else crep = 186;
 }
 
-/* overlay */ void tfouiller() {
+void tfouiller() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 	int cx;
 
@@ -428,12 +428,12 @@ L2:
 	}
 }
 
-/* overlay */ void tsfouiller() {
+void tsfouiller() {
 	if (s.derobj != 0)  st7(s.derobj);
 	else crep = 186;
 }
 
-/* overlay */ void touvrir() {
+void touvrir() {
 	int cx, haz;
 
 	if (!syn)
@@ -487,7 +487,7 @@ L2:
 	}
 }
 
-/* overlay */ void tmettre() {
+void tmettre() {
 	int quel;
 	bool entre;
 	char st[1410];
@@ -591,7 +591,7 @@ L2:
 	}
 }
 
-/* overlay */ void ttourner() {
+void ttourner() {
 	int quel;
 
 	if (caff > 99) {
@@ -626,7 +626,7 @@ L2:
 	}
 }
 
-/* overlay */ void tcacher() {
+void tcacher() {
 	if (!syn)
 		ecr3(g_vm->getString(S_HIDE_SELF));
 	tfleche();
@@ -640,7 +640,7 @@ L2:
 	}
 }
 
-/* overlay */ void tattacher() {
+void tattacher() {
 	if (s.derobj == 0)  crep = 186;
 	else {
 		if (!syn)
@@ -661,7 +661,7 @@ L2:
 	}
 }
 
-/* overlay */ void tfermer() {
+void tfermer() {
 	int cx, chai;
 
 	if (!syn)
@@ -691,7 +691,7 @@ L2:
 	if (caff == 26)  crep = 999;
 }
 
-/* overlay */ void tfrapper() {
+void tfrapper() {
 	int l, p, haz;
 
 	if (!syn)
@@ -724,7 +724,7 @@ L2:
 	}
 }
 
-/* overlay */ void tposer() {
+void tposer() {
 	int cx, chai;
 
 	if (!syn)
@@ -790,7 +790,7 @@ L2:
 	}
 }
 
-/* overlay */ void tecouter() {
+void tecouter() {
 	int l, p, haz, j, h, m;
 
 	if (s.mlieu != 26)  crep = 101;
@@ -815,7 +815,7 @@ L2:
 	}
 }
 
-/* overlay */ void tmanger() {
+void tmanger() {
 	int j, h, m;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26))
@@ -842,7 +842,7 @@ L2:
 	}
 }
 
-/* overlay */ void tentrer() {
+void tentrer() {
 	int x, z = 0;
 
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
@@ -895,7 +895,7 @@ L2:
 	}
 }
 
-/* overlay */ void tdormir() {
+void tdormir() {
 	int z, j, h, m, quel;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
@@ -934,7 +934,7 @@ L2:
 	num = 0;
 }
 
-/* overlay */ void tdefoncer() {
+void tdefoncer() {
 	if (!syn)
 		ecr3(g_vm->getString(S_SMASH));
 	if (caff < 25)  tfleche();
@@ -946,7 +946,7 @@ L2:
 		}
 }
 
-/* overlay */ void tsortir() {
+void tsortir() {
 	int lx = 0;
 
 	tsort();
@@ -971,7 +971,7 @@ L2:
 	}
 }
 
-/* overlay */ void tattendre() {
+void tattendre() {
 	int quel;
 
 	mpers = 0;
@@ -995,7 +995,7 @@ L2:
 	if (! anyone)  tinke();
 }
 
-/* overlay */ void tsonder() {
+void tsonder() {
 	if (!syn)
 		ecr3(g_vm->getString(S_PROBE2));
 	if (caff < 27) {
@@ -1005,7 +1005,7 @@ L2:
 	}
 }
 
-/* overlay */ void tparler()
+void tparler()
 
 {
 	bool te[47];
@@ -1179,7 +1179,7 @@ L2:
 	clsf3();
 }
 
-/* overlay */ void tsentir() {
+void tsentir() {
 	crep = 119;
 	if (caff < 26) {
 		if (!syn)
@@ -1191,7 +1191,7 @@ L2:
 	num = 0;
 }
 
-/* overlay */ void tgratter() {
+void tgratter() {
 	crep = 155;
 	if (caff < 27) {
 		if (!syn)
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
index 6eb7d5e..a3787a0 100644
--- a/engines/mortevielle/alert.cpp
+++ b/engines/mortevielle/alert.cpp
@@ -33,7 +33,7 @@
 
 namespace Mortevielle {
 
-/* overlay */ int do_alert(Common::String str_, int n);
+int do_alert(Common::String str_, int n);
 
 
 const int nligne = 7;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 12ccbe3..fbe3ff2 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -38,7 +38,7 @@ namespace Mortevielle {
 
 /* NIVEAU 14*/
 
-/* overlay */ void menut(int no, Common::String nom) {
+void menut(int no, Common::String nom) {
 	byte h, l;
 	Common::String s;
 
@@ -74,7 +74,7 @@ namespace Mortevielle {
 	}
 }
 
-/* overlay */ void menu_disable(int no) {
+void menu_disable(int no) {
 	byte h, l;
 
 	/* debug('menu_disable'); */
@@ -103,7 +103,7 @@ namespace Mortevielle {
 	}
 }
 
-/* overlay */ void menu_enable(int no) {
+void menu_enable(int no) {
 	byte h, l;
 
 	/* debug('menu_disable'); */
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 2d4df26..4699575 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -491,7 +491,7 @@ void affper(int per) {
 	ipers = per;
 }
 
-/* overlay */ void choix(int min, int max, int &per) {
+void choix(int min, int max, int &per) {
 	bool i;
 	int haz, cx, cy, cz;
 
@@ -515,7 +515,7 @@ void affper(int per) {
 	i = false;
 }
 
-/* overlay */ void cpl1(int &p) {
+void cpl1(int &p) {
 	int j, h, m;
 
 	/* debug('o0 cpl1'); */
@@ -530,7 +530,7 @@ void affper(int per) {
 	mdn();
 }
 
-/* overlay */ void cpl2(int &p) {
+void cpl2(int &p) {
 	int j, h, m;
 
 	/* debug('o0 cpl2'); */
@@ -542,7 +542,7 @@ void affper(int per) {
 	if ((h >= 0) && (h < 8))  p = 50;
 }
 
-/* overlay */ void cpl3(int &p) {
+void cpl3(int &p) {
 	int j, h, m;
 
 	/* debug('o0 cpl3'); */
@@ -551,7 +551,7 @@ void affper(int per) {
 	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
 }
 
-/* overlay */ void cpl5(int &p) {
+void cpl5(int &p) {
 	int j, h, m;
 
 	/* debug('o0 cpl5'); */
@@ -562,7 +562,7 @@ void affper(int per) {
 	if ((h >= 0) && (h < 7))  p = 50;
 }
 
-/* overlay */ void cpl6(int &p) {
+void cpl6(int &p) {
 	int j, h, m;
 
 	/* debug('o0 cpl6'); */
@@ -650,7 +650,7 @@ void debloc(int l) {
 	mpers = ipers;
 }
 
-/* overlay */ void cpl10(int &p, int &h) {
+void cpl10(int &p, int &h) {
 	int j, m;
 
 	/* debug('o1 cpl10'); */
@@ -663,7 +663,7 @@ void debloc(int l) {
 	if ((h >= 0) && (h < 8))  p = 5;
 }
 
-/* overlay */ void cpl11(int &p, int &h) {
+void cpl11(int &p, int &h) {
 	int j, m;
 
 	/* debug('o1 cpl11'); */
@@ -675,7 +675,7 @@ void debloc(int l) {
 	if ((h >= 0) && (h < 9))  p = 0;
 }
 
-/* overlay */ void cpl12(int &p) {
+void cpl12(int &p) {
 	int j, h, m;
 
 	/* debug('o1 cpl12'); */
@@ -686,12 +686,12 @@ void debloc(int l) {
 	if ((h > 4) && (h < 9))  p = 15;
 }
 
-/* overlay */ void cpl13(int &p) {
+void cpl13(int &p) {
 	/* debug('o1 cpl13'); */
 	p = 0;
 }
 
-/* overlay */ void cpl15(int &p) {
+void cpl15(int &p) {
 	int j, h, m;
 
 	/* debug('o1 cpl15'); */
@@ -705,7 +705,7 @@ void debloc(int l) {
 	if ((h >= 0) && (h < 8))  p = -15;
 }
 
-/* overlay */ void cpl20(int &p, int &h) {
+void cpl20(int &p, int &h) {
 	int j, m;
 
 	/* debug('o1 cpl20'); */
@@ -717,7 +717,7 @@ void debloc(int l) {
 	if ((h > 4) && (h < 10))  p = -5;
 }
 
-/* overlay */ void quelq1(int l) {
+void quelq1(int l) {
 	int per;
 
 	/* debug('o1 quelq1'); */
@@ -731,27 +731,27 @@ void debloc(int l) {
 	ipers = 10;
 }
 
-/* overlay */ void quelq2() {
+void quelq2() {
 	/* debug('o1 quelq2'); */
 	if (li == 2)  bh2 = true;
 	else bh9 = true;
 	ipers = 10;
 }
 
-/* overlay */ void quelq5() {
+void quelq5() {
 	/* debug('o1 quelq5'); */
 	bh5 = true;
 	ipers = 10;
 }
 
-/* overlay */ void quelq6(int l) {
+void quelq6(int l) {
 	/* debug('o1 quelq6'); */
 	if (l == 6)  bh6 = true;
 	if (l == 8)  bh8 = true;
 	ipers = 10;
 }
 
-/* overlay */ void quelq10(int h, int &per) {
+void quelq10(int h, int &per) {
 	int min = 0, max = 0;
 
 	/* debug('o1 quelq10'); */
@@ -778,7 +778,7 @@ void debloc(int l) {
 	affper(per);
 }
 
-/* overlay */ void quelq11(int h, int &per) {
+void quelq11(int h, int &per) {
 	int min = 0, max = 0;
 
 	/* debug('o1 quelq11'); */
@@ -801,13 +801,13 @@ void debloc(int l) {
 	affper(per);
 }
 
-/* overlay */ void quelq12(int &per) {
+void quelq12(int &per) {
 	/* debug('o1 quelq12'); */
 	chlm(per);
 	affper(per);
 }
 
-/* overlay */ void quelq15(int &per) {
+void quelq15(int &per) {
 	int cx;
 	bool test;
 
@@ -831,7 +831,7 @@ void debloc(int l) {
 	}
 }
 
-/* overlay */ void quelq20(int h, int &per) {
+void quelq20(int h, int &per) {
 	int min = 0, max = 0;
 
 	/* debug('o1 quelq20'); */
@@ -855,7 +855,7 @@ void debloc(int l) {
 }
 
 
-/* overlay */void frap() {
+void frap() {
 	int j, h, m, haz;
 
 	/* debug('o1 frap'); */
@@ -868,7 +868,7 @@ void debloc(int l) {
 	}
 }
 
-/* overlay */ void nouvp(int l, int &p) {
+void nouvp(int l, int &p) {
 	/* debug('o1 nouvp'); */
 	p = 0;
 	if (l == 1) {
@@ -889,7 +889,7 @@ void debloc(int l) {
 
 
 
-/* overlay */ void tip(int ip, int &cx) {
+void tip(int ip, int &cx) {
 	/* debug('o1 tip'); */
 	if (ip == 128)  cx = 1;
 	else if (ip == 64)   cx = 2;
@@ -902,7 +902,7 @@ void debloc(int l) {
 }
 
 
-/* overlay */ void ecfren(int &p, int &haz, int cf, int l) {
+void ecfren(int &p, int &haz, int cf, int l) {
 	/* debug('o1 ecfren'); */
 	if (l == 0)  person();
 	p = -500;
@@ -921,7 +921,7 @@ void debloc(int l) {
 	}
 }
 
-/* overlay */ void becfren(int l) {
+void becfren(int l) {
 	int haz;
 
 	/* debug('o1 becfren'); */
@@ -958,7 +958,7 @@ void phaz(int &haz, int &p, int cf) {
 	haz = hazard(1, 100);
 }
 
-/* overlay */ void inzon() {
+void inzon() {
 	int cx;
 
 	/* debug('o2 inzon'); */
@@ -989,7 +989,7 @@ void phaz(int &haz, int &p, int cf) {
 	init_nbrepm();
 }
 
-/* overlay */ void dprog() {
+void dprog() {
 	/* debug('o2 dprog'); */
 	li = 21;
 	/* jh:= t_settime(0);*/
@@ -999,7 +999,7 @@ void phaz(int &haz, int &p, int cf) {
 	mh = readclock();
 }
 
-/* overlay */ void pl1(int cf) {
+void pl1(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl1'); */
@@ -1012,7 +1012,7 @@ void phaz(int &haz, int &p, int cf) {
 	}
 }
 
-/* overlay */ void pl2(int cf) {
+void pl2(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl2'); */
@@ -1024,7 +1024,7 @@ void phaz(int &haz, int &p, int cf) {
 	}
 }
 
-/* overlay */ void pl5(int cf) {
+void pl5(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl5'); */
@@ -1036,7 +1036,7 @@ void phaz(int &haz, int &p, int cf) {
 	}
 }
 
-/* overlay */ void pl6(int cf) {
+void pl6(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl6'); */
@@ -1048,7 +1048,7 @@ void phaz(int &haz, int &p, int cf) {
 	}
 }
 
-/* overlayi */ void pl9(int cf) {
+void pl9(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl9'); */
@@ -1060,7 +1060,7 @@ void phaz(int &haz, int &p, int cf) {
 	}
 }
 
-/* overlayi */ void pl10(int cf) {
+void pl10(int cf) {
 	int p, h, haz;
 
 	/* debug('o2 pl10'); */
@@ -1070,7 +1070,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq10(h, p);
 }
 
-/* overlay */ void pl11(int cf) {
+void pl11(int cf) {
 	int p, h, haz;
 
 	/* debug('o2 pl11'); */
@@ -1080,7 +1080,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq11(h, p);
 }
 
-/* overlay */ void pl12(int cf) {
+void pl12(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl12'); */
@@ -1090,7 +1090,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq12(p);
 }
 
-/* overlay */ void pl13(int cf) {
+void pl13(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl13'); */
@@ -1100,7 +1100,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq12(p);
 }
 
-/* overlay */ void pl15(int cf) {
+void pl15(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl15'); */
@@ -1110,7 +1110,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq15(p);
 }
 
-/* overlay */ void pl20(int cf) {
+void pl20(int cf) {
 	int p, h, haz;
 
 	/* debug('o2 pl20'); */
@@ -1120,7 +1120,7 @@ void phaz(int &haz, int &p, int cf) {
 	else quelq20(h, p);
 }
 
-/* overlay */ void t11(int l11, int &a) {
+void t11(int l11, int &a) {
 	int p, haz, h = 0;
 
 	/* debug('o2 t11'); */
@@ -1161,7 +1161,7 @@ void phaz(int &haz, int &p, int cf) {
 		}
 }
 
-/* overlay */ void cavegre()
+void cavegre()
 
 {
 	int haz;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 6650dd0..94f89c3 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -61,7 +61,7 @@ void ani50() {
 	repon(2, c_paroles + 143);
 }
 
-/* overlay */ void aff50(bool c) {
+void aff50(bool c) {
 	caff = 50;
 	maff = 0;
 	taffich();
@@ -71,7 +71,7 @@ void ani50() {
 	f3f8();
 }
 
-/* overlay */ void init_menu() {
+void init_menu() {
 	int i, tai;
 	char st[1410];
 	Common::File f;
@@ -124,7 +124,7 @@ void ani50() {
 }
 
 
-/* overlay */ void charpal() {
+void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
 	int i, j, k;
@@ -172,7 +172,7 @@ void ani50() {
 	fb.close();
 }
 
-/* overlay */ void chartex() {
+void chartex() {
 	int i;
 	Common::File f;
 	char s[1410];
@@ -219,7 +219,7 @@ void dialpre() {
 	int_m = true;
 }
 
-/* overlay */ void init_lieu() {
+void init_lieu() {
 	Common::File f_lieu;	// tab_mlieu
 
 	/* debug('o3 init_lieu'); */
@@ -234,7 +234,7 @@ void dialpre() {
 }
 
 
-/* overlay */ void music() {
+void music() {
 	Common::File fic;
 	int k;
 	bool fin;
@@ -269,7 +269,7 @@ void dialpre() {
 }
 
 
-/* overlay */ void charge_bruit5() {
+void charge_bruit5() {
 	Common::File f;
 
 	if (!f.open("bruit5"))
@@ -279,7 +279,7 @@ void dialpre() {
 	f.close();
 }
 
-/* overlay */ void charge_cfiec() {
+void charge_cfiec() {
 	Common::File f;
 
 	if (!f.open("cfiec.mor"))
@@ -292,7 +292,7 @@ void dialpre() {
 }
 
 
-/* overlay */ void charge_cfiph() {
+void charge_cfiph() {
 	Common::File f;
 
 	if (!f.open("cfiph.mor"))
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 2a89841..70bbd72 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -97,7 +97,7 @@ void veracf(byte b) {
 	;
 }
 
-/* overlay */ void cctable(tablint &t) {
+void cctable(tablint &t) {
 	int k;
 	float tb[257];
 
@@ -109,7 +109,7 @@ void veracf(byte b) {
 	}
 }
 
-/* overlay */ void regenbruit() {
+void regenbruit() {
 	int i, j;
 
 	i = offsetb3 + 8590;
@@ -121,7 +121,7 @@ void veracf(byte b) {
 	} while (!(i >= offsetb3 + 8790));
 }
 
-/* overlay */   void charge_son() {
+  void charge_son() {
 	Common::File f;
 
 	if (!f.open("sonmus.mor"))
@@ -133,7 +133,7 @@ void veracf(byte b) {
 	f.close();
 }
 
-/* overlay */   void charge_phbruit() {
+  void charge_phbruit() {
 	Common::File f;
 
 	if (!f.open("phbrui.mor"))
@@ -145,7 +145,7 @@ void veracf(byte b) {
 	f.close();
 }
 
-/* overlay */   void charge_bruit() {
+  void charge_bruit() {
 	Common::File f;
 	int i;
 
@@ -159,7 +159,7 @@ void veracf(byte b) {
 	f.close();
 }
 
-/* overlay */   void trait_car() {
+  void trait_car() {
 	byte d3;
 	int d2, i;
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 9d8b8f9..db8b2e9 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -38,7 +38,7 @@
 
 namespace Mortevielle {
 
-/* overlay */ void change_gd(int ngd) {
+void change_gd(int ngd) {
 	hide_mouse();
 	gd = ngd;
 	hirs();
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
index aadedbd..e8c568d 100644
--- a/engines/mortevielle/ques.cpp
+++ b/engines/mortevielle/ques.cpp
@@ -34,7 +34,7 @@
 
 namespace Mortevielle {
 
-/* overlay */ bool ques() {
+bool ques() {
 	const int ta[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
 	const int ok[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 


Commit: 922c4d8244900b3ff1471e7ea8f7b2a2cbd27dee
    https://github.com/scummvm/scummvm/commit/922c4d8244900b3ff1471e7ea8f7b2a2cbd27dee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:17-07:00

Commit Message:
MORTEVIELLE: Removed all the remaining text mode function stubs

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index fbe3ff2..35caac3 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,7 +48,6 @@ void menut(int no, Common::String nom) {
 	l = lo(no);
 	s = nom;
 	if (! tesok) {
-		clrscr;
 		mortevielle_exit(0);
 	}
 	while (s.size() < 20)  s = s + ' ';
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4699575..22816dc 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -260,7 +260,6 @@ void clsf10() {
 }
 
 void stop() {
-	clrscr;
 	hirs();
 	gd = ams;
 	hirs();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 026f17d..130449a 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -150,7 +150,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	init_lieu();
 	sonoff = false;
 	f2_all = false;
-	textcolor(9);
+
 	teskbd();
 	dialpre();
 	newgd = gd;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 5c72961..1b19d5c 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -255,17 +255,6 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 
 int port[0xfff];
 byte mem[65536 * 16];
-int wherey;
-
-void gotoxy(int x, int y) {
-}
-void textcolor(int c) {
-}
-void output(const Common::String &s) {
-	debug(s.c_str());
-}
-void graphbackground(int c) {
-}
 
 void intr(int intNum, registres &regs) {
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a872af1..9bc10b3 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -411,16 +411,6 @@ extern byte mem[65536 * 16];
 #define hires {}
 #define mortevielle_exit(ret) error("Exit the game")
 
-// Text screen functions not relevant for ScummVM
-#define clrscr { warning("ClrScr"); }
-#define clreol {}
-#define graphcolormode {}
-extern void gotoxy(int x, int y);
-extern void textcolor(int c);
-extern void output(const Common::String &s);
-extern void graphbackground(int c);
-extern int wherey;
-
 // Stubs for input functions
 extern bool keypressed();
 extern char get_ch();


Commit: 0992a9592f170608d43d794bb28503da234e6e45
    https://github.com/scummvm/scummvm/commit/0992a9592f170608d43d794bb28503da234e6e45
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:18-07:00

Commit Message:
MORTEVIELLE: Replaced stub calls to mortevielle_exit with Engine::quitGame

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 35caac3..d8c1b60 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,7 +48,7 @@ void menut(int no, Common::String nom) {
 	l = lo(no);
 	s = nom;
 	if (! tesok) {
-		mortevielle_exit(0);
+		g_vm->quitGame();
 	}
 	while (s.size() < 20)  s = s + ' ';
 	switch (h) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 22816dc..05fe6c2 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -48,7 +48,7 @@ const int ioresult = 0;
 void testfi() {
 	if (ioresult != 0) {
 		caff = do_alert(err_mess, 1);
-		mortevielle_exit(0);
+		g_vm->quitGame();
 	}
 }
 
@@ -263,7 +263,7 @@ void stop() {
 	hirs();
 	gd = ams;
 	hirs();
-	mortevielle_exit(0);
+	g_vm->quitGame();
 }
 
 void paint_rect(int x, int y, int dx, int dy) {
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 9bc10b3..3e496df 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -409,7 +409,6 @@ extern int port[0xfff];
 extern byte mem[65536 * 16];
 
 #define hires {}
-#define mortevielle_exit(ret) error("Exit the game")
 
 // Stubs for input functions
 extern bool keypressed();


Commit: 0a497bdd9e788ca9cd4f4139254451f45abaa8fe
    https://github.com/scummvm/scummvm/commit/0a497bdd9e788ca9cd4f4139254451f45abaa8fe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:19-07:00

Commit Message:
MORTEVIELLE: Moved DROITE() into the ScreenSurface class

Changed paths:
  R engines/mortevielle/droite.cpp
  R engines/mortevielle/droite.h
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/droite.cpp b/engines/mortevielle/droite.cpp
deleted file mode 100644
index fc52ff7..0000000
--- a/engines/mortevielle/droite.cpp
+++ /dev/null
@@ -1,68 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/droite.h"
-#include "mortevielle/graphics.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void droite(int x, int y, int xx, int yy, int coul) {
-	int step, i;
-	float a, b;
-	float xr, yr, xro, yro;
-
-	xr = x;
-	yr = y;
-	xro = xx;
-	yro = yy;
-	
-	if (abs(y - yy) > abs(x - xx)) {
-		a = (float)((x - xx)) / (y - yy);
-		b = (yr * xro - yro * xr) / (y - yy);
-		i = y;
-		if (y > yy)  step = -1;
-		else step = 1;
-		do {
-			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
-			i = i + step;
-		} while (!(i == yy));
-	} else {
-		a = (float)((y - yy)) / (x - xx);
-		b = ((yro * xr) - (yr * xro)) / (x - xx);
-		i = x;
-		if (x > xx)  step = -1;
-		else step = 1;
-		do {
-			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
-			i = i + step;
-		} while (!(i == xx));
-	}
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/droite.h b/engines/mortevielle/droite.h
deleted file mode 100644
index 6017f48..0000000
--- a/engines/mortevielle/droite.h
+++ /dev/null
@@ -1,36 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_DROITE_H
-#define MORTEVIELLE_DROITE_H
-
-namespace Mortevielle {
-
-extern void droite(int x, int y, int xx, int yy, int coul);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index bdf6c86..0fab9de 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1097,4 +1097,37 @@ int ScreenSurface::getStringWidth(const Common::String &s) {
 	return s.size() * charWidth;
 }
 
+void ScreenSurface::droite(int x, int y, int xx, int yy, int coul) {
+	int step, i;
+	float a, b;
+	float xr, yr, xro, yro;
+
+	xr = x;
+	yr = y;
+	xro = xx;
+	yro = yy;
+	
+	if (abs(y - yy) > abs(x - xx)) {
+		a = (float)((x - xx)) / (y - yy);
+		b = (yr * xro - yro * xr) / (y - yy);
+		i = y;
+		if (y > yy)  step = -1;
+		else step = 1;
+		do {
+			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
+			i = i + step;
+		} while (!(i == yy));
+	} else {
+		a = (float)((y - yy)) / (x - xx);
+		b = ((yro * xr) - (yr * xro)) / (x - xx);
+		i = x;
+		if (x > xx)  step = -1;
+		else step = 1;
+		do {
+			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
+			i = i + step;
+		} while (!(i == xx));
+	}
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 1daad57..1aab4cf 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -92,6 +92,7 @@ public:
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void writeg(const Common::String &l, int c);
 	int getStringWidth(const Common::String &s);
+	void droite(int x, int y, int xx, int yy, int coul);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 0688fd5..67ca57d 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -5,7 +5,6 @@ MODULE_OBJS := \
 	alert.o \
 	asm.o \
 	detection.o \
-	droite.o \
 	graphics.o \
 	keyboard.o \
 	level15.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 05fe6c2..895e183 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -30,7 +30,7 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "mortevielle/alert.h"
-#include "mortevielle/droite.h"
+#include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -616,12 +616,14 @@ void pendule() {
 	if ((gd == cga) || (gd == her))
 		co = 0;
 	else co = 1;
-	if (min == 0)  droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
-	else droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
+	if (min == 0)
+		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
+	else 
+		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
 	h = heu;
 	if (h > 12)  h = h - 12;
 	if (h == 0)  h = 12;
-	droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
 	show_mouse();
 	g_vm->_screenSurface.putxy(568, 154);
 	if (heu > 11)


Commit: 9dbe5659c8b1fe07b795487c79879b0cd1412a7a
    https://github.com/scummvm/scummvm/commit/9dbe5659c8b1fe07b795487c79879b0cd1412a7a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:20-07:00

Commit Message:
MORTEVIELLE: Convert menu code to a class

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5b2f437..b848571 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -543,9 +543,12 @@ void tmettre() {
 						show_mouse();
 						tinke();
 						pendule();
-						if (ipers != 0)  affper(ipers);
-						else person();
-						menu_aff();
+						if (ipers != 0)
+							affper(ipers);
+						else 
+							person();
+
+						g_vm->_menu.menu_aff();
 						if (entre) {
 							s.mlieu = 17;
 							tmlieu(17);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index d8c1b60..d6475c9 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -38,19 +38,22 @@ namespace Mortevielle {
 
 /* NIVEAU 14*/
 
-void menut(int no, Common::String nom) {
+/**
+ * Setup a menu's contents
+ */
+void Menu::menut(int no, Common::String nom) {
 	byte h, l;
 	Common::String s;
 
-
-	/* debug('menut'); */
 	h = hi(no);
 	l = lo(no);
 	s = nom;
 	if (! tesok) {
 		g_vm->quitGame();
 	}
-	while (s.size() < 20)  s = s + ' ';
+	while (s.size() < 20)
+		s = s + ' ';
+
 	switch (h) {
 	case invent  :
 		if (l != 7) {
@@ -73,10 +76,13 @@ void menut(int no, Common::String nom) {
 	}
 }
 
-void menu_disable(int no) {
+/**
+ * Disable a menu item
+ * @param no	Hi byte represents menu number, lo byte reprsents item index
+ */
+void Menu::disableMenuItem(int no) {
 	byte h, l;
 
-	/* debug('menu_disable'); */
 	h = hi(no);
 	l = lo(no);
 	switch (h) {
@@ -84,7 +90,8 @@ void menu_disable(int no) {
 		if (l > 6)  {
 			inv[l].setChar('<', 0);
 			inv[l].setChar('>', 21);
-		} else inv[l].setChar('*', 0);
+		} else
+			inv[l].setChar('*', 0);
 	}
 	break;
 	case depla :
@@ -102,10 +109,13 @@ void menu_disable(int no) {
 	}
 }
 
-void menu_enable(int no) {
+/**
+ * Enable a menu item
+ * @param no	Hi byte represents menu number, lo byte reprsents item index
+ */
+void Menu::enableMenuItem(int no) {
 	byte h, l;
 
-	/* debug('menu_disable'); */
 	h = hi(no);
 	l = lo(no);
 	switch (h) {
@@ -131,19 +141,13 @@ void menu_enable(int no) {
 	}
 }
 
-void menu_aff() {
+void Menu::menu_aff() {
 	int ind_tabl, k, col;
-//	char c;
-	int pt, x, y, color, msk,
-	        num_letr;
 
-	/* debug('menu_aff'); */
+	int pt, x, y, color, msk, num_letr;
+
 	hide_mouse();
-	/*if not tesok then
-	   begin
-	     clrscr;
-	     halt;
-	   end;*/
+	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
 	if (gd == cga)  color = 1;
@@ -177,9 +181,10 @@ void menu_aff() {
 	show_mouse();
 }
 
-
-void draw_menu() {
-	/* debug('draw_menu'); */
+/**
+ * Show the menu
+ */
+void Menu::drawMenu() {
 	menu_aff();
 	active_menu = true;
 	msg4 = no_choice;
@@ -189,10 +194,9 @@ void draw_menu() {
 	test0 = false;
 }
 
-void invers(int ix) {
+void Menu::invers(int ix) {
 	Common::String s;
 
-	/* debug('invers'); */
 	if (msg4 == no_choice)  return;
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
@@ -235,7 +239,7 @@ void invers(int ix) {
 		msg4 = no_choice;
 }
 
-void util(int x, int y) {
+void Menu::util(int x, int y) {
 	int ymx, dxcar, xmn, xmx, ix;
 
 	/* debug('util'); */
@@ -258,11 +262,14 @@ void util(int x, int y) {
 	}
 }
 
-void menu_down(int ii) {
+/**
+ * Draw a menu
+ */
+void Menu::menuDown(int ii) {
 	int cx, xcc;
 	int xco, nb_lig;
 
-	/* debug('menu_down'); */
+	/* debug('menuDown'); */
 
 	// Make a copy of the current screen surface for later restore
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
@@ -331,8 +338,11 @@ void menu_down(int ii) {
 	show_mouse();
 }
 
-void menu_up(int xx) {
-	/* debug('menu_up'); */
+/**
+ * Menu is being removed, so restore the previous background area.
+ */
+void Menu::menuUp(int xx) {
+	/* debug('menuUp'); */
 	if (test0) {
 		charecr(10, succ(byte, don[xx][2]) << 1);
 
@@ -351,14 +361,20 @@ void menu_up(int xx) {
 	}
 }
 
-void erase_menu() {
-	/* debug('erase_menu'); */
+/**
+ * Erase the menu
+ */
+void Menu::eraseMenu() {
+	/* debug('eraseMenu'); */
 	active_menu = false;
 	g_vm->setMouseClick(false);
-	menu_up(msg3);
+	menuUp(msg3);
 }
 
-void mdn() {
+/**
+ * Handle updates to the menu
+ */
+void Menu::mdn() {
 	//int x, y, c, a, ix;
 	int x, y, ix;
 	bool tes;
@@ -389,28 +405,28 @@ void mdn() {
 			else ix = fichier;
 			if ((ix != msg3) || (! test0))
 				if (!((ix == fichier) && ((msg3 == sauve) || (msg3 == charge)))) {
-					menu_up(msg3);
-					menu_down(ix);
+					menuUp(msg3);
+					menuDown(ix);
 					msg3 = ix;
 					msg4 = no_choice;
 				}
 		} else { /* Not in the MenuTitle line */
 			if ((y > 11) && (test0))  util(x, y);
 		}
-	} else        /* There was a click */
+	} else {       /* There was a click */
 		if ((msg3 == fichier) && (msg4 != no_choice)) {
 			// Another menu to be displayed
 			g_vm->setMouseClick(false);
-			menu_up(msg3);
+			menuUp(msg3);
 			if (lo(msg4) == 1)  msg3 = 7;
 			else msg3 = 8;
-			menu_down(msg3);
+			menuDown(msg3);
 
 			g_vm->setMouseClick(false);
 		} else { 
 			//  A menu was clicked on
 			choisi = (test0) && (msg4 != no_choice);
-			menu_up(msg3);
+			menuUp(msg3);
 			msg[4] = msg4;
 			msg[3] = msg3;
 			msg3 = no_choice;
@@ -418,6 +434,7 @@ void mdn() {
 
 			g_vm->setMouseClick(false);
 		}
+	}
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 1ea6931..6ab020d 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -32,18 +32,21 @@
 
 namespace Mortevielle {
 
-/* NIVEAU 14*/
-extern void menut(int no, Common::String nom);
-extern void menu_disable(int no);
-extern void menu_enable(int no);
-extern void menu_aff();
-extern void draw_menu();
-extern void invers(int ix);
-extern void util(int x, int y);
-extern void menu_down(int ii);
-extern void menu_up(int xx);
-extern void erase_menu();
-extern void mdn();
+class Menu {
+private:
+	void util(int x, int y);
+	void invers(int ix);
+	void menuDown(int ii);
+public:
+	void menut(int no, Common::String nom);
+	void disableMenuItem(int no);
+	void enableMenuItem(int no);
+	void menu_aff();
+	void drawMenu();
+	void menuUp(int xx);
+	void eraseMenu();
+	void mdn();
+};
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 895e183..d4461be 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -324,8 +324,8 @@ void modobj(int m) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
 	}
-	menut(invt[8], strp);
-	menu_disable(invt[8]);
+	g_vm->_menu.menut(invt[8], strp);
+	g_vm->_menu.disableMenuItem(invt[8]);
 }
 
 void modobj2(int m, bool t1, bool t2) {
@@ -341,8 +341,8 @@ void modobj2(int m, bool t1, bool t2) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
 	}
-	menut(invt[8], strp);
-	menu_disable(invt[8]);
+	g_vm->_menu.menut(invt[8], strp);
+	g_vm->_menu.disableMenuItem(invt[8]);
 }
 
 
@@ -445,47 +445,48 @@ void affper(int per) {
 	int cx;
 
 	/* debug('affper'); */
-	for (cx = 1; cx <= 8; cx ++) menu_disable(disc[cx]);
+	for (cx = 1; cx <= 8; cx ++)
+		g_vm->_menu.disableMenuItem(disc[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
 		g_vm->_screenSurface.putxy(560, 24);
 		g_vm->_screenSurface.writeg("LEO", 4);
-		menu_enable(disc[1]);
+		g_vm->_menu.enableMenuItem(disc[1]);
 	}
 	if ((per & 64) == 64) {
 		g_vm->_screenSurface.putxy(560, 32);
 		g_vm->_screenSurface.writeg("PAT", 4);
-		menu_enable(disc[2]);
+		g_vm->_menu.enableMenuItem(disc[2]);
 	}
 	if ((per & 32) == 32) {
 		g_vm->_screenSurface.putxy(560, 40);
 		g_vm->_screenSurface.writeg("GUY", 4);
-		menu_enable(disc[3]);
+		g_vm->_menu.enableMenuItem(disc[3]);
 	}
 	if ((per & 16) == 16) {
 		g_vm->_screenSurface.putxy(560, 48);
 		g_vm->_screenSurface.writeg("EVA", 4);
-		menu_enable(disc[4]);
+		g_vm->_menu.enableMenuItem(disc[4]);
 	}
 	if ((per & 8) == 8) {
 		g_vm->_screenSurface.putxy(560, 56);
 		g_vm->_screenSurface.writeg("BOB", 4);
-		menu_enable(disc[5]);
+		g_vm->_menu.enableMenuItem(disc[5]);
 	}
 	if ((per & 4) == 4) {
 		g_vm->_screenSurface.putxy(560, 64);
 		g_vm->_screenSurface.writeg("LUC", 4);
-		menu_enable(disc[6]);
+		g_vm->_menu.enableMenuItem(disc[6]);
 	}
 	if ((per & 2) == 2) {
 		g_vm->_screenSurface.putxy(560, 72);
 		g_vm->_screenSurface.writeg("IDA", 4);
-		menu_enable(disc[7]);
+		g_vm->_menu.enableMenuItem(disc[7]);
 	}
 	if ((per & 1) == 1) {
 		g_vm->_screenSurface.putxy(560, 80);
 		g_vm->_screenSurface.writeg("MAX", 4);
-		menu_enable(disc[8]);
+		g_vm->_menu.enableMenuItem(disc[8]);
 	}
 	ipers = per;
 }
@@ -526,7 +527,7 @@ void cpl1(int &p) {
 	if ((h > 17) && (h < 22))  p = 35;
 	if ((h > 21) && (h < 24))  p = 50;
 	if ((h >= 0) && (h < 8))  p = 70;
-	mdn();
+	g_vm->_menu.mdn();
 }
 
 void cpl2(int &p) {
@@ -578,7 +579,7 @@ void cpl6(int &p) {
 void person() {
 	/* debug('person'); */
 	for (int cf = 1; cf <= 8; cf ++)
-		menu_disable(disc[cf]);
+		g_vm->_menu.disableMenuItem(disc[cf]);
 
 	clsf10();
 	g_vm->_screenSurface.putxy(560, 30);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 5d33175..557ca06 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -104,7 +104,7 @@ void tinke() {
 		nh = readclock();
 		if ((nh - mh) > t) {
 			am = active_menu;
-			erase_menu();
+			g_vm->_menu.eraseMenu();
 			jh = jh + ((nh - mh) / t);
 			mh = nh;
 			switch (li) {
@@ -165,7 +165,8 @@ void tinke() {
 						}
 					}
 				}
-			if (am)  draw_menu();
+			if (am)
+				g_vm->_menu.drawMenu();
 		}
 	}
 	hfb = readclock();
@@ -233,11 +234,12 @@ void tmlieu(int mli) {
 		deline(cx + c_tmlieu, st, tail);
 		nomp = delig;
 		while (nomp.size() < 20)  nomp = nomp + ' ';
-		menut(depl[i], nomp);
+		g_vm->_menu.menut(depl[i], nomp);
 		i = i + 1;
 	}
 	nomp = "*                   ";
-	for (cx = 7; cx >= i; cx --) menut(depl[cx], nomp);
+	for (cx = 7; cx >= i; cx --)
+		g_vm->_menu.menut(depl[cx], nomp);
 }
 
 
@@ -271,20 +273,11 @@ void mfouen()
 	int cx;
 
 	tmlieu(s.mlieu);
-	for (cx = 1; cx <= 11; cx ++) menu_enable(men[cx]);
-	/* menu_enable( scacher);
-	 menu_enable(menup, attacher);
-	 menu_enable(menup, defoncer);
-	 menu_enable(menup, dormir);
-	 menu_enable(menup, entrer);
-	 menu_enable(menup, fermer);
-	 menu_enable(menup, frapper);
-	 menu_enable(menup, manger);
-	 menu_enable(menup, mettre);
-	 menu_enable(menup, ouvrir);
-	 menu_enable(menup, sortir);  */
-	menut(sonder, g_vm->getString(S_PROBE));
-	menut(soulever, g_vm->getString(S_RAISE));
+	for (cx = 1; cx <= 11; cx ++)
+		g_vm->_menu.enableMenuItem(men[cx]);
+
+	g_vm->_menu.menut(sonder, g_vm->getString(S_PROBE));
+	g_vm->_menu.menut(soulever, g_vm->getString(S_RAISE));
 }
 
 void atf3f8(int &key) {
@@ -382,13 +375,13 @@ void modinv() {
 			r = (ord(s.sjer[cx]) + 400);
 			deline(r - 501 + c_st41, nom, tay);
 			nomp = delig;
-			menut(invt[cy], nomp);
-			menu_enable(invt[cx]);
+			g_vm->_menu.menut(invt[cy], nomp);
+			g_vm->_menu.enableMenuItem(invt[cx]);
 		}
 	if (cy < 6)
 		for (cx = cy + 1; cx <= 6; cx ++) {
-			menut(invt[cx], "                       ");
-			menu_disable(invt[cx]);
+			g_vm->_menu.menut(invt[cx], "                       ");
+			g_vm->_menu.disableMenuItem(invt[cx]);
 		}
 }
 
@@ -425,16 +418,16 @@ void mfoudi() {
 	int cx;
 
 	for (cx = 1; cx <= 7; cx ++) 
-		menu_disable(depl[cx]);
+		g_vm->_menu.disableMenuItem(depl[cx]);
 	for (cx = 1; cx <= 11; cx ++)
-		menu_disable(men[cx]);
+		g_vm->_menu.disableMenuItem(men[cx]);
 
-	menut(sonder, g_vm->getString(S_SUITE));
-	menut(soulever, g_vm->getString(S_STOP));
+	g_vm->_menu.menut(sonder, g_vm->getString(S_SUITE));
+	g_vm->_menu.menut(soulever, g_vm->getString(S_STOP));
 }
 
 void mennor() {
-	menu_up(msg[3]);
+	g_vm->_menu.menuUp(msg[3]);
 }
 
 void premtet() {
@@ -553,7 +546,8 @@ void quelquun()
 {
 	int haz, cx;
 
-	if (imen)  erase_menu();
+	if (imen)
+		g_vm->_menu.eraseMenu();
 	finfouil();
 	crep = 997;
 L1:
@@ -591,7 +585,8 @@ L1:
 			affrep();
 		}
 	}
-	if (imen)  draw_menu();
+	if (imen)
+		g_vm->_menu.drawMenu();
 }
 
 void tsuiv() {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 130449a..29a9d5b 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -553,7 +553,7 @@ void MortevielleEngine::handleAction() {
 	oo = false;
 	ctrm = 0;
 	if (! iesc) {
-		draw_menu();
+		g_vm->_menu.drawMenu();
 		imen = true;
 		temps = 0;
 		key = 0;
@@ -562,7 +562,7 @@ void MortevielleEngine::handleAction() {
 
 		_inMainGameLoop = true;
 		do {
-			mdn();
+			g_vm->_menu.mdn();
 			tinke();
 			mov_mouse(funct, inkey);
 			CHECK_QUIT;
@@ -570,7 +570,7 @@ void MortevielleEngine::handleAction() {
 		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
 		_inMainGameLoop = false;
 
-		erase_menu();
+		g_vm->_menu.eraseMenu();
 		imen = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
 			change_gd((uint)pred(int, ord(inkey)) >> 1);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 94640ba..371dd40 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -33,6 +33,7 @@
 #include "common/error.h"
 #include "graphics/surface.h"
 #include "mortevielle/graphics.h"
+#include "mortevielle/menu.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/sound.h"
 
@@ -100,6 +101,7 @@ public:
 	Common::RandomSource _randomSource;
 	SoundManager _soundManager;
 	SavegameManager _savegameManager;
+	Menu _menu;
 
 	bool _quitGame;			// Quit game flag. Originally called 'arret'
 	bool _endGame;			// End game flag. Originally called 'solu'
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 94f89c3..5bdb54f 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -114,7 +114,8 @@ void init_menu() {
 		disc[i] = 0x500 + i;
 		if (i < 8)  depl[i] = 0x200 + i;
 		invt[i] = 0x100 + i;
-		if (i > 6)  menu_disable(invt[i]);
+		if (i > 6)
+			g_vm->_menu.disableMenuItem(invt[i]);
 	}
 	msg3 = no_choice;
 	msg4 = no_choice;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index db8b2e9..7f61b79 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -54,7 +54,7 @@ void change_gd(int ngd) {
 	maff = 68;
 	afdes(0);
 	repon(2, crep);
-	menu_aff();
+	g_vm->_menu.menu_aff();
 }
 
 /**
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 1b19d5c..62b1457 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -278,7 +278,7 @@ char get_ch() {
  */
 void s_sauv(int Gd, int y, int dy) {
 	// Note: May no longer be necessary, since the backgorund restore code 
-	// is being handled slightly differently now in the menu_up() method
+	// is being handled slightly differently now in the menuUp() method
 }
 
 void palette(int v1) {


Commit: 449aefa9325e96a2b7a8fba4734ccdab1cad06dc
    https://github.com/scummvm/scummvm/commit/449aefa9325e96a2b7a8fba4734ccdab1cad06dc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:22-07:00

Commit Message:
MORTEVIELLE: Converted menu functions into it's own class

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b848571..dfd0811 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -47,13 +47,13 @@ void taller() {
 	//int mx, cx, cy;
 	int cx;
 
-	if ((s.mlieu == 26) && (msg[4] == depl[6])) {
+	if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._depl[6])) {
 		s.mlieu = 15;
 		caff = s.mlieu;
 		afdes(0);
 		repon(2, s.mlieu);
 	}
-	if ((s.mlieu == 15) && (msg[4] == depl[6])) {
+	if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._depl[6])) {
 		if (!syn)
 			ecr3(g_vm->getString(S_GO_TO));
 		tfleche();
@@ -78,7 +78,7 @@ void taller() {
 	cx = 0;
 	do {
 		cx = cx + 1;
-	} while (!(depl[cx] == msg[4]));
+	} while (!(g_vm->_menu._depl[cx] == msg[4]));
 	if (s.mlieu == 19) {
 		if (cx == 1)  t1deva();
 		if (cx == 2)  t1neig();
@@ -236,7 +236,7 @@ void tsprendre() {
 	cx = 0;
 	do {
 		cx = cx + 1;
-	} while (!(invt[cx] == msg[4]));
+	} while (!(g_vm->_menu._invt[cx] == msg[4]));
 	cz = 0;
 	cy = 0;
 	do {
@@ -870,7 +870,7 @@ void tentrer() {
 					s.conf = s.conf + 1;
 					s.mlieu = 15;
 					msg[3] = discut;
-					msg[4] = disc[x];
+					msg[4] = g_vm->_menu._disc[x];
 					syn = true;
 					if (ment == 9) {
 						col = true;
@@ -1027,7 +1027,7 @@ void tparler()
 		cx = 0;
 		do {
 			cx = cx + 1;
-		} while (!(disc[cx] == msg[4]));
+		} while (!(g_vm->_menu._disc[cx] == msg[4]));
 		caff = 69 + cx;
 		afdes(0);
 		repon(2, caff);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index d6475c9..2fc558a 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -2,14 +2,14 @@
  *
  * ScummVM is the legal property of its developers, whose names
  * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
+ * file _distributed with this source _distribution.
  *
- * This program is free software; you can redistribute it and/or
+ * This program is free software; you can re_distribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * 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.
@@ -32,6 +32,8 @@
 #include "mortevielle/menu.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
+#include "mortevielle/ovd1.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -57,27 +59,27 @@ void Menu::menut(int no, Common::String nom) {
 	switch (h) {
 	case invent  :
 		if (l != 7) {
-			inv[l] = s;
-			inv[l].insertChar(' ', 0);
+			_inv[l] = s;
+			_inv[l].insertChar(' ', 0);
 		}
 		break;
-	case depla   :
-		dep[l] = s;
+	case depla:
+		_dep[l] = s;
 		break;
-	case action  :
-		act[l] = s;
+	case action:
+		_act[l] = s;
 		break;
-	case saction :
-		self_[l] = s;
+	case saction:
+		_self[l] = s;
 		break;
-	case discut  :
-		dis[l] = s;
+	case discut:
+		_dis[l] = s;
 		break;
 	}
 }
 
 /**
- * Disable a menu item
+ * _disable a menu item
  * @param no	Hi byte represents menu number, lo byte reprsents item index
  */
 void Menu::disableMenuItem(int no) {
@@ -88,23 +90,23 @@ void Menu::disableMenuItem(int no) {
 	switch (h) {
 	case invent : {
 		if (l > 6)  {
-			inv[l].setChar('<', 0);
-			inv[l].setChar('>', 21);
+			_inv[l].setChar('<', 0);
+			_inv[l].setChar('>', 21);
 		} else
-			inv[l].setChar('*', 0);
+			_inv[l].setChar('*', 0);
 	}
 	break;
-	case depla :
-		dep[l].setChar('*', 0);
+	case depla:
+		_dep[l].setChar('*', 0);
 		break;
-	case action :
-		act[l].setChar('*', 0);
+	case action:
+		_act[l].setChar('*', 0);
 		break;
-	case saction :
-		self_[l].setChar('*', 0);
+	case saction:
+		_self[l].setChar('*', 0);
 		break;
-	case discut :
-		dis[l].setChar('*', 0);
+	case discut:
+		_dis[l].setChar('*', 0);
 		break;
 	}
 }
@@ -120,23 +122,23 @@ void Menu::enableMenuItem(int no) {
 	l = lo(no);
 	switch (h) {
 	case invent : {
-		inv[l].setChar(' ', 0);
-		inv[l].setChar(' ', 21);
+		_inv[l].setChar(' ', 0);
+		_inv[l].setChar(' ', 21);
 	}
 	break;
-	case depla :
-		dep[l].setChar(' ', 0);
+	case depla:
+		_dep[l].setChar(' ', 0);
 		break;
-	case action :
-		act[l].setChar(' ', 0);
+	case action:
+		_act[l].setChar(' ', 0);
 		break;
-	case saction : {
-		self_[l].setChar(' ', 0);
-		self_[l].setChar(' ', 0);
+	case saction: {
+		_self[l].setChar(' ', 0);
+		_self[l].setChar(' ', 0);
 	}
 	break;
-	case discut :
-		dis[l].setChar(' ', 0);
+	case discut:
+		_dis[l].setChar(' ', 0);
 		break;
 	}
 }
@@ -186,7 +188,7 @@ void Menu::menu_aff() {
  */
 void Menu::drawMenu() {
 	menu_aff();
-	active_menu = true;
+	_menuActive = true;
 	msg4 = no_choice;
 	msg3 = no_choice;
 	choisi = false;
@@ -201,19 +203,19 @@ void Menu::invers(int ix) {
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
 	case 1 :
-		s = inv[lo(msg4)];
+		s = _inv[lo(msg4)];
 		break;
 	case 2 :
-		s = dep[lo(msg4)];
+		s = _dep[lo(msg4)];
 		break;
 	case 3 :
-		s = act[lo(msg4)];
+		s = _act[lo(msg4)];
 		break;
 	case 4 :
-		s = self_[lo(msg4)];
+		s = _self[lo(msg4)];
 		break;
 	case 5 :
-		s = dis[lo(msg4)];
+		s = _dis[lo(msg4)];
 		break;
 	case 6 :
 		s = g_vm->getString(S_SAVE_LOAD + lo(msg4));
@@ -292,24 +294,24 @@ void Menu::menuDown(int ii) {
 		cx = succ(int, cx);
 		switch (ii) {
 		case 1 :
-			if (inv[cx][0] != '*')
-				g_vm->_screenSurface.writeg(inv[cx], 4);
+			if (_inv[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_inv[cx], 4);
 			break;
 		case 2 :
-			if (dep[cx][0] != '*')
-				g_vm->_screenSurface.writeg(dep[cx], 4);
+			if (_dep[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_dep[cx], 4);
 			break;
 		case 3 :
-			if (act[cx][0] != '*')
-				g_vm->_screenSurface.writeg(act[cx], 4);
+			if (_act[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_act[cx], 4);
 			break;
 		case 4 :
-			if (self_[cx][0] != '*')
-				g_vm->_screenSurface.writeg(self_[cx], 4);
+			if (_self[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_self[cx], 4);
 			break;
 		case 5 :
-			if (dis[cx][0] != '*')
-				g_vm->_screenSurface.writeg(dis[cx], 4);
+			if (_dis[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_dis[cx], 4);
 			break;
 		case 6 :
 			g_vm->_screenSurface.writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
@@ -366,7 +368,7 @@ void Menu::menuUp(int xx) {
  */
 void Menu::eraseMenu() {
 	/* debug('eraseMenu'); */
-	active_menu = false;
+	_menuActive = false;
 	g_vm->setMouseClick(false);
 	menuUp(msg3);
 }
@@ -380,7 +382,8 @@ void Menu::mdn() {
 	bool tes;
 
 	/* debug('mdn'); */
-	if (! active_menu)  return;
+	if (!_menuActive)
+		return;
 	x = x_s;
 	y = y_s;
 	if (!g_vm->getMouseClick()) {
@@ -415,7 +418,7 @@ void Menu::mdn() {
 		}
 	} else {       /* There was a click */
 		if ((msg3 == fichier) && (msg4 != no_choice)) {
-			// Another menu to be displayed
+			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
 			menuUp(msg3);
 			if (lo(msg4) == 1)  msg3 = 7;
@@ -437,4 +440,57 @@ void Menu::mdn() {
 	}
 }
 
+void Menu::initMenu() {
+	int i, tai;
+	char st[1410];
+	Common::File f;
+
+	if (!f.open("menufr.mor"))
+		error("Missing file - menufr.mor");
+
+	f.read(lettres, 7 * 24);
+	f.close();
+
+	// Ask to swap floppy
+	dem2();
+
+	for (i = 1; i <= 8; i ++)
+		_inv[i] = "*                     ";
+	_inv[7] = "< -*-*-*-*-*-*-*-*-*- ";
+	for (i = 1; i <= 7; i ++)
+		_dep[i] = "*                       ";
+	i = 1;
+	do {
+		deline(i + c_action, st, tai);
+		_act[i] = delig;
+		while (_act[i].size() < 10)
+			_act[i] += ' ';
+
+		if (i < 9) {
+			if (i < 6) {
+				deline(i + c_saction, st, tai);
+				_self[i] = delig;
+				while (_self[i].size() < 10)
+					_self[i] += ' ';
+			}
+			deline(i + c_dis, st, tai);
+			_dis[i] = delig + ' ';
+		}
+		i = succ(int, i);
+	} while (!(i == 22));
+	for (i = 1; i <= 8; i ++) {
+		_disc[i] = 0x500 + i;
+		if (i < 8)
+			_depl[i] = 0x200 + i;
+		_invt[i] = 0x100 + i;
+		if (i > 6)
+			g_vm->_menu.disableMenuItem(_invt[i]);
+	}
+	msg3 = no_choice;
+	msg4 = no_choice;
+	msg[3] = no_choice;
+	msg[4] = no_choice;
+	g_vm->setMouseClick(false);
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 6ab020d..8779d51 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -38,6 +38,16 @@ private:
 	void invers(int ix);
 	void menuDown(int ii);
 public:
+	bool _menuActive;
+	Common::String _inv[9];
+	Common::String _dep[8];
+	Common::String _act[22];
+	Common::String _self[7];
+	Common::String _dis[9];
+	int _disc[9];
+	int _invt[9];
+	int _depl[8];
+public:
 	void menut(int no, Common::String nom);
 	void disableMenuItem(int no);
 	void enableMenuItem(int no);
@@ -46,6 +56,12 @@ public:
 	void menuUp(int xx);
 	void eraseMenu();
 	void mdn();
+	void initMenu();
+};
+
+enum {
+	invent = 1, depla = 2, action = 3, saction = 4,
+	discut = 5, fichier = 6, sauve = 7, charge = 8
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d4461be..013f694 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -324,8 +324,8 @@ void modobj(int m) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
 	}
-	g_vm->_menu.menut(invt[8], strp);
-	g_vm->_menu.disableMenuItem(invt[8]);
+	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
+	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
 }
 
 void modobj2(int m, bool t1, bool t2) {
@@ -341,8 +341,8 @@ void modobj2(int m, bool t1, bool t2) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
 	}
-	g_vm->_menu.menut(invt[8], strp);
-	g_vm->_menu.disableMenuItem(invt[8]);
+	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
+	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
 }
 
 
@@ -446,47 +446,47 @@ void affper(int per) {
 
 	/* debug('affper'); */
 	for (cx = 1; cx <= 8; cx ++)
-		g_vm->_menu.disableMenuItem(disc[cx]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
 		g_vm->_screenSurface.putxy(560, 24);
 		g_vm->_screenSurface.writeg("LEO", 4);
-		g_vm->_menu.enableMenuItem(disc[1]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[1]);
 	}
 	if ((per & 64) == 64) {
 		g_vm->_screenSurface.putxy(560, 32);
 		g_vm->_screenSurface.writeg("PAT", 4);
-		g_vm->_menu.enableMenuItem(disc[2]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[2]);
 	}
 	if ((per & 32) == 32) {
 		g_vm->_screenSurface.putxy(560, 40);
 		g_vm->_screenSurface.writeg("GUY", 4);
-		g_vm->_menu.enableMenuItem(disc[3]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[3]);
 	}
 	if ((per & 16) == 16) {
 		g_vm->_screenSurface.putxy(560, 48);
 		g_vm->_screenSurface.writeg("EVA", 4);
-		g_vm->_menu.enableMenuItem(disc[4]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[4]);
 	}
 	if ((per & 8) == 8) {
 		g_vm->_screenSurface.putxy(560, 56);
 		g_vm->_screenSurface.writeg("BOB", 4);
-		g_vm->_menu.enableMenuItem(disc[5]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[5]);
 	}
 	if ((per & 4) == 4) {
 		g_vm->_screenSurface.putxy(560, 64);
 		g_vm->_screenSurface.writeg("LUC", 4);
-		g_vm->_menu.enableMenuItem(disc[6]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[6]);
 	}
 	if ((per & 2) == 2) {
 		g_vm->_screenSurface.putxy(560, 72);
 		g_vm->_screenSurface.writeg("IDA", 4);
-		g_vm->_menu.enableMenuItem(disc[7]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[7]);
 	}
 	if ((per & 1) == 1) {
 		g_vm->_screenSurface.putxy(560, 80);
 		g_vm->_screenSurface.writeg("MAX", 4);
-		g_vm->_menu.enableMenuItem(disc[8]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[8]);
 	}
 	ipers = per;
 }
@@ -579,7 +579,7 @@ void cpl6(int &p) {
 void person() {
 	/* debug('person'); */
 	for (int cf = 1; cf <= 8; cf ++)
-		g_vm->_menu.disableMenuItem(disc[cf]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
 
 	clsf10();
 	g_vm->_screenSurface.putxy(560, 30);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 557ca06..9a1d271 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -103,7 +103,7 @@ void tinke() {
 		if (cf > 65)  t = t - ((t / 3) * 2);
 		nh = readclock();
 		if ((nh - mh) > t) {
-			am = active_menu;
+			am = g_vm->_menu._menuActive;
 			g_vm->_menu.eraseMenu();
 			jh = jh + ((nh - mh) / t);
 			mh = nh;
@@ -234,12 +234,12 @@ void tmlieu(int mli) {
 		deline(cx + c_tmlieu, st, tail);
 		nomp = delig;
 		while (nomp.size() < 20)  nomp = nomp + ' ';
-		g_vm->_menu.menut(depl[i], nomp);
+		g_vm->_menu.menut(g_vm->_menu._depl[i], nomp);
 		i = i + 1;
 	}
 	nomp = "*                   ";
 	for (cx = 7; cx >= i; cx --)
-		g_vm->_menu.menut(depl[cx], nomp);
+		g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp);
 }
 
 
@@ -375,13 +375,13 @@ void modinv() {
 			r = (ord(s.sjer[cx]) + 400);
 			deline(r - 501 + c_st41, nom, tay);
 			nomp = delig;
-			g_vm->_menu.menut(invt[cy], nomp);
-			g_vm->_menu.enableMenuItem(invt[cx]);
+			g_vm->_menu.menut(g_vm->_menu._invt[cy], nomp);
+			g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]);
 		}
 	if (cy < 6)
 		for (cx = cy + 1; cx <= 6; cx ++) {
-			g_vm->_menu.menut(invt[cx], "                       ");
-			g_vm->_menu.disableMenuItem(invt[cx]);
+			g_vm->_menu.menut(g_vm->_menu._invt[cx], "                       ");
+			g_vm->_menu.disableMenuItem(g_vm->_menu._invt[cx]);
 		}
 }
 
@@ -418,7 +418,7 @@ void mfoudi() {
 	int cx;
 
 	for (cx = 1; cx <= 7; cx ++) 
-		g_vm->_menu.disableMenuItem(depl[cx]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]);
 	for (cx = 1; cx <= 11; cx ++)
 		g_vm->_menu.disableMenuItem(men[cx]);
 
@@ -541,9 +541,7 @@ void tctrm() {
 }
 
 
-void quelquun()
-
-{
+void quelquun() {
 	int haz, cx;
 
 	if (imen)
@@ -566,7 +564,7 @@ L1:
 		caff = 69 + cx;
 		crep = caff;
 		msg[3] = discut;
-		msg[4] = disc[cx];
+		msg[4] = g_vm->_menu._disc[cx];
 		syn = true;
 		col = true;
 	} else {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 29a9d5b..6a7f84c 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -506,7 +506,7 @@ void MortevielleEngine::mainGame() {
 	for (crep = 1; crep <= c_zzz; crep ++) 
 		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	charge_bruit5();
-	init_menu();
+	_menu.initMenu();
 
 	theure();
 	dprog();
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 5bdb54f..53237f7 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -71,60 +71,6 @@ void aff50(bool c) {
 	f3f8();
 }
 
-void init_menu() {
-	int i, tai;
-	char st[1410];
-	Common::File f;
-
-	if (!f.open("menufr.mor"))
-		error("Missing file - menufr.mor");
-
-	f.read(lettres, 7 * 24);
-	f.close();
-
-	// Ask to swap floppy
-	dem2();
-
-
-	for (i = 1; i <= 8; i ++)
-		inv[i] = "*                     ";
-	inv[7] = "< -*-*-*-*-*-*-*-*-*- ";
-	for (i = 1; i <= 7; i ++)
-		dep[i] = "*                       ";
-	i = 1;
-	do {
-		deline(i + c_action, st, tai);
-		act[i] = delig;
-		while (act[i].size() < 10)
-			act[i] += ' ';
-
-		if (i < 9) {
-			if (i < 6) {
-				deline(i + c_saction, st, tai);
-				self_[i] = delig;
-				while (self_[i].size() < 10)
-					self_[i] += ' ';
-			}
-			deline(i + c_dis, st, tai);
-			dis[i] = delig + ' ';
-		}
-		i = succ(int, i);
-	} while (!(i == 22));
-	for (i = 1; i <= 8; i ++) {
-		disc[i] = 0x500 + i;
-		if (i < 8)  depl[i] = 0x200 + i;
-		invt[i] = 0x100 + i;
-		if (i > 6)
-			g_vm->_menu.disableMenuItem(invt[i]);
-	}
-	msg3 = no_choice;
-	msg4 = no_choice;
-	msg[3] = no_choice;
-	msg[4] = no_choice;
-	g_vm->setMouseClick(false);
-}
-
-
 void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 96239ed..6bb553a 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -34,7 +34,6 @@ extern void dem2();
 extern void ani50();
 //extern void apzuul();
 extern void aff50(bool c);
-extern void init_menu();
 extern void charpal();
 extern void chartex();
 extern void dialpre();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 62b1457..27eb5bb 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -111,8 +111,7 @@ bool blo,
         anyone,
         brt,
         rect,
-        rech_cfiec,
-        active_menu;
+        rech_cfiec;
 
 
 int x,
@@ -183,17 +182,9 @@ Common::String al_mess,
        ind_mess,
        al_mess2;
 
-int invt[9];
 int nbrep[9];
 int nbrepm[9];
-int disc[9];
 int msg[5];
-int depl[8];
-Common::String inv[9];
-Common::String dep[8];
-Common::String act[22];
-Common::String self_[7];
-Common::String dis[9];
 char touv[8];
 sav_chaine s, s1;
 byte bufcha[391];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 3e496df..b810033 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -129,14 +129,6 @@ const int amzon = 1650;
 const int fleche = 1758;
 
 const int no_choice = 0;
-const int invent = 1;
-const int depla = 2;
-const int action = 3;
-const int saction = 4;
-const int discut = 5;
-const int fichier = 6;
-const int sauve = 7;
-const int charge = 8;
 
 const int attacher = 0x301;
 const int attendre = 0x302;
@@ -284,8 +276,7 @@ extern bool blo,
         anyone,
         brt,
         rect,
-        rech_cfiec,
-        active_menu;
+        rech_cfiec;
 
 
 extern int x,
@@ -356,17 +347,9 @@ extern Common::String al_mess,
        ind_mess,
        al_mess2;
 
-extern int invt[9];
 extern int nbrep[9];
 extern int nbrepm[9];
-extern int disc[9];
 extern int msg[5];
-extern int depl[8];
-extern Common::String inv[9];
-extern Common::String dep[8];
-extern Common::String act[22];
-extern Common::String self_[7];
-extern Common::String dis[9];
 extern char touv[8];
 extern sav_chaine s, s1;
 extern byte bufcha[391];


Commit: b1d60ae77f6270e77df50d8a05edf581720464cf
    https://github.com/scummvm/scummvm/commit/b1d60ae77f6270e77df50d8a05edf581720464cf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:23-07:00

Commit Message:
MORTEVIELLE: Convert f3/f8 dialog, alert dialog, and ques dialogs into classes

Changed paths:
  A engines/mortevielle/dialogs.cpp
  A engines/mortevielle/dialogs.h
  R engines/mortevielle/alert.cpp
  R engines/mortevielle/alert.h
  R engines/mortevielle/ques.cpp
  R engines/mortevielle/ques.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index dfd0811..02c7b6a 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -27,7 +27,7 @@
 
 #include "common/scummsys.h"
 #include "mortevielle/actions.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -35,7 +35,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/ques.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
@@ -529,12 +528,12 @@ void tmettre() {
 					repon(2, 165);
 					maivid();
 					parole(6, -9, 1);
-					quel = do_alert(g_vm->getString(S_YES_NO), 1);
+					quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 					if (quel == 1)  {
 						deline(582, st, tay);
-						i = do_alert(delig, 1);
+						i = Alert::show(delig, 1);
 						tesok = false;
-						entre = ques();
+						entre = Ques::show();
 						hide_mouse();
 						hirs();
 						dessine_rouleau();
@@ -559,7 +558,7 @@ void tmettre() {
 							aniof(1, 2);
 							aniof(1, 1);
 							deline(577, st, tay);
-							i = do_alert(delig, 1);
+							i = Alert::show(delig, 1);
 							aniof(2, 1);
 							crep = 166;
 						}
@@ -611,7 +610,7 @@ void ttourner() {
 		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
-			quel = do_alert(g_vm->getString(S_YES_NO), 1);
+			quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 			if (quel == 1)
 				g_vm->_endGame = true;
 			else crep = 168;
@@ -620,7 +619,7 @@ void ttourner() {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
-			quel = do_alert(g_vm->getString(S_YES_NO), 1);
+			quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 			if (quel == 1) {
 				s.mlieu = 16;
 				affrep();
@@ -700,7 +699,7 @@ void tfrapper() {
 	if (!syn)
 		ecr3(g_vm->getString(S_HIT));
 	if (s.mlieu == 15) {
-		l = do_alert(g_vm->getString(S_BEFORE_USE_DEP_MENU), 1);
+		l = Alert::show(g_vm->getString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 	if (s.mlieu < 25) {
@@ -930,7 +929,7 @@ void tdormir() {
 		h = h + 1;
 		if (h > 23)  h = 0;
 		tinke();
-		quel = do_alert(g_vm->getString(S_YES_NO), 1);
+		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 		anyone = false;
 	} while (!(quel == 1));
 	crep = 998;
@@ -992,7 +991,7 @@ void tattendre() {
 			return;
 		}
 		repon(2, 102);
-		quel = do_alert(g_vm->getString(S_YES_NO), 1);
+		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 	} while (!(quel == 2));
 	crep = 998;
 	if (! anyone)  tinke();
@@ -1259,7 +1258,7 @@ void MortevielleEngine::loseGame() {
 	heu = 10;
 	jou = 0;
 	repon(2, 180);
-	quel = do_alert(g_vm->getString(S_YES_NO), 1);
+	quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 	_quitGame = (quel != 1);
 }
 
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp
deleted file mode 100644
index a3787a0..0000000
--- a/engines/mortevielle/alert.cpp
+++ /dev/null
@@ -1,270 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/str.h"
-#include "mortevielle/alert.h"
-#include "mortevielle/level15.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-
-namespace Mortevielle {
-
-int do_alert(Common::String str_, int n);
-
-
-const int nligne = 7;
-
-const int coord[3][4] = {
-	{0, 0, 0, 0},
-	{0, 150, 72, 103},
-	{0, 143, 107, 183}
-};
-
-
-static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
-	int i, k;
-	bool v;
-
-	//val(s[2], nbc, i);
-	nbc = atoi(s.c_str() + 1);
-	i = 0;
-
-	c = "";
-	nbl = 0;
-	i = 5;
-	k = 0;
-	v = true;
-	col = 0;
-
-	while (s[i] != ']') {
-		c = c + s[i];
-		if ((s[i] == '|') || (s[i + 1] == ']')) {
-			if (k > col)  col = k;
-			k = 0;
-			nbl = nbl + 1;
-		} else if (s[i] != ' ')  v = false;
-		i = i + 1;
-		k = k + 1;
-	}
-	if (v)  {
-		c = "";
-		col = 20;
-	} else {
-		c = c + ']';
-		col = col + 6;
-	}
-	i = i + 1;
-	cs = copy(s, i, 30);
-	if (res == 2)  col = col * 6;
-	else col = col * 10;
-}
-
-
-
-static void posit(int ji, int &coldep, int &esp) {
-	g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
-}
-
-
-
-static void fait_boite(int lidep, int nli, int tx) {
-	int x, y, xx, yy;
-
-	if (tx > 640)  tx = 640;
-	x = 320 - ((uint)tx >> 1);
-	y = pred(int, lidep) << 3;
-	xx = x + tx;
-	yy = y + (nli << 3);
-	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
-}
-
-
-
-static void fait_choix(Common::String c, int &coldep, int &nbcase, Common::String *str, int &esp) {
-	int i, l, x;
-	char ch;
-
-	i = 1;
-	x = coldep;
-	for (l = 1; l <= nbcase; l ++) {
-		str[l] = "";
-		do {
-			i = i + 1;
-			ch = c[i];
-			str[l] = str[l] + ch;
-		} while (!(c[i + 1] == ']'));
-		i = i + 2;
-		while (str[l].size() < 3)  str[l] = str[l] + ' ';
-		g_vm->_screenSurface.putxy(x, 98);
-
-		Common::String tmp(" ");
-		tmp += str[l];
-		tmp += " ";
-
-		g_vm->_screenSurface.writeg(tmp, 0);
-		x = x + esp + 40;
-	}
-}
-
-int do_alert(Common::String str_, int n) {
-	int coldep, esp, i, nbcase, quoi, ix;
-	Common::String st, chaine;
-	int limit[3][3];
-	char dumi;
-	Common::String s[3];
-	int cx, cy, nbcol, nblig;
-	bool newaff, test, test1, test2, test3, dum;
-	Common::String cas;
-
-	// Make a copy of the current screen surface for later restore
-	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
-
-	/*debug('** do_alert **');*/
-	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
-	int do_alert_result;
-	hide_mouse();
-	while (keypressed())
-		dumi = get_ch();	// input >> kbd >> dumi;
-
-	g_vm->setMouseClick(false);
-	decod(str_, nbcase, nblig, nbcol, chaine, cas);
-	sauvecr(50, succ(int, nligne) << 4);
-
-	i = 0;
-	if (chaine == "") {
-		fait_boite(10, 5, nbcol);
-	} else {
-		fait_boite(8, 7, nbcol);
-		i = 0;
-		g_vm->_screenSurface._textPos.y = 70;
-		do {
-			cx = 320;
-			st = "";
-			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
-				i = i + 1;
-				st = st + chaine[i];
-				if (res == 2)  cx = cx - 3;
-				else cx = cx - 5;
-			}
-			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
-			g_vm->_screenSurface._textPos.y += 6;
-			g_vm->_screenSurface.writeg(st, 4);
-			i = i + 1;
-		} while (!(chaine[i] == ']'));
-	}
-	if (nbcase == 1)  esp = nbcol - 40;
-	else esp = (uint)(nbcol - nbcase * 40) >> 1;
-	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
-	fait_choix(cas, coldep, nbcase, &s[0], esp);
-	limit[1][1] = ((uint)(coldep) >> 1) * res;
-	limit[1][2] = limit[1][1] + 40;
-	if (nbcase == 1) {
-		limit[2][1] = limit[2][2];
-	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
-		limit[2][2] = (limit[2][1]) + 40;
-	}
-	show_mouse();
-	quoi = 0;
-	dum = false;
-	do {
-		dumi = '\377';
-		mov_mouse(dum, dumi);
-		CHECK_QUIT0;
-
-		cx = x_s;
-		cy = y_s;
-		test = (cy > 95) && (cy < 105);
-		newaff = false;
-		if (test) {
-			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
-			test2 = test1;
-			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
-			if (test2) {
-				newaff = true;
-				if (test1)  ix = 1;
-				else ix = 2;
-				if (ix != quoi) {
-					hide_mouse();
-					if (quoi != 0) {
-						posit(quoi, coldep, esp);
-
-						Common::String tmp(" ");
-						tmp += s[quoi];
-						tmp += " ";
-						g_vm->_screenSurface.writeg(tmp, 0);
-					}
-					posit(ix, coldep, esp);
-
-					Common::String tmp2 = " ";
-					tmp2 += s[ix];
-					tmp2 += " ";
-					g_vm->_screenSurface.writeg(tmp2, 1);
-
-					quoi = ix;
-					show_mouse();
-				}
-			}
-		}
-		if ((quoi != 0) && ! newaff) {
-			hide_mouse();
-			posit(quoi, coldep, esp);
-
-			Common::String tmp3(" ");
-			tmp3 += s[quoi];
-			tmp3 += " ";
-			g_vm->_screenSurface.writeg(tmp3, 0);
-
-			quoi = 0;
-			show_mouse();
-		}
-		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
-		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
-	} while (!g_vm->getMouseClick());
-	g_vm->setMouseClick(false);
-	hide_mouse();
-	if (! test3)  {
-		quoi = n;
-		posit(n, coldep, esp);
-		Common::String tmp4(" ");
-		tmp4 += s[n];
-		tmp4 += " ";
-		g_vm->_screenSurface.writeg(tmp4, 1);
-	}
-	charecr(50, succ(int, nligne) << 4);
-	show_mouse();
-
-	/* Restore the background area */
-	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
-
-	do_alert_result = quoi;
-	return do_alert_result;
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/alert.h b/engines/mortevielle/alert.h
deleted file mode 100644
index f7a9e7d..0000000
--- a/engines/mortevielle/alert.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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_ALERT_H
-#define MORTEVIELLE_ALERT_H
-
-#include "common/str.h"
-
-namespace Mortevielle {
-
-extern int do_alert(Common::String str_, int n);
-extern int do_alert(Common::String str_, int n);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
new file mode 100644
index 0000000..3efa80e
--- /dev/null
+++ b/engines/mortevielle/dialogs.cpp
@@ -0,0 +1,447 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "common/str.h"
+#include "mortevielle/dialogs.h"
+#include "mortevielle/keyboard.h"
+#include "mortevielle/level15.h"
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
+#include "mortevielle/parole2.h"
+#include "mortevielle/taffich.h"
+
+namespace Mortevielle {
+
+static const int nligne = 7;
+
+/*
+static const int coord[3][4] = {
+	{0, 0, 0, 0},
+	{0, 150, 72, 103},
+	{0, 143, 107, 183}
+};
+*/
+
+int Alert::show(const Common::String &msg, int n) {
+	int coldep, esp, i, nbcase, quoi, ix;
+	Common::String st, chaine;
+	int limit[3][3];
+	char dumi;
+	Common::String s[3];
+	int cx, cy, nbcol, nblig;
+	bool newaff, test, test1, test2, test3, dum;
+	Common::String cas;
+
+	// Make a copy of the current screen surface for later restore
+	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
+
+	/*debug('** do_alert **');*/
+	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
+	int do_alert_result;
+	hide_mouse();
+	while (keypressed())
+		dumi = get_ch();	// input >> kbd >> dumi;
+
+	g_vm->setMouseClick(false);
+	decod(msg, nbcase, nblig, nbcol, chaine, cas);
+	sauvecr(50, succ(int, nligne) << 4);
+
+	i = 0;
+	if (chaine == "") {
+		fait_boite(10, 5, nbcol);
+	} else {
+		fait_boite(8, 7, nbcol);
+		i = 0;
+		g_vm->_screenSurface._textPos.y = 70;
+		do {
+			cx = 320;
+			st = "";
+			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
+				i = i + 1;
+				st = st + chaine[i];
+				if (res == 2)  cx = cx - 3;
+				else cx = cx - 5;
+			}
+			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
+			g_vm->_screenSurface._textPos.y += 6;
+			g_vm->_screenSurface.writeg(st, 4);
+			i = i + 1;
+		} while (!(chaine[i] == ']'));
+	}
+	if (nbcase == 1)  esp = nbcol - 40;
+	else esp = (uint)(nbcol - nbcase * 40) >> 1;
+	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
+	fait_choix(cas, coldep, nbcase, &s[0], esp);
+	limit[1][1] = ((uint)(coldep) >> 1) * res;
+	limit[1][2] = limit[1][1] + 40;
+	if (nbcase == 1) {
+		limit[2][1] = limit[2][2];
+	} else {
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
+		limit[2][2] = (limit[2][1]) + 40;
+	}
+	show_mouse();
+	quoi = 0;
+	dum = false;
+	do {
+		dumi = '\377';
+		mov_mouse(dum, dumi);
+		CHECK_QUIT0;
+
+		cx = x_s;
+		cy = y_s;
+		test = (cy > 95) && (cy < 105);
+		newaff = false;
+		if (test) {
+			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
+			test2 = test1;
+			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
+			if (test2) {
+				newaff = true;
+				if (test1)  ix = 1;
+				else ix = 2;
+				if (ix != quoi) {
+					hide_mouse();
+					if (quoi != 0) {
+						setPosition(quoi, coldep, esp);
+
+						Common::String tmp(" ");
+						tmp += s[quoi];
+						tmp += " ";
+						g_vm->_screenSurface.writeg(tmp, 0);
+					}
+					setPosition(ix, coldep, esp);
+
+					Common::String tmp2 = " ";
+					tmp2 += s[ix];
+					tmp2 += " ";
+					g_vm->_screenSurface.writeg(tmp2, 1);
+
+					quoi = ix;
+					show_mouse();
+				}
+			}
+		}
+		if ((quoi != 0) && ! newaff) {
+			hide_mouse();
+			setPosition(quoi, coldep, esp);
+
+			Common::String tmp3(" ");
+			tmp3 += s[quoi];
+			tmp3 += " ";
+			g_vm->_screenSurface.writeg(tmp3, 0);
+
+			quoi = 0;
+			show_mouse();
+		}
+		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
+		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
+	} while (!g_vm->getMouseClick());
+	g_vm->setMouseClick(false);
+	hide_mouse();
+	if (! test3)  {
+		quoi = n;
+		setPosition(n, coldep, esp);
+		Common::String tmp4(" ");
+		tmp4 += s[n];
+		tmp4 += " ";
+		g_vm->_screenSurface.writeg(tmp4, 1);
+	}
+	charecr(50, succ(int, nligne) << 4);
+	show_mouse();
+
+	/* Restore the background area */
+	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
+
+	do_alert_result = quoi;
+	return do_alert_result;
+}
+
+void Alert::decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
+	int i, k;
+	bool v;
+
+	//val(s[2], nbc, i);
+	nbc = atoi(s.c_str() + 1);
+	i = 0;
+
+	c = "";
+	nbl = 0;
+	i = 5;
+	k = 0;
+	v = true;
+	col = 0;
+
+	while (s[i] != ']') {
+		c = c + s[i];
+		if ((s[i] == '|') || (s[i + 1] == ']')) {
+			if (k > col)  col = k;
+			k = 0;
+			nbl = nbl + 1;
+		} else if (s[i] != ' ')  v = false;
+		i = i + 1;
+		k = k + 1;
+	}
+	if (v)  {
+		c = "";
+		col = 20;
+	} else {
+		c = c + ']';
+		col = col + 6;
+	}
+	i = i + 1;
+	cs = copy(s, i, 30);
+	if (res == 2)  col = col * 6;
+	else col = col * 10;
+}
+
+void Alert::setPosition(int ji, int coldep, int esp) {
+	g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
+}
+
+void Alert::fait_boite(int lidep, int nli, int tx) {
+	int x, y, xx, yy;
+
+	if (tx > 640)  tx = 640;
+	x = 320 - ((uint)tx >> 1);
+	y = pred(int, lidep) << 3;
+	xx = x + tx;
+	yy = y + (nli << 3);
+	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
+}
+
+
+
+void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
+	int i, l, x;
+	char ch;
+
+	i = 1;
+	x = coldep;
+	for (l = 1; l <= nbcase; l ++) {
+		str[l] = "";
+		do {
+			i = i + 1;
+			ch = c[i];
+			str[l] = str[l] + ch;
+		} while (!(c[i + 1] == ']'));
+		i = i + 2;
+		while (str[l].size() < 3)  str[l] = str[l] + ' ';
+		g_vm->_screenSurface.putxy(x, 98);
+
+		Common::String tmp(" ");
+		tmp += str[l];
+		tmp += " ";
+
+		g_vm->_screenSurface.writeg(tmp, 0);
+		x = x + esp + 40;
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+bool Ques::show() {
+	const int ta[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
+	const int ok[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
+
+	bool q, func, test;
+	int i, j, k, y, memk;
+	int tay , tmax;
+	int rep, prem, der;
+	char st[1410];
+	char key;
+	rectangle coor[max_rect];
+	Common::String chaines[15];
+	int compte;
+
+
+	bool ques_result;
+	test = false;
+	i = 0;
+	compte = 0;
+
+	do {
+		hide_mouse();
+		hirs();
+		show_mouse();
+		i = i + 1;
+		deline(ta[i], st, tay);
+		if (res == 1)  y = 29;
+		else y = 23;
+		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, y));
+		afftex(st, 20, 15, 100, 2, 0);
+		if (i != 10) {
+			prem = ta[i] + 1;
+			der = ta[i + 1] - 1;
+		} else {
+			prem = 503;
+			der = 510;
+		}
+		y = 35;
+		tmax = 0;
+		memk = 1;
+		for (j = prem; j <= der; j ++) {
+			deline(j, st, tay);
+			if (tay > tmax)  tmax = tay;
+			afftex(st, 100, y, 100, 1, 0);
+			chaines[memk] = delig;
+			memk = memk + 1;
+			y = y + 8;
+		}
+		for (j = 1; j <= succ(int, der - prem); j ++) {
+			{
+				rectangle &with = coor[j];
+
+				with.x1 = 45 * res;
+				with.x2 = (tmax * 3 + 55) * res;
+				with.y1 = 27 + j * 8;
+				with.y2 = 34 + j * 8;
+				with.etat = true;
+			}
+			while ((int)chaines[j].size() < tmax) {
+				chaines[j] = chaines[j] + ' ';
+			}
+		}
+		coor[j + 1].etat = false;
+		if (res == 1)  rep = 10;
+		else rep = 6;
+		g_vm->_screenSurface.drawBox(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
+		rep = 0;
+		j = 0;
+		memk = 0;
+		do {
+			g_vm->setMouseClick(false);
+			tesok = false;
+			mov_mouse(func, key);
+			CHECK_QUIT0;
+
+			k = 1;
+			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
+			if (coor[k].etat) {
+				if ((memk != 0) && (memk != k)) {
+					for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
+					st[1 + tmax] = '$';
+					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
+				}
+				if (memk != k) {
+					for (j = 1; j <= tmax; j ++) st[j] = chaines[k][j];
+					st[1 + tmax] = '$';
+					afftex(st, 100, 27 + k * 8, 100, 1, 1);
+					memk = k;
+				}
+			} else if (memk != 0) {
+				for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
+				st[1 + tmax] = '$';
+				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
+				memk = 0;
+			}
+		} while (!((memk != 0) && g_vm->getMouseClick()));
+		if (memk == ok[i])  compte = compte + 1;
+		else {
+			if (i == 5)  i = i + 1;
+			if ((i == 7) || (i == 8))  i = 10;
+		}
+		if (i == 10)  q =   /*testprot*/ true;
+	} while (!(i == 10));
+	ques_result = (compte == 10) && q;
+	return ques_result;
+}
+
+/*------------------------------------------------------------------------*/
+
+/**
+ * Draw the F3/F8 dialog
+ */
+void f3f8::draw() {
+	Common::String f3 = g_vm->getString(S_F3);
+	Common::String f8 = g_vm->getString(S_F8);
+
+	// Write the F3 and F8 text strings
+	g_vm->_screenSurface.putxy(3, 44);
+	g_vm->_screenSurface.writeg(f3, 5);
+	g_vm->_screenSurface._textPos.y = 51;
+	g_vm->_screenSurface.writeg(f8, 5);
+
+	// Get the width of the written text strings
+	int f3Width = g_vm->_screenSurface.getStringWidth(f3);
+	int f8Width = g_vm->_screenSurface.getStringWidth(f8);
+
+	// Write out the bounding box
+	g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
+}
+
+void f3f8::divers(int np, bool b) {
+	teskbd();
+	do {
+		parole(np, 0, 0);
+		atf3f8(key);
+		CHECK_QUIT;
+
+		if (newgd != gd) {
+			gd = newgd;
+			hirs();
+			aff50(b);
+		}
+	} while (!(key == 66));
+}
+
+void f3f8::atf3f8(int &key) {
+	do {
+		key = testou();
+		CHECK_QUIT;
+	} while (!((key == 61) || (key == 66)));
+}
+
+void f3f8::aff50(bool c) {
+	caff = 50;
+	maff = 0;
+	taffich();
+	dessine(ades, 63, 12);
+	if (c)
+		ani50();
+	else
+		repon(2, c_paroles + 142);
+	
+	// Draw the f3/f8 dialog
+	draw();
+}
+
+void f3f8::ani50() {
+	crep = animof(1, 1);
+	pictout(adani, crep, 63, 12);
+	crep = animof(2, 1);
+	pictout(adani, crep, 63, 12);
+	f2_all = (res == 1);
+	repon(2, c_paroles + 143);
+}
+
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
new file mode 100644
index 0000000..260f355
--- /dev/null
+++ b/engines/mortevielle/dialogs.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_ALERT_H
+#define MORTEVIELLE_ALERT_H
+
+#include "common/str.h"
+
+namespace Mortevielle {
+
+class Alert {
+private:
+	static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
+	static void setPosition(int ji, int coldep, int esp);
+	static void fait_boite(int lidep, int nli, int tx);
+	static void fait_choix(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
+public:
+	static int show(const Common::String &s, int n);
+};
+
+class Ques {
+public:
+	static bool show();
+};
+
+class f3f8 {
+public:
+	static void draw();
+	static void divers(int np, bool b);
+	static void atf3f8(int &key);
+	static void aff50(bool c);
+	static void ani50();
+};
+	
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 67ca57d..16f56bc 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -2,9 +2,9 @@ MODULE := engines/mortevielle
 
 MODULE_OBJS := \
 	actions.o \
-	alert.o \
 	asm.o \
 	detection.o \
+	dialogs.o \
 	graphics.o \
 	keyboard.o \
 	level15.o \
@@ -18,7 +18,6 @@ MODULE_OBJS := \
 	parole.o \
 	parole2.o \
 	prog.o \
-	ques.o \
 	saveload.o \
 	sound.o \
 	taffich.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 013f694..eb900d1 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -29,7 +29,7 @@
 #include "common/str.h"
 #include "common/system.h"
 #include "common/textconsole.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
@@ -47,7 +47,7 @@ const int ioresult = 0;
 
 void testfi() {
 	if (ioresult != 0) {
-		caff = do_alert(err_mess, 1);
+		caff = Alert::show(err_mess, 1);
 		g_vm->quitGame();
 	}
 }
@@ -403,24 +403,6 @@ void repon(int f, int m) {
 	}
 }
 
-void f3f8() {
-	Common::String f3 = g_vm->getString(S_F3);
-	Common::String f8 = g_vm->getString(S_F8);
-
-	// Write the F3 and F8 text strings
-	g_vm->_screenSurface.putxy(3, 44);
-	g_vm->_screenSurface.writeg(f3, 5);
-	g_vm->_screenSurface._textPos.y = 51;
-	g_vm->_screenSurface.writeg(f8, 5);
-
-	// Get the width of the written text strings
-	int f3Width = g_vm->_screenSurface.getStringWidth(f3);
-	int f8Width = g_vm->_screenSurface.getStringWidth(f8);
-
-	// Write out the bounding box
-	g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
-}
-
 void t5(int cx) {
 	/* debug('t5'); */
 	if (cx == 10)  blo = false;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index cabc3c4..2287924 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -62,7 +62,6 @@ extern void okpas();
 extern void modobj(int m);
 extern void modobj2(int m, bool t1, bool t2);
 extern void repon(int f, int m);
-extern void f3f8();
 extern void t5(int cx);
 extern void affper(int per);
 extern void choix(int min, int max, int &per);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9a1d271..c388c4a 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -26,7 +26,7 @@
  */
 
 #include "mortevielle/mor2.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -280,13 +280,6 @@ void mfouen()
 	g_vm->_menu.menut(soulever, g_vm->getString(S_RAISE));
 }
 
-void atf3f8(int &key) {
-	do {
-		key = testou();
-		CHECK_QUIT;
-	} while (!((key == 61) || (key == 66)));
-}
-
 /* NIVEAU 6 */
 
 void tperd() {
@@ -394,12 +387,12 @@ void sparl(float adr, float rep) {
 	hide_mouse();
 	deline(repint + c_paroles, st, tay);
 	afftex(st, 230, 4, 65, 24, 5);
-	f3f8();
+	f3f8::draw();
 	
 	key = 0;
 	do {
 		parole(repint, haut[caff - 69], 0);
-		atf3f8(key);
+		f3f8::atf3f8(key);
 		CHECK_QUIT;
 	} while (!(key == 66));
 	hirs();
@@ -631,7 +624,7 @@ void tfleche() {
 			tinke();
 		} while (!(qust || rect || anyone));
 
-		if (qust && (touch == '\103'))  dummy = do_alert(stpou, 1);
+		if (qust && (touch == '\103'))  dummy = Alert::show(stpou, 1);
 	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) ||
 	           (anyone) || (rect)));
 	if (touch == '\73')  iesc = true;
@@ -767,7 +760,7 @@ void st13(int ob) {
 void aldepl() {
 	int dummy;
 
-	dummy = do_alert(g_vm->getString(S_USE_DEP_MENU), 1);
+	dummy = Alert::show(g_vm->getString(S_USE_DEP_MENU), 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 6668d54..1d66548 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -41,7 +41,6 @@ extern void tlu(int af, int ob);
 extern void delin(int n);
 extern void affrep();
 extern void mfouen();
-extern void atf3f8(int &key);
 /* NIVEAU 6 */
 extern void tperd();
 extern void tsort();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6a7f84c..b35e986 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -30,7 +30,7 @@
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/actions.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/level15.h"
@@ -467,13 +467,13 @@ Common::Error MortevielleEngine::run() {
  * Show the game introduction
  */
 void MortevielleEngine::showIntroduction() {
-	aff50(false);
+	f3f8::aff50(false);
 	mlec = 0;
-	divers(142, false);
+	f3f8::divers(142, false);
 	CHECK_QUIT;
 
-	ani50();
-	divers(143, true);
+	f3f8::ani50();
+	f3f8::divers(143, true);
 	CHECK_QUIT;
 
 	// TODO: Once music is implemented, only use the below delay if music is turned off
@@ -482,21 +482,6 @@ void MortevielleEngine::showIntroduction() {
 	music();
 }
 
-void MortevielleEngine::divers(int np, bool b) {
-	teskbd();
-	do {
-		parole(np, 0, 0);
-		atf3f8(key);
-		CHECK_QUIT;
-
-		if (newgd != gd) {
-			gd = newgd;
-			hirs();
-			aff50(b);
-		}
-	} while (!(key == 66));
-}
-
 /**
  * Main game loop. Handles potentially playing the game multiple times, such as if the player
  * loses, and chooses to start playing the game again.
@@ -583,7 +568,7 @@ void MortevielleEngine::handleAction() {
 		if (choisi && (msg[3] == charge))
 			g_vm->_savegameManager.loadGame((msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
-			temps = do_alert(stpou, 1);
+			temps = Alert::show(stpou, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((mnumo != no_choice) && ((msg[3] == action) || (msg[3] == saction))) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 371dd40..b0f1c4c 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -93,7 +93,6 @@ private:
 	void mainGame();
 	void playGame();
 	void handleAction();
-	void divers(int np, bool b);
 public:
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 53237f7..33f879d 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -26,7 +26,7 @@
  */
 
 #include "common/file.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
@@ -52,25 +52,6 @@ void dem2() {
 	// Deprecated under ScummVM
 }
 
-void ani50() {
-	crep = animof(1, 1);
-	pictout(adani, crep, 63, 12);
-	crep = animof(2, 1);
-	pictout(adani, crep, 63, 12);
-	f2_all = (res == 1);
-	repon(2, c_paroles + 143);
-}
-
-void aff50(bool c) {
-	caff = 50;
-	maff = 0;
-	taffich();
-	dessine(ades, 63, 12);
-	if (c)  ani50();
-	else repon(2, c_paroles + 142);
-	f3f8();
-}
-
 void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 6bb553a..13a8f5d 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -31,9 +31,7 @@
 namespace Mortevielle {
 
 extern void dem2();
-extern void ani50();
 //extern void apzuul();
-extern void aff50(bool c);
 extern void charpal();
 extern void chartex();
 extern void dialpre();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 7f61b79..8d905af 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -26,7 +26,7 @@
  */
 
 #include "mortevielle/actions.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
diff --git a/engines/mortevielle/ques.cpp b/engines/mortevielle/ques.cpp
deleted file mode 100644
index e8c568d..0000000
--- a/engines/mortevielle/ques.cpp
+++ /dev/null
@@ -1,144 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/str.h"
-#include "mortevielle/level15.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-#include "mortevielle/ques.h"
-
-namespace Mortevielle {
-
-bool ques() {
-	const int ta[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
-	const int ok[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
-
-	bool q, func, test;
-	int i, j, k, y, memk;
-	int tay , tmax;
-	int rep, prem, der;
-	char st[1410];
-	char key;
-	rectangle coor[max_rect];
-	Common::String chaines[15];
-	int compte;
-
-
-	bool ques_result;
-	test = false;
-	i = 0;
-	compte = 0;
-
-	do {
-		hide_mouse();
-		hirs();
-		show_mouse();
-		i = i + 1;
-		deline(ta[i], st, tay);
-		if (res == 1)  y = 29;
-		else y = 23;
-		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, y));
-		afftex(st, 20, 15, 100, 2, 0);
-		if (i != 10) {
-			prem = ta[i] + 1;
-			der = ta[i + 1] - 1;
-		} else {
-			prem = 503;
-			der = 510;
-		}
-		y = 35;
-		tmax = 0;
-		memk = 1;
-		for (j = prem; j <= der; j ++) {
-			deline(j, st, tay);
-			if (tay > tmax)  tmax = tay;
-			afftex(st, 100, y, 100, 1, 0);
-			chaines[memk] = delig;
-			memk = memk + 1;
-			y = y + 8;
-		}
-		for (j = 1; j <= succ(int, der - prem); j ++) {
-			{
-				rectangle &with = coor[j];
-
-				with.x1 = 45 * res;
-				with.x2 = (tmax * 3 + 55) * res;
-				with.y1 = 27 + j * 8;
-				with.y2 = 34 + j * 8;
-				with.etat = true;
-			}
-			while ((int)chaines[j].size() < tmax) {
-				chaines[j] = chaines[j] + ' ';
-			}
-		}
-		coor[j + 1].etat = false;
-		if (res == 1)  rep = 10;
-		else rep = 6;
-		g_vm->_screenSurface.drawBox(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
-		rep = 0;
-		j = 0;
-		memk = 0;
-		do {
-			g_vm->setMouseClick(false);
-			tesok = false;
-			mov_mouse(func, key);
-			CHECK_QUIT0;
-
-			k = 1;
-			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
-			if (coor[k].etat) {
-				if ((memk != 0) && (memk != k)) {
-					for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
-					st[1 + tmax] = '$';
-					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
-				}
-				if (memk != k) {
-					for (j = 1; j <= tmax; j ++) st[j] = chaines[k][j];
-					st[1 + tmax] = '$';
-					afftex(st, 100, 27 + k * 8, 100, 1, 1);
-					memk = k;
-				}
-			} else if (memk != 0) {
-				for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
-				st[1 + tmax] = '$';
-				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
-				memk = 0;
-			}
-		} while (!((memk != 0) && g_vm->getMouseClick()));
-		if (memk == ok[i])  compte = compte + 1;
-		else {
-			if (i == 5)  i = i + 1;
-			if ((i == 7) || (i == 8))  i = 10;
-		}
-		if (i == 10)  q =   /*testprot*/ true;
-	} while (!(i == 10));
-	ques_result = (compte == 10) && q;
-	return ques_result;
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/ques.h b/engines/mortevielle/ques.h
deleted file mode 100644
index 7260bfa..0000000
--- a/engines/mortevielle/ques.h
+++ /dev/null
@@ -1,38 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_QUES_H
-#define MORTEVIELLE_QUES_H
-
-#include "common/str.h"
-
-namespace Mortevielle {
-
-extern bool ques();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 4f37c28..0b3946a 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -27,7 +27,7 @@
 
 #include "common/file.h"
 #include "common/system.h"
-#include "mortevielle/alert.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/mortevielle.h"


Commit: 8ffa0f9b155d86b3e6a7c1b0fcc26605b85b93c4
    https://github.com/scummvm/scummvm/commit/8ffa0f9b155d86b3e6a7c1b0fcc26605b85b93c4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:24-07:00

Commit Message:
MORTEVIELLE: Fix the 'You Are Alone' to be properly justified with English text

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index eb900d1..de78447 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -246,10 +246,8 @@ void clsf10() {
 		st = g_vm->getString(S_LOURDE);
 	else if (s.conf > 65)
 		st = g_vm->getString(S_MALSAINE);
-	if (res == 1)
-		co = 10;
-	else co = 6;
-	co = 574 - ((uint)co * st.size() >> 1);
+	
+	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
 	g_vm->_screenSurface.putxy(co, 92);
 	g_vm->_screenSurface.writeg(st, 4);
 	if (res == 1)  co = 620;
@@ -563,13 +561,18 @@ void person() {
 	for (int cf = 1; cf <= 8; cf ++)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
 
+	Common::String sYou = g_vm->getString(S_YOU);
+	Common::String sAre = g_vm->getString(S_ARE);
+	Common::String sAlone = g_vm->getString(S_ALONE);
+
 	clsf10();
-	g_vm->_screenSurface.putxy(560, 30);
-	g_vm->_screenSurface.writeg(g_vm->getString(S_YOU), 4);
-	g_vm->_screenSurface.putxy(560, 50);
-	g_vm->_screenSurface.writeg(g_vm->getString(S_ARE), 4);
-	g_vm->_screenSurface.putxy(560, 70);
-	g_vm->_screenSurface.writeg(g_vm->getString(S_ALONE), 4);
+	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sYou) / 2), 30);
+	g_vm->_screenSurface.writeg(sYou, 4);
+	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAre) / 2), 50);
+	g_vm->_screenSurface.writeg(sAre, 4);
+	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAlone) / 2), 70);
+	g_vm->_screenSurface.writeg(sAlone, 4);
+
 	ipers = 0;
 }
 


Commit: 58a67ed11b006ba8a62525e65e412f38000d533f
    https://github.com/scummvm/scummvm/commit/58a67ed11b006ba8a62525e65e412f38000d533f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:26-07:00

Commit Message:
TOOLS: Add header files to create_mortdat, remove second parameter

Changed paths:
  A devtools/create_mortdat/create_mortdat.h
  A devtools/create_mortdat/enginetext.h
    devtools/create_mortdat/create_mortdat.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index aff67dc..2f15398 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -38,74 +38,11 @@
 #include <string.h>
 
 #include "common/endian.h"
-
-enum AccessMode {
-	kFileReadMode = 1,
-	kFileWriteMode = 2
-};
-
-class File {
-private:
-	FILE *f;
-public:
-	bool open(const char *filename, AccessMode mode = kFileReadMode) {
-		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
-		return (f != NULL);
-	}
-	void close() {
-		fclose(f);
-		f = NULL;
-	}
-	int seek(int32 offset, int whence = SEEK_SET) {
-		return fseek(f, offset, whence);
-	}
-	long read(void *buffer, int len) {
-		return fread(buffer, 1, len, f);
-	}
-	void write(const void *buffer, int len) {
-		fwrite(buffer, 1, len, f);
-	}
-	byte readByte() {
-		byte v;
-		read(&v, sizeof(byte));
-		return v;
-	}
-	uint16 readWord() {
-		uint16 v;
-		read(&v, sizeof(uint16));
-		return FROM_LE_16(v);
-	}
-	uint32 readLong() {
-		uint32 v;
-		read(&v, sizeof(uint32));
-		return FROM_LE_32(v);
-	}
-	void writeByte(byte v) {
-		write(&v, sizeof(byte));
-	}
-	void writeWord(uint16 v) {
-		uint16 vTemp = TO_LE_16(v);
-		write(&vTemp, sizeof(uint16));
-	}
-	void writeLong(uint32 v) {
-		uint32 vTemp = TO_LE_32(v);
-		write(&vTemp, sizeof(uint32));
-	}
-	void writeString(const char *s) {
-		write(s, strlen(s) + 1);
-	}
-	uint32 pos() {
-		return ftell(f);
-	}
-};
-
-File outputFile, mortCom;
+#include "create_mortdat.h"
+#include "enginetext.h"
 
 /*-------------------------------------------------------------------------*/
 
-#define VERSION_MAJOR 1
-#define VERSION_MINOR 0
-
 void openOutputFile(const char *outFilename) {
 	outputFile.open(outFilename, kFileWriteMode);
 
@@ -171,143 +108,29 @@ void writeStaticStrings(const char **strings, int languageId) {
 }
 
 /**
- * Write out the French strings previously hard-coded into the application
- */
-void writeEnglishStaticStrings() {
-	const char *string_list[] =  {
-		"[2][ ][YES][NO]",
-		"Go to",
-		"Someone enters, looks surised, but says nothing",
-		"Cool",
-		" Lourde ",
-		"Malsaine",
-		"Idem",
-		"You",
-		"are",
-		"Alone",
-
-		"Gosh! You hear some noise...",
-		" | You should have noticed,   |       ",
-		"% of hints...",
-		"Do you want to wake up?",
-		"OK",
-		"", 
-		" Save",
-
-		" Load",
-		" Restart     ",
-		"F3: Repeat",
-		"F8: Proceed",
-		"Hide self",
-		"take",
-		" probe    ",
-		" raise    ",
-		" -SUITE- ",
-		" -STOP-  ",
-		"[1] [So, use the DEP menu] [Ok]",
-		"lift",
-		"read",
-
-		"look",
-		"search",
-		"open",
-		"put",
-		"turn",
-		"tie",
-		"close",
-		"hit",
-		"pose",
-		"smash",
-
-		"smell",
-		"scratch",
-		"probe",
-		"[1] [ | Before, use the DEP menu...] [Ok]",
-		"& day",
-		NULL
-	};
-
-	writeStaticStrings(string_list, 1);
-}
-
-/**
- * Write out the French strings previously hard-coded into the application
+ * Write out the strings previously hard-coded into the engine
  */
-void writeFrenchStaticStrings() {
-	const char *string_list[] = {
-		"[2][ ][OUI][NON]",
-		"aller",
-		"quelqu'un entre, parait ‚tonn‚ mais ne dit rien",
-		"Cool",
-		" Lourde ",
-		"Malsaine",
-		"Idem",
-		"Vous",
-		"ˆtes",
-		"SEUL",
-
-		"Mince! Vous entendez du bruit...",
-		" | Vous devriez avoir remarqu‚|       ",
-		"% des indices...",
-		"D‚sirez-vous vous r‚veiller?",
-		"OK",
-		"", 
-		" Sauvegarde",
-
-		" Chargement",
-		" Recommence  ",
-		"F3: Encore",
-		"F8: Suite",
-		"se cacher",
-
-		"prendre",
-		" sonder   ",
-		"soulever",
-		" -SUITE- ",
-		" -STOP-  ",
-		"[1][Alors, utilisez le menu DEP...][ok]",
-		"soulever",
-		"lire",
-
-		"regarder",
-		"fouiller",
-		"ouvrir",
-		"mettre",
-		"tourner",
-		"attacher",
-		"fermer",
-		"frapper",
-		"poser",
-		"d‚foncer",
-
-		"sentir",
-		"gratter",
-		"sonder",
-		"[1][ | Avant, utilisez le menu DEP...][ok]",
-		"& jour",
-		NULL
-	};
-
-	writeStaticStrings(string_list, 0);
+void writeEngineStrings() {
+	writeStaticStrings(engineDataEn, 1);
+	writeStaticStrings(engineDataFr, 0);
 }
 
 void process() {
 	writeFontBlock();
-	writeEnglishStaticStrings();
-	writeFrenchStaticStrings();
+	writeEngineStrings();
 }
 
 /**
  * Main method
  */
 int main(int argc, char *argv[]) {
-	if (argc != 3) {
-		printf("Format: input_filename output_filename\n", argv[0]);
+	if (argc != 2) {
+		printf("Usage:\n%s input_filename\nWhere input_filename is the name of the Mortevielle DOS executable", argv[0]);
 		exit(0);
 	}
 
 	mortCom.open(argv[1], kFileReadMode);
-	openOutputFile(argv[2]);
+	openOutputFile("mort.dat");
 
 	process();
 
diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
new file mode 100644
index 0000000..c46ad8a
--- /dev/null
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -0,0 +1,90 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This is a utility for extracting needed resource data from different language
+ * version of the Mortevielle executable files into a new file mort.dat - this
+ * is required for the ScummVM Mortevielle module to work properly
+ */
+
+#define VERSION_MAJOR 1
+#define VERSION_MINOR 0
+
+enum AccessMode {
+	kFileReadMode = 1,
+	kFileWriteMode = 2
+};
+
+class File {
+private:
+	FILE *f;
+public:
+	bool open(const char *filename, AccessMode mode = kFileReadMode) {
+		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
+		return (f != NULL);
+	}
+	void close() {
+		fclose(f);
+		f = NULL;
+	}
+	int seek(int32 offset, int whence = SEEK_SET) {
+		return fseek(f, offset, whence);
+	}
+	long read(void *buffer, int len) {
+		return fread(buffer, 1, len, f);
+	}
+	void write(const void *buffer, int len) {
+		fwrite(buffer, 1, len, f);
+	}
+	byte readByte() {
+		byte v;
+		read(&v, sizeof(byte));
+		return v;
+	}
+	uint16 readWord() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_LE_16(v);
+	}
+	uint32 readLong() {
+		uint32 v;
+		read(&v, sizeof(uint32));
+		return FROM_LE_32(v);
+	}
+	void writeByte(byte v) {
+		write(&v, sizeof(byte));
+	}
+	void writeWord(uint16 v) {
+		uint16 vTemp = TO_LE_16(v);
+		write(&vTemp, sizeof(uint16));
+	}
+	void writeLong(uint32 v) {
+		uint32 vTemp = TO_LE_32(v);
+		write(&vTemp, sizeof(uint32));
+	}
+	void writeString(const char *s) {
+		write(s, strlen(s) + 1);
+	}
+	uint32 pos() {
+		return ftell(f);
+	}
+};
+
+File outputFile, mortCom;
+
diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
new file mode 100644
index 0000000..fb4d12d
--- /dev/null
+++ b/devtools/create_mortdat/enginetext.h
@@ -0,0 +1,136 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This is a utility for extracting needed resource data from different language
+ * version of the Mortevielle executable files into a new file mort.dat - this
+ * is required for the ScummVM Mortevielle module to work properly
+ */
+
+#ifndef ENGINEDATA_H
+#define ENGINEDATA_H
+
+const char *engineDataEn[] =  {
+	"[2][ ][YES][NO]",
+	"Go to",
+	"Someone enters, looks surised, but says nothing",
+	"Cool",
+	" Lourde ",
+	"Malsaine",
+	"Idem",
+	"You",
+	"are",
+	"Alone",
+
+	"Gosh! You hear some noise...",
+	" | You should have noticed,   |       ",
+	"% of hints...",
+	"Do you want to wake up?",
+	"OK",
+	"", 
+	" Save",
+
+	" Load",
+	" Restart     ",
+	"F3: Repeat",
+	"F8: Proceed",
+	"Hide self",
+	"take",
+	" probe    ",
+	" raise    ",
+	" -SUITE- ",
+	" -STOP-  ",
+	"[1] [So, use the DEP menu] [Ok]",
+	"lift",
+	"read",
+
+	"look",
+	"search",
+	"open",
+	"put",
+	"turn",
+	"tie",
+	"close",
+	"hit",
+	"pose",
+	"smash",
+
+	"smell",
+	"scratch",
+	"probe",
+	"[1] [ | Before, use the DEP menu...] [Ok]",
+	"& day",
+	NULL
+};
+
+const char *engineDataFr[] = {
+	"[2][ ][OUI][NON]",
+	"aller",
+	"quelqu'un entre, parait ‚tonn‚ mais ne dit rien",
+	"Cool",
+	" Lourde ",
+	"Malsaine",
+	"Idem",
+	"Vous",
+	"ˆtes",
+	"SEUL",
+
+	"Mince! Vous entendez du bruit...",
+	" | Vous devriez avoir remarqu‚|       ",
+	"% des indices...",
+	"D‚sirez-vous vous r‚veiller?",
+	"OK",
+	"", 
+	" Sauvegarde",
+
+	" Chargement",
+	" Recommence  ",
+	"F3: Encore",
+	"F8: Suite",
+	"se cacher",
+
+	"prendre",
+	" sonder   ",
+	"soulever",
+	" -SUITE- ",
+	" -STOP-  ",
+	"[1][Alors, utilisez le menu DEP...][ok]",
+	"soulever",
+	"lire",
+
+	"regarder",
+	"fouiller",
+	"ouvrir",
+	"mettre",
+	"tourner",
+	"attacher",
+	"fermer",
+	"frapper",
+	"poser",
+	"d‚foncer",
+
+	"sentir",
+	"gratter",
+	"sonder",
+	"[1][ | Avant, utilisez le menu DEP...][ok]",
+	"& jour",
+	NULL
+};
+
+#endif


Commit: 7d03b094b5640fb389954da079c72a190c2c90d0
    https://github.com/scummvm/scummvm/commit/7d03b094b5640fb389954da079c72a190c2c90d0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:27-07:00

Commit Message:
TOOL: Use a define for output name

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/create_mortdat.h



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 2f15398..eb476c1 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
 	}
 
 	mortCom.open(argv[1], kFileReadMode);
-	openOutputFile("mort.dat");
+	openOutputFile(MORT_DAT);
 
 	process();
 
diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
index c46ad8a..d9c7561 100644
--- a/devtools/create_mortdat/create_mortdat.h
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -31,6 +31,8 @@ enum AccessMode {
 	kFileWriteMode = 2
 };
 
+#define MORT_DAT "mort.dat"
+
 class File {
 private:
 	FILE *f;


Commit: 6e7445cde0261c6d45953d1d9876ddca55bf819e
    https://github.com/scummvm/scummvm/commit/6e7445cde0261c6d45953d1d9876ddca55bf819e
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:28-07:00

Commit Message:
TOOLS: Add ingame text.

This will allow us to get an English version, and will help when we'll try to support Atari/Amiga version using hardcoded ingame texts

Changed paths:
  A devtools/create_mortdat/gametext.h
    devtools/create_mortdat/create_mortdat.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index eb476c1..de4bb41 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -40,6 +40,7 @@
 #include "common/endian.h"
 #include "create_mortdat.h"
 #include "enginetext.h"
+#include "gametext.h"
 
 /*-------------------------------------------------------------------------*/
 
@@ -115,9 +116,18 @@ void writeEngineStrings() {
 	writeStaticStrings(engineDataFr, 0);
 }
 
+/**
+ * Write out the strings used in the game
+ */
+void writeGameStrings() {
+	writeStaticStrings(gameDataEn, 1);
+	writeStaticStrings(gameDataFr, 0);
+}
+
 void process() {
 	writeFontBlock();
 	writeEngineStrings();
+	writeGameStrings();
 }
 
 /**
diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
new file mode 100644
index 0000000..6905fdf
--- /dev/null
+++ b/devtools/create_mortdat/gametext.h
@@ -0,0 +1,1206 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * This is a utility for extracting needed resource data from different language
+ * version of the Mortevielle executable files into a new file mort.dat - this
+ * is required for the ScummVM Mortevielle module to work properly
+ */
+
+#ifndef GAMEDATA_H
+#define GAMEDATA_H
+
+const char *gameDataEn[] =  {
+	"Calm within the storm$",
+	"Discussed in colours$",
+	"Your mauve!$",
+	"Be kind enough to leave the room...$",
+	"If you're NOT overdrawn...$",
+	"If you're feeling blue...$",
+	"Read what's on the walls?$",
+	"Water sports$",
+	"Room for envy?$",
+	"A glance at the forbidden$",
+	"Smell of a woodfire and tobacco$",
+	"Tobacco and old books$",
+	"Onions, cinnamon and spirits$",
+	"A place seldom visited$",
+	"Humidity and decay$",
+	"Sorry, no ""door to door""$",
+	"Rotting corpse: deady cryptomania$",
+	"And what's more, there are disused traps$",
+	"It's already open$",
+	"Danger: avalanches$",
+	"Proper Charlie's place?$",
+	"An imposing building$",
+	"The other side of the mystery$",
+	"Strange horoscope$",
+	"Look out... but she wishes well?$",
+	"An oak door$",
+	"A photograph$",
+	"The coat of arms$",
+	"$",
+	"Max, the servant, welcomes you and shows you to your room$",
+	"Mortville     6/2/51@         My dear Jerome at Regarding my telegram, I must tell  you  the reason for my wor- at ries. A year ago, Murielle, my lady companion, disappeared. The de at part may have had something to do at with the financial success of themanor, or... A silence hard to un at derstand for my son Guy.  Not  ha at ving been able to see the  light of day over this affair, I count @on you to sort things out. If my state of health doesn't improve, @take the decisions that you feel @are apropriate.@             Kind regards, Julia DEFRANCK$",
+	"Later, Guy will inform you of Leo's suicide after a at heavy bet at the races$",
+	"F3: AGAIN             F8: STOP$",
+	"The master of the premises$",
+	"The future heir$",
+	"JULIA's son$",
+	"A pretty picture$",
+	"Superman!$",
+	"Ida's husband$",
+	"Interesting remarks?$",
+	"Service included!$",
+	"Nothing underneath$",
+	"You could hear a pin drop$",
+	"Half an hour passes: nothing! Wait any longer?$",
+	"Admire! Contemplate!$",
+	"No! Nothing!$",
+	"Impossible$",
+	"That stains!$",
+	"A treatise on the history of the area$",
+	"A few coins...$",
+	"First commandment...$",
+	"Pleasing to the nostrils!$",
+	"Spades, Hearts...$",
+	"Just a spoonful of sugar...$",
+	"A romantic novel$",
+	"Worth more than a penny, (whistle)$",
+	"Just needs a little patience$",
+	"Watch the sharp bends$",
+	"Deep and dark$",
+	"Normal sensations$",
+	"Sniff!$",
+	"Not discreet! Be content to watch!$",
+	"Bless you! Dusty!$",
+	"The canvas is signed, the wallpaper is not!$",
+	"Nothing, Unlucky!$",
+	"Be more discreet!$",
+	"The shutters are closed$",
+	"Snow! And more snow!$",
+	"Brilliant! The work of a master!$",
+	"No doubt at all! A genuine fake!$",
+	"Hmm! A cheap reproduction!$",
+	"A rare and valuable piece$",
+	"Nothing special$",
+	"Linen, personal belongings...$",
+	"Not just anywhere!$",
+	"It's not time!$",
+	"One doesn't speak with ones mouth full!$",
+	"Someone comes in, messes about then goes out again$",
+	"Someone's approaching your hiding-place$",
+	"Someone surprises you!$",
+	"Impossible! You're too loaded!$",
+	"Try again!$",
+	"Still puzzled!?$",
+	"You leave Mortville.In Paris a message awaits you...$",
+	"You hurt yourself$",
+	"Nothing more here$",
+	"The sound seems normal$",
+	"It doesn't move$",
+	"You are answered$",
+	"Not the right moment!$",
+	"The same matter, from another angle!$",
+	"The reflection is tarnished, but the frame is gold!$",
+	"Bric-a-brac$",
+	"Face to face with failure!$",
+	"Smells like something you'd rather not see!$",
+	"Cleaning products$",
+	"Got an itch?$",
+	"It's stuck, frozen. Brrr!$",
+	"All the locks are jammed!$",
+	"Papers$",
+	"No! Father christmas hasn't got himself stuck!$",
+	"It leads onto a corridor$",
+	"China, silverware...$",
+	"No! It's not Julia's remains!$",
+	"An old engraving$",
+	"You find a deep diamond-shaped opening$",
+	"The wall slides open! A passage! Do you follow it?$",
+	"The passageway closes$",
+	"A secret drawer: a notebook! Do you read it?$",
+	"The drawer shuts$",
+	"Nothing! Flesh and blood stuck to the stone$",
+	"Certain details lead you to believe death was not immediate!$",
+	"A rotten affair!$",
+	"Did she cling to dear life with just one finger?$",
+	"Has the treasure packed its trunk?$",
+	"A slot the size of a coin$",
+	"Part of the stone wall pivots.A crypt! Do you enter?$",
+	"The ring turns, the wall closes$",
+	"A stone column behind the altar$",
+	"There is a noise!$",
+	"Occupied!$",
+	"Take another chance?$",
+	"Too deep!$",
+	"The cellar wall pivots$",
+	"Nothing$",
+	"The one and only!$",
+	"The object slides to the bottom$",
+	"You have nothing in hand$",
+	"It is not open$",
+	"There is already something$",
+	"The door is locked$",
+	"No reply$",
+	"A solid wooden ball$",
+	"There's no more space$",
+	"A wooden ball pierced through the side$",
+	"? ?$",
+	"Your move$",
+	"OK !$",
+	"Suddenly  Max  arrives with your suitcase:  \"Thank  you  for your @visit!\".Mister discreet \"private eye\" (in need of a private optici at an!). Thoroughly demoralised, you at leave the manor. You are useless!$",
+	"Leo interrupts:  \"The storm has  died down,I am going into town in at 1 hour. Get ready\". You have lost at time...but not your life$",
+	"Congestion, the deadly flu... You at are stuck here! Your  whole  case at sinks slowly beneath the water$",
+	"The water is rising fast,freezing your last illusions. Before you at have time to react...you are dead$",
+	"As soon as you reach the bottom  of the well, a hand cuts the rope at Farewell sweet life!$",
+	"The storm covers your footprints.A wall of  silence falls heavily at on your shoulders. Slowly you  succumb to frosbite...$",
+	"You're not completely alone!  A  cold blade plunges into your backup at In future, be more care!$",
+	"You don't know what implication  Leo may have had  in  Murielle's at death. Was she dead outright? In at any case,the family problems thatyou have uncovered in the course at of your enquiries would explain  Leo's behaviour. You're not sure at that's the reason Julia had asked at for your help, but that's reason enough for you!Out of respect for at her, after taking certain precau- at tions you have a revealing  talk with Leo.$",
+	"$",
+	"You don't have the keys to  the  manor. Your  cries  rest  unheard at You're   going   to   catch...             your death!$",
+	"With  a  circular  movement, the sword slices across you. Guts and at intestines spill out all over. A sorry state of affairs!$",
+	"Home, Sweet home !$",
+	"The mystery behind a closed door$",
+	"Bewitching charm of these old rooms$",
+	"An empty stomach$",
+	"Closer to heaven? Not so sure$",
+	"Afraid of the dark?$",
+	"Old rugs and a glint of gold$",
+	"Anguish!$",
+	"Safe? Perhaps not!$",
+	"A little ill at ease, eh!?$",
+	"Always further$",
+	"Your way of the cross!$",
+	"On the trail of...$",
+	"Watch what's hiding$",
+	"The road down to hell$",
+	"Feeling well? You look a little pale$",
+	"What lurks behind...?$",
+	"Close-up on:$",
+	"You notice, amongst other things$",
+	"And...$",
+	"That's all!$",
+	"A bit of reading$",
+	"The adventure awaits, you set off!$",
+	"Don't mess up YOUR next ADVENTURE!$",
+	"I don't understand$",
+	"There is an easier way$",
+	"No, not just now$",
+	"Too late$",
+	"$",
+	"Like a deep stony stare, a solitary  eye  that points towards the at stars; the artery that links hea-ven and hell.  You  must  fathom at these depths keeping hold of that at which is, and will become. Monday, Tuesday, Wednesday, Sunday, from at Monday 1st to Sunday 1st,plunging from one  day  to  the next your@\"IS\" or \"WILL BECOME\".  Carrying your burden with love and light, at the smallest oversight will seal your fate.$",
+	"10/1/51: We think  we've  solved the mystery of the manuscript and at located the crypt. Is it the idea at of success in what seems like  a dream that disturbs me so? I feel at I have committed myself  rather  too much, as far as Leo is concer at ned... No! I should go on.       @I should have put Guy in the pic-ture but for a week now, I've had at no news of him$",
+	"Take your prayers as you would to the holy place.  From  the  pillar at of wisdom, bring the sun to  his at knees. Thus will it show you the place to  offer  alms of another at kind and like young Arthur, open the way of darkness.White is your at colour, golden your hearth.  So at advance with caution Orpheus and light  your  way  unto  the  sad at virgin. Offer her the circle  of the man with three faces. That he at may regain the  world  and  turn with it to its original at inglory!$",
+	"The mountains are the fangs in a monstrous mouth opening on the at finity of a celestial orgy, grin-ding the stars as we  grind  our at teeth into dust.  You  will drop your chord of stone at your feet. at The  laugh  of  silence  at  the at highest pitch, and in your right hand, the measure of genius. Thus at will you pass between  the  two  crescents beyond the abyss of the at wall of silence. The key to the  melody is within your grasp.  It at suffices to find the note  that  clashes.$",
+	"  9/12 INTER. 518  3/13 EXPENS.  23@  9/12 SALES 1203  7/12 CHEQUE 1598@      TOTAL 1721       TOTAL  1721$",
+	"   5/1/51@@              Luc, my love@ Guy knows about us. After an argument I told  him  everything! I at think only of you. Max keeps pes-tering me, but it's finished with @him. He should stick to his pots and pans! When can you and I be  alone together? For you I  would at get a divorce. at I love you.@                             Eva$",
+	"             Mortville, 10/2/51@@              Pat@ I recall you owe me  50000 frs that I lent you for your business at I need that money, can you repay me quickly?@              Guy$",
+	"             Mortville, 15/2/51@           Dear Sir@ I am writing to you on the sub-ject of our business deal. I have at decided to go all the way in the certainty that  my  partner, Pat at DEFRANCK, has been forging the accounts. @In spite of$",
+	"A pipe$",
+	"A pen$",
+	"A lighter$",
+	"A retort$",
+	"A shaving brush$",
+	"A tin of paint$",
+	"A flute$",
+	"An expensive ring$",
+	"A reel of thread$",
+	"An old book$",
+	"A wallet$",
+	"A dagger$",
+	"A pistol$",
+	"A bible$",
+	"A candle$",
+	"A jewellery box$",
+	"An iron$",
+	"A photo$",
+	"A pocket watch$",
+	"A rope$",
+	"Keys$",
+	"A pearl necklace$",
+	"A bottle of perfume$",
+	"Binoculars$",
+	"Glasses$",
+	"A leather purse$",
+	"A tennis ball$",
+	"Ammunition$",
+	"A cut-throat razor$",
+	"A hairbrush$",
+	"A clothes brush$",
+	"A pack of cards$",
+	"A shoe horn$",
+	"A screwdriver$",
+	"A hammer$",
+	"Keys$",
+	"Keys$",
+	"An ashtray$",
+	"A paintbrush$",
+	"A rope$",
+	"A wooden object$",
+	"Sleeping pills$",
+	"A gold ring$",
+	"A jewellery box$",
+	"An alarm clock$",
+	"A coat of armour$",
+	"A candlestick$",
+	"A pair of gloves$",
+	"A engraved goblet$",
+	"A parchment$",
+	"A dagger$",
+	"A dossier$",
+	"A parchment$",
+	"A parchment$",
+	"A dossier$",
+	"A dossier$",
+	"A letter$",
+	"A novel$",
+	"A wooden rod$",
+	"An envelope$",
+	"A letter$",
+	"An envelope$",
+	"Julia$",
+	"Julia's death$",
+	"Julia's relationships$",
+	"A message from Julia$",
+	"Julia's inheritance$",
+	"Julia's final actions$",
+	"Julia's gifts$",
+	"Julia's bedroom$",
+	"The photo at Julia's home$",
+	"Julia and yourself...$",
+	"L‚o's occupations$",
+	"Pat's occupations$",
+	"Guy's occupations$",
+	"Bob's occupations$",
+	"Eva's occupations$",
+	"Luc's occupations$",
+	"Ida's occupations$",
+	"Max's occupations$",
+	"Your occupations$",
+	"L‚o's relationships$",
+	"Pat's relationships$",
+	"Guy's relationships$",
+	"Bob's relationships$",
+	"Eva's relationships$",
+	"Luc's relationships$",
+	"Ida's relationships$",
+	"Max's relationships$",
+	"Your relationships$",
+	"Murielle$",
+	"Murielle's relationships$",
+	"Murielle and yourself...$",
+	"Murielle's disappearance$",
+	"The wall of silence$",
+	"The manuscripts$",
+	"The coat of arms$",
+	"Engravings in the cellar$",
+	"The well$",
+	"The secret passages$",
+	"The chapel$",
+	"The paintings$",
+	"The photo of the attic$",
+	"The body in the crypt$",
+	"$",
+	"$",
+	"END OF THE CONVERSATION$",
+	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
+	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"TBT - Je n'en sais rien !$",
+	"TBT - Elle est morte d'une embolie pulmonaire$",
+	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
+	"TBT - Elle est morte d'une embolie pulmonaire$",
+	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
+	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
+	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
+	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
+	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
+	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
+	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"TBT - Ce sont ses affaires ...$",
+	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
+	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
+	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
+	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
+	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
+	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
+	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
+	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
+	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"TBT - Les bijoux ...$",
+	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
+	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
+	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
+	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
+	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
+	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
+	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
+	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
+	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
+	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
+	"TBT - Moi je n'ai rien … lui reprocher$",
+	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
+	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
+	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
+	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
+	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
+	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
+	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
+	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
+	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"TBT - C'est pour un rendez-vous ?$",
+	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
+	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
+	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
+	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
+	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
+	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
+	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
+	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
+	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
+	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
+	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
+	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"TBT - Elle aussi, faisait des recherches ...$",
+	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
+	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"TBT - Je crois que tout le monde l'aimait bien$",
+	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
+	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
+	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"TBT - A part sa famille, pas grand monde$",
+	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"TBT - Non rien !$",
+	"TBT - Non ... Pas que le sache$",
+	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
+	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
+	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
+	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
+	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
+	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
+	"TBT - Son dernier pr‚sent m'a surpris$",
+	"TBT - Quel cadeau ?$",
+	"TBT - Un chandellier ...$",
+	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"TBT - Et bien oui ! Comme tout le monde, je crois$",
+	"TBT - Un poignard$",
+	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"TBT - Vous avez un don de double-vue ou un passe-partout$",
+	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
+	"TBT - Vous savez, je la connaissais assez peu$",
+	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
+	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
+	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
+	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
+	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
+	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"TBT - Vous savez ce que c'est : Des relations familiales$",
+	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
+	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
+	"TBT - Je ne me rappelle pas$",
+	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
+	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
+	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"TBT - Dommage que la devise soit manquante ...$",
+	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
+	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
+	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
+	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
+	"TBT - Ca reste pour moi le plus grand des mystŠres$",
+	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
+	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
+	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
+	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
+	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
+	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
+	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"TBT - Julia aimait beaucoup la peinture$",
+	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
+	"TBT - Que faites-vous l… ?$",
+	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
+	"TBT - Je vous ‚coute$",
+	"TBT - Que d‚sirez-vous ?$",
+	"TBT - Oui ?$",
+	"TBT - Je suis … vous ...$",
+	"TBT - C'est pourquoi ?$",
+	"TBT - Allez-y$",
+	"TBT - C'est … quel sujet ?$",
+	"TBT - Max : … votre service, monsieur$",
+	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
+	"TBT - Vous ˆtes trop curieux !$",
+	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
+	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
+	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
+	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"to the bureau$",
+	"to the kitchen$",
+	"to the cellar$",
+	"to the landing$",
+	"outside$",
+	"to the dining room$",
+	"inside the manor$",
+	"front of the manor$",
+	"to the chapel$",
+	"to the weel$",
+	"north$",
+	"behind the manor$",
+	"south$",
+	"east$",
+	"west$",
+	"towards the manor$",
+	"further$",
+	"in the water$",
+	"out of the weel$",
+	"in the weel$",
+	"choice on screen$",
+	"In the MYSTERY series...$",
+	"MORTVILLE MANOR$",
+	"$",
+	"From an original idea of...$",
+	"Bernard GRELAUD and Bruno GOURIER$",
+	"$",
+	"Directed by: KYILKHOR CREATION and LANGLOIS$",
+	"$",
+	"With the cooperation of...$",
+	"B‚atrice et Jean_Luc LANGLOIS$",
+	"for the music and the voices,$",
+	"Bernard GRELAUD for the graphic conception,$",
+	"MARIA-DOLORES for the graphic direction,$",
+	"Bruno GOURIER for the technical direction,$",
+	"Mick ANDON for the translation. $",
+	"$",
+	"Publisher: KYILKHOR and B&JL LANGLOIS $",
+	"COPYRIGHT 1987: KYILKHOR and B&JL LANGLOIS$",
+	"$",
+	"YOUR MOVE$",
+	"attach$",
+	"wait$",
+	"force$",
+	"sleep$",
+	"listen$",
+	"enter$",
+	"close$",
+	"search$",
+	"knock$",
+	"scratch$",
+	"read$",
+	"eat$",
+	"place$",
+	"open$",
+	"take$",
+	"look$",
+	"smell$",
+	"sound$",
+	"leave$",
+	"lift$",
+	"turn$",
+	"hide yourself$",
+	"search$",
+	"read$",
+	"put$",
+	"look$",
+	"Leo$",
+	"Pat$",
+	"Guy$",
+	"Eva$",
+	"Bob$",
+	"Luc$",
+	"Ida$",
+	"Max$",
+	"JULIA...$",
+	"- Did she commit suicide?$",
+	"- Was she murdered?$",
+	"- Did she die by accident?$",
+	"- Did she die of natural causes?$",
+	"Where did the money come from at for the restoration of the manor?$",
+	"- Blackmail$",
+	"- Honest work$",
+	"- Inheritance$",
+	"- Races$",
+	"- Rents$",
+	"- Hold-up$",
+	"- Other$",
+	"What is Leo's hobby?$",
+	"- Historical research$",
+	"- Politics$",
+	"- Painting$",
+	"- Drugs$",
+	"- Occult sciences$",
+	"- Management of a sect$",
+	"Julia left several clues that are at represented in one place. Which?$",
+	"- Chapel$",
+	"- Outside$",
+	"- Cellar$",
+	"- Attic$",
+	"- Kitchen$",
+	"- Dining room$",
+	"- Julia's room$",
+	"- Leo's room$",
+	"- Pat's room$",
+	"- Bob's room$",
+	"- Max's room$",
+	"- Luc/Ida's room$",
+	"- Guy/Eva's room$",
+	"The main clue that leads you at to the underground door is:$",
+	"- A dagger$",
+	"- A ring$",
+	"- A book$",
+	"- A parchment$",
+	"- A letter$",
+	"- A pendulum$",
+	"How many parchments were there in the manor?$",
+	"- 0$",
+	"- 1$",
+	"- 2$",
+	"- 3$",
+	"- 4$",
+	"- 5$",
+	"How many persons are involved in at this story?@(Julia included, but not yourself)$",
+	"- 9$",
+	"- 10$",
+	"- 11$",
+	"What was the first name at of the unknown character?$",
+	"- Mireille$",
+	"- Françoise$",
+	"- Maguy$",
+	"- Emilie$",
+	"- Murielle$",
+	"- Sophie$",
+	"Wo did Murielle have an affair with?$",
+	"- Bob$",
+	"- Luc$",
+	"- Guy$",
+	"- Leo$",
+	"- Max$",
+	"Murielle shared an occupation at with one other person. Who?$",
+	"[1][You realize that certain elements of|this investigation remain a mystery for you.|Therefore, you decide first to learn|more before undertaking new risks..][ok]$",
+	"[3][ | insert disk 1 | in drive A ][ok]$",
+	"[1][ | Disk error | All stop... ][ok]$",
+	"[1][ | You should have noticed |00% of the clues ][ok]$",
+	"[3][ | insert disk 2 | in drive A ][ok]$",
+	"TBT - [1][|Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"TBT -  MASTER .$",
+	"TBT -   rorL$",
+	NULL
+};
+
+const char *gameDataFr[] = {
+	"Le calme dans la tourmente$",
+	"Des go—ts et des couleurs!$",
+	"Mauve qui peut!$",
+	"PriŠre de laisser en sortant...$",
+	"Trou noir troublant$",
+	"Bleu... comme \"peur bleue\"!$",
+	"Chambre de \"Saigneur\"!$",
+	"Histoire d'eaux$",
+	"Vert nid$",
+	"Coup d'oeil sur l'interdit$",
+	"Odeur de feux de bois et de tabac$",
+	"Tabac et vieux bouquins$",
+	"Oignons, cannelle et spiritueux$",
+	"Un endroit bien peu visit‚$",
+	"Humidit‚ et moisissure$",
+	"Avis aux colporteurs...$",
+	"Corps putr‚fi‚ : cryptomanie mortelle!$",
+	"Et en plus... des piŠges d‚samorc‚s!$",
+	"C'est d‚j… ouvert$",
+	"Danger : avalanches$",
+	"Une odeur de saintet‚!$",
+	"Une bƒtisse imposante$",
+	"L'envers du mystŠre!$",
+	"Dr“le d'horoscope!$",
+	"Tant va la cruche...$",
+	"Une porte en chŠne$",
+	"Une photo$",
+	"Les armoiries$",
+	"$",
+	"Max, le domestique, vous accueille puis vous conduit … votre chambre$",
+	"Mortevielle, le 16/2/51@         Mon cher J‚r“me,@ Suite … mon t‚l‚gramme, je vous fais part des raisons de mon inqui‚tude :il y a un an, Murielle, ma dame de compagnie, disparaissait . D‚part ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile … comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'… pr‚sent, faire le jour sur cette affaire, je compte sur vous pour la mener … bien . Si mon ‚tat de sant‚ ne s'am‚liorait pas, prenez les d‚cisions qui vous sembleront le plus  appropri‚es...@             Amiti‚s. JULIA DEFRANCK$",
+	"Plus tard, Guy vous apprendra le suicide de L‚o...  aprŠs un pari insens‚ aux courses!$",
+	"F3: encore at F8: suite$",
+	"Le maŒtre des lieux$",
+	"Le futur h‚ritier$",
+	"Le fils de JULIA$",
+	"Joli brin!!!$",
+	"Superman!$",
+	"Le mari d'Ida$",
+	"Propos int‚ressants?$",
+	"Service compris...$",
+	"Rien dessous!$",
+	"Un ange passe...$",
+	"Une 1/2 h passe: rien! Attendez-vous encore?$",
+	"Admirez! Contemplez!$",
+	"Non ! Rien !$",
+	"Impossible$",
+	"‡a tache !$",
+	"Un trait‚ sur l'histoire de la r‚gion$",
+	"Quelques piŠces$",
+	"Premier commandement...$",
+	"Des p‚tales plein les narines !$",
+	"Pique, Coeur...$",
+	"‡a ne manque pas de cachets !$",
+	"Un roman d'amour$",
+	"Souffler n'est pas jouer$",
+	"Pas une r‚ussite!$",
+	"Gare aux rebondissements !$",
+	"Sombre et profond...$",
+	"Sensations normales$",
+	"Sniff!$",
+	"Pas discret ! Contentez-vous de regarder !$",
+	"Atchoum! De la p... poussiŠre$",
+	"La toile est sign‚e... pas le papier peint !$",
+	"Pas de chance, rien !$",
+	"Soyez plus discret !$",
+	"Les volets sont clos$",
+	"De la neige, encore de la neige !$",
+	"G‚nial : une toile de maŒtre !$",
+	"Aucun doute : une v‚ritable imitation$",
+	"Hum ! Vous tiquez : de l'antique en toc !$",
+	"Une piŠce rare de valeur !$",
+	"Rien de remarquable$",
+	"Linge, objets personnels...$",
+	"Pas n'importe o— !$",
+	"Ce n'est pas l'heure !$",
+	"On ne parle pas la bouche pleine ! Donc, une fois le repas termin‚...$",
+	"Quelqu'un entre, s'affaire, ressort...$",
+	"On s'approche de votre cachette !$",
+	"On vous surprend !$",
+	"Non : vous ˆtes trop charg‚ !$",
+	"Essayez de nouveau$",
+	"Vous restez perplexe !?$",
+	"Vous quittez le Manoir. A Paris, un message vous attend...$",
+	"A‹e, a‹e, a‹e !$",
+	"Rien de plus$",
+	"Le son paraŒt normal$",
+	"Ca ne bouge pas$",
+	"On vous r‚pond$",
+	"Pas le moment !$",
+	"Mˆme matiŠre, autre face !$",
+	"Le reflet est piqu‚, mais le cadre est d'or$",
+	"Bibelots, babioles...$",
+	"Vous essuyez un ‚chec !$",
+	"Il est des odeurs... qu'il vaut mieux ne pas voir !$",
+	"Des produits m‚nagers$",
+	"‡a vous d‚mange ?$",
+	"C'est coinc‚, gel‚ ! Brrrr...$",
+	"Les huisseries sont bloqu‚es !$",
+	"Des papiers...$",
+	"Non ! Le pŠre Noˆl n'est pas coinc‚ !$",
+	"‡a donne sur un couloir$",
+	"Vaisselle, argenterie...$",
+	"Non ! Ce ne sont pas les restes de Julia !$",
+	"Une gravure ancienne$",
+	"Il y a une profonde ouverture en losange$",
+	"Le mur coulisse... Un passage !  L'empruntez-vous ?$",
+	"Le passage se ferme$",
+	"Un tiroir secret... Un livret ! Le lisez-vous ?$",
+	"Le tiroir se referme$",
+	"Rien ! Sang et chairs collent … la pierre !$",
+	"Des d‚tails vous font supposer que... la mort ne fut pas imm‚diate !$",
+	"Des projets v‚reux ?$",
+	"Sa vie n'aurait-elle tenu qu'… un doigt ?$",
+	"Un tr‚sor se serait-il fait la malle ?$",
+	"Une fente de la taille d'une piŠce !$",
+	"Quelques pierres pivotent... Une crypte ! Y p‚n‚trez-vous ?$",
+	"La bague tourne, le mur se referme...$",
+	"Une colonne de pierres derriŠre l'autel$",
+	"Il y a du bruit...$",
+	"Occup‚ !$",
+	"Retentez-vous votre chance ?$",
+	"Trop profond !$",
+	"Le mur de la cave pivote$",
+	"Nothing !$",
+	"L'unique !$",
+	"L'objet glisse au fond...$",
+	"Vous n'avez rien en main$",
+	"Ce n'est pas ouvert$",
+	"Il y a d‚j… quelque chose$",
+	"La porte est ferm‚e$",
+	"Pas de r‚ponse$",
+	"Une boule de bois pleine$",
+	"Il n'y a plus de place$",
+	"Une boule de bois perc‚e par le travers$",
+	"? ?$",
+	"A vous de jouer$",
+	"OK !$",
+	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  D‚tective \"priv‚\"... de bon sens et de discr‚tion sans doute\" . D‚‡u d‚moralis‚, vous quittez le manoir at Vous Štes NUL !$",
+	"L‚o vous interrompt : \"la tempŠte est calm‚e. Je pars en ville dans 1 heure. Tenez-vous prˆt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
+	"Congestion, grippe fatale : vous y restez ! Votre enquŠte tombe … l'eau$",
+	"L'eau monte trŠs vite et refroidit vos derniŠres illusions...  Avant que vous n'ayez eu le temps de r‚agir, vous Štes mort!$",
+	"A peine Štes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
+	"La tempŠte recouvre vos traces . Un mur de silence s'abat sur vos ‚paules . Lentement vous succombez … la morsure du froid !$",
+	"Pas si seul que ‡a ! Une lame glac‚e s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
+	"Vous ignorez la responsabilit‚ exacte de L‚o dans la mort de Murielle... Est-elle morte sur le coup ? De toutes fa‡ons les problŠmes familiaux d‚couverts lors de votre enquŠte justifient l'attitude de L‚o... Vous n'Štes pas s—r que Julia vous ait appel‚ pour ‡a mais c'est suffisant pour vous ! Par respect pour elle, et aprŠs  certaines pr‚cautions, vous avez une entrevue r‚v‚latrice avec L‚o$",
+	"$",
+	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans r‚ponse . Vous allez attraper... la mort !$",
+	"D'un mouvement circulaire, l'‚p‚e vous fend par le travers : tripes et boyaux … l'air, bonjour les vers!$",
+	"Home, Sweet home !$",
+	"MystŠre d'une porte close$",
+	"Charme envo—tant de vieilles piŠces$",
+	"La faim au ventre$",
+	"Plus prŠs du ciel? Pas s—r !$",
+	"Peur du noir?$",
+	"Vieux tapis et reflets d'or$",
+	"Angoisse !$",
+	"Sauv‚ ? Pas certain !$",
+	"Mal … l'aise, hein !$",
+	"Toujours plus loin !$",
+	"Votre chemin de croix !$",
+	"A la d‚couverte de...$",
+	"Attention … ce que cache...$",
+	"Une descente aux Enfers !$",
+	"Si ce n'est pas dans vos cordes :@       ne soyez pas sot!$",
+	"Avant la mise en piŠce !$",
+	"Gros plan sur :$",
+	"Vous remarquez particuliŠrement...$",
+	"Et encore...$",
+	"C'est fini !$",
+	"Un peu de lecture$",
+	"L'aventure vous attend, vous partez...$",
+	"Ne ratez pas VOTRE prochaine AVENTURE...$",
+	"Je ne comprends pas$",
+	"Il y a plus simple$",
+	"Non ! Pas ce coup-ci$",
+	"Trop tard$",
+	"$",
+	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumiŠre, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artŠre comme un rat au coeur mˆme de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
+	"10/1/50: Nous avons r‚solu le mystŠre du manuscrit et localis‚ la crypte . Est-ce l'id‚e d'aboutir dans ce qui n'‚tait qu'un \"rŠve\" qui me rend si anxieuse ?@Je regrette de m'ˆtre engag‚e vis … vis de L‚o . Non! je dois continuer ! J'aurais d— mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
+	"Porte ta priŠre au lieu saint qui se doit, changes-en l'air, tu auras la matiŠre !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton …me s'ouvrira un chemin et gagnera son Šre . Avance comme un Orph‚e peu soucieux des t‚nŠbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'… la myst‚rieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse premiŠre.$",
+	"Les montagnes sont les crocs d'une gueule dantesque ouverte … l'infini de quelqu' orgie c‚leste, mastiquant des ‚toiles comme nous broyons du noir . at Tu d‚poseras l'accord de pierre … tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mŠtre . Tu passeras ainsi entre les deux croissants, par del… les abŒmes du Mur du Silence . La Cl‚ des champs est … ta port‚e, tu n'as qu'… retrouver la note qui d‚note.$",
+	"                DECEMBRE@   9 REMISE     518    13 AGIOS       23@  19 VIREMENT  1203    17 TRESOR    1598@      TOTAL     1721        TOTAL    1721$",
+	"  Le 5/01/51@@              Luc, mon amour@ Guy connaŒt notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'… toi !  Max me relance mais j'ai d‚finitivement rompu avec lui . Qu'il reste … ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
+	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr‚t‚s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
+	"  Mortevielle, le 15/2/51@              MaŒtre,@ Je vous ‚cris au sujet de notre affaire.  Je suis d‚cid‚  … aller jusqu'au bout, certain que mon associ‚, Pat DEFRANCK, a falsifi‚  un livre de comptes . Malgr‚$",
+	"Une pipe$",
+	"Un stylo … plume$",
+	"Un briquet … essence$",
+	"Une cornue$",
+	"Un blaireau$",
+	"Un pot de peinture$",
+	"Une flute$",
+	"Une bague de valeur$",
+	"Une bobine de fil$",
+	"Un vieux bouquin$",
+	"Un porte-monnaie$",
+	"Un poignard$",
+	"Un r‚volver$",
+	"Une bible$",
+	"Une bougie$",
+	"Un coffret … bijoux$",
+	"Un fer … repasser$",
+	"Une photo$",
+	"Une montre … gousset$",
+	"Une corde$",
+	"Des clefs$",
+	"Un collier de perles$",
+	"Un flacon de parfum$",
+	"Des jumelles$",
+	"Des lunettes$",
+	"Une bourse en cuir$",
+	"Une balle de tennis$",
+	"Des munitions$",
+	"Un rasoir … main$",
+	"Une brosse … cheveux$",
+	"Une brosse … linge$",
+	"Un jeu de cartes$",
+	"Un chausse pied$",
+	"Un tournevis$",
+	"Un marteau$",
+	"Des clefs$",
+	"Des clefs$",
+	"Un cendrier$",
+	"Un pinceau$",
+	"Une corde$",
+	"Un objet en bois$",
+	"Des somnifŠres$",
+	"Une bague en or$",
+	"Un coffret … bijoux$",
+	"Un r‚veil matin$",
+	"Une cotte de mailles$",
+	"Un chandellier$",
+	"Une paire de gants$",
+	"Une coupe cisel‚e$",
+	"Un parchemin$",
+	"Un poignard$",
+	"Un dossier$",
+	"Un parchemin$",
+	"Un parchemin$",
+	"Un dossier$",
+	"Un dossier$",
+	"Une lettre$",
+	"Un roman$",
+	"Une baguette en bois$",
+	"Une enveloppe$",
+	"Une lettre$",
+	"Une enveloppe$",
+	"Julia$",
+	"La mort de Julia$",
+	"Les relations de Julia$",
+	"Un message de Julia$",
+	"L'h‚ritage de Julia$",
+	"Derniers actes de Julia$",
+	"Les cadeaux de Julia$",
+	"La chambre de Julia$",
+	"La photo chez Julia$",
+	"Julia et vous...$",
+	"Les occupations de L‚o$",
+	"Les occupations de Pat$",
+	"Les occupations de Guy$",
+	"Les occupations de Bob$",
+	"Les occupations d'Eva$",
+	"Les occupations de Luc$",
+	"Les occupations d'Ida$",
+	"Les occupations de Max$",
+	"Vos occupations$",
+	"Les relations de L‚o$",
+	"Les relations de Pat$",
+	"Les relations de Guy$",
+	"Les relations de Bob$",
+	"Les relations d'Eva$",
+	"Les relations de Luc$",
+	"Les relations d'Ida$",
+	"Les relations de Max$",
+	"Vos relations$",
+	"Murielle$",
+	"Les relations de Murielle$",
+	"Murielle et vous...$",
+	"Disparition de Murielle$",
+	"Le mur du silence$",
+	"Les manuscrits$",
+	"Le blason$",
+	"Les gravures dans la cave$",
+	"Le puits$",
+	"Les passages secrets$",
+	"La chapelle$",
+	"Les tableaux$",
+	"La photo du grenier$",
+	"Le corps dans la crypte$",
+	"$",
+	"$",
+	"FIN DE LA CONVERSATION$",
+	"Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
+	"C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"Je n'en sais rien !$",
+	"Elle est morte d'une embolie pulmonaire$",
+	"Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"Madame DEFRANCK est morte d'un coup de froid$",
+	"Elle est morte d'une embolie pulmonaire$",
+	"Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"Ce sont toujours les meilleurs qui partent les premiers$",
+	"J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
+	"Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
+	"C'est un homme dynamique qui a r‚ussi dans le parfum$",
+	"Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
+	"J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
+	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"Ce sont ses affaires ...$",
+	"Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
+	"Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
+	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
+	"Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
+	"Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
+	"Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
+	"Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
+	"Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
+	"Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"Les bijoux ...$",
+	"Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
+	"Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
+	"Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
+	"Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
+	"Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
+	"Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
+	"C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
+	"C'est un homme de caractŠre . Il faut savoir le prendre ..$",
+	"Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
+	"Relations ? Relations amicales ? Relations financiŠres sans doute$",
+	"Moi je n'ai rien … lui reprocher$",
+	"C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
+	"Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
+	"A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
+	"Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
+	"Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
+	"Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
+	"Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
+	"Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
+	"Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"C'est pour un rendez-vous ?$",
+	"Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
+	"Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
+	"La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
+	"C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
+	"Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
+	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
+	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
+	"Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
+	"Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
+	"C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
+	"C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
+	"Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"Elle aussi, faisait des recherches ...$",
+	"C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
+	"Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"Je crois que tout le monde l'aimait bien$",
+	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
+	"A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
+	"Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"A part sa famille, pas grand monde$",
+	"Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"Non rien !$",
+	"Non ... Pas que le sache$",
+	"J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
+	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
+	"Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
+	"A part la lettre pour vous que j'ai post‚, rien de bien important !$",
+	"J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
+	"Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
+	"Son dernier pr‚sent m'a surpris$",
+	"Quel cadeau ?$",
+	"Un chandellier ...$",
+	"Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"Et bien oui ! Comme tout le monde, je crois$",
+	"Un poignard$",
+	"Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"Vous avez un don de double-vue ou un passe-partout$",
+	"Le portrait d'une jeune fille : C'est Murielle ...$",
+	"Vous savez, je la connaissais assez peu$",
+	"Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
+	"C'est la seule femme vraiment interessante que j'ai rencontr‚$",
+	"Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
+	"Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
+	"Si la chambre est ferm‚e, demandez … L‚o$",
+	"J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"Vous savez ce que c'est : Des relations familiales$",
+	"Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"Je l'aimais autant qu'elle m'aimais, je crois$",
+	"De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"C'est sans doute la photo de Murielle avec le filleul de Julia$",
+	"Je ne me rappelle pas$",
+	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
+	"Vous ˆtes bien curieux !... C'est sans valeur$",
+	"Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"Dommage que la devise soit manquante ...$",
+	"C'est trŠs beau ... Et trŠs vieux ...$",
+	"Tiens ! C'est un endroit que je n'ai jamais visit‚$",
+	"D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
+	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"Profond et inqui‚tant : Le progrŠs a du bon$",
+	"Ca reste pour moi le plus grand des mystŠres$",
+	"Les derniers temps elle parlait d'un voyage . Et puis ...$",
+	"Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
+	"De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"Quoi ?! Quel corps ? Quel crypte ?$",
+	"Si il y en a, je ne les ai jamais trouv‚ ...$",
+	"Bien s–r ! ... Et des fant“mes aussi ...$",
+	"C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
+	"Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"Julia aimait beaucoup la peinture$",
+	"Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
+	"Que faites-vous l… ?$",
+	"Je suis s–r que vous cherchez quelque chose ici$",
+	"Je vous ‚coute$",
+	"Que d‚sirez-vous ?$",
+	"Oui ?$",
+	"Je suis … vous ...$",
+	"C'est pourquoi ?$",
+	"Allez-y$",
+	"C'est … quel sujet ?$",
+	"Max : … votre service, monsieur$",
+	"De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
+	"Vous ˆtes trop curieux !$",
+	"J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
+	"En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aventur‚s 
 dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
+	"F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
+	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	" au bureau$",
+	" … la cuisine$",
+	" … la cave$",
+	" dans le couloir$",
+	" dehors$",
+	" la salle … manger$",
+	" dans le manoir$",
+	" devant le manoir$",
+	" … la chapelle$",
+	" devant le puits$",
+	" au nord$",
+	" derriŠre le manoir$",
+	" au sud$",
+	" … l'est$",
+	" … l'ouest$",
+	" vers le manoir$",
+	" plus loin$",
+	" dans l'eau$",
+	" hors du puits$",
+	" dans le puits$",
+	" choix sur ‚cran$",
+	" Dans la serie MYSTERE...$",
+	" LE MANOIR DE MORTEVIELLE$",
+	"$",
+	" Sur une idee de...$",
+	" Bernard GRELAUD et Bruno GOURIER$",
+	"$",
+	" Realisation: LANKHOR$",
+	"$",
+	" Avec la participation de...$",
+	" Beatrice et Jean-Luc LANGLOIS$",
+	" pour la musique et les voix,$",
+	" Bernard GRELAUD pour la conception graphique,$",
+	" MARIA-DOLORES  pour la realisation graphique,$",
+	" Bruno GOURIER pour la realisation technique,$",
+	" Clement ROQUES pour l'adaptation sur IBM PC et compatibles .$",
+	"$",
+	" Edition: LANKHOR$",
+	" COPYRIGHT 1988: LANKHOR$",
+	"$",
+	" A VOUS DE JOUER$",
+	" attacher$",
+	" attendre$",
+	" d‚foncer$",
+	" dormir$",
+	" ‚couter$",
+	" entrer$",
+	" fermer$",
+	" fouiller$",
+	" frapper$",
+	" gratter$",
+	" lire$",
+	" manger$",
+	" mettre$",
+	" ouvrir$",
+	" prendre$",
+	" regarder$",
+	" sentir$",
+	" sonder$",
+	" sortir$",
+	" soulever$",
+	" tourner$",
+	" se cacher$",
+	" fouiller$",
+	" lire$",
+	" poser$",
+	" regarder$",
+	" L‚o$",
+	" Pat$",
+	" Guy$",
+	" Eva$",
+	" Bob$",
+	" Luc$",
+	" Ida$",
+	" Max$",
+	"Comment Julia est-elle morte ?$",
+	"Elle s'est suicid‚e$",
+	"Elle est morte assassin‚e$",
+	"Elle est morte accidentellement$",
+	"Elle est morte naturellement$",
+	"D'o— provenait l'argent qui a permis la restauration du manoir ?$",
+	"chantage$",
+	"travail$",
+	"h‚ritage$",
+	"courses$",
+	"rentes$",
+	"hold-up$",
+	"d‚couverte$",
+	"Quel est le hobby de L‚o ?$",
+	"recherches historiques$",
+	"politique$",
+	"peinture$",
+	"drogue$",
+	"sciences occultes$",
+	"direction d'une secte$",
+	"Julia a laiss‚ une s‚rie d'indices . Ceux-ci sont repr‚sent‚s en un seul lieu . Lequel ?$",
+	"Chapelle$",
+	"Ext‚rieur$",
+	"Cave$",
+	"Grenier$",
+	"Cuisine$",
+	"Salle … manger$",
+	"Chambre Julia$",
+	"Chambre L‚o$",
+	"Chambre Pat$",
+	"Chambre Bob$",
+	"Chambre Max$",
+	"Chambre Luc/Ida$",
+	"Chambre Guy/Eva$",
+	"L'indice principal qui vous a permis d'arriver … la porte du souterrain est :$",
+	"Un poignard$",
+	"Une bague$",
+	"Un livre$",
+	"Un parchemin$",
+	"Une lettre$",
+	"Un pendule$",
+	"Combien y avait-il de parchemin dans le manoir ?$",
+	"Aucun$",
+	"Un seul$",
+	"Deux$",
+	"Trois$",
+	"Quatre$",
+	"Cinq$",
+	"Combien de personnes sont m‚l‚es … cette histoire - Julia y comprise, vous except‚ - ?$",
+	"Neuf$",
+	"Dix$",
+	"Onze$",
+	"Quel ‚tait le pr‚nom de la personne inconnue ?$",
+	"Mireille$",
+	"Fran‡oise$",
+	"Maguy$",
+	"Emilie$",
+	"Murielle$",
+	"Sophie$",
+	"De qui Murielle ‚tait-elle la maŒtresse ?$",
+	"Bob$",
+	"Luc$",
+	"Guy$",
+	"L‚o$",
+	"Max$",
+	"Murielle partageait une occupation avec une autre personne . Qui ?$",
+	"[1][|Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
+	"[1][|Ins‚rez la disquette 1 dans le lecteur A][ok]$",
+	"[1][|! ERREUR DISQUETTE !|On arrete tout][ok]$",
+	"[1][|Vous devriez avoir remarqu‚|00% des indices][ok]$",
+	"[1][|Ins‚rez la disquette 2 dans le lecteur A][ok]$",
+	"[1][|Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	" MASTER .$",
+	"  rorL$",
+};
+
+#endif


Commit: 3ef19ad8c159f16329f23bdce9b62a8b965c6b58
    https://github.com/scummvm/scummvm/commit/3ef19ad8c159f16329f23bdce9b62a8b965c6b58
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:30-07:00

Commit Message:
TOOLS: Mortevielle - Remove extra spaces in one of the words

Changed paths:
    devtools/create_mortdat/enginetext.h



diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index fb4d12d..d9b3b05 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -106,7 +106,7 @@ const char *engineDataFr[] = {
 	"se cacher",
 
 	"prendre",
-	" sonder   ",
+	"sonder",
 	"soulever",
 	" -SUITE- ",
 	" -STOP-  ",


Commit: b6fa7e07cf8622df8a783aa810ec009c670499d2
    https://github.com/scummvm/scummvm/commit/b6fa7e07cf8622df8a783aa810ec009c670499d2
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:31-07:00

Commit Message:
MORTEVIELLE: Start cleaning taffich.cpp

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/taffich.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 3efa80e..3cb8192 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -422,7 +422,7 @@ void f3f8::atf3f8(int &key) {
 
 void f3f8::aff50(bool c) {
 	caff = 50;
-	maff = 0;
+	_maff = 0;
 	taffich();
 	dessine(ades, 63, 12);
 	if (c)
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 8d905af..f0a95ff 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -51,7 +51,7 @@ void change_gd(int ngd) {
 	else person();
 	clsf2();
 	clsf3();
-	maff = 68;
+	_maff = 68;
 	afdes(0);
 	repon(2, crep);
 	g_vm->_menu.menu_aff();
@@ -83,7 +83,7 @@ void MortevielleEngine::gameLoaded() {
 	g[2] = 'A';
 	cache = false;
 	brt = false;
-	maff = 68;
+	_maff = 68;
 	g[5] = 'E';
 	mnumo = 0;
 	prebru = 0;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index a9f727a..e654d1a 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -35,69 +35,63 @@
 
 namespace Mortevielle {
 
-void chardes(Common::String nom, int32 passe, int long_) {
-	int i, p, l;
-//	byte b;
+void chardes(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
-
-	/* debug('chardes'); */
-	if (!f.open(nom))
-		error("Missing file %s", nom.c_str());
+	if (!f.open(filename))
+		error("Missing file %s", filename.c_str());
 
 	testfi();
-	p = 0;
-	while (passe > 127) {
-		p = p + 1;
-		passe = passe - 128;
+	int skipBlock = 0;
+	while (skipSize > 127) {
+		++skipBlock;
+		skipSize -= 128;
 	}
-	if (p != 0)
-		f.seek(p * 0x80);
-	p = abs(passe);
-	l = long_ + p;
-	i = 0;
-	while (l > 0) {
-		f.read(&mem[0x6000 * 16 + i], 128);
+	if (skipBlock != 0)
+		f.seek(skipBlock * 0x80);
+
+	int remainingSkipSize = abs(skipSize);
+	int totalLength = length + remainingSkipSize;
+	int memIndx = 0x6000 * 16;
+	while (totalLength > 0) {
+		f.read(&mem[memIndx], 128);
 		testfi();
-		l = l - 128;
-		i = i + 128;
+		totalLength -= 128;
+		memIndx += 128;
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) 
-		mem[0x7000 * 16 + i - p] = mem[0x6000 * 16 + i];
-	/*$i+*/
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; i ++) 
+		mem[0x7000 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
 }
 
-void charani(Common::String nom, int32 passe, int long_) {
-	int i, p, l;
-//	byte b;
+void charani(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
 
-	/* debug('charani'); */
-	if (!f.open(nom))
-		error("Missing file - %s", nom.c_str());
+	if (!f.open(filename))
+		error("Missing file - %s", filename.c_str());
 
 	testfi();
-	p = 0;
-	while (passe > 127) {
-		passe = passe - 128;
-		p = p + 1;
+	int skipBlock = 0;
+	while (skipSize > 127) {
+		skipSize = skipSize - 128;
+		++skipBlock;
 	}
-	if (p != 0)
-		f.seek(p * 0x80);
-
-	p = abs(passe);
-	l = long_ + p;
-	i = 0;
-	while (l > 0) {
-		f.read(&mem[0x6000 * 16 + i], 128);
+	if (skipBlock != 0)
+		f.seek(skipBlock * 0x80);
+
+	int remainingSkipSize = abs(skipSize);
+	int fullLength = length + remainingSkipSize;
+	int memIndx = 0x6000 * 16;
+	while (fullLength > 0) {
+		f.read(&mem[memIndx], 128);
 		testfi();
-		l = l - 128;
-		i = i + 128;
+		fullLength -= 128;
+		memIndx += 128;
 	}
 	f.close();
 
-	for (i = p; i <= long_ + p; i ++) mem[0x7314 * 16 + i - p] = mem[0x6000 * 16 + i];
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; i ++)
+		mem[0x7314 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
 }
 
 void taffich() {
@@ -107,7 +101,6 @@ void taffich() {
 	int i, m, a, b, cx, handle,
 	        npal;
 	int32 lgt;
-	Common::String nom;
 	int palh, k, j;
 	int alllum[16];
 
@@ -118,69 +111,101 @@ void taffich() {
 	else if ((a >= 136) && (a <= 140))
 		a = tran1[a - 136];
 	b = a;
-	if (maff == a)  return;
-	if (a == 16) {
+	if (_maff == a)
+		return;
+
+	switch (a) {
+	case 16:
 		s.pourc[9] = '*';
 		s.teauto[42] = '*';
-	}
-	if (a == 20) {
+		break;
+	case 20:
 		s.teauto[39] = '*';
 		if (s.teauto[36] == '*') {
 			s.pourc[3] = '*';
 			s.teauto[38] = '*';
 		}
-	}
-	if (a == 24)  s.teauto[37] = '*';
-	if (a == 30)  s.teauto[9] = '*';
-	if (a == 31) {
+		break;
+	case 24:
+		s.teauto[37] = '*';
+		break;
+	case 30:
+		s.teauto[9] = '*';
+		break;
+	case 31:
 		s.pourc[4] = '*';
 		s.teauto[35] = '*';
+		break;
+	case 118:
+		s.teauto[41] = '*';
+		break;
+	case 143:
+		s.pourc[1] = '*';
+		break;
+	case 150:
+		s.teauto[34] = '*';
+		break;
+	case 151:
+		s.pourc[2] = '*';
+		break;
+	default:
+		break;
 	}
-	if (a == 118)  s.teauto[41] = '*';
-	if (a == 143)  s.pourc[1] = '*';
-	if (a == 150)  s.teauto[34] = '*';
-	if (a == 151)  s.pourc[2] = '*';
+
 	okdes = true;
 	hide_mouse();
 	lgt = 0;
+	Common::String filename;
+
 	if ((a != 50) && (a != 51)) {
 		m = a + 2000;
 		if ((m > 2001) && (m < 2010))  m = 2001;
 		if (m == 2011)  m = 2010;
 		if (a == 32)  m = 2034;
-		if ((a == 17) && (maff == 14))  m = 2018;
+		if ((a == 17) && (_maff == 14))  m = 2018;
 		if (a > 99)
 			if ((is == 1) || (is == 0))  m = 2031;
 			else m = 2032;
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144)
 		        || (a == 147) || (a == 149))  m = 2030;
-		if (((a < 27) && (((maff > 69) && (! s.ipre)) || (maff > 99)))
-		        || ((maff > 29) && (maff < 33)))  m = 2033;
+		if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99)))
+		        || ((_maff > 29) && (_maff < 33)))  m = 2033;
 		messint(m);
-		maff = a;
-		if (a == 159)  a = 86;
-		else if (a > 140)  a = a - 67;
-		else if (a > 137)  a = a - 66;
-		else if (a > 99)  a = a - 64;
-		else if (a > 69)  a = a - 42;
-		else if (a > 29)  a = a - 5;
-		else if (a == 26)  a = 24;
-		else if (a > 18)  a = a - 1;
+		_maff = a;
+		if (a == 159)
+			a = 86;
+		else if (a > 140)
+			a = a - 67;
+		else if (a > 137)
+			a = a - 66;
+		else if (a > 99)
+			a = a - 64;
+		else if (a > 69)
+			a = a - 42;
+		else if (a > 29)
+			a = a - 5;
+		else if (a == 26)
+			a = 24;
+		else if (a > 18)
+			a = a - 1;
 		npal = a;
-		for (cx = 0; cx <= (a - 1); cx ++) lgt = lgt + l[cx];
+
+		for (cx = 0; cx <= (a - 1); cx ++)
+			lgt = lgt + l[cx];
 		handle = l[a];
-		nom = "DXX.mor";
+
+		filename = "DXX.mor";
 	} else {
-		nom = "DZZ.mor";
+		filename = "DZZ.mor";
 		handle = l[87];
 		if (a == 51) {
 			lgt = handle;
 			handle = l[88];
 		}
-		maff = a;
+		_maff = a;
 		npal = a + 37;
 	}
-	chardes(nom, lgt, handle);
+	chardes(filename, lgt, handle);
 	if (gd == her) {
 		for (i = 0; i <= 15; i ++) {
 			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
@@ -204,15 +229,15 @@ void taffich() {
 			else if (b > 15)  b = b - 1;
 			for (cx = 0; cx <= (b - 1); cx ++) lgt = lgt + l[cx + 89];
 			handle = l[b + 89];
-			nom = "AXX.mor";
+			filename = "AXX.mor";
 		} else if (b == 50) {
-			nom = "AZZ.mor";
+			filename = "AZZ.mor";
 			handle = 1260;
 		}
-		charani(nom, lgt, handle);
+		charani(filename, lgt, handle);
 	}
 	show_mouse();
-	if ((a < 27) && ((maff < 27) || (s.mlieu == 15)) && (msg[4] != entrer)) {
+	if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != entrer)) {
 		if ((a == 13) || (a == 14))  person();
 		else if (! blo)  t11(s.mlieu, cx);
 		mpers =  0;
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
index a6acce2..4bb5e77 100644
--- a/engines/mortevielle/taffich.h
+++ b/engines/mortevielle/taffich.h
@@ -32,8 +32,8 @@
 
 namespace Mortevielle {
 
-extern void chardes(Common::String nom, int32 passe, int long_);
-extern void charani(Common::String nom, int32 passe, int long_);
+extern void chardes(Common::String filename, int32 passe, int long_);
+extern void charani(Common::String filename, int32 skipSize, int length);
 extern void taffich();
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 27eb5bb..0caadad 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -137,7 +137,7 @@ int x,
         ment,
         haut,
         caff,
-        maff,
+        _maff,
         crep,
         ades,
         iouv,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index b810033..bfccd66 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -302,7 +302,7 @@ extern int x,
         ment,
         haut,
         caff,
-        maff,
+        _maff,
         crep,
         ades,
         iouv,


Commit: 87fe13ff09f3a960925d1324a045f6c4c04360c0
    https://github.com/scummvm/scummvm/commit/87fe13ff09f3a960925d1324a045f6c4c04360c0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:32-07:00

Commit Message:
MORTEVIELLE: Rename mouse functions, various formatting fixes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 02c7b6a..fe9d3a4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -534,12 +534,12 @@ void tmettre() {
 						i = Alert::show(delig, 1);
 						tesok = false;
 						entre = Ques::show();
-						hide_mouse();
+						hideMouse();
 						hirs();
 						dessine_rouleau();
 						clsf2();
 						clsf3();
-						show_mouse();
+						showMouse();
 						tinke();
 						pendule();
 						if (ipers != 0)
@@ -1034,7 +1034,7 @@ void tparler()
 	}
 	tkey1(false);
 	mennor();
-	hide_mouse();
+	hideMouse();
 	hirs();
 	premtet();
 	sparl(0, suj);
@@ -1047,7 +1047,7 @@ void tparler()
 	}
 	lib[46] = lib[45];
 	lib[45] = ' ';
-	show_mouse();
+	showMouse();
 	do {
 		choi = 0;
 		icm = 0;
@@ -1068,10 +1068,10 @@ void tparler()
 		writetp(lib[46], 0);
 		tou = '\0';
 		do {
-			mov_mouse(f, tou);
+			moveMouse(f, tou);
 			CHECK_QUIT;
 
-			read_pos_mouse(x, y, c);
+			getMousePos(x, y, c);
 			x = x * (3 - res);
 			if (x > 319)  cx = 41;
 			else cx = 1;
@@ -1135,11 +1135,11 @@ void tparler()
 				s.conf = s.conf + 3;
 				suj = 139;
 			}
-			hide_mouse();
+			hideMouse();
 			hirs();
 			premtet();
 			sparl(0, suj);
-			show_mouse();
+			showMouse();
 			if ((suj == 84) || (suj == 86)) {
 				s.pourc[5] = '*';
 				s.teauto[7] = '*';
@@ -1152,26 +1152,26 @@ void tparler()
 				s.pourc[8] = '*';
 				s.teauto[32] = '*';
 			}
-			hide_mouse();
+			hideMouse();
 			hirs();
-			show_mouse();
+			showMouse();
 		}
 	} while (!((choi == 46) || (suj == 138)));
 	if (col) {
 		s.conf = s.conf + (3 * (s.conf / 10));
-		hide_mouse();
+		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 138);
-		show_mouse();
+		showMouse();
 		col = false;
 		s.mlieu = 15;
 	}
 	ctrm = 0;
-	hide_mouse();
+	hideMouse();
 	hirs();
 	dessine_rouleau();
-	show_mouse();
+	showMouse();
 	affper(ipers);
 	tinke();
 	pendule();
@@ -1216,13 +1216,13 @@ void MortevielleEngine::endGame() {
 	clsf3();
 	repon(9, 1509);
 	tkey1(false);
-	hide_mouse();
+	hideMouse();
 	caff = 70;
 	taffich();
 	hirs();
 	premtet();
 	sparl(0, 141);
-	show_mouse();
+	showMouse();
 	clsf1();
 	repon(9, 1509);
 	repon(2, 142);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 3cb8192..bccbb10 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -64,7 +64,7 @@ int Alert::show(const Common::String &msg, int n) {
 	/*debug('** do_alert **');*/
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 	int do_alert_result;
-	hide_mouse();
+	hideMouse();
 	while (keypressed())
 		dumi = get_ch();	// input >> kbd >> dumi;
 
@@ -106,12 +106,12 @@ int Alert::show(const Common::String &msg, int n) {
 		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
-	show_mouse();
+	showMouse();
 	quoi = 0;
 	dum = false;
 	do {
 		dumi = '\377';
-		mov_mouse(dum, dumi);
+		moveMouse(dum, dumi);
 		CHECK_QUIT0;
 
 		cx = x_s;
@@ -127,7 +127,7 @@ int Alert::show(const Common::String &msg, int n) {
 				if (test1)  ix = 1;
 				else ix = 2;
 				if (ix != quoi) {
-					hide_mouse();
+					hideMouse();
 					if (quoi != 0) {
 						setPosition(quoi, coldep, esp);
 
@@ -144,12 +144,12 @@ int Alert::show(const Common::String &msg, int n) {
 					g_vm->_screenSurface.writeg(tmp2, 1);
 
 					quoi = ix;
-					show_mouse();
+					showMouse();
 				}
 			}
 		}
 		if ((quoi != 0) && ! newaff) {
-			hide_mouse();
+			hideMouse();
 			setPosition(quoi, coldep, esp);
 
 			Common::String tmp3(" ");
@@ -158,13 +158,13 @@ int Alert::show(const Common::String &msg, int n) {
 			g_vm->_screenSurface.writeg(tmp3, 0);
 
 			quoi = 0;
-			show_mouse();
+			showMouse();
 		}
 		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
 		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
 	} while (!g_vm->getMouseClick());
 	g_vm->setMouseClick(false);
-	hide_mouse();
+	hideMouse();
 	if (! test3)  {
 		quoi = n;
 		setPosition(n, coldep, esp);
@@ -174,7 +174,7 @@ int Alert::show(const Common::String &msg, int n) {
 		g_vm->_screenSurface.writeg(tmp4, 1);
 	}
 	charecr(50, succ(int, nligne) << 4);
-	show_mouse();
+	showMouse();
 
 	/* Restore the background area */
 	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
@@ -289,9 +289,9 @@ bool Ques::show() {
 	compte = 0;
 
 	do {
-		hide_mouse();
+		hideMouse();
 		hirs();
-		show_mouse();
+		showMouse();
 		i = i + 1;
 		deline(ta[i], st, tay);
 		if (res == 1)  y = 29;
@@ -340,7 +340,7 @@ bool Ques::show() {
 		do {
 			g_vm->setMouseClick(false);
 			tesok = false;
-			mov_mouse(func, key);
+			moveMouse(func, key);
 			CHECK_QUIT0;
 
 			k = 1;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 0fab9de..62f13da 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1048,7 +1048,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 
 	if (l == "")
 		return;
-	hide_mouse();
+	hideMouse();
 	pt = _textPos;
 
 	if (res == 2)
@@ -1085,7 +1085,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 		g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
 		pt.x += i;
 	}
-	show_mouse();
+	showMouse();
 }
 
 /**
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 8d89767..374851f 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -50,7 +50,7 @@ bool dans_rect(rectangle r) {
 	int x, y, c;
 
 	bool dans_rect_result;
-	read_pos_mouse(x, y, c);
+	getMousePos(x, y, c);
 	if ((x > r.x1) &&
 	        (x < r.x2) &&
 	        (y > r.y1) &&
@@ -113,15 +113,15 @@ void pictout(int seg, int dep, int x, int y) {
 }
 
 void sauvecr(int y, int dy) {
-	hide_mouse();
+	hideMouse();
 	s_sauv(gd, y, dy);
-	show_mouse();
+	showMouse();
 }
 
 void charecr(int y, int dy) {
-	hide_mouse();
+	hideMouse();
 	s_char(gd, y, dy);
-	show_mouse();
+	showMouse();
 }
 
 void adzon() {
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 2fc558a..7da2eef 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -148,7 +148,7 @@ void Menu::menu_aff() {
 
 	int pt, x, y, color, msk, num_letr;
 
-	hide_mouse();
+	hideMouse();
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
@@ -180,7 +180,7 @@ void Menu::menu_aff() {
 		} while (!(y == 9));
 		col = col + 48 * res;
 	} while (!(num_letr == 6));
-	show_mouse();
+	showMouse();
 }
 
 /**
@@ -279,7 +279,7 @@ void Menu::menuDown(int ii) {
 	// Draw the menu
 	xco = don[ii][1];
 	nb_lig = don[ii][4];
-	hide_mouse();
+	hideMouse();
 	sauvecr(10, succ(byte, don[ii][2]) << 1);
 	xco = xco << 3;
 	if (res == 1)  cx = 10;
@@ -337,7 +337,7 @@ void Menu::menuDown(int ii) {
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (!(cx == nb_lig));
 	test0 = true;
-	show_mouse();
+	showMouse();
 }
 
 /**
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index de78447..78e577a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -92,10 +92,10 @@ void modif(int &nu) {
 
 void dessine(int ad, int x, int y) {
 	/* debug('dessine'); */
-	hide_mouse();
+	hideMouse();
 	writepal(numpal);
 	pictout(ad, 0, x, y);
-	show_mouse();
+	showMouse();
 }
 
 void dessine_rouleau() {
@@ -104,9 +104,9 @@ void dessine_rouleau() {
 	if (gd == her) {
 		mem[0x7000 * 16 + 14] = 15;
 	}
-	hide_mouse();
+	hideMouse();
 	pictout(0x73a2, 0, 0, 0);
-	show_mouse();
+	showMouse();
 }
 
 
@@ -145,17 +145,17 @@ void ecrf1() {
 
 void clsf1() {
 	/* debug('clsf1'); */
-	hide_mouse();
+	hideMouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
 
-	show_mouse();
+	showMouse();
 }
 
 void clsf2() {
 //	int i, j;
 
 	/* debug('clsf2'); */
-	hide_mouse();
+	hideMouse();
 	if (f2_all) {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
@@ -164,7 +164,7 @@ void clsf2() {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
 	}
-	show_mouse();
+	showMouse();
 }
 
 void ecrf2() {
@@ -203,10 +203,10 @@ void clsf3() {
 //	int i, j;
 
 	/* debug('clsf3'); */
-	hide_mouse();
+	hideMouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
 	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
-	show_mouse();
+	showMouse();
 }
 
 void ecr3(Common::String text) {
@@ -231,7 +231,7 @@ void clsf10() {
 	Common::String st;
 
 	/* debug('clsf10'); */
-	hide_mouse();
+	hideMouse();
 	if (res == 1) {
 		co = 634;
 		cod = 534;
@@ -254,7 +254,7 @@ void clsf10() {
 	else co = 584;
 	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, co, 86));
 	/* rempli(69,12,32,5,255);*/
-	show_mouse();
+	showMouse();
 }
 
 void stop() {
@@ -595,7 +595,7 @@ void pendule() {
 
 
 	/* debug('pendule'); */
-	hide_mouse();
+	hideMouse();
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
@@ -610,7 +610,7 @@ void pendule() {
 	if (h > 12)  h = h - 12;
 	if (h == 0)  h = 12;
 	g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
-	show_mouse();
+	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 	if (heu > 11)
 		g_vm->_screenSurface.writeg("PM ", 1);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c388c4a..7a49456 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -181,7 +181,7 @@ void tinke() {
 void fenat(char ans) {
 	int coul;
 
-	hide_mouse();
+	hideMouse();
 	if (gd == cga)
 		coul = 2;
 	else if (gd == her)
@@ -191,7 +191,7 @@ void fenat(char ans) {
 
 	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
 	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
-	show_mouse();
+	showMouse();
 }
 
 
@@ -207,18 +207,18 @@ void tkey1(bool d) {
 	int x, y, c;
 	int key;
 
-	hide_mouse();
+	hideMouse();
 	fenat('K');
 	while (keypressed())  key = testou();
 	do {
 		if (d)  tinke();
 		quest = keypressed();
-		read_pos_mouse(x, y, c);
+		getMousePos(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && anyone)));
 	if (quest)  key = testou();
 	g_vm->setMouseClick(false);
-	show_mouse();
+	showMouse();
 }
 
 void tmlieu(int mli) {
@@ -384,7 +384,7 @@ void sparl(float adr, float rep) {
 	char st[1410];
 
 	repint = abs((int)rep);
-	hide_mouse();
+	hideMouse();
 	deline(repint + c_paroles, st, tay);
 	afftex(st, 230, 4, 65, 24, 5);
 	f3f8::draw();
@@ -396,7 +396,7 @@ void sparl(float adr, float rep) {
 		CHECK_QUIT;
 	} while (!(key == 66));
 	hirs();
-	show_mouse();
+	showMouse();
 }
 
 void finfouil() {
@@ -477,13 +477,13 @@ void t1sama() {    /* On entre dans le manoir */                 //Translation:
 		repon(2, 33);
 		tkey1(false);
 		mennor();
-		hide_mouse();
+		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 140);
 		dessine_rouleau();
 		pendule();
-		show_mouse();
+		showMouse();
 		s.mlieu = 0;
 		affrep();
 		t5(10);
@@ -616,7 +616,7 @@ void tfleche() {
 		touch = '\0';
 
 		do {
-			mov_mouse(qust, touch);
+			moveMouse(qust, touch);
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index b35e986..256b855 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -145,7 +145,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	c_zzz = 1;
 	init_nbrepm();
-	init_mouse();
+	initMouse();
 
 	init_lieu();
 	sonoff = false;
@@ -497,7 +497,7 @@ void MortevielleEngine::mainGame() {
 	dprog();
 	hirs();
 	dessine_rouleau();
-	show_mouse();
+	showMouse();
 
 	// Loop to play the game
 	do {
@@ -549,7 +549,7 @@ void MortevielleEngine::handleAction() {
 		do {
 			g_vm->_menu.mdn();
 			tinke();
-			mov_mouse(funct, inkey);
+			moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
 		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 51af36b..d99163c 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -47,8 +47,11 @@ int m_show,
 
 int s_s[12][6];
 
-
-void init_mouse() {
+/**
+ * Initialize the mouse
+ * @remarks	Originally called 'init_mouse'
+ */
+void initMouse() {
 	registres reg;
 
 	mouse_shwn = 0;
@@ -58,23 +61,28 @@ void init_mouse() {
 	
 	g_vm->setMouseClick(false);
 	m_show = m_arrow;
-	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))  int_m = false;
+	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))
+		int_m = false;
+
 	if (int_m) {
 		reg.ax = 0;
 		intr(0x33, reg);
 		int_m = (reg.ax == -1);
 		if (int_m) {
-			{
-				reg.ax = 4;
-				reg.cx = 0;
-				reg.dx = 0;
-			}
+			reg.ax = 4;
+			reg.cx = 0;
+			reg.dx = 0;
+
 			intr(0x33, reg);
 		}
 	}
 }
 
-void hide_mouse() {
+/**
+ * Hide the mouse
+ * @remarks	Originally called 'hide_mouse'
+ */
+void hideMouse() {
 	int i, j, k, ps;;
 	bool imp;
 
@@ -83,7 +91,7 @@ void hide_mouse() {
 		imp = odd(y_s);
 		j = p_o_s;
 		switch (gd) {
-		case cga : {
+		case cga: {
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
@@ -91,12 +99,12 @@ void hide_mouse() {
 				WRITE_LE_UINT16(&mem[0xb800 * 16 + j + 2], s_s[1][k]);
 				WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
 				WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
-				j = j + 80;
+				j += 80;
 				k = succ(int, k);
 			} while (!(k >= 5));
 		}
 		break;
-		case ams : {
+		case ams: {
 			for (i = 0; i <= 3; i ++) {
 				port[0x3dd] = 1 << i;
 				k = 0;
@@ -104,10 +112,10 @@ void hide_mouse() {
 				do {
 					if (imp) {
 						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
-						j = j + 80 - 0x2000;
+						j += 80 - 0x2000;
 					} else {
 						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
-						j = j + 0x2000;
+						j += 0x2000;
 					}
 					imp = ! imp;
 					k = succ(int, k);
@@ -115,7 +123,7 @@ void hide_mouse() {
 			}
 		}
 		break;
-		case ega : {
+		case ega: {
 			port[0x3c4] = 2;
 			port[0x3ce] = 8;
 			port[0x3cf] = 255;
@@ -129,23 +137,23 @@ void hide_mouse() {
 					mem[0xa000 * 16 + j] = lo(s_s[i][k]);
 					ps = mem[0xa000 * 16 + j + 1];
 					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
-					j = j + 80;
+					j += 80;
 					k = succ(int, k);
 				} while (!(k >= 8));
-				i = i + 1;
+				++i;
 			} while (!(i == 4));
 		}
 		break;
-		case her : {
+		case her: {
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; i ++) {
 				for (k = 0; k <= 3; k ++) 
 					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
-				j = j + 80;
+				j += 80;
 			}
 		}
 		break;
-		case tan : {
+		case tan: {
 			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 			k = 0;
 			do {
@@ -153,7 +161,7 @@ void hide_mouse() {
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
-				j = j + 160;
+				j += 160;
 				k = succ(int, k);
 			} while (!(k == 3));
 		}
@@ -163,7 +171,11 @@ void hide_mouse() {
 	}
 }
 
-void show_mouse() {
+/**
+ * Show mouse
+ * @remarks	Originally called 'show_mouse'
+ */
+void showMouse() {
 	int i, j, k, l;
 	bool imp;
 
@@ -173,7 +185,7 @@ void show_mouse() {
 	imp = odd(y_s);
 	i = x_s & 7;
 	switch (gd) {
-	case cga : {
+	case cga: {
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
@@ -181,12 +193,12 @@ void show_mouse() {
 			s_s[1][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j + 2]);
 			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
 			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
-			j = j + 80;
+			j += 80;
 			k = succ(int, k);
 		} while (!(k >= 5));
 	}
 	break;
-	case ams : {
+	case ams: {
 		for (i = 0; i <= 3; i ++) {
 			j = p_o_s;
 			imp = odd(y_s);
@@ -195,10 +207,10 @@ void show_mouse() {
 			do {
 				if (imp) {
 					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
-					j = j + 80 - 0x2000;
+					j += 80 - 0x2000;
 				} else {
 					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
-					j = j + 0x2000;
+					j += 0x2000;
 				}
 				imp = ! imp;
 				k = succ(int, k);
@@ -206,7 +218,7 @@ void show_mouse() {
 		}
 	}
 	break;
-	case ega : {
+	case ega: {
 		port[0x3ce] = 4;
 		l = 0;
 		do {
@@ -215,14 +227,14 @@ void show_mouse() {
 			j = p_o_s;
 			do {
 				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 * 16 + succ(int, j)] << 8);
-				j = j + 80;
+				j += 80;
 				k = succ(int, k);
 			} while (!(k >= 8));
-			l = l + 1;
+			++l;
 		} while (!(l == 4));
 	}
 	break;
-	case her : {
+	case her: {
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; i ++) {
 			for (k = 0; k <= 3; k ++)
@@ -231,7 +243,7 @@ void show_mouse() {
 		}
 	}
 	break;
-	case tan : {
+	case tan: {
 		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 		k = 0;
 		do {
@@ -239,7 +251,7 @@ void show_mouse() {
 				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
 				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
-			j = j + 160;
+			j += 160;
 			k = succ(int, k);
 		} while (!(k == 3));
 	}
@@ -247,24 +259,41 @@ void show_mouse() {
 	}    /*  case Gd   */
 }
 
-void pos_mouse(int x, int y) {
-	if (x > 314 * res)  x = 314 * res;
-	else if (x < 0)  x = 0;
-	if (y > 199)  y = 199;
-	else if (y < 0)  y = 0;
-	if ((x == x_s) && (y == y_s))  return;
+/**
+ * Set mouse position
+ * @remarks	Originally called 'pos_mouse'
+ */
+void setMousePos(int x, int y) {
+	if (x > 314 * res)
+		x = 314 * res;
+	else if (x < 0)
+		x = 0;
+	if (y > 199)
+		y = 199;
+	else if (y < 0)
+		y = 0;
+	if ((x == x_s) && (y == y_s))
+		return;
 
 	// Set the new position
 	g_vm->setMousePos(Common::Point(x, y));
 }
 
-void read_pos_mouse(int &x, int &y, int &c) {
+/**
+ * Get mouse poisition
+ * @remarks	Originally called 'read_pos_mouse'
+ */
+void getMousePos(int &x, int &y, int &c) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
 	c = g_vm->getMouseClick() ? 1 : 0;
 }
 
-void mov_mouse(bool &funct, char &key) {
+/**
+ * Move mouse
+ * @remarks	Originally called 'mov_mouse'
+ */
+void moveMouse(bool &funct, char &key) {
 	bool p_key;
 	char in1, in2;
 	int cx, cy, cd;
@@ -283,52 +312,46 @@ void mov_mouse(bool &funct, char &key) {
 		CHECK_QUIT;
 
 		in1 = get_ch();
-		read_pos_mouse(cx, cy, cd);
+		getMousePos(cx, cy, cd);
 		switch (toupper(in1)) {
-		case '4' :
+		case '4':
 			cx = cx - 8;
 			break;
-		case '2' :
+		case '2':
 			cy = cy + 8;
 			break;
-		case '6' :
+		case '6':
 			cx = cx + 8;
 			break;
-		case '8' :
+		case '8':
 			cy = cy - 8;
 			break;
-		case '7' : {
+		case '7':
 			cy = 1;
 			cx = 1;
-		}
-		break;
-		case '1' : {
+			break;
+		case '1':
 			cx = 1;
 			cy = 190;
-		}
-		break;
-		case '9' : {
+			break;
+		case '9':
 			cx = 315 * res;
 			cy = 1;
-		}
-		break;
-		case '3' : {
+			break;
+		case '3':
 			cy = 190;
 			cx = 315 * res;
-		}
-		break;
-		case '5' : {
+			break;
+		case '5':
 			cy = 100;
 			cx = 155 * res;
-		}
-		break;
+			break;
 		case ' ':
-		case '\15' : {
+		case '\15':
 			g_vm->setMouseClick(true);
 			return;
-		}
-		break;
-		case '\33' : {
+			break;
+		case '\33':
 			p_key = keypressed();
 
 			if (p_key) {
@@ -340,102 +363,90 @@ void mov_mouse(bool &funct, char &key) {
 					return;
 				} else {
 					switch (in2) {
-					case 'K' :
+					case 'K':
 						cx = pred(int, cx);
 						break;
-					case 'P' :
+					case 'P':
 						cy = succ(int, cy);
 						break;
-					case 'M' :
+					case 'M':
 						cx = cx + 2;
 						break;
-					case 'H' :
+					case 'H':
 						cy = pred(int, cy);
 						break;
-					case 'G' : {
+					case 'G':
 						cx = cx - 1;
 						cy = cy - 1;
-					}
-					break;
-					case 'I' : {
+						break;
+					case 'I':
 						cx = cx + 1;
 						cy = cy - 1;
-					}
-					break;
-					case 'O' : {
+						break;
+					case 'O':
 						cx = cx - 1;
 						cy = cy + 1;
-					}
-					break;
-					case 'Q' : {
+						break;
+					case 'Q':
 						cx = cx + 1;
 						cy = cy + 1;
-					}
-					break;
-					}    /* case */
+						break;
+					default:
+						break;
+					}    // case
 				}
 			}
-		}
-		break;
-		case 'I' : {
+			break;
+		case 'I':
 			cx = res * 32;
 			cy = 8;
-		}
-		break;
-		case 'D' : {
+			break;
+		case 'D':
 			cx = 80 * res;
 			cy = 8;
-		}
-		break;
-		case 'A' : {
+			break;
+		case 'A':
 			cx = 126 * res;
 			cy = 8;
-		}
-		break;
-		case 'S' : {
+			break;
+		case 'S':
 			cx = 174 * res;
 			cy = 8;
-		}
-		break;
-		case 'P' : {
+			break;
+		case 'P':
 			cx = 222 * res;
 			cy = 8;
-		}
-		break;
-		case 'F' : {
+			break;
+		case 'F':
 			cx = res * 270;
 			cy = 8;
-		}
-		break;
-		case '\23' : {
+			break;
+		case '\23':
 			sonoff = ! sonoff;
 			return;
-		}
-		break;
-		case '\26' : {
+			break;
+		case '\26':
 			zuul = true;
 			return;
-		}
-		break;
-		case '\24' : {           /* ^T => mode tandy */
+			break;
+		case '\24':           // ^T => mode tandy
 			funct = true;
 			key = '\11';
-		}
-		break;
-		case '\10' : {           /* ^H => mode Hercule */
+			break;
+		case '\10':           // ^H => mode Hercule
 			funct = true;
 			key = '\7';
-		}
-		break;
+			break;
 		case '\1':
 		case '\3':
-		case '\5' : {
+		case '\5':
 			funct = true;
 			key = in1;
+			break;
+		default:
+			break;
 		}
-		break;
-		}
-		pos_mouse(cx, cy);
+		setMousePos(cx, cy);
 		p_key = keypressed();
 	}
 }
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 32fba04..d17654c 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -38,14 +38,14 @@ extern int m_show,
         p_o_s,
         mouse_shwn;
 
-void init_mouse();
+void initMouse();
 //extern void change_mouse(int t);
 //extern void dessine_souris(int xf, int yf);
-extern void hide_mouse();
-extern void show_mouse();
-extern void pos_mouse(int x, int y);
-extern void read_pos_mouse(int &x, int &y, int &c);
-extern void mov_mouse(bool &funct, char &key);
+extern void hideMouse();
+extern void showMouse();
+extern void setMousePos(int x, int y);
+extern void getMousePos(int &x, int &y, int &c);
+extern void moveMouse(bool &funct, char &key);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index f0a95ff..737ec66 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -39,11 +39,11 @@
 namespace Mortevielle {
 
 void change_gd(int ngd) {
-	hide_mouse();
+	hideMouse();
 	gd = ngd;
 	hirs();
-	init_mouse();
-	show_mouse();
+	initMouse();
+	showMouse();
 	dessine_rouleau();
 	tinke();
 	pendule();
@@ -67,7 +67,7 @@ void MortevielleEngine::gameLoaded() {
 	char g[8];
 
 
-	hide_mouse();
+	hideMouse();
 	imen = false;
 	g[1] = 'M';
 	_loseGame = true;
@@ -131,7 +131,7 @@ void MortevielleEngine::gameLoaded() {
 	modinv();
 	if (s.derobj != 0)  modobj2(s.derobj + 400, test[1], test[2]);
 	else tesok = test[1] || test[2];
-	show_mouse();
+	showMouse();
 }
 
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 0b3946a..c2c4395 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -118,7 +118,7 @@ void SavegameManager::takesav(int n) {
  * Load a saved game
  */
 Common::Error SavegameManager::loadGame(int n) {
-	hide_mouse();
+	hideMouse();
 	maivid();
 	takesav(n);
 	
@@ -126,7 +126,7 @@ Common::Error SavegameManager::loadGame(int n) {
 	theure();
 	dprog();
 	g_vm->gameLoaded();
-	show_mouse();
+	showMouse();
 	return Common::kNoError;
 }
 
@@ -137,7 +137,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	Common::OutSaveFile *f;
 	int i;
 
-	hide_mouse();
+	hideMouse();
 	tmaj3();
 	
 	for (i = 0; i <= 389; i ++)
@@ -165,7 +165,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	delete f;
 
 	dem2();
-	show_mouse();
+	showMouse();
 	return Common::kNoError;
 }
 
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index e654d1a..9402f3f 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -40,7 +40,6 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
 
-	testfi();
 	int skipBlock = 0;
 	while (skipSize > 127) {
 		++skipBlock;
@@ -66,11 +65,9 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 
 void charani(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
-
 	if (!f.open(filename))
 		error("Missing file - %s", filename.c_str());
 
-	testfi();
 	int skipBlock = 0;
 	while (skipSize > 127) {
 		skipSize = skipSize - 128;
@@ -153,23 +150,29 @@ void taffich() {
 	}
 
 	okdes = true;
-	hide_mouse();
+	hideMouse();
 	lgt = 0;
 	Common::String filename;
 
 	if ((a != 50) && (a != 51)) {
 		m = a + 2000;
-		if ((m > 2001) && (m < 2010))  m = 2001;
-		if (m == 2011)  m = 2010;
-		if (a == 32)  m = 2034;
-		if ((a == 17) && (_maff == 14))  m = 2018;
+		if ((m > 2001) && (m < 2010))
+			m = 2001;
+		if (m == 2011)
+			m = 2010;
+		if (a == 32)
+			m = 2034;
+		if ((a == 17) && (_maff == 14))
+			m = 2018;
 		if (a > 99)
-			if ((is == 1) || (is == 0))  m = 2031;
-			else m = 2032;
-		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144)
-		        || (a == 147) || (a == 149))  m = 2030;
-		if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99)))
-		        || ((_maff > 29) && (_maff < 33)))  m = 2033;
+			if ((is == 1) || (is == 0))
+				m = 2031;
+			else
+				m = 2032;
+		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
+			m = 2030;
+		if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99))) || ((_maff > 29) && (_maff < 33)))
+			m = 2033;
 		messint(m);
 		_maff = a;
 		if (a == 159)
@@ -224,10 +227,14 @@ void taffich() {
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
 		lgt = 0;
 		if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26)) {
-			if (b == 26)  b = 18;
-			else if (b == 24)  b = 17;
-			else if (b > 15)  b = b - 1;
-			for (cx = 0; cx <= (b - 1); cx ++) lgt = lgt + l[cx + 89];
+			if (b == 26)
+				b = 18;
+			else if (b == 24)
+				b = 17;
+			else if (b > 15)
+				b = b - 1;
+			for (cx = 0; cx <= (b - 1); cx ++)
+				lgt = lgt + l[cx + 89];
 			handle = l[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
@@ -236,10 +243,12 @@ void taffich() {
 		}
 		charani(filename, lgt, handle);
 	}
-	show_mouse();
+	showMouse();
 	if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != entrer)) {
-		if ((a == 13) || (a == 14))  person();
-		else if (! blo)  t11(s.mlieu, cx);
+		if ((a == 13) || (a == 14))
+			person();
+		else if (! blo)
+			t11(s.mlieu, cx);
 		mpers =  0;
 	}
 }


Commit: 45553de16d34011736ede49a41d5f23eda457d17
    https://github.com/scummvm/scummvm/commit/45553de16d34011736ede49a41d5f23eda457d17
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:33-07:00

Commit Message:
MORTEVIELLE: Some more code formatting in mouse

Changed paths:
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d99163c..d724fe6 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -36,8 +36,7 @@ namespace Mortevielle {
 const int m_arrow = 0;
 const int m_point_hand = 1;
 
-bool int_m,
-        clic;
+bool int_m, clic;
 
 int m_show,
         x_s,
@@ -91,7 +90,7 @@ void hideMouse() {
 		imp = odd(y_s);
 		j = p_o_s;
 		switch (gd) {
-		case cga: {
+		case cga:
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
@@ -102,9 +101,8 @@ void hideMouse() {
 				j += 80;
 				k = succ(int, k);
 			} while (!(k >= 5));
-		}
-		break;
-		case ams: {
+			break;
+		case ams:
 			for (i = 0; i <= 3; i ++) {
 				port[0x3dd] = 1 << i;
 				k = 0;
@@ -117,13 +115,12 @@ void hideMouse() {
 						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 0x2000;
 					}
-					imp = ! imp;
+					imp = !imp;
 					k = succ(int, k);
 				} while (!(k >= 8));
 			}
-		}
-		break;
-		case ega: {
+			break;
+		case ega:
 			port[0x3c4] = 2;
 			port[0x3ce] = 8;
 			port[0x3cf] = 255;
@@ -142,18 +139,16 @@ void hideMouse() {
 				} while (!(k >= 8));
 				++i;
 			} while (!(i == 4));
-		}
-		break;
-		case her: {
+			break;
+		case her:
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; i ++) {
 				for (k = 0; k <= 3; k ++) 
 					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
-		}
-		break;
-		case tan: {
+			break;
+		case tan:
 			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 			k = 0;
 			do {
@@ -164,10 +159,10 @@ void hideMouse() {
 				j += 160;
 				k = succ(int, k);
 			} while (!(k == 3));
-		}
-		break;
-
-		}     /* case Gd */
+			break;
+		default:
+			break;
+		}     // case Gd
 	}
 }
 
@@ -180,12 +175,13 @@ void showMouse() {
 	bool imp;
 
 	mouse_shwn = mouse_shwn + 1;
-	if (mouse_shwn != 1)  return;
+	if (mouse_shwn != 1)
+		return;
 	j = p_o_s;
 	imp = odd(y_s);
 	i = x_s & 7;
 	switch (gd) {
-	case cga: {
+	case cga:
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
@@ -196,9 +192,8 @@ void showMouse() {
 			j += 80;
 			k = succ(int, k);
 		} while (!(k >= 5));
-	}
-	break;
-	case ams: {
+		break;
+	case ams:
 		for (i = 0; i <= 3; i ++) {
 			j = p_o_s;
 			imp = odd(y_s);
@@ -212,13 +207,12 @@ void showMouse() {
 					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
 					j += 0x2000;
 				}
-				imp = ! imp;
+				imp = !imp;
 				k = succ(int, k);
 			} while (!(k >= 8));
 		}
-	}
-	break;
-	case ega: {
+		break;
+	case ega:
 		port[0x3ce] = 4;
 		l = 0;
 		do {
@@ -232,18 +226,16 @@ void showMouse() {
 			} while (!(k >= 8));
 			++l;
 		} while (!(l == 4));
-	}
-	break;
-	case her: {
+		break;
+	case her:
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; i ++) {
 			for (k = 0; k <= 3; k ++)
 				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j]);
-			j = j + 80;
+			j += 80;
 		}
-	}
-	break;
-	case tan: {
+		break;
+	case tan:
 		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 		k = 0;
 		do {
@@ -254,9 +246,10 @@ void showMouse() {
 			j += 160;
 			k = succ(int, k);
 		} while (!(k == 3));
-	}
-	break;
-	}    /*  case Gd   */
+		break;
+	default:
+		break;
+	}    //  case Gd
 }
 
 /**
@@ -370,26 +363,26 @@ void moveMouse(bool &funct, char &key) {
 						cy = succ(int, cy);
 						break;
 					case 'M':
-						cx = cx + 2;
+						cx += 2;
 						break;
 					case 'H':
 						cy = pred(int, cy);
 						break;
 					case 'G':
-						cx = cx - 1;
-						cy = cy - 1;
+						--cx;
+						--cy;
 						break;
 					case 'I':
-						cx = cx + 1;
-						cy = cy - 1;
+						++cx;
+						--cy;
 						break;
 					case 'O':
-						cx = cx - 1;
-						cy = cy + 1;
+						--cx;
+						++cy;
 						break;
 					case 'Q':
-						cx = cx + 1;
-						cy = cy + 1;
+						++cx;
+						++cy;
 						break;
 					default:
 						break;
@@ -422,7 +415,7 @@ void moveMouse(bool &funct, char &key) {
 			cy = 8;
 			break;
 		case '\23':
-			sonoff = ! sonoff;
+			sonoff = !sonoff;
 			return;
 			break;
 		case '\26':
@@ -446,6 +439,7 @@ void moveMouse(bool &funct, char &key) {
 		default:
 			break;
 		}
+
 		setMousePos(cx, cy);
 		p_key = keypressed();
 	}


Commit: 8458a8bf66b339d6616b4dfc7874f86c1d524104
    https://github.com/scummvm/scummvm/commit/8458a8bf66b339d6616b4dfc7874f86c1d524104
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:35-07:00

Commit Message:
MORTEVIELLE: Apply coding conventions to actions.cpp

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index fe9d3a4..5aa91f8 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -56,69 +56,106 @@ void taller() {
 		if (!syn)
 			ecr3(g_vm->getString(S_GO_TO));
 		tfleche();
-		if (iesc)  okdes = false;
-		if ((anyone) || (iesc))  return;
+		if (iesc)
+			okdes = false;
+		if ((anyone) || (iesc))
+			return;
 		tcoord(1);
-		if (num == 0)  return;
+		if (num == 0)
+			return;
 		if (num == 1) {
 			s.mlieu = 0;
 			tmlieu(0);
 		} else if (num == 7) {
 			s.mlieu = 13;
 			tmlieu(13);
-		} else if (num != 6)  s.mlieu = 26;
-		if ((num > 1) && (num < 6))  ment = num - 1;
-		if (num > 7)  ment = num - 3;
-		if (num != 6)  affrep();
-		else aldepl();
+		} else if (num != 6)
+			s.mlieu = 26;
+		if ((num > 1) && (num < 6))
+			ment = num - 1;
+		if (num > 7)
+			ment = num - 3;
+		if (num != 6)
+			affrep();
+		else
+			aldepl();
 		return;
 	}
 	tsort();
 	cx = 0;
 	do {
-		cx = cx + 1;
+		++cx;
 	} while (!(g_vm->_menu._depl[cx] == msg[4]));
 	if (s.mlieu == 19) {
-		if (cx == 1)  t1deva();
-		if (cx == 2)  t1neig();
+		if (cx == 1)
+			t1deva();
+		if (cx == 2)
+			t1neig();
 		goto L2;
 	}
 	if (s.mlieu == 23) {
-		if (cx == 1)  t1deau();
-		if (cx == 2)  t1derr();
+		if (cx == 1)
+			t1deau();
+		if (cx == 2)
+			t1derr();
 		goto L2;
 	}
-	if ((s.mlieu == 11) && (cx == 1))  cx = 6;
+	if ((s.mlieu == 11) && (cx == 1))
+		cx = 6;
 	if (s.mlieu == 12) {
-		if (cx == 2)  cx = 6;
-		if (cx == 5)  cx = 16;
+		if (cx == 2)
+			cx = 6;
+		if (cx == 5)
+			cx = 16;
 	}
-	if ((s.mlieu == 14) && (cx == 3))  cx = 6;
-	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))  cx = 6;
-	if ((s.mlieu > 19) && (s.mlieu != 26))  cx = cx + 10;
-	if ((s.mlieu == 20) && (cx == 13))  cx = 16;
+	if ((s.mlieu == 14) && (cx == 3))
+		cx = 6;
+	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))
+		cx = 6;
+	if ((s.mlieu > 19) && (s.mlieu != 26))
+		cx += 10;
+	if ((s.mlieu == 20) && (cx == 13))
+		cx = 16;
 	if (s.mlieu == 21) {
-		if (cx == 12)  cx = 16;
-		else if (cx > 13)  cx = 15;
+		if (cx == 12)
+			cx = 16;
+		else if (cx > 13)
+			cx = 15;
 	}
-	if ((s.mlieu == 22) && (cx > 14))  cx = 15;
+	if ((s.mlieu == 22) && (cx > 14))
+		cx = 15;
 	if ((s.mlieu == 24) && (cx != 17))
-		if (cx > 13)  cx = 15;
-	if (cx == 1)  s.mlieu = 11;
-	else if (cx == 2)  s.mlieu = 12;
-	else if (cx == 3)  s.mlieu = 14;
-	else if (cx == 4)  s.mlieu = 15;
-	else if (cx == 5)  cx = 12;
-	if (cx == 6)  cx = 11;
-	if (cx == 11)  t1sama();
-	else if (cx == 12)  t1deva();
-	else if (cx == 13)  s.mlieu = 20;
-	else if (cx == 14)  s.mlieu = 24;
-	else if (cx == 15)  t1neig();
-	else if (cx == 16)  t1derr();
+		if (cx > 13)
+			cx = 15;
+	if (cx == 1)
+		s.mlieu = 11;
+	else if (cx == 2)
+		s.mlieu = 12;
+	else if (cx == 3)
+		s.mlieu = 14;
+	else if (cx == 4)
+		s.mlieu = 15;
+	else if (cx == 5)
+		cx = 12;
+	if (cx == 6)
+		cx = 11;
+	if (cx == 11)
+		t1sama();
+	else if (cx == 12)
+		t1deva();
+	else if (cx == 13)
+		s.mlieu = 20;
+	else if (cx == 14)
+		s.mlieu = 24;
+	else if (cx == 15)
+		t1neig();
+	else if (cx == 16)
+		t1derr();
 	else if (cx == 17) {
-		if ((s.ipuit != 120) && (s.ipuit != 140))  crep = 997;
-		else if (s.ipuit == 120)  crep = 181;
+		if ((s.ipuit != 120) && (s.ipuit != 140))
+			crep = 997;
+		else if (s.ipuit == 120)
+			crep = 181;
 		else if (s.conf > 80) {
 			crep = 1505;
 			tperd();
@@ -127,7 +164,8 @@ void taller() {
 			affrep();
 		}
 	}
-	if ((cx < 5) || (cx == 13) || (cx == 14))  affrep();
+	if ((cx < 5) || (cx == 13) || (cx == 14))
+		affrep();
 	debloc(s.mlieu);
 L2:
 	tmlieu(s.mlieu);
@@ -141,26 +179,34 @@ void tprendre() {
 		cx = caff;
 		avpoing(cx);
 		if (crep != 139) {
-			if (ipers > 0)  s.conf = s.conf + 3;
+			if (ipers > 0)
+				s.conf += 3;
 			if (obpart) {
-				if (s.mlieu == 2)  s.iloic = 0;
+				if (s.mlieu == 2)
+					s.iloic = 0;
 				if (s.mlieu == 13) {
-					if (s.iboul == caff)  s.iboul = 0;
-					if (s.ibag == caff)  s.ibag = 0;
+					if (s.iboul == caff)
+						s.iboul = 0;
+					if (s.ibag == caff)
+						s.ibag = 0;
 				}
-				if (s.mlieu == 14)  s.icave = 0;
-				if (s.mlieu == 16)  s.icryp = 0;
-				if (s.mlieu == 17)  s.ivier = 0;
-				if (s.mlieu == 24)  s.ipuit = 0;
+				if (s.mlieu == 14)
+					s.icave = 0;
+				if (s.mlieu == 16)
+					s.icryp = 0;
+				if (s.mlieu == 17)
+					s.ivier = 0;
+				if (s.mlieu == 24)
+					s.ipuit = 0;
 				mfouen();
 				obpart = false;
 				affrep();
 			} else {
 				tabdon[acha + (pred(int, mchai) * 10) + pred(int, cs)] = 0;
 				tsuiv();
-				dobj = dobj + 1;
+				++dobj;
 				if (dobj > 6) {
-					s.conf = s.conf + 2;
+					s.conf += 2;
 					dobj = 0;
 				}
 			}
@@ -170,7 +216,8 @@ void tprendre() {
 	if (!syn)
 		ecr3(g_vm->getString(S_TAKE));
 	tfleche();
-	if ((anyone) || (iesc))  return;
+	if ((anyone) || (iesc))
+		return;
 	if (caff == 3) {
 		tcoord(2);
 		if (num == 1) {
@@ -182,22 +229,28 @@ void tprendre() {
 	if ((num == 0) || ((num == 1) && (s.mlieu == 16))) {
 		tcoord(8);
 		if (num != 0) {
-			if (ipers > 0)  s.conf = s.conf + 3;
+			if (ipers > 0)
+				s.conf += 3;
 			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))  avpoing(s.iloic);
+			if ((s.mlieu == 2) && (s.iloic != 0))
+				avpoing(s.iloic);
 			if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) {
 				avpoing(s.iboul);
-				if ((crep != 997) && (crep != 139))  aniof(2, 7);
+				if ((crep != 997) && (crep != 139))
+					aniof(2, 7);
 			}
 			if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) {
 				avpoing(s.ibag);
-				if ((crep != 997) && (crep != 139))  aniof(2, 6);
+				if ((crep != 997) && (crep != 139))
+					aniof(2, 6);
 			}
 			if ((s.mlieu == 14) && (s.icave != 0)) {
 				avpoing(s.icave);
-				if ((crep != 997) && (crep != 139))  aniof(2, 2);
+				if ((crep != 997) && (crep != 139))
+					aniof(2, 2);
 			}
-			if ((s.mlieu == 16) && (s.icryp != 0))  avpoing(s.icryp);
+			if ((s.mlieu == 16) && (s.icryp != 0))
+				avpoing(s.icryp);
 			if ((s.mlieu == 17) && (s.ivier != 0)) {
 				avpoing(s.ivier);
 				if ((crep != 997) && (crep != 139)) {
@@ -207,25 +260,26 @@ void tprendre() {
 			}
 			if ((s.mlieu == 24) && (s.ipuit != 0)) {
 				avpoing(s.ipuit);
-				if ((crep != 997) && (crep != 139))  aniof(2, 1);
+				if ((crep != 997) && (crep != 139))
+					aniof(2, 1);
 			}
-			if ((crep != 997) && (crep != 182) && (crep != 139))  crep = 999;
+			if ((crep != 997) && (crep != 182) && (crep != 139))
+				crep = 999;
 		}
 	} else {
-		if (((s.mlieu == 0) && (num == 3)) || ((s.mlieu == 1) && (num == 4))
-		        || ((s.mlieu == 2) && (num == 1)) || ((s.mlieu == 4) && (num == 3))
-		        || ((s.mlieu == 5) && (num == 6)) || ((s.mlieu == 6) && (num == 2))
-		        || ((s.mlieu == 7) && (num == 6)) || ((s.mlieu == 8) && (num == 4))
-		        || ((s.mlieu == 9) && (num == 4)) || ((s.mlieu == 10) && (num > 2))
-		        || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
-		        || ((s.mlieu == 13) && (num > 4)) || ((s.mlieu > 13)
-		                && (s.mlieu != 23)))  crep = 997;
-		else {
-			if (s.mlieu == 23) {
-				crep = 1504;
-				tperd();
-			} else crep = 120;
-		}
+		if ( ((s.mlieu == 0)  && (num == 3)) || ((s.mlieu == 1)  && (num == 4))
+		  || ((s.mlieu == 2)  && (num == 1)) || ((s.mlieu == 4)  && (num == 3))
+		  || ((s.mlieu == 5)  && (num == 6)) || ((s.mlieu == 6)  && (num == 2))
+		  || ((s.mlieu == 7)  && (num == 6)) || ((s.mlieu == 8)  && (num == 4))
+		  || ((s.mlieu == 9)  && (num == 4)) || ((s.mlieu == 10) && (num > 2))
+		  || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
+		  || ((s.mlieu == 13) && (num > 4))  || ((s.mlieu > 13)  && (s.mlieu != 23)) )
+		  crep = 997;
+		else if (s.mlieu == 23) {
+			crep = 1504;
+			tperd();
+		} else
+			crep = 120;
 	}
 }
 
@@ -234,13 +288,14 @@ void tsprendre() {
 
 	cx = 0;
 	do {
-		cx = cx + 1;
+		++cx;
 	} while (!(g_vm->_menu._invt[cx] == msg[4]));
 	cz = 0;
 	cy = 0;
 	do {
-		cy = cy + 1;
-		if (ord(s.sjer[cy]) != 0)  cz = cz + 1;
+		++cy;
+		if (ord(s.sjer[cy]) != 0)
+			++cz;
 	} while (!(cz == cx));
 	cz = ord(s.sjer[cy]);
 	s.sjer[cy] = chr(0);
@@ -250,37 +305,43 @@ void tsprendre() {
 	clsf2();
 }
 
-void tsoulever()
-
-{
+void tsoulever() {
 	int cx;
 
 	if (!syn)
 		ecr3(g_vm->getString(S_LIFT));
 	tfleche();
-	if ((anyone) || (iesc))  return;
+	if ((anyone) || (iesc))
+		return;
 	tcoord(3);
 	if (num == 0) {
 		tcoord(8);
 		if (num != 0) {
-			if (ipers > 0)  s.conf = s.conf + 1;
+			if (ipers > 0)
+				++s.conf;
 			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))  treg(s.iloic);
+			if ((s.mlieu == 2) && (s.iloic != 0))
+				treg(s.iloic);
 		}
 		return;
 	}
-	if (ipers > 0)  s.conf = s.conf + 1;
+	if (ipers > 0)
+		++s.conf;
 	cx = s.mlieu;
-	if (s.mlieu == 16)  cx = 14;
-	if (s.mlieu == 19)  cx = 15;
+	if (s.mlieu == 16)
+		cx = 14;
+	else if (s.mlieu == 19)
+		cx = 15;
 	crep = tabdon[asoul + (cx << 3) + pred(int, num)];
-	if (crep == 255)  crep = 997;
+	if (crep == 255)
+		crep = 997;
 }
 
 void tlire() {
 //	int iaff;
 
-	if (caff > 99)  st4(caff);
+	if (caff > 99)
+		st4(caff);
 	else {
 		if (!syn)
 			ecr3(g_vm->getString(S_READ));
@@ -294,8 +355,10 @@ void tlire() {
 }
 
 void tslire() {
-	if (s.derobj == 0)  crep = 186;
-	else st4(s.derobj);
+	if (s.derobj == 0)
+		crep = 186;
+	else
+		st4(s.derobj);
 }
 
 void tregarder() {
@@ -308,7 +371,8 @@ void tregarder() {
 	if (!syn)
 		ecr3(g_vm->getString(S_LOOK));
 	tfleche();
-	if ((anyone) || (iesc))  return;
+	if ((anyone) || (iesc))
+		return;
 	tcoord(5);
 	if (num == 0) {
 		tcoord(8);
@@ -317,46 +381,65 @@ void tregarder() {
 			if (s.mlieu == 13) {
 				if (num == 1) {
 					crep = 164;
-					if (s.ibag != 0)  treg(s.ibag);
-					else if (s.iboul != 0)  treg(s.iboul);
+					if (s.ibag != 0)
+						treg(s.ibag);
+					else if (s.iboul != 0)
+						treg(s.iboul);
 				} else {
 					crep = 193;
-					if (s.ibag != 0)  treg(s.ibag);
+					if (s.ibag != 0)
+						treg(s.ibag);
 				}
 			}
 			if (s.mlieu == 14) {
 				crep = 164;
-				if (s.icave != 0)  treg(s.icave);
+				if (s.icave != 0)
+					treg(s.icave);
 			}
 			if (s.mlieu == 17) {
 				crep = 174;
-				if (s.ivier != 0)  treg(s.ivier);
+				if (s.ivier != 0)
+					treg(s.ivier);
 			}
 			if (s.mlieu == 24) {
 				crep = 131;
-				if (s.ipuit != 0)  treg(s.ipuit);
+				if (s.ipuit != 0)
+					treg(s.ipuit);
 			}
 		}
 		return;
 	}
 	cx = s.mlieu;
-	if (s.mlieu == 20)  cx = 17;
-	if ((s.mlieu > 21) && (s.mlieu < 25))  cx = cx - 4;
-	if (s.mlieu == 26)  cx = 21;
+	if (s.mlieu == 20)
+		cx = 17;
+	if ((s.mlieu > 21) && (s.mlieu < 25))
+		cx -= 4;
+	if (s.mlieu == 26)
+		cx = 21;
 	crep = tabdon[arega + (cx * 7) + pred(int, num)];
-	if ((s.mlieu == 13) && (num == 8))  crep = 126;
-	if (s.mlieu == 19)  crep = 103;
-	if (crep == 255)  crep = 131;
-	if ((s.mlieu == 1) && (num == 1))  treg(144);
-	if ((s.mlieu == 5) && (num == 3))  treg(147);
-	if ((s.mlieu == 8) && (num == 3))  treg(149);
-	if ((s.mlieu == 9) && (num == 2))  treg(30);
-	if ((s.mlieu == 10) && (num == 3))  treg(31);
+	if ((s.mlieu == 13) && (num == 8))
+		crep = 126;
+	if (s.mlieu == 19)
+		crep = 103;
+	if (crep == 255)
+		crep = 131;
+	if ((s.mlieu == 1) && (num == 1))
+		treg(144);
+	if ((s.mlieu == 5) && (num == 3))
+		treg(147);
+	if ((s.mlieu == 8) && (num == 3))
+		treg(149);
+	if ((s.mlieu == 9) && (num == 2))
+		treg(30);
+	if ((s.mlieu == 10) && (num == 3))
+		treg(31);
 }
 
 void tsregarder() {
-	if (s.derobj != 0)  treg(s.derobj);
-	else crep = 186;
+	if (s.derobj != 0)
+		treg(s.derobj);
+	else
+		crep = 186;
 }
 
 void tfouiller() {
@@ -370,7 +453,8 @@ void tfouiller() {
 	if (!syn)
 		ecr3(g_vm->getString(S_SEARCH));
 	tfleche();
-	if (anyone || iesc)  return;
+	if (anyone || iesc)
+		return;
 	if (s.mlieu == 23) {
 		crep = 1504;
 		tperd();
@@ -382,11 +466,13 @@ void tfouiller() {
 		if (num != 0) {
 			cx = 0;
 			do {
-				cx = cx + 1;
+				++cx;
 			} while (!((cx > 6) || (num == ord(touv[cx]))));
-			if (num != ord(touv[cx]))  crep = 187;
+			if (num != ord(touv[cx]))
+				crep = 187;
 			else {
-				if (ipers > 0)  s.conf = s.conf + 3;
+				if (ipers > 0)
+					s.conf += 3;
 				rechai(mchai);
 				if (mchai != 0) {
 					cs = 0;
@@ -394,42 +480,55 @@ void tfouiller() {
 					fouil = true;
 					mfoudi();
 					tsuiv();
-				} else crep = 997;
+				} else
+					crep = 997;
 			}
 		} else {
 			tcoord(8);
 			crep = 997;
 			if (num != 0) {
-				if (ipers > 0)  s.conf = s.conf + 3;
+				if (ipers > 0)
+					s.conf += 3;
 				if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) {
 					if (s.mlieu == 2) {
 						crep = 123;
-						if (s.iloic != 0)  treg(s.iloic);
+						if (s.iloic != 0)
+							treg(s.iloic);
 					}
 					if (s.mlieu == 16) {
 						crep = 123;
-						if (s.icryp != 0)  treg(s.icryp);
+						if (s.icryp != 0)
+							treg(s.icryp);
 					}
 				}
 			}
 		}
 	} else {
-		if (ipers > 0)  s.conf = s.conf + 3;
+		if (ipers > 0)
+			s.conf += 3;
 		crep = 997;
-		if (s.mlieu < 14)  crep = r[s.mlieu];
-		if ((s.mlieu == 3) && (num == 2))  crep = 162;
+		if (s.mlieu < 14)
+			crep = r[s.mlieu];
+		if ((s.mlieu == 3) && (num == 2))
+			crep = 162;
 		if (s.mlieu == 12) {
-			if ((num == 3) || (num == 4))  crep = 162;
-			if (num == 5)  crep = 159;
+			if ((num == 3) || (num == 4))
+				crep = 162;
+			else if (num == 5)
+				crep = 159;
 		}
-		if (s.mlieu == 19)  crep = 104;
-		if (s.mlieu == 16)  crep = 155;
+		if (s.mlieu == 19)
+			crep = 104;
+		else if (s.mlieu == 16)
+			crep = 155;
 	}
 }
 
 void tsfouiller() {
-	if (s.derobj != 0)  st7(s.derobj);
-	else crep = 186;
+	if (s.derobj != 0)
+		st7(s.derobj);
+	else
+		crep = 186;
 }
 
 void touvrir() {
@@ -441,7 +540,8 @@ void touvrir() {
 		if (ment != 0) {
 			msg[4] = entrer;
 			syn = true;
-		} else crep = 997;
+		} else
+			crep = 997;
 		return;
 	}
 	if (caff == 15) {
@@ -449,40 +549,42 @@ void touvrir() {
 		return;
 	}
 	tfleche();
-	if ((anyone) || (iesc))  return;
+	if ((anyone) || (iesc))
+		return;
 	tcoord(7);
 	if (num != 0) {
-		if (ipers > 0)  s.conf = s.conf + 2;
-		iouv = iouv + 1;
+		if (ipers > 0)
+			s.conf += 2;
+		++iouv;
 		cx = 0;
 		do {
-			cx = cx + 1;
+			++cx;
 		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
 		if (ord(touv[cx]) != num) {
-			if (!
-			        (
-			            ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
-			            ||
-			            ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6))) ||
-			            ((s.mlieu == 4) && (num == 5)) ||
-			            ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) ||
-			                            (s.mlieu == 8) || (s.mlieu == 13))) ||
-			            ((s.mlieu == 8) && (num == 2)) ||
-			            ((s.mlieu == 12) && (num == 7)))) {
-				if (((s.mlieu > 10) && (s.mlieu < 14)) ||
-				        ((s.mlieu > 6) && (s.mlieu < 10)) ||
-				        (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
+			if (!( ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
+			    || ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6)))
+				|| ((s.mlieu == 4) && (num == 5))
+				|| ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) || (s.mlieu == 8) || (s.mlieu == 13)))
+				|| ((s.mlieu == 8) && (num == 2))
+				|| ((s.mlieu == 12) && (num == 7))) ) {
+				if ( ((s.mlieu > 10) && (s.mlieu < 14))
+				  || ((s.mlieu > 6) && (s.mlieu < 10))
+				  || (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
 					haz = hazard(1, 4);
-					if (haz == 3)  parole(7, 9, 1);
+					if (haz == 3)
+						parole(7, 9, 1);
 				}
 				touv[cx] = chr(num);
 				aniof(1, num);
 			}
 			cx = s.mlieu;
-			if (s.mlieu == 16)  cx = 14;
+			if (s.mlieu == 16)
+				cx = 14;
 			crep = tabdon[aouvr + (cx * 7) + pred(int, num)];
-			if (crep == 254)  crep = 999;
-		} else crep = 18;
+			if (crep == 254)
+				crep = 999;
+		} else
+			crep = 18;
 	}
 }
 
@@ -500,26 +602,33 @@ void tmettre() {
 	if (!syn)
 		ecr3(g_vm->getString(S_PUT));
 	tfleche();
-	if (iesc)  crep = 998;
-	if ((anyone) || (iesc))  return;
+	if (iesc)
+		crep = 998;
+	if ((anyone) || (iesc))
+		return;
 	tcoord(8);
 	if (num != 0) {
 		crep = 999;
 		if (caff == 13) {
 			if (num == 1) {
-				if (s.iboul != 0)  crep = 188;
+				if (s.iboul != 0)
+					crep = 188;
 				else {
 					s.iboul = s.derobj;
-					if (s.derobj == 141)  aniof(1, 7);
+					if (s.derobj == 141)
+						aniof(1, 7);
 				}
-			} else if (s.ibag != 0)  crep = 188;
+			} else if (s.ibag != 0)
+				crep = 188;
 			else {
 				s.ibag = s.derobj;
-				if (s.derobj == 159)  aniof(1, 6);
+				if (s.derobj == 159)
+					aniof(1, 6);
 			}
 		}
 		if (caff == 14)
-			if (s.icave != 0)  crep = 188;
+			if (s.icave != 0)
+				crep = 188;
 			else {
 				s.icave = s.derobj;
 				if (s.derobj == 151) {
@@ -572,10 +681,13 @@ void tmettre() {
 				}
 			}
 		if (caff == 16)
-			if (s.icryp == 0)  s.icryp = s.derobj;
-			else crep = 188;
+			if (s.icryp == 0)
+				s.icryp = s.derobj;
+			else
+				crep = 188;
 		if (caff == 17)
-			if (s.ivier != 0)  crep = 188;
+			if (s.ivier != 0)
+				crep = 188;
 			else if (s.derobj == 143) {
 				s.ivier = 143;
 				aniof(1, 1);
@@ -584,12 +696,15 @@ void tmettre() {
 				tperd();
 			}
 		if (caff == 24)
-			if (s.ipuit != 0)  crep = 188;
+			if (s.ipuit != 0)
+				crep = 188;
 			else if ((s.derobj == 140) || (s.derobj == 120)) {
 				s.ipuit = s.derobj;
 				aniof(1, 1);
-			} else crep = 185;
-		if (crep != 188)  maivid();
+			} else
+				crep = 185;
+		if (crep != 188)
+			maivid();
 	}
 }
 
@@ -603,7 +718,8 @@ void ttourner() {
 	if (!syn)
 		ecr3(g_vm->getString(S_TURN));
 	tfleche();
-	if ((anyone) || (iesc))  return;
+	if ((anyone) || (iesc))
+		return;
 	tcoord(9);
 	if (num != 0) {
 		crep = 997;
@@ -613,7 +729,8 @@ void ttourner() {
 			quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 			if (quel == 1)
 				g_vm->_endGame = true;
-			else crep = 168;
+			else
+				crep = 168;
 		}
 		if ((s.mlieu == 17) && (s.ivier == 143)) {
 			repon(2, 175);
@@ -623,7 +740,8 @@ void ttourner() {
 			if (quel == 1) {
 				s.mlieu = 16;
 				affrep();
-			} else crep = 176;
+			} else
+				crep = 176;
 		}
 	}
 }
@@ -634,7 +752,8 @@ void tcacher() {
 	tfleche();
 	if (!(anyone) && !(iesc)) {
 		tcoord(10);
-		if (num == 0)  cache = false;
+		if (num == 0)
+			cache = false;
 		else {
 			cache = true;
 			crep = 999;
@@ -643,7 +762,8 @@ void tcacher() {
 }
 
 void tattacher() {
-	if (s.derobj == 0)  crep = 186;
+	if (s.derobj == 0)
+		crep = 186;
 	else {
 		if (!syn)
 			ecr3(g_vm->getString(S_TIE));
@@ -656,7 +776,8 @@ void tattacher() {
 				if ((s.derobj == 120) || (s.derobj == 140)) {
 					s.ipuit = s.derobj;
 					aniof(1, 1);
-				} else crep = 185;
+				} else
+					crep = 185;
 				maivid();
 			}
 		}
@@ -670,27 +791,32 @@ void tfermer() {
 		ecr3(g_vm->getString(S_CLOSE));
 	if (caff < 26) {
 		tfleche();
-		if (iesc)  crep = 998;
-		if ((anyone) || (iesc))  return;
+		if (iesc)
+			crep = 998;
+		if ((anyone) || (iesc))
+			return;
 		tcoord(7);
 		if (num != 0) {
 			cx = 0;
 			do {
-				cx = cx + 1;
+				++cx;
 			} while (!((cx > 6) || (num == ord(touv[cx]))));
 			if (num == ord(touv[cx])) {
 				aniof(2, num);
 				crep = 998;
 				touv[cx] = chr(0);
 				iouv = iouv - 1;
-				if (iouv < 0)  iouv = 0;
+				if (iouv < 0)
+					iouv = 0;
 				chai = 9999;
 				rechai(chai);
-				if (mchai == chai)  mchai = 0;
+				if (mchai == chai)
+					mchai = 0;
 			} else crep = 187;
 		}
 	}
-	if (caff == 26)  crep = 999;
+	if (caff == 26)
+		crep = 999;
 }
 
 void tfrapper() {
@@ -705,8 +831,10 @@ void tfrapper() {
 	if (s.mlieu < 25) {
 		tfleche();
 		if (!(anyone) && !(iesc))
-			if ((s.mlieu < 19) && (s.mlieu != 15))  crep = 133;
-			else crep = 997;
+			if ((s.mlieu < 19) && (s.mlieu != 15))
+				crep = 133;
+			else
+				crep = 997;
 		return;
 	}
 	if (s.mlieu == 26) {
@@ -716,13 +844,16 @@ void tfrapper() {
 		l = ment;
 		if (l != 0)
 			if (p != -500) {
-				if (haz > p)  crep = 190;
+				if (haz > p)
+					crep = 190;
 				else {
 					becfren(l);
 					frap();
 				}
-			} else frap();
-		if (ment == 8)  crep = 190;
+			} else
+				frap();
+		if (ment == 8)
+			crep = 190;
 	}
 }
 
@@ -731,27 +862,32 @@ void tposer() {
 
 	if (!syn)
 		ecr3(g_vm->getString(S_POSE));
-	if (s.derobj == 0)  crep = 186;
+	if (s.derobj == 0)
+		crep = 186;
 	else {
 		if (caff > 99) {
 			crep = 999;
 			ajchai();
-			if (crep != 192)  maivid();
+			if (crep != 192)
+				maivid();
 			return;
 		}
 		tfleche();
-		if ((anyone) || (iesc))  return;
+		if ((anyone) || (iesc))
+			return;
 		tcoord(7);
 		crep = 124;
 		if (num != 0) {
 			rechai(chai);
-			if (chai == 0)  crep = 997;
+			if (chai == 0)
+				crep = 997;
 			else {
 				cx = 0;
 				do {
-					cx = cx + 1;
+					++cx;
 				} while (!((cx > 6) || (num == ord(touv[cx]))));
-				if (num != ord(touv[cx]))  crep = 187;
+				if (num != ord(touv[cx]))
+					crep = 187;
 				else {
 					mchai = chai;
 					crep = 999;
@@ -762,32 +898,46 @@ void tposer() {
 			if (num != 0) {
 				crep = 998;
 				if (caff == 2)
-					if (s.iloic != 0)  crep = 188;
-					else s.iloic = s.derobj;
+					if (s.iloic != 0)
+						crep = 188;
+					else
+						s.iloic = s.derobj;
 				if (caff == 13) {
 					if (num == 1) {
-						if (s.iboul != 0)  crep = 188;
-						else s.iboul = s.derobj;
-					} else if (s.ibag != 0)  crep = 188;
-					else s.ibag = s.derobj;
+						if (s.iboul != 0)
+							crep = 188;
+						else
+							s.iboul = s.derobj;
+					} else if (s.ibag != 0)
+						crep = 188;
+					else
+						s.ibag = s.derobj;
 				}
 				if (caff == 16)
-					if (s.icryp != 0)  crep = 188;
-					else s.icryp = s.derobj;
-				if (caff == 24)  crep = 185;
-				if ((caff == 14) || (caff == 17))  crep = 124;
+					if (s.icryp != 0)
+						crep = 188;
+					else
+						s.icryp = s.derobj;
+				if (caff == 24)
+					crep = 185;
+				if ((caff == 14) || (caff == 17))
+					crep = 124;
 			} else {
 				crep = 124;
 				if (caff == 24) {
 					tcoord(5);
-					if (num != 0)  crep = 185;
+					if (num != 0)
+						crep = 185;
 				}
 			}
 		}
-		if (caff == 23)  crep = 185;
+		if (caff == 23)
+			crep = 185;
 		if ((crep == 999) || (crep == 185) || (crep == 998)) {
-			if (crep == 999)  ajchai();
-			if (crep != 192)  maivid();
+			if (crep == 999)
+				ajchai();
+			if (crep != 192)
+				maivid();
 		}
 	}
 }
@@ -795,25 +945,34 @@ void tposer() {
 void tecouter() {
 	int l, p, haz, j, h, m;
 
-	if (s.mlieu != 26)  crep = 101;
+	if (s.mlieu != 26)
+		crep = 101;
 	else {
-		if (ipers != 0)  s.conf = s.conf + 1;
+		if (ipers != 0)
+			++s.conf;
 		ecfren(p, haz, s.conf, ment);
 		l = ment;
-		if (l != 0)
+		if (l != 0) {
 			if (p != -500) {
-				if (haz > p)  crep = 101;
+				if (haz > p)
+					crep = 101;
 				else {
 					becfren(l);
 					calch(j, h, m);
 					haz = hazard(1, 100);
 					if ((h >= 0) && (h < 8)) {
-						if (haz > 30)  crep = 101;
-						else crep = 178;
-					} else if (haz > 70)  crep = 101;
-					else crep = 178;
+						if (haz > 30)
+							crep = 101;
+						else
+							crep = 178;
+					} else if (haz > 70)
+						crep = 101;
+					else
+						crep = 178;
 				}
-			} else crep = 178;
+			} else
+				crep = 178;
+		}
 	}
 }
 
@@ -832,15 +991,20 @@ void tmanger() {
 		if ((h == 12) || (h == 13) || (h == 19)) {
 			s.conf = s.conf - (s.conf / 7);
 			if (h == 12)
-				if (m == 0)  h = 4;
-				else h = 3;
+				if (m == 0)
+					h = 4;
+				else
+					h = 3;
 			if ((h == 13) || (h == 19))
-				if (m == 0)  h = 2;
-				else h = 1;
-			jh = jh + h;
+				if (m == 0)
+					h = 2;
+				else
+					h = 1;
+			jh += h;
 			crep = 135;
 			tinke();
-		} else crep = 134;
+		} else
+			crep = 134;
 	}
 }
 
@@ -850,49 +1014,52 @@ void tentrer() {
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
 		t1sama();
 		tmlieu(s.mlieu);
-	} else if (s.mlieu == 15)  aldepl();
-	else if (ment == 0)  crep = 997;
-	else {
-		if ((ment == 9) && (s.derobj != 136)) {
+	} else if (s.mlieu == 15)
+		aldepl();
+	else if (ment == 0)
+		crep = 997;
+	else if ((ment == 9) && (s.derobj != 136)) {
 			crep = 189;
 			s.teauto[8] = '*';
-		} else {
-			if (! blo)  t11(ment, z);
-			if (z != 0) {
-				if ((ment == 3) || (ment == 7))  crep = 179;
-				else {
-					x = (hazard(0, 10)) - 5;
-					parole(7, x, 1);
-					aniof(1, 1);
-					
-					tip(z, x);
-					s.conf = s.conf + 1;
-					s.mlieu = 15;
-					msg[3] = discut;
-					msg[4] = g_vm->_menu._disc[x];
-					syn = true;
-					if (ment == 9) {
-						col = true;
-						caff = 70;
-						afdes(0);
-						repon(2, caff);
-					} else col = false;
-					debloc(ment);
-					ment = 0;
-				}
-			} else {
+	} else {
+		if (! blo)
+			t11(ment, z);
+		if (z != 0) {
+			if ((ment == 3) || (ment == 7))
+				crep = 179;
+			else {
 				x = (hazard(0, 10)) - 5;
 				parole(7, x, 1);
 				aniof(1, 1);
 				
-				s.mlieu = ment;
-				affrep();
-				debloc(s.mlieu);
-				tmlieu(s.mlieu);
+				tip(z, x);
+				++s.conf;
+				s.mlieu = 15;
+				msg[3] = discut;
+				msg[4] = g_vm->_menu._disc[x];
+				syn = true;
+				if (ment == 9) {
+					col = true;
+					caff = 70;
+					afdes(0);
+					repon(2, caff);
+				} else
+					col = false;
+				debloc(ment);
 				ment = 0;
-				mpers = 0;
-				ipers = 0;
 			}
+		} else {
+			x = (hazard(0, 10)) - 5;
+			parole(7, x, 1);
+			aniof(1, 1);
+			
+			s.mlieu = ment;
+			affrep();
+			debloc(s.mlieu);
+			tmlieu(s.mlieu);
+			ment = 0;
+			mpers = 0;
+			ipers = 0;
 		}
 	}
 }
@@ -921,13 +1088,15 @@ void tdormir() {
 		if (h < 8) {
 			s.conf = s.conf - (s.conf / 20);
 			z = (7 - h) * 2;
-			if (m == 30)  z = z - 1;
-			jh = jh + z;
+			if (m == 30)
+				--z;
+			jh += z;
 			h = 7;
 		}
-		jh = jh + 2;
-		h = h + 1;
-		if (h > 23)  h = 0;
+		jh += 2;
+		++h;
+		if (h > 23)
+			h = 0;
 		tinke();
 		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 		anyone = false;
@@ -939,12 +1108,14 @@ void tdormir() {
 void tdefoncer() {
 	if (!syn)
 		ecr3(g_vm->getString(S_SMASH));
-	if (caff < 25)  tfleche();
+	if (caff < 25)
+		tfleche();
 	if ((! anyone) && (! iesc))
-		if (s.mlieu != 26)  crep = 997;
+		if (s.mlieu != 26)
+			crep = 997;
 		else {
 			crep = 143;
-			s.conf = s.conf + 2;
+			s.conf += 2;
 		}
 }
 
@@ -953,21 +1124,28 @@ void tsortir() {
 
 	tsort();
 	crep = 0;
-	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)
-	        || (s.mlieu == 24))  crep = 997;
+	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22) || (s.mlieu == 24))
+		crep = 997;
 	else {
-		if ((s.mlieu < 16) || (s.mlieu == 26))  lx = 10;
-		if ((s.mlieu == 10) || (s.mlieu == 20))  lx = 21;
-		if ((s.mlieu < 10) || (s.mlieu == 13))  lx = 15;
+		if ((s.mlieu < 16) || (s.mlieu == 26))
+			lx = 10;
+		if ((s.mlieu == 10) || (s.mlieu == 20))
+			lx = 21;
+		if ((s.mlieu < 10) || (s.mlieu == 13))
+			lx = 15;
 		if (s.mlieu == 16) {
 			lx = 17;
 			crep = 176;
 		}
-		if (s.mlieu == 17)  t23coul(lx);
-		if (s.mlieu == 23)  lx = 24;
-		if (crep != 997)  s.mlieu = lx;
+		if (s.mlieu == 17)
+			t23coul(lx);
+		if (s.mlieu == 23)
+			lx = 24;
+		if (crep != 997)
+			s.mlieu = lx;
 		caff = lx;
-		if (crep == 0)  crep = lx;
+		if (crep == 0)
+			crep = lx;
 		debloc(lx);
 		tmlieu(lx);
 	}
@@ -979,22 +1157,27 @@ void tattendre() {
 	mpers = 0;
 	clsf3();
 	do {
-		jh = jh + 1;
+		++jh;
 		tinke();
-		if (! blo)  t11(s.mlieu, quel);
+		if (!blo)
+			t11(s.mlieu, quel);
 		if ((ipers != 0) && (mpers == 0)) {
 			crep = 998;
-			if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
-			if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+			if ((s.mlieu == 13) || (s.mlieu == 14))
+				cavegre();
+			if ((s.mlieu > 0) && (s.mlieu < 10))
+				anyone = true;
 			mpers = ipers;
-			if (! anyone)  tinke();
+			if (!anyone)
+				tinke();
 			return;
 		}
 		repon(2, 102);
 		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
 	} while (!(quel == 2));
 	crep = 998;
-	if (! anyone)  tinke();
+	if (!anyone)
+		tinke();
 }
 
 void tsonder() {
@@ -1002,14 +1185,13 @@ void tsonder() {
 		ecr3(g_vm->getString(S_PROBE2));
 	if (caff < 27) {
 		tfleche();
-		if (!(anyone) && (! iesc))  crep = 145;
+		if (!(anyone) && (!iesc))
+			crep = 145;
 		num = 0;
 	}
 }
 
-void tparler()
-
-{
+void tparler() {
 	bool te[47];
 	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
@@ -1018,14 +1200,13 @@ void tparler()
 	char st[1410];
 	bool f;
 
-
-
 	finfouil();
-	if (col)  suj = 128;
+	if (col)
+		suj = 128;
 	else {
 		cx = 0;
 		do {
-			cx = cx + 1;
+			++cx;
 		} while (!(g_vm->_menu._disc[cx] == msg[4]));
 		caff = 69 + cx;
 		afdes(0);
@@ -1039,11 +1220,13 @@ void tparler()
 	premtet();
 	sparl(0, suj);
 	hirs();
-	for (ix = 1; ix <= 46; ix ++) te[ix] = false;
-	for (ix = 1; ix <= 45; ix ++) {
+	for (ix = 1; ix <= 46; ++ix)
+		te[ix] = false;
+	for (ix = 1; ix <= 45; ++ix) {
 		deline(ix + c_tparler, st, tay);
 		lib[ix] = delig;
-		for (i = tay; i <= 40; i ++) lib[ix] = lib[ix] + ' ';
+		for (i = tay; i <= 40; ++i)
+			lib[ix] = lib[ix] + ' ';
 	}
 	lib[46] = lib[45];
 	lib[45] = ' ';
@@ -1057,12 +1240,15 @@ void tparler()
 			icm = succ(int, icm);
 			g_vm->_screenSurface.putxy(co, lig);
 			if (s.teauto[icm] == '*')
-				if (te[icm])  writetp(lib[icm], 1);
-				else writetp(lib[icm], 0);
+				if (te[icm])
+					writetp(lib[icm], 1);
+				else
+					writetp(lib[icm], 0);
 			if (icm == 23)  {
 				lig = 0;
 				co = 320;
-			} else lig = lig + 8;
+			} else
+				lig = lig + 8;
 		} while (!(icm == 42));
 		g_vm->_screenSurface.putxy(320, 176);
 		writetp(lib[46], 0);
@@ -1073,43 +1259,59 @@ void tparler()
 
 			getMousePos(x, y, c);
 			x = x * (3 - res);
-			if (x > 319)  cx = 41;
-			else cx = 1;
+			if (x > 319)
+				cx = 41;
+			else
+				cx = 1;
 			cy = succ(int, ((uint)y >> 3));                  /* 0-199 => 1-25 */
 			if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
-					if (choi > 23)  co = 320;
-					else co = 0;
+					if (choi > 23)
+						co = 320;
+					else
+						co = 0;
 					g_vm->_screenSurface.putxy(co, lig);
-					if (te[choi])  writetp(lib[choi], 0);
-					else writetp(lib[choi], 1);
-					te[choi] = ! te[choi];
+					if (te[choi])
+						writetp(lib[choi], 0);
+					else
+						writetp(lib[choi], 1);
+					te[choi] = !te[choi];
 					choi = 0;
 				}
 			} else {
 				ix = cy;
-				if (cx == 41)  ix = ix + 23;
+				if (cx == 41)
+					ix = ix + 23;
 				if (ix != choi) {
 					if (choi != 0) {
 						lig = ((choi - 1) % 23) << 3;
-						if (choi > 23)  co = 320;
-						else co = 0;
+						if (choi > 23)
+							co = 320;
+						else
+							co = 0;
 						g_vm->_screenSurface.putxy(co, lig);
-						if (te[choi])  writetp(lib[choi], 0);
-						else writetp(lib[choi], 1);
+						if (te[choi])
+							writetp(lib[choi], 0);
+						else
+							writetp(lib[choi], 1);
 						te[choi] = ! te[choi];
 					}
 					if ((s.teauto[ix] == '*') || (ix == 46)) {
 						lig = ((ix - 1) % 23) << 3;
-						if (ix > 23)  co = 320;
-						else co = 0;
+						if (ix > 23)
+							co = 320;
+						else
+							co = 0;
 						g_vm->_screenSurface.putxy(co, lig);
-						if (te[ix])  writetp(lib[ix], 0);
-						else writetp(lib[ix], 1);
+						if (te[ix])
+							writetp(lib[ix], 0);
+						else
+							writetp(lib[ix], 1);
 						te[ix] = ! te[ix];
 						choi = ix;
-					} else choi = 0;
+					} else
+						choi = 0;
 				}
 			}
 		} while (!((tou == '\15') || (((c != 0) || g_vm->getMouseClick()) && (choi != 0))));
@@ -1119,10 +1321,13 @@ void tparler()
 			if (col) {
 				col = false;
 				s.mlieu = 15;
-				if (iouv > 0)  max = 8;
-				else max = 4;
+				if (iouv > 0)
+					max = 8;
+				else
+					max = 4;
 				haz = hazard(1, max);
-				if (haz == 2)  suj = 129;
+				if (haz == 2)
+					suj = 129;
 				else {
 					suj = 138;
 					s.conf = s.conf + (3 * (s.conf / 10));
@@ -1145,7 +1350,8 @@ void tparler()
 				s.teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
-				for (ix = 29; ix <= 31; ix ++) s.teauto[ix] = '*';
+				for (ix = 29; ix <= 31; ++ix)
+					s.teauto[ix] = '*';
 				s.pourc[7] = '*';
 			}
 			if (suj == 70) {
@@ -1188,8 +1394,10 @@ void tsentir() {
 			ecr3(g_vm->getString(S_SMELL));
 		tfleche();
 		if (!(anyone) && !(iesc))
-			if (caff == 16)  crep = 153;
-	} else if (caff == 123)  crep = 110;
+			if (caff == 16)
+				crep = 153;
+	} else if (caff == 123)
+		crep = 110;
 	num = 0;
 }
 


Commit: efafc08884d740b381425453b849f648a55a2528
    https://github.com/scummvm/scummvm/commit/efafc08884d740b381425453b849f648a55a2528
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:36-07:00

Commit Message:
MORTEVIELLE: rename verbs and associated opcodes, use enum for opcodes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/actions.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5aa91f8..caaeb07 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,7 +42,11 @@
 namespace Mortevielle {
 
 
-void taller() {
+/**
+ * Engine function - Move
+ * @remarks	Originally called 'taller'
+ */
+void fctMove() {
 	//int mx, cx, cy;
 	int cx;
 
@@ -171,7 +175,11 @@ L2:
 	tmlieu(s.mlieu);
 }
 
-void tprendre() {
+/**
+ * Engine function - Take
+ * @remarks	Originally called 'tprendre'
+ */
+void fctTake() {
 	//int cx, cy, cz;
 	int cx;
 
@@ -305,7 +313,11 @@ void tsprendre() {
 	clsf2();
 }
 
-void tsoulever() {
+/**
+ * Engine function - Lift
+ * @remarks	Originally called 'tsoulever'
+ */
+void fctLift() {
 	int cx;
 
 	if (!syn)
@@ -337,7 +349,11 @@ void tsoulever() {
 		crep = 997;
 }
 
-void tlire() {
+/**
+ * Engine function - Read
+ * @remarks	Originally called 'tlire'
+ */
+void fctRead() {
 //	int iaff;
 
 	if (caff > 99)
@@ -361,7 +377,11 @@ void tslire() {
 		st4(s.derobj);
 }
 
-void tregarder() {
+/**
+ * Engine function - Look
+ * @remarks	Originally called 'tregarder'
+ */
+void fctLook() {
 	int cx;
 
 	if (caff > 99) {
@@ -442,7 +462,11 @@ void tsregarder() {
 		crep = 186;
 }
 
-void tfouiller() {
+/**
+ * Engine function - Search
+ * @remarks	Originally called 'tfouiller'
+ */
+void fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 	int cx;
 
@@ -531,14 +555,18 @@ void tsfouiller() {
 		crep = 186;
 }
 
-void touvrir() {
+/**
+ * Engine function - Open
+ * @remarks	Originally called 'touvrir'
+ */
+void fctOpen() {
 	int cx, haz;
 
 	if (!syn)
 		ecr3(g_vm->getString(S_OPEN));
 	if (caff == 26) {
 		if (ment != 0) {
-			msg[4] = entrer;
+			msg[4] = OPCODE_ENTER;
 			syn = true;
 		} else
 			crep = 997;
@@ -588,7 +616,11 @@ void touvrir() {
 	}
 }
 
-void tmettre() {
+/**
+ * Engine function - Place
+ * @remarks	Originally called 'tmettre'
+ */
+void fctPlace() {
 	int quel;
 	bool entre;
 	char st[1410];
@@ -708,7 +740,11 @@ void tmettre() {
 	}
 }
 
-void ttourner() {
+/**
+ * Engine function - Turn
+ * @remarks	Originally called 'ttourner'
+ */
+void fctTurn() {
 	int quel;
 
 	if (caff > 99) {
@@ -746,7 +782,11 @@ void ttourner() {
 	}
 }
 
-void tcacher() {
+/**
+ * Engine function - Hide Self
+ * @remarks	Originally called 'tcacher'
+ */
+void fctHideSelf() {
 	if (!syn)
 		ecr3(g_vm->getString(S_HIDE_SELF));
 	tfleche();
@@ -761,7 +801,11 @@ void tcacher() {
 	}
 }
 
-void tattacher() {
+/**
+ * Engine function - Attach
+ * @remarks	Originally called 'tattacher'
+ */
+void fctAttach() {
 	if (s.derobj == 0)
 		crep = 186;
 	else {
@@ -784,7 +828,11 @@ void tattacher() {
 	}
 }
 
-void tfermer() {
+/**
+ * Engine function - Close
+ * @remarks	Originally called 'tfermer'
+ */
+void fctClose() {
 	int cx, chai;
 
 	if (!syn)
@@ -819,7 +867,11 @@ void tfermer() {
 		crep = 999;
 }
 
-void tfrapper() {
+/**
+ * Engine function - Knock
+ * @remarks	Originally called 'tfrapper'
+ */
+void fctKnock() {
 	int l, p, haz;
 
 	if (!syn)
@@ -942,7 +994,11 @@ void tposer() {
 	}
 }
 
-void tecouter() {
+/**
+ * Engine function - Listen
+ * @remarks	Originally called 'tecouter'
+ */
+void fctListen() {
 	int l, p, haz, j, h, m;
 
 	if (s.mlieu != 26)
@@ -976,7 +1032,11 @@ void tecouter() {
 	}
 }
 
-void tmanger() {
+/**
+ * Engine function - Eat
+ * @remarks	Originally called 'tmanger'
+ */
+void fctEat() {
 	int j, h, m;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26))
@@ -1008,7 +1068,11 @@ void tmanger() {
 	}
 }
 
-void tentrer() {
+/**
+ * Engine function - Enter
+ * @remarks	Originally called 'tentrer'
+ */
+void fctEnter() {
 	int x, z = 0;
 
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
@@ -1064,7 +1128,11 @@ void tentrer() {
 	}
 }
 
-void tdormir() {
+/**
+ * Engine function - Sleep
+ * @remarks	Originally called 'tdormir'
+ */
+void fctSleep() {
 	int z, j, h, m, quel;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
@@ -1105,7 +1173,11 @@ void tdormir() {
 	num = 0;
 }
 
-void tdefoncer() {
+/**
+ * Engine function - Force
+ * @remarks	Originally called 'tdefoncer'
+ */
+void fctForce() {
 	if (!syn)
 		ecr3(g_vm->getString(S_SMASH));
 	if (caff < 25)
@@ -1119,7 +1191,11 @@ void tdefoncer() {
 		}
 }
 
-void tsortir() {
+/**
+ * Engine function - Leave
+ * @remarks	Originally called 'tsortir'
+ */
+void fctLeave() {
 	int lx = 0;
 
 	tsort();
@@ -1151,7 +1227,11 @@ void tsortir() {
 	}
 }
 
-void tattendre() {
+/**
+ * Engine function - Wait
+ * @remarks	Originally called 'tattendre'
+ */
+void fctWait() {
 	int quel;
 
 	mpers = 0;
@@ -1180,7 +1260,11 @@ void tattendre() {
 		tinke();
 }
 
-void tsonder() {
+/**
+ * Engine function - Sound
+ * @remarks	Originally called 'tsonder'
+ */
+void fctSound() {
 	if (!syn)
 		ecr3(g_vm->getString(S_PROBE2));
 	if (caff < 27) {
@@ -1387,7 +1471,11 @@ void tparler() {
 	clsf3();
 }
 
-void tsentir() {
+/**
+ * Engine function - Smell
+ * @remarks	Originally called 'tsentir'
+ */
+void fctSmell() {
 	crep = 119;
 	if (caff < 26) {
 		if (!syn)
@@ -1401,7 +1489,11 @@ void tsentir() {
 	num = 0;
 }
 
-void tgratter() {
+/**
+ * Engine function - Scratch
+ * @remarks	Originally called 'tgratter'
+ */
+void fctScratch() {
 	crep = 155;
 	if (caff < 27) {
 		if (!syn)
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index 196e5a5..d96b712 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -31,35 +31,35 @@
 namespace Mortevielle {
 
 /* NIVEAU 4 */
-extern void taller();
-extern void tprendre();
+extern void fctMove();
+extern void fctTake();
 extern void tsprendre();
-extern void tsoulever();
-extern void tlire();
+extern void fctLift();
+extern void fctRead();
 extern void tslire();
-extern void tregarder();
+extern void fctLook();
 extern void tsregarder();
-extern void tfouiller();
+extern void fctSearch();
 extern void tsfouiller();
-extern void touvrir();
-extern void tmettre();
-extern void ttourner();
-extern void tcacher();
-extern void tattacher();
-extern void tfermer();
-extern void tfrapper();
+extern void fctOpen();
+extern void fctPlace();
+extern void fctTurn();
+extern void fctHideSelf();
+extern void fctAttach();
+extern void fctClose();
+extern void fctKnock();
 extern void tposer();
-extern void tecouter();
-extern void tmanger();
-extern void tentrer();
-extern void tdormir();
-extern void tdefoncer();
-extern void tsortir();
-extern void tattendre();
-extern void tsonder();
+extern void fctListen();
+extern void fctEat();
+extern void fctEnter();
+extern void fctSleep();
+extern void fctForce();
+extern void fctLeave();
+extern void fctWait();
+extern void fctSound();
 extern void tparler();
-extern void tsentir();
-extern void tgratter();
+extern void fctSmell();
+extern void fctScratch();
 /* NIVEAU 2 */
 extern void endGame();
 extern void loseGame();
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 7da2eef..51fad3f 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -63,7 +63,7 @@ void Menu::menut(int no, Common::String nom) {
 			_inv[l].insertChar(' ', 0);
 		}
 		break;
-	case depla:
+	case MENU_MOVE:
 		_dep[l] = s;
 		break;
 	case action:
@@ -96,7 +96,7 @@ void Menu::disableMenuItem(int no) {
 			_inv[l].setChar('*', 0);
 	}
 	break;
-	case depla:
+	case MENU_MOVE:
 		_dep[l].setChar('*', 0);
 		break;
 	case action:
@@ -126,7 +126,7 @@ void Menu::enableMenuItem(int no) {
 		_inv[l].setChar(' ', 21);
 	}
 	break;
-	case depla:
+	case MENU_MOVE:
 		_dep[l].setChar(' ', 0);
 		break;
 	case action:
@@ -189,8 +189,8 @@ void Menu::menu_aff() {
 void Menu::drawMenu() {
 	menu_aff();
 	_menuActive = true;
-	msg4 = no_choice;
-	msg3 = no_choice;
+	msg4 = OPCODE_NONE;
+	msg3 = OPCODE_NONE;
 	choisi = false;
 	g_vm->setMouseClick(false);
 	test0 = false;
@@ -199,7 +199,7 @@ void Menu::drawMenu() {
 void Menu::invers(int ix) {
 	Common::String s;
 
-	if (msg4 == no_choice)  return;
+	if (msg4 == OPCODE_NONE)  return;
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
 	case 1 :
@@ -238,7 +238,7 @@ void Menu::invers(int ix) {
 	if ((s[0] != '*') && (s[0] != '<'))
 		g_vm->_screenSurface.writeg(s, ix);
 	else
-		msg4 = no_choice;
+		msg4 = OPCODE_NONE;
 }
 
 void Menu::util(int x, int y) {
@@ -258,9 +258,9 @@ void Menu::util(int x, int y) {
 			msg4 = ix;
 			invers(0);
 		}
-	} else if (msg4 != no_choice) {
+	} else if (msg4 != OPCODE_NONE) {
 		invers(1);
-		msg4 = no_choice;
+		msg4 = OPCODE_NONE;
 	}
 }
 
@@ -401,7 +401,7 @@ void Menu::mdn() {
 		                   || ((x > 268 * res) && (x < 268 * res + 24)));
 		if (tes) {
 			if (x < 76 * res)  ix = invent;
-			else if (x < 124 * res)  ix = depla;
+			else if (x < 124 * res)  ix = MENU_MOVE;
 			else if (x < 172 * res)  ix = action;
 			else if (x < 220 * res)  ix = saction;
 			else if (x < 268 * res)  ix = discut;
@@ -411,13 +411,13 @@ void Menu::mdn() {
 					menuUp(msg3);
 					menuDown(ix);
 					msg3 = ix;
-					msg4 = no_choice;
+					msg4 = OPCODE_NONE;
 				}
 		} else { /* Not in the MenuTitle line */
 			if ((y > 11) && (test0))  util(x, y);
 		}
 	} else {       /* There was a click */
-		if ((msg3 == fichier) && (msg4 != no_choice)) {
+		if ((msg3 == fichier) && (msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
 			menuUp(msg3);
@@ -428,12 +428,12 @@ void Menu::mdn() {
 			g_vm->setMouseClick(false);
 		} else { 
 			//  A menu was clicked on
-			choisi = (test0) && (msg4 != no_choice);
+			choisi = (test0) && (msg4 != OPCODE_NONE);
 			menuUp(msg3);
 			msg[4] = msg4;
 			msg[3] = msg3;
-			msg3 = no_choice;
-			msg4 = no_choice;
+			msg3 = OPCODE_NONE;
+			msg4 = OPCODE_NONE;
 
 			g_vm->setMouseClick(false);
 		}
@@ -486,10 +486,10 @@ void Menu::initMenu() {
 		if (i > 6)
 			g_vm->_menu.disableMenuItem(_invt[i]);
 	}
-	msg3 = no_choice;
-	msg4 = no_choice;
-	msg[3] = no_choice;
-	msg[4] = no_choice;
+	msg3 = OPCODE_NONE;
+	msg4 = OPCODE_NONE;
+	msg[3] = OPCODE_NONE;
+	msg[4] = OPCODE_NONE;
 	g_vm->setMouseClick(false);
 }
 
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 8779d51..d4aecbc 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -60,7 +60,7 @@ public:
 };
 
 enum {
-	invent = 1, depla = 2, action = 3, saction = 4,
+	invent = 1, MENU_MOVE = 2, action = 3, saction = 4,
 	discut = 5, fichier = 6, sauve = 7, charge = 8
 };
 
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 7a49456..15d413d 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -39,10 +39,10 @@
 
 namespace Mortevielle {
 
-const int men[12] = { 0,
-		scacher, attacher, defoncer, dormir, 
-		entrer,  fermer,   frapper,  manger,
-		mettre,  ouvrir,   sortir
+const int men[12] = { OPCODE_NONE,
+		OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER,     OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE,     OPCODE_OPEN,   OPCODE_LEAVE
 };
 
 void tinke() {
@@ -251,7 +251,7 @@ void tlu(int af, int ob) {
 	repon(2, 999);
 	tkey1(true);
 	caff = af;
-	msg[3] = no_choice;
+	msg[3] = OPCODE_NONE;
 	crep = 998;
 }
 
@@ -276,8 +276,8 @@ void mfouen()
 	for (cx = 1; cx <= 11; cx ++)
 		g_vm->_menu.enableMenuItem(men[cx]);
 
-	g_vm->_menu.menut(sonder, g_vm->getString(S_PROBE));
-	g_vm->_menu.menut(soulever, g_vm->getString(S_RAISE));
+	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_PROBE));
+	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getString(S_RAISE));
 }
 
 /* NIVEAU 6 */
@@ -415,8 +415,8 @@ void mfoudi() {
 	for (cx = 1; cx <= 11; cx ++)
 		g_vm->_menu.disableMenuItem(men[cx]);
 
-	g_vm->_menu.menut(sonder, g_vm->getString(S_SUITE));
-	g_vm->_menu.menut(soulever, g_vm->getString(S_STOP));
+	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_SUITE));
+	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getString(S_STOP));
 }
 
 void mennor() {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 256b855..82eb117 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -571,7 +571,7 @@ void MortevielleEngine::handleAction() {
 			temps = Alert::show(stpou, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((mnumo != no_choice) && ((msg[3] == action) || (msg[3] == saction))) {
+			if ((mnumo != OPCODE_NONE) && ((msg[3] == action) || (msg[3] == saction))) {
 				msg[4] = mnumo;
 				ecr3(g_vm->getString(S_IDEM));
 			} else return;
@@ -594,9 +594,9 @@ void MortevielleEngine::handleAction() {
 			if (! anyone) {
 				if ((fouil) || (obpart)) {
 					if (y_s < 12)  return;
-					if ((msg[4] == sonder) || (msg[4] == soulever)) {
+					if ((msg[4] == OPCODE_SOUND) || (msg[4] == OPCODE_LIFT)) {
 						oo = true;
-						if ((msg[4] == soulever) || (obpart)) {
+						if ((msg[4] == OPCODE_LIFT) || (obpart)) {
 							finfouil();
 							caff = s.mlieu;
 							crep = 998;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 737ec66..2ee26a9 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -157,37 +157,58 @@ void tsitu()
 	iesc = false;
 	if (anyone)  goto L1;
 	if (brt)
-		if ((msg[3] == depla) || (msg[4] == sortir) || (msg[4] == dormir) ||
-		        (msg[4] == manger)) {
+		if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
 			ctrm = 4;
 			goto L2;
 		}
-	if (msg[3] == depla)       taller();    //Translation: go to
+	if (msg[3] == MENU_MOVE)
+		fctMove();
 	if (msg[3] == discut)      tparler();   //Translation: talk
 	if (msg[3] == invent)      tsprendre(); //Translation: inventory/take
-	if (msg[4] == attacher)    tattacher(); //Translation: tie
-	if (msg[4] == attendre)    tattendre(); //Translation: wait
-	if (msg[4] == defoncer)    tdefoncer(); //Translation: smash
-	if (msg[4] == dormir)      tdormir();   //Translation: sleep
-	if (msg[4] == ecouter)     tecouter();  //Translation: listen
-	if (msg[4] == entrer)      tentrer();   //Translation: enter
-	if (msg[4] == fermer)      tfermer();   //Translation: close
-	if (msg[4] == fouiller)    tfouiller(); //Translation: search
-	if (msg[4] == frapper)     tfrapper();  //Translation: hit
-	if (msg[4] == gratter)     tgratter();  //Translation: scratch
-	if (msg[4] == lire)        tlire();     //Translation: read
-	if (msg[4] == manger)      tmanger();   //Translation: eat
-	if (msg[4] == mettre)      tmettre();   //Translation: put
-	if (msg[4] == ouvrir)      touvrir();   //Translation: open
-	if (msg[4] == prendre)     tprendre();  //Translation: take
-	if (msg[4] == regarder)    tregarder(); //Translation: look
-	if (msg[4] == sentir)      tsentir();   //Translation: smell
-	if (msg[4] == sonder)      tsonder();   //Translation: probe
-	if (msg[4] == sortir)      tsortir();   //Translation: exit
-	if (msg[4] == soulever)    tsoulever(); //Translation: lift
-	if (msg[4] == tourner)     ttourner();  //Translation: turn
-	if (msg[4] == scacher) {                //Translation: hide
-		tcacher();
+	if (msg[4] == OPCODE_ATTACH)
+		fctAttach();
+	if (msg[4] == OPCODE_WAIT)
+		fctWait();
+	if (msg[4] == OPCODE_FORCE)
+		fctForce();
+	if (msg[4] == OPCODE_SLEEP)
+		fctSleep();
+	if (msg[4] == OPCODE_LISTEN)
+		fctListen();
+	if (msg[4] == OPCODE_ENTER)
+		fctEnter();
+	if (msg[4] == OPCODE_CLOSE)
+		fctClose();
+	if (msg[4] == OPCODE_SEARCH)
+		fctSearch();
+	if (msg[4] == OPCODE_KNOCK)
+		fctKnock();
+	if (msg[4] == OPCODE_SCRATCH)
+		fctScratch();
+	if (msg[4] == OPCODE_READ)
+		fctRead();
+	if (msg[4] == OPCODE_EAT)
+		fctEat();
+	if (msg[4] == OPCODE_PLACE)
+		fctPlace();
+	if (msg[4] == OPCODE_OPEN)
+		fctOpen();
+	if (msg[4] == OPCODE_TAKE)
+		fctTake();
+	if (msg[4] == OPCODE_LOOK)
+		fctLook();
+	if (msg[4] == OPCODE_SMELL)
+		fctSmell();
+	if (msg[4] == OPCODE_SOUND)
+		fctSound();
+	if (msg[4] == OPCODE_LEAVE)
+		fctLeave();
+	if (msg[4] == OPCODE_LIFT)
+		fctLift();
+	if (msg[4] == OPCODE_TURN)
+		fctTurn();
+	if (msg[4] == OPCODE_HIDE_SELF) {                //Translation: hide
+		fctHideSelf();
 		goto L1;
 	}
 	if (msg[4] == sfouiller)   tsfouiller();//Translation: search 
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 9402f3f..08aaa2a 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -244,7 +244,7 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	showMouse();
-	if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != entrer)) {
+	if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
 		else if (! blo)
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index bfccd66..7a3249d 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -128,31 +128,16 @@ const int arep = 1314;
 const int amzon = 1650;
 const int fleche = 1758;
 
-const int no_choice = 0;
-
-const int attacher = 0x301;
-const int attendre = 0x302;
-const int defoncer = 0x303;
-const int dormir = 0x304;
-const int ecouter = 0x305;
-const int entrer = 0x306;
-const int fermer = 0x307;
-const int fouiller = 0x308;
-const int frapper = 0x309;
-const int gratter = 0x30a;
-const int lire = 0x30b;
-const int manger = 0x30c;
-const int mettre = 0x30d;
-const int ouvrir = 0x30e;
-const int prendre = 0x30f;
-const int regarder = 0x310;
-const int sentir = 0x311;
-const int sonder = 0x312;
-const int sortir = 0x313;
-const int soulever = 0x314;
-const int tourner = 0x315;
-
-const int scacher = 0x401;
+const int OPCODE_NONE = 0;
+
+enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,  OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
+            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308, OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
+			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,  OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
+			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,  OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
+			OPCODE_TURN = 0x315};
+
+enum verbs2 {OPCODE_HIDE_SELF = 0x401};
+
 const int sfouiller = 0x402;
 const int slire = 0x403;
 const int sposer = 0x404;


Commit: 5f0f24c89839f9ea45044cd9aa8735c9268d650b
    https://github.com/scummvm/scummvm/commit/5f0f24c89839f9ea45044cd9aa8735c9268d650b
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:37-07:00

Commit Message:
MORTEVIELLE: Some more cleanup, renaming, plus a couple of crash fixes in deline and writeg

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/actions.h
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index caaeb07..6621517 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -909,7 +909,11 @@ void fctKnock() {
 	}
 }
 
-void tposer() {
+/**
+ * Engine function - Put
+ * @remarks	Originally called 'tposer'
+ */
+void fctPut() {
 	int cx, chai;
 
 	if (!syn)
@@ -1099,7 +1103,7 @@ void fctEnter() {
 				tip(z, x);
 				++s.conf;
 				s.mlieu = 15;
-				msg[3] = discut;
+				msg[3] = MENU_DISCUSS;
 				msg[4] = g_vm->_menu._disc[x];
 				syn = true;
 				if (ment == 9) {
@@ -1275,7 +1279,11 @@ void fctSound() {
 	}
 }
 
-void tparler() {
+/**
+ * Engine function - Discuss
+ * @remarks	Originally called 'tparler'
+ */
+void fctDiscuss() {
 	bool te[47];
 	int ix, cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index d96b712..e73dc08 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -48,7 +48,7 @@ extern void fctHideSelf();
 extern void fctAttach();
 extern void fctClose();
 extern void fctKnock();
-extern void tposer();
+extern void fctPut();
 extern void fctListen();
 extern void fctEat();
 extern void fctEnter();
@@ -57,7 +57,7 @@ extern void fctForce();
 extern void fctLeave();
 extern void fctWait();
 extern void fctSound();
-extern void tparler();
+extern void fctDiscuss();
 extern void fctSmell();
 extern void fctScratch();
 /* NIVEAU 2 */
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index bccbb10..8965845 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -83,19 +83,23 @@ int Alert::show(const Common::String &msg, int n) {
 			cx = 320;
 			st = "";
 			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
-				i = i + 1;
+				++i;
 				st = st + chaine[i];
-				if (res == 2)  cx = cx - 3;
-				else cx = cx - 5;
+				if (res == 2)
+					cx -= 3;
+				else
+					cx -= 5;
 			}
 			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
 			g_vm->_screenSurface._textPos.y += 6;
 			g_vm->_screenSurface.writeg(st, 4);
-			i = i + 1;
+			++i;
 		} while (!(chaine[i] == ']'));
 	}
-	if (nbcase == 1)  esp = nbcol - 40;
-	else esp = (uint)(nbcol - nbcase * 40) >> 1;
+	if (nbcase == 1)
+		esp = nbcol - 40;
+	else
+		esp = (uint)(nbcol - nbcase * 40) >> 1;
 	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
 	fait_choix(cas, coldep, nbcase, &s[0], esp);
 	limit[1][1] = ((uint)(coldep) >> 1) * res;
@@ -121,11 +125,14 @@ int Alert::show(const Common::String &msg, int n) {
 		if (test) {
 			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
 			test2 = test1;
-			if (nbcase > 1)  test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
+			if (nbcase > 1)
+				test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
 			if (test2) {
 				newaff = true;
-				if (test1)  ix = 1;
-				else ix = 2;
+				if (test1)
+					ix = 1;
+				else
+					ix = 2;
 				if (ix != quoi) {
 					hideMouse();
 					if (quoi != 0) {
@@ -165,7 +172,7 @@ int Alert::show(const Common::String &msg, int n) {
 	} while (!g_vm->getMouseClick());
 	g_vm->setMouseClick(false);
 	hideMouse();
-	if (! test3)  {
+	if (!test3)  {
 		quoi = n;
 		setPosition(n, coldep, esp);
 		Common::String tmp4(" ");
@@ -199,26 +206,30 @@ void Alert::decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 	col = 0;
 
 	while (s[i] != ']') {
-		c = c + s[i];
+		c += s[i];
 		if ((s[i] == '|') || (s[i + 1] == ']')) {
-			if (k > col)  col = k;
+			if (k > col)
+				col = k;
 			k = 0;
 			nbl = nbl + 1;
-		} else if (s[i] != ' ')  v = false;
-		i = i + 1;
-		k = k + 1;
+		} else if (s[i] != ' ')
+			v = false;
+		++i;
+		++k;
 	}
 	if (v)  {
 		c = "";
 		col = 20;
 	} else {
-		c = c + ']';
-		col = col + 6;
+		c += ']';
+		col += 6;
 	}
-	i = i + 1;
+	++i;
 	cs = copy(s, i, 30);
-	if (res == 2)  col = col * 6;
-	else col = col * 10;
+	if (res == 2)
+		col *= 6;
+	else
+		col *= 10;
 }
 
 void Alert::setPosition(int ji, int coldep, int esp) {
@@ -228,7 +239,8 @@ void Alert::setPosition(int ji, int coldep, int esp) {
 void Alert::fait_boite(int lidep, int nli, int tx) {
 	int x, y, xx, yy;
 
-	if (tx > 640)  tx = 640;
+	if (tx > 640)
+		tx = 640;
 	x = 320 - ((uint)tx >> 1);
 	y = pred(int, lidep) << 3;
 	xx = x + tx;
@@ -249,12 +261,13 @@ void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String
 	for (l = 1; l <= nbcase; l ++) {
 		str[l] = "";
 		do {
-			i = i + 1;
+			++i;
 			ch = c[i];
-			str[l] = str[l] + ch;
+			str[l] += ch;
 		} while (!(c[i + 1] == ']'));
 		i = i + 2;
-		while (str[l].size() < 3)  str[l] = str[l] + ' ';
+		while (str[l].size() < 3)
+		str[l] += ' ';
 		g_vm->_screenSurface.putxy(x, 98);
 
 		Common::String tmp(" ");
@@ -262,7 +275,7 @@ void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String
 		tmp += " ";
 
 		g_vm->_screenSurface.writeg(tmp, 0);
-		x = x + esp + 40;
+		x += esp + 40;
 	}
 }
 
@@ -292,10 +305,12 @@ bool Ques::show() {
 		hideMouse();
 		hirs();
 		showMouse();
-		i = i + 1;
+		++i;
 		deline(ta[i], st, tay);
-		if (res == 1)  y = 29;
-		else y = 23;
+		if (res == 1)
+			y = 29;
+		else
+			y = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, y));
 		afftex(st, 20, 15, 100, 2, 0);
 		if (i != 10) {
@@ -310,29 +325,31 @@ bool Ques::show() {
 		memk = 1;
 		for (j = prem; j <= der; j ++) {
 			deline(j, st, tay);
-			if (tay > tmax)  tmax = tay;
+			if (tay > tmax)
+				tmax = tay;
 			afftex(st, 100, y, 100, 1, 0);
 			chaines[memk] = delig;
-			memk = memk + 1;
-			y = y + 8;
+			++memk;
+			y += 8;
 		}
-		for (j = 1; j <= succ(int, der - prem); j ++) {
-			{
-				rectangle &with = coor[j];
-
-				with.x1 = 45 * res;
-				with.x2 = (tmax * 3 + 55) * res;
-				with.y1 = 27 + j * 8;
-				with.y2 = 34 + j * 8;
-				with.etat = true;
-			}
+		for (j = 1; j <= succ(int, der - prem); j++) {
+			rectangle &with = coor[j];
+
+			with.x1 = 45 * res;
+			with.x2 = (tmax * 3 + 55) * res;
+			with.y1 = 27 + j * 8;
+			with.y2 = 34 + j * 8;
+			with.etat = true;
+
 			while ((int)chaines[j].size() < tmax) {
-				chaines[j] = chaines[j] + ' ';
+				chaines[j] += ' ';
 			}
 		}
 		coor[j + 1].etat = false;
-		if (res == 1)  rep = 10;
-		else rep = 6;
+		if (res == 1)
+			rep = 10;
+		else
+			rep = 6;
 		g_vm->_screenSurface.drawBox(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
 		rep = 0;
 		j = 0;
@@ -347,29 +364,40 @@ bool Ques::show() {
 			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
 			if (coor[k].etat) {
 				if ((memk != 0) && (memk != k)) {
-					for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
+//					for (j = 1; j <= tmax; j ++)
+//						st[j] = chaines[memk][j];
+					strncpy(st, chaines[memk].c_str(), tmax);
+//
 					st[1 + tmax] = '$';
 					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				}
 				if (memk != k) {
-					for (j = 1; j <= tmax; j ++) st[j] = chaines[k][j];
+//					for (j = 1; j <= tmax; j ++)
+//						st[j] = chaines[k][j];
+					strncpy(st, chaines[k].c_str(), tmax);
 					st[1 + tmax] = '$';
 					afftex(st, 100, 27 + k * 8, 100, 1, 1);
 					memk = k;
 				}
 			} else if (memk != 0) {
-				for (j = 1; j <= tmax; j ++) st[j] = chaines[memk][j];
+//				for (j = 1; j <= tmax; j ++)
+//					st[j] = chaines[memk][j];
+				strncpy(st, chaines[memk].c_str(), tmax);
 				st[1 + tmax] = '$';
 				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				memk = 0;
 			}
 		} while (!((memk != 0) && g_vm->getMouseClick()));
-		if (memk == ok[i])  compte = compte + 1;
+		if (memk == ok[i])
+			++compte;
 		else {
-			if (i == 5)  i = i + 1;
-			if ((i == 7) || (i == 8))  i = 10;
+			if (i == 5)
+				++i;
+			if ((i == 7) || (i == 8))
+				i = 10;
 		}
-		if (i == 10)  q =   /*testprot*/ true;
+		if (i == 10)
+			q = /*testprot*/ true;
 	} while (!(i == 10));
 	ques_result = (compte == 10) && q;
 	return ques_result;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 62f13da..1c0a4fa 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -484,7 +484,8 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 	for (;;) {
 		// If position is past end point, then skip this line
 		if (((_thickness - 1) * DEFAULT_WIDTH) + pDest >= pDestEnd) {
-			if (--_thickness == 0) break;
+			if (--_thickness == 0)
+				break;
 			continue;
 		}
 		
@@ -1081,7 +1082,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	}
 	pt.x += 1;
 	pt.y += 1;
-	for (x = 1; x <= (int)l.size(); ++x) {
+	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
 		g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
 		pt.x += i;
 	}
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index a330a38..abf8c26 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -32,43 +32,38 @@
 namespace Mortevielle {
 
 char readkey1() {
-	char c;
+	char c = get_ch();
 
-	char readkey1_result;
-	c = get_ch();	// input >> kbd >> c;
-	readkey1_result = c;
-	return readkey1_result;
+	return c;
 }
 
 int testou() {
-	char ch;
+	char ch = get_ch();
 
-	int testou_result;
-	ch = get_ch();	// input >> kbd >> ch;
 	switch (ch)  {
 	case '\23' :
-		sonoff = ! sonoff;
+		sonoff = !sonoff;
 		break;
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			c_zzz = succ(int, c_zzz);
-			testou_result = 61;
-			return testou_result;
+
+			return 61;
 		}
 		break;
 	case '\33' :
-		if (keypressed())  ch = get_ch();	// input >> kbd >> ch;
+		if (keypressed())
+			ch = get_ch();
 		break;
 	}
-	testou_result = ord(ch);
-	return testou_result;
+
+	return ord(ch);
 }
 
 void teskbd() {
-	int dum;
-
-	if (keypressed())  dum = testou();
+	if (keypressed())
+		testou();
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 374851f..571abfa 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -37,9 +37,7 @@ namespace Mortevielle {
 
 /* NIVEAU 15 */
 void copcha() {
-	int i;
-
-	i = acha;
+	int i = acha;
 	do {
 		tabdon[i] = tabdon[i + 390];
 		i = succ(int, i);
@@ -54,8 +52,11 @@ bool dans_rect(rectangle r) {
 	if ((x > r.x1) &&
 	        (x < r.x2) &&
 	        (y > r.y1) &&
-	        (y < r.y2))  dans_rect_result = true;
-	else dans_rect_result = false;
+	        (y < r.y2))
+		dans_rect_result = true;
+	else
+		dans_rect_result = false;
+
 	return dans_rect_result;
 }
 
@@ -63,27 +64,24 @@ void outbloc(int n, pattern p, t_nhom pal) {
 	int i, j, ad;
 
 	ad = n * 404 + 0xd700;
-	{
-		WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
-		WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
-		ad = ad + 4;
-		for (i = 1; i <= p.tax; i ++)
-			for (j = 1; j <= p.tay; j ++)
-				mem[0x6000 * 16 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
-	}
-}
 
+	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
+	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
+	ad = ad + 4;
+	for (i = 1; i <= p.tax; i ++)
+		for (j = 1; j <= p.tay; j ++)
+			mem[0x6000 * 16 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
+}
 
 void writepal(int n) {
 	int i;
 	t_nhom pal;
 
-
 	switch (gd) {
 	case tan:
 	case ega:
 	case ams :
-		for (i = 1; i <= 16; i ++) {
+		for (i = 1; i <= 16; i++) {
 			mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x;
 			mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y;
 		}
@@ -91,8 +89,10 @@ void writepal(int n) {
 	case cga : {
 		warning("TODO: If this code is needed, resolve the incompatible types");
 //		pal = palcga[n].a;
-		if (n < 89)  palette(palcga[n].p);
-		for (i = 0; i <= 15; i ++) outbloc(i, tpt[pal[i].n], pal);
+		if (n < 89)
+			palette(palcga[n].p);
+		for (i = 0; i <= 15; i++)
+			outbloc(i, tpt[pal[i].n], pal);
 	}
 	break;
 	}
@@ -152,7 +152,8 @@ int animof(int ouf, int num) {
 	int animof_result;
 	nani = mem[adani * 16 + 1];
 	aux = num;
-	if (ouf != 1)  aux = aux + nani;
+	if (ouf != 1)
+		aux += nani;
 	animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
 
 	return animof_result;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 51fad3f..97ba083 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -44,20 +44,19 @@ namespace Mortevielle {
  * Setup a menu's contents
  */
 void Menu::menut(int no, Common::String nom) {
-	byte h, l;
-	Common::String s;
+	byte h = hi(no);
+	byte l = lo(no);
+	Common::String s = nom;
 
-	h = hi(no);
-	l = lo(no);
-	s = nom;
 	if (! tesok) {
 		g_vm->quitGame();
 	}
+
 	while (s.size() < 20)
-		s = s + ' ';
+		s += ' ';
 
 	switch (h) {
-	case invent  :
+	case invent:
 		if (l != 7) {
 			_inv[l] = s;
 			_inv[l].insertChar(' ', 0);
@@ -72,7 +71,7 @@ void Menu::menut(int no, Common::String nom) {
 	case saction:
 		_self[l] = s;
 		break;
-	case discut:
+	case MENU_DISCUSS:
 		_dis[l] = s;
 		break;
 	}
@@ -83,13 +82,12 @@ void Menu::menut(int no, Common::String nom) {
  * @param no	Hi byte represents menu number, lo byte reprsents item index
  */
 void Menu::disableMenuItem(int no) {
-	byte h, l;
+	byte h = hi(no);
+	byte l = lo(no);
 
-	h = hi(no);
-	l = lo(no);
 	switch (h) {
 	case invent : {
-		if (l > 6)  {
+		if (l > 6) {
 			_inv[l].setChar('<', 0);
 			_inv[l].setChar('>', 21);
 		} else
@@ -105,7 +103,7 @@ void Menu::disableMenuItem(int no) {
 	case saction:
 		_self[l].setChar('*', 0);
 		break;
-	case discut:
+	case MENU_DISCUSS:
 		_dis[l].setChar('*', 0);
 		break;
 	}
@@ -116,28 +114,25 @@ void Menu::disableMenuItem(int no) {
  * @param no	Hi byte represents menu number, lo byte reprsents item index
  */
 void Menu::enableMenuItem(int no) {
-	byte h, l;
+	byte h = hi(no);
+	byte l = lo(no);
 
-	h = hi(no);
-	l = lo(no);
 	switch (h) {
-	case invent : {
+	case invent :
 		_inv[l].setChar(' ', 0);
 		_inv[l].setChar(' ', 21);
-	}
-	break;
+		break;
 	case MENU_MOVE:
 		_dep[l].setChar(' ', 0);
 		break;
 	case action:
 		_act[l].setChar(' ', 0);
 		break;
-	case saction: {
+	case saction:
 		_self[l].setChar(' ', 0);
 		_self[l].setChar(' ', 0);
-	}
-	break;
-	case discut:
+		break;
+	case MENU_DISCUSS:
 		_dis[l].setChar(' ', 0);
 		break;
 	}
@@ -152,17 +147,19 @@ void Menu::menu_aff() {
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
-	if (gd == cga)  color = 1;
-	else color = 9;
+	if (gd == cga)
+		color = 1;
+	else
+		color = 9;
 	num_letr = 0;
-	do {       /* lettre par lettre */
-		num_letr = num_letr + 1;
+	do {       // One character after the other
+		++num_letr;
 		ind_tabl = 0;
 		y = 1;
-		do {      /* colonne par colonne */
+		do {     // One column after the other
 			k = 0;
 			x = col;
-			do {     /* ligne par ligne */
+			do {   // One line after the other
 				msk = 0x80;
 				for (pt = 0; pt <= 7; pt ++) {
 					if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
@@ -171,14 +168,14 @@ void Menu::menu_aff() {
 						g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
 					}
 					msk = (uint)msk >> 1;
-					x = x + 1;
+					++x;
 				}
 				ind_tabl = succ(int, ind_tabl);
 				k = succ(int, k);
 			} while (!(k == 3));
-			y = y + 1;
+			++y;
 		} while (!(y == 9));
-		col = col + 48 * res;
+		col += 48 * res;
 	} while (!(num_letr == 6));
 	showMouse();
 }
@@ -199,7 +196,9 @@ void Menu::drawMenu() {
 void Menu::invers(int ix) {
 	Common::String s;
 
-	if (msg4 == OPCODE_NONE)  return;
+	if (msg4 == OPCODE_NONE)
+		return;
+
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
 	case 1 :
@@ -248,8 +247,10 @@ void Menu::util(int x, int y) {
 	ymx = (don[msg3][4] << 3) + 16;
 	dxcar = don[msg3][3];
 	xmn = (don[msg3][1] << 2) * res;
-	if (res == 1)  ix = 5;
-	else ix = 3;
+	if (res == 1)
+		ix = 5;
+	else
+		ix = 3;
 	xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
 		ix = pred(int, ((uint)y >> 3)) + (msg3 << 8);
@@ -282,8 +283,10 @@ void Menu::menuDown(int ii) {
 	hideMouse();
 	sauvecr(10, succ(byte, don[ii][2]) << 1);
 	xco = xco << 3;
-	if (res == 1)  cx = 10;
-	else cx = 6;
+	if (res == 1)
+		cx = 10;
+	else
+		cx = 6;
 	xcc = xco + (don[ii][3] * cx) + 6;
 	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
@@ -384,11 +387,12 @@ void Menu::mdn() {
 	/* debug('mdn'); */
 	if (!_menuActive)
 		return;
+
 	x = x_s;
 	y = y_s;
 	if (!g_vm->getMouseClick()) {
-		if ((x == xprec) &&
-		        (y == yprec))  return;
+		if ((x == xprec) && (y == yprec))
+			return;
 		else {
 			xprec = x;
 			yprec = y;
@@ -400,12 +404,19 @@ void Menu::mdn() {
 		                   || ((x > 220 * res) && (x < 220 * res + 24))
 		                   || ((x > 268 * res) && (x < 268 * res + 24)));
 		if (tes) {
-			if (x < 76 * res)  ix = invent;
-			else if (x < 124 * res)  ix = MENU_MOVE;
-			else if (x < 172 * res)  ix = action;
-			else if (x < 220 * res)  ix = saction;
-			else if (x < 268 * res)  ix = discut;
-			else ix = fichier;
+			if (x < 76 * res)
+				ix = invent;
+			else if (x < 124 * res)
+				ix = MENU_MOVE;
+			else if (x < 172 * res)
+				ix = action;
+			else if (x < 220 * res)
+				ix = saction;
+			else if (x < 268 * res)
+				ix = MENU_DISCUSS;
+			else
+				ix = fichier;
+
 			if ((ix != msg3) || (! test0))
 				if (!((ix == fichier) && ((msg3 == sauve) || (msg3 == charge)))) {
 					menuUp(msg3);
@@ -413,16 +424,19 @@ void Menu::mdn() {
 					msg3 = ix;
 					msg4 = OPCODE_NONE;
 				}
-		} else { /* Not in the MenuTitle line */
-			if ((y > 11) && (test0))  util(x, y);
+		} else { // Not in the MenuTitle line
+			if ((y > 11) && (test0))
+				util(x, y);
 		}
-	} else {       /* There was a click */
+	} else {       // There was a click
 		if ((msg3 == fichier) && (msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
 			menuUp(msg3);
-			if (lo(msg4) == 1)  msg3 = 7;
-			else msg3 = 8;
+			if (lo(msg4) == 1)
+				msg3 = 7;
+			else
+				msg3 = 8;
 			menuDown(msg3);
 
 			g_vm->setMouseClick(false);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index d4aecbc..1fb8ad4 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -61,7 +61,7 @@ public:
 
 enum {
 	invent = 1, MENU_MOVE = 2, action = 3, saction = 4,
-	discut = 5, fichier = 6, sauve = 7, charge = 8
+	MENU_DISCUSS = 5, fichier = 6, sauve = 7, charge = 8
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 78e577a..bf9a480 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -56,42 +56,55 @@ void testfi() {
  * Read the current system time
  */
 int readclock() {
-	int m, h;
-
-	/* debug('readclock');*/
 	TimeDate dateTime;
 	g_system->getTimeAndDate(dateTime);
 
-	m = dateTime.tm_min * 60;
-	h = dateTime.tm_hour * 3600;
+	int m = dateTime.tm_min * 60;
+	int h = dateTime.tm_hour * 3600;
 	return h + m + dateTime.tm_sec;
 }
 
 void modif(int &nu) {
-	/* debug('modif'); */
-	if (nu == 26)  nu = 25;
-	if ((nu > 29) && (nu < 36))  nu = nu - 4;
-	if ((nu > 69) && (nu < 78))  nu = nu - 37;
-	if ((nu > 99) && (nu < 194))  nu = nu - 59;
-	if ((nu > 996) && (nu < 1000))  nu = nu - 862;
-	if ((nu > 1500) && (nu < 1507))  nu = nu - 1363;
-	if ((nu > 1507) && (nu < 1513))  nu = nu - 1364;
-	if ((nu > 1999) && (nu < 2002))  nu = nu - 1851;
-	if (nu == 2010)  nu = 151;
-	if ((nu > 2011) && (nu < 2025))  nu = nu - 1860;
-	if (nu == 2026)  nu = 165;
-	if ((nu > 2029) && (nu < 2037))  nu = nu - 1864;
-	if ((nu > 3000) && (nu < 3005))  nu = nu - 2828;
-	if (nu == 4100)  nu = 177;
-	if (nu == 4150)  nu = 178;
-	if ((nu > 4151) && (nu < 4156))  nu = nu - 3973;
-	if (nu == 4157)  nu = 183;
-	if ((nu == 4160) || (nu == 4161))  nu = nu - 3976;
+	if (nu == 26)
+		nu = 25;
+	else if ((nu > 29) && (nu < 36))
+		nu -= 4;
+	else if ((nu > 69) && (nu < 78))
+		nu -= 37;
+	else if ((nu > 99) && (nu < 194))
+		nu -= 59;
+	else if ((nu > 996) && (nu < 1000))
+		nu -= 862;
+	else if ((nu > 1500) && (nu < 1507))
+		nu -= 1363;
+	else if ((nu > 1507) && (nu < 1513))
+		nu -= 1364;
+	else if ((nu > 1999) && (nu < 2002))
+		nu -= 1851;
+	else if (nu == 2010)
+		nu = 151;
+	else if ((nu > 2011) && (nu < 2025))
+		nu -= 1860;
+	else if (nu == 2026)
+		nu = 165;
+	else if ((nu > 2029) && (nu < 2037))
+		nu -= 1864;
+	else if ((nu > 3000) && (nu < 3005))
+		nu -= 2828;
+	else if (nu == 4100)
+		nu = 177;
+	else if (nu == 4150)
+		nu = 178;
+	else if ((nu > 4151) && (nu < 4156))
+		nu -= 3973;
+	else if (nu == 4157)
+		nu = 183;
+	else if ((nu == 4160) || (nu == 4161))
+		nu -= 3976;
 }
 
 
 void dessine(int ad, int x, int y) {
-	/* debug('dessine'); */
 	hideMouse();
 	writepal(numpal);
 	pictout(ad, 0, x, y);
@@ -99,7 +112,6 @@ void dessine(int ad, int x, int y) {
 }
 
 void dessine_rouleau() {
-	/* debug('dessine_rouleau'); */
 	writepal(89);
 	if (gd == her) {
 		mem[0x7000 * 16 + 14] = 15;
@@ -124,18 +136,19 @@ void text1(int x, int y, int nb, int m) {
 
 
 	/* debug('text'); */
-	if (res == 1)  co = 10;
-	else co = 6;
+	if (res == 1)
+		co = 10;
+	else
+		co = 6;
 	deline(m, st, tay);
-	if ((y == 182) && (tay * co > nb * 6))  y = 176;
+	if ((y == 182) && (tay * co > nb * 6))
+		y = 176;
 	afftex(st, x, y, nb, 20, color_txt);
 }
 
 void initouv() {
-	int cx;
-
-	/* debug('initouv'); */
-	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+	for (int cx = 1; cx <= 7; cx++)
+		touv[cx] = chr(0);
 }
 
 void ecrf1() {
@@ -144,7 +157,6 @@ void ecrf1() {
 }
 
 void clsf1() {
-	/* debug('clsf1'); */
 	hideMouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
 
@@ -152,9 +164,6 @@ void clsf1() {
 }
 
 void clsf2() {
-//	int i, j;
-
-	/* debug('clsf2'); */
 	hideMouse();
 	if (f2_all) {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
@@ -173,13 +182,13 @@ void ecrf2() {
 
 void ecr2(Common::String str_) {
 	int tab;
-	int tlig;
 
-	/* debug('ecr2 : '+str_);*/
-	if (res == 1)  tab = 10;
-	else tab = 6;
+	if (res == 1)
+		tab = 10;
+	else
+		tab = 6;
 	g_vm->_screenSurface.putxy(8, 177);
-	tlig = 59 + pred(int, res) * 36;
+	int tlig = 59 + pred(int, res) * 36;
 	if ((int)str_.size() < tlig)
 		g_vm->_screenSurface.writeg(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
@@ -200,9 +209,6 @@ void ecr2(Common::String str_) {
 }
 
 void clsf3() {
-//	int i, j;
-
-	/* debug('clsf3'); */
 	hideMouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
 	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
@@ -210,14 +216,12 @@ void clsf3() {
 }
 
 void ecr3(Common::String text) {
-	/* debug('ecr3 : '+text);*/
 	clsf3();
 	g_vm->_screenSurface.putxy(8, 192);
 	g_vm->_screenSurface.writeg(text, 5);
 }
 
 void ecrf6() {
-	/* debug('ecrf6'); */
 	text_color(5);
 	g_vm->_screenSurface.drawBox(62, 33, 363, 80, 15);
 }
@@ -230,7 +234,6 @@ void clsf10() {
 	int co, cod;
 	Common::String st;
 
-	/* debug('clsf10'); */
 	hideMouse();
 	if (res == 1) {
 		co = 634;
@@ -250,8 +253,12 @@ void clsf10() {
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
 	g_vm->_screenSurface.putxy(co, 92);
 	g_vm->_screenSurface.writeg(st, 4);
-	if (res == 1)  co = 620;
-	else co = 584;
+
+	if (res == 1)
+		co = 620;
+	else
+		co = 584;
+
 	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, co, 86));
 	/* rempli(69,12,32,5,255);*/
 	showMouse();
@@ -267,23 +274,20 @@ void stop() {
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
-	/* debug('paint_rect'); */
-	if (gd == cga)  co = 3;
-	else co = 11;
+	if (gd == cga)
+		co = 3;
+	else
+		co = 11;
 	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
 int hazard(int min, int max) {
-	/* debug('hazard'); */
 	return get_random_number(min, max);
 }
 
 void calch(int &j, int &h, int &m) {
-	int th, nh;
-
-	/* debug('calch');*/
-	nh = readclock();
-	th = jh + ((nh - mh) / t);
+	int nh = readclock();
+	int th = jh + ((nh - mh) / t);
 	m = ((th % 2) + vm) * 30;
 	h = ((uint)th >> 1) + vh;
 	if (m == 60) {
@@ -295,10 +299,7 @@ void calch(int &j, int &h, int &m) {
 }
 
 void conv(int x, int &y) {
-	int cx;
-
-	/* debug('conv'); */
-	cx = 1;
+	int cx = 1;
 	y = 128;
 	while (cx < x) {
 		y = (uint)y >> 1;
@@ -313,11 +314,9 @@ void okpas() {
 
 void modobj(int m) {
 	char str_[1410];
-	Common::String strp;
 	int tay;
 
-	/* debug('modobj'); */
-	strp = ' ';
+	Common::String strp = Common::String(' ');
 	if (m != 500) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
@@ -328,13 +327,13 @@ void modobj(int m) {
 
 void modobj2(int m, bool t1, bool t2) {
 	char str_[1410];
-	Common::String strp;
 	int tay;
 
-	/* debug('modobj'); */
-	strp = ' ';
-	if (t1 || t2)  okpas();
-	else tesok = false;;
+	Common::String strp = Common::String(' ');
+	if (t1 || t2)
+		okpas();
+	else
+		tesok = false;;
 	if (m != 500) {
 		deline(m - 501 + c_st41, str_, tay);
 		strp = delig;
@@ -348,25 +347,28 @@ void repon(int f, int m) {
 	Common::String str_;
 	Common::String str1;
 	char st[1410];
-//	text1 fic;
 	int i, xco, dx, caspe, tay;
 
-	/* debug('repon fenetre nø'+chr(f+48));*/
 	if ((m > 499) && (m < 563)) {
 		deline(m - 501 + c_st41, st, tay);
-		if (tay > ((58 + pred(int, res) * 37) << 1))  f2_all = true;
-		else f2_all = false;
+		if (tay > ((58 + pred(int, res) * 37) << 1))
+			f2_all = true;
+		else
+			f2_all = false;
 		clsf2();
 		afftex(st, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
-		if (f == 8)  f = 2;
-		if (f == 1)  f = 6;
+		if (f == 8)
+			f = 2;
+		if (f == 1)
+			f = 6;
 		if (f == 2) {
 			clsf2();
 			ecrf2();
 			text1(8, 182, 103, m);
-			if ((m == 68) || (m == 69))  s.teauto[40] = '*';
+			if ((m == 68) || (m == 69))
+				s.teauto[40] = '*';
 			if ((m == 104) && (caff == 14)) {
 				s.teauto[36] = '*';
 				if (s.teauto[39] == '*') {
@@ -377,11 +379,15 @@ void repon(int f, int m) {
 		}
 		if ((f >= 6) && (f <= 9)) {
 			deline(m, st, tay);
-			if (f == 6)  i = 4;
-			else i = 5;
+			if (f == 6)
+				i = 4;
+			else
+				i = 5;
 			afftex(st, 80, 40, 60, 25, i);
-			if (m == 180)  s.pourc[6] = '*';
-			if (m == 179)  s.pourc[10] = '*';
+			if (m == 180)
+				s.pourc[6] = '*';
+			if (m == 179)
+				s.pourc[10] = '*';
 		}
 		if (f == 7) {         /* messint */
 			ecrf7();
@@ -395,30 +401,43 @@ void repon(int f, int m) {
 				caspe = 144;
 				dx = 50;
 			}
-			if (tay < 40)  afftex(st, xco, 86, dx, 3, 5);
-			else afftex(st, caspe, 86, dx, 3, 5);
+			if (tay < 40)
+				afftex(st, xco, 86, dx, 3, 5);
+			else
+				afftex(st, caspe, 86, dx, 3, 5);
 		}
 	}
 }
 
 void t5(int cx) {
-	/* debug('t5'); */
-	if (cx == 10)  blo = false;
+	if (cx == 10)
+		blo = false;
+
 	if (cx != 1) {
 		bh1 = false;
 		bf1 = false;
 	}
-	if (cx != 2)  bh2 = false;
+
+	if (cx != 2)
+		bh2 = false;
+
 	if (cx != 4) {
 		bh4 = false;
 		bf4 = false;
 	}
-	if (cx != 5)  bh5 = false;
-	if (cx != 6)  bh6 = false;
-	if (cx != 8)  bh8 = false;
-	if (cx != 3)  bt3 = false;
-	if (cx != 7)  bt7 = false;
-	if (cx != 9)  bh9 = false;
+
+	if (cx != 5)
+		bh5 = false;
+	if (cx != 6)
+		bh6 = false;
+	if (cx != 8)
+		bh8 = false;
+	if (cx != 3)
+		bt3 = false;
+	if (cx != 7)
+		bt7 = false;
+	if (cx != 9)
+		bh9 = false;
 }
 
 void affper(int per) {
@@ -473,91 +492,109 @@ void affper(int per) {
 
 void choix(int min, int max, int &per) {
 	bool i;
-	int haz, cx, cy, cz;
+	int cz;
 
-	/* debug('o0 choix'); */
-	haz = hazard(min, max);
+	int haz = hazard(min, max);
 	if (haz > 4) {
 		haz = 8 - haz;
 		i = true;
-	} else i = false;
-	cx = 0;
+	} else
+		i = false;
+
+	int cx = 0;
 	per = 0;
 	while (cx < haz) {
-		cy = hazard(1, 8);
+		int cy = hazard(1, 8);
 		conv(cy, cz);
 		if ((per & cz) != cz) {
-			cx = cx + 1;
-			per = (per | cz);
+			++cx;
+			per |= cz;
 		}
 	}
-	if (i)  per = 255 - per;
-	i = false;
+	if (i)
+		per = 255 - per;
 }
 
 void cpl1(int &p) {
 	int j, h, m;
 
-	/* debug('o0 cpl1'); */
 	calch(j, h, m);
-	if ((h > 7) || (h < 11))  p = 25;
-	if ((h > 10) && (h < 14))  p = 35;
-	if ((h > 13) && (h < 16))  p = 50;
-	if ((h > 15) && (h < 18))  p = 5;
-	if ((h > 17) && (h < 22))  p = 35;
-	if ((h > 21) && (h < 24))  p = 50;
-	if ((h >= 0) && (h < 8))  p = 70;
+	if ((h > 7) || (h < 11))
+		p = 25;
+	else if ((h > 10) && (h < 14))
+		p = 35;
+	else if ((h > 13) && (h < 16))
+		p = 50;
+	else if ((h > 15) && (h < 18))
+		p = 5;
+	else if ((h > 17) && (h < 22))
+		p = 35;
+	else if ((h > 21) && (h < 24))
+		p = 50;
+	else if ((h >= 0) && (h < 8))
+		p = 70;
+
 	g_vm->_menu.mdn();
 }
 
 void cpl2(int &p) {
 	int j, h, m;
 
-	/* debug('o0 cpl2'); */
 	calch(j, h, m);
-	if ((h > 7) && (h < 11))  p = -2;
-	if (h == 11)  p = 100;
-	if ((h > 11) && (h < 23))  p = 10;
-	if (h == 23)  p = 20;
-	if ((h >= 0) && (h < 8))  p = 50;
+	if ((h > 7) && (h < 11))
+		p = -2;
+	if (h == 11)
+		p = 100;
+	if ((h > 11) && (h < 23))
+		p = 10;
+	if (h == 23)
+		p = 20;
+	if ((h >= 0) && (h < 8))
+		p = 50;
 }
 
 void cpl3(int &p) {
 	int j, h, m;
 
-	/* debug('o0 cpl3'); */
 	calch(j, h, m);
-	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))  p = 34;
-	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))  p = 0;
+	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))
+		p = 34;
+	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))
+		p = 0;
 }
 
 void cpl5(int &p) {
 	int j, h, m;
 
-	/* debug('o0 cpl5'); */
 	calch(j, h, m);
-	if ((h > 6) && (h < 10))  p = 0;
-	if (h == 10)  p = 100;
-	if ((h > 10) && (h < 24))  p = 15;
-	if ((h >= 0) && (h < 7))  p = 50;
+	if ((h > 6) && (h < 10))
+		p = 0;
+	if (h == 10)
+		p = 100;
+	if ((h > 10) && (h < 24))
+		p = 15;
+	if ((h >= 0) && (h < 7))
+		p = 50;
 }
 
 void cpl6(int &p) {
 	int j, h, m;
 
-	/* debug('o0 cpl6'); */
 	calch(j, h, m);
-	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))  p = -2;
-	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))  p = 35;
-	if (h == 17)  p = 100;
-	if ((h >= 0) && (h < 8))  p = 60;
+	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))
+		p = -2;
+	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))
+		p = 35;
+	if (h == 17)
+		p = 100;
+	if ((h >= 0) && (h < 8))
+		p = 60;
 }
 
 /**
  * Shows the you are alone message in the status area on the right hand side of the screen
  */
 void person() {
-	/* debug('person'); */
 	for (int cf = 1; cf <= 8; cf ++)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
 
@@ -577,7 +614,6 @@ void person() {
 }
 
 void chlm(int &per) {
-	/* debug('chlm'); */
 	per = hazard(1, 2);
 	if (per == 2)  per = 128;
 }
@@ -594,7 +630,6 @@ void pendule() {
 	int h, co;
 
 
-	/* debug('pendule'); */
 	hideMouse();
 	
 	paint_rect(570, 118, 20, 10);
@@ -602,20 +637,27 @@ void pendule() {
 	if ((gd == cga) || (gd == her))
 		co = 0;
 	else co = 1;
+
 	if (min == 0)
 		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
 	else 
 		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
+
 	h = heu;
-	if (h > 12)  h = h - 12;
-	if (h == 0)  h = 12;
+	if (h > 12)
+		h -= 12;
+	if (h == 0)
+		h = 12;
+
 	g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
+
 	if (heu > 11)
 		g_vm->_screenSurface.writeg("PM ", 1);
 	else
 		g_vm->_screenSurface.writeg("AM ", 1);
+
 	g_vm->_screenSurface.putxy(550, 160);
 	if ((jou >= 0) && (jou <= 8)) {
 		Common::String tmp = g_vm->getString(S_DAY);
@@ -629,134 +671,158 @@ void pendule() {
  *************/
 
 void debloc(int l) {
-	/* debug('debloc'); */
 	num = 0;
 	x = 0;
 	y = 0;
-	if ((l != 26) && (l != 15))  t5(l);
+	if ((l != 26) && (l != 15))
+		t5(l);
 	mpers = ipers;
 }
 
 void cpl10(int &p, int &h) {
 	int j, m;
 
-	/* debug('o1 cpl10'); */
 	calch(j, h, m);
-	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14))
-	        || ((h > 18) && (h < 21)))  p = 100;
-	if ((h == 11) || ((h > 20) && (h < 24)))  p = 45;
-	if (((h > 13) && (h < 17)) || (h == 18))  p = 35;
-	if (h == 17)  p = 60;
-	if ((h >= 0) && (h < 8))  p = 5;
+	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+		p = 100;
+	if ((h == 11) || ((h > 20) && (h < 24)))
+		p = 45;
+	if (((h > 13) && (h < 17)) || (h == 18))
+		p = 35;
+	if (h == 17)
+		p = 60;
+	if ((h >= 0) && (h < 8))
+		p = 5;
 }
 
 void cpl11(int &p, int &h) {
 	int j, m;
 
-	/* debug('o1 cpl11'); */
 	calch(j, h, m);
-	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))  p = 25;
-	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))  p = 5;
-	if ((h > 13) && (h < 17))  p = 55;
-	if ((h > 16) && (h < 19))  p = 45;
-	if ((h >= 0) && (h < 9))  p = 0;
+	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))
+		p = 25;
+	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+		p = 5;
+	if ((h > 13) && (h < 17))
+		p = 55;
+	if ((h > 16) && (h < 19))
+		p = 45;
+	if ((h >= 0) && (h < 9))
+		p = 0;
 }
 
 void cpl12(int &p) {
 	int j, h, m;
 
-	/* debug('o1 cpl12'); */
 	calch(j, h, m);
-	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))  p = 55;
-	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))  p = 25;
-	if ((h >= 0) && (h < 5))  p = 0;
-	if ((h > 4) && (h < 9))  p = 15;
+	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))
+		p = 55;
+	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))
+		p = 25;
+	if ((h >= 0) && (h < 5))
+		p = 0;
+	if ((h > 4) && (h < 9))
+		p = 15;
 }
 
 void cpl13(int &p) {
-	/* debug('o1 cpl13'); */
 	p = 0;
 }
 
 void cpl15(int &p) {
 	int j, h, m;
 
-	/* debug('o1 cpl15'); */
 	calch(j, h, m);
-	if ((h > 7) && (h < 12))  p = 25;
-	if ((h > 11) && (h < 14))  p = 0;
-	if ((h > 13) && (h < 18))  p = 10;
-	if ((h > 17) && (h < 20))  p = 55;
-	if ((h > 19) && (h < 22))  p = 5;
-	if ((h > 21) && (h < 24))  p = 15;
-	if ((h >= 0) && (h < 8))  p = -15;
+	if ((h > 7) && (h < 12))
+		p = 25;
+	else if ((h > 11) && (h < 14))
+		p = 0;
+	else if ((h > 13) && (h < 18))
+		p = 10;
+	else if ((h > 17) && (h < 20))
+		p = 55;
+	else if ((h > 19) && (h < 22))
+		p = 5;
+	else if ((h > 21) && (h < 24))
+		p = 15;
+	else if ((h >= 0) && (h < 8))
+		p = -15;
 }
 
 void cpl20(int &p, int &h) {
 	int j, m;
 
-	/* debug('o1 cpl20'); */
 	calch(j, h, m);
-	if (h == 10)  p = 65;
-	if ((h > 10) && (h < 21))  p = 5;
-	if ((h > 20) && (h < 24))  p = -15;
-	if ((h >= 0) && (h < 5))  p = -300;
-	if ((h > 4) && (h < 10))  p = -5;
+	if (h == 10)
+		p = 65;
+	else if ((h > 10) && (h < 21))
+		p = 5;
+	else if ((h > 20) && (h < 24))
+		p = -15;
+	else if ((h >= 0) && (h < 5))
+		p = -300;
+	else if ((h > 4) && (h < 10))
+		p = -5;
 }
 
 void quelq1(int l) {
 	int per;
 
-	/* debug('o1 quelq1'); */
 	per = hazard(1, 2);
-	if (l == 1)
-		if (per == 1)  bh1 = true;
-		else bf1 = true;
-	if (l == 4)
-		if (per == 1)  bh4 = true;
-		else bf4 = true;
+	if (l == 1) {
+		if (per == 1)
+			bh1 = true;
+		else
+			bf1 = true;
+	} else if (l == 4) {
+		if (per == 1)
+			bh4 = true;
+		else
+			bf4 = true;
+	}
+
 	ipers = 10;
 }
 
 void quelq2() {
-	/* debug('o1 quelq2'); */
-	if (li == 2)  bh2 = true;
-	else bh9 = true;
+	if (li == 2)
+		bh2 = true;
+	else
+		bh9 = true;
+
 	ipers = 10;
 }
 
 void quelq5() {
-	/* debug('o1 quelq5'); */
 	bh5 = true;
 	ipers = 10;
 }
 
 void quelq6(int l) {
-	/* debug('o1 quelq6'); */
-	if (l == 6)  bh6 = true;
-	if (l == 8)  bh8 = true;
+	if (l == 6)
+		bh6 = true;
+	else if (l == 8)
+		bh8 = true;
+
 	ipers = 10;
 }
 
 void quelq10(int h, int &per) {
 	int min = 0, max = 0;
 
-	/* debug('o1 quelq10'); */
-	if ((h >= 0) && (h < 8))  chlm(per);
+	if ((h >= 0) && (h < 8))
+		chlm(per);
 	else {
 		if ((h > 7) && (h < 10)) {
 			min = 5;
 			max = 7;
-		}
-		if ((h > 9) && (h < 12)) {
+		} else if ((h > 9) && (h < 12)) {
 			min = 1;
 			max = 4;
-		}
-		if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
+		} else if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
 			min = 6;
 			max = 8;
-		}
-		if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
+		} else if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
 			min = 1;
 			max = 5;
 		}
@@ -768,18 +834,16 @@ void quelq10(int h, int &per) {
 void quelq11(int h, int &per) {
 	int min = 0, max = 0;
 
-	/* debug('o1 quelq11'); */
-	if ((h >= 0) && (h < 8))  chlm(per);
+	if ((h >= 0) && (h < 8))
+		chlm(per);
 	else {
 		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
 			min = 1;
 			max = 3;
-		}
-		if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
+		} else if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
 			min = 1;
 			max = 4;
-		}
-		if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
+		} else if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
 			min = 1;
 			max = 2;
 		}
@@ -789,7 +853,6 @@ void quelq11(int h, int &per) {
 }
 
 void quelq12(int &per) {
-	/* debug('o1 quelq12'); */
 	chlm(per);
 	affper(per);
 }
@@ -798,41 +861,37 @@ void quelq15(int &per) {
 	int cx;
 	bool test;
 
-
-	/* debug('o1 quelq15'); */
 	per = 0;
-	if (per == 0) {
-		do {
-			cx = hazard(1, 8);
-			test = (((cx == 1) && (bh2 || bh9)) ||
-			        ((cx == 2) && bh8) ||
-			        ((cx == 3) && bh4) ||
-			        ((cx == 4) && bf4) ||
-			        ((cx == 5) && bh6) ||
-			        ((cx == 6) && bh1) ||
-			        ((cx == 7) && bf1) ||
-			        ((cx == 8) && bh5));
-		} while (!(! test));
-		conv(cx, per);
-		affper(per);
-	}
+
+	do {
+		cx = hazard(1, 8);
+		test = (((cx == 1) && (bh2 || bh9)) ||
+		        ((cx == 2) && bh8) ||
+		        ((cx == 3) && bh4) ||
+		        ((cx == 4) && bf4) ||
+		        ((cx == 5) && bh6) ||
+		        ((cx == 6) && bh1) ||
+		        ((cx == 7) && bf1) ||
+		        ((cx == 8) && bh5));
+	} while (!(! test));
+
+	conv(cx, per);
+	affper(per);
 }
 
 void quelq20(int h, int &per) {
 	int min = 0, max = 0;
 
-	/* debug('o1 quelq20'); */
-	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))  chlm(per);
+	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
+		chlm(per);
 	else {
 		if ((h > 9) && (h < 12)) {
 			min = 3;
 			max = 7;
-		}
-		if ((h > 11) && (h < 18)) {
+		} else if ((h > 11) && (h < 18)) {
 			min = 1;
 			max = 2;
-		}
-		if (h == 18) {
+		} else if (h == 18) {
 			min = 2;
 			max = 4;
 		}
@@ -847,61 +906,86 @@ void frap() {
 
 	/* debug('o1 frap'); */
 	calch(j, h, m);
-	if ((h >= 0) && (h < 8))  crep = 190;
+	if ((h >= 0) && (h < 8))
+		crep = 190;
 	else {
 		haz = hazard(1, 100);
-		if (haz > 70)  crep = 190;
-		else crep = 147;
+		if (haz > 70)
+			crep = 190;
+		else
+			crep = 147;
 	}
 }
 
 void nouvp(int l, int &p) {
-	/* debug('o1 nouvp'); */
 	p = 0;
 	if (l == 1) {
-		if (bh1)  p = 4;
-		if (bf1)  p = 2;
-	}
-	if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))  p = 128;
-	if (l == 4) {
-		if (bh4)  p = 32;
-		if (bf4)  p = 16;
-	}
-	if ((l == 5) && (bh5))  p = 1;
-	if ((l == 6) && (bh6))  p = 8;
-	if ((l == 8) && (bh8))  p = 64;
-	if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))  p = 9;
-	if (p != 9)  affper(p);
+		if (bh1)
+			p = 4;
+		if (bf1)
+			p = 2;
+	} else if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))
+		p = 128;
+	else if (l == 4) {
+		if (bh4)
+			p = 32;
+		if (bf4)
+			p = 16;
+	} else if ((l == 5) && (bh5))
+		p = 1;
+	else if ((l == 6) && (bh6))
+		p = 8;
+	else if ((l == 8) && (bh8))
+		p = 64;
+	else if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))
+		p = 9;
+
+	if (p != 9)
+		affper(p);
 }
 
 
 
 void tip(int ip, int &cx) {
-	/* debug('o1 tip'); */
-	if (ip == 128)  cx = 1;
-	else if (ip == 64)   cx = 2;
-	else if (ip == 32)   cx = 3;
-	else if (ip == 16)   cx = 4;
-	else if (ip == 8)    cx = 5;
-	else if (ip == 4)    cx = 6;
-	else if (ip == 2)    cx = 7;
-	else if (ip == 1)    cx = 8;
+	if (ip == 128)
+		cx = 1;
+	else if (ip == 64)
+		cx = 2;
+	else if (ip == 32)
+		cx = 3;
+	else if (ip == 16)
+		cx = 4;
+	else if (ip == 8)
+		cx = 5;
+	else if (ip == 4)
+		cx = 6;
+	else if (ip == 2)
+		cx = 7;
+	else if (ip == 1)
+		cx = 8;
 }
 
 
 void ecfren(int &p, int &haz, int cf, int l) {
 	/* debug('o1 ecfren'); */
-	if (l == 0)  person();
+	if (l == 0)
+		person();
 	p = -500;
 	haz = 0;
-	if (((l == 1) && (! bh1) && (! bf1))
-	        || ((l == 4) && (! bh4) && (! bf4)))  cpl1(p);
-	if ((l == 2) && (! bh2) && (! bh9))  cpl2(p);
-	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))  cpl3(p);
-	if ((l == 5) && (! bh5))  cpl5(p);
-	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))  cpl6(p);
-	if ((l == 9) && (! bh9) && (! bh2))  p = 10;
-	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))  p = -400;
+	if (((l == 1) && (! bh1) && (! bf1)) || ((l == 4) && (! bh4) && (! bf4)))
+		cpl1(p);
+	if ((l == 2) && (! bh2) && (! bh9))
+		cpl2(p);
+	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))
+		cpl3(p);
+	if ((l == 5) && (! bh5))
+		cpl5(p);
+	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))
+		cpl6(p);
+	if ((l == 9) && (! bh9) && (! bh2))
+		p = 10;
+	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))
+		p = -400;
 	if (p != -500) {
 		p = p + cf;
 		haz = hazard(1, 100);
@@ -915,19 +999,29 @@ void becfren(int l) {
 	if ((l == 1) || (l == 4)) {
 		haz = hazard(1, 2);
 		if (l == 1)
-			if (haz == 1)  bh1 = true;
-			else bf1 = true;
+			if (haz == 1)
+				bh1 = true;
+			else
+				bf1 = true;
 		if (l == 4)
-			if (haz == 1)  bh4 = true;
-			else bf4 = true;
-	}
-	if (l == 2)  bh2 = true;
-	else if (l == 3)  bt3 = true;
-	else if (l == 5)  bh5 = true;
-	else if (l == 6)  bh6 = true;
-	else if (l == 7)  bt7 = true;
-	else if (l == 8)  bh8 = true;
-	else if (l == 9)  bh9 = true;
+			if (haz == 1)
+				bh4 = true;
+			else
+				bf4 = true;
+	} else if (l == 2)
+		bh2 = true;
+	else if (l == 3)
+		bt3 = true;
+	else if (l == 5)
+		bh5 = true;
+	else if (l == 6)
+		bh6 = true;
+	else if (l == 7)
+		bt7 = true;
+	else if (l == 8)
+		bh8 = true;
+	else if (l == 9)
+		bh9 = true;
 }
 
 /* NIVEAU 10 */
@@ -941,7 +1035,7 @@ void init_nbrepm() {
 
 void phaz(int &haz, int &p, int cf) {
 	/* debug('phaz'); */
-	p = p + cf;
+	p += cf;
 	haz = hazard(1, 100);
 }
 
@@ -950,29 +1044,45 @@ void inzon() {
 
 	/* debug('o2 inzon'); */
 	copcha();
-	{
-		s.ipre  = false;
-		s.derobj = 0;
-		s.icave = 0;
-		s.iboul = 0;
-		s.ibag  = 0;
-		s.ipuit = 0;
-		s.ivier = 0;
-		s.iloic = 136;
-		s.icryp = 141;
-		s.conf  = hazard(4, 10);
-		s.mlieu = 21;
-		for (cx = 2; cx <= 6; cx ++) s.sjer[cx] = chr(0);
-		s.sjer[1] = chr(113);
-		s.heure = chr(20);
-		for (cx = 1; cx <= 10; cx ++) s.pourc[cx] = ' ';
-		for (cx = 1; cx <= 6; cx ++) s.teauto[cx] = '*';
-		for (cx = 7; cx <= 9; cx ++) s.teauto[cx] = ' ';
-		for (cx = 10; cx <= 28; cx ++) s.teauto[cx] = '*';
-		for (cx = 29; cx <= 42; cx ++) s.teauto[cx] = ' ';
-		s.teauto[33] = '*';
-	}
-	for (cx = 1; cx <= 8; cx ++) nbrep[cx] = 0;
+
+	s.ipre  = false;
+	s.derobj = 0;
+	s.icave = 0;
+	s.iboul = 0;
+	s.ibag  = 0;
+	s.ipuit = 0;
+	s.ivier = 0;
+	s.iloic = 136;
+	s.icryp = 141;
+	s.conf  = hazard(4, 10);
+	s.mlieu = 21;
+
+	for (cx = 2; cx <= 6; cx ++)
+		s.sjer[cx] = chr(0);
+
+	s.sjer[1] = chr(113);
+	s.heure = chr(20);
+
+	for (cx = 1; cx <= 10; cx ++)
+		s.pourc[cx] = ' ';
+
+	for (cx = 1; cx <= 6; cx ++)
+		s.teauto[cx] = '*';
+
+	for (cx = 7; cx <= 9; cx ++)
+		s.teauto[cx] = ' ';
+
+	for (cx = 10; cx <= 28; cx ++)
+		s.teauto[cx] = '*';
+
+	for (cx = 29; cx <= 42; cx ++)
+		s.teauto[cx] = ' ';
+
+	s.teauto[33] = '*';
+
+	for (cx = 1; cx <= 8; cx ++)
+		nbrep[cx] = 0;
+
 	init_nbrepm();
 }
 
@@ -981,7 +1091,8 @@ void dprog() {
 	li = 21;
 	/* jh:= t_settime(0);*/
 	jh = 0;
-	if (! s.ipre)  blo = true;
+	if (! s.ipre)
+		blo = true;
 	t = ti1;
 	mh = readclock();
 }
@@ -990,12 +1101,13 @@ void pl1(int cf) {
 	int p, haz;
 
 	/* debug('o2 pl1'); */
-	if (((li == 1) && (! bh1) && (! bf1))
-	        || ((li == 4) && (! bh4) && (! bf4))) {
+	if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) {
 		cpl1(p);
 		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq1(li);
+		if (haz > p)
+			person();
+		else
+			quelq1(li);
 	}
 }
 
@@ -1006,8 +1118,10 @@ void pl2(int cf) {
 	if (! bh2) {
 		cpl2(p);
 		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq2();
+		if (haz > p)
+			person();
+		else
+			quelq2();
 	}
 }
 
@@ -1018,8 +1132,10 @@ void pl5(int cf) {
 	if (! bh5) {
 		cpl5(p);
 		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq5();
+		if (haz > p)
+			person();
+		else
+			quelq5();
 	}
 }
 
@@ -1030,8 +1146,10 @@ void pl6(int cf) {
 	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
 		cpl6(p);
 		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq6(li);
+		if (haz > p)
+			person();
+		else
+			quelq6(li);
 	}
 }
 
@@ -1042,8 +1160,10 @@ void pl9(int cf) {
 	if (! bh9) {
 		cf = -10;
 		phaz(haz, p, cf);
-		if (haz > p)  person();
-		else quelq2();
+		if (haz > p)
+			person();
+		else
+			quelq2();
 	}
 }
 
@@ -1053,8 +1173,10 @@ void pl10(int cf) {
 	/* debug('o2 pl10'); */
 	cpl10(p, h);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq10(h, p);
+	if (haz > p)
+		person();
+	else
+		quelq10(h, p);
 }
 
 void pl11(int cf) {
@@ -1063,8 +1185,10 @@ void pl11(int cf) {
 	/* debug('o2 pl11'); */
 	cpl11(p, h);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq11(h, p);
+	if (haz > p)
+		person();
+	else
+		quelq11(h, p);
 }
 
 void pl12(int cf) {
@@ -1073,8 +1197,10 @@ void pl12(int cf) {
 	/* debug('o2 pl12'); */
 	cpl12(p);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq12(p);
+	if (haz > p)
+		person();
+	else
+		quelq12(p);
 }
 
 void pl13(int cf) {
@@ -1083,8 +1209,10 @@ void pl13(int cf) {
 	/* debug('o2 pl13'); */
 	cpl13(p);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq12(p);
+	if (haz > p)
+		person();
+	else
+		quelq12(p);
 }
 
 void pl15(int cf) {
@@ -1093,8 +1221,10 @@ void pl15(int cf) {
 	/* debug('o2 pl15'); */
 	cpl15(p);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq15(p);
+	if (haz > p)
+		person();
+	else
+		quelq15(p);
 }
 
 void pl20(int cf) {
@@ -1103,8 +1233,10 @@ void pl20(int cf) {
 	/* debug('o2 pl20'); */
 	cpl20(p, h);
 	phaz(haz, p, cf);
-	if (haz > p)  person();
-	else quelq20(h, p);
+	if (haz > p)
+		person();
+	else
+		quelq20(h, p);
 }
 
 void t11(int l11, int &a) {
@@ -1113,7 +1245,7 @@ void t11(int l11, int &a) {
 	/* debug('o2 t11'); */
 	ecfren(p, haz, s.conf, l11);
 	li = l11;
-	if ((l11 > 0) && (l11 < 10))
+	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
 			if (haz > p) {
 				person();
@@ -1122,46 +1254,63 @@ void t11(int l11, int &a) {
 				becfren(li);
 				nouvp(li, a);
 			}
-		} else nouvp(li, a);
-	if (l11 > 9)
-		if ((l11 > 15) && (l11 != 20) && (l11 != 26))  person();
+		} else
+			nouvp(li, a);
+	}
+
+	if (l11 > 9) {
+		if ((l11 > 15) && (l11 != 20) && (l11 != 26))
+			person();
 		else {
-			if (l11 == 10)  cpl10(p, h);
-			if (l11 == 11)  cpl11(p, h);
-			if (l11 == 12)  cpl12(p);
-			if ((l11 == 13) || (l11 == 14))  cpl13(p);
-			if ((l11 == 15) || (l11 == 26))  cpl15(p);
-			if (l11 == 20)  cpl20(p, h);
+			if (l11 == 10)
+				cpl10(p, h);
+			if (l11 == 11)
+				cpl11(p, h);
+			if (l11 == 12)
+				cpl12(p);
+			if ((l11 == 13) || (l11 == 14))
+				cpl13(p);
+			if ((l11 == 15) || (l11 == 26))
+				cpl15(p);
+			if (l11 == 20)
+				cpl20(p, h);
 			p = p + s.conf;
 			haz = hazard(1, 100);
 			if (haz > p) {
 				person();
 				a = 0;
 			} else {
-				if (l11 == 10)  quelq10(h, p);
-				if (l11 == 11)  quelq11(h, p);
-				if ((l11 == 12) || (l11 == 13) || (l11 == 14))  quelq12(p);
-				if ((l11 == 15) || (l11 == 26))  quelq15(p);
-				if (l11 == 20)  quelq20(h, p);
+				if (l11 == 10)
+					quelq10(h, p);
+				if (l11 == 11)
+					quelq11(h, p);
+				if ((l11 == 12) || (l11 == 13) || (l11 == 14))
+					quelq12(p);
+				if ((l11 == 15) || (l11 == 26))
+					quelq15(p);
+				if (l11 == 20)
+					quelq20(h, p);
 				a = p;
 			}
 		}
+	}
 }
 
-void cavegre()
-
-{
+void cavegre() {
 	int haz;
 
 	/* debug('cavegre'); */
 	s.conf = s.conf + 2;
-	if (s.conf > 69)  s.conf = s.conf + (s.conf / 10);
+	if (s.conf > 69)
+		s.conf += (s.conf / 10);
 	clsf3();
 	ecrf2();
 	ecr3(g_vm->getString(S_SOMEONE_ENTERS));
 	haz = (hazard(0, 4)) - 2;
 	parole(2, haz, 1);
-	for (haz = 0; haz <= 3000; haz ++);
+
+	// Useless?
+	for (haz = 0; haz <= 3000; haz++);
 	clsf3();
 	person();
 }
@@ -1183,15 +1332,21 @@ void messint(int nu) {
 }
 
 void aniof(int ouf, int num) {
-	int ad, offset;
+	if ((caff == 7) && ((num == 4) || (num == 5)))
+		return;
+	
+	if ((caff == 10) && (num == 7))
+		num = 6;
+
+	if (caff == 12) {
+		if (num == 3)
+			num = 4;
+		else if (num == 4)
+			num = 3;
+	}
 
-	/* debug('aniof'); */
-	if ((caff == 7) && ((num == 4) || (num == 5)))  return;
-	if ((caff == 10) && (num == 7))  num = 6;
-	if (caff == 12)  if (num == 3)  num = 4;
-		else if (num == 4)  num = 3;
-	ad = adani;
-	offset = animof(ouf, num);
+	int ad = adani;
+	int offset = animof(ouf, num);
 
 	GfxSurface surface;
 	surface.decode(&mem[ad * 16 + offset]);
@@ -1209,7 +1364,7 @@ void musique(int so) {
 		;
 	} else if ((prebru == 0) && (! s.ipre)) {
 		parole(10, 1, 1);
-		prebru = prebru + 1;
+		++prebru;
 	} else {
 		i = false;
 		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
@@ -1247,15 +1402,13 @@ void musique(int so) {
 
 /* NIVEAU 9 */
 void dessin(int ad) {
-	int cx;
-
-	/* debug('dessin'); */
-	if (ad != 0)  dessine(ades, ((ad % 160) * 2), (ad / 160));
+	if (ad != 0)
+		dessine(ades, ((ad % 160) * 2), (ad / 160));
 	else {
 		clsf1();
 		if (caff > 99) {
 			dessine(ades, 60, 33);
-			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         /* cadre moyen */          //Translation: Medium box
+			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 		} else if (caff > 69) {
 			dessine(ades, 112, 48);           /* tˆtes */                    //Translation: Heads
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
@@ -1263,17 +1416,30 @@ void dessin(int ad) {
 			dessine(ades, 0, 12);
 			ecrf1();
 			if ((caff < 30) || (caff > 32)) {
-				for (cx = 1; cx <= 6; cx ++)
-					if (ord(touv[cx]) != 0)  aniof(1, ord(touv[cx]));
+				for (int cx = 1; cx <= 6; cx ++) {
+					if (ord(touv[cx]) != 0)
+						aniof(1, ord(touv[cx]));
+				}
+
 				if (caff == 13) {
-					if (s.iboul == 141)  aniof(1, 7);
-					if (s.ibag == 159)  aniof(1, 6);
+					if (s.iboul == 141)
+						aniof(1, 7);
+
+					if (s.ibag == 159)
+						aniof(1, 6);
 				}
-				if ((caff == 14) && (s.icave == 151))  aniof(1, 2);
-				if ((caff == 17) && (s.ivier == 143))  aniof(1, 1);
-				if ((caff == 24) && (s.ipuit != 0))  aniof(1, 1);
+				if ((caff == 14) && (s.icave == 151))
+					aniof(1, 2);
+
+				if ((caff == 17) && (s.ivier == 143))
+					aniof(1, 1);
+
+				if ((caff == 24) && (s.ipuit != 0))
+					aniof(1, 1);
 			}
-			if (caff < 26)  musique(1);
+			
+			if (caff < 26)
+				musique(1);
 		}
 	}
 }
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 15d413d..73259aa 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -62,8 +62,9 @@ void tinke() {
 		jou = j;
 		cx = 0;
 		do {
-			cx = cx + 1;
-			if (nbrepm[cx] != 0)  nbrepm[cx] = nbrepm[cx] - 1;
+			++cx;
+			if (nbrepm[cx] != 0)
+				--nbrepm[cx];
 			nbrep[cx] = 0;
 		} while (!(cx == 8));
 	}
@@ -72,9 +73,15 @@ void tinke() {
 		min = 0;
 		pendule();
 		cf = 0;
-		for (cx = 1; cx <= 10; cx ++) if (s.pourc[cx] == '*')  cf = cf + 1;
-		if (cf == 10)  stpo = "10";
-		else stpo = chr(cf + 48);
+		for (cx = 1; cx <= 10; cx ++) {
+			if (s.pourc[cx] == '*')
+				++cf;
+		}
+
+		if (cf == 10)
+			stpo = "10";
+		else
+			stpo = chr(cf + 48);
 
 		stpou = Common::String(d3);
 		stpou += d5;
@@ -93,14 +100,21 @@ void tinke() {
 		min = 30;
 		pendule();
 	}
-	if (y_s < 12)  return;
+	if (y_s < 12)
+		return;
+
 	if (! blo) {
 		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
 			t = ti2;
-		else t = ti1;
+		else
+			t = ti1;
 		cf = s.conf;
-		if ((cf > 33) && (cf < 66))  t = t - (t / 3);
-		if (cf > 65)  t = t - ((t / 3) * 2);
+		if ((cf > 33) && (cf < 66))
+			t = t - (t / 3);
+
+		if (cf > 65)
+			t = t - ((t / 3) * 2);
+
 		nh = readclock();
 		if ((nh - mh) > t) {
 			am = g_vm->_menu._menuActive;
@@ -146,9 +160,12 @@ void tinke() {
 				pl20(cf);
 				break;
 			}
-			if ((mpers != 0) && (ipers != 10))  mpers = ipers;
+			if ((mpers != 0) && (ipers != 10))
+				mpers = ipers;
+
 			if ((mpers == 0) && (ipers > 0))
-				if ((s.mlieu == 13) || (s.mlieu == 14))  cavegre();
+				if ((s.mlieu == 13) || (s.mlieu == 14))
+					cavegre();
 				else if (ipers == 10) {
 					ipers = 0;
 					if (! brt) {
@@ -174,7 +191,8 @@ void tinke() {
 		nouvp(li, cx);
 		brt = false;
 		hdb = 0;
-		if ((s.mlieu > 0) && (s.mlieu < 10))  anyone = true;
+		if ((s.mlieu > 0) && (s.mlieu < 10))
+			anyone = true;
 	}
 }
 
@@ -209,14 +227,18 @@ void tkey1(bool d) {
 
 	hideMouse();
 	fenat('K');
-	while (keypressed())  key = testou();
+	while (keypressed())
+		key = testou();
+
 	do {
-		if (d)  tinke();
+		if (d)
+			tinke();
 		quest = keypressed();
 		getMousePos(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && anyone)));
-	if (quest)  key = testou();
+	if (quest)
+		key = testou();
 	g_vm->setMouseClick(false);
 	showMouse();
 }
@@ -227,18 +249,21 @@ void tmlieu(int mli) {
 	char st[1410];
 
 
-	if (mli == 26)  mli = 15;
+	if (mli == 26)
+		mli = 15;
+
 	i = 1;
 	while ((i < 8) && (v_lieu[i][mli] != 0)) {
 		cx = v_lieu[i][mli];
 		deline(cx + c_tmlieu, st, tail);
 		nomp = delig;
-		while (nomp.size() < 20)  nomp = nomp + ' ';
+		while (nomp.size() < 20)
+			nomp += ' ';
 		g_vm->_menu.menut(g_vm->_menu._depl[i], nomp);
-		i = i + 1;
+		++i;
 	}
 	nomp = "*                   ";
-	for (cx = 7; cx >= i; cx --)
+	for (cx = 7; cx >= i; cx--)
 		g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp);
 }
 
@@ -267,9 +292,7 @@ void affrep() {
 	crep = s.mlieu;
 }
 
-void mfouen()
-
-{
+void mfouen() {
 	int cx;
 
 	tmlieu(s.mlieu);
@@ -304,12 +327,16 @@ void tperd() {
 }
 
 void tsort() {
-	int cx;
 
-	if ((iouv > 0) && (s.mlieu != 0))
-		if (s.conf < 50)  s.conf = s.conf + 2;
-		else s.conf = s.conf + (s.conf / 10);
-	for (cx = 1; cx <= 7; cx ++) touv[cx] = chr(0);
+	if ((iouv > 0) && (s.mlieu != 0)) {
+		if (s.conf < 50)
+			s.conf += 2;
+		else
+			s.conf += (s.conf / 10);
+	}
+
+	for (int cx = 1; cx <= 7; cx ++)
+		touv[cx] = chr(0);
 	ment = 0;
 	iouv = 0;
 	mchai = 0;
@@ -318,6 +345,7 @@ void tsort() {
 
 void st4(int ob) {
 	crep = 997;
+
 	switch (ob) {
 	case 114 :
 		crep = 109;
@@ -340,6 +368,8 @@ void st4(int ob) {
 	case 161 :
 		tlu(caff, ob);
 		break;
+	default:
+		break;
 	}
 }
 
@@ -347,8 +377,11 @@ void cherjer(int ob, bool &d) {
 	int cx;
 
 	d = false;
-	for (cx = 1; cx <= 6; cx ++) d = (d || (ord(s.sjer[cx]) == ob));
-	if (s.derobj == ob)  d = true;
+	for (cx = 1; cx <= 6; cx++)
+		d = (d || (ord(s.sjer[cx]) == ob));
+
+	if (s.derobj == ob)
+		d = true;
 }
 
 void st1sama() {
@@ -357,12 +390,12 @@ void st1sama() {
 }
 
 void modinv() {
-	int cx, cy, tay, r;
+	int tay, r;
 	char nom[1410];
 	Common::String nomp;
 
-	cy = 0;
-	for (cx = 1; cx <= 6; cx ++)
+	int cy = 0;
+	for (int cx = 1; cx <= 6; cx++)
 		if (s.sjer[cx] != chr(0)) {
 			cy = succ(int, cy);
 			r = (ord(s.sjer[cx]) + 400);
@@ -372,7 +405,7 @@ void modinv() {
 			g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]);
 		}
 	if (cy < 6)
-		for (cx = cy + 1; cx <= 6; cx ++) {
+		for (int cx = cy + 1; cx <= 6; cx++) {
 			g_vm->_menu.menut(g_vm->_menu._invt[cx], "                       ");
 			g_vm->_menu.disableMenuItem(g_vm->_menu._invt[cx]);
 		}
@@ -408,11 +441,10 @@ void finfouil() {
 }
 
 void mfoudi() {
-	int cx;
-
-	for (cx = 1; cx <= 7; cx ++) 
+	for (int cx = 1; cx <= 7; cx++) 
 		g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]);
-	for (cx = 1; cx <= 11; cx ++)
+
+	for (int cx = 1; cx <= 11; cx++)
 		g_vm->_menu.disableMenuItem(men[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_SUITE));
@@ -430,45 +462,47 @@ void premtet() {
 
 /* NIVEAU 5 */
 void ajchai() {
-	int cx, cy, lderobj;
 
 
-	cy = (acha + pred(int, pred(int, mchai) * 10));
-	cx = 0;
+	int cy = (acha + pred(int, pred(int, mchai) * 10));
+	int cx = 0;
 	do {
-		cx = cx + 1;
+		++cx;
 	} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
+
 	if (tabdon[cy + cx] == 0) {
-		lderobj = s.derobj;
+		int lderobj = s.derobj;
 		tabdon[cy + cx] = lderobj;
-	} else crep = 192;
+	} else
+		crep = 192;
 }
 
 void ajjer(int ob) {
-	int cx;
-
-	cx = 0;
+	int cx = 0;
 	do {
-		cx = cx + 1;
+		++cx;
 	} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
+
 	if (ord(s.sjer[cx]) == 0) {
 		s.sjer[(cx)] = chr(ob);
 		modinv();
-	} else crep = 139;
+	} else
+		crep = 139;
 }
 
-void t1sama() {    /* On entre dans le manoir */                 //Translation: Entering manor
+void t1sama() {    //Entering manor
 	int j, h, m;
 	bool d;
 
 	calch(j, h, m);
 	if ((h < 5) && (s.mlieu > 18)) {
 		cherjer(137, d);
-		if (! d) {        /* On n'a pas les cl‚s et il est tard */   //Translation: You don't have the keys, and it's late
+		if (!d) {        /* On n'a pas les cl‚s et il est tard */   //Translation: You don't have the keys, and it's late
 			crep = 1511;
 			tperd();
-		} else st1sama();
-	} else if (! s.ipre) {     /* c'est votre premiŠre fois ? */   //Translation: Is it your first time?
+		} else
+			st1sama();
+	} else if (!s.ipre) {     /* c'est votre premiŠre fois ? */   //Translation: Is it your first time?
 		ipers = 255;
 		affper(ipers);
 		caff = 77;
@@ -487,12 +521,14 @@ void t1sama() {    /* On entre dans le manoir */                 //Translation:
 		s.mlieu = 0;
 		affrep();
 		t5(10);
-		if (! blo)  t11(0, m);
+		if (! blo)
+			t11(0, m);
 		ipers = 0;
 		mpers = 0;
 		s.ipre = true;
 		/*chech;*/
-	} else  st1sama();
+	} else
+		st1sama();
 }
 
 void t1vier() {
@@ -501,7 +537,7 @@ void t1vier() {
 }
 
 void t1neig() {
-	inei = inei + 1;
+	++inei;
 	if (inei > 2) {
 		crep = 1506;
 		tperd();
@@ -543,20 +579,26 @@ void quelquun() {
 	crep = 997;
 L1:
 	if (! cache) {
-		if (crep == 997)  crep = 138;
+		if (crep == 997)
+			crep = 138;
 		repon(2, crep);
-		if (crep == 138)  parole(5, 2, 1);
-		else parole(4, 4, 1);
-		if (iouv == 0)  s.conf = s.conf + 2;
-		else if (s.conf < 50)  s.conf = s.conf + 4;
+		if (crep == 138)
+			parole(5, 2, 1);
 		else
-			s.conf = s.conf + (3 * (s.conf / 10));
+			parole(4, 4, 1);
+
+		if (iouv == 0)
+			s.conf += 2;
+		else if (s.conf < 50)
+			s.conf += 4;
+		else
+			s.conf += 3 * (s.conf / 10);
 		tsort();
 		tmlieu(15);
 		tip(ipers, cx);
 		caff = 69 + cx;
 		crep = caff;
-		msg[3] = discut;
+		msg[3] = MENU_DISCUSS;
 		msg[4] = g_vm->_menu._disc[cx];
 		syn = true;
 		col = true;
@@ -581,35 +623,39 @@ L1:
 }
 
 void tsuiv() {
-	int cx, tbcl;
-	int cl, cy;
+	int tbcl;
+	int cl;
 
-	cy = acha + ((mchai - 1) * 10) - 1;
-	cx = 0;
+	int cy = acha + ((mchai - 1) * 10) - 1;
+	int cx = 0;
 	do {
 		cx = cx + 1;
 		cs = cs + 1;
 		cl = cy + cs;
 		tbcl = tabdon[cl];
 	} while (!((tbcl != 0) || (cs > 9)));
+
 	if ((tbcl != 0) && (cs < 11)) {
 		is = is + 1;
 		caff = tbcl;
 		crep = caff + 400;
-		if (ipers != 0)  s.conf = s.conf + 2;
+		if (ipers != 0)
+			s.conf = s.conf + 2;
 	} else {
 		affrep();
 		finfouil();
-		if (cx > 9)  crep = 131;
+		if (cx > 9)
+			crep = 131;
 	}
 }
 
 void tfleche() {
 	bool qust;
 	char touch;
-	int dummy;
 
-	if (num == 9999)  return;
+	if (num == 9999)
+		return;
+
 	fenat(chr(152));
 	rect = false;
 	do {
@@ -624,19 +670,20 @@ void tfleche() {
 			tinke();
 		} while (!(qust || rect || anyone));
 
-		if (qust && (touch == '\103'))  dummy = Alert::show(stpou, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) ||
-	           (anyone) || (rect)));
-	if (touch == '\73')  iesc = true;
+		if (qust && (touch == '\103'))
+			Alert::show(stpou, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) || (anyone) || (rect)));
+
+	if (touch == '\73')
+		iesc = true;
+
 	if (rect) {
 		x = x_s;
 		y = y_s;
 	}
 }
 
-void tcoord(int sx)
-
-{
+void tcoord(int sx) {
 	int sy, ix, iy, cb, cy, ib;
 	int a, b, atdon;
 
@@ -647,50 +694,65 @@ void tcoord(int sx)
 	atdon = amzon + 3;
 	cy = 0;
 	while (cy < caff) {
-		a = a + tabdon[atdon];
-		atdon = atdon + 4;
+		a += tabdon[atdon];
+		atdon += 4;
 		cy = succ(int, cy);
 	}
 
 	b = tabdon[atdon];
-	if (b == 0)  goto L1;
-	a = a + fleche;
+	if (b == 0)
+		goto L1;
+	a += fleche;
 	cb = 0;
-	for (cy = 0; cy <= (sx - 2); cy ++) {
+	for (cy = 0; cy <= (sx - 2); cy++) {
 		ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
-		cb = cb + (ib * 4) + 2;
+		cb += (ib * 4) + 2;
 	}
 	ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
-	if (ib == 0)  goto L1;
+	if (ib == 0)
+		goto L1;
+
 	cy = 1;
 	do {
-		cb = cb + 2;
+		cb += 2;
 		sx = tabdon[a + cb] * res;
 		sy = tabdon[succ(int, a + cb)];
-		cb = cb + 2;
+		cb += 2;
 		ix = tabdon[a + cb] * res;
 		iy = tabdon[succ(int, a + cb)];
-		cy = cy + 1;
-	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
-	           || (cy > ib)));
-	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy))
+		++cy;
+	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib)));
 
-	{
+	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy)) {
 		num = cy - 1;
 		return;
 	}
+
 L1:
 	crep = 997;
 }
 
 
 void st7(int ob) {
-	crep = 183;
-	if ((ob == 116) || (ob == 144))  crep = 104;
-	if ((ob == 126) || (ob == 111))  crep = 108;
-	if (ob == 132)  crep = 111;
-	if (ob == 142)  crep = 112;
-	if (crep == 183)  st4(ob);
+	switch (ob) {
+	case 116:
+	case 144:
+		crep = 104;
+		break;
+	case 126:
+	case 111:
+		crep = 108;
+		break;
+	case 132:
+		crep = 111;
+		break;
+	case 142:
+		crep = 112;
+		break;
+	default:
+		crep = 183;
+		st4(ob);
+	}
 }
 
 void treg(int ob) {
@@ -698,11 +760,12 @@ void treg(int ob) {
 
 	mdes = caff;
 	caff = ob;
-	if (((caff > 29) && (caff < 33)) || (caff == 144) ||
-	        (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
+	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
 		afdes(0);
-		if ((caff > 29) && (caff < 33))  repon(2, caff);
-		else repon(2, (caff + 400));
+		if ((caff > 29) && (caff < 33))
+			repon(2, caff);
+		else
+			repon(2, (caff + 400));
 		tkey1(true);
 		caff = mdes;
 		msg[3] = 0;
@@ -716,7 +779,8 @@ void treg(int ob) {
 
 void avpoing(int &ob) {
 	crep = 999;
-	if (s.derobj != 0)  ajjer(s.derobj);
+	if (s.derobj != 0)
+		ajjer(s.derobj);
 	if (crep != 139) {
 		modobj(ob + 400);
 		s.derobj = ob;
@@ -728,7 +792,8 @@ void rechai(int &ch) {
 	int cx;
 
 	cx = s.mlieu;
-	if (s.mlieu == 16)  cx = 14;
+	if (s.mlieu == 16)
+		cx = 14;
 	ch = tabdon[achai + (cx * 7) + pred(int, num)];
 }
 
@@ -737,7 +802,7 @@ void t23coul(int &l) {
 
 	cherjer(143, d);
 	l = 14;
-	if (! d) {
+	if (!d) {
 		crep = 1512;
 		tperd();
 	}
@@ -750,17 +815,17 @@ void maivid() {
 
 void st13(int ob) {
 	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
-	        (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
-	        (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
-	        (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
-	        (ob == 150) || (ob == 152))  crep = 999;
-	else crep = 105;
+	    (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
+	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
+	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
+	    (ob == 150) || (ob == 152))
+		crep = 999;
+	else
+		crep = 105;
 }
 
 void aldepl() {
-	int dummy;
-
-	dummy = Alert::show(g_vm->getString(S_USE_DEP_MENU), 1);
+	Alert::show(g_vm->getString(S_USE_DEP_MENU), 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 4f2cade..82b8ad3 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -129,6 +129,11 @@ void deline(int num, char *l , int &tl) {
 	byte ps, k;
 	bool the_end;
 
+	if (num < 0) {
+		warning("deline: num < 0! Skipping");
+		return;
+	}
+
 	/* DETEX */
 	/*debug('  => DeLine');*/
 	delig = "";
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 2ee26a9..f478fc0 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -163,7 +163,8 @@ void tsitu()
 		}
 	if (msg[3] == MENU_MOVE)
 		fctMove();
-	if (msg[3] == discut)      tparler();   //Translation: talk
+	if (msg[3] == MENU_DISCUSS)
+		fctDiscuss();
 	if (msg[3] == invent)      tsprendre(); //Translation: inventory/take
 	if (msg[4] == OPCODE_ATTACH)
 		fctAttach();
@@ -213,7 +214,8 @@ void tsitu()
 	}
 	if (msg[4] == sfouiller)   tsfouiller();//Translation: search 
 	if (msg[4] == slire)       tslire();    //Translation: read
-	if (msg[4] == sposer)      tposer();    //Translation: put
+	if (msg[4] == OPCODE_PUT)
+		fctPut();
 	if (msg[4] == sregarder)   tsregarder();//Translation: look
 	cache = false;
 L1:
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 7a3249d..e8f9282 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -136,11 +136,10 @@ enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,
 			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,  OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
 			OPCODE_TURN = 0x315};
 
-enum verbs2 {OPCODE_HIDE_SELF = 0x401};
+enum verbs2 {OPCODE_HIDE_SELF = 0x401, OPCODE_PUT = 0x404};
 
 const int sfouiller = 0x402;
 const int slire = 0x403;
-const int sposer = 0x404;
 const int sregarder = 0x405;
 
 const int max_patt = 20;


Commit: d6ee8f088af6fe0cf021f23aaedf349ea6669b8c
    https://github.com/scummvm/scummvm/commit/d6ee8f088af6fe0cf021f23aaedf349ea6669b8c
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:39-07:00

Commit Message:
MORTEVIELLE: Rename some more variables and functions

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6621517..975992e 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -621,7 +621,6 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	int quel;
 	bool entre;
 	char st[1410];
 	Common::String str_;
@@ -669,8 +668,8 @@ void fctPlace() {
 					repon(2, 165);
 					maivid();
 					parole(6, -9, 1);
-					quel = Alert::show(g_vm->getString(S_YES_NO), 1);
-					if (quel == 1)  {
+					int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+					if (answer== 1)  {
 						deline(582, st, tay);
 						i = Alert::show(delig, 1);
 						tesok = false;
@@ -682,7 +681,7 @@ void fctPlace() {
 						clsf3();
 						showMouse();
 						tinke();
-						pendule();
+						drawClock();
 						if (ipers != 0)
 							affper(ipers);
 						else 
@@ -745,8 +744,6 @@ void fctPlace() {
  * @remarks	Originally called 'ttourner'
  */
 void fctTurn() {
-	int quel;
-
 	if (caff > 99) {
 		crep = 149;
 		return;
@@ -762,8 +759,8 @@ void fctTurn() {
 		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
-			quel = Alert::show(g_vm->getString(S_YES_NO), 1);
-			if (quel == 1)
+			int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+			if (answer == 1)
 				g_vm->_endGame = true;
 			else
 				crep = 168;
@@ -772,8 +769,8 @@ void fctTurn() {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
-			quel = Alert::show(g_vm->getString(S_YES_NO), 1);
-			if (quel == 1) {
+			int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+			if (answer == 1) {
 				s.mlieu = 16;
 				affrep();
 			} else
@@ -1137,7 +1134,7 @@ void fctEnter() {
  * @remarks	Originally called 'tdormir'
  */
 void fctSleep() {
-	int z, j, h, m, quel;
+	int z, j, h, m;
 
 	if ((s.mlieu > 15) && (s.mlieu < 26)) {
 		crep = 148;
@@ -1156,6 +1153,8 @@ void fctSleep() {
 	ecrf2();
 	ecr2(g_vm->getString(S_WANT_TO_WAKE_UP));
 	calch(j, h, m);
+
+	int answer;
 	do {
 		if (h < 8) {
 			s.conf = s.conf - (s.conf / 20);
@@ -1170,9 +1169,9 @@ void fctSleep() {
 		if (h > 23)
 			h = 0;
 		tinke();
-		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
+		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
 		anyone = false;
-	} while (!(quel == 1));
+	} while (!(answer == 1));
 	crep = 998;
 	num = 0;
 }
@@ -1240,6 +1239,8 @@ void fctWait() {
 
 	mpers = 0;
 	clsf3();
+
+	int answer;
 	do {
 		++jh;
 		tinke();
@@ -1257,8 +1258,8 @@ void fctWait() {
 			return;
 		}
 		repon(2, 102);
-		quel = Alert::show(g_vm->getString(S_YES_NO), 1);
-	} while (!(quel == 2));
+		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+	} while (!(answer == 2));
 	crep = 998;
 	if (!anyone)
 		tinke();
@@ -1472,7 +1473,7 @@ void fctDiscuss() {
 	showMouse();
 	affper(ipers);
 	tinke();
-	pendule();
+	drawClock();
 	affrep();
 	/* chech;*/
 	tmlieu(s.mlieu);
@@ -1551,7 +1552,7 @@ void MortevielleEngine::endGame() {
  * @remarks	Originally called 'tencore'
  */
 void MortevielleEngine::loseGame() {
-	int quel;
+	int answer;
 
 	clsf2();
 	musique(0);
@@ -1562,12 +1563,12 @@ void MortevielleEngine::loseGame() {
 	vh = 10;
 	vm = 0;
 	vj = 0;
-	min = 0;
-	heu = 10;
-	jou = 0;
+	_minute = 0;
+	_hour = 10;
+	_day = 0;
 	repon(2, 180);
-	quel = Alert::show(g_vm->getString(S_YES_NO), 1);
-	_quitGame = (quel != 1);
+	answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+	_quitGame = (answer != 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 1c0a4fa..e26901b 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1098,7 +1098,7 @@ int ScreenSurface::getStringWidth(const Common::String &s) {
 	return s.size() * charWidth;
 }
 
-void ScreenSurface::droite(int x, int y, int xx, int yy, int coul) {
+void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 	int step, i;
 	float a, b;
 	float xr, yr, xro, yro;
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 1aab4cf..28a9d64 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -92,7 +92,7 @@ public:
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void writeg(const Common::String &l, int c);
 	int getStringWidth(const Common::String &s);
-	void droite(int x, int y, int xx, int yy, int coul);
+	void drawLine(int x, int y, int xx, int yy, int coul);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index bf9a480..a428340 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -618,7 +618,7 @@ void chlm(int &per) {
 	if (per == 2)  per = 128;
 }
 
-void pendule() {
+void drawClock() {
 	const int cv[3][13] = {
 		{ 0,  0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0 },
 		{ 0,  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
@@ -638,30 +638,30 @@ void pendule() {
 		co = 0;
 	else co = 1;
 
-	if (min == 0)
-		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
+	if (_minute == 0)
+		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
 	else 
-		g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
+		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
 
-	h = heu;
+	h = _hour;
 	if (h > 12)
 		h -= 12;
 	if (h == 0)
 		h = 12;
 
-	g_vm->_screenSurface.droite(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 
-	if (heu > 11)
+	if (_hour > 11)
 		g_vm->_screenSurface.writeg("PM ", 1);
 	else
 		g_vm->_screenSurface.writeg("AM ", 1);
 
 	g_vm->_screenSurface.putxy(550, 160);
-	if ((jou >= 0) && (jou <= 8)) {
+	if ((_day >= 0) && (_day <= 8)) {
 		Common::String tmp = g_vm->getString(S_DAY);
-		tmp.insertChar((char)(jou + 49), 0);
+		tmp.insertChar((char)(_day + 49), 0);
 		g_vm->_screenSurface.writeg(tmp, 1);
 	}
 }
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 2287924..0351bd0 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -72,7 +72,7 @@ extern void cpl5(int &p);
 extern void cpl6(int &p);
 extern void person();
 extern void chlm(int &per);
-extern void pendule();
+extern void drawClock();
 /*************
  * NIVEAU 11 *
  *************/
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 73259aa..9dcbb85 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -58,8 +58,8 @@ void tinke() {
 
 	anyone = false;
 	calch(j, h, m);
-	if (j != jou) {
-		jou = j;
+	if (j != _day) {
+		_day = j;
 		cx = 0;
 		do {
 			++cx;
@@ -68,10 +68,10 @@ void tinke() {
 			nbrep[cx] = 0;
 		} while (!(cx == 8));
 	}
-	if ((h > heu) || ((h == 0) && (heu == 23))) {
-		heu = h;
-		min = 0;
-		pendule();
+	if ((h > _hour) || ((h == 0) && (_hour == 23))) {
+		_hour = h;
+		_minute = 0;
+		drawClock();
 		cf = 0;
 		for (cx = 1; cx <= 10; cx ++) {
 			if (s.pourc[cx] == '*')
@@ -96,9 +96,9 @@ void tinke() {
 		stpou += d6;
 		stpou += d4;
 	}
-	if (m > min) {
-		min = 30;
-		pendule();
+	if (m > _minute) {
+		_minute = 30;
+		drawClock();
 	}
 	if (y_s < 12)
 		return;
@@ -110,16 +110,16 @@ void tinke() {
 			t = ti1;
 		cf = s.conf;
 		if ((cf > 33) && (cf < 66))
-			t = t - (t / 3);
+			t -= (t / 3);
 
 		if (cf > 65)
-			t = t - ((t / 3) * 2);
+			t -= ((t / 3) * 2);
 
 		nh = readclock();
 		if ((nh - mh) > t) {
 			am = g_vm->_menu._menuActive;
 			g_vm->_menu.eraseMenu();
-			jh = jh + ((nh - mh) / t);
+			jh += ((nh - mh) / t);
 			mh = nh;
 			switch (li) {
 			case 1:
@@ -516,7 +516,7 @@ void t1sama() {    //Entering manor
 		premtet();
 		sparl(0, 140);
 		dessine_rouleau();
-		pendule();
+		drawClock();
 		showMouse();
 		s.mlieu = 0;
 		affrep();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index f478fc0..e6fd9b7 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -46,7 +46,7 @@ void change_gd(int ngd) {
 	showMouse();
 	dessine_rouleau();
 	tinke();
-	pendule();
+	drawClock();
 	if (ipers != 0)  affper(ipers);
 	else person();
 	clsf2();
@@ -122,7 +122,7 @@ void MortevielleEngine::gameLoaded() {
 	}
 	person();
 	tinke();
-	pendule();
+	drawClock();
 	afdes(0);
 	repon(2, crep);
 	clsf3();
@@ -254,9 +254,11 @@ void theure() {
 	vj = vj / 48;
 	vm = vh % 2;
 	vh = vh / 2;
-	heu = vh;
-	if (vm == 1)  min = 30;
-	else min = 0;
+	_hour = vh;
+	if (vm == 1)
+		_minute = 30;
+	else
+		_minute = 0;
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0caadad..6f88d8d 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -127,10 +127,10 @@ int x,
         gd,                /*  Gd = graph device  */
         hdb,
         hfb,
-        heu,
-        jou,
+        _hour,
+        _day,
         key,
-        min,
+        _minute,
         num,
         max,
         res,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index e8f9282..f5cd3af 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -276,10 +276,10 @@ extern int x,
         gd,                /*  Gd = graph device  */
         hdb,
         hfb,
-        heu,
-        jou,
+        _hour,
+        _day,
         key,
-        min,
+        _minute,
         num,
         max,
         res,


Commit: 6c2e66273164ccc38c212d852df0ea7fdc041452
    https://github.com/scummvm/scummvm/commit/6c2e66273164ccc38c212d852df0ea7fdc041452
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:40-07:00

Commit Message:
MORTEVIELLE: Some more code formatting, rename sonoff

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 8965845..9f90f4c 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -258,7 +258,7 @@ void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String
 
 	i = 1;
 	x = coldep;
-	for (l = 1; l <= nbcase; l ++) {
+	for (l = 1; l <= nbcase; ++l) {
 		str[l] = "";
 		do {
 			++i;
@@ -323,7 +323,7 @@ bool Ques::show() {
 		y = 35;
 		tmax = 0;
 		memk = 1;
-		for (j = prem; j <= der; j ++) {
+		for (j = prem; j <= der; ++j) {
 			deline(j, st, tay);
 			if (tay > tmax)
 				tmax = tay;
@@ -332,7 +332,7 @@ bool Ques::show() {
 			++memk;
 			y += 8;
 		}
-		for (j = 1; j <= succ(int, der - prem); j++) {
+		for (j = 1; j <= succ(int, der - prem); ++j) {
 			rectangle &with = coor[j];
 
 			with.x1 = 45 * res;
@@ -364,7 +364,7 @@ bool Ques::show() {
 			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
 			if (coor[k].etat) {
 				if ((memk != 0) && (memk != k)) {
-//					for (j = 1; j <= tmax; j ++)
+//					for (j = 1; j <= tmax; ++j)
 //						st[j] = chaines[memk][j];
 					strncpy(st, chaines[memk].c_str(), tmax);
 //
@@ -372,7 +372,7 @@ bool Ques::show() {
 					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				}
 				if (memk != k) {
-//					for (j = 1; j <= tmax; j ++)
+//					for (j = 1; j <= tmax; ++j)
 //						st[j] = chaines[k][j];
 					strncpy(st, chaines[k].c_str(), tmax);
 					st[1 + tmax] = '$';
@@ -380,7 +380,7 @@ bool Ques::show() {
 					memk = k;
 				}
 			} else if (memk != 0) {
-//				for (j = 1; j <= tmax; j ++)
+//				for (j = 1; j <= tmax; ++j)
 //					st[j] = chaines[memk][j];
 				strncpy(st, chaines[memk].c_str(), tmax);
 				st[1 + tmax] = '$';
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e26901b..acc2bb0 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -45,11 +45,11 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
 	byte egaPalette[64 * 3];
 
 	byte *p = &egaPalette[0];
-	for (int i = 0; i < 64; i++) {
+	for (int i = 0; i < 64; ++i) {
 		*p++ = (i >> 2 & 1) * 0xaa + (i >> 5 & 1) * 0x55;
 		*p++ = (i >> 1 & 1) * 0xaa + (i >> 4 & 1) * 0x55;
 		*p++ = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
-    }
+	}
 
 	// Loop through setting palette colours based on the passed indexes
 	for (; size > 0; --size, ++idx) {
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index abf8c26..bd7ad2c 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -42,7 +42,7 @@ int testou() {
 
 	switch (ch)  {
 	case '\23' :
-		sonoff = !sonoff;
+		_soundOff = !_soundOff;
 		break;
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 571abfa..d297529 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -47,54 +47,47 @@ void copcha() {
 bool dans_rect(rectangle r) {
 	int x, y, c;
 
-	bool dans_rect_result;
 	getMousePos(x, y, c);
-	if ((x > r.x1) &&
-	        (x < r.x2) &&
-	        (y > r.y1) &&
-	        (y < r.y2))
-		dans_rect_result = true;
-	else
-		dans_rect_result = false;
-
-	return dans_rect_result;
+	if ((x > r.x1) && (x < r.x2) && (y > r.y1) && (y < r.y2))
+		return true;
+
+	return false;
 }
 
 void outbloc(int n, pattern p, t_nhom pal) {
-	int i, j, ad;
-
-	ad = n * 404 + 0xd700;
+	int ad = n * 404 + 0xd700;
 
 	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
 	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
-	ad = ad + 4;
-	for (i = 1; i <= p.tax; i ++)
-		for (j = 1; j <= p.tay; j ++)
+	ad += 4;
+	for (int i = 1; i <= p.tax; ++i)
+		for (int j = 1; j <= p.tay; ++j)
 			mem[0x6000 * 16 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
 }
 
 void writepal(int n) {
-	int i;
 	t_nhom pal;
 
 	switch (gd) {
 	case tan:
 	case ega:
-	case ams :
-		for (i = 1; i <= 16; i++) {
+	case ams:
+		for (int i = 1; i <= 16; ++i) {
 			mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x;
 			mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y;
 		}
 		break;
-	case cga : {
+	case cga:
 		warning("TODO: If this code is needed, resolve the incompatible types");
 //		pal = palcga[n].a;
 		if (n < 89)
 			palette(palcga[n].p);
-		for (i = 0; i <= 15; i++)
+		
+		for (int i = 0; i <= 15; ++i)
 			outbloc(i, tpt[pal[i].n], pal);
-	}
-	break;
+		break;
+	default:
+		break;
 	}
 }
 
@@ -107,8 +100,10 @@ void pictout(int seg, int dep, int x, int y) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
+
 	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
 		WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
+
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
 
@@ -129,16 +124,19 @@ void adzon() {
 
 	if (!f.open("don.mor"))
 		error("Missing file - don.mor");
+
 	f.read(tabdon, 7 * 256);
 	f.close();
 
 	if (!f.open("bmor.mor"))
 		error("Missing file - bmor.mor");
+
 	f.read(&tabdon[fleche], 1 * 1916);
 	f.close();
 
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
+
 	f.read(&mem[0x73a2 * 16 + 0], 1 * 1664);
 	f.close();
 }
@@ -147,14 +145,12 @@ void adzon() {
  * Returns the offset within the compressed image data resource of the desired image
  */
 int animof(int ouf, int num) {
-	int nani, aux;
-
-	int animof_result;
-	nani = mem[adani * 16 + 1];
-	aux = num;
+	int nani = mem[adani * 16 + 1];
+	int aux = num;
 	if (ouf != 1)
 		aux += nani;
-	animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
+
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
 
 	return animof_result;
 }
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 97ba083..b585177 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,9 +48,9 @@ void Menu::menut(int no, Common::String nom) {
 	byte l = lo(no);
 	Common::String s = nom;
 
-	if (! tesok) {
+	if (! tesok)
 		g_vm->quitGame();
-	}
+
 
 	while (s.size() < 20)
 		s += ' ';
@@ -74,6 +74,8 @@ void Menu::menut(int no, Common::String nom) {
 	case MENU_DISCUSS:
 		_dis[l] = s;
 		break;
+	default:
+		break;
 	}
 }
 
@@ -86,14 +88,13 @@ void Menu::disableMenuItem(int no) {
 	byte l = lo(no);
 
 	switch (h) {
-	case invent : {
+	case invent:
 		if (l > 6) {
 			_inv[l].setChar('<', 0);
 			_inv[l].setChar('>', 21);
 		} else
 			_inv[l].setChar('*', 0);
-	}
-	break;
+		break;
 	case MENU_MOVE:
 		_dep[l].setChar('*', 0);
 		break;
@@ -106,6 +107,8 @@ void Menu::disableMenuItem(int no) {
 	case MENU_DISCUSS:
 		_dis[l].setChar('*', 0);
 		break;
+	default:
+		break;
 	}
 }
 
@@ -135,6 +138,8 @@ void Menu::enableMenuItem(int no) {
 	case MENU_DISCUSS:
 		_dis[l].setChar(' ', 0);
 		break;
+	default:
+		break;
 	}
 }
 
@@ -161,7 +166,7 @@ void Menu::menu_aff() {
 			x = col;
 			do {   // One line after the other
 				msk = 0x80;
-				for (pt = 0; pt <= 7; pt ++) {
+				for (pt = 0; pt <= 7; ++pt) {
 					if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
 						g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
 						g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
@@ -201,30 +206,30 @@ void Menu::invers(int ix) {
 
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
 	switch (msg3) {
-	case 1 :
+	case 1:
 		s = _inv[lo(msg4)];
 		break;
-	case 2 :
+	case 2:
 		s = _dep[lo(msg4)];
 		break;
-	case 3 :
+	case 3:
 		s = _act[lo(msg4)];
 		break;
-	case 4 :
+	case 4:
 		s = _self[lo(msg4)];
 		break;
-	case 5 :
+	case 5:
 		s = _dis[lo(msg4)];
 		break;
-	case 6 :
+	case 6:
 		s = g_vm->getString(S_SAVE_LOAD + lo(msg4));
 		break;
-	case 7 :
+	case 7:
 		s = g_vm->getString(S_SAVE_LOAD + 1);
 		s += ' ';
 		s += (char)(48 + lo(msg4));
 		break;
-	case 8 :
+	case 8:
 		if (lo(msg4) == 1) {
 			s = g_vm->getString(S_RESTART);
 		} else {
@@ -233,6 +238,8 @@ void Menu::invers(int ix) {
 			s += (char)(47 + lo(msg4));
 		}
 		break;
+	default:
+		break;
 	}
 	if ((s[0] != '*') && (s[0] != '<'))
 		g_vm->_screenSurface.writeg(s, ix);
@@ -241,17 +248,17 @@ void Menu::invers(int ix) {
 }
 
 void Menu::util(int x, int y) {
-	int ymx, dxcar, xmn, xmx, ix;
 
-	/* debug('util'); */
-	ymx = (don[msg3][4] << 3) + 16;
-	dxcar = don[msg3][3];
-	xmn = (don[msg3][1] << 2) * res;
+	int ymx = (don[msg3][4] << 3) + 16;
+	int dxcar = don[msg3][3];
+	int xmn = (don[msg3][1] << 2) * res;
+
+	int ix;
 	if (res == 1)
 		ix = 5;
 	else
 		ix = 3;
-	xmx = dxcar * ix * res + xmn + 2;
+	int xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
 		ix = pred(int, ((uint)y >> 3)) + (msg3 << 8);
 		if (ix != msg4) {
@@ -296,37 +303,37 @@ void Menu::menuDown(int ii) {
 	do {
 		cx = succ(int, cx);
 		switch (ii) {
-		case 1 :
+		case 1:
 			if (_inv[cx][0] != '*')
 				g_vm->_screenSurface.writeg(_inv[cx], 4);
 			break;
-		case 2 :
+		case 2:
 			if (_dep[cx][0] != '*')
 				g_vm->_screenSurface.writeg(_dep[cx], 4);
 			break;
-		case 3 :
+		case 3:
 			if (_act[cx][0] != '*')
 				g_vm->_screenSurface.writeg(_act[cx], 4);
 			break;
-		case 4 :
+		case 4:
 			if (_self[cx][0] != '*')
 				g_vm->_screenSurface.writeg(_self[cx], 4);
 			break;
-		case 5 :
+		case 5:
 			if (_dis[cx][0] != '*')
 				g_vm->_screenSurface.writeg(_dis[cx], 4);
 			break;
-		case 6 :
+		case 6:
 			g_vm->_screenSurface.writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
 			break;
-		case 7 : {
+		case 7: {
 			Common::String s = g_vm->getString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
 			g_vm->_screenSurface.writeg(s, 4);
+			}
 			break;
-		}
-		case 8 :
+		case 8:
 			if (cx == 1)
 				g_vm->_screenSurface.writeg(g_vm->getString(S_RESTART), 4);
 			else {
@@ -336,6 +343,8 @@ void Menu::menuDown(int ii) {
 				g_vm->_screenSurface.writeg(s, 4);
 			}
 			break;
+		default:
+			break;
 		}
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (!(cx == nb_lig));
@@ -397,12 +406,14 @@ void Menu::mdn() {
 			xprec = x;
 			yprec = y;
 		}
-		tes = (y < 11) && ((x >= (28 * res) && x <= (28 * res + 24)) 
-						   || (x >= (76 * res) && x <= (76 * res + 24))
-		                   || ((x > 124 * res) && (x < 124 * res + 24))
-		                   || ((x > 172 * res) && (x < 172 * res + 24))
-		                   || ((x > 220 * res) && (x < 220 * res + 24))
-		                   || ((x > 268 * res) && (x < 268 * res + 24)));
+		
+		tes =  (y < 11) 
+		   && ((x >= (28 * res) && x <= (28 * res + 24)) 
+		   ||  (x >= (76 * res) && x <= (76 * res + 24))
+		   || ((x > 124 * res) && (x < 124 * res + 24))
+		   || ((x > 172 * res) && (x < 172 * res + 24))
+		   || ((x > 220 * res) && (x < 220 * res + 24))
+		   || ((x > 268 * res) && (x < 268 * res + 24)));
 		if (tes) {
 			if (x < 76 * res)
 				ix = invent;
@@ -468,10 +479,10 @@ void Menu::initMenu() {
 	// Ask to swap floppy
 	dem2();
 
-	for (i = 1; i <= 8; i ++)
+	for (i = 1; i <= 8; ++i)
 		_inv[i] = "*                     ";
 	_inv[7] = "< -*-*-*-*-*-*-*-*-*- ";
-	for (i = 1; i <= 7; i ++)
+	for (i = 1; i <= 7; ++i)
 		_dep[i] = "*                       ";
 	i = 1;
 	do {
@@ -492,7 +503,7 @@ void Menu::initMenu() {
 		}
 		i = succ(int, i);
 	} while (!(i == 22));
-	for (i = 1; i <= 8; i ++) {
+	for (i = 1; i <= 8; ++i) {
 		_disc[i] = 0x500 + i;
 		if (i < 8)
 			_depl[i] = 0x200 + i;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 82eb117..4112073 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -148,7 +148,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	initMouse();
 
 	init_lieu();
-	sonoff = false;
+	_soundOff = false;
 	f2_all = false;
 
 	teskbd();
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d724fe6..44b254f 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -103,7 +103,7 @@ void hideMouse() {
 			} while (!(k >= 5));
 			break;
 		case ams:
-			for (i = 0; i <= 3; i ++) {
+			for (i = 0; i <= 3; ++i) {
 				port[0x3dd] = 1 << i;
 				k = 0;
 				j = p_o_s;
@@ -142,8 +142,8 @@ void hideMouse() {
 			break;
 		case her:
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
-			for (i = 0; i <= 5; i ++) {
-				for (k = 0; k <= 3; k ++) 
+			for (i = 0; i <= 5; ++i) {
+				for (k = 0; k <= 3; ++k) 
 					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
@@ -152,7 +152,7 @@ void hideMouse() {
 			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 			k = 0;
 			do {
-				for (i = 0; i <= 3; i ++) {
+				for (i = 0; i <= 3; ++i) {
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
@@ -194,7 +194,7 @@ void showMouse() {
 		} while (!(k >= 5));
 		break;
 	case ams:
-		for (i = 0; i <= 3; i ++) {
+		for (i = 0; i <= 3; ++i) {
 			j = p_o_s;
 			imp = odd(y_s);
 			port[0x3de] = i;
@@ -229,8 +229,8 @@ void showMouse() {
 		break;
 	case her:
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
-		for (i = 0; i <= 5; i ++) {
-			for (k = 0; k <= 3; k ++)
+		for (i = 0; i <= 5; ++i) {
+			for (k = 0; k <= 3; ++k)
 				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j]);
 			j += 80;
 		}
@@ -239,7 +239,7 @@ void showMouse() {
 		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 		k = 0;
 		do {
-			for (i = 0; i <= 3; i ++) {
+			for (i = 0; i <= 3; ++i) {
 				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
 				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
@@ -415,7 +415,7 @@ void moveMouse(bool &funct, char &key) {
 			cy = 8;
 			break;
 		case '\23':
-			sonoff = !sonoff;
+			_soundOff = !_soundOff;
 			return;
 			break;
 		case '\26':
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 82b8ad3..95ccc3b 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -79,44 +79,47 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	oct = t_mot[idx];
 	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
 	if (pt < 6) {
-		idx = idx + 1;
+		++idx;
 		oct = oct << (5 - pt);
-		pt = pt + 11;
+		pt += 11;
 		oct = oct | ((uint)t_mot[idx] >> pt);
 	} else {
-		pt = pt - 5;
+		pt -= 5;
 		oct = (uint)oct >> pt;
 	}
 
 	switch (oct) {
-	case 11 : {
+	case 11:
 		c = '$';
 		the_end = true;
-	}
-	break;
+		break;
 	case 30:
-	case 31 : {
+	case 31:
 		ocd = t_mot[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
-			idx = idx + 1;
+			++idx;
 			ocd = ocd << (5 - pt);
-			pt = pt + 11;
+			pt += 11;
 			ocd = ocd | ((uint)t_mot[idx] >> pt);
 		} else {
-			pt = pt - 5;
+			pt -= 5;
 			ocd = (uint)ocd >> pt;
 		}
-		if (oct == 30)  c = chr(tab30[ocd]);
-		else c = chr(tab31[ocd]);
+
+		if (oct == 30)
+			c = chr(tab30[ocd]);
+		else
+			c = chr(tab31[ocd]);
+
 		if (c == '\0') {
 			the_end = true;
 			c = '#';
 		}
-	}
-	break;
+		break;
 	default:
 		c = chr(tabdr[oct]);
+		break;
 	}
 }              /* 5-8 */
 
@@ -124,94 +127,88 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
  * Decode and extract the line with the given Id
  */
 void deline(int num, char *l , int &tl) {
-	int i, j, ts;
-	char let;
-	byte ps, k;
-	bool the_end;
-
 	if (num < 0) {
 		warning("deline: num < 0! Skipping");
 		return;
 	}
 
-	/* DETEX */
-	/*debug('  => DeLine');*/
+	// DETEX
 	delig = "";
-	ts = t_rec[num].indis;
-	ps = t_rec[num].point;
-	i = ts;
+	int ts = t_rec[num].indis;
+	byte ps = t_rec[num].point;
+	int i = ts;
 	tl = 1;
-	j = 1;
-	k = ps;
-	the_end = false;
+	int j = 1;
+	byte k = ps;
+	bool endFl = false;
+	char let;
 	do {
-		cinq_huit(let, i, k, the_end);
+		cinq_huit(let, i, k, endFl);
 		l[j] = let;
-		if (j < 254)  delig = delig + let;
-		j = j + 1;
-	} while (!the_end);
+		if (j < 254)
+			delig += let;
+		++j;
+	} while (!endFl);
 	tl = j - 1;
 	if (tl < 255)
-		delig.deleteLastChar();		// Remove trailing '$'
-}       /* DETEX */
+		// Remove trailing '$'
+		delig.deleteLastChar();
+}
 
 
 void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 
 static int l_motsuiv(int p, char *ch, int &tab) {
-	int c;
+	int c = p;
 
-	int l_motsuiv_result;
-	c = p;
 	while ((ch[p] != ' ') && (ch[p] != '$') && (ch[p] != '@'))
 		++p;
-	l_motsuiv_result = tab * (p - c);
-	return l_motsuiv_result;
+
+	return tab * (p - c);
 }
 
 void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	bool the_end;
-	int xf, yf;
-	int xc, yc;
-	int tab, p;
+	int tab;
 	Common::String s;
 	int i, j;
 
 
 	/*    debug('  .. Afftex');*/
 	g_vm->_screenSurface.putxy(x, y);
-	if (res == 1)  tab = 10;
-	else tab = 6;
-	dx = dx * 6;
-	dy = dy * 6;
-	xc = x;
-	yc = y;
-	xf = x + dx;
-	yf = y + dy;
-	p = 1;
+	if (res == 1)
+		tab = 10;
+	else
+		tab = 6;
+	dx *= 6;
+	dy *= 6;
+	int xc = x;
+	int yc = y;
+	int xf = x + dx;
+	int yf = y + dy;
+	int p = 1;
 	the_end = (ch[p] == '$');
 	s = "";
-	while (! the_end) {
+	while (!the_end) {
 		switch (ch[p]) {
-		case '@' : {
+		case '@':
 			g_vm->_screenSurface.writeg(s, typ);
 			s = "";
-			p = p + 1;
+			++p;
 			xc = x;
-			yc = yc + 6;
+			yc += 6;
 			g_vm->_screenSurface.putxy(xc, yc);
-		}
-		break;
-		case ' ' : {
-			s = s + ' ';
-			xc = xc + tab;
-			p = p + 1;
+			break;
+		case ' ':
+			s += ' ';
+			xc += tab;
+			++p;
 			if (l_motsuiv(p, ch, tab) + xc > xf) {
 				g_vm->_screenSurface.writeg(s, typ);
 				s = "";
 				xc = x;
-				yc = yc + 6;
+				yc += 6;
 				if (yc > yf) {
 					do {
 						;
@@ -222,26 +219,24 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 						do {
 							g_vm->_screenSurface.putxy(j, i);
 							g_vm->_screenSurface.writeg(" ", 0);
-							j = j + 6;
+							j += 6;
 						} while (!(j > xf));
-						i = i + 6;
+						i += 6;
 					} while (!(i > yf));
 					yc = y;
 				}
 				g_vm->_screenSurface.putxy(xc, yc);
 			}
-		}
-		break;
-		case '$' : {
+			break;
+		case '$':
 			the_end = true;
 			g_vm->_screenSurface.writeg(s, typ);
-		}
-		break;
-		default: {
-			s = s + ch[p];
-			p = p + 1;
-			xc = xc + tab;
-		}
+			break;
+		default:
+			s += ch[p];
+			++p;
+			xc += tab;
+			break;
 		}     /* case */
 	}
 }
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index ad69ca9..470479a 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -34,9 +34,7 @@ namespace Mortevielle {
 
 extern Common::String delig;
 
-//static void cinq_huit(char &c, int &ind, byte &pt, bool &the_end);
 extern void deline(int num , char *l , int &tl);
-//static int l_motsuiv(int p, char *ch, int &tab);
 extern void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 33f879d..0177d3e 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -55,7 +55,6 @@ void dem2() {
 void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
-	int i, j, k;
 	Common::File fb;	// byte values
 	byte b;
 
@@ -67,8 +66,8 @@ void charpal() {
 
 	if (!f.open("plxx.mor"))
 		error("Missing file - plxx.mor");
-	for (i = 0; i <= 90; ++i) {
-		for (j = 1; j <= 16; ++j) {
+	for (int i = 0; i <= 90; ++i) {
+		for (int j = 1; j <= 16; ++j) {
 			tabpal[i][j].x = f.readByte();
 			tabpal[i][j].y = f.readByte();
 		}
@@ -78,9 +77,9 @@ void charpal() {
 	if (!fb.open("cxx.mor"))
 		error("Missing file - cxx.mor");
 
-	for (j = 0; j <= 90; j ++) {
+	for (int j = 0; j <= 90; ++j) {
 		palcga[j].p = fb.readByte();
-		for (i = 0; i <= 15; i ++) {
+		for (int i = 0; i <= 15; ++i) {
 			nhom &with = palcga[j].a[i];
 
 			b = fb.readByte();
@@ -90,28 +89,26 @@ void charpal() {
 		}
 	}
 	palcga[10].a[9] = palcga[10].a[5];
-	for (j = 0; j <= 14; j ++) {
+	for (int j = 0; j <= 14; ++j) {
 		tpt[j].tax = fb.readByte();
 		tpt[j].tay = fb.readByte();
-		for (i = 1; i <= 20; i ++)
-			for (k = 1; k <= 20; k ++)
+		for (int i = 1; i <= 20; ++i)
+			for (int k = 1; k <= 20; ++k)
 				tpt[j].des[i][k] = fb.readByte();
 	}
 	fb.close();
 }
 
 void chartex() {
-	int i;
 	Common::File f;
 	char s[1410];
 
 	/* debug('o3 chartex'); */
-	i = 0;
 	if (!f.open("TXX.INP"))
 		error("Missing file - TXX.INP");
 
 	assert(f.size() <= (maxti * 2));
-	for (i = 0; i < f.size() / 2; ++i)
+	for (int i = 0; i < f.size() / 2; ++i)
 		t_mot[i] = f.readUint16LE();
 
 	f.close();
@@ -120,6 +117,7 @@ void chartex() {
 		error("Missing file - TXX.NTP");
 	
 	assert(f.size() <= (maxtd * 3));
+	int i;
 	for (i = 0; i < (f.size() / 3); ++i) {
 		t_rec[i].indis = f.readSint16LE();
 		t_rec[i].point = f.readByte();
@@ -171,7 +169,9 @@ void music() {
 
 
 	/* debug('o3 music'); */
-	if (sonoff)  return;
+	if (_soundOff)
+		return;
+
 	rech_cfiec = true;
 	
 	if (!fic.open("mort.img"))
@@ -190,10 +190,11 @@ void music() {
 	do {
 		fin = keypressed();
 		g_vm->_soundManager.musyc(tbi, 9958 , tempo_mus);
-		k = k + 1;
+		++k;
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
-	while (keypressed())  ch = get_ch();	// input >> kbd >> ch;
+	while (keypressed())
+		ch = get_ch();	// input >> kbd >> ch;
 }
 
 
@@ -238,7 +239,8 @@ void suite() {
 	caff = 51;
 	taffich();
 	teskbd();
-	if (newgd != gd)  gd = newgd;
+	if (newgd != gd)
+		gd = newgd;
 	hirs();
 	dessine(ades, 0, 0);
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 70bbd72..02f298e 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -37,7 +37,7 @@ void spfrac(int wor) {
 	if ((typlec == 0) && (c3.code != 9))
 		if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
 				((c3.code < 5) && ((c3.rep != 19) && (c3.rep != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
-			c3.rep = c3.rep + 1;
+			++c3.rep;
 		}
 
 	c3.freq = ((uint)wor >> 6) & 7;
@@ -65,21 +65,19 @@ void charg_car() {
 		c3.code = 4;
 	} else {
 		switch (int_) {
-		case 60 : {
+		case 60:
 			c3.val = 32;  /*  " "  */
 			c3.code = 9;
-		}
-		break;
-		case 61 : {
+			break;
+		case 61:
 			c3.val = 46;  /*  "."  */
 			c3.code = 9;
-		}
-		break;
-		case 62 : {
+			break;
+		case 62:
 			c3.val = 35;  /*  "#"  */
 			c3.code = 9;
-		}
-		break;
+		default:
+			break;
 		}
 	}
 
@@ -90,7 +88,7 @@ void charg_car() {
 
 void entroct(byte o) {
 	mem[adtroct * 16 + ptr_oct] = o;
-	ptr_oct = ptr_oct + 1;
+	++ptr_oct;
 }
 
 void veracf(byte b) {
@@ -98,30 +96,26 @@ void veracf(byte b) {
 }
 
 void cctable(tablint &t) {
-	int k;
 	float tb[257];
 
-
 	tb[0] = 0;
-	for (k = 0; k <= 255; k ++) {
+	for (int k = 0; k <= 255; ++k) {
 		tb[k + 1] = addfix + tb[k];
 		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
 
 void regenbruit() {
-	int i, j;
-
-	i = offsetb3 + 8590;
-	j = 0;
+	int i = offsetb3 + 8590;
+	int j = 0;
 	do {
 		t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
-		i = i + 2;
-		j = j + 1;
+		i += 2;
+		++j;
 	} while (!(i >= offsetb3 + 8790));
 }
 
-  void charge_son() {
+void charge_son() {
 	Common::File f;
 
 	if (!f.open("sonmus.mor"))
@@ -133,7 +127,7 @@ void regenbruit() {
 	f.close();
 }
 
-  void charge_phbruit() {
+void charge_phbruit() {
 	Common::File f;
 
 	if (!f.open("phbrui.mor"))
@@ -145,7 +139,7 @@ void regenbruit() {
 	f.close();
 }
 
-  void charge_bruit() {
+void charge_bruit() {
 	Common::File f;
 	int i;
 
@@ -153,54 +147,67 @@ void regenbruit() {
 		error("Missing file - bruits");
 
 	f.read(&mem[adbruit * 16 + 0], 250);
-	for (i = 0; i <= 19013; i ++) mem[adbruit * 16 + 32000 + i] = mem[adbruit5 + i];
+	for (i = 0; i <= 19013; ++i)
+		mem[adbruit * 16 + 32000 + i] = mem[adbruit5 + i];
 	f.read(&mem[adbruit1 * 16 + offsetb1], 149);
 
 	f.close();
 }
 
-  void trait_car() {
+void trait_car() {
 	byte d3;
 	int d2, i;
 
 	switch (c2.code) {
-	case 9 :
-		if (c2.val != ord('#'))  for (i = 0; i <= c2.rep; i ++) entroct(c2.val);
+	case 9:
+		if (c2.val != ord('#'))
+			for (i = 0; i <= c2.rep; ++i)
+				entroct(c2.val);
 		break;
-
 	case 5:
-	case 6 : {
-		if (c2.code == 6)  d3 = tabdph[(c2.val - 14) << 1];
-		else d3 = null;
+	case 6:
+		if (c2.code == 6)
+			d3 = tabdph[(c2.val - 14) << 1];
+		else
+			d3 = null;
 		if (c1.code >= 5) {
 			veracf(c2.acc);
 			if (c1.code == 9) {
 				entroct(4);
-				if (d3 == null)  entroct(c2.val);
-				else entroct(d3);
+				if (d3 == null)
+					entroct(c2.val);
+				else
+					entroct(d3);
 				entroct(22);
 			}
 		}
+
 		switch (c2.rep) {
-		case 0 : {
+		case 0:
 			entroct(0);
 			entroct(c2.val);
-			if (d3 == null)  if (c3.code == 9)  entroct(2);
-				else entroct(4);
-			else if (c3.code == 9)  entroct(0);
-			else entroct(1);
-		}
-		break;
+			if (d3 == null)
+				if (c3.code == 9)
+					entroct(2);
+				else
+					entroct(4);
+			else if (c3.code == 9)
+				entroct(0);
+			else
+				entroct(1);
+			break;
 		case 4:
 		case 5:
-		case 6 : {
+		case 6:
 			if (c2.rep != 4) {
 				i = c2.rep - 5;
 				do {
-					i = i - 1;
+					--i;
 					entroct(0);
-					if (d3 == null)  entroct(c2.val);
-					else entroct(d3);
+					if (d3 == null)
+						entroct(c2.val);
+					else
+						entroct(d3);
 					entroct(3);
 				} while (!(i < 0));
 			}
@@ -213,18 +220,19 @@ void regenbruit() {
 				entroct(c2.val);
 				entroct(3);
 			}
-		}
-		break;
+			break;
 		case 7:
 		case 8:
-		case 9 : {
+		case 9:
 			if (c2.rep != 7) {
 				i = c2.rep - 8;
 				do {
-					i = i - 1;
+					--i;
 					entroct(0);
-					if (d3 == null)  entroct(c2.val);
-					else entroct(d3);
+					if (d3 == null)
+						entroct(c2.val);
+					else
+						entroct(d3);
 					entroct(3);
 				} while (!(i < 0));
 			}
@@ -237,34 +245,37 @@ void regenbruit() {
 				entroct(c2.val);
 				entroct(0);
 			}
-		}
-		break;
+			break;
 		case 1:
 		case 2:
-		case 3 : {
+		case 3:
 			if (c2.rep != 1) {
 				i = c2.rep - 2;
 				do {
-					i = i - 1;
+					--i;
 					entroct(0);
-					if (d3 == null)  entroct(c2.val);
-					else entroct(d3);
+					if (d3 == null)
+						entroct(c2.val);
+					else
+						entroct(d3);
 					entroct(3);
 				} while (!(i < 0));
 			}
 			entroct(0);
 			entroct(c2.val);
-			if (c3.code == 9)  entroct(0);
-			else entroct(1);
-		}
+			if (c3.code == 9)
+				entroct(0);
+			else
+				entroct(1);
+			break;
+		default:
+			break;
+		}     //  switch  c2.rep
 		break;
-		}     /*  case  c2.rep  */
-	}
-	break;
 
 	case 2:
-	case 3 : {
-		d3 = c2.code + 5; /*  7 ou 8  => voyelle correspondante  */ //Translation: Corresponding vowel
+	case 3:
+		d3 = c2.code + 5; //  7 ou 8  => Corresponding vowel
 		if (c1.code > 4) {
 			veracf(c2.acc);
 			if (c1.code == 9) {
@@ -274,9 +285,10 @@ void regenbruit() {
 			}
 		}
 		i = c2.rep;
+		assert(i >= 0);
 		if (i != 0) {
 			do {
-				i = i - 1;
+				--i;
 				entroct(0);
 				entroct(d3);
 				entroct(3);
@@ -289,43 +301,47 @@ void regenbruit() {
 			entroct(c2.val);
 		} else {
 			entroct(4);
-			if (c3.val == 4)  entroct(3);
-			else entroct(c3.val);
+			if (c3.val == 4)
+				entroct(3);
+			else
+				entroct(c3.val);
 			entroct(c2.val);
 		}
-	}
-	break;
+		break;
 	case 0:
-	case 1 : {
+	case 1: 
 		veracf(c2.acc);
 		switch (c3.code) {
-		case 2 :
+		case 2:
 			d2 = 7;
 			break;
-		case 3 :
+		case 3:
 			d2 = 8;
 			break;
-		case 6 :
+		case 6:
 			d2 = tabdph[(c3.val - 14) << 1];
 			break;
-		case 5 :
+		case 5:
 			d2 = c3.val;
 			break;
 		default:
 			d2 = 10;
-		}       /*  case  c3.code  */
+			break;
+		}       //  switch  c3.code
 		d2 = d2 * 26 + c2.val;
-		if (tnocon[d2] == 0)  d3 = 2;
-		else d3 = 6;
+		if (tnocon[d2] == 0)
+			d3 = 2;
+		else
+			d3 = 6;
 		if (c2.rep >= 5) {
 			c2.rep = c2.rep - 5;
-			d3 = 8 - d3;       /*  echange 2 et 6  */    //Translation: swap 2 and 6
+			d3 = 8 - d3;       // Swap 2 and 6
 		}
 		if (c2.code == 0) {
 			i = c2.rep;
 			if (i != 0) {
 				do {
-					i = i - 1;
+					--i;
 					entroct(d3);
 					entroct(c2.val);
 					entroct(3);
@@ -341,7 +357,7 @@ void regenbruit() {
 			i = c2.rep;
 			if (i != 0) {
 				do {
-					i = i - 1;
+					--i;
 					entroct(d3);
 					entroct(c2.val);
 					entroct(4);
@@ -355,33 +371,40 @@ void regenbruit() {
 		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
 			veracf(c3.acc);
 			switch (c3.code) {
-			case 3 :
+			case 3:
 				d2 = 8;
 				break;
-			case 6 :
+			case 6:
 				d2 = tabdph[(c3.val - 14) << 1];
 				break;
-			case 5 :
+			case 5:
 				d2 = c3.val;
 				break;
 			default:
 				d2 = 7;
-			}     /*  case c3.code  */
-			if (d2 == 4)  d2 = 3;
-			if (intcon[c2.val] != 0)  c2.val = c2.val + 1;
-			if ((c2.val == 17) || (c2.val == 18))  c2.val = 16;
+				break;
+			}     //  switch c3.code
+			if (d2 == 4)
+				d2 = 3;
+
+			if (intcon[c2.val] != 0)
+				++c2.val;
+
+			if ((c2.val == 17) || (c2.val == 18))
+				c2.val = 16;
+
 			entroct(4);
 			entroct(d2);
 			entroct(c2.val);
 		}
-	}
-	break;
-	case 4 : {
+	
+		break;
+	case 4:
 		veracf(c2.acc);
 		i = c2.rep;
 		if (i != 0) {
 			do {
-				i = i - 1;
+				--i;
 				entroct(2);
 				entroct(c2.val);
 				entroct(3);
@@ -397,27 +420,35 @@ void regenbruit() {
 		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
 			veracf(c3.acc);
 			switch (c3.code) {
-			case 3 :
+			case 3:
 				d2 = 8;
 				break;
-			case 6 :
+			case 6:
 				d2 = tabdph[(c3.val - 14) << 1];
 				break;
-			case 5 :
+			case 5:
 				d2 = c3.val;
 				break;
 			default:
 				d2 = 7;
-			}     /*  case c3.code  */
-			if (d2 == 4)  d2 = 3;
-			if (intcon[c2.val] != 0)  c2.val = c2.val + 1;
+				break;
+			}     //  switch c3.code
+
+			if (d2 == 4)
+				d2 = 3;
+
+			if (intcon[c2.val] != 0)
+				++c2.val;
+
 			entroct(4);
 			entroct(d2);
 			entroct(tabdbc[((c2.val - 26) << 1) + 1]);
 		}
-	}
-	break;
-	}     /* case c2.code  */
+	
+		break;
+	default:
+		break;
+	}     // switch c2.code
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index e0aaf83..785e49a 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -38,18 +38,14 @@ namespace Mortevielle {
 void rot_chariot() {
 	c1 = c2;
 	c2 = c3;
-	{
-		c3.val = 32;
-		c3.code = 9;
-	}
+	c3.val = 32;
+	c3.code = 9;
 }
 
 void init_chariot() {
-	{
-		c3.rep = 0;
-		c3.freq = 0;
-		c3.acc = 0;
-	}
+	c3.rep = 0;
+	c3.freq = 0;
+	c3.acc = 0;
 	rot_chariot();
 	rot_chariot();
 }
@@ -89,38 +85,41 @@ void trait_ph() {
 
 void parole(int rep, int ht, int typ) {
 	int savph[501];
-	int i;
 	int tempo;
 
+	if (_soundOff)
+		return;
 
-	if (sonoff)  return;
 	num_ph = rep;
 	haut = ht;
 	typlec = typ;
 	if (typlec != 0) {
-		for (i = 0; i <= 500; i ++) savph[i] = t_cph[i];
+		for (int i = 0; i <= 500; ++i)
+			savph[i] = t_cph[i];
 		tempo = tempo_bruit;
-	} else if (haut > 5)  tempo = tempo_f;
-	else tempo = tempo_m;
+	} else if (haut > 5)
+		tempo = tempo_f;
+	else
+		tempo = tempo_m;
 	addfix = (float)((tempo - addv[0])) / 256;
 	cctable(tbi);
 	switch (typ) {
-	case 1 : {
+	case 1:
 		charge_bruit();
 		/*if zuul then zzuul(adbruit,0,1095);*/
 		regenbruit();
-	}
-	break;
-	case 2 : {
+		break;
+	case 2:
 		charge_son();
 		charge_phbruit();
-	}
-	break;
+		break;
+	default:
+		break;
 	}
 	trait_ph();
 	g_vm->_soundManager.litph(tbi, typ, tempo);
 	if (typlec != 0)
-		for (i = 0; i <= 500; i ++) {
+		for (int i = 0; i <= 500; ++i) {
 			t_cph[i] = savph[i];
 			mlec = typlec;
 		}
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index e6fd9b7..fa83b82 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -47,8 +47,10 @@ void change_gd(int ngd) {
 	dessine_rouleau();
 	tinke();
 	drawClock();
-	if (ipers != 0)  affper(ipers);
-	else person();
+	if (ipers != 0)
+		affper(ipers);
+	else
+		person();
 	clsf2();
 	clsf3();
 	_maff = 68;
@@ -66,7 +68,6 @@ void MortevielleEngine::gameLoaded() {
 	bool test[3];
 	char g[8];
 
-
 	hideMouse();
 	imen = false;
 	g[1] = 'M';
@@ -129,8 +130,10 @@ void MortevielleEngine::gameLoaded() {
 	_endGame = false;
 	tmlieu(s.mlieu);
 	modinv();
-	if (s.derobj != 0)  modobj2(s.derobj + 400, test[1], test[2]);
-	else tesok = test[1] || test[2];
+	if (s.derobj != 0)
+		modobj2(s.derobj + 400, test[1], test[2]);
+	else
+		tesok = test[1] || test[2];
 	showMouse();
 }
 
@@ -141,21 +144,22 @@ void tmaj3() {
 	int j, h, m;
 
 	calch(j, h, m);
-	if (m == 30)  m = 1;
-	h = h + (j * 24);
-	m = m + (h * 2);
+	if (m == 30)
+		m = 1;
+	h += j * 24;
+	m += h * 2;
 	s.heure = chr(m);
 }
 
-void tsitu()
-
-{
+void tsitu() {
 	int h, j, m;
 
-	if (! col)  clsf2();
+	if (! col)
+		clsf2();
 	syn = false;
 	iesc = false;
-	if (anyone)  goto L1;
+	if (anyone)
+		goto L1;
 	if (brt)
 		if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
 			ctrm = 4;
@@ -165,7 +169,8 @@ void tsitu()
 		fctMove();
 	if (msg[3] == MENU_DISCUSS)
 		fctDiscuss();
-	if (msg[3] == invent)      tsprendre(); //Translation: inventory/take
+	if (msg[3] == invent)
+		tsprendre(); //Translation: inventory/take
 	if (msg[4] == OPCODE_ATTACH)
 		fctAttach();
 	if (msg[4] == OPCODE_WAIT)
@@ -208,15 +213,18 @@ void tsitu()
 		fctLift();
 	if (msg[4] == OPCODE_TURN)
 		fctTurn();
-	if (msg[4] == OPCODE_HIDE_SELF) {                //Translation: hide
+	if (msg[4] == OPCODE_HIDE_SELF) {
 		fctHideSelf();
 		goto L1;
 	}
-	if (msg[4] == sfouiller)   tsfouiller();//Translation: search 
-	if (msg[4] == slire)       tslire();    //Translation: read
+	if (msg[4] == sfouiller)
+		tsfouiller();//Translation: search 
+	if (msg[4] == slire)
+		tslire();    //Translation: read
 	if (msg[4] == OPCODE_PUT)
 		fctPut();
-	if (msg[4] == sregarder)   tsregarder();//Translation: look
+	if (msg[4] == sregarder)
+		tsregarder();//Translation: look
 	cache = false;
 L1:
 	if (anyone) {
@@ -226,7 +234,8 @@ L1:
 	}
 	calch(j, h, m);
 	if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) ||
-	        ((h > 0) && (h < 6) && (s.mlieu != 0)))  s.conf = s.conf + 1;
+	        ((h > 0) && (h < 6) && (s.mlieu != 0)))
+		s.conf = s.conf + 1;
 	if (((s.mlieu < 16) || (s.mlieu > 19)) && (s.mlieu != 23)
 	        && (s.mlieu != 0) && (s.derobj != 152) && (!g_vm->_loseGame)) {
 		if ((s.conf > 99) && (h > 8) && (h < 16)) {
@@ -251,9 +260,9 @@ L2:
 void theure() {
 	vj = ord(s.heure);
 	vh = vj % 48;
-	vj = vj / 48;
+	vj /= 48;
 	vm = vh % 2;
-	vh = vh / 2;
+	vh /= 2;
 	_hour = vh;
 	if (vm == 1)
 		_minute = 30;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index c2c4395..929b088 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -108,7 +108,8 @@ void SavegameManager::takesav(int n) {
 	sync_save(sz);
 
 	s = s1;
-	for (i = 0; i <= 389; i ++) tabdon[i + acha] = bufcha[i];
+	for (i = 0; i <= 389; ++i)
+		tabdon[i + acha] = bufcha[i];
 
 	// Close the stream
 	delete stream;	
@@ -140,7 +141,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	hideMouse();
 	tmaj3();
 	
-	for (i = 0; i <= 389; i ++)
+	for (i = 0; i <= 389; ++i)
 		bufcha[i] = tabdon[i + acha];
 	s1 = s;
 	if (s1.mlieu == 26)
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 08aaa2a..4da3ef0 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -59,7 +59,7 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 	}
 	f.close();
 
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; i ++) 
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
 		mem[0x7000 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
 }
 
@@ -87,7 +87,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
 	}
 	f.close();
 
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; i ++)
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
 		mem[0x7314 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
 }
 
@@ -95,19 +95,18 @@ void taffich() {
 	byte tran1[] = { 121, 121, 138, 139, 120 };	// array<136, 140, byte>
 	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };	// array<153, 161, byte>
 
-	int i, m, a, b, cx, handle,
-	        npal;
+	int i, m, cx, handle, npal;
 	int32 lgt;
 	int palh, k, j;
 	int alllum[16];
 
 
-	a = caff;
+	int a = caff;
 	if ((a >= 153) && (a <= 161))
 		a = tran2[a - 153];
 	else if ((a >= 136) && (a <= 140))
 		a = tran1[a - 136];
-	b = a;
+	int b = a;
 	if (_maff == a)
 		return;
 
@@ -193,7 +192,7 @@ void taffich() {
 			a = a - 1;
 		npal = a;
 
-		for (cx = 0; cx <= (a - 1); cx ++)
+		for (cx = 0; cx <= (a - 1); ++cx)
 			lgt = lgt + l[cx];
 		handle = l[a];
 
@@ -210,13 +209,15 @@ void taffich() {
 	}
 	chardes(filename, lgt, handle);
 	if (gd == her) {
-		for (i = 0; i <= 15; i ++) {
+		for (i = 0; i <= 15; ++i) {
 			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
-		for (i = 0; i <= 15; i ++) {
+		for (i = 0; i <= 15; ++i) {
 			k = 0;
-			for (j = 0; j <= 15; j ++) if (alllum[j] > alllum[k])  k = j;
+			for (j = 0; j <= 15; ++j)
+				if (alllum[j] > alllum[k])
+					k = j;
 			mem[0x7000 * 16 + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
@@ -232,9 +233,9 @@ void taffich() {
 			else if (b == 24)
 				b = 17;
 			else if (b > 15)
-				b = b - 1;
-			for (cx = 0; cx <= (b - 1); cx ++)
-				lgt = lgt + l[cx + 89];
+				--b;
+			for (cx = 0; cx <= (b - 1); ++cx)
+				lgt += l[cx + 89];
 			handle = l[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 6f88d8d..efd84cc 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -92,7 +92,7 @@ bool blo,
         bt7,
         bh9,
 
-        sonoff,
+        _soundOff,
         main1,
         choisi,
         test0,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index f5cd3af..a77586c 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -242,7 +242,7 @@ extern bool blo,
         bt7,
         bh9,
 
-        sonoff,
+        _soundOff,
         main1,
         choisi,
         test0,


Commit: d5718f6a3170614bc1032009a4b1e6187d1d0263
    https://github.com/scummvm/scummvm/commit/d5718f6a3170614bc1032009a4b1e6187d1d0263
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:41-07:00

Commit Message:
MORTEVIELLE: Rename Alert functions

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 9f90f4c..991bda4 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -40,21 +40,13 @@ namespace Mortevielle {
 
 static const int nligne = 7;
 
-/*
-static const int coord[3][4] = {
-	{0, 0, 0, 0},
-	{0, 150, 72, 103},
-	{0, 143, 107, 183}
-};
-*/
-
 int Alert::show(const Common::String &msg, int n) {
-	int coldep, esp, i, nbcase, quoi, ix;
+	int coldep, esp, i, caseNumb, quoi, ix;
 	Common::String st, chaine;
 	int limit[3][3];
 	char dumi;
 	Common::String s[3];
-	int cx, cy, nbcol, nblig;
+	int cx, cy, nbcol, lignNumb;
 	bool newaff, test, test1, test2, test3, dum;
 	Common::String cas;
 
@@ -69,14 +61,14 @@ int Alert::show(const Common::String &msg, int n) {
 		dumi = get_ch();	// input >> kbd >> dumi;
 
 	g_vm->setMouseClick(false);
-	decod(msg, nbcase, nblig, nbcol, chaine, cas);
-	sauvecr(50, succ(int, nligne) << 4);
+	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
+	sauvecr(50, (nligne + 1) << 4);
 
 	i = 0;
 	if (chaine == "") {
-		fait_boite(10, 5, nbcol);
+		drawAlertBox(10, 5, nbcol);
 	} else {
-		fait_boite(8, 7, nbcol);
+		drawAlertBox(8, 7, nbcol);
 		i = 0;
 		g_vm->_screenSurface._textPos.y = 70;
 		do {
@@ -96,15 +88,15 @@ int Alert::show(const Common::String &msg, int n) {
 			++i;
 		} while (!(chaine[i] == ']'));
 	}
-	if (nbcase == 1)
+	if (caseNumb == 1)
 		esp = nbcol - 40;
 	else
-		esp = (uint)(nbcol - nbcase * 40) >> 1;
+		esp = (uint)(nbcol - caseNumb * 40) >> 1;
 	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
-	fait_choix(cas, coldep, nbcase, &s[0], esp);
+	setButtonText(cas, coldep, caseNumb, &s[0], esp);
 	limit[1][1] = ((uint)(coldep) >> 1) * res;
 	limit[1][2] = limit[1][1] + 40;
-	if (nbcase == 1) {
+	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
 		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
@@ -125,7 +117,7 @@ int Alert::show(const Common::String &msg, int n) {
 		if (test) {
 			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
 			test2 = test1;
-			if (nbcase > 1)
+			if (caseNumb > 1)
 				test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
 			if (test2) {
 				newaff = true;
@@ -190,7 +182,7 @@ int Alert::show(const Common::String &msg, int n) {
 	return do_alert_result;
 }
 
-void Alert::decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs) {
+void Alert::decodeAlertDetails(Common::String s, int &nbc, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
 	int i, k;
 	bool v;
 
@@ -199,7 +191,7 @@ void Alert::decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 	i = 0;
 
 	c = "";
-	nbl = 0;
+	lineNumb = 0;
 	i = 5;
 	k = 0;
 	v = true;
@@ -211,7 +203,7 @@ void Alert::decod(Common::String s, int &nbc, int &nbl, int &col, Common::String
 			if (k > col)
 				col = k;
 			k = 0;
-			nbl = nbl + 1;
+			++lineNumb;
 		} else if (s[i] != ' ')
 			v = false;
 		++i;
@@ -236,23 +228,28 @@ void Alert::setPosition(int ji, int coldep, int esp) {
 	g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
 }
 
-void Alert::fait_boite(int lidep, int nli, int tx) {
-	int x, y, xx, yy;
-
+/**
+ * Alert function - Draw Alert Box
+ * @remarks	Originally called 'fait_boite'
+ */
+void Alert::drawAlertBox(int lidep, int nli, int tx) {
 	if (tx > 640)
 		tx = 640;
-	x = 320 - ((uint)tx >> 1);
-	y = pred(int, lidep) << 3;
-	xx = x + tx;
-	yy = y + (nli << 3);
+	int x = 320 - ((uint)tx >> 1);
+	int y = pred(int, lidep) << 3;
+	int xx = x + tx;
+	int yy = y + (nli << 3);
 	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
 }
 
 
-
-void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
+/**
+ * Alert function - Set Button Text
+ * @remarks	Originally called 'fait_choix'
+ */
+void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
 	int i, l, x;
 	char ch;
 
@@ -265,9 +262,11 @@ void Alert::fait_choix(Common::String c, int coldep, int nbcase, Common::String
 			ch = c[i];
 			str[l] += ch;
 		} while (!(c[i + 1] == ']'));
-		i = i + 2;
+		i += 2;
+
 		while (str[l].size() < 3)
-		str[l] += ' ';
+			str[l] += ' ';
+
 		g_vm->_screenSurface.putxy(x, 98);
 
 		Common::String tmp(" ");
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 260f355..76b824e 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -34,10 +34,10 @@ namespace Mortevielle {
 
 class Alert {
 private:
-	static void decod(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
+	static void decodeAlertDetails(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
 	static void setPosition(int ji, int coldep, int esp);
-	static void fait_boite(int lidep, int nli, int tx);
-	static void fait_choix(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
+	static void drawAlertBox(int lidep, int nli, int tx);
+	static void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
 public:
 	static int show(const Common::String &s, int n);
 };


Commit: 38e11b6ce01243bfbe03b463e9088e4d9aadc429
    https://github.com/scummvm/scummvm/commit/38e11b6ce01243bfbe03b463e9088e4d9aadc429
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:42-07:00

Commit Message:
MORTEVIELLE: Rename F3F8 functions, rename everything related to Graphical Device

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/prog.h
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 991bda4..93b556e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -40,6 +40,10 @@ namespace Mortevielle {
 
 static const int nligne = 7;
 
+/**
+ * Alert function - Show
+ * @remarks	Originally called 'do_alert'
+ */
 int Alert::show(const Common::String &msg, int n) {
 	int coldep, esp, i, caseNumb, quoi, ix;
 	Common::String st, chaine;
@@ -182,6 +186,10 @@ int Alert::show(const Common::String &msg, int n) {
 	return do_alert_result;
 }
 
+/**
+ * Alert function - Decode Alert Details
+ * @remarks	Originally called 'decod'
+ */
 void Alert::decodeAlertDetails(Common::String s, int &nbc, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
 	int i, k;
 	bool v;
@@ -244,7 +252,6 @@ void Alert::drawAlertBox(int lidep, int nli, int tx) {
 	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
 }
 
-
 /**
  * Alert function - Set Button Text
  * @remarks	Originally called 'fait_choix'
@@ -425,34 +432,43 @@ void f3f8::draw() {
 	g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
 }
 
-void f3f8::divers(int np, bool b) {
+/**
+ * Alert function - Loop until F8 is pressed, update 
+ * Graphical Device if modified
+ * @remarks	Originally called 'diver'
+ */
+void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
-		parole(np, 0, 0);
-		atf3f8(key);
+		parole(SpeechNum, 0, 0);
+		waitForF3F8(key);
 		CHECK_QUIT;
 
-		if (newgd != gd) {
-			gd = newgd;
+		if (_newGraphicalDevice != _currGraphicalDevice) {
+			_currGraphicalDevice = _newGraphicalDevice;
 			hirs();
-			aff50(b);
+			aff50(drawAni50Fl);
 		}
-	} while (!(key == 66));
+	} while (!(key == 66)); // keycode for F8
 }
 
-void f3f8::atf3f8(int &key) {
+/**
+ * Alert function - Loop until F3 or F8 is pressed
+ * @remarks	Originally called 'atf3f8'
+ */
+void f3f8::waitForF3F8(int &key) {
 	do {
 		key = testou();
 		CHECK_QUIT;
 	} while (!((key == 61) || (key == 66)));
 }
 
-void f3f8::aff50(bool c) {
+void f3f8::aff50(bool drawAni50Fl) {
 	caff = 50;
 	_maff = 0;
 	taffich();
 	dessine(ades, 63, 12);
-	if (c)
+	if (drawAni50Fl)
 		ani50();
 	else
 		repon(2, c_paroles + 142);
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 76b824e..a8c0cb7 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -50,9 +50,9 @@ public:
 class f3f8 {
 public:
 	static void draw();
-	static void divers(int np, bool b);
-	static void atf3f8(int &key);
-	static void aff50(bool c);
+	static void checkForF8(int SpeechNum, bool drawAni50Fl);
+	static void waitForF3F8(int &key);
+	static void aff50(bool drawAni50Fl);
 	static void ani50();
 };
 	
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index bd7ad2c..679264b 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -56,6 +56,8 @@ int testou() {
 		if (keypressed())
 			ch = get_ch();
 		break;
+	default:
+		break;
 	}
 
 	return ord(ch);
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index d297529..eff7172 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -68,7 +68,7 @@ void outbloc(int n, pattern p, t_nhom pal) {
 void writepal(int n) {
 	t_nhom pal;
 
-	switch (gd) {
+	switch (_currGraphicalDevice) {
 	case tan:
 	case ega:
 	case ams:
@@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&mem[seg * 16 + dep]);
 
-	if (gd == her) {
+	if (_currGraphicalDevice == her) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
@@ -109,13 +109,13 @@ void pictout(int seg, int dep, int x, int y) {
 
 void sauvecr(int y, int dy) {
 	hideMouse();
-	s_sauv(gd, y, dy);
+	s_sauv(_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
 void charecr(int y, int dy) {
 	hideMouse();
-	s_char(gd, y, dy);
+	s_char(_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index b585177..9f2e83f 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -152,7 +152,7 @@ void Menu::menu_aff() {
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
-	if (gd == cga)
+	if (_currGraphicalDevice == cga)
 		color = 1;
 	else
 		color = 9;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a428340..76ba080 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -113,7 +113,7 @@ void dessine(int ad, int x, int y) {
 
 void dessine_rouleau() {
 	writepal(89);
-	if (gd == her) {
+	if (_currGraphicalDevice == her) {
 		mem[0x7000 * 16 + 14] = 15;
 	}
 	hideMouse();
@@ -266,7 +266,7 @@ void clsf10() {
 
 void stop() {
 	hirs();
-	gd = ams;
+	_currGraphicalDevice = ams;
 	hirs();
 	g_vm->quitGame();
 }
@@ -274,7 +274,7 @@ void stop() {
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
-	if (gd == cga)
+	if (_currGraphicalDevice == cga)
 		co = 3;
 	else
 		co = 11;
@@ -634,9 +634,10 @@ void drawClock() {
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
-	if ((gd == cga) || (gd == her))
+	if ((_currGraphicalDevice == cga) || (_currGraphicalDevice == her))
 		co = 0;
-	else co = 1;
+	else
+		co = 1;
 
 	if (_minute == 0)
 		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9dcbb85..fff6917 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -200,9 +200,9 @@ void fenat(char ans) {
 	int coul;
 
 	hideMouse();
-	if (gd == cga)
+	if (_currGraphicalDevice == cga)
 		coul = 2;
-	else if (gd == her)
+	else if (_currGraphicalDevice == her)
 		coul = 1;
 	else
 		coul = 12;
@@ -425,7 +425,7 @@ void sparl(float adr, float rep) {
 	key = 0;
 	do {
 		parole(repint, haut[caff - 69], 0);
-		f3f8::atf3f8(key);
+		f3f8::waitForF3F8(key);
 		CHECK_QUIT;
 	} while (!(key == 66));
 	hirs();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4112073..e6ecbde 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -120,7 +120,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	gd = ega;
+	_currGraphicalDevice = ega;
 	res = 2;
 
 	// Load the mort.dat resource
@@ -134,8 +134,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	gd = ega;
-	newgd = gd;
+	_currGraphicalDevice = ega;
+	_newGraphicalDevice = _currGraphicalDevice;
 	zuul = false;
 	tesok = false;
 	chartex();
@@ -153,10 +153,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	teskbd();
 	dialpre();
-	newgd = gd;
+	_newGraphicalDevice = _currGraphicalDevice;
 	teskbd();
-	if (newgd != gd)
-		gd = newgd;
+	if (_newGraphicalDevice != _currGraphicalDevice)
+		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
 	ades = 0x7000;
 
@@ -469,11 +469,11 @@ Common::Error MortevielleEngine::run() {
 void MortevielleEngine::showIntroduction() {
 	f3f8::aff50(false);
 	mlec = 0;
-	f3f8::divers(142, false);
+	f3f8::checkForF8(142, false);
 	CHECK_QUIT;
 
 	f3f8::ani50();
-	f3f8::divers(143, true);
+	f3f8::checkForF8(143, true);
 	CHECK_QUIT;
 
 	// TODO: Once music is implemented, only use the below delay if music is turned off
@@ -558,7 +558,7 @@ void MortevielleEngine::handleAction() {
 		g_vm->_menu.eraseMenu();
 		imen = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			change_gd((uint)pred(int, ord(inkey)) >> 1);
+			changeGraphicalDevice((uint)pred(int, ord(inkey)) >> 1);
 			return;
 		}
 		if (choisi && (msg[3] == sauve)) {
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 44b254f..2a4ab76 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -89,7 +89,7 @@ void hideMouse() {
 	if (mouse_shwn == 0) {
 		imp = odd(y_s);
 		j = p_o_s;
-		switch (gd) {
+		switch (_currGraphicalDevice) {
 		case cga:
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
@@ -180,7 +180,7 @@ void showMouse() {
 	j = p_o_s;
 	imp = odd(y_s);
 	i = x_s & 7;
-	switch (gd) {
+	switch (_currGraphicalDevice) {
 	case cga:
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 0177d3e..fb89357 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -239,8 +239,8 @@ void suite() {
 	caff = 51;
 	taffich();
 	teskbd();
-	if (newgd != gd)
-		gd = newgd;
+	if (_newGraphicalDevice != _currGraphicalDevice)
+		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
 	dessine(ades, 0, 0);
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index fa83b82..0c05e81 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -38,9 +38,13 @@
 
 namespace Mortevielle {
 
-void change_gd(int ngd) {
+/**
+ * Engine function - Change Graphical Device
+ * @remarks	Originally called 'change_gd'
+ */
+void changeGraphicalDevice(int newDevice) {
 	hideMouse();
-	gd = ngd;
+	_currGraphicalDevice = newDevice;
 	hirs();
 	initMouse();
 	showMouse();
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
index e88b943..c6ccca8 100644
--- a/engines/mortevielle/prog.h
+++ b/engines/mortevielle/prog.h
@@ -30,7 +30,7 @@
 
 namespace Mortevielle {
 
-extern void change_gd(int ngd);
+extern void changeGraphicalDevice(int newDevice);
 
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 4da3ef0..1306f7f 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -208,7 +208,7 @@ void taffich() {
 		npal = a + 37;
 	}
 	chardes(filename, lgt, handle);
-	if (gd == her) {
+	if (_currGraphicalDevice == her) {
 		for (i = 0; i <= 15; ++i) {
 			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index efd84cc..759c29a 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -124,7 +124,7 @@ int x,
         jh,
         mh,
         cs,
-        gd,                /*  Gd = graph device  */
+        _currGraphicalDevice,
         hdb,
         hfb,
         _hour,
@@ -147,7 +147,7 @@ int x,
         msg3,
         msg4,
         mlec,
-        newgd,
+        _newGraphicalDevice,
         c_zzz,
         mchai,
         menup,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a77586c..179c92d 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -273,7 +273,7 @@ extern int x,
         jh,
         mh,
         cs,
-        gd,                /*  Gd = graph device  */
+        _currGraphicalDevice,
         hdb,
         hfb,
         _hour,
@@ -296,7 +296,7 @@ extern int x,
         msg3,
         msg4,
         mlec,
-        newgd,
+        _newGraphicalDevice,
         c_zzz,
         mchai,
         menup,


Commit: ef42231f01f7c81931aa8a7e832e04bd695dcb08
    https://github.com/scummvm/scummvm/commit/ef42231f01f7c81931aa8a7e832e04bd695dcb08
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:44-07:00

Commit Message:
MORTEVIELLE: Rename graphical mode constants

Changed paths:
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index eff7172..e1bba27 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -69,15 +69,15 @@ void writepal(int n) {
 	t_nhom pal;
 
 	switch (_currGraphicalDevice) {
-	case tan:
-	case ega:
-	case ams:
+	case MODE_TANDY:
+	case MODE_EGA:
+	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
 			mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x;
 			mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y;
 		}
 		break;
-	case cga:
+	case MODE_CGA:
 		warning("TODO: If this code is needed, resolve the incompatible types");
 //		pal = palcga[n].a;
 		if (n < 89)
@@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&mem[seg * 16 + dep]);
 
-	if (_currGraphicalDevice == her) {
+	if (_currGraphicalDevice == MODE_HERCULES) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 9f2e83f..78d9449 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -152,7 +152,7 @@ void Menu::menu_aff() {
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
-	if (_currGraphicalDevice == cga)
+	if (_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
 		color = 9;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 76ba080..6707587 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -113,7 +113,7 @@ void dessine(int ad, int x, int y) {
 
 void dessine_rouleau() {
 	writepal(89);
-	if (_currGraphicalDevice == her) {
+	if (_currGraphicalDevice == MODE_HERCULES) {
 		mem[0x7000 * 16 + 14] = 15;
 	}
 	hideMouse();
@@ -266,7 +266,7 @@ void clsf10() {
 
 void stop() {
 	hirs();
-	_currGraphicalDevice = ams;
+	_currGraphicalDevice = MODE_AMSTRAD1512;
 	hirs();
 	g_vm->quitGame();
 }
@@ -274,7 +274,7 @@ void stop() {
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
-	if (_currGraphicalDevice == cga)
+	if (_currGraphicalDevice == MODE_CGA)
 		co = 3;
 	else
 		co = 11;
@@ -634,7 +634,7 @@ void drawClock() {
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
-	if ((_currGraphicalDevice == cga) || (_currGraphicalDevice == her))
+	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
 		co = 0;
 	else
 		co = 1;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index fff6917..9ded5a1 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -200,9 +200,9 @@ void fenat(char ans) {
 	int coul;
 
 	hideMouse();
-	if (_currGraphicalDevice == cga)
+	if (_currGraphicalDevice == MODE_CGA)
 		coul = 2;
-	else if (_currGraphicalDevice == her)
+	else if (_currGraphicalDevice == MODE_HERCULES)
 		coul = 1;
 	else
 		coul = 12;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index e6ecbde..67621d0 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -120,7 +120,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	_currGraphicalDevice = ega;
+	_currGraphicalDevice = MODE_EGA;
 	res = 2;
 
 	// Load the mort.dat resource
@@ -134,7 +134,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	_currGraphicalDevice = ega;
+	_currGraphicalDevice = MODE_EGA;
 	_newGraphicalDevice = _currGraphicalDevice;
 	zuul = false;
 	tesok = false;
@@ -296,8 +296,8 @@ bool MortevielleEngine::handleEvents() {
 			_mouseClick = true;
 		else if (event.type == Common::EVENT_LBUTTONUP)
 			_mouseClick = false;
-		break;
 
+		break;
 	case Common::EVENT_KEYDOWN:
 		addKeypress(event);
 		break;
@@ -445,7 +445,7 @@ Common::Error MortevielleEngine::run() {
 	int loadSlot = 0;
 	if (ConfMan.hasKey("save_slot")) {
 		int gameToLoad = ConfMan.getInt("save_slot");
-		if (gameToLoad >= 1 && gameToLoad <= 999)
+		if ((gameToLoad >= 1) && (gameToLoad <= 999))
 			loadSlot = gameToLoad;
 	}
 
@@ -487,9 +487,12 @@ void MortevielleEngine::showIntroduction() {
  * loses, and chooses to start playing the game again.
  */
 void MortevielleEngine::mainGame() {
-	if (rech_cfiec)  charge_cfiec();
+	if (rech_cfiec)
+		charge_cfiec();
+
 	for (crep = 1; crep <= c_zzz; crep ++) 
 		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+
 	charge_bruit5();
 	_menu.initMenu();
 
@@ -518,6 +521,7 @@ void MortevielleEngine::playGame() {
 		handleAction();
 		CHECK_QUIT;
 	} while (!((_quitGame) || (_endGame) || (_loseGame)));
+
 	if (_endGame)
 		endGame();
 	else if (_loseGame)
@@ -574,9 +578,11 @@ void MortevielleEngine::handleAction() {
 			if ((mnumo != OPCODE_NONE) && ((msg[3] == action) || (msg[3] == saction))) {
 				msg[4] = mnumo;
 				ecr3(g_vm->getString(S_IDEM));
-			} else return;
+			} else
+				return;
 		} else if (inkey == '\104') {
-			if ((x != 0) && (y != 0))  num = 9999;
+			if ((x != 0) && (y != 0))
+				num = 9999;
 			return;
 		}
 	}
@@ -584,39 +590,49 @@ void MortevielleEngine::handleAction() {
 		_quitGame = true;
 		tmaj3();
 	} else {
-		if ((funct) && (inkey != '\77'))  return;
+		if ((funct) && (inkey != '\77'))
+			return;
 		if (temps > lim) {
 			repon(2, 141);
-			if (num == 9999)  num = 0;
+			if (num == 9999)
+				num = 0;
 		} else {
 			mnumo = msg[3];
-			if ((msg[3] == action) || (msg[3] == saction))  mnumo = msg[4];
+			if ((msg[3] == action) || (msg[3] == saction))
+				mnumo = msg[4];
 			if (! anyone) {
 				if ((fouil) || (obpart)) {
-					if (y_s < 12)  return;
+					if (y_s < 12)
+						return;
+
 					if ((msg[4] == OPCODE_SOUND) || (msg[4] == OPCODE_LIFT)) {
 						oo = true;
 						if ((msg[4] == OPCODE_LIFT) || (obpart)) {
 							finfouil();
 							caff = s.mlieu;
 							crep = 998;
-						} else tsuiv();
+						} else
+							tsuiv();
 						mennor();
 					}
 				}
 			}
 			do {
-				if (! oo)  tsitu();
+				if (! oo)
+					tsitu();
+
 				if ((ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
 					if (okdes) {
 						okdes = false;
 						dessin(0);
 					}
-					if ((! syn) || (col))  repon(2, crep);
+					if ((! syn) || (col))
+						repon(2, crep);
 				}
 			} while (!(! syn));
-			if (ctrm != 0)  tctrm();
+			if (ctrm != 0)
+				tctrm();
 		}
 	}
 }
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2a4ab76..c96e92f 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -90,7 +90,7 @@ void hideMouse() {
 		imp = odd(y_s);
 		j = p_o_s;
 		switch (_currGraphicalDevice) {
-		case cga:
+		case MODE_CGA:
 			k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
@@ -102,7 +102,7 @@ void hideMouse() {
 				k = succ(int, k);
 			} while (!(k >= 5));
 			break;
-		case ams:
+		case MODE_AMSTRAD1512:
 			for (i = 0; i <= 3; ++i) {
 				port[0x3dd] = 1 << i;
 				k = 0;
@@ -120,7 +120,7 @@ void hideMouse() {
 				} while (!(k >= 8));
 			}
 			break;
-		case ega:
+		case MODE_EGA:
 			port[0x3c4] = 2;
 			port[0x3ce] = 8;
 			port[0x3cf] = 255;
@@ -140,7 +140,7 @@ void hideMouse() {
 				++i;
 			} while (!(i == 4));
 			break;
-		case her:
+		case MODE_HERCULES:
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (i = 0; i <= 5; ++i) {
 				for (k = 0; k <= 3; ++k) 
@@ -148,7 +148,7 @@ void hideMouse() {
 				j += 80;
 			}
 			break;
-		case tan:
+		case MODE_TANDY:
 			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 			k = 0;
 			do {
@@ -181,7 +181,7 @@ void showMouse() {
 	imp = odd(y_s);
 	i = x_s & 7;
 	switch (_currGraphicalDevice) {
-	case cga:
+	case MODE_CGA:
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
@@ -193,7 +193,7 @@ void showMouse() {
 			k = succ(int, k);
 		} while (!(k >= 5));
 		break;
-	case ams:
+	case MODE_AMSTRAD1512:
 		for (i = 0; i <= 3; ++i) {
 			j = p_o_s;
 			imp = odd(y_s);
@@ -212,7 +212,7 @@ void showMouse() {
 			} while (!(k >= 8));
 		}
 		break;
-	case ega:
+	case MODE_EGA:
 		port[0x3ce] = 4;
 		l = 0;
 		do {
@@ -227,7 +227,7 @@ void showMouse() {
 			++l;
 		} while (!(l == 4));
 		break;
-	case her:
+	case MODE_HERCULES:
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; ++i) {
 			for (k = 0; k <= 3; ++k)
@@ -235,7 +235,7 @@ void showMouse() {
 			j += 80;
 		}
 		break;
-	case tan:
+	case MODE_TANDY:
 		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
 		k = 0;
 		do {
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1306f7f..46df0b4 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -208,7 +208,7 @@ void taffich() {
 		npal = a + 37;
 	}
 	chardes(filename, lgt, handle);
-	if (_currGraphicalDevice == her) {
+	if (_currGraphicalDevice == MODE_HERCULES) {
 		for (i = 0; i <= 15; ++i) {
 			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 179c92d..a6d40e5 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -223,7 +223,7 @@ typedef int tfxx[108];
 /*------------------------------     ENUMS     ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-enum GraphicModes { ams = 0, cga = 1, ega = 2, her = 3, tan = 4 };
+enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
 
 /*---------------------------------------------------------------------------*/
 /*------------------------------   VARIABLES   ------------------------------*/


Commit: c0697ec3a087d27403b68fa76dda6d77535030af
    https://github.com/scummvm/scummvm/commit/c0697ec3a087d27403b68fa76dda6d77535030af
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:45-07:00

Commit Message:
MORTEVIELLE: remove pred and succ

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 975992e..eb8bf87 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -210,7 +210,7 @@ void fctTake() {
 				obpart = false;
 				affrep();
 			} else {
-				tabdon[acha + (pred(int, mchai) * 10) + pred(int, cs)] = 0;
+				tabdon[acha + ((mchai - 1) * 10) + cs - 1] = 0;
 				tsuiv();
 				++dobj;
 				if (dobj > 6) {
@@ -344,7 +344,7 @@ void fctLift() {
 		cx = 14;
 	else if (s.mlieu == 19)
 		cx = 15;
-	crep = tabdon[asoul + (cx << 3) + pred(int, num)];
+	crep = tabdon[asoul + (cx << 3) + (num - 1)];
 	if (crep == 255)
 		crep = 997;
 }
@@ -436,7 +436,7 @@ void fctLook() {
 		cx -= 4;
 	if (s.mlieu == 26)
 		cx = 21;
-	crep = tabdon[arega + (cx * 7) + pred(int, num)];
+	crep = tabdon[arega + (cx * 7) + num - 1];
 	if ((s.mlieu == 13) && (num == 8))
 		crep = 126;
 	if (s.mlieu == 19)
@@ -608,7 +608,7 @@ void fctOpen() {
 			cx = s.mlieu;
 			if (s.mlieu == 16)
 				cx = 14;
-			crep = tabdon[aouvr + (cx * 7) + pred(int, num)];
+			crep = tabdon[aouvr + (cx * 7) + num - 1];
 			if (crep == 254)
 				crep = 999;
 		} else
@@ -1330,7 +1330,7 @@ void fctDiscuss() {
 		co = 0;
 		lig = 0;
 		do {
-			icm = succ(int, icm);
+			++icm;
 			g_vm->_screenSurface.putxy(co, lig);
 			if (s.teauto[icm] == '*')
 				if (te[icm])
@@ -1356,7 +1356,7 @@ void fctDiscuss() {
 				cx = 41;
 			else
 				cx = 1;
-			cy = succ(int, ((uint)y >> 3));                  /* 0-199 => 1-25 */
+			cy = ((uint)y >> 3) + 1;      // 0-199 => 1-25
 			if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
 				if (choi != 0) {
 					lig = ((choi - 1) % 23) << 3;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 93b556e..20e2898 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -176,7 +176,7 @@ int Alert::show(const Common::String &msg, int n) {
 		tmp4 += " ";
 		g_vm->_screenSurface.writeg(tmp4, 1);
 	}
-	charecr(50, succ(int, nligne) << 4);
+	charecr(50, (nligne + 1) << 4);
 	showMouse();
 
 	/* Restore the background area */
@@ -233,7 +233,7 @@ void Alert::decodeAlertDetails(Common::String s, int &nbc, int &lineNumb, int &c
 }
 
 void Alert::setPosition(int ji, int coldep, int esp) {
-	g_vm->_screenSurface.putxy(coldep + (40 + esp) *pred(int, ji), 98);
+	g_vm->_screenSurface.putxy(coldep + (40 + esp) * (ji - 1), 98);
 }
 
 /**
@@ -244,7 +244,7 @@ void Alert::drawAlertBox(int lidep, int nli, int tx) {
 	if (tx > 640)
 		tx = 640;
 	int x = 320 - ((uint)tx >> 1);
-	int y = pred(int, lidep) << 3;
+	int y = (lidep - 1) << 3;
 	int xx = x + tx;
 	int yy = y + (nli << 3);
 	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
@@ -338,7 +338,7 @@ bool Ques::show() {
 			++memk;
 			y += 8;
 		}
-		for (j = 1; j <= succ(int, der - prem); ++j) {
+		for (j = 1; j <= der - prem + 1; ++j) {
 			rectangle &with = coor[j];
 
 			with.x1 = 45 * res;
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 679264b..0306e71 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -47,7 +47,7 @@ int testou() {
 	case '\26' :
 		if ((c_zzz == 1) && (c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-			c_zzz = succ(int, c_zzz);
+			++c_zzz;
 
 			return 61;
 		}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index e1bba27..57eaa4d 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -40,7 +40,7 @@ void copcha() {
 	int i = acha;
 	do {
 		tabdon[i] = tabdon[i + 390];
-		i = succ(int, i);
+		++i;
 	} while (!(i == acha + 390));
 }
 
@@ -62,7 +62,7 @@ void outbloc(int n, pattern p, t_nhom pal) {
 	ad += 4;
 	for (int i = 1; i <= p.tax; ++i)
 		for (int j = 1; j <= p.tay; ++j)
-			mem[0x6000 * 16 + ad + pred(int, j)*p.tax + pred(int, i)] = pal[n].hom[p.des[i][j]];
+			mem[(0x6000 * 16) + ad + (j - 1) * p.tax + i - 1] = pal[n].hom[p.des[i][j]];
 }
 
 void writepal(int n) {
@@ -73,8 +73,8 @@ void writepal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			mem[0x7000 * 16 + 2 * i] = tabpal[n][i].x;
-			mem[0x7000 * 16 + succ(int, 2 * i)] = tabpal[n][i].y;
+			mem[(0x7000 * 16) + (2 * i)] = tabpal[n][i].x;
+			mem[(0x7000 * 16) + (2 * i) + 1] = tabpal[n][i].y;
 		}
 		break;
 	case MODE_CGA:
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 78d9449..1f8f346 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -175,8 +175,8 @@ void Menu::menu_aff() {
 					msk = (uint)msk >> 1;
 					++x;
 				}
-				ind_tabl = succ(int, ind_tabl);
-				k = succ(int, k);
+				++ind_tabl;
+				++k;
 			} while (!(k == 3));
 			++y;
 		} while (!(y == 9));
@@ -204,7 +204,7 @@ void Menu::invers(int ix) {
 	if (msg4 == OPCODE_NONE)
 		return;
 
-	g_vm->_screenSurface.putxy(don[msg3][1] << 3, succ(void, lo(msg4)) << 3);
+	g_vm->_screenSurface.putxy(don[msg3][1] << 3, (lo(msg4) + 1) << 3);
 	switch (msg3) {
 	case 1:
 		s = _inv[lo(msg4)];
@@ -260,7 +260,7 @@ void Menu::util(int x, int y) {
 		ix = 3;
 	int xmx = dxcar * ix * res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = pred(int, ((uint)y >> 3)) + (msg3 << 8);
+		ix = (((uint)y >> 3) - 1) + (msg3 << 8);
 		if (ix != msg4) {
 			invers(1);
 			msg4 = ix;
@@ -288,7 +288,7 @@ void Menu::menuDown(int ii) {
 	xco = don[ii][1];
 	nb_lig = don[ii][4];
 	hideMouse();
-	sauvecr(10, succ(byte, don[ii][2]) << 1);
+	sauvecr(10, (don[ii][2] + 1) << 1);
 	xco = xco << 3;
 	if (res == 1)
 		cx = 10;
@@ -301,7 +301,7 @@ void Menu::menuDown(int ii) {
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
-		cx = succ(int, cx);
+		++cx;
 		switch (ii) {
 		case 1:
 			if (_inv[cx][0] != '*')
@@ -358,7 +358,7 @@ void Menu::menuDown(int ii) {
 void Menu::menuUp(int xx) {
 	/* debug('menuUp'); */
 	if (test0) {
-		charecr(10, succ(byte, don[xx][2]) << 1);
+		charecr(10, (don[xx][2] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
@@ -501,7 +501,7 @@ void Menu::initMenu() {
 			deline(i + c_dis, st, tai);
 			_dis[i] = delig + ' ';
 		}
-		i = succ(int, i);
+		++i;
 	} while (!(i == 22));
 	for (i = 1; i <= 8; ++i) {
 		_disc[i] = 0x500 + i;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 6707587..6fe396f 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -188,21 +188,21 @@ void ecr2(Common::String str_) {
 	else
 		tab = 6;
 	g_vm->_screenSurface.putxy(8, 177);
-	int tlig = 59 + pred(int, res) * 36;
+	int tlig = 59 + (res - 1) * 36;
 	if ((int)str_.size() < tlig)
 		g_vm->_screenSurface.writeg(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+		g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
 		g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
 	} else {
 		f2_all = true;
 		clsf2();
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.writeg(copy(str_, 1, pred(int, tlig)), 5);
+		g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.writeg(copy(str_, tlig, pred(int, (tlig << 1))), 5);
+		g_vm->_screenSurface.writeg(copy(str_, tlig, ((tlig << 1) - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 190);
 		g_vm->_screenSurface.writeg(copy(str_, tlig << 1, tlig * 3), 5);
 	}
@@ -303,7 +303,7 @@ void conv(int x, int &y) {
 	y = 128;
 	while (cx < x) {
 		y = (uint)y >> 1;
-		cx = succ(int, cx);
+		++cx;
 	}
 }
 
@@ -351,7 +351,7 @@ void repon(int f, int m) {
 
 	if ((m > 499) && (m < 563)) {
 		deline(m - 501 + c_st41, st, tay);
-		if (tay > ((58 + pred(int, res) * 37) << 1))
+		if (tay > ((58 + (res - 1) * 37) << 1))
 			f2_all = true;
 		else
 			f2_all = false;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9ded5a1..9a06668 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -395,9 +395,9 @@ void modinv() {
 	Common::String nomp;
 
 	int cy = 0;
-	for (int cx = 1; cx <= 6; cx++)
+	for (int cx = 1; cx <= 6; ++cx)
 		if (s.sjer[cx] != chr(0)) {
-			cy = succ(int, cy);
+			++cy;
 			r = (ord(s.sjer[cx]) + 400);
 			deline(r - 501 + c_st41, nom, tay);
 			nomp = delig;
@@ -405,7 +405,7 @@ void modinv() {
 			g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]);
 		}
 	if (cy < 6)
-		for (int cx = cy + 1; cx <= 6; cx++) {
+		for (int cx = cy + 1; cx <= 6; ++cx) {
 			g_vm->_menu.menut(g_vm->_menu._invt[cx], "                       ");
 			g_vm->_menu.disableMenuItem(g_vm->_menu._invt[cx]);
 		}
@@ -464,7 +464,7 @@ void premtet() {
 void ajchai() {
 
 
-	int cy = (acha + pred(int, pred(int, mchai) * 10));
+	int cy = acha + ((mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
@@ -696,7 +696,7 @@ void tcoord(int sx) {
 	while (cy < caff) {
 		a += tabdon[atdon];
 		atdon += 4;
-		cy = succ(int, cy);
+		++cy;
 	}
 
 	b = tabdon[atdon];
@@ -704,11 +704,11 @@ void tcoord(int sx) {
 		goto L1;
 	a += fleche;
 	cb = 0;
-	for (cy = 0; cy <= (sx - 2); cy++) {
-		ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
+	for (cy = 0; cy <= (sx - 2); ++cy) {
+		ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
 		cb += (ib * 4) + 2;
 	}
-	ib = (tabdon[a + cb] << 8) + tabdon[succ(int, a + cb)];
+	ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
 	if (ib == 0)
 		goto L1;
 
@@ -716,10 +716,10 @@ void tcoord(int sx) {
 	do {
 		cb += 2;
 		sx = tabdon[a + cb] * res;
-		sy = tabdon[succ(int, a + cb)];
+		sy = tabdon[(a + cb + 1)];
 		cb += 2;
 		ix = tabdon[a + cb] * res;
-		iy = tabdon[succ(int, a + cb)];
+		iy = tabdon[(a + cb + 1)];
 		++cy;
 	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib)));
 
@@ -794,7 +794,7 @@ void rechai(int &ch) {
 	cx = s.mlieu;
 	if (s.mlieu == 16)
 		cx = 14;
-	ch = tabdon[achai + (cx * 7) + pred(int, num)];
+	ch = tabdon[achai + (cx * 7) + num - 1];
 }
 
 void t23coul(int &l) {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 67621d0..7c75242 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -562,7 +562,7 @@ void MortevielleEngine::handleAction() {
 		g_vm->_menu.eraseMenu();
 		imen = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			changeGraphicalDevice((uint)pred(int, ord(inkey)) >> 1);
+			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
 		if (choisi && (msg[3] == sauve)) {
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index c96e92f..a367666 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -85,7 +85,7 @@ void hideMouse() {
 	int i, j, k, ps;;
 	bool imp;
 
-	mouse_shwn = pred(int, mouse_shwn);
+	--mouse_shwn;
 	if (mouse_shwn == 0) {
 		imp = odd(y_s);
 		j = p_o_s;
@@ -99,7 +99,7 @@ void hideMouse() {
 				WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
 				WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j += 80;
-				k = succ(int, k);
+				++k;
 			} while (!(k >= 5));
 			break;
 		case MODE_AMSTRAD1512:
@@ -116,7 +116,7 @@ void hideMouse() {
 						j += 0x2000;
 					}
 					imp = !imp;
-					k = succ(int, k);
+					++k;
 				} while (!(k >= 8));
 			}
 			break;
@@ -135,7 +135,7 @@ void hideMouse() {
 					ps = mem[0xa000 * 16 + j + 1];
 					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
-					k = succ(int, k);
+					++k;
 				} while (!(k >= 8));
 				++i;
 			} while (!(i == 4));
@@ -157,7 +157,7 @@ void hideMouse() {
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j += 160;
-				k = succ(int, k);
+				++k;
 			} while (!(k == 3));
 			break;
 		default:
@@ -190,7 +190,7 @@ void showMouse() {
 			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
 			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
 			j += 80;
-			k = succ(int, k);
+			++k;
 		} while (!(k >= 5));
 		break;
 	case MODE_AMSTRAD1512:
@@ -208,7 +208,7 @@ void showMouse() {
 					j += 0x2000;
 				}
 				imp = !imp;
-				k = succ(int, k);
+				++k;
 			} while (!(k >= 8));
 		}
 		break;
@@ -220,9 +220,9 @@ void showMouse() {
 			k = 0;
 			j = p_o_s;
 			do {
-				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[0xa000 * 16 + succ(int, j)] << 8);
+				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
-				k = succ(int, k);
+				++k;
 			} while (!(k >= 8));
 			++l;
 		} while (!(l == 4));
@@ -244,7 +244,7 @@ void showMouse() {
 				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
 			j += 160;
-			k = succ(int, k);
+			++k;
 		} while (!(k == 3));
 		break;
 	default:
@@ -357,16 +357,16 @@ void moveMouse(bool &funct, char &key) {
 				} else {
 					switch (in2) {
 					case 'K':
-						cx = pred(int, cx);
+						--cx;
 						break;
 					case 'P':
-						cy = succ(int, cy);
+						++cy;
 						break;
 					case 'M':
 						cx += 2;
 						break;
 					case 'H':
-						cy = pred(int, cy);
+						--cy;
 						break;
 					case 'G':
 						--cx;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 785e49a..c493e19 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -54,7 +54,7 @@ void init_chariot() {
 void trait_ph() {
 	const int deca[3] = {300, 30, 40};
 
-	ptr_tcph = pred(int, num_ph);
+	ptr_tcph = num_ph - 1;
 	ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
 	lefin = swap(t_cph[ptr_tcph + 1]) + deca[typlec];
 	nb_word = lefin - ledeb;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 46df0b4..29cdc0a 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -210,7 +210,7 @@ void taffich() {
 	chardes(filename, lgt, handle);
 	if (_currGraphicalDevice == MODE_HERCULES) {
 		for (i = 0; i <= 15; ++i) {
-			palh = READ_LE_UINT16(&mem[0x7000 * 16 + (succ(int, i) << 1)]);
+			palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (i = 0; i <= 15; ++i) {
@@ -218,7 +218,7 @@ void taffich() {
 			for (j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			mem[0x7000 * 16 + 2 + (k << 1)] = rang[i];
+			mem[(0x7000 * 16) + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a6d40e5..069a603 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -62,8 +62,6 @@ namespace Mortevielle {
 /*-------------------------     DEFINES    ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-#define pred(type, v) ((v) - 1)
-#define succ(type, v) ((v) + 1)
 #define ord(v) ((int) v)
 #define chr(v) ((char) v)
 #define lo(v) ((v) & 0xff)


Commit: ab90fae676cc9bff650d39f3acd0fa5407990822
    https://github.com/scummvm/scummvm/commit/ab90fae676cc9bff650d39f3acd0fa5407990822
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:46-07:00

Commit Message:
MORTEVIELLE: various cleanup and renaming

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 20e2898..c58f6b3 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -345,13 +345,13 @@ bool Ques::show() {
 			with.x2 = (tmax * 3 + 55) * res;
 			with.y1 = 27 + j * 8;
 			with.y2 = 34 + j * 8;
-			with.etat = true;
+			with.enabled = true;
 
 			while ((int)chaines[j].size() < tmax) {
 				chaines[j] += ' ';
 			}
 		}
-		coor[j + 1].etat = false;
+		coor[j + 1].enabled = false;
 		if (res == 1)
 			rep = 10;
 		else
@@ -367,8 +367,8 @@ bool Ques::show() {
 			CHECK_QUIT0;
 
 			k = 1;
-			while (coor[k].etat && ! dans_rect(coor[k]))  k = k + 1;
-			if (coor[k].etat) {
+			while (coor[k].enabled && ! dans_rect(coor[k]))  k = k + 1;
+			if (coor[k].enabled) {
 				if ((memk != 0) && (memk != k)) {
 //					for (j = 1; j <= tmax; ++j)
 //						st[j] = chaines[memk][j];
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 759c29a..a304592 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -204,7 +204,7 @@ int tbi[256];
 chariot c1, c2, c3;
 float addfix;
 t_pcga palsav[91];
-doublet tabpal[91][17];
+Common::Point tabpal[91][17];
 t_pcga palcga[91];
 pattern tpt[15];
 
@@ -248,6 +248,7 @@ int port[0xfff];
 byte mem[65536 * 16];
 
 void intr(int intNum, registres &regs) {
+	warning("STUBBED: Call to DOS interrupt #%d", intNum);
 }
 
 /**
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 069a603..bc63aa9 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -75,23 +75,24 @@ namespace Mortevielle {
 
 const float freq0 = 1.19318e6;
 
-const int seg_syst = 0x6fed;
-const int segmou = 0x6f00;
-const int segdon = 0x6c00;
 const int adani = 0x7314;
-const int adword = 0x4000;
-const int adtroct = 0x406b;
 const int adbruit = 0x5cb0;/*2C00;*/
-const int adbruit1 = 0x6924;/*3874;*/
-const int adbruit2 = 0x6b30;/*3A80;*/
+const int adbruit1 = 0x6924;
 const int adbruit3 = 0x6ba6;/*3AF6;*/
 const int adbruit5 = 0x3b50;
 const int adson = 0x5cb0;/*2C00;*/
-const int adson2 = 0x60b0;/*3000;*/
+const int adtroct = 0x406b;
+const int adword = 0x4000;
 const int offsetb1 = 6;
-const int offsetb2 = 4;
 const int offsetb3 = 6;
 
+// Useless constants
+//const int segdon = 0x6c00;
+//const int adbruit2 = 0x6b30;/*3A80;*/
+//const int adson2 = 0x60b0;/*3000;*/
+//const int seg_syst = 0x6fed;
+//const int offsetb2 = 4;
+
 const int null = 255;
 
 const int tempo_mus = 71;
@@ -168,6 +169,7 @@ struct sav_chaine {
 	bool ipre;
 	char heure;
 };
+
 struct registres {
 	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
 };
@@ -177,22 +179,23 @@ struct ind {
 	byte point;
 };
 
-typedef int word1;
 struct chariot {
 	int val,
-	        code,
-	        acc,
-	        freq,
-	        rep;
+		code,
+		acc,
+		freq,
+		rep;
 };
 
+/*
 struct doublet {
 	byte x, y;
 };
+*/
 
 struct rectangle {
 	int x1, x2, y1, y2;
-	bool etat;
+	bool enabled;
 };
 
 struct pattern {
@@ -214,7 +217,7 @@ struct t_pcga {
 };
 
 typedef int tablint[256];
-typedef doublet tabdb[17];
+//typedef Common::Point tabdb[17];
 typedef int tfxx[108];
 
 /*---------------------------------------------------------------------------*/
@@ -351,7 +354,7 @@ extern int tbi[256];
 extern chariot c1, c2, c3;
 extern float addfix;
 extern t_pcga palsav[91];
-extern doublet tabpal[91][17];
+extern Common::Point tabpal[91][17];
 extern t_pcga palcga[91];
 extern pattern tpt[15];
 


Commit: 2f4671a2df70711a9fd850a04981c77159789ca3
    https://github.com/scummvm/scummvm/commit/2f4671a2df70711a9fd850a04981c77159789ca3
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:47-07:00

Commit Message:
MORTEVIELLE: Add detection for another French version

Changed paths:
    engines/mortevielle/detection_tables.h



diff --git a/engines/mortevielle/detection_tables.h b/engines/mortevielle/detection_tables.h
index 307d125..2b9a451 100644
--- a/engines/mortevielle/detection_tables.h
+++ b/engines/mortevielle/detection_tables.h
@@ -37,7 +37,20 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
-
+	// French
+	{
+		"mortevielle",
+		"",
+		{
+			{"menu.mor", 0, "3fef0a3f8fca99fdcb6dbca8cbcef46f", 160},
+			{"dxx.mor", 0, "949e68e829ecd5ad29e36a00347a9e7e", 207744},
+			AD_LISTEND
+		},
+		Common::FR_FRA,
+		Common::kPlatformPC,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
 	// German
 	{
 		"mortevielle",


Commit: a3ae21f14a19531626526b75ccc9e784de118ffa
    https://github.com/scummvm/scummvm/commit/a3ae21f14a19531626526b75ccc9e784de118ffa
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:49-07:00

Commit Message:
MORTEVIELLE: Fix a bug in decodeAlertDetails

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index c58f6b3..b332c7e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -190,17 +190,19 @@ int Alert::show(const Common::String &msg, int n) {
  * Alert function - Decode Alert Details
  * @remarks	Originally called 'decod'
  */
-void Alert::decodeAlertDetails(Common::String s, int &nbc, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
+void Alert::decodeAlertDetails(Common::String s, int &choiceNumb, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
 	int i, k;
 	bool v;
 
 	//val(s[2], nbc, i);
-	nbc = atoi(s.c_str() + 1);
+	choiceNumb = atoi(s.c_str() + 1);
 	i = 0;
 
 	c = "";
 	lineNumb = 0;
-	i = 5;
+
+	// Originally set to 5, decreased to 4 because strings are 0 based, and not 1 based as in Pascal
+	i = 4;
 	k = 0;
 	v = true;
 	col = 0;
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index a8c0cb7..c4d4ab2 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -34,7 +34,7 @@ namespace Mortevielle {
 
 class Alert {
 private:
-	static void decodeAlertDetails(Common::String s, int &nbc, int &nbl, int &col, Common::String &c, Common::String &cs);
+	static void decodeAlertDetails(Common::String s, int &choiceNumb, int &lineNumb, int &col, Common::String &c, Common::String &cs);
 	static void setPosition(int ji, int coldep, int esp);
 	static void drawAlertBox(int lidep, int nli, int tx);
 	static void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);


Commit: 0e5637c5241b97419afe34d27997bd165e74e3a1
    https://github.com/scummvm/scummvm/commit/0e5637c5241b97419afe34d27997bd165e74e3a1
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:51-07:00

Commit Message:
MORTEVIELLE: cleanup decodeAlertDetails, rename parameters and variables

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b332c7e..beac0a5 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -190,44 +190,40 @@ int Alert::show(const Common::String &msg, int n) {
  * Alert function - Decode Alert Details
  * @remarks	Originally called 'decod'
  */
-void Alert::decodeAlertDetails(Common::String s, int &choiceNumb, int &lineNumb, int &col, Common::String &c, Common::String &cs) {
-	int i, k;
-	bool v;
+void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr) {
+	// The second character of the string contains the number of choices
+	choiceNumb = atoi(inputStr.c_str() + 1);
 
-	//val(s[2], nbc, i);
-	choiceNumb = atoi(s.c_str() + 1);
-	i = 0;
-
-	c = "";
+	choiceStr = "";
+	col = 0;
 	lineNumb = 0;
 
 	// Originally set to 5, decreased to 4 because strings are 0 based, and not 1 based as in Pascal
-	i = 4;
-	k = 0;
-	v = true;
-	col = 0;
+	int i = 4;
+	int k = 0;
+	bool empty = true;
 
-	while (s[i] != ']') {
-		c += s[i];
-		if ((s[i] == '|') || (s[i + 1] == ']')) {
+	for (; inputStr[i] != ']'; ++i) {
+		choiceStr += inputStr[i];
+		if ((inputStr[i] == '|') || (inputStr[i + 1] == ']')) {
 			if (k > col)
 				col = k;
 			k = 0;
 			++lineNumb;
-		} else if (s[i] != ' ')
-			v = false;
-		++i;
+		} else if (inputStr[i] != ' ')
+			empty = false;
 		++k;
 	}
-	if (v)  {
-		c = "";
+
+	if (empty)  {
+		choiceStr = "";
 		col = 20;
 	} else {
-		c += ']';
+		choiceStr += ']';
 		col += 6;
 	}
 	++i;
-	cs = copy(s, i, 30);
+	choiceListStr = copy(inputStr, i, 30);
 	if (res == 2)
 		col *= 6;
 	else
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index c4d4ab2..a3f98f3 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -34,7 +34,7 @@ namespace Mortevielle {
 
 class Alert {
 private:
-	static void decodeAlertDetails(Common::String s, int &choiceNumb, int &lineNumb, int &col, Common::String &c, Common::String &cs);
+	static void decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr);
 	static void setPosition(int ji, int coldep, int esp);
 	static void drawAlertBox(int lidep, int nli, int tx);
 	static void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);


Commit: 49422afea18eeb39bd80a2c7f66924b41f38245a
    https://github.com/scummvm/scummvm/commit/49422afea18eeb39bd80a2c7f66924b41f38245a
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:52-07:00

Commit Message:
MORTEVIELLE: Fix questions display when entering hidden passage

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index beac0a5..50cfc7b 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -291,12 +291,13 @@ bool Ques::show() {
 
 	bool q, func, test;
 	int i, j, k, y, memk;
-	int tay , tmax;
+	int curLength, maxLength;
 	int rep, prem, der;
 	char st[1410];
 	char key;
 	rectangle coor[max_rect];
-	Common::String chaines[15];
+	Common::String choiceArray[15];
+	Common::String currChoice;
 	int compte;
 
 
@@ -310,7 +311,7 @@ bool Ques::show() {
 		hirs();
 		showMouse();
 		++i;
-		deline(ta[i], st, tay);
+		deline(ta[i], st, curLength);
 		if (res == 1)
 			y = 29;
 		else
@@ -325,14 +326,14 @@ bool Ques::show() {
 			der = 510;
 		}
 		y = 35;
-		tmax = 0;
+		maxLength = 0;
 		memk = 1;
 		for (j = prem; j <= der; ++j) {
-			deline(j, st, tay);
-			if (tay > tmax)
-				tmax = tay;
+			deline(j, st, curLength);
+			if (curLength > maxLength)
+				maxLength = curLength;
 			afftex(st, 100, y, 100, 1, 0);
-			chaines[memk] = delig;
+			choiceArray[memk] = delig;
 			++memk;
 			y += 8;
 		}
@@ -340,13 +341,13 @@ bool Ques::show() {
 			rectangle &with = coor[j];
 
 			with.x1 = 45 * res;
-			with.x2 = (tmax * 3 + 55) * res;
+			with.x2 = (maxLength * 3 + 55) * res;
 			with.y1 = 27 + j * 8;
 			with.y2 = 34 + j * 8;
 			with.enabled = true;
 
-			while ((int)chaines[j].size() < tmax) {
-				chaines[j] += ' ';
+			while ((int)choiceArray[j].size() < maxLength) {
+				choiceArray[j] += ' ';
 			}
 		}
 		coor[j + 1].enabled = false;
@@ -354,7 +355,7 @@ bool Ques::show() {
 			rep = 10;
 		else
 			rep = 6;
-		g_vm->_screenSurface.drawBox(80, 33, 40 + tmax * rep, (der - prem) * 8 + 16, 15);
+		g_vm->_screenSurface.drawBox(80, 33, 40 + maxLength * rep, (der - prem) * 8 + 16, 15);
 		rep = 0;
 		j = 0;
 		memk = 0;
@@ -365,29 +366,32 @@ bool Ques::show() {
 			CHECK_QUIT0;
 
 			k = 1;
-			while (coor[k].enabled && ! dans_rect(coor[k]))  k = k + 1;
+			while (coor[k].enabled && ! dans_rect(coor[k]))
+				++k;
 			if (coor[k].enabled) {
 				if ((memk != 0) && (memk != k)) {
-//					for (j = 1; j <= tmax; ++j)
-//						st[j] = chaines[memk][j];
-					strncpy(st, chaines[memk].c_str(), tmax);
-//
-					st[1 + tmax] = '$';
+					st[0] = ' ';
+//					for (j = 0; j <= maxLength; ++j)
+//						st[j + 1] = choiceArray[memk][j];
+					strncpy(st + 1, choiceArray[memk].c_str(), maxLength);
+					st[1 + maxLength] = '$';
 					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				}
 				if (memk != k) {
-//					for (j = 1; j <= tmax; ++j)
-//						st[j] = chaines[k][j];
-					strncpy(st, chaines[k].c_str(), tmax);
-					st[1 + tmax] = '$';
+					st[0] = ' ';
+//					for (j = 0; j <= maxLength; ++j)
+//						st[j + 1] = choiceArray[k][j];
+					strncpy(st + 1, choiceArray[k].c_str(), maxLength);
+					st[1 + maxLength] = '$';
 					afftex(st, 100, 27 + k * 8, 100, 1, 1);
 					memk = k;
 				}
 			} else if (memk != 0) {
-//				for (j = 1; j <= tmax; ++j)
-//					st[j] = chaines[memk][j];
-				strncpy(st, chaines[memk].c_str(), tmax);
-				st[1 + tmax] = '$';
+					st[0] = ' ';
+//				for (j = 0; j <= maxLength; ++j)
+//					st[j + 1] = choiceArray[memk][j];
+				strncpy(st + 1, choiceArray[memk].c_str(), maxLength);
+				st[1 + maxLength] = '$';
 				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
 				memk = 0;
 			}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 9a06668..6ef3294 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -280,13 +280,6 @@ void tlu(int af, int ob) {
 	crep = 998;
 }
 
-void delin(int n) {
-	char s[1410];
-	int t;
-
-	deline(n, s, t);
-}
-
 void affrep() {
 	caff = s.mlieu;
 	crep = s.mlieu;
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 1d66548..2c95f1e 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -38,7 +38,6 @@ extern void tkey1(bool d);
 extern void tmlieu(int mli);
 /* NIVEAU 7 */
 extern void tlu(int af, int ob);
-extern void delin(int n);
 extern void affrep();
 extern void mfouen();
 /* NIVEAU 6 */
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 95ccc3b..ceac79a 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -126,7 +126,7 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 /**
  * Decode and extract the line with the given Id
  */
-void deline(int num, char *l , int &tl) {
+void deline(int num, char *line , int &length) {
 	if (num < 0) {
 		warning("deline: num < 0! Skipping");
 		return;
@@ -137,20 +137,22 @@ void deline(int num, char *l , int &tl) {
 	int ts = t_rec[num].indis;
 	byte ps = t_rec[num].point;
 	int i = ts;
-	tl = 1;
+	length = 1;
 	int j = 1;
+	// Initialize properly first string character
+	line[0] = ' ';
 	byte k = ps;
 	bool endFl = false;
 	char let;
 	do {
 		cinq_huit(let, i, k, endFl);
-		l[j] = let;
+		line[j] = let;
 		if (j < 254)
 			delig += let;
 		++j;
 	} while (!endFl);
-	tl = j - 1;
-	if (tl < 255)
+	length = j - 1;
+	if (length < 255)
 		// Remove trailing '$'
 		delig.deleteLastChar();
 }
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 470479a..32d3c4c 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -34,7 +34,7 @@ namespace Mortevielle {
 
 extern Common::String delig;
 
-extern void deline(int num , char *l , int &tl);
+extern void deline(int num , char *line , int &length);
 extern void afftex(char *ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle


Commit: f9666f4e30c27098026949590388541696771172
    https://github.com/scummvm/scummvm/commit/f9666f4e30c27098026949590388541696771172
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:53-07:00

Commit Message:
MORTEVIELLE: rename variables in Ques::show(), fix remaining glitches

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index eb8bf87..1f83c5c 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -621,7 +621,7 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	bool entre;
+	bool enterPassageFl;
 	char st[1410];
 	Common::String str_;
 	int i, tay;
@@ -663,17 +663,20 @@ void fctPlace() {
 			else {
 				s.icave = s.derobj;
 				if (s.derobj == 151) {
+					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
 					repon(2, 165);
 					maivid();
 					parole(6, -9, 1);
+
+					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
 					if (answer== 1)  {
 						deline(582, st, tay);
 						i = Alert::show(delig, 1);
 						tesok = false;
-						entre = Ques::show();
+						enterPassageFl = Ques::show();
 						hideMouse();
 						hirs();
 						dessine_rouleau();
@@ -688,7 +691,7 @@ void fctPlace() {
 							person();
 
 						g_vm->_menu.menu_aff();
-						if (entre) {
+						if (enterPassageFl) {
 							s.mlieu = 17;
 							tmlieu(17);
 						} else {
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 50cfc7b..b6253b0 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -285,59 +285,59 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
 
 /*------------------------------------------------------------------------*/
 
+/**
+ * Questions asked before entering the hidden passage
+ */
 bool Ques::show() {
-	const int ta[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
-	const int ok[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
+	const int textIndexArr[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
+	const int correctAnswerArr[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
-	bool q, func, test;
-	int i, j, k, y, memk;
+	int optionPosY;
 	int curLength, maxLength;
-	int rep, prem, der;
-	char st[1410];
+	int rep;
+	int firstOption, lastOption;
 	char key;
 	rectangle coor[max_rect];
 	Common::String choiceArray[15];
-	Common::String currChoice;
-	int compte;
-
+	char st[1410];
 
-	bool ques_result;
-	test = false;
-	i = 0;
-	compte = 0;
+	int currChoice, prevChoice;
+	int indx = 0;
+	int correctCount = 0;
+	bool protectionCheck = false;
 
 	do {
 		hideMouse();
 		hirs();
 		showMouse();
-		++i;
-		deline(ta[i], st, curLength);
+		++indx;
+		deline(textIndexArr[indx], st, curLength);
+		int dialogHeight;
 		if (res == 1)
-			y = 29;
+			dialogHeight = 29;
 		else
-			y = 23;
-		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, y));
+			dialogHeight = 23;
+		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
 		afftex(st, 20, 15, 100, 2, 0);
-		if (i != 10) {
-			prem = ta[i] + 1;
-			der = ta[i + 1] - 1;
+		if (indx != 10) {
+			firstOption = textIndexArr[indx] + 1;
+			lastOption = textIndexArr[indx + 1] - 1;
 		} else {
-			prem = 503;
-			der = 510;
+			firstOption = 503;
+			lastOption = 510;
 		}
-		y = 35;
+		optionPosY = 35;
 		maxLength = 0;
-		memk = 1;
-		for (j = prem; j <= der; ++j) {
+
+		for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) {
 			deline(j, st, curLength);
 			if (curLength > maxLength)
 				maxLength = curLength;
-			afftex(st, 100, y, 100, 1, 0);
-			choiceArray[memk] = delig;
-			++memk;
-			y += 8;
+			afftex(st, 100, optionPosY, 100, 1, 0);
+			choiceArray[prevChoice] = delig;
+			optionPosY += 8;
 		}
-		for (j = 1; j <= der - prem + 1; ++j) {
+		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
 			rectangle &with = coor[j];
 
 			with.x1 = 45 * res;
@@ -350,65 +350,73 @@ bool Ques::show() {
 				choiceArray[j] += ' ';
 			}
 		}
-		coor[j + 1].enabled = false;
+		coor[lastOption - firstOption + 2].enabled = false;
 		if (res == 1)
 			rep = 10;
 		else
 			rep = 6;
-		g_vm->_screenSurface.drawBox(80, 33, 40 + maxLength * rep, (der - prem) * 8 + 16, 15);
+		g_vm->_screenSurface.drawBox(80, 33, 40 + (maxLength * rep), (lastOption - firstOption) * 8 + 16, 15);
 		rep = 0;
-		j = 0;
-		memk = 0;
+
+		prevChoice = 0;
 		do {
 			g_vm->setMouseClick(false);
 			tesok = false;
-			moveMouse(func, key);
+			bool flag;
+			moveMouse(flag, key);
 			CHECK_QUIT0;
 
-			k = 1;
-			while (coor[k].enabled && ! dans_rect(coor[k]))
-				++k;
-			if (coor[k].enabled) {
-				if ((memk != 0) && (memk != k)) {
+			currChoice = 1;
+			while (coor[currChoice].enabled && !dans_rect(coor[currChoice]))
+				++currChoice;
+			if (coor[currChoice].enabled) {
+				if ((prevChoice != 0) && (prevChoice != currChoice)) {
 					st[0] = ' ';
 //					for (j = 0; j <= maxLength; ++j)
-//						st[j + 1] = choiceArray[memk][j];
-					strncpy(st + 1, choiceArray[memk].c_str(), maxLength);
+//						st[j + 1] = choiceArray[prevChoice][j];
+					strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength);
 					st[1 + maxLength] = '$';
-					afftex(st, 100, 27 + memk * 8, 100, 1, 0);
+					afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
-				if (memk != k) {
+				if (prevChoice != currChoice) {
 					st[0] = ' ';
 //					for (j = 0; j <= maxLength; ++j)
-//						st[j + 1] = choiceArray[k][j];
-					strncpy(st + 1, choiceArray[k].c_str(), maxLength);
+//						st[j + 1] = choiceArray[currChoice][j];
+					strncpy(st + 1, choiceArray[currChoice].c_str(), maxLength);
 					st[1 + maxLength] = '$';
-					afftex(st, 100, 27 + k * 8, 100, 1, 1);
-					memk = k;
+					afftex(st, 100, 27 + (currChoice * 8), 100, 1, 1);
+					prevChoice = currChoice;
 				}
-			} else if (memk != 0) {
+			} else if (prevChoice != 0) {
 					st[0] = ' ';
 //				for (j = 0; j <= maxLength; ++j)
-//					st[j + 1] = choiceArray[memk][j];
-				strncpy(st + 1, choiceArray[memk].c_str(), maxLength);
+//					st[j + 1] = choiceArray[prevChoice][j];
+				strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength);
 				st[1 + maxLength] = '$';
-				afftex(st, 100, 27 + memk * 8, 100, 1, 0);
-				memk = 0;
+				afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0);
+				prevChoice = 0;
 			}
-		} while (!((memk != 0) && g_vm->getMouseClick()));
-		if (memk == ok[i])
-			++compte;
+		} while (!((prevChoice != 0) && g_vm->getMouseClick()));
+
+		warning("Expected answer: %d, answer: %d", prevChoice, correctAnswerArr[indx]);
+		if (prevChoice == correctAnswerArr[indx])
+			// Answer is correct
+			++correctCount;
 		else {
-			if (i == 5)
-				++i;
-			if ((i == 7) || (i == 8))
-				i = 10;
+			// Skip questions that may give hints on previous wrong answer
+			if (indx == 5)
+				++indx;
+
+			if ((indx == 7) || (indx == 8))
+				indx = 10;
+		}
+		if (indx == 10) {
+			warning("Skipping protection check: testprot()");
+			protectionCheck = true;
 		}
-		if (i == 10)
-			q = /*testprot*/ true;
-	} while (!(i == 10));
-	ques_result = (compte == 10) && q;
-	return ques_result;
+	} while (!(indx == 10));
+
+	return (correctCount == 10) && protectionCheck;
 }
 
 /*------------------------------------------------------------------------*/


Commit: 32ba785f4af3cdb43b2803859bec2773af9ab504
    https://github.com/scummvm/scummvm/commit/32ba785f4af3cdb43b2803859bec2773af9ab504
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:54-07:00

Commit Message:
MORTEVIELLE: Changed some char fields in sav_chaine to byte

This fixes a problem with inventory display, because the original Pascal type was unsigned, whereas char is cigned

Changed paths:
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index bc63aa9..5bbc8bd 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -161,9 +161,9 @@ extern const byte rang[16];
 
 struct sav_chaine {
 	int conf;
-	char pourc[11];
-	char teauto[43];
-	char sjer[31];
+	byte pourc[11];
+	byte teauto[43];
+	byte sjer[31];
 	int mlieu, iboul, ibag, icave, ivier, ipuit;
 	int derobj, iloic, icryp;
 	bool ipre;


Commit: 3a0a48c0a56cedb57d37c65bbc4441108acd495c
    https://github.com/scummvm/scummvm/commit/3a0a48c0a56cedb57d37c65bbc4441108acd495c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:21:56-07:00

Commit Message:
MORTEVIELLE: Convert some more char types to byte

Changed paths:
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index a304592..7aef569 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -176,7 +176,7 @@ byte tabdon[4001];
 
 Common::String stpou;               /* donne le % d'indices */ //Translation: "Provides the % of hints"
 byte is;
-char mode;
+byte mode;
 Common::String al_mess,
        err_mess,
        ind_mess,
@@ -185,7 +185,7 @@ Common::String al_mess,
 int nbrep[9];
 int nbrepm[9];
 int msg[5];
-char touv[8];
+byte touv[8];
 sav_chaine s, s1;
 byte bufcha[391];
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5bbc8bd..af8ef9d 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -63,7 +63,7 @@ namespace Mortevielle {
 /*---------------------------------------------------------------------------*/
 
 #define ord(v) ((int) v)
-#define chr(v) ((char) v)
+#define chr(v) ((unsigned char) v)
 #define lo(v) ((v) & 0xff)
 #define hi(v) (((v) >> 8) & 0xff)
 #define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
@@ -167,7 +167,7 @@ struct sav_chaine {
 	int mlieu, iboul, ibag, icave, ivier, ipuit;
 	int derobj, iloic, icryp;
 	bool ipre;
-	char heure;
+	byte heure;
 };
 
 struct registres {
@@ -326,7 +326,7 @@ extern byte tabdon[4001];
 
 extern Common::String stpou;                               /* donne le % d'indices */
 extern byte is;
-extern char mode;
+extern byte mode;
 extern Common::String al_mess,
        err_mess,
        ind_mess,
@@ -335,7 +335,7 @@ extern Common::String al_mess,
 extern int nbrep[9];
 extern int nbrepm[9];
 extern int msg[5];
-extern char touv[8];
+extern byte touv[8];
 extern sav_chaine s, s1;
 extern byte bufcha[391];
 


Commit: f382f7adc60e03fbe4261aa5d28238cd9a7c4ae5
    https://github.com/scummvm/scummvm/commit/f382f7adc60e03fbe4261aa5d28238cd9a7c4ae5
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:57-07:00

Commit Message:
MORTEVIELLE: remove a couple of GOTOs

Changed paths:
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 0c05e81..96083f1 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -167,7 +167,8 @@ void tsitu() {
 	if (brt)
 		if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
 			ctrm = 4;
-			goto L2;
+			mennor();
+			return;
 		}
 	if (msg[3] == MENU_MOVE)
 		fctMove();
@@ -234,7 +235,8 @@ L1:
 	if (anyone) {
 		quelquun();
 		anyone = false;
-		goto L2;
+		mennor();
+		return;
 	}
 	calch(j, h, m);
 	if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) ||
@@ -255,7 +257,6 @@ L1:
 			tperd();
 		}
 	}
-L2:
 	mennor();
 }
 


Commit: d6b76bbe318d704db96f9a5c73a5fcb3f7f4268d
    https://github.com/scummvm/scummvm/commit/d6b76bbe318d704db96f9a5c73a5fcb3f7f4268d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:58-07:00

Commit Message:
MORTEVIELLE: Fix protection skip and avoid instant exit

Changed paths:
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b6253b0..8d53da7 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -413,6 +413,7 @@ bool Ques::show() {
 		if (indx == 10) {
 			warning("Skipping protection check: testprot()");
 			protectionCheck = true;
+			tesok = true;
 		}
 	} while (!(indx == 10));
 


Commit: 1cce0754ef96cfd0d185105d945afdee238eb4ce
    https://github.com/scummvm/scummvm/commit/1cce0754ef96cfd0d185105d945afdee238eb4ce
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:21:59-07:00

Commit Message:
MORTEVIELLE: Some more cleanup, add alternate file names used by german and alternate french versions

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 8d53da7..7cf12cb 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -38,8 +38,6 @@
 
 namespace Mortevielle {
 
-static const int nligne = 7;
-
 /**
  * Alert function - Show
  * @remarks	Originally called 'do_alert'
@@ -57,7 +55,6 @@ int Alert::show(const Common::String &msg, int n) {
 	// Make a copy of the current screen surface for later restore
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
-	/*debug('** do_alert **');*/
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 	int do_alert_result;
 	hideMouse();
@@ -66,7 +63,7 @@ int Alert::show(const Common::String &msg, int n) {
 
 	g_vm->setMouseClick(false);
 	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
-	sauvecr(50, (nligne + 1) << 4);
+	sauvecr(50, (NUM_LINES + 1) << 4);
 
 	i = 0;
 	if (chaine == "") {
@@ -176,7 +173,7 @@ int Alert::show(const Common::String &msg, int n) {
 		tmp4 += " ";
 		g_vm->_screenSurface.writeg(tmp4, 1);
 	}
-	charecr(50, (nligne + 1) << 4);
+	charecr(50, (NUM_LINES + 1) << 4);
 	showMouse();
 
 	/* Restore the background area */
@@ -413,6 +410,7 @@ bool Ques::show() {
 		if (indx == 10) {
 			warning("Skipping protection check: testprot()");
 			protectionCheck = true;
+			// tesok is set to true in testprot()
 			tesok = true;
 		}
 	} while (!(indx == 10));
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index a3f98f3..661c544 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -32,6 +32,8 @@
 
 namespace Mortevielle {
 
+static const int NUM_LINES = 7;
+
 class Alert {
 private:
 	static void decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 1f8f346..7cf6a31 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -471,7 +471,9 @@ void Menu::initMenu() {
 	Common::File f;
 
 	if (!f.open("menufr.mor"))
-		error("Missing file - menufr.mor");
+		if (!f.open("menual.mor"))
+			if (!f.open("menu.mor"))
+				error("Missing file - menufr.mor or menual.mor or menu.mor");
 
 	f.read(lettres, 7 * 24);
 	f.close();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 6fe396f..b740ad2 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -147,7 +147,7 @@ void text1(int x, int y, int nb, int m) {
 }
 
 void initouv() {
-	for (int cx = 1; cx <= 7; cx++)
+	for (int cx = 1; cx <= 7; ++cx)
 		touv[cx] = chr(0);
 }
 
@@ -444,7 +444,7 @@ void affper(int per) {
 	int cx;
 
 	/* debug('affper'); */
-	for (cx = 1; cx <= 8; cx ++)
+	for (cx = 1; cx <= 8; ++cx)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
@@ -595,7 +595,7 @@ void cpl6(int &p) {
  * Shows the you are alone message in the status area on the right hand side of the screen
  */
 void person() {
-	for (int cf = 1; cf <= 8; cf ++)
+	for (int cf = 1; cf <= 8; ++cf)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
 
 	Common::String sYou = g_vm->getString(S_YOU);
@@ -1058,30 +1058,30 @@ void inzon() {
 	s.conf  = hazard(4, 10);
 	s.mlieu = 21;
 
-	for (cx = 2; cx <= 6; cx ++)
+	for (cx = 2; cx <= 6; ++cx)
 		s.sjer[cx] = chr(0);
 
 	s.sjer[1] = chr(113);
 	s.heure = chr(20);
 
-	for (cx = 1; cx <= 10; cx ++)
+	for (cx = 1; cx <= 10; ++cx)
 		s.pourc[cx] = ' ';
 
-	for (cx = 1; cx <= 6; cx ++)
+	for (cx = 1; cx <= 6; ++cx)
 		s.teauto[cx] = '*';
 
-	for (cx = 7; cx <= 9; cx ++)
+	for (cx = 7; cx <= 9; ++cx)
 		s.teauto[cx] = ' ';
 
-	for (cx = 10; cx <= 28; cx ++)
+	for (cx = 10; cx <= 28; ++cx)
 		s.teauto[cx] = '*';
 
-	for (cx = 29; cx <= 42; cx ++)
+	for (cx = 29; cx <= 42; ++cx)
 		s.teauto[cx] = ' ';
 
 	s.teauto[33] = '*';
 
-	for (cx = 1; cx <= 8; cx ++)
+	for (cx = 1; cx <= 8; ++cx)
 		nbrep[cx] = 0;
 
 	init_nbrepm();
@@ -1311,7 +1311,7 @@ void cavegre() {
 	parole(2, haz, 1);
 
 	// Useless?
-	for (haz = 0; haz <= 3000; haz++);
+	for (haz = 0; haz <= 3000; ++haz);
 	clsf3();
 	person();
 }
@@ -1411,13 +1411,13 @@ void dessin(int ad) {
 			dessine(ades, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 		} else if (caff > 69) {
-			dessine(ades, 112, 48);           /* tˆtes */                    //Translation: Heads
+			dessine(ades, 112, 48);           // Heads
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
 			dessine(ades, 0, 12);
 			ecrf1();
 			if ((caff < 30) || (caff > 32)) {
-				for (int cx = 1; cx <= 6; cx ++) {
+				for (int cx = 1; cx <= 6; ++cx) {
 					if (ord(touv[cx]) != 0)
 						aniof(1, ord(touv[cx]));
 				}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 6ef3294..0a96375 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -39,12 +39,6 @@
 
 namespace Mortevielle {
 
-const int men[12] = { OPCODE_NONE,
-		OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER,     OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE,     OPCODE_OPEN,   OPCODE_LEAVE
-};
-
 void tinke() {
 	Common::String d1 = g_vm->getString(S_SHOULD_HAVE_NOTICED);
 	Common::String d2 = g_vm->getString(S_NUMBER_OF_HINTS);
@@ -73,7 +67,7 @@ void tinke() {
 		_minute = 0;
 		drawClock();
 		cf = 0;
-		for (cx = 1; cx <= 10; cx ++) {
+		for (cx = 1; cx <= 10; ++cx) {
 			if (s.pourc[cx] == '*')
 				++cf;
 		}
@@ -263,7 +257,7 @@ void tmlieu(int mli) {
 		++i;
 	}
 	nomp = "*                   ";
-	for (cx = 7; cx >= i; cx--)
+	for (cx = 7; cx >= i; --cx)
 		g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp);
 }
 
@@ -289,7 +283,7 @@ void mfouen() {
 	int cx;
 
 	tmlieu(s.mlieu);
-	for (cx = 1; cx <= 11; cx ++)
+	for (cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(men[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_PROBE));
@@ -328,7 +322,7 @@ void tsort() {
 			s.conf += (s.conf / 10);
 	}
 
-	for (int cx = 1; cx <= 7; cx ++)
+	for (int cx = 1; cx <= 7; ++cx)
 		touv[cx] = chr(0);
 	ment = 0;
 	iouv = 0;
@@ -370,7 +364,7 @@ void cherjer(int ob, bool &d) {
 	int cx;
 
 	d = false;
-	for (cx = 1; cx <= 6; cx++)
+	for (cx = 1; cx <= 6; ++cx)
 		d = (d || (ord(s.sjer[cx]) == ob));
 
 	if (s.derobj == ob)
@@ -434,10 +428,10 @@ void finfouil() {
 }
 
 void mfoudi() {
-	for (int cx = 1; cx <= 7; cx++) 
+	for (int cx = 1; cx <= 7; ++cx) 
 		g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]);
 
-	for (int cx = 1; cx <= 11; cx++)
+	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.disableMenuItem(men[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_SUITE));
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 2c95f1e..dc23d04 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -28,8 +28,16 @@
 #ifndef MORTEVIELLE_MOR2_H
 #define MORTEVIELLE_MOR2_H
 
+#include "mortevielle/var_mor.h"
+
 namespace Mortevielle {
 
+static const int men[12] = { OPCODE_NONE,
+		OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER,     OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE,     OPCODE_OPEN,   OPCODE_LEAVE
+};
+
 extern void tinke();
 extern void fenat(char ans);
 /* NIVEAU 8 */
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7c75242..3a744fa 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -490,7 +490,7 @@ void MortevielleEngine::mainGame() {
 	if (rech_cfiec)
 		charge_cfiec();
 
-	for (crep = 1; crep <= c_zzz; crep ++) 
+	for (crep = 1; crep <= c_zzz; ++crep) 
 		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	charge_bruit5();
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index fb89357..84f5740 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -105,7 +105,8 @@ void chartex() {
 
 	/* debug('o3 chartex'); */
 	if (!f.open("TXX.INP"))
-		error("Missing file - TXX.INP");
+		if (!f.open("TXX.MOR"))
+			error("Missing file - TXX.INP or .MOR");
 
 	assert(f.size() <= (maxti * 2));
 	for (int i = 0; i < f.size() / 2; ++i)
@@ -114,7 +115,8 @@ void chartex() {
 	f.close();
 
 	if (!f.open("TXX.NTP"))
-		error("Missing file - TXX.NTP");
+		if (!f.open("TXX.IND"))
+			error("Missing file - TXX.NTP or .IND");
 	
 	assert(f.size() <= (maxtd * 3));
 	int i;
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 0a6e7e8..5f634c5 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -87,7 +87,7 @@ int PCSpeaker::readBuffer(int16 *buffer, const int numSamples) {
 
 	int i;
 
-	for (i = 0; (_remainingSamples || !_pendingNotes.empty())  && (i < numSamples); i++) {
+	for (i = 0; (_remainingSamples || !_pendingNotes.empty())  && (i < numSamples); ++i) {
 		if (!_remainingSamples)
 			// Used up the current note, so queue the next one
 			dequeueNote();
@@ -148,7 +148,7 @@ SoundManager::~SoundManager() {
 /**
  * Decode music data
  */
-void SoundManager::demus(const byte *PSrc, byte *PDest, int NbreSeg) {
+void SoundManager::decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg) {
 	int seed = 128;
 	int v;
 
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index f089974..5c70bc8 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -101,7 +101,7 @@ public:
 
 	void playNote(int frequency, int32 length);
 
-	void demus(const byte *PSrc, byte *PDest, int NbreSeg);
+	void decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg);
 	void litph(tablint &t, int typ, int tempo);
 	void musyc(tablint &tb, int nbseg, int att);  
 };


Commit: d1420c9739214874d962d4d9972194711a3ad8bd
    https://github.com/scummvm/scummvm/commit/d1420c9739214874d962d4d9972194711a3ad8bd
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:00-07:00

Commit Message:
MORTEVIELLE: clean up while statements using separate 'not'

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1f83c5c..6aea0e6 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -89,7 +89,7 @@ void fctMove() {
 	cx = 0;
 	do {
 		++cx;
-	} while (!(g_vm->_menu._depl[cx] == msg[4]));
+	} while (g_vm->_menu._depl[cx] != msg[4]);
 	if (s.mlieu == 19) {
 		if (cx == 1)
 			t1deva();
@@ -297,14 +297,14 @@ void tsprendre() {
 	cx = 0;
 	do {
 		++cx;
-	} while (!(g_vm->_menu._invt[cx] == msg[4]));
+	} while (g_vm->_menu._invt[cx] != msg[4]);
 	cz = 0;
 	cy = 0;
 	do {
 		++cy;
 		if (ord(s.sjer[cy]) != 0)
 			++cz;
-	} while (!(cz == cx));
+	} while (cz != cx);
 	cz = ord(s.sjer[cy]);
 	s.sjer[cy] = chr(0);
 	modinv();
@@ -491,7 +491,7 @@ void fctSearch() {
 			cx = 0;
 			do {
 				++cx;
-			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			} while ((cx <= 6) && (num != ord(touv[cx])));
 			if (num != ord(touv[cx]))
 				crep = 187;
 			else {
@@ -848,7 +848,7 @@ void fctClose() {
 			cx = 0;
 			do {
 				++cx;
-			} while (!((cx > 6) || (num == ord(touv[cx]))));
+			} while ((cx <= 6) && (num != ord(touv[cx])));
 			if (num == ord(touv[cx])) {
 				aniof(2, num);
 				crep = 998;
@@ -941,7 +941,7 @@ void fctPut() {
 				cx = 0;
 				do {
 					++cx;
-				} while (!((cx > 6) || (num == ord(touv[cx]))));
+				} while ((cx <= 6) && (num != ord(touv[cx])));
 				if (num != ord(touv[cx]))
 					crep = 187;
 				else {
@@ -1174,7 +1174,7 @@ void fctSleep() {
 		tinke();
 		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
 		anyone = false;
-	} while (!(answer == 1));
+	} while (answer != 1);
 	crep = 998;
 	num = 0;
 }
@@ -1262,7 +1262,7 @@ void fctWait() {
 		}
 		repon(2, 102);
 		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
-	} while (!(answer == 2));
+	} while (answer != 2);
 	crep = 998;
 	if (!anyone)
 		tinke();
@@ -1303,7 +1303,7 @@ void fctDiscuss() {
 		cx = 0;
 		do {
 			++cx;
-		} while (!(g_vm->_menu._disc[cx] == msg[4]));
+		} while (g_vm->_menu._disc[cx] != msg[4]);
 		caff = 69 + cx;
 		afdes(0);
 		repon(2, caff);
@@ -1345,7 +1345,7 @@ void fctDiscuss() {
 				co = 320;
 			} else
 				lig = lig + 8;
-		} while (!(icm == 42));
+		} while (icm != 42);
 		g_vm->_screenSurface.putxy(320, 176);
 		writetp(lib[46], 0);
 		tou = '\0';
@@ -1458,7 +1458,7 @@ void fctDiscuss() {
 			hirs();
 			showMouse();
 		}
-	} while (!((choi == 46) || (suj == 138)));
+	} while ((choi != 46) && (suj != 138));
 	if (col) {
 		s.conf = s.conf + (3 * (s.conf / 10));
 		hideMouse();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 7cf12cb..5c53616 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -87,7 +87,7 @@ int Alert::show(const Common::String &msg, int n) {
 			g_vm->_screenSurface._textPos.y += 6;
 			g_vm->_screenSurface.writeg(st, 4);
 			++i;
-		} while (!(chaine[i] == ']'));
+		} while (chaine[i] != ']');
 	}
 	if (caseNumb == 1)
 		esp = nbcol - 40;
@@ -263,7 +263,7 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
 			++i;
 			ch = c[i];
 			str[l] += ch;
-		} while (!(c[i + 1] == ']'));
+		} while (c[i + 1] != ']');
 		i += 2;
 
 		while (str[l].size() < 3)
@@ -413,7 +413,7 @@ bool Ques::show() {
 			// tesok is set to true in testprot()
 			tesok = true;
 		}
-	} while (!(indx == 10));
+	} while (indx != 10);
 
 	return (correctCount == 10) && protectionCheck;
 }
@@ -458,7 +458,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 			hirs();
 			aff50(drawAni50Fl);
 		}
-	} while (!(key == 66)); // keycode for F8
+	} while (key != 66); // keycode for F8
 }
 
 /**
@@ -469,7 +469,7 @@ void f3f8::waitForF3F8(int &key) {
 	do {
 		key = testou();
 		CHECK_QUIT;
-	} while (!((key == 61) || (key == 66)));
+	} while ((key != 61) && (key != 66));
 }
 
 void f3f8::aff50(bool drawAni50Fl) {
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index acc2bb0..7511b21 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1117,7 +1117,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 		do {
 			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
 			i = i + step;
-		} while (!(i == yy));
+		} while (i != yy);
 	} else {
 		a = (float)((y - yy)) / (x - xx);
 		b = ((yro * xr) - (yr * xro)) / (x - xx);
@@ -1127,7 +1127,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 		do {
 			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
 			i = i + step;
-		} while (!(i == xx));
+		} while (i != xx);
 	}
 }
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 57eaa4d..f90e1aa 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -41,7 +41,7 @@ void copcha() {
 	do {
 		tabdon[i] = tabdon[i + 390];
 		++i;
-	} while (!(i == acha + 390));
+	} while (i != acha + 390);
 }
 
 bool dans_rect(rectangle r) {
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 7cf6a31..bb901a1 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -177,11 +177,11 @@ void Menu::menu_aff() {
 				}
 				++ind_tabl;
 				++k;
-			} while (!(k == 3));
+			} while (k != 3);
 			++y;
-		} while (!(y == 9));
+		} while (y != 9);
 		col += 48 * res;
-	} while (!(num_letr == 6));
+	} while (num_letr != 6);
 	showMouse();
 }
 
@@ -347,7 +347,7 @@ void Menu::menuDown(int ii) {
 			break;
 		}
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
-	} while (!(cx == nb_lig));
+	} while (cx != nb_lig);
 	test0 = true;
 	showMouse();
 }
@@ -504,7 +504,7 @@ void Menu::initMenu() {
 			_dis[i] = delig + ' ';
 		}
 		++i;
-	} while (!(i == 22));
+	} while (i != 22);
 	for (i = 1; i <= 8; ++i) {
 		_disc[i] = 0x500 + i;
 		if (i < 8)
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index b740ad2..f8873c6 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -874,7 +874,7 @@ void quelq15(int &per) {
 		        ((cx == 6) && bh1) ||
 		        ((cx == 7) && bf1) ||
 		        ((cx == 8) && bh5));
-	} while (!(! test));
+	} while (test);
 
 	conv(cx, per);
 	affper(per);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 0a96375..c235186 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -60,7 +60,7 @@ void tinke() {
 			if (nbrepm[cx] != 0)
 				--nbrepm[cx];
 			nbrep[cx] = 0;
-		} while (!(cx == 8));
+		} while (cx != 8);
 	}
 	if ((h > _hour) || ((h == 0) && (_hour == 23))) {
 		_hour = h;
@@ -414,7 +414,7 @@ void sparl(float adr, float rep) {
 		parole(repint, haut[caff - 69], 0);
 		f3f8::waitForF3F8(key);
 		CHECK_QUIT;
-	} while (!(key == 66));
+	} while (key != 66);
 	hirs();
 	showMouse();
 }
@@ -455,7 +455,7 @@ void ajchai() {
 	int cx = 0;
 	do {
 		++cx;
-	} while (!((cx > 9) || (tabdon[cy + cx] == 0)));
+	} while ((cx <= 9) && (tabdon[cy + cx] != 0));
 
 	if (tabdon[cy + cx] == 0) {
 		int lderobj = s.derobj;
@@ -468,7 +468,7 @@ void ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while (!((cx > 5) || (ord(s.sjer[cx]) == 0)));
+	} while ((cx <= 5) && (ord(s.sjer[cx]) != 0));
 
 	if (ord(s.sjer[cx]) == 0) {
 		s.sjer[(cx)] = chr(ob);
@@ -620,7 +620,7 @@ void tsuiv() {
 		cs = cs + 1;
 		cl = cy + cs;
 		tbcl = tabdon[cl];
-	} while (!((tbcl != 0) || (cs > 9)));
+	} while ((tbcl == 0) && (cs <= 9));
 
 	if ((tbcl != 0) && (cs < 11)) {
 		is = is + 1;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3a744fa..6be14bd 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -630,7 +630,7 @@ void MortevielleEngine::handleAction() {
 					if ((! syn) || (col))
 						repon(2, crep);
 				}
-			} while (!(! syn));
+			} while (syn);
 			if (ctrm != 0)
 				tctrm();
 		}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index a367666..e7da3c3 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -100,7 +100,7 @@ void hideMouse() {
 				WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j += 80;
 				++k;
-			} while (!(k >= 5));
+			} while (k < 5);
 			break;
 		case MODE_AMSTRAD1512:
 			for (i = 0; i <= 3; ++i) {
@@ -117,7 +117,7 @@ void hideMouse() {
 					}
 					imp = !imp;
 					++k;
-				} while (!(k >= 8));
+				} while (k < 8);
 			}
 			break;
 		case MODE_EGA:
@@ -136,9 +136,9 @@ void hideMouse() {
 					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
 					++k;
-				} while (!(k >= 8));
+				} while (k < 8);
 				++i;
-			} while (!(i == 4));
+			} while (i != 4);
 			break;
 		case MODE_HERCULES:
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
@@ -158,7 +158,7 @@ void hideMouse() {
 				}
 				j += 160;
 				++k;
-			} while (!(k == 3));
+			} while (k != 3);
 			break;
 		default:
 			break;
@@ -191,7 +191,7 @@ void showMouse() {
 			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
 			j += 80;
 			++k;
-		} while (!(k >= 5));
+		} while (k < 5);
 		break;
 	case MODE_AMSTRAD1512:
 		for (i = 0; i <= 3; ++i) {
@@ -209,7 +209,7 @@ void showMouse() {
 				}
 				imp = !imp;
 				++k;
-			} while (!(k >= 8));
+			} while (k < 8);
 		}
 		break;
 	case MODE_EGA:
@@ -223,9 +223,9 @@ void showMouse() {
 				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
 				++k;
-			} while (!(k >= 8));
+			} while (k < 8);
 			++l;
-		} while (!(l == 4));
+		} while (l != 4);
 		break;
 	case MODE_HERCULES:
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
@@ -245,7 +245,7 @@ void showMouse() {
 			}
 			j += 160;
 			++k;
-		} while (!(k == 3));
+		} while (k != 3);
 		break;
 	default:
 		break;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index ceac79a..1c73f7a 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -222,9 +222,9 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 							g_vm->_screenSurface.putxy(j, i);
 							g_vm->_screenSurface.writeg(" ", 0);
 							j += 6;
-						} while (!(j > xf));
+						} while (j <= xf);
 						i += 6;
-					} while (!(i > yf));
+					} while (i <= yf);
 					yc = y;
 				}
 				g_vm->_screenSurface.putxy(xc, yc);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 84f5740..74639d3 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -183,7 +183,7 @@ void music() {
 	fic.read(&mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	g_vm->_soundManager.demus(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
+	g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
 	addfix = (float)((tempo_mus - addv[1])) / 256;
 	cctable(tbi);
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 02f298e..e86b647 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -112,7 +112,7 @@ void regenbruit() {
 		t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
 		i += 2;
 		++j;
-	} while (!(i >= offsetb3 + 8790));
+	} while (i < offsetb3 + 8790);
 }
 
 void charge_son() {
@@ -123,7 +123,7 @@ void charge_son() {
 	
 	f.read(&mem[0x7414 * 16 + 0], 273);
 
-	g_vm->_soundManager.demus(&mem[0x7414 * 16], &mem[adson * 16], 273);
+	g_vm->_soundManager.decodeMusic(&mem[0x7414 * 16], &mem[adson * 16], 273);
 	f.close();
 }
 
@@ -209,7 +209,7 @@ void trait_car() {
 					else
 						entroct(d3);
 					entroct(3);
-				} while (!(i < 0));
+				} while (i >= 0);
 			}
 			if (d3 == null) {
 				entroct(4);
@@ -234,7 +234,7 @@ void trait_car() {
 					else
 						entroct(d3);
 					entroct(3);
-				} while (!(i < 0));
+				} while (i >= 0);
 			}
 			if (d3 == null) {
 				entroct(0);
@@ -259,7 +259,7 @@ void trait_car() {
 					else
 						entroct(d3);
 					entroct(3);
-				} while (!(i < 0));
+				} while (i >= 0);
 			}
 			entroct(0);
 			entroct(c2.val);
@@ -292,7 +292,7 @@ void trait_car() {
 				entroct(0);
 				entroct(d3);
 				entroct(3);
-			} while (!(i <= 0));
+			} while (i > 0);
 		}
 		veracf(c3.acc);
 		if (c3.code == 6) {
@@ -345,7 +345,7 @@ void trait_car() {
 					entroct(d3);
 					entroct(c2.val);
 					entroct(3);
-				} while (!(i <= 0));
+				} while (i > 0);
 			}
 			entroct(d3);
 			entroct(c2.val);
@@ -361,7 +361,7 @@ void trait_car() {
 					entroct(d3);
 					entroct(c2.val);
 					entroct(4);
-				} while (!(i <= 0));
+				} while (i > 0);
 			}
 		}
 		if (c3.code == 9) {
@@ -408,7 +408,7 @@ void trait_car() {
 				entroct(2);
 				entroct(c2.val);
 				entroct(3);
-			} while (!(i <= 0));
+			} while (i > 0);
 		}
 		entroct(2);
 		entroct(c2.val);
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index c493e19..19b4419 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -64,7 +64,7 @@ void trait_ph() {
 		WRITE_LE_UINT16(&mem[adword + ptr_word], t_cph[ptr_tcph]);
 		ptr_word = ptr_word + 2;
 		ptr_tcph = ptr_tcph + 1;
-	} while (!(ptr_tcph >= (int)((uint)lefin >> 1)));
+	} while (ptr_tcph < (int)((uint)lefin >> 1));
 
 	ptr_oct = 0;
 	ptr_word = 0;
@@ -74,7 +74,7 @@ void trait_ph() {
 		rot_chariot();
 		charg_car();
 		trait_car();
-	} while (!(ptr_word >= nb_word));
+	} while (ptr_word < nb_word);
 
 	rot_chariot();
 	trait_car();


Commit: 14f8c2954d8655cd94f3adb5b4e873e4aa5d6111
    https://github.com/scummvm/scummvm/commit/14f8c2954d8655cd94f3adb5b4e873e4aa5d6111
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:02-07:00

Commit Message:
MORTEVIELLE: Rename remaining Menu enums, rename _staticStrings into _engineStrings as a preliminar work on an English DOS version

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6aea0e6..68d6e82 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -58,7 +58,7 @@ void fctMove() {
 	}
 	if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._depl[6])) {
 		if (!syn)
-			ecr3(g_vm->getString(S_GO_TO));
+			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
 		if (iesc)
 			okdes = false;
@@ -222,7 +222,7 @@ void fctTake() {
 		return;
 	}
 	if (!syn)
-		ecr3(g_vm->getString(S_TAKE));
+		ecr3(g_vm->getEngineString(S_TAKE));
 	tfleche();
 	if ((anyone) || (iesc))
 		return;
@@ -321,7 +321,7 @@ void fctLift() {
 	int cx;
 
 	if (!syn)
-		ecr3(g_vm->getString(S_LIFT));
+		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
 	if ((anyone) || (iesc))
 		return;
@@ -360,7 +360,7 @@ void fctRead() {
 		st4(caff);
 	else {
 		if (!syn)
-			ecr3(g_vm->getString(S_READ));
+			ecr3(g_vm->getEngineString(S_READ));
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(4);
@@ -389,7 +389,7 @@ void fctLook() {
 		return;
 	}
 	if (!syn)
-		ecr3(g_vm->getString(S_LOOK));
+		ecr3(g_vm->getEngineString(S_LOOK));
 	tfleche();
 	if ((anyone) || (iesc))
 		return;
@@ -475,7 +475,7 @@ void fctSearch() {
 		return;
 	}
 	if (!syn)
-		ecr3(g_vm->getString(S_SEARCH));
+		ecr3(g_vm->getEngineString(S_SEARCH));
 	tfleche();
 	if (anyone || iesc)
 		return;
@@ -563,7 +563,7 @@ void fctOpen() {
 	int cx, haz;
 
 	if (!syn)
-		ecr3(g_vm->getString(S_OPEN));
+		ecr3(g_vm->getEngineString(S_OPEN));
 	if (caff == 26) {
 		if (ment != 0) {
 			msg[4] = OPCODE_ENTER;
@@ -631,7 +631,7 @@ void fctPlace() {
 		return;
 	}
 	if (!syn)
-		ecr3(g_vm->getString(S_PUT));
+		ecr3(g_vm->getEngineString(S_PUT));
 	tfleche();
 	if (iesc)
 		crep = 998;
@@ -671,7 +671,7 @@ void fctPlace() {
 					parole(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
-					int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 					if (answer== 1)  {
 						deline(582, st, tay);
 						i = Alert::show(delig, 1);
@@ -752,7 +752,7 @@ void fctTurn() {
 		return;
 	}
 	if (!syn)
-		ecr3(g_vm->getString(S_TURN));
+		ecr3(g_vm->getEngineString(S_TURN));
 	tfleche();
 	if ((anyone) || (iesc))
 		return;
@@ -762,7 +762,7 @@ void fctTurn() {
 		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
-			int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1)
 				g_vm->_endGame = true;
 			else
@@ -772,7 +772,7 @@ void fctTurn() {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
-			int answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				s.mlieu = 16;
 				affrep();
@@ -788,7 +788,7 @@ void fctTurn() {
  */
 void fctHideSelf() {
 	if (!syn)
-		ecr3(g_vm->getString(S_HIDE_SELF));
+		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
 	if (!(anyone) && !(iesc)) {
 		tcoord(10);
@@ -810,7 +810,7 @@ void fctAttach() {
 		crep = 186;
 	else {
 		if (!syn)
-			ecr3(g_vm->getString(S_TIE));
+			ecr3(g_vm->getEngineString(S_TIE));
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(8);
@@ -836,7 +836,7 @@ void fctClose() {
 	int cx, chai;
 
 	if (!syn)
-		ecr3(g_vm->getString(S_CLOSE));
+		ecr3(g_vm->getEngineString(S_CLOSE));
 	if (caff < 26) {
 		tfleche();
 		if (iesc)
@@ -875,9 +875,9 @@ void fctKnock() {
 	int l, p, haz;
 
 	if (!syn)
-		ecr3(g_vm->getString(S_HIT));
+		ecr3(g_vm->getEngineString(S_HIT));
 	if (s.mlieu == 15) {
-		l = Alert::show(g_vm->getString(S_BEFORE_USE_DEP_MENU), 1);
+		l = Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 	if (s.mlieu < 25) {
@@ -917,7 +917,7 @@ void fctPut() {
 	int cx, chai;
 
 	if (!syn)
-		ecr3(g_vm->getString(S_POSE));
+		ecr3(g_vm->getEngineString(S_POSE));
 	if (s.derobj == 0)
 		crep = 186;
 	else {
@@ -1154,7 +1154,7 @@ void fctSleep() {
 	clsf3();
 	clsf2();
 	ecrf2();
-	ecr2(g_vm->getString(S_WANT_TO_WAKE_UP));
+	ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
 	calch(j, h, m);
 
 	int answer;
@@ -1172,7 +1172,7 @@ void fctSleep() {
 		if (h > 23)
 			h = 0;
 		tinke();
-		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 		anyone = false;
 	} while (answer != 1);
 	crep = 998;
@@ -1185,7 +1185,7 @@ void fctSleep() {
  */
 void fctForce() {
 	if (!syn)
-		ecr3(g_vm->getString(S_SMASH));
+		ecr3(g_vm->getEngineString(S_SMASH));
 	if (caff < 25)
 		tfleche();
 	if ((! anyone) && (! iesc))
@@ -1261,7 +1261,7 @@ void fctWait() {
 			return;
 		}
 		repon(2, 102);
-		answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
 	crep = 998;
 	if (!anyone)
@@ -1274,7 +1274,7 @@ void fctWait() {
  */
 void fctSound() {
 	if (!syn)
-		ecr3(g_vm->getString(S_PROBE2));
+		ecr3(g_vm->getEngineString(S_PROBE2));
 	if (caff < 27) {
 		tfleche();
 		if (!(anyone) && (!iesc))
@@ -1289,7 +1289,7 @@ void fctSound() {
  */
 void fctDiscuss() {
 	bool te[47];
-	int ix, cy, cx, max, haz, suj, co, lig, icm,
+	int cy, cx, max, haz, suj, co, lig, icm,
 	        i, tay, choi, x, y, c;
 	char tou;
 	Common::String lib[47];
@@ -1316,9 +1316,9 @@ void fctDiscuss() {
 	premtet();
 	sparl(0, suj);
 	hirs();
-	for (ix = 1; ix <= 46; ++ix)
+	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
-	for (ix = 1; ix <= 45; ++ix) {
+	for (int ix = 1; ix <= 45; ++ix) {
 		deline(ix + c_tparler, st, tay);
 		lib[ix] = delig;
 		for (i = tay; i <= 40; ++i)
@@ -1376,7 +1376,7 @@ void fctDiscuss() {
 					choi = 0;
 				}
 			} else {
-				ix = cy;
+				int ix = cy;
 				if (cx == 41)
 					ix = ix + 23;
 				if (ix != choi) {
@@ -1413,7 +1413,7 @@ void fctDiscuss() {
 		} while (!((tou == '\15') || (((c != 0) || g_vm->getMouseClick()) && (choi != 0))));
 		g_vm->setMouseClick(false);
 		if (choi != 46) {
-			ix = choi - 1;
+			int ix = choi - 1;
 			if (col) {
 				col = false;
 				s.mlieu = 15;
@@ -1446,7 +1446,7 @@ void fctDiscuss() {
 				s.teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
-				for (ix = 29; ix <= 31; ++ix)
+				for (int ix = 29; ix <= 31; ++ix)
 					s.teauto[ix] = '*';
 				s.pourc[7] = '*';
 			}
@@ -1491,7 +1491,7 @@ void fctSmell() {
 	crep = 119;
 	if (caff < 26) {
 		if (!syn)
-			ecr3(g_vm->getString(S_SMELL));
+			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
 		if (!(anyone) && !(iesc))
 			if (caff == 16)
@@ -1509,7 +1509,7 @@ void fctScratch() {
 	crep = 155;
 	if (caff < 27) {
 		if (!syn)
-			ecr3(g_vm->getString(S_SCRATCH));
+			ecr3(g_vm->getEngineString(S_SCRATCH));
 		tfleche();
 	}
 	num = 0;
@@ -1570,7 +1570,7 @@ void MortevielleEngine::loseGame() {
 	_hour = 10;
 	_day = 0;
 	repon(2, 180);
-	answer = Alert::show(g_vm->getString(S_YES_NO), 1);
+	answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
 }
 
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 5c53616..b91fd30 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -424,8 +424,8 @@ bool Ques::show() {
  * Draw the F3/F8 dialog
  */
 void f3f8::draw() {
-	Common::String f3 = g_vm->getString(S_F3);
-	Common::String f8 = g_vm->getString(S_F8);
+	Common::String f3 = g_vm->getEngineString(S_F3);
+	Common::String f8 = g_vm->getEngineString(S_F8);
 
 	// Write the F3 and F8 text strings
 	g_vm->_screenSurface.putxy(3, 44);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index bb901a1..f81a454 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -56,7 +56,7 @@ void Menu::menut(int no, Common::String nom) {
 		s += ' ';
 
 	switch (h) {
-	case invent:
+	case MENU_INVENTORY:
 		if (l != 7) {
 			_inv[l] = s;
 			_inv[l].insertChar(' ', 0);
@@ -65,10 +65,10 @@ void Menu::menut(int no, Common::String nom) {
 	case MENU_MOVE:
 		_dep[l] = s;
 		break;
-	case action:
+	case MENU_ACTION:
 		_act[l] = s;
 		break;
-	case saction:
+	case MENU_SUB_ACTION:
 		_self[l] = s;
 		break;
 	case MENU_DISCUSS:
@@ -88,7 +88,7 @@ void Menu::disableMenuItem(int no) {
 	byte l = lo(no);
 
 	switch (h) {
-	case invent:
+	case MENU_INVENTORY:
 		if (l > 6) {
 			_inv[l].setChar('<', 0);
 			_inv[l].setChar('>', 21);
@@ -98,10 +98,10 @@ void Menu::disableMenuItem(int no) {
 	case MENU_MOVE:
 		_dep[l].setChar('*', 0);
 		break;
-	case action:
+	case MENU_ACTION:
 		_act[l].setChar('*', 0);
 		break;
-	case saction:
+	case MENU_SUB_ACTION:
 		_self[l].setChar('*', 0);
 		break;
 	case MENU_DISCUSS:
@@ -121,17 +121,17 @@ void Menu::enableMenuItem(int no) {
 	byte l = lo(no);
 
 	switch (h) {
-	case invent :
+	case MENU_INVENTORY:
 		_inv[l].setChar(' ', 0);
 		_inv[l].setChar(' ', 21);
 		break;
 	case MENU_MOVE:
 		_dep[l].setChar(' ', 0);
 		break;
-	case action:
+	case MENU_ACTION:
 		_act[l].setChar(' ', 0);
 		break;
-	case saction:
+	case MENU_SUB_ACTION:
 		_self[l].setChar(' ', 0);
 		_self[l].setChar(' ', 0);
 		break;
@@ -222,18 +222,18 @@ void Menu::invers(int ix) {
 		s = _dis[lo(msg4)];
 		break;
 	case 6:
-		s = g_vm->getString(S_SAVE_LOAD + lo(msg4));
+		s = g_vm->getEngineString(S_SAVE_LOAD + lo(msg4));
 		break;
 	case 7:
-		s = g_vm->getString(S_SAVE_LOAD + 1);
+		s = g_vm->getEngineString(S_SAVE_LOAD + 1);
 		s += ' ';
 		s += (char)(48 + lo(msg4));
 		break;
 	case 8:
 		if (lo(msg4) == 1) {
-			s = g_vm->getString(S_RESTART);
+			s = g_vm->getEngineString(S_RESTART);
 		} else {
-			s = g_vm->getString(S_SAVE_LOAD + 2);
+			s = g_vm->getEngineString(S_SAVE_LOAD + 2);
 			s += ' ';
 			s += (char)(47 + lo(msg4));
 		}
@@ -324,10 +324,10 @@ void Menu::menuDown(int ii) {
 				g_vm->_screenSurface.writeg(_dis[cx], 4);
 			break;
 		case 6:
-			g_vm->_screenSurface.writeg(g_vm->getString(S_SAVE_LOAD + cx), 4);
+			g_vm->_screenSurface.writeg(g_vm->getEngineString(S_SAVE_LOAD + cx), 4);
 			break;
 		case 7: {
-			Common::String s = g_vm->getString(S_SAVE_LOAD + 1);
+			Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
 			g_vm->_screenSurface.writeg(s, 4);
@@ -335,9 +335,9 @@ void Menu::menuDown(int ii) {
 			break;
 		case 8:
 			if (cx == 1)
-				g_vm->_screenSurface.writeg(g_vm->getString(S_RESTART), 4);
+				g_vm->_screenSurface.writeg(g_vm->getEngineString(S_RESTART), 4);
 			else {
-				Common::String s = g_vm->getString(S_SAVE_LOAD + 2);
+				Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 2);
 				s += ' ';
 				s += (char)(47 + cx);
 				g_vm->_screenSurface.writeg(s, 4);
@@ -416,20 +416,20 @@ void Menu::mdn() {
 		   || ((x > 268 * res) && (x < 268 * res + 24)));
 		if (tes) {
 			if (x < 76 * res)
-				ix = invent;
+				ix = MENU_INVENTORY;
 			else if (x < 124 * res)
 				ix = MENU_MOVE;
 			else if (x < 172 * res)
-				ix = action;
+				ix = MENU_ACTION;
 			else if (x < 220 * res)
-				ix = saction;
+				ix = MENU_SUB_ACTION;
 			else if (x < 268 * res)
 				ix = MENU_DISCUSS;
 			else
-				ix = fichier;
+				ix = MENU_FILE;
 
 			if ((ix != msg3) || (! test0))
-				if (!((ix == fichier) && ((msg3 == sauve) || (msg3 == charge)))) {
+				if (!((ix == MENU_FILE) && ((msg3 == MENU_SAVE) || (msg3 == MENU_LOAD)))) {
 					menuUp(msg3);
 					menuDown(ix);
 					msg3 = ix;
@@ -440,7 +440,7 @@ void Menu::mdn() {
 				util(x, y);
 		}
 	} else {       // There was a click
-		if ((msg3 == fichier) && (msg4 != OPCODE_NONE)) {
+		if ((msg3 == MENU_FILE) && (msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
 			menuUp(msg3);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 1fb8ad4..8416924 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -60,8 +60,8 @@ public:
 };
 
 enum {
-	invent = 1, MENU_MOVE = 2, action = 3, saction = 4,
-	MENU_DISCUSS = 5, fichier = 6, sauve = 7, charge = 8
+	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SUB_ACTION = 4,
+	MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,   MENU_LOAD = 8
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index f8873c6..f36ae2d 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -244,11 +244,11 @@ void clsf10() {
 	}
 	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
 	if (s.conf < 33)
-		st = g_vm->getString(S_COOL);
+		st = g_vm->getEngineString(S_COOL);
 	else if (s.conf < 66)
-		st = g_vm->getString(S_LOURDE);
+		st = g_vm->getEngineString(S_LOURDE);
 	else if (s.conf > 65)
-		st = g_vm->getString(S_MALSAINE);
+		st = g_vm->getEngineString(S_MALSAINE);
 	
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
 	g_vm->_screenSurface.putxy(co, 92);
@@ -598,9 +598,9 @@ void person() {
 	for (int cf = 1; cf <= 8; ++cf)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
 
-	Common::String sYou = g_vm->getString(S_YOU);
-	Common::String sAre = g_vm->getString(S_ARE);
-	Common::String sAlone = g_vm->getString(S_ALONE);
+	Common::String sYou = g_vm->getEngineString(S_YOU);
+	Common::String sAre = g_vm->getEngineString(S_ARE);
+	Common::String sAlone = g_vm->getEngineString(S_ALONE);
 
 	clsf10();
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sYou) / 2), 30);
@@ -661,7 +661,7 @@ void drawClock() {
 
 	g_vm->_screenSurface.putxy(550, 160);
 	if ((_day >= 0) && (_day <= 8)) {
-		Common::String tmp = g_vm->getString(S_DAY);
+		Common::String tmp = g_vm->getEngineString(S_DAY);
 		tmp.insertChar((char)(_day + 49), 0);
 		g_vm->_screenSurface.writeg(tmp, 1);
 	}
@@ -1306,12 +1306,14 @@ void cavegre() {
 		s.conf += (s.conf / 10);
 	clsf3();
 	ecrf2();
-	ecr3(g_vm->getString(S_SOMEONE_ENTERS));
+	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
 	haz = (hazard(0, 4)) - 2;
 	parole(2, haz, 1);
 
 	// Useless?
-	for (haz = 0; haz <= 3000; ++haz);
+	for (haz = 0; haz <= 3000; ++haz)
+		;
+
 	clsf3();
 	person();
 }
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c235186..fb1ccaf 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -40,12 +40,12 @@
 namespace Mortevielle {
 
 void tinke() {
-	Common::String d1 = g_vm->getString(S_SHOULD_HAVE_NOTICED);
-	Common::String d2 = g_vm->getString(S_NUMBER_OF_HINTS);
+	Common::String d1 = g_vm->getEngineString(S_SHOULD_HAVE_NOTICED);
+	Common::String d2 = g_vm->getEngineString(S_NUMBER_OF_HINTS);
 	const char d3 = '[';
 	const char d4 = ']';
 	const char d5 = '1';
-	Common::String d6 = g_vm->getString(S_OK);
+	Common::String d6 = g_vm->getEngineString(S_OK);
 	int cx, haz, nh, cf, j, h, m;
 	Common::String stpo;
 	bool am;
@@ -169,7 +169,7 @@ void tinke() {
 						if (haz < 5) {
 							clsf3();
 							ecrf2();
-							ecr3(g_vm->getString(S_HEAR_NOISE));
+							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
 							haz = (hazard(0, 4)) - 2;
 							parole(1, haz, 1);
 							clsf3();
@@ -286,8 +286,8 @@ void mfouen() {
 	for (cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(men[cx]);
 
-	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_PROBE));
-	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getString(S_RAISE));
+	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
+	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
 }
 
 /* NIVEAU 6 */
@@ -434,8 +434,8 @@ void mfoudi() {
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.disableMenuItem(men[cx]);
 
-	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getString(S_SUITE));
-	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getString(S_STOP));
+	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
+	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
 }
 
 void mennor() {
@@ -812,7 +812,7 @@ void st13(int ob) {
 }
 
 void aldepl() {
-	Alert::show(g_vm->getString(S_USE_DEP_MENU), 1);
+	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6be14bd..4f36741 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -212,7 +212,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 	// Close the file
 	f.close();
 
-	assert(_staticStrings.size() > 0);
+	assert(_engineStrings.size() > 0);
 	return Common::kNoError;
 }
 
@@ -240,7 +240,7 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize) {
 		while ((ch = (char)f.readByte()) != '\0')
 			s += ch;
 		
-		_staticStrings.push_back(s);
+		_engineStrings.push_back(s);
 		dataSize -= s.size() + 1;
 	}
 	assert(dataSize == 0);
@@ -565,19 +565,19 @@ void MortevielleEngine::handleAction() {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (choisi && (msg[3] == sauve)) {
+		if (choisi && (msg[3] == MENU_SAVE)) {
 			Common::String saveName = Common::String::format("Savegame #%d", msg[4] & 7);
 			g_vm->_savegameManager.saveGame(msg[4] & 7, saveName);
 		}
-		if (choisi && (msg[3] == charge))
+		if (choisi && (msg[3] == MENU_LOAD))
 			g_vm->_savegameManager.loadGame((msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(stpou, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((mnumo != OPCODE_NONE) && ((msg[3] == action) || (msg[3] == saction))) {
+			if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SUB_ACTION))) {
 				msg[4] = mnumo;
-				ecr3(g_vm->getString(S_IDEM));
+				ecr3(g_vm->getEngineString(S_IDEM));
 			} else
 				return;
 		} else if (inkey == '\104') {
@@ -598,7 +598,7 @@ void MortevielleEngine::handleAction() {
 				num = 0;
 		} else {
 			mnumo = msg[3];
-			if ((msg[3] == action) || (msg[3] == saction))
+			if ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SUB_ACTION))
 				mnumo = msg[4];
 			if (! anyone) {
 				if ((fouil) || (obpart)) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b0f1c4c..07c5896 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -80,7 +80,7 @@ private:
 	bool _mouseClick;
 	Common::Point _mousePos;
 	bool _inMainGameLoop;	// Flag when the main game loop is active
-	Common::StringArray _staticStrings;
+	Common::StringArray _engineStrings;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
@@ -124,7 +124,7 @@ public:
 	bool getMouseClick() const { return _mouseClick; }
 	void setMouseClick(bool v) { _mouseClick = v; }
 	void delay(int amount);
-	Common::String getString(int idx) const { return _staticStrings[idx]; }
+	Common::String getEngineString(int idx) const { return _engineStrings[idx]; }
 
 	void endGame();
 	void loseGame();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 96083f1..e2a6cf4 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -174,7 +174,7 @@ void tsitu() {
 		fctMove();
 	if (msg[3] == MENU_DISCUSS)
 		fctDiscuss();
-	if (msg[3] == invent)
+	if (msg[3] == MENU_INVENTORY)
 		tsprendre(); //Translation: inventory/take
 	if (msg[4] == OPCODE_ATTACH)
 		fctAttach();


Commit: cc85fd239aa02e964634abd3290fe16990f55e14
    https://github.com/scummvm/scummvm/commit/cc85fd239aa02e964634abd3290fe16990f55e14
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:03-07:00

Commit Message:
MORTEVIELLE: First "English" version.

DAT file needs to be rebuilt

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/create_mortdat.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index de4bb41..4c1dd14 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -82,10 +82,15 @@ void writeFontBlock() {
 	outputFile.write(fontBuffer, 121 * 6);
 }
 
-void writeStaticStrings(const char **strings, int languageId) {
+void writeStaticStrings(const char **strings, DataType dataType, int languageId) {
 	// Write out a section header 
 	char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
-	outputFile.write(sStaticStrings, 4);
+	char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
+
+	if (dataType == kStaticStrings)
+		outputFile.write(sStaticStrings, 4);
+	else if (dataType == kGameStrings)
+		outputFile.write(sGameStrings, 4);
 
 	// Figure out the block size
 	int blockSize = 1;
@@ -112,22 +117,22 @@ void writeStaticStrings(const char **strings, int languageId) {
  * Write out the strings previously hard-coded into the engine
  */
 void writeEngineStrings() {
-	writeStaticStrings(engineDataEn, 1);
-	writeStaticStrings(engineDataFr, 0);
+	writeStaticStrings(engineDataEn, kStaticStrings, 1);
+	writeStaticStrings(engineDataFr, kStaticStrings, 0);
 }
 
 /**
  * Write out the strings used in the game
  */
 void writeGameStrings() {
-	writeStaticStrings(gameDataEn, 1);
-	writeStaticStrings(gameDataFr, 0);
+	writeStaticStrings(gameDataEn, kGameStrings, 1);
+	writeStaticStrings(gameDataFr, kGameStrings, 0);
 }
 
 void process() {
 	writeFontBlock();
-	writeEngineStrings();
 	writeGameStrings();
+	writeEngineStrings();
 }
 
 /**
diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
index d9c7561..0aa6b52 100644
--- a/devtools/create_mortdat/create_mortdat.h
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -31,6 +31,11 @@ enum AccessMode {
 	kFileWriteMode = 2
 };
 
+enum DataType {
+	kStaticStrings = 0,
+	kGameStrings = 1
+};
+
 #define MORT_DAT "mort.dat"
 
 class File {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4f36741..9ca4839 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -38,6 +38,7 @@
 #include "mortevielle/mor.h"
 #include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
 #include "mortevielle/parole2.h"
 #include "mortevielle/prog.h"
@@ -123,11 +124,28 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_currGraphicalDevice = MODE_EGA;
 	res = 2;
 
+	_txxFileFl = false;
+	// Load texts from TXX files
+	chartex();
+
 	// Load the mort.dat resource
 	Common::ErrorCode result = loadMortDat();
 	if (result != Common::kNoError)
 		return result;
 
+	// Load some error messages (was previously in chartex())
+	int length = 0;
+	char str[1410];
+
+	deline(578, str, length);
+	al_mess = delig;
+	deline(579, str, length);
+	err_mess = delig;
+	deline(580, str, length);
+	ind_mess = delig;
+	deline(581, str, length);
+	al_mess2 = delig;
+
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
 
@@ -138,7 +156,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_newGraphicalDevice = _currGraphicalDevice;
 	zuul = false;
 	tesok = false;
-	chartex();
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
@@ -202,7 +219,9 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 			// Font resource
 			_screenSurface.readFontData(f, dataSize);
 		} else if (!strncmp(dataType, "SSTR", 4)) {
-			readStaticStrings(f, dataSize);
+			readStaticStrings(f, dataSize, kStaticStrings);
+		} else if ((!strncmp(dataType, "GSTR", 4)) && (!_txxFileFl)) {
+			readStaticStrings(f, dataSize, kGameStrings);
 		} else {
 			// Unknown section
 			f.skip(dataSize);
@@ -219,7 +238,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 /**
  * Read in a static strings block, and if the language matches, load up the static strings
  */
-void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize) {
+void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataType dataType) {
 	// Figure out what language Id is needed
 	byte desiredLanguageId = (getLanguage() == Common::EN_ANY) ? LANG_ENGLISH : LANG_FRENCH;
 
@@ -240,7 +259,11 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize) {
 		while ((ch = (char)f.readByte()) != '\0')
 			s += ch;
 		
-		_engineStrings.push_back(s);
+		if (dataType == kStaticStrings)
+			_engineStrings.push_back(s);
+		else if (dataType == kGameStrings)
+			_gameStrings.push_back(s);
+
 		dataSize -= s.size() + 1;
 	}
 	assert(dataSize == 0);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 07c5896..c44daff 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -48,7 +48,8 @@ enum {
 // Game languages
 enum {
 	LANG_FRENCH = 0,
-	LANG_ENGLISH = 1
+	LANG_ENGLISH = 1,
+	LANG_GERMAN = 2
 };
 
 // Static string list
@@ -65,6 +66,11 @@ enum {
 	S_SMELL = 40, S_SCRATCH = 41, S_PROBE2 = 42, S_BEFORE_USE_DEP_MENU = 43, S_DAY = 44
 };
 
+enum DataType {
+	kStaticStrings = 0,
+	kGameStrings = 1
+};
+
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
 #define SCREEN_ORIG_HEIGHT 200
@@ -81,10 +87,10 @@ private:
 	Common::Point _mousePos;
 	bool _inMainGameLoop;	// Flag when the main game loop is active
 	Common::StringArray _engineStrings;
-
+	Common::StringArray _gameStrings;
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
-	void readStaticStrings(Common::File &f, int dataSize);
+	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
 	void loadFont(Common::File &f);
 	bool handleEvents();
 	void addKeypress(Common::Event &evt);
@@ -105,6 +111,7 @@ public:
 	bool _quitGame;			// Quit game flag. Originally called 'arret'
 	bool _endGame;			// End game flag. Originally called 'solu'
 	bool _loseGame;			// Lose game flag. Originally called 'perdu'
+	bool _txxFileFl;        // Flag used to determine if texts are from the original files or from a DAT file
 public:
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
@@ -125,6 +132,7 @@ public:
 	void setMouseClick(bool v) { _mouseClick = v; }
 	void delay(int amount);
 	Common::String getEngineString(int idx) const { return _engineStrings[idx]; }
+	Common::String getGameString(int idx) const { return _gameStrings[idx]; }
 
 	void endGame();
 	void loseGame();
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 1c73f7a..99c2cac 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -132,6 +132,16 @@ void deline(int num, char *line , int &length) {
 		return;
 	}
 
+	if (!g_vm->_txxFileFl) {
+		delig = g_vm->getGameString(num);
+		if (line) {
+			strcpy(line, delig.c_str());
+			length = delig.size();
+		}
+
+		return;
+	}
+
 	// DETEX
 	delig = "";
 	int ts = t_rec[num].indis;
@@ -155,6 +165,8 @@ void deline(int num, char *line , int &length) {
 	if (length < 255)
 		// Remove trailing '$'
 		delig.deleteLastChar();
+
+	warning("deline: delig %s - line %s", delig.c_str(), line);
 }
 
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 74639d3..17966b8 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -100,45 +100,52 @@ void charpal() {
 }
 
 void chartex() {
-	Common::File f;
+	Common::File inpFile;
+	Common::File ntpFile;
 	char s[1410];
 
-	/* debug('o3 chartex'); */
-	if (!f.open("TXX.INP"))
-		if (!f.open("TXX.MOR"))
-			error("Missing file - TXX.INP or .MOR");
+	g_vm->_txxFileFl = false;
+	if (g_vm->getLanguage() == Common::EN_ANY) {
+		warning("English version expected - Switching to DAT file");
+		return;
+	}
 
-	assert(f.size() <= (maxti * 2));
-	for (int i = 0; i < f.size() / 2; ++i)
-		t_mot[i] = f.readUint16LE();
+	if (!inpFile.open("TXX.INP")) {
+		if (!inpFile.open("TXX.MOR")) {
+			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+			return;
+		}
+	}
 
-	f.close();
+	if (!ntpFile.open("TXX.NTP")) {
+		if (!ntpFile.open("TXX.IND")) {
+			warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
+			return;
+		}
+	}
 
-	if (!f.open("TXX.NTP"))
-		if (!f.open("TXX.IND"))
-			error("Missing file - TXX.NTP or .IND");
-	
-	assert(f.size() <= (maxtd * 3));
-	int i;
-	for (i = 0; i < (f.size() / 3); ++i) {
-		t_rec[i].indis = f.readSint16LE();
-		t_rec[i].point = f.readByte();
+	if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
+		warning("TXX file - Unexpected format - Switching to DAT file");
+		return;
 	}
 
-	f.close();
+	for (int i = 0; i < inpFile.size() / 2; ++i)
+		t_mot[i] = inpFile.readUint16LE();
+
+	inpFile.close();
+
+	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
+		t_rec[i].indis = ntpFile.readSint16LE();
+		t_rec[i].point = ntpFile.readByte();
+	}
+
+	ntpFile.close();
 
-	deline(578, s, i);
-	al_mess = delig;
-	deline(579, s, i);
-	err_mess = delig;
-	deline(580, s, i);
-	ind_mess = delig;
-	deline(581, s, i);
-	al_mess2 = delig;
+	g_vm->_txxFileFl = true;
 }
 
 /**
- * The original engine used this method to display a starting text screen letting the palyer
+ * The original engine used this method to display a starting text screen letting the player
  * select the graphics mode to use
  */
 void dialpre() {


Commit: 6e8a50c8739e9c003d324f8f832eb9d83c457b0f
    https://github.com/scummvm/scummvm/commit/6e8a50c8739e9c003d324f8f832eb9d83c457b0f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:04-07:00

Commit Message:
MORTEVIELLE: Start removing deline() and delig

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 68d6e82..a22dd3b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -47,7 +47,6 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void fctMove() {
-	//int mx, cx, cy;
 	int cx;
 
 	if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._depl[6])) {
@@ -180,7 +179,6 @@ L2:
  * @remarks	Originally called 'tprendre'
  */
 void fctTake() {
-	//int cx, cy, cz;
 	int cx;
 
 	if (caff > 99) {
@@ -354,8 +352,6 @@ void fctLift() {
  * @remarks	Originally called 'tlire'
  */
 void fctRead() {
-//	int iaff;
-
 	if (caff > 99)
 		st4(caff);
 	else {
@@ -622,9 +618,8 @@ void fctOpen() {
  */
 void fctPlace() {
 	bool enterPassageFl;
-	char st[1410];
 	Common::String str_;
-	int i, tay;
+	int i;
 
 	if (s.derobj == 0) {
 		crep = 186;
@@ -673,8 +668,9 @@ void fctPlace() {
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 					if (answer== 1)  {
-						deline(582, st, tay);
-						i = Alert::show(delig, 1);
+						Common::String alertTxt = delin2(582);
+						i = Alert::show(alertTxt, 1);
+
 						tesok = false;
 						enterPassageFl = Ques::show();
 						hideMouse();
@@ -700,8 +696,8 @@ void fctPlace() {
 							dessin(0);
 							aniof(1, 2);
 							aniof(1, 1);
-							deline(577, st, tay);
-							i = Alert::show(delig, 1);
+							alertTxt = delin2(577);
+							i = Alert::show(alertTxt, 1);
 							aniof(2, 1);
 							crep = 166;
 						}
@@ -1289,11 +1285,9 @@ void fctSound() {
  */
 void fctDiscuss() {
 	bool te[47];
-	int cy, cx, max, haz, suj, co, lig, icm,
-	        i, tay, choi, x, y, c;
+	int cy, cx, max, haz, suj, co, lig, icm, i, choi, x, y, c;
 	char tou;
 	Common::String lib[47];
-	char st[1410];
 	bool f;
 
 	finfouil();
@@ -1319,9 +1313,8 @@ void fctDiscuss() {
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
-		deline(ix + c_tparler, st, tay);
-		lib[ix] = delig;
-		for (i = tay; i <= 40; ++i)
+		lib[ix] = delin2(ix + c_tparler);
+		for (i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
 	lib[46] = lib[45];
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b91fd30..f8c5ceb 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -290,13 +290,12 @@ bool Ques::show() {
 	const int correctAnswerArr[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
 	int optionPosY;
-	int curLength, maxLength;
+	int maxLength;
 	int rep;
 	int firstOption, lastOption;
 	char key;
 	rectangle coor[max_rect];
 	Common::String choiceArray[15];
-	char st[1410];
 
 	int currChoice, prevChoice;
 	int indx = 0;
@@ -308,14 +307,15 @@ bool Ques::show() {
 		hirs();
 		showMouse();
 		++indx;
-		deline(textIndexArr[indx], st, curLength);
 		int dialogHeight;
 		if (res == 1)
 			dialogHeight = 29;
 		else
 			dialogHeight = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
-		afftex(st, 20, 15, 100, 2, 0);
+		Common::String tmpStr = delin2(textIndexArr[indx]);
+		afftex(tmpStr, 20, 15, 100, 2, 0);
+
 		if (indx != 10) {
 			firstOption = textIndexArr[indx] + 1;
 			lastOption = textIndexArr[indx + 1] - 1;
@@ -327,11 +327,11 @@ bool Ques::show() {
 		maxLength = 0;
 
 		for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) {
-			deline(j, st, curLength);
-			if (curLength > maxLength)
-				maxLength = curLength;
-			afftex(st, 100, optionPosY, 100, 1, 0);
-			choiceArray[prevChoice] = delig;
+			tmpStr = delin2(j);
+			if ((int) tmpStr.size() > maxLength)
+				maxLength = tmpStr.size();
+			afftex(tmpStr, 100, optionPosY, 100, 1, 0);
+			choiceArray[prevChoice] = tmpStr;
 			optionPosY += 8;
 		}
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
@@ -356,6 +356,7 @@ bool Ques::show() {
 		rep = 0;
 
 		prevChoice = 0;
+		warning("Expected answer: %d", correctAnswerArr[indx]);
 		do {
 			g_vm->setMouseClick(false);
 			tesok = false;
@@ -368,34 +369,21 @@ bool Ques::show() {
 				++currChoice;
 			if (coor[currChoice].enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
-					st[0] = ' ';
-//					for (j = 0; j <= maxLength; ++j)
-//						st[j + 1] = choiceArray[prevChoice][j];
-					strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength);
-					st[1 + maxLength] = '$';
-					afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0);
+					Common::String tmpStr = choiceArray[prevChoice] + '$';
+					afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
 				if (prevChoice != currChoice) {
-					st[0] = ' ';
-//					for (j = 0; j <= maxLength; ++j)
-//						st[j + 1] = choiceArray[currChoice][j];
-					strncpy(st + 1, choiceArray[currChoice].c_str(), maxLength);
-					st[1 + maxLength] = '$';
-					afftex(st, 100, 27 + (currChoice * 8), 100, 1, 1);
+					Common::String tmpStr = choiceArray[currChoice] + '$';
+					afftex(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
 					prevChoice = currChoice;
 				}
 			} else if (prevChoice != 0) {
-					st[0] = ' ';
-//				for (j = 0; j <= maxLength; ++j)
-//					st[j + 1] = choiceArray[prevChoice][j];
-				strncpy(st + 1, choiceArray[prevChoice].c_str(), maxLength);
-				st[1 + maxLength] = '$';
-				afftex(st, 100, 27 + (prevChoice * 8), 100, 1, 0);
+				Common::String tmpStr = choiceArray[prevChoice] + '$';
+				afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				prevChoice = 0;
 			}
 		} while (!((prevChoice != 0) && g_vm->getMouseClick()));
 
-		warning("Expected answer: %d, answer: %d", prevChoice, correctAnswerArr[indx]);
 		if (prevChoice == correctAnswerArr[indx])
 			// Answer is correct
 			++correctCount;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 7511b21..bec7ef4 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1112,18 +1112,22 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 		a = (float)((x - xx)) / (y - yy);
 		b = (yr * xro - yro * xr) / (y - yy);
 		i = y;
-		if (y > yy)  step = -1;
-		else step = 1;
+		if (y > yy)
+			step = -1;
+		else
+			step = 1;
 		do {
 			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
-			i = i + step;
+			i += step;
 		} while (i != yy);
 	} else {
 		a = (float)((y - yy)) / (x - xx);
 		b = ((yro * xr) - (yr * xro)) / (x - xx);
 		i = x;
-		if (x > xx)  step = -1;
-		else step = 1;
+		if (x > xx)
+			step = -1;
+		else
+			step = 1;
 		do {
 			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
 			i = i + step;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index f81a454..d176d7c 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -389,11 +389,9 @@ void Menu::eraseMenu() {
  * Handle updates to the menu
  */
 void Menu::mdn() {
-	//int x, y, c, a, ix;
 	int x, y, ix;
 	bool tes;
 
-	/* debug('mdn'); */
 	if (!_menuActive)
 		return;
 
@@ -466,8 +464,7 @@ void Menu::mdn() {
 }
 
 void Menu::initMenu() {
-	int i, tai;
-	char st[1410];
+	int i;
 	Common::File f;
 
 	if (!f.open("menufr.mor"))
@@ -488,20 +485,18 @@ void Menu::initMenu() {
 		_dep[i] = "*                       ";
 	i = 1;
 	do {
-		deline(i + c_action, st, tai);
-		_act[i] = delig;
+		_act[i] = delin2(i + c_action);
+
 		while (_act[i].size() < 10)
 			_act[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				deline(i + c_saction, st, tai);
-				_self[i] = delig;
+				_self[i] = delin2(i + c_saction);
 				while (_self[i].size() < 10)
 					_self[i] += ' ';
 			}
-			deline(i + c_dis, st, tai);
-			_dis[i] = delig + ' ';
+			_dis[i] = delin2(i + c_dis) + ' ';
 		}
 		++i;
 	} while (i != 22);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index f36ae2d..cac723a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -130,20 +130,16 @@ void text_color(int c) {
 
 
 void text1(int x, int y, int nb, int m) {
-	char st[1410];
-	int tay;
 	int co;
 
-
-	/* debug('text'); */
 	if (res == 1)
 		co = 10;
 	else
 		co = 6;
-	deline(m, st, tay);
-	if ((y == 182) && (tay * co > nb * 6))
+	Common::String tmpStr = delin2(m);
+	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
-	afftex(st, x, y, nb, 20, color_txt);
+	afftex(tmpStr, x, y, nb, 20, color_txt);
 }
 
 void initouv() {
@@ -313,31 +309,26 @@ void okpas() {
 }
 
 void modobj(int m) {
-	char str_[1410];
-	int tay;
-
 	Common::String strp = Common::String(' ');
-	if (m != 500) {
-		deline(m - 501 + c_st41, str_, tay);
-		strp = delig;
-	}
+
+	if (m != 500)
+		strp = delin2(m - 501 + c_st41);
+
 	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
 }
 
 void modobj2(int m, bool t1, bool t2) {
-	char str_[1410];
-	int tay;
-
 	Common::String strp = Common::String(' ');
+
 	if (t1 || t2)
 		okpas();
 	else
 		tesok = false;;
-	if (m != 500) {
-		deline(m - 501 + c_st41, str_, tay);
-		strp = delig;
-	}
+
+	if (m != 500)
+		strp = delin2(m - 501 + c_st41);
+
 	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
 }
@@ -346,17 +337,19 @@ void modobj2(int m, bool t1, bool t2) {
 void repon(int f, int m) {
 	Common::String str_;
 	Common::String str1;
-	char st[1410];
-	int i, xco, dx, caspe, tay;
+	Common::String tmpStr;
+	int i, xco, dx, caspe;
 
 	if ((m > 499) && (m < 563)) {
-		deline(m - 501 + c_st41, st, tay);
-		if (tay > ((58 + (res - 1) * 37) << 1))
+		tmpStr = delin2(m - 501 + c_st41);
+
+		if ((int) tmpStr.size() > ((58 + (res - 1) * 37) << 1))
 			f2_all = true;
 		else
 			f2_all = false;
+
 		clsf2();
-		afftex(st, 8, 176, 85, 3, 5);
+		afftex(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
 		if (f == 8)
@@ -378,33 +371,37 @@ void repon(int f, int m) {
 			}
 		}
 		if ((f >= 6) && (f <= 9)) {
-			deline(m, st, tay);
 			if (f == 6)
 				i = 4;
 			else
 				i = 5;
-			afftex(st, 80, 40, 60, 25, i);
+
+			tmpStr = delin2(m);
+			afftex(tmpStr, 80, 40, 60, 25, i);
+
 			if (m == 180)
 				s.pourc[6] = '*';
+
 			if (m == 179)
 				s.pourc[10] = '*';
 		}
 		if (f == 7) {         /* messint */
 			ecrf7();
-			deline(m, st, tay);
+			tmpStr = delin2(m);
 			if (res == 1) {
-				xco = 252 - tay * 5;
+				xco = 252 - tmpStr.size() * 5;
 				caspe = 100;
 				dx = 80;
 			} else {
-				xco = 252 - tay * 3;
+				xco = 252 - tmpStr.size() * 3;
 				caspe = 144;
 				dx = 50;
 			}
-			if (tay < 40)
-				afftex(st, xco, 86, dx, 3, 5);
+
+			if (tmpStr.size() < 40)
+				afftex(tmpStr, xco, 86, dx, 3, 5);
 			else
-				afftex(st, caspe, 86, dx, 3, 5);
+				afftex(tmpStr, caspe, 86, dx, 3, 5);
 		}
 	}
 }
@@ -443,7 +440,6 @@ void t5(int cx) {
 void affper(int per) {
 	int cx;
 
-	/* debug('affper'); */
 	for (cx = 1; cx <= 8; ++cx)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]);
 	clsf10();
@@ -905,7 +901,6 @@ void quelq20(int h, int &per) {
 void frap() {
 	int j, h, m, haz;
 
-	/* debug('o1 frap'); */
 	calch(j, h, m);
 	if ((h >= 0) && (h < 8))
 		crep = 190;
@@ -968,7 +963,6 @@ void tip(int ip, int &cx) {
 
 
 void ecfren(int &p, int &haz, int cf, int l) {
-	/* debug('o1 ecfren'); */
 	if (l == 0)
 		person();
 	p = -500;
@@ -996,7 +990,6 @@ void ecfren(int &p, int &haz, int cf, int l) {
 void becfren(int l) {
 	int haz;
 
-	/* debug('o1 becfren'); */
 	if ((l == 1) || (l == 4)) {
 		haz = hazard(1, 2);
 		if (l == 1)
@@ -1029,13 +1022,11 @@ void becfren(int l) {
 void init_nbrepm() {
 	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 
-	/* debug('init_nbrepm'); */
 	for (int idx = 0; idx < 9; ++idx)
 		nbrepm[idx] = ipm[idx];
 }
 
 void phaz(int &haz, int &p, int cf) {
-	/* debug('phaz'); */
 	p += cf;
 	haz = hazard(1, 100);
 }
@@ -1043,7 +1034,6 @@ void phaz(int &haz, int &p, int cf) {
 void inzon() {
 	int cx;
 
-	/* debug('o2 inzon'); */
 	copcha();
 
 	s.ipre  = false;
@@ -1088,9 +1078,7 @@ void inzon() {
 }
 
 void dprog() {
-	/* debug('o2 dprog'); */
 	li = 21;
-	/* jh:= t_settime(0);*/
 	jh = 0;
 	if (! s.ipre)
 		blo = true;
@@ -1101,7 +1089,6 @@ void dprog() {
 void pl1(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl1'); */
 	if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) {
 		cpl1(p);
 		phaz(haz, p, cf);
@@ -1115,7 +1102,6 @@ void pl1(int cf) {
 void pl2(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl2'); */
 	if (! bh2) {
 		cpl2(p);
 		phaz(haz, p, cf);
@@ -1129,7 +1115,6 @@ void pl2(int cf) {
 void pl5(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl5'); */
 	if (! bh5) {
 		cpl5(p);
 		phaz(haz, p, cf);
@@ -1143,7 +1128,6 @@ void pl5(int cf) {
 void pl6(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl6'); */
 	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
 		cpl6(p);
 		phaz(haz, p, cf);
@@ -1157,7 +1141,6 @@ void pl6(int cf) {
 void pl9(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl9'); */
 	if (! bh9) {
 		cf = -10;
 		phaz(haz, p, cf);
@@ -1171,7 +1154,6 @@ void pl9(int cf) {
 void pl10(int cf) {
 	int p, h, haz;
 
-	/* debug('o2 pl10'); */
 	cpl10(p, h);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1183,7 +1165,6 @@ void pl10(int cf) {
 void pl11(int cf) {
 	int p, h, haz;
 
-	/* debug('o2 pl11'); */
 	cpl11(p, h);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1195,7 +1176,6 @@ void pl11(int cf) {
 void pl12(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl12'); */
 	cpl12(p);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1207,7 +1187,6 @@ void pl12(int cf) {
 void pl13(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl13'); */
 	cpl13(p);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1219,7 +1198,6 @@ void pl13(int cf) {
 void pl15(int cf) {
 	int p, haz;
 
-	/* debug('o2 pl15'); */
 	cpl15(p);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1231,7 +1209,6 @@ void pl15(int cf) {
 void pl20(int cf) {
 	int p, h, haz;
 
-	/* debug('o2 pl20'); */
 	cpl20(p, h);
 	phaz(haz, p, cf);
 	if (haz > p)
@@ -1243,7 +1220,6 @@ void pl20(int cf) {
 void t11(int l11, int &a) {
 	int p, haz, h = 0;
 
-	/* debug('o2 t11'); */
 	ecfren(p, haz, s.conf, l11);
 	li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
@@ -1300,7 +1276,6 @@ void t11(int l11, int &a) {
 void cavegre() {
 	int haz;
 
-	/* debug('cavegre'); */
 	s.conf = s.conf + 2;
 	if (s.conf > 69)
 		s.conf += (s.conf / 10);
@@ -1362,8 +1337,8 @@ void musique(int so) {
 	bool i;
 	int haz;
 
-	/* debug('musique'); */
-	if (so == 0) { /*musik(0)*/
+	if (so == 0) {
+		/* musik(0) */
 		;
 	} else if ((prebru == 0) && (! s.ipre)) {
 		parole(10, 1, 1);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index fb1ccaf..f512757 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -238,26 +238,21 @@ void tkey1(bool d) {
 }
 
 void tmlieu(int mli) {
-	int cx, i, tail;
 	Common::String nomp;
-	char st[1410];
-
 
 	if (mli == 26)
 		mli = 15;
 
-	i = 1;
+	int i = 1;
 	while ((i < 8) && (v_lieu[i][mli] != 0)) {
-		cx = v_lieu[i][mli];
-		deline(cx + c_tmlieu, st, tail);
-		nomp = delig;
+		nomp = delin2(v_lieu[i][mli] + c_tmlieu);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		g_vm->_menu.menut(g_vm->_menu._depl[i], nomp);
 		++i;
 	}
 	nomp = "*                   ";
-	for (cx = 7; cx >= i; --cx)
+	for (int cx = 7; cx >= i; --cx)
 		g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp);
 }
 
@@ -377,8 +372,7 @@ void st1sama() {
 }
 
 void modinv() {
-	int tay, r;
-	char nom[1410];
+	int r;
 	Common::String nomp;
 
 	int cy = 0;
@@ -386,8 +380,7 @@ void modinv() {
 		if (s.sjer[cx] != chr(0)) {
 			++cy;
 			r = (ord(s.sjer[cx]) + 400);
-			deline(r - 501 + c_st41, nom, tay);
-			nomp = delig;
+			nomp = delin2(r - 501 + c_st41);
 			g_vm->_menu.menut(g_vm->_menu._invt[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]);
 		}
@@ -400,13 +393,12 @@ void modinv() {
 
 void sparl(float adr, float rep) {
 	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
-	int key, tay, repint;
-	char st[1410];
+	int key, repint;
 
 	repint = abs((int)rep);
 	hideMouse();
-	deline(repint + c_paroles, st, tay);
-	afftex(st, 230, 4, 65, 24, 5);
+	Common::String tmpStr = delin2(repint + c_paroles);
+	afftex(tmpStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
 	key = 0;
@@ -449,8 +441,6 @@ void premtet() {
 
 /* NIVEAU 5 */
 void ajchai() {
-
-
 	int cy = acha + ((mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
@@ -484,12 +474,12 @@ void t1sama() {    //Entering manor
 	calch(j, h, m);
 	if ((h < 5) && (s.mlieu > 18)) {
 		cherjer(137, d);
-		if (!d) {        /* On n'a pas les cl‚s et il est tard */   //Translation: You don't have the keys, and it's late
+		if (!d) {        //You don't have the keys, and it's late
 			crep = 1511;
 			tperd();
 		} else
 			st1sama();
-	} else if (!s.ipre) {     /* c'est votre premiŠre fois ? */   //Translation: Is it your first time?
+	} else if (!s.ipre) {     //Is it your first time?
 		ipers = 255;
 		affper(ipers);
 		caff = 77;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 9ca4839..262cc34 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,17 +134,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	int length = 0;
-	char str[1410];
-
-	deline(578, str, length);
-	al_mess = delig;
-	deline(579, str, length);
-	err_mess = delig;
-	deline(580, str, length);
-	ind_mess = delig;
-	deline(581, str, length);
-	al_mess2 = delig;
+	al_mess  = delin2(578);  // Insert floppy #1
+	err_mess = delin2(579);  // Floppy error
+	ind_mess = delin2(580);  // You should have noticed %d hints
+	al_mess2 = delin2(581);  // Insert floppy #2
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 99c2cac..c2da116 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -134,8 +134,13 @@ void deline(int num, char *line , int &length) {
 
 	if (!g_vm->_txxFileFl) {
 		delig = g_vm->getGameString(num);
+/*		if (delig.size() < 255)
+			// Remove trailing '$'
+			delig.deleteLastChar();
+*/
 		if (line) {
-			strcpy(line, delig.c_str());
+			line[0] = ' ';
+			strcpy(line + 1, delig.c_str());
 			length = delig.size();
 		}
 
@@ -169,11 +174,21 @@ void deline(int num, char *line , int &length) {
 	warning("deline: delig %s - line %s", delig.c_str(), line);
 }
 
+Common::String delin2(int num) {
+	char tmpStr[1410];
+	int length;
+
+	deline(num, tmpStr, length);
+	
+	Common::String resStr = delig;
+	delig = "";
+	return resStr;
+}
 
-void afftex(char *ch, int x, int y, int dx, int dy, int typ);
+void afftex(const char *ch, int x, int y, int dx, int dy, int typ);
 
 
-static int l_motsuiv(int p, char *ch, int &tab) {
+static int l_motsuiv(int p, const char *ch, int &tab) {
 	int c = p;
 
 	while ((ch[p] != ' ') && (ch[p] != '$') && (ch[p] != '@'))
@@ -182,12 +197,14 @@ static int l_motsuiv(int p, char *ch, int &tab) {
 	return tab * (p - c);
 }
 
-void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
+void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
 	bool the_end;
 	int tab;
 	Common::String s;
 	int i, j;
 
+	// Safeguard: add $ just in case
+	ch += '$'; 
 
 	/*    debug('  .. Afftex');*/
 	g_vm->_screenSurface.putxy(x, y);
@@ -201,7 +218,8 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 	int yc = y;
 	int xf = x + dx;
 	int yf = y + dy;
-	int p = 1;
+//	int p = 1;
+	int p = 0;
 	the_end = (ch[p] == '$');
 	s = "";
 	while (!the_end) {
@@ -218,7 +236,7 @@ void afftex(char *ch, int x, int y, int dx, int dy, int typ) {
 			s += ' ';
 			xc += tab;
 			++p;
-			if (l_motsuiv(p, ch, tab) + xc > xf) {
+			if (l_motsuiv(p, ch.c_str(), tab) + xc > xf) {
 				g_vm->_screenSurface.writeg(s, typ);
 				s = "";
 				xc = x;
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 32d3c4c..742b832 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -35,7 +35,8 @@ namespace Mortevielle {
 extern Common::String delig;
 
 extern void deline(int num , char *line , int &length);
-extern void afftex(char *ch, int x, int y, int dx, int dy, int typ);
+extern Common::String delin2(int num);
+extern void afftex(Common::String ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 17966b8..64bb6cb 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -102,7 +102,6 @@ void charpal() {
 void chartex() {
 	Common::File inpFile;
 	Common::File ntpFile;
-	char s[1410];
 
 	g_vm->_txxFileFl = false;
 	if (g_vm->getLanguage() == Common::EN_ANY) {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 7aef569..daac977 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -174,7 +174,7 @@ int x,
 int t_cph[6401];
 byte tabdon[4001];
 
-Common::String stpou;               /* donne le % d'indices */ //Translation: "Provides the % of hints"
+Common::String stpou;               // Provides the % of hints
 byte is;
 byte mode;
 Common::String al_mess,


Commit: d22862201bff3053f11ee013648dd5d9e39cefd1
    https://github.com/scummvm/scummvm/commit/d22862201bff3053f11ee013648dd5d9e39cefd1
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:06-07:00

Commit Message:
MORTEVIELLE: Rename arrays used by menu

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index a22dd3b..80aba8d 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,13 +49,13 @@ namespace Mortevielle {
 void fctMove() {
 	int cx;
 
-	if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._depl[6])) {
+	if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._moveMenu[6])) {
 		s.mlieu = 15;
 		caff = s.mlieu;
 		afdes(0);
 		repon(2, s.mlieu);
 	}
-	if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._depl[6])) {
+	if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._moveMenu[6])) {
 		if (!syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
@@ -88,7 +88,7 @@ void fctMove() {
 	cx = 0;
 	do {
 		++cx;
-	} while (g_vm->_menu._depl[cx] != msg[4]);
+	} while (g_vm->_menu._moveMenu[cx] != msg[4]);
 	if (s.mlieu == 19) {
 		if (cx == 1)
 			t1deva();
@@ -295,7 +295,7 @@ void tsprendre() {
 	cx = 0;
 	do {
 		++cx;
-	} while (g_vm->_menu._invt[cx] != msg[4]);
+	} while (g_vm->_menu._inventoryMenu[cx] != msg[4]);
 	cz = 0;
 	cy = 0;
 	do {
@@ -1100,7 +1100,7 @@ void fctEnter() {
 				++s.conf;
 				s.mlieu = 15;
 				msg[3] = MENU_DISCUSS;
-				msg[4] = g_vm->_menu._disc[x];
+				msg[4] = g_vm->_menu._discussMenu[x];
 				syn = true;
 				if (ment == 9) {
 					col = true;
@@ -1297,7 +1297,7 @@ void fctDiscuss() {
 		cx = 0;
 		do {
 			++cx;
-		} while (g_vm->_menu._disc[cx] != msg[4]);
+		} while (g_vm->_menu._discussMenu[cx] != msg[4]);
 		caff = 69 + cx;
 		afdes(0);
 		repon(2, caff);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index d176d7c..250fd12 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -43,10 +43,10 @@ namespace Mortevielle {
 /**
  * Setup a menu's contents
  */
-void Menu::menut(int no, Common::String nom) {
+void Menu::menut(int no, Common::String name) {
 	byte h = hi(no);
 	byte l = lo(no);
-	Common::String s = nom;
+	Common::String s = name;
 
 	if (! tesok)
 		g_vm->quitGame();
@@ -58,21 +58,21 @@ void Menu::menut(int no, Common::String nom) {
 	switch (h) {
 	case MENU_INVENTORY:
 		if (l != 7) {
-			_inv[l] = s;
-			_inv[l].insertChar(' ', 0);
+			_inventoryStringArray[l] = s;
+			_inventoryStringArray[l].insertChar(' ', 0);
 		}
 		break;
 	case MENU_MOVE:
-		_dep[l] = s;
+		_moveStringArray[l] = s;
 		break;
 	case MENU_ACTION:
-		_act[l] = s;
+		_actionStringArray[l] = s;
 		break;
 	case MENU_SUB_ACTION:
-		_self[l] = s;
+		_selfStringArray[l] = s;
 		break;
 	case MENU_DISCUSS:
-		_dis[l] = s;
+		_discussStringArray[l] = s;
 		break;
 	default:
 		break;
@@ -90,22 +90,22 @@ void Menu::disableMenuItem(int no) {
 	switch (h) {
 	case MENU_INVENTORY:
 		if (l > 6) {
-			_inv[l].setChar('<', 0);
-			_inv[l].setChar('>', 21);
+			_inventoryStringArray[l].setChar('<', 0);
+			_inventoryStringArray[l].setChar('>', 21);
 		} else
-			_inv[l].setChar('*', 0);
+			_inventoryStringArray[l].setChar('*', 0);
 		break;
 	case MENU_MOVE:
-		_dep[l].setChar('*', 0);
+		_moveStringArray[l].setChar('*', 0);
 		break;
 	case MENU_ACTION:
-		_act[l].setChar('*', 0);
+		_actionStringArray[l].setChar('*', 0);
 		break;
 	case MENU_SUB_ACTION:
-		_self[l].setChar('*', 0);
+		_selfStringArray[l].setChar('*', 0);
 		break;
 	case MENU_DISCUSS:
-		_dis[l].setChar('*', 0);
+		_discussStringArray[l].setChar('*', 0);
 		break;
 	default:
 		break;
@@ -115,6 +115,7 @@ void Menu::disableMenuItem(int no) {
 /**
  * Enable a menu item
  * @param no	Hi byte represents menu number, lo byte reprsents item index
+ * @remarks	Originally called menu_enable
  */
 void Menu::enableMenuItem(int no) {
 	byte h = hi(no);
@@ -122,21 +123,22 @@ void Menu::enableMenuItem(int no) {
 
 	switch (h) {
 	case MENU_INVENTORY:
-		_inv[l].setChar(' ', 0);
-		_inv[l].setChar(' ', 21);
+		_inventoryStringArray[l].setChar(' ', 0);
+		_inventoryStringArray[l].setChar(' ', 21);
 		break;
 	case MENU_MOVE:
-		_dep[l].setChar(' ', 0);
+		_moveStringArray[l].setChar(' ', 0);
 		break;
 	case MENU_ACTION:
-		_act[l].setChar(' ', 0);
+		_actionStringArray[l].setChar(' ', 0);
 		break;
 	case MENU_SUB_ACTION:
-		_self[l].setChar(' ', 0);
-		_self[l].setChar(' ', 0);
+		_selfStringArray[l].setChar(' ', 0);
+		// The original sets two times the same value. Skipped
+		// _selfStringArray[l].setChar(' ', 0);
 		break;
 	case MENU_DISCUSS:
-		_dis[l].setChar(' ', 0);
+		_discussStringArray[l].setChar(' ', 0);
 		break;
 	default:
 		break;
@@ -207,19 +209,19 @@ void Menu::invers(int ix) {
 	g_vm->_screenSurface.putxy(don[msg3][1] << 3, (lo(msg4) + 1) << 3);
 	switch (msg3) {
 	case 1:
-		s = _inv[lo(msg4)];
+		s = _inventoryStringArray[lo(msg4)];
 		break;
 	case 2:
-		s = _dep[lo(msg4)];
+		s = _moveStringArray[lo(msg4)];
 		break;
 	case 3:
-		s = _act[lo(msg4)];
+		s = _actionStringArray[lo(msg4)];
 		break;
 	case 4:
-		s = _self[lo(msg4)];
+		s = _selfStringArray[lo(msg4)];
 		break;
 	case 5:
-		s = _dis[lo(msg4)];
+		s = _discussStringArray[lo(msg4)];
 		break;
 	case 6:
 		s = g_vm->getEngineString(S_SAVE_LOAD + lo(msg4));
@@ -304,24 +306,24 @@ void Menu::menuDown(int ii) {
 		++cx;
 		switch (ii) {
 		case 1:
-			if (_inv[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_inv[cx], 4);
+			if (_inventoryStringArray[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_inventoryStringArray[cx], 4);
 			break;
 		case 2:
-			if (_dep[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_dep[cx], 4);
+			if (_moveStringArray[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_moveStringArray[cx], 4);
 			break;
 		case 3:
-			if (_act[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_act[cx], 4);
+			if (_actionStringArray[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_actionStringArray[cx], 4);
 			break;
 		case 4:
-			if (_self[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_self[cx], 4);
+			if (_selfStringArray[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_selfStringArray[cx], 4);
 			break;
 		case 5:
-			if (_dis[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_dis[cx], 4);
+			if (_discussStringArray[cx][0] != '*')
+				g_vm->_screenSurface.writeg(_discussStringArray[cx], 4);
 			break;
 		case 6:
 			g_vm->_screenSurface.writeg(g_vm->getEngineString(S_SAVE_LOAD + cx), 4);
@@ -479,34 +481,34 @@ void Menu::initMenu() {
 	dem2();
 
 	for (i = 1; i <= 8; ++i)
-		_inv[i] = "*                     ";
-	_inv[7] = "< -*-*-*-*-*-*-*-*-*- ";
+		_inventoryStringArray[i] = "*                     ";
+	_inventoryStringArray[7] = "< -*-*-*-*-*-*-*-*-*- ";
 	for (i = 1; i <= 7; ++i)
-		_dep[i] = "*                       ";
+		_moveStringArray[i] = "*                       ";
 	i = 1;
 	do {
-		_act[i] = delin2(i + c_action);
+		_actionStringArray[i] = delin2(i + c_action);
 
-		while (_act[i].size() < 10)
-			_act[i] += ' ';
+		while (_actionStringArray[i].size() < 10)
+			_actionStringArray[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				_self[i] = delin2(i + c_saction);
-				while (_self[i].size() < 10)
-					_self[i] += ' ';
+				_selfStringArray[i] = delin2(i + c_saction);
+				while (_selfStringArray[i].size() < 10)
+					_selfStringArray[i] += ' ';
 			}
-			_dis[i] = delin2(i + c_dis) + ' ';
+			_discussStringArray[i] = delin2(i + c_dis) + ' ';
 		}
 		++i;
 	} while (i != 22);
 	for (i = 1; i <= 8; ++i) {
-		_disc[i] = 0x500 + i;
+		_discussMenu[i] = 0x500 + i;
 		if (i < 8)
-			_depl[i] = 0x200 + i;
-		_invt[i] = 0x100 + i;
+			_moveMenu[i] = 0x200 + i;
+		_inventoryMenu[i] = 0x100 + i;
 		if (i > 6)
-			g_vm->_menu.disableMenuItem(_invt[i]);
+			g_vm->_menu.disableMenuItem(_inventoryMenu[i]);
 	}
 	msg3 = OPCODE_NONE;
 	msg4 = OPCODE_NONE;
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 8416924..67fc8bb 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -39,16 +39,16 @@ private:
 	void menuDown(int ii);
 public:
 	bool _menuActive;
-	Common::String _inv[9];
-	Common::String _dep[8];
-	Common::String _act[22];
-	Common::String _self[7];
-	Common::String _dis[9];
-	int _disc[9];
-	int _invt[9];
-	int _depl[8];
+	Common::String _inventoryStringArray[9];
+	Common::String _moveStringArray[8];
+	Common::String _actionStringArray[22];
+	Common::String _selfStringArray[7];
+	Common::String _discussStringArray[9];
+	int _discussMenu[9];
+	int _inventoryMenu[9];
+	int _moveMenu[8];
 public:
-	void menut(int no, Common::String nom);
+	void menut(int no, Common::String name);
 	void disableMenuItem(int no);
 	void enableMenuItem(int no);
 	void menu_aff();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index cac723a..25a0cf7 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -314,8 +314,8 @@ void modobj(int m) {
 	if (m != 500)
 		strp = delin2(m - 501 + c_st41);
 
-	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
-	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
+	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
+	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
 }
 
 void modobj2(int m, bool t1, bool t2) {
@@ -329,8 +329,8 @@ void modobj2(int m, bool t1, bool t2) {
 	if (m != 500)
 		strp = delin2(m - 501 + c_st41);
 
-	g_vm->_menu.menut(g_vm->_menu._invt[8], strp);
-	g_vm->_menu.disableMenuItem(g_vm->_menu._invt[8]);
+	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
+	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
 }
 
 
@@ -441,47 +441,47 @@ void affper(int per) {
 	int cx;
 
 	for (cx = 1; cx <= 8; ++cx)
-		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cx]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
 		g_vm->_screenSurface.putxy(560, 24);
 		g_vm->_screenSurface.writeg("LEO", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[1]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[1]);
 	}
 	if ((per & 64) == 64) {
 		g_vm->_screenSurface.putxy(560, 32);
 		g_vm->_screenSurface.writeg("PAT", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[2]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[2]);
 	}
 	if ((per & 32) == 32) {
 		g_vm->_screenSurface.putxy(560, 40);
 		g_vm->_screenSurface.writeg("GUY", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[3]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[3]);
 	}
 	if ((per & 16) == 16) {
 		g_vm->_screenSurface.putxy(560, 48);
 		g_vm->_screenSurface.writeg("EVA", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[4]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[4]);
 	}
 	if ((per & 8) == 8) {
 		g_vm->_screenSurface.putxy(560, 56);
 		g_vm->_screenSurface.writeg("BOB", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[5]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[5]);
 	}
 	if ((per & 4) == 4) {
 		g_vm->_screenSurface.putxy(560, 64);
 		g_vm->_screenSurface.writeg("LUC", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[6]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[6]);
 	}
 	if ((per & 2) == 2) {
 		g_vm->_screenSurface.putxy(560, 72);
 		g_vm->_screenSurface.writeg("IDA", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[7]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[7]);
 	}
 	if ((per & 1) == 1) {
 		g_vm->_screenSurface.putxy(560, 80);
 		g_vm->_screenSurface.writeg("MAX", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._disc[8]);
+		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
 	}
 	ipers = per;
 }
@@ -592,7 +592,7 @@ void cpl6(int &p) {
  */
 void person() {
 	for (int cf = 1; cf <= 8; ++cf)
-		g_vm->_menu.disableMenuItem(g_vm->_menu._disc[cf]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cf]);
 
 	Common::String sYou = g_vm->getEngineString(S_YOU);
 	Common::String sAre = g_vm->getEngineString(S_ARE);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index f512757..5495854 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -248,12 +248,12 @@ void tmlieu(int mli) {
 		nomp = delin2(v_lieu[i][mli] + c_tmlieu);
 		while (nomp.size() < 20)
 			nomp += ' ';
-		g_vm->_menu.menut(g_vm->_menu._depl[i], nomp);
+		g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
 		++i;
 	}
 	nomp = "*                   ";
 	for (int cx = 7; cx >= i; --cx)
-		g_vm->_menu.menut(g_vm->_menu._depl[cx], nomp);
+		g_vm->_menu.menut(g_vm->_menu._moveMenu[cx], nomp);
 }
 
 
@@ -279,7 +279,7 @@ void mfouen() {
 
 	tmlieu(s.mlieu);
 	for (cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.enableMenuItem(men[cx]);
+		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
 	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
@@ -381,13 +381,13 @@ void modinv() {
 			++cy;
 			r = (ord(s.sjer[cx]) + 400);
 			nomp = delin2(r - 501 + c_st41);
-			g_vm->_menu.menut(g_vm->_menu._invt[cy], nomp);
-			g_vm->_menu.enableMenuItem(g_vm->_menu._invt[cx]);
+			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
+			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
 	if (cy < 6)
 		for (int cx = cy + 1; cx <= 6; ++cx) {
-			g_vm->_menu.menut(g_vm->_menu._invt[cx], "                       ");
-			g_vm->_menu.disableMenuItem(g_vm->_menu._invt[cx]);
+			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cx], "                       ");
+			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
 }
 
@@ -421,10 +421,10 @@ void finfouil() {
 
 void mfoudi() {
 	for (int cx = 1; cx <= 7; ++cx) 
-		g_vm->_menu.disableMenuItem(g_vm->_menu._depl[cx]);
+		g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]);
 
 	for (int cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.disableMenuItem(men[cx]);
+		g_vm->_menu.disableMenuItem(_actionMenu[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
 	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
@@ -576,7 +576,7 @@ L1:
 		caff = 69 + cx;
 		crep = caff;
 		msg[3] = MENU_DISCUSS;
-		msg[4] = g_vm->_menu._disc[cx];
+		msg[4] = g_vm->_menu._discussMenu[cx];
 		syn = true;
 		col = true;
 	} else {
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index dc23d04..2df20b7 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -32,7 +32,7 @@
 
 namespace Mortevielle {
 
-static const int men[12] = { OPCODE_NONE,
+static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
 		OPCODE_ENTER,     OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
 		OPCODE_PLACE,     OPCODE_OPEN,   OPCODE_LEAVE


Commit: 2634bee7c66576e6a57425c7dd7892613d0794ef
    https://github.com/scummvm/scummvm/commit/2634bee7c66576e6a57425c7dd7892613d0794ef
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:07-07:00

Commit Message:
MORTEVIELLE: clean up deline()

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 80aba8d..d9a1022 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -668,7 +668,7 @@ void fctPlace() {
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 					if (answer== 1)  {
-						Common::String alertTxt = delin2(582);
+						Common::String alertTxt = deline(582);
 						i = Alert::show(alertTxt, 1);
 
 						tesok = false;
@@ -696,7 +696,7 @@ void fctPlace() {
 							dessin(0);
 							aniof(1, 2);
 							aniof(1, 1);
-							alertTxt = delin2(577);
+							alertTxt = deline(577);
 							i = Alert::show(alertTxt, 1);
 							aniof(2, 1);
 							crep = 166;
@@ -1313,7 +1313,7 @@ void fctDiscuss() {
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
-		lib[ix] = delin2(ix + c_tparler);
+		lib[ix] = deline(ix + c_tparler);
 		for (i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index f8c5ceb..9d7ea2f 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -313,7 +313,7 @@ bool Ques::show() {
 		else
 			dialogHeight = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
-		Common::String tmpStr = delin2(textIndexArr[indx]);
+		Common::String tmpStr = deline(textIndexArr[indx]);
 		afftex(tmpStr, 20, 15, 100, 2, 0);
 
 		if (indx != 10) {
@@ -327,7 +327,7 @@ bool Ques::show() {
 		maxLength = 0;
 
 		for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) {
-			tmpStr = delin2(j);
+			tmpStr = deline(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
 			afftex(tmpStr, 100, optionPosY, 100, 1, 0);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 250fd12..fe5581d 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -487,18 +487,18 @@ void Menu::initMenu() {
 		_moveStringArray[i] = "*                       ";
 	i = 1;
 	do {
-		_actionStringArray[i] = delin2(i + c_action);
+		_actionStringArray[i] = deline(i + c_action);
 
 		while (_actionStringArray[i].size() < 10)
 			_actionStringArray[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				_selfStringArray[i] = delin2(i + c_saction);
+				_selfStringArray[i] = deline(i + c_saction);
 				while (_selfStringArray[i].size() < 10)
 					_selfStringArray[i] += ' ';
 			}
-			_discussStringArray[i] = delin2(i + c_dis) + ' ';
+			_discussStringArray[i] = deline(i + c_dis) + ' ';
 		}
 		++i;
 	} while (i != 22);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 25a0cf7..9c57ed5 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -136,7 +136,7 @@ void text1(int x, int y, int nb, int m) {
 		co = 10;
 	else
 		co = 6;
-	Common::String tmpStr = delin2(m);
+	Common::String tmpStr = deline(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
 	afftex(tmpStr, x, y, nb, 20, color_txt);
@@ -312,7 +312,7 @@ void modobj(int m) {
 	Common::String strp = Common::String(' ');
 
 	if (m != 500)
-		strp = delin2(m - 501 + c_st41);
+		strp = deline(m - 501 + c_st41);
 
 	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -327,7 +327,7 @@ void modobj2(int m, bool t1, bool t2) {
 		tesok = false;;
 
 	if (m != 500)
-		strp = delin2(m - 501 + c_st41);
+		strp = deline(m - 501 + c_st41);
 
 	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -341,7 +341,7 @@ void repon(int f, int m) {
 	int i, xco, dx, caspe;
 
 	if ((m > 499) && (m < 563)) {
-		tmpStr = delin2(m - 501 + c_st41);
+		tmpStr = deline(m - 501 + c_st41);
 
 		if ((int) tmpStr.size() > ((58 + (res - 1) * 37) << 1))
 			f2_all = true;
@@ -376,7 +376,7 @@ void repon(int f, int m) {
 			else
 				i = 5;
 
-			tmpStr = delin2(m);
+			tmpStr = deline(m);
 			afftex(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
@@ -387,7 +387,7 @@ void repon(int f, int m) {
 		}
 		if (f == 7) {         /* messint */
 			ecrf7();
-			tmpStr = delin2(m);
+			tmpStr = deline(m);
 			if (res == 1) {
 				xco = 252 - tmpStr.size() * 5;
 				caspe = 100;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 5495854..01e913d 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -245,7 +245,7 @@ void tmlieu(int mli) {
 
 	int i = 1;
 	while ((i < 8) && (v_lieu[i][mli] != 0)) {
-		nomp = delin2(v_lieu[i][mli] + c_tmlieu);
+		nomp = deline(v_lieu[i][mli] + c_tmlieu);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
@@ -380,7 +380,7 @@ void modinv() {
 		if (s.sjer[cx] != chr(0)) {
 			++cy;
 			r = (ord(s.sjer[cx]) + 400);
-			nomp = delin2(r - 501 + c_st41);
+			nomp = deline(r - 501 + c_st41);
 			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
@@ -397,7 +397,7 @@ void sparl(float adr, float rep) {
 
 	repint = abs((int)rep);
 	hideMouse();
-	Common::String tmpStr = delin2(repint + c_paroles);
+	Common::String tmpStr = deline(repint + c_paroles);
 	afftex(tmpStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 262cc34..f2bb1ef 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,10 +134,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	al_mess  = delin2(578);  // Insert floppy #1
-	err_mess = delin2(579);  // Floppy error
-	ind_mess = delin2(580);  // You should have noticed %d hints
-	al_mess2 = delin2(581);  // Insert floppy #2
+	al_mess  = deline(578);  // Insert floppy #1
+	err_mess = deline(579);  // Floppy error
+	ind_mess = deline(580);  // You should have noticed %d hints
+	al_mess2 = deline(581);  // Insert floppy #2
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index c2da116..2cdfbe4 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -60,7 +60,7 @@ const byte tab31[32]= {
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
-void deline(int num , char *l , int &tl);
+Common::String deline(int num);
 typedef unsigned char uchar;
 
 static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
@@ -126,63 +126,32 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 /**
  * Decode and extract the line with the given Id
  */
-void deline(int num, char *line , int &length) {
+Common::String deline(int num) {
+	Common::String wrkStr = "";
+
 	if (num < 0) {
 		warning("deline: num < 0! Skipping");
-		return;
-	}
-
-	if (!g_vm->_txxFileFl) {
-		delig = g_vm->getGameString(num);
-/*		if (delig.size() < 255)
-			// Remove trailing '$'
-			delig.deleteLastChar();
-*/
-		if (line) {
-			line[0] = ' ';
-			strcpy(line + 1, delig.c_str());
-			length = delig.size();
-		}
-
-		return;
+	} else if (!g_vm->_txxFileFl) {
+		wrkStr = g_vm->getGameString(num);
+	} else {
+		int i = t_rec[num].indis;
+		byte k = t_rec[num].point;
+		int length = 0;
+		bool endFl = false;
+		char let;
+		do {
+			cinq_huit(let, i, k, endFl);
+			if (length < 254)
+				wrkStr += let;
+			++length;
+		} while (!endFl);
 	}
 
-	// DETEX
-	delig = "";
-	int ts = t_rec[num].indis;
-	byte ps = t_rec[num].point;
-	int i = ts;
-	length = 1;
-	int j = 1;
-	// Initialize properly first string character
-	line[0] = ' ';
-	byte k = ps;
-	bool endFl = false;
-	char let;
-	do {
-		cinq_huit(let, i, k, endFl);
-		line[j] = let;
-		if (j < 254)
-			delig += let;
-		++j;
-	} while (!endFl);
-	length = j - 1;
-	if (length < 255)
+	if (wrkStr.lastChar() == '$')
 		// Remove trailing '$'
-		delig.deleteLastChar();
-
-	warning("deline: delig %s - line %s", delig.c_str(), line);
-}
-
-Common::String delin2(int num) {
-	char tmpStr[1410];
-	int length;
+		wrkStr.deleteLastChar();
 
-	deline(num, tmpStr, length);
-	
-	Common::String resStr = delig;
-	delig = "";
-	return resStr;
+	return wrkStr;
 }
 
 void afftex(const char *ch, int x, int y, int dx, int dy, int typ);
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 742b832..d2e5f6b 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -32,10 +32,7 @@
 
 namespace Mortevielle {
 
-extern Common::String delig;
-
-extern void deline(int num , char *line , int &length);
-extern Common::String delin2(int num);
+extern Common::String deline(int num);
 extern void afftex(Common::String ch, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle


Commit: 36e0e8ab050f619215af0d43b48df5f93e3ba3ac
    https://github.com/scummvm/scummvm/commit/36e0e8ab050f619215af0d43b48df5f93e3ba3ac
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:08-07:00

Commit Message:
MORTEVIELLE: remove error messages uselessly loaded

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 9c57ed5..10f0194 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -47,7 +47,8 @@ const int ioresult = 0;
 
 void testfi() {
 	if (ioresult != 0) {
-		caff = Alert::show(err_mess, 1);
+		// Theoritical message
+		warning("IO Error");
 		g_vm->quitGame();
 	}
 }
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 01e913d..86360b0 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -77,18 +77,18 @@ void tinke() {
 		else
 			stpo = chr(cf + 48);
 
-		stpou = Common::String(d3);
-		stpou += d5;
-		stpou += d4;
-		stpou += d3;
-		stpou += d1;
-		stpou += stpo;
-		stpou += '0';
-		stpou += d2;
-		stpou += d4;
-		stpou += d3;
-		stpou += d6;
-		stpou += d4;
+		_hintPctMessage = Common::String(d3);
+		_hintPctMessage += d5;
+		_hintPctMessage += d4;
+		_hintPctMessage += d3;
+		_hintPctMessage += d1;
+		_hintPctMessage += stpo;
+		_hintPctMessage += '0';
+		_hintPctMessage += d2;
+		_hintPctMessage += d4;
+		_hintPctMessage += d3;
+		_hintPctMessage += d6;
+		_hintPctMessage += d4;
 	}
 	if (m > _minute) {
 		_minute = 30;
@@ -648,7 +648,7 @@ void tfleche() {
 		} while (!(qust || rect || anyone));
 
 		if (qust && (touch == '\103'))
-			Alert::show(stpou, 1);
+			Alert::show(_hintPctMessage, 1);
 	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) || (anyone) || (rect)));
 
 	if (touch == '\73')
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f2bb1ef..9c4df1c 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,10 +134,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	al_mess  = deline(578);  // Insert floppy #1
-	err_mess = deline(579);  // Floppy error
-	ind_mess = deline(580);  // You should have noticed %d hints
-	al_mess2 = deline(581);  // Insert floppy #2
+	_hintPctMessage = deline(580);  // You should have noticed %d hints
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
@@ -588,7 +585,7 @@ void MortevielleEngine::handleAction() {
 		if (choisi && (msg[3] == MENU_LOAD))
 			g_vm->_savegameManager.loadGame((msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
-			temps = Alert::show(stpou, 1);
+			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SUB_ACTION))) {
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index e2a6cf4..a41b652 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -35,6 +35,7 @@
 #include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
 
 namespace Mortevielle {
 
@@ -112,7 +113,7 @@ void MortevielleEngine::gameLoaded() {
 	iouv = 0;
 	dobj = 0;
 	affrep();
-	stpou = ind_mess;
+	_hintPctMessage = deline(580);
 	while ((test[k] == false) && (k < 2)) {
 		++k;
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index daac977..d3a44c4 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -174,13 +174,9 @@ int x,
 int t_cph[6401];
 byte tabdon[4001];
 
-Common::String stpou;               // Provides the % of hints
+Common::String _hintPctMessage;               // Provides the % of hints
 byte is;
 byte mode;
-Common::String al_mess,
-       err_mess,
-       ind_mess,
-       al_mess2;
 
 int nbrep[9];
 int nbrepm[9];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index af8ef9d..0956b23 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -324,13 +324,9 @@ extern int x,
 extern int t_cph[6401];
 extern byte tabdon[4001];
 
-extern Common::String stpou;                               /* donne le % d'indices */
+extern Common::String _hintPctMessage;      // gives the pct of hints found
 extern byte is;
 extern byte mode;
-extern Common::String al_mess,
-       err_mess,
-       ind_mess,
-       al_mess2;
 
 extern int nbrep[9];
 extern int nbrepm[9];


Commit: 87ccfb46774895c1dcef36e80112021ed9c71cef
    https://github.com/scummvm/scummvm/commit/87ccfb46774895c1dcef36e80112021ed9c71cef
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:09-07:00

Commit Message:
TOOLS: Mortevielle - Add missing heading space for several sentences used in menus, in the English version

Changed paths:
    devtools/create_mortdat/gametext.h



diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index 6905fdf..b9ef039 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -213,68 +213,68 @@ const char *gameDataEn[] =  {
 	"   5/1/51@@              Luc, my love@ Guy knows about us. After an argument I told  him  everything! I at think only of you. Max keeps pes-tering me, but it's finished with @him. He should stick to his pots and pans! When can you and I be  alone together? For you I  would at get a divorce. at I love you.@                             Eva$",
 	"             Mortville, 10/2/51@@              Pat@ I recall you owe me  50000 frs that I lent you for your business at I need that money, can you repay me quickly?@              Guy$",
 	"             Mortville, 15/2/51@           Dear Sir@ I am writing to you on the sub-ject of our business deal. I have at decided to go all the way in the certainty that  my  partner, Pat at DEFRANCK, has been forging the accounts. @In spite of$",
-	"A pipe$",
-	"A pen$",
-	"A lighter$",
-	"A retort$",
-	"A shaving brush$",
-	"A tin of paint$",
-	"A flute$",
-	"An expensive ring$",
-	"A reel of thread$",
-	"An old book$",
-	"A wallet$",
-	"A dagger$",
-	"A pistol$",
-	"A bible$",
-	"A candle$",
-	"A jewellery box$",
-	"An iron$",
-	"A photo$",
-	"A pocket watch$",
-	"A rope$",
-	"Keys$",
-	"A pearl necklace$",
-	"A bottle of perfume$",
-	"Binoculars$",
-	"Glasses$",
-	"A leather purse$",
-	"A tennis ball$",
-	"Ammunition$",
-	"A cut-throat razor$",
-	"A hairbrush$",
-	"A clothes brush$",
-	"A pack of cards$",
-	"A shoe horn$",
-	"A screwdriver$",
-	"A hammer$",
-	"Keys$",
-	"Keys$",
-	"An ashtray$",
-	"A paintbrush$",
-	"A rope$",
-	"A wooden object$",
-	"Sleeping pills$",
-	"A gold ring$",
-	"A jewellery box$",
-	"An alarm clock$",
-	"A coat of armour$",
-	"A candlestick$",
-	"A pair of gloves$",
-	"A engraved goblet$",
-	"A parchment$",
-	"A dagger$",
-	"A dossier$",
-	"A parchment$",
-	"A parchment$",
-	"A dossier$",
-	"A dossier$",
-	"A letter$",
-	"A novel$",
-	"A wooden rod$",
-	"An envelope$",
-	"A letter$",
-	"An envelope$",
+	" A pipe$",
+	" A pen$",
+	" A lighter$",
+	" A retort$",
+	" A shaving brush$",
+	" A tin of paint$",
+	" A flute$",
+	" An expensive ring$",
+	" A reel of thread$",
+	" An old book$",
+	" A wallet$",
+	" A dagger$",
+	" A pistol$",
+	" A bible$",
+	" A candle$",
+	" A jewellery box$",
+	" An iron$",
+	" A photo$",
+	" A pocket watch$",
+	" A rope$",
+	" Keys$",
+	" A pearl necklace$",
+	" A bottle of perfume$",
+	" Binoculars$",
+	" Glasses$",
+	" A leather purse$",
+	" A tennis ball$",
+	" Ammunition$",
+	" A cut-throat razor$",
+	" A hairbrush$",
+	" A clothes brush$",
+	" A pack of cards$",
+	" A shoe horn$",
+	" A screwdriver$",
+	" A hammer$",
+	" Keys$",
+	" Keys$",
+	" An ashtray$",
+	" A paintbrush$",
+	" A rope$",
+	" A wooden object$",
+	" Sleeping pills$",
+	" A gold ring$",
+	" A jewellery box$",
+	" An alarm clock$",
+	" A coat of armour$",
+	" A candlestick$",
+	" A pair of gloves$",
+	" A engraved goblet$",
+	" A parchment$",
+	" A dagger$",
+	" A dossier$",
+	" A parchment$",
+	" A parchment$",
+	" A dossier$",
+	" A dossier$",
+	" A letter$",
+	" A novel$",
+	" A wooden rod$",
+	" An envelope$",
+	" A letter$",
+	" An envelope$",
 	"Julia$",
 	"Julia's death$",
 	"Julia's relationships$",
@@ -463,27 +463,27 @@ const char *gameDataEn[] =  {
 	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
 	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
 	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
-	"to the bureau$",
-	"to the kitchen$",
-	"to the cellar$",
-	"to the landing$",
-	"outside$",
-	"to the dining room$",
-	"inside the manor$",
-	"front of the manor$",
-	"to the chapel$",
-	"to the weel$",
-	"north$",
-	"behind the manor$",
-	"south$",
-	"east$",
-	"west$",
-	"towards the manor$",
-	"further$",
-	"in the water$",
-	"out of the weel$",
-	"in the weel$",
-	"choice on screen$",
+	" to the bureau$",
+	" to the kitchen$",
+	" to the cellar$",
+	" to the landing$",
+	" outside$",
+	" to the dining room$",
+	" inside the manor$",
+	" front of the manor$",
+	" to the chapel$",
+	" to the weel$",
+	" north$",
+	" behind the manor$",
+	" south$",
+	" east$",
+	" west$",
+	" towards the manor$",
+	" further$",
+	" in the water$",
+	" out of the weel$",
+	" in the weel$",
+	" choice on screen$",
 	"In the MYSTERY series...$",
 	"MORTVILLE MANOR$",
 	"$",
@@ -504,40 +504,40 @@ const char *gameDataEn[] =  {
 	"COPYRIGHT 1987: KYILKHOR and B&JL LANGLOIS$",
 	"$",
 	"YOUR MOVE$",
-	"attach$",
-	"wait$",
-	"force$",
-	"sleep$",
-	"listen$",
-	"enter$",
-	"close$",
-	"search$",
-	"knock$",
-	"scratch$",
-	"read$",
-	"eat$",
-	"place$",
-	"open$",
-	"take$",
-	"look$",
-	"smell$",
-	"sound$",
-	"leave$",
-	"lift$",
-	"turn$",
-	"hide yourself$",
-	"search$",
-	"read$",
-	"put$",
-	"look$",
-	"Leo$",
-	"Pat$",
-	"Guy$",
-	"Eva$",
-	"Bob$",
-	"Luc$",
-	"Ida$",
-	"Max$",
+	" attach$",
+	" wait$",
+	" force$",
+	" sleep$",
+	" listen$",
+	" enter$",
+	" close$",
+	" search$",
+	" knock$",
+	" scratch$",
+	" read$",
+	" eat$",
+	" place$",
+	" open$",
+	" take$",
+	" look$",
+	" smell$",
+	" sound$",
+	" leave$",
+	" lift$",
+	" turn$",
+	" hide yourself$",
+	" search$",
+	" read$",
+	" put$",
+	" look$",
+	" Leo$",
+	" Pat$",
+	" Guy$",
+	" Eva$",
+	" Bob$",
+	" Luc$",
+	" Ida$",
+	" Max$",
 	"JULIA...$",
 	"- Did she commit suicide?$",
 	"- Was she murdered?$",
@@ -592,7 +592,7 @@ const char *gameDataEn[] =  {
 	"- 11$",
 	"What was the first name at of the unknown character?$",
 	"- Mireille$",
-	"- Françoise$",
+	"- Fran‡oise$",
 	"- Maguy$",
 	"- Emilie$",
 	"- Murielle$",
@@ -802,68 +802,68 @@ const char *gameDataFr[] = {
 	"  Le 5/01/51@@              Luc, mon amour@ Guy connaŒt notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'… toi !  Max me relance mais j'ai d‚finitivement rompu avec lui . Qu'il reste … ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
 	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr‚t‚s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
 	"  Mortevielle, le 15/2/51@              MaŒtre,@ Je vous ‚cris au sujet de notre affaire.  Je suis d‚cid‚  … aller jusqu'au bout, certain que mon associ‚, Pat DEFRANCK, a falsifi‚  un livre de comptes . Malgr‚$",
-	"Une pipe$",
-	"Un stylo … plume$",
-	"Un briquet … essence$",
-	"Une cornue$",
-	"Un blaireau$",
-	"Un pot de peinture$",
-	"Une flute$",
-	"Une bague de valeur$",
-	"Une bobine de fil$",
-	"Un vieux bouquin$",
-	"Un porte-monnaie$",
-	"Un poignard$",
-	"Un r‚volver$",
-	"Une bible$",
-	"Une bougie$",
-	"Un coffret … bijoux$",
-	"Un fer … repasser$",
-	"Une photo$",
-	"Une montre … gousset$",
-	"Une corde$",
-	"Des clefs$",
-	"Un collier de perles$",
-	"Un flacon de parfum$",
-	"Des jumelles$",
-	"Des lunettes$",
-	"Une bourse en cuir$",
-	"Une balle de tennis$",
-	"Des munitions$",
-	"Un rasoir … main$",
-	"Une brosse … cheveux$",
-	"Une brosse … linge$",
-	"Un jeu de cartes$",
-	"Un chausse pied$",
-	"Un tournevis$",
-	"Un marteau$",
-	"Des clefs$",
-	"Des clefs$",
-	"Un cendrier$",
-	"Un pinceau$",
-	"Une corde$",
-	"Un objet en bois$",
-	"Des somnifŠres$",
-	"Une bague en or$",
-	"Un coffret … bijoux$",
-	"Un r‚veil matin$",
-	"Une cotte de mailles$",
-	"Un chandellier$",
-	"Une paire de gants$",
-	"Une coupe cisel‚e$",
-	"Un parchemin$",
-	"Un poignard$",
-	"Un dossier$",
-	"Un parchemin$",
-	"Un parchemin$",
-	"Un dossier$",
-	"Un dossier$",
-	"Une lettre$",
-	"Un roman$",
-	"Une baguette en bois$",
-	"Une enveloppe$",
-	"Une lettre$",
-	"Une enveloppe$",
+	" Une pipe$",
+	" Un stylo … plume$",
+	" Un briquet … essence$",
+	" Une cornue$",
+	" Un blaireau$",
+	" Un pot de peinture$",
+	" Une flute$",
+	" Une bague de valeur$",
+	" Une bobine de fil$",
+	" Un vieux bouquin$",
+	" Un porte-monnaie$",
+	" Un poignard$",
+	" Un r‚volver$",
+	" Une bible$",
+	" Une bougie$",
+	" Un coffret … bijoux$",
+	" Un fer … repasser$",
+	" Une photo$",
+	" Une montre … gousset$",
+	" Une corde$",
+	" Des clefs$",
+	" Un collier de perles$",
+	" Un flacon de parfum$",
+	" Des jumelles$",
+	" Des lunettes$",
+	" Une bourse en cuir$",
+	" Une balle de tennis$",
+	" Des munitions$",
+	" Un rasoir … main$",
+	" Une brosse … cheveux$",
+	" Une brosse … linge$",
+	" Un jeu de cartes$",
+	" Un chausse pied$",
+	" Un tournevis$",
+	" Un marteau$",
+	" Des clefs$",
+	" Des clefs$",
+	" Un cendrier$",
+	" Un pinceau$",
+	" Une corde$",
+	" Un objet en bois$",
+	" Des somnifŠres$",
+	" Une bague en or$",
+	" Un coffret … bijoux$",
+	" Un r‚veil matin$",
+	" Une cotte de mailles$",
+	" Un chandellier$",
+	" Une paire de gants$",
+	" Une coupe cisel‚e$",
+	" Un parchemin$",
+	" Un poignard$",
+	" Un dossier$",
+	" Un parchemin$",
+	" Un parchemin$",
+	" Un dossier$",
+	" Un dossier$",
+	" Une lettre$",
+	" Un roman$",
+	" Une baguette en bois$",
+	" Une enveloppe$",
+	" Une lettre$",
+	" Une enveloppe$",
 	"Julia$",
 	"La mort de Julia$",
 	"Les relations de Julia$",


Commit: bb5175c156a795eb537dfc567ef8908b3de6367e
    https://github.com/scummvm/scummvm/commit/bb5175c156a795eb537dfc567ef8908b3de6367e
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:11-07:00

Commit Message:
MORTEVIELLE: Rename menu entry type erroneously named

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index fe5581d..3edaaaa 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -68,7 +68,7 @@ void Menu::menut(int no, Common::String name) {
 	case MENU_ACTION:
 		_actionStringArray[l] = s;
 		break;
-	case MENU_SUB_ACTION:
+	case MENU_SELF:
 		_selfStringArray[l] = s;
 		break;
 	case MENU_DISCUSS:
@@ -101,7 +101,7 @@ void Menu::disableMenuItem(int no) {
 	case MENU_ACTION:
 		_actionStringArray[l].setChar('*', 0);
 		break;
-	case MENU_SUB_ACTION:
+	case MENU_SELF:
 		_selfStringArray[l].setChar('*', 0);
 		break;
 	case MENU_DISCUSS:
@@ -132,7 +132,7 @@ void Menu::enableMenuItem(int no) {
 	case MENU_ACTION:
 		_actionStringArray[l].setChar(' ', 0);
 		break;
-	case MENU_SUB_ACTION:
+	case MENU_SELF:
 		_selfStringArray[l].setChar(' ', 0);
 		// The original sets two times the same value. Skipped
 		// _selfStringArray[l].setChar(' ', 0);
@@ -422,7 +422,7 @@ void Menu::mdn() {
 			else if (x < 172 * res)
 				ix = MENU_ACTION;
 			else if (x < 220 * res)
-				ix = MENU_SUB_ACTION;
+				ix = MENU_SELF;
 			else if (x < 268 * res)
 				ix = MENU_DISCUSS;
 			else
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 67fc8bb..f6e3ea5 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -60,7 +60,7 @@ public:
 };
 
 enum {
-	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SUB_ACTION = 4,
+	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SELF = 4,
 	MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,   MENU_LOAD = 8
 };
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 9c4df1c..c9ea556 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -588,7 +588,7 @@ void MortevielleEngine::handleAction() {
 			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SUB_ACTION))) {
+			if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF))) {
 				msg[4] = mnumo;
 				ecr3(g_vm->getEngineString(S_IDEM));
 			} else
@@ -611,7 +611,7 @@ void MortevielleEngine::handleAction() {
 				num = 0;
 		} else {
 			mnumo = msg[3];
-			if ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SUB_ACTION))
+			if ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF))
 				mnumo = msg[4];
 			if (! anyone) {
 				if ((fouil) || (obpart)) {


Commit: bdd4f4897b193c40658b4e684f9336542a452991
    https://github.com/scummvm/scummvm/commit/bdd4f4897b193c40658b4e684f9336542a452991
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:12-07:00

Commit Message:
MORTEVIELLE: Use 0-based array instead of 1-based for menu constants, some renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index d9a1022..80a460e 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -686,7 +686,7 @@ void fctPlace() {
 						else 
 							person();
 
-						g_vm->_menu.menu_aff();
+						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
 							s.mlieu = 17;
 							tmlieu(17);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 3edaaaa..6bbfa62 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -145,7 +145,7 @@ void Menu::enableMenuItem(int no) {
 	}
 }
 
-void Menu::menu_aff() {
+void Menu::displayMenu() {
 	int ind_tabl, k, col;
 
 	int pt, x, y, color, msk, num_letr;
@@ -191,7 +191,7 @@ void Menu::menu_aff() {
  * Show the menu
  */
 void Menu::drawMenu() {
-	menu_aff();
+	displayMenu();
 	_menuActive = true;
 	msg4 = OPCODE_NONE;
 	msg3 = OPCODE_NONE;
@@ -206,38 +206,40 @@ void Menu::invers(int ix) {
 	if (msg4 == OPCODE_NONE)
 		return;
 
-	g_vm->_screenSurface.putxy(don[msg3][1] << 3, (lo(msg4) + 1) << 3);
+	int menuIndex = lo(msg4);
+
+	g_vm->_screenSurface.putxy(_menuConstants[msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 	switch (msg3) {
 	case 1:
-		s = _inventoryStringArray[lo(msg4)];
+		s = _inventoryStringArray[menuIndex];
 		break;
 	case 2:
-		s = _moveStringArray[lo(msg4)];
+		s = _moveStringArray[menuIndex];
 		break;
 	case 3:
-		s = _actionStringArray[lo(msg4)];
+		s = _actionStringArray[menuIndex];
 		break;
 	case 4:
-		s = _selfStringArray[lo(msg4)];
+		s = _selfStringArray[menuIndex];
 		break;
 	case 5:
-		s = _discussStringArray[lo(msg4)];
+		s = _discussStringArray[menuIndex];
 		break;
 	case 6:
-		s = g_vm->getEngineString(S_SAVE_LOAD + lo(msg4));
+		s = g_vm->getEngineString(S_SAVE_LOAD + menuIndex);
 		break;
 	case 7:
 		s = g_vm->getEngineString(S_SAVE_LOAD + 1);
 		s += ' ';
-		s += (char)(48 + lo(msg4));
+		s += (char)(48 + menuIndex);
 		break;
 	case 8:
-		if (lo(msg4) == 1) {
+		if (menuIndex == 1) {
 			s = g_vm->getEngineString(S_RESTART);
 		} else {
 			s = g_vm->getEngineString(S_SAVE_LOAD + 2);
 			s += ' ';
-			s += (char)(47 + lo(msg4));
+			s += (char)(47 + menuIndex);
 		}
 		break;
 	default:
@@ -251,9 +253,9 @@ void Menu::invers(int ix) {
 
 void Menu::util(int x, int y) {
 
-	int ymx = (don[msg3][4] << 3) + 16;
-	int dxcar = don[msg3][3];
-	int xmn = (don[msg3][1] << 2) * res;
+	int ymx = (_menuConstants[msg3 - 1][3] << 3) + 16;
+	int dxcar = _menuConstants[msg3 - 1][2];
+	int xmn = (_menuConstants[msg3 - 1][0] << 2) * res;
 
 	int ix;
 	if (res == 1)
@@ -287,19 +289,19 @@ void Menu::menuDown(int ii) {
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
 	// Draw the menu
-	xco = don[ii][1];
-	nb_lig = don[ii][4];
+	xco = _menuConstants[ii - 1][0];
+	nb_lig = _menuConstants[ii - 1][3];
 	hideMouse();
-	sauvecr(10, (don[ii][2] + 1) << 1);
+	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (res == 1)
 		cx = 10;
 	else
 		cx = 6;
-	xcc = xco + (don[ii][3] * cx) + 6;
-	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (don[ii][2] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (don[ii][2] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (don[ii][2] << 1), xcc + 4, 12 + (don[ii][2] << 1)));
+	xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
+	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
@@ -360,7 +362,7 @@ void Menu::menuDown(int ii) {
 void Menu::menuUp(int xx) {
 	/* debug('menuUp'); */
 	if (test0) {
-		charecr(10, (don[xx][2] + 1) << 1);
+		charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index f6e3ea5..923c5aa 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -51,7 +51,7 @@ public:
 	void menut(int no, Common::String name);
 	void disableMenuItem(int no);
 	void enableMenuItem(int no);
-	void menu_aff();
+	void displayMenu();
 	void drawMenu();
 	void menuUp(int xx);
 	void eraseMenu();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index a41b652..cd7bb2a 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -61,7 +61,7 @@ void changeGraphicalDevice(int newDevice) {
 	_maff = 68;
 	afdes(0);
 	repon(2, crep);
-	g_vm->_menu.menu_aff();
+	g_vm->_menu.displayMenu();
 }
 
 /**
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index d3a44c4..ef9dbcf 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -59,16 +59,15 @@ const byte tnocon[364] = {
 };
 
 
-const byte don[9][5] = {
-	{ 0,  0,  0,  0, 0},
-	{ 0,  7, 37, 22,  8},
-	{0,  19, 33, 23,  7},
-	{0,  31, 89, 10, 21},
-	{0,  43, 25, 11,  5},
-	{0,  55, 37,  5,  8},
-	{0,  64, 13, 11,  2},
-	{0,  62, 22, 13,  4},
-	{0,  62, 25, 13,  5}
+const byte _menuConstants[8][4] = {
+	{ 7, 37, 22,  8},
+	{19, 33, 23,  7},
+	{31, 89, 10, 21},
+	{43, 25, 11,  5},
+	{55, 37,  5,  8},
+	{64, 13, 11,  2},
+	{62, 22, 13,  4},
+	{62, 25, 13,  5}
 };
 
 const byte addv[2] = {8, 8};
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 0956b23..d6024ec 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -149,7 +149,7 @@ extern const byte typcon[26];
 extern const byte intcon[26];
 extern const byte tnocon[364];
 
-extern const byte don[9][5];
+extern const byte _menuConstants[8][4];
 
 extern const byte addv[2];
 


Commit: 5df9ccde632a019c6b355a65bf51dcc2020eb8bb
    https://github.com/scummvm/scummvm/commit/5df9ccde632a019c6b355a65bf51dcc2020eb8bb
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:13-07:00

Commit Message:
MORTEVIELLE: Rename remaining opcodes, remove a couple of GOTOs

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/actions.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 80a460e..63f432b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -288,8 +288,11 @@ void fctTake() {
 			crep = 120;
 	}
 }
-
-void tsprendre() {
+/**
+ * Engine function - Inventory / Take
+ * @remarks	Originally called 'tsprendre'
+ */
+void fctInventoryTake() {
 	int cx, cy, cz;
 
 	cx = 0;
@@ -366,7 +369,11 @@ void fctRead() {
 	}
 }
 
-void tslire() {
+/**
+ * Engine function - Self / Read
+ * @remarks	Originally called 'tslire'
+ */
+void fctSelfRead() {
 	if (s.derobj == 0)
 		crep = 186;
 	else
@@ -451,7 +458,11 @@ void fctLook() {
 		treg(31);
 }
 
-void tsregarder() {
+/**
+ * Engine function - Self / Look
+ * @remarks	Originally called 'tsregarder'
+ */
+void fctSelftLook() {
 	if (s.derobj != 0)
 		treg(s.derobj);
 	else
@@ -544,7 +555,11 @@ void fctSearch() {
 	}
 }
 
-void tsfouiller() {
+/**
+ * Engine function - Self / Search
+ * @remarks	Originally called 'tsfouiller'
+ */
+void fctSelfSearch() {
 	if (s.derobj != 0)
 		st7(s.derobj);
 	else
@@ -782,7 +797,7 @@ void fctTurn() {
  * Engine function - Hide Self
  * @remarks	Originally called 'tcacher'
  */
-void fctHideSelf() {
+void fctSelfHide() {
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
@@ -906,10 +921,10 @@ void fctKnock() {
 }
 
 /**
- * Engine function - Put
+ * Engine function - Self / Put
  * @remarks	Originally called 'tposer'
  */
-void fctPut() {
+void fctSelfPut() {
 	int cx, chai;
 
 	if (!syn)
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
index e73dc08..74d4e5c 100644
--- a/engines/mortevielle/actions.h
+++ b/engines/mortevielle/actions.h
@@ -33,22 +33,22 @@ namespace Mortevielle {
 /* NIVEAU 4 */
 extern void fctMove();
 extern void fctTake();
-extern void tsprendre();
+extern void fctInventoryTake();
 extern void fctLift();
 extern void fctRead();
-extern void tslire();
+extern void fctSelfRead();
 extern void fctLook();
-extern void tsregarder();
+extern void fctSelftLook();
 extern void fctSearch();
-extern void tsfouiller();
+extern void fctSelfSearch();
 extern void fctOpen();
 extern void fctPlace();
 extern void fctTurn();
-extern void fctHideSelf();
+extern void fctSelfHide();
 extern void fctAttach();
 extern void fctClose();
 extern void fctKnock();
-extern void fctPut();
+extern void fctSelfPut();
 extern void fctListen();
 extern void fctEat();
 extern void fctEnter();
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 86360b0..33016fa 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -737,7 +737,7 @@ void treg(int ob) {
 
 	mdes = caff;
 	caff = ob;
-	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == sregarder)) {
+	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == OPCODE_SLOOK)) {
 		afdes(0);
 		if ((caff > 29) && (caff < 33))
 			repon(2, caff);
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 2df20b7..8dc0e1a 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -33,9 +33,9 @@
 namespace Mortevielle {
 
 static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_HIDE_SELF, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER,     OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE,     OPCODE_OPEN,   OPCODE_LEAVE
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
 extern void tinke();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index cd7bb2a..4953f86 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -163,81 +163,80 @@ void tsitu() {
 		clsf2();
 	syn = false;
 	iesc = false;
-	if (anyone)
-		goto L1;
-	if (brt)
-		if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
-			ctrm = 4;
+	if (!anyone) {
+		if (brt)
+			if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
+				ctrm = 4;
+				mennor();
+				return;
+			}
+		if (msg[3] == MENU_MOVE)
+			fctMove();
+		if (msg[3] == MENU_DISCUSS)
+			fctDiscuss();
+		if (msg[3] == MENU_INVENTORY)
+			fctInventoryTake();
+		if (msg[4] == OPCODE_ATTACH)
+			fctAttach();
+		if (msg[4] == OPCODE_WAIT)
+			fctWait();
+		if (msg[4] == OPCODE_FORCE)
+			fctForce();
+		if (msg[4] == OPCODE_SLEEP)
+			fctSleep();
+		if (msg[4] == OPCODE_LISTEN)
+			fctListen();
+		if (msg[4] == OPCODE_ENTER)
+			fctEnter();
+		if (msg[4] == OPCODE_CLOSE)
+			fctClose();
+		if (msg[4] == OPCODE_SEARCH)
+			fctSearch();
+		if (msg[4] == OPCODE_KNOCK)
+			fctKnock();
+		if (msg[4] == OPCODE_SCRATCH)
+			fctScratch();
+		if (msg[4] == OPCODE_READ)
+			fctRead();
+		if (msg[4] == OPCODE_EAT)
+			fctEat();
+		if (msg[4] == OPCODE_PLACE)
+			fctPlace();
+		if (msg[4] == OPCODE_OPEN)
+			fctOpen();
+		if (msg[4] == OPCODE_TAKE)
+			fctTake();
+		if (msg[4] == OPCODE_LOOK)
+			fctLook();
+		if (msg[4] == OPCODE_SMELL)
+			fctSmell();
+		if (msg[4] == OPCODE_SOUND)
+			fctSound();
+		if (msg[4] == OPCODE_LEAVE)
+			fctLeave();
+		if (msg[4] == OPCODE_LIFT)
+			fctLift();
+		if (msg[4] == OPCODE_TURN)
+			fctTurn();
+		if (msg[4] == OPCODE_SSEARCH)
+			fctSelfSearch();
+		if (msg[4] == OPCODE_SREAD)
+			fctSelfRead();
+		if (msg[4] == OPCODE_SPUT)
+			fctSelfPut();
+		if (msg[4] == OPCODE_SLOOK)
+			fctSelftLook();
+		cache = false;
+
+		if (msg[4] == OPCODE_SHIDE)
+			fctSelfHide();
+	} else {
+		if (anyone) {
+			quelquun();
+			anyone = false;
 			mennor();
 			return;
 		}
-	if (msg[3] == MENU_MOVE)
-		fctMove();
-	if (msg[3] == MENU_DISCUSS)
-		fctDiscuss();
-	if (msg[3] == MENU_INVENTORY)
-		tsprendre(); //Translation: inventory/take
-	if (msg[4] == OPCODE_ATTACH)
-		fctAttach();
-	if (msg[4] == OPCODE_WAIT)
-		fctWait();
-	if (msg[4] == OPCODE_FORCE)
-		fctForce();
-	if (msg[4] == OPCODE_SLEEP)
-		fctSleep();
-	if (msg[4] == OPCODE_LISTEN)
-		fctListen();
-	if (msg[4] == OPCODE_ENTER)
-		fctEnter();
-	if (msg[4] == OPCODE_CLOSE)
-		fctClose();
-	if (msg[4] == OPCODE_SEARCH)
-		fctSearch();
-	if (msg[4] == OPCODE_KNOCK)
-		fctKnock();
-	if (msg[4] == OPCODE_SCRATCH)
-		fctScratch();
-	if (msg[4] == OPCODE_READ)
-		fctRead();
-	if (msg[4] == OPCODE_EAT)
-		fctEat();
-	if (msg[4] == OPCODE_PLACE)
-		fctPlace();
-	if (msg[4] == OPCODE_OPEN)
-		fctOpen();
-	if (msg[4] == OPCODE_TAKE)
-		fctTake();
-	if (msg[4] == OPCODE_LOOK)
-		fctLook();
-	if (msg[4] == OPCODE_SMELL)
-		fctSmell();
-	if (msg[4] == OPCODE_SOUND)
-		fctSound();
-	if (msg[4] == OPCODE_LEAVE)
-		fctLeave();
-	if (msg[4] == OPCODE_LIFT)
-		fctLift();
-	if (msg[4] == OPCODE_TURN)
-		fctTurn();
-	if (msg[4] == OPCODE_HIDE_SELF) {
-		fctHideSelf();
-		goto L1;
-	}
-	if (msg[4] == sfouiller)
-		tsfouiller();//Translation: search 
-	if (msg[4] == slire)
-		tslire();    //Translation: read
-	if (msg[4] == OPCODE_PUT)
-		fctPut();
-	if (msg[4] == sregarder)
-		tsregarder();//Translation: look
-	cache = false;
-L1:
-	if (anyone) {
-		quelquun();
-		anyone = false;
-		mennor();
-		return;
 	}
 	calch(j, h, m);
 	if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) ||
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index d6024ec..d9a11f5 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -129,17 +129,12 @@ const int fleche = 1758;
 
 const int OPCODE_NONE = 0;
 
-enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,  OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
-            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308, OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
-			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,  OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
-			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,  OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
-			OPCODE_TURN = 0x315};
-
-enum verbs2 {OPCODE_HIDE_SELF = 0x401, OPCODE_PUT = 0x404};
-
-const int sfouiller = 0x402;
-const int slire = 0x403;
-const int sregarder = 0x405;
+enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
+            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
+			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
+			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
+			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
+			OPCODE_SLOOK = 0x405};
 
 const int max_patt = 20;
 


Commit: 97de41b56e42b31debc873ef4ddeab2c581437ba
    https://github.com/scummvm/scummvm/commit/97de41b56e42b31debc873ef4ddeab2c581437ba
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:15-07:00

Commit Message:
MORTEVIELLE: Fix bug, this is a "in [1, 2]" in the original code

Changed paths:
    engines/mortevielle/keyboard.cpp



diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 0306e71..0cf22b3 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -45,7 +45,7 @@ int testou() {
 		_soundOff = !_soundOff;
 		break;
 	case '\26' :
-		if ((c_zzz == 1) && (c_zzz == 2)) {
+		if ((c_zzz == 1) || (c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			++c_zzz;
 


Commit: 9751829d27abe79b40bf25fb3b786c6798d0389f
    https://github.com/scummvm/scummvm/commit/9751829d27abe79b40bf25fb3b786c6798d0389f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:16-07:00

Commit Message:
MORTEVIELLE: Double check all "in []" statements, fix a couple of errors

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/parole.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 10f0194..97b116f 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -371,7 +371,7 @@ void repon(int f, int m) {
 				}
 			}
 		}
-		if ((f >= 6) && (f <= 9)) {
+		if ((f == 6) || (f == 9)) {
 			if (f == 6)
 				i = 4;
 			else
@@ -615,6 +615,10 @@ void chlm(int &per) {
 	if (per == 2)  per = 128;
 }
 
+/**
+ * Engine function - Draw Clock
+ * @remarks	Originally called 'pendule'
+ */
 void drawClock() {
 	const int cv[3][13] = {
 		{ 0,  0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0 },
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index e86b647..791bfd7 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -36,7 +36,7 @@ void spfrac(int wor) {
 	c3.rep = (uint)wor >> 12;
 	if ((typlec == 0) && (c3.code != 9))
 		if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
-				((c3.code < 5) && ((c3.rep != 19) && (c3.rep != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
+				((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
 			++c3.rep;
 		}
 


Commit: be68aada86c5b7f8646ce9972060f072568e8769
    https://github.com/scummvm/scummvm/commit/be68aada86c5b7f8646ce9972060f072568e8769
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:17-07:00

Commit Message:
MORTEVIELLE: silent several warning reported by cppCheck

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 63f432b..b2a23f5 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -179,10 +179,8 @@ L2:
  * @remarks	Originally called 'tprendre'
  */
 void fctTake() {
-	int cx;
-
 	if (caff > 99) {
-		cx = caff;
+		int cx = caff;
 		avpoing(cx);
 		if (crep != 139) {
 			if (ipers > 0)
@@ -475,27 +473,30 @@ void fctSelftLook() {
  */
 void fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
-	int cx;
 
 	if (caff > 99) {
 		st7(caff);
 		return;
 	}
+
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_SEARCH));
+
 	tfleche();
 	if (anyone || iesc)
 		return;
+
 	if (s.mlieu == 23) {
 		crep = 1504;
 		tperd();
 		return;
 	}
+
 	tcoord(6);
 	if (num == 0) {
 		tcoord(7);
 		if (num != 0) {
-			cx = 0;
+			int cx = 0;
 			do {
 				++cx;
 			} while ((cx <= 6) && (num != ord(touv[cx])));
@@ -504,6 +505,7 @@ void fctSearch() {
 			else {
 				if (ipers > 0)
 					s.conf += 3;
+
 				rechai(mchai);
 				if (mchai != 0) {
 					cs = 0;
@@ -540,14 +542,17 @@ void fctSearch() {
 		crep = 997;
 		if (s.mlieu < 14)
 			crep = r[s.mlieu];
+
 		if ((s.mlieu == 3) && (num == 2))
 			crep = 162;
+
 		if (s.mlieu == 12) {
 			if ((num == 3) || (num == 4))
 				crep = 162;
 			else if (num == 5)
 				crep = 159;
 		}
+
 		if (s.mlieu == 19)
 			crep = 104;
 		else if (s.mlieu == 16)
@@ -571,10 +576,9 @@ void fctSelfSearch() {
  * @remarks	Originally called 'touvrir'
  */
 void fctOpen() {
-	int cx, haz;
-
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_OPEN));
+
 	if (caff == 26) {
 		if (ment != 0) {
 			msg[4] = OPCODE_ENTER;
@@ -583,19 +587,22 @@ void fctOpen() {
 			crep = 997;
 		return;
 	}
+
 	if (caff == 15) {
 		aldepl();
 		return;
 	}
+
 	tfleche();
 	if ((anyone) || (iesc))
 		return;
+
 	tcoord(7);
 	if (num != 0) {
 		if (ipers > 0)
 			s.conf += 2;
 		++iouv;
-		cx = 0;
+		int cx = 0;
 		do {
 			++cx;
 		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
@@ -609,8 +616,7 @@ void fctOpen() {
 				if ( ((s.mlieu > 10) && (s.mlieu < 14))
 				  || ((s.mlieu > 6) && (s.mlieu < 10))
 				  || (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
-					haz = hazard(1, 4);
-					if (haz == 3)
+					if (hazard(1, 4) == 3)
 						parole(7, 9, 1);
 				}
 				touv[cx] = chr(num);
@@ -632,10 +638,6 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	bool enterPassageFl;
-	Common::String str_;
-	int i;
-
 	if (s.derobj == 0) {
 		crep = 186;
 		return;
@@ -684,10 +686,10 @@ void fctPlace() {
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 					if (answer== 1)  {
 						Common::String alertTxt = deline(582);
-						i = Alert::show(alertTxt, 1);
+						Alert::show(alertTxt, 1);
 
 						tesok = false;
-						enterPassageFl = Ques::show();
+						bool enterPassageFl = Ques::show();
 						hideMouse();
 						hirs();
 						dessine_rouleau();
@@ -712,7 +714,7 @@ void fctPlace() {
 							aniof(1, 2);
 							aniof(1, 1);
 							alertTxt = deline(577);
-							i = Alert::show(alertTxt, 1);
+							Alert::show(alertTxt, 1);
 							aniof(2, 1);
 							crep = 166;
 						}
@@ -844,10 +846,9 @@ void fctAttach() {
  * @remarks	Originally called 'tfermer'
  */
 void fctClose() {
-	int cx, chai;
-
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_CLOSE));
+
 	if (caff < 26) {
 		tfleche();
 		if (iesc)
@@ -856,7 +857,7 @@ void fctClose() {
 			return;
 		tcoord(7);
 		if (num != 0) {
-			cx = 0;
+			int cx = 0;
 			do {
 				++cx;
 			} while ((cx <= 6) && (num != ord(touv[cx])));
@@ -867,7 +868,7 @@ void fctClose() {
 				iouv = iouv - 1;
 				if (iouv < 0)
 					iouv = 0;
-				chai = 9999;
+				int chai = 9999;
 				rechai(chai);
 				if (mchai == chai)
 					mchai = 0;
@@ -883,14 +884,14 @@ void fctClose() {
  * @remarks	Originally called 'tfrapper'
  */
 void fctKnock() {
-	int l, p, haz;
-
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_HIT));
+
 	if (s.mlieu == 15) {
-		l = Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
+		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
+
 	if (s.mlieu < 25) {
 		tfleche();
 		if (!(anyone) && !(iesc))
@@ -900,12 +901,14 @@ void fctKnock() {
 				crep = 997;
 		return;
 	}
+
 	if (s.mlieu == 26) {
-		haz = (hazard(0, 8)) - 4;
+		int haz = (hazard(0, 8)) - 4;
 		parole(11, haz, 1);
+		int p;
 		ecfren(p, haz, s.conf, ment);
-		l = ment;
-		if (l != 0)
+		int l = ment;
+		if (l != 0) {
 			if (p != -500) {
 				if (haz > p)
 					crep = 190;
@@ -915,6 +918,8 @@ void fctKnock() {
 				}
 			} else
 				frap();
+		}
+
 		if (ment == 8)
 			crep = 190;
 	}
@@ -925,8 +930,6 @@ void fctKnock() {
  * @remarks	Originally called 'tposer'
  */
 void fctSelfPut() {
-	int cx, chai;
-
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_POSE));
 	if (s.derobj == 0)
@@ -945,11 +948,12 @@ void fctSelfPut() {
 		tcoord(7);
 		crep = 124;
 		if (num != 0) {
+			int chai;
 			rechai(chai);
 			if (chai == 0)
 				crep = 997;
 			else {
-				cx = 0;
+				int cx = 0;
 				do {
 					++cx;
 				} while ((cx <= 6) && (num != ord(touv[cx])));
@@ -1014,21 +1018,21 @@ void fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void fctListen() {
-	int l, p, haz, j, h, m;
-
 	if (s.mlieu != 26)
 		crep = 101;
 	else {
 		if (ipers != 0)
 			++s.conf;
+		int p, haz;
 		ecfren(p, haz, s.conf, ment);
-		l = ment;
+		int l = ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (haz > p)
 					crep = 101;
 				else {
 					becfren(l);
+					int j, h, m;
 					calch(j, h, m);
 					haz = hazard(1, 100);
 					if ((h >= 0) && (h < 8)) {
@@ -1052,8 +1056,6 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	int j, h, m;
-
 	if ((s.mlieu > 15) && (s.mlieu < 26))
 		crep = 148;
 	else {
@@ -1062,6 +1064,8 @@ void fctEat() {
 		caff = 10;
 		debloc(s.mlieu);
 		tmlieu(s.mlieu);
+
+		int j, h, m;
 		calch(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
 			s.conf = s.conf - (s.conf / 7);
@@ -1088,7 +1092,7 @@ void fctEat() {
  * @remarks	Originally called 'tentrer'
  */
 void fctEnter() {
-	int x, z = 0;
+//	int x;
 
 	if ((s.mlieu == 21) || (s.mlieu == 22)) {
 		t1sama();
@@ -1101,21 +1105,22 @@ void fctEnter() {
 			crep = 189;
 			s.teauto[8] = '*';
 	} else {
+		int z = 0;
 		if (! blo)
 			t11(ment, z);
 		if (z != 0) {
 			if ((ment == 3) || (ment == 7))
 				crep = 179;
 			else {
-				x = (hazard(0, 10)) - 5;
-				parole(7, x, 1);
+				g_x = (hazard(0, 10)) - 5;
+				parole(7, g_x, 1);
 				aniof(1, 1);
 				
-				tip(z, x);
+				tip(z, g_x);
 				++s.conf;
 				s.mlieu = 15;
 				msg[3] = MENU_DISCUSS;
-				msg[4] = g_vm->_menu._discussMenu[x];
+				msg[4] = g_vm->_menu._discussMenu[g_x];
 				syn = true;
 				if (ment == 9) {
 					col = true;
@@ -1128,8 +1133,8 @@ void fctEnter() {
 				ment = 0;
 			}
 		} else {
-			x = (hazard(0, 10)) - 5;
-			parole(7, x, 1);
+			g_x = (hazard(0, 10)) - 5;
+			parole(7, g_x, 1);
 			aniof(1, 1);
 			
 			s.mlieu = ment;
@@ -1213,13 +1218,13 @@ void fctForce() {
  * @remarks	Originally called 'tsortir'
  */
 void fctLeave() {
-	int lx = 0;
-
 	tsort();
 	crep = 0;
 	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22) || (s.mlieu == 24))
 		crep = 997;
 	else {
+		int lx = 0;
+
 		if ((s.mlieu < 16) || (s.mlieu == 26))
 			lx = 10;
 		if ((s.mlieu == 10) || (s.mlieu == 20))
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 6bbfa62..6ff9716 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -393,14 +393,11 @@ void Menu::eraseMenu() {
  * Handle updates to the menu
  */
 void Menu::mdn() {
-	int x, y, ix;
-	bool tes;
-
 	if (!_menuActive)
 		return;
 
-	x = x_s;
-	y = y_s;
+	int x = x_s;
+	int y = y_s;
 	if (!g_vm->getMouseClick()) {
 		if ((x == xprec) && (y == yprec))
 			return;
@@ -409,7 +406,7 @@ void Menu::mdn() {
 			yprec = y;
 		}
 		
-		tes =  (y < 11) 
+		bool tes =  (y < 11) 
 		   && ((x >= (28 * res) && x <= (28 * res + 24)) 
 		   ||  (x >= (76 * res) && x <= (76 * res + 24))
 		   || ((x > 124 * res) && (x < 124 * res + 24))
@@ -417,6 +414,8 @@ void Menu::mdn() {
 		   || ((x > 220 * res) && (x < 220 * res + 24))
 		   || ((x > 268 * res) && (x < 268 * res + 24)));
 		if (tes) {
+			int ix;
+
 			if (x < 76 * res)
 				ix = MENU_INVENTORY;
 			else if (x < 124 * res)
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 97b116f..12df21e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -674,7 +674,7 @@ void drawClock() {
 
 void debloc(int l) {
 	num = 0;
-	x = 0;
+	g_x = 0;
 	y = 0;
 	if ((l != 26) && (l != 15))
 		t5(l);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 33016fa..2a80cec 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -649,45 +649,49 @@ void tfleche() {
 
 		if (qust && (touch == '\103'))
 			Alert::show(_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (x != 0) && (y != 0)) || (anyone) || (rect)));
+	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (y != 0)) || (anyone) || (rect)));
 
 	if (touch == '\73')
 		iesc = true;
 
 	if (rect) {
-		x = x_s;
+		g_x = x_s;
 		y = y_s;
 	}
 }
 
 void tcoord(int sx) {
-	int sy, ix, iy, cb, cy, ib;
-	int a, b, atdon;
+	int sy, ix, iy;
+	int ib;
 
 
 	num = 0;
 	crep = 999;
-	a = 0;
-	atdon = amzon + 3;
-	cy = 0;
+	int a = 0;
+	int atdon = amzon + 3;
+	int cy = 0;
 	while (cy < caff) {
 		a += tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
-	b = tabdon[atdon];
-	if (b == 0)
-		goto L1;
+	if (tabdon[atdon] == 0) {
+		crep = 997;
+		return;
+	}
+
 	a += fleche;
-	cb = 0;
+	int cb = 0;
 	for (cy = 0; cy <= (sx - 2); ++cy) {
 		ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
 		cb += (ib * 4) + 2;
 	}
 	ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
-	if (ib == 0)
-		goto L1;
+	if (ib == 0) {
+		crep = 997;
+		return;
+	}
 
 	cy = 1;
 	do {
@@ -698,14 +702,13 @@ void tcoord(int sx) {
 		ix = tabdon[a + cb] * res;
 		iy = tabdon[(a + cb + 1)];
 		++cy;
-	} while (!(((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib)));
+	} while (!(((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib)));
 
-	if ((x >= sx) && (x <= ix) && (y >= sy) && (y <= iy)) {
+	if ((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) {
 		num = cy - 1;
 		return;
 	}
 
-L1:
 	crep = 997;
 }
 
@@ -733,10 +736,9 @@ void st7(int ob) {
 }
 
 void treg(int ob) {
-	int mdes;
-
-	mdes = caff;
+	int mdes = caff;
 	caff = ob;
+
 	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == OPCODE_SLOOK)) {
 		afdes(0);
 		if ((caff > 29) && (caff < 33))
@@ -758,6 +760,7 @@ void avpoing(int &ob) {
 	crep = 999;
 	if (s.derobj != 0)
 		ajjer(s.derobj);
+
 	if (crep != 139) {
 		modobj(ob + 400);
 		s.derobj = ob;
@@ -766,9 +769,8 @@ void avpoing(int &ob) {
 }
 
 void rechai(int &ch) {
-	int cx;
+	int cx = s.mlieu;
 
-	cx = s.mlieu;
 	if (s.mlieu == 16)
 		cx = 14;
 	ch = tabdon[achai + (cx * 7) + num - 1];
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index c9ea556..5063166 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -594,7 +594,7 @@ void MortevielleEngine::handleAction() {
 			} else
 				return;
 		} else if (inkey == '\104') {
-			if ((x != 0) && (y != 0))
+			if ((g_x != 0) && (y != 0))
 				num = 9999;
 			return;
 		}
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 2cdfbe4..3cc9b34 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -154,9 +154,6 @@ Common::String deline(int num) {
 	return wrkStr;
 }
 
-void afftex(const char *ch, int x, int y, int dx, int dy, int typ);
-
-
 static int l_motsuiv(int p, const char *ch, int &tab) {
 	int c = p;
 
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 64bb6cb..1ea8d50 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -61,7 +61,7 @@ void charpal() {
 	if (!ft.open("fxx.mor"))
 		error("Missing file - fxx.mor");
 	for (int i = 0; i < 108; ++i)
-		l[i] = ft.readSint16LE();
+		g_l[i] = ft.readSint16LE();
 	ft.close();
 
 	if (!f.open("plxx.mor"))
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 4953f86..635140f 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -94,7 +94,7 @@ void MortevielleEngine::gameLoaded() {
 	mnumo = 0;
 	prebru = 0;
 	g[4] = 'T';
-	x = 0;
+	g_x = 0;
 	y = 0;
 	num = 0;
 	hdb = 0;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 29cdc0a..52ed011 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -193,16 +193,16 @@ void taffich() {
 		npal = a;
 
 		for (cx = 0; cx <= (a - 1); ++cx)
-			lgt = lgt + l[cx];
-		handle = l[a];
+			lgt = lgt + g_l[cx];
+		handle = g_l[a];
 
 		filename = "DXX.mor";
 	} else {
 		filename = "DZZ.mor";
-		handle = l[87];
+		handle = g_l[87];
 		if (a == 51) {
 			lgt = handle;
-			handle = l[88];
+			handle = g_l[88];
 		}
 		_maff = a;
 		npal = a + 37;
@@ -235,8 +235,8 @@ void taffich() {
 			else if (b > 15)
 				--b;
 			for (cx = 0; cx <= (b - 1); ++cx)
-				lgt += l[cx + 89];
-			handle = l[b + 89];
+				lgt += g_l[cx + 89];
+			handle = g_l[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
 			filename = "AZZ.mor";
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index ef9dbcf..d63d9aa 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -113,7 +113,7 @@ bool blo,
         rech_cfiec;
 
 
-int x,
+int g_x,
         y,
         t,
         vj,
@@ -194,7 +194,7 @@ ind t_rec[maxtd + 1];
 //file<ind> sauv_t;
 //untyped_file fibyte;
 byte v_lieu[8][25];
-int l[108];
+int g_l[108];
 int tbi[256];
 chariot c1, c2, c3;
 float addfix;
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index d9a11f5..5769b61 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -182,12 +182,6 @@ struct chariot {
 		rep;
 };
 
-/*
-struct doublet {
-	byte x, y;
-};
-*/
-
 struct rectangle {
 	int x1, x2, y1, y2;
 	bool enabled;
@@ -259,7 +253,7 @@ extern bool blo,
         rech_cfiec;
 
 
-extern int x,
+extern int g_x,
         y,
         t,
         vj,
@@ -340,7 +334,7 @@ extern ind t_rec[maxtd + 1];
 //file<ind> sauv_t;
 //untyped_file fibyte;
 extern byte v_lieu[8][25];
-extern int l[108];
+extern int g_l[108];
 extern int tbi[256];
 extern chariot c1, c2, c3;
 extern float addfix;


Commit: 7ebfcb1d9738fa28ae1dfe1f9adefe0812ceb7ee
    https://github.com/scummvm/scummvm/commit/7ebfcb1d9738fa28ae1dfe1f9adefe0812ceb7ee
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:19-07:00

Commit Message:
MORTEVIELLE: Silent the remaining errors reported by CppCheck

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 12df21e..d54312a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -178,14 +178,10 @@ void ecrf2() {
 }
 
 void ecr2(Common::String str_) {
-	int tab;
-
-	if (res == 1)
-		tab = 10;
-	else
-		tab = 6;
+	// Some dead code was present in the original: removed
 	g_vm->_screenSurface.putxy(8, 177);
 	int tlig = 59 + (res - 1) * 36;
+
 	if ((int)str_.size() < tlig)
 		g_vm->_screenSurface.writeg(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
@@ -339,7 +335,6 @@ void repon(int f, int m) {
 	Common::String str_;
 	Common::String str1;
 	Common::String tmpStr;
-	int i, xco, dx, caspe;
 
 	if ((m > 499) && (m < 563)) {
 		tmpStr = deline(m - 501 + c_st41);
@@ -372,6 +367,7 @@ void repon(int f, int m) {
 			}
 		}
 		if ((f == 6) || (f == 9)) {
+			int i;
 			if (f == 6)
 				i = 4;
 			else
@@ -389,6 +385,8 @@ void repon(int f, int m) {
 		if (f == 7) {         /* messint */
 			ecrf7();
 			tmpStr = deline(m);
+
+			int xco, dx, caspe;
 			if (res == 1) {
 				xco = 252 - tmpStr.size() * 5;
 				caspe = 100;
@@ -516,7 +514,11 @@ void cpl1(int &p) {
 	int j, h, m;
 
 	calch(j, h, m);
-	if ((h > 7) || (h < 11))
+	// The original uses an || instead of an &&, resulting 
+	// in an always true condition. Based on the other tests, 
+	// and on other scenes, we use an && instead.
+	// if ((h > 7) || (h < 11))
+	if ((h > 7) && (h < 11))
 		p = 25;
 	else if ((h > 10) && (h < 14))
 		p = 35;
@@ -810,11 +812,10 @@ void quelq6(int l) {
 }
 
 void quelq10(int h, int &per) {
-	int min = 0, max = 0;
-
 	if ((h >= 0) && (h < 8))
 		chlm(per);
 	else {
+		int min = 0, max = 0;
 		if ((h > 7) && (h < 10)) {
 			min = 5;
 			max = 7;
@@ -834,11 +835,10 @@ void quelq10(int h, int &per) {
 }
 
 void quelq11(int h, int &per) {
-	int min = 0, max = 0;
-
 	if ((h >= 0) && (h < 8))
 		chlm(per);
 	else {
+		int min = 0, max = 0;
 		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
 			min = 1;
 			max = 3;
@@ -882,11 +882,10 @@ void quelq15(int &per) {
 }
 
 void quelq20(int h, int &per) {
-	int min = 0, max = 0;
-
 	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
 		chlm(per);
 	else {
+		int min = 0, max = 0;
 		if ((h > 9) && (h < 12)) {
 			min = 3;
 			max = 7;
@@ -904,13 +903,13 @@ void quelq20(int h, int &per) {
 
 
 void frap() {
-	int j, h, m, haz;
+	int j, h, m;
 
 	calch(j, h, m);
 	if ((h >= 0) && (h < 8))
 		crep = 190;
 	else {
-		haz = hazard(1, 100);
+		int haz = hazard(1, 100);
 		if (haz > 70)
 			crep = 190;
 		else
@@ -993,10 +992,8 @@ void ecfren(int &p, int &haz, int cf, int l) {
 }
 
 void becfren(int l) {
-	int haz;
-
 	if ((l == 1) || (l == 4)) {
-		haz = hazard(1, 2);
+		int haz = hazard(1, 2);
 		if (l == 1)
 			if (haz == 1)
 				bh1 = true;
@@ -1092,11 +1089,11 @@ void dprog() {
 }
 
 void pl1(int cf) {
-	int p, haz;
-
 	if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) {
+		int p, haz;
 		cpl1(p);
 		phaz(haz, p, cf);
+
 		if (haz > p)
 			person();
 		else
@@ -1105,11 +1102,11 @@ void pl1(int cf) {
 }
 
 void pl2(int cf) {
-	int p, haz;
-
 	if (! bh2) {
+		int p, haz;
 		cpl2(p);
 		phaz(haz, p, cf);
+
 		if (haz > p)
 			person();
 		else
@@ -1118,11 +1115,11 @@ void pl2(int cf) {
 }
 
 void pl5(int cf) {
-	int p, haz;
-
 	if (! bh5) {
+		int p, haz;
 		cpl5(p);
 		phaz(haz, p, cf);
+
 		if (haz > p)
 			person();
 		else
@@ -1131,11 +1128,11 @@ void pl5(int cf) {
 }
 
 void pl6(int cf) {
-	int p, haz;
-
 	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
+		int p, haz;
 		cpl6(p);
 		phaz(haz, p, cf);
+
 		if (haz > p)
 			person();
 		else
@@ -1144,11 +1141,11 @@ void pl6(int cf) {
 }
 
 void pl9(int cf) {
-	int p, haz;
-
 	if (! bh9) {
 		cf = -10;
+		int p, haz;
 		phaz(haz, p, cf);
+
 		if (haz > p)
 			person();
 		else
@@ -1158,9 +1155,9 @@ void pl9(int cf) {
 
 void pl10(int cf) {
 	int p, h, haz;
-
 	cpl10(p, h);
 	phaz(haz, p, cf);
+
 	if (haz > p)
 		person();
 	else
@@ -1223,7 +1220,7 @@ void pl20(int cf) {
 }
 
 void t11(int l11, int &a) {
-	int p, haz, h = 0;
+	int p, haz;
 
 	ecfren(p, haz, s.conf, l11);
 	li = l11;
@@ -1244,6 +1241,7 @@ void t11(int l11, int &a) {
 		if ((l11 > 15) && (l11 != 20) && (l11 != 26))
 			person();
 		else {
+			int h = 0;
 			if (l11 == 10)
 				cpl10(p, h);
 			if (l11 == 11)
@@ -1312,6 +1310,7 @@ void writetp(Common::String s, int t) {
  */
 void messint(int nu) {
 	// Method is deprecated
+	warning("DEPRECATED: messint");
 }
 
 void aniof(int ouf, int num) {
@@ -1339,9 +1338,6 @@ void aniof(int ouf, int num) {
 }
 
 void musique(int so) {
-	bool i;
-	int haz;
-
 	if (so == 0) {
 		/* musik(0) */
 		;
@@ -1349,9 +1345,9 @@ void musique(int so) {
 		parole(10, 1, 1);
 		++prebru;
 	} else {
-		i = false;
+		bool i = false;
 		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
-			haz = hazard(1, 3);
+			int haz = hazard(1, 3);
 			if (haz == 2) {
 				haz = hazard(2, 4);
 				parole(9, haz, 1);
@@ -1359,14 +1355,14 @@ void musique(int so) {
 			}
 		}
 		if (s.mlieu == 20) {
-			haz = hazard(1, 2);
+			int haz = hazard(1, 2);
 			if (haz == 1) {
 				parole(8, 1, 1);
 				i = true;
 			}
 		}
 		if (s.mlieu == 24) {
-			haz = hazard(1, 2);
+			int haz = hazard(1, 2);
 			if (haz == 2) {
 				parole(12, 1, 1);
 				i = true;
@@ -1377,7 +1373,7 @@ void musique(int so) {
 			i = true;
 		}
 		if (! i) {
-			haz = hazard(1, 17);
+			int haz = hazard(1, 17);
 			parole(haz, 1, 2);
 		}
 	}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 2a80cec..ed5ed49 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -46,9 +46,8 @@ void tinke() {
 	const char d4 = ']';
 	const char d5 = '1';
 	Common::String d6 = g_vm->getEngineString(S_OK);
-	int cx, haz, nh, cf, j, h, m;
+	int cx, cf, j, h, m;
 	Common::String stpo;
-	bool am;
 
 	anyone = false;
 	calch(j, h, m);
@@ -109,9 +108,9 @@ void tinke() {
 		if (cf > 65)
 			t -= ((t / 3) * 2);
 
-		nh = readclock();
+		int nh = readclock();
 		if ((nh - mh) > t) {
-			am = g_vm->_menu._menuActive;
+			bool activeMenu = g_vm->_menu._menuActive;
 			g_vm->_menu.eraseMenu();
 			jh += ((nh - mh) / t);
 			mh = nh;
@@ -165,7 +164,7 @@ void tinke() {
 					if (! brt) {
 						brt = true;
 						hdb = readclock();
-						haz = hazard(1, 5);
+						int haz = hazard(1, 5);
 						if (haz < 5) {
 							clsf3();
 							ecrf2();
@@ -176,7 +175,7 @@ void tinke() {
 						}
 					}
 				}
-			if (am)
+			if (activeMenu)
 				g_vm->_menu.drawMenu();
 		}
 	}
@@ -217,7 +216,6 @@ void afdes(int ad) {
 void tkey1(bool d) {
 	bool quest;
 	int x, y, c;
-	int key;
 
 	hideMouse();
 	fenat('K');
@@ -232,7 +230,7 @@ void tkey1(bool d) {
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && anyone)));
 	if (quest)
-		key = testou();
+		testou();
 	g_vm->setMouseClick(false);
 	showMouse();
 }
@@ -288,15 +286,16 @@ void mfouen() {
 /* NIVEAU 6 */
 
 void tperd() {
-	int cx;
-
 	initouv();
 	ment = 0;
 	iouv = 0;
 	mchai = 0;
 	mfouen();
-	if (!blo)
+	if (!blo) {
+		int cx;
 		t11(21, cx);
+	}
+
 	g_vm->_loseGame = true;
 	clsf1();
 	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
@@ -469,10 +468,10 @@ void ajjer(int ob) {
 
 void t1sama() {    //Entering manor
 	int j, h, m;
-	bool d;
 
 	calch(j, h, m);
 	if ((h < 5) && (s.mlieu > 18)) {
+		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
 			crep = 1511;
@@ -548,10 +547,9 @@ void tctrm() {
 
 
 void quelquun() {
-	int haz, cx;
-
 	if (imen)
 		g_vm->_menu.eraseMenu();
+
 	finfouil();
 	crep = 997;
 L1:
@@ -572,6 +570,7 @@ L1:
 			s.conf += 3 * (s.conf / 10);
 		tsort();
 		tmlieu(15);
+		int cx;
 		tip(ipers, cx);
 		caff = 69 + cx;
 		crep = caff;
@@ -580,7 +579,7 @@ L1:
 		syn = true;
 		col = true;
 	} else {
-		haz = hazard(1, 3);
+		int haz = hazard(1, 3);
 		if (haz == 2) {
 			cache = false;
 			crep = 137;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index e7da3c3..d607b05 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -82,16 +82,13 @@ void initMouse() {
  * @remarks	Originally called 'hide_mouse'
  */
 void hideMouse() {
-	int i, j, k, ps;;
-	bool imp;
-
 	--mouse_shwn;
 	if (mouse_shwn == 0) {
-		imp = odd(y_s);
-		j = p_o_s;
+		bool imp = odd(y_s);
+		int j = p_o_s;
 		switch (_currGraphicalDevice) {
-		case MODE_CGA:
-			k = 0;
+		case MODE_CGA: {
+			int k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
 				WRITE_LE_UINT16(&mem[0xb000 * 16 + j], s_s[0][k]);
@@ -101,11 +98,12 @@ void hideMouse() {
 				j += 80;
 				++k;
 			} while (k < 5);
+			}
 			break;
 		case MODE_AMSTRAD1512:
-			for (i = 0; i <= 3; ++i) {
+			for (int i = 0; i <= 3; ++i) {
 				port[0x3dd] = 1 << i;
-				k = 0;
+				int k = 0;
 				j = p_o_s;
 				do {
 					if (imp) {
@@ -120,45 +118,50 @@ void hideMouse() {
 				} while (k < 8);
 			}
 			break;
-		case MODE_EGA:
+		case MODE_EGA: {
 			port[0x3c4] = 2;
 			port[0x3ce] = 8;
 			port[0x3cf] = 255;
-			i = 0;
+			int i = 0;
 			do {
 				port[0x3c5] = 1 << i;
-				k = 0;
+				int k = 0;
 				j = p_o_s;
 				do {
-					ps = mem[0xa000 * 16 + j];
+					// Useless ?
+					// ps = mem[0xa000 * 16 + j];
 					mem[0xa000 * 16 + j] = lo(s_s[i][k]);
-					ps = mem[0xa000 * 16 + j + 1];
+
+					// Useless ??
+					// ps = mem[0xa000 * 16 + j + 1];
 					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
 					++k;
 				} while (k < 8);
 				++i;
 			} while (i != 4);
+			}
 			break;
 		case MODE_HERCULES:
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
-			for (i = 0; i <= 5; ++i) {
-				for (k = 0; k <= 3; ++k) 
+			for (int i = 0; i <= 5; ++i) {
+				for (int k = 0; k <= 3; ++k) 
 					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
 			break;
-		case MODE_TANDY:
+		case MODE_TANDY: {
 			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
-			k = 0;
+			int k = 0;
 			do {
-				for (i = 0; i <= 3; ++i) {
+				for (int i = 0; i <= 3; ++i) {
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
 					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j += 160;
 				++k;
 			} while (k != 3);
+			}
 			break;
 		default:
 			break;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 1ea8d50..e1374d4 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -172,9 +172,6 @@ void music() {
 	Common::File fic;
 	int k;
 	bool fin;
-	char ch;
-//	float x, y;
-
 
 	/* debug('o3 music'); */
 	if (_soundOff)
@@ -202,7 +199,7 @@ void music() {
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
 	while (keypressed())
-		ch = get_ch();	// input >> kbd >> ch;
+		get_ch();	// input >> kbd >> ch;
 }
 
 
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 52ed011..82abc27 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -95,9 +95,8 @@ void taffich() {
 	byte tran1[] = { 121, 121, 138, 139, 120 };	// array<136, 140, byte>
 	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };	// array<153, 161, byte>
 
-	int i, m, cx, handle, npal;
+	int cx, handle, npal;
 	int32 lgt;
-	int palh, k, j;
 	int alllum[16];
 
 
@@ -154,7 +153,7 @@ void taffich() {
 	Common::String filename;
 
 	if ((a != 50) && (a != 51)) {
-		m = a + 2000;
+		int m = a + 2000;
 		if ((m > 2001) && (m < 2010))
 			m = 2001;
 		if (m == 2011)
@@ -209,13 +208,13 @@ void taffich() {
 	}
 	chardes(filename, lgt, handle);
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		for (i = 0; i <= 15; ++i) {
-			palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
+		for (int i = 0; i <= 15; ++i) {
+			int palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
-		for (i = 0; i <= 15; ++i) {
-			k = 0;
-			for (j = 0; j <= 15; ++j)
+		for (int i = 0; i <= 15; ++i) {
+			int k = 0;
+			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
 			mem[(0x7000 * 16) + 2 + (k << 1)] = rang[i];
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index d63d9aa..42fab06 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -231,7 +231,7 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 	tmp[size] = '\0';
 
 	Common::String result(tmp);
-	delete tmp;
+	delete[] tmp;
 	return result;
 }
 


Commit: f2e8b4dc0445219fdd7112746fc7ce26e0294ce3
    https://github.com/scummvm/scummvm/commit/f2e8b4dc0445219fdd7112746fc7ce26e0294ce3
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:20-07:00

Commit Message:
MORTEVIELLE: Replace an 1-based array by a 0-based one

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d54312a..ab2ac1f 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -622,17 +622,15 @@ void chlm(int &per) {
  * @remarks	Originally called 'pendule'
  */
 void drawClock() {
-	const int cv[3][13] = {
-		{ 0,  0,  0,  0,  0,  0,  0,  0,  0,   0,  0,  0,  0 },
-		{ 0,  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
-		{ 0, -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
+	const int cv[2][12] = {
+		{  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
+		{ -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
 	};
 	const int x = 580;
 	const int y = 123;
 	const int rg = 9;
 	int h, co;
 
-
 	hideMouse();
 	
 	paint_rect(570, 118, 20, 10);
@@ -653,7 +651,7 @@ void drawClock() {
 	if (h == 0)
 		h = 12;
 
-	g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[1][h]) >> 1)*res, y + cv[2][h], co);
+	g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[0][h - 1]) >> 1)*res, y + cv[1][h - 1], co);
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 


Commit: 0f82bab350fb2eabaf8df2c46625052dea536794
    https://github.com/scummvm/scummvm/commit/0f82bab350fb2eabaf8df2c46625052dea536794
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:21-07:00

Commit Message:
MORTEVIELLE: Add braces, silenting some GCC warnings

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b2a23f5..49d6a00 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -642,37 +642,42 @@ void fctPlace() {
 		crep = 186;
 		return;
 	}
+
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_PUT));
+
 	tfleche();
 	if (iesc)
 		crep = 998;
+
 	if ((anyone) || (iesc))
 		return;
+
 	tcoord(8);
 	if (num != 0) {
 		crep = 999;
 		if (caff == 13) {
 			if (num == 1) {
-				if (s.iboul != 0)
+				if (s.iboul != 0) {
 					crep = 188;
-				else {
+				} else {
 					s.iboul = s.derobj;
 					if (s.derobj == 141)
 						aniof(1, 7);
 				}
-			} else if (s.ibag != 0)
+			} else if (s.ibag != 0) {
 				crep = 188;
-			else {
+			} else {
 				s.ibag = s.derobj;
 				if (s.derobj == 159)
 					aniof(1, 6);
 			}
 		}
-		if (caff == 14)
-			if (s.icave != 0)
+
+		if (caff == 14) {
+			if (s.icave != 0) {
 				crep = 188;
-			else {
+			} else {
 				s.icave = s.derobj;
 				if (s.derobj == 151) {
 					// Open hidden passage
@@ -684,7 +689,7 @@ void fctPlace() {
 
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
-					if (answer== 1)  {
+					if (answer== 1) {
 						Common::String alertTxt = deline(582);
 						Alert::show(alertTxt, 1);
 
@@ -727,29 +732,38 @@ void fctPlace() {
 					return;
 				}
 			}
-		if (caff == 16)
+		}
+
+		if (caff == 16) {
 			if (s.icryp == 0)
 				s.icryp = s.derobj;
 			else
 				crep = 188;
-		if (caff == 17)
-			if (s.ivier != 0)
+		}
+
+		if (caff == 17) {
+			if (s.ivier != 0) {
 				crep = 188;
-			else if (s.derobj == 143) {
+			} else if (s.derobj == 143) {
 				s.ivier = 143;
 				aniof(1, 1);
 			} else {
 				crep = 1512;
 				tperd();
 			}
-		if (caff == 24)
-			if (s.ipuit != 0)
+		}
+
+		if (caff == 24) {
+			if (s.ipuit != 0) {
 				crep = 188;
-			else if ((s.derobj == 140) || (s.derobj == 120)) {
+			} else if ((s.derobj == 140) || (s.derobj == 120)) {
 				s.ipuit = s.derobj;
 				aniof(1, 1);
-			} else
+			} else {
 				crep = 185;
+			}
+		}
+
 		if (crep != 188)
 			maivid();
 	}
@@ -894,11 +908,13 @@ void fctKnock() {
 
 	if (s.mlieu < 25) {
 		tfleche();
-		if (!(anyone) && !(iesc))
+		if (!(anyone) && !(iesc)) {
 			if ((s.mlieu < 19) && (s.mlieu != 15))
 				crep = 133;
 			else
 				crep = 997;
+		}
+
 		return;
 	}
 
@@ -968,27 +984,33 @@ void fctSelfPut() {
 			tcoord(8);
 			if (num != 0) {
 				crep = 998;
-				if (caff == 2)
+				if (caff == 2) {
 					if (s.iloic != 0)
 						crep = 188;
 					else
 						s.iloic = s.derobj;
+				}
+
 				if (caff == 13) {
 					if (num == 1) {
 						if (s.iboul != 0)
 							crep = 188;
 						else
 							s.iboul = s.derobj;
-					} else if (s.ibag != 0)
+					} else if (s.ibag != 0) {
 						crep = 188;
-					else
+					} else {
 						s.ibag = s.derobj;
+					}
 				}
-				if (caff == 16)
+
+				if (caff == 16) {
 					if (s.icryp != 0)
 						crep = 188;
 					else
 						s.icryp = s.derobj;
+				}
+
 				if (caff == 24)
 					crep = 185;
 				if ((caff == 14) || (caff == 17))
@@ -1056,9 +1078,9 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	if ((s.mlieu > 15) && (s.mlieu < 26))
+	if ((s.mlieu > 15) && (s.mlieu < 26)) {
 		crep = 148;
-	else {
+	} else {
 		tsort();
 		s.mlieu = 10;
 		caff = 10;
@@ -1069,21 +1091,26 @@ void fctEat() {
 		calch(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
 			s.conf = s.conf - (s.conf / 7);
-			if (h == 12)
+			if (h == 12) {
 				if (m == 0)
 					h = 4;
 				else
 					h = 3;
-			if ((h == 13) || (h == 19))
+			}
+
+			if ((h == 13) || (h == 19)) {
 				if (m == 0)
 					h = 2;
 				else
 					h = 1;
+			}
+			
 			jh += h;
 			crep = 135;
 			tinke();
-		} else
+		} else {
 			crep = 134;
+		}
 	}
 }
 
@@ -1204,13 +1231,15 @@ void fctForce() {
 		ecr3(g_vm->getEngineString(S_SMASH));
 	if (caff < 25)
 		tfleche();
-	if ((! anyone) && (! iesc))
+
+	if ((! anyone) && (! iesc)) {
 		if (s.mlieu != 26)
 			crep = 997;
 		else {
 			crep = 143;
 			s.conf += 2;
 		}
+	}
 }
 
 /**
@@ -1443,10 +1472,10 @@ void fctDiscuss() {
 				}
 			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
 				suj = tabdon[arep + (ix << 3) + (caff - 70)];
-				s.conf = s.conf + tabdon[arcf + ix];
-				nbrep[caff - 69] = nbrep[caff - 69] + 1;
+				s.conf += tabdon[arcf + ix];
+				++nbrep[caff - 69];
 			} else {
-				s.conf = s.conf + 3;
+				s.conf += 3;
 				suj = 139;
 			}
 			hideMouse();
@@ -1459,8 +1488,8 @@ void fctDiscuss() {
 				s.teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
-				for (int ix = 29; ix <= 31; ++ix)
-					s.teauto[ix] = '*';
+				for (int indx = 29; indx <= 31; ++indx)
+					s.teauto[indx] = '*';
 				s.pourc[7] = '*';
 			}
 			if (suj == 70) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ab2ac1f..8b99fcc 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -992,16 +992,17 @@ void ecfren(int &p, int &haz, int cf, int l) {
 void becfren(int l) {
 	if ((l == 1) || (l == 4)) {
 		int haz = hazard(1, 2);
-		if (l == 1)
+		if (l == 1) {
 			if (haz == 1)
 				bh1 = true;
 			else
 				bf1 = true;
-		if (l == 4)
+		} else { // l == 4
 			if (haz == 1)
 				bh4 = true;
 			else
 				bf4 = true;
+		}
 	} else if (l == 2)
 		bh2 = true;
 	else if (l == 3)
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index ed5ed49..8edafa8 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -156,10 +156,10 @@ void tinke() {
 			if ((mpers != 0) && (ipers != 10))
 				mpers = ipers;
 
-			if ((mpers == 0) && (ipers > 0))
-				if ((s.mlieu == 13) || (s.mlieu == 14))
+			if ((mpers == 0) && (ipers > 0)) {
+				if ((s.mlieu == 13) || (s.mlieu == 14)) {
 					cavegre();
-				else if (ipers == 10) {
+				} else if (ipers == 10) {
 					ipers = 0;
 					if (! brt) {
 						brt = true;
@@ -175,6 +175,8 @@ void tinke() {
 						}
 					}
 				}
+			}
+
 			if (activeMenu)
 				g_vm->_menu.drawMenu();
 		}


Commit: e81636fe5015e76f3c8b3e520c0c7749e0a1b7be
    https://github.com/scummvm/scummvm/commit/e81636fe5015e76f3c8b3e520c0c7749e0a1b7be
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:23-07:00

Commit Message:
MORTEVIELLE: Silent a bunch of GCC warnings and errors

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 49d6a00..56c87ef 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,13 +49,13 @@ namespace Mortevielle {
 void fctMove() {
 	int cx;
 
-	if ((s.mlieu == 26) && (msg[4] == g_vm->_menu._moveMenu[6])) {
-		s.mlieu = 15;
-		caff = s.mlieu;
+	if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+		g_s.mlieu = 15;
+		caff = g_s.mlieu;
 		afdes(0);
-		repon(2, s.mlieu);
+		repon(2, g_s.mlieu);
 	}
-	if ((s.mlieu == 15) && (msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		if (!syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
@@ -64,21 +64,21 @@ void fctMove() {
 		if ((anyone) || (iesc))
 			return;
 		tcoord(1);
-		if (num == 0)
+		if (g_num == 0)
 			return;
-		if (num == 1) {
-			s.mlieu = 0;
+		if (g_num == 1) {
+			g_s.mlieu = 0;
 			tmlieu(0);
-		} else if (num == 7) {
-			s.mlieu = 13;
+		} else if (g_num == 7) {
+			g_s.mlieu = 13;
 			tmlieu(13);
-		} else if (num != 6)
-			s.mlieu = 26;
-		if ((num > 1) && (num < 6))
-			ment = num - 1;
-		if (num > 7)
-			ment = num - 3;
-		if (num != 6)
+		} else if (g_num != 6)
+			g_s.mlieu = 26;
+		if ((g_num > 1) && (g_num < 6))
+			ment = g_num - 1;
+		if (g_num > 7)
+			ment = g_num - 3;
+		if (g_num != 6)
 			affrep();
 		else
 			aldepl();
@@ -88,56 +88,56 @@ void fctMove() {
 	cx = 0;
 	do {
 		++cx;
-	} while (g_vm->_menu._moveMenu[cx] != msg[4]);
-	if (s.mlieu == 19) {
+	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
+	if (g_s.mlieu == 19) {
 		if (cx == 1)
 			t1deva();
 		if (cx == 2)
 			t1neig();
 		goto L2;
 	}
-	if (s.mlieu == 23) {
+	if (g_s.mlieu == 23) {
 		if (cx == 1)
 			t1deau();
 		if (cx == 2)
 			t1derr();
 		goto L2;
 	}
-	if ((s.mlieu == 11) && (cx == 1))
+	if ((g_s.mlieu == 11) && (cx == 1))
 		cx = 6;
-	if (s.mlieu == 12) {
+	if (g_s.mlieu == 12) {
 		if (cx == 2)
 			cx = 6;
 		if (cx == 5)
 			cx = 16;
 	}
-	if ((s.mlieu == 14) && (cx == 3))
+	if ((g_s.mlieu == 14) && (cx == 3))
 		cx = 6;
-	if (((s.mlieu == 15) || (s.mlieu == 26)) && (cx == 4))
+	if (((g_s.mlieu == 15) || (g_s.mlieu == 26)) && (cx == 4))
 		cx = 6;
-	if ((s.mlieu > 19) && (s.mlieu != 26))
+	if ((g_s.mlieu > 19) && (g_s.mlieu != 26))
 		cx += 10;
-	if ((s.mlieu == 20) && (cx == 13))
+	if ((g_s.mlieu == 20) && (cx == 13))
 		cx = 16;
-	if (s.mlieu == 21) {
+	if (g_s.mlieu == 21) {
 		if (cx == 12)
 			cx = 16;
 		else if (cx > 13)
 			cx = 15;
 	}
-	if ((s.mlieu == 22) && (cx > 14))
+	if ((g_s.mlieu == 22) && (cx > 14))
 		cx = 15;
-	if ((s.mlieu == 24) && (cx != 17))
+	if ((g_s.mlieu == 24) && (cx != 17))
 		if (cx > 13)
 			cx = 15;
 	if (cx == 1)
-		s.mlieu = 11;
+		g_s.mlieu = 11;
 	else if (cx == 2)
-		s.mlieu = 12;
+		g_s.mlieu = 12;
 	else if (cx == 3)
-		s.mlieu = 14;
+		g_s.mlieu = 14;
 	else if (cx == 4)
-		s.mlieu = 15;
+		g_s.mlieu = 15;
 	else if (cx == 5)
 		cx = 12;
 	if (cx == 6)
@@ -147,31 +147,31 @@ void fctMove() {
 	else if (cx == 12)
 		t1deva();
 	else if (cx == 13)
-		s.mlieu = 20;
+		g_s.mlieu = 20;
 	else if (cx == 14)
-		s.mlieu = 24;
+		g_s.mlieu = 24;
 	else if (cx == 15)
 		t1neig();
 	else if (cx == 16)
 		t1derr();
 	else if (cx == 17) {
-		if ((s.ipuit != 120) && (s.ipuit != 140))
+		if ((g_s.ipuit != 120) && (g_s.ipuit != 140))
 			crep = 997;
-		else if (s.ipuit == 120)
+		else if (g_s.ipuit == 120)
 			crep = 181;
-		else if (s.conf > 80) {
+		else if (g_s.conf > 80) {
 			crep = 1505;
 			tperd();
 		} else {
-			s.mlieu = 23;
+			g_s.mlieu = 23;
 			affrep();
 		}
 	}
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
-	debloc(s.mlieu);
+	debloc(g_s.mlieu);
 L2:
-	tmlieu(s.mlieu);
+	tmlieu(g_s.mlieu);
 }
 
 /**
@@ -184,24 +184,24 @@ void fctTake() {
 		avpoing(cx);
 		if (crep != 139) {
 			if (ipers > 0)
-				s.conf += 3;
+				g_s.conf += 3;
 			if (obpart) {
-				if (s.mlieu == 2)
-					s.iloic = 0;
-				if (s.mlieu == 13) {
-					if (s.iboul == caff)
-						s.iboul = 0;
-					if (s.ibag == caff)
-						s.ibag = 0;
+				if (g_s.mlieu == 2)
+					g_s.iloic = 0;
+				if (g_s.mlieu == 13) {
+					if (g_s.iboul == caff)
+						g_s.iboul = 0;
+					if (g_s.ibag == caff)
+						g_s.ibag = 0;
 				}
-				if (s.mlieu == 14)
-					s.icave = 0;
-				if (s.mlieu == 16)
-					s.icryp = 0;
-				if (s.mlieu == 17)
-					s.ivier = 0;
-				if (s.mlieu == 24)
-					s.ipuit = 0;
+				if (g_s.mlieu == 14)
+					g_s.icave = 0;
+				if (g_s.mlieu == 16)
+					g_s.icryp = 0;
+				if (g_s.mlieu == 17)
+					g_s.ivier = 0;
+				if (g_s.mlieu == 24)
+					g_s.ipuit = 0;
 				mfouen();
 				obpart = false;
 				affrep();
@@ -210,7 +210,7 @@ void fctTake() {
 				tsuiv();
 				++dobj;
 				if (dobj > 6) {
-					s.conf += 2;
+					g_s.conf += 2;
 					dobj = 0;
 				}
 			}
@@ -224,46 +224,46 @@ void fctTake() {
 		return;
 	if (caff == 3) {
 		tcoord(2);
-		if (num == 1) {
+		if (g_num == 1) {
 			crep = 152;
 			return;
 		}
 	}
 	tcoord(5);
-	if ((num == 0) || ((num == 1) && (s.mlieu == 16))) {
+	if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) {
 		tcoord(8);
-		if (num != 0) {
+		if (g_num != 0) {
 			if (ipers > 0)
-				s.conf += 3;
+				g_s.conf += 3;
 			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))
-				avpoing(s.iloic);
-			if ((s.mlieu == 13) && (num == 1) && (s.iboul != 0)) {
-				avpoing(s.iboul);
+			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
+				avpoing(g_s.iloic);
+			if ((g_s.mlieu == 13) && (g_num == 1) && (g_s.iboul != 0)) {
+				avpoing(g_s.iboul);
 				if ((crep != 997) && (crep != 139))
 					aniof(2, 7);
 			}
-			if ((s.mlieu == 13) && (num == 2) && (s.ibag != 0)) {
-				avpoing(s.ibag);
+			if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) {
+				avpoing(g_s.ibag);
 				if ((crep != 997) && (crep != 139))
 					aniof(2, 6);
 			}
-			if ((s.mlieu == 14) && (s.icave != 0)) {
-				avpoing(s.icave);
+			if ((g_s.mlieu == 14) && (g_s.icave != 0)) {
+				avpoing(g_s.icave);
 				if ((crep != 997) && (crep != 139))
 					aniof(2, 2);
 			}
-			if ((s.mlieu == 16) && (s.icryp != 0))
-				avpoing(s.icryp);
-			if ((s.mlieu == 17) && (s.ivier != 0)) {
-				avpoing(s.ivier);
+			if ((g_s.mlieu == 16) && (g_s.icryp != 0))
+				avpoing(g_s.icryp);
+			if ((g_s.mlieu == 17) && (g_s.ivier != 0)) {
+				avpoing(g_s.ivier);
 				if ((crep != 997) && (crep != 139)) {
 					crep = 182;
 					aniof(2, 1);
 				}
 			}
-			if ((s.mlieu == 24) && (s.ipuit != 0)) {
-				avpoing(s.ipuit);
+			if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) {
+				avpoing(g_s.ipuit);
 				if ((crep != 997) && (crep != 139))
 					aniof(2, 1);
 			}
@@ -271,15 +271,15 @@ void fctTake() {
 				crep = 999;
 		}
 	} else {
-		if ( ((s.mlieu == 0)  && (num == 3)) || ((s.mlieu == 1)  && (num == 4))
-		  || ((s.mlieu == 2)  && (num == 1)) || ((s.mlieu == 4)  && (num == 3))
-		  || ((s.mlieu == 5)  && (num == 6)) || ((s.mlieu == 6)  && (num == 2))
-		  || ((s.mlieu == 7)  && (num == 6)) || ((s.mlieu == 8)  && (num == 4))
-		  || ((s.mlieu == 9)  && (num == 4)) || ((s.mlieu == 10) && (num > 2))
-		  || ((s.mlieu == 11) && (num == 7)) || ((s.mlieu == 12) && (num == 6))
-		  || ((s.mlieu == 13) && (num > 4))  || ((s.mlieu > 13)  && (s.mlieu != 23)) )
+		if ( ((g_s.mlieu == 0)  && (g_num == 3)) || ((g_s.mlieu == 1)  && (g_num == 4))
+		  || ((g_s.mlieu == 2)  && (g_num == 1)) || ((g_s.mlieu == 4)  && (g_num == 3))
+		  || ((g_s.mlieu == 5)  && (g_num == 6)) || ((g_s.mlieu == 6)  && (g_num == 2))
+		  || ((g_s.mlieu == 7)  && (g_num == 6)) || ((g_s.mlieu == 8)  && (g_num == 4))
+		  || ((g_s.mlieu == 9)  && (g_num == 4)) || ((g_s.mlieu == 10) && (g_num > 2))
+		  || ((g_s.mlieu == 11) && (g_num == 7)) || ((g_s.mlieu == 12) && (g_num == 6))
+		  || ((g_s.mlieu == 13) && (g_num > 4))  || ((g_s.mlieu > 13)  && (g_s.mlieu != 23)) )
 		  crep = 997;
-		else if (s.mlieu == 23) {
+		else if (g_s.mlieu == 23) {
 			crep = 1504;
 			tperd();
 		} else
@@ -296,16 +296,16 @@ void fctInventoryTake() {
 	cx = 0;
 	do {
 		++cx;
-	} while (g_vm->_menu._inventoryMenu[cx] != msg[4]);
+	} while (g_vm->_menu._inventoryMenu[cx] != g_msg[4]);
 	cz = 0;
 	cy = 0;
 	do {
 		++cy;
-		if (ord(s.sjer[cy]) != 0)
+		if (ord(g_s.sjer[cy]) != 0)
 			++cz;
 	} while (cz != cx);
-	cz = ord(s.sjer[cy]);
-	s.sjer[cy] = chr(0);
+	cz = ord(g_s.sjer[cy]);
+	g_s.sjer[cy] = chr(0);
 	modinv();
 	avpoing(cz);
 	crep = 998;
@@ -325,25 +325,25 @@ void fctLift() {
 	if ((anyone) || (iesc))
 		return;
 	tcoord(3);
-	if (num == 0) {
+	if (g_num == 0) {
 		tcoord(8);
-		if (num != 0) {
+		if (g_num != 0) {
 			if (ipers > 0)
-				++s.conf;
+				++g_s.conf;
 			crep = 997;
-			if ((s.mlieu == 2) && (s.iloic != 0))
-				treg(s.iloic);
+			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
+				treg(g_s.iloic);
 		}
 		return;
 	}
 	if (ipers > 0)
-		++s.conf;
-	cx = s.mlieu;
-	if (s.mlieu == 16)
+		++g_s.conf;
+	cx = g_s.mlieu;
+	if (g_s.mlieu == 16)
 		cx = 14;
-	else if (s.mlieu == 19)
+	else if (g_s.mlieu == 19)
 		cx = 15;
-	crep = tabdon[asoul + (cx << 3) + (num - 1)];
+	crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
 	if (crep == 255)
 		crep = 997;
 }
@@ -361,7 +361,7 @@ void fctRead() {
 		tfleche();
 		if (!(anyone) && !(iesc)) {
 			tcoord(4);
-			if (num != 0)
+			if (g_num != 0)
 				crep = 107;
 		}
 	}
@@ -372,10 +372,10 @@ void fctRead() {
  * @remarks	Originally called 'tslire'
  */
 void fctSelfRead() {
-	if (s.derobj == 0)
+	if (g_s.derobj == 0)
 		crep = 186;
 	else
-		st4(s.derobj);
+		st4(g_s.derobj);
 }
 
 /**
@@ -395,64 +395,64 @@ void fctLook() {
 	if ((anyone) || (iesc))
 		return;
 	tcoord(5);
-	if (num == 0) {
+	if (g_num == 0) {
 		tcoord(8);
 		crep = 131;
-		if (num != 0) {
-			if (s.mlieu == 13) {
-				if (num == 1) {
+		if (g_num != 0) {
+			if (g_s.mlieu == 13) {
+				if (g_num == 1) {
 					crep = 164;
-					if (s.ibag != 0)
-						treg(s.ibag);
-					else if (s.iboul != 0)
-						treg(s.iboul);
+					if (g_s.ibag != 0)
+						treg(g_s.ibag);
+					else if (g_s.iboul != 0)
+						treg(g_s.iboul);
 				} else {
 					crep = 193;
-					if (s.ibag != 0)
-						treg(s.ibag);
+					if (g_s.ibag != 0)
+						treg(g_s.ibag);
 				}
 			}
-			if (s.mlieu == 14) {
+			if (g_s.mlieu == 14) {
 				crep = 164;
-				if (s.icave != 0)
-					treg(s.icave);
+				if (g_s.icave != 0)
+					treg(g_s.icave);
 			}
-			if (s.mlieu == 17) {
+			if (g_s.mlieu == 17) {
 				crep = 174;
-				if (s.ivier != 0)
-					treg(s.ivier);
+				if (g_s.ivier != 0)
+					treg(g_s.ivier);
 			}
-			if (s.mlieu == 24) {
+			if (g_s.mlieu == 24) {
 				crep = 131;
-				if (s.ipuit != 0)
-					treg(s.ipuit);
+				if (g_s.ipuit != 0)
+					treg(g_s.ipuit);
 			}
 		}
 		return;
 	}
-	cx = s.mlieu;
-	if (s.mlieu == 20)
+	cx = g_s.mlieu;
+	if (g_s.mlieu == 20)
 		cx = 17;
-	if ((s.mlieu > 21) && (s.mlieu < 25))
+	if ((g_s.mlieu > 21) && (g_s.mlieu < 25))
 		cx -= 4;
-	if (s.mlieu == 26)
+	if (g_s.mlieu == 26)
 		cx = 21;
-	crep = tabdon[arega + (cx * 7) + num - 1];
-	if ((s.mlieu == 13) && (num == 8))
+	crep = tabdon[arega + (cx * 7) + g_num - 1];
+	if ((g_s.mlieu == 13) && (g_num == 8))
 		crep = 126;
-	if (s.mlieu == 19)
+	if (g_s.mlieu == 19)
 		crep = 103;
 	if (crep == 255)
 		crep = 131;
-	if ((s.mlieu == 1) && (num == 1))
+	if ((g_s.mlieu == 1) && (g_num == 1))
 		treg(144);
-	if ((s.mlieu == 5) && (num == 3))
+	if ((g_s.mlieu == 5) && (g_num == 3))
 		treg(147);
-	if ((s.mlieu == 8) && (num == 3))
+	if ((g_s.mlieu == 8) && (g_num == 3))
 		treg(149);
-	if ((s.mlieu == 9) && (num == 2))
+	if ((g_s.mlieu == 9) && (g_num == 2))
 		treg(30);
-	if ((s.mlieu == 10) && (num == 3))
+	if ((g_s.mlieu == 10) && (g_num == 3))
 		treg(31);
 }
 
@@ -461,8 +461,8 @@ void fctLook() {
  * @remarks	Originally called 'tsregarder'
  */
 void fctSelftLook() {
-	if (s.derobj != 0)
-		treg(s.derobj);
+	if (g_s.derobj != 0)
+		treg(g_s.derobj);
 	else
 		crep = 186;
 }
@@ -486,25 +486,25 @@ void fctSearch() {
 	if (anyone || iesc)
 		return;
 
-	if (s.mlieu == 23) {
+	if (g_s.mlieu == 23) {
 		crep = 1504;
 		tperd();
 		return;
 	}
 
 	tcoord(6);
-	if (num == 0) {
+	if (g_num == 0) {
 		tcoord(7);
-		if (num != 0) {
+		if (g_num != 0) {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (num != ord(touv[cx])));
-			if (num != ord(touv[cx]))
+			} while ((cx <= 6) && (g_num != ord(touv[cx])));
+			if (g_num != ord(touv[cx]))
 				crep = 187;
 			else {
 				if (ipers > 0)
-					s.conf += 3;
+					g_s.conf += 3;
 
 				rechai(mchai);
 				if (mchai != 0) {
@@ -519,43 +519,43 @@ void fctSearch() {
 		} else {
 			tcoord(8);
 			crep = 997;
-			if (num != 0) {
+			if (g_num != 0) {
 				if (ipers > 0)
-					s.conf += 3;
-				if ((s.mlieu != 24) && (s.mlieu != 17) && (s.mlieu != 13)) {
-					if (s.mlieu == 2) {
+					g_s.conf += 3;
+				if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) {
+					if (g_s.mlieu == 2) {
 						crep = 123;
-						if (s.iloic != 0)
-							treg(s.iloic);
+						if (g_s.iloic != 0)
+							treg(g_s.iloic);
 					}
-					if (s.mlieu == 16) {
+					if (g_s.mlieu == 16) {
 						crep = 123;
-						if (s.icryp != 0)
-							treg(s.icryp);
+						if (g_s.icryp != 0)
+							treg(g_s.icryp);
 					}
 				}
 			}
 		}
 	} else {
 		if (ipers > 0)
-			s.conf += 3;
+			g_s.conf += 3;
 		crep = 997;
-		if (s.mlieu < 14)
-			crep = r[s.mlieu];
+		if (g_s.mlieu < 14)
+			crep = r[g_s.mlieu];
 
-		if ((s.mlieu == 3) && (num == 2))
+		if ((g_s.mlieu == 3) && (g_num == 2))
 			crep = 162;
 
-		if (s.mlieu == 12) {
-			if ((num == 3) || (num == 4))
+		if (g_s.mlieu == 12) {
+			if ((g_num == 3) || (g_num == 4))
 				crep = 162;
-			else if (num == 5)
+			else if (g_num == 5)
 				crep = 159;
 		}
 
-		if (s.mlieu == 19)
+		if (g_s.mlieu == 19)
 			crep = 104;
-		else if (s.mlieu == 16)
+		else if (g_s.mlieu == 16)
 			crep = 155;
 	}
 }
@@ -565,8 +565,8 @@ void fctSearch() {
  * @remarks	Originally called 'tsfouiller'
  */
 void fctSelfSearch() {
-	if (s.derobj != 0)
-		st7(s.derobj);
+	if (g_s.derobj != 0)
+		st7(g_s.derobj);
 	else
 		crep = 186;
 }
@@ -581,7 +581,7 @@ void fctOpen() {
 
 	if (caff == 26) {
 		if (ment != 0) {
-			msg[4] = OPCODE_ENTER;
+			g_msg[4] = OPCODE_ENTER;
 			syn = true;
 		} else
 			crep = 997;
@@ -598,34 +598,34 @@ void fctOpen() {
 		return;
 
 	tcoord(7);
-	if (num != 0) {
+	if (g_num != 0) {
 		if (ipers > 0)
-			s.conf += 2;
+			g_s.conf += 2;
 		++iouv;
 		int cx = 0;
 		do {
 			++cx;
-		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == num)));
-		if (ord(touv[cx]) != num) {
-			if (!( ((num == 3) && ((s.mlieu == 0) || (s.mlieu == 9) || (s.mlieu == 5) || (s.mlieu == 7)))
-			    || ((num == 4) && ((s.mlieu == 1) || (s.mlieu == 2) || (s.mlieu == 6)))
-				|| ((s.mlieu == 4) && (num == 5))
-				|| ((num == 6) && ((s.mlieu == 7) || (s.mlieu == 10) || (s.mlieu == 8) || (s.mlieu == 13)))
-				|| ((s.mlieu == 8) && (num == 2))
-				|| ((s.mlieu == 12) && (num == 7))) ) {
-				if ( ((s.mlieu > 10) && (s.mlieu < 14))
-				  || ((s.mlieu > 6) && (s.mlieu < 10))
-				  || (s.mlieu == 0) || (s.mlieu == 2) || (s.mlieu == 5)) {
+		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == g_num)));
+		if (ord(touv[cx]) != g_num) {
+			if (!( ((g_num == 3) && ((g_s.mlieu == 0) || (g_s.mlieu == 9) || (g_s.mlieu == 5) || (g_s.mlieu == 7)))
+			    || ((g_num == 4) && ((g_s.mlieu == 1) || (g_s.mlieu == 2) || (g_s.mlieu == 6)))
+				|| ((g_s.mlieu == 4) && (g_num == 5))
+				|| ((g_num == 6) && ((g_s.mlieu == 7) || (g_s.mlieu == 10) || (g_s.mlieu == 8) || (g_s.mlieu == 13)))
+				|| ((g_s.mlieu == 8) && (g_num == 2))
+				|| ((g_s.mlieu == 12) && (g_num == 7))) ) {
+				if ( ((g_s.mlieu > 10) && (g_s.mlieu < 14))
+				  || ((g_s.mlieu > 6) && (g_s.mlieu < 10))
+				  || (g_s.mlieu == 0) || (g_s.mlieu == 2) || (g_s.mlieu == 5)) {
 					if (hazard(1, 4) == 3)
 						parole(7, 9, 1);
 				}
-				touv[cx] = chr(num);
-				aniof(1, num);
+				touv[cx] = chr(g_num);
+				aniof(1, g_num);
 			}
-			cx = s.mlieu;
-			if (s.mlieu == 16)
+			cx = g_s.mlieu;
+			if (g_s.mlieu == 16)
 				cx = 14;
-			crep = tabdon[aouvr + (cx * 7) + num - 1];
+			crep = tabdon[aouvr + (cx * 7) + g_num - 1];
 			if (crep == 254)
 				crep = 999;
 		} else
@@ -638,7 +638,7 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	if (s.derobj == 0) {
+	if (g_s.derobj == 0) {
 		crep = 186;
 		return;
 	}
@@ -654,32 +654,32 @@ void fctPlace() {
 		return;
 
 	tcoord(8);
-	if (num != 0) {
+	if (g_num != 0) {
 		crep = 999;
 		if (caff == 13) {
-			if (num == 1) {
-				if (s.iboul != 0) {
+			if (g_num == 1) {
+				if (g_s.iboul != 0) {
 					crep = 188;
 				} else {
-					s.iboul = s.derobj;
-					if (s.derobj == 141)
+					g_s.iboul = g_s.derobj;
+					if (g_s.derobj == 141)
 						aniof(1, 7);
 				}
-			} else if (s.ibag != 0) {
+			} else if (g_s.ibag != 0) {
 				crep = 188;
 			} else {
-				s.ibag = s.derobj;
-				if (s.derobj == 159)
+				g_s.ibag = g_s.derobj;
+				if (g_s.derobj == 159)
 					aniof(1, 6);
 			}
 		}
 
 		if (caff == 14) {
-			if (s.icave != 0) {
+			if (g_s.icave != 0) {
 				crep = 188;
 			} else {
-				s.icave = s.derobj;
-				if (s.derobj == 151) {
+				g_s.icave = g_s.derobj;
+				if (g_s.derobj == 151) {
 					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
@@ -710,10 +710,10 @@ void fctPlace() {
 
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
-							s.mlieu = 17;
+							g_s.mlieu = 17;
 							tmlieu(17);
 						} else {
-							tmlieu(s.mlieu);
+							tmlieu(g_s.mlieu);
 							writepal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -735,17 +735,17 @@ void fctPlace() {
 		}
 
 		if (caff == 16) {
-			if (s.icryp == 0)
-				s.icryp = s.derobj;
+			if (g_s.icryp == 0)
+				g_s.icryp = g_s.derobj;
 			else
 				crep = 188;
 		}
 
 		if (caff == 17) {
-			if (s.ivier != 0) {
+			if (g_s.ivier != 0) {
 				crep = 188;
-			} else if (s.derobj == 143) {
-				s.ivier = 143;
+			} else if (g_s.derobj == 143) {
+				g_s.ivier = 143;
 				aniof(1, 1);
 			} else {
 				crep = 1512;
@@ -754,10 +754,10 @@ void fctPlace() {
 		}
 
 		if (caff == 24) {
-			if (s.ipuit != 0) {
+			if (g_s.ipuit != 0) {
 				crep = 188;
-			} else if ((s.derobj == 140) || (s.derobj == 120)) {
-				s.ipuit = s.derobj;
+			} else if ((g_s.derobj == 140) || (g_s.derobj == 120)) {
+				g_s.ipuit = g_s.derobj;
 				aniof(1, 1);
 			} else {
 				crep = 185;
@@ -784,9 +784,9 @@ void fctTurn() {
 	if ((anyone) || (iesc))
 		return;
 	tcoord(9);
-	if (num != 0) {
+	if (g_num != 0) {
 		crep = 997;
-		if ((s.mlieu == 13) && (s.ibag == 159) && (s.iboul == 141)) {
+		if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -795,13 +795,13 @@ void fctTurn() {
 			else
 				crep = 168;
 		}
-		if ((s.mlieu == 17) && (s.ivier == 143)) {
+		if ((g_s.mlieu == 17) && (g_s.ivier == 143)) {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
-				s.mlieu = 16;
+				g_s.mlieu = 16;
 				affrep();
 			} else
 				crep = 176;
@@ -819,7 +819,7 @@ void fctSelfHide() {
 	tfleche();
 	if (!(anyone) && !(iesc)) {
 		tcoord(10);
-		if (num == 0)
+		if (g_num == 0)
 			cache = false;
 		else {
 			cache = true;
@@ -833,7 +833,7 @@ void fctSelfHide() {
  * @remarks	Originally called 'tattacher'
  */
 void fctAttach() {
-	if (s.derobj == 0)
+	if (g_s.derobj == 0)
 		crep = 186;
 	else {
 		if (!syn)
@@ -842,10 +842,10 @@ void fctAttach() {
 		if (!(anyone) && !(iesc)) {
 			tcoord(8);
 			crep = 997;
-			if ((num != 0) && (s.mlieu == 24)) {
+			if ((g_num != 0) && (g_s.mlieu == 24)) {
 				crep = 999;
-				if ((s.derobj == 120) || (s.derobj == 140)) {
-					s.ipuit = s.derobj;
+				if ((g_s.derobj == 120) || (g_s.derobj == 140)) {
+					g_s.ipuit = g_s.derobj;
 					aniof(1, 1);
 				} else
 					crep = 185;
@@ -870,13 +870,13 @@ void fctClose() {
 		if ((anyone) || (iesc))
 			return;
 		tcoord(7);
-		if (num != 0) {
+		if (g_num != 0) {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (num != ord(touv[cx])));
-			if (num == ord(touv[cx])) {
-				aniof(2, num);
+			} while ((cx <= 6) && (g_num != ord(touv[cx])));
+			if (g_num == ord(touv[cx])) {
+				aniof(2, g_num);
 				crep = 998;
 				touv[cx] = chr(0);
 				iouv = iouv - 1;
@@ -901,15 +901,15 @@ void fctKnock() {
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
-	if (s.mlieu == 15) {
+	if (g_s.mlieu == 15) {
 		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
-	if (s.mlieu < 25) {
+	if (g_s.mlieu < 25) {
 		tfleche();
 		if (!(anyone) && !(iesc)) {
-			if ((s.mlieu < 19) && (s.mlieu != 15))
+			if ((g_s.mlieu < 19) && (g_s.mlieu != 15))
 				crep = 133;
 			else
 				crep = 997;
@@ -918,11 +918,11 @@ void fctKnock() {
 		return;
 	}
 
-	if (s.mlieu == 26) {
+	if (g_s.mlieu == 26) {
 		int haz = (hazard(0, 8)) - 4;
 		parole(11, haz, 1);
 		int p;
-		ecfren(p, haz, s.conf, ment);
+		ecfren(p, haz, g_s.conf, ment);
 		int l = ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -948,7 +948,7 @@ void fctKnock() {
 void fctSelfPut() {
 	if (!syn)
 		ecr3(g_vm->getEngineString(S_POSE));
-	if (s.derobj == 0)
+	if (g_s.derobj == 0)
 		crep = 186;
 	else {
 		if (caff > 99) {
@@ -963,7 +963,7 @@ void fctSelfPut() {
 			return;
 		tcoord(7);
 		crep = 124;
-		if (num != 0) {
+		if (g_num != 0) {
 			int chai;
 			rechai(chai);
 			if (chai == 0)
@@ -972,8 +972,8 @@ void fctSelfPut() {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (num != ord(touv[cx])));
-				if (num != ord(touv[cx]))
+				} while ((cx <= 6) && (g_num != ord(touv[cx])));
+				if (g_num != ord(touv[cx]))
 					crep = 187;
 				else {
 					mchai = chai;
@@ -982,33 +982,33 @@ void fctSelfPut() {
 			}
 		} else {
 			tcoord(8);
-			if (num != 0) {
+			if (g_num != 0) {
 				crep = 998;
 				if (caff == 2) {
-					if (s.iloic != 0)
+					if (g_s.iloic != 0)
 						crep = 188;
 					else
-						s.iloic = s.derobj;
+						g_s.iloic = g_s.derobj;
 				}
 
 				if (caff == 13) {
-					if (num == 1) {
-						if (s.iboul != 0)
+					if (g_num == 1) {
+						if (g_s.iboul != 0)
 							crep = 188;
 						else
-							s.iboul = s.derobj;
-					} else if (s.ibag != 0) {
+							g_s.iboul = g_s.derobj;
+					} else if (g_s.ibag != 0) {
 						crep = 188;
 					} else {
-						s.ibag = s.derobj;
+						g_s.ibag = g_s.derobj;
 					}
 				}
 
 				if (caff == 16) {
-					if (s.icryp != 0)
+					if (g_s.icryp != 0)
 						crep = 188;
 					else
-						s.icryp = s.derobj;
+						g_s.icryp = g_s.derobj;
 				}
 
 				if (caff == 24)
@@ -1019,7 +1019,7 @@ void fctSelfPut() {
 				crep = 124;
 				if (caff == 24) {
 					tcoord(5);
-					if (num != 0)
+					if (g_num != 0)
 						crep = 185;
 				}
 			}
@@ -1040,13 +1040,13 @@ void fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void fctListen() {
-	if (s.mlieu != 26)
+	if (g_s.mlieu != 26)
 		crep = 101;
 	else {
 		if (ipers != 0)
-			++s.conf;
+			++g_s.conf;
 		int p, haz;
-		ecfren(p, haz, s.conf, ment);
+		ecfren(p, haz, g_s.conf, ment);
 		int l = ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -1078,19 +1078,19 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	if ((s.mlieu > 15) && (s.mlieu < 26)) {
+	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
 		crep = 148;
 	} else {
 		tsort();
-		s.mlieu = 10;
+		g_s.mlieu = 10;
 		caff = 10;
-		debloc(s.mlieu);
-		tmlieu(s.mlieu);
+		debloc(g_s.mlieu);
+		tmlieu(g_s.mlieu);
 
 		int j, h, m;
 		calch(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
-			s.conf = s.conf - (s.conf / 7);
+			g_s.conf -= (g_s.conf / 7);
 			if (h == 12) {
 				if (m == 0)
 					h = 4;
@@ -1121,16 +1121,16 @@ void fctEat() {
 void fctEnter() {
 //	int x;
 
-	if ((s.mlieu == 21) || (s.mlieu == 22)) {
+	if ((g_s.mlieu == 21) || (g_s.mlieu == 22)) {
 		t1sama();
-		tmlieu(s.mlieu);
-	} else if (s.mlieu == 15)
+		tmlieu(g_s.mlieu);
+	} else if (g_s.mlieu == 15)
 		aldepl();
 	else if (ment == 0)
 		crep = 997;
-	else if ((ment == 9) && (s.derobj != 136)) {
+	else if ((ment == 9) && (g_s.derobj != 136)) {
 			crep = 189;
-			s.teauto[8] = '*';
+			g_s.teauto[8] = '*';
 	} else {
 		int z = 0;
 		if (! blo)
@@ -1144,18 +1144,18 @@ void fctEnter() {
 				aniof(1, 1);
 				
 				tip(z, g_x);
-				++s.conf;
-				s.mlieu = 15;
-				msg[3] = MENU_DISCUSS;
-				msg[4] = g_vm->_menu._discussMenu[g_x];
+				++g_s.conf;
+				g_s.mlieu = 15;
+				g_msg[3] = MENU_DISCUSS;
+				g_msg[4] = g_vm->_menu._discussMenu[g_x];
 				syn = true;
 				if (ment == 9) {
-					col = true;
+					g_col = true;
 					caff = 70;
 					afdes(0);
 					repon(2, caff);
 				} else
-					col = false;
+					g_col = false;
 				debloc(ment);
 				ment = 0;
 			}
@@ -1164,10 +1164,10 @@ void fctEnter() {
 			parole(7, g_x, 1);
 			aniof(1, 1);
 			
-			s.mlieu = ment;
+			g_s.mlieu = ment;
 			affrep();
-			debloc(s.mlieu);
-			tmlieu(s.mlieu);
+			debloc(g_s.mlieu);
+			tmlieu(g_s.mlieu);
 			ment = 0;
 			mpers = 0;
 			ipers = 0;
@@ -1182,17 +1182,17 @@ void fctEnter() {
 void fctSleep() {
 	int z, j, h, m;
 
-	if ((s.mlieu > 15) && (s.mlieu < 26)) {
+	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
 		crep = 148;
 		return;
 	}
-	if (s.mlieu != 0) {
+	if (g_s.mlieu != 0) {
 		tsort();
-		s.mlieu = 0;
+		g_s.mlieu = 0;
 		affrep();
 		afdes(0);
-		debloc(s.mlieu);
-		tmlieu(s.mlieu);
+		debloc(g_s.mlieu);
+		tmlieu(g_s.mlieu);
 	}
 	clsf3();
 	clsf2();
@@ -1203,7 +1203,7 @@ void fctSleep() {
 	int answer;
 	do {
 		if (h < 8) {
-			s.conf = s.conf - (s.conf / 20);
+			g_s.conf -= (g_s.conf / 20);
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
@@ -1219,7 +1219,7 @@ void fctSleep() {
 		anyone = false;
 	} while (answer != 1);
 	crep = 998;
-	num = 0;
+	g_num = 0;
 }
 
 /**
@@ -1233,11 +1233,11 @@ void fctForce() {
 		tfleche();
 
 	if ((! anyone) && (! iesc)) {
-		if (s.mlieu != 26)
+		if (g_s.mlieu != 26)
 			crep = 997;
 		else {
 			crep = 143;
-			s.conf += 2;
+			g_s.conf += 2;
 		}
 	}
 }
@@ -1249,27 +1249,27 @@ void fctForce() {
 void fctLeave() {
 	tsort();
 	crep = 0;
-	if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22) || (s.mlieu == 24))
+	if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24))
 		crep = 997;
 	else {
 		int lx = 0;
 
-		if ((s.mlieu < 16) || (s.mlieu == 26))
+		if ((g_s.mlieu < 16) || (g_s.mlieu == 26))
 			lx = 10;
-		if ((s.mlieu == 10) || (s.mlieu == 20))
+		if ((g_s.mlieu == 10) || (g_s.mlieu == 20))
 			lx = 21;
-		if ((s.mlieu < 10) || (s.mlieu == 13))
+		if ((g_s.mlieu < 10) || (g_s.mlieu == 13))
 			lx = 15;
-		if (s.mlieu == 16) {
+		if (g_s.mlieu == 16) {
 			lx = 17;
 			crep = 176;
 		}
-		if (s.mlieu == 17)
+		if (g_s.mlieu == 17)
 			t23coul(lx);
-		if (s.mlieu == 23)
+		if (g_s.mlieu == 23)
 			lx = 24;
 		if (crep != 997)
-			s.mlieu = lx;
+			g_s.mlieu = lx;
 		caff = lx;
 		if (crep == 0)
 			crep = lx;
@@ -1293,12 +1293,12 @@ void fctWait() {
 		++jh;
 		tinke();
 		if (!blo)
-			t11(s.mlieu, quel);
+			t11(g_s.mlieu, quel);
 		if ((ipers != 0) && (mpers == 0)) {
 			crep = 998;
-			if ((s.mlieu == 13) || (s.mlieu == 14))
+			if ((g_s.mlieu == 13) || (g_s.mlieu == 14))
 				cavegre();
-			if ((s.mlieu > 0) && (s.mlieu < 10))
+			if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
 				anyone = true;
 			mpers = ipers;
 			if (!anyone)
@@ -1324,7 +1324,7 @@ void fctSound() {
 		tfleche();
 		if (!(anyone) && (!iesc))
 			crep = 145;
-		num = 0;
+		g_num = 0;
 	}
 }
 
@@ -1340,13 +1340,13 @@ void fctDiscuss() {
 	bool f;
 
 	finfouil();
-	if (col)
+	if (g_col)
 		suj = 128;
 	else {
 		cx = 0;
 		do {
 			++cx;
-		} while (g_vm->_menu._discussMenu[cx] != msg[4]);
+		} while (g_vm->_menu._discussMenu[cx] != g_msg[4]);
 		caff = 69 + cx;
 		afdes(0);
 		repon(2, caff);
@@ -1377,11 +1377,13 @@ void fctDiscuss() {
 		do {
 			++icm;
 			g_vm->_screenSurface.putxy(co, lig);
-			if (s.teauto[icm] == '*')
+			if (g_s.teauto[icm] == '*') {
 				if (te[icm])
 					writetp(lib[icm], 1);
 				else
 					writetp(lib[icm], 0);
+			}
+
 			if (icm == 23)  {
 				lig = 0;
 				co = 320;
@@ -1396,7 +1398,7 @@ void fctDiscuss() {
 			CHECK_QUIT;
 
 			getMousePos(x, y, c);
-			x = x * (3 - res);
+			x *= (3 - res);
 			if (x > 319)
 				cx = 41;
 			else
@@ -1435,7 +1437,7 @@ void fctDiscuss() {
 							writetp(lib[choi], 1);
 						te[choi] = ! te[choi];
 					}
-					if ((s.teauto[ix] == '*') || (ix == 46)) {
+					if ((g_s.teauto[ix] == '*') || (ix == 46)) {
 						lig = ((ix - 1) % 23) << 3;
 						if (ix > 23)
 							co = 320;
@@ -1456,9 +1458,9 @@ void fctDiscuss() {
 		g_vm->setMouseClick(false);
 		if (choi != 46) {
 			int ix = choi - 1;
-			if (col) {
-				col = false;
-				s.mlieu = 15;
+			if (g_col) {
+				g_col = false;
+				g_s.mlieu = 15;
 				if (iouv > 0)
 					max = 8;
 				else
@@ -1468,14 +1470,14 @@ void fctDiscuss() {
 					suj = 129;
 				else {
 					suj = 138;
-					s.conf = s.conf + (3 * (s.conf / 10));
+					g_s.conf += (3 * (g_s.conf / 10));
 				}
 			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
 				suj = tabdon[arep + (ix << 3) + (caff - 70)];
-				s.conf += tabdon[arcf + ix];
+				g_s.conf += tabdon[arcf + ix];
 				++nbrep[caff - 69];
 			} else {
-				s.conf += 3;
+				g_s.conf += 3;
 				suj = 139;
 			}
 			hideMouse();
@@ -1484,32 +1486,32 @@ void fctDiscuss() {
 			sparl(0, suj);
 			showMouse();
 			if ((suj == 84) || (suj == 86)) {
-				s.pourc[5] = '*';
-				s.teauto[7] = '*';
+				g_s.pourc[5] = '*';
+				g_s.teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
 				for (int indx = 29; indx <= 31; ++indx)
-					s.teauto[indx] = '*';
-				s.pourc[7] = '*';
+					g_s.teauto[indx] = '*';
+				g_s.pourc[7] = '*';
 			}
 			if (suj == 70) {
-				s.pourc[8] = '*';
-				s.teauto[32] = '*';
+				g_s.pourc[8] = '*';
+				g_s.teauto[32] = '*';
 			}
 			hideMouse();
 			hirs();
 			showMouse();
 		}
 	} while ((choi != 46) && (suj != 138));
-	if (col) {
-		s.conf = s.conf + (3 * (s.conf / 10));
+	if (g_col) {
+		g_s.conf += (3 * (g_s.conf / 10));
 		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 138);
 		showMouse();
-		col = false;
-		s.mlieu = 15;
+		g_col = false;
+		g_s.mlieu = 15;
 	}
 	ctrm = 0;
 	hideMouse();
@@ -1521,7 +1523,7 @@ void fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	tmlieu(s.mlieu);
+	tmlieu(g_s.mlieu);
 	clsf3();
 }
 
@@ -1540,7 +1542,7 @@ void fctSmell() {
 				crep = 153;
 	} else if (caff == 123)
 		crep = 110;
-	num = 0;
+	g_num = 0;
 }
 
 /**
@@ -1554,7 +1556,7 @@ void fctScratch() {
 			ecr3(g_vm->getEngineString(S_SCRATCH));
 		tfleche();
 	}
-	num = 0;
+	g_num = 0;
 }
 
 /**
@@ -1608,9 +1610,9 @@ void MortevielleEngine::loseGame() {
 	vh = 10;
 	vm = 0;
 	vj = 0;
-	_minute = 0;
-	_hour = 10;
-	_day = 0;
+	g_minute = 0;
+	g_hour = 10;
+	g_day = 0;
 	repon(2, 180);
 	answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 9d7ea2f..fec8b2f 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -326,7 +326,8 @@ bool Ques::show() {
 		optionPosY = 35;
 		maxLength = 0;
 
-		for (int j = firstOption, prevChoice = 1; j <= lastOption; ++j, ++prevChoice) {
+		prevChoice = 1;
+		for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
 			tmpStr = deline(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
@@ -369,16 +370,16 @@ bool Ques::show() {
 				++currChoice;
 			if (coor[currChoice].enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
-					Common::String tmpStr = choiceArray[prevChoice] + '$';
+					tmpStr = choiceArray[prevChoice] + '$';
 					afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
 				if (prevChoice != currChoice) {
-					Common::String tmpStr = choiceArray[currChoice] + '$';
+					tmpStr = choiceArray[currChoice] + '$';
 					afftex(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
 					prevChoice = currChoice;
 				}
 			} else if (prevChoice != 0) {
-				Common::String tmpStr = choiceArray[prevChoice] + '$';
+				tmpStr = choiceArray[prevChoice] + '$';
 				afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				prevChoice = 0;
 			}
@@ -438,15 +439,15 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
 		parole(SpeechNum, 0, 0);
-		waitForF3F8(key);
+		waitForF3F8(g_key);
 		CHECK_QUIT;
 
-		if (_newGraphicalDevice != _currGraphicalDevice) {
-			_currGraphicalDevice = _newGraphicalDevice;
+		if (g_newGraphicalDevice != g_currGraphicalDevice) {
+			g_currGraphicalDevice = g_newGraphicalDevice;
 			hirs();
 			aff50(drawAni50Fl);
 		}
-	} while (key != 66); // keycode for F8
+	} while (g_key != 66); // keycode for F8
 }
 
 /**
@@ -462,7 +463,7 @@ void f3f8::waitForF3F8(int &key) {
 
 void f3f8::aff50(bool drawAni50Fl) {
 	caff = 50;
-	_maff = 0;
+	g_maff = 0;
 	taffich();
 	dessine(ades, 63, 12);
 	if (drawAni50Fl)
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 0cf22b3..d6ebe98 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -42,7 +42,7 @@ int testou() {
 
 	switch (ch)  {
 	case '\23' :
-		_soundOff = !_soundOff;
+		g_soundOff = !g_soundOff;
 		break;
 	case '\26' :
 		if ((c_zzz == 1) || (c_zzz == 2)) {
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index f90e1aa..5030da9 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -68,7 +68,7 @@ void outbloc(int n, pattern p, t_nhom pal) {
 void writepal(int n) {
 	t_nhom pal;
 
-	switch (_currGraphicalDevice) {
+	switch (g_currGraphicalDevice) {
 	case MODE_TANDY:
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
@@ -96,7 +96,7 @@ void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&mem[seg * 16 + dep]);
 
-	if (_currGraphicalDevice == MODE_HERCULES) {
+	if (g_currGraphicalDevice == MODE_HERCULES) {
 		mem[0x7000 * 16 + 2] = 0;
 		mem[0x7000 * 16 + 32] = 15;
 	}
@@ -109,13 +109,13 @@ void pictout(int seg, int dep, int x, int y) {
 
 void sauvecr(int y, int dy) {
 	hideMouse();
-	s_sauv(_currGraphicalDevice, y, dy);
+	s_sauv(g_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
 void charecr(int y, int dy) {
 	hideMouse();
-	s_char(_currGraphicalDevice, y, dy);
+	s_char(g_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 6ff9716..998b70f 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -154,7 +154,7 @@ void Menu::displayMenu() {
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * res;
-	if (_currGraphicalDevice == MODE_CGA)
+	if (g_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
 		color = 9;
@@ -456,8 +456,8 @@ void Menu::mdn() {
 			//  A menu was clicked on
 			choisi = (test0) && (msg4 != OPCODE_NONE);
 			menuUp(msg3);
-			msg[4] = msg4;
-			msg[3] = msg3;
+			g_msg[4] = msg4;
+			g_msg[3] = msg3;
 			msg3 = OPCODE_NONE;
 			msg4 = OPCODE_NONE;
 
@@ -513,8 +513,8 @@ void Menu::initMenu() {
 	}
 	msg3 = OPCODE_NONE;
 	msg4 = OPCODE_NONE;
-	msg[3] = OPCODE_NONE;
-	msg[4] = OPCODE_NONE;
+	g_msg[3] = OPCODE_NONE;
+	g_msg[4] = OPCODE_NONE;
 	g_vm->setMouseClick(false);
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 8b99fcc..d3eb248 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -114,7 +114,7 @@ void dessine(int ad, int x, int y) {
 
 void dessine_rouleau() {
 	writepal(89);
-	if (_currGraphicalDevice == MODE_HERCULES) {
+	if (g_currGraphicalDevice == MODE_HERCULES) {
 		mem[0x7000 * 16 + 14] = 15;
 	}
 	hideMouse();
@@ -236,11 +236,11 @@ void clsf10() {
 		cod = 544;
 	}
 	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (s.conf < 33)
+	if (g_s.conf < 33)
 		st = g_vm->getEngineString(S_COOL);
-	else if (s.conf < 66)
+	else if (g_s.conf < 66)
 		st = g_vm->getEngineString(S_LOURDE);
-	else if (s.conf > 65)
+	else if (g_s.conf > 65)
 		st = g_vm->getEngineString(S_MALSAINE);
 	
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
@@ -259,7 +259,7 @@ void clsf10() {
 
 void stop() {
 	hirs();
-	_currGraphicalDevice = MODE_AMSTRAD1512;
+	g_currGraphicalDevice = MODE_AMSTRAD1512;
 	hirs();
 	g_vm->quitGame();
 }
@@ -267,7 +267,7 @@ void stop() {
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
-	if (_currGraphicalDevice == MODE_CGA)
+	if (g_currGraphicalDevice == MODE_CGA)
 		co = 3;
 	else
 		co = 11;
@@ -280,7 +280,7 @@ int hazard(int min, int max) {
 
 void calch(int &j, int &h, int &m) {
 	int nh = readclock();
-	int th = jh + ((nh - mh) / t);
+	int th = jh + ((nh - mh) / g_t);
 	m = ((th % 2) + vm) * 30;
 	h = ((uint)th >> 1) + vh;
 	if (m == 60) {
@@ -357,12 +357,12 @@ void repon(int f, int m) {
 			ecrf2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
-				s.teauto[40] = '*';
+				g_s.teauto[40] = '*';
 			if ((m == 104) && (caff == 14)) {
-				s.teauto[36] = '*';
-				if (s.teauto[39] == '*') {
-					s.pourc[3] = '*';
-					s.teauto[38] = '*';
+				g_s.teauto[36] = '*';
+				if (g_s.teauto[39] == '*') {
+					g_s.pourc[3] = '*';
+					g_s.teauto[38] = '*';
 				}
 			}
 		}
@@ -377,10 +377,10 @@ void repon(int f, int m) {
 			afftex(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
-				s.pourc[6] = '*';
+				g_s.pourc[6] = '*';
 
 			if (m == 179)
-				s.pourc[10] = '*';
+				g_s.pourc[10] = '*';
 		}
 		if (f == 7) {         /* messint */
 			ecrf7();
@@ -635,17 +635,17 @@ void drawClock() {
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
-	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
+	if ((g_currGraphicalDevice == MODE_CGA) || (g_currGraphicalDevice == MODE_HERCULES))
 		co = 0;
 	else
 		co = 1;
 
-	if (_minute == 0)
+	if (g_minute == 0)
 		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
 	else 
 		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
 
-	h = _hour;
+	h = g_hour;
 	if (h > 12)
 		h -= 12;
 	if (h == 0)
@@ -655,15 +655,15 @@ void drawClock() {
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 
-	if (_hour > 11)
+	if (g_hour > 11)
 		g_vm->_screenSurface.writeg("PM ", 1);
 	else
 		g_vm->_screenSurface.writeg("AM ", 1);
 
 	g_vm->_screenSurface.putxy(550, 160);
-	if ((_day >= 0) && (_day <= 8)) {
+	if ((g_day >= 0) && (g_day <= 8)) {
 		Common::String tmp = g_vm->getEngineString(S_DAY);
-		tmp.insertChar((char)(_day + 49), 0);
+		tmp.insertChar((char)(g_day + 49), 0);
 		g_vm->_screenSurface.writeg(tmp, 1);
 	}
 }
@@ -673,9 +673,9 @@ void drawClock() {
  *************/
 
 void debloc(int l) {
-	num = 0;
+	g_num = 0;
 	g_x = 0;
-	y = 0;
+	g_y = 0;
 	if ((l != 26) && (l != 15))
 		t5(l);
 	mpers = ipers;
@@ -1033,46 +1033,44 @@ void phaz(int &haz, int &p, int cf) {
 }
 
 void inzon() {
-	int cx;
-
 	copcha();
 
-	s.ipre  = false;
-	s.derobj = 0;
-	s.icave = 0;
-	s.iboul = 0;
-	s.ibag  = 0;
-	s.ipuit = 0;
-	s.ivier = 0;
-	s.iloic = 136;
-	s.icryp = 141;
-	s.conf  = hazard(4, 10);
-	s.mlieu = 21;
+	g_s.ipre  = false;
+	g_s.derobj = 0;
+	g_s.icave = 0;
+	g_s.iboul = 0;
+	g_s.ibag  = 0;
+	g_s.ipuit = 0;
+	g_s.ivier = 0;
+	g_s.iloic = 136;
+	g_s.icryp = 141;
+	g_s.conf  = hazard(4, 10);
+	g_s.mlieu = 21;
 
-	for (cx = 2; cx <= 6; ++cx)
-		s.sjer[cx] = chr(0);
+	for (int cx = 2; cx <= 6; ++cx)
+		g_s.sjer[cx] = chr(0);
 
-	s.sjer[1] = chr(113);
-	s.heure = chr(20);
+	g_s.sjer[1] = chr(113);
+	g_s.heure = chr(20);
 
-	for (cx = 1; cx <= 10; ++cx)
-		s.pourc[cx] = ' ';
+	for (int cx = 1; cx <= 10; ++cx)
+		g_s.pourc[cx] = ' ';
 
-	for (cx = 1; cx <= 6; ++cx)
-		s.teauto[cx] = '*';
+	for (int cx = 1; cx <= 6; ++cx)
+		g_s.teauto[cx] = '*';
 
-	for (cx = 7; cx <= 9; ++cx)
-		s.teauto[cx] = ' ';
+	for (int cx = 7; cx <= 9; ++cx)
+		g_s.teauto[cx] = ' ';
 
-	for (cx = 10; cx <= 28; ++cx)
-		s.teauto[cx] = '*';
+	for (int cx = 10; cx <= 28; ++cx)
+		g_s.teauto[cx] = '*';
 
-	for (cx = 29; cx <= 42; ++cx)
-		s.teauto[cx] = ' ';
+	for (int cx = 29; cx <= 42; ++cx)
+		g_s.teauto[cx] = ' ';
 
-	s.teauto[33] = '*';
+	g_s.teauto[33] = '*';
 
-	for (cx = 1; cx <= 8; ++cx)
+	for (int cx = 1; cx <= 8; ++cx)
 		nbrep[cx] = 0;
 
 	init_nbrepm();
@@ -1081,9 +1079,9 @@ void inzon() {
 void dprog() {
 	li = 21;
 	jh = 0;
-	if (! s.ipre)
+	if (!g_s.ipre)
 		blo = true;
-	t = ti1;
+	g_t = ti1;
 	mh = readclock();
 }
 
@@ -1221,7 +1219,7 @@ void pl20(int cf) {
 void t11(int l11, int &a) {
 	int p, haz;
 
-	ecfren(p, haz, s.conf, l11);
+	ecfren(p, haz, g_s.conf, l11);
 	li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
@@ -1253,7 +1251,7 @@ void t11(int l11, int &a) {
 				cpl15(p);
 			if (l11 == 20)
 				cpl20(p, h);
-			p = p + s.conf;
+			p += g_s.conf;
 			haz = hazard(1, 100);
 			if (haz > p) {
 				person();
@@ -1276,20 +1274,17 @@ void t11(int l11, int &a) {
 }
 
 void cavegre() {
-	int haz;
-
-	s.conf = s.conf + 2;
-	if (s.conf > 69)
-		s.conf += (s.conf / 10);
+	g_s.conf += 2;
+	if (g_s.conf > 69)
+		g_s.conf += (g_s.conf / 10);
 	clsf3();
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
-	haz = (hazard(0, 4)) - 2;
+	int haz = (hazard(0, 4)) - 2;
 	parole(2, haz, 1);
 
-	// Useless?
-	for (haz = 0; haz <= 3000; ++haz)
-		;
+	// The original was doing here a useless loop.
+	// It has been removed
 
 	clsf3();
 	person();
@@ -1340,12 +1335,12 @@ void musique(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((prebru == 0) && (! s.ipre)) {
+	} else if ((prebru == 0) && (!g_s.ipre)) {
 		parole(10, 1, 1);
 		++prebru;
 	} else {
 		bool i = false;
-		if ((s.mlieu == 19) || (s.mlieu == 21) || (s.mlieu == 22)) {
+		if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22)) {
 			int haz = hazard(1, 3);
 			if (haz == 2) {
 				haz = hazard(2, 4);
@@ -1353,21 +1348,23 @@ void musique(int so) {
 				i = true;
 			}
 		}
-		if (s.mlieu == 20) {
+		if (g_s.mlieu == 20) {
 			int haz = hazard(1, 2);
 			if (haz == 1) {
 				parole(8, 1, 1);
 				i = true;
 			}
 		}
-		if (s.mlieu == 24) {
+
+		if (g_s.mlieu == 24) {
 			int haz = hazard(1, 2);
 			if (haz == 2) {
 				parole(12, 1, 1);
 				i = true;
 			}
 		}
-		if (s.mlieu == 23) {
+
+		if (g_s.mlieu == 23) {
 			parole(13, 1, 1);
 			i = true;
 		}
@@ -1400,19 +1397,19 @@ void dessin(int ad) {
 				}
 
 				if (caff == 13) {
-					if (s.iboul == 141)
+					if (g_s.iboul == 141)
 						aniof(1, 7);
 
-					if (s.ibag == 159)
+					if (g_s.ibag == 159)
 						aniof(1, 6);
 				}
-				if ((caff == 14) && (s.icave == 151))
+				if ((caff == 14) && (g_s.icave == 151))
 					aniof(1, 2);
 
-				if ((caff == 17) && (s.ivier == 143))
+				if ((caff == 17) && (g_s.ivier == 143))
 					aniof(1, 1);
 
-				if ((caff == 24) && (s.ipuit != 0))
+				if ((caff == 24) && (g_s.ipuit != 0))
 					aniof(1, 1);
 			}
 			
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 8edafa8..42e1d0f 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -51,8 +51,8 @@ void tinke() {
 
 	anyone = false;
 	calch(j, h, m);
-	if (j != _day) {
-		_day = j;
+	if (j != g_day) {
+		g_day = j;
 		cx = 0;
 		do {
 			++cx;
@@ -61,13 +61,13 @@ void tinke() {
 			nbrep[cx] = 0;
 		} while (cx != 8);
 	}
-	if ((h > _hour) || ((h == 0) && (_hour == 23))) {
-		_hour = h;
-		_minute = 0;
+	if ((h > g_hour) || ((h == 0) && (g_hour == 23))) {
+		g_hour = h;
+		g_minute = 0;
 		drawClock();
 		cf = 0;
 		for (cx = 1; cx <= 10; ++cx) {
-			if (s.pourc[cx] == '*')
+			if (g_s.pourc[cx] == '*')
 				++cf;
 		}
 
@@ -89,8 +89,8 @@ void tinke() {
 		_hintPctMessage += d6;
 		_hintPctMessage += d4;
 	}
-	if (m > _minute) {
-		_minute = 30;
+	if (m > g_minute) {
+		g_minute = 30;
 		drawClock();
 	}
 	if (y_s < 12)
@@ -98,21 +98,21 @@ void tinke() {
 
 	if (! blo) {
 		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
-			t = ti2;
+			g_t = ti2;
 		else
-			t = ti1;
-		cf = s.conf;
+			g_t = ti1;
+		cf = g_s.conf;
 		if ((cf > 33) && (cf < 66))
-			t -= (t / 3);
+			g_t -= (g_t / 3);
 
 		if (cf > 65)
-			t -= ((t / 3) * 2);
+			g_t -= ((g_t / 3) * 2);
 
 		int nh = readclock();
-		if ((nh - mh) > t) {
+		if ((nh - mh) > g_t) {
 			bool activeMenu = g_vm->_menu._menuActive;
 			g_vm->_menu.eraseMenu();
-			jh += ((nh - mh) / t);
+			jh += ((nh - mh) / g_t);
 			mh = nh;
 			switch (li) {
 			case 1:
@@ -157,7 +157,7 @@ void tinke() {
 				mpers = ipers;
 
 			if ((mpers == 0) && (ipers > 0)) {
-				if ((s.mlieu == 13) || (s.mlieu == 14)) {
+				if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) {
 					cavegre();
 				} else if (ipers == 10) {
 					ipers = 0;
@@ -186,7 +186,7 @@ void tinke() {
 		nouvp(li, cx);
 		brt = false;
 		hdb = 0;
-		if ((s.mlieu > 0) && (s.mlieu < 10))
+		if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
 			anyone = true;
 	}
 }
@@ -195,9 +195,9 @@ void fenat(char ans) {
 	int coul;
 
 	hideMouse();
-	if (_currGraphicalDevice == MODE_CGA)
+	if (g_currGraphicalDevice == MODE_CGA)
 		coul = 2;
-	else if (_currGraphicalDevice == MODE_HERCULES)
+	else if (g_currGraphicalDevice == MODE_HERCULES)
 		coul = 1;
 	else
 		coul = 12;
@@ -222,7 +222,7 @@ void tkey1(bool d) {
 	hideMouse();
 	fenat('K');
 	while (keypressed())
-		key = testou();
+		g_key = testou();
 
 	do {
 		if (d)
@@ -265,20 +265,18 @@ void tlu(int af, int ob) {
 	repon(2, 999);
 	tkey1(true);
 	caff = af;
-	msg[3] = OPCODE_NONE;
+	g_msg[3] = OPCODE_NONE;
 	crep = 998;
 }
 
 void affrep() {
-	caff = s.mlieu;
-	crep = s.mlieu;
+	caff = g_s.mlieu;
+	crep = g_s.mlieu;
 }
 
 void mfouen() {
-	int cx;
-
-	tmlieu(s.mlieu);
-	for (cx = 1; cx <= 11; ++cx)
+	tmlieu(g_s.mlieu);
+	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
 
 	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
@@ -304,18 +302,18 @@ void tperd() {
 	repon(9, crep);
 	clsf2();
 	clsf3();
-	col = false;
+	g_col = false;
 	syn = false;
 	okdes = false;
 }
 
 void tsort() {
 
-	if ((iouv > 0) && (s.mlieu != 0)) {
-		if (s.conf < 50)
-			s.conf += 2;
+	if ((iouv > 0) && (g_s.mlieu != 0)) {
+		if (g_s.conf < 50)
+			g_s.conf += 2;
 		else
-			s.conf += (s.conf / 10);
+			g_s.conf += (g_s.conf / 10);
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
@@ -323,7 +321,7 @@ void tsort() {
 	ment = 0;
 	iouv = 0;
 	mchai = 0;
-	debloc(s.mlieu);
+	debloc(g_s.mlieu);
 }
 
 void st4(int ob) {
@@ -361,14 +359,14 @@ void cherjer(int ob, bool &d) {
 
 	d = false;
 	for (cx = 1; cx <= 6; ++cx)
-		d = (d || (ord(s.sjer[cx]) == ob));
+		d = (d || (ord(g_s.sjer[cx]) == ob));
 
-	if (s.derobj == ob)
+	if (g_s.derobj == ob)
 		d = true;
 }
 
 void st1sama() {
-	s.mlieu = 10;
+	g_s.mlieu = 10;
 	affrep();
 }
 
@@ -378,9 +376,9 @@ void modinv() {
 
 	int cy = 0;
 	for (int cx = 1; cx <= 6; ++cx)
-		if (s.sjer[cx] != chr(0)) {
+		if (g_s.sjer[cx] != chr(0)) {
 			++cy;
-			r = (ord(s.sjer[cx]) + 400);
+			r = (ord(g_s.sjer[cx]) + 400);
 			nomp = deline(r - 501 + c_st41);
 			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
@@ -432,7 +430,7 @@ void mfoudi() {
 }
 
 void mennor() {
-	g_vm->_menu.menuUp(msg[3]);
+	g_vm->_menu.menuUp(g_msg[3]);
 }
 
 void premtet() {
@@ -449,7 +447,7 @@ void ajchai() {
 	} while ((cx <= 9) && (tabdon[cy + cx] != 0));
 
 	if (tabdon[cy + cx] == 0) {
-		int lderobj = s.derobj;
+		int lderobj = g_s.derobj;
 		tabdon[cy + cx] = lderobj;
 	} else
 		crep = 192;
@@ -459,10 +457,10 @@ void ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 5) && (ord(s.sjer[cx]) != 0));
+	} while ((cx <= 5) && (ord(g_s.sjer[cx]) != 0));
 
-	if (ord(s.sjer[cx]) == 0) {
-		s.sjer[(cx)] = chr(ob);
+	if (ord(g_s.sjer[cx]) == 0) {
+		g_s.sjer[(cx)] = chr(ob);
 		modinv();
 	} else
 		crep = 139;
@@ -472,7 +470,7 @@ void t1sama() {    //Entering manor
 	int j, h, m;
 
 	calch(j, h, m);
-	if ((h < 5) && (s.mlieu > 18)) {
+	if ((h < 5) && (g_s.mlieu > 18)) {
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
@@ -480,7 +478,7 @@ void t1sama() {    //Entering manor
 			tperd();
 		} else
 			st1sama();
-	} else if (!s.ipre) {     //Is it your first time?
+	} else if (!g_s.ipre) {     //Is it your first time?
 		ipers = 255;
 		affper(ipers);
 		caff = 77;
@@ -496,21 +494,21 @@ void t1sama() {    //Entering manor
 		dessine_rouleau();
 		drawClock();
 		showMouse();
-		s.mlieu = 0;
+		g_s.mlieu = 0;
 		affrep();
 		t5(10);
 		if (! blo)
 			t11(0, m);
 		ipers = 0;
 		mpers = 0;
-		s.ipre = true;
+		g_s.ipre = true;
 		/*chech;*/
 	} else
 		st1sama();
 }
 
 void t1vier() {
-	s.mlieu = 17;
+	g_s.mlieu = 17;
 	affrep();
 }
 
@@ -521,19 +519,19 @@ void t1neig() {
 		tperd();
 	} else {
 		okdes = true;
-		s.mlieu = 19;
+		g_s.mlieu = 19;
 		affrep();
 	}
 }
 
 void t1deva() {
 	inei = 0;
-	s.mlieu = 21;
+	g_s.mlieu = 21;
 	affrep();
 }
 
 void t1derr() {
-	s.mlieu = 22;
+	g_s.mlieu = 22;
 	affrep();
 }
 
@@ -565,21 +563,21 @@ L1:
 			parole(4, 4, 1);
 
 		if (iouv == 0)
-			s.conf += 2;
-		else if (s.conf < 50)
-			s.conf += 4;
+			g_s.conf += 2;
+		else if (g_s.conf < 50)
+			g_s.conf += 4;
 		else
-			s.conf += 3 * (s.conf / 10);
+			g_s.conf += 3 * (g_s.conf / 10);
 		tsort();
 		tmlieu(15);
 		int cx;
 		tip(ipers, cx);
 		caff = 69 + cx;
 		crep = caff;
-		msg[3] = MENU_DISCUSS;
-		msg[4] = g_vm->_menu._discussMenu[cx];
+		g_msg[3] = MENU_DISCUSS;
+		g_msg[4] = g_vm->_menu._discussMenu[cx];
 		syn = true;
-		col = true;
+		g_col = true;
 	} else {
 		int haz = hazard(1, 3);
 		if (haz == 2) {
@@ -618,7 +616,7 @@ void tsuiv() {
 		caff = tbcl;
 		crep = caff + 400;
 		if (ipers != 0)
-			s.conf = s.conf + 2;
+			g_s.conf = g_s.conf + 2;
 	} else {
 		affrep();
 		finfouil();
@@ -631,7 +629,7 @@ void tfleche() {
 	bool qust;
 	char touch;
 
-	if (num == 9999)
+	if (g_num == 9999)
 		return;
 
 	fenat(chr(152));
@@ -650,14 +648,14 @@ void tfleche() {
 
 		if (qust && (touch == '\103'))
 			Alert::show(_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (y != 0)) || (anyone) || (rect)));
+	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (anyone) || (rect)));
 
 	if (touch == '\73')
 		iesc = true;
 
 	if (rect) {
 		g_x = x_s;
-		y = y_s;
+		g_y = y_s;
 	}
 }
 
@@ -666,7 +664,7 @@ void tcoord(int sx) {
 	int ib;
 
 
-	num = 0;
+	g_num = 0;
 	crep = 999;
 	int a = 0;
 	int atdon = amzon + 3;
@@ -703,10 +701,10 @@ void tcoord(int sx) {
 		ix = tabdon[a + cb] * res;
 		iy = tabdon[(a + cb + 1)];
 		++cy;
-	} while (!(((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) || (cy > ib)));
+	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
 
-	if ((g_x >= sx) && (g_x <= ix) && (y >= sy) && (y <= iy)) {
-		num = cy - 1;
+	if ((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) {
+		g_num = cy - 1;
 		return;
 	}
 
@@ -740,7 +738,7 @@ void treg(int ob) {
 	int mdes = caff;
 	caff = ob;
 
-	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (msg[4] == OPCODE_SLOOK)) {
+	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
 		afdes(0);
 		if ((caff > 29) && (caff < 33))
 			repon(2, caff);
@@ -748,7 +746,7 @@ void treg(int ob) {
 			repon(2, (caff + 400));
 		tkey1(true);
 		caff = mdes;
-		msg[3] = 0;
+		g_msg[3] = 0;
 		crep = 998;
 	} else {
 		obpart = true;
@@ -759,22 +757,22 @@ void treg(int ob) {
 
 void avpoing(int &ob) {
 	crep = 999;
-	if (s.derobj != 0)
-		ajjer(s.derobj);
+	if (g_s.derobj != 0)
+		ajjer(g_s.derobj);
 
 	if (crep != 139) {
 		modobj(ob + 400);
-		s.derobj = ob;
+		g_s.derobj = ob;
 		ob = 0;
 	}
 }
 
 void rechai(int &ch) {
-	int cx = s.mlieu;
+	int cx = g_s.mlieu;
 
-	if (s.mlieu == 16)
+	if (g_s.mlieu == 16)
 		cx = 14;
-	ch = tabdon[achai + (cx * 7) + num - 1];
+	ch = tabdon[achai + (cx * 7) + g_num - 1];
 }
 
 void t23coul(int &l) {
@@ -789,7 +787,7 @@ void t23coul(int &l) {
 }
 
 void maivid() {
-	s.derobj = 0;
+	g_s.derobj = 0;
 	modobj(500);
 }
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 5063166..7d0e7bc 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -121,7 +121,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	_currGraphicalDevice = MODE_EGA;
+	g_currGraphicalDevice = MODE_EGA;
 	res = 2;
 
 	_txxFileFl = false;
@@ -142,8 +142,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	_currGraphicalDevice = MODE_EGA;
-	_newGraphicalDevice = _currGraphicalDevice;
+	g_currGraphicalDevice = MODE_EGA;
+	g_newGraphicalDevice = g_currGraphicalDevice;
 	zuul = false;
 	tesok = false;
 	charpal();
@@ -155,15 +155,15 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	initMouse();
 
 	init_lieu();
-	_soundOff = false;
+	g_soundOff = false;
 	f2_all = false;
 
 	teskbd();
 	dialpre();
-	_newGraphicalDevice = _currGraphicalDevice;
+	g_newGraphicalDevice = g_currGraphicalDevice;
 	teskbd();
-	if (_newGraphicalDevice != _currGraphicalDevice)
-		_currGraphicalDevice = _newGraphicalDevice;
+	if (g_newGraphicalDevice != g_currGraphicalDevice)
+		g_currGraphicalDevice = g_newGraphicalDevice;
 	hirs();
 	ades = 0x7000;
 
@@ -558,7 +558,7 @@ void MortevielleEngine::handleAction() {
 		g_vm->_menu.drawMenu();
 		imen = true;
 		temps = 0;
-		key = 0;
+		g_key = 0;
 		funct = false;
 		inkey = '.';
 
@@ -578,24 +578,24 @@ void MortevielleEngine::handleAction() {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (choisi && (msg[3] == MENU_SAVE)) {
-			Common::String saveName = Common::String::format("Savegame #%d", msg[4] & 7);
-			g_vm->_savegameManager.saveGame(msg[4] & 7, saveName);
+		if (choisi && (g_msg[3] == MENU_SAVE)) {
+			Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7);
+			g_vm->_savegameManager.saveGame(g_msg[4] & 7, saveName);
 		}
-		if (choisi && (msg[3] == MENU_LOAD))
-			g_vm->_savegameManager.loadGame((msg[4] & 7) - 1);
+		if (choisi && (g_msg[3] == MENU_LOAD))
+			g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((mnumo != OPCODE_NONE) && ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF))) {
-				msg[4] = mnumo;
+			if ((mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
+				g_msg[4] = mnumo;
 				ecr3(g_vm->getEngineString(S_IDEM));
 			} else
 				return;
 		} else if (inkey == '\104') {
-			if ((g_x != 0) && (y != 0))
-				num = 9999;
+			if ((g_x != 0) && (g_y != 0))
+				g_num = 9999;
 			return;
 		}
 	}
@@ -607,22 +607,22 @@ void MortevielleEngine::handleAction() {
 			return;
 		if (temps > lim) {
 			repon(2, 141);
-			if (num == 9999)
-				num = 0;
+			if (g_num == 9999)
+				g_num = 0;
 		} else {
-			mnumo = msg[3];
-			if ((msg[3] == MENU_ACTION) || (msg[3] == MENU_SELF))
-				mnumo = msg[4];
+			mnumo = g_msg[3];
+			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
+				mnumo = g_msg[4];
 			if (! anyone) {
 				if ((fouil) || (obpart)) {
 					if (y_s < 12)
 						return;
 
-					if ((msg[4] == OPCODE_SOUND) || (msg[4] == OPCODE_LIFT)) {
+					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
 						oo = true;
-						if ((msg[4] == OPCODE_LIFT) || (obpart)) {
+						if ((g_msg[4] == OPCODE_LIFT) || (obpart)) {
 							finfouil();
-							caff = s.mlieu;
+							caff = g_s.mlieu;
 							crep = 998;
 						} else
 							tsuiv();
@@ -640,7 +640,7 @@ void MortevielleEngine::handleAction() {
 						okdes = false;
 						dessin(0);
 					}
-					if ((! syn) || (col))
+					if ((! syn) || (g_col))
 						repon(2, crep);
 				}
 			} while (syn);
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d607b05..9baae57 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -86,7 +86,7 @@ void hideMouse() {
 	if (mouse_shwn == 0) {
 		bool imp = odd(y_s);
 		int j = p_o_s;
-		switch (_currGraphicalDevice) {
+		switch (g_currGraphicalDevice) {
 		case MODE_CGA: {
 			int k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
@@ -183,7 +183,7 @@ void showMouse() {
 	j = p_o_s;
 	imp = odd(y_s);
 	i = x_s & 7;
-	switch (_currGraphicalDevice) {
+	switch (g_currGraphicalDevice) {
 	case MODE_CGA:
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
@@ -418,7 +418,7 @@ void moveMouse(bool &funct, char &key) {
 			cy = 8;
 			break;
 		case '\23':
-			_soundOff = !_soundOff;
+			g_soundOff = !g_soundOff;
 			return;
 			break;
 		case '\26':
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index e1374d4..7b2dcab 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -174,7 +174,7 @@ void music() {
 	bool fin;
 
 	/* debug('o3 music'); */
-	if (_soundOff)
+	if (g_soundOff)
 		return;
 
 	rech_cfiec = true;
@@ -244,8 +244,8 @@ void suite() {
 	caff = 51;
 	taffich();
 	teskbd();
-	if (_newGraphicalDevice != _currGraphicalDevice)
-		_currGraphicalDevice = _newGraphicalDevice;
+	if (g_newGraphicalDevice != g_currGraphicalDevice)
+		g_currGraphicalDevice = g_newGraphicalDevice;
 	hirs();
 	dessine(ades, 0, 0);
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 791bfd7..cbe460a 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -35,8 +35,8 @@ namespace Mortevielle {
 void spfrac(int wor) {
 	c3.rep = (uint)wor >> 12;
 	if ((typlec == 0) && (c3.code != 9))
-		if (((c3.code > 4) && (c3.val != 20) && ((c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
-				((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9))))) {
+		if (((c3.code > 4) && (c3.val != 20) && (c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
+				((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9)))) {
 			++c3.rep;
 		}
 
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 19b4419..2402e37 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -87,17 +87,17 @@ void parole(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
 
-	if (_soundOff)
+	if (g_soundOff)
 		return;
 
 	num_ph = rep;
-	haut = ht;
+	g_haut = ht;
 	typlec = typ;
 	if (typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
 			savph[i] = t_cph[i];
 		tempo = tempo_bruit;
-	} else if (haut > 5)
+	} else if (g_haut > 5)
 		tempo = tempo_f;
 	else
 		tempo = tempo_m;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 635140f..6dd8df1 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -45,7 +45,7 @@ namespace Mortevielle {
  */
 void changeGraphicalDevice(int newDevice) {
 	hideMouse();
-	_currGraphicalDevice = newDevice;
+	g_currGraphicalDevice = newDevice;
 	hirs();
 	initMouse();
 	showMouse();
@@ -58,7 +58,7 @@ void changeGraphicalDevice(int newDevice) {
 		person();
 	clsf2();
 	clsf3();
-	_maff = 68;
+	g_maff = 68;
 	afdes(0);
 	repon(2, crep);
 	g_vm->_menu.displayMenu();
@@ -82,21 +82,21 @@ void MortevielleEngine::gameLoaded() {
 	test[0] = false;
 	test[1] = false;
 	g[0] = '\040';
-	col = false;
+	g_col = false;
 	tesok = true;
 	test[2] = false;
 	g[7] = g[0];
 	g[2] = 'A';
 	cache = false;
 	brt = false;
-	_maff = 68;
+	g_maff = 68;
 	g[5] = 'E';
 	mnumo = 0;
 	prebru = 0;
 	g[4] = 'T';
 	g_x = 0;
-	y = 0;
-	num = 0;
+	g_y = 0;
+	g_num = 0;
 	hdb = 0;
 	hfb = 0;
 	cs = 0;
@@ -133,10 +133,10 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, crep);
 	clsf3();
 	_endGame = false;
-	tmlieu(s.mlieu);
+	tmlieu(g_s.mlieu);
 	modinv();
-	if (s.derobj != 0)
-		modobj2(s.derobj + 400, test[1], test[2]);
+	if (g_s.derobj != 0)
+		modobj2(g_s.derobj + 400, test[1], test[2]);
 	else
 		tesok = test[1] || test[2];
 	showMouse();
@@ -153,82 +153,82 @@ void tmaj3() {
 		m = 1;
 	h += j * 24;
 	m += h * 2;
-	s.heure = chr(m);
+	g_s.heure = chr(m);
 }
 
 void tsitu() {
 	int h, j, m;
 
-	if (! col)
+	if (!g_col)
 		clsf2();
 	syn = false;
 	iesc = false;
 	if (!anyone) {
 		if (brt)
-			if ((msg[3] == MENU_MOVE) || (msg[4] == OPCODE_LEAVE) || (msg[4] == OPCODE_SLEEP) || (msg[4] == OPCODE_EAT)) {
+			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
 				ctrm = 4;
 				mennor();
 				return;
 			}
-		if (msg[3] == MENU_MOVE)
+		if (g_msg[3] == MENU_MOVE)
 			fctMove();
-		if (msg[3] == MENU_DISCUSS)
+		if (g_msg[3] == MENU_DISCUSS)
 			fctDiscuss();
-		if (msg[3] == MENU_INVENTORY)
+		if (g_msg[3] == MENU_INVENTORY)
 			fctInventoryTake();
-		if (msg[4] == OPCODE_ATTACH)
+		if (g_msg[4] == OPCODE_ATTACH)
 			fctAttach();
-		if (msg[4] == OPCODE_WAIT)
+		if (g_msg[4] == OPCODE_WAIT)
 			fctWait();
-		if (msg[4] == OPCODE_FORCE)
+		if (g_msg[4] == OPCODE_FORCE)
 			fctForce();
-		if (msg[4] == OPCODE_SLEEP)
+		if (g_msg[4] == OPCODE_SLEEP)
 			fctSleep();
-		if (msg[4] == OPCODE_LISTEN)
+		if (g_msg[4] == OPCODE_LISTEN)
 			fctListen();
-		if (msg[4] == OPCODE_ENTER)
+		if (g_msg[4] == OPCODE_ENTER)
 			fctEnter();
-		if (msg[4] == OPCODE_CLOSE)
+		if (g_msg[4] == OPCODE_CLOSE)
 			fctClose();
-		if (msg[4] == OPCODE_SEARCH)
+		if (g_msg[4] == OPCODE_SEARCH)
 			fctSearch();
-		if (msg[4] == OPCODE_KNOCK)
+		if (g_msg[4] == OPCODE_KNOCK)
 			fctKnock();
-		if (msg[4] == OPCODE_SCRATCH)
+		if (g_msg[4] == OPCODE_SCRATCH)
 			fctScratch();
-		if (msg[4] == OPCODE_READ)
+		if (g_msg[4] == OPCODE_READ)
 			fctRead();
-		if (msg[4] == OPCODE_EAT)
+		if (g_msg[4] == OPCODE_EAT)
 			fctEat();
-		if (msg[4] == OPCODE_PLACE)
+		if (g_msg[4] == OPCODE_PLACE)
 			fctPlace();
-		if (msg[4] == OPCODE_OPEN)
+		if (g_msg[4] == OPCODE_OPEN)
 			fctOpen();
-		if (msg[4] == OPCODE_TAKE)
+		if (g_msg[4] == OPCODE_TAKE)
 			fctTake();
-		if (msg[4] == OPCODE_LOOK)
+		if (g_msg[4] == OPCODE_LOOK)
 			fctLook();
-		if (msg[4] == OPCODE_SMELL)
+		if (g_msg[4] == OPCODE_SMELL)
 			fctSmell();
-		if (msg[4] == OPCODE_SOUND)
+		if (g_msg[4] == OPCODE_SOUND)
 			fctSound();
-		if (msg[4] == OPCODE_LEAVE)
+		if (g_msg[4] == OPCODE_LEAVE)
 			fctLeave();
-		if (msg[4] == OPCODE_LIFT)
+		if (g_msg[4] == OPCODE_LIFT)
 			fctLift();
-		if (msg[4] == OPCODE_TURN)
+		if (g_msg[4] == OPCODE_TURN)
 			fctTurn();
-		if (msg[4] == OPCODE_SSEARCH)
+		if (g_msg[4] == OPCODE_SSEARCH)
 			fctSelfSearch();
-		if (msg[4] == OPCODE_SREAD)
+		if (g_msg[4] == OPCODE_SREAD)
 			fctSelfRead();
-		if (msg[4] == OPCODE_SPUT)
+		if (g_msg[4] == OPCODE_SPUT)
 			fctSelfPut();
-		if (msg[4] == OPCODE_SLOOK)
+		if (g_msg[4] == OPCODE_SLOOK)
 			fctSelftLook();
 		cache = false;
 
-		if (msg[4] == OPCODE_SHIDE)
+		if (g_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
 		if (anyone) {
@@ -239,16 +239,16 @@ void tsitu() {
 		}
 	}
 	calch(j, h, m);
-	if ((((h == 12) || (h == 13) || (h == 19)) && (s.mlieu != 10)) ||
-	        ((h > 0) && (h < 6) && (s.mlieu != 0)))
-		s.conf = s.conf + 1;
-	if (((s.mlieu < 16) || (s.mlieu > 19)) && (s.mlieu != 23)
-	        && (s.mlieu != 0) && (s.derobj != 152) && (!g_vm->_loseGame)) {
-		if ((s.conf > 99) && (h > 8) && (h < 16)) {
+	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s.mlieu != 10)) ||
+	        ((h > 0) && (h < 6) && (g_s.mlieu != 0)))
+		++g_s.conf;
+	if (((g_s.mlieu < 16) || (g_s.mlieu > 19)) && (g_s.mlieu != 23)
+	        && (g_s.mlieu != 0) && (g_s.derobj != 152) && (!g_vm->_loseGame)) {
+		if ((g_s.conf > 99) && (h > 8) && (h < 16)) {
 			crep = 1501;
 			tperd();
 		}
-		if ((s.conf > 99) && (h > 0) && (h < 9)) {
+		if ((g_s.conf > 99) && (h > 0) && (h < 9)) {
 			crep = 1508;
 			tperd();
 		}
@@ -263,16 +263,16 @@ void tsitu() {
 /* NIVEAU 1 */
 
 void theure() {
-	vj = ord(s.heure);
+	vj = ord(g_s.heure);
 	vh = vj % 48;
 	vj /= 48;
 	vm = vh % 2;
 	vh /= 2;
-	_hour = vh;
+	g_hour = vh;
 	if (vm == 1)
-		_minute = 30;
+		g_minute = 30;
 	else
-		_minute = 0;
+		g_minute = 0;
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 929b088..7afaa47 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -85,7 +85,7 @@ void SavegameManager::takesav(int n) {
 	Common::File f;
 	if (stream == NULL) {
 		if (!f.open(filename))
-			error("Unable to open save file '%s'", filename);
+			error("Unable to open save file '%s'", filename.c_str());
 
 		stream = f.readStream(f.size());
 		f.close();
@@ -107,7 +107,7 @@ void SavegameManager::takesav(int n) {
 	Common::Serializer sz(stream, NULL);
 	sync_save(sz);
 
-	s = s1;
+	g_s = s1;
 	for (i = 0; i <= 389; ++i)
 		tabdon[i + acha] = bufcha[i];
 
@@ -143,7 +143,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	
 	for (i = 0; i <= 389; ++i)
 		bufcha[i] = tabdon[i + acha];
-	s1 = s;
+	s1 = g_s;
 	if (s1.mlieu == 26)
 		s1.mlieu = 15;
 	
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 82abc27..1694387 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -106,42 +106,42 @@ void taffich() {
 	else if ((a >= 136) && (a <= 140))
 		a = tran1[a - 136];
 	int b = a;
-	if (_maff == a)
+	if (g_maff == a)
 		return;
 
 	switch (a) {
 	case 16:
-		s.pourc[9] = '*';
-		s.teauto[42] = '*';
+		g_s.pourc[9] = '*';
+		g_s.teauto[42] = '*';
 		break;
 	case 20:
-		s.teauto[39] = '*';
-		if (s.teauto[36] == '*') {
-			s.pourc[3] = '*';
-			s.teauto[38] = '*';
+		g_s.teauto[39] = '*';
+		if (g_s.teauto[36] == '*') {
+			g_s.pourc[3] = '*';
+			g_s.teauto[38] = '*';
 		}
 		break;
 	case 24:
-		s.teauto[37] = '*';
+		g_s.teauto[37] = '*';
 		break;
 	case 30:
-		s.teauto[9] = '*';
+		g_s.teauto[9] = '*';
 		break;
 	case 31:
-		s.pourc[4] = '*';
-		s.teauto[35] = '*';
+		g_s.pourc[4] = '*';
+		g_s.teauto[35] = '*';
 		break;
 	case 118:
-		s.teauto[41] = '*';
+		g_s.teauto[41] = '*';
 		break;
 	case 143:
-		s.pourc[1] = '*';
+		g_s.pourc[1] = '*';
 		break;
 	case 150:
-		s.teauto[34] = '*';
+		g_s.teauto[34] = '*';
 		break;
 	case 151:
-		s.pourc[2] = '*';
+		g_s.pourc[2] = '*';
 		break;
 	default:
 		break;
@@ -160,7 +160,7 @@ void taffich() {
 			m = 2010;
 		if (a == 32)
 			m = 2034;
-		if ((a == 17) && (_maff == 14))
+		if ((a == 17) && (g_maff == 14))
 			m = 2018;
 		if (a > 99)
 			if ((is == 1) || (is == 0))
@@ -169,10 +169,10 @@ void taffich() {
 				m = 2032;
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
-		if (((a < 27) && (((_maff > 69) && (! s.ipre)) || (_maff > 99))) || ((_maff > 29) && (_maff < 33)))
+		if (((a < 27) && (((g_maff > 69) && (!g_s.ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
 		messint(m);
-		_maff = a;
+		g_maff = a;
 		if (a == 159)
 			a = 86;
 		else if (a > 140)
@@ -203,11 +203,11 @@ void taffich() {
 			lgt = handle;
 			handle = g_l[88];
 		}
-		_maff = a;
+		g_maff = a;
 		npal = a + 37;
 	}
 	chardes(filename, lgt, handle);
-	if (_currGraphicalDevice == MODE_HERCULES) {
+	if (g_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
 			int palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
@@ -244,11 +244,11 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	showMouse();
-	if ((a < 27) && ((_maff < 27) || (s.mlieu == 15)) && (msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
 		else if (! blo)
-			t11(s.mlieu, cx);
+			t11(g_s.mlieu, cx);
 		mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 42fab06..138b604 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -91,7 +91,7 @@ bool blo,
         bt7,
         bh9,
 
-        _soundOff,
+        g_soundOff,
         main1,
         choisi,
         test0,
@@ -99,7 +99,7 @@ bool blo,
         imen,
         cache,
         iesc,
-        col,
+        g_col,
         syn,
         fouil,
         zuul,
@@ -114,8 +114,8 @@ bool blo,
 
 
 int g_x,
-        y,
-        t,
+        g_y,
+        g_t,
         vj,
         li,
         vh,
@@ -123,20 +123,19 @@ int g_x,
         jh,
         mh,
         cs,
-        _currGraphicalDevice,
+        g_currGraphicalDevice,
         hdb,
         hfb,
-        _hour,
-        _day,
-        key,
-        _minute,
-        num,
-        max,
+        g_hour,
+        g_day,
+        g_key,
+        g_minute,
+        g_num,
         res,
         ment,
-        haut,
+        g_haut,
         caff,
-        _maff,
+        g_maff,
         crep,
         ades,
         iouv,
@@ -146,7 +145,7 @@ int g_x,
         msg3,
         msg4,
         mlec,
-        _newGraphicalDevice,
+        g_newGraphicalDevice,
         c_zzz,
         mchai,
         menup,
@@ -162,7 +161,6 @@ int g_x,
         typlec,
         num_ph,
         numpal,
-        lderobj,
         nb_word,
         ptr_oct,
         k_tempo,
@@ -179,9 +177,9 @@ byte mode;
 
 int nbrep[9];
 int nbrepm[9];
-int msg[5];
+int g_msg[5];
 byte touv[8];
-sav_chaine s, s1;
+sav_chaine g_s, s1;
 byte bufcha[391];
 
 byte lettres[7][24];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5769b61..1ccea2c 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -232,7 +232,7 @@ extern bool blo,
         bt7,
         bh9,
 
-        _soundOff,
+        g_soundOff,
         main1,
         choisi,
         test0,
@@ -240,7 +240,7 @@ extern bool blo,
         imen,
         cache,
         iesc,
-        col,
+        g_col,
         syn,
         fouil,
         zuul,
@@ -254,8 +254,8 @@ extern bool blo,
 
 
 extern int g_x,
-        y,
-        t,
+        g_y,
+        g_t,
         vj,
         li,
         vh,
@@ -263,20 +263,19 @@ extern int g_x,
         jh,
         mh,
         cs,
-        _currGraphicalDevice,
+        g_currGraphicalDevice,
         hdb,
         hfb,
-        _hour,
-        _day,
-        key,
-        _minute,
-        num,
-        max,
+        g_hour,
+        g_day,
+        g_key,
+        g_minute,
+        g_num,
         res,
         ment,
-        haut,
+        g_haut,
         caff,
-        _maff,
+        g_maff,
         crep,
         ades,
         iouv,
@@ -286,7 +285,7 @@ extern int g_x,
         msg3,
         msg4,
         mlec,
-        _newGraphicalDevice,
+        g_newGraphicalDevice,
         c_zzz,
         mchai,
         menup,
@@ -302,7 +301,6 @@ extern int g_x,
         typlec,
         num_ph,
         numpal,
-        lderobj,
         nb_word,
         ptr_oct,
         k_tempo,
@@ -319,9 +317,9 @@ extern byte mode;
 
 extern int nbrep[9];
 extern int nbrepm[9];
-extern int msg[5];
+extern int g_msg[5];
 extern byte touv[8];
-extern sav_chaine s, s1;
+extern sav_chaine g_s, s1;
 extern byte bufcha[391];
 
 extern byte lettres[7][24];


Commit: 7155d010253ee0b244b70200bc983d0dc2cd45ee
    https://github.com/scummvm/scummvm/commit/7155d010253ee0b244b70200bc983d0dc2cd45ee
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:24-07:00

Commit Message:
MORTEVIELLE: Start renaming globals

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 56c87ef..d115ef3 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -51,17 +51,17 @@ void fctMove() {
 
 	if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		g_s.mlieu = 15;
-		caff = g_s.mlieu;
+		g_caff = g_s.mlieu;
 		afdes(0);
 		repon(2, g_s.mlieu);
 	}
 	if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		if (!syn)
+		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
-		if (iesc)
-			okdes = false;
-		if ((anyone) || (iesc))
+		if (g_iesc)
+			g_okdes = false;
+		if ((g_anyone) || (g_iesc))
 			return;
 		tcoord(1);
 		if (g_num == 0)
@@ -75,9 +75,9 @@ void fctMove() {
 		} else if (g_num != 6)
 			g_s.mlieu = 26;
 		if ((g_num > 1) && (g_num < 6))
-			ment = g_num - 1;
+			g_ment = g_num - 1;
 		if (g_num > 7)
-			ment = g_num - 3;
+			g_ment = g_num - 3;
 		if (g_num != 6)
 			affrep();
 		else
@@ -156,11 +156,11 @@ void fctMove() {
 		t1derr();
 	else if (cx == 17) {
 		if ((g_s.ipuit != 120) && (g_s.ipuit != 140))
-			crep = 997;
+			g_crep = 997;
 		else if (g_s.ipuit == 120)
-			crep = 181;
+			g_crep = 181;
 		else if (g_s.conf > 80) {
-			crep = 1505;
+			g_crep = 1505;
 			tperd();
 		} else {
 			g_s.mlieu = 23;
@@ -179,19 +179,19 @@ L2:
  * @remarks	Originally called 'tprendre'
  */
 void fctTake() {
-	if (caff > 99) {
-		int cx = caff;
+	if (g_caff > 99) {
+		int cx = g_caff;
 		avpoing(cx);
-		if (crep != 139) {
-			if (ipers > 0)
+		if (g_crep != 139) {
+			if (g_ipers > 0)
 				g_s.conf += 3;
-			if (obpart) {
+			if (g_obpart) {
 				if (g_s.mlieu == 2)
 					g_s.iloic = 0;
 				if (g_s.mlieu == 13) {
-					if (g_s.iboul == caff)
+					if (g_s.iboul == g_caff)
 						g_s.iboul = 0;
-					if (g_s.ibag == caff)
+					if (g_s.ibag == g_caff)
 						g_s.ibag = 0;
 				}
 				if (g_s.mlieu == 14)
@@ -203,29 +203,29 @@ void fctTake() {
 				if (g_s.mlieu == 24)
 					g_s.ipuit = 0;
 				mfouen();
-				obpart = false;
+				g_obpart = false;
 				affrep();
 			} else {
-				tabdon[acha + ((mchai - 1) * 10) + cs - 1] = 0;
+				tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
 				tsuiv();
-				++dobj;
-				if (dobj > 6) {
+				++g_dobj;
+				if (g_dobj > 6) {
 					g_s.conf += 2;
-					dobj = 0;
+					g_dobj = 0;
 				}
 			}
 		}
 		return;
 	}
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_TAKE));
 	tfleche();
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
-	if (caff == 3) {
+	if (g_caff == 3) {
 		tcoord(2);
 		if (g_num == 1) {
-			crep = 152;
+			g_crep = 152;
 			return;
 		}
 	}
@@ -233,42 +233,42 @@ void fctTake() {
 	if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) {
 		tcoord(8);
 		if (g_num != 0) {
-			if (ipers > 0)
+			if (g_ipers > 0)
 				g_s.conf += 3;
-			crep = 997;
+			g_crep = 997;
 			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
 				avpoing(g_s.iloic);
 			if ((g_s.mlieu == 13) && (g_num == 1) && (g_s.iboul != 0)) {
 				avpoing(g_s.iboul);
-				if ((crep != 997) && (crep != 139))
+				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 7);
 			}
 			if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) {
 				avpoing(g_s.ibag);
-				if ((crep != 997) && (crep != 139))
+				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 6);
 			}
 			if ((g_s.mlieu == 14) && (g_s.icave != 0)) {
 				avpoing(g_s.icave);
-				if ((crep != 997) && (crep != 139))
+				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 2);
 			}
 			if ((g_s.mlieu == 16) && (g_s.icryp != 0))
 				avpoing(g_s.icryp);
 			if ((g_s.mlieu == 17) && (g_s.ivier != 0)) {
 				avpoing(g_s.ivier);
-				if ((crep != 997) && (crep != 139)) {
-					crep = 182;
+				if ((g_crep != 997) && (g_crep != 139)) {
+					g_crep = 182;
 					aniof(2, 1);
 				}
 			}
 			if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) {
 				avpoing(g_s.ipuit);
-				if ((crep != 997) && (crep != 139))
+				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 1);
 			}
-			if ((crep != 997) && (crep != 182) && (crep != 139))
-				crep = 999;
+			if ((g_crep != 997) && (g_crep != 182) && (g_crep != 139))
+				g_crep = 999;
 		}
 	} else {
 		if ( ((g_s.mlieu == 0)  && (g_num == 3)) || ((g_s.mlieu == 1)  && (g_num == 4))
@@ -278,12 +278,12 @@ void fctTake() {
 		  || ((g_s.mlieu == 9)  && (g_num == 4)) || ((g_s.mlieu == 10) && (g_num > 2))
 		  || ((g_s.mlieu == 11) && (g_num == 7)) || ((g_s.mlieu == 12) && (g_num == 6))
 		  || ((g_s.mlieu == 13) && (g_num > 4))  || ((g_s.mlieu > 13)  && (g_s.mlieu != 23)) )
-		  crep = 997;
+		  g_crep = 997;
 		else if (g_s.mlieu == 23) {
-			crep = 1504;
+			g_crep = 1504;
 			tperd();
 		} else
-			crep = 120;
+			g_crep = 120;
 	}
 }
 /**
@@ -308,7 +308,7 @@ void fctInventoryTake() {
 	g_s.sjer[cy] = chr(0);
 	modinv();
 	avpoing(cz);
-	crep = 998;
+	g_crep = 998;
 	clsf2();
 }
 
@@ -319,33 +319,33 @@ void fctInventoryTake() {
 void fctLift() {
 	int cx;
 
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
 	tcoord(3);
 	if (g_num == 0) {
 		tcoord(8);
 		if (g_num != 0) {
-			if (ipers > 0)
+			if (g_ipers > 0)
 				++g_s.conf;
-			crep = 997;
+			g_crep = 997;
 			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
 				treg(g_s.iloic);
 		}
 		return;
 	}
-	if (ipers > 0)
+	if (g_ipers > 0)
 		++g_s.conf;
 	cx = g_s.mlieu;
 	if (g_s.mlieu == 16)
 		cx = 14;
 	else if (g_s.mlieu == 19)
 		cx = 15;
-	crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
-	if (crep == 255)
-		crep = 997;
+	g_crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
+	if (g_crep == 255)
+		g_crep = 997;
 }
 
 /**
@@ -353,16 +353,16 @@ void fctLift() {
  * @remarks	Originally called 'tlire'
  */
 void fctRead() {
-	if (caff > 99)
-		st4(caff);
+	if (g_caff > 99)
+		st4(g_caff);
 	else {
-		if (!syn)
+		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_READ));
 		tfleche();
-		if (!(anyone) && !(iesc)) {
+		if (!(g_anyone) && !(g_iesc)) {
 			tcoord(4);
 			if (g_num != 0)
-				crep = 107;
+				g_crep = 107;
 		}
 	}
 }
@@ -373,7 +373,7 @@ void fctRead() {
  */
 void fctSelfRead() {
 	if (g_s.derobj == 0)
-		crep = 186;
+		g_crep = 186;
 	else
 		st4(g_s.derobj);
 }
@@ -385,45 +385,45 @@ void fctSelfRead() {
 void fctLook() {
 	int cx;
 
-	if (caff > 99) {
-		crep = 103;
+	if (g_caff > 99) {
+		g_crep = 103;
 		return;
 	}
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_LOOK));
 	tfleche();
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
 	tcoord(5);
 	if (g_num == 0) {
 		tcoord(8);
-		crep = 131;
+		g_crep = 131;
 		if (g_num != 0) {
 			if (g_s.mlieu == 13) {
 				if (g_num == 1) {
-					crep = 164;
+					g_crep = 164;
 					if (g_s.ibag != 0)
 						treg(g_s.ibag);
 					else if (g_s.iboul != 0)
 						treg(g_s.iboul);
 				} else {
-					crep = 193;
+					g_crep = 193;
 					if (g_s.ibag != 0)
 						treg(g_s.ibag);
 				}
 			}
 			if (g_s.mlieu == 14) {
-				crep = 164;
+				g_crep = 164;
 				if (g_s.icave != 0)
 					treg(g_s.icave);
 			}
 			if (g_s.mlieu == 17) {
-				crep = 174;
+				g_crep = 174;
 				if (g_s.ivier != 0)
 					treg(g_s.ivier);
 			}
 			if (g_s.mlieu == 24) {
-				crep = 131;
+				g_crep = 131;
 				if (g_s.ipuit != 0)
 					treg(g_s.ipuit);
 			}
@@ -437,13 +437,13 @@ void fctLook() {
 		cx -= 4;
 	if (g_s.mlieu == 26)
 		cx = 21;
-	crep = tabdon[arega + (cx * 7) + g_num - 1];
+	g_crep = tabdon[arega + (cx * 7) + g_num - 1];
 	if ((g_s.mlieu == 13) && (g_num == 8))
-		crep = 126;
+		g_crep = 126;
 	if (g_s.mlieu == 19)
-		crep = 103;
-	if (crep == 255)
-		crep = 131;
+		g_crep = 103;
+	if (g_crep == 255)
+		g_crep = 131;
 	if ((g_s.mlieu == 1) && (g_num == 1))
 		treg(144);
 	if ((g_s.mlieu == 5) && (g_num == 3))
@@ -464,7 +464,7 @@ void fctSelftLook() {
 	if (g_s.derobj != 0)
 		treg(g_s.derobj);
 	else
-		crep = 186;
+		g_crep = 186;
 }
 
 /**
@@ -474,20 +474,20 @@ void fctSelftLook() {
 void fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
-	if (caff > 99) {
-		st7(caff);
+	if (g_caff > 99) {
+		st7(g_caff);
 		return;
 	}
 
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_SEARCH));
 
 	tfleche();
-	if (anyone || iesc)
+	if (g_anyone || g_iesc)
 		return;
 
 	if (g_s.mlieu == 23) {
-		crep = 1504;
+		g_crep = 1504;
 		tperd();
 		return;
 	}
@@ -501,35 +501,35 @@ void fctSearch() {
 				++cx;
 			} while ((cx <= 6) && (g_num != ord(touv[cx])));
 			if (g_num != ord(touv[cx]))
-				crep = 187;
+				g_crep = 187;
 			else {
-				if (ipers > 0)
+				if (g_ipers > 0)
 					g_s.conf += 3;
 
-				rechai(mchai);
-				if (mchai != 0) {
-					cs = 0;
+				rechai(g_mchai);
+				if (g_mchai != 0) {
+					g_cs = 0;
 					is = 0;
-					fouil = true;
+					g_fouil = true;
 					mfoudi();
 					tsuiv();
 				} else
-					crep = 997;
+					g_crep = 997;
 			}
 		} else {
 			tcoord(8);
-			crep = 997;
+			g_crep = 997;
 			if (g_num != 0) {
-				if (ipers > 0)
+				if (g_ipers > 0)
 					g_s.conf += 3;
 				if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) {
 					if (g_s.mlieu == 2) {
-						crep = 123;
+						g_crep = 123;
 						if (g_s.iloic != 0)
 							treg(g_s.iloic);
 					}
 					if (g_s.mlieu == 16) {
-						crep = 123;
+						g_crep = 123;
 						if (g_s.icryp != 0)
 							treg(g_s.icryp);
 					}
@@ -537,26 +537,26 @@ void fctSearch() {
 			}
 		}
 	} else {
-		if (ipers > 0)
+		if (g_ipers > 0)
 			g_s.conf += 3;
-		crep = 997;
+		g_crep = 997;
 		if (g_s.mlieu < 14)
-			crep = r[g_s.mlieu];
+			g_crep = r[g_s.mlieu];
 
 		if ((g_s.mlieu == 3) && (g_num == 2))
-			crep = 162;
+			g_crep = 162;
 
 		if (g_s.mlieu == 12) {
 			if ((g_num == 3) || (g_num == 4))
-				crep = 162;
+				g_crep = 162;
 			else if (g_num == 5)
-				crep = 159;
+				g_crep = 159;
 		}
 
 		if (g_s.mlieu == 19)
-			crep = 104;
+			g_crep = 104;
 		else if (g_s.mlieu == 16)
-			crep = 155;
+			g_crep = 155;
 	}
 }
 
@@ -568,7 +568,7 @@ void fctSelfSearch() {
 	if (g_s.derobj != 0)
 		st7(g_s.derobj);
 	else
-		crep = 186;
+		g_crep = 186;
 }
 
 /**
@@ -576,32 +576,32 @@ void fctSelfSearch() {
  * @remarks	Originally called 'touvrir'
  */
 void fctOpen() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_OPEN));
 
-	if (caff == 26) {
-		if (ment != 0) {
+	if (g_caff == 26) {
+		if (g_ment != 0) {
 			g_msg[4] = OPCODE_ENTER;
-			syn = true;
+			g_syn = true;
 		} else
-			crep = 997;
+			g_crep = 997;
 		return;
 	}
 
-	if (caff == 15) {
+	if (g_caff == 15) {
 		aldepl();
 		return;
 	}
 
 	tfleche();
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
 
 	tcoord(7);
 	if (g_num != 0) {
-		if (ipers > 0)
+		if (g_ipers > 0)
 			g_s.conf += 2;
-		++iouv;
+		++g_iouv;
 		int cx = 0;
 		do {
 			++cx;
@@ -625,11 +625,11 @@ void fctOpen() {
 			cx = g_s.mlieu;
 			if (g_s.mlieu == 16)
 				cx = 14;
-			crep = tabdon[aouvr + (cx * 7) + g_num - 1];
-			if (crep == 254)
-				crep = 999;
+			g_crep = tabdon[aouvr + (cx * 7) + g_num - 1];
+			if (g_crep == 254)
+				g_crep = 999;
 		} else
-			crep = 18;
+			g_crep = 18;
 	}
 }
 
@@ -639,34 +639,34 @@ void fctOpen() {
  */
 void fctPlace() {
 	if (g_s.derobj == 0) {
-		crep = 186;
+		g_crep = 186;
 		return;
 	}
 
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_PUT));
 
 	tfleche();
-	if (iesc)
-		crep = 998;
+	if (g_iesc)
+		g_crep = 998;
 
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
 
 	tcoord(8);
 	if (g_num != 0) {
-		crep = 999;
-		if (caff == 13) {
+		g_crep = 999;
+		if (g_caff == 13) {
 			if (g_num == 1) {
 				if (g_s.iboul != 0) {
-					crep = 188;
+					g_crep = 188;
 				} else {
 					g_s.iboul = g_s.derobj;
 					if (g_s.derobj == 141)
 						aniof(1, 7);
 				}
 			} else if (g_s.ibag != 0) {
-				crep = 188;
+				g_crep = 188;
 			} else {
 				g_s.ibag = g_s.derobj;
 				if (g_s.derobj == 159)
@@ -674,9 +674,9 @@ void fctPlace() {
 			}
 		}
 
-		if (caff == 14) {
+		if (g_caff == 14) {
 			if (g_s.icave != 0) {
-				crep = 188;
+				g_crep = 188;
 			} else {
 				g_s.icave = g_s.derobj;
 				if (g_s.derobj == 151) {
@@ -693,7 +693,7 @@ void fctPlace() {
 						Common::String alertTxt = deline(582);
 						Alert::show(alertTxt, 1);
 
-						tesok = false;
+						g_tesok = false;
 						bool enterPassageFl = Ques::show();
 						hideMouse();
 						hirs();
@@ -703,8 +703,8 @@ void fctPlace() {
 						showMouse();
 						tinke();
 						drawClock();
-						if (ipers != 0)
-							affper(ipers);
+						if (g_ipers != 0)
+							affper(g_ipers);
 						else 
 							person();
 
@@ -721,50 +721,50 @@ void fctPlace() {
 							alertTxt = deline(577);
 							Alert::show(alertTxt, 1);
 							aniof(2, 1);
-							crep = 166;
+							g_crep = 166;
 						}
 						affrep();
 					} else {
 						aniof(2, 1);
-						crep = 166;
-						tesok = true;
+						g_crep = 166;
+						g_tesok = true;
 					}
 					return;
 				}
 			}
 		}
 
-		if (caff == 16) {
+		if (g_caff == 16) {
 			if (g_s.icryp == 0)
 				g_s.icryp = g_s.derobj;
 			else
-				crep = 188;
+				g_crep = 188;
 		}
 
-		if (caff == 17) {
+		if (g_caff == 17) {
 			if (g_s.ivier != 0) {
-				crep = 188;
+				g_crep = 188;
 			} else if (g_s.derobj == 143) {
 				g_s.ivier = 143;
 				aniof(1, 1);
 			} else {
-				crep = 1512;
+				g_crep = 1512;
 				tperd();
 			}
 		}
 
-		if (caff == 24) {
+		if (g_caff == 24) {
 			if (g_s.ipuit != 0) {
-				crep = 188;
+				g_crep = 188;
 			} else if ((g_s.derobj == 140) || (g_s.derobj == 120)) {
 				g_s.ipuit = g_s.derobj;
 				aniof(1, 1);
 			} else {
-				crep = 185;
+				g_crep = 185;
 			}
 		}
 
-		if (crep != 188)
+		if (g_crep != 188)
 			maivid();
 	}
 }
@@ -774,18 +774,18 @@ void fctPlace() {
  * @remarks	Originally called 'ttourner'
  */
 void fctTurn() {
-	if (caff > 99) {
-		crep = 149;
+	if (g_caff > 99) {
+		g_crep = 149;
 		return;
 	}
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_TURN));
 	tfleche();
-	if ((anyone) || (iesc))
+	if ((g_anyone) || (g_iesc))
 		return;
 	tcoord(9);
 	if (g_num != 0) {
-		crep = 997;
+		g_crep = 997;
 		if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
@@ -793,7 +793,7 @@ void fctTurn() {
 			if (answer == 1)
 				g_vm->_endGame = true;
 			else
-				crep = 168;
+				g_crep = 168;
 		}
 		if ((g_s.mlieu == 17) && (g_s.ivier == 143)) {
 			repon(2, 175);
@@ -804,7 +804,7 @@ void fctTurn() {
 				g_s.mlieu = 16;
 				affrep();
 			} else
-				crep = 176;
+				g_crep = 176;
 		}
 	}
 }
@@ -814,16 +814,16 @@ void fctTurn() {
  * @remarks	Originally called 'tcacher'
  */
 void fctSelfHide() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
-	if (!(anyone) && !(iesc)) {
+	if (!(g_anyone) && !(g_iesc)) {
 		tcoord(10);
 		if (g_num == 0)
-			cache = false;
+			g_cache = false;
 		else {
-			cache = true;
-			crep = 999;
+			g_cache = true;
+			g_crep = 999;
 		}
 	}
 }
@@ -834,21 +834,21 @@ void fctSelfHide() {
  */
 void fctAttach() {
 	if (g_s.derobj == 0)
-		crep = 186;
+		g_crep = 186;
 	else {
-		if (!syn)
+		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_TIE));
 		tfleche();
-		if (!(anyone) && !(iesc)) {
+		if (!(g_anyone) && !(g_iesc)) {
 			tcoord(8);
-			crep = 997;
+			g_crep = 997;
 			if ((g_num != 0) && (g_s.mlieu == 24)) {
-				crep = 999;
+				g_crep = 999;
 				if ((g_s.derobj == 120) || (g_s.derobj == 140)) {
 					g_s.ipuit = g_s.derobj;
 					aniof(1, 1);
 				} else
-					crep = 185;
+					g_crep = 185;
 				maivid();
 			}
 		}
@@ -860,14 +860,14 @@ void fctAttach() {
  * @remarks	Originally called 'tfermer'
  */
 void fctClose() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_CLOSE));
 
-	if (caff < 26) {
+	if (g_caff < 26) {
 		tfleche();
-		if (iesc)
-			crep = 998;
-		if ((anyone) || (iesc))
+		if (g_iesc)
+			g_crep = 998;
+		if ((g_anyone) || (g_iesc))
 			return;
 		tcoord(7);
 		if (g_num != 0) {
@@ -877,20 +877,22 @@ void fctClose() {
 			} while ((cx <= 6) && (g_num != ord(touv[cx])));
 			if (g_num == ord(touv[cx])) {
 				aniof(2, g_num);
-				crep = 998;
+				g_crep = 998;
 				touv[cx] = chr(0);
-				iouv = iouv - 1;
-				if (iouv < 0)
-					iouv = 0;
+				--g_iouv;
+				if (g_iouv < 0)
+					g_iouv = 0;
 				int chai = 9999;
 				rechai(chai);
-				if (mchai == chai)
-					mchai = 0;
-			} else crep = 187;
+				if (g_mchai == chai)
+					g_mchai = 0;
+			} else {
+				g_crep = 187;
+			}
 		}
 	}
-	if (caff == 26)
-		crep = 999;
+	if (g_caff == 26)
+		g_crep = 999;
 }
 
 /**
@@ -898,7 +900,7 @@ void fctClose() {
  * @remarks	Originally called 'tfrapper'
  */
 void fctKnock() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
 	if (g_s.mlieu == 15) {
@@ -908,11 +910,11 @@ void fctKnock() {
 
 	if (g_s.mlieu < 25) {
 		tfleche();
-		if (!(anyone) && !(iesc)) {
+		if (!(g_anyone) && !(g_iesc)) {
 			if ((g_s.mlieu < 19) && (g_s.mlieu != 15))
-				crep = 133;
+				g_crep = 133;
 			else
-				crep = 997;
+				g_crep = 997;
 		}
 
 		return;
@@ -922,12 +924,12 @@ void fctKnock() {
 		int haz = (hazard(0, 8)) - 4;
 		parole(11, haz, 1);
 		int p;
-		ecfren(p, haz, g_s.conf, ment);
-		int l = ment;
+		ecfren(p, haz, g_s.conf, g_ment);
+		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (haz > p)
-					crep = 190;
+					g_crep = 190;
 				else {
 					becfren(l);
 					frap();
@@ -936,8 +938,8 @@ void fctKnock() {
 				frap();
 		}
 
-		if (ment == 8)
-			crep = 190;
+		if (g_ment == 8)
+			g_crep = 190;
 	}
 }
 
@@ -946,90 +948,90 @@ void fctKnock() {
  * @remarks	Originally called 'tposer'
  */
 void fctSelfPut() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_POSE));
 	if (g_s.derobj == 0)
-		crep = 186;
+		g_crep = 186;
 	else {
-		if (caff > 99) {
-			crep = 999;
+		if (g_caff > 99) {
+			g_crep = 999;
 			ajchai();
-			if (crep != 192)
+			if (g_crep != 192)
 				maivid();
 			return;
 		}
 		tfleche();
-		if ((anyone) || (iesc))
+		if ((g_anyone) || (g_iesc))
 			return;
 		tcoord(7);
-		crep = 124;
+		g_crep = 124;
 		if (g_num != 0) {
 			int chai;
 			rechai(chai);
 			if (chai == 0)
-				crep = 997;
+				g_crep = 997;
 			else {
 				int cx = 0;
 				do {
 					++cx;
 				} while ((cx <= 6) && (g_num != ord(touv[cx])));
 				if (g_num != ord(touv[cx]))
-					crep = 187;
+					g_crep = 187;
 				else {
-					mchai = chai;
-					crep = 999;
+					g_mchai = chai;
+					g_crep = 999;
 				}
 			}
 		} else {
 			tcoord(8);
 			if (g_num != 0) {
-				crep = 998;
-				if (caff == 2) {
+				g_crep = 998;
+				if (g_caff == 2) {
 					if (g_s.iloic != 0)
-						crep = 188;
+						g_crep = 188;
 					else
 						g_s.iloic = g_s.derobj;
 				}
 
-				if (caff == 13) {
+				if (g_caff == 13) {
 					if (g_num == 1) {
 						if (g_s.iboul != 0)
-							crep = 188;
+							g_crep = 188;
 						else
 							g_s.iboul = g_s.derobj;
 					} else if (g_s.ibag != 0) {
-						crep = 188;
+						g_crep = 188;
 					} else {
 						g_s.ibag = g_s.derobj;
 					}
 				}
 
-				if (caff == 16) {
+				if (g_caff == 16) {
 					if (g_s.icryp != 0)
-						crep = 188;
+						g_crep = 188;
 					else
 						g_s.icryp = g_s.derobj;
 				}
 
-				if (caff == 24)
-					crep = 185;
-				if ((caff == 14) || (caff == 17))
-					crep = 124;
+				if (g_caff == 24)
+					g_crep = 185;
+				if ((g_caff == 14) || (g_caff == 17))
+					g_crep = 124;
 			} else {
-				crep = 124;
-				if (caff == 24) {
+				g_crep = 124;
+				if (g_caff == 24) {
 					tcoord(5);
 					if (g_num != 0)
-						crep = 185;
+						g_crep = 185;
 				}
 			}
 		}
-		if (caff == 23)
-			crep = 185;
-		if ((crep == 999) || (crep == 185) || (crep == 998)) {
-			if (crep == 999)
+		if (g_caff == 23)
+			g_crep = 185;
+		if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
+			if (g_crep == 999)
 				ajchai();
-			if (crep != 192)
+			if (g_crep != 192)
 				maivid();
 		}
 	}
@@ -1041,17 +1043,17 @@ void fctSelfPut() {
  */
 void fctListen() {
 	if (g_s.mlieu != 26)
-		crep = 101;
+		g_crep = 101;
 	else {
-		if (ipers != 0)
+		if (g_ipers != 0)
 			++g_s.conf;
 		int p, haz;
-		ecfren(p, haz, g_s.conf, ment);
-		int l = ment;
+		ecfren(p, haz, g_s.conf, g_ment);
+		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (haz > p)
-					crep = 101;
+					g_crep = 101;
 				else {
 					becfren(l);
 					int j, h, m;
@@ -1059,16 +1061,16 @@ void fctListen() {
 					haz = hazard(1, 100);
 					if ((h >= 0) && (h < 8)) {
 						if (haz > 30)
-							crep = 101;
+							g_crep = 101;
 						else
-							crep = 178;
+							g_crep = 178;
 					} else if (haz > 70)
-						crep = 101;
+						g_crep = 101;
 					else
-						crep = 178;
+						g_crep = 178;
 				}
 			} else
-				crep = 178;
+				g_crep = 178;
 		}
 	}
 }
@@ -1079,11 +1081,11 @@ void fctListen() {
  */
 void fctEat() {
 	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
-		crep = 148;
+		g_crep = 148;
 	} else {
 		tsort();
 		g_s.mlieu = 10;
-		caff = 10;
+		g_caff = 10;
 		debloc(g_s.mlieu);
 		tmlieu(g_s.mlieu);
 
@@ -1105,11 +1107,11 @@ void fctEat() {
 					h = 1;
 			}
 			
-			jh += h;
-			crep = 135;
+			g_jh += h;
+			g_crep = 135;
 			tinke();
 		} else {
-			crep = 134;
+			g_crep = 134;
 		}
 	}
 }
@@ -1126,18 +1128,18 @@ void fctEnter() {
 		tmlieu(g_s.mlieu);
 	} else if (g_s.mlieu == 15)
 		aldepl();
-	else if (ment == 0)
-		crep = 997;
-	else if ((ment == 9) && (g_s.derobj != 136)) {
-			crep = 189;
+	else if (g_ment == 0)
+		g_crep = 997;
+	else if ((g_ment == 9) && (g_s.derobj != 136)) {
+			g_crep = 189;
 			g_s.teauto[8] = '*';
 	} else {
 		int z = 0;
-		if (! blo)
-			t11(ment, z);
+		if (!g_blo)
+			t11(g_ment, z);
 		if (z != 0) {
-			if ((ment == 3) || (ment == 7))
-				crep = 179;
+			if ((g_ment == 3) || (g_ment == 7))
+				g_crep = 179;
 			else {
 				g_x = (hazard(0, 10)) - 5;
 				parole(7, g_x, 1);
@@ -1148,29 +1150,29 @@ void fctEnter() {
 				g_s.mlieu = 15;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
-				syn = true;
-				if (ment == 9) {
+				g_syn = true;
+				if (g_ment == 9) {
 					g_col = true;
-					caff = 70;
+					g_caff = 70;
 					afdes(0);
-					repon(2, caff);
+					repon(2, g_caff);
 				} else
 					g_col = false;
-				debloc(ment);
-				ment = 0;
+				debloc(g_ment);
+				g_ment = 0;
 			}
 		} else {
 			g_x = (hazard(0, 10)) - 5;
 			parole(7, g_x, 1);
 			aniof(1, 1);
 			
-			g_s.mlieu = ment;
+			g_s.mlieu = g_ment;
 			affrep();
 			debloc(g_s.mlieu);
 			tmlieu(g_s.mlieu);
-			ment = 0;
-			mpers = 0;
-			ipers = 0;
+			g_ment = 0;
+			g_mpers = 0;
+			g_ipers = 0;
 		}
 	}
 }
@@ -1183,7 +1185,7 @@ void fctSleep() {
 	int z, j, h, m;
 
 	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
-		crep = 148;
+		g_crep = 148;
 		return;
 	}
 	if (g_s.mlieu != 0) {
@@ -1207,18 +1209,18 @@ void fctSleep() {
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
-			jh += z;
+			g_jh += z;
 			h = 7;
 		}
-		jh += 2;
+		g_jh += 2;
 		++h;
 		if (h > 23)
 			h = 0;
 		tinke();
 		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
-		anyone = false;
+		g_anyone = false;
 	} while (answer != 1);
-	crep = 998;
+	g_crep = 998;
 	g_num = 0;
 }
 
@@ -1227,16 +1229,16 @@ void fctSleep() {
  * @remarks	Originally called 'tdefoncer'
  */
 void fctForce() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_SMASH));
-	if (caff < 25)
+	if (g_caff < 25)
 		tfleche();
 
-	if ((! anyone) && (! iesc)) {
+	if ((!g_anyone) && (!g_iesc)) {
 		if (g_s.mlieu != 26)
-			crep = 997;
+			g_crep = 997;
 		else {
-			crep = 143;
+			g_crep = 143;
 			g_s.conf += 2;
 		}
 	}
@@ -1248,9 +1250,9 @@ void fctForce() {
  */
 void fctLeave() {
 	tsort();
-	crep = 0;
+	g_crep = 0;
 	if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24))
-		crep = 997;
+		g_crep = 997;
 	else {
 		int lx = 0;
 
@@ -1262,17 +1264,17 @@ void fctLeave() {
 			lx = 15;
 		if (g_s.mlieu == 16) {
 			lx = 17;
-			crep = 176;
+			g_crep = 176;
 		}
 		if (g_s.mlieu == 17)
 			t23coul(lx);
 		if (g_s.mlieu == 23)
 			lx = 24;
-		if (crep != 997)
+		if (g_crep != 997)
 			g_s.mlieu = lx;
-		caff = lx;
-		if (crep == 0)
-			crep = lx;
+		g_caff = lx;
+		if (g_crep == 0)
+			g_crep = lx;
 		debloc(lx);
 		tmlieu(lx);
 	}
@@ -1285,31 +1287,31 @@ void fctLeave() {
 void fctWait() {
 	int quel;
 
-	mpers = 0;
+	g_mpers = 0;
 	clsf3();
 
 	int answer;
 	do {
-		++jh;
+		++g_jh;
 		tinke();
-		if (!blo)
+		if (!g_blo)
 			t11(g_s.mlieu, quel);
-		if ((ipers != 0) && (mpers == 0)) {
-			crep = 998;
+		if ((g_ipers != 0) && (g_mpers == 0)) {
+			g_crep = 998;
 			if ((g_s.mlieu == 13) || (g_s.mlieu == 14))
 				cavegre();
 			if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
-				anyone = true;
-			mpers = ipers;
-			if (!anyone)
+				g_anyone = true;
+			g_mpers = g_ipers;
+			if (!g_anyone)
 				tinke();
 			return;
 		}
 		repon(2, 102);
 		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
-	crep = 998;
-	if (!anyone)
+	g_crep = 998;
+	if (!g_anyone)
 		tinke();
 }
 
@@ -1318,12 +1320,12 @@ void fctWait() {
  * @remarks	Originally called 'tsonder'
  */
 void fctSound() {
-	if (!syn)
+	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_PROBE2));
-	if (caff < 27) {
+	if (g_caff < 27) {
 		tfleche();
-		if (!(anyone) && (!iesc))
-			crep = 145;
+		if (!(g_anyone) && (!g_iesc))
+			g_crep = 145;
 		g_num = 0;
 	}
 }
@@ -1347,10 +1349,10 @@ void fctDiscuss() {
 		do {
 			++cx;
 		} while (g_vm->_menu._discussMenu[cx] != g_msg[4]);
-		caff = 69 + cx;
+		g_caff = 69 + cx;
 		afdes(0);
-		repon(2, caff);
-		suj = caff + 60;
+		repon(2, g_caff);
+		suj = g_caff + 60;
 	}
 	tkey1(false);
 	mennor();
@@ -1398,7 +1400,7 @@ void fctDiscuss() {
 			CHECK_QUIT;
 
 			getMousePos(x, y, c);
-			x *= (3 - res);
+			x *= (3 - g_res);
 			if (x > 319)
 				cx = 41;
 			else
@@ -1461,7 +1463,7 @@ void fctDiscuss() {
 			if (g_col) {
 				g_col = false;
 				g_s.mlieu = 15;
-				if (iouv > 0)
+				if (g_iouv > 0)
 					max = 8;
 				else
 					max = 4;
@@ -1472,10 +1474,10 @@ void fctDiscuss() {
 					suj = 138;
 					g_s.conf += (3 * (g_s.conf / 10));
 				}
-			} else if (nbrep[caff - 69] < nbrepm[caff - 69]) {
-				suj = tabdon[arep + (ix << 3) + (caff - 70)];
+			} else if (nbrep[g_caff - 69] < nbrepm[g_caff - 69]) {
+				suj = tabdon[arep + (ix << 3) + (g_caff - 70)];
 				g_s.conf += tabdon[arcf + ix];
-				++nbrep[caff - 69];
+				++nbrep[g_caff - 69];
 			} else {
 				g_s.conf += 3;
 				suj = 139;
@@ -1513,12 +1515,12 @@ void fctDiscuss() {
 		g_col = false;
 		g_s.mlieu = 15;
 	}
-	ctrm = 0;
+	g_ctrm = 0;
 	hideMouse();
 	hirs();
 	dessine_rouleau();
 	showMouse();
-	affper(ipers);
+	affper(g_ipers);
 	tinke();
 	drawClock();
 	affrep();
@@ -1532,16 +1534,16 @@ void fctDiscuss() {
  * @remarks	Originally called 'tsentir'
  */
 void fctSmell() {
-	crep = 119;
-	if (caff < 26) {
-		if (!syn)
+	g_crep = 119;
+	if (g_caff < 26) {
+		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
-		if (!(anyone) && !(iesc))
-			if (caff == 16)
-				crep = 153;
-	} else if (caff == 123)
-		crep = 110;
+		if (!(g_anyone) && !(g_iesc))
+			if (g_caff == 16)
+				g_crep = 153;
+	} else if (g_caff == 123)
+		g_crep = 110;
 	g_num = 0;
 }
 
@@ -1550,9 +1552,9 @@ void fctSmell() {
  * @remarks	Originally called 'tgratter'
  */
 void fctScratch() {
-	crep = 155;
-	if (caff < 27) {
-		if (!syn)
+	g_crep = 155;
+	if (g_caff < 27) {
+		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_SCRATCH));
 		tfleche();
 	}
@@ -1573,7 +1575,7 @@ void MortevielleEngine::endGame() {
 	repon(9, 1509);
 	tkey1(false);
 	hideMouse();
-	caff = 70;
+	g_caff = 70;
 	taffich();
 	hirs();
 	premtet();
@@ -1583,7 +1585,7 @@ void MortevielleEngine::endGame() {
 	repon(9, 1509);
 	repon(2, 142);
 	tkey1(false);
-	caff = 32;
+	g_caff = 32;
 	afdes(0);
 	repon(6, 34);
 	repon(2, 35);
@@ -1607,9 +1609,9 @@ void MortevielleEngine::loseGame() {
 	maivid();
 	inzon();
 	dprog();
-	vh = 10;
-	vm = 0;
-	vj = 0;
+	g_vh = 10;
+	g_vm__ = 0;
+	g_vj = 0;
 	g_minute = 0;
 	g_hour = 10;
 	g_day = 0;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index fec8b2f..96264c8 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -78,7 +78,7 @@ int Alert::show(const Common::String &msg, int n) {
 			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
 				++i;
 				st = st + chaine[i];
-				if (res == 2)
+				if (g_res == 2)
 					cx -= 3;
 				else
 					cx -= 5;
@@ -95,12 +95,12 @@ int Alert::show(const Common::String &msg, int n) {
 		esp = (uint)(nbcol - caseNumb * 40) >> 1;
 	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
 	setButtonText(cas, coldep, caseNumb, &s[0], esp);
-	limit[1][1] = ((uint)(coldep) >> 1) * res;
+	limit[1][1] = ((uint)(coldep) >> 1) * g_res;
 	limit[1][2] = limit[1][1] + 40;
 	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * res;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
 	showMouse();
@@ -221,7 +221,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
 	}
 	++i;
 	choiceListStr = copy(inputStr, i, 30);
-	if (res == 2)
+	if (g_res == 2)
 		col *= 6;
 	else
 		col *= 10;
@@ -308,7 +308,7 @@ bool Ques::show() {
 		showMouse();
 		++indx;
 		int dialogHeight;
-		if (res == 1)
+		if (g_res == 1)
 			dialogHeight = 29;
 		else
 			dialogHeight = 23;
@@ -338,8 +338,8 @@ bool Ques::show() {
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
 			rectangle &with = coor[j];
 
-			with.x1 = 45 * res;
-			with.x2 = (maxLength * 3 + 55) * res;
+			with.x1 = 45 * g_res;
+			with.x2 = (maxLength * 3 + 55) * g_res;
 			with.y1 = 27 + j * 8;
 			with.y2 = 34 + j * 8;
 			with.enabled = true;
@@ -349,7 +349,7 @@ bool Ques::show() {
 			}
 		}
 		coor[lastOption - firstOption + 2].enabled = false;
-		if (res == 1)
+		if (g_res == 1)
 			rep = 10;
 		else
 			rep = 6;
@@ -360,7 +360,7 @@ bool Ques::show() {
 		warning("Expected answer: %d", correctAnswerArr[indx]);
 		do {
 			g_vm->setMouseClick(false);
-			tesok = false;
+			g_tesok = false;
 			bool flag;
 			moveMouse(flag, key);
 			CHECK_QUIT0;
@@ -400,7 +400,7 @@ bool Ques::show() {
 			warning("Skipping protection check: testprot()");
 			protectionCheck = true;
 			// tesok is set to true in testprot()
-			tesok = true;
+			g_tesok = true;
 		}
 	} while (indx != 10);
 
@@ -462,10 +462,10 @@ void f3f8::waitForF3F8(int &key) {
 }
 
 void f3f8::aff50(bool drawAni50Fl) {
-	caff = 50;
+	g_caff = 50;
 	g_maff = 0;
 	taffich();
-	dessine(ades, 63, 12);
+	dessine(g_ades, 63, 12);
 	if (drawAni50Fl)
 		ani50();
 	else
@@ -476,11 +476,11 @@ void f3f8::aff50(bool drawAni50Fl) {
 }
 
 void f3f8::ani50() {
-	crep = animof(1, 1);
-	pictout(adani, crep, 63, 12);
-	crep = animof(2, 1);
-	pictout(adani, crep, 63, 12);
-	f2_all = (res == 1);
+	g_crep = animof(1, 1);
+	pictout(adani, g_crep, 63, 12);
+	g_crep = animof(2, 1);
+	pictout(adani, g_crep, 63, 12);
+	g_f2_all = (g_res == 1);
 	repon(2, c_paroles + 143);
 }
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index bec7ef4..3108594 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -985,7 +985,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
-	if (res == 1) {
+	if (g_res == 1) {
 		x = (uint)x >> 1;
 		dx = (uint)dx >> 1;
 	}
@@ -1052,7 +1052,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 	hideMouse();
 	pt = _textPos;
 
-	if (res == 2)
+	if (g_res == 2)
 		i = 6;
 	else
 		i = 10;
@@ -1093,7 +1093,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
  * Gets the width in pixels of the specified string
  */
 int ScreenSurface::getStringWidth(const Common::String &s) {
-	int charWidth = (res == 2) ? 6 : 10;
+	int charWidth = (g_res == 2) ? 6 : 10;
 
 	return s.size() * charWidth;
 }
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index d6ebe98..602d53d 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -45,9 +45,9 @@ int testou() {
 		g_soundOff = !g_soundOff;
 		break;
 	case '\26' :
-		if ((c_zzz == 1) || (c_zzz == 2)) {
+		if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
 			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-			++c_zzz;
+			++g_c_zzz;
 
 			return 61;
 		}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 5030da9..68fff8a 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -101,7 +101,7 @@ void pictout(int seg, int dep, int x, int y) {
 		mem[0x7000 * 16 + 32] = 15;
 	}
 
-	if ((caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
+	if ((g_caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
 		WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
 
 	g_vm->_screenSurface.drawPicture(surface, x, y);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 998b70f..ac19959 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,7 +48,7 @@ void Menu::menut(int no, Common::String name) {
 	byte l = lo(no);
 	Common::String s = name;
 
-	if (! tesok)
+	if (!g_tesok)
 		g_vm->quitGame();
 
 
@@ -153,7 +153,7 @@ void Menu::displayMenu() {
 	hideMouse();
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
-	col = 28 * res;
+	col = 28 * g_res;
 	if (g_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
@@ -182,7 +182,7 @@ void Menu::displayMenu() {
 			} while (k != 3);
 			++y;
 		} while (y != 9);
-		col += 48 * res;
+		col += 48 * g_res;
 	} while (num_letr != 6);
 	showMouse();
 }
@@ -193,23 +193,23 @@ void Menu::displayMenu() {
 void Menu::drawMenu() {
 	displayMenu();
 	_menuActive = true;
-	msg4 = OPCODE_NONE;
-	msg3 = OPCODE_NONE;
-	choisi = false;
+	g_msg4 = OPCODE_NONE;
+	g_msg3 = OPCODE_NONE;
+	g_choisi = false;
 	g_vm->setMouseClick(false);
-	test0 = false;
+	g_test0 = false;
 }
 
 void Menu::invers(int ix) {
 	Common::String s;
 
-	if (msg4 == OPCODE_NONE)
+	if (g_msg4 == OPCODE_NONE)
 		return;
 
-	int menuIndex = lo(msg4);
+	int menuIndex = lo(g_msg4);
 
-	g_vm->_screenSurface.putxy(_menuConstants[msg3 - 1][0] << 3, (menuIndex + 1) << 3);
-	switch (msg3) {
+	g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	switch (g_msg3) {
 	case 1:
 		s = _inventoryStringArray[menuIndex];
 		break;
@@ -248,31 +248,31 @@ void Menu::invers(int ix) {
 	if ((s[0] != '*') && (s[0] != '<'))
 		g_vm->_screenSurface.writeg(s, ix);
 	else
-		msg4 = OPCODE_NONE;
+		g_msg4 = OPCODE_NONE;
 }
 
 void Menu::util(int x, int y) {
 
-	int ymx = (_menuConstants[msg3 - 1][3] << 3) + 16;
-	int dxcar = _menuConstants[msg3 - 1][2];
-	int xmn = (_menuConstants[msg3 - 1][0] << 2) * res;
+	int ymx = (_menuConstants[g_msg3 - 1][3] << 3) + 16;
+	int dxcar = _menuConstants[g_msg3 - 1][2];
+	int xmn = (_menuConstants[g_msg3 - 1][0] << 2) * g_res;
 
 	int ix;
-	if (res == 1)
+	if (g_res == 1)
 		ix = 5;
 	else
 		ix = 3;
-	int xmx = dxcar * ix * res + xmn + 2;
+	int xmx = dxcar * ix * g_res + xmn + 2;
 	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = (((uint)y >> 3) - 1) + (msg3 << 8);
-		if (ix != msg4) {
+		ix = (((uint)y >> 3) - 1) + (g_msg3 << 8);
+		if (ix != g_msg4) {
 			invers(1);
-			msg4 = ix;
+			g_msg4 = ix;
 			invers(0);
 		}
-	} else if (msg4 != OPCODE_NONE) {
+	} else if (g_msg4 != OPCODE_NONE) {
 		invers(1);
-		msg4 = OPCODE_NONE;
+		g_msg4 = OPCODE_NONE;
 	}
 }
 
@@ -294,7 +294,7 @@ void Menu::menuDown(int ii) {
 	hideMouse();
 	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
-	if (res == 1)
+	if (g_res == 1)
 		cx = 10;
 	else
 		cx = 6;
@@ -352,7 +352,7 @@ void Menu::menuDown(int ii) {
 		}
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (cx != nb_lig);
-	test0 = true;
+	g_test0 = true;
 	showMouse();
 }
 
@@ -361,7 +361,7 @@ void Menu::menuDown(int ii) {
  */
 void Menu::menuUp(int xx) {
 	/* debug('menuUp'); */
-	if (test0) {
+	if (g_test0) {
 		charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
@@ -375,7 +375,7 @@ void Menu::menuUp(int xx) {
 		// Copy the data
 		Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest);
 
-		test0 = false;
+		g_test0 = false;
 	}
 }
 
@@ -386,7 +386,7 @@ void Menu::eraseMenu() {
 	/* debug('eraseMenu'); */
 	_menuActive = false;
 	g_vm->setMouseClick(false);
-	menuUp(msg3);
+	menuUp(g_msg3);
 }
 
 /**
@@ -399,67 +399,67 @@ void Menu::mdn() {
 	int x = x_s;
 	int y = y_s;
 	if (!g_vm->getMouseClick()) {
-		if ((x == xprec) && (y == yprec))
+		if ((x == g_xprec) && (y == g_yprec))
 			return;
 		else {
-			xprec = x;
-			yprec = y;
+			g_xprec = x;
+			g_yprec = y;
 		}
 		
 		bool tes =  (y < 11) 
-		   && ((x >= (28 * res) && x <= (28 * res + 24)) 
-		   ||  (x >= (76 * res) && x <= (76 * res + 24))
-		   || ((x > 124 * res) && (x < 124 * res + 24))
-		   || ((x > 172 * res) && (x < 172 * res + 24))
-		   || ((x > 220 * res) && (x < 220 * res + 24))
-		   || ((x > 268 * res) && (x < 268 * res + 24)));
+		   && ((x >= (28 * g_res) && x <= (28 * g_res + 24)) 
+		   ||  (x >= (76 * g_res) && x <= (76 * g_res + 24))
+		   || ((x > 124 * g_res) && (x < 124 * g_res + 24))
+		   || ((x > 172 * g_res) && (x < 172 * g_res + 24))
+		   || ((x > 220 * g_res) && (x < 220 * g_res + 24))
+		   || ((x > 268 * g_res) && (x < 268 * g_res + 24)));
 		if (tes) {
 			int ix;
 
-			if (x < 76 * res)
+			if (x < 76 * g_res)
 				ix = MENU_INVENTORY;
-			else if (x < 124 * res)
+			else if (x < 124 * g_res)
 				ix = MENU_MOVE;
-			else if (x < 172 * res)
+			else if (x < 172 * g_res)
 				ix = MENU_ACTION;
-			else if (x < 220 * res)
+			else if (x < 220 * g_res)
 				ix = MENU_SELF;
-			else if (x < 268 * res)
+			else if (x < 268 * g_res)
 				ix = MENU_DISCUSS;
 			else
 				ix = MENU_FILE;
 
-			if ((ix != msg3) || (! test0))
-				if (!((ix == MENU_FILE) && ((msg3 == MENU_SAVE) || (msg3 == MENU_LOAD)))) {
-					menuUp(msg3);
+			if ((ix != g_msg3) || (!g_test0))
+				if (!((ix == MENU_FILE) && ((g_msg3 == MENU_SAVE) || (g_msg3 == MENU_LOAD)))) {
+					menuUp(g_msg3);
 					menuDown(ix);
-					msg3 = ix;
-					msg4 = OPCODE_NONE;
+					g_msg3 = ix;
+					g_msg4 = OPCODE_NONE;
 				}
 		} else { // Not in the MenuTitle line
-			if ((y > 11) && (test0))
+			if ((y > 11) && (g_test0))
 				util(x, y);
 		}
 	} else {       // There was a click
-		if ((msg3 == MENU_FILE) && (msg4 != OPCODE_NONE)) {
+		if ((g_msg3 == MENU_FILE) && (g_msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
-			menuUp(msg3);
-			if (lo(msg4) == 1)
-				msg3 = 7;
+			menuUp(g_msg3);
+			if (lo(g_msg4) == 1)
+				g_msg3 = 7;
 			else
-				msg3 = 8;
-			menuDown(msg3);
+				g_msg3 = 8;
+			menuDown(g_msg3);
 
 			g_vm->setMouseClick(false);
 		} else { 
 			//  A menu was clicked on
-			choisi = (test0) && (msg4 != OPCODE_NONE);
-			menuUp(msg3);
-			g_msg[4] = msg4;
-			g_msg[3] = msg3;
-			msg3 = OPCODE_NONE;
-			msg4 = OPCODE_NONE;
+			g_choisi = (g_test0) && (g_msg4 != OPCODE_NONE);
+			menuUp(g_msg3);
+			g_msg[4] = g_msg4;
+			g_msg[3] = g_msg3;
+			g_msg3 = OPCODE_NONE;
+			g_msg4 = OPCODE_NONE;
 
 			g_vm->setMouseClick(false);
 		}
@@ -511,8 +511,8 @@ void Menu::initMenu() {
 		if (i > 6)
 			g_vm->_menu.disableMenuItem(_inventoryMenu[i]);
 	}
-	msg3 = OPCODE_NONE;
-	msg4 = OPCODE_NONE;
+	g_msg3 = OPCODE_NONE;
+	g_msg4 = OPCODE_NONE;
 	g_msg[3] = OPCODE_NONE;
 	g_msg[4] = OPCODE_NONE;
 	g_vm->setMouseClick(false);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d3eb248..20882eb 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -107,7 +107,7 @@ void modif(int &nu) {
 
 void dessine(int ad, int x, int y) {
 	hideMouse();
-	writepal(numpal);
+	writepal(g_numpal);
 	pictout(ad, 0, x, y);
 	showMouse();
 }
@@ -124,7 +124,7 @@ void dessine_rouleau() {
 
 
 void text_color(int c) {
-	color_txt = c;
+	g_color_txt = c;
 }
 
 /* NIVEAU 13 */
@@ -133,14 +133,14 @@ void text_color(int c) {
 void text1(int x, int y, int nb, int m) {
 	int co;
 
-	if (res == 1)
+	if (g_res == 1)
 		co = 10;
 	else
 		co = 6;
 	Common::String tmpStr = deline(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
-	afftex(tmpStr, x, y, nb, 20, color_txt);
+	afftex(tmpStr, x, y, nb, 20, g_color_txt);
 }
 
 void initouv() {
@@ -162,10 +162,10 @@ void clsf1() {
 
 void clsf2() {
 	hideMouse();
-	if (f2_all) {
+	if (g_f2_all) {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
-		f2_all = false;
+		g_f2_all = false;
 	} else {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
@@ -180,7 +180,7 @@ void ecrf2() {
 void ecr2(Common::String str_) {
 	// Some dead code was present in the original: removed
 	g_vm->_screenSurface.putxy(8, 177);
-	int tlig = 59 + (res - 1) * 36;
+	int tlig = 59 + (g_res - 1) * 36;
 
 	if ((int)str_.size() < tlig)
 		g_vm->_screenSurface.writeg(str_, 5);
@@ -190,7 +190,7 @@ void ecr2(Common::String str_) {
 		g_vm->_screenSurface.putxy(8, 182);
 		g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
 	} else {
-		f2_all = true;
+		g_f2_all = true;
 		clsf2();
 		g_vm->_screenSurface.putxy(8, 176);
 		g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
@@ -228,7 +228,7 @@ void clsf10() {
 	Common::String st;
 
 	hideMouse();
-	if (res == 1) {
+	if (g_res == 1) {
 		co = 634;
 		cod = 534;
 	} else {
@@ -247,7 +247,7 @@ void clsf10() {
 	g_vm->_screenSurface.putxy(co, 92);
 	g_vm->_screenSurface.writeg(st, 4);
 
-	if (res == 1)
+	if (g_res == 1)
 		co = 620;
 	else
 		co = 584;
@@ -280,15 +280,15 @@ int hazard(int min, int max) {
 
 void calch(int &j, int &h, int &m) {
 	int nh = readclock();
-	int th = jh + ((nh - mh) / g_t);
-	m = ((th % 2) + vm) * 30;
-	h = ((uint)th >> 1) + vh;
+	int th = g_jh + ((nh - g_mh) / g_t);
+	m = ((th % 2) + g_vm__) * 30;
+	h = ((uint)th >> 1) + g_vh;
 	if (m == 60) {
 		m = 0;
 		h = h + 1;
 	}
-	j = (h / 24) + vj;
-	h = h - ((j - vj) * 24);
+	j = (h / 24) + g_vj;
+	h = h - ((j - g_vj) * 24);
 }
 
 void conv(int x, int &y) {
@@ -302,7 +302,7 @@ void conv(int x, int &y) {
 
 /* NIVEAU 12 */
 void okpas() {
-	tesok = true;
+	g_tesok = true;
 }
 
 void modobj(int m) {
@@ -321,7 +321,7 @@ void modobj2(int m, bool t1, bool t2) {
 	if (t1 || t2)
 		okpas();
 	else
-		tesok = false;;
+		g_tesok = false;;
 
 	if (m != 500)
 		strp = deline(m - 501 + c_st41);
@@ -339,10 +339,10 @@ void repon(int f, int m) {
 	if ((m > 499) && (m < 563)) {
 		tmpStr = deline(m - 501 + c_st41);
 
-		if ((int) tmpStr.size() > ((58 + (res - 1) * 37) << 1))
-			f2_all = true;
+		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
+			g_f2_all = true;
 		else
-			f2_all = false;
+			g_f2_all = false;
 
 		clsf2();
 		afftex(tmpStr, 8, 176, 85, 3, 5);
@@ -358,7 +358,7 @@ void repon(int f, int m) {
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
 				g_s.teauto[40] = '*';
-			if ((m == 104) && (caff == 14)) {
+			if ((m == 104) && (g_caff == 14)) {
 				g_s.teauto[36] = '*';
 				if (g_s.teauto[39] == '*') {
 					g_s.pourc[3] = '*';
@@ -387,7 +387,7 @@ void repon(int f, int m) {
 			tmpStr = deline(m);
 
 			int xco, dx, caspe;
-			if (res == 1) {
+			if (g_res == 1) {
 				xco = 252 - tmpStr.size() * 5;
 				caspe = 100;
 				dx = 80;
@@ -407,33 +407,33 @@ void repon(int f, int m) {
 
 void t5(int cx) {
 	if (cx == 10)
-		blo = false;
+		g_blo = false;
 
 	if (cx != 1) {
-		bh1 = false;
-		bf1 = false;
+		g_bh1 = false;
+		g_bf1 = false;
 	}
 
 	if (cx != 2)
-		bh2 = false;
+		g_bh2 = false;
 
 	if (cx != 4) {
-		bh4 = false;
-		bf4 = false;
+		g_bh4 = false;
+		g_bf4 = false;
 	}
 
 	if (cx != 5)
-		bh5 = false;
+		g_bh5 = false;
 	if (cx != 6)
-		bh6 = false;
+		g_bh6 = false;
 	if (cx != 8)
-		bh8 = false;
+		g_bh8 = false;
 	if (cx != 3)
-		bt3 = false;
+		g_bt3 = false;
 	if (cx != 7)
-		bt7 = false;
+		g_bt7 = false;
 	if (cx != 9)
-		bh9 = false;
+		g_bh9 = false;
 }
 
 void affper(int per) {
@@ -482,7 +482,7 @@ void affper(int per) {
 		g_vm->_screenSurface.writeg("MAX", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
 	}
-	ipers = per;
+	g_ipers = per;
 }
 
 void choix(int min, int max, int &per) {
@@ -609,7 +609,7 @@ void person() {
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAlone) / 2), 70);
 	g_vm->_screenSurface.writeg(sAlone, 4);
 
-	ipers = 0;
+	g_ipers = 0;
 }
 
 void chlm(int &per) {
@@ -641,9 +641,9 @@ void drawClock() {
 		co = 1;
 
 	if (g_minute == 0)
-		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y - rg), co);
+		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
 	else 
-		g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)x >> 1)*res, (y + rg), co);
+		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
 
 	h = g_hour;
 	if (h > 12)
@@ -651,7 +651,7 @@ void drawClock() {
 	if (h == 0)
 		h = 12;
 
-	g_vm->_screenSurface.drawLine(((uint)x >> 1)*res, y, ((uint)(x + cv[0][h - 1]) >> 1)*res, y + cv[1][h - 1], co);
+	g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 
@@ -678,7 +678,7 @@ void debloc(int l) {
 	g_y = 0;
 	if ((l != 26) && (l != 15))
 		t5(l);
-	mpers = ipers;
+	g_mpers = g_ipers;
 }
 
 void cpl10(int &p, int &h) {
@@ -773,40 +773,40 @@ void quelq1(int l) {
 	per = hazard(1, 2);
 	if (l == 1) {
 		if (per == 1)
-			bh1 = true;
+			g_bh1 = true;
 		else
-			bf1 = true;
+			g_bf1 = true;
 	} else if (l == 4) {
 		if (per == 1)
-			bh4 = true;
+			g_bh4 = true;
 		else
-			bf4 = true;
+			g_bf4 = true;
 	}
 
-	ipers = 10;
+	g_ipers = 10;
 }
 
 void quelq2() {
-	if (li == 2)
-		bh2 = true;
+	if (g_li == 2)
+		g_bh2 = true;
 	else
-		bh9 = true;
+		g_bh9 = true;
 
-	ipers = 10;
+	g_ipers = 10;
 }
 
 void quelq5() {
-	bh5 = true;
-	ipers = 10;
+	g_bh5 = true;
+	g_ipers = 10;
 }
 
 void quelq6(int l) {
 	if (l == 6)
-		bh6 = true;
+		g_bh6 = true;
 	else if (l == 8)
-		bh8 = true;
+		g_bh8 = true;
 
-	ipers = 10;
+	g_ipers = 10;
 }
 
 void quelq10(int h, int &per) {
@@ -865,14 +865,14 @@ void quelq15(int &per) {
 
 	do {
 		cx = hazard(1, 8);
-		test = (((cx == 1) && (bh2 || bh9)) ||
-		        ((cx == 2) && bh8) ||
-		        ((cx == 3) && bh4) ||
-		        ((cx == 4) && bf4) ||
-		        ((cx == 5) && bh6) ||
-		        ((cx == 6) && bh1) ||
-		        ((cx == 7) && bf1) ||
-		        ((cx == 8) && bh5));
+		test = (((cx == 1) && (g_bh2 || g_bh9)) ||
+		        ((cx == 2) && g_bh8) ||
+		        ((cx == 3) && g_bh4) ||
+		        ((cx == 4) && g_bf4) ||
+		        ((cx == 5) && g_bh6) ||
+		        ((cx == 6) && g_bh1) ||
+		        ((cx == 7) && g_bf1) ||
+		        ((cx == 8) && g_bh5));
 	} while (test);
 
 	conv(cx, per);
@@ -905,37 +905,37 @@ void frap() {
 
 	calch(j, h, m);
 	if ((h >= 0) && (h < 8))
-		crep = 190;
+		g_crep = 190;
 	else {
 		int haz = hazard(1, 100);
 		if (haz > 70)
-			crep = 190;
+			g_crep = 190;
 		else
-			crep = 147;
+			g_crep = 147;
 	}
 }
 
 void nouvp(int l, int &p) {
 	p = 0;
 	if (l == 1) {
-		if (bh1)
+		if (g_bh1)
 			p = 4;
-		if (bf1)
+		if (g_bf1)
 			p = 2;
-	} else if (((l == 2) && (bh2)) || ((l == 9) && (bh9)))
+	} else if (((l == 2) && (g_bh2)) || ((l == 9) && (g_bh9)))
 		p = 128;
 	else if (l == 4) {
-		if (bh4)
+		if (g_bh4)
 			p = 32;
-		if (bf4)
+		if (g_bf4)
 			p = 16;
-	} else if ((l == 5) && (bh5))
+	} else if ((l == 5) && (g_bh5))
 		p = 1;
-	else if ((l == 6) && (bh6))
+	else if ((l == 6) && (g_bh6))
 		p = 8;
-	else if ((l == 8) && (bh8))
+	else if ((l == 8) && (g_bh8))
 		p = 64;
-	else if (((l == 3) && (bt3)) || ((l == 7) && (bt7)))
+	else if (((l == 3) && (g_bt3)) || ((l == 7) && (g_bt7)))
 		p = 9;
 
 	if (p != 9)
@@ -969,19 +969,19 @@ void ecfren(int &p, int &haz, int cf, int l) {
 		person();
 	p = -500;
 	haz = 0;
-	if (((l == 1) && (! bh1) && (! bf1)) || ((l == 4) && (! bh4) && (! bf4)))
+	if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
 		cpl1(p);
-	if ((l == 2) && (! bh2) && (! bh9))
+	if ((l == 2) && (!g_bh2) && (!g_bh9))
 		cpl2(p);
-	if (((l == 3) && (! bt3)) || ((l == 7) && (! bt7)))
+	if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
 		cpl3(p);
-	if ((l == 5) && (! bh5))
+	if ((l == 5) && (!g_bh5))
 		cpl5(p);
-	if (((l == 6) && (! bh6)) || ((l == 8) && (! bh8)))
+	if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
 		cpl6(p);
-	if ((l == 9) && (! bh9) && (! bh2))
+	if ((l == 9) && (!g_bh9) && (!g_bh2))
 		p = 10;
-	if (((l == 2) && (bh9)) || ((l == 9) && (bh2)))
+	if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
 		p = -400;
 	if (p != -500) {
 		p = p + cf;
@@ -994,29 +994,29 @@ void becfren(int l) {
 		int haz = hazard(1, 2);
 		if (l == 1) {
 			if (haz == 1)
-				bh1 = true;
+				g_bh1 = true;
 			else
-				bf1 = true;
+				g_bf1 = true;
 		} else { // l == 4
 			if (haz == 1)
-				bh4 = true;
+				g_bh4 = true;
 			else
-				bf4 = true;
+				g_bf4 = true;
 		}
 	} else if (l == 2)
-		bh2 = true;
+		g_bh2 = true;
 	else if (l == 3)
-		bt3 = true;
+		g_bt3 = true;
 	else if (l == 5)
-		bh5 = true;
+		g_bh5 = true;
 	else if (l == 6)
-		bh6 = true;
+		g_bh6 = true;
 	else if (l == 7)
-		bt7 = true;
+		g_bt7 = true;
 	else if (l == 8)
-		bh8 = true;
+		g_bh8 = true;
 	else if (l == 9)
-		bh9 = true;
+		g_bh9 = true;
 }
 
 /* NIVEAU 10 */
@@ -1077,16 +1077,16 @@ void inzon() {
 }
 
 void dprog() {
-	li = 21;
-	jh = 0;
+	g_li = 21;
+	g_jh = 0;
 	if (!g_s.ipre)
-		blo = true;
+		g_blo = true;
 	g_t = ti1;
-	mh = readclock();
+	g_mh = readclock();
 }
 
 void pl1(int cf) {
-	if (((li == 1) && (! bh1) && (! bf1)) || ((li == 4) && (! bh4) && (! bf4))) {
+	if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
 		int p, haz;
 		cpl1(p);
 		phaz(haz, p, cf);
@@ -1094,12 +1094,12 @@ void pl1(int cf) {
 		if (haz > p)
 			person();
 		else
-			quelq1(li);
+			quelq1(g_li);
 	}
 }
 
 void pl2(int cf) {
-	if (! bh2) {
+	if (!g_bh2) {
 		int p, haz;
 		cpl2(p);
 		phaz(haz, p, cf);
@@ -1112,7 +1112,7 @@ void pl2(int cf) {
 }
 
 void pl5(int cf) {
-	if (! bh5) {
+	if (!g_bh5) {
 		int p, haz;
 		cpl5(p);
 		phaz(haz, p, cf);
@@ -1125,7 +1125,7 @@ void pl5(int cf) {
 }
 
 void pl6(int cf) {
-	if (((li == 6) && (! bh6)) || ((li == 8) && (! bh8))) {
+	if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
 		int p, haz;
 		cpl6(p);
 		phaz(haz, p, cf);
@@ -1133,12 +1133,12 @@ void pl6(int cf) {
 		if (haz > p)
 			person();
 		else
-			quelq6(li);
+			quelq6(g_li);
 	}
 }
 
 void pl9(int cf) {
-	if (! bh9) {
+	if (!g_bh9) {
 		cf = -10;
 		int p, haz;
 		phaz(haz, p, cf);
@@ -1220,18 +1220,18 @@ void t11(int l11, int &a) {
 	int p, haz;
 
 	ecfren(p, haz, g_s.conf, l11);
-	li = l11;
+	g_li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
 			if (haz > p) {
 				person();
 				a = 0;
 			} else {
-				becfren(li);
-				nouvp(li, a);
+				becfren(g_li);
+				nouvp(g_li, a);
 			}
 		} else
-			nouvp(li, a);
+			nouvp(g_li, a);
 	}
 
 	if (l11 > 9) {
@@ -1291,7 +1291,7 @@ void cavegre() {
 }
 
 void writetp(Common::String s, int t) {
-	if (res == 2)
+	if (g_res == 2)
 		g_vm->_screenSurface.writeg(s, t);
 	else
 		g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
@@ -1308,13 +1308,13 @@ void messint(int nu) {
 }
 
 void aniof(int ouf, int num) {
-	if ((caff == 7) && ((num == 4) || (num == 5)))
+	if ((g_caff == 7) && ((num == 4) || (num == 5)))
 		return;
 	
-	if ((caff == 10) && (num == 7))
+	if ((g_caff == 10) && (num == 7))
 		num = 6;
 
-	if (caff == 12) {
+	if (g_caff == 12) {
 		if (num == 3)
 			num = 4;
 		else if (num == 4)
@@ -1335,9 +1335,9 @@ void musique(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((prebru == 0) && (!g_s.ipre)) {
+	} else if ((g_prebru == 0) && (!g_s.ipre)) {
 		parole(10, 1, 1);
-		++prebru;
+		++g_prebru;
 	} else {
 		bool i = false;
 		if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22)) {
@@ -1378,42 +1378,42 @@ void musique(int so) {
 /* NIVEAU 9 */
 void dessin(int ad) {
 	if (ad != 0)
-		dessine(ades, ((ad % 160) * 2), (ad / 160));
+		dessine(g_ades, ((ad % 160) * 2), (ad / 160));
 	else {
 		clsf1();
-		if (caff > 99) {
-			dessine(ades, 60, 33);
+		if (g_caff > 99) {
+			dessine(g_ades, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
-		} else if (caff > 69) {
-			dessine(ades, 112, 48);           // Heads
+		} else if (g_caff > 69) {
+			dessine(g_ades, 112, 48);           // Heads
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
-			dessine(ades, 0, 12);
+			dessine(g_ades, 0, 12);
 			ecrf1();
-			if ((caff < 30) || (caff > 32)) {
+			if ((g_caff < 30) || (g_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
 					if (ord(touv[cx]) != 0)
 						aniof(1, ord(touv[cx]));
 				}
 
-				if (caff == 13) {
+				if (g_caff == 13) {
 					if (g_s.iboul == 141)
 						aniof(1, 7);
 
 					if (g_s.ibag == 159)
 						aniof(1, 6);
 				}
-				if ((caff == 14) && (g_s.icave == 151))
+				if ((g_caff == 14) && (g_s.icave == 151))
 					aniof(1, 2);
 
-				if ((caff == 17) && (g_s.ivier == 143))
+				if ((g_caff == 17) && (g_s.ivier == 143))
 					aniof(1, 1);
 
-				if ((caff == 24) && (g_s.ipuit != 0))
+				if ((g_caff == 24) && (g_s.ipuit != 0))
 					aniof(1, 1);
 			}
 			
-			if (caff < 26)
+			if (g_caff < 26)
 				musique(1);
 		}
 	}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 42e1d0f..c592ddc 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -49,7 +49,7 @@ void tinke() {
 	int cx, cf, j, h, m;
 	Common::String stpo;
 
-	anyone = false;
+	g_anyone = false;
 	calch(j, h, m);
 	if (j != g_day) {
 		g_day = j;
@@ -96,7 +96,7 @@ void tinke() {
 	if (y_s < 12)
 		return;
 
-	if (! blo) {
+	if (!g_blo) {
 		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
 			g_t = ti2;
 		else
@@ -109,12 +109,12 @@ void tinke() {
 			g_t -= ((g_t / 3) * 2);
 
 		int nh = readclock();
-		if ((nh - mh) > g_t) {
+		if ((nh - g_mh) > g_t) {
 			bool activeMenu = g_vm->_menu._menuActive;
 			g_vm->_menu.eraseMenu();
-			jh += ((nh - mh) / g_t);
-			mh = nh;
-			switch (li) {
+			g_jh += ((nh - g_mh) / g_t);
+			g_mh = nh;
+			switch (g_li) {
 			case 1:
 			case 4 :
 				pl1(cf);
@@ -153,17 +153,17 @@ void tinke() {
 				pl20(cf);
 				break;
 			}
-			if ((mpers != 0) && (ipers != 10))
-				mpers = ipers;
+			if ((g_mpers != 0) && (g_ipers != 10))
+				g_mpers = g_ipers;
 
-			if ((mpers == 0) && (ipers > 0)) {
+			if ((g_mpers == 0) && (g_ipers > 0)) {
 				if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) {
 					cavegre();
-				} else if (ipers == 10) {
-					ipers = 0;
-					if (! brt) {
-						brt = true;
-						hdb = readclock();
+				} else if (g_ipers == 10) {
+					g_ipers = 0;
+					if (!g_brt) {
+						g_brt = true;
+						g_hdb = readclock();
 						int haz = hazard(1, 5);
 						if (haz < 5) {
 							clsf3();
@@ -181,13 +181,13 @@ void tinke() {
 				g_vm->_menu.drawMenu();
 		}
 	}
-	hfb = readclock();
-	if ((brt) && ((hfb - hdb) > 17)) {
-		nouvp(li, cx);
-		brt = false;
-		hdb = 0;
+	g_hfb = readclock();
+	if ((g_brt) && ((g_hfb - g_hdb) > 17)) {
+		nouvp(g_li, cx);
+		g_brt = false;
+		g_hdb = 0;
 		if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
-			anyone = true;
+			g_anyone = true;
 	}
 }
 
@@ -212,7 +212,7 @@ void fenat(char ans) {
 void afdes(int ad) {
 	taffich();
 	dessin(ad);
-	okdes = false;
+	g_okdes = false;
 }
 
 void tkey1(bool d) {
@@ -230,7 +230,7 @@ void tkey1(bool d) {
 		quest = keypressed();
 		getMousePos(x, y, c);
 		CHECK_QUIT;
-	} while (!(quest || (c != 0) || (d && anyone)));
+	} while (!(quest || (c != 0) || (d && g_anyone)));
 	if (quest)
 		testou();
 	g_vm->setMouseClick(false);
@@ -259,19 +259,19 @@ void tmlieu(int mli) {
 
 /* NIVEAU 7 */
 void tlu(int af, int ob) {
-	caff = 32;
+	g_caff = 32;
 	afdes(0);
 	repon(6, ob + 4000);
 	repon(2, 999);
 	tkey1(true);
-	caff = af;
+	g_caff = af;
 	g_msg[3] = OPCODE_NONE;
-	crep = 998;
+	g_crep = 998;
 }
 
 void affrep() {
-	caff = g_s.mlieu;
-	crep = g_s.mlieu;
+	g_caff = g_s.mlieu;
+	g_crep = g_s.mlieu;
 }
 
 void mfouen() {
@@ -287,11 +287,11 @@ void mfouen() {
 
 void tperd() {
 	initouv();
-	ment = 0;
-	iouv = 0;
-	mchai = 0;
+	g_ment = 0;
+	g_iouv = 0;
+	g_mchai = 0;
 	mfouen();
-	if (!blo) {
+	if (!g_blo) {
 		int cx;
 		t11(21, cx);
 	}
@@ -299,17 +299,17 @@ void tperd() {
 	g_vm->_loseGame = true;
 	clsf1();
 	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
-	repon(9, crep);
+	repon(9, g_crep);
 	clsf2();
 	clsf3();
 	g_col = false;
-	syn = false;
-	okdes = false;
+	g_syn = false;
+	g_okdes = false;
 }
 
 void tsort() {
 
-	if ((iouv > 0) && (g_s.mlieu != 0)) {
+	if ((g_iouv > 0) && (g_s.mlieu != 0)) {
 		if (g_s.conf < 50)
 			g_s.conf += 2;
 		else
@@ -318,24 +318,24 @@ void tsort() {
 
 	for (int cx = 1; cx <= 7; ++cx)
 		touv[cx] = chr(0);
-	ment = 0;
-	iouv = 0;
-	mchai = 0;
+	g_ment = 0;
+	g_iouv = 0;
+	g_mchai = 0;
 	debloc(g_s.mlieu);
 }
 
 void st4(int ob) {
-	crep = 997;
+	g_crep = 997;
 
 	switch (ob) {
 	case 114 :
-		crep = 109;
+		g_crep = 109;
 		break;
 	case 110 :
-		crep = 107;
+		g_crep = 107;
 		break;
 	case 158 :
-		crep = 113;
+		g_crep = 113;
 		break;
 	case 152:
 	case 153:
@@ -347,7 +347,7 @@ void st4(int ob) {
 	case 157:
 	case 160:
 	case 161 :
-		tlu(caff, ob);
+		tlu(g_caff, ob);
 		break;
 	default:
 		break;
@@ -402,7 +402,7 @@ void sparl(float adr, float rep) {
 	
 	key = 0;
 	do {
-		parole(repint, haut[caff - 69], 0);
+		parole(repint, haut[g_caff - 69], 0);
 		f3f8::waitForF3F8(key);
 		CHECK_QUIT;
 	} while (key != 66);
@@ -411,9 +411,9 @@ void sparl(float adr, float rep) {
 }
 
 void finfouil() {
-	fouil = false;
-	obpart = false;
-	cs = 0;
+	g_fouil = false;
+	g_obpart = false;
+	g_cs = 0;
 	is = 0;
 	mfouen();
 }
@@ -434,13 +434,13 @@ void mennor() {
 }
 
 void premtet() {
-	dessine(ades, 10, 80);
+	dessine(g_ades, 10, 80);
 	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 
 /* NIVEAU 5 */
 void ajchai() {
-	int cy = acha + ((mchai - 1) * 10) - 1;
+	int cy = acha + ((g_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
@@ -450,7 +450,7 @@ void ajchai() {
 		int lderobj = g_s.derobj;
 		tabdon[cy + cx] = lderobj;
 	} else
-		crep = 192;
+		g_crep = 192;
 }
 
 void ajjer(int ob) {
@@ -463,7 +463,7 @@ void ajjer(int ob) {
 		g_s.sjer[(cx)] = chr(ob);
 		modinv();
 	} else
-		crep = 139;
+		g_crep = 139;
 }
 
 void t1sama() {    //Entering manor
@@ -474,14 +474,14 @@ void t1sama() {    //Entering manor
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
-			crep = 1511;
+			g_crep = 1511;
 			tperd();
 		} else
 			st1sama();
 	} else if (!g_s.ipre) {     //Is it your first time?
-		ipers = 255;
-		affper(ipers);
-		caff = 77;
+		g_ipers = 255;
+		affper(g_ipers);
+		g_caff = 77;
 		afdes(0);
 		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
@@ -497,10 +497,10 @@ void t1sama() {    //Entering manor
 		g_s.mlieu = 0;
 		affrep();
 		t5(10);
-		if (! blo)
+		if (!g_blo)
 			t11(0, m);
-		ipers = 0;
-		mpers = 0;
+		g_ipers = 0;
+		g_mpers = 0;
 		g_s.ipre = true;
 		/*chech;*/
 	} else
@@ -513,19 +513,19 @@ void t1vier() {
 }
 
 void t1neig() {
-	++inei;
-	if (inei > 2) {
-		crep = 1506;
+	++g_inei;
+	if (g_inei > 2) {
+		g_crep = 1506;
 		tperd();
 	} else {
-		okdes = true;
+		g_okdes = true;
 		g_s.mlieu = 19;
 		affrep();
 	}
 }
 
 void t1deva() {
-	inei = 0;
+	g_inei = 0;
 	g_s.mlieu = 21;
 	affrep();
 }
@@ -536,33 +536,33 @@ void t1derr() {
 }
 
 void t1deau() {
-	crep = 1503;
+	g_crep = 1503;
 	tperd();
 }
 
 void tctrm() {
-	repon(2, (3000 + ctrm));
-	ctrm = 0;
+	repon(2, (3000 + g_ctrm));
+	g_ctrm = 0;
 }
 
 
 void quelquun() {
-	if (imen)
+	if (g_imen)
 		g_vm->_menu.eraseMenu();
 
 	finfouil();
-	crep = 997;
+	g_crep = 997;
 L1:
-	if (! cache) {
-		if (crep == 997)
-			crep = 138;
-		repon(2, crep);
-		if (crep == 138)
+	if (!g_cache) {
+		if (g_crep == 997)
+			g_crep = 138;
+		repon(2, g_crep);
+		if (g_crep == 138)
 			parole(5, 2, 1);
 		else
 			parole(4, 4, 1);
 
-		if (iouv == 0)
+		if (g_iouv == 0)
 			g_s.conf += 2;
 		else if (g_s.conf < 50)
 			g_s.conf += 4;
@@ -571,18 +571,18 @@ L1:
 		tsort();
 		tmlieu(15);
 		int cx;
-		tip(ipers, cx);
-		caff = 69 + cx;
-		crep = caff;
+		tip(g_ipers, cx);
+		g_caff = 69 + cx;
+		g_crep = g_caff;
 		g_msg[3] = MENU_DISCUSS;
 		g_msg[4] = g_vm->_menu._discussMenu[cx];
-		syn = true;
+		g_syn = true;
 		g_col = true;
 	} else {
 		int haz = hazard(1, 3);
 		if (haz == 2) {
-			cache = false;
-			crep = 137;
+			g_cache = false;
+			g_crep = 137;
 			goto L1;
 		} else {
 			repon(2, 136);
@@ -594,7 +594,7 @@ L1:
 			affrep();
 		}
 	}
-	if (imen)
+	if (g_imen)
 		g_vm->_menu.drawMenu();
 }
 
@@ -602,26 +602,26 @@ void tsuiv() {
 	int tbcl;
 	int cl;
 
-	int cy = acha + ((mchai - 1) * 10) - 1;
+	int cy = acha + ((g_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		cx = cx + 1;
-		cs = cs + 1;
-		cl = cy + cs;
+		g_cs = g_cs + 1;
+		cl = cy + g_cs;
 		tbcl = tabdon[cl];
-	} while ((tbcl == 0) && (cs <= 9));
+	} while ((tbcl == 0) && (g_cs <= 9));
 
-	if ((tbcl != 0) && (cs < 11)) {
+	if ((tbcl != 0) && (g_cs < 11)) {
 		is = is + 1;
-		caff = tbcl;
-		crep = caff + 400;
-		if (ipers != 0)
+		g_caff = tbcl;
+		g_crep = g_caff + 400;
+		if (g_ipers != 0)
 			g_s.conf = g_s.conf + 2;
 	} else {
 		affrep();
 		finfouil();
 		if (cx > 9)
-			crep = 131;
+			g_crep = 131;
 	}
 }
 
@@ -633,7 +633,7 @@ void tfleche() {
 		return;
 
 	fenat(chr(152));
-	rect = false;
+	g_rect = false;
 	do {
 		touch = '\0';
 
@@ -642,18 +642,18 @@ void tfleche() {
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
-				rect = (x_s < 256 * res) && (y_s < 176) && (y_s > 12);
+				g_rect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
 			tinke();
-		} while (!(qust || rect || anyone));
+		} while (!(qust || g_rect || g_anyone));
 
 		if (qust && (touch == '\103'))
 			Alert::show(_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (anyone) || (rect)));
+	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
 
 	if (touch == '\73')
-		iesc = true;
+		g_iesc = true;
 
-	if (rect) {
+	if (g_rect) {
 		g_x = x_s;
 		g_y = y_s;
 	}
@@ -665,18 +665,18 @@ void tcoord(int sx) {
 
 
 	g_num = 0;
-	crep = 999;
+	g_crep = 999;
 	int a = 0;
 	int atdon = amzon + 3;
 	int cy = 0;
-	while (cy < caff) {
+	while (cy < g_caff) {
 		a += tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
 	if (tabdon[atdon] == 0) {
-		crep = 997;
+		g_crep = 997;
 		return;
 	}
 
@@ -688,17 +688,17 @@ void tcoord(int sx) {
 	}
 	ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
 	if (ib == 0) {
-		crep = 997;
+		g_crep = 997;
 		return;
 	}
 
 	cy = 1;
 	do {
 		cb += 2;
-		sx = tabdon[a + cb] * res;
+		sx = tabdon[a + cb] * g_res;
 		sy = tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = tabdon[a + cb] * res;
+		ix = tabdon[a + cb] * g_res;
 		iy = tabdon[(a + cb + 1)];
 		++cy;
 	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
@@ -708,7 +708,7 @@ void tcoord(int sx) {
 		return;
 	}
 
-	crep = 997;
+	g_crep = 997;
 }
 
 
@@ -716,51 +716,51 @@ void st7(int ob) {
 	switch (ob) {
 	case 116:
 	case 144:
-		crep = 104;
+		g_crep = 104;
 		break;
 	case 126:
 	case 111:
-		crep = 108;
+		g_crep = 108;
 		break;
 	case 132:
-		crep = 111;
+		g_crep = 111;
 		break;
 	case 142:
-		crep = 112;
+		g_crep = 112;
 		break;
 	default:
-		crep = 183;
+		g_crep = 183;
 		st4(ob);
 	}
 }
 
 void treg(int ob) {
-	int mdes = caff;
-	caff = ob;
+	int mdes = g_caff;
+	g_caff = ob;
 
-	if (((caff > 29) && (caff < 33)) || (caff == 144) || (caff == 147) || (caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
+	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
 		afdes(0);
-		if ((caff > 29) && (caff < 33))
-			repon(2, caff);
+		if ((g_caff > 29) && (g_caff < 33))
+			repon(2, g_caff);
 		else
-			repon(2, (caff + 400));
+			repon(2, g_caff + 400);
 		tkey1(true);
-		caff = mdes;
+		g_caff = mdes;
 		g_msg[3] = 0;
-		crep = 998;
+		g_crep = 998;
 	} else {
-		obpart = true;
-		crep = caff + 400;
+		g_obpart = true;
+		g_crep = g_caff + 400;
 		mfoudi();
 	}
 }
 
 void avpoing(int &ob) {
-	crep = 999;
+	g_crep = 999;
 	if (g_s.derobj != 0)
 		ajjer(g_s.derobj);
 
-	if (crep != 139) {
+	if (g_crep != 139) {
 		modobj(ob + 400);
 		g_s.derobj = ob;
 		ob = 0;
@@ -781,7 +781,7 @@ void t23coul(int &l) {
 	cherjer(143, d);
 	l = 14;
 	if (!d) {
-		crep = 1512;
+		g_crep = 1512;
 		tperd();
 	}
 }
@@ -797,9 +797,9 @@ void st13(int ob) {
 	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
 	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
 	    (ob == 150) || (ob == 152))
-		crep = 999;
+		g_crep = 999;
 	else
-		crep = 105;
+		g_crep = 105;
 }
 
 void aldepl() {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7d0e7bc..dceb5c7 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -122,7 +122,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	// Set the screen mode
 	g_currGraphicalDevice = MODE_EGA;
-	res = 2;
+	g_res = 2;
 
 	_txxFileFl = false;
 	// Load texts from TXX files
@@ -144,19 +144,19 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	g_currGraphicalDevice = MODE_EGA;
 	g_newGraphicalDevice = g_currGraphicalDevice;
-	zuul = false;
-	tesok = false;
+	g_zuul = false;
+	g_tesok = false;
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
 	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-	c_zzz = 1;
+	g_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
 
 	init_lieu();
 	g_soundOff = false;
-	f2_all = false;
+	g_f2_all = false;
 
 	teskbd();
 	dialpre();
@@ -165,7 +165,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	if (g_newGraphicalDevice != g_currGraphicalDevice)
 		g_currGraphicalDevice = g_newGraphicalDevice;
 	hirs();
-	ades = 0x7000;
+	g_ades = 0x7000;
 
 	return Common::kNoError;
 }
@@ -481,7 +481,7 @@ Common::Error MortevielleEngine::run() {
  */
 void MortevielleEngine::showIntroduction() {
 	f3f8::aff50(false);
-	mlec = 0;
+	g_mlec = 0;
 	f3f8::checkForF8(142, false);
 	CHECK_QUIT;
 
@@ -500,10 +500,10 @@ void MortevielleEngine::showIntroduction() {
  * loses, and chooses to start playing the game again.
  */
 void MortevielleEngine::mainGame() {
-	if (rech_cfiec)
+	if (g_rech_cfiec)
 		charge_cfiec();
 
-	for (crep = 1; crep <= c_zzz; ++crep) 
+	for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep) 
 		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	charge_bruit5();
@@ -553,10 +553,10 @@ void MortevielleEngine::handleAction() {
 
 	clsf3();
 	oo = false;
-	ctrm = 0;
-	if (! iesc) {
+	g_ctrm = 0;
+	if (!g_iesc) {
 		g_vm->_menu.drawMenu();
-		imen = true;
+		g_imen = true;
 		temps = 0;
 		g_key = 0;
 		funct = false;
@@ -569,27 +569,27 @@ void MortevielleEngine::handleAction() {
 			moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
-		} while (!((choisi) || (temps > lim) || (funct) || (anyone)));
+		} while (!((g_choisi) || (temps > lim) || (funct) || (g_anyone)));
 		_inMainGameLoop = false;
 
 		g_vm->_menu.eraseMenu();
-		imen = false;
+		g_imen = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (choisi && (g_msg[3] == MENU_SAVE)) {
+		if (g_choisi && (g_msg[3] == MENU_SAVE)) {
 			Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7);
 			g_vm->_savegameManager.saveGame(g_msg[4] & 7, saveName);
 		}
-		if (choisi && (g_msg[3] == MENU_LOAD))
+		if (g_choisi && (g_msg[3] == MENU_LOAD))
 			g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
-				g_msg[4] = mnumo;
+			if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
+				g_msg[4] = g_mnumo;
 				ecr3(g_vm->getEngineString(S_IDEM));
 			} else
 				return;
@@ -610,20 +610,20 @@ void MortevielleEngine::handleAction() {
 			if (g_num == 9999)
 				g_num = 0;
 		} else {
-			mnumo = g_msg[3];
+			g_mnumo = g_msg[3];
 			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
-				mnumo = g_msg[4];
-			if (! anyone) {
-				if ((fouil) || (obpart)) {
+				g_mnumo = g_msg[4];
+			if (!g_anyone) {
+				if ((g_fouil) || (g_obpart)) {
 					if (y_s < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
 						oo = true;
-						if ((g_msg[4] == OPCODE_LIFT) || (obpart)) {
+						if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
 							finfouil();
-							caff = g_s.mlieu;
-							crep = 998;
+							g_caff = g_s.mlieu;
+							g_crep = 998;
 						} else
 							tsuiv();
 						mennor();
@@ -634,17 +634,17 @@ void MortevielleEngine::handleAction() {
 				if (! oo)
 					tsitu();
 
-				if ((ctrm == 0) && (! _loseGame) && (! _endGame)) {
+				if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
-					if (okdes) {
-						okdes = false;
+					if (g_okdes) {
+						g_okdes = false;
 						dessin(0);
 					}
-					if ((! syn) || (g_col))
-						repon(2, crep);
+					if ((!g_syn) || (g_col))
+						repon(2, g_crep);
 				}
-			} while (syn);
-			if (ctrm != 0)
+			} while (g_syn);
+			if (g_ctrm != 0)
 				tctrm();
 		}
 	}
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 9baae57..f26c705 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -260,8 +260,8 @@ void showMouse() {
  * @remarks	Originally called 'pos_mouse'
  */
 void setMousePos(int x, int y) {
-	if (x > 314 * res)
-		x = 314 * res;
+	if (x > 314 * g_res)
+		x = 314 * g_res;
 	else if (x < 0)
 		x = 0;
 	if (y > 199)
@@ -331,16 +331,16 @@ void moveMouse(bool &funct, char &key) {
 			cy = 190;
 			break;
 		case '9':
-			cx = 315 * res;
+			cx = 315 * g_res;
 			cy = 1;
 			break;
 		case '3':
 			cy = 190;
-			cx = 315 * res;
+			cx = 315 * g_res;
 			break;
 		case '5':
 			cy = 100;
-			cx = 155 * res;
+			cx = 155 * g_res;
 			break;
 		case ' ':
 		case '\15':
@@ -394,27 +394,27 @@ void moveMouse(bool &funct, char &key) {
 			}
 			break;
 		case 'I':
-			cx = res * 32;
+			cx = g_res * 32;
 			cy = 8;
 			break;
 		case 'D':
-			cx = 80 * res;
+			cx = 80 * g_res;
 			cy = 8;
 			break;
 		case 'A':
-			cx = 126 * res;
+			cx = 126 * g_res;
 			cy = 8;
 			break;
 		case 'S':
-			cx = 174 * res;
+			cx = 174 * g_res;
 			cy = 8;
 			break;
 		case 'P':
-			cx = 222 * res;
+			cx = 222 * g_res;
 			cy = 8;
 			break;
 		case 'F':
-			cx = res * 270;
+			cx = g_res * 270;
 			cy = 8;
 			break;
 		case '\23':
@@ -422,7 +422,7 @@ void moveMouse(bool &funct, char &key) {
 			return;
 			break;
 		case '\26':
-			zuul = true;
+			g_zuul = true;
 			return;
 			break;
 		case '\24':           // ^T => mode tandy
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 3cc9b34..80eeaa7 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -174,7 +174,7 @@ void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
 
 	/*    debug('  .. Afftex');*/
 	g_vm->_screenSurface.putxy(x, y);
-	if (res == 1)
+	if (g_res == 1)
 		tab = 10;
 	else
 		tab = 6;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 7b2dcab..1ad58ed 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -149,7 +149,7 @@ void chartex() {
  */
 void dialpre() {
 	/* debug('o3 dialpre'); */
-	crep = 998;
+	g_crep = 998;
 	int_m = true;
 }
 
@@ -177,7 +177,7 @@ void music() {
 	if (g_soundOff)
 		return;
 
-	rech_cfiec = true;
+	g_rech_cfiec = true;
 	
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
@@ -222,7 +222,7 @@ void charge_cfiec() {
 	f.read(&adcfiec[0], 822 * 128);
 	f.close();
 
-	rech_cfiec = false;
+	g_rech_cfiec = false;
 }
 
 
@@ -241,16 +241,16 @@ void charge_cfiph() {
 void suite() {
 	hirs();
 	repon(7, 2035);
-	caff = 51;
+	g_caff = 51;
 	taffich();
 	teskbd();
 	if (g_newGraphicalDevice != g_currGraphicalDevice)
 		g_currGraphicalDevice = g_newGraphicalDevice;
 	hirs();
-	dessine(ades, 0, 0);
+	dessine(g_ades, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	g_vm->_screenSurface.putxy(104 + 72 * res, 185);
+	g_vm->_screenSurface.putxy(104 + 72 * g_res, 185);
 	g_vm->_screenSurface.writeg(cpr, 0);
 }
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index cbe460a..9bfbaaf 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -34,7 +34,7 @@ namespace Mortevielle {
 
 void spfrac(int wor) {
 	c3.rep = (uint)wor >> 12;
-	if ((typlec == 0) && (c3.code != 9))
+	if ((g_typlec == 0) && (c3.code != 9))
 		if (((c3.code > 4) && (c3.val != 20) && (c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
 				((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9)))) {
 			++c3.rep;
@@ -47,7 +47,7 @@ void spfrac(int wor) {
 void charg_car() {
 	int wor, int_;
 
-	wor = swap(READ_LE_UINT16(&mem[adword + ptr_word]));
+	wor = swap(READ_LE_UINT16(&mem[adword + g_ptr_word]));
 	int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -82,13 +82,13 @@ void charg_car() {
 	}
 
 	spfrac(wor);
-	ptr_word = ptr_word + 2;
+	g_ptr_word += 2;
 }
 
 
 void entroct(byte o) {
-	mem[adtroct * 16 + ptr_oct] = o;
-	++ptr_oct;
+	mem[adtroct * 16 + g_ptr_oct] = o;
+	++g_ptr_oct;
 }
 
 void veracf(byte b) {
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 2402e37..a96edde 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -54,27 +54,27 @@ void init_chariot() {
 void trait_ph() {
 	const int deca[3] = {300, 30, 40};
 
-	ptr_tcph = num_ph - 1;
-	ledeb = swap(t_cph[ptr_tcph]) + deca[typlec];
-	lefin = swap(t_cph[ptr_tcph + 1]) + deca[typlec];
-	nb_word = lefin - ledeb;
-	ptr_tcph = (uint)ledeb >> 1;
-	ptr_word = 0;
+	g_ptr_tcph = g_num_ph - 1;
+	g_ledeb = swap(t_cph[g_ptr_tcph]) + deca[g_typlec];
+	g_lefin = swap(t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
+	g_nb_word = g_lefin - g_ledeb;
+	g_ptr_tcph = (uint)g_ledeb >> 1;
+	g_ptr_word = 0;
 	do {
-		WRITE_LE_UINT16(&mem[adword + ptr_word], t_cph[ptr_tcph]);
-		ptr_word = ptr_word + 2;
-		ptr_tcph = ptr_tcph + 1;
-	} while (ptr_tcph < (int)((uint)lefin >> 1));
+		WRITE_LE_UINT16(&mem[adword + g_ptr_word], t_cph[g_ptr_tcph]);
+		g_ptr_word += 2;
+		++g_ptr_tcph;
+	} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
 
-	ptr_oct = 0;
-	ptr_word = 0;
+	g_ptr_oct = 0;
+	g_ptr_word = 0;
 	init_chariot();
 
 	do {
 		rot_chariot();
 		charg_car();
 		trait_car();
-	} while (ptr_word < nb_word);
+	} while (g_ptr_word < g_nb_word);
 
 	rot_chariot();
 	trait_car();
@@ -90,10 +90,10 @@ void parole(int rep, int ht, int typ) {
 	if (g_soundOff)
 		return;
 
-	num_ph = rep;
+	g_num_ph = rep;
 	g_haut = ht;
-	typlec = typ;
-	if (typlec != 0) {
+	g_typlec = typ;
+	if (g_typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
 			savph[i] = t_cph[i];
 		tempo = tempo_bruit;
@@ -118,12 +118,12 @@ void parole(int rep, int ht, int typ) {
 	}
 	trait_ph();
 	g_vm->_soundManager.litph(tbi, typ, tempo);
-	if (typlec != 0)
+	if (g_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
 			t_cph[i] = savph[i];
-			mlec = typlec;
+			g_mlec = g_typlec;
 		}
-	writepal(numpal);
+	writepal(g_numpal);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 6dd8df1..b34e64a 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -52,15 +52,15 @@ void changeGraphicalDevice(int newDevice) {
 	dessine_rouleau();
 	tinke();
 	drawClock();
-	if (ipers != 0)
-		affper(ipers);
+	if (g_ipers != 0)
+		affper(g_ipers);
 	else
 		person();
 	clsf2();
 	clsf3();
 	g_maff = 68;
 	afdes(0);
-	repon(2, crep);
+	repon(2, g_crep);
 	g_vm->_menu.displayMenu();
 }
 
@@ -74,44 +74,44 @@ void MortevielleEngine::gameLoaded() {
 	char g[8];
 
 	hideMouse();
-	imen = false;
+	g_imen = false;
 	g[1] = 'M';
 	_loseGame = true;
-	anyone = false;
-	okdes = true;
+	g_anyone = false;
+	g_okdes = true;
 	test[0] = false;
 	test[1] = false;
 	g[0] = '\040';
 	g_col = false;
-	tesok = true;
+	g_tesok = true;
 	test[2] = false;
 	g[7] = g[0];
 	g[2] = 'A';
-	cache = false;
-	brt = false;
+	g_cache = false;
+	g_brt = false;
 	g_maff = 68;
 	g[5] = 'E';
-	mnumo = 0;
-	prebru = 0;
+	g_mnumo = 0;
+	g_prebru = 0;
 	g[4] = 'T';
 	g_x = 0;
 	g_y = 0;
 	g_num = 0;
-	hdb = 0;
-	hfb = 0;
-	cs = 0;
+	g_hdb = 0;
+	g_hfb = 0;
+	g_cs = 0;
 	is = 0;
 	k = 0;
-	ment = 0;
-	syn = true;
-	fouil = true;
-	mchai = 0;
-	inei = 0;
+	g_ment = 0;
+	g_syn = true;
+	g_fouil = true;
+	g_mchai = 0;
+	g_inei = 0;
 	initouv();
 	g[3] = 'S';
 	g[6] = 'R';
-	iouv = 0;
-	dobj = 0;
+	g_iouv = 0;
+	g_dobj = 0;
 	affrep();
 	_hintPctMessage = deline(580);
 	while ((test[k] == false) && (k < 2)) {
@@ -121,16 +121,16 @@ void MortevielleEngine::gameLoaded() {
 		// presumably for copy protection. This has been replaced with hardcoded success
 		test[k] = true;
 
-		okdes = false;
+		g_okdes = false;
 		_endGame = true;
 		_loseGame = false;
-		fouil = false;
+		g_fouil = false;
 	}
 	person();
 	tinke();
 	drawClock();
 	afdes(0);
-	repon(2, crep);
+	repon(2, g_crep);
 	clsf3();
 	_endGame = false;
 	tmlieu(g_s.mlieu);
@@ -138,7 +138,7 @@ void MortevielleEngine::gameLoaded() {
 	if (g_s.derobj != 0)
 		modobj2(g_s.derobj + 400, test[1], test[2]);
 	else
-		tesok = test[1] || test[2];
+		g_tesok = test[1] || test[2];
 	showMouse();
 }
 
@@ -161,12 +161,12 @@ void tsitu() {
 
 	if (!g_col)
 		clsf2();
-	syn = false;
-	iesc = false;
-	if (!anyone) {
-		if (brt)
+	g_syn = false;
+	g_iesc = false;
+	if (!g_anyone) {
+		if (g_brt)
 			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
-				ctrm = 4;
+				g_ctrm = 4;
 				mennor();
 				return;
 			}
@@ -226,14 +226,14 @@ void tsitu() {
 			fctSelfPut();
 		if (g_msg[4] == OPCODE_SLOOK)
 			fctSelftLook();
-		cache = false;
+		g_cache = false;
 
 		if (g_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
-		if (anyone) {
+		if (g_anyone) {
 			quelquun();
-			anyone = false;
+			g_anyone = false;
 			mennor();
 			return;
 		}
@@ -245,15 +245,15 @@ void tsitu() {
 	if (((g_s.mlieu < 16) || (g_s.mlieu > 19)) && (g_s.mlieu != 23)
 	        && (g_s.mlieu != 0) && (g_s.derobj != 152) && (!g_vm->_loseGame)) {
 		if ((g_s.conf > 99) && (h > 8) && (h < 16)) {
-			crep = 1501;
+			g_crep = 1501;
 			tperd();
 		}
 		if ((g_s.conf > 99) && (h > 0) && (h < 9)) {
-			crep = 1508;
+			g_crep = 1508;
 			tperd();
 		}
 		if ((j > 1) && (h > 8) && (!g_vm->_loseGame)) {
-			crep = 1502;
+			g_crep = 1502;
 			tperd();
 		}
 	}
@@ -263,13 +263,13 @@ void tsitu() {
 /* NIVEAU 1 */
 
 void theure() {
-	vj = ord(g_s.heure);
-	vh = vj % 48;
-	vj /= 48;
-	vm = vh % 2;
-	vh /= 2;
-	g_hour = vh;
-	if (vm == 1)
+	g_vj = ord(g_s.heure);
+	g_vh = g_vj % 48;
+	g_vj /= 48;
+	g_vm__ = g_vh % 2;
+	g_vh /= 2;
+	g_hour = g_vh;
+	if (g_vm__ == 1)
 		g_minute = 30;
 	else
 		g_minute = 0;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 1694387..8d9e67f 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -100,7 +100,7 @@ void taffich() {
 	int alllum[16];
 
 
-	int a = caff;
+	int a = g_caff;
 	if ((a >= 153) && (a <= 161))
 		a = tran2[a - 153];
 	else if ((a >= 136) && (a <= 140))
@@ -147,7 +147,7 @@ void taffich() {
 		break;
 	}
 
-	okdes = true;
+	g_okdes = true;
 	hideMouse();
 	lgt = 0;
 	Common::String filename;
@@ -221,7 +221,7 @@ void taffich() {
 			alllum[k] = -1;
 		}
 	}
-	numpal = npal;
+	g_numpal = npal;
 	writepal(npal);
 
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
@@ -247,9 +247,9 @@ void taffich() {
 	if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
-		else if (! blo)
+		else if (!g_blo)
 			t11(g_s.mlieu, cx);
-		mpers =  0;
+		g_mpers =  0;
 	}
 }
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 138b604..8873c7e 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,95 +78,95 @@ const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool blo,
-        bh1,
-        bf1,
-        bh2,
-        bh4,
-        bf4,
-        bh5,
-        bh6,
-        bh8,
-        bt3,
-        bt7,
-        bh9,
+bool g_blo,
+        g_bh1,
+        g_bf1,
+        g_bh2,
+        g_bh4,
+        g_bf4,
+        g_bh5,
+        g_bh6,
+        g_bh8,
+        g_bt3,
+        g_bt7,
+        g_bh9,
 
         g_soundOff,
-        main1,
-        choisi,
-        test0,
-        f2_all,
-        imen,
-        cache,
-        iesc,
+        g_main1,
+        g_choisi,
+        g_test0,
+        g_f2_all,
+        g_imen,
+        g_cache,
+        g_iesc,
         g_col,
-        syn,
-        fouil,
-        zuul,
-        tesok,
-        obpart,
-        okdes,
-        arret,
-        anyone,
-        brt,
-        rect,
-        rech_cfiec;
+        g_syn,
+        g_fouil,
+        g_zuul,
+        g_tesok,
+        g_obpart,
+        g_okdes,
+        g_arret,
+        g_anyone,
+        g_brt,
+        g_rect,
+        g_rech_cfiec;
 
 
 int g_x,
         g_y,
         g_t,
-        vj,
-        li,
-        vh,
-        vm,
-        jh,
-        mh,
-        cs,
+        g_vj,
+        g_li,
+        g_vh,
+        g_vm__,
+        g_jh,
+        g_mh,
+        g_cs,
         g_currGraphicalDevice,
-        hdb,
-        hfb,
+        g_hdb,
+        g_hfb,
         g_hour,
         g_day,
         g_key,
         g_minute,
         g_num,
-        res,
-        ment,
+        g_res,
+        g_ment,
         g_haut,
-        caff,
+        g_caff,
         g_maff,
-        crep,
-        ades,
-        iouv,
-        inei,
-        ctrm,
-        dobj,
-        msg3,
-        msg4,
-        mlec,
+        g_crep,
+        g_ades,
+        g_iouv,
+        g_inei,
+        g_ctrm,
+        g_dobj,
+        g_msg3,
+        g_msg4,
+        g_mlec,
         g_newGraphicalDevice,
-        c_zzz,
-        mchai,
-        menup,
-        ipers,
-        ledeb,
-        lefin,
-        mpers,
-        mnumo,
-        xprec,
-        yprec,
-        perdep,
-        prebru,
-        typlec,
-        num_ph,
-        numpal,
-        nb_word,
-        ptr_oct,
-        k_tempo,
-        ptr_tcph,
-        ptr_word,
-        color_txt;
+        g_c_zzz,
+        g_mchai,
+        g_menup,
+        g_ipers,
+        g_ledeb,
+        g_lefin,
+        g_mpers,
+        g_mnumo,
+        g_xprec,
+        g_yprec,
+        g_perdep,
+        g_prebru,
+        g_typlec,
+        g_num_ph,
+        g_numpal,
+        g_nb_word,
+        g_ptr_oct,
+        g_k_tempo,
+        g_ptr_tcph,
+        g_ptr_word,
+        g_color_txt;
 
 int t_cph[6401];
 byte tabdon[4001];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 1ccea2c..3b2e44d 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -219,94 +219,94 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-extern bool blo,
-        bh1,
-        bf1,
-        bh2,
-        bh4,
-        bf4,
-        bh5,
-        bh6,
-        bh8,
-        bt3,
-        bt7,
-        bh9,
+extern bool g_blo,
+        g_bh1,
+        g_bf1,
+        g_bh2,
+        g_bh4,
+        g_bf4,
+        g_bh5,
+        g_bh6,
+        g_bh8,
+        g_bt3,
+        g_bt7,
+        g_bh9,
 
         g_soundOff,
-        main1,
-        choisi,
-        test0,
-        f2_all,
-        imen,
-        cache,
-        iesc,
+        g_main1,
+        g_choisi,
+        g_test0,
+        g_f2_all,
+        g_imen,
+        g_cache,
+        g_iesc,
         g_col,
-        syn,
-        fouil,
-        zuul,
-        tesok,
-        obpart,
-        okdes,
-        anyone,
-        brt,
-        rect,
-        rech_cfiec;
+        g_syn,
+        g_fouil,
+        g_zuul,
+        g_tesok,
+        g_obpart,
+        g_okdes,
+        g_anyone,
+        g_brt,
+        g_rect,
+        g_rech_cfiec;
 
 
 extern int g_x,
         g_y,
         g_t,
-        vj,
-        li,
-        vh,
-        vm,
-        jh,
-        mh,
-        cs,
+        g_vj,
+        g_li,
+        g_vh,
+        g_vm__,
+        g_jh,
+        g_mh,
+        g_cs,
         g_currGraphicalDevice,
-        hdb,
-        hfb,
+        g_hdb,
+        g_hfb,
         g_hour,
         g_day,
         g_key,
         g_minute,
         g_num,
-        res,
-        ment,
+        g_res,
+        g_ment,
         g_haut,
-        caff,
+        g_caff,
         g_maff,
-        crep,
-        ades,
-        iouv,
-        inei,
-        ctrm,
-        dobj,
-        msg3,
-        msg4,
-        mlec,
+        g_crep,
+        g_ades,
+        g_iouv,
+        g_inei,
+        g_ctrm,
+        g_dobj,
+        g_msg3,
+        g_msg4,
+        g_mlec,
         g_newGraphicalDevice,
-        c_zzz,
-        mchai,
-        menup,
-        ipers,
-        ledeb,
-        lefin,
-        mpers,
-        mnumo,
-        xprec,
-        yprec,
-        perdep,
-        prebru,
-        typlec,
-        num_ph,
-        numpal,
-        nb_word,
-        ptr_oct,
-        k_tempo,
-        ptr_tcph,
-        ptr_word,
-        color_txt;
+        g_c_zzz,
+        g_mchai,
+        g_menup,
+        g_ipers,
+        g_ledeb,
+        g_lefin,
+        g_mpers,
+        g_mnumo,
+        g_xprec,
+        g_yprec,
+        g_perdep,
+        g_prebru,
+        g_typlec,
+        g_num_ph,
+        g_numpal,
+        g_nb_word,
+        g_ptr_oct,
+        g_k_tempo,
+        g_ptr_tcph,
+        g_ptr_word,
+        g_color_txt;
 
 extern int t_cph[6401];
 extern byte tabdon[4001];


Commit: b67858b3d49ae0cdd7d4ecde9f5999664150cde6
    https://github.com/scummvm/scummvm/commit/b67858b3d49ae0cdd7d4ecde9f5999664150cde6
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:26-07:00

Commit Message:
MORTEVIELLE: rename more globals and constants, remove t_nhom usage

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/level15.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index d115ef3..8441315 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,13 +49,13 @@ namespace Mortevielle {
 void fctMove() {
 	int cx;
 
-	if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		g_s.mlieu = 15;
-		g_caff = g_s.mlieu;
+	if ((g_s._mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+		g_s._mlieu = 15;
+		g_caff = g_s._mlieu;
 		afdes(0);
-		repon(2, g_s.mlieu);
+		repon(2, g_s._mlieu);
 	}
-	if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s._mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
@@ -67,13 +67,13 @@ void fctMove() {
 		if (g_num == 0)
 			return;
 		if (g_num == 1) {
-			g_s.mlieu = 0;
+			g_s._mlieu = 0;
 			tmlieu(0);
 		} else if (g_num == 7) {
-			g_s.mlieu = 13;
+			g_s._mlieu = 13;
 			tmlieu(13);
 		} else if (g_num != 6)
-			g_s.mlieu = 26;
+			g_s._mlieu = 26;
 		if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
 		if (g_num > 7)
@@ -89,55 +89,60 @@ void fctMove() {
 	do {
 		++cx;
 	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
-	if (g_s.mlieu == 19) {
+
+	if (g_s._mlieu == 19) {
 		if (cx == 1)
 			t1deva();
 		if (cx == 2)
 			t1neig();
 		goto L2;
 	}
-	if (g_s.mlieu == 23) {
+
+	if (g_s._mlieu == 23) {
 		if (cx == 1)
 			t1deau();
 		if (cx == 2)
 			t1derr();
 		goto L2;
 	}
-	if ((g_s.mlieu == 11) && (cx == 1))
+
+	if ((g_s._mlieu == 11) && (cx == 1))
 		cx = 6;
-	if (g_s.mlieu == 12) {
+
+	if (g_s._mlieu == 12) {
 		if (cx == 2)
 			cx = 6;
 		if (cx == 5)
 			cx = 16;
 	}
-	if ((g_s.mlieu == 14) && (cx == 3))
+
+	if ((g_s._mlieu == 14) && (cx == 3))
 		cx = 6;
-	if (((g_s.mlieu == 15) || (g_s.mlieu == 26)) && (cx == 4))
+	if (((g_s._mlieu == 15) || (g_s._mlieu == 26)) && (cx == 4))
 		cx = 6;
-	if ((g_s.mlieu > 19) && (g_s.mlieu != 26))
+	if ((g_s._mlieu > 19) && (g_s._mlieu != 26))
 		cx += 10;
-	if ((g_s.mlieu == 20) && (cx == 13))
+	if ((g_s._mlieu == 20) && (cx == 13))
 		cx = 16;
-	if (g_s.mlieu == 21) {
+	if (g_s._mlieu == 21) {
 		if (cx == 12)
 			cx = 16;
 		else if (cx > 13)
 			cx = 15;
 	}
-	if ((g_s.mlieu == 22) && (cx > 14))
+	if ((g_s._mlieu == 22) && (cx > 14))
 		cx = 15;
-	if ((g_s.mlieu == 24) && (cx != 17))
+	if ((g_s._mlieu == 24) && (cx != 17))
 		if (cx > 13)
 			cx = 15;
 	if (cx == 1)
-		g_s.mlieu = 11;
+		g_s._mlieu = 11;
 	else if (cx == 2)
-		g_s.mlieu = 12;
+		g_s._mlieu = 12;
 	else if (cx == 3)
-		g_s.mlieu = 14;
+		g_s._mlieu = 14;
 	else if (cx == 4)
-		g_s.mlieu = 15;
+		g_s._mlieu = 15;
 	else if (cx == 5)
 		cx = 12;
 	if (cx == 6)
@@ -147,31 +152,31 @@ void fctMove() {
 	else if (cx == 12)
 		t1deva();
 	else if (cx == 13)
-		g_s.mlieu = 20;
+		g_s._mlieu = 20;
 	else if (cx == 14)
-		g_s.mlieu = 24;
+		g_s._mlieu = 24;
 	else if (cx == 15)
 		t1neig();
 	else if (cx == 16)
 		t1derr();
 	else if (cx == 17) {
-		if ((g_s.ipuit != 120) && (g_s.ipuit != 140))
+		if ((g_s._ipuit != 120) && (g_s._ipuit != 140))
 			g_crep = 997;
-		else if (g_s.ipuit == 120)
+		else if (g_s._ipuit == 120)
 			g_crep = 181;
-		else if (g_s.conf > 80) {
+		else if (g_s._conf > 80) {
 			g_crep = 1505;
 			tperd();
 		} else {
-			g_s.mlieu = 23;
+			g_s._mlieu = 23;
 			affrep();
 		}
 	}
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
-	debloc(g_s.mlieu);
+	debloc(g_s._mlieu);
 L2:
-	tmlieu(g_s.mlieu);
+	tmlieu(g_s._mlieu);
 }
 
 /**
@@ -184,33 +189,33 @@ void fctTake() {
 		avpoing(cx);
 		if (g_crep != 139) {
 			if (g_ipers > 0)
-				g_s.conf += 3;
+				g_s._conf += 3;
 			if (g_obpart) {
-				if (g_s.mlieu == 2)
-					g_s.iloic = 0;
-				if (g_s.mlieu == 13) {
-					if (g_s.iboul == g_caff)
-						g_s.iboul = 0;
-					if (g_s.ibag == g_caff)
-						g_s.ibag = 0;
+				if (g_s._mlieu == 2)
+					g_s._iloic = 0;
+				if (g_s._mlieu == 13) {
+					if (g_s._iboul == g_caff)
+						g_s._iboul = 0;
+					if (g_s._ibag == g_caff)
+						g_s._ibag = 0;
 				}
-				if (g_s.mlieu == 14)
-					g_s.icave = 0;
-				if (g_s.mlieu == 16)
-					g_s.icryp = 0;
-				if (g_s.mlieu == 17)
-					g_s.ivier = 0;
-				if (g_s.mlieu == 24)
-					g_s.ipuit = 0;
+				if (g_s._mlieu == 14)
+					g_s._icave = 0;
+				if (g_s._mlieu == 16)
+					g_s._icryp = 0;
+				if (g_s._mlieu == 17)
+					g_s._ivier = 0;
+				if (g_s._mlieu == 24)
+					g_s._ipuit = 0;
 				mfouen();
 				g_obpart = false;
 				affrep();
 			} else {
-				tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
+				g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
-					g_s.conf += 2;
+					g_s._conf += 2;
 					g_dobj = 0;
 				}
 			}
@@ -230,40 +235,40 @@ void fctTake() {
 		}
 	}
 	tcoord(5);
-	if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) {
+	if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == 16))) {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
-				g_s.conf += 3;
+				g_s._conf += 3;
 			g_crep = 997;
-			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
-				avpoing(g_s.iloic);
-			if ((g_s.mlieu == 13) && (g_num == 1) && (g_s.iboul != 0)) {
-				avpoing(g_s.iboul);
+			if ((g_s._mlieu == 2) && (g_s._iloic != 0))
+				avpoing(g_s._iloic);
+			if ((g_s._mlieu == 13) && (g_num == 1) && (g_s._iboul != 0)) {
+				avpoing(g_s._iboul);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 7);
 			}
-			if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) {
-				avpoing(g_s.ibag);
+			if ((g_s._mlieu == 13) && (g_num == 2) && (g_s._ibag != 0)) {
+				avpoing(g_s._ibag);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 6);
 			}
-			if ((g_s.mlieu == 14) && (g_s.icave != 0)) {
-				avpoing(g_s.icave);
+			if ((g_s._mlieu == 14) && (g_s._icave != 0)) {
+				avpoing(g_s._icave);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 2);
 			}
-			if ((g_s.mlieu == 16) && (g_s.icryp != 0))
-				avpoing(g_s.icryp);
-			if ((g_s.mlieu == 17) && (g_s.ivier != 0)) {
-				avpoing(g_s.ivier);
+			if ((g_s._mlieu == 16) && (g_s._icryp != 0))
+				avpoing(g_s._icryp);
+			if ((g_s._mlieu == 17) && (g_s._ivier != 0)) {
+				avpoing(g_s._ivier);
 				if ((g_crep != 997) && (g_crep != 139)) {
 					g_crep = 182;
 					aniof(2, 1);
 				}
 			}
-			if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) {
-				avpoing(g_s.ipuit);
+			if ((g_s._mlieu == 24) && (g_s._ipuit != 0)) {
+				avpoing(g_s._ipuit);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 1);
 			}
@@ -271,15 +276,15 @@ void fctTake() {
 				g_crep = 999;
 		}
 	} else {
-		if ( ((g_s.mlieu == 0)  && (g_num == 3)) || ((g_s.mlieu == 1)  && (g_num == 4))
-		  || ((g_s.mlieu == 2)  && (g_num == 1)) || ((g_s.mlieu == 4)  && (g_num == 3))
-		  || ((g_s.mlieu == 5)  && (g_num == 6)) || ((g_s.mlieu == 6)  && (g_num == 2))
-		  || ((g_s.mlieu == 7)  && (g_num == 6)) || ((g_s.mlieu == 8)  && (g_num == 4))
-		  || ((g_s.mlieu == 9)  && (g_num == 4)) || ((g_s.mlieu == 10) && (g_num > 2))
-		  || ((g_s.mlieu == 11) && (g_num == 7)) || ((g_s.mlieu == 12) && (g_num == 6))
-		  || ((g_s.mlieu == 13) && (g_num > 4))  || ((g_s.mlieu > 13)  && (g_s.mlieu != 23)) )
+		if ( ((g_s._mlieu == 0)  && (g_num == 3)) || ((g_s._mlieu == 1)  && (g_num == 4))
+		  || ((g_s._mlieu == 2)  && (g_num == 1)) || ((g_s._mlieu == 4)  && (g_num == 3))
+		  || ((g_s._mlieu == 5)  && (g_num == 6)) || ((g_s._mlieu == 6)  && (g_num == 2))
+		  || ((g_s._mlieu == 7)  && (g_num == 6)) || ((g_s._mlieu == 8)  && (g_num == 4))
+		  || ((g_s._mlieu == 9)  && (g_num == 4)) || ((g_s._mlieu == 10) && (g_num > 2))
+		  || ((g_s._mlieu == 11) && (g_num == 7)) || ((g_s._mlieu == 12) && (g_num == 6))
+		  || ((g_s._mlieu == 13) && (g_num > 4))  || ((g_s._mlieu > 13)  && (g_s._mlieu != 23)) )
 		  g_crep = 997;
-		else if (g_s.mlieu == 23) {
+		else if (g_s._mlieu == 23) {
 			g_crep = 1504;
 			tperd();
 		} else
@@ -301,11 +306,11 @@ void fctInventoryTake() {
 	cy = 0;
 	do {
 		++cy;
-		if (ord(g_s.sjer[cy]) != 0)
+		if (ord(g_s._sjer[cy]) != 0)
 			++cz;
 	} while (cz != cx);
-	cz = ord(g_s.sjer[cy]);
-	g_s.sjer[cy] = chr(0);
+	cz = ord(g_s._sjer[cy]);
+	g_s._sjer[cy] = chr(0);
 	modinv();
 	avpoing(cz);
 	g_crep = 998;
@@ -329,21 +334,21 @@ void fctLift() {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
-				++g_s.conf;
+				++g_s._conf;
 			g_crep = 997;
-			if ((g_s.mlieu == 2) && (g_s.iloic != 0))
-				treg(g_s.iloic);
+			if ((g_s._mlieu == 2) && (g_s._iloic != 0))
+				treg(g_s._iloic);
 		}
 		return;
 	}
 	if (g_ipers > 0)
-		++g_s.conf;
-	cx = g_s.mlieu;
-	if (g_s.mlieu == 16)
+		++g_s._conf;
+	cx = g_s._mlieu;
+	if (g_s._mlieu == 16)
 		cx = 14;
-	else if (g_s.mlieu == 19)
+	else if (g_s._mlieu == 19)
 		cx = 15;
-	g_crep = tabdon[asoul + (cx << 3) + (g_num - 1)];
+	g_crep = g_tabdon[asoul + (cx << 3) + (g_num - 1)];
 	if (g_crep == 255)
 		g_crep = 997;
 }
@@ -372,10 +377,10 @@ void fctRead() {
  * @remarks	Originally called 'tslire'
  */
 void fctSelfRead() {
-	if (g_s.derobj == 0)
+	if (g_s._derobj == 0)
 		g_crep = 186;
 	else
-		st4(g_s.derobj);
+		st4(g_s._derobj);
 }
 
 /**
@@ -399,60 +404,60 @@ void fctLook() {
 		tcoord(8);
 		g_crep = 131;
 		if (g_num != 0) {
-			if (g_s.mlieu == 13) {
+			if (g_s._mlieu == 13) {
 				if (g_num == 1) {
 					g_crep = 164;
-					if (g_s.ibag != 0)
-						treg(g_s.ibag);
-					else if (g_s.iboul != 0)
-						treg(g_s.iboul);
+					if (g_s._ibag != 0)
+						treg(g_s._ibag);
+					else if (g_s._iboul != 0)
+						treg(g_s._iboul);
 				} else {
 					g_crep = 193;
-					if (g_s.ibag != 0)
-						treg(g_s.ibag);
+					if (g_s._ibag != 0)
+						treg(g_s._ibag);
 				}
 			}
-			if (g_s.mlieu == 14) {
+			if (g_s._mlieu == 14) {
 				g_crep = 164;
-				if (g_s.icave != 0)
-					treg(g_s.icave);
+				if (g_s._icave != 0)
+					treg(g_s._icave);
 			}
-			if (g_s.mlieu == 17) {
+			if (g_s._mlieu == 17) {
 				g_crep = 174;
-				if (g_s.ivier != 0)
-					treg(g_s.ivier);
+				if (g_s._ivier != 0)
+					treg(g_s._ivier);
 			}
-			if (g_s.mlieu == 24) {
+			if (g_s._mlieu == 24) {
 				g_crep = 131;
-				if (g_s.ipuit != 0)
-					treg(g_s.ipuit);
+				if (g_s._ipuit != 0)
+					treg(g_s._ipuit);
 			}
 		}
 		return;
 	}
-	cx = g_s.mlieu;
-	if (g_s.mlieu == 20)
+	cx = g_s._mlieu;
+	if (g_s._mlieu == 20)
 		cx = 17;
-	if ((g_s.mlieu > 21) && (g_s.mlieu < 25))
+	if ((g_s._mlieu > 21) && (g_s._mlieu < 25))
 		cx -= 4;
-	if (g_s.mlieu == 26)
+	if (g_s._mlieu == 26)
 		cx = 21;
-	g_crep = tabdon[arega + (cx * 7) + g_num - 1];
-	if ((g_s.mlieu == 13) && (g_num == 8))
+	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
+	if ((g_s._mlieu == 13) && (g_num == 8))
 		g_crep = 126;
-	if (g_s.mlieu == 19)
+	if (g_s._mlieu == 19)
 		g_crep = 103;
 	if (g_crep == 255)
 		g_crep = 131;
-	if ((g_s.mlieu == 1) && (g_num == 1))
+	if ((g_s._mlieu == 1) && (g_num == 1))
 		treg(144);
-	if ((g_s.mlieu == 5) && (g_num == 3))
+	if ((g_s._mlieu == 5) && (g_num == 3))
 		treg(147);
-	if ((g_s.mlieu == 8) && (g_num == 3))
+	if ((g_s._mlieu == 8) && (g_num == 3))
 		treg(149);
-	if ((g_s.mlieu == 9) && (g_num == 2))
+	if ((g_s._mlieu == 9) && (g_num == 2))
 		treg(30);
-	if ((g_s.mlieu == 10) && (g_num == 3))
+	if ((g_s._mlieu == 10) && (g_num == 3))
 		treg(31);
 }
 
@@ -461,8 +466,8 @@ void fctLook() {
  * @remarks	Originally called 'tsregarder'
  */
 void fctSelftLook() {
-	if (g_s.derobj != 0)
-		treg(g_s.derobj);
+	if (g_s._derobj != 0)
+		treg(g_s._derobj);
 	else
 		g_crep = 186;
 }
@@ -486,7 +491,7 @@ void fctSearch() {
 	if (g_anyone || g_iesc)
 		return;
 
-	if (g_s.mlieu == 23) {
+	if (g_s._mlieu == 23) {
 		g_crep = 1504;
 		tperd();
 		return;
@@ -499,17 +504,17 @@ void fctSearch() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(touv[cx])));
-			if (g_num != ord(touv[cx]))
+			} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+			if (g_num != ord(g_touv[cx]))
 				g_crep = 187;
 			else {
 				if (g_ipers > 0)
-					g_s.conf += 3;
+					g_s._conf += 3;
 
 				rechai(g_mchai);
 				if (g_mchai != 0) {
 					g_cs = 0;
-					is = 0;
+					g_is = 0;
 					g_fouil = true;
 					mfoudi();
 					tsuiv();
@@ -521,41 +526,41 @@ void fctSearch() {
 			g_crep = 997;
 			if (g_num != 0) {
 				if (g_ipers > 0)
-					g_s.conf += 3;
-				if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) {
-					if (g_s.mlieu == 2) {
+					g_s._conf += 3;
+				if ((g_s._mlieu != 24) && (g_s._mlieu != 17) && (g_s._mlieu != 13)) {
+					if (g_s._mlieu == 2) {
 						g_crep = 123;
-						if (g_s.iloic != 0)
-							treg(g_s.iloic);
+						if (g_s._iloic != 0)
+							treg(g_s._iloic);
 					}
-					if (g_s.mlieu == 16) {
+					if (g_s._mlieu == 16) {
 						g_crep = 123;
-						if (g_s.icryp != 0)
-							treg(g_s.icryp);
+						if (g_s._icryp != 0)
+							treg(g_s._icryp);
 					}
 				}
 			}
 		}
 	} else {
 		if (g_ipers > 0)
-			g_s.conf += 3;
+			g_s._conf += 3;
 		g_crep = 997;
-		if (g_s.mlieu < 14)
-			g_crep = r[g_s.mlieu];
+		if (g_s._mlieu < 14)
+			g_crep = r[g_s._mlieu];
 
-		if ((g_s.mlieu == 3) && (g_num == 2))
+		if ((g_s._mlieu == 3) && (g_num == 2))
 			g_crep = 162;
 
-		if (g_s.mlieu == 12) {
+		if (g_s._mlieu == 12) {
 			if ((g_num == 3) || (g_num == 4))
 				g_crep = 162;
 			else if (g_num == 5)
 				g_crep = 159;
 		}
 
-		if (g_s.mlieu == 19)
+		if (g_s._mlieu == 19)
 			g_crep = 104;
-		else if (g_s.mlieu == 16)
+		else if (g_s._mlieu == 16)
 			g_crep = 155;
 	}
 }
@@ -565,8 +570,8 @@ void fctSearch() {
  * @remarks	Originally called 'tsfouiller'
  */
 void fctSelfSearch() {
-	if (g_s.derobj != 0)
-		st7(g_s.derobj);
+	if (g_s._derobj != 0)
+		st7(g_s._derobj);
 	else
 		g_crep = 186;
 }
@@ -600,32 +605,32 @@ void fctOpen() {
 	tcoord(7);
 	if (g_num != 0) {
 		if (g_ipers > 0)
-			g_s.conf += 2;
+			g_s._conf += 2;
 		++g_iouv;
 		int cx = 0;
 		do {
 			++cx;
-		} while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == g_num)));
-		if (ord(touv[cx]) != g_num) {
-			if (!( ((g_num == 3) && ((g_s.mlieu == 0) || (g_s.mlieu == 9) || (g_s.mlieu == 5) || (g_s.mlieu == 7)))
-			    || ((g_num == 4) && ((g_s.mlieu == 1) || (g_s.mlieu == 2) || (g_s.mlieu == 6)))
-				|| ((g_s.mlieu == 4) && (g_num == 5))
-				|| ((g_num == 6) && ((g_s.mlieu == 7) || (g_s.mlieu == 10) || (g_s.mlieu == 8) || (g_s.mlieu == 13)))
-				|| ((g_s.mlieu == 8) && (g_num == 2))
-				|| ((g_s.mlieu == 12) && (g_num == 7))) ) {
-				if ( ((g_s.mlieu > 10) && (g_s.mlieu < 14))
-				  || ((g_s.mlieu > 6) && (g_s.mlieu < 10))
-				  || (g_s.mlieu == 0) || (g_s.mlieu == 2) || (g_s.mlieu == 5)) {
+		} while (!((cx > 6) || (ord(g_touv[cx]) == 0) || (ord(g_touv[cx]) == g_num)));
+		if (ord(g_touv[cx]) != g_num) {
+			if (!( ((g_num == 3) && ((g_s._mlieu == 0) || (g_s._mlieu == 9) || (g_s._mlieu == 5) || (g_s._mlieu == 7)))
+			    || ((g_num == 4) && ((g_s._mlieu == 1) || (g_s._mlieu == 2) || (g_s._mlieu == 6)))
+				|| ((g_s._mlieu == 4) && (g_num == 5))
+				|| ((g_num == 6) && ((g_s._mlieu == 7) || (g_s._mlieu == 10) || (g_s._mlieu == 8) || (g_s._mlieu == 13)))
+				|| ((g_s._mlieu == 8) && (g_num == 2))
+				|| ((g_s._mlieu == 12) && (g_num == 7))) ) {
+				if ( ((g_s._mlieu > 10) && (g_s._mlieu < 14))
+				  || ((g_s._mlieu > 6) && (g_s._mlieu < 10))
+				  || (g_s._mlieu == 0) || (g_s._mlieu == 2) || (g_s._mlieu == 5)) {
 					if (hazard(1, 4) == 3)
 						parole(7, 9, 1);
 				}
-				touv[cx] = chr(g_num);
+				g_touv[cx] = chr(g_num);
 				aniof(1, g_num);
 			}
-			cx = g_s.mlieu;
-			if (g_s.mlieu == 16)
+			cx = g_s._mlieu;
+			if (g_s._mlieu == 16)
 				cx = 14;
-			g_crep = tabdon[aouvr + (cx * 7) + g_num - 1];
+			g_crep = g_tabdon[aouvr + (cx * 7) + g_num - 1];
 			if (g_crep == 254)
 				g_crep = 999;
 		} else
@@ -638,7 +643,7 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	if (g_s.derobj == 0) {
+	if (g_s._derobj == 0) {
 		g_crep = 186;
 		return;
 	}
@@ -658,28 +663,28 @@ void fctPlace() {
 		g_crep = 999;
 		if (g_caff == 13) {
 			if (g_num == 1) {
-				if (g_s.iboul != 0) {
+				if (g_s._iboul != 0) {
 					g_crep = 188;
 				} else {
-					g_s.iboul = g_s.derobj;
-					if (g_s.derobj == 141)
+					g_s._iboul = g_s._derobj;
+					if (g_s._derobj == 141)
 						aniof(1, 7);
 				}
-			} else if (g_s.ibag != 0) {
+			} else if (g_s._ibag != 0) {
 				g_crep = 188;
 			} else {
-				g_s.ibag = g_s.derobj;
-				if (g_s.derobj == 159)
+				g_s._ibag = g_s._derobj;
+				if (g_s._derobj == 159)
 					aniof(1, 6);
 			}
 		}
 
 		if (g_caff == 14) {
-			if (g_s.icave != 0) {
+			if (g_s._icave != 0) {
 				g_crep = 188;
 			} else {
-				g_s.icave = g_s.derobj;
-				if (g_s.derobj == 151) {
+				g_s._icave = g_s._derobj;
+				if (g_s._derobj == 151) {
 					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
@@ -689,7 +694,7 @@ void fctPlace() {
 
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
-					if (answer== 1) {
+					if (answer == 1) {
 						Common::String alertTxt = deline(582);
 						Alert::show(alertTxt, 1);
 
@@ -710,10 +715,10 @@ void fctPlace() {
 
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
-							g_s.mlieu = 17;
+							g_s._mlieu = 17;
 							tmlieu(17);
 						} else {
-							tmlieu(g_s.mlieu);
+							tmlieu(g_s._mlieu);
 							writepal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -735,17 +740,17 @@ void fctPlace() {
 		}
 
 		if (g_caff == 16) {
-			if (g_s.icryp == 0)
-				g_s.icryp = g_s.derobj;
+			if (g_s._icryp == 0)
+				g_s._icryp = g_s._derobj;
 			else
 				g_crep = 188;
 		}
 
 		if (g_caff == 17) {
-			if (g_s.ivier != 0) {
+			if (g_s._ivier != 0) {
 				g_crep = 188;
-			} else if (g_s.derobj == 143) {
-				g_s.ivier = 143;
+			} else if (g_s._derobj == 143) {
+				g_s._ivier = 143;
 				aniof(1, 1);
 			} else {
 				g_crep = 1512;
@@ -754,10 +759,10 @@ void fctPlace() {
 		}
 
 		if (g_caff == 24) {
-			if (g_s.ipuit != 0) {
+			if (g_s._ipuit != 0) {
 				g_crep = 188;
-			} else if ((g_s.derobj == 140) || (g_s.derobj == 120)) {
-				g_s.ipuit = g_s.derobj;
+			} else if ((g_s._derobj == 140) || (g_s._derobj == 120)) {
+				g_s._ipuit = g_s._derobj;
 				aniof(1, 1);
 			} else {
 				g_crep = 185;
@@ -786,7 +791,7 @@ void fctTurn() {
 	tcoord(9);
 	if (g_num != 0) {
 		g_crep = 997;
-		if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) {
+		if ((g_s._mlieu == 13) && (g_s._ibag == 159) && (g_s._iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -795,13 +800,13 @@ void fctTurn() {
 			else
 				g_crep = 168;
 		}
-		if ((g_s.mlieu == 17) && (g_s.ivier == 143)) {
+		if ((g_s._mlieu == 17) && (g_s._ivier == 143)) {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
-				g_s.mlieu = 16;
+				g_s._mlieu = 16;
 				affrep();
 			} else
 				g_crep = 176;
@@ -833,7 +838,7 @@ void fctSelfHide() {
  * @remarks	Originally called 'tattacher'
  */
 void fctAttach() {
-	if (g_s.derobj == 0)
+	if (g_s._derobj == 0)
 		g_crep = 186;
 	else {
 		if (!g_syn)
@@ -842,10 +847,10 @@ void fctAttach() {
 		if (!(g_anyone) && !(g_iesc)) {
 			tcoord(8);
 			g_crep = 997;
-			if ((g_num != 0) && (g_s.mlieu == 24)) {
+			if ((g_num != 0) && (g_s._mlieu == 24)) {
 				g_crep = 999;
-				if ((g_s.derobj == 120) || (g_s.derobj == 140)) {
-					g_s.ipuit = g_s.derobj;
+				if ((g_s._derobj == 120) || (g_s._derobj == 140)) {
+					g_s._ipuit = g_s._derobj;
 					aniof(1, 1);
 				} else
 					g_crep = 185;
@@ -874,11 +879,11 @@ void fctClose() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(touv[cx])));
-			if (g_num == ord(touv[cx])) {
+			} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+			if (g_num == ord(g_touv[cx])) {
 				aniof(2, g_num);
 				g_crep = 998;
-				touv[cx] = chr(0);
+				g_touv[cx] = chr(0);
 				--g_iouv;
 				if (g_iouv < 0)
 					g_iouv = 0;
@@ -903,15 +908,15 @@ void fctKnock() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
-	if (g_s.mlieu == 15) {
+	if (g_s._mlieu == 15) {
 		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
-	if (g_s.mlieu < 25) {
+	if (g_s._mlieu < 25) {
 		tfleche();
 		if (!(g_anyone) && !(g_iesc)) {
-			if ((g_s.mlieu < 19) && (g_s.mlieu != 15))
+			if ((g_s._mlieu < 19) && (g_s._mlieu != 15))
 				g_crep = 133;
 			else
 				g_crep = 997;
@@ -920,11 +925,11 @@ void fctKnock() {
 		return;
 	}
 
-	if (g_s.mlieu == 26) {
+	if (g_s._mlieu == 26) {
 		int haz = (hazard(0, 8)) - 4;
 		parole(11, haz, 1);
 		int p;
-		ecfren(p, haz, g_s.conf, g_ment);
+		ecfren(p, haz, g_s._conf, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -950,7 +955,7 @@ void fctKnock() {
 void fctSelfPut() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_POSE));
-	if (g_s.derobj == 0)
+	if (g_s._derobj == 0)
 		g_crep = 186;
 	else {
 		if (g_caff > 99) {
@@ -974,8 +979,8 @@ void fctSelfPut() {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (g_num != ord(touv[cx])));
-				if (g_num != ord(touv[cx]))
+				} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
+				if (g_num != ord(g_touv[cx]))
 					g_crep = 187;
 				else {
 					g_mchai = chai;
@@ -987,30 +992,30 @@ void fctSelfPut() {
 			if (g_num != 0) {
 				g_crep = 998;
 				if (g_caff == 2) {
-					if (g_s.iloic != 0)
+					if (g_s._iloic != 0)
 						g_crep = 188;
 					else
-						g_s.iloic = g_s.derobj;
+						g_s._iloic = g_s._derobj;
 				}
 
 				if (g_caff == 13) {
 					if (g_num == 1) {
-						if (g_s.iboul != 0)
+						if (g_s._iboul != 0)
 							g_crep = 188;
 						else
-							g_s.iboul = g_s.derobj;
-					} else if (g_s.ibag != 0) {
+							g_s._iboul = g_s._derobj;
+					} else if (g_s._ibag != 0) {
 						g_crep = 188;
 					} else {
-						g_s.ibag = g_s.derobj;
+						g_s._ibag = g_s._derobj;
 					}
 				}
 
 				if (g_caff == 16) {
-					if (g_s.icryp != 0)
+					if (g_s._icryp != 0)
 						g_crep = 188;
 					else
-						g_s.icryp = g_s.derobj;
+						g_s._icryp = g_s._derobj;
 				}
 
 				if (g_caff == 24)
@@ -1042,13 +1047,13 @@ void fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void fctListen() {
-	if (g_s.mlieu != 26)
+	if (g_s._mlieu != 26)
 		g_crep = 101;
 	else {
 		if (g_ipers != 0)
-			++g_s.conf;
+			++g_s._conf;
 		int p, haz;
-		ecfren(p, haz, g_s.conf, g_ment);
+		ecfren(p, haz, g_s._conf, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -1080,19 +1085,19 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
+	if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
 		g_crep = 148;
 	} else {
 		tsort();
-		g_s.mlieu = 10;
+		g_s._mlieu = 10;
 		g_caff = 10;
-		debloc(g_s.mlieu);
-		tmlieu(g_s.mlieu);
+		debloc(g_s._mlieu);
+		tmlieu(g_s._mlieu);
 
 		int j, h, m;
 		calch(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
-			g_s.conf -= (g_s.conf / 7);
+			g_s._conf -= (g_s._conf / 7);
 			if (h == 12) {
 				if (m == 0)
 					h = 4;
@@ -1123,16 +1128,16 @@ void fctEat() {
 void fctEnter() {
 //	int x;
 
-	if ((g_s.mlieu == 21) || (g_s.mlieu == 22)) {
+	if ((g_s._mlieu == 21) || (g_s._mlieu == 22)) {
 		t1sama();
-		tmlieu(g_s.mlieu);
-	} else if (g_s.mlieu == 15)
+		tmlieu(g_s._mlieu);
+	} else if (g_s._mlieu == 15)
 		aldepl();
 	else if (g_ment == 0)
 		g_crep = 997;
-	else if ((g_ment == 9) && (g_s.derobj != 136)) {
+	else if ((g_ment == 9) && (g_s._derobj != 136)) {
 			g_crep = 189;
-			g_s.teauto[8] = '*';
+			g_s._teauto[8] = '*';
 	} else {
 		int z = 0;
 		if (!g_blo)
@@ -1146,8 +1151,8 @@ void fctEnter() {
 				aniof(1, 1);
 				
 				tip(z, g_x);
-				++g_s.conf;
-				g_s.mlieu = 15;
+				++g_s._conf;
+				g_s._mlieu = 15;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
 				g_syn = true;
@@ -1166,10 +1171,10 @@ void fctEnter() {
 			parole(7, g_x, 1);
 			aniof(1, 1);
 			
-			g_s.mlieu = g_ment;
+			g_s._mlieu = g_ment;
 			affrep();
-			debloc(g_s.mlieu);
-			tmlieu(g_s.mlieu);
+			debloc(g_s._mlieu);
+			tmlieu(g_s._mlieu);
 			g_ment = 0;
 			g_mpers = 0;
 			g_ipers = 0;
@@ -1184,17 +1189,17 @@ void fctEnter() {
 void fctSleep() {
 	int z, j, h, m;
 
-	if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) {
+	if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
 		g_crep = 148;
 		return;
 	}
-	if (g_s.mlieu != 0) {
+	if (g_s._mlieu != 0) {
 		tsort();
-		g_s.mlieu = 0;
+		g_s._mlieu = 0;
 		affrep();
 		afdes(0);
-		debloc(g_s.mlieu);
-		tmlieu(g_s.mlieu);
+		debloc(g_s._mlieu);
+		tmlieu(g_s._mlieu);
 	}
 	clsf3();
 	clsf2();
@@ -1205,7 +1210,7 @@ void fctSleep() {
 	int answer;
 	do {
 		if (h < 8) {
-			g_s.conf -= (g_s.conf / 20);
+			g_s._conf -= (g_s._conf / 20);
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
@@ -1235,11 +1240,11 @@ void fctForce() {
 		tfleche();
 
 	if ((!g_anyone) && (!g_iesc)) {
-		if (g_s.mlieu != 26)
+		if (g_s._mlieu != 26)
 			g_crep = 997;
 		else {
 			g_crep = 143;
-			g_s.conf += 2;
+			g_s._conf += 2;
 		}
 	}
 }
@@ -1251,27 +1256,27 @@ void fctForce() {
 void fctLeave() {
 	tsort();
 	g_crep = 0;
-	if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24))
+	if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22) || (g_s._mlieu == 24))
 		g_crep = 997;
 	else {
 		int lx = 0;
 
-		if ((g_s.mlieu < 16) || (g_s.mlieu == 26))
+		if ((g_s._mlieu < 16) || (g_s._mlieu == 26))
 			lx = 10;
-		if ((g_s.mlieu == 10) || (g_s.mlieu == 20))
+		if ((g_s._mlieu == 10) || (g_s._mlieu == 20))
 			lx = 21;
-		if ((g_s.mlieu < 10) || (g_s.mlieu == 13))
+		if ((g_s._mlieu < 10) || (g_s._mlieu == 13))
 			lx = 15;
-		if (g_s.mlieu == 16) {
+		if (g_s._mlieu == 16) {
 			lx = 17;
 			g_crep = 176;
 		}
-		if (g_s.mlieu == 17)
+		if (g_s._mlieu == 17)
 			t23coul(lx);
-		if (g_s.mlieu == 23)
+		if (g_s._mlieu == 23)
 			lx = 24;
 		if (g_crep != 997)
-			g_s.mlieu = lx;
+			g_s._mlieu = lx;
 		g_caff = lx;
 		if (g_crep == 0)
 			g_crep = lx;
@@ -1295,12 +1300,12 @@ void fctWait() {
 		++g_jh;
 		tinke();
 		if (!g_blo)
-			t11(g_s.mlieu, quel);
+			t11(g_s._mlieu, quel);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
-			if ((g_s.mlieu == 13) || (g_s.mlieu == 14))
+			if ((g_s._mlieu == 13) || (g_s._mlieu == 14))
 				cavegre();
-			if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
+			if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
 				g_anyone = true;
 			g_mpers = g_ipers;
 			if (!g_anyone)
@@ -1364,7 +1369,7 @@ void fctDiscuss() {
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
-		lib[ix] = deline(ix + c_tparler);
+		lib[ix] = deline(ix + kQuestionStringIndex);
 		for (i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
@@ -1379,7 +1384,7 @@ void fctDiscuss() {
 		do {
 			++icm;
 			g_vm->_screenSurface.putxy(co, lig);
-			if (g_s.teauto[icm] == '*') {
+			if (g_s._teauto[icm] == '*') {
 				if (te[icm])
 					writetp(lib[icm], 1);
 				else
@@ -1439,7 +1444,7 @@ void fctDiscuss() {
 							writetp(lib[choi], 1);
 						te[choi] = ! te[choi];
 					}
-					if ((g_s.teauto[ix] == '*') || (ix == 46)) {
+					if ((g_s._teauto[ix] == '*') || (ix == 46)) {
 						lig = ((ix - 1) % 23) << 3;
 						if (ix > 23)
 							co = 320;
@@ -1462,7 +1467,7 @@ void fctDiscuss() {
 			int ix = choi - 1;
 			if (g_col) {
 				g_col = false;
-				g_s.mlieu = 15;
+				g_s._mlieu = 15;
 				if (g_iouv > 0)
 					max = 8;
 				else
@@ -1472,14 +1477,14 @@ void fctDiscuss() {
 					suj = 129;
 				else {
 					suj = 138;
-					g_s.conf += (3 * (g_s.conf / 10));
+					g_s._conf += (3 * (g_s._conf / 10));
 				}
-			} else if (nbrep[g_caff - 69] < nbrepm[g_caff - 69]) {
-				suj = tabdon[arep + (ix << 3) + (g_caff - 70)];
-				g_s.conf += tabdon[arcf + ix];
-				++nbrep[g_caff - 69];
+			} else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) {
+				suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)];
+				g_s._conf += g_tabdon[arcf + ix];
+				++g_nbrep[g_caff - 69];
 			} else {
-				g_s.conf += 3;
+				g_s._conf += 3;
 				suj = 139;
 			}
 			hideMouse();
@@ -1488,17 +1493,17 @@ void fctDiscuss() {
 			sparl(0, suj);
 			showMouse();
 			if ((suj == 84) || (suj == 86)) {
-				g_s.pourc[5] = '*';
-				g_s.teauto[7] = '*';
+				g_s._pourc[5] = '*';
+				g_s._teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
 				for (int indx = 29; indx <= 31; ++indx)
-					g_s.teauto[indx] = '*';
-				g_s.pourc[7] = '*';
+					g_s._teauto[indx] = '*';
+				g_s._pourc[7] = '*';
 			}
 			if (suj == 70) {
-				g_s.pourc[8] = '*';
-				g_s.teauto[32] = '*';
+				g_s._pourc[8] = '*';
+				g_s._teauto[32] = '*';
 			}
 			hideMouse();
 			hirs();
@@ -1506,14 +1511,14 @@ void fctDiscuss() {
 		}
 	} while ((choi != 46) && (suj != 138));
 	if (g_col) {
-		g_s.conf += (3 * (g_s.conf / 10));
+		g_s._conf += (3 * (g_s._conf / 10));
 		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 138);
 		showMouse();
 		g_col = false;
-		g_s.mlieu = 15;
+		g_s._mlieu = 15;
 	}
 	g_ctrm = 0;
 	hideMouse();
@@ -1525,7 +1530,7 @@ void fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	tmlieu(g_s.mlieu);
+	tmlieu(g_s._mlieu);
 	clsf3();
 }
 
@@ -1601,8 +1606,6 @@ void MortevielleEngine::endGame() {
  * @remarks	Originally called 'tencore'
  */
 void MortevielleEngine::loseGame() {
-	int answer;
-
 	clsf2();
 	musique(0);
 	tkey1(false);
@@ -1616,7 +1619,8 @@ void MortevielleEngine::loseGame() {
 	g_hour = 10;
 	g_day = 0;
 	repon(2, 180);
-	answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+
+	int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
 }
 
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 96264c8..a586ccf 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -294,7 +294,7 @@ bool Ques::show() {
 	int rep;
 	int firstOption, lastOption;
 	char key;
-	rectangle coor[max_rect];
+	rectangle coor[kMaxRect];
 	Common::String choiceArray[15];
 
 	int currChoice, prevChoice;
@@ -336,19 +336,17 @@ bool Ques::show() {
 			optionPosY += 8;
 		}
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			rectangle &with = coor[j];
-
-			with.x1 = 45 * g_res;
-			with.x2 = (maxLength * 3 + 55) * g_res;
-			with.y1 = 27 + j * 8;
-			with.y2 = 34 + j * 8;
-			with.enabled = true;
+			coor[j]._x1 = 45 * g_res;
+			coor[j]._x2 = (maxLength * 3 + 55) * g_res;
+			coor[j]._y1 = 27 + j * 8;
+			coor[j]._y2 = 34 + j * 8;
+			coor[j]._enabled = true;
 
 			while ((int)choiceArray[j].size() < maxLength) {
 				choiceArray[j] += ' ';
 			}
 		}
-		coor[lastOption - firstOption + 2].enabled = false;
+		coor[lastOption - firstOption + 2]._enabled = false;
 		if (g_res == 1)
 			rep = 10;
 		else
@@ -366,9 +364,9 @@ bool Ques::show() {
 			CHECK_QUIT0;
 
 			currChoice = 1;
-			while (coor[currChoice].enabled && !dans_rect(coor[currChoice]))
+			while (coor[currChoice]._enabled && !isMouseIn(coor[currChoice]))
 				++currChoice;
-			if (coor[currChoice].enabled) {
+			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
 					tmpStr = choiceArray[prevChoice] + '$';
 					afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
@@ -469,7 +467,7 @@ void f3f8::aff50(bool drawAni50Fl) {
 	if (drawAni50Fl)
 		ani50();
 	else
-		repon(2, c_paroles + 142);
+		repon(2, kDialogStringIndex + 142);
 	
 	// Draw the f3/f8 dialog
 	draw();
@@ -481,7 +479,7 @@ void f3f8::ani50() {
 	g_crep = animof(2, 1);
 	pictout(adani, g_crep, 63, 12);
 	g_f2_all = (g_res == 1);
-	repon(2, c_paroles + 143);
+	repon(2, kDialogStringIndex + 143);
 }
 
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 68fff8a..aabbe29 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -39,35 +39,37 @@ namespace Mortevielle {
 void copcha() {
 	int i = acha;
 	do {
-		tabdon[i] = tabdon[i + 390];
+		g_tabdon[i] = g_tabdon[i + 390];
 		++i;
 	} while (i != acha + 390);
 }
 
-bool dans_rect(rectangle r) {
+/**
+ * Engine function : Is mouse in a given rect?
+ * @remarks	Originally called 'dans_rect'
+ */
+bool isMouseIn(rectangle r) {
 	int x, y, c;
 
 	getMousePos(x, y, c);
-	if ((x > r.x1) && (x < r.x2) && (y > r.y1) && (y < r.y2))
+	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
 		return true;
 
 	return false;
 }
 
-void outbloc(int n, pattern p, t_nhom pal) {
+void outbloc(int n, pattern p, nhom *pal) {
 	int ad = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p.tax);
-	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p.tay);
+	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p._tax);
+	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p._tay);
 	ad += 4;
-	for (int i = 1; i <= p.tax; ++i)
-		for (int j = 1; j <= p.tay; ++j)
-			mem[(0x6000 * 16) + ad + (j - 1) * p.tax + i - 1] = pal[n].hom[p.des[i][j]];
+	for (int i = 1; i <= p._tax; ++i)
+		for (int j = 1; j <= p._tay; ++j)
+			mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
 }
 
 void writepal(int n) {
-	t_nhom pal;
-
 	switch (g_currGraphicalDevice) {
 	case MODE_TANDY:
 	case MODE_EGA:
@@ -77,14 +79,19 @@ void writepal(int n) {
 			mem[(0x7000 * 16) + (2 * i) + 1] = tabpal[n][i].y;
 		}
 		break;
-	case MODE_CGA:
+	case MODE_CGA: {
 		warning("TODO: If this code is needed, resolve the incompatible types");
-//		pal = palcga[n].a;
+		nhom pal[16];
+		for (int i = 0; i < 16; ++i) {
+			pal[i] = palcga[n]._a[i];
+		}
+//		nhom pal[16] = palcga[n]._a;
 		if (n < 89)
-			palette(palcga[n].p);
+			palette(palcga[n]._p);
 		
 		for (int i = 0; i <= 15; ++i)
-			outbloc(i, tpt[pal[i].n], pal);
+			outbloc(i, tpt[pal[i]._id], pal);
+		}
 		break;
 	default:
 		break;
@@ -125,13 +132,13 @@ void adzon() {
 	if (!f.open("don.mor"))
 		error("Missing file - don.mor");
 
-	f.read(tabdon, 7 * 256);
+	f.read(g_tabdon, 7 * 256);
 	f.close();
 
 	if (!f.open("bmor.mor"))
 		error("Missing file - bmor.mor");
 
-	f.read(&tabdon[fleche], 1 * 1916);
+	f.read(&g_tabdon[fleche], 1 * 1916);
 	f.close();
 
 	if (!f.open("dec.mor"))
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index c3df5e5..34e1026 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -34,8 +34,8 @@ namespace Mortevielle {
 
 /* NIVEAU 15 */
 extern void copcha();
-extern bool dans_rect(rectangle r);
-extern void outbloc(int n, pattern p, t_nhom pal);
+extern bool isMouseIn(rectangle r);
+extern void outbloc(int n, pattern p, nhom *pal);
 extern void writepal(int n);
 extern void pictout(int seg, int dep, int x, int y);
 // extern int calad(int x, int y);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index ac19959..7de738d 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -169,7 +169,7 @@ void Menu::displayMenu() {
 			do {   // One line after the other
 				msk = 0x80;
 				for (pt = 0; pt <= 7; ++pt) {
-					if ((lettres[num_letr - 1][ind_tabl] & msk) != 0) {
+					if ((g_lettres[num_letr - 1][ind_tabl] & msk) != 0) {
 						g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
 						g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
 						g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
@@ -208,7 +208,7 @@ void Menu::invers(int ix) {
 
 	int menuIndex = lo(g_msg4);
 
-	g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	g_vm->_screenSurface.putxy(g_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 	switch (g_msg3) {
 	case 1:
 		s = _inventoryStringArray[menuIndex];
@@ -253,9 +253,9 @@ void Menu::invers(int ix) {
 
 void Menu::util(int x, int y) {
 
-	int ymx = (_menuConstants[g_msg3 - 1][3] << 3) + 16;
-	int dxcar = _menuConstants[g_msg3 - 1][2];
-	int xmn = (_menuConstants[g_msg3 - 1][0] << 2) * g_res;
+	int ymx = (g_menuConstants[g_msg3 - 1][3] << 3) + 16;
+	int dxcar = g_menuConstants[g_msg3 - 1][2];
+	int xmn = (g_menuConstants[g_msg3 - 1][0] << 2) * g_res;
 
 	int ix;
 	if (g_res == 1)
@@ -289,19 +289,19 @@ void Menu::menuDown(int ii) {
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
 	// Draw the menu
-	xco = _menuConstants[ii - 1][0];
-	nb_lig = _menuConstants[ii - 1][3];
+	xco = g_menuConstants[ii - 1][0];
+	nb_lig = g_menuConstants[ii - 1][3];
 	hideMouse();
-	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
+	sauvecr(10, (g_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (g_res == 1)
 		cx = 10;
 	else
 		cx = 6;
-	xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
-	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
+	xcc = xco + (g_menuConstants[ii - 1][2] * cx) + 6;
+	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (g_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (g_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (g_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (g_menuConstants[ii - 1][1] << 1)));
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
@@ -362,7 +362,7 @@ void Menu::menuDown(int ii) {
 void Menu::menuUp(int xx) {
 	/* debug('menuUp'); */
 	if (g_test0) {
-		charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
+		charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
@@ -475,7 +475,7 @@ void Menu::initMenu() {
 			if (!f.open("menu.mor"))
 				error("Missing file - menufr.mor or menual.mor or menu.mor");
 
-	f.read(lettres, 7 * 24);
+	f.read(g_lettres, 7 * 24);
 	f.close();
 
 	// Ask to swap floppy
@@ -488,18 +488,18 @@ void Menu::initMenu() {
 		_moveStringArray[i] = "*                       ";
 	i = 1;
 	do {
-		_actionStringArray[i] = deline(i + c_action);
+		_actionStringArray[i] = deline(i + kMenuActionStringIndex);
 
 		while (_actionStringArray[i].size() < 10)
 			_actionStringArray[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				_selfStringArray[i] = deline(i + c_saction);
+				_selfStringArray[i] = deline(i + kMenuSelfStringIndex);
 				while (_selfStringArray[i].size() < 10)
 					_selfStringArray[i] += ' ';
 			}
-			_discussStringArray[i] = deline(i + c_dis) + ' ';
+			_discussStringArray[i] = deline(i + kMenuSayStringIndex) + ' ';
 		}
 		++i;
 	} while (i != 22);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 20882eb..ab3467e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -145,7 +145,7 @@ void text1(int x, int y, int nb, int m) {
 
 void initouv() {
 	for (int cx = 1; cx <= 7; ++cx)
-		touv[cx] = chr(0);
+		g_touv[cx] = chr(0);
 }
 
 void ecrf1() {
@@ -236,11 +236,11 @@ void clsf10() {
 		cod = 544;
 	}
 	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (g_s.conf < 33)
+	if (g_s._conf < 33)
 		st = g_vm->getEngineString(S_COOL);
-	else if (g_s.conf < 66)
+	else if (g_s._conf < 66)
 		st = g_vm->getEngineString(S_LOURDE);
-	else if (g_s.conf > 65)
+	else if (g_s._conf > 65)
 		st = g_vm->getEngineString(S_MALSAINE);
 	
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
@@ -309,7 +309,7 @@ void modobj(int m) {
 	Common::String strp = Common::String(' ');
 
 	if (m != 500)
-		strp = deline(m - 501 + c_st41);
+		strp = deline(m - 501 + kInventoryStringIndex);
 
 	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -324,7 +324,7 @@ void modobj2(int m, bool t1, bool t2) {
 		g_tesok = false;;
 
 	if (m != 500)
-		strp = deline(m - 501 + c_st41);
+		strp = deline(m - 501 + kInventoryStringIndex);
 
 	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -337,7 +337,7 @@ void repon(int f, int m) {
 	Common::String tmpStr;
 
 	if ((m > 499) && (m < 563)) {
-		tmpStr = deline(m - 501 + c_st41);
+		tmpStr = deline(m - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
 			g_f2_all = true;
@@ -357,12 +357,12 @@ void repon(int f, int m) {
 			ecrf2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
-				g_s.teauto[40] = '*';
+				g_s._teauto[40] = '*';
 			if ((m == 104) && (g_caff == 14)) {
-				g_s.teauto[36] = '*';
-				if (g_s.teauto[39] == '*') {
-					g_s.pourc[3] = '*';
-					g_s.teauto[38] = '*';
+				g_s._teauto[36] = '*';
+				if (g_s._teauto[39] == '*') {
+					g_s._pourc[3] = '*';
+					g_s._teauto[38] = '*';
 				}
 			}
 		}
@@ -377,10 +377,10 @@ void repon(int f, int m) {
 			afftex(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
-				g_s.pourc[6] = '*';
+				g_s._pourc[6] = '*';
 
 			if (m == 179)
-				g_s.pourc[10] = '*';
+				g_s._pourc[10] = '*';
 		}
 		if (f == 7) {         /* messint */
 			ecrf7();
@@ -1024,7 +1024,7 @@ void init_nbrepm() {
 	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 
 	for (int idx = 0; idx < 9; ++idx)
-		nbrepm[idx] = ipm[idx];
+		g_nbrepm[idx] = ipm[idx];
 }
 
 void phaz(int &haz, int &p, int cf) {
@@ -1035,43 +1035,43 @@ void phaz(int &haz, int &p, int cf) {
 void inzon() {
 	copcha();
 
-	g_s.ipre  = false;
-	g_s.derobj = 0;
-	g_s.icave = 0;
-	g_s.iboul = 0;
-	g_s.ibag  = 0;
-	g_s.ipuit = 0;
-	g_s.ivier = 0;
-	g_s.iloic = 136;
-	g_s.icryp = 141;
-	g_s.conf  = hazard(4, 10);
-	g_s.mlieu = 21;
+	g_s._ipre  = false;
+	g_s._derobj = 0;
+	g_s._icave = 0;
+	g_s._iboul = 0;
+	g_s._ibag  = 0;
+	g_s._ipuit = 0;
+	g_s._ivier = 0;
+	g_s._iloic = 136;
+	g_s._icryp = 141;
+	g_s._conf  = hazard(4, 10);
+	g_s._mlieu = 21;
 
 	for (int cx = 2; cx <= 6; ++cx)
-		g_s.sjer[cx] = chr(0);
+		g_s._sjer[cx] = chr(0);
 
-	g_s.sjer[1] = chr(113);
-	g_s.heure = chr(20);
+	g_s._sjer[1] = chr(113);
+	g_s._heure = chr(20);
 
 	for (int cx = 1; cx <= 10; ++cx)
-		g_s.pourc[cx] = ' ';
+		g_s._pourc[cx] = ' ';
 
 	for (int cx = 1; cx <= 6; ++cx)
-		g_s.teauto[cx] = '*';
+		g_s._teauto[cx] = '*';
 
 	for (int cx = 7; cx <= 9; ++cx)
-		g_s.teauto[cx] = ' ';
+		g_s._teauto[cx] = ' ';
 
 	for (int cx = 10; cx <= 28; ++cx)
-		g_s.teauto[cx] = '*';
+		g_s._teauto[cx] = '*';
 
 	for (int cx = 29; cx <= 42; ++cx)
-		g_s.teauto[cx] = ' ';
+		g_s._teauto[cx] = ' ';
 
-	g_s.teauto[33] = '*';
+	g_s._teauto[33] = '*';
 
 	for (int cx = 1; cx <= 8; ++cx)
-		nbrep[cx] = 0;
+		g_nbrep[cx] = 0;
 
 	init_nbrepm();
 }
@@ -1079,7 +1079,7 @@ void inzon() {
 void dprog() {
 	g_li = 21;
 	g_jh = 0;
-	if (!g_s.ipre)
+	if (!g_s._ipre)
 		g_blo = true;
 	g_t = ti1;
 	g_mh = readclock();
@@ -1219,7 +1219,7 @@ void pl20(int cf) {
 void t11(int l11, int &a) {
 	int p, haz;
 
-	ecfren(p, haz, g_s.conf, l11);
+	ecfren(p, haz, g_s._conf, l11);
 	g_li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
@@ -1251,7 +1251,7 @@ void t11(int l11, int &a) {
 				cpl15(p);
 			if (l11 == 20)
 				cpl20(p, h);
-			p += g_s.conf;
+			p += g_s._conf;
 			haz = hazard(1, 100);
 			if (haz > p) {
 				person();
@@ -1274,9 +1274,9 @@ void t11(int l11, int &a) {
 }
 
 void cavegre() {
-	g_s.conf += 2;
-	if (g_s.conf > 69)
-		g_s.conf += (g_s.conf / 10);
+	g_s._conf += 2;
+	if (g_s._conf > 69)
+		g_s._conf += (g_s._conf / 10);
 	clsf3();
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
@@ -1335,12 +1335,12 @@ void musique(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((g_prebru == 0) && (!g_s.ipre)) {
+	} else if ((g_prebru == 0) && (!g_s._ipre)) {
 		parole(10, 1, 1);
 		++g_prebru;
 	} else {
 		bool i = false;
-		if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22)) {
+		if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22)) {
 			int haz = hazard(1, 3);
 			if (haz == 2) {
 				haz = hazard(2, 4);
@@ -1348,7 +1348,7 @@ void musique(int so) {
 				i = true;
 			}
 		}
-		if (g_s.mlieu == 20) {
+		if (g_s._mlieu == 20) {
 			int haz = hazard(1, 2);
 			if (haz == 1) {
 				parole(8, 1, 1);
@@ -1356,7 +1356,7 @@ void musique(int so) {
 			}
 		}
 
-		if (g_s.mlieu == 24) {
+		if (g_s._mlieu == 24) {
 			int haz = hazard(1, 2);
 			if (haz == 2) {
 				parole(12, 1, 1);
@@ -1364,7 +1364,7 @@ void musique(int so) {
 			}
 		}
 
-		if (g_s.mlieu == 23) {
+		if (g_s._mlieu == 23) {
 			parole(13, 1, 1);
 			i = true;
 		}
@@ -1392,24 +1392,24 @@ void dessin(int ad) {
 			ecrf1();
 			if ((g_caff < 30) || (g_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
-					if (ord(touv[cx]) != 0)
-						aniof(1, ord(touv[cx]));
+					if (ord(g_touv[cx]) != 0)
+						aniof(1, ord(g_touv[cx]));
 				}
 
 				if (g_caff == 13) {
-					if (g_s.iboul == 141)
+					if (g_s._iboul == 141)
 						aniof(1, 7);
 
-					if (g_s.ibag == 159)
+					if (g_s._ibag == 159)
 						aniof(1, 6);
 				}
-				if ((g_caff == 14) && (g_s.icave == 151))
+				if ((g_caff == 14) && (g_s._icave == 151))
 					aniof(1, 2);
 
-				if ((g_caff == 17) && (g_s.ivier == 143))
+				if ((g_caff == 17) && (g_s._ivier == 143))
 					aniof(1, 1);
 
-				if ((g_caff == 24) && (g_s.ipuit != 0))
+				if ((g_caff == 24) && (g_s._ipuit != 0))
 					aniof(1, 1);
 			}
 			
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c592ddc..326010a 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -56,9 +56,9 @@ void tinke() {
 		cx = 0;
 		do {
 			++cx;
-			if (nbrepm[cx] != 0)
-				--nbrepm[cx];
-			nbrep[cx] = 0;
+			if (g_nbrepm[cx] != 0)
+				--g_nbrepm[cx];
+			g_nbrep[cx] = 0;
 		} while (cx != 8);
 	}
 	if ((h > g_hour) || ((h == 0) && (g_hour == 23))) {
@@ -67,7 +67,7 @@ void tinke() {
 		drawClock();
 		cf = 0;
 		for (cx = 1; cx <= 10; ++cx) {
-			if (g_s.pourc[cx] == '*')
+			if (g_s._pourc[cx] == '*')
 				++cf;
 		}
 
@@ -76,18 +76,18 @@ void tinke() {
 		else
 			stpo = chr(cf + 48);
 
-		_hintPctMessage = Common::String(d3);
-		_hintPctMessage += d5;
-		_hintPctMessage += d4;
-		_hintPctMessage += d3;
-		_hintPctMessage += d1;
-		_hintPctMessage += stpo;
-		_hintPctMessage += '0';
-		_hintPctMessage += d2;
-		_hintPctMessage += d4;
-		_hintPctMessage += d3;
-		_hintPctMessage += d6;
-		_hintPctMessage += d4;
+		g_hintPctMessage = Common::String(d3);
+		g_hintPctMessage += d5;
+		g_hintPctMessage += d4;
+		g_hintPctMessage += d3;
+		g_hintPctMessage += d1;
+		g_hintPctMessage += stpo;
+		g_hintPctMessage += '0';
+		g_hintPctMessage += d2;
+		g_hintPctMessage += d4;
+		g_hintPctMessage += d3;
+		g_hintPctMessage += d6;
+		g_hintPctMessage += d4;
 	}
 	if (m > g_minute) {
 		g_minute = 30;
@@ -101,7 +101,7 @@ void tinke() {
 			g_t = ti2;
 		else
 			g_t = ti1;
-		cf = g_s.conf;
+		cf = g_s._conf;
 		if ((cf > 33) && (cf < 66))
 			g_t -= (g_t / 3);
 
@@ -157,7 +157,7 @@ void tinke() {
 				g_mpers = g_ipers;
 
 			if ((g_mpers == 0) && (g_ipers > 0)) {
-				if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) {
+				if ((g_s._mlieu == 13) || (g_s._mlieu == 14)) {
 					cavegre();
 				} else if (g_ipers == 10) {
 					g_ipers = 0;
@@ -186,7 +186,7 @@ void tinke() {
 		nouvp(g_li, cx);
 		g_brt = false;
 		g_hdb = 0;
-		if ((g_s.mlieu > 0) && (g_s.mlieu < 10))
+		if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
 			g_anyone = true;
 	}
 }
@@ -245,7 +245,7 @@ void tmlieu(int mli) {
 
 	int i = 1;
 	while ((i < 8) && (v_lieu[i][mli] != 0)) {
-		nomp = deline(v_lieu[i][mli] + c_tmlieu);
+		nomp = deline(v_lieu[i][mli] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
@@ -270,12 +270,12 @@ void tlu(int af, int ob) {
 }
 
 void affrep() {
-	g_caff = g_s.mlieu;
-	g_crep = g_s.mlieu;
+	g_caff = g_s._mlieu;
+	g_crep = g_s._mlieu;
 }
 
 void mfouen() {
-	tmlieu(g_s.mlieu);
+	tmlieu(g_s._mlieu);
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
 
@@ -309,19 +309,19 @@ void tperd() {
 
 void tsort() {
 
-	if ((g_iouv > 0) && (g_s.mlieu != 0)) {
-		if (g_s.conf < 50)
-			g_s.conf += 2;
+	if ((g_iouv > 0) && (g_s._mlieu != 0)) {
+		if (g_s._conf < 50)
+			g_s._conf += 2;
 		else
-			g_s.conf += (g_s.conf / 10);
+			g_s._conf += (g_s._conf / 10);
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
-		touv[cx] = chr(0);
+		g_touv[cx] = chr(0);
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	debloc(g_s.mlieu);
+	debloc(g_s._mlieu);
 }
 
 void st4(int ob) {
@@ -359,14 +359,14 @@ void cherjer(int ob, bool &d) {
 
 	d = false;
 	for (cx = 1; cx <= 6; ++cx)
-		d = (d || (ord(g_s.sjer[cx]) == ob));
+		d = (d || (ord(g_s._sjer[cx]) == ob));
 
-	if (g_s.derobj == ob)
+	if (g_s._derobj == ob)
 		d = true;
 }
 
 void st1sama() {
-	g_s.mlieu = 10;
+	g_s._mlieu = 10;
 	affrep();
 }
 
@@ -376,10 +376,10 @@ void modinv() {
 
 	int cy = 0;
 	for (int cx = 1; cx <= 6; ++cx)
-		if (g_s.sjer[cx] != chr(0)) {
+		if (g_s._sjer[cx] != chr(0)) {
 			++cy;
-			r = (ord(g_s.sjer[cx]) + 400);
-			nomp = deline(r - 501 + c_st41);
+			r = (ord(g_s._sjer[cx]) + 400);
+			nomp = deline(r - 501 + kInventoryStringIndex);
 			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
@@ -396,7 +396,7 @@ void sparl(float adr, float rep) {
 
 	repint = abs((int)rep);
 	hideMouse();
-	Common::String tmpStr = deline(repint + c_paroles);
+	Common::String tmpStr = deline(repint + kDialogStringIndex);
 	afftex(tmpStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
@@ -414,7 +414,7 @@ void finfouil() {
 	g_fouil = false;
 	g_obpart = false;
 	g_cs = 0;
-	is = 0;
+	g_is = 0;
 	mfouen();
 }
 
@@ -444,12 +444,11 @@ void ajchai() {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 9) && (tabdon[cy + cx] != 0));
+	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
 
-	if (tabdon[cy + cx] == 0) {
-		int lderobj = g_s.derobj;
-		tabdon[cy + cx] = lderobj;
-	} else
+	if (g_tabdon[cy + cx] == 0)
+		g_tabdon[cy + cx] = g_s._derobj;
+	else
 		g_crep = 192;
 }
 
@@ -457,10 +456,10 @@ void ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 5) && (ord(g_s.sjer[cx]) != 0));
+	} while ((cx <= 5) && (ord(g_s._sjer[cx]) != 0));
 
-	if (ord(g_s.sjer[cx]) == 0) {
-		g_s.sjer[(cx)] = chr(ob);
+	if (ord(g_s._sjer[cx]) == 0) {
+		g_s._sjer[(cx)] = chr(ob);
 		modinv();
 	} else
 		g_crep = 139;
@@ -470,7 +469,7 @@ void t1sama() {    //Entering manor
 	int j, h, m;
 
 	calch(j, h, m);
-	if ((h < 5) && (g_s.mlieu > 18)) {
+	if ((h < 5) && (g_s._mlieu > 18)) {
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
@@ -478,7 +477,7 @@ void t1sama() {    //Entering manor
 			tperd();
 		} else
 			st1sama();
-	} else if (!g_s.ipre) {     //Is it your first time?
+	} else if (!g_s._ipre) {     //Is it your first time?
 		g_ipers = 255;
 		affper(g_ipers);
 		g_caff = 77;
@@ -494,21 +493,21 @@ void t1sama() {    //Entering manor
 		dessine_rouleau();
 		drawClock();
 		showMouse();
-		g_s.mlieu = 0;
+		g_s._mlieu = 0;
 		affrep();
 		t5(10);
 		if (!g_blo)
 			t11(0, m);
 		g_ipers = 0;
 		g_mpers = 0;
-		g_s.ipre = true;
+		g_s._ipre = true;
 		/*chech;*/
 	} else
 		st1sama();
 }
 
 void t1vier() {
-	g_s.mlieu = 17;
+	g_s._mlieu = 17;
 	affrep();
 }
 
@@ -519,19 +518,19 @@ void t1neig() {
 		tperd();
 	} else {
 		g_okdes = true;
-		g_s.mlieu = 19;
+		g_s._mlieu = 19;
 		affrep();
 	}
 }
 
 void t1deva() {
 	g_inei = 0;
-	g_s.mlieu = 21;
+	g_s._mlieu = 21;
 	affrep();
 }
 
 void t1derr() {
-	g_s.mlieu = 22;
+	g_s._mlieu = 22;
 	affrep();
 }
 
@@ -563,11 +562,11 @@ L1:
 			parole(4, 4, 1);
 
 		if (g_iouv == 0)
-			g_s.conf += 2;
-		else if (g_s.conf < 50)
-			g_s.conf += 4;
+			g_s._conf += 2;
+		else if (g_s._conf < 50)
+			g_s._conf += 4;
 		else
-			g_s.conf += 3 * (g_s.conf / 10);
+			g_s._conf += 3 * (g_s._conf / 10);
 		tsort();
 		tmlieu(15);
 		int cx;
@@ -605,18 +604,18 @@ void tsuiv() {
 	int cy = acha + ((g_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
-		cx = cx + 1;
-		g_cs = g_cs + 1;
+		++cx;
+		++g_cs;
 		cl = cy + g_cs;
-		tbcl = tabdon[cl];
+		tbcl = g_tabdon[cl];
 	} while ((tbcl == 0) && (g_cs <= 9));
 
 	if ((tbcl != 0) && (g_cs < 11)) {
-		is = is + 1;
+		++g_is;
 		g_caff = tbcl;
 		g_crep = g_caff + 400;
 		if (g_ipers != 0)
-			g_s.conf = g_s.conf + 2;
+			g_s._conf += 2;
 	} else {
 		affrep();
 		finfouil();
@@ -647,7 +646,7 @@ void tfleche() {
 		} while (!(qust || g_rect || g_anyone));
 
 		if (qust && (touch == '\103'))
-			Alert::show(_hintPctMessage, 1);
+			Alert::show(g_hintPctMessage, 1);
 	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
 
 	if (touch == '\73')
@@ -670,12 +669,12 @@ void tcoord(int sx) {
 	int atdon = amzon + 3;
 	int cy = 0;
 	while (cy < g_caff) {
-		a += tabdon[atdon];
+		a += g_tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
-	if (tabdon[atdon] == 0) {
+	if (g_tabdon[atdon] == 0) {
 		g_crep = 997;
 		return;
 	}
@@ -683,10 +682,10 @@ void tcoord(int sx) {
 	a += fleche;
 	int cb = 0;
 	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
+		ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
 		cb += (ib * 4) + 2;
 	}
-	ib = (tabdon[a + cb] << 8) + tabdon[(a + cb + 1)];
+	ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
 	if (ib == 0) {
 		g_crep = 997;
 		return;
@@ -695,11 +694,11 @@ void tcoord(int sx) {
 	cy = 1;
 	do {
 		cb += 2;
-		sx = tabdon[a + cb] * g_res;
-		sy = tabdon[(a + cb + 1)];
+		sx = g_tabdon[a + cb] * g_res;
+		sy = g_tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = tabdon[a + cb] * g_res;
-		iy = tabdon[(a + cb + 1)];
+		ix = g_tabdon[a + cb] * g_res;
+		iy = g_tabdon[(a + cb + 1)];
 		++cy;
 	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
 
@@ -757,22 +756,22 @@ void treg(int ob) {
 
 void avpoing(int &ob) {
 	g_crep = 999;
-	if (g_s.derobj != 0)
-		ajjer(g_s.derobj);
+	if (g_s._derobj != 0)
+		ajjer(g_s._derobj);
 
 	if (g_crep != 139) {
 		modobj(ob + 400);
-		g_s.derobj = ob;
+		g_s._derobj = ob;
 		ob = 0;
 	}
 }
 
 void rechai(int &ch) {
-	int cx = g_s.mlieu;
+	int cx = g_s._mlieu;
 
-	if (g_s.mlieu == 16)
+	if (g_s._mlieu == 16)
 		cx = 14;
-	ch = tabdon[achai + (cx * 7) + g_num - 1];
+	ch = g_tabdon[achai + (cx * 7) + g_num - 1];
 }
 
 void t23coul(int &l) {
@@ -787,7 +786,7 @@ void t23coul(int &l) {
 }
 
 void maivid() {
-	g_s.derobj = 0;
+	g_s._derobj = 0;
 	modobj(500);
 }
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index dceb5c7..4a410f0 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -134,7 +134,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	_hintPctMessage = deline(580);  // You should have noticed %d hints
+	g_hintPctMessage = deline(580);  // You should have noticed %d hints
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
@@ -585,7 +585,7 @@ void MortevielleEngine::handleAction() {
 		if (g_choisi && (g_msg[3] == MENU_LOAD))
 			g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
-			temps = Alert::show(_hintPctMessage, 1);
+			temps = Alert::show(g_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
@@ -622,7 +622,7 @@ void MortevielleEngine::handleAction() {
 						oo = true;
 						if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
 							finfouil();
-							g_caff = g_s.mlieu;
+							g_caff = g_s._mlieu;
 							g_crep = 998;
 						} else
 							tsuiv();
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index f26c705..ca88a79 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -64,13 +64,13 @@ void initMouse() {
 		int_m = false;
 
 	if (int_m) {
-		reg.ax = 0;
+		reg._ax = 0;
 		intr(0x33, reg);
-		int_m = (reg.ax == -1);
+		int_m = (reg._ax == -1);
 		if (int_m) {
-			reg.ax = 4;
-			reg.cx = 0;
-			reg.dx = 0;
+			reg._ax = 4;
+			reg._cx = 0;
+			reg._dx = 0;
 
 			intr(0x33, reg);
 		}
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 80eeaa7..4d54040 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -134,8 +134,8 @@ Common::String deline(int num) {
 	} else if (!g_vm->_txxFileFl) {
 		wrkStr = g_vm->getGameString(num);
 	} else {
-		int i = t_rec[num].indis;
-		byte k = t_rec[num].point;
+		int i = t_rec[num]._indis;
+		byte k = t_rec[num]._point;
 		int length = 0;
 		bool endFl = false;
 		char let;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 1ad58ed..e69e7ae 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -78,23 +78,23 @@ void charpal() {
 		error("Missing file - cxx.mor");
 
 	for (int j = 0; j <= 90; ++j) {
-		palcga[j].p = fb.readByte();
+		palcga[j]._p = fb.readByte();
 		for (int i = 0; i <= 15; ++i) {
-			nhom &with = palcga[j].a[i];
+			nhom &with = palcga[j]._a[i];
 
 			b = fb.readByte();
-			with.n = (uint)b >> 4;
-			with.hom[0] = ((uint)b >> 2) & 3;
-			with.hom[1] = b & 3;
+			with._id = (uint)b >> 4;
+			with._hom[0] = ((uint)b >> 2) & 3;
+			with._hom[1] = b & 3;
 		}
 	}
-	palcga[10].a[9] = palcga[10].a[5];
+	palcga[10]._a[9] = palcga[10]._a[5];
 	for (int j = 0; j <= 14; ++j) {
-		tpt[j].tax = fb.readByte();
-		tpt[j].tay = fb.readByte();
+		tpt[j]._tax = fb.readByte();
+		tpt[j]._tay = fb.readByte();
 		for (int i = 1; i <= 20; ++i)
 			for (int k = 1; k <= 20; ++k)
-				tpt[j].des[i][k] = fb.readByte();
+				tpt[j]._des[i][k] = fb.readByte();
 	}
 	fb.close();
 }
@@ -134,8 +134,8 @@ void chartex() {
 	inpFile.close();
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		t_rec[i].indis = ntpFile.readSint16LE();
-		t_rec[i].point = ntpFile.readByte();
+		t_rec[i]._indis = ntpFile.readSint16LE();
+		t_rec[i]._point = ntpFile.readByte();
 	}
 
 	ntpFile.close();
@@ -187,14 +187,14 @@ void music() {
 	fic.close();
 
 	g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
-	addfix = (float)((tempo_mus - addv[1])) / 256;
+	addfix = (float)((kTempoMusic - g_addv[1])) / 256;
 	cctable(tbi);
 
 	fin = false;
 	k = 0;
 	do {
 		fin = keypressed();
-		g_vm->_soundManager.musyc(tbi, 9958 , tempo_mus);
+		g_vm->_soundManager.musyc(tbi, 9958, kTempoMusic);
 		++k;
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
@@ -233,7 +233,7 @@ void charge_cfiph() {
 		error("Missing file - cfiph.mor");
 
 	for (int i = 0; i < (f.size() / 2); ++i)
-		t_cph[i] = f.readSint16LE();
+		g_t_cph[i] = f.readSint16LE();
 
 	f.close();
 }
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 9bfbaaf..f0d7552 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -33,15 +33,15 @@
 namespace Mortevielle {
 
 void spfrac(int wor) {
-	c3.rep = (uint)wor >> 12;
-	if ((g_typlec == 0) && (c3.code != 9))
-		if (((c3.code > 4) && (c3.val != 20) && (c3.rep != 3) && (c3.rep != 6) && (c3.rep != 9)) ||
-				((c3.code < 5) && ((c3.val != 19) && (c3.val != 22) && (c3.rep != 4) && (c3.rep != 9)))) {
-			++c3.rep;
+	c3._rep = (uint)wor >> 12;
+	if ((g_typlec == 0) && (c3._code != 9))
+		if (((c3._code > 4) && (c3._val != 20) && (c3._rep != 3) && (c3._rep != 6) && (c3._rep != 9)) ||
+				((c3._code < 5) && ((c3._val != 19) && (c3._val != 22) && (c3._rep != 4) && (c3._rep != 9)))) {
+			++c3._rep;
 		}
 
-	c3.freq = ((uint)wor >> 6) & 7;
-	c3.acc = ((uint)wor >> 9) & 7;
+	c3._freq = ((uint)wor >> 6) & 7;
+	c3._acc = ((uint)wor >> 9) & 7;
 }
 
 void charg_car() {
@@ -51,31 +51,31 @@ void charg_car() {
 	int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
-		c3.val = int_;
-		c3.code = 5;
+		c3._val = int_;
+		c3._code = 5;
 	} else if ((int_ >= 14) && (int_ <= 21)) {
-		c3.val = int_;
-		c3.code = 6;
+		c3._val = int_;
+		c3._code = 6;
 	} else if ((int_ >= 22) && (int_ <= 47)) {
 		int_ = int_ - 22;
-		c3.val = int_;
-		c3.code = typcon[int_];
+		c3._val = int_;
+		c3._code = g_typcon[int_];
 	} else if ((int_ >= 48) && (int_ <= 56)) {
-		c3.val = int_ - 22;
-		c3.code = 4;
+		c3._val = int_ - 22;
+		c3._code = 4;
 	} else {
 		switch (int_) {
 		case 60:
-			c3.val = 32;  /*  " "  */
-			c3.code = 9;
+			c3._val = 32;  /*  " "  */
+			c3._code = 9;
 			break;
 		case 61:
-			c3.val = 46;  /*  "."  */
-			c3.code = 9;
+			c3._val = 46;  /*  "."  */
+			c3._code = 9;
 			break;
 		case 62:
-			c3.val = 35;  /*  "#"  */
-			c3.code = 9;
+			c3._val = 35;  /*  "#"  */
+			c3._code = 9;
 		default:
 			break;
 		}
@@ -109,7 +109,7 @@ void regenbruit() {
 	int i = offsetb3 + 8590;
 	int j = 0;
 	do {
-		t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
+		g_t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
 		i += 2;
 		++j;
 	} while (i < offsetb3 + 8790);
@@ -134,7 +134,7 @@ void charge_phbruit() {
 		error("Missing file - phbrui.mor");
 
 	for (int i = 1; i <= 3; ++i)
-		t_cph[i] = f.readSint16LE();
+		g_t_cph[i] = f.readSint16LE();
 
 	f.close();
 }
@@ -158,40 +158,40 @@ void trait_car() {
 	byte d3;
 	int d2, i;
 
-	switch (c2.code) {
+	switch (c2._code) {
 	case 9:
-		if (c2.val != ord('#'))
-			for (i = 0; i <= c2.rep; ++i)
-				entroct(c2.val);
+		if (c2._val != ord('#'))
+			for (i = 0; i <= c2._rep; ++i)
+				entroct(c2._val);
 		break;
 	case 5:
 	case 6:
-		if (c2.code == 6)
-			d3 = tabdph[(c2.val - 14) << 1];
+		if (c2._code == 6)
+			d3 = g_tabdph[(c2._val - 14) << 1];
 		else
 			d3 = null;
-		if (c1.code >= 5) {
-			veracf(c2.acc);
-			if (c1.code == 9) {
+		if (c1._code >= 5) {
+			veracf(c2._acc);
+			if (c1._code == 9) {
 				entroct(4);
 				if (d3 == null)
-					entroct(c2.val);
+					entroct(c2._val);
 				else
 					entroct(d3);
 				entroct(22);
 			}
 		}
 
-		switch (c2.rep) {
+		switch (c2._rep) {
 		case 0:
 			entroct(0);
-			entroct(c2.val);
+			entroct(c2._val);
 			if (d3 == null)
-				if (c3.code == 9)
+				if (c3._code == 9)
 					entroct(2);
 				else
 					entroct(4);
-			else if (c3.code == 9)
+			else if (c3._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -199,13 +199,13 @@ void trait_car() {
 		case 4:
 		case 5:
 		case 6:
-			if (c2.rep != 4) {
-				i = c2.rep - 5;
+			if (c2._rep != 4) {
+				i = c2._rep - 5;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2.val);
+						entroct(c2._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -213,24 +213,24 @@ void trait_car() {
 			}
 			if (d3 == null) {
 				entroct(4);
-				entroct(c2.val);
+				entroct(c2._val);
 				entroct(0);
 			} else {
 				entroct(0);
-				entroct(c2.val);
+				entroct(c2._val);
 				entroct(3);
 			}
 			break;
 		case 7:
 		case 8:
 		case 9:
-			if (c2.rep != 7) {
-				i = c2.rep - 8;
+			if (c2._rep != 7) {
+				i = c2._rep - 8;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2.val);
+						entroct(c2._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -238,32 +238,32 @@ void trait_car() {
 			}
 			if (d3 == null) {
 				entroct(0);
-				entroct(c2.val);
+				entroct(c2._val);
 				entroct(2);
 			} else {
 				entroct(0);
-				entroct(c2.val);
+				entroct(c2._val);
 				entroct(0);
 			}
 			break;
 		case 1:
 		case 2:
 		case 3:
-			if (c2.rep != 1) {
-				i = c2.rep - 2;
+			if (c2._rep != 1) {
+				i = c2._rep - 2;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2.val);
+						entroct(c2._val);
 					else
 						entroct(d3);
 					entroct(3);
 				} while (i >= 0);
 			}
 			entroct(0);
-			entroct(c2.val);
-			if (c3.code == 9)
+			entroct(c2._val);
+			if (c3._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -275,16 +275,16 @@ void trait_car() {
 
 	case 2:
 	case 3:
-		d3 = c2.code + 5; //  7 ou 8  => Corresponding vowel
-		if (c1.code > 4) {
-			veracf(c2.acc);
-			if (c1.code == 9) {
+		d3 = c2._code + 5; //  7 ou 8  => Corresponding vowel
+		if (c1._code > 4) {
+			veracf(c2._acc);
+			if (c1._code == 9) {
 				entroct(4);
 				entroct(d3);
 				entroct(22);
 			}
 		}
-		i = c2.rep;
+		i = c2._rep;
 		assert(i >= 0);
 		if (i != 0) {
 			do {
@@ -294,24 +294,24 @@ void trait_car() {
 				entroct(3);
 			} while (i > 0);
 		}
-		veracf(c3.acc);
-		if (c3.code == 6) {
+		veracf(c3._acc);
+		if (c3._code == 6) {
 			entroct(4);
-			entroct(tabdph[(c3.val - 14) << 1]);
-			entroct(c2.val);
+			entroct(g_tabdph[(c3._val - 14) << 1]);
+			entroct(c2._val);
 		} else {
 			entroct(4);
-			if (c3.val == 4)
+			if (c3._val == 4)
 				entroct(3);
 			else
-				entroct(c3.val);
-			entroct(c2.val);
+				entroct(c3._val);
+			entroct(c2._val);
 		}
 		break;
 	case 0:
 	case 1: 
-		veracf(c2.acc);
-		switch (c3.code) {
+		veracf(c2._acc);
+		switch (c3._code) {
 		case 2:
 			d2 = 7;
 			break;
@@ -319,130 +319,130 @@ void trait_car() {
 			d2 = 8;
 			break;
 		case 6:
-			d2 = tabdph[(c3.val - 14) << 1];
+			d2 = g_tabdph[(c3._val - 14) << 1];
 			break;
 		case 5:
-			d2 = c3.val;
+			d2 = c3._val;
 			break;
 		default:
 			d2 = 10;
 			break;
-		}       //  switch  c3.code
-		d2 = d2 * 26 + c2.val;
-		if (tnocon[d2] == 0)
+		}       //  switch  c3._code
+		d2 = d2 * 26 + c2._val;
+		if (g_tnocon[d2] == 0)
 			d3 = 2;
 		else
 			d3 = 6;
-		if (c2.rep >= 5) {
-			c2.rep = c2.rep - 5;
+		if (c2._rep >= 5) {
+			c2._rep = c2._rep - 5;
 			d3 = 8 - d3;       // Swap 2 and 6
 		}
-		if (c2.code == 0) {
-			i = c2.rep;
+		if (c2._code == 0) {
+			i = c2._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(c2.val);
+					entroct(c2._val);
 					entroct(3);
 				} while (i > 0);
 			}
 			entroct(d3);
-			entroct(c2.val);
+			entroct(c2._val);
 			entroct(4);
 		} else {
 			entroct(d3);
-			entroct(c2.val);
+			entroct(c2._val);
 			entroct(3);
-			i = c2.rep;
+			i = c2._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(c2.val);
+					entroct(c2._val);
 					entroct(4);
 				} while (i > 0);
 			}
 		}
-		if (c3.code == 9) {
+		if (c3._code == 9) {
 			entroct(d3);
-			entroct(c2.val);
+			entroct(c2._val);
 			entroct(5);
-		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
-			veracf(c3.acc);
-			switch (c3.code) {
+		} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
+			veracf(c3._acc);
+			switch (c3._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = tabdph[(c3.val - 14) << 1];
+				d2 = g_tabdph[(c3._val - 14) << 1];
 				break;
 			case 5:
-				d2 = c3.val;
+				d2 = c3._val;
 				break;
 			default:
 				d2 = 7;
 				break;
-			}     //  switch c3.code
+			}     //  switch c3._code
 			if (d2 == 4)
 				d2 = 3;
 
-			if (intcon[c2.val] != 0)
-				++c2.val;
+			if (g_intcon[c2._val] != 0)
+				++c2._val;
 
-			if ((c2.val == 17) || (c2.val == 18))
-				c2.val = 16;
+			if ((c2._val == 17) || (c2._val == 18))
+				c2._val = 16;
 
 			entroct(4);
 			entroct(d2);
-			entroct(c2.val);
+			entroct(c2._val);
 		}
 	
 		break;
 	case 4:
-		veracf(c2.acc);
-		i = c2.rep;
+		veracf(c2._acc);
+		i = c2._rep;
 		if (i != 0) {
 			do {
 				--i;
 				entroct(2);
-				entroct(c2.val);
+				entroct(c2._val);
 				entroct(3);
 			} while (i > 0);
 		}
 		entroct(2);
-		entroct(c2.val);
+		entroct(c2._val);
 		entroct(4);
-		if (c3.code == 9) {
+		if (c3._code == 9) {
 			entroct(2);
-			entroct(c2.val);
+			entroct(c2._val);
 			entroct(5);
-		} else if ((c3.code != 0) && (c3.code != 1) && (c3.code != 4)) {
-			veracf(c3.acc);
-			switch (c3.code) {
+		} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
+			veracf(c3._acc);
+			switch (c3._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = tabdph[(c3.val - 14) << 1];
+				d2 = g_tabdph[(c3._val - 14) << 1];
 				break;
 			case 5:
-				d2 = c3.val;
+				d2 = c3._val;
 				break;
 			default:
 				d2 = 7;
 				break;
-			}     //  switch c3.code
+			}     //  switch c3._code
 
 			if (d2 == 4)
 				d2 = 3;
 
-			if (intcon[c2.val] != 0)
-				++c2.val;
+			if (g_intcon[c2._val] != 0)
+				++c2._val;
 
 			entroct(4);
 			entroct(d2);
-			entroct(tabdbc[((c2.val - 26) << 1) + 1]);
+			entroct(g_tabdbc[((c2._val - 26) << 1) + 1]);
 		}
 	
 		break;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index a96edde..8d781b7 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -38,14 +38,14 @@ namespace Mortevielle {
 void rot_chariot() {
 	c1 = c2;
 	c2 = c3;
-	c3.val = 32;
-	c3.code = 9;
+	c3._val = 32;
+	c3._code = 9;
 }
 
 void init_chariot() {
-	c3.rep = 0;
-	c3.freq = 0;
-	c3.acc = 0;
+	c3._rep = 0;
+	c3._freq = 0;
+	c3._acc = 0;
 	rot_chariot();
 	rot_chariot();
 }
@@ -55,13 +55,13 @@ void trait_ph() {
 	const int deca[3] = {300, 30, 40};
 
 	g_ptr_tcph = g_num_ph - 1;
-	g_ledeb = swap(t_cph[g_ptr_tcph]) + deca[g_typlec];
-	g_lefin = swap(t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
+	g_ledeb = swap(g_t_cph[g_ptr_tcph]) + deca[g_typlec];
+	g_lefin = swap(g_t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
 	g_nb_word = g_lefin - g_ledeb;
 	g_ptr_tcph = (uint)g_ledeb >> 1;
 	g_ptr_word = 0;
 	do {
-		WRITE_LE_UINT16(&mem[adword + g_ptr_word], t_cph[g_ptr_tcph]);
+		WRITE_LE_UINT16(&mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
 		g_ptr_word += 2;
 		++g_ptr_tcph;
 	} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
@@ -95,13 +95,13 @@ void parole(int rep, int ht, int typ) {
 	g_typlec = typ;
 	if (g_typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
-			savph[i] = t_cph[i];
-		tempo = tempo_bruit;
+			savph[i] = g_t_cph[i];
+		tempo = kTempoNoise;
 	} else if (g_haut > 5)
-		tempo = tempo_f;
+		tempo = kTempoF;
 	else
-		tempo = tempo_m;
-	addfix = (float)((tempo - addv[0])) / 256;
+		tempo = kTempoM;
+	addfix = (float)((tempo - g_addv[0])) / 256;
 	cctable(tbi);
 	switch (typ) {
 	case 1:
@@ -120,7 +120,7 @@ void parole(int rep, int ht, int typ) {
 	g_vm->_soundManager.litph(tbi, typ, tempo);
 	if (g_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
-			t_cph[i] = savph[i];
+			g_t_cph[i] = savph[i];
 			g_mlec = g_typlec;
 		}
 	writepal(g_numpal);
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index b34e64a..0731418 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -100,7 +100,7 @@ void MortevielleEngine::gameLoaded() {
 	g_hdb = 0;
 	g_hfb = 0;
 	g_cs = 0;
-	is = 0;
+	g_is = 0;
 	k = 0;
 	g_ment = 0;
 	g_syn = true;
@@ -113,7 +113,7 @@ void MortevielleEngine::gameLoaded() {
 	g_iouv = 0;
 	g_dobj = 0;
 	affrep();
-	_hintPctMessage = deline(580);
+	g_hintPctMessage = deline(580);
 	while ((test[k] == false) && (k < 2)) {
 		++k;
 
@@ -133,10 +133,10 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, g_crep);
 	clsf3();
 	_endGame = false;
-	tmlieu(g_s.mlieu);
+	tmlieu(g_s._mlieu);
 	modinv();
-	if (g_s.derobj != 0)
-		modobj2(g_s.derobj + 400, test[1], test[2]);
+	if (g_s._derobj != 0)
+		modobj2(g_s._derobj + 400, test[1], test[2]);
 	else
 		g_tesok = test[1] || test[2];
 	showMouse();
@@ -153,7 +153,7 @@ void tmaj3() {
 		m = 1;
 	h += j * 24;
 	m += h * 2;
-	g_s.heure = chr(m);
+	g_s._heure = chr(m);
 }
 
 void tsitu() {
@@ -239,16 +239,16 @@ void tsitu() {
 		}
 	}
 	calch(j, h, m);
-	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s.mlieu != 10)) ||
-	        ((h > 0) && (h < 6) && (g_s.mlieu != 0)))
-		++g_s.conf;
-	if (((g_s.mlieu < 16) || (g_s.mlieu > 19)) && (g_s.mlieu != 23)
-	        && (g_s.mlieu != 0) && (g_s.derobj != 152) && (!g_vm->_loseGame)) {
-		if ((g_s.conf > 99) && (h > 8) && (h < 16)) {
+	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._mlieu != 10)) ||
+	        ((h > 0) && (h < 6) && (g_s._mlieu != 0)))
+		++g_s._conf;
+	if (((g_s._mlieu < 16) || (g_s._mlieu > 19)) && (g_s._mlieu != 23)
+	        && (g_s._mlieu != 0) && (g_s._derobj != 152) && (!g_vm->_loseGame)) {
+		if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
 			g_crep = 1501;
 			tperd();
 		}
-		if ((g_s.conf > 99) && (h > 0) && (h < 9)) {
+		if ((g_s._conf > 99) && (h > 0) && (h < 9)) {
 			g_crep = 1508;
 			tperd();
 		}
@@ -263,7 +263,7 @@ void tsitu() {
 /* NIVEAU 1 */
 
 void theure() {
-	g_vj = ord(g_s.heure);
+	g_vj = ord(g_s._heure);
 	g_vh = g_vj % 48;
 	g_vj /= 48;
 	g_vm__ = g_vh % 2;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 7afaa47..cbff7b7 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -49,23 +49,23 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
  * Handle saving or loading savegame data
  */
 void SavegameManager::sync_save(Common::Serializer &sz) {
-	sz.syncAsSint16LE(s1.conf);
-	sz.syncBytes((byte *)&s1.pourc[0], 11);
-	sz.syncBytes((byte *)&s1.teauto[0], 43);
-	sz.syncBytes((byte *)&s1.sjer[0], 31);
-	sz.syncAsSint16LE(s1.mlieu);
-	sz.syncAsSint16LE(s1.iboul);
-	sz.syncAsSint16LE(s1.ibag);
-	sz.syncAsSint16LE(s1.icave);
-	sz.syncAsSint16LE(s1.ivier);
-	sz.syncAsSint16LE(s1.ipuit);
-	sz.syncAsSint16LE(s1.derobj);
-	sz.syncAsSint16LE(s1.iloic);
-	sz.syncAsSint16LE(s1.icryp);
-	sz.syncAsByte(s1.ipre);
-	sz.syncAsByte(s1.heure);
-
-	sz.syncBytes(bufcha, 391);
+	sz.syncAsSint16LE(g_s1._conf);
+	sz.syncBytes((byte *)&g_s1._pourc[0], 11);
+	sz.syncBytes((byte *)&g_s1._teauto[0], 43);
+	sz.syncBytes((byte *)&g_s1._sjer[0], 31);
+	sz.syncAsSint16LE(g_s1._mlieu);
+	sz.syncAsSint16LE(g_s1._iboul);
+	sz.syncAsSint16LE(g_s1._ibag);
+	sz.syncAsSint16LE(g_s1._icave);
+	sz.syncAsSint16LE(g_s1._ivier);
+	sz.syncAsSint16LE(g_s1._ipuit);
+	sz.syncAsSint16LE(g_s1._derobj);
+	sz.syncAsSint16LE(g_s1._iloic);
+	sz.syncAsSint16LE(g_s1._icryp);
+	sz.syncAsByte(g_s1._ipre);
+	sz.syncAsByte(g_s1._heure);
+
+	sz.syncBytes(g_bufcha, 391);
 }
 
 /**
@@ -107,9 +107,9 @@ void SavegameManager::takesav(int n) {
 	Common::Serializer sz(stream, NULL);
 	sync_save(sz);
 
-	g_s = s1;
+	g_s = g_s1;
 	for (i = 0; i <= 389; ++i)
-		tabdon[i + acha] = bufcha[i];
+		g_tabdon[i + acha] = g_bufcha[i];
 
 	// Close the stream
 	delete stream;	
@@ -142,10 +142,10 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	tmaj3();
 	
 	for (i = 0; i <= 389; ++i)
-		bufcha[i] = tabdon[i + acha];
-	s1 = g_s;
-	if (s1.mlieu == 26)
-		s1.mlieu = 15;
+		g_bufcha[i] = g_tabdon[i + acha];
+	g_s1 = g_s;
+	if (g_s1._mlieu == 26)
+		g_s1._mlieu = 15;
 	
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 8d9e67f..d49feac 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -111,37 +111,37 @@ void taffich() {
 
 	switch (a) {
 	case 16:
-		g_s.pourc[9] = '*';
-		g_s.teauto[42] = '*';
+		g_s._pourc[9] = '*';
+		g_s._teauto[42] = '*';
 		break;
 	case 20:
-		g_s.teauto[39] = '*';
-		if (g_s.teauto[36] == '*') {
-			g_s.pourc[3] = '*';
-			g_s.teauto[38] = '*';
+		g_s._teauto[39] = '*';
+		if (g_s._teauto[36] == '*') {
+			g_s._pourc[3] = '*';
+			g_s._teauto[38] = '*';
 		}
 		break;
 	case 24:
-		g_s.teauto[37] = '*';
+		g_s._teauto[37] = '*';
 		break;
 	case 30:
-		g_s.teauto[9] = '*';
+		g_s._teauto[9] = '*';
 		break;
 	case 31:
-		g_s.pourc[4] = '*';
-		g_s.teauto[35] = '*';
+		g_s._pourc[4] = '*';
+		g_s._teauto[35] = '*';
 		break;
 	case 118:
-		g_s.teauto[41] = '*';
+		g_s._teauto[41] = '*';
 		break;
 	case 143:
-		g_s.pourc[1] = '*';
+		g_s._pourc[1] = '*';
 		break;
 	case 150:
-		g_s.teauto[34] = '*';
+		g_s._teauto[34] = '*';
 		break;
 	case 151:
-		g_s.pourc[2] = '*';
+		g_s._pourc[2] = '*';
 		break;
 	default:
 		break;
@@ -162,15 +162,20 @@ void taffich() {
 			m = 2034;
 		if ((a == 17) && (g_maff == 14))
 			m = 2018;
-		if (a > 99)
-			if ((is == 1) || (is == 0))
+
+		if (a > 99) {
+			if ((g_is == 1) || (g_is == 0))
 				m = 2031;
 			else
 				m = 2032;
+		}
+
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
-		if (((a < 27) && (((g_maff > 69) && (!g_s.ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+
+		if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
+
 		messint(m);
 		g_maff = a;
 		if (a == 159)
@@ -217,7 +222,7 @@ void taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			mem[(0x7000 * 16) + 2 + (k << 1)] = rang[i];
+			mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
 			alllum[k] = -1;
 		}
 	}
@@ -244,11 +249,11 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_s.mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_s._mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
 		else if (!g_blo)
-			t11(g_s.mlieu, cx);
+			t11(g_s._mlieu, cx);
 		g_mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 8873c7e..0b8a5d7 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -37,11 +37,11 @@ namespace Mortevielle {
 /*------------------------------   CONSTANTS   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-const byte tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-const byte tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
-const byte typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-const byte intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
-const byte tnocon[364] = {
+const byte g_tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+const byte g_tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte g_typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte g_intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte g_tnocon[364] = {
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -59,7 +59,7 @@ const byte tnocon[364] = {
 };
 
 
-const byte _menuConstants[8][4] = {
+const byte g_menuConstants[8][4] = {
 	{ 7, 37, 22,  8},
 	{19, 33, 23,  7},
 	{31, 89, 10, 21},
@@ -70,9 +70,9 @@ const byte _menuConstants[8][4] = {
 	{62, 25, 13,  5}
 };
 
-const byte addv[2] = {8, 8};
+const byte g_addv[2] = {8, 8};
 
-const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
 /*---------------------------------------------------------------------------*/
 /*------------------------------   VARIABLES   ------------------------------*/
@@ -168,21 +168,20 @@ int g_x,
         g_ptr_word,
         g_color_txt;
 
-int t_cph[6401];
-byte tabdon[4001];
+int g_t_cph[6401];
+byte g_tabdon[4001];
 
-Common::String _hintPctMessage;               // Provides the % of hints
-byte is;
-byte mode;
+Common::String g_hintPctMessage;               // Provides the % of hints
+byte g_is;
 
-int nbrep[9];
-int nbrepm[9];
+int g_nbrep[9];
+int g_nbrepm[9];
 int g_msg[5];
-byte touv[8];
-sav_chaine g_s, s1;
-byte bufcha[391];
+byte g_touv[8];
+sav_chaine g_s, g_s1;
+byte g_bufcha[391];
 
-byte lettres[7][24];
+byte g_lettres[7][24];
 
 byte palher[16];
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 3b2e44d..cff7512 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -95,27 +95,26 @@ const int offsetb3 = 6;
 
 const int null = 255;
 
-const int tempo_mus = 71;
-const int tempo_bruit = 78;
-const int tempo_f = 80;
-const int tempo_m = 89;
+const int kTempoMusic = 71;
+const int kTempoNoise = 78;
+const int kTempoF = 80;
+const int kTempoM = 89;
 
 const int ti1 = 410;
 const int ti2 = 250;
 const int maxti = 7975;
 const int maxtd = 600;
-const int max_rect = 14;
-
-const int c_repon = 0;
-const int c_st41 = 186;
-const int c_tparler = 247;
-const int c_paroles = 292;
-const int c_tmlieu = 435;
-const int c_dialpre = 456;
-const int c_action = 476;
-const int c_saction = 497;
-const int c_dis = 502;
-const int c_fin = 510;    /*  =>   n'existe pas  ; si !! */
+const int kMaxRect = 14;
+
+const int kDescriptionStringIndex = 0;                // Unused
+const int kInventoryStringIndex = 186;
+const int kQuestionStringIndex = 247;
+const int kDialogStringIndex = 292;
+const int kMenuPlaceStringIndex = 435;
+const int kMenuActionStringIndex = 476;
+const int kMenuSelfStringIndex = 497;
+const int kMenuSayStringIndex = 502;
+const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
 
 const int arega = 0;
 const int asoul = 154;
@@ -128,7 +127,6 @@ const int amzon = 1650;
 const int fleche = 1758;
 
 const int OPCODE_NONE = 0;
-
 enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
             OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
 			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
@@ -136,73 +134,71 @@ enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,
 			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
 			OPCODE_SLOOK = 0x405};
 
-const int max_patt = 20;
+const int kMaxPatt = 20;
 
-extern const byte tabdbc[18];
-extern const byte tabdph[16];
-extern const byte typcon[26];
-extern const byte intcon[26];
-extern const byte tnocon[364];
+extern const byte g_tabdbc[18];
+extern const byte g_tabdph[16];
+extern const byte g_typcon[26];
+extern const byte g_intcon[26];
+extern const byte g_tnocon[364];
 
-extern const byte _menuConstants[8][4];
+extern const byte g_menuConstants[8][4];
 
-extern const byte addv[2];
+extern const byte g_addv[2];
 
-extern const byte rang[16];
+extern const byte g_rang[16];
 
 /*---------------------------------------------------------------------------*/
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 struct sav_chaine {
-	int conf;
-	byte pourc[11];
-	byte teauto[43];
-	byte sjer[31];
-	int mlieu, iboul, ibag, icave, ivier, ipuit;
-	int derobj, iloic, icryp;
-	bool ipre;
-	byte heure;
+	int _conf;
+	byte _pourc[11];
+	byte _teauto[43];
+	byte _sjer[31];
+	int _mlieu, _iboul, _ibag, _icave, _ivier, _ipuit;
+	int _derobj, _iloic, _icryp;
+	bool _ipre;
+	byte _heure;
 };
 
 struct registres {
-	int ax, bx, cx, dx, bp, si, di, ds, es, flags;
+	int _ax, _bx, _cx, _dx, _bp, _si, _di, _ds, _es, _flags;
 };
 
 struct ind {
-	int indis;
-	byte point;
+	int _indis;
+	byte _point;
 };
 
 struct chariot {
-	int val,
-		code,
-		acc,
-		freq,
-		rep;
+	int _val,
+		_code,
+		_acc,
+		_freq,
+		_rep;
 };
 
 struct rectangle {
-	int x1, x2, y1, y2;
-	bool enabled;
+	int _x1, _x2, _y1, _y2;
+	bool _enabled;
 };
 
 struct pattern {
-	byte tay, tax;
-	byte des[max_patt+1][max_patt+1];
+	byte _tay, _tax;
+	byte _des[kMaxPatt + 1][kMaxPatt + 1];
 };
 
 
 struct nhom {
-	byte n;     /* numero entre 0 et 32 */
-	byte hom[4];
+	byte _id;     /* number betwwen 0 and 32 */
+	byte _hom[4];
 };
 
-typedef nhom t_nhom[16];
-
 struct t_pcga {
-	byte p;
-	nhom a[16];
+	byte _p;
+	nhom _a[16];
 };
 
 typedef int tablint[256];
@@ -308,21 +304,20 @@ extern int g_x,
         g_ptr_word,
         g_color_txt;
 
-extern int t_cph[6401];
-extern byte tabdon[4001];
+extern int g_t_cph[6401];
+extern byte g_tabdon[4001];
 
-extern Common::String _hintPctMessage;      // gives the pct of hints found
-extern byte is;
-extern byte mode;
+extern Common::String g_hintPctMessage;      // gives the pct of hints found
+extern byte g_is;
 
-extern int nbrep[9];
-extern int nbrepm[9];
+extern int g_nbrep[9];
+extern int g_nbrepm[9];
 extern int g_msg[5];
-extern byte touv[8];
-extern sav_chaine g_s, s1;
-extern byte bufcha[391];
+extern byte g_touv[8];
+extern sav_chaine g_s, g_s1;
+extern byte g_bufcha[391];
 
-extern byte lettres[7][24];
+extern byte g_lettres[7][24];
 
 extern byte palher[16];
 


Commit: 81049d8d96b6b445f6688b77d2a1f1c754842c72
    https://github.com/scummvm/scummvm/commit/81049d8d96b6b445f6688b77d2a1f1c754842c72
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:28-07:00

Commit Message:
MORTEVIELLE: Rename more globals

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/level15.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3108594..ce02915 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -911,7 +911,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &mem[0x7000 * 16 + 2];
+	const byte *paletteMap = &g_mem[0x7000 * 16 + 2];
 
 	// Loop through writing 
 	for (int yp = 0; yp < surface.h; ++yp) {
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 602d53d..72fc6e9 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -46,7 +46,7 @@ int testou() {
 		break;
 	case '\26' :
 		if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
-			zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+			zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			++g_c_zzz;
 
 			return 61;
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index aabbe29..444a810 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -61,12 +61,13 @@ bool isMouseIn(rectangle r) {
 void outbloc(int n, pattern p, nhom *pal) {
 	int ad = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p._tax);
-	WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p._tay);
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad + 2], p._tay);
 	ad += 4;
-	for (int i = 1; i <= p._tax; ++i)
+	for (int i = 1; i <= p._tax; ++i) {
 		for (int j = 1; j <= p._tay; ++j)
-			mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
+			g_mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
+	}
 }
 
 void writepal(int n) {
@@ -75,22 +76,22 @@ void writepal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			mem[(0x7000 * 16) + (2 * i)] = tabpal[n][i].x;
-			mem[(0x7000 * 16) + (2 * i) + 1] = tabpal[n][i].y;
+			g_mem[(0x7000 * 16) + (2 * i)] = g_tabpal[n][i].x;
+			g_mem[(0x7000 * 16) + (2 * i) + 1] = g_tabpal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
 		warning("TODO: If this code is needed, resolve the incompatible types");
 		nhom pal[16];
 		for (int i = 0; i < 16; ++i) {
-			pal[i] = palcga[n]._a[i];
+			pal[i] = g_palcga[n]._a[i];
 		}
 //		nhom pal[16] = palcga[n]._a;
 		if (n < 89)
-			palette(palcga[n]._p);
+			palette(g_palcga[n]._p);
 		
 		for (int i = 0; i <= 15; ++i)
-			outbloc(i, tpt[pal[i]._id], pal);
+			outbloc(i, g_tpt[pal[i]._id], pal);
 		}
 		break;
 	default:
@@ -101,15 +102,15 @@ void writepal(int n) {
 
 void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
-	surface.decode(&mem[seg * 16 + dep]);
+	surface.decode(&g_mem[seg * 16 + dep]);
 
 	if (g_currGraphicalDevice == MODE_HERCULES) {
-		mem[0x7000 * 16 + 2] = 0;
-		mem[0x7000 * 16 + 32] = 15;
+		g_mem[0x7000 * 16 + 2] = 0;
+		g_mem[0x7000 * 16 + 32] = 15;
 	}
 
-	if ((g_caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
+	if ((g_caff != 51) && (READ_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138], 0x100);
 
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
@@ -144,7 +145,7 @@ void adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.read(&g_mem[0x73a2 * 16 + 0], 1 * 1664);
 	f.close();
 }
 
@@ -152,12 +153,12 @@ void adzon() {
  * Returns the offset within the compressed image data resource of the desired image
  */
 int animof(int ouf, int num) {
-	int nani = mem[adani * 16 + 1];
+	int nani = g_mem[adani * 16 + 1];
 	int aux = num;
 	if (ouf != 1)
 		aux += nani;
 
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
 
 	return animof_result;
 }
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
index 34e1026..2d7c0d4 100644
--- a/engines/mortevielle/level15.h
+++ b/engines/mortevielle/level15.h
@@ -38,16 +38,10 @@ extern bool isMouseIn(rectangle r);
 extern void outbloc(int n, pattern p, nhom *pal);
 extern void writepal(int n);
 extern void pictout(int seg, int dep, int x, int y);
-// extern int calad(int x, int y);
 extern void sauvecr(int y, int dy);
 extern void charecr(int y, int dy);
-// extern int peek(int ad);
-// extern int peekw(int ad);
-// extern real peekl(int ad);
-// extern void procedure poke(int ad, int n);
 extern void adzon();
 extern int animof(int ouf, int num);
-// extern void affgd(int offs, int dep, int x, int y);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ab3467e..ddfa188 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -115,7 +115,7 @@ void dessine(int ad, int x, int y) {
 void dessine_rouleau() {
 	writepal(89);
 	if (g_currGraphicalDevice == MODE_HERCULES) {
-		mem[0x7000 * 16 + 14] = 15;
+		g_mem[0x7000 * 16 + 14] = 15;
 	}
 	hideMouse();
 	pictout(0x73a2, 0, 0, 0);
@@ -1325,7 +1325,7 @@ void aniof(int ouf, int num) {
 	int offset = animof(ouf, num);
 
 	GfxSurface surface;
-	surface.decode(&mem[ad * 16 + offset]);
+	surface.decode(&g_mem[ad * 16 + offset]);
 	g_vm->_screenSurface.drawPicture(surface, 0, 12);
 
 	ecrf1();
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 326010a..19a9e85 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -237,15 +237,15 @@ void tkey1(bool d) {
 	showMouse();
 }
 
-void tmlieu(int mli) {
+void tmlieu(int roomId) {
 	Common::String nomp;
 
-	if (mli == 26)
-		mli = 15;
+	if (roomId == 26)
+		roomId = 15;
 
 	int i = 1;
-	while ((i < 8) && (v_lieu[i][mli] != 0)) {
-		nomp = deline(v_lieu[i][mli] + kMenuPlaceStringIndex);
+	while ((i < 8) && (g_v_lieu[i][roomId] != 0)) {
+		nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 8dc0e1a..64eed71 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -43,7 +43,7 @@ extern void fenat(char ans);
 /* NIVEAU 8 */
 extern void afdes(int ad);
 extern void tkey1(bool d);
-extern void tmlieu(int mli);
+extern void tmlieu(int roomId);
 /* NIVEAU 7 */
 extern void tlu(int af, int ob);
 extern void affrep();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4a410f0..52bb1fe 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -149,7 +149,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
-	zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	g_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
@@ -504,7 +504,7 @@ void MortevielleEngine::mainGame() {
 		charge_cfiec();
 
 	for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep) 
-		zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+		zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	charge_bruit5();
 	_menu.initMenu();
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index ca88a79..4fcbb02 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -60,7 +60,7 @@ void initMouse() {
 	
 	g_vm->setMouseClick(false);
 	m_show = m_arrow;
-	if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))
+	if ((READ_LE_UINT16(&g_mem[0xcc]) == 0) && (READ_LE_UINT16(&g_mem[0xce]) == 0))
 		int_m = false;
 
 	if (int_m) {
@@ -91,10 +91,10 @@ void hideMouse() {
 			int k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 			do {
-				WRITE_LE_UINT16(&mem[0xb000 * 16 + j], s_s[0][k]);
-				WRITE_LE_UINT16(&mem[0xb800 * 16 + j + 2], s_s[1][k]);
-				WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
-				WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
+				WRITE_LE_UINT16(&g_mem[0xb000 * 16 + j], s_s[0][k]);
+				WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j + 2], s_s[1][k]);
+				WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j], s_s[2][k]);
+				WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j += 80;
 				++k;
 			} while (k < 5);
@@ -102,15 +102,15 @@ void hideMouse() {
 			break;
 		case MODE_AMSTRAD1512:
 			for (int i = 0; i <= 3; ++i) {
-				port[0x3dd] = 1 << i;
+				g_port[0x3dd] = 1 << i;
 				int k = 0;
 				j = p_o_s;
 				do {
 					if (imp) {
-						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 80 - 0x2000;
 					} else {
-						WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 0x2000;
 					}
 					imp = !imp;
@@ -119,22 +119,22 @@ void hideMouse() {
 			}
 			break;
 		case MODE_EGA: {
-			port[0x3c4] = 2;
-			port[0x3ce] = 8;
-			port[0x3cf] = 255;
+			g_port[0x3c4] = 2;
+			g_port[0x3ce] = 8;
+			g_port[0x3cf] = 255;
 			int i = 0;
 			do {
-				port[0x3c5] = 1 << i;
+				g_port[0x3c5] = 1 << i;
 				int k = 0;
 				j = p_o_s;
 				do {
 					// Useless ?
 					// ps = mem[0xa000 * 16 + j];
-					mem[0xa000 * 16 + j] = lo(s_s[i][k]);
+					g_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
 
 					// Useless ??
 					// ps = mem[0xa000 * 16 + j + 1];
-					mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
+					g_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
 					++k;
 				} while (k < 8);
@@ -146,7 +146,7 @@ void hideMouse() {
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 			for (int i = 0; i <= 5; ++i) {
 				for (int k = 0; k <= 3; ++k) 
-					WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
+					WRITE_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
 			break;
@@ -155,8 +155,8 @@ void hideMouse() {
 			int k = 0;
 			do {
 				for (int i = 0; i <= 3; ++i) {
-					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
-					WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
+					WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
+					WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j += 160;
 				++k;
@@ -188,10 +188,10 @@ void showMouse() {
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
 		do {
-			s_s[0][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
-			s_s[1][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j + 2]);
-			s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
-			s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
+			s_s[0][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
+			s_s[1][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j + 2]);
+			s_s[2][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j]);
+			s_s[3][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j + 2]);
 			j += 80;
 			++k;
 		} while (k < 5);
@@ -200,14 +200,14 @@ void showMouse() {
 		for (i = 0; i <= 3; ++i) {
 			j = p_o_s;
 			imp = odd(y_s);
-			port[0x3de] = i;
+			g_port[0x3de] = i;
 			k = 0;
 			do {
 				if (imp) {
-					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
 					j += 80 - 0x2000;
 				} else {
-					s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
 					j += 0x2000;
 				}
 				imp = !imp;
@@ -216,14 +216,14 @@ void showMouse() {
 		}
 		break;
 	case MODE_EGA:
-		port[0x3ce] = 4;
+		g_port[0x3ce] = 4;
 		l = 0;
 		do {
-			port[0x3cf] = l;
+			g_port[0x3cf] = l;
 			k = 0;
 			j = p_o_s;
 			do {
-				s_s[l][k] = mem[0xa000 * 16 + j] + (mem[(0xa000 * 16) + j + 1] << 8);
+				s_s[l][k] = g_mem[0xa000 * 16 + j] + (g_mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
 				++k;
 			} while (k < 8);
@@ -234,7 +234,7 @@ void showMouse() {
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
 		for (i = 0; i <= 5; ++i) {
 			for (k = 0; k <= 3; ++k)
-				s_s[i][k] = READ_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j]);
+				s_s[i][k] = READ_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j]);
 			j += 80;
 		}
 		break;
@@ -243,8 +243,8 @@ void showMouse() {
 		k = 0;
 		do {
 			for (i = 0; i <= 3; ++i) {
-				s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
-				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
+				s_s[k][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j]);
+				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
 			j += 160;
 			++k;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 4d54040..43a0386 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -76,13 +76,13 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	uint16 oct, ocd;
 
 	/* 5-8 */
-	oct = t_mot[idx];
+	oct = g_t_mot[idx];
 	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
 	if (pt < 6) {
 		++idx;
 		oct = oct << (5 - pt);
 		pt += 11;
-		oct = oct | ((uint)t_mot[idx] >> pt);
+		oct = oct | ((uint)g_t_mot[idx] >> pt);
 	} else {
 		pt -= 5;
 		oct = (uint)oct >> pt;
@@ -95,13 +95,13 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		break;
 	case 30:
 	case 31:
-		ocd = t_mot[idx];
+		ocd = g_t_mot[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
 			++idx;
 			ocd = ocd << (5 - pt);
 			pt += 11;
-			ocd = ocd | ((uint)t_mot[idx] >> pt);
+			ocd = ocd | ((uint)g_t_mot[idx] >> pt);
 		} else {
 			pt -= 5;
 			ocd = (uint)ocd >> pt;
@@ -134,8 +134,8 @@ Common::String deline(int num) {
 	} else if (!g_vm->_txxFileFl) {
 		wrkStr = g_vm->getGameString(num);
 	} else {
-		int i = t_rec[num]._indis;
-		byte k = t_rec[num]._point;
+		int i = g_t_rec[num]._indis;
+		byte k = g_t_rec[num]._point;
 		int length = 0;
 		bool endFl = false;
 		char let;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index e69e7ae..3033235 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -68,8 +68,8 @@ void charpal() {
 		error("Missing file - plxx.mor");
 	for (int i = 0; i <= 90; ++i) {
 		for (int j = 1; j <= 16; ++j) {
-			tabpal[i][j].x = f.readByte();
-			tabpal[i][j].y = f.readByte();
+			g_tabpal[i][j].x = f.readByte();
+			g_tabpal[i][j].y = f.readByte();
 		}
 	}
 	f.close();
@@ -78,9 +78,9 @@ void charpal() {
 		error("Missing file - cxx.mor");
 
 	for (int j = 0; j <= 90; ++j) {
-		palcga[j]._p = fb.readByte();
+		g_palcga[j]._p = fb.readByte();
 		for (int i = 0; i <= 15; ++i) {
-			nhom &with = palcga[j]._a[i];
+			nhom &with = g_palcga[j]._a[i];
 
 			b = fb.readByte();
 			with._id = (uint)b >> 4;
@@ -88,13 +88,13 @@ void charpal() {
 			with._hom[1] = b & 3;
 		}
 	}
-	palcga[10]._a[9] = palcga[10]._a[5];
+	g_palcga[10]._a[9] = g_palcga[10]._a[5];
 	for (int j = 0; j <= 14; ++j) {
-		tpt[j]._tax = fb.readByte();
-		tpt[j]._tay = fb.readByte();
+		g_tpt[j]._tax = fb.readByte();
+		g_tpt[j]._tay = fb.readByte();
 		for (int i = 1; i <= 20; ++i)
 			for (int k = 1; k <= 20; ++k)
-				tpt[j]._des[i][k] = fb.readByte();
+				g_tpt[j]._des[i][k] = fb.readByte();
 	}
 	fb.close();
 }
@@ -112,35 +112,29 @@ void chartex() {
 	if (!inpFile.open("TXX.INP")) {
 		if (!inpFile.open("TXX.MOR")) {
 			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-			return;
 		}
-	}
-
-	if (!ntpFile.open("TXX.NTP")) {
-		if (!ntpFile.open("TXX.IND")) {
-			warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
-			return;
-		}
-	}
-
-	if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
+	} else if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
 		warning("TXX file - Unexpected format - Switching to DAT file");
 		return;
+	} else {
+		for (int i = 0; i < inpFile.size() / 2; ++i)
+			g_t_mot[i] = inpFile.readUint16LE();
+	
+		inpFile.close();
+		g_vm->_txxFileFl = true;
 	}
 
-	for (int i = 0; i < inpFile.size() / 2; ++i)
-		t_mot[i] = inpFile.readUint16LE();
-
-	inpFile.close();
+	if (!ntpFile.open("TXX.NTP")) {
+		error("Missing file - TXX.NTP");
+	}
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		t_rec[i]._indis = ntpFile.readSint16LE();
-		t_rec[i]._point = ntpFile.readByte();
+		g_t_rec[i]._indis = ntpFile.readSint16LE();
+		g_t_rec[i]._point = ntpFile.readByte();
 	}
 
 	ntpFile.close();
 
-	g_vm->_txxFileFl = true;
 }
 
 /**
@@ -154,17 +148,17 @@ void dialpre() {
 }
 
 void init_lieu() {
-	Common::File f_lieu;	// tab_mlieu
+	Common::File f;
 
-	/* debug('o3 init_lieu'); */
-	if (!f_lieu.open("MXX.mor"))
+	if (!f.open("MXX.mor"))
 		error("Missing file - MXX.mor");
 
-	for (int i = 1; i < 8; ++i)
+	for (int i = 1; i < 8; ++i) {
 		for (int j = 0; j < 25; ++j)
-			v_lieu[i][j] = f_lieu.readByte(); 
+			g_v_lieu[i][j] = f.readByte(); 
+	}
 
-	f_lieu.close();
+	f.close();
 }
 
 
@@ -182,19 +176,19 @@ void music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&mem[0x3800 * 16 + 0], 500);
-	fic.read(&mem[0x47a0 * 16 + 0], 123);
+	fic.read(&g_mem[0x3800 * 16 + 0], 500);
+	fic.read(&g_mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
-	addfix = (float)((kTempoMusic - g_addv[1])) / 256;
-	cctable(tbi);
+	g_vm->_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
+	g_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
+	cctable(g_tbi);
 
 	fin = false;
 	k = 0;
 	do {
 		fin = keypressed();
-		g_vm->_soundManager.musyc(tbi, 9958, kTempoMusic);
+		g_vm->_soundManager.musyc(g_tbi, 9958, kTempoMusic);
 		++k;
 		fin = fin | keypressed() | (k >= 5);
 	} while (!fin);
@@ -209,7 +203,7 @@ void charge_bruit5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&mem[adbruit5 * 16 + 0], 149 * 128);
+	f.read(&g_mem[adbruit5 * 16 + 0], 149 * 128);
 	f.close();
 }
 
@@ -219,7 +213,7 @@ void charge_cfiec() {
 	if (!f.open("cfiec.mor"))
 		error("Missing file - cfiec.mor");
 
-	f.read(&adcfiec[0], 822 * 128);
+	f.read(&g_adcfiec[0], 822 * 128);
 	f.close();
 
 	g_rech_cfiec = false;
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index f0d7552..8974b45 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -33,49 +33,49 @@
 namespace Mortevielle {
 
 void spfrac(int wor) {
-	c3._rep = (uint)wor >> 12;
-	if ((g_typlec == 0) && (c3._code != 9))
-		if (((c3._code > 4) && (c3._val != 20) && (c3._rep != 3) && (c3._rep != 6) && (c3._rep != 9)) ||
-				((c3._code < 5) && ((c3._val != 19) && (c3._val != 22) && (c3._rep != 4) && (c3._rep != 9)))) {
-			++c3._rep;
+	g_c3._rep = (uint)wor >> 12;
+	if ((g_typlec == 0) && (g_c3._code != 9))
+		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
+				((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
+			++g_c3._rep;
 		}
 
-	c3._freq = ((uint)wor >> 6) & 7;
-	c3._acc = ((uint)wor >> 9) & 7;
+	g_c3._freq = ((uint)wor >> 6) & 7;
+	g_c3._acc = ((uint)wor >> 9) & 7;
 }
 
 void charg_car() {
 	int wor, int_;
 
-	wor = swap(READ_LE_UINT16(&mem[adword + g_ptr_word]));
+	wor = swap(READ_LE_UINT16(&g_mem[adword + g_ptr_word]));
 	int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
-		c3._val = int_;
-		c3._code = 5;
+		g_c3._val = int_;
+		g_c3._code = 5;
 	} else if ((int_ >= 14) && (int_ <= 21)) {
-		c3._val = int_;
-		c3._code = 6;
+		g_c3._val = int_;
+		g_c3._code = 6;
 	} else if ((int_ >= 22) && (int_ <= 47)) {
 		int_ = int_ - 22;
-		c3._val = int_;
-		c3._code = g_typcon[int_];
+		g_c3._val = int_;
+		g_c3._code = g_typcon[int_];
 	} else if ((int_ >= 48) && (int_ <= 56)) {
-		c3._val = int_ - 22;
-		c3._code = 4;
+		g_c3._val = int_ - 22;
+		g_c3._code = 4;
 	} else {
 		switch (int_) {
 		case 60:
-			c3._val = 32;  /*  " "  */
-			c3._code = 9;
+			g_c3._val = 32;  /*  " "  */
+			g_c3._code = 9;
 			break;
 		case 61:
-			c3._val = 46;  /*  "."  */
-			c3._code = 9;
+			g_c3._val = 46;  /*  "."  */
+			g_c3._code = 9;
 			break;
 		case 62:
-			c3._val = 35;  /*  "#"  */
-			c3._code = 9;
+			g_c3._val = 35;  /*  "#"  */
+			g_c3._code = 9;
 		default:
 			break;
 		}
@@ -87,7 +87,7 @@ void charg_car() {
 
 
 void entroct(byte o) {
-	mem[adtroct * 16 + g_ptr_oct] = o;
+	g_mem[adtroct * 16 + g_ptr_oct] = o;
 	++g_ptr_oct;
 }
 
@@ -100,7 +100,7 @@ void cctable(tablint &t) {
 
 	tb[0] = 0;
 	for (int k = 0; k <= 255; ++k) {
-		tb[k + 1] = addfix + tb[k];
+		tb[k + 1] = g_addfix + tb[k];
 		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
@@ -109,7 +109,7 @@ void regenbruit() {
 	int i = offsetb3 + 8590;
 	int j = 0;
 	do {
-		g_t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
+		g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
 		i += 2;
 		++j;
 	} while (i < offsetb3 + 8790);
@@ -121,9 +121,9 @@ void charge_son() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 	
-	f.read(&mem[0x7414 * 16 + 0], 273);
+	f.read(&g_mem[0x7414 * 16 + 0], 273);
 
-	g_vm->_soundManager.decodeMusic(&mem[0x7414 * 16], &mem[adson * 16], 273);
+	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
 	f.close();
 }
 
@@ -146,10 +146,10 @@ void charge_bruit() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&mem[adbruit * 16 + 0], 250);
+	f.read(&g_mem[adbruit * 16 + 0], 250);
 	for (i = 0; i <= 19013; ++i)
-		mem[adbruit * 16 + 32000 + i] = mem[adbruit5 + i];
-	f.read(&mem[adbruit1 * 16 + offsetb1], 149);
+		g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
+	f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
 
 	f.close();
 }
@@ -158,40 +158,40 @@ void trait_car() {
 	byte d3;
 	int d2, i;
 
-	switch (c2._code) {
+	switch (g_c2._code) {
 	case 9:
-		if (c2._val != ord('#'))
-			for (i = 0; i <= c2._rep; ++i)
-				entroct(c2._val);
+		if (g_c2._val != ord('#'))
+			for (i = 0; i <= g_c2._rep; ++i)
+				entroct(g_c2._val);
 		break;
 	case 5:
 	case 6:
-		if (c2._code == 6)
-			d3 = g_tabdph[(c2._val - 14) << 1];
+		if (g_c2._code == 6)
+			d3 = g_tabdph[(g_c2._val - 14) << 1];
 		else
 			d3 = null;
-		if (c1._code >= 5) {
-			veracf(c2._acc);
-			if (c1._code == 9) {
+		if (g_c1._code >= 5) {
+			veracf(g_c2._acc);
+			if (g_c1._code == 9) {
 				entroct(4);
 				if (d3 == null)
-					entroct(c2._val);
+					entroct(g_c2._val);
 				else
 					entroct(d3);
 				entroct(22);
 			}
 		}
 
-		switch (c2._rep) {
+		switch (g_c2._rep) {
 		case 0:
 			entroct(0);
-			entroct(c2._val);
+			entroct(g_c2._val);
 			if (d3 == null)
-				if (c3._code == 9)
+				if (g_c3._code == 9)
 					entroct(2);
 				else
 					entroct(4);
-			else if (c3._code == 9)
+			else if (g_c3._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -199,13 +199,13 @@ void trait_car() {
 		case 4:
 		case 5:
 		case 6:
-			if (c2._rep != 4) {
-				i = c2._rep - 5;
+			if (g_c2._rep != 4) {
+				i = g_c2._rep - 5;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2._val);
+						entroct(g_c2._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -213,24 +213,24 @@ void trait_car() {
 			}
 			if (d3 == null) {
 				entroct(4);
-				entroct(c2._val);
+				entroct(g_c2._val);
 				entroct(0);
 			} else {
 				entroct(0);
-				entroct(c2._val);
+				entroct(g_c2._val);
 				entroct(3);
 			}
 			break;
 		case 7:
 		case 8:
 		case 9:
-			if (c2._rep != 7) {
-				i = c2._rep - 8;
+			if (g_c2._rep != 7) {
+				i = g_c2._rep - 8;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2._val);
+						entroct(g_c2._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -238,32 +238,32 @@ void trait_car() {
 			}
 			if (d3 == null) {
 				entroct(0);
-				entroct(c2._val);
+				entroct(g_c2._val);
 				entroct(2);
 			} else {
 				entroct(0);
-				entroct(c2._val);
+				entroct(g_c2._val);
 				entroct(0);
 			}
 			break;
 		case 1:
 		case 2:
 		case 3:
-			if (c2._rep != 1) {
-				i = c2._rep - 2;
+			if (g_c2._rep != 1) {
+				i = g_c2._rep - 2;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == null)
-						entroct(c2._val);
+						entroct(g_c2._val);
 					else
 						entroct(d3);
 					entroct(3);
 				} while (i >= 0);
 			}
 			entroct(0);
-			entroct(c2._val);
-			if (c3._code == 9)
+			entroct(g_c2._val);
+			if (g_c3._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -275,16 +275,16 @@ void trait_car() {
 
 	case 2:
 	case 3:
-		d3 = c2._code + 5; //  7 ou 8  => Corresponding vowel
-		if (c1._code > 4) {
-			veracf(c2._acc);
-			if (c1._code == 9) {
+		d3 = g_c2._code + 5; //  7 ou 8  => Corresponding vowel
+		if (g_c1._code > 4) {
+			veracf(g_c2._acc);
+			if (g_c1._code == 9) {
 				entroct(4);
 				entroct(d3);
 				entroct(22);
 			}
 		}
-		i = c2._rep;
+		i = g_c2._rep;
 		assert(i >= 0);
 		if (i != 0) {
 			do {
@@ -294,24 +294,24 @@ void trait_car() {
 				entroct(3);
 			} while (i > 0);
 		}
-		veracf(c3._acc);
-		if (c3._code == 6) {
+		veracf(g_c3._acc);
+		if (g_c3._code == 6) {
 			entroct(4);
-			entroct(g_tabdph[(c3._val - 14) << 1]);
-			entroct(c2._val);
+			entroct(g_tabdph[(g_c3._val - 14) << 1]);
+			entroct(g_c2._val);
 		} else {
 			entroct(4);
-			if (c3._val == 4)
+			if (g_c3._val == 4)
 				entroct(3);
 			else
-				entroct(c3._val);
-			entroct(c2._val);
+				entroct(g_c3._val);
+			entroct(g_c2._val);
 		}
 		break;
 	case 0:
 	case 1: 
-		veracf(c2._acc);
-		switch (c3._code) {
+		veracf(g_c2._acc);
+		switch (g_c3._code) {
 		case 2:
 			d2 = 7;
 			break;
@@ -319,66 +319,66 @@ void trait_car() {
 			d2 = 8;
 			break;
 		case 6:
-			d2 = g_tabdph[(c3._val - 14) << 1];
+			d2 = g_tabdph[(g_c3._val - 14) << 1];
 			break;
 		case 5:
-			d2 = c3._val;
+			d2 = g_c3._val;
 			break;
 		default:
 			d2 = 10;
 			break;
 		}       //  switch  c3._code
-		d2 = d2 * 26 + c2._val;
+		d2 = (d2 * 26) + g_c2._val;
 		if (g_tnocon[d2] == 0)
 			d3 = 2;
 		else
 			d3 = 6;
-		if (c2._rep >= 5) {
-			c2._rep = c2._rep - 5;
+		if (g_c2._rep >= 5) {
+			g_c2._rep = g_c2._rep - 5;
 			d3 = 8 - d3;       // Swap 2 and 6
 		}
-		if (c2._code == 0) {
-			i = c2._rep;
+		if (g_c2._code == 0) {
+			i = g_c2._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(c2._val);
+					entroct(g_c2._val);
 					entroct(3);
 				} while (i > 0);
 			}
 			entroct(d3);
-			entroct(c2._val);
+			entroct(g_c2._val);
 			entroct(4);
 		} else {
 			entroct(d3);
-			entroct(c2._val);
+			entroct(g_c2._val);
 			entroct(3);
-			i = c2._rep;
+			i = g_c2._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(c2._val);
+					entroct(g_c2._val);
 					entroct(4);
 				} while (i > 0);
 			}
 		}
-		if (c3._code == 9) {
+		if (g_c3._code == 9) {
 			entroct(d3);
-			entroct(c2._val);
+			entroct(g_c2._val);
 			entroct(5);
-		} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
-			veracf(c3._acc);
-			switch (c3._code) {
+		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
+			veracf(g_c3._acc);
+			switch (g_c3._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(c3._val - 14) << 1];
+				d2 = g_tabdph[(g_c3._val - 14) << 1];
 				break;
 			case 5:
-				d2 = c3._val;
+				d2 = g_c3._val;
 				break;
 			default:
 				d2 = 7;
@@ -387,47 +387,47 @@ void trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[c2._val] != 0)
-				++c2._val;
+			if (g_intcon[g_c2._val] != 0)
+				++g_c2._val;
 
-			if ((c2._val == 17) || (c2._val == 18))
-				c2._val = 16;
+			if ((g_c2._val == 17) || (g_c2._val == 18))
+				g_c2._val = 16;
 
 			entroct(4);
 			entroct(d2);
-			entroct(c2._val);
+			entroct(g_c2._val);
 		}
 	
 		break;
 	case 4:
-		veracf(c2._acc);
-		i = c2._rep;
+		veracf(g_c2._acc);
+		i = g_c2._rep;
 		if (i != 0) {
 			do {
 				--i;
 				entroct(2);
-				entroct(c2._val);
+				entroct(g_c2._val);
 				entroct(3);
 			} while (i > 0);
 		}
 		entroct(2);
-		entroct(c2._val);
+		entroct(g_c2._val);
 		entroct(4);
-		if (c3._code == 9) {
+		if (g_c3._code == 9) {
 			entroct(2);
-			entroct(c2._val);
+			entroct(g_c2._val);
 			entroct(5);
-		} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
-			veracf(c3._acc);
-			switch (c3._code) {
+		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
+			veracf(g_c3._acc);
+			switch (g_c3._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(c3._val - 14) << 1];
+				d2 = g_tabdph[(g_c3._val - 14) << 1];
 				break;
 			case 5:
-				d2 = c3._val;
+				d2 = g_c3._val;
 				break;
 			default:
 				d2 = 7;
@@ -437,12 +437,12 @@ void trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[c2._val] != 0)
-				++c2._val;
+			if (g_intcon[g_c2._val] != 0)
+				++g_c2._val;
 
 			entroct(4);
 			entroct(d2);
-			entroct(g_tabdbc[((c2._val - 26) << 1) + 1]);
+			entroct(g_tabdbc[((g_c2._val - 26) << 1) + 1]);
 		}
 	
 		break;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 8d781b7..3682dc9 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -36,16 +36,16 @@
 namespace Mortevielle {
 
 void rot_chariot() {
-	c1 = c2;
-	c2 = c3;
-	c3._val = 32;
-	c3._code = 9;
+	g_c1 = g_c2;
+	g_c2 = g_c3;
+	g_c3._val = 32;
+	g_c3._code = 9;
 }
 
 void init_chariot() {
-	c3._rep = 0;
-	c3._freq = 0;
-	c3._acc = 0;
+	g_c3._rep = 0;
+	g_c3._freq = 0;
+	g_c3._acc = 0;
 	rot_chariot();
 	rot_chariot();
 }
@@ -61,7 +61,7 @@ void trait_ph() {
 	g_ptr_tcph = (uint)g_ledeb >> 1;
 	g_ptr_word = 0;
 	do {
-		WRITE_LE_UINT16(&mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
+		WRITE_LE_UINT16(&g_mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
 		g_ptr_word += 2;
 		++g_ptr_tcph;
 	} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
@@ -101,8 +101,8 @@ void parole(int rep, int ht, int typ) {
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
-	addfix = (float)((tempo - g_addv[0])) / 256;
-	cctable(tbi);
+	g_addfix = (float)((tempo - g_addv[0])) / 256;
+	cctable(g_tbi);
 	switch (typ) {
 	case 1:
 		charge_bruit();
@@ -117,7 +117,7 @@ void parole(int rep, int ht, int typ) {
 		break;
 	}
 	trait_ph();
-	g_vm->_soundManager.litph(tbi, typ, tempo);
+	g_vm->_soundManager.litph(g_tbi, typ, tempo);
 	if (g_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
 			g_t_cph[i] = savph[i];
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index d49feac..6e9a66c 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -52,7 +52,7 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 	int totalLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (totalLength > 0) {
-		f.read(&mem[memIndx], 128);
+		f.read(&g_mem[memIndx], 128);
 		testfi();
 		totalLength -= 128;
 		memIndx += 128;
@@ -60,7 +60,7 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
-		mem[0x7000 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
+		g_mem[0x7000 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
 }
 
 void charani(Common::String filename, int32 skipSize, int length) {
@@ -80,7 +80,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
 	int fullLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (fullLength > 0) {
-		f.read(&mem[memIndx], 128);
+		f.read(&g_mem[memIndx], 128);
 		testfi();
 		fullLength -= 128;
 		memIndx += 128;
@@ -88,7 +88,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		mem[0x7314 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
+		g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
 }
 
 void taffich() {
@@ -214,7 +214,7 @@ void taffich() {
 	chardes(filename, lgt, handle);
 	if (g_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
+			int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -222,7 +222,7 @@ void taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
+			g_mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0b8a5d7..7b27e24 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -183,24 +183,19 @@ byte g_bufcha[391];
 
 byte g_lettres[7][24];
 
-byte palher[16];
-
-uint16 t_mot[maxti + 1];
-int tay_tchar;
-ind t_rec[maxtd + 1];
-//file<ind> sauv_t;
-//untyped_file fibyte;
-byte v_lieu[8][25];
+uint16 g_t_mot[maxti + 1];
+int g_tay_tchar;
+ind g_t_rec[maxtd + 1];
+byte g_v_lieu[8][25];
 int g_l[108];
-int tbi[256];
-chariot c1, c2, c3;
-float addfix;
-t_pcga palsav[91];
-Common::Point tabpal[91][17];
-t_pcga palcga[91];
-pattern tpt[15];
+int g_tbi[256];
+chariot g_c1, g_c2, g_c3;
+float g_addfix;
+Common::Point g_tabpal[91][17];
+t_pcga g_palcga[91];
+pattern g_tpt[15];
 
-byte adcfiec[(4088 * 16) + (311 * 0x80)];
+byte g_adcfiec[(4088 * 16) + (311 * 0x80)];
 
 /*---------------------------------------------------------------------------*/
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
@@ -236,8 +231,8 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 /*------------------------------     STUBS     ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-int port[0xfff];
-byte mem[65536 * 16];
+int g_port[0xfff];
+byte g_mem[65536 * 16];
 
 void intr(int intNum, registres &regs) {
 	warning("STUBBED: Call to DOS interrupt #%d", intNum);
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index cff7512..5fd5f23 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -319,24 +319,19 @@ extern byte g_bufcha[391];
 
 extern byte g_lettres[7][24];
 
-extern byte palher[16];
-
-extern uint16 t_mot[maxti + 1];
-extern int tay_tchar;
-extern ind t_rec[maxtd + 1];
-//file<ind> sauv_t;
-//untyped_file fibyte;
-extern byte v_lieu[8][25];
+extern uint16 g_t_mot[maxti + 1];
+extern int g_tay_tchar;
+extern ind g_t_rec[maxtd + 1];
+extern byte g_v_lieu[8][25];
 extern int g_l[108];
-extern int tbi[256];
-extern chariot c1, c2, c3;
-extern float addfix;
-extern t_pcga palsav[91];
-extern Common::Point tabpal[91][17];
-extern t_pcga palcga[91];
-extern pattern tpt[15];
+extern int g_tbi[256];
+extern chariot g_c1, g_c2, g_c3;
+extern float g_addfix;
+extern Common::Point g_tabpal[91][17];
+extern t_pcga g_palcga[91];
+extern pattern g_tpt[15];
 
-extern byte adcfiec[822 * 128];
+extern byte g_adcfiec[822 * 128];
 
 /*---------------------------------------------------------------------------*/
 /*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
@@ -351,8 +346,8 @@ void Val(const Common::String &s, int &V, int Code);
 /*---------------------------------------------------------------------------*/
 // TODO: Replace the following with proper implementations, or refactor out the code using them
 
-extern int port[0xfff];
-extern byte mem[65536 * 16];
+extern int g_port[0xfff];
+extern byte g_mem[65536 * 16];
 
 #define hires {}
 


Commit: db48f9812f333059a4bd38055e6905692d99bc29
    https://github.com/scummvm/scummvm/commit/db48f9812f333059a4bd38055e6905692d99bc29
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:29-07:00

Commit Message:
MORTEVIELLE: Refactor KnowledgeCheck

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 8441315..fcecc9b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -699,7 +699,7 @@ void fctPlace() {
 						Alert::show(alertTxt, 1);
 
 						g_tesok = false;
-						bool enterPassageFl = Ques::show();
+						bool enterPassageFl = KnowledgeCheck::show();
 						hideMouse();
 						hirs();
 						dessine_rouleau();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index a586ccf..42e726e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -285,9 +285,9 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
 /**
  * Questions asked before entering the hidden passage
  */
-bool Ques::show() {
-	const int textIndexArr[11] = {0, 511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
-	const int correctAnswerArr[11] = {0, 4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
+bool KnowledgeCheck::show() {
+	const int textIndexArr[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
+	const int correctAnswerArr[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
 	int optionPosY;
 	int maxLength;
@@ -302,11 +302,10 @@ bool Ques::show() {
 	int correctCount = 0;
 	bool protectionCheck = false;
 
-	do {
+	for (indx = 0; indx < 10; ++indx) {
 		hideMouse();
 		hirs();
 		showMouse();
-		++indx;
 		int dialogHeight;
 		if (g_res == 1)
 			dialogHeight = 29;
@@ -316,7 +315,7 @@ bool Ques::show() {
 		Common::String tmpStr = deline(textIndexArr[indx]);
 		afftex(tmpStr, 20, 15, 100, 2, 0);
 
-		if (indx != 10) {
+		if (indx != 9) {
 			firstOption = textIndexArr[indx] + 1;
 			lastOption = textIndexArr[indx + 1] - 1;
 		} else {
@@ -335,6 +334,7 @@ bool Ques::show() {
 			choiceArray[prevChoice] = tmpStr;
 			optionPosY += 8;
 		}
+
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
 			coor[j]._x1 = 45 * g_res;
 			coor[j]._x2 = (maxLength * 3 + 55) * g_res;
@@ -388,19 +388,19 @@ bool Ques::show() {
 			++correctCount;
 		else {
 			// Skip questions that may give hints on previous wrong answer
-			if (indx == 5)
+			if (indx == 4)
 				++indx;
-
-			if ((indx == 7) || (indx == 8))
-				indx = 10;
-		}
-		if (indx == 10) {
-			warning("Skipping protection check: testprot()");
-			protectionCheck = true;
-			// tesok is set to true in testprot()
-			g_tesok = true;
+			else if ((indx == 6) || (indx == 7))
+				indx = 9;
 		}
-	} while (indx != 10);
+	}
+
+	if (correctCount == 10) {
+		warning("Skipping protection check: testprot()");
+		protectionCheck = true;
+		// tesok is set to true in testprot()
+		g_tesok = true;
+	}
 
 	return (correctCount == 10) && protectionCheck;
 }
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 661c544..c3f33e8 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -44,7 +44,7 @@ public:
 	static int show(const Common::String &s, int n);
 };
 
-class Ques {
+class KnowledgeCheck {
 public:
 	static bool show();
 };


Commit: b781caf0bd06074fb5e5fcc0e4bb4c00a04f263b
    https://github.com/scummvm/scummvm/commit/b781caf0bd06074fb5e5fcc0e4bb4c00a04f263b
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:31-07:00

Commit Message:
MORTEVIELLE: Properly remove protection checks

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index fcecc9b..67c9562 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -698,7 +698,6 @@ void fctPlace() {
 						Common::String alertTxt = deline(582);
 						Alert::show(alertTxt, 1);
 
-						g_tesok = false;
 						bool enterPassageFl = KnowledgeCheck::show();
 						hideMouse();
 						hirs();
@@ -732,7 +731,6 @@ void fctPlace() {
 					} else {
 						aniof(2, 1);
 						g_crep = 166;
-						g_tesok = true;
 					}
 					return;
 				}
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 42e726e..b50c6e9 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -298,11 +298,9 @@ bool KnowledgeCheck::show() {
 	Common::String choiceArray[15];
 
 	int currChoice, prevChoice;
-	int indx = 0;
 	int correctCount = 0;
-	bool protectionCheck = false;
 
-	for (indx = 0; indx < 10; ++indx) {
+	for (int indx = 0; indx < 10; ++indx) {
 		hideMouse();
 		hirs();
 		showMouse();
@@ -358,7 +356,6 @@ bool KnowledgeCheck::show() {
 		warning("Expected answer: %d", correctAnswerArr[indx]);
 		do {
 			g_vm->setMouseClick(false);
-			g_tesok = false;
 			bool flag;
 			moveMouse(flag, key);
 			CHECK_QUIT0;
@@ -395,14 +392,7 @@ bool KnowledgeCheck::show() {
 		}
 	}
 
-	if (correctCount == 10) {
-		warning("Skipping protection check: testprot()");
-		protectionCheck = true;
-		// tesok is set to true in testprot()
-		g_tesok = true;
-	}
-
-	return (correctCount == 10) && protectionCheck;
+	return (correctCount == 10);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 7de738d..3abe06a 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,10 +48,6 @@ void Menu::menut(int no, Common::String name) {
 	byte l = lo(no);
 	Common::String s = name;
 
-	if (!g_tesok)
-		g_vm->quitGame();
-
-
 	while (s.size() < 20)
 		s += ' ';
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ddfa188..d27c135 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -301,10 +301,6 @@ void conv(int x, int &y) {
 }
 
 /* NIVEAU 12 */
-void okpas() {
-	g_tesok = true;
-}
-
 void modobj(int m) {
 	Common::String strp = Common::String(' ');
 
@@ -315,22 +311,6 @@ void modobj(int m) {
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
 }
 
-void modobj2(int m, bool t1, bool t2) {
-	Common::String strp = Common::String(' ');
-
-	if (t1 || t2)
-		okpas();
-	else
-		g_tesok = false;;
-
-	if (m != 500)
-		strp = deline(m - 501 + kInventoryStringIndex);
-
-	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
-	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
-}
-
-
 void repon(int f, int m) {
 	Common::String str_;
 	Common::String str1;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 0351bd0..afb9963 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -58,9 +58,7 @@ extern int hazard(int min, int max);
 extern void calch(int &j, int &h, int &m);
 extern void conv(int x, int &y);
 /* NIVEAU 12 */
-extern void okpas();
 extern void modobj(int m);
-extern void modobj2(int m, bool t1, bool t2);
 extern void repon(int f, int m);
 extern void t5(int cx);
 extern void affper(int per);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 52bb1fe..2347fa0 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -145,7 +145,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	g_currGraphicalDevice = MODE_EGA;
 	g_newGraphicalDevice = g_currGraphicalDevice;
 	g_zuul = false;
-	g_tesok = false;
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 0731418..5ceb0d4 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -83,7 +83,6 @@ void MortevielleEngine::gameLoaded() {
 	test[1] = false;
 	g[0] = '\040';
 	g_col = false;
-	g_tesok = true;
 	test[2] = false;
 	g[7] = g[0];
 	g[2] = 'A';
@@ -136,9 +135,7 @@ void MortevielleEngine::gameLoaded() {
 	tmlieu(g_s._mlieu);
 	modinv();
 	if (g_s._derobj != 0)
-		modobj2(g_s._derobj + 400, test[1], test[2]);
-	else
-		g_tesok = test[1] || test[2];
+		modobj(g_s._derobj + 400);
 	showMouse();
 }
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 7b27e24..98d629a 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -103,7 +103,6 @@ bool g_blo,
         g_syn,
         g_fouil,
         g_zuul,
-        g_tesok,
         g_obpart,
         g_okdes,
         g_arret,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 5fd5f23..f1a332f 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -240,7 +240,6 @@ extern bool g_blo,
         g_syn,
         g_fouil,
         g_zuul,
-        g_tesok,
         g_obpart,
         g_okdes,
         g_anyone,


Commit: 55701268d31b1a641648f0d384e6823f3f5fc40d
    https://github.com/scummvm/scummvm/commit/55701268d31b1a641648f0d384e6823f3f5fc40d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:32-07:00

Commit Message:
MORTEVIELLE: Rename some variables and functions related to 'Search' action

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mor2.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 67c9562..1edf1cd 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -207,7 +207,7 @@ void fctTake() {
 					g_s._ivier = 0;
 				if (g_s._mlieu == 24)
 					g_s._ipuit = 0;
-				mfouen();
+				unsetSearchMenu();
 				g_obpart = false;
 				affrep();
 			} else {
@@ -377,10 +377,10 @@ void fctRead() {
  * @remarks	Originally called 'tslire'
  */
 void fctSelfRead() {
-	if (g_s._derobj == 0)
+	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else
-		st4(g_s._derobj);
+		st4(g_s._selectedObjectId);
 }
 
 /**
@@ -466,8 +466,8 @@ void fctLook() {
  * @remarks	Originally called 'tsregarder'
  */
 void fctSelftLook() {
-	if (g_s._derobj != 0)
-		treg(g_s._derobj);
+	if (g_s._selectedObjectId != 0)
+		treg(g_s._selectedObjectId);
 	else
 		g_crep = 186;
 }
@@ -515,8 +515,8 @@ void fctSearch() {
 				if (g_mchai != 0) {
 					g_cs = 0;
 					g_is = 0;
-					g_fouil = true;
-					mfoudi();
+					g_heroSearching = true;
+					setSearchMenu();
 					tsuiv();
 				} else
 					g_crep = 997;
@@ -570,8 +570,8 @@ void fctSearch() {
  * @remarks	Originally called 'tsfouiller'
  */
 void fctSelfSearch() {
-	if (g_s._derobj != 0)
-		st7(g_s._derobj);
+	if (g_s._selectedObjectId != 0)
+		st7(g_s._selectedObjectId);
 	else
 		g_crep = 186;
 }
@@ -643,7 +643,7 @@ void fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void fctPlace() {
-	if (g_s._derobj == 0) {
+	if (g_s._selectedObjectId == 0) {
 		g_crep = 186;
 		return;
 	}
@@ -666,15 +666,15 @@ void fctPlace() {
 				if (g_s._iboul != 0) {
 					g_crep = 188;
 				} else {
-					g_s._iboul = g_s._derobj;
-					if (g_s._derobj == 141)
+					g_s._iboul = g_s._selectedObjectId;
+					if (g_s._selectedObjectId == 141)
 						aniof(1, 7);
 				}
 			} else if (g_s._ibag != 0) {
 				g_crep = 188;
 			} else {
-				g_s._ibag = g_s._derobj;
-				if (g_s._derobj == 159)
+				g_s._ibag = g_s._selectedObjectId;
+				if (g_s._selectedObjectId == 159)
 					aniof(1, 6);
 			}
 		}
@@ -683,8 +683,8 @@ void fctPlace() {
 			if (g_s._icave != 0) {
 				g_crep = 188;
 			} else {
-				g_s._icave = g_s._derobj;
-				if (g_s._derobj == 151) {
+				g_s._icave = g_s._selectedObjectId;
+				if (g_s._selectedObjectId == 151) {
 					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
@@ -739,7 +739,7 @@ void fctPlace() {
 
 		if (g_caff == 16) {
 			if (g_s._icryp == 0)
-				g_s._icryp = g_s._derobj;
+				g_s._icryp = g_s._selectedObjectId;
 			else
 				g_crep = 188;
 		}
@@ -747,7 +747,7 @@ void fctPlace() {
 		if (g_caff == 17) {
 			if (g_s._ivier != 0) {
 				g_crep = 188;
-			} else if (g_s._derobj == 143) {
+			} else if (g_s._selectedObjectId == 143) {
 				g_s._ivier = 143;
 				aniof(1, 1);
 			} else {
@@ -759,8 +759,8 @@ void fctPlace() {
 		if (g_caff == 24) {
 			if (g_s._ipuit != 0) {
 				g_crep = 188;
-			} else if ((g_s._derobj == 140) || (g_s._derobj == 120)) {
-				g_s._ipuit = g_s._derobj;
+			} else if ((g_s._selectedObjectId == 140) || (g_s._selectedObjectId == 120)) {
+				g_s._ipuit = g_s._selectedObjectId;
 				aniof(1, 1);
 			} else {
 				g_crep = 185;
@@ -836,7 +836,7 @@ void fctSelfHide() {
  * @remarks	Originally called 'tattacher'
  */
 void fctAttach() {
-	if (g_s._derobj == 0)
+	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
 		if (!g_syn)
@@ -847,8 +847,8 @@ void fctAttach() {
 			g_crep = 997;
 			if ((g_num != 0) && (g_s._mlieu == 24)) {
 				g_crep = 999;
-				if ((g_s._derobj == 120) || (g_s._derobj == 140)) {
-					g_s._ipuit = g_s._derobj;
+				if ((g_s._selectedObjectId == 120) || (g_s._selectedObjectId == 140)) {
+					g_s._ipuit = g_s._selectedObjectId;
 					aniof(1, 1);
 				} else
 					g_crep = 185;
@@ -953,7 +953,7 @@ void fctKnock() {
 void fctSelfPut() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_POSE));
-	if (g_s._derobj == 0)
+	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
 		if (g_caff > 99) {
@@ -993,7 +993,7 @@ void fctSelfPut() {
 					if (g_s._iloic != 0)
 						g_crep = 188;
 					else
-						g_s._iloic = g_s._derobj;
+						g_s._iloic = g_s._selectedObjectId;
 				}
 
 				if (g_caff == 13) {
@@ -1001,11 +1001,11 @@ void fctSelfPut() {
 						if (g_s._iboul != 0)
 							g_crep = 188;
 						else
-							g_s._iboul = g_s._derobj;
+							g_s._iboul = g_s._selectedObjectId;
 					} else if (g_s._ibag != 0) {
 						g_crep = 188;
 					} else {
-						g_s._ibag = g_s._derobj;
+						g_s._ibag = g_s._selectedObjectId;
 					}
 				}
 
@@ -1013,7 +1013,7 @@ void fctSelfPut() {
 					if (g_s._icryp != 0)
 						g_crep = 188;
 					else
-						g_s._icryp = g_s._derobj;
+						g_s._icryp = g_s._selectedObjectId;
 				}
 
 				if (g_caff == 24)
@@ -1133,7 +1133,7 @@ void fctEnter() {
 		aldepl();
 	else if (g_ment == 0)
 		g_crep = 997;
-	else if ((g_ment == 9) && (g_s._derobj != 136)) {
+	else if ((g_ment == 9) && (g_s._selectedObjectId != 136)) {
 			g_crep = 189;
 			g_s._teauto[8] = '*';
 	} else {
@@ -1344,7 +1344,7 @@ void fctDiscuss() {
 	Common::String lib[47];
 	bool f;
 
-	finfouil();
+	endSearch();
 	if (g_col)
 		suj = 128;
 	else {
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b50c6e9..d538774 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -311,7 +311,7 @@ bool KnowledgeCheck::show() {
 			dialogHeight = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
 		Common::String tmpStr = deline(textIndexArr[indx]);
-		afftex(tmpStr, 20, 15, 100, 2, 0);
+		displayStr(tmpStr, 20, 15, 100, 2, 0);
 
 		if (indx != 9) {
 			firstOption = textIndexArr[indx] + 1;
@@ -328,7 +328,7 @@ bool KnowledgeCheck::show() {
 			tmpStr = deline(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
-			afftex(tmpStr, 100, optionPosY, 100, 1, 0);
+			displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
 			choiceArray[prevChoice] = tmpStr;
 			optionPosY += 8;
 		}
@@ -366,16 +366,16 @@ bool KnowledgeCheck::show() {
 			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
 					tmpStr = choiceArray[prevChoice] + '$';
-					afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+					displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
 				if (prevChoice != currChoice) {
 					tmpStr = choiceArray[currChoice] + '$';
-					afftex(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
+					displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
 					prevChoice = currChoice;
 				}
 			} else if (prevChoice != 0) {
 				tmpStr = choiceArray[prevChoice] + '$';
-				afftex(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+				displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				prevChoice = 0;
 			}
 		} while (!((prevChoice != 0) && g_vm->getMouseClick()));
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d27c135..2cb44c7 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -140,7 +140,7 @@ void text1(int x, int y, int nb, int m) {
 	Common::String tmpStr = deline(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
-	afftex(tmpStr, x, y, nb, 20, g_color_txt);
+	displayStr(tmpStr, x, y, nb, 20, g_color_txt);
 }
 
 void initouv() {
@@ -325,7 +325,7 @@ void repon(int f, int m) {
 			g_f2_all = false;
 
 		clsf2();
-		afftex(tmpStr, 8, 176, 85, 3, 5);
+		displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
 		if (f == 8)
@@ -354,7 +354,7 @@ void repon(int f, int m) {
 				i = 5;
 
 			tmpStr = deline(m);
-			afftex(tmpStr, 80, 40, 60, 25, i);
+			displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
 				g_s._pourc[6] = '*';
@@ -366,21 +366,21 @@ void repon(int f, int m) {
 			ecrf7();
 			tmpStr = deline(m);
 
-			int xco, dx, caspe;
+			int xSmallStr, xLargeStr, dx;
 			if (g_res == 1) {
-				xco = 252 - tmpStr.size() * 5;
-				caspe = 100;
+				xSmallStr = 252 - tmpStr.size() * 5;
+				xLargeStr = 100;
 				dx = 80;
 			} else {
-				xco = 252 - tmpStr.size() * 3;
-				caspe = 144;
+				xSmallStr = 252 - tmpStr.size() * 3;
+				xLargeStr = 144;
 				dx = 50;
 			}
 
 			if (tmpStr.size() < 40)
-				afftex(tmpStr, xco, 86, dx, 3, 5);
+				displayStr(tmpStr, xSmallStr, 86, dx, 3, 5);
 			else
-				afftex(tmpStr, caspe, 86, dx, 3, 5);
+				displayStr(tmpStr, xLargeStr, 86, dx, 3, 5);
 		}
 	}
 }
@@ -1016,7 +1016,7 @@ void inzon() {
 	copcha();
 
 	g_s._ipre  = false;
-	g_s._derobj = 0;
+	g_s._selectedObjectId = 0;
 	g_s._icave = 0;
 	g_s._iboul = 0;
 	g_s._ibag  = 0;
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 19a9e85..0d6069b 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -274,7 +274,11 @@ void affrep() {
 	g_crep = g_s._mlieu;
 }
 
-void mfouen() {
+/**
+ * Engine function - Switch action menu from "Search" mode back to normal mode
+ * @remarks	Originally called 'mfouen'
+ */
+void unsetSearchMenu() {
 	tmlieu(g_s._mlieu);
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
@@ -290,7 +294,7 @@ void tperd() {
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	mfouen();
+	unsetSearchMenu();
 	if (!g_blo) {
 		int cx;
 		t11(21, cx);
@@ -361,7 +365,7 @@ void cherjer(int ob, bool &d) {
 	for (cx = 1; cx <= 6; ++cx)
 		d = (d || (ord(g_s._sjer[cx]) == ob));
 
-	if (g_s._derobj == ob)
+	if (g_s._selectedObjectId == ob)
 		d = true;
 }
 
@@ -397,7 +401,7 @@ void sparl(float adr, float rep) {
 	repint = abs((int)rep);
 	hideMouse();
 	Common::String tmpStr = deline(repint + kDialogStringIndex);
-	afftex(tmpStr, 230, 4, 65, 24, 5);
+	displayStr(tmpStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
 	key = 0;
@@ -410,15 +414,23 @@ void sparl(float adr, float rep) {
 	showMouse();
 }
 
-void finfouil() {
-	g_fouil = false;
+/**
+ * Engine function - End of Search: reset globals
+ * @remarks	Originally called 'finfouill'
+ */
+void endSearch() {
+	g_heroSearching = false;
 	g_obpart = false;
 	g_cs = 0;
 	g_is = 0;
-	mfouen();
+	unsetSearchMenu();
 }
 
-void mfoudi() {
+/**
+ * Engine function - Switch action menu to "Search" mode
+ * @remarks	Originally called 'mfoudi'
+ */
+void setSearchMenu() {
 	for (int cx = 1; cx <= 7; ++cx) 
 		g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]);
 
@@ -447,7 +459,7 @@ void ajchai() {
 	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
 
 	if (g_tabdon[cy + cx] == 0)
-		g_tabdon[cy + cx] = g_s._derobj;
+		g_tabdon[cy + cx] = g_s._selectedObjectId;
 	else
 		g_crep = 192;
 }
@@ -549,7 +561,7 @@ void quelquun() {
 	if (g_imen)
 		g_vm->_menu.eraseMenu();
 
-	finfouil();
+	endSearch();
 	g_crep = 997;
 L1:
 	if (!g_cache) {
@@ -618,7 +630,7 @@ void tsuiv() {
 			g_s._conf += 2;
 	} else {
 		affrep();
-		finfouil();
+		endSearch();
 		if (cx > 9)
 			g_crep = 131;
 	}
@@ -750,18 +762,18 @@ void treg(int ob) {
 	} else {
 		g_obpart = true;
 		g_crep = g_caff + 400;
-		mfoudi();
+		setSearchMenu();
 	}
 }
 
 void avpoing(int &ob) {
 	g_crep = 999;
-	if (g_s._derobj != 0)
-		ajjer(g_s._derobj);
+	if (g_s._selectedObjectId != 0)
+		ajjer(g_s._selectedObjectId);
 
 	if (g_crep != 139) {
 		modobj(ob + 400);
-		g_s._derobj = ob;
+		g_s._selectedObjectId = ob;
 		ob = 0;
 	}
 }
@@ -786,7 +798,7 @@ void t23coul(int &l) {
 }
 
 void maivid() {
-	g_s._derobj = 0;
+	g_s._selectedObjectId = 0;
 	modobj(500);
 }
 
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
index 64eed71..9107913 100644
--- a/engines/mortevielle/mor2.h
+++ b/engines/mortevielle/mor2.h
@@ -47,7 +47,7 @@ extern void tmlieu(int roomId);
 /* NIVEAU 7 */
 extern void tlu(int af, int ob);
 extern void affrep();
-extern void mfouen();
+extern void unsetSearchMenu();
 /* NIVEAU 6 */
 extern void tperd();
 extern void tsort();
@@ -56,8 +56,8 @@ extern void cherjer(int ob, bool &d);
 extern void st1sama();
 extern void modinv();
 extern void sparl(float adr, float rep);
-extern void finfouil();
-extern void mfoudi();
+extern void endSearch();
+extern void setSearchMenu();
 extern void mennor();
 extern void premtet();
 /* NIVEAU 5 */
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 2347fa0..51f0d95 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -613,14 +613,14 @@ void MortevielleEngine::handleAction() {
 			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
 				g_mnumo = g_msg[4];
 			if (!g_anyone) {
-				if ((g_fouil) || (g_obpart)) {
+				if ((g_heroSearching) || (g_obpart)) {
 					if (y_s < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
 						oo = true;
 						if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
-							finfouil();
+							endSearch();
 							g_caff = g_s._mlieu;
 							g_crep = 998;
 						} else
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 43a0386..02c03b8 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -163,16 +163,18 @@ static int l_motsuiv(int p, const char *ch, int &tab) {
 	return tab * (p - c);
 }
 
-void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
-	bool the_end;
+/**
+ * Engine function - Display Text
+ * @remarks	Originally called 'afftex'
+ */
+void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ) {
 	int tab;
 	Common::String s;
 	int i, j;
 
 	// Safeguard: add $ just in case
-	ch += '$'; 
+	inputStr += '$'; 
 
-	/*    debug('  .. Afftex');*/
 	g_vm->_screenSurface.putxy(x, y);
 	if (g_res == 1)
 		tab = 10;
@@ -184,12 +186,11 @@ void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
 	int yc = y;
 	int xf = x + dx;
 	int yf = y + dy;
-//	int p = 1;
 	int p = 0;
-	the_end = (ch[p] == '$');
+	bool stringParsed = (inputStr[p] == '$');
 	s = "";
-	while (!the_end) {
-		switch (ch[p]) {
+	while (!stringParsed) {
+		switch (inputStr[p]) {
 		case '@':
 			g_vm->_screenSurface.writeg(s, typ);
 			s = "";
@@ -202,15 +203,14 @@ void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
 			s += ' ';
 			xc += tab;
 			++p;
-			if (l_motsuiv(p, ch.c_str(), tab) + xc > xf) {
+			if (l_motsuiv(p, inputStr.c_str(), tab) + xc > xf) {
 				g_vm->_screenSurface.writeg(s, typ);
 				s = "";
 				xc = x;
 				yc += 6;
 				if (yc > yf) {
-					do {
+					while (!keypressed())
 						;
-					} while (!keypressed());
 					i = y;
 					do {
 						j = x;
@@ -227,15 +227,15 @@ void afftex(Common::String ch, int x, int y, int dx, int dy, int typ) {
 			}
 			break;
 		case '$':
-			the_end = true;
+			stringParsed = true;
 			g_vm->_screenSurface.writeg(s, typ);
 			break;
 		default:
-			s += ch[p];
+			s += inputStr[p];
 			++p;
 			xc += tab;
 			break;
-		}     /* case */
+		}
 	}
 }
 
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index d2e5f6b..55e0ec5 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -33,7 +33,7 @@
 namespace Mortevielle {
 
 extern Common::String deline(int num);
-extern void afftex(Common::String ch, int x, int y, int dx, int dy, int typ);
+extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 5ceb0d4..85a5f14 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -70,7 +70,6 @@ void changeGraphicalDevice(int newDevice) {
  */
 void MortevielleEngine::gameLoaded() {
 	int k;
-	bool test[3];
 	char g[8];
 
 	hideMouse();
@@ -79,11 +78,8 @@ void MortevielleEngine::gameLoaded() {
 	_loseGame = true;
 	g_anyone = false;
 	g_okdes = true;
-	test[0] = false;
-	test[1] = false;
 	g[0] = '\040';
 	g_col = false;
-	test[2] = false;
 	g[7] = g[0];
 	g[2] = 'A';
 	g_cache = false;
@@ -103,7 +99,7 @@ void MortevielleEngine::gameLoaded() {
 	k = 0;
 	g_ment = 0;
 	g_syn = true;
-	g_fouil = true;
+	g_heroSearching = true;
 	g_mchai = 0;
 	g_inei = 0;
 	initouv();
@@ -113,18 +109,12 @@ void MortevielleEngine::gameLoaded() {
 	g_dobj = 0;
 	affrep();
 	g_hintPctMessage = deline(580);
-	while ((test[k] == false) && (k < 2)) {
-		++k;
 
-		// Original read in the boot sector here of each drive and did some calculations -
-		// presumably for copy protection. This has been replaced with hardcoded success
-		test[k] = true;
+	g_okdes = false;
+	_endGame = true;
+	_loseGame = false;
+	g_heroSearching = false;
 
-		g_okdes = false;
-		_endGame = true;
-		_loseGame = false;
-		g_fouil = false;
-	}
 	person();
 	tinke();
 	drawClock();
@@ -134,8 +124,8 @@ void MortevielleEngine::gameLoaded() {
 	_endGame = false;
 	tmlieu(g_s._mlieu);
 	modinv();
-	if (g_s._derobj != 0)
-		modobj(g_s._derobj + 400);
+	if (g_s._selectedObjectId != 0)
+		modobj(g_s._selectedObjectId + 400);
 	showMouse();
 }
 
@@ -240,7 +230,7 @@ void tsitu() {
 	        ((h > 0) && (h < 6) && (g_s._mlieu != 0)))
 		++g_s._conf;
 	if (((g_s._mlieu < 16) || (g_s._mlieu > 19)) && (g_s._mlieu != 23)
-	        && (g_s._mlieu != 0) && (g_s._derobj != 152) && (!g_vm->_loseGame)) {
+	        && (g_s._mlieu != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
 		if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
 			g_crep = 1501;
 			tperd();
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index cbff7b7..53a147c 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -59,7 +59,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(g_s1._icave);
 	sz.syncAsSint16LE(g_s1._ivier);
 	sz.syncAsSint16LE(g_s1._ipuit);
-	sz.syncAsSint16LE(g_s1._derobj);
+	sz.syncAsSint16LE(g_s1._selectedObjectId);
 	sz.syncAsSint16LE(g_s1._iloic);
 	sz.syncAsSint16LE(g_s1._icryp);
 	sz.syncAsByte(g_s1._ipre);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 98d629a..e668a6d 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -101,7 +101,7 @@ bool g_blo,
         g_iesc,
         g_col,
         g_syn,
-        g_fouil,
+        g_heroSearching,
         g_zuul,
         g_obpart,
         g_okdes,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index f1a332f..a9652ce 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -158,7 +158,7 @@ struct sav_chaine {
 	byte _teauto[43];
 	byte _sjer[31];
 	int _mlieu, _iboul, _ibag, _icave, _ivier, _ipuit;
-	int _derobj, _iloic, _icryp;
+	int _selectedObjectId, _iloic, _icryp;
 	bool _ipre;
 	byte _heure;
 };
@@ -238,7 +238,7 @@ extern bool g_blo,
         g_iesc,
         g_col,
         g_syn,
-        g_fouil,
+        g_heroSearching,
         g_zuul,
         g_obpart,
         g_okdes,


Commit: 8c808d206810c34639a851dfd6c8b76ff53602e0
    https://github.com/scummvm/scummvm/commit/8c808d206810c34639a851dfd6c8b76ff53602e0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:34-07:00

Commit Message:
MORTEVIELLE: Replaced mort.dat with latest generated dat file

Changed paths:
    dists/engine-data/mort.dat



diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index b2caafe..2f31c0a 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: 6146e5d74524134960425d9b051a9af59b8a2352
    https://github.com/scummvm/scummvm/commit/6146e5d74524134960425d9b051a9af59b8a2352
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:35-07:00

Commit Message:
MORTEVIELLE: Start using place names (as enums) instead of magic values

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1edf1cd..1520ede 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -50,12 +50,12 @@ void fctMove() {
 	int cx;
 
 	if ((g_s._mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		g_s._mlieu = 15;
+		g_s._mlieu = LANDING;
 		g_caff = g_s._mlieu;
 		afdes(0);
 		repon(2, g_s._mlieu);
 	}
-	if ((g_s._mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s._mlieu == LANDING) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
@@ -67,10 +67,10 @@ void fctMove() {
 		if (g_num == 0)
 			return;
 		if (g_num == 1) {
-			g_s._mlieu = 0;
+			g_s._mlieu = OWN_ROOM;
 			tmlieu(0);
 		} else if (g_num == 7) {
-			g_s._mlieu = 13;
+			g_s._mlieu = ATTIC;
 			tmlieu(13);
 		} else if (g_num != 6)
 			g_s._mlieu = 26;
@@ -90,7 +90,7 @@ void fctMove() {
 		++cx;
 	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
 
-	if (g_s._mlieu == 19) {
+	if (g_s._mlieu == MOUNTAIN) {
 		if (cx == 1)
 			t1deva();
 		if (cx == 2)
@@ -106,43 +106,43 @@ void fctMove() {
 		goto L2;
 	}
 
-	if ((g_s._mlieu == 11) && (cx == 1))
+	if ((g_s._mlieu == BUREAU) && (cx == 1))
 		cx = 6;
 
-	if (g_s._mlieu == 12) {
+	if (g_s._mlieu == KITCHEN) {
 		if (cx == 2)
 			cx = 6;
 		if (cx == 5)
 			cx = 16;
 	}
 
-	if ((g_s._mlieu == 14) && (cx == 3))
+	if ((g_s._mlieu == CELLAR) && (cx == 3))
 		cx = 6;
-	if (((g_s._mlieu == 15) || (g_s._mlieu == 26)) && (cx == 4))
+	if (((g_s._mlieu == LANDING) || (g_s._mlieu == 26)) && (cx == 4))
 		cx = 6;
-	if ((g_s._mlieu > 19) && (g_s._mlieu != 26))
+	if ((g_s._mlieu > MOUNTAIN) && (g_s._mlieu != 26))
 		cx += 10;
-	if ((g_s._mlieu == 20) && (cx == 13))
+	if ((g_s._mlieu == CHAPEL) && (cx == 13))
 		cx = 16;
-	if (g_s._mlieu == 21) {
+	if (g_s._mlieu == MANOR_FRONT) {
 		if (cx == 12)
 			cx = 16;
 		else if (cx > 13)
 			cx = 15;
 	}
-	if ((g_s._mlieu == 22) && (cx > 14))
+	if ((g_s._mlieu == MANOR_BACK) && (cx > 14))
 		cx = 15;
-	if ((g_s._mlieu == 24) && (cx != 17))
+	if ((g_s._mlieu == WELL) && (cx != 17))
 		if (cx > 13)
 			cx = 15;
 	if (cx == 1)
-		g_s._mlieu = 11;
+		g_s._mlieu = BUREAU;
 	else if (cx == 2)
-		g_s._mlieu = 12;
+		g_s._mlieu = KITCHEN;
 	else if (cx == 3)
-		g_s._mlieu = 14;
+		g_s._mlieu = CELLAR;
 	else if (cx == 4)
-		g_s._mlieu = 15;
+		g_s._mlieu = LANDING;
 	else if (cx == 5)
 		cx = 12;
 	if (cx == 6)
@@ -152,9 +152,9 @@ void fctMove() {
 	else if (cx == 12)
 		t1deva();
 	else if (cx == 13)
-		g_s._mlieu = 20;
+		g_s._mlieu = CHAPEL;
 	else if (cx == 14)
-		g_s._mlieu = 24;
+		g_s._mlieu = WELL;
 	else if (cx == 15)
 		t1neig();
 	else if (cx == 16)
@@ -191,21 +191,21 @@ void fctTake() {
 			if (g_ipers > 0)
 				g_s._conf += 3;
 			if (g_obpart) {
-				if (g_s._mlieu == 2)
+				if (g_s._mlieu == PURPLE_ROOM)
 					g_s._iloic = 0;
-				if (g_s._mlieu == 13) {
+				if (g_s._mlieu == ATTIC) {
 					if (g_s._iboul == g_caff)
 						g_s._iboul = 0;
 					if (g_s._ibag == g_caff)
 						g_s._ibag = 0;
 				}
-				if (g_s._mlieu == 14)
+				if (g_s._mlieu == CELLAR)
 					g_s._icave = 0;
-				if (g_s._mlieu == 16)
+				if (g_s._mlieu == CRYPT)
 					g_s._icryp = 0;
-				if (g_s._mlieu == 17)
+				if (g_s._mlieu == SECRET_PASSAGE)
 					g_s._ivier = 0;
-				if (g_s._mlieu == 24)
+				if (g_s._mlieu == WELL)
 					g_s._ipuit = 0;
 				unsetSearchMenu();
 				g_obpart = false;
@@ -235,39 +235,39 @@ void fctTake() {
 		}
 	}
 	tcoord(5);
-	if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == 16))) {
+	if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == CRYPT))) {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
 				g_s._conf += 3;
 			g_crep = 997;
-			if ((g_s._mlieu == 2) && (g_s._iloic != 0))
+			if ((g_s._mlieu == PURPLE_ROOM) && (g_s._iloic != 0))
 				avpoing(g_s._iloic);
-			if ((g_s._mlieu == 13) && (g_num == 1) && (g_s._iboul != 0)) {
+			if ((g_s._mlieu == ATTIC) && (g_num == 1) && (g_s._iboul != 0)) {
 				avpoing(g_s._iboul);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 7);
 			}
-			if ((g_s._mlieu == 13) && (g_num == 2) && (g_s._ibag != 0)) {
+			if ((g_s._mlieu == ATTIC) && (g_num == 2) && (g_s._ibag != 0)) {
 				avpoing(g_s._ibag);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 6);
 			}
-			if ((g_s._mlieu == 14) && (g_s._icave != 0)) {
+			if ((g_s._mlieu == CELLAR) && (g_s._icave != 0)) {
 				avpoing(g_s._icave);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 2);
 			}
-			if ((g_s._mlieu == 16) && (g_s._icryp != 0))
+			if ((g_s._mlieu == CRYPT) && (g_s._icryp != 0))
 				avpoing(g_s._icryp);
-			if ((g_s._mlieu == 17) && (g_s._ivier != 0)) {
+			if ((g_s._mlieu == SECRET_PASSAGE) && (g_s._ivier != 0)) {
 				avpoing(g_s._ivier);
 				if ((g_crep != 997) && (g_crep != 139)) {
 					g_crep = 182;
 					aniof(2, 1);
 				}
 			}
-			if ((g_s._mlieu == 24) && (g_s._ipuit != 0)) {
+			if ((g_s._mlieu == WELL) && (g_s._ipuit != 0)) {
 				avpoing(g_s._ipuit);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 1);
@@ -276,13 +276,13 @@ void fctTake() {
 				g_crep = 999;
 		}
 	} else {
-		if ( ((g_s._mlieu == 0)  && (g_num == 3)) || ((g_s._mlieu == 1)  && (g_num == 4))
-		  || ((g_s._mlieu == 2)  && (g_num == 1)) || ((g_s._mlieu == 4)  && (g_num == 3))
-		  || ((g_s._mlieu == 5)  && (g_num == 6)) || ((g_s._mlieu == 6)  && (g_num == 2))
-		  || ((g_s._mlieu == 7)  && (g_num == 6)) || ((g_s._mlieu == 8)  && (g_num == 4))
-		  || ((g_s._mlieu == 9)  && (g_num == 4)) || ((g_s._mlieu == 10) && (g_num > 2))
-		  || ((g_s._mlieu == 11) && (g_num == 7)) || ((g_s._mlieu == 12) && (g_num == 6))
-		  || ((g_s._mlieu == 13) && (g_num > 4))  || ((g_s._mlieu > 13)  && (g_s._mlieu != 23)) )
+		if ( ((g_s._mlieu == OWN_ROOM)  && (g_num == 3)) || ((g_s._mlieu == GREEN_ROOM)  && (g_num == 4))
+		  || ((g_s._mlieu == PURPLE_ROOM)  && (g_num == 1)) || ((g_s._mlieu == DARKBLUE_ROOM)  && (g_num == 3))
+		  || ((g_s._mlieu == BLUE_ROOM)  && (g_num == 6)) || ((g_s._mlieu == RED_ROOM)  && (g_num == 2))
+		  || ((g_s._mlieu == BATHROOM)  && (g_num == 6)) || ((g_s._mlieu == GREEN_ROOM2)  && (g_num == 4))
+		  || ((g_s._mlieu == 9)  && (g_num == 4)) || ((g_s._mlieu == DINING_ROOM) && (g_num > 2))
+		  || ((g_s._mlieu == BUREAU) && (g_num == 7)) || ((g_s._mlieu == KITCHEN) && (g_num == 6))
+		  || ((g_s._mlieu == ATTIC) && (g_num > 4))  || ((g_s._mlieu > ATTIC)  && (g_s._mlieu != 23)) )
 		  g_crep = 997;
 		else if (g_s._mlieu == 23) {
 			g_crep = 1504;
@@ -336,7 +336,7 @@ void fctLift() {
 			if (g_ipers > 0)
 				++g_s._conf;
 			g_crep = 997;
-			if ((g_s._mlieu == 2) && (g_s._iloic != 0))
+			if ((g_s._mlieu == PURPLE_ROOM) && (g_s._iloic != 0))
 				treg(g_s._iloic);
 		}
 		return;
@@ -344,9 +344,9 @@ void fctLift() {
 	if (g_ipers > 0)
 		++g_s._conf;
 	cx = g_s._mlieu;
-	if (g_s._mlieu == 16)
+	if (g_s._mlieu == CRYPT)
 		cx = 14;
-	else if (g_s._mlieu == 19)
+	else if (g_s._mlieu == MOUNTAIN)
 		cx = 15;
 	g_crep = g_tabdon[asoul + (cx << 3) + (g_num - 1)];
 	if (g_crep == 255)
@@ -404,7 +404,7 @@ void fctLook() {
 		tcoord(8);
 		g_crep = 131;
 		if (g_num != 0) {
-			if (g_s._mlieu == 13) {
+			if (g_s._mlieu == ATTIC) {
 				if (g_num == 1) {
 					g_crep = 164;
 					if (g_s._ibag != 0)
@@ -417,17 +417,17 @@ void fctLook() {
 						treg(g_s._ibag);
 				}
 			}
-			if (g_s._mlieu == 14) {
+			if (g_s._mlieu == CELLAR) {
 				g_crep = 164;
 				if (g_s._icave != 0)
 					treg(g_s._icave);
 			}
-			if (g_s._mlieu == 17) {
+			if (g_s._mlieu == SECRET_PASSAGE) {
 				g_crep = 174;
 				if (g_s._ivier != 0)
 					treg(g_s._ivier);
 			}
-			if (g_s._mlieu == 24) {
+			if (g_s._mlieu == WELL) {
 				g_crep = 131;
 				if (g_s._ipuit != 0)
 					treg(g_s._ipuit);
@@ -436,28 +436,28 @@ void fctLook() {
 		return;
 	}
 	cx = g_s._mlieu;
-	if (g_s._mlieu == 20)
+	if (g_s._mlieu == CHAPEL)
 		cx = 17;
-	if ((g_s._mlieu > 21) && (g_s._mlieu < 25))
+	if ((g_s._mlieu > MANOR_FRONT) && (g_s._mlieu < DOOR))
 		cx -= 4;
 	if (g_s._mlieu == 26)
 		cx = 21;
 	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
-	if ((g_s._mlieu == 13) && (g_num == 8))
+	if ((g_s._mlieu == ATTIC) && (g_num == 8))
 		g_crep = 126;
-	if (g_s._mlieu == 19)
+	if (g_s._mlieu == MOUNTAIN)
 		g_crep = 103;
 	if (g_crep == 255)
 		g_crep = 131;
-	if ((g_s._mlieu == 1) && (g_num == 1))
+	if ((g_s._mlieu == GREEN_ROOM) && (g_num == 1))
 		treg(144);
-	if ((g_s._mlieu == 5) && (g_num == 3))
+	if ((g_s._mlieu == BLUE_ROOM) && (g_num == 3))
 		treg(147);
-	if ((g_s._mlieu == 8) && (g_num == 3))
+	if ((g_s._mlieu == GREEN_ROOM2) && (g_num == 3))
 		treg(149);
 	if ((g_s._mlieu == 9) && (g_num == 2))
 		treg(30);
-	if ((g_s._mlieu == 10) && (g_num == 3))
+	if ((g_s._mlieu == DINING_ROOM) && (g_num == 3))
 		treg(31);
 }
 
@@ -527,13 +527,13 @@ void fctSearch() {
 			if (g_num != 0) {
 				if (g_ipers > 0)
 					g_s._conf += 3;
-				if ((g_s._mlieu != 24) && (g_s._mlieu != 17) && (g_s._mlieu != 13)) {
-					if (g_s._mlieu == 2) {
+				if ((g_s._mlieu != WELL) && (g_s._mlieu != SECRET_PASSAGE) && (g_s._mlieu != ATTIC)) {
+					if (g_s._mlieu == PURPLE_ROOM) {
 						g_crep = 123;
 						if (g_s._iloic != 0)
 							treg(g_s._iloic);
 					}
-					if (g_s._mlieu == 16) {
+					if (g_s._mlieu == CRYPT) {
 						g_crep = 123;
 						if (g_s._icryp != 0)
 							treg(g_s._icryp);
@@ -545,22 +545,22 @@ void fctSearch() {
 		if (g_ipers > 0)
 			g_s._conf += 3;
 		g_crep = 997;
-		if (g_s._mlieu < 14)
+		if (g_s._mlieu < CELLAR)
 			g_crep = r[g_s._mlieu];
 
-		if ((g_s._mlieu == 3) && (g_num == 2))
+		if ((g_s._mlieu == TOILETS) && (g_num == 2))
 			g_crep = 162;
 
-		if (g_s._mlieu == 12) {
+		if (g_s._mlieu == KITCHEN) {
 			if ((g_num == 3) || (g_num == 4))
 				g_crep = 162;
 			else if (g_num == 5)
 				g_crep = 159;
 		}
 
-		if (g_s._mlieu == 19)
+		if (g_s._mlieu == MOUNTAIN)
 			g_crep = 104;
-		else if (g_s._mlieu == 16)
+		else if (g_s._mlieu == CRYPT)
 			g_crep = 155;
 	}
 }
@@ -612,15 +612,15 @@ void fctOpen() {
 			++cx;
 		} while (!((cx > 6) || (ord(g_touv[cx]) == 0) || (ord(g_touv[cx]) == g_num)));
 		if (ord(g_touv[cx]) != g_num) {
-			if (!( ((g_num == 3) && ((g_s._mlieu == 0) || (g_s._mlieu == 9) || (g_s._mlieu == 5) || (g_s._mlieu == 7)))
-			    || ((g_num == 4) && ((g_s._mlieu == 1) || (g_s._mlieu == 2) || (g_s._mlieu == 6)))
-				|| ((g_s._mlieu == 4) && (g_num == 5))
-				|| ((g_num == 6) && ((g_s._mlieu == 7) || (g_s._mlieu == 10) || (g_s._mlieu == 8) || (g_s._mlieu == 13)))
-				|| ((g_s._mlieu == 8) && (g_num == 2))
-				|| ((g_s._mlieu == 12) && (g_num == 7))) ) {
-				if ( ((g_s._mlieu > 10) && (g_s._mlieu < 14))
-				  || ((g_s._mlieu > 6) && (g_s._mlieu < 10))
-				  || (g_s._mlieu == 0) || (g_s._mlieu == 2) || (g_s._mlieu == 5)) {
+			if (!( ((g_num == 3) && ((g_s._mlieu == OWN_ROOM) || (g_s._mlieu == 9) || (g_s._mlieu == BLUE_ROOM) || (g_s._mlieu == BATHROOM)))
+			    || ((g_num == 4) && ((g_s._mlieu == GREEN_ROOM) || (g_s._mlieu == PURPLE_ROOM) || (g_s._mlieu == RED_ROOM)))
+				|| ((g_s._mlieu == DARKBLUE_ROOM) && (g_num == 5))
+				|| ((g_num == 6) && ((g_s._mlieu == BATHROOM) || (g_s._mlieu == DINING_ROOM) || (g_s._mlieu == GREEN_ROOM2) || (g_s._mlieu == ATTIC)))
+				|| ((g_s._mlieu == GREEN_ROOM2) && (g_num == 2))
+				|| ((g_s._mlieu == KITCHEN) && (g_num == 7))) ) {
+				if ( ((g_s._mlieu > DINING_ROOM) && (g_s._mlieu < CELLAR))
+				  || ((g_s._mlieu > RED_ROOM) && (g_s._mlieu < DINING_ROOM))
+				  || (g_s._mlieu == OWN_ROOM) || (g_s._mlieu == PURPLE_ROOM) || (g_s._mlieu == BLUE_ROOM)) {
 					if (hazard(1, 4) == 3)
 						parole(7, 9, 1);
 				}
@@ -628,7 +628,7 @@ void fctOpen() {
 				aniof(1, g_num);
 			}
 			cx = g_s._mlieu;
-			if (g_s._mlieu == 16)
+			if (g_s._mlieu == CRYPT)
 				cx = 14;
 			g_crep = g_tabdon[aouvr + (cx * 7) + g_num - 1];
 			if (g_crep == 254)
@@ -714,7 +714,7 @@ void fctPlace() {
 
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
-							g_s._mlieu = 17;
+							g_s._mlieu = SECRET_PASSAGE;
 							tmlieu(17);
 						} else {
 							tmlieu(g_s._mlieu);
@@ -789,7 +789,7 @@ void fctTurn() {
 	tcoord(9);
 	if (g_num != 0) {
 		g_crep = 997;
-		if ((g_s._mlieu == 13) && (g_s._ibag == 159) && (g_s._iboul == 141)) {
+		if ((g_s._mlieu == ATTIC) && (g_s._ibag == 159) && (g_s._iboul == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -798,13 +798,13 @@ void fctTurn() {
 			else
 				g_crep = 168;
 		}
-		if ((g_s._mlieu == 17) && (g_s._ivier == 143)) {
+		if ((g_s._mlieu == SECRET_PASSAGE) && (g_s._ivier == 143)) {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
-				g_s._mlieu = 16;
+				g_s._mlieu = CRYPT;
 				affrep();
 			} else
 				g_crep = 176;
@@ -845,7 +845,7 @@ void fctAttach() {
 		if (!(g_anyone) && !(g_iesc)) {
 			tcoord(8);
 			g_crep = 997;
-			if ((g_num != 0) && (g_s._mlieu == 24)) {
+			if ((g_num != 0) && (g_s._mlieu == WELL)) {
 				g_crep = 999;
 				if ((g_s._selectedObjectId == 120) || (g_s._selectedObjectId == 140)) {
 					g_s._ipuit = g_s._selectedObjectId;
@@ -903,18 +903,20 @@ void fctClose() {
  * @remarks	Originally called 'tfrapper'
  */
 void fctKnock() {
+	warning("Knock - mlieu %d", g_s._mlieu);
+
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
-	if (g_s._mlieu == 15) {
+	if (g_s._mlieu == LANDING) {
 		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
-	if (g_s._mlieu < 25) {
+	if (g_s._mlieu < DOOR) {
 		tfleche();
 		if (!(g_anyone) && !(g_iesc)) {
-			if ((g_s._mlieu < 19) && (g_s._mlieu != 15))
+			if ((g_s._mlieu < MOUNTAIN) && (g_s._mlieu != LANDING))
 				g_crep = 133;
 			else
 				g_crep = 997;
@@ -1083,11 +1085,11 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
+	if ((g_s._mlieu > LANDING) && (g_s._mlieu < 26)) {
 		g_crep = 148;
 	} else {
 		tsort();
-		g_s._mlieu = 10;
+		g_s._mlieu = DINING_ROOM;
 		g_caff = 10;
 		debloc(g_s._mlieu);
 		tmlieu(g_s._mlieu);
@@ -1124,12 +1126,10 @@ void fctEat() {
  * @remarks	Originally called 'tentrer'
  */
 void fctEnter() {
-//	int x;
-
-	if ((g_s._mlieu == 21) || (g_s._mlieu == 22)) {
+	if ((g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK)) {
 		t1sama();
 		tmlieu(g_s._mlieu);
-	} else if (g_s._mlieu == 15)
+	} else if (g_s._mlieu == LANDING)
 		aldepl();
 	else if (g_ment == 0)
 		g_crep = 997;
@@ -1150,7 +1150,7 @@ void fctEnter() {
 				
 				tip(z, g_x);
 				++g_s._conf;
-				g_s._mlieu = 15;
+				g_s._mlieu = LANDING;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
 				g_syn = true;
@@ -1187,13 +1187,13 @@ void fctEnter() {
 void fctSleep() {
 	int z, j, h, m;
 
-	if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) {
+	if ((g_s._mlieu > LANDING) && (g_s._mlieu < 26)) {
 		g_crep = 148;
 		return;
 	}
-	if (g_s._mlieu != 0) {
+	if (g_s._mlieu != OWN_ROOM) {
 		tsort();
-		g_s._mlieu = 0;
+		g_s._mlieu = OWN_ROOM;
 		affrep();
 		afdes(0);
 		debloc(g_s._mlieu);
@@ -1254,22 +1254,22 @@ void fctForce() {
 void fctLeave() {
 	tsort();
 	g_crep = 0;
-	if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22) || (g_s._mlieu == 24))
+	if ((g_s._mlieu == MOUNTAIN) || (g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK) || (g_s._mlieu == WELL))
 		g_crep = 997;
 	else {
 		int lx = 0;
 
-		if ((g_s._mlieu < 16) || (g_s._mlieu == 26))
+		if ((g_s._mlieu < CRYPT) || (g_s._mlieu == 26))
 			lx = 10;
-		if ((g_s._mlieu == 10) || (g_s._mlieu == 20))
+		if ((g_s._mlieu == DINING_ROOM) || (g_s._mlieu == CHAPEL))
 			lx = 21;
-		if ((g_s._mlieu < 10) || (g_s._mlieu == 13))
+		if ((g_s._mlieu < DINING_ROOM) || (g_s._mlieu == ATTIC))
 			lx = 15;
-		if (g_s._mlieu == 16) {
+		if (g_s._mlieu == CRYPT) {
 			lx = 17;
 			g_crep = 176;
 		}
-		if (g_s._mlieu == 17)
+		if (g_s._mlieu == SECRET_PASSAGE)
 			t23coul(lx);
 		if (g_s._mlieu == 23)
 			lx = 24;
@@ -1301,9 +1301,9 @@ void fctWait() {
 			t11(g_s._mlieu, quel);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
-			if ((g_s._mlieu == 13) || (g_s._mlieu == 14))
+			if ((g_s._mlieu == ATTIC) || (g_s._mlieu == CELLAR))
 				cavegre();
-			if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
+			if ((g_s._mlieu > OWN_ROOM) && (g_s._mlieu < DINING_ROOM))
 				g_anyone = true;
 			g_mpers = g_ipers;
 			if (!g_anyone)
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 2cb44c7..b951a81 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1025,7 +1025,7 @@ void inzon() {
 	g_s._iloic = 136;
 	g_s._icryp = 141;
 	g_s._conf  = hazard(4, 10);
-	g_s._mlieu = 21;
+	g_s._mlieu = MANOR_FRONT;
 
 	for (int cx = 2; cx <= 6; ++cx)
 		g_s._sjer[cx] = chr(0);
@@ -1320,7 +1320,7 @@ void musique(int so) {
 		++g_prebru;
 	} else {
 		bool i = false;
-		if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22)) {
+		if ((g_s._mlieu == MOUNTAIN) || (g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK)) {
 			int haz = hazard(1, 3);
 			if (haz == 2) {
 				haz = hazard(2, 4);
@@ -1328,7 +1328,7 @@ void musique(int so) {
 				i = true;
 			}
 		}
-		if (g_s._mlieu == 20) {
+		if (g_s._mlieu == CHAPEL) {
 			int haz = hazard(1, 2);
 			if (haz == 1) {
 				parole(8, 1, 1);
@@ -1336,7 +1336,7 @@ void musique(int so) {
 			}
 		}
 
-		if (g_s._mlieu == 24) {
+		if (g_s._mlieu == WELL) {
 			int haz = hazard(1, 2);
 			if (haz == 2) {
 				parole(12, 1, 1);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 0d6069b..70cfc88 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -157,7 +157,7 @@ void tinke() {
 				g_mpers = g_ipers;
 
 			if ((g_mpers == 0) && (g_ipers > 0)) {
-				if ((g_s._mlieu == 13) || (g_s._mlieu == 14)) {
+				if ((g_s._mlieu == ATTIC) || (g_s._mlieu == CELLAR)) {
 					cavegre();
 				} else if (g_ipers == 10) {
 					g_ipers = 0;
@@ -186,7 +186,7 @@ void tinke() {
 		nouvp(g_li, cx);
 		g_brt = false;
 		g_hdb = 0;
-		if ((g_s._mlieu > 0) && (g_s._mlieu < 10))
+		if ((g_s._mlieu > OWN_ROOM) && (g_s._mlieu < DINING_ROOM))
 			g_anyone = true;
 	}
 }
@@ -370,7 +370,7 @@ void cherjer(int ob, bool &d) {
 }
 
 void st1sama() {
-	g_s._mlieu = 10;
+	g_s._mlieu = DINING_ROOM;
 	affrep();
 }
 
@@ -505,7 +505,7 @@ void t1sama() {    //Entering manor
 		dessine_rouleau();
 		drawClock();
 		showMouse();
-		g_s._mlieu = 0;
+		g_s._mlieu = OWN_ROOM;
 		affrep();
 		t5(10);
 		if (!g_blo)
@@ -519,7 +519,7 @@ void t1sama() {    //Entering manor
 }
 
 void t1vier() {
-	g_s._mlieu = 17;
+	g_s._mlieu = SECRET_PASSAGE;
 	affrep();
 }
 
@@ -530,19 +530,19 @@ void t1neig() {
 		tperd();
 	} else {
 		g_okdes = true;
-		g_s._mlieu = 19;
+		g_s._mlieu = MOUNTAIN;
 		affrep();
 	}
 }
 
 void t1deva() {
 	g_inei = 0;
-	g_s._mlieu = 21;
+	g_s._mlieu = MANOR_FRONT;
 	affrep();
 }
 
 void t1derr() {
-	g_s._mlieu = 22;
+	g_s._mlieu = MANOR_BACK;
 	affrep();
 }
 
@@ -781,7 +781,7 @@ void avpoing(int &ob) {
 void rechai(int &ch) {
 	int cx = g_s._mlieu;
 
-	if (g_s._mlieu == 16)
+	if (g_s._mlieu == CRYPT)
 		cx = 14;
 	ch = g_tabdon[achai + (cx * 7) + g_num - 1];
 }
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 85a5f14..8479538 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -229,7 +229,7 @@ void tsitu() {
 	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._mlieu != 10)) ||
 	        ((h > 0) && (h < 6) && (g_s._mlieu != 0)))
 		++g_s._conf;
-	if (((g_s._mlieu < 16) || (g_s._mlieu > 19)) && (g_s._mlieu != 23)
+	if (((g_s._mlieu < CRYPT) || (g_s._mlieu > MOUNTAIN)) && (g_s._mlieu != 23)
 	        && (g_s._mlieu != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
 		if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
 			g_crep = 1501;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 6e9a66c..096a076 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -249,7 +249,7 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_s._mlieu == 15)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_s._mlieu == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
 		else if (!g_blo)
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a9652ce..a1b22d4 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -33,15 +33,6 @@
 
 namespace Mortevielle {
 
-/*         Constantes, Types et Variables pour le
-
-              M A N O I R   DE   M O R T E V I E L L E
-
-                                                    ( version Nov 1988
-                                                             +
-                                                  musique & paroles Oct 88 )
-                                                                             */
-
 /*---------------------------------------------------------------------------*/
 /*-------------------           MEMORY  MAP          ------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -152,6 +143,23 @@ extern const byte g_rang[16];
 /*--------------------------------   TYPES   --------------------------------*/
 /*---------------------------------------------------------------------------*/
 
+/*
+9   "A glance at the forbidden$",
+18  "It's already open$",
+23  "Strange horoscope$",
+26  "A photograph$",
+27  "The coat of arms$",
+*/
+
+enum places {
+	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,     DARKBLUE_ROOM = 4,
+	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8, 
+	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,      CELLAR = 14, 
+	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17,                  MOUNTAIN = 19, 
+	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,                      WELL = 24,
+	DOOR = 25
+};
+
 struct sav_chaine {
 	int _conf;
 	byte _pourc[11];


Commit: 69f762182da7581a746518cb8f10e9157a5fc799
    https://github.com/scummvm/scummvm/commit/69f762182da7581a746518cb8f10e9157a5fc799
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:37-07:00

Commit Message:
MORTEVIELLE: rename variables and functions related to random number generation

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1520ede..b988f44 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -621,7 +621,7 @@ void fctOpen() {
 				if ( ((g_s._mlieu > DINING_ROOM) && (g_s._mlieu < CELLAR))
 				  || ((g_s._mlieu > RED_ROOM) && (g_s._mlieu < DINING_ROOM))
 				  || (g_s._mlieu == OWN_ROOM) || (g_s._mlieu == PURPLE_ROOM) || (g_s._mlieu == BLUE_ROOM)) {
-					if (hazard(1, 4) == 3)
+					if (getRandomNumber(1, 4) == 3)
 						parole(7, 9, 1);
 				}
 				g_touv[cx] = chr(g_num);
@@ -926,14 +926,14 @@ void fctKnock() {
 	}
 
 	if (g_s._mlieu == 26) {
-		int haz = (hazard(0, 8)) - 4;
-		parole(11, haz, 1);
+		int rand = (getRandomNumber(0, 8)) - 4;
+		parole(11, rand, 1);
 		int p;
-		ecfren(p, haz, g_s._conf, g_ment);
+		ecfren(p, rand, g_s._conf, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
-				if (haz > p)
+				if (rand > p)
 					g_crep = 190;
 				else {
 					becfren(l);
@@ -1052,24 +1052,24 @@ void fctListen() {
 	else {
 		if (g_ipers != 0)
 			++g_s._conf;
-		int p, haz;
-		ecfren(p, haz, g_s._conf, g_ment);
+		int p, rand;
+		ecfren(p, rand, g_s._conf, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
-				if (haz > p)
+				if (rand > p)
 					g_crep = 101;
 				else {
 					becfren(l);
 					int j, h, m;
 					calch(j, h, m);
-					haz = hazard(1, 100);
+					rand = getRandomNumber(1, 100);
 					if ((h >= 0) && (h < 8)) {
-						if (haz > 30)
+						if (rand > 30)
 							g_crep = 101;
 						else
 							g_crep = 178;
-					} else if (haz > 70)
+					} else if (rand > 70)
 						g_crep = 101;
 					else
 						g_crep = 178;
@@ -1144,7 +1144,7 @@ void fctEnter() {
 			if ((g_ment == 3) || (g_ment == 7))
 				g_crep = 179;
 			else {
-				g_x = (hazard(0, 10)) - 5;
+				g_x = (getRandomNumber(0, 10)) - 5;
 				parole(7, g_x, 1);
 				aniof(1, 1);
 				
@@ -1165,7 +1165,7 @@ void fctEnter() {
 				g_ment = 0;
 			}
 		} else {
-			g_x = (hazard(0, 10)) - 5;
+			g_x = (getRandomNumber(0, 10)) - 5;
 			parole(7, g_x, 1);
 			aniof(1, 1);
 			
@@ -1339,7 +1339,7 @@ void fctSound() {
  */
 void fctDiscuss() {
 	bool te[47];
-	int cy, cx, max, haz, suj, co, lig, icm, i, choi, x, y, c;
+	int cy, cx, max, suj, co, lig, icm, i, choi, x, y, c;
 	char tou;
 	Common::String lib[47];
 	bool f;
@@ -1470,8 +1470,7 @@ void fctDiscuss() {
 					max = 8;
 				else
 					max = 4;
-				haz = hazard(1, max);
-				if (haz == 2)
+				if (getRandomNumber(1, max) == 2)
 					suj = 129;
 				else {
 					suj = 138;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index b951a81..52b71c7 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -274,10 +274,6 @@ void paint_rect(int x, int y, int dx, int dy) {
 	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
-int hazard(int min, int max) {
-	return get_random_number(min, max);
-}
-
 void calch(int &j, int &h, int &m) {
 	int nh = readclock();
 	int th = g_jh + ((nh - g_mh) / g_t);
@@ -469,17 +465,17 @@ void choix(int min, int max, int &per) {
 	bool i;
 	int cz;
 
-	int haz = hazard(min, max);
-	if (haz > 4) {
-		haz = 8 - haz;
+	int rand = getRandomNumber(min, max);
+	if (rand > 4) {
+		rand = 8 - rand;
 		i = true;
 	} else
 		i = false;
 
 	int cx = 0;
 	per = 0;
-	while (cx < haz) {
-		int cy = hazard(1, 8);
+	while (cx < rand) {
+		int cy = getRandomNumber(1, 8);
 		conv(cy, cz);
 		if ((per & cz) != cz) {
 			++cx;
@@ -592,9 +588,12 @@ void person() {
 	g_ipers = 0;
 }
 
-void chlm(int &per) {
-	per = hazard(1, 2);
-	if (per == 2)  per = 128;
+int chlm() {
+	int retval = getRandomNumber(1, 2);
+	if (retval == 2)
+		retval = 128;
+	
+	return retval;
 }
 
 /**
@@ -750,7 +749,7 @@ void cpl20(int &p, int &h) {
 void quelq1(int l) {
 	int per;
 
-	per = hazard(1, 2);
+	per = getRandomNumber(1, 2);
 	if (l == 1) {
 		if (per == 1)
 			g_bh1 = true;
@@ -791,7 +790,7 @@ void quelq6(int l) {
 
 void quelq10(int h, int &per) {
 	if ((h >= 0) && (h < 8))
-		chlm(per);
+		per = chlm();
 	else {
 		int min = 0, max = 0;
 		if ((h > 7) && (h < 10)) {
@@ -814,7 +813,7 @@ void quelq10(int h, int &per) {
 
 void quelq11(int h, int &per) {
 	if ((h >= 0) && (h < 8))
-		chlm(per);
+		per = chlm();
 	else {
 		int min = 0, max = 0;
 		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
@@ -833,7 +832,7 @@ void quelq11(int h, int &per) {
 }
 
 void quelq12(int &per) {
-	chlm(per);
+	per = chlm();
 	affper(per);
 }
 
@@ -844,7 +843,7 @@ void quelq15(int &per) {
 	per = 0;
 
 	do {
-		cx = hazard(1, 8);
+		cx = getRandomNumber(1, 8);
 		test = (((cx == 1) && (g_bh2 || g_bh9)) ||
 		        ((cx == 2) && g_bh8) ||
 		        ((cx == 3) && g_bh4) ||
@@ -861,7 +860,7 @@ void quelq15(int &per) {
 
 void quelq20(int h, int &per) {
 	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
-		chlm(per);
+		per = chlm();
 	else {
 		int min = 0, max = 0;
 		if ((h > 9) && (h < 12)) {
@@ -887,8 +886,7 @@ void frap() {
 	if ((h >= 0) && (h < 8))
 		g_crep = 190;
 	else {
-		int haz = hazard(1, 100);
-		if (haz > 70)
+		if (getRandomNumber(1, 100) > 70)
 			g_crep = 190;
 		else
 			g_crep = 147;
@@ -944,11 +942,11 @@ void tip(int ip, int &cx) {
 }
 
 
-void ecfren(int &p, int &haz, int cf, int l) {
+void ecfren(int &p, int &rand, int cf, int l) {
 	if (l == 0)
 		person();
 	p = -500;
-	haz = 0;
+	rand = 0;
 	if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
 		cpl1(p);
 	if ((l == 2) && (!g_bh2) && (!g_bh9))
@@ -965,20 +963,20 @@ void ecfren(int &p, int &haz, int cf, int l) {
 		p = -400;
 	if (p != -500) {
 		p = p + cf;
-		haz = hazard(1, 100);
+		rand = getRandomNumber(1, 100);
 	}
 }
 
 void becfren(int l) {
 	if ((l == 1) || (l == 4)) {
-		int haz = hazard(1, 2);
+		int rand = getRandomNumber(1, 2);
 		if (l == 1) {
-			if (haz == 1)
+			if (rand == 1)
 				g_bh1 = true;
 			else
 				g_bf1 = true;
 		} else { // l == 4
-			if (haz == 1)
+			if (rand == 1)
 				g_bh4 = true;
 			else
 				g_bf4 = true;
@@ -1007,9 +1005,9 @@ void init_nbrepm() {
 		g_nbrepm[idx] = ipm[idx];
 }
 
-void phaz(int &haz, int &p, int cf) {
+void phaz(int &rand, int &p, int cf) {
 	p += cf;
-	haz = hazard(1, 100);
+	rand = getRandomNumber(1, 100);
 }
 
 void inzon() {
@@ -1024,7 +1022,7 @@ void inzon() {
 	g_s._ivier = 0;
 	g_s._iloic = 136;
 	g_s._icryp = 141;
-	g_s._conf  = hazard(4, 10);
+	g_s._conf  = getRandomNumber(4, 10);
 	g_s._mlieu = MANOR_FRONT;
 
 	for (int cx = 2; cx <= 6; ++cx)
@@ -1067,11 +1065,11 @@ void dprog() {
 
 void pl1(int cf) {
 	if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
-		int p, haz;
+		int p, rand;
 		cpl1(p);
-		phaz(haz, p, cf);
+		phaz(rand, p, cf);
 
-		if (haz > p)
+		if (rand > p)
 			person();
 		else
 			quelq1(g_li);
@@ -1080,11 +1078,11 @@ void pl1(int cf) {
 
 void pl2(int cf) {
 	if (!g_bh2) {
-		int p, haz;
+		int p, rand;
 		cpl2(p);
-		phaz(haz, p, cf);
+		phaz(rand, p, cf);
 
-		if (haz > p)
+		if (rand > p)
 			person();
 		else
 			quelq2();
@@ -1093,11 +1091,11 @@ void pl2(int cf) {
 
 void pl5(int cf) {
 	if (!g_bh5) {
-		int p, haz;
+		int p, rand;
 		cpl5(p);
-		phaz(haz, p, cf);
+		phaz(rand, p, cf);
 
-		if (haz > p)
+		if (rand > p)
 			person();
 		else
 			quelq5();
@@ -1106,11 +1104,11 @@ void pl5(int cf) {
 
 void pl6(int cf) {
 	if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
-		int p, haz;
+		int p, rand;
 		cpl6(p);
-		phaz(haz, p, cf);
+		phaz(rand, p, cf);
 
-		if (haz > p)
+		if (rand > p)
 			person();
 		else
 			quelq6(g_li);
@@ -1120,10 +1118,10 @@ void pl6(int cf) {
 void pl9(int cf) {
 	if (!g_bh9) {
 		cf = -10;
-		int p, haz;
-		phaz(haz, p, cf);
+		int p, rand;
+		phaz(rand, p, cf);
 
-		if (haz > p)
+		if (rand > p)
 			person();
 		else
 			quelq2();
@@ -1131,79 +1129,79 @@ void pl9(int cf) {
 }
 
 void pl10(int cf) {
-	int p, h, haz;
+	int p, h, rand;
 	cpl10(p, h);
-	phaz(haz, p, cf);
+	phaz(rand, p, cf);
 
-	if (haz > p)
+	if (rand > p)
 		person();
 	else
 		quelq10(h, p);
 }
 
 void pl11(int cf) {
-	int p, h, haz;
+	int p, h, rand;
 
 	cpl11(p, h);
-	phaz(haz, p, cf);
-	if (haz > p)
+	phaz(rand, p, cf);
+	if (rand > p)
 		person();
 	else
 		quelq11(h, p);
 }
 
 void pl12(int cf) {
-	int p, haz;
+	int p, rand;
 
 	cpl12(p);
-	phaz(haz, p, cf);
-	if (haz > p)
+	phaz(rand, p, cf);
+	if (rand > p)
 		person();
 	else
 		quelq12(p);
 }
 
 void pl13(int cf) {
-	int p, haz;
+	int p, rand;
 
 	cpl13(p);
-	phaz(haz, p, cf);
-	if (haz > p)
+	phaz(rand, p, cf);
+	if (rand > p)
 		person();
 	else
 		quelq12(p);
 }
 
 void pl15(int cf) {
-	int p, haz;
+	int p, rand;
 
 	cpl15(p);
-	phaz(haz, p, cf);
-	if (haz > p)
+	phaz(rand, p, cf);
+	if (rand > p)
 		person();
 	else
 		quelq15(p);
 }
 
 void pl20(int cf) {
-	int p, h, haz;
+	int p, h, rand;
 
 	cpl20(p, h);
-	phaz(haz, p, cf);
-	if (haz > p)
+	phaz(rand, p, cf);
+	if (rand > p)
 		person();
 	else
 		quelq20(h, p);
 }
 
 void t11(int l11, int &a) {
-	int p, haz;
+	int p, rand;
 
-	ecfren(p, haz, g_s._conf, l11);
+	ecfren(p, rand, g_s._conf, l11);
 	g_li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
-			if (haz > p) {
+			if (rand > p) {
 				person();
 				a = 0;
 			} else {
@@ -1232,8 +1230,8 @@ void t11(int l11, int &a) {
 			if (l11 == 20)
 				cpl20(p, h);
 			p += g_s._conf;
-			haz = hazard(1, 100);
-			if (haz > p) {
+			rand = getRandomNumber(1, 100);
+			if (rand > p) {
 				person();
 				a = 0;
 			} else {
@@ -1260,8 +1258,8 @@ void cavegre() {
 	clsf3();
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
-	int haz = (hazard(0, 4)) - 2;
-	parole(2, haz, 1);
+	int rand = (getRandomNumber(0, 4)) - 2;
+	parole(2, rand, 1);
 
 	// The original was doing here a useless loop.
 	// It has been removed
@@ -1321,24 +1319,20 @@ void musique(int so) {
 	} else {
 		bool i = false;
 		if ((g_s._mlieu == MOUNTAIN) || (g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK)) {
-			int haz = hazard(1, 3);
-			if (haz == 2) {
-				haz = hazard(2, 4);
-				parole(9, haz, 1);
+			if (getRandomNumber(1, 3) == 2) {
+				parole(9, getRandomNumber(2, 4), 1);
 				i = true;
 			}
 		}
 		if (g_s._mlieu == CHAPEL) {
-			int haz = hazard(1, 2);
-			if (haz == 1) {
+			if (getRandomNumber(1, 2) == 1) {
 				parole(8, 1, 1);
 				i = true;
 			}
 		}
 
 		if (g_s._mlieu == WELL) {
-			int haz = hazard(1, 2);
-			if (haz == 2) {
+			if (getRandomNumber(1, 2) == 2) {
 				parole(12, 1, 1);
 				i = true;
 			}
@@ -1348,10 +1342,8 @@ void musique(int so) {
 			parole(13, 1, 1);
 			i = true;
 		}
-		if (! i) {
-			int haz = hazard(1, 17);
-			parole(haz, 1, 2);
-		}
+		if (!i)
+			parole(getRandomNumber(1, 17), 1, 2);
 	}
 }
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index afb9963..f649195 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -54,7 +54,6 @@ extern void ecrf7();
 extern void clsf10();
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
-extern int hazard(int min, int max);
 extern void calch(int &j, int &h, int &m);
 extern void conv(int x, int &y);
 /* NIVEAU 12 */
@@ -69,7 +68,7 @@ extern void cpl3(int &p);
 extern void cpl5(int &p);
 extern void cpl6(int &p);
 extern void person();
-extern void chlm(int &per);
+extern int chlm();
 extern void drawClock();
 /*************
  * NIVEAU 11 *
@@ -93,11 +92,11 @@ extern void quelq20(int h, int &per);
 extern void frap();
 extern void nouvp(int l, int &p);
 extern void tip(int ip, int &cx);
-extern void ecfren(int &p, int &haz, int cf, int l);
+extern void ecfren(int &p, int &rand, int cf, int l);
 extern void becfren(int l);
 /* NIVEAU 10 */
 extern void init_nbrepm();
-extern void phaz(int &haz, int &p, int cf);
+extern void phaz(int &rand, int &p, int cf);
 extern void inzon();
 extern void dprog();
 extern void pl1(int cf);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 70cfc88..05002a3 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -164,13 +164,12 @@ void tinke() {
 					if (!g_brt) {
 						g_brt = true;
 						g_hdb = readclock();
-						int haz = hazard(1, 5);
-						if (haz < 5) {
+						if (getRandomNumber(1, 5) < 5) {
 							clsf3();
 							ecrf2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
-							haz = (hazard(0, 4)) - 2;
-							parole(1, haz, 1);
+							int rand = (getRandomNumber(0, 4)) - 2;
+							parole(1, rand, 1);
 							clsf3();
 						}
 					}
@@ -590,15 +589,14 @@ L1:
 		g_syn = true;
 		g_col = true;
 	} else {
-		int haz = hazard(1, 3);
-		if (haz == 2) {
+		if (getRandomNumber(1, 3) == 2) {
 			g_cache = false;
 			g_crep = 137;
 			goto L1;
 		} else {
 			repon(2, 136);
-			haz = (hazard(0, 4)) - 2;
-			parole(3, haz, 1);
+			int rand = (getRandomNumber(0, 4)) - 2;
+			parole(3, rand, 1);
 			clsf2();
 			person();
 			debloc(21);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index e668a6d..9218cad 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -238,9 +238,10 @@ void intr(int intNum, registres &regs) {
 }
 
 /**
- * Get a random number between two values
+ * Engine function - Get a random number between two values
+ * @remarks	Originally called 'get_random_number' and 'hazard'
  */
-int get_random_number(int minval, int maxval) {
+int getRandomNumber(int minval, int maxval) {
 	return g_vm->_randomSource.getRandomNumber(maxval - minval) + minval;
 }
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a1b22d4..dd65f39 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -364,7 +364,7 @@ extern char get_ch();
 
 extern void palette(int v1);
 extern void intr(int intNum, registres &regs);
-extern int get_random_number(int minval, int maxval);
+extern int getRandomNumber(int minval, int maxval);
 
 // (* external 'c:\mc\charecr.com'; *)
 extern void s_char(int Gd, int y, int dy);


Commit: 802d87998eced49ade7c03d7f458cd30dbf13c23
    https://github.com/scummvm/scummvm/commit/802d87998eced49ade7c03d7f458cd30dbf13c23
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:39-07:00

Commit Message:
MORTEVIELLE: rename several globals

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b988f44..6b9388a 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,13 +49,13 @@ namespace Mortevielle {
 void fctMove() {
 	int cx;
 
-	if ((g_s._mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		g_s._mlieu = LANDING;
-		g_caff = g_s._mlieu;
+	if ((g_s._currPlace == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+		g_s._currPlace = LANDING;
+		g_caff = g_s._currPlace;
 		afdes(0);
-		repon(2, g_s._mlieu);
+		repon(2, g_s._currPlace);
 	}
-	if ((g_s._mlieu == LANDING) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s._currPlace == LANDING) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
@@ -67,13 +67,13 @@ void fctMove() {
 		if (g_num == 0)
 			return;
 		if (g_num == 1) {
-			g_s._mlieu = OWN_ROOM;
+			g_s._currPlace = OWN_ROOM;
 			tmlieu(0);
 		} else if (g_num == 7) {
-			g_s._mlieu = ATTIC;
+			g_s._currPlace = ATTIC;
 			tmlieu(13);
 		} else if (g_num != 6)
-			g_s._mlieu = 26;
+			g_s._currPlace = 26;
 		if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
 		if (g_num > 7)
@@ -90,7 +90,7 @@ void fctMove() {
 		++cx;
 	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
 
-	if (g_s._mlieu == MOUNTAIN) {
+	if (g_s._currPlace == MOUNTAIN) {
 		if (cx == 1)
 			t1deva();
 		if (cx == 2)
@@ -98,7 +98,7 @@ void fctMove() {
 		goto L2;
 	}
 
-	if (g_s._mlieu == 23) {
+	if (g_s._currPlace == 23) {
 		if (cx == 1)
 			t1deau();
 		if (cx == 2)
@@ -106,43 +106,43 @@ void fctMove() {
 		goto L2;
 	}
 
-	if ((g_s._mlieu == BUREAU) && (cx == 1))
+	if ((g_s._currPlace == BUREAU) && (cx == 1))
 		cx = 6;
 
-	if (g_s._mlieu == KITCHEN) {
+	if (g_s._currPlace == KITCHEN) {
 		if (cx == 2)
 			cx = 6;
 		if (cx == 5)
 			cx = 16;
 	}
 
-	if ((g_s._mlieu == CELLAR) && (cx == 3))
+	if ((g_s._currPlace == CELLAR) && (cx == 3))
 		cx = 6;
-	if (((g_s._mlieu == LANDING) || (g_s._mlieu == 26)) && (cx == 4))
+	if (((g_s._currPlace == LANDING) || (g_s._currPlace == 26)) && (cx == 4))
 		cx = 6;
-	if ((g_s._mlieu > MOUNTAIN) && (g_s._mlieu != 26))
+	if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != 26))
 		cx += 10;
-	if ((g_s._mlieu == CHAPEL) && (cx == 13))
+	if ((g_s._currPlace == CHAPEL) && (cx == 13))
 		cx = 16;
-	if (g_s._mlieu == MANOR_FRONT) {
+	if (g_s._currPlace == MANOR_FRONT) {
 		if (cx == 12)
 			cx = 16;
 		else if (cx > 13)
 			cx = 15;
 	}
-	if ((g_s._mlieu == MANOR_BACK) && (cx > 14))
+	if ((g_s._currPlace == MANOR_BACK) && (cx > 14))
 		cx = 15;
-	if ((g_s._mlieu == WELL) && (cx != 17))
+	if ((g_s._currPlace == WELL) && (cx != 17))
 		if (cx > 13)
 			cx = 15;
 	if (cx == 1)
-		g_s._mlieu = BUREAU;
+		g_s._currPlace = BUREAU;
 	else if (cx == 2)
-		g_s._mlieu = KITCHEN;
+		g_s._currPlace = KITCHEN;
 	else if (cx == 3)
-		g_s._mlieu = CELLAR;
+		g_s._currPlace = CELLAR;
 	else if (cx == 4)
-		g_s._mlieu = LANDING;
+		g_s._currPlace = LANDING;
 	else if (cx == 5)
 		cx = 12;
 	if (cx == 6)
@@ -152,31 +152,31 @@ void fctMove() {
 	else if (cx == 12)
 		t1deva();
 	else if (cx == 13)
-		g_s._mlieu = CHAPEL;
+		g_s._currPlace = CHAPEL;
 	else if (cx == 14)
-		g_s._mlieu = WELL;
+		g_s._currPlace = WELL;
 	else if (cx == 15)
 		t1neig();
 	else if (cx == 16)
 		t1derr();
 	else if (cx == 17) {
-		if ((g_s._ipuit != 120) && (g_s._ipuit != 140))
+		if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140))
 			g_crep = 997;
-		else if (g_s._ipuit == 120)
+		else if (g_s._wellObjectId == 120)
 			g_crep = 181;
 		else if (g_s._conf > 80) {
 			g_crep = 1505;
 			tperd();
 		} else {
-			g_s._mlieu = 23;
+			g_s._currPlace = 23;
 			affrep();
 		}
 	}
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
-	debloc(g_s._mlieu);
+	debloc(g_s._currPlace);
 L2:
-	tmlieu(g_s._mlieu);
+	tmlieu(g_s._currPlace);
 }
 
 /**
@@ -191,22 +191,22 @@ void fctTake() {
 			if (g_ipers > 0)
 				g_s._conf += 3;
 			if (g_obpart) {
-				if (g_s._mlieu == PURPLE_ROOM)
-					g_s._iloic = 0;
-				if (g_s._mlieu == ATTIC) {
-					if (g_s._iboul == g_caff)
-						g_s._iboul = 0;
-					if (g_s._ibag == g_caff)
-						g_s._ibag = 0;
+				if (g_s._currPlace == PURPLE_ROOM)
+					g_s._purpleRoomObjectId = 0;
+				if (g_s._currPlace == ATTIC) {
+					if (g_s._atticBallHoleObjectId == g_caff)
+						g_s._atticBallHoleObjectId = 0;
+					if (g_s._atticRodHoleObjectId == g_caff)
+						g_s._atticRodHoleObjectId = 0;
 				}
-				if (g_s._mlieu == CELLAR)
-					g_s._icave = 0;
-				if (g_s._mlieu == CRYPT)
-					g_s._icryp = 0;
-				if (g_s._mlieu == SECRET_PASSAGE)
-					g_s._ivier = 0;
-				if (g_s._mlieu == WELL)
-					g_s._ipuit = 0;
+				if (g_s._currPlace == CELLAR)
+					g_s._cellarObjectId = 0;
+				if (g_s._currPlace == CRYPT)
+					g_s._cryptObjectId = 0;
+				if (g_s._currPlace == SECRET_PASSAGE)
+					g_s._secretPassageObjectId = 0;
+				if (g_s._currPlace == WELL)
+					g_s._wellObjectId = 0;
 				unsetSearchMenu();
 				g_obpart = false;
 				affrep();
@@ -235,40 +235,41 @@ void fctTake() {
 		}
 	}
 	tcoord(5);
-	if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == CRYPT))) {
+	if ((g_num == 0) || ((g_num == 1) && (g_s._currPlace == CRYPT))) {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
 				g_s._conf += 3;
 			g_crep = 997;
-			if ((g_s._mlieu == PURPLE_ROOM) && (g_s._iloic != 0))
-				avpoing(g_s._iloic);
-			if ((g_s._mlieu == ATTIC) && (g_num == 1) && (g_s._iboul != 0)) {
-				avpoing(g_s._iboul);
+			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
+				avpoing(g_s._purpleRoomObjectId);
+			if ((g_s._currPlace == ATTIC) && (g_num == 1) && (g_s._atticBallHoleObjectId != 0)) {
+				avpoing(g_s._atticBallHoleObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 7);
 			}
-			if ((g_s._mlieu == ATTIC) && (g_num == 2) && (g_s._ibag != 0)) {
-				avpoing(g_s._ibag);
+			if ((g_s._currPlace == ATTIC) && (g_num == 2) && (g_s._atticRodHoleObjectId != 0)) {
+				avpoing(g_s._atticRodHoleObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 6);
 			}
-			if ((g_s._mlieu == CELLAR) && (g_s._icave != 0)) {
-				avpoing(g_s._icave);
+			if ((g_s._currPlace == CELLAR) && (g_s._cellarObjectId != 0)) {
+				avpoing(g_s._cellarObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 2);
 			}
-			if ((g_s._mlieu == CRYPT) && (g_s._icryp != 0))
-				avpoing(g_s._icryp);
-			if ((g_s._mlieu == SECRET_PASSAGE) && (g_s._ivier != 0)) {
-				avpoing(g_s._ivier);
+			if ((g_s._currPlace == CRYPT) && (g_s._cryptObjectId != 0))
+				avpoing(g_s._cryptObjectId);
+
+			if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId != 0)) {
+				avpoing(g_s._secretPassageObjectId);
 				if ((g_crep != 997) && (g_crep != 139)) {
 					g_crep = 182;
 					aniof(2, 1);
 				}
 			}
-			if ((g_s._mlieu == WELL) && (g_s._ipuit != 0)) {
-				avpoing(g_s._ipuit);
+			if ((g_s._currPlace == WELL) && (g_s._wellObjectId != 0)) {
+				avpoing(g_s._wellObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 1);
 			}
@@ -276,15 +277,15 @@ void fctTake() {
 				g_crep = 999;
 		}
 	} else {
-		if ( ((g_s._mlieu == OWN_ROOM)  && (g_num == 3)) || ((g_s._mlieu == GREEN_ROOM)  && (g_num == 4))
-		  || ((g_s._mlieu == PURPLE_ROOM)  && (g_num == 1)) || ((g_s._mlieu == DARKBLUE_ROOM)  && (g_num == 3))
-		  || ((g_s._mlieu == BLUE_ROOM)  && (g_num == 6)) || ((g_s._mlieu == RED_ROOM)  && (g_num == 2))
-		  || ((g_s._mlieu == BATHROOM)  && (g_num == 6)) || ((g_s._mlieu == GREEN_ROOM2)  && (g_num == 4))
-		  || ((g_s._mlieu == 9)  && (g_num == 4)) || ((g_s._mlieu == DINING_ROOM) && (g_num > 2))
-		  || ((g_s._mlieu == BUREAU) && (g_num == 7)) || ((g_s._mlieu == KITCHEN) && (g_num == 6))
-		  || ((g_s._mlieu == ATTIC) && (g_num > 4))  || ((g_s._mlieu > ATTIC)  && (g_s._mlieu != 23)) )
+		if ( ((g_s._currPlace == OWN_ROOM)  && (g_num == 3)) || ((g_s._currPlace == GREEN_ROOM)  && (g_num == 4))
+		  || ((g_s._currPlace == PURPLE_ROOM)  && (g_num == 1)) || ((g_s._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
+		  || ((g_s._currPlace == BLUE_ROOM)  && (g_num == 6)) || ((g_s._currPlace == RED_ROOM)  && (g_num == 2))
+		  || ((g_s._currPlace == BATHROOM)  && (g_num == 6)) || ((g_s._currPlace == GREEN_ROOM2)  && (g_num == 4))
+		  || ((g_s._currPlace == 9)  && (g_num == 4)) || ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
+		  || ((g_s._currPlace == BUREAU) && (g_num == 7)) || ((g_s._currPlace == KITCHEN) && (g_num == 6))
+		  || ((g_s._currPlace == ATTIC) && (g_num > 4))  || ((g_s._currPlace > ATTIC)  && (g_s._currPlace != 23)) )
 		  g_crep = 997;
-		else if (g_s._mlieu == 23) {
+		else if (g_s._currPlace == 23) {
 			g_crep = 1504;
 			tperd();
 		} else
@@ -322,7 +323,7 @@ void fctInventoryTake() {
  * @remarks	Originally called 'tsoulever'
  */
 void fctLift() {
-	int cx;
+//	int cx;
 
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
@@ -336,19 +337,19 @@ void fctLift() {
 			if (g_ipers > 0)
 				++g_s._conf;
 			g_crep = 997;
-			if ((g_s._mlieu == PURPLE_ROOM) && (g_s._iloic != 0))
-				treg(g_s._iloic);
+			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
+				treg(g_s._purpleRoomObjectId);
 		}
 		return;
 	}
 	if (g_ipers > 0)
 		++g_s._conf;
-	cx = g_s._mlieu;
-	if (g_s._mlieu == CRYPT)
-		cx = 14;
-	else if (g_s._mlieu == MOUNTAIN)
-		cx = 15;
-	g_crep = g_tabdon[asoul + (cx << 3) + (g_num - 1)];
+	int tmpPlace = g_s._currPlace;
+	if (g_s._currPlace == CRYPT)
+		tmpPlace = 14;
+	else if (g_s._currPlace == MOUNTAIN)
+		tmpPlace = 15;
+	g_crep = g_tabdon[asoul + (tmpPlace << 3) + (g_num - 1)];
 	if (g_crep == 255)
 		g_crep = 997;
 }
@@ -404,60 +405,60 @@ void fctLook() {
 		tcoord(8);
 		g_crep = 131;
 		if (g_num != 0) {
-			if (g_s._mlieu == ATTIC) {
+			if (g_s._currPlace == ATTIC) {
 				if (g_num == 1) {
 					g_crep = 164;
-					if (g_s._ibag != 0)
-						treg(g_s._ibag);
-					else if (g_s._iboul != 0)
-						treg(g_s._iboul);
+					if (g_s._atticRodHoleObjectId != 0)
+						treg(g_s._atticRodHoleObjectId);
+					else if (g_s._atticBallHoleObjectId != 0)
+						treg(g_s._atticBallHoleObjectId);
 				} else {
 					g_crep = 193;
-					if (g_s._ibag != 0)
-						treg(g_s._ibag);
+					if (g_s._atticRodHoleObjectId != 0)
+						treg(g_s._atticRodHoleObjectId);
 				}
 			}
-			if (g_s._mlieu == CELLAR) {
+			if (g_s._currPlace == CELLAR) {
 				g_crep = 164;
-				if (g_s._icave != 0)
-					treg(g_s._icave);
+				if (g_s._cellarObjectId != 0)
+					treg(g_s._cellarObjectId);
 			}
-			if (g_s._mlieu == SECRET_PASSAGE) {
+			if (g_s._currPlace == SECRET_PASSAGE) {
 				g_crep = 174;
-				if (g_s._ivier != 0)
-					treg(g_s._ivier);
+				if (g_s._secretPassageObjectId != 0)
+					treg(g_s._secretPassageObjectId);
 			}
-			if (g_s._mlieu == WELL) {
+			if (g_s._currPlace == WELL) {
 				g_crep = 131;
-				if (g_s._ipuit != 0)
-					treg(g_s._ipuit);
+				if (g_s._wellObjectId != 0)
+					treg(g_s._wellObjectId);
 			}
 		}
 		return;
 	}
-	cx = g_s._mlieu;
-	if (g_s._mlieu == CHAPEL)
+	cx = g_s._currPlace;
+	if (g_s._currPlace == CHAPEL)
 		cx = 17;
-	if ((g_s._mlieu > MANOR_FRONT) && (g_s._mlieu < DOOR))
+	if ((g_s._currPlace > MANOR_FRONT) && (g_s._currPlace < DOOR))
 		cx -= 4;
-	if (g_s._mlieu == 26)
+	if (g_s._currPlace == 26)
 		cx = 21;
 	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
-	if ((g_s._mlieu == ATTIC) && (g_num == 8))
+	if ((g_s._currPlace == ATTIC) && (g_num == 8))
 		g_crep = 126;
-	if (g_s._mlieu == MOUNTAIN)
+	if (g_s._currPlace == MOUNTAIN)
 		g_crep = 103;
 	if (g_crep == 255)
 		g_crep = 131;
-	if ((g_s._mlieu == GREEN_ROOM) && (g_num == 1))
+	if ((g_s._currPlace == GREEN_ROOM) && (g_num == 1))
 		treg(144);
-	if ((g_s._mlieu == BLUE_ROOM) && (g_num == 3))
+	if ((g_s._currPlace == BLUE_ROOM) && (g_num == 3))
 		treg(147);
-	if ((g_s._mlieu == GREEN_ROOM2) && (g_num == 3))
+	if ((g_s._currPlace == GREEN_ROOM2) && (g_num == 3))
 		treg(149);
-	if ((g_s._mlieu == 9) && (g_num == 2))
+	if ((g_s._currPlace == 9) && (g_num == 2))
 		treg(30);
-	if ((g_s._mlieu == DINING_ROOM) && (g_num == 3))
+	if ((g_s._currPlace == DINING_ROOM) && (g_num == 3))
 		treg(31);
 }
 
@@ -491,7 +492,7 @@ void fctSearch() {
 	if (g_anyone || g_iesc)
 		return;
 
-	if (g_s._mlieu == 23) {
+	if (g_s._currPlace == 23) {
 		g_crep = 1504;
 		tperd();
 		return;
@@ -527,16 +528,16 @@ void fctSearch() {
 			if (g_num != 0) {
 				if (g_ipers > 0)
 					g_s._conf += 3;
-				if ((g_s._mlieu != WELL) && (g_s._mlieu != SECRET_PASSAGE) && (g_s._mlieu != ATTIC)) {
-					if (g_s._mlieu == PURPLE_ROOM) {
+				if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
+					if (g_s._currPlace == PURPLE_ROOM) {
 						g_crep = 123;
-						if (g_s._iloic != 0)
-							treg(g_s._iloic);
+						if (g_s._purpleRoomObjectId != 0)
+							treg(g_s._purpleRoomObjectId);
 					}
-					if (g_s._mlieu == CRYPT) {
+					if (g_s._currPlace == CRYPT) {
 						g_crep = 123;
-						if (g_s._icryp != 0)
-							treg(g_s._icryp);
+						if (g_s._cryptObjectId != 0)
+							treg(g_s._cryptObjectId);
 					}
 				}
 			}
@@ -545,22 +546,22 @@ void fctSearch() {
 		if (g_ipers > 0)
 			g_s._conf += 3;
 		g_crep = 997;
-		if (g_s._mlieu < CELLAR)
-			g_crep = r[g_s._mlieu];
+		if (g_s._currPlace < CELLAR)
+			g_crep = r[g_s._currPlace];
 
-		if ((g_s._mlieu == TOILETS) && (g_num == 2))
+		if ((g_s._currPlace == TOILETS) && (g_num == 2))
 			g_crep = 162;
 
-		if (g_s._mlieu == KITCHEN) {
+		if (g_s._currPlace == KITCHEN) {
 			if ((g_num == 3) || (g_num == 4))
 				g_crep = 162;
 			else if (g_num == 5)
 				g_crep = 159;
 		}
 
-		if (g_s._mlieu == MOUNTAIN)
+		if (g_s._currPlace == MOUNTAIN)
 			g_crep = 104;
-		else if (g_s._mlieu == CRYPT)
+		else if (g_s._currPlace == CRYPT)
 			g_crep = 155;
 	}
 }
@@ -607,30 +608,30 @@ void fctOpen() {
 		if (g_ipers > 0)
 			g_s._conf += 2;
 		++g_iouv;
-		int cx = 0;
+		int tmpPlace = 0;
 		do {
-			++cx;
-		} while (!((cx > 6) || (ord(g_touv[cx]) == 0) || (ord(g_touv[cx]) == g_num)));
-		if (ord(g_touv[cx]) != g_num) {
-			if (!( ((g_num == 3) && ((g_s._mlieu == OWN_ROOM) || (g_s._mlieu == 9) || (g_s._mlieu == BLUE_ROOM) || (g_s._mlieu == BATHROOM)))
-			    || ((g_num == 4) && ((g_s._mlieu == GREEN_ROOM) || (g_s._mlieu == PURPLE_ROOM) || (g_s._mlieu == RED_ROOM)))
-				|| ((g_s._mlieu == DARKBLUE_ROOM) && (g_num == 5))
-				|| ((g_num == 6) && ((g_s._mlieu == BATHROOM) || (g_s._mlieu == DINING_ROOM) || (g_s._mlieu == GREEN_ROOM2) || (g_s._mlieu == ATTIC)))
-				|| ((g_s._mlieu == GREEN_ROOM2) && (g_num == 2))
-				|| ((g_s._mlieu == KITCHEN) && (g_num == 7))) ) {
-				if ( ((g_s._mlieu > DINING_ROOM) && (g_s._mlieu < CELLAR))
-				  || ((g_s._mlieu > RED_ROOM) && (g_s._mlieu < DINING_ROOM))
-				  || (g_s._mlieu == OWN_ROOM) || (g_s._mlieu == PURPLE_ROOM) || (g_s._mlieu == BLUE_ROOM)) {
+			++tmpPlace;
+		} while (!((tmpPlace > 6) || (ord(g_touv[tmpPlace]) == 0) || (ord(g_touv[tmpPlace]) == g_num)));
+		if (ord(g_touv[tmpPlace]) != g_num) {
+			if (!( ((g_num == 3) && ((g_s._currPlace == OWN_ROOM) || (g_s._currPlace == 9) || (g_s._currPlace == BLUE_ROOM) || (g_s._currPlace == BATHROOM)))
+			    || ((g_num == 4) && ((g_s._currPlace == GREEN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == RED_ROOM)))
+				|| ((g_s._currPlace == DARKBLUE_ROOM) && (g_num == 5))
+				|| ((g_num == 6) && ((g_s._currPlace == BATHROOM) || (g_s._currPlace == DINING_ROOM) || (g_s._currPlace == GREEN_ROOM2) || (g_s._currPlace == ATTIC)))
+				|| ((g_s._currPlace == GREEN_ROOM2) && (g_num == 2))
+				|| ((g_s._currPlace == KITCHEN) && (g_num == 7))) ) {
+				if ( ((g_s._currPlace > DINING_ROOM) && (g_s._currPlace < CELLAR))
+				  || ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
+				  || (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
 						parole(7, 9, 1);
 				}
-				g_touv[cx] = chr(g_num);
+				g_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
 			}
-			cx = g_s._mlieu;
-			if (g_s._mlieu == CRYPT)
-				cx = 14;
-			g_crep = g_tabdon[aouvr + (cx * 7) + g_num - 1];
+			tmpPlace = g_s._currPlace;
+			if (g_s._currPlace == CRYPT)
+				tmpPlace = CELLAR;
+			g_crep = g_tabdon[aouvr + (tmpPlace * 7) + g_num - 1];
 			if (g_crep == 254)
 				g_crep = 999;
 		} else
@@ -663,27 +664,27 @@ void fctPlace() {
 		g_crep = 999;
 		if (g_caff == 13) {
 			if (g_num == 1) {
-				if (g_s._iboul != 0) {
+				if (g_s._atticBallHoleObjectId != 0) {
 					g_crep = 188;
 				} else {
-					g_s._iboul = g_s._selectedObjectId;
+					g_s._atticBallHoleObjectId = g_s._selectedObjectId;
 					if (g_s._selectedObjectId == 141)
 						aniof(1, 7);
 				}
-			} else if (g_s._ibag != 0) {
+			} else if (g_s._atticRodHoleObjectId != 0) {
 				g_crep = 188;
 			} else {
-				g_s._ibag = g_s._selectedObjectId;
+				g_s._atticRodHoleObjectId = g_s._selectedObjectId;
 				if (g_s._selectedObjectId == 159)
 					aniof(1, 6);
 			}
 		}
 
 		if (g_caff == 14) {
-			if (g_s._icave != 0) {
+			if (g_s._cellarObjectId != 0) {
 				g_crep = 188;
 			} else {
-				g_s._icave = g_s._selectedObjectId;
+				g_s._cellarObjectId = g_s._selectedObjectId;
 				if (g_s._selectedObjectId == 151) {
 					// Open hidden passage
 					aniof(1, 2);
@@ -714,10 +715,10 @@ void fctPlace() {
 
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
-							g_s._mlieu = SECRET_PASSAGE;
+							g_s._currPlace = SECRET_PASSAGE;
 							tmlieu(17);
 						} else {
-							tmlieu(g_s._mlieu);
+							tmlieu(g_s._currPlace);
 							writepal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -738,17 +739,17 @@ void fctPlace() {
 		}
 
 		if (g_caff == 16) {
-			if (g_s._icryp == 0)
-				g_s._icryp = g_s._selectedObjectId;
+			if (g_s._cryptObjectId == 0)
+				g_s._cryptObjectId = g_s._selectedObjectId;
 			else
 				g_crep = 188;
 		}
 
 		if (g_caff == 17) {
-			if (g_s._ivier != 0) {
+			if (g_s._secretPassageObjectId != 0) {
 				g_crep = 188;
 			} else if (g_s._selectedObjectId == 143) {
-				g_s._ivier = 143;
+				g_s._secretPassageObjectId = 143;
 				aniof(1, 1);
 			} else {
 				g_crep = 1512;
@@ -757,10 +758,10 @@ void fctPlace() {
 		}
 
 		if (g_caff == 24) {
-			if (g_s._ipuit != 0) {
+			if (g_s._wellObjectId != 0) {
 				g_crep = 188;
 			} else if ((g_s._selectedObjectId == 140) || (g_s._selectedObjectId == 120)) {
-				g_s._ipuit = g_s._selectedObjectId;
+				g_s._wellObjectId = g_s._selectedObjectId;
 				aniof(1, 1);
 			} else {
 				g_crep = 185;
@@ -789,7 +790,7 @@ void fctTurn() {
 	tcoord(9);
 	if (g_num != 0) {
 		g_crep = 997;
-		if ((g_s._mlieu == ATTIC) && (g_s._ibag == 159) && (g_s._iboul == 141)) {
+		if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
 			parole(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -798,13 +799,13 @@ void fctTurn() {
 			else
 				g_crep = 168;
 		}
-		if ((g_s._mlieu == SECRET_PASSAGE) && (g_s._ivier == 143)) {
+		if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
 			repon(2, 175);
 			clsf3();
 			parole(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
-				g_s._mlieu = CRYPT;
+				g_s._currPlace = CRYPT;
 				affrep();
 			} else
 				g_crep = 176;
@@ -845,10 +846,10 @@ void fctAttach() {
 		if (!(g_anyone) && !(g_iesc)) {
 			tcoord(8);
 			g_crep = 997;
-			if ((g_num != 0) && (g_s._mlieu == WELL)) {
+			if ((g_num != 0) && (g_s._currPlace == WELL)) {
 				g_crep = 999;
 				if ((g_s._selectedObjectId == 120) || (g_s._selectedObjectId == 140)) {
-					g_s._ipuit = g_s._selectedObjectId;
+					g_s._wellObjectId = g_s._selectedObjectId;
 					aniof(1, 1);
 				} else
 					g_crep = 185;
@@ -903,20 +904,20 @@ void fctClose() {
  * @remarks	Originally called 'tfrapper'
  */
 void fctKnock() {
-	warning("Knock - mlieu %d", g_s._mlieu);
+	warning("Knock - _currPlace %d", g_s._currPlace);
 
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
-	if (g_s._mlieu == LANDING) {
+	if (g_s._currPlace == LANDING) {
 		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
-	if (g_s._mlieu < DOOR) {
+	if (g_s._currPlace < DOOR) {
 		tfleche();
 		if (!(g_anyone) && !(g_iesc)) {
-			if ((g_s._mlieu < MOUNTAIN) && (g_s._mlieu != LANDING))
+			if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING))
 				g_crep = 133;
 			else
 				g_crep = 997;
@@ -925,7 +926,7 @@ void fctKnock() {
 		return;
 	}
 
-	if (g_s._mlieu == 26) {
+	if (g_s._currPlace == 26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		parole(11, rand, 1);
 		int p;
@@ -991,40 +992,40 @@ void fctSelfPut() {
 			tcoord(8);
 			if (g_num != 0) {
 				g_crep = 998;
-				if (g_caff == 2) {
-					if (g_s._iloic != 0)
+				if (g_caff == PURPLE_ROOM) {
+					if (g_s._purpleRoomObjectId != 0)
 						g_crep = 188;
 					else
-						g_s._iloic = g_s._selectedObjectId;
+						g_s._purpleRoomObjectId = g_s._selectedObjectId;
 				}
 
-				if (g_caff == 13) {
+				if (g_caff == ATTIC) {
 					if (g_num == 1) {
-						if (g_s._iboul != 0)
+						if (g_s._atticBallHoleObjectId != 0)
 							g_crep = 188;
 						else
-							g_s._iboul = g_s._selectedObjectId;
-					} else if (g_s._ibag != 0) {
+							g_s._atticBallHoleObjectId = g_s._selectedObjectId;
+					} else if (g_s._atticRodHoleObjectId != 0) {
 						g_crep = 188;
 					} else {
-						g_s._ibag = g_s._selectedObjectId;
+						g_s._atticRodHoleObjectId = g_s._selectedObjectId;
 					}
 				}
 
-				if (g_caff == 16) {
-					if (g_s._icryp != 0)
+				if (g_caff == CRYPT) {
+					if (g_s._cryptObjectId != 0)
 						g_crep = 188;
 					else
-						g_s._icryp = g_s._selectedObjectId;
+						g_s._cryptObjectId = g_s._selectedObjectId;
 				}
 
-				if (g_caff == 24)
+				if (g_caff == WELL)
 					g_crep = 185;
-				if ((g_caff == 14) || (g_caff == 17))
+				if ((g_caff == CELLAR) || (g_caff == SECRET_PASSAGE))
 					g_crep = 124;
 			} else {
 				g_crep = 124;
-				if (g_caff == 24) {
+				if (g_caff == WELL) {
 					tcoord(5);
 					if (g_num != 0)
 						g_crep = 185;
@@ -1047,7 +1048,7 @@ void fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void fctListen() {
-	if (g_s._mlieu != 26)
+	if (g_s._currPlace != 26)
 		g_crep = 101;
 	else {
 		if (g_ipers != 0)
@@ -1085,14 +1086,14 @@ void fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void fctEat() {
-	if ((g_s._mlieu > LANDING) && (g_s._mlieu < 26)) {
+	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
 		g_crep = 148;
 	} else {
 		tsort();
-		g_s._mlieu = DINING_ROOM;
+		g_s._currPlace = DINING_ROOM;
 		g_caff = 10;
-		debloc(g_s._mlieu);
-		tmlieu(g_s._mlieu);
+		debloc(g_s._currPlace);
+		tmlieu(g_s._currPlace);
 
 		int j, h, m;
 		calch(j, h, m);
@@ -1126,10 +1127,10 @@ void fctEat() {
  * @remarks	Originally called 'tentrer'
  */
 void fctEnter() {
-	if ((g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK)) {
+	if ((g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 		t1sama();
-		tmlieu(g_s._mlieu);
-	} else if (g_s._mlieu == LANDING)
+		tmlieu(g_s._currPlace);
+	} else if (g_s._currPlace == LANDING)
 		aldepl();
 	else if (g_ment == 0)
 		g_crep = 997;
@@ -1150,7 +1151,7 @@ void fctEnter() {
 				
 				tip(z, g_x);
 				++g_s._conf;
-				g_s._mlieu = LANDING;
+				g_s._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
 				g_syn = true;
@@ -1169,10 +1170,10 @@ void fctEnter() {
 			parole(7, g_x, 1);
 			aniof(1, 1);
 			
-			g_s._mlieu = g_ment;
+			g_s._currPlace = g_ment;
 			affrep();
-			debloc(g_s._mlieu);
-			tmlieu(g_s._mlieu);
+			debloc(g_s._currPlace);
+			tmlieu(g_s._currPlace);
 			g_ment = 0;
 			g_mpers = 0;
 			g_ipers = 0;
@@ -1187,17 +1188,17 @@ void fctEnter() {
 void fctSleep() {
 	int z, j, h, m;
 
-	if ((g_s._mlieu > LANDING) && (g_s._mlieu < 26)) {
+	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
 		g_crep = 148;
 		return;
 	}
-	if (g_s._mlieu != OWN_ROOM) {
+	if (g_s._currPlace != OWN_ROOM) {
 		tsort();
-		g_s._mlieu = OWN_ROOM;
+		g_s._currPlace = OWN_ROOM;
 		affrep();
 		afdes(0);
-		debloc(g_s._mlieu);
-		tmlieu(g_s._mlieu);
+		debloc(g_s._currPlace);
+		tmlieu(g_s._currPlace);
 	}
 	clsf3();
 	clsf2();
@@ -1238,7 +1239,7 @@ void fctForce() {
 		tfleche();
 
 	if ((!g_anyone) && (!g_iesc)) {
-		if (g_s._mlieu != 26)
+		if (g_s._currPlace != 26)
 			g_crep = 997;
 		else {
 			g_crep = 143;
@@ -1254,27 +1255,27 @@ void fctForce() {
 void fctLeave() {
 	tsort();
 	g_crep = 0;
-	if ((g_s._mlieu == MOUNTAIN) || (g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK) || (g_s._mlieu == WELL))
+	if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK) || (g_s._currPlace == WELL))
 		g_crep = 997;
 	else {
 		int lx = 0;
 
-		if ((g_s._mlieu < CRYPT) || (g_s._mlieu == 26))
+		if ((g_s._currPlace < CRYPT) || (g_s._currPlace == 26))
 			lx = 10;
-		if ((g_s._mlieu == DINING_ROOM) || (g_s._mlieu == CHAPEL))
+		if ((g_s._currPlace == DINING_ROOM) || (g_s._currPlace == CHAPEL))
 			lx = 21;
-		if ((g_s._mlieu < DINING_ROOM) || (g_s._mlieu == ATTIC))
+		if ((g_s._currPlace < DINING_ROOM) || (g_s._currPlace == ATTIC))
 			lx = 15;
-		if (g_s._mlieu == CRYPT) {
+		if (g_s._currPlace == CRYPT) {
 			lx = 17;
 			g_crep = 176;
 		}
-		if (g_s._mlieu == SECRET_PASSAGE)
+		if (g_s._currPlace == SECRET_PASSAGE)
 			t23coul(lx);
-		if (g_s._mlieu == 23)
+		if (g_s._currPlace == 23)
 			lx = 24;
 		if (g_crep != 997)
-			g_s._mlieu = lx;
+			g_s._currPlace = lx;
 		g_caff = lx;
 		if (g_crep == 0)
 			g_crep = lx;
@@ -1298,12 +1299,12 @@ void fctWait() {
 		++g_jh;
 		tinke();
 		if (!g_blo)
-			t11(g_s._mlieu, quel);
+			t11(g_s._currPlace, quel);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
-			if ((g_s._mlieu == ATTIC) || (g_s._mlieu == CELLAR))
+			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
 				cavegre();
-			if ((g_s._mlieu > OWN_ROOM) && (g_s._mlieu < DINING_ROOM))
+			if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
 				g_anyone = true;
 			g_mpers = g_ipers;
 			if (!g_anyone)
@@ -1465,7 +1466,7 @@ void fctDiscuss() {
 			int ix = choi - 1;
 			if (g_col) {
 				g_col = false;
-				g_s._mlieu = 15;
+				g_s._currPlace = 15;
 				if (g_iouv > 0)
 					max = 8;
 				else
@@ -1515,7 +1516,7 @@ void fctDiscuss() {
 		sparl(0, 138);
 		showMouse();
 		g_col = false;
-		g_s._mlieu = 15;
+		g_s._currPlace = 15;
 	}
 	g_ctrm = 0;
 	hideMouse();
@@ -1527,7 +1528,7 @@ void fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	tmlieu(g_s._mlieu);
+	tmlieu(g_s._currPlace);
 	clsf3();
 }
 
@@ -1593,8 +1594,11 @@ void MortevielleEngine::endGame() {
 	repon(2, 35);
 	musique(0);
 	tkey1(false);
-	messint(2036);
-	tkey1(false);
+	// A wait message was displayed. 
+	// tkey1 was called before and after.
+	// Most likely the double call is useless, thus removed
+	//
+	// tkey1(false);
 	inzon();
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 52b71c7..d6d5236 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1015,15 +1015,15 @@ void inzon() {
 
 	g_s._ipre  = false;
 	g_s._selectedObjectId = 0;
-	g_s._icave = 0;
-	g_s._iboul = 0;
-	g_s._ibag  = 0;
-	g_s._ipuit = 0;
-	g_s._ivier = 0;
-	g_s._iloic = 136;
-	g_s._icryp = 141;
+	g_s._cellarObjectId = 0;
+	g_s._atticBallHoleObjectId = 0;
+	g_s._atticRodHoleObjectId = 0;
+	g_s._wellObjectId = 0;
+	g_s._secretPassageObjectId = 0;
+	g_s._purpleRoomObjectId = 136;
+	g_s._cryptObjectId = 141;
 	g_s._conf  = getRandomNumber(4, 10);
-	g_s._mlieu = MANOR_FRONT;
+	g_s._currPlace = MANOR_FRONT;
 
 	for (int cx = 2; cx <= 6; ++cx)
 		g_s._sjer[cx] = chr(0);
@@ -1275,16 +1275,6 @@ void writetp(Common::String s, int t) {
 		g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
 }
 
-/**
- * Shows the waiting message when changing scenes.
- * @remarks	Because modern computesr are so much quicker. There's no point in showing
- * a waiting message between scenes.
- */
-void messint(int nu) {
-	// Method is deprecated
-	warning("DEPRECATED: messint");
-}
-
 void aniof(int ouf, int num) {
 	if ((g_caff == 7) && ((num == 4) || (num == 5)))
 		return;
@@ -1318,27 +1308,27 @@ void musique(int so) {
 		++g_prebru;
 	} else {
 		bool i = false;
-		if ((g_s._mlieu == MOUNTAIN) || (g_s._mlieu == MANOR_FRONT) || (g_s._mlieu == MANOR_BACK)) {
+		if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 			if (getRandomNumber(1, 3) == 2) {
 				parole(9, getRandomNumber(2, 4), 1);
 				i = true;
 			}
 		}
-		if (g_s._mlieu == CHAPEL) {
+		if (g_s._currPlace == CHAPEL) {
 			if (getRandomNumber(1, 2) == 1) {
 				parole(8, 1, 1);
 				i = true;
 			}
 		}
 
-		if (g_s._mlieu == WELL) {
+		if (g_s._currPlace == WELL) {
 			if (getRandomNumber(1, 2) == 2) {
 				parole(12, 1, 1);
 				i = true;
 			}
 		}
 
-		if (g_s._mlieu == 23) {
+		if (g_s._currPlace == 23) {
 			parole(13, 1, 1);
 			i = true;
 		}
@@ -1369,19 +1359,19 @@ void dessin(int ad) {
 				}
 
 				if (g_caff == 13) {
-					if (g_s._iboul == 141)
+					if (g_s._atticBallHoleObjectId == 141)
 						aniof(1, 7);
 
-					if (g_s._ibag == 159)
+					if (g_s._atticRodHoleObjectId == 159)
 						aniof(1, 6);
 				}
-				if ((g_caff == 14) && (g_s._icave == 151))
+				if ((g_caff == 14) && (g_s._cellarObjectId == 151))
 					aniof(1, 2);
 
-				if ((g_caff == 17) && (g_s._ivier == 143))
+				if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
 					aniof(1, 1);
 
-				if ((g_caff == 24) && (g_s._ipuit != 0))
+				if ((g_caff == 24) && (g_s._wellObjectId != 0))
 					aniof(1, 1);
 			}
 			
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index f649195..87238c4 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -113,7 +113,6 @@ extern void pl20(int cf);
 extern void t11(int l11, int &a);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
-extern void messint(int nu);
 extern void aniof(int ouf, int num);
 extern void musique(int so);
 /* NIVEAU 9 */
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 05002a3..28692ea 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -157,7 +157,7 @@ void tinke() {
 				g_mpers = g_ipers;
 
 			if ((g_mpers == 0) && (g_ipers > 0)) {
-				if ((g_s._mlieu == ATTIC) || (g_s._mlieu == CELLAR)) {
+				if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
 					cavegre();
 				} else if (g_ipers == 10) {
 					g_ipers = 0;
@@ -185,7 +185,7 @@ void tinke() {
 		nouvp(g_li, cx);
 		g_brt = false;
 		g_hdb = 0;
-		if ((g_s._mlieu > OWN_ROOM) && (g_s._mlieu < DINING_ROOM))
+		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
 			g_anyone = true;
 	}
 }
@@ -269,8 +269,8 @@ void tlu(int af, int ob) {
 }
 
 void affrep() {
-	g_caff = g_s._mlieu;
-	g_crep = g_s._mlieu;
+	g_caff = g_s._currPlace;
+	g_crep = g_s._currPlace;
 }
 
 /**
@@ -278,7 +278,7 @@ void affrep() {
  * @remarks	Originally called 'mfouen'
  */
 void unsetSearchMenu() {
-	tmlieu(g_s._mlieu);
+	tmlieu(g_s._currPlace);
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
 
@@ -312,7 +312,7 @@ void tperd() {
 
 void tsort() {
 
-	if ((g_iouv > 0) && (g_s._mlieu != 0)) {
+	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
 		if (g_s._conf < 50)
 			g_s._conf += 2;
 		else
@@ -324,7 +324,7 @@ void tsort() {
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	debloc(g_s._mlieu);
+	debloc(g_s._currPlace);
 }
 
 void st4(int ob) {
@@ -369,7 +369,7 @@ void cherjer(int ob, bool &d) {
 }
 
 void st1sama() {
-	g_s._mlieu = DINING_ROOM;
+	g_s._currPlace = DINING_ROOM;
 	affrep();
 }
 
@@ -480,7 +480,7 @@ void t1sama() {    //Entering manor
 	int j, h, m;
 
 	calch(j, h, m);
-	if ((h < 5) && (g_s._mlieu > 18)) {
+	if ((h < 5) && (g_s._currPlace > 18)) {
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
@@ -504,7 +504,7 @@ void t1sama() {    //Entering manor
 		dessine_rouleau();
 		drawClock();
 		showMouse();
-		g_s._mlieu = OWN_ROOM;
+		g_s._currPlace = OWN_ROOM;
 		affrep();
 		t5(10);
 		if (!g_blo)
@@ -518,7 +518,7 @@ void t1sama() {    //Entering manor
 }
 
 void t1vier() {
-	g_s._mlieu = SECRET_PASSAGE;
+	g_s._currPlace = SECRET_PASSAGE;
 	affrep();
 }
 
@@ -529,19 +529,19 @@ void t1neig() {
 		tperd();
 	} else {
 		g_okdes = true;
-		g_s._mlieu = MOUNTAIN;
+		g_s._currPlace = MOUNTAIN;
 		affrep();
 	}
 }
 
 void t1deva() {
 	g_inei = 0;
-	g_s._mlieu = MANOR_FRONT;
+	g_s._currPlace = MANOR_FRONT;
 	affrep();
 }
 
 void t1derr() {
-	g_s._mlieu = MANOR_BACK;
+	g_s._currPlace = MANOR_BACK;
 	affrep();
 }
 
@@ -777,11 +777,11 @@ void avpoing(int &ob) {
 }
 
 void rechai(int &ch) {
-	int cx = g_s._mlieu;
+	int tmpPlace = g_s._currPlace;
 
-	if (g_s._mlieu == CRYPT)
-		cx = 14;
-	ch = g_tabdon[achai + (cx * 7) + g_num - 1];
+	if (g_s._currPlace == CRYPT)
+		tmpPlace = CELLAR;
+	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
 }
 
 void t23coul(int &l) {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 51f0d95..7ed3e92 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -621,7 +621,7 @@ void MortevielleEngine::handleAction() {
 						oo = true;
 						if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
 							endSearch();
-							g_caff = g_s._mlieu;
+							g_caff = g_s._currPlace;
 							g_crep = 998;
 						} else
 							tsuiv();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 8479538..46bde5e 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -122,7 +122,7 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, g_crep);
 	clsf3();
 	_endGame = false;
-	tmlieu(g_s._mlieu);
+	tmlieu(g_s._currPlace);
 	modinv();
 	if (g_s._selectedObjectId != 0)
 		modobj(g_s._selectedObjectId + 400);
@@ -226,11 +226,11 @@ void tsitu() {
 		}
 	}
 	calch(j, h, m);
-	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._mlieu != 10)) ||
-	        ((h > 0) && (h < 6) && (g_s._mlieu != 0)))
+	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._currPlace != 10)) ||
+	        ((h > 0) && (h < 6) && (g_s._currPlace != 0)))
 		++g_s._conf;
-	if (((g_s._mlieu < CRYPT) || (g_s._mlieu > MOUNTAIN)) && (g_s._mlieu != 23)
-	        && (g_s._mlieu != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
+	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
+	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
 		if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
 			g_crep = 1501;
 			tperd();
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 53a147c..386fd95 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -53,15 +53,15 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncBytes((byte *)&g_s1._pourc[0], 11);
 	sz.syncBytes((byte *)&g_s1._teauto[0], 43);
 	sz.syncBytes((byte *)&g_s1._sjer[0], 31);
-	sz.syncAsSint16LE(g_s1._mlieu);
-	sz.syncAsSint16LE(g_s1._iboul);
-	sz.syncAsSint16LE(g_s1._ibag);
-	sz.syncAsSint16LE(g_s1._icave);
-	sz.syncAsSint16LE(g_s1._ivier);
-	sz.syncAsSint16LE(g_s1._ipuit);
+	sz.syncAsSint16LE(g_s1._currPlace);
+	sz.syncAsSint16LE(g_s1._atticBallHoleObjectId);
+	sz.syncAsSint16LE(g_s1._atticRodHoleObjectId);
+	sz.syncAsSint16LE(g_s1._cellarObjectId);
+	sz.syncAsSint16LE(g_s1._secretPassageObjectId);
+	sz.syncAsSint16LE(g_s1._wellObjectId);
 	sz.syncAsSint16LE(g_s1._selectedObjectId);
-	sz.syncAsSint16LE(g_s1._iloic);
-	sz.syncAsSint16LE(g_s1._icryp);
+	sz.syncAsSint16LE(g_s1._purpleRoomObjectId);
+	sz.syncAsSint16LE(g_s1._cryptObjectId);
 	sz.syncAsByte(g_s1._ipre);
 	sz.syncAsByte(g_s1._heure);
 
@@ -144,8 +144,8 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	for (i = 0; i <= 389; ++i)
 		g_bufcha[i] = g_tabdon[i + acha];
 	g_s1 = g_s;
-	if (g_s1._mlieu == 26)
-		g_s1._mlieu = 15;
+	if (g_s1._currPlace == 26)
+		g_s1._currPlace = 15;
 	
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 096a076..00d9dca 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -176,7 +176,6 @@ void taffich() {
 		if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
 
-		messint(m);
 		g_maff = a;
 		if (a == 159)
 			a = 86;
@@ -249,11 +248,11 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_s._mlieu == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			person();
 		else if (!g_blo)
-			t11(g_s._mlieu, cx);
+			t11(g_s._currPlace, cx);
 		g_mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index dd65f39..8c66143 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -165,8 +165,8 @@ struct sav_chaine {
 	byte _pourc[11];
 	byte _teauto[43];
 	byte _sjer[31];
-	int _mlieu, _iboul, _ibag, _icave, _ivier, _ipuit;
-	int _selectedObjectId, _iloic, _icryp;
+	int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId;
+	int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId;
 	bool _ipre;
 	byte _heure;
 };


Commit: fb4563a29d3deabc60f4a1b0274a27c6ef77c05d
    https://github.com/scummvm/scummvm/commit/fb4563a29d3deabc60f4a1b0274a27c6ef77c05d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:40-07:00

Commit Message:
MORTEVIELLE: Rename some more functions and globals

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6b9388a..22c12d6 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -164,7 +164,7 @@ void fctMove() {
 			g_crep = 997;
 		else if (g_s._wellObjectId == 120)
 			g_crep = 181;
-		else if (g_s._conf > 80) {
+		else if (g_s._faithScore > 80) {
 			g_crep = 1505;
 			tperd();
 		} else {
@@ -189,7 +189,7 @@ void fctTake() {
 		avpoing(cx);
 		if (g_crep != 139) {
 			if (g_ipers > 0)
-				g_s._conf += 3;
+				g_s._faithScore += 3;
 			if (g_obpart) {
 				if (g_s._currPlace == PURPLE_ROOM)
 					g_s._purpleRoomObjectId = 0;
@@ -215,7 +215,7 @@ void fctTake() {
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
-					g_s._conf += 2;
+					g_s._faithScore += 2;
 					g_dobj = 0;
 				}
 			}
@@ -239,7 +239,7 @@ void fctTake() {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
-				g_s._conf += 3;
+				g_s._faithScore += 3;
 			g_crep = 997;
 			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
 				avpoing(g_s._purpleRoomObjectId);
@@ -335,7 +335,7 @@ void fctLift() {
 		tcoord(8);
 		if (g_num != 0) {
 			if (g_ipers > 0)
-				++g_s._conf;
+				++g_s._faithScore;
 			g_crep = 997;
 			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
 				treg(g_s._purpleRoomObjectId);
@@ -343,7 +343,7 @@ void fctLift() {
 		return;
 	}
 	if (g_ipers > 0)
-		++g_s._conf;
+		++g_s._faithScore;
 	int tmpPlace = g_s._currPlace;
 	if (g_s._currPlace == CRYPT)
 		tmpPlace = 14;
@@ -510,7 +510,7 @@ void fctSearch() {
 				g_crep = 187;
 			else {
 				if (g_ipers > 0)
-					g_s._conf += 3;
+					g_s._faithScore += 3;
 
 				rechai(g_mchai);
 				if (g_mchai != 0) {
@@ -527,7 +527,7 @@ void fctSearch() {
 			g_crep = 997;
 			if (g_num != 0) {
 				if (g_ipers > 0)
-					g_s._conf += 3;
+					g_s._faithScore += 3;
 				if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
 					if (g_s._currPlace == PURPLE_ROOM) {
 						g_crep = 123;
@@ -544,7 +544,7 @@ void fctSearch() {
 		}
 	} else {
 		if (g_ipers > 0)
-			g_s._conf += 3;
+			g_s._faithScore += 3;
 		g_crep = 997;
 		if (g_s._currPlace < CELLAR)
 			g_crep = r[g_s._currPlace];
@@ -606,7 +606,7 @@ void fctOpen() {
 	tcoord(7);
 	if (g_num != 0) {
 		if (g_ipers > 0)
-			g_s._conf += 2;
+			g_s._faithScore += 2;
 		++g_iouv;
 		int tmpPlace = 0;
 		do {
@@ -930,7 +930,7 @@ void fctKnock() {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		parole(11, rand, 1);
 		int p;
-		ecfren(p, rand, g_s._conf, g_ment);
+		ecfren(p, rand, g_s._faithScore, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -1052,9 +1052,9 @@ void fctListen() {
 		g_crep = 101;
 	else {
 		if (g_ipers != 0)
-			++g_s._conf;
+			++g_s._faithScore;
 		int p, rand;
-		ecfren(p, rand, g_s._conf, g_ment);
+		ecfren(p, rand, g_s._faithScore, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -1098,7 +1098,7 @@ void fctEat() {
 		int j, h, m;
 		calch(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
-			g_s._conf -= (g_s._conf / 7);
+			g_s._faithScore -= (g_s._faithScore / 7);
 			if (h == 12) {
 				if (m == 0)
 					h = 4;
@@ -1150,7 +1150,7 @@ void fctEnter() {
 				aniof(1, 1);
 				
 				tip(z, g_x);
-				++g_s._conf;
+				++g_s._faithScore;
 				g_s._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
@@ -1209,7 +1209,7 @@ void fctSleep() {
 	int answer;
 	do {
 		if (h < 8) {
-			g_s._conf -= (g_s._conf / 20);
+			g_s._faithScore -= (g_s._faithScore / 20);
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
@@ -1243,7 +1243,7 @@ void fctForce() {
 			g_crep = 997;
 		else {
 			g_crep = 143;
-			g_s._conf += 2;
+			g_s._faithScore += 2;
 		}
 	}
 }
@@ -1475,14 +1475,14 @@ void fctDiscuss() {
 					suj = 129;
 				else {
 					suj = 138;
-					g_s._conf += (3 * (g_s._conf / 10));
+					g_s._faithScore += (3 * (g_s._faithScore / 10));
 				}
 			} else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) {
 				suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)];
-				g_s._conf += g_tabdon[arcf + ix];
+				g_s._faithScore += g_tabdon[arcf + ix];
 				++g_nbrep[g_caff - 69];
 			} else {
-				g_s._conf += 3;
+				g_s._faithScore += 3;
 				suj = 139;
 			}
 			hideMouse();
@@ -1509,7 +1509,7 @@ void fctDiscuss() {
 		}
 	} while ((choi != 46) && (suj != 138));
 	if (g_col) {
-		g_s._conf += (3 * (g_s._conf / 10));
+		g_s._faithScore += (3 * (g_s._faithScore / 10));
 		hideMouse();
 		hirs();
 		premtet();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index d6d5236..82d0ef1 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -236,11 +236,11 @@ void clsf10() {
 		cod = 544;
 	}
 	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (g_s._conf < 33)
+	if (g_s._faithScore < 33)
 		st = g_vm->getEngineString(S_COOL);
-	else if (g_s._conf < 66)
+	else if (g_s._faithScore < 66)
 		st = g_vm->getEngineString(S_LOURDE);
-	else if (g_s._conf > 65)
+	else if (g_s._faithScore > 65)
 		st = g_vm->getEngineString(S_MALSAINE);
 	
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
@@ -746,10 +746,12 @@ void cpl20(int &p, int &h) {
 		p = -5;
 }
 
-void quelq1(int l) {
-	int per;
-
-	per = getRandomNumber(1, 2);
+/**
+ * Engine function - Check who is in the Green Room
+ * @remarks	Originally called 'quelq1'
+ */
+void setPresenceGreenRoom(int l) {
+	int per = getRandomNumber(1, 2);
 	if (l == 1) {
 		if (per == 1)
 			g_bh1 = true;
@@ -765,7 +767,11 @@ void quelq1(int l) {
 	g_ipers = 10;
 }
 
-void quelq2() {
+/**
+ * Engine function - Check who is in the Purple Room
+ * @remarks	Originally called 'quelq2'
+ */
+void setPresencePurpleRoom() {
 	if (g_li == 2)
 		g_bh2 = true;
 	else
@@ -774,12 +780,20 @@ void quelq2() {
 	g_ipers = 10;
 }
 
-void quelq5() {
+/**
+ * Engine function - Check who is in the Blue Room
+ * @remarks	Originally called 'quelq5'
+ */
+void setPresenceBlueRoom() {
 	g_bh5 = true;
 	g_ipers = 10;
 }
 
-void quelq6(int l) {
+/**
+ * Engine function - Check who is in the Red Room
+ * @remarks	Originally called 'quelq6'
+ */
+void setPresenceRedRoom(int l) {
 	if (l == 6)
 		g_bh6 = true;
 	else if (l == 8)
@@ -788,9 +802,15 @@ void quelq6(int l) {
 	g_ipers = 10;
 }
 
-void quelq10(int h, int &per) {
+/**
+ * Engine function - Check who is in the Dining Room
+ * @remarks	Originally called 'quelq10'
+ */
+int setPresenceDiningRoom(int h) {
+	int retVal = 0;
+
 	if ((h >= 0) && (h < 8))
-		per = chlm();
+		retVal = chlm();
 	else {
 		int min = 0, max = 0;
 		if ((h > 7) && (h < 10)) {
@@ -806,14 +826,22 @@ void quelq10(int h, int &per) {
 			min = 1;
 			max = 5;
 		}
-		choix(min, max, per);
+		choix(min, max, retVal);
 	}
-	affper(per);
+	affper(retVal);
+
+	return retVal;
 }
 
-void quelq11(int h, int &per) {
+/**
+ * Engine function - Check who is in the Bureau
+ * @remarks	Originally called 'quelq11'
+ */
+int setPresenceBureau(int h) {
+	int retVal = 0;
+
 	if ((h >= 0) && (h < 8))
-		per = chlm();
+		retVal = chlm();
 	else {
 		int min = 0, max = 0;
 		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
@@ -826,41 +854,59 @@ void quelq11(int h, int &per) {
 			min = 1;
 			max = 2;
 		}
-		choix(min, max, per);
+		choix(min, max, retVal);
 	}
-	affper(per);
-}
+	affper(retVal);
 
-void quelq12(int &per) {
-	per = chlm();
-	affper(per);
+	return retVal;
 }
 
-void quelq15(int &per) {
-	int cx;
-	bool test;
+/**
+ * Engine function - Check who is in the Kitchen
+ * @remarks	Originally called 'quelq12'
+ */
+int setPresenceKitchen() {
+	int retVal = chlm();
+	affper(retVal);
 
-	per = 0;
+	return retVal;
+}
 
+/**
+ * Engine function - Check who is in the Landing
+ * @remarks	Originally called 'quelq15'
+ */
+int setPresenceLanding() {
+	bool test = false;
+	int rand = 0;
 	do {
-		cx = getRandomNumber(1, 8);
-		test = (((cx == 1) && (g_bh2 || g_bh9)) ||
-		        ((cx == 2) && g_bh8) ||
-		        ((cx == 3) && g_bh4) ||
-		        ((cx == 4) && g_bf4) ||
-		        ((cx == 5) && g_bh6) ||
-		        ((cx == 6) && g_bh1) ||
-		        ((cx == 7) && g_bf1) ||
-		        ((cx == 8) && g_bh5));
+		rand = getRandomNumber(1, 8);
+		test = (((rand == 1) && (g_bh2 || g_bh9)) ||
+		        ((rand == 2) && g_bh8) ||
+		        ((rand == 3) && g_bh4) ||
+		        ((rand == 4) && g_bf4) ||
+		        ((rand == 5) && g_bh6) ||
+		        ((rand == 6) && g_bh1) ||
+		        ((rand == 7) && g_bf1) ||
+		        ((rand == 8) && g_bh5));
 	} while (test);
 
-	conv(cx, per);
-	affper(per);
+	int retVal = 0;
+	conv(rand, retVal);
+	affper(retVal);
+
+	return retVal;
 }
 
-void quelq20(int h, int &per) {
+/**
+ * Engine function - Check who is in the chapel
+ * @remarks	Originally called 'quelq20'
+ */
+int setPresenceChapel(int h) {
+	int retVal = 0;
+
 	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
-		per = chlm();
+		retVal = chlm();
 	else {
 		int min = 0, max = 0;
 		if ((h > 9) && (h < 12)) {
@@ -873,9 +919,11 @@ void quelq20(int h, int &per) {
 			min = 2;
 			max = 4;
 		}
-		choix(min, max, per);
+		choix(min, max, retVal);
 	}
-	affper(per);
+	affper(retVal);
+
+	return retVal;
 }
 
 
@@ -1022,7 +1070,7 @@ void inzon() {
 	g_s._secretPassageObjectId = 0;
 	g_s._purpleRoomObjectId = 136;
 	g_s._cryptObjectId = 141;
-	g_s._conf  = getRandomNumber(4, 10);
+	g_s._faithScore = getRandomNumber(4, 10);
 	g_s._currPlace = MANOR_FRONT;
 
 	for (int cx = 2; cx <= 6; ++cx)
@@ -1072,7 +1120,7 @@ void pl1(int cf) {
 		if (rand > p)
 			person();
 		else
-			quelq1(g_li);
+			setPresenceGreenRoom(g_li);
 	}
 }
 
@@ -1085,7 +1133,7 @@ void pl2(int cf) {
 		if (rand > p)
 			person();
 		else
-			quelq2();
+			setPresencePurpleRoom();
 	}
 }
 
@@ -1098,7 +1146,7 @@ void pl5(int cf) {
 		if (rand > p)
 			person();
 		else
-			quelq5();
+			setPresenceBlueRoom();
 	}
 }
 
@@ -1111,7 +1159,7 @@ void pl6(int cf) {
 		if (rand > p)
 			person();
 		else
-			quelq6(g_li);
+			setPresenceRedRoom(g_li);
 	}
 }
 
@@ -1124,7 +1172,7 @@ void pl9(int cf) {
 		if (rand > p)
 			person();
 		else
-			quelq2();
+			setPresencePurpleRoom();
 	}
 }
 
@@ -1136,7 +1184,7 @@ void pl10(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq10(h, p);
+		p = setPresenceDiningRoom(h);
 }
 
 void pl11(int cf) {
@@ -1147,7 +1195,7 @@ void pl11(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq11(h, p);
+		p = setPresenceBureau(h);
 }
 
 void pl12(int cf) {
@@ -1158,7 +1206,7 @@ void pl12(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq12(p);
+		p = setPresenceKitchen();
 }
 
 void pl13(int cf) {
@@ -1169,7 +1217,7 @@ void pl13(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq12(p);
+		p = setPresenceKitchen();
 }
 
 void pl15(int cf) {
@@ -1180,7 +1228,7 @@ void pl15(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq15(p);
+		p = setPresenceLanding();
 }
 
 void pl20(int cf) {
@@ -1191,13 +1239,13 @@ void pl20(int cf) {
 	if (rand > p)
 		person();
 	else
-		quelq20(h, p);
+		p = setPresenceChapel(h);
 }
 
 void t11(int l11, int &a) {
 	int p, rand;
 
-	ecfren(p, rand, g_s._conf, l11);
+	ecfren(p, rand, g_s._faithScore, l11);
 	g_li = l11;
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
@@ -1229,22 +1277,22 @@ void t11(int l11, int &a) {
 				cpl15(p);
 			if (l11 == 20)
 				cpl20(p, h);
-			p += g_s._conf;
+			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
 				person();
 				a = 0;
 			} else {
 				if (l11 == 10)
-					quelq10(h, p);
+					p = setPresenceDiningRoom(h);
 				if (l11 == 11)
-					quelq11(h, p);
+					p = setPresenceBureau(h);
 				if ((l11 == 12) || (l11 == 13) || (l11 == 14))
-					quelq12(p);
+					p = setPresenceKitchen();
 				if ((l11 == 15) || (l11 == 26))
-					quelq15(p);
+					p = setPresenceLanding();
 				if (l11 == 20)
-					quelq20(h, p);
+					p = setPresenceChapel(h);
 				a = p;
 			}
 		}
@@ -1252,9 +1300,9 @@ void t11(int l11, int &a) {
 }
 
 void cavegre() {
-	g_s._conf += 2;
-	if (g_s._conf > 69)
-		g_s._conf += (g_s._conf / 10);
+	g_s._faithScore += 2;
+	if (g_s._faithScore > 69)
+		g_s._faithScore += (g_s._faithScore / 10);
 	clsf3();
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 87238c4..14172c7 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -80,15 +80,15 @@ extern void cpl12(int &p);
 extern void cpl13(int &p);
 extern void cpl15(int &p);
 extern void cpl20(int &p, int &h);
-extern void quelq1(int l);
-extern void quelq2();
-extern void quelq5();
-extern void quelq6(int l);
-extern void quelq10(int h, int &per);
-extern void quelq11(int h, int &per);
-extern void quelq12(int &per);
-extern void quelq15(int &per);
-extern void quelq20(int h, int &per);
+extern void setPresenceGreenRoom(int l);
+extern void setPresencePurpleRoom();
+extern void setPresenceBlueRoom();
+extern void setPresenceRedRoom(int l);
+extern int setPresenceDiningRoom(int h);
+extern int setPresenceBureau(int h);
+extern int setPresenceKitchen();
+extern int setPresenceLanding();
+extern int setPresenceChapel(int h);
 extern void frap();
 extern void nouvp(int l, int &p);
 extern void tip(int ip, int &cx);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 28692ea..a35a4e9 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -101,7 +101,7 @@ void tinke() {
 			g_t = ti2;
 		else
 			g_t = ti1;
-		cf = g_s._conf;
+		cf = g_s._faithScore;
 		if ((cf > 33) && (cf < 66))
 			g_t -= (g_t / 3);
 
@@ -313,10 +313,10 @@ void tperd() {
 void tsort() {
 
 	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
-		if (g_s._conf < 50)
-			g_s._conf += 2;
+		if (g_s._faithScore < 50)
+			g_s._faithScore += 2;
 		else
-			g_s._conf += (g_s._conf / 10);
+			g_s._faithScore += (g_s._faithScore / 10);
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
@@ -573,11 +573,11 @@ L1:
 			parole(4, 4, 1);
 
 		if (g_iouv == 0)
-			g_s._conf += 2;
-		else if (g_s._conf < 50)
-			g_s._conf += 4;
+			g_s._faithScore += 2;
+		else if (g_s._faithScore < 50)
+			g_s._faithScore += 4;
 		else
-			g_s._conf += 3 * (g_s._conf / 10);
+			g_s._faithScore += 3 * (g_s._faithScore / 10);
 		tsort();
 		tmlieu(15);
 		int cx;
@@ -625,7 +625,7 @@ void tsuiv() {
 		g_caff = tbcl;
 		g_crep = g_caff + 400;
 		if (g_ipers != 0)
-			g_s._conf += 2;
+			g_s._faithScore += 2;
 	} else {
 		affrep();
 		endSearch();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 46bde5e..078813b 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -228,14 +228,14 @@ void tsitu() {
 	calch(j, h, m);
 	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._currPlace != 10)) ||
 	        ((h > 0) && (h < 6) && (g_s._currPlace != 0)))
-		++g_s._conf;
+		++g_s._faithScore;
 	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
 	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
-		if ((g_s._conf > 99) && (h > 8) && (h < 16)) {
+		if ((g_s._faithScore > 99) && (h > 8) && (h < 16)) {
 			g_crep = 1501;
 			tperd();
 		}
-		if ((g_s._conf > 99) && (h > 0) && (h < 9)) {
+		if ((g_s._faithScore > 99) && (h > 0) && (h < 9)) {
 			g_crep = 1508;
 			tperd();
 		}
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 386fd95..a53d218 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -49,7 +49,7 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
  * Handle saving or loading savegame data
  */
 void SavegameManager::sync_save(Common::Serializer &sz) {
-	sz.syncAsSint16LE(g_s1._conf);
+	sz.syncAsSint16LE(g_s1._faithScore);
 	sz.syncBytes((byte *)&g_s1._pourc[0], 11);
 	sz.syncBytes((byte *)&g_s1._teauto[0], 43);
 	sz.syncBytes((byte *)&g_s1._sjer[0], 31);
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 8c66143..11bc4e0 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -161,7 +161,7 @@ enum places {
 };
 
 struct sav_chaine {
-	int _conf;
+	int _faithScore;
 	byte _pourc[11];
 	byte _teauto[43];
 	byte _sjer[31];


Commit: 03ed51482032bd266323b9cff193e7f656f7bbb8
    https://github.com/scummvm/scummvm/commit/03ed51482032bd266323b9cff193e7f656f7bbb8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:42-07:00

Commit Message:
MORTEVIELLE: Properly implement transparency when drawing images

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index ce02915..775075c 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -83,6 +83,8 @@ void PaletteManager::setDefaultPalette() {
 
 void GfxSurface::decode(const byte *pSrc) {
 	_width = _height = 0;
+	// If no transparency, use invalid (for EGA) palette index of 16. Otherwise get index to use
+	_transparency = (*pSrc == 0) ? 16 : *(pSrc + 2);
 	bool offsetFlag = *pSrc++ == 0;
 	int entryCount = *pSrc++;
 	pSrc += 2;
@@ -114,7 +116,7 @@ void GfxSurface::decode(const byte *pSrc) {
 
 	// Temporary output buffer
 	byte outputBuffer[65536];
-	Common::fill(&outputBuffer[0], &outputBuffer[65536], 0);
+	Common::fill(&outputBuffer[0], &outputBuffer[65536], _transparency);
 
 	byte *pDest = &outputBuffer[0];
 	const byte *pSrcStart = pSrc;
@@ -922,15 +924,20 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		byte *pDest = (byte *)destSurface.getBasePtr(0, yp * 2);
 
 		for (int xp = 0; xp < surface.w; ++xp, ++pSrc) {
-			// Draw the pixel using the specified index in the palette map
-			*pDest = paletteMap[*pSrc * 2];
-			*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2];
-			++pDest;
+			if (*pSrc == surface._transparency) {
+				// Transparent point, so skip pixels
+				pDest += 2;
+			} else {
+				// Draw the pixel using the specified index in the palette map
+				*pDest = paletteMap[*pSrc * 2];
+				*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2];
+				++pDest;
 
-			// Use the secondary mapping value to draw the secondary column pixel
-			*pDest = paletteMap[*pSrc * 2 + 1];
-			*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2 + 1];
-			++pDest;
+				// Use the secondary mapping value to draw the secondary column pixel
+				*pDest = paletteMap[*pSrc * 2 + 1];
+				*(pDest + SCREEN_WIDTH) = paletteMap[*pSrc * 2 + 1];
+				++pDest;
+			}
 		}
 	}
 }
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 28a9d64..253b708 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -67,6 +67,8 @@ private:
 public:
 	// Specifies offset when drawing the image
 	Common::Point _offset;
+	// Transparency palette index
+	int _transparency;
 public:
 	~GfxSurface();
 


Commit: 07956b0aa9b115cab4dbc60a9755c0be923bd82d
    https://github.com/scummvm/scummvm/commit/07956b0aa9b115cab4dbc60a9755c0be923bd82d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:43-07:00

Commit Message:
MORTEVIELLE: Bugfixes for correctly displaying people present in a room

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 22c12d6..01dd5b4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -709,7 +709,7 @@ void fctPlace() {
 						tinke();
 						drawClock();
 						if (g_ipers != 0)
-							affper(g_ipers);
+							showPeoplePresent(g_ipers);
 						else 
 							person();
 
@@ -1523,7 +1523,7 @@ void fctDiscuss() {
 	hirs();
 	dessine_rouleau();
 	showMouse();
-	affper(g_ipers);
+	showPeoplePresent(g_ipers);
 	tinke();
 	drawClock();
 	affrep();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 82d0ef1..e2a7fac 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -247,12 +247,7 @@ void clsf10() {
 	g_vm->_screenSurface.putxy(co, 92);
 	g_vm->_screenSurface.writeg(st, 4);
 
-	if (g_res == 1)
-		co = 620;
-	else
-		co = 584;
-
-	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, co, 86));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
 	/* rempli(69,12,32,5,255);*/
 	showMouse();
 }
@@ -412,49 +407,54 @@ void t5(int cx) {
 		g_bh9 = false;
 }
 
-void affper(int per) {
+/**
+ * Engine function - Show the people present in the given room 
+ * @remarks	Originally called 'affper'
+ */
+void showPeoplePresent(int per) {
 	int cx;
+	int xp = 580 - (g_vm->_screenSurface.getStringWidth("LEO") / 2);
 
 	for (cx = 1; cx <= 8; ++cx)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cx]);
 	clsf10();
 	if ((per & 128) == 128) {
-		g_vm->_screenSurface.putxy(560, 24);
+		g_vm->_screenSurface.putxy(xp, 24);
 		g_vm->_screenSurface.writeg("LEO", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[1]);
 	}
 	if ((per & 64) == 64) {
-		g_vm->_screenSurface.putxy(560, 32);
+		g_vm->_screenSurface.putxy(xp, 32);
 		g_vm->_screenSurface.writeg("PAT", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[2]);
 	}
 	if ((per & 32) == 32) {
-		g_vm->_screenSurface.putxy(560, 40);
+		g_vm->_screenSurface.putxy(xp, 40);
 		g_vm->_screenSurface.writeg("GUY", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[3]);
 	}
 	if ((per & 16) == 16) {
-		g_vm->_screenSurface.putxy(560, 48);
+		g_vm->_screenSurface.putxy(xp, 48);
 		g_vm->_screenSurface.writeg("EVA", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[4]);
 	}
 	if ((per & 8) == 8) {
-		g_vm->_screenSurface.putxy(560, 56);
+		g_vm->_screenSurface.putxy(xp, 56);
 		g_vm->_screenSurface.writeg("BOB", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[5]);
 	}
 	if ((per & 4) == 4) {
-		g_vm->_screenSurface.putxy(560, 64);
+		g_vm->_screenSurface.putxy(xp, 64);
 		g_vm->_screenSurface.writeg("LUC", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[6]);
 	}
 	if ((per & 2) == 2) {
-		g_vm->_screenSurface.putxy(560, 72);
+		g_vm->_screenSurface.putxy(xp, 72);
 		g_vm->_screenSurface.writeg("IDA", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[7]);
 	}
 	if ((per & 1) == 1) {
-		g_vm->_screenSurface.putxy(560, 80);
+		g_vm->_screenSurface.putxy(xp, 80);
 		g_vm->_screenSurface.writeg("MAX", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
 	}
@@ -828,7 +828,7 @@ int setPresenceDiningRoom(int h) {
 		}
 		choix(min, max, retVal);
 	}
-	affper(retVal);
+	showPeoplePresent(retVal);
 
 	return retVal;
 }
@@ -856,7 +856,7 @@ int setPresenceBureau(int h) {
 		}
 		choix(min, max, retVal);
 	}
-	affper(retVal);
+	showPeoplePresent(retVal);
 
 	return retVal;
 }
@@ -867,7 +867,7 @@ int setPresenceBureau(int h) {
  */
 int setPresenceKitchen() {
 	int retVal = chlm();
-	affper(retVal);
+	showPeoplePresent(retVal);
 
 	return retVal;
 }
@@ -893,7 +893,7 @@ int setPresenceLanding() {
 
 	int retVal = 0;
 	conv(rand, retVal);
-	affper(retVal);
+	showPeoplePresent(retVal);
 
 	return retVal;
 }
@@ -921,7 +921,7 @@ int setPresenceChapel(int h) {
 		}
 		choix(min, max, retVal);
 	}
-	affper(retVal);
+	showPeoplePresent(retVal);
 
 	return retVal;
 }
@@ -965,7 +965,7 @@ void nouvp(int l, int &p) {
 		p = 9;
 
 	if (p != 9)
-		affper(p);
+		showPeoplePresent(p);
 }
 
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 14172c7..514bd73 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -60,7 +60,7 @@ extern void conv(int x, int &y);
 extern void modobj(int m);
 extern void repon(int f, int m);
 extern void t5(int cx);
-extern void affper(int per);
+extern void showPeoplePresent(int per);
 extern void choix(int min, int max, int &per);
 extern void cpl1(int &p);
 extern void cpl2(int &p);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index a35a4e9..25793c8 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -490,7 +490,7 @@ void t1sama() {    //Entering manor
 			st1sama();
 	} else if (!g_s._ipre) {     //Is it your first time?
 		g_ipers = 255;
-		affper(g_ipers);
+		showPeoplePresent(g_ipers);
 		g_caff = 77;
 		afdes(0);
 		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 078813b..606b417 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -53,7 +53,7 @@ void changeGraphicalDevice(int newDevice) {
 	tinke();
 	drawClock();
 	if (g_ipers != 0)
-		affper(g_ipers);
+		showPeoplePresent(g_ipers);
 	else
 		person();
 	clsf2();


Commit: d0a9014cd44ca7256876b284ad9703d276d8867a
    https://github.com/scummvm/scummvm/commit/d0a9014cd44ca7256876b284ad9703d276d8867a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:45-07:00

Commit Message:
MORTEVIELLE: Bugfix to ignore previous mouse click when waiting in tkey1

Changed paths:
    engines/mortevielle/mor2.cpp



diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 25793c8..c98b399 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -220,9 +220,16 @@ void tkey1(bool d) {
 
 	hideMouse();
 	fenat('K');
+
+	// Wait for release from any key or mouse button
 	while (keypressed())
 		g_key = testou();
-
+	do {
+		getMousePos(x, y, c);
+		keypressed();
+	} while (c != 0);
+	
+	// Event loop
 	do {
 		if (d)
 			tinke();


Commit: ba1a5b286efe549d73797c488e3dd183fa039bdd
    https://github.com/scummvm/scummvm/commit/ba1a5b286efe549d73797c488e3dd183fa039bdd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:46-07:00

Commit Message:
MORTEVIELLE: Added extra width to the Self menu for the English version

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 3abe06a..b60c70b 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -295,6 +295,10 @@ void Menu::menuDown(int ii) {
 	else
 		cx = 6;
 	xcc = xco + (g_menuConstants[ii - 1][2] * cx) + 6;
+	if ((ii == 4) && (g_vm->getLanguage() == Common::EN_ANY))
+		// Extra width needed for Self menu in English version
+		xcc = 435;
+
 	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (g_menuConstants[ii - 1][1] << 1)));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (g_menuConstants[ii - 1][1] << 1)));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (g_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (g_menuConstants[ii - 1][1] << 1)));


Commit: 7056467e1495ff9bafdc2c1ad2f470e89d5223fa
    https://github.com/scummvm/scummvm/commit/7056467e1495ff9bafdc2c1ad2f470e89d5223fa
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:48-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 01dd5b4..0bcfd67 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -711,7 +711,7 @@ void fctPlace() {
 						if (g_ipers != 0)
 							showPeoplePresent(g_ipers);
 						else 
-							person();
+							displayAloneText();
 
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
@@ -1063,7 +1063,7 @@ void fctListen() {
 				else {
 					becfren(l);
 					int j, h, m;
-					calch(j, h, m);
+					updateHour(j, h, m);
 					rand = getRandomNumber(1, 100);
 					if ((h >= 0) && (h < 8)) {
 						if (rand > 30)
@@ -1096,7 +1096,7 @@ void fctEat() {
 		tmlieu(g_s._currPlace);
 
 		int j, h, m;
-		calch(j, h, m);
+		updateHour(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
 			g_s._faithScore -= (g_s._faithScore / 7);
 			if (h == 12) {
@@ -1204,7 +1204,7 @@ void fctSleep() {
 	clsf2();
 	ecrf2();
 	ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
-	calch(j, h, m);
+	updateHour(j, h, m);
 
 	int answer;
 	do {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e2a7fac..ef5800e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -269,17 +269,21 @@ void paint_rect(int x, int y, int dx, int dy) {
 	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
-void calch(int &j, int &h, int &m) {
-	int nh = readclock();
-	int th = g_jh + ((nh - g_mh) / g_t);
-	m = ((th % 2) + g_vm__) * 30;
-	h = ((uint)th >> 1) + g_vh;
-	if (m == 60) {
-		m = 0;
-		h = h + 1;
+/**
+ * Engine function - Update hour
+ * @remarks	Originally called 'calch'
+ */
+void updateHour(int &day, int &hour, int &minute) {
+	int newHour = readclock();
+	int th = g_jh + ((newHour - g_mh) / g_t);
+	minute = ((th % 2) + g_vm__) * 30;
+	hour = ((uint)th >> 1) + g_vh;
+	if (minute == 60) {
+		minute = 0;
+		++hour;
 	}
-	j = (h / 24) + g_vj;
-	h = h - ((j - g_vj) * 24);
+	day = (hour / 24) + g_vj;
+	hour = hour - ((day - g_vj) * 24);
 }
 
 void conv(int x, int &y) {
@@ -486,90 +490,106 @@ void choix(int min, int max, int &per) {
 		per = 255 - per;
 }
 
-void cpl1(int &p) {
-	int j, h, m;
+int cpl1() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
+	updateHour(day, hour, minute);
 	// The original uses an || instead of an &&, resulting 
 	// in an always true condition. Based on the other tests, 
 	// and on other scenes, we use an && instead.
-	// if ((h > 7) || (h < 11))
-	if ((h > 7) && (h < 11))
-		p = 25;
-	else if ((h > 10) && (h < 14))
-		p = 35;
-	else if ((h > 13) && (h < 16))
-		p = 50;
-	else if ((h > 15) && (h < 18))
-		p = 5;
-	else if ((h > 17) && (h < 22))
-		p = 35;
-	else if ((h > 21) && (h < 24))
-		p = 50;
-	else if ((h >= 0) && (h < 8))
-		p = 70;
+	if ((hour > 7) && (hour < 11))
+		retVal = 25;
+	else if ((hour > 10) && (hour < 14))
+		retVal = 35;
+	else if ((hour > 13) && (hour < 16))
+		retVal = 50;
+	else if ((hour > 15) && (hour < 18))
+		retVal = 5;
+	else if ((hour > 17) && (hour < 22))
+		retVal = 35;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 50;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 70;
 
 	g_vm->_menu.mdn();
+
+	return retVal;
 }
 
-void cpl2(int &p) {
-	int j, h, m;
+int cpl2() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if ((h > 7) && (h < 11))
-		p = -2;
-	if (h == 11)
-		p = 100;
-	if ((h > 11) && (h < 23))
-		p = 10;
-	if (h == 23)
-		p = 20;
-	if ((h >= 0) && (h < 8))
-		p = 50;
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 11))
+		retVal = -2;
+	else if (hour == 11)
+		retVal = 100;
+	else if ((hour > 11) && (hour < 23))
+		retVal = 10;
+	else if (hour == 23)
+		retVal = 20;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 50;
+	
+	return retVal;
 }
 
-void cpl3(int &p) {
-	int j, h, m;
+int cpl3() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if (((h > 8) && (h < 10)) || ((h > 19) && (h < 24)))
-		p = 34;
-	if (((h > 9) && (h < 20)) || ((h >= 0) && (h < 9)))
-		p = 0;
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
+		retVal = 34;
+	else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
+		retVal = 0;
+
+	return retVal;
 }
 
-void cpl5(int &p) {
-	int j, h, m;
+int cpl5() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if ((h > 6) && (h < 10))
-		p = 0;
-	if (h == 10)
-		p = 100;
-	if ((h > 10) && (h < 24))
-		p = 15;
-	if ((h >= 0) && (h < 7))
-		p = 50;
+	updateHour(day, hour, minute);
+	if ((hour > 6) && (hour < 10))
+		retVal = 0;
+	else if (hour == 10)
+		retVal = 100;
+	else if ((hour > 10) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 7))
+		retVal = 50;
+
+	return retVal;
 }
 
-void cpl6(int &p) {
-	int j, h, m;
+int cpl6() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if (((h > 7) && (h < 13)) || ((h > 17) && (h < 20)))
-		p = -2;
-	if (((h > 12) && (h < 17)) || ((h > 19) && (h < 24)))
-		p = 35;
-	if (h == 17)
-		p = 100;
-	if ((h >= 0) && (h < 8))
-		p = 60;
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
+		retVal = -2;
+	else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
+		retVal = 35;
+	else if (hour == 17)
+		retVal = 100;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 60;
+
+	return retVal;
 }
 
 /**
- * Shows the you are alone message in the status area on the right hand side of the screen
+ * Shows the "you are alone" message in the status area
+ * on the right hand side of the screen
+ * @remarks	Originally called 'person'
  */
-void person() {
+void displayAloneText() {
 	for (int cf = 1; cf <= 8; ++cf)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cf]);
 
@@ -660,89 +680,95 @@ void debloc(int l) {
 	g_mpers = g_ipers;
 }
 
-void cpl10(int &p, int &h) {
-	int j, m;
+void cpl10(int &p, int &hour) {
+	int day, minute;
 
-	calch(j, h, m);
-	if (((h > 7) && (h < 11)) || ((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
 		p = 100;
-	if ((h == 11) || ((h > 20) && (h < 24)))
+	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
 		p = 45;
-	if (((h > 13) && (h < 17)) || (h == 18))
+	else if (((hour > 13) && (hour < 17)) || (hour == 18))
 		p = 35;
-	if (h == 17)
+	else if (hour == 17)
 		p = 60;
-	if ((h >= 0) && (h < 8))
+	else if ((hour >= 0) && (hour < 8))
 		p = 5;
 }
 
-void cpl11(int &p, int &h) {
-	int j, m;
+void cpl11(int &p, int &hour) {
+	int day, minute;
 
-	calch(j, h, m);
-	if (((h > 8) && (h < 12)) || ((h > 20) && (h < 24)))
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
 		p = 25;
-	if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21)))
+	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
 		p = 5;
-	if ((h > 13) && (h < 17))
+	else if ((hour > 13) && (hour < 17))
 		p = 55;
-	if ((h > 16) && (h < 19))
+	else if ((hour > 16) && (hour < 19))
 		p = 45;
-	if ((h >= 0) && (h < 9))
+	else if ((hour >= 0) && (hour < 9))
 		p = 0;
 }
 
-void cpl12(int &p) {
-	int j, h, m;
+int cpl12() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if (((h > 8) && (h < 15)) || ((h > 16) && (h < 22)))
-		p = 55;
-	if (((h > 14) && (h < 17)) || ((h > 21) && (h < 24)))
-		p = 25;
-	if ((h >= 0) && (h < 5))
-		p = 0;
-	if ((h > 4) && (h < 9))
-		p = 15;
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
+		retVal = 55;
+	else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
+		retVal = 25;
+	else if ((hour >= 0) && (hour < 5))
+		retVal = 0;
+	else if ((hour > 4) && (hour < 9))
+		retVal = 15;
+
+	return retVal;
 }
 
-void cpl13(int &p) {
-	p = 0;
+int cpl13() {
+	return 0;
 }
 
-void cpl15(int &p) {
-	int j, h, m;
+int cpl15() {
+	int day, hour, minute;
+	int retVal = 0;
 
-	calch(j, h, m);
-	if ((h > 7) && (h < 12))
-		p = 25;
-	else if ((h > 11) && (h < 14))
-		p = 0;
-	else if ((h > 13) && (h < 18))
-		p = 10;
-	else if ((h > 17) && (h < 20))
-		p = 55;
-	else if ((h > 19) && (h < 22))
-		p = 5;
-	else if ((h > 21) && (h < 24))
-		p = 15;
-	else if ((h >= 0) && (h < 8))
-		p = -15;
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 12))
+		retVal = 25;
+	else if ((hour > 11) && (hour < 14))
+		retVal = 0;
+	else if ((hour > 13) && (hour < 18))
+		retVal = 10;
+	else if ((hour > 17) && (hour < 20))
+		retVal = 55;
+	else if ((hour > 19) && (hour < 22))
+		retVal = 5;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = -15;
+
+	return retVal;
 }
 
-void cpl20(int &p, int &h) {
-	int j, m;
+void cpl20(int &p, int &hour) {
+	int day, minute;
 
-	calch(j, h, m);
-	if (h == 10)
+	updateHour(day, hour, minute);
+	if (hour == 10)
 		p = 65;
-	else if ((h > 10) && (h < 21))
+	else if ((hour > 10) && (hour < 21))
 		p = 5;
-	else if ((h > 20) && (h < 24))
+	else if ((hour > 20) && (hour < 24))
 		p = -15;
-	else if ((h >= 0) && (h < 5))
+	else if ((hour >= 0) && (hour < 5))
 		p = -300;
-	else if ((h > 4) && (h < 10))
+	else if ((hour > 4) && (hour < 10))
 		p = -5;
 }
 
@@ -806,23 +832,23 @@ void setPresenceRedRoom(int l) {
  * Engine function - Check who is in the Dining Room
  * @remarks	Originally called 'quelq10'
  */
-int setPresenceDiningRoom(int h) {
+int setPresenceDiningRoom(int hour) {
 	int retVal = 0;
 
-	if ((h >= 0) && (h < 8))
+	if ((hour >= 0) && (hour < 8))
 		retVal = chlm();
 	else {
 		int min = 0, max = 0;
-		if ((h > 7) && (h < 10)) {
+		if ((hour > 7) && (hour < 10)) {
 			min = 5;
 			max = 7;
-		} else if ((h > 9) && (h < 12)) {
+		} else if ((hour > 9) && (hour < 12)) {
 			min = 1;
 			max = 4;
-		} else if (((h > 11) && (h < 15)) || ((h > 18) && (h < 21))) {
+		} else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
 			min = 6;
 			max = 8;
-		} else if (((h > 14) && (h < 19)) || ((h > 20) && (h < 24))) {
+		} else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
 			min = 1;
 			max = 5;
 		}
@@ -837,20 +863,20 @@ int setPresenceDiningRoom(int h) {
  * Engine function - Check who is in the Bureau
  * @remarks	Originally called 'quelq11'
  */
-int setPresenceBureau(int h) {
+int setPresenceBureau(int hour) {
 	int retVal = 0;
 
-	if ((h >= 0) && (h < 8))
+	if ((hour >= 0) && (hour < 8))
 		retVal = chlm();
 	else {
 		int min = 0, max = 0;
-		if (((h > 7) && (h < 10)) || ((h > 20) && (h < 24))) {
+		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
 			min = 1;
 			max = 3;
-		} else if (((h > 9) && (h < 12)) || ((h > 13) && (h < 19))) {
+		} else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
 			min = 1;
 			max = 4;
-		} else if (((h > 11) && (h < 14)) || ((h > 18) && (h < 21))) {
+		} else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
 			min = 1;
 			max = 2;
 		}
@@ -902,20 +928,20 @@ int setPresenceLanding() {
  * Engine function - Check who is in the chapel
  * @remarks	Originally called 'quelq20'
  */
-int setPresenceChapel(int h) {
+int setPresenceChapel(int hour) {
 	int retVal = 0;
 
-	if (((h >= 0) && (h < 10)) || ((h > 18) && (h < 24)))
+	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
 		retVal = chlm();
 	else {
 		int min = 0, max = 0;
-		if ((h > 9) && (h < 12)) {
+		if ((hour > 9) && (hour < 12)) {
 			min = 3;
 			max = 7;
-		} else if ((h > 11) && (h < 18)) {
+		} else if ((hour > 11) && (hour < 18)) {
 			min = 1;
 			max = 2;
-		} else if (h == 18) {
+		} else if (hour == 18) {
 			min = 2;
 			max = 4;
 		}
@@ -928,10 +954,10 @@ int setPresenceChapel(int h) {
 
 
 void frap() {
-	int j, h, m;
+	int day, hour, minute;
 
-	calch(j, h, m);
-	if ((h >= 0) && (h < 8))
+	updateHour(day, hour, minute);
+	if ((hour >= 0) && (hour < 8))
 		g_crep = 190;
 	else {
 		if (getRandomNumber(1, 100) > 70)
@@ -992,25 +1018,25 @@ void tip(int ip, int &cx) {
 
 void ecfren(int &p, int &rand, int cf, int l) {
 	if (l == 0)
-		person();
+		displayAloneText();
 	p = -500;
 	rand = 0;
 	if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
-		cpl1(p);
+		p = cpl1();
 	if ((l == 2) && (!g_bh2) && (!g_bh9))
-		cpl2(p);
+		p = cpl2();
 	if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
-		cpl3(p);
+		p = cpl3();
 	if ((l == 5) && (!g_bh5))
-		cpl5(p);
+		p = cpl5();
 	if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
-		cpl6(p);
+		p = cpl6();
 	if ((l == 9) && (!g_bh9) && (!g_bh2))
 		p = 10;
 	if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
 		p = -400;
 	if (p != -500) {
-		p = p + cf;
+		p += cf;
 		rand = getRandomNumber(1, 100);
 	}
 }
@@ -1113,12 +1139,12 @@ void dprog() {
 
 void pl1(int cf) {
 	if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
-		int p, rand;
-		cpl1(p);
+		int p = cpl1();
+		int rand;
 		phaz(rand, p, cf);
 
 		if (rand > p)
-			person();
+			displayAloneText();
 		else
 			setPresenceGreenRoom(g_li);
 	}
@@ -1126,12 +1152,12 @@ void pl1(int cf) {
 
 void pl2(int cf) {
 	if (!g_bh2) {
-		int p, rand;
-		cpl2(p);
+		int p = cpl2();
+		int rand;
 		phaz(rand, p, cf);
 
 		if (rand > p)
-			person();
+			displayAloneText();
 		else
 			setPresencePurpleRoom();
 	}
@@ -1139,12 +1165,13 @@ void pl2(int cf) {
 
 void pl5(int cf) {
 	if (!g_bh5) {
-		int p, rand;
-		cpl5(p);
+		int p = cpl5();
+		int rand;
+
 		phaz(rand, p, cf);
 
 		if (rand > p)
-			person();
+			displayAloneText();
 		else
 			setPresenceBlueRoom();
 	}
@@ -1152,12 +1179,13 @@ void pl5(int cf) {
 
 void pl6(int cf) {
 	if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
-		int p, rand;
-		cpl6(p);
+		int p = cpl6();
+		int rand;
+
 		phaz(rand, p, cf);
 
 		if (rand > p)
-			person();
+			displayAloneText();
 		else
 			setPresenceRedRoom(g_li);
 	}
@@ -1170,7 +1198,7 @@ void pl9(int cf) {
 		phaz(rand, p, cf);
 
 		if (rand > p)
-			person();
+			displayAloneText();
 		else
 			setPresencePurpleRoom();
 	}
@@ -1182,9 +1210,9 @@ void pl10(int cf) {
 	phaz(rand, p, cf);
 
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceDiningRoom(h);
+		setPresenceDiningRoom(h);
 }
 
 void pl11(int cf) {
@@ -1193,42 +1221,42 @@ void pl11(int cf) {
 	cpl11(p, h);
 	phaz(rand, p, cf);
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceBureau(h);
+		setPresenceBureau(h);
 }
 
 void pl12(int cf) {
 	int p, rand;
 
-	cpl12(p);
+	p = cpl12();
 	phaz(rand, p, cf);
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceKitchen();
+		setPresenceKitchen();
 }
 
 void pl13(int cf) {
 	int p, rand;
 
-	cpl13(p);
+	p = cpl13();
 	phaz(rand, p, cf);
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceKitchen();
+		setPresenceKitchen();
 }
 
 void pl15(int cf) {
 	int p, rand;
 
-	cpl15(p);
+	p = cpl15();
 	phaz(rand, p, cf);
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceLanding();
+		setPresenceLanding();
 }
 
 void pl20(int cf) {
@@ -1237,9 +1265,9 @@ void pl20(int cf) {
 	cpl20(p, h);
 	phaz(rand, p, cf);
 	if (rand > p)
-		person();
+		displayAloneText();
 	else
-		p = setPresenceChapel(h);
+		setPresenceChapel(h);
 }
 
 void t11(int l11, int &a) {
@@ -1250,7 +1278,7 @@ void t11(int l11, int &a) {
 	if ((l11 > 0) && (l11 < 10)) {
 		if (p != -500) {
 			if (rand > p) {
-				person();
+				displayAloneText();
 				a = 0;
 			} else {
 				becfren(g_li);
@@ -1262,36 +1290,36 @@ void t11(int l11, int &a) {
 
 	if (l11 > 9) {
 		if ((l11 > 15) && (l11 != 20) && (l11 != 26))
-			person();
+			displayAloneText();
 		else {
 			int h = 0;
 			if (l11 == 10)
 				cpl10(p, h);
-			if (l11 == 11)
+			else if (l11 == 11)
 				cpl11(p, h);
-			if (l11 == 12)
-				cpl12(p);
-			if ((l11 == 13) || (l11 == 14))
-				cpl13(p);
-			if ((l11 == 15) || (l11 == 26))
-				cpl15(p);
-			if (l11 == 20)
+			else if (l11 == 12)
+				p = cpl12();
+			else if ((l11 == 13) || (l11 == 14))
+				p = cpl13();
+			else if ((l11 == 15) || (l11 == 26))
+				p = cpl15();
+			else if (l11 == 20)
 				cpl20(p, h);
 			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
-				person();
+				displayAloneText();
 				a = 0;
 			} else {
 				if (l11 == 10)
 					p = setPresenceDiningRoom(h);
-				if (l11 == 11)
+				else if (l11 == 11)
 					p = setPresenceBureau(h);
-				if ((l11 == 12) || (l11 == 13) || (l11 == 14))
+				else if ((l11 == 12) || (l11 == 13) || (l11 == 14))
 					p = setPresenceKitchen();
-				if ((l11 == 15) || (l11 == 26))
+				else if ((l11 == 15) || (l11 == 26))
 					p = setPresenceLanding();
-				if (l11 == 20)
+				else if (l11 == 20)
 					p = setPresenceChapel(h);
 				a = p;
 			}
@@ -1313,7 +1341,7 @@ void cavegre() {
 	// It has been removed
 
 	clsf3();
-	person();
+	displayAloneText();
 }
 
 void writetp(Common::String s, int t) {
@@ -1329,8 +1357,7 @@ void aniof(int ouf, int num) {
 	
 	if ((g_caff == 10) && (num == 7))
 		num = 6;
-
-	if (g_caff == 12) {
+	else if (g_caff == 12) {
 		if (num == 3)
 			num = 4;
 		else if (num == 4)
@@ -1362,24 +1389,23 @@ void musique(int so) {
 				i = true;
 			}
 		}
-		if (g_s._currPlace == CHAPEL) {
+		else if (g_s._currPlace == CHAPEL) {
 			if (getRandomNumber(1, 2) == 1) {
 				parole(8, 1, 1);
 				i = true;
 			}
 		}
-
-		if (g_s._currPlace == WELL) {
+		else if (g_s._currPlace == WELL) {
 			if (getRandomNumber(1, 2) == 2) {
 				parole(12, 1, 1);
 				i = true;
 			}
 		}
-
-		if (g_s._currPlace == 23) {
+		else if (g_s._currPlace == 23) {
 			parole(13, 1, 1);
 			i = true;
 		}
+
 		if (!i)
 			parole(getRandomNumber(1, 17), 1, 2);
 	}
@@ -1412,14 +1438,11 @@ void dessin(int ad) {
 
 					if (g_s._atticRodHoleObjectId == 159)
 						aniof(1, 6);
-				}
-				if ((g_caff == 14) && (g_s._cellarObjectId == 151))
+				} else if ((g_caff == 14) && (g_s._cellarObjectId == 151))
 					aniof(1, 2);
-
-				if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
+				else if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
 					aniof(1, 1);
-
-				if ((g_caff == 24) && (g_s._wellObjectId != 0))
+				else if ((g_caff == 24) && (g_s._wellObjectId != 0))
 					aniof(1, 1);
 			}
 			
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 514bd73..066392c 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -54,7 +54,7 @@ extern void ecrf7();
 extern void clsf10();
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
-extern void calch(int &j, int &h, int &m);
+extern void updateHour(int &day, int &hour, int &minute);
 extern void conv(int x, int &y);
 /* NIVEAU 12 */
 extern void modobj(int m);
@@ -62,33 +62,33 @@ extern void repon(int f, int m);
 extern void t5(int cx);
 extern void showPeoplePresent(int per);
 extern void choix(int min, int max, int &per);
-extern void cpl1(int &p);
-extern void cpl2(int &p);
-extern void cpl3(int &p);
-extern void cpl5(int &p);
-extern void cpl6(int &p);
-extern void person();
+extern int cpl1();
+extern int cpl2();
+extern int cpl3();
+extern int cpl5();
+extern int cpl6();
+extern void displayAloneText();
 extern int chlm();
 extern void drawClock();
 /*************
  * NIVEAU 11 *
  *************/
 extern void debloc(int l);
-extern void cpl10(int &p, int &h);
-extern void cpl11(int &p, int &h);
-extern void cpl12(int &p);
-extern void cpl13(int &p);
-extern void cpl15(int &p);
-extern void cpl20(int &p, int &h);
+extern void cpl10(int &p, int &hour);
+extern void cpl11(int &p, int &hour);
+extern int  cpl12();
+extern int  cpl13();
+extern int  cpl15();
+extern void cpl20(int &p, int &hour);
 extern void setPresenceGreenRoom(int l);
 extern void setPresencePurpleRoom();
 extern void setPresenceBlueRoom();
 extern void setPresenceRedRoom(int l);
-extern int setPresenceDiningRoom(int h);
-extern int setPresenceBureau(int h);
+extern int setPresenceDiningRoom(int hour);
+extern int setPresenceBureau(int hour);
 extern int setPresenceKitchen();
 extern int setPresenceLanding();
-extern int setPresenceChapel(int h);
+extern int setPresenceChapel(int hour);
 extern void frap();
 extern void nouvp(int l, int &p);
 extern void tip(int ip, int &cx);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index c98b399..8776336 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -46,13 +46,13 @@ void tinke() {
 	const char d4 = ']';
 	const char d5 = '1';
 	Common::String d6 = g_vm->getEngineString(S_OK);
-	int cx, cf, j, h, m;
+	int cx, cf, day, hour, minute;
 	Common::String stpo;
 
 	g_anyone = false;
-	calch(j, h, m);
-	if (j != g_day) {
-		g_day = j;
+	updateHour(day, hour, minute);
+	if (day != g_day) {
+		g_day = day;
 		cx = 0;
 		do {
 			++cx;
@@ -61,8 +61,8 @@ void tinke() {
 			g_nbrep[cx] = 0;
 		} while (cx != 8);
 	}
-	if ((h > g_hour) || ((h == 0) && (g_hour == 23))) {
-		g_hour = h;
+	if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
+		g_hour = hour;
 		g_minute = 0;
 		drawClock();
 		cf = 0;
@@ -89,7 +89,7 @@ void tinke() {
 		g_hintPctMessage += d6;
 		g_hintPctMessage += d4;
 	}
-	if (m > g_minute) {
+	if (minute > g_minute) {
 		g_minute = 30;
 		drawClock();
 	}
@@ -97,7 +97,7 @@ void tinke() {
 		return;
 
 	if (!g_blo) {
-		if ((h == 12) || ((h > 18) && (h < 21)) || ((h >= 0) && (h < 7)))
+		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
 			g_t = ti2;
 		else
 			g_t = ti1;
@@ -484,10 +484,10 @@ void ajjer(int ob) {
 }
 
 void t1sama() {    //Entering manor
-	int j, h, m;
+	int day, hour, minute;
 
-	calch(j, h, m);
-	if ((h < 5) && (g_s._currPlace > 18)) {
+	updateHour(day, hour, minute);
+	if ((hour < 5) && (g_s._currPlace > 18)) {
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
@@ -515,11 +515,10 @@ void t1sama() {    //Entering manor
 		affrep();
 		t5(10);
 		if (!g_blo)
-			t11(0, m);
+			t11(0, minute);
 		g_ipers = 0;
 		g_mpers = 0;
 		g_s._ipre = true;
-		/*chech;*/
 	} else
 		st1sama();
 }
@@ -605,7 +604,7 @@ L1:
 			int rand = (getRandomNumber(0, 4)) - 2;
 			parole(3, rand, 1);
 			clsf2();
-			person();
+			displayAloneText();
 			debloc(21);
 			affrep();
 		}
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 606b417..f011cc8 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -55,7 +55,7 @@ void changeGraphicalDevice(int newDevice) {
 	if (g_ipers != 0)
 		showPeoplePresent(g_ipers);
 	else
-		person();
+		displayAloneText();
 	clsf2();
 	clsf3();
 	g_maff = 68;
@@ -115,7 +115,7 @@ void MortevielleEngine::gameLoaded() {
 	_loseGame = false;
 	g_heroSearching = false;
 
-	person();
+	displayAloneText();
 	tinke();
 	drawClock();
 	afdes(0);
@@ -133,19 +133,17 @@ void MortevielleEngine::gameLoaded() {
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
 void tmaj3() {
-	int j, h, m;
+	int day, hour, minute;
 
-	calch(j, h, m);
-	if (m == 30)
-		m = 1;
-	h += j * 24;
-	m += h * 2;
-	g_s._heure = chr(m);
+	updateHour(day, hour, minute);
+	if (minute == 30)
+		minute = 1;
+	hour += day * 24;
+	minute += hour * 2;
+	g_s._heure = chr(minute);
 }
 
 void tsitu() {
-	int h, j, m;
-
 	if (!g_col)
 		clsf2();
 	g_syn = false;
@@ -225,21 +223,22 @@ void tsitu() {
 			return;
 		}
 	}
-	calch(j, h, m);
-	if ((((h == 12) || (h == 13) || (h == 19)) && (g_s._currPlace != 10)) ||
-	        ((h > 0) && (h < 6) && (g_s._currPlace != 0)))
+	int hour, day, minute;
+	updateHour(day, hour, minute);
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
+	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
 		++g_s._faithScore;
 	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
 	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
-		if ((g_s._faithScore > 99) && (h > 8) && (h < 16)) {
+		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
 			tperd();
 		}
-		if ((g_s._faithScore > 99) && (h > 0) && (h < 9)) {
+		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
 			g_crep = 1508;
 			tperd();
 		}
-		if ((j > 1) && (h > 8) && (!g_vm->_loseGame)) {
+		if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
 			g_crep = 1502;
 			tperd();
 		}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 00d9dca..3e21a35 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -250,7 +250,7 @@ void taffich() {
 	showMouse();
 	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
-			person();
+			displayAloneText();
 		else if (!g_blo)
 			t11(g_s._currPlace, cx);
 		g_mpers =  0;


Commit: f43e55c9f6ed20c341c9d87772ceef359fae42f3
    https://github.com/scummvm/scummvm/commit/f43e55c9f6ed20c341c9d87772ceef359fae42f3
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:50-07:00

Commit Message:
MORTEVIELLE: Remove useless variables from gameLoaded()

Changed paths:
    engines/mortevielle/prog.cpp



diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index f011cc8..1407e0e 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -69,26 +69,17 @@ void changeGraphicalDevice(int newDevice) {
  * @remarks	Originally called 'antegame'
  */
 void MortevielleEngine::gameLoaded() {
-	int k;
-	char g[8];
-
 	hideMouse();
 	g_imen = false;
-	g[1] = 'M';
 	_loseGame = true;
 	g_anyone = false;
 	g_okdes = true;
-	g[0] = '\040';
 	g_col = false;
-	g[7] = g[0];
-	g[2] = 'A';
 	g_cache = false;
 	g_brt = false;
 	g_maff = 68;
-	g[5] = 'E';
 	g_mnumo = 0;
 	g_prebru = 0;
-	g[4] = 'T';
 	g_x = 0;
 	g_y = 0;
 	g_num = 0;
@@ -96,15 +87,12 @@ void MortevielleEngine::gameLoaded() {
 	g_hfb = 0;
 	g_cs = 0;
 	g_is = 0;
-	k = 0;
 	g_ment = 0;
 	g_syn = true;
 	g_heroSearching = true;
 	g_mchai = 0;
 	g_inei = 0;
 	initouv();
-	g[3] = 'S';
-	g[6] = 'R';
 	g_iouv = 0;
 	g_dobj = 0;
 	affrep();


Commit: 8ae1e9e450584813e4bc79b8384242de1924d58b
    https://github.com/scummvm/scummvm/commit/8ae1e9e450584813e4bc79b8384242de1924d58b
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:51-07:00

Commit Message:
MORTEVIELLE: Some more renaming and refactoring

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 0bcfd67..be0407c 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1149,7 +1149,7 @@ void fctEnter() {
 				parole(7, g_x, 1);
 				aniof(1, 1);
 				
-				tip(z, g_x);
+				g_x = convertBitIndexToCharacterIndex(z);
 				++g_s._faithScore;
 				g_s._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
@@ -1599,7 +1599,7 @@ void MortevielleEngine::endGame() {
 	// Most likely the double call is useless, thus removed
 	//
 	// tkey1(false);
-	inzon();
+	resetVariables();
 }
 
 /**
@@ -1611,7 +1611,7 @@ void MortevielleEngine::loseGame() {
 	musique(0);
 	tkey1(false);
 	maivid();
-	inzon();
+	resetVariables();
 	dprog();
 	g_vh = 10;
 	g_vm__ = 0;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 775075c..f373760 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1067,26 +1067,27 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 
 	switch (c) {
 	case 1:
-	case 3  : {
+	case 3: {
 		cecr = 0;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
-	}
-	break;
-	case 4 : {
+		}
+		break;
+	case 4:
 		cecr = 0;
-	}
-	break;
-	case 5 : {
+		break;
+	case 5:
 		cecr = 15;
-	}
-	break;
+		break;
 	case 0:
-	case 2 : {
+	case 2: {
 		cecr = 15;
 		g_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		}
+		break;
+	default:
+		break;
 	}
-	break;
-	}
+
 	pt.x += 1;
 	pt.y += 1;
 	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ef5800e..b3ae537 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -286,13 +286,12 @@ void updateHour(int &day, int &hour, int &minute) {
 	hour = hour - ((day - g_vj) * 24);
 }
 
-void conv(int x, int &y) {
-	int cx = 1;
-	y = 128;
-	while (cx < x) {
-		y = (uint)y >> 1;
-		++cx;
-	}
+/**
+ * Engine function - Convert character index to bit index
+ * @remarks	Originally called 'conv'
+ */
+int convertCharacterIndexToBitIndex(int characterIndex) {
+	return 128 >> (characterIndex - 1);
 }
 
 /* NIVEAU 12 */
@@ -465,29 +464,29 @@ void showPeoplePresent(int per) {
 	g_ipers = per;
 }
 
-void choix(int min, int max, int &per) {
-	bool i;
-	int cz;
-
+int selectCharacters(int min, int max) {
+	bool invertSelection = false;
 	int rand = getRandomNumber(min, max);
+
 	if (rand > 4) {
 		rand = 8 - rand;
-		i = true;
-	} else
-		i = false;
+		invertSelection = true;
+	}
 
 	int cx = 0;
-	per = 0;
+	int retVal = 0;
 	while (cx < rand) {
-		int cy = getRandomNumber(1, 8);
-		conv(cy, cz);
-		if ((per & cz) != cz) {
+		int charIndex = getRandomNumber(1, 8);
+		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
+		if ((retVal & charBitIndex) != charBitIndex) {
 			++cx;
-			per |= cz;
+			retVal |= charBitIndex;
 		}
 	}
-	if (i)
-		per = 255 - per;
+	if (invertSelection)
+		retVal = 255 - retVal;
+
+	return retVal;
 }
 
 int cpl1() {
@@ -852,7 +851,7 @@ int setPresenceDiningRoom(int hour) {
 			min = 1;
 			max = 5;
 		}
-		choix(min, max, retVal);
+		retVal = selectCharacters(min, max);
 	}
 	showPeoplePresent(retVal);
 
@@ -880,7 +879,7 @@ int setPresenceBureau(int hour) {
 			min = 1;
 			max = 2;
 		}
-		choix(min, max, retVal);
+		retVal = selectCharacters(min, max);
 	}
 	showPeoplePresent(retVal);
 
@@ -917,8 +916,7 @@ int setPresenceLanding() {
 		        ((rand == 8) && g_bh5));
 	} while (test);
 
-	int retVal = 0;
-	conv(rand, retVal);
+	int retVal = convertCharacterIndexToBitIndex(rand);
 	showPeoplePresent(retVal);
 
 	return retVal;
@@ -945,7 +943,7 @@ int setPresenceChapel(int hour) {
 			min = 2;
 			max = 4;
 		}
-		choix(min, max, retVal);
+		retVal = selectCharacters(min, max);
 	}
 	showPeoplePresent(retVal);
 
@@ -994,25 +992,31 @@ void nouvp(int l, int &p) {
 		showPeoplePresent(p);
 }
 
+/**
+ * Engine function - Convert bit index to character index
+ * @remarks	Originally called 'tip'
+ */
+int convertBitIndexToCharacterIndex(int bitIndex) {
+	int retVal = 0;
 
+	if (bitIndex == 128)
+		retVal = 1;
+	else if (bitIndex == 64)
+		retVal = 2;
+	else if (bitIndex == 32)
+		retVal = 3;
+	else if (bitIndex == 16)
+		retVal = 4;
+	else if (bitIndex == 8)
+		retVal = 5;
+	else if (bitIndex == 4)
+		retVal = 6;
+	else if (bitIndex == 2)
+		retVal = 7;
+	else if (bitIndex == 1)
+		retVal = 8;
 
-void tip(int ip, int &cx) {
-	if (ip == 128)
-		cx = 1;
-	else if (ip == 64)
-		cx = 2;
-	else if (ip == 32)
-		cx = 3;
-	else if (ip == 16)
-		cx = 4;
-	else if (ip == 8)
-		cx = 5;
-	else if (ip == 4)
-		cx = 6;
-	else if (ip == 2)
-		cx = 7;
-	else if (ip == 1)
-		cx = 8;
+	return retVal;
 }
 
 
@@ -1084,7 +1088,11 @@ void phaz(int &rand, int &p, int cf) {
 	rand = getRandomNumber(1, 100);
 }
 
-void inzon() {
+/**
+ * Engine function - When restarting the game, reset the main variables used by the engine
+ * @remarks	Originally called 'inzon'
+ */
+void resetVariables() {
 	copcha();
 
 	g_s._ipre  = false;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 066392c..4e35e19 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -55,13 +55,13 @@ extern void clsf10();
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
 extern void updateHour(int &day, int &hour, int &minute);
-extern void conv(int x, int &y);
+extern int convertCharacterIndexToBitIndex(int characterIndex);
 /* NIVEAU 12 */
 extern void modobj(int m);
 extern void repon(int f, int m);
 extern void t5(int cx);
 extern void showPeoplePresent(int per);
-extern void choix(int min, int max, int &per);
+extern int selectCharacters(int min, int max);
 extern int cpl1();
 extern int cpl2();
 extern int cpl3();
@@ -91,13 +91,13 @@ extern int setPresenceLanding();
 extern int setPresenceChapel(int hour);
 extern void frap();
 extern void nouvp(int l, int &p);
-extern void tip(int ip, int &cx);
+extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int l);
 extern void becfren(int l);
 /* NIVEAU 10 */
 extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
-extern void inzon();
+extern void resetVariables();
 extern void dprog();
 extern void pl1(int cf);
 extern void pl2(int cf);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 8776336..d026ccf 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -586,8 +586,7 @@ L1:
 			g_s._faithScore += 3 * (g_s._faithScore / 10);
 		tsort();
 		tmlieu(15);
-		int cx;
-		tip(g_ipers, cx);
+		int cx = convertBitIndexToCharacterIndex(g_ipers);
 		g_caff = 69 + cx;
 		g_crep = g_caff;
 		g_msg[3] = MENU_DISCUSS;


Commit: a2bfb1321595d3444e0d7114d2d29cdafd61db90
    https://github.com/scummvm/scummvm/commit/a2bfb1321595d3444e0d7114d2d29cdafd61db90
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:53-07:00

Commit Message:
MORTEVIELLE: Rename some more functions

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index be0407c..7766272 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -938,10 +938,10 @@ void fctKnock() {
 					g_crep = 190;
 				else {
 					becfren(l);
-					frap();
+					getKnockAnswer();
 				}
 			} else
-				frap();
+				getKnockAnswer();
 		}
 
 		if (g_ment == 8)
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index b3ae537..ebce8e4 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -489,7 +489,11 @@ int selectCharacters(int min, int max) {
 	return retVal;
 }
 
-int cpl1() {
+/**
+ * Engine function - Get Presence Statistics - Green Room
+ * @remarks	Originally called 'cpl1'
+ */
+int getPresenceStatsGreenRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -516,8 +520,11 @@ int cpl1() {
 
 	return retVal;
 }
-
-int cpl2() {
+/**
+ * Engine function - Get Presence Statistics - Purple Room
+ * @remarks	Originally called 'cpl2'
+ */
+int getPresenceStatsPurpleRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -536,7 +543,11 @@ int cpl2() {
 	return retVal;
 }
 
-int cpl3() {
+/**
+ * Engine function - Get Presence Statistics - Toilets
+ * @remarks	Originally called 'cpl3'
+ */
+int getPresenceStatsToilets() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -549,7 +560,11 @@ int cpl3() {
 	return retVal;
 }
 
-int cpl5() {
+/**
+ * Engine function - Get Presence Statistics - Blue Room
+ * @remarks	Originally called 'cpl5'
+ */
+int getPresenceStatsBlueRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -566,7 +581,11 @@ int cpl5() {
 	return retVal;
 }
 
-int cpl6() {
+/**
+ * Engine function - Get Presence Statistics - Red Room
+ * @remarks	Originally called 'cpl6'
+ */
+int getPresenceStatsRedRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -679,39 +698,57 @@ void debloc(int l) {
 	g_mpers = g_ipers;
 }
 
-void cpl10(int &p, int &hour) {
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl10'
+ */
+int getPresenceStatsDiningRoom(int &hour) {
 	int day, minute;
 
+	int retVal = 0;
 	updateHour(day, hour, minute);
 	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		p = 100;
+		retVal = 100;
 	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
-		p = 45;
+		retVal = 45;
 	else if (((hour > 13) && (hour < 17)) || (hour == 18))
-		p = 35;
+		retVal = 35;
 	else if (hour == 17)
-		p = 60;
+		retVal = 60;
 	else if ((hour >= 0) && (hour < 8))
-		p = 5;
+		retVal = 5;
+
+	return retVal;
 }
 
-void cpl11(int &p, int &hour) {
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl11'
+ */
+int getPresenceStatsBureau(int &hour) {
 	int day, minute;
+	int retVal = 0;
 
 	updateHour(day, hour, minute);
 	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
-		p = 25;
+		retVal = 25;
 	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		p = 5;
+		retVal = 5;
 	else if ((hour > 13) && (hour < 17))
-		p = 55;
+		retVal = 55;
 	else if ((hour > 16) && (hour < 19))
-		p = 45;
+		retVal = 45;
 	else if ((hour >= 0) && (hour < 9))
-		p = 0;
+		retVal = 0;
+
+	return retVal;
 }
 
-int cpl12() {
+/**
+ * Engine function - Get Presence Statistics - Room Kitchen
+ * @remarks	Originally called 'cpl12'
+ */
+int getPresenceStatsKitchen() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -728,11 +765,19 @@ int cpl12() {
 	return retVal;
 }
 
-int cpl13() {
+/**
+ * Engine function - Get Presence Statistics - Room Attic
+ * @remarks	Originally called 'cpl13'
+ */
+int getPresenceStatsAttic() {
 	return 0;
 }
 
-int cpl15() {
+/**
+ * Engine function - Get Presence Statistics - Room Landing
+ * @remarks	Originally called 'cpl15'
+ */
+int getPresenceStatsLanding() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -755,20 +800,27 @@ int cpl15() {
 	return retVal;
 }
 
-void cpl20(int &p, int &hour) {
+/**
+ * Engine function - Get Presence Statistics - Room Chapel
+ * @remarks	Originally called 'cpl20'
+ */
+int getPresenceStatsChapel(int &hour) {
 	int day, minute;
+	int retVal = 0;
 
 	updateHour(day, hour, minute);
 	if (hour == 10)
-		p = 65;
+		retVal = 65;
 	else if ((hour > 10) && (hour < 21))
-		p = 5;
+		retVal = 5;
 	else if ((hour > 20) && (hour < 24))
-		p = -15;
+		retVal = -15;
 	else if ((hour >= 0) && (hour < 5))
-		p = -300;
+		retVal = -300;
 	else if ((hour > 4) && (hour < 10))
-		p = -5;
+		retVal = -5;
+
+	return retVal;
 }
 
 /**
@@ -950,8 +1002,11 @@ int setPresenceChapel(int hour) {
 	return retVal;
 }
 
-
-void frap() {
+/**
+ * Engine function - Get the answer after you known a door
+ * @remarks	Originally called 'frap'
+ */
+void getKnockAnswer() {
 	int day, hour, minute;
 
 	updateHour(day, hour, minute);
@@ -1026,15 +1081,15 @@ void ecfren(int &p, int &rand, int cf, int l) {
 	p = -500;
 	rand = 0;
 	if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
-		p = cpl1();
+		p = getPresenceStatsGreenRoom();
 	if ((l == 2) && (!g_bh2) && (!g_bh9))
-		p = cpl2();
+		p = getPresenceStatsPurpleRoom();
 	if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
-		p = cpl3();
+		p = getPresenceStatsToilets();
 	if ((l == 5) && (!g_bh5))
-		p = cpl5();
+		p = getPresenceStatsBlueRoom();
 	if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
-		p = cpl6();
+		p = getPresenceStatsRedRoom();
 	if ((l == 9) && (!g_bh9) && (!g_bh2))
 		p = 10;
 	if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
@@ -1147,7 +1202,7 @@ void dprog() {
 
 void pl1(int cf) {
 	if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
-		int p = cpl1();
+		int p = getPresenceStatsGreenRoom();
 		int rand;
 		phaz(rand, p, cf);
 
@@ -1160,7 +1215,7 @@ void pl1(int cf) {
 
 void pl2(int cf) {
 	if (!g_bh2) {
-		int p = cpl2();
+		int p = getPresenceStatsPurpleRoom();
 		int rand;
 		phaz(rand, p, cf);
 
@@ -1173,7 +1228,7 @@ void pl2(int cf) {
 
 void pl5(int cf) {
 	if (!g_bh5) {
-		int p = cpl5();
+		int p = getPresenceStatsBlueRoom();
 		int rand;
 
 		phaz(rand, p, cf);
@@ -1187,7 +1242,7 @@ void pl5(int cf) {
 
 void pl6(int cf) {
 	if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
-		int p = cpl6();
+		int p = getPresenceStatsRedRoom();
 		int rand;
 
 		phaz(rand, p, cf);
@@ -1213,8 +1268,8 @@ void pl9(int cf) {
 }
 
 void pl10(int cf) {
-	int p, h, rand;
-	cpl10(p, h);
+	int h, rand;
+	int p = getPresenceStatsDiningRoom(h);
 	phaz(rand, p, cf);
 
 	if (rand > p)
@@ -1224,9 +1279,9 @@ void pl10(int cf) {
 }
 
 void pl11(int cf) {
-	int p, h, rand;
+	int h, rand;
 
-	cpl11(p, h);
+	int p = getPresenceStatsBureau(h);
 	phaz(rand, p, cf);
 	if (rand > p)
 		displayAloneText();
@@ -1237,7 +1292,7 @@ void pl11(int cf) {
 void pl12(int cf) {
 	int p, rand;
 
-	p = cpl12();
+	p = getPresenceStatsKitchen();
 	phaz(rand, p, cf);
 	if (rand > p)
 		displayAloneText();
@@ -1248,7 +1303,7 @@ void pl12(int cf) {
 void pl13(int cf) {
 	int p, rand;
 
-	p = cpl13();
+	p = getPresenceStatsAttic();
 	phaz(rand, p, cf);
 	if (rand > p)
 		displayAloneText();
@@ -1259,7 +1314,7 @@ void pl13(int cf) {
 void pl15(int cf) {
 	int p, rand;
 
-	p = cpl15();
+	p = getPresenceStatsLanding();
 	phaz(rand, p, cf);
 	if (rand > p)
 		displayAloneText();
@@ -1268,9 +1323,9 @@ void pl15(int cf) {
 }
 
 void pl20(int cf) {
-	int p, h, rand;
+	int h, rand;
 
-	cpl20(p, h);
+	int p = getPresenceStatsChapel(h);
 	phaz(rand, p, cf);
 	if (rand > p)
 		displayAloneText();
@@ -1302,17 +1357,17 @@ void t11(int l11, int &a) {
 		else {
 			int h = 0;
 			if (l11 == 10)
-				cpl10(p, h);
+				p = getPresenceStatsDiningRoom(h);
 			else if (l11 == 11)
-				cpl11(p, h);
+				p = getPresenceStatsBureau(h);
 			else if (l11 == 12)
-				p = cpl12();
+				p = getPresenceStatsKitchen();
 			else if ((l11 == 13) || (l11 == 14))
-				p = cpl13();
+				p = getPresenceStatsAttic();
 			else if ((l11 == 15) || (l11 == 26))
-				p = cpl15();
+				p = getPresenceStatsLanding();
 			else if (l11 == 20)
-				cpl20(p, h);
+				p = getPresenceStatsChapel(h);
 			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 4e35e19..05dba14 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -62,11 +62,11 @@ extern void repon(int f, int m);
 extern void t5(int cx);
 extern void showPeoplePresent(int per);
 extern int selectCharacters(int min, int max);
-extern int cpl1();
-extern int cpl2();
-extern int cpl3();
-extern int cpl5();
-extern int cpl6();
+extern int getPresenceStatsGreenRoom();
+extern int getPresenceStatsPurpleRoom();
+extern int getPresenceStatsToilets();
+extern int getPresenceStatsBlueRoom();
+extern int getPresenceStatsRedRoom();
 extern void displayAloneText();
 extern int chlm();
 extern void drawClock();
@@ -74,12 +74,12 @@ extern void drawClock();
  * NIVEAU 11 *
  *************/
 extern void debloc(int l);
-extern void cpl10(int &p, int &hour);
-extern void cpl11(int &p, int &hour);
-extern int  cpl12();
-extern int  cpl13();
-extern int  cpl15();
-extern void cpl20(int &p, int &hour);
+extern int  getPresenceStatsDiningRoom(int &hour);
+extern int  getPresenceStatsBureau(int &hour);
+extern int  getPresenceStatsKitchen();
+extern int  getPresenceStatsAttic();
+extern int  getPresenceStatsLanding();
+extern int  getPresenceStatsChapel(int &hour);
 extern void setPresenceGreenRoom(int l);
 extern void setPresencePurpleRoom();
 extern void setPresenceBlueRoom();
@@ -89,7 +89,7 @@ extern int setPresenceBureau(int hour);
 extern int setPresenceKitchen();
 extern int setPresenceLanding();
 extern int setPresenceChapel(int hour);
-extern void frap();
+extern void getKnockAnswer();
 extern void nouvp(int l, int &p);
 extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int l);


Commit: c539a3b9eca26bac3e70ea07c6098a126be03709
    https://github.com/scummvm/scummvm/commit/c539a3b9eca26bac3e70ea07c6098a126be03709
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:54-07:00

Commit Message:
MORTEVIELLE: some more renaming, match menu item size in setText()

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/parole2.cpp
    engines/mortevielle/parole2.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 7766272..8f30e0d 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -47,8 +47,6 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void fctMove() {
-	int cx;
-
 	if ((g_s._currPlace == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		g_s._currPlace = LANDING;
 		g_caff = g_s._currPlace;
@@ -85,7 +83,7 @@ void fctMove() {
 		return;
 	}
 	tsort();
-	cx = 0;
+	int cx = 0;
 	do {
 		++cx;
 	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
@@ -95,7 +93,8 @@ void fctMove() {
 			t1deva();
 		if (cx == 2)
 			t1neig();
-		goto L2;
+		tmlieu(g_s._currPlace);
+		return;
 	}
 
 	if (g_s._currPlace == 23) {
@@ -103,7 +102,8 @@ void fctMove() {
 			t1deau();
 		if (cx == 2)
 			t1derr();
-		goto L2;
+		tmlieu(g_s._currPlace);
+		return;
 	}
 
 	if ((g_s._currPlace == BUREAU) && (cx == 1))
@@ -175,7 +175,6 @@ void fctMove() {
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
 	debloc(g_s._currPlace);
-L2:
 	tmlieu(g_s._currPlace);
 }
 
@@ -315,7 +314,7 @@ void fctInventoryTake() {
 	modinv();
 	avpoing(cz);
 	g_crep = 998;
-	clsf2();
+	clearScreenType2();
 }
 
 /**
@@ -623,7 +622,7 @@ void fctOpen() {
 				  || ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
 				  || (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
-						parole(7, 9, 1);
+						startSpeech(7, 9, 1);
 				}
 				g_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
@@ -691,7 +690,7 @@ void fctPlace() {
 					aniof(1, 1);
 					repon(2, 165);
 					maivid();
-					parole(6, -9, 1);
+					startSpeech(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -703,7 +702,7 @@ void fctPlace() {
 						hideMouse();
 						hirs();
 						dessine_rouleau();
-						clsf2();
+						clearScreenType2();
 						clsf3();
 						showMouse();
 						tinke();
@@ -792,7 +791,7 @@ void fctTurn() {
 		g_crep = 997;
 		if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
-			parole(7, 9, 1);
+			startSpeech(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1)
 				g_vm->_endGame = true;
@@ -802,7 +801,7 @@ void fctTurn() {
 		if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
 			repon(2, 175);
 			clsf3();
-			parole(6, -9, 1);
+			startSpeech(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				g_s._currPlace = CRYPT;
@@ -928,7 +927,7 @@ void fctKnock() {
 
 	if (g_s._currPlace == 26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
-		parole(11, rand, 1);
+		startSpeech(11, rand, 1);
 		int p;
 		ecfren(p, rand, g_s._faithScore, g_ment);
 		int l = g_ment;
@@ -1146,7 +1145,7 @@ void fctEnter() {
 				g_crep = 179;
 			else {
 				g_x = (getRandomNumber(0, 10)) - 5;
-				parole(7, g_x, 1);
+				startSpeech(7, g_x, 1);
 				aniof(1, 1);
 				
 				g_x = convertBitIndexToCharacterIndex(z);
@@ -1167,7 +1166,7 @@ void fctEnter() {
 			}
 		} else {
 			g_x = (getRandomNumber(0, 10)) - 5;
-			parole(7, g_x, 1);
+			startSpeech(7, g_x, 1);
 			aniof(1, 1);
 			
 			g_s._currPlace = g_ment;
@@ -1201,7 +1200,7 @@ void fctSleep() {
 		tmlieu(g_s._currPlace);
 	}
 	clsf3();
-	clsf2();
+	clearScreenType2();
 	ecrf2();
 	ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
 	updateHour(j, h, m);
@@ -1573,7 +1572,7 @@ void MortevielleEngine::endGame() {
 	tlu(13, 152);
 	maivid();
 	clsf1();
-	clsf2();
+	clearScreenType2();
 	clsf3();
 	repon(9, 1509);
 	tkey1(false);
@@ -1607,7 +1606,7 @@ void MortevielleEngine::endGame() {
  * @remarks	Originally called 'tencore'
  */
 void MortevielleEngine::loseGame() {
-	clsf2();
+	clearScreenType2();
 	musique(0);
 	tkey1(false);
 	maivid();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index d538774..717a256 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -85,7 +85,7 @@ int Alert::show(const Common::String &msg, int n) {
 			}
 			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
 			g_vm->_screenSurface._textPos.y += 6;
-			g_vm->_screenSurface.writeg(st, 4);
+			g_vm->_screenSurface.drawString(st, 4);
 			++i;
 		} while (chaine[i] != ']');
 	}
@@ -134,14 +134,14 @@ int Alert::show(const Common::String &msg, int n) {
 						Common::String tmp(" ");
 						tmp += s[quoi];
 						tmp += " ";
-						g_vm->_screenSurface.writeg(tmp, 0);
+						g_vm->_screenSurface.drawString(tmp, 0);
 					}
 					setPosition(ix, coldep, esp);
 
 					Common::String tmp2 = " ";
 					tmp2 += s[ix];
 					tmp2 += " ";
-					g_vm->_screenSurface.writeg(tmp2, 1);
+					g_vm->_screenSurface.drawString(tmp2, 1);
 
 					quoi = ix;
 					showMouse();
@@ -155,7 +155,7 @@ int Alert::show(const Common::String &msg, int n) {
 			Common::String tmp3(" ");
 			tmp3 += s[quoi];
 			tmp3 += " ";
-			g_vm->_screenSurface.writeg(tmp3, 0);
+			g_vm->_screenSurface.drawString(tmp3, 0);
 
 			quoi = 0;
 			showMouse();
@@ -171,7 +171,7 @@ int Alert::show(const Common::String &msg, int n) {
 		Common::String tmp4(" ");
 		tmp4 += s[n];
 		tmp4 += " ";
-		g_vm->_screenSurface.writeg(tmp4, 1);
+		g_vm->_screenSurface.drawString(tmp4, 1);
 	}
 	charecr(50, (NUM_LINES + 1) << 4);
 	showMouse();
@@ -275,7 +275,7 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
 		tmp += str[l];
 		tmp += " ";
 
-		g_vm->_screenSurface.writeg(tmp, 0);
+		g_vm->_screenSurface.drawString(tmp, 0);
 		x += esp + 40;
 	}
 }
@@ -406,9 +406,9 @@ void f3f8::draw() {
 
 	// Write the F3 and F8 text strings
 	g_vm->_screenSurface.putxy(3, 44);
-	g_vm->_screenSurface.writeg(f3, 5);
+	g_vm->_screenSurface.drawString(f3, 5);
 	g_vm->_screenSurface._textPos.y = 51;
-	g_vm->_screenSurface.writeg(f8, 5);
+	g_vm->_screenSurface.drawString(f8, 5);
 
 	// Get the width of the written text strings
 	int f3Width = g_vm->_screenSurface.getStringWidth(f3);
@@ -426,7 +426,7 @@ void f3f8::draw() {
 void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
-		parole(SpeechNum, 0, 0);
+		startSpeech(SpeechNum, 0, 0);
 		waitForF3F8(g_key);
 		CHECK_QUIT;
 
@@ -468,7 +468,7 @@ void f3f8::ani50() {
 	pictout(adani, g_crep, 63, 12);
 	g_crep = animof(2, 1);
 	pictout(adani, g_crep, 63, 12);
-	g_f2_all = (g_res == 1);
+	g_largestClearScreen = (g_res == 1);
 	repon(2, kDialogStringIndex + 143);
 }
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index f373760..1c26a5c 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1046,16 +1046,16 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
 
 /**
  * Write out a string
+ * @remarks	Originally called 'writeg'
  */
-void ScreenSurface::writeg(const Common::String &l, int c) {
+void ScreenSurface::drawString(const Common::String &l, int command) {
 	int i, x;
 	Common::Point pt;
 	int cecr = 0;
 
-	/*  debug('writeg : '+l);*/
-
 	if (l == "")
 		return;
+
 	hideMouse();
 	pt = _textPos;
 
@@ -1065,7 +1065,7 @@ void ScreenSurface::writeg(const Common::String &l, int c) {
 		i = 10;
 	x = pt.x + i * l.size();
 
-	switch (c) {
+	switch (command) {
 	case 1:
 	case 3: {
 		cecr = 0;
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 253b708..9f4a479 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -92,7 +92,7 @@ public:
 	void fillRect(int colour, const Common::Rect &bounds);
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
-	void writeg(const Common::String &l, int c);
+	void drawString(const Common::String &l, int command);
 	int getStringWidth(const Common::String &s);
 	void drawLine(int x, int y, int xx, int yy, int coul);
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index b60c70b..f2f19b6 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -42,13 +42,14 @@ namespace Mortevielle {
 
 /**
  * Setup a menu's contents
+ * @remarks	Originally called 'menut'
  */
-void Menu::menut(int no, Common::String name) {
-	byte h = hi(no);
-	byte l = lo(no);
+void Menu::setText(int menuId, Common::String name) {
+	byte h = hi(menuId);
+	byte l = lo(menuId);
 	Common::String s = name;
 
-	while (s.size() < 20)
+	while (s.size() < 30)
 		s += ' ';
 
 	switch (h) {
@@ -77,11 +78,11 @@ void Menu::menut(int no, Common::String name) {
 
 /**
  * _disable a menu item
- * @param no	Hi byte represents menu number, lo byte reprsents item index
+ * @param menuId	Hi byte represents menu number, lo byte reprsents item index
  */
-void Menu::disableMenuItem(int no) {
-	byte h = hi(no);
-	byte l = lo(no);
+void Menu::disableMenuItem(int menuId) {
+	byte h = hi(menuId);
+	byte l = lo(menuId);
 
 	switch (h) {
 	case MENU_INVENTORY:
@@ -110,12 +111,12 @@ void Menu::disableMenuItem(int no) {
 
 /**
  * Enable a menu item
- * @param no	Hi byte represents menu number, lo byte reprsents item index
+ * @param menuId	Hi byte represents menu number, lo byte reprsents item index
  * @remarks	Originally called menu_enable
  */
-void Menu::enableMenuItem(int no) {
-	byte h = hi(no);
-	byte l = lo(no);
+void Menu::enableMenuItem(int menuId) {
+	byte h = hi(menuId);
+	byte l = lo(menuId);
 
 	switch (h) {
 	case MENU_INVENTORY:
@@ -242,7 +243,7 @@ void Menu::invers(int ix) {
 		break;
 	}
 	if ((s[0] != '*') && (s[0] != '<'))
-		g_vm->_screenSurface.writeg(s, ix);
+		g_vm->_screenSurface.drawString(s, ix);
 	else
 		g_msg4 = OPCODE_NONE;
 }
@@ -309,42 +310,42 @@ void Menu::menuDown(int ii) {
 		switch (ii) {
 		case 1:
 			if (_inventoryStringArray[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_inventoryStringArray[cx], 4);
+				g_vm->_screenSurface.drawString(_inventoryStringArray[cx], 4);
 			break;
 		case 2:
 			if (_moveStringArray[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_moveStringArray[cx], 4);
+				g_vm->_screenSurface.drawString(_moveStringArray[cx], 4);
 			break;
 		case 3:
 			if (_actionStringArray[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_actionStringArray[cx], 4);
+				g_vm->_screenSurface.drawString(_actionStringArray[cx], 4);
 			break;
 		case 4:
 			if (_selfStringArray[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_selfStringArray[cx], 4);
+				g_vm->_screenSurface.drawString(_selfStringArray[cx], 4);
 			break;
 		case 5:
 			if (_discussStringArray[cx][0] != '*')
-				g_vm->_screenSurface.writeg(_discussStringArray[cx], 4);
+				g_vm->_screenSurface.drawString(_discussStringArray[cx], 4);
 			break;
 		case 6:
-			g_vm->_screenSurface.writeg(g_vm->getEngineString(S_SAVE_LOAD + cx), 4);
+			g_vm->_screenSurface.drawString(g_vm->getEngineString(S_SAVE_LOAD + cx), 4);
 			break;
 		case 7: {
 			Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
-			g_vm->_screenSurface.writeg(s, 4);
+			g_vm->_screenSurface.drawString(s, 4);
 			}
 			break;
 		case 8:
 			if (cx == 1)
-				g_vm->_screenSurface.writeg(g_vm->getEngineString(S_RESTART), 4);
+				g_vm->_screenSurface.drawString(g_vm->getEngineString(S_RESTART), 4);
 			else {
 				Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 2);
 				s += ' ';
 				s += (char)(47 + cx);
-				g_vm->_screenSurface.writeg(s, 4);
+				g_vm->_screenSurface.drawString(s, 4);
 			}
 			break;
 		default:
@@ -360,7 +361,6 @@ void Menu::menuDown(int ii) {
  * Menu is being removed, so restore the previous background area.
  */
 void Menu::menuUp(int xx) {
-	/* debug('menuUp'); */
 	if (g_test0) {
 		charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1);
 
@@ -383,7 +383,6 @@ void Menu::menuUp(int xx) {
  * Erase the menu
  */
 void Menu::eraseMenu() {
-	/* debug('eraseMenu'); */
 	_menuActive = false;
 	g_vm->setMouseClick(false);
 	menuUp(g_msg3);
@@ -478,8 +477,7 @@ void Menu::initMenu() {
 	f.read(g_lettres, 7 * 24);
 	f.close();
 
-	// Ask to swap floppy
-	dem2();
+	// Skipped: dialog asking to swap floppy
 
 	for (i = 1; i <= 8; ++i)
 		_inventoryStringArray[i] = "*                     ";
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 923c5aa..cdd343a 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -48,9 +48,9 @@ public:
 	int _inventoryMenu[9];
 	int _moveMenu[8];
 public:
-	void menut(int no, Common::String name);
-	void disableMenuItem(int no);
-	void enableMenuItem(int no);
+	void setText(int menuId, Common::String name);
+	void disableMenuItem(int menuId);
+	void enableMenuItem(int menuId);
 	void displayMenu();
 	void drawMenu();
 	void menuUp(int xx);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ebce8e4..36e0611 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -160,12 +160,16 @@ void clsf1() {
 	showMouse();
 }
 
-void clsf2() {
+/**
+ * Engine function - Clear Screen - Type 2
+ * @remarks	Originally called 'clsf2'
+ */
+void clearScreenType2() {
 	hideMouse();
-	if (g_f2_all) {
+	if (g_largestClearScreen) {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
-		g_f2_all = false;
+		g_largestClearScreen = false;
 	} else {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
@@ -183,21 +187,21 @@ void ecr2(Common::String str_) {
 	int tlig = 59 + (g_res - 1) * 36;
 
 	if ((int)str_.size() < tlig)
-		g_vm->_screenSurface.writeg(str_, 5);
+		g_vm->_screenSurface.drawString(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
+		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.writeg(copy(str_, tlig, tlig << 1), 5);
+		g_vm->_screenSurface.drawString(copy(str_, tlig, tlig << 1), 5);
 	} else {
-		g_f2_all = true;
-		clsf2();
+		g_largestClearScreen = true;
+		clearScreenType2();
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.writeg(copy(str_, 1, (tlig - 1)), 5);
+		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.writeg(copy(str_, tlig, ((tlig << 1) - 1)), 5);
+		g_vm->_screenSurface.drawString(copy(str_, tlig, ((tlig << 1) - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 190);
-		g_vm->_screenSurface.writeg(copy(str_, tlig << 1, tlig * 3), 5);
+		g_vm->_screenSurface.drawString(copy(str_, tlig << 1, tlig * 3), 5);
 	}
 }
 
@@ -211,7 +215,7 @@ void clsf3() {
 void ecr3(Common::String text) {
 	clsf3();
 	g_vm->_screenSurface.putxy(8, 192);
-	g_vm->_screenSurface.writeg(text, 5);
+	g_vm->_screenSurface.drawString(text, 5);
 }
 
 void ecrf6() {
@@ -245,7 +249,7 @@ void clsf10() {
 	
 	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
 	g_vm->_screenSurface.putxy(co, 92);
-	g_vm->_screenSurface.writeg(st, 4);
+	g_vm->_screenSurface.drawString(st, 4);
 
 	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
 	/* rempli(69,12,32,5,255);*/
@@ -301,7 +305,7 @@ void modobj(int m) {
 	if (m != 500)
 		strp = deline(m - 501 + kInventoryStringIndex);
 
-	g_vm->_menu.menut(g_vm->_menu._inventoryMenu[8], strp);
+	g_vm->_menu.setText(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
 }
 
@@ -314,11 +318,11 @@ void repon(int f, int m) {
 		tmpStr = deline(m - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
-			g_f2_all = true;
+			g_largestClearScreen = true;
 		else
-			g_f2_all = false;
+			g_largestClearScreen = false;
 
-		clsf2();
+		clearScreenType2();
 		displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
@@ -327,7 +331,7 @@ void repon(int f, int m) {
 		if (f == 1)
 			f = 6;
 		if (f == 2) {
-			clsf2();
+			clearScreenType2();
 			ecrf2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
@@ -423,42 +427,42 @@ void showPeoplePresent(int per) {
 	clsf10();
 	if ((per & 128) == 128) {
 		g_vm->_screenSurface.putxy(xp, 24);
-		g_vm->_screenSurface.writeg("LEO", 4);
+		g_vm->_screenSurface.drawString("LEO", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[1]);
 	}
 	if ((per & 64) == 64) {
 		g_vm->_screenSurface.putxy(xp, 32);
-		g_vm->_screenSurface.writeg("PAT", 4);
+		g_vm->_screenSurface.drawString("PAT", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[2]);
 	}
 	if ((per & 32) == 32) {
 		g_vm->_screenSurface.putxy(xp, 40);
-		g_vm->_screenSurface.writeg("GUY", 4);
+		g_vm->_screenSurface.drawString("GUY", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[3]);
 	}
 	if ((per & 16) == 16) {
 		g_vm->_screenSurface.putxy(xp, 48);
-		g_vm->_screenSurface.writeg("EVA", 4);
+		g_vm->_screenSurface.drawString("EVA", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[4]);
 	}
 	if ((per & 8) == 8) {
 		g_vm->_screenSurface.putxy(xp, 56);
-		g_vm->_screenSurface.writeg("BOB", 4);
+		g_vm->_screenSurface.drawString("BOB", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[5]);
 	}
 	if ((per & 4) == 4) {
 		g_vm->_screenSurface.putxy(xp, 64);
-		g_vm->_screenSurface.writeg("LUC", 4);
+		g_vm->_screenSurface.drawString("LUC", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[6]);
 	}
 	if ((per & 2) == 2) {
 		g_vm->_screenSurface.putxy(xp, 72);
-		g_vm->_screenSurface.writeg("IDA", 4);
+		g_vm->_screenSurface.drawString("IDA", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[7]);
 	}
 	if ((per & 1) == 1) {
 		g_vm->_screenSurface.putxy(xp, 80);
-		g_vm->_screenSurface.writeg("MAX", 4);
+		g_vm->_screenSurface.drawString("MAX", 4);
 		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
 	}
 	g_ipers = per;
@@ -617,11 +621,11 @@ void displayAloneText() {
 
 	clsf10();
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sYou) / 2), 30);
-	g_vm->_screenSurface.writeg(sYou, 4);
+	g_vm->_screenSurface.drawString(sYou, 4);
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAre) / 2), 50);
-	g_vm->_screenSurface.writeg(sAre, 4);
+	g_vm->_screenSurface.drawString(sAre, 4);
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAlone) / 2), 70);
-	g_vm->_screenSurface.writeg(sAlone, 4);
+	g_vm->_screenSurface.drawString(sAlone, 4);
 
 	g_ipers = 0;
 }
@@ -673,15 +677,15 @@ void drawClock() {
 	g_vm->_screenSurface.putxy(568, 154);
 
 	if (g_hour > 11)
-		g_vm->_screenSurface.writeg("PM ", 1);
+		g_vm->_screenSurface.drawString("PM ", 1);
 	else
-		g_vm->_screenSurface.writeg("AM ", 1);
+		g_vm->_screenSurface.drawString("AM ", 1);
 
 	g_vm->_screenSurface.putxy(550, 160);
 	if ((g_day >= 0) && (g_day <= 8)) {
 		Common::String tmp = g_vm->getEngineString(S_DAY);
 		tmp.insertChar((char)(g_day + 49), 0);
-		g_vm->_screenSurface.writeg(tmp, 1);
+		g_vm->_screenSurface.drawString(tmp, 1);
 	}
 }
 
@@ -1196,7 +1200,7 @@ void dprog() {
 	g_jh = 0;
 	if (!g_s._ipre)
 		g_blo = true;
-	g_t = ti1;
+	g_t = kTime1;
 	g_mh = readclock();
 }
 
@@ -1398,7 +1402,7 @@ void cavegre() {
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
-	parole(2, rand, 1);
+	startSpeech(2, rand, 1);
 
 	// The original was doing here a useless loop.
 	// It has been removed
@@ -1409,9 +1413,9 @@ void cavegre() {
 
 void writetp(Common::String s, int t) {
 	if (g_res == 2)
-		g_vm->_screenSurface.writeg(s, t);
+		g_vm->_screenSurface.drawString(s, t);
 	else
-		g_vm->_screenSurface.writeg(copy(s, 1, 25), t);
+		g_vm->_screenSurface.drawString(copy(s, 1, 25), t);
 }
 
 void aniof(int ouf, int num) {
@@ -1442,35 +1446,35 @@ void musique(int so) {
 		/* musik(0) */
 		;
 	} else if ((g_prebru == 0) && (!g_s._ipre)) {
-		parole(10, 1, 1);
+		startSpeech(10, 1, 1);
 		++g_prebru;
 	} else {
 		bool i = false;
 		if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 			if (getRandomNumber(1, 3) == 2) {
-				parole(9, getRandomNumber(2, 4), 1);
+				startSpeech(9, getRandomNumber(2, 4), 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == CHAPEL) {
 			if (getRandomNumber(1, 2) == 1) {
-				parole(8, 1, 1);
+				startSpeech(8, 1, 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == WELL) {
 			if (getRandomNumber(1, 2) == 2) {
-				parole(12, 1, 1);
+				startSpeech(12, 1, 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == 23) {
-			parole(13, 1, 1);
+			startSpeech(13, 1, 1);
 			i = true;
 		}
 
 		if (!i)
-			parole(getRandomNumber(1, 17), 1, 2);
+			startSpeech(getRandomNumber(1, 17), 1, 2);
 	}
 }
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 05dba14..fcabee5 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -44,7 +44,7 @@ extern void text1(int x, int y, int nb, int m);
 extern void initouv();
 extern void ecrf1();
 extern void clsf1();
-extern void clsf2();
+extern void clearScreenType2();
 extern void ecrf2();
 extern void ecr2(Common::String str_);
 extern void clsf3();
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index d026ccf..48ca45e 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -98,9 +98,9 @@ void tinke() {
 
 	if (!g_blo) {
 		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			g_t = ti2;
+			g_t = kTime2;
 		else
-			g_t = ti1;
+			g_t = kTime1;
 		cf = g_s._faithScore;
 		if ((cf > 33) && (cf < 66))
 			g_t -= (g_t / 3);
@@ -169,7 +169,7 @@ void tinke() {
 							ecrf2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
-							parole(1, rand, 1);
+							startSpeech(1, rand, 1);
 							clsf3();
 						}
 					}
@@ -254,12 +254,12 @@ void tmlieu(int roomId) {
 		nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
-		g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
+		g_vm->_menu.setText(g_vm->_menu._moveMenu[i], nomp);
 		++i;
 	}
 	nomp = "*                   ";
 	for (int cx = 7; cx >= i; --cx)
-		g_vm->_menu.menut(g_vm->_menu._moveMenu[cx], nomp);
+		g_vm->_menu.setText(g_vm->_menu._moveMenu[cx], nomp);
 }
 
 
@@ -289,8 +289,8 @@ void unsetSearchMenu() {
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
 
-	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
-	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
+	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
+	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
 }
 
 /* NIVEAU 6 */
@@ -310,7 +310,7 @@ void tperd() {
 	clsf1();
 	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
 	repon(9, g_crep);
-	clsf2();
+	clearScreenType2();
 	clsf3();
 	g_col = false;
 	g_syn = false;
@@ -390,12 +390,12 @@ void modinv() {
 			++cy;
 			r = (ord(g_s._sjer[cx]) + 400);
 			nomp = deline(r - 501 + kInventoryStringIndex);
-			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cy], nomp);
+			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
 	if (cy < 6)
 		for (int cx = cy + 1; cx <= 6; ++cx) {
-			g_vm->_menu.menut(g_vm->_menu._inventoryMenu[cx], "                       ");
+			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cx], "                       ");
 			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]);
 		}
 }
@@ -412,7 +412,7 @@ void sparl(float adr, float rep) {
 	
 	key = 0;
 	do {
-		parole(repint, haut[g_caff - 69], 0);
+		startSpeech(repint, haut[g_caff - 69], 0);
 		f3f8::waitForF3F8(key);
 		CHECK_QUIT;
 	} while (key != 66);
@@ -443,8 +443,8 @@ void setSearchMenu() {
 	for (int cx = 1; cx <= 11; ++cx)
 		g_vm->_menu.disableMenuItem(_actionMenu[cx]);
 
-	g_vm->_menu.menut(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
-	g_vm->_menu.menut(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
+	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
+	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
 }
 
 void mennor() {
@@ -574,9 +574,9 @@ L1:
 			g_crep = 138;
 		repon(2, g_crep);
 		if (g_crep == 138)
-			parole(5, 2, 1);
+			startSpeech(5, 2, 1);
 		else
-			parole(4, 4, 1);
+			startSpeech(4, 4, 1);
 
 		if (g_iouv == 0)
 			g_s._faithScore += 2;
@@ -601,8 +601,8 @@ L1:
 		} else {
 			repon(2, 136);
 			int rand = (getRandomNumber(0, 4)) - 2;
-			parole(3, rand, 1);
-			clsf2();
+			startSpeech(3, rand, 1);
+			clearScreenType2();
 			displayAloneText();
 			debloc(21);
 			affrep();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7ed3e92..8dd5ac3 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -155,7 +155,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	init_lieu();
 	g_soundOff = false;
-	g_f2_all = false;
+	g_largestClearScreen = false;
 
 	teskbd();
 	dialpre();
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 4fcbb02..3b381dd 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -174,15 +174,14 @@ void hideMouse() {
  * @remarks	Originally called 'show_mouse'
  */
 void showMouse() {
-	int i, j, k, l;
-	bool imp;
+	int k, l;
 
 	mouse_shwn = mouse_shwn + 1;
 	if (mouse_shwn != 1)
 		return;
-	j = p_o_s;
-	imp = odd(y_s);
-	i = x_s & 7;
+	int j = p_o_s;
+	bool imp = odd(y_s);
+	int i = x_s & 7;
 	switch (g_currGraphicalDevice) {
 	case MODE_CGA:
 		k = 0;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 02c03b8..d8e2309 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -192,7 +192,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 	while (!stringParsed) {
 		switch (inputStr[p]) {
 		case '@':
-			g_vm->_screenSurface.writeg(s, typ);
+			g_vm->_screenSurface.drawString(s, typ);
 			s = "";
 			++p;
 			xc = x;
@@ -204,7 +204,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 			xc += tab;
 			++p;
 			if (l_motsuiv(p, inputStr.c_str(), tab) + xc > xf) {
-				g_vm->_screenSurface.writeg(s, typ);
+				g_vm->_screenSurface.drawString(s, typ);
 				s = "";
 				xc = x;
 				yc += 6;
@@ -216,7 +216,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 						j = x;
 						do {
 							g_vm->_screenSurface.putxy(j, i);
-							g_vm->_screenSurface.writeg(" ", 0);
+							g_vm->_screenSurface.drawString(" ", 0);
 							j += 6;
 						} while (j <= xf);
 						i += 6;
@@ -228,7 +228,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 			break;
 		case '$':
 			stringParsed = true;
-			g_vm->_screenSurface.writeg(s, typ);
+			g_vm->_screenSurface.drawString(s, typ);
 			break;
 		default:
 			s += inputStr[p];
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 3033235..d5bb43a 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -45,13 +45,6 @@ namespace Mortevielle {
 // For ScummVM, we need to do check for file errors where we do the file access
 const int ioresult = 0;
 
-/**
- * Check for disk 2 being in the drive
- */
-void dem2() {
-	// Deprecated under ScummVM
-}
-
 void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
@@ -245,7 +238,7 @@ void suite() {
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
 	g_vm->_screenSurface.putxy(104 + 72 * g_res, 185);
-	g_vm->_screenSurface.writeg(cpr, 0);
+	g_vm->_screenSurface.drawString(cpr, 0);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 13a8f5d..25633a4 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -30,8 +30,6 @@
 
 namespace Mortevielle {
 
-extern void dem2();
-//extern void apzuul();
 extern void charpal();
 extern void chartex();
 extern void dialpre();
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index 3682dc9..ff6ad7f 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -83,7 +83,7 @@ void trait_ph() {
 
 
 
-void parole(int rep, int ht, int typ) {
+void startSpeech(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
 
diff --git a/engines/mortevielle/parole2.h b/engines/mortevielle/parole2.h
index 01cf277..3fab74d 100644
--- a/engines/mortevielle/parole2.h
+++ b/engines/mortevielle/parole2.h
@@ -33,7 +33,7 @@ namespace Mortevielle {
 extern void rot_chariot();
 extern void init_chariot();
 extern void trait_ph();
-extern void parole(int rep, int ht, int typ);
+extern void startSpeech(int rep, int ht, int typ);
 
 } // End of namespace Mortevielle
 
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 1407e0e..36d5265 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -56,7 +56,7 @@ void changeGraphicalDevice(int newDevice) {
 		showPeoplePresent(g_ipers);
 	else
 		displayAloneText();
-	clsf2();
+	clearScreenType2();
 	clsf3();
 	g_maff = 68;
 	afdes(0);
@@ -133,7 +133,7 @@ void tmaj3() {
 
 void tsitu() {
 	if (!g_col)
-		clsf2();
+		clearScreenType2();
 	g_syn = false;
 	g_iesc = false;
 	if (!g_anyone) {
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index a53d218..0efafe7 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -164,8 +164,9 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	// Close the save file
 	f->finalize();
 	delete f;
+	
+	// Skipped: dialog asking to swap floppy
 
-	dem2();
 	showMouse();
 	return Common::kNoError;
 }
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9218cad..0fe22fc 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -95,7 +95,7 @@ bool g_blo,
         g_main1,
         g_choisi,
         g_test0,
-        g_f2_all,
+        g_largestClearScreen,
         g_imen,
         g_cache,
         g_iesc,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 11bc4e0..7517beb 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -91,8 +91,8 @@ const int kTempoNoise = 78;
 const int kTempoF = 80;
 const int kTempoM = 89;
 
-const int ti1 = 410;
-const int ti2 = 250;
+const int kTime1 = 410;
+const int kTime2 = 250;
 const int maxti = 7975;
 const int maxtd = 600;
 const int kMaxRect = 14;
@@ -240,7 +240,7 @@ extern bool g_blo,
         g_main1,
         g_choisi,
         g_test0,
-        g_f2_all,
+        g_largestClearScreen,
         g_imen,
         g_cache,
         g_iesc,


Commit: a5507be8a86069de39fd345e2b4226362d6b4b8e
    https://github.com/scummvm/scummvm/commit/a5507be8a86069de39fd345e2b4226362d6b4b8e
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:56-07:00

Commit Message:
MORTEVIELLE: Some more renaming. Move globals to the  MortevielleEngine class

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole2.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 8f30e0d..d4a5378 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1138,8 +1138,8 @@ void fctEnter() {
 			g_s._teauto[8] = '*';
 	} else {
 		int z = 0;
-		if (!g_blo)
-			t11(g_ment, z);
+		if (!g_vm->g_blo)
+			z = t11(g_ment);
 		if (z != 0) {
 			if ((g_ment == 3) || (g_ment == 7))
 				g_crep = 179;
@@ -1297,8 +1297,8 @@ void fctWait() {
 	do {
 		++g_jh;
 		tinke();
-		if (!g_blo)
-			t11(g_s._currPlace, quel);
+		if (!g_vm->g_blo)
+			quel = t11(g_s._currPlace);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
 			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 72fc6e9..f28e309 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -25,6 +25,7 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/asm.h"
@@ -42,7 +43,7 @@ int testou() {
 
 	switch (ch)  {
 	case '\23' :
-		g_soundOff = !g_soundOff;
+		g_vm->_soundOff = !g_vm->_soundOff;
 		break;
 	case '\26' :
 		if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 36e0611..24548fa 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -385,33 +385,33 @@ void repon(int f, int m) {
 
 void t5(int cx) {
 	if (cx == 10)
-		g_blo = false;
+		g_vm->g_blo = false;
 
 	if (cx != 1) {
-		g_bh1 = false;
-		g_bf1 = false;
+		g_vm->_roomPresenceLuc = false;
+		g_vm->_roomPresenceIda = false;
 	}
 
 	if (cx != 2)
-		g_bh2 = false;
+		g_vm->_purpleRoomPresenceLeo = false;
 
 	if (cx != 4) {
-		g_bh4 = false;
-		g_bf4 = false;
+		g_vm->_roomPresenceGuy = false;
+		g_vm->_roomPresenceEva = false;
 	}
 
 	if (cx != 5)
-		g_bh5 = false;
+		g_vm->_roomPresenceMax = false;
 	if (cx != 6)
-		g_bh6 = false;
+		g_vm->_roomPresenceBob = false;
 	if (cx != 8)
-		g_bh8 = false;
+		g_vm->_roomPresencePat = false;
 	if (cx != 3)
-		g_bt3 = false;
+		g_vm->_toiletsPresenceBobMax = false;
 	if (cx != 7)
-		g_bt7 = false;
+		g_vm->_bathRoomPresenceBobMax = false;
 	if (cx != 9)
-		g_bh9 = false;
+		g_vm->_room9PresenceLeo = false;
 }
 
 /**
@@ -831,18 +831,18 @@ int getPresenceStatsChapel(int &hour) {
  * Engine function - Check who is in the Green Room
  * @remarks	Originally called 'quelq1'
  */
-void setPresenceGreenRoom(int l) {
-	int per = getRandomNumber(1, 2);
-	if (l == 1) {
-		if (per == 1)
-			g_bh1 = true;
+void setPresenceGreenRoom(int roomId) {
+	int rand = getRandomNumber(1, 2);
+	if (roomId == GREEN_ROOM) {
+		if (rand == 1)
+			g_vm->_roomPresenceLuc = true;
 		else
-			g_bf1 = true;
-	} else if (l == 4) {
-		if (per == 1)
-			g_bh4 = true;
+			g_vm->_roomPresenceIda = true;
+	} else if (roomId == DARKBLUE_ROOM) {
+		if (rand == 1)
+			g_vm->_roomPresenceGuy = true;
 		else
-			g_bf4 = true;
+			g_vm->_roomPresenceEva = true;
 	}
 
 	g_ipers = 10;
@@ -854,9 +854,9 @@ void setPresenceGreenRoom(int l) {
  */
 void setPresencePurpleRoom() {
 	if (g_li == 2)
-		g_bh2 = true;
+		g_vm->_purpleRoomPresenceLeo = true;
 	else
-		g_bh9 = true;
+		g_vm->_room9PresenceLeo = true;
 
 	g_ipers = 10;
 }
@@ -866,7 +866,7 @@ void setPresencePurpleRoom() {
  * @remarks	Originally called 'quelq5'
  */
 void setPresenceBlueRoom() {
-	g_bh5 = true;
+	g_vm->_roomPresenceMax = true;
 	g_ipers = 10;
 }
 
@@ -876,9 +876,9 @@ void setPresenceBlueRoom() {
  */
 void setPresenceRedRoom(int l) {
 	if (l == 6)
-		g_bh6 = true;
+		g_vm->_roomPresenceBob = true;
 	else if (l == 8)
-		g_bh8 = true;
+		g_vm->_roomPresencePat = true;
 
 	g_ipers = 10;
 }
@@ -962,14 +962,14 @@ int setPresenceLanding() {
 	int rand = 0;
 	do {
 		rand = getRandomNumber(1, 8);
-		test = (((rand == 1) && (g_bh2 || g_bh9)) ||
-		        ((rand == 2) && g_bh8) ||
-		        ((rand == 3) && g_bh4) ||
-		        ((rand == 4) && g_bf4) ||
-		        ((rand == 5) && g_bh6) ||
-		        ((rand == 6) && g_bh1) ||
-		        ((rand == 7) && g_bf1) ||
-		        ((rand == 8) && g_bh5));
+		test = (((rand == 1) && (g_vm->_purpleRoomPresenceLeo || g_vm->_room9PresenceLeo)) ||
+		        ((rand == 2) && g_vm->_roomPresencePat) ||
+		        ((rand == 3) && g_vm->_roomPresenceGuy) ||
+		        ((rand == 4) && g_vm->_roomPresenceEva) ||
+		        ((rand == 5) && g_vm->_roomPresenceBob) ||
+		        ((rand == 6) && g_vm->_roomPresenceLuc) ||
+		        ((rand == 7) && g_vm->_roomPresenceIda) ||
+		        ((rand == 8) && g_vm->_roomPresenceMax));
 	} while (test);
 
 	int retVal = convertCharacterIndexToBitIndex(rand);
@@ -1024,31 +1024,33 @@ void getKnockAnswer() {
 	}
 }
 
-void nouvp(int l, int &p) {
-	p = 0;
+int nouvp(int l) {
+	int bitIndex = 0;
 	if (l == 1) {
-		if (g_bh1)
-			p = 4;
-		if (g_bf1)
-			p = 2;
-	} else if (((l == 2) && (g_bh2)) || ((l == 9) && (g_bh9)))
-		p = 128;
+		if (g_vm->_roomPresenceLuc)
+			bitIndex = 4;  // LUC
+		if (g_vm->_roomPresenceIda)
+			bitIndex = 2;  // IDA
+	} else if (((l == 2) && (g_vm->_purpleRoomPresenceLeo)) || ((l == 9) && (g_vm->_room9PresenceLeo)))
+		bitIndex = 128;    // LEO
 	else if (l == 4) {
-		if (g_bh4)
-			p = 32;
-		if (g_bf4)
-			p = 16;
-	} else if ((l == 5) && (g_bh5))
-		p = 1;
-	else if ((l == 6) && (g_bh6))
-		p = 8;
-	else if ((l == 8) && (g_bh8))
-		p = 64;
-	else if (((l == 3) && (g_bt3)) || ((l == 7) && (g_bt7)))
-		p = 9;
-
-	if (p != 9)
-		showPeoplePresent(p);
+		if (g_vm->_roomPresenceGuy)
+			bitIndex = 32; // GUY
+		if (g_vm->_roomPresenceEva)
+			bitIndex = 16; // EVA
+	} else if ((l == 5) && (g_vm->_roomPresenceMax))
+		bitIndex = 1;      // MAX
+	else if ((l == 6) && (g_vm->_roomPresenceBob))
+		bitIndex = 8;      // BOB
+	else if ((l == 8) && (g_vm->_roomPresencePat))
+		bitIndex = 64;     // PAT
+	else if (((l == 3) && (g_vm->_toiletsPresenceBobMax)) || ((l == 7) && (g_vm->_bathRoomPresenceBobMax)))
+		bitIndex = 9;      // BOB + MAX
+
+	if (bitIndex != 9)
+		showPeoplePresent(bitIndex);
+
+	return bitIndex;
 }
 
 /**
@@ -1084,19 +1086,19 @@ void ecfren(int &p, int &rand, int cf, int l) {
 		displayAloneText();
 	p = -500;
 	rand = 0;
-	if (((l == 1) && (!g_bh1) && (!g_bf1)) || ((l == 4) && (!g_bh4) && (!g_bf4)))
+	if (((l == 1) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda)) || ((l == 4) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva)))
 		p = getPresenceStatsGreenRoom();
-	if ((l == 2) && (!g_bh2) && (!g_bh9))
+	if ((l == 2) && (!g_vm->_purpleRoomPresenceLeo) && (!g_vm->_room9PresenceLeo))
 		p = getPresenceStatsPurpleRoom();
-	if (((l == 3) && (!g_bt3)) || ((l == 7) && (!g_bt7)))
+	if (((l == 3) && (!g_vm->_toiletsPresenceBobMax)) || ((l == 7) && (!g_vm->_bathRoomPresenceBobMax)))
 		p = getPresenceStatsToilets();
-	if ((l == 5) && (!g_bh5))
+	if ((l == 5) && (!g_vm->_roomPresenceMax))
 		p = getPresenceStatsBlueRoom();
-	if (((l == 6) && (!g_bh6)) || ((l == 8) && (!g_bh8)))
+	if (((l == 6) && (!g_vm->_roomPresenceBob)) || ((l == 8) && (!g_vm->_roomPresencePat)))
 		p = getPresenceStatsRedRoom();
-	if ((l == 9) && (!g_bh9) && (!g_bh2))
+	if ((l == 9) && (!g_vm->_room9PresenceLeo) && (!g_vm->_purpleRoomPresenceLeo))
 		p = 10;
-	if (((l == 2) && (g_bh9)) || ((l == 9) && (g_bh2)))
+	if (((l == 2) && (g_vm->_room9PresenceLeo)) || ((l == 9) && (g_vm->_purpleRoomPresenceLeo)))
 		p = -400;
 	if (p != -500) {
 		p += cf;
@@ -1109,29 +1111,29 @@ void becfren(int l) {
 		int rand = getRandomNumber(1, 2);
 		if (l == 1) {
 			if (rand == 1)
-				g_bh1 = true;
+				g_vm->_roomPresenceLuc = true;
 			else
-				g_bf1 = true;
+				g_vm->_roomPresenceIda = true;
 		} else { // l == 4
 			if (rand == 1)
-				g_bh4 = true;
+				g_vm->_roomPresenceGuy = true;
 			else
-				g_bf4 = true;
+				g_vm->_roomPresenceEva = true;
 		}
 	} else if (l == 2)
-		g_bh2 = true;
+		g_vm->_purpleRoomPresenceLeo = true;
 	else if (l == 3)
-		g_bt3 = true;
+		g_vm->_toiletsPresenceBobMax = true;
 	else if (l == 5)
-		g_bh5 = true;
+		g_vm->_roomPresenceMax = true;
 	else if (l == 6)
-		g_bh6 = true;
+		g_vm->_roomPresenceBob = true;
 	else if (l == 7)
-		g_bt7 = true;
+		g_vm->_bathRoomPresenceBobMax = true;
 	else if (l == 8)
-		g_bh8 = true;
+		g_vm->_roomPresencePat = true;
 	else if (l == 9)
-		g_bh9 = true;
+		g_vm->_room9PresenceLeo = true;
 }
 
 /* NIVEAU 10 */
@@ -1199,13 +1201,13 @@ void dprog() {
 	g_li = 21;
 	g_jh = 0;
 	if (!g_s._ipre)
-		g_blo = true;
+		g_vm->g_blo = true;
 	g_t = kTime1;
 	g_mh = readclock();
 }
 
 void pl1(int cf) {
-	if (((g_li == 1) && (!g_bh1) && (!g_bf1)) || ((g_li == 4) && (!g_bh4) && (!g_bf4))) {
+	if (((g_li == 1) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda)) || ((g_li == 4) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva))) {
 		int p = getPresenceStatsGreenRoom();
 		int rand;
 		phaz(rand, p, cf);
@@ -1218,7 +1220,7 @@ void pl1(int cf) {
 }
 
 void pl2(int cf) {
-	if (!g_bh2) {
+	if (!g_vm->_purpleRoomPresenceLeo) {
 		int p = getPresenceStatsPurpleRoom();
 		int rand;
 		phaz(rand, p, cf);
@@ -1231,7 +1233,7 @@ void pl2(int cf) {
 }
 
 void pl5(int cf) {
-	if (!g_bh5) {
+	if (!g_vm->_roomPresenceMax) {
 		int p = getPresenceStatsBlueRoom();
 		int rand;
 
@@ -1245,7 +1247,7 @@ void pl5(int cf) {
 }
 
 void pl6(int cf) {
-	if (((g_li == 6) && (!g_bh6)) || ((g_li == 8) && (!g_bh8))) {
+	if (((g_li == 6) && (!g_vm->_roomPresenceBob)) || ((g_li == 8) && (!g_vm->_roomPresencePat))) {
 		int p = getPresenceStatsRedRoom();
 		int rand;
 
@@ -1259,7 +1261,7 @@ void pl6(int cf) {
 }
 
 void pl9(int cf) {
-	if (!g_bh9) {
+	if (!g_vm->_room9PresenceLeo) {
 		cf = -10;
 		int p, rand;
 		phaz(rand, p, cf);
@@ -1337,7 +1339,8 @@ void pl20(int cf) {
 		setPresenceChapel(h);
 }
 
-void t11(int l11, int &a) {
+int t11(int l11) {
+	int retVal = 0;
 	int p, rand;
 
 	ecfren(p, rand, g_s._faithScore, l11);
@@ -1346,13 +1349,13 @@ void t11(int l11, int &a) {
 		if (p != -500) {
 			if (rand > p) {
 				displayAloneText();
-				a = 0;
+				retVal = 0;
 			} else {
 				becfren(g_li);
-				nouvp(g_li, a);
+				retVal = nouvp(g_li);
 			}
 		} else
-			nouvp(g_li, a);
+			retVal = nouvp(g_li);
 	}
 
 	if (l11 > 9) {
@@ -1376,7 +1379,7 @@ void t11(int l11, int &a) {
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
 				displayAloneText();
-				a = 0;
+				retVal = 0;
 			} else {
 				if (l11 == 10)
 					p = setPresenceDiningRoom(h);
@@ -1388,10 +1391,12 @@ void t11(int l11, int &a) {
 					p = setPresenceLanding();
 				else if (l11 == 20)
 					p = setPresenceChapel(h);
-				a = p;
+				retVal = p;
 			}
 		}
 	}
+
+	return retVal;
 }
 
 void cavegre() {
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index fcabee5..59555fb 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -80,7 +80,7 @@ extern int  getPresenceStatsKitchen();
 extern int  getPresenceStatsAttic();
 extern int  getPresenceStatsLanding();
 extern int  getPresenceStatsChapel(int &hour);
-extern void setPresenceGreenRoom(int l);
+extern void setPresenceGreenRoom(int roomId);
 extern void setPresencePurpleRoom();
 extern void setPresenceBlueRoom();
 extern void setPresenceRedRoom(int l);
@@ -90,7 +90,7 @@ extern int setPresenceKitchen();
 extern int setPresenceLanding();
 extern int setPresenceChapel(int hour);
 extern void getKnockAnswer();
-extern void nouvp(int l, int &p);
+extern int nouvp(int l);
 extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int l);
 extern void becfren(int l);
@@ -110,7 +110,7 @@ extern void pl12(int cf);
 extern void pl13(int cf);
 extern void pl15(int cf);
 extern void pl20(int cf);
-extern void t11(int l11, int &a);
+extern int t11(int l11);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
 extern void aniof(int ouf, int num);
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 48ca45e..bbe4a77 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -96,7 +96,7 @@ void tinke() {
 	if (y_s < 12)
 		return;
 
-	if (!g_blo) {
+	if (!g_vm->g_blo) {
 		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
 			g_t = kTime2;
 		else
@@ -182,7 +182,7 @@ void tinke() {
 	}
 	g_hfb = readclock();
 	if ((g_brt) && ((g_hfb - g_hdb) > 17)) {
-		nouvp(g_li, cx);
+		cx = nouvp(g_li);
 		g_brt = false;
 		g_hdb = 0;
 		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
@@ -301,9 +301,9 @@ void tperd() {
 	g_iouv = 0;
 	g_mchai = 0;
 	unsetSearchMenu();
-	if (!g_blo) {
+	if (!g_vm->g_blo) {
 		int cx;
-		t11(21, cx);
+		cx = t11(21);
 	}
 
 	g_vm->_loseGame = true;
@@ -514,8 +514,8 @@ void t1sama() {    //Entering manor
 		g_s._currPlace = OWN_ROOM;
 		affrep();
 		t5(10);
-		if (!g_blo)
-			t11(0, minute);
+		if (!g_vm->g_blo)
+			minute = t11(0);
 		g_ipers = 0;
 		g_mpers = 0;
 		g_s._ipre = true;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8dd5ac3..95701ca 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -154,7 +154,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	initMouse();
 
 	init_lieu();
-	g_soundOff = false;
+	g_vm->_soundOff = false;
 	g_largestClearScreen = false;
 
 	teskbd();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c44daff..d00d318 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -88,6 +88,8 @@ private:
 	bool _inMainGameLoop;	// Flag when the main game loop is active
 	Common::StringArray _engineStrings;
 	Common::StringArray _gameStrings;
+
+
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
 	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
@@ -100,6 +102,21 @@ private:
 	void playGame();
 	void handleAction();
 public:
+	bool g_blo;
+	bool _roomPresenceLuc;
+	bool _roomPresenceIda;
+	bool _purpleRoomPresenceLeo;
+	bool _roomPresenceGuy;
+	bool _roomPresenceEva;
+	bool _roomPresenceMax;
+	bool _roomPresenceBob;
+	bool _roomPresencePat;
+	bool _toiletsPresenceBobMax;
+	bool _bathRoomPresenceBobMax;
+	bool _room9PresenceLeo;
+
+	bool _soundOff;
+
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
 	GfxSurface _backgroundSurface;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 3b381dd..d6ffb11 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -417,7 +417,7 @@ void moveMouse(bool &funct, char &key) {
 			cy = 8;
 			break;
 		case '\23':
-			g_soundOff = !g_soundOff;
+			g_vm->_soundOff = !g_vm->_soundOff;
 			return;
 			break;
 		case '\26':
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index d5bb43a..cab69c0 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -161,7 +161,7 @@ void music() {
 	bool fin;
 
 	/* debug('o3 music'); */
-	if (g_soundOff)
+	if (g_vm->_soundOff)
 		return;
 
 	g_rech_cfiec = true;
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index ff6ad7f..e08cbeb 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -87,7 +87,7 @@ void startSpeech(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
 
-	if (g_soundOff)
+	if (g_vm->_soundOff)
 		return;
 
 	g_num_ph = rep;
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 3e21a35..4795480 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -27,6 +27,7 @@
 
 #include "common/file.h"
 #include "common/str.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/level15.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
@@ -251,8 +252,8 @@ void taffich() {
 	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			displayAloneText();
-		else if (!g_blo)
-			t11(g_s._currPlace, cx);
+		else if (!g_vm->g_blo)
+			cx = t11(g_s._currPlace);
 		g_mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 7517beb..1a5f137 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -223,20 +223,7 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-extern bool g_blo,
-        g_bh1,
-        g_bf1,
-        g_bh2,
-        g_bh4,
-        g_bf4,
-        g_bh5,
-        g_bh6,
-        g_bh8,
-        g_bt3,
-        g_bt7,
-        g_bh9,
-
-        g_soundOff,
+extern bool 
         g_main1,
         g_choisi,
         g_test0,


Commit: fcf07e01b88128d72ec8145906a80efa26ce7c21
    https://github.com/scummvm/scummvm/commit/fcf07e01b88128d72ec8145906a80efa26ce7c21
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:22:57-07:00

Commit Message:
MORTEVIELLE: Move (and rename) some more globals to MortevielleEngine

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index d4a5378..cd08177 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -57,9 +57,9 @@ void fctMove() {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
-		if (g_iesc)
+		if (g_vm->_keyPressedEsc)
 			g_okdes = false;
-		if ((g_anyone) || (g_iesc))
+		if ((g_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(1);
 		if (g_num == 0)
@@ -224,7 +224,7 @@ void fctTake() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_TAKE));
 	tfleche();
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	if (g_caff == 3) {
 		tcoord(2);
@@ -322,12 +322,10 @@ void fctInventoryTake() {
  * @remarks	Originally called 'tsoulever'
  */
 void fctLift() {
-//	int cx;
-
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(3);
 	if (g_num == 0) {
@@ -364,7 +362,7 @@ void fctRead() {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_READ));
 		tfleche();
-		if (!(g_anyone) && !(g_iesc)) {
+		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
 			tcoord(4);
 			if (g_num != 0)
 				g_crep = 107;
@@ -397,7 +395,7 @@ void fctLook() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_LOOK));
 	tfleche();
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(5);
 	if (g_num == 0) {
@@ -488,7 +486,7 @@ void fctSearch() {
 		ecr3(g_vm->getEngineString(S_SEARCH));
 
 	tfleche();
-	if (g_anyone || g_iesc)
+	if (g_anyone || g_vm->_keyPressedEsc)
 		return;
 
 	if (g_s._currPlace == 23) {
@@ -599,7 +597,7 @@ void fctOpen() {
 	}
 
 	tfleche();
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 
 	tcoord(7);
@@ -652,10 +650,10 @@ void fctPlace() {
 		ecr3(g_vm->getEngineString(S_PUT));
 
 	tfleche();
-	if (g_iesc)
+	if (g_vm->_keyPressedEsc)
 		g_crep = 998;
 
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 
 	tcoord(8);
@@ -784,7 +782,7 @@ void fctTurn() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_TURN));
 	tfleche();
-	if ((g_anyone) || (g_iesc))
+	if ((g_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(9);
 	if (g_num != 0) {
@@ -820,12 +818,12 @@ void fctSelfHide() {
 	if (!g_syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
-	if (!(g_anyone) && !(g_iesc)) {
+	if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
 		tcoord(10);
 		if (g_num == 0)
-			g_cache = false;
+			g_vm->_hiddenHero = false;
 		else {
-			g_cache = true;
+			g_vm->_hiddenHero = true;
 			g_crep = 999;
 		}
 	}
@@ -842,7 +840,7 @@ void fctAttach() {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_TIE));
 		tfleche();
-		if (!(g_anyone) && !(g_iesc)) {
+		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
 			tcoord(8);
 			g_crep = 997;
 			if ((g_num != 0) && (g_s._currPlace == WELL)) {
@@ -868,9 +866,9 @@ void fctClose() {
 
 	if (g_caff < 26) {
 		tfleche();
-		if (g_iesc)
+		if (g_vm->_keyPressedEsc)
 			g_crep = 998;
-		if ((g_anyone) || (g_iesc))
+		if ((g_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(7);
 		if (g_num != 0) {
@@ -915,7 +913,7 @@ void fctKnock() {
 
 	if (g_s._currPlace < DOOR) {
 		tfleche();
-		if (!(g_anyone) && !(g_iesc)) {
+		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
 			if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING))
 				g_crep = 133;
 			else
@@ -966,7 +964,7 @@ void fctSelfPut() {
 			return;
 		}
 		tfleche();
-		if ((g_anyone) || (g_iesc))
+		if ((g_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(7);
 		g_crep = 124;
@@ -1138,7 +1136,7 @@ void fctEnter() {
 			g_s._teauto[8] = '*';
 	} else {
 		int z = 0;
-		if (!g_vm->g_blo)
+		if (!g_vm->_blo)
 			z = t11(g_ment);
 		if (z != 0) {
 			if ((g_ment == 3) || (g_ment == 7))
@@ -1155,12 +1153,12 @@ void fctEnter() {
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
 				g_syn = true;
 				if (g_ment == 9) {
-					g_col = true;
+					g_vm->_col = true;
 					g_caff = 70;
 					afdes(0);
 					repon(2, g_caff);
 				} else
-					g_col = false;
+					g_vm->_col = false;
 				debloc(g_ment);
 				g_ment = 0;
 			}
@@ -1237,7 +1235,7 @@ void fctForce() {
 	if (g_caff < 25)
 		tfleche();
 
-	if ((!g_anyone) && (!g_iesc)) {
+	if ((!g_anyone) && (!g_vm->_keyPressedEsc)) {
 		if (g_s._currPlace != 26)
 			g_crep = 997;
 		else {
@@ -1297,7 +1295,7 @@ void fctWait() {
 	do {
 		++g_jh;
 		tinke();
-		if (!g_vm->g_blo)
+		if (!g_vm->_blo)
 			quel = t11(g_s._currPlace);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
@@ -1327,7 +1325,7 @@ void fctSound() {
 		ecr3(g_vm->getEngineString(S_PROBE2));
 	if (g_caff < 27) {
 		tfleche();
-		if (!(g_anyone) && (!g_iesc))
+		if (!(g_anyone) && (!g_vm->_keyPressedEsc))
 			g_crep = 145;
 		g_num = 0;
 	}
@@ -1345,7 +1343,7 @@ void fctDiscuss() {
 	bool f;
 
 	endSearch();
-	if (g_col)
+	if (g_vm->_col)
 		suj = 128;
 	else {
 		cx = 0;
@@ -1463,8 +1461,8 @@ void fctDiscuss() {
 		g_vm->setMouseClick(false);
 		if (choi != 46) {
 			int ix = choi - 1;
-			if (g_col) {
-				g_col = false;
+			if (g_vm->_col) {
+				g_vm->_col = false;
 				g_s._currPlace = 15;
 				if (g_iouv > 0)
 					max = 8;
@@ -1507,15 +1505,15 @@ void fctDiscuss() {
 			showMouse();
 		}
 	} while ((choi != 46) && (suj != 138));
-	if (g_col) {
+	if (g_vm->_col) {
 		g_s._faithScore += (3 * (g_s._faithScore / 10));
 		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 138);
 		showMouse();
-		g_col = false;
-		g_s._currPlace = 15;
+		g_vm->_col = false;
+		g_s._currPlace = LANDING;
 	}
 	g_ctrm = 0;
 	hideMouse();
@@ -1541,7 +1539,7 @@ void fctSmell() {
 		if (!g_syn)
 			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
-		if (!(g_anyone) && !(g_iesc))
+		if (!(g_anyone) && !(g_vm->_keyPressedEsc))
 			if (g_caff == 16)
 				g_crep = 153;
 	} else if (g_caff == 123)
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 717a256..c4b476c 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -468,7 +468,7 @@ void f3f8::ani50() {
 	pictout(adani, g_crep, 63, 12);
 	g_crep = animof(2, 1);
 	pictout(adani, g_crep, 63, 12);
-	g_largestClearScreen = (g_res == 1);
+	g_vm->_largestClearScreen = (g_res == 1);
 	repon(2, kDialogStringIndex + 143);
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index f2f19b6..9a0bcec 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -192,9 +192,9 @@ void Menu::drawMenu() {
 	_menuActive = true;
 	g_msg4 = OPCODE_NONE;
 	g_msg3 = OPCODE_NONE;
-	g_choisi = false;
+	_menuSelected = false;
 	g_vm->setMouseClick(false);
-	g_test0 = false;
+	_multiTitle = false;
 }
 
 void Menu::invers(int ix) {
@@ -353,7 +353,7 @@ void Menu::menuDown(int ii) {
 		}
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (cx != nb_lig);
-	g_test0 = true;
+	_multiTitle = true;
 	showMouse();
 }
 
@@ -361,7 +361,7 @@ void Menu::menuDown(int ii) {
  * Menu is being removed, so restore the previous background area.
  */
 void Menu::menuUp(int xx) {
-	if (g_test0) {
+	if (_multiTitle) {
 		charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
@@ -375,7 +375,7 @@ void Menu::menuUp(int xx) {
 		// Copy the data
 		Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest);
 
-		g_test0 = false;
+		_multiTitle = false;
 	}
 }
 
@@ -428,7 +428,7 @@ void Menu::mdn() {
 			else
 				ix = MENU_FILE;
 
-			if ((ix != g_msg3) || (!g_test0))
+			if ((ix != g_msg3) || (!_multiTitle))
 				if (!((ix == MENU_FILE) && ((g_msg3 == MENU_SAVE) || (g_msg3 == MENU_LOAD)))) {
 					menuUp(g_msg3);
 					menuDown(ix);
@@ -436,7 +436,7 @@ void Menu::mdn() {
 					g_msg4 = OPCODE_NONE;
 				}
 		} else { // Not in the MenuTitle line
-			if ((y > 11) && (g_test0))
+			if ((y > 11) && (_multiTitle))
 				util(x, y);
 		}
 	} else {       // There was a click
@@ -453,7 +453,7 @@ void Menu::mdn() {
 			g_vm->setMouseClick(false);
 		} else { 
 			//  A menu was clicked on
-			g_choisi = (g_test0) && (g_msg4 != OPCODE_NONE);
+			_menuSelected = (_multiTitle) && (g_msg4 != OPCODE_NONE);
 			menuUp(g_msg3);
 			g_msg[4] = g_msg4;
 			g_msg[3] = g_msg3;
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index cdd343a..5672ef7 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -39,6 +39,9 @@ private:
 	void menuDown(int ii);
 public:
 	bool _menuActive;
+	bool _menuSelected;
+	bool _multiTitle;
+	bool _menuDisplayed;
 	Common::String _inventoryStringArray[9];
 	Common::String _moveStringArray[8];
 	Common::String _actionStringArray[22];
@@ -47,7 +50,7 @@ public:
 	int _discussMenu[9];
 	int _inventoryMenu[9];
 	int _moveMenu[8];
-public:
+
 	void setText(int menuId, Common::String name);
 	void disableMenuItem(int menuId);
 	void enableMenuItem(int menuId);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 24548fa..e3bc524 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -166,10 +166,10 @@ void clsf1() {
  */
 void clearScreenType2() {
 	hideMouse();
-	if (g_largestClearScreen) {
+	if (g_vm->_largestClearScreen) {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
-		g_largestClearScreen = false;
+		g_vm->_largestClearScreen = false;
 	} else {
 		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
 		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
@@ -194,7 +194,7 @@ void ecr2(Common::String str_) {
 		g_vm->_screenSurface.putxy(8, 182);
 		g_vm->_screenSurface.drawString(copy(str_, tlig, tlig << 1), 5);
 	} else {
-		g_largestClearScreen = true;
+		g_vm->_largestClearScreen = true;
 		clearScreenType2();
 		g_vm->_screenSurface.putxy(8, 176);
 		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
@@ -318,9 +318,9 @@ void repon(int f, int m) {
 		tmpStr = deline(m - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
-			g_largestClearScreen = true;
+			g_vm->_largestClearScreen = true;
 		else
-			g_largestClearScreen = false;
+			g_vm->_largestClearScreen = false;
 
 		clearScreenType2();
 		displayStr(tmpStr, 8, 176, 85, 3, 5);
@@ -385,7 +385,7 @@ void repon(int f, int m) {
 
 void t5(int cx) {
 	if (cx == 10)
-		g_vm->g_blo = false;
+		g_vm->_blo = false;
 
 	if (cx != 1) {
 		g_vm->_roomPresenceLuc = false;
@@ -1201,7 +1201,7 @@ void dprog() {
 	g_li = 21;
 	g_jh = 0;
 	if (!g_s._ipre)
-		g_vm->g_blo = true;
+		g_vm->_blo = true;
 	g_t = kTime1;
 	g_mh = readclock();
 }
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index bbe4a77..4c3342b 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -96,7 +96,7 @@ void tinke() {
 	if (y_s < 12)
 		return;
 
-	if (!g_vm->g_blo) {
+	if (!g_vm->_blo) {
 		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
 			g_t = kTime2;
 		else
@@ -301,7 +301,7 @@ void tperd() {
 	g_iouv = 0;
 	g_mchai = 0;
 	unsetSearchMenu();
-	if (!g_vm->g_blo) {
+	if (!g_vm->_blo) {
 		int cx;
 		cx = t11(21);
 	}
@@ -312,7 +312,7 @@ void tperd() {
 	repon(9, g_crep);
 	clearScreenType2();
 	clsf3();
-	g_col = false;
+	g_vm->_col = false;
 	g_syn = false;
 	g_okdes = false;
 }
@@ -514,7 +514,7 @@ void t1sama() {    //Entering manor
 		g_s._currPlace = OWN_ROOM;
 		affrep();
 		t5(10);
-		if (!g_vm->g_blo)
+		if (!g_vm->_blo)
 			minute = t11(0);
 		g_ipers = 0;
 		g_mpers = 0;
@@ -563,13 +563,13 @@ void tctrm() {
 
 
 void quelquun() {
-	if (g_imen)
+	if (g_vm->_menu._menuDisplayed)
 		g_vm->_menu.eraseMenu();
 
 	endSearch();
 	g_crep = 997;
 L1:
-	if (!g_cache) {
+	if (!g_vm->_hiddenHero) {
 		if (g_crep == 997)
 			g_crep = 138;
 		repon(2, g_crep);
@@ -592,10 +592,10 @@ L1:
 		g_msg[3] = MENU_DISCUSS;
 		g_msg[4] = g_vm->_menu._discussMenu[cx];
 		g_syn = true;
-		g_col = true;
+		g_vm->_col = true;
 	} else {
 		if (getRandomNumber(1, 3) == 2) {
-			g_cache = false;
+			g_vm->_hiddenHero = false;
 			g_crep = 137;
 			goto L1;
 		} else {
@@ -608,7 +608,7 @@ L1:
 			affrep();
 		}
 	}
-	if (g_imen)
+	if (g_vm->_menu._menuDisplayed)
 		g_vm->_menu.drawMenu();
 }
 
@@ -665,7 +665,7 @@ void tfleche() {
 	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
 
 	if (touch == '\73')
-		g_iesc = true;
+		g_vm->_keyPressedEsc = true;
 
 	if (g_rect) {
 		g_x = x_s;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 95701ca..42c714e 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -154,8 +154,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	initMouse();
 
 	init_lieu();
-	g_vm->_soundOff = false;
-	g_largestClearScreen = false;
+	_soundOff = false;
+	_largestClearScreen = false;
 
 	teskbd();
 	dialpre();
@@ -553,9 +553,9 @@ void MortevielleEngine::handleAction() {
 	clsf3();
 	oo = false;
 	g_ctrm = 0;
-	if (!g_iesc) {
+	if (!_keyPressedEsc) {
 		g_vm->_menu.drawMenu();
-		g_imen = true;
+		g_vm->_menu._menuDisplayed = true;
 		temps = 0;
 		g_key = 0;
 		funct = false;
@@ -568,20 +568,20 @@ void MortevielleEngine::handleAction() {
 			moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
-		} while (!((g_choisi) || (temps > lim) || (funct) || (g_anyone)));
+		} while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (g_anyone)));
 		_inMainGameLoop = false;
 
 		g_vm->_menu.eraseMenu();
-		g_imen = false;
+		g_vm->_menu._menuDisplayed = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (g_choisi && (g_msg[3] == MENU_SAVE)) {
+		if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_SAVE)) {
 			Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7);
 			g_vm->_savegameManager.saveGame(g_msg[4] & 7, saveName);
 		}
-		if (g_choisi && (g_msg[3] == MENU_LOAD))
+		if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_LOAD))
 			g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(g_hintPctMessage, 1);
@@ -639,7 +639,7 @@ void MortevielleEngine::handleAction() {
 						g_okdes = false;
 						dessin(0);
 					}
-					if ((!g_syn) || (g_col))
+					if ((!g_syn) || (_col))
 						repon(2, g_crep);
 				}
 			} while (g_syn);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index d00d318..30b1b98 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -102,7 +102,6 @@ private:
 	void playGame();
 	void handleAction();
 public:
-	bool g_blo;
 	bool _roomPresenceLuc;
 	bool _roomPresenceIda;
 	bool _purpleRoomPresenceLeo;
@@ -116,6 +115,13 @@ public:
 	bool _room9PresenceLeo;
 
 	bool _soundOff;
+	bool _largestClearScreen;
+	bool _hiddenHero;
+	bool _keyPressedEsc;
+
+	bool _blo;
+	bool _col;
+
 
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 36d5265..a74def2 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -70,12 +70,12 @@ void changeGraphicalDevice(int newDevice) {
  */
 void MortevielleEngine::gameLoaded() {
 	hideMouse();
-	g_imen = false;
+	_menu._menuDisplayed = false;
 	_loseGame = true;
 	g_anyone = false;
 	g_okdes = true;
-	g_col = false;
-	g_cache = false;
+	_col = false;
+	_hiddenHero = false;
 	g_brt = false;
 	g_maff = 68;
 	g_mnumo = 0;
@@ -132,10 +132,10 @@ void tmaj3() {
 }
 
 void tsitu() {
-	if (!g_col)
+	if (!g_vm->_col)
 		clearScreenType2();
 	g_syn = false;
-	g_iesc = false;
+	g_vm->_keyPressedEsc = false;
 	if (!g_anyone) {
 		if (g_brt)
 			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
@@ -199,7 +199,7 @@ void tsitu() {
 			fctSelfPut();
 		if (g_msg[4] == OPCODE_SLOOK)
 			fctSelftLook();
-		g_cache = false;
+		g_vm->_hiddenHero = false;
 
 		if (g_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 4795480..6fe9f61 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -252,7 +252,7 @@ void taffich() {
 	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			displayAloneText();
-		else if (!g_vm->g_blo)
+		else if (!g_vm->_blo)
 			cx = t11(g_s._currPlace);
 		g_mpers =  0;
 	}
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 0fe22fc..d9aa291 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,29 +78,7 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool g_blo,
-        g_bh1,
-        g_bf1,
-        g_bh2,
-        g_bh4,
-        g_bf4,
-        g_bh5,
-        g_bh6,
-        g_bh8,
-        g_bt3,
-        g_bt7,
-        g_bh9,
-
-        g_soundOff,
-        g_main1,
-        g_choisi,
-        g_test0,
-        g_largestClearScreen,
-        g_imen,
-        g_cache,
-        g_iesc,
-        g_col,
-        g_syn,
+bool    g_syn,
         g_heroSearching,
         g_zuul,
         g_obpart,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 1a5f137..610b302 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -224,14 +224,6 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 /*---------------------------------------------------------------------------*/
 
 extern bool 
-        g_main1,
-        g_choisi,
-        g_test0,
-        g_largestClearScreen,
-        g_imen,
-        g_cache,
-        g_iesc,
-        g_col,
         g_syn,
         g_heroSearching,
         g_zuul,


Commit: d31a85aa1437369d998e03b1cb345cdd084eed3d
    https://github.com/scummvm/scummvm/commit/d31a85aa1437369d998e03b1cb345cdd084eed3d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2012-04-05T23:22:59-07:00

Commit Message:
MORTEVIELLE: Fix crash in chartex method for French version

Changed paths:
    engines/mortevielle/ovd1.cpp



diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index cab69c0..8641a18 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -105,21 +105,24 @@ void chartex() {
 	if (!inpFile.open("TXX.INP")) {
 		if (!inpFile.open("TXX.MOR")) {
 			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+			return;
 		}
-	} else if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
-		warning("TXX file - Unexpected format - Switching to DAT file");
+	} 
+	if (!ntpFile.open("TXX.NTP")) {
+		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
 		return;
-	} else {
-		for (int i = 0; i < inpFile.size() / 2; ++i)
-			g_t_mot[i] = inpFile.readUint16LE();
-	
-		inpFile.close();
-		g_vm->_txxFileFl = true;
 	}
+	
+	if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
+		warning("TXX file - Unexpected format - Switching to DAT file");
+		return;
+	} 
 
-	if (!ntpFile.open("TXX.NTP")) {
-		error("Missing file - TXX.NTP");
-	}
+	for (int i = 0; i < inpFile.size() / 2; ++i)
+		g_t_mot[i] = inpFile.readUint16LE();
+
+	inpFile.close();
+	g_vm->_txxFileFl = true;
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
 		g_t_rec[i]._indis = ntpFile.readSint16LE();


Commit: 4a86ef81f08ca15527750b3a577e7ce85ab48025
    https://github.com/scummvm/scummvm/commit/4a86ef81f08ca15527750b3a577e7ce85ab48025
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:01-07:00

Commit Message:
MORTEVIELLE: Some more renaming, fix a couple of GCC warnings

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index cd08177..cabd052 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -54,7 +54,7 @@ void fctMove() {
 		repon(2, g_s._currPlace);
 	}
 	if ((g_s._currPlace == LANDING) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		if (!g_syn)
+		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
 		if (g_vm->_keyPressedEsc)
@@ -189,7 +189,7 @@ void fctTake() {
 		if (g_crep != 139) {
 			if (g_ipers > 0)
 				g_s._faithScore += 3;
-			if (g_obpart) {
+			if (g_vm->_obpart) {
 				if (g_s._currPlace == PURPLE_ROOM)
 					g_s._purpleRoomObjectId = 0;
 				if (g_s._currPlace == ATTIC) {
@@ -207,7 +207,7 @@ void fctTake() {
 				if (g_s._currPlace == WELL)
 					g_s._wellObjectId = 0;
 				unsetSearchMenu();
-				g_obpart = false;
+				g_vm->_obpart = false;
 				affrep();
 			} else {
 				g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
@@ -221,7 +221,7 @@ void fctTake() {
 		}
 		return;
 	}
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_TAKE));
 	tfleche();
 	if ((g_anyone) || (g_vm->_keyPressedEsc))
@@ -322,7 +322,7 @@ void fctInventoryTake() {
  * @remarks	Originally called 'tsoulever'
  */
 void fctLift() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
 	if ((g_anyone) || (g_vm->_keyPressedEsc))
@@ -359,7 +359,7 @@ void fctRead() {
 	if (g_caff > 99)
 		st4(g_caff);
 	else {
-		if (!g_syn)
+		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_READ));
 		tfleche();
 		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
@@ -392,7 +392,7 @@ void fctLook() {
 		g_crep = 103;
 		return;
 	}
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_LOOK));
 	tfleche();
 	if ((g_anyone) || (g_vm->_keyPressedEsc))
@@ -482,7 +482,7 @@ void fctSearch() {
 		return;
 	}
 
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_SEARCH));
 
 	tfleche();
@@ -513,7 +513,7 @@ void fctSearch() {
 				if (g_mchai != 0) {
 					g_cs = 0;
 					g_is = 0;
-					g_heroSearching = true;
+					g_vm->_heroSearching = true;
 					setSearchMenu();
 					tsuiv();
 				} else
@@ -579,13 +579,13 @@ void fctSelfSearch() {
  * @remarks	Originally called 'touvrir'
  */
 void fctOpen() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_OPEN));
 
 	if (g_caff == 26) {
 		if (g_ment != 0) {
 			g_msg[4] = OPCODE_ENTER;
-			g_syn = true;
+			g_vm->_syn = true;
 		} else
 			g_crep = 997;
 		return;
@@ -646,7 +646,7 @@ void fctPlace() {
 		return;
 	}
 
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_PUT));
 
 	tfleche();
@@ -779,7 +779,7 @@ void fctTurn() {
 		g_crep = 149;
 		return;
 	}
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_TURN));
 	tfleche();
 	if ((g_anyone) || (g_vm->_keyPressedEsc))
@@ -815,7 +815,7 @@ void fctTurn() {
  * @remarks	Originally called 'tcacher'
  */
 void fctSelfHide() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
 	if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
@@ -837,7 +837,7 @@ void fctAttach() {
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
-		if (!g_syn)
+		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_TIE));
 		tfleche();
 		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
@@ -861,7 +861,7 @@ void fctAttach() {
  * @remarks	Originally called 'tfermer'
  */
 void fctClose() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_CLOSE));
 
 	if (g_caff < 26) {
@@ -903,7 +903,7 @@ void fctClose() {
 void fctKnock() {
 	warning("Knock - _currPlace %d", g_s._currPlace);
 
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_HIT));
 
 	if (g_s._currPlace == LANDING) {
@@ -951,7 +951,7 @@ void fctKnock() {
  * @remarks	Originally called 'tposer'
  */
 void fctSelfPut() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_POSE));
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
@@ -1151,7 +1151,7 @@ void fctEnter() {
 				g_s._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = g_vm->_menu._discussMenu[g_x];
-				g_syn = true;
+				g_vm->_syn = true;
 				if (g_ment == 9) {
 					g_vm->_col = true;
 					g_caff = 70;
@@ -1230,7 +1230,7 @@ void fctSleep() {
  * @remarks	Originally called 'tdefoncer'
  */
 void fctForce() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_SMASH));
 	if (g_caff < 25)
 		tfleche();
@@ -1286,8 +1286,6 @@ void fctLeave() {
  * @remarks	Originally called 'tattendre'
  */
 void fctWait() {
-	int quel;
-
 	g_mpers = 0;
 	clsf3();
 
@@ -1296,7 +1294,7 @@ void fctWait() {
 		++g_jh;
 		tinke();
 		if (!g_vm->_blo)
-			quel = t11(g_s._currPlace);
+			t11(g_s._currPlace);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
 			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
@@ -1321,7 +1319,7 @@ void fctWait() {
  * @remarks	Originally called 'tsonder'
  */
 void fctSound() {
-	if (!g_syn)
+	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_PROBE2));
 	if (g_caff < 27) {
 		tfleche();
@@ -1536,7 +1534,7 @@ void fctDiscuss() {
 void fctSmell() {
 	g_crep = 119;
 	if (g_caff < 26) {
-		if (!g_syn)
+		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
 		if (!(g_anyone) && !(g_vm->_keyPressedEsc))
@@ -1554,7 +1552,7 @@ void fctSmell() {
 void fctScratch() {
 	g_crep = 155;
 	if (g_caff < 27) {
-		if (!g_syn)
+		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_SCRATCH));
 		tfleche();
 	}
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index 4c3342b..bf62fe3 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -301,10 +301,8 @@ void tperd() {
 	g_iouv = 0;
 	g_mchai = 0;
 	unsetSearchMenu();
-	if (!g_vm->_blo) {
-		int cx;
-		cx = t11(21);
-	}
+	if (!g_vm->_blo)
+		t11(21);
 
 	g_vm->_loseGame = true;
 	clsf1();
@@ -313,7 +311,7 @@ void tperd() {
 	clearScreenType2();
 	clsf3();
 	g_vm->_col = false;
-	g_syn = false;
+	g_vm->_syn = false;
 	g_okdes = false;
 }
 
@@ -425,8 +423,8 @@ void sparl(float adr, float rep) {
  * @remarks	Originally called 'finfouill'
  */
 void endSearch() {
-	g_heroSearching = false;
-	g_obpart = false;
+	g_vm->_heroSearching = false;
+	g_vm->_obpart = false;
 	g_cs = 0;
 	g_is = 0;
 	unsetSearchMenu();
@@ -591,7 +589,7 @@ L1:
 		g_crep = g_caff;
 		g_msg[3] = MENU_DISCUSS;
 		g_msg[4] = g_vm->_menu._discussMenu[cx];
-		g_syn = true;
+		g_vm->_syn = true;
 		g_vm->_col = true;
 	} else {
 		if (getRandomNumber(1, 3) == 2) {
@@ -763,7 +761,7 @@ void treg(int ob) {
 		g_msg[3] = 0;
 		g_crep = 998;
 	} else {
-		g_obpart = true;
+		g_vm->_obpart = true;
 		g_crep = g_caff + 400;
 		setSearchMenu();
 	}
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 42c714e..8677798 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -144,7 +144,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	g_currGraphicalDevice = MODE_EGA;
 	g_newGraphicalDevice = g_currGraphicalDevice;
-	g_zuul = false;
+	_zuul = false;
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
@@ -613,13 +613,13 @@ void MortevielleEngine::handleAction() {
 			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
 				g_mnumo = g_msg[4];
 			if (!g_anyone) {
-				if ((g_heroSearching) || (g_obpart)) {
+				if ((g_vm->_heroSearching) || (_obpart)) {
 					if (y_s < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
 						oo = true;
-						if ((g_msg[4] == OPCODE_LIFT) || (g_obpart)) {
+						if ((g_msg[4] == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
 							g_caff = g_s._currPlace;
 							g_crep = 998;
@@ -639,10 +639,10 @@ void MortevielleEngine::handleAction() {
 						g_okdes = false;
 						dessin(0);
 					}
-					if ((!g_syn) || (_col))
+					if ((!g_vm->_syn) || (_col))
 						repon(2, g_crep);
 				}
-			} while (g_syn);
+			} while (g_vm->_syn);
 			if (g_ctrm != 0)
 				tctrm();
 		}
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 30b1b98..b2a8ff6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -117,10 +117,14 @@ public:
 	bool _soundOff;
 	bool _largestClearScreen;
 	bool _hiddenHero;
+	bool _heroSearching;
 	bool _keyPressedEsc;
 
 	bool _blo;
 	bool _col;
+	bool _syn;
+	bool _zuul;
+	bool _obpart;
 
 
 	ScreenSurface _screenSurface;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index d6ffb11..55edea5 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -421,7 +421,7 @@ void moveMouse(bool &funct, char &key) {
 			return;
 			break;
 		case '\26':
-			g_zuul = true;
+			g_vm->_zuul = true;
 			return;
 			break;
 		case '\24':           // ^T => mode tandy
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index a74def2..eb6b979 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -88,8 +88,8 @@ void MortevielleEngine::gameLoaded() {
 	g_cs = 0;
 	g_is = 0;
 	g_ment = 0;
-	g_syn = true;
-	g_heroSearching = true;
+	g_vm->_syn = true;
+	g_vm->_heroSearching = true;
 	g_mchai = 0;
 	g_inei = 0;
 	initouv();
@@ -101,7 +101,7 @@ void MortevielleEngine::gameLoaded() {
 	g_okdes = false;
 	_endGame = true;
 	_loseGame = false;
-	g_heroSearching = false;
+	g_vm->_heroSearching = false;
 
 	displayAloneText();
 	tinke();
@@ -134,7 +134,7 @@ void tmaj3() {
 void tsitu() {
 	if (!g_vm->_col)
 		clearScreenType2();
-	g_syn = false;
+	g_vm->_syn = false;
 	g_vm->_keyPressedEsc = false;
 	if (!g_anyone) {
 		if (g_brt)
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index d9aa291..2903abf 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,11 +78,7 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool    g_syn,
-        g_heroSearching,
-        g_zuul,
-        g_obpart,
-        g_okdes,
+bool    g_okdes,
         g_arret,
         g_anyone,
         g_brt,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 610b302..0402cd6 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -224,10 +224,6 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 /*---------------------------------------------------------------------------*/
 
 extern bool 
-        g_syn,
-        g_heroSearching,
-        g_zuul,
-        g_obpart,
         g_okdes,
         g_anyone,
         g_brt,


Commit: 149e9367deb68889c7da1b7ce6dc9671749f015d
    https://github.com/scummvm/scummvm/commit/149e9367deb68889c7da1b7ce6dc9671749f015d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:02-07:00

Commit Message:
MORTEVIELLE: Remove global variable zuul

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8677798..38b2343 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -144,7 +144,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	g_currGraphicalDevice = MODE_EGA;
 	g_newGraphicalDevice = g_currGraphicalDevice;
-	_zuul = false;
 	charpal();
 	charge_cfiph();
 	charge_cfiec();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b2a8ff6..69446ae 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -123,7 +123,6 @@ public:
 	bool _blo;
 	bool _col;
 	bool _syn;
-	bool _zuul;
 	bool _obpart;
 
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 55edea5..8ae8635 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -420,10 +420,6 @@ void moveMouse(bool &funct, char &key) {
 			g_vm->_soundOff = !g_vm->_soundOff;
 			return;
 			break;
-		case '\26':
-			g_vm->_zuul = true;
-			return;
-			break;
 		case '\24':           // ^T => mode tandy
 			funct = true;
 			key = '\11';


Commit: db92a1bc3e3a646edcb72f8f3520b5f965dd38b7
    https://github.com/scummvm/scummvm/commit/db92a1bc3e3a646edcb72f8f3520b5f965dd38b7
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:03-07:00

Commit Message:
MORTEVIELLE: Fix regression due to uninitialized variable, move remaining global booleans

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index cabd052..6733d24 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -58,8 +58,8 @@ void fctMove() {
 			ecr3(g_vm->getEngineString(S_GO_TO));
 		tfleche();
 		if (g_vm->_keyPressedEsc)
-			g_okdes = false;
-		if ((g_anyone) || (g_vm->_keyPressedEsc))
+			g_vm->_okdes = false;
+		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(1);
 		if (g_num == 0)
@@ -224,7 +224,7 @@ void fctTake() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_TAKE));
 	tfleche();
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	if (g_caff == 3) {
 		tcoord(2);
@@ -325,7 +325,7 @@ void fctLift() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(3);
 	if (g_num == 0) {
@@ -362,7 +362,7 @@ void fctRead() {
 		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_READ));
 		tfleche();
-		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
 			tcoord(4);
 			if (g_num != 0)
 				g_crep = 107;
@@ -395,7 +395,7 @@ void fctLook() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_LOOK));
 	tfleche();
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(5);
 	if (g_num == 0) {
@@ -486,7 +486,7 @@ void fctSearch() {
 		ecr3(g_vm->getEngineString(S_SEARCH));
 
 	tfleche();
-	if (g_anyone || g_vm->_keyPressedEsc)
+	if (g_vm->_anyone || g_vm->_keyPressedEsc)
 		return;
 
 	if (g_s._currPlace == 23) {
@@ -597,7 +597,7 @@ void fctOpen() {
 	}
 
 	tfleche();
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 
 	tcoord(7);
@@ -653,7 +653,7 @@ void fctPlace() {
 	if (g_vm->_keyPressedEsc)
 		g_crep = 998;
 
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 
 	tcoord(8);
@@ -782,7 +782,7 @@ void fctTurn() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_TURN));
 	tfleche();
-	if ((g_anyone) || (g_vm->_keyPressedEsc))
+	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 		return;
 	tcoord(9);
 	if (g_num != 0) {
@@ -818,7 +818,7 @@ void fctSelfHide() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
-	if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
+	if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
 		tcoord(10);
 		if (g_num == 0)
 			g_vm->_hiddenHero = false;
@@ -840,7 +840,7 @@ void fctAttach() {
 		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_TIE));
 		tfleche();
-		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
 			tcoord(8);
 			g_crep = 997;
 			if ((g_num != 0) && (g_s._currPlace == WELL)) {
@@ -868,7 +868,7 @@ void fctClose() {
 		tfleche();
 		if (g_vm->_keyPressedEsc)
 			g_crep = 998;
-		if ((g_anyone) || (g_vm->_keyPressedEsc))
+		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(7);
 		if (g_num != 0) {
@@ -913,7 +913,7 @@ void fctKnock() {
 
 	if (g_s._currPlace < DOOR) {
 		tfleche();
-		if (!(g_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
 			if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING))
 				g_crep = 133;
 			else
@@ -964,7 +964,7 @@ void fctSelfPut() {
 			return;
 		}
 		tfleche();
-		if ((g_anyone) || (g_vm->_keyPressedEsc))
+		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
 			return;
 		tcoord(7);
 		g_crep = 124;
@@ -1219,7 +1219,7 @@ void fctSleep() {
 			h = 0;
 		tinke();
 		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
-		g_anyone = false;
+		g_vm->_anyone = false;
 	} while (answer != 1);
 	g_crep = 998;
 	g_num = 0;
@@ -1235,7 +1235,7 @@ void fctForce() {
 	if (g_caff < 25)
 		tfleche();
 
-	if ((!g_anyone) && (!g_vm->_keyPressedEsc)) {
+	if ((!g_vm->_anyone) && (!g_vm->_keyPressedEsc)) {
 		if (g_s._currPlace != 26)
 			g_crep = 997;
 		else {
@@ -1300,9 +1300,9 @@ void fctWait() {
 			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
 				cavegre();
 			if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
-				g_anyone = true;
+				g_vm->_anyone = true;
 			g_mpers = g_ipers;
-			if (!g_anyone)
+			if (!g_vm->_anyone)
 				tinke();
 			return;
 		}
@@ -1310,7 +1310,7 @@ void fctWait() {
 		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
 	g_crep = 998;
-	if (!g_anyone)
+	if (!g_vm->_anyone)
 		tinke();
 }
 
@@ -1323,7 +1323,7 @@ void fctSound() {
 		ecr3(g_vm->getEngineString(S_PROBE2));
 	if (g_caff < 27) {
 		tfleche();
-		if (!(g_anyone) && (!g_vm->_keyPressedEsc))
+		if (!(g_vm->_anyone) && (!g_vm->_keyPressedEsc))
 			g_crep = 145;
 		g_num = 0;
 	}
@@ -1537,7 +1537,7 @@ void fctSmell() {
 		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
-		if (!(g_anyone) && !(g_vm->_keyPressedEsc))
+		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc))
 			if (g_caff == 16)
 				g_crep = 153;
 	} else if (g_caff == 123)
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index bf62fe3..e6abc8e 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -49,7 +49,7 @@ void tinke() {
 	int cx, cf, day, hour, minute;
 	Common::String stpo;
 
-	g_anyone = false;
+	g_vm->_anyone = false;
 	updateHour(day, hour, minute);
 	if (day != g_day) {
 		g_day = day;
@@ -161,8 +161,8 @@ void tinke() {
 					cavegre();
 				} else if (g_ipers == 10) {
 					g_ipers = 0;
-					if (!g_brt) {
-						g_brt = true;
+					if (!g_vm->_brt) {
+						g_vm->_brt = true;
 						g_hdb = readclock();
 						if (getRandomNumber(1, 5) < 5) {
 							clsf3();
@@ -181,12 +181,12 @@ void tinke() {
 		}
 	}
 	g_hfb = readclock();
-	if ((g_brt) && ((g_hfb - g_hdb) > 17)) {
+	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
 		cx = nouvp(g_li);
-		g_brt = false;
+		g_vm->_brt = false;
 		g_hdb = 0;
 		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
-			g_anyone = true;
+			g_vm->_anyone = true;
 	}
 }
 
@@ -211,7 +211,7 @@ void fenat(char ans) {
 void afdes(int ad) {
 	taffich();
 	dessin(ad);
-	g_okdes = false;
+	g_vm->_okdes = false;
 }
 
 void tkey1(bool d) {
@@ -236,7 +236,7 @@ void tkey1(bool d) {
 		quest = keypressed();
 		getMousePos(x, y, c);
 		CHECK_QUIT;
-	} while (!(quest || (c != 0) || (d && g_anyone)));
+	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
 	if (quest)
 		testou();
 	g_vm->setMouseClick(false);
@@ -312,7 +312,7 @@ void tperd() {
 	clsf3();
 	g_vm->_col = false;
 	g_vm->_syn = false;
-	g_okdes = false;
+	g_vm->_okdes = false;
 }
 
 void tsort() {
@@ -532,7 +532,7 @@ void t1neig() {
 		g_crep = 1506;
 		tperd();
 	} else {
-		g_okdes = true;
+		g_vm->_okdes = true;
 		g_s._currPlace = MOUNTAIN;
 		affrep();
 	}
@@ -645,7 +645,7 @@ void tfleche() {
 		return;
 
 	fenat(chr(152));
-	g_rect = false;
+	bool inRect = false;
 	do {
 		touch = '\0';
 
@@ -654,18 +654,18 @@ void tfleche() {
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
-				g_rect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
+				inRect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
 			tinke();
-		} while (!(qust || g_rect || g_anyone));
+		} while (!(qust || inRect || g_vm->_anyone));
 
 		if (qust && (touch == '\103'))
 			Alert::show(g_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_anyone) || (g_rect)));
+	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect)));
 
 	if (touch == '\73')
 		g_vm->_keyPressedEsc = true;
 
-	if (g_rect) {
+	if (inRect) {
 		g_x = x_s;
 		g_y = y_s;
 	}
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 38b2343..01ef472 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -58,6 +58,33 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_mouseClick = false;
 	_inMainGameLoop = false;
 	_quitGame = false;
+
+	_roomPresenceLuc = false;
+	_roomPresenceIda = false;
+	_purpleRoomPresenceLeo = false;
+	_roomPresenceGuy = false;
+	_roomPresenceEva = false;
+	_roomPresenceMax = false;
+	_roomPresenceBob = false;
+	_roomPresencePat = false;
+	_toiletsPresenceBobMax = false;
+	_bathRoomPresenceBobMax = false;
+	_room9PresenceLeo = false;
+	
+	_soundOff = false;
+	_largestClearScreen = false;
+	_hiddenHero = false;
+	_heroSearching = false;
+	_keyPressedEsc = false;
+	_reloadCFIEC = false;
+
+	_blo = false;
+	_col = false;
+	_syn = false;
+	_obpart = false;
+	_okdes = false;
+	_anyone = false;
+	_brt = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -145,8 +172,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	g_currGraphicalDevice = MODE_EGA;
 	g_newGraphicalDevice = g_currGraphicalDevice;
 	charpal();
-	charge_cfiph();
-	charge_cfiec();
+	loadCFIPH();
+	loadCFIEC();
 	zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	g_c_zzz = 1;
 	init_nbrepm();
@@ -498,13 +525,13 @@ void MortevielleEngine::showIntroduction() {
  * loses, and chooses to start playing the game again.
  */
 void MortevielleEngine::mainGame() {
-	if (g_rech_cfiec)
-		charge_cfiec();
+	if (_reloadCFIEC)
+		loadCFIEC();
 
 	for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep) 
 		zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
-	charge_bruit5();
+	loadBRUIT5();
 	_menu.initMenu();
 
 	theure();
@@ -567,7 +594,7 @@ void MortevielleEngine::handleAction() {
 			moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
-		} while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (g_anyone)));
+		} while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
 		_inMainGameLoop = false;
 
 		g_vm->_menu.eraseMenu();
@@ -611,7 +638,7 @@ void MortevielleEngine::handleAction() {
 			g_mnumo = g_msg[3];
 			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
 				g_mnumo = g_msg[4];
-			if (!g_anyone) {
+			if (!_anyone) {
 				if ((g_vm->_heroSearching) || (_obpart)) {
 					if (y_s < 12)
 						return;
@@ -634,8 +661,8 @@ void MortevielleEngine::handleAction() {
 
 				if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
-					if (g_okdes) {
-						g_okdes = false;
+					if (g_vm->_okdes) {
+						g_vm->_okdes = false;
 						dessin(0);
 					}
 					if ((!g_vm->_syn) || (_col))
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 69446ae..5a8c0f9 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -119,11 +119,15 @@ public:
 	bool _hiddenHero;
 	bool _heroSearching;
 	bool _keyPressedEsc;
+	bool _reloadCFIEC;
 
 	bool _blo;
 	bool _col;
 	bool _syn;
 	bool _obpart;
+	bool _okdes;
+	bool _anyone;
+	bool _brt;
 
 
 	ScreenSurface _screenSurface;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 8641a18..374a5f7 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -167,7 +167,7 @@ void music() {
 	if (g_vm->_soundOff)
 		return;
 
-	g_rech_cfiec = true;
+	g_vm->_reloadCFIEC = true;
 	
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
@@ -193,7 +193,7 @@ void music() {
 }
 
 
-void charge_bruit5() {
+void loadBRUIT5() {
 	Common::File f;
 
 	if (!f.open("bruit5"))
@@ -203,7 +203,7 @@ void charge_bruit5() {
 	f.close();
 }
 
-void charge_cfiec() {
+void loadCFIEC() {
 	Common::File f;
 
 	if (!f.open("cfiec.mor"))
@@ -212,11 +212,11 @@ void charge_cfiec() {
 	f.read(&g_adcfiec[0], 822 * 128);
 	f.close();
 
-	g_rech_cfiec = false;
+	g_vm->_reloadCFIEC = false;
 }
 
 
-void charge_cfiph() {
+void loadCFIPH() {
 	Common::File f;
 
 	if (!f.open("cfiph.mor"))
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index 25633a4..ef9f401 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -35,9 +35,9 @@ extern void chartex();
 extern void dialpre();
 extern void init_lieu();
 extern void music();
-extern void charge_bruit5();
-extern void charge_cfiec();
-extern void charge_cfiph();
+extern void loadBRUIT5();
+extern void loadCFIEC();
+extern void loadCFIPH();
 extern void suite();
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index eb6b979..95e8c01 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -72,11 +72,11 @@ void MortevielleEngine::gameLoaded() {
 	hideMouse();
 	_menu._menuDisplayed = false;
 	_loseGame = true;
-	g_anyone = false;
-	g_okdes = true;
+	_anyone = false;
+	_okdes = true;
 	_col = false;
 	_hiddenHero = false;
-	g_brt = false;
+	_brt = false;
 	g_maff = 68;
 	g_mnumo = 0;
 	g_prebru = 0;
@@ -88,8 +88,8 @@ void MortevielleEngine::gameLoaded() {
 	g_cs = 0;
 	g_is = 0;
 	g_ment = 0;
-	g_vm->_syn = true;
-	g_vm->_heroSearching = true;
+	_syn = true;
+	_heroSearching = true;
 	g_mchai = 0;
 	g_inei = 0;
 	initouv();
@@ -98,10 +98,10 @@ void MortevielleEngine::gameLoaded() {
 	affrep();
 	g_hintPctMessage = deline(580);
 
-	g_okdes = false;
+	_okdes = false;
 	_endGame = true;
 	_loseGame = false;
-	g_vm->_heroSearching = false;
+	_heroSearching = false;
 
 	displayAloneText();
 	tinke();
@@ -136,8 +136,8 @@ void tsitu() {
 		clearScreenType2();
 	g_vm->_syn = false;
 	g_vm->_keyPressedEsc = false;
-	if (!g_anyone) {
-		if (g_brt)
+	if (!g_vm->_anyone) {
+		if (g_vm->_brt)
 			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
 				g_ctrm = 4;
 				mennor();
@@ -204,9 +204,9 @@ void tsitu() {
 		if (g_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
-		if (g_anyone) {
+		if (g_vm->_anyone) {
 			quelquun();
-			g_anyone = false;
+			g_vm->_anyone = false;
 			mennor();
 			return;
 		}
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 6fe9f61..5bb172f 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -148,7 +148,7 @@ void taffich() {
 		break;
 	}
 
-	g_okdes = true;
+	g_vm->_okdes = true;
 	hideMouse();
 	lgt = 0;
 	Common::String filename;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 2903abf..14f440f 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,12 +78,7 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool    g_okdes,
-        g_arret,
-        g_anyone,
-        g_brt,
-        g_rect,
-        g_rech_cfiec;
+bool    g_rech_cfiec;
 
 
 int g_x,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 0402cd6..cf7d608 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -223,14 +223,6 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-extern bool 
-        g_okdes,
-        g_anyone,
-        g_brt,
-        g_rect,
-        g_rech_cfiec;
-
-
 extern int g_x,
         g_y,
         g_t,


Commit: a0cf7e74542cb564dfb2c0f5a1e8dd16d9bc7b09
    https://github.com/scummvm/scummvm/commit/a0cf7e74542cb564dfb2c0f5a1e8dd16d9bc7b09
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:05-07:00

Commit Message:
MORTEVIELLE: Move some more globals, get rid of some others

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/level15.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mor2.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/parole.cpp
    engines/mortevielle/parole.h
    engines/mortevielle/parole2.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/taffich.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index c4b476c..754e014 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -430,8 +430,8 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 		waitForF3F8(g_key);
 		CHECK_QUIT;
 
-		if (g_newGraphicalDevice != g_currGraphicalDevice) {
-			g_currGraphicalDevice = g_newGraphicalDevice;
+		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
+			g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
 			hirs();
 			aff50(drawAni50Fl);
 		}
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index f28e309..faf4719 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -46,9 +46,9 @@ int testou() {
 		g_vm->_soundOff = !g_vm->_soundOff;
 		break;
 	case '\26' :
-		if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
+		if ((g_vm->_c_zzz == 1) || (g_vm->_c_zzz == 2)) {
 			zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-			++g_c_zzz;
+			++g_vm->_c_zzz;
 
 			return 61;
 		}
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
index 444a810..17f4943 100644
--- a/engines/mortevielle/level15.cpp
+++ b/engines/mortevielle/level15.cpp
@@ -71,7 +71,7 @@ void outbloc(int n, pattern p, nhom *pal) {
 }
 
 void writepal(int n) {
-	switch (g_currGraphicalDevice) {
+	switch (g_vm->_currGraphicalDevice) {
 	case MODE_TANDY:
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
@@ -104,7 +104,7 @@ void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&g_mem[seg * 16 + dep]);
 
-	if (g_currGraphicalDevice == MODE_HERCULES) {
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 2] = 0;
 		g_mem[0x7000 * 16 + 32] = 15;
 	}
@@ -117,13 +117,13 @@ void pictout(int seg, int dep, int x, int y) {
 
 void sauvecr(int y, int dy) {
 	hideMouse();
-	s_sauv(g_currGraphicalDevice, y, dy);
+	s_sauv(g_vm->_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
 void charecr(int y, int dy) {
 	hideMouse();
-	s_char(g_currGraphicalDevice, y, dy);
+	s_char(g_vm->_currGraphicalDevice, y, dy);
 	showMouse();
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 9a0bcec..22bf269 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -151,7 +151,7 @@ void Menu::displayMenu() {
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * g_res;
-	if (g_currGraphicalDevice == MODE_CGA)
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
 		color = 9;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e3bc524..c8b5b7e 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -114,7 +114,7 @@ void dessine(int ad, int x, int y) {
 
 void dessine_rouleau() {
 	writepal(89);
-	if (g_currGraphicalDevice == MODE_HERCULES) {
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 14] = 15;
 	}
 	hideMouse();
@@ -122,9 +122,12 @@ void dessine_rouleau() {
 	showMouse();
 }
 
-
-void text_color(int c) {
-	g_color_txt = c;
+/**
+ * Set Text Color
+ * @remarks	Originally called 'text_color'
+ */
+void setTextColor(int c) {
+	g_vm->_textColor = c;
 }
 
 /* NIVEAU 13 */
@@ -140,7 +143,7 @@ void text1(int x, int y, int nb, int m) {
 	Common::String tmpStr = deline(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
-	displayStr(tmpStr, x, y, nb, 20, g_color_txt);
+	displayStr(tmpStr, x, y, nb, 20, g_vm->_textColor);
 }
 
 void initouv() {
@@ -178,7 +181,7 @@ void clearScreenType2() {
 }
 
 void ecrf2() {
-	text_color(5);
+	setTextColor(5);
 }
 
 void ecr2(Common::String str_) {
@@ -219,12 +222,12 @@ void ecr3(Common::String text) {
 }
 
 void ecrf6() {
-	text_color(5);
+	setTextColor(5);
 	g_vm->_screenSurface.drawBox(62, 33, 363, 80, 15);
 }
 
 void ecrf7() {
-	text_color(4);
+	setTextColor(4);
 }
 
 void clsf10() {
@@ -258,7 +261,7 @@ void clsf10() {
 
 void stop() {
 	hirs();
-	g_currGraphicalDevice = MODE_AMSTRAD1512;
+	g_vm->_currGraphicalDevice = MODE_AMSTRAD1512;
 	hirs();
 	g_vm->quitGame();
 }
@@ -266,7 +269,7 @@ void stop() {
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
-	if (g_currGraphicalDevice == MODE_CGA)
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		co = 3;
 	else
 		co = 11;
@@ -656,7 +659,7 @@ void drawClock() {
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
-	if ((g_currGraphicalDevice == MODE_CGA) || (g_currGraphicalDevice == MODE_HERCULES))
+	if ((g_vm->_currGraphicalDevice == MODE_CGA) || (g_vm->_currGraphicalDevice == MODE_HERCULES))
 		co = 0;
 	else
 		co = 1;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 59555fb..67c7bdd 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -38,7 +38,7 @@ extern int readclock();
 extern void modif(int &nu);
 extern void dessine(int ad, int x, int y);
 extern void dessine_rouleau();
-extern void text_color(int c);
+extern void setTextColor(int c);
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
 extern void initouv();
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
index e6abc8e..380959e 100644
--- a/engines/mortevielle/mor2.cpp
+++ b/engines/mortevielle/mor2.cpp
@@ -194,9 +194,9 @@ void fenat(char ans) {
 	int coul;
 
 	hideMouse();
-	if (g_currGraphicalDevice == MODE_CGA)
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		coul = 2;
-	else if (g_currGraphicalDevice == MODE_HERCULES)
+	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
 		coul = 1;
 	else
 		coul = 12;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 01ef472..0e65ca2 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -85,6 +85,13 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_okdes = false;
 	_anyone = false;
 	_brt = false;
+
+	_textColor = 0;
+	_currGraphicalDevice = -1;
+	_newGraphicalDevice = -1;
+
+	_c_zzz = -1;
+
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -148,7 +155,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	g_currGraphicalDevice = MODE_EGA;
+	g_vm->_currGraphicalDevice = MODE_EGA;
 	g_res = 2;
 
 	_txxFileFl = false;
@@ -169,13 +176,13 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	g_currGraphicalDevice = MODE_EGA;
-	g_newGraphicalDevice = g_currGraphicalDevice;
+	g_vm->_currGraphicalDevice = MODE_EGA;
+	g_vm->_newGraphicalDevice = g_vm->_currGraphicalDevice;
 	charpal();
 	loadCFIPH();
 	loadCFIEC();
 	zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-	g_c_zzz = 1;
+	g_vm->_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
 
@@ -185,10 +192,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	teskbd();
 	dialpre();
-	g_newGraphicalDevice = g_currGraphicalDevice;
+	g_vm->_newGraphicalDevice = g_vm->_currGraphicalDevice;
 	teskbd();
-	if (g_newGraphicalDevice != g_currGraphicalDevice)
-		g_currGraphicalDevice = g_newGraphicalDevice;
+	if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice)
+		g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
 	hirs();
 	g_ades = 0x7000;
 
@@ -528,7 +535,7 @@ void MortevielleEngine::mainGame() {
 	if (_reloadCFIEC)
 		loadCFIEC();
 
-	for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep) 
+	for (g_crep = 1; g_crep <= g_vm->_c_zzz; ++g_crep) 
 		zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 5a8c0f9..0d1f567 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -129,6 +129,12 @@ public:
 	bool _anyone;
 	bool _brt;
 
+	int _textColor;
+	int _currGraphicalDevice;
+	int _newGraphicalDevice;
+
+	int _c_zzz;
+	int ptr_word;
 
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 8ae8635..1240fa4 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -86,7 +86,7 @@ void hideMouse() {
 	if (mouse_shwn == 0) {
 		bool imp = odd(y_s);
 		int j = p_o_s;
-		switch (g_currGraphicalDevice) {
+		switch (g_vm->_currGraphicalDevice) {
 		case MODE_CGA: {
 			int k = 0;
 			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
@@ -182,7 +182,7 @@ void showMouse() {
 	int j = p_o_s;
 	bool imp = odd(y_s);
 	int i = x_s & 7;
-	switch (g_currGraphicalDevice) {
+	switch (g_vm->_currGraphicalDevice) {
 	case MODE_CGA:
 		k = 0;
 		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 374a5f7..14b3e3e 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -159,16 +159,12 @@ void init_lieu() {
 
 
 void music() {
-	Common::File fic;
-	int k;
-	bool fin;
-
-	/* debug('o3 music'); */
 	if (g_vm->_soundOff)
 		return;
 
 	g_vm->_reloadCFIEC = true;
 	
+	Common::File fic;
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
@@ -180,8 +176,8 @@ void music() {
 	g_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
 	cctable(g_tbi);
 
-	fin = false;
-	k = 0;
+	bool fin = false;
+	int k = 0;
 	do {
 		fin = keypressed();
 		g_vm->_soundManager.musyc(g_tbi, 9958, kTempoMusic);
@@ -234,8 +230,8 @@ void suite() {
 	g_caff = 51;
 	taffich();
 	teskbd();
-	if (g_newGraphicalDevice != g_currGraphicalDevice)
-		g_currGraphicalDevice = g_newGraphicalDevice;
+	if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice)
+		g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
 	hirs();
 	dessine(g_ades, 0, 0);
 
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
index 8974b45..b2266dc 100644
--- a/engines/mortevielle/parole.cpp
+++ b/engines/mortevielle/parole.cpp
@@ -44,10 +44,10 @@ void spfrac(int wor) {
 	g_c3._acc = ((uint)wor >> 9) & 7;
 }
 
-void charg_car() {
+void charg_car(int &currWordNumb) {
 	int wor, int_;
 
-	wor = swap(READ_LE_UINT16(&g_mem[adword + g_ptr_word]));
+	wor = swap(READ_LE_UINT16(&g_mem[adword + currWordNumb]));
 	int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -82,7 +82,7 @@ void charg_car() {
 	}
 
 	spfrac(wor);
-	g_ptr_word += 2;
+	currWordNumb += 2;
 }
 
 
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
index 4168187..46d55ab 100644
--- a/engines/mortevielle/parole.h
+++ b/engines/mortevielle/parole.h
@@ -34,7 +34,7 @@
 namespace Mortevielle {
 
 extern void spfrac(int wor);
-extern void charg_car();
+extern void charg_car(int &currWordNumb);
 extern void entroct(byte o);
 extern void veracf(byte b);
 extern void cctable(tablint &t);
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
index e08cbeb..950f294 100644
--- a/engines/mortevielle/parole2.cpp
+++ b/engines/mortevielle/parole2.cpp
@@ -54,27 +54,22 @@ void init_chariot() {
 void trait_ph() {
 	const int deca[3] = {300, 30, 40};
 
-	g_ptr_tcph = g_num_ph - 1;
-	g_ledeb = swap(g_t_cph[g_ptr_tcph]) + deca[g_typlec];
-	g_lefin = swap(g_t_cph[g_ptr_tcph + 1]) + deca[g_typlec];
-	g_nb_word = g_lefin - g_ledeb;
-	g_ptr_tcph = (uint)g_ledeb >> 1;
-	g_ptr_word = 0;
-	do {
-		WRITE_LE_UINT16(&g_mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
-		g_ptr_word += 2;
-		++g_ptr_tcph;
-	} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
+	int ptr_tcph = g_num_ph - 1;
+	int startPos = swap(g_t_cph[ptr_tcph]) + deca[g_typlec];
+	int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
+	int wordCount = endPos - startPos;
+	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
+		WRITE_LE_UINT16(&g_mem[adword + currWord], g_t_cph[i]);
 
 	g_ptr_oct = 0;
-	g_ptr_word = 0;
+	int currWord = 0;
 	init_chariot();
 
 	do {
 		rot_chariot();
-		charg_car();
+		charg_car(currWord);
 		trait_car();
-	} while (g_ptr_word < g_nb_word);
+	} while (currWord < wordCount);
 
 	rot_chariot();
 	trait_car();
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index 95e8c01..b56aba6 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -45,7 +45,7 @@ namespace Mortevielle {
  */
 void changeGraphicalDevice(int newDevice) {
 	hideMouse();
-	g_currGraphicalDevice = newDevice;
+	g_vm->_currGraphicalDevice = newDevice;
 	hirs();
 	initMouse();
 	showMouse();
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
index 5bb172f..a65cecd 100644
--- a/engines/mortevielle/taffich.cpp
+++ b/engines/mortevielle/taffich.cpp
@@ -212,7 +212,7 @@ void taffich() {
 		npal = a + 37;
 	}
 	chardes(filename, lgt, handle);
-	if (g_currGraphicalDevice == MODE_HERCULES) {
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
 			int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 14f440f..62f9834 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -78,9 +78,6 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-bool    g_rech_cfiec;
-
-
 int g_x,
         g_y,
         g_t,
@@ -91,7 +88,6 @@ int g_x,
         g_jh,
         g_mh,
         g_cs,
-        g_currGraphicalDevice,
         g_hdb,
         g_hfb,
         g_hour,
@@ -113,13 +109,9 @@ int g_x,
         g_msg3,
         g_msg4,
         g_mlec,
-        g_newGraphicalDevice,
-        g_c_zzz,
         g_mchai,
         g_menup,
         g_ipers,
-        g_ledeb,
-        g_lefin,
         g_mpers,
         g_mnumo,
         g_xprec,
@@ -129,12 +121,8 @@ int g_x,
         g_typlec,
         g_num_ph,
         g_numpal,
-        g_nb_word,
         g_ptr_oct,
-        g_k_tempo,
-        g_ptr_tcph,
-        g_ptr_word,
-        g_color_txt;
+        g_k_tempo;
 
 int g_t_cph[6401];
 byte g_tabdon[4001];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index cf7d608..50c7397 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -233,7 +233,6 @@ extern int g_x,
         g_jh,
         g_mh,
         g_cs,
-        g_currGraphicalDevice,
         g_hdb,
         g_hfb,
         g_hour,
@@ -255,13 +254,9 @@ extern int g_x,
         g_msg3,
         g_msg4,
         g_mlec,
-        g_newGraphicalDevice,
-        g_c_zzz,
         g_mchai,
         g_menup,
         g_ipers,
-        g_ledeb,
-        g_lefin,
         g_mpers,
         g_mnumo,
         g_xprec,
@@ -271,12 +266,8 @@ extern int g_x,
         g_typlec,
         g_num_ph,
         g_numpal,
-        g_nb_word,
         g_ptr_oct,
-        g_k_tempo,
-        g_ptr_tcph,
-        g_ptr_word,
-        g_color_txt;
+        g_k_tempo;
 
 extern int g_t_cph[6401];
 extern byte g_tabdon[4001];


Commit: 32a842bf7b72cbd43a620d9868d6b19e5381a20d
    https://github.com/scummvm/scummvm/commit/32a842bf7b72cbd43a620d9868d6b19e5381a20d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:06-07:00

Commit Message:
MORTEVIELLE: regroup several files

Changed paths:
  A engines/mortevielle/speech.cpp
  A engines/mortevielle/speech.h
  R engines/mortevielle/level15.cpp
  R engines/mortevielle/level15.h
  R engines/mortevielle/mor2.cpp
  R engines/mortevielle/mor2.h
  R engines/mortevielle/parole2.cpp
  R engines/mortevielle/parole2.h
  R engines/mortevielle/parole.cpp
  R engines/mortevielle/parole.h
  R engines/mortevielle/taffich.cpp
  R engines/mortevielle/taffich.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/prog.cpp
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6733d24..5f511fc 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -28,15 +28,12 @@
 #include "common/scummsys.h"
 #include "mortevielle/actions.h"
 #include "mortevielle/dialogs.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
-#include "mortevielle/mor2.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/parole2.h"
-#include "mortevielle/taffich.h"
+#include "mortevielle/speech.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 754e014..b37e0a5 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -28,13 +28,11 @@
 #include "common/str.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/parole2.h"
-#include "mortevielle/taffich.h"
+#include "mortevielle/speech.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/level15.cpp b/engines/mortevielle/level15.cpp
deleted file mode 100644
index 17f4943..0000000
--- a/engines/mortevielle/level15.cpp
+++ /dev/null
@@ -1,166 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/system.h"
-#include "common/file.h"
-#include "mortevielle/graphics.h"
-#include "mortevielle/level15.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-/* NIVEAU 15 */
-void copcha() {
-	int i = acha;
-	do {
-		g_tabdon[i] = g_tabdon[i + 390];
-		++i;
-	} while (i != acha + 390);
-}
-
-/**
- * Engine function : Is mouse in a given rect?
- * @remarks	Originally called 'dans_rect'
- */
-bool isMouseIn(rectangle r) {
-	int x, y, c;
-
-	getMousePos(x, y, c);
-	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
-		return true;
-
-	return false;
-}
-
-void outbloc(int n, pattern p, nhom *pal) {
-	int ad = n * 404 + 0xd700;
-
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad + 2], p._tay);
-	ad += 4;
-	for (int i = 1; i <= p._tax; ++i) {
-		for (int j = 1; j <= p._tay; ++j)
-			g_mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
-	}
-}
-
-void writepal(int n) {
-	switch (g_vm->_currGraphicalDevice) {
-	case MODE_TANDY:
-	case MODE_EGA:
-	case MODE_AMSTRAD1512:
-		for (int i = 1; i <= 16; ++i) {
-			g_mem[(0x7000 * 16) + (2 * i)] = g_tabpal[n][i].x;
-			g_mem[(0x7000 * 16) + (2 * i) + 1] = g_tabpal[n][i].y;
-		}
-		break;
-	case MODE_CGA: {
-		warning("TODO: If this code is needed, resolve the incompatible types");
-		nhom pal[16];
-		for (int i = 0; i < 16; ++i) {
-			pal[i] = g_palcga[n]._a[i];
-		}
-//		nhom pal[16] = palcga[n]._a;
-		if (n < 89)
-			palette(g_palcga[n]._p);
-		
-		for (int i = 0; i <= 15; ++i)
-			outbloc(i, g_tpt[pal[i]._id], pal);
-		}
-		break;
-	default:
-		break;
-	}
-}
-
-
-void pictout(int seg, int dep, int x, int y) {
-	GfxSurface surface;
-	surface.decode(&g_mem[seg * 16 + dep]);
-
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
-		g_mem[0x7000 * 16 + 2] = 0;
-		g_mem[0x7000 * 16 + 32] = 15;
-	}
-
-	if ((g_caff != 51) && (READ_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138], 0x100);
-
-	g_vm->_screenSurface.drawPicture(surface, x, y);
-}
-
-void sauvecr(int y, int dy) {
-	hideMouse();
-	s_sauv(g_vm->_currGraphicalDevice, y, dy);
-	showMouse();
-}
-
-void charecr(int y, int dy) {
-	hideMouse();
-	s_char(g_vm->_currGraphicalDevice, y, dy);
-	showMouse();
-}
-
-void adzon() {
-	Common::File f;
-
-	if (!f.open("don.mor"))
-		error("Missing file - don.mor");
-
-	f.read(g_tabdon, 7 * 256);
-	f.close();
-
-	if (!f.open("bmor.mor"))
-		error("Missing file - bmor.mor");
-
-	f.read(&g_tabdon[fleche], 1 * 1916);
-	f.close();
-
-	if (!f.open("dec.mor"))
-		error("Missing file - dec.mor");
-
-	f.read(&g_mem[0x73a2 * 16 + 0], 1 * 1664);
-	f.close();
-}
-
-/**
- * Returns the offset within the compressed image data resource of the desired image
- */
-int animof(int ouf, int num) {
-	int nani = g_mem[adani * 16 + 1];
-	int aux = num;
-	if (ouf != 1)
-		aux += nani;
-
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
-
-	return animof_result;
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/level15.h b/engines/mortevielle/level15.h
deleted file mode 100644
index 2d7c0d4..0000000
--- a/engines/mortevielle/level15.h
+++ /dev/null
@@ -1,47 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_LEVEL15_H
-#define MORTEVIELLE_LEVEL15_H
-
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-/* NIVEAU 15 */
-extern void copcha();
-extern bool isMouseIn(rectangle r);
-extern void outbloc(int n, pattern p, nhom *pal);
-extern void writepal(int n);
-extern void pictout(int seg, int dep, int x, int y);
-extern void sauvecr(int y, int dy);
-extern void charecr(int y, int dy);
-extern void adzon();
-extern int animof(int ouf, int num);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 22bf269..6604b1b 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -28,8 +28,8 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 #include "common/textconsole.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
+#include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 16f56bc..103a4fc 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -7,20 +7,16 @@ MODULE_OBJS := \
 	dialogs.o \
 	graphics.o \
 	keyboard.o \
-	level15.o \
 	menu.o \
 	mor.o \
-	mor2.o \
 	mortevielle.o \
 	mouse.o \
 	outtext.o \
 	ovd1.o \
-	parole.o \
-	parole2.o \
 	prog.o \
 	saveload.o \
 	sound.o \
-	taffich.o \
+	speech.o \
 	var_mor.o
 
 # This module can be built as a plugin
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index c8b5b7e..7c92d9a 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -26,31 +26,150 @@
  */
 
 #include "common/endian.h"
+#include "common/file.h"
 #include "common/str.h"
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/graphics.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/parole2.h"
+#include "mortevielle/speech.h"
 #include "mortevielle/var_mor.h"
 
+#include "mortevielle/keyboard.h"
+
 namespace Mortevielle {
 
-// For ScummVM, we need to do check for file errors where we do the file access
-const int ioresult = 0;
+/* NIVEAU 15 */
+void copcha() {
+	int i = acha;
+	do {
+		g_tabdon[i] = g_tabdon[i + 390];
+		++i;
+	} while (i != acha + 390);
+}
+
+/**
+ * Engine function : Is mouse in a given rect?
+ * @remarks	Originally called 'dans_rect'
+ */
+bool isMouseIn(rectangle r) {
+	int x, y, c;
+
+	getMousePos(x, y, c);
+	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
+		return true;
+
+	return false;
+}
+
+void outbloc(int n, pattern p, nhom *pal) {
+	int ad = n * 404 + 0xd700;
+
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad + 2], p._tay);
+	ad += 4;
+	for (int i = 1; i <= p._tax; ++i) {
+		for (int j = 1; j <= p._tay; ++j)
+			g_mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
+	}
+}
+
+void writepal(int n) {
+	switch (g_vm->_currGraphicalDevice) {
+	case MODE_TANDY:
+	case MODE_EGA:
+	case MODE_AMSTRAD1512:
+		for (int i = 1; i <= 16; ++i) {
+			g_mem[(0x7000 * 16) + (2 * i)] = g_tabpal[n][i].x;
+			g_mem[(0x7000 * 16) + (2 * i) + 1] = g_tabpal[n][i].y;
+		}
+		break;
+	case MODE_CGA: {
+		warning("TODO: If this code is needed, resolve the incompatible types");
+		nhom pal[16];
+		for (int i = 0; i < 16; ++i) {
+			pal[i] = g_palcga[n]._a[i];
+		}
+//		nhom pal[16] = palcga[n]._a;
+		if (n < 89)
+			palette(g_palcga[n]._p);
+		
+		for (int i = 0; i <= 15; ++i)
+			outbloc(i, g_tpt[pal[i]._id], pal);
+		}
+		break;
+	default:
+		break;
+	}
+}
+
 
-void testfi() {
-	if (ioresult != 0) {
-		// Theoritical message
-		warning("IO Error");
-		g_vm->quitGame();
+void pictout(int seg, int dep, int x, int y) {
+	GfxSurface surface;
+	surface.decode(&g_mem[seg * 16 + dep]);
+
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
+		g_mem[0x7000 * 16 + 2] = 0;
+		g_mem[0x7000 * 16 + 32] = 15;
 	}
+
+	if ((g_caff != 51) && (READ_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138], 0x100);
+
+	g_vm->_screenSurface.drawPicture(surface, x, y);
+}
+
+void sauvecr(int y, int dy) {
+	hideMouse();
+	s_sauv(g_vm->_currGraphicalDevice, y, dy);
+	showMouse();
+}
+
+void charecr(int y, int dy) {
+	hideMouse();
+	s_char(g_vm->_currGraphicalDevice, y, dy);
+	showMouse();
+}
+
+void adzon() {
+	Common::File f;
+
+	if (!f.open("don.mor"))
+		error("Missing file - don.mor");
+
+	f.read(g_tabdon, 7 * 256);
+	f.close();
+
+	if (!f.open("bmor.mor"))
+		error("Missing file - bmor.mor");
+
+	f.read(&g_tabdon[fleche], 1 * 1916);
+	f.close();
+
+	if (!f.open("dec.mor"))
+		error("Missing file - dec.mor");
+
+	f.read(&g_mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.close();
+}
+
+/**
+ * Returns the offset within the compressed image data resource of the desired image
+ */
+int animof(int ouf, int num) {
+	int nani = g_mem[adani * 16 + 1];
+	int aux = num;
+	if (ouf != 1)
+		aux += nani;
+
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
+
+	return animof_result;
 }
 
 /**
@@ -1527,4 +1646,783 @@ void dessin(int ad) {
 	}
 }
 
+void tinke() {
+	Common::String d1 = g_vm->getEngineString(S_SHOULD_HAVE_NOTICED);
+	Common::String d2 = g_vm->getEngineString(S_NUMBER_OF_HINTS);
+	const char d3 = '[';
+	const char d4 = ']';
+	const char d5 = '1';
+	Common::String d6 = g_vm->getEngineString(S_OK);
+	int cx, cf, day, hour, minute;
+	Common::String stpo;
+
+	g_vm->_anyone = false;
+	updateHour(day, hour, minute);
+	if (day != g_day) {
+		g_day = day;
+		cx = 0;
+		do {
+			++cx;
+			if (g_nbrepm[cx] != 0)
+				--g_nbrepm[cx];
+			g_nbrep[cx] = 0;
+		} while (cx != 8);
+	}
+	if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
+		g_hour = hour;
+		g_minute = 0;
+		drawClock();
+		cf = 0;
+		for (cx = 1; cx <= 10; ++cx) {
+			if (g_s._pourc[cx] == '*')
+				++cf;
+		}
+
+		if (cf == 10)
+			stpo = "10";
+		else
+			stpo = chr(cf + 48);
+
+		g_hintPctMessage = Common::String(d3);
+		g_hintPctMessage += d5;
+		g_hintPctMessage += d4;
+		g_hintPctMessage += d3;
+		g_hintPctMessage += d1;
+		g_hintPctMessage += stpo;
+		g_hintPctMessage += '0';
+		g_hintPctMessage += d2;
+		g_hintPctMessage += d4;
+		g_hintPctMessage += d3;
+		g_hintPctMessage += d6;
+		g_hintPctMessage += d4;
+	}
+	if (minute > g_minute) {
+		g_minute = 30;
+		drawClock();
+	}
+	if (y_s < 12)
+		return;
+
+	if (!g_vm->_blo) {
+		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
+			g_t = kTime2;
+		else
+			g_t = kTime1;
+		cf = g_s._faithScore;
+		if ((cf > 33) && (cf < 66))
+			g_t -= (g_t / 3);
+
+		if (cf > 65)
+			g_t -= ((g_t / 3) * 2);
+
+		int nh = readclock();
+		if ((nh - g_mh) > g_t) {
+			bool activeMenu = g_vm->_menu._menuActive;
+			g_vm->_menu.eraseMenu();
+			g_jh += ((nh - g_mh) / g_t);
+			g_mh = nh;
+			switch (g_li) {
+			case 1:
+			case 4 :
+				pl1(cf);
+				break;
+			case 2 :
+				pl2(cf);
+				break;
+			case 5 :
+				pl5(cf);
+				break;
+			case 6:
+			case 8 :
+				pl6(cf);
+				break;
+			case 9 :
+				pl9(cf);
+				break;
+			case 10 :
+				pl10(cf);
+				break;
+			case 11 :
+				pl11(cf);
+				break;
+			case 12 :
+				pl12(cf);
+				break;
+			case 13:
+			case 14 :
+				pl13(cf);
+				break;
+			case 15:
+			case 26 :
+				pl15(cf);
+				break;
+			case 20 :
+				pl20(cf);
+				break;
+			}
+			if ((g_mpers != 0) && (g_ipers != 10))
+				g_mpers = g_ipers;
+
+			if ((g_mpers == 0) && (g_ipers > 0)) {
+				if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
+					cavegre();
+				} else if (g_ipers == 10) {
+					g_ipers = 0;
+					if (!g_vm->_brt) {
+						g_vm->_brt = true;
+						g_hdb = readclock();
+						if (getRandomNumber(1, 5) < 5) {
+							clsf3();
+							ecrf2();
+							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
+							int rand = (getRandomNumber(0, 4)) - 2;
+							startSpeech(1, rand, 1);
+							clsf3();
+						}
+					}
+				}
+			}
+
+			if (activeMenu)
+				g_vm->_menu.drawMenu();
+		}
+	}
+	g_hfb = readclock();
+	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
+		cx = nouvp(g_li);
+		g_vm->_brt = false;
+		g_hdb = 0;
+		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
+			g_vm->_anyone = true;
+	}
+}
+
+void fenat(char ans) {
+	int coul;
+
+	hideMouse();
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
+		coul = 2;
+	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
+		coul = 1;
+	else
+		coul = 12;
+
+	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
+	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
+	showMouse();
+}
+
+
+/* NIVEAU 8 */
+void afdes(int ad) {
+	taffich();
+	dessin(ad);
+	g_vm->_okdes = false;
+}
+
+void tkey1(bool d) {
+	bool quest;
+	int x, y, c;
+
+	hideMouse();
+	fenat('K');
+
+	// Wait for release from any key or mouse button
+	while (keypressed())
+		g_key = testou();
+	do {
+		getMousePos(x, y, c);
+		keypressed();
+	} while (c != 0);
+	
+	// Event loop
+	do {
+		if (d)
+			tinke();
+		quest = keypressed();
+		getMousePos(x, y, c);
+		CHECK_QUIT;
+	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
+	if (quest)
+		testou();
+	g_vm->setMouseClick(false);
+	showMouse();
+}
+
+void tmlieu(int roomId) {
+	Common::String nomp;
+
+	if (roomId == 26)
+		roomId = 15;
+
+	int i = 1;
+	while ((i < 8) && (g_v_lieu[i][roomId] != 0)) {
+		nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
+		while (nomp.size() < 20)
+			nomp += ' ';
+		g_vm->_menu.setText(g_vm->_menu._moveMenu[i], nomp);
+		++i;
+	}
+	nomp = "*                   ";
+	for (int cx = 7; cx >= i; --cx)
+		g_vm->_menu.setText(g_vm->_menu._moveMenu[cx], nomp);
+}
+
+
+/* NIVEAU 7 */
+void tlu(int af, int ob) {
+	g_caff = 32;
+	afdes(0);
+	repon(6, ob + 4000);
+	repon(2, 999);
+	tkey1(true);
+	g_caff = af;
+	g_msg[3] = OPCODE_NONE;
+	g_crep = 998;
+}
+
+void affrep() {
+	g_caff = g_s._currPlace;
+	g_crep = g_s._currPlace;
+}
+
+/**
+ * Engine function - Switch action menu from "Search" mode back to normal mode
+ * @remarks	Originally called 'mfouen'
+ */
+void unsetSearchMenu() {
+	tmlieu(g_s._currPlace);
+	for (int cx = 1; cx <= 11; ++cx)
+		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
+
+	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
+	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
+}
+
+/* NIVEAU 6 */
+
+void tperd() {
+	initouv();
+	g_ment = 0;
+	g_iouv = 0;
+	g_mchai = 0;
+	unsetSearchMenu();
+	if (!g_vm->_blo)
+		t11(21);
+
+	g_vm->_loseGame = true;
+	clsf1();
+	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
+	repon(9, g_crep);
+	clearScreenType2();
+	clsf3();
+	g_vm->_col = false;
+	g_vm->_syn = false;
+	g_vm->_okdes = false;
+}
+
+void tsort() {
+
+	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
+		if (g_s._faithScore < 50)
+			g_s._faithScore += 2;
+		else
+			g_s._faithScore += (g_s._faithScore / 10);
+	}
+
+	for (int cx = 1; cx <= 7; ++cx)
+		g_touv[cx] = chr(0);
+	g_ment = 0;
+	g_iouv = 0;
+	g_mchai = 0;
+	debloc(g_s._currPlace);
+}
+
+void st4(int ob) {
+	g_crep = 997;
+
+	switch (ob) {
+	case 114 :
+		g_crep = 109;
+		break;
+	case 110 :
+		g_crep = 107;
+		break;
+	case 158 :
+		g_crep = 113;
+		break;
+	case 152:
+	case 153:
+	case 154:
+	case 155:
+	case 156:
+	case 150:
+	case 100:
+	case 157:
+	case 160:
+	case 161 :
+		tlu(g_caff, ob);
+		break;
+	default:
+		break;
+	}
+}
+
+void cherjer(int ob, bool &d) {
+	int cx;
+
+	d = false;
+	for (cx = 1; cx <= 6; ++cx)
+		d = (d || (ord(g_s._sjer[cx]) == ob));
+
+	if (g_s._selectedObjectId == ob)
+		d = true;
+}
+
+void st1sama() {
+	g_s._currPlace = DINING_ROOM;
+	affrep();
+}
+
+void modinv() {
+	int r;
+	Common::String nomp;
+
+	int cy = 0;
+	for (int cx = 1; cx <= 6; ++cx)
+		if (g_s._sjer[cx] != chr(0)) {
+			++cy;
+			r = (ord(g_s._sjer[cx]) + 400);
+			nomp = deline(r - 501 + kInventoryStringIndex);
+			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
+			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
+		}
+	if (cy < 6)
+		for (int cx = cy + 1; cx <= 6; ++cx) {
+			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cx], "                       ");
+			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]);
+		}
+}
+
+void sparl(float adr, float rep) {
+	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
+	int key, repint;
+
+	repint = abs((int)rep);
+	hideMouse();
+	Common::String tmpStr = deline(repint + kDialogStringIndex);
+	displayStr(tmpStr, 230, 4, 65, 24, 5);
+	f3f8::draw();
+	
+	key = 0;
+	do {
+		startSpeech(repint, haut[g_caff - 69], 0);
+		f3f8::waitForF3F8(key);
+		CHECK_QUIT;
+	} while (key != 66);
+	hirs();
+	showMouse();
+}
+
+/**
+ * Engine function - End of Search: reset globals
+ * @remarks	Originally called 'finfouill'
+ */
+void endSearch() {
+	g_vm->_heroSearching = false;
+	g_vm->_obpart = false;
+	g_cs = 0;
+	g_is = 0;
+	unsetSearchMenu();
+}
+
+/**
+ * Engine function - Switch action menu to "Search" mode
+ * @remarks	Originally called 'mfoudi'
+ */
+void setSearchMenu() {
+	for (int cx = 1; cx <= 7; ++cx) 
+		g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]);
+
+	for (int cx = 1; cx <= 11; ++cx)
+		g_vm->_menu.disableMenuItem(_actionMenu[cx]);
+
+	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
+	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
+}
+
+void mennor() {
+	g_vm->_menu.menuUp(g_msg[3]);
+}
+
+void premtet() {
+	dessine(g_ades, 10, 80);
+	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
+}
+
+/* NIVEAU 5 */
+void ajchai() {
+	int cy = acha + ((g_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
+
+	if (g_tabdon[cy + cx] == 0)
+		g_tabdon[cy + cx] = g_s._selectedObjectId;
+	else
+		g_crep = 192;
+}
+
+void ajjer(int ob) {
+	int cx = 0;
+	do {
+		++cx;
+	} while ((cx <= 5) && (ord(g_s._sjer[cx]) != 0));
+
+	if (ord(g_s._sjer[cx]) == 0) {
+		g_s._sjer[(cx)] = chr(ob);
+		modinv();
+	} else
+		g_crep = 139;
+}
+
+void t1sama() {    //Entering manor
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if ((hour < 5) && (g_s._currPlace > 18)) {
+		bool d;
+		cherjer(137, d);
+		if (!d) {        //You don't have the keys, and it's late
+			g_crep = 1511;
+			tperd();
+		} else
+			st1sama();
+	} else if (!g_s._ipre) {     //Is it your first time?
+		g_ipers = 255;
+		showPeoplePresent(g_ipers);
+		g_caff = 77;
+		afdes(0);
+		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
+		repon(2, 33);
+		tkey1(false);
+		mennor();
+		hideMouse();
+		hirs();
+		premtet();
+		sparl(0, 140);
+		dessine_rouleau();
+		drawClock();
+		showMouse();
+		g_s._currPlace = OWN_ROOM;
+		affrep();
+		t5(10);
+		if (!g_vm->_blo)
+			minute = t11(0);
+		g_ipers = 0;
+		g_mpers = 0;
+		g_s._ipre = true;
+	} else
+		st1sama();
+}
+
+void t1vier() {
+	g_s._currPlace = SECRET_PASSAGE;
+	affrep();
+}
+
+void t1neig() {
+	++g_inei;
+	if (g_inei > 2) {
+		g_crep = 1506;
+		tperd();
+	} else {
+		g_vm->_okdes = true;
+		g_s._currPlace = MOUNTAIN;
+		affrep();
+	}
+}
+
+void t1deva() {
+	g_inei = 0;
+	g_s._currPlace = MANOR_FRONT;
+	affrep();
+}
+
+void t1derr() {
+	g_s._currPlace = MANOR_BACK;
+	affrep();
+}
+
+void t1deau() {
+	g_crep = 1503;
+	tperd();
+}
+
+void tctrm() {
+	repon(2, (3000 + g_ctrm));
+	g_ctrm = 0;
+}
+
+
+void quelquun() {
+	if (g_vm->_menu._menuDisplayed)
+		g_vm->_menu.eraseMenu();
+
+	endSearch();
+	g_crep = 997;
+L1:
+	if (!g_vm->_hiddenHero) {
+		if (g_crep == 997)
+			g_crep = 138;
+		repon(2, g_crep);
+		if (g_crep == 138)
+			startSpeech(5, 2, 1);
+		else
+			startSpeech(4, 4, 1);
+
+		if (g_iouv == 0)
+			g_s._faithScore += 2;
+		else if (g_s._faithScore < 50)
+			g_s._faithScore += 4;
+		else
+			g_s._faithScore += 3 * (g_s._faithScore / 10);
+		tsort();
+		tmlieu(15);
+		int cx = convertBitIndexToCharacterIndex(g_ipers);
+		g_caff = 69 + cx;
+		g_crep = g_caff;
+		g_msg[3] = MENU_DISCUSS;
+		g_msg[4] = g_vm->_menu._discussMenu[cx];
+		g_vm->_syn = true;
+		g_vm->_col = true;
+	} else {
+		if (getRandomNumber(1, 3) == 2) {
+			g_vm->_hiddenHero = false;
+			g_crep = 137;
+			goto L1;
+		} else {
+			repon(2, 136);
+			int rand = (getRandomNumber(0, 4)) - 2;
+			startSpeech(3, rand, 1);
+			clearScreenType2();
+			displayAloneText();
+			debloc(21);
+			affrep();
+		}
+	}
+	if (g_vm->_menu._menuDisplayed)
+		g_vm->_menu.drawMenu();
+}
+
+void tsuiv() {
+	int tbcl;
+	int cl;
+
+	int cy = acha + ((g_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+		++g_cs;
+		cl = cy + g_cs;
+		tbcl = g_tabdon[cl];
+	} while ((tbcl == 0) && (g_cs <= 9));
+
+	if ((tbcl != 0) && (g_cs < 11)) {
+		++g_is;
+		g_caff = tbcl;
+		g_crep = g_caff + 400;
+		if (g_ipers != 0)
+			g_s._faithScore += 2;
+	} else {
+		affrep();
+		endSearch();
+		if (cx > 9)
+			g_crep = 131;
+	}
+}
+
+void tfleche() {
+	bool qust;
+	char touch;
+
+	if (g_num == 9999)
+		return;
+
+	fenat(chr(152));
+	bool inRect = false;
+	do {
+		touch = '\0';
+
+		do {
+			moveMouse(qust, touch);
+			CHECK_QUIT;
+
+			if (g_vm->getMouseClick())
+				inRect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
+			tinke();
+		} while (!(qust || inRect || g_vm->_anyone));
+
+		if (qust && (touch == '\103'))
+			Alert::show(g_hintPctMessage, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect)));
+
+	if (touch == '\73')
+		g_vm->_keyPressedEsc = true;
+
+	if (inRect) {
+		g_x = x_s;
+		g_y = y_s;
+	}
+}
+
+void tcoord(int sx) {
+	int sy, ix, iy;
+	int ib;
+
+
+	g_num = 0;
+	g_crep = 999;
+	int a = 0;
+	int atdon = amzon + 3;
+	int cy = 0;
+	while (cy < g_caff) {
+		a += g_tabdon[atdon];
+		atdon += 4;
+		++cy;
+	}
+
+	if (g_tabdon[atdon] == 0) {
+		g_crep = 997;
+		return;
+	}
+
+	a += fleche;
+	int cb = 0;
+	for (cy = 0; cy <= (sx - 2); ++cy) {
+		ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
+		cb += (ib * 4) + 2;
+	}
+	ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
+	if (ib == 0) {
+		g_crep = 997;
+		return;
+	}
+
+	cy = 1;
+	do {
+		cb += 2;
+		sx = g_tabdon[a + cb] * g_res;
+		sy = g_tabdon[(a + cb + 1)];
+		cb += 2;
+		ix = g_tabdon[a + cb] * g_res;
+		iy = g_tabdon[(a + cb + 1)];
+		++cy;
+	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
+
+	if ((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) {
+		g_num = cy - 1;
+		return;
+	}
+
+	g_crep = 997;
+}
+
+
+void st7(int ob) {
+	switch (ob) {
+	case 116:
+	case 144:
+		g_crep = 104;
+		break;
+	case 126:
+	case 111:
+		g_crep = 108;
+		break;
+	case 132:
+		g_crep = 111;
+		break;
+	case 142:
+		g_crep = 112;
+		break;
+	default:
+		g_crep = 183;
+		st4(ob);
+	}
+}
+
+void treg(int ob) {
+	int mdes = g_caff;
+	g_caff = ob;
+
+	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
+		afdes(0);
+		if ((g_caff > 29) && (g_caff < 33))
+			repon(2, g_caff);
+		else
+			repon(2, g_caff + 400);
+		tkey1(true);
+		g_caff = mdes;
+		g_msg[3] = 0;
+		g_crep = 998;
+	} else {
+		g_vm->_obpart = true;
+		g_crep = g_caff + 400;
+		setSearchMenu();
+	}
+}
+
+void avpoing(int &ob) {
+	g_crep = 999;
+	if (g_s._selectedObjectId != 0)
+		ajjer(g_s._selectedObjectId);
+
+	if (g_crep != 139) {
+		modobj(ob + 400);
+		g_s._selectedObjectId = ob;
+		ob = 0;
+	}
+}
+
+void rechai(int &ch) {
+	int tmpPlace = g_s._currPlace;
+
+	if (g_s._currPlace == CRYPT)
+		tmpPlace = CELLAR;
+	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
+}
+
+void t23coul(int &l) {
+	bool d;
+
+	cherjer(143, d);
+	l = 14;
+	if (!d) {
+		g_crep = 1512;
+		tperd();
+	}
+}
+
+void maivid() {
+	g_s._selectedObjectId = 0;
+	modobj(500);
+}
+
+void st13(int ob) {
+	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
+	    (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
+	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
+	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
+	    (ob == 150) || (ob == 152))
+		g_crep = 999;
+	else
+		g_crep = 105;
+}
+
+void aldepl() {
+	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 67c7bdd..73f6df2 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -29,11 +29,21 @@
 #define MORTEVIELLE_MOR_H
 
 #include "common/str.h"
+#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
+/* NIVEAU 15 */
+extern void copcha();
+extern bool isMouseIn(rectangle r);
+extern void outbloc(int n, pattern p, nhom *pal);
+extern void writepal(int n);
+extern void pictout(int seg, int dep, int x, int y);
+extern void sauvecr(int y, int dy);
+extern void charecr(int y, int dy);
+extern void adzon();
+extern int animof(int ouf, int num);
 /* Niveau 14 suite */
-extern void testfi();
 extern int readclock();
 extern void modif(int &nu);
 extern void dessine(int ad, int x, int y);
@@ -118,5 +128,55 @@ extern void musique(int so);
 /* NIVEAU 9 */
 extern void dessin(int ad);
 
+static const int _actionMenu[12] = { OPCODE_NONE,
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
+};
+
+extern void tinke();
+extern void fenat(char ans);
+/* NIVEAU 8 */
+extern void afdes(int ad);
+extern void tkey1(bool d);
+extern void tmlieu(int roomId);
+/* NIVEAU 7 */
+extern void tlu(int af, int ob);
+extern void affrep();
+extern void unsetSearchMenu();
+/* NIVEAU 6 */
+extern void tperd();
+extern void tsort();
+extern void st4(int ob);
+extern void cherjer(int ob, bool &d);
+extern void st1sama();
+extern void modinv();
+extern void sparl(float adr, float rep);
+extern void endSearch();
+extern void setSearchMenu();
+extern void mennor();
+extern void premtet();
+/* NIVEAU 5 */
+extern void ajchai();
+extern void ajjer(int ob);
+extern void t1sama();
+extern void t1vier();
+extern void t1neig();
+extern void t1deva();
+extern void t1derr();
+extern void t1deau();
+extern void tctrm();
+extern void quelquun();
+extern void tsuiv();
+extern void tfleche();
+extern void tcoord(int sx);
+extern void st7(int ob);
+extern void treg(int ob);
+extern void avpoing(int &ob);
+extern void rechai(int &ch);
+extern void t23coul(int &l);
+extern void maivid();
+extern void st13(int ob);
+extern void aldepl();
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor2.cpp b/engines/mortevielle/mor2.cpp
deleted file mode 100644
index 380959e..0000000
--- a/engines/mortevielle/mor2.cpp
+++ /dev/null
@@ -1,821 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/mor2.h"
-#include "mortevielle/dialogs.h"
-#include "mortevielle/keyboard.h"
-#include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-#include "mortevielle/parole2.h"
-#include "mortevielle/taffich.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void tinke() {
-	Common::String d1 = g_vm->getEngineString(S_SHOULD_HAVE_NOTICED);
-	Common::String d2 = g_vm->getEngineString(S_NUMBER_OF_HINTS);
-	const char d3 = '[';
-	const char d4 = ']';
-	const char d5 = '1';
-	Common::String d6 = g_vm->getEngineString(S_OK);
-	int cx, cf, day, hour, minute;
-	Common::String stpo;
-
-	g_vm->_anyone = false;
-	updateHour(day, hour, minute);
-	if (day != g_day) {
-		g_day = day;
-		cx = 0;
-		do {
-			++cx;
-			if (g_nbrepm[cx] != 0)
-				--g_nbrepm[cx];
-			g_nbrep[cx] = 0;
-		} while (cx != 8);
-	}
-	if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
-		g_hour = hour;
-		g_minute = 0;
-		drawClock();
-		cf = 0;
-		for (cx = 1; cx <= 10; ++cx) {
-			if (g_s._pourc[cx] == '*')
-				++cf;
-		}
-
-		if (cf == 10)
-			stpo = "10";
-		else
-			stpo = chr(cf + 48);
-
-		g_hintPctMessage = Common::String(d3);
-		g_hintPctMessage += d5;
-		g_hintPctMessage += d4;
-		g_hintPctMessage += d3;
-		g_hintPctMessage += d1;
-		g_hintPctMessage += stpo;
-		g_hintPctMessage += '0';
-		g_hintPctMessage += d2;
-		g_hintPctMessage += d4;
-		g_hintPctMessage += d3;
-		g_hintPctMessage += d6;
-		g_hintPctMessage += d4;
-	}
-	if (minute > g_minute) {
-		g_minute = 30;
-		drawClock();
-	}
-	if (y_s < 12)
-		return;
-
-	if (!g_vm->_blo) {
-		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			g_t = kTime2;
-		else
-			g_t = kTime1;
-		cf = g_s._faithScore;
-		if ((cf > 33) && (cf < 66))
-			g_t -= (g_t / 3);
-
-		if (cf > 65)
-			g_t -= ((g_t / 3) * 2);
-
-		int nh = readclock();
-		if ((nh - g_mh) > g_t) {
-			bool activeMenu = g_vm->_menu._menuActive;
-			g_vm->_menu.eraseMenu();
-			g_jh += ((nh - g_mh) / g_t);
-			g_mh = nh;
-			switch (g_li) {
-			case 1:
-			case 4 :
-				pl1(cf);
-				break;
-			case 2 :
-				pl2(cf);
-				break;
-			case 5 :
-				pl5(cf);
-				break;
-			case 6:
-			case 8 :
-				pl6(cf);
-				break;
-			case 9 :
-				pl9(cf);
-				break;
-			case 10 :
-				pl10(cf);
-				break;
-			case 11 :
-				pl11(cf);
-				break;
-			case 12 :
-				pl12(cf);
-				break;
-			case 13:
-			case 14 :
-				pl13(cf);
-				break;
-			case 15:
-			case 26 :
-				pl15(cf);
-				break;
-			case 20 :
-				pl20(cf);
-				break;
-			}
-			if ((g_mpers != 0) && (g_ipers != 10))
-				g_mpers = g_ipers;
-
-			if ((g_mpers == 0) && (g_ipers > 0)) {
-				if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
-					cavegre();
-				} else if (g_ipers == 10) {
-					g_ipers = 0;
-					if (!g_vm->_brt) {
-						g_vm->_brt = true;
-						g_hdb = readclock();
-						if (getRandomNumber(1, 5) < 5) {
-							clsf3();
-							ecrf2();
-							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
-							int rand = (getRandomNumber(0, 4)) - 2;
-							startSpeech(1, rand, 1);
-							clsf3();
-						}
-					}
-				}
-			}
-
-			if (activeMenu)
-				g_vm->_menu.drawMenu();
-		}
-	}
-	g_hfb = readclock();
-	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
-		cx = nouvp(g_li);
-		g_vm->_brt = false;
-		g_hdb = 0;
-		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
-			g_vm->_anyone = true;
-	}
-}
-
-void fenat(char ans) {
-	int coul;
-
-	hideMouse();
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
-		coul = 2;
-	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
-		coul = 1;
-	else
-		coul = 12;
-
-	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
-	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
-	showMouse();
-}
-
-
-/* NIVEAU 8 */
-void afdes(int ad) {
-	taffich();
-	dessin(ad);
-	g_vm->_okdes = false;
-}
-
-void tkey1(bool d) {
-	bool quest;
-	int x, y, c;
-
-	hideMouse();
-	fenat('K');
-
-	// Wait for release from any key or mouse button
-	while (keypressed())
-		g_key = testou();
-	do {
-		getMousePos(x, y, c);
-		keypressed();
-	} while (c != 0);
-	
-	// Event loop
-	do {
-		if (d)
-			tinke();
-		quest = keypressed();
-		getMousePos(x, y, c);
-		CHECK_QUIT;
-	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
-	if (quest)
-		testou();
-	g_vm->setMouseClick(false);
-	showMouse();
-}
-
-void tmlieu(int roomId) {
-	Common::String nomp;
-
-	if (roomId == 26)
-		roomId = 15;
-
-	int i = 1;
-	while ((i < 8) && (g_v_lieu[i][roomId] != 0)) {
-		nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
-		while (nomp.size() < 20)
-			nomp += ' ';
-		g_vm->_menu.setText(g_vm->_menu._moveMenu[i], nomp);
-		++i;
-	}
-	nomp = "*                   ";
-	for (int cx = 7; cx >= i; --cx)
-		g_vm->_menu.setText(g_vm->_menu._moveMenu[cx], nomp);
-}
-
-
-/* NIVEAU 7 */
-void tlu(int af, int ob) {
-	g_caff = 32;
-	afdes(0);
-	repon(6, ob + 4000);
-	repon(2, 999);
-	tkey1(true);
-	g_caff = af;
-	g_msg[3] = OPCODE_NONE;
-	g_crep = 998;
-}
-
-void affrep() {
-	g_caff = g_s._currPlace;
-	g_crep = g_s._currPlace;
-}
-
-/**
- * Engine function - Switch action menu from "Search" mode back to normal mode
- * @remarks	Originally called 'mfouen'
- */
-void unsetSearchMenu() {
-	tmlieu(g_s._currPlace);
-	for (int cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
-
-	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
-	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
-}
-
-/* NIVEAU 6 */
-
-void tperd() {
-	initouv();
-	g_ment = 0;
-	g_iouv = 0;
-	g_mchai = 0;
-	unsetSearchMenu();
-	if (!g_vm->_blo)
-		t11(21);
-
-	g_vm->_loseGame = true;
-	clsf1();
-	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
-	repon(9, g_crep);
-	clearScreenType2();
-	clsf3();
-	g_vm->_col = false;
-	g_vm->_syn = false;
-	g_vm->_okdes = false;
-}
-
-void tsort() {
-
-	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
-		if (g_s._faithScore < 50)
-			g_s._faithScore += 2;
-		else
-			g_s._faithScore += (g_s._faithScore / 10);
-	}
-
-	for (int cx = 1; cx <= 7; ++cx)
-		g_touv[cx] = chr(0);
-	g_ment = 0;
-	g_iouv = 0;
-	g_mchai = 0;
-	debloc(g_s._currPlace);
-}
-
-void st4(int ob) {
-	g_crep = 997;
-
-	switch (ob) {
-	case 114 :
-		g_crep = 109;
-		break;
-	case 110 :
-		g_crep = 107;
-		break;
-	case 158 :
-		g_crep = 113;
-		break;
-	case 152:
-	case 153:
-	case 154:
-	case 155:
-	case 156:
-	case 150:
-	case 100:
-	case 157:
-	case 160:
-	case 161 :
-		tlu(g_caff, ob);
-		break;
-	default:
-		break;
-	}
-}
-
-void cherjer(int ob, bool &d) {
-	int cx;
-
-	d = false;
-	for (cx = 1; cx <= 6; ++cx)
-		d = (d || (ord(g_s._sjer[cx]) == ob));
-
-	if (g_s._selectedObjectId == ob)
-		d = true;
-}
-
-void st1sama() {
-	g_s._currPlace = DINING_ROOM;
-	affrep();
-}
-
-void modinv() {
-	int r;
-	Common::String nomp;
-
-	int cy = 0;
-	for (int cx = 1; cx <= 6; ++cx)
-		if (g_s._sjer[cx] != chr(0)) {
-			++cy;
-			r = (ord(g_s._sjer[cx]) + 400);
-			nomp = deline(r - 501 + kInventoryStringIndex);
-			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
-			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
-		}
-	if (cy < 6)
-		for (int cx = cy + 1; cx <= 6; ++cx) {
-			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cx], "                       ");
-			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]);
-		}
-}
-
-void sparl(float adr, float rep) {
-	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
-	int key, repint;
-
-	repint = abs((int)rep);
-	hideMouse();
-	Common::String tmpStr = deline(repint + kDialogStringIndex);
-	displayStr(tmpStr, 230, 4, 65, 24, 5);
-	f3f8::draw();
-	
-	key = 0;
-	do {
-		startSpeech(repint, haut[g_caff - 69], 0);
-		f3f8::waitForF3F8(key);
-		CHECK_QUIT;
-	} while (key != 66);
-	hirs();
-	showMouse();
-}
-
-/**
- * Engine function - End of Search: reset globals
- * @remarks	Originally called 'finfouill'
- */
-void endSearch() {
-	g_vm->_heroSearching = false;
-	g_vm->_obpart = false;
-	g_cs = 0;
-	g_is = 0;
-	unsetSearchMenu();
-}
-
-/**
- * Engine function - Switch action menu to "Search" mode
- * @remarks	Originally called 'mfoudi'
- */
-void setSearchMenu() {
-	for (int cx = 1; cx <= 7; ++cx) 
-		g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]);
-
-	for (int cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.disableMenuItem(_actionMenu[cx]);
-
-	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
-	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
-}
-
-void mennor() {
-	g_vm->_menu.menuUp(g_msg[3]);
-}
-
-void premtet() {
-	dessine(g_ades, 10, 80);
-	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
-}
-
-/* NIVEAU 5 */
-void ajchai() {
-	int cy = acha + ((g_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
-
-	if (g_tabdon[cy + cx] == 0)
-		g_tabdon[cy + cx] = g_s._selectedObjectId;
-	else
-		g_crep = 192;
-}
-
-void ajjer(int ob) {
-	int cx = 0;
-	do {
-		++cx;
-	} while ((cx <= 5) && (ord(g_s._sjer[cx]) != 0));
-
-	if (ord(g_s._sjer[cx]) == 0) {
-		g_s._sjer[(cx)] = chr(ob);
-		modinv();
-	} else
-		g_crep = 139;
-}
-
-void t1sama() {    //Entering manor
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if ((hour < 5) && (g_s._currPlace > 18)) {
-		bool d;
-		cherjer(137, d);
-		if (!d) {        //You don't have the keys, and it's late
-			g_crep = 1511;
-			tperd();
-		} else
-			st1sama();
-	} else if (!g_s._ipre) {     //Is it your first time?
-		g_ipers = 255;
-		showPeoplePresent(g_ipers);
-		g_caff = 77;
-		afdes(0);
-		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
-		repon(2, 33);
-		tkey1(false);
-		mennor();
-		hideMouse();
-		hirs();
-		premtet();
-		sparl(0, 140);
-		dessine_rouleau();
-		drawClock();
-		showMouse();
-		g_s._currPlace = OWN_ROOM;
-		affrep();
-		t5(10);
-		if (!g_vm->_blo)
-			minute = t11(0);
-		g_ipers = 0;
-		g_mpers = 0;
-		g_s._ipre = true;
-	} else
-		st1sama();
-}
-
-void t1vier() {
-	g_s._currPlace = SECRET_PASSAGE;
-	affrep();
-}
-
-void t1neig() {
-	++g_inei;
-	if (g_inei > 2) {
-		g_crep = 1506;
-		tperd();
-	} else {
-		g_vm->_okdes = true;
-		g_s._currPlace = MOUNTAIN;
-		affrep();
-	}
-}
-
-void t1deva() {
-	g_inei = 0;
-	g_s._currPlace = MANOR_FRONT;
-	affrep();
-}
-
-void t1derr() {
-	g_s._currPlace = MANOR_BACK;
-	affrep();
-}
-
-void t1deau() {
-	g_crep = 1503;
-	tperd();
-}
-
-void tctrm() {
-	repon(2, (3000 + g_ctrm));
-	g_ctrm = 0;
-}
-
-
-void quelquun() {
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.eraseMenu();
-
-	endSearch();
-	g_crep = 997;
-L1:
-	if (!g_vm->_hiddenHero) {
-		if (g_crep == 997)
-			g_crep = 138;
-		repon(2, g_crep);
-		if (g_crep == 138)
-			startSpeech(5, 2, 1);
-		else
-			startSpeech(4, 4, 1);
-
-		if (g_iouv == 0)
-			g_s._faithScore += 2;
-		else if (g_s._faithScore < 50)
-			g_s._faithScore += 4;
-		else
-			g_s._faithScore += 3 * (g_s._faithScore / 10);
-		tsort();
-		tmlieu(15);
-		int cx = convertBitIndexToCharacterIndex(g_ipers);
-		g_caff = 69 + cx;
-		g_crep = g_caff;
-		g_msg[3] = MENU_DISCUSS;
-		g_msg[4] = g_vm->_menu._discussMenu[cx];
-		g_vm->_syn = true;
-		g_vm->_col = true;
-	} else {
-		if (getRandomNumber(1, 3) == 2) {
-			g_vm->_hiddenHero = false;
-			g_crep = 137;
-			goto L1;
-		} else {
-			repon(2, 136);
-			int rand = (getRandomNumber(0, 4)) - 2;
-			startSpeech(3, rand, 1);
-			clearScreenType2();
-			displayAloneText();
-			debloc(21);
-			affrep();
-		}
-	}
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.drawMenu();
-}
-
-void tsuiv() {
-	int tbcl;
-	int cl;
-
-	int cy = acha + ((g_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-		++g_cs;
-		cl = cy + g_cs;
-		tbcl = g_tabdon[cl];
-	} while ((tbcl == 0) && (g_cs <= 9));
-
-	if ((tbcl != 0) && (g_cs < 11)) {
-		++g_is;
-		g_caff = tbcl;
-		g_crep = g_caff + 400;
-		if (g_ipers != 0)
-			g_s._faithScore += 2;
-	} else {
-		affrep();
-		endSearch();
-		if (cx > 9)
-			g_crep = 131;
-	}
-}
-
-void tfleche() {
-	bool qust;
-	char touch;
-
-	if (g_num == 9999)
-		return;
-
-	fenat(chr(152));
-	bool inRect = false;
-	do {
-		touch = '\0';
-
-		do {
-			moveMouse(qust, touch);
-			CHECK_QUIT;
-
-			if (g_vm->getMouseClick())
-				inRect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
-			tinke();
-		} while (!(qust || inRect || g_vm->_anyone));
-
-		if (qust && (touch == '\103'))
-			Alert::show(g_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect)));
-
-	if (touch == '\73')
-		g_vm->_keyPressedEsc = true;
-
-	if (inRect) {
-		g_x = x_s;
-		g_y = y_s;
-	}
-}
-
-void tcoord(int sx) {
-	int sy, ix, iy;
-	int ib;
-
-
-	g_num = 0;
-	g_crep = 999;
-	int a = 0;
-	int atdon = amzon + 3;
-	int cy = 0;
-	while (cy < g_caff) {
-		a += g_tabdon[atdon];
-		atdon += 4;
-		++cy;
-	}
-
-	if (g_tabdon[atdon] == 0) {
-		g_crep = 997;
-		return;
-	}
-
-	a += fleche;
-	int cb = 0;
-	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
-		cb += (ib * 4) + 2;
-	}
-	ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
-	if (ib == 0) {
-		g_crep = 997;
-		return;
-	}
-
-	cy = 1;
-	do {
-		cb += 2;
-		sx = g_tabdon[a + cb] * g_res;
-		sy = g_tabdon[(a + cb + 1)];
-		cb += 2;
-		ix = g_tabdon[a + cb] * g_res;
-		iy = g_tabdon[(a + cb + 1)];
-		++cy;
-	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
-
-	if ((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) {
-		g_num = cy - 1;
-		return;
-	}
-
-	g_crep = 997;
-}
-
-
-void st7(int ob) {
-	switch (ob) {
-	case 116:
-	case 144:
-		g_crep = 104;
-		break;
-	case 126:
-	case 111:
-		g_crep = 108;
-		break;
-	case 132:
-		g_crep = 111;
-		break;
-	case 142:
-		g_crep = 112;
-		break;
-	default:
-		g_crep = 183;
-		st4(ob);
-	}
-}
-
-void treg(int ob) {
-	int mdes = g_caff;
-	g_caff = ob;
-
-	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
-		afdes(0);
-		if ((g_caff > 29) && (g_caff < 33))
-			repon(2, g_caff);
-		else
-			repon(2, g_caff + 400);
-		tkey1(true);
-		g_caff = mdes;
-		g_msg[3] = 0;
-		g_crep = 998;
-	} else {
-		g_vm->_obpart = true;
-		g_crep = g_caff + 400;
-		setSearchMenu();
-	}
-}
-
-void avpoing(int &ob) {
-	g_crep = 999;
-	if (g_s._selectedObjectId != 0)
-		ajjer(g_s._selectedObjectId);
-
-	if (g_crep != 139) {
-		modobj(ob + 400);
-		g_s._selectedObjectId = ob;
-		ob = 0;
-	}
-}
-
-void rechai(int &ch) {
-	int tmpPlace = g_s._currPlace;
-
-	if (g_s._currPlace == CRYPT)
-		tmpPlace = CELLAR;
-	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
-}
-
-void t23coul(int &l) {
-	bool d;
-
-	cherjer(143, d);
-	l = 14;
-	if (!d) {
-		g_crep = 1512;
-		tperd();
-	}
-}
-
-void maivid() {
-	g_s._selectedObjectId = 0;
-	modobj(500);
-}
-
-void st13(int ob) {
-	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
-	    (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
-	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
-	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
-	    (ob == 150) || (ob == 152))
-		g_crep = 999;
-	else
-		g_crep = 105;
-}
-
-void aldepl() {
-	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor2.h b/engines/mortevielle/mor2.h
deleted file mode 100644
index 9107913..0000000
--- a/engines/mortevielle/mor2.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_MOR2_H
-#define MORTEVIELLE_MOR2_H
-
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
-};
-
-extern void tinke();
-extern void fenat(char ans);
-/* NIVEAU 8 */
-extern void afdes(int ad);
-extern void tkey1(bool d);
-extern void tmlieu(int roomId);
-/* NIVEAU 7 */
-extern void tlu(int af, int ob);
-extern void affrep();
-extern void unsetSearchMenu();
-/* NIVEAU 6 */
-extern void tperd();
-extern void tsort();
-extern void st4(int ob);
-extern void cherjer(int ob, bool &d);
-extern void st1sama();
-extern void modinv();
-extern void sparl(float adr, float rep);
-extern void endSearch();
-extern void setSearchMenu();
-extern void mennor();
-extern void premtet();
-/* NIVEAU 5 */
-extern void ajchai();
-extern void ajjer(int ob);
-extern void t1sama();
-extern void t1vier();
-extern void t1neig();
-extern void t1deva();
-extern void t1derr();
-extern void t1deau();
-extern void tctrm();
-extern void quelquun();
-extern void tsuiv();
-extern void tfleche();
-extern void tcoord(int sx);
-extern void st7(int ob);
-extern void treg(int ob);
-extern void avpoing(int &ob);
-extern void rechai(int &ch);
-extern void t23coul(int &l);
-extern void maivid();
-extern void st13(int ob);
-extern void aldepl();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 0e65ca2..5093013 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -33,17 +33,14 @@
 #include "mortevielle/dialogs.h"
 #include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
-#include "mortevielle/mor2.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
-#include "mortevielle/parole2.h"
 #include "mortevielle/prog.h"
 #include "mortevielle/saveload.h"
-#include "mortevielle/taffich.h"
+#include "mortevielle/outtext.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index d8e2309..9d7c38d 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -25,12 +25,14 @@
  * Copyright (c) 1988-1989 Lankhor
  */
 
+#include "common/file.h"
+#include "common/str.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/graphics.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/var_mor.h"
-#include "common/str.h"
 
 namespace Mortevielle {
 
@@ -239,4 +241,224 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 	}
 }
 
+void chardes(Common::String filename, int32 skipSize, int length) {
+	Common::File f;
+	if (!f.open(filename))
+		error("Missing file %s", filename.c_str());
+
+	int skipBlock = 0;
+	while (skipSize > 127) {
+		++skipBlock;
+		skipSize -= 128;
+	}
+	if (skipBlock != 0)
+		f.seek(skipBlock * 0x80);
+
+	int remainingSkipSize = abs(skipSize);
+	int totalLength = length + remainingSkipSize;
+	int memIndx = 0x6000 * 16;
+	while (totalLength > 0) {
+		f.read(&g_mem[memIndx], 128);
+		totalLength -= 128;
+		memIndx += 128;
+	}
+	f.close();
+
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
+		g_mem[0x7000 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+}
+
+void charani(Common::String filename, int32 skipSize, int length) {
+	Common::File f;
+	if (!f.open(filename))
+		error("Missing file - %s", filename.c_str());
+
+	int skipBlock = 0;
+	while (skipSize > 127) {
+		skipSize = skipSize - 128;
+		++skipBlock;
+	}
+	if (skipBlock != 0)
+		f.seek(skipBlock * 0x80);
+
+	int remainingSkipSize = abs(skipSize);
+	int fullLength = length + remainingSkipSize;
+	int memIndx = 0x6000 * 16;
+	while (fullLength > 0) {
+		f.read(&g_mem[memIndx], 128);
+		fullLength -= 128;
+		memIndx += 128;
+	}
+	f.close();
+
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
+		g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+}
+
+void taffich() {
+	byte tran1[] = { 121, 121, 138, 139, 120 };
+	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
+
+	int cx, handle, npal;
+	int32 lgt;
+	int alllum[16];
+
+
+	int a = g_caff;
+	if ((a >= 153) && (a <= 161))
+		a = tran2[a - 153];
+	else if ((a >= 136) && (a <= 140))
+		a = tran1[a - 136];
+	int b = a;
+	if (g_maff == a)
+		return;
+
+	switch (a) {
+	case 16:
+		g_s._pourc[9] = '*';
+		g_s._teauto[42] = '*';
+		break;
+	case 20:
+		g_s._teauto[39] = '*';
+		if (g_s._teauto[36] == '*') {
+			g_s._pourc[3] = '*';
+			g_s._teauto[38] = '*';
+		}
+		break;
+	case 24:
+		g_s._teauto[37] = '*';
+		break;
+	case 30:
+		g_s._teauto[9] = '*';
+		break;
+	case 31:
+		g_s._pourc[4] = '*';
+		g_s._teauto[35] = '*';
+		break;
+	case 118:
+		g_s._teauto[41] = '*';
+		break;
+	case 143:
+		g_s._pourc[1] = '*';
+		break;
+	case 150:
+		g_s._teauto[34] = '*';
+		break;
+	case 151:
+		g_s._pourc[2] = '*';
+		break;
+	default:
+		break;
+	}
+
+	g_vm->_okdes = true;
+	hideMouse();
+	lgt = 0;
+	Common::String filename;
+
+	if ((a != 50) && (a != 51)) {
+		int m = a + 2000;
+		if ((m > 2001) && (m < 2010))
+			m = 2001;
+		if (m == 2011)
+			m = 2010;
+		if (a == 32)
+			m = 2034;
+		if ((a == 17) && (g_maff == 14))
+			m = 2018;
+
+		if (a > 99) {
+			if ((g_is == 1) || (g_is == 0))
+				m = 2031;
+			else
+				m = 2032;
+		}
+
+		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
+			m = 2030;
+
+		if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+			m = 2033;
+
+		g_maff = a;
+		if (a == 159)
+			a = 86;
+		else if (a > 140)
+			a = a - 67;
+		else if (a > 137)
+			a = a - 66;
+		else if (a > 99)
+			a = a - 64;
+		else if (a > 69)
+			a = a - 42;
+		else if (a > 29)
+			a = a - 5;
+		else if (a == 26)
+			a = 24;
+		else if (a > 18)
+			a = a - 1;
+		npal = a;
+
+		for (cx = 0; cx <= (a - 1); ++cx)
+			lgt = lgt + g_l[cx];
+		handle = g_l[a];
+
+		filename = "DXX.mor";
+	} else {
+		filename = "DZZ.mor";
+		handle = g_l[87];
+		if (a == 51) {
+			lgt = handle;
+			handle = g_l[88];
+		}
+		g_maff = a;
+		npal = a + 37;
+	}
+	chardes(filename, lgt, handle);
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
+		for (int i = 0; i <= 15; ++i) {
+			int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
+			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
+		}
+		for (int i = 0; i <= 15; ++i) {
+			int k = 0;
+			for (int j = 0; j <= 15; ++j)
+				if (alllum[j] > alllum[k])
+					k = j;
+			g_mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
+			alllum[k] = -1;
+		}
+	}
+	g_numpal = npal;
+	writepal(npal);
+
+	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
+		lgt = 0;
+		if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26)) {
+			if (b == 26)
+				b = 18;
+			else if (b == 24)
+				b = 17;
+			else if (b > 15)
+				--b;
+			for (cx = 0; cx <= (b - 1); ++cx)
+				lgt += g_l[cx + 89];
+			handle = g_l[b + 89];
+			filename = "AXX.mor";
+		} else if (b == 50) {
+			filename = "AZZ.mor";
+			handle = 1260;
+		}
+		charani(filename, lgt, handle);
+	}
+	showMouse();
+	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
+		if ((a == 13) || (a == 14))
+			displayAloneText();
+		else if (!g_vm->_blo)
+			cx = t11(g_s._currPlace);
+		g_mpers =  0;
+	}
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 55e0ec5..03523d7 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -28,6 +28,7 @@
 #ifndef MORTEVIELLE_OUTTEXT_H
 #define MORTEVIELLE_OUTTEXT_H
 
+#include "common/str.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -35,5 +36,9 @@ namespace Mortevielle {
 extern Common::String deline(int num);
 extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
 
+extern void chardes(Common::String filename, int32 passe, int long_);
+extern void charani(Common::String filename, int32 skipSize, int length);
+extern void taffich();
+
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 14b3e3e..53da434 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -28,23 +28,18 @@
 #include "common/file.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
-#include "mortevielle/level15.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
-#include "mortevielle/parole.h"
+#include "mortevielle/speech.h"
 #include "mortevielle/sound.h"
-#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
-// For ScummVM, we need to do check for file errors where we do the file access
-const int ioresult = 0;
-
 void charpal() {
 	Common::File f;		// tabdb records
 	Common::File ft;	// tfxx
diff --git a/engines/mortevielle/parole.cpp b/engines/mortevielle/parole.cpp
deleted file mode 100644
index b2266dc..0000000
--- a/engines/mortevielle/parole.cpp
+++ /dev/null
@@ -1,454 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/file.h"
-#include "mortevielle/parole.h"
-#include "mortevielle/sound.h"
-#include "mortevielle/mortevielle.h"
-
-namespace Mortevielle {
-
-void spfrac(int wor) {
-	g_c3._rep = (uint)wor >> 12;
-	if ((g_typlec == 0) && (g_c3._code != 9))
-		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
-				((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
-			++g_c3._rep;
-		}
-
-	g_c3._freq = ((uint)wor >> 6) & 7;
-	g_c3._acc = ((uint)wor >> 9) & 7;
-}
-
-void charg_car(int &currWordNumb) {
-	int wor, int_;
-
-	wor = swap(READ_LE_UINT16(&g_mem[adword + currWordNumb]));
-	int_ = wor & 0x3f;
-
-	if ((int_ >= 0) && (int_ <= 13)) {
-		g_c3._val = int_;
-		g_c3._code = 5;
-	} else if ((int_ >= 14) && (int_ <= 21)) {
-		g_c3._val = int_;
-		g_c3._code = 6;
-	} else if ((int_ >= 22) && (int_ <= 47)) {
-		int_ = int_ - 22;
-		g_c3._val = int_;
-		g_c3._code = g_typcon[int_];
-	} else if ((int_ >= 48) && (int_ <= 56)) {
-		g_c3._val = int_ - 22;
-		g_c3._code = 4;
-	} else {
-		switch (int_) {
-		case 60:
-			g_c3._val = 32;  /*  " "  */
-			g_c3._code = 9;
-			break;
-		case 61:
-			g_c3._val = 46;  /*  "."  */
-			g_c3._code = 9;
-			break;
-		case 62:
-			g_c3._val = 35;  /*  "#"  */
-			g_c3._code = 9;
-		default:
-			break;
-		}
-	}
-
-	spfrac(wor);
-	currWordNumb += 2;
-}
-
-
-void entroct(byte o) {
-	g_mem[adtroct * 16 + g_ptr_oct] = o;
-	++g_ptr_oct;
-}
-
-void veracf(byte b) {
-	;
-}
-
-void cctable(tablint &t) {
-	float tb[257];
-
-	tb[0] = 0;
-	for (int k = 0; k <= 255; ++k) {
-		tb[k + 1] = g_addfix + tb[k];
-		t[255 - k] = abs((int)tb[k] + 1);
-	}
-}
-
-void regenbruit() {
-	int i = offsetb3 + 8590;
-	int j = 0;
-	do {
-		g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
-		i += 2;
-		++j;
-	} while (i < offsetb3 + 8790);
-}
-
-void charge_son() {
-	Common::File f;
-
-	if (!f.open("sonmus.mor"))
-		error("Missing file - sonmus.mor");
-	
-	f.read(&g_mem[0x7414 * 16 + 0], 273);
-
-	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
-	f.close();
-}
-
-void charge_phbruit() {
-	Common::File f;
-
-	if (!f.open("phbrui.mor"))
-		error("Missing file - phbrui.mor");
-
-	for (int i = 1; i <= 3; ++i)
-		g_t_cph[i] = f.readSint16LE();
-
-	f.close();
-}
-
-void charge_bruit() {
-	Common::File f;
-	int i;
-
-	if (!f.open("bruits"))               //Translation: "noise"
-		error("Missing file - bruits");
-
-	f.read(&g_mem[adbruit * 16 + 0], 250);
-	for (i = 0; i <= 19013; ++i)
-		g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
-	f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
-
-	f.close();
-}
-
-void trait_car() {
-	byte d3;
-	int d2, i;
-
-	switch (g_c2._code) {
-	case 9:
-		if (g_c2._val != ord('#'))
-			for (i = 0; i <= g_c2._rep; ++i)
-				entroct(g_c2._val);
-		break;
-	case 5:
-	case 6:
-		if (g_c2._code == 6)
-			d3 = g_tabdph[(g_c2._val - 14) << 1];
-		else
-			d3 = null;
-		if (g_c1._code >= 5) {
-			veracf(g_c2._acc);
-			if (g_c1._code == 9) {
-				entroct(4);
-				if (d3 == null)
-					entroct(g_c2._val);
-				else
-					entroct(d3);
-				entroct(22);
-			}
-		}
-
-		switch (g_c2._rep) {
-		case 0:
-			entroct(0);
-			entroct(g_c2._val);
-			if (d3 == null)
-				if (g_c3._code == 9)
-					entroct(2);
-				else
-					entroct(4);
-			else if (g_c3._code == 9)
-				entroct(0);
-			else
-				entroct(1);
-			break;
-		case 4:
-		case 5:
-		case 6:
-			if (g_c2._rep != 4) {
-				i = g_c2._rep - 5;
-				do {
-					--i;
-					entroct(0);
-					if (d3 == null)
-						entroct(g_c2._val);
-					else
-						entroct(d3);
-					entroct(3);
-				} while (i >= 0);
-			}
-			if (d3 == null) {
-				entroct(4);
-				entroct(g_c2._val);
-				entroct(0);
-			} else {
-				entroct(0);
-				entroct(g_c2._val);
-				entroct(3);
-			}
-			break;
-		case 7:
-		case 8:
-		case 9:
-			if (g_c2._rep != 7) {
-				i = g_c2._rep - 8;
-				do {
-					--i;
-					entroct(0);
-					if (d3 == null)
-						entroct(g_c2._val);
-					else
-						entroct(d3);
-					entroct(3);
-				} while (i >= 0);
-			}
-			if (d3 == null) {
-				entroct(0);
-				entroct(g_c2._val);
-				entroct(2);
-			} else {
-				entroct(0);
-				entroct(g_c2._val);
-				entroct(0);
-			}
-			break;
-		case 1:
-		case 2:
-		case 3:
-			if (g_c2._rep != 1) {
-				i = g_c2._rep - 2;
-				do {
-					--i;
-					entroct(0);
-					if (d3 == null)
-						entroct(g_c2._val);
-					else
-						entroct(d3);
-					entroct(3);
-				} while (i >= 0);
-			}
-			entroct(0);
-			entroct(g_c2._val);
-			if (g_c3._code == 9)
-				entroct(0);
-			else
-				entroct(1);
-			break;
-		default:
-			break;
-		}     //  switch  c2.rep
-		break;
-
-	case 2:
-	case 3:
-		d3 = g_c2._code + 5; //  7 ou 8  => Corresponding vowel
-		if (g_c1._code > 4) {
-			veracf(g_c2._acc);
-			if (g_c1._code == 9) {
-				entroct(4);
-				entroct(d3);
-				entroct(22);
-			}
-		}
-		i = g_c2._rep;
-		assert(i >= 0);
-		if (i != 0) {
-			do {
-				--i;
-				entroct(0);
-				entroct(d3);
-				entroct(3);
-			} while (i > 0);
-		}
-		veracf(g_c3._acc);
-		if (g_c3._code == 6) {
-			entroct(4);
-			entroct(g_tabdph[(g_c3._val - 14) << 1]);
-			entroct(g_c2._val);
-		} else {
-			entroct(4);
-			if (g_c3._val == 4)
-				entroct(3);
-			else
-				entroct(g_c3._val);
-			entroct(g_c2._val);
-		}
-		break;
-	case 0:
-	case 1: 
-		veracf(g_c2._acc);
-		switch (g_c3._code) {
-		case 2:
-			d2 = 7;
-			break;
-		case 3:
-			d2 = 8;
-			break;
-		case 6:
-			d2 = g_tabdph[(g_c3._val - 14) << 1];
-			break;
-		case 5:
-			d2 = g_c3._val;
-			break;
-		default:
-			d2 = 10;
-			break;
-		}       //  switch  c3._code
-		d2 = (d2 * 26) + g_c2._val;
-		if (g_tnocon[d2] == 0)
-			d3 = 2;
-		else
-			d3 = 6;
-		if (g_c2._rep >= 5) {
-			g_c2._rep = g_c2._rep - 5;
-			d3 = 8 - d3;       // Swap 2 and 6
-		}
-		if (g_c2._code == 0) {
-			i = g_c2._rep;
-			if (i != 0) {
-				do {
-					--i;
-					entroct(d3);
-					entroct(g_c2._val);
-					entroct(3);
-				} while (i > 0);
-			}
-			entroct(d3);
-			entroct(g_c2._val);
-			entroct(4);
-		} else {
-			entroct(d3);
-			entroct(g_c2._val);
-			entroct(3);
-			i = g_c2._rep;
-			if (i != 0) {
-				do {
-					--i;
-					entroct(d3);
-					entroct(g_c2._val);
-					entroct(4);
-				} while (i > 0);
-			}
-		}
-		if (g_c3._code == 9) {
-			entroct(d3);
-			entroct(g_c2._val);
-			entroct(5);
-		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
-			veracf(g_c3._acc);
-			switch (g_c3._code) {
-			case 3:
-				d2 = 8;
-				break;
-			case 6:
-				d2 = g_tabdph[(g_c3._val - 14) << 1];
-				break;
-			case 5:
-				d2 = g_c3._val;
-				break;
-			default:
-				d2 = 7;
-				break;
-			}     //  switch c3._code
-			if (d2 == 4)
-				d2 = 3;
-
-			if (g_intcon[g_c2._val] != 0)
-				++g_c2._val;
-
-			if ((g_c2._val == 17) || (g_c2._val == 18))
-				g_c2._val = 16;
-
-			entroct(4);
-			entroct(d2);
-			entroct(g_c2._val);
-		}
-	
-		break;
-	case 4:
-		veracf(g_c2._acc);
-		i = g_c2._rep;
-		if (i != 0) {
-			do {
-				--i;
-				entroct(2);
-				entroct(g_c2._val);
-				entroct(3);
-			} while (i > 0);
-		}
-		entroct(2);
-		entroct(g_c2._val);
-		entroct(4);
-		if (g_c3._code == 9) {
-			entroct(2);
-			entroct(g_c2._val);
-			entroct(5);
-		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
-			veracf(g_c3._acc);
-			switch (g_c3._code) {
-			case 3:
-				d2 = 8;
-				break;
-			case 6:
-				d2 = g_tabdph[(g_c3._val - 14) << 1];
-				break;
-			case 5:
-				d2 = g_c3._val;
-				break;
-			default:
-				d2 = 7;
-				break;
-			}     //  switch c3._code
-
-			if (d2 == 4)
-				d2 = 3;
-
-			if (g_intcon[g_c2._val] != 0)
-				++g_c2._val;
-
-			entroct(4);
-			entroct(d2);
-			entroct(g_tabdbc[((g_c2._val - 26) << 1) + 1]);
-		}
-	
-		break;
-	default:
-		break;
-	}     // switch c2.code
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/parole.h b/engines/mortevielle/parole.h
deleted file mode 100644
index 46d55ab..0000000
--- a/engines/mortevielle/parole.h
+++ /dev/null
@@ -1,48 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_PAROLE_H
-#define MORTEVIELLE_PAROLE_H
-
-#include "common/scummsys.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-extern void spfrac(int wor);
-extern void charg_car(int &currWordNumb);
-extern void entroct(byte o);
-extern void veracf(byte b);
-extern void cctable(tablint &t);
-extern void regenbruit();
-extern void charge_son();
-extern void charge_phbruit();
-extern void charge_bruit();
-extern void trait_car();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/parole2.cpp b/engines/mortevielle/parole2.cpp
deleted file mode 100644
index 950f294..0000000
--- a/engines/mortevielle/parole2.cpp
+++ /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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/endian.h"
-#include "mortevielle/level15.h"
-#include "mortevielle/parole2.h"
-#include "mortevielle/parole.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/sound.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void rot_chariot() {
-	g_c1 = g_c2;
-	g_c2 = g_c3;
-	g_c3._val = 32;
-	g_c3._code = 9;
-}
-
-void init_chariot() {
-	g_c3._rep = 0;
-	g_c3._freq = 0;
-	g_c3._acc = 0;
-	rot_chariot();
-	rot_chariot();
-}
-
-
-void trait_ph() {
-	const int deca[3] = {300, 30, 40};
-
-	int ptr_tcph = g_num_ph - 1;
-	int startPos = swap(g_t_cph[ptr_tcph]) + deca[g_typlec];
-	int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
-	int wordCount = endPos - startPos;
-	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&g_mem[adword + currWord], g_t_cph[i]);
-
-	g_ptr_oct = 0;
-	int currWord = 0;
-	init_chariot();
-
-	do {
-		rot_chariot();
-		charg_car(currWord);
-		trait_car();
-	} while (currWord < wordCount);
-
-	rot_chariot();
-	trait_car();
-	entroct(ord('#'));
-}
-
-
-
-void startSpeech(int rep, int ht, int typ) {
-	int savph[501];
-	int tempo;
-
-	if (g_vm->_soundOff)
-		return;
-
-	g_num_ph = rep;
-	g_haut = ht;
-	g_typlec = typ;
-	if (g_typlec != 0) {
-		for (int i = 0; i <= 500; ++i)
-			savph[i] = g_t_cph[i];
-		tempo = kTempoNoise;
-	} else if (g_haut > 5)
-		tempo = kTempoF;
-	else
-		tempo = kTempoM;
-	g_addfix = (float)((tempo - g_addv[0])) / 256;
-	cctable(g_tbi);
-	switch (typ) {
-	case 1:
-		charge_bruit();
-		/*if zuul then zzuul(adbruit,0,1095);*/
-		regenbruit();
-		break;
-	case 2:
-		charge_son();
-		charge_phbruit();
-		break;
-	default:
-		break;
-	}
-	trait_ph();
-	g_vm->_soundManager.litph(g_tbi, typ, tempo);
-	if (g_typlec != 0)
-		for (int i = 0; i <= 500; ++i) {
-			g_t_cph[i] = savph[i];
-			g_mlec = g_typlec;
-		}
-	writepal(g_numpal);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/parole2.h b/engines/mortevielle/parole2.h
deleted file mode 100644
index 3fab74d..0000000
--- a/engines/mortevielle/parole2.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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_PAROLE2_H
-#define MORTEVIELLE_PAROLE2_H
-
-namespace Mortevielle {
-
-extern void rot_chariot();
-extern void init_chariot();
-extern void trait_ph();
-extern void startSpeech(int rep, int ht, int typ);
-
-} // End of namespace Mortevielle
-
-#endif
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
index b56aba6..a6ccfcb 100644
--- a/engines/mortevielle/prog.cpp
+++ b/engines/mortevielle/prog.cpp
@@ -29,10 +29,8 @@
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
-#include "mortevielle/mor2.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/prog.h"
-#include "mortevielle/taffich.h"
 #include "mortevielle/var_mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 0efafe7..2c2af49 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -29,7 +29,6 @@
 #include "common/system.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/mor.h"
-#include "mortevielle/mor2.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/ovd1.h"
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
new file mode 100644
index 0000000..2ad5c05
--- /dev/null
+++ b/engines/mortevielle/speech.cpp
@@ -0,0 +1,543 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#include "common/endian.h"
+#include "common/file.h"
+#include "mortevielle/speech.h"
+#include "mortevielle/sound.h"
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mor.h"
+#include "mortevielle/var_mor.h"
+
+namespace Mortevielle {
+
+void spfrac(int wor) {
+	g_c3._rep = (uint)wor >> 12;
+	if ((g_typlec == 0) && (g_c3._code != 9))
+		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
+				((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
+			++g_c3._rep;
+		}
+
+	g_c3._freq = ((uint)wor >> 6) & 7;
+	g_c3._acc = ((uint)wor >> 9) & 7;
+}
+
+void charg_car(int &currWordNumb) {
+	int wor, int_;
+
+	wor = swap(READ_LE_UINT16(&g_mem[adword + currWordNumb]));
+	int_ = wor & 0x3f;
+
+	if ((int_ >= 0) && (int_ <= 13)) {
+		g_c3._val = int_;
+		g_c3._code = 5;
+	} else if ((int_ >= 14) && (int_ <= 21)) {
+		g_c3._val = int_;
+		g_c3._code = 6;
+	} else if ((int_ >= 22) && (int_ <= 47)) {
+		int_ = int_ - 22;
+		g_c3._val = int_;
+		g_c3._code = g_typcon[int_];
+	} else if ((int_ >= 48) && (int_ <= 56)) {
+		g_c3._val = int_ - 22;
+		g_c3._code = 4;
+	} else {
+		switch (int_) {
+		case 60:
+			g_c3._val = 32;  /*  " "  */
+			g_c3._code = 9;
+			break;
+		case 61:
+			g_c3._val = 46;  /*  "."  */
+			g_c3._code = 9;
+			break;
+		case 62:
+			g_c3._val = 35;  /*  "#"  */
+			g_c3._code = 9;
+		default:
+			break;
+		}
+	}
+
+	spfrac(wor);
+	currWordNumb += 2;
+}
+
+
+void entroct(byte o) {
+	g_mem[adtroct * 16 + g_ptr_oct] = o;
+	++g_ptr_oct;
+}
+
+void veracf(byte b) {
+	;
+}
+
+void cctable(tablint &t) {
+	float tb[257];
+
+	tb[0] = 0;
+	for (int k = 0; k <= 255; ++k) {
+		tb[k + 1] = g_addfix + tb[k];
+		t[255 - k] = abs((int)tb[k] + 1);
+	}
+}
+
+void regenbruit() {
+	int i = offsetb3 + 8590;
+	int j = 0;
+	do {
+		g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
+		i += 2;
+		++j;
+	} while (i < offsetb3 + 8790);
+}
+
+void charge_son() {
+	Common::File f;
+
+	if (!f.open("sonmus.mor"))
+		error("Missing file - sonmus.mor");
+	
+	f.read(&g_mem[0x7414 * 16 + 0], 273);
+
+	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
+	f.close();
+}
+
+void charge_phbruit() {
+	Common::File f;
+
+	if (!f.open("phbrui.mor"))
+		error("Missing file - phbrui.mor");
+
+	for (int i = 1; i <= 3; ++i)
+		g_t_cph[i] = f.readSint16LE();
+
+	f.close();
+}
+
+void charge_bruit() {
+	Common::File f;
+	int i;
+
+	if (!f.open("bruits"))               //Translation: "noise"
+		error("Missing file - bruits");
+
+	f.read(&g_mem[adbruit * 16 + 0], 250);
+	for (i = 0; i <= 19013; ++i)
+		g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
+	f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
+
+	f.close();
+}
+
+void trait_car() {
+	byte d3;
+	int d2, i;
+
+	switch (g_c2._code) {
+	case 9:
+		if (g_c2._val != ord('#'))
+			for (i = 0; i <= g_c2._rep; ++i)
+				entroct(g_c2._val);
+		break;
+	case 5:
+	case 6:
+		if (g_c2._code == 6)
+			d3 = g_tabdph[(g_c2._val - 14) << 1];
+		else
+			d3 = null;
+		if (g_c1._code >= 5) {
+			veracf(g_c2._acc);
+			if (g_c1._code == 9) {
+				entroct(4);
+				if (d3 == null)
+					entroct(g_c2._val);
+				else
+					entroct(d3);
+				entroct(22);
+			}
+		}
+
+		switch (g_c2._rep) {
+		case 0:
+			entroct(0);
+			entroct(g_c2._val);
+			if (d3 == null)
+				if (g_c3._code == 9)
+					entroct(2);
+				else
+					entroct(4);
+			else if (g_c3._code == 9)
+				entroct(0);
+			else
+				entroct(1);
+			break;
+		case 4:
+		case 5:
+		case 6:
+			if (g_c2._rep != 4) {
+				i = g_c2._rep - 5;
+				do {
+					--i;
+					entroct(0);
+					if (d3 == null)
+						entroct(g_c2._val);
+					else
+						entroct(d3);
+					entroct(3);
+				} while (i >= 0);
+			}
+			if (d3 == null) {
+				entroct(4);
+				entroct(g_c2._val);
+				entroct(0);
+			} else {
+				entroct(0);
+				entroct(g_c2._val);
+				entroct(3);
+			}
+			break;
+		case 7:
+		case 8:
+		case 9:
+			if (g_c2._rep != 7) {
+				i = g_c2._rep - 8;
+				do {
+					--i;
+					entroct(0);
+					if (d3 == null)
+						entroct(g_c2._val);
+					else
+						entroct(d3);
+					entroct(3);
+				} while (i >= 0);
+			}
+			if (d3 == null) {
+				entroct(0);
+				entroct(g_c2._val);
+				entroct(2);
+			} else {
+				entroct(0);
+				entroct(g_c2._val);
+				entroct(0);
+			}
+			break;
+		case 1:
+		case 2:
+		case 3:
+			if (g_c2._rep != 1) {
+				i = g_c2._rep - 2;
+				do {
+					--i;
+					entroct(0);
+					if (d3 == null)
+						entroct(g_c2._val);
+					else
+						entroct(d3);
+					entroct(3);
+				} while (i >= 0);
+			}
+			entroct(0);
+			entroct(g_c2._val);
+			if (g_c3._code == 9)
+				entroct(0);
+			else
+				entroct(1);
+			break;
+		default:
+			break;
+		}     //  switch  c2.rep
+		break;
+
+	case 2:
+	case 3:
+		d3 = g_c2._code + 5; //  7 ou 8  => Corresponding vowel
+		if (g_c1._code > 4) {
+			veracf(g_c2._acc);
+			if (g_c1._code == 9) {
+				entroct(4);
+				entroct(d3);
+				entroct(22);
+			}
+		}
+		i = g_c2._rep;
+		assert(i >= 0);
+		if (i != 0) {
+			do {
+				--i;
+				entroct(0);
+				entroct(d3);
+				entroct(3);
+			} while (i > 0);
+		}
+		veracf(g_c3._acc);
+		if (g_c3._code == 6) {
+			entroct(4);
+			entroct(g_tabdph[(g_c3._val - 14) << 1]);
+			entroct(g_c2._val);
+		} else {
+			entroct(4);
+			if (g_c3._val == 4)
+				entroct(3);
+			else
+				entroct(g_c3._val);
+			entroct(g_c2._val);
+		}
+		break;
+	case 0:
+	case 1: 
+		veracf(g_c2._acc);
+		switch (g_c3._code) {
+		case 2:
+			d2 = 7;
+			break;
+		case 3:
+			d2 = 8;
+			break;
+		case 6:
+			d2 = g_tabdph[(g_c3._val - 14) << 1];
+			break;
+		case 5:
+			d2 = g_c3._val;
+			break;
+		default:
+			d2 = 10;
+			break;
+		}       //  switch  c3._code
+		d2 = (d2 * 26) + g_c2._val;
+		if (g_tnocon[d2] == 0)
+			d3 = 2;
+		else
+			d3 = 6;
+		if (g_c2._rep >= 5) {
+			g_c2._rep = g_c2._rep - 5;
+			d3 = 8 - d3;       // Swap 2 and 6
+		}
+		if (g_c2._code == 0) {
+			i = g_c2._rep;
+			if (i != 0) {
+				do {
+					--i;
+					entroct(d3);
+					entroct(g_c2._val);
+					entroct(3);
+				} while (i > 0);
+			}
+			entroct(d3);
+			entroct(g_c2._val);
+			entroct(4);
+		} else {
+			entroct(d3);
+			entroct(g_c2._val);
+			entroct(3);
+			i = g_c2._rep;
+			if (i != 0) {
+				do {
+					--i;
+					entroct(d3);
+					entroct(g_c2._val);
+					entroct(4);
+				} while (i > 0);
+			}
+		}
+		if (g_c3._code == 9) {
+			entroct(d3);
+			entroct(g_c2._val);
+			entroct(5);
+		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
+			veracf(g_c3._acc);
+			switch (g_c3._code) {
+			case 3:
+				d2 = 8;
+				break;
+			case 6:
+				d2 = g_tabdph[(g_c3._val - 14) << 1];
+				break;
+			case 5:
+				d2 = g_c3._val;
+				break;
+			default:
+				d2 = 7;
+				break;
+			}     //  switch c3._code
+			if (d2 == 4)
+				d2 = 3;
+
+			if (g_intcon[g_c2._val] != 0)
+				++g_c2._val;
+
+			if ((g_c2._val == 17) || (g_c2._val == 18))
+				g_c2._val = 16;
+
+			entroct(4);
+			entroct(d2);
+			entroct(g_c2._val);
+		}
+	
+		break;
+	case 4:
+		veracf(g_c2._acc);
+		i = g_c2._rep;
+		if (i != 0) {
+			do {
+				--i;
+				entroct(2);
+				entroct(g_c2._val);
+				entroct(3);
+			} while (i > 0);
+		}
+		entroct(2);
+		entroct(g_c2._val);
+		entroct(4);
+		if (g_c3._code == 9) {
+			entroct(2);
+			entroct(g_c2._val);
+			entroct(5);
+		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
+			veracf(g_c3._acc);
+			switch (g_c3._code) {
+			case 3:
+				d2 = 8;
+				break;
+			case 6:
+				d2 = g_tabdph[(g_c3._val - 14) << 1];
+				break;
+			case 5:
+				d2 = g_c3._val;
+				break;
+			default:
+				d2 = 7;
+				break;
+			}     //  switch c3._code
+
+			if (d2 == 4)
+				d2 = 3;
+
+			if (g_intcon[g_c2._val] != 0)
+				++g_c2._val;
+
+			entroct(4);
+			entroct(d2);
+			entroct(g_tabdbc[((g_c2._val - 26) << 1) + 1]);
+		}
+	
+		break;
+	default:
+		break;
+	}     // switch c2.code
+}
+
+void rot_chariot() {
+	g_c1 = g_c2;
+	g_c2 = g_c3;
+	g_c3._val = 32;
+	g_c3._code = 9;
+}
+
+void init_chariot() {
+	g_c3._rep = 0;
+	g_c3._freq = 0;
+	g_c3._acc = 0;
+	rot_chariot();
+	rot_chariot();
+}
+
+
+void trait_ph() {
+	const int deca[3] = {300, 30, 40};
+
+	int ptr_tcph = g_num_ph - 1;
+	int startPos = swap(g_t_cph[ptr_tcph]) + deca[g_typlec];
+	int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
+	int wordCount = endPos - startPos;
+	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
+		WRITE_LE_UINT16(&g_mem[adword + currWord], g_t_cph[i]);
+
+	g_ptr_oct = 0;
+	int currWord = 0;
+	init_chariot();
+
+	do {
+		rot_chariot();
+		charg_car(currWord);
+		trait_car();
+	} while (currWord < wordCount);
+
+	rot_chariot();
+	trait_car();
+	entroct(ord('#'));
+}
+
+
+
+void startSpeech(int rep, int ht, int typ) {
+	int savph[501];
+	int tempo;
+
+	if (g_vm->_soundOff)
+		return;
+
+	g_num_ph = rep;
+	g_haut = ht;
+	g_typlec = typ;
+	if (g_typlec != 0) {
+		for (int i = 0; i <= 500; ++i)
+			savph[i] = g_t_cph[i];
+		tempo = kTempoNoise;
+	} else if (g_haut > 5)
+		tempo = kTempoF;
+	else
+		tempo = kTempoM;
+	g_addfix = (float)((tempo - g_addv[0])) / 256;
+	cctable(g_tbi);
+	switch (typ) {
+	case 1:
+		charge_bruit();
+		/*if zuul then zzuul(adbruit,0,1095);*/
+		regenbruit();
+		break;
+	case 2:
+		charge_son();
+		charge_phbruit();
+		break;
+	default:
+		break;
+	}
+	trait_ph();
+	g_vm->_soundManager.litph(g_tbi, typ, tempo);
+	if (g_typlec != 0)
+		for (int i = 0; i <= 500; ++i) {
+			g_t_cph[i] = savph[i];
+			g_mlec = g_typlec;
+		}
+	writepal(g_numpal);
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
new file mode 100644
index 0000000..0e249b8
--- /dev/null
+++ b/engines/mortevielle/speech.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 original Mortville Manor DOS source code
+ * Copyright (c) 1988-1989 Lankhor
+ */
+
+#ifndef MORTEVIELLE_PAROLE_H
+#define MORTEVIELLE_PAROLE_H
+
+#include "common/scummsys.h"
+#include "mortevielle/var_mor.h"
+
+namespace Mortevielle {
+
+extern void spfrac(int wor);
+extern void charg_car(int &currWordNumb);
+extern void entroct(byte o);
+extern void veracf(byte b);
+extern void cctable(tablint &t);
+extern void regenbruit();
+extern void charge_son();
+extern void charge_phbruit();
+extern void charge_bruit();
+extern void trait_car();
+
+extern void rot_chariot();
+extern void init_chariot();
+extern void trait_ph();
+extern void startSpeech(int rep, int ht, int typ);
+
+} // End of namespace Mortevielle
+#endif
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp
deleted file mode 100644
index a65cecd..0000000
--- a/engines/mortevielle/taffich.cpp
+++ /dev/null
@@ -1,261 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/file.h"
-#include "common/str.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/level15.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/taffich.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void chardes(Common::String filename, int32 skipSize, int length) {
-	Common::File f;
-	if (!f.open(filename))
-		error("Missing file %s", filename.c_str());
-
-	int skipBlock = 0;
-	while (skipSize > 127) {
-		++skipBlock;
-		skipSize -= 128;
-	}
-	if (skipBlock != 0)
-		f.seek(skipBlock * 0x80);
-
-	int remainingSkipSize = abs(skipSize);
-	int totalLength = length + remainingSkipSize;
-	int memIndx = 0x6000 * 16;
-	while (totalLength > 0) {
-		f.read(&g_mem[memIndx], 128);
-		testfi();
-		totalLength -= 128;
-		memIndx += 128;
-	}
-	f.close();
-
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
-		g_mem[0x7000 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
-}
-
-void charani(Common::String filename, int32 skipSize, int length) {
-	Common::File f;
-	if (!f.open(filename))
-		error("Missing file - %s", filename.c_str());
-
-	int skipBlock = 0;
-	while (skipSize > 127) {
-		skipSize = skipSize - 128;
-		++skipBlock;
-	}
-	if (skipBlock != 0)
-		f.seek(skipBlock * 0x80);
-
-	int remainingSkipSize = abs(skipSize);
-	int fullLength = length + remainingSkipSize;
-	int memIndx = 0x6000 * 16;
-	while (fullLength > 0) {
-		f.read(&g_mem[memIndx], 128);
-		testfi();
-		fullLength -= 128;
-		memIndx += 128;
-	}
-	f.close();
-
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
-}
-
-void taffich() {
-	byte tran1[] = { 121, 121, 138, 139, 120 };	// array<136, 140, byte>
-	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };	// array<153, 161, byte>
-
-	int cx, handle, npal;
-	int32 lgt;
-	int alllum[16];
-
-
-	int a = g_caff;
-	if ((a >= 153) && (a <= 161))
-		a = tran2[a - 153];
-	else if ((a >= 136) && (a <= 140))
-		a = tran1[a - 136];
-	int b = a;
-	if (g_maff == a)
-		return;
-
-	switch (a) {
-	case 16:
-		g_s._pourc[9] = '*';
-		g_s._teauto[42] = '*';
-		break;
-	case 20:
-		g_s._teauto[39] = '*';
-		if (g_s._teauto[36] == '*') {
-			g_s._pourc[3] = '*';
-			g_s._teauto[38] = '*';
-		}
-		break;
-	case 24:
-		g_s._teauto[37] = '*';
-		break;
-	case 30:
-		g_s._teauto[9] = '*';
-		break;
-	case 31:
-		g_s._pourc[4] = '*';
-		g_s._teauto[35] = '*';
-		break;
-	case 118:
-		g_s._teauto[41] = '*';
-		break;
-	case 143:
-		g_s._pourc[1] = '*';
-		break;
-	case 150:
-		g_s._teauto[34] = '*';
-		break;
-	case 151:
-		g_s._pourc[2] = '*';
-		break;
-	default:
-		break;
-	}
-
-	g_vm->_okdes = true;
-	hideMouse();
-	lgt = 0;
-	Common::String filename;
-
-	if ((a != 50) && (a != 51)) {
-		int m = a + 2000;
-		if ((m > 2001) && (m < 2010))
-			m = 2001;
-		if (m == 2011)
-			m = 2010;
-		if (a == 32)
-			m = 2034;
-		if ((a == 17) && (g_maff == 14))
-			m = 2018;
-
-		if (a > 99) {
-			if ((g_is == 1) || (g_is == 0))
-				m = 2031;
-			else
-				m = 2032;
-		}
-
-		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
-			m = 2030;
-
-		if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
-			m = 2033;
-
-		g_maff = a;
-		if (a == 159)
-			a = 86;
-		else if (a > 140)
-			a = a - 67;
-		else if (a > 137)
-			a = a - 66;
-		else if (a > 99)
-			a = a - 64;
-		else if (a > 69)
-			a = a - 42;
-		else if (a > 29)
-			a = a - 5;
-		else if (a == 26)
-			a = 24;
-		else if (a > 18)
-			a = a - 1;
-		npal = a;
-
-		for (cx = 0; cx <= (a - 1); ++cx)
-			lgt = lgt + g_l[cx];
-		handle = g_l[a];
-
-		filename = "DXX.mor";
-	} else {
-		filename = "DZZ.mor";
-		handle = g_l[87];
-		if (a == 51) {
-			lgt = handle;
-			handle = g_l[88];
-		}
-		g_maff = a;
-		npal = a + 37;
-	}
-	chardes(filename, lgt, handle);
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
-		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
-			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
-		}
-		for (int i = 0; i <= 15; ++i) {
-			int k = 0;
-			for (int j = 0; j <= 15; ++j)
-				if (alllum[j] > alllum[k])
-					k = j;
-			g_mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
-			alllum[k] = -1;
-		}
-	}
-	g_numpal = npal;
-	writepal(npal);
-
-	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
-		lgt = 0;
-		if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26)) {
-			if (b == 26)
-				b = 18;
-			else if (b == 24)
-				b = 17;
-			else if (b > 15)
-				--b;
-			for (cx = 0; cx <= (b - 1); ++cx)
-				lgt += g_l[cx + 89];
-			handle = g_l[b + 89];
-			filename = "AXX.mor";
-		} else if (b == 50) {
-			filename = "AZZ.mor";
-			handle = 1260;
-		}
-		charani(filename, lgt, handle);
-	}
-	showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
-		if ((a == 13) || (a == 14))
-			displayAloneText();
-		else if (!g_vm->_blo)
-			cx = t11(g_s._currPlace);
-		g_mpers =  0;
-	}
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/taffich.h b/engines/mortevielle/taffich.h
deleted file mode 100644
index 4bb5e77..0000000
--- a/engines/mortevielle/taffich.h
+++ /dev/null
@@ -1,41 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_TAFFICH_H
-#define MORTEVIELLE_TAFFICH_H
-
-#include "common/str.h"
-
-namespace Mortevielle {
-
-extern void chardes(Common::String filename, int32 passe, int long_);
-extern void charani(Common::String filename, int32 skipSize, int length);
-extern void taffich();
-
-} // End of namespace Mortevielle
-
-#endif


Commit: c3e81b1b912a533a23a261576fd4f5b9c86672b6
    https://github.com/scummvm/scummvm/commit/c3e81b1b912a533a23a261576fd4f5b9c86672b6
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:08-07:00

Commit Message:
MORTEVIELLE: Merge prog and mor files

Changed paths:
  R engines/mortevielle/prog.cpp
  R engines/mortevielle/prog.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5f511fc..59a99ef 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -38,7 +38,6 @@
 
 namespace Mortevielle {
 
-
 /**
  * Engine function - Move
  * @remarks	Originally called 'taller'
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 103a4fc..07631ea 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -13,7 +13,6 @@ MODULE_OBJS := \
 	mouse.o \
 	outtext.o \
 	ovd1.o \
-	prog.o \
 	saveload.o \
 	sound.o \
 	speech.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 7c92d9a..ef55e31 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -30,6 +30,7 @@
 #include "common/str.h"
 #include "common/system.h"
 #include "common/textconsole.h"
+#include "mortevielle/actions.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/menu.h"
@@ -2425,4 +2426,213 @@ void aldepl() {
 	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
 }
 
+/**
+ * Engine function - Change Graphical Device
+ * @remarks	Originally called 'change_gd'
+ */
+void changeGraphicalDevice(int newDevice) {
+	hideMouse();
+	g_vm->_currGraphicalDevice = newDevice;
+	hirs();
+	initMouse();
+	showMouse();
+	dessine_rouleau();
+	tinke();
+	drawClock();
+	if (g_ipers != 0)
+		showPeoplePresent(g_ipers);
+	else
+		displayAloneText();
+	clearScreenType2();
+	clsf3();
+	g_maff = 68;
+	afdes(0);
+	repon(2, g_crep);
+	g_vm->_menu.displayMenu();
+}
+
+/**
+ * Called when a savegame has been loaded.
+ * @remarks	Originally called 'antegame'
+ */
+void MortevielleEngine::gameLoaded() {
+	hideMouse();
+	_menu._menuDisplayed = false;
+	_loseGame = true;
+	_anyone = false;
+	_okdes = true;
+	_col = false;
+	_hiddenHero = false;
+	_brt = false;
+	g_maff = 68;
+	g_mnumo = 0;
+	g_prebru = 0;
+	g_x = 0;
+	g_y = 0;
+	g_num = 0;
+	g_hdb = 0;
+	g_hfb = 0;
+	g_cs = 0;
+	g_is = 0;
+	g_ment = 0;
+	_syn = true;
+	_heroSearching = true;
+	g_mchai = 0;
+	g_inei = 0;
+	initouv();
+	g_iouv = 0;
+	g_dobj = 0;
+	affrep();
+	g_hintPctMessage = deline(580);
+
+	_okdes = false;
+	_endGame = true;
+	_loseGame = false;
+	_heroSearching = false;
+
+	displayAloneText();
+	tinke();
+	drawClock();
+	afdes(0);
+	repon(2, g_crep);
+	clsf3();
+	_endGame = false;
+	tmlieu(g_s._currPlace);
+	modinv();
+	if (g_s._selectedObjectId != 0)
+		modobj(g_s._selectedObjectId + 400);
+	showMouse();
+}
+
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+void tmaj3() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if (minute == 30)
+		minute = 1;
+	hour += day * 24;
+	minute += hour * 2;
+	g_s._heure = chr(minute);
+}
+
+void tsitu() {
+	if (!g_vm->_col)
+		clearScreenType2();
+	g_vm->_syn = false;
+	g_vm->_keyPressedEsc = false;
+	if (!g_vm->_anyone) {
+		if (g_vm->_brt)
+			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
+				g_ctrm = 4;
+				mennor();
+				return;
+			}
+		if (g_msg[3] == MENU_MOVE)
+			fctMove();
+		if (g_msg[3] == MENU_DISCUSS)
+			fctDiscuss();
+		if (g_msg[3] == MENU_INVENTORY)
+			fctInventoryTake();
+		if (g_msg[4] == OPCODE_ATTACH)
+			fctAttach();
+		if (g_msg[4] == OPCODE_WAIT)
+			fctWait();
+		if (g_msg[4] == OPCODE_FORCE)
+			fctForce();
+		if (g_msg[4] == OPCODE_SLEEP)
+			fctSleep();
+		if (g_msg[4] == OPCODE_LISTEN)
+			fctListen();
+		if (g_msg[4] == OPCODE_ENTER)
+			fctEnter();
+		if (g_msg[4] == OPCODE_CLOSE)
+			fctClose();
+		if (g_msg[4] == OPCODE_SEARCH)
+			fctSearch();
+		if (g_msg[4] == OPCODE_KNOCK)
+			fctKnock();
+		if (g_msg[4] == OPCODE_SCRATCH)
+			fctScratch();
+		if (g_msg[4] == OPCODE_READ)
+			fctRead();
+		if (g_msg[4] == OPCODE_EAT)
+			fctEat();
+		if (g_msg[4] == OPCODE_PLACE)
+			fctPlace();
+		if (g_msg[4] == OPCODE_OPEN)
+			fctOpen();
+		if (g_msg[4] == OPCODE_TAKE)
+			fctTake();
+		if (g_msg[4] == OPCODE_LOOK)
+			fctLook();
+		if (g_msg[4] == OPCODE_SMELL)
+			fctSmell();
+		if (g_msg[4] == OPCODE_SOUND)
+			fctSound();
+		if (g_msg[4] == OPCODE_LEAVE)
+			fctLeave();
+		if (g_msg[4] == OPCODE_LIFT)
+			fctLift();
+		if (g_msg[4] == OPCODE_TURN)
+			fctTurn();
+		if (g_msg[4] == OPCODE_SSEARCH)
+			fctSelfSearch();
+		if (g_msg[4] == OPCODE_SREAD)
+			fctSelfRead();
+		if (g_msg[4] == OPCODE_SPUT)
+			fctSelfPut();
+		if (g_msg[4] == OPCODE_SLOOK)
+			fctSelftLook();
+		g_vm->_hiddenHero = false;
+
+		if (g_msg[4] == OPCODE_SHIDE)
+			fctSelfHide();
+	} else {
+		if (g_vm->_anyone) {
+			quelquun();
+			g_vm->_anyone = false;
+			mennor();
+			return;
+		}
+	}
+	int hour, day, minute;
+	updateHour(day, hour, minute);
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
+	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
+		++g_s._faithScore;
+	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
+	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
+		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
+			g_crep = 1501;
+			tperd();
+		}
+		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
+			g_crep = 1508;
+			tperd();
+		}
+		if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
+			g_crep = 1502;
+			tperd();
+		}
+	}
+	mennor();
+}
+
+/* NIVEAU 1 */
+
+void theure() {
+	g_vj = ord(g_s._heure);
+	g_vh = g_vj % 48;
+	g_vj /= 48;
+	g_vm__ = g_vh % 2;
+	g_vh /= 2;
+	g_hour = g_vh;
+	if (g_vm__ == 1)
+		g_minute = 30;
+	else
+		g_minute = 0;
+}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 73f6df2..d7d5c87 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -178,5 +178,15 @@ extern void t23coul(int &l);
 extern void maivid();
 extern void st13(int ob);
 extern void aldepl();
+
+extern void changeGraphicalDevice(int newDevice);
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+extern void tmaj3();
+extern void tsitu();
+
+/* NIVEAU 1 */
+extern void theure();
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 5093013..4b8c267 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -38,7 +38,6 @@
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/ovd1.h"
-#include "mortevielle/prog.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/var_mor.h"
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
deleted file mode 100644
index a6ccfcb..0000000
--- a/engines/mortevielle/prog.cpp
+++ /dev/null
@@ -1,250 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/actions.h"
-#include "mortevielle/dialogs.h"
-#include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/prog.h"
-#include "mortevielle/var_mor.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-
-namespace Mortevielle {
-
-/**
- * Engine function - Change Graphical Device
- * @remarks	Originally called 'change_gd'
- */
-void changeGraphicalDevice(int newDevice) {
-	hideMouse();
-	g_vm->_currGraphicalDevice = newDevice;
-	hirs();
-	initMouse();
-	showMouse();
-	dessine_rouleau();
-	tinke();
-	drawClock();
-	if (g_ipers != 0)
-		showPeoplePresent(g_ipers);
-	else
-		displayAloneText();
-	clearScreenType2();
-	clsf3();
-	g_maff = 68;
-	afdes(0);
-	repon(2, g_crep);
-	g_vm->_menu.displayMenu();
-}
-
-/**
- * Called when a savegame has been loaded.
- * @remarks	Originally called 'antegame'
- */
-void MortevielleEngine::gameLoaded() {
-	hideMouse();
-	_menu._menuDisplayed = false;
-	_loseGame = true;
-	_anyone = false;
-	_okdes = true;
-	_col = false;
-	_hiddenHero = false;
-	_brt = false;
-	g_maff = 68;
-	g_mnumo = 0;
-	g_prebru = 0;
-	g_x = 0;
-	g_y = 0;
-	g_num = 0;
-	g_hdb = 0;
-	g_hfb = 0;
-	g_cs = 0;
-	g_is = 0;
-	g_ment = 0;
-	_syn = true;
-	_heroSearching = true;
-	g_mchai = 0;
-	g_inei = 0;
-	initouv();
-	g_iouv = 0;
-	g_dobj = 0;
-	affrep();
-	g_hintPctMessage = deline(580);
-
-	_okdes = false;
-	_endGame = true;
-	_loseGame = false;
-	_heroSearching = false;
-
-	displayAloneText();
-	tinke();
-	drawClock();
-	afdes(0);
-	repon(2, g_crep);
-	clsf3();
-	_endGame = false;
-	tmlieu(g_s._currPlace);
-	modinv();
-	if (g_s._selectedObjectId != 0)
-		modobj(g_s._selectedObjectId + 400);
-	showMouse();
-}
-
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-void tmaj3() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if (minute == 30)
-		minute = 1;
-	hour += day * 24;
-	minute += hour * 2;
-	g_s._heure = chr(minute);
-}
-
-void tsitu() {
-	if (!g_vm->_col)
-		clearScreenType2();
-	g_vm->_syn = false;
-	g_vm->_keyPressedEsc = false;
-	if (!g_vm->_anyone) {
-		if (g_vm->_brt)
-			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
-				g_ctrm = 4;
-				mennor();
-				return;
-			}
-		if (g_msg[3] == MENU_MOVE)
-			fctMove();
-		if (g_msg[3] == MENU_DISCUSS)
-			fctDiscuss();
-		if (g_msg[3] == MENU_INVENTORY)
-			fctInventoryTake();
-		if (g_msg[4] == OPCODE_ATTACH)
-			fctAttach();
-		if (g_msg[4] == OPCODE_WAIT)
-			fctWait();
-		if (g_msg[4] == OPCODE_FORCE)
-			fctForce();
-		if (g_msg[4] == OPCODE_SLEEP)
-			fctSleep();
-		if (g_msg[4] == OPCODE_LISTEN)
-			fctListen();
-		if (g_msg[4] == OPCODE_ENTER)
-			fctEnter();
-		if (g_msg[4] == OPCODE_CLOSE)
-			fctClose();
-		if (g_msg[4] == OPCODE_SEARCH)
-			fctSearch();
-		if (g_msg[4] == OPCODE_KNOCK)
-			fctKnock();
-		if (g_msg[4] == OPCODE_SCRATCH)
-			fctScratch();
-		if (g_msg[4] == OPCODE_READ)
-			fctRead();
-		if (g_msg[4] == OPCODE_EAT)
-			fctEat();
-		if (g_msg[4] == OPCODE_PLACE)
-			fctPlace();
-		if (g_msg[4] == OPCODE_OPEN)
-			fctOpen();
-		if (g_msg[4] == OPCODE_TAKE)
-			fctTake();
-		if (g_msg[4] == OPCODE_LOOK)
-			fctLook();
-		if (g_msg[4] == OPCODE_SMELL)
-			fctSmell();
-		if (g_msg[4] == OPCODE_SOUND)
-			fctSound();
-		if (g_msg[4] == OPCODE_LEAVE)
-			fctLeave();
-		if (g_msg[4] == OPCODE_LIFT)
-			fctLift();
-		if (g_msg[4] == OPCODE_TURN)
-			fctTurn();
-		if (g_msg[4] == OPCODE_SSEARCH)
-			fctSelfSearch();
-		if (g_msg[4] == OPCODE_SREAD)
-			fctSelfRead();
-		if (g_msg[4] == OPCODE_SPUT)
-			fctSelfPut();
-		if (g_msg[4] == OPCODE_SLOOK)
-			fctSelftLook();
-		g_vm->_hiddenHero = false;
-
-		if (g_msg[4] == OPCODE_SHIDE)
-			fctSelfHide();
-	} else {
-		if (g_vm->_anyone) {
-			quelquun();
-			g_vm->_anyone = false;
-			mennor();
-			return;
-		}
-	}
-	int hour, day, minute;
-	updateHour(day, hour, minute);
-	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
-	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
-		++g_s._faithScore;
-	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
-	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
-		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
-			g_crep = 1501;
-			tperd();
-		}
-		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
-			g_crep = 1508;
-			tperd();
-		}
-		if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
-			g_crep = 1502;
-			tperd();
-		}
-	}
-	mennor();
-}
-
-/* NIVEAU 1 */
-
-void theure() {
-	g_vj = ord(g_s._heure);
-	g_vh = g_vj % 48;
-	g_vj /= 48;
-	g_vm__ = g_vh % 2;
-	g_vh /= 2;
-	g_hour = g_vh;
-	if (g_vm__ == 1)
-		g_minute = 30;
-	else
-		g_minute = 0;
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
deleted file mode 100644
index c6ccca8..0000000
--- a/engines/mortevielle/prog.h
+++ /dev/null
@@ -1,44 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_PROG_H
-#define MORTEVIELLE_PROG_H
-
-namespace Mortevielle {
-
-extern void changeGraphicalDevice(int newDevice);
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-extern void tmaj3();
-extern void tsitu();
-
-/* NIVEAU 1 */
-extern void theure();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 2c2af49..a864322 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -32,7 +32,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/ovd1.h"
-#include "mortevielle/prog.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/var_mor.h"
 


Commit: 6e1cc8b6d977db44ffa781535a4e6d3d0db45b83
    https://github.com/scummvm/scummvm/commit/6e1cc8b6d977db44ffa781535a4e6d3d0db45b83
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:09-07:00

Commit Message:
MORTEVIELLE: Move opcode functions to MortevielleEngine class

Changed paths:
  R engines/mortevielle/actions.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 59a99ef..49496e8 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -26,7 +26,6 @@
  */
 
 #include "common/scummsys.h"
-#include "mortevielle/actions.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -42,7 +41,7 @@ namespace Mortevielle {
  * Engine function - Move
  * @remarks	Originally called 'taller'
  */
-void fctMove() {
+void MortevielleEngine::fctMove() {
 	if ((g_s._currPlace == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		g_s._currPlace = LANDING;
 		g_caff = g_s._currPlace;
@@ -178,7 +177,7 @@ void fctMove() {
  * Engine function - Take
  * @remarks	Originally called 'tprendre'
  */
-void fctTake() {
+void MortevielleEngine::fctTake() {
 	if (g_caff > 99) {
 		int cx = g_caff;
 		avpoing(cx);
@@ -291,7 +290,7 @@ void fctTake() {
  * Engine function - Inventory / Take
  * @remarks	Originally called 'tsprendre'
  */
-void fctInventoryTake() {
+void MortevielleEngine::fctInventoryTake() {
 	int cx, cy, cz;
 
 	cx = 0;
@@ -317,7 +316,7 @@ void fctInventoryTake() {
  * Engine function - Lift
  * @remarks	Originally called 'tsoulever'
  */
-void fctLift() {
+void MortevielleEngine::fctLift() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_LIFT));
 	tfleche();
@@ -351,7 +350,7 @@ void fctLift() {
  * Engine function - Read
  * @remarks	Originally called 'tlire'
  */
-void fctRead() {
+void MortevielleEngine::fctRead() {
 	if (g_caff > 99)
 		st4(g_caff);
 	else {
@@ -370,7 +369,7 @@ void fctRead() {
  * Engine function - Self / Read
  * @remarks	Originally called 'tslire'
  */
-void fctSelfRead() {
+void MortevielleEngine::fctSelfRead() {
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else
@@ -381,7 +380,7 @@ void fctSelfRead() {
  * Engine function - Look
  * @remarks	Originally called 'tregarder'
  */
-void fctLook() {
+void MortevielleEngine::fctLook() {
 	int cx;
 
 	if (g_caff > 99) {
@@ -459,7 +458,7 @@ void fctLook() {
  * Engine function - Self / Look
  * @remarks	Originally called 'tsregarder'
  */
-void fctSelftLook() {
+void MortevielleEngine::fctSelftLook() {
 	if (g_s._selectedObjectId != 0)
 		treg(g_s._selectedObjectId);
 	else
@@ -470,7 +469,7 @@ void fctSelftLook() {
  * Engine function - Search
  * @remarks	Originally called 'tfouiller'
  */
-void fctSearch() {
+void MortevielleEngine::fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
 	if (g_caff > 99) {
@@ -563,7 +562,7 @@ void fctSearch() {
  * Engine function - Self / Search
  * @remarks	Originally called 'tsfouiller'
  */
-void fctSelfSearch() {
+void MortevielleEngine::fctSelfSearch() {
 	if (g_s._selectedObjectId != 0)
 		st7(g_s._selectedObjectId);
 	else
@@ -574,7 +573,7 @@ void fctSelfSearch() {
  * Engine function - Open
  * @remarks	Originally called 'touvrir'
  */
-void fctOpen() {
+void MortevielleEngine::fctOpen() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_OPEN));
 
@@ -636,7 +635,7 @@ void fctOpen() {
  * Engine function - Place
  * @remarks	Originally called 'tmettre'
  */
-void fctPlace() {
+void MortevielleEngine::fctPlace() {
 	if (g_s._selectedObjectId == 0) {
 		g_crep = 186;
 		return;
@@ -770,7 +769,7 @@ void fctPlace() {
  * Engine function - Turn
  * @remarks	Originally called 'ttourner'
  */
-void fctTurn() {
+void MortevielleEngine::fctTurn() {
 	if (g_caff > 99) {
 		g_crep = 149;
 		return;
@@ -810,7 +809,7 @@ void fctTurn() {
  * Engine function - Hide Self
  * @remarks	Originally called 'tcacher'
  */
-void fctSelfHide() {
+void MortevielleEngine::fctSelfHide() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_HIDE_SELF));
 	tfleche();
@@ -829,7 +828,7 @@ void fctSelfHide() {
  * Engine function - Attach
  * @remarks	Originally called 'tattacher'
  */
-void fctAttach() {
+void MortevielleEngine::fctAttach() {
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
@@ -856,7 +855,7 @@ void fctAttach() {
  * Engine function - Close
  * @remarks	Originally called 'tfermer'
  */
-void fctClose() {
+void MortevielleEngine::fctClose() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_CLOSE));
 
@@ -896,7 +895,7 @@ void fctClose() {
  * Engine function - Knock
  * @remarks	Originally called 'tfrapper'
  */
-void fctKnock() {
+void MortevielleEngine::fctKnock() {
 	warning("Knock - _currPlace %d", g_s._currPlace);
 
 	if (!g_vm->_syn)
@@ -946,7 +945,7 @@ void fctKnock() {
  * Engine function - Self / Put
  * @remarks	Originally called 'tposer'
  */
-void fctSelfPut() {
+void MortevielleEngine::fctSelfPut() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_POSE));
 	if (g_s._selectedObjectId == 0)
@@ -1040,7 +1039,7 @@ void fctSelfPut() {
  * Engine function - Listen
  * @remarks	Originally called 'tecouter'
  */
-void fctListen() {
+void MortevielleEngine::fctListen() {
 	if (g_s._currPlace != 26)
 		g_crep = 101;
 	else {
@@ -1078,7 +1077,7 @@ void fctListen() {
  * Engine function - Eat
  * @remarks	Originally called 'tmanger'
  */
-void fctEat() {
+void MortevielleEngine::fctEat() {
 	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
 		g_crep = 148;
 	} else {
@@ -1119,7 +1118,7 @@ void fctEat() {
  * Engine function - Enter
  * @remarks	Originally called 'tentrer'
  */
-void fctEnter() {
+void MortevielleEngine::fctEnter() {
 	if ((g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 		t1sama();
 		tmlieu(g_s._currPlace);
@@ -1178,7 +1177,7 @@ void fctEnter() {
  * Engine function - Sleep
  * @remarks	Originally called 'tdormir'
  */
-void fctSleep() {
+void MortevielleEngine::fctSleep() {
 	int z, j, h, m;
 
 	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
@@ -1225,7 +1224,7 @@ void fctSleep() {
  * Engine function - Force
  * @remarks	Originally called 'tdefoncer'
  */
-void fctForce() {
+void MortevielleEngine::fctForce() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_SMASH));
 	if (g_caff < 25)
@@ -1245,7 +1244,7 @@ void fctForce() {
  * Engine function - Leave
  * @remarks	Originally called 'tsortir'
  */
-void fctLeave() {
+void MortevielleEngine::fctLeave() {
 	tsort();
 	g_crep = 0;
 	if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK) || (g_s._currPlace == WELL))
@@ -1281,7 +1280,7 @@ void fctLeave() {
  * Engine function - Wait
  * @remarks	Originally called 'tattendre'
  */
-void fctWait() {
+void MortevielleEngine::fctWait() {
 	g_mpers = 0;
 	clsf3();
 
@@ -1314,7 +1313,7 @@ void fctWait() {
  * Engine function - Sound
  * @remarks	Originally called 'tsonder'
  */
-void fctSound() {
+void MortevielleEngine::fctSound() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_PROBE2));
 	if (g_caff < 27) {
@@ -1329,7 +1328,7 @@ void fctSound() {
  * Engine function - Discuss
  * @remarks	Originally called 'tparler'
  */
-void fctDiscuss() {
+void MortevielleEngine::fctDiscuss() {
 	bool te[47];
 	int cy, cx, max, suj, co, lig, icm, i, choi, x, y, c;
 	char tou;
@@ -1394,7 +1393,7 @@ void fctDiscuss() {
 			moveMouse(f, tou);
 			CHECK_QUIT;
 
-			getMousePos(x, y, c);
+			getMousePos_(x, y, c);
 			x *= (3 - g_res);
 			if (x > 319)
 				cx = 41;
@@ -1527,7 +1526,7 @@ void fctDiscuss() {
  * Engine function - Smell
  * @remarks	Originally called 'tsentir'
  */
-void fctSmell() {
+void MortevielleEngine::fctSmell() {
 	g_crep = 119;
 	if (g_caff < 26) {
 		if (!g_vm->_syn)
@@ -1545,7 +1544,7 @@ void fctSmell() {
  * Engine function - Scratch
  * @remarks	Originally called 'tgratter'
  */
-void fctScratch() {
+void MortevielleEngine::fctScratch() {
 	g_crep = 155;
 	if (g_caff < 27) {
 		if (!g_vm->_syn)
diff --git a/engines/mortevielle/actions.h b/engines/mortevielle/actions.h
deleted file mode 100644
index 74d4e5c..0000000
--- a/engines/mortevielle/actions.h
+++ /dev/null
@@ -1,68 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_ACTIONS_H
-#define MORTEVIELLE_ACTIONS_H
-
-namespace Mortevielle {
-
-/* NIVEAU 4 */
-extern void fctMove();
-extern void fctTake();
-extern void fctInventoryTake();
-extern void fctLift();
-extern void fctRead();
-extern void fctSelfRead();
-extern void fctLook();
-extern void fctSelftLook();
-extern void fctSearch();
-extern void fctSelfSearch();
-extern void fctOpen();
-extern void fctPlace();
-extern void fctTurn();
-extern void fctSelfHide();
-extern void fctAttach();
-extern void fctClose();
-extern void fctKnock();
-extern void fctSelfPut();
-extern void fctListen();
-extern void fctEat();
-extern void fctEnter();
-extern void fctSleep();
-extern void fctForce();
-extern void fctLeave();
-extern void fctWait();
-extern void fctSound();
-extern void fctDiscuss();
-extern void fctSmell();
-extern void fctScratch();
-/* NIVEAU 2 */
-extern void endGame();
-extern void loseGame();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ef55e31..c973fab 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -30,7 +30,6 @@
 #include "common/str.h"
 #include "common/system.h"
 #include "common/textconsole.h"
-#include "mortevielle/actions.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/menu.h"
@@ -61,7 +60,7 @@ void copcha() {
 bool isMouseIn(rectangle r) {
 	int x, y, c;
 
-	getMousePos(x, y, c);
+	getMousePos_(x, y, c);
 	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
 		return true;
 
@@ -91,12 +90,11 @@ void writepal(int n) {
 		}
 		break;
 	case MODE_CGA: {
-		warning("TODO: If this code is needed, resolve the incompatible types");
 		nhom pal[16];
 		for (int i = 0; i < 16; ++i) {
 			pal[i] = g_palcga[n]._a[i];
 		}
-//		nhom pal[16] = palcga[n]._a;
+
 		if (n < 89)
 			palette(g_palcga[n]._p);
 		
@@ -1833,7 +1831,7 @@ void tkey1(bool d) {
 	while (keypressed())
 		g_key = testou();
 	do {
-		getMousePos(x, y, c);
+		getMousePos_(x, y, c);
 		keypressed();
 	} while (c != 0);
 	
@@ -1842,7 +1840,7 @@ void tkey1(bool d) {
 		if (d)
 			tinke();
 		quest = keypressed();
-		getMousePos(x, y, c);
+		getMousePos_(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
 	if (quest)
@@ -2518,18 +2516,23 @@ void tmaj3() {
 	g_s._heure = chr(minute);
 }
 
-void tsitu() {
-	if (!g_vm->_col)
+/**
+ * Engine function - Handle OpCodes
+ * @remarks	Originally called 'tsitu'
+ */
+void MortevielleEngine::handleOpcode() {
+	if (!_col)
 		clearScreenType2();
-	g_vm->_syn = false;
-	g_vm->_keyPressedEsc = false;
-	if (!g_vm->_anyone) {
-		if (g_vm->_brt)
+	_syn = false;
+	_keyPressedEsc = false;
+	if (!_anyone) {
+		if (_brt) {
 			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
 				g_ctrm = 4;
 				mennor();
 				return;
 			}
+		}
 		if (g_msg[3] == MENU_MOVE)
 			fctMove();
 		if (g_msg[3] == MENU_DISCUSS)
@@ -2586,14 +2589,14 @@ void tsitu() {
 			fctSelfPut();
 		if (g_msg[4] == OPCODE_SLOOK)
 			fctSelftLook();
-		g_vm->_hiddenHero = false;
+		_hiddenHero = false;
 
 		if (g_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
-		if (g_vm->_anyone) {
+		if (_anyone) {
 			quelquun();
-			g_vm->_anyone = false;
+			_anyone = false;
 			mennor();
 			return;
 		}
@@ -2604,7 +2607,7 @@ void tsitu() {
 	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
 		++g_s._faithScore;
 	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
-	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
+	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
 		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
 			tperd();
@@ -2613,7 +2616,7 @@ void tsitu() {
 			g_crep = 1508;
 			tperd();
 		}
-		if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
+		if ((day > 1) && (hour > 8) && (!_loseGame)) {
 			g_crep = 1502;
 			tperd();
 		}
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index d7d5c87..2336bc4 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -184,7 +184,6 @@ extern void changeGraphicalDevice(int newDevice);
 /* NIVEAU 3 */
 /* procedure PROGRAMME */
 extern void tmaj3();
-extern void tsitu();
 
 /* NIVEAU 1 */
 extern void theure();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4b8c267..1ef69a6 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -29,7 +29,6 @@
 #include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/actions.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"
@@ -552,7 +551,7 @@ void MortevielleEngine::mainGame() {
 
 /**
  * This method handles playing a loaded game
- * @remarks	Originally called tojouer
+ * @remarks	Originally called tjouer
  */
 void MortevielleEngine::playGame() {
 	gameLoaded();
@@ -660,7 +659,7 @@ void MortevielleEngine::handleAction() {
 			}
 			do {
 				if (! oo)
-					tsitu();
+					handleOpcode();
 
 				if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0d1f567..c1ed2ad 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -169,10 +169,42 @@ public:
 	void delay(int amount);
 	Common::String getEngineString(int idx) const { return _engineStrings[idx]; }
 	Common::String getGameString(int idx) const { return _gameStrings[idx]; }
+	void handleOpcode();
 
 	void endGame();
 	void loseGame();
 	void gameLoaded();
+
+/* NIVEAU 4 */
+	void fctMove();
+	void fctTake();
+	void fctInventoryTake();
+	void fctLift();
+	void fctRead();
+	void fctSelfRead();
+	void fctLook();
+	void fctSelftLook();
+	void fctSearch();
+	void fctSelfSearch();
+	void fctOpen();
+	void fctPlace();
+	void fctTurn();
+	void fctSelfHide();
+	void fctAttach();
+	void fctClose();
+	void fctKnock();
+	void fctSelfPut();
+	void fctListen();
+	void fctEat();
+	void fctEnter();
+	void fctSleep();
+	void fctForce();
+	void fctLeave();
+	void fctWait();
+	void fctSound();
+	void fctDiscuss();
+	void fctSmell();
+	void fctScratch();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 1240fa4..2eec6ab 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -278,7 +278,7 @@ void setMousePos(int x, int y) {
  * Get mouse poisition
  * @remarks	Originally called 'read_pos_mouse'
  */
-void getMousePos(int &x, int &y, int &c) {
+void getMousePos_(int &x, int &y, int &c) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
 	c = g_vm->getMouseClick() ? 1 : 0;
@@ -307,7 +307,7 @@ void moveMouse(bool &funct, char &key) {
 		CHECK_QUIT;
 
 		in1 = get_ch();
-		getMousePos(cx, cy, cd);
+		getMousePos_(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4':
 			cx = cx - 8;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index d17654c..532644a 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -44,7 +44,7 @@ void initMouse();
 extern void hideMouse();
 extern void showMouse();
 extern void setMousePos(int x, int y);
-extern void getMousePos(int &x, int &y, int &c);
+extern void getMousePos_(int &x, int &y, int &c);
 extern void moveMouse(bool &funct, char &key);
 
 } // End of namespace Mortevielle


Commit: 46a972af95e67d816e7572a9a0c161760cc67f00
    https://github.com/scummvm/scummvm/commit/46a972af95e67d816e7572a9a0c161760cc67f00
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:11-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b37e0a5..b5cf831 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -463,9 +463,9 @@ void f3f8::aff50(bool drawAni50Fl) {
 
 void f3f8::ani50() {
 	g_crep = animof(1, 1);
-	pictout(adani, g_crep, 63, 12);
+	pictout(kAdrAni, g_crep, 63, 12);
 	g_crep = animof(2, 1);
-	pictout(adani, g_crep, 63, 12);
+	pictout(kAdrAni, g_crep, 63, 12);
 	g_vm->_largestClearScreen = (g_res == 1);
 	repon(2, kDialogStringIndex + 143);
 }
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index c3f33e8..eaab56d 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -33,6 +33,7 @@
 namespace Mortevielle {
 
 static const int NUM_LINES = 7;
+const int kMaxRect = 14;
 
 class Alert {
 private:
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index c973fab..a19bb2d 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -161,12 +161,12 @@ void adzon() {
  * Returns the offset within the compressed image data resource of the desired image
  */
 int animof(int ouf, int num) {
-	int nani = g_mem[adani * 16 + 1];
+	int nani = g_mem[kAdrAni * 16 + 1];
 	int aux = num;
 	if (ouf != 1)
 		aux += nani;
 
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[kAdrAni * 16 + (aux << 1)]);
 
 	return animof_result;
 }
@@ -1557,7 +1557,7 @@ void aniof(int ouf, int num) {
 			num = 3;
 	}
 
-	int ad = adani;
+	int ad = kAdrAni;
 	int offset = animof(ouf, num);
 
 	GfxSurface surface;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 2336bc4..5f47a17 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -33,6 +33,9 @@
 
 namespace Mortevielle {
 
+const int kTime1 = 410;
+const int kTime2 = 250;
+
 /* NIVEAU 15 */
 extern void copcha();
 extern bool isMouseIn(rectangle r);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c1ed2ad..345db2c 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -78,6 +78,16 @@ enum DataType {
 #define MORT_DAT "mort.dat"
 #define GAME_FRAME_DELAY (1000 / 50)
 
+const int asoul = 154;
+const int aouvr = 282;
+const int achai = 387;
+const int acha = 492;
+const int arcf = 1272;
+const int arep = 1314;
+const int amzon = 1650;
+const int fleche = 1758;
+const int arega = 0;
+
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 9d7c38d..0d3216d 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -292,7 +292,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+		g_mem[kAdrAni * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
 }
 
 void taffich() {
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 03523d7..cd109ff 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -33,9 +33,10 @@
 
 namespace Mortevielle {
 
+const int kAdrAni = 0x7314;
+
 extern Common::String deline(int num);
 extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-
 extern void chardes(Common::String filename, int32 passe, int long_);
 extern void charani(Common::String filename, int32 skipSize, int length);
 extern void taffich();
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 53da434..058a880 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -190,7 +190,7 @@ void loadBRUIT5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&g_mem[adbruit5 * 16 + 0], 149 * 128);
+	f.read(&g_mem[kAdrNoise5 * 16 + 0], 149 * 128);
 	f.close();
 }
 
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 2ad5c05..dae6e83 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -48,10 +48,8 @@ void spfrac(int wor) {
 }
 
 void charg_car(int &currWordNumb) {
-	int wor, int_;
-
-	wor = swap(READ_LE_UINT16(&g_mem[adword + currWordNumb]));
-	int_ = wor & 0x3f;
+	int wor = swap(READ_LE_UINT16(&g_mem[kAdrWord + currWordNumb]));
+	int int_ = wor & 0x3f;
 
 	if ((int_ >= 0) && (int_ <= 13)) {
 		g_c3._val = int_;
@@ -90,7 +88,7 @@ void charg_car(int &currWordNumb) {
 
 
 void entroct(byte o) {
-	g_mem[adtroct * 16 + g_ptr_oct] = o;
+	g_mem[kAdrTroct * 16 + g_ptr_oct] = o;
 	++g_ptr_oct;
 }
 
@@ -109,16 +107,20 @@ void cctable(tablint &t) {
 }
 
 void regenbruit() {
-	int i = offsetb3 + 8590;
+	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
+		g_t_cph[j] = READ_LE_UINT16(&g_mem[kAdrNoise3 + i]);
 		i += 2;
 		++j;
-	} while (i < offsetb3 + 8790);
+	} while (i < kOffsetB3 + 8790);
 }
 
-void charge_son() {
+/**
+ * Load sonmus.mor file
+ * @remarks	Originally called 'charge_son'
+ */
+void loadMusicSound() {
 	Common::File f;
 
 	if (!f.open("sonmus.mor"))
@@ -126,11 +128,15 @@ void charge_son() {
 	
 	f.read(&g_mem[0x7414 * 16 + 0], 273);
 
-	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
+	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[kAdrNoise * 16], 273);
 	f.close();
 }
 
-void charge_phbruit() {
+/**
+ * Load phoneme sound file
+ * @remarks	Originally called 'charge_phbruit'
+ */
+void loadPhonemeSounds() {
 	Common::File f;
 
 	if (!f.open("phbrui.mor"))
@@ -142,17 +148,21 @@ void charge_phbruit() {
 	f.close();
 }
 
-void charge_bruit() {
+/**
+ * Speech function - Load Noise file
+ * @remarks	Originally called 'charge_bruit'
+ */
+void loadNoise() {
 	Common::File f;
 	int i;
 
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&g_mem[adbruit * 16 + 0], 250);
+	f.read(&g_mem[kAdrNoise * 16 + 0], 250);
 	for (i = 0; i <= 19013; ++i)
-		g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
-	f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
+		g_mem[kAdrNoise * 16 + 32000 + i] = g_mem[kAdrNoise5 + i];
+	f.read(&g_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
 
 	f.close();
 }
@@ -172,12 +182,12 @@ void trait_car() {
 		if (g_c2._code == 6)
 			d3 = g_tabdph[(g_c2._val - 14) << 1];
 		else
-			d3 = null;
+			d3 = kNullValue;
 		if (g_c1._code >= 5) {
 			veracf(g_c2._acc);
 			if (g_c1._code == 9) {
 				entroct(4);
-				if (d3 == null)
+				if (d3 == kNullValue)
 					entroct(g_c2._val);
 				else
 					entroct(d3);
@@ -189,7 +199,7 @@ void trait_car() {
 		case 0:
 			entroct(0);
 			entroct(g_c2._val);
-			if (d3 == null)
+			if (d3 == kNullValue)
 				if (g_c3._code == 9)
 					entroct(2);
 				else
@@ -207,14 +217,14 @@ void trait_car() {
 				do {
 					--i;
 					entroct(0);
-					if (d3 == null)
+					if (d3 == kNullValue)
 						entroct(g_c2._val);
 					else
 						entroct(d3);
 					entroct(3);
 				} while (i >= 0);
 			}
-			if (d3 == null) {
+			if (d3 == kNullValue) {
 				entroct(4);
 				entroct(g_c2._val);
 				entroct(0);
@@ -232,14 +242,14 @@ void trait_car() {
 				do {
 					--i;
 					entroct(0);
-					if (d3 == null)
+					if (d3 == kNullValue)
 						entroct(g_c2._val);
 					else
 						entroct(d3);
 					entroct(3);
 				} while (i >= 0);
 			}
-			if (d3 == null) {
+			if (d3 == kNullValue) {
 				entroct(0);
 				entroct(g_c2._val);
 				entroct(2);
@@ -257,7 +267,7 @@ void trait_car() {
 				do {
 					--i;
 					entroct(0);
-					if (d3 == null)
+					if (d3 == kNullValue)
 						entroct(g_c2._val);
 					else
 						entroct(d3);
@@ -478,7 +488,7 @@ void trait_ph() {
 	int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&g_mem[adword + currWord], g_t_cph[i]);
+		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], g_t_cph[i]);
 
 	g_ptr_oct = 0;
 	int currWord = 0;
@@ -495,8 +505,10 @@ void trait_ph() {
 	entroct(ord('#'));
 }
 
-
-
+/**
+ * Start speech
+ * @remarks	Originally called 'parole'
+ */
 void startSpeech(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
@@ -519,13 +531,13 @@ void startSpeech(int rep, int ht, int typ) {
 	cctable(g_tbi);
 	switch (typ) {
 	case 1:
-		charge_bruit();
-		/*if zuul then zzuul(adbruit,0,1095);*/
+		loadNoise();
+		/*if zuul then zzuul(kAdrNoise,0,1095);*/
 		regenbruit();
 		break;
 	case 2:
-		charge_son();
-		charge_phbruit();
+		loadMusicSound();
+		loadPhonemeSounds();
 		break;
 	default:
 		break;
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 0e249b8..7947ee4 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -33,15 +33,40 @@
 
 namespace Mortevielle {
 
+const int kAdrNoise  = 0x5cb0;/*2C00;*/
+const int kAdrNoise1 = 0x6924;
+const int kAdrNoise3 = 0x6ba6;/*3AF6;*/
+const int kAdrNoise5 = 0x3b50;
+const int kAdrTroct  = 0x406b;
+const int kAdrWord   = 0x4000;
+const int kOffsetB1  = 6;
+const int kOffsetB3  = 6;
+
+const float freq0 = 1.19318e6;
+const int kNullValue = 255;
+const int kTempoMusic = 71;
+const int kTempoNoise = 78;
+const int kTempoF = 80;
+const int kTempoM = 89;
+
+
+// Useless constants
+//const int segdon = 0x6c00;
+//const int adbruit2 = 0x6b30;/*3A80;*/
+//const int adson2 = 0x60b0;/*3000;*/
+//const int seg_syst = 0x6fed;
+//const int offsetb2 = 4;
+
+
 extern void spfrac(int wor);
 extern void charg_car(int &currWordNumb);
 extern void entroct(byte o);
 extern void veracf(byte b);
 extern void cctable(tablint &t);
 extern void regenbruit();
-extern void charge_son();
-extern void charge_phbruit();
-extern void charge_bruit();
+extern void loadMusicSound();
+extern void loadPhonemeSounds();
+extern void loadNoise();
 extern void trait_car();
 
 extern void rot_chariot();
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 50c7397..9d81a8e 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -64,38 +64,8 @@ namespace Mortevielle {
 /*-------------------------    CONSTANTS   ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-const float freq0 = 1.19318e6;
-
-const int adani = 0x7314;
-const int adbruit = 0x5cb0;/*2C00;*/
-const int adbruit1 = 0x6924;
-const int adbruit3 = 0x6ba6;/*3AF6;*/
-const int adbruit5 = 0x3b50;
-const int adson = 0x5cb0;/*2C00;*/
-const int adtroct = 0x406b;
-const int adword = 0x4000;
-const int offsetb1 = 6;
-const int offsetb3 = 6;
-
-// Useless constants
-//const int segdon = 0x6c00;
-//const int adbruit2 = 0x6b30;/*3A80;*/
-//const int adson2 = 0x60b0;/*3000;*/
-//const int seg_syst = 0x6fed;
-//const int offsetb2 = 4;
-
-const int null = 255;
-
-const int kTempoMusic = 71;
-const int kTempoNoise = 78;
-const int kTempoF = 80;
-const int kTempoM = 89;
-
-const int kTime1 = 410;
-const int kTime2 = 250;
 const int maxti = 7975;
 const int maxtd = 600;
-const int kMaxRect = 14;
 
 const int kDescriptionStringIndex = 0;                // Unused
 const int kInventoryStringIndex = 186;
@@ -107,15 +77,6 @@ const int kMenuSelfStringIndex = 497;
 const int kMenuSayStringIndex = 502;
 const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
 
-const int arega = 0;
-const int asoul = 154;
-const int aouvr = 282;
-const int achai = 387;
-const int acha = 492;
-const int arcf = 1272;
-const int arep = 1314;
-const int amzon = 1650;
-const int fleche = 1758;
 
 const int OPCODE_NONE = 0;
 enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 


Commit: 305f8fa147c9781aa5c00511b746bd89b967956f
    https://github.com/scummvm/scummvm/commit/305f8fa147c9781aa5c00511b746bd89b967956f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:12-07:00

Commit Message:
MORTEVIELLE: move  couple of functions to menu class, more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/ovd1.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 49496e8..e7e1fdd 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -61,10 +61,10 @@ void MortevielleEngine::fctMove() {
 			return;
 		if (g_num == 1) {
 			g_s._currPlace = OWN_ROOM;
-			tmlieu(0);
+			g_vm->_menu.setDestinationMenuText(OWN_ROOM);
 		} else if (g_num == 7) {
 			g_s._currPlace = ATTIC;
-			tmlieu(13);
+			g_vm->_menu.setDestinationMenuText(ATTIC);
 		} else if (g_num != 6)
 			g_s._currPlace = 26;
 		if ((g_num > 1) && (g_num < 6))
@@ -88,7 +88,7 @@ void MortevielleEngine::fctMove() {
 			t1deva();
 		if (cx == 2)
 			t1neig();
-		tmlieu(g_s._currPlace);
+		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 		return;
 	}
 
@@ -97,7 +97,7 @@ void MortevielleEngine::fctMove() {
 			t1deau();
 		if (cx == 2)
 			t1derr();
-		tmlieu(g_s._currPlace);
+		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 		return;
 	}
 
@@ -170,7 +170,7 @@ void MortevielleEngine::fctMove() {
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
 	debloc(g_s._currPlace);
-	tmlieu(g_s._currPlace);
+	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 }
 
 /**
@@ -201,7 +201,7 @@ void MortevielleEngine::fctTake() {
 					g_s._secretPassageObjectId = 0;
 				if (g_s._currPlace == WELL)
 					g_s._wellObjectId = 0;
-				unsetSearchMenu();
+				g_vm->_menu.unsetSearchMenu();
 				g_vm->_obpart = false;
 				affrep();
 			} else {
@@ -509,7 +509,7 @@ void MortevielleEngine::fctSearch() {
 					g_cs = 0;
 					g_is = 0;
 					g_vm->_heroSearching = true;
-					setSearchMenu();
+					g_vm->_menu.setSearchMenu();
 					tsuiv();
 				} else
 					g_crep = 997;
@@ -708,9 +708,9 @@ void MortevielleEngine::fctPlace() {
 						g_vm->_menu.displayMenu();
 						if (enterPassageFl) {
 							g_s._currPlace = SECRET_PASSAGE;
-							tmlieu(17);
+							g_vm->_menu.setDestinationMenuText(SECRET_PASSAGE);
 						} else {
-							tmlieu(g_s._currPlace);
+							g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 							writepal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -1085,7 +1085,7 @@ void MortevielleEngine::fctEat() {
 		g_s._currPlace = DINING_ROOM;
 		g_caff = 10;
 		debloc(g_s._currPlace);
-		tmlieu(g_s._currPlace);
+		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 
 		int j, h, m;
 		updateHour(j, h, m);
@@ -1121,7 +1121,7 @@ void MortevielleEngine::fctEat() {
 void MortevielleEngine::fctEnter() {
 	if ((g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 		t1sama();
-		tmlieu(g_s._currPlace);
+		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	} else if (g_s._currPlace == LANDING)
 		aldepl();
 	else if (g_ment == 0)
@@ -1165,7 +1165,7 @@ void MortevielleEngine::fctEnter() {
 			g_s._currPlace = g_ment;
 			affrep();
 			debloc(g_s._currPlace);
-			tmlieu(g_s._currPlace);
+			g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 			g_ment = 0;
 			g_mpers = 0;
 			g_ipers = 0;
@@ -1190,7 +1190,7 @@ void MortevielleEngine::fctSleep() {
 		affrep();
 		afdes(0);
 		debloc(g_s._currPlace);
-		tmlieu(g_s._currPlace);
+		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	}
 	clsf3();
 	clearScreenType2();
@@ -1272,7 +1272,7 @@ void MortevielleEngine::fctLeave() {
 		if (g_crep == 0)
 			g_crep = lx;
 		debloc(lx);
-		tmlieu(lx);
+		g_vm->_menu.setDestinationMenuText(lx);
 	}
 }
 
@@ -1518,7 +1518,7 @@ void MortevielleEngine::fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	tmlieu(g_s._currPlace);
+	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	clsf3();
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 6604b1b..a28df25 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -77,6 +77,28 @@ void Menu::setText(int menuId, Common::String name) {
 }
 
 /**
+ * Init destination menu
+ * @remarks	Originally called 'tmlieu'
+ */
+void Menu::setDestinationMenuText(int roomId) {
+	Common::String nomp;
+
+	if (roomId == 26)
+		roomId = LANDING;
+
+	int destinationId = 0;
+	for (; (destinationId < 7) && (g_vm->_v_lieu[destinationId][roomId]); ++destinationId) {
+		nomp = deline(g_vm->_v_lieu[destinationId][roomId] + kMenuPlaceStringIndex);
+		while (nomp.size() < 20)
+			nomp += ' ';
+		setText(_moveMenu[destinationId + 1], nomp);
+	}
+	nomp = "*                   ";
+	for (int i = 7; i >= destinationId + 1; --i)
+		setText(_moveMenu[i], nomp);
+}
+
+/**
  * _disable a menu item
  * @param menuId	Hi byte represents menu number, lo byte reprsents item index
  */
@@ -516,4 +538,32 @@ void Menu::initMenu() {
 	g_vm->setMouseClick(false);
 }
 
+/**
+ * Engine function - Switch action menu to "Search" mode
+ * @remarks	Originally called 'mfoudi'
+ */
+void Menu::setSearchMenu() {
+	for (int i = 1; i <= 7; ++i) 
+		disableMenuItem(_moveMenu[i]);
+
+	for (int i = 1; i <= 11; ++i)
+		disableMenuItem(_actionMenu[i]);
+
+	setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
+	setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
+}
+
+/**
+ * Engine function - Switch action menu from "Search" mode back to normal mode
+ * @remarks	Originally called 'mfouen'
+ */
+void Menu::unsetSearchMenu() {
+	setDestinationMenuText(g_s._currPlace);
+	for (int i = 1; i <= 11; ++i)
+		enableMenuItem(_actionMenu[i]);
+
+	setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
+	setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 5672ef7..adfe359 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -52,6 +52,7 @@ public:
 	int _moveMenu[8];
 
 	void setText(int menuId, Common::String name);
+	void setDestinationMenuText(int roomId);
 	void disableMenuItem(int menuId);
 	void enableMenuItem(int menuId);
 	void displayMenu();
@@ -60,6 +61,9 @@ public:
 	void eraseMenu();
 	void mdn();
 	void initMenu();
+
+	void setSearchMenu();
+	void unsetSearchMenu();
 };
 
 enum {
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a19bb2d..4e56300 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1849,26 +1849,6 @@ void tkey1(bool d) {
 	showMouse();
 }
 
-void tmlieu(int roomId) {
-	Common::String nomp;
-
-	if (roomId == 26)
-		roomId = 15;
-
-	int i = 1;
-	while ((i < 8) && (g_v_lieu[i][roomId] != 0)) {
-		nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
-		while (nomp.size() < 20)
-			nomp += ' ';
-		g_vm->_menu.setText(g_vm->_menu._moveMenu[i], nomp);
-		++i;
-	}
-	nomp = "*                   ";
-	for (int cx = 7; cx >= i; --cx)
-		g_vm->_menu.setText(g_vm->_menu._moveMenu[cx], nomp);
-}
-
-
 /* NIVEAU 7 */
 void tlu(int af, int ob) {
 	g_caff = 32;
@@ -1886,19 +1866,6 @@ void affrep() {
 	g_crep = g_s._currPlace;
 }
 
-/**
- * Engine function - Switch action menu from "Search" mode back to normal mode
- * @remarks	Originally called 'mfouen'
- */
-void unsetSearchMenu() {
-	tmlieu(g_s._currPlace);
-	for (int cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.enableMenuItem(_actionMenu[cx]);
-
-	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
-	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
-}
-
 /* NIVEAU 6 */
 
 void tperd() {
@@ -1906,7 +1873,7 @@ void tperd() {
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	unsetSearchMenu();
+	g_vm->_menu.unsetSearchMenu();
 	if (!g_vm->_blo)
 		t11(21);
 
@@ -2033,22 +2000,7 @@ void endSearch() {
 	g_vm->_obpart = false;
 	g_cs = 0;
 	g_is = 0;
-	unsetSearchMenu();
-}
-
-/**
- * Engine function - Switch action menu to "Search" mode
- * @remarks	Originally called 'mfoudi'
- */
-void setSearchMenu() {
-	for (int cx = 1; cx <= 7; ++cx) 
-		g_vm->_menu.disableMenuItem(g_vm->_menu._moveMenu[cx]);
-
-	for (int cx = 1; cx <= 11; ++cx)
-		g_vm->_menu.disableMenuItem(_actionMenu[cx]);
-
-	g_vm->_menu.setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
-	g_vm->_menu.setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
+	g_vm->_menu.unsetSearchMenu();
 }
 
 void mennor() {
@@ -2189,7 +2141,7 @@ L1:
 		else
 			g_s._faithScore += 3 * (g_s._faithScore / 10);
 		tsort();
-		tmlieu(15);
+		g_vm->_menu.setDestinationMenuText(LANDING);
 		int cx = convertBitIndexToCharacterIndex(g_ipers);
 		g_caff = 69 + cx;
 		g_crep = g_caff;
@@ -2369,7 +2321,7 @@ void treg(int ob) {
 	} else {
 		g_vm->_obpart = true;
 		g_crep = g_caff + 400;
-		setSearchMenu();
+		g_vm->_menu.setSearchMenu();
 	}
 }
 
@@ -2495,7 +2447,7 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, g_crep);
 	clsf3();
 	_endGame = false;
-	tmlieu(g_s._currPlace);
+	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	modinv();
 	if (g_s._selectedObjectId != 0)
 		modobj(g_s._selectedObjectId + 400);
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 5f47a17..269a566 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -142,11 +142,9 @@ extern void fenat(char ans);
 /* NIVEAU 8 */
 extern void afdes(int ad);
 extern void tkey1(bool d);
-extern void tmlieu(int roomId);
 /* NIVEAU 7 */
 extern void tlu(int af, int ob);
 extern void affrep();
-extern void unsetSearchMenu();
 /* NIVEAU 6 */
 extern void tperd();
 extern void tsort();
@@ -156,7 +154,6 @@ extern void st1sama();
 extern void modinv();
 extern void sparl(float adr, float rep);
 extern void endSearch();
-extern void setSearchMenu();
 extern void mennor();
 extern void premtet();
 /* NIVEAU 5 */
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 1ef69a6..b328271 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -181,7 +181,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	init_nbrepm();
 	initMouse();
 
-	init_lieu();
+	loadPlaces();
 	_soundOff = false;
 	_largestClearScreen = false;
 
@@ -677,4 +677,22 @@ void MortevielleEngine::handleAction() {
 	}
 }
 
+/**
+ * Engine function - Init Places
+ * @remarks	Originally called 'init_lieu'
+ */
+void MortevielleEngine::loadPlaces() {
+	Common::File f;
+
+	if (!f.open("MXX.mor"))
+		error("Missing file - MXX.mor");
+
+	for (int i = 0; i < 7; ++i) {
+		for (int j = 0; j < 25; ++j)
+			_v_lieu[i][j] = f.readByte(); 
+	}
+
+	f.close();
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 345db2c..84a739e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -146,6 +146,8 @@ public:
 	int _c_zzz;
 	int ptr_word;
 
+	byte _v_lieu[7][25];
+
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
 	GfxSurface _backgroundSurface;
@@ -215,6 +217,8 @@ public:
 	void fctDiscuss();
 	void fctSmell();
 	void fctScratch();
+
+	void loadPlaces();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 058a880..b81c817 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -41,16 +41,14 @@
 namespace Mortevielle {
 
 void charpal() {
-	Common::File f;		// tabdb records
-	Common::File ft;	// tfxx
-	Common::File fb;	// byte values
+	Common::File f;
 	byte b;
 
-	if (!ft.open("fxx.mor"))
+	if (!f.open("fxx.mor"))
 		error("Missing file - fxx.mor");
 	for (int i = 0; i < 108; ++i)
-		g_l[i] = ft.readSint16LE();
-	ft.close();
+		g_l[i] = f.readSint16LE();
+	f.close();
 
 	if (!f.open("plxx.mor"))
 		error("Missing file - plxx.mor");
@@ -62,29 +60,30 @@ void charpal() {
 	}
 	f.close();
 	
-	if (!fb.open("cxx.mor"))
+	if (!f.open("cxx.mor"))
 		error("Missing file - cxx.mor");
 
 	for (int j = 0; j <= 90; ++j) {
-		g_palcga[j]._p = fb.readByte();
+		g_palcga[j]._p = f.readByte();
 		for (int i = 0; i <= 15; ++i) {
 			nhom &with = g_palcga[j]._a[i];
 
-			b = fb.readByte();
+			b = f.readByte();
 			with._id = (uint)b >> 4;
 			with._hom[0] = ((uint)b >> 2) & 3;
 			with._hom[1] = b & 3;
 		}
 	}
+
 	g_palcga[10]._a[9] = g_palcga[10]._a[5];
 	for (int j = 0; j <= 14; ++j) {
-		g_tpt[j]._tax = fb.readByte();
-		g_tpt[j]._tay = fb.readByte();
+		g_tpt[j]._tax = f.readByte();
+		g_tpt[j]._tay = f.readByte();
 		for (int i = 1; i <= 20; ++i)
 			for (int k = 1; k <= 20; ++k)
-				g_tpt[j]._des[i][k] = fb.readByte();
+				g_tpt[j]._des[i][k] = f.readByte();
 	}
-	fb.close();
+	f.close();
 }
 
 void chartex() {
@@ -138,21 +137,6 @@ void dialpre() {
 	int_m = true;
 }
 
-void init_lieu() {
-	Common::File f;
-
-	if (!f.open("MXX.mor"))
-		error("Missing file - MXX.mor");
-
-	for (int i = 1; i < 8; ++i) {
-		for (int j = 0; j < 25; ++j)
-			g_v_lieu[i][j] = f.readByte(); 
-	}
-
-	f.close();
-}
-
-
 void music() {
 	if (g_vm->_soundOff)
 		return;
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
index ef9f401..90f9c0d 100644
--- a/engines/mortevielle/ovd1.h
+++ b/engines/mortevielle/ovd1.h
@@ -33,7 +33,6 @@ namespace Mortevielle {
 extern void charpal();
 extern void chartex();
 extern void dialpre();
-extern void init_lieu();
 extern void music();
 extern void loadBRUIT5();
 extern void loadCFIEC();
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index dae6e83..2fb933b 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -49,7 +49,7 @@ void spfrac(int wor) {
 
 void charg_car(int &currWordNumb) {
 	int wor = swap(READ_LE_UINT16(&g_mem[kAdrWord + currWordNumb]));
-	int int_ = wor & 0x3f;
+	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {
 		g_c3._val = int_;
@@ -464,43 +464,53 @@ void trait_car() {
 	}     // switch c2.code
 }
 
-void rot_chariot() {
+/**
+ * Make the queue evolve by 1 value
+ * @remarks	Originally called 'rot_chariot'
+ */
+void moveQueue() {
 	g_c1 = g_c2;
 	g_c2 = g_c3;
 	g_c3._val = 32;
 	g_c3._code = 9;
 }
 
-void init_chariot() {
+/**
+ * initialize the queue
+ * @remarks	Originally called 'init_chariot'
+ */
+void initQueue() {
 	g_c3._rep = 0;
 	g_c3._freq = 0;
 	g_c3._acc = 0;
-	rot_chariot();
-	rot_chariot();
+	moveQueue();
+	moveQueue();
 }
 
-
-void trait_ph() {
+/**
+ * Handle a phoneme
+ * @remarks	Originally called 'trait_ph'
+ */
+void handlePhoneme() {
 	const int deca[3] = {300, 30, 40};
 
-	int ptr_tcph = g_num_ph - 1;
-	int startPos = swap(g_t_cph[ptr_tcph]) + deca[g_typlec];
-	int endPos = swap(g_t_cph[ptr_tcph + 1]) + deca[g_typlec];
+	int startPos = swap(g_t_cph[g_phonemeNumb - 1]) + deca[g_typlec];
+	int endPos = swap(g_t_cph[g_phonemeNumb]) + deca[g_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
 		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], g_t_cph[i]);
 
 	g_ptr_oct = 0;
 	int currWord = 0;
-	init_chariot();
+	initQueue();
 
 	do {
-		rot_chariot();
+		moveQueue();
 		charg_car(currWord);
 		trait_car();
 	} while (currWord < wordCount);
 
-	rot_chariot();
+	moveQueue();
 	trait_car();
 	entroct(ord('#'));
 }
@@ -516,7 +526,7 @@ void startSpeech(int rep, int ht, int typ) {
 	if (g_vm->_soundOff)
 		return;
 
-	g_num_ph = rep;
+	g_phonemeNumb = rep;
 	g_haut = ht;
 	g_typlec = typ;
 	if (g_typlec != 0) {
@@ -542,7 +552,7 @@ void startSpeech(int rep, int ht, int typ) {
 	default:
 		break;
 	}
-	trait_ph();
+	handlePhoneme();
 	g_vm->_soundManager.litph(g_tbi, typ, tempo);
 	if (g_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 7947ee4..03caa83 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -49,7 +49,6 @@ const int kTempoNoise = 78;
 const int kTempoF = 80;
 const int kTempoM = 89;
 
-
 // Useless constants
 //const int segdon = 0x6c00;
 //const int adbruit2 = 0x6b30;/*3A80;*/
@@ -69,9 +68,9 @@ extern void loadPhonemeSounds();
 extern void loadNoise();
 extern void trait_car();
 
-extern void rot_chariot();
-extern void init_chariot();
-extern void trait_ph();
+extern void moveQueue();
+extern void initQueue();
+extern void handlePhoneme();
 extern void startSpeech(int rep, int ht, int typ);
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 62f9834..78ff6ef 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -119,7 +119,7 @@ int g_x,
         g_perdep,
         g_prebru,
         g_typlec,
-        g_num_ph,
+        g_phonemeNumb,
         g_numpal,
         g_ptr_oct,
         g_k_tempo;
@@ -142,7 +142,6 @@ byte g_lettres[7][24];
 uint16 g_t_mot[maxti + 1];
 int g_tay_tchar;
 ind g_t_rec[maxtd + 1];
-byte g_v_lieu[8][25];
 int g_l[108];
 int g_tbi[256];
 chariot g_c1, g_c2, g_c3;
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 9d81a8e..26131c7 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -224,13 +224,13 @@ extern int g_x,
         g_yprec,
         g_perdep,
         g_prebru,
-        g_typlec,
-        g_num_ph,
+        g_typlec, // Speech
+        g_phonemeNumb, // Speech
         g_numpal,
         g_ptr_oct,
         g_k_tempo;
 
-extern int g_t_cph[6401];
+extern int g_t_cph[6401]; // Speech
 extern byte g_tabdon[4001];
 
 extern Common::String g_hintPctMessage;      // gives the pct of hints found
@@ -248,7 +248,6 @@ extern byte g_lettres[7][24];
 extern uint16 g_t_mot[maxti + 1];
 extern int g_tay_tchar;
 extern ind g_t_rec[maxtd + 1];
-extern byte g_v_lieu[8][25];
 extern int g_l[108];
 extern int g_tbi[256];
 extern chariot g_c1, g_c2, g_c3;


Commit: 6fdd5355dc1aec97e4a749221c094cbdb7cabbf0
    https://github.com/scummvm/scummvm/commit/6fdd5355dc1aec97e4a749221c094cbdb7cabbf0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:14-07:00

Commit Message:
MORTEVIELLE: Remove extre usage of g_vm

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index b328271..cc3ee98 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -150,7 +150,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
 
 	// Set the screen mode
-	g_vm->_currGraphicalDevice = MODE_EGA;
+	_currGraphicalDevice = MODE_EGA;
 	g_res = 2;
 
 	_txxFileFl = false;
@@ -171,13 +171,13 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	// Setup the mouse cursor
 	initMouse();
 
-	g_vm->_currGraphicalDevice = MODE_EGA;
-	g_vm->_newGraphicalDevice = g_vm->_currGraphicalDevice;
+	_currGraphicalDevice = MODE_EGA;
+	_newGraphicalDevice = _currGraphicalDevice;
 	charpal();
 	loadCFIPH();
 	loadCFIEC();
 	zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-	g_vm->_c_zzz = 1;
+	_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
 
@@ -187,10 +187,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	teskbd();
 	dialpre();
-	g_vm->_newGraphicalDevice = g_vm->_currGraphicalDevice;
+	_newGraphicalDevice = _currGraphicalDevice;
 	teskbd();
-	if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice)
-		g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
+	if (_newGraphicalDevice != _currGraphicalDevice)
+		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
 	g_ades = 0x7000;
 
@@ -294,7 +294,7 @@ bool MortevielleEngine::keyPressed() {
 	if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
 		_lastGameFrame = g_system->getMillis();
 	
-		g_vm->_screenSurface.updateScreen();
+		_screenSurface.updateScreen();
 	}
 
 	// Delay briefly to keep CPU usage down
@@ -466,7 +466,7 @@ void MortevielleEngine::delay(int amount) {
 	while (g_system->getMillis() < endTime) {
 		if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
 			_lastGameFrame = g_system->getMillis();
-			g_vm->_screenSurface.updateScreen();
+			_screenSurface.updateScreen();
 		}
 
 		g_system->delayMillis(10);
@@ -530,7 +530,7 @@ void MortevielleEngine::mainGame() {
 	if (_reloadCFIEC)
 		loadCFIEC();
 
-	for (g_crep = 1; g_crep <= g_vm->_c_zzz; ++g_crep) 
+	for (g_crep = 1; g_crep <= _c_zzz; ++g_crep) 
 		zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
@@ -582,8 +582,8 @@ void MortevielleEngine::handleAction() {
 	oo = false;
 	g_ctrm = 0;
 	if (!_keyPressedEsc) {
-		g_vm->_menu.drawMenu();
-		g_vm->_menu._menuDisplayed = true;
+		_menu.drawMenu();
+		_menu._menuDisplayed = true;
 		temps = 0;
 		g_key = 0;
 		funct = false;
@@ -591,33 +591,33 @@ void MortevielleEngine::handleAction() {
 
 		_inMainGameLoop = true;
 		do {
-			g_vm->_menu.mdn();
+			_menu.mdn();
 			tinke();
 			moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
-		} while (!((g_vm->_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
+		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
 		_inMainGameLoop = false;
 
-		g_vm->_menu.eraseMenu();
-		g_vm->_menu._menuDisplayed = false;
+		_menu.eraseMenu();
+		_menu._menuDisplayed = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_SAVE)) {
+		if (_menu._menuSelected && (g_msg[3] == MENU_SAVE)) {
 			Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7);
-			g_vm->_savegameManager.saveGame(g_msg[4] & 7, saveName);
+			_savegameManager.saveGame(g_msg[4] & 7, saveName);
 		}
-		if (g_vm->_menu._menuSelected && (g_msg[3] == MENU_LOAD))
-			g_vm->_savegameManager.loadGame((g_msg[4] & 7) - 1);
+		if (_menu._menuSelected && (g_msg[3] == MENU_LOAD))
+			_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(g_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
 				g_msg[4] = g_mnumo;
-				ecr3(g_vm->getEngineString(S_IDEM));
+				ecr3(getEngineString(S_IDEM));
 			} else
 				return;
 		} else if (inkey == '\104') {
@@ -641,7 +641,7 @@ void MortevielleEngine::handleAction() {
 			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
 				g_mnumo = g_msg[4];
 			if (!_anyone) {
-				if ((g_vm->_heroSearching) || (_obpart)) {
+				if ((_heroSearching) || (_obpart)) {
 					if (y_s < 12)
 						return;
 
@@ -663,14 +663,14 @@ void MortevielleEngine::handleAction() {
 
 				if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
-					if (g_vm->_okdes) {
-						g_vm->_okdes = false;
+					if (_okdes) {
+						_okdes = false;
 						dessin(0);
 					}
-					if ((!g_vm->_syn) || (_col))
+					if ((!_syn) || (_col))
 						repon(2, g_crep);
 				}
-			} while (g_vm->_syn);
+			} while (_syn);
 			if (g_ctrm != 0)
 				tctrm();
 		}


Commit: 56d571fec4fc687677c374c0788d8275863a5d05
    https://github.com/scummvm/scummvm/commit/56d571fec4fc687677c374c0788d8275863a5d05
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:15-07:00

Commit Message:
MORTEVIELLE: get rid of several magic values, introduce SpeechManager, some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index e7e1fdd..b007966 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -615,7 +615,7 @@ void MortevielleEngine::fctOpen() {
 				  || ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
 				  || (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
-						startSpeech(7, 9, 1);
+						g_vm->_speechManager.startSpeech(7, 9, 1);
 				}
 				g_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
@@ -683,7 +683,7 @@ void MortevielleEngine::fctPlace() {
 					aniof(1, 1);
 					repon(2, 165);
 					maivid();
-					startSpeech(6, -9, 1);
+					g_vm->_speechManager.startSpeech(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
@@ -694,9 +694,9 @@ void MortevielleEngine::fctPlace() {
 						bool enterPassageFl = KnowledgeCheck::show();
 						hideMouse();
 						hirs();
-						dessine_rouleau();
+						drawRightFrame();
 						clearScreenType2();
-						clsf3();
+						clearScreenType3();
 						showMouse();
 						tinke();
 						drawClock();
@@ -784,7 +784,7 @@ void MortevielleEngine::fctTurn() {
 		g_crep = 997;
 		if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
-			startSpeech(7, 9, 1);
+			g_vm->_speechManager.startSpeech(7, 9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1)
 				g_vm->_endGame = true;
@@ -793,8 +793,8 @@ void MortevielleEngine::fctTurn() {
 		}
 		if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
 			repon(2, 175);
-			clsf3();
-			startSpeech(6, -9, 1);
+			clearScreenType3();
+			g_vm->_speechManager.startSpeech(6, -9, 1);
 			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				g_s._currPlace = CRYPT;
@@ -920,7 +920,7 @@ void MortevielleEngine::fctKnock() {
 
 	if (g_s._currPlace == 26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
-		startSpeech(11, rand, 1);
+		g_vm->_speechManager.startSpeech(11, rand, 1);
 		int p;
 		ecfren(p, rand, g_s._faithScore, g_ment);
 		int l = g_ment;
@@ -1138,7 +1138,7 @@ void MortevielleEngine::fctEnter() {
 				g_crep = 179;
 			else {
 				g_x = (getRandomNumber(0, 10)) - 5;
-				startSpeech(7, g_x, 1);
+				g_vm->_speechManager.startSpeech(7, g_x, 1);
 				aniof(1, 1);
 				
 				g_x = convertBitIndexToCharacterIndex(z);
@@ -1159,7 +1159,7 @@ void MortevielleEngine::fctEnter() {
 			}
 		} else {
 			g_x = (getRandomNumber(0, 10)) - 5;
-			startSpeech(7, g_x, 1);
+			_speechManager.startSpeech(7, g_x, 1);
 			aniof(1, 1);
 			
 			g_s._currPlace = g_ment;
@@ -1192,7 +1192,7 @@ void MortevielleEngine::fctSleep() {
 		debloc(g_s._currPlace);
 		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	}
-	clsf3();
+	clearScreenType3();
 	clearScreenType2();
 	ecrf2();
 	ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
@@ -1282,7 +1282,7 @@ void MortevielleEngine::fctLeave() {
  */
 void MortevielleEngine::fctWait() {
 	g_mpers = 0;
-	clsf3();
+	clearScreenType3();
 
 	int answer;
 	do {
@@ -1511,7 +1511,7 @@ void MortevielleEngine::fctDiscuss() {
 	g_ctrm = 0;
 	hideMouse();
 	hirs();
-	dessine_rouleau();
+	drawRightFrame();
 	showMouse();
 	showPeoplePresent(g_ipers);
 	tinke();
@@ -1519,7 +1519,7 @@ void MortevielleEngine::fctDiscuss() {
 	affrep();
 	/* chech;*/
 	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
-	clsf3();
+	clearScreenType3();
 }
 
 /**
@@ -1562,9 +1562,9 @@ void MortevielleEngine::endGame() {
 	_quitGame = true;
 	tlu(13, 152);
 	maivid();
-	clsf1();
+	clearScreenType1();
 	clearScreenType2();
-	clsf3();
+	clearScreenType3();
 	repon(9, 1509);
 	tkey1(false);
 	hideMouse();
@@ -1574,7 +1574,7 @@ void MortevielleEngine::endGame() {
 	premtet();
 	sparl(0, 141);
 	showMouse();
-	clsf1();
+	clearScreenType1();
 	repon(9, 1509);
 	repon(2, 142);
 	tkey1(false);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b5cf831..eabeae2 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -424,7 +424,7 @@ void f3f8::draw() {
 void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
-		startSpeech(SpeechNum, 0, 0);
+		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
 		waitForF3F8(g_key);
 		CHECK_QUIT;
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4e56300..9adf335 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -230,7 +230,11 @@ void dessine(int ad, int x, int y) {
 	showMouse();
 }
 
-void dessine_rouleau() {
+/**
+ * Draw right frame
+ * @remarks	Originally called 'dessine_rouleau'
+ */
+void drawRightFrame() {
 	writepal(89);
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 14] = 15;
@@ -274,10 +278,13 @@ void ecrf1() {
 	g_vm->_screenSurface.drawBox(0, 11, 512, 163, 15);
 }
 
-void clsf1() {
+/**
+ * Engine function - Clear Screen - Type 1
+ * @remarks	Originally called 'clsf1'
+ */
+void clearScreenType1() {
 	hideMouse();
 	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
-
 	showMouse();
 }
 
@@ -298,6 +305,50 @@ void clearScreenType2() {
 	showMouse();
 }
 
+/**
+ * Engine function - Clear Screen - Type 3
+ * @remarks	Originally called 'clsf3'
+ */
+void clearScreenType3() {
+	hideMouse();
+	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
+	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
+	showMouse();
+}
+
+/**
+ * Engine function - Clear Screen - Type 10
+ * @remarks	Originally called 'clsf10'
+ */
+void clearScreenType10() {
+	int co, cod;
+	Common::String st;
+
+	hideMouse();
+	if (g_res == 1) {
+		co = 634;
+		cod = 534;
+	} else {
+		co = 600;
+		cod = 544;
+	}
+	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
+	if (g_s._faithScore < 33)
+		st = g_vm->getEngineString(S_COOL);
+	else if (g_s._faithScore < 66)
+		st = g_vm->getEngineString(S_LOURDE);
+	else if (g_s._faithScore > 65)
+		st = g_vm->getEngineString(S_MALSAINE);
+	
+	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
+	g_vm->_screenSurface.putxy(co, 92);
+	g_vm->_screenSurface.drawString(st, 4);
+
+	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
+	/* rempli(69,12,32,5,255);*/
+	showMouse();
+}
+
 void ecrf2() {
 	setTextColor(5);
 }
@@ -326,15 +377,8 @@ void ecr2(Common::String str_) {
 	}
 }
 
-void clsf3() {
-	hideMouse();
-	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
-	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
-	showMouse();
-}
-
 void ecr3(Common::String text) {
-	clsf3();
+	clearScreenType3();
 	g_vm->_screenSurface.putxy(8, 192);
 	g_vm->_screenSurface.drawString(text, 5);
 }
@@ -348,35 +392,6 @@ void ecrf7() {
 	setTextColor(4);
 }
 
-void clsf10() {
-	int co, cod;
-	Common::String st;
-
-	hideMouse();
-	if (g_res == 1) {
-		co = 634;
-		cod = 534;
-	} else {
-		co = 600;
-		cod = 544;
-	}
-	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (g_s._faithScore < 33)
-		st = g_vm->getEngineString(S_COOL);
-	else if (g_s._faithScore < 66)
-		st = g_vm->getEngineString(S_LOURDE);
-	else if (g_s._faithScore > 65)
-		st = g_vm->getEngineString(S_MALSAINE);
-	
-	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
-	g_vm->_screenSurface.putxy(co, 92);
-	g_vm->_screenSurface.drawString(st, 4);
-
-	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
-	/* rempli(69,12,32,5,255);*/
-	showMouse();
-}
-
 void stop() {
 	hirs();
 	g_vm->_currGraphicalDevice = MODE_AMSTRAD1512;
@@ -504,34 +519,34 @@ void repon(int f, int m) {
 	}
 }
 
-void t5(int cx) {
-	if (cx == 10)
+void t5(int roomId) {
+	if (roomId == DINING_ROOM)
 		g_vm->_blo = false;
 
-	if (cx != 1) {
+	if (roomId != GREEN_ROOM) {
 		g_vm->_roomPresenceLuc = false;
 		g_vm->_roomPresenceIda = false;
 	}
 
-	if (cx != 2)
+	if (roomId != PURPLE_ROOM)
 		g_vm->_purpleRoomPresenceLeo = false;
 
-	if (cx != 4) {
+	if (roomId != DARKBLUE_ROOM) {
 		g_vm->_roomPresenceGuy = false;
 		g_vm->_roomPresenceEva = false;
 	}
 
-	if (cx != 5)
+	if (roomId != BLUE_ROOM)
 		g_vm->_roomPresenceMax = false;
-	if (cx != 6)
+	if (roomId != RED_ROOM)
 		g_vm->_roomPresenceBob = false;
-	if (cx != 8)
+	if (roomId != GREEN_ROOM2)
 		g_vm->_roomPresencePat = false;
-	if (cx != 3)
+	if (roomId != TOILETS)
 		g_vm->_toiletsPresenceBobMax = false;
-	if (cx != 7)
+	if (roomId != BATHROOM)
 		g_vm->_bathRoomPresenceBobMax = false;
-	if (cx != 9)
+	if (roomId != ROOM9)
 		g_vm->_room9PresenceLeo = false;
 }
 
@@ -545,7 +560,7 @@ void showPeoplePresent(int per) {
 
 	for (cx = 1; cx <= 8; ++cx)
 		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cx]);
-	clsf10();
+	clearScreenType10();
 	if ((per & 128) == 128) {
 		g_vm->_screenSurface.putxy(xp, 24);
 		g_vm->_screenSurface.drawString("LEO", 4);
@@ -740,7 +755,7 @@ void displayAloneText() {
 	Common::String sAre = g_vm->getEngineString(S_ARE);
 	Common::String sAlone = g_vm->getEngineString(S_ALONE);
 
-	clsf10();
+	clearScreenType10();
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sYou) / 2), 30);
 	g_vm->_screenSurface.drawString(sYou, 4);
 	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAre) / 2), 50);
@@ -814,12 +829,12 @@ void drawClock() {
  * NIVEAU 11 *
  *************/
 
-void debloc(int l) {
+void debloc(int roomId) {
 	g_num = 0;
 	g_x = 0;
 	g_y = 0;
-	if ((l != 26) && (l != 15))
-		t5(l);
+	if ((roomId != 26) && (roomId != LANDING))
+		t5(roomId);
 	g_mpers = g_ipers;
 }
 
@@ -1145,27 +1160,29 @@ void getKnockAnswer() {
 	}
 }
 
-int nouvp(int l) {
+int nouvp(int roomId) {
 	int bitIndex = 0;
-	if (l == 1) {
+	if (roomId == GREEN_ROOM) {
 		if (g_vm->_roomPresenceLuc)
 			bitIndex = 4;  // LUC
 		if (g_vm->_roomPresenceIda)
 			bitIndex = 2;  // IDA
-	} else if (((l == 2) && (g_vm->_purpleRoomPresenceLeo)) || ((l == 9) && (g_vm->_room9PresenceLeo)))
+	} else if ( ((roomId == PURPLE_ROOM) && (g_vm->_purpleRoomPresenceLeo))
+			 || ((roomId == ROOM9) && (g_vm->_room9PresenceLeo)))
 		bitIndex = 128;    // LEO
-	else if (l == 4) {
+	else if (roomId == DARKBLUE_ROOM) {
 		if (g_vm->_roomPresenceGuy)
 			bitIndex = 32; // GUY
 		if (g_vm->_roomPresenceEva)
 			bitIndex = 16; // EVA
-	} else if ((l == 5) && (g_vm->_roomPresenceMax))
+	} else if ((roomId == BLUE_ROOM) && (g_vm->_roomPresenceMax))
 		bitIndex = 1;      // MAX
-	else if ((l == 6) && (g_vm->_roomPresenceBob))
+	else if ((roomId == RED_ROOM) && (g_vm->_roomPresenceBob))
 		bitIndex = 8;      // BOB
-	else if ((l == 8) && (g_vm->_roomPresencePat))
+	else if ((roomId == GREEN_ROOM2) && (g_vm->_roomPresencePat))
 		bitIndex = 64;     // PAT
-	else if (((l == 3) && (g_vm->_toiletsPresenceBobMax)) || ((l == 7) && (g_vm->_bathRoomPresenceBobMax)))
+	else if ( ((roomId == TOILETS) && (g_vm->_toiletsPresenceBobMax))
+		   || ((roomId == BATHROOM) && (g_vm->_bathRoomPresenceBobMax)) )
 		bitIndex = 9;      // BOB + MAX
 
 	if (bitIndex != 9)
@@ -1202,24 +1219,28 @@ int convertBitIndexToCharacterIndex(int bitIndex) {
 }
 
 
-void ecfren(int &p, int &rand, int cf, int l) {
-	if (l == 0)
+void ecfren(int &p, int &rand, int cf, int roomId) {
+	if (roomId == OWN_ROOM)
 		displayAloneText();
 	p = -500;
 	rand = 0;
-	if (((l == 1) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda)) || ((l == 4) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva)))
+	if ( ((roomId == GREEN_ROOM) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda))
+	  || ((roomId == DARKBLUE_ROOM) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva)) )
 		p = getPresenceStatsGreenRoom();
-	if ((l == 2) && (!g_vm->_purpleRoomPresenceLeo) && (!g_vm->_room9PresenceLeo))
+	if ((roomId == PURPLE_ROOM) && (!g_vm->_purpleRoomPresenceLeo) && (!g_vm->_room9PresenceLeo))
 		p = getPresenceStatsPurpleRoom();
-	if (((l == 3) && (!g_vm->_toiletsPresenceBobMax)) || ((l == 7) && (!g_vm->_bathRoomPresenceBobMax)))
+	if ( ((roomId == TOILETS) && (!g_vm->_toiletsPresenceBobMax))
+	  || ((roomId == BATHROOM) && (!g_vm->_bathRoomPresenceBobMax)) )
 		p = getPresenceStatsToilets();
-	if ((l == 5) && (!g_vm->_roomPresenceMax))
+	if ((roomId == BLUE_ROOM) && (!g_vm->_roomPresenceMax))
 		p = getPresenceStatsBlueRoom();
-	if (((l == 6) && (!g_vm->_roomPresenceBob)) || ((l == 8) && (!g_vm->_roomPresencePat)))
+	if ( ((roomId == RED_ROOM) && (!g_vm->_roomPresenceBob))
+	  || ((roomId == GREEN_ROOM2) && (!g_vm->_roomPresencePat)))
 		p = getPresenceStatsRedRoom();
-	if ((l == 9) && (!g_vm->_room9PresenceLeo) && (!g_vm->_purpleRoomPresenceLeo))
+	if ((roomId == ROOM9) && (!g_vm->_room9PresenceLeo) && (!g_vm->_purpleRoomPresenceLeo))
 		p = 10;
-	if (((l == 2) && (g_vm->_room9PresenceLeo)) || ((l == 9) && (g_vm->_purpleRoomPresenceLeo)))
+	if ( ((roomId == PURPLE_ROOM) && (g_vm->_room9PresenceLeo))
+	  || ((roomId == ROOM9) && (g_vm->_purpleRoomPresenceLeo)))
 		p = -400;
 	if (p != -500) {
 		p += cf;
@@ -1227,33 +1248,33 @@ void ecfren(int &p, int &rand, int cf, int l) {
 	}
 }
 
-void becfren(int l) {
-	if ((l == 1) || (l == 4)) {
+void becfren(int roomId) {
+	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
 		int rand = getRandomNumber(1, 2);
-		if (l == 1) {
+		if (roomId == GREEN_ROOM) {
 			if (rand == 1)
 				g_vm->_roomPresenceLuc = true;
 			else
 				g_vm->_roomPresenceIda = true;
-		} else { // l == 4
+		} else { // roomId == DARKBLUE_ROOM
 			if (rand == 1)
 				g_vm->_roomPresenceGuy = true;
 			else
 				g_vm->_roomPresenceEva = true;
 		}
-	} else if (l == 2)
+	} else if (roomId == PURPLE_ROOM)
 		g_vm->_purpleRoomPresenceLeo = true;
-	else if (l == 3)
+	else if (roomId == TOILETS)
 		g_vm->_toiletsPresenceBobMax = true;
-	else if (l == 5)
+	else if (roomId == BLUE_ROOM)
 		g_vm->_roomPresenceMax = true;
-	else if (l == 6)
+	else if (roomId == RED_ROOM)
 		g_vm->_roomPresenceBob = true;
-	else if (l == 7)
+	else if (roomId == BATHROOM)
 		g_vm->_bathRoomPresenceBobMax = true;
-	else if (l == 8)
+	else if (roomId == GREEN_ROOM2)
 		g_vm->_roomPresencePat = true;
-	else if (l == 9)
+	else if (roomId == ROOM9)
 		g_vm->_room9PresenceLeo = true;
 }
 
@@ -1289,31 +1310,31 @@ void resetVariables() {
 	g_s._faithScore = getRandomNumber(4, 10);
 	g_s._currPlace = MANOR_FRONT;
 
-	for (int cx = 2; cx <= 6; ++cx)
-		g_s._sjer[cx] = chr(0);
+	for (int i = 2; i <= 6; ++i)
+		g_s._sjer[i] = chr(0);
 
 	g_s._sjer[1] = chr(113);
 	g_s._heure = chr(20);
 
-	for (int cx = 1; cx <= 10; ++cx)
-		g_s._pourc[cx] = ' ';
+	for (int i = 1; i <= 10; ++i)
+		g_s._pourc[i] = ' ';
 
-	for (int cx = 1; cx <= 6; ++cx)
-		g_s._teauto[cx] = '*';
+	for (int i = 1; i <= 6; ++i)
+		g_s._teauto[i] = '*';
 
-	for (int cx = 7; cx <= 9; ++cx)
-		g_s._teauto[cx] = ' ';
+	for (int i = 7; i <= 9; ++i)
+		g_s._teauto[i] = ' ';
 
-	for (int cx = 10; cx <= 28; ++cx)
-		g_s._teauto[cx] = '*';
+	for (int i = 10; i <= 28; ++i)
+		g_s._teauto[i] = '*';
 
-	for (int cx = 29; cx <= 42; ++cx)
-		g_s._teauto[cx] = ' ';
+	for (int i = 29; i <= 42; ++i)
+		g_s._teauto[i] = ' ';
 
 	g_s._teauto[33] = '*';
 
-	for (int cx = 1; cx <= 8; ++cx)
-		g_nbrep[cx] = 0;
+	for (int i = 1; i <= 8; ++i)
+		g_nbrep[i] = 0;
 
 	init_nbrepm();
 }
@@ -1460,13 +1481,13 @@ void pl20(int cf) {
 		setPresenceChapel(h);
 }
 
-int t11(int l11) {
+int t11(int roomId) {
 	int retVal = 0;
 	int p, rand;
 
-	ecfren(p, rand, g_s._faithScore, l11);
-	g_li = l11;
-	if ((l11 > 0) && (l11 < 10)) {
+	ecfren(p, rand, g_s._faithScore, roomId);
+	g_li = roomId;
+	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
 			if (rand > p) {
 				displayAloneText();
@@ -1479,22 +1500,22 @@ int t11(int l11) {
 			retVal = nouvp(g_li);
 	}
 
-	if (l11 > 9) {
-		if ((l11 > 15) && (l11 != 20) && (l11 != 26))
+	if (roomId > ROOM9) {
+		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != 26))
 			displayAloneText();
 		else {
 			int h = 0;
-			if (l11 == 10)
+			if (roomId == DINING_ROOM)
 				p = getPresenceStatsDiningRoom(h);
-			else if (l11 == 11)
+			else if (roomId == BUREAU)
 				p = getPresenceStatsBureau(h);
-			else if (l11 == 12)
+			else if (roomId == KITCHEN)
 				p = getPresenceStatsKitchen();
-			else if ((l11 == 13) || (l11 == 14))
+			else if ((roomId == ATTIC) || (roomId == CELLAR))
 				p = getPresenceStatsAttic();
-			else if ((l11 == 15) || (l11 == 26))
+			else if ((roomId == LANDING) || (roomId == 26))
 				p = getPresenceStatsLanding();
-			else if (l11 == 20)
+			else if (roomId == CHAPEL)
 				p = getPresenceStatsChapel(h);
 			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
@@ -1502,15 +1523,15 @@ int t11(int l11) {
 				displayAloneText();
 				retVal = 0;
 			} else {
-				if (l11 == 10)
+				if (roomId == DINING_ROOM)
 					p = setPresenceDiningRoom(h);
-				else if (l11 == 11)
+				else if (roomId == BUREAU)
 					p = setPresenceBureau(h);
-				else if ((l11 == 12) || (l11 == 13) || (l11 == 14))
+				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
 					p = setPresenceKitchen();
-				else if ((l11 == 15) || (l11 == 26))
+				else if ((roomId == LANDING) || (roomId == 26))
 					p = setPresenceLanding();
-				else if (l11 == 20)
+				else if (roomId == CHAPEL)
 					p = setPresenceChapel(h);
 				retVal = p;
 			}
@@ -1524,16 +1545,16 @@ void cavegre() {
 	g_s._faithScore += 2;
 	if (g_s._faithScore > 69)
 		g_s._faithScore += (g_s._faithScore / 10);
-	clsf3();
+	clearScreenType3();
 	ecrf2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
-	startSpeech(2, rand, 1);
+	g_vm->_speechManager.startSpeech(2, rand, 1);
 
 	// The original was doing here a useless loop.
 	// It has been removed
 
-	clsf3();
+	clearScreenType3();
 	displayAloneText();
 }
 
@@ -1572,35 +1593,35 @@ void musique(int so) {
 		/* musik(0) */
 		;
 	} else if ((g_prebru == 0) && (!g_s._ipre)) {
-		startSpeech(10, 1, 1);
+		g_vm->_speechManager.startSpeech(10, 1, 1);
 		++g_prebru;
 	} else {
 		bool i = false;
 		if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
 			if (getRandomNumber(1, 3) == 2) {
-				startSpeech(9, getRandomNumber(2, 4), 1);
+				g_vm->_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == CHAPEL) {
 			if (getRandomNumber(1, 2) == 1) {
-				startSpeech(8, 1, 1);
+				g_vm->_speechManager.startSpeech(8, 1, 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == WELL) {
 			if (getRandomNumber(1, 2) == 2) {
-				startSpeech(12, 1, 1);
+				g_vm->_speechManager.startSpeech(12, 1, 1);
 				i = true;
 			}
 		}
 		else if (g_s._currPlace == 23) {
-			startSpeech(13, 1, 1);
+			g_vm->_speechManager.startSpeech(13, 1, 1);
 			i = true;
 		}
 
 		if (!i)
-			startSpeech(getRandomNumber(1, 17), 1, 2);
+			g_vm->_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
 	}
 }
 
@@ -1609,7 +1630,7 @@ void dessin(int ad) {
 	if (ad != 0)
 		dessine(g_ades, ((ad % 160) * 2), (ad / 160));
 	else {
-		clsf1();
+		clearScreenType1();
 		if (g_caff > 99) {
 			dessine(g_ades, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
@@ -1771,12 +1792,12 @@ void tinke() {
 						g_vm->_brt = true;
 						g_hdb = readclock();
 						if (getRandomNumber(1, 5) < 5) {
-							clsf3();
+							clearScreenType3();
 							ecrf2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
-							startSpeech(1, rand, 1);
-							clsf3();
+							g_vm->_speechManager.startSpeech(1, rand, 1);
+							clearScreenType3();
 						}
 					}
 				}
@@ -1875,14 +1896,14 @@ void tperd() {
 	g_mchai = 0;
 	g_vm->_menu.unsetSearchMenu();
 	if (!g_vm->_blo)
-		t11(21);
+		t11(MANOR_FRONT);
 
 	g_vm->_loseGame = true;
-	clsf1();
+	clearScreenType1();
 	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
 	repon(9, g_crep);
 	clearScreenType2();
-	clsf3();
+	clearScreenType3();
 	g_vm->_col = false;
 	g_vm->_syn = false;
 	g_vm->_okdes = false;
@@ -1983,7 +2004,7 @@ void sparl(float adr, float rep) {
 	
 	key = 0;
 	do {
-		startSpeech(repint, haut[g_caff - 69], 0);
+		g_vm->_speechManager.startSpeech(repint, haut[g_caff - 69], 0);
 		f3f8::waitForF3F8(key);
 		CHECK_QUIT;
 	} while (key != 66);
@@ -2064,14 +2085,14 @@ void t1sama() {    //Entering manor
 		hirs();
 		premtet();
 		sparl(0, 140);
-		dessine_rouleau();
+		drawRightFrame();
 		drawClock();
 		showMouse();
 		g_s._currPlace = OWN_ROOM;
 		affrep();
-		t5(10);
+		t5(DINING_ROOM);
 		if (!g_vm->_blo)
-			minute = t11(0);
+			minute = t11(OWN_ROOM);
 		g_ipers = 0;
 		g_mpers = 0;
 		g_s._ipre = true;
@@ -2130,9 +2151,9 @@ L1:
 			g_crep = 138;
 		repon(2, g_crep);
 		if (g_crep == 138)
-			startSpeech(5, 2, 1);
+			g_vm->_speechManager.startSpeech(5, 2, 1);
 		else
-			startSpeech(4, 4, 1);
+			g_vm->_speechManager.startSpeech(4, 4, 1);
 
 		if (g_iouv == 0)
 			g_s._faithScore += 2;
@@ -2157,7 +2178,7 @@ L1:
 		} else {
 			repon(2, 136);
 			int rand = (getRandomNumber(0, 4)) - 2;
-			startSpeech(3, rand, 1);
+			g_vm->_speechManager.startSpeech(3, rand, 1);
 			clearScreenType2();
 			displayAloneText();
 			debloc(21);
@@ -2386,7 +2407,7 @@ void changeGraphicalDevice(int newDevice) {
 	hirs();
 	initMouse();
 	showMouse();
-	dessine_rouleau();
+	drawRightFrame();
 	tinke();
 	drawClock();
 	if (g_ipers != 0)
@@ -2394,7 +2415,7 @@ void changeGraphicalDevice(int newDevice) {
 	else
 		displayAloneText();
 	clearScreenType2();
-	clsf3();
+	clearScreenType3();
 	g_maff = 68;
 	afdes(0);
 	repon(2, g_crep);
@@ -2445,7 +2466,7 @@ void MortevielleEngine::gameLoaded() {
 	drawClock();
 	afdes(0);
 	repon(2, g_crep);
-	clsf3();
+	clearScreenType3();
 	_endGame = false;
 	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
 	modinv();
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 269a566..d817a3c 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -50,21 +50,21 @@ extern int animof(int ouf, int num);
 extern int readclock();
 extern void modif(int &nu);
 extern void dessine(int ad, int x, int y);
-extern void dessine_rouleau();
+extern void drawRightFrame();
 extern void setTextColor(int c);
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
 extern void initouv();
 extern void ecrf1();
-extern void clsf1();
+extern void clearScreenType1();
 extern void clearScreenType2();
+extern void clearScreenType3();
+extern void clearScreenType10();
 extern void ecrf2();
 extern void ecr2(Common::String str_);
-extern void clsf3();
 extern void ecr3(Common::String text);
 extern void ecrf6();
 extern void ecrf7();
-extern void clsf10();
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
 extern void updateHour(int &day, int &hour, int &minute);
@@ -72,7 +72,7 @@ extern int convertCharacterIndexToBitIndex(int characterIndex);
 /* NIVEAU 12 */
 extern void modobj(int m);
 extern void repon(int f, int m);
-extern void t5(int cx);
+extern void t5(int roomId);
 extern void showPeoplePresent(int per);
 extern int selectCharacters(int min, int max);
 extern int getPresenceStatsGreenRoom();
@@ -86,7 +86,7 @@ extern void drawClock();
 /*************
  * NIVEAU 11 *
  *************/
-extern void debloc(int l);
+extern void debloc(int roomId);
 extern int  getPresenceStatsDiningRoom(int &hour);
 extern int  getPresenceStatsBureau(int &hour);
 extern int  getPresenceStatsKitchen();
@@ -103,10 +103,10 @@ extern int setPresenceKitchen();
 extern int setPresenceLanding();
 extern int setPresenceChapel(int hour);
 extern void getKnockAnswer();
-extern int nouvp(int l);
+extern int nouvp(int roomId);
 extern int convertBitIndexToCharacterIndex(int bitIndex);
-extern void ecfren(int &p, int &rand, int cf, int l);
-extern void becfren(int l);
+extern void ecfren(int &p, int &rand, int cf, int roomId);
+extern void becfren(int roomId);
 /* NIVEAU 10 */
 extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
@@ -123,7 +123,7 @@ extern void pl12(int cf);
 extern void pl13(int cf);
 extern void pl15(int cf);
 extern void pl20(int cf);
-extern int t11(int l11);
+extern int t11(int roomId);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
 extern void aniof(int ouf, int num);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index cc3ee98..3842578 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -539,7 +539,7 @@ void MortevielleEngine::mainGame() {
 	theure();
 	dprog();
 	hirs();
-	dessine_rouleau();
+	drawRightFrame();
 	showMouse();
 
 	// Loop to play the game
@@ -578,7 +578,7 @@ void MortevielleEngine::handleAction() {
 	char inkey = '\0';
 	bool oo, funct = 0;
 
-	clsf3();
+	clearScreenType3();
 	oo = false;
 	g_ctrm = 0;
 	if (!_keyPressedEsc) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 84a739e..6fa354b 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -36,6 +36,7 @@
 #include "mortevielle/menu.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/sound.h"
+#include "mortevielle/speech.h"
 
 namespace Mortevielle {
 
@@ -99,7 +100,6 @@ private:
 	Common::StringArray _engineStrings;
 	Common::StringArray _gameStrings;
 
-
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
 	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
@@ -154,6 +154,7 @@ public:
 	Common::RandomSource _randomSource;
 	SoundManager _soundManager;
 	SavegameManager _savegameManager;
+	SpeechManager _speechManager;
 	Menu _menu;
 
 	bool _quitGame;			// Quit game flag. Originally called 'arret'
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index b81c817..9605adc 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -153,7 +153,7 @@ void music() {
 
 	g_vm->_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
 	g_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
-	cctable(g_tbi);
+	g_vm->_speechManager.cctable(g_tbi);
 
 	bool fin = false;
 	int k = 0;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 2fb933b..49d47fb 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -35,7 +35,7 @@
 
 namespace Mortevielle {
 
-void spfrac(int wor) {
+void SpeechManager::spfrac(int wor) {
 	g_c3._rep = (uint)wor >> 12;
 	if ((g_typlec == 0) && (g_c3._code != 9))
 		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
@@ -47,7 +47,7 @@ void spfrac(int wor) {
 	g_c3._acc = ((uint)wor >> 9) & 7;
 }
 
-void charg_car(int &currWordNumb) {
+void SpeechManager::charg_car(int &currWordNumb) {
 	int wor = swap(READ_LE_UINT16(&g_mem[kAdrWord + currWordNumb]));
 	int int_ = wor & 0x3f; // 63
 
@@ -87,16 +87,16 @@ void charg_car(int &currWordNumb) {
 }
 
 
-void entroct(byte o) {
+void SpeechManager::entroct(byte o) {
 	g_mem[kAdrTroct * 16 + g_ptr_oct] = o;
 	++g_ptr_oct;
 }
 
-void veracf(byte b) {
+void SpeechManager::veracf(byte b) {
 	;
 }
 
-void cctable(tablint &t) {
+void SpeechManager::cctable(tablint &t) {
 	float tb[257];
 
 	tb[0] = 0;
@@ -106,7 +106,7 @@ void cctable(tablint &t) {
 	}
 }
 
-void regenbruit() {
+void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
@@ -120,7 +120,7 @@ void regenbruit() {
  * Load sonmus.mor file
  * @remarks	Originally called 'charge_son'
  */
-void loadMusicSound() {
+void SpeechManager::loadMusicSound() {
 	Common::File f;
 
 	if (!f.open("sonmus.mor"))
@@ -136,7 +136,7 @@ void loadMusicSound() {
  * Load phoneme sound file
  * @remarks	Originally called 'charge_phbruit'
  */
-void loadPhonemeSounds() {
+void SpeechManager::loadPhonemeSounds() {
 	Common::File f;
 
 	if (!f.open("phbrui.mor"))
@@ -152,7 +152,7 @@ void loadPhonemeSounds() {
  * Speech function - Load Noise file
  * @remarks	Originally called 'charge_bruit'
  */
-void loadNoise() {
+void SpeechManager::loadNoise() {
 	Common::File f;
 	int i;
 
@@ -167,7 +167,7 @@ void loadNoise() {
 	f.close();
 }
 
-void trait_car() {
+void SpeechManager::trait_car() {
 	byte d3;
 	int d2, i;
 
@@ -468,7 +468,7 @@ void trait_car() {
  * Make the queue evolve by 1 value
  * @remarks	Originally called 'rot_chariot'
  */
-void moveQueue() {
+void SpeechManager::moveQueue() {
 	g_c1 = g_c2;
 	g_c2 = g_c3;
 	g_c3._val = 32;
@@ -479,7 +479,7 @@ void moveQueue() {
  * initialize the queue
  * @remarks	Originally called 'init_chariot'
  */
-void initQueue() {
+void SpeechManager::initQueue() {
 	g_c3._rep = 0;
 	g_c3._freq = 0;
 	g_c3._acc = 0;
@@ -491,7 +491,7 @@ void initQueue() {
  * Handle a phoneme
  * @remarks	Originally called 'trait_ph'
  */
-void handlePhoneme() {
+void SpeechManager::handlePhoneme() {
 	const int deca[3] = {300, 30, 40};
 
 	int startPos = swap(g_t_cph[g_phonemeNumb - 1]) + deca[g_typlec];
@@ -519,7 +519,7 @@ void handlePhoneme() {
  * Start speech
  * @remarks	Originally called 'parole'
  */
-void startSpeech(int rep, int ht, int typ) {
+void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
 
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 03caa83..3a27abf 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -56,22 +56,24 @@ const int kTempoM = 89;
 //const int seg_syst = 0x6fed;
 //const int offsetb2 = 4;
 
+class SpeechManager {
+public:
+	void spfrac(int wor);
+	void charg_car(int &currWordNumb);
+	void entroct(byte o);
+	void veracf(byte b);
+	void cctable(tablint &t);
+	void regenbruit();
+	void loadMusicSound();
+	void loadPhonemeSounds();
+	void loadNoise();
+	void trait_car();
 
-extern void spfrac(int wor);
-extern void charg_car(int &currWordNumb);
-extern void entroct(byte o);
-extern void veracf(byte b);
-extern void cctable(tablint &t);
-extern void regenbruit();
-extern void loadMusicSound();
-extern void loadPhonemeSounds();
-extern void loadNoise();
-extern void trait_car();
-
-extern void moveQueue();
-extern void initQueue();
-extern void handlePhoneme();
-extern void startSpeech(int rep, int ht, int typ);
+	void moveQueue();
+	void initQueue();
+	void handlePhoneme();
+	void startSpeech(int rep, int ht, int typ);
+};
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 26131c7..8679c3c 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -114,7 +114,7 @@ extern const byte g_rang[16];
 
 enum places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,     DARKBLUE_ROOM = 4,
-	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8, 
+	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8, ROOM9 = 9,
 	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,      CELLAR = 14, 
 	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17,                  MOUNTAIN = 19, 
 	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,                      WELL = 24,
@@ -161,7 +161,7 @@ struct pattern {
 
 
 struct nhom {
-	byte _id;     /* number betwwen 0 and 32 */
+	byte _id;     /* number between 0 and 32 */
 	byte _hom[4];
 };
 


Commit: 5e489f433eebccee45cb099e83be21dd8e7a1802
    https://github.com/scummvm/scummvm/commit/5e489f433eebccee45cb099e83be21dd8e7a1802
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:17-07:00

Commit Message:
MORTEVIELLE: More renaming and moving

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b007966..ebacfa3 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1602,7 +1602,7 @@ void MortevielleEngine::loseGame() {
 	tkey1(false);
 	maivid();
 	resetVariables();
-	dprog();
+	initGame();
 	g_vh = 10;
 	g_vm__ = 0;
 	g_vj = 0;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 9adf335..74d6f71 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -633,7 +633,7 @@ int selectCharacters(int min, int max) {
  * Engine function - Get Presence Statistics - Green Room
  * @remarks	Originally called 'cpl1'
  */
-int getPresenceStatsGreenRoom() {
+int MortevielleEngine::getPresenceStatsGreenRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -664,7 +664,7 @@ int getPresenceStatsGreenRoom() {
  * Engine function - Get Presence Statistics - Purple Room
  * @remarks	Originally called 'cpl2'
  */
-int getPresenceStatsPurpleRoom() {
+int MortevielleEngine::getPresenceStatsPurpleRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -687,7 +687,7 @@ int getPresenceStatsPurpleRoom() {
  * Engine function - Get Presence Statistics - Toilets
  * @remarks	Originally called 'cpl3'
  */
-int getPresenceStatsToilets() {
+int MortevielleEngine::getPresenceStatsToilets() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -704,7 +704,7 @@ int getPresenceStatsToilets() {
  * Engine function - Get Presence Statistics - Blue Room
  * @remarks	Originally called 'cpl5'
  */
-int getPresenceStatsBlueRoom() {
+int MortevielleEngine::getPresenceStatsBlueRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -725,7 +725,7 @@ int getPresenceStatsBlueRoom() {
  * Engine function - Get Presence Statistics - Red Room
  * @remarks	Originally called 'cpl6'
  */
-int getPresenceStatsRedRoom() {
+int MortevielleEngine::getPresenceStatsRedRoom() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -842,7 +842,7 @@ void debloc(int roomId) {
  * Engine function - Get Presence Statistics - Room Bureau
  * @remarks	Originally called 'cpl10'
  */
-int getPresenceStatsDiningRoom(int &hour) {
+int MortevielleEngine::getPresenceStatsDiningRoom(int &hour) {
 	int day, minute;
 
 	int retVal = 0;
@@ -865,7 +865,7 @@ int getPresenceStatsDiningRoom(int &hour) {
  * Engine function - Get Presence Statistics - Room Bureau
  * @remarks	Originally called 'cpl11'
  */
-int getPresenceStatsBureau(int &hour) {
+int MortevielleEngine::getPresenceStatsBureau(int &hour) {
 	int day, minute;
 	int retVal = 0;
 
@@ -888,7 +888,7 @@ int getPresenceStatsBureau(int &hour) {
  * Engine function - Get Presence Statistics - Room Kitchen
  * @remarks	Originally called 'cpl12'
  */
-int getPresenceStatsKitchen() {
+int MortevielleEngine::getPresenceStatsKitchen() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -909,7 +909,7 @@ int getPresenceStatsKitchen() {
  * Engine function - Get Presence Statistics - Room Attic
  * @remarks	Originally called 'cpl13'
  */
-int getPresenceStatsAttic() {
+int MortevielleEngine::getPresenceStatsAttic() {
 	return 0;
 }
 
@@ -917,7 +917,7 @@ int getPresenceStatsAttic() {
  * Engine function - Get Presence Statistics - Room Landing
  * @remarks	Originally called 'cpl15'
  */
-int getPresenceStatsLanding() {
+int MortevielleEngine::getPresenceStatsLanding() {
 	int day, hour, minute;
 	int retVal = 0;
 
@@ -944,7 +944,7 @@ int getPresenceStatsLanding() {
  * Engine function - Get Presence Statistics - Room Chapel
  * @remarks	Originally called 'cpl20'
  */
-int getPresenceStatsChapel(int &hour) {
+int MortevielleEngine::getPresenceStatsChapel(int &hour) {
 	int day, minute;
 	int retVal = 0;
 
@@ -967,18 +967,18 @@ int getPresenceStatsChapel(int &hour) {
  * Engine function - Check who is in the Green Room
  * @remarks	Originally called 'quelq1'
  */
-void setPresenceGreenRoom(int roomId) {
+void MortevielleEngine::setPresenceGreenRoom(int roomId) {
 	int rand = getRandomNumber(1, 2);
 	if (roomId == GREEN_ROOM) {
 		if (rand == 1)
-			g_vm->_roomPresenceLuc = true;
+			_roomPresenceLuc = true;
 		else
-			g_vm->_roomPresenceIda = true;
+			_roomPresenceIda = true;
 	} else if (roomId == DARKBLUE_ROOM) {
 		if (rand == 1)
-			g_vm->_roomPresenceGuy = true;
+			_roomPresenceGuy = true;
 		else
-			g_vm->_roomPresenceEva = true;
+			_roomPresenceEva = true;
 	}
 
 	g_ipers = 10;
@@ -988,11 +988,11 @@ void setPresenceGreenRoom(int roomId) {
  * Engine function - Check who is in the Purple Room
  * @remarks	Originally called 'quelq2'
  */
-void setPresencePurpleRoom() {
-	if (g_li == 2)
-		g_vm->_purpleRoomPresenceLeo = true;
+void MortevielleEngine::setPresencePurpleRoom() {
+	if (_place == PURPLE_ROOM)
+		_purpleRoomPresenceLeo = true;
 	else
-		g_vm->_room9PresenceLeo = true;
+		_room9PresenceLeo = true;
 
 	g_ipers = 10;
 }
@@ -1001,8 +1001,8 @@ void setPresencePurpleRoom() {
  * Engine function - Check who is in the Blue Room
  * @remarks	Originally called 'quelq5'
  */
-void setPresenceBlueRoom() {
-	g_vm->_roomPresenceMax = true;
+void MortevielleEngine::setPresenceBlueRoom() {
+	_roomPresenceMax = true;
 	g_ipers = 10;
 }
 
@@ -1010,11 +1010,11 @@ void setPresenceBlueRoom() {
  * Engine function - Check who is in the Red Room
  * @remarks	Originally called 'quelq6'
  */
-void setPresenceRedRoom(int l) {
-	if (l == 6)
-		g_vm->_roomPresenceBob = true;
-	else if (l == 8)
-		g_vm->_roomPresencePat = true;
+void MortevielleEngine::setPresenceRedRoom(int roomId) {
+	if (roomId == RED_ROOM)
+		_roomPresenceBob = true;
+	else if (roomId == GREEN_ROOM2)
+		_roomPresencePat = true;
 
 	g_ipers = 10;
 }
@@ -1023,7 +1023,7 @@ void setPresenceRedRoom(int l) {
  * Engine function - Check who is in the Dining Room
  * @remarks	Originally called 'quelq10'
  */
-int setPresenceDiningRoom(int hour) {
+int MortevielleEngine::setPresenceDiningRoom(int hour) {
 	int retVal = 0;
 
 	if ((hour >= 0) && (hour < 8))
@@ -1054,7 +1054,7 @@ int setPresenceDiningRoom(int hour) {
  * Engine function - Check who is in the Bureau
  * @remarks	Originally called 'quelq11'
  */
-int setPresenceBureau(int hour) {
+int MortevielleEngine::setPresenceBureau(int hour) {
 	int retVal = 0;
 
 	if ((hour >= 0) && (hour < 8))
@@ -1082,7 +1082,7 @@ int setPresenceBureau(int hour) {
  * Engine function - Check who is in the Kitchen
  * @remarks	Originally called 'quelq12'
  */
-int setPresenceKitchen() {
+int MortevielleEngine::setPresenceKitchen() {
 	int retVal = chlm();
 	showPeoplePresent(retVal);
 
@@ -1093,7 +1093,7 @@ int setPresenceKitchen() {
  * Engine function - Check who is in the Landing
  * @remarks	Originally called 'quelq15'
  */
-int setPresenceLanding() {
+int MortevielleEngine::setPresenceLanding() {
 	bool test = false;
 	int rand = 0;
 	do {
@@ -1118,7 +1118,7 @@ int setPresenceLanding() {
  * Engine function - Check who is in the chapel
  * @remarks	Originally called 'quelq20'
  */
-int setPresenceChapel(int hour) {
+int MortevielleEngine::setPresenceChapel(int hour) {
 	int retVal = 0;
 
 	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
@@ -1226,17 +1226,17 @@ void ecfren(int &p, int &rand, int cf, int roomId) {
 	rand = 0;
 	if ( ((roomId == GREEN_ROOM) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda))
 	  || ((roomId == DARKBLUE_ROOM) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva)) )
-		p = getPresenceStatsGreenRoom();
+		p = g_vm->getPresenceStatsGreenRoom();
 	if ((roomId == PURPLE_ROOM) && (!g_vm->_purpleRoomPresenceLeo) && (!g_vm->_room9PresenceLeo))
-		p = getPresenceStatsPurpleRoom();
+		p = g_vm->getPresenceStatsPurpleRoom();
 	if ( ((roomId == TOILETS) && (!g_vm->_toiletsPresenceBobMax))
 	  || ((roomId == BATHROOM) && (!g_vm->_bathRoomPresenceBobMax)) )
-		p = getPresenceStatsToilets();
+		p = g_vm->getPresenceStatsToilets();
 	if ((roomId == BLUE_ROOM) && (!g_vm->_roomPresenceMax))
-		p = getPresenceStatsBlueRoom();
+		p = g_vm->getPresenceStatsBlueRoom();
 	if ( ((roomId == RED_ROOM) && (!g_vm->_roomPresenceBob))
 	  || ((roomId == GREEN_ROOM2) && (!g_vm->_roomPresencePat)))
-		p = getPresenceStatsRedRoom();
+		p = g_vm->getPresenceStatsRedRoom();
 	if ((roomId == ROOM9) && (!g_vm->_room9PresenceLeo) && (!g_vm->_purpleRoomPresenceLeo))
 		p = 10;
 	if ( ((roomId == PURPLE_ROOM) && (g_vm->_room9PresenceLeo))
@@ -1339,17 +1339,26 @@ void resetVariables() {
 	init_nbrepm();
 }
 
-void dprog() {
-	g_li = 21;
+/**
+ * Engine function - initGame
+ * @remarks	Originally called 'dprog'
+ */
+void MortevielleEngine::initGame() {
+	_place = MANOR_FRONT;
 	g_jh = 0;
 	if (!g_s._ipre)
-		g_vm->_blo = true;
+		_blo = true;
 	g_t = kTime1;
 	g_mh = readclock();
 }
 
-void pl1(int cf) {
-	if (((g_li == 1) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda)) || ((g_li == 4) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva))) {
+/**
+ * Engine function - Set Random Presence - Green Room
+ * @remarks	Originally called 'pl1'
+ */
+void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
+	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
+	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
 		int p = getPresenceStatsGreenRoom();
 		int rand;
 		phaz(rand, p, cf);
@@ -1357,12 +1366,16 @@ void pl1(int cf) {
 		if (rand > p)
 			displayAloneText();
 		else
-			setPresenceGreenRoom(g_li);
+			setPresenceGreenRoom(_place);
 	}
 }
 
-void pl2(int cf) {
-	if (!g_vm->_purpleRoomPresenceLeo) {
+/**
+ * Engine function - Set Random Presence - Purple Room
+ * @remarks	Originally called 'pl2'
+ */
+void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
+	if (!_purpleRoomPresenceLeo) {
 		int p = getPresenceStatsPurpleRoom();
 		int rand;
 		phaz(rand, p, cf);
@@ -1374,7 +1387,11 @@ void pl2(int cf) {
 	}
 }
 
-void pl5(int cf) {
+/**
+ * Engine function - Set Random Presence - Blue Room
+ * @remarks	Originally called 'pl5'
+ */
+void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
 	if (!g_vm->_roomPresenceMax) {
 		int p = getPresenceStatsBlueRoom();
 		int rand;
@@ -1388,8 +1405,13 @@ void pl5(int cf) {
 	}
 }
 
-void pl6(int cf) {
-	if (((g_li == 6) && (!g_vm->_roomPresenceBob)) || ((g_li == 8) && (!g_vm->_roomPresencePat))) {
+/**
+ * Engine function - Set Random Presence - Red Room
+ * @remarks	Originally called 'pl6'
+ */
+void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
+	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
+	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
 		int p = getPresenceStatsRedRoom();
 		int rand;
 
@@ -1398,12 +1420,16 @@ void pl6(int cf) {
 		if (rand > p)
 			displayAloneText();
 		else
-			setPresenceRedRoom(g_li);
+			setPresenceRedRoom(_place);
 	}
 }
 
-void pl9(int cf) {
-	if (!g_vm->_room9PresenceLeo) {
+/**
+ * Engine function - Set Random Presence - Room 9
+ * @remarks	Originally called 'pl9'
+ */
+void MortevielleEngine::setRandomPresenceRoom9(int cf) {
+	if (!_room9PresenceLeo) {
 		cf = -10;
 		int p, rand;
 		phaz(rand, p, cf);
@@ -1415,7 +1441,11 @@ void pl9(int cf) {
 	}
 }
 
-void pl10(int cf) {
+/**
+ * Engine function - Set Random Presence - Dining Room
+ * @remarks	Originally called 'pl10'
+ */
+void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
 	int h, rand;
 	int p = getPresenceStatsDiningRoom(h);
 	phaz(rand, p, cf);
@@ -1426,7 +1456,11 @@ void pl10(int cf) {
 		setPresenceDiningRoom(h);
 }
 
-void pl11(int cf) {
+/**
+ * Engine function - Set Random Presence - Bureau
+ * @remarks	Originally called 'pl11'
+ */
+void MortevielleEngine::setRandomPresenceBureau(int cf) {
 	int h, rand;
 
 	int p = getPresenceStatsBureau(h);
@@ -1437,7 +1471,11 @@ void pl11(int cf) {
 		setPresenceBureau(h);
 }
 
-void pl12(int cf) {
+/**
+ * Engine function - Set Random Presence - Kitchen
+ * @remarks	Originally called 'pl12'
+ */
+void MortevielleEngine::setRandomPresenceKitchen(int cf) {
 	int p, rand;
 
 	p = getPresenceStatsKitchen();
@@ -1448,7 +1486,11 @@ void pl12(int cf) {
 		setPresenceKitchen();
 }
 
-void pl13(int cf) {
+/**
+ * Engine function - Set Random Presence - Attic / Cellar
+ * @remarks	Originally called 'pl13'
+ */
+void MortevielleEngine::setRandomPresenceAttic(int cf) {
 	int p, rand;
 
 	p = getPresenceStatsAttic();
@@ -1459,7 +1501,11 @@ void pl13(int cf) {
 		setPresenceKitchen();
 }
 
-void pl15(int cf) {
+/**
+ * Engine function - Set Random Presence - Landing
+ * @remarks	Originally called 'pl15'
+ */
+void MortevielleEngine::setRandomPresenceLanding(int cf) {
 	int p, rand;
 
 	p = getPresenceStatsLanding();
@@ -1470,7 +1516,11 @@ void pl15(int cf) {
 		setPresenceLanding();
 }
 
-void pl20(int cf) {
+/**
+ * Engine function - Set Random Presence - Chapel
+ * @remarks	Originally called 'pl20'
+ */
+void MortevielleEngine::setRandomPresenceChapel(int cf) {
 	int h, rand;
 
 	int p = getPresenceStatsChapel(h);
@@ -1486,18 +1536,18 @@ int t11(int roomId) {
 	int p, rand;
 
 	ecfren(p, rand, g_s._faithScore, roomId);
-	g_li = roomId;
+	g_vm->_place = roomId;
 	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
 			if (rand > p) {
 				displayAloneText();
 				retVal = 0;
 			} else {
-				becfren(g_li);
-				retVal = nouvp(g_li);
+				becfren(g_vm->_place);
+				retVal = nouvp(g_vm->_place);
 			}
 		} else
-			retVal = nouvp(g_li);
+			retVal = nouvp(g_vm->_place);
 	}
 
 	if (roomId > ROOM9) {
@@ -1506,17 +1556,17 @@ int t11(int roomId) {
 		else {
 			int h = 0;
 			if (roomId == DINING_ROOM)
-				p = getPresenceStatsDiningRoom(h);
+				p = g_vm->getPresenceStatsDiningRoom(h);
 			else if (roomId == BUREAU)
-				p = getPresenceStatsBureau(h);
+				p = g_vm->getPresenceStatsBureau(h);
 			else if (roomId == KITCHEN)
-				p = getPresenceStatsKitchen();
+				p = g_vm->getPresenceStatsKitchen();
 			else if ((roomId == ATTIC) || (roomId == CELLAR))
-				p = getPresenceStatsAttic();
+				p = g_vm->getPresenceStatsAttic();
 			else if ((roomId == LANDING) || (roomId == 26))
-				p = getPresenceStatsLanding();
+				p = g_vm->getPresenceStatsLanding();
 			else if (roomId == CHAPEL)
-				p = getPresenceStatsChapel(h);
+				p = g_vm->getPresenceStatsChapel(h);
 			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
@@ -1524,15 +1574,15 @@ int t11(int roomId) {
 				retVal = 0;
 			} else {
 				if (roomId == DINING_ROOM)
-					p = setPresenceDiningRoom(h);
+					p = g_vm->setPresenceDiningRoom(h);
 				else if (roomId == BUREAU)
-					p = setPresenceBureau(h);
+					p = g_vm->setPresenceBureau(h);
 				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
-					p = setPresenceKitchen();
+					p = g_vm->setPresenceKitchen();
 				else if ((roomId == LANDING) || (roomId == 26))
-					p = setPresenceLanding();
+					p = g_vm->setPresenceLanding();
 				else if (roomId == CHAPEL)
-					p = setPresenceChapel(h);
+					p = g_vm->setPresenceChapel(h);
 				retVal = p;
 			}
 		}
@@ -1602,20 +1652,17 @@ void musique(int so) {
 				g_vm->_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
 				i = true;
 			}
-		}
-		else if (g_s._currPlace == CHAPEL) {
+		} else if (g_s._currPlace == CHAPEL) {
 			if (getRandomNumber(1, 2) == 1) {
 				g_vm->_speechManager.startSpeech(8, 1, 1);
 				i = true;
 			}
-		}
-		else if (g_s._currPlace == WELL) {
+		} else if (g_s._currPlace == WELL) {
 			if (getRandomNumber(1, 2) == 2) {
 				g_vm->_speechManager.startSpeech(12, 1, 1);
 				i = true;
 			}
-		}
-		else if (g_s._currPlace == 23) {
+		} else if (g_s._currPlace == 23) {
 			g_vm->_speechManager.startSpeech(13, 1, 1);
 			i = true;
 		}
@@ -1673,28 +1720,28 @@ void tinke() {
 	const char d4 = ']';
 	const char d5 = '1';
 	Common::String d6 = g_vm->getEngineString(S_OK);
-	int cx, cf, day, hour, minute;
+	int cf, day, hour, minute;
 	Common::String stpo;
 
 	g_vm->_anyone = false;
 	updateHour(day, hour, minute);
 	if (day != g_day) {
 		g_day = day;
-		cx = 0;
+		int i = 0;
 		do {
-			++cx;
-			if (g_nbrepm[cx] != 0)
-				--g_nbrepm[cx];
-			g_nbrep[cx] = 0;
-		} while (cx != 8);
+			++i;
+			if (g_nbrepm[i] != 0)
+				--g_nbrepm[i];
+			g_nbrep[i] = 0;
+		} while (i != 8);
 	}
 	if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
 		g_hour = hour;
 		g_minute = 0;
 		drawClock();
 		cf = 0;
-		for (cx = 1; cx <= 10; ++cx) {
-			if (g_s._pourc[cx] == '*')
+		for (int i = 1; i <= 10; ++i) {
+			if (g_s._pourc[i] == '*')
 				++cf;
 		}
 
@@ -1741,43 +1788,43 @@ void tinke() {
 			g_vm->_menu.eraseMenu();
 			g_jh += ((nh - g_mh) / g_t);
 			g_mh = nh;
-			switch (g_li) {
-			case 1:
-			case 4 :
-				pl1(cf);
+			switch (g_vm->_place) {
+			case GREEN_ROOM:
+			case DARKBLUE_ROOM:
+				g_vm->setRandomPresenceGreenRoom(cf);
 				break;
-			case 2 :
-				pl2(cf);
+			case PURPLE_ROOM:
+				g_vm->setRandomPresencePurpleRoom(cf);
 				break;
-			case 5 :
-				pl5(cf);
+			case BLUE_ROOM:
+				g_vm->setRandomPresenceBlueRoom(cf);
 				break;
-			case 6:
-			case 8 :
-				pl6(cf);
+			case RED_ROOM:
+			case GREEN_ROOM2:
+				g_vm->setRandomPresenceRedRoom(cf);
 				break;
-			case 9 :
-				pl9(cf);
+			case ROOM9:
+				g_vm->setRandomPresenceRoom9(cf);
 				break;
-			case 10 :
-				pl10(cf);
+			case DINING_ROOM:
+				g_vm->setRandomPresenceDiningRoom(cf);
 				break;
-			case 11 :
-				pl11(cf);
+			case BUREAU:
+				g_vm->setRandomPresenceBureau(cf);
 				break;
-			case 12 :
-				pl12(cf);
+			case KITCHEN:
+				g_vm->setRandomPresenceKitchen(cf);
 				break;
-			case 13:
-			case 14 :
-				pl13(cf);
+			case ATTIC:
+			case CELLAR:
+				g_vm->setRandomPresenceAttic(cf);
 				break;
-			case 15:
-			case 26 :
-				pl15(cf);
+			case LANDING:
+			case 26:
+				g_vm->setRandomPresenceLanding(cf);
 				break;
-			case 20 :
-				pl20(cf);
+			case CHAPEL:
+				g_vm->setRandomPresenceChapel(cf);
 				break;
 			}
 			if ((g_mpers != 0) && (g_ipers != 10))
@@ -1809,7 +1856,7 @@ void tinke() {
 	}
 	g_hfb = readclock();
 	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
-		cx = nouvp(g_li);
+		nouvp(g_vm->_place);
 		g_vm->_brt = false;
 		g_hdb = 0;
 		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
@@ -2436,7 +2483,7 @@ void MortevielleEngine::gameLoaded() {
 	_hiddenHero = false;
 	_brt = false;
 	g_maff = 68;
-	g_mnumo = 0;
+	g_mnumo = OPCODE_NONE;
 	g_prebru = 0;
 	g_x = 0;
 	g_y = 0;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index d817a3c..e067534 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -75,11 +75,6 @@ extern void repon(int f, int m);
 extern void t5(int roomId);
 extern void showPeoplePresent(int per);
 extern int selectCharacters(int min, int max);
-extern int getPresenceStatsGreenRoom();
-extern int getPresenceStatsPurpleRoom();
-extern int getPresenceStatsToilets();
-extern int getPresenceStatsBlueRoom();
-extern int getPresenceStatsRedRoom();
 extern void displayAloneText();
 extern int chlm();
 extern void drawClock();
@@ -87,21 +82,6 @@ extern void drawClock();
  * NIVEAU 11 *
  *************/
 extern void debloc(int roomId);
-extern int  getPresenceStatsDiningRoom(int &hour);
-extern int  getPresenceStatsBureau(int &hour);
-extern int  getPresenceStatsKitchen();
-extern int  getPresenceStatsAttic();
-extern int  getPresenceStatsLanding();
-extern int  getPresenceStatsChapel(int &hour);
-extern void setPresenceGreenRoom(int roomId);
-extern void setPresencePurpleRoom();
-extern void setPresenceBlueRoom();
-extern void setPresenceRedRoom(int l);
-extern int setPresenceDiningRoom(int hour);
-extern int setPresenceBureau(int hour);
-extern int setPresenceKitchen();
-extern int setPresenceLanding();
-extern int setPresenceChapel(int hour);
 extern void getKnockAnswer();
 extern int nouvp(int roomId);
 extern int convertBitIndexToCharacterIndex(int bitIndex);
@@ -111,18 +91,6 @@ extern void becfren(int roomId);
 extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
 extern void resetVariables();
-extern void dprog();
-extern void pl1(int cf);
-extern void pl2(int cf);
-extern void pl5(int cf);
-extern void pl6(int cf);
-extern void pl9(int cf);
-extern void pl10(int cf);
-extern void pl11(int cf);
-extern void pl12(int cf);
-extern void pl13(int cf);
-extern void pl15(int cf);
-extern void pl20(int cf);
 extern int t11(int roomId);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3842578..508e90f 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -84,6 +84,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_textColor = 0;
 	_currGraphicalDevice = -1;
 	_newGraphicalDevice = -1;
+	_place = -1;
 
 	_c_zzz = -1;
 
@@ -537,7 +538,7 @@ void MortevielleEngine::mainGame() {
 	_menu.initMenu();
 
 	theure();
-	dprog();
+	initGame();
 	hirs();
 	drawRightFrame();
 	showMouse();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6fa354b..c62af99 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -142,6 +142,7 @@ public:
 	int _textColor;
 	int _currGraphicalDevice;
 	int _newGraphicalDevice;
+	int _place;
 
 	int _c_zzz;
 	int ptr_word;
@@ -219,7 +220,40 @@ public:
 	void fctSmell();
 	void fctScratch();
 
+	int  getPresenceStatsGreenRoom();
+	int  getPresenceStatsPurpleRoom();
+	int  getPresenceStatsToilets();
+	int  getPresenceStatsBlueRoom();
+	int  getPresenceStatsRedRoom();
+	int  getPresenceStatsDiningRoom(int &hour);
+	int  getPresenceStatsBureau(int &hour);
+	int  getPresenceStatsKitchen();
+	int  getPresenceStatsAttic();
+	int  getPresenceStatsLanding();
+	int  getPresenceStatsChapel(int &hour);
+	void setPresenceGreenRoom(int roomId);
+	void setPresencePurpleRoom();
+	void setPresenceBlueRoom();
+	void setPresenceRedRoom(int roomId);
+	int setPresenceDiningRoom(int hour);
+	int setPresenceBureau(int hour);
+	int setPresenceKitchen();
+	int setPresenceLanding();
+	int setPresenceChapel(int hour);
+	void setRandomPresenceGreenRoom(int cf);
+	void setRandomPresencePurpleRoom(int cf);
+	void setRandomPresenceBlueRoom(int cf);
+	void setRandomPresenceRedRoom(int cf);
+	void setRandomPresenceRoom9(int cf);
+	void setRandomPresenceDiningRoom(int cf);
+	void setRandomPresenceBureau(int cf);
+	void setRandomPresenceKitchen(int cf);
+	void setRandomPresenceAttic(int cf);
+	void setRandomPresenceLanding(int cf);
+	void setRandomPresenceChapel(int cf);
+
 	void loadPlaces();
+	void initGame();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index a864322..37b3376 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -123,7 +123,7 @@ Common::Error SavegameManager::loadGame(int n) {
 	
 	/* Initialization */
 	theure();
-	dprog();
+	g_vm->initGame();
 	g_vm->gameLoaded();
 	showMouse();
 	return Common::kNoError;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 49d47fb..bd58905 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -35,9 +35,14 @@
 
 namespace Mortevielle {
 
+SpeechManager::SpeechManager() {
+	_typlec = 0;
+	_phonemeNumb = 0;
+}
+
 void SpeechManager::spfrac(int wor) {
 	g_c3._rep = (uint)wor >> 12;
-	if ((g_typlec == 0) && (g_c3._code != 9))
+	if ((_typlec == 0) && (g_c3._code != 9))
 		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
 				((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
 			++g_c3._rep;
@@ -494,8 +499,8 @@ void SpeechManager::initQueue() {
 void SpeechManager::handlePhoneme() {
 	const int deca[3] = {300, 30, 40};
 
-	int startPos = swap(g_t_cph[g_phonemeNumb - 1]) + deca[g_typlec];
-	int endPos = swap(g_t_cph[g_phonemeNumb]) + deca[g_typlec];
+	int startPos = swap(g_t_cph[_phonemeNumb - 1]) + deca[_typlec];
+	int endPos = swap(g_t_cph[_phonemeNumb]) + deca[_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
 		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], g_t_cph[i]);
@@ -526,10 +531,10 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	if (g_vm->_soundOff)
 		return;
 
-	g_phonemeNumb = rep;
+	_phonemeNumb = rep;
 	g_haut = ht;
-	g_typlec = typ;
-	if (g_typlec != 0) {
+	_typlec = typ;
+	if (_typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
 			savph[i] = g_t_cph[i];
 		tempo = kTempoNoise;
@@ -554,10 +559,10 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	}
 	handlePhoneme();
 	g_vm->_soundManager.litph(g_tbi, typ, tempo);
-	if (g_typlec != 0)
+	if (_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
 			g_t_cph[i] = savph[i];
-			g_mlec = g_typlec;
+			g_mlec = _typlec;
 		}
 	writepal(g_numpal);
 }
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 3a27abf..a0bdf8a 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -57,7 +57,11 @@ const int kTempoM = 89;
 //const int offsetb2 = 4;
 
 class SpeechManager {
+private:
+	int _typlec;
+	int _phonemeNumb;
 public:
+	SpeechManager();
 	void spfrac(int wor);
 	void charg_car(int &currWordNumb);
 	void entroct(byte o);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 78ff6ef..f548ed6 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -82,7 +82,6 @@ int g_x,
         g_y,
         g_t,
         g_vj,
-        g_li,
         g_vh,
         g_vm__,
         g_jh,
@@ -104,7 +103,7 @@ int g_x,
         g_ades,
         g_iouv,
         g_inei,
-        g_ctrm,
+		g_ctrm,
         g_dobj,
         g_msg3,
         g_msg4,
@@ -118,8 +117,6 @@ int g_x,
         g_yprec,
         g_perdep,
         g_prebru,
-        g_typlec,
-        g_phonemeNumb,
         g_numpal,
         g_ptr_oct,
         g_k_tempo;
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 8679c3c..059e9b0 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -188,7 +188,6 @@ extern int g_x,
         g_y,
         g_t,
         g_vj,
-        g_li,
         g_vh,
         g_vm__,
         g_jh,
@@ -210,7 +209,7 @@ extern int g_x,
         g_ades,
         g_iouv,
         g_inei,
-        g_ctrm,
+		g_ctrm,
         g_dobj,
         g_msg3,
         g_msg4,
@@ -224,8 +223,6 @@ extern int g_x,
         g_yprec,
         g_perdep,
         g_prebru,
-        g_typlec, // Speech
-        g_phonemeNumb, // Speech
         g_numpal,
         g_ptr_oct,
         g_k_tempo;


Commit: 2392e5219308b116944aea94b50ea7722122ff97
    https://github.com/scummvm/scummvm/commit/2392e5219308b116944aea94b50ea7722122ff97
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:18-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index ebacfa3..390f7da 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,7 +42,7 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((g_s._currPlace == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s._currPlace == ROOM26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
 		g_s._currPlace = LANDING;
 		g_caff = g_s._currPlace;
 		afdes(0);
@@ -66,7 +66,7 @@ void MortevielleEngine::fctMove() {
 			g_s._currPlace = ATTIC;
 			g_vm->_menu.setDestinationMenuText(ATTIC);
 		} else if (g_num != 6)
-			g_s._currPlace = 26;
+			g_s._currPlace = ROOM26;
 		if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
 		if (g_num > 7)
@@ -92,7 +92,7 @@ void MortevielleEngine::fctMove() {
 		return;
 	}
 
-	if (g_s._currPlace == 23) {
+	if (g_s._currPlace == ROOM23) {
 		if (cx == 1)
 			t1deau();
 		if (cx == 2)
@@ -113,9 +113,9 @@ void MortevielleEngine::fctMove() {
 
 	if ((g_s._currPlace == CELLAR) && (cx == 3))
 		cx = 6;
-	if (((g_s._currPlace == LANDING) || (g_s._currPlace == 26)) && (cx == 4))
+	if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (cx == 4))
 		cx = 6;
-	if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != 26))
+	if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != ROOM26))
 		cx += 10;
 	if ((g_s._currPlace == CHAPEL) && (cx == 13))
 		cx = 16;
@@ -163,7 +163,7 @@ void MortevielleEngine::fctMove() {
 			g_crep = 1505;
 			tperd();
 		} else {
-			g_s._currPlace = 23;
+			g_s._currPlace = ROOM23;
 			affrep();
 		}
 	}
@@ -277,9 +277,9 @@ void MortevielleEngine::fctTake() {
 		  || ((g_s._currPlace == BATHROOM)  && (g_num == 6)) || ((g_s._currPlace == GREEN_ROOM2)  && (g_num == 4))
 		  || ((g_s._currPlace == 9)  && (g_num == 4)) || ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
 		  || ((g_s._currPlace == BUREAU) && (g_num == 7)) || ((g_s._currPlace == KITCHEN) && (g_num == 6))
-		  || ((g_s._currPlace == ATTIC) && (g_num > 4))  || ((g_s._currPlace > ATTIC)  && (g_s._currPlace != 23)) )
+		  || ((g_s._currPlace == ATTIC) && (g_num > 4))  || ((g_s._currPlace > ATTIC)  && (g_s._currPlace != ROOM23)) )
 		  g_crep = 997;
-		else if (g_s._currPlace == 23) {
+		else if (g_s._currPlace == ROOM23) {
 			g_crep = 1504;
 			tperd();
 		} else
@@ -433,7 +433,7 @@ void MortevielleEngine::fctLook() {
 		cx = 17;
 	if ((g_s._currPlace > MANOR_FRONT) && (g_s._currPlace < DOOR))
 		cx -= 4;
-	if (g_s._currPlace == 26)
+	if (g_s._currPlace == ROOM26)
 		cx = 21;
 	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
 	if ((g_s._currPlace == ATTIC) && (g_num == 8))
@@ -484,7 +484,7 @@ void MortevielleEngine::fctSearch() {
 	if (g_vm->_anyone || g_vm->_keyPressedEsc)
 		return;
 
-	if (g_s._currPlace == 23) {
+	if (g_s._currPlace == ROOM23) {
 		g_crep = 1504;
 		tperd();
 		return;
@@ -577,7 +577,7 @@ void MortevielleEngine::fctOpen() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_OPEN));
 
-	if (g_caff == 26) {
+	if (g_caff == ROOM26) {
 		if (g_ment != 0) {
 			g_msg[4] = OPCODE_ENTER;
 			g_vm->_syn = true;
@@ -859,7 +859,7 @@ void MortevielleEngine::fctClose() {
 	if (!g_vm->_syn)
 		ecr3(g_vm->getEngineString(S_CLOSE));
 
-	if (g_caff < 26) {
+	if (g_caff < ROOM26) {
 		tfleche();
 		if (g_vm->_keyPressedEsc)
 			g_crep = 998;
@@ -887,7 +887,7 @@ void MortevielleEngine::fctClose() {
 			}
 		}
 	}
-	if (g_caff == 26)
+	if (g_caff == ROOM26)
 		g_crep = 999;
 }
 
@@ -918,7 +918,7 @@ void MortevielleEngine::fctKnock() {
 		return;
 	}
 
-	if (g_s._currPlace == 26) {
+	if (g_s._currPlace == ROOM26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		g_vm->_speechManager.startSpeech(11, rand, 1);
 		int p;
@@ -1024,7 +1024,7 @@ void MortevielleEngine::fctSelfPut() {
 				}
 			}
 		}
-		if (g_caff == 23)
+		if (g_caff == ROOM23)
 			g_crep = 185;
 		if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
 			if (g_crep == 999)
@@ -1040,7 +1040,7 @@ void MortevielleEngine::fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void MortevielleEngine::fctListen() {
-	if (g_s._currPlace != 26)
+	if (g_s._currPlace != ROOM26)
 		g_crep = 101;
 	else {
 		if (g_ipers != 0)
@@ -1078,7 +1078,7 @@ void MortevielleEngine::fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void MortevielleEngine::fctEat() {
-	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
+	if ((g_s._currPlace > LANDING) && (g_s._currPlace < ROOM26)) {
 		g_crep = 148;
 	} else {
 		tsort();
@@ -1180,7 +1180,7 @@ void MortevielleEngine::fctEnter() {
 void MortevielleEngine::fctSleep() {
 	int z, j, h, m;
 
-	if ((g_s._currPlace > LANDING) && (g_s._currPlace < 26)) {
+	if ((g_s._currPlace > LANDING) && (g_s._currPlace < ROOM26)) {
 		g_crep = 148;
 		return;
 	}
@@ -1231,7 +1231,7 @@ void MortevielleEngine::fctForce() {
 		tfleche();
 
 	if ((!g_vm->_anyone) && (!g_vm->_keyPressedEsc)) {
-		if (g_s._currPlace != 26)
+		if (g_s._currPlace != ROOM26)
 			g_crep = 997;
 		else {
 			g_crep = 143;
@@ -1252,7 +1252,7 @@ void MortevielleEngine::fctLeave() {
 	else {
 		int lx = 0;
 
-		if ((g_s._currPlace < CRYPT) || (g_s._currPlace == 26))
+		if ((g_s._currPlace < CRYPT) || (g_s._currPlace == ROOM26))
 			lx = 10;
 		if ((g_s._currPlace == DINING_ROOM) || (g_s._currPlace == CHAPEL))
 			lx = 21;
@@ -1264,7 +1264,7 @@ void MortevielleEngine::fctLeave() {
 		}
 		if (g_s._currPlace == SECRET_PASSAGE)
 			t23coul(lx);
-		if (g_s._currPlace == 23)
+		if (g_s._currPlace == ROOM23)
 			lx = 24;
 		if (g_crep != 997)
 			g_s._currPlace = lx;
@@ -1418,7 +1418,7 @@ void MortevielleEngine::fctDiscuss() {
 			} else {
 				int ix = cy;
 				if (cx == 41)
-					ix = ix + 23;
+					ix += 23;
 				if (ix != choi) {
 					if (choi != 0) {
 						lig = ((choi - 1) % 23) << 3;
@@ -1528,7 +1528,7 @@ void MortevielleEngine::fctDiscuss() {
  */
 void MortevielleEngine::fctSmell() {
 	g_crep = 119;
-	if (g_caff < 26) {
+	if (g_caff < ROOM26) {
 		if (!g_vm->_syn)
 			ecr3(g_vm->getEngineString(S_SMELL));
 		tfleche();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 74d6f71..4b6a7b3 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -519,92 +519,100 @@ void repon(int f, int m) {
 	}
 }
 
-void t5(int roomId) {
+/**
+ * Engine function - Reset presence in other rooms
+ * @remarks	Originally called 't5'
+ */
+void MortevielleEngine::resetPresenceInRooms(int roomId) {
 	if (roomId == DINING_ROOM)
-		g_vm->_blo = false;
+		_blo = false;
 
 	if (roomId != GREEN_ROOM) {
-		g_vm->_roomPresenceLuc = false;
-		g_vm->_roomPresenceIda = false;
+		_roomPresenceLuc = false;
+		_roomPresenceIda = false;
 	}
 
 	if (roomId != PURPLE_ROOM)
-		g_vm->_purpleRoomPresenceLeo = false;
+		_purpleRoomPresenceLeo = false;
 
 	if (roomId != DARKBLUE_ROOM) {
-		g_vm->_roomPresenceGuy = false;
-		g_vm->_roomPresenceEva = false;
+		_roomPresenceGuy = false;
+		_roomPresenceEva = false;
 	}
 
 	if (roomId != BLUE_ROOM)
-		g_vm->_roomPresenceMax = false;
+		_roomPresenceMax = false;
 	if (roomId != RED_ROOM)
-		g_vm->_roomPresenceBob = false;
+		_roomPresenceBob = false;
 	if (roomId != GREEN_ROOM2)
-		g_vm->_roomPresencePat = false;
+		_roomPresencePat = false;
 	if (roomId != TOILETS)
-		g_vm->_toiletsPresenceBobMax = false;
+		_toiletsPresenceBobMax = false;
 	if (roomId != BATHROOM)
-		g_vm->_bathRoomPresenceBobMax = false;
+		_bathRoomPresenceBobMax = false;
 	if (roomId != ROOM9)
-		g_vm->_room9PresenceLeo = false;
+		_room9PresenceLeo = false;
 }
 
 /**
  * Engine function - Show the people present in the given room 
  * @remarks	Originally called 'affper'
  */
-void showPeoplePresent(int per) {
-	int cx;
-	int xp = 580 - (g_vm->_screenSurface.getStringWidth("LEO") / 2);
+void MortevielleEngine::showPeoplePresent(int per) {
+	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
+
+	for (int i = 1; i <= 8; ++i)
+		_menu.disableMenuItem(_menu._discussMenu[i]);
 
-	for (cx = 1; cx <= 8; ++cx)
-		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cx]);
 	clearScreenType10();
 	if ((per & 128) == 128) {
-		g_vm->_screenSurface.putxy(xp, 24);
-		g_vm->_screenSurface.drawString("LEO", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[1]);
+		_screenSurface.putxy(xp, 24);
+		_screenSurface.drawString("LEO", 4);
+		_menu.enableMenuItem(_menu._discussMenu[1]);
 	}
 	if ((per & 64) == 64) {
-		g_vm->_screenSurface.putxy(xp, 32);
-		g_vm->_screenSurface.drawString("PAT", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[2]);
+		_screenSurface.putxy(xp, 32);
+		_screenSurface.drawString("PAT", 4);
+		_menu.enableMenuItem(_menu._discussMenu[2]);
 	}
 	if ((per & 32) == 32) {
-		g_vm->_screenSurface.putxy(xp, 40);
-		g_vm->_screenSurface.drawString("GUY", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[3]);
+		_screenSurface.putxy(xp, 40);
+		_screenSurface.drawString("GUY", 4);
+		_menu.enableMenuItem(_menu._discussMenu[3]);
 	}
 	if ((per & 16) == 16) {
-		g_vm->_screenSurface.putxy(xp, 48);
-		g_vm->_screenSurface.drawString("EVA", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[4]);
+		_screenSurface.putxy(xp, 48);
+		_screenSurface.drawString("EVA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[4]);
 	}
 	if ((per & 8) == 8) {
-		g_vm->_screenSurface.putxy(xp, 56);
-		g_vm->_screenSurface.drawString("BOB", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[5]);
+		_screenSurface.putxy(xp, 56);
+		_screenSurface.drawString("BOB", 4);
+		_menu.enableMenuItem(_menu._discussMenu[5]);
 	}
 	if ((per & 4) == 4) {
-		g_vm->_screenSurface.putxy(xp, 64);
-		g_vm->_screenSurface.drawString("LUC", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[6]);
+		_screenSurface.putxy(xp, 64);
+		_screenSurface.drawString("LUC", 4);
+		_menu.enableMenuItem(_menu._discussMenu[6]);
 	}
 	if ((per & 2) == 2) {
-		g_vm->_screenSurface.putxy(xp, 72);
-		g_vm->_screenSurface.drawString("IDA", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[7]);
+		_screenSurface.putxy(xp, 72);
+		_screenSurface.drawString("IDA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[7]);
 	}
 	if ((per & 1) == 1) {
-		g_vm->_screenSurface.putxy(xp, 80);
-		g_vm->_screenSurface.drawString("MAX", 4);
-		g_vm->_menu.enableMenuItem(g_vm->_menu._discussMenu[8]);
+		_screenSurface.putxy(xp, 80);
+		_screenSurface.drawString("MAX", 4);
+		_menu.enableMenuItem(_menu._discussMenu[8]);
 	}
 	g_ipers = per;
 }
 
-int selectCharacters(int min, int max) {
+/**
+ * Engine function - Select random characters
+ * @remarks	Originally called 'choix'
+ */
+int MortevielleEngine::selectCharacters(int min, int max) {
 	bool invertSelection = false;
 	int rand = getRandomNumber(min, max);
 
@@ -613,13 +621,13 @@ int selectCharacters(int min, int max) {
 		invertSelection = true;
 	}
 
-	int cx = 0;
+	int i = 0;
 	int retVal = 0;
-	while (cx < rand) {
+	while (i < rand) {
 		int charIndex = getRandomNumber(1, 8);
 		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
 		if ((retVal & charBitIndex) != charBitIndex) {
-			++cx;
+			++i;
 			retVal |= charBitIndex;
 		}
 	}
@@ -656,7 +664,7 @@ int MortevielleEngine::getPresenceStatsGreenRoom() {
 	else if ((hour >= 0) && (hour < 8))
 		retVal = 70;
 
-	g_vm->_menu.mdn();
+	_menu.mdn();
 
 	return retVal;
 }
@@ -747,21 +755,21 @@ int MortevielleEngine::getPresenceStatsRedRoom() {
  * on the right hand side of the screen
  * @remarks	Originally called 'person'
  */
-void displayAloneText() {
+void MortevielleEngine::displayAloneText() {
 	for (int cf = 1; cf <= 8; ++cf)
-		g_vm->_menu.disableMenuItem(g_vm->_menu._discussMenu[cf]);
+		_menu.disableMenuItem(_menu._discussMenu[cf]);
 
-	Common::String sYou = g_vm->getEngineString(S_YOU);
-	Common::String sAre = g_vm->getEngineString(S_ARE);
-	Common::String sAlone = g_vm->getEngineString(S_ALONE);
+	Common::String sYou = getEngineString(S_YOU);
+	Common::String sAre = getEngineString(S_ARE);
+	Common::String sAlone = getEngineString(S_ALONE);
 
 	clearScreenType10();
-	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sYou) / 2), 30);
-	g_vm->_screenSurface.drawString(sYou, 4);
-	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAre) / 2), 50);
-	g_vm->_screenSurface.drawString(sAre, 4);
-	g_vm->_screenSurface.putxy(580 - (g_vm->_screenSurface.getStringWidth(sAlone) / 2), 70);
-	g_vm->_screenSurface.drawString(sAlone, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
+	_screenSurface.drawString(sYou, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
+	_screenSurface.drawString(sAre, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
+	_screenSurface.drawString(sAlone, 4);
 
 	g_ipers = 0;
 }
@@ -833,8 +841,8 @@ void debloc(int roomId) {
 	g_num = 0;
 	g_x = 0;
 	g_y = 0;
-	if ((roomId != 26) && (roomId != LANDING))
-		t5(roomId);
+	if ((roomId != ROOM26) && (roomId != LANDING))
+		g_vm->resetPresenceInRooms(roomId);
 	g_mpers = g_ipers;
 }
 
@@ -1160,29 +1168,33 @@ void getKnockAnswer() {
 	}
 }
 
-int nouvp(int roomId) {
+/**
+ * Engine function - Get Room Presence Bit Index
+ * @remarks	Originally called 'nouvp'
+ */
+int MortevielleEngine::getPresenceBitIndex(int roomId) {
 	int bitIndex = 0;
 	if (roomId == GREEN_ROOM) {
-		if (g_vm->_roomPresenceLuc)
+		if (_roomPresenceLuc)
 			bitIndex = 4;  // LUC
-		if (g_vm->_roomPresenceIda)
+		if (_roomPresenceIda)
 			bitIndex = 2;  // IDA
-	} else if ( ((roomId == PURPLE_ROOM) && (g_vm->_purpleRoomPresenceLeo))
-			 || ((roomId == ROOM9) && (g_vm->_room9PresenceLeo)))
+	} else if ( ((roomId == PURPLE_ROOM) && (_purpleRoomPresenceLeo))
+			 || ((roomId == ROOM9) && (_room9PresenceLeo)))
 		bitIndex = 128;    // LEO
 	else if (roomId == DARKBLUE_ROOM) {
-		if (g_vm->_roomPresenceGuy)
+		if (_roomPresenceGuy)
 			bitIndex = 32; // GUY
-		if (g_vm->_roomPresenceEva)
+		if (_roomPresenceEva)
 			bitIndex = 16; // EVA
-	} else if ((roomId == BLUE_ROOM) && (g_vm->_roomPresenceMax))
+	} else if ((roomId == BLUE_ROOM) && (_roomPresenceMax))
 		bitIndex = 1;      // MAX
-	else if ((roomId == RED_ROOM) && (g_vm->_roomPresenceBob))
+	else if ((roomId == RED_ROOM) && (_roomPresenceBob))
 		bitIndex = 8;      // BOB
-	else if ((roomId == GREEN_ROOM2) && (g_vm->_roomPresencePat))
+	else if ((roomId == GREEN_ROOM2) && (_roomPresencePat))
 		bitIndex = 64;     // PAT
-	else if ( ((roomId == TOILETS) && (g_vm->_toiletsPresenceBobMax))
-		   || ((roomId == BATHROOM) && (g_vm->_bathRoomPresenceBobMax)) )
+	else if ( ((roomId == TOILETS) && (_toiletsPresenceBobMax))
+		   || ((roomId == BATHROOM) && (_bathRoomPresenceBobMax)) )
 		bitIndex = 9;      // BOB + MAX
 
 	if (bitIndex != 9)
@@ -1221,7 +1233,7 @@ int convertBitIndexToCharacterIndex(int bitIndex) {
 
 void ecfren(int &p, int &rand, int cf, int roomId) {
 	if (roomId == OWN_ROOM)
-		displayAloneText();
+		g_vm->displayAloneText();
 	p = -500;
 	rand = 0;
 	if ( ((roomId == GREEN_ROOM) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda))
@@ -1540,19 +1552,19 @@ int t11(int roomId) {
 	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
 			if (rand > p) {
-				displayAloneText();
+				g_vm->displayAloneText();
 				retVal = 0;
 			} else {
 				becfren(g_vm->_place);
-				retVal = nouvp(g_vm->_place);
+				retVal = g_vm->getPresenceBitIndex(g_vm->_place);
 			}
 		} else
-			retVal = nouvp(g_vm->_place);
+			retVal = g_vm->getPresenceBitIndex(g_vm->_place);
 	}
 
 	if (roomId > ROOM9) {
-		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != 26))
-			displayAloneText();
+		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != ROOM26))
+			g_vm->displayAloneText();
 		else {
 			int h = 0;
 			if (roomId == DINING_ROOM)
@@ -1563,14 +1575,14 @@ int t11(int roomId) {
 				p = g_vm->getPresenceStatsKitchen();
 			else if ((roomId == ATTIC) || (roomId == CELLAR))
 				p = g_vm->getPresenceStatsAttic();
-			else if ((roomId == LANDING) || (roomId == 26))
+			else if ((roomId == LANDING) || (roomId == ROOM26))
 				p = g_vm->getPresenceStatsLanding();
 			else if (roomId == CHAPEL)
 				p = g_vm->getPresenceStatsChapel(h);
 			p += g_s._faithScore;
 			rand = getRandomNumber(1, 100);
 			if (rand > p) {
-				displayAloneText();
+				g_vm->displayAloneText();
 				retVal = 0;
 			} else {
 				if (roomId == DINING_ROOM)
@@ -1579,7 +1591,7 @@ int t11(int roomId) {
 					p = g_vm->setPresenceBureau(h);
 				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
 					p = g_vm->setPresenceKitchen();
-				else if ((roomId == LANDING) || (roomId == 26))
+				else if ((roomId == LANDING) || (roomId == ROOM26))
 					p = g_vm->setPresenceLanding();
 				else if (roomId == CHAPEL)
 					p = g_vm->setPresenceChapel(h);
@@ -1605,7 +1617,7 @@ void cavegre() {
 	// It has been removed
 
 	clearScreenType3();
-	displayAloneText();
+	g_vm->displayAloneText();
 }
 
 void writetp(Common::String s, int t) {
@@ -1662,7 +1674,7 @@ void musique(int so) {
 				g_vm->_speechManager.startSpeech(12, 1, 1);
 				i = true;
 			}
-		} else if (g_s._currPlace == 23) {
+		} else if (g_s._currPlace == ROOM23) {
 			g_vm->_speechManager.startSpeech(13, 1, 1);
 			i = true;
 		}
@@ -1707,7 +1719,7 @@ void dessin(int ad) {
 					aniof(1, 1);
 			}
 			
-			if (g_caff < 26)
+			if (g_caff < ROOM26)
 				musique(1);
 		}
 	}
@@ -1820,7 +1832,7 @@ void tinke() {
 				g_vm->setRandomPresenceAttic(cf);
 				break;
 			case LANDING:
-			case 26:
+			case ROOM26:
 				g_vm->setRandomPresenceLanding(cf);
 				break;
 			case CHAPEL:
@@ -1856,7 +1868,7 @@ void tinke() {
 	}
 	g_hfb = readclock();
 	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
-		nouvp(g_vm->_place);
+		g_vm->getPresenceBitIndex(g_vm->_place);
 		g_vm->_brt = false;
 		g_hdb = 0;
 		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
@@ -2111,7 +2123,7 @@ void t1sama() {    //Entering manor
 	int day, hour, minute;
 
 	updateHour(day, hour, minute);
-	if ((hour < 5) && (g_s._currPlace > 18)) {
+	if ((hour < 5) && (g_s._currPlace > ROOM18)) {
 		bool d;
 		cherjer(137, d);
 		if (!d) {        //You don't have the keys, and it's late
@@ -2121,7 +2133,7 @@ void t1sama() {    //Entering manor
 			st1sama();
 	} else if (!g_s._ipre) {     //Is it your first time?
 		g_ipers = 255;
-		showPeoplePresent(g_ipers);
+		g_vm->showPeoplePresent(g_ipers);
 		g_caff = 77;
 		afdes(0);
 		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
@@ -2137,7 +2149,7 @@ void t1sama() {    //Entering manor
 		showMouse();
 		g_s._currPlace = OWN_ROOM;
 		affrep();
-		t5(DINING_ROOM);
+		g_vm->resetPresenceInRooms(DINING_ROOM);
 		if (!g_vm->_blo)
 			minute = t11(OWN_ROOM);
 		g_ipers = 0;
@@ -2227,7 +2239,7 @@ L1:
 			int rand = (getRandomNumber(0, 4)) - 2;
 			g_vm->_speechManager.startSpeech(3, rand, 1);
 			clearScreenType2();
-			displayAloneText();
+			g_vm->displayAloneText();
 			debloc(21);
 			affrep();
 		}
@@ -2458,9 +2470,9 @@ void changeGraphicalDevice(int newDevice) {
 	tinke();
 	drawClock();
 	if (g_ipers != 0)
-		showPeoplePresent(g_ipers);
+		g_vm->showPeoplePresent(g_ipers);
 	else
-		displayAloneText();
+		g_vm->displayAloneText();
 	clearScreenType2();
 	clearScreenType3();
 	g_maff = 68;
@@ -2626,7 +2638,7 @@ void MortevielleEngine::handleOpcode() {
 	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
 	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
 		++g_s._faithScore;
-	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
+	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != ROOM23)
 	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
 		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index e067534..bc416e0 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -72,10 +72,6 @@ extern int convertCharacterIndexToBitIndex(int characterIndex);
 /* NIVEAU 12 */
 extern void modobj(int m);
 extern void repon(int f, int m);
-extern void t5(int roomId);
-extern void showPeoplePresent(int per);
-extern int selectCharacters(int min, int max);
-extern void displayAloneText();
 extern int chlm();
 extern void drawClock();
 /*************
@@ -83,7 +79,6 @@ extern void drawClock();
  *************/
 extern void debloc(int roomId);
 extern void getKnockAnswer();
-extern int nouvp(int roomId);
 extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int roomId);
 extern void becfren(int roomId);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c62af99..e3a8986 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -231,6 +231,7 @@ public:
 	int  getPresenceStatsAttic();
 	int  getPresenceStatsLanding();
 	int  getPresenceStatsChapel(int &hour);
+	int  getPresenceBitIndex(int roomId);
 	void setPresenceGreenRoom(int roomId);
 	void setPresencePurpleRoom();
 	void setPresenceBlueRoom();
@@ -254,6 +255,10 @@ public:
 
 	void loadPlaces();
 	void initGame();
+	void resetPresenceInRooms(int roomId);
+	void showPeoplePresent(int per);
+	int selectCharacters(int min, int max);
+	void displayAloneText();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 0d3216d..3e770b8 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -454,7 +454,7 @@ void taffich() {
 	showMouse();
 	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
-			displayAloneText();
+			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
 			cx = t11(g_s._currPlace);
 		g_mpers =  0;
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 059e9b0..150710e 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -116,9 +116,9 @@ enum places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,     DARKBLUE_ROOM = 4,
 	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8, ROOM9 = 9,
 	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,      CELLAR = 14, 
-	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17,                  MOUNTAIN = 19, 
-	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,                      WELL = 24,
-	DOOR = 25
+	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,     MOUNTAIN = 19, 
+	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     ROOM23 = 23,     WELL = 24,
+	DOOR = 25,        ROOM26 = 26
 };
 
 struct sav_chaine {


Commit: a47323aec2a466c290d0771738229a5cd2d843e0
    https://github.com/scummvm/scummvm/commit/a47323aec2a466c290d0771738229a5cd2d843e0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:20-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 390f7da..8b4e5a7 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,35 +42,40 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((g_s._currPlace == ROOM26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
+	if ((g_s._currPlace == ROOM26) && (g_msg[4] == _menu._moveMenu[6])) {
 		g_s._currPlace = LANDING;
 		g_caff = g_s._currPlace;
 		afdes(0);
 		repon(2, g_s._currPlace);
 	}
-	if ((g_s._currPlace == LANDING) && (g_msg[4] == g_vm->_menu._moveMenu[6])) {
-		if (!g_vm->_syn)
-			ecr3(g_vm->getEngineString(S_GO_TO));
+	if ((g_s._currPlace == LANDING) && (g_msg[4] == _menu._moveMenu[6])) {
+		if (!_syn)
+			ecr3(getEngineString(S_GO_TO));
 		tfleche();
-		if (g_vm->_keyPressedEsc)
-			g_vm->_okdes = false;
-		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+
+		if (_keyPressedEsc)
+			_okdes = false;
+
+		if ((_anyone) || (_keyPressedEsc))
 			return;
 		tcoord(1);
+
 		if (g_num == 0)
 			return;
+
 		if (g_num == 1) {
 			g_s._currPlace = OWN_ROOM;
-			g_vm->_menu.setDestinationMenuText(OWN_ROOM);
+			_menu.setDestinationMenuText(OWN_ROOM);
 		} else if (g_num == 7) {
 			g_s._currPlace = ATTIC;
-			g_vm->_menu.setDestinationMenuText(ATTIC);
+			_menu.setDestinationMenuText(ATTIC);
 		} else if (g_num != 6)
 			g_s._currPlace = ROOM26;
-		if ((g_num > 1) && (g_num < 6))
+		else if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
-		if (g_num > 7)
+		else if (g_num > 7)
 			g_ment = g_num - 3;
+
 		if (g_num != 6)
 			affrep();
 		else
@@ -78,17 +83,17 @@ void MortevielleEngine::fctMove() {
 		return;
 	}
 	tsort();
-	int cx = 0;
-	do {
+	int cx = 1;
+
+	while (_menu._moveMenu[cx] != g_msg[4])
 		++cx;
-	} while (g_vm->_menu._moveMenu[cx] != g_msg[4]);
 
 	if (g_s._currPlace == MOUNTAIN) {
 		if (cx == 1)
-			t1deva();
+			gotoManorFront();
 		if (cx == 2)
-			t1neig();
-		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+			checkManorDistance();
+		_menu.setDestinationMenuText(g_s._currPlace);
 		return;
 	}
 
@@ -96,18 +101,17 @@ void MortevielleEngine::fctMove() {
 		if (cx == 1)
 			t1deau();
 		if (cx == 2)
-			t1derr();
-		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+			gotoManorBack();
+		_menu.setDestinationMenuText(g_s._currPlace);
 		return;
 	}
 
 	if ((g_s._currPlace == BUREAU) && (cx == 1))
 		cx = 6;
-
-	if (g_s._currPlace == KITCHEN) {
+	else if (g_s._currPlace == KITCHEN) {
 		if (cx == 2)
 			cx = 6;
-		if (cx == 5)
+		else if (cx == 5)
 			cx = 16;
 	}
 
@@ -127,9 +131,9 @@ void MortevielleEngine::fctMove() {
 	}
 	if ((g_s._currPlace == MANOR_BACK) && (cx > 14))
 		cx = 15;
-	if ((g_s._currPlace == WELL) && (cx != 17))
-		if (cx > 13)
-			cx = 15;
+	else if ((g_s._currPlace == WELL) && (cx > 13) && (cx != 17))
+		cx = 15;
+
 	if (cx == 1)
 		g_s._currPlace = BUREAU;
 	else if (cx == 2)
@@ -140,20 +144,21 @@ void MortevielleEngine::fctMove() {
 		g_s._currPlace = LANDING;
 	else if (cx == 5)
 		cx = 12;
-	if (cx == 6)
+	else if (cx == 6)
 		cx = 11;
+
 	if (cx == 11)
-		t1sama();
+		gotoDiningRoom();
 	else if (cx == 12)
-		t1deva();
+		gotoManorFront();
 	else if (cx == 13)
 		g_s._currPlace = CHAPEL;
 	else if (cx == 14)
 		g_s._currPlace = WELL;
 	else if (cx == 15)
-		t1neig();
+		checkManorDistance();
 	else if (cx == 16)
-		t1derr();
+		gotoManorBack();
 	else if (cx == 17) {
 		if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140))
 			g_crep = 997;
@@ -161,7 +166,7 @@ void MortevielleEngine::fctMove() {
 			g_crep = 181;
 		else if (g_s._faithScore > 80) {
 			g_crep = 1505;
-			tperd();
+			loseGame();
 		} else {
 			g_s._currPlace = ROOM23;
 			affrep();
@@ -170,7 +175,7 @@ void MortevielleEngine::fctMove() {
 	if ((cx < 5) || (cx == 13) || (cx == 14))
 		affrep();
 	debloc(g_s._currPlace);
-	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+	_menu.setDestinationMenuText(g_s._currPlace);
 }
 
 /**
@@ -184,7 +189,7 @@ void MortevielleEngine::fctTake() {
 		if (g_crep != 139) {
 			if (g_ipers > 0)
 				g_s._faithScore += 3;
-			if (g_vm->_obpart) {
+			if (_obpart) {
 				if (g_s._currPlace == PURPLE_ROOM)
 					g_s._purpleRoomObjectId = 0;
 				if (g_s._currPlace == ATTIC) {
@@ -201,8 +206,8 @@ void MortevielleEngine::fctTake() {
 					g_s._secretPassageObjectId = 0;
 				if (g_s._currPlace == WELL)
 					g_s._wellObjectId = 0;
-				g_vm->_menu.unsetSearchMenu();
-				g_vm->_obpart = false;
+				_menu.unsetSearchMenu();
+				_obpart = false;
 				affrep();
 			} else {
 				g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
@@ -216,10 +221,10 @@ void MortevielleEngine::fctTake() {
 		}
 		return;
 	}
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_TAKE));
+	if (!_syn)
+		ecr3(getEngineString(S_TAKE));
 	tfleche();
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 	if (g_caff == 3) {
 		tcoord(2);
@@ -281,7 +286,7 @@ void MortevielleEngine::fctTake() {
 		  g_crep = 997;
 		else if (g_s._currPlace == ROOM23) {
 			g_crep = 1504;
-			tperd();
+			loseGame();
 		} else
 			g_crep = 120;
 	}
@@ -296,7 +301,7 @@ void MortevielleEngine::fctInventoryTake() {
 	cx = 0;
 	do {
 		++cx;
-	} while (g_vm->_menu._inventoryMenu[cx] != g_msg[4]);
+	} while (_menu._inventoryMenu[cx] != g_msg[4]);
 	cz = 0;
 	cy = 0;
 	do {
@@ -317,10 +322,10 @@ void MortevielleEngine::fctInventoryTake() {
  * @remarks	Originally called 'tsoulever'
  */
 void MortevielleEngine::fctLift() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_LIFT));
+	if (!_syn)
+		ecr3(getEngineString(S_LIFT));
 	tfleche();
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(3);
 	if (g_num == 0) {
@@ -354,10 +359,10 @@ void MortevielleEngine::fctRead() {
 	if (g_caff > 99)
 		st4(g_caff);
 	else {
-		if (!g_vm->_syn)
-			ecr3(g_vm->getEngineString(S_READ));
+		if (!_syn)
+			ecr3(getEngineString(S_READ));
 		tfleche();
-		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(_anyone) && !(_keyPressedEsc)) {
 			tcoord(4);
 			if (g_num != 0)
 				g_crep = 107;
@@ -387,10 +392,10 @@ void MortevielleEngine::fctLook() {
 		g_crep = 103;
 		return;
 	}
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_LOOK));
+	if (!_syn)
+		ecr3(getEngineString(S_LOOK));
 	tfleche();
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(5);
 	if (g_num == 0) {
@@ -477,16 +482,16 @@ void MortevielleEngine::fctSearch() {
 		return;
 	}
 
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_SEARCH));
+	if (!_syn)
+		ecr3(getEngineString(S_SEARCH));
 
 	tfleche();
-	if (g_vm->_anyone || g_vm->_keyPressedEsc)
+	if (_anyone || _keyPressedEsc)
 		return;
 
 	if (g_s._currPlace == ROOM23) {
 		g_crep = 1504;
-		tperd();
+		loseGame();
 		return;
 	}
 
@@ -508,8 +513,8 @@ void MortevielleEngine::fctSearch() {
 				if (g_mchai != 0) {
 					g_cs = 0;
 					g_is = 0;
-					g_vm->_heroSearching = true;
-					g_vm->_menu.setSearchMenu();
+					_heroSearching = true;
+					_menu.setSearchMenu();
 					tsuiv();
 				} else
 					g_crep = 997;
@@ -574,13 +579,13 @@ void MortevielleEngine::fctSelfSearch() {
  * @remarks	Originally called 'touvrir'
  */
 void MortevielleEngine::fctOpen() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_OPEN));
+	if (!_syn)
+		ecr3(getEngineString(S_OPEN));
 
 	if (g_caff == ROOM26) {
 		if (g_ment != 0) {
 			g_msg[4] = OPCODE_ENTER;
-			g_vm->_syn = true;
+			_syn = true;
 		} else
 			g_crep = 997;
 		return;
@@ -592,7 +597,7 @@ void MortevielleEngine::fctOpen() {
 	}
 
 	tfleche();
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 
 	tcoord(7);
@@ -615,7 +620,7 @@ void MortevielleEngine::fctOpen() {
 				  || ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
 				  || (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
-						g_vm->_speechManager.startSpeech(7, 9, 1);
+						_speechManager.startSpeech(7, 9, 1);
 				}
 				g_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
@@ -641,14 +646,14 @@ void MortevielleEngine::fctPlace() {
 		return;
 	}
 
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_PUT));
+	if (!_syn)
+		ecr3(getEngineString(S_PUT));
 
 	tfleche();
-	if (g_vm->_keyPressedEsc)
+	if (_keyPressedEsc)
 		g_crep = 998;
 
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 
 	tcoord(8);
@@ -683,10 +688,10 @@ void MortevielleEngine::fctPlace() {
 					aniof(1, 1);
 					repon(2, 165);
 					maivid();
-					g_vm->_speechManager.startSpeech(6, -9, 1);
+					_speechManager.startSpeech(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
-					int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+					int answer = Alert::show(getEngineString(S_YES_NO), 1);
 					if (answer == 1) {
 						Common::String alertTxt = deline(582);
 						Alert::show(alertTxt, 1);
@@ -705,12 +710,12 @@ void MortevielleEngine::fctPlace() {
 						else 
 							displayAloneText();
 
-						g_vm->_menu.displayMenu();
+						_menu.displayMenu();
 						if (enterPassageFl) {
 							g_s._currPlace = SECRET_PASSAGE;
-							g_vm->_menu.setDestinationMenuText(SECRET_PASSAGE);
+							_menu.setDestinationMenuText(SECRET_PASSAGE);
 						} else {
-							g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+							_menu.setDestinationMenuText(g_s._currPlace);
 							writepal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -745,7 +750,7 @@ void MortevielleEngine::fctPlace() {
 				aniof(1, 1);
 			} else {
 				g_crep = 1512;
-				tperd();
+				loseGame();
 			}
 		}
 
@@ -774,28 +779,28 @@ void MortevielleEngine::fctTurn() {
 		g_crep = 149;
 		return;
 	}
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_TURN));
+	if (!_syn)
+		ecr3(getEngineString(S_TURN));
 	tfleche();
-	if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(9);
 	if (g_num != 0) {
 		g_crep = 997;
 		if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
-			g_vm->_speechManager.startSpeech(7, 9, 1);
-			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+			_speechManager.startSpeech(7, 9, 1);
+			int answer = Alert::show(getEngineString(S_YES_NO), 1);
 			if (answer == 1)
-				g_vm->_endGame = true;
+				_endGame = true;
 			else
 				g_crep = 168;
 		}
 		if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
 			repon(2, 175);
 			clearScreenType3();
-			g_vm->_speechManager.startSpeech(6, -9, 1);
-			int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+			_speechManager.startSpeech(6, -9, 1);
+			int answer = Alert::show(getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				g_s._currPlace = CRYPT;
 				affrep();
@@ -810,15 +815,15 @@ void MortevielleEngine::fctTurn() {
  * @remarks	Originally called 'tcacher'
  */
 void MortevielleEngine::fctSelfHide() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_HIDE_SELF));
+	if (!_syn)
+		ecr3(getEngineString(S_HIDE_SELF));
 	tfleche();
-	if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
+	if (!(_anyone) && !(_keyPressedEsc)) {
 		tcoord(10);
 		if (g_num == 0)
-			g_vm->_hiddenHero = false;
+			_hiddenHero = false;
 		else {
-			g_vm->_hiddenHero = true;
+			_hiddenHero = true;
 			g_crep = 999;
 		}
 	}
@@ -832,10 +837,10 @@ void MortevielleEngine::fctAttach() {
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
-		if (!g_vm->_syn)
-			ecr3(g_vm->getEngineString(S_TIE));
+		if (!_syn)
+			ecr3(getEngineString(S_TIE));
 		tfleche();
-		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(_anyone) && !(_keyPressedEsc)) {
 			tcoord(8);
 			g_crep = 997;
 			if ((g_num != 0) && (g_s._currPlace == WELL)) {
@@ -856,14 +861,14 @@ void MortevielleEngine::fctAttach() {
  * @remarks	Originally called 'tfermer'
  */
 void MortevielleEngine::fctClose() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_CLOSE));
+	if (!_syn)
+		ecr3(getEngineString(S_CLOSE));
 
 	if (g_caff < ROOM26) {
 		tfleche();
-		if (g_vm->_keyPressedEsc)
+		if (_keyPressedEsc)
 			g_crep = 998;
-		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+		if ((_anyone) || (_keyPressedEsc))
 			return;
 		tcoord(7);
 		if (g_num != 0) {
@@ -896,19 +901,17 @@ void MortevielleEngine::fctClose() {
  * @remarks	Originally called 'tfrapper'
  */
 void MortevielleEngine::fctKnock() {
-	warning("Knock - _currPlace %d", g_s._currPlace);
-
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_HIT));
+	if (!_syn)
+		ecr3(getEngineString(S_HIT));
 
 	if (g_s._currPlace == LANDING) {
-		Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1);
+		Alert::show(getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
 	if (g_s._currPlace < DOOR) {
 		tfleche();
-		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc)) {
+		if (!(_anyone) && !(_keyPressedEsc)) {
 			if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING))
 				g_crep = 133;
 			else
@@ -920,7 +923,7 @@ void MortevielleEngine::fctKnock() {
 
 	if (g_s._currPlace == ROOM26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
-		g_vm->_speechManager.startSpeech(11, rand, 1);
+		_speechManager.startSpeech(11, rand, 1);
 		int p;
 		ecfren(p, rand, g_s._faithScore, g_ment);
 		int l = g_ment;
@@ -946,8 +949,8 @@ void MortevielleEngine::fctKnock() {
  * @remarks	Originally called 'tposer'
  */
 void MortevielleEngine::fctSelfPut() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_POSE));
+	if (!_syn)
+		ecr3(getEngineString(S_POSE));
 	if (g_s._selectedObjectId == 0)
 		g_crep = 186;
 	else {
@@ -959,7 +962,7 @@ void MortevielleEngine::fctSelfPut() {
 			return;
 		}
 		tfleche();
-		if ((g_vm->_anyone) || (g_vm->_keyPressedEsc))
+		if ((_anyone) || (_keyPressedEsc))
 			return;
 		tcoord(7);
 		g_crep = 124;
@@ -1085,7 +1088,7 @@ void MortevielleEngine::fctEat() {
 		g_s._currPlace = DINING_ROOM;
 		g_caff = 10;
 		debloc(g_s._currPlace);
-		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+		_menu.setDestinationMenuText(g_s._currPlace);
 
 		int j, h, m;
 		updateHour(j, h, m);
@@ -1120,8 +1123,8 @@ void MortevielleEngine::fctEat() {
  */
 void MortevielleEngine::fctEnter() {
 	if ((g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
-		t1sama();
-		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+		gotoDiningRoom();
+		_menu.setDestinationMenuText(g_s._currPlace);
 	} else if (g_s._currPlace == LANDING)
 		aldepl();
 	else if (g_ment == 0)
@@ -1131,29 +1134,29 @@ void MortevielleEngine::fctEnter() {
 			g_s._teauto[8] = '*';
 	} else {
 		int z = 0;
-		if (!g_vm->_blo)
+		if (!_blo)
 			z = t11(g_ment);
 		if (z != 0) {
 			if ((g_ment == 3) || (g_ment == 7))
 				g_crep = 179;
 			else {
 				g_x = (getRandomNumber(0, 10)) - 5;
-				g_vm->_speechManager.startSpeech(7, g_x, 1);
+				_speechManager.startSpeech(7, g_x, 1);
 				aniof(1, 1);
 				
 				g_x = convertBitIndexToCharacterIndex(z);
 				++g_s._faithScore;
 				g_s._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
-				g_msg[4] = g_vm->_menu._discussMenu[g_x];
-				g_vm->_syn = true;
+				g_msg[4] = _menu._discussMenu[g_x];
+				_syn = true;
 				if (g_ment == 9) {
-					g_vm->_col = true;
+					_col = true;
 					g_caff = 70;
 					afdes(0);
 					repon(2, g_caff);
 				} else
-					g_vm->_col = false;
+					_col = false;
 				debloc(g_ment);
 				g_ment = 0;
 			}
@@ -1165,7 +1168,7 @@ void MortevielleEngine::fctEnter() {
 			g_s._currPlace = g_ment;
 			affrep();
 			debloc(g_s._currPlace);
-			g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+			_menu.setDestinationMenuText(g_s._currPlace);
 			g_ment = 0;
 			g_mpers = 0;
 			g_ipers = 0;
@@ -1190,12 +1193,12 @@ void MortevielleEngine::fctSleep() {
 		affrep();
 		afdes(0);
 		debloc(g_s._currPlace);
-		g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+		_menu.setDestinationMenuText(g_s._currPlace);
 	}
 	clearScreenType3();
 	clearScreenType2();
 	ecrf2();
-	ecr2(g_vm->getEngineString(S_WANT_TO_WAKE_UP));
+	ecr2(getEngineString(S_WANT_TO_WAKE_UP));
 	updateHour(j, h, m);
 
 	int answer;
@@ -1213,8 +1216,8 @@ void MortevielleEngine::fctSleep() {
 		if (h > 23)
 			h = 0;
 		tinke();
-		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
-		g_vm->_anyone = false;
+		answer = Alert::show(getEngineString(S_YES_NO), 1);
+		_anyone = false;
 	} while (answer != 1);
 	g_crep = 998;
 	g_num = 0;
@@ -1225,12 +1228,12 @@ void MortevielleEngine::fctSleep() {
  * @remarks	Originally called 'tdefoncer'
  */
 void MortevielleEngine::fctForce() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_SMASH));
+	if (!_syn)
+		ecr3(getEngineString(S_SMASH));
 	if (g_caff < 25)
 		tfleche();
 
-	if ((!g_vm->_anyone) && (!g_vm->_keyPressedEsc)) {
+	if ((!_anyone) && (!_keyPressedEsc)) {
 		if (g_s._currPlace != ROOM26)
 			g_crep = 997;
 		else {
@@ -1250,29 +1253,30 @@ void MortevielleEngine::fctLeave() {
 	if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK) || (g_s._currPlace == WELL))
 		g_crep = 997;
 	else {
-		int lx = 0;
+		int nextPlace = OWN_ROOM;
 
 		if ((g_s._currPlace < CRYPT) || (g_s._currPlace == ROOM26))
-			lx = 10;
-		if ((g_s._currPlace == DINING_ROOM) || (g_s._currPlace == CHAPEL))
-			lx = 21;
-		if ((g_s._currPlace < DINING_ROOM) || (g_s._currPlace == ATTIC))
-			lx = 15;
-		if (g_s._currPlace == CRYPT) {
-			lx = 17;
+			nextPlace = DINING_ROOM;
+		else if ((g_s._currPlace == DINING_ROOM) || (g_s._currPlace == CHAPEL))
+			nextPlace = MANOR_FRONT;
+		else if ((g_s._currPlace < DINING_ROOM) || (g_s._currPlace == ATTIC))
+			nextPlace = LANDING;
+		else if (g_s._currPlace == CRYPT) {
+			nextPlace = SECRET_PASSAGE;
 			g_crep = 176;
-		}
-		if (g_s._currPlace == SECRET_PASSAGE)
-			t23coul(lx);
-		if (g_s._currPlace == ROOM23)
-			lx = 24;
+		} else if (g_s._currPlace == SECRET_PASSAGE)
+			nextPlace = t23coul();
+		else if (g_s._currPlace == ROOM23)
+			nextPlace = WELL;
+
 		if (g_crep != 997)
-			g_s._currPlace = lx;
-		g_caff = lx;
+			g_s._currPlace = nextPlace;
+
+		g_caff = nextPlace;
 		if (g_crep == 0)
-			g_crep = lx;
-		debloc(lx);
-		g_vm->_menu.setDestinationMenuText(lx);
+			g_crep = nextPlace;
+		debloc(nextPlace);
+		_menu.setDestinationMenuText(nextPlace);
 	}
 }
 
@@ -1288,24 +1292,24 @@ void MortevielleEngine::fctWait() {
 	do {
 		++g_jh;
 		tinke();
-		if (!g_vm->_blo)
+		if (!_blo)
 			t11(g_s._currPlace);
 		if ((g_ipers != 0) && (g_mpers == 0)) {
 			g_crep = 998;
 			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
 				cavegre();
 			if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
-				g_vm->_anyone = true;
+				_anyone = true;
 			g_mpers = g_ipers;
-			if (!g_vm->_anyone)
+			if (!_anyone)
 				tinke();
 			return;
 		}
 		repon(2, 102);
-		answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+		answer = Alert::show(getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
 	g_crep = 998;
-	if (!g_vm->_anyone)
+	if (!_anyone)
 		tinke();
 }
 
@@ -1314,11 +1318,11 @@ void MortevielleEngine::fctWait() {
  * @remarks	Originally called 'tsonder'
  */
 void MortevielleEngine::fctSound() {
-	if (!g_vm->_syn)
-		ecr3(g_vm->getEngineString(S_PROBE2));
+	if (!_syn)
+		ecr3(getEngineString(S_PROBE2));
 	if (g_caff < 27) {
 		tfleche();
-		if (!(g_vm->_anyone) && (!g_vm->_keyPressedEsc))
+		if (!(_anyone) && (!_keyPressedEsc))
 			g_crep = 145;
 		g_num = 0;
 	}
@@ -1336,13 +1340,13 @@ void MortevielleEngine::fctDiscuss() {
 	bool f;
 
 	endSearch();
-	if (g_vm->_col)
+	if (_col)
 		suj = 128;
 	else {
 		cx = 0;
 		do {
 			++cx;
-		} while (g_vm->_menu._discussMenu[cx] != g_msg[4]);
+		} while (_menu._discussMenu[cx] != g_msg[4]);
 		g_caff = 69 + cx;
 		afdes(0);
 		repon(2, g_caff);
@@ -1372,7 +1376,7 @@ void MortevielleEngine::fctDiscuss() {
 		lig = 0;
 		do {
 			++icm;
-			g_vm->_screenSurface.putxy(co, lig);
+			_screenSurface.putxy(co, lig);
 			if (g_s._teauto[icm] == '*') {
 				if (te[icm])
 					writetp(lib[icm], 1);
@@ -1386,7 +1390,7 @@ void MortevielleEngine::fctDiscuss() {
 			} else
 				lig = lig + 8;
 		} while (icm != 42);
-		g_vm->_screenSurface.putxy(320, 176);
+		_screenSurface.putxy(320, 176);
 		writetp(lib[46], 0);
 		tou = '\0';
 		do {
@@ -1407,7 +1411,7 @@ void MortevielleEngine::fctDiscuss() {
 						co = 320;
 					else
 						co = 0;
-					g_vm->_screenSurface.putxy(co, lig);
+					_screenSurface.putxy(co, lig);
 					if (te[choi])
 						writetp(lib[choi], 0);
 					else
@@ -1426,7 +1430,7 @@ void MortevielleEngine::fctDiscuss() {
 							co = 320;
 						else
 							co = 0;
-						g_vm->_screenSurface.putxy(co, lig);
+						_screenSurface.putxy(co, lig);
 						if (te[choi])
 							writetp(lib[choi], 0);
 						else
@@ -1439,7 +1443,7 @@ void MortevielleEngine::fctDiscuss() {
 							co = 320;
 						else
 							co = 0;
-						g_vm->_screenSurface.putxy(co, lig);
+						_screenSurface.putxy(co, lig);
 						if (te[ix])
 							writetp(lib[ix], 0);
 						else
@@ -1450,12 +1454,12 @@ void MortevielleEngine::fctDiscuss() {
 						choi = 0;
 				}
 			}
-		} while (!((tou == '\15') || (((c != 0) || g_vm->getMouseClick()) && (choi != 0))));
-		g_vm->setMouseClick(false);
+		} while (!((tou == '\15') || (((c != 0) || getMouseClick()) && (choi != 0))));
+		setMouseClick(false);
 		if (choi != 46) {
 			int ix = choi - 1;
-			if (g_vm->_col) {
-				g_vm->_col = false;
+			if (_col) {
+				_col = false;
 				g_s._currPlace = 15;
 				if (g_iouv > 0)
 					max = 8;
@@ -1498,14 +1502,14 @@ void MortevielleEngine::fctDiscuss() {
 			showMouse();
 		}
 	} while ((choi != 46) && (suj != 138));
-	if (g_vm->_col) {
+	if (_col) {
 		g_s._faithScore += (3 * (g_s._faithScore / 10));
 		hideMouse();
 		hirs();
 		premtet();
 		sparl(0, 138);
 		showMouse();
-		g_vm->_col = false;
+		_col = false;
 		g_s._currPlace = LANDING;
 	}
 	g_ctrm = 0;
@@ -1518,7 +1522,7 @@ void MortevielleEngine::fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+	_menu.setDestinationMenuText(g_s._currPlace);
 	clearScreenType3();
 }
 
@@ -1529,10 +1533,10 @@ void MortevielleEngine::fctDiscuss() {
 void MortevielleEngine::fctSmell() {
 	g_crep = 119;
 	if (g_caff < ROOM26) {
-		if (!g_vm->_syn)
-			ecr3(g_vm->getEngineString(S_SMELL));
+		if (!_syn)
+			ecr3(getEngineString(S_SMELL));
 		tfleche();
-		if (!(g_vm->_anyone) && !(g_vm->_keyPressedEsc))
+		if (!(_anyone) && !(_keyPressedEsc))
 			if (g_caff == 16)
 				g_crep = 153;
 	} else if (g_caff == 123)
@@ -1547,8 +1551,8 @@ void MortevielleEngine::fctSmell() {
 void MortevielleEngine::fctScratch() {
 	g_crep = 155;
 	if (g_caff < 27) {
-		if (!g_vm->_syn)
-			ecr3(g_vm->getEngineString(S_SCRATCH));
+		if (!_syn)
+			ecr3(getEngineString(S_SCRATCH));
 		tfleche();
 	}
 	g_num = 0;
@@ -1596,7 +1600,7 @@ void MortevielleEngine::endGame() {
  * You lost!
  * @remarks	Originally called 'tencore'
  */
-void MortevielleEngine::loseGame() {
+void MortevielleEngine::askRestart() {
 	clearScreenType2();
 	musique(0);
 	tkey1(false);
@@ -1611,7 +1615,7 @@ void MortevielleEngine::loseGame() {
 	g_day = 0;
 	repon(2, 180);
 
-	int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1);
+	int answer = Alert::show(getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4b6a7b3..9510360 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1946,26 +1946,28 @@ void affrep() {
 	g_crep = g_s._currPlace;
 }
 
-/* NIVEAU 6 */
-
-void tperd() {
+/**
+ * Engine function - You lose!
+ * @remarks	Originally called 'tperd'
+ */
+void MortevielleEngine::loseGame() {
 	initouv();
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	g_vm->_menu.unsetSearchMenu();
-	if (!g_vm->_blo)
+	_menu.unsetSearchMenu();
+	if (!_blo)
 		t11(MANOR_FRONT);
 
-	g_vm->_loseGame = true;
+	_loseGame = true;
 	clearScreenType1();
-	g_vm->_screenSurface.drawBox(60, 35, 400, 50, 15);
+	_screenSurface.drawBox(60, 35, 400, 50, 15);
 	repon(9, g_crep);
 	clearScreenType2();
 	clearScreenType3();
-	g_vm->_col = false;
-	g_vm->_syn = false;
-	g_vm->_okdes = false;
+	_col = false;
+	_syn = false;
+	_okdes = false;
 }
 
 void tsort() {
@@ -2015,15 +2017,19 @@ void st4(int ob) {
 	}
 }
 
-void cherjer(int ob, bool &d) {
-	int cx;
+/**
+ * Engine function - Check inventory for a given object
+ * @remarks	Originally called 'cherjer'
+ */
+bool MortevielleEngine::checkInventory(int objectId) {
+	bool retVal = false;
+	for (int i = 1; i <= 6; ++i)
+		retVal = (retVal || (ord(g_s._sjer[i]) == objectId));
 
-	d = false;
-	for (cx = 1; cx <= 6; ++cx)
-		d = (d || (ord(g_s._sjer[cx]) == ob));
+	if (g_s._selectedObjectId == objectId)
+		retVal = true;
 
-	if (g_s._selectedObjectId == ob)
-		d = true;
+	return retVal;
 }
 
 void st1sama() {
@@ -2036,19 +2042,22 @@ void modinv() {
 	Common::String nomp;
 
 	int cy = 0;
-	for (int cx = 1; cx <= 6; ++cx)
-		if (g_s._sjer[cx] != chr(0)) {
+	for (int i = 1; i <= 6; ++i) {
+		if (g_s._sjer[i] != chr(0)) {
 			++cy;
-			r = (ord(g_s._sjer[cx]) + 400);
+			r = (ord(g_s._sjer[i]) + 400);
 			nomp = deline(r - 501 + kInventoryStringIndex);
 			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
-			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[cx]);
+			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[i]);
 		}
-	if (cy < 6)
-		for (int cx = cy + 1; cx <= 6; ++cx) {
-			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cx], "                       ");
-			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[cx]);
+	}
+
+	if (cy < 6) {
+		for (int i = cy + 1; i <= 6; ++i) {
+			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[i], "                       ");
+			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[i]);
 		}
+	}
 }
 
 void sparl(float adr, float rep) {
@@ -2119,16 +2128,18 @@ void ajjer(int ob) {
 		g_crep = 139;
 }
 
-void t1sama() {    //Entering manor
+/**
+ * Engine function - Go to Dining room
+ * @remarks	Originally called 't1sama'
+ */
+void MortevielleEngine::gotoDiningRoom() {
 	int day, hour, minute;
 
 	updateHour(day, hour, minute);
 	if ((hour < 5) && (g_s._currPlace > ROOM18)) {
-		bool d;
-		cherjer(137, d);
-		if (!d) {        //You don't have the keys, and it's late
+		if (!checkInventory(137)) {        //You don't have the keys, and it's late
 			g_crep = 1511;
-			tperd();
+			loseGame();
 		} else
 			st1sama();
 	} else if (!g_s._ipre) {     //Is it your first time?
@@ -2164,32 +2175,44 @@ void t1vier() {
 	affrep();
 }
 
-void t1neig() {
-	++g_inei;
-	if (g_inei > 2) {
+/**
+ * Engine function - Check Manor distance (in the mountains)
+ * @remarks	Originally called 't1neig'
+ */
+void MortevielleEngine::checkManorDistance() {
+	++_manorDistance;
+	if (_manorDistance > 2) {
 		g_crep = 1506;
-		tperd();
+		loseGame();
 	} else {
-		g_vm->_okdes = true;
+		_okdes = true;
 		g_s._currPlace = MOUNTAIN;
 		affrep();
 	}
 }
 
-void t1deva() {
-	g_inei = 0;
+/**
+ * Engine function - Go to Manor front
+ * @remarks	Originally called 't1deva'
+ */
+void MortevielleEngine::gotoManorFront() {
+	_manorDistance = 0;
 	g_s._currPlace = MANOR_FRONT;
 	affrep();
 }
 
-void t1derr() {
+/**
+ * Engine function - Go to Manor back
+ * @remarks	Originally called 't1derr'
+ */
+void MortevielleEngine::gotoManorBack() {
 	g_s._currPlace = MANOR_BACK;
 	affrep();
 }
 
 void t1deau() {
 	g_crep = 1503;
-	tperd();
+	g_vm->loseGame();
 }
 
 void tctrm() {
@@ -2425,15 +2448,13 @@ void rechai(int &ch) {
 	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
 }
 
-void t23coul(int &l) {
-	bool d;
-
-	cherjer(143, d);
-	l = 14;
-	if (!d) {
+int t23coul() {
+	if (!g_vm->checkInventory(143)) {
 		g_crep = 1512;
-		tperd();
+		g_vm->loseGame();
 	}
+
+	return CELLAR;
 }
 
 void maivid() {
@@ -2508,7 +2529,7 @@ void MortevielleEngine::gameLoaded() {
 	_syn = true;
 	_heroSearching = true;
 	g_mchai = 0;
-	g_inei = 0;
+	_manorDistance = 0;
 	initouv();
 	g_iouv = 0;
 	g_dobj = 0;
@@ -2642,15 +2663,15 @@ void MortevielleEngine::handleOpcode() {
 	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
 		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
-			tperd();
+			loseGame();
 		}
 		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
 			g_crep = 1508;
-			tperd();
+			loseGame();
 		}
 		if ((day > 1) && (hour > 8) && (!_loseGame)) {
 			g_crep = 1502;
-			tperd();
+			loseGame();
 		}
 	}
 	mennor();
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index bc416e0..5e76042 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -109,10 +109,8 @@ extern void tkey1(bool d);
 extern void tlu(int af, int ob);
 extern void affrep();
 /* NIVEAU 6 */
-extern void tperd();
 extern void tsort();
 extern void st4(int ob);
-extern void cherjer(int ob, bool &d);
 extern void st1sama();
 extern void modinv();
 extern void sparl(float adr, float rep);
@@ -122,11 +120,7 @@ extern void premtet();
 /* NIVEAU 5 */
 extern void ajchai();
 extern void ajjer(int ob);
-extern void t1sama();
 extern void t1vier();
-extern void t1neig();
-extern void t1deva();
-extern void t1derr();
 extern void t1deau();
 extern void tctrm();
 extern void quelquun();
@@ -137,7 +131,7 @@ extern void st7(int ob);
 extern void treg(int ob);
 extern void avpoing(int &ob);
 extern void rechai(int &ch);
-extern void t23coul(int &l);
+extern int t23coul();
 extern void maivid();
 extern void st13(int ob);
 extern void aldepl();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 508e90f..6e7726b 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -566,7 +566,7 @@ void MortevielleEngine::playGame() {
 	if (_endGame)
 		endGame();
 	else if (_loseGame)
-		loseGame();
+		askRestart();
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e3a8986..f868f01 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -143,6 +143,8 @@ public:
 	int _currGraphicalDevice;
 	int _newGraphicalDevice;
 	int _place;
+	int _manorDistance;
+
 
 	int _c_zzz;
 	int ptr_word;
@@ -162,7 +164,8 @@ public:
 	bool _endGame;			// End game flag. Originally called 'solu'
 	bool _loseGame;			// Lose game flag. Originally called 'perdu'
 	bool _txxFileFl;        // Flag used to determine if texts are from the original files or from a DAT file
-public:
+
+
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
 	virtual bool hasFeature(EngineFeature f) const;
@@ -186,10 +189,9 @@ public:
 	void handleOpcode();
 
 	void endGame();
-	void loseGame();
+	void askRestart();
 	void gameLoaded();
 
-/* NIVEAU 4 */
 	void fctMove();
 	void fctTake();
 	void fctInventoryTake();
@@ -259,6 +261,14 @@ public:
 	void showPeoplePresent(int per);
 	int selectCharacters(int min, int max);
 	void displayAloneText();
+
+	void checkManorDistance();
+	void gotoManorFront();
+	void gotoManorBack();
+	void gotoDiningRoom();
+	bool checkInventory(int objectId);
+	void loseGame();
+
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index f548ed6..6ed5ef8 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -102,7 +102,6 @@ int g_x,
         g_crep,
         g_ades,
         g_iouv,
-        g_inei,
 		g_ctrm,
         g_dobj,
         g_msg3,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 150710e..ae114ef 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -118,7 +118,7 @@ enum places {
 	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,      CELLAR = 14, 
 	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,     MOUNTAIN = 19, 
 	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     ROOM23 = 23,     WELL = 24,
-	DOOR = 25,        ROOM26 = 26
+	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
 
 struct sav_chaine {
@@ -208,7 +208,6 @@ extern int g_x,
         g_crep,
         g_ades,
         g_iouv,
-        g_inei,
 		g_ctrm,
         g_dobj,
         g_msg3,


Commit: e4df49dfb8aefc97e94c3d28209b74a0d0c38680
    https://github.com/scummvm/scummvm/commit/e4df49dfb8aefc97e94c3d28209b74a0d0c38680
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:21-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 8b4e5a7..4f16218 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -58,6 +58,7 @@ void MortevielleEngine::fctMove() {
 
 		if ((_anyone) || (_keyPressedEsc))
 			return;
+
 		tcoord(1);
 
 		if (g_num == 0)
@@ -83,83 +84,78 @@ void MortevielleEngine::fctMove() {
 		return;
 	}
 	tsort();
-	int cx = 1;
+	int menuChoice = 1;
 
-	while (_menu._moveMenu[cx] != g_msg[4])
-		++cx;
+	while (_menu._moveMenu[menuChoice] != g_msg[4])
+		++menuChoice;
 
 	if (g_s._currPlace == MOUNTAIN) {
-		if (cx == 1)
+		if (menuChoice == 1)
 			gotoManorFront();
-		if (cx == 2)
+		else if (menuChoice == 2)
 			checkManorDistance();
 		_menu.setDestinationMenuText(g_s._currPlace);
 		return;
-	}
-
-	if (g_s._currPlace == ROOM23) {
-		if (cx == 1)
-			t1deau();
-		if (cx == 2)
+	} else if (g_s._currPlace == INSIDE_WELL) {
+		if (menuChoice == 1)
+			floodedInWell();
+		else if (menuChoice == 2)
 			gotoManorBack();
 		_menu.setDestinationMenuText(g_s._currPlace);
 		return;
-	}
-
-	if ((g_s._currPlace == BUREAU) && (cx == 1))
-		cx = 6;
+	} else if ((g_s._currPlace == BUREAU) && (menuChoice == 1))
+		menuChoice = 6;
 	else if (g_s._currPlace == KITCHEN) {
-		if (cx == 2)
-			cx = 6;
-		else if (cx == 5)
-			cx = 16;
-	}
-
-	if ((g_s._currPlace == CELLAR) && (cx == 3))
-		cx = 6;
-	if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (cx == 4))
-		cx = 6;
+		if (menuChoice == 2)
+			menuChoice = 6;
+		else if (menuChoice == 5)
+			menuChoice = 16;
+	} else if ((g_s._currPlace == CELLAR) && (menuChoice == 3))
+		menuChoice = 6;
+	else if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (menuChoice == 4))
+		menuChoice = 6;
+	
 	if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != ROOM26))
-		cx += 10;
-	if ((g_s._currPlace == CHAPEL) && (cx == 13))
-		cx = 16;
-	if (g_s._currPlace == MANOR_FRONT) {
-		if (cx == 12)
-			cx = 16;
-		else if (cx > 13)
-			cx = 15;
-	}
-	if ((g_s._currPlace == MANOR_BACK) && (cx > 14))
-		cx = 15;
-	else if ((g_s._currPlace == WELL) && (cx > 13) && (cx != 17))
-		cx = 15;
-
-	if (cx == 1)
+		menuChoice += 10;
+	
+	if ((g_s._currPlace == CHAPEL) && (menuChoice == 13))
+		menuChoice = 16;
+	else if (g_s._currPlace == MANOR_FRONT) {
+		if (menuChoice == 12)
+			menuChoice = 16;
+		else if (menuChoice > 13)
+			menuChoice = 15;
+	} else if ((g_s._currPlace == MANOR_BACK) && (menuChoice > 14))
+		menuChoice = 15;
+	else if ((g_s._currPlace == WELL) && (menuChoice > 13) && (menuChoice != 17))
+		menuChoice = 15;
+
+	if (menuChoice == 1)
 		g_s._currPlace = BUREAU;
-	else if (cx == 2)
+	else if (menuChoice == 2)
 		g_s._currPlace = KITCHEN;
-	else if (cx == 3)
+	else if (menuChoice == 3)
 		g_s._currPlace = CELLAR;
-	else if (cx == 4)
+	else if (menuChoice == 4)
 		g_s._currPlace = LANDING;
-	else if (cx == 5)
-		cx = 12;
-	else if (cx == 6)
-		cx = 11;
+	else if (menuChoice == 5)
+		menuChoice = 12;
+	else if (menuChoice == 6)
+		menuChoice = 11;
 
-	if (cx == 11)
+	if (menuChoice == 11)
 		gotoDiningRoom();
-	else if (cx == 12)
+	else if (menuChoice == 12)
 		gotoManorFront();
-	else if (cx == 13)
+	else if (menuChoice == 13)
 		g_s._currPlace = CHAPEL;
-	else if (cx == 14)
+	else if (menuChoice == 14)
 		g_s._currPlace = WELL;
-	else if (cx == 15)
+	else if (menuChoice == 15)
 		checkManorDistance();
-	else if (cx == 16)
+	else if (menuChoice == 16)
 		gotoManorBack();
-	else if (cx == 17) {
+	else if (menuChoice == 17) {
 		if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140))
 			g_crep = 997;
 		else if (g_s._wellObjectId == 120)
@@ -168,11 +164,11 @@ void MortevielleEngine::fctMove() {
 			g_crep = 1505;
 			loseGame();
 		} else {
-			g_s._currPlace = ROOM23;
+			g_s._currPlace = INSIDE_WELL;
 			affrep();
 		}
 	}
-	if ((cx < 5) || (cx == 13) || (cx == 14))
+	if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
 		affrep();
 	debloc(g_s._currPlace);
 	_menu.setDestinationMenuText(g_s._currPlace);
@@ -187,7 +183,7 @@ void MortevielleEngine::fctTake() {
 		int cx = g_caff;
 		avpoing(cx);
 		if (g_crep != 139) {
-			if (g_ipers > 0)
+			if (_currBitIndex > 0)
 				g_s._faithScore += 3;
 			if (_obpart) {
 				if (g_s._currPlace == PURPLE_ROOM)
@@ -237,7 +233,7 @@ void MortevielleEngine::fctTake() {
 	if ((g_num == 0) || ((g_num == 1) && (g_s._currPlace == CRYPT))) {
 		tcoord(8);
 		if (g_num != 0) {
-			if (g_ipers > 0)
+			if (_currBitIndex > 0)
 				g_s._faithScore += 3;
 			g_crep = 997;
 			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
@@ -276,15 +272,22 @@ void MortevielleEngine::fctTake() {
 				g_crep = 999;
 		}
 	} else {
-		if ( ((g_s._currPlace == OWN_ROOM)  && (g_num == 3)) || ((g_s._currPlace == GREEN_ROOM)  && (g_num == 4))
-		  || ((g_s._currPlace == PURPLE_ROOM)  && (g_num == 1)) || ((g_s._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
-		  || ((g_s._currPlace == BLUE_ROOM)  && (g_num == 6)) || ((g_s._currPlace == RED_ROOM)  && (g_num == 2))
-		  || ((g_s._currPlace == BATHROOM)  && (g_num == 6)) || ((g_s._currPlace == GREEN_ROOM2)  && (g_num == 4))
-		  || ((g_s._currPlace == 9)  && (g_num == 4)) || ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
-		  || ((g_s._currPlace == BUREAU) && (g_num == 7)) || ((g_s._currPlace == KITCHEN) && (g_num == 6))
-		  || ((g_s._currPlace == ATTIC) && (g_num > 4))  || ((g_s._currPlace > ATTIC)  && (g_s._currPlace != ROOM23)) )
+		if ( ((g_s._currPlace == OWN_ROOM)  && (g_num == 3))
+		  || ((g_s._currPlace == GREEN_ROOM)  && (g_num == 4))
+		  || ((g_s._currPlace == PURPLE_ROOM)  && (g_num == 1))
+		  || ((g_s._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
+		  || ((g_s._currPlace == BLUE_ROOM)  && (g_num == 6))
+		  || ((g_s._currPlace == RED_ROOM)  && (g_num == 2))
+		  || ((g_s._currPlace == BATHROOM)  && (g_num == 6))
+		  || ((g_s._currPlace == GREEN_ROOM2)  && (g_num == 4))
+		  || ((g_s._currPlace == ROOM9) && (g_num == 4))
+		  || ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
+		  || ((g_s._currPlace == BUREAU) && (g_num == 7))
+		  || ((g_s._currPlace == KITCHEN) && (g_num == 6))
+		  || ((g_s._currPlace == ATTIC) && (g_num > 4))
+		  || ((g_s._currPlace > ATTIC) && (g_s._currPlace != INSIDE_WELL)) )
 		  g_crep = 997;
-		else if (g_s._currPlace == ROOM23) {
+		else if (g_s._currPlace == INSIDE_WELL) {
 			g_crep = 1504;
 			loseGame();
 		} else
@@ -331,7 +334,7 @@ void MortevielleEngine::fctLift() {
 	if (g_num == 0) {
 		tcoord(8);
 		if (g_num != 0) {
-			if (g_ipers > 0)
+			if (_currBitIndex > 0)
 				++g_s._faithScore;
 			g_crep = 997;
 			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
@@ -339,7 +342,7 @@ void MortevielleEngine::fctLift() {
 		}
 		return;
 	}
-	if (g_ipers > 0)
+	if (_currBitIndex > 0)
 		++g_s._faithScore;
 	int tmpPlace = g_s._currPlace;
 	if (g_s._currPlace == CRYPT)
@@ -489,7 +492,7 @@ void MortevielleEngine::fctSearch() {
 	if (_anyone || _keyPressedEsc)
 		return;
 
-	if (g_s._currPlace == ROOM23) {
+	if (g_s._currPlace == INSIDE_WELL) {
 		g_crep = 1504;
 		loseGame();
 		return;
@@ -506,7 +509,7 @@ void MortevielleEngine::fctSearch() {
 			if (g_num != ord(g_touv[cx]))
 				g_crep = 187;
 			else {
-				if (g_ipers > 0)
+				if (_currBitIndex > 0)
 					g_s._faithScore += 3;
 
 				rechai(g_mchai);
@@ -523,7 +526,7 @@ void MortevielleEngine::fctSearch() {
 			tcoord(8);
 			g_crep = 997;
 			if (g_num != 0) {
-				if (g_ipers > 0)
+				if (_currBitIndex > 0)
 					g_s._faithScore += 3;
 				if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
 					if (g_s._currPlace == PURPLE_ROOM) {
@@ -540,7 +543,7 @@ void MortevielleEngine::fctSearch() {
 			}
 		}
 	} else {
-		if (g_ipers > 0)
+		if (_currBitIndex > 0)
 			g_s._faithScore += 3;
 		g_crep = 997;
 		if (g_s._currPlace < CELLAR)
@@ -602,7 +605,7 @@ void MortevielleEngine::fctOpen() {
 
 	tcoord(7);
 	if (g_num != 0) {
-		if (g_ipers > 0)
+		if (_currBitIndex > 0)
 			g_s._faithScore += 2;
 		++g_iouv;
 		int tmpPlace = 0;
@@ -705,8 +708,8 @@ void MortevielleEngine::fctPlace() {
 						showMouse();
 						tinke();
 						drawClock();
-						if (g_ipers != 0)
-							showPeoplePresent(g_ipers);
+						if (_currBitIndex != 0)
+							showPeoplePresent(_currBitIndex);
 						else 
 							displayAloneText();
 
@@ -1027,7 +1030,7 @@ void MortevielleEngine::fctSelfPut() {
 				}
 			}
 		}
-		if (g_caff == ROOM23)
+		if (g_caff == INSIDE_WELL)
 			g_crep = 185;
 		if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
 			if (g_crep == 999)
@@ -1046,7 +1049,7 @@ void MortevielleEngine::fctListen() {
 	if (g_s._currPlace != ROOM26)
 		g_crep = 101;
 	else {
-		if (g_ipers != 0)
+		if (_currBitIndex != 0)
 			++g_s._faithScore;
 		int p, rand;
 		ecfren(p, rand, g_s._faithScore, g_ment);
@@ -1171,7 +1174,7 @@ void MortevielleEngine::fctEnter() {
 			_menu.setDestinationMenuText(g_s._currPlace);
 			g_ment = 0;
 			g_mpers = 0;
-			g_ipers = 0;
+			_currBitIndex = 0;
 		}
 	}
 }
@@ -1266,7 +1269,7 @@ void MortevielleEngine::fctLeave() {
 			g_crep = 176;
 		} else if (g_s._currPlace == SECRET_PASSAGE)
 			nextPlace = t23coul();
-		else if (g_s._currPlace == ROOM23)
+		else if (g_s._currPlace == INSIDE_WELL)
 			nextPlace = WELL;
 
 		if (g_crep != 997)
@@ -1294,13 +1297,13 @@ void MortevielleEngine::fctWait() {
 		tinke();
 		if (!_blo)
 			t11(g_s._currPlace);
-		if ((g_ipers != 0) && (g_mpers == 0)) {
+		if ((_currBitIndex != 0) && (g_mpers == 0)) {
 			g_crep = 998;
 			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
 				cavegre();
 			if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
 				_anyone = true;
-			g_mpers = g_ipers;
+			g_mpers = _currBitIndex;
 			if (!_anyone)
 				tinke();
 			return;
@@ -1517,7 +1520,7 @@ void MortevielleEngine::fctDiscuss() {
 	hirs();
 	drawRightFrame();
 	showMouse();
-	showPeoplePresent(g_ipers);
+	showPeoplePresent(_currBitIndex);
 	tinke();
 	drawClock();
 	affrep();
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 9510360..a3a0ef7 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -558,54 +558,54 @@ void MortevielleEngine::resetPresenceInRooms(int roomId) {
  * Engine function - Show the people present in the given room 
  * @remarks	Originally called 'affper'
  */
-void MortevielleEngine::showPeoplePresent(int per) {
+void MortevielleEngine::showPeoplePresent(int bitIndex) {
 	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
 
 	for (int i = 1; i <= 8; ++i)
 		_menu.disableMenuItem(_menu._discussMenu[i]);
 
 	clearScreenType10();
-	if ((per & 128) == 128) {
+	if ((bitIndex & 128) == 128) {
 		_screenSurface.putxy(xp, 24);
 		_screenSurface.drawString("LEO", 4);
 		_menu.enableMenuItem(_menu._discussMenu[1]);
 	}
-	if ((per & 64) == 64) {
+	if ((bitIndex & 64) == 64) {
 		_screenSurface.putxy(xp, 32);
 		_screenSurface.drawString("PAT", 4);
 		_menu.enableMenuItem(_menu._discussMenu[2]);
 	}
-	if ((per & 32) == 32) {
+	if ((bitIndex & 32) == 32) {
 		_screenSurface.putxy(xp, 40);
 		_screenSurface.drawString("GUY", 4);
 		_menu.enableMenuItem(_menu._discussMenu[3]);
 	}
-	if ((per & 16) == 16) {
+	if ((bitIndex & 16) == 16) {
 		_screenSurface.putxy(xp, 48);
 		_screenSurface.drawString("EVA", 4);
 		_menu.enableMenuItem(_menu._discussMenu[4]);
 	}
-	if ((per & 8) == 8) {
+	if ((bitIndex & 8) == 8) {
 		_screenSurface.putxy(xp, 56);
 		_screenSurface.drawString("BOB", 4);
 		_menu.enableMenuItem(_menu._discussMenu[5]);
 	}
-	if ((per & 4) == 4) {
+	if ((bitIndex & 4) == 4) {
 		_screenSurface.putxy(xp, 64);
 		_screenSurface.drawString("LUC", 4);
 		_menu.enableMenuItem(_menu._discussMenu[6]);
 	}
-	if ((per & 2) == 2) {
+	if ((bitIndex & 2) == 2) {
 		_screenSurface.putxy(xp, 72);
 		_screenSurface.drawString("IDA", 4);
 		_menu.enableMenuItem(_menu._discussMenu[7]);
 	}
-	if ((per & 1) == 1) {
+	if ((bitIndex & 1) == 1) {
 		_screenSurface.putxy(xp, 80);
 		_screenSurface.drawString("MAX", 4);
 		_menu.enableMenuItem(_menu._discussMenu[8]);
 	}
-	g_ipers = per;
+	_currBitIndex = bitIndex;
 }
 
 /**
@@ -771,7 +771,7 @@ void MortevielleEngine::displayAloneText() {
 	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
 	_screenSurface.drawString(sAlone, 4);
 
-	g_ipers = 0;
+	_currBitIndex = 0;
 }
 
 int chlm() {
@@ -843,7 +843,7 @@ void debloc(int roomId) {
 	g_y = 0;
 	if ((roomId != ROOM26) && (roomId != LANDING))
 		g_vm->resetPresenceInRooms(roomId);
-	g_mpers = g_ipers;
+	g_mpers = g_vm->_currBitIndex;
 }
 
 /**
@@ -989,7 +989,7 @@ void MortevielleEngine::setPresenceGreenRoom(int roomId) {
 			_roomPresenceEva = true;
 	}
 
-	g_ipers = 10;
+	_currBitIndex = 10;
 }
 
 /**
@@ -1002,7 +1002,7 @@ void MortevielleEngine::setPresencePurpleRoom() {
 	else
 		_room9PresenceLeo = true;
 
-	g_ipers = 10;
+	_currBitIndex = 10;
 }
 
 /**
@@ -1011,7 +1011,7 @@ void MortevielleEngine::setPresencePurpleRoom() {
  */
 void MortevielleEngine::setPresenceBlueRoom() {
 	_roomPresenceMax = true;
-	g_ipers = 10;
+	_currBitIndex = 10;
 }
 
 /**
@@ -1024,7 +1024,7 @@ void MortevielleEngine::setPresenceRedRoom(int roomId) {
 	else if (roomId == GREEN_ROOM2)
 		_roomPresencePat = true;
 
-	g_ipers = 10;
+	_currBitIndex = 10;
 }
 
 /**
@@ -1310,7 +1310,7 @@ void phaz(int &rand, int &p, int cf) {
 void resetVariables() {
 	copcha();
 
-	g_s._ipre  = false;
+	g_s._alreadyEnteredManor = false;
 	g_s._selectedObjectId = 0;
 	g_s._cellarObjectId = 0;
 	g_s._atticBallHoleObjectId = 0;
@@ -1358,7 +1358,7 @@ void resetVariables() {
 void MortevielleEngine::initGame() {
 	_place = MANOR_FRONT;
 	g_jh = 0;
-	if (!g_s._ipre)
+	if (!g_s._alreadyEnteredManor)
 		_blo = true;
 	g_t = kTime1;
 	g_mh = readclock();
@@ -1654,7 +1654,7 @@ void musique(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((g_prebru == 0) && (!g_s._ipre)) {
+	} else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
 		g_vm->_speechManager.startSpeech(10, 1, 1);
 		++g_prebru;
 	} else {
@@ -1674,7 +1674,7 @@ void musique(int so) {
 				g_vm->_speechManager.startSpeech(12, 1, 1);
 				i = true;
 			}
-		} else if (g_s._currPlace == ROOM23) {
+		} else if (g_s._currPlace == INSIDE_WELL) {
 			g_vm->_speechManager.startSpeech(13, 1, 1);
 			i = true;
 		}
@@ -1839,14 +1839,14 @@ void tinke() {
 				g_vm->setRandomPresenceChapel(cf);
 				break;
 			}
-			if ((g_mpers != 0) && (g_ipers != 10))
-				g_mpers = g_ipers;
+			if ((g_mpers != 0) && (g_vm->_currBitIndex != 10))
+				g_mpers = g_vm->_currBitIndex;
 
-			if ((g_mpers == 0) && (g_ipers > 0)) {
+			if ((g_mpers == 0) && (g_vm->_currBitIndex > 0)) {
 				if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
 					cavegre();
-				} else if (g_ipers == 10) {
-					g_ipers = 0;
+				} else if (g_vm->_currBitIndex == 10) {
+					g_vm->_currBitIndex = 0;
 					if (!g_vm->_brt) {
 						g_vm->_brt = true;
 						g_hdb = readclock();
@@ -1901,7 +1901,7 @@ void afdes(int ad) {
 }
 
 void tkey1(bool d) {
-	bool quest;
+	bool quest = false;
 	int x, y, c;
 
 	hideMouse();
@@ -2142,9 +2142,9 @@ void MortevielleEngine::gotoDiningRoom() {
 			loseGame();
 		} else
 			st1sama();
-	} else if (!g_s._ipre) {     //Is it your first time?
-		g_ipers = 255;
-		g_vm->showPeoplePresent(g_ipers);
+	} else if (!g_s._alreadyEnteredManor) {     //Is it your first time?
+		_currBitIndex = 255; // Everybody is present
+		g_vm->showPeoplePresent(_currBitIndex);
 		g_caff = 77;
 		afdes(0);
 		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
@@ -2163,9 +2163,9 @@ void MortevielleEngine::gotoDiningRoom() {
 		g_vm->resetPresenceInRooms(DINING_ROOM);
 		if (!g_vm->_blo)
 			minute = t11(OWN_ROOM);
-		g_ipers = 0;
+		_currBitIndex = 0;
 		g_mpers = 0;
-		g_s._ipre = true;
+		g_s._alreadyEnteredManor = true;
 	} else
 		st1sama();
 }
@@ -2210,7 +2210,11 @@ void MortevielleEngine::gotoManorBack() {
 	affrep();
 }
 
-void t1deau() {
+/**
+ * Engine function - Dead : Flooded in Well 
+ * @remarks	Originally called 't1deau'
+ */
+void MortevielleEngine::floodedInWell() {
 	g_crep = 1503;
 	g_vm->loseGame();
 }
@@ -2245,7 +2249,7 @@ L1:
 			g_s._faithScore += 3 * (g_s._faithScore / 10);
 		tsort();
 		g_vm->_menu.setDestinationMenuText(LANDING);
-		int cx = convertBitIndexToCharacterIndex(g_ipers);
+		int cx = convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
 		g_caff = 69 + cx;
 		g_crep = g_caff;
 		g_msg[3] = MENU_DISCUSS;
@@ -2288,7 +2292,7 @@ void tsuiv() {
 		++g_is;
 		g_caff = tbcl;
 		g_crep = g_caff + 400;
-		if (g_ipers != 0)
+		if (g_vm->_currBitIndex != 0)
 			g_s._faithScore += 2;
 	} else {
 		affrep();
@@ -2490,8 +2494,8 @@ void changeGraphicalDevice(int newDevice) {
 	drawRightFrame();
 	tinke();
 	drawClock();
-	if (g_ipers != 0)
-		g_vm->showPeoplePresent(g_ipers);
+	if (g_vm->_currBitIndex != 0)
+		g_vm->showPeoplePresent(g_vm->_currBitIndex);
 	else
 		g_vm->displayAloneText();
 	clearScreenType2();
@@ -2659,8 +2663,8 @@ void MortevielleEngine::handleOpcode() {
 	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
 	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
 		++g_s._faithScore;
-	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != ROOM23)
-	        && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
+	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != INSIDE_WELL)
+	        && (g_s._currPlace != OWN_ROOM) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
 		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
 			loseGame();
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 5e76042..43413b3 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -121,7 +121,6 @@ extern void premtet();
 extern void ajchai();
 extern void ajjer(int ob);
 extern void t1vier();
-extern void t1deau();
 extern void tctrm();
 extern void quelquun();
 extern void tsuiv();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index f868f01..52c68fa 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -144,6 +144,7 @@ public:
 	int _newGraphicalDevice;
 	int _place;
 	int _manorDistance;
+	int _currBitIndex;
 
 
 	int _c_zzz;
@@ -165,7 +166,6 @@ public:
 	bool _loseGame;			// Lose game flag. Originally called 'perdu'
 	bool _txxFileFl;        // Flag used to determine if texts are from the original files or from a DAT file
 
-
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
 	virtual bool hasFeature(EngineFeature f) const;
@@ -258,7 +258,7 @@ public:
 	void loadPlaces();
 	void initGame();
 	void resetPresenceInRooms(int roomId);
-	void showPeoplePresent(int per);
+	void showPeoplePresent(int bitIndex);
 	int selectCharacters(int min, int max);
 	void displayAloneText();
 
@@ -268,6 +268,7 @@ public:
 	void gotoDiningRoom();
 	bool checkInventory(int objectId);
 	void loseGame();
+	void floodedInWell();
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 3e770b8..45cbb1b 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -377,7 +377,7 @@ void taffich() {
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
 
-		if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+		if (((a < 27) && (((g_maff > 69) && (!g_s._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
 
 		g_maff = a;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 37b3376..9e17252 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -60,7 +60,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(g_s1._selectedObjectId);
 	sz.syncAsSint16LE(g_s1._purpleRoomObjectId);
 	sz.syncAsSint16LE(g_s1._cryptObjectId);
-	sz.syncAsByte(g_s1._ipre);
+	sz.syncAsByte(g_s1._alreadyEnteredManor);
 	sz.syncAsByte(g_s1._heure);
 
 	sz.syncBytes(g_bufcha, 391);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 6ed5ef8..9b48ed3 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -109,7 +109,6 @@ int g_x,
         g_mlec,
         g_mchai,
         g_menup,
-        g_ipers,
         g_mpers,
         g_mnumo,
         g_xprec,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index ae114ef..22ec5cc 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -107,17 +107,16 @@ extern const byte g_rang[16];
 /*
 9   "A glance at the forbidden$",
 18  "It's already open$",
-23  "Strange horoscope$",
 26  "A photograph$",
 27  "The coat of arms$",
 */
 
 enum places {
-	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,     DARKBLUE_ROOM = 4,
-	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8, ROOM9 = 9,
-	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,      CELLAR = 14, 
-	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,     MOUNTAIN = 19, 
-	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     ROOM23 = 23,     WELL = 24,
+	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
+	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
+	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14, 
+	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19, 
+	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     INSIDE_WELL = 23, WELL = 24,
 	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
 
@@ -128,7 +127,7 @@ struct sav_chaine {
 	byte _sjer[31];
 	int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId;
 	int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId;
-	bool _ipre;
+	bool _alreadyEnteredManor;
 	byte _heure;
 };
 
@@ -215,7 +214,6 @@ extern int g_x,
         g_mlec,
         g_mchai,
         g_menup,
-        g_ipers,
         g_mpers,
         g_mnumo,
         g_xprec,


Commit: d9c78dec0c1d0d38a800370aa2b28a294512a30f
    https://github.com/scummvm/scummvm/commit/d9c78dec0c1d0d38a800370aa2b28a294512a30f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:23-07:00

Commit Message:
MORTEVIELLE: Remove some useless g_vm uses, some more renaming

Changed paths:
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a3a0ef7..8b27833 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1106,14 +1106,14 @@ int MortevielleEngine::setPresenceLanding() {
 	int rand = 0;
 	do {
 		rand = getRandomNumber(1, 8);
-		test = (((rand == 1) && (g_vm->_purpleRoomPresenceLeo || g_vm->_room9PresenceLeo)) ||
-		        ((rand == 2) && g_vm->_roomPresencePat) ||
-		        ((rand == 3) && g_vm->_roomPresenceGuy) ||
-		        ((rand == 4) && g_vm->_roomPresenceEva) ||
-		        ((rand == 5) && g_vm->_roomPresenceBob) ||
-		        ((rand == 6) && g_vm->_roomPresenceLuc) ||
-		        ((rand == 7) && g_vm->_roomPresenceIda) ||
-		        ((rand == 8) && g_vm->_roomPresenceMax));
+		test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
+		        ((rand == 2) && _roomPresencePat) ||
+		        ((rand == 3) && _roomPresenceGuy) ||
+		        ((rand == 4) && _roomPresenceEva) ||
+		        ((rand == 5) && _roomPresenceBob) ||
+		        ((rand == 6) && _roomPresenceLuc) ||
+		        ((rand == 7) && _roomPresenceIda) ||
+		        ((rand == 8) && _roomPresenceMax));
 	} while (test);
 
 	int retVal = convertCharacterIndexToBitIndex(rand);
@@ -1404,7 +1404,7 @@ void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
  * @remarks	Originally called 'pl5'
  */
 void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
-	if (!g_vm->_roomPresenceMax) {
+	if (!_roomPresenceMax) {
 		int p = getPresenceStatsBlueRoom();
 		int rand;
 
@@ -2032,7 +2032,11 @@ bool MortevielleEngine::checkInventory(int objectId) {
 	return retVal;
 }
 
-void st1sama() {
+/**
+ * Engine function - Display Dining Room
+ * @remarks	Originally called 'st1sama'
+ */
+void MortevielleEngine::displayDiningRoom() {
 	g_s._currPlace = DINING_ROOM;
 	affrep();
 }
@@ -2141,13 +2145,13 @@ void MortevielleEngine::gotoDiningRoom() {
 			g_crep = 1511;
 			loseGame();
 		} else
-			st1sama();
+			displayDiningRoom();
 	} else if (!g_s._alreadyEnteredManor) {     //Is it your first time?
 		_currBitIndex = 255; // Everybody is present
-		g_vm->showPeoplePresent(_currBitIndex);
+		showPeoplePresent(_currBitIndex);
 		g_caff = 77;
 		afdes(0);
-		g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
+		_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
 		tkey1(false);
 		mennor();
@@ -2160,19 +2164,14 @@ void MortevielleEngine::gotoDiningRoom() {
 		showMouse();
 		g_s._currPlace = OWN_ROOM;
 		affrep();
-		g_vm->resetPresenceInRooms(DINING_ROOM);
-		if (!g_vm->_blo)
+		resetPresenceInRooms(DINING_ROOM);
+		if (!_blo)
 			minute = t11(OWN_ROOM);
 		_currBitIndex = 0;
 		g_mpers = 0;
 		g_s._alreadyEnteredManor = true;
 	} else
-		st1sama();
-}
-
-void t1vier() {
-	g_s._currPlace = SECRET_PASSAGE;
-	affrep();
+		displayDiningRoom();
 }
 
 /**
@@ -2216,7 +2215,7 @@ void MortevielleEngine::gotoManorBack() {
  */
 void MortevielleEngine::floodedInWell() {
 	g_crep = 1503;
-	g_vm->loseGame();
+	loseGame();
 }
 
 void tctrm() {
@@ -2552,7 +2551,7 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, g_crep);
 	clearScreenType3();
 	_endGame = false;
-	g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+	_menu.setDestinationMenuText(g_s._currPlace);
 	modinv();
 	if (g_s._selectedObjectId != 0)
 		modobj(g_s._selectedObjectId + 400);
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 43413b3..da1f447 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -111,7 +111,7 @@ extern void affrep();
 /* NIVEAU 6 */
 extern void tsort();
 extern void st4(int ob);
-extern void st1sama();
+extern void displayDiningRoom();
 extern void modinv();
 extern void sparl(float adr, float rep);
 extern void endSearch();
@@ -120,7 +120,6 @@ extern void premtet();
 /* NIVEAU 5 */
 extern void ajchai();
 extern void ajjer(int ob);
-extern void t1vier();
 extern void tctrm();
 extern void quelquun();
 extern void tsuiv();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 52c68fa..57de236 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -269,7 +269,7 @@ public:
 	bool checkInventory(int objectId);
 	void loseGame();
 	void floodedInWell();
-
+	void displayDiningRoom();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 9e17252..4113ff0 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -48,9 +48,13 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
  */
 void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(g_s1._faithScore);
-	sz.syncBytes((byte *)&g_s1._pourc[0], 11);
-	sz.syncBytes((byte *)&g_s1._teauto[0], 43);
-	sz.syncBytes((byte *)&g_s1._sjer[0], 31);
+	for (int i = 0; i < 11; ++i)
+		sz.syncAsByte(g_s1._pourc[i]);
+	for (int i = 0; i < 43; ++i)
+		sz.syncAsByte(g_s1._teauto[i]);
+	for (int i = 0; i < 31; ++i)
+		sz.syncAsByte(g_s1._sjer[i]);
+
 	sz.syncAsSint16LE(g_s1._currPlace);
 	sz.syncAsSint16LE(g_s1._atticBallHoleObjectId);
 	sz.syncAsSint16LE(g_s1._atticRodHoleObjectId);


Commit: e3c16a17995ade25e80c1f5353dc68d32c702dab
    https://github.com/scummvm/scummvm/commit/e3c16a17995ade25e80c1f5353dc68d32c702dab
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:25-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 4f16218..c78c3a6 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1200,7 +1200,7 @@ void MortevielleEngine::fctSleep() {
 	}
 	clearScreenType3();
 	clearScreenType2();
-	ecrf2();
+	prepareScreenType2();
 	ecr2(getEngineString(S_WANT_TO_WAKE_UP));
 	updateHour(j, h, m);
 
@@ -1589,7 +1589,7 @@ void MortevielleEngine::endGame() {
 	afdes(0);
 	repon(6, 34);
 	repon(2, 35);
-	musique(0);
+	startMusicOrSpeech(0);
 	tkey1(false);
 	// A wait message was displayed. 
 	// tkey1 was called before and after.
@@ -1605,17 +1605,17 @@ void MortevielleEngine::endGame() {
  */
 void MortevielleEngine::askRestart() {
 	clearScreenType2();
-	musique(0);
+	startMusicOrSpeech(0);
 	tkey1(false);
 	maivid();
 	resetVariables();
 	initGame();
-	g_vh = 10;
-	g_vm__ = 0;
-	g_vj = 0;
-	g_minute = 0;
-	g_hour = 10;
-	g_day = 0;
+	_currHour = 10;
+	_currHalfHour = 0;
+	_currDay = 0;
+	_minute = 0;
+	_hour = 10;
+	_day = 0;
 	repon(2, 180);
 
 	int answer = Alert::show(getEngineString(S_YES_NO), 1);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 8b27833..8a8ef56 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -248,8 +248,8 @@ void drawRightFrame() {
  * Set Text Color
  * @remarks	Originally called 'text_color'
  */
-void setTextColor(int c) {
-	g_vm->_textColor = c;
+void MortevielleEngine::setTextColor(int col) {
+	_textColor = col;
 }
 
 /* NIVEAU 13 */
@@ -273,11 +273,6 @@ void initouv() {
 		g_touv[cx] = chr(0);
 }
 
-void ecrf1() {
-	// Large drawing
-	g_vm->_screenSurface.drawBox(0, 11, 512, 163, 15);
-}
-
 /**
  * Engine function - Clear Screen - Type 1
  * @remarks	Originally called 'clsf1'
@@ -349,10 +344,6 @@ void clearScreenType10() {
 	showMouse();
 }
 
-void ecrf2() {
-	setTextColor(5);
-}
-
 void ecr2(Common::String str_) {
 	// Some dead code was present in the original: removed
 	g_vm->_screenSurface.putxy(8, 177);
@@ -383,12 +374,28 @@ void ecr3(Common::String text) {
 	g_vm->_screenSurface.drawString(text, 5);
 }
 
-void ecrf6() {
+/**
+ * Prepare screen - Type 1!
+ * @remarks	Originally called 'ecrf1'
+ */
+void MortevielleEngine::prepareScreenType1() {
+	// Large drawing
+	_screenSurface.drawBox(0, 11, 512, 163, 15);
+}
+
+/**
+ * Prepare room - Type 2!
+ * @remarks	Originally called 'ecrf2'
+ */
+void MortevielleEngine::prepareScreenType2() {
 	setTextColor(5);
-	g_vm->_screenSurface.drawBox(62, 33, 363, 80, 15);
 }
 
-void ecrf7() {
+/**
+ * Prepare room - Type 3!
+ * @remarks	Originally called 'ecrf7'
+ */
+void MortevielleEngine::prepareScreenType3() {
 	setTextColor(4);
 }
 
@@ -416,14 +423,14 @@ void paint_rect(int x, int y, int dx, int dy) {
 void updateHour(int &day, int &hour, int &minute) {
 	int newHour = readclock();
 	int th = g_jh + ((newHour - g_mh) / g_t);
-	minute = ((th % 2) + g_vm__) * 30;
-	hour = ((uint)th >> 1) + g_vh;
+	minute = ((th % 2) + g_vm->_currHalfHour) * 30;
+	hour = ((uint)th >> 1) + g_vm->_currHour;
 	if (minute == 60) {
 		minute = 0;
 		++hour;
 	}
-	day = (hour / 24) + g_vj;
-	hour = hour - ((day - g_vj) * 24);
+	day = (hour / 24) + g_vm->_currDay;
+	hour = hour - ((day - g_vm->_currDay) * 24);
 }
 
 /**
@@ -462,13 +469,9 @@ void repon(int f, int m) {
 		displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
-		if (f == 8)
-			f = 2;
-		if (f == 1)
-			f = 6;
-		if (f == 2) {
+		if ((f == 2) || (f == 8)) {
 			clearScreenType2();
-			ecrf2();
+			g_vm->prepareScreenType2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
 				g_s._teauto[40] = '*';
@@ -479,10 +482,9 @@ void repon(int f, int m) {
 					g_s._teauto[38] = '*';
 				}
 			}
-		}
-		if ((f == 6) || (f == 9)) {
+		} else if ((f == 1) || (f == 6) || (f == 9)) {
 			int i;
-			if (f == 6)
+			if ((f == 1) || (f == 6))
 				i = 4;
 			else
 				i = 5;
@@ -495,9 +497,8 @@ void repon(int f, int m) {
 
 			if (m == 179)
 				g_s._pourc[10] = '*';
-		}
-		if (f == 7) {         /* messint */
-			ecrf7();
+		} else if (f == 7) {         /* messint */
+			g_vm->prepareScreenType3();
 			tmpStr = deline(m);
 
 			int xSmallStr, xLargeStr, dx;
@@ -805,12 +806,12 @@ void drawClock() {
 	else
 		co = 1;
 
-	if (g_minute == 0)
+	if (g_vm->_minute == 0)
 		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
 	else 
 		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
 
-	h = g_hour;
+	h = g_vm->_hour;
 	if (h > 12)
 		h -= 12;
 	if (h == 0)
@@ -820,15 +821,15 @@ void drawClock() {
 	showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 
-	if (g_hour > 11)
+	if (g_vm->_hour > 11)
 		g_vm->_screenSurface.drawString("PM ", 1);
 	else
 		g_vm->_screenSurface.drawString("AM ", 1);
 
 	g_vm->_screenSurface.putxy(550, 160);
-	if ((g_day >= 0) && (g_day <= 8)) {
+	if ((g_vm->_day >= 0) && (g_vm->_day <= 8)) {
 		Common::String tmp = g_vm->getEngineString(S_DAY);
-		tmp.insertChar((char)(g_day + 49), 0);
+		tmp.insertChar((char)(g_vm->_day + 49), 0);
 		g_vm->_screenSurface.drawString(tmp, 1);
 	}
 }
@@ -1326,7 +1327,7 @@ void resetVariables() {
 		g_s._sjer[i] = chr(0);
 
 	g_s._sjer[1] = chr(113);
-	g_s._heure = chr(20);
+	g_s._fullHour = chr(20);
 
 	for (int i = 1; i <= 10; ++i)
 		g_s._pourc[i] = ' ';
@@ -1608,7 +1609,7 @@ void cavegre() {
 	if (g_s._faithScore > 69)
 		g_s._faithScore += (g_s._faithScore / 10);
 	clearScreenType3();
-	ecrf2();
+	g_vm->prepareScreenType2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
 	g_vm->_speechManager.startSpeech(2, rand, 1);
@@ -1647,40 +1648,37 @@ void aniof(int ouf, int num) {
 	surface.decode(&g_mem[ad * 16 + offset]);
 	g_vm->_screenSurface.drawPicture(surface, 0, 12);
 
-	ecrf1();
+	g_vm->prepareScreenType1();
 }
 
-void musique(int so) {
+/**
+ * Start music or speech
+ * @remarks	Originally called 'musique'
+ */
+void MortevielleEngine::startMusicOrSpeech(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
 	} else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
-		g_vm->_speechManager.startSpeech(10, 1, 1);
+		// Type 1: Speech
+		_speechManager.startSpeech(10, 1, 1);
 		++g_prebru;
 	} else {
-		bool i = false;
-		if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
-			if (getRandomNumber(1, 3) == 2) {
-				g_vm->_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
-				i = true;
-			}
-		} else if (g_s._currPlace == CHAPEL) {
-			if (getRandomNumber(1, 2) == 1) {
-				g_vm->_speechManager.startSpeech(8, 1, 1);
-				i = true;
-			}
-		} else if (g_s._currPlace == WELL) {
-			if (getRandomNumber(1, 2) == 2) {
-				g_vm->_speechManager.startSpeech(12, 1, 1);
-				i = true;
-			}
-		} else if (g_s._currPlace == INSIDE_WELL) {
-			g_vm->_speechManager.startSpeech(13, 1, 1);
-			i = true;
-		}
-
-		if (!i)
-			g_vm->_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
+		if (((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
+		else if ((g_s._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
+			// Type 1: Speech
+			_speechManager.startSpeech(8, 1, 1);
+		else if ((g_s._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(12, 1, 1);
+		else if (g_s._currPlace == INSIDE_WELL)
+			// Type 1: Speech
+			_speechManager.startSpeech(13, 1, 1);
+		else
+			// Type 2 : music
+			_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
 	}
 }
 
@@ -1698,7 +1696,7 @@ void dessin(int ad) {
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
 			dessine(g_ades, 0, 12);
-			ecrf1();
+			g_vm->prepareScreenType1();
 			if ((g_caff < 30) || (g_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
 					if (ord(g_touv[cx]) != 0)
@@ -1720,7 +1718,7 @@ void dessin(int ad) {
 			}
 			
 			if (g_caff < ROOM26)
-				musique(1);
+				g_vm->startMusicOrSpeech(1);
 		}
 	}
 }
@@ -1737,8 +1735,8 @@ void tinke() {
 
 	g_vm->_anyone = false;
 	updateHour(day, hour, minute);
-	if (day != g_day) {
-		g_day = day;
+	if (day != g_vm->_day) {
+		g_vm->_day = day;
 		int i = 0;
 		do {
 			++i;
@@ -1747,9 +1745,9 @@ void tinke() {
 			g_nbrep[i] = 0;
 		} while (i != 8);
 	}
-	if ((hour > g_hour) || ((hour == 0) && (g_hour == 23))) {
-		g_hour = hour;
-		g_minute = 0;
+	if ((hour > g_vm->_hour) || ((hour == 0) && (g_vm->_hour == 23))) {
+		g_vm->_hour = hour;
+		g_vm->_minute = 0;
 		drawClock();
 		cf = 0;
 		for (int i = 1; i <= 10; ++i) {
@@ -1775,8 +1773,8 @@ void tinke() {
 		g_hintPctMessage += d6;
 		g_hintPctMessage += d4;
 	}
-	if (minute > g_minute) {
-		g_minute = 30;
+	if (minute > g_vm->_minute) {
+		g_vm->_minute = 30;
 		drawClock();
 	}
 	if (y_s < 12)
@@ -1852,7 +1850,7 @@ void tinke() {
 						g_hdb = readclock();
 						if (getRandomNumber(1, 5) < 5) {
 							clearScreenType3();
-							ecrf2();
+							g_vm->prepareScreenType2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
 							g_vm->_speechManager.startSpeech(1, rand, 1);
@@ -2569,7 +2567,7 @@ void tmaj3() {
 		minute = 1;
 	hour += day * 24;
 	minute += hour * 2;
-	g_s._heure = chr(minute);
+	g_s._fullHour = chr(minute);
 }
 
 /**
@@ -2683,15 +2681,15 @@ void MortevielleEngine::handleOpcode() {
 /* NIVEAU 1 */
 
 void theure() {
-	g_vj = ord(g_s._heure);
-	g_vh = g_vj % 48;
-	g_vj /= 48;
-	g_vm__ = g_vh % 2;
-	g_vh /= 2;
-	g_hour = g_vh;
-	if (g_vm__ == 1)
-		g_minute = 30;
+	int fullHour = ord(g_s._fullHour);
+	int tmpHour = fullHour % 48;
+	g_vm->_currDay = fullHour / 48;
+	g_vm->_currHalfHour = tmpHour % 2;
+	g_vm->_currHour = tmpHour / 2;
+	g_vm->_hour = g_vm->_currHour;
+	if (g_vm->_currHalfHour == 1)
+		g_vm->_minute = 30;
 	else
-		g_minute = 0;
+		g_vm->_minute = 0;
 }
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index da1f447..4b3dd9d 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -36,6 +36,12 @@ namespace Mortevielle {
 const int kTime1 = 410;
 const int kTime2 = 250;
 
+static const int _actionMenu[12] = { OPCODE_NONE,
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
+};
+
 /* NIVEAU 15 */
 extern void copcha();
 extern bool isMouseIn(rectangle r);
@@ -51,20 +57,15 @@ extern int readclock();
 extern void modif(int &nu);
 extern void dessine(int ad, int x, int y);
 extern void drawRightFrame();
-extern void setTextColor(int c);
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
 extern void initouv();
-extern void ecrf1();
 extern void clearScreenType1();
 extern void clearScreenType2();
 extern void clearScreenType3();
 extern void clearScreenType10();
-extern void ecrf2();
 extern void ecr2(Common::String str_);
 extern void ecr3(Common::String text);
-extern void ecrf6();
-extern void ecrf7();
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
 extern void updateHour(int &day, int &hour, int &minute);
@@ -90,16 +91,9 @@ extern int t11(int roomId);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
 extern void aniof(int ouf, int num);
-extern void musique(int so);
 /* NIVEAU 9 */
 extern void dessin(int ad);
 
-static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
-};
-
 extern void tinke();
 extern void fenat(char ans);
 /* NIVEAU 8 */
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 57de236..3422767 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -145,6 +145,12 @@ public:
 	int _place;
 	int _manorDistance;
 	int _currBitIndex;
+	int _currDay;
+	int _currHour;
+	int _currHalfHour;
+	int _day;
+	int _hour;
+	int _minute;
 
 
 	int _c_zzz;
@@ -270,6 +276,12 @@ public:
 	void loseGame();
 	void floodedInWell();
 	void displayDiningRoom();
+	void startMusicOrSpeech(int so);
+	void setTextColor(int col);
+	void prepareScreenType1();
+	void prepareScreenType2();
+	void prepareScreenType3();
+
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 4113ff0..f6a3def 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -65,7 +65,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(g_s1._purpleRoomObjectId);
 	sz.syncAsSint16LE(g_s1._cryptObjectId);
 	sz.syncAsByte(g_s1._alreadyEnteredManor);
-	sz.syncAsByte(g_s1._heure);
+	sz.syncAsByte(g_s1._fullHour);
 
 	sz.syncBytes(g_bufcha, 391);
 }
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9b48ed3..58f4956 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -81,18 +81,12 @@ const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 int g_x,
         g_y,
         g_t,
-        g_vj,
-        g_vh,
-        g_vm__,
         g_jh,
         g_mh,
         g_cs,
         g_hdb,
         g_hfb,
-        g_hour,
-        g_day,
         g_key,
-        g_minute,
         g_num,
         g_res,
         g_ment,
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 22ec5cc..c9f6ed7 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -128,7 +128,7 @@ struct sav_chaine {
 	int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId;
 	int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId;
 	bool _alreadyEnteredManor;
-	byte _heure;
+	byte _fullHour;
 };
 
 struct registres {
@@ -186,18 +186,12 @@ enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCU
 extern int g_x,
         g_y,
         g_t,
-        g_vj,
-        g_vh,
-        g_vm__,
         g_jh,
         g_mh,
         g_cs,
         g_hdb,
         g_hfb,
-        g_hour,
-        g_day,
         g_key,
-        g_minute,
         g_num,
         g_res,
         g_ment,


Commit: c989aa0df1b0139e674a0e41a126d250388e6431
    https://github.com/scummvm/scummvm/commit/c989aa0df1b0139e674a0e41a126d250388e6431
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:26-07:00

Commit Message:
MORTEVIELLE: Remove dead code related to messint (display of loading message between rooms)

Changed paths:
    engines/mortevielle/mor.cpp



diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 8a8ef56..526ac4b 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -453,12 +453,8 @@ void modobj(int m) {
 }
 
 void repon(int f, int m) {
-	Common::String str_;
-	Common::String str1;
-	Common::String tmpStr;
-
 	if ((m > 499) && (m < 563)) {
-		tmpStr = deline(m - 501 + kInventoryStringIndex);
+		Common::String tmpStr = deline(m - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
 			g_vm->_largestClearScreen = true;
@@ -489,7 +485,7 @@ void repon(int f, int m) {
 			else
 				i = 5;
 
-			tmpStr = deline(m);
+			Common::String tmpStr = deline(m);
 			displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
@@ -497,25 +493,6 @@ void repon(int f, int m) {
 
 			if (m == 179)
 				g_s._pourc[10] = '*';
-		} else if (f == 7) {         /* messint */
-			g_vm->prepareScreenType3();
-			tmpStr = deline(m);
-
-			int xSmallStr, xLargeStr, dx;
-			if (g_res == 1) {
-				xSmallStr = 252 - tmpStr.size() * 5;
-				xLargeStr = 100;
-				dx = 80;
-			} else {
-				xSmallStr = 252 - tmpStr.size() * 3;
-				xLargeStr = 144;
-				dx = 50;
-			}
-
-			if (tmpStr.size() < 40)
-				displayStr(tmpStr, xSmallStr, 86, dx, 3, 5);
-			else
-				displayStr(tmpStr, xLargeStr, 86, dx, 3, 5);
 		}
 	}
 }


Commit: bd5aa76c804fb84f79b524dbe1b4d5a78c3196a0
    https://github.com/scummvm/scummvm/commit/bd5aa76c804fb84f79b524dbe1b4d5a78c3196a0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:28-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/saveload.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index c78c3a6..944ac9f 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -45,7 +45,7 @@ void MortevielleEngine::fctMove() {
 	if ((g_s._currPlace == ROOM26) && (g_msg[4] == _menu._moveMenu[6])) {
 		g_s._currPlace = LANDING;
 		g_caff = g_s._currPlace;
-		afdes(0);
+		afdes();
 		repon(2, g_s._currPlace);
 	}
 	if ((g_s._currPlace == LANDING) && (g_msg[4] == _menu._moveMenu[6])) {
@@ -1156,7 +1156,7 @@ void MortevielleEngine::fctEnter() {
 				if (g_ment == 9) {
 					_col = true;
 					g_caff = 70;
-					afdes(0);
+					afdes();
 					repon(2, g_caff);
 				} else
 					_col = false;
@@ -1194,7 +1194,7 @@ void MortevielleEngine::fctSleep() {
 		tsort();
 		g_s._currPlace = OWN_ROOM;
 		affrep();
-		afdes(0);
+		afdes();
 		debloc(g_s._currPlace);
 		_menu.setDestinationMenuText(g_s._currPlace);
 	}
@@ -1351,7 +1351,7 @@ void MortevielleEngine::fctDiscuss() {
 			++cx;
 		} while (_menu._discussMenu[cx] != g_msg[4]);
 		g_caff = 69 + cx;
-		afdes(0);
+		afdes();
 		repon(2, g_caff);
 		suj = g_caff + 60;
 	}
@@ -1586,7 +1586,7 @@ void MortevielleEngine::endGame() {
 	repon(2, 142);
 	tkey1(false);
 	g_caff = 32;
-	afdes(0);
+	afdes();
 	repon(6, 34);
 	repon(2, 35);
 	startMusicOrSpeech(0);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index eabeae2..dbbd8c5 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -56,8 +56,8 @@ int Alert::show(const Common::String &msg, int n) {
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 	int do_alert_result;
 	hideMouse();
-	while (keypressed())
-		dumi = get_ch();	// input >> kbd >> dumi;
+	while (g_vm->keyPressed())
+		dumi = g_vm->getChar();
 
 	g_vm->setMouseClick(false);
 	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index faf4719..71ab0c1 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -33,13 +33,13 @@
 namespace Mortevielle {
 
 char readkey1() {
-	char c = get_ch();
+	char c = g_vm->getChar();
 
 	return c;
 }
 
 int testou() {
-	char ch = get_ch();
+	char ch = g_vm->getChar();
 
 	switch (ch)  {
 	case '\23' :
@@ -54,8 +54,8 @@ int testou() {
 		}
 		break;
 	case '\33' :
-		if (keypressed())
-			ch = get_ch();
+		if (g_vm->keyPressed())
+			ch = g_vm->getChar();
 		break;
 	default:
 		break;
@@ -65,7 +65,7 @@ int testou() {
 }
 
 void teskbd() {
-	if (keypressed())
+	if (g_vm->keyPressed())
 		testou();
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 526ac4b..5bba9c5 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -420,17 +420,17 @@ void paint_rect(int x, int y, int dx, int dy) {
  * Engine function - Update hour
  * @remarks	Originally called 'calch'
  */
-void updateHour(int &day, int &hour, int &minute) {
+void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
 	int newHour = readclock();
 	int th = g_jh + ((newHour - g_mh) / g_t);
-	minute = ((th % 2) + g_vm->_currHalfHour) * 30;
-	hour = ((uint)th >> 1) + g_vm->_currHour;
+	minute = ((th % 2) + _currHalfHour) * 30;
+	hour = ((uint)th >> 1) + _currHour;
 	if (minute == 60) {
 		minute = 0;
 		++hour;
 	}
-	day = (hour / 24) + g_vm->_currDay;
-	hour = hour - ((day - g_vm->_currDay) * 24);
+	day = (hour / 24) + _currDay;
+	hour = hour - ((day - _currDay) * 24);
 }
 
 /**
@@ -465,7 +465,9 @@ void repon(int f, int m) {
 		displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
-		if ((f == 2) || (f == 8)) {
+		switch (f) {
+		case 2:
+		case 8:
 			clearScreenType2();
 			g_vm->prepareScreenType2();
 			text1(8, 182, 103, m);
@@ -478,7 +480,10 @@ void repon(int f, int m) {
 					g_s._teauto[38] = '*';
 				}
 			}
-		} else if ((f == 1) || (f == 6) || (f == 9)) {
+			break;
+		case 1:
+		case 6:
+		case 9: {
 			int i;
 			if ((f == 1) || (f == 6))
 				i = 4;
@@ -490,9 +495,12 @@ void repon(int f, int m) {
 
 			if (m == 180)
 				g_s._pourc[6] = '*';
-
-			if (m == 179)
+			else if (m == 179)
 				g_s._pourc[10] = '*';
+			}
+			break;
+		default:
+			break;
 		}
 	}
 }
@@ -1132,7 +1140,7 @@ int MortevielleEngine::setPresenceChapel(int hour) {
  * Engine function - Get the answer after you known a door
  * @remarks	Originally called 'frap'
  */
-void getKnockAnswer() {
+void MortevielleEngine::getKnockAnswer() {
 	int day, hour, minute;
 
 	updateHour(day, hour, minute);
@@ -1711,7 +1719,7 @@ void tinke() {
 	Common::String stpo;
 
 	g_vm->_anyone = false;
-	updateHour(day, hour, minute);
+	g_vm->updateHour(day, hour, minute);
 	if (day != g_vm->_day) {
 		g_vm->_day = day;
 		int i = 0;
@@ -1737,18 +1745,18 @@ void tinke() {
 		else
 			stpo = chr(cf + 48);
 
-		g_hintPctMessage = Common::String(d3);
-		g_hintPctMessage += d5;
-		g_hintPctMessage += d4;
-		g_hintPctMessage += d3;
-		g_hintPctMessage += d1;
-		g_hintPctMessage += stpo;
-		g_hintPctMessage += '0';
-		g_hintPctMessage += d2;
-		g_hintPctMessage += d4;
-		g_hintPctMessage += d3;
-		g_hintPctMessage += d6;
-		g_hintPctMessage += d4;
+		g_vm->_hintPctMessage = Common::String(d3);
+		g_vm->_hintPctMessage += d5;
+		g_vm->_hintPctMessage += d4;
+		g_vm->_hintPctMessage += d3;
+		g_vm->_hintPctMessage += d1;
+		g_vm->_hintPctMessage += stpo;
+		g_vm->_hintPctMessage += '0';
+		g_vm->_hintPctMessage += d2;
+		g_vm->_hintPctMessage += d4;
+		g_vm->_hintPctMessage += d3;
+		g_vm->_hintPctMessage += d6;
+		g_vm->_hintPctMessage += d4;
 	}
 	if (minute > g_vm->_minute) {
 		g_vm->_minute = 30;
@@ -1869,9 +1877,9 @@ void fenat(char ans) {
 
 
 /* NIVEAU 8 */
-void afdes(int ad) {
+void afdes() {
 	taffich();
-	dessin(ad);
+	dessin(0);
 	g_vm->_okdes = false;
 }
 
@@ -1883,18 +1891,18 @@ void tkey1(bool d) {
 	fenat('K');
 
 	// Wait for release from any key or mouse button
-	while (keypressed())
+	while (g_vm->keyPressed())
 		g_key = testou();
 	do {
 		getMousePos_(x, y, c);
-		keypressed();
+		g_vm->keyPressed();
 	} while (c != 0);
 	
 	// Event loop
 	do {
 		if (d)
 			tinke();
-		quest = keypressed();
+		quest = g_vm->keyPressed();
 		getMousePos_(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
@@ -1907,7 +1915,7 @@ void tkey1(bool d) {
 /* NIVEAU 7 */
 void tlu(int af, int ob) {
 	g_caff = 32;
-	afdes(0);
+	afdes();
 	repon(6, ob + 4000);
 	repon(2, 999);
 	tkey1(true);
@@ -2125,7 +2133,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		_currBitIndex = 255; // Everybody is present
 		showPeoplePresent(_currBitIndex);
 		g_caff = 77;
-		afdes(0);
+		afdes();
 		_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
 		tkey1(false);
@@ -2298,7 +2306,7 @@ void tfleche() {
 		} while (!(qust || inRect || g_vm->_anyone));
 
 		if (qust && (touch == '\103'))
-			Alert::show(g_hintPctMessage, 1);
+			Alert::show(g_vm->_hintPctMessage, 1);
 	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect)));
 
 	if (touch == '\73')
@@ -2390,7 +2398,7 @@ void treg(int ob) {
 	g_caff = ob;
 
 	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
-		afdes(0);
+		afdes();
 		if ((g_caff > 29) && (g_caff < 33))
 			repon(2, g_caff);
 		else
@@ -2459,25 +2467,25 @@ void aldepl() {
  * Engine function - Change Graphical Device
  * @remarks	Originally called 'change_gd'
  */
-void changeGraphicalDevice(int newDevice) {
+void MortevielleEngine::changeGraphicalDevice(int newDevice) {
 	hideMouse();
-	g_vm->_currGraphicalDevice = newDevice;
+	_currGraphicalDevice = newDevice;
 	hirs();
 	initMouse();
 	showMouse();
 	drawRightFrame();
 	tinke();
 	drawClock();
-	if (g_vm->_currBitIndex != 0)
-		g_vm->showPeoplePresent(g_vm->_currBitIndex);
+	if (_currBitIndex != 0)
+		showPeoplePresent(_currBitIndex);
 	else
-		g_vm->displayAloneText();
+		displayAloneText();
 	clearScreenType2();
 	clearScreenType3();
 	g_maff = 68;
-	afdes(0);
+	afdes();
 	repon(2, g_crep);
-	g_vm->_menu.displayMenu();
+	_menu.displayMenu();
 }
 
 /**
@@ -2512,7 +2520,7 @@ void MortevielleEngine::gameLoaded() {
 	g_iouv = 0;
 	g_dobj = 0;
 	affrep();
-	g_hintPctMessage = deline(580);
+	_hintPctMessage = deline(580);
 
 	_okdes = false;
 	_endGame = true;
@@ -2522,7 +2530,7 @@ void MortevielleEngine::gameLoaded() {
 	displayAloneText();
 	tinke();
 	drawClock();
-	afdes(0);
+	afdes();
 	repon(2, g_crep);
 	clearScreenType3();
 	_endGame = false;
@@ -2533,20 +2541,6 @@ void MortevielleEngine::gameLoaded() {
 	showMouse();
 }
 
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-void tmaj3() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if (minute == 30)
-		minute = 1;
-	hour += day * 24;
-	minute += hour * 2;
-	g_s._fullHour = chr(minute);
-}
-
 /**
  * Engine function - Handle OpCodes
  * @remarks	Originally called 'tsitu'
@@ -2655,9 +2649,26 @@ void MortevielleEngine::handleOpcode() {
 	mennor();
 }
 
-/* NIVEAU 1 */
+/**
+ * Engine function - Transform time into a char
+ * @remarks	Originally called 'tmaj3'
+ */
+void MortevielleEngine::hourToChar() {
+	int day, hour, minute;
+
+	g_vm->updateHour(day, hour, minute);
+	if (minute == 30)
+		minute = 1;
+	hour += day * 24;
+	minute += hour * 2;
+	g_s._fullHour = chr(minute);
+}
 
-void theure() {
+/**
+ * Engine function - extract time from a char
+ * @remarks	Originally called 'theure'
+ */
+void MortevielleEngine::charToHour() {
 	int fullHour = ord(g_s._fullHour);
 	int tmpHour = fullHour % 48;
 	g_vm->_currDay = fullHour / 48;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 4b3dd9d..528039c 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -68,7 +68,6 @@ extern void ecr2(Common::String str_);
 extern void ecr3(Common::String text);
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
-extern void updateHour(int &day, int &hour, int &minute);
 extern int convertCharacterIndexToBitIndex(int characterIndex);
 /* NIVEAU 12 */
 extern void modobj(int m);
@@ -79,7 +78,6 @@ extern void drawClock();
  * NIVEAU 11 *
  *************/
 extern void debloc(int roomId);
-extern void getKnockAnswer();
 extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int roomId);
 extern void becfren(int roomId);
@@ -97,7 +95,7 @@ extern void dessin(int ad);
 extern void tinke();
 extern void fenat(char ans);
 /* NIVEAU 8 */
-extern void afdes(int ad);
+extern void afdes();
 extern void tkey1(bool d);
 /* NIVEAU 7 */
 extern void tlu(int af, int ob);
@@ -128,13 +126,5 @@ extern void maivid();
 extern void st13(int ob);
 extern void aldepl();
 
-extern void changeGraphicalDevice(int newDevice);
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-extern void tmaj3();
-
-/* NIVEAU 1 */
-extern void theure();
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6e7726b..3667a13 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -164,7 +164,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	g_hintPctMessage = deline(580);  // You should have noticed %d hints
+	_hintPctMessage = deline(580);  // You should have noticed %d hints
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
@@ -287,6 +287,11 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataTyp
 	assert(dataSize == 0);
 }
 
+/**
+ * Check is a key was pressed
+ * It also delays the engine and check if the screen has to be updated
+ * @remarks	Originally called 'keypressed'
+ */
 bool MortevielleEngine::keyPressed() {
 	// Check for any pending key presses
 	handleEvents();
@@ -305,10 +310,14 @@ bool MortevielleEngine::keyPressed() {
 	return !_keypresses.empty(); 
 }
 
+/**
+ * Wait for a keypress
+ * @remarks	Originally called 'get_ch'
+ */
 int MortevielleEngine::getChar() {
 	// If there isn't any pending keypress, wait until there is
 	while (!shouldQuit() && _keypresses.empty()) {
-		keypressed();
+		keyPressed();
 	}
 
 	// Return the top keypress
@@ -496,7 +505,7 @@ Common::Error MortevielleEngine::run() {
 
 	// Either load the initial game state savegame, or the specified savegame number
 	adzon();
-	_savegameManager.takesav(loadSlot);
+	_savegameManager.loadSavegame(loadSlot);
 
 	// Run the main game loop
 	mainGame();
@@ -537,7 +546,7 @@ void MortevielleEngine::mainGame() {
 	loadBRUIT5();
 	_menu.initMenu();
 
-	theure();
+	charToHour();
 	initGame();
 	hirs();
 	drawRightFrame();
@@ -613,7 +622,7 @@ void MortevielleEngine::handleAction() {
 		if (_menu._menuSelected && (g_msg[3] == MENU_LOAD))
 			_savegameManager.loadGame((g_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
-			temps = Alert::show(g_hintPctMessage, 1);
+			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
@@ -629,7 +638,7 @@ void MortevielleEngine::handleAction() {
 	}
 	if (inkey == '\73') {
 		_quitGame = true;
-		tmaj3();
+		hourToChar();
 	} else {
 		if ((funct) && (inkey != '\77'))
 			return;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 3422767..aeaf5e2 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -112,6 +112,8 @@ private:
 	void playGame();
 	void handleAction();
 public:
+	Common::String _hintPctMessage;
+
 	bool _roomPresenceLuc;
 	bool _roomPresenceIda;
 	bool _purpleRoomPresenceLeo;
@@ -281,6 +283,12 @@ public:
 	void prepareScreenType1();
 	void prepareScreenType2();
 	void prepareScreenType3();
+	void updateHour(int &day, int &hour, int &minute);
+	void getKnockAnswer();
+	void charToHour();
+	void hourToChar();
+
+	void changeGraphicalDevice(int newDevice);
 
 };
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 2eec6ab..401a2b3 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -296,7 +296,7 @@ void moveMouse(bool &funct, char &key) {
 	// Set defaults and check pending events
 	funct = false;
 	key = '\377';
-	p_key = keypressed();
+	p_key = g_vm->keyPressed();
 
 	// If mouse button clicked, return it
 	if (g_vm->getMouseClick())
@@ -306,7 +306,7 @@ void moveMouse(bool &funct, char &key) {
 	while (p_key) {
 		CHECK_QUIT;
 
-		in1 = get_ch();
+		in1 = g_vm->getChar();
 		getMousePos_(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4':
@@ -347,10 +347,10 @@ void moveMouse(bool &funct, char &key) {
 			return;
 			break;
 		case '\33':
-			p_key = keypressed();
+			p_key = g_vm->keyPressed();
 
 			if (p_key) {
-				in2 = get_ch();
+				in2 = g_vm->getChar();
 
 				if ((in2 >= ';') && (in2 <= 'D')) {
 					funct = true;
@@ -439,7 +439,7 @@ void moveMouse(bool &funct, char &key) {
 		}
 
 		setMousePos(cx, cy);
-		p_key = keypressed();
+		p_key = g_vm->keyPressed();
 	}
 }
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 45cbb1b..c93107c 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -211,7 +211,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 				xc = x;
 				yc += 6;
 				if (yc > yf) {
-					while (!keypressed())
+					while (!g_vm->keyPressed())
 						;
 					i = y;
 					do {
@@ -303,7 +303,6 @@ void taffich() {
 	int32 lgt;
 	int alllum[16];
 
-
 	int a = g_caff;
 	if ((a >= 153) && (a <= 161))
 		a = tran2[a - 153];
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 9605adc..9b0f72c 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -158,13 +158,13 @@ void music() {
 	bool fin = false;
 	int k = 0;
 	do {
-		fin = keypressed();
+		fin = g_vm->keyPressed();
 		g_vm->_soundManager.musyc(g_tbi, 9958, kTempoMusic);
 		++k;
-		fin = fin | keypressed() | (k >= 5);
+		fin = fin | g_vm->keyPressed() | (k >= 5);
 	} while (!fin);
-	while (keypressed())
-		get_ch();	// input >> kbd >> ch;
+	while (g_vm->keyPressed())
+		g_vm->getChar();
 }
 
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index f6a3def..d054308 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -72,11 +72,9 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 
 /**
  * Inner code for loading a saved game
+ * @remarks	Originally called 'takesav'
  */
-void SavegameManager::takesav(int n) {
-	int i;
-	Common::String st;
-
+void SavegameManager::loadSavegame(int n) {
 	// -- Load the file
 	Common::String filename = generateSaveName(n);
 
@@ -110,7 +108,7 @@ void SavegameManager::takesav(int n) {
 	sync_save(sz);
 
 	g_s = g_s1;
-	for (i = 0; i <= 389; ++i)
+	for (int i = 0; i <= 389; ++i)
 		g_tabdon[i + acha] = g_bufcha[i];
 
 	// Close the stream
@@ -123,10 +121,10 @@ void SavegameManager::takesav(int n) {
 Common::Error SavegameManager::loadGame(int n) {
 	hideMouse();
 	maivid();
-	takesav(n);
+	loadSavegame(n);
 	
 	/* Initialization */
-	theure();
+	g_vm->charToHour();
 	g_vm->initGame();
 	g_vm->gameLoaded();
 	showMouse();
@@ -141,7 +139,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	int i;
 
 	hideMouse();
-	tmaj3();
+	g_vm->hourToChar();
 	
 	for (i = 0; i <= 389; ++i)
 		g_bufcha[i] = g_tabdon[i + acha];
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index 7f2edd8..c1c3c80 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -51,7 +51,7 @@ class SavegameManager {
 private:
 	void sync_save(Common::Serializer &sz);
 public:
-	void takesav(int n);
+	void loadSavegame(int n);
 	Common::Error loadGame(int n);
 	Common::Error saveGame(int n, const Common::String &saveName);
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 58f4956..495487c 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -115,8 +115,6 @@ int g_x,
 
 int g_t_cph[6401];
 byte g_tabdon[4001];
-
-Common::String g_hintPctMessage;               // Provides the % of hints
 byte g_is;
 
 int g_nbrep[9];
@@ -190,13 +188,6 @@ int getRandomNumber(int minval, int maxval) {
 	return g_vm->_randomSource.getRandomNumber(maxval - minval) + minval;
 }
 
-bool keypressed() {
-	return g_vm->keyPressed();
-}
-char get_ch() {
-	return g_vm->getChar();
-}
-
 /**
  * Restore a screen sectio
  */
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index c9f6ed7..19bde40 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -221,7 +221,6 @@ extern int g_x,
 extern int g_t_cph[6401]; // Speech
 extern byte g_tabdon[4001];
 
-extern Common::String g_hintPctMessage;      // gives the pct of hints found
 extern byte g_is;
 
 extern int g_nbrep[9];
@@ -264,17 +263,11 @@ extern byte g_mem[65536 * 16];
 
 #define hires {}
 
-// Stubs for input functions
-extern bool keypressed();
-extern char get_ch();
-
 extern void palette(int v1);
 extern void intr(int intNum, registres &regs);
 extern int getRandomNumber(int minval, int maxval);
 
-// (* external 'c:\mc\charecr.com'; *)
 extern void s_char(int Gd, int y, int dy);
-// (* external 'c:\mc\sauvecr.com'; *)
 extern void s_sauv(int Gd, int y, int dy);
 
 } // End of namespace Mortevielle


Commit: 6774c15896455fa84cf78b02f78adc7e9c8daacc
    https://github.com/scummvm/scummvm/commit/6774c15896455fa84cf78b02f78adc7e9c8daacc
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:30-07:00

Commit Message:
MORTEVIELLE: Some more renaming, introduce MouseHandler

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 944ac9f..7949d93 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -700,12 +700,12 @@ void MortevielleEngine::fctPlace() {
 						Alert::show(alertTxt, 1);
 
 						bool enterPassageFl = KnowledgeCheck::show();
-						hideMouse();
+						_mouse.hideMouse();
 						hirs();
 						drawRightFrame();
 						clearScreenType2();
 						clearScreenType3();
-						showMouse();
+						_mouse.showMouse();
 						tinke();
 						drawClock();
 						if (_currBitIndex != 0)
@@ -1357,10 +1357,10 @@ void MortevielleEngine::fctDiscuss() {
 	}
 	tkey1(false);
 	mennor();
-	hideMouse();
+	_mouse.hideMouse();
 	hirs();
 	premtet();
-	sparl(0, suj);
+	startDialog(suj);
 	hirs();
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
@@ -1371,7 +1371,7 @@ void MortevielleEngine::fctDiscuss() {
 	}
 	lib[46] = lib[45];
 	lib[45] = ' ';
-	showMouse();
+	_mouse.showMouse();
 	do {
 		choi = 0;
 		icm = 0;
@@ -1397,10 +1397,10 @@ void MortevielleEngine::fctDiscuss() {
 		writetp(lib[46], 0);
 		tou = '\0';
 		do {
-			moveMouse(f, tou);
+			_mouse.moveMouse(f, tou);
 			CHECK_QUIT;
 
-			getMousePos_(x, y, c);
+			_mouse.getMousePos_(x, y, c);
 			x *= (3 - g_res);
 			if (x > 319)
 				cx = 41;
@@ -1482,11 +1482,11 @@ void MortevielleEngine::fctDiscuss() {
 				g_s._faithScore += 3;
 				suj = 139;
 			}
-			hideMouse();
+			_mouse.hideMouse();
 			hirs();
 			premtet();
-			sparl(0, suj);
-			showMouse();
+			startDialog(suj);
+			_mouse.showMouse();
 			if ((suj == 84) || (suj == 86)) {
 				g_s._pourc[5] = '*';
 				g_s._teauto[7] = '*';
@@ -1500,26 +1500,26 @@ void MortevielleEngine::fctDiscuss() {
 				g_s._pourc[8] = '*';
 				g_s._teauto[32] = '*';
 			}
-			hideMouse();
+			_mouse.hideMouse();
 			hirs();
-			showMouse();
+			_mouse.showMouse();
 		}
 	} while ((choi != 46) && (suj != 138));
 	if (_col) {
 		g_s._faithScore += (3 * (g_s._faithScore / 10));
-		hideMouse();
+		_mouse.hideMouse();
 		hirs();
 		premtet();
-		sparl(0, 138);
-		showMouse();
+		startDialog(138);
+		_mouse.showMouse();
 		_col = false;
 		g_s._currPlace = LANDING;
 	}
 	g_ctrm = 0;
-	hideMouse();
+	_mouse.hideMouse();
 	hirs();
 	drawRightFrame();
-	showMouse();
+	_mouse.showMouse();
 	showPeoplePresent(_currBitIndex);
 	tinke();
 	drawClock();
@@ -1574,13 +1574,13 @@ void MortevielleEngine::endGame() {
 	clearScreenType3();
 	repon(9, 1509);
 	tkey1(false);
-	hideMouse();
+	_mouse.hideMouse();
 	g_caff = 70;
 	taffich();
 	hirs();
 	premtet();
-	sparl(0, 141);
-	showMouse();
+	startDialog(141);
+	_mouse.showMouse();
 	clearScreenType1();
 	repon(9, 1509);
 	repon(2, 142);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index dbbd8c5..f1faee0 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -44,7 +44,6 @@ int Alert::show(const Common::String &msg, int n) {
 	int coldep, esp, i, caseNumb, quoi, ix;
 	Common::String st, chaine;
 	int limit[3][3];
-	char dumi;
 	Common::String s[3];
 	int cx, cy, nbcol, lignNumb;
 	bool newaff, test, test1, test2, test3, dum;
@@ -55,9 +54,9 @@ int Alert::show(const Common::String &msg, int n) {
 
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 	int do_alert_result;
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	while (g_vm->keyPressed())
-		dumi = g_vm->getChar();
+		g_vm->getChar();
 
 	g_vm->setMouseClick(false);
 	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
@@ -101,16 +100,16 @@ int Alert::show(const Common::String &msg, int n) {
 		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
-	showMouse();
+	g_vm->_mouse.showMouse();
 	quoi = 0;
 	dum = false;
 	do {
-		dumi = '\377';
-		moveMouse(dum, dumi);
+		char dummyKey = '\377';
+		g_vm->_mouse.moveMouse(dum, dummyKey);
 		CHECK_QUIT0;
 
-		cx = x_s;
-		cy = y_s;
+		cx = g_vm->_mouse.x_s;
+		cy = g_vm->_mouse.y_s;
 		test = (cy > 95) && (cy < 105);
 		newaff = false;
 		if (test) {
@@ -125,7 +124,7 @@ int Alert::show(const Common::String &msg, int n) {
 				else
 					ix = 2;
 				if (ix != quoi) {
-					hideMouse();
+					g_vm->_mouse.hideMouse();
 					if (quoi != 0) {
 						setPosition(quoi, coldep, esp);
 
@@ -142,12 +141,12 @@ int Alert::show(const Common::String &msg, int n) {
 					g_vm->_screenSurface.drawString(tmp2, 1);
 
 					quoi = ix;
-					showMouse();
+					g_vm->_mouse.showMouse();
 				}
 			}
 		}
 		if ((quoi != 0) && ! newaff) {
-			hideMouse();
+			g_vm->_mouse.hideMouse();
 			setPosition(quoi, coldep, esp);
 
 			Common::String tmp3(" ");
@@ -156,13 +155,13 @@ int Alert::show(const Common::String &msg, int n) {
 			g_vm->_screenSurface.drawString(tmp3, 0);
 
 			quoi = 0;
-			showMouse();
+			g_vm->_mouse.showMouse();
 		}
 		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
 		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
 	} while (!g_vm->getMouseClick());
 	g_vm->setMouseClick(false);
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	if (!test3)  {
 		quoi = n;
 		setPosition(n, coldep, esp);
@@ -172,7 +171,7 @@ int Alert::show(const Common::String &msg, int n) {
 		g_vm->_screenSurface.drawString(tmp4, 1);
 	}
 	charecr(50, (NUM_LINES + 1) << 4);
-	showMouse();
+	g_vm->_mouse.showMouse();
 
 	/* Restore the background area */
 	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
@@ -299,9 +298,9 @@ bool KnowledgeCheck::show() {
 	int correctCount = 0;
 
 	for (int indx = 0; indx < 10; ++indx) {
-		hideMouse();
+		g_vm->_mouse.hideMouse();
 		hirs();
-		showMouse();
+		g_vm->_mouse.showMouse();
 		int dialogHeight;
 		if (g_res == 1)
 			dialogHeight = 29;
@@ -355,11 +354,11 @@ bool KnowledgeCheck::show() {
 		do {
 			g_vm->setMouseClick(false);
 			bool flag;
-			moveMouse(flag, key);
+			g_vm->_mouse.moveMouse(flag, key);
 			CHECK_QUIT0;
 
 			currChoice = 1;
-			while (coor[currChoice]._enabled && !isMouseIn(coor[currChoice]))
+			while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]))
 				++currChoice;
 			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
@@ -425,7 +424,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
 		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
-		waitForF3F8(g_key);
+		g_key = waitForF3F8();
 		CHECK_QUIT;
 
 		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
@@ -440,11 +439,16 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
  * Alert function - Loop until F3 or F8 is pressed
  * @remarks	Originally called 'atf3f8'
  */
-void f3f8::waitForF3F8(int &key) {
+int f3f8::waitForF3F8() {
+	int key;
+
 	do {
 		key = testou();
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return key;
 	} while ((key != 61) && (key != 66));
+
+	return key;
 }
 
 void f3f8::aff50(bool drawAni50Fl) {
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index eaab56d..40109c8 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -54,7 +54,7 @@ class f3f8 {
 public:
 	static void draw();
 	static void checkForF8(int SpeechNum, bool drawAni50Fl);
-	static void waitForF3F8(int &key);
+	static int waitForF3F8();
 	static void aff50(bool drawAni50Fl);
 	static void ani50();
 };
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 1c26a5c..dc63e05 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1056,7 +1056,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	if (l == "")
 		return;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	pt = _textPos;
 
 	if (g_res == 2)
@@ -1094,7 +1094,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 		g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
 		pt.x += i;
 	}
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 /**
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a28df25..3f5db6d 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -169,7 +169,7 @@ void Menu::displayMenu() {
 
 	int pt, x, y, color, msk, num_letr;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * g_res;
@@ -203,7 +203,7 @@ void Menu::displayMenu() {
 		} while (y != 9);
 		col += 48 * g_res;
 	} while (num_letr != 6);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 /**
@@ -310,7 +310,7 @@ void Menu::menuDown(int ii) {
 	// Draw the menu
 	xco = g_menuConstants[ii - 1][0];
 	nb_lig = g_menuConstants[ii - 1][3];
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	sauvecr(10, (g_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (g_res == 1)
@@ -376,7 +376,7 @@ void Menu::menuDown(int ii) {
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
 	} while (cx != nb_lig);
 	_multiTitle = true;
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 /**
@@ -417,8 +417,8 @@ void Menu::mdn() {
 	if (!_menuActive)
 		return;
 
-	int x = x_s;
-	int y = y_s;
+	int x = g_vm->_mouse.x_s;
+	int y = g_vm->_mouse.y_s;
 	if (!g_vm->getMouseClick()) {
 		if ((x == g_xprec) && (y == g_yprec))
 			return;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 5bba9c5..439d925 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -53,20 +53,6 @@ void copcha() {
 	} while (i != acha + 390);
 }
 
-/**
- * Engine function : Is mouse in a given rect?
- * @remarks	Originally called 'dans_rect'
- */
-bool isMouseIn(rectangle r) {
-	int x, y, c;
-
-	getMousePos_(x, y, c);
-	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
-		return true;
-
-	return false;
-}
-
 void outbloc(int n, pattern p, nhom *pal) {
 	int ad = n * 404 + 0xd700;
 
@@ -124,15 +110,15 @@ void pictout(int seg, int dep, int x, int y) {
 }
 
 void sauvecr(int y, int dy) {
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	s_sauv(g_vm->_currGraphicalDevice, y, dy);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 void charecr(int y, int dy) {
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	s_char(g_vm->_currGraphicalDevice, y, dy);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 void adzon() {
@@ -224,10 +210,10 @@ void modif(int &nu) {
 
 
 void dessine(int ad, int x, int y) {
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	writepal(g_numpal);
 	pictout(ad, 0, x, y);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 /**
@@ -239,17 +225,9 @@ void drawRightFrame() {
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 14] = 15;
 	}
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	pictout(0x73a2, 0, 0, 0);
-	showMouse();
-}
-
-/**
- * Set Text Color
- * @remarks	Originally called 'text_color'
- */
-void MortevielleEngine::setTextColor(int col) {
-	_textColor = col;
+	g_vm->_mouse.showMouse();
 }
 
 /* NIVEAU 13 */
@@ -273,77 +251,6 @@ void initouv() {
 		g_touv[cx] = chr(0);
 }
 
-/**
- * Engine function - Clear Screen - Type 1
- * @remarks	Originally called 'clsf1'
- */
-void clearScreenType1() {
-	hideMouse();
-	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
-	showMouse();
-}
-
-/**
- * Engine function - Clear Screen - Type 2
- * @remarks	Originally called 'clsf2'
- */
-void clearScreenType2() {
-	hideMouse();
-	if (g_vm->_largestClearScreen) {
-		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
-		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
-		g_vm->_largestClearScreen = false;
-	} else {
-		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
-		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
-	}
-	showMouse();
-}
-
-/**
- * Engine function - Clear Screen - Type 3
- * @remarks	Originally called 'clsf3'
- */
-void clearScreenType3() {
-	hideMouse();
-	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
-	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
-	showMouse();
-}
-
-/**
- * Engine function - Clear Screen - Type 10
- * @remarks	Originally called 'clsf10'
- */
-void clearScreenType10() {
-	int co, cod;
-	Common::String st;
-
-	hideMouse();
-	if (g_res == 1) {
-		co = 634;
-		cod = 534;
-	} else {
-		co = 600;
-		cod = 544;
-	}
-	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (g_s._faithScore < 33)
-		st = g_vm->getEngineString(S_COOL);
-	else if (g_s._faithScore < 66)
-		st = g_vm->getEngineString(S_LOURDE);
-	else if (g_s._faithScore > 65)
-		st = g_vm->getEngineString(S_MALSAINE);
-	
-	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
-	g_vm->_screenSurface.putxy(co, 92);
-	g_vm->_screenSurface.drawString(st, 4);
-
-	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
-	/* rempli(69,12,32,5,255);*/
-	showMouse();
-}
-
 void ecr2(Common::String str_) {
 	// Some dead code was present in the original: removed
 	g_vm->_screenSurface.putxy(8, 177);
@@ -358,7 +265,7 @@ void ecr2(Common::String str_) {
 		g_vm->_screenSurface.drawString(copy(str_, tlig, tlig << 1), 5);
 	} else {
 		g_vm->_largestClearScreen = true;
-		clearScreenType2();
+		g_vm->clearScreenType2();
 		g_vm->_screenSurface.putxy(8, 176);
 		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
@@ -369,36 +276,11 @@ void ecr2(Common::String str_) {
 }
 
 void ecr3(Common::String text) {
-	clearScreenType3();
+	g_vm->clearScreenType3();
 	g_vm->_screenSurface.putxy(8, 192);
 	g_vm->_screenSurface.drawString(text, 5);
 }
 
-/**
- * Prepare screen - Type 1!
- * @remarks	Originally called 'ecrf1'
- */
-void MortevielleEngine::prepareScreenType1() {
-	// Large drawing
-	_screenSurface.drawBox(0, 11, 512, 163, 15);
-}
-
-/**
- * Prepare room - Type 2!
- * @remarks	Originally called 'ecrf2'
- */
-void MortevielleEngine::prepareScreenType2() {
-	setTextColor(5);
-}
-
-/**
- * Prepare room - Type 3!
- * @remarks	Originally called 'ecrf7'
- */
-void MortevielleEngine::prepareScreenType3() {
-	setTextColor(4);
-}
-
 void stop() {
 	hirs();
 	g_vm->_currGraphicalDevice = MODE_AMSTRAD1512;
@@ -416,31 +298,6 @@ void paint_rect(int x, int y, int dx, int dy) {
 	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
 }
 
-/**
- * Engine function - Update hour
- * @remarks	Originally called 'calch'
- */
-void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
-	int newHour = readclock();
-	int th = g_jh + ((newHour - g_mh) / g_t);
-	minute = ((th % 2) + _currHalfHour) * 30;
-	hour = ((uint)th >> 1) + _currHour;
-	if (minute == 60) {
-		minute = 0;
-		++hour;
-	}
-	day = (hour / 24) + _currDay;
-	hour = hour - ((day - _currDay) * 24);
-}
-
-/**
- * Engine function - Convert character index to bit index
- * @remarks	Originally called 'conv'
- */
-int convertCharacterIndexToBitIndex(int characterIndex) {
-	return 128 >> (characterIndex - 1);
-}
-
 /* NIVEAU 12 */
 void modobj(int m) {
 	Common::String strp = Common::String(' ');
@@ -461,14 +318,14 @@ void repon(int f, int m) {
 		else
 			g_vm->_largestClearScreen = false;
 
-		clearScreenType2();
+		g_vm->clearScreenType2();
 		displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
 		switch (f) {
 		case 2:
 		case 8:
-			clearScreenType2();
+			g_vm->clearScreenType2();
 			g_vm->prepareScreenType2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
@@ -505,261 +362,6 @@ void repon(int f, int m) {
 	}
 }
 
-/**
- * Engine function - Reset presence in other rooms
- * @remarks	Originally called 't5'
- */
-void MortevielleEngine::resetPresenceInRooms(int roomId) {
-	if (roomId == DINING_ROOM)
-		_blo = false;
-
-	if (roomId != GREEN_ROOM) {
-		_roomPresenceLuc = false;
-		_roomPresenceIda = false;
-	}
-
-	if (roomId != PURPLE_ROOM)
-		_purpleRoomPresenceLeo = false;
-
-	if (roomId != DARKBLUE_ROOM) {
-		_roomPresenceGuy = false;
-		_roomPresenceEva = false;
-	}
-
-	if (roomId != BLUE_ROOM)
-		_roomPresenceMax = false;
-	if (roomId != RED_ROOM)
-		_roomPresenceBob = false;
-	if (roomId != GREEN_ROOM2)
-		_roomPresencePat = false;
-	if (roomId != TOILETS)
-		_toiletsPresenceBobMax = false;
-	if (roomId != BATHROOM)
-		_bathRoomPresenceBobMax = false;
-	if (roomId != ROOM9)
-		_room9PresenceLeo = false;
-}
-
-/**
- * Engine function - Show the people present in the given room 
- * @remarks	Originally called 'affper'
- */
-void MortevielleEngine::showPeoplePresent(int bitIndex) {
-	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
-
-	for (int i = 1; i <= 8; ++i)
-		_menu.disableMenuItem(_menu._discussMenu[i]);
-
-	clearScreenType10();
-	if ((bitIndex & 128) == 128) {
-		_screenSurface.putxy(xp, 24);
-		_screenSurface.drawString("LEO", 4);
-		_menu.enableMenuItem(_menu._discussMenu[1]);
-	}
-	if ((bitIndex & 64) == 64) {
-		_screenSurface.putxy(xp, 32);
-		_screenSurface.drawString("PAT", 4);
-		_menu.enableMenuItem(_menu._discussMenu[2]);
-	}
-	if ((bitIndex & 32) == 32) {
-		_screenSurface.putxy(xp, 40);
-		_screenSurface.drawString("GUY", 4);
-		_menu.enableMenuItem(_menu._discussMenu[3]);
-	}
-	if ((bitIndex & 16) == 16) {
-		_screenSurface.putxy(xp, 48);
-		_screenSurface.drawString("EVA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[4]);
-	}
-	if ((bitIndex & 8) == 8) {
-		_screenSurface.putxy(xp, 56);
-		_screenSurface.drawString("BOB", 4);
-		_menu.enableMenuItem(_menu._discussMenu[5]);
-	}
-	if ((bitIndex & 4) == 4) {
-		_screenSurface.putxy(xp, 64);
-		_screenSurface.drawString("LUC", 4);
-		_menu.enableMenuItem(_menu._discussMenu[6]);
-	}
-	if ((bitIndex & 2) == 2) {
-		_screenSurface.putxy(xp, 72);
-		_screenSurface.drawString("IDA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[7]);
-	}
-	if ((bitIndex & 1) == 1) {
-		_screenSurface.putxy(xp, 80);
-		_screenSurface.drawString("MAX", 4);
-		_menu.enableMenuItem(_menu._discussMenu[8]);
-	}
-	_currBitIndex = bitIndex;
-}
-
-/**
- * Engine function - Select random characters
- * @remarks	Originally called 'choix'
- */
-int MortevielleEngine::selectCharacters(int min, int max) {
-	bool invertSelection = false;
-	int rand = getRandomNumber(min, max);
-
-	if (rand > 4) {
-		rand = 8 - rand;
-		invertSelection = true;
-	}
-
-	int i = 0;
-	int retVal = 0;
-	while (i < rand) {
-		int charIndex = getRandomNumber(1, 8);
-		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
-		if ((retVal & charBitIndex) != charBitIndex) {
-			++i;
-			retVal |= charBitIndex;
-		}
-	}
-	if (invertSelection)
-		retVal = 255 - retVal;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Green Room
- * @remarks	Originally called 'cpl1'
- */
-int MortevielleEngine::getPresenceStatsGreenRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	// The original uses an || instead of an &&, resulting 
-	// in an always true condition. Based on the other tests, 
-	// and on other scenes, we use an && instead.
-	if ((hour > 7) && (hour < 11))
-		retVal = 25;
-	else if ((hour > 10) && (hour < 14))
-		retVal = 35;
-	else if ((hour > 13) && (hour < 16))
-		retVal = 50;
-	else if ((hour > 15) && (hour < 18))
-		retVal = 5;
-	else if ((hour > 17) && (hour < 22))
-		retVal = 35;
-	else if ((hour > 21) && (hour < 24))
-		retVal = 50;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 70;
-
-	_menu.mdn();
-
-	return retVal;
-}
-/**
- * Engine function - Get Presence Statistics - Purple Room
- * @remarks	Originally called 'cpl2'
- */
-int MortevielleEngine::getPresenceStatsPurpleRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 7) && (hour < 11))
-		retVal = -2;
-	else if (hour == 11)
-		retVal = 100;
-	else if ((hour > 11) && (hour < 23))
-		retVal = 10;
-	else if (hour == 23)
-		retVal = 20;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 50;
-	
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Toilets
- * @remarks	Originally called 'cpl3'
- */
-int MortevielleEngine::getPresenceStatsToilets() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
-		retVal = 34;
-	else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
-		retVal = 0;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Blue Room
- * @remarks	Originally called 'cpl5'
- */
-int MortevielleEngine::getPresenceStatsBlueRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 6) && (hour < 10))
-		retVal = 0;
-	else if (hour == 10)
-		retVal = 100;
-	else if ((hour > 10) && (hour < 24))
-		retVal = 15;
-	else if ((hour >= 0) && (hour < 7))
-		retVal = 50;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Red Room
- * @remarks	Originally called 'cpl6'
- */
-int MortevielleEngine::getPresenceStatsRedRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
-		retVal = -2;
-	else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
-		retVal = 35;
-	else if (hour == 17)
-		retVal = 100;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 60;
-
-	return retVal;
-}
-
-/**
- * Shows the "you are alone" message in the status area
- * on the right hand side of the screen
- * @remarks	Originally called 'person'
- */
-void MortevielleEngine::displayAloneText() {
-	for (int cf = 1; cf <= 8; ++cf)
-		_menu.disableMenuItem(_menu._discussMenu[cf]);
-
-	Common::String sYou = getEngineString(S_YOU);
-	Common::String sAre = getEngineString(S_ARE);
-	Common::String sAlone = getEngineString(S_ALONE);
-
-	clearScreenType10();
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
-	_screenSurface.drawString(sYou, 4);
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
-	_screenSurface.drawString(sAre, 4);
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
-	_screenSurface.drawString(sAlone, 4);
-
-	_currBitIndex = 0;
-}
-
 int chlm() {
 	int retval = getRandomNumber(1, 2);
 	if (retval == 2)
@@ -782,7 +384,7 @@ void drawClock() {
 	const int rg = 9;
 	int h, co;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	
 	paint_rect(570, 118, 20, 10);
 	paint_rect(578, 114, 6, 18);
@@ -803,7 +405,7 @@ void drawClock() {
 		h = 12;
 
 	g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
-	showMouse();
+	g_vm->_mouse.showMouse();
 	g_vm->_screenSurface.putxy(568, 154);
 
 	if (g_vm->_hour > 11)
@@ -832,391 +434,6 @@ void debloc(int roomId) {
 	g_mpers = g_vm->_currBitIndex;
 }
 
-/**
- * Engine function - Get Presence Statistics - Room Bureau
- * @remarks	Originally called 'cpl10'
- */
-int MortevielleEngine::getPresenceStatsDiningRoom(int &hour) {
-	int day, minute;
-
-	int retVal = 0;
-	updateHour(day, hour, minute);
-	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		retVal = 100;
-	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
-		retVal = 45;
-	else if (((hour > 13) && (hour < 17)) || (hour == 18))
-		retVal = 35;
-	else if (hour == 17)
-		retVal = 60;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 5;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Bureau
- * @remarks	Originally called 'cpl11'
- */
-int MortevielleEngine::getPresenceStatsBureau(int &hour) {
-	int day, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
-		retVal = 25;
-	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		retVal = 5;
-	else if ((hour > 13) && (hour < 17))
-		retVal = 55;
-	else if ((hour > 16) && (hour < 19))
-		retVal = 45;
-	else if ((hour >= 0) && (hour < 9))
-		retVal = 0;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Kitchen
- * @remarks	Originally called 'cpl12'
- */
-int MortevielleEngine::getPresenceStatsKitchen() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
-		retVal = 55;
-	else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
-		retVal = 25;
-	else if ((hour >= 0) && (hour < 5))
-		retVal = 0;
-	else if ((hour > 4) && (hour < 9))
-		retVal = 15;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Attic
- * @remarks	Originally called 'cpl13'
- */
-int MortevielleEngine::getPresenceStatsAttic() {
-	return 0;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Landing
- * @remarks	Originally called 'cpl15'
- */
-int MortevielleEngine::getPresenceStatsLanding() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 7) && (hour < 12))
-		retVal = 25;
-	else if ((hour > 11) && (hour < 14))
-		retVal = 0;
-	else if ((hour > 13) && (hour < 18))
-		retVal = 10;
-	else if ((hour > 17) && (hour < 20))
-		retVal = 55;
-	else if ((hour > 19) && (hour < 22))
-		retVal = 5;
-	else if ((hour > 21) && (hour < 24))
-		retVal = 15;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = -15;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Chapel
- * @remarks	Originally called 'cpl20'
- */
-int MortevielleEngine::getPresenceStatsChapel(int &hour) {
-	int day, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (hour == 10)
-		retVal = 65;
-	else if ((hour > 10) && (hour < 21))
-		retVal = 5;
-	else if ((hour > 20) && (hour < 24))
-		retVal = -15;
-	else if ((hour >= 0) && (hour < 5))
-		retVal = -300;
-	else if ((hour > 4) && (hour < 10))
-		retVal = -5;
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Green Room
- * @remarks	Originally called 'quelq1'
- */
-void MortevielleEngine::setPresenceGreenRoom(int roomId) {
-	int rand = getRandomNumber(1, 2);
-	if (roomId == GREEN_ROOM) {
-		if (rand == 1)
-			_roomPresenceLuc = true;
-		else
-			_roomPresenceIda = true;
-	} else if (roomId == DARKBLUE_ROOM) {
-		if (rand == 1)
-			_roomPresenceGuy = true;
-		else
-			_roomPresenceEva = true;
-	}
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Purple Room
- * @remarks	Originally called 'quelq2'
- */
-void MortevielleEngine::setPresencePurpleRoom() {
-	if (_place == PURPLE_ROOM)
-		_purpleRoomPresenceLeo = true;
-	else
-		_room9PresenceLeo = true;
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Blue Room
- * @remarks	Originally called 'quelq5'
- */
-void MortevielleEngine::setPresenceBlueRoom() {
-	_roomPresenceMax = true;
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Red Room
- * @remarks	Originally called 'quelq6'
- */
-void MortevielleEngine::setPresenceRedRoom(int roomId) {
-	if (roomId == RED_ROOM)
-		_roomPresenceBob = true;
-	else if (roomId == GREEN_ROOM2)
-		_roomPresencePat = true;
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Dining Room
- * @remarks	Originally called 'quelq10'
- */
-int MortevielleEngine::setPresenceDiningRoom(int hour) {
-	int retVal = 0;
-
-	if ((hour >= 0) && (hour < 8))
-		retVal = chlm();
-	else {
-		int min = 0, max = 0;
-		if ((hour > 7) && (hour < 10)) {
-			min = 5;
-			max = 7;
-		} else if ((hour > 9) && (hour < 12)) {
-			min = 1;
-			max = 4;
-		} else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
-			min = 6;
-			max = 8;
-		} else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
-			min = 1;
-			max = 5;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Bureau
- * @remarks	Originally called 'quelq11'
- */
-int MortevielleEngine::setPresenceBureau(int hour) {
-	int retVal = 0;
-
-	if ((hour >= 0) && (hour < 8))
-		retVal = chlm();
-	else {
-		int min = 0, max = 0;
-		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
-			min = 1;
-			max = 3;
-		} else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
-			min = 1;
-			max = 4;
-		} else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
-			min = 1;
-			max = 2;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Kitchen
- * @remarks	Originally called 'quelq12'
- */
-int MortevielleEngine::setPresenceKitchen() {
-	int retVal = chlm();
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Landing
- * @remarks	Originally called 'quelq15'
- */
-int MortevielleEngine::setPresenceLanding() {
-	bool test = false;
-	int rand = 0;
-	do {
-		rand = getRandomNumber(1, 8);
-		test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
-		        ((rand == 2) && _roomPresencePat) ||
-		        ((rand == 3) && _roomPresenceGuy) ||
-		        ((rand == 4) && _roomPresenceEva) ||
-		        ((rand == 5) && _roomPresenceBob) ||
-		        ((rand == 6) && _roomPresenceLuc) ||
-		        ((rand == 7) && _roomPresenceIda) ||
-		        ((rand == 8) && _roomPresenceMax));
-	} while (test);
-
-	int retVal = convertCharacterIndexToBitIndex(rand);
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the chapel
- * @remarks	Originally called 'quelq20'
- */
-int MortevielleEngine::setPresenceChapel(int hour) {
-	int retVal = 0;
-
-	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
-		retVal = chlm();
-	else {
-		int min = 0, max = 0;
-		if ((hour > 9) && (hour < 12)) {
-			min = 3;
-			max = 7;
-		} else if ((hour > 11) && (hour < 18)) {
-			min = 1;
-			max = 2;
-		} else if (hour == 18) {
-			min = 2;
-			max = 4;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Get the answer after you known a door
- * @remarks	Originally called 'frap'
- */
-void MortevielleEngine::getKnockAnswer() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if ((hour >= 0) && (hour < 8))
-		g_crep = 190;
-	else {
-		if (getRandomNumber(1, 100) > 70)
-			g_crep = 190;
-		else
-			g_crep = 147;
-	}
-}
-
-/**
- * Engine function - Get Room Presence Bit Index
- * @remarks	Originally called 'nouvp'
- */
-int MortevielleEngine::getPresenceBitIndex(int roomId) {
-	int bitIndex = 0;
-	if (roomId == GREEN_ROOM) {
-		if (_roomPresenceLuc)
-			bitIndex = 4;  // LUC
-		if (_roomPresenceIda)
-			bitIndex = 2;  // IDA
-	} else if ( ((roomId == PURPLE_ROOM) && (_purpleRoomPresenceLeo))
-			 || ((roomId == ROOM9) && (_room9PresenceLeo)))
-		bitIndex = 128;    // LEO
-	else if (roomId == DARKBLUE_ROOM) {
-		if (_roomPresenceGuy)
-			bitIndex = 32; // GUY
-		if (_roomPresenceEva)
-			bitIndex = 16; // EVA
-	} else if ((roomId == BLUE_ROOM) && (_roomPresenceMax))
-		bitIndex = 1;      // MAX
-	else if ((roomId == RED_ROOM) && (_roomPresenceBob))
-		bitIndex = 8;      // BOB
-	else if ((roomId == GREEN_ROOM2) && (_roomPresencePat))
-		bitIndex = 64;     // PAT
-	else if ( ((roomId == TOILETS) && (_toiletsPresenceBobMax))
-		   || ((roomId == BATHROOM) && (_bathRoomPresenceBobMax)) )
-		bitIndex = 9;      // BOB + MAX
-
-	if (bitIndex != 9)
-		showPeoplePresent(bitIndex);
-
-	return bitIndex;
-}
-
-/**
- * Engine function - Convert bit index to character index
- * @remarks	Originally called 'tip'
- */
-int convertBitIndexToCharacterIndex(int bitIndex) {
-	int retVal = 0;
-
-	if (bitIndex == 128)
-		retVal = 1;
-	else if (bitIndex == 64)
-		retVal = 2;
-	else if (bitIndex == 32)
-		retVal = 3;
-	else if (bitIndex == 16)
-		retVal = 4;
-	else if (bitIndex == 8)
-		retVal = 5;
-	else if (bitIndex == 4)
-		retVal = 6;
-	else if (bitIndex == 2)
-		retVal = 7;
-	else if (bitIndex == 1)
-		retVal = 8;
-
-	return retVal;
-}
-
-
 void ecfren(int &p, int &rand, int cf, int roomId) {
 	if (roomId == OWN_ROOM)
 		g_vm->displayAloneText();
@@ -1337,198 +554,6 @@ void resetVariables() {
 	init_nbrepm();
 }
 
-/**
- * Engine function - initGame
- * @remarks	Originally called 'dprog'
- */
-void MortevielleEngine::initGame() {
-	_place = MANOR_FRONT;
-	g_jh = 0;
-	if (!g_s._alreadyEnteredManor)
-		_blo = true;
-	g_t = kTime1;
-	g_mh = readclock();
-}
-
-/**
- * Engine function - Set Random Presence - Green Room
- * @remarks	Originally called 'pl1'
- */
-void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
-	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
-	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
-		int p = getPresenceStatsGreenRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceGreenRoom(_place);
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Purple Room
- * @remarks	Originally called 'pl2'
- */
-void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
-	if (!_purpleRoomPresenceLeo) {
-		int p = getPresenceStatsPurpleRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresencePurpleRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Blue Room
- * @remarks	Originally called 'pl5'
- */
-void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
-	if (!_roomPresenceMax) {
-		int p = getPresenceStatsBlueRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceBlueRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Red Room
- * @remarks	Originally called 'pl6'
- */
-void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
-	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
-	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
-		int p = getPresenceStatsRedRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceRedRoom(_place);
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Room 9
- * @remarks	Originally called 'pl9'
- */
-void MortevielleEngine::setRandomPresenceRoom9(int cf) {
-	if (!_room9PresenceLeo) {
-		cf = -10;
-		int p, rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresencePurpleRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Dining Room
- * @remarks	Originally called 'pl10'
- */
-void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
-	int h, rand;
-	int p = getPresenceStatsDiningRoom(h);
-	phaz(rand, p, cf);
-
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceDiningRoom(h);
-}
-
-/**
- * Engine function - Set Random Presence - Bureau
- * @remarks	Originally called 'pl11'
- */
-void MortevielleEngine::setRandomPresenceBureau(int cf) {
-	int h, rand;
-
-	int p = getPresenceStatsBureau(h);
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceBureau(h);
-}
-
-/**
- * Engine function - Set Random Presence - Kitchen
- * @remarks	Originally called 'pl12'
- */
-void MortevielleEngine::setRandomPresenceKitchen(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsKitchen();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceKitchen();
-}
-
-/**
- * Engine function - Set Random Presence - Attic / Cellar
- * @remarks	Originally called 'pl13'
- */
-void MortevielleEngine::setRandomPresenceAttic(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsAttic();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceKitchen();
-}
-
-/**
- * Engine function - Set Random Presence - Landing
- * @remarks	Originally called 'pl15'
- */
-void MortevielleEngine::setRandomPresenceLanding(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsLanding();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceLanding();
-}
-
-/**
- * Engine function - Set Random Presence - Chapel
- * @remarks	Originally called 'pl20'
- */
-void MortevielleEngine::setRandomPresenceChapel(int cf) {
-	int h, rand;
-
-	int p = getPresenceStatsChapel(h);
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceChapel(h);
-}
-
 int t11(int roomId) {
 	int retVal = 0;
 	int p, rand;
@@ -1593,7 +618,7 @@ void cavegre() {
 	g_s._faithScore += 2;
 	if (g_s._faithScore > 69)
 		g_s._faithScore += (g_s._faithScore / 10);
-	clearScreenType3();
+	g_vm->clearScreenType3();
 	g_vm->prepareScreenType2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
@@ -1602,7 +627,7 @@ void cavegre() {
 	// The original was doing here a useless loop.
 	// It has been removed
 
-	clearScreenType3();
+	g_vm->clearScreenType3();
 	g_vm->displayAloneText();
 }
 
@@ -1636,43 +661,12 @@ void aniof(int ouf, int num) {
 	g_vm->prepareScreenType1();
 }
 
-/**
- * Start music or speech
- * @remarks	Originally called 'musique'
- */
-void MortevielleEngine::startMusicOrSpeech(int so) {
-	if (so == 0) {
-		/* musik(0) */
-		;
-	} else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
-		// Type 1: Speech
-		_speechManager.startSpeech(10, 1, 1);
-		++g_prebru;
-	} else {
-		if (((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
-			// Type 1: Speech
-			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
-		else if ((g_s._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
-			// Type 1: Speech
-			_speechManager.startSpeech(8, 1, 1);
-		else if ((g_s._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
-			// Type 1: Speech
-			_speechManager.startSpeech(12, 1, 1);
-		else if (g_s._currPlace == INSIDE_WELL)
-			// Type 1: Speech
-			_speechManager.startSpeech(13, 1, 1);
-		else
-			// Type 2 : music
-			_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
-	}
-}
-
 /* NIVEAU 9 */
 void dessin(int ad) {
 	if (ad != 0)
 		dessine(g_ades, ((ad % 160) * 2), (ad / 160));
 	else {
-		clearScreenType1();
+		g_vm->clearScreenType1();
 		if (g_caff > 99) {
 			dessine(g_ades, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
@@ -1762,7 +756,7 @@ void tinke() {
 		g_vm->_minute = 30;
 		drawClock();
 	}
-	if (y_s < 12)
+	if (g_vm->_mouse.y_s < 12)
 		return;
 
 	if (!g_vm->_blo) {
@@ -1834,12 +828,12 @@ void tinke() {
 						g_vm->_brt = true;
 						g_hdb = readclock();
 						if (getRandomNumber(1, 5) < 5) {
-							clearScreenType3();
+							g_vm->clearScreenType3();
 							g_vm->prepareScreenType2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
 							g_vm->_speechManager.startSpeech(1, rand, 1);
-							clearScreenType3();
+							g_vm->clearScreenType3();
 						}
 					}
 				}
@@ -1862,7 +856,7 @@ void tinke() {
 void fenat(char ans) {
 	int coul;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		coul = 2;
 	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
@@ -1872,7 +866,7 @@ void fenat(char ans) {
 
 	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
 	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 
@@ -1887,14 +881,14 @@ void tkey1(bool d) {
 	bool quest = false;
 	int x, y, c;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	fenat('K');
 
 	// Wait for release from any key or mouse button
 	while (g_vm->keyPressed())
 		g_key = testou();
 	do {
-		getMousePos_(x, y, c);
+		g_vm->_mouse.getMousePos_(x, y, c);
 		g_vm->keyPressed();
 	} while (c != 0);
 	
@@ -1903,13 +897,13 @@ void tkey1(bool d) {
 		if (d)
 			tinke();
 		quest = g_vm->keyPressed();
-		getMousePos_(x, y, c);
+		g_vm->_mouse.getMousePos_(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
 	if (quest)
 		testou();
 	g_vm->setMouseClick(false);
-	showMouse();
+	g_vm->_mouse.showMouse();
 }
 
 /* NIVEAU 7 */
@@ -1929,30 +923,6 @@ void affrep() {
 	g_crep = g_s._currPlace;
 }
 
-/**
- * Engine function - You lose!
- * @remarks	Originally called 'tperd'
- */
-void MortevielleEngine::loseGame() {
-	initouv();
-	g_ment = 0;
-	g_iouv = 0;
-	g_mchai = 0;
-	_menu.unsetSearchMenu();
-	if (!_blo)
-		t11(MANOR_FRONT);
-
-	_loseGame = true;
-	clearScreenType1();
-	_screenSurface.drawBox(60, 35, 400, 50, 15);
-	repon(9, g_crep);
-	clearScreenType2();
-	clearScreenType3();
-	_col = false;
-	_syn = false;
-	_okdes = false;
-}
-
 void tsort() {
 
 	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
@@ -2000,30 +970,6 @@ void st4(int ob) {
 	}
 }
 
-/**
- * Engine function - Check inventory for a given object
- * @remarks	Originally called 'cherjer'
- */
-bool MortevielleEngine::checkInventory(int objectId) {
-	bool retVal = false;
-	for (int i = 1; i <= 6; ++i)
-		retVal = (retVal || (ord(g_s._sjer[i]) == objectId));
-
-	if (g_s._selectedObjectId == objectId)
-		retVal = true;
-
-	return retVal;
-}
-
-/**
- * Engine function - Display Dining Room
- * @remarks	Originally called 'st1sama'
- */
-void MortevielleEngine::displayDiningRoom() {
-	g_s._currPlace = DINING_ROOM;
-	affrep();
-}
-
 void modinv() {
 	int r;
 	Common::String nomp;
@@ -2047,38 +993,6 @@ void modinv() {
 	}
 }
 
-void sparl(float adr, float rep) {
-	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
-	int key, repint;
-
-	repint = abs((int)rep);
-	hideMouse();
-	Common::String tmpStr = deline(repint + kDialogStringIndex);
-	displayStr(tmpStr, 230, 4, 65, 24, 5);
-	f3f8::draw();
-	
-	key = 0;
-	do {
-		g_vm->_speechManager.startSpeech(repint, haut[g_caff - 69], 0);
-		f3f8::waitForF3F8(key);
-		CHECK_QUIT;
-	} while (key != 66);
-	hirs();
-	showMouse();
-}
-
-/**
- * Engine function - End of Search: reset globals
- * @remarks	Originally called 'finfouill'
- */
-void endSearch() {
-	g_vm->_heroSearching = false;
-	g_vm->_obpart = false;
-	g_cs = 0;
-	g_is = 0;
-	g_vm->_menu.unsetSearchMenu();
-}
-
 void mennor() {
 	g_vm->_menu.menuUp(g_msg[3]);
 }
@@ -2115,92 +1029,6 @@ void ajjer(int ob) {
 		g_crep = 139;
 }
 
-/**
- * Engine function - Go to Dining room
- * @remarks	Originally called 't1sama'
- */
-void MortevielleEngine::gotoDiningRoom() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if ((hour < 5) && (g_s._currPlace > ROOM18)) {
-		if (!checkInventory(137)) {        //You don't have the keys, and it's late
-			g_crep = 1511;
-			loseGame();
-		} else
-			displayDiningRoom();
-	} else if (!g_s._alreadyEnteredManor) {     //Is it your first time?
-		_currBitIndex = 255; // Everybody is present
-		showPeoplePresent(_currBitIndex);
-		g_caff = 77;
-		afdes();
-		_screenSurface.drawBox(223, 47, 155, 91, 15);
-		repon(2, 33);
-		tkey1(false);
-		mennor();
-		hideMouse();
-		hirs();
-		premtet();
-		sparl(0, 140);
-		drawRightFrame();
-		drawClock();
-		showMouse();
-		g_s._currPlace = OWN_ROOM;
-		affrep();
-		resetPresenceInRooms(DINING_ROOM);
-		if (!_blo)
-			minute = t11(OWN_ROOM);
-		_currBitIndex = 0;
-		g_mpers = 0;
-		g_s._alreadyEnteredManor = true;
-	} else
-		displayDiningRoom();
-}
-
-/**
- * Engine function - Check Manor distance (in the mountains)
- * @remarks	Originally called 't1neig'
- */
-void MortevielleEngine::checkManorDistance() {
-	++_manorDistance;
-	if (_manorDistance > 2) {
-		g_crep = 1506;
-		loseGame();
-	} else {
-		_okdes = true;
-		g_s._currPlace = MOUNTAIN;
-		affrep();
-	}
-}
-
-/**
- * Engine function - Go to Manor front
- * @remarks	Originally called 't1deva'
- */
-void MortevielleEngine::gotoManorFront() {
-	_manorDistance = 0;
-	g_s._currPlace = MANOR_FRONT;
-	affrep();
-}
-
-/**
- * Engine function - Go to Manor back
- * @remarks	Originally called 't1derr'
- */
-void MortevielleEngine::gotoManorBack() {
-	g_s._currPlace = MANOR_BACK;
-	affrep();
-}
-
-/**
- * Engine function - Dead : Flooded in Well 
- * @remarks	Originally called 't1deau'
- */
-void MortevielleEngine::floodedInWell() {
-	g_crep = 1503;
-	loseGame();
-}
-
 void tctrm() {
 	repon(2, (3000 + g_ctrm));
 	g_ctrm = 0;
@@ -2211,7 +1039,7 @@ void quelquun() {
 	if (g_vm->_menu._menuDisplayed)
 		g_vm->_menu.eraseMenu();
 
-	endSearch();
+	g_vm->endSearch();
 	g_crep = 997;
 L1:
 	if (!g_vm->_hiddenHero) {
@@ -2231,7 +1059,7 @@ L1:
 			g_s._faithScore += 3 * (g_s._faithScore / 10);
 		tsort();
 		g_vm->_menu.setDestinationMenuText(LANDING);
-		int cx = convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
+		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
 		g_caff = 69 + cx;
 		g_crep = g_caff;
 		g_msg[3] = MENU_DISCUSS;
@@ -2247,7 +1075,7 @@ L1:
 			repon(2, 136);
 			int rand = (getRandomNumber(0, 4)) - 2;
 			g_vm->_speechManager.startSpeech(3, rand, 1);
-			clearScreenType2();
+			g_vm->clearScreenType2();
 			g_vm->displayAloneText();
 			debloc(21);
 			affrep();
@@ -2278,7 +1106,7 @@ void tsuiv() {
 			g_s._faithScore += 2;
 	} else {
 		affrep();
-		endSearch();
+		g_vm->endSearch();
 		if (cx > 9)
 			g_crep = 131;
 	}
@@ -2297,11 +1125,11 @@ void tfleche() {
 		touch = '\0';
 
 		do {
-			moveMouse(qust, touch);
+			g_vm->_mouse.moveMouse(qust, touch);
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
-				inRect = (x_s < 256 * g_res) && (y_s < 176) && (y_s > 12);
+				inRect = (g_vm->_mouse.x_s < 256 * g_res) && (g_vm->_mouse.y_s < 176) && (g_vm->_mouse.y_s > 12);
 			tinke();
 		} while (!(qust || inRect || g_vm->_anyone));
 
@@ -2313,8 +1141,8 @@ void tfleche() {
 		g_vm->_keyPressedEsc = true;
 
 	if (inRect) {
-		g_x = x_s;
-		g_y = y_s;
+		g_x = g_vm->_mouse.x_s;
+		g_y = g_vm->_mouse.y_s;
 	}
 }
 
@@ -2463,221 +1291,4 @@ void aldepl() {
 	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
 }
 
-/**
- * Engine function - Change Graphical Device
- * @remarks	Originally called 'change_gd'
- */
-void MortevielleEngine::changeGraphicalDevice(int newDevice) {
-	hideMouse();
-	_currGraphicalDevice = newDevice;
-	hirs();
-	initMouse();
-	showMouse();
-	drawRightFrame();
-	tinke();
-	drawClock();
-	if (_currBitIndex != 0)
-		showPeoplePresent(_currBitIndex);
-	else
-		displayAloneText();
-	clearScreenType2();
-	clearScreenType3();
-	g_maff = 68;
-	afdes();
-	repon(2, g_crep);
-	_menu.displayMenu();
-}
-
-/**
- * Called when a savegame has been loaded.
- * @remarks	Originally called 'antegame'
- */
-void MortevielleEngine::gameLoaded() {
-	hideMouse();
-	_menu._menuDisplayed = false;
-	_loseGame = true;
-	_anyone = false;
-	_okdes = true;
-	_col = false;
-	_hiddenHero = false;
-	_brt = false;
-	g_maff = 68;
-	g_mnumo = OPCODE_NONE;
-	g_prebru = 0;
-	g_x = 0;
-	g_y = 0;
-	g_num = 0;
-	g_hdb = 0;
-	g_hfb = 0;
-	g_cs = 0;
-	g_is = 0;
-	g_ment = 0;
-	_syn = true;
-	_heroSearching = true;
-	g_mchai = 0;
-	_manorDistance = 0;
-	initouv();
-	g_iouv = 0;
-	g_dobj = 0;
-	affrep();
-	_hintPctMessage = deline(580);
-
-	_okdes = false;
-	_endGame = true;
-	_loseGame = false;
-	_heroSearching = false;
-
-	displayAloneText();
-	tinke();
-	drawClock();
-	afdes();
-	repon(2, g_crep);
-	clearScreenType3();
-	_endGame = false;
-	_menu.setDestinationMenuText(g_s._currPlace);
-	modinv();
-	if (g_s._selectedObjectId != 0)
-		modobj(g_s._selectedObjectId + 400);
-	showMouse();
-}
-
-/**
- * Engine function - Handle OpCodes
- * @remarks	Originally called 'tsitu'
- */
-void MortevielleEngine::handleOpcode() {
-	if (!_col)
-		clearScreenType2();
-	_syn = false;
-	_keyPressedEsc = false;
-	if (!_anyone) {
-		if (_brt) {
-			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
-				g_ctrm = 4;
-				mennor();
-				return;
-			}
-		}
-		if (g_msg[3] == MENU_MOVE)
-			fctMove();
-		if (g_msg[3] == MENU_DISCUSS)
-			fctDiscuss();
-		if (g_msg[3] == MENU_INVENTORY)
-			fctInventoryTake();
-		if (g_msg[4] == OPCODE_ATTACH)
-			fctAttach();
-		if (g_msg[4] == OPCODE_WAIT)
-			fctWait();
-		if (g_msg[4] == OPCODE_FORCE)
-			fctForce();
-		if (g_msg[4] == OPCODE_SLEEP)
-			fctSleep();
-		if (g_msg[4] == OPCODE_LISTEN)
-			fctListen();
-		if (g_msg[4] == OPCODE_ENTER)
-			fctEnter();
-		if (g_msg[4] == OPCODE_CLOSE)
-			fctClose();
-		if (g_msg[4] == OPCODE_SEARCH)
-			fctSearch();
-		if (g_msg[4] == OPCODE_KNOCK)
-			fctKnock();
-		if (g_msg[4] == OPCODE_SCRATCH)
-			fctScratch();
-		if (g_msg[4] == OPCODE_READ)
-			fctRead();
-		if (g_msg[4] == OPCODE_EAT)
-			fctEat();
-		if (g_msg[4] == OPCODE_PLACE)
-			fctPlace();
-		if (g_msg[4] == OPCODE_OPEN)
-			fctOpen();
-		if (g_msg[4] == OPCODE_TAKE)
-			fctTake();
-		if (g_msg[4] == OPCODE_LOOK)
-			fctLook();
-		if (g_msg[4] == OPCODE_SMELL)
-			fctSmell();
-		if (g_msg[4] == OPCODE_SOUND)
-			fctSound();
-		if (g_msg[4] == OPCODE_LEAVE)
-			fctLeave();
-		if (g_msg[4] == OPCODE_LIFT)
-			fctLift();
-		if (g_msg[4] == OPCODE_TURN)
-			fctTurn();
-		if (g_msg[4] == OPCODE_SSEARCH)
-			fctSelfSearch();
-		if (g_msg[4] == OPCODE_SREAD)
-			fctSelfRead();
-		if (g_msg[4] == OPCODE_SPUT)
-			fctSelfPut();
-		if (g_msg[4] == OPCODE_SLOOK)
-			fctSelftLook();
-		_hiddenHero = false;
-
-		if (g_msg[4] == OPCODE_SHIDE)
-			fctSelfHide();
-	} else {
-		if (_anyone) {
-			quelquun();
-			_anyone = false;
-			mennor();
-			return;
-		}
-	}
-	int hour, day, minute;
-	updateHour(day, hour, minute);
-	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
-	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
-		++g_s._faithScore;
-	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != INSIDE_WELL)
-	        && (g_s._currPlace != OWN_ROOM) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
-		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
-			g_crep = 1501;
-			loseGame();
-		}
-		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
-			g_crep = 1508;
-			loseGame();
-		}
-		if ((day > 1) && (hour > 8) && (!_loseGame)) {
-			g_crep = 1502;
-			loseGame();
-		}
-	}
-	mennor();
-}
-
-/**
- * Engine function - Transform time into a char
- * @remarks	Originally called 'tmaj3'
- */
-void MortevielleEngine::hourToChar() {
-	int day, hour, minute;
-
-	g_vm->updateHour(day, hour, minute);
-	if (minute == 30)
-		minute = 1;
-	hour += day * 24;
-	minute += hour * 2;
-	g_s._fullHour = chr(minute);
-}
-
-/**
- * Engine function - extract time from a char
- * @remarks	Originally called 'theure'
- */
-void MortevielleEngine::charToHour() {
-	int fullHour = ord(g_s._fullHour);
-	int tmpHour = fullHour % 48;
-	g_vm->_currDay = fullHour / 48;
-	g_vm->_currHalfHour = tmpHour % 2;
-	g_vm->_currHour = tmpHour / 2;
-	g_vm->_hour = g_vm->_currHour;
-	if (g_vm->_currHalfHour == 1)
-		g_vm->_minute = 30;
-	else
-		g_vm->_minute = 0;
-}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 528039c..0cd467c 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -42,9 +42,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
-/* NIVEAU 15 */
 extern void copcha();
-extern bool isMouseIn(rectangle r);
 extern void outbloc(int n, pattern p, nhom *pal);
 extern void writepal(int n);
 extern void pictout(int seg, int dep, int x, int y);
@@ -60,15 +58,10 @@ extern void drawRightFrame();
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
 extern void initouv();
-extern void clearScreenType1();
-extern void clearScreenType2();
-extern void clearScreenType3();
-extern void clearScreenType10();
 extern void ecr2(Common::String str_);
 extern void ecr3(Common::String text);
 extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
-extern int convertCharacterIndexToBitIndex(int characterIndex);
 /* NIVEAU 12 */
 extern void modobj(int m);
 extern void repon(int f, int m);
@@ -78,7 +71,6 @@ extern void drawClock();
  * NIVEAU 11 *
  *************/
 extern void debloc(int roomId);
-extern int convertBitIndexToCharacterIndex(int bitIndex);
 extern void ecfren(int &p, int &rand, int cf, int roomId);
 extern void becfren(int roomId);
 /* NIVEAU 10 */
@@ -105,8 +97,6 @@ extern void tsort();
 extern void st4(int ob);
 extern void displayDiningRoom();
 extern void modinv();
-extern void sparl(float adr, float rep);
-extern void endSearch();
 extern void mennor();
 extern void premtet();
 /* NIVEAU 5 */
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3667a13..f376e57 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -339,8 +339,8 @@ bool MortevielleEngine::handleEvents() {
 	case Common::EVENT_LBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
 		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
-		x_s = event.mouse.x;
-		y_s = event.mouse.y / 2;
+		g_vm->_mouse.x_s = event.mouse.x;
+		g_vm->_mouse.y_s = event.mouse.y / 2;
 
 		if (event.type == Common::EVENT_LBUTTONDOWN)
 			_mouseClick = true;
@@ -550,7 +550,7 @@ void MortevielleEngine::mainGame() {
 	initGame();
 	hirs();
 	drawRightFrame();
-	showMouse();
+	g_vm->_mouse.showMouse();
 
 	// Loop to play the game
 	do {
@@ -603,7 +603,7 @@ void MortevielleEngine::handleAction() {
 		do {
 			_menu.mdn();
 			tinke();
-			moveMouse(funct, inkey);
+			g_vm->_mouse.moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
 		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
@@ -652,7 +652,7 @@ void MortevielleEngine::handleAction() {
 				g_mnumo = g_msg[4];
 			if (!_anyone) {
 				if ((_heroSearching) || (_obpart)) {
-					if (y_s < 12)
+					if (g_vm->_mouse.y_s < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
@@ -705,4 +705,1384 @@ void MortevielleEngine::loadPlaces() {
 	f.close();
 }
 
+/**
+ * Set Text Color
+ * @remarks	Originally called 'text_color'
+ */
+void MortevielleEngine::setTextColor(int col) {
+	_textColor = col;
+}
+
+/**
+ * Prepare screen - Type 1!
+ * @remarks	Originally called 'ecrf1'
+ */
+void MortevielleEngine::prepareScreenType1() {
+	// Large drawing
+	_screenSurface.drawBox(0, 11, 512, 163, 15);
+}
+
+/**
+ * Prepare room - Type 2!
+ * @remarks	Originally called 'ecrf2'
+ */
+void MortevielleEngine::prepareScreenType2() {
+	setTextColor(5);
+}
+
+/**
+ * Prepare room - Type 3!
+ * @remarks	Originally called 'ecrf7'
+ */
+void MortevielleEngine::prepareScreenType3() {
+	setTextColor(4);
+}
+
+/**
+ * Engine function - Update hour
+ * @remarks	Originally called 'calch'
+ */
+void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
+	int newHour = readclock();
+	int th = g_jh + ((newHour - g_mh) / g_t);
+	minute = ((th % 2) + _currHalfHour) * 30;
+	hour = ((uint)th >> 1) + _currHour;
+	if (minute == 60) {
+		minute = 0;
+		++hour;
+	}
+	day = (hour / 24) + _currDay;
+	hour = hour - ((day - _currDay) * 24);
+}
+
+/**
+ * Engine function - Convert character index to bit index
+ * @remarks	Originally called 'conv'
+ */
+int MortevielleEngine::convertCharacterIndexToBitIndex(int characterIndex) {
+	return 128 >> (characterIndex - 1);
+}
+
+/**
+ * Engine function - Convert bit index to character index
+ * @remarks	Originally called 'tip'
+ */
+int MortevielleEngine::convertBitIndexToCharacterIndex(int bitIndex) {
+	int retVal = 0;
+
+	if (bitIndex == 128)
+		retVal = 1;
+	else if (bitIndex == 64)
+		retVal = 2;
+	else if (bitIndex == 32)
+		retVal = 3;
+	else if (bitIndex == 16)
+		retVal = 4;
+	else if (bitIndex == 8)
+		retVal = 5;
+	else if (bitIndex == 4)
+		retVal = 6;
+	else if (bitIndex == 2)
+		retVal = 7;
+	else if (bitIndex == 1)
+		retVal = 8;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Reset presence in other rooms
+ * @remarks	Originally called 't5'
+ */
+void MortevielleEngine::resetPresenceInRooms(int roomId) {
+	if (roomId == DINING_ROOM)
+		_blo = false;
+
+	if (roomId != GREEN_ROOM) {
+		_roomPresenceLuc = false;
+		_roomPresenceIda = false;
+	}
+
+	if (roomId != PURPLE_ROOM)
+		_purpleRoomPresenceLeo = false;
+
+	if (roomId != DARKBLUE_ROOM) {
+		_roomPresenceGuy = false;
+		_roomPresenceEva = false;
+	}
+
+	if (roomId != BLUE_ROOM)
+		_roomPresenceMax = false;
+	if (roomId != RED_ROOM)
+		_roomPresenceBob = false;
+	if (roomId != GREEN_ROOM2)
+		_roomPresencePat = false;
+	if (roomId != TOILETS)
+		_toiletsPresenceBobMax = false;
+	if (roomId != BATHROOM)
+		_bathRoomPresenceBobMax = false;
+	if (roomId != ROOM9)
+		_room9PresenceLeo = false;
+}
+
+/**
+ * Engine function - Show the people present in the given room 
+ * @remarks	Originally called 'affper'
+ */
+void MortevielleEngine::showPeoplePresent(int bitIndex) {
+	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
+
+	for (int i = 1; i <= 8; ++i)
+		_menu.disableMenuItem(_menu._discussMenu[i]);
+
+	clearScreenType10();
+	if ((bitIndex & 128) == 128) {
+		_screenSurface.putxy(xp, 24);
+		_screenSurface.drawString("LEO", 4);
+		_menu.enableMenuItem(_menu._discussMenu[1]);
+	}
+	if ((bitIndex & 64) == 64) {
+		_screenSurface.putxy(xp, 32);
+		_screenSurface.drawString("PAT", 4);
+		_menu.enableMenuItem(_menu._discussMenu[2]);
+	}
+	if ((bitIndex & 32) == 32) {
+		_screenSurface.putxy(xp, 40);
+		_screenSurface.drawString("GUY", 4);
+		_menu.enableMenuItem(_menu._discussMenu[3]);
+	}
+	if ((bitIndex & 16) == 16) {
+		_screenSurface.putxy(xp, 48);
+		_screenSurface.drawString("EVA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[4]);
+	}
+	if ((bitIndex & 8) == 8) {
+		_screenSurface.putxy(xp, 56);
+		_screenSurface.drawString("BOB", 4);
+		_menu.enableMenuItem(_menu._discussMenu[5]);
+	}
+	if ((bitIndex & 4) == 4) {
+		_screenSurface.putxy(xp, 64);
+		_screenSurface.drawString("LUC", 4);
+		_menu.enableMenuItem(_menu._discussMenu[6]);
+	}
+	if ((bitIndex & 2) == 2) {
+		_screenSurface.putxy(xp, 72);
+		_screenSurface.drawString("IDA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[7]);
+	}
+	if ((bitIndex & 1) == 1) {
+		_screenSurface.putxy(xp, 80);
+		_screenSurface.drawString("MAX", 4);
+		_menu.enableMenuItem(_menu._discussMenu[8]);
+	}
+	_currBitIndex = bitIndex;
+}
+
+/**
+ * Engine function - Select random characters
+ * @remarks	Originally called 'choix'
+ */
+int MortevielleEngine::selectCharacters(int min, int max) {
+	bool invertSelection = false;
+	int rand = getRandomNumber(min, max);
+
+	if (rand > 4) {
+		rand = 8 - rand;
+		invertSelection = true;
+	}
+
+	int i = 0;
+	int retVal = 0;
+	while (i < rand) {
+		int charIndex = getRandomNumber(1, 8);
+		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
+		if ((retVal & charBitIndex) != charBitIndex) {
+			++i;
+			retVal |= charBitIndex;
+		}
+	}
+	if (invertSelection)
+		retVal = 255 - retVal;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Green Room
+ * @remarks	Originally called 'cpl1'
+ */
+int MortevielleEngine::getPresenceStatsGreenRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	// The original uses an || instead of an &&, resulting 
+	// in an always true condition. Based on the other tests, 
+	// and on other scenes, we use an && instead.
+	if ((hour > 7) && (hour < 11))
+		retVal = 25;
+	else if ((hour > 10) && (hour < 14))
+		retVal = 35;
+	else if ((hour > 13) && (hour < 16))
+		retVal = 50;
+	else if ((hour > 15) && (hour < 18))
+		retVal = 5;
+	else if ((hour > 17) && (hour < 22))
+		retVal = 35;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 50;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 70;
+
+	_menu.mdn();
+
+	return retVal;
+}
+/**
+ * Engine function - Get Presence Statistics - Purple Room
+ * @remarks	Originally called 'cpl2'
+ */
+int MortevielleEngine::getPresenceStatsPurpleRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 11))
+		retVal = -2;
+	else if (hour == 11)
+		retVal = 100;
+	else if ((hour > 11) && (hour < 23))
+		retVal = 10;
+	else if (hour == 23)
+		retVal = 20;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 50;
+	
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Toilets
+ * @remarks	Originally called 'cpl3'
+ */
+int MortevielleEngine::getPresenceStatsToilets() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
+		retVal = 34;
+	else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
+		retVal = 0;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Blue Room
+ * @remarks	Originally called 'cpl5'
+ */
+int MortevielleEngine::getPresenceStatsBlueRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 6) && (hour < 10))
+		retVal = 0;
+	else if (hour == 10)
+		retVal = 100;
+	else if ((hour > 10) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 7))
+		retVal = 50;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Red Room
+ * @remarks	Originally called 'cpl6'
+ */
+int MortevielleEngine::getPresenceStatsRedRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
+		retVal = -2;
+	else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
+		retVal = 35;
+	else if (hour == 17)
+		retVal = 100;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 60;
+
+	return retVal;
+}
+
+/**
+ * Shows the "you are alone" message in the status area
+ * on the right hand side of the screen
+ * @remarks	Originally called 'person'
+ */
+void MortevielleEngine::displayAloneText() {
+	for (int cf = 1; cf <= 8; ++cf)
+		_menu.disableMenuItem(_menu._discussMenu[cf]);
+
+	Common::String sYou = getEngineString(S_YOU);
+	Common::String sAre = getEngineString(S_ARE);
+	Common::String sAlone = getEngineString(S_ALONE);
+
+	clearScreenType10();
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
+	_screenSurface.drawString(sYou, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
+	_screenSurface.drawString(sAre, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
+	_screenSurface.drawString(sAlone, 4);
+
+	_currBitIndex = 0;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl10'
+ */
+int MortevielleEngine::getPresenceStatsDiningRoom(int &hour) {
+	int day, minute;
+
+	int retVal = 0;
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
+		retVal = 100;
+	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
+		retVal = 45;
+	else if (((hour > 13) && (hour < 17)) || (hour == 18))
+		retVal = 35;
+	else if (hour == 17)
+		retVal = 60;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 5;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl11'
+ */
+int MortevielleEngine::getPresenceStatsBureau(int &hour) {
+	int day, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
+		retVal = 25;
+	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
+		retVal = 5;
+	else if ((hour > 13) && (hour < 17))
+		retVal = 55;
+	else if ((hour > 16) && (hour < 19))
+		retVal = 45;
+	else if ((hour >= 0) && (hour < 9))
+		retVal = 0;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Kitchen
+ * @remarks	Originally called 'cpl12'
+ */
+int MortevielleEngine::getPresenceStatsKitchen() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
+		retVal = 55;
+	else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
+		retVal = 25;
+	else if ((hour >= 0) && (hour < 5))
+		retVal = 0;
+	else if ((hour > 4) && (hour < 9))
+		retVal = 15;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Attic
+ * @remarks	Originally called 'cpl13'
+ */
+int MortevielleEngine::getPresenceStatsAttic() {
+	return 0;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Landing
+ * @remarks	Originally called 'cpl15'
+ */
+int MortevielleEngine::getPresenceStatsLanding() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 12))
+		retVal = 25;
+	else if ((hour > 11) && (hour < 14))
+		retVal = 0;
+	else if ((hour > 13) && (hour < 18))
+		retVal = 10;
+	else if ((hour > 17) && (hour < 20))
+		retVal = 55;
+	else if ((hour > 19) && (hour < 22))
+		retVal = 5;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = -15;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Chapel
+ * @remarks	Originally called 'cpl20'
+ */
+int MortevielleEngine::getPresenceStatsChapel(int &hour) {
+	int day, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (hour == 10)
+		retVal = 65;
+	else if ((hour > 10) && (hour < 21))
+		retVal = 5;
+	else if ((hour > 20) && (hour < 24))
+		retVal = -15;
+	else if ((hour >= 0) && (hour < 5))
+		retVal = -300;
+	else if ((hour > 4) && (hour < 10))
+		retVal = -5;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Green Room
+ * @remarks	Originally called 'quelq1'
+ */
+void MortevielleEngine::setPresenceGreenRoom(int roomId) {
+	int rand = getRandomNumber(1, 2);
+	if (roomId == GREEN_ROOM) {
+		if (rand == 1)
+			_roomPresenceLuc = true;
+		else
+			_roomPresenceIda = true;
+	} else if (roomId == DARKBLUE_ROOM) {
+		if (rand == 1)
+			_roomPresenceGuy = true;
+		else
+			_roomPresenceEva = true;
+	}
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Purple Room
+ * @remarks	Originally called 'quelq2'
+ */
+void MortevielleEngine::setPresencePurpleRoom() {
+	if (_place == PURPLE_ROOM)
+		_purpleRoomPresenceLeo = true;
+	else
+		_room9PresenceLeo = true;
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Blue Room
+ * @remarks	Originally called 'quelq5'
+ */
+void MortevielleEngine::setPresenceBlueRoom() {
+	_roomPresenceMax = true;
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Red Room
+ * @remarks	Originally called 'quelq6'
+ */
+void MortevielleEngine::setPresenceRedRoom(int roomId) {
+	if (roomId == RED_ROOM)
+		_roomPresenceBob = true;
+	else if (roomId == GREEN_ROOM2)
+		_roomPresencePat = true;
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Dining Room
+ * @remarks	Originally called 'quelq10'
+ */
+int MortevielleEngine::setPresenceDiningRoom(int hour) {
+	int retVal = 0;
+
+	if ((hour >= 0) && (hour < 8))
+		retVal = chlm();
+	else {
+		int min = 0, max = 0;
+		if ((hour > 7) && (hour < 10)) {
+			min = 5;
+			max = 7;
+		} else if ((hour > 9) && (hour < 12)) {
+			min = 1;
+			max = 4;
+		} else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
+			min = 6;
+			max = 8;
+		} else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
+			min = 1;
+			max = 5;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Bureau
+ * @remarks	Originally called 'quelq11'
+ */
+int MortevielleEngine::setPresenceBureau(int hour) {
+	int retVal = 0;
+
+	if ((hour >= 0) && (hour < 8))
+		retVal = chlm();
+	else {
+		int min = 0, max = 0;
+		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
+			min = 1;
+			max = 3;
+		} else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
+			min = 1;
+			max = 4;
+		} else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
+			min = 1;
+			max = 2;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Kitchen
+ * @remarks	Originally called 'quelq12'
+ */
+int MortevielleEngine::setPresenceKitchen() {
+	int retVal = chlm();
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Landing
+ * @remarks	Originally called 'quelq15'
+ */
+int MortevielleEngine::setPresenceLanding() {
+	bool test = false;
+	int rand = 0;
+	do {
+		rand = getRandomNumber(1, 8);
+		test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
+		        ((rand == 2) && _roomPresencePat) ||
+		        ((rand == 3) && _roomPresenceGuy) ||
+		        ((rand == 4) && _roomPresenceEva) ||
+		        ((rand == 5) && _roomPresenceBob) ||
+		        ((rand == 6) && _roomPresenceLuc) ||
+		        ((rand == 7) && _roomPresenceIda) ||
+		        ((rand == 8) && _roomPresenceMax));
+	} while (test);
+
+	int retVal = convertCharacterIndexToBitIndex(rand);
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the chapel
+ * @remarks	Originally called 'quelq20'
+ */
+int MortevielleEngine::setPresenceChapel(int hour) {
+	int retVal = 0;
+
+	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
+		retVal = chlm();
+	else {
+		int min = 0, max = 0;
+		if ((hour > 9) && (hour < 12)) {
+			min = 3;
+			max = 7;
+		} else if ((hour > 11) && (hour < 18)) {
+			min = 1;
+			max = 2;
+		} else if (hour == 18) {
+			min = 2;
+			max = 4;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get the answer after you known a door
+ * @remarks	Originally called 'frap'
+ */
+void MortevielleEngine::getKnockAnswer() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if ((hour >= 0) && (hour < 8))
+		g_crep = 190;
+	else {
+		if (getRandomNumber(1, 100) > 70)
+			g_crep = 190;
+		else
+			g_crep = 147;
+	}
+}
+
+/**
+ * Engine function - Get Room Presence Bit Index
+ * @remarks	Originally called 'nouvp'
+ */
+int MortevielleEngine::getPresenceBitIndex(int roomId) {
+	int bitIndex = 0;
+	if (roomId == GREEN_ROOM) {
+		if (_roomPresenceLuc)
+			bitIndex = 4;  // LUC
+		if (_roomPresenceIda)
+			bitIndex = 2;  // IDA
+	} else if ( ((roomId == PURPLE_ROOM) && (_purpleRoomPresenceLeo))
+			 || ((roomId == ROOM9) && (_room9PresenceLeo)))
+		bitIndex = 128;    // LEO
+	else if (roomId == DARKBLUE_ROOM) {
+		if (_roomPresenceGuy)
+			bitIndex = 32; // GUY
+		if (_roomPresenceEva)
+			bitIndex = 16; // EVA
+	} else if ((roomId == BLUE_ROOM) && (_roomPresenceMax))
+		bitIndex = 1;      // MAX
+	else if ((roomId == RED_ROOM) && (_roomPresenceBob))
+		bitIndex = 8;      // BOB
+	else if ((roomId == GREEN_ROOM2) && (_roomPresencePat))
+		bitIndex = 64;     // PAT
+	else if ( ((roomId == TOILETS) && (_toiletsPresenceBobMax))
+		   || ((roomId == BATHROOM) && (_bathRoomPresenceBobMax)) )
+		bitIndex = 9;      // BOB + MAX
+
+	if (bitIndex != 9)
+		showPeoplePresent(bitIndex);
+
+	return bitIndex;
+}
+
+/**
+ * Engine function - initGame
+ * @remarks	Originally called 'dprog'
+ */
+void MortevielleEngine::initGame() {
+	_place = MANOR_FRONT;
+	g_jh = 0;
+	if (!g_s._alreadyEnteredManor)
+		_blo = true;
+	g_t = kTime1;
+	g_mh = readclock();
+}
+
+/**
+ * Engine function - Set Random Presence - Green Room
+ * @remarks	Originally called 'pl1'
+ */
+void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
+	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
+	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
+		int p = getPresenceStatsGreenRoom();
+		int rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceGreenRoom(_place);
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Purple Room
+ * @remarks	Originally called 'pl2'
+ */
+void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
+	if (!_purpleRoomPresenceLeo) {
+		int p = getPresenceStatsPurpleRoom();
+		int rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresencePurpleRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Blue Room
+ * @remarks	Originally called 'pl5'
+ */
+void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
+	if (!_roomPresenceMax) {
+		int p = getPresenceStatsBlueRoom();
+		int rand;
+
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceBlueRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Red Room
+ * @remarks	Originally called 'pl6'
+ */
+void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
+	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
+	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
+		int p = getPresenceStatsRedRoom();
+		int rand;
+
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceRedRoom(_place);
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Room 9
+ * @remarks	Originally called 'pl9'
+ */
+void MortevielleEngine::setRandomPresenceRoom9(int cf) {
+	if (!_room9PresenceLeo) {
+		cf = -10;
+		int p, rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresencePurpleRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Dining Room
+ * @remarks	Originally called 'pl10'
+ */
+void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
+	int h, rand;
+	int p = getPresenceStatsDiningRoom(h);
+	phaz(rand, p, cf);
+
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceDiningRoom(h);
+}
+
+/**
+ * Engine function - Set Random Presence - Bureau
+ * @remarks	Originally called 'pl11'
+ */
+void MortevielleEngine::setRandomPresenceBureau(int cf) {
+	int h, rand;
+
+	int p = getPresenceStatsBureau(h);
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceBureau(h);
+}
+
+/**
+ * Engine function - Set Random Presence - Kitchen
+ * @remarks	Originally called 'pl12'
+ */
+void MortevielleEngine::setRandomPresenceKitchen(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsKitchen();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceKitchen();
+}
+
+/**
+ * Engine function - Set Random Presence - Attic / Cellar
+ * @remarks	Originally called 'pl13'
+ */
+void MortevielleEngine::setRandomPresenceAttic(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsAttic();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceKitchen();
+}
+
+/**
+ * Engine function - Set Random Presence - Landing
+ * @remarks	Originally called 'pl15'
+ */
+void MortevielleEngine::setRandomPresenceLanding(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsLanding();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceLanding();
+}
+
+/**
+ * Engine function - Set Random Presence - Chapel
+ * @remarks	Originally called 'pl20'
+ */
+void MortevielleEngine::setRandomPresenceChapel(int cf) {
+	int h, rand;
+
+	int p = getPresenceStatsChapel(h);
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceChapel(h);
+}
+
+/**
+ * Start music or speech
+ * @remarks	Originally called 'musique'
+ */
+void MortevielleEngine::startMusicOrSpeech(int so) {
+	if (so == 0) {
+		/* musik(0) */
+		;
+	} else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
+		// Type 1: Speech
+		_speechManager.startSpeech(10, 1, 1);
+		++g_prebru;
+	} else {
+		if (((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
+		else if ((g_s._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
+			// Type 1: Speech
+			_speechManager.startSpeech(8, 1, 1);
+		else if ((g_s._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(12, 1, 1);
+		else if (g_s._currPlace == INSIDE_WELL)
+			// Type 1: Speech
+			_speechManager.startSpeech(13, 1, 1);
+		else
+			// Type 2 : music
+			_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
+	}
+}
+
+/**
+ * Engine function - You lose!
+ * @remarks	Originally called 'tperd'
+ */
+void MortevielleEngine::loseGame() {
+	initouv();
+	g_ment = 0;
+	g_iouv = 0;
+	g_mchai = 0;
+	_menu.unsetSearchMenu();
+	if (!_blo)
+		t11(MANOR_FRONT);
+
+	_loseGame = true;
+	clearScreenType1();
+	_screenSurface.drawBox(60, 35, 400, 50, 15);
+	repon(9, g_crep);
+	clearScreenType2();
+	clearScreenType3();
+	_col = false;
+	_syn = false;
+	_okdes = false;
+}
+
+/**
+ * Engine function - Check inventory for a given object
+ * @remarks	Originally called 'cherjer'
+ */
+bool MortevielleEngine::checkInventory(int objectId) {
+	bool retVal = false;
+	for (int i = 1; i <= 6; ++i)
+		retVal = (retVal || (ord(g_s._sjer[i]) == objectId));
+
+	if (g_s._selectedObjectId == objectId)
+		retVal = true;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Display Dining Room
+ * @remarks	Originally called 'st1sama'
+ */
+void MortevielleEngine::displayDiningRoom() {
+	g_s._currPlace = DINING_ROOM;
+	affrep();
+}
+
+/**
+ * Engine function - Start non interactive Dialog
+ * @remarks	Originally called 'sparl'
+ */
+void MortevielleEngine::startDialog(int16 rep) {
+	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
+	int key;
+
+	assert(rep >= 0);
+
+	_mouse.hideMouse();
+	Common::String dialogStr = deline(rep + kDialogStringIndex);
+	displayStr(dialogStr, 230, 4, 65, 24, 5);
+	f3f8::draw();
+	
+	key = 0;
+	do {
+		_speechManager.startSpeech(rep, haut[g_caff - 69], 0);
+		key = f3f8::waitForF3F8();
+		CHECK_QUIT;
+	} while (key != 66);
+	hirs();
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - End of Search: reset globals
+ * @remarks	Originally called 'finfouill'
+ */
+void MortevielleEngine::endSearch() {
+	_heroSearching = false;
+	_obpart = false;
+	g_cs = 0;
+	g_is = 0;
+	_menu.unsetSearchMenu();
+}
+
+/**
+ * Engine function - Go to Dining room
+ * @remarks	Originally called 't1sama'
+ */
+void MortevielleEngine::gotoDiningRoom() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if ((hour < 5) && (g_s._currPlace > ROOM18)) {
+		if (!checkInventory(137)) {        //You don't have the keys, and it's late
+			g_crep = 1511;
+			loseGame();
+		} else
+			displayDiningRoom();
+	} else if (!g_s._alreadyEnteredManor) {     //Is it your first time?
+		_currBitIndex = 255; // Everybody is present
+		showPeoplePresent(_currBitIndex);
+		g_caff = 77;
+		afdes();
+		_screenSurface.drawBox(223, 47, 155, 91, 15);
+		repon(2, 33);
+		tkey1(false);
+		mennor();
+		_mouse.hideMouse();
+		hirs();
+		premtet();
+		startDialog(140);
+		drawRightFrame();
+		drawClock();
+		_mouse.showMouse();
+		g_s._currPlace = OWN_ROOM;
+		affrep();
+		resetPresenceInRooms(DINING_ROOM);
+		if (!_blo)
+			minute = t11(OWN_ROOM);
+		_currBitIndex = 0;
+		g_mpers = 0;
+		g_s._alreadyEnteredManor = true;
+	} else
+		displayDiningRoom();
+}
+
+/**
+ * Engine function - Check Manor distance (in the mountains)
+ * @remarks	Originally called 't1neig'
+ */
+void MortevielleEngine::checkManorDistance() {
+	++_manorDistance;
+	if (_manorDistance > 2) {
+		g_crep = 1506;
+		loseGame();
+	} else {
+		_okdes = true;
+		g_s._currPlace = MOUNTAIN;
+		affrep();
+	}
+}
+
+/**
+ * Engine function - Go to Manor front
+ * @remarks	Originally called 't1deva'
+ */
+void MortevielleEngine::gotoManorFront() {
+	_manorDistance = 0;
+	g_s._currPlace = MANOR_FRONT;
+	affrep();
+}
+
+/**
+ * Engine function - Go to Manor back
+ * @remarks	Originally called 't1derr'
+ */
+void MortevielleEngine::gotoManorBack() {
+	g_s._currPlace = MANOR_BACK;
+	affrep();
+}
+
+/**
+ * Engine function - Dead : Flooded in Well 
+ * @remarks	Originally called 't1deau'
+ */
+void MortevielleEngine::floodedInWell() {
+	g_crep = 1503;
+	loseGame();
+}
+
+/**
+ * Engine function - Change Graphical Device
+ * @remarks	Originally called 'change_gd'
+ */
+void MortevielleEngine::changeGraphicalDevice(int newDevice) {
+	_mouse.hideMouse();
+	_currGraphicalDevice = newDevice;
+	hirs();
+	_mouse.initMouse();
+	_mouse.showMouse();
+	drawRightFrame();
+	tinke();
+	drawClock();
+	if (_currBitIndex != 0)
+		showPeoplePresent(_currBitIndex);
+	else
+		displayAloneText();
+	clearScreenType2();
+	clearScreenType3();
+	g_maff = 68;
+	afdes();
+	repon(2, g_crep);
+	_menu.displayMenu();
+}
+
+/**
+ * Called when a savegame has been loaded.
+ * @remarks	Originally called 'antegame'
+ */
+void MortevielleEngine::gameLoaded() {
+	_mouse.hideMouse();
+	_menu._menuDisplayed = false;
+	_loseGame = true;
+	_anyone = false;
+	_okdes = true;
+	_col = false;
+	_hiddenHero = false;
+	_brt = false;
+	g_maff = 68;
+	g_mnumo = OPCODE_NONE;
+	g_prebru = 0;
+	g_x = 0;
+	g_y = 0;
+	g_num = 0;
+	g_hdb = 0;
+	g_hfb = 0;
+	g_cs = 0;
+	g_is = 0;
+	g_ment = 0;
+	_syn = true;
+	_heroSearching = true;
+	g_mchai = 0;
+	_manorDistance = 0;
+	initouv();
+	g_iouv = 0;
+	g_dobj = 0;
+	affrep();
+	_hintPctMessage = deline(580);
+
+	_okdes = false;
+	_endGame = true;
+	_loseGame = false;
+	_heroSearching = false;
+
+	displayAloneText();
+	tinke();
+	drawClock();
+	afdes();
+	repon(2, g_crep);
+	clearScreenType3();
+	_endGame = false;
+	_menu.setDestinationMenuText(g_s._currPlace);
+	modinv();
+	if (g_s._selectedObjectId != 0)
+		modobj(g_s._selectedObjectId + 400);
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Handle OpCodes
+ * @remarks	Originally called 'tsitu'
+ */
+void MortevielleEngine::handleOpcode() {
+	if (!_col)
+		clearScreenType2();
+	_syn = false;
+	_keyPressedEsc = false;
+	if (!_anyone) {
+		if (_brt) {
+			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
+				g_ctrm = 4;
+				mennor();
+				return;
+			}
+		}
+		if (g_msg[3] == MENU_MOVE)
+			fctMove();
+		if (g_msg[3] == MENU_DISCUSS)
+			fctDiscuss();
+		if (g_msg[3] == MENU_INVENTORY)
+			fctInventoryTake();
+		if (g_msg[4] == OPCODE_ATTACH)
+			fctAttach();
+		if (g_msg[4] == OPCODE_WAIT)
+			fctWait();
+		if (g_msg[4] == OPCODE_FORCE)
+			fctForce();
+		if (g_msg[4] == OPCODE_SLEEP)
+			fctSleep();
+		if (g_msg[4] == OPCODE_LISTEN)
+			fctListen();
+		if (g_msg[4] == OPCODE_ENTER)
+			fctEnter();
+		if (g_msg[4] == OPCODE_CLOSE)
+			fctClose();
+		if (g_msg[4] == OPCODE_SEARCH)
+			fctSearch();
+		if (g_msg[4] == OPCODE_KNOCK)
+			fctKnock();
+		if (g_msg[4] == OPCODE_SCRATCH)
+			fctScratch();
+		if (g_msg[4] == OPCODE_READ)
+			fctRead();
+		if (g_msg[4] == OPCODE_EAT)
+			fctEat();
+		if (g_msg[4] == OPCODE_PLACE)
+			fctPlace();
+		if (g_msg[4] == OPCODE_OPEN)
+			fctOpen();
+		if (g_msg[4] == OPCODE_TAKE)
+			fctTake();
+		if (g_msg[4] == OPCODE_LOOK)
+			fctLook();
+		if (g_msg[4] == OPCODE_SMELL)
+			fctSmell();
+		if (g_msg[4] == OPCODE_SOUND)
+			fctSound();
+		if (g_msg[4] == OPCODE_LEAVE)
+			fctLeave();
+		if (g_msg[4] == OPCODE_LIFT)
+			fctLift();
+		if (g_msg[4] == OPCODE_TURN)
+			fctTurn();
+		if (g_msg[4] == OPCODE_SSEARCH)
+			fctSelfSearch();
+		if (g_msg[4] == OPCODE_SREAD)
+			fctSelfRead();
+		if (g_msg[4] == OPCODE_SPUT)
+			fctSelfPut();
+		if (g_msg[4] == OPCODE_SLOOK)
+			fctSelftLook();
+		_hiddenHero = false;
+
+		if (g_msg[4] == OPCODE_SHIDE)
+			fctSelfHide();
+	} else {
+		if (_anyone) {
+			quelquun();
+			_anyone = false;
+			mennor();
+			return;
+		}
+	}
+	int hour, day, minute;
+	updateHour(day, hour, minute);
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
+	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
+		++g_s._faithScore;
+	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != INSIDE_WELL)
+	        && (g_s._currPlace != OWN_ROOM) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
+		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
+			g_crep = 1501;
+			loseGame();
+		}
+		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
+			g_crep = 1508;
+			loseGame();
+		}
+		if ((day > 1) && (hour > 8) && (!_loseGame)) {
+			g_crep = 1502;
+			loseGame();
+		}
+	}
+	mennor();
+}
+
+/**
+ * Engine function - Transform time into a char
+ * @remarks	Originally called 'tmaj3'
+ */
+void MortevielleEngine::hourToChar() {
+	int day, hour, minute;
+
+	g_vm->updateHour(day, hour, minute);
+	if (minute == 30)
+		minute = 1;
+	hour += day * 24;
+	minute += hour * 2;
+	g_s._fullHour = chr(minute);
+}
+
+/**
+ * Engine function - extract time from a char
+ * @remarks	Originally called 'theure'
+ */
+void MortevielleEngine::charToHour() {
+	int fullHour = ord(g_s._fullHour);
+	int tmpHour = fullHour % 48;
+	g_vm->_currDay = fullHour / 48;
+	g_vm->_currHalfHour = tmpHour % 2;
+	g_vm->_currHour = tmpHour / 2;
+	g_vm->_hour = g_vm->_currHour;
+	if (g_vm->_currHalfHour == 1)
+		g_vm->_minute = 30;
+	else
+		g_vm->_minute = 0;
+}
+
+/**
+ * Engine function - Clear Screen - Type 1
+ * @remarks	Originally called 'clsf1'
+ */
+void MortevielleEngine::clearScreenType1() {
+	g_vm->_mouse.hideMouse();
+	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
+	g_vm->_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear Screen - Type 2
+ * @remarks	Originally called 'clsf2'
+ */
+void MortevielleEngine::clearScreenType2() {
+	g_vm->_mouse.hideMouse();
+	if (g_vm->_largestClearScreen) {
+		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
+		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
+		g_vm->_largestClearScreen = false;
+	} else {
+		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
+		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
+	}
+	g_vm->_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear Screen - Type 3
+ * @remarks	Originally called 'clsf3'
+ */
+void MortevielleEngine::clearScreenType3() {
+	g_vm->_mouse.hideMouse();
+	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
+	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
+	g_vm->_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear Screen - Type 10
+ * @remarks	Originally called 'clsf10'
+ */
+void MortevielleEngine::clearScreenType10() {
+	int co, cod;
+	Common::String st;
+
+	g_vm->_mouse.hideMouse();
+	if (g_res == 1) {
+		co = 634;
+		cod = 534;
+	} else {
+		co = 600;
+		cod = 544;
+	}
+	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
+	if (g_s._faithScore < 33)
+		st = g_vm->getEngineString(S_COOL);
+	else if (g_s._faithScore < 66)
+		st = g_vm->getEngineString(S_LOURDE);
+	else if (g_s._faithScore > 65)
+		st = g_vm->getEngineString(S_MALSAINE);
+	
+	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
+	g_vm->_screenSurface.putxy(co, 92);
+	g_vm->_screenSurface.drawString(st, 4);
+
+	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
+	/* rempli(69,12,32,5,255);*/
+	g_vm->_mouse.showMouse();
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index aeaf5e2..477415b 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -34,6 +34,7 @@
 #include "graphics/surface.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/menu.h"
+#include "mortevielle/mouse.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/sound.h"
 #include "mortevielle/speech.h"
@@ -168,6 +169,7 @@ public:
 	SavegameManager _savegameManager;
 	SpeechManager _speechManager;
 	Menu _menu;
+	MouseHandler _mouse;
 
 	bool _quitGame;			// Quit game flag. Originally called 'arret'
 	bool _endGame;			// End game flag. Originally called 'solu'
@@ -289,6 +291,14 @@ public:
 	void hourToChar();
 
 	void changeGraphicalDevice(int newDevice);
+	void startDialog(int16 rep);
+	void endSearch();
+	int convertCharacterIndexToBitIndex(int characterIndex);
+	int convertBitIndexToCharacterIndex(int bitIndex);
+	void clearScreenType1();
+	void clearScreenType2();
+	void clearScreenType3();
+	void clearScreenType10();
 
 };
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 401a2b3..c5f0e21 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -36,21 +36,11 @@ namespace Mortevielle {
 const int m_arrow = 0;
 const int m_point_hand = 1;
 
-bool int_m, clic;
-
-int m_show,
-        x_s,
-        y_s,
-        p_o_s,
-        mouse_shwn;
-
-int s_s[12][6];
-
 /**
  * Initialize the mouse
  * @remarks	Originally called 'init_mouse'
  */
-void initMouse() {
+void MouseHandler::initMouse() {
 	registres reg;
 
 	mouse_shwn = 0;
@@ -81,7 +71,7 @@ void initMouse() {
  * Hide the mouse
  * @remarks	Originally called 'hide_mouse'
  */
-void hideMouse() {
+void MouseHandler::hideMouse() {
 	--mouse_shwn;
 	if (mouse_shwn == 0) {
 		bool imp = odd(y_s);
@@ -173,7 +163,7 @@ void hideMouse() {
  * Show mouse
  * @remarks	Originally called 'show_mouse'
  */
-void showMouse() {
+void MouseHandler::showMouse() {
 	int k, l;
 
 	mouse_shwn = mouse_shwn + 1;
@@ -258,7 +248,7 @@ void showMouse() {
  * Set mouse position
  * @remarks	Originally called 'pos_mouse'
  */
-void setMousePos(int x, int y) {
+void MouseHandler::setMousePos(int x, int y) {
 	if (x > 314 * g_res)
 		x = 314 * g_res;
 	else if (x < 0)
@@ -278,7 +268,7 @@ void setMousePos(int x, int y) {
  * Get mouse poisition
  * @remarks	Originally called 'read_pos_mouse'
  */
-void getMousePos_(int &x, int &y, int &c) {
+void MouseHandler::getMousePos_(int &x, int &y, int &c) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
 	c = g_vm->getMouseClick() ? 1 : 0;
@@ -288,7 +278,7 @@ void getMousePos_(int &x, int &y, int &c) {
  * Move mouse
  * @remarks	Originally called 'mov_mouse'
  */
-void moveMouse(bool &funct, char &key) {
+void MouseHandler::moveMouse(bool &funct, char &key) {
 	bool p_key;
 	char in1, in2;
 	int cx, cy, cd;
@@ -443,4 +433,18 @@ void moveMouse(bool &funct, char &key) {
 	}
 }
 
+/**
+ * Engine function : Is mouse in a given rect?
+ * @remarks	Originally called 'dans_rect'
+ */
+bool MouseHandler::isMouseIn(rectangle r) {
+	int x, y, c;
+
+	getMousePos_(x, y, c);
+	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
+		return true;
+
+	return false;
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 532644a..e9cc8af 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -28,24 +28,30 @@
 #ifndef MORTEVIELLE_MOUSE_H
 #define MORTEVIELLE_MOUSE_H
 
+#include "mortevielle/var_mor.h"
+
 namespace Mortevielle {
 
-extern bool int_m;
-
-extern int m_show,
-        x_s,
-        y_s,
-        p_o_s,
-        mouse_shwn;
-
-void initMouse();
-//extern void change_mouse(int t);
-//extern void dessine_souris(int xf, int yf);
-extern void hideMouse();
-extern void showMouse();
-extern void setMousePos(int x, int y);
-extern void getMousePos_(int &x, int &y, int &c);
-extern void moveMouse(bool &funct, char &key);
+class MouseHandler {
+protected:
+	int s_s[12][6];
+public:
+	bool int_m;
+
+	int m_show;
+	int x_s;
+	int y_s;
+	int p_o_s;
+	int mouse_shwn;
+
+	void initMouse();
+	void hideMouse();
+	void showMouse();
+	void setMousePos(int x, int y);
+	void getMousePos_(int &x, int &y, int &c);
+	void moveMouse(bool &funct, char &key);
+	bool isMouseIn(rectangle r);
+};
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index c93107c..1947e3d 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -351,7 +351,7 @@ void taffich() {
 	}
 
 	g_vm->_okdes = true;
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	lgt = 0;
 	Common::String filename;
 
@@ -450,7 +450,7 @@ void taffich() {
 		}
 		charani(filename, lgt, handle);
 	}
-	showMouse();
+	g_vm->_mouse.showMouse();
 	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 9b0f72c..1ac883f 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -134,7 +134,7 @@ void chartex() {
 void dialpre() {
 	/* debug('o3 dialpre'); */
 	g_crep = 998;
-	int_m = true;
+	g_vm->_mouse.int_m = true;
 }
 
 void music() {
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index d054308..9458da3 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -119,7 +119,7 @@ void SavegameManager::loadSavegame(int n) {
  * Load a saved game
  */
 Common::Error SavegameManager::loadGame(int n) {
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	maivid();
 	loadSavegame(n);
 	
@@ -127,7 +127,7 @@ Common::Error SavegameManager::loadGame(int n) {
 	g_vm->charToHour();
 	g_vm->initGame();
 	g_vm->gameLoaded();
-	showMouse();
+	g_vm->_mouse.showMouse();
 	return Common::kNoError;
 }
 
@@ -138,7 +138,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	Common::OutSaveFile *f;
 	int i;
 
-	hideMouse();
+	g_vm->_mouse.hideMouse();
 	g_vm->hourToChar();
 	
 	for (i = 0; i <= 389; ++i)
@@ -167,7 +167,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	
 	// Skipped: dialog asking to swap floppy
 
-	showMouse();
+	g_vm->_mouse.showMouse();
 	return Common::kNoError;
 }
 


Commit: 7eabd1e5b8c931a0c62f78cd721751b1f53bda50
    https://github.com/scummvm/scummvm/commit/7eabd1e5b8c931a0c62f78cd721751b1f53bda50
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:32-07:00

Commit Message:
MORTEVIELLE: Refactor mouse class

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index f1faee0..68d2852 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -45,7 +45,8 @@ int Alert::show(const Common::String &msg, int n) {
 	Common::String st, chaine;
 	int limit[3][3];
 	Common::String s[3];
-	int cx, cy, nbcol, lignNumb;
+	Common::Point curPos;
+	int nbcol, lignNumb;
 	bool newaff, test, test1, test2, test3, dum;
 	Common::String cas;
 
@@ -70,17 +71,17 @@ int Alert::show(const Common::String &msg, int n) {
 		i = 0;
 		g_vm->_screenSurface._textPos.y = 70;
 		do {
-			cx = 320;
+			curPos.x = 320;
 			st = "";
 			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
 				++i;
 				st = st + chaine[i];
 				if (g_res == 2)
-					cx -= 3;
+					curPos.x -= 3;
 				else
-					cx -= 5;
+					curPos.x -= 5;
 			}
-			g_vm->_screenSurface.putxy(cx, g_vm->_screenSurface._textPos.y);
+			g_vm->_screenSurface.putxy(curPos.x, g_vm->_screenSurface._textPos.y);
 			g_vm->_screenSurface._textPos.y += 6;
 			g_vm->_screenSurface.drawString(st, 4);
 			++i;
@@ -108,15 +109,14 @@ int Alert::show(const Common::String &msg, int n) {
 		g_vm->_mouse.moveMouse(dum, dummyKey);
 		CHECK_QUIT0;
 
-		cx = g_vm->_mouse.x_s;
-		cy = g_vm->_mouse.y_s;
-		test = (cy > 95) && (cy < 105);
+		curPos = g_vm->_mouse._pos;
+		test = (curPos.y > 95) && (curPos.y < 105);
 		newaff = false;
 		if (test) {
-			test1 = (cx > limit[1][1]) && (cx < limit[1][2]);
+			test1 = (curPos.x > limit[1][1]) && (curPos.x < limit[1][2]);
 			test2 = test1;
 			if (caseNumb > 1)
-				test2 = test1 || ((cx > limit[2][1]) && (cx < limit[2][2]));
+				test2 = test1 || ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2]));
 			if (test2) {
 				newaff = true;
 				if (test1)
@@ -157,8 +157,8 @@ int Alert::show(const Common::String &msg, int n) {
 			quoi = 0;
 			g_vm->_mouse.showMouse();
 		}
-		test3 = (cy > 95) && (cy < 105) && (((cx > limit[1][1]) && (cx < limit[1][2]))
-		                                    || ((cx > limit[2][1]) && (cx < limit[2][2])));
+		test3 = (curPos.y > 95) && (curPos.y < 105) && (((curPos.x > limit[1][1]) && (curPos.x < limit[1][2]))
+		                                    || ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2])));
 	} while (!g_vm->getMouseClick());
 	g_vm->setMouseClick(false);
 	g_vm->_mouse.hideMouse();
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 3f5db6d..e4f3702 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -270,7 +270,7 @@ void Menu::invers(int ix) {
 		g_msg4 = OPCODE_NONE;
 }
 
-void Menu::util(int x, int y) {
+void Menu::util(Common::Point pos) {
 
 	int ymx = (g_menuConstants[g_msg3 - 1][3] << 3) + 16;
 	int dxcar = g_menuConstants[g_msg3 - 1][2];
@@ -282,8 +282,8 @@ void Menu::util(int x, int y) {
 	else
 		ix = 3;
 	int xmx = dxcar * ix * g_res + xmn + 2;
-	if ((x > xmn) && (x < xmx) && (y < ymx) && (y > 15)) {
-		ix = (((uint)y >> 3) - 1) + (g_msg3 << 8);
+	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
+		ix = (((uint)pos.y >> 3) - 1) + (g_msg3 << 8);
 		if (ix != g_msg4) {
 			invers(1);
 			g_msg4 = ix;
@@ -417,35 +417,32 @@ void Menu::mdn() {
 	if (!_menuActive)
 		return;
 
-	int x = g_vm->_mouse.x_s;
-	int y = g_vm->_mouse.y_s;
+	Common::Point curPos = g_vm->_mouse._pos;
 	if (!g_vm->getMouseClick()) {
-		if ((x == g_xprec) && (y == g_yprec))
+		if (curPos == g_vm->_prevPos)
 			return;
-		else {
-			g_xprec = x;
-			g_yprec = y;
-		}
+		else
+			g_vm->_prevPos = curPos;
 		
-		bool tes =  (y < 11) 
-		   && ((x >= (28 * g_res) && x <= (28 * g_res + 24)) 
-		   ||  (x >= (76 * g_res) && x <= (76 * g_res + 24))
-		   || ((x > 124 * g_res) && (x < 124 * g_res + 24))
-		   || ((x > 172 * g_res) && (x < 172 * g_res + 24))
-		   || ((x > 220 * g_res) && (x < 220 * g_res + 24))
-		   || ((x > 268 * g_res) && (x < 268 * g_res + 24)));
+		bool tes =  (curPos.y < 11) 
+		   && ((curPos.x >= (28 * g_res) && curPos.x <= (28 * g_res + 24)) 
+		   ||  (curPos.x >= (76 * g_res) && curPos.x <= (76 * g_res + 24))
+		   || ((curPos.x > 124 * g_res) && (curPos.x < 124 * g_res + 24))
+		   || ((curPos.x > 172 * g_res) && (curPos.x < 172 * g_res + 24))
+		   || ((curPos.x > 220 * g_res) && (curPos.x < 220 * g_res + 24))
+		   || ((curPos.x > 268 * g_res) && (curPos.x < 268 * g_res + 24)));
 		if (tes) {
 			int ix;
 
-			if (x < 76 * g_res)
+			if (curPos.x < 76 * g_res)
 				ix = MENU_INVENTORY;
-			else if (x < 124 * g_res)
+			else if (curPos.x < 124 * g_res)
 				ix = MENU_MOVE;
-			else if (x < 172 * g_res)
+			else if (curPos.x < 172 * g_res)
 				ix = MENU_ACTION;
-			else if (x < 220 * g_res)
+			else if (curPos.x < 220 * g_res)
 				ix = MENU_SELF;
-			else if (x < 268 * g_res)
+			else if (curPos.x < 268 * g_res)
 				ix = MENU_DISCUSS;
 			else
 				ix = MENU_FILE;
@@ -458,8 +455,8 @@ void Menu::mdn() {
 					g_msg4 = OPCODE_NONE;
 				}
 		} else { // Not in the MenuTitle line
-			if ((y > 11) && (_multiTitle))
-				util(x, y);
+			if ((curPos.y > 11) && (_multiTitle))
+				util(curPos);
 		}
 	} else {       // There was a click
 		if ((g_msg3 == MENU_FILE) && (g_msg4 != OPCODE_NONE)) {
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index adfe359..ccf5bd8 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -28,13 +28,14 @@
 #ifndef MORTEVIELLE_MENU_H
 #define MORTEVIELLE_MENU_H
 
+#include "common/rect.h"
 #include "common/str.h"
 
 namespace Mortevielle {
 
 class Menu {
 private:
-	void util(int x, int y);
+	void util(Common::Point pos);
 	void invers(int ix);
 	void menuDown(int ii);
 public:
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 439d925..041841f 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -756,7 +756,7 @@ void tinke() {
 		g_vm->_minute = 30;
 		drawClock();
 	}
-	if (g_vm->_mouse.y_s < 12)
+	if (g_vm->_mouse._pos.y < 12)
 		return;
 
 	if (!g_vm->_blo) {
@@ -1129,7 +1129,7 @@ void tfleche() {
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
-				inRect = (g_vm->_mouse.x_s < 256 * g_res) && (g_vm->_mouse.y_s < 176) && (g_vm->_mouse.y_s > 12);
+				inRect = (g_vm->_mouse._pos.x < 256 * g_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
 			tinke();
 		} while (!(qust || inRect || g_vm->_anyone));
 
@@ -1141,8 +1141,8 @@ void tfleche() {
 		g_vm->_keyPressedEsc = true;
 
 	if (inRect) {
-		g_x = g_vm->_mouse.x_s;
-		g_y = g_vm->_mouse.y_s;
+		g_x = g_vm->_mouse._pos.x;
+		g_y = g_vm->_mouse._pos.y;
 	}
 }
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f376e57..4a8961f 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -339,8 +339,8 @@ bool MortevielleEngine::handleEvents() {
 	case Common::EVENT_LBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
 		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
-		g_vm->_mouse.x_s = event.mouse.x;
-		g_vm->_mouse.y_s = event.mouse.y / 2;
+		g_vm->_mouse._pos.x = event.mouse.x;
+		g_vm->_mouse._pos.y = event.mouse.y / 2;
 
 		if (event.type == Common::EVENT_LBUTTONDOWN)
 			_mouseClick = true;
@@ -652,7 +652,7 @@ void MortevielleEngine::handleAction() {
 				g_mnumo = g_msg[4];
 			if (!_anyone) {
 				if ((_heroSearching) || (_obpart)) {
-					if (g_vm->_mouse.y_s < 12)
+					if (g_vm->_mouse._pos.y < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 477415b..e6df670 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -114,6 +114,7 @@ private:
 	void handleAction();
 public:
 	Common::String _hintPctMessage;
+	Common::Point _prevPos;
 
 	bool _roomPresenceLuc;
 	bool _roomPresenceIda;
@@ -126,7 +127,6 @@ public:
 	bool _toiletsPresenceBobMax;
 	bool _bathRoomPresenceBobMax;
 	bool _room9PresenceLeo;
-
 	bool _soundOff;
 	bool _largestClearScreen;
 	bool _hiddenHero;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index c5f0e21..a898f22 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -33,38 +33,15 @@
 
 namespace Mortevielle {
 
-const int m_arrow = 0;
-const int m_point_hand = 1;
-
 /**
  * Initialize the mouse
  * @remarks	Originally called 'init_mouse'
  */
 void MouseHandler::initMouse() {
-	registres reg;
-
-	mouse_shwn = 0;
-	x_s = 0;
-	y_s = 0;
-	p_o_s = 0;
+	_counter = 0;
+	_pos = Common::Point(0, 0);
 	
 	g_vm->setMouseClick(false);
-	m_show = m_arrow;
-	if ((READ_LE_UINT16(&g_mem[0xcc]) == 0) && (READ_LE_UINT16(&g_mem[0xce]) == 0))
-		int_m = false;
-
-	if (int_m) {
-		reg._ax = 0;
-		intr(0x33, reg);
-		int_m = (reg._ax == -1);
-		if (int_m) {
-			reg._ax = 4;
-			reg._cx = 0;
-			reg._dx = 0;
-
-			intr(0x33, reg);
-		}
-	}
 }
 
 /**
@@ -72,14 +49,13 @@ void MouseHandler::initMouse() {
  * @remarks	Originally called 'hide_mouse'
  */
 void MouseHandler::hideMouse() {
-	--mouse_shwn;
-	if (mouse_shwn == 0) {
-		bool imp = odd(y_s);
-		int j = p_o_s;
+	--_counter;
+	if (_counter == 0) {
+		int j = 0;
 		switch (g_vm->_currGraphicalDevice) {
 		case MODE_CGA: {
 			int k = 0;
-			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
+			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 			do {
 				WRITE_LE_UINT16(&g_mem[0xb000 * 16 + j], s_s[0][k]);
 				WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j + 2], s_s[1][k]);
@@ -90,11 +66,12 @@ void MouseHandler::hideMouse() {
 			} while (k < 5);
 			}
 			break;
-		case MODE_AMSTRAD1512:
+		case MODE_AMSTRAD1512: {
+			bool imp = odd(_pos.y);
 			for (int i = 0; i <= 3; ++i) {
 				g_port[0x3dd] = 1 << i;
 				int k = 0;
-				j = p_o_s;
+				j = 0;
 				do {
 					if (imp) {
 						WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
@@ -108,6 +85,7 @@ void MouseHandler::hideMouse() {
 				} while (k < 8);
 			}
 			break;
+			}
 		case MODE_EGA: {
 			g_port[0x3c4] = 2;
 			g_port[0x3ce] = 8;
@@ -116,7 +94,7 @@ void MouseHandler::hideMouse() {
 			do {
 				g_port[0x3c5] = 1 << i;
 				int k = 0;
-				j = p_o_s;
+				j = 0;
 				do {
 					// Useless ?
 					// ps = mem[0xa000 * 16 + j];
@@ -133,7 +111,7 @@ void MouseHandler::hideMouse() {
 			}
 			break;
 		case MODE_HERCULES:
-			j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
+			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 			for (int i = 0; i <= 5; ++i) {
 				for (int k = 0; k <= 3; ++k) 
 					WRITE_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
@@ -141,7 +119,7 @@ void MouseHandler::hideMouse() {
 			}
 			break;
 		case MODE_TANDY: {
-			j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
+			j = ((uint)_pos.y >> 2) * 160 + ((uint)_pos.x >> 1);
 			int k = 0;
 			do {
 				for (int i = 0; i <= 3; ++i) {
@@ -166,16 +144,15 @@ void MouseHandler::hideMouse() {
 void MouseHandler::showMouse() {
 	int k, l;
 
-	mouse_shwn = mouse_shwn + 1;
-	if (mouse_shwn != 1)
+	++_counter;
+	if (_counter != 1)
 		return;
-	int j = p_o_s;
-	bool imp = odd(y_s);
-	int i = x_s & 7;
+	int j = 0;
+	int i = _pos.x & 7;
 	switch (g_vm->_currGraphicalDevice) {
 	case MODE_CGA:
 		k = 0;
-		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
+		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 		do {
 			s_s[0][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
 			s_s[1][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j + 2]);
@@ -185,10 +162,11 @@ void MouseHandler::showMouse() {
 			++k;
 		} while (k < 5);
 		break;
-	case MODE_AMSTRAD1512:
+	case MODE_AMSTRAD1512: {
+		bool imp = odd(_pos.y);
 		for (i = 0; i <= 3; ++i) {
-			j = p_o_s;
-			imp = odd(y_s);
+			j = 0;
+			imp = odd(_pos.y);
 			g_port[0x3de] = i;
 			k = 0;
 			do {
@@ -204,13 +182,14 @@ void MouseHandler::showMouse() {
 			} while (k < 8);
 		}
 		break;
+		}
 	case MODE_EGA:
 		g_port[0x3ce] = 4;
 		l = 0;
 		do {
 			g_port[0x3cf] = l;
 			k = 0;
-			j = p_o_s;
+			j = 0;
 			do {
 				s_s[l][k] = g_mem[0xa000 * 16 + j] + (g_mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
@@ -220,7 +199,7 @@ void MouseHandler::showMouse() {
 		} while (l != 4);
 		break;
 	case MODE_HERCULES:
-		j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
+		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 		for (i = 0; i <= 5; ++i) {
 			for (k = 0; k <= 3; ++k)
 				s_s[i][k] = READ_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j]);
@@ -228,7 +207,7 @@ void MouseHandler::showMouse() {
 		}
 		break;
 	case MODE_TANDY:
-		j = ((uint)y_s >> 2) * 160 + ((uint)x_s >> 1);
+		j = ((uint)_pos.y >> 2) * 160 + ((uint)_pos.x >> 1);
 		k = 0;
 		do {
 			for (i = 0; i <= 3; ++i) {
@@ -248,20 +227,20 @@ void MouseHandler::showMouse() {
  * Set mouse position
  * @remarks	Originally called 'pos_mouse'
  */
-void MouseHandler::setMousePos(int x, int y) {
-	if (x > 314 * g_res)
-		x = 314 * g_res;
-	else if (x < 0)
-		x = 0;
-	if (y > 199)
-		y = 199;
-	else if (y < 0)
-		y = 0;
-	if ((x == x_s) && (y == y_s))
+void MouseHandler::setMousePos(Common::Point newPos) {
+	if (newPos.x > 314 * g_res)
+		newPos.x = 314 * g_res;
+	else if (newPos.x < 0)
+		newPos.x = 0;
+	if (newPos.y > 199)
+		newPos.y = 199;
+	else if (newPos.y < 0)
+		newPos.y = 0;
+	if (newPos == _pos)
 		return;
 
 	// Set the new position
-	g_vm->setMousePos(Common::Point(x, y));
+	g_vm->setMousePos(newPos);
 }
 
 /**
@@ -300,16 +279,16 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 		getMousePos_(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4':
-			cx = cx - 8;
+			cx -= 8;
 			break;
 		case '2':
-			cy = cy + 8;
+			cy += 8;
 			break;
 		case '6':
-			cx = cx + 8;
+			cx += 8;
 			break;
 		case '8':
-			cy = cy - 8;
+			cy -= 8;
 			break;
 		case '7':
 			cy = 1;
@@ -428,7 +407,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			break;
 		}
 
-		setMousePos(cx, cy);
+		setMousePos(Common::Point(cx, cy));
 		p_key = g_vm->keyPressed();
 	}
 }
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index e9cc8af..76a9991 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -33,21 +33,17 @@
 namespace Mortevielle {
 
 class MouseHandler {
-protected:
+private:
 	int s_s[12][6];
-public:
-	bool int_m;
+	int _counter;
 
-	int m_show;
-	int x_s;
-	int y_s;
-	int p_o_s;
-	int mouse_shwn;
+public:
+	Common::Point _pos;
 
 	void initMouse();
 	void hideMouse();
 	void showMouse();
-	void setMousePos(int x, int y);
+	void setMousePos(Common::Point newPos);
 	void getMousePos_(int &x, int &y, int &c);
 	void moveMouse(bool &funct, char &key);
 	bool isMouseIn(rectangle r);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 1ac883f..2f86437 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -134,7 +134,6 @@ void chartex() {
 void dialpre() {
 	/* debug('o3 dialpre'); */
 	g_crep = 998;
-	g_vm->_mouse.int_m = true;
 }
 
 void music() {
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 495487c..f4a5d12 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -105,8 +105,6 @@ int g_x,
         g_menup,
         g_mpers,
         g_mnumo,
-        g_xprec,
-        g_yprec,
         g_perdep,
         g_prebru,
         g_numpal,
@@ -176,10 +174,6 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 int g_port[0xfff];
 byte g_mem[65536 * 16];
 
-void intr(int intNum, registres &regs) {
-	warning("STUBBED: Call to DOS interrupt #%d", intNum);
-}
-
 /**
  * Engine function - Get a random number between two values
  * @remarks	Originally called 'get_random_number' and 'hazard'
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 19bde40..d71c0d7 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -131,10 +131,6 @@ struct sav_chaine {
 	byte _fullHour;
 };
 
-struct registres {
-	int _ax, _bx, _cx, _dx, _bp, _si, _di, _ds, _es, _flags;
-};
-
 struct ind {
 	int _indis;
 	byte _point;
@@ -210,8 +206,6 @@ extern int g_x,
         g_menup,
         g_mpers,
         g_mnumo,
-        g_xprec,
-        g_yprec,
         g_perdep,
         g_prebru,
         g_numpal,
@@ -264,7 +258,6 @@ extern byte g_mem[65536 * 16];
 #define hires {}
 
 extern void palette(int v1);
-extern void intr(int intNum, registres &regs);
 extern int getRandomNumber(int minval, int maxval);
 
 extern void s_char(int Gd, int y, int dy);


Commit: 00664fd0e9e1829f029b45f9599d870cf4c37b8b
    https://github.com/scummvm/scummvm/commit/00664fd0e9e1829f029b45f9599d870cf4c37b8b
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:34-07:00

Commit Message:
MORTEVIELLE: Fix regression

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 7949d93..86c03b4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -70,9 +70,12 @@ void MortevielleEngine::fctMove() {
 		} else if (g_num == 7) {
 			g_s._currPlace = ATTIC;
 			_menu.setDestinationMenuText(ATTIC);
-		} else if (g_num != 6)
+		}
+		
+		if (g_num != 6)
 			g_s._currPlace = ROOM26;
-		else if ((g_num > 1) && (g_num < 6))
+		
+		if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
 		else if (g_num > 7)
 			g_ment = g_num - 3;


Commit: bf8083f2aaad03a1865ff6387c2e79e212ff65f6
    https://github.com/scummvm/scummvm/commit/bf8083f2aaad03a1865ff6387c2e79e212ff65f6
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:35-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 86c03b4..a4255fd 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -83,7 +83,7 @@ void MortevielleEngine::fctMove() {
 		if (g_num != 6)
 			affrep();
 		else
-			aldepl();
+			showMoveMenuAlert();
 		return;
 	}
 	tsort();
@@ -598,7 +598,7 @@ void MortevielleEngine::fctOpen() {
 	}
 
 	if (g_caff == 15) {
-		aldepl();
+		showMoveMenuAlert();
 		return;
 	}
 
@@ -1132,7 +1132,7 @@ void MortevielleEngine::fctEnter() {
 		gotoDiningRoom();
 		_menu.setDestinationMenuText(g_s._currPlace);
 	} else if (g_s._currPlace == LANDING)
-		aldepl();
+		showMoveMenuAlert();
 	else if (g_ment == 0)
 		g_crep = 997;
 	else if ((g_ment == 9) && (g_s._selectedObjectId != 136)) {
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index e4f3702..6cf09be 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -38,7 +38,16 @@
 
 namespace Mortevielle {
 
-/* NIVEAU 14*/
+const byte _menuConstants[8][4] = {
+	{ 7, 37, 22,  8},
+	{19, 33, 23,  7},
+	{31, 89, 10, 21},
+	{43, 25, 11,  5},
+	{55, 37,  5,  8},
+	{64, 13, 11,  2},
+	{62, 22, 13,  4},
+	{62, 25, 13,  5}
+};
 
 /**
  * Setup a menu's contents
@@ -219,62 +228,66 @@ void Menu::drawMenu() {
 	_multiTitle = false;
 }
 
-void Menu::invers(int ix) {
-	Common::String s;
-
+/**
+ * Menu function - Invert a menu entry
+ * @remarks	Originally called 'invers'
+ */
+void Menu::invert(int indx) {
 	if (g_msg4 == OPCODE_NONE)
 		return;
 
 	int menuIndex = lo(g_msg4);
 
-	g_vm->_screenSurface.putxy(g_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+
+	Common::String str;
 	switch (g_msg3) {
 	case 1:
-		s = _inventoryStringArray[menuIndex];
+		str = _inventoryStringArray[menuIndex];
 		break;
 	case 2:
-		s = _moveStringArray[menuIndex];
+		str = _moveStringArray[menuIndex];
 		break;
 	case 3:
-		s = _actionStringArray[menuIndex];
+		str = _actionStringArray[menuIndex];
 		break;
 	case 4:
-		s = _selfStringArray[menuIndex];
+		str = _selfStringArray[menuIndex];
 		break;
 	case 5:
-		s = _discussStringArray[menuIndex];
+		str = _discussStringArray[menuIndex];
 		break;
 	case 6:
-		s = g_vm->getEngineString(S_SAVE_LOAD + menuIndex);
+		str = g_vm->getEngineString(S_SAVE_LOAD + menuIndex);
 		break;
 	case 7:
-		s = g_vm->getEngineString(S_SAVE_LOAD + 1);
-		s += ' ';
-		s += (char)(48 + menuIndex);
+		str = g_vm->getEngineString(S_SAVE_LOAD + 1);
+		str += ' ';
+		str += (char)(48 + menuIndex);
 		break;
 	case 8:
 		if (menuIndex == 1) {
-			s = g_vm->getEngineString(S_RESTART);
+			str = g_vm->getEngineString(S_RESTART);
 		} else {
-			s = g_vm->getEngineString(S_SAVE_LOAD + 2);
-			s += ' ';
-			s += (char)(47 + menuIndex);
+			str = g_vm->getEngineString(S_SAVE_LOAD + 2);
+			str += ' ';
+			str += (char)(47 + menuIndex);
 		}
 		break;
 	default:
 		break;
 	}
-	if ((s[0] != '*') && (s[0] != '<'))
-		g_vm->_screenSurface.drawString(s, ix);
+	if ((str[0] != '*') && (str[0] != '<'))
+		g_vm->_screenSurface.drawString(str, indx);
 	else
 		g_msg4 = OPCODE_NONE;
 }
 
 void Menu::util(Common::Point pos) {
 
-	int ymx = (g_menuConstants[g_msg3 - 1][3] << 3) + 16;
-	int dxcar = g_menuConstants[g_msg3 - 1][2];
-	int xmn = (g_menuConstants[g_msg3 - 1][0] << 2) * g_res;
+	int ymx = (_menuConstants[g_msg3 - 1][3] << 3) + 16;
+	int dxcar = _menuConstants[g_msg3 - 1][2];
+	int xmn = (_menuConstants[g_msg3 - 1][0] << 2) * g_res;
 
 	int ix;
 	if (g_res == 1)
@@ -285,12 +298,12 @@ void Menu::util(Common::Point pos) {
 	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
 		ix = (((uint)pos.y >> 3) - 1) + (g_msg3 << 8);
 		if (ix != g_msg4) {
-			invers(1);
+			invert(1);
 			g_msg4 = ix;
-			invers(0);
+			invert(0);
 		}
 	} else if (g_msg4 != OPCODE_NONE) {
-		invers(1);
+		invert(1);
 		g_msg4 = OPCODE_NONE;
 	}
 }
@@ -299,8 +312,8 @@ void Menu::util(Common::Point pos) {
  * Draw a menu
  */
 void Menu::menuDown(int ii) {
-	int cx, xcc;
-	int xco, nb_lig;
+	int cx, xcc, xco;
+	int lignNumb;
 
 	/* debug('menuDown'); */
 
@@ -308,23 +321,23 @@ void Menu::menuDown(int ii) {
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
 	// Draw the menu
-	xco = g_menuConstants[ii - 1][0];
-	nb_lig = g_menuConstants[ii - 1][3];
+	xco = _menuConstants[ii - 1][0];
+	lignNumb = _menuConstants[ii - 1][3];
 	g_vm->_mouse.hideMouse();
-	sauvecr(10, (g_menuConstants[ii - 1][1] + 1) << 1);
+	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (g_res == 1)
 		cx = 10;
 	else
 		cx = 6;
-	xcc = xco + (g_menuConstants[ii - 1][2] * cx) + 6;
+	xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
 	if ((ii == 4) && (g_vm->getLanguage() == Common::EN_ANY))
 		// Extra width needed for Self menu in English version
 		xcc = 435;
 
-	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (g_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (g_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (g_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (g_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
+	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
 	g_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
@@ -374,7 +387,7 @@ void Menu::menuDown(int ii) {
 			break;
 		}
 		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
-	} while (cx != nb_lig);
+	} while (cx != lignNumb);
 	_multiTitle = true;
 	g_vm->_mouse.showMouse();
 }
@@ -384,7 +397,7 @@ void Menu::menuDown(int ii) {
  */
 void Menu::menuUp(int xx) {
 	if (_multiTitle) {
-		charecr(10, (g_menuConstants[xx - 1][1] + 1) << 1);
+		charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index ccf5bd8..7f224a3 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -33,10 +33,15 @@
 
 namespace Mortevielle {
 
+enum {
+	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SELF = 4,
+	MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,   MENU_LOAD = 8
+};
+
 class Menu {
 private:
 	void util(Common::Point pos);
-	void invers(int ix);
+	void invert(int indx);
 	void menuDown(int ii);
 public:
 	bool _menuActive;
@@ -67,10 +72,5 @@ public:
 	void unsetSearchMenu();
 };
 
-enum {
-	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SELF = 4,
-	MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,   MENU_LOAD = 8
-};
-
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 041841f..4ba68c3 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -109,18 +109,6 @@ void pictout(int seg, int dep, int x, int y) {
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
 
-void sauvecr(int y, int dy) {
-	g_vm->_mouse.hideMouse();
-	s_sauv(g_vm->_currGraphicalDevice, y, dy);
-	g_vm->_mouse.showMouse();
-}
-
-void charecr(int y, int dy) {
-	g_vm->_mouse.hideMouse();
-	s_char(g_vm->_currGraphicalDevice, y, dy);
-	g_vm->_mouse.showMouse();
-}
-
 void adzon() {
 	Common::File f;
 
@@ -363,7 +351,7 @@ void repon(int f, int m) {
 }
 
 int chlm() {
-	int retval = getRandomNumber(1, 2);
+	int retval = g_vm->getRandomNumber(1, 2);
 	if (retval == 2)
 		retval = 128;
 	
@@ -459,13 +447,13 @@ void ecfren(int &p, int &rand, int cf, int roomId) {
 		p = -400;
 	if (p != -500) {
 		p += cf;
-		rand = getRandomNumber(1, 100);
+		rand = g_vm->getRandomNumber(1, 100);
 	}
 }
 
 void becfren(int roomId) {
 	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
-		int rand = getRandomNumber(1, 2);
+		int rand = g_vm->getRandomNumber(1, 2);
 		if (roomId == GREEN_ROOM) {
 			if (rand == 1)
 				g_vm->_roomPresenceLuc = true;
@@ -503,7 +491,7 @@ void init_nbrepm() {
 
 void phaz(int &rand, int &p, int cf) {
 	p += cf;
-	rand = getRandomNumber(1, 100);
+	rand = g_vm->getRandomNumber(1, 100);
 }
 
 /**
@@ -522,7 +510,7 @@ void resetVariables() {
 	g_s._secretPassageObjectId = 0;
 	g_s._purpleRoomObjectId = 136;
 	g_s._cryptObjectId = 141;
-	g_s._faithScore = getRandomNumber(4, 10);
+	g_s._faithScore = g_vm->getRandomNumber(4, 10);
 	g_s._currPlace = MANOR_FRONT;
 
 	for (int i = 2; i <= 6; ++i)
@@ -591,7 +579,7 @@ int t11(int roomId) {
 			else if (roomId == CHAPEL)
 				p = g_vm->getPresenceStatsChapel(h);
 			p += g_s._faithScore;
-			rand = getRandomNumber(1, 100);
+			rand = g_vm->getRandomNumber(1, 100);
 			if (rand > p) {
 				g_vm->displayAloneText();
 				retVal = 0;
@@ -621,7 +609,7 @@ void cavegre() {
 	g_vm->clearScreenType3();
 	g_vm->prepareScreenType2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
-	int rand = (getRandomNumber(0, 4)) - 2;
+	int rand = (g_vm->getRandomNumber(0, 4)) - 2;
 	g_vm->_speechManager.startSpeech(2, rand, 1);
 
 	// The original was doing here a useless loop.
@@ -827,11 +815,11 @@ void tinke() {
 					if (!g_vm->_brt) {
 						g_vm->_brt = true;
 						g_hdb = readclock();
-						if (getRandomNumber(1, 5) < 5) {
+						if (g_vm->getRandomNumber(1, 5) < 5) {
 							g_vm->clearScreenType3();
 							g_vm->prepareScreenType2();
 							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
-							int rand = (getRandomNumber(0, 4)) - 2;
+							int rand = (g_vm->getRandomNumber(0, 4)) - 2;
 							g_vm->_speechManager.startSpeech(1, rand, 1);
 							g_vm->clearScreenType3();
 						}
@@ -1067,13 +1055,13 @@ L1:
 		g_vm->_syn = true;
 		g_vm->_col = true;
 	} else {
-		if (getRandomNumber(1, 3) == 2) {
+		if (g_vm->getRandomNumber(1, 3) == 2) {
 			g_vm->_hiddenHero = false;
 			g_crep = 137;
 			goto L1;
 		} else {
 			repon(2, 136);
-			int rand = (getRandomNumber(0, 4)) - 2;
+			int rand = (g_vm->getRandomNumber(0, 4)) - 2;
 			g_vm->_speechManager.startSpeech(3, rand, 1);
 			g_vm->clearScreenType2();
 			g_vm->displayAloneText();
@@ -1287,8 +1275,14 @@ void st13(int ob) {
 		g_crep = 105;
 }
 
-void aldepl() {
-	Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
+void sauvecr(int y, int dy) {
+//	g_vm->_mouse.hideMouse();
+//	g_vm->_mouse.showMouse();
+}
+
+void charecr(int y, int dy) {
+//	g_vm->_mouse.hideMouse();
+//	g_vm->_mouse.showMouse();
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 0cd467c..d3defc1 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -114,7 +114,6 @@ extern void rechai(int &ch);
 extern int t23coul();
 extern void maivid();
 extern void st13(int ob);
-extern void aldepl();
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 4a8961f..9b7ade1 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -339,8 +339,8 @@ bool MortevielleEngine::handleEvents() {
 	case Common::EVENT_LBUTTONUP:
 	case Common::EVENT_MOUSEMOVE:
 		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
-		g_vm->_mouse._pos.x = event.mouse.x;
-		g_vm->_mouse._pos.y = event.mouse.y / 2;
+		_mouse._pos.x = event.mouse.x;
+		_mouse._pos.y = event.mouse.y / 2;
 
 		if (event.type == Common::EVENT_LBUTTONDOWN)
 			_mouseClick = true;
@@ -550,7 +550,7 @@ void MortevielleEngine::mainGame() {
 	initGame();
 	hirs();
 	drawRightFrame();
-	g_vm->_mouse.showMouse();
+	_mouse.showMouse();
 
 	// Loop to play the game
 	do {
@@ -603,7 +603,7 @@ void MortevielleEngine::handleAction() {
 		do {
 			_menu.mdn();
 			tinke();
-			g_vm->_mouse.moveMouse(funct, inkey);
+			_mouse.moveMouse(funct, inkey);
 			CHECK_QUIT;
 			temps = temps + 1;
 		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
@@ -652,7 +652,7 @@ void MortevielleEngine::handleAction() {
 				g_mnumo = g_msg[4];
 			if (!_anyone) {
 				if ((_heroSearching) || (_obpart)) {
-					if (g_vm->_mouse._pos.y < 12)
+					if (_mouse._pos.y < 12)
 						return;
 
 					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
@@ -1989,7 +1989,7 @@ void MortevielleEngine::handleOpcode() {
 void MortevielleEngine::hourToChar() {
 	int day, hour, minute;
 
-	g_vm->updateHour(day, hour, minute);
+	updateHour(day, hour, minute);
 	if (minute == 30)
 		minute = 1;
 	hour += day * 24;
@@ -2004,14 +2004,14 @@ void MortevielleEngine::hourToChar() {
 void MortevielleEngine::charToHour() {
 	int fullHour = ord(g_s._fullHour);
 	int tmpHour = fullHour % 48;
-	g_vm->_currDay = fullHour / 48;
-	g_vm->_currHalfHour = tmpHour % 2;
-	g_vm->_currHour = tmpHour / 2;
-	g_vm->_hour = g_vm->_currHour;
-	if (g_vm->_currHalfHour == 1)
-		g_vm->_minute = 30;
+	_currDay = fullHour / 48;
+	_currHalfHour = tmpHour % 2;
+	_currHour = tmpHour / 2;
+	_hour = _currHour;
+	if (_currHalfHour == 1)
+		_minute = 30;
 	else
-		g_vm->_minute = 0;
+		_minute = 0;
 }
 
 /**
@@ -2019,9 +2019,9 @@ void MortevielleEngine::charToHour() {
  * @remarks	Originally called 'clsf1'
  */
 void MortevielleEngine::clearScreenType1() {
-	g_vm->_mouse.hideMouse();
-	g_vm->_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
-	g_vm->_mouse.showMouse();
+	_mouse.hideMouse();
+	_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
+	_mouse.showMouse();
 }
 
 /**
@@ -2029,16 +2029,16 @@ void MortevielleEngine::clearScreenType1() {
  * @remarks	Originally called 'clsf2'
  */
 void MortevielleEngine::clearScreenType2() {
-	g_vm->_mouse.hideMouse();
-	if (g_vm->_largestClearScreen) {
-		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
-		g_vm->_screenSurface.drawBox(0, 175, 634, 24, 15);
-		g_vm->_largestClearScreen = false;
+	_mouse.hideMouse();
+	if (_largestClearScreen) {
+		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
+		_screenSurface.drawBox(0, 175, 634, 24, 15);
+		_largestClearScreen = false;
 	} else {
-		g_vm->_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
-		g_vm->_screenSurface.drawBox(0, 175, 634, 15, 15);
+		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
+		_screenSurface.drawBox(0, 175, 634, 15, 15);
 	}
-	g_vm->_mouse.showMouse();
+	_mouse.showMouse();
 }
 
 /**
@@ -2046,10 +2046,10 @@ void MortevielleEngine::clearScreenType2() {
  * @remarks	Originally called 'clsf3'
  */
 void MortevielleEngine::clearScreenType3() {
-	g_vm->_mouse.hideMouse();
-	g_vm->_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
-	g_vm->_screenSurface.drawBox(0, 191, 634, 8, 15);
-	g_vm->_mouse.showMouse();
+	_mouse.hideMouse();
+	_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
+	_screenSurface.drawBox(0, 191, 634, 8, 15);
+	_mouse.showMouse();
 }
 
 /**
@@ -2060,7 +2060,7 @@ void MortevielleEngine::clearScreenType10() {
 	int co, cod;
 	Common::String st;
 
-	g_vm->_mouse.hideMouse();
+	_mouse.hideMouse();
 	if (g_res == 1) {
 		co = 634;
 		cod = 534;
@@ -2068,21 +2068,37 @@ void MortevielleEngine::clearScreenType10() {
 		co = 600;
 		cod = 544;
 	}
-	g_vm->_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
+	_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
 	if (g_s._faithScore < 33)
-		st = g_vm->getEngineString(S_COOL);
+		st = getEngineString(S_COOL);
 	else if (g_s._faithScore < 66)
-		st = g_vm->getEngineString(S_LOURDE);
+		st = getEngineString(S_LOURDE);
 	else if (g_s._faithScore > 65)
-		st = g_vm->getEngineString(S_MALSAINE);
+		st = getEngineString(S_MALSAINE);
 	
-	co = 580 - (g_vm->_screenSurface.getStringWidth(st) / 2);
-	g_vm->_screenSurface.putxy(co, 92);
-	g_vm->_screenSurface.drawString(st, 4);
+	co = 580 - (_screenSurface.getStringWidth(st) / 2);
+	_screenSurface.putxy(co, 92);
+	_screenSurface.drawString(st, 4);
 
-	g_vm->_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
+	_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
 	/* rempli(69,12,32,5,255);*/
-	g_vm->_mouse.showMouse();
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Get a random number between two values
+ * @remarks	Originally called 'get_random_number' and 'hazard'
+ */
+int MortevielleEngine::getRandomNumber(int minval, int maxval) {
+	return _randomSource.getRandomNumber(maxval - minval) + minval;
+}
+
+/**
+ * Engine function - Show alert "use move menu"
+ * @remarks	Originally called 'aldepl'
+ */
+void MortevielleEngine::showMoveMenuAlert() {
+	Alert::show(getEngineString(S_USE_DEP_MENU), 1);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e6df670..c2fd857 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -154,6 +154,7 @@ public:
 	int _day;
 	int _hour;
 	int _minute;
+	float _addfix;
 
 
 	int _c_zzz;
@@ -299,6 +300,8 @@ public:
 	void clearScreenType2();
 	void clearScreenType3();
 	void clearScreenType10();
+	int getRandomNumber(int minval, int maxval);
+	void showMoveMenuAlert();
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 1947e3d..a941f79 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -136,7 +136,7 @@ Common::String deline(int num) {
 	} else if (!g_vm->_txxFileFl) {
 		wrkStr = g_vm->getGameString(num);
 	} else {
-		int i = g_t_rec[num]._indis;
+		int i = g_t_rec[num]._hintId;
 		byte k = g_t_rec[num]._point;
 		int length = 0;
 		bool endFl = false;
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 2f86437..0a93a84 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -119,7 +119,7 @@ void chartex() {
 	g_vm->_txxFileFl = true;
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		g_t_rec[i]._indis = ntpFile.readSint16LE();
+		g_t_rec[i]._hintId = ntpFile.readSint16LE();
 		g_t_rec[i]._point = ntpFile.readByte();
 	}
 
@@ -151,7 +151,7 @@ void music() {
 	fic.close();
 
 	g_vm->_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
-	g_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
+	g_vm->_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
 	g_vm->_speechManager.cctable(g_tbi);
 
 	bool fin = false;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index bd58905..ba7ef62 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -41,15 +41,15 @@ SpeechManager::SpeechManager() {
 }
 
 void SpeechManager::spfrac(int wor) {
-	g_c3._rep = (uint)wor >> 12;
-	if ((_typlec == 0) && (g_c3._code != 9))
-		if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
-				((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
-			++g_c3._rep;
+	_queue[2]._rep = (uint)wor >> 12;
+	if ((_typlec == 0) && (_queue[2]._code != 9))
+		if (((_queue[2]._code > 4) && (_queue[2]._val != 20) && (_queue[2]._rep != 3) && (_queue[2]._rep != 6) && (_queue[2]._rep != 9)) ||
+				((_queue[2]._code < 5) && ((_queue[2]._val != 19) && (_queue[2]._val != 22) && (_queue[2]._rep != 4) && (_queue[2]._rep != 9)))) {
+			++_queue[2]._rep;
 		}
 
-	g_c3._freq = ((uint)wor >> 6) & 7;
-	g_c3._acc = ((uint)wor >> 9) & 7;
+	_queue[2]._freq = ((uint)wor >> 6) & 7;
+	_queue[2]._acc = ((uint)wor >> 9) & 7;
 }
 
 void SpeechManager::charg_car(int &currWordNumb) {
@@ -57,31 +57,31 @@ void SpeechManager::charg_car(int &currWordNumb) {
 	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {
-		g_c3._val = int_;
-		g_c3._code = 5;
+		_queue[2]._val = int_;
+		_queue[2]._code = 5;
 	} else if ((int_ >= 14) && (int_ <= 21)) {
-		g_c3._val = int_;
-		g_c3._code = 6;
+		_queue[2]._val = int_;
+		_queue[2]._code = 6;
 	} else if ((int_ >= 22) && (int_ <= 47)) {
 		int_ = int_ - 22;
-		g_c3._val = int_;
-		g_c3._code = g_typcon[int_];
+		_queue[2]._val = int_;
+		_queue[2]._code = g_typcon[int_];
 	} else if ((int_ >= 48) && (int_ <= 56)) {
-		g_c3._val = int_ - 22;
-		g_c3._code = 4;
+		_queue[2]._val = int_ - 22;
+		_queue[2]._code = 4;
 	} else {
 		switch (int_) {
 		case 60:
-			g_c3._val = 32;  /*  " "  */
-			g_c3._code = 9;
+			_queue[2]._val = 32;  /*  " "  */
+			_queue[2]._code = 9;
 			break;
 		case 61:
-			g_c3._val = 46;  /*  "."  */
-			g_c3._code = 9;
+			_queue[2]._val = 46;  /*  "."  */
+			_queue[2]._code = 9;
 			break;
 		case 62:
-			g_c3._val = 35;  /*  "#"  */
-			g_c3._code = 9;
+			_queue[2]._val = 35;  /*  "#"  */
+			_queue[2]._code = 9;
 		default:
 			break;
 		}
@@ -106,7 +106,7 @@ void SpeechManager::cctable(tablint &t) {
 
 	tb[0] = 0;
 	for (int k = 0; k <= 255; ++k) {
-		tb[k + 1] = g_addfix + tb[k];
+		tb[k + 1] = g_vm->_addfix + tb[k];
 		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
@@ -176,40 +176,40 @@ void SpeechManager::trait_car() {
 	byte d3;
 	int d2, i;
 
-	switch (g_c2._code) {
+	switch (_queue[1]._code) {
 	case 9:
-		if (g_c2._val != ord('#'))
-			for (i = 0; i <= g_c2._rep; ++i)
-				entroct(g_c2._val);
+		if (_queue[1]._val != ord('#'))
+			for (i = 0; i <= _queue[1]._rep; ++i)
+				entroct(_queue[1]._val);
 		break;
 	case 5:
 	case 6:
-		if (g_c2._code == 6)
-			d3 = g_tabdph[(g_c2._val - 14) << 1];
+		if (_queue[1]._code == 6)
+			d3 = g_tabdph[(_queue[1]._val - 14) << 1];
 		else
 			d3 = kNullValue;
-		if (g_c1._code >= 5) {
-			veracf(g_c2._acc);
-			if (g_c1._code == 9) {
+		if (_queue[0]._code >= 5) {
+			veracf(_queue[1]._acc);
+			if (_queue[0]._code == 9) {
 				entroct(4);
 				if (d3 == kNullValue)
-					entroct(g_c2._val);
+					entroct(_queue[1]._val);
 				else
 					entroct(d3);
 				entroct(22);
 			}
 		}
 
-		switch (g_c2._rep) {
+		switch (_queue[1]._rep) {
 		case 0:
 			entroct(0);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 			if (d3 == kNullValue)
-				if (g_c3._code == 9)
+				if (_queue[2]._code == 9)
 					entroct(2);
 				else
 					entroct(4);
-			else if (g_c3._code == 9)
+			else if (_queue[2]._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -217,13 +217,13 @@ void SpeechManager::trait_car() {
 		case 4:
 		case 5:
 		case 6:
-			if (g_c2._rep != 4) {
-				i = g_c2._rep - 5;
+			if (_queue[1]._rep != 4) {
+				i = _queue[1]._rep - 5;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == kNullValue)
-						entroct(g_c2._val);
+						entroct(_queue[1]._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -231,24 +231,24 @@ void SpeechManager::trait_car() {
 			}
 			if (d3 == kNullValue) {
 				entroct(4);
-				entroct(g_c2._val);
+				entroct(_queue[1]._val);
 				entroct(0);
 			} else {
 				entroct(0);
-				entroct(g_c2._val);
+				entroct(_queue[1]._val);
 				entroct(3);
 			}
 			break;
 		case 7:
 		case 8:
 		case 9:
-			if (g_c2._rep != 7) {
-				i = g_c2._rep - 8;
+			if (_queue[1]._rep != 7) {
+				i = _queue[1]._rep - 8;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == kNullValue)
-						entroct(g_c2._val);
+						entroct(_queue[1]._val);
 					else
 						entroct(d3);
 					entroct(3);
@@ -256,32 +256,32 @@ void SpeechManager::trait_car() {
 			}
 			if (d3 == kNullValue) {
 				entroct(0);
-				entroct(g_c2._val);
+				entroct(_queue[1]._val);
 				entroct(2);
 			} else {
 				entroct(0);
-				entroct(g_c2._val);
+				entroct(_queue[1]._val);
 				entroct(0);
 			}
 			break;
 		case 1:
 		case 2:
 		case 3:
-			if (g_c2._rep != 1) {
-				i = g_c2._rep - 2;
+			if (_queue[1]._rep != 1) {
+				i = _queue[1]._rep - 2;
 				do {
 					--i;
 					entroct(0);
 					if (d3 == kNullValue)
-						entroct(g_c2._val);
+						entroct(_queue[1]._val);
 					else
 						entroct(d3);
 					entroct(3);
 				} while (i >= 0);
 			}
 			entroct(0);
-			entroct(g_c2._val);
-			if (g_c3._code == 9)
+			entroct(_queue[1]._val);
+			if (_queue[2]._code == 9)
 				entroct(0);
 			else
 				entroct(1);
@@ -293,16 +293,16 @@ void SpeechManager::trait_car() {
 
 	case 2:
 	case 3:
-		d3 = g_c2._code + 5; //  7 ou 8  => Corresponding vowel
-		if (g_c1._code > 4) {
-			veracf(g_c2._acc);
-			if (g_c1._code == 9) {
+		d3 = _queue[1]._code + 5; //  7 ou 8  => Corresponding vowel
+		if (_queue[0]._code > 4) {
+			veracf(_queue[1]._acc);
+			if (_queue[0]._code == 9) {
 				entroct(4);
 				entroct(d3);
 				entroct(22);
 			}
 		}
-		i = g_c2._rep;
+		i = _queue[1]._rep;
 		assert(i >= 0);
 		if (i != 0) {
 			do {
@@ -312,24 +312,24 @@ void SpeechManager::trait_car() {
 				entroct(3);
 			} while (i > 0);
 		}
-		veracf(g_c3._acc);
-		if (g_c3._code == 6) {
+		veracf(_queue[2]._acc);
+		if (_queue[2]._code == 6) {
 			entroct(4);
-			entroct(g_tabdph[(g_c3._val - 14) << 1]);
-			entroct(g_c2._val);
+			entroct(g_tabdph[(_queue[2]._val - 14) << 1]);
+			entroct(_queue[1]._val);
 		} else {
 			entroct(4);
-			if (g_c3._val == 4)
+			if (_queue[2]._val == 4)
 				entroct(3);
 			else
-				entroct(g_c3._val);
-			entroct(g_c2._val);
+				entroct(_queue[2]._val);
+			entroct(_queue[1]._val);
 		}
 		break;
 	case 0:
 	case 1: 
-		veracf(g_c2._acc);
-		switch (g_c3._code) {
+		veracf(_queue[1]._acc);
+		switch (_queue[2]._code) {
 		case 2:
 			d2 = 7;
 			break;
@@ -337,66 +337,66 @@ void SpeechManager::trait_car() {
 			d2 = 8;
 			break;
 		case 6:
-			d2 = g_tabdph[(g_c3._val - 14) << 1];
+			d2 = g_tabdph[(_queue[2]._val - 14) << 1];
 			break;
 		case 5:
-			d2 = g_c3._val;
+			d2 = _queue[2]._val;
 			break;
 		default:
 			d2 = 10;
 			break;
 		}       //  switch  c3._code
-		d2 = (d2 * 26) + g_c2._val;
+		d2 = (d2 * 26) + _queue[1]._val;
 		if (g_tnocon[d2] == 0)
 			d3 = 2;
 		else
 			d3 = 6;
-		if (g_c2._rep >= 5) {
-			g_c2._rep = g_c2._rep - 5;
+		if (_queue[1]._rep >= 5) {
+			_queue[1]._rep -= 5;
 			d3 = 8 - d3;       // Swap 2 and 6
 		}
-		if (g_c2._code == 0) {
-			i = g_c2._rep;
+		if (_queue[1]._code == 0) {
+			i = _queue[1]._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(g_c2._val);
+					entroct(_queue[1]._val);
 					entroct(3);
 				} while (i > 0);
 			}
 			entroct(d3);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 			entroct(4);
 		} else {
 			entroct(d3);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 			entroct(3);
-			i = g_c2._rep;
+			i = _queue[1]._rep;
 			if (i != 0) {
 				do {
 					--i;
 					entroct(d3);
-					entroct(g_c2._val);
+					entroct(_queue[1]._val);
 					entroct(4);
 				} while (i > 0);
 			}
 		}
-		if (g_c3._code == 9) {
+		if (_queue[2]._code == 9) {
 			entroct(d3);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 			entroct(5);
-		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
-			veracf(g_c3._acc);
-			switch (g_c3._code) {
+		} else if ((_queue[2]._code != 0) && (_queue[2]._code != 1) && (_queue[2]._code != 4)) {
+			veracf(_queue[2]._acc);
+			switch (_queue[2]._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(g_c3._val - 14) << 1];
+				d2 = g_tabdph[(_queue[2]._val - 14) << 1];
 				break;
 			case 5:
-				d2 = g_c3._val;
+				d2 = _queue[2]._val;
 				break;
 			default:
 				d2 = 7;
@@ -405,47 +405,47 @@ void SpeechManager::trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[g_c2._val] != 0)
-				++g_c2._val;
+			if (g_intcon[_queue[1]._val] != 0)
+				++_queue[1]._val;
 
-			if ((g_c2._val == 17) || (g_c2._val == 18))
-				g_c2._val = 16;
+			if ((_queue[1]._val == 17) || (_queue[1]._val == 18))
+				_queue[1]._val = 16;
 
 			entroct(4);
 			entroct(d2);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 		}
 	
 		break;
 	case 4:
-		veracf(g_c2._acc);
-		i = g_c2._rep;
+		veracf(_queue[1]._acc);
+		i = _queue[1]._rep;
 		if (i != 0) {
 			do {
 				--i;
 				entroct(2);
-				entroct(g_c2._val);
+				entroct(_queue[1]._val);
 				entroct(3);
 			} while (i > 0);
 		}
 		entroct(2);
-		entroct(g_c2._val);
+		entroct(_queue[1]._val);
 		entroct(4);
-		if (g_c3._code == 9) {
+		if (_queue[2]._code == 9) {
 			entroct(2);
-			entroct(g_c2._val);
+			entroct(_queue[1]._val);
 			entroct(5);
-		} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
-			veracf(g_c3._acc);
-			switch (g_c3._code) {
+		} else if ((_queue[2]._code != 0) && (_queue[2]._code != 1) && (_queue[2]._code != 4)) {
+			veracf(_queue[2]._acc);
+			switch (_queue[2]._code) {
 			case 3:
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(g_c3._val - 14) << 1];
+				d2 = g_tabdph[(_queue[2]._val - 14) << 1];
 				break;
 			case 5:
-				d2 = g_c3._val;
+				d2 = _queue[2]._val;
 				break;
 			default:
 				d2 = 7;
@@ -455,12 +455,12 @@ void SpeechManager::trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[g_c2._val] != 0)
-				++g_c2._val;
+			if (g_intcon[_queue[1]._val] != 0)
+				++_queue[1]._val;
 
 			entroct(4);
 			entroct(d2);
-			entroct(g_tabdbc[((g_c2._val - 26) << 1) + 1]);
+			entroct(g_tabdbc[((_queue[1]._val - 26) << 1) + 1]);
 		}
 	
 		break;
@@ -474,10 +474,10 @@ void SpeechManager::trait_car() {
  * @remarks	Originally called 'rot_chariot'
  */
 void SpeechManager::moveQueue() {
-	g_c1 = g_c2;
-	g_c2 = g_c3;
-	g_c3._val = 32;
-	g_c3._code = 9;
+	_queue[0] = _queue[1];
+	_queue[1] = _queue[2];
+	_queue[2]._val = 32;
+	_queue[2]._code = 9;
 }
 
 /**
@@ -485,9 +485,9 @@ void SpeechManager::moveQueue() {
  * @remarks	Originally called 'init_chariot'
  */
 void SpeechManager::initQueue() {
-	g_c3._rep = 0;
-	g_c3._freq = 0;
-	g_c3._acc = 0;
+	_queue[2]._rep = 0;
+	_queue[2]._freq = 0;
+	_queue[2]._acc = 0;
 	moveQueue();
 	moveQueue();
 }
@@ -542,7 +542,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
-	g_addfix = (float)((tempo - g_addv[0])) / 256;
+	g_vm->_addfix = (float)((tempo - g_addv[0])) / 256;
 	cctable(g_tbi);
 	switch (typ) {
 	case 1:
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index a0bdf8a..eabffb9 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -60,6 +60,8 @@ class SpeechManager {
 private:
 	int _typlec;
 	int _phonemeNumb;
+	SpeechQueue _queue[3];
+
 public:
 	SpeechManager();
 	void spfrac(int wor);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index f4a5d12..392e8a2 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -58,18 +58,6 @@ const byte g_tnocon[364] = {
 		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-
-const byte g_menuConstants[8][4] = {
-	{ 7, 37, 22,  8},
-	{19, 33, 23,  7},
-	{31, 89, 10, 21},
-	{43, 25, 11,  5},
-	{55, 37,  5,  8},
-	{64, 13, 11,  2},
-	{62, 22, 13,  4},
-	{62, 25, 13,  5}
-};
-
 const byte g_addv[2] = {8, 8};
 
 const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
@@ -119,18 +107,16 @@ int g_nbrep[9];
 int g_nbrepm[9];
 int g_msg[5];
 byte g_touv[8];
-sav_chaine g_s, g_s1;
+SaveStruct g_s, g_s1;
 byte g_bufcha[391];
 
 byte g_lettres[7][24];
 
 uint16 g_t_mot[maxti + 1];
 int g_tay_tchar;
-ind g_t_rec[maxtd + 1];
+Hint g_t_rec[maxtd + 1];
 int g_l[108];
 int g_tbi[256];
-chariot g_c1, g_c2, g_c3;
-float g_addfix;
 Common::Point g_tabpal[91][17];
 t_pcga g_palcga[91];
 pattern g_tpt[15];
@@ -174,36 +160,10 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 int g_port[0xfff];
 byte g_mem[65536 * 16];
 
-/**
- * Engine function - Get a random number between two values
- * @remarks	Originally called 'get_random_number' and 'hazard'
- */
-int getRandomNumber(int minval, int maxval) {
-	return g_vm->_randomSource.getRandomNumber(maxval - minval) + minval;
-}
-
-/**
- * Restore a screen sectio
- */
-void s_sauv(int Gd, int y, int dy) {
-	// Note: May no longer be necessary, since the backgorund restore code 
-	// is being handled slightly differently now in the menuUp() method
-}
-
 void palette(int v1) {
 	warning("TODO: palette");
 }
 
-/**
- * Restore a screen area
- * @remarks	Currently implemented differently in ScummVM, so this method is redundant.
- * Original assembly was present in 'charecr.asm'
- */
-void s_char(int Gd, int y, int dy) {
-	debugC(1, kMortevielleCore, "s_char called");
-}
-
-// (* external 'c:\mc\reusint.com'; *)
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index d71c0d7..a91e6d9 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -76,7 +76,7 @@ const int kMenuActionStringIndex = 476;
 const int kMenuSelfStringIndex = 497;
 const int kMenuSayStringIndex = 502;
 const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
-
+const int kMaxPatt = 20;
 
 const int OPCODE_NONE = 0;
 enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
@@ -86,31 +86,12 @@ enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,
 			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
 			OPCODE_SLOOK = 0x405};
 
-const int kMaxPatt = 20;
-
-extern const byte g_tabdbc[18];
-extern const byte g_tabdph[16];
-extern const byte g_typcon[26];
-extern const byte g_intcon[26];
-extern const byte g_tnocon[364];
-
-extern const byte g_menuConstants[8][4];
-
-extern const byte g_addv[2];
-
-extern const byte g_rang[16];
-
-/*---------------------------------------------------------------------------*/
-/*--------------------------------   TYPES   --------------------------------*/
-/*---------------------------------------------------------------------------*/
-
 /*
 9   "A glance at the forbidden$",
 18  "It's already open$",
 26  "A photograph$",
 27  "The coat of arms$",
 */
-
 enum places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
 	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
@@ -120,28 +101,43 @@ enum places {
 	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
 
-struct sav_chaine {
+extern const byte g_tabdbc[18];
+extern const byte g_tabdph[16];
+extern const byte g_typcon[26];
+extern const byte g_intcon[26];
+extern const byte g_tnocon[364];
+extern const byte g_addv[2];
+extern const byte g_rang[16];
+
+struct Hint {
+	int _hintId;
+	byte _point;
+};
+
+struct SaveStruct {
 	int _faithScore;
 	byte _pourc[11];
 	byte _teauto[43];
 	byte _sjer[31];
-	int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId;
-	int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId;
+	int _currPlace;
+	int _atticBallHoleObjectId;
+	int _atticRodHoleObjectId;
+	int _cellarObjectId;
+	int _secretPassageObjectId;
+	int _wellObjectId;
+	int _selectedObjectId;
+	int _purpleRoomObjectId;
+	int _cryptObjectId;
 	bool _alreadyEnteredManor;
 	byte _fullHour;
 };
 
-struct ind {
-	int _indis;
-	byte _point;
-};
-
-struct chariot {
-	int _val,
-		_code,
-		_acc,
-		_freq,
-		_rep;
+struct SpeechQueue {
+	int _val;
+	int _code;
+	int _acc;
+	int _freq;
+	int _rep;
 };
 
 struct rectangle {
@@ -221,18 +217,16 @@ extern int g_nbrep[9];
 extern int g_nbrepm[9];
 extern int g_msg[5];
 extern byte g_touv[8];
-extern sav_chaine g_s, g_s1;
+extern SaveStruct g_s, g_s1;
 extern byte g_bufcha[391];
 
 extern byte g_lettres[7][24];
 
 extern uint16 g_t_mot[maxti + 1];
 extern int g_tay_tchar;
-extern ind g_t_rec[maxtd + 1];
+extern Hint g_t_rec[maxtd + 1];
 extern int g_l[108];
 extern int g_tbi[256];
-extern chariot g_c1, g_c2, g_c3;
-extern float g_addfix;
 extern Common::Point g_tabpal[91][17];
 extern t_pcga g_palcga[91];
 extern pattern g_tpt[15];
@@ -258,10 +252,6 @@ extern byte g_mem[65536 * 16];
 #define hires {}
 
 extern void palette(int v1);
-extern int getRandomNumber(int minval, int maxval);
-
-extern void s_char(int Gd, int y, int dy);
-extern void s_sauv(int Gd, int y, int dy);
 
 } // End of namespace Mortevielle
 


Commit: 56a74274660a2f5a18ebc85da656b12b4a3c7da2
    https://github.com/scummvm/scummvm/commit/56a74274660a2f5a18ebc85da656b12b4a3c7da2
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:36-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
  R engines/mortevielle/asm.cpp
  R engines/mortevielle/asm.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/ovd1.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index a4255fd..9479ad5 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -209,7 +209,7 @@ void MortevielleEngine::fctTake() {
 				_obpart = false;
 				affrep();
 			} else {
-				g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
+				g_tabdon[kAcha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
@@ -699,7 +699,7 @@ void MortevielleEngine::fctPlace() {
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(getEngineString(S_YES_NO), 1);
 					if (answer == 1) {
-						Common::String alertTxt = deline(582);
+						Common::String alertTxt = g_vm->getString(582);
 						Alert::show(alertTxt, 1);
 
 						bool enterPassageFl = KnowledgeCheck::show();
@@ -722,11 +722,11 @@ void MortevielleEngine::fctPlace() {
 							_menu.setDestinationMenuText(SECRET_PASSAGE);
 						} else {
 							_menu.setDestinationMenuText(g_s._currPlace);
-							writepal(14);
+							setPal(14);
 							dessin(0);
 							aniof(1, 2);
 							aniof(1, 1);
-							alertTxt = deline(577);
+							alertTxt = g_vm->getString(577);
 							Alert::show(alertTxt, 1);
 							aniof(2, 1);
 							g_crep = 166;
@@ -1368,7 +1368,7 @@ void MortevielleEngine::fctDiscuss() {
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
-		lib[ix] = deline(ix + kQuestionStringIndex);
+		lib[ix] = g_vm->getString(ix + kQuestionStringIndex);
 		for (i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
@@ -1403,7 +1403,7 @@ void MortevielleEngine::fctDiscuss() {
 			_mouse.moveMouse(f, tou);
 			CHECK_QUIT;
 
-			_mouse.getMousePos_(x, y, c);
+			_mouse.getMousePosition(x, y, c);
 			x *= (3 - g_res);
 			if (x > 319)
 				cx = 41;
diff --git a/engines/mortevielle/asm.cpp b/engines/mortevielle/asm.cpp
deleted file mode 100644
index 2d057a3..0000000
--- a/engines/mortevielle/asm.cpp
+++ /dev/null
@@ -1,52 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/scummsys.h"
-
-namespace Mortevielle {
-
-/**
- * Decodes a number of 64 byte blocks
- * @param pStart	Start of data
- * @param count		Number of 64 byte blocks
- */
-void zzuul(byte *pStart, int count) {
-	while (count-- > 0) {
-		for (int idx = 0; idx < 64; ++pStart, ++idx) {
-			uint16 v = ((*pStart - 0x80) << 1) + 0x80;
-
-			if (v & 0x8000)
-				*pStart = 0;
-			else if (v & 0xff00)
-				*pStart = 0xff;
-			else 
-				*pStart = (byte)v;
-		}
-	}
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/asm.h b/engines/mortevielle/asm.h
deleted file mode 100644
index 11793b3..0000000
--- a/engines/mortevielle/asm.h
+++ /dev/null
@@ -1,36 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_ASM_H
-#define MORTEVIELLE_ASM_H
-
-namespace Mortevielle {
-
-extern void zzuul(byte *pStart, int count);
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 68d2852..c20b99e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -291,7 +291,7 @@ bool KnowledgeCheck::show() {
 	int rep;
 	int firstOption, lastOption;
 	char key;
-	rectangle coor[kMaxRect];
+	Rect coor[kMaxRect];
 	Common::String choiceArray[15];
 
 	int currChoice, prevChoice;
@@ -307,7 +307,7 @@ bool KnowledgeCheck::show() {
 		else
 			dialogHeight = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
-		Common::String tmpStr = deline(textIndexArr[indx]);
+		Common::String tmpStr = g_vm->getString(textIndexArr[indx]);
 		displayStr(tmpStr, 20, 15, 100, 2, 0);
 
 		if (indx != 9) {
@@ -322,7 +322,7 @@ bool KnowledgeCheck::show() {
 
 		prevChoice = 1;
 		for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
-			tmpStr = deline(j);
+			tmpStr = g_vm->getString(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
 			displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 71ab0c1..2ce96bc 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -28,7 +28,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/var_mor.h"
-#include "mortevielle/asm.h"
 
 namespace Mortevielle {
 
@@ -47,7 +46,7 @@ int testou() {
 		break;
 	case '\26' :
 		if ((g_vm->_c_zzz == 1) || (g_vm->_c_zzz == 2)) {
-			zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+			g_vm->decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			++g_vm->_c_zzz;
 
 			return 61;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 6cf09be..0ba0cb5 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -97,7 +97,7 @@ void Menu::setDestinationMenuText(int roomId) {
 
 	int destinationId = 0;
 	for (; (destinationId < 7) && (g_vm->_v_lieu[destinationId][roomId]); ++destinationId) {
-		nomp = deline(g_vm->_v_lieu[destinationId][roomId] + kMenuPlaceStringIndex);
+		nomp = g_vm->getString(g_vm->_v_lieu[destinationId][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		setText(_moveMenu[destinationId + 1], nomp);
@@ -518,18 +518,18 @@ void Menu::initMenu() {
 		_moveStringArray[i] = "*                       ";
 	i = 1;
 	do {
-		_actionStringArray[i] = deline(i + kMenuActionStringIndex);
+		_actionStringArray[i] = g_vm->getString(i + kMenuActionStringIndex);
 
 		while (_actionStringArray[i].size() < 10)
 			_actionStringArray[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				_selfStringArray[i] = deline(i + kMenuSelfStringIndex);
+				_selfStringArray[i] = g_vm->getString(i + kMenuSelfStringIndex);
 				while (_selfStringArray[i].size() < 10)
 					_selfStringArray[i] += ' ';
 			}
-			_discussStringArray[i] = deline(i + kMenuSayStringIndex) + ' ';
+			_discussStringArray[i] = g_vm->getString(i + kMenuSayStringIndex) + ' ';
 		}
 		++i;
 	} while (i != 22);
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 07631ea..563da9f 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -2,7 +2,6 @@ MODULE := engines/mortevielle
 
 MODULE_OBJS := \
 	actions.o \
-	asm.o \
 	detection.o \
 	dialogs.o \
 	graphics.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4ba68c3..77a23d3 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -44,16 +44,7 @@
 
 namespace Mortevielle {
 
-/* NIVEAU 15 */
-void copcha() {
-	int i = acha;
-	do {
-		g_tabdon[i] = g_tabdon[i + 390];
-		++i;
-	} while (i != acha + 390);
-}
-
-void outbloc(int n, pattern p, nhom *pal) {
+void outbloc(int n, Pattern p, nhom *pal) {
 	int ad = n * 404 + 0xd700;
 
 	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
@@ -65,34 +56,6 @@ void outbloc(int n, pattern p, nhom *pal) {
 	}
 }
 
-void writepal(int n) {
-	switch (g_vm->_currGraphicalDevice) {
-	case MODE_TANDY:
-	case MODE_EGA:
-	case MODE_AMSTRAD1512:
-		for (int i = 1; i <= 16; ++i) {
-			g_mem[(0x7000 * 16) + (2 * i)] = g_tabpal[n][i].x;
-			g_mem[(0x7000 * 16) + (2 * i) + 1] = g_tabpal[n][i].y;
-		}
-		break;
-	case MODE_CGA: {
-		nhom pal[16];
-		for (int i = 0; i < 16; ++i) {
-			pal[i] = g_palcga[n]._a[i];
-		}
-
-		if (n < 89)
-			palette(g_palcga[n]._p);
-		
-		for (int i = 0; i <= 15; ++i)
-			outbloc(i, g_tpt[pal[i]._id], pal);
-		}
-		break;
-	default:
-		break;
-	}
-}
-
 
 void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
@@ -199,7 +162,7 @@ void modif(int &nu) {
 
 void dessine(int ad, int x, int y) {
 	g_vm->_mouse.hideMouse();
-	writepal(g_numpal);
+	g_vm->setPal(g_numpal);
 	pictout(ad, 0, x, y);
 	g_vm->_mouse.showMouse();
 }
@@ -209,7 +172,7 @@ void dessine(int ad, int x, int y) {
  * @remarks	Originally called 'dessine_rouleau'
  */
 void drawRightFrame() {
-	writepal(89);
+	g_vm->setPal(89);
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 14] = 15;
 	}
@@ -228,7 +191,7 @@ void text1(int x, int y, int nb, int m) {
 		co = 10;
 	else
 		co = 6;
-	Common::String tmpStr = deline(m);
+	Common::String tmpStr = g_vm->getString(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
 	displayStr(tmpStr, x, y, nb, 20, g_vm->_textColor);
@@ -291,7 +254,7 @@ void modobj(int m) {
 	Common::String strp = Common::String(' ');
 
 	if (m != 500)
-		strp = deline(m - 501 + kInventoryStringIndex);
+		strp = g_vm->getString(m - 501 + kInventoryStringIndex);
 
 	g_vm->_menu.setText(g_vm->_menu._inventoryMenu[8], strp);
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
@@ -299,7 +262,7 @@ void modobj(int m) {
 
 void repon(int f, int m) {
 	if ((m > 499) && (m < 563)) {
-		Common::String tmpStr = deline(m - 501 + kInventoryStringIndex);
+		Common::String tmpStr = g_vm->getString(m - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
 			g_vm->_largestClearScreen = true;
@@ -335,7 +298,7 @@ void repon(int f, int m) {
 			else
 				i = 5;
 
-			Common::String tmpStr = deline(m);
+			Common::String tmpStr = g_vm->getString(m);
 			displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
@@ -494,54 +457,6 @@ void phaz(int &rand, int &p, int cf) {
 	rand = g_vm->getRandomNumber(1, 100);
 }
 
-/**
- * Engine function - When restarting the game, reset the main variables used by the engine
- * @remarks	Originally called 'inzon'
- */
-void resetVariables() {
-	copcha();
-
-	g_s._alreadyEnteredManor = false;
-	g_s._selectedObjectId = 0;
-	g_s._cellarObjectId = 0;
-	g_s._atticBallHoleObjectId = 0;
-	g_s._atticRodHoleObjectId = 0;
-	g_s._wellObjectId = 0;
-	g_s._secretPassageObjectId = 0;
-	g_s._purpleRoomObjectId = 136;
-	g_s._cryptObjectId = 141;
-	g_s._faithScore = g_vm->getRandomNumber(4, 10);
-	g_s._currPlace = MANOR_FRONT;
-
-	for (int i = 2; i <= 6; ++i)
-		g_s._sjer[i] = chr(0);
-
-	g_s._sjer[1] = chr(113);
-	g_s._fullHour = chr(20);
-
-	for (int i = 1; i <= 10; ++i)
-		g_s._pourc[i] = ' ';
-
-	for (int i = 1; i <= 6; ++i)
-		g_s._teauto[i] = '*';
-
-	for (int i = 7; i <= 9; ++i)
-		g_s._teauto[i] = ' ';
-
-	for (int i = 10; i <= 28; ++i)
-		g_s._teauto[i] = '*';
-
-	for (int i = 29; i <= 42; ++i)
-		g_s._teauto[i] = ' ';
-
-	g_s._teauto[33] = '*';
-
-	for (int i = 1; i <= 8; ++i)
-		g_nbrep[i] = 0;
-
-	init_nbrepm();
-}
-
 int t11(int roomId) {
 	int retVal = 0;
 	int p, rand;
@@ -876,7 +791,7 @@ void tkey1(bool d) {
 	while (g_vm->keyPressed())
 		g_key = testou();
 	do {
-		g_vm->_mouse.getMousePos_(x, y, c);
+		g_vm->_mouse.getMousePosition(x, y, c);
 		g_vm->keyPressed();
 	} while (c != 0);
 	
@@ -885,7 +800,7 @@ void tkey1(bool d) {
 		if (d)
 			tinke();
 		quest = g_vm->keyPressed();
-		g_vm->_mouse.getMousePos_(x, y, c);
+		g_vm->_mouse.getMousePosition(x, y, c);
 		CHECK_QUIT;
 	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
 	if (quest)
@@ -967,7 +882,7 @@ void modinv() {
 		if (g_s._sjer[i] != chr(0)) {
 			++cy;
 			r = (ord(g_s._sjer[i]) + 400);
-			nomp = deline(r - 501 + kInventoryStringIndex);
+			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
 			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[i]);
 		}
@@ -992,7 +907,7 @@ void premtet() {
 
 /* NIVEAU 5 */
 void ajchai() {
-	int cy = acha + ((g_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((g_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
@@ -1077,7 +992,7 @@ void tsuiv() {
 	int tbcl;
 	int cl;
 
-	int cy = acha + ((g_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((g_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index d3defc1..ebf9537 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -42,9 +42,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
-extern void copcha();
-extern void outbloc(int n, pattern p, nhom *pal);
-extern void writepal(int n);
+extern void outbloc(int n, Pattern p, nhom *pal);
 extern void pictout(int seg, int dep, int x, int y);
 extern void sauvecr(int y, int dy);
 extern void charecr(int y, int dy);
@@ -76,7 +74,6 @@ extern void becfren(int roomId);
 /* NIVEAU 10 */
 extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
-extern void resetVariables();
 extern int t11(int roomId);
 extern void cavegre();
 extern void writetp(Common::String s, int t);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 9b7ade1..cd37597 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -30,7 +30,6 @@
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/dialogs.h"
-#include "mortevielle/asm.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mor.h"
@@ -43,6 +42,31 @@
 
 namespace Mortevielle {
 
+const byte tabdr[32] = {
+	32, 101, 115,  97, 114, 105, 110,
+	117, 116, 111, 108,  13, 100,  99,
+	112, 109,  46, 118, 130,  39, 102,
+	98,  44, 113, 104, 103,  33,  76,
+	85, 106,  30,  31
+};
+
+
+const byte tab30[32] = {
+	69,  67,  74, 138, 133, 120,  77, 122,
+	121,  68,  65,  63,  73,  80,  83,  82,
+	156,  45,  58,  79,  49,  86,  78,  84,
+	71,  81,  64,  66, 135,  34, 136,  91
+};
+
+
+
+const byte tab31[32]= {
+	93,  47,  48,  53,  50,  70, 124,  75,
+	72, 147, 140, 150, 151,  57,  56,  51,
+	107, 139,  55,  89, 131,  37,  54,  88,
+	119,   0,   0,   0,   0,   0,   0,   0
+};
+
 MortevielleEngine *g_vm;
 
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
@@ -164,7 +188,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		return result;
 
 	// Load some error messages (was previously in chartex())
-	_hintPctMessage = deline(580);  // You should have noticed %d hints
+	_hintPctMessage = getString(580);  // You should have noticed %d hints
 
 	// Set default EGA palette
 	_paletteManager.setDefaultPalette();
@@ -177,7 +201,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	charpal();
 	loadCFIPH();
 	loadCFIEC();
-	zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
@@ -541,7 +565,7 @@ void MortevielleEngine::mainGame() {
 		loadCFIEC();
 
 	for (g_crep = 1; g_crep <= _c_zzz; ++g_crep) 
-		zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+		decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
 	_menu.initMenu();
@@ -1684,7 +1708,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 	assert(rep >= 0);
 
 	_mouse.hideMouse();
-	Common::String dialogStr = deline(rep + kDialogStringIndex);
+	Common::String dialogStr = getString(rep + kDialogStringIndex);
 	displayStr(dialogStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
@@ -1853,7 +1877,7 @@ void MortevielleEngine::gameLoaded() {
 	g_iouv = 0;
 	g_dobj = 0;
 	affrep();
-	_hintPctMessage = deline(580);
+	_hintPctMessage = getString(580);
 
 	_okdes = false;
 	_endGame = true;
@@ -2101,4 +2125,196 @@ void MortevielleEngine::showMoveMenuAlert() {
 	Alert::show(getEngineString(S_USE_DEP_MENU), 1);
 }
 
+/**
+ * Decodes a number of 64 byte blocks
+ * @param pStart	Start of data
+ * @param count		Number of 64 byte blocks
+ * @remarks	Originally called 'zzuul'
+ */
+void MortevielleEngine::decodeNumber(byte *pStart, int count) {
+	while (count-- > 0) {
+		for (int idx = 0; idx < 64; ++pStart, ++idx) {
+			uint16 v = ((*pStart - 0x80) << 1) + 0x80;
+
+			if (v & 0x8000)
+				*pStart = 0;
+			else if (v & 0xff00)
+				*pStart = 0xff;
+			else 
+				*pStart = (byte)v;
+		}
+	}
+}
+
+void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
+	uint16 oct, ocd;
+
+	/* 5-8 */
+	oct = g_t_mot[idx];
+	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
+	if (pt < 6) {
+		++idx;
+		oct = oct << (5 - pt);
+		pt += 11;
+		oct = oct | ((uint)g_t_mot[idx] >> pt);
+	} else {
+		pt -= 5;
+		oct = (uint)oct >> pt;
+	}
+
+	switch (oct) {
+	case 11:
+		c = '$';
+		the_end = true;
+		break;
+	case 30:
+	case 31:
+		ocd = g_t_mot[idx];
+		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
+		if (pt < 6) {
+			++idx;
+			ocd = ocd << (5 - pt);
+			pt += 11;
+			ocd = ocd | ((uint)g_t_mot[idx] >> pt);
+		} else {
+			pt -= 5;
+			ocd = (uint)ocd >> pt;
+		}
+
+		if (oct == 30)
+			c = chr(tab30[ocd]);
+		else
+			c = chr(tab31[ocd]);
+
+		if (c == '\0') {
+			the_end = true;
+			c = '#';
+		}
+		break;
+	default:
+		c = chr(tabdr[oct]);
+		break;
+	}
+}
+
+/**
+ * Decode and extract the line with the given Id
+ * @remarks	Originally called 'deline'
+ */
+Common::String MortevielleEngine::getString(int num) {
+	Common::String wrkStr = "";
+
+	if (num < 0) {
+		warning("deline: num < 0! Skipping");
+	} else if (!g_vm->_txxFileFl) {
+		wrkStr = g_vm->getGameString(num);
+	} else {
+		int i = g_t_rec[num]._hintId;
+		byte k = g_t_rec[num]._point;
+		int length = 0;
+		bool endFl = false;
+		char let;
+		do {
+			cinq_huit(let, i, k, endFl);
+			if (length < 254)
+				wrkStr += let;
+			++length;
+		} while (!endFl);
+	}
+
+	if (wrkStr.lastChar() == '$')
+		// Remove trailing '$'
+		wrkStr.deleteLastChar();
+
+	return wrkStr;
+}
+
+void MortevielleEngine::copcha() {
+	int i = kAcha;
+	do {
+		g_tabdon[i] = g_tabdon[i + 390];
+		++i;
+	} while (i != kAcha + 390);
+}
+
+/**
+ * Engine function - When restarting the game, reset the main variables used by the engine
+ * @remarks	Originally called 'inzon'
+ */
+void MortevielleEngine::resetVariables() {
+	copcha();
+
+	g_s._alreadyEnteredManor = false;
+	g_s._selectedObjectId = 0;
+	g_s._cellarObjectId = 0;
+	g_s._atticBallHoleObjectId = 0;
+	g_s._atticRodHoleObjectId = 0;
+	g_s._wellObjectId = 0;
+	g_s._secretPassageObjectId = 0;
+	g_s._purpleRoomObjectId = 136;
+	g_s._cryptObjectId = 141;
+	g_s._faithScore = g_vm->getRandomNumber(4, 10);
+	g_s._currPlace = MANOR_FRONT;
+
+	for (int i = 2; i <= 6; ++i)
+		g_s._sjer[i] = chr(0);
+
+	g_s._sjer[1] = chr(113);
+	g_s._fullHour = chr(20);
+
+	for (int i = 1; i <= 10; ++i)
+		g_s._pourc[i] = ' ';
+
+	for (int i = 1; i <= 6; ++i)
+		g_s._teauto[i] = '*';
+
+	for (int i = 7; i <= 9; ++i)
+		g_s._teauto[i] = ' ';
+
+	for (int i = 10; i <= 28; ++i)
+		g_s._teauto[i] = '*';
+
+	for (int i = 29; i <= 42; ++i)
+		g_s._teauto[i] = ' ';
+
+	g_s._teauto[33] = '*';
+
+	for (int i = 1; i <= 8; ++i)
+		g_nbrep[i] = 0;
+
+	init_nbrepm();
+}
+
+/**
+ * Engine function - Set the palette
+ * @remarks	Originally called 'writepal'
+ */
+void MortevielleEngine::setPal(int n) {
+	switch (g_vm->_currGraphicalDevice) {
+	case MODE_TANDY:
+	case MODE_EGA:
+	case MODE_AMSTRAD1512:
+		for (int i = 1; i <= 16; ++i) {
+			g_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
+			g_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+		}
+		break;
+	case MODE_CGA: {
+		nhom pal[16];
+		for (int i = 0; i < 16; ++i) {
+			pal[i] = g_vm->_cgaPal[n]._a[i];
+		}
+
+		if (n < 89)
+			palette(g_vm->_cgaPal[n]._p);
+		
+		for (int i = 0; i <= 15; ++i)
+			outbloc(i, _patternArr[pal[i]._id], pal);
+		}
+		break;
+	default:
+		break;
+	}
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c2fd857..0bc6b09 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -80,10 +80,10 @@ enum DataType {
 #define MORT_DAT "mort.dat"
 #define GAME_FRAME_DELAY (1000 / 50)
 
+const int kAcha = 492;
 const int asoul = 154;
 const int aouvr = 282;
 const int achai = 387;
-const int acha = 492;
 const int arcf = 1272;
 const int arep = 1314;
 const int amzon = 1650;
@@ -112,6 +112,8 @@ private:
 	void mainGame();
 	void playGame();
 	void handleAction();
+	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
+	void copcha();
 public:
 	Common::String _hintPctMessage;
 	Common::Point _prevPos;
@@ -156,10 +158,10 @@ public:
 	int _minute;
 	float _addfix;
 
-
+	Common::Point _stdPal[91][17];
+	t_pcga _cgaPal[91];
 	int _c_zzz;
 	int ptr_word;
-
 	byte _v_lieu[7][25];
 
 	ScreenSurface _screenSurface;
@@ -302,6 +304,11 @@ public:
 	void clearScreenType10();
 	int getRandomNumber(int minval, int maxval);
 	void showMoveMenuAlert();
+	void decodeNumber(byte *pStart, int count);
+	Common::String getString(int num);
+	void resetVariables();
+
+	void setPal(int n);
 
 };
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index a898f22..3010723 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -227,7 +227,7 @@ void MouseHandler::showMouse() {
  * Set mouse position
  * @remarks	Originally called 'pos_mouse'
  */
-void MouseHandler::setMousePos(Common::Point newPos) {
+void MouseHandler::setMousePosition(Common::Point newPos) {
 	if (newPos.x > 314 * g_res)
 		newPos.x = 314 * g_res;
 	else if (newPos.x < 0)
@@ -247,7 +247,7 @@ void MouseHandler::setMousePos(Common::Point newPos) {
  * Get mouse poisition
  * @remarks	Originally called 'read_pos_mouse'
  */
-void MouseHandler::getMousePos_(int &x, int &y, int &c) {
+void MouseHandler::getMousePosition(int &x, int &y, int &c) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
 	c = g_vm->getMouseClick() ? 1 : 0;
@@ -276,7 +276,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 		CHECK_QUIT;
 
 		in1 = g_vm->getChar();
-		getMousePos_(cx, cy, cd);
+		getMousePosition(cx, cy, cd);
 		switch (toupper(in1)) {
 		case '4':
 			cx -= 8;
@@ -407,19 +407,19 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			break;
 		}
 
-		setMousePos(Common::Point(cx, cy));
+		setMousePosition(Common::Point(cx, cy));
 		p_key = g_vm->keyPressed();
 	}
 }
 
 /**
- * Engine function : Is mouse in a given rect?
+ * Mouse function : Is mouse in a given rect?
  * @remarks	Originally called 'dans_rect'
  */
-bool MouseHandler::isMouseIn(rectangle r) {
+bool MouseHandler::isMouseIn(Rect r) {
 	int x, y, c;
 
-	getMousePos_(x, y, c);
+	getMousePosition(x, y, c);
 	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
 		return true;
 
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 76a9991..0bf46d9 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -43,10 +43,10 @@ public:
 	void initMouse();
 	void hideMouse();
 	void showMouse();
-	void setMousePos(Common::Point newPos);
-	void getMousePos_(int &x, int &y, int &c);
+	void setMousePosition(Common::Point newPos);
+	void getMousePosition(int &x, int &y, int &c);
 	void moveMouse(bool &funct, char &key);
-	bool isMouseIn(rectangle r);
+	bool isMouseIn(Rect r);
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index a941f79..12c16f9 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -36,126 +36,8 @@
 
 namespace Mortevielle {
 
-Common::String delig;
-const byte tabdr[32] = {
-	32, 101, 115,  97, 114, 105, 110,
-	117, 116, 111, 108,  13, 100,  99,
-	112, 109,  46, 118, 130,  39, 102,
-	98,  44, 113, 104, 103,  33,  76,
-	85, 106,  30,  31
-};
-
-
-const byte tab30[32] = {
-	69,  67,  74, 138, 133, 120,  77, 122,
-	121,  68,  65,  63,  73,  80,  83,  82,
-	156,  45,  58,  79,  49,  86,  78,  84,
-	71,  81,  64,  66, 135,  34, 136,  91
-};
-
-
-
-const byte tab31[32]= {
-	93,  47,  48,  53,  50,  70, 124,  75,
-	72, 147, 140, 150, 151,  57,  56,  51,
-	107, 139,  55,  89, 131,  37,  54,  88,
-	119,   0,   0,   0,   0,   0,   0,   0
-};
-
-Common::String deline(int num);
 typedef unsigned char uchar;
 
-static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
-/*
-	const uchar rap[32] = { 
-		(uchar)',', (uchar)':', (uchar)'@', (uchar)'!', (uchar)'?', (uchar)'-', (uchar)'\207',
-		(uchar)'\240', (uchar)'\205', (uchar)'\203', (uchar)'\202', (uchar)'\212', (uchar)'\210', (uchar)'/',
-		(uchar)'\213', (uchar)'\214', (uchar)'\242', (uchar)'\047', (uchar)'\223', (uchar)'"', (uchar)'\227',
-		(uchar)'\226', (uchar)'0', (uchar)'1', (uchar)'2', (uchar)'3', (uchar)'4', (uchar)'5',
-		(uchar)'6', (uchar)'7', (uchar)'8', (uchar)'9'
-	};
-*/
-	uint16 oct, ocd;
-
-	/* 5-8 */
-	oct = g_t_mot[idx];
-	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
-	if (pt < 6) {
-		++idx;
-		oct = oct << (5 - pt);
-		pt += 11;
-		oct = oct | ((uint)g_t_mot[idx] >> pt);
-	} else {
-		pt -= 5;
-		oct = (uint)oct >> pt;
-	}
-
-	switch (oct) {
-	case 11:
-		c = '$';
-		the_end = true;
-		break;
-	case 30:
-	case 31:
-		ocd = g_t_mot[idx];
-		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
-		if (pt < 6) {
-			++idx;
-			ocd = ocd << (5 - pt);
-			pt += 11;
-			ocd = ocd | ((uint)g_t_mot[idx] >> pt);
-		} else {
-			pt -= 5;
-			ocd = (uint)ocd >> pt;
-		}
-
-		if (oct == 30)
-			c = chr(tab30[ocd]);
-		else
-			c = chr(tab31[ocd]);
-
-		if (c == '\0') {
-			the_end = true;
-			c = '#';
-		}
-		break;
-	default:
-		c = chr(tabdr[oct]);
-		break;
-	}
-}              /* 5-8 */
-
-/**
- * Decode and extract the line with the given Id
- */
-Common::String deline(int num) {
-	Common::String wrkStr = "";
-
-	if (num < 0) {
-		warning("deline: num < 0! Skipping");
-	} else if (!g_vm->_txxFileFl) {
-		wrkStr = g_vm->getGameString(num);
-	} else {
-		int i = g_t_rec[num]._hintId;
-		byte k = g_t_rec[num]._point;
-		int length = 0;
-		bool endFl = false;
-		char let;
-		do {
-			cinq_huit(let, i, k, endFl);
-			if (length < 254)
-				wrkStr += let;
-			++length;
-		} while (!endFl);
-	}
-
-	if (wrkStr.lastChar() == '$')
-		// Remove trailing '$'
-		wrkStr.deleteLastChar();
-
-	return wrkStr;
-}
-
 static int l_motsuiv(int p, const char *ch, int &tab) {
 	int c = p;
 
@@ -429,7 +311,7 @@ void taffich() {
 		}
 	}
 	g_numpal = npal;
-	writepal(npal);
+	g_vm->setPal(npal);
 
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
 		lgt = 0;
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index cd109ff..d27ca3e 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -35,7 +35,6 @@ namespace Mortevielle {
 
 const int kAdrAni = 0x7314;
 
-extern Common::String deline(int num);
 extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
 extern void chardes(Common::String filename, int32 passe, int long_);
 extern void charani(Common::String filename, int32 skipSize, int length);
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index 0a93a84..178ef43 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -54,8 +54,8 @@ void charpal() {
 		error("Missing file - plxx.mor");
 	for (int i = 0; i <= 90; ++i) {
 		for (int j = 1; j <= 16; ++j) {
-			g_tabpal[i][j].x = f.readByte();
-			g_tabpal[i][j].y = f.readByte();
+			g_vm->_stdPal[i][j].x = f.readByte();
+			g_vm->_stdPal[i][j].y = f.readByte();
 		}
 	}
 	f.close();
@@ -64,9 +64,9 @@ void charpal() {
 		error("Missing file - cxx.mor");
 
 	for (int j = 0; j <= 90; ++j) {
-		g_palcga[j]._p = f.readByte();
+		g_vm->_cgaPal[j]._p = f.readByte();
 		for (int i = 0; i <= 15; ++i) {
-			nhom &with = g_palcga[j]._a[i];
+			nhom &with = g_vm->_cgaPal[j]._a[i];
 
 			b = f.readByte();
 			with._id = (uint)b >> 4;
@@ -75,13 +75,13 @@ void charpal() {
 		}
 	}
 
-	g_palcga[10]._a[9] = g_palcga[10]._a[5];
+	g_vm->_cgaPal[10]._a[9] = g_vm->_cgaPal[10]._a[5];
 	for (int j = 0; j <= 14; ++j) {
-		g_tpt[j]._tax = f.readByte();
-		g_tpt[j]._tay = f.readByte();
+		_patternArr[j]._tax = f.readByte();
+		_patternArr[j]._tay = f.readByte();
 		for (int i = 1; i <= 20; ++i)
 			for (int k = 1; k <= 20; ++k)
-				g_tpt[j]._des[i][k] = f.readByte();
+				_patternArr[j]._des[i][k] = f.readByte();
 	}
 	f.close();
 }
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 9458da3..7ddd8b7 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -109,7 +109,7 @@ void SavegameManager::loadSavegame(int n) {
 
 	g_s = g_s1;
 	for (int i = 0; i <= 389; ++i)
-		g_tabdon[i + acha] = g_bufcha[i];
+		g_tabdon[i + kAcha] = g_bufcha[i];
 
 	// Close the stream
 	delete stream;	
@@ -142,7 +142,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	g_vm->hourToChar();
 	
 	for (i = 0; i <= 389; ++i)
-		g_bufcha[i] = g_tabdon[i + acha];
+		g_bufcha[i] = g_tabdon[i + kAcha];
 	g_s1 = g_s;
 	if (g_s1._currPlace == 26)
 		g_s1._currPlace = 15;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index ba7ef62..69a0c33 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -564,7 +564,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 			g_t_cph[i] = savph[i];
 			g_mlec = _typlec;
 		}
-	writepal(g_numpal);
+	g_vm->setPal(g_numpal);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 392e8a2..b3999b7 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -117,9 +117,8 @@ int g_tay_tchar;
 Hint g_t_rec[maxtd + 1];
 int g_l[108];
 int g_tbi[256];
-Common::Point g_tabpal[91][17];
 t_pcga g_palcga[91];
-pattern g_tpt[15];
+Pattern _patternArr[15];
 
 byte g_adcfiec[(4088 * 16) + (311 * 0x80)];
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a91e6d9..b689752 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -140,17 +140,16 @@ struct SpeechQueue {
 	int _rep;
 };
 
-struct rectangle {
+struct Rect {
 	int _x1, _x2, _y1, _y2;
 	bool _enabled;
 };
 
-struct pattern {
+struct Pattern {
 	byte _tay, _tax;
 	byte _des[kMaxPatt + 1][kMaxPatt + 1];
 };
 
-
 struct nhom {
 	byte _id;     /* number between 0 and 32 */
 	byte _hom[4];
@@ -227,9 +226,7 @@ extern int g_tay_tchar;
 extern Hint g_t_rec[maxtd + 1];
 extern int g_l[108];
 extern int g_tbi[256];
-extern Common::Point g_tabpal[91][17];
-extern t_pcga g_palcga[91];
-extern pattern g_tpt[15];
+extern Pattern _patternArr[15];
 
 extern byte g_adcfiec[822 * 128];
 


Commit: 4d28d0963f402d4c2661b95ec24730f9bc83e67e
    https://github.com/scummvm/scummvm/commit/4d28d0963f402d4c2661b95ec24730f9bc83e67e
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:38-07:00

Commit Message:
MORTEVIELLE: Rename more globals and move functions to MortevielleEngine. Remove ovd1 files.

Changed paths:
  R engines/mortevielle/ovd1.cpp
  R engines/mortevielle/ovd1.h
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index c20b99e..5191b1e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -455,7 +455,7 @@ void f3f8::aff50(bool drawAni50Fl) {
 	g_caff = 50;
 	g_maff = 0;
 	taffich();
-	dessine(g_ades, 63, 12);
+	g_vm->draw(g_ades, 63, 12);
 	if (drawAni50Fl)
 		ani50();
 	else
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 0ba0cb5..137ff46 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -33,7 +33,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/ovd1.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
@@ -568,7 +567,7 @@ void Menu::setSearchMenu() {
  * @remarks	Originally called 'mfouen'
  */
 void Menu::unsetSearchMenu() {
-	setDestinationMenuText(g_s._currPlace);
+	setDestinationMenuText(g_vm->g_s._currPlace);
 	for (int i = 1; i <= 11; ++i)
 		enableMenuItem(_actionMenu[i]);
 
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 563da9f..58978c9 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -11,7 +11,6 @@ MODULE_OBJS := \
 	mortevielle.o \
 	mouse.o \
 	outtext.o \
-	ovd1.o \
 	saveload.o \
 	sound.o \
 	speech.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 77a23d3..e1206be 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -44,19 +44,6 @@
 
 namespace Mortevielle {
 
-void outbloc(int n, Pattern p, nhom *pal) {
-	int ad = n * 404 + 0xd700;
-
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad + 2], p._tay);
-	ad += 4;
-	for (int i = 1; i <= p._tax; ++i) {
-		for (int j = 1; j <= p._tay; ++j)
-			g_mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
-	}
-}
-
-
 void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
 	surface.decode(&g_mem[seg * 16 + dep]);
@@ -159,28 +146,6 @@ void modif(int &nu) {
 		nu -= 3976;
 }
 
-
-void dessine(int ad, int x, int y) {
-	g_vm->_mouse.hideMouse();
-	g_vm->setPal(g_numpal);
-	pictout(ad, 0, x, y);
-	g_vm->_mouse.showMouse();
-}
-
-/**
- * Draw right frame
- * @remarks	Originally called 'dessine_rouleau'
- */
-void drawRightFrame() {
-	g_vm->setPal(89);
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
-		g_mem[0x7000 * 16 + 14] = 15;
-	}
-	g_vm->_mouse.hideMouse();
-	pictout(0x73a2, 0, 0, 0);
-	g_vm->_mouse.showMouse();
-}
-
 /* NIVEAU 13 */
 
 
@@ -280,12 +245,12 @@ void repon(int f, int m) {
 			g_vm->prepareScreenType2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
-				g_s._teauto[40] = '*';
+				g_vm->g_s._teauto[40] = '*';
 			if ((m == 104) && (g_caff == 14)) {
-				g_s._teauto[36] = '*';
-				if (g_s._teauto[39] == '*') {
-					g_s._pourc[3] = '*';
-					g_s._teauto[38] = '*';
+				g_vm->g_s._teauto[36] = '*';
+				if (g_vm->g_s._teauto[39] == '*') {
+					g_vm->g_s._pourc[3] = '*';
+					g_vm->g_s._teauto[38] = '*';
 				}
 			}
 			break;
@@ -302,9 +267,9 @@ void repon(int f, int m) {
 			displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
-				g_s._pourc[6] = '*';
+				g_vm->g_s._pourc[6] = '*';
 			else if (m == 179)
-				g_s._pourc[10] = '*';
+				g_vm->g_s._pourc[10] = '*';
 			}
 			break;
 		default:
@@ -461,7 +426,7 @@ int t11(int roomId) {
 	int retVal = 0;
 	int p, rand;
 
-	ecfren(p, rand, g_s._faithScore, roomId);
+	ecfren(p, rand, g_vm->g_s._faithScore, roomId);
 	g_vm->_place = roomId;
 	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
@@ -493,7 +458,7 @@ int t11(int roomId) {
 				p = g_vm->getPresenceStatsLanding();
 			else if (roomId == CHAPEL)
 				p = g_vm->getPresenceStatsChapel(h);
-			p += g_s._faithScore;
+			p += g_vm->g_s._faithScore;
 			rand = g_vm->getRandomNumber(1, 100);
 			if (rand > p) {
 				g_vm->displayAloneText();
@@ -518,9 +483,9 @@ int t11(int roomId) {
 }
 
 void cavegre() {
-	g_s._faithScore += 2;
-	if (g_s._faithScore > 69)
-		g_s._faithScore += (g_s._faithScore / 10);
+	g_vm->g_s._faithScore += 2;
+	if (g_vm->g_s._faithScore > 69)
+		g_vm->g_s._faithScore += (g_vm->g_s._faithScore / 10);
 	g_vm->clearScreenType3();
 	g_vm->prepareScreenType2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
@@ -567,17 +532,17 @@ void aniof(int ouf, int num) {
 /* NIVEAU 9 */
 void dessin(int ad) {
 	if (ad != 0)
-		dessine(g_ades, ((ad % 160) * 2), (ad / 160));
+		g_vm->draw(g_ades, ((ad % 160) * 2), (ad / 160));
 	else {
 		g_vm->clearScreenType1();
 		if (g_caff > 99) {
-			dessine(g_ades, 60, 33);
+			g_vm->draw(g_ades, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 		} else if (g_caff > 69) {
-			dessine(g_ades, 112, 48);           // Heads
+			g_vm->draw(g_ades, 112, 48);           // Heads
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
-			dessine(g_ades, 0, 12);
+			g_vm->draw(g_ades, 0, 12);
 			g_vm->prepareScreenType1();
 			if ((g_caff < 30) || (g_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
@@ -586,16 +551,16 @@ void dessin(int ad) {
 				}
 
 				if (g_caff == 13) {
-					if (g_s._atticBallHoleObjectId == 141)
+					if (g_vm->g_s._atticBallHoleObjectId == 141)
 						aniof(1, 7);
 
-					if (g_s._atticRodHoleObjectId == 159)
+					if (g_vm->g_s._atticRodHoleObjectId == 159)
 						aniof(1, 6);
-				} else if ((g_caff == 14) && (g_s._cellarObjectId == 151))
+				} else if ((g_caff == 14) && (g_vm->g_s._cellarObjectId == 151))
 					aniof(1, 2);
-				else if ((g_caff == 17) && (g_s._secretPassageObjectId == 143))
+				else if ((g_caff == 17) && (g_vm->g_s._secretPassageObjectId == 143))
 					aniof(1, 1);
-				else if ((g_caff == 24) && (g_s._wellObjectId != 0))
+				else if ((g_caff == 24) && (g_vm->g_s._wellObjectId != 0))
 					aniof(1, 1);
 			}
 			
@@ -633,7 +598,7 @@ void tinke() {
 		drawClock();
 		cf = 0;
 		for (int i = 1; i <= 10; ++i) {
-			if (g_s._pourc[i] == '*')
+			if (g_vm->g_s._pourc[i] == '*')
 				++cf;
 		}
 
@@ -667,7 +632,7 @@ void tinke() {
 			g_t = kTime2;
 		else
 			g_t = kTime1;
-		cf = g_s._faithScore;
+		cf = g_vm->g_s._faithScore;
 		if ((cf > 33) && (cf < 66))
 			g_t -= (g_t / 3);
 
@@ -723,7 +688,7 @@ void tinke() {
 				g_mpers = g_vm->_currBitIndex;
 
 			if ((g_mpers == 0) && (g_vm->_currBitIndex > 0)) {
-				if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
+				if ((g_vm->g_s._currPlace == ATTIC) || (g_vm->g_s._currPlace == CELLAR)) {
 					cavegre();
 				} else if (g_vm->_currBitIndex == 10) {
 					g_vm->_currBitIndex = 0;
@@ -751,7 +716,7 @@ void tinke() {
 		g_vm->getPresenceBitIndex(g_vm->_place);
 		g_vm->_brt = false;
 		g_hdb = 0;
-		if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
+		if ((g_vm->g_s._currPlace > OWN_ROOM) && (g_vm->g_s._currPlace < DINING_ROOM))
 			g_vm->_anyone = true;
 	}
 }
@@ -822,17 +787,17 @@ void tlu(int af, int ob) {
 }
 
 void affrep() {
-	g_caff = g_s._currPlace;
-	g_crep = g_s._currPlace;
+	g_caff = g_vm->g_s._currPlace;
+	g_crep = g_vm->g_s._currPlace;
 }
 
 void tsort() {
 
-	if ((g_iouv > 0) && (g_s._currPlace != 0)) {
-		if (g_s._faithScore < 50)
-			g_s._faithScore += 2;
+	if ((g_iouv > 0) && (g_vm->g_s._currPlace != 0)) {
+		if (g_vm->g_s._faithScore < 50)
+			g_vm->g_s._faithScore += 2;
 		else
-			g_s._faithScore += (g_s._faithScore / 10);
+			g_vm->g_s._faithScore += (g_vm->g_s._faithScore / 10);
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
@@ -840,7 +805,7 @@ void tsort() {
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	debloc(g_s._currPlace);
+	debloc(g_vm->g_s._currPlace);
 }
 
 void st4(int ob) {
@@ -879,9 +844,9 @@ void modinv() {
 
 	int cy = 0;
 	for (int i = 1; i <= 6; ++i) {
-		if (g_s._sjer[i] != chr(0)) {
+		if (g_vm->g_s._sjer[i] != chr(0)) {
 			++cy;
-			r = (ord(g_s._sjer[i]) + 400);
+			r = (ord(g_vm->g_s._sjer[i]) + 400);
 			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
 			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[i]);
@@ -901,7 +866,7 @@ void mennor() {
 }
 
 void premtet() {
-	dessine(g_ades, 10, 80);
+	g_vm->draw(g_ades, 10, 80);
 	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 
@@ -914,7 +879,7 @@ void ajchai() {
 	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
 
 	if (g_tabdon[cy + cx] == 0)
-		g_tabdon[cy + cx] = g_s._selectedObjectId;
+		g_tabdon[cy + cx] = g_vm->g_s._selectedObjectId;
 	else
 		g_crep = 192;
 }
@@ -923,10 +888,10 @@ void ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 5) && (ord(g_s._sjer[cx]) != 0));
+	} while ((cx <= 5) && (ord(g_vm->g_s._sjer[cx]) != 0));
 
-	if (ord(g_s._sjer[cx]) == 0) {
-		g_s._sjer[(cx)] = chr(ob);
+	if (ord(g_vm->g_s._sjer[cx]) == 0) {
+		g_vm->g_s._sjer[(cx)] = chr(ob);
 		modinv();
 	} else
 		g_crep = 139;
@@ -955,11 +920,11 @@ L1:
 			g_vm->_speechManager.startSpeech(4, 4, 1);
 
 		if (g_iouv == 0)
-			g_s._faithScore += 2;
-		else if (g_s._faithScore < 50)
-			g_s._faithScore += 4;
+			g_vm->g_s._faithScore += 2;
+		else if (g_vm->g_s._faithScore < 50)
+			g_vm->g_s._faithScore += 4;
 		else
-			g_s._faithScore += 3 * (g_s._faithScore / 10);
+			g_vm->g_s._faithScore += 3 * (g_vm->g_s._faithScore / 10);
 		tsort();
 		g_vm->_menu.setDestinationMenuText(LANDING);
 		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
@@ -1002,11 +967,11 @@ void tsuiv() {
 	} while ((tbcl == 0) && (g_cs <= 9));
 
 	if ((tbcl != 0) && (g_cs < 11)) {
-		++g_is;
+		++g_vm->g_is;
 		g_caff = tbcl;
 		g_crep = g_caff + 400;
 		if (g_vm->_currBitIndex != 0)
-			g_s._faithScore += 2;
+			g_vm->g_s._faithScore += 2;
 	} else {
 		affrep();
 		g_vm->endSearch();
@@ -1147,20 +1112,20 @@ void treg(int ob) {
 
 void avpoing(int &ob) {
 	g_crep = 999;
-	if (g_s._selectedObjectId != 0)
-		ajjer(g_s._selectedObjectId);
+	if (g_vm->g_s._selectedObjectId != 0)
+		ajjer(g_vm->g_s._selectedObjectId);
 
 	if (g_crep != 139) {
 		modobj(ob + 400);
-		g_s._selectedObjectId = ob;
+		g_vm->g_s._selectedObjectId = ob;
 		ob = 0;
 	}
 }
 
 void rechai(int &ch) {
-	int tmpPlace = g_s._currPlace;
+	int tmpPlace = g_vm->g_s._currPlace;
 
-	if (g_s._currPlace == CRYPT)
+	if (g_vm->g_s._currPlace == CRYPT)
 		tmpPlace = CELLAR;
 	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
 }
@@ -1175,7 +1140,7 @@ int t23coul() {
 }
 
 void maivid() {
-	g_s._selectedObjectId = 0;
+	g_vm->g_s._selectedObjectId = 0;
 	modobj(500);
 }
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index ebf9537..de1b0b4 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -42,7 +42,6 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
-extern void outbloc(int n, Pattern p, nhom *pal);
 extern void pictout(int seg, int dep, int x, int y);
 extern void sauvecr(int y, int dy);
 extern void charecr(int y, int dy);
@@ -51,8 +50,6 @@ extern int animof(int ouf, int num);
 /* Niveau 14 suite */
 extern int readclock();
 extern void modif(int &nu);
-extern void dessine(int ad, int x, int y);
-extern void drawRightFrame();
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
 extern void initouv();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index cd37597..866c8e4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -35,7 +35,6 @@
 #include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/ovd1.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/var_mor.h"
@@ -180,7 +179,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	_txxFileFl = false;
 	// Load texts from TXX files
-	chartex();
+	loadTexts();
 
 	// Load the mort.dat resource
 	Common::ErrorCode result = loadMortDat();
@@ -198,7 +197,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	_currGraphicalDevice = MODE_EGA;
 	_newGraphicalDevice = _currGraphicalDevice;
-	charpal();
+	loadPalette();
 	loadCFIPH();
 	loadCFIEC();
 	decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
@@ -211,7 +210,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_largestClearScreen = false;
 
 	teskbd();
-	dialpre();
+	showConfigScreen();
 	_newGraphicalDevice = _currGraphicalDevice;
 	teskbd();
 	if (_newGraphicalDevice != _currGraphicalDevice)
@@ -551,7 +550,7 @@ void MortevielleEngine::showIntroduction() {
 	CHECK_QUIT;
 
 	// TODO: Once music is implemented, only use the below delay if music is turned off
-	suite();
+	showTitleScreen();
 	delay(3000);
 	music();
 }
@@ -2126,6 +2125,15 @@ void MortevielleEngine::showMoveMenuAlert() {
 }
 
 /**
+ * The original engine used this method to display a starting text screen letting the player
+ * select the graphics mode to use
+ * @remarks	Originally called 'dialpre'
+ */
+void MortevielleEngine::showConfigScreen() {
+	g_crep = 998;
+}
+
+/**
  * Decodes a number of 64 byte blocks
  * @param pStart	Start of data
  * @param count		Number of 64 byte blocks
@@ -2206,8 +2214,8 @@ Common::String MortevielleEngine::getString(int num) {
 
 	if (num < 0) {
 		warning("deline: num < 0! Skipping");
-	} else if (!g_vm->_txxFileFl) {
-		wrkStr = g_vm->getGameString(num);
+	} else if (!_txxFileFl) {
+		wrkStr = getGameString(num);
 	} else {
 		int i = g_t_rec[num]._hintId;
 		byte k = g_t_rec[num]._point;
@@ -2253,7 +2261,7 @@ void MortevielleEngine::resetVariables() {
 	g_s._secretPassageObjectId = 0;
 	g_s._purpleRoomObjectId = 136;
 	g_s._cryptObjectId = 141;
-	g_s._faithScore = g_vm->getRandomNumber(4, 10);
+	g_s._faithScore = getRandomNumber(4, 10);
 	g_s._currPlace = MANOR_FRONT;
 
 	for (int i = 2; i <= 6; ++i)
@@ -2290,7 +2298,7 @@ void MortevielleEngine::resetVariables() {
  * @remarks	Originally called 'writepal'
  */
 void MortevielleEngine::setPal(int n) {
-	switch (g_vm->_currGraphicalDevice) {
+	switch (_currGraphicalDevice) {
 	case MODE_TANDY:
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
@@ -2302,14 +2310,14 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_CGA: {
 		nhom pal[16];
 		for (int i = 0; i < 16; ++i) {
-			pal[i] = g_vm->_cgaPal[n]._a[i];
+			pal[i] = _cgaPal[n]._a[i];
 		}
 
 		if (n < 89)
-			palette(g_vm->_cgaPal[n]._p);
+			palette(_cgaPal[n]._p);
 		
 		for (int i = 0; i <= 15; ++i)
-			outbloc(i, _patternArr[pal[i]._id], pal);
+			displayCGAPattern(i, _patternArr[pal[i]._id], pal);
 		}
 		break;
 	default:
@@ -2317,4 +2325,230 @@ void MortevielleEngine::setPal(int n) {
 	}
 }
 
+/**
+ * Engine function - Display a CGA pattern, using a specified palette
+ * @remarks	Originally called 'outbloc'
+ */
+void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
+	int addr = n * 404 + 0xd700;
+
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + addr], p._tax);
+	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + addr + 2], p._tay);
+	addr += 4;
+	for (int i = 0; i < p._tax; ++i) {
+		for (int j = 0; j < p._tay; ++j)
+			g_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+	}
+}
+
+/**
+ * Engine function - Load Palette from File
+ * @remarks	Originally called 'charpal'
+ */
+void MortevielleEngine::loadPalette() {
+	Common::File f;
+	byte b;
+
+	if (!f.open("fxx.mor"))
+		error("Missing file - fxx.mor");
+	for (int i = 0; i < 108; ++i)
+		g_l[i] = f.readSint16LE();
+	f.close();
+
+	if (!f.open("plxx.mor"))
+		error("Missing file - plxx.mor");
+	for (int i = 0; i <= 90; ++i) {
+		for (int j = 1; j <= 16; ++j) {
+			_stdPal[i][j].x = f.readByte();
+			_stdPal[i][j].y = f.readByte();
+		}
+	}
+	f.close();
+	
+	if (!f.open("cxx.mor"))
+		error("Missing file - cxx.mor");
+
+	for (int j = 0; j <= 90; ++j) {
+		_cgaPal[j]._p = f.readByte();
+		for (int i = 0; i <= 15; ++i) {
+			nhom &with = _cgaPal[j]._a[i];
+
+			b = f.readByte();
+			with._id = (uint)b >> 4;
+			with._hom[0] = ((uint)b >> 2) & 3;
+			with._hom[1] = b & 3;
+		}
+	}
+
+	_cgaPal[10]._a[9] = _cgaPal[10]._a[5];
+	for (int j = 0; j <= 14; ++j) {
+		_patternArr[j]._tax = f.readByte();
+		_patternArr[j]._tay = f.readByte();
+		for (int i = 1; i <= 20; ++i) {
+			for (int k = 1; k <= 20; ++k)
+				_patternArr[j]._des[i][k] = f.readByte();
+		}
+	}
+	f.close();
+}
+
+/**
+ * Engine function - Load Texts from File
+ * @remarks	Originally called 'chartex'
+ */
+void MortevielleEngine::loadTexts() {
+	Common::File inpFile;
+	Common::File ntpFile;
+
+	_txxFileFl = false;
+	if (getLanguage() == Common::EN_ANY) {
+		warning("English version expected - Switching to DAT file");
+		return;
+	}
+
+	if (!inpFile.open("TXX.INP")) {
+		if (!inpFile.open("TXX.MOR")) {
+			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+			return;
+		}
+	} 
+	if (!ntpFile.open("TXX.NTP")) {
+		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+		return;
+	}
+	
+	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {
+		warning("TXX file - Unexpected format - Switching to DAT file");
+		return;
+	} 
+
+	for (int i = 0; i < inpFile.size() / 2; ++i)
+		g_t_mot[i] = inpFile.readUint16LE();
+
+	inpFile.close();
+	_txxFileFl = true;
+
+	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
+		g_t_rec[i]._hintId = ntpFile.readSint16LE();
+		g_t_rec[i]._point = ntpFile.readByte();
+	}
+
+	ntpFile.close();
+
+}
+
+void MortevielleEngine::loadBRUIT5() {
+	Common::File f;
+
+	if (!f.open("bruit5"))
+		error("Missing file - bruit5");
+
+	f.read(&g_mem[kAdrNoise5 * 16 + 0], 149 * 128);
+	f.close();
+}
+
+void MortevielleEngine::loadCFIEC() {
+	Common::File f;
+
+	if (!f.open("cfiec.mor"))
+		error("Missing file - cfiec.mor");
+
+	f.read(&g_adcfiec[0], 822 * 128);
+	f.close();
+
+	_reloadCFIEC = false;
+}
+
+
+void MortevielleEngine::loadCFIPH() {
+	Common::File f;
+
+	if (!f.open("cfiph.mor"))
+		error("Missing file - cfiph.mor");
+
+	for (int i = 0; i < (f.size() / 2); ++i)
+		g_t_cph[i] = f.readSint16LE();
+
+	f.close();
+}
+
+/**
+ * Engine function - Play Music
+ * @remarks	Originally called 'music'
+ */
+void MortevielleEngine::music() {
+	if (_soundOff)
+		return;
+
+	_reloadCFIEC = true;
+	
+	Common::File fic;
+	if (!fic.open("mort.img"))
+		error("Missing file - mort.img");
+
+	fic.read(&g_mem[0x3800 * 16 + 0], 500);
+	fic.read(&g_mem[0x47a0 * 16 + 0], 123);
+	fic.close();
+
+	_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
+	_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
+	_speechManager.cctable(g_tbi);
+
+	bool fin = false;
+	int k = 0;
+	do {
+		fin = keyPressed();
+		_soundManager.musyc(g_tbi, 9958, kTempoMusic);
+		++k;
+		fin = fin | keyPressed() | (k >= 5);
+	} while (!fin);
+	while (keyPressed())
+		getChar();
+}
+
+/**
+ * Engine function - Show title screen
+ * @remarks	Originally called 'suite'
+ */
+void MortevielleEngine::showTitleScreen() {
+	hirs();
+	repon(7, 2035);
+	g_caff = 51;
+	taffich();
+	teskbd();
+	if (_newGraphicalDevice != _currGraphicalDevice)
+		_currGraphicalDevice = _newGraphicalDevice;
+	hirs();
+	g_vm->draw(g_ades, 0, 0);
+
+	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
+	_screenSurface.putxy(104 + 72 * g_res, 185);
+	_screenSurface.drawString(cpr, 0);
+}
+
+/**
+ * Draw picture
+ * @remarks	Originally called 'dessine'
+ */
+void MortevielleEngine::draw(int ad, int x, int y) {
+	g_vm->_mouse.hideMouse();
+	g_vm->setPal(g_numpal);
+	pictout(ad, 0, x, y);
+	g_vm->_mouse.showMouse();
+}
+
+/**
+ * Draw right frame
+ * @remarks	Originally called 'dessine_rouleau'
+ */
+void MortevielleEngine::drawRightFrame() {
+	g_vm->setPal(89);
+	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
+		g_mem[0x7000 * 16 + 14] = 15;
+	}
+	g_vm->_mouse.hideMouse();
+	pictout(0x73a2, 0, 0, 0);
+	g_vm->_mouse.showMouse();
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0bc6b09..b17d729 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -90,6 +90,16 @@ const int amzon = 1650;
 const int fleche = 1758;
 const int arega = 0;
 
+struct nhom {
+	byte _id;     /* number between 0 and 32 */
+	byte _hom[4];
+};
+
+struct t_pcga {
+	byte _p;
+	nhom _a[16];
+};
+
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
@@ -101,6 +111,8 @@ private:
 	Common::StringArray _engineStrings;
 	Common::StringArray _gameStrings;
 
+	Pattern _patternArr[15];
+
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
 	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
@@ -114,6 +126,14 @@ private:
 	void handleAction();
 	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
 	void copcha();
+	void displayCGAPattern(int n, Pattern p, nhom *pal);
+	void loadPalette();
+	void loadTexts();
+	void loadBRUIT5();
+	void loadCFIEC();
+	void loadCFIPH();
+	void showTitleScreen();
+
 public:
 	Common::String _hintPctMessage;
 	Common::Point _prevPos;
@@ -163,6 +183,8 @@ public:
 	int _c_zzz;
 	int ptr_word;
 	byte _v_lieu[7][25];
+	SaveStruct g_s, g_s1;
+	byte g_is;
 
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
@@ -304,11 +326,14 @@ public:
 	void clearScreenType10();
 	int getRandomNumber(int minval, int maxval);
 	void showMoveMenuAlert();
+	void showConfigScreen();
 	void decodeNumber(byte *pStart, int count);
 	Common::String getString(int num);
 	void resetVariables();
-
 	void setPal(int n);
+	void music();
+	void draw(int ad, int x, int y);
+	void drawRightFrame();
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 12c16f9..6a8aaff 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -196,37 +196,37 @@ void taffich() {
 
 	switch (a) {
 	case 16:
-		g_s._pourc[9] = '*';
-		g_s._teauto[42] = '*';
+		g_vm->g_s._pourc[9] = '*';
+		g_vm->g_s._teauto[42] = '*';
 		break;
 	case 20:
-		g_s._teauto[39] = '*';
-		if (g_s._teauto[36] == '*') {
-			g_s._pourc[3] = '*';
-			g_s._teauto[38] = '*';
+		g_vm->g_s._teauto[39] = '*';
+		if (g_vm->g_s._teauto[36] == '*') {
+			g_vm->g_s._pourc[3] = '*';
+			g_vm->g_s._teauto[38] = '*';
 		}
 		break;
 	case 24:
-		g_s._teauto[37] = '*';
+		g_vm->g_s._teauto[37] = '*';
 		break;
 	case 30:
-		g_s._teauto[9] = '*';
+		g_vm->g_s._teauto[9] = '*';
 		break;
 	case 31:
-		g_s._pourc[4] = '*';
-		g_s._teauto[35] = '*';
+		g_vm->g_s._pourc[4] = '*';
+		g_vm->g_s._teauto[35] = '*';
 		break;
 	case 118:
-		g_s._teauto[41] = '*';
+		g_vm->g_s._teauto[41] = '*';
 		break;
 	case 143:
-		g_s._pourc[1] = '*';
+		g_vm->g_s._pourc[1] = '*';
 		break;
 	case 150:
-		g_s._teauto[34] = '*';
+		g_vm->g_s._teauto[34] = '*';
 		break;
 	case 151:
-		g_s._pourc[2] = '*';
+		g_vm->g_s._pourc[2] = '*';
 		break;
 	default:
 		break;
@@ -249,7 +249,7 @@ void taffich() {
 			m = 2018;
 
 		if (a > 99) {
-			if ((g_is == 1) || (g_is == 0))
+			if ((g_vm->g_is == 1) || (g_vm->g_is == 0))
 				m = 2031;
 			else
 				m = 2032;
@@ -258,7 +258,7 @@ void taffich() {
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
 
-		if (((a < 27) && (((g_maff > 69) && (!g_s._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+		if (((a < 27) && (((g_maff > 69) && (!g_vm->g_s._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
 
 		g_maff = a;
@@ -333,11 +333,11 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	g_vm->_mouse.showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_vm->g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
-			cx = t11(g_s._currPlace);
+			cx = t11(g_vm->g_s._currPlace);
 		g_mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
deleted file mode 100644
index 178ef43..0000000
--- a/engines/mortevielle/ovd1.cpp
+++ /dev/null
@@ -1,221 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/file.h"
-#include "mortevielle/dialogs.h"
-#include "mortevielle/keyboard.h"
-#include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-#include "mortevielle/ovd1.h"
-#include "mortevielle/speech.h"
-#include "mortevielle/sound.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-void charpal() {
-	Common::File f;
-	byte b;
-
-	if (!f.open("fxx.mor"))
-		error("Missing file - fxx.mor");
-	for (int i = 0; i < 108; ++i)
-		g_l[i] = f.readSint16LE();
-	f.close();
-
-	if (!f.open("plxx.mor"))
-		error("Missing file - plxx.mor");
-	for (int i = 0; i <= 90; ++i) {
-		for (int j = 1; j <= 16; ++j) {
-			g_vm->_stdPal[i][j].x = f.readByte();
-			g_vm->_stdPal[i][j].y = f.readByte();
-		}
-	}
-	f.close();
-	
-	if (!f.open("cxx.mor"))
-		error("Missing file - cxx.mor");
-
-	for (int j = 0; j <= 90; ++j) {
-		g_vm->_cgaPal[j]._p = f.readByte();
-		for (int i = 0; i <= 15; ++i) {
-			nhom &with = g_vm->_cgaPal[j]._a[i];
-
-			b = f.readByte();
-			with._id = (uint)b >> 4;
-			with._hom[0] = ((uint)b >> 2) & 3;
-			with._hom[1] = b & 3;
-		}
-	}
-
-	g_vm->_cgaPal[10]._a[9] = g_vm->_cgaPal[10]._a[5];
-	for (int j = 0; j <= 14; ++j) {
-		_patternArr[j]._tax = f.readByte();
-		_patternArr[j]._tay = f.readByte();
-		for (int i = 1; i <= 20; ++i)
-			for (int k = 1; k <= 20; ++k)
-				_patternArr[j]._des[i][k] = f.readByte();
-	}
-	f.close();
-}
-
-void chartex() {
-	Common::File inpFile;
-	Common::File ntpFile;
-
-	g_vm->_txxFileFl = false;
-	if (g_vm->getLanguage() == Common::EN_ANY) {
-		warning("English version expected - Switching to DAT file");
-		return;
-	}
-
-	if (!inpFile.open("TXX.INP")) {
-		if (!inpFile.open("TXX.MOR")) {
-			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-			return;
-		}
-	} 
-	if (!ntpFile.open("TXX.NTP")) {
-		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-		return;
-	}
-	
-	if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
-		warning("TXX file - Unexpected format - Switching to DAT file");
-		return;
-	} 
-
-	for (int i = 0; i < inpFile.size() / 2; ++i)
-		g_t_mot[i] = inpFile.readUint16LE();
-
-	inpFile.close();
-	g_vm->_txxFileFl = true;
-
-	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		g_t_rec[i]._hintId = ntpFile.readSint16LE();
-		g_t_rec[i]._point = ntpFile.readByte();
-	}
-
-	ntpFile.close();
-
-}
-
-/**
- * The original engine used this method to display a starting text screen letting the player
- * select the graphics mode to use
- */
-void dialpre() {
-	/* debug('o3 dialpre'); */
-	g_crep = 998;
-}
-
-void music() {
-	if (g_vm->_soundOff)
-		return;
-
-	g_vm->_reloadCFIEC = true;
-	
-	Common::File fic;
-	if (!fic.open("mort.img"))
-		error("Missing file - mort.img");
-
-	fic.read(&g_mem[0x3800 * 16 + 0], 500);
-	fic.read(&g_mem[0x47a0 * 16 + 0], 123);
-	fic.close();
-
-	g_vm->_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
-	g_vm->_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
-	g_vm->_speechManager.cctable(g_tbi);
-
-	bool fin = false;
-	int k = 0;
-	do {
-		fin = g_vm->keyPressed();
-		g_vm->_soundManager.musyc(g_tbi, 9958, kTempoMusic);
-		++k;
-		fin = fin | g_vm->keyPressed() | (k >= 5);
-	} while (!fin);
-	while (g_vm->keyPressed())
-		g_vm->getChar();
-}
-
-
-void loadBRUIT5() {
-	Common::File f;
-
-	if (!f.open("bruit5"))
-		error("Missing file - bruit5");
-
-	f.read(&g_mem[kAdrNoise5 * 16 + 0], 149 * 128);
-	f.close();
-}
-
-void loadCFIEC() {
-	Common::File f;
-
-	if (!f.open("cfiec.mor"))
-		error("Missing file - cfiec.mor");
-
-	f.read(&g_adcfiec[0], 822 * 128);
-	f.close();
-
-	g_vm->_reloadCFIEC = false;
-}
-
-
-void loadCFIPH() {
-	Common::File f;
-
-	if (!f.open("cfiph.mor"))
-		error("Missing file - cfiph.mor");
-
-	for (int i = 0; i < (f.size() / 2); ++i)
-		g_t_cph[i] = f.readSint16LE();
-
-	f.close();
-}
-
-void suite() {
-	hirs();
-	repon(7, 2035);
-	g_caff = 51;
-	taffich();
-	teskbd();
-	if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice)
-		g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
-	hirs();
-	dessine(g_ades, 0, 0);
-
-	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	g_vm->_screenSurface.putxy(104 + 72 * g_res, 185);
-	g_vm->_screenSurface.drawString(cpr, 0);
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/ovd1.h b/engines/mortevielle/ovd1.h
deleted file mode 100644
index 90f9c0d..0000000
--- a/engines/mortevielle/ovd1.h
+++ /dev/null
@@ -1,43 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_OVD1_H
-#define MORTEVIELLE_OVD1_H
-
-namespace Mortevielle {
-
-extern void charpal();
-extern void chartex();
-extern void dialpre();
-extern void music();
-extern void loadBRUIT5();
-extern void loadCFIEC();
-extern void loadCFIPH();
-extern void suite();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 7ddd8b7..c99804f 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -31,7 +31,6 @@
 #include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
-#include "mortevielle/ovd1.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/var_mor.h"
 
@@ -47,25 +46,25 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
  * Handle saving or loading savegame data
  */
 void SavegameManager::sync_save(Common::Serializer &sz) {
-	sz.syncAsSint16LE(g_s1._faithScore);
+	sz.syncAsSint16LE(g_vm->g_s1._faithScore);
 	for (int i = 0; i < 11; ++i)
-		sz.syncAsByte(g_s1._pourc[i]);
+		sz.syncAsByte(g_vm->g_s1._pourc[i]);
 	for (int i = 0; i < 43; ++i)
-		sz.syncAsByte(g_s1._teauto[i]);
+		sz.syncAsByte(g_vm->g_s1._teauto[i]);
 	for (int i = 0; i < 31; ++i)
-		sz.syncAsByte(g_s1._sjer[i]);
-
-	sz.syncAsSint16LE(g_s1._currPlace);
-	sz.syncAsSint16LE(g_s1._atticBallHoleObjectId);
-	sz.syncAsSint16LE(g_s1._atticRodHoleObjectId);
-	sz.syncAsSint16LE(g_s1._cellarObjectId);
-	sz.syncAsSint16LE(g_s1._secretPassageObjectId);
-	sz.syncAsSint16LE(g_s1._wellObjectId);
-	sz.syncAsSint16LE(g_s1._selectedObjectId);
-	sz.syncAsSint16LE(g_s1._purpleRoomObjectId);
-	sz.syncAsSint16LE(g_s1._cryptObjectId);
-	sz.syncAsByte(g_s1._alreadyEnteredManor);
-	sz.syncAsByte(g_s1._fullHour);
+		sz.syncAsByte(g_vm->g_s1._sjer[i]);
+
+	sz.syncAsSint16LE(g_vm->g_s1._currPlace);
+	sz.syncAsSint16LE(g_vm->g_s1._atticBallHoleObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._atticRodHoleObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._cellarObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._secretPassageObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._wellObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._selectedObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._purpleRoomObjectId);
+	sz.syncAsSint16LE(g_vm->g_s1._cryptObjectId);
+	sz.syncAsByte(g_vm->g_s1._alreadyEnteredManor);
+	sz.syncAsByte(g_vm->g_s1._fullHour);
 
 	sz.syncBytes(g_bufcha, 391);
 }
@@ -107,7 +106,7 @@ void SavegameManager::loadSavegame(int n) {
 	Common::Serializer sz(stream, NULL);
 	sync_save(sz);
 
-	g_s = g_s1;
+	g_vm->g_s = g_vm->g_s1;
 	for (int i = 0; i <= 389; ++i)
 		g_tabdon[i + kAcha] = g_bufcha[i];
 
@@ -143,9 +142,9 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	
 	for (i = 0; i <= 389; ++i)
 		g_bufcha[i] = g_tabdon[i + kAcha];
-	g_s1 = g_s;
-	if (g_s1._currPlace == 26)
-		g_s1._currPlace = 15;
+	g_vm->g_s1 = g_vm->g_s;
+	if (g_vm->g_s1._currPlace == 26)
+		g_vm->g_s1._currPlace = 15;
 	
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index b3999b7..a601c45 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -101,7 +101,6 @@ int g_x,
 
 int g_t_cph[6401];
 byte g_tabdon[4001];
-byte g_is;
 
 int g_nbrep[9];
 int g_nbrepm[9];
@@ -112,13 +111,11 @@ byte g_bufcha[391];
 
 byte g_lettres[7][24];
 
-uint16 g_t_mot[maxti + 1];
+uint16 g_t_mot[kMaxTi + 1];
 int g_tay_tchar;
-Hint g_t_rec[maxtd + 1];
+Hint g_t_rec[kMaxTd + 1];
 int g_l[108];
 int g_tbi[256];
-t_pcga g_palcga[91];
-Pattern _patternArr[15];
 
 byte g_adcfiec[(4088 * 16) + (311 * 0x80)];
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index b689752..178ca2d 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -64,8 +64,8 @@ namespace Mortevielle {
 /*-------------------------    CONSTANTS   ----------------------------------*/
 /*---------------------------------------------------------------------------*/
 
-const int maxti = 7975;
-const int maxtd = 600;
+const int kMaxTi = 7975;
+const int kMaxTd = 600;
 
 const int kDescriptionStringIndex = 0;                // Unused
 const int kInventoryStringIndex = 186;
@@ -150,16 +150,6 @@ struct Pattern {
 	byte _des[kMaxPatt + 1][kMaxPatt + 1];
 };
 
-struct nhom {
-	byte _id;     /* number between 0 and 32 */
-	byte _hom[4];
-};
-
-struct t_pcga {
-	byte _p;
-	nhom _a[16];
-};
-
 typedef int tablint[256];
 //typedef Common::Point tabdb[17];
 typedef int tfxx[108];
@@ -210,23 +200,19 @@ extern int g_x,
 extern int g_t_cph[6401]; // Speech
 extern byte g_tabdon[4001];
 
-extern byte g_is;
-
 extern int g_nbrep[9];
 extern int g_nbrepm[9];
 extern int g_msg[5];
 extern byte g_touv[8];
-extern SaveStruct g_s, g_s1;
 extern byte g_bufcha[391];
 
 extern byte g_lettres[7][24];
 
-extern uint16 g_t_mot[maxti + 1];
+extern uint16 g_t_mot[kMaxTi + 1];
 extern int g_tay_tchar;
-extern Hint g_t_rec[maxtd + 1];
+extern Hint g_t_rec[kMaxTd + 1];
 extern int g_l[108];
 extern int g_tbi[256];
-extern Pattern _patternArr[15];
 
 extern byte g_adcfiec[822 * 128];
 
@@ -245,9 +231,6 @@ void Val(const Common::String &s, int &V, int Code);
 
 extern int g_port[0xfff];
 extern byte g_mem[65536 * 16];
-
-#define hires {}
-
 extern void palette(int v1);
 
 } // End of namespace Mortevielle


Commit: e296271d62e800d674ef3e7d4f8411c07d4f21b3
    https://github.com/scummvm/scummvm/commit/e296271d62e800d674ef3e7d4f8411c07d4f21b3
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:40-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 9479ad5..3d92db8 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,13 +42,13 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((g_s._currPlace == ROOM26) && (g_msg[4] == _menu._moveMenu[6])) {
-		g_s._currPlace = LANDING;
-		g_caff = g_s._currPlace;
+	if ((_coreVar._currPlace == ROOM26) && (g_msg[4] == _menu._moveMenu[6])) {
+		_coreVar._currPlace = LANDING;
+		g_caff = _coreVar._currPlace;
 		afdes();
-		repon(2, g_s._currPlace);
+		repon(2, _coreVar._currPlace);
 	}
-	if ((g_s._currPlace == LANDING) && (g_msg[4] == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == LANDING) && (g_msg[4] == _menu._moveMenu[6])) {
 		if (!_syn)
 			ecr3(getEngineString(S_GO_TO));
 		tfleche();
@@ -65,15 +65,15 @@ void MortevielleEngine::fctMove() {
 			return;
 
 		if (g_num == 1) {
-			g_s._currPlace = OWN_ROOM;
+			_coreVar._currPlace = OWN_ROOM;
 			_menu.setDestinationMenuText(OWN_ROOM);
 		} else if (g_num == 7) {
-			g_s._currPlace = ATTIC;
+			_coreVar._currPlace = ATTIC;
 			_menu.setDestinationMenuText(ATTIC);
 		}
 		
 		if (g_num != 6)
-			g_s._currPlace = ROOM26;
+			_coreVar._currPlace = ROOM26;
 		
 		if ((g_num > 1) && (g_num < 6))
 			g_ment = g_num - 1;
@@ -92,55 +92,55 @@ void MortevielleEngine::fctMove() {
 	while (_menu._moveMenu[menuChoice] != g_msg[4])
 		++menuChoice;
 
-	if (g_s._currPlace == MOUNTAIN) {
+	if (_coreVar._currPlace == MOUNTAIN) {
 		if (menuChoice == 1)
 			gotoManorFront();
 		else if (menuChoice == 2)
 			checkManorDistance();
-		_menu.setDestinationMenuText(g_s._currPlace);
+		_menu.setDestinationMenuText(_coreVar._currPlace);
 		return;
-	} else if (g_s._currPlace == INSIDE_WELL) {
+	} else if (_coreVar._currPlace == INSIDE_WELL) {
 		if (menuChoice == 1)
 			floodedInWell();
 		else if (menuChoice == 2)
 			gotoManorBack();
-		_menu.setDestinationMenuText(g_s._currPlace);
+		_menu.setDestinationMenuText(_coreVar._currPlace);
 		return;
-	} else if ((g_s._currPlace == BUREAU) && (menuChoice == 1))
+	} else if ((_coreVar._currPlace == BUREAU) && (menuChoice == 1))
 		menuChoice = 6;
-	else if (g_s._currPlace == KITCHEN) {
+	else if (_coreVar._currPlace == KITCHEN) {
 		if (menuChoice == 2)
 			menuChoice = 6;
 		else if (menuChoice == 5)
 			menuChoice = 16;
-	} else if ((g_s._currPlace == CELLAR) && (menuChoice == 3))
+	} else if ((_coreVar._currPlace == CELLAR) && (menuChoice == 3))
 		menuChoice = 6;
-	else if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (menuChoice == 4))
+	else if (((_coreVar._currPlace == LANDING) || (_coreVar._currPlace == ROOM26)) && (menuChoice == 4))
 		menuChoice = 6;
 	
-	if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != ROOM26))
+	if ((_coreVar._currPlace > MOUNTAIN) && (_coreVar._currPlace != ROOM26))
 		menuChoice += 10;
 	
-	if ((g_s._currPlace == CHAPEL) && (menuChoice == 13))
+	if ((_coreVar._currPlace == CHAPEL) && (menuChoice == 13))
 		menuChoice = 16;
-	else if (g_s._currPlace == MANOR_FRONT) {
+	else if (_coreVar._currPlace == MANOR_FRONT) {
 		if (menuChoice == 12)
 			menuChoice = 16;
 		else if (menuChoice > 13)
 			menuChoice = 15;
-	} else if ((g_s._currPlace == MANOR_BACK) && (menuChoice > 14))
+	} else if ((_coreVar._currPlace == MANOR_BACK) && (menuChoice > 14))
 		menuChoice = 15;
-	else if ((g_s._currPlace == WELL) && (menuChoice > 13) && (menuChoice != 17))
+	else if ((_coreVar._currPlace == WELL) && (menuChoice > 13) && (menuChoice != 17))
 		menuChoice = 15;
 
 	if (menuChoice == 1)
-		g_s._currPlace = BUREAU;
+		_coreVar._currPlace = BUREAU;
 	else if (menuChoice == 2)
-		g_s._currPlace = KITCHEN;
+		_coreVar._currPlace = KITCHEN;
 	else if (menuChoice == 3)
-		g_s._currPlace = CELLAR;
+		_coreVar._currPlace = CELLAR;
 	else if (menuChoice == 4)
-		g_s._currPlace = LANDING;
+		_coreVar._currPlace = LANDING;
 	else if (menuChoice == 5)
 		menuChoice = 12;
 	else if (menuChoice == 6)
@@ -151,30 +151,30 @@ void MortevielleEngine::fctMove() {
 	else if (menuChoice == 12)
 		gotoManorFront();
 	else if (menuChoice == 13)
-		g_s._currPlace = CHAPEL;
+		_coreVar._currPlace = CHAPEL;
 	else if (menuChoice == 14)
-		g_s._currPlace = WELL;
+		_coreVar._currPlace = WELL;
 	else if (menuChoice == 15)
 		checkManorDistance();
 	else if (menuChoice == 16)
 		gotoManorBack();
 	else if (menuChoice == 17) {
-		if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140))
+		if ((_coreVar._wellObjectId != 120) && (_coreVar._wellObjectId != 140))
 			g_crep = 997;
-		else if (g_s._wellObjectId == 120)
+		else if (_coreVar._wellObjectId == 120)
 			g_crep = 181;
-		else if (g_s._faithScore > 80) {
+		else if (_coreVar._faithScore > 80) {
 			g_crep = 1505;
 			loseGame();
 		} else {
-			g_s._currPlace = INSIDE_WELL;
+			_coreVar._currPlace = INSIDE_WELL;
 			affrep();
 		}
 	}
 	if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
 		affrep();
-	debloc(g_s._currPlace);
-	_menu.setDestinationMenuText(g_s._currPlace);
+	debloc(_coreVar._currPlace);
+	_menu.setDestinationMenuText(_coreVar._currPlace);
 }
 
 /**
@@ -187,24 +187,24 @@ void MortevielleEngine::fctTake() {
 		avpoing(cx);
 		if (g_crep != 139) {
 			if (_currBitIndex > 0)
-				g_s._faithScore += 3;
+				_coreVar._faithScore += 3;
 			if (_obpart) {
-				if (g_s._currPlace == PURPLE_ROOM)
-					g_s._purpleRoomObjectId = 0;
-				if (g_s._currPlace == ATTIC) {
-					if (g_s._atticBallHoleObjectId == g_caff)
-						g_s._atticBallHoleObjectId = 0;
-					if (g_s._atticRodHoleObjectId == g_caff)
-						g_s._atticRodHoleObjectId = 0;
+				if (_coreVar._currPlace == PURPLE_ROOM)
+					_coreVar._purpleRoomObjectId = 0;
+				if (_coreVar._currPlace == ATTIC) {
+					if (_coreVar._atticBallHoleObjectId == g_caff)
+						_coreVar._atticBallHoleObjectId = 0;
+					if (_coreVar._atticRodHoleObjectId == g_caff)
+						_coreVar._atticRodHoleObjectId = 0;
 				}
-				if (g_s._currPlace == CELLAR)
-					g_s._cellarObjectId = 0;
-				if (g_s._currPlace == CRYPT)
-					g_s._cryptObjectId = 0;
-				if (g_s._currPlace == SECRET_PASSAGE)
-					g_s._secretPassageObjectId = 0;
-				if (g_s._currPlace == WELL)
-					g_s._wellObjectId = 0;
+				if (_coreVar._currPlace == CELLAR)
+					_coreVar._cellarObjectId = 0;
+				if (_coreVar._currPlace == CRYPT)
+					_coreVar._cryptObjectId = 0;
+				if (_coreVar._currPlace == SECRET_PASSAGE)
+					_coreVar._secretPassageObjectId = 0;
+				if (_coreVar._currPlace == WELL)
+					_coreVar._wellObjectId = 0;
 				_menu.unsetSearchMenu();
 				_obpart = false;
 				affrep();
@@ -213,7 +213,7 @@ void MortevielleEngine::fctTake() {
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
-					g_s._faithScore += 2;
+					_coreVar._faithScore += 2;
 					g_dobj = 0;
 				}
 			}
@@ -233,41 +233,41 @@ void MortevielleEngine::fctTake() {
 		}
 	}
 	tcoord(5);
-	if ((g_num == 0) || ((g_num == 1) && (g_s._currPlace == CRYPT))) {
+	if ((g_num == 0) || ((g_num == 1) && (_coreVar._currPlace == CRYPT))) {
 		tcoord(8);
 		if (g_num != 0) {
 			if (_currBitIndex > 0)
-				g_s._faithScore += 3;
+				_coreVar._faithScore += 3;
 			g_crep = 997;
-			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
-				avpoing(g_s._purpleRoomObjectId);
-			if ((g_s._currPlace == ATTIC) && (g_num == 1) && (g_s._atticBallHoleObjectId != 0)) {
-				avpoing(g_s._atticBallHoleObjectId);
+			if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
+				avpoing(_coreVar._purpleRoomObjectId);
+			if ((_coreVar._currPlace == ATTIC) && (g_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
+				avpoing(_coreVar._atticBallHoleObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 7);
 			}
-			if ((g_s._currPlace == ATTIC) && (g_num == 2) && (g_s._atticRodHoleObjectId != 0)) {
-				avpoing(g_s._atticRodHoleObjectId);
+			if ((_coreVar._currPlace == ATTIC) && (g_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
+				avpoing(_coreVar._atticRodHoleObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 6);
 			}
-			if ((g_s._currPlace == CELLAR) && (g_s._cellarObjectId != 0)) {
-				avpoing(g_s._cellarObjectId);
+			if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
+				avpoing(_coreVar._cellarObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 2);
 			}
-			if ((g_s._currPlace == CRYPT) && (g_s._cryptObjectId != 0))
-				avpoing(g_s._cryptObjectId);
+			if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
+				avpoing(_coreVar._cryptObjectId);
 
-			if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId != 0)) {
-				avpoing(g_s._secretPassageObjectId);
+			if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId != 0)) {
+				avpoing(_coreVar._secretPassageObjectId);
 				if ((g_crep != 997) && (g_crep != 139)) {
 					g_crep = 182;
 					aniof(2, 1);
 				}
 			}
-			if ((g_s._currPlace == WELL) && (g_s._wellObjectId != 0)) {
-				avpoing(g_s._wellObjectId);
+			if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
+				avpoing(_coreVar._wellObjectId);
 				if ((g_crep != 997) && (g_crep != 139))
 					aniof(2, 1);
 			}
@@ -275,22 +275,22 @@ void MortevielleEngine::fctTake() {
 				g_crep = 999;
 		}
 	} else {
-		if ( ((g_s._currPlace == OWN_ROOM)  && (g_num == 3))
-		  || ((g_s._currPlace == GREEN_ROOM)  && (g_num == 4))
-		  || ((g_s._currPlace == PURPLE_ROOM)  && (g_num == 1))
-		  || ((g_s._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
-		  || ((g_s._currPlace == BLUE_ROOM)  && (g_num == 6))
-		  || ((g_s._currPlace == RED_ROOM)  && (g_num == 2))
-		  || ((g_s._currPlace == BATHROOM)  && (g_num == 6))
-		  || ((g_s._currPlace == GREEN_ROOM2)  && (g_num == 4))
-		  || ((g_s._currPlace == ROOM9) && (g_num == 4))
-		  || ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
-		  || ((g_s._currPlace == BUREAU) && (g_num == 7))
-		  || ((g_s._currPlace == KITCHEN) && (g_num == 6))
-		  || ((g_s._currPlace == ATTIC) && (g_num > 4))
-		  || ((g_s._currPlace > ATTIC) && (g_s._currPlace != INSIDE_WELL)) )
+		if ( ((_coreVar._currPlace == OWN_ROOM)  && (g_num == 3))
+		  || ((_coreVar._currPlace == GREEN_ROOM)  && (g_num == 4))
+		  || ((_coreVar._currPlace == PURPLE_ROOM)  && (g_num == 1))
+		  || ((_coreVar._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
+		  || ((_coreVar._currPlace == BLUE_ROOM)  && (g_num == 6))
+		  || ((_coreVar._currPlace == RED_ROOM)  && (g_num == 2))
+		  || ((_coreVar._currPlace == BATHROOM)  && (g_num == 6))
+		  || ((_coreVar._currPlace == GREEN_ROOM2)  && (g_num == 4))
+		  || ((_coreVar._currPlace == ROOM9) && (g_num == 4))
+		  || ((_coreVar._currPlace == DINING_ROOM) && (g_num > 2))
+		  || ((_coreVar._currPlace == BUREAU) && (g_num == 7))
+		  || ((_coreVar._currPlace == KITCHEN) && (g_num == 6))
+		  || ((_coreVar._currPlace == ATTIC) && (g_num > 4))
+		  || ((_coreVar._currPlace > ATTIC) && (_coreVar._currPlace != INSIDE_WELL)) )
 		  g_crep = 997;
-		else if (g_s._currPlace == INSIDE_WELL) {
+		else if (_coreVar._currPlace == INSIDE_WELL) {
 			g_crep = 1504;
 			loseGame();
 		} else
@@ -312,11 +312,11 @@ void MortevielleEngine::fctInventoryTake() {
 	cy = 0;
 	do {
 		++cy;
-		if (ord(g_s._sjer[cy]) != 0)
+		if (ord(_coreVar._sjer[cy]) != 0)
 			++cz;
 	} while (cz != cx);
-	cz = ord(g_s._sjer[cy]);
-	g_s._sjer[cy] = chr(0);
+	cz = ord(_coreVar._sjer[cy]);
+	_coreVar._sjer[cy] = chr(0);
 	modinv();
 	avpoing(cz);
 	g_crep = 998;
@@ -338,19 +338,19 @@ void MortevielleEngine::fctLift() {
 		tcoord(8);
 		if (g_num != 0) {
 			if (_currBitIndex > 0)
-				++g_s._faithScore;
+				++_coreVar._faithScore;
 			g_crep = 997;
-			if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
-				treg(g_s._purpleRoomObjectId);
+			if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
+				treg(_coreVar._purpleRoomObjectId);
 		}
 		return;
 	}
 	if (_currBitIndex > 0)
-		++g_s._faithScore;
-	int tmpPlace = g_s._currPlace;
-	if (g_s._currPlace == CRYPT)
+		++_coreVar._faithScore;
+	int tmpPlace = _coreVar._currPlace;
+	if (_coreVar._currPlace == CRYPT)
 		tmpPlace = 14;
-	else if (g_s._currPlace == MOUNTAIN)
+	else if (_coreVar._currPlace == MOUNTAIN)
 		tmpPlace = 15;
 	g_crep = g_tabdon[asoul + (tmpPlace << 3) + (g_num - 1)];
 	if (g_crep == 255)
@@ -381,10 +381,10 @@ void MortevielleEngine::fctRead() {
  * @remarks	Originally called 'tslire'
  */
 void MortevielleEngine::fctSelfRead() {
-	if (g_s._selectedObjectId == 0)
+	if (_coreVar._selectedObjectId == 0)
 		g_crep = 186;
 	else
-		st4(g_s._selectedObjectId);
+		st4(_coreVar._selectedObjectId);
 }
 
 /**
@@ -408,60 +408,60 @@ void MortevielleEngine::fctLook() {
 		tcoord(8);
 		g_crep = 131;
 		if (g_num != 0) {
-			if (g_s._currPlace == ATTIC) {
+			if (_coreVar._currPlace == ATTIC) {
 				if (g_num == 1) {
 					g_crep = 164;
-					if (g_s._atticRodHoleObjectId != 0)
-						treg(g_s._atticRodHoleObjectId);
-					else if (g_s._atticBallHoleObjectId != 0)
-						treg(g_s._atticBallHoleObjectId);
+					if (_coreVar._atticRodHoleObjectId != 0)
+						treg(_coreVar._atticRodHoleObjectId);
+					else if (_coreVar._atticBallHoleObjectId != 0)
+						treg(_coreVar._atticBallHoleObjectId);
 				} else {
 					g_crep = 193;
-					if (g_s._atticRodHoleObjectId != 0)
-						treg(g_s._atticRodHoleObjectId);
+					if (_coreVar._atticRodHoleObjectId != 0)
+						treg(_coreVar._atticRodHoleObjectId);
 				}
 			}
-			if (g_s._currPlace == CELLAR) {
+			if (_coreVar._currPlace == CELLAR) {
 				g_crep = 164;
-				if (g_s._cellarObjectId != 0)
-					treg(g_s._cellarObjectId);
+				if (_coreVar._cellarObjectId != 0)
+					treg(_coreVar._cellarObjectId);
 			}
-			if (g_s._currPlace == SECRET_PASSAGE) {
+			if (_coreVar._currPlace == SECRET_PASSAGE) {
 				g_crep = 174;
-				if (g_s._secretPassageObjectId != 0)
-					treg(g_s._secretPassageObjectId);
+				if (_coreVar._secretPassageObjectId != 0)
+					treg(_coreVar._secretPassageObjectId);
 			}
-			if (g_s._currPlace == WELL) {
+			if (_coreVar._currPlace == WELL) {
 				g_crep = 131;
-				if (g_s._wellObjectId != 0)
-					treg(g_s._wellObjectId);
+				if (_coreVar._wellObjectId != 0)
+					treg(_coreVar._wellObjectId);
 			}
 		}
 		return;
 	}
-	cx = g_s._currPlace;
-	if (g_s._currPlace == CHAPEL)
+	cx = _coreVar._currPlace;
+	if (_coreVar._currPlace == CHAPEL)
 		cx = 17;
-	if ((g_s._currPlace > MANOR_FRONT) && (g_s._currPlace < DOOR))
+	if ((_coreVar._currPlace > MANOR_FRONT) && (_coreVar._currPlace < DOOR))
 		cx -= 4;
-	if (g_s._currPlace == ROOM26)
+	if (_coreVar._currPlace == ROOM26)
 		cx = 21;
 	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
-	if ((g_s._currPlace == ATTIC) && (g_num == 8))
+	if ((_coreVar._currPlace == ATTIC) && (g_num == 8))
 		g_crep = 126;
-	if (g_s._currPlace == MOUNTAIN)
+	if (_coreVar._currPlace == MOUNTAIN)
 		g_crep = 103;
 	if (g_crep == 255)
 		g_crep = 131;
-	if ((g_s._currPlace == GREEN_ROOM) && (g_num == 1))
+	if ((_coreVar._currPlace == GREEN_ROOM) && (g_num == 1))
 		treg(144);
-	if ((g_s._currPlace == BLUE_ROOM) && (g_num == 3))
+	if ((_coreVar._currPlace == BLUE_ROOM) && (g_num == 3))
 		treg(147);
-	if ((g_s._currPlace == GREEN_ROOM2) && (g_num == 3))
+	if ((_coreVar._currPlace == GREEN_ROOM2) && (g_num == 3))
 		treg(149);
-	if ((g_s._currPlace == 9) && (g_num == 2))
+	if ((_coreVar._currPlace == 9) && (g_num == 2))
 		treg(30);
-	if ((g_s._currPlace == DINING_ROOM) && (g_num == 3))
+	if ((_coreVar._currPlace == DINING_ROOM) && (g_num == 3))
 		treg(31);
 }
 
@@ -470,8 +470,8 @@ void MortevielleEngine::fctLook() {
  * @remarks	Originally called 'tsregarder'
  */
 void MortevielleEngine::fctSelftLook() {
-	if (g_s._selectedObjectId != 0)
-		treg(g_s._selectedObjectId);
+	if (_coreVar._selectedObjectId != 0)
+		treg(_coreVar._selectedObjectId);
 	else
 		g_crep = 186;
 }
@@ -495,7 +495,7 @@ void MortevielleEngine::fctSearch() {
 	if (_anyone || _keyPressedEsc)
 		return;
 
-	if (g_s._currPlace == INSIDE_WELL) {
+	if (_coreVar._currPlace == INSIDE_WELL) {
 		g_crep = 1504;
 		loseGame();
 		return;
@@ -513,7 +513,7 @@ void MortevielleEngine::fctSearch() {
 				g_crep = 187;
 			else {
 				if (_currBitIndex > 0)
-					g_s._faithScore += 3;
+					_coreVar._faithScore += 3;
 
 				rechai(g_mchai);
 				if (g_mchai != 0) {
@@ -530,41 +530,41 @@ void MortevielleEngine::fctSearch() {
 			g_crep = 997;
 			if (g_num != 0) {
 				if (_currBitIndex > 0)
-					g_s._faithScore += 3;
-				if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
-					if (g_s._currPlace == PURPLE_ROOM) {
+					_coreVar._faithScore += 3;
+				if ((_coreVar._currPlace != WELL) && (_coreVar._currPlace != SECRET_PASSAGE) && (_coreVar._currPlace != ATTIC)) {
+					if (_coreVar._currPlace == PURPLE_ROOM) {
 						g_crep = 123;
-						if (g_s._purpleRoomObjectId != 0)
-							treg(g_s._purpleRoomObjectId);
+						if (_coreVar._purpleRoomObjectId != 0)
+							treg(_coreVar._purpleRoomObjectId);
 					}
-					if (g_s._currPlace == CRYPT) {
+					if (_coreVar._currPlace == CRYPT) {
 						g_crep = 123;
-						if (g_s._cryptObjectId != 0)
-							treg(g_s._cryptObjectId);
+						if (_coreVar._cryptObjectId != 0)
+							treg(_coreVar._cryptObjectId);
 					}
 				}
 			}
 		}
 	} else {
 		if (_currBitIndex > 0)
-			g_s._faithScore += 3;
+			_coreVar._faithScore += 3;
 		g_crep = 997;
-		if (g_s._currPlace < CELLAR)
-			g_crep = r[g_s._currPlace];
+		if (_coreVar._currPlace < CELLAR)
+			g_crep = r[_coreVar._currPlace];
 
-		if ((g_s._currPlace == TOILETS) && (g_num == 2))
+		if ((_coreVar._currPlace == TOILETS) && (g_num == 2))
 			g_crep = 162;
 
-		if (g_s._currPlace == KITCHEN) {
+		if (_coreVar._currPlace == KITCHEN) {
 			if ((g_num == 3) || (g_num == 4))
 				g_crep = 162;
 			else if (g_num == 5)
 				g_crep = 159;
 		}
 
-		if (g_s._currPlace == MOUNTAIN)
+		if (_coreVar._currPlace == MOUNTAIN)
 			g_crep = 104;
-		else if (g_s._currPlace == CRYPT)
+		else if (_coreVar._currPlace == CRYPT)
 			g_crep = 155;
 	}
 }
@@ -574,8 +574,8 @@ void MortevielleEngine::fctSearch() {
  * @remarks	Originally called 'tsfouiller'
  */
 void MortevielleEngine::fctSelfSearch() {
-	if (g_s._selectedObjectId != 0)
-		st7(g_s._selectedObjectId);
+	if (_coreVar._selectedObjectId != 0)
+		st7(_coreVar._selectedObjectId);
 	else
 		g_crep = 186;
 }
@@ -609,30 +609,30 @@ void MortevielleEngine::fctOpen() {
 	tcoord(7);
 	if (g_num != 0) {
 		if (_currBitIndex > 0)
-			g_s._faithScore += 2;
+			_coreVar._faithScore += 2;
 		++g_iouv;
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
 		} while (!((tmpPlace > 6) || (ord(g_touv[tmpPlace]) == 0) || (ord(g_touv[tmpPlace]) == g_num)));
 		if (ord(g_touv[tmpPlace]) != g_num) {
-			if (!( ((g_num == 3) && ((g_s._currPlace == OWN_ROOM) || (g_s._currPlace == 9) || (g_s._currPlace == BLUE_ROOM) || (g_s._currPlace == BATHROOM)))
-			    || ((g_num == 4) && ((g_s._currPlace == GREEN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == RED_ROOM)))
-				|| ((g_s._currPlace == DARKBLUE_ROOM) && (g_num == 5))
-				|| ((g_num == 6) && ((g_s._currPlace == BATHROOM) || (g_s._currPlace == DINING_ROOM) || (g_s._currPlace == GREEN_ROOM2) || (g_s._currPlace == ATTIC)))
-				|| ((g_s._currPlace == GREEN_ROOM2) && (g_num == 2))
-				|| ((g_s._currPlace == KITCHEN) && (g_num == 7))) ) {
-				if ( ((g_s._currPlace > DINING_ROOM) && (g_s._currPlace < CELLAR))
-				  || ((g_s._currPlace > RED_ROOM) && (g_s._currPlace < DINING_ROOM))
-				  || (g_s._currPlace == OWN_ROOM) || (g_s._currPlace == PURPLE_ROOM) || (g_s._currPlace == BLUE_ROOM)) {
+			if (!( ((g_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == 9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
+			    || ((g_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
+				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (g_num == 5))
+				|| ((g_num == 6) && ((_coreVar._currPlace == BATHROOM) || (_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == GREEN_ROOM2) || (_coreVar._currPlace == ATTIC)))
+				|| ((_coreVar._currPlace == GREEN_ROOM2) && (g_num == 2))
+				|| ((_coreVar._currPlace == KITCHEN) && (g_num == 7))) ) {
+				if ( ((_coreVar._currPlace > DINING_ROOM) && (_coreVar._currPlace < CELLAR))
+				  || ((_coreVar._currPlace > RED_ROOM) && (_coreVar._currPlace < DINING_ROOM))
+				  || (_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
 						_speechManager.startSpeech(7, 9, 1);
 				}
 				g_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
 			}
-			tmpPlace = g_s._currPlace;
-			if (g_s._currPlace == CRYPT)
+			tmpPlace = _coreVar._currPlace;
+			if (_coreVar._currPlace == CRYPT)
 				tmpPlace = CELLAR;
 			g_crep = g_tabdon[aouvr + (tmpPlace * 7) + g_num - 1];
 			if (g_crep == 254)
@@ -647,7 +647,7 @@ void MortevielleEngine::fctOpen() {
  * @remarks	Originally called 'tmettre'
  */
 void MortevielleEngine::fctPlace() {
-	if (g_s._selectedObjectId == 0) {
+	if (_coreVar._selectedObjectId == 0) {
 		g_crep = 186;
 		return;
 	}
@@ -667,28 +667,28 @@ void MortevielleEngine::fctPlace() {
 		g_crep = 999;
 		if (g_caff == 13) {
 			if (g_num == 1) {
-				if (g_s._atticBallHoleObjectId != 0) {
+				if (_coreVar._atticBallHoleObjectId != 0) {
 					g_crep = 188;
 				} else {
-					g_s._atticBallHoleObjectId = g_s._selectedObjectId;
-					if (g_s._selectedObjectId == 141)
+					_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
+					if (_coreVar._selectedObjectId == 141)
 						aniof(1, 7);
 				}
-			} else if (g_s._atticRodHoleObjectId != 0) {
+			} else if (_coreVar._atticRodHoleObjectId != 0) {
 				g_crep = 188;
 			} else {
-				g_s._atticRodHoleObjectId = g_s._selectedObjectId;
-				if (g_s._selectedObjectId == 159)
+				_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
+				if (_coreVar._selectedObjectId == 159)
 					aniof(1, 6);
 			}
 		}
 
 		if (g_caff == 14) {
-			if (g_s._cellarObjectId != 0) {
+			if (_coreVar._cellarObjectId != 0) {
 				g_crep = 188;
 			} else {
-				g_s._cellarObjectId = g_s._selectedObjectId;
-				if (g_s._selectedObjectId == 151) {
+				_coreVar._cellarObjectId = _coreVar._selectedObjectId;
+				if (_coreVar._selectedObjectId == 151) {
 					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
@@ -709,7 +709,7 @@ void MortevielleEngine::fctPlace() {
 						clearScreenType2();
 						clearScreenType3();
 						_mouse.showMouse();
-						tinke();
+						prepareRoom();
 						drawClock();
 						if (_currBitIndex != 0)
 							showPeoplePresent(_currBitIndex);
@@ -718,10 +718,10 @@ void MortevielleEngine::fctPlace() {
 
 						_menu.displayMenu();
 						if (enterPassageFl) {
-							g_s._currPlace = SECRET_PASSAGE;
+							_coreVar._currPlace = SECRET_PASSAGE;
 							_menu.setDestinationMenuText(SECRET_PASSAGE);
 						} else {
-							_menu.setDestinationMenuText(g_s._currPlace);
+							_menu.setDestinationMenuText(_coreVar._currPlace);
 							setPal(14);
 							dessin(0);
 							aniof(1, 2);
@@ -742,17 +742,17 @@ void MortevielleEngine::fctPlace() {
 		}
 
 		if (g_caff == 16) {
-			if (g_s._cryptObjectId == 0)
-				g_s._cryptObjectId = g_s._selectedObjectId;
+			if (_coreVar._cryptObjectId == 0)
+				_coreVar._cryptObjectId = _coreVar._selectedObjectId;
 			else
 				g_crep = 188;
 		}
 
 		if (g_caff == 17) {
-			if (g_s._secretPassageObjectId != 0) {
+			if (_coreVar._secretPassageObjectId != 0) {
 				g_crep = 188;
-			} else if (g_s._selectedObjectId == 143) {
-				g_s._secretPassageObjectId = 143;
+			} else if (_coreVar._selectedObjectId == 143) {
+				_coreVar._secretPassageObjectId = 143;
 				aniof(1, 1);
 			} else {
 				g_crep = 1512;
@@ -761,10 +761,10 @@ void MortevielleEngine::fctPlace() {
 		}
 
 		if (g_caff == 24) {
-			if (g_s._wellObjectId != 0) {
+			if (_coreVar._wellObjectId != 0) {
 				g_crep = 188;
-			} else if ((g_s._selectedObjectId == 140) || (g_s._selectedObjectId == 120)) {
-				g_s._wellObjectId = g_s._selectedObjectId;
+			} else if ((_coreVar._selectedObjectId == 140) || (_coreVar._selectedObjectId == 120)) {
+				_coreVar._wellObjectId = _coreVar._selectedObjectId;
 				aniof(1, 1);
 			} else {
 				g_crep = 185;
@@ -793,7 +793,7 @@ void MortevielleEngine::fctTurn() {
 	tcoord(9);
 	if (g_num != 0) {
 		g_crep = 997;
-		if ((g_s._currPlace == ATTIC) && (g_s._atticRodHoleObjectId == 159) && (g_s._atticBallHoleObjectId == 141)) {
+		if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
 			_speechManager.startSpeech(7, 9, 1);
 			int answer = Alert::show(getEngineString(S_YES_NO), 1);
@@ -802,13 +802,13 @@ void MortevielleEngine::fctTurn() {
 			else
 				g_crep = 168;
 		}
-		if ((g_s._currPlace == SECRET_PASSAGE) && (g_s._secretPassageObjectId == 143)) {
+		if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143)) {
 			repon(2, 175);
 			clearScreenType3();
 			_speechManager.startSpeech(6, -9, 1);
 			int answer = Alert::show(getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
-				g_s._currPlace = CRYPT;
+				_coreVar._currPlace = CRYPT;
 				affrep();
 			} else
 				g_crep = 176;
@@ -840,7 +840,7 @@ void MortevielleEngine::fctSelfHide() {
  * @remarks	Originally called 'tattacher'
  */
 void MortevielleEngine::fctAttach() {
-	if (g_s._selectedObjectId == 0)
+	if (_coreVar._selectedObjectId == 0)
 		g_crep = 186;
 	else {
 		if (!_syn)
@@ -849,10 +849,10 @@ void MortevielleEngine::fctAttach() {
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			tcoord(8);
 			g_crep = 997;
-			if ((g_num != 0) && (g_s._currPlace == WELL)) {
+			if ((g_num != 0) && (_coreVar._currPlace == WELL)) {
 				g_crep = 999;
-				if ((g_s._selectedObjectId == 120) || (g_s._selectedObjectId == 140)) {
-					g_s._wellObjectId = g_s._selectedObjectId;
+				if ((_coreVar._selectedObjectId == 120) || (_coreVar._selectedObjectId == 140)) {
+					_coreVar._wellObjectId = _coreVar._selectedObjectId;
 					aniof(1, 1);
 				} else
 					g_crep = 185;
@@ -910,15 +910,15 @@ void MortevielleEngine::fctKnock() {
 	if (!_syn)
 		ecr3(getEngineString(S_HIT));
 
-	if (g_s._currPlace == LANDING) {
+	if (_coreVar._currPlace == LANDING) {
 		Alert::show(getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
-	if (g_s._currPlace < DOOR) {
+	if (_coreVar._currPlace < DOOR) {
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
-			if ((g_s._currPlace < MOUNTAIN) && (g_s._currPlace != LANDING))
+			if ((_coreVar._currPlace < MOUNTAIN) && (_coreVar._currPlace != LANDING))
 				g_crep = 133;
 			else
 				g_crep = 997;
@@ -927,11 +927,11 @@ void MortevielleEngine::fctKnock() {
 		return;
 	}
 
-	if (g_s._currPlace == ROOM26) {
+	if (_coreVar._currPlace == ROOM26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		_speechManager.startSpeech(11, rand, 1);
 		int p;
-		ecfren(p, rand, g_s._faithScore, g_ment);
+		ecfren(p, rand, _coreVar._faithScore, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -957,7 +957,7 @@ void MortevielleEngine::fctKnock() {
 void MortevielleEngine::fctSelfPut() {
 	if (!_syn)
 		ecr3(getEngineString(S_POSE));
-	if (g_s._selectedObjectId == 0)
+	if (_coreVar._selectedObjectId == 0)
 		g_crep = 186;
 	else {
 		if (g_caff > 99) {
@@ -994,30 +994,30 @@ void MortevielleEngine::fctSelfPut() {
 			if (g_num != 0) {
 				g_crep = 998;
 				if (g_caff == PURPLE_ROOM) {
-					if (g_s._purpleRoomObjectId != 0)
+					if (_coreVar._purpleRoomObjectId != 0)
 						g_crep = 188;
 					else
-						g_s._purpleRoomObjectId = g_s._selectedObjectId;
+						_coreVar._purpleRoomObjectId = _coreVar._selectedObjectId;
 				}
 
 				if (g_caff == ATTIC) {
 					if (g_num == 1) {
-						if (g_s._atticBallHoleObjectId != 0)
+						if (_coreVar._atticBallHoleObjectId != 0)
 							g_crep = 188;
 						else
-							g_s._atticBallHoleObjectId = g_s._selectedObjectId;
-					} else if (g_s._atticRodHoleObjectId != 0) {
+							_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
+					} else if (_coreVar._atticRodHoleObjectId != 0) {
 						g_crep = 188;
 					} else {
-						g_s._atticRodHoleObjectId = g_s._selectedObjectId;
+						_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
 					}
 				}
 
 				if (g_caff == CRYPT) {
-					if (g_s._cryptObjectId != 0)
+					if (_coreVar._cryptObjectId != 0)
 						g_crep = 188;
 					else
-						g_s._cryptObjectId = g_s._selectedObjectId;
+						_coreVar._cryptObjectId = _coreVar._selectedObjectId;
 				}
 
 				if (g_caff == WELL)
@@ -1049,13 +1049,13 @@ void MortevielleEngine::fctSelfPut() {
  * @remarks	Originally called 'tecouter'
  */
 void MortevielleEngine::fctListen() {
-	if (g_s._currPlace != ROOM26)
+	if (_coreVar._currPlace != ROOM26)
 		g_crep = 101;
 	else {
 		if (_currBitIndex != 0)
-			++g_s._faithScore;
+			++_coreVar._faithScore;
 		int p, rand;
-		ecfren(p, rand, g_s._faithScore, g_ment);
+		ecfren(p, rand, _coreVar._faithScore, g_ment);
 		int l = g_ment;
 		if (l != 0) {
 			if (p != -500) {
@@ -1087,19 +1087,19 @@ void MortevielleEngine::fctListen() {
  * @remarks	Originally called 'tmanger'
  */
 void MortevielleEngine::fctEat() {
-	if ((g_s._currPlace > LANDING) && (g_s._currPlace < ROOM26)) {
+	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
 		g_crep = 148;
 	} else {
 		tsort();
-		g_s._currPlace = DINING_ROOM;
+		_coreVar._currPlace = DINING_ROOM;
 		g_caff = 10;
-		debloc(g_s._currPlace);
-		_menu.setDestinationMenuText(g_s._currPlace);
+		debloc(_coreVar._currPlace);
+		_menu.setDestinationMenuText(_coreVar._currPlace);
 
 		int j, h, m;
 		updateHour(j, h, m);
 		if ((h == 12) || (h == 13) || (h == 19)) {
-			g_s._faithScore -= (g_s._faithScore / 7);
+			_coreVar._faithScore -= (_coreVar._faithScore / 7);
 			if (h == 12) {
 				if (m == 0)
 					h = 4;
@@ -1116,7 +1116,7 @@ void MortevielleEngine::fctEat() {
 			
 			g_jh += h;
 			g_crep = 135;
-			tinke();
+			prepareRoom();
 		} else {
 			g_crep = 134;
 		}
@@ -1128,16 +1128,16 @@ void MortevielleEngine::fctEat() {
  * @remarks	Originally called 'tentrer'
  */
 void MortevielleEngine::fctEnter() {
-	if ((g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) {
+	if ((_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) {
 		gotoDiningRoom();
-		_menu.setDestinationMenuText(g_s._currPlace);
-	} else if (g_s._currPlace == LANDING)
+		_menu.setDestinationMenuText(_coreVar._currPlace);
+	} else if (_coreVar._currPlace == LANDING)
 		showMoveMenuAlert();
 	else if (g_ment == 0)
 		g_crep = 997;
-	else if ((g_ment == 9) && (g_s._selectedObjectId != 136)) {
+	else if ((g_ment == 9) && (_coreVar._selectedObjectId != 136)) {
 			g_crep = 189;
-			g_s._teauto[8] = '*';
+			_coreVar._teauto[8] = '*';
 	} else {
 		int z = 0;
 		if (!_blo)
@@ -1151,8 +1151,8 @@ void MortevielleEngine::fctEnter() {
 				aniof(1, 1);
 				
 				g_x = convertBitIndexToCharacterIndex(z);
-				++g_s._faithScore;
-				g_s._currPlace = LANDING;
+				++_coreVar._faithScore;
+				_coreVar._currPlace = LANDING;
 				g_msg[3] = MENU_DISCUSS;
 				g_msg[4] = _menu._discussMenu[g_x];
 				_syn = true;
@@ -1171,10 +1171,10 @@ void MortevielleEngine::fctEnter() {
 			_speechManager.startSpeech(7, g_x, 1);
 			aniof(1, 1);
 			
-			g_s._currPlace = g_ment;
+			_coreVar._currPlace = g_ment;
 			affrep();
-			debloc(g_s._currPlace);
-			_menu.setDestinationMenuText(g_s._currPlace);
+			debloc(_coreVar._currPlace);
+			_menu.setDestinationMenuText(_coreVar._currPlace);
 			g_ment = 0;
 			g_mpers = 0;
 			_currBitIndex = 0;
@@ -1189,17 +1189,17 @@ void MortevielleEngine::fctEnter() {
 void MortevielleEngine::fctSleep() {
 	int z, j, h, m;
 
-	if ((g_s._currPlace > LANDING) && (g_s._currPlace < ROOM26)) {
+	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
 		g_crep = 148;
 		return;
 	}
-	if (g_s._currPlace != OWN_ROOM) {
+	if (_coreVar._currPlace != OWN_ROOM) {
 		tsort();
-		g_s._currPlace = OWN_ROOM;
+		_coreVar._currPlace = OWN_ROOM;
 		affrep();
 		afdes();
-		debloc(g_s._currPlace);
-		_menu.setDestinationMenuText(g_s._currPlace);
+		debloc(_coreVar._currPlace);
+		_menu.setDestinationMenuText(_coreVar._currPlace);
 	}
 	clearScreenType3();
 	clearScreenType2();
@@ -1210,7 +1210,7 @@ void MortevielleEngine::fctSleep() {
 	int answer;
 	do {
 		if (h < 8) {
-			g_s._faithScore -= (g_s._faithScore / 20);
+			_coreVar._faithScore -= (_coreVar._faithScore / 20);
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
@@ -1221,7 +1221,7 @@ void MortevielleEngine::fctSleep() {
 		++h;
 		if (h > 23)
 			h = 0;
-		tinke();
+		prepareRoom();
 		answer = Alert::show(getEngineString(S_YES_NO), 1);
 		_anyone = false;
 	} while (answer != 1);
@@ -1240,11 +1240,11 @@ void MortevielleEngine::fctForce() {
 		tfleche();
 
 	if ((!_anyone) && (!_keyPressedEsc)) {
-		if (g_s._currPlace != ROOM26)
+		if (_coreVar._currPlace != ROOM26)
 			g_crep = 997;
 		else {
 			g_crep = 143;
-			g_s._faithScore += 2;
+			_coreVar._faithScore += 2;
 		}
 	}
 }
@@ -1256,27 +1256,27 @@ void MortevielleEngine::fctForce() {
 void MortevielleEngine::fctLeave() {
 	tsort();
 	g_crep = 0;
-	if ((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK) || (g_s._currPlace == WELL))
+	if ((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK) || (_coreVar._currPlace == WELL))
 		g_crep = 997;
 	else {
 		int nextPlace = OWN_ROOM;
 
-		if ((g_s._currPlace < CRYPT) || (g_s._currPlace == ROOM26))
+		if ((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace == ROOM26))
 			nextPlace = DINING_ROOM;
-		else if ((g_s._currPlace == DINING_ROOM) || (g_s._currPlace == CHAPEL))
+		else if ((_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == CHAPEL))
 			nextPlace = MANOR_FRONT;
-		else if ((g_s._currPlace < DINING_ROOM) || (g_s._currPlace == ATTIC))
+		else if ((_coreVar._currPlace < DINING_ROOM) || (_coreVar._currPlace == ATTIC))
 			nextPlace = LANDING;
-		else if (g_s._currPlace == CRYPT) {
+		else if (_coreVar._currPlace == CRYPT) {
 			nextPlace = SECRET_PASSAGE;
 			g_crep = 176;
-		} else if (g_s._currPlace == SECRET_PASSAGE)
+		} else if (_coreVar._currPlace == SECRET_PASSAGE)
 			nextPlace = t23coul();
-		else if (g_s._currPlace == INSIDE_WELL)
+		else if (_coreVar._currPlace == INSIDE_WELL)
 			nextPlace = WELL;
 
 		if (g_crep != 997)
-			g_s._currPlace = nextPlace;
+			_coreVar._currPlace = nextPlace;
 
 		g_caff = nextPlace;
 		if (g_crep == 0)
@@ -1297,18 +1297,18 @@ void MortevielleEngine::fctWait() {
 	int answer;
 	do {
 		++g_jh;
-		tinke();
+		prepareRoom();
 		if (!_blo)
-			t11(g_s._currPlace);
+			t11(_coreVar._currPlace);
 		if ((_currBitIndex != 0) && (g_mpers == 0)) {
 			g_crep = 998;
-			if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
+			if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR))
 				cavegre();
-			if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
+			if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
 				_anyone = true;
 			g_mpers = _currBitIndex;
 			if (!_anyone)
-				tinke();
+				prepareRoom();
 			return;
 		}
 		repon(2, 102);
@@ -1316,7 +1316,7 @@ void MortevielleEngine::fctWait() {
 	} while (answer != 2);
 	g_crep = 998;
 	if (!_anyone)
-		tinke();
+		prepareRoom();
 }
 
 /**
@@ -1383,7 +1383,7 @@ void MortevielleEngine::fctDiscuss() {
 		do {
 			++icm;
 			_screenSurface.putxy(co, lig);
-			if (g_s._teauto[icm] == '*') {
+			if (_coreVar._teauto[icm] == '*') {
 				if (te[icm])
 					writetp(lib[icm], 1);
 				else
@@ -1443,7 +1443,7 @@ void MortevielleEngine::fctDiscuss() {
 							writetp(lib[choi], 1);
 						te[choi] = ! te[choi];
 					}
-					if ((g_s._teauto[ix] == '*') || (ix == 46)) {
+					if ((_coreVar._teauto[ix] == '*') || (ix == 46)) {
 						lig = ((ix - 1) % 23) << 3;
 						if (ix > 23)
 							co = 320;
@@ -1466,7 +1466,7 @@ void MortevielleEngine::fctDiscuss() {
 			int ix = choi - 1;
 			if (_col) {
 				_col = false;
-				g_s._currPlace = 15;
+				_coreVar._currPlace = 15;
 				if (g_iouv > 0)
 					max = 8;
 				else
@@ -1475,14 +1475,14 @@ void MortevielleEngine::fctDiscuss() {
 					suj = 129;
 				else {
 					suj = 138;
-					g_s._faithScore += (3 * (g_s._faithScore / 10));
+					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
 			} else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) {
 				suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)];
-				g_s._faithScore += g_tabdon[arcf + ix];
+				_coreVar._faithScore += g_tabdon[arcf + ix];
 				++g_nbrep[g_caff - 69];
 			} else {
-				g_s._faithScore += 3;
+				_coreVar._faithScore += 3;
 				suj = 139;
 			}
 			_mouse.hideMouse();
@@ -1491,17 +1491,17 @@ void MortevielleEngine::fctDiscuss() {
 			startDialog(suj);
 			_mouse.showMouse();
 			if ((suj == 84) || (suj == 86)) {
-				g_s._pourc[5] = '*';
-				g_s._teauto[7] = '*';
+				_coreVar._pourc[5] = '*';
+				_coreVar._teauto[7] = '*';
 			}
 			if ((suj == 106) || (suj == 108) || (suj == 94)) {
 				for (int indx = 29; indx <= 31; ++indx)
-					g_s._teauto[indx] = '*';
-				g_s._pourc[7] = '*';
+					_coreVar._teauto[indx] = '*';
+				_coreVar._pourc[7] = '*';
 			}
 			if (suj == 70) {
-				g_s._pourc[8] = '*';
-				g_s._teauto[32] = '*';
+				_coreVar._pourc[8] = '*';
+				_coreVar._teauto[32] = '*';
 			}
 			_mouse.hideMouse();
 			hirs();
@@ -1509,14 +1509,14 @@ void MortevielleEngine::fctDiscuss() {
 		}
 	} while ((choi != 46) && (suj != 138));
 	if (_col) {
-		g_s._faithScore += (3 * (g_s._faithScore / 10));
+		_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 		_mouse.hideMouse();
 		hirs();
 		premtet();
 		startDialog(138);
 		_mouse.showMouse();
 		_col = false;
-		g_s._currPlace = LANDING;
+		_coreVar._currPlace = LANDING;
 	}
 	g_ctrm = 0;
 	_mouse.hideMouse();
@@ -1524,11 +1524,11 @@ void MortevielleEngine::fctDiscuss() {
 	drawRightFrame();
 	_mouse.showMouse();
 	showPeoplePresent(_currBitIndex);
-	tinke();
+	prepareRoom();
 	drawClock();
 	affrep();
 	/* chech;*/
-	_menu.setDestinationMenuText(g_s._currPlace);
+	_menu.setDestinationMenuText(_coreVar._currPlace);
 	clearScreenType3();
 }
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 137ff46..1d8a105 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -196,7 +196,7 @@ void Menu::displayMenu() {
 			do {   // One line after the other
 				msk = 0x80;
 				for (pt = 0; pt <= 7; ++pt) {
-					if ((g_lettres[num_letr - 1][ind_tabl] & msk) != 0) {
+					if ((_charArr[num_letr - 1][ind_tabl] & msk) != 0) {
 						g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
 						g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
 						g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
@@ -505,7 +505,7 @@ void Menu::initMenu() {
 			if (!f.open("menu.mor"))
 				error("Missing file - menufr.mor or menual.mor or menu.mor");
 
-	f.read(g_lettres, 7 * 24);
+	f.read(_charArr, 7 * 24);
 	f.close();
 
 	// Skipped: dialog asking to swap floppy
@@ -567,7 +567,7 @@ void Menu::setSearchMenu() {
  * @remarks	Originally called 'mfouen'
  */
 void Menu::unsetSearchMenu() {
-	setDestinationMenuText(g_vm->g_s._currPlace);
+	setDestinationMenuText(g_vm->_coreVar._currPlace);
 	for (int i = 1; i <= 11; ++i)
 		enableMenuItem(_actionMenu[i]);
 
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 7f224a3..b600d4e 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -40,6 +40,8 @@ enum {
 
 class Menu {
 private:
+	byte _charArr[7][24];
+
 	void util(Common::Point pos);
 	void invert(int indx);
 	void menuDown(int ii);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index e1206be..ca01e01 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -95,18 +95,6 @@ int animof(int ouf, int num) {
 	return animof_result;
 }
 
-/**
- * Read the current system time
- */
-int readclock() {
-	TimeDate dateTime;
-	g_system->getTimeAndDate(dateTime);
-
-	int m = dateTime.tm_min * 60;
-	int h = dateTime.tm_hour * 3600;
-	return h + m + dateTime.tm_sec;
-}
-
 void modif(int &nu) {
 	if (nu == 26)
 		nu = 25;
@@ -245,12 +233,12 @@ void repon(int f, int m) {
 			g_vm->prepareScreenType2();
 			text1(8, 182, 103, m);
 			if ((m == 68) || (m == 69))
-				g_vm->g_s._teauto[40] = '*';
+				g_vm->_coreVar._teauto[40] = '*';
 			if ((m == 104) && (g_caff == 14)) {
-				g_vm->g_s._teauto[36] = '*';
-				if (g_vm->g_s._teauto[39] == '*') {
-					g_vm->g_s._pourc[3] = '*';
-					g_vm->g_s._teauto[38] = '*';
+				g_vm->_coreVar._teauto[36] = '*';
+				if (g_vm->_coreVar._teauto[39] == '*') {
+					g_vm->_coreVar._pourc[3] = '*';
+					g_vm->_coreVar._teauto[38] = '*';
 				}
 			}
 			break;
@@ -267,9 +255,9 @@ void repon(int f, int m) {
 			displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
-				g_vm->g_s._pourc[6] = '*';
+				g_vm->_coreVar._pourc[6] = '*';
 			else if (m == 179)
-				g_vm->g_s._pourc[10] = '*';
+				g_vm->_coreVar._pourc[10] = '*';
 			}
 			break;
 		default:
@@ -286,57 +274,6 @@ int chlm() {
 	return retval;
 }
 
-/**
- * Engine function - Draw Clock
- * @remarks	Originally called 'pendule'
- */
-void drawClock() {
-	const int cv[2][12] = {
-		{  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
-		{ -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
-	};
-	const int x = 580;
-	const int y = 123;
-	const int rg = 9;
-	int h, co;
-
-	g_vm->_mouse.hideMouse();
-	
-	paint_rect(570, 118, 20, 10);
-	paint_rect(578, 114, 6, 18);
-	if ((g_vm->_currGraphicalDevice == MODE_CGA) || (g_vm->_currGraphicalDevice == MODE_HERCULES))
-		co = 0;
-	else
-		co = 1;
-
-	if (g_vm->_minute == 0)
-		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
-	else 
-		g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
-
-	h = g_vm->_hour;
-	if (h > 12)
-		h -= 12;
-	if (h == 0)
-		h = 12;
-
-	g_vm->_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
-	g_vm->_mouse.showMouse();
-	g_vm->_screenSurface.putxy(568, 154);
-
-	if (g_vm->_hour > 11)
-		g_vm->_screenSurface.drawString("PM ", 1);
-	else
-		g_vm->_screenSurface.drawString("AM ", 1);
-
-	g_vm->_screenSurface.putxy(550, 160);
-	if ((g_vm->_day >= 0) && (g_vm->_day <= 8)) {
-		Common::String tmp = g_vm->getEngineString(S_DAY);
-		tmp.insertChar((char)(g_vm->_day + 49), 0);
-		g_vm->_screenSurface.drawString(tmp, 1);
-	}
-}
-
 /*************
  * NIVEAU 11 *
  *************/
@@ -426,7 +363,7 @@ int t11(int roomId) {
 	int retVal = 0;
 	int p, rand;
 
-	ecfren(p, rand, g_vm->g_s._faithScore, roomId);
+	ecfren(p, rand, g_vm->_coreVar._faithScore, roomId);
 	g_vm->_place = roomId;
 	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
@@ -458,7 +395,7 @@ int t11(int roomId) {
 				p = g_vm->getPresenceStatsLanding();
 			else if (roomId == CHAPEL)
 				p = g_vm->getPresenceStatsChapel(h);
-			p += g_vm->g_s._faithScore;
+			p += g_vm->_coreVar._faithScore;
 			rand = g_vm->getRandomNumber(1, 100);
 			if (rand > p) {
 				g_vm->displayAloneText();
@@ -483,9 +420,9 @@ int t11(int roomId) {
 }
 
 void cavegre() {
-	g_vm->g_s._faithScore += 2;
-	if (g_vm->g_s._faithScore > 69)
-		g_vm->g_s._faithScore += (g_vm->g_s._faithScore / 10);
+	g_vm->_coreVar._faithScore += 2;
+	if (g_vm->_coreVar._faithScore > 69)
+		g_vm->_coreVar._faithScore += (g_vm->_coreVar._faithScore / 10);
 	g_vm->clearScreenType3();
 	g_vm->prepareScreenType2();
 	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
@@ -551,16 +488,16 @@ void dessin(int ad) {
 				}
 
 				if (g_caff == 13) {
-					if (g_vm->g_s._atticBallHoleObjectId == 141)
+					if (g_vm->_coreVar._atticBallHoleObjectId == 141)
 						aniof(1, 7);
 
-					if (g_vm->g_s._atticRodHoleObjectId == 159)
+					if (g_vm->_coreVar._atticRodHoleObjectId == 159)
 						aniof(1, 6);
-				} else if ((g_caff == 14) && (g_vm->g_s._cellarObjectId == 151))
+				} else if ((g_caff == 14) && (g_vm->_coreVar._cellarObjectId == 151))
 					aniof(1, 2);
-				else if ((g_caff == 17) && (g_vm->g_s._secretPassageObjectId == 143))
+				else if ((g_caff == 17) && (g_vm->_coreVar._secretPassageObjectId == 143))
 					aniof(1, 1);
-				else if ((g_caff == 24) && (g_vm->g_s._wellObjectId != 0))
+				else if ((g_caff == 24) && (g_vm->_coreVar._wellObjectId != 0))
 					aniof(1, 1);
 			}
 			
@@ -570,157 +507,6 @@ void dessin(int ad) {
 	}
 }
 
-void tinke() {
-	Common::String d1 = g_vm->getEngineString(S_SHOULD_HAVE_NOTICED);
-	Common::String d2 = g_vm->getEngineString(S_NUMBER_OF_HINTS);
-	const char d3 = '[';
-	const char d4 = ']';
-	const char d5 = '1';
-	Common::String d6 = g_vm->getEngineString(S_OK);
-	int cf, day, hour, minute;
-	Common::String stpo;
-
-	g_vm->_anyone = false;
-	g_vm->updateHour(day, hour, minute);
-	if (day != g_vm->_day) {
-		g_vm->_day = day;
-		int i = 0;
-		do {
-			++i;
-			if (g_nbrepm[i] != 0)
-				--g_nbrepm[i];
-			g_nbrep[i] = 0;
-		} while (i != 8);
-	}
-	if ((hour > g_vm->_hour) || ((hour == 0) && (g_vm->_hour == 23))) {
-		g_vm->_hour = hour;
-		g_vm->_minute = 0;
-		drawClock();
-		cf = 0;
-		for (int i = 1; i <= 10; ++i) {
-			if (g_vm->g_s._pourc[i] == '*')
-				++cf;
-		}
-
-		if (cf == 10)
-			stpo = "10";
-		else
-			stpo = chr(cf + 48);
-
-		g_vm->_hintPctMessage = Common::String(d3);
-		g_vm->_hintPctMessage += d5;
-		g_vm->_hintPctMessage += d4;
-		g_vm->_hintPctMessage += d3;
-		g_vm->_hintPctMessage += d1;
-		g_vm->_hintPctMessage += stpo;
-		g_vm->_hintPctMessage += '0';
-		g_vm->_hintPctMessage += d2;
-		g_vm->_hintPctMessage += d4;
-		g_vm->_hintPctMessage += d3;
-		g_vm->_hintPctMessage += d6;
-		g_vm->_hintPctMessage += d4;
-	}
-	if (minute > g_vm->_minute) {
-		g_vm->_minute = 30;
-		drawClock();
-	}
-	if (g_vm->_mouse._pos.y < 12)
-		return;
-
-	if (!g_vm->_blo) {
-		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			g_t = kTime2;
-		else
-			g_t = kTime1;
-		cf = g_vm->g_s._faithScore;
-		if ((cf > 33) && (cf < 66))
-			g_t -= (g_t / 3);
-
-		if (cf > 65)
-			g_t -= ((g_t / 3) * 2);
-
-		int nh = readclock();
-		if ((nh - g_mh) > g_t) {
-			bool activeMenu = g_vm->_menu._menuActive;
-			g_vm->_menu.eraseMenu();
-			g_jh += ((nh - g_mh) / g_t);
-			g_mh = nh;
-			switch (g_vm->_place) {
-			case GREEN_ROOM:
-			case DARKBLUE_ROOM:
-				g_vm->setRandomPresenceGreenRoom(cf);
-				break;
-			case PURPLE_ROOM:
-				g_vm->setRandomPresencePurpleRoom(cf);
-				break;
-			case BLUE_ROOM:
-				g_vm->setRandomPresenceBlueRoom(cf);
-				break;
-			case RED_ROOM:
-			case GREEN_ROOM2:
-				g_vm->setRandomPresenceRedRoom(cf);
-				break;
-			case ROOM9:
-				g_vm->setRandomPresenceRoom9(cf);
-				break;
-			case DINING_ROOM:
-				g_vm->setRandomPresenceDiningRoom(cf);
-				break;
-			case BUREAU:
-				g_vm->setRandomPresenceBureau(cf);
-				break;
-			case KITCHEN:
-				g_vm->setRandomPresenceKitchen(cf);
-				break;
-			case ATTIC:
-			case CELLAR:
-				g_vm->setRandomPresenceAttic(cf);
-				break;
-			case LANDING:
-			case ROOM26:
-				g_vm->setRandomPresenceLanding(cf);
-				break;
-			case CHAPEL:
-				g_vm->setRandomPresenceChapel(cf);
-				break;
-			}
-			if ((g_mpers != 0) && (g_vm->_currBitIndex != 10))
-				g_mpers = g_vm->_currBitIndex;
-
-			if ((g_mpers == 0) && (g_vm->_currBitIndex > 0)) {
-				if ((g_vm->g_s._currPlace == ATTIC) || (g_vm->g_s._currPlace == CELLAR)) {
-					cavegre();
-				} else if (g_vm->_currBitIndex == 10) {
-					g_vm->_currBitIndex = 0;
-					if (!g_vm->_brt) {
-						g_vm->_brt = true;
-						g_hdb = readclock();
-						if (g_vm->getRandomNumber(1, 5) < 5) {
-							g_vm->clearScreenType3();
-							g_vm->prepareScreenType2();
-							ecr3(g_vm->getEngineString(S_HEAR_NOISE));
-							int rand = (g_vm->getRandomNumber(0, 4)) - 2;
-							g_vm->_speechManager.startSpeech(1, rand, 1);
-							g_vm->clearScreenType3();
-						}
-					}
-				}
-			}
-
-			if (activeMenu)
-				g_vm->_menu.drawMenu();
-		}
-	}
-	g_hfb = readclock();
-	if ((g_vm->_brt) && ((g_hfb - g_hdb) > 17)) {
-		g_vm->getPresenceBitIndex(g_vm->_place);
-		g_vm->_brt = false;
-		g_hdb = 0;
-		if ((g_vm->g_s._currPlace > OWN_ROOM) && (g_vm->g_s._currPlace < DINING_ROOM))
-			g_vm->_anyone = true;
-	}
-}
-
 void fenat(char ans) {
 	int coul;
 
@@ -763,7 +549,7 @@ void tkey1(bool d) {
 	// Event loop
 	do {
 		if (d)
-			tinke();
+			g_vm->prepareRoom();
 		quest = g_vm->keyPressed();
 		g_vm->_mouse.getMousePosition(x, y, c);
 		CHECK_QUIT;
@@ -787,17 +573,17 @@ void tlu(int af, int ob) {
 }
 
 void affrep() {
-	g_caff = g_vm->g_s._currPlace;
-	g_crep = g_vm->g_s._currPlace;
+	g_caff = g_vm->_coreVar._currPlace;
+	g_crep = g_vm->_coreVar._currPlace;
 }
 
 void tsort() {
 
-	if ((g_iouv > 0) && (g_vm->g_s._currPlace != 0)) {
-		if (g_vm->g_s._faithScore < 50)
-			g_vm->g_s._faithScore += 2;
+	if ((g_iouv > 0) && (g_vm->_coreVar._currPlace != 0)) {
+		if (g_vm->_coreVar._faithScore < 50)
+			g_vm->_coreVar._faithScore += 2;
 		else
-			g_vm->g_s._faithScore += (g_vm->g_s._faithScore / 10);
+			g_vm->_coreVar._faithScore += (g_vm->_coreVar._faithScore / 10);
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
@@ -805,7 +591,7 @@ void tsort() {
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
-	debloc(g_vm->g_s._currPlace);
+	debloc(g_vm->_coreVar._currPlace);
 }
 
 void st4(int ob) {
@@ -844,9 +630,9 @@ void modinv() {
 
 	int cy = 0;
 	for (int i = 1; i <= 6; ++i) {
-		if (g_vm->g_s._sjer[i] != chr(0)) {
+		if (g_vm->_coreVar._sjer[i] != chr(0)) {
 			++cy;
-			r = (ord(g_vm->g_s._sjer[i]) + 400);
+			r = (ord(g_vm->_coreVar._sjer[i]) + 400);
 			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
 			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
 			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[i]);
@@ -879,7 +665,7 @@ void ajchai() {
 	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
 
 	if (g_tabdon[cy + cx] == 0)
-		g_tabdon[cy + cx] = g_vm->g_s._selectedObjectId;
+		g_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
 	else
 		g_crep = 192;
 }
@@ -888,10 +674,10 @@ void ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 5) && (ord(g_vm->g_s._sjer[cx]) != 0));
+	} while ((cx <= 5) && (ord(g_vm->_coreVar._sjer[cx]) != 0));
 
-	if (ord(g_vm->g_s._sjer[cx]) == 0) {
-		g_vm->g_s._sjer[(cx)] = chr(ob);
+	if (ord(g_vm->_coreVar._sjer[cx]) == 0) {
+		g_vm->_coreVar._sjer[(cx)] = chr(ob);
 		modinv();
 	} else
 		g_crep = 139;
@@ -920,11 +706,11 @@ L1:
 			g_vm->_speechManager.startSpeech(4, 4, 1);
 
 		if (g_iouv == 0)
-			g_vm->g_s._faithScore += 2;
-		else if (g_vm->g_s._faithScore < 50)
-			g_vm->g_s._faithScore += 4;
+			g_vm->_coreVar._faithScore += 2;
+		else if (g_vm->_coreVar._faithScore < 50)
+			g_vm->_coreVar._faithScore += 4;
 		else
-			g_vm->g_s._faithScore += 3 * (g_vm->g_s._faithScore / 10);
+			g_vm->_coreVar._faithScore += 3 * (g_vm->_coreVar._faithScore / 10);
 		tsort();
 		g_vm->_menu.setDestinationMenuText(LANDING);
 		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
@@ -971,7 +757,7 @@ void tsuiv() {
 		g_caff = tbcl;
 		g_crep = g_caff + 400;
 		if (g_vm->_currBitIndex != 0)
-			g_vm->g_s._faithScore += 2;
+			g_vm->_coreVar._faithScore += 2;
 	} else {
 		affrep();
 		g_vm->endSearch();
@@ -998,7 +784,7 @@ void tfleche() {
 
 			if (g_vm->getMouseClick())
 				inRect = (g_vm->_mouse._pos.x < 256 * g_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
-			tinke();
+			g_vm->prepareRoom();
 		} while (!(qust || inRect || g_vm->_anyone));
 
 		if (qust && (touch == '\103'))
@@ -1112,20 +898,20 @@ void treg(int ob) {
 
 void avpoing(int &ob) {
 	g_crep = 999;
-	if (g_vm->g_s._selectedObjectId != 0)
-		ajjer(g_vm->g_s._selectedObjectId);
+	if (g_vm->_coreVar._selectedObjectId != 0)
+		ajjer(g_vm->_coreVar._selectedObjectId);
 
 	if (g_crep != 139) {
 		modobj(ob + 400);
-		g_vm->g_s._selectedObjectId = ob;
+		g_vm->_coreVar._selectedObjectId = ob;
 		ob = 0;
 	}
 }
 
 void rechai(int &ch) {
-	int tmpPlace = g_vm->g_s._currPlace;
+	int tmpPlace = g_vm->_coreVar._currPlace;
 
-	if (g_vm->g_s._currPlace == CRYPT)
+	if (g_vm->_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
 	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
 }
@@ -1140,7 +926,7 @@ int t23coul() {
 }
 
 void maivid() {
-	g_vm->g_s._selectedObjectId = 0;
+	g_vm->_coreVar._selectedObjectId = 0;
 	modobj(500);
 }
 
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index de1b0b4..03a4c0f 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -48,7 +48,6 @@ extern void charecr(int y, int dy);
 extern void adzon();
 extern int animof(int ouf, int num);
 /* Niveau 14 suite */
-extern int readclock();
 extern void modif(int &nu);
 /* NIVEAU 13 */
 extern void text1(int x, int y, int nb, int m);
@@ -77,8 +76,6 @@ extern void writetp(Common::String s, int t);
 extern void aniof(int ouf, int num);
 /* NIVEAU 9 */
 extern void dessin(int ad);
-
-extern void tinke();
 extern void fenat(char ans);
 /* NIVEAU 8 */
 extern void afdes();
@@ -89,7 +86,6 @@ extern void affrep();
 /* NIVEAU 6 */
 extern void tsort();
 extern void st4(int ob);
-extern void displayDiningRoom();
 extern void modinv();
 extern void mennor();
 extern void premtet();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 866c8e4..907e305 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -625,10 +625,10 @@ void MortevielleEngine::handleAction() {
 		_inMainGameLoop = true;
 		do {
 			_menu.mdn();
-			tinke();
+			prepareRoom();
 			_mouse.moveMouse(funct, inkey);
 			CHECK_QUIT;
-			temps = temps + 1;
+			++temps;
 		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
 		_inMainGameLoop = false;
 
@@ -682,7 +682,7 @@ void MortevielleEngine::handleAction() {
 						oo = true;
 						if ((g_msg[4] == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
-							g_caff = g_s._currPlace;
+							g_caff = _coreVar._currPlace;
 							g_crep = 998;
 						} else
 							tsuiv();
@@ -1432,7 +1432,7 @@ int MortevielleEngine::getPresenceBitIndex(int roomId) {
 void MortevielleEngine::initGame() {
 	_place = MANOR_FRONT;
 	g_jh = 0;
-	if (!g_s._alreadyEnteredManor)
+	if (!_coreVar._alreadyEnteredManor)
 		_blo = true;
 	g_t = kTime1;
 	g_mh = readclock();
@@ -1625,21 +1625,21 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
+	} else if ((g_prebru == 0) && (!_coreVar._alreadyEnteredManor)) {
 		// Type 1: Speech
 		_speechManager.startSpeech(10, 1, 1);
 		++g_prebru;
 	} else {
-		if (((g_s._currPlace == MOUNTAIN) || (g_s._currPlace == MANOR_FRONT) || (g_s._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
+		if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
 			// Type 1: Speech
 			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
-		else if ((g_s._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
+		else if ((_coreVar._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
 			// Type 1: Speech
 			_speechManager.startSpeech(8, 1, 1);
-		else if ((g_s._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
+		else if ((_coreVar._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
 			// Type 1: Speech
 			_speechManager.startSpeech(12, 1, 1);
-		else if (g_s._currPlace == INSIDE_WELL)
+		else if (_coreVar._currPlace == INSIDE_WELL)
 			// Type 1: Speech
 			_speechManager.startSpeech(13, 1, 1);
 		else
@@ -1679,9 +1679,9 @@ void MortevielleEngine::loseGame() {
 bool MortevielleEngine::checkInventory(int objectId) {
 	bool retVal = false;
 	for (int i = 1; i <= 6; ++i)
-		retVal = (retVal || (ord(g_s._sjer[i]) == objectId));
+		retVal = (retVal || (ord(_coreVar._sjer[i]) == objectId));
 
-	if (g_s._selectedObjectId == objectId)
+	if (_coreVar._selectedObjectId == objectId)
 		retVal = true;
 
 	return retVal;
@@ -1692,7 +1692,7 @@ bool MortevielleEngine::checkInventory(int objectId) {
  * @remarks	Originally called 'st1sama'
  */
 void MortevielleEngine::displayDiningRoom() {
-	g_s._currPlace = DINING_ROOM;
+	_coreVar._currPlace = DINING_ROOM;
 	affrep();
 }
 
@@ -1741,13 +1741,13 @@ void MortevielleEngine::gotoDiningRoom() {
 	int day, hour, minute;
 
 	updateHour(day, hour, minute);
-	if ((hour < 5) && (g_s._currPlace > ROOM18)) {
+	if ((hour < 5) && (_coreVar._currPlace > ROOM18)) {
 		if (!checkInventory(137)) {        //You don't have the keys, and it's late
 			g_crep = 1511;
 			loseGame();
 		} else
 			displayDiningRoom();
-	} else if (!g_s._alreadyEnteredManor) {     //Is it your first time?
+	} else if (!_coreVar._alreadyEnteredManor) {     //Is it your first time?
 		_currBitIndex = 255; // Everybody is present
 		showPeoplePresent(_currBitIndex);
 		g_caff = 77;
@@ -1763,14 +1763,14 @@ void MortevielleEngine::gotoDiningRoom() {
 		drawRightFrame();
 		drawClock();
 		_mouse.showMouse();
-		g_s._currPlace = OWN_ROOM;
+		_coreVar._currPlace = OWN_ROOM;
 		affrep();
 		resetPresenceInRooms(DINING_ROOM);
 		if (!_blo)
 			minute = t11(OWN_ROOM);
 		_currBitIndex = 0;
 		g_mpers = 0;
-		g_s._alreadyEnteredManor = true;
+		_coreVar._alreadyEnteredManor = true;
 	} else
 		displayDiningRoom();
 }
@@ -1786,7 +1786,7 @@ void MortevielleEngine::checkManorDistance() {
 		loseGame();
 	} else {
 		_okdes = true;
-		g_s._currPlace = MOUNTAIN;
+		_coreVar._currPlace = MOUNTAIN;
 		affrep();
 	}
 }
@@ -1797,7 +1797,7 @@ void MortevielleEngine::checkManorDistance() {
  */
 void MortevielleEngine::gotoManorFront() {
 	_manorDistance = 0;
-	g_s._currPlace = MANOR_FRONT;
+	_coreVar._currPlace = MANOR_FRONT;
 	affrep();
 }
 
@@ -1806,7 +1806,7 @@ void MortevielleEngine::gotoManorFront() {
  * @remarks	Originally called 't1derr'
  */
 void MortevielleEngine::gotoManorBack() {
-	g_s._currPlace = MANOR_BACK;
+	_coreVar._currPlace = MANOR_BACK;
 	affrep();
 }
 
@@ -1830,7 +1830,7 @@ void MortevielleEngine::changeGraphicalDevice(int newDevice) {
 	_mouse.initMouse();
 	_mouse.showMouse();
 	drawRightFrame();
-	tinke();
+	prepareRoom();
 	drawClock();
 	if (_currBitIndex != 0)
 		showPeoplePresent(_currBitIndex);
@@ -1884,16 +1884,16 @@ void MortevielleEngine::gameLoaded() {
 	_heroSearching = false;
 
 	displayAloneText();
-	tinke();
+	prepareRoom();
 	drawClock();
 	afdes();
 	repon(2, g_crep);
 	clearScreenType3();
 	_endGame = false;
-	_menu.setDestinationMenuText(g_s._currPlace);
+	_menu.setDestinationMenuText(_coreVar._currPlace);
 	modinv();
-	if (g_s._selectedObjectId != 0)
-		modobj(g_s._selectedObjectId + 400);
+	if (_coreVar._selectedObjectId != 0)
+		modobj(_coreVar._selectedObjectId + 400);
 	_mouse.showMouse();
 }
 
@@ -1984,16 +1984,16 @@ void MortevielleEngine::handleOpcode() {
 	}
 	int hour, day, minute;
 	updateHour(day, hour, minute);
-	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
-	        ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
-		++g_s._faithScore;
-	if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != INSIDE_WELL)
-	        && (g_s._currPlace != OWN_ROOM) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
-		if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (_coreVar._currPlace != 10)) ||
+	        ((hour > 0) && (hour < 6) && (_coreVar._currPlace != 0)))
+		++_coreVar._faithScore;
+	if (((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace > MOUNTAIN)) && (_coreVar._currPlace != INSIDE_WELL)
+	        && (_coreVar._currPlace != OWN_ROOM) && (_coreVar._selectedObjectId != 152) && (!_loseGame)) {
+		if ((_coreVar._faithScore > 99) && (hour > 8) && (hour < 16)) {
 			g_crep = 1501;
 			loseGame();
 		}
-		if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
+		if ((_coreVar._faithScore > 99) && (hour > 0) && (hour < 9)) {
 			g_crep = 1508;
 			loseGame();
 		}
@@ -2017,7 +2017,7 @@ void MortevielleEngine::hourToChar() {
 		minute = 1;
 	hour += day * 24;
 	minute += hour * 2;
-	g_s._fullHour = chr(minute);
+	_coreVar._fullHour = chr(minute);
 }
 
 /**
@@ -2025,7 +2025,7 @@ void MortevielleEngine::hourToChar() {
  * @remarks	Originally called 'theure'
  */
 void MortevielleEngine::charToHour() {
-	int fullHour = ord(g_s._fullHour);
+	int fullHour = ord(_coreVar._fullHour);
 	int tmpHour = fullHour % 48;
 	_currDay = fullHour / 48;
 	_currHalfHour = tmpHour % 2;
@@ -2092,11 +2092,11 @@ void MortevielleEngine::clearScreenType10() {
 		cod = 544;
 	}
 	_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
-	if (g_s._faithScore < 33)
+	if (_coreVar._faithScore < 33)
 		st = getEngineString(S_COOL);
-	else if (g_s._faithScore < 66)
+	else if (_coreVar._faithScore < 66)
 		st = getEngineString(S_LOURDE);
-	else if (g_s._faithScore > 65)
+	else if (_coreVar._faithScore > 65)
 		st = getEngineString(S_MALSAINE);
 	
 	co = 580 - (_screenSurface.getStringWidth(st) / 2);
@@ -2252,40 +2252,40 @@ void MortevielleEngine::copcha() {
 void MortevielleEngine::resetVariables() {
 	copcha();
 
-	g_s._alreadyEnteredManor = false;
-	g_s._selectedObjectId = 0;
-	g_s._cellarObjectId = 0;
-	g_s._atticBallHoleObjectId = 0;
-	g_s._atticRodHoleObjectId = 0;
-	g_s._wellObjectId = 0;
-	g_s._secretPassageObjectId = 0;
-	g_s._purpleRoomObjectId = 136;
-	g_s._cryptObjectId = 141;
-	g_s._faithScore = getRandomNumber(4, 10);
-	g_s._currPlace = MANOR_FRONT;
+	_coreVar._alreadyEnteredManor = false;
+	_coreVar._selectedObjectId = 0;
+	_coreVar._cellarObjectId = 0;
+	_coreVar._atticBallHoleObjectId = 0;
+	_coreVar._atticRodHoleObjectId = 0;
+	_coreVar._wellObjectId = 0;
+	_coreVar._secretPassageObjectId = 0;
+	_coreVar._purpleRoomObjectId = 136;
+	_coreVar._cryptObjectId = 141;
+	_coreVar._faithScore = getRandomNumber(4, 10);
+	_coreVar._currPlace = MANOR_FRONT;
 
 	for (int i = 2; i <= 6; ++i)
-		g_s._sjer[i] = chr(0);
+		_coreVar._sjer[i] = chr(0);
 
-	g_s._sjer[1] = chr(113);
-	g_s._fullHour = chr(20);
+	_coreVar._sjer[1] = chr(113);
+	_coreVar._fullHour = chr(20);
 
 	for (int i = 1; i <= 10; ++i)
-		g_s._pourc[i] = ' ';
+		_coreVar._pourc[i] = ' ';
 
 	for (int i = 1; i <= 6; ++i)
-		g_s._teauto[i] = '*';
+		_coreVar._teauto[i] = '*';
 
 	for (int i = 7; i <= 9; ++i)
-		g_s._teauto[i] = ' ';
+		_coreVar._teauto[i] = ' ';
 
 	for (int i = 10; i <= 28; ++i)
-		g_s._teauto[i] = '*';
+		_coreVar._teauto[i] = '*';
 
 	for (int i = 29; i <= 42; ++i)
-		g_s._teauto[i] = ' ';
+		_coreVar._teauto[i] = ' ';
 
-	g_s._teauto[33] = '*';
+	_coreVar._teauto[33] = '*';
 
 	for (int i = 1; i <= 8; ++i)
 		g_nbrep[i] = 0;
@@ -2519,7 +2519,7 @@ void MortevielleEngine::showTitleScreen() {
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
-	g_vm->draw(g_ades, 0, 0);
+	draw(g_ades, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
 	_screenSurface.putxy(104 + 72 * g_res, 185);
@@ -2531,10 +2531,10 @@ void MortevielleEngine::showTitleScreen() {
  * @remarks	Originally called 'dessine'
  */
 void MortevielleEngine::draw(int ad, int x, int y) {
-	g_vm->_mouse.hideMouse();
-	g_vm->setPal(g_numpal);
+	_mouse.hideMouse();
+	setPal(g_numpal);
 	pictout(ad, 0, x, y);
-	g_vm->_mouse.showMouse();
+	_mouse.showMouse();
 }
 
 /**
@@ -2542,13 +2542,231 @@ void MortevielleEngine::draw(int ad, int x, int y) {
  * @remarks	Originally called 'dessine_rouleau'
  */
 void MortevielleEngine::drawRightFrame() {
-	g_vm->setPal(89);
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
+	setPal(89);
+	if (_currGraphicalDevice == MODE_HERCULES) {
 		g_mem[0x7000 * 16 + 14] = 15;
 	}
-	g_vm->_mouse.hideMouse();
+	_mouse.hideMouse();
 	pictout(0x73a2, 0, 0, 0);
-	g_vm->_mouse.showMouse();
+	_mouse.showMouse();
+}
+
+/**
+ * Read the current system time
+ */
+int MortevielleEngine::readclock() {
+	TimeDate dateTime;
+	g_system->getTimeAndDate(dateTime);
+
+	int m = dateTime.tm_min * 60;
+	int h = dateTime.tm_hour * 3600;
+	return h + m + dateTime.tm_sec;
+}
+
+/**
+ * Engine function - Prepare room and hint string
+ * @remarks	Originally called 'tinke'
+ */
+void MortevielleEngine::prepareRoom() {
+	Common::String d1 = getEngineString(S_SHOULD_HAVE_NOTICED);
+	Common::String d2 = getEngineString(S_NUMBER_OF_HINTS);
+	const char d3 = '[';
+	const char d4 = ']';
+	const char d5 = '1';
+	Common::String d6 = getEngineString(S_OK);
+	int cf, day, hour, minute;
+	Common::String stpo;
+
+	_anyone = false;
+	updateHour(day, hour, minute);
+	if (day != _day) {
+		_day = day;
+		int i = 0;
+		do {
+			++i;
+			if (g_nbrepm[i] != 0)
+				--g_nbrepm[i];
+			g_nbrep[i] = 0;
+		} while (i != 8);
+	}
+	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
+		_hour = hour;
+		_minute = 0;
+		drawClock();
+		cf = 0;
+		for (int i = 1; i <= 10; ++i) {
+			if (_coreVar._pourc[i] == '*')
+				++cf;
+		}
+
+		if (cf == 10)
+			stpo = "10";
+		else
+			stpo = chr(cf + 48);
+
+		_hintPctMessage = Common::String(d3);
+		_hintPctMessage += d5;
+		_hintPctMessage += d4;
+		_hintPctMessage += d3;
+		_hintPctMessage += d1;
+		_hintPctMessage += stpo;
+		_hintPctMessage += '0';
+		_hintPctMessage += d2;
+		_hintPctMessage += d4;
+		_hintPctMessage += d3;
+		_hintPctMessage += d6;
+		_hintPctMessage += d4;
+	}
+	if (minute > _minute) {
+		_minute = 30;
+		drawClock();
+	}
+	if (_mouse._pos.y < 12)
+		return;
+
+	if (!_blo) {
+		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
+			g_t = kTime2;
+		else
+			g_t = kTime1;
+		cf = _coreVar._faithScore;
+		if ((cf > 33) && (cf < 66))
+			g_t -= (g_t / 3);
+
+		if (cf > 65)
+			g_t -= ((g_t / 3) * 2);
+
+		int nh = readclock();
+		if ((nh - g_mh) > g_t) {
+			bool activeMenu = _menu._menuActive;
+			_menu.eraseMenu();
+			g_jh += ((nh - g_mh) / g_t);
+			g_mh = nh;
+			switch (_place) {
+			case GREEN_ROOM:
+			case DARKBLUE_ROOM:
+				setRandomPresenceGreenRoom(cf);
+				break;
+			case PURPLE_ROOM:
+				setRandomPresencePurpleRoom(cf);
+				break;
+			case BLUE_ROOM:
+				setRandomPresenceBlueRoom(cf);
+				break;
+			case RED_ROOM:
+			case GREEN_ROOM2:
+				setRandomPresenceRedRoom(cf);
+				break;
+			case ROOM9:
+				setRandomPresenceRoom9(cf);
+				break;
+			case DINING_ROOM:
+				setRandomPresenceDiningRoom(cf);
+				break;
+			case BUREAU:
+				setRandomPresenceBureau(cf);
+				break;
+			case KITCHEN:
+				setRandomPresenceKitchen(cf);
+				break;
+			case ATTIC:
+			case CELLAR:
+				setRandomPresenceAttic(cf);
+				break;
+			case LANDING:
+			case ROOM26:
+				setRandomPresenceLanding(cf);
+				break;
+			case CHAPEL:
+				setRandomPresenceChapel(cf);
+				break;
+			}
+			if ((g_mpers != 0) && (_currBitIndex != 10))
+				g_mpers = _currBitIndex;
+
+			if ((g_mpers == 0) && (_currBitIndex > 0)) {
+				if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR)) {
+					cavegre();
+				} else if (_currBitIndex == 10) {
+					_currBitIndex = 0;
+					if (!_brt) {
+						_brt = true;
+						g_hdb = readclock();
+						if (getRandomNumber(1, 5) < 5) {
+							clearScreenType3();
+							prepareScreenType2();
+							ecr3(getEngineString(S_HEAR_NOISE));
+							int rand = (getRandomNumber(0, 4)) - 2;
+							_speechManager.startSpeech(1, rand, 1);
+							clearScreenType3();
+						}
+					}
+				}
+			}
+
+			if (activeMenu)
+				_menu.drawMenu();
+		}
+	}
+	g_hfb = readclock();
+	if ((_brt) && ((g_hfb - g_hdb) > 17)) {
+		getPresenceBitIndex(_place);
+		_brt = false;
+		g_hdb = 0;
+		if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
+			_anyone = true;
+	}
+}
+
+/**
+ * Engine function - Draw Clock
+ * @remarks	Originally called 'pendule'
+ */
+void MortevielleEngine::drawClock() {
+	const int cv[2][12] = {
+		{  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
+		{ -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
+	};
+	const int x = 580;
+	const int y = 123;
+	const int rg = 9;
+	int h, co;
+
+	_mouse.hideMouse();
+	
+	paint_rect(570, 118, 20, 10);
+	paint_rect(578, 114, 6, 18);
+	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
+		co = 0;
+	else
+		co = 1;
+
+	if (_minute == 0)
+		_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
+	else 
+		_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
+
+	h = _hour;
+	if (h > 12)
+		h -= 12;
+	if (h == 0)
+		h = 12;
+
+	_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
+	_mouse.showMouse();
+	_screenSurface.putxy(568, 154);
+
+	if (_hour > 11)
+		_screenSurface.drawString("PM ", 1);
+	else
+		_screenSurface.drawString("AM ", 1);
+
+	_screenSurface.putxy(550, 160);
+	if ((_day >= 0) && (_day <= 8)) {
+		Common::String tmp = getEngineString(S_DAY);
+		tmp.insertChar((char)(_day + 49), 0);
+		_screenSurface.drawString(tmp, 1);
+	}
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b17d729..c0230cf 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -100,6 +100,29 @@ struct t_pcga {
 	nhom _a[16];
 };
 
+struct Pattern {
+	byte _tay, _tax;
+	byte _des[kMaxPatt + 1][kMaxPatt + 1];
+};
+
+struct SaveStruct {
+	int _faithScore;
+	byte _pourc[11];
+	byte _teauto[43];
+	byte _sjer[31];
+	int _currPlace;
+	int _atticBallHoleObjectId;
+	int _atticRodHoleObjectId;
+	int _cellarObjectId;
+	int _secretPassageObjectId;
+	int _wellObjectId;
+	int _selectedObjectId;
+	int _purpleRoomObjectId;
+	int _cryptObjectId;
+	bool _alreadyEnteredManor;
+	byte _fullHour;
+};
+
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
@@ -133,6 +156,7 @@ private:
 	void loadCFIEC();
 	void loadCFIPH();
 	void showTitleScreen();
+	int readclock();
 
 public:
 	Common::String _hintPctMessage;
@@ -183,7 +207,7 @@ public:
 	int _c_zzz;
 	int ptr_word;
 	byte _v_lieu[7][25];
-	SaveStruct g_s, g_s1;
+	SaveStruct _coreVar, _saveStruct;
 	byte g_is;
 
 	ScreenSurface _screenSurface;
@@ -334,6 +358,8 @@ public:
 	void music();
 	void draw(int ad, int x, int y);
 	void drawRightFrame();
+	void prepareRoom();
+	void drawClock();
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 6a8aaff..22385ed 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -196,37 +196,37 @@ void taffich() {
 
 	switch (a) {
 	case 16:
-		g_vm->g_s._pourc[9] = '*';
-		g_vm->g_s._teauto[42] = '*';
+		g_vm->_coreVar._pourc[9] = '*';
+		g_vm->_coreVar._teauto[42] = '*';
 		break;
 	case 20:
-		g_vm->g_s._teauto[39] = '*';
-		if (g_vm->g_s._teauto[36] == '*') {
-			g_vm->g_s._pourc[3] = '*';
-			g_vm->g_s._teauto[38] = '*';
+		g_vm->_coreVar._teauto[39] = '*';
+		if (g_vm->_coreVar._teauto[36] == '*') {
+			g_vm->_coreVar._pourc[3] = '*';
+			g_vm->_coreVar._teauto[38] = '*';
 		}
 		break;
 	case 24:
-		g_vm->g_s._teauto[37] = '*';
+		g_vm->_coreVar._teauto[37] = '*';
 		break;
 	case 30:
-		g_vm->g_s._teauto[9] = '*';
+		g_vm->_coreVar._teauto[9] = '*';
 		break;
 	case 31:
-		g_vm->g_s._pourc[4] = '*';
-		g_vm->g_s._teauto[35] = '*';
+		g_vm->_coreVar._pourc[4] = '*';
+		g_vm->_coreVar._teauto[35] = '*';
 		break;
 	case 118:
-		g_vm->g_s._teauto[41] = '*';
+		g_vm->_coreVar._teauto[41] = '*';
 		break;
 	case 143:
-		g_vm->g_s._pourc[1] = '*';
+		g_vm->_coreVar._pourc[1] = '*';
 		break;
 	case 150:
-		g_vm->g_s._teauto[34] = '*';
+		g_vm->_coreVar._teauto[34] = '*';
 		break;
 	case 151:
-		g_vm->g_s._pourc[2] = '*';
+		g_vm->_coreVar._pourc[2] = '*';
 		break;
 	default:
 		break;
@@ -258,7 +258,7 @@ void taffich() {
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
 
-		if (((a < 27) && (((g_maff > 69) && (!g_vm->g_s._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+		if (((a < 27) && (((g_maff > 69) && (!g_vm->_coreVar._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
 			m = 2033;
 
 		g_maff = a;
@@ -333,11 +333,11 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	g_vm->_mouse.showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_vm->g_s._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
-			cx = t11(g_vm->g_s._currPlace);
+			cx = t11(g_vm->_coreVar._currPlace);
 		g_mpers =  0;
 	}
 }
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index c99804f..fa26132 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -46,25 +46,25 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
  * Handle saving or loading savegame data
  */
 void SavegameManager::sync_save(Common::Serializer &sz) {
-	sz.syncAsSint16LE(g_vm->g_s1._faithScore);
+	sz.syncAsSint16LE(g_vm->_saveStruct._faithScore);
 	for (int i = 0; i < 11; ++i)
-		sz.syncAsByte(g_vm->g_s1._pourc[i]);
+		sz.syncAsByte(g_vm->_saveStruct._pourc[i]);
 	for (int i = 0; i < 43; ++i)
-		sz.syncAsByte(g_vm->g_s1._teauto[i]);
+		sz.syncAsByte(g_vm->_saveStruct._teauto[i]);
 	for (int i = 0; i < 31; ++i)
-		sz.syncAsByte(g_vm->g_s1._sjer[i]);
-
-	sz.syncAsSint16LE(g_vm->g_s1._currPlace);
-	sz.syncAsSint16LE(g_vm->g_s1._atticBallHoleObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._atticRodHoleObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._cellarObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._secretPassageObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._wellObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._selectedObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._purpleRoomObjectId);
-	sz.syncAsSint16LE(g_vm->g_s1._cryptObjectId);
-	sz.syncAsByte(g_vm->g_s1._alreadyEnteredManor);
-	sz.syncAsByte(g_vm->g_s1._fullHour);
+		sz.syncAsByte(g_vm->_saveStruct._sjer[i]);
+
+	sz.syncAsSint16LE(g_vm->_saveStruct._currPlace);
+	sz.syncAsSint16LE(g_vm->_saveStruct._atticBallHoleObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._atticRodHoleObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._cellarObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._secretPassageObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._wellObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._selectedObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._purpleRoomObjectId);
+	sz.syncAsSint16LE(g_vm->_saveStruct._cryptObjectId);
+	sz.syncAsByte(g_vm->_saveStruct._alreadyEnteredManor);
+	sz.syncAsByte(g_vm->_saveStruct._fullHour);
 
 	sz.syncBytes(g_bufcha, 391);
 }
@@ -106,7 +106,7 @@ void SavegameManager::loadSavegame(int n) {
 	Common::Serializer sz(stream, NULL);
 	sync_save(sz);
 
-	g_vm->g_s = g_vm->g_s1;
+	g_vm->_coreVar = g_vm->_saveStruct;
 	for (int i = 0; i <= 389; ++i)
 		g_tabdon[i + kAcha] = g_bufcha[i];
 
@@ -142,9 +142,9 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	
 	for (i = 0; i <= 389; ++i)
 		g_bufcha[i] = g_tabdon[i + kAcha];
-	g_vm->g_s1 = g_vm->g_s;
-	if (g_vm->g_s1._currPlace == 26)
-		g_vm->g_s1._currPlace = 15;
+	g_vm->_saveStruct = g_vm->_coreVar;
+	if (g_vm->_saveStruct._currPlace == 26)
+		g_vm->_saveStruct._currPlace = 15;
 	
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index eabffb9..0c12a43 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -56,6 +56,14 @@ const int kTempoM = 89;
 //const int seg_syst = 0x6fed;
 //const int offsetb2 = 4;
 
+struct SpeechQueue {
+	int _val;
+	int _code;
+	int _acc;
+	int _freq;
+	int _rep;
+};
+
 class SpeechManager {
 private:
 	int _typlec;
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index a601c45..8b82aac 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -106,7 +106,6 @@ int g_nbrep[9];
 int g_nbrepm[9];
 int g_msg[5];
 byte g_touv[8];
-SaveStruct g_s, g_s1;
 byte g_bufcha[391];
 
 byte g_lettres[7][24];
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 178ca2d..a6fccb6 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -114,44 +114,12 @@ struct Hint {
 	byte _point;
 };
 
-struct SaveStruct {
-	int _faithScore;
-	byte _pourc[11];
-	byte _teauto[43];
-	byte _sjer[31];
-	int _currPlace;
-	int _atticBallHoleObjectId;
-	int _atticRodHoleObjectId;
-	int _cellarObjectId;
-	int _secretPassageObjectId;
-	int _wellObjectId;
-	int _selectedObjectId;
-	int _purpleRoomObjectId;
-	int _cryptObjectId;
-	bool _alreadyEnteredManor;
-	byte _fullHour;
-};
-
-struct SpeechQueue {
-	int _val;
-	int _code;
-	int _acc;
-	int _freq;
-	int _rep;
-};
-
 struct Rect {
 	int _x1, _x2, _y1, _y2;
 	bool _enabled;
 };
 
-struct Pattern {
-	byte _tay, _tax;
-	byte _des[kMaxPatt + 1][kMaxPatt + 1];
-};
-
 typedef int tablint[256];
-//typedef Common::Point tabdb[17];
 typedef int tfxx[108];
 
 /*---------------------------------------------------------------------------*/
@@ -206,8 +174,6 @@ extern int g_msg[5];
 extern byte g_touv[8];
 extern byte g_bufcha[391];
 
-extern byte g_lettres[7][24];
-
 extern uint16 g_t_mot[kMaxTi + 1];
 extern int g_tay_tchar;
 extern Hint g_t_rec[kMaxTd + 1];


Commit: b6d198d12757889682a132640766c23b368438a7
    https://github.com/scummvm/scummvm/commit/b6d198d12757889682a132640766c23b368438a7
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:42-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/keyboard.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/saveload.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 3d92db8..bcf291b 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -42,13 +42,13 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((_coreVar._currPlace == ROOM26) && (g_msg[4] == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == ROOM26) && (_msg[4] == _menu._moveMenu[6])) {
 		_coreVar._currPlace = LANDING;
 		g_caff = _coreVar._currPlace;
 		afdes();
 		repon(2, _coreVar._currPlace);
 	}
-	if ((_coreVar._currPlace == LANDING) && (g_msg[4] == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == LANDING) && (_msg[4] == _menu._moveMenu[6])) {
 		if (!_syn)
 			ecr3(getEngineString(S_GO_TO));
 		tfleche();
@@ -89,7 +89,7 @@ void MortevielleEngine::fctMove() {
 	tsort();
 	int menuChoice = 1;
 
-	while (_menu._moveMenu[menuChoice] != g_msg[4])
+	while (_menu._moveMenu[menuChoice] != _msg[4])
 		++menuChoice;
 
 	if (_coreVar._currPlace == MOUNTAIN) {
@@ -209,7 +209,7 @@ void MortevielleEngine::fctTake() {
 				_obpart = false;
 				affrep();
 			} else {
-				g_tabdon[kAcha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
+				_tabdon[kAcha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
@@ -307,7 +307,7 @@ void MortevielleEngine::fctInventoryTake() {
 	cx = 0;
 	do {
 		++cx;
-	} while (_menu._inventoryMenu[cx] != g_msg[4]);
+	} while (_menu._inventoryMenu[cx] != _msg[4]);
 	cz = 0;
 	cy = 0;
 	do {
@@ -352,7 +352,7 @@ void MortevielleEngine::fctLift() {
 		tmpPlace = 14;
 	else if (_coreVar._currPlace == MOUNTAIN)
 		tmpPlace = 15;
-	g_crep = g_tabdon[asoul + (tmpPlace << 3) + (g_num - 1)];
+	g_crep = _tabdon[asoul + (tmpPlace << 3) + (g_num - 1)];
 	if (g_crep == 255)
 		g_crep = 997;
 }
@@ -446,7 +446,7 @@ void MortevielleEngine::fctLook() {
 		cx -= 4;
 	if (_coreVar._currPlace == ROOM26)
 		cx = 21;
-	g_crep = g_tabdon[arega + (cx * 7) + g_num - 1];
+	g_crep = _tabdon[arega + (cx * 7) + g_num - 1];
 	if ((_coreVar._currPlace == ATTIC) && (g_num == 8))
 		g_crep = 126;
 	if (_coreVar._currPlace == MOUNTAIN)
@@ -508,8 +508,8 @@ void MortevielleEngine::fctSearch() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
-			if (g_num != ord(g_touv[cx]))
+			} while ((cx <= 6) && (g_num != ord(_touv[cx])));
+			if (g_num != ord(_touv[cx]))
 				g_crep = 187;
 			else {
 				if (_currBitIndex > 0)
@@ -590,7 +590,7 @@ void MortevielleEngine::fctOpen() {
 
 	if (g_caff == ROOM26) {
 		if (g_ment != 0) {
-			g_msg[4] = OPCODE_ENTER;
+			_msg[4] = OPCODE_ENTER;
 			_syn = true;
 		} else
 			g_crep = 997;
@@ -614,8 +614,8 @@ void MortevielleEngine::fctOpen() {
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
-		} while (!((tmpPlace > 6) || (ord(g_touv[tmpPlace]) == 0) || (ord(g_touv[tmpPlace]) == g_num)));
-		if (ord(g_touv[tmpPlace]) != g_num) {
+		} while (!((tmpPlace > 6) || (ord(_touv[tmpPlace]) == 0) || (ord(_touv[tmpPlace]) == g_num)));
+		if (ord(_touv[tmpPlace]) != g_num) {
 			if (!( ((g_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == 9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
 			    || ((g_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
 				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (g_num == 5))
@@ -628,13 +628,13 @@ void MortevielleEngine::fctOpen() {
 					if (getRandomNumber(1, 4) == 3)
 						_speechManager.startSpeech(7, 9, 1);
 				}
-				g_touv[tmpPlace] = chr(g_num);
+				_touv[tmpPlace] = chr(g_num);
 				aniof(1, g_num);
 			}
 			tmpPlace = _coreVar._currPlace;
 			if (_coreVar._currPlace == CRYPT)
 				tmpPlace = CELLAR;
-			g_crep = g_tabdon[aouvr + (tmpPlace * 7) + g_num - 1];
+			g_crep = _tabdon[aouvr + (tmpPlace * 7) + g_num - 1];
 			if (g_crep == 254)
 				g_crep = 999;
 		} else
@@ -699,7 +699,7 @@ void MortevielleEngine::fctPlace() {
 					// Do you want to enter the hidden passage?
 					int answer = Alert::show(getEngineString(S_YES_NO), 1);
 					if (answer == 1) {
-						Common::String alertTxt = g_vm->getString(582);
+						Common::String alertTxt = getString(582);
 						Alert::show(alertTxt, 1);
 
 						bool enterPassageFl = KnowledgeCheck::show();
@@ -726,7 +726,7 @@ void MortevielleEngine::fctPlace() {
 							dessin(0);
 							aniof(1, 2);
 							aniof(1, 1);
-							alertTxt = g_vm->getString(577);
+							alertTxt = getString(577);
 							Alert::show(alertTxt, 1);
 							aniof(2, 1);
 							g_crep = 166;
@@ -881,11 +881,11 @@ void MortevielleEngine::fctClose() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
-			if (g_num == ord(g_touv[cx])) {
+			} while ((cx <= 6) && (g_num != ord(_touv[cx])));
+			if (g_num == ord(_touv[cx])) {
 				aniof(2, g_num);
 				g_crep = 998;
-				g_touv[cx] = chr(0);
+				_touv[cx] = chr(0);
 				--g_iouv;
 				if (g_iouv < 0)
 					g_iouv = 0;
@@ -981,8 +981,8 @@ void MortevielleEngine::fctSelfPut() {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (g_num != ord(g_touv[cx])));
-				if (g_num != ord(g_touv[cx]))
+				} while ((cx <= 6) && (g_num != ord(_touv[cx])));
+				if (g_num != ord(_touv[cx]))
 					g_crep = 187;
 				else {
 					g_mchai = chai;
@@ -1153,8 +1153,8 @@ void MortevielleEngine::fctEnter() {
 				g_x = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
-				g_msg[3] = MENU_DISCUSS;
-				g_msg[4] = _menu._discussMenu[g_x];
+				_msg[3] = MENU_DISCUSS;
+				_msg[4] = _menu._discussMenu[g_x];
 				_syn = true;
 				if (g_ment == 9) {
 					_col = true;
@@ -1352,7 +1352,7 @@ void MortevielleEngine::fctDiscuss() {
 		cx = 0;
 		do {
 			++cx;
-		} while (_menu._discussMenu[cx] != g_msg[4]);
+		} while (_menu._discussMenu[cx] != _msg[4]);
 		g_caff = 69 + cx;
 		afdes();
 		repon(2, g_caff);
@@ -1368,7 +1368,7 @@ void MortevielleEngine::fctDiscuss() {
 	for (int ix = 1; ix <= 46; ++ix)
 		te[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
-		lib[ix] = g_vm->getString(ix + kQuestionStringIndex);
+		lib[ix] = getString(ix + kQuestionStringIndex);
 		for (i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
@@ -1477,10 +1477,10 @@ void MortevielleEngine::fctDiscuss() {
 					suj = 138;
 					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
-			} else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) {
-				suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)];
-				_coreVar._faithScore += g_tabdon[arcf + ix];
-				++g_nbrep[g_caff - 69];
+			} else if (_nbrep[g_caff - 69] < _nbrepm[g_caff - 69]) {
+				suj = _tabdon[arep + (ix << 3) + (g_caff - 70)];
+				_coreVar._faithScore += _tabdon[arcf + ix];
+				++_nbrep[g_caff - 69];
 			} else {
 				_coreVar._faithScore += 3;
 				suj = 139;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 5191b1e..318a4ba 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -217,7 +217,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
 		col += 6;
 	}
 	++i;
-	choiceListStr = copy(inputStr, i, 30);
+	choiceListStr = g_vm->copy(inputStr, i, 30);
 	if (g_res == 2)
 		col *= 6;
 	else
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
index 2ce96bc..699bd5a 100644
--- a/engines/mortevielle/keyboard.cpp
+++ b/engines/mortevielle/keyboard.cpp
@@ -46,7 +46,7 @@ int testou() {
 		break;
 	case '\26' :
 		if ((g_vm->_c_zzz == 1) || (g_vm->_c_zzz == 2)) {
-			g_vm->decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+			g_vm->decodeNumber(&g_vm->_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 			++g_vm->_c_zzz;
 
 			return 61;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 1d8a105..ec41a7e 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -486,8 +486,8 @@ void Menu::mdn() {
 			//  A menu was clicked on
 			_menuSelected = (_multiTitle) && (g_msg4 != OPCODE_NONE);
 			menuUp(g_msg3);
-			g_msg[4] = g_msg4;
-			g_msg[3] = g_msg3;
+			g_vm->_msg[4] = g_msg4;
+			g_vm->_msg[3] = g_msg3;
 			g_msg3 = OPCODE_NONE;
 			g_msg4 = OPCODE_NONE;
 
@@ -542,8 +542,8 @@ void Menu::initMenu() {
 	}
 	g_msg3 = OPCODE_NONE;
 	g_msg4 = OPCODE_NONE;
-	g_msg[3] = OPCODE_NONE;
-	g_msg[4] = OPCODE_NONE;
+	g_vm->_msg[3] = OPCODE_NONE;
+	g_vm->_msg[4] = OPCODE_NONE;
 	g_vm->setMouseClick(false);
 }
 
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index ca01e01..9bd3236 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -65,13 +65,13 @@ void adzon() {
 	if (!f.open("don.mor"))
 		error("Missing file - don.mor");
 
-	f.read(g_tabdon, 7 * 256);
+	f.read(g_vm->_tabdon, 7 * 256);
 	f.close();
 
 	if (!f.open("bmor.mor"))
 		error("Missing file - bmor.mor");
 
-	f.read(&g_tabdon[fleche], 1 * 1916);
+	f.read(&g_vm->_tabdon[fleche], 1 * 1916);
 	f.close();
 
 	if (!f.open("dec.mor"))
@@ -152,7 +152,7 @@ void text1(int x, int y, int nb, int m) {
 
 void initouv() {
 	for (int cx = 1; cx <= 7; ++cx)
-		g_touv[cx] = chr(0);
+		g_vm->_touv[cx] = chr(0);
 }
 
 void ecr2(Common::String str_) {
@@ -164,18 +164,18 @@ void ecr2(Common::String str_) {
 		g_vm->_screenSurface.drawString(str_, 5);
 	else if ((int)str_.size() < (tlig << 1)) {
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
+		g_vm->_screenSurface.drawString(g_vm->copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.drawString(copy(str_, tlig, tlig << 1), 5);
+		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig, tlig << 1), 5);
 	} else {
 		g_vm->_largestClearScreen = true;
 		g_vm->clearScreenType2();
 		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.drawString(copy(str_, 1, (tlig - 1)), 5);
+		g_vm->_screenSurface.drawString(g_vm->copy(str_, 1, (tlig - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.drawString(copy(str_, tlig, ((tlig << 1) - 1)), 5);
+		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig, ((tlig << 1) - 1)), 5);
 		g_vm->_screenSurface.putxy(8, 190);
-		g_vm->_screenSurface.drawString(copy(str_, tlig << 1, tlig * 3), 5);
+		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig << 1, tlig * 3), 5);
 	}
 }
 
@@ -351,7 +351,7 @@ void init_nbrepm() {
 	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 
 	for (int idx = 0; idx < 9; ++idx)
-		g_nbrepm[idx] = ipm[idx];
+		g_vm->_nbrepm[idx] = ipm[idx];
 }
 
 void phaz(int &rand, int &p, int cf) {
@@ -440,7 +440,7 @@ void writetp(Common::String s, int t) {
 	if (g_res == 2)
 		g_vm->_screenSurface.drawString(s, t);
 	else
-		g_vm->_screenSurface.drawString(copy(s, 1, 25), t);
+		g_vm->_screenSurface.drawString(g_vm->copy(s, 1, 25), t);
 }
 
 void aniof(int ouf, int num) {
@@ -483,8 +483,8 @@ void dessin(int ad) {
 			g_vm->prepareScreenType1();
 			if ((g_caff < 30) || (g_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
-					if (ord(g_touv[cx]) != 0)
-						aniof(1, ord(g_touv[cx]));
+					if (ord(g_vm->_touv[cx]) != 0)
+						aniof(1, ord(g_vm->_touv[cx]));
 				}
 
 				if (g_caff == 13) {
@@ -568,7 +568,7 @@ void tlu(int af, int ob) {
 	repon(2, 999);
 	tkey1(true);
 	g_caff = af;
-	g_msg[3] = OPCODE_NONE;
+	g_vm->_msg[3] = OPCODE_NONE;
 	g_crep = 998;
 }
 
@@ -587,7 +587,7 @@ void tsort() {
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
-		g_touv[cx] = chr(0);
+		g_vm->_touv[cx] = chr(0);
 	g_ment = 0;
 	g_iouv = 0;
 	g_mchai = 0;
@@ -648,7 +648,7 @@ void modinv() {
 }
 
 void mennor() {
-	g_vm->_menu.menuUp(g_msg[3]);
+	g_vm->_menu.menuUp(g_vm->_msg[3]);
 }
 
 void premtet() {
@@ -662,10 +662,10 @@ void ajchai() {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 9) && (g_tabdon[cy + cx] != 0));
+	} while ((cx <= 9) && (g_vm->_tabdon[cy + cx] != 0));
 
-	if (g_tabdon[cy + cx] == 0)
-		g_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
+	if (g_vm->_tabdon[cy + cx] == 0)
+		g_vm->_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
 	else
 		g_crep = 192;
 }
@@ -716,8 +716,8 @@ L1:
 		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
 		g_caff = 69 + cx;
 		g_crep = g_caff;
-		g_msg[3] = MENU_DISCUSS;
-		g_msg[4] = g_vm->_menu._discussMenu[cx];
+		g_vm->_msg[3] = MENU_DISCUSS;
+		g_vm->_msg[4] = g_vm->_menu._discussMenu[cx];
 		g_vm->_syn = true;
 		g_vm->_col = true;
 	} else {
@@ -749,7 +749,7 @@ void tsuiv() {
 		++cx;
 		++g_cs;
 		cl = cy + g_cs;
-		tbcl = g_tabdon[cl];
+		tbcl = g_vm->_tabdon[cl];
 	} while ((tbcl == 0) && (g_cs <= 9));
 
 	if ((tbcl != 0) && (g_cs < 11)) {
@@ -811,12 +811,12 @@ void tcoord(int sx) {
 	int atdon = amzon + 3;
 	int cy = 0;
 	while (cy < g_caff) {
-		a += g_tabdon[atdon];
+		a += g_vm->_tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
-	if (g_tabdon[atdon] == 0) {
+	if (g_vm->_tabdon[atdon] == 0) {
 		g_crep = 997;
 		return;
 	}
@@ -824,10 +824,10 @@ void tcoord(int sx) {
 	a += fleche;
 	int cb = 0;
 	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
+		ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
 		cb += (ib * 4) + 2;
 	}
-	ib = (g_tabdon[a + cb] << 8) + g_tabdon[(a + cb + 1)];
+	ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
 	if (ib == 0) {
 		g_crep = 997;
 		return;
@@ -836,11 +836,11 @@ void tcoord(int sx) {
 	cy = 1;
 	do {
 		cb += 2;
-		sx = g_tabdon[a + cb] * g_res;
-		sy = g_tabdon[(a + cb + 1)];
+		sx = g_vm->_tabdon[a + cb] * g_res;
+		sy = g_vm->_tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = g_tabdon[a + cb] * g_res;
-		iy = g_tabdon[(a + cb + 1)];
+		ix = g_vm->_tabdon[a + cb] * g_res;
+		iy = g_vm->_tabdon[(a + cb + 1)];
 		++cy;
 	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
 
@@ -879,7 +879,7 @@ void treg(int ob) {
 	int mdes = g_caff;
 	g_caff = ob;
 
-	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_msg[4] == OPCODE_SLOOK)) {
+	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
 		afdes();
 		if ((g_caff > 29) && (g_caff < 33))
 			repon(2, g_caff);
@@ -887,7 +887,7 @@ void treg(int ob) {
 			repon(2, g_caff + 400);
 		tkey1(true);
 		g_caff = mdes;
-		g_msg[3] = 0;
+		g_vm->_msg[3] = 0;
 		g_crep = 998;
 	} else {
 		g_vm->_obpart = true;
@@ -913,7 +913,7 @@ void rechai(int &ch) {
 
 	if (g_vm->_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
-	ch = g_tabdon[achai + (tmpPlace * 7) + g_num - 1];
+	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_num - 1];
 }
 
 int t23coul() {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 907e305..ffad259 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -200,7 +200,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	loadPalette();
 	loadCFIPH();
 	loadCFIEC();
-	decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 	_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
@@ -564,7 +564,7 @@ void MortevielleEngine::mainGame() {
 		loadCFIEC();
 
 	for (g_crep = 1; g_crep <= _c_zzz; ++g_crep) 
-		decodeNumber(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+		decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
 	_menu.initMenu();
@@ -638,18 +638,18 @@ void MortevielleEngine::handleAction() {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (_menu._menuSelected && (g_msg[3] == MENU_SAVE)) {
-			Common::String saveName = Common::String::format("Savegame #%d", g_msg[4] & 7);
-			_savegameManager.saveGame(g_msg[4] & 7, saveName);
+		if (_menu._menuSelected && (_msg[3] == MENU_SAVE)) {
+			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 7);
+			_savegameManager.saveGame(_msg[4] & 7, saveName);
 		}
-		if (_menu._menuSelected && (g_msg[3] == MENU_LOAD))
-			_savegameManager.loadGame((g_msg[4] & 7) - 1);
+		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
+			_savegameManager.loadGame((_msg[4] & 7) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((g_mnumo != OPCODE_NONE) && ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))) {
-				g_msg[4] = g_mnumo;
+			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
+				_msg[4] = _menuOpcode;
 				ecr3(getEngineString(S_IDEM));
 			} else
 				return;
@@ -670,17 +670,17 @@ void MortevielleEngine::handleAction() {
 			if (g_num == 9999)
 				g_num = 0;
 		} else {
-			g_mnumo = g_msg[3];
-			if ((g_msg[3] == MENU_ACTION) || (g_msg[3] == MENU_SELF))
-				g_mnumo = g_msg[4];
+			_menuOpcode = _msg[3];
+			if ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))
+				_menuOpcode = _msg[4];
 			if (!_anyone) {
 				if ((_heroSearching) || (_obpart)) {
 					if (_mouse._pos.y < 12)
 						return;
 
-					if ((g_msg[4] == OPCODE_SOUND) || (g_msg[4] == OPCODE_LIFT)) {
+					if ((_msg[4] == OPCODE_SOUND) || (_msg[4] == OPCODE_LIFT)) {
 						oo = true;
-						if ((g_msg[4] == OPCODE_LIFT) || (_obpart)) {
+						if ((_msg[4] == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
 							g_caff = _coreVar._currPlace;
 							g_crep = 998;
@@ -1858,7 +1858,7 @@ void MortevielleEngine::gameLoaded() {
 	_hiddenHero = false;
 	_brt = false;
 	g_maff = 68;
-	g_mnumo = OPCODE_NONE;
+	_menuOpcode = OPCODE_NONE;
 	g_prebru = 0;
 	g_x = 0;
 	g_y = 0;
@@ -1908,71 +1908,71 @@ void MortevielleEngine::handleOpcode() {
 	_keyPressedEsc = false;
 	if (!_anyone) {
 		if (_brt) {
-			if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
+			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
 				g_ctrm = 4;
 				mennor();
 				return;
 			}
 		}
-		if (g_msg[3] == MENU_MOVE)
+		if (_msg[3] == MENU_MOVE)
 			fctMove();
-		if (g_msg[3] == MENU_DISCUSS)
+		if (_msg[3] == MENU_DISCUSS)
 			fctDiscuss();
-		if (g_msg[3] == MENU_INVENTORY)
+		if (_msg[3] == MENU_INVENTORY)
 			fctInventoryTake();
-		if (g_msg[4] == OPCODE_ATTACH)
+		if (_msg[4] == OPCODE_ATTACH)
 			fctAttach();
-		if (g_msg[4] == OPCODE_WAIT)
+		if (_msg[4] == OPCODE_WAIT)
 			fctWait();
-		if (g_msg[4] == OPCODE_FORCE)
+		if (_msg[4] == OPCODE_FORCE)
 			fctForce();
-		if (g_msg[4] == OPCODE_SLEEP)
+		if (_msg[4] == OPCODE_SLEEP)
 			fctSleep();
-		if (g_msg[4] == OPCODE_LISTEN)
+		if (_msg[4] == OPCODE_LISTEN)
 			fctListen();
-		if (g_msg[4] == OPCODE_ENTER)
+		if (_msg[4] == OPCODE_ENTER)
 			fctEnter();
-		if (g_msg[4] == OPCODE_CLOSE)
+		if (_msg[4] == OPCODE_CLOSE)
 			fctClose();
-		if (g_msg[4] == OPCODE_SEARCH)
+		if (_msg[4] == OPCODE_SEARCH)
 			fctSearch();
-		if (g_msg[4] == OPCODE_KNOCK)
+		if (_msg[4] == OPCODE_KNOCK)
 			fctKnock();
-		if (g_msg[4] == OPCODE_SCRATCH)
+		if (_msg[4] == OPCODE_SCRATCH)
 			fctScratch();
-		if (g_msg[4] == OPCODE_READ)
+		if (_msg[4] == OPCODE_READ)
 			fctRead();
-		if (g_msg[4] == OPCODE_EAT)
+		if (_msg[4] == OPCODE_EAT)
 			fctEat();
-		if (g_msg[4] == OPCODE_PLACE)
+		if (_msg[4] == OPCODE_PLACE)
 			fctPlace();
-		if (g_msg[4] == OPCODE_OPEN)
+		if (_msg[4] == OPCODE_OPEN)
 			fctOpen();
-		if (g_msg[4] == OPCODE_TAKE)
+		if (_msg[4] == OPCODE_TAKE)
 			fctTake();
-		if (g_msg[4] == OPCODE_LOOK)
+		if (_msg[4] == OPCODE_LOOK)
 			fctLook();
-		if (g_msg[4] == OPCODE_SMELL)
+		if (_msg[4] == OPCODE_SMELL)
 			fctSmell();
-		if (g_msg[4] == OPCODE_SOUND)
+		if (_msg[4] == OPCODE_SOUND)
 			fctSound();
-		if (g_msg[4] == OPCODE_LEAVE)
+		if (_msg[4] == OPCODE_LEAVE)
 			fctLeave();
-		if (g_msg[4] == OPCODE_LIFT)
+		if (_msg[4] == OPCODE_LIFT)
 			fctLift();
-		if (g_msg[4] == OPCODE_TURN)
+		if (_msg[4] == OPCODE_TURN)
 			fctTurn();
-		if (g_msg[4] == OPCODE_SSEARCH)
+		if (_msg[4] == OPCODE_SSEARCH)
 			fctSelfSearch();
-		if (g_msg[4] == OPCODE_SREAD)
+		if (_msg[4] == OPCODE_SREAD)
 			fctSelfRead();
-		if (g_msg[4] == OPCODE_SPUT)
+		if (_msg[4] == OPCODE_SPUT)
 			fctSelfPut();
-		if (g_msg[4] == OPCODE_SLOOK)
+		if (_msg[4] == OPCODE_SLOOK)
 			fctSelftLook();
 		_hiddenHero = false;
 
-		if (g_msg[4] == OPCODE_SHIDE)
+		if (_msg[4] == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
 		if (_anyone) {
@@ -2158,13 +2158,13 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	uint16 oct, ocd;
 
 	/* 5-8 */
-	oct = g_t_mot[idx];
+	oct = _inpBuffer[idx];
 	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
 	if (pt < 6) {
 		++idx;
 		oct = oct << (5 - pt);
 		pt += 11;
-		oct = oct | ((uint)g_t_mot[idx] >> pt);
+		oct = oct | ((uint)_inpBuffer[idx] >> pt);
 	} else {
 		pt -= 5;
 		oct = (uint)oct >> pt;
@@ -2177,13 +2177,13 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		break;
 	case 30:
 	case 31:
-		ocd = g_t_mot[idx];
+		ocd = _inpBuffer[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
 			++idx;
 			ocd = ocd << (5 - pt);
 			pt += 11;
-			ocd = ocd | ((uint)g_t_mot[idx] >> pt);
+			ocd = ocd | ((uint)_inpBuffer[idx] >> pt);
 		} else {
 			pt -= 5;
 			ocd = (uint)ocd >> pt;
@@ -2217,21 +2217,21 @@ Common::String MortevielleEngine::getString(int num) {
 	} else if (!_txxFileFl) {
 		wrkStr = getGameString(num);
 	} else {
-		int i = g_t_rec[num]._hintId;
-		byte k = g_t_rec[num]._point;
+		int hint = _ntpBuffer[num]._hintId;
+		byte point = _ntpBuffer[num]._point;
 		int length = 0;
 		bool endFl = false;
 		char let;
 		do {
-			cinq_huit(let, i, k, endFl);
+			cinq_huit(let, hint, point, endFl);
 			if (length < 254)
 				wrkStr += let;
 			++length;
 		} while (!endFl);
 	}
 
-	if (wrkStr.lastChar() == '$')
-		// Remove trailing '$'
+	while (wrkStr.lastChar() == '$')
+		// Remove trailing '$'s
 		wrkStr.deleteLastChar();
 
 	return wrkStr;
@@ -2240,7 +2240,7 @@ Common::String MortevielleEngine::getString(int num) {
 void MortevielleEngine::copcha() {
 	int i = kAcha;
 	do {
-		g_tabdon[i] = g_tabdon[i + 390];
+		_tabdon[i] = _tabdon[i + 390];
 		++i;
 	} while (i != kAcha + 390);
 }
@@ -2288,7 +2288,7 @@ void MortevielleEngine::resetVariables() {
 	_coreVar._teauto[33] = '*';
 
 	for (int i = 1; i <= 8; ++i)
-		g_nbrep[i] = 0;
+		_nbrep[i] = 0;
 
 	init_nbrepm();
 }
@@ -2352,7 +2352,7 @@ void MortevielleEngine::loadPalette() {
 	if (!f.open("fxx.mor"))
 		error("Missing file - fxx.mor");
 	for (int i = 0; i < 108; ++i)
-		g_l[i] = f.readSint16LE();
+		_fxxBuffer[i] = f.readSint16LE();
 	f.close();
 
 	if (!f.open("plxx.mor"))
@@ -2423,14 +2423,14 @@ void MortevielleEngine::loadTexts() {
 	} 
 
 	for (int i = 0; i < inpFile.size() / 2; ++i)
-		g_t_mot[i] = inpFile.readUint16LE();
+		_inpBuffer[i] = inpFile.readUint16LE();
 
 	inpFile.close();
 	_txxFileFl = true;
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		g_t_rec[i]._hintId = ntpFile.readSint16LE();
-		g_t_rec[i]._point = ntpFile.readByte();
+		_ntpBuffer[i]._hintId = ntpFile.readSint16LE();
+		_ntpBuffer[i]._point = ntpFile.readByte();
 	}
 
 	ntpFile.close();
@@ -2453,7 +2453,7 @@ void MortevielleEngine::loadCFIEC() {
 	if (!f.open("cfiec.mor"))
 		error("Missing file - cfiec.mor");
 
-	f.read(&g_adcfiec[0], 822 * 128);
+	f.read(&_cfiecBuffer[0], 822 * 128);
 	f.close();
 
 	_reloadCFIEC = false;
@@ -2467,7 +2467,7 @@ void MortevielleEngine::loadCFIPH() {
 		error("Missing file - cfiph.mor");
 
 	for (int i = 0; i < (f.size() / 2); ++i)
-		g_t_cph[i] = f.readSint16LE();
+		_speechManager._cfiphBuffer[i] = f.readSint16LE();
 
 	f.close();
 }
@@ -2492,13 +2492,13 @@ void MortevielleEngine::music() {
 
 	_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
 	_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
-	_speechManager.cctable(g_tbi);
+	_speechManager.cctable(_speechManager._tbi);
 
 	bool fin = false;
 	int k = 0;
 	do {
 		fin = keyPressed();
-		_soundManager.musyc(g_tbi, 9958, kTempoMusic);
+		_soundManager.musyc(_speechManager._tbi, 9958, kTempoMusic);
 		++k;
 		fin = fin | keyPressed() | (k >= 5);
 	} while (!fin);
@@ -2532,7 +2532,7 @@ void MortevielleEngine::showTitleScreen() {
  */
 void MortevielleEngine::draw(int ad, int x, int y) {
 	_mouse.hideMouse();
-	setPal(g_numpal);
+	setPal(_numpal);
 	pictout(ad, 0, x, y);
 	_mouse.showMouse();
 }
@@ -2584,9 +2584,9 @@ void MortevielleEngine::prepareRoom() {
 		int i = 0;
 		do {
 			++i;
-			if (g_nbrepm[i] != 0)
-				--g_nbrepm[i];
-			g_nbrep[i] = 0;
+			if (_nbrepm[i] != 0)
+				--_nbrepm[i];
+			_nbrep[i] = 0;
 		} while (i != 8);
 	}
 	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
@@ -2769,4 +2769,26 @@ void MortevielleEngine::drawClock() {
 	}
 }
 
+void MortevielleEngine::palette(int v1) {
+	warning("TODO: palette");
+}
+
+/**
+ * Returns a substring of the given string
+ * @param s		Source string
+ * @param idx	Starting index (1 based)
+ * @param size	Number of characters to return
+ */
+
+Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t size) {
+	// Copy the substring into a temporary buffer
+	char *tmp = new char[size + 1];
+	strncpy(tmp, s.c_str() + idx - 1, size);
+	tmp[size] = '\0';
+
+	Common::String result(tmp);
+	delete[] tmp;
+	return result;
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c0230cf..46795e6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -135,6 +135,7 @@ private:
 	Common::StringArray _gameStrings;
 
 	Pattern _patternArr[15];
+	int _menuOpcode;
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
@@ -156,12 +157,22 @@ private:
 	void loadCFIEC();
 	void loadCFIPH();
 	void showTitleScreen();
-	int readclock();
-
+	int  readclock();
+	void palette(int v1);
 public:
 	Common::String _hintPctMessage;
 	Common::Point _prevPos;
 
+	byte _tabdon[4001];
+	byte _cfiecBuffer[822 * 128];
+	int  _fxxBuffer[108];
+	byte _touv[8];
+	int  _msg[5];
+	int  _nbrep[9];
+	int  _nbrepm[9];
+	uint16 _inpBuffer[kMaxTi + 1];
+	Hint _ntpBuffer[kMaxTd + 1];
+
 	bool _roomPresenceLuc;
 	bool _roomPresenceIda;
 	bool _purpleRoomPresenceLeo;
@@ -202,6 +213,8 @@ public:
 	int _minute;
 	float _addfix;
 
+	int _numpal;
+
 	Common::Point _stdPal[91][17];
 	t_pcga _cgaPal[91];
 	int _c_zzz;
@@ -360,6 +373,7 @@ public:
 	void drawRightFrame();
 	void prepareRoom();
 	void drawClock();
+	Common::String copy(const Common::String &s, int idx, size_t size);
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 22385ed..bb57ac0 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -281,16 +281,16 @@ void taffich() {
 		npal = a;
 
 		for (cx = 0; cx <= (a - 1); ++cx)
-			lgt = lgt + g_l[cx];
-		handle = g_l[a];
+			lgt += g_vm->_fxxBuffer[cx];
+		handle = g_vm->_fxxBuffer[a];
 
 		filename = "DXX.mor";
 	} else {
 		filename = "DZZ.mor";
-		handle = g_l[87];
+		handle = g_vm->_fxxBuffer[87];
 		if (a == 51) {
 			lgt = handle;
-			handle = g_l[88];
+			handle = g_vm->_fxxBuffer[88];
 		}
 		g_maff = a;
 		npal = a + 37;
@@ -310,7 +310,7 @@ void taffich() {
 			alllum[k] = -1;
 		}
 	}
-	g_numpal = npal;
+	g_vm->_numpal = npal;
 	g_vm->setPal(npal);
 
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
@@ -323,8 +323,8 @@ void taffich() {
 			else if (b > 15)
 				--b;
 			for (cx = 0; cx <= (b - 1); ++cx)
-				lgt += g_l[cx + 89];
-			handle = g_l[b + 89];
+				lgt += g_vm->_fxxBuffer[cx + 89];
+			handle = g_vm->_fxxBuffer[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
 			filename = "AZZ.mor";
@@ -333,7 +333,7 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	g_vm->_mouse.showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_vm->_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index fa26132..d71e2fd 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -66,7 +66,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsByte(g_vm->_saveStruct._alreadyEnteredManor);
 	sz.syncAsByte(g_vm->_saveStruct._fullHour);
 
-	sz.syncBytes(g_bufcha, 391);
+	sz.syncBytes(_tabdonSaveBuffer, 391);
 }
 
 /**
@@ -108,7 +108,7 @@ void SavegameManager::loadSavegame(int n) {
 
 	g_vm->_coreVar = g_vm->_saveStruct;
 	for (int i = 0; i <= 389; ++i)
-		g_tabdon[i + kAcha] = g_bufcha[i];
+		g_vm->_tabdon[i + kAcha] = _tabdonSaveBuffer[i];
 
 	// Close the stream
 	delete stream;	
@@ -141,10 +141,10 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	g_vm->hourToChar();
 	
 	for (i = 0; i <= 389; ++i)
-		g_bufcha[i] = g_tabdon[i + kAcha];
+		_tabdonSaveBuffer[i] = g_vm->_tabdon[i + kAcha];
 	g_vm->_saveStruct = g_vm->_coreVar;
-	if (g_vm->_saveStruct._currPlace == 26)
-		g_vm->_saveStruct._currPlace = 15;
+	if (g_vm->_saveStruct._currPlace == ROOM26)
+		g_vm->_saveStruct._currPlace = LANDING;
 	
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index c1c3c80..a89fc9d 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -49,6 +49,8 @@ struct SavegameHeader {
 
 class SavegameManager {
 private:
+	byte _tabdonSaveBuffer[391];
+
 	void sync_save(Common::Serializer &sz);
 public:
 	void loadSavegame(int n);
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 69a0c33..7d235cd 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -93,8 +93,8 @@ void SpeechManager::charg_car(int &currWordNumb) {
 
 
 void SpeechManager::entroct(byte o) {
-	g_mem[kAdrTroct * 16 + g_ptr_oct] = o;
-	++g_ptr_oct;
+	g_mem[kAdrTroct * 16 + _ptr_oct] = o;
+	++_ptr_oct;
 }
 
 void SpeechManager::veracf(byte b) {
@@ -115,7 +115,7 @@ void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		g_t_cph[j] = READ_LE_UINT16(&g_mem[kAdrNoise3 + i]);
+		_cfiphBuffer[j] = READ_LE_UINT16(&g_mem[kAdrNoise3 + i]);
 		i += 2;
 		++j;
 	} while (i < kOffsetB3 + 8790);
@@ -148,7 +148,7 @@ void SpeechManager::loadPhonemeSounds() {
 		error("Missing file - phbrui.mor");
 
 	for (int i = 1; i <= 3; ++i)
-		g_t_cph[i] = f.readSint16LE();
+		_cfiphBuffer[i] = f.readSint16LE();
 
 	f.close();
 }
@@ -499,13 +499,13 @@ void SpeechManager::initQueue() {
 void SpeechManager::handlePhoneme() {
 	const int deca[3] = {300, 30, 40};
 
-	int startPos = swap(g_t_cph[_phonemeNumb - 1]) + deca[_typlec];
-	int endPos = swap(g_t_cph[_phonemeNumb]) + deca[_typlec];
+	int startPos = swap(_cfiphBuffer[_phonemeNumb - 1]) + deca[_typlec];
+	int endPos = swap(_cfiphBuffer[_phonemeNumb]) + deca[_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], g_t_cph[i]);
+		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], _cfiphBuffer[i]);
 
-	g_ptr_oct = 0;
+	_ptr_oct = 0;
 	int currWord = 0;
 	initQueue();
 
@@ -536,14 +536,14 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	_typlec = typ;
 	if (_typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
-			savph[i] = g_t_cph[i];
+			savph[i] = _cfiphBuffer[i];
 		tempo = kTempoNoise;
 	} else if (g_haut > 5)
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
 	g_vm->_addfix = (float)((tempo - g_addv[0])) / 256;
-	cctable(g_tbi);
+	cctable(_tbi);
 	switch (typ) {
 	case 1:
 		loadNoise();
@@ -558,13 +558,13 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		break;
 	}
 	handlePhoneme();
-	g_vm->_soundManager.litph(g_tbi, typ, tempo);
+	g_vm->_soundManager.litph(_tbi, typ, tempo);
 	if (_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
-			g_t_cph[i] = savph[i];
+			_cfiphBuffer[i] = savph[i];
 			g_mlec = _typlec;
 		}
-	g_vm->setPal(g_numpal);
+	g_vm->setPal(g_vm->_numpal);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 0c12a43..9eccd04 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -68,9 +68,14 @@ class SpeechManager {
 private:
 	int _typlec;
 	int _phonemeNumb;
+
 	SpeechQueue _queue[3];
+	int _ptr_oct;
 
 public:
+	int _cfiphBuffer[6401];
+	int _tbi[256];
+
 	SpeechManager();
 	void spfrac(int wor);
 	void charg_car(int &currWordNumb);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 8b82aac..b6cc46c 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -92,31 +92,8 @@ int g_x,
         g_mchai,
         g_menup,
         g_mpers,
-        g_mnumo,
         g_perdep,
-        g_prebru,
-        g_numpal,
-        g_ptr_oct,
-        g_k_tempo;
-
-int g_t_cph[6401];
-byte g_tabdon[4001];
-
-int g_nbrep[9];
-int g_nbrepm[9];
-int g_msg[5];
-byte g_touv[8];
-byte g_bufcha[391];
-
-byte g_lettres[7][24];
-
-uint16 g_t_mot[kMaxTi + 1];
-int g_tay_tchar;
-Hint g_t_rec[kMaxTd + 1];
-int g_l[108];
-int g_tbi[256];
-
-byte g_adcfiec[(4088 * 16) + (311 * 0x80)];
+        g_prebru;
 
 /*---------------------------------------------------------------------------*/
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
@@ -131,23 +108,6 @@ void hirs() {
 	g_vm->_screenSurface.clearScreen();
 }
 
-/**
- * Returns a substring of the given string
- * @param s		Source string
- * @param idx	Starting index (1 based)
- * @param size	Number of characters to return
- */
-Common::String copy(const Common::String &s, int idx, size_t size) {
-	// Copy the substring into a temporary buffer
-	char *tmp = new char[size + 1];
-	strncpy(tmp, s.c_str() + idx - 1, size);
-	tmp[size] = '\0';
-
-	Common::String result(tmp);
-	delete[] tmp;
-	return result;
-}
-
 /*---------------------------------------------------------------------------*/
 /*------------------------------     STUBS     ------------------------------*/
 /*---------------------------------------------------------------------------*/
@@ -155,10 +115,6 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
 int g_port[0xfff];
 byte g_mem[65536 * 16];
 
-void palette(int v1) {
-	warning("TODO: palette");
-}
-
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index a6fccb6..26e4edd 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -158,36 +158,14 @@ extern int g_x,
         g_mchai,
         g_menup,
         g_mpers,
-        g_mnumo,
         g_perdep,
-        g_prebru,
-        g_numpal,
-        g_ptr_oct,
-        g_k_tempo;
-
-extern int g_t_cph[6401]; // Speech
-extern byte g_tabdon[4001];
-
-extern int g_nbrep[9];
-extern int g_nbrepm[9];
-extern int g_msg[5];
-extern byte g_touv[8];
-extern byte g_bufcha[391];
-
-extern uint16 g_t_mot[kMaxTi + 1];
-extern int g_tay_tchar;
-extern Hint g_t_rec[kMaxTd + 1];
-extern int g_l[108];
-extern int g_tbi[256];
-
-extern byte g_adcfiec[822 * 128];
+        g_prebru;
 
 /*---------------------------------------------------------------------------*/
 /*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
 /*---------------------------------------------------------------------------*/
 
 void hirs();
-Common::String copy(const Common::String &s, int idx, size_t size);
 void Val(const Common::String &s, int &V, int Code);
 
 /*---------------------------------------------------------------------------*/
@@ -197,7 +175,6 @@ void Val(const Common::String &s, int &V, int Code);
 
 extern int g_port[0xfff];
 extern byte g_mem[65536 * 16];
-extern void palette(int v1);
 
 } // End of namespace Mortevielle
 


Commit: b63857195ded6a06406a7637a780794e07aa294f
    https://github.com/scummvm/scummvm/commit/b63857195ded6a06406a7637a780794e07aa294f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:43-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index bcf291b..1c3314f 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -209,7 +209,7 @@ void MortevielleEngine::fctTake() {
 				_obpart = false;
 				affrep();
 			} else {
-				_tabdon[kAcha + ((g_mchai - 1) * 10) + g_cs - 1] = 0;
+				_tabdon[kAcha + ((_mchai - 1) * 10) + g_cs - 1] = 0;
 				tsuiv();
 				++g_dobj;
 				if (g_dobj > 6) {
@@ -515,8 +515,8 @@ void MortevielleEngine::fctSearch() {
 				if (_currBitIndex > 0)
 					_coreVar._faithScore += 3;
 
-				rechai(g_mchai);
-				if (g_mchai != 0) {
+				rechai(_mchai);
+				if (_mchai != 0) {
 					g_cs = 0;
 					g_is = 0;
 					_heroSearching = true;
@@ -891,8 +891,8 @@ void MortevielleEngine::fctClose() {
 					g_iouv = 0;
 				int chai = 9999;
 				rechai(chai);
-				if (g_mchai == chai)
-					g_mchai = 0;
+				if (_mchai == chai)
+					_mchai = 0;
 			} else {
 				g_crep = 187;
 			}
@@ -985,7 +985,7 @@ void MortevielleEngine::fctSelfPut() {
 				if (g_num != ord(_touv[cx]))
 					g_crep = 187;
 				else {
-					g_mchai = chai;
+					_mchai = chai;
 					g_crep = 999;
 				}
 			}
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 318a4ba..b14af53 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -299,7 +299,7 @@ bool KnowledgeCheck::show() {
 
 	for (int indx = 0; indx < 10; ++indx) {
 		g_vm->_mouse.hideMouse();
-		hirs();
+		g_vm->hirs();
 		g_vm->_mouse.showMouse();
 		int dialogHeight;
 		if (g_res == 1)
@@ -429,7 +429,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 
 		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
 			g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
-			hirs();
+			g_vm->hirs();
 			aff50(drawAni50Fl);
 		}
 	} while (g_key != 66); // keycode for F8
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index dc63e05..2e9e019 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -913,7 +913,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &g_mem[0x7000 * 16 + 2];
+	const byte *paletteMap = &g_vm->_mem[0x7000 * 16 + 2];
 
 	// Loop through writing 
 	for (int yp = 0; yp < surface.h; ++yp) {
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index ec41a7e..1b03093 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -220,8 +220,8 @@ void Menu::displayMenu() {
 void Menu::drawMenu() {
 	displayMenu();
 	_menuActive = true;
-	g_msg4 = OPCODE_NONE;
-	g_msg3 = OPCODE_NONE;
+	_msg4 = OPCODE_NONE;
+	_msg3 = OPCODE_NONE;
 	_menuSelected = false;
 	g_vm->setMouseClick(false);
 	_multiTitle = false;
@@ -232,15 +232,15 @@ void Menu::drawMenu() {
  * @remarks	Originally called 'invers'
  */
 void Menu::invert(int indx) {
-	if (g_msg4 == OPCODE_NONE)
+	if (_msg4 == OPCODE_NONE)
 		return;
 
-	int menuIndex = lo(g_msg4);
+	int menuIndex = lo(_msg4);
 
-	g_vm->_screenSurface.putxy(_menuConstants[g_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	g_vm->_screenSurface.putxy(_menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 
 	Common::String str;
-	switch (g_msg3) {
+	switch (_msg3) {
 	case 1:
 		str = _inventoryStringArray[menuIndex];
 		break;
@@ -279,14 +279,14 @@ void Menu::invert(int indx) {
 	if ((str[0] != '*') && (str[0] != '<'))
 		g_vm->_screenSurface.drawString(str, indx);
 	else
-		g_msg4 = OPCODE_NONE;
+		_msg4 = OPCODE_NONE;
 }
 
 void Menu::util(Common::Point pos) {
 
-	int ymx = (_menuConstants[g_msg3 - 1][3] << 3) + 16;
-	int dxcar = _menuConstants[g_msg3 - 1][2];
-	int xmn = (_menuConstants[g_msg3 - 1][0] << 2) * g_res;
+	int ymx = (_menuConstants[_msg3 - 1][3] << 3) + 16;
+	int dxcar = _menuConstants[_msg3 - 1][2];
+	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_res;
 
 	int ix;
 	if (g_res == 1)
@@ -295,15 +295,15 @@ void Menu::util(Common::Point pos) {
 		ix = 3;
 	int xmx = dxcar * ix * g_res + xmn + 2;
 	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
-		ix = (((uint)pos.y >> 3) - 1) + (g_msg3 << 8);
-		if (ix != g_msg4) {
+		ix = (((uint)pos.y >> 3) - 1) + (_msg3 << 8);
+		if (ix != _msg4) {
 			invert(1);
-			g_msg4 = ix;
+			_msg4 = ix;
 			invert(0);
 		}
-	} else if (g_msg4 != OPCODE_NONE) {
+	} else if (_msg4 != OPCODE_NONE) {
 		invert(1);
-		g_msg4 = OPCODE_NONE;
+		_msg4 = OPCODE_NONE;
 	}
 }
 
@@ -419,7 +419,7 @@ void Menu::menuUp(int xx) {
 void Menu::eraseMenu() {
 	_menuActive = false;
 	g_vm->setMouseClick(false);
-	menuUp(g_msg3);
+	menuUp(_msg3);
 }
 
 /**
@@ -459,37 +459,37 @@ void Menu::mdn() {
 			else
 				ix = MENU_FILE;
 
-			if ((ix != g_msg3) || (!_multiTitle))
-				if (!((ix == MENU_FILE) && ((g_msg3 == MENU_SAVE) || (g_msg3 == MENU_LOAD)))) {
-					menuUp(g_msg3);
+			if ((ix != _msg3) || (!_multiTitle))
+				if (!((ix == MENU_FILE) && ((_msg3 == MENU_SAVE) || (_msg3 == MENU_LOAD)))) {
+					menuUp(_msg3);
 					menuDown(ix);
-					g_msg3 = ix;
-					g_msg4 = OPCODE_NONE;
+					_msg3 = ix;
+					_msg4 = OPCODE_NONE;
 				}
 		} else { // Not in the MenuTitle line
 			if ((curPos.y > 11) && (_multiTitle))
 				util(curPos);
 		}
 	} else {       // There was a click
-		if ((g_msg3 == MENU_FILE) && (g_msg4 != OPCODE_NONE)) {
+		if ((_msg3 == MENU_FILE) && (_msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
 			g_vm->setMouseClick(false);
-			menuUp(g_msg3);
-			if (lo(g_msg4) == 1)
-				g_msg3 = 7;
+			menuUp(_msg3);
+			if (lo(_msg4) == 1)
+				_msg3 = 7;
 			else
-				g_msg3 = 8;
-			menuDown(g_msg3);
+				_msg3 = 8;
+			menuDown(_msg3);
 
 			g_vm->setMouseClick(false);
 		} else { 
 			//  A menu was clicked on
-			_menuSelected = (_multiTitle) && (g_msg4 != OPCODE_NONE);
-			menuUp(g_msg3);
-			g_vm->_msg[4] = g_msg4;
-			g_vm->_msg[3] = g_msg3;
-			g_msg3 = OPCODE_NONE;
-			g_msg4 = OPCODE_NONE;
+			_menuSelected = (_multiTitle) && (_msg4 != OPCODE_NONE);
+			menuUp(_msg3);
+			g_vm->_msg[4] = _msg4;
+			g_vm->_msg[3] = _msg3;
+			_msg3 = OPCODE_NONE;
+			_msg4 = OPCODE_NONE;
 
 			g_vm->setMouseClick(false);
 		}
@@ -540,8 +540,8 @@ void Menu::initMenu() {
 		if (i > 6)
 			g_vm->_menu.disableMenuItem(_inventoryMenu[i]);
 	}
-	g_msg3 = OPCODE_NONE;
-	g_msg4 = OPCODE_NONE;
+	_msg3 = OPCODE_NONE;
+	_msg4 = OPCODE_NONE;
 	g_vm->_msg[3] = OPCODE_NONE;
 	g_vm->_msg[4] = OPCODE_NONE;
 	g_vm->setMouseClick(false);
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index b600d4e..f4d12bc 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -41,6 +41,8 @@ enum {
 class Menu {
 private:
 	byte _charArr[7][24];
+	int _msg3;
+	int _msg4;
 
 	void util(Common::Point pos);
 	void invert(int indx);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 9bd3236..4c1d4de 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -46,15 +46,15 @@ namespace Mortevielle {
 
 void pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
-	surface.decode(&g_mem[seg * 16 + dep]);
+	surface.decode(&g_vm->_mem[seg * 16 + dep]);
 
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
-		g_mem[0x7000 * 16 + 2] = 0;
-		g_mem[0x7000 * 16 + 32] = 15;
+		g_vm->_mem[0x7000 * 16 + 2] = 0;
+		g_vm->_mem[0x7000 * 16 + 32] = 15;
 	}
 
-	if ((g_caff != 51) && (READ_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138], 0x100);
+	if ((g_caff != 51) && (READ_LE_UINT16(&g_vm->_mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&g_vm->_mem[0x7000 * 16 + 0x4138], 0x100);
 
 	g_vm->_screenSurface.drawPicture(surface, x, y);
 }
@@ -77,7 +77,7 @@ void adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&g_mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.read(&g_vm->_mem[0x73a2 * 16 + 0], 1 * 1664);
 	f.close();
 }
 
@@ -85,12 +85,12 @@ void adzon() {
  * Returns the offset within the compressed image data resource of the desired image
  */
 int animof(int ouf, int num) {
-	int nani = g_mem[kAdrAni * 16 + 1];
+	int nani = g_vm->_mem[kAdrAni * 16 + 1];
 	int aux = num;
 	if (ouf != 1)
 		aux += nani;
 
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[kAdrAni * 16 + (aux << 1)]);
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_vm->_mem[kAdrAni * 16 + (aux << 1)]);
 
 	return animof_result;
 }
@@ -185,13 +185,6 @@ void ecr3(Common::String text) {
 	g_vm->_screenSurface.drawString(text, 5);
 }
 
-void stop() {
-	hirs();
-	g_vm->_currGraphicalDevice = MODE_AMSTRAD1512;
-	hirs();
-	g_vm->quitGame();
-}
-
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
@@ -460,7 +453,7 @@ void aniof(int ouf, int num) {
 	int offset = animof(ouf, num);
 
 	GfxSurface surface;
-	surface.decode(&g_mem[ad * 16 + offset]);
+	surface.decode(&g_vm->_mem[ad * 16 + offset]);
 	g_vm->_screenSurface.drawPicture(surface, 0, 12);
 
 	g_vm->prepareScreenType1();
@@ -590,7 +583,7 @@ void tsort() {
 		g_vm->_touv[cx] = chr(0);
 	g_ment = 0;
 	g_iouv = 0;
-	g_mchai = 0;
+	g_vm->_mchai = 0;
 	debloc(g_vm->_coreVar._currPlace);
 }
 
@@ -658,7 +651,7 @@ void premtet() {
 
 /* NIVEAU 5 */
 void ajchai() {
-	int cy = kAcha + ((g_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
@@ -743,7 +736,7 @@ void tsuiv() {
 	int tbcl;
 	int cl;
 
-	int cy = kAcha + ((g_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 03a4c0f..30b0caf 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -54,7 +54,6 @@ extern void text1(int x, int y, int nb, int m);
 extern void initouv();
 extern void ecr2(Common::String str_);
 extern void ecr3(Common::String text);
-extern void stop();
 extern void paint_rect(int x, int y, int dx, int dy);
 /* NIVEAU 12 */
 extern void modobj(int m);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index ffad259..05d6e05 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -541,7 +541,7 @@ Common::Error MortevielleEngine::run() {
  */
 void MortevielleEngine::showIntroduction() {
 	f3f8::aff50(false);
-	g_mlec = 0;
+	_speechManager._mlec = 0;
 	f3f8::checkForF8(142, false);
 	CHECK_QUIT;
 
@@ -1656,7 +1656,7 @@ void MortevielleEngine::loseGame() {
 	initouv();
 	g_ment = 0;
 	g_iouv = 0;
-	g_mchai = 0;
+	_mchai = 0;
 	_menu.unsetSearchMenu();
 	if (!_blo)
 		t11(MANOR_FRONT);
@@ -1870,7 +1870,7 @@ void MortevielleEngine::gameLoaded() {
 	g_ment = 0;
 	_syn = true;
 	_heroSearching = true;
-	g_mchai = 0;
+	_mchai = 0;
 	_manorDistance = 0;
 	initouv();
 	g_iouv = 0;
@@ -2303,8 +2303,8 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			g_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
-			g_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+			g_vm->_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
+			g_vm->_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
@@ -2332,12 +2332,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + addr], p._tax);
-	WRITE_LE_UINT16(&g_mem[0x6000 * 16 + addr + 2], p._tay);
+	WRITE_LE_UINT16(&g_vm->_mem[0x6000 * 16 + addr], p._tax);
+	WRITE_LE_UINT16(&g_vm->_mem[0x6000 * 16 + addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			g_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			g_vm->_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 
@@ -2443,7 +2443,7 @@ void MortevielleEngine::loadBRUIT5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&g_mem[kAdrNoise5 * 16 + 0], 149 * 128);
+	f.read(&g_vm->_mem[kAdrNoise5 * 16 + 0], 149 * 128);
 	f.close();
 }
 
@@ -2486,12 +2486,12 @@ void MortevielleEngine::music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&g_mem[0x3800 * 16 + 0], 500);
-	fic.read(&g_mem[0x47a0 * 16 + 0], 123);
+	fic.read(&g_vm->_mem[0x3800 * 16 + 0], 500);
+	fic.read(&g_vm->_mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
-	_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
+	_soundManager.decodeMusic(&g_vm->_mem[0x3800 * 16], &g_vm->_mem[0x5000 * 16], 623);
+	_addfix = (float)((kTempoMusic - 8)) / 256;
 	_speechManager.cctable(_speechManager._tbi);
 
 	bool fin = false;
@@ -2544,7 +2544,7 @@ void MortevielleEngine::draw(int ad, int x, int y) {
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		g_mem[0x7000 * 16 + 14] = 15;
+		g_vm->_mem[0x7000 * 16 + 14] = 15;
 	}
 	_mouse.hideMouse();
 	pictout(0x73a2, 0, 0, 0);
@@ -2791,4 +2791,13 @@ Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t
 	return result;
 }
 
+void MortevielleEngine::hirs() {
+	// Note: The original used this to set the graphics mode and clear the screen, both at
+	// the start of the game, and whenever the screen need to be cleared. As such, this
+	// method is deprecated in favour of clearing the screen
+	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
+
+	g_vm->_screenSurface.clearScreen();
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 46795e6..69cb12a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -123,6 +123,11 @@ struct SaveStruct {
 	byte _fullHour;
 };
 
+struct Hint {
+	int _hintId;
+	byte _point;
+};
+
 class MortevielleEngine : public Engine {
 private:
 	const ADGameDescription *_gameDescription;
@@ -211,17 +216,20 @@ public:
 	int _day;
 	int _hour;
 	int _minute;
+	int _mchai;
 	float _addfix;
-
-	int _numpal;
-
+	SaveStruct _coreVar, _saveStruct;
 	Common::Point _stdPal[91][17];
 	t_pcga _cgaPal[91];
+
 	int _c_zzz;
 	int ptr_word;
 	byte _v_lieu[7][25];
-	SaveStruct _coreVar, _saveStruct;
 	byte g_is;
+	int _numpal;
+
+	// TODO: Replace the following with proper implementations, or refactor out the code using them
+	byte _mem[65536 * 16];
 
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
@@ -374,7 +382,7 @@ public:
 	void prepareRoom();
 	void drawClock();
 	Common::String copy(const Common::String &s, int idx, size_t size);
-
+	void hirs();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 3010723..bd7e489 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -57,10 +57,10 @@ void MouseHandler::hideMouse() {
 			int k = 0;
 			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 			do {
-				WRITE_LE_UINT16(&g_mem[0xb000 * 16 + j], s_s[0][k]);
-				WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j + 2], s_s[1][k]);
-				WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j], s_s[2][k]);
-				WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j + 2], s_s[3][k]);
+				WRITE_LE_UINT16(&g_vm->_mem[0xb000 * 16 + j], s_s[0][k]);
+				WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j + 2], s_s[1][k]);
+				WRITE_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j], s_s[2][k]);
+				WRITE_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j += 80;
 				++k;
 			} while (k < 5);
@@ -69,15 +69,15 @@ void MouseHandler::hideMouse() {
 		case MODE_AMSTRAD1512: {
 			bool imp = odd(_pos.y);
 			for (int i = 0; i <= 3; ++i) {
-				g_port[0x3dd] = 1 << i;
+				_port[0x3dd] = 1 << i;
 				int k = 0;
 				j = 0;
 				do {
 					if (imp) {
-						WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 80 - 0x2000;
 					} else {
-						WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 0x2000;
 					}
 					imp = !imp;
@@ -87,22 +87,22 @@ void MouseHandler::hideMouse() {
 			break;
 			}
 		case MODE_EGA: {
-			g_port[0x3c4] = 2;
-			g_port[0x3ce] = 8;
-			g_port[0x3cf] = 255;
+			_port[0x3c4] = 2;
+			_port[0x3ce] = 8;
+			_port[0x3cf] = 255;
 			int i = 0;
 			do {
-				g_port[0x3c5] = 1 << i;
+				_port[0x3c5] = 1 << i;
 				int k = 0;
 				j = 0;
 				do {
 					// Useless ?
 					// ps = mem[0xa000 * 16 + j];
-					g_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
+					g_vm->_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
 
 					// Useless ??
 					// ps = mem[0xa000 * 16 + j + 1];
-					g_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
+					g_vm->_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
 					++k;
 				} while (k < 8);
@@ -114,7 +114,7 @@ void MouseHandler::hideMouse() {
 			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 			for (int i = 0; i <= 5; ++i) {
 				for (int k = 0; k <= 3; ++k) 
-					WRITE_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
+					WRITE_LE_UINT16(&g_vm->_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
 			break;
@@ -123,8 +123,8 @@ void MouseHandler::hideMouse() {
 			int k = 0;
 			do {
 				for (int i = 0; i <= 3; ++i) {
-					WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
-					WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
+					WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
+					WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j += 160;
 				++k;
@@ -154,10 +154,10 @@ void MouseHandler::showMouse() {
 		k = 0;
 		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 		do {
-			s_s[0][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
-			s_s[1][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j + 2]);
-			s_s[2][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j]);
-			s_s[3][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j + 2]);
+			s_s[0][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
+			s_s[1][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j + 2]);
+			s_s[2][k] = READ_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j]);
+			s_s[3][k] = READ_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j + 2]);
 			j += 80;
 			++k;
 		} while (k < 5);
@@ -167,14 +167,14 @@ void MouseHandler::showMouse() {
 		for (i = 0; i <= 3; ++i) {
 			j = 0;
 			imp = odd(_pos.y);
-			g_port[0x3de] = i;
+			_port[0x3de] = i;
 			k = 0;
 			do {
 				if (imp) {
-					s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
 					j += 80 - 0x2000;
 				} else {
-					s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
 					j += 0x2000;
 				}
 				imp = !imp;
@@ -184,14 +184,14 @@ void MouseHandler::showMouse() {
 		break;
 		}
 	case MODE_EGA:
-		g_port[0x3ce] = 4;
+		_port[0x3ce] = 4;
 		l = 0;
 		do {
-			g_port[0x3cf] = l;
+			_port[0x3cf] = l;
 			k = 0;
 			j = 0;
 			do {
-				s_s[l][k] = g_mem[0xa000 * 16 + j] + (g_mem[(0xa000 * 16) + j + 1] << 8);
+				s_s[l][k] = g_vm->_mem[0xa000 * 16 + j] + (g_vm->_mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
 				++k;
 			} while (k < 8);
@@ -202,7 +202,7 @@ void MouseHandler::showMouse() {
 		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 		for (i = 0; i <= 5; ++i) {
 			for (k = 0; k <= 3; ++k)
-				s_s[i][k] = READ_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j]);
+				s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb000 * 16 + k * 0x200 + j]);
 			j += 80;
 		}
 		break;
@@ -211,8 +211,8 @@ void MouseHandler::showMouse() {
 		k = 0;
 		do {
 			for (i = 0; i <= 3; ++i) {
-				s_s[k][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j]);
-				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2]);
+				s_s[k][i + (k << 2)] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j]);
+				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
 			j += 160;
 			++k;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 0bf46d9..b570f89 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -36,7 +36,8 @@ class MouseHandler {
 private:
 	int s_s[12][6];
 	int _counter;
-
+	// TODO: Replace the following with proper implementations, or refactor out the code using them
+	int  _port[0xfff];
 public:
 	Common::Point _pos;
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index bb57ac0..8a3ecb8 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -37,6 +37,7 @@
 namespace Mortevielle {
 
 typedef unsigned char uchar;
+const byte _rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
 static int l_motsuiv(int p, const char *ch, int &tab) {
 	int c = p;
@@ -140,14 +141,14 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 	int totalLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (totalLength > 0) {
-		f.read(&g_mem[memIndx], 128);
+		f.read(&g_vm->_mem[memIndx], 128);
 		totalLength -= 128;
 		memIndx += 128;
 	}
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
-		g_mem[0x7000 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+		g_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
 }
 
 void charani(Common::String filename, int32 skipSize, int length) {
@@ -167,14 +168,14 @@ void charani(Common::String filename, int32 skipSize, int length) {
 	int fullLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (fullLength > 0) {
-		f.read(&g_mem[memIndx], 128);
+		f.read(&g_vm->_mem[memIndx], 128);
 		fullLength -= 128;
 		memIndx += 128;
 	}
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		g_mem[kAdrAni * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
+		g_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
 }
 
 void taffich() {
@@ -298,7 +299,7 @@ void taffich() {
 	chardes(filename, lgt, handle);
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
+			int palh = READ_LE_UINT16(&g_vm->_mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -306,7 +307,7 @@ void taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			g_mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
+			g_vm->_mem[(0x7000 * 16) + 2 + (k << 1)] = _rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 7d235cd..d8731f9 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -35,6 +35,28 @@
 
 namespace Mortevielle {
 
+const byte _tnocon[364] = {
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+const byte _intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
+const byte _typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
+const byte _tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
+const byte _tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
+
 SpeechManager::SpeechManager() {
 	_typlec = 0;
 	_phonemeNumb = 0;
@@ -53,7 +75,7 @@ void SpeechManager::spfrac(int wor) {
 }
 
 void SpeechManager::charg_car(int &currWordNumb) {
-	int wor = swap(READ_LE_UINT16(&g_mem[kAdrWord + currWordNumb]));
+	int wor = swap(READ_LE_UINT16(&g_vm->_mem[kAdrWord + currWordNumb]));
 	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -65,7 +87,7 @@ void SpeechManager::charg_car(int &currWordNumb) {
 	} else if ((int_ >= 22) && (int_ <= 47)) {
 		int_ = int_ - 22;
 		_queue[2]._val = int_;
-		_queue[2]._code = g_typcon[int_];
+		_queue[2]._code = _typcon[int_];
 	} else if ((int_ >= 48) && (int_ <= 56)) {
 		_queue[2]._val = int_ - 22;
 		_queue[2]._code = 4;
@@ -93,7 +115,7 @@ void SpeechManager::charg_car(int &currWordNumb) {
 
 
 void SpeechManager::entroct(byte o) {
-	g_mem[kAdrTroct * 16 + _ptr_oct] = o;
+	g_vm->_mem[kAdrTroct * 16 + _ptr_oct] = o;
 	++_ptr_oct;
 }
 
@@ -115,7 +137,7 @@ void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		_cfiphBuffer[j] = READ_LE_UINT16(&g_mem[kAdrNoise3 + i]);
+		_cfiphBuffer[j] = READ_LE_UINT16(&g_vm->_mem[kAdrNoise3 + i]);
 		i += 2;
 		++j;
 	} while (i < kOffsetB3 + 8790);
@@ -131,9 +153,9 @@ void SpeechManager::loadMusicSound() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 	
-	f.read(&g_mem[0x7414 * 16 + 0], 273);
+	f.read(&g_vm->_mem[0x7414 * 16 + 0], 273);
 
-	g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[kAdrNoise * 16], 273);
+	g_vm->_soundManager.decodeMusic(&g_vm->_mem[0x7414 * 16], &g_vm->_mem[kAdrNoise * 16], 273);
 	f.close();
 }
 
@@ -164,10 +186,10 @@ void SpeechManager::loadNoise() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&g_mem[kAdrNoise * 16 + 0], 250);
+	f.read(&g_vm->_mem[kAdrNoise * 16 + 0], 250);
 	for (i = 0; i <= 19013; ++i)
-		g_mem[kAdrNoise * 16 + 32000 + i] = g_mem[kAdrNoise5 + i];
-	f.read(&g_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
+		g_vm->_mem[kAdrNoise * 16 + 32000 + i] = g_vm->_mem[kAdrNoise5 + i];
+	f.read(&g_vm->_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
 
 	f.close();
 }
@@ -185,7 +207,7 @@ void SpeechManager::trait_car() {
 	case 5:
 	case 6:
 		if (_queue[1]._code == 6)
-			d3 = g_tabdph[(_queue[1]._val - 14) << 1];
+			d3 = _tabdph[(_queue[1]._val - 14) << 1];
 		else
 			d3 = kNullValue;
 		if (_queue[0]._code >= 5) {
@@ -315,7 +337,7 @@ void SpeechManager::trait_car() {
 		veracf(_queue[2]._acc);
 		if (_queue[2]._code == 6) {
 			entroct(4);
-			entroct(g_tabdph[(_queue[2]._val - 14) << 1]);
+			entroct(_tabdph[(_queue[2]._val - 14) << 1]);
 			entroct(_queue[1]._val);
 		} else {
 			entroct(4);
@@ -337,7 +359,7 @@ void SpeechManager::trait_car() {
 			d2 = 8;
 			break;
 		case 6:
-			d2 = g_tabdph[(_queue[2]._val - 14) << 1];
+			d2 = _tabdph[(_queue[2]._val - 14) << 1];
 			break;
 		case 5:
 			d2 = _queue[2]._val;
@@ -347,7 +369,7 @@ void SpeechManager::trait_car() {
 			break;
 		}       //  switch  c3._code
 		d2 = (d2 * 26) + _queue[1]._val;
-		if (g_tnocon[d2] == 0)
+		if (_tnocon[d2] == 0)
 			d3 = 2;
 		else
 			d3 = 6;
@@ -393,7 +415,7 @@ void SpeechManager::trait_car() {
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(_queue[2]._val - 14) << 1];
+				d2 = _tabdph[(_queue[2]._val - 14) << 1];
 				break;
 			case 5:
 				d2 = _queue[2]._val;
@@ -405,7 +427,7 @@ void SpeechManager::trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[_queue[1]._val] != 0)
+			if (_intcon[_queue[1]._val] != 0)
 				++_queue[1]._val;
 
 			if ((_queue[1]._val == 17) || (_queue[1]._val == 18))
@@ -442,7 +464,7 @@ void SpeechManager::trait_car() {
 				d2 = 8;
 				break;
 			case 6:
-				d2 = g_tabdph[(_queue[2]._val - 14) << 1];
+				d2 = _tabdph[(_queue[2]._val - 14) << 1];
 				break;
 			case 5:
 				d2 = _queue[2]._val;
@@ -455,12 +477,12 @@ void SpeechManager::trait_car() {
 			if (d2 == 4)
 				d2 = 3;
 
-			if (g_intcon[_queue[1]._val] != 0)
+			if (_intcon[_queue[1]._val] != 0)
 				++_queue[1]._val;
 
 			entroct(4);
 			entroct(d2);
-			entroct(g_tabdbc[((_queue[1]._val - 26) << 1) + 1]);
+			entroct(_tabdbc[((_queue[1]._val - 26) << 1) + 1]);
 		}
 	
 		break;
@@ -503,7 +525,7 @@ void SpeechManager::handlePhoneme() {
 	int endPos = swap(_cfiphBuffer[_phonemeNumb]) + deca[_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&g_mem[kAdrWord + currWord], _cfiphBuffer[i]);
+		WRITE_LE_UINT16(&g_vm->_mem[kAdrWord + currWord], _cfiphBuffer[i]);
 
 	_ptr_oct = 0;
 	int currWord = 0;
@@ -542,7 +564,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
-	g_vm->_addfix = (float)((tempo - g_addv[0])) / 256;
+	g_vm->_addfix = (float)((tempo - 8)) / 256;
 	cctable(_tbi);
 	switch (typ) {
 	case 1:
@@ -562,7 +584,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	if (_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
 			_cfiphBuffer[i] = savph[i];
-			g_mlec = _typlec;
+			_mlec = _typlec;
 		}
 	g_vm->setPal(g_vm->_numpal);
 }
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 9eccd04..6521fd9 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -75,6 +75,7 @@ private:
 public:
 	int _cfiphBuffer[6401];
 	int _tbi[256];
+	int _mlec;
 
 	SpeechManager();
 	void spfrac(int wor);
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index b6cc46c..6fc0593 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -34,35 +34,6 @@
 namespace Mortevielle {
 
 /*---------------------------------------------------------------------------*/
-/*------------------------------   CONSTANTS   ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-const byte g_tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-const byte g_tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
-const byte g_typcon[26] = {0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3};
-const byte g_intcon[26] = {1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0};
-const byte g_tnocon[364] = {
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-		0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-const byte g_addv[2] = {8, 8};
-
-const byte g_rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
-
-/*---------------------------------------------------------------------------*/
 /*------------------------------   VARIABLES   ------------------------------*/
 /*---------------------------------------------------------------------------*/
 
@@ -86,11 +57,8 @@ int g_x,
         g_iouv,
 		g_ctrm,
         g_dobj,
-        g_msg3,
-        g_msg4,
         g_mlec,
         g_mchai,
-        g_menup,
         g_mpers,
         g_perdep,
         g_prebru;
@@ -99,22 +67,6 @@ int g_x,
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
 /*---------------------------------------------------------------------------*/
 
-void hirs() {
-	// Note: The original used this to set the graphics mode and clear the screen, both at
-	// the start of the game, and whenever the screen need to be cleared. As such, this
-	// method is deprecated in favour of clearing the screen
-	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
-
-	g_vm->_screenSurface.clearScreen();
-}
-
-/*---------------------------------------------------------------------------*/
-/*------------------------------     STUBS     ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-int g_port[0xfff];
-byte g_mem[65536 * 16];
-
 void musyc(tablint &tb, int nbseg, int att) {
 	warning("TODO: musyc");
 }
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 26e4edd..9ac807a 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -101,19 +101,6 @@ enum places {
 	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
 
-extern const byte g_tabdbc[18];
-extern const byte g_tabdph[16];
-extern const byte g_typcon[26];
-extern const byte g_intcon[26];
-extern const byte g_tnocon[364];
-extern const byte g_addv[2];
-extern const byte g_rang[16];
-
-struct Hint {
-	int _hintId;
-	byte _point;
-};
-
 struct Rect {
 	int _x1, _x2, _y1, _y2;
 	bool _enabled;
@@ -152,30 +139,10 @@ extern int g_x,
         g_iouv,
 		g_ctrm,
         g_dobj,
-        g_msg3,
-        g_msg4,
-        g_mlec,
-        g_mchai,
-        g_menup,
         g_mpers,
         g_perdep,
         g_prebru;
 
-/*---------------------------------------------------------------------------*/
-/*-------------------   PROCEDURES  AND  FONCTIONS   ------------------------*/
-/*---------------------------------------------------------------------------*/
-
-void hirs();
-void Val(const Common::String &s, int &V, int Code);
-
-/*---------------------------------------------------------------------------*/
-/*------------------------------     STUBS     ------------------------------*/
-/*---------------------------------------------------------------------------*/
-// TODO: Replace the following with proper implementations, or refactor out the code using them
-
-extern int g_port[0xfff];
-extern byte g_mem[65536 * 16];
-
 } // End of namespace Mortevielle
 
 #endif


Commit: 2f0fd01184afc374e6047dcf2b37cbac5fb73ddc
    https://github.com/scummvm/scummvm/commit/2f0fd01184afc374e6047dcf2b37cbac5fb73ddc
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:45-07:00

Commit Message:
MORTEVIELLE: More renaming, add a piece of code to improve CGA/EGA switching

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/var_mor.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1c3314f..174af9f 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -44,7 +44,7 @@ namespace Mortevielle {
 void MortevielleEngine::fctMove() {
 	if ((_coreVar._currPlace == ROOM26) && (_msg[4] == _menu._moveMenu[6])) {
 		_coreVar._currPlace = LANDING;
-		g_caff = _coreVar._currPlace;
+		_caff = _coreVar._currPlace;
 		afdes();
 		repon(2, _coreVar._currPlace);
 	}
@@ -61,26 +61,26 @@ void MortevielleEngine::fctMove() {
 
 		tcoord(1);
 
-		if (g_num == 0)
+		if (_num == 0)
 			return;
 
-		if (g_num == 1) {
+		if (_num == 1) {
 			_coreVar._currPlace = OWN_ROOM;
 			_menu.setDestinationMenuText(OWN_ROOM);
-		} else if (g_num == 7) {
+		} else if (_num == 7) {
 			_coreVar._currPlace = ATTIC;
 			_menu.setDestinationMenuText(ATTIC);
 		}
 		
-		if (g_num != 6)
+		if (_num != 6)
 			_coreVar._currPlace = ROOM26;
 		
-		if ((g_num > 1) && (g_num < 6))
-			g_ment = g_num - 1;
-		else if (g_num > 7)
-			g_ment = g_num - 3;
+		if ((_num > 1) && (_num < 6))
+			_ment = _num - 1;
+		else if (_num > 7)
+			_ment = _num - 3;
 
-		if (g_num != 6)
+		if (_num != 6)
 			affrep();
 		else
 			showMoveMenuAlert();
@@ -160,11 +160,11 @@ void MortevielleEngine::fctMove() {
 		gotoManorBack();
 	else if (menuChoice == 17) {
 		if ((_coreVar._wellObjectId != 120) && (_coreVar._wellObjectId != 140))
-			g_crep = 997;
+			_crep = 997;
 		else if (_coreVar._wellObjectId == 120)
-			g_crep = 181;
+			_crep = 181;
 		else if (_coreVar._faithScore > 80) {
-			g_crep = 1505;
+			_crep = 1505;
 			loseGame();
 		} else {
 			_coreVar._currPlace = INSIDE_WELL;
@@ -182,19 +182,19 @@ void MortevielleEngine::fctMove() {
  * @remarks	Originally called 'tprendre'
  */
 void MortevielleEngine::fctTake() {
-	if (g_caff > 99) {
-		int cx = g_caff;
+	if (_caff > 99) {
+		int cx = _caff;
 		avpoing(cx);
-		if (g_crep != 139) {
+		if (_crep != 139) {
 			if (_currBitIndex > 0)
 				_coreVar._faithScore += 3;
 			if (_obpart) {
 				if (_coreVar._currPlace == PURPLE_ROOM)
 					_coreVar._purpleRoomObjectId = 0;
 				if (_coreVar._currPlace == ATTIC) {
-					if (_coreVar._atticBallHoleObjectId == g_caff)
+					if (_coreVar._atticBallHoleObjectId == _caff)
 						_coreVar._atticBallHoleObjectId = 0;
-					if (_coreVar._atticRodHoleObjectId == g_caff)
+					if (_coreVar._atticRodHoleObjectId == _caff)
 						_coreVar._atticRodHoleObjectId = 0;
 				}
 				if (_coreVar._currPlace == CELLAR)
@@ -209,12 +209,12 @@ void MortevielleEngine::fctTake() {
 				_obpart = false;
 				affrep();
 			} else {
-				_tabdon[kAcha + ((_mchai - 1) * 10) + g_cs - 1] = 0;
+				_tabdon[kAcha + ((_mchai - 1) * 10) + _cs - 1] = 0;
 				tsuiv();
-				++g_dobj;
-				if (g_dobj > 6) {
+				++_dobj;
+				if (_dobj > 6) {
 					_coreVar._faithScore += 2;
-					g_dobj = 0;
+					_dobj = 0;
 				}
 			}
 		}
@@ -225,35 +225,35 @@ void MortevielleEngine::fctTake() {
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
-	if (g_caff == 3) {
+	if (_caff == 3) {
 		tcoord(2);
-		if (g_num == 1) {
-			g_crep = 152;
+		if (_num == 1) {
+			_crep = 152;
 			return;
 		}
 	}
 	tcoord(5);
-	if ((g_num == 0) || ((g_num == 1) && (_coreVar._currPlace == CRYPT))) {
+	if ((_num == 0) || ((_num == 1) && (_coreVar._currPlace == CRYPT))) {
 		tcoord(8);
-		if (g_num != 0) {
+		if (_num != 0) {
 			if (_currBitIndex > 0)
 				_coreVar._faithScore += 3;
-			g_crep = 997;
+			_crep = 997;
 			if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
 				avpoing(_coreVar._purpleRoomObjectId);
-			if ((_coreVar._currPlace == ATTIC) && (g_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
+			if ((_coreVar._currPlace == ATTIC) && (_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
 				avpoing(_coreVar._atticBallHoleObjectId);
-				if ((g_crep != 997) && (g_crep != 139))
+				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 7);
 			}
-			if ((_coreVar._currPlace == ATTIC) && (g_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
+			if ((_coreVar._currPlace == ATTIC) && (_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
 				avpoing(_coreVar._atticRodHoleObjectId);
-				if ((g_crep != 997) && (g_crep != 139))
+				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 6);
 			}
 			if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
 				avpoing(_coreVar._cellarObjectId);
-				if ((g_crep != 997) && (g_crep != 139))
+				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 2);
 			}
 			if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
@@ -261,40 +261,40 @@ void MortevielleEngine::fctTake() {
 
 			if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId != 0)) {
 				avpoing(_coreVar._secretPassageObjectId);
-				if ((g_crep != 997) && (g_crep != 139)) {
-					g_crep = 182;
+				if ((_crep != 997) && (_crep != 139)) {
+					_crep = 182;
 					aniof(2, 1);
 				}
 			}
 			if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
 				avpoing(_coreVar._wellObjectId);
-				if ((g_crep != 997) && (g_crep != 139))
+				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 1);
 			}
-			if ((g_crep != 997) && (g_crep != 182) && (g_crep != 139))
-				g_crep = 999;
+			if ((_crep != 997) && (_crep != 182) && (_crep != 139))
+				_crep = 999;
 		}
 	} else {
-		if ( ((_coreVar._currPlace == OWN_ROOM)  && (g_num == 3))
-		  || ((_coreVar._currPlace == GREEN_ROOM)  && (g_num == 4))
-		  || ((_coreVar._currPlace == PURPLE_ROOM)  && (g_num == 1))
-		  || ((_coreVar._currPlace == DARKBLUE_ROOM)  && (g_num == 3))
-		  || ((_coreVar._currPlace == BLUE_ROOM)  && (g_num == 6))
-		  || ((_coreVar._currPlace == RED_ROOM)  && (g_num == 2))
-		  || ((_coreVar._currPlace == BATHROOM)  && (g_num == 6))
-		  || ((_coreVar._currPlace == GREEN_ROOM2)  && (g_num == 4))
-		  || ((_coreVar._currPlace == ROOM9) && (g_num == 4))
-		  || ((_coreVar._currPlace == DINING_ROOM) && (g_num > 2))
-		  || ((_coreVar._currPlace == BUREAU) && (g_num == 7))
-		  || ((_coreVar._currPlace == KITCHEN) && (g_num == 6))
-		  || ((_coreVar._currPlace == ATTIC) && (g_num > 4))
+		if ( ((_coreVar._currPlace == OWN_ROOM)  && (_num == 3))
+		  || ((_coreVar._currPlace == GREEN_ROOM)  && (_num == 4))
+		  || ((_coreVar._currPlace == PURPLE_ROOM)  && (_num == 1))
+		  || ((_coreVar._currPlace == DARKBLUE_ROOM)  && (_num == 3))
+		  || ((_coreVar._currPlace == BLUE_ROOM)  && (_num == 6))
+		  || ((_coreVar._currPlace == RED_ROOM)  && (_num == 2))
+		  || ((_coreVar._currPlace == BATHROOM)  && (_num == 6))
+		  || ((_coreVar._currPlace == GREEN_ROOM2)  && (_num == 4))
+		  || ((_coreVar._currPlace == ROOM9) && (_num == 4))
+		  || ((_coreVar._currPlace == DINING_ROOM) && (_num > 2))
+		  || ((_coreVar._currPlace == BUREAU) && (_num == 7))
+		  || ((_coreVar._currPlace == KITCHEN) && (_num == 6))
+		  || ((_coreVar._currPlace == ATTIC) && (_num > 4))
 		  || ((_coreVar._currPlace > ATTIC) && (_coreVar._currPlace != INSIDE_WELL)) )
-		  g_crep = 997;
+		  _crep = 997;
 		else if (_coreVar._currPlace == INSIDE_WELL) {
-			g_crep = 1504;
+			_crep = 1504;
 			loseGame();
 		} else
-			g_crep = 120;
+			_crep = 120;
 	}
 }
 /**
@@ -319,7 +319,7 @@ void MortevielleEngine::fctInventoryTake() {
 	_coreVar._sjer[cy] = chr(0);
 	modinv();
 	avpoing(cz);
-	g_crep = 998;
+	_crep = 998;
 	clearScreenType2();
 }
 
@@ -334,12 +334,12 @@ void MortevielleEngine::fctLift() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(3);
-	if (g_num == 0) {
+	if (_num == 0) {
 		tcoord(8);
-		if (g_num != 0) {
+		if (_num != 0) {
 			if (_currBitIndex > 0)
 				++_coreVar._faithScore;
-			g_crep = 997;
+			_crep = 997;
 			if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
 				treg(_coreVar._purpleRoomObjectId);
 		}
@@ -352,9 +352,9 @@ void MortevielleEngine::fctLift() {
 		tmpPlace = 14;
 	else if (_coreVar._currPlace == MOUNTAIN)
 		tmpPlace = 15;
-	g_crep = _tabdon[asoul + (tmpPlace << 3) + (g_num - 1)];
-	if (g_crep == 255)
-		g_crep = 997;
+	_crep = _tabdon[asoul + (tmpPlace << 3) + (_num - 1)];
+	if (_crep == 255)
+		_crep = 997;
 }
 
 /**
@@ -362,16 +362,16 @@ void MortevielleEngine::fctLift() {
  * @remarks	Originally called 'tlire'
  */
 void MortevielleEngine::fctRead() {
-	if (g_caff > 99)
-		st4(g_caff);
+	if (_caff > 99)
+		st4(_caff);
 	else {
 		if (!_syn)
 			ecr3(getEngineString(S_READ));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			tcoord(4);
-			if (g_num != 0)
-				g_crep = 107;
+			if (_num != 0)
+				_crep = 107;
 		}
 	}
 }
@@ -382,7 +382,7 @@ void MortevielleEngine::fctRead() {
  */
 void MortevielleEngine::fctSelfRead() {
 	if (_coreVar._selectedObjectId == 0)
-		g_crep = 186;
+		_crep = 186;
 	else
 		st4(_coreVar._selectedObjectId);
 }
@@ -394,8 +394,8 @@ void MortevielleEngine::fctSelfRead() {
 void MortevielleEngine::fctLook() {
 	int cx;
 
-	if (g_caff > 99) {
-		g_crep = 103;
+	if (_caff > 99) {
+		_crep = 103;
 		return;
 	}
 	if (!_syn)
@@ -404,35 +404,35 @@ void MortevielleEngine::fctLook() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(5);
-	if (g_num == 0) {
+	if (_num == 0) {
 		tcoord(8);
-		g_crep = 131;
-		if (g_num != 0) {
+		_crep = 131;
+		if (_num != 0) {
 			if (_coreVar._currPlace == ATTIC) {
-				if (g_num == 1) {
-					g_crep = 164;
+				if (_num == 1) {
+					_crep = 164;
 					if (_coreVar._atticRodHoleObjectId != 0)
 						treg(_coreVar._atticRodHoleObjectId);
 					else if (_coreVar._atticBallHoleObjectId != 0)
 						treg(_coreVar._atticBallHoleObjectId);
 				} else {
-					g_crep = 193;
+					_crep = 193;
 					if (_coreVar._atticRodHoleObjectId != 0)
 						treg(_coreVar._atticRodHoleObjectId);
 				}
 			}
 			if (_coreVar._currPlace == CELLAR) {
-				g_crep = 164;
+				_crep = 164;
 				if (_coreVar._cellarObjectId != 0)
 					treg(_coreVar._cellarObjectId);
 			}
 			if (_coreVar._currPlace == SECRET_PASSAGE) {
-				g_crep = 174;
+				_crep = 174;
 				if (_coreVar._secretPassageObjectId != 0)
 					treg(_coreVar._secretPassageObjectId);
 			}
 			if (_coreVar._currPlace == WELL) {
-				g_crep = 131;
+				_crep = 131;
 				if (_coreVar._wellObjectId != 0)
 					treg(_coreVar._wellObjectId);
 			}
@@ -446,22 +446,22 @@ void MortevielleEngine::fctLook() {
 		cx -= 4;
 	if (_coreVar._currPlace == ROOM26)
 		cx = 21;
-	g_crep = _tabdon[arega + (cx * 7) + g_num - 1];
-	if ((_coreVar._currPlace == ATTIC) && (g_num == 8))
-		g_crep = 126;
+	_crep = _tabdon[arega + (cx * 7) + _num - 1];
+	if ((_coreVar._currPlace == ATTIC) && (_num == 8))
+		_crep = 126;
 	if (_coreVar._currPlace == MOUNTAIN)
-		g_crep = 103;
-	if (g_crep == 255)
-		g_crep = 131;
-	if ((_coreVar._currPlace == GREEN_ROOM) && (g_num == 1))
+		_crep = 103;
+	if (_crep == 255)
+		_crep = 131;
+	if ((_coreVar._currPlace == GREEN_ROOM) && (_num == 1))
 		treg(144);
-	if ((_coreVar._currPlace == BLUE_ROOM) && (g_num == 3))
+	if ((_coreVar._currPlace == BLUE_ROOM) && (_num == 3))
 		treg(147);
-	if ((_coreVar._currPlace == GREEN_ROOM2) && (g_num == 3))
+	if ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 3))
 		treg(149);
-	if ((_coreVar._currPlace == 9) && (g_num == 2))
+	if ((_coreVar._currPlace == 9) && (_num == 2))
 		treg(30);
-	if ((_coreVar._currPlace == DINING_ROOM) && (g_num == 3))
+	if ((_coreVar._currPlace == DINING_ROOM) && (_num == 3))
 		treg(31);
 }
 
@@ -473,7 +473,7 @@ void MortevielleEngine::fctSelftLook() {
 	if (_coreVar._selectedObjectId != 0)
 		treg(_coreVar._selectedObjectId);
 	else
-		g_crep = 186;
+		_crep = 186;
 }
 
 /**
@@ -483,8 +483,8 @@ void MortevielleEngine::fctSelftLook() {
 void MortevielleEngine::fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
-	if (g_caff > 99) {
-		st7(g_caff);
+	if (_caff > 99) {
+		st7(_caff);
 		return;
 	}
 
@@ -496,49 +496,49 @@ void MortevielleEngine::fctSearch() {
 		return;
 
 	if (_coreVar._currPlace == INSIDE_WELL) {
-		g_crep = 1504;
+		_crep = 1504;
 		loseGame();
 		return;
 	}
 
 	tcoord(6);
-	if (g_num == 0) {
+	if (_num == 0) {
 		tcoord(7);
-		if (g_num != 0) {
+		if (_num != 0) {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(_touv[cx])));
-			if (g_num != ord(_touv[cx]))
-				g_crep = 187;
+			} while ((cx <= 6) && (_num != ord(_touv[cx])));
+			if (_num != ord(_touv[cx]))
+				_crep = 187;
 			else {
 				if (_currBitIndex > 0)
 					_coreVar._faithScore += 3;
 
 				rechai(_mchai);
 				if (_mchai != 0) {
-					g_cs = 0;
-					g_is = 0;
+					_cs = 0;
+					_is = 0;
 					_heroSearching = true;
 					_menu.setSearchMenu();
 					tsuiv();
 				} else
-					g_crep = 997;
+					_crep = 997;
 			}
 		} else {
 			tcoord(8);
-			g_crep = 997;
-			if (g_num != 0) {
+			_crep = 997;
+			if (_num != 0) {
 				if (_currBitIndex > 0)
 					_coreVar._faithScore += 3;
 				if ((_coreVar._currPlace != WELL) && (_coreVar._currPlace != SECRET_PASSAGE) && (_coreVar._currPlace != ATTIC)) {
 					if (_coreVar._currPlace == PURPLE_ROOM) {
-						g_crep = 123;
+						_crep = 123;
 						if (_coreVar._purpleRoomObjectId != 0)
 							treg(_coreVar._purpleRoomObjectId);
 					}
 					if (_coreVar._currPlace == CRYPT) {
-						g_crep = 123;
+						_crep = 123;
 						if (_coreVar._cryptObjectId != 0)
 							treg(_coreVar._cryptObjectId);
 					}
@@ -548,24 +548,24 @@ void MortevielleEngine::fctSearch() {
 	} else {
 		if (_currBitIndex > 0)
 			_coreVar._faithScore += 3;
-		g_crep = 997;
+		_crep = 997;
 		if (_coreVar._currPlace < CELLAR)
-			g_crep = r[_coreVar._currPlace];
+			_crep = r[_coreVar._currPlace];
 
-		if ((_coreVar._currPlace == TOILETS) && (g_num == 2))
-			g_crep = 162;
+		if ((_coreVar._currPlace == TOILETS) && (_num == 2))
+			_crep = 162;
 
 		if (_coreVar._currPlace == KITCHEN) {
-			if ((g_num == 3) || (g_num == 4))
-				g_crep = 162;
-			else if (g_num == 5)
-				g_crep = 159;
+			if ((_num == 3) || (_num == 4))
+				_crep = 162;
+			else if (_num == 5)
+				_crep = 159;
 		}
 
 		if (_coreVar._currPlace == MOUNTAIN)
-			g_crep = 104;
+			_crep = 104;
 		else if (_coreVar._currPlace == CRYPT)
-			g_crep = 155;
+			_crep = 155;
 	}
 }
 
@@ -577,7 +577,7 @@ void MortevielleEngine::fctSelfSearch() {
 	if (_coreVar._selectedObjectId != 0)
 		st7(_coreVar._selectedObjectId);
 	else
-		g_crep = 186;
+		_crep = 186;
 }
 
 /**
@@ -588,16 +588,16 @@ void MortevielleEngine::fctOpen() {
 	if (!_syn)
 		ecr3(getEngineString(S_OPEN));
 
-	if (g_caff == ROOM26) {
-		if (g_ment != 0) {
+	if (_caff == ROOM26) {
+		if (_ment != 0) {
 			_msg[4] = OPCODE_ENTER;
 			_syn = true;
 		} else
-			g_crep = 997;
+			_crep = 997;
 		return;
 	}
 
-	if (g_caff == 15) {
+	if (_caff == 15) {
 		showMoveMenuAlert();
 		return;
 	}
@@ -607,38 +607,38 @@ void MortevielleEngine::fctOpen() {
 		return;
 
 	tcoord(7);
-	if (g_num != 0) {
+	if (_num != 0) {
 		if (_currBitIndex > 0)
 			_coreVar._faithScore += 2;
-		++g_iouv;
+		++_iouv;
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
-		} while (!((tmpPlace > 6) || (ord(_touv[tmpPlace]) == 0) || (ord(_touv[tmpPlace]) == g_num)));
-		if (ord(_touv[tmpPlace]) != g_num) {
-			if (!( ((g_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == 9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
-			    || ((g_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
-				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (g_num == 5))
-				|| ((g_num == 6) && ((_coreVar._currPlace == BATHROOM) || (_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == GREEN_ROOM2) || (_coreVar._currPlace == ATTIC)))
-				|| ((_coreVar._currPlace == GREEN_ROOM2) && (g_num == 2))
-				|| ((_coreVar._currPlace == KITCHEN) && (g_num == 7))) ) {
+		} while (!((tmpPlace > 6) || (ord(_touv[tmpPlace]) == 0) || (ord(_touv[tmpPlace]) == _num)));
+		if (ord(_touv[tmpPlace]) != _num) {
+			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == 9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
+			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
+				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (_num == 5))
+				|| ((_num == 6) && ((_coreVar._currPlace == BATHROOM) || (_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == GREEN_ROOM2) || (_coreVar._currPlace == ATTIC)))
+				|| ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 2))
+				|| ((_coreVar._currPlace == KITCHEN) && (_num == 7))) ) {
 				if ( ((_coreVar._currPlace > DINING_ROOM) && (_coreVar._currPlace < CELLAR))
 				  || ((_coreVar._currPlace > RED_ROOM) && (_coreVar._currPlace < DINING_ROOM))
 				  || (_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
 						_speechManager.startSpeech(7, 9, 1);
 				}
-				_touv[tmpPlace] = chr(g_num);
-				aniof(1, g_num);
+				_touv[tmpPlace] = chr(_num);
+				aniof(1, _num);
 			}
 			tmpPlace = _coreVar._currPlace;
 			if (_coreVar._currPlace == CRYPT)
 				tmpPlace = CELLAR;
-			g_crep = _tabdon[aouvr + (tmpPlace * 7) + g_num - 1];
-			if (g_crep == 254)
-				g_crep = 999;
+			_crep = _tabdon[aouvr + (tmpPlace * 7) + _num - 1];
+			if (_crep == 254)
+				_crep = 999;
 		} else
-			g_crep = 18;
+			_crep = 18;
 	}
 }
 
@@ -648,7 +648,7 @@ void MortevielleEngine::fctOpen() {
  */
 void MortevielleEngine::fctPlace() {
 	if (_coreVar._selectedObjectId == 0) {
-		g_crep = 186;
+		_crep = 186;
 		return;
 	}
 
@@ -657,25 +657,25 @@ void MortevielleEngine::fctPlace() {
 
 	tfleche();
 	if (_keyPressedEsc)
-		g_crep = 998;
+		_crep = 998;
 
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 
 	tcoord(8);
-	if (g_num != 0) {
-		g_crep = 999;
-		if (g_caff == 13) {
-			if (g_num == 1) {
+	if (_num != 0) {
+		_crep = 999;
+		if (_caff == 13) {
+			if (_num == 1) {
 				if (_coreVar._atticBallHoleObjectId != 0) {
-					g_crep = 188;
+					_crep = 188;
 				} else {
 					_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
 					if (_coreVar._selectedObjectId == 141)
 						aniof(1, 7);
 				}
 			} else if (_coreVar._atticRodHoleObjectId != 0) {
-				g_crep = 188;
+				_crep = 188;
 			} else {
 				_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 159)
@@ -683,9 +683,9 @@ void MortevielleEngine::fctPlace() {
 			}
 		}
 
-		if (g_caff == 14) {
+		if (_caff == 14) {
 			if (_coreVar._cellarObjectId != 0) {
-				g_crep = 188;
+				_crep = 188;
 			} else {
 				_coreVar._cellarObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 151) {
@@ -729,49 +729,49 @@ void MortevielleEngine::fctPlace() {
 							alertTxt = getString(577);
 							Alert::show(alertTxt, 1);
 							aniof(2, 1);
-							g_crep = 166;
+							_crep = 166;
 						}
 						affrep();
 					} else {
 						aniof(2, 1);
-						g_crep = 166;
+						_crep = 166;
 					}
 					return;
 				}
 			}
 		}
 
-		if (g_caff == 16) {
+		if (_caff == 16) {
 			if (_coreVar._cryptObjectId == 0)
 				_coreVar._cryptObjectId = _coreVar._selectedObjectId;
 			else
-				g_crep = 188;
+				_crep = 188;
 		}
 
-		if (g_caff == 17) {
+		if (_caff == 17) {
 			if (_coreVar._secretPassageObjectId != 0) {
-				g_crep = 188;
+				_crep = 188;
 			} else if (_coreVar._selectedObjectId == 143) {
 				_coreVar._secretPassageObjectId = 143;
 				aniof(1, 1);
 			} else {
-				g_crep = 1512;
+				_crep = 1512;
 				loseGame();
 			}
 		}
 
-		if (g_caff == 24) {
+		if (_caff == 24) {
 			if (_coreVar._wellObjectId != 0) {
-				g_crep = 188;
+				_crep = 188;
 			} else if ((_coreVar._selectedObjectId == 140) || (_coreVar._selectedObjectId == 120)) {
 				_coreVar._wellObjectId = _coreVar._selectedObjectId;
 				aniof(1, 1);
 			} else {
-				g_crep = 185;
+				_crep = 185;
 			}
 		}
 
-		if (g_crep != 188)
+		if (_crep != 188)
 			maivid();
 	}
 }
@@ -781,8 +781,8 @@ void MortevielleEngine::fctPlace() {
  * @remarks	Originally called 'ttourner'
  */
 void MortevielleEngine::fctTurn() {
-	if (g_caff > 99) {
-		g_crep = 149;
+	if (_caff > 99) {
+		_crep = 149;
 		return;
 	}
 	if (!_syn)
@@ -791,8 +791,8 @@ void MortevielleEngine::fctTurn() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	tcoord(9);
-	if (g_num != 0) {
-		g_crep = 997;
+	if (_num != 0) {
+		_crep = 997;
 		if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
 			repon(2, 167);
 			_speechManager.startSpeech(7, 9, 1);
@@ -800,7 +800,7 @@ void MortevielleEngine::fctTurn() {
 			if (answer == 1)
 				_endGame = true;
 			else
-				g_crep = 168;
+				_crep = 168;
 		}
 		if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143)) {
 			repon(2, 175);
@@ -811,7 +811,7 @@ void MortevielleEngine::fctTurn() {
 				_coreVar._currPlace = CRYPT;
 				affrep();
 			} else
-				g_crep = 176;
+				_crep = 176;
 		}
 	}
 }
@@ -826,11 +826,11 @@ void MortevielleEngine::fctSelfHide() {
 	tfleche();
 	if (!(_anyone) && !(_keyPressedEsc)) {
 		tcoord(10);
-		if (g_num == 0)
+		if (_num == 0)
 			_hiddenHero = false;
 		else {
 			_hiddenHero = true;
-			g_crep = 999;
+			_crep = 999;
 		}
 	}
 }
@@ -841,21 +841,21 @@ void MortevielleEngine::fctSelfHide() {
  */
 void MortevielleEngine::fctAttach() {
 	if (_coreVar._selectedObjectId == 0)
-		g_crep = 186;
+		_crep = 186;
 	else {
 		if (!_syn)
 			ecr3(getEngineString(S_TIE));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			tcoord(8);
-			g_crep = 997;
-			if ((g_num != 0) && (_coreVar._currPlace == WELL)) {
-				g_crep = 999;
+			_crep = 997;
+			if ((_num != 0) && (_coreVar._currPlace == WELL)) {
+				_crep = 999;
 				if ((_coreVar._selectedObjectId == 120) || (_coreVar._selectedObjectId == 140)) {
 					_coreVar._wellObjectId = _coreVar._selectedObjectId;
 					aniof(1, 1);
 				} else
-					g_crep = 185;
+					_crep = 185;
 				maivid();
 			}
 		}
@@ -870,36 +870,36 @@ void MortevielleEngine::fctClose() {
 	if (!_syn)
 		ecr3(getEngineString(S_CLOSE));
 
-	if (g_caff < ROOM26) {
+	if (_caff < ROOM26) {
 		tfleche();
 		if (_keyPressedEsc)
-			g_crep = 998;
+			_crep = 998;
 		if ((_anyone) || (_keyPressedEsc))
 			return;
 		tcoord(7);
-		if (g_num != 0) {
+		if (_num != 0) {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (g_num != ord(_touv[cx])));
-			if (g_num == ord(_touv[cx])) {
-				aniof(2, g_num);
-				g_crep = 998;
+			} while ((cx <= 6) && (_num != ord(_touv[cx])));
+			if (_num == ord(_touv[cx])) {
+				aniof(2, _num);
+				_crep = 998;
 				_touv[cx] = chr(0);
-				--g_iouv;
-				if (g_iouv < 0)
-					g_iouv = 0;
+				--_iouv;
+				if (_iouv < 0)
+					_iouv = 0;
 				int chai = 9999;
 				rechai(chai);
 				if (_mchai == chai)
 					_mchai = 0;
 			} else {
-				g_crep = 187;
+				_crep = 187;
 			}
 		}
 	}
-	if (g_caff == ROOM26)
-		g_crep = 999;
+	if (_caff == ROOM26)
+		_crep = 999;
 }
 
 /**
@@ -919,9 +919,9 @@ void MortevielleEngine::fctKnock() {
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			if ((_coreVar._currPlace < MOUNTAIN) && (_coreVar._currPlace != LANDING))
-				g_crep = 133;
+				_crep = 133;
 			else
-				g_crep = 997;
+				_crep = 997;
 		}
 
 		return;
@@ -931,12 +931,12 @@ void MortevielleEngine::fctKnock() {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		_speechManager.startSpeech(11, rand, 1);
 		int p;
-		ecfren(p, rand, _coreVar._faithScore, g_ment);
-		int l = g_ment;
+		ecfren(p, rand, _coreVar._faithScore, _ment);
+		int l = _ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (rand > p)
-					g_crep = 190;
+					_crep = 190;
 				else {
 					becfren(l);
 					getKnockAnswer();
@@ -945,8 +945,8 @@ void MortevielleEngine::fctKnock() {
 				getKnockAnswer();
 		}
 
-		if (g_ment == 8)
-			g_crep = 190;
+		if (_ment == 8)
+			_crep = 190;
 	}
 }
 
@@ -958,12 +958,12 @@ void MortevielleEngine::fctSelfPut() {
 	if (!_syn)
 		ecr3(getEngineString(S_POSE));
 	if (_coreVar._selectedObjectId == 0)
-		g_crep = 186;
+		_crep = 186;
 	else {
-		if (g_caff > 99) {
-			g_crep = 999;
+		if (_caff > 99) {
+			_crep = 999;
 			ajchai();
-			if (g_crep != 192)
+			if (_crep != 192)
 				maivid();
 			return;
 		}
@@ -971,74 +971,74 @@ void MortevielleEngine::fctSelfPut() {
 		if ((_anyone) || (_keyPressedEsc))
 			return;
 		tcoord(7);
-		g_crep = 124;
-		if (g_num != 0) {
+		_crep = 124;
+		if (_num != 0) {
 			int chai;
 			rechai(chai);
 			if (chai == 0)
-				g_crep = 997;
+				_crep = 997;
 			else {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (g_num != ord(_touv[cx])));
-				if (g_num != ord(_touv[cx]))
-					g_crep = 187;
+				} while ((cx <= 6) && (_num != ord(_touv[cx])));
+				if (_num != ord(_touv[cx]))
+					_crep = 187;
 				else {
 					_mchai = chai;
-					g_crep = 999;
+					_crep = 999;
 				}
 			}
 		} else {
 			tcoord(8);
-			if (g_num != 0) {
-				g_crep = 998;
-				if (g_caff == PURPLE_ROOM) {
+			if (_num != 0) {
+				_crep = 998;
+				if (_caff == PURPLE_ROOM) {
 					if (_coreVar._purpleRoomObjectId != 0)
-						g_crep = 188;
+						_crep = 188;
 					else
 						_coreVar._purpleRoomObjectId = _coreVar._selectedObjectId;
 				}
 
-				if (g_caff == ATTIC) {
-					if (g_num == 1) {
+				if (_caff == ATTIC) {
+					if (_num == 1) {
 						if (_coreVar._atticBallHoleObjectId != 0)
-							g_crep = 188;
+							_crep = 188;
 						else
 							_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
 					} else if (_coreVar._atticRodHoleObjectId != 0) {
-						g_crep = 188;
+						_crep = 188;
 					} else {
 						_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
 					}
 				}
 
-				if (g_caff == CRYPT) {
+				if (_caff == CRYPT) {
 					if (_coreVar._cryptObjectId != 0)
-						g_crep = 188;
+						_crep = 188;
 					else
 						_coreVar._cryptObjectId = _coreVar._selectedObjectId;
 				}
 
-				if (g_caff == WELL)
-					g_crep = 185;
-				if ((g_caff == CELLAR) || (g_caff == SECRET_PASSAGE))
-					g_crep = 124;
+				if (_caff == WELL)
+					_crep = 185;
+				if ((_caff == CELLAR) || (_caff == SECRET_PASSAGE))
+					_crep = 124;
 			} else {
-				g_crep = 124;
-				if (g_caff == WELL) {
+				_crep = 124;
+				if (_caff == WELL) {
 					tcoord(5);
-					if (g_num != 0)
-						g_crep = 185;
+					if (_num != 0)
+						_crep = 185;
 				}
 			}
 		}
-		if (g_caff == INSIDE_WELL)
-			g_crep = 185;
-		if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
-			if (g_crep == 999)
+		if (_caff == INSIDE_WELL)
+			_crep = 185;
+		if ((_crep == 999) || (_crep == 185) || (_crep == 998)) {
+			if (_crep == 999)
 				ajchai();
-			if (g_crep != 192)
+			if (_crep != 192)
 				maivid();
 		}
 	}
@@ -1050,17 +1050,17 @@ void MortevielleEngine::fctSelfPut() {
  */
 void MortevielleEngine::fctListen() {
 	if (_coreVar._currPlace != ROOM26)
-		g_crep = 101;
+		_crep = 101;
 	else {
 		if (_currBitIndex != 0)
 			++_coreVar._faithScore;
 		int p, rand;
-		ecfren(p, rand, _coreVar._faithScore, g_ment);
-		int l = g_ment;
+		ecfren(p, rand, _coreVar._faithScore, _ment);
+		int l = _ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (rand > p)
-					g_crep = 101;
+					_crep = 101;
 				else {
 					becfren(l);
 					int j, h, m;
@@ -1068,16 +1068,16 @@ void MortevielleEngine::fctListen() {
 					rand = getRandomNumber(1, 100);
 					if ((h >= 0) && (h < 8)) {
 						if (rand > 30)
-							g_crep = 101;
+							_crep = 101;
 						else
-							g_crep = 178;
+							_crep = 178;
 					} else if (rand > 70)
-						g_crep = 101;
+						_crep = 101;
 					else
-						g_crep = 178;
+						_crep = 178;
 				}
 			} else
-				g_crep = 178;
+				_crep = 178;
 		}
 	}
 }
@@ -1088,11 +1088,11 @@ void MortevielleEngine::fctListen() {
  */
 void MortevielleEngine::fctEat() {
 	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
-		g_crep = 148;
+		_crep = 148;
 	} else {
 		tsort();
 		_coreVar._currPlace = DINING_ROOM;
-		g_caff = 10;
+		_caff = 10;
 		debloc(_coreVar._currPlace);
 		_menu.setDestinationMenuText(_coreVar._currPlace);
 
@@ -1114,11 +1114,11 @@ void MortevielleEngine::fctEat() {
 					h = 1;
 			}
 			
-			g_jh += h;
-			g_crep = 135;
+			_jh += h;
+			_crep = 135;
 			prepareRoom();
 		} else {
-			g_crep = 134;
+			_crep = 134;
 		}
 	}
 }
@@ -1133,50 +1133,50 @@ void MortevielleEngine::fctEnter() {
 		_menu.setDestinationMenuText(_coreVar._currPlace);
 	} else if (_coreVar._currPlace == LANDING)
 		showMoveMenuAlert();
-	else if (g_ment == 0)
-		g_crep = 997;
-	else if ((g_ment == 9) && (_coreVar._selectedObjectId != 136)) {
-			g_crep = 189;
+	else if (_ment == 0)
+		_crep = 997;
+	else if ((_ment == 9) && (_coreVar._selectedObjectId != 136)) {
+			_crep = 189;
 			_coreVar._teauto[8] = '*';
 	} else {
 		int z = 0;
 		if (!_blo)
-			z = t11(g_ment);
+			z = t11(_ment);
 		if (z != 0) {
-			if ((g_ment == 3) || (g_ment == 7))
-				g_crep = 179;
+			if ((_ment == 3) || (_ment == 7))
+				_crep = 179;
 			else {
-				g_x = (getRandomNumber(0, 10)) - 5;
-				_speechManager.startSpeech(7, g_x, 1);
+				_x = (getRandomNumber(0, 10)) - 5;
+				_speechManager.startSpeech(7, _x, 1);
 				aniof(1, 1);
 				
-				g_x = convertBitIndexToCharacterIndex(z);
+				_x = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
 				_msg[3] = MENU_DISCUSS;
-				_msg[4] = _menu._discussMenu[g_x];
+				_msg[4] = _menu._discussMenu[_x];
 				_syn = true;
-				if (g_ment == 9) {
+				if (_ment == 9) {
 					_col = true;
-					g_caff = 70;
+					_caff = 70;
 					afdes();
-					repon(2, g_caff);
+					repon(2, _caff);
 				} else
 					_col = false;
-				debloc(g_ment);
-				g_ment = 0;
+				debloc(_ment);
+				_ment = 0;
 			}
 		} else {
-			g_x = (getRandomNumber(0, 10)) - 5;
-			_speechManager.startSpeech(7, g_x, 1);
+			_x = (getRandomNumber(0, 10)) - 5;
+			_speechManager.startSpeech(7, _x, 1);
 			aniof(1, 1);
 			
-			_coreVar._currPlace = g_ment;
+			_coreVar._currPlace = _ment;
 			affrep();
 			debloc(_coreVar._currPlace);
 			_menu.setDestinationMenuText(_coreVar._currPlace);
-			g_ment = 0;
-			g_mpers = 0;
+			_ment = 0;
+			_savedBitIndex = 0;
 			_currBitIndex = 0;
 		}
 	}
@@ -1190,7 +1190,7 @@ void MortevielleEngine::fctSleep() {
 	int z, j, h, m;
 
 	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
-		g_crep = 148;
+		_crep = 148;
 		return;
 	}
 	if (_coreVar._currPlace != OWN_ROOM) {
@@ -1214,10 +1214,10 @@ void MortevielleEngine::fctSleep() {
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
-			g_jh += z;
+			_jh += z;
 			h = 7;
 		}
-		g_jh += 2;
+		_jh += 2;
 		++h;
 		if (h > 23)
 			h = 0;
@@ -1225,8 +1225,8 @@ void MortevielleEngine::fctSleep() {
 		answer = Alert::show(getEngineString(S_YES_NO), 1);
 		_anyone = false;
 	} while (answer != 1);
-	g_crep = 998;
-	g_num = 0;
+	_crep = 998;
+	_num = 0;
 }
 
 /**
@@ -1236,14 +1236,14 @@ void MortevielleEngine::fctSleep() {
 void MortevielleEngine::fctForce() {
 	if (!_syn)
 		ecr3(getEngineString(S_SMASH));
-	if (g_caff < 25)
+	if (_caff < 25)
 		tfleche();
 
 	if ((!_anyone) && (!_keyPressedEsc)) {
 		if (_coreVar._currPlace != ROOM26)
-			g_crep = 997;
+			_crep = 997;
 		else {
-			g_crep = 143;
+			_crep = 143;
 			_coreVar._faithScore += 2;
 		}
 	}
@@ -1255,9 +1255,9 @@ void MortevielleEngine::fctForce() {
  */
 void MortevielleEngine::fctLeave() {
 	tsort();
-	g_crep = 0;
+	_crep = 0;
 	if ((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK) || (_coreVar._currPlace == WELL))
-		g_crep = 997;
+		_crep = 997;
 	else {
 		int nextPlace = OWN_ROOM;
 
@@ -1269,18 +1269,18 @@ void MortevielleEngine::fctLeave() {
 			nextPlace = LANDING;
 		else if (_coreVar._currPlace == CRYPT) {
 			nextPlace = SECRET_PASSAGE;
-			g_crep = 176;
+			_crep = 176;
 		} else if (_coreVar._currPlace == SECRET_PASSAGE)
 			nextPlace = t23coul();
 		else if (_coreVar._currPlace == INSIDE_WELL)
 			nextPlace = WELL;
 
-		if (g_crep != 997)
+		if (_crep != 997)
 			_coreVar._currPlace = nextPlace;
 
-		g_caff = nextPlace;
-		if (g_crep == 0)
-			g_crep = nextPlace;
+		_caff = nextPlace;
+		if (_crep == 0)
+			_crep = nextPlace;
 		debloc(nextPlace);
 		_menu.setDestinationMenuText(nextPlace);
 	}
@@ -1291,22 +1291,22 @@ void MortevielleEngine::fctLeave() {
  * @remarks	Originally called 'tattendre'
  */
 void MortevielleEngine::fctWait() {
-	g_mpers = 0;
+	_savedBitIndex = 0;
 	clearScreenType3();
 
 	int answer;
 	do {
-		++g_jh;
+		++_jh;
 		prepareRoom();
 		if (!_blo)
 			t11(_coreVar._currPlace);
-		if ((_currBitIndex != 0) && (g_mpers == 0)) {
-			g_crep = 998;
+		if ((_currBitIndex != 0) && (_savedBitIndex == 0)) {
+			_crep = 998;
 			if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR))
-				cavegre();
+				initCaveOrCellar();
 			if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
 				_anyone = true;
-			g_mpers = _currBitIndex;
+			_savedBitIndex = _currBitIndex;
 			if (!_anyone)
 				prepareRoom();
 			return;
@@ -1314,7 +1314,7 @@ void MortevielleEngine::fctWait() {
 		repon(2, 102);
 		answer = Alert::show(getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
-	g_crep = 998;
+	_crep = 998;
 	if (!_anyone)
 		prepareRoom();
 }
@@ -1326,11 +1326,11 @@ void MortevielleEngine::fctWait() {
 void MortevielleEngine::fctSound() {
 	if (!_syn)
 		ecr3(getEngineString(S_PROBE2));
-	if (g_caff < 27) {
+	if (_caff < 27) {
 		tfleche();
 		if (!(_anyone) && (!_keyPressedEsc))
-			g_crep = 145;
-		g_num = 0;
+			_crep = 145;
+		_num = 0;
 	}
 }
 
@@ -1353,10 +1353,10 @@ void MortevielleEngine::fctDiscuss() {
 		do {
 			++cx;
 		} while (_menu._discussMenu[cx] != _msg[4]);
-		g_caff = 69 + cx;
+		_caff = 69 + cx;
 		afdes();
-		repon(2, g_caff);
-		suj = g_caff + 60;
+		repon(2, _caff);
+		suj = _caff + 60;
 	}
 	tkey1(false);
 	mennor();
@@ -1404,7 +1404,7 @@ void MortevielleEngine::fctDiscuss() {
 			CHECK_QUIT;
 
 			_mouse.getMousePosition(x, y, c);
-			x *= (3 - g_res);
+			x *= (3 - _res);
 			if (x > 319)
 				cx = 41;
 			else
@@ -1467,7 +1467,7 @@ void MortevielleEngine::fctDiscuss() {
 			if (_col) {
 				_col = false;
 				_coreVar._currPlace = 15;
-				if (g_iouv > 0)
+				if (_iouv > 0)
 					max = 8;
 				else
 					max = 4;
@@ -1477,10 +1477,10 @@ void MortevielleEngine::fctDiscuss() {
 					suj = 138;
 					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
-			} else if (_nbrep[g_caff - 69] < _nbrepm[g_caff - 69]) {
-				suj = _tabdon[arep + (ix << 3) + (g_caff - 70)];
+			} else if (_nbrep[_caff - 69] < _nbrepm[_caff - 69]) {
+				suj = _tabdon[arep + (ix << 3) + (_caff - 70)];
 				_coreVar._faithScore += _tabdon[arcf + ix];
-				++_nbrep[g_caff - 69];
+				++_nbrep[_caff - 69];
 			} else {
 				_coreVar._faithScore += 3;
 				suj = 139;
@@ -1518,7 +1518,7 @@ void MortevielleEngine::fctDiscuss() {
 		_col = false;
 		_coreVar._currPlace = LANDING;
 	}
-	g_ctrm = 0;
+	_controlMenu = 0;
 	_mouse.hideMouse();
 	hirs();
 	drawRightFrame();
@@ -1537,17 +1537,17 @@ void MortevielleEngine::fctDiscuss() {
  * @remarks	Originally called 'tsentir'
  */
 void MortevielleEngine::fctSmell() {
-	g_crep = 119;
-	if (g_caff < ROOM26) {
+	_crep = 119;
+	if (_caff < ROOM26) {
 		if (!_syn)
 			ecr3(getEngineString(S_SMELL));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc))
-			if (g_caff == 16)
-				g_crep = 153;
-	} else if (g_caff == 123)
-		g_crep = 110;
-	g_num = 0;
+			if (_caff == 16)
+				_crep = 153;
+	} else if (_caff == 123)
+		_crep = 110;
+	_num = 0;
 }
 
 /**
@@ -1555,13 +1555,13 @@ void MortevielleEngine::fctSmell() {
  * @remarks	Originally called 'tgratter'
  */
 void MortevielleEngine::fctScratch() {
-	g_crep = 155;
-	if (g_caff < 27) {
+	_crep = 155;
+	if (_caff < 27) {
 		if (!_syn)
 			ecr3(getEngineString(S_SCRATCH));
 		tfleche();
 	}
-	g_num = 0;
+	_num = 0;
 }
 
 /**
@@ -1578,7 +1578,7 @@ void MortevielleEngine::endGame() {
 	repon(9, 1509);
 	tkey1(false);
 	_mouse.hideMouse();
-	g_caff = 70;
+	_caff = 70;
 	taffich();
 	hirs();
 	premtet();
@@ -1588,7 +1588,7 @@ void MortevielleEngine::endGame() {
 	repon(9, 1509);
 	repon(2, 142);
 	tkey1(false);
-	g_caff = 32;
+	_caff = 32;
 	afdes();
 	repon(6, 34);
 	repon(2, 35);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b14af53..1f97ee0 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -76,7 +76,7 @@ int Alert::show(const Common::String &msg, int n) {
 			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
 				++i;
 				st = st + chaine[i];
-				if (g_res == 2)
+				if (g_vm->_res == 2)
 					curPos.x -= 3;
 				else
 					curPos.x -= 5;
@@ -93,12 +93,12 @@ int Alert::show(const Common::String &msg, int n) {
 		esp = (uint)(nbcol - caseNumb * 40) >> 1;
 	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
 	setButtonText(cas, coldep, caseNumb, &s[0], esp);
-	limit[1][1] = ((uint)(coldep) >> 1) * g_res;
+	limit[1][1] = ((uint)(coldep) >> 1) * g_vm->_res;
 	limit[1][2] = limit[1][1] + 40;
 	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_res;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_vm->_res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
 	g_vm->_mouse.showMouse();
@@ -218,7 +218,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
 	}
 	++i;
 	choiceListStr = g_vm->copy(inputStr, i, 30);
-	if (g_res == 2)
+	if (g_vm->_res == 2)
 		col *= 6;
 	else
 		col *= 10;
@@ -302,7 +302,7 @@ bool KnowledgeCheck::show() {
 		g_vm->hirs();
 		g_vm->_mouse.showMouse();
 		int dialogHeight;
-		if (g_res == 1)
+		if (g_vm->_res == 1)
 			dialogHeight = 29;
 		else
 			dialogHeight = 23;
@@ -331,8 +331,8 @@ bool KnowledgeCheck::show() {
 		}
 
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			coor[j]._x1 = 45 * g_res;
-			coor[j]._x2 = (maxLength * 3 + 55) * g_res;
+			coor[j]._x1 = 45 * g_vm->_res;
+			coor[j]._x2 = (maxLength * 3 + 55) * g_vm->_res;
 			coor[j]._y1 = 27 + j * 8;
 			coor[j]._y2 = 34 + j * 8;
 			coor[j]._enabled = true;
@@ -342,7 +342,7 @@ bool KnowledgeCheck::show() {
 			}
 		}
 		coor[lastOption - firstOption + 2]._enabled = false;
-		if (g_res == 1)
+		if (g_vm->_res == 1)
 			rep = 10;
 		else
 			rep = 6;
@@ -424,7 +424,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	teskbd();
 	do {
 		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
-		g_key = waitForF3F8();
+		g_vm->_key = waitForF3F8();
 		CHECK_QUIT;
 
 		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
@@ -432,7 +432,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 			g_vm->hirs();
 			aff50(drawAni50Fl);
 		}
-	} while (g_key != 66); // keycode for F8
+	} while (g_vm->_key != 66); // keycode for F8
 }
 
 /**
@@ -452,27 +452,26 @@ int f3f8::waitForF3F8() {
 }
 
 void f3f8::aff50(bool drawAni50Fl) {
-	g_caff = 50;
-	g_maff = 0;
+	g_vm->_caff = 50;
+	g_vm->_maff = 0;
 	taffich();
-	g_vm->draw(g_ades, 63, 12);
+	g_vm->draw(kAdrDes, 63, 12);
 	if (drawAni50Fl)
 		ani50();
 	else
-		repon(2, kDialogStringIndex + 142);
+		g_vm->repon(2, kDialogStringIndex + 142);
 	
 	// Draw the f3/f8 dialog
 	draw();
 }
 
 void f3f8::ani50() {
-	g_crep = animof(1, 1);
-	pictout(kAdrAni, g_crep, 63, 12);
-	g_crep = animof(2, 1);
-	pictout(kAdrAni, g_crep, 63, 12);
-	g_vm->_largestClearScreen = (g_res == 1);
-	repon(2, kDialogStringIndex + 143);
+	g_vm->_crep = g_vm->animof(1, 1);
+	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
+	g_vm->_crep = g_vm->animof(2, 1);
+	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
+	g_vm->_largestClearScreen = (g_vm->_res == 1);
+	g_vm->repon(2, kDialogStringIndex + 143);
 }
 
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 2e9e019..42dd3c7 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -992,7 +992,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
-	if (g_res == 1) {
+	if (g_vm->_res == 1) {
 		x = (uint)x >> 1;
 		dx = (uint)dx >> 1;
 	}
@@ -1059,7 +1059,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	g_vm->_mouse.hideMouse();
 	pt = _textPos;
 
-	if (g_res == 2)
+	if (g_vm->_res == 2)
 		i = 6;
 	else
 		i = 10;
@@ -1101,7 +1101,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
  * Gets the width in pixels of the specified string
  */
 int ScreenSurface::getStringWidth(const Common::String &s) {
-	int charWidth = (g_res == 2) ? 6 : 10;
+	int charWidth = (g_vm->_res == 2) ? 6 : 10;
 
 	return s.size() * charWidth;
 }
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 1b03093..5bc0940 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -180,7 +180,7 @@ void Menu::displayMenu() {
 	g_vm->_mouse.hideMouse();
 	
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
-	col = 28 * g_res;
+	col = 28 * g_vm->_res;
 	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
@@ -209,7 +209,7 @@ void Menu::displayMenu() {
 			} while (k != 3);
 			++y;
 		} while (y != 9);
-		col += 48 * g_res;
+		col += 48 * g_vm->_res;
 	} while (num_letr != 6);
 	g_vm->_mouse.showMouse();
 }
@@ -286,14 +286,14 @@ void Menu::util(Common::Point pos) {
 
 	int ymx = (_menuConstants[_msg3 - 1][3] << 3) + 16;
 	int dxcar = _menuConstants[_msg3 - 1][2];
-	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_res;
+	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_vm->_res;
 
 	int ix;
-	if (g_res == 1)
+	if (g_vm->_res == 1)
 		ix = 5;
 	else
 		ix = 3;
-	int xmx = dxcar * ix * g_res + xmn + 2;
+	int xmx = dxcar * ix * g_vm->_res + xmn + 2;
 	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
 		ix = (((uint)pos.y >> 3) - 1) + (_msg3 << 8);
 		if (ix != _msg4) {
@@ -325,7 +325,7 @@ void Menu::menuDown(int ii) {
 	g_vm->_mouse.hideMouse();
 	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
-	if (g_res == 1)
+	if (g_vm->_res == 1)
 		cx = 10;
 	else
 		cx = 6;
@@ -437,24 +437,24 @@ void Menu::mdn() {
 			g_vm->_prevPos = curPos;
 		
 		bool tes =  (curPos.y < 11) 
-		   && ((curPos.x >= (28 * g_res) && curPos.x <= (28 * g_res + 24)) 
-		   ||  (curPos.x >= (76 * g_res) && curPos.x <= (76 * g_res + 24))
-		   || ((curPos.x > 124 * g_res) && (curPos.x < 124 * g_res + 24))
-		   || ((curPos.x > 172 * g_res) && (curPos.x < 172 * g_res + 24))
-		   || ((curPos.x > 220 * g_res) && (curPos.x < 220 * g_res + 24))
-		   || ((curPos.x > 268 * g_res) && (curPos.x < 268 * g_res + 24)));
+		   && ((curPos.x >= (28 * g_vm->_res) && curPos.x <= (28 * g_vm->_res + 24)) 
+		   ||  (curPos.x >= (76 * g_vm->_res) && curPos.x <= (76 * g_vm->_res + 24))
+		   || ((curPos.x > 124 * g_vm->_res) && (curPos.x < 124 * g_vm->_res + 24))
+		   || ((curPos.x > 172 * g_vm->_res) && (curPos.x < 172 * g_vm->_res + 24))
+		   || ((curPos.x > 220 * g_vm->_res) && (curPos.x < 220 * g_vm->_res + 24))
+		   || ((curPos.x > 268 * g_vm->_res) && (curPos.x < 268 * g_vm->_res + 24)));
 		if (tes) {
 			int ix;
 
-			if (curPos.x < 76 * g_res)
+			if (curPos.x < 76 * g_vm->_res)
 				ix = MENU_INVENTORY;
-			else if (curPos.x < 124 * g_res)
+			else if (curPos.x < 124 * g_vm->_res)
 				ix = MENU_MOVE;
-			else if (curPos.x < 172 * g_res)
+			else if (curPos.x < 172 * g_vm->_res)
 				ix = MENU_ACTION;
-			else if (curPos.x < 220 * g_res)
+			else if (curPos.x < 220 * g_vm->_res)
 				ix = MENU_SELF;
-			else if (curPos.x < 268 * g_res)
+			else if (curPos.x < 268 * g_vm->_res)
 				ix = MENU_DISCUSS;
 			else
 				ix = MENU_FILE;
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 4c1d4de..85e34b6 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -44,147 +44,6 @@
 
 namespace Mortevielle {
 
-void pictout(int seg, int dep, int x, int y) {
-	GfxSurface surface;
-	surface.decode(&g_vm->_mem[seg * 16 + dep]);
-
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
-		g_vm->_mem[0x7000 * 16 + 2] = 0;
-		g_vm->_mem[0x7000 * 16 + 32] = 15;
-	}
-
-	if ((g_caff != 51) && (READ_LE_UINT16(&g_vm->_mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&g_vm->_mem[0x7000 * 16 + 0x4138], 0x100);
-
-	g_vm->_screenSurface.drawPicture(surface, x, y);
-}
-
-void adzon() {
-	Common::File f;
-
-	if (!f.open("don.mor"))
-		error("Missing file - don.mor");
-
-	f.read(g_vm->_tabdon, 7 * 256);
-	f.close();
-
-	if (!f.open("bmor.mor"))
-		error("Missing file - bmor.mor");
-
-	f.read(&g_vm->_tabdon[fleche], 1 * 1916);
-	f.close();
-
-	if (!f.open("dec.mor"))
-		error("Missing file - dec.mor");
-
-	f.read(&g_vm->_mem[0x73a2 * 16 + 0], 1 * 1664);
-	f.close();
-}
-
-/**
- * Returns the offset within the compressed image data resource of the desired image
- */
-int animof(int ouf, int num) {
-	int nani = g_vm->_mem[kAdrAni * 16 + 1];
-	int aux = num;
-	if (ouf != 1)
-		aux += nani;
-
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_vm->_mem[kAdrAni * 16 + (aux << 1)]);
-
-	return animof_result;
-}
-
-void modif(int &nu) {
-	if (nu == 26)
-		nu = 25;
-	else if ((nu > 29) && (nu < 36))
-		nu -= 4;
-	else if ((nu > 69) && (nu < 78))
-		nu -= 37;
-	else if ((nu > 99) && (nu < 194))
-		nu -= 59;
-	else if ((nu > 996) && (nu < 1000))
-		nu -= 862;
-	else if ((nu > 1500) && (nu < 1507))
-		nu -= 1363;
-	else if ((nu > 1507) && (nu < 1513))
-		nu -= 1364;
-	else if ((nu > 1999) && (nu < 2002))
-		nu -= 1851;
-	else if (nu == 2010)
-		nu = 151;
-	else if ((nu > 2011) && (nu < 2025))
-		nu -= 1860;
-	else if (nu == 2026)
-		nu = 165;
-	else if ((nu > 2029) && (nu < 2037))
-		nu -= 1864;
-	else if ((nu > 3000) && (nu < 3005))
-		nu -= 2828;
-	else if (nu == 4100)
-		nu = 177;
-	else if (nu == 4150)
-		nu = 178;
-	else if ((nu > 4151) && (nu < 4156))
-		nu -= 3973;
-	else if (nu == 4157)
-		nu = 183;
-	else if ((nu == 4160) || (nu == 4161))
-		nu -= 3976;
-}
-
-/* NIVEAU 13 */
-
-
-void text1(int x, int y, int nb, int m) {
-	int co;
-
-	if (g_res == 1)
-		co = 10;
-	else
-		co = 6;
-	Common::String tmpStr = g_vm->getString(m);
-	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
-		y = 176;
-	displayStr(tmpStr, x, y, nb, 20, g_vm->_textColor);
-}
-
-void initouv() {
-	for (int cx = 1; cx <= 7; ++cx)
-		g_vm->_touv[cx] = chr(0);
-}
-
-void ecr2(Common::String str_) {
-	// Some dead code was present in the original: removed
-	g_vm->_screenSurface.putxy(8, 177);
-	int tlig = 59 + (g_res - 1) * 36;
-
-	if ((int)str_.size() < tlig)
-		g_vm->_screenSurface.drawString(str_, 5);
-	else if ((int)str_.size() < (tlig << 1)) {
-		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.drawString(g_vm->copy(str_, 1, (tlig - 1)), 5);
-		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig, tlig << 1), 5);
-	} else {
-		g_vm->_largestClearScreen = true;
-		g_vm->clearScreenType2();
-		g_vm->_screenSurface.putxy(8, 176);
-		g_vm->_screenSurface.drawString(g_vm->copy(str_, 1, (tlig - 1)), 5);
-		g_vm->_screenSurface.putxy(8, 182);
-		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig, ((tlig << 1) - 1)), 5);
-		g_vm->_screenSurface.putxy(8, 190);
-		g_vm->_screenSurface.drawString(g_vm->copy(str_, tlig << 1, tlig * 3), 5);
-	}
-}
-
-void ecr3(Common::String text) {
-	g_vm->clearScreenType3();
-	g_vm->_screenSurface.putxy(8, 192);
-	g_vm->_screenSurface.drawString(text, 5);
-}
-
 void paint_rect(int x, int y, int dx, int dy) {
 	int co;
 
@@ -206,59 +65,6 @@ void modobj(int m) {
 	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
 }
 
-void repon(int f, int m) {
-	if ((m > 499) && (m < 563)) {
-		Common::String tmpStr = g_vm->getString(m - 501 + kInventoryStringIndex);
-
-		if ((int) tmpStr.size() > ((58 + (g_res - 1) * 37) << 1))
-			g_vm->_largestClearScreen = true;
-		else
-			g_vm->_largestClearScreen = false;
-
-		g_vm->clearScreenType2();
-		displayStr(tmpStr, 8, 176, 85, 3, 5);
-	} else {
-		modif(m);
-		switch (f) {
-		case 2:
-		case 8:
-			g_vm->clearScreenType2();
-			g_vm->prepareScreenType2();
-			text1(8, 182, 103, m);
-			if ((m == 68) || (m == 69))
-				g_vm->_coreVar._teauto[40] = '*';
-			if ((m == 104) && (g_caff == 14)) {
-				g_vm->_coreVar._teauto[36] = '*';
-				if (g_vm->_coreVar._teauto[39] == '*') {
-					g_vm->_coreVar._pourc[3] = '*';
-					g_vm->_coreVar._teauto[38] = '*';
-				}
-			}
-			break;
-		case 1:
-		case 6:
-		case 9: {
-			int i;
-			if ((f == 1) || (f == 6))
-				i = 4;
-			else
-				i = 5;
-
-			Common::String tmpStr = g_vm->getString(m);
-			displayStr(tmpStr, 80, 40, 60, 25, i);
-
-			if (m == 180)
-				g_vm->_coreVar._pourc[6] = '*';
-			else if (m == 179)
-				g_vm->_coreVar._pourc[10] = '*';
-			}
-			break;
-		default:
-			break;
-		}
-	}
-}
-
 int chlm() {
 	int retval = g_vm->getRandomNumber(1, 2);
 	if (retval == 2)
@@ -272,12 +78,12 @@ int chlm() {
  *************/
 
 void debloc(int roomId) {
-	g_num = 0;
-	g_x = 0;
-	g_y = 0;
+	g_vm->_num = 0;
+	g_vm->_x = 0;
+	g_vm->_y = 0;
 	if ((roomId != ROOM26) && (roomId != LANDING))
 		g_vm->resetPresenceInRooms(roomId);
-	g_mpers = g_vm->_currBitIndex;
+	g_vm->_savedBitIndex = g_vm->_currBitIndex;
 }
 
 void ecfren(int &p, int &rand, int cf, int roomId) {
@@ -412,37 +218,20 @@ int t11(int roomId) {
 	return retVal;
 }
 
-void cavegre() {
-	g_vm->_coreVar._faithScore += 2;
-	if (g_vm->_coreVar._faithScore > 69)
-		g_vm->_coreVar._faithScore += (g_vm->_coreVar._faithScore / 10);
-	g_vm->clearScreenType3();
-	g_vm->prepareScreenType2();
-	ecr3(g_vm->getEngineString(S_SOMEONE_ENTERS));
-	int rand = (g_vm->getRandomNumber(0, 4)) - 2;
-	g_vm->_speechManager.startSpeech(2, rand, 1);
-
-	// The original was doing here a useless loop.
-	// It has been removed
-
-	g_vm->clearScreenType3();
-	g_vm->displayAloneText();
-}
-
 void writetp(Common::String s, int t) {
-	if (g_res == 2)
+	if (g_vm->_res == 2)
 		g_vm->_screenSurface.drawString(s, t);
 	else
 		g_vm->_screenSurface.drawString(g_vm->copy(s, 1, 25), t);
 }
 
 void aniof(int ouf, int num) {
-	if ((g_caff == 7) && ((num == 4) || (num == 5)))
+	if ((g_vm->_caff == 7) && ((num == 4) || (num == 5)))
 		return;
 	
-	if ((g_caff == 10) && (num == 7))
+	if ((g_vm->_caff == 10) && (num == 7))
 		num = 6;
-	else if (g_caff == 12) {
+	else if (g_vm->_caff == 12) {
 		if (num == 3)
 			num = 4;
 		else if (num == 4)
@@ -450,7 +239,7 @@ void aniof(int ouf, int num) {
 	}
 
 	int ad = kAdrAni;
-	int offset = animof(ouf, num);
+	int offset = g_vm->animof(ouf, num);
 
 	GfxSurface surface;
 	surface.decode(&g_vm->_mem[ad * 16 + offset]);
@@ -462,39 +251,39 @@ void aniof(int ouf, int num) {
 /* NIVEAU 9 */
 void dessin(int ad) {
 	if (ad != 0)
-		g_vm->draw(g_ades, ((ad % 160) * 2), (ad / 160));
+		g_vm->draw(kAdrDes, ((ad % 160) * 2), (ad / 160));
 	else {
 		g_vm->clearScreenType1();
-		if (g_caff > 99) {
-			g_vm->draw(g_ades, 60, 33);
+		if (g_vm->_caff > 99) {
+			g_vm->draw(kAdrDes, 60, 33);
 			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
-		} else if (g_caff > 69) {
-			g_vm->draw(g_ades, 112, 48);           // Heads
+		} else if (g_vm->_caff > 69) {
+			g_vm->draw(kAdrDes, 112, 48);           // Heads
 			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
 		} else {
-			g_vm->draw(g_ades, 0, 12);
+			g_vm->draw(kAdrDes, 0, 12);
 			g_vm->prepareScreenType1();
-			if ((g_caff < 30) || (g_caff > 32)) {
+			if ((g_vm->_caff < 30) || (g_vm->_caff > 32)) {
 				for (int cx = 1; cx <= 6; ++cx) {
 					if (ord(g_vm->_touv[cx]) != 0)
 						aniof(1, ord(g_vm->_touv[cx]));
 				}
 
-				if (g_caff == 13) {
+				if (g_vm->_caff == 13) {
 					if (g_vm->_coreVar._atticBallHoleObjectId == 141)
 						aniof(1, 7);
 
 					if (g_vm->_coreVar._atticRodHoleObjectId == 159)
 						aniof(1, 6);
-				} else if ((g_caff == 14) && (g_vm->_coreVar._cellarObjectId == 151))
+				} else if ((g_vm->_caff == 14) && (g_vm->_coreVar._cellarObjectId == 151))
 					aniof(1, 2);
-				else if ((g_caff == 17) && (g_vm->_coreVar._secretPassageObjectId == 143))
+				else if ((g_vm->_caff == 17) && (g_vm->_coreVar._secretPassageObjectId == 143))
 					aniof(1, 1);
-				else if ((g_caff == 24) && (g_vm->_coreVar._wellObjectId != 0))
+				else if ((g_vm->_caff == 24) && (g_vm->_coreVar._wellObjectId != 0))
 					aniof(1, 1);
 			}
 			
-			if (g_caff < ROOM26)
+			if (g_vm->_caff < ROOM26)
 				g_vm->startMusicOrSpeech(1);
 		}
 	}
@@ -533,7 +322,8 @@ void tkey1(bool d) {
 
 	// Wait for release from any key or mouse button
 	while (g_vm->keyPressed())
-		g_key = testou();
+		g_vm->_key = testou();
+
 	do {
 		g_vm->_mouse.getMousePosition(x, y, c);
 		g_vm->keyPressed();
@@ -555,24 +345,24 @@ void tkey1(bool d) {
 
 /* NIVEAU 7 */
 void tlu(int af, int ob) {
-	g_caff = 32;
+	g_vm->_caff = 32;
 	afdes();
-	repon(6, ob + 4000);
-	repon(2, 999);
+	g_vm->repon(6, ob + 4000);
+	g_vm->repon(2, 999);
 	tkey1(true);
-	g_caff = af;
+	g_vm->_caff = af;
 	g_vm->_msg[3] = OPCODE_NONE;
-	g_crep = 998;
+	g_vm->_crep = 998;
 }
 
 void affrep() {
-	g_caff = g_vm->_coreVar._currPlace;
-	g_crep = g_vm->_coreVar._currPlace;
+	g_vm->_caff = g_vm->_coreVar._currPlace;
+	g_vm->_crep = g_vm->_coreVar._currPlace;
 }
 
 void tsort() {
 
-	if ((g_iouv > 0) && (g_vm->_coreVar._currPlace != 0)) {
+	if ((g_vm->_iouv > 0) && (g_vm->_coreVar._currPlace != 0)) {
 		if (g_vm->_coreVar._faithScore < 50)
 			g_vm->_coreVar._faithScore += 2;
 		else
@@ -581,24 +371,24 @@ void tsort() {
 
 	for (int cx = 1; cx <= 7; ++cx)
 		g_vm->_touv[cx] = chr(0);
-	g_ment = 0;
-	g_iouv = 0;
+	g_vm->_ment = 0;
+	g_vm->_iouv = 0;
 	g_vm->_mchai = 0;
 	debloc(g_vm->_coreVar._currPlace);
 }
 
 void st4(int ob) {
-	g_crep = 997;
+	g_vm->_crep = 997;
 
 	switch (ob) {
 	case 114 :
-		g_crep = 109;
+		g_vm->_crep = 109;
 		break;
 	case 110 :
-		g_crep = 107;
+		g_vm->_crep = 107;
 		break;
 	case 158 :
-		g_crep = 113;
+		g_vm->_crep = 113;
 		break;
 	case 152:
 	case 153:
@@ -610,7 +400,7 @@ void st4(int ob) {
 	case 157:
 	case 160:
 	case 161 :
-		tlu(g_caff, ob);
+		tlu(g_vm->_caff, ob);
 		break;
 	default:
 		break;
@@ -645,7 +435,7 @@ void mennor() {
 }
 
 void premtet() {
-	g_vm->draw(g_ades, 10, 80);
+	g_vm->draw(kAdrDes, 10, 80);
 	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 
@@ -660,7 +450,7 @@ void ajchai() {
 	if (g_vm->_tabdon[cy + cx] == 0)
 		g_vm->_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
 	else
-		g_crep = 192;
+		g_vm->_crep = 192;
 }
 
 void ajjer(int ob) {
@@ -673,32 +463,26 @@ void ajjer(int ob) {
 		g_vm->_coreVar._sjer[(cx)] = chr(ob);
 		modinv();
 	} else
-		g_crep = 139;
+		g_vm->_crep = 139;
 }
 
-void tctrm() {
-	repon(2, (3000 + g_ctrm));
-	g_ctrm = 0;
-}
-
-
 void quelquun() {
 	if (g_vm->_menu._menuDisplayed)
 		g_vm->_menu.eraseMenu();
 
 	g_vm->endSearch();
-	g_crep = 997;
+	g_vm->_crep = 997;
 L1:
 	if (!g_vm->_hiddenHero) {
-		if (g_crep == 997)
-			g_crep = 138;
-		repon(2, g_crep);
-		if (g_crep == 138)
+		if (g_vm->_crep == 997)
+			g_vm->_crep = 138;
+		g_vm->repon(2, g_vm->_crep);
+		if (g_vm->_crep == 138)
 			g_vm->_speechManager.startSpeech(5, 2, 1);
 		else
 			g_vm->_speechManager.startSpeech(4, 4, 1);
 
-		if (g_iouv == 0)
+		if (g_vm->_iouv == 0)
 			g_vm->_coreVar._faithScore += 2;
 		else if (g_vm->_coreVar._faithScore < 50)
 			g_vm->_coreVar._faithScore += 4;
@@ -707,8 +491,8 @@ L1:
 		tsort();
 		g_vm->_menu.setDestinationMenuText(LANDING);
 		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
-		g_caff = 69 + cx;
-		g_crep = g_caff;
+		g_vm->_caff = 69 + cx;
+		g_vm->_crep = g_vm->_caff;
 		g_vm->_msg[3] = MENU_DISCUSS;
 		g_vm->_msg[4] = g_vm->_menu._discussMenu[cx];
 		g_vm->_syn = true;
@@ -716,10 +500,10 @@ L1:
 	} else {
 		if (g_vm->getRandomNumber(1, 3) == 2) {
 			g_vm->_hiddenHero = false;
-			g_crep = 137;
+			g_vm->_crep = 137;
 			goto L1;
 		} else {
-			repon(2, 136);
+			g_vm->repon(2, 136);
 			int rand = (g_vm->getRandomNumber(0, 4)) - 2;
 			g_vm->_speechManager.startSpeech(3, rand, 1);
 			g_vm->clearScreenType2();
@@ -740,22 +524,22 @@ void tsuiv() {
 	int cx = 0;
 	do {
 		++cx;
-		++g_cs;
-		cl = cy + g_cs;
+		++g_vm->_cs;
+		cl = cy + g_vm->_cs;
 		tbcl = g_vm->_tabdon[cl];
-	} while ((tbcl == 0) && (g_cs <= 9));
+	} while ((tbcl == 0) && (g_vm->_cs <= 9));
 
-	if ((tbcl != 0) && (g_cs < 11)) {
-		++g_vm->g_is;
-		g_caff = tbcl;
-		g_crep = g_caff + 400;
+	if ((tbcl != 0) && (g_vm->_cs < 11)) {
+		++g_vm->_is;
+		g_vm->_caff = tbcl;
+		g_vm->_crep = g_vm->_caff + 400;
 		if (g_vm->_currBitIndex != 0)
 			g_vm->_coreVar._faithScore += 2;
 	} else {
 		affrep();
 		g_vm->endSearch();
 		if (cx > 9)
-			g_crep = 131;
+			g_vm->_crep = 131;
 	}
 }
 
@@ -763,7 +547,7 @@ void tfleche() {
 	bool qust;
 	char touch;
 
-	if (g_num == 9999)
+	if (g_vm->_num == 9999)
 		return;
 
 	fenat(chr(152));
@@ -776,20 +560,20 @@ void tfleche() {
 			CHECK_QUIT;
 
 			if (g_vm->getMouseClick())
-				inRect = (g_vm->_mouse._pos.x < 256 * g_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
+				inRect = (g_vm->_mouse._pos.x < 256 * g_vm->_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
 			g_vm->prepareRoom();
 		} while (!(qust || inRect || g_vm->_anyone));
 
 		if (qust && (touch == '\103'))
 			Alert::show(g_vm->_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_x != 0) && (g_y != 0)) || (g_vm->_anyone) || (inRect)));
+	} while (!((touch == '\73') || ((touch == '\104') && (g_vm->_x != 0) && (g_vm->_y != 0)) || (g_vm->_anyone) || (inRect)));
 
 	if (touch == '\73')
 		g_vm->_keyPressedEsc = true;
 
 	if (inRect) {
-		g_x = g_vm->_mouse._pos.x;
-		g_y = g_vm->_mouse._pos.y;
+		g_vm->_x = g_vm->_mouse._pos.x;
+		g_vm->_y = g_vm->_mouse._pos.y;
 	}
 }
 
@@ -798,23 +582,23 @@ void tcoord(int sx) {
 	int ib;
 
 
-	g_num = 0;
-	g_crep = 999;
+	g_vm->_num = 0;
+	g_vm->_crep = 999;
 	int a = 0;
 	int atdon = amzon + 3;
 	int cy = 0;
-	while (cy < g_caff) {
+	while (cy < g_vm->_caff) {
 		a += g_vm->_tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
 	if (g_vm->_tabdon[atdon] == 0) {
-		g_crep = 997;
+		g_vm->_crep = 997;
 		return;
 	}
 
-	a += fleche;
+	a += kFleche;
 	int cb = 0;
 	for (cy = 0; cy <= (sx - 2); ++cy) {
 		ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
@@ -822,27 +606,27 @@ void tcoord(int sx) {
 	}
 	ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
 	if (ib == 0) {
-		g_crep = 997;
+		g_vm->_crep = 997;
 		return;
 	}
 
 	cy = 1;
 	do {
 		cb += 2;
-		sx = g_vm->_tabdon[a + cb] * g_res;
+		sx = g_vm->_tabdon[a + cb] * g_vm->_res;
 		sy = g_vm->_tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = g_vm->_tabdon[a + cb] * g_res;
+		ix = g_vm->_tabdon[a + cb] * g_vm->_res;
 		iy = g_vm->_tabdon[(a + cb + 1)];
 		++cy;
-	} while (!(((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) || (cy > ib)));
+	} while (!(((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) || (cy > ib)));
 
-	if ((g_x >= sx) && (g_x <= ix) && (g_y >= sy) && (g_y <= iy)) {
-		g_num = cy - 1;
+	if ((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) {
+		g_vm->_num = cy - 1;
 		return;
 	}
 
-	g_crep = 997;
+	g_vm->_crep = 997;
 }
 
 
@@ -850,51 +634,51 @@ void st7(int ob) {
 	switch (ob) {
 	case 116:
 	case 144:
-		g_crep = 104;
+		g_vm->_crep = 104;
 		break;
 	case 126:
 	case 111:
-		g_crep = 108;
+		g_vm->_crep = 108;
 		break;
 	case 132:
-		g_crep = 111;
+		g_vm->_crep = 111;
 		break;
 	case 142:
-		g_crep = 112;
+		g_vm->_crep = 112;
 		break;
 	default:
-		g_crep = 183;
+		g_vm->_crep = 183;
 		st4(ob);
 	}
 }
 
 void treg(int ob) {
-	int mdes = g_caff;
-	g_caff = ob;
+	int mdes = g_vm->_caff;
+	g_vm->_caff = ob;
 
-	if (((g_caff > 29) && (g_caff < 33)) || (g_caff == 144) || (g_caff == 147) || (g_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
+	if (((g_vm->_caff > 29) && (g_vm->_caff < 33)) || (g_vm->_caff == 144) || (g_vm->_caff == 147) || (g_vm->_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
 		afdes();
-		if ((g_caff > 29) && (g_caff < 33))
-			repon(2, g_caff);
+		if ((g_vm->_caff > 29) && (g_vm->_caff < 33))
+			g_vm->repon(2, g_vm->_caff);
 		else
-			repon(2, g_caff + 400);
+			g_vm->repon(2, g_vm->_caff + 400);
 		tkey1(true);
-		g_caff = mdes;
+		g_vm->_caff = mdes;
 		g_vm->_msg[3] = 0;
-		g_crep = 998;
+		g_vm->_crep = 998;
 	} else {
 		g_vm->_obpart = true;
-		g_crep = g_caff + 400;
+		g_vm->_crep = g_vm->_caff + 400;
 		g_vm->_menu.setSearchMenu();
 	}
 }
 
 void avpoing(int &ob) {
-	g_crep = 999;
+	g_vm->_crep = 999;
 	if (g_vm->_coreVar._selectedObjectId != 0)
 		ajjer(g_vm->_coreVar._selectedObjectId);
 
-	if (g_crep != 139) {
+	if (g_vm->_crep != 139) {
 		modobj(ob + 400);
 		g_vm->_coreVar._selectedObjectId = ob;
 		ob = 0;
@@ -906,12 +690,12 @@ void rechai(int &ch) {
 
 	if (g_vm->_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
-	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_num - 1];
+	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_vm->_num - 1];
 }
 
 int t23coul() {
 	if (!g_vm->checkInventory(143)) {
-		g_crep = 1512;
+		g_vm->_crep = 1512;
 		g_vm->loseGame();
 	}
 
@@ -929,9 +713,9 @@ void st13(int ob) {
 	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
 	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
 	    (ob == 150) || (ob == 152))
-		g_crep = 999;
+		g_vm->_crep = 999;
 	else
-		g_crep = 105;
+		g_vm->_crep = 105;
 }
 
 void sauvecr(int y, int dy) {
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 30b0caf..667883c 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -42,24 +42,11 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
-extern void pictout(int seg, int dep, int x, int y);
-extern void sauvecr(int y, int dy);
-extern void charecr(int y, int dy);
-extern void adzon();
-extern int animof(int ouf, int num);
-/* Niveau 14 suite */
-extern void modif(int &nu);
 /* NIVEAU 13 */
-extern void text1(int x, int y, int nb, int m);
-extern void initouv();
-extern void ecr2(Common::String str_);
-extern void ecr3(Common::String text);
 extern void paint_rect(int x, int y, int dx, int dy);
 /* NIVEAU 12 */
 extern void modobj(int m);
-extern void repon(int f, int m);
 extern int chlm();
-extern void drawClock();
 /*************
  * NIVEAU 11 *
  *************/
@@ -70,7 +57,6 @@ extern void becfren(int roomId);
 extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
 extern int t11(int roomId);
-extern void cavegre();
 extern void writetp(Common::String s, int t);
 extern void aniof(int ouf, int num);
 /* NIVEAU 9 */
@@ -91,7 +77,6 @@ extern void premtet();
 /* NIVEAU 5 */
 extern void ajchai();
 extern void ajjer(int ob);
-extern void tctrm();
 extern void quelquun();
 extern void tsuiv();
 extern void tfleche();
@@ -104,5 +89,7 @@ extern int t23coul();
 extern void maivid();
 extern void st13(int ob);
 
+extern void sauvecr(int y, int dy);
+extern void charecr(int y, int dy);
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 05d6e05..536fe09 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -175,7 +175,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	// Set the screen mode
 	_currGraphicalDevice = MODE_EGA;
-	g_res = 2;
+	_res = 2;
 
 	_txxFileFl = false;
 	// Load texts from TXX files
@@ -216,7 +216,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
-	g_ades = 0x7000;
 
 	return Common::kNoError;
 }
@@ -563,7 +562,7 @@ void MortevielleEngine::mainGame() {
 	if (_reloadCFIEC)
 		loadCFIEC();
 
-	for (g_crep = 1; g_crep <= _c_zzz; ++g_crep) 
+	for (_crep = 1; _crep <= _c_zzz; ++_crep) 
 		decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
@@ -613,12 +612,12 @@ void MortevielleEngine::handleAction() {
 
 	clearScreenType3();
 	oo = false;
-	g_ctrm = 0;
+	_controlMenu = 0;
 	if (!_keyPressedEsc) {
 		_menu.drawMenu();
 		_menu._menuDisplayed = true;
 		temps = 0;
-		g_key = 0;
+		_key = 0;
 		funct = false;
 		inkey = '.';
 
@@ -654,8 +653,8 @@ void MortevielleEngine::handleAction() {
 			} else
 				return;
 		} else if (inkey == '\104') {
-			if ((g_x != 0) && (g_y != 0))
-				g_num = 9999;
+			if ((_x != 0) && (_y != 0))
+				_num = 9999;
 			return;
 		}
 	}
@@ -667,8 +666,8 @@ void MortevielleEngine::handleAction() {
 			return;
 		if (temps > lim) {
 			repon(2, 141);
-			if (g_num == 9999)
-				g_num = 0;
+			if (_num == 9999)
+				_num = 0;
 		} else {
 			_menuOpcode = _msg[3];
 			if ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))
@@ -682,8 +681,8 @@ void MortevielleEngine::handleAction() {
 						oo = true;
 						if ((_msg[4] == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
-							g_caff = _coreVar._currPlace;
-							g_crep = 998;
+							_caff = _coreVar._currPlace;
+							_crep = 998;
 						} else
 							tsuiv();
 						mennor();
@@ -694,18 +693,18 @@ void MortevielleEngine::handleAction() {
 				if (! oo)
 					handleOpcode();
 
-				if ((g_ctrm == 0) && (! _loseGame) && (! _endGame)) {
+				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
 					taffich();
 					if (_okdes) {
 						_okdes = false;
 						dessin(0);
 					}
 					if ((!_syn) || (_col))
-						repon(2, g_crep);
+						repon(2, _crep);
 				}
 			} while (_syn);
-			if (g_ctrm != 0)
-				tctrm();
+			if (_controlMenu != 0)
+				displayControlMenu();
 		}
 	}
 }
@@ -767,7 +766,7 @@ void MortevielleEngine::prepareScreenType3() {
  */
 void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
 	int newHour = readclock();
-	int th = g_jh + ((newHour - g_mh) / g_t);
+	int th = _jh + ((newHour - _mh) / _t);
 	minute = ((th % 2) + _currHalfHour) * 30;
 	hour = ((uint)th >> 1) + _currHour;
 	if (minute == 60) {
@@ -1381,12 +1380,12 @@ void MortevielleEngine::getKnockAnswer() {
 
 	updateHour(day, hour, minute);
 	if ((hour >= 0) && (hour < 8))
-		g_crep = 190;
+		_crep = 190;
 	else {
 		if (getRandomNumber(1, 100) > 70)
-			g_crep = 190;
+			_crep = 190;
 		else
-			g_crep = 147;
+			_crep = 147;
 	}
 }
 
@@ -1431,11 +1430,11 @@ int MortevielleEngine::getPresenceBitIndex(int roomId) {
  */
 void MortevielleEngine::initGame() {
 	_place = MANOR_FRONT;
-	g_jh = 0;
+	_jh = 0;
 	if (!_coreVar._alreadyEnteredManor)
 		_blo = true;
-	g_t = kTime1;
-	g_mh = readclock();
+	_t = kTime1;
+	_mh = readclock();
 }
 
 /**
@@ -1625,10 +1624,10 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((g_prebru == 0) && (!_coreVar._alreadyEnteredManor)) {
+	} else if ((_prebru == 0) && (!_coreVar._alreadyEnteredManor)) {
 		// Type 1: Speech
 		_speechManager.startSpeech(10, 1, 1);
-		++g_prebru;
+		++_prebru;
 	} else {
 		if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
 			// Type 1: Speech
@@ -1654,8 +1653,8 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
  */
 void MortevielleEngine::loseGame() {
 	initouv();
-	g_ment = 0;
-	g_iouv = 0;
+	_ment = 0;
+	_iouv = 0;
 	_mchai = 0;
 	_menu.unsetSearchMenu();
 	if (!_blo)
@@ -1664,7 +1663,7 @@ void MortevielleEngine::loseGame() {
 	_loseGame = true;
 	clearScreenType1();
 	_screenSurface.drawBox(60, 35, 400, 50, 15);
-	repon(9, g_crep);
+	repon(9, _crep);
 	clearScreenType2();
 	clearScreenType3();
 	_col = false;
@@ -1713,7 +1712,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 	
 	key = 0;
 	do {
-		_speechManager.startSpeech(rep, haut[g_caff - 69], 0);
+		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
 		key = f3f8::waitForF3F8();
 		CHECK_QUIT;
 	} while (key != 66);
@@ -1728,8 +1727,8 @@ void MortevielleEngine::startDialog(int16 rep) {
 void MortevielleEngine::endSearch() {
 	_heroSearching = false;
 	_obpart = false;
-	g_cs = 0;
-	g_is = 0;
+	_cs = 0;
+	_is = 0;
 	_menu.unsetSearchMenu();
 }
 
@@ -1743,14 +1742,14 @@ void MortevielleEngine::gotoDiningRoom() {
 	updateHour(day, hour, minute);
 	if ((hour < 5) && (_coreVar._currPlace > ROOM18)) {
 		if (!checkInventory(137)) {        //You don't have the keys, and it's late
-			g_crep = 1511;
+			_crep = 1511;
 			loseGame();
 		} else
 			displayDiningRoom();
 	} else if (!_coreVar._alreadyEnteredManor) {     //Is it your first time?
 		_currBitIndex = 255; // Everybody is present
 		showPeoplePresent(_currBitIndex);
-		g_caff = 77;
+		_caff = 77;
 		afdes();
 		_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
@@ -1769,7 +1768,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		if (!_blo)
 			minute = t11(OWN_ROOM);
 		_currBitIndex = 0;
-		g_mpers = 0;
+		_savedBitIndex = 0;
 		_coreVar._alreadyEnteredManor = true;
 	} else
 		displayDiningRoom();
@@ -1782,7 +1781,7 @@ void MortevielleEngine::gotoDiningRoom() {
 void MortevielleEngine::checkManorDistance() {
 	++_manorDistance;
 	if (_manorDistance > 2) {
-		g_crep = 1506;
+		_crep = 1506;
 		loseGame();
 	} else {
 		_okdes = true;
@@ -1815,7 +1814,7 @@ void MortevielleEngine::gotoManorBack() {
  * @remarks	Originally called 't1deau'
  */
 void MortevielleEngine::floodedInWell() {
-	g_crep = 1503;
+	_crep = 1503;
 	loseGame();
 }
 
@@ -1838,9 +1837,9 @@ void MortevielleEngine::changeGraphicalDevice(int newDevice) {
 		displayAloneText();
 	clearScreenType2();
 	clearScreenType3();
-	g_maff = 68;
+	_maff = 68;
 	afdes();
-	repon(2, g_crep);
+	repon(2, _crep);
 	_menu.displayMenu();
 }
 
@@ -1857,24 +1856,24 @@ void MortevielleEngine::gameLoaded() {
 	_col = false;
 	_hiddenHero = false;
 	_brt = false;
-	g_maff = 68;
+	_maff = 68;
 	_menuOpcode = OPCODE_NONE;
-	g_prebru = 0;
-	g_x = 0;
-	g_y = 0;
-	g_num = 0;
-	g_hdb = 0;
-	g_hfb = 0;
-	g_cs = 0;
-	g_is = 0;
-	g_ment = 0;
+	_prebru = 0;
+	_x = 0;
+	_y = 0;
+	_num = 0;
+	_startHour = 0;
+	_endHour = 0;
+	_cs = 0;
+	_is = 0;
+	_ment = 0;
 	_syn = true;
 	_heroSearching = true;
 	_mchai = 0;
 	_manorDistance = 0;
 	initouv();
-	g_iouv = 0;
-	g_dobj = 0;
+	_iouv = 0;
+	_dobj = 0;
 	affrep();
 	_hintPctMessage = getString(580);
 
@@ -1887,7 +1886,7 @@ void MortevielleEngine::gameLoaded() {
 	prepareRoom();
 	drawClock();
 	afdes();
-	repon(2, g_crep);
+	repon(2, _crep);
 	clearScreenType3();
 	_endGame = false;
 	_menu.setDestinationMenuText(_coreVar._currPlace);
@@ -1909,7 +1908,7 @@ void MortevielleEngine::handleOpcode() {
 	if (!_anyone) {
 		if (_brt) {
 			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
-				g_ctrm = 4;
+				_controlMenu = 4;
 				mennor();
 				return;
 			}
@@ -1990,15 +1989,15 @@ void MortevielleEngine::handleOpcode() {
 	if (((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace > MOUNTAIN)) && (_coreVar._currPlace != INSIDE_WELL)
 	        && (_coreVar._currPlace != OWN_ROOM) && (_coreVar._selectedObjectId != 152) && (!_loseGame)) {
 		if ((_coreVar._faithScore > 99) && (hour > 8) && (hour < 16)) {
-			g_crep = 1501;
+			_crep = 1501;
 			loseGame();
 		}
 		if ((_coreVar._faithScore > 99) && (hour > 0) && (hour < 9)) {
-			g_crep = 1508;
+			_crep = 1508;
 			loseGame();
 		}
 		if ((day > 1) && (hour > 8) && (!_loseGame)) {
-			g_crep = 1502;
+			_crep = 1502;
 			loseGame();
 		}
 	}
@@ -2084,7 +2083,7 @@ void MortevielleEngine::clearScreenType10() {
 	Common::String st;
 
 	_mouse.hideMouse();
-	if (g_res == 1) {
+	if (_res == 1) {
 		co = 634;
 		cod = 534;
 	} else {
@@ -2130,7 +2129,7 @@ void MortevielleEngine::showMoveMenuAlert() {
  * @remarks	Originally called 'dialpre'
  */
 void MortevielleEngine::showConfigScreen() {
-	g_crep = 998;
+	_crep = 998;
 }
 
 /**
@@ -2303,8 +2302,8 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			g_vm->_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
-			g_vm->_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+			_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
+			_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
@@ -2332,12 +2331,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&g_vm->_mem[0x6000 * 16 + addr], p._tax);
-	WRITE_LE_UINT16(&g_vm->_mem[0x6000 * 16 + addr + 2], p._tay);
+	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr], p._tax);
+	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			g_vm->_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 
@@ -2443,7 +2442,7 @@ void MortevielleEngine::loadBRUIT5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&g_vm->_mem[kAdrNoise5 * 16 + 0], 149 * 128);
+	f.read(&_mem[kAdrNoise5 * 16 + 0], 149 * 128);
 	f.close();
 }
 
@@ -2486,12 +2485,12 @@ void MortevielleEngine::music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&g_vm->_mem[0x3800 * 16 + 0], 500);
-	fic.read(&g_vm->_mem[0x47a0 * 16 + 0], 123);
+	fic.read(&_mem[0x3800 * 16 + 0], 500);
+	fic.read(&_mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	_soundManager.decodeMusic(&g_vm->_mem[0x3800 * 16], &g_vm->_mem[0x5000 * 16], 623);
-	_addfix = (float)((kTempoMusic - 8)) / 256;
+	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[0x5000 * 16], 623);
+	_addFix = (float)((kTempoMusic - 8)) / 256;
 	_speechManager.cctable(_speechManager._tbi);
 
 	bool fin = false;
@@ -2513,16 +2512,16 @@ void MortevielleEngine::music() {
 void MortevielleEngine::showTitleScreen() {
 	hirs();
 	repon(7, 2035);
-	g_caff = 51;
+	_caff = 51;
 	taffich();
 	teskbd();
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
-	draw(g_ades, 0, 0);
+	draw(kAdrDes, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	_screenSurface.putxy(104 + 72 * g_res, 185);
+	_screenSurface.putxy(104 + 72 * _res, 185);
 	_screenSurface.drawString(cpr, 0);
 }
 
@@ -2544,7 +2543,7 @@ void MortevielleEngine::draw(int ad, int x, int y) {
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		g_vm->_mem[0x7000 * 16 + 14] = 15;
+		_mem[0x7000 * 16 + 14] = 15;
 	}
 	_mouse.hideMouse();
 	pictout(0x73a2, 0, 0, 0);
@@ -2626,22 +2625,22 @@ void MortevielleEngine::prepareRoom() {
 
 	if (!_blo) {
 		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			g_t = kTime2;
+			_t = kTime2;
 		else
-			g_t = kTime1;
+			_t = kTime1;
 		cf = _coreVar._faithScore;
 		if ((cf > 33) && (cf < 66))
-			g_t -= (g_t / 3);
+			_t -= (_t / 3);
 
 		if (cf > 65)
-			g_t -= ((g_t / 3) * 2);
+			_t -= ((_t / 3) * 2);
 
 		int nh = readclock();
-		if ((nh - g_mh) > g_t) {
+		if ((nh - _mh) > _t) {
 			bool activeMenu = _menu._menuActive;
 			_menu.eraseMenu();
-			g_jh += ((nh - g_mh) / g_t);
-			g_mh = nh;
+			_jh += ((nh - _mh) / _t);
+			_mh = nh;
 			switch (_place) {
 			case GREEN_ROOM:
 			case DARKBLUE_ROOM:
@@ -2681,17 +2680,17 @@ void MortevielleEngine::prepareRoom() {
 				setRandomPresenceChapel(cf);
 				break;
 			}
-			if ((g_mpers != 0) && (_currBitIndex != 10))
-				g_mpers = _currBitIndex;
+			if ((_savedBitIndex != 0) && (_currBitIndex != 10))
+				_savedBitIndex = _currBitIndex;
 
-			if ((g_mpers == 0) && (_currBitIndex > 0)) {
+			if ((_savedBitIndex == 0) && (_currBitIndex > 0)) {
 				if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR)) {
-					cavegre();
+					initCaveOrCellar();
 				} else if (_currBitIndex == 10) {
 					_currBitIndex = 0;
 					if (!_brt) {
 						_brt = true;
-						g_hdb = readclock();
+						_startHour = readclock();
 						if (getRandomNumber(1, 5) < 5) {
 							clearScreenType3();
 							prepareScreenType2();
@@ -2708,11 +2707,11 @@ void MortevielleEngine::prepareRoom() {
 				_menu.drawMenu();
 		}
 	}
-	g_hfb = readclock();
-	if ((_brt) && ((g_hfb - g_hdb) > 17)) {
+	_endHour = readclock();
+	if ((_brt) && ((_endHour - _startHour) > 17)) {
 		getPresenceBitIndex(_place);
 		_brt = false;
-		g_hdb = 0;
+		_startHour = 0;
 		if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
 			_anyone = true;
 	}
@@ -2742,9 +2741,9 @@ void MortevielleEngine::drawClock() {
 		co = 1;
 
 	if (_minute == 0)
-		_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y - rg), co);
+		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y - rg), co);
 	else 
-		_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)x >> 1) * g_res, (y + rg), co);
+		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y + rg), co);
 
 	h = _hour;
 	if (h > 12)
@@ -2752,7 +2751,7 @@ void MortevielleEngine::drawClock() {
 	if (h == 0)
 		h = 12;
 
-	_screenSurface.drawLine(((uint)x >> 1) * g_res, y, ((uint)(x + cv[0][h - 1]) >> 1) * g_res, y + cv[1][h - 1], co);
+	_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)(x + cv[0][h - 1]) >> 1) * _res, y + cv[1][h - 1], co);
 	_mouse.showMouse();
 	_screenSurface.putxy(568, 154);
 
@@ -2797,7 +2796,233 @@ void MortevielleEngine::hirs() {
 	// method is deprecated in favour of clearing the screen
 	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
 
-	g_vm->_screenSurface.clearScreen();
+	if (_currGraphicalDevice == MODE_CGA)
+		_res = 1;
+	else
+		_res = 2;
+
+	_screenSurface.clearScreen();
+}
+
+/**
+ * Init room : Cave or Cellar
+ * @remarks	Originally called 'cavegre'
+ */
+void MortevielleEngine::initCaveOrCellar() {
+	_coreVar._faithScore += 2;
+	if (_coreVar._faithScore > 69)
+		_coreVar._faithScore += (_coreVar._faithScore / 10);
+	clearScreenType3();
+	prepareScreenType2();
+	ecr3(getEngineString(S_SOMEONE_ENTERS));
+	int rand = (getRandomNumber(0, 4)) - 2;
+	_speechManager.startSpeech(2, rand, 1);
+
+	// The original was doing here a useless loop.
+	// It has been removed
+
+	clearScreenType3();
+	displayAloneText();
+}
+
+/**
+ * Display control menu string
+ * @remarks	Originally called 'tctrm'
+ */
+void MortevielleEngine::displayControlMenu() {
+	repon(2, (3000 + _controlMenu));
+	_controlMenu = 0;
+}
+
+void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
+	GfxSurface surface;
+	surface.decode(&_mem[seg * 16 + dep]);
+
+	if (_currGraphicalDevice == MODE_HERCULES) {
+		_mem[0x7000 * 16 + 2] = 0;
+		_mem[0x7000 * 16 + 32] = 15;
+	}
+
+	if ((_caff != 51) && (READ_LE_UINT16(&_mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&_mem[0x7000 * 16 + 0x4138], 0x100);
+
+	_screenSurface.drawPicture(surface, x, y);
+}
+
+void MortevielleEngine::adzon() {
+	Common::File f;
+
+	if (!f.open("don.mor"))
+		error("Missing file - don.mor");
+
+	f.read(_tabdon, 7 * 256);
+	f.close();
+
+	if (!f.open("bmor.mor"))
+		error("Missing file - bmor.mor");
+
+	f.read(&_tabdon[kFleche], 1 * 1916);
+	f.close();
+
+	if (!f.open("dec.mor"))
+		error("Missing file - dec.mor");
+
+	f.read(&_mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.close();
+}
+
+/**
+ * Returns the offset within the compressed image data resource of the desired image
+ */
+int MortevielleEngine::animof(int ouf, int num) {
+	int nani = _mem[kAdrAni * 16 + 1];
+	int aux = num;
+	if (ouf != 1)
+		aux += nani;
+
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[kAdrAni * 16 + (aux << 1)]);
+
+	return animof_result;
+}
+
+void MortevielleEngine::text1(int x, int y, int nb, int m) {
+	int co;
+
+	if (_res == 1)
+		co = 10;
+	else
+		co = 6;
+	Common::String tmpStr = getString(m);
+	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
+		y = 176;
+	displayStr(tmpStr, x, y, nb, 20, _textColor);
+}
+
+void MortevielleEngine::repon(int f, int m) {
+	if ((m > 499) && (m < 563)) {
+		Common::String tmpStr = getString(m - 501 + kInventoryStringIndex);
+
+		if ((int) tmpStr.size() > ((58 + (_res - 1) * 37) << 1))
+			_largestClearScreen = true;
+		else
+			_largestClearScreen = false;
+
+		clearScreenType2();
+		displayStr(tmpStr, 8, 176, 85, 3, 5);
+	} else {
+		modif(m);
+		switch (f) {
+		case 2:
+		case 8:
+			clearScreenType2();
+			prepareScreenType2();
+			text1(8, 182, 103, m);
+			if ((m == 68) || (m == 69))
+				_coreVar._teauto[40] = '*';
+			if ((m == 104) && (_caff == 14)) {
+				_coreVar._teauto[36] = '*';
+				if (_coreVar._teauto[39] == '*') {
+					_coreVar._pourc[3] = '*';
+					_coreVar._teauto[38] = '*';
+				}
+			}
+			break;
+		case 1:
+		case 6:
+		case 9: {
+			int i;
+			if ((f == 1) || (f == 6))
+				i = 4;
+			else
+				i = 5;
+
+			Common::String tmpStr = getString(m);
+			displayStr(tmpStr, 80, 40, 60, 25, i);
+
+			if (m == 180)
+				_coreVar._pourc[6] = '*';
+			else if (m == 179)
+				_coreVar._pourc[10] = '*';
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+void MortevielleEngine::modif(int &nu) {
+	if (nu == 26)
+		nu = 25;
+	else if ((nu > 29) && (nu < 36))
+		nu -= 4;
+	else if ((nu > 69) && (nu < 78))
+		nu -= 37;
+	else if ((nu > 99) && (nu < 194))
+		nu -= 59;
+	else if ((nu > 996) && (nu < 1000))
+		nu -= 862;
+	else if ((nu > 1500) && (nu < 1507))
+		nu -= 1363;
+	else if ((nu > 1507) && (nu < 1513))
+		nu -= 1364;
+	else if ((nu > 1999) && (nu < 2002))
+		nu -= 1851;
+	else if (nu == 2010)
+		nu = 151;
+	else if ((nu > 2011) && (nu < 2025))
+		nu -= 1860;
+	else if (nu == 2026)
+		nu = 165;
+	else if ((nu > 2029) && (nu < 2037))
+		nu -= 1864;
+	else if ((nu > 3000) && (nu < 3005))
+		nu -= 2828;
+	else if (nu == 4100)
+		nu = 177;
+	else if (nu == 4150)
+		nu = 178;
+	else if ((nu > 4151) && (nu < 4156))
+		nu -= 3973;
+	else if (nu == 4157)
+		nu = 183;
+	else if ((nu == 4160) || (nu == 4161))
+		nu -= 3976;
+}
+
+void MortevielleEngine::initouv() {
+	for (int cx = 1; cx <= 7; ++cx)
+		_touv[cx] = chr(0);
+}
+
+void MortevielleEngine::ecr2(Common::String text) {
+	// Some dead code was present in the original: removed
+	_screenSurface.putxy(8, 177);
+	int tlig = 59 + (_res - 1) * 36;
+
+	if ((int)text.size() < tlig)
+		_screenSurface.drawString(text, 5);
+	else if ((int)text.size() < (tlig << 1)) {
+		_screenSurface.putxy(8, 176);
+		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
+		_screenSurface.putxy(8, 182);
+		_screenSurface.drawString(copy(text, tlig, tlig << 1), 5);
+	} else {
+		_largestClearScreen = true;
+		clearScreenType2();
+		_screenSurface.putxy(8, 176);
+		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
+		_screenSurface.putxy(8, 182);
+		_screenSurface.drawString(copy(text, tlig, ((tlig << 1) - 1)), 5);
+		_screenSurface.putxy(8, 190);
+		_screenSurface.drawString(copy(text, tlig << 1, tlig * 3), 5);
+	}
+}
+
+void MortevielleEngine::ecr3(Common::String text) {
+	clearScreenType3();
+	_screenSurface.putxy(8, 192);
+	_screenSurface.drawString(text, 5);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 69cb12a..924e92b 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -81,13 +81,15 @@ enum DataType {
 #define GAME_FRAME_DELAY (1000 / 50)
 
 const int kAcha = 492;
+const int kAdrDes = 0x7000;
+const int kFleche = 1758;
+
 const int asoul = 154;
 const int aouvr = 282;
 const int achai = 387;
 const int arcf = 1272;
 const int arep = 1314;
 const int amzon = 1650;
-const int fleche = 1758;
 const int arega = 0;
 
 struct nhom {
@@ -164,6 +166,12 @@ private:
 	void showTitleScreen();
 	int  readclock();
 	void palette(int v1);
+
+	void adzon();
+	void text1(int x, int y, int nb, int m);
+	void modif(int &nu);
+	void initouv();
+
 public:
 	Common::String _hintPctMessage;
 	Common::Point _prevPos;
@@ -210,6 +218,7 @@ public:
 	int _place;
 	int _manorDistance;
 	int _currBitIndex;
+	int _savedBitIndex;
 	int _currDay;
 	int _currHour;
 	int _currHalfHour;
@@ -217,16 +226,35 @@ public:
 	int _hour;
 	int _minute;
 	int _mchai;
-	float _addfix;
+	float _addFix;
 	SaveStruct _coreVar, _saveStruct;
 	Common::Point _stdPal[91][17];
 	t_pcga _cgaPal[91];
+	int _key;
+	int _controlMenu;
+	int _startHour;
+	int _endHour;
 
 	int _c_zzz;
 	int ptr_word;
 	byte _v_lieu[7][25];
-	byte g_is;
+	byte _is;
 	int _numpal;
+	int _ment;
+	int _iouv;
+	int _caff;
+	int _maff;
+	int _dobj;
+	int _num;
+	int _crep;
+	int _cs;
+	int _res;
+	int _prebru;
+	int _t;
+	int _x;
+	int _y;
+	int _jh;
+	int _mh;
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
@@ -383,6 +411,16 @@ public:
 	void drawClock();
 	Common::String copy(const Common::String &s, int idx, size_t size);
 	void hirs();
+	void initCaveOrCellar();
+	void displayControlMenu();
+
+
+	void pictout(int seg, int dep, int x, int y);
+	int  animof(int ouf, int num);
+	void repon(int f, int m);
+	void ecr2(Common::String text);
+	void ecr3(Common::String text);
+
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index bd7e489..e18090e 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -228,8 +228,8 @@ void MouseHandler::showMouse() {
  * @remarks	Originally called 'pos_mouse'
  */
 void MouseHandler::setMousePosition(Common::Point newPos) {
-	if (newPos.x > 314 * g_res)
-		newPos.x = 314 * g_res;
+	if (newPos.x > 314 * g_vm->_res)
+		newPos.x = 314 * g_vm->_res;
 	else if (newPos.x < 0)
 		newPos.x = 0;
 	if (newPos.y > 199)
@@ -299,16 +299,16 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			cy = 190;
 			break;
 		case '9':
-			cx = 315 * g_res;
+			cx = 315 * g_vm->_res;
 			cy = 1;
 			break;
 		case '3':
 			cy = 190;
-			cx = 315 * g_res;
+			cx = 315 * g_vm->_res;
 			break;
 		case '5':
 			cy = 100;
-			cx = 155 * g_res;
+			cx = 155 * g_vm->_res;
 			break;
 		case ' ':
 		case '\15':
@@ -362,27 +362,27 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			}
 			break;
 		case 'I':
-			cx = g_res * 32;
+			cx = g_vm->_res * 32;
 			cy = 8;
 			break;
 		case 'D':
-			cx = 80 * g_res;
+			cx = 80 * g_vm->_res;
 			cy = 8;
 			break;
 		case 'A':
-			cx = 126 * g_res;
+			cx = 126 * g_vm->_res;
 			cy = 8;
 			break;
 		case 'S':
-			cx = 174 * g_res;
+			cx = 174 * g_vm->_res;
 			cy = 8;
 			break;
 		case 'P':
-			cx = 222 * g_res;
+			cx = 222 * g_vm->_res;
 			cy = 8;
 			break;
 		case 'F':
-			cx = g_res * 270;
+			cx = g_vm->_res * 270;
 			cy = 8;
 			break;
 		case '\23':
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 8a3ecb8..92831ec 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -61,7 +61,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 	inputStr += '$'; 
 
 	g_vm->_screenSurface.putxy(x, y);
-	if (g_res == 1)
+	if (g_vm->_res == 1)
 		tab = 10;
 	else
 		tab = 6;
@@ -186,13 +186,13 @@ void taffich() {
 	int32 lgt;
 	int alllum[16];
 
-	int a = g_caff;
+	int a = g_vm->_caff;
 	if ((a >= 153) && (a <= 161))
 		a = tran2[a - 153];
 	else if ((a >= 136) && (a <= 140))
 		a = tran1[a - 136];
 	int b = a;
-	if (g_maff == a)
+	if (g_vm->_maff == a)
 		return;
 
 	switch (a) {
@@ -246,11 +246,11 @@ void taffich() {
 			m = 2010;
 		if (a == 32)
 			m = 2034;
-		if ((a == 17) && (g_maff == 14))
+		if ((a == 17) && (g_vm->_maff == 14))
 			m = 2018;
 
 		if (a > 99) {
-			if ((g_vm->g_is == 1) || (g_vm->g_is == 0))
+			if ((g_vm->_is == 1) || (g_vm->_is == 0))
 				m = 2031;
 			else
 				m = 2032;
@@ -259,26 +259,26 @@ void taffich() {
 		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
 			m = 2030;
 
-		if (((a < 27) && (((g_maff > 69) && (!g_vm->_coreVar._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
+		if (((a < 27) && (((g_vm->_maff > 69) && (!g_vm->_coreVar._alreadyEnteredManor)) || (g_vm->_maff > 99))) || ((g_vm->_maff > 29) && (g_vm->_maff < 33)))
 			m = 2033;
 
-		g_maff = a;
+		g_vm->_maff = a;
 		if (a == 159)
 			a = 86;
 		else if (a > 140)
-			a = a - 67;
+			a -= 67;
 		else if (a > 137)
-			a = a - 66;
+			a -= 66;
 		else if (a > 99)
-			a = a - 64;
+			a -= 64;
 		else if (a > 69)
-			a = a - 42;
+			a -= 42;
 		else if (a > 29)
-			a = a - 5;
+			a -= 5;
 		else if (a == 26)
 			a = 24;
 		else if (a > 18)
-			a = a - 1;
+			--a;
 		npal = a;
 
 		for (cx = 0; cx <= (a - 1); ++cx)
@@ -293,7 +293,7 @@ void taffich() {
 			lgt = handle;
 			handle = g_vm->_fxxBuffer[88];
 		}
-		g_maff = a;
+		g_vm->_maff = a;
 		npal = a + 37;
 	}
 	chardes(filename, lgt, handle);
@@ -334,12 +334,12 @@ void taffich() {
 		charani(filename, lgt, handle);
 	}
 	g_vm->_mouse.showMouse();
-	if ((a < 27) && ((g_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_vm->_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((g_vm->_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_vm->_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
 			cx = t11(g_vm->_coreVar._currPlace);
-		g_mpers =  0;
+		g_vm->_savedBitIndex =  0;
 	}
 }
 
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index d8731f9..5b9e841 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -128,7 +128,7 @@ void SpeechManager::cctable(tablint &t) {
 
 	tb[0] = 0;
 	for (int k = 0; k <= 255; ++k) {
-		tb[k + 1] = g_vm->_addfix + tb[k];
+		tb[k + 1] = g_vm->_addFix + tb[k];
 		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
@@ -554,17 +554,17 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		return;
 
 	_phonemeNumb = rep;
-	g_haut = ht;
+	int haut = ht;
 	_typlec = typ;
 	if (_typlec != 0) {
 		for (int i = 0; i <= 500; ++i)
 			savph[i] = _cfiphBuffer[i];
 		tempo = kTempoNoise;
-	} else if (g_haut > 5)
+	} else if (haut > 5)
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
-	g_vm->_addfix = (float)((tempo - 8)) / 256;
+	g_vm->_addFix = (float)((tempo - 8)) / 256;
 	cctable(_tbi);
 	switch (typ) {
 	case 1:
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 6fc0593..a451cb6 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -34,36 +34,6 @@
 namespace Mortevielle {
 
 /*---------------------------------------------------------------------------*/
-/*------------------------------   VARIABLES   ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-int g_x,
-        g_y,
-        g_t,
-        g_jh,
-        g_mh,
-        g_cs,
-        g_hdb,
-        g_hfb,
-        g_key,
-        g_num,
-        g_res,
-        g_ment,
-        g_haut,
-        g_caff,
-        g_maff,
-        g_crep,
-        g_ades,
-        g_iouv,
-		g_ctrm,
-        g_dobj,
-        g_mlec,
-        g_mchai,
-        g_mpers,
-        g_perdep,
-        g_prebru;
-
-/*---------------------------------------------------------------------------*/
 /*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
 /*---------------------------------------------------------------------------*/
 
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 9ac807a..ddde25a 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -115,34 +115,6 @@ typedef int tfxx[108];
 
 enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
 
-/*---------------------------------------------------------------------------*/
-/*------------------------------   VARIABLES   ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-extern int g_x,
-        g_y,
-        g_t,
-        g_jh,
-        g_mh,
-        g_cs,
-        g_hdb,
-        g_hfb,
-        g_key,
-        g_num,
-        g_res,
-        g_ment,
-        g_haut,
-        g_caff,
-        g_maff,
-        g_crep,
-        g_ades,
-        g_iouv,
-		g_ctrm,
-        g_dobj,
-        g_mpers,
-        g_perdep,
-        g_prebru;
-
 } // End of namespace Mortevielle
 
 #endif


Commit: 75fcdfac0f51dd0a1c49e0e73294f6b2a59164b4
    https://github.com/scummvm/scummvm/commit/75fcdfac0f51dd0a1c49e0e73294f6b2a59164b4
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:46-07:00

Commit Message:
MORTEVIELLE: Move functions out of mor.cpp

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/mor.cpp
    engines/mortevielle/mor.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 174af9f..70979be 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -173,7 +173,7 @@ void MortevielleEngine::fctMove() {
 	}
 	if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
 		affrep();
-	debloc(_coreVar._currPlace);
+	resetRoomVariables(_coreVar._currPlace);
 	_menu.setDestinationMenuText(_coreVar._currPlace);
 }
 
@@ -693,7 +693,7 @@ void MortevielleEngine::fctPlace() {
 					aniof(1, 2);
 					aniof(1, 1);
 					repon(2, 165);
-					maivid();
+					displayEmptyHand();
 					_speechManager.startSpeech(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
@@ -772,7 +772,7 @@ void MortevielleEngine::fctPlace() {
 		}
 
 		if (_crep != 188)
-			maivid();
+			displayEmptyHand();
 	}
 }
 
@@ -856,7 +856,7 @@ void MortevielleEngine::fctAttach() {
 					aniof(1, 1);
 				} else
 					_crep = 185;
-				maivid();
+				displayEmptyHand();
 			}
 		}
 	}
@@ -930,15 +930,14 @@ void MortevielleEngine::fctKnock() {
 	if (_coreVar._currPlace == ROOM26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		_speechManager.startSpeech(11, rand, 1);
-		int p;
-		ecfren(p, rand, _coreVar._faithScore, _ment);
+		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
 		int l = _ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (rand > p)
 					_crep = 190;
 				else {
-					becfren(l);
+					setPresenceFlags(l);
 					getKnockAnswer();
 				}
 			} else
@@ -964,7 +963,7 @@ void MortevielleEngine::fctSelfPut() {
 			_crep = 999;
 			ajchai();
 			if (_crep != 192)
-				maivid();
+				displayEmptyHand();
 			return;
 		}
 		tfleche();
@@ -1039,7 +1038,7 @@ void MortevielleEngine::fctSelfPut() {
 			if (_crep == 999)
 				ajchai();
 			if (_crep != 192)
-				maivid();
+				displayEmptyHand();
 		}
 	}
 }
@@ -1054,15 +1053,15 @@ void MortevielleEngine::fctListen() {
 	else {
 		if (_currBitIndex != 0)
 			++_coreVar._faithScore;
-		int p, rand;
-		ecfren(p, rand, _coreVar._faithScore, _ment);
+		int rand;
+		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
 		int l = _ment;
 		if (l != 0) {
 			if (p != -500) {
 				if (rand > p)
 					_crep = 101;
 				else {
-					becfren(l);
+					setPresenceFlags(l);
 					int j, h, m;
 					updateHour(j, h, m);
 					rand = getRandomNumber(1, 100);
@@ -1093,7 +1092,7 @@ void MortevielleEngine::fctEat() {
 		tsort();
 		_coreVar._currPlace = DINING_ROOM;
 		_caff = 10;
-		debloc(_coreVar._currPlace);
+		resetRoomVariables(_coreVar._currPlace);
 		_menu.setDestinationMenuText(_coreVar._currPlace);
 
 		int j, h, m;
@@ -1163,7 +1162,7 @@ void MortevielleEngine::fctEnter() {
 					repon(2, _caff);
 				} else
 					_col = false;
-				debloc(_ment);
+				resetRoomVariables(_ment);
 				_ment = 0;
 			}
 		} else {
@@ -1173,7 +1172,7 @@ void MortevielleEngine::fctEnter() {
 			
 			_coreVar._currPlace = _ment;
 			affrep();
-			debloc(_coreVar._currPlace);
+			resetRoomVariables(_coreVar._currPlace);
 			_menu.setDestinationMenuText(_coreVar._currPlace);
 			_ment = 0;
 			_savedBitIndex = 0;
@@ -1198,7 +1197,7 @@ void MortevielleEngine::fctSleep() {
 		_coreVar._currPlace = OWN_ROOM;
 		affrep();
 		afdes();
-		debloc(_coreVar._currPlace);
+		resetRoomVariables(_coreVar._currPlace);
 		_menu.setDestinationMenuText(_coreVar._currPlace);
 	}
 	clearScreenType3();
@@ -1281,7 +1280,7 @@ void MortevielleEngine::fctLeave() {
 		_caff = nextPlace;
 		if (_crep == 0)
 			_crep = nextPlace;
-		debloc(nextPlace);
+		resetRoomVariables(nextPlace);
 		_menu.setDestinationMenuText(nextPlace);
 	}
 }
@@ -1571,7 +1570,7 @@ void MortevielleEngine::fctScratch() {
 void MortevielleEngine::endGame() {
 	_quitGame = true;
 	tlu(13, 152);
-	maivid();
+	displayEmptyHand();
 	clearScreenType1();
 	clearScreenType2();
 	clearScreenType3();
@@ -1610,7 +1609,7 @@ void MortevielleEngine::askRestart() {
 	clearScreenType2();
 	startMusicOrSpeech(0);
 	tkey1(false);
-	maivid();
+	displayEmptyHand();
 	resetVariables();
 	initGame();
 	_currHour = 10;
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 42dd3c7..2b66075 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1143,4 +1143,19 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 	}
 }
 
+/**
+ * Draw plain rectangle
+ * @remarks	Originally called 'paint_rect'
+ */
+void ScreenSurface::drawRectangle(int x, int y, int dx, int dy) {
+	int co;
+
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
+		co = 3;
+	else
+		co = 11;
+	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
+}
+
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 9f4a479..4983226 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -93,8 +93,9 @@ public:
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void drawString(const Common::String &l, int command);
-	int getStringWidth(const Common::String &s);
+	int  getStringWidth(const Common::String &s);
 	void drawLine(int x, int y, int xx, int yy, int coul);
+	void drawRectangle(int x, int y, int dx, int dy);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 85e34b6..09857c8 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -44,115 +44,7 @@
 
 namespace Mortevielle {
 
-void paint_rect(int x, int y, int dx, int dy) {
-	int co;
-
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
-		co = 3;
-	else
-		co = 11;
-	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
-}
-
-/* NIVEAU 12 */
-void modobj(int m) {
-	Common::String strp = Common::String(' ');
-
-	if (m != 500)
-		strp = g_vm->getString(m - 501 + kInventoryStringIndex);
-
-	g_vm->_menu.setText(g_vm->_menu._inventoryMenu[8], strp);
-	g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[8]);
-}
-
-int chlm() {
-	int retval = g_vm->getRandomNumber(1, 2);
-	if (retval == 2)
-		retval = 128;
-	
-	return retval;
-}
-
-/*************
- * NIVEAU 11 *
- *************/
-
-void debloc(int roomId) {
-	g_vm->_num = 0;
-	g_vm->_x = 0;
-	g_vm->_y = 0;
-	if ((roomId != ROOM26) && (roomId != LANDING))
-		g_vm->resetPresenceInRooms(roomId);
-	g_vm->_savedBitIndex = g_vm->_currBitIndex;
-}
-
-void ecfren(int &p, int &rand, int cf, int roomId) {
-	if (roomId == OWN_ROOM)
-		g_vm->displayAloneText();
-	p = -500;
-	rand = 0;
-	if ( ((roomId == GREEN_ROOM) && (!g_vm->_roomPresenceLuc) && (!g_vm->_roomPresenceIda))
-	  || ((roomId == DARKBLUE_ROOM) && (!g_vm->_roomPresenceGuy) && (!g_vm->_roomPresenceEva)) )
-		p = g_vm->getPresenceStatsGreenRoom();
-	if ((roomId == PURPLE_ROOM) && (!g_vm->_purpleRoomPresenceLeo) && (!g_vm->_room9PresenceLeo))
-		p = g_vm->getPresenceStatsPurpleRoom();
-	if ( ((roomId == TOILETS) && (!g_vm->_toiletsPresenceBobMax))
-	  || ((roomId == BATHROOM) && (!g_vm->_bathRoomPresenceBobMax)) )
-		p = g_vm->getPresenceStatsToilets();
-	if ((roomId == BLUE_ROOM) && (!g_vm->_roomPresenceMax))
-		p = g_vm->getPresenceStatsBlueRoom();
-	if ( ((roomId == RED_ROOM) && (!g_vm->_roomPresenceBob))
-	  || ((roomId == GREEN_ROOM2) && (!g_vm->_roomPresencePat)))
-		p = g_vm->getPresenceStatsRedRoom();
-	if ((roomId == ROOM9) && (!g_vm->_room9PresenceLeo) && (!g_vm->_purpleRoomPresenceLeo))
-		p = 10;
-	if ( ((roomId == PURPLE_ROOM) && (g_vm->_room9PresenceLeo))
-	  || ((roomId == ROOM9) && (g_vm->_purpleRoomPresenceLeo)))
-		p = -400;
-	if (p != -500) {
-		p += cf;
-		rand = g_vm->getRandomNumber(1, 100);
-	}
-}
-
-void becfren(int roomId) {
-	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
-		int rand = g_vm->getRandomNumber(1, 2);
-		if (roomId == GREEN_ROOM) {
-			if (rand == 1)
-				g_vm->_roomPresenceLuc = true;
-			else
-				g_vm->_roomPresenceIda = true;
-		} else { // roomId == DARKBLUE_ROOM
-			if (rand == 1)
-				g_vm->_roomPresenceGuy = true;
-			else
-				g_vm->_roomPresenceEva = true;
-		}
-	} else if (roomId == PURPLE_ROOM)
-		g_vm->_purpleRoomPresenceLeo = true;
-	else if (roomId == TOILETS)
-		g_vm->_toiletsPresenceBobMax = true;
-	else if (roomId == BLUE_ROOM)
-		g_vm->_roomPresenceMax = true;
-	else if (roomId == RED_ROOM)
-		g_vm->_roomPresenceBob = true;
-	else if (roomId == BATHROOM)
-		g_vm->_bathRoomPresenceBobMax = true;
-	else if (roomId == GREEN_ROOM2)
-		g_vm->_roomPresencePat = true;
-	else if (roomId == ROOM9)
-		g_vm->_room9PresenceLeo = true;
-}
-
 /* NIVEAU 10 */
-void init_nbrepm() {
-	const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
-
-	for (int idx = 0; idx < 9; ++idx)
-		g_vm->_nbrepm[idx] = ipm[idx];
-}
-
 void phaz(int &rand, int &p, int cf) {
 	p += cf;
 	rand = g_vm->getRandomNumber(1, 100);
@@ -160,9 +52,9 @@ void phaz(int &rand, int &p, int cf) {
 
 int t11(int roomId) {
 	int retVal = 0;
-	int p, rand;
+	int rand;
 
-	ecfren(p, rand, g_vm->_coreVar._faithScore, roomId);
+	int p = g_vm->getPresenceStats(rand, g_vm->_coreVar._faithScore, roomId);
 	g_vm->_place = roomId;
 	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
 		if (p != -500) {
@@ -170,7 +62,7 @@ int t11(int roomId) {
 				g_vm->displayAloneText();
 				retVal = 0;
 			} else {
-				becfren(g_vm->_place);
+				g_vm->setPresenceFlags(g_vm->_place);
 				retVal = g_vm->getPresenceBitIndex(g_vm->_place);
 			}
 		} else
@@ -374,7 +266,7 @@ void tsort() {
 	g_vm->_ment = 0;
 	g_vm->_iouv = 0;
 	g_vm->_mchai = 0;
-	debloc(g_vm->_coreVar._currPlace);
+	g_vm->resetRoomVariables(g_vm->_coreVar._currPlace);
 }
 
 void st4(int ob) {
@@ -508,7 +400,7 @@ L1:
 			g_vm->_speechManager.startSpeech(3, rand, 1);
 			g_vm->clearScreenType2();
 			g_vm->displayAloneText();
-			debloc(21);
+			g_vm->resetRoomVariables(MANOR_FRONT);
 			affrep();
 		}
 	}
@@ -679,7 +571,7 @@ void avpoing(int &ob) {
 		ajjer(g_vm->_coreVar._selectedObjectId);
 
 	if (g_vm->_crep != 139) {
-		modobj(ob + 400);
+		g_vm->displayItemInHand(ob + 400);
 		g_vm->_coreVar._selectedObjectId = ob;
 		ob = 0;
 	}
@@ -702,11 +594,6 @@ int t23coul() {
 	return CELLAR;
 }
 
-void maivid() {
-	g_vm->_coreVar._selectedObjectId = 0;
-	modobj(500);
-}
-
 void st13(int ob) {
 	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
 	    (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 667883c..b55dc46 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -42,19 +42,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
 
-/* NIVEAU 13 */
-extern void paint_rect(int x, int y, int dx, int dy);
-/* NIVEAU 12 */
-extern void modobj(int m);
-extern int chlm();
-/*************
- * NIVEAU 11 *
- *************/
-extern void debloc(int roomId);
-extern void ecfren(int &p, int &rand, int cf, int roomId);
-extern void becfren(int roomId);
 /* NIVEAU 10 */
-extern void init_nbrepm();
 extern void phaz(int &rand, int &p, int cf);
 extern int t11(int roomId);
 extern void writetp(Common::String s, int t);
@@ -86,7 +74,6 @@ extern void treg(int ob);
 extern void avpoing(int &ob);
 extern void rechai(int &ch);
 extern int t23coul();
-extern void maivid();
 extern void st13(int ob);
 
 extern void sauvecr(int y, int dy);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 536fe09..cd5c215 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -1256,7 +1256,7 @@ int MortevielleEngine::setPresenceDiningRoom(int hour) {
 	int retVal = 0;
 
 	if ((hour >= 0) && (hour < 8))
-		retVal = chlm();
+		retVal = checkLeoMaxRandomPresence();
 	else {
 		int min = 0, max = 0;
 		if ((hour > 7) && (hour < 10)) {
@@ -1287,7 +1287,7 @@ int MortevielleEngine::setPresenceBureau(int hour) {
 	int retVal = 0;
 
 	if ((hour >= 0) && (hour < 8))
-		retVal = chlm();
+		retVal = checkLeoMaxRandomPresence();
 	else {
 		int min = 0, max = 0;
 		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
@@ -1312,7 +1312,7 @@ int MortevielleEngine::setPresenceBureau(int hour) {
  * @remarks	Originally called 'quelq12'
  */
 int MortevielleEngine::setPresenceKitchen() {
-	int retVal = chlm();
+	int retVal = checkLeoMaxRandomPresence();
 	showPeoplePresent(retVal);
 
 	return retVal;
@@ -1351,7 +1351,7 @@ int MortevielleEngine::setPresenceChapel(int hour) {
 	int retVal = 0;
 
 	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
-		retVal = chlm();
+		retVal = checkLeoMaxRandomPresence();
 	else {
 		int min = 0, max = 0;
 		if ((hour > 9) && (hour < 12)) {
@@ -1892,7 +1892,7 @@ void MortevielleEngine::gameLoaded() {
 	_menu.setDestinationMenuText(_coreVar._currPlace);
 	modinv();
 	if (_coreVar._selectedObjectId != 0)
-		modobj(_coreVar._selectedObjectId + 400);
+		displayItemInHand(_coreVar._selectedObjectId + 400);
 	_mouse.showMouse();
 }
 
@@ -2733,8 +2733,8 @@ void MortevielleEngine::drawClock() {
 
 	_mouse.hideMouse();
 	
-	paint_rect(570, 118, 20, 10);
-	paint_rect(578, 114, 6, 18);
+	_screenSurface.drawRectangle(570, 118, 20, 10);
+	_screenSurface.drawRectangle(578, 114, 6, 18);
 	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
 		co = 0;
 	else
@@ -2796,9 +2796,13 @@ void MortevielleEngine::hirs() {
 	// method is deprecated in favour of clearing the screen
 	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
 
-	if (_currGraphicalDevice == MODE_CGA)
+	if (_currGraphicalDevice == MODE_TANDY) {
+		_screenSurface.fillRect(0, Common::Rect(0, 0, 639, 200));
 		_res = 1;
-	else
+	} else if (_currGraphicalDevice == MODE_CGA) {
+		palette(1);
+		_res = 1;
+	} else
 		_res = 2;
 
 	_screenSurface.clearScreen();
@@ -3025,4 +3029,128 @@ void MortevielleEngine::ecr3(Common::String text) {
 	_screenSurface.drawString(text, 5);
 }
 
+/**
+ * Display item in hand
+ * @remarks	Originally called 'modobj'
+ */
+void MortevielleEngine::displayItemInHand(int objId) {
+	Common::String strp = Common::String(' ');
+
+	if (objId != 500)
+		strp = getString(objId - 501 + kInventoryStringIndex);
+
+	_menu.setText(_menu._inventoryMenu[8], strp);
+	_menu.disableMenuItem(_menu._inventoryMenu[8]);
+}
+
+/**
+ * Display empty hand
+ * @remarks	Originally called 'maivid'
+ */
+void MortevielleEngine::displayEmptyHand() {
+	_coreVar._selectedObjectId = 0;
+	displayItemInHand(500);
+}
+
+/**
+ * Set a random presence: Leo or Max
+ * @remarks	Originally called 'chlm'
+ */
+int MortevielleEngine::checkLeoMaxRandomPresence() {
+	int retval = getRandomNumber(1, 2);
+	if (retval == 2)
+		retval = 128;
+	
+	return retval;
+}
+
+/**
+ * Reset room variables
+ * @remarks	Originally called 'debloc'
+ */
+void MortevielleEngine::resetRoomVariables(int roomId) {
+	_num = 0;
+	_x = 0;
+	_y = 0;
+	if ((roomId != ROOM26) && (roomId != LANDING))
+		resetPresenceInRooms(roomId);
+	_savedBitIndex = _currBitIndex;
+}
+
+/**
+ * Compute presence stats
+ * @remarks	Originally called 'ecfren'
+ */
+int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
+	if (roomId == OWN_ROOM)
+		displayAloneText();
+	int retVal = -500;
+	rand = 0;
+	if ( ((roomId == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
+	  || ((roomId == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) )
+		retVal = getPresenceStatsGreenRoom();
+	if ((roomId == PURPLE_ROOM) && (!_purpleRoomPresenceLeo) && (!_room9PresenceLeo))
+		retVal = getPresenceStatsPurpleRoom();
+	if ( ((roomId == TOILETS) && (!_toiletsPresenceBobMax))
+	  || ((roomId == BATHROOM) && (!_bathRoomPresenceBobMax)) )
+		retVal = getPresenceStatsToilets();
+	if ((roomId == BLUE_ROOM) && (!_roomPresenceMax))
+		retVal = getPresenceStatsBlueRoom();
+	if ( ((roomId == RED_ROOM) && (!_roomPresenceBob))
+	  || ((roomId == GREEN_ROOM2) && (!_roomPresencePat)))
+		retVal = getPresenceStatsRedRoom();
+	if ((roomId == ROOM9) && (!_room9PresenceLeo) && (!_purpleRoomPresenceLeo))
+		retVal = 10;
+	if ( ((roomId == PURPLE_ROOM) && (_room9PresenceLeo))
+	  || ((roomId == ROOM9) && (_purpleRoomPresenceLeo)))
+		retVal = -400;
+	if (retVal != -500) {
+		retVal += cf;
+		rand = getRandomNumber(1, 100);
+	}
+
+	return retVal;
+}
+
+/**
+ * Set presence flags
+ * @remarks	Originally called 'becfren'
+ */
+void MortevielleEngine::setPresenceFlags(int roomId) {
+	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
+		int rand = g_vm->getRandomNumber(1, 2);
+		if (roomId == GREEN_ROOM) {
+			if (rand == 1)
+				g_vm->_roomPresenceLuc = true;
+			else
+				g_vm->_roomPresenceIda = true;
+		} else { // roomId == DARKBLUE_ROOM
+			if (rand == 1)
+				g_vm->_roomPresenceGuy = true;
+			else
+				g_vm->_roomPresenceEva = true;
+		}
+	} else if (roomId == PURPLE_ROOM)
+		g_vm->_purpleRoomPresenceLeo = true;
+	else if (roomId == TOILETS)
+		g_vm->_toiletsPresenceBobMax = true;
+	else if (roomId == BLUE_ROOM)
+		g_vm->_roomPresenceMax = true;
+	else if (roomId == RED_ROOM)
+		g_vm->_roomPresenceBob = true;
+	else if (roomId == BATHROOM)
+		g_vm->_bathRoomPresenceBobMax = true;
+	else if (roomId == GREEN_ROOM2)
+		g_vm->_roomPresencePat = true;
+	else if (roomId == ROOM9)
+		g_vm->_room9PresenceLeo = true;
+}
+
+void MortevielleEngine::init_nbrepm() {
+	static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
+
+	for (int idx = 0; idx < 9; ++idx)
+		g_vm->_nbrepm[idx] = ipm[idx];
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 924e92b..bb594d2 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -166,6 +166,7 @@ private:
 	void showTitleScreen();
 	int  readclock();
 	void palette(int v1);
+	int checkLeoMaxRandomPresence();
 
 	void adzon();
 	void text1(int x, int y, int nb, int m);
@@ -413,6 +414,11 @@ public:
 	void hirs();
 	void initCaveOrCellar();
 	void displayControlMenu();
+	void displayItemInHand(int objId);
+	void displayEmptyHand();
+	void resetRoomVariables(int roomId);
+	int getPresenceStats(int &rand, int cf, int roomId);
+	void setPresenceFlags(int roomId);
 
 
 	void pictout(int seg, int dep, int x, int y);
@@ -420,6 +426,7 @@ public:
 	void repon(int f, int m);
 	void ecr2(Common::String text);
 	void ecr3(Common::String text);
+	void init_nbrepm();
 
 };
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index d71e2fd..daa59b2 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -119,7 +119,7 @@ void SavegameManager::loadSavegame(int n) {
  */
 Common::Error SavegameManager::loadGame(int n) {
 	g_vm->_mouse.hideMouse();
-	maivid();
+	g_vm->displayEmptyHand();
 	loadSavegame(n);
 	
 	/* Initialization */
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index ddde25a..3086f9e 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -101,6 +101,8 @@ enum places {
 	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
 
+enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
+
 struct Rect {
 	int _x1, _x2, _y1, _y2;
 	bool _enabled;
@@ -109,12 +111,6 @@ struct Rect {
 typedef int tablint[256];
 typedef int tfxx[108];
 
-/*---------------------------------------------------------------------------*/
-/*------------------------------     ENUMS     ------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
-
 } // End of namespace Mortevielle
 
 #endif


Commit: 3dce1becd70a113d0e0aa15e6951cf5545924749
    https://github.com/scummvm/scummvm/commit/3dce1becd70a113d0e0aa15e6951cf5545924749
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:48-07:00

Commit Message:
MORTEVIELLE: Get rid of mor.cpp

Changed paths:
  R engines/mortevielle/mor.cpp
  R engines/mortevielle/mor.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 70979be..0247eca 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -28,7 +28,6 @@
 #include "common/scummsys.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
@@ -59,17 +58,17 @@ void MortevielleEngine::fctMove() {
 		if ((_anyone) || (_keyPressedEsc))
 			return;
 
-		tcoord(1);
+		setCoordinates(1);
 
 		if (_num == 0)
 			return;
 
 		if (_num == 1) {
 			_coreVar._currPlace = OWN_ROOM;
-			_menu.setDestinationMenuText(OWN_ROOM);
+			_menu.setDestinationText(OWN_ROOM);
 		} else if (_num == 7) {
 			_coreVar._currPlace = ATTIC;
-			_menu.setDestinationMenuText(ATTIC);
+			_menu.setDestinationText(ATTIC);
 		}
 		
 		if (_num != 6)
@@ -86,7 +85,7 @@ void MortevielleEngine::fctMove() {
 			showMoveMenuAlert();
 		return;
 	}
-	tsort();
+	exitRoom();
 	int menuChoice = 1;
 
 	while (_menu._moveMenu[menuChoice] != _msg[4])
@@ -97,14 +96,14 @@ void MortevielleEngine::fctMove() {
 			gotoManorFront();
 		else if (menuChoice == 2)
 			checkManorDistance();
-		_menu.setDestinationMenuText(_coreVar._currPlace);
+		_menu.setDestinationText(_coreVar._currPlace);
 		return;
 	} else if (_coreVar._currPlace == INSIDE_WELL) {
 		if (menuChoice == 1)
 			floodedInWell();
 		else if (menuChoice == 2)
 			gotoManorBack();
-		_menu.setDestinationMenuText(_coreVar._currPlace);
+		_menu.setDestinationText(_coreVar._currPlace);
 		return;
 	} else if ((_coreVar._currPlace == BUREAU) && (menuChoice == 1))
 		menuChoice = 6;
@@ -174,7 +173,7 @@ void MortevielleEngine::fctMove() {
 	if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
 		affrep();
 	resetRoomVariables(_coreVar._currPlace);
-	_menu.setDestinationMenuText(_coreVar._currPlace);
+	_menu.setDestinationText(_coreVar._currPlace);
 }
 
 /**
@@ -226,15 +225,15 @@ void MortevielleEngine::fctTake() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	if (_caff == 3) {
-		tcoord(2);
+		setCoordinates(2);
 		if (_num == 1) {
 			_crep = 152;
 			return;
 		}
 	}
-	tcoord(5);
+	setCoordinates(5);
 	if ((_num == 0) || ((_num == 1) && (_coreVar._currPlace == CRYPT))) {
-		tcoord(8);
+		setCoordinates(8);
 		if (_num != 0) {
 			if (_currBitIndex > 0)
 				_coreVar._faithScore += 3;
@@ -302,14 +301,12 @@ void MortevielleEngine::fctTake() {
  * @remarks	Originally called 'tsprendre'
  */
 void MortevielleEngine::fctInventoryTake() {
-	int cx, cy, cz;
-
-	cx = 0;
+	int cx = 0;
 	do {
 		++cx;
 	} while (_menu._inventoryMenu[cx] != _msg[4]);
-	cz = 0;
-	cy = 0;
+	int cz = 0;
+	int cy = 0;
 	do {
 		++cy;
 		if (ord(_coreVar._sjer[cy]) != 0)
@@ -317,7 +314,7 @@ void MortevielleEngine::fctInventoryTake() {
 	} while (cz != cx);
 	cz = ord(_coreVar._sjer[cy]);
 	_coreVar._sjer[cy] = chr(0);
-	modinv();
+	_menu.setInventoryText();
 	avpoing(cz);
 	_crep = 998;
 	clearScreenType2();
@@ -333,9 +330,9 @@ void MortevielleEngine::fctLift() {
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
-	tcoord(3);
+	setCoordinates(3);
 	if (_num == 0) {
-		tcoord(8);
+		setCoordinates(8);
 		if (_num != 0) {
 			if (_currBitIndex > 0)
 				++_coreVar._faithScore;
@@ -363,13 +360,13 @@ void MortevielleEngine::fctLift() {
  */
 void MortevielleEngine::fctRead() {
 	if (_caff > 99)
-		st4(_caff);
+		getReadDescription(_caff);
 	else {
 		if (!_syn)
 			ecr3(getEngineString(S_READ));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
-			tcoord(4);
+			setCoordinates(4);
 			if (_num != 0)
 				_crep = 107;
 		}
@@ -384,7 +381,7 @@ void MortevielleEngine::fctSelfRead() {
 	if (_coreVar._selectedObjectId == 0)
 		_crep = 186;
 	else
-		st4(_coreVar._selectedObjectId);
+		getReadDescription(_coreVar._selectedObjectId);
 }
 
 /**
@@ -403,9 +400,9 @@ void MortevielleEngine::fctLook() {
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
-	tcoord(5);
+	setCoordinates(5);
 	if (_num == 0) {
-		tcoord(8);
+		setCoordinates(8);
 		_crep = 131;
 		if (_num != 0) {
 			if (_coreVar._currPlace == ATTIC) {
@@ -484,7 +481,7 @@ void MortevielleEngine::fctSearch() {
 	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
 	if (_caff > 99) {
-		st7(_caff);
+		getSearchDescription(_caff);
 		return;
 	}
 
@@ -501,9 +498,9 @@ void MortevielleEngine::fctSearch() {
 		return;
 	}
 
-	tcoord(6);
+	setCoordinates(6);
 	if (_num == 0) {
-		tcoord(7);
+		setCoordinates(7);
 		if (_num != 0) {
 			int cx = 0;
 			do {
@@ -526,7 +523,7 @@ void MortevielleEngine::fctSearch() {
 					_crep = 997;
 			}
 		} else {
-			tcoord(8);
+			setCoordinates(8);
 			_crep = 997;
 			if (_num != 0) {
 				if (_currBitIndex > 0)
@@ -575,7 +572,7 @@ void MortevielleEngine::fctSearch() {
  */
 void MortevielleEngine::fctSelfSearch() {
 	if (_coreVar._selectedObjectId != 0)
-		st7(_coreVar._selectedObjectId);
+		getSearchDescription(_coreVar._selectedObjectId);
 	else
 		_crep = 186;
 }
@@ -606,7 +603,7 @@ void MortevielleEngine::fctOpen() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 
-	tcoord(7);
+	setCoordinates(7);
 	if (_num != 0) {
 		if (_currBitIndex > 0)
 			_coreVar._faithScore += 2;
@@ -662,7 +659,7 @@ void MortevielleEngine::fctPlace() {
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 
-	tcoord(8);
+	setCoordinates(8);
 	if (_num != 0) {
 		_crep = 999;
 		if (_caff == 13) {
@@ -719,11 +716,11 @@ void MortevielleEngine::fctPlace() {
 						_menu.displayMenu();
 						if (enterPassageFl) {
 							_coreVar._currPlace = SECRET_PASSAGE;
-							_menu.setDestinationMenuText(SECRET_PASSAGE);
+							_menu.setDestinationText(SECRET_PASSAGE);
 						} else {
-							_menu.setDestinationMenuText(_coreVar._currPlace);
+							_menu.setDestinationText(_coreVar._currPlace);
 							setPal(14);
-							dessin(0);
+							dessin();
 							aniof(1, 2);
 							aniof(1, 1);
 							alertTxt = getString(577);
@@ -790,7 +787,7 @@ void MortevielleEngine::fctTurn() {
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
-	tcoord(9);
+	setCoordinates(9);
 	if (_num != 0) {
 		_crep = 997;
 		if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
@@ -825,7 +822,7 @@ void MortevielleEngine::fctSelfHide() {
 		ecr3(getEngineString(S_HIDE_SELF));
 	tfleche();
 	if (!(_anyone) && !(_keyPressedEsc)) {
-		tcoord(10);
+		setCoordinates(10);
 		if (_num == 0)
 			_hiddenHero = false;
 		else {
@@ -847,7 +844,7 @@ void MortevielleEngine::fctAttach() {
 			ecr3(getEngineString(S_TIE));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
-			tcoord(8);
+			setCoordinates(8);
 			_crep = 997;
 			if ((_num != 0) && (_coreVar._currPlace == WELL)) {
 				_crep = 999;
@@ -876,7 +873,7 @@ void MortevielleEngine::fctClose() {
 			_crep = 998;
 		if ((_anyone) || (_keyPressedEsc))
 			return;
-		tcoord(7);
+		setCoordinates(7);
 		if (_num != 0) {
 			int cx = 0;
 			do {
@@ -969,7 +966,7 @@ void MortevielleEngine::fctSelfPut() {
 		tfleche();
 		if ((_anyone) || (_keyPressedEsc))
 			return;
-		tcoord(7);
+		setCoordinates(7);
 		_crep = 124;
 		if (_num != 0) {
 			int chai;
@@ -989,7 +986,7 @@ void MortevielleEngine::fctSelfPut() {
 				}
 			}
 		} else {
-			tcoord(8);
+			setCoordinates(8);
 			if (_num != 0) {
 				_crep = 998;
 				if (_caff == PURPLE_ROOM) {
@@ -1026,7 +1023,7 @@ void MortevielleEngine::fctSelfPut() {
 			} else {
 				_crep = 124;
 				if (_caff == WELL) {
-					tcoord(5);
+					setCoordinates(5);
 					if (_num != 0)
 						_crep = 185;
 				}
@@ -1089,11 +1086,11 @@ void MortevielleEngine::fctEat() {
 	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
 		_crep = 148;
 	} else {
-		tsort();
+		exitRoom();
 		_coreVar._currPlace = DINING_ROOM;
 		_caff = 10;
 		resetRoomVariables(_coreVar._currPlace);
-		_menu.setDestinationMenuText(_coreVar._currPlace);
+		_menu.setDestinationText(_coreVar._currPlace);
 
 		int j, h, m;
 		updateHour(j, h, m);
@@ -1129,7 +1126,7 @@ void MortevielleEngine::fctEat() {
 void MortevielleEngine::fctEnter() {
 	if ((_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) {
 		gotoDiningRoom();
-		_menu.setDestinationMenuText(_coreVar._currPlace);
+		_menu.setDestinationText(_coreVar._currPlace);
 	} else if (_coreVar._currPlace == LANDING)
 		showMoveMenuAlert();
 	else if (_ment == 0)
@@ -1140,7 +1137,7 @@ void MortevielleEngine::fctEnter() {
 	} else {
 		int z = 0;
 		if (!_blo)
-			z = t11(_ment);
+			z = getPresence(_ment);
 		if (z != 0) {
 			if ((_ment == 3) || (_ment == 7))
 				_crep = 179;
@@ -1173,7 +1170,7 @@ void MortevielleEngine::fctEnter() {
 			_coreVar._currPlace = _ment;
 			affrep();
 			resetRoomVariables(_coreVar._currPlace);
-			_menu.setDestinationMenuText(_coreVar._currPlace);
+			_menu.setDestinationText(_coreVar._currPlace);
 			_ment = 0;
 			_savedBitIndex = 0;
 			_currBitIndex = 0;
@@ -1193,12 +1190,12 @@ void MortevielleEngine::fctSleep() {
 		return;
 	}
 	if (_coreVar._currPlace != OWN_ROOM) {
-		tsort();
+		exitRoom();
 		_coreVar._currPlace = OWN_ROOM;
 		affrep();
 		afdes();
 		resetRoomVariables(_coreVar._currPlace);
-		_menu.setDestinationMenuText(_coreVar._currPlace);
+		_menu.setDestinationText(_coreVar._currPlace);
 	}
 	clearScreenType3();
 	clearScreenType2();
@@ -1253,7 +1250,7 @@ void MortevielleEngine::fctForce() {
  * @remarks	Originally called 'tsortir'
  */
 void MortevielleEngine::fctLeave() {
-	tsort();
+	exitRoom();
 	_crep = 0;
 	if ((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK) || (_coreVar._currPlace == WELL))
 		_crep = 997;
@@ -1270,7 +1267,7 @@ void MortevielleEngine::fctLeave() {
 			nextPlace = SECRET_PASSAGE;
 			_crep = 176;
 		} else if (_coreVar._currPlace == SECRET_PASSAGE)
-			nextPlace = t23coul();
+			nextPlace = checkLeaveSecretPassage();
 		else if (_coreVar._currPlace == INSIDE_WELL)
 			nextPlace = WELL;
 
@@ -1281,7 +1278,7 @@ void MortevielleEngine::fctLeave() {
 		if (_crep == 0)
 			_crep = nextPlace;
 		resetRoomVariables(nextPlace);
-		_menu.setDestinationMenuText(nextPlace);
+		_menu.setDestinationText(nextPlace);
 	}
 }
 
@@ -1298,7 +1295,7 @@ void MortevielleEngine::fctWait() {
 		++_jh;
 		prepareRoom();
 		if (!_blo)
-			t11(_coreVar._currPlace);
+			getPresence(_coreVar._currPlace);
 		if ((_currBitIndex != 0) && (_savedBitIndex == 0)) {
 			_crep = 998;
 			if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR))
@@ -1357,7 +1354,7 @@ void MortevielleEngine::fctDiscuss() {
 		repon(2, _caff);
 		suj = _caff + 60;
 	}
-	tkey1(false);
+	testKey(false);
 	mennor();
 	_mouse.hideMouse();
 	hirs();
@@ -1527,7 +1524,7 @@ void MortevielleEngine::fctDiscuss() {
 	drawClock();
 	affrep();
 	/* chech;*/
-	_menu.setDestinationMenuText(_coreVar._currPlace);
+	_menu.setDestinationText(_coreVar._currPlace);
 	clearScreenType3();
 }
 
@@ -1575,7 +1572,7 @@ void MortevielleEngine::endGame() {
 	clearScreenType2();
 	clearScreenType3();
 	repon(9, 1509);
-	tkey1(false);
+	testKey(false);
 	_mouse.hideMouse();
 	_caff = 70;
 	taffich();
@@ -1586,18 +1583,18 @@ void MortevielleEngine::endGame() {
 	clearScreenType1();
 	repon(9, 1509);
 	repon(2, 142);
-	tkey1(false);
+	testKey(false);
 	_caff = 32;
 	afdes();
 	repon(6, 34);
 	repon(2, 35);
 	startMusicOrSpeech(0);
-	tkey1(false);
+	testKey(false);
 	// A wait message was displayed. 
-	// tkey1 was called before and after.
+	// testKey (aka tkey1) was called before and after.
 	// Most likely the double call is useless, thus removed
 	//
-	// tkey1(false);
+	// testKey(false);
 	resetVariables();
 }
 
@@ -1608,7 +1605,7 @@ void MortevielleEngine::endGame() {
 void MortevielleEngine::askRestart() {
 	clearScreenType2();
 	startMusicOrSpeech(0);
-	tkey1(false);
+	testKey(false);
 	displayEmptyHand();
 	resetVariables();
 	initGame();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 1f97ee0..19ff580 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -29,7 +29,6 @@
 #include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/speech.h"
@@ -61,7 +60,7 @@ int Alert::show(const Common::String &msg, int n) {
 
 	g_vm->setMouseClick(false);
 	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
-	sauvecr(50, (NUM_LINES + 1) << 4);
+	g_vm->sauvecr(50, (NUM_LINES + 1) << 4);
 
 	i = 0;
 	if (chaine == "") {
@@ -170,7 +169,7 @@ int Alert::show(const Common::String &msg, int n) {
 		tmp4 += " ";
 		g_vm->_screenSurface.drawString(tmp4, 1);
 	}
-	charecr(50, (NUM_LINES + 1) << 4);
+	g_vm->charecr(50, (NUM_LINES + 1) << 4);
 	g_vm->_mouse.showMouse();
 
 	/* Restore the background area */
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 5bc0940..d7ece8a 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -29,7 +29,6 @@
 #include "common/str.h"
 #include "common/textconsole.h"
 #include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
@@ -88,7 +87,7 @@ void Menu::setText(int menuId, Common::String name) {
  * Init destination menu
  * @remarks	Originally called 'tmlieu'
  */
-void Menu::setDestinationMenuText(int roomId) {
+void Menu::setDestinationText(int roomId) {
 	Common::String nomp;
 
 	if (roomId == 26)
@@ -323,7 +322,7 @@ void Menu::menuDown(int ii) {
 	xco = _menuConstants[ii - 1][0];
 	lignNumb = _menuConstants[ii - 1][3];
 	g_vm->_mouse.hideMouse();
-	sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
+	g_vm->sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (g_vm->_res == 1)
 		cx = 10;
@@ -396,7 +395,7 @@ void Menu::menuDown(int ii) {
  */
 void Menu::menuUp(int xx) {
 	if (_multiTitle) {
-		charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
+		g_vm->charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
@@ -538,7 +537,7 @@ void Menu::initMenu() {
 			_moveMenu[i] = 0x200 + i;
 		_inventoryMenu[i] = 0x100 + i;
 		if (i > 6)
-			g_vm->_menu.disableMenuItem(_inventoryMenu[i]);
+			disableMenuItem(_inventoryMenu[i]);
 	}
 	_msg3 = OPCODE_NONE;
 	_msg4 = OPCODE_NONE;
@@ -567,7 +566,7 @@ void Menu::setSearchMenu() {
  * @remarks	Originally called 'mfouen'
  */
 void Menu::unsetSearchMenu() {
-	setDestinationMenuText(g_vm->_coreVar._currPlace);
+	setDestinationText(g_vm->_coreVar._currPlace);
 	for (int i = 1; i <= 11; ++i)
 		enableMenuItem(_actionMenu[i]);
 
@@ -575,4 +574,30 @@ void Menu::unsetSearchMenu() {
 	setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
 }
 
+/**
+ * Set Inventory menu texts
+ * @remarks	Originally called 'modinv'
+ */
+void Menu::setInventoryText() {
+	int r;
+	Common::String nomp;
+
+	int cy = 0;
+	for (int i = 1; i <= 6; ++i) {
+		if (g_vm->_coreVar._sjer[i] != chr(0)) {
+			++cy;
+			r = (ord(g_vm->_coreVar._sjer[i]) + 400);
+			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
+			setText(_inventoryMenu[cy], nomp);
+			enableMenuItem(_inventoryMenu[i]);
+		}
+	}
+
+	if (cy < 6) {
+		for (int i = cy + 1; i <= 6; ++i) {
+			setText(_inventoryMenu[i], "                       ");
+			disableMenuItem(_inventoryMenu[i]);
+		}
+	}
+}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index f4d12bc..37612ed 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -62,7 +62,8 @@ public:
 	int _moveMenu[8];
 
 	void setText(int menuId, Common::String name);
-	void setDestinationMenuText(int roomId);
+	void setDestinationText(int roomId);
+	void setInventoryText();
 	void disableMenuItem(int menuId);
 	void enableMenuItem(int menuId);
 	void displayMenu();
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 58978c9..fe02e11 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -7,7 +7,6 @@ MODULE_OBJS := \
 	graphics.o \
 	keyboard.o \
 	menu.o \
-	mor.o \
 	mortevielle.o \
 	mouse.o \
 	outtext.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
deleted file mode 100644
index 09857c8..0000000
--- a/engines/mortevielle/mor.cpp
+++ /dev/null
@@ -1,618 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/endian.h"
-#include "common/file.h"
-#include "common/str.h"
-#include "common/system.h"
-#include "common/textconsole.h"
-#include "mortevielle/dialogs.h"
-#include "mortevielle/graphics.h"
-#include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-#include "mortevielle/speech.h"
-#include "mortevielle/var_mor.h"
-
-#include "mortevielle/keyboard.h"
-
-namespace Mortevielle {
-
-/* NIVEAU 10 */
-void phaz(int &rand, int &p, int cf) {
-	p += cf;
-	rand = g_vm->getRandomNumber(1, 100);
-}
-
-int t11(int roomId) {
-	int retVal = 0;
-	int rand;
-
-	int p = g_vm->getPresenceStats(rand, g_vm->_coreVar._faithScore, roomId);
-	g_vm->_place = roomId;
-	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
-		if (p != -500) {
-			if (rand > p) {
-				g_vm->displayAloneText();
-				retVal = 0;
-			} else {
-				g_vm->setPresenceFlags(g_vm->_place);
-				retVal = g_vm->getPresenceBitIndex(g_vm->_place);
-			}
-		} else
-			retVal = g_vm->getPresenceBitIndex(g_vm->_place);
-	}
-
-	if (roomId > ROOM9) {
-		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != ROOM26))
-			g_vm->displayAloneText();
-		else {
-			int h = 0;
-			if (roomId == DINING_ROOM)
-				p = g_vm->getPresenceStatsDiningRoom(h);
-			else if (roomId == BUREAU)
-				p = g_vm->getPresenceStatsBureau(h);
-			else if (roomId == KITCHEN)
-				p = g_vm->getPresenceStatsKitchen();
-			else if ((roomId == ATTIC) || (roomId == CELLAR))
-				p = g_vm->getPresenceStatsAttic();
-			else if ((roomId == LANDING) || (roomId == ROOM26))
-				p = g_vm->getPresenceStatsLanding();
-			else if (roomId == CHAPEL)
-				p = g_vm->getPresenceStatsChapel(h);
-			p += g_vm->_coreVar._faithScore;
-			rand = g_vm->getRandomNumber(1, 100);
-			if (rand > p) {
-				g_vm->displayAloneText();
-				retVal = 0;
-			} else {
-				if (roomId == DINING_ROOM)
-					p = g_vm->setPresenceDiningRoom(h);
-				else if (roomId == BUREAU)
-					p = g_vm->setPresenceBureau(h);
-				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
-					p = g_vm->setPresenceKitchen();
-				else if ((roomId == LANDING) || (roomId == ROOM26))
-					p = g_vm->setPresenceLanding();
-				else if (roomId == CHAPEL)
-					p = g_vm->setPresenceChapel(h);
-				retVal = p;
-			}
-		}
-	}
-
-	return retVal;
-}
-
-void writetp(Common::String s, int t) {
-	if (g_vm->_res == 2)
-		g_vm->_screenSurface.drawString(s, t);
-	else
-		g_vm->_screenSurface.drawString(g_vm->copy(s, 1, 25), t);
-}
-
-void aniof(int ouf, int num) {
-	if ((g_vm->_caff == 7) && ((num == 4) || (num == 5)))
-		return;
-	
-	if ((g_vm->_caff == 10) && (num == 7))
-		num = 6;
-	else if (g_vm->_caff == 12) {
-		if (num == 3)
-			num = 4;
-		else if (num == 4)
-			num = 3;
-	}
-
-	int ad = kAdrAni;
-	int offset = g_vm->animof(ouf, num);
-
-	GfxSurface surface;
-	surface.decode(&g_vm->_mem[ad * 16 + offset]);
-	g_vm->_screenSurface.drawPicture(surface, 0, 12);
-
-	g_vm->prepareScreenType1();
-}
-
-/* NIVEAU 9 */
-void dessin(int ad) {
-	if (ad != 0)
-		g_vm->draw(kAdrDes, ((ad % 160) * 2), (ad / 160));
-	else {
-		g_vm->clearScreenType1();
-		if (g_vm->_caff > 99) {
-			g_vm->draw(kAdrDes, 60, 33);
-			g_vm->_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
-		} else if (g_vm->_caff > 69) {
-			g_vm->draw(kAdrDes, 112, 48);           // Heads
-			g_vm->_screenSurface.drawBox(222, 47, 155, 91, 15);
-		} else {
-			g_vm->draw(kAdrDes, 0, 12);
-			g_vm->prepareScreenType1();
-			if ((g_vm->_caff < 30) || (g_vm->_caff > 32)) {
-				for (int cx = 1; cx <= 6; ++cx) {
-					if (ord(g_vm->_touv[cx]) != 0)
-						aniof(1, ord(g_vm->_touv[cx]));
-				}
-
-				if (g_vm->_caff == 13) {
-					if (g_vm->_coreVar._atticBallHoleObjectId == 141)
-						aniof(1, 7);
-
-					if (g_vm->_coreVar._atticRodHoleObjectId == 159)
-						aniof(1, 6);
-				} else if ((g_vm->_caff == 14) && (g_vm->_coreVar._cellarObjectId == 151))
-					aniof(1, 2);
-				else if ((g_vm->_caff == 17) && (g_vm->_coreVar._secretPassageObjectId == 143))
-					aniof(1, 1);
-				else if ((g_vm->_caff == 24) && (g_vm->_coreVar._wellObjectId != 0))
-					aniof(1, 1);
-			}
-			
-			if (g_vm->_caff < ROOM26)
-				g_vm->startMusicOrSpeech(1);
-		}
-	}
-}
-
-void fenat(char ans) {
-	int coul;
-
-	g_vm->_mouse.hideMouse();
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
-		coul = 2;
-	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
-		coul = 1;
-	else
-		coul = 12;
-
-	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
-	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
-	g_vm->_mouse.showMouse();
-}
-
-
-/* NIVEAU 8 */
-void afdes() {
-	taffich();
-	dessin(0);
-	g_vm->_okdes = false;
-}
-
-void tkey1(bool d) {
-	bool quest = false;
-	int x, y, c;
-
-	g_vm->_mouse.hideMouse();
-	fenat('K');
-
-	// Wait for release from any key or mouse button
-	while (g_vm->keyPressed())
-		g_vm->_key = testou();
-
-	do {
-		g_vm->_mouse.getMousePosition(x, y, c);
-		g_vm->keyPressed();
-	} while (c != 0);
-	
-	// Event loop
-	do {
-		if (d)
-			g_vm->prepareRoom();
-		quest = g_vm->keyPressed();
-		g_vm->_mouse.getMousePosition(x, y, c);
-		CHECK_QUIT;
-	} while (!(quest || (c != 0) || (d && g_vm->_anyone)));
-	if (quest)
-		testou();
-	g_vm->setMouseClick(false);
-	g_vm->_mouse.showMouse();
-}
-
-/* NIVEAU 7 */
-void tlu(int af, int ob) {
-	g_vm->_caff = 32;
-	afdes();
-	g_vm->repon(6, ob + 4000);
-	g_vm->repon(2, 999);
-	tkey1(true);
-	g_vm->_caff = af;
-	g_vm->_msg[3] = OPCODE_NONE;
-	g_vm->_crep = 998;
-}
-
-void affrep() {
-	g_vm->_caff = g_vm->_coreVar._currPlace;
-	g_vm->_crep = g_vm->_coreVar._currPlace;
-}
-
-void tsort() {
-
-	if ((g_vm->_iouv > 0) && (g_vm->_coreVar._currPlace != 0)) {
-		if (g_vm->_coreVar._faithScore < 50)
-			g_vm->_coreVar._faithScore += 2;
-		else
-			g_vm->_coreVar._faithScore += (g_vm->_coreVar._faithScore / 10);
-	}
-
-	for (int cx = 1; cx <= 7; ++cx)
-		g_vm->_touv[cx] = chr(0);
-	g_vm->_ment = 0;
-	g_vm->_iouv = 0;
-	g_vm->_mchai = 0;
-	g_vm->resetRoomVariables(g_vm->_coreVar._currPlace);
-}
-
-void st4(int ob) {
-	g_vm->_crep = 997;
-
-	switch (ob) {
-	case 114 :
-		g_vm->_crep = 109;
-		break;
-	case 110 :
-		g_vm->_crep = 107;
-		break;
-	case 158 :
-		g_vm->_crep = 113;
-		break;
-	case 152:
-	case 153:
-	case 154:
-	case 155:
-	case 156:
-	case 150:
-	case 100:
-	case 157:
-	case 160:
-	case 161 :
-		tlu(g_vm->_caff, ob);
-		break;
-	default:
-		break;
-	}
-}
-
-void modinv() {
-	int r;
-	Common::String nomp;
-
-	int cy = 0;
-	for (int i = 1; i <= 6; ++i) {
-		if (g_vm->_coreVar._sjer[i] != chr(0)) {
-			++cy;
-			r = (ord(g_vm->_coreVar._sjer[i]) + 400);
-			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
-			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[cy], nomp);
-			g_vm->_menu.enableMenuItem(g_vm->_menu._inventoryMenu[i]);
-		}
-	}
-
-	if (cy < 6) {
-		for (int i = cy + 1; i <= 6; ++i) {
-			g_vm->_menu.setText(g_vm->_menu._inventoryMenu[i], "                       ");
-			g_vm->_menu.disableMenuItem(g_vm->_menu._inventoryMenu[i]);
-		}
-	}
-}
-
-void mennor() {
-	g_vm->_menu.menuUp(g_vm->_msg[3]);
-}
-
-void premtet() {
-	g_vm->draw(kAdrDes, 10, 80);
-	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
-}
-
-/* NIVEAU 5 */
-void ajchai() {
-	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-	} while ((cx <= 9) && (g_vm->_tabdon[cy + cx] != 0));
-
-	if (g_vm->_tabdon[cy + cx] == 0)
-		g_vm->_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
-	else
-		g_vm->_crep = 192;
-}
-
-void ajjer(int ob) {
-	int cx = 0;
-	do {
-		++cx;
-	} while ((cx <= 5) && (ord(g_vm->_coreVar._sjer[cx]) != 0));
-
-	if (ord(g_vm->_coreVar._sjer[cx]) == 0) {
-		g_vm->_coreVar._sjer[(cx)] = chr(ob);
-		modinv();
-	} else
-		g_vm->_crep = 139;
-}
-
-void quelquun() {
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.eraseMenu();
-
-	g_vm->endSearch();
-	g_vm->_crep = 997;
-L1:
-	if (!g_vm->_hiddenHero) {
-		if (g_vm->_crep == 997)
-			g_vm->_crep = 138;
-		g_vm->repon(2, g_vm->_crep);
-		if (g_vm->_crep == 138)
-			g_vm->_speechManager.startSpeech(5, 2, 1);
-		else
-			g_vm->_speechManager.startSpeech(4, 4, 1);
-
-		if (g_vm->_iouv == 0)
-			g_vm->_coreVar._faithScore += 2;
-		else if (g_vm->_coreVar._faithScore < 50)
-			g_vm->_coreVar._faithScore += 4;
-		else
-			g_vm->_coreVar._faithScore += 3 * (g_vm->_coreVar._faithScore / 10);
-		tsort();
-		g_vm->_menu.setDestinationMenuText(LANDING);
-		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
-		g_vm->_caff = 69 + cx;
-		g_vm->_crep = g_vm->_caff;
-		g_vm->_msg[3] = MENU_DISCUSS;
-		g_vm->_msg[4] = g_vm->_menu._discussMenu[cx];
-		g_vm->_syn = true;
-		g_vm->_col = true;
-	} else {
-		if (g_vm->getRandomNumber(1, 3) == 2) {
-			g_vm->_hiddenHero = false;
-			g_vm->_crep = 137;
-			goto L1;
-		} else {
-			g_vm->repon(2, 136);
-			int rand = (g_vm->getRandomNumber(0, 4)) - 2;
-			g_vm->_speechManager.startSpeech(3, rand, 1);
-			g_vm->clearScreenType2();
-			g_vm->displayAloneText();
-			g_vm->resetRoomVariables(MANOR_FRONT);
-			affrep();
-		}
-	}
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.drawMenu();
-}
-
-void tsuiv() {
-	int tbcl;
-	int cl;
-
-	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-		++g_vm->_cs;
-		cl = cy + g_vm->_cs;
-		tbcl = g_vm->_tabdon[cl];
-	} while ((tbcl == 0) && (g_vm->_cs <= 9));
-
-	if ((tbcl != 0) && (g_vm->_cs < 11)) {
-		++g_vm->_is;
-		g_vm->_caff = tbcl;
-		g_vm->_crep = g_vm->_caff + 400;
-		if (g_vm->_currBitIndex != 0)
-			g_vm->_coreVar._faithScore += 2;
-	} else {
-		affrep();
-		g_vm->endSearch();
-		if (cx > 9)
-			g_vm->_crep = 131;
-	}
-}
-
-void tfleche() {
-	bool qust;
-	char touch;
-
-	if (g_vm->_num == 9999)
-		return;
-
-	fenat(chr(152));
-	bool inRect = false;
-	do {
-		touch = '\0';
-
-		do {
-			g_vm->_mouse.moveMouse(qust, touch);
-			CHECK_QUIT;
-
-			if (g_vm->getMouseClick())
-				inRect = (g_vm->_mouse._pos.x < 256 * g_vm->_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
-			g_vm->prepareRoom();
-		} while (!(qust || inRect || g_vm->_anyone));
-
-		if (qust && (touch == '\103'))
-			Alert::show(g_vm->_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_vm->_x != 0) && (g_vm->_y != 0)) || (g_vm->_anyone) || (inRect)));
-
-	if (touch == '\73')
-		g_vm->_keyPressedEsc = true;
-
-	if (inRect) {
-		g_vm->_x = g_vm->_mouse._pos.x;
-		g_vm->_y = g_vm->_mouse._pos.y;
-	}
-}
-
-void tcoord(int sx) {
-	int sy, ix, iy;
-	int ib;
-
-
-	g_vm->_num = 0;
-	g_vm->_crep = 999;
-	int a = 0;
-	int atdon = amzon + 3;
-	int cy = 0;
-	while (cy < g_vm->_caff) {
-		a += g_vm->_tabdon[atdon];
-		atdon += 4;
-		++cy;
-	}
-
-	if (g_vm->_tabdon[atdon] == 0) {
-		g_vm->_crep = 997;
-		return;
-	}
-
-	a += kFleche;
-	int cb = 0;
-	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
-		cb += (ib * 4) + 2;
-	}
-	ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
-	if (ib == 0) {
-		g_vm->_crep = 997;
-		return;
-	}
-
-	cy = 1;
-	do {
-		cb += 2;
-		sx = g_vm->_tabdon[a + cb] * g_vm->_res;
-		sy = g_vm->_tabdon[(a + cb + 1)];
-		cb += 2;
-		ix = g_vm->_tabdon[a + cb] * g_vm->_res;
-		iy = g_vm->_tabdon[(a + cb + 1)];
-		++cy;
-	} while (!(((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) || (cy > ib)));
-
-	if ((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) {
-		g_vm->_num = cy - 1;
-		return;
-	}
-
-	g_vm->_crep = 997;
-}
-
-
-void st7(int ob) {
-	switch (ob) {
-	case 116:
-	case 144:
-		g_vm->_crep = 104;
-		break;
-	case 126:
-	case 111:
-		g_vm->_crep = 108;
-		break;
-	case 132:
-		g_vm->_crep = 111;
-		break;
-	case 142:
-		g_vm->_crep = 112;
-		break;
-	default:
-		g_vm->_crep = 183;
-		st4(ob);
-	}
-}
-
-void treg(int ob) {
-	int mdes = g_vm->_caff;
-	g_vm->_caff = ob;
-
-	if (((g_vm->_caff > 29) && (g_vm->_caff < 33)) || (g_vm->_caff == 144) || (g_vm->_caff == 147) || (g_vm->_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
-		afdes();
-		if ((g_vm->_caff > 29) && (g_vm->_caff < 33))
-			g_vm->repon(2, g_vm->_caff);
-		else
-			g_vm->repon(2, g_vm->_caff + 400);
-		tkey1(true);
-		g_vm->_caff = mdes;
-		g_vm->_msg[3] = 0;
-		g_vm->_crep = 998;
-	} else {
-		g_vm->_obpart = true;
-		g_vm->_crep = g_vm->_caff + 400;
-		g_vm->_menu.setSearchMenu();
-	}
-}
-
-void avpoing(int &ob) {
-	g_vm->_crep = 999;
-	if (g_vm->_coreVar._selectedObjectId != 0)
-		ajjer(g_vm->_coreVar._selectedObjectId);
-
-	if (g_vm->_crep != 139) {
-		g_vm->displayItemInHand(ob + 400);
-		g_vm->_coreVar._selectedObjectId = ob;
-		ob = 0;
-	}
-}
-
-void rechai(int &ch) {
-	int tmpPlace = g_vm->_coreVar._currPlace;
-
-	if (g_vm->_coreVar._currPlace == CRYPT)
-		tmpPlace = CELLAR;
-	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_vm->_num - 1];
-}
-
-int t23coul() {
-	if (!g_vm->checkInventory(143)) {
-		g_vm->_crep = 1512;
-		g_vm->loseGame();
-	}
-
-	return CELLAR;
-}
-
-void st13(int ob) {
-	if ((ob == 114) || (ob == 116) || (ob == 126) || (ob == 132) ||
-	    (ob == 111) || (ob == 106) || (ob == 102) || (ob == 100) ||
-	    (ob == 110) || (ob == 153) || (ob == 154) || (ob == 155) ||
-	    (ob == 156) || (ob == 157) || (ob == 144) || (ob == 158) ||
-	    (ob == 150) || (ob == 152))
-		g_vm->_crep = 999;
-	else
-		g_vm->_crep = 105;
-}
-
-void sauvecr(int y, int dy) {
-//	g_vm->_mouse.hideMouse();
-//	g_vm->_mouse.showMouse();
-}
-
-void charecr(int y, int dy) {
-//	g_vm->_mouse.hideMouse();
-//	g_vm->_mouse.showMouse();
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
deleted file mode 100644
index b55dc46..0000000
--- a/engines/mortevielle/mor.h
+++ /dev/null
@@ -1,82 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_MOR_H
-#define MORTEVIELLE_MOR_H
-
-#include "common/str.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-const int kTime1 = 410;
-const int kTime2 = 250;
-
-static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
-};
-
-/* NIVEAU 10 */
-extern void phaz(int &rand, int &p, int cf);
-extern int t11(int roomId);
-extern void writetp(Common::String s, int t);
-extern void aniof(int ouf, int num);
-/* NIVEAU 9 */
-extern void dessin(int ad);
-extern void fenat(char ans);
-/* NIVEAU 8 */
-extern void afdes();
-extern void tkey1(bool d);
-/* NIVEAU 7 */
-extern void tlu(int af, int ob);
-extern void affrep();
-/* NIVEAU 6 */
-extern void tsort();
-extern void st4(int ob);
-extern void modinv();
-extern void mennor();
-extern void premtet();
-/* NIVEAU 5 */
-extern void ajchai();
-extern void ajjer(int ob);
-extern void quelquun();
-extern void tsuiv();
-extern void tfleche();
-extern void tcoord(int sx);
-extern void st7(int ob);
-extern void treg(int ob);
-extern void avpoing(int &ob);
-extern void rechai(int &ch);
-extern int t23coul();
-extern void st13(int ob);
-
-extern void sauvecr(int y, int dy);
-extern void charecr(int y, int dy);
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index cd5c215..6d1a949 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -32,7 +32,6 @@
 #include "mortevielle/dialogs.h"
 #include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/saveload.h"
@@ -697,7 +696,7 @@ void MortevielleEngine::handleAction() {
 					taffich();
 					if (_okdes) {
 						_okdes = false;
-						dessin(0);
+						dessin();
 					}
 					if ((!_syn) || (_col))
 						repon(2, _crep);
@@ -1658,7 +1657,7 @@ void MortevielleEngine::loseGame() {
 	_mchai = 0;
 	_menu.unsetSearchMenu();
 	if (!_blo)
-		t11(MANOR_FRONT);
+		getPresence(MANOR_FRONT);
 
 	_loseGame = true;
 	clearScreenType1();
@@ -1753,7 +1752,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		afdes();
 		_screenSurface.drawBox(223, 47, 155, 91, 15);
 		repon(2, 33);
-		tkey1(false);
+		testKey(false);
 		mennor();
 		_mouse.hideMouse();
 		hirs();
@@ -1766,7 +1765,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		affrep();
 		resetPresenceInRooms(DINING_ROOM);
 		if (!_blo)
-			minute = t11(OWN_ROOM);
+			getPresence(OWN_ROOM);
 		_currBitIndex = 0;
 		_savedBitIndex = 0;
 		_coreVar._alreadyEnteredManor = true;
@@ -1889,8 +1888,8 @@ void MortevielleEngine::gameLoaded() {
 	repon(2, _crep);
 	clearScreenType3();
 	_endGame = false;
-	_menu.setDestinationMenuText(_coreVar._currPlace);
-	modinv();
+	_menu.setDestinationText(_coreVar._currPlace);
+	_menu.setInventoryText();
 	if (_coreVar._selectedObjectId != 0)
 		displayItemInHand(_coreVar._selectedObjectId + 400);
 	_mouse.showMouse();
@@ -1975,7 +1974,7 @@ void MortevielleEngine::handleOpcode() {
 			fctSelfHide();
 	} else {
 		if (_anyone) {
-			quelquun();
+			interactNPC();
 			_anyone = false;
 			mennor();
 			return;
@@ -3118,39 +3117,594 @@ int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
  */
 void MortevielleEngine::setPresenceFlags(int roomId) {
 	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
-		int rand = g_vm->getRandomNumber(1, 2);
+		int rand = getRandomNumber(1, 2);
 		if (roomId == GREEN_ROOM) {
 			if (rand == 1)
-				g_vm->_roomPresenceLuc = true;
+				_roomPresenceLuc = true;
 			else
-				g_vm->_roomPresenceIda = true;
+				_roomPresenceIda = true;
 		} else { // roomId == DARKBLUE_ROOM
 			if (rand == 1)
-				g_vm->_roomPresenceGuy = true;
+				_roomPresenceGuy = true;
 			else
-				g_vm->_roomPresenceEva = true;
+				_roomPresenceEva = true;
 		}
 	} else if (roomId == PURPLE_ROOM)
-		g_vm->_purpleRoomPresenceLeo = true;
+		_purpleRoomPresenceLeo = true;
 	else if (roomId == TOILETS)
-		g_vm->_toiletsPresenceBobMax = true;
+		_toiletsPresenceBobMax = true;
 	else if (roomId == BLUE_ROOM)
-		g_vm->_roomPresenceMax = true;
+		_roomPresenceMax = true;
 	else if (roomId == RED_ROOM)
-		g_vm->_roomPresenceBob = true;
+		_roomPresenceBob = true;
 	else if (roomId == BATHROOM)
-		g_vm->_bathRoomPresenceBobMax = true;
+		_bathRoomPresenceBobMax = true;
 	else if (roomId == GREEN_ROOM2)
-		g_vm->_roomPresencePat = true;
+		_roomPresencePat = true;
 	else if (roomId == ROOM9)
-		g_vm->_room9PresenceLeo = true;
+		_room9PresenceLeo = true;
 }
 
 void MortevielleEngine::init_nbrepm() {
 	static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 
 	for (int idx = 0; idx < 9; ++idx)
-		g_vm->_nbrepm[idx] = ipm[idx];
+		_nbrepm[idx] = ipm[idx];
+}
+
+void MortevielleEngine::phaz(int &rand, int &p, int cf) {
+	p += cf;
+	rand = getRandomNumber(1, 100);
+}
+
+/**
+ * Get Presence
+ * @remarks	Originally called 't11'
+ */
+int MortevielleEngine::getPresence(int roomId) {
+	int retVal = 0;
+	int rand;
+
+	int p = getPresenceStats(rand, _coreVar._faithScore, roomId);
+	_place = roomId;
+	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
+		if (p != -500) {
+			if (rand > p) {
+				displayAloneText();
+				retVal = 0;
+			} else {
+				setPresenceFlags(_place);
+				retVal = getPresenceBitIndex(_place);
+			}
+		} else
+			retVal = getPresenceBitIndex(_place);
+	}
+
+	if (roomId > ROOM9) {
+		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != ROOM26))
+			displayAloneText();
+		else {
+			int h = 0;
+			if (roomId == DINING_ROOM)
+				p = getPresenceStatsDiningRoom(h);
+			else if (roomId == BUREAU)
+				p = getPresenceStatsBureau(h);
+			else if (roomId == KITCHEN)
+				p = getPresenceStatsKitchen();
+			else if ((roomId == ATTIC) || (roomId == CELLAR))
+				p = getPresenceStatsAttic();
+			else if ((roomId == LANDING) || (roomId == ROOM26))
+				p = getPresenceStatsLanding();
+			else if (roomId == CHAPEL)
+				p = getPresenceStatsChapel(h);
+			p += _coreVar._faithScore;
+			rand = getRandomNumber(1, 100);
+			if (rand > p) {
+				displayAloneText();
+				retVal = 0;
+			} else {
+				if (roomId == DINING_ROOM)
+					p = setPresenceDiningRoom(h);
+				else if (roomId == BUREAU)
+					p = setPresenceBureau(h);
+				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
+					p = setPresenceKitchen();
+				else if ((roomId == LANDING) || (roomId == ROOM26))
+					p = setPresenceLanding();
+				else if (roomId == CHAPEL)
+					p = setPresenceChapel(h);
+				retVal = p;
+			}
+		}
+	}
+
+	return retVal;
+}
+
+void MortevielleEngine::writetp(Common::String s, int t) {
+	if (_res == 2)
+		_screenSurface.drawString(s, t);
+	else
+		_screenSurface.drawString(copy(s, 1, 25), t);
+}
+
+void MortevielleEngine::aniof(int ouf, int num) {
+	if ((_caff == 7) && ((num == 4) || (num == 5)))
+		return;
+	
+	if ((_caff == 10) && (num == 7))
+		num = 6;
+	else if (_caff == 12) {
+		if (num == 3)
+			num = 4;
+		else if (num == 4)
+			num = 3;
+	}
+
+	int ad = kAdrAni;
+	int offset = animof(ouf, num);
+
+	GfxSurface surface;
+	surface.decode(&_mem[ad * 16 + offset]);
+	_screenSurface.drawPicture(surface, 0, 12);
+
+	prepareScreenType1();
+}
+
+void MortevielleEngine::dessin() {
+	clearScreenType1();
+	if (_caff > 99) {
+		draw(kAdrDes, 60, 33);
+		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
+	} else if (_caff > 69) {
+		draw(kAdrDes, 112, 48);           // Heads
+		_screenSurface.drawBox(222, 47, 155, 91, 15);
+	} else {
+		draw(kAdrDes, 0, 12);
+		prepareScreenType1();
+		if ((_caff < 30) || (_caff > 32)) {
+			for (int cx = 1; cx <= 6; ++cx) {
+				if (ord(_touv[cx]) != 0)
+					aniof(1, ord(_touv[cx]));
+			}
+
+			if (_caff == 13) {
+				if (_coreVar._atticBallHoleObjectId == 141)
+					aniof(1, 7);
+
+				if (_coreVar._atticRodHoleObjectId == 159)
+					aniof(1, 6);
+			} else if ((_caff == 14) && (_coreVar._cellarObjectId == 151))
+				aniof(1, 2);
+			else if ((_caff == 17) && (_coreVar._secretPassageObjectId == 143))
+				aniof(1, 1);
+			else if ((_caff == 24) && (_coreVar._wellObjectId != 0))
+				aniof(1, 1);
+		}
+		
+		if (_caff < ROOM26)
+			startMusicOrSpeech(1);
+	}
+}
+
+void MortevielleEngine::afdes() {
+	taffich();
+	dessin();
+	_okdes = false;
+}
+
+/**
+ * Engine function - Place
+ * @remarks	Originally called 'tkey1'
+ */
+void MortevielleEngine::testKey(bool d) {
+	bool quest = false;
+	int x, y, c;
+
+	_mouse.hideMouse();
+	fenat('K');
+
+	// Wait for release from any key or mouse button
+	while (keyPressed())
+		_key = testou();
+
+	do {
+		_mouse.getMousePosition(x, y, c);
+		keyPressed();
+	} while (c != 0);
+	
+	// Event loop
+	do {
+		if (d)
+			prepareRoom();
+		quest = keyPressed();
+		_mouse.getMousePosition(x, y, c);
+		CHECK_QUIT;
+	} while (!(quest || (c != 0) || (d && _anyone)));
+	if (quest)
+		testou();
+	setMouseClick(false);
+	_mouse.showMouse();
+}
+
+void MortevielleEngine::tlu(int af, int ob) {
+	_caff = 32;
+	afdes();
+	repon(6, ob + 4000);
+	repon(2, 999);
+	testKey(true);
+	_caff = af;
+	_msg[3] = OPCODE_NONE;
+	_crep = 998;
+}
+
+void MortevielleEngine::affrep() {
+	_caff = _coreVar._currPlace;
+	_crep = _coreVar._currPlace;
+}
+
+/**
+ * Exit room
+ * @remarks	Originally called 'tsort'
+ */
+void MortevielleEngine::exitRoom() {
+	if ((_iouv > 0) && (_coreVar._currPlace != OWN_ROOM)) {
+		if (_coreVar._faithScore < 50)
+			_coreVar._faithScore += 2;
+		else
+			_coreVar._faithScore += (_coreVar._faithScore / 10);
+	}
+
+	for (int cx = 1; cx <= 7; ++cx)
+		_touv[cx] = chr(0);
+	_ment = 0;
+	_iouv = 0;
+	_mchai = 0;
+	resetRoomVariables(_coreVar._currPlace);
+}
+
+/**
+ * get 'read' description
+ * @remarks	Originally called 'st4'
+ */
+void MortevielleEngine::getReadDescription(int objId) {
+	_crep = 997;
+
+	switch (objId) {
+	case 114 :
+		_crep = 109;
+		break;
+	case 110 :
+		_crep = 107;
+		break;
+	case 158 :
+		_crep = 113;
+		break;
+	case 152:
+	case 153:
+	case 154:
+	case 155:
+	case 156:
+	case 150:
+	case 100:
+	case 157:
+	case 160:
+	case 161 :
+		tlu(_caff, objId);
+		break;
+	default:
+		break;
+	}
+}
+
+/**
+ * get 'search' description
+ * @remarks	Originally called 'st7'
+ */
+void MortevielleEngine::getSearchDescription(int objId) {
+	switch (objId) {
+	case 116:
+	case 144:
+		_crep = 104;
+		break;
+	case 126:
+	case 111:
+		_crep = 108;
+		break;
+	case 132:
+		_crep = 111;
+		break;
+	case 142:
+		_crep = 112;
+		break;
+	default:
+		_crep = 183;
+		getReadDescription(objId);
+	}
+}
+
+void MortevielleEngine::mennor() {
+	g_vm->_menu.menuUp(g_vm->_msg[3]);
+}
+
+void MortevielleEngine::premtet() {
+	g_vm->draw(kAdrDes, 10, 80);
+	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
+}
+
+void MortevielleEngine::ajchai() {
+	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+	} while ((cx <= 9) && (g_vm->_tabdon[cy + cx] != 0));
+
+	if (g_vm->_tabdon[cy + cx] == 0)
+		g_vm->_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
+	else
+		g_vm->_crep = 192;
+}
+
+void MortevielleEngine::ajjer(int ob) {
+	int cx = 0;
+	do {
+		++cx;
+	} while ((cx <= 5) && (ord(g_vm->_coreVar._sjer[cx]) != 0));
+
+	if (ord(g_vm->_coreVar._sjer[cx]) == 0) {
+		g_vm->_coreVar._sjer[(cx)] = chr(ob);
+		g_vm->_menu.setInventoryText();
+	} else
+		g_vm->_crep = 139;
+}
+
+/**
+ * Interact with NPC
+ * @remarks	Originally called 'quelquun'
+ */
+void MortevielleEngine::interactNPC() {
+	if (g_vm->_menu._menuDisplayed)
+		g_vm->_menu.eraseMenu();
+
+	g_vm->endSearch();
+	g_vm->_crep = 997;
+L1:
+	if (!g_vm->_hiddenHero) {
+		if (g_vm->_crep == 997)
+			g_vm->_crep = 138;
+		g_vm->repon(2, g_vm->_crep);
+		if (g_vm->_crep == 138)
+			g_vm->_speechManager.startSpeech(5, 2, 1);
+		else
+			g_vm->_speechManager.startSpeech(4, 4, 1);
+
+		if (g_vm->_iouv == 0)
+			g_vm->_coreVar._faithScore += 2;
+		else if (g_vm->_coreVar._faithScore < 50)
+			g_vm->_coreVar._faithScore += 4;
+		else
+			g_vm->_coreVar._faithScore += 3 * (g_vm->_coreVar._faithScore / 10);
+		g_vm->exitRoom();
+		g_vm->_menu.setDestinationText(LANDING);
+		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
+		g_vm->_caff = 69 + cx;
+		g_vm->_crep = g_vm->_caff;
+		g_vm->_msg[3] = MENU_DISCUSS;
+		g_vm->_msg[4] = g_vm->_menu._discussMenu[cx];
+		g_vm->_syn = true;
+		g_vm->_col = true;
+	} else {
+		if (g_vm->getRandomNumber(1, 3) == 2) {
+			g_vm->_hiddenHero = false;
+			g_vm->_crep = 137;
+			goto L1;
+		} else {
+			g_vm->repon(2, 136);
+			int rand = (g_vm->getRandomNumber(0, 4)) - 2;
+			g_vm->_speechManager.startSpeech(3, rand, 1);
+			g_vm->clearScreenType2();
+			g_vm->displayAloneText();
+			g_vm->resetRoomVariables(MANOR_FRONT);
+			g_vm->affrep();
+		}
+	}
+	if (g_vm->_menu._menuDisplayed)
+		g_vm->_menu.drawMenu();
+}
+
+void MortevielleEngine::tsuiv() {
+	int tbcl;
+	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+		++g_vm->_cs;
+		int cl = cy + g_vm->_cs;
+		tbcl = g_vm->_tabdon[cl];
+	} while ((tbcl == 0) && (g_vm->_cs <= 9));
+
+	if ((tbcl != 0) && (g_vm->_cs < 11)) {
+		++g_vm->_is;
+		g_vm->_caff = tbcl;
+		g_vm->_crep = g_vm->_caff + 400;
+		if (g_vm->_currBitIndex != 0)
+			g_vm->_coreVar._faithScore += 2;
+	} else {
+		g_vm->affrep();
+		g_vm->endSearch();
+		if (cx > 9)
+			g_vm->_crep = 131;
+	}
+}
+
+void MortevielleEngine::tfleche() {
+	bool qust;
+	char touch;
+
+	if (g_vm->_num == 9999)
+		return;
+
+	fenat(chr(152));
+	bool inRect = false;
+	do {
+		touch = '\0';
+
+		do {
+			g_vm->_mouse.moveMouse(qust, touch);
+			CHECK_QUIT;
+
+			if (g_vm->getMouseClick())
+				inRect = (g_vm->_mouse._pos.x < 256 * g_vm->_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
+			g_vm->prepareRoom();
+		} while (!(qust || inRect || g_vm->_anyone));
+
+		if (qust && (touch == '\103'))
+			Alert::show(g_vm->_hintPctMessage, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (g_vm->_x != 0) && (g_vm->_y != 0)) || (g_vm->_anyone) || (inRect)));
+
+	if (touch == '\73')
+		g_vm->_keyPressedEsc = true;
+
+	if (inRect) {
+		g_vm->_x = g_vm->_mouse._pos.x;
+		g_vm->_y = g_vm->_mouse._pos.y;
+	}
+}
+
+/**
+ * Set coordinates
+ * @remarks	Originally called 'tcoord'
+ */
+void MortevielleEngine::setCoordinates(int sx) {
+	int sy, ix, iy;
+	int ib;
+
+
+	g_vm->_num = 0;
+	g_vm->_crep = 999;
+	int a = 0;
+	int atdon = amzon + 3;
+	int cy = 0;
+	while (cy < g_vm->_caff) {
+		a += g_vm->_tabdon[atdon];
+		atdon += 4;
+		++cy;
+	}
+
+	if (g_vm->_tabdon[atdon] == 0) {
+		g_vm->_crep = 997;
+		return;
+	}
+
+	a += kFleche;
+	int cb = 0;
+	for (cy = 0; cy <= (sx - 2); ++cy) {
+		ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
+		cb += (ib * 4) + 2;
+	}
+	ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
+	if (ib == 0) {
+		g_vm->_crep = 997;
+		return;
+	}
+
+	cy = 1;
+	do {
+		cb += 2;
+		sx = g_vm->_tabdon[a + cb] * g_vm->_res;
+		sy = g_vm->_tabdon[(a + cb + 1)];
+		cb += 2;
+		ix = g_vm->_tabdon[a + cb] * g_vm->_res;
+		iy = g_vm->_tabdon[(a + cb + 1)];
+		++cy;
+	} while (!(((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) || (cy > ib)));
+
+	if ((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) {
+		g_vm->_num = cy - 1;
+		return;
+	}
+
+	g_vm->_crep = 997;
+}
+
+void MortevielleEngine::treg(int objId) {
+	int mdes = g_vm->_caff;
+	g_vm->_caff = objId;
+
+	if (((g_vm->_caff > 29) && (g_vm->_caff < 33)) || (g_vm->_caff == 144) || (g_vm->_caff == 147) || (g_vm->_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
+		g_vm->afdes();
+		if ((g_vm->_caff > 29) && (g_vm->_caff < 33))
+			g_vm->repon(2, g_vm->_caff);
+		else
+			g_vm->repon(2, g_vm->_caff + 400);
+		g_vm->testKey(true);
+		g_vm->_caff = mdes;
+		g_vm->_msg[3] = 0;
+		g_vm->_crep = 998;
+	} else {
+		g_vm->_obpart = true;
+		g_vm->_crep = g_vm->_caff + 400;
+		g_vm->_menu.setSearchMenu();
+	}
+}
+
+void MortevielleEngine::avpoing(int &objId) {
+	g_vm->_crep = 999;
+	if (g_vm->_coreVar._selectedObjectId != 0)
+		g_vm->ajjer(g_vm->_coreVar._selectedObjectId);
+
+	if (g_vm->_crep != 139) {
+		g_vm->displayItemInHand(objId + 400);
+		g_vm->_coreVar._selectedObjectId = objId;
+		objId = 0;
+	}
+}
+
+void MortevielleEngine::rechai(int &ch) {
+	int tmpPlace = g_vm->_coreVar._currPlace;
+
+	if (g_vm->_coreVar._currPlace == CRYPT)
+		tmpPlace = CELLAR;
+	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_vm->_num - 1];
+}
+
+/**
+ * Check before leaving the secret passage
+ * @remarks	Originally called 't23coul'
+ */
+int MortevielleEngine::checkLeaveSecretPassage() {
+	if (!g_vm->checkInventory(143)) {
+		g_vm->_crep = 1512;
+		g_vm->loseGame();
+	}
+
+	return CELLAR;
+}
+
+void MortevielleEngine::fenat(char ans) {
+	int coul;
+
+	g_vm->_mouse.hideMouse();
+	if (g_vm->_currGraphicalDevice == MODE_CGA)
+		coul = 2;
+	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
+		coul = 1;
+	else
+		coul = 12;
+
+	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
+	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
+	g_vm->_mouse.showMouse();
+}
+
+void MortevielleEngine::sauvecr(int y, int dy) {
+//	_mouse.hideMouse();
+//	_mouse.showMouse();
+}
+
+void MortevielleEngine::charecr(int y, int dy) {
+//	_mouse.hideMouse();
+//	_mouse.showMouse();
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index bb594d2..6e55beb 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -73,6 +73,12 @@ enum DataType {
 	kGameStrings = 1
 };
 
+static const int _actionMenu[12] = { OPCODE_NONE,
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
+};
+
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
 #define SCREEN_ORIG_HEIGHT 200
@@ -80,6 +86,9 @@ enum DataType {
 #define MORT_DAT "mort.dat"
 #define GAME_FRAME_DELAY (1000 / 50)
 
+const int kTime1 = 410;
+const int kTime2 = 250;
+
 const int kAcha = 492;
 const int kAdrDes = 0x7000;
 const int kFleche = 1758;
@@ -167,11 +176,18 @@ private:
 	int  readclock();
 	void palette(int v1);
 	int checkLeoMaxRandomPresence();
+	void interactNPC();
 
 	void adzon();
 	void text1(int x, int y, int nb, int m);
 	void modif(int &nu);
 	void initouv();
+	void phaz(int &rand, int &p, int cf);
+	void writetp(Common::String s, int t);
+	void premtet();
+	void ajchai();
+	void tfleche();
+	void setCoordinates(int sx);
 
 public:
 	Common::String _hintPctMessage;
@@ -417,9 +433,14 @@ public:
 	void displayItemInHand(int objId);
 	void displayEmptyHand();
 	void resetRoomVariables(int roomId);
-	int getPresenceStats(int &rand, int cf, int roomId);
+	int  getPresenceStats(int &rand, int cf, int roomId);
 	void setPresenceFlags(int roomId);
-
+	int  getPresence(int roomId);
+	void testKey(bool d);
+	void exitRoom();
+	void getReadDescription(int objId);
+	void getSearchDescription(int objId);
+	int  checkLeaveSecretPassage();
 
 	void pictout(int seg, int dep, int x, int y);
 	int  animof(int ouf, int num);
@@ -427,6 +448,21 @@ public:
 	void ecr2(Common::String text);
 	void ecr3(Common::String text);
 	void init_nbrepm();
+	void aniof(int ouf, int num);
+	void dessin();
+	void afdes();
+	void tlu(int af, int ob);
+	void affrep();
+	void mennor();
+	void ajjer(int ob);
+	void tsuiv();
+	void treg(int objId);
+	void avpoing(int &objId);
+	void rechai(int &ch);
+	void fenat(char ans);
+
+	void sauvecr(int y, int dy);
+	void charecr(int y, int dy);
 
 };
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 92831ec..35d4225 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -27,7 +27,6 @@
 
 #include "common/file.h"
 #include "common/str.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/graphics.h"
@@ -338,7 +337,7 @@ void taffich() {
 		if ((a == 13) || (a == 14))
 			g_vm->displayAloneText();
 		else if (!g_vm->_blo)
-			cx = t11(g_vm->_coreVar._currPlace);
+			g_vm->getPresence(g_vm->_coreVar._currPlace);
 		g_vm->_savedBitIndex =  0;
 	}
 }
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index daa59b2..4c5e625 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -28,7 +28,6 @@
 #include "common/file.h"
 #include "common/system.h"
 #include "mortevielle/dialogs.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/saveload.h"
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 5b9e841..c374d20 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -30,7 +30,6 @@
 #include "mortevielle/speech.h"
 #include "mortevielle/sound.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/mor.h"
 #include "mortevielle/var_mor.h"
 
 namespace Mortevielle {


Commit: 19798a23b37700dabc44eca610dc1e90824a18f0
    https://github.com/scummvm/scummvm/commit/19798a23b37700dabc44eca610dc1e90824a18f0
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:50-07:00

Commit Message:
MORTEVIELLE: More renaming and refactoring

Changed paths:
  R engines/mortevielle/keyboard.cpp
  R engines/mortevielle/keyboard.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 0247eca..1a66149 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1575,7 +1575,7 @@ void MortevielleEngine::endGame() {
 	testKey(false);
 	_mouse.hideMouse();
 	_caff = 70;
-	taffich();
+	_text.taffich();
 	hirs();
 	premtet();
 	startDialog(141);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 19ff580..f04233d 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -27,7 +27,6 @@
 
 #include "common/str.h"
 #include "mortevielle/dialogs.h"
-#include "mortevielle/keyboard.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
@@ -307,7 +306,7 @@ bool KnowledgeCheck::show() {
 			dialogHeight = 23;
 		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
 		Common::String tmpStr = g_vm->getString(textIndexArr[indx]);
-		displayStr(tmpStr, 20, 15, 100, 2, 0);
+		g_vm->_text.displayStr(tmpStr, 20, 15, 100, 2, 0);
 
 		if (indx != 9) {
 			firstOption = textIndexArr[indx] + 1;
@@ -324,7 +323,7 @@ bool KnowledgeCheck::show() {
 			tmpStr = g_vm->getString(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
-			displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
+			g_vm->_text.displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
 			choiceArray[prevChoice] = tmpStr;
 			optionPosY += 8;
 		}
@@ -362,16 +361,16 @@ bool KnowledgeCheck::show() {
 			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
 					tmpStr = choiceArray[prevChoice] + '$';
-					displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+					g_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
 				if (prevChoice != currChoice) {
 					tmpStr = choiceArray[currChoice] + '$';
-					displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
+					g_vm->_text.displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
 					prevChoice = currChoice;
 				}
 			} else if (prevChoice != 0) {
 				tmpStr = choiceArray[prevChoice] + '$';
-				displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+				g_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				prevChoice = 0;
 			}
 		} while (!((prevChoice != 0) && g_vm->getMouseClick()));
@@ -420,7 +419,7 @@ void f3f8::draw() {
  * @remarks	Originally called 'diver'
  */
 void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
-	teskbd();
+	g_vm->testKeyboard();
 	do {
 		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
 		g_vm->_key = waitForF3F8();
@@ -442,7 +441,7 @@ int f3f8::waitForF3F8() {
 	int key;
 
 	do {
-		key = testou();
+		key = g_vm->testou();
 		if (g_vm->shouldQuit())
 			return key;
 	} while ((key != 61) && (key != 66));
@@ -453,7 +452,7 @@ int f3f8::waitForF3F8() {
 void f3f8::aff50(bool drawAni50Fl) {
 	g_vm->_caff = 50;
 	g_vm->_maff = 0;
-	taffich();
+	g_vm->_text.taffich();
 	g_vm->draw(kAdrDes, 63, 12);
 	if (drawAni50Fl)
 		ani50();
diff --git a/engines/mortevielle/keyboard.cpp b/engines/mortevielle/keyboard.cpp
deleted file mode 100644
index 699bd5a..0000000
--- a/engines/mortevielle/keyboard.cpp
+++ /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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/keyboard.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-char readkey1() {
-	char c = g_vm->getChar();
-
-	return c;
-}
-
-int testou() {
-	char ch = g_vm->getChar();
-
-	switch (ch)  {
-	case '\23' :
-		g_vm->_soundOff = !g_vm->_soundOff;
-		break;
-	case '\26' :
-		if ((g_vm->_c_zzz == 1) || (g_vm->_c_zzz == 2)) {
-			g_vm->decodeNumber(&g_vm->_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
-			++g_vm->_c_zzz;
-
-			return 61;
-		}
-		break;
-	case '\33' :
-		if (g_vm->keyPressed())
-			ch = g_vm->getChar();
-		break;
-	default:
-		break;
-	}
-
-	return ord(ch);
-}
-
-void teskbd() {
-	if (g_vm->keyPressed())
-		testou();
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/keyboard.h b/engines/mortevielle/keyboard.h
deleted file mode 100644
index 7b2510f..0000000
--- a/engines/mortevielle/keyboard.h
+++ /dev/null
@@ -1,38 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_KEYBOARD_H
-#define MORTEVIELLE_KEYBOARD_H
-
-namespace Mortevielle {
-
-extern char readkey1();
-extern int testou();
-extern void teskbd();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index fe02e11..8cad2b8 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -5,7 +5,6 @@ MODULE_OBJS := \
 	detection.o \
 	dialogs.o \
 	graphics.o \
-	keyboard.o \
 	menu.o \
 	mortevielle.o \
 	mouse.o \
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6d1a949..fec1473 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -30,7 +30,6 @@
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/dialogs.h"
-#include "mortevielle/keyboard.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
@@ -208,10 +207,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	_soundOff = false;
 	_largestClearScreen = false;
 
-	teskbd();
+	testKeyboard();
 	showConfigScreen();
 	_newGraphicalDevice = _currGraphicalDevice;
-	teskbd();
+	testKeyboard();
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
@@ -693,7 +692,7 @@ void MortevielleEngine::handleAction() {
 					handleOpcode();
 
 				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
-					taffich();
+					g_vm->_text.taffich();
 					if (_okdes) {
 						_okdes = false;
 						dessin();
@@ -1706,7 +1705,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 
 	_mouse.hideMouse();
 	Common::String dialogStr = getString(rep + kDialogStringIndex);
-	displayStr(dialogStr, 230, 4, 65, 24, 5);
+	_text.displayStr(dialogStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
 	
 	key = 0;
@@ -2512,8 +2511,8 @@ void MortevielleEngine::showTitleScreen() {
 	hirs();
 	repon(7, 2035);
 	_caff = 51;
-	taffich();
-	teskbd();
+	_text.taffich();
+	testKeyboard();
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
@@ -2898,7 +2897,7 @@ void MortevielleEngine::text1(int x, int y, int nb, int m) {
 	Common::String tmpStr = getString(m);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
-	displayStr(tmpStr, x, y, nb, 20, _textColor);
+	_text.displayStr(tmpStr, x, y, nb, 20, _textColor);
 }
 
 void MortevielleEngine::repon(int f, int m) {
@@ -2911,7 +2910,7 @@ void MortevielleEngine::repon(int f, int m) {
 			_largestClearScreen = false;
 
 		clearScreenType2();
-		displayStr(tmpStr, 8, 176, 85, 3, 5);
+		_text.displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
 		modif(m);
 		switch (f) {
@@ -2940,7 +2939,7 @@ void MortevielleEngine::repon(int f, int m) {
 				i = 5;
 
 			Common::String tmpStr = getString(m);
-			displayStr(tmpStr, 80, 40, 60, 25, i);
+			_text.displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (m == 180)
 				_coreVar._pourc[6] = '*';
@@ -3288,7 +3287,7 @@ void MortevielleEngine::dessin() {
 }
 
 void MortevielleEngine::afdes() {
-	taffich();
+	_text.taffich();
 	dessin();
 	_okdes = false;
 }
@@ -3424,38 +3423,38 @@ void MortevielleEngine::getSearchDescription(int objId) {
 }
 
 void MortevielleEngine::mennor() {
-	g_vm->_menu.menuUp(g_vm->_msg[3]);
+	_menu.menuUp(_msg[3]);
 }
 
 void MortevielleEngine::premtet() {
-	g_vm->draw(kAdrDes, 10, 80);
-	g_vm->_screenSurface.drawBox(18, 79, 155, 91, 15);
+	draw(kAdrDes, 10, 80);
+	_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 
 void MortevielleEngine::ajchai() {
-	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 9) && (g_vm->_tabdon[cy + cx] != 0));
+	} while ((cx <= 9) && (_tabdon[cy + cx] != 0));
 
-	if (g_vm->_tabdon[cy + cx] == 0)
-		g_vm->_tabdon[cy + cx] = g_vm->_coreVar._selectedObjectId;
+	if (_tabdon[cy + cx] == 0)
+		_tabdon[cy + cx] = _coreVar._selectedObjectId;
 	else
-		g_vm->_crep = 192;
+		_crep = 192;
 }
 
 void MortevielleEngine::ajjer(int ob) {
 	int cx = 0;
 	do {
 		++cx;
-	} while ((cx <= 5) && (ord(g_vm->_coreVar._sjer[cx]) != 0));
+	} while ((cx <= 5) && (ord(_coreVar._sjer[cx]) != 0));
 
-	if (ord(g_vm->_coreVar._sjer[cx]) == 0) {
-		g_vm->_coreVar._sjer[(cx)] = chr(ob);
-		g_vm->_menu.setInventoryText();
+	if (ord(_coreVar._sjer[cx]) == 0) {
+		_coreVar._sjer[(cx)] = chr(ob);
+		_menu.setInventoryText();
 	} else
-		g_vm->_crep = 139;
+		_crep = 139;
 }
 
 /**
@@ -3463,77 +3462,77 @@ void MortevielleEngine::ajjer(int ob) {
  * @remarks	Originally called 'quelquun'
  */
 void MortevielleEngine::interactNPC() {
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.eraseMenu();
+	if (_menu._menuDisplayed)
+		_menu.eraseMenu();
 
-	g_vm->endSearch();
-	g_vm->_crep = 997;
+	endSearch();
+	_crep = 997;
 L1:
-	if (!g_vm->_hiddenHero) {
-		if (g_vm->_crep == 997)
-			g_vm->_crep = 138;
-		g_vm->repon(2, g_vm->_crep);
-		if (g_vm->_crep == 138)
-			g_vm->_speechManager.startSpeech(5, 2, 1);
+	if (!_hiddenHero) {
+		if (_crep == 997)
+			_crep = 138;
+		repon(2, _crep);
+		if (_crep == 138)
+			_speechManager.startSpeech(5, 2, 1);
 		else
-			g_vm->_speechManager.startSpeech(4, 4, 1);
+			_speechManager.startSpeech(4, 4, 1);
 
-		if (g_vm->_iouv == 0)
-			g_vm->_coreVar._faithScore += 2;
-		else if (g_vm->_coreVar._faithScore < 50)
-			g_vm->_coreVar._faithScore += 4;
+		if (_iouv == 0)
+			_coreVar._faithScore += 2;
+		else if (_coreVar._faithScore < 50)
+			_coreVar._faithScore += 4;
 		else
-			g_vm->_coreVar._faithScore += 3 * (g_vm->_coreVar._faithScore / 10);
-		g_vm->exitRoom();
-		g_vm->_menu.setDestinationText(LANDING);
-		int cx = g_vm->convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
-		g_vm->_caff = 69 + cx;
-		g_vm->_crep = g_vm->_caff;
-		g_vm->_msg[3] = MENU_DISCUSS;
-		g_vm->_msg[4] = g_vm->_menu._discussMenu[cx];
-		g_vm->_syn = true;
-		g_vm->_col = true;
+			_coreVar._faithScore += 3 * (_coreVar._faithScore / 10);
+		exitRoom();
+		_menu.setDestinationText(LANDING);
+		int cx = convertBitIndexToCharacterIndex(_currBitIndex);
+		_caff = 69 + cx;
+		_crep = _caff;
+		_msg[3] = MENU_DISCUSS;
+		_msg[4] = _menu._discussMenu[cx];
+		_syn = true;
+		_col = true;
 	} else {
-		if (g_vm->getRandomNumber(1, 3) == 2) {
-			g_vm->_hiddenHero = false;
-			g_vm->_crep = 137;
+		if (getRandomNumber(1, 3) == 2) {
+			_hiddenHero = false;
+			_crep = 137;
 			goto L1;
 		} else {
-			g_vm->repon(2, 136);
-			int rand = (g_vm->getRandomNumber(0, 4)) - 2;
-			g_vm->_speechManager.startSpeech(3, rand, 1);
-			g_vm->clearScreenType2();
-			g_vm->displayAloneText();
-			g_vm->resetRoomVariables(MANOR_FRONT);
-			g_vm->affrep();
+			repon(2, 136);
+			int rand = (getRandomNumber(0, 4)) - 2;
+			_speechManager.startSpeech(3, rand, 1);
+			clearScreenType2();
+			displayAloneText();
+			resetRoomVariables(MANOR_FRONT);
+			affrep();
 		}
 	}
-	if (g_vm->_menu._menuDisplayed)
-		g_vm->_menu.drawMenu();
+	if (_menu._menuDisplayed)
+		_menu.drawMenu();
 }
 
 void MortevielleEngine::tsuiv() {
 	int tbcl;
-	int cy = kAcha + ((g_vm->_mchai - 1) * 10) - 1;
+	int cy = kAcha + ((_mchai - 1) * 10) - 1;
 	int cx = 0;
 	do {
 		++cx;
-		++g_vm->_cs;
-		int cl = cy + g_vm->_cs;
-		tbcl = g_vm->_tabdon[cl];
-	} while ((tbcl == 0) && (g_vm->_cs <= 9));
-
-	if ((tbcl != 0) && (g_vm->_cs < 11)) {
-		++g_vm->_is;
-		g_vm->_caff = tbcl;
-		g_vm->_crep = g_vm->_caff + 400;
-		if (g_vm->_currBitIndex != 0)
-			g_vm->_coreVar._faithScore += 2;
+		++_cs;
+		int cl = cy + _cs;
+		tbcl = _tabdon[cl];
+	} while ((tbcl == 0) && (_cs <= 9));
+
+	if ((tbcl != 0) && (_cs < 11)) {
+		++_is;
+		_caff = tbcl;
+		_crep = _caff + 400;
+		if (_currBitIndex != 0)
+			_coreVar._faithScore += 2;
 	} else {
-		g_vm->affrep();
-		g_vm->endSearch();
+		affrep();
+		endSearch();
 		if (cx > 9)
-			g_vm->_crep = 131;
+			_crep = 131;
 	}
 }
 
@@ -3541,7 +3540,7 @@ void MortevielleEngine::tfleche() {
 	bool qust;
 	char touch;
 
-	if (g_vm->_num == 9999)
+	if (_num == 9999)
 		return;
 
 	fenat(chr(152));
@@ -3550,24 +3549,24 @@ void MortevielleEngine::tfleche() {
 		touch = '\0';
 
 		do {
-			g_vm->_mouse.moveMouse(qust, touch);
+			_mouse.moveMouse(qust, touch);
 			CHECK_QUIT;
 
-			if (g_vm->getMouseClick())
-				inRect = (g_vm->_mouse._pos.x < 256 * g_vm->_res) && (g_vm->_mouse._pos.y < 176) && (g_vm->_mouse._pos.y > 12);
-			g_vm->prepareRoom();
-		} while (!(qust || inRect || g_vm->_anyone));
+			if (getMouseClick())
+				inRect = (_mouse._pos.x < 256 * _res) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
+			prepareRoom();
+		} while (!(qust || inRect || _anyone));
 
 		if (qust && (touch == '\103'))
-			Alert::show(g_vm->_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (g_vm->_x != 0) && (g_vm->_y != 0)) || (g_vm->_anyone) || (inRect)));
+			Alert::show(_hintPctMessage, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (_x != 0) && (_y != 0)) || (_anyone) || (inRect)));
 
 	if (touch == '\73')
-		g_vm->_keyPressedEsc = true;
+		_keyPressedEsc = true;
 
 	if (inRect) {
-		g_vm->_x = g_vm->_mouse._pos.x;
-		g_vm->_y = g_vm->_mouse._pos.y;
+		_x = _mouse._pos.x;
+		_y = _mouse._pos.y;
 	}
 }
 
@@ -3580,92 +3579,92 @@ void MortevielleEngine::setCoordinates(int sx) {
 	int ib;
 
 
-	g_vm->_num = 0;
-	g_vm->_crep = 999;
+	_num = 0;
+	_crep = 999;
 	int a = 0;
 	int atdon = amzon + 3;
 	int cy = 0;
-	while (cy < g_vm->_caff) {
-		a += g_vm->_tabdon[atdon];
+	while (cy < _caff) {
+		a += _tabdon[atdon];
 		atdon += 4;
 		++cy;
 	}
 
-	if (g_vm->_tabdon[atdon] == 0) {
-		g_vm->_crep = 997;
+	if (_tabdon[atdon] == 0) {
+		_crep = 997;
 		return;
 	}
 
 	a += kFleche;
 	int cb = 0;
 	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
+		ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
 		cb += (ib * 4) + 2;
 	}
-	ib = (g_vm->_tabdon[a + cb] << 8) + g_vm->_tabdon[(a + cb + 1)];
+	ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
 	if (ib == 0) {
-		g_vm->_crep = 997;
+		_crep = 997;
 		return;
 	}
 
 	cy = 1;
 	do {
 		cb += 2;
-		sx = g_vm->_tabdon[a + cb] * g_vm->_res;
-		sy = g_vm->_tabdon[(a + cb + 1)];
+		sx = _tabdon[a + cb] * _res;
+		sy = _tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = g_vm->_tabdon[a + cb] * g_vm->_res;
-		iy = g_vm->_tabdon[(a + cb + 1)];
+		ix = _tabdon[a + cb] * _res;
+		iy = _tabdon[(a + cb + 1)];
 		++cy;
-	} while (!(((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) || (cy > ib)));
+	} while (!(((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) || (cy > ib)));
 
-	if ((g_vm->_x >= sx) && (g_vm->_x <= ix) && (g_vm->_y >= sy) && (g_vm->_y <= iy)) {
-		g_vm->_num = cy - 1;
+	if ((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) {
+		_num = cy - 1;
 		return;
 	}
 
-	g_vm->_crep = 997;
+	_crep = 997;
 }
 
 void MortevielleEngine::treg(int objId) {
-	int mdes = g_vm->_caff;
-	g_vm->_caff = objId;
+	int mdes = _caff;
+	_caff = objId;
 
-	if (((g_vm->_caff > 29) && (g_vm->_caff < 33)) || (g_vm->_caff == 144) || (g_vm->_caff == 147) || (g_vm->_caff == 149) || (g_vm->_msg[4] == OPCODE_SLOOK)) {
-		g_vm->afdes();
-		if ((g_vm->_caff > 29) && (g_vm->_caff < 33))
-			g_vm->repon(2, g_vm->_caff);
+	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_msg[4] == OPCODE_SLOOK)) {
+		afdes();
+		if ((_caff > 29) && (_caff < 33))
+			repon(2, _caff);
 		else
-			g_vm->repon(2, g_vm->_caff + 400);
-		g_vm->testKey(true);
-		g_vm->_caff = mdes;
-		g_vm->_msg[3] = 0;
-		g_vm->_crep = 998;
+			repon(2, _caff + 400);
+		testKey(true);
+		_caff = mdes;
+		_msg[3] = 0;
+		_crep = 998;
 	} else {
-		g_vm->_obpart = true;
-		g_vm->_crep = g_vm->_caff + 400;
-		g_vm->_menu.setSearchMenu();
+		_obpart = true;
+		_crep = _caff + 400;
+		_menu.setSearchMenu();
 	}
 }
 
 void MortevielleEngine::avpoing(int &objId) {
-	g_vm->_crep = 999;
-	if (g_vm->_coreVar._selectedObjectId != 0)
-		g_vm->ajjer(g_vm->_coreVar._selectedObjectId);
+	_crep = 999;
+	if (_coreVar._selectedObjectId != 0)
+		ajjer(_coreVar._selectedObjectId);
 
-	if (g_vm->_crep != 139) {
-		g_vm->displayItemInHand(objId + 400);
-		g_vm->_coreVar._selectedObjectId = objId;
+	if (_crep != 139) {
+		displayItemInHand(objId + 400);
+		_coreVar._selectedObjectId = objId;
 		objId = 0;
 	}
 }
 
 void MortevielleEngine::rechai(int &ch) {
-	int tmpPlace = g_vm->_coreVar._currPlace;
+	int tmpPlace = _coreVar._currPlace;
 
-	if (g_vm->_coreVar._currPlace == CRYPT)
+	if (_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
-	ch = g_vm->_tabdon[achai + (tmpPlace * 7) + g_vm->_num - 1];
+	ch = _tabdon[achai + (tmpPlace * 7) + _num - 1];
 }
 
 /**
@@ -3673,9 +3672,9 @@ void MortevielleEngine::rechai(int &ch) {
  * @remarks	Originally called 't23coul'
  */
 int MortevielleEngine::checkLeaveSecretPassage() {
-	if (!g_vm->checkInventory(143)) {
-		g_vm->_crep = 1512;
-		g_vm->loseGame();
+	if (!checkInventory(143)) {
+		_crep = 1512;
+		loseGame();
 	}
 
 	return CELLAR;
@@ -3684,17 +3683,52 @@ int MortevielleEngine::checkLeaveSecretPassage() {
 void MortevielleEngine::fenat(char ans) {
 	int coul;
 
-	g_vm->_mouse.hideMouse();
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
+	_mouse.hideMouse();
+	if (_currGraphicalDevice == MODE_CGA)
 		coul = 2;
-	else if (g_vm->_currGraphicalDevice == MODE_HERCULES)
+	else if (_currGraphicalDevice == MODE_HERCULES)
 		coul = 1;
 	else
 		coul = 12;
 
-	g_vm->_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
-	g_vm->_screenSurface.drawBox(300, 191, 16, 8, 15);
-	g_vm->_mouse.showMouse();
+	_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
+	_screenSurface.drawBox(300, 191, 16, 8, 15);
+	_mouse.showMouse();
+}
+
+/**
+ * Test Keyboard
+ * @remarks	Originally called 'teskbd'
+ */
+void MortevielleEngine::testKeyboard() {
+	if (keyPressed())
+		testou();
+}
+
+int MortevielleEngine::testou() {
+	char ch = getChar();
+
+	switch (ch)  {
+	case '\23' :
+		_soundOff = !_soundOff;
+		break;
+	case '\26' :
+		if ((_c_zzz == 1) || (_c_zzz == 2)) {
+			decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+			++_c_zzz;
+
+			return 61;
+		}
+		break;
+	case '\33' :
+		if (keyPressed())
+			ch = getChar();
+		break;
+	default:
+		break;
+	}
+
+	return ord(ch);
 }
 
 void MortevielleEngine::sauvecr(int y, int dy) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6e55beb..514b929 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -38,9 +38,32 @@
 #include "mortevielle/saveload.h"
 #include "mortevielle/sound.h"
 #include "mortevielle/speech.h"
+#include "mortevielle/outtext.h"
 
 namespace Mortevielle {
 
+/*---------------------------------------------------------------------------*/
+/*-------------------           MEMORY  MAP          ------------------------*/
+/*---------------------------------------------------------------------------*/
+/* The following is a list of physical addresses in memory currently used
+ * by the game.
+ *
+ * Address
+ * -------
+ * 5000:0 - Music data
+ * 6000:0 - Decompressed current image
+ * 7000:0+ - Compressed images
+ * 7000:2 - 16 words representing palette map
+ * 7000:4138 - width, height, x/y offset of decoded image
+ */
+
+#define ord(v) ((int) v)
+#define chr(v) ((unsigned char) v)
+#define lo(v) ((v) & 0xff)
+#define hi(v) (((v) >> 8) & 0xff)
+#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
+#define odd(v) (((v) % 2) == 1)
+
 // Debug channels
 enum {
 	kMortevielleCore = 1 << 0,
@@ -73,12 +96,6 @@ enum DataType {
 	kGameStrings = 1
 };
 
-static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
-		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
-};
-
 #define SCREEN_WIDTH 640
 #define SCREEN_HEIGHT 400
 #define SCREEN_ORIG_HEIGHT 200
@@ -101,6 +118,51 @@ const int arep = 1314;
 const int amzon = 1650;
 const int arega = 0;
 
+const int kMaxTi = 7975;
+const int kMaxTd = 600;
+
+const int kDescriptionStringIndex = 0;                // Unused
+const int kInventoryStringIndex = 186;
+const int kQuestionStringIndex = 247;
+const int kDialogStringIndex = 292;
+const int kMenuPlaceStringIndex = 435;
+const int kMenuActionStringIndex = 476;
+const int kMenuSelfStringIndex = 497;
+const int kMenuSayStringIndex = 502;
+const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
+const int kMaxPatt = 20;
+
+const int OPCODE_NONE = 0;
+enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
+            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
+			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
+			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
+			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
+			OPCODE_SLOOK = 0x405};
+
+static const int _actionMenu[12] = { OPCODE_NONE,
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
+		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
+};
+
+/*
+9   "A glance at the forbidden$",
+18  "It's already open$",
+26  "A photograph$",
+27  "The coat of arms$",
+*/
+enum places {
+	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
+	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
+	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14, 
+	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19, 
+	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     INSIDE_WELL = 23, WELL = 24,
+	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
+};
+
+enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
+
 struct nhom {
 	byte _id;     /* number between 0 and 32 */
 	byte _hom[4];
@@ -144,15 +206,79 @@ private:
 	const ADGameDescription *_gameDescription;
 	Common::Stack<int> _keypresses;
 	uint32 _lastGameFrame;
-	bool _mouseClick;
 	Common::Point _mousePos;
-	bool _inMainGameLoop;	// Flag when the main game loop is active
 	Common::StringArray _engineStrings;
 	Common::StringArray _gameStrings;
 
 	Pattern _patternArr[15];
 	int _menuOpcode;
 
+	bool _mouseClick;
+	bool _inMainGameLoop;	// Flag when the main game loop is active
+	bool _quitGame;			// Quit game flag. Originally called 'arret'
+	bool _endGame;			// End game flag. Originally called 'solu'
+	bool _loseGame;			// Lose game flag. Originally called 'perdu'
+	bool _txxFileFl;        // Flag used to determine if texts are from the original files or from a DAT file
+	bool _roomPresenceLuc;
+	bool _roomPresenceIda;
+	bool _purpleRoomPresenceLeo;
+	bool _roomPresenceGuy;
+	bool _roomPresenceEva;
+	bool _roomPresenceMax;
+	bool _roomPresenceBob;
+	bool _roomPresencePat;
+	bool _toiletsPresenceBobMax;
+	bool _bathRoomPresenceBobMax;
+	bool _room9PresenceLeo;
+	bool _hiddenHero;
+	bool _heroSearching;
+	bool _keyPressedEsc;
+	bool _reloadCFIEC;
+	bool _col;
+	bool _syn;
+	bool _obpart;
+	bool _anyone;
+	bool _brt;
+
+	int  _textColor;
+	int  _place;
+	int  _manorDistance;
+	int  _currBitIndex;
+	int  _currDay;
+	int  _currHour;
+	int  _currHalfHour;
+	int  _day;
+	int  _hour;
+	int  _minute;
+	int  _mchai;
+	int  _controlMenu;
+	int  _startHour;
+	int  _endHour;
+	Common::Point _stdPal[91][17];
+	t_pcga _cgaPal[91];
+
+	int  _c_zzz;
+	int  _ment;
+	int  _iouv;
+	int  _dobj;
+	int  _num;
+	int  _cs;
+	int  _prebru;
+	int  _t;
+	int  _x;
+	int  _y;
+	int  _jh;
+	int  _mh;
+
+
+	Common::String _hintPctMessage;
+	byte _cfiecBuffer[822 * 128];
+	byte _touv[8];
+	int  _nbrep[9];
+	int  _nbrepm[9];
+	uint16 _inpBuffer[kMaxTi + 1];
+	Hint _ntpBuffer[kMaxTd + 1];
+
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
 	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
@@ -164,8 +290,6 @@ private:
 	void mainGame();
 	void playGame();
 	void handleAction();
-	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
-	void copcha();
 	void displayCGAPattern(int n, Pattern p, nhom *pal);
 	void loadPalette();
 	void loadTexts();
@@ -177,7 +301,122 @@ private:
 	void palette(int v1);
 	int checkLeoMaxRandomPresence();
 	void interactNPC();
+	void initCaveOrCellar();
+	void displayControlMenu();
+	void displayItemInHand(int objId);
+	void resetRoomVariables(int roomId);
+	int  getPresenceStats(int &rand, int cf, int roomId);
+	void setPresenceFlags(int roomId);
+	void testKey(bool d);
+	void exitRoom();
+	void getReadDescription(int objId);
+	void getSearchDescription(int objId);
+	int  checkLeaveSecretPassage();
+	void changeGraphicalDevice(int newDevice);
+	void startDialog(int16 rep);
+	void endSearch();
+	int convertCharacterIndexToBitIndex(int characterIndex);
+	int convertBitIndexToCharacterIndex(int bitIndex);
+	void clearScreenType1();
+	void clearScreenType2();
+	void clearScreenType3();
+	void clearScreenType10();
+	int  getRandomNumber(int minval, int maxval);
+	void showMoveMenuAlert();
+	void showConfigScreen();
+	void decodeNumber(byte *pStart, int count);
+	void resetVariables();
+	void music();
+	void drawRightFrame();
+	void prepareRoom();
+	void drawClock();
+	void checkManorDistance();
+	void gotoManorFront();
+	void gotoManorBack();
+	void gotoDiningRoom();
+	bool checkInventory(int objectId);
+	void loseGame();
+	void floodedInWell();
+	void displayDiningRoom();
+	void startMusicOrSpeech(int so);
+	void setTextColor(int col);
+	void prepareScreenType1();
+	void prepareScreenType2();
+	void prepareScreenType3();
+	void updateHour(int &day, int &hour, int &minute);
+	void getKnockAnswer();
+	int  getPresenceStatsGreenRoom();
+	int  getPresenceStatsPurpleRoom();
+	int  getPresenceStatsToilets();
+	int  getPresenceStatsBlueRoom();
+	int  getPresenceStatsRedRoom();
+	int  getPresenceStatsDiningRoom(int &hour);
+	int  getPresenceStatsBureau(int &hour);
+	int  getPresenceStatsKitchen();
+	int  getPresenceStatsAttic();
+	int  getPresenceStatsLanding();
+	int  getPresenceStatsChapel(int &hour);
+	int  getPresenceBitIndex(int roomId);
+	void setPresenceGreenRoom(int roomId);
+	void setPresencePurpleRoom();
+	void setPresenceBlueRoom();
+	void setPresenceRedRoom(int roomId);
+	int  setPresenceDiningRoom(int hour);
+	int  setPresenceBureau(int hour);
+	int  setPresenceKitchen();
+	int  setPresenceLanding();
+	int  setPresenceChapel(int hour);
+	void setRandomPresenceGreenRoom(int cf);
+	void setRandomPresencePurpleRoom(int cf);
+	void setRandomPresenceBlueRoom(int cf);
+	void setRandomPresenceRedRoom(int cf);
+	void setRandomPresenceRoom9(int cf);
+	void setRandomPresenceDiningRoom(int cf);
+	void setRandomPresenceBureau(int cf);
+	void setRandomPresenceKitchen(int cf);
+	void setRandomPresenceAttic(int cf);
+	void setRandomPresenceLanding(int cf);
+	void setRandomPresenceChapel(int cf);
+	void loadPlaces();
+	void resetPresenceInRooms(int roomId);
+	void showPeoplePresent(int bitIndex);
+	int  selectCharacters(int min, int max);
+	void fctMove();
+	void fctTake();
+	void fctInventoryTake();
+	void fctLift();
+	void fctRead();
+	void fctSelfRead();
+	void fctLook();
+	void fctSelftLook();
+	void fctSearch();
+	void fctSelfSearch();
+	void fctOpen();
+	void fctPlace();
+	void fctTurn();
+	void fctSelfHide();
+	void fctAttach();
+	void fctClose();
+	void fctKnock();
+	void fctSelfPut();
+	void fctListen();
+	void fctEat();
+	void fctEnter();
+	void fctSleep();
+	void fctForce();
+	void fctLeave();
+	void fctWait();
+	void fctSound();
+	void fctDiscuss();
+	void fctSmell();
+	void fctScratch();
+	void endGame();
+	void askRestart();
+	void delay(int amount);
+	void handleOpcode();
 
+	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
+	void copcha();
 	void adzon();
 	void text1(int x, int y, int nb, int m);
 	void modif(int &nu);
@@ -188,90 +427,45 @@ private:
 	void ajchai();
 	void tfleche();
 	void setCoordinates(int sx);
+	void ecr2(Common::String text);
+	void ecr3(Common::String text);
+	void init_nbrepm();
+	void aniof(int ouf, int num);
+	void dessin();
+	void afdes();
+	void tlu(int af, int ob);
+	void affrep();
+	void mennor();
+	void ajjer(int ob);
+	void tsuiv();
+	void treg(int objId);
+	void avpoing(int &objId);
+	void rechai(int &ch);
+	void fenat(char ans);
 
 public:
-	Common::String _hintPctMessage;
 	Common::Point _prevPos;
-
-	byte _tabdon[4001];
-	byte _cfiecBuffer[822 * 128];
-	int  _fxxBuffer[108];
-	byte _touv[8];
 	int  _msg[5];
-	int  _nbrep[9];
-	int  _nbrepm[9];
-	uint16 _inpBuffer[kMaxTi + 1];
-	Hint _ntpBuffer[kMaxTd + 1];
-
-	bool _roomPresenceLuc;
-	bool _roomPresenceIda;
-	bool _purpleRoomPresenceLeo;
-	bool _roomPresenceGuy;
-	bool _roomPresenceEva;
-	bool _roomPresenceMax;
-	bool _roomPresenceBob;
-	bool _roomPresencePat;
-	bool _toiletsPresenceBobMax;
-	bool _bathRoomPresenceBobMax;
-	bool _room9PresenceLeo;
+	int  _fxxBuffer[108];
+	byte _tabdon[4001];
 	bool _soundOff;
-	bool _largestClearScreen;
-	bool _hiddenHero;
-	bool _heroSearching;
-	bool _keyPressedEsc;
-	bool _reloadCFIEC;
-
 	bool _blo;
-	bool _col;
-	bool _syn;
-	bool _obpart;
 	bool _okdes;
-	bool _anyone;
-	bool _brt;
-
-	int _textColor;
-	int _currGraphicalDevice;
-	int _newGraphicalDevice;
-	int _place;
-	int _manorDistance;
-	int _currBitIndex;
-	int _savedBitIndex;
-	int _currDay;
-	int _currHour;
-	int _currHalfHour;
-	int _day;
-	int _hour;
-	int _minute;
-	int _mchai;
+	bool _largestClearScreen;
+	int  _currGraphicalDevice;
+	int  _newGraphicalDevice;
 	float _addFix;
+	int  _savedBitIndex;
+	int  _numpal;
+	int  _key;
 	SaveStruct _coreVar, _saveStruct;
-	Common::Point _stdPal[91][17];
-	t_pcga _cgaPal[91];
-	int _key;
-	int _controlMenu;
-	int _startHour;
-	int _endHour;
 
-	int _c_zzz;
-	int ptr_word;
-	byte _v_lieu[7][25];
-	byte _is;
-	int _numpal;
-	int _ment;
-	int _iouv;
-	int _caff;
 	int _maff;
-	int _dobj;
-	int _num;
-	int _crep;
-	int _cs;
 	int _res;
-	int _prebru;
-	int _t;
-	int _x;
-	int _y;
-	int _jh;
-	int _mh;
+	int _caff;
+	int _crep;
+	byte _is;
+	byte _v_lieu[7][25];
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
@@ -285,11 +479,7 @@ public:
 	SpeechManager _speechManager;
 	Menu _menu;
 	MouseHandler _mouse;
-
-	bool _quitGame;			// Quit game flag. Originally called 'arret'
-	bool _endGame;			// End game flag. Originally called 'solu'
-	bool _loseGame;			// Lose game flag. Originally called 'perdu'
-	bool _txxFileFl;        // Flag used to determine if texts are from the original files or from a DAT file
+	TextHandler _text;
 
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
@@ -302,165 +492,33 @@ public:
 	uint32 getGameFlags() const;
 	Common::Language getLanguage() const;
 
-	bool keyPressed();
 	int getChar();
+	bool keyPressed();
 	Common::Point getMousePos() const { return _mousePos; }
 	void setMousePos(const Common::Point &pt);
 	bool getMouseClick() const { return _mouseClick; }
 	void setMouseClick(bool v) { _mouseClick = v; }
-	void delay(int amount);
 	Common::String getEngineString(int idx) const { return _engineStrings[idx]; }
 	Common::String getGameString(int idx) const { return _gameStrings[idx]; }
-	void handleOpcode();
 
-	void endGame();
-	void askRestart();
 	void gameLoaded();
-
-	void fctMove();
-	void fctTake();
-	void fctInventoryTake();
-	void fctLift();
-	void fctRead();
-	void fctSelfRead();
-	void fctLook();
-	void fctSelftLook();
-	void fctSearch();
-	void fctSelfSearch();
-	void fctOpen();
-	void fctPlace();
-	void fctTurn();
-	void fctSelfHide();
-	void fctAttach();
-	void fctClose();
-	void fctKnock();
-	void fctSelfPut();
-	void fctListen();
-	void fctEat();
-	void fctEnter();
-	void fctSleep();
-	void fctForce();
-	void fctLeave();
-	void fctWait();
-	void fctSound();
-	void fctDiscuss();
-	void fctSmell();
-	void fctScratch();
-
-	int  getPresenceStatsGreenRoom();
-	int  getPresenceStatsPurpleRoom();
-	int  getPresenceStatsToilets();
-	int  getPresenceStatsBlueRoom();
-	int  getPresenceStatsRedRoom();
-	int  getPresenceStatsDiningRoom(int &hour);
-	int  getPresenceStatsBureau(int &hour);
-	int  getPresenceStatsKitchen();
-	int  getPresenceStatsAttic();
-	int  getPresenceStatsLanding();
-	int  getPresenceStatsChapel(int &hour);
-	int  getPresenceBitIndex(int roomId);
-	void setPresenceGreenRoom(int roomId);
-	void setPresencePurpleRoom();
-	void setPresenceBlueRoom();
-	void setPresenceRedRoom(int roomId);
-	int setPresenceDiningRoom(int hour);
-	int setPresenceBureau(int hour);
-	int setPresenceKitchen();
-	int setPresenceLanding();
-	int setPresenceChapel(int hour);
-	void setRandomPresenceGreenRoom(int cf);
-	void setRandomPresencePurpleRoom(int cf);
-	void setRandomPresenceBlueRoom(int cf);
-	void setRandomPresenceRedRoom(int cf);
-	void setRandomPresenceRoom9(int cf);
-	void setRandomPresenceDiningRoom(int cf);
-	void setRandomPresenceBureau(int cf);
-	void setRandomPresenceKitchen(int cf);
-	void setRandomPresenceAttic(int cf);
-	void setRandomPresenceLanding(int cf);
-	void setRandomPresenceChapel(int cf);
-
-	void loadPlaces();
 	void initGame();
-	void resetPresenceInRooms(int roomId);
-	void showPeoplePresent(int bitIndex);
-	int selectCharacters(int min, int max);
 	void displayAloneText();
-
-	void checkManorDistance();
-	void gotoManorFront();
-	void gotoManorBack();
-	void gotoDiningRoom();
-	bool checkInventory(int objectId);
-	void loseGame();
-	void floodedInWell();
-	void displayDiningRoom();
-	void startMusicOrSpeech(int so);
-	void setTextColor(int col);
-	void prepareScreenType1();
-	void prepareScreenType2();
-	void prepareScreenType3();
-	void updateHour(int &day, int &hour, int &minute);
-	void getKnockAnswer();
+	void draw(int ad, int x, int y);
 	void charToHour();
 	void hourToChar();
-
-	void changeGraphicalDevice(int newDevice);
-	void startDialog(int16 rep);
-	void endSearch();
-	int convertCharacterIndexToBitIndex(int characterIndex);
-	int convertBitIndexToCharacterIndex(int bitIndex);
-	void clearScreenType1();
-	void clearScreenType2();
-	void clearScreenType3();
-	void clearScreenType10();
-	int getRandomNumber(int minval, int maxval);
-	void showMoveMenuAlert();
-	void showConfigScreen();
-	void decodeNumber(byte *pStart, int count);
 	Common::String getString(int num);
-	void resetVariables();
 	void setPal(int n);
-	void music();
-	void draw(int ad, int x, int y);
-	void drawRightFrame();
-	void prepareRoom();
-	void drawClock();
 	Common::String copy(const Common::String &s, int idx, size_t size);
-	void hirs();
-	void initCaveOrCellar();
-	void displayControlMenu();
-	void displayItemInHand(int objId);
-	void displayEmptyHand();
-	void resetRoomVariables(int roomId);
-	int  getPresenceStats(int &rand, int cf, int roomId);
-	void setPresenceFlags(int roomId);
+	void testKeyboard();
 	int  getPresence(int roomId);
-	void testKey(bool d);
-	void exitRoom();
-	void getReadDescription(int objId);
-	void getSearchDescription(int objId);
-	int  checkLeaveSecretPassage();
+	void displayEmptyHand();
 
-	void pictout(int seg, int dep, int x, int y);
-	int  animof(int ouf, int num);
+	void hirs();
+	int  testou();
 	void repon(int f, int m);
-	void ecr2(Common::String text);
-	void ecr3(Common::String text);
-	void init_nbrepm();
-	void aniof(int ouf, int num);
-	void dessin();
-	void afdes();
-	void tlu(int af, int ob);
-	void affrep();
-	void mennor();
-	void ajjer(int ob);
-	void tsuiv();
-	void treg(int objId);
-	void avpoing(int &objId);
-	void rechai(int &ch);
-	void fenat(char ans);
-
+	int  animof(int ouf, int num);
+	void pictout(int seg, int dep, int x, int y);
 	void sauvecr(int y, int dy);
 	void charecr(int y, int dy);
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index e18090e..ff50e8b 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -69,7 +69,6 @@ void MouseHandler::hideMouse() {
 		case MODE_AMSTRAD1512: {
 			bool imp = odd(_pos.y);
 			for (int i = 0; i <= 3; ++i) {
-				_port[0x3dd] = 1 << i;
 				int k = 0;
 				j = 0;
 				do {
@@ -87,12 +86,8 @@ void MouseHandler::hideMouse() {
 			break;
 			}
 		case MODE_EGA: {
-			_port[0x3c4] = 2;
-			_port[0x3ce] = 8;
-			_port[0x3cf] = 255;
 			int i = 0;
 			do {
-				_port[0x3c5] = 1 << i;
 				int k = 0;
 				j = 0;
 				do {
@@ -167,7 +162,6 @@ void MouseHandler::showMouse() {
 		for (i = 0; i <= 3; ++i) {
 			j = 0;
 			imp = odd(_pos.y);
-			_port[0x3de] = i;
 			k = 0;
 			do {
 				if (imp) {
@@ -184,10 +178,8 @@ void MouseHandler::showMouse() {
 		break;
 		}
 	case MODE_EGA:
-		_port[0x3ce] = 4;
 		l = 0;
 		do {
-			_port[0x3cf] = l;
 			k = 0;
 			j = 0;
 			do {
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index b570f89..efbb52a 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -36,8 +36,6 @@ class MouseHandler {
 private:
 	int s_s[12][6];
 	int _counter;
-	// TODO: Replace the following with proper implementations, or refactor out the code using them
-	int  _port[0xfff];
 public:
 	Common::Point _pos;
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 35d4225..f53a7b2 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -35,10 +35,11 @@
 
 namespace Mortevielle {
 
-typedef unsigned char uchar;
-const byte _rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
-
-static int l_motsuiv(int p, const char *ch, int &tab) {
+/**
+ * Next word
+ * @remarks	Originally called 'l_motsuiv'
+ */
+int TextHandler::nextWord(int p, const char *ch, int &tab) {
 	int c = p;
 
 	while ((ch[p] != ' ') && (ch[p] != '$') && (ch[p] != '@'))
@@ -51,7 +52,7 @@ static int l_motsuiv(int p, const char *ch, int &tab) {
  * Engine function - Display Text
  * @remarks	Originally called 'afftex'
  */
-void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ) {
+void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ) {
 	int tab;
 	Common::String s;
 	int i, j;
@@ -87,7 +88,7 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 			s += ' ';
 			xc += tab;
 			++p;
-			if (l_motsuiv(p, inputStr.c_str(), tab) + xc > xf) {
+			if (nextWord(p, inputStr.c_str(), tab) + xc > xf) {
 				g_vm->_screenSurface.drawString(s, typ);
 				s = "";
 				xc = x;
@@ -123,7 +124,11 @@ void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ)
 	}
 }
 
-void chardes(Common::String filename, int32 skipSize, int length) {
+/**
+ * Load DES file
+ * @remarks	Originally called 'chardes'
+ */
+void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
@@ -150,7 +155,11 @@ void chardes(Common::String filename, int32 skipSize, int length) {
 		g_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
 }
 
-void charani(Common::String filename, int32 skipSize, int length) {
+/**
+ * Load ANI file
+ * @remarks	Originally called 'charani'
+ */
+void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
 	if (!f.open(filename))
 		error("Missing file - %s", filename.c_str());
@@ -177,7 +186,9 @@ void charani(Common::String filename, int32 skipSize, int length) {
 		g_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
 }
 
-void taffich() {
+void TextHandler::taffich() {
+	static const byte _rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+
 	byte tran1[] = { 121, 121, 138, 139, 120 };
 	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
 
@@ -295,7 +306,7 @@ void taffich() {
 		g_vm->_maff = a;
 		npal = a + 37;
 	}
-	chardes(filename, lgt, handle);
+	loadDesFile(filename, lgt, handle);
 	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
 			int palh = READ_LE_UINT16(&g_vm->_mem[(0x7000 * 16) + ((i + 1) << 1)]);
@@ -330,7 +341,7 @@ void taffich() {
 			filename = "AZZ.mor";
 			handle = 1260;
 		}
-		charani(filename, lgt, handle);
+		loadAniFile(filename, lgt, handle);
 	}
 	g_vm->_mouse.showMouse();
 	if ((a < 27) && ((g_vm->_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_vm->_msg[4] != OPCODE_ENTER)) {
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index d27ca3e..3664fd6 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -35,10 +35,15 @@ namespace Mortevielle {
 
 const int kAdrAni = 0x7314;
 
-extern void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-extern void chardes(Common::String filename, int32 passe, int long_);
-extern void charani(Common::String filename, int32 skipSize, int length);
-extern void taffich();
+class TextHandler {
+private:
+	int  nextWord(int p, const char *ch, int &tab);
+public:
+	void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
+	void loadDesFile(Common::String filename, int32 passe, int long_);
+	void loadAniFile(Common::String filename, int32 skipSize, int length);
+	void taffich();
+};
 
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 3086f9e..0e12c5f 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -33,76 +33,6 @@
 
 namespace Mortevielle {
 
-/*---------------------------------------------------------------------------*/
-/*-------------------           MEMORY  MAP          ------------------------*/
-/*---------------------------------------------------------------------------*/
-/* The following is a list of physical addresses in memory currently used
- * by the game.
- *
- * Address
- * -------
- * 5000:0 - Music data
- * 6000:0 - Decompressed current image
- * 7000:0+ - Compressed images
- * 7000:2 - 16 words representing palette map
- * 7000:4138 - width, height, x/y offset of decoded image
- */
-
-
-/*---------------------------------------------------------------------------*/
-/*-------------------------     DEFINES    ----------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-#define ord(v) ((int) v)
-#define chr(v) ((unsigned char) v)
-#define lo(v) ((v) & 0xff)
-#define hi(v) (((v) >> 8) & 0xff)
-#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
-#define odd(v) (((v) % 2) == 1)
-
-/*---------------------------------------------------------------------------*/
-/*-------------------------    CONSTANTS   ----------------------------------*/
-/*---------------------------------------------------------------------------*/
-
-const int kMaxTi = 7975;
-const int kMaxTd = 600;
-
-const int kDescriptionStringIndex = 0;                // Unused
-const int kInventoryStringIndex = 186;
-const int kQuestionStringIndex = 247;
-const int kDialogStringIndex = 292;
-const int kMenuPlaceStringIndex = 435;
-const int kMenuActionStringIndex = 476;
-const int kMenuSelfStringIndex = 497;
-const int kMenuSayStringIndex = 502;
-const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
-const int kMaxPatt = 20;
-
-const int OPCODE_NONE = 0;
-enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
-            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
-			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
-			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
-			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
-			OPCODE_SLOOK = 0x405};
-
-/*
-9   "A glance at the forbidden$",
-18  "It's already open$",
-26  "A photograph$",
-27  "The coat of arms$",
-*/
-enum places {
-	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
-	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
-	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14, 
-	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19, 
-	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     INSIDE_WELL = 23, WELL = 24,
-	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
-};
-
-enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
-
 struct Rect {
 	int _x1, _x2, _y1, _y2;
 	bool _enabled;


Commit: 4db87a5f47c8a81a87e2c98f6864720f6798bb6f
    https://github.com/scummvm/scummvm/commit/4db87a5f47c8a81a87e2c98f6864720f6798bb6f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:51-07:00

Commit Message:
MORTEVIELLE: rename some constants

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1a66149..0117288 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -349,7 +349,7 @@ void MortevielleEngine::fctLift() {
 		tmpPlace = 14;
 	else if (_coreVar._currPlace == MOUNTAIN)
 		tmpPlace = 15;
-	_crep = _tabdon[asoul + (tmpPlace << 3) + (_num - 1)];
+	_crep = _tabdon[kAsoul + (tmpPlace << 3) + (_num - 1)];
 	if (_crep == 255)
 		_crep = 997;
 }
@@ -443,7 +443,7 @@ void MortevielleEngine::fctLook() {
 		cx -= 4;
 	if (_coreVar._currPlace == ROOM26)
 		cx = 21;
-	_crep = _tabdon[arega + (cx * 7) + _num - 1];
+	_crep = _tabdon[kArega + (cx * 7) + _num - 1];
 	if ((_coreVar._currPlace == ATTIC) && (_num == 8))
 		_crep = 126;
 	if (_coreVar._currPlace == MOUNTAIN)
@@ -631,7 +631,7 @@ void MortevielleEngine::fctOpen() {
 			tmpPlace = _coreVar._currPlace;
 			if (_coreVar._currPlace == CRYPT)
 				tmpPlace = CELLAR;
-			_crep = _tabdon[aouvr + (tmpPlace * 7) + _num - 1];
+			_crep = _tabdon[kAouvr + (tmpPlace * 7) + _num - 1];
 			if (_crep == 254)
 				_crep = 999;
 		} else
@@ -1474,8 +1474,8 @@ void MortevielleEngine::fctDiscuss() {
 					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
 			} else if (_nbrep[_caff - 69] < _nbrepm[_caff - 69]) {
-				suj = _tabdon[arep + (ix << 3) + (_caff - 70)];
-				_coreVar._faithScore += _tabdon[arcf + ix];
+				suj = _tabdon[kArep + (ix << 3) + (_caff - 70)];
+				_coreVar._faithScore += _tabdon[kArcf + ix];
 				++_nbrep[_caff - 69];
 			} else {
 				_coreVar._faithScore += 3;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index fec1473..2c3313e 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -3582,7 +3582,7 @@ void MortevielleEngine::setCoordinates(int sx) {
 	_num = 0;
 	_crep = 999;
 	int a = 0;
-	int atdon = amzon + 3;
+	int atdon = kAmzon + 3;
 	int cy = 0;
 	while (cy < _caff) {
 		a += _tabdon[atdon];
@@ -3664,7 +3664,7 @@ void MortevielleEngine::rechai(int &ch) {
 
 	if (_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
-	ch = _tabdon[achai + (tmpPlace * 7) + _num - 1];
+	ch = _tabdon[kAchai + (tmpPlace * 7) + _num - 1];
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 514b929..98d4b04 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -110,13 +110,13 @@ const int kAcha = 492;
 const int kAdrDes = 0x7000;
 const int kFleche = 1758;
 
-const int asoul = 154;
-const int aouvr = 282;
-const int achai = 387;
-const int arcf = 1272;
-const int arep = 1314;
-const int amzon = 1650;
-const int arega = 0;
+const int kAsoul = 154;
+const int kAouvr = 282;
+const int kAchai = 387;
+const int kArcf = 1272;
+const int kArep = 1314;
+const int kAmzon = 1650;
+const int kArega = 0;
 
 const int kMaxTi = 7975;
 const int kMaxTd = 600;


Commit: 2a91308490582d85a5dc8ec7bd7492ec201bb173
    https://github.com/scummvm/scummvm/commit/2a91308490582d85a5dc8ec7bd7492ec201bb173
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:53-07:00

Commit Message:
MORTEVIELLE: rename Rect

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/var_mor.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index f04233d..395f6b6 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -289,7 +289,7 @@ bool KnowledgeCheck::show() {
 	int rep;
 	int firstOption, lastOption;
 	char key;
-	Rect coor[kMaxRect];
+	Hotspot coor[kMaxRect];
 	Common::String choiceArray[15];
 
 	int currChoice, prevChoice;
@@ -329,10 +329,10 @@ bool KnowledgeCheck::show() {
 		}
 
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			coor[j]._x1 = 45 * g_vm->_res;
-			coor[j]._x2 = (maxLength * 3 + 55) * g_vm->_res;
-			coor[j]._y1 = 27 + j * 8;
-			coor[j]._y2 = 34 + j * 8;
+			coor[j]._rect.left = 45 * g_vm->_res;
+			coor[j]._rect.right = (maxLength * 3 + 55) * g_vm->_res;
+			coor[j]._rect.top = 27 + j * 8;
+			coor[j]._rect.bottom = 34 + j * 8;
 			coor[j]._enabled = true;
 
 			while ((int)choiceArray[j].size() < maxLength) {
@@ -356,7 +356,7 @@ bool KnowledgeCheck::show() {
 			CHECK_QUIT0;
 
 			currChoice = 1;
-			while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]))
+			while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]._rect))
 				++currChoice;
 			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index ff50e8b..f914860 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -408,11 +408,11 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
  * Mouse function : Is mouse in a given rect?
  * @remarks	Originally called 'dans_rect'
  */
-bool MouseHandler::isMouseIn(Rect r) {
+bool MouseHandler::isMouseIn(Common::Rect r) {
 	int x, y, c;
 
 	getMousePosition(x, y, c);
-	if ((x > r._x1) && (x < r._x2) && (y > r._y1) && (y < r._y2))
+	if ((x > r.left) && (x < r.right) && (y > r.top) && (y < r.bottom))
 		return true;
 
 	return false;
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index efbb52a..b93ce61 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -45,7 +45,7 @@ public:
 	void setMousePosition(Common::Point newPos);
 	void getMousePosition(int &x, int &y, int &c);
 	void moveMouse(bool &funct, char &key);
-	bool isMouseIn(Rect r);
+	bool isMouseIn(Common::Rect r);
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
index 0e12c5f..bddf85c 100644
--- a/engines/mortevielle/var_mor.h
+++ b/engines/mortevielle/var_mor.h
@@ -33,8 +33,8 @@
 
 namespace Mortevielle {
 
-struct Rect {
-	int _x1, _x2, _y1, _y2;
+struct Hotspot {
+	Common::Rect _rect;
 	bool _enabled;
 };
 


Commit: 9dfee9c811c07a480b50026269461235104f6668
    https://github.com/scummvm/scummvm/commit/9dfee9c811c07a480b50026269461235104f6668
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:54-07:00

Commit Message:
MORTEVIELLE: Fix regression in previous commit

Changed paths:
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 395f6b6..b90f165 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -284,12 +284,19 @@ bool KnowledgeCheck::show() {
 	const int textIndexArr[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
 	const int correctAnswerArr[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
+	char key;
 	int optionPosY;
 	int maxLength;
 	int rep;
 	int firstOption, lastOption;
-	char key;
-	Hotspot coor[kMaxRect];
+
+	Hotspot coor[kMaxRect+1];
+
+	for (int i = 0; i < kMaxRect; ++i) {
+		coor[i]._rect = Common::Rect();
+		coor[i]._enabled = false;
+	}
+
 	Common::String choiceArray[15];
 
 	int currChoice, prevChoice;
@@ -329,10 +336,7 @@ bool KnowledgeCheck::show() {
 		}
 
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			coor[j]._rect.left = 45 * g_vm->_res;
-			coor[j]._rect.right = (maxLength * 3 + 55) * g_vm->_res;
-			coor[j]._rect.top = 27 + j * 8;
-			coor[j]._rect.bottom = 34 + j * 8;
+			coor[j]._rect = Common::Rect(45 * g_vm->_res, 27 + j * 8, (maxLength * 3 + 55) * g_vm->_res, 34 + j * 8);
 			coor[j]._enabled = true;
 
 			while ((int)choiceArray[j].size() < maxLength) {


Commit: edbeb905b2967ac47c767a2ea1fedcec295729cc
    https://github.com/scummvm/scummvm/commit/edbeb905b2967ac47c767a2ea1fedcec295729cc
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:56-07:00

Commit Message:
MORTEVIELLE: Remove trailing spaces

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/detection.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 0117288..48d73a2 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -70,10 +70,10 @@ void MortevielleEngine::fctMove() {
 			_coreVar._currPlace = ATTIC;
 			_menu.setDestinationText(ATTIC);
 		}
-		
+
 		if (_num != 6)
 			_coreVar._currPlace = ROOM26;
-		
+
 		if ((_num > 1) && (_num < 6))
 			_ment = _num - 1;
 		else if (_num > 7)
@@ -116,10 +116,10 @@ void MortevielleEngine::fctMove() {
 		menuChoice = 6;
 	else if (((_coreVar._currPlace == LANDING) || (_coreVar._currPlace == ROOM26)) && (menuChoice == 4))
 		menuChoice = 6;
-	
+
 	if ((_coreVar._currPlace > MOUNTAIN) && (_coreVar._currPlace != ROOM26))
 		menuChoice += 10;
-	
+
 	if ((_coreVar._currPlace == CHAPEL) && (menuChoice == 13))
 		menuChoice = 16;
 	else if (_coreVar._currPlace == MANOR_FRONT) {
@@ -710,7 +710,7 @@ void MortevielleEngine::fctPlace() {
 						drawClock();
 						if (_currBitIndex != 0)
 							showPeoplePresent(_currBitIndex);
-						else 
+						else
 							displayAloneText();
 
 						_menu.displayMenu();
@@ -1109,7 +1109,7 @@ void MortevielleEngine::fctEat() {
 				else
 					h = 1;
 			}
-			
+
 			_jh += h;
 			_crep = 135;
 			prepareRoom();
@@ -1145,7 +1145,7 @@ void MortevielleEngine::fctEnter() {
 				_x = (getRandomNumber(0, 10)) - 5;
 				_speechManager.startSpeech(7, _x, 1);
 				aniof(1, 1);
-				
+
 				_x = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
@@ -1166,7 +1166,7 @@ void MortevielleEngine::fctEnter() {
 			_x = (getRandomNumber(0, 10)) - 5;
 			_speechManager.startSpeech(7, _x, 1);
 			aniof(1, 1);
-			
+
 			_coreVar._currPlace = _ment;
 			affrep();
 			resetRoomVariables(_coreVar._currPlace);
@@ -1590,7 +1590,7 @@ void MortevielleEngine::endGame() {
 	repon(2, 35);
 	startMusicOrSpeech(0);
 	testKey(false);
-	// A wait message was displayed. 
+	// A wait message was displayed.
 	// testKey (aka tkey1) was called before and after.
 	// Most likely the double call is useless, thus removed
 	//
diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 5997b4c..994563d 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -41,7 +41,7 @@ static const PlainGameDescriptor MortevielleGame[] = {
 
 class MortevielleMetaEngine : public AdvancedMetaEngine {
 public:
-	MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::MortevielleGameDescriptions, sizeof(ADGameDescription), 
+	MortevielleMetaEngine() : AdvancedMetaEngine(Mortevielle::MortevielleGameDescriptions, sizeof(ADGameDescription),
 		MortevielleGame) {
 		_md5Bytes = 512;
 		_singleid = "mortevielle";
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b90f165..b53a9d5 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -418,7 +418,7 @@ void f3f8::draw() {
 }
 
 /**
- * Alert function - Loop until F8 is pressed, update 
+ * Alert function - Loop until F8 is pressed, update
  * Graphical Device if modified
  * @remarks	Originally called 'diver'
  */
@@ -462,7 +462,7 @@ void f3f8::aff50(bool drawAni50Fl) {
 		ani50();
 	else
 		g_vm->repon(2, kDialogStringIndex + 142);
-	
+
 	// Draw the f3/f8 dialog
 	draw();
 }
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 40109c8..db13c09 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -58,6 +58,6 @@ public:
 	static void aff50(bool drawAni50Fl);
 	static void ani50();
 };
-	
+
 } // End of namespace Mortevielle
 #endif
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 2b66075..e290f60 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -31,8 +31,8 @@
 namespace Mortevielle {
 
 /*-------------------------------------------------------------------------*
- * Palette Manager 
- * 
+ * Palette Manager
+ *
  *-------------------------------------------------------------------------*/
 
 /**
@@ -71,7 +71,7 @@ void PaletteManager::setDefaultPalette() {
 
 /*-------------------------------------------------------------------------*
  * Image decoding
- * 
+ *
  * The code in this section is responsible for decoding image resources.
  * Images are broken down into rectangular sections, which can use one
  * of 18 different encoding methods.
@@ -138,7 +138,7 @@ void GfxSurface::decode(const byte *pSrc) {
 		_xSize = READ_BE_UINT16(pSrc + 2) + 1;
 		_ySize = READ_BE_UINT16(pSrc + 4) + 1;
 		majTtxTty();
-		
+
 		pSrc += 6;
 		pDest = &outputBuffer[0];
 
@@ -159,7 +159,7 @@ void GfxSurface::decode(const byte *pSrc) {
 					const byte *pSrcSaved = pSrc;
 					bool savedNibbleFlag = _nibbleFlag;
 					int savedLookupIndex = _lookupIndex;
-					
+
 					do {
 						pSrc = pSrcSaved;
 						_nibbleFlag = savedNibbleFlag;
@@ -237,7 +237,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			pDest = &outputBuffer[_yp * DEFAULT_WIDTH + _xp];
 			pSrcStart = pSrc;
 			INCR_TAIX;
-			
+
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 				byte *pDestLine = pDest;
 				for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
@@ -490,7 +490,7 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 				break;
 			continue;
 		}
-		
+
 		bool continueFlag = false;
 		do {
 			for (int xIndex = 0; xIndex < _xSize; ++xIndex) {
@@ -599,7 +599,7 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 			pDest += _thickness;
 			drawIndex += _thickness;
 		}
-		
+
 		while (_xSize < (drawIndex + _thickness)) {
 			if (--_thickness == 0)
 				return;
@@ -622,7 +622,7 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
 					*--pDest = csuiv(pSrc, pLookup);
 			}
-		}				
+		}
 		if ((_ySize % 2) == 0) {
 			pDest += _thickness;
 			drawIndex += _thickness;
@@ -743,7 +743,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 				NIH();
 				increments(pDest);
 			}
-			
+
 			NIH();
 			NIV();
 			increments(pDest);
@@ -780,7 +780,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 				NIH();
 				increments(pDest);
 			}
-			
+
 			NIH();
 			NIV();
 			increments(pDest);
@@ -791,13 +791,13 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 				break;
 			} else {
 				pDest += _xInc;
-				
+
 				if (--drawIndex == 0) {
 					TF2(pSrc, pDest, pLookup, diagIndex);
 					NIH();
 					break;
 				}
-			} 
+			}
 
 			NIH();
 		}
@@ -885,7 +885,7 @@ void ScreenSurface::updateScreen() {
 	// Iterate through copying dirty areas to the screen
 	for (Common::List<Common::Rect>::iterator i = _dirtyRects.begin(); i != _dirtyRects.end(); ++i) {
 		Common::Rect r = *i;
-		g_system->copyRectToScreen((const byte *)getBasePtr(r.left, r.top), pitch, 
+		g_system->copyRectToScreen((const byte *)getBasePtr(r.left, r.top), pitch,
 			r.left, r.top, r.width(), r.height());
 	}
 	_dirtyRects.clear();
@@ -896,7 +896,7 @@ void ScreenSurface::updateScreen() {
 
 /**
  * Draws a decoded picture on the screen
- * @remarks		- Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		- Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled.
  *		- Image resources are stored at 320x200, so when drawn onto the screen a single pixel
  *		from the source image is drawn using the two pixels at the given index in the palette map
@@ -909,13 +909,13 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 	y += surface._offset.y;
 
 	// Lock the affected area of the surface to write to
-	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y * 2, 
+	Graphics::Surface destSurface = lockArea(Common::Rect(x * 2, y * 2,
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
 	const byte *paletteMap = &g_vm->_mem[0x7000 * 16 + 2];
 
-	// Loop through writing 
+	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
 		if (((y + yp) < 0) || ((y + yp) >= 200))
 			continue;
@@ -948,7 +948,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 void ScreenSurface::copyFrom(Graphics::Surface &src, int x, int y) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(x, y, x + src.w, y + src.h));
 
-	// Loop through writing 
+	// Loop through writing
 	for (int yp = 0; yp < src.h; ++yp) {
 		if (((y + yp) < 0) || ((y + yp) >= SCREEN_HEIGHT))
 			continue;
@@ -961,11 +961,11 @@ void ScreenSurface::copyFrom(Graphics::Surface &src, int x, int y) {
 
 /**
  * Draws a character at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex) {
-	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2, 
+	Graphics::Surface destSurface = lockArea(Common::Rect(pt.x, pt.y * 2,
 		pt.x + FONT_WIDTH, (pt.y + FONT_HEIGHT) * 2));
 
 	// Get the start of the character to use
@@ -988,7 +988,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
 
 /**
  * Draws a box at the specified position and size
- * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
@@ -1011,13 +1011,13 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
 
 /**
  * Fills an area with the specified colour
- * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::fillRect(int colour, const Common::Rect &bounds) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2,
 		bounds.right, bounds.bottom * 2));
-	
+
 	// Fill the area
 	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), colour);
 }
@@ -1032,7 +1032,7 @@ void ScreenSurface::clearScreen() {
 
 /**
  * Sets a single pixel at the specified co-ordinates
- * @remarks		Because the ScummVM surface is using a double height 640x400 surface to 
+ * @remarks		Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
@@ -1115,7 +1115,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 	yr = y;
 	xro = xx;
 	yro = yy;
-	
+
 	if (abs(y - yy) > abs(x - xx)) {
 		a = (float)((x - xx)) / (y - yy);
 		b = (yr * xro - yro * xr) / (y - yy);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index d7ece8a..4dcb034 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -177,7 +177,7 @@ void Menu::displayMenu() {
 	int pt, x, y, color, msk, num_letr;
 
 	g_vm->_mouse.hideMouse();
-	
+
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
 	col = 28 * g_vm->_res;
 	if (g_vm->_currGraphicalDevice == MODE_CGA)
@@ -434,9 +434,9 @@ void Menu::mdn() {
 			return;
 		else
 			g_vm->_prevPos = curPos;
-		
-		bool tes =  (curPos.y < 11) 
-		   && ((curPos.x >= (28 * g_vm->_res) && curPos.x <= (28 * g_vm->_res + 24)) 
+
+		bool tes =  (curPos.y < 11)
+		   && ((curPos.x >= (28 * g_vm->_res) && curPos.x <= (28 * g_vm->_res + 24))
 		   ||  (curPos.x >= (76 * g_vm->_res) && curPos.x <= (76 * g_vm->_res + 24))
 		   || ((curPos.x > 124 * g_vm->_res) && (curPos.x < 124 * g_vm->_res + 24))
 		   || ((curPos.x > 172 * g_vm->_res) && (curPos.x < 172 * g_vm->_res + 24))
@@ -481,7 +481,7 @@ void Menu::mdn() {
 			menuDown(_msg3);
 
 			g_vm->setMouseClick(false);
-		} else { 
+		} else {
 			//  A menu was clicked on
 			_menuSelected = (_multiTitle) && (_msg4 != OPCODE_NONE);
 			menuUp(_msg3);
@@ -551,7 +551,7 @@ void Menu::initMenu() {
  * @remarks	Originally called 'mfoudi'
  */
 void Menu::setSearchMenu() {
-	for (int i = 1; i <= 7; ++i) 
+	for (int i = 1; i <= 7; ++i)
 		disableMenuItem(_moveMenu[i]);
 
 	for (int i = 1; i <= 11; ++i)
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 2c3313e..af4db82 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -86,7 +86,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_toiletsPresenceBobMax = false;
 	_bathRoomPresenceBobMax = false;
 	_room9PresenceLeo = false;
-	
+
 	_soundOff = false;
 	_largestClearScreen = false;
 	_hiddenHero = false;
@@ -144,7 +144,7 @@ bool MortevielleEngine::canSaveGameStateCurrently() {
  * Load in a savegame at the specified slot number
  */
 Common::Error MortevielleEngine::loadGameState(int slot) {
-	return _savegameManager.loadGame(slot);	
+	return _savegameManager.loadGame(slot);
 }
 
 /**
@@ -153,7 +153,7 @@ Common::Error MortevielleEngine::loadGameState(int slot) {
 Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &desc) {
 	if (slot == 0)
 		return Common::kWritingFailed;
-	
+
 	return _savegameManager.saveGame(slot, desc);
 }
 
@@ -296,7 +296,7 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataTyp
 		char ch;
 		while ((ch = (char)f.readByte()) != '\0')
 			s += ch;
-		
+
 		if (dataType == kStaticStrings)
 			_engineStrings.push_back(s);
 		else if (dataType == kGameStrings)
@@ -319,7 +319,7 @@ bool MortevielleEngine::keyPressed() {
 	// Check if it's time to draw the next frame
 	if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
 		_lastGameFrame = g_system->getMillis();
-	
+
 		_screenSurface.updateScreen();
 	}
 
@@ -327,7 +327,7 @@ bool MortevielleEngine::keyPressed() {
 	g_system->delayMillis(5);
 
 	// Return if there are any pending key presses
-	return !_keypresses.empty(); 
+	return !_keypresses.empty();
 }
 
 /**
@@ -387,7 +387,7 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
 
 	// Handle alphabetic keys
 	if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
-		if (evt.kbd.hasFlags(Common::KBD_CTRL)) 
+		if (evt.kbd.hasFlags(Common::KBD_CTRL))
 			ch = evt.kbd.keycode - Common::KEYCODE_a + 1;
 		else
 			ch = evt.kbd.keycode - Common::KEYCODE_a + 'A';
@@ -560,7 +560,7 @@ void MortevielleEngine::mainGame() {
 	if (_reloadCFIEC)
 		loadCFIEC();
 
-	for (_crep = 1; _crep <= _c_zzz; ++_crep) 
+	for (_crep = 1; _crep <= _c_zzz; ++_crep)
 		decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
@@ -719,7 +719,7 @@ void MortevielleEngine::loadPlaces() {
 
 	for (int i = 0; i < 7; ++i) {
 		for (int j = 0; j < 25; ++j)
-			_v_lieu[i][j] = f.readByte(); 
+			_v_lieu[i][j] = f.readByte();
 	}
 
 	f.close();
@@ -846,7 +846,7 @@ void MortevielleEngine::resetPresenceInRooms(int roomId) {
 }
 
 /**
- * Engine function - Show the people present in the given room 
+ * Engine function - Show the people present in the given room
  * @remarks	Originally called 'affper'
  */
 void MortevielleEngine::showPeoplePresent(int bitIndex) {
@@ -937,8 +937,8 @@ int MortevielleEngine::getPresenceStatsGreenRoom() {
 	int retVal = 0;
 
 	updateHour(day, hour, minute);
-	// The original uses an || instead of an &&, resulting 
-	// in an always true condition. Based on the other tests, 
+	// The original uses an || instead of an &&, resulting
+	// in an always true condition. Based on the other tests,
 	// and on other scenes, we use an && instead.
 	if ((hour > 7) && (hour < 11))
 		retVal = 25;
@@ -978,7 +978,7 @@ int MortevielleEngine::getPresenceStatsPurpleRoom() {
 		retVal = 20;
 	else if ((hour >= 0) && (hour < 8))
 		retVal = 50;
-	
+
 	return retVal;
 }
 
@@ -1707,7 +1707,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 	Common::String dialogStr = getString(rep + kDialogStringIndex);
 	_text.displayStr(dialogStr, 230, 4, 65, 24, 5);
 	f3f8::draw();
-	
+
 	key = 0;
 	do {
 		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
@@ -1808,7 +1808,7 @@ void MortevielleEngine::gotoManorBack() {
 }
 
 /**
- * Engine function - Dead : Flooded in Well 
+ * Engine function - Dead : Flooded in Well
  * @remarks	Originally called 't1deau'
  */
 void MortevielleEngine::floodedInWell() {
@@ -2095,7 +2095,7 @@ void MortevielleEngine::clearScreenType10() {
 		st = getEngineString(S_LOURDE);
 	else if (_coreVar._faithScore > 65)
 		st = getEngineString(S_MALSAINE);
-	
+
 	co = 580 - (_screenSurface.getStringWidth(st) / 2);
 	_screenSurface.putxy(co, 92);
 	_screenSurface.drawString(st, 4);
@@ -2145,7 +2145,7 @@ void MortevielleEngine::decodeNumber(byte *pStart, int count) {
 				*pStart = 0;
 			else if (v & 0xff00)
 				*pStart = 0xff;
-			else 
+			else
 				*pStart = (byte)v;
 		}
 	}
@@ -2312,7 +2312,7 @@ void MortevielleEngine::setPal(int n) {
 
 		if (n < 89)
 			palette(_cgaPal[n]._p);
-		
+
 		for (int i = 0; i <= 15; ++i)
 			displayCGAPattern(i, _patternArr[pal[i]._id], pal);
 		}
@@ -2361,7 +2361,7 @@ void MortevielleEngine::loadPalette() {
 		}
 	}
 	f.close();
-	
+
 	if (!f.open("cxx.mor"))
 		error("Missing file - cxx.mor");
 
@@ -2408,16 +2408,16 @@ void MortevielleEngine::loadTexts() {
 			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
 			return;
 		}
-	} 
+	}
 	if (!ntpFile.open("TXX.NTP")) {
 		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
 		return;
 	}
-	
+
 	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {
 		warning("TXX file - Unexpected format - Switching to DAT file");
 		return;
-	} 
+	}
 
 	for (int i = 0; i < inpFile.size() / 2; ++i)
 		_inpBuffer[i] = inpFile.readUint16LE();
@@ -2478,7 +2478,7 @@ void MortevielleEngine::music() {
 		return;
 
 	_reloadCFIEC = true;
-	
+
 	Common::File fic;
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
@@ -2730,7 +2730,7 @@ void MortevielleEngine::drawClock() {
 	int h, co;
 
 	_mouse.hideMouse();
-	
+
 	_screenSurface.drawRectangle(570, 118, 20, 10);
 	_screenSurface.drawRectangle(578, 114, 6, 18);
 	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
@@ -2740,7 +2740,7 @@ void MortevielleEngine::drawClock() {
 
 	if (_minute == 0)
 		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y - rg), co);
-	else 
+	else
 		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y + rg), co);
 
 	h = _hour;
@@ -3058,7 +3058,7 @@ int MortevielleEngine::checkLeoMaxRandomPresence() {
 	int retval = getRandomNumber(1, 2);
 	if (retval == 2)
 		retval = 128;
-	
+
 	return retval;
 }
 
@@ -3230,7 +3230,7 @@ void MortevielleEngine::writetp(Common::String s, int t) {
 void MortevielleEngine::aniof(int ouf, int num) {
 	if ((_caff == 7) && ((num == 4) || (num == 5)))
 		return;
-	
+
 	if ((_caff == 10) && (num == 7))
 		num = 6;
 	else if (_caff == 12) {
@@ -3280,7 +3280,7 @@ void MortevielleEngine::dessin() {
 			else if ((_caff == 24) && (_coreVar._wellObjectId != 0))
 				aniof(1, 1);
 		}
-		
+
 		if (_caff < ROOM26)
 			startMusicOrSpeech(1);
 	}
@@ -3311,7 +3311,7 @@ void MortevielleEngine::testKey(bool d) {
 		_mouse.getMousePosition(x, y, c);
 		keyPressed();
 	} while (c != 0);
-	
+
 	// Event loop
 	do {
 		if (d)
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 98d4b04..68ea227 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -61,7 +61,7 @@ namespace Mortevielle {
 #define chr(v) ((unsigned char) v)
 #define lo(v) ((v) & 0xff)
 #define hi(v) (((v) >> 8) & 0xff)
-#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8)) 
+#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8))
 #define odd(v) (((v) % 2) == 1)
 
 // Debug channels
@@ -79,12 +79,12 @@ enum {
 
 // Static string list
 enum {
-	S_YES_NO = 0, S_GO_TO = 1, S_SOMEONE_ENTERS = 2, S_COOL = 3, S_LOURDE = 4, 
+	S_YES_NO = 0, S_GO_TO = 1, S_SOMEONE_ENTERS = 2, S_COOL = 3, S_LOURDE = 4,
 	S_MALSAINE = 5, S_IDEM = 6,	S_YOU = 7, S_ARE = 8, S_ALONE = 9,
 	S_HEAR_NOISE = 10, S_SHOULD_HAVE_NOTICED = 11, S_NUMBER_OF_HINTS = 12,
-	S_WANT_TO_WAKE_UP = 13, S_OK = 14, S_SAVE_LOAD = 15, S_RESTART = 18, S_F3 = 19, 
-	S_F8 = 20, S_HIDE_SELF = 21, S_TAKE = 22, S_PROBE = 23, S_RAISE = 24, S_SUITE = 25, 
-	S_STOP = 26, S_USE_DEP_MENU = 27, S_LIFT = 28, S_READ = 29, 
+	S_WANT_TO_WAKE_UP = 13, S_OK = 14, S_SAVE_LOAD = 15, S_RESTART = 18, S_F3 = 19,
+	S_F8 = 20, S_HIDE_SELF = 21, S_TAKE = 22, S_PROBE = 23, S_RAISE = 24, S_SUITE = 25,
+	S_STOP = 26, S_USE_DEP_MENU = 27, S_LIFT = 28, S_READ = 29,
 	S_LOOK = 30, S_SEARCH = 31, S_OPEN = 32, S_PUT = 33, S_TURN = 34, S_TIE = 35, S_CLOSE = 36,
 	S_HIT = 37, S_POSE = 38, S_SMASH = 39,
 
@@ -133,7 +133,7 @@ const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
 const int kMaxPatt = 20;
 
 const int OPCODE_NONE = 0;
-enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305, 
+enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305,
             OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
 			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
 			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
@@ -141,7 +141,7 @@ enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,
 			OPCODE_SLOOK = 0x405};
 
 static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP, 
+		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP,
 		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
 		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
 };
@@ -155,8 +155,8 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 enum places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
 	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
-	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14, 
-	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19, 
+	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14,
+	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19,
 	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     INSIDE_WELL = 23, WELL = 24,
 	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
 };
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index f914860..8516643 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -40,7 +40,7 @@ namespace Mortevielle {
 void MouseHandler::initMouse() {
 	_counter = 0;
 	_pos = Common::Point(0, 0);
-	
+
 	g_vm->setMouseClick(false);
 }
 
@@ -108,7 +108,7 @@ void MouseHandler::hideMouse() {
 		case MODE_HERCULES:
 			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 			for (int i = 0; i <= 5; ++i) {
-				for (int k = 0; k <= 3; ++k) 
+				for (int k = 0; k <= 3; ++k)
 					WRITE_LE_UINT16(&g_vm->_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index f53a7b2..eb79963 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -58,7 +58,7 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
 	int i, j;
 
 	// Safeguard: add $ just in case
-	inputStr += '$'; 
+	inputStr += '$';
 
 	g_vm->_screenSurface.putxy(x, y);
 	if (g_vm->_res == 1)
@@ -151,7 +151,7 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	}
 	f.close();
 
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i) 
+	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
 		g_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
 }
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 4c5e625..8ce97fb 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -110,7 +110,7 @@ void SavegameManager::loadSavegame(int n) {
 		g_vm->_tabdon[i + kAcha] = _tabdonSaveBuffer[i];
 
 	// Close the stream
-	delete stream;	
+	delete stream;
 }
 
 /**
@@ -120,7 +120,7 @@ Common::Error SavegameManager::loadGame(int n) {
 	g_vm->_mouse.hideMouse();
 	g_vm->displayEmptyHand();
 	loadSavegame(n);
-	
+
 	/* Initialization */
 	g_vm->charToHour();
 	g_vm->initGame();
@@ -138,13 +138,13 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 
 	g_vm->_mouse.hideMouse();
 	g_vm->hourToChar();
-	
+
 	for (i = 0; i <= 389; ++i)
 		_tabdonSaveBuffer[i] = g_vm->_tabdon[i + kAcha];
 	g_vm->_saveStruct = g_vm->_coreVar;
 	if (g_vm->_saveStruct._currPlace == ROOM26)
 		g_vm->_saveStruct._currPlace = LANDING;
-	
+
 	Common::String filename = generateSaveName(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
 
@@ -162,7 +162,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	// Close the save file
 	f->finalize();
 	delete f;
-	
+
 	// Skipped: dialog asking to swap floppy
 
 	g_vm->_mouse.showMouse();
@@ -252,18 +252,18 @@ SaveStateList SavegameManager::listSaves(const char *target) {
 				// ScummVm savegame. Read in the header to get the savegame name
 				SavegameHeader header;
 				validFlag = readSavegameHeader(in, header);
-				
+
 				if (validFlag) {
 					delete header.thumbnail;
 					saveDescription = header.saveName;
 				}
 			} else if (file->size() == 497) {
 				// Form an appropriate savegame name
-				saveDescription = (slotNumber == 0) ? "Initial game state" : 
+				saveDescription = (slotNumber == 0) ? "Initial game state" :
 					Common::String::format("Savegame #%d", slotNumber);
 				validFlag = true;
 			}
-				
+
 			if (validFlag)
 				// Got a valid savegame
 				saveList.push_back(SaveStateDescriptor(slotNumber, saveDescription));
@@ -278,7 +278,7 @@ SaveStateList SavegameManager::listSaves(const char *target) {
 SaveStateDescriptor SavegameManager::querySaveMetaInfos(int slot) {
 	Common::String fileName = Mortevielle::SavegameManager::generateSaveName(slot);
 	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
-	
+
 	if (f) {
 		// Check to see if it's a ScummVM savegame or not
 		char buffer[4];
@@ -311,7 +311,7 @@ SaveStateDescriptor SavegameManager::querySaveMetaInfos(int slot) {
 			return desc;
 		}
 	}
-	
+
 	return SaveStateDescriptor();
 }
 
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 5f634c5..9f0738c 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -178,7 +178,7 @@ void SoundManager::playNote(int frequency, int32 length) {
 void SoundManager::musyc(tablint &tb, int nbseg, int att) {
 #ifdef DEBUG
 	const byte *pSrc = &mem[0x5000 * 16];
-	
+
 	// Convert the countdown amount to a tempo rate, and then to note length in microseconds
 	int tempo = TIMER_FREQUENCY / att;
 	int length = 1000000 / tempo;
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index 5c70bc8..c469706 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -48,7 +48,7 @@ struct SpeakerNote {
 		length = noteLength;
 	}
 };
-	
+
 /**
  * This is a modified PC Speaker class that allows the queueing of an entire song
  * sequence one note at a time.
@@ -103,7 +103,7 @@ public:
 
 	void decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg);
 	void litph(tablint &t, int typ, int tempo);
-	void musyc(tablint &tb, int nbseg, int att);  
+	void musyc(tablint &tb, int nbseg, int att);
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index c374d20..08f773c 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -151,7 +151,7 @@ void SpeechManager::loadMusicSound() {
 
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
-	
+
 	f.read(&g_vm->_mem[0x7414 * 16 + 0], 273);
 
 	g_vm->_soundManager.decodeMusic(&g_vm->_mem[0x7414 * 16], &g_vm->_mem[kAdrNoise * 16], 273);
@@ -348,7 +348,7 @@ void SpeechManager::trait_car() {
 		}
 		break;
 	case 0:
-	case 1: 
+	case 1:
 		veracf(_queue[1]._acc);
 		switch (_queue[2]._code) {
 		case 2:
@@ -436,7 +436,7 @@ void SpeechManager::trait_car() {
 			entroct(d2);
 			entroct(_queue[1]._val);
 		}
-	
+
 		break;
 	case 4:
 		veracf(_queue[1]._acc);
@@ -483,7 +483,7 @@ void SpeechManager::trait_car() {
 			entroct(d2);
 			entroct(_tabdbc[((_queue[1]._val - 26) << 1) + 1]);
 		}
-	
+
 		break;
 	default:
 		break;


Commit: 5b4327a81c5082c62c54cbe2a4e6424fd8bd7a4a
    https://github.com/scummvm/scummvm/commit/5b4327a81c5082c62c54cbe2a4e6424fd8bd7a4a
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:57-07:00

Commit Message:
MORTEVIELLE: Fix invert in Dep menu. Still a bit short due to Inventory width too small. Also add some ingame same/load slots

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 4dcb034..4616d13 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -43,8 +43,8 @@ const byte _menuConstants[8][4] = {
 	{43, 25, 11,  5},
 	{55, 37,  5,  8},
 	{64, 13, 11,  2},
-	{62, 22, 13,  4},
-	{62, 25, 13,  5}
+	{62, 42, 13,  9},
+	{62, 46, 13, 10}
 };
 
 /**
@@ -56,7 +56,7 @@ void Menu::setText(int menuId, Common::String name) {
 	byte l = lo(menuId);
 	Common::String s = name;
 
-	while (s.size() < 30)
+	while (s.size() < 20)
 		s += ' ';
 
 	switch (h) {
@@ -313,8 +313,6 @@ void Menu::menuDown(int ii) {
 	int cx, xcc, xco;
 	int lignNumb;
 
-	/* debug('menuDown'); */
-
 	// Make a copy of the current screen surface for later restore
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index af4db82..ed9441c 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -636,11 +636,11 @@ void MortevielleEngine::handleAction() {
 			return;
 		}
 		if (_menu._menuSelected && (_msg[3] == MENU_SAVE)) {
-			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 7);
-			_savegameManager.saveGame(_msg[4] & 7, saveName);
+			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 15);
+			_savegameManager.saveGame(_msg[4] & 15, saveName);
 		}
 		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
-			_savegameManager.loadGame((_msg[4] & 7) - 1);
+			_savegameManager.loadGame((_msg[4] & 15) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = Alert::show(_hintPctMessage, 1);
 			return;


Commit: 8b065c2521eba398e5cb0e057820c2ba85a2fbb5
    https://github.com/scummvm/scummvm/commit/8b065c2521eba398e5cb0e057820c2ba85a2fbb5
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:23:59-07:00

Commit Message:
MORTEVIELLE: Enlarge Inventory menu display to match Depl menu.

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 4616d13..a9fea17 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -37,7 +37,7 @@
 namespace Mortevielle {
 
 const byte _menuConstants[8][4] = {
-	{ 7, 37, 22,  8},
+	{ 7, 37, 23,  8},
 	{19, 33, 23,  7},
 	{31, 89, 10, 21},
 	{43, 25, 11,  5},
@@ -56,7 +56,7 @@ void Menu::setText(int menuId, Common::String name) {
 	byte l = lo(menuId);
 	Common::String s = name;
 
-	while (s.size() < 20)
+	while (s.size() < 22)
 		s += ' ';
 
 	switch (h) {


Commit: a42a9282414c908ad4584794b5fb7d0e00fad5f2
    https://github.com/scummvm/scummvm/commit/a42a9282414c908ad4584794b5fb7d0e00fad5f2
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:00-07:00

Commit Message:
MORTEVIELLE: Remove var_mor

Changed paths:
  R engines/mortevielle/var_mor.cpp
  R engines/mortevielle/var_mor.h
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/sound.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 48d73a2..2f39b61 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -32,7 +32,6 @@
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/speech.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b53a9d5..1947705 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -290,9 +290,9 @@ bool KnowledgeCheck::show() {
 	int rep;
 	int firstOption, lastOption;
 
-	Hotspot coor[kMaxRect+1];
+	Hotspot coor[kMaxHotspots+1];
 
-	for (int i = 0; i < kMaxRect; ++i) {
+	for (int i = 0; i <= kMaxHotspots; ++i) {
 		coor[i]._rect = Common::Rect();
 		coor[i]._enabled = false;
 	}
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index db13c09..1ed8745 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -28,12 +28,18 @@
 #ifndef MORTEVIELLE_ALERT_H
 #define MORTEVIELLE_ALERT_H
 
+#include "common/rect.h"
 #include "common/str.h"
 
 namespace Mortevielle {
 
 static const int NUM_LINES = 7;
-const int kMaxRect = 14;
+const int kMaxHotspots = 14;
+
+struct Hotspot {
+	Common::Rect _rect;
+	bool _enabled;
+};
 
 class Alert {
 private:
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e290f60..a49bda7 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -26,7 +26,6 @@
 #include "mortevielle/graphics.h"
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a9fea17..1cfafb8 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -32,7 +32,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 8cad2b8..38e6e05 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -11,8 +11,7 @@ MODULE_OBJS := \
 	outtext.o \
 	saveload.o \
 	sound.o \
-	speech.o \
-	var_mor.o
+	speech.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_MORTEVIELLE), DYNAMIC_PLUGIN)
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index ed9441c..94821bf 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -35,7 +35,6 @@
 #include "mortevielle/outtext.h"
 #include "mortevielle/saveload.h"
 #include "mortevielle/outtext.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 8516643..b46b1d6 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -29,7 +29,6 @@
 #include "common/rect.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index b93ce61..0e235ad 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -28,7 +28,7 @@
 #ifndef MORTEVIELLE_MOUSE_H
 #define MORTEVIELLE_MOUSE_H
 
-#include "mortevielle/var_mor.h"
+#include "common/rect.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index eb79963..75d9bde 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -31,7 +31,6 @@
 #include "mortevielle/outtext.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 3664fd6..cc7bb1f 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -29,7 +29,6 @@
 #define MORTEVIELLE_OUTTEXT_H
 
 #include "common/str.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 8ce97fb..af00de2 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -31,7 +31,6 @@
 #include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/saveload.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index c469706..9ad46e8 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -32,10 +32,11 @@
 #include "audio/mixer.h"
 #include "common/mutex.h"
 #include "common/queue.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
+typedef int tablint[256];
+
 /**
  * Structure used to store pending notes to play
  */
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 08f773c..09b0af7 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -30,7 +30,6 @@
 #include "mortevielle/speech.h"
 #include "mortevielle/sound.h"
 #include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 6521fd9..f9af192 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -29,7 +29,7 @@
 #define MORTEVIELLE_PAROLE_H
 
 #include "common/scummsys.h"
-#include "mortevielle/var_mor.h"
+#include "mortevielle/sound.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
deleted file mode 100644
index a451cb6..0000000
--- a/engines/mortevielle/var_mor.cpp
+++ /dev/null
@@ -1,44 +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 original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "common/debug.h"
-#include "common/str.h"
-#include "common/textconsole.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/var_mor.h"
-
-namespace Mortevielle {
-
-/*---------------------------------------------------------------------------*/
-/*--------------------   PROCEDURES  AND  FONCTIONS   -----------------------*/
-/*---------------------------------------------------------------------------*/
-
-void musyc(tablint &tb, int nbseg, int att) {
-	warning("TODO: musyc");
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/var_mor.h b/engines/mortevielle/var_mor.h
deleted file mode 100644
index bddf85c..0000000
--- a/engines/mortevielle/var_mor.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_VAR_H
-#define MORTEVIELLE_VAR_H
-
-#include "common/rect.h"
-#include "common/str.h"
-
-namespace Mortevielle {
-
-struct Hotspot {
-	Common::Rect _rect;
-	bool _enabled;
-};
-
-typedef int tablint[256];
-typedef int tfxx[108];
-
-} // End of namespace Mortevielle
-
-#endif


Commit: 2c49c3e66a2be33cda79c9c8bf68965188dff4d5
    https://github.com/scummvm/scummvm/commit/2c49c3e66a2be33cda79c9c8bf68965188dff4d5
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:02-07:00

Commit Message:
MORTEVIELLE: Start adding German DOS version

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 94821bf..5be59d5 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -214,6 +214,8 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
 
+	free(_cfiecBuffer);
+	free(_speechManager._cfiphBuffer);
 	return Common::kNoError;
 }
 
@@ -714,7 +716,8 @@ void MortevielleEngine::loadPlaces() {
 	Common::File f;
 
 	if (!f.open("MXX.mor"))
-		error("Missing file - MXX.mor");
+		if (!f.open("MFXX.mor"))
+			error("Missing file - MXX.mor");
 
 	for (int i = 0; i < 7; ++i) {
 		for (int j = 0; j < 25; ++j)
@@ -2345,8 +2348,13 @@ void MortevielleEngine::loadPalette() {
 	Common::File f;
 	byte b;
 
-	if (!f.open("fxx.mor"))
-		error("Missing file - fxx.mor");
+	if (!f.open("fxx.mor")) {
+		if (f.open("mfxx.mor"))
+			f.seek(7 * 25);
+		else
+			error("Missing file - fxx.mor");
+	}
+
 	for (int i = 0; i < 108; ++i)
 		_fxxBuffer[i] = f.readSint16LE();
 	f.close();
@@ -2446,10 +2454,19 @@ void MortevielleEngine::loadBRUIT5() {
 void MortevielleEngine::loadCFIEC() {
 	Common::File f;
 
-	if (!f.open("cfiec.mor"))
-		error("Missing file - cfiec.mor");
+	if (!f.open("cfiec.mor")) {
+		if (!f.open("alcfiec.mor"))
+			error("Missing file - *cfiec.mor");
+	}
+
+	int size = ((f.size() / 128) + 1) * 128;
+
+	if (!_reloadCFIEC)
+		_cfiecBuffer = (byte *)malloc(sizeof(byte) * size);
+
+	for (int i = 0; i < size; ++i)
+		_cfiecBuffer[i] = f.readByte();
 
-	f.read(&_cfiecBuffer[0], 822 * 128);
 	f.close();
 
 	_reloadCFIEC = false;
@@ -2459,8 +2476,12 @@ void MortevielleEngine::loadCFIEC() {
 void MortevielleEngine::loadCFIPH() {
 	Common::File f;
 
-	if (!f.open("cfiph.mor"))
-		error("Missing file - cfiph.mor");
+	if (!f.open("cfiph.mor")) {
+		if (!f.open("alcfiph.mor"))
+			error("Missing file - *cfiph.mor");
+	}
+
+	_speechManager._cfiphBuffer = (int16 *)malloc(sizeof(int16) * (f.size() / 2));
 
 	for (int i = 0; i < (f.size() / 2); ++i)
 		_speechManager._cfiphBuffer[i] = f.readSint16LE();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 68ea227..e227326 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -272,7 +272,7 @@ private:
 
 
 	Common::String _hintPctMessage;
-	byte _cfiecBuffer[822 * 128];
+	byte *_cfiecBuffer;
 	byte _touv[8];
 	int  _nbrep[9];
 	int  _nbrepm[9];
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 75d9bde..e44dc98 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -296,7 +296,11 @@ void TextHandler::taffich() {
 
 		filename = "DXX.mor";
 	} else {
-		filename = "DZZ.mor";
+		if (g_vm->getLanguage() == Common::DE_DEU)
+			filename = "DZZALL";
+		else
+			filename = "DZZ.mor";
+
 		handle = g_vm->_fxxBuffer[87];
 		if (a == 51) {
 			lgt = handle;
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index f9af192..42be466 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -73,7 +73,7 @@ private:
 	int _ptr_oct;
 
 public:
-	int _cfiphBuffer[6401];
+	int16 *_cfiphBuffer;
 	int _tbi[256];
 	int _mlec;
 


Commit: 7ad0997082dc524fb11ef55a3bf329c1f950625d
    https://github.com/scummvm/scummvm/commit/7ad0997082dc524fb11ef55a3bf329c1f950625d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:04-07:00

Commit Message:
MORTEVIELLE: Start updating tools to add support to German DOS version

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/enginetext.h
    devtools/create_mortdat/gametext.h
    devtools/extract_mort/extract_mort.cpp
    dists/engine-data/mort.dat
    engines/mortevielle/mortevielle.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 4c1dd14..6fe115d 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -57,25 +57,32 @@ void openOutputFile(const char *outFilename) {
  * Write out the data for the font 
  */
 void writeFontBlock() {
+	const int knownAddr[2] = {0x36b0, 0x36c0};
 	byte checkBuffer[7];
 	byte fontBuffer[121 * 6];
 
 	// Move to just prior the font data and verify that we're reading the known mort.com
-	mortCom.seek(0x36b0);
-	mortCom.read(checkBuffer, 7);
-
-	if ((checkBuffer[0] != 0x59) || (checkBuffer[1] != 0x5B) || (checkBuffer[2] != 0x58) ||
-		(checkBuffer[3] != 0xC3) || (checkBuffer[4] != 0xE8) || (checkBuffer[5] != 0xD6) ||
-		(checkBuffer[6] != 0x02)) {
-		printf("Invalid mort.com input file");
-		exit(0);
+	for (int i = 0; i <= 2; ++i) {
+		if ( i == 2) {
+			printf("Invalid mort.com input file");
+			exit(0);
+		}
+
+		mortCom.seek(knownAddr[i]);
+		mortCom.read(checkBuffer, 7);
+
+		if ((checkBuffer[0] == 0x59) && (checkBuffer[1] == 0x5B) && (checkBuffer[2] == 0x58) ||
+			(checkBuffer[3] == 0xC3) && (checkBuffer[4] == 0xE8) && (checkBuffer[5] == 0xD6) ||
+			(checkBuffer[6] == 0x02)) {
+			break;
+		}
 	}
 
 	// Read in the data
 	mortCom.read(fontBuffer, 121 * 6);
 
 	// Write out a section header to the output file and the font data
-	char fontHeader[4] = { 'F', 'O', 'N', 'T' };
+	const char fontHeader[4] = { 'F', 'O', 'N', 'T' };
 	outputFile.write(fontHeader, 4);	// Section Id
 	outputFile.writeWord(121 * 6);		// Section size
 
@@ -84,8 +91,8 @@ void writeFontBlock() {
 
 void writeStaticStrings(const char **strings, DataType dataType, int languageId) {
 	// Write out a section header 
-	char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
-	char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
+	const char sStaticStrings[4] = { 'S', 'S', 'T', 'R' };
+	const char sGameStrings[4] = { 'G', 'S', 'T', 'R' };
 
 	if (dataType == kStaticStrings)
 		outputFile.write(sStaticStrings, 4);
@@ -119,6 +126,7 @@ void writeStaticStrings(const char **strings, DataType dataType, int languageId)
 void writeEngineStrings() {
 	writeStaticStrings(engineDataEn, kStaticStrings, 1);
 	writeStaticStrings(engineDataFr, kStaticStrings, 0);
+	writeStaticStrings(engineDataDe, kStaticStrings, 2);
 }
 
 /**
@@ -127,6 +135,7 @@ void writeEngineStrings() {
 void writeGameStrings() {
 	writeStaticStrings(gameDataEn, kGameStrings, 1);
 	writeStaticStrings(gameDataFr, kGameStrings, 0);
+	writeStaticStrings(gameDataDe, kGameStrings, 2);
 }
 
 void process() {
diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index d9b3b05..68db310 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -133,4 +133,57 @@ const char *engineDataFr[] = {
 	NULL
 };
 
+const char *engineDataDe[] =  {
+	"[2][ ][JA][NEIN]",
+	"Go to",
+	"Someone enters, looks surised, but says nothing",
+	"Cool",
+	"Schwer",
+	"Ungesund",
+	"Idem",
+	"You",
+	"are",
+	"Alone",
+
+	"Verdammt! Sie hoeren ein Geraeush...",
+	"Sie haetten ",
+	"% der Hinweise|      bemerken muessen...",
+	"Do you want to wake up?",
+	"OK",
+	"", 
+	" schreiben",
+
+	" lesen",
+	" Restart     ",
+	"F3 nochmals",
+	"F8: stop",
+	"Hide self",
+	"take",
+	" probe    ",
+	" raise    ",
+	" -WEITER- ",
+	" -STOP-  ",
+	"[1][ Benutzen Sie jetzt das Menue DEP...][OK]",
+	"lift",
+	"read",
+
+	"look",
+	"search",
+	"open",
+	"put",
+	"turn",
+	"tie",
+	"close",
+	"hit",
+	"pose",
+	"smash",
+
+	"smell",
+	"scratch",
+	"probe",
+	"[1][ Benutzen Sie jetzt das Menue DEP...][OK]",
+	"& tag",
+	NULL
+};
+
 #endif
diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index b9ef039..0e0948e 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -609,7 +609,7 @@ const char *gameDataEn[] =  {
 	"[1][ | Disk error | All stop... ][ok]$",
 	"[1][ | You should have noticed |00% of the clues ][ok]$",
 	"[3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][|Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
 	"TBT -  MASTER .$",
 	"TBT -   rorL$",
 	NULL
@@ -1193,14 +1193,602 @@ const char *gameDataFr[] = {
 	"L‚o$",
 	"Max$",
 	"Murielle partageait une occupation avec une autre personne . Qui ?$",
-	"[1][|Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
-	"[1][|Ins‚rez la disquette 1 dans le lecteur A][ok]$",
-	"[1][|! ERREUR DISQUETTE !|On arrete tout][ok]$",
-	"[1][|Vous devriez avoir remarqu‚|00% des indices][ok]$",
-	"[1][|Ins‚rez la disquette 2 dans le lecteur A][ok]$",
-	"[1][|Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
+	"[1][ |Ins‚rez la disquette 1 dans le lecteur A][ok]$",
+	"[1][ |! ERREUR DISQUETTE !|On arrete tout][ok]$",
+	"[1][ |Vous devriez avoir remarqu‚|00% des indices][ok]$",
+	"[1][ |Ins‚rez la disquette 2 dans le lecteur A][ok]$",
+	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
 	" MASTER .$",
 	"  rorL$",
 };
 
+const char *gameDataDe[] =  {
+	"TBT - Calm within the storm$",
+	"TBT - Discussed in colours$",
+	"TBT - Your mauve!$",
+	"TBT - Be kind enough to leave the room...$",
+	"TBT - If you're NOT overdrawn...$",
+	"TBT - If you're feeling blue...$",
+	"TBT - Read what's on the walls?$",
+	"TBT - Water sports$",
+	"TBT - Room for envy?$",
+	"TBT - A glance at the forbidden$",
+	"TBT - Smell of a woodfire and tobacco$",
+	"TBT - Tobacco and old books$",
+	"TBT - Onions, cinnamon and spirits$",
+	"TBT - A place seldom visited$",
+	"TBT - Humidity and decay$",
+	"TBT - Sorry, no ""door to door""$",
+	"TBT - Rotting corpse: deady cryptomania$",
+	"TBT - And what's more, there are disused traps$",
+	"TBT - It's already open$",
+	"TBT - Danger: avalanches$",
+	"TBT - Proper Charlie's place?$",
+	"TBT - An imposing building$",
+	"TBT - The other side of the mystery$",
+	"TBT - Strange horoscope$",
+	"TBT - Look out... but she wishes well?$",
+	"TBT - An oak door$",
+	"TBT - A photograph$",
+	"TBT - The coat of arms$",
+	"TBT - $",
+	"TBT - Max, the servant, welcomes you and shows you to your room$",
+	"TBT - Mortville     6/2/51@         My dear Jerome at Regarding my telegram, I must tell  you  the reason for my wor- at ries. A year ago, Murielle, my lady companion, disappeared. The de at part may have had something to do at with the financial success of themanor, or... A silence hard to un at derstand for my son Guy.  Not  ha at ving been able to see the  light of day over this affair, I count @on you to sort things out. If my state of health doesn't improve, @take the decisions that you feel @are apropriate.@             Kind regards, Julia DEFRANCK$",
+	"TBT - Later, Guy will inform you of Leo's suicide after a at heavy bet at the races$",
+	"TBT - F3: AGAIN             F8: STOP$",
+	"TBT - The master of the premises$",
+	"TBT - The future heir$",
+	"TBT - JULIA's son$",
+	"TBT - A pretty picture$",
+	"TBT - Superman!$",
+	"TBT - Ida's husband$",
+	"TBT - Interesting remarks?$",
+	"TBT - Service included!$",
+	"TBT - Nothing underneath$",
+	"TBT - You could hear a pin drop$",
+	"TBT - Half an hour passes: nothing! Wait any longer?$",
+	"TBT - Admire! Contemplate!$",
+	"TBT - No! Nothing!$",
+	"TBT - Impossible$",
+	"TBT - That stains!$",
+	"TBT - A treatise on the history of the area$",
+	"TBT - A few coins...$",
+	"TBT - First commandment...$",
+	"TBT - Pleasing to the nostrils!$",
+	"TBT - Spades, Hearts...$",
+	"TBT - Just a spoonful of sugar...$",
+	"TBT - A romantic novel$",
+	"TBT - Worth more than a penny, (whistle)$",
+	"TBT - Just needs a little patience$",
+	"TBT - Watch the sharp bends$",
+	"TBT - Deep and dark$",
+	"TBT - Normal sensations$",
+	"TBT - Sniff!$",
+	"TBT - Not discreet! Be content to watch!$",
+	"TBT - Bless you! Dusty!$",
+	"TBT - The canvas is signed, the wallpaper is not!$",
+	"TBT - Nothing, Unlucky!$",
+	"TBT - Be more discreet!$",
+	"TBT - The shutters are closed$",
+	"TBT - Snow! And more snow!$",
+	"TBT - Brilliant! The work of a master!$",
+	"TBT - No doubt at all! A genuine fake!$",
+	"TBT - Hmm! A cheap reproduction!$",
+	"TBT - A rare and valuable piece$",
+	"TBT - Nothing special$",
+	"TBT - Linen, personal belongings...$",
+	"TBT - Not just anywhere!$",
+	"TBT - It's not time!$",
+	"TBT - One doesn't speak with ones mouth full!$",
+	"TBT - Someone comes in, messes about then goes out again$",
+	"TBT - Someone's approaching your hiding-place$",
+	"TBT - Someone surprises you!$",
+	"TBT - Impossible! You're too loaded!$",
+	"TBT - Try again!$",
+	"TBT - Still puzzled!?$",
+	"TBT - You leave Mortville.In Paris a message awaits you...$",
+	"TBT - You hurt yourself$",
+	"TBT - Nothing more here$",
+	"TBT - The sound seems normal$",
+	"TBT - It doesn't move$",
+	"TBT - You are answered$",
+	"TBT - Not the right moment!$",
+	"TBT - The same matter, from another angle!$",
+	"TBT - The reflection is tarnished, but the frame is gold!$",
+	"TBT - Bric-a-brac$",
+	"TBT - Face to face with failure!$",
+	"TBT - Smells like something you'd rather not see!$",
+	"TBT - Cleaning products$",
+	"TBT - Got an itch?$",
+	"TBT - It's stuck, frozen. Brrr!$",
+	"TBT - All the locks are jammed!$",
+	"TBT - Papers$",
+	"TBT - No! Father christmas hasn't got himself stuck!$",
+	"TBT - It leads onto a corridor$",
+	"TBT - China, silverware...$",
+	"TBT - No! It's not Julia's remains!$",
+	"TBT - An old engraving$",
+	"TBT - You find a deep diamond-shaped opening$",
+	"TBT - The wall slides open! A passage! Do you follow it?$",
+	"TBT - The passageway closes$",
+	"TBT - A secret drawer: a notebook! Do you read it?$",
+	"TBT - The drawer shuts$",
+	"TBT - Nothing! Flesh and blood stuck to the stone$",
+	"TBT - Certain details lead you to believe death was not immediate!$",
+	"TBT - A rotten affair!$",
+	"TBT - Did she cling to dear life with just one finger?$",
+	"TBT - Has the treasure packed its trunk?$",
+	"TBT - A slot the size of a coin$",
+	"TBT - Part of the stone wall pivots.A crypt! Do you enter?$",
+	"TBT - The ring turns, the wall closes$",
+	"TBT - A stone column behind the altar$",
+	"TBT - There is a noise!$",
+	"TBT - Occupied!$",
+	"TBT - Take another chance?$",
+	"TBT - Too deep!$",
+	"TBT - The cellar wall pivots$",
+	"TBT - Nothing$",
+	"TBT - The one and only!$",
+	"TBT - The object slides to the bottom$",
+	"TBT - You have nothing in hand$",
+	"TBT - It is not open$",
+	"TBT - There is already something$",
+	"TBT - The door is locked$",
+	"TBT - No reply$",
+	"TBT - A solid wooden ball$",
+	"TBT - There's no more space$",
+	"TBT - A wooden ball pierced through the side$",
+	"TBT - ? ?$",
+	"TBT - Your move$",
+	"TBT - OK !$",
+	"TBT - Suddenly  Max  arrives with your suitcase:  \"Thank  you  for your @visit!\".Mister discreet \"private eye\" (in need of a private optici at an!). Thoroughly demoralised, you at leave the manor. You are useless!$",
+	"TBT - Leo interrupts:  \"The storm has  died down,I am going into town in at 1 hour. Get ready\". You have lost at time...but not your life$",
+	"TBT - Congestion, the deadly flu... You at are stuck here! Your  whole  case at sinks slowly beneath the water$",
+	"TBT - The water is rising fast,freezing your last illusions. Before you at have time to react...you are dead$",
+	"TBT - As soon as you reach the bottom  of the well, a hand cuts the rope at Farewell sweet life!$",
+	"TBT - The storm covers your footprints.A wall of  silence falls heavily at on your shoulders. Slowly you  succumb to frosbite...$",
+	"TBT - You're not completely alone!  A  cold blade plunges into your backup at In future, be more care!$",
+	"TBT - You don't know what implication  Leo may have had  in  Murielle's at death. Was she dead outright? In at any case,the family problems thatyou have uncovered in the course at of your enquiries would explain  Leo's behaviour. You're not sure at that's the reason Julia had asked at for your help, but that's reason enough for you!Out of respect for at her, after taking certain precau- at tions you have a revealing  talk with Leo.$",
+	"TBT - $",
+	"TBT - You don't have the keys to  the  manor. Your  cries  rest  unheard at You're   going   to   catch...             your death!$",
+	"TBT - With  a  circular  movement, the sword slices across you. Guts and at intestines spill out all over. A sorry state of affairs!$",
+	"TBT - Home, Sweet home !$",
+	"TBT - The mystery behind a closed door$",
+	"TBT - Bewitching charm of these old rooms$",
+	"TBT - An empty stomach$",
+	"TBT - Closer to heaven? Not so sure$",
+	"TBT - Afraid of the dark?$",
+	"TBT - Old rugs and a glint of gold$",
+	"TBT - Anguish!$",
+	"TBT - Safe? Perhaps not!$",
+	"TBT - A little ill at ease, eh!?$",
+	"TBT - Always further$",
+	"TBT - Your way of the cross!$",
+	"TBT - On the trail of...$",
+	"TBT - Watch what's hiding$",
+	"TBT - The road down to hell$",
+	"TBT - Feeling well? You look a little pale$",
+	"TBT - What lurks behind...?$",
+	"TBT - Close-up on:$",
+	"TBT - You notice, amongst other things$",
+	"TBT - And...$",
+	"TBT - That's all!$",
+	"TBT - A bit of reading$",
+	"TBT - The adventure awaits, you set off!$",
+	"TBT - Don't mess up YOUR next ADVENTURE!$",
+	"TBT - I don't understand$",
+	"TBT - There is an easier way$",
+	"TBT - No, not just now$",
+	"TBT - Too late$",
+	"TBT - $",
+	"TBT - Like a deep stony stare, a solitary  eye  that points towards the at stars; the artery that links hea-ven and hell.  You  must  fathom at these depths keeping hold of that at which is, and will become. Monday, Tuesday, Wednesday, Sunday, from at Monday 1st to Sunday 1st,plunging from one  day  to  the next your@\"IS\" or \"WILL BECOME\".  Carrying your burden with love and light, at the smallest oversight will seal your fate.$",
+	"TBT - 10/1/51: We think  we've  solved the mystery of the manuscript and at located the crypt. Is it the idea at of success in what seems like  a dream that disturbs me so? I feel at I have committed myself  rather  too much, as far as Leo is concer at ned... No! I should go on.       @I should have put Guy in the pic-ture but for a week now, I've had at no news of him$",
+	"TBT - Take your prayers as you would to the holy place.  From  the  pillar at of wisdom, bring the sun to  his at knees. Thus will it show you the place to  offer  alms of another at kind and like young Arthur, open the way of darkness.White is your at colour, golden your hearth.  So at advance with caution Orpheus and light  your  way  unto  the  sad at virgin. Offer her the circle  of the man with three faces. That he at may regain the  world  and  turn with it to its original at inglory!$",
+	"TBT - The mountains are the fangs in a monstrous mouth opening on the at finity of a celestial orgy, grin-ding the stars as we  grind  our at teeth into dust.  You  will drop your chord of stone at your feet. at The  laugh  of  silence  at  the at highest pitch, and in your right hand, the measure of genius. Thus at will you pass between  the  two  crescents beyond the abyss of the at wall of silence. The key to the  melody is within your grasp.  It at suffices to find the note  that  clashes.$",
+	"TBT -   9/12 INTER. 518  3/13 EXPENS.  23@  9/12 SALES 1203  7/12 CHEQUE 1598@      TOTAL 1721       TOTAL  1721$",
+	"TBT -    5/1/51@@              Luc, my love@ Guy knows about us. After an argument I told  him  everything! I at think only of you. Max keeps pes-tering me, but it's finished with @him. He should stick to his pots and pans! When can you and I be  alone together? For you I  would at get a divorce. at I love you.@                             Eva$",
+	"TBT -              Mortville, 10/2/51@@              Pat@ I recall you owe me  50000 frs that I lent you for your business at I need that money, can you repay me quickly?@              Guy$",
+	"TBT -              Mortville, 15/2/51@           Dear Sir@ I am writing to you on the sub-ject of our business deal. I have at decided to go all the way in the certainty that  my  partner, Pat at DEFRANCK, has been forging the accounts. @In spite of$",
+	"TBT -  A pipe$",
+	"TBT -  A pen$",
+	"TBT -  A lighter$",
+	"TBT -  A retort$",
+	"TBT -  A shaving brush$",
+	"TBT -  A tin of paint$",
+	"TBT -  A flute$",
+	"TBT -  An expensive ring$",
+	"TBT -  A reel of thread$",
+	"TBT -  An old book$",
+	"TBT -  A wallet$",
+	"TBT -  A dagger$",
+	"TBT -  A pistol$",
+	"TBT -  A bible$",
+	"TBT -  A candle$",
+	"TBT -  A jewellery box$",
+	"TBT -  An iron$",
+	"TBT -  A photo$",
+	"TBT -  A pocket watch$",
+	"TBT -  A rope$",
+	"TBT -  Keys$",
+	"TBT -  A pearl necklace$",
+	"TBT -  A bottle of perfume$",
+	"TBT -  Binoculars$",
+	"TBT -  Glasses$",
+	"TBT -  A leather purse$",
+	"TBT -  A tennis ball$",
+	"TBT -  Ammunition$",
+	"TBT -  A cut-throat razor$",
+	"TBT -  A hairbrush$",
+	"TBT -  A clothes brush$",
+	"TBT -  A pack of cards$",
+	"TBT -  A shoe horn$",
+	"TBT -  A screwdriver$",
+	"TBT -  A hammer$",
+	"TBT -  Keys$",
+	"TBT -  Keys$",
+	"TBT -  An ashtray$",
+	"TBT -  A paintbrush$",
+	"TBT -  A rope$",
+	"TBT -  A wooden object$",
+	"TBT -  Sleeping pills$",
+	"TBT -  A gold ring$",
+	"TBT -  A jewellery box$",
+	"TBT -  An alarm clock$",
+	"TBT -  A coat of armour$",
+	"TBT -  A candlestick$",
+	"TBT -  A pair of gloves$",
+	"TBT -  A engraved goblet$",
+	"TBT -  A parchment$",
+	"TBT -  A dagger$",
+	"TBT -  A dossier$",
+	"TBT -  A parchment$",
+	"TBT -  A parchment$",
+	"TBT -  A dossier$",
+	"TBT -  A dossier$",
+	"TBT -  A letter$",
+	"TBT -  A novel$",
+	"TBT -  A wooden rod$",
+	"TBT -  An envelope$",
+	"TBT -  A letter$",
+	"TBT -  An envelope$",
+	"TBT - Julia$",
+	"TBT - Julia's death$",
+	"TBT - Julia's relationships$",
+	"TBT - A message from Julia$",
+	"TBT - Julia's inheritance$",
+	"TBT - Julia's final actions$",
+	"TBT - Julia's gifts$",
+	"TBT - Julia's bedroom$",
+	"TBT - The photo at Julia's home$",
+	"TBT - Julia and yourself...$",
+	"TBT - L‚o's occupations$",
+	"TBT - Pat's occupations$",
+	"TBT - Guy's occupations$",
+	"TBT - Bob's occupations$",
+	"TBT - Eva's occupations$",
+	"TBT - Luc's occupations$",
+	"TBT - Ida's occupations$",
+	"TBT - Max's occupations$",
+	"TBT - Your occupations$",
+	"TBT - L‚o's relationships$",
+	"TBT - Pat's relationships$",
+	"TBT - Guy's relationships$",
+	"TBT - Bob's relationships$",
+	"TBT - Eva's relationships$",
+	"TBT - Luc's relationships$",
+	"TBT - Ida's relationships$",
+	"TBT - Max's relationships$",
+	"TBT - Your relationships$",
+	"TBT - Murielle$",
+	"TBT - Murielle's relationships$",
+	"TBT - Murielle and yourself...$",
+	"TBT - Murielle's disappearance$",
+	"TBT - The wall of silence$",
+	"TBT - The manuscripts$",
+	"TBT - The coat of arms$",
+	"TBT - Engravings in the cellar$",
+	"TBT - The well$",
+	"TBT - The secret passages$",
+	"TBT - The chapel$",
+	"TBT - The paintings$",
+	"TBT - The photo of the attic$",
+	"TBT - The body in the crypt$",
+	"TBT - $",
+	"TBT - $",
+	"TBT - END OF THE CONVERSATION$",
+	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
+	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"TBT - Je n'en sais rien !$",
+	"TBT - Elle est morte d'une embolie pulmonaire$",
+	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
+	"TBT - Elle est morte d'une embolie pulmonaire$",
+	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
+	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
+	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
+	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
+	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
+	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
+	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"TBT - Ce sont ses affaires ...$",
+	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
+	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
+	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
+	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
+	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
+	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
+	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
+	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
+	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"TBT - Les bijoux ...$",
+	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
+	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
+	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
+	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
+	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
+	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
+	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
+	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
+	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
+	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
+	"TBT - Moi je n'ai rien … lui reprocher$",
+	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
+	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
+	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
+	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
+	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
+	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
+	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
+	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
+	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"TBT - C'est pour un rendez-vous ?$",
+	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
+	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
+	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
+	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
+	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
+	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
+	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
+	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
+	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
+	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
+	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
+	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"TBT - Elle aussi, faisait des recherches ...$",
+	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
+	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"TBT - Je crois que tout le monde l'aimait bien$",
+	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
+	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
+	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"TBT - A part sa famille, pas grand monde$",
+	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"TBT - Non rien !$",
+	"TBT - Non ... Pas que le sache$",
+	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
+	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
+	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
+	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
+	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
+	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
+	"TBT - Son dernier pr‚sent m'a surpris$",
+	"TBT - Quel cadeau ?$",
+	"TBT - Un chandellier ...$",
+	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"TBT - Et bien oui ! Comme tout le monde, je crois$",
+	"TBT - Un poignard$",
+	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"TBT - Vous avez un don de double-vue ou un passe-partout$",
+	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
+	"TBT - Vous savez, je la connaissais assez peu$",
+	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
+	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
+	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
+	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
+	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
+	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"TBT - Vous savez ce que c'est : Des relations familiales$",
+	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
+	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
+	"TBT - Je ne me rappelle pas$",
+	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
+	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
+	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"TBT - Dommage que la devise soit manquante ...$",
+	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
+	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
+	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
+	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
+	"TBT - Ca reste pour moi le plus grand des mystŠres$",
+	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
+	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
+	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
+	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
+	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
+	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
+	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"TBT - Julia aimait beaucoup la peinture$",
+	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
+	"TBT - Que faites-vous l… ?$",
+	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
+	"TBT - Je vous ‚coute$",
+	"TBT - Que d‚sirez-vous ?$",
+	"TBT - Oui ?$",
+	"TBT - Je suis … vous ...$",
+	"TBT - C'est pourquoi ?$",
+	"TBT - Allez-y$",
+	"TBT - C'est … quel sujet ?$",
+	"TBT - Max : … votre service, monsieur$",
+	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
+	"TBT - Vous ˆtes trop curieux !$",
+	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
+	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
+	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
+	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"TBT -  to the bureau$",
+	"TBT -  to the kitchen$",
+	"TBT -  to the cellar$",
+	"TBT -  to the landing$",
+	"TBT -  outside$",
+	"TBT -  to the dining room$",
+	"TBT -  inside the manor$",
+	"TBT -  front of the manor$",
+	"TBT -  to the chapel$",
+	"TBT -  to the weel$",
+	"TBT -  north$",
+	"TBT -  behind the manor$",
+	"TBT -  south$",
+	"TBT -  east$",
+	"TBT -  west$",
+	"TBT -  towards the manor$",
+	"TBT -  further$",
+	"TBT -  in the water$",
+	"TBT -  out of the weel$",
+	"TBT -  in the weel$",
+	"TBT -  choice on screen$",
+	"TBT - In the MYSTERY series...$",
+	"TBT - MORTVILLE MANOR$",
+	"TBT - $",
+	"TBT - From an original idea of...$",
+	"TBT - Bernard GRELAUD and Bruno GOURIER$",
+	"TBT - $",
+	"TBT - Directed by: KYILKHOR CREATION and LANGLOIS$",
+	"TBT - $",
+	"TBT - With the cooperation of...$",
+	"TBT - B‚atrice et Jean_Luc LANGLOIS$",
+	"TBT - for the music and the voices,$",
+	"TBT - Bernard GRELAUD for the graphic conception,$",
+	"TBT - MARIA-DOLORES for the graphic direction,$",
+	"TBT - Bruno GOURIER for the technical direction,$",
+	"TBT - Mick ANDON for the translation. $",
+	"TBT - $",
+	"TBT - Publisher: KYILKHOR and B&JL LANGLOIS $",
+	"TBT - COPYRIGHT 1987: KYILKHOR and B&JL LANGLOIS$",
+	"TBT - $",
+	"TBT - YOUR MOVE$",
+	"TBT -  attach$",
+	"TBT -  wait$",
+	"TBT -  force$",
+	"TBT -  sleep$",
+	"TBT -  listen$",
+	"TBT -  enter$",
+	"TBT -  close$",
+	"TBT -  search$",
+	"TBT -  knock$",
+	"TBT -  scratch$",
+	"TBT -  read$",
+	"TBT -  eat$",
+	"TBT -  place$",
+	"TBT -  open$",
+	"TBT -  take$",
+	"TBT -  look$",
+	"TBT -  smell$",
+	"TBT -  sound$",
+	"TBT -  leave$",
+	"TBT -  lift$",
+	"TBT -  turn$",
+	"TBT -  hide yourself$",
+	"TBT -  search$",
+	"TBT -  read$",
+	"TBT -  put$",
+	"TBT -  look$",
+	"TBT -  Leo$",
+	"TBT -  Pat$",
+	"TBT -  Guy$",
+	"TBT -  Eva$",
+	"TBT -  Bob$",
+	"TBT -  Luc$",
+	"TBT -  Ida$",
+	"TBT -  Max$",
+	"TBT - JULIA...$",
+	"TBT - - Did she commit suicide?$",
+	"TBT - - Was she murdered?$",
+	"TBT - - Did she die by accident?$",
+	"TBT - - Did she die of natural causes?$",
+	"TBT - Where did the money come from at for the restoration of the manor?$",
+	"TBT - - Blackmail$",
+	"TBT - - Honest work$",
+	"TBT - - Inheritance$",
+	"TBT - - Races$",
+	"TBT - - Rents$",
+	"TBT - - Hold-up$",
+	"TBT - - Other$",
+	"TBT - What is Leo's hobby?$",
+	"TBT - - Historical research$",
+	"TBT - - Politics$",
+	"TBT - - Painting$",
+	"TBT - - Drugs$",
+	"TBT - - Occult sciences$",
+	"TBT - - Management of a sect$",
+	"TBT - Julia left several clues that are at represented in one place. Which?$",
+	"TBT - - Chapel$",
+	"TBT - - Outside$",
+	"TBT - - Cellar$",
+	"TBT - - Attic$",
+	"TBT - - Kitchen$",
+	"TBT - - Dining room$",
+	"TBT - - Julia's room$",
+	"TBT - - Leo's room$",
+	"TBT - - Pat's room$",
+	"TBT - - Bob's room$",
+	"TBT - - Max's room$",
+	"TBT - - Luc/Ida's room$",
+	"TBT - - Guy/Eva's room$",
+	"TBT - The main clue that leads you at to the underground door is:$",
+	"TBT - - A dagger$",
+	"TBT - - A ring$",
+	"TBT - - A book$",
+	"TBT - - A parchment$",
+	"TBT - - A letter$",
+	"TBT - - A pendulum$",
+	"TBT - How many parchments were there in the manor?$",
+	"TBT - - 0$",
+	"TBT - - 1$",
+	"TBT - - 2$",
+	"TBT - - 3$",
+	"TBT - - 4$",
+	"TBT - - 5$",
+	"TBT - How many persons are involved in at this story?@(Julia included, but not yourself)$",
+	"TBT - - 9$",
+	"TBT - - 10$",
+	"TBT - - 11$",
+	"TBT - What was the first name at of the unknown character?$",
+	"TBT - - Mireille$",
+	"TBT - - Fran‡oise$",
+	"TBT - - Maguy$",
+	"TBT - - Emilie$",
+	"TBT - - Murielle$",
+	"TBT - - Sophie$",
+	"TBT - Wo did Murielle have an affair with?$",
+	"TBT - - Bob$",
+	"TBT - - Luc$",
+	"TBT - - Guy$",
+	"TBT - - Leo$",
+	"TBT - - Max$",
+	"TBT - Murielle shared an occupation at with one other person. Who?$",
+	"TBT - [1][You realize that certain elements of|this investigation remain a mystery for you.|Therefore, you decide first to learn|more before undertaking new risks..][ok]$",
+	"TBT - [3][ | insert disk 1 | in drive A ][ok]$",
+	"TBT - [1][ | Disk error | All stop... ][ok]$",
+	"TBT - [1][ | You should have noticed |00% of the clues ][ok]$",
+	"TBT - [3][ | insert disk 2 | in drive A ][ok]$",
+	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"TBT -  MASTER .$",
+	"TBT -   rorL$",
+	NULL
+};
 #endif
diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index 192ea50..477ca44 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -272,11 +272,22 @@ static void export_strings(const char *textFilename) {
 	uint16 *strData;
 
 	// Open input and output files
-	txxInp.open("TXX.INP", kFileReadMode);
-	txxNtp.open("TXX.NTP", kFileReadMode);
+	if (!txxInp.open("TXX.INP", kFileReadMode)) {
+		if (!txxInp.open("TXX.MOR", kFileReadMode)) {
+			printf("Missing TXX.INP/MOR");
+			exit(-1);
+		}
+	}
+	if (!txxNtp.open("TXX.NTP", kFileReadMode)) {
+		if (!txxNtp.open("TXX.IND", kFileReadMode)) {
+			printf("Missing TXX.NTP/IND");
+			exit(-1);
+		}
+	}
 	textFile.open(textFilename, kFileWriteMode);
 
 	// Read all the compressed string data into a buffer
+	printf("%d %d", txxInp.size(), txxNtp.size());
 	strData = (uint16 *)malloc(txxInp.size());
 	txxInp.read(strData, txxInp.size());
 
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index 2f31c0a..4415f57 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 5be59d5..b8be838 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -279,7 +279,22 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
  */
 void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataType dataType) {
 	// Figure out what language Id is needed
-	byte desiredLanguageId = (getLanguage() == Common::EN_ANY) ? LANG_ENGLISH : LANG_FRENCH;
+	byte desiredLanguageId;
+	switch(getLanguage()) {
+	case Common::EN_ANY:
+		desiredLanguageId = LANG_ENGLISH;
+		break;
+	case Common::FR_FRA:
+		desiredLanguageId = LANG_FRENCH;
+		break;
+	case Common::DE_DEU:
+		desiredLanguageId = LANG_GERMAN;
+		break;
+	default:
+		warning("Language not supported, switching to English");
+		desiredLanguageId = LANG_ENGLISH;
+		break;
+	}
 
 	// Read in the language
 	byte languageId = f.readByte();


Commit: 18ebc66cfde44b604d75cd8e934bfbf79c89926a
    https://github.com/scummvm/scummvm/commit/18ebc66cfde44b604d75cd8e934bfbf79c89926a
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:05-07:00

Commit Message:
MORTEVIELLE: Get rid of the hardcoded size of _cfiecBuffer

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



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index b8be838..38355ec 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -197,7 +197,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	loadPalette();
 	loadCFIPH();
 	loadCFIEC();
-	decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+	decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
 	_c_zzz = 1;
 	init_nbrepm();
 	initMouse();
@@ -2474,12 +2474,12 @@ void MortevielleEngine::loadCFIEC() {
 			error("Missing file - *cfiec.mor");
 	}
 
-	int size = ((f.size() / 128) + 1) * 128;
+	_cfiecBufferSize = ((f.size() / 128) + 1) * 128;
 
 	if (!_reloadCFIEC)
-		_cfiecBuffer = (byte *)malloc(sizeof(byte) * size);
+		_cfiecBuffer = (byte *)malloc(sizeof(byte) * _cfiecBufferSize);
 
-	for (int i = 0; i < size; ++i)
+	for (int i = 0; i < _cfiecBufferSize; ++i)
 		_cfiecBuffer[i] = f.readByte();
 
 	f.close();
@@ -3749,7 +3749,7 @@ int MortevielleEngine::testou() {
 		break;
 	case '\26' :
 		if ((_c_zzz == 1) || (_c_zzz == 2)) {
-			decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+			decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
 			++_c_zzz;
 
 			return 61;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e227326..97bc814 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -273,6 +273,7 @@ private:
 
 	Common::String _hintPctMessage;
 	byte *_cfiecBuffer;
+	int _cfiecBufferSize;
 	byte _touv[8];
 	int  _nbrep[9];
 	int  _nbrepm[9];


Commit: 37391a747754595996d9ee7d9b05862c881b6f3f
    https://github.com/scummvm/scummvm/commit/37391a747754595996d9ee7d9b05862c881b6f3f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:07-07:00

Commit Message:
MORTEVIELLE: Modify copyright string to include 1987.

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/detection.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/saveload.h
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 2f39b61..4e6dfb0 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/scummsys.h"
diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 994563d..9fe0927 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -51,7 +51,7 @@ public:
 	}
 
 	virtual const char *getOriginalCopyright() const {
-		return "Mortville Manor (C) 1988-89 Lankhor";
+		return "Mortville Manor (C) 1987-89 Lankhor";
 	}
 
 	virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 1947705..0a1cb42 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/str.h"
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 1ed8745..740b5fa 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_ALERT_H
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index a49bda7..fec2cfb 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -20,6 +20,11 @@
  *
  */
 
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1987-1989 Lankhor
+ */
+
 #include "common/endian.h"
 #include "common/system.h"
 #include "graphics/palette.h"
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 4983226..03e0d01 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -20,6 +20,11 @@
  *
  */
 
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1987-1989 Lankhor
+ */
+
 #ifndef MORTEVIELLE_GRAPHICS_H
 #define MORTEVIELLE_GRAPHICS_H
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 1cfafb8..99509f8 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/scummsys.h"
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 37612ed..03c0919 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_MENU_H
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 38355ec..c93722c 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -20,6 +20,11 @@
  *
  */
 
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1987-1989 Lankhor
+ */
+
 #include "common/system.h"
 #include "common/config-manager.h"
 #include "common/debug-channels.h"
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 97bc814..3f5c133 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -20,6 +20,11 @@
  *
  */
 
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1987-1989 Lankhor
+ */
+
 #ifndef MORTEVIELLE_H
 #define MORTEVIELLE_H
 
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index b46b1d6..598677f 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/endian.h"
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 0e235ad..abfc315 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_MOUSE_H
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e44dc98..9e903bb 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/file.h"
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index cc7bb1f..2516298 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_OUTTEXT_H
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index af00de2..48ae046 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/file.h"
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index a89fc9d..2152210 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_SAVELOAD_H
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 9f0738c..bb85221 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/scummsys.h"
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index 9ad46e8..675fc78 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_SOUND_H
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 09b0af7..2c15db2 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #include "common/endian.h"
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 42be466..c27f2bf 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -22,7 +22,7 @@
 
 /*
  * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
+ * Copyright (c) 1987-1989 Lankhor
  */
 
 #ifndef MORTEVIELLE_PAROLE_H


Commit: c0f86412e7d6c1051955098a173e923f73fd6e70
    https://github.com/scummvm/scummvm/commit/c0f86412e7d6c1051955098a173e923f73fd6e70
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:08-07:00

Commit Message:
MORTEVIELLE: Fix regression in 4edc3bff94b4cb27b32f46a4934bf486ab834e1c

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 4e6dfb0..cf68d7d 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -68,9 +68,7 @@ void MortevielleEngine::fctMove() {
 		} else if (_num == 7) {
 			_coreVar._currPlace = ATTIC;
 			_menu.setDestinationText(ATTIC);
-		}
-
-		if (_num != 6)
+		} else if (_num != 6)
 			_coreVar._currPlace = ROOM26;
 
 		if ((_num > 1) && (_num < 6))


Commit: 6b096df3978511cebaf16b936095e97ed4d1e137
    https://github.com/scummvm/scummvm/commit/6b096df3978511cebaf16b936095e97ed4d1e137
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-04-05T23:24:10-07:00

Commit Message:
MORTEVIELLE: Fix regression in 2c73b82b8ee95f9809af5e0d9893245f2c57247e

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index c93722c..a5c5dab 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -2243,8 +2243,7 @@ Common::String MortevielleEngine::getString(int num) {
 		char let;
 		do {
 			cinq_huit(let, hint, point, endFl);
-			if (length < 254)
-				wrkStr += let;
+			wrkStr += let;
 			++length;
 		} while (!endFl);
 	}


Commit: 5604a4693cc725b88ae9bded25b2da70dca71a8f
    https://github.com/scummvm/scummvm/commit/5604a4693cc725b88ae9bded25b2da70dca71a8f
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-05-30T14:28:11-07:00

Commit Message:
MORTEVIELLE: Some renaming

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 0a1cb42..b2be026 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -39,41 +39,38 @@ namespace Mortevielle {
  * @remarks	Originally called 'do_alert'
  */
 int Alert::show(const Common::String &msg, int n) {
-	int coldep, esp, i, caseNumb, quoi, ix;
-	Common::String st, chaine;
-	int limit[3][3];
-	Common::String s[3];
-	Common::Point curPos;
-	int nbcol, lignNumb;
-	bool newaff, test, test1, test2, test3, dum;
-	Common::String cas;
-
 	// Make a copy of the current screen surface for later restore
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
-	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
-	int do_alert_result;
 	g_vm->_mouse.hideMouse();
 	while (g_vm->keyPressed())
 		g_vm->getChar();
 
 	g_vm->setMouseClick(false);
-	decodeAlertDetails(msg, caseNumb, lignNumb, nbcol, chaine, cas);
+
+	int colNumb = 0;
+	int lignNumb = 0;
+	int caseNumb = 0;
+	Common::String alertStr = "";
+	Common::String caseStr;
+
+	decodeAlertDetails(msg, caseNumb, lignNumb, colNumb, alertStr, caseStr);
 	g_vm->sauvecr(50, (NUM_LINES + 1) << 4);
 
-	i = 0;
-	if (chaine == "") {
-		drawAlertBox(10, 5, nbcol);
+	int i = 0;
+	Common::Point curPos;
+	if (alertStr == "") {
+		drawAlertBox(10, 5, colNumb);
 	} else {
-		drawAlertBox(8, 7, nbcol);
+		drawAlertBox(8, 7, colNumb);
 		i = 0;
 		g_vm->_screenSurface._textPos.y = 70;
 		do {
 			curPos.x = 320;
-			st = "";
-			while ((chaine[i + 1] != '\174') && (chaine[i + 1] != '\135')) {
+			Common::String displayStr = "";
+			while ((alertStr[i + 1] != '\174') && (alertStr[i + 1] != '\135')) {
 				++i;
-				st = st + chaine[i];
+				displayStr += alertStr[i];
 				if (g_vm->_res == 2)
 					curPos.x -= 3;
 				else
@@ -81,78 +78,87 @@ int Alert::show(const Common::String &msg, int n) {
 			}
 			g_vm->_screenSurface.putxy(curPos.x, g_vm->_screenSurface._textPos.y);
 			g_vm->_screenSurface._textPos.y += 6;
-			g_vm->_screenSurface.drawString(st, 4);
+			g_vm->_screenSurface.drawString(displayStr, 4);
 			++i;
-		} while (chaine[i] != ']');
+		} while (alertStr[i] != ']');
 	}
+	int esp;
 	if (caseNumb == 1)
-		esp = nbcol - 40;
+		esp = colNumb - 40;
 	else
-		esp = (uint)(nbcol - caseNumb * 40) >> 1;
-	coldep = 320 - ((uint)nbcol >> 1) + ((uint)esp >> 1);
-	setButtonText(cas, coldep, caseNumb, &s[0], esp);
-	limit[1][1] = ((uint)(coldep) >> 1) * g_vm->_res;
+		esp = (uint)(colNumb - caseNumb * 40) / 2;
+
+	int coldep = 320 - ((uint)colNumb / 2) + ((uint)esp / 2);
+	Common::String buttonStr[3];
+	setButtonText(caseStr, coldep, caseNumb, &buttonStr[0], esp);
+
+	int limit[3][3];
+	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
+
+	limit[1][1] = ((uint)(coldep) / 2) * g_vm->_res;
 	limit[1][2] = limit[1][1] + 40;
 	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) >> 1) * g_vm->_res;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * g_vm->_res;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
 	g_vm->_mouse.showMouse();
-	quoi = 0;
-	dum = false;
+	int id = 0;
+	bool dummyFl = false;
+	bool test3;
 	do {
 		char dummyKey = '\377';
-		g_vm->_mouse.moveMouse(dum, dummyKey);
+		g_vm->_mouse.moveMouse(dummyFl, dummyKey);
 		CHECK_QUIT0;
 
 		curPos = g_vm->_mouse._pos;
-		test = (curPos.y > 95) && (curPos.y < 105);
-		newaff = false;
-		if (test) {
-			test1 = (curPos.x > limit[1][1]) && (curPos.x < limit[1][2]);
-			test2 = test1;
+		bool newaff = false;
+		if ((curPos.y > 95) && (curPos.y < 105)) {
+			bool test1 = (curPos.x > limit[1][1]) && (curPos.x < limit[1][2]);
+			bool test2 = test1;
 			if (caseNumb > 1)
-				test2 = test1 || ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2]));
+				test2 |= ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2]));
 			if (test2) {
 				newaff = true;
+
+				int ix;
 				if (test1)
 					ix = 1;
 				else
 					ix = 2;
-				if (ix != quoi) {
+				if (ix != id) {
 					g_vm->_mouse.hideMouse();
-					if (quoi != 0) {
-						setPosition(quoi, coldep, esp);
+					if (id != 0) {
+						setPosition(id, coldep, esp);
 
-						Common::String tmp(" ");
-						tmp += s[quoi];
-						tmp += " ";
-						g_vm->_screenSurface.drawString(tmp, 0);
+						Common::String tmpStr(" ");
+						tmpStr += buttonStr[id];
+						tmpStr += " ";
+						g_vm->_screenSurface.drawString(tmpStr, 0);
 					}
 					setPosition(ix, coldep, esp);
 
 					Common::String tmp2 = " ";
-					tmp2 += s[ix];
+					tmp2 += buttonStr[ix];
 					tmp2 += " ";
 					g_vm->_screenSurface.drawString(tmp2, 1);
 
-					quoi = ix;
+					id = ix;
 					g_vm->_mouse.showMouse();
 				}
 			}
 		}
-		if ((quoi != 0) && ! newaff) {
+		if ((id != 0) && !newaff) {
 			g_vm->_mouse.hideMouse();
-			setPosition(quoi, coldep, esp);
+			setPosition(id, coldep, esp);
 
 			Common::String tmp3(" ");
-			tmp3 += s[quoi];
+			tmp3 += buttonStr[id];
 			tmp3 += " ";
 			g_vm->_screenSurface.drawString(tmp3, 0);
 
-			quoi = 0;
+			id = 0;
 			g_vm->_mouse.showMouse();
 		}
 		test3 = (curPos.y > 95) && (curPos.y < 105) && (((curPos.x > limit[1][1]) && (curPos.x < limit[1][2]))
@@ -161,21 +167,20 @@ int Alert::show(const Common::String &msg, int n) {
 	g_vm->setMouseClick(false);
 	g_vm->_mouse.hideMouse();
 	if (!test3)  {
-		quoi = n;
+		id = n;
 		setPosition(n, coldep, esp);
 		Common::String tmp4(" ");
-		tmp4 += s[n];
+		tmp4 += buttonStr[n];
 		tmp4 += " ";
 		g_vm->_screenSurface.drawString(tmp4, 1);
 	}
-	g_vm->charecr(50, (NUM_LINES + 1) << 4);
+	g_vm->charecr(50, (NUM_LINES + 1) * 16);
 	g_vm->_mouse.showMouse();
 
 	/* Restore the background area */
 	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
 
-	do_alert_result = quoi;
-	return do_alert_result;
+	return id;
 }
 
 /**
@@ -233,10 +238,10 @@ void Alert::setPosition(int ji, int coldep, int esp) {
 void Alert::drawAlertBox(int lidep, int nli, int tx) {
 	if (tx > 640)
 		tx = 640;
-	int x = 320 - ((uint)tx >> 1);
-	int y = (lidep - 1) << 3;
+	int x = 320 - ((uint)tx / 2);
+	int y = (lidep - 1) * 8;
 	int xx = x + tx;
-	int yy = y + (nli << 3);
+	int yy = y + (nli * 8);
 	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
 	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
@@ -247,16 +252,13 @@ void Alert::drawAlertBox(int lidep, int nli, int tx) {
  * @remarks	Originally called 'fait_choix'
  */
 void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
-	int i, l, x;
-	char ch;
-
-	i = 1;
-	x = coldep;
-	for (l = 1; l <= nbcase; ++l) {
+	int i = 1;
+	int x = coldep;
+	for (int l = 1; l <= nbcase; ++l) {
 		str[l] = "";
 		do {
 			++i;
-			ch = c[i];
+			char ch = c[i];
 			str[l] += ch;
 		} while (c[i + 1] != ']');
 		i += 2;
@@ -284,12 +286,6 @@ bool KnowledgeCheck::show() {
 	const int textIndexArr[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
 	const int correctAnswerArr[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
-	char key;
-	int optionPosY;
-	int maxLength;
-	int rep;
-	int firstOption, lastOption;
-
 	Hotspot coor[kMaxHotspots+1];
 
 	for (int i = 0; i <= kMaxHotspots; ++i) {
@@ -315,6 +311,9 @@ bool KnowledgeCheck::show() {
 		Common::String tmpStr = g_vm->getString(textIndexArr[indx]);
 		g_vm->_text.displayStr(tmpStr, 20, 15, 100, 2, 0);
 
+		int firstOption;
+		int lastOption;
+
 		if (indx != 9) {
 			firstOption = textIndexArr[indx] + 1;
 			lastOption = textIndexArr[indx + 1] - 1;
@@ -322,8 +321,8 @@ bool KnowledgeCheck::show() {
 			firstOption = 503;
 			lastOption = 510;
 		}
-		optionPosY = 35;
-		maxLength = 0;
+		int optionPosY = 35;
+		int maxLength = 0;
 
 		prevChoice = 1;
 		for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
@@ -344,6 +343,7 @@ bool KnowledgeCheck::show() {
 			}
 		}
 		coor[lastOption - firstOption + 2]._enabled = false;
+		int rep;
 		if (g_vm->_res == 1)
 			rep = 10;
 		else
@@ -356,6 +356,7 @@ bool KnowledgeCheck::show() {
 		do {
 			g_vm->setMouseClick(false);
 			bool flag;
+			char key;
 			g_vm->_mouse.moveMouse(flag, key);
 			CHECK_QUIT0;
 
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 740b5fa..9b980af 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -48,7 +48,7 @@ private:
 	static void drawAlertBox(int lidep, int nli, int tx);
 	static void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
 public:
-	static int show(const Common::String &s, int n);
+	static int show(const Common::String &msg, int n);
 };
 
 class KnowledgeCheck {


Commit: b6aa4110f6c5e13f6ea4b89711a5a0154c3c3703
    https://github.com/scummvm/scummvm/commit/b6aa4110f6c5e13f6ea4b89711a5a0154c3c3703
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-05-30T14:29:25-07:00

Commit Message:
TOOLS: Translate a couple of strings used in Mortevielle English

Changed paths:
    devtools/create_mortdat/enginetext.h



diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index 68db310..c492914 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -30,9 +30,9 @@ const char *engineDataEn[] =  {
 	"[2][ ][YES][NO]",
 	"Go to",
 	"Someone enters, looks surised, but says nothing",
-	"Cool",
-	" Lourde ",
-	"Malsaine",
+	"   Cool   ",
+	"Oppressive",
+	"  Tense   ",
 	"Idem",
 	"You",
 	"are",
@@ -47,14 +47,14 @@ const char *engineDataEn[] =  {
 	" Save",
 
 	" Load",
-	" Restart     ",
+	" Restart",
 	"F3: Repeat",
 	"F8: Proceed",
 	"Hide self",
 	"take",
 	" probe    ",
 	" raise    ",
-	" -SUITE- ",
+	" -MORE- ",
 	" -STOP-  ",
 	"[1] [So, use the DEP menu] [Ok]",
 	"lift",


Commit: 188897042152b9fb4aaf2a37b1ad1b94f500d600
    https://github.com/scummvm/scummvm/commit/188897042152b9fb4aaf2a37b1ad1b94f500d600
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-06-14T09:47:03-07:00

Commit Message:
MORTEVIELLE: Fix recurrent Valgrind warnings (thanks DrMcCoy for reporting)

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index a5c5dab..21f2ba3 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -112,7 +112,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_place = -1;
 
 	_c_zzz = -1;
-
+	_caff = -1;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -489,6 +489,8 @@ static byte CURSOR_ARROW_DATA[16 * 16] = {
 void MortevielleEngine::initMouse() {
 	CursorMan.replaceCursor(CURSOR_ARROW_DATA, 16, 16, 0, 0, 0xff);
 	CursorMan.showMouse(true);
+
+	_mouse.initMouse();
 }
 
 /**


Commit: 1688911fcf6f50c2ed56593ae1027328d6d881f6
    https://github.com/scummvm/scummvm/commit/1688911fcf6f50c2ed56593ae1027328d6d881f6
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-06-14T15:31:48-07:00

Commit Message:
MORTEVIELLE: Initialize some more variables

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 21f2ba3..8ff7d02 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -113,6 +113,8 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 
 	_c_zzz = -1;
 	_caff = -1;
+
+	memset(_mem, 0, sizeof(_mem));
 }
 
 MortevielleEngine::~MortevielleEngine() {
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 2c15db2..0d06edc 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -58,6 +58,14 @@ const byte _tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4,
 SpeechManager::SpeechManager() {
 	_typlec = 0;
 	_phonemeNumb = 0;
+
+	for (int i = 0; i < 3; i++) {
+		_queue[i]._val;
+		_queue[i]._code;
+		_queue[i]._acc;
+		_queue[i]._freq;
+		_queue[i]._rep;
+	}
 }
 
 void SpeechManager::spfrac(int wor) {


Commit: d290ebe8303045764072b127f356fd164376894a
    https://github.com/scummvm/scummvm/commit/d290ebe8303045764072b127f356fd164376894a
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-06-14T15:34:19-07:00

Commit Message:
MORTEVIELLE: Initialize some more variables

Changed paths:
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 0d06edc..853d6ba 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -60,11 +60,11 @@ SpeechManager::SpeechManager() {
 	_phonemeNumb = 0;
 
 	for (int i = 0; i < 3; i++) {
-		_queue[i]._val;
-		_queue[i]._code;
-		_queue[i]._acc;
-		_queue[i]._freq;
-		_queue[i]._rep;
+		_queue[i]._val = 0;
+		_queue[i]._code = 0;
+		_queue[i]._acc = 0;
+		_queue[i]._freq = 0;
+		_queue[i]._rep = 0;
 	}
 }
 


Commit: e7aa754dac7db8f98d920f8ca2fbb7b7ddad7b86
    https://github.com/scummvm/scummvm/commit/e7aa754dac7db8f98d920f8ca2fbb7b7ddad7b86
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-06-15T11:39:03-07:00

Commit Message:
MORTEVIELLE: Fix a couple of Valgrind warnings

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8ff7d02..58708f3 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -113,8 +113,10 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 
 	_c_zzz = -1;
 	_caff = -1;
+	_day = 0;
 
 	memset(_mem, 0, sizeof(_mem));
+	_anyone = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -2483,11 +2485,12 @@ void MortevielleEngine::loadCFIEC() {
 	}
 
 	_cfiecBufferSize = ((f.size() / 128) + 1) * 128;
+	int32 fileSize = f.size();
 
 	if (!_reloadCFIEC)
 		_cfiecBuffer = (byte *)malloc(sizeof(byte) * _cfiecBufferSize);
 
-	for (int i = 0; i < _cfiecBufferSize; ++i)
+	for (int32 i = 0; i < fileSize; ++i)
 		_cfiecBuffer[i] = f.readByte();
 
 	f.close();


Commit: b504a566ee5e2139bd457c86a6868c2269c23f2d
    https://github.com/scummvm/scummvm/commit/b504a566ee5e2139bd457c86a6868c2269c23f2d
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-07T23:00:00-07:00

Commit Message:
MORTEVIELLE: Get rid of some magic values

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index cf68d7d..bff5d63 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -453,7 +453,7 @@ void MortevielleEngine::fctLook() {
 		treg(147);
 	if ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 3))
 		treg(149);
-	if ((_coreVar._currPlace == 9) && (_num == 2))
+	if ((_coreVar._currPlace == ROOM9) && (_num == 2))
 		treg(30);
 	if ((_coreVar._currPlace == DINING_ROOM) && (_num == 3))
 		treg(31);
@@ -610,7 +610,7 @@ void MortevielleEngine::fctOpen() {
 			++tmpPlace;
 		} while (!((tmpPlace > 6) || (ord(_touv[tmpPlace]) == 0) || (ord(_touv[tmpPlace]) == _num)));
 		if (ord(_touv[tmpPlace]) != _num) {
-			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == 9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
+			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == ROOM9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
 			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
 				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (_num == 5))
 				|| ((_num == 6) && ((_coreVar._currPlace == BATHROOM) || (_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == GREEN_ROOM2) || (_coreVar._currPlace == ATTIC)))
@@ -926,7 +926,7 @@ void MortevielleEngine::fctKnock() {
 		_speechManager.startSpeech(11, rand, 1);
 		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
 		int l = _ment;
-		if (l != 0) {
+		if (l != OWN_ROOM) {
 			if (p != -500) {
 				if (rand > p)
 					_crep = 190;
@@ -938,7 +938,7 @@ void MortevielleEngine::fctKnock() {
 				getKnockAnswer();
 		}
 
-		if (_ment == 8)
+		if (_ment == GREEN_ROOM2)
 			_crep = 190;
 	}
 }
@@ -1050,7 +1050,7 @@ void MortevielleEngine::fctListen() {
 		int rand;
 		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
 		int l = _ment;
-		if (l != 0) {
+		if (l != OWN_ROOM) {
 			if (p != -500) {
 				if (rand > p)
 					_crep = 101;


Commit: b6fc1fe31ff8c962278b30817402763738809944
    https://github.com/scummvm/scummvm/commit/b6fc1fe31ff8c962278b30817402763738809944
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-09T23:19:54-07:00

Commit Message:
MORTEVIELLE: Some renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index bff5d63..f53dd91 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -72,9 +72,9 @@ void MortevielleEngine::fctMove() {
 			_coreVar._currPlace = ROOM26;
 
 		if ((_num > 1) && (_num < 6))
-			_ment = _num - 1;
+			_roomDoorId = _num - 1;
 		else if (_num > 7)
-			_ment = _num - 3;
+			_roomDoorId = _num - 3;
 
 		if (_num != 6)
 			affrep();
@@ -207,10 +207,10 @@ void MortevielleEngine::fctTake() {
 			} else {
 				_tabdon[kAcha + ((_mchai - 1) * 10) + _cs - 1] = 0;
 				tsuiv();
-				++_dobj;
-				if (_dobj > 6) {
+				++_takeObjCount;
+				if (_takeObjCount > 6) {
 					_coreVar._faithScore += 2;
-					_dobj = 0;
+					_takeObjCount = 0;
 				}
 			}
 		}
@@ -583,7 +583,7 @@ void MortevielleEngine::fctOpen() {
 		ecr3(getEngineString(S_OPEN));
 
 	if (_caff == ROOM26) {
-		if (_ment != 0) {
+		if (_roomDoorId != OWN_ROOM) {
 			_msg[4] = OPCODE_ENTER;
 			_syn = true;
 		} else
@@ -604,7 +604,7 @@ void MortevielleEngine::fctOpen() {
 	if (_num != 0) {
 		if (_currBitIndex > 0)
 			_coreVar._faithScore += 2;
-		++_iouv;
+		++_openObjCount;
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
@@ -880,9 +880,9 @@ void MortevielleEngine::fctClose() {
 				aniof(2, _num);
 				_crep = 998;
 				_touv[cx] = chr(0);
-				--_iouv;
-				if (_iouv < 0)
-					_iouv = 0;
+				--_openObjCount;
+				if (_openObjCount < 0)
+					_openObjCount = 0;
 				int chai = 9999;
 				rechai(chai);
 				if (_mchai == chai)
@@ -924,8 +924,8 @@ void MortevielleEngine::fctKnock() {
 	if (_coreVar._currPlace == ROOM26) {
 		int rand = (getRandomNumber(0, 8)) - 4;
 		_speechManager.startSpeech(11, rand, 1);
-		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
-		int l = _ment;
+		int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
+		int l = _roomDoorId;
 		if (l != OWN_ROOM) {
 			if (p != -500) {
 				if (rand > p)
@@ -938,7 +938,7 @@ void MortevielleEngine::fctKnock() {
 				getKnockAnswer();
 		}
 
-		if (_ment == GREEN_ROOM2)
+		if (_roomDoorId == GREEN_ROOM2)
 			_crep = 190;
 	}
 }
@@ -1048,8 +1048,8 @@ void MortevielleEngine::fctListen() {
 		if (_currBitIndex != 0)
 			++_coreVar._faithScore;
 		int rand;
-		int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
-		int l = _ment;
+		int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
+		int l = _roomDoorId;
 		if (l != OWN_ROOM) {
 			if (p != -500) {
 				if (rand > p)
@@ -1126,17 +1126,17 @@ void MortevielleEngine::fctEnter() {
 		_menu.setDestinationText(_coreVar._currPlace);
 	} else if (_coreVar._currPlace == LANDING)
 		showMoveMenuAlert();
-	else if (_ment == 0)
+	else if (_roomDoorId == OWN_ROOM)
 		_crep = 997;
-	else if ((_ment == 9) && (_coreVar._selectedObjectId != 136)) {
+	else if ((_roomDoorId == ROOM9) && (_coreVar._selectedObjectId != 136)) {
 			_crep = 189;
 			_coreVar._teauto[8] = '*';
 	} else {
 		int z = 0;
 		if (!_blo)
-			z = getPresence(_ment);
+			z = getPresence(_roomDoorId);
 		if (z != 0) {
-			if ((_ment == 3) || (_ment == 7))
+			if ((_roomDoorId == TOILETS) || (_roomDoorId == BATHROOM))
 				_crep = 179;
 			else {
 				_x = (getRandomNumber(0, 10)) - 5;
@@ -1149,26 +1149,26 @@ void MortevielleEngine::fctEnter() {
 				_msg[3] = MENU_DISCUSS;
 				_msg[4] = _menu._discussMenu[_x];
 				_syn = true;
-				if (_ment == 9) {
+				if (_roomDoorId == ROOM9) {
 					_col = true;
 					_caff = 70;
 					afdes();
 					repon(2, _caff);
 				} else
 					_col = false;
-				resetRoomVariables(_ment);
-				_ment = 0;
+				resetRoomVariables(_roomDoorId);
+				_roomDoorId = OWN_ROOM;
 			}
 		} else {
 			_x = (getRandomNumber(0, 10)) - 5;
 			_speechManager.startSpeech(7, _x, 1);
 			aniof(1, 1);
 
-			_coreVar._currPlace = _ment;
+			_coreVar._currPlace = _roomDoorId;
 			affrep();
 			resetRoomVariables(_coreVar._currPlace);
 			_menu.setDestinationText(_coreVar._currPlace);
-			_ment = 0;
+			_roomDoorId = OWN_ROOM;
 			_savedBitIndex = 0;
 			_currBitIndex = 0;
 		}
@@ -1460,7 +1460,7 @@ void MortevielleEngine::fctDiscuss() {
 			if (_col) {
 				_col = false;
 				_coreVar._currPlace = 15;
-				if (_iouv > 0)
+				if (_openObjCount > 0)
 					max = 8;
 				else
 					max = 4;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 58708f3..9f41292 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -111,7 +111,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_newGraphicalDevice = -1;
 	_place = -1;
 
-	_c_zzz = -1;
+	_x26KeyCount = -1;
 	_caff = -1;
 	_day = 0;
 
@@ -207,7 +207,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 	loadCFIPH();
 	loadCFIEC();
 	decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
-	_c_zzz = 1;
+	_x26KeyCount = 1;
 	init_nbrepm();
 	initMouse();
 
@@ -587,7 +587,7 @@ void MortevielleEngine::mainGame() {
 	if (_reloadCFIEC)
 		loadCFIEC();
 
-	for (_crep = 1; _crep <= _c_zzz; ++_crep)
+	for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
 		decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
 
 	loadBRUIT5();
@@ -1679,8 +1679,8 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
  */
 void MortevielleEngine::loseGame() {
 	initouv();
-	_ment = 0;
-	_iouv = 0;
+	_roomDoorId = OWN_ROOM;
+	_openObjCount = 0;
 	_mchai = 0;
 	_menu.unsetSearchMenu();
 	if (!_blo)
@@ -1892,14 +1892,14 @@ void MortevielleEngine::gameLoaded() {
 	_endHour = 0;
 	_cs = 0;
 	_is = 0;
-	_ment = 0;
+	_roomDoorId = OWN_ROOM;
 	_syn = true;
 	_heroSearching = true;
 	_mchai = 0;
 	_manorDistance = 0;
 	initouv();
-	_iouv = 0;
-	_dobj = 0;
+	_openObjCount = 0;
+	_takeObjCount = 0;
 	affrep();
 	_hintPctMessage = getString(580);
 
@@ -3393,7 +3393,7 @@ void MortevielleEngine::affrep() {
  * @remarks	Originally called 'tsort'
  */
 void MortevielleEngine::exitRoom() {
-	if ((_iouv > 0) && (_coreVar._currPlace != OWN_ROOM)) {
+	if ((_openObjCount > 0) && (_coreVar._currPlace != OWN_ROOM)) {
 		if (_coreVar._faithScore < 50)
 			_coreVar._faithScore += 2;
 		else
@@ -3402,8 +3402,8 @@ void MortevielleEngine::exitRoom() {
 
 	for (int cx = 1; cx <= 7; ++cx)
 		_touv[cx] = chr(0);
-	_ment = 0;
-	_iouv = 0;
+	_roomDoorId = OWN_ROOM;
+	_openObjCount = 0;
 	_mchai = 0;
 	resetRoomVariables(_coreVar._currPlace);
 }
@@ -3523,7 +3523,7 @@ L1:
 		else
 			_speechManager.startSpeech(4, 4, 1);
 
-		if (_iouv == 0)
+		if (_openObjCount == 0)
 			_coreVar._faithScore += 2;
 		else if (_coreVar._faithScore < 50)
 			_coreVar._faithScore += 4;
@@ -3568,7 +3568,7 @@ void MortevielleEngine::tsuiv() {
 		tbcl = _tabdon[cl];
 	} while ((tbcl == 0) && (_cs <= 9));
 
-	if ((tbcl != 0) && (_cs < 11)) {
+	if ((tbcl != 0) && (_cs < 11)) { // 2nd check useless as _cs is <= 10
 		++_is;
 		_caff = tbcl;
 		_crep = _caff + 400;
@@ -3759,9 +3759,9 @@ int MortevielleEngine::testou() {
 		_soundOff = !_soundOff;
 		break;
 	case '\26' :
-		if ((_c_zzz == 1) || (_c_zzz == 2)) {
+		if ((_x26KeyCount == 1) || (_x26KeyCount == 2)) {
 			decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
-			++_c_zzz;
+			++_x26KeyCount;
 
 			return 61;
 		}
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 3f5c133..ec7e86f 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -157,7 +157,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 26  "A photograph$",
 27  "The coat of arms$",
 */
-enum places {
+enum Places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
 	BLUE_ROOM = 5,    RED_ROOM = 6,     BATHROOM = 7,        GREEN_ROOM2 = 8,  ROOM9 = 9,
 	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14,
@@ -173,7 +173,7 @@ struct nhom {
 	byte _hom[4];
 };
 
-struct t_pcga {
+struct CgaPalette {
 	byte _p;
 	nhom _a[16];
 };
@@ -260,12 +260,12 @@ private:
 	int  _startHour;
 	int  _endHour;
 	Common::Point _stdPal[91][17];
-	t_pcga _cgaPal[91];
+	CgaPalette _cgaPal[91];
 
-	int  _c_zzz;
-	int  _ment;
-	int  _iouv;
-	int  _dobj;
+	int  _x26KeyCount;
+	int  _roomDoorId;
+	int  _openObjCount;
+	int  _takeObjCount;
 	int  _num;
 	int  _cs;
 	int  _prebru;


Commit: 9488222929fb757b20a27ac28b72f8df1fa7913b
    https://github.com/scummvm/scummvm/commit/9488222929fb757b20a27ac28b72f8df1fa7913b
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-09T23:26:41-07:00

Commit Message:
Merge branch 'master' of github.com:scummvm/scummvm into mortevielle

Conflicts:
	base/plugins.cpp
	configure

Changed paths:
  A backends/midi/sndio.cpp
  A backends/platform/dingux/scummvm.png
  A common/coroutines.cpp
  A common/coroutines.h
  A common/installshield_cab.cpp
  A common/installshield_cab.h
  A devtools/create_project/msvc11/create_project.sln
  A devtools/create_project/msvc11/create_project.vcxproj
  A devtools/create_project/msvc11/create_project.vcxproj.filters
  A devtools/create_tony/create_tony.cpp
  A devtools/create_tony/create_tony.h
  A devtools/create_tony/module.mk
  A devtools/create_tony/staticdata.h
  A dists/engine-data/tony.dat
  A dists/msvc11/create_msvc11.bat
  A dists/msvc11/readme.txt
  A doc/da/HurtigStart
  A engines/configure.engines
  A engines/dreamweb/mouse.cpp
  A engines/dreamweb/sound.h
  A engines/gob/backbuffer.cpp
  A engines/gob/backbuffer.h
  A engines/gob/detection/detection.cpp
  A engines/gob/detection/tables.h
  A engines/gob/detection/tables_adi2.h
  A engines/gob/detection/tables_adi4.h
  A engines/gob/detection/tables_adibou.h
  A engines/gob/detection/tables_ajworld.h
  A engines/gob/detection/tables_bargon.h
  A engines/gob/detection/tables_dynasty.h
  A engines/gob/detection/tables_fallback.h
  A engines/gob/detection/tables_fascin.h
  A engines/gob/detection/tables_geisha.h
  A engines/gob/detection/tables_gob1.h
  A engines/gob/detection/tables_gob2.h
  A engines/gob/detection/tables_gob3.h
  A engines/gob/detection/tables_inca2.h
  A engines/gob/detection/tables_lit.h
  A engines/gob/detection/tables_littlered.h
  A engines/gob/detection/tables_onceupon.h
  A engines/gob/detection/tables_playtoons.h
  A engines/gob/detection/tables_urban.h
  A engines/gob/detection/tables_ween.h
  A engines/gob/detection/tables_woodruff.h
  A engines/gob/inter_littlered.cpp
  A engines/gob/minigames/geisha/mouth.cpp
  A engines/gob/minigames/geisha/mouth.h
  A engines/gob/minigames/geisha/submarine.cpp
  A engines/gob/minigames/geisha/submarine.h
  A engines/gob/pregob/gctfile.cpp
  A engines/gob/pregob/gctfile.h
  A engines/gob/pregob/onceupon/abracadabra.cpp
  A engines/gob/pregob/onceupon/abracadabra.h
  A engines/gob/pregob/onceupon/babayaga.cpp
  A engines/gob/pregob/onceupon/babayaga.h
  A engines/gob/pregob/onceupon/brokenstrings.h
  A engines/gob/pregob/onceupon/chargenchild.cpp
  A engines/gob/pregob/onceupon/chargenchild.h
  A engines/gob/pregob/onceupon/onceupon.cpp
  A engines/gob/pregob/onceupon/onceupon.h
  A engines/gob/pregob/onceupon/palettes.h
  A engines/gob/pregob/onceupon/parents.cpp
  A engines/gob/pregob/onceupon/parents.h
  A engines/gob/pregob/onceupon/stork.cpp
  A engines/gob/pregob/onceupon/stork.h
  A engines/gob/pregob/onceupon/title.cpp
  A engines/gob/pregob/onceupon/title.h
  A engines/gob/pregob/pregob.cpp
  A engines/gob/pregob/pregob.h
  A engines/gob/pregob/seqfile.cpp
  A engines/gob/pregob/seqfile.h
  A engines/gob/pregob/txtfile.cpp
  A engines/gob/pregob/txtfile.h
  A engines/gob/save/saveload_ajworld.cpp
  A engines/gob/sound/adlplayer.cpp
  A engines/gob/sound/adlplayer.h
  A engines/gob/sound/musplayer.cpp
  A engines/gob/sound/musplayer.h
  A engines/parallaction/adlib.cpp
  A engines/pegasus/ai/ai_action.cpp
  A engines/pegasus/ai/ai_action.h
  A engines/pegasus/ai/ai_area.cpp
  A engines/pegasus/ai/ai_area.h
  A engines/pegasus/ai/ai_condition.cpp
  A engines/pegasus/ai/ai_condition.h
  A engines/pegasus/ai/ai_rule.cpp
  A engines/pegasus/ai/ai_rule.h
  A engines/pegasus/compass.cpp
  A engines/pegasus/compass.h
  A engines/pegasus/console.cpp
  A engines/pegasus/console.h
  A engines/pegasus/constants.h
  A engines/pegasus/cursor.cpp
  A engines/pegasus/cursor.h
  A engines/pegasus/detection.cpp
  A engines/pegasus/elements.cpp
  A engines/pegasus/elements.h
  A engines/pegasus/energymonitor.cpp
  A engines/pegasus/energymonitor.h
  A engines/pegasus/fader.cpp
  A engines/pegasus/fader.h
  A engines/pegasus/gamestate.cpp
  A engines/pegasus/gamestate.h
  A engines/pegasus/graphics.cpp
  A engines/pegasus/graphics.h
  A engines/pegasus/hotspot.cpp
  A engines/pegasus/hotspot.h
  A engines/pegasus/input.cpp
  A engines/pegasus/input.h
  A engines/pegasus/interaction.h
  A engines/pegasus/interface.cpp
  A engines/pegasus/interface.h
  A engines/pegasus/items/autodragger.cpp
  A engines/pegasus/items/autodragger.h
  A engines/pegasus/items/biochips/aichip.cpp
  A engines/pegasus/items/biochips/aichip.h
  A engines/pegasus/items/biochips/biochipitem.cpp
  A engines/pegasus/items/biochips/biochipitem.h
  A engines/pegasus/items/biochips/mapchip.cpp
  A engines/pegasus/items/biochips/mapchip.h
  A engines/pegasus/items/biochips/mapimage.cpp
  A engines/pegasus/items/biochips/mapimage.h
  A engines/pegasus/items/biochips/opticalchip.cpp
  A engines/pegasus/items/biochips/opticalchip.h
  A engines/pegasus/items/biochips/pegasuschip.cpp
  A engines/pegasus/items/biochips/pegasuschip.h
  A engines/pegasus/items/biochips/retscanchip.cpp
  A engines/pegasus/items/biochips/retscanchip.h
  A engines/pegasus/items/biochips/shieldchip.cpp
  A engines/pegasus/items/biochips/shieldchip.h
  A engines/pegasus/items/inventory.cpp
  A engines/pegasus/items/inventory.h
  A engines/pegasus/items/inventory/airmask.cpp
  A engines/pegasus/items/inventory/airmask.h
  A engines/pegasus/items/inventory/gascanister.cpp
  A engines/pegasus/items/inventory/gascanister.h
  A engines/pegasus/items/inventory/inventoryitem.cpp
  A engines/pegasus/items/inventory/inventoryitem.h
  A engines/pegasus/items/inventory/keycard.cpp
  A engines/pegasus/items/inventory/keycard.h
  A engines/pegasus/items/inventorypicture.cpp
  A engines/pegasus/items/inventorypicture.h
  A engines/pegasus/items/item.cpp
  A engines/pegasus/items/item.h
  A engines/pegasus/items/itemdragger.cpp
  A engines/pegasus/items/itemdragger.h
  A engines/pegasus/items/itemlist.cpp
  A engines/pegasus/items/itemlist.h
  A engines/pegasus/menu.cpp
  A engines/pegasus/menu.h
  A engines/pegasus/module.mk
  A engines/pegasus/movie.cpp
  A engines/pegasus/movie.h
  A engines/pegasus/neighborhood/caldoria/caldoria.cpp
  A engines/pegasus/neighborhood/caldoria/caldoria.h
  A engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp
  A engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h
  A engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
  A engines/pegasus/neighborhood/caldoria/caldoriabomb.h
  A engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp
  A engines/pegasus/neighborhood/caldoria/caldoriamessages.h
  A engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp
  A engines/pegasus/neighborhood/caldoria/caldoriamirror.h
  A engines/pegasus/neighborhood/door.cpp
  A engines/pegasus/neighborhood/door.h
  A engines/pegasus/neighborhood/exit.cpp
  A engines/pegasus/neighborhood/exit.h
  A engines/pegasus/neighborhood/extra.cpp
  A engines/pegasus/neighborhood/extra.h
  A engines/pegasus/neighborhood/hotspotinfo.cpp
  A engines/pegasus/neighborhood/hotspotinfo.h
  A engines/pegasus/neighborhood/mars/constants.h
  A engines/pegasus/neighborhood/mars/energybeam.cpp
  A engines/pegasus/neighborhood/mars/energybeam.h
  A engines/pegasus/neighborhood/mars/gravitoncannon.cpp
  A engines/pegasus/neighborhood/mars/gravitoncannon.h
  A engines/pegasus/neighborhood/mars/hermite.cpp
  A engines/pegasus/neighborhood/mars/hermite.h
  A engines/pegasus/neighborhood/mars/mars.cpp
  A engines/pegasus/neighborhood/mars/mars.h
  A engines/pegasus/neighborhood/mars/planetmover.cpp
  A engines/pegasus/neighborhood/mars/planetmover.h
  A engines/pegasus/neighborhood/mars/reactor.cpp
  A engines/pegasus/neighborhood/mars/reactor.h
  A engines/pegasus/neighborhood/mars/robotship.cpp
  A engines/pegasus/neighborhood/mars/robotship.h
  A engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp
  A engines/pegasus/neighborhood/mars/shuttleenergymeter.h
  A engines/pegasus/neighborhood/mars/shuttlehud.cpp
  A engines/pegasus/neighborhood/mars/shuttlehud.h
  A engines/pegasus/neighborhood/mars/shuttleweapon.cpp
  A engines/pegasus/neighborhood/mars/shuttleweapon.h
  A engines/pegasus/neighborhood/mars/spacechase3d.cpp
  A engines/pegasus/neighborhood/mars/spacechase3d.h
  A engines/pegasus/neighborhood/mars/spacejunk.cpp
  A engines/pegasus/neighborhood/mars/spacejunk.h
  A engines/pegasus/neighborhood/mars/tractorbeam.cpp
  A engines/pegasus/neighborhood/mars/tractorbeam.h
  A engines/pegasus/neighborhood/neighborhood.cpp
  A engines/pegasus/neighborhood/neighborhood.h
  A engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp
  A engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h
  A engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp
  A engines/pegasus/neighborhood/norad/alpha/fillingstation.h
  A engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
  A engines/pegasus/neighborhood/norad/alpha/noradalpha.h
  A engines/pegasus/neighborhood/norad/alpha/panorama.cpp
  A engines/pegasus/neighborhood/norad/alpha/panorama.h
  A engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp
  A engines/pegasus/neighborhood/norad/alpha/panoramascroll.h
  A engines/pegasus/neighborhood/norad/constants.h
  A engines/pegasus/neighborhood/norad/delta/globegame.cpp
  A engines/pegasus/neighborhood/norad/delta/globegame.h
  A engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
  A engines/pegasus/neighborhood/norad/delta/noraddelta.h
  A engines/pegasus/neighborhood/norad/norad.cpp
  A engines/pegasus/neighborhood/norad/norad.h
  A engines/pegasus/neighborhood/norad/noradelevator.cpp
  A engines/pegasus/neighborhood/norad/noradelevator.h
  A engines/pegasus/neighborhood/norad/pressuredoor.cpp
  A engines/pegasus/neighborhood/norad/pressuredoor.h
  A engines/pegasus/neighborhood/norad/pressuretracker.cpp
  A engines/pegasus/neighborhood/norad/pressuretracker.h
  A engines/pegasus/neighborhood/norad/subcontrolroom.cpp
  A engines/pegasus/neighborhood/norad/subcontrolroom.h
  A engines/pegasus/neighborhood/norad/subplatform.cpp
  A engines/pegasus/neighborhood/norad/subplatform.h
  A engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
  A engines/pegasus/neighborhood/prehistoric/prehistoric.h
  A engines/pegasus/neighborhood/spot.cpp
  A engines/pegasus/neighborhood/spot.h
  A engines/pegasus/neighborhood/tsa/fulltsa.cpp
  A engines/pegasus/neighborhood/tsa/fulltsa.h
  A engines/pegasus/neighborhood/tsa/tinytsa.cpp
  A engines/pegasus/neighborhood/tsa/tinytsa.h
  A engines/pegasus/neighborhood/turn.cpp
  A engines/pegasus/neighborhood/turn.h
  A engines/pegasus/neighborhood/view.cpp
  A engines/pegasus/neighborhood/view.h
  A engines/pegasus/neighborhood/wsc/moleculebin.cpp
  A engines/pegasus/neighborhood/wsc/moleculebin.h
  A engines/pegasus/neighborhood/wsc/wsc.cpp
  A engines/pegasus/neighborhood/wsc/wsc.h
  A engines/pegasus/neighborhood/zoom.cpp
  A engines/pegasus/neighborhood/zoom.h
  A engines/pegasus/notification.cpp
  A engines/pegasus/notification.h
  A engines/pegasus/pegasus.cpp
  A engines/pegasus/pegasus.h
  A engines/pegasus/scoring.h
  A engines/pegasus/sound.cpp
  A engines/pegasus/sound.h
  A engines/pegasus/surface.cpp
  A engines/pegasus/surface.h
  A engines/pegasus/timers.cpp
  A engines/pegasus/timers.h
  A engines/pegasus/transition.cpp
  A engines/pegasus/transition.h
  A engines/pegasus/types.h
  A engines/pegasus/util.cpp
  A engines/pegasus/util.h
  A engines/plugins_table.h
  A engines/sci/engine/file.cpp
  A engines/sci/engine/file.h
  A engines/sci/engine/kgraphics32.cpp
  A engines/scumm/imuse/mac_m68k.cpp
  A engines/scumm/imuse/mac_m68k.h
  A engines/tony/custom.cpp
  A engines/tony/custom.h
  A engines/tony/debugger.cpp
  A engines/tony/debugger.h
  A engines/tony/detection.cpp
  A engines/tony/detection_tables.h
  A engines/tony/font.cpp
  A engines/tony/font.h
  A engines/tony/game.cpp
  A engines/tony/game.h
  A engines/tony/gfxcore.cpp
  A engines/tony/gfxcore.h
  A engines/tony/gfxengine.cpp
  A engines/tony/gfxengine.h
  A engines/tony/globals.cpp
  A engines/tony/globals.h
  A engines/tony/input.cpp
  A engines/tony/input.h
  A engines/tony/inventory.cpp
  A engines/tony/inventory.h
  A engines/tony/loc.cpp
  A engines/tony/loc.h
  A engines/tony/module.mk
  A engines/tony/mpal/expr.cpp
  A engines/tony/mpal/expr.h
  A engines/tony/mpal/loadmpc.cpp
  A engines/tony/mpal/loadmpc.h
  A engines/tony/mpal/lzo.cpp
  A engines/tony/mpal/lzo.h
  A engines/tony/mpal/memory.cpp
  A engines/tony/mpal/memory.h
  A engines/tony/mpal/mpal.cpp
  A engines/tony/mpal/mpal.h
  A engines/tony/mpal/mpaldll.h
  A engines/tony/mpal/mpalutils.cpp
  A engines/tony/mpal/mpalutils.h
  A engines/tony/resid.h
  A engines/tony/sound.cpp
  A engines/tony/sound.h
  A engines/tony/tony.cpp
  A engines/tony/tony.h
  A engines/tony/tonychar.cpp
  A engines/tony/tonychar.h
  A engines/tony/utils.cpp
  A engines/tony/utils.h
  A engines/tony/window.cpp
  A engines/tony/window.h
  A engines/wintermute/ad/ad_actor.cpp
  A engines/wintermute/ad/ad_actor.h
  A engines/wintermute/ad/ad_entity.cpp
  A engines/wintermute/ad/ad_entity.h
  A engines/wintermute/ad/ad_game.cpp
  A engines/wintermute/ad/ad_game.h
  A engines/wintermute/ad/ad_inventory.cpp
  A engines/wintermute/ad/ad_inventory.h
  A engines/wintermute/ad/ad_inventory_box.cpp
  A engines/wintermute/ad/ad_inventory_box.h
  A engines/wintermute/ad/ad_item.cpp
  A engines/wintermute/ad/ad_item.h
  A engines/wintermute/ad/ad_layer.cpp
  A engines/wintermute/ad/ad_layer.h
  A engines/wintermute/ad/ad_node_state.cpp
  A engines/wintermute/ad/ad_node_state.h
  A engines/wintermute/ad/ad_object.cpp
  A engines/wintermute/ad/ad_object.h
  A engines/wintermute/ad/ad_path.cpp
  A engines/wintermute/ad/ad_path.h
  A engines/wintermute/ad/ad_path_point.cpp
  A engines/wintermute/ad/ad_path_point.h
  A engines/wintermute/ad/ad_region.cpp
  A engines/wintermute/ad/ad_region.h
  A engines/wintermute/ad/ad_response.cpp
  A engines/wintermute/ad/ad_response.h
  A engines/wintermute/ad/ad_response_box.cpp
  A engines/wintermute/ad/ad_response_box.h
  A engines/wintermute/ad/ad_response_context.cpp
  A engines/wintermute/ad/ad_response_context.h
  A engines/wintermute/ad/ad_rot_level.cpp
  A engines/wintermute/ad/ad_rot_level.h
  A engines/wintermute/ad/ad_scale_level.cpp
  A engines/wintermute/ad/ad_scale_level.h
  A engines/wintermute/ad/ad_scene.cpp
  A engines/wintermute/ad/ad_scene.h
  A engines/wintermute/ad/ad_scene_node.cpp
  A engines/wintermute/ad/ad_scene_node.h
  A engines/wintermute/ad/ad_scene_state.cpp
  A engines/wintermute/ad/ad_scene_state.h
  A engines/wintermute/ad/ad_sentence.cpp
  A engines/wintermute/ad/ad_sentence.h
  A engines/wintermute/ad/ad_sprite_set.cpp
  A engines/wintermute/ad/ad_sprite_set.h
  A engines/wintermute/ad/ad_talk_def.cpp
  A engines/wintermute/ad/ad_talk_def.h
  A engines/wintermute/ad/ad_talk_holder.cpp
  A engines/wintermute/ad/ad_talk_holder.h
  A engines/wintermute/ad/ad_talk_node.cpp
  A engines/wintermute/ad/ad_talk_node.h
  A engines/wintermute/ad/ad_types.h
  A engines/wintermute/ad/ad_waypoint_group.cpp
  A engines/wintermute/ad/ad_waypoint_group.h
  A engines/wintermute/base/base.cpp
  A engines/wintermute/base/base.h
  A engines/wintermute/base/base_active_rect.cpp
  A engines/wintermute/base/base_active_rect.h
  A engines/wintermute/base/base_dynamic_buffer.cpp
  A engines/wintermute/base/base_dynamic_buffer.h
  A engines/wintermute/base/base_engine.cpp
  A engines/wintermute/base/base_engine.h
  A engines/wintermute/base/base_fader.cpp
  A engines/wintermute/base/base_fader.h
  A engines/wintermute/base/base_file_manager.cpp
  A engines/wintermute/base/base_file_manager.h
  A engines/wintermute/base/base_frame.cpp
  A engines/wintermute/base/base_frame.h
  A engines/wintermute/base/base_game.cpp
  A engines/wintermute/base/base_game.h
  A engines/wintermute/base/base_keyboard_state.cpp
  A engines/wintermute/base/base_keyboard_state.h
  A engines/wintermute/base/base_named_object.cpp
  A engines/wintermute/base/base_named_object.h
  A engines/wintermute/base/base_object.cpp
  A engines/wintermute/base/base_object.h
  A engines/wintermute/base/base_parser.cpp
  A engines/wintermute/base/base_parser.h
  A engines/wintermute/base/base_persistence_manager.cpp
  A engines/wintermute/base/base_persistence_manager.h
  A engines/wintermute/base/base_point.cpp
  A engines/wintermute/base/base_point.h
  A engines/wintermute/base/base_quick_msg.cpp
  A engines/wintermute/base/base_quick_msg.h
  A engines/wintermute/base/base_region.cpp
  A engines/wintermute/base/base_region.h
  A engines/wintermute/base/base_save_thumb_helper.cpp
  A engines/wintermute/base/base_save_thumb_helper.h
  A engines/wintermute/base/base_script_holder.cpp
  A engines/wintermute/base/base_script_holder.h
  A engines/wintermute/base/base_scriptable.cpp
  A engines/wintermute/base/base_scriptable.h
  A engines/wintermute/base/base_sprite.cpp
  A engines/wintermute/base/base_sprite.h
  A engines/wintermute/base/base_string_table.cpp
  A engines/wintermute/base/base_string_table.h
  A engines/wintermute/base/base_sub_frame.cpp
  A engines/wintermute/base/base_sub_frame.h
  A engines/wintermute/base/base_surface_storage.cpp
  A engines/wintermute/base/base_surface_storage.h
  A engines/wintermute/base/base_transition_manager.cpp
  A engines/wintermute/base/base_transition_manager.h
  A engines/wintermute/base/base_viewport.cpp
  A engines/wintermute/base/base_viewport.h
  A engines/wintermute/base/file/base_disk_file.cpp
  A engines/wintermute/base/file/base_disk_file.h
  A engines/wintermute/base/file/base_file.cpp
  A engines/wintermute/base/file/base_file.h
  A engines/wintermute/base/file/base_file_entry.cpp
  A engines/wintermute/base/file/base_file_entry.h
  A engines/wintermute/base/file/base_package.cpp
  A engines/wintermute/base/file/base_package.h
  A engines/wintermute/base/file/base_resources.cpp
  A engines/wintermute/base/file/base_resources.h
  A engines/wintermute/base/file/base_save_thumb_file.cpp
  A engines/wintermute/base/file/base_save_thumb_file.h
  A engines/wintermute/base/file/dcpackage.h
  A engines/wintermute/base/font/base_font.cpp
  A engines/wintermute/base/font/base_font.h
  A engines/wintermute/base/font/base_font_bitmap.cpp
  A engines/wintermute/base/font/base_font_bitmap.h
  A engines/wintermute/base/font/base_font_storage.cpp
  A engines/wintermute/base/font/base_font_storage.h
  A engines/wintermute/base/font/base_font_truetype.cpp
  A engines/wintermute/base/font/base_font_truetype.h
  A engines/wintermute/base/gfx/base_image.cpp
  A engines/wintermute/base/gfx/base_image.h
  A engines/wintermute/base/gfx/base_renderer.cpp
  A engines/wintermute/base/gfx/base_renderer.h
  A engines/wintermute/base/gfx/base_surface.cpp
  A engines/wintermute/base/gfx/base_surface.h
  A engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
  A engines/wintermute/base/gfx/osystem/base_render_osystem.h
  A engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
  A engines/wintermute/base/gfx/osystem/base_surface_osystem.h
  A engines/wintermute/base/particles/part_emitter.cpp
  A engines/wintermute/base/particles/part_emitter.h
  A engines/wintermute/base/particles/part_force.cpp
  A engines/wintermute/base/particles/part_force.h
  A engines/wintermute/base/particles/part_particle.cpp
  A engines/wintermute/base/particles/part_particle.h
  A engines/wintermute/base/saveload.cpp
  A engines/wintermute/base/saveload.h
  A engines/wintermute/base/scriptables/dcscript.h
  A engines/wintermute/base/scriptables/script.cpp
  A engines/wintermute/base/scriptables/script.h
  A engines/wintermute/base/scriptables/script_engine.cpp
  A engines/wintermute/base/scriptables/script_engine.h
  A engines/wintermute/base/scriptables/script_ext_array.cpp
  A engines/wintermute/base/scriptables/script_ext_array.h
  A engines/wintermute/base/scriptables/script_ext_date.cpp
  A engines/wintermute/base/scriptables/script_ext_date.h
  A engines/wintermute/base/scriptables/script_ext_file.cpp
  A engines/wintermute/base/scriptables/script_ext_file.h
  A engines/wintermute/base/scriptables/script_ext_math.cpp
  A engines/wintermute/base/scriptables/script_ext_math.h
  A engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
  A engines/wintermute/base/scriptables/script_ext_mem_buffer.h
  A engines/wintermute/base/scriptables/script_ext_object.cpp
  A engines/wintermute/base/scriptables/script_ext_object.h
  A engines/wintermute/base/scriptables/script_ext_string.cpp
  A engines/wintermute/base/scriptables/script_ext_string.h
  A engines/wintermute/base/scriptables/script_stack.cpp
  A engines/wintermute/base/scriptables/script_stack.h
  A engines/wintermute/base/scriptables/script_value.cpp
  A engines/wintermute/base/scriptables/script_value.h
  A engines/wintermute/base/sound/base_sound.cpp
  A engines/wintermute/base/sound/base_sound.h
  A engines/wintermute/base/sound/base_sound_buffer.cpp
  A engines/wintermute/base/sound/base_sound_buffer.h
  A engines/wintermute/base/sound/base_sound_manager.cpp
  A engines/wintermute/base/sound/base_sound_manager.h
  A engines/wintermute/coll_templ.h
  A engines/wintermute/dcgf.h
  A engines/wintermute/dctypes.h
  A engines/wintermute/detection.cpp
  A engines/wintermute/detection_tables.h
  A engines/wintermute/graphics/transparent_surface.cpp
  A engines/wintermute/graphics/transparent_surface.h
  A engines/wintermute/math/math_util.cpp
  A engines/wintermute/math/math_util.h
  A engines/wintermute/math/matrix4.cpp
  A engines/wintermute/math/matrix4.h
  A engines/wintermute/math/rect32.h
  A engines/wintermute/math/vector2.cpp
  A engines/wintermute/math/vector2.h
  A engines/wintermute/module.mk
  A engines/wintermute/persistent.cpp
  A engines/wintermute/persistent.h
  A engines/wintermute/platform_osystem.cpp
  A engines/wintermute/platform_osystem.h
  A engines/wintermute/system/sys_class.cpp
  A engines/wintermute/system/sys_class.h
  A engines/wintermute/system/sys_class_registry.cpp
  A engines/wintermute/system/sys_class_registry.h
  A engines/wintermute/system/sys_instance.cpp
  A engines/wintermute/system/sys_instance.h
  A engines/wintermute/ui/ui_button.cpp
  A engines/wintermute/ui/ui_button.h
  A engines/wintermute/ui/ui_edit.cpp
  A engines/wintermute/ui/ui_edit.h
  A engines/wintermute/ui/ui_entity.cpp
  A engines/wintermute/ui/ui_entity.h
  A engines/wintermute/ui/ui_object.cpp
  A engines/wintermute/ui/ui_object.h
  A engines/wintermute/ui/ui_text.cpp
  A engines/wintermute/ui/ui_text.h
  A engines/wintermute/ui/ui_tiled_image.cpp
  A engines/wintermute/ui/ui_tiled_image.h
  A engines/wintermute/ui/ui_window.cpp
  A engines/wintermute/ui/ui_window.h
  A engines/wintermute/utils/convert_utf.cpp
  A engines/wintermute/utils/convert_utf.h
  A engines/wintermute/utils/crc.cpp
  A engines/wintermute/utils/crc.h
  A engines/wintermute/utils/path_util.cpp
  A engines/wintermute/utils/path_util.h
  A engines/wintermute/utils/string_util.cpp
  A engines/wintermute/utils/string_util.h
  A engines/wintermute/utils/utils.cpp
  A engines/wintermute/utils/utils.h
  A engines/wintermute/video/video_player.cpp
  A engines/wintermute/video/video_player.h
  A engines/wintermute/video/video_theora_player.cpp
  A engines/wintermute/video/video_theora_player.h
  A engines/wintermute/wintermute.cpp
  A engines/wintermute/wintermute.h
  A engines/wintermute/wintypes.h
  A graphics/decoders/pcx.cpp
  A graphics/decoders/pcx.h
  A graphics/decoders/tga.cpp
  A graphics/decoders/tga.h
  A gui/saveload-dialog.cpp
  A gui/saveload-dialog.h
  A gui/themes/scummmodern/grid.bmp
  A gui/themes/scummmodern/list.bmp
  A po/gl_ES.po
  A test/common/memorywritestream.h
  A video/codecs/svq1.cpp
  A video/codecs/svq1.h
  A video/codecs/svq1_cb.h
  A video/codecs/svq1_vlc.h
  A video/theora_decoder.cpp
  A video/theora_decoder.h
  R backends/platform/sdl/main.cpp
  R engines/agos/installshield_cab.cpp
  R engines/agos/installshield_cab.h
  R engines/gob/detection.cpp
  R engines/gob/detection_tables.h
  R engines/sword25/fmv/theora_decoder.cpp
  R engines/sword25/fmv/theora_decoder.h
  R engines/tinsel/coroutine.cpp
  R engines/tinsel/coroutine.h
    AUTHORS
    Makefile
    NEWS
    README
    audio/audiostream.cpp
    audio/audiostream.h
    audio/decoders/adpcm.cpp
    audio/decoders/adpcm_intern.h
    audio/decoders/aiff.h
    audio/decoders/qdm2.cpp
    audio/decoders/quicktime.cpp
    audio/decoders/quicktime.h
    audio/decoders/quicktime_intern.h
    audio/decoders/voc.cpp
    audio/mididrv.cpp
    audio/midiparser.cpp
    audio/midiparser.h
    audio/midiparser_smf.cpp
    audio/midiparser_xmidi.cpp
    audio/mixer.h
    audio/mods/maxtrax.h
    audio/mods/protracker.cpp
    audio/mods/protracker.h
    audio/mods/tfmx.h
    audio/softsynth/mt32/Part.cpp
    audio/softsynth/mt32/Partial.h
    audio/softsynth/mt32/PartialManager.cpp
    audio/softsynth/mt32/Synth.cpp
    audio/softsynth/mt32/TVA.cpp
    audio/softsynth/mt32/TVF.cpp
    audio/softsynth/mt32/freeverb.cpp
    backends/events/gph/gph-events.cpp
    backends/events/gph/gph-events.h
    backends/events/openpandora/op-events.cpp
    backends/events/sdl/sdl-events.cpp
    backends/events/sdl/sdl-events.h
    backends/events/webossdl/webossdl-events.h
    backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
    backends/graphics/gph/gph-graphics.cpp
    backends/graphics/graphics.h
    backends/graphics/null/null-graphics.h
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/opengl/opengl-graphics.h
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/openpandora/op-graphics.cpp
    backends/graphics/openpandora/op-graphics.h
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.h
    backends/graphics/wincesdl/wincesdl-graphics.cpp
    backends/graphics/wincesdl/wincesdl-graphics.h
    backends/midi/coreaudio.cpp
    backends/mixer/sdl13/sdl13-mixer.cpp
    backends/modular-backend.cpp
    backends/modular-backend.h
    backends/module.mk
    backends/platform/android/android.cpp
    backends/platform/android/android.h
    backends/platform/android/android.mk
    backends/platform/android/gfx.cpp
    backends/platform/android/texture.cpp
    backends/platform/bada/application.cpp
    backends/platform/bada/sscanf.cpp
    backends/platform/bada/system.cpp
    backends/platform/dc/dc.h
    backends/platform/dc/dcmain.cpp
    backends/platform/dc/display.cpp
    backends/platform/dc/vmsave.cpp
    backends/platform/dingux/README.DINGUX
    backends/platform/dingux/dingux.mk
    backends/platform/ds/arm9/source/gbampsave.cpp
    backends/platform/ds/arm9/source/gbampsave.h
    backends/platform/ds/arm9/source/osystem_ds.cpp
    backends/platform/ds/arm9/source/osystem_ds.h
    backends/platform/gph/gph-backend.cpp
    backends/platform/gph/gph-main.cpp
    backends/platform/gph/gph.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/maemo/debian/changelog
    backends/platform/maemo/debian/control
    backends/platform/maemo/debian/rules
    backends/platform/maemo/maemo.cpp
    backends/platform/n64/framfs_save_manager.h
    backends/platform/n64/osys_n64.h
    backends/platform/n64/osys_n64_base.cpp
    backends/platform/n64/pakfs_save_manager.h
    backends/platform/openpandora/op-backend.cpp
    backends/platform/openpandora/op-options.cpp
    backends/platform/openpandora/op-sdl.h
    backends/platform/ps2/Gs2dScreen.cpp
    backends/platform/ps2/Gs2dScreen.h
    backends/platform/ps2/ps2time.cpp
    backends/platform/ps2/savefilemgr.cpp
    backends/platform/ps2/savefilemgr.h
    backends/platform/ps2/systemps2.cpp
    backends/platform/ps2/systemps2.h
    backends/platform/psp/README.PSP
    backends/platform/psp/default_display_client.cpp
    backends/platform/psp/default_display_client.h
    backends/platform/psp/display_manager.cpp
    backends/platform/psp/osys_psp.cpp
    backends/platform/psp/osys_psp.h
    backends/platform/sdl/macosx/macosx.cpp
    backends/platform/sdl/macosx/macosx.h
    backends/platform/sdl/module.mk
    backends/platform/sdl/sdl.cpp
    backends/platform/webos/webos.cpp
    backends/platform/webos/webos.h
    backends/platform/wii/osystem.cpp
    backends/platform/wii/osystem.h
    backends/platform/wii/osystem_gfx.cpp
    backends/platform/wince/wince-sdl.cpp
    backends/saves/default/default-saves.cpp
    backends/saves/default/default-saves.h
    backends/saves/windows/windows-saves.cpp
    backends/taskbar/win32/mingw-compat.h
    backends/timer/bada/timer.cpp
    backends/timer/bada/timer.h
    backends/timer/default/default-timer.cpp
    backends/timer/default/default-timer.h
    backends/vkeybd/virtual-keyboard-gui.cpp
    base/commandLine.cpp
    base/internal_version.h
    base/main.cpp
    base/plugins.cpp
    base/plugins.h
    base/version.cpp
    common/array.h
    common/cosinetables.cpp
    common/cosinetables.h
    common/dct.cpp
    common/dct.h
    common/endian.h
    common/fft.cpp
    common/fft.h
    common/gui_options.h
    common/keyboard.h
    common/macresman.cpp
    common/macresman.h
    common/memstream.h
    common/module.mk
    common/quicktime.cpp
    common/quicktime.h
    common/rational.h
    common/rdft.cpp
    common/rdft.h
    common/rect.h
    common/savefile.h
    common/sinetables.cpp
    common/sinetables.h
    common/system.h
    common/taskbar.h
    common/unzip.cpp
    common/updates.h
    common/util.h
    common/winexe_pe.cpp
    common/xmlparser.cpp
    common/zlib.cpp
    common/zlib.h
    configure
    devtools/README
    devtools/create_drascula/staticdata.h
    devtools/create_kyradat/create_kyradat.cpp
    devtools/create_kyradat/games.cpp
    devtools/create_kyradat/tables.cpp
    devtools/create_project/config.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/scripts/postbuild.cmd
    devtools/create_project/visualstudio.cpp
    devtools/create_project/xcode.cpp
    devtools/create_teenagent/create_teenagent.cpp
    devtools/credits.pl
    devtools/module.mk
    devtools/scumm-md5.txt
    dists/android/AndroidManifest.xml
    dists/android/plugin-manifest.xml
    dists/engine-data/README
    dists/engine-data/drascula.dat
    dists/engine-data/kyra.dat
    dists/engine-data/teenagent.dat
    dists/gph/README-GPH
    dists/gph/scummvm.ini
    dists/iphone/Info.plist
    dists/irix/scummvm.spec
    dists/macosx/Info.plist
    dists/openpandora/PXML.xml
    dists/openpandora/README-OPENPANDORA
    dists/openpandora/README-PND.txt
    dists/openpandora/index.html
    dists/redhat/scummvm-tools.spec
    dists/redhat/scummvm.spec
    dists/redhat/scummvm.spec.in
    dists/samsungtv/scummvm.dat
    dists/scummvm.6
    dists/scummvm.rc
    dists/scummvm.rc.in
    dists/slackware/scummvm.SlackBuild
    dists/wii/meta.xml
    dists/win32/ScummVM.iss
    dists/win32/scummvm.nsi
    doc/cz/PrectiMe
    doc/de/Liesmich
    doc/de/Neues
    doc/se/LasMig
    engines/advancedDetector.cpp
    engines/advancedDetector.h
    engines/agi/agi.cpp
    engines/agi/detection.cpp
    engines/agi/detection_tables.h
    engines/agi/loader_v1.cpp
    engines/agi/menu.cpp
    engines/agi/op_cmd.cpp
    engines/agi/op_test.cpp
    engines/agi/opcodes.cpp
    engines/agi/saveload.cpp
    engines/agi/sound_pcjr.cpp
    engines/agi/text.cpp
    engines/agi/words.cpp
    engines/agos/agos.h
    engines/agos/animation.cpp
    engines/agos/animation.h
    engines/agos/charset-fontdata.cpp
    engines/agos/event.cpp
    engines/agos/midiparser_s1d.cpp
    engines/agos/module.mk
    engines/agos/res.cpp
    engines/agos/saveload.cpp
    engines/agos/sound.cpp
    engines/cge/bitmap.cpp
    engines/cge/cge.cpp
    engines/cge/cge.h
    engines/cge/cge_main.cpp
    engines/cge/cge_main.h
    engines/cge/detection.cpp
    engines/cge/events.cpp
    engines/cge/events.h
    engines/cge/fileio.cpp
    engines/cge/sound.cpp
    engines/cge/text.cpp
    engines/cge/vga13h.cpp
    engines/cge/vga13h.h
    engines/cge/vmenu.cpp
    engines/cge/vmenu.h
    engines/cine/anim.cpp
    engines/cine/anim.h
    engines/cine/bg_list.cpp
    engines/cine/cine.cpp
    engines/cine/cine.h
    engines/cine/console.cpp
    engines/cine/detection_tables.h
    engines/cine/gfx.cpp
    engines/cine/gfx.h
    engines/cine/main_loop.cpp
    engines/cine/object.cpp
    engines/cine/pal.cpp
    engines/cine/part.cpp
    engines/cine/saveload.cpp
    engines/cine/saveload.h
    engines/cine/script.h
    engines/cine/script_fw.cpp
    engines/cine/sound.cpp
    engines/cine/sound.h
    engines/cine/texte.cpp
    engines/cine/texte.h
    engines/cine/various.cpp
    engines/cine/various.h
    engines/composer/composer.cpp
    engines/composer/resource.cpp
    engines/cruise/cruise.cpp
    engines/cruise/cruise_main.cpp
    engines/cruise/detection.cpp
    engines/cruise/menu.cpp
    engines/cruise/staticres.cpp
    engines/cruise/staticres.h
    engines/dialogs.cpp
    engines/draci/detection.cpp
    engines/drascula/detection.cpp
    engines/drascula/interface.cpp
    engines/dreamweb/detection.cpp
    engines/dreamweb/detection_tables.h
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/keypad.cpp
    engines/dreamweb/module.mk
    engines/dreamweb/monitor.cpp
    engines/dreamweb/newplace.cpp
    engines/dreamweb/object.cpp
    engines/dreamweb/people.cpp
    engines/dreamweb/print.cpp
    engines/dreamweb/rain.cpp
    engines/dreamweb/saveload.cpp
    engines/dreamweb/sound.cpp
    engines/dreamweb/sprite.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/talk.cpp
    engines/dreamweb/titles.cpp
    engines/dreamweb/use.cpp
    engines/dreamweb/vgafades.cpp
    engines/dreamweb/vgagrafx.cpp
    engines/engines.mk
    engines/gob/anifile.cpp
    engines/gob/anifile.h
    engines/gob/aniobject.cpp
    engines/gob/aniobject.h
    engines/gob/cheater.h
    engines/gob/cheater_geisha.cpp
    engines/gob/cmpfile.cpp
    engines/gob/cmpfile.h
    engines/gob/decfile.cpp
    engines/gob/draw.cpp
    engines/gob/draw.h
    engines/gob/draw_fascin.cpp
    engines/gob/draw_playtoons.cpp
    engines/gob/draw_v1.cpp
    engines/gob/draw_v2.cpp
    engines/gob/game.cpp
    engines/gob/game.h
    engines/gob/global.cpp
    engines/gob/global.h
    engines/gob/gob.cpp
    engines/gob/gob.h
    engines/gob/hotspots.cpp
    engines/gob/hotspots.h
    engines/gob/init.cpp
    engines/gob/init.h
    engines/gob/init_fascin.cpp
    engines/gob/init_geisha.cpp
    engines/gob/init_v1.cpp
    engines/gob/init_v2.cpp
    engines/gob/inter.cpp
    engines/gob/inter.h
    engines/gob/inter_bargon.cpp
    engines/gob/inter_fascin.cpp
    engines/gob/inter_geisha.cpp
    engines/gob/inter_v1.cpp
    engines/gob/inter_v2.cpp
    engines/gob/inter_v5.cpp
    engines/gob/inter_v7.cpp
    engines/gob/minigames/geisha/diving.cpp
    engines/gob/minigames/geisha/evilfish.cpp
    engines/gob/minigames/geisha/evilfish.h
    engines/gob/minigames/geisha/meter.cpp
    engines/gob/minigames/geisha/meter.h
    engines/gob/minigames/geisha/penetration.cpp
    engines/gob/minigames/geisha/penetration.h
    engines/gob/module.mk
    engines/gob/mult.cpp
    engines/gob/mult_v2.cpp
    engines/gob/palanim.cpp
    engines/gob/resources.cpp
    engines/gob/resources.h
    engines/gob/rxyfile.cpp
    engines/gob/rxyfile.h
    engines/gob/save/saveload.h
    engines/gob/sound/adlib.cpp
    engines/gob/sound/adlib.h
    engines/gob/sound/sound.cpp
    engines/gob/sound/sound.h
    engines/gob/sound/soundblaster.cpp
    engines/gob/sound/soundblaster.h
    engines/gob/surface.cpp
    engines/gob/surface.h
    engines/gob/util.cpp
    engines/gob/util.h
    engines/gob/video.cpp
    engines/gob/video.h
    engines/gob/videoplayer.cpp
    engines/gob/videoplayer.h
    engines/groovie/cursor.cpp
    engines/groovie/detection.cpp
    engines/groovie/graphics.cpp
    engines/groovie/resource.cpp
    engines/groovie/roq.cpp
    engines/groovie/saveload.cpp
    engines/groovie/script.cpp
    engines/hugo/console.cpp
    engines/hugo/detection.cpp
    engines/hugo/dialogs.cpp
    engines/hugo/dialogs.h
    engines/hugo/display.cpp
    engines/hugo/display.h
    engines/hugo/file.cpp
    engines/hugo/file.h
    engines/hugo/file_v1d.cpp
    engines/hugo/file_v1w.cpp
    engines/hugo/file_v2d.cpp
    engines/hugo/file_v3d.cpp
    engines/hugo/game.h
    engines/hugo/hugo.cpp
    engines/hugo/hugo.h
    engines/hugo/intro.cpp
    engines/hugo/intro.h
    engines/hugo/inventory.cpp
    engines/hugo/inventory.h
    engines/hugo/mouse.cpp
    engines/hugo/mouse.h
    engines/hugo/object.cpp
    engines/hugo/object.h
    engines/hugo/object_v1d.cpp
    engines/hugo/object_v1w.cpp
    engines/hugo/object_v2d.cpp
    engines/hugo/object_v3d.cpp
    engines/hugo/parser.cpp
    engines/hugo/parser.h
    engines/hugo/parser_v1d.cpp
    engines/hugo/parser_v1w.cpp
    engines/hugo/parser_v2d.cpp
    engines/hugo/parser_v3d.cpp
    engines/hugo/route.cpp
    engines/hugo/route.h
    engines/hugo/schedule.cpp
    engines/hugo/schedule.h
    engines/hugo/sound.cpp
    engines/hugo/sound.h
    engines/kyra/animator_hof.cpp
    engines/kyra/animator_mr.cpp
    engines/kyra/detection_tables.h
    engines/kyra/eobcommon.cpp
    engines/kyra/eobcommon.h
    engines/kyra/gui_hof.cpp
    engines/kyra/gui_lok.cpp
    engines/kyra/gui_mr.cpp
    engines/kyra/gui_v1.cpp
    engines/kyra/gui_v2.cpp
    engines/kyra/items_hof.cpp
    engines/kyra/items_lok.cpp
    engines/kyra/items_lol.cpp
    engines/kyra/items_mr.cpp
    engines/kyra/items_v2.cpp
    engines/kyra/kyra_hof.cpp
    engines/kyra/kyra_lok.cpp
    engines/kyra/kyra_mr.cpp
    engines/kyra/kyra_v2.cpp
    engines/kyra/lol.cpp
    engines/kyra/lol.h
    engines/kyra/screen.cpp
    engines/kyra/screen.h
    engines/kyra/screen_eob.cpp
    engines/kyra/screen_lok.cpp
    engines/kyra/screen_lol.cpp
    engines/kyra/screen_lol.h
    engines/kyra/script_hof.cpp
    engines/kyra/script_lok.cpp
    engines/kyra/script_lol.cpp
    engines/kyra/script_mr.cpp
    engines/kyra/sequences_lok.cpp
    engines/kyra/sound_intern.h
    engines/kyra/sound_midi.cpp
    engines/kyra/sound_towns.cpp
    engines/kyra/sprites_lol.cpp
    engines/kyra/staticres.cpp
    engines/kyra/text_hof.cpp
    engines/kyra/text_lok.cpp
    engines/kyra/text_mr.cpp
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/background.cpp
    engines/lastexpress/data/cursor.cpp
    engines/lastexpress/data/font.cpp
    engines/lastexpress/data/scene.cpp
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/data/sequence.h
    engines/lastexpress/data/snd.cpp
    engines/lastexpress/data/subtitle.cpp
    engines/lastexpress/debug.cpp
    engines/lastexpress/debug.h
    engines/lastexpress/detection.cpp
    engines/lastexpress/entities/abbot.cpp
    engines/lastexpress/entities/abbot.h
    engines/lastexpress/entities/alexei.cpp
    engines/lastexpress/entities/alexei.h
    engines/lastexpress/entities/alouan.cpp
    engines/lastexpress/entities/alouan.h
    engines/lastexpress/entities/anna.cpp
    engines/lastexpress/entities/anna.h
    engines/lastexpress/entities/august.cpp
    engines/lastexpress/entities/august.h
    engines/lastexpress/entities/boutarel.cpp
    engines/lastexpress/entities/boutarel.h
    engines/lastexpress/entities/chapters.cpp
    engines/lastexpress/entities/chapters.h
    engines/lastexpress/entities/cooks.cpp
    engines/lastexpress/entities/cooks.h
    engines/lastexpress/entities/coudert.cpp
    engines/lastexpress/entities/coudert.h
    engines/lastexpress/entities/entity.cpp
    engines/lastexpress/entities/entity.h
    engines/lastexpress/entities/entity39.cpp
    engines/lastexpress/entities/entity39.h
    engines/lastexpress/entities/entity_intern.h
    engines/lastexpress/entities/francois.cpp
    engines/lastexpress/entities/francois.h
    engines/lastexpress/entities/gendarmes.cpp
    engines/lastexpress/entities/gendarmes.h
    engines/lastexpress/entities/hadija.cpp
    engines/lastexpress/entities/hadija.h
    engines/lastexpress/entities/ivo.cpp
    engines/lastexpress/entities/ivo.h
    engines/lastexpress/entities/kahina.cpp
    engines/lastexpress/entities/kahina.h
    engines/lastexpress/entities/kronos.cpp
    engines/lastexpress/entities/kronos.h
    engines/lastexpress/entities/mahmud.cpp
    engines/lastexpress/entities/mahmud.h
    engines/lastexpress/entities/max.cpp
    engines/lastexpress/entities/max.h
    engines/lastexpress/entities/mertens.cpp
    engines/lastexpress/entities/mertens.h
    engines/lastexpress/entities/milos.cpp
    engines/lastexpress/entities/milos.h
    engines/lastexpress/entities/mmeboutarel.cpp
    engines/lastexpress/entities/mmeboutarel.h
    engines/lastexpress/entities/pascale.cpp
    engines/lastexpress/entities/pascale.h
    engines/lastexpress/entities/rebecca.cpp
    engines/lastexpress/entities/rebecca.h
    engines/lastexpress/entities/salko.cpp
    engines/lastexpress/entities/salko.h
    engines/lastexpress/entities/servers0.cpp
    engines/lastexpress/entities/servers0.h
    engines/lastexpress/entities/servers1.cpp
    engines/lastexpress/entities/servers1.h
    engines/lastexpress/entities/sophie.cpp
    engines/lastexpress/entities/sophie.h
    engines/lastexpress/entities/tables.cpp
    engines/lastexpress/entities/tables.h
    engines/lastexpress/entities/tatiana.cpp
    engines/lastexpress/entities/tatiana.h
    engines/lastexpress/entities/train.cpp
    engines/lastexpress/entities/train.h
    engines/lastexpress/entities/vassili.cpp
    engines/lastexpress/entities/vassili.h
    engines/lastexpress/entities/verges.cpp
    engines/lastexpress/entities/verges.h
    engines/lastexpress/entities/vesna.cpp
    engines/lastexpress/entities/vesna.h
    engines/lastexpress/entities/yasmin.cpp
    engines/lastexpress/entities/yasmin.h
    engines/lastexpress/fight/fight.cpp
    engines/lastexpress/fight/fighter.cpp
    engines/lastexpress/fight/fighter.h
    engines/lastexpress/game/action.cpp
    engines/lastexpress/game/beetle.cpp
    engines/lastexpress/game/beetle.h
    engines/lastexpress/game/entities.cpp
    engines/lastexpress/game/entities.h
    engines/lastexpress/game/inventory.cpp
    engines/lastexpress/game/inventory.h
    engines/lastexpress/game/logic.cpp
    engines/lastexpress/game/logic.h
    engines/lastexpress/game/object.cpp
    engines/lastexpress/game/savegame.cpp
    engines/lastexpress/game/savegame.h
    engines/lastexpress/game/savepoint.cpp
    engines/lastexpress/game/savepoint.h
    engines/lastexpress/game/scenes.cpp
    engines/lastexpress/game/scenes.h
    engines/lastexpress/game/state.cpp
    engines/lastexpress/game/state.h
    engines/lastexpress/graphics.cpp
    engines/lastexpress/helpers.h
    engines/lastexpress/lastexpress.cpp
    engines/lastexpress/menu/menu.cpp
    engines/lastexpress/resource.cpp
    engines/lastexpress/resource.h
    engines/lastexpress/shared.h
    engines/lastexpress/sound/entry.cpp
    engines/lastexpress/sound/queue.cpp
    engines/lastexpress/sound/queue.h
    engines/lastexpress/sound/sound.cpp
    engines/lure/decode.cpp
    engines/lure/surface.cpp
    engines/made/pmvplayer.cpp
    engines/made/screen.cpp
    engines/made/screen.h
    engines/made/screenfx.cpp
    engines/made/scriptfuncs.cpp
    engines/mohawk/bitmap.cpp
    engines/mohawk/cursors.cpp
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks.h
    engines/mohawk/myst.cpp
    engines/mohawk/myst_graphics.cpp
    engines/mohawk/myst_graphics.h
    engines/mohawk/myst_stacks/dni.cpp
    engines/mohawk/myst_stacks/intro.cpp
    engines/mohawk/riven.cpp
    engines/mohawk/riven_external.cpp
    engines/mohawk/riven_graphics.cpp
    engines/mohawk/video.cpp
    engines/mohawk/video.h
    engines/parallaction/callables_ns.cpp
    engines/parallaction/debug.cpp
    engines/parallaction/dialogue.cpp
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/exec.cpp
    engines/parallaction/exec_br.cpp
    engines/parallaction/exec_ns.cpp
    engines/parallaction/font.cpp
    engines/parallaction/gfxbase.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/graphics.h
    engines/parallaction/gui_ns.cpp
    engines/parallaction/input.cpp
    engines/parallaction/module.mk
    engines/parallaction/objects.cpp
    engines/parallaction/parallaction.cpp
    engines/parallaction/parallaction.h
    engines/parallaction/parallaction_br.cpp
    engines/parallaction/parallaction_ns.cpp
    engines/parallaction/parser_br.cpp
    engines/parallaction/parser_ns.cpp
    engines/parallaction/saveload.cpp
    engines/parallaction/sound.h
    engines/parallaction/sound_br.cpp
    engines/parallaction/sound_ns.cpp
    engines/parallaction/staticres.cpp
    engines/parallaction/walk.cpp
    engines/parallaction/walk.h
    engines/queen/display.cpp
    engines/queen/queen.cpp
    engines/saga/actor_path.cpp
    engines/saga/detection.cpp
    engines/saga/introproc_ihnm.cpp
    engines/saga/introproc_ite.cpp
    engines/saga/introproc_saga2.cpp
    engines/saga/script.cpp
    engines/saga/shorten.cpp
    engines/savestate.h
    engines/sci/console.cpp
    engines/sci/console.h
    engines/sci/detection.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/features.cpp
    engines/sci/engine/features.h
    engines/sci/engine/gc.cpp
    engines/sci/engine/gc.h
    engines/sci/engine/kernel.cpp
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kevent.cpp
    engines/sci/engine/kfile.cpp
    engines/sci/engine/kgraphics.cpp
    engines/sci/engine/klists.cpp
    engines/sci/engine/kmath.cpp
    engines/sci/engine/kmisc.cpp
    engines/sci/engine/kparse.cpp
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/kscripts.cpp
    engines/sci/engine/ksound.cpp
    engines/sci/engine/kstring.cpp
    engines/sci/engine/kvideo.cpp
    engines/sci/engine/message.cpp
    engines/sci/engine/object.cpp
    engines/sci/engine/object.h
    engines/sci/engine/savegame.cpp
    engines/sci/engine/script.cpp
    engines/sci/engine/script.h
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/seg_manager.h
    engines/sci/engine/segment.cpp
    engines/sci/engine/segment.h
    engines/sci/engine/selector.cpp
    engines/sci/engine/selector.h
    engines/sci/engine/state.cpp
    engines/sci/engine/state.h
    engines/sci/engine/vm.cpp
    engines/sci/engine/vm.h
    engines/sci/engine/vm_types.cpp
    engines/sci/engine/vm_types.h
    engines/sci/engine/workarounds.cpp
    engines/sci/event.cpp
    engines/sci/graphics/animate.cpp
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/cursor.cpp
    engines/sci/graphics/font.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h
    engines/sci/graphics/maciconbar.cpp
    engines/sci/graphics/menu.cpp
    engines/sci/graphics/paint16.cpp
    engines/sci/graphics/palette.cpp
    engines/sci/graphics/palette.h
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/screen.cpp
    engines/sci/graphics/screen.h
    engines/sci/graphics/text32.cpp
    engines/sci/graphics/text32.h
    engines/sci/graphics/view.cpp
    engines/sci/module.mk
    engines/sci/resource.cpp
    engines/sci/resource.h
    engines/sci/sci.cpp
    engines/sci/sci.h
    engines/sci/sound/audio.cpp
    engines/sci/sound/drivers/adlib.cpp
    engines/sci/sound/drivers/fmtowns.cpp
    engines/sci/sound/midiparser_sci.cpp
    engines/sci/sound/midiparser_sci.h
    engines/sci/sound/music.cpp
    engines/sci/sound/soundcmd.cpp
    engines/sci/video/robot_decoder.cpp
    engines/sci/video/robot_decoder.h
    engines/sci/video/seq_decoder.cpp
    engines/sci/video/seq_decoder.h
    engines/scumm/actor.cpp
    engines/scumm/actor.h
    engines/scumm/charset.cpp
    engines/scumm/charset.h
    engines/scumm/costume.cpp
    engines/scumm/cursor.cpp
    engines/scumm/debugger.cpp
    engines/scumm/detection.cpp
    engines/scumm/detection.h
    engines/scumm/detection_tables.h
    engines/scumm/dialogs.cpp
    engines/scumm/gfx.cpp
    engines/scumm/he/animation_he.cpp
    engines/scumm/he/intern_he.h
    engines/scumm/he/logic/football.cpp
    engines/scumm/he/logic/soccer.cpp
    engines/scumm/he/logic_he.cpp
    engines/scumm/he/logic_he.h
    engines/scumm/he/resource_he.cpp
    engines/scumm/he/script_v100he.cpp
    engines/scumm/he/script_v60he.cpp
    engines/scumm/he/script_v90he.cpp
    engines/scumm/he/sound_he.cpp
    engines/scumm/he/wiz_he.cpp
    engines/scumm/imuse/imuse.cpp
    engines/scumm/imuse/imuse_internal.h
    engines/scumm/imuse/imuse_part.cpp
    engines/scumm/imuse/imuse_player.cpp
    engines/scumm/imuse/instrument.cpp
    engines/scumm/imuse/instrument.h
    engines/scumm/imuse/sysex_scumm.cpp
    engines/scumm/imuse_digi/dimuse_sndmgr.h
    engines/scumm/insane/insane_scenes.cpp
    engines/scumm/midiparser_ro.cpp
    engines/scumm/module.mk
    engines/scumm/object.cpp
    engines/scumm/player_apple2.cpp
    engines/scumm/player_apple2.h
    engines/scumm/player_towns.cpp
    engines/scumm/player_v2cms.cpp
    engines/scumm/proc3ARM.s
    engines/scumm/saveload.cpp
    engines/scumm/saveload.h
    engines/scumm/script.cpp
    engines/scumm/script_v0.cpp
    engines/scumm/script_v2.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/scumm-md5.h
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/sound.cpp
    engines/scumm/verbs.cpp
    engines/sky/detection.cpp
    engines/sword1/animation.cpp
    engines/sword1/animation.h
    engines/sword1/control.cpp
    engines/sword1/detection.cpp
    engines/sword1/logic.cpp
    engines/sword1/objectman.cpp
    engines/sword1/objectman.h
    engines/sword1/sound.cpp
    engines/sword1/sword1.cpp
    engines/sword1/sword1.h
    engines/sword1/text.cpp
    engines/sword2/animation.cpp
    engines/sword2/animation.h
    engines/sword2/function.cpp
    engines/sword2/sprite.cpp
    engines/sword25/fmv/movieplayer.cpp
    engines/sword25/fmv/movieplayer.h
    engines/sword25/gfx/graphicengine.cpp
    engines/sword25/gfx/image/art.cpp
    engines/sword25/gfx/image/art.h
    engines/sword25/gfx/image/renderedimage.cpp
    engines/sword25/module.mk
    engines/sword25/script/luabindhelper.cpp
    engines/sword25/sfx/soundengine.cpp
    engines/sword25/util/pluto/pluto.cpp
    engines/teenagent/callbacks.cpp
    engines/teenagent/detection.cpp
    engines/teenagent/resources.cpp
    engines/teenagent/scene.cpp
    engines/teenagent/teenagent.cpp
    engines/testbed/graphics.cpp
    engines/testbed/testsuite.cpp
    engines/tinsel/actors.cpp
    engines/tinsel/background.h
    engines/tinsel/bg.cpp
    engines/tinsel/bmv.cpp
    engines/tinsel/bmv.h
    engines/tinsel/detection.cpp
    engines/tinsel/detection_tables.h
    engines/tinsel/dialogs.cpp
    engines/tinsel/dialogs.h
    engines/tinsel/drives.cpp
    engines/tinsel/drives.h
    engines/tinsel/effect.cpp
    engines/tinsel/events.cpp
    engines/tinsel/events.h
    engines/tinsel/faders.cpp
    engines/tinsel/handle.cpp
    engines/tinsel/module.mk
    engines/tinsel/move.cpp
    engines/tinsel/music.cpp
    engines/tinsel/music.h
    engines/tinsel/pcode.cpp
    engines/tinsel/pcode.h
    engines/tinsel/pdisplay.cpp
    engines/tinsel/play.cpp
    engines/tinsel/play.h
    engines/tinsel/polygons.cpp
    engines/tinsel/rince.cpp
    engines/tinsel/rince.h
    engines/tinsel/saveload.cpp
    engines/tinsel/savescn.cpp
    engines/tinsel/scene.cpp
    engines/tinsel/scene.h
    engines/tinsel/sched.cpp
    engines/tinsel/sched.h
    engines/tinsel/sound.cpp
    engines/tinsel/text.h
    engines/tinsel/tinlib.cpp
    engines/tinsel/tinsel.cpp
    engines/tinsel/tinsel.h
    engines/tinsel/token.cpp
    engines/toltecs/animation.cpp
    engines/toltecs/animation.h
    engines/toltecs/detection.cpp
    engines/toltecs/menu.cpp
    engines/toltecs/menu.h
    engines/toltecs/microtiles.cpp
    engines/toltecs/movie.cpp
    engines/toltecs/movie.h
    engines/toltecs/music.cpp
    engines/toltecs/music.h
    engines/toltecs/palette.cpp
    engines/toltecs/palette.h
    engines/toltecs/render.cpp
    engines/toltecs/render.h
    engines/toltecs/resource.cpp
    engines/toltecs/saveload.cpp
    engines/toltecs/screen.cpp
    engines/toltecs/screen.h
    engines/toltecs/script.cpp
    engines/toltecs/script.h
    engines/toltecs/segmap.cpp
    engines/toltecs/segmap.h
    engines/toltecs/sound.cpp
    engines/toltecs/sound.h
    engines/toltecs/sprite.cpp
    engines/toltecs/toltecs.cpp
    engines/toltecs/toltecs.h
    engines/toon/anim.cpp
    engines/toon/anim.h
    engines/toon/audio.cpp
    engines/toon/character.cpp
    engines/toon/character.h
    engines/toon/detection.cpp
    engines/toon/drew.cpp
    engines/toon/drew.h
    engines/toon/flux.cpp
    engines/toon/flux.h
    engines/toon/font.cpp
    engines/toon/font.h
    engines/toon/hotspot.cpp
    engines/toon/hotspot.h
    engines/toon/movie.cpp
    engines/toon/movie.h
    engines/toon/path.cpp
    engines/toon/path.h
    engines/toon/picture.cpp
    engines/toon/picture.h
    engines/toon/script_func.cpp
    engines/toon/toon.cpp
    engines/toon/toon.h
    engines/touche/detection.cpp
    engines/touche/staticres.cpp
    engines/tsage/blue_force/blueforce_dialogs.cpp
    engines/tsage/blue_force/blueforce_scenes3.cpp
    engines/tsage/blue_force/blueforce_scenes7.cpp
    engines/tsage/blue_force/blueforce_scenes9.cpp
    engines/tsage/blue_force/blueforce_speakers.cpp
    engines/tsage/blue_force/blueforce_speakers.h
    engines/tsage/converse.cpp
    engines/tsage/detection.cpp
    engines/tsage/detection_tables.h
    engines/tsage/dialogs.cpp
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp
    engines/tsage/graphics.h
    engines/tsage/ringworld/ringworld_dialogs.cpp
    engines/tsage/ringworld/ringworld_logic.cpp
    engines/tsage/ringworld/ringworld_scenes5.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/ringworld2/ringworld2_scenes3.cpp
    engines/tsage/ringworld2/ringworld2_speakers.h
    engines/tsage/scenes.cpp
    engines/tsage/scenes.h
    engines/tsage/sound.cpp
    engines/tsage/sound.h
    engines/tsage/tsage.cpp
    engines/tsage/user_interface.cpp
    engines/tucker/resource.cpp
    engines/tucker/sequences.cpp
    graphics/VectorRenderer.cpp
    graphics/VectorRenderer.h
    graphics/VectorRendererSpec.cpp
    graphics/conversion.cpp
    graphics/conversion.h
    graphics/cursorman.cpp
    graphics/cursorman.h
    graphics/decoders/bmp.cpp
    graphics/decoders/bmp.h
    graphics/decoders/image_decoder.h
    graphics/decoders/jpeg.cpp
    graphics/decoders/jpeg.h
    graphics/decoders/pict.cpp
    graphics/decoders/pict.h
    graphics/decoders/png.cpp
    graphics/decoders/png.h
    graphics/fontman.cpp
    graphics/fontman.h
    graphics/fonts/bdf.h
    graphics/fonts/consolefont.cpp
    graphics/fonts/newfont.cpp
    graphics/fonts/newfont_big.cpp
    graphics/fonts/ttf.cpp
    graphics/fonts/ttf.h
    graphics/iff.cpp
    graphics/module.mk
    graphics/pixelformat.h
    graphics/primitives.cpp
    graphics/primitives.h
    graphics/scaler.cpp
    graphics/scaler/aspect.cpp
    graphics/sjis.h
    graphics/surface.cpp
    graphics/surface.h
    graphics/wincursor.cpp
    graphics/wincursor.h
    graphics/yuv_to_rgb.cpp
    graphics/yuv_to_rgb.h
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/ThemeParser.cpp
    gui/ThemeParser.h
    gui/Tooltip.cpp
    gui/credits.h
    gui/dialog.cpp
    gui/dialog.h
    gui/gui-manager.cpp
    gui/launcher.cpp
    gui/module.mk
    gui/options.cpp
    gui/predictivedialog.cpp
    gui/predictivedialog.h
    gui/saveload.cpp
    gui/saveload.h
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_gfx.stx
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_gfx.stx
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/themes/translations.dat
    gui/widget.cpp
    gui/widget.h
    gui/widgets/editable.h
    gui/widgets/list.h
    po/POTFILES
    po/ca_ES.po
    po/cs_CZ.po
    po/da_DA.po
    po/de_DE.po
    po/es_ES.po
    po/eu.po
    po/fr_FR.po
    po/hu_HU.po
    po/it_IT.po
    po/nb_NO.po
    po/nn_NO.po
    po/pl_PL.po
    po/pt_BR.po
    po/ru_RU.po
    po/scummvm.pot
    po/se_SE.po
    po/uk_UA.po
    ports.mk
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/bink_decoder.cpp
    video/bink_decoder.h
    video/codecs/qtrle.cpp
    video/codecs/qtrle.h
    video/codecs/rpza.cpp
    video/codecs/rpza.h
    video/coktel_decoder.cpp
    video/coktel_decoder.h
    video/dxa_decoder.cpp
    video/dxa_decoder.h
    video/flic_decoder.cpp
    video/flic_decoder.h
    video/module.mk
    video/psx_decoder.cpp
    video/psx_decoder.h
    video/qt_decoder.cpp
    video/qt_decoder.h
    video/smk_decoder.cpp
    video/smk_decoder.h
    video/video_decoder.cpp
    video/video_decoder.h





Commit: 0782835e6bf5f14347d1d09a221e6d4c13baa929
    https://github.com/scummvm/scummvm/commit/0782835e6bf5f14347d1d09a221e6d4c13baa929
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-09T23:29:27-07:00

Commit Message:
MORTEVIELLE: Fix merge

Changed paths:
    engines/configure.engines
    engines/plugins_table.h



diff --git a/engines/configure.engines b/engines/configure.engines
index a8eb89a..ee29e32 100644
--- a/engines/configure.engines
+++ b/engines/configure.engines
@@ -24,6 +24,7 @@ add_engine lastexpress "The Last Express" no "" "" "16bit"
 add_engine lure "Lure of the Temptress" yes
 add_engine made "MADE" yes
 add_engine mohawk "Mohawk" yes "cstime myst riven" "Living Books"
+add_engine mortevielle "Mortevielle" no
 add_engine cstime "Where in Time is Carmen Sandiego?" no
 add_engine riven "Riven: The Sequel to Myst" no "" "" "16bit"
 add_engine myst "Myst" no "" "" "16bit"
diff --git a/engines/plugins_table.h b/engines/plugins_table.h
index 010de0d..5097c87 100644
--- a/engines/plugins_table.h
+++ b/engines/plugins_table.h
@@ -41,6 +41,9 @@ LINK_PLUGIN(HUGO)
 #if PLUGIN_ENABLED_STATIC(KYRA)
 LINK_PLUGIN(KYRA)
 #endif
+#if PLUGIN_ENABLED_STATIC(MORTEVIELLE)
+LINK_PLUGIN(MORTEVIELLE)
+#endif
 #if PLUGIN_ENABLED_STATIC(LASTEXPRESS)
 LINK_PLUGIN(LASTEXPRESS)
 #endif


Commit: e2b939888b421c30cd165623aaf00f1427c93bbd
    https://github.com/scummvm/scummvm/commit/e2b939888b421c30cd165623aaf00f1427c93bbd
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-10T15:45:46-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index f53dd91..2e4a237 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -43,8 +43,8 @@ void MortevielleEngine::fctMove() {
 	if ((_coreVar._currPlace == ROOM26) && (_msg[4] == _menu._moveMenu[6])) {
 		_coreVar._currPlace = LANDING;
 		_caff = _coreVar._currPlace;
-		afdes();
-		repon(2, _coreVar._currPlace);
+		drawPictureWithText();
+		handleDescriptionText(2, _coreVar._currPlace);
 	}
 	if ((_coreVar._currPlace == LANDING) && (_msg[4] == _menu._moveMenu[6])) {
 		if (!_syn)
@@ -314,7 +314,7 @@ void MortevielleEngine::fctInventoryTake() {
 	_menu.setInventoryText();
 	avpoing(cz);
 	_crep = 998;
-	clearScreenType2();
+	clearDescriptionBar();
 }
 
 /**
@@ -686,7 +686,7 @@ void MortevielleEngine::fctPlace() {
 					// Open hidden passage
 					aniof(1, 2);
 					aniof(1, 1);
-					repon(2, 165);
+					handleDescriptionText(2, 165);
 					displayEmptyHand();
 					_speechManager.startSpeech(6, -9, 1);
 
@@ -700,8 +700,8 @@ void MortevielleEngine::fctPlace() {
 						_mouse.hideMouse();
 						hirs();
 						drawRightFrame();
-						clearScreenType2();
-						clearScreenType3();
+						clearDescriptionBar();
+						clearVerbBar();
 						_mouse.showMouse();
 						prepareRoom();
 						drawClock();
@@ -717,7 +717,7 @@ void MortevielleEngine::fctPlace() {
 						} else {
 							_menu.setDestinationText(_coreVar._currPlace);
 							setPal(14);
-							dessin();
+							drawPicture();
 							aniof(1, 2);
 							aniof(1, 1);
 							alertTxt = getString(577);
@@ -788,7 +788,7 @@ void MortevielleEngine::fctTurn() {
 	if (_num != 0) {
 		_crep = 997;
 		if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
-			repon(2, 167);
+			handleDescriptionText(2, 167);
 			_speechManager.startSpeech(7, 9, 1);
 			int answer = Alert::show(getEngineString(S_YES_NO), 1);
 			if (answer == 1)
@@ -797,8 +797,8 @@ void MortevielleEngine::fctTurn() {
 				_crep = 168;
 		}
 		if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143)) {
-			repon(2, 175);
-			clearScreenType3();
+			handleDescriptionText(2, 175);
+			clearVerbBar();
 			_speechManager.startSpeech(6, -9, 1);
 			int answer = Alert::show(getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
@@ -1152,8 +1152,8 @@ void MortevielleEngine::fctEnter() {
 				if (_roomDoorId == ROOM9) {
 					_col = true;
 					_caff = 70;
-					afdes();
-					repon(2, _caff);
+					drawPictureWithText();
+					handleDescriptionText(2, _caff);
 				} else
 					_col = false;
 				resetRoomVariables(_roomDoorId);
@@ -1190,12 +1190,12 @@ void MortevielleEngine::fctSleep() {
 		exitRoom();
 		_coreVar._currPlace = OWN_ROOM;
 		affrep();
-		afdes();
+		drawPictureWithText();
 		resetRoomVariables(_coreVar._currPlace);
 		_menu.setDestinationText(_coreVar._currPlace);
 	}
-	clearScreenType3();
-	clearScreenType2();
+	clearVerbBar();
+	clearDescriptionBar();
 	prepareScreenType2();
 	ecr2(getEngineString(S_WANT_TO_WAKE_UP));
 	updateHour(j, h, m);
@@ -1285,7 +1285,7 @@ void MortevielleEngine::fctLeave() {
  */
 void MortevielleEngine::fctWait() {
 	_savedBitIndex = 0;
-	clearScreenType3();
+	clearVerbBar();
 
 	int answer;
 	do {
@@ -1304,7 +1304,7 @@ void MortevielleEngine::fctWait() {
 				prepareRoom();
 			return;
 		}
-		repon(2, 102);
+		handleDescriptionText(2, 102);
 		answer = Alert::show(getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
 	_crep = 998;
@@ -1347,8 +1347,8 @@ void MortevielleEngine::fctDiscuss() {
 			++cx;
 		} while (_menu._discussMenu[cx] != _msg[4]);
 		_caff = 69 + cx;
-		afdes();
-		repon(2, _caff);
+		drawPictureWithText();
+		handleDescriptionText(2, _caff);
 		suj = _caff + 60;
 	}
 	testKey(false);
@@ -1522,7 +1522,7 @@ void MortevielleEngine::fctDiscuss() {
 	affrep();
 	/* chech;*/
 	_menu.setDestinationText(_coreVar._currPlace);
-	clearScreenType3();
+	clearVerbBar();
 }
 
 /**
@@ -1565,10 +1565,10 @@ void MortevielleEngine::endGame() {
 	_quitGame = true;
 	tlu(13, 152);
 	displayEmptyHand();
-	clearScreenType1();
-	clearScreenType2();
-	clearScreenType3();
-	repon(9, 1509);
+	clearUpperLeftPart();
+	clearDescriptionBar();
+	clearVerbBar();
+	handleDescriptionText(9, 1509);
 	testKey(false);
 	_mouse.hideMouse();
 	_caff = 70;
@@ -1577,14 +1577,14 @@ void MortevielleEngine::endGame() {
 	premtet();
 	startDialog(141);
 	_mouse.showMouse();
-	clearScreenType1();
-	repon(9, 1509);
-	repon(2, 142);
+	clearUpperLeftPart();
+	handleDescriptionText(9, 1509);
+	handleDescriptionText(2, 142);
 	testKey(false);
 	_caff = 32;
-	afdes();
-	repon(6, 34);
-	repon(2, 35);
+	drawPictureWithText();
+	handleDescriptionText(6, 34);
+	handleDescriptionText(2, 35);
 	startMusicOrSpeech(0);
 	testKey(false);
 	// A wait message was displayed.
@@ -1600,7 +1600,7 @@ void MortevielleEngine::endGame() {
  * @remarks	Originally called 'tencore'
  */
 void MortevielleEngine::askRestart() {
-	clearScreenType2();
+	clearDescriptionBar();
 	startMusicOrSpeech(0);
 	testKey(false);
 	displayEmptyHand();
@@ -1612,7 +1612,7 @@ void MortevielleEngine::askRestart() {
 	_minute = 0;
 	_hour = 10;
 	_day = 0;
-	repon(2, 180);
+	handleDescriptionText(2, 180);
 
 	int answer = Alert::show(getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index b2be026..f0f4452 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -462,7 +462,7 @@ void f3f8::aff50(bool drawAni50Fl) {
 	if (drawAni50Fl)
 		ani50();
 	else
-		g_vm->repon(2, kDialogStringIndex + 142);
+		g_vm->handleDescriptionText(2, kDialogStringIndex + 142);
 
 	// Draw the f3/f8 dialog
 	draw();
@@ -474,7 +474,7 @@ void f3f8::ani50() {
 	g_vm->_crep = g_vm->animof(2, 1);
 	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
 	g_vm->_largestClearScreen = (g_vm->_res == 1);
-	g_vm->repon(2, kDialogStringIndex + 143);
+	g_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 9f41292..a6fda73 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -635,7 +635,7 @@ void MortevielleEngine::handleAction() {
 	char inkey = '\0';
 	bool oo, funct = 0;
 
-	clearScreenType3();
+	clearVerbBar();
 	oo = false;
 	_controlMenu = 0;
 	if (!_keyPressedEsc) {
@@ -690,7 +690,7 @@ void MortevielleEngine::handleAction() {
 		if ((funct) && (inkey != '\77'))
 			return;
 		if (temps > lim) {
-			repon(2, 141);
+			handleDescriptionText(2, 141);
 			if (_num == 9999)
 				_num = 0;
 		} else {
@@ -722,10 +722,10 @@ void MortevielleEngine::handleAction() {
 					g_vm->_text.taffich();
 					if (_okdes) {
 						_okdes = false;
-						dessin();
+						drawPicture();
 					}
 					if ((!_syn) || (_col))
-						repon(2, _crep);
+						handleDescriptionText(2, _crep);
 				}
 			} while (_syn);
 			if (_controlMenu != 0)
@@ -883,7 +883,7 @@ void MortevielleEngine::showPeoplePresent(int bitIndex) {
 	for (int i = 1; i <= 8; ++i)
 		_menu.disableMenuItem(_menu._discussMenu[i]);
 
-	clearScreenType10();
+	clearUpperRightPart();
 	if ((bitIndex & 128) == 128) {
 		_screenSurface.putxy(xp, 24);
 		_screenSurface.drawString("LEO", 4);
@@ -1082,7 +1082,7 @@ void MortevielleEngine::displayAloneText() {
 	Common::String sAre = getEngineString(S_ARE);
 	Common::String sAlone = getEngineString(S_ALONE);
 
-	clearScreenType10();
+	clearUpperRightPart();
 	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
 	_screenSurface.drawString(sYou, 4);
 	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
@@ -1687,11 +1687,11 @@ void MortevielleEngine::loseGame() {
 		getPresence(MANOR_FRONT);
 
 	_loseGame = true;
-	clearScreenType1();
+	clearUpperLeftPart();
 	_screenSurface.drawBox(60, 35, 400, 50, 15);
-	repon(9, _crep);
-	clearScreenType2();
-	clearScreenType3();
+	handleDescriptionText(9, _crep);
+	clearDescriptionBar();
+	clearVerbBar();
 	_col = false;
 	_syn = false;
 	_okdes = false;
@@ -1776,9 +1776,9 @@ void MortevielleEngine::gotoDiningRoom() {
 		_currBitIndex = 255; // Everybody is present
 		showPeoplePresent(_currBitIndex);
 		_caff = 77;
-		afdes();
+		drawPictureWithText();
 		_screenSurface.drawBox(223, 47, 155, 91, 15);
-		repon(2, 33);
+		handleDescriptionText(2, 33);
 		testKey(false);
 		mennor();
 		_mouse.hideMouse();
@@ -1861,11 +1861,11 @@ void MortevielleEngine::changeGraphicalDevice(int newDevice) {
 		showPeoplePresent(_currBitIndex);
 	else
 		displayAloneText();
-	clearScreenType2();
-	clearScreenType3();
+	clearDescriptionBar();
+	clearVerbBar();
 	_maff = 68;
-	afdes();
-	repon(2, _crep);
+	drawPictureWithText();
+	handleDescriptionText(2, _crep);
 	_menu.displayMenu();
 }
 
@@ -1911,9 +1911,9 @@ void MortevielleEngine::gameLoaded() {
 	displayAloneText();
 	prepareRoom();
 	drawClock();
-	afdes();
-	repon(2, _crep);
-	clearScreenType3();
+	drawPictureWithText();
+	handleDescriptionText(2, _crep);
+	clearVerbBar();
 	_endGame = false;
 	_menu.setDestinationText(_coreVar._currPlace);
 	_menu.setInventoryText();
@@ -1928,7 +1928,7 @@ void MortevielleEngine::gameLoaded() {
  */
 void MortevielleEngine::handleOpcode() {
 	if (!_col)
-		clearScreenType2();
+		clearDescriptionBar();
 	_syn = false;
 	_keyPressedEsc = false;
 	if (!_anyone) {
@@ -2063,20 +2063,20 @@ void MortevielleEngine::charToHour() {
 }
 
 /**
- * Engine function - Clear Screen - Type 1
+ * Engine function - Clear upper left part of Screen - Type 1
  * @remarks	Originally called 'clsf1'
  */
-void MortevielleEngine::clearScreenType1() {
+void MortevielleEngine::clearUpperLeftPart() {
 	_mouse.hideMouse();
 	_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
 	_mouse.showMouse();
 }
 
 /**
- * Engine function - Clear Screen - Type 2
+ * Engine function - Clear low bar used by description
  * @remarks	Originally called 'clsf2'
  */
-void MortevielleEngine::clearScreenType2() {
+void MortevielleEngine::clearDescriptionBar() {
 	_mouse.hideMouse();
 	if (_largestClearScreen) {
 		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
@@ -2090,10 +2090,10 @@ void MortevielleEngine::clearScreenType2() {
 }
 
 /**
- * Engine function - Clear Screen - Type 3
+ * Engine function - Clear lowest bar used by verbs
  * @remarks	Originally called 'clsf3'
  */
-void MortevielleEngine::clearScreenType3() {
+void MortevielleEngine::clearVerbBar() {
 	_mouse.hideMouse();
 	_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
 	_screenSurface.drawBox(0, 191, 634, 8, 15);
@@ -2101,22 +2101,23 @@ void MortevielleEngine::clearScreenType3() {
 }
 
 /**
- * Engine function - Clear Screen - Type 10
+ * Engine function - Clear upper right part of the screen
  * @remarks	Originally called 'clsf10'
  */
-void MortevielleEngine::clearScreenType10() {
-	int co, cod;
+void MortevielleEngine::clearUpperRightPart() {
+	int x1, x2;
 	Common::String st;
 
 	_mouse.hideMouse();
 	if (_res == 1) {
-		co = 634;
-		cod = 534;
+		x2 = 634;
+		x1 = 534;
 	} else {
-		co = 600;
-		cod = 544;
+		x2 = 600;
+		x1 = 544;
 	}
-	_screenSurface.fillRect(15, Common::Rect(cod, 93, co, 98));
+	// Clear ambiance description
+	_screenSurface.fillRect(15, Common::Rect(x1, 93, x2, 98));
 	if (_coreVar._faithScore < 33)
 		st = getEngineString(S_COOL);
 	else if (_coreVar._faithScore < 66)
@@ -2124,12 +2125,12 @@ void MortevielleEngine::clearScreenType10() {
 	else if (_coreVar._faithScore > 65)
 		st = getEngineString(S_MALSAINE);
 
-	co = 580 - (_screenSurface.getStringWidth(st) / 2);
-	_screenSurface.putxy(co, 92);
+	x1 = 580 - (_screenSurface.getStringWidth(st) / 2);
+	_screenSurface.putxy(x1, 92);
 	_screenSurface.drawString(st, 4);
 
+	// Clear person list
 	_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
-	/* rempli(69,12,32,5,255);*/
 	_mouse.showMouse();
 }
 
@@ -2555,7 +2556,7 @@ void MortevielleEngine::music() {
  */
 void MortevielleEngine::showTitleScreen() {
 	hirs();
-	repon(7, 2035);
+	handleDescriptionText(7, 2035);
 	_caff = 51;
 	_text.taffich();
 	testKeyboard();
@@ -2736,12 +2737,12 @@ void MortevielleEngine::prepareRoom() {
 						_brt = true;
 						_startHour = readclock();
 						if (getRandomNumber(1, 5) < 5) {
-							clearScreenType3();
+							clearVerbBar();
 							prepareScreenType2();
 							ecr3(getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
 							_speechManager.startSpeech(1, rand, 1);
-							clearScreenType3();
+							clearVerbBar();
 						}
 					}
 				}
@@ -2860,7 +2861,7 @@ void MortevielleEngine::initCaveOrCellar() {
 	_coreVar._faithScore += 2;
 	if (_coreVar._faithScore > 69)
 		_coreVar._faithScore += (_coreVar._faithScore / 10);
-	clearScreenType3();
+	clearVerbBar();
 	prepareScreenType2();
 	ecr3(getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
@@ -2869,7 +2870,7 @@ void MortevielleEngine::initCaveOrCellar() {
 	// The original was doing here a useless loop.
 	// It has been removed
 
-	clearScreenType3();
+	clearVerbBar();
 	displayAloneText();
 }
 
@@ -2878,7 +2879,7 @@ void MortevielleEngine::initCaveOrCellar() {
  * @remarks	Originally called 'tctrm'
  */
 void MortevielleEngine::displayControlMenu() {
-	repon(2, (3000 + _controlMenu));
+	handleDescriptionText(2, (3000 + _controlMenu));
 	_controlMenu = 0;
 }
 
@@ -2933,41 +2934,49 @@ int MortevielleEngine::animof(int ouf, int num) {
 	return animof_result;
 }
 
-void MortevielleEngine::text1(int x, int y, int nb, int m) {
+/**
+ * Display text in description bar
+ * @remarks	Originally called 'text1'
+ */
+void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int mesgId) {
 	int co;
 
 	if (_res == 1)
 		co = 10;
 	else
 		co = 6;
-	Common::String tmpStr = getString(m);
+	Common::String tmpStr = getString(mesgId);
 	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
 		y = 176;
 	_text.displayStr(tmpStr, x, y, nb, 20, _textColor);
 }
 
-void MortevielleEngine::repon(int f, int m) {
-	if ((m > 499) && (m < 563)) {
-		Common::String tmpStr = getString(m - 501 + kInventoryStringIndex);
+/**
+ * Display description text
+ * @remarks	Originally called 'repon'
+ */
+void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
+	if ((mesgId > 499) && (mesgId < 563)) {
+		Common::String tmpStr = getString(mesgId - 501 + kInventoryStringIndex);
 
 		if ((int) tmpStr.size() > ((58 + (_res - 1) * 37) << 1))
 			_largestClearScreen = true;
 		else
 			_largestClearScreen = false;
 
-		clearScreenType2();
+		clearDescriptionBar();
 		_text.displayStr(tmpStr, 8, 176, 85, 3, 5);
 	} else {
-		modif(m);
+		mapMessageId(mesgId);
 		switch (f) {
 		case 2:
 		case 8:
-			clearScreenType2();
+			clearDescriptionBar();
 			prepareScreenType2();
-			text1(8, 182, 103, m);
-			if ((m == 68) || (m == 69))
+			displayTextInDescriptionBar(8, 182, 103, mesgId);
+			if ((mesgId == 68) || (mesgId == 69))
 				_coreVar._teauto[40] = '*';
-			if ((m == 104) && (_caff == 14)) {
+			if ((mesgId == 104) && (_caff == 14)) {
 				_coreVar._teauto[36] = '*';
 				if (_coreVar._teauto[39] == '*') {
 					_coreVar._pourc[3] = '*';
@@ -2984,12 +2993,12 @@ void MortevielleEngine::repon(int f, int m) {
 			else
 				i = 5;
 
-			Common::String tmpStr = getString(m);
+			Common::String tmpStr = getString(mesgId);
 			_text.displayStr(tmpStr, 80, 40, 60, 25, i);
 
-			if (m == 180)
+			if (mesgId == 180)
 				_coreVar._pourc[6] = '*';
-			else if (m == 179)
+			else if (mesgId == 179)
 				_coreVar._pourc[10] = '*';
 			}
 			break;
@@ -2999,43 +3008,47 @@ void MortevielleEngine::repon(int f, int m) {
 	}
 }
 
-void MortevielleEngine::modif(int &nu) {
-	if (nu == 26)
-		nu = 25;
-	else if ((nu > 29) && (nu < 36))
-		nu -= 4;
-	else if ((nu > 69) && (nu < 78))
-		nu -= 37;
-	else if ((nu > 99) && (nu < 194))
-		nu -= 59;
-	else if ((nu > 996) && (nu < 1000))
-		nu -= 862;
-	else if ((nu > 1500) && (nu < 1507))
-		nu -= 1363;
-	else if ((nu > 1507) && (nu < 1513))
-		nu -= 1364;
-	else if ((nu > 1999) && (nu < 2002))
-		nu -= 1851;
-	else if (nu == 2010)
-		nu = 151;
-	else if ((nu > 2011) && (nu < 2025))
-		nu -= 1860;
-	else if (nu == 2026)
-		nu = 165;
-	else if ((nu > 2029) && (nu < 2037))
-		nu -= 1864;
-	else if ((nu > 3000) && (nu < 3005))
-		nu -= 2828;
-	else if (nu == 4100)
-		nu = 177;
-	else if (nu == 4150)
-		nu = 178;
-	else if ((nu > 4151) && (nu < 4156))
-		nu -= 3973;
-	else if (nu == 4157)
-		nu = 183;
-	else if ((nu == 4160) || (nu == 4161))
-		nu -= 3976;
+/**
+ * Recompute message Id
+ * @remarks	Originally called 'modif'
+ */
+void MortevielleEngine::mapMessageId(int &mesgId) {
+	if (mesgId == 26)
+		mesgId = 25;
+	else if ((mesgId > 29) && (mesgId < 36))
+		mesgId -= 4;
+	else if ((mesgId > 69) && (mesgId < 78))
+		mesgId -= 37;
+	else if ((mesgId > 99) && (mesgId < 194))
+		mesgId -= 59;
+	else if ((mesgId > 996) && (mesgId < 1000))
+		mesgId -= 862;
+	else if ((mesgId > 1500) && (mesgId < 1507))
+		mesgId -= 1363;
+	else if ((mesgId > 1507) && (mesgId < 1513))
+		mesgId -= 1364;
+	else if ((mesgId > 1999) && (mesgId < 2002))
+		mesgId -= 1851;
+	else if (mesgId == 2010)
+		mesgId = 151;
+	else if ((mesgId > 2011) && (mesgId < 2025))
+		mesgId -= 1860;
+	else if (mesgId == 2026)
+		mesgId = 165;
+	else if ((mesgId > 2029) && (mesgId < 2037))
+		mesgId -= 1864;
+	else if ((mesgId > 3000) && (mesgId < 3005))
+		mesgId -= 2828;
+	else if (mesgId == 4100)
+		mesgId = 177;
+	else if (mesgId == 4150)
+		mesgId = 178;
+	else if ((mesgId > 4151) && (mesgId < 4156))
+		mesgId -= 3973;
+	else if (mesgId == 4157)
+		mesgId = 183;
+	else if ((mesgId == 4160) || (mesgId == 4161))
+		mesgId -= 3976;
 }
 
 void MortevielleEngine::initouv() {
@@ -3057,7 +3070,7 @@ void MortevielleEngine::ecr2(Common::String text) {
 		_screenSurface.drawString(copy(text, tlig, tlig << 1), 5);
 	} else {
 		_largestClearScreen = true;
-		clearScreenType2();
+		clearDescriptionBar();
 		_screenSurface.putxy(8, 176);
 		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
 		_screenSurface.putxy(8, 182);
@@ -3068,7 +3081,7 @@ void MortevielleEngine::ecr2(Common::String text) {
 }
 
 void MortevielleEngine::ecr3(Common::String text) {
-	clearScreenType3();
+	clearVerbBar();
 	_screenSurface.putxy(8, 192);
 	_screenSurface.drawString(text, 5);
 }
@@ -3296,8 +3309,12 @@ void MortevielleEngine::aniof(int ouf, int num) {
 	prepareScreenType1();
 }
 
-void MortevielleEngine::dessin() {
-	clearScreenType1();
+/**
+ * Draw Picture
+ * @remarks	Originally called 'dessin'
+ */
+void MortevielleEngine::drawPicture() {
+	clearUpperLeftPart();
 	if (_caff > 99) {
 		draw(kAdrDes, 60, 33);
 		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
@@ -3332,9 +3349,9 @@ void MortevielleEngine::dessin() {
 	}
 }
 
-void MortevielleEngine::afdes() {
+void MortevielleEngine::drawPictureWithText() {
 	_text.taffich();
-	dessin();
+	drawPicture();
 	_okdes = false;
 }
 
@@ -3374,9 +3391,9 @@ void MortevielleEngine::testKey(bool d) {
 
 void MortevielleEngine::tlu(int af, int ob) {
 	_caff = 32;
-	afdes();
-	repon(6, ob + 4000);
-	repon(2, 999);
+	drawPictureWithText();
+	handleDescriptionText(6, ob + 4000);
+	handleDescriptionText(2, 999);
 	testKey(true);
 	_caff = af;
 	_msg[3] = OPCODE_NONE;
@@ -3517,7 +3534,7 @@ L1:
 	if (!_hiddenHero) {
 		if (_crep == 997)
 			_crep = 138;
-		repon(2, _crep);
+		handleDescriptionText(2, _crep);
 		if (_crep == 138)
 			_speechManager.startSpeech(5, 2, 1);
 		else
@@ -3544,10 +3561,10 @@ L1:
 			_crep = 137;
 			goto L1;
 		} else {
-			repon(2, 136);
+			handleDescriptionText(2, 136);
 			int rand = (getRandomNumber(0, 4)) - 2;
 			_speechManager.startSpeech(3, rand, 1);
-			clearScreenType2();
+			clearDescriptionBar();
 			displayAloneText();
 			resetRoomVariables(MANOR_FRONT);
 			affrep();
@@ -3677,11 +3694,11 @@ void MortevielleEngine::treg(int objId) {
 	_caff = objId;
 
 	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_msg[4] == OPCODE_SLOOK)) {
-		afdes();
+		drawPictureWithText();
 		if ((_caff > 29) && (_caff < 33))
-			repon(2, _caff);
+			handleDescriptionText(2, _caff);
 		else
-			repon(2, _caff + 400);
+			handleDescriptionText(2, _caff + 400);
 		testKey(true);
 		_caff = mdes;
 		_msg[3] = 0;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index ec7e86f..20390af 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -323,10 +323,10 @@ private:
 	void endSearch();
 	int convertCharacterIndexToBitIndex(int characterIndex);
 	int convertBitIndexToCharacterIndex(int bitIndex);
-	void clearScreenType1();
-	void clearScreenType2();
-	void clearScreenType3();
-	void clearScreenType10();
+	void clearUpperLeftPart();
+	void clearDescriptionBar();
+	void clearVerbBar();
+	void clearUpperRightPart();
 	int  getRandomNumber(int minval, int maxval);
 	void showMoveMenuAlert();
 	void showConfigScreen();
@@ -424,8 +424,8 @@ private:
 	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
 	void copcha();
 	void adzon();
-	void text1(int x, int y, int nb, int m);
-	void modif(int &nu);
+	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
+	void mapMessageId(int &mesgId);
 	void initouv();
 	void phaz(int &rand, int &p, int cf);
 	void writetp(Common::String s, int t);
@@ -437,8 +437,8 @@ private:
 	void ecr3(Common::String text);
 	void init_nbrepm();
 	void aniof(int ouf, int num);
-	void dessin();
-	void afdes();
+	void drawPicture();
+	void drawPictureWithText();
 	void tlu(int af, int ob);
 	void affrep();
 	void mennor();
@@ -522,7 +522,7 @@ public:
 
 	void hirs();
 	int  testou();
-	void repon(int f, int m);
+	void handleDescriptionText(int f, int mesgId);
 	int  animof(int ouf, int num);
 	void pictout(int seg, int dep, int x, int y);
 	void sauvecr(int y, int dy);


Commit: b06701e104cf09d1116913ea641afdcbfac06123
    https://github.com/scummvm/scummvm/commit/b06701e104cf09d1116913ea641afdcbfac06123
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-11T22:31:30-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 2e4a237..9aca451 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -52,7 +52,7 @@ void MortevielleEngine::fctMove() {
 		tfleche();
 
 		if (_keyPressedEsc)
-			_okdes = false;
+			_destinationOk = false;
 
 		if ((_anyone) || (_keyPressedEsc))
 			return;
@@ -180,7 +180,7 @@ void MortevielleEngine::fctMove() {
 void MortevielleEngine::fctTake() {
 	if (_caff > 99) {
 		int cx = _caff;
-		avpoing(cx);
+		putInHand(cx);
 		if (_crep != 139) {
 			if (_currBitIndex > 0)
 				_coreVar._faithScore += 3;
@@ -236,34 +236,34 @@ void MortevielleEngine::fctTake() {
 				_coreVar._faithScore += 3;
 			_crep = 997;
 			if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
-				avpoing(_coreVar._purpleRoomObjectId);
+				putInHand(_coreVar._purpleRoomObjectId);
 			if ((_coreVar._currPlace == ATTIC) && (_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
-				avpoing(_coreVar._atticBallHoleObjectId);
+				putInHand(_coreVar._atticBallHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 7);
 			}
 			if ((_coreVar._currPlace == ATTIC) && (_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
-				avpoing(_coreVar._atticRodHoleObjectId);
+				putInHand(_coreVar._atticRodHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 6);
 			}
 			if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
-				avpoing(_coreVar._cellarObjectId);
+				putInHand(_coreVar._cellarObjectId);
 				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 2);
 			}
 			if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
-				avpoing(_coreVar._cryptObjectId);
+				putInHand(_coreVar._cryptObjectId);
 
 			if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId != 0)) {
-				avpoing(_coreVar._secretPassageObjectId);
+				putInHand(_coreVar._secretPassageObjectId);
 				if ((_crep != 997) && (_crep != 139)) {
 					_crep = 182;
 					aniof(2, 1);
 				}
 			}
 			if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
-				avpoing(_coreVar._wellObjectId);
+				putInHand(_coreVar._wellObjectId);
 				if ((_crep != 997) && (_crep != 139))
 					aniof(2, 1);
 			}
@@ -312,7 +312,7 @@ void MortevielleEngine::fctInventoryTake() {
 	cz = ord(_coreVar._sjer[cy]);
 	_coreVar._sjer[cy] = chr(0);
 	_menu.setInventoryText();
-	avpoing(cz);
+	putInHand(cz);
 	_crep = 998;
 	clearDescriptionBar();
 }
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index a6fda73..df80408 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -102,9 +102,9 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_col = false;
 	_syn = false;
 	_obpart = false;
-	_okdes = false;
+	_destinationOk = false;
 	_anyone = false;
-	_brt = false;
+	_uptodatePresence = false;
 
 	_textColor = 0;
 	_currGraphicalDevice = -1;
@@ -116,7 +116,6 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_day = 0;
 
 	memset(_mem, 0, sizeof(_mem));
-	_anyone = false;
 }
 
 MortevielleEngine::~MortevielleEngine() {
@@ -720,8 +719,8 @@ void MortevielleEngine::handleAction() {
 
 				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
 					g_vm->_text.taffich();
-					if (_okdes) {
-						_okdes = false;
+					if (_destinationOk) {
+						_destinationOk = false;
 						drawPicture();
 					}
 					if ((!_syn) || (_col))
@@ -1694,7 +1693,7 @@ void MortevielleEngine::loseGame() {
 	clearVerbBar();
 	_col = false;
 	_syn = false;
-	_okdes = false;
+	_destinationOk = false;
 }
 
 /**
@@ -1810,7 +1809,7 @@ void MortevielleEngine::checkManorDistance() {
 		_crep = 1506;
 		loseGame();
 	} else {
-		_okdes = true;
+		_destinationOk = true;
 		_coreVar._currPlace = MOUNTAIN;
 		affrep();
 	}
@@ -1878,10 +1877,10 @@ void MortevielleEngine::gameLoaded() {
 	_menu._menuDisplayed = false;
 	_loseGame = true;
 	_anyone = false;
-	_okdes = true;
+	_destinationOk = true;
 	_col = false;
 	_hiddenHero = false;
-	_brt = false;
+	_uptodatePresence = false;
 	_maff = 68;
 	_menuOpcode = OPCODE_NONE;
 	_prebru = 0;
@@ -1903,7 +1902,7 @@ void MortevielleEngine::gameLoaded() {
 	affrep();
 	_hintPctMessage = getString(580);
 
-	_okdes = false;
+	_destinationOk = false;
 	_endGame = true;
 	_loseGame = false;
 	_heroSearching = false;
@@ -1932,7 +1931,7 @@ void MortevielleEngine::handleOpcode() {
 	_syn = false;
 	_keyPressedEsc = false;
 	if (!_anyone) {
-		if (_brt) {
+		if (_uptodatePresence) {
 			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
 				_controlMenu = 4;
 				mennor();
@@ -2733,8 +2732,8 @@ void MortevielleEngine::prepareRoom() {
 					initCaveOrCellar();
 				} else if (_currBitIndex == 10) {
 					_currBitIndex = 0;
-					if (!_brt) {
-						_brt = true;
+					if (!_uptodatePresence) {
+						_uptodatePresence = true;
 						_startHour = readclock();
 						if (getRandomNumber(1, 5) < 5) {
 							clearVerbBar();
@@ -2753,9 +2752,9 @@ void MortevielleEngine::prepareRoom() {
 		}
 	}
 	_endHour = readclock();
-	if ((_brt) && ((_endHour - _startHour) > 17)) {
+	if ((_uptodatePresence) && ((_endHour - _startHour) > 17)) {
 		getPresenceBitIndex(_place);
-		_brt = false;
+		_uptodatePresence = false;
 		_startHour = 0;
 		if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
 			_anyone = true;
@@ -3352,7 +3351,7 @@ void MortevielleEngine::drawPicture() {
 void MortevielleEngine::drawPictureWithText() {
 	_text.taffich();
 	drawPicture();
-	_okdes = false;
+	_destinationOk = false;
 }
 
 /**
@@ -3710,7 +3709,11 @@ void MortevielleEngine::treg(int objId) {
 	}
 }
 
-void MortevielleEngine::avpoing(int &objId) {
+/**
+ * Engine function - Put in hand
+ * @remarks	Originally called 'avpoing'
+ */
+void MortevielleEngine::putInHand(int &objId) {
 	_crep = 999;
 	if (_coreVar._selectedObjectId != 0)
 		ajjer(_coreVar._selectedObjectId);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 20390af..390ff7a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -243,7 +243,7 @@ private:
 	bool _syn;
 	bool _obpart;
 	bool _anyone;
-	bool _brt;
+	bool _uptodatePresence;
 
 	int  _textColor;
 	int  _place;
@@ -445,7 +445,7 @@ private:
 	void ajjer(int ob);
 	void tsuiv();
 	void treg(int objId);
-	void avpoing(int &objId);
+	void putInHand(int &objId);
 	void rechai(int &ch);
 	void fenat(char ans);
 
@@ -456,7 +456,7 @@ public:
 	byte _tabdon[4001];
 	bool _soundOff;
 	bool _blo;
-	bool _okdes;
+	bool _destinationOk;
 	bool _largestClearScreen;
 	int  _currGraphicalDevice;
 	int  _newGraphicalDevice;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 9e903bb..e105002 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -242,7 +242,7 @@ void TextHandler::taffich() {
 		break;
 	}
 
-	g_vm->_okdes = true;
+	g_vm->_destinationOk = true;
 	g_vm->_mouse.hideMouse();
 	lgt = 0;
 	Common::String filename;


Commit: ef7681aa8157db7e82c1c3572cb7ba76589e92d5
    https://github.com/scummvm/scummvm/commit/ef7681aa8157db7e82c1c3572cb7ba76589e92d5
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-11T22:46:58-07:00

Commit Message:
MORTEVIELLE: Remove dead code.

m was computed to in order to display a message while loading the next
resource. As there are no more delays, the message isn't displayed anymore,
thus it's useless to compute the message id.

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 9aca451..5bcaf4c 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -512,7 +512,6 @@ void MortevielleEngine::fctSearch() {
 				rechai(_mchai);
 				if (_mchai != 0) {
 					_cs = 0;
-					_is = 0;
 					_heroSearching = true;
 					_menu.setSearchMenu();
 					tsuiv();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index df80408..e4e9610 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -1753,7 +1753,6 @@ void MortevielleEngine::endSearch() {
 	_heroSearching = false;
 	_obpart = false;
 	_cs = 0;
-	_is = 0;
 	_menu.unsetSearchMenu();
 }
 
@@ -1890,7 +1889,6 @@ void MortevielleEngine::gameLoaded() {
 	_startHour = 0;
 	_endHour = 0;
 	_cs = 0;
-	_is = 0;
 	_roomDoorId = OWN_ROOM;
 	_syn = true;
 	_heroSearching = true;
@@ -3584,8 +3582,7 @@ void MortevielleEngine::tsuiv() {
 		tbcl = _tabdon[cl];
 	} while ((tbcl == 0) && (_cs <= 9));
 
-	if ((tbcl != 0) && (_cs < 11)) { // 2nd check useless as _cs is <= 10
-		++_is;
+	if ((tbcl != 0) && (_cs < 11)) {
 		_caff = tbcl;
 		_crep = _caff + 400;
 		if (_currBitIndex != 0)
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 390ff7a..59fd6f6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -470,7 +470,7 @@ public:
 	int _res;
 	int _caff;
 	int _crep;
-	byte _is;
+//	byte _is;
 	byte _v_lieu[7][25];
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e105002..e18c5c1 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -248,29 +248,6 @@ void TextHandler::taffich() {
 	Common::String filename;
 
 	if ((a != 50) && (a != 51)) {
-		int m = a + 2000;
-		if ((m > 2001) && (m < 2010))
-			m = 2001;
-		if (m == 2011)
-			m = 2010;
-		if (a == 32)
-			m = 2034;
-		if ((a == 17) && (g_vm->_maff == 14))
-			m = 2018;
-
-		if (a > 99) {
-			if ((g_vm->_is == 1) || (g_vm->_is == 0))
-				m = 2031;
-			else
-				m = 2032;
-		}
-
-		if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
-			m = 2030;
-
-		if (((a < 27) && (((g_vm->_maff > 69) && (!g_vm->_coreVar._alreadyEnteredManor)) || (g_vm->_maff > 99))) || ((g_vm->_maff > 29) && (g_vm->_maff < 33)))
-			m = 2033;
-
 		g_vm->_maff = a;
 		if (a == 159)
 			a = 86;


Commit: dd3e3a4062321f27ddbf6c4a841aa2f3a82ed0a6
    https://github.com/scummvm/scummvm/commit/dd3e3a4062321f27ddbf6c4a841aa2f3a82ed0a6
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-13T03:10:48-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5bcaf4c..1bf64cc 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -205,7 +205,7 @@ void MortevielleEngine::fctTake() {
 				_obpart = false;
 				affrep();
 			} else {
-				_tabdon[kAcha + ((_mchai - 1) * 10) + _cs - 1] = 0;
+				_tabdon[kAcha + ((_mchai - 1) * 10) + _searchCount - 1] = 0;
 				tsuiv();
 				++_takeObjCount;
 				if (_takeObjCount > 6) {
@@ -502,8 +502,8 @@ void MortevielleEngine::fctSearch() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (_num != ord(_touv[cx])));
-			if (_num != ord(_touv[cx]))
+			} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
+			if (_num != ord(_openObjects[cx]))
 				_crep = 187;
 			else {
 				if (_currBitIndex > 0)
@@ -511,7 +511,7 @@ void MortevielleEngine::fctSearch() {
 
 				rechai(_mchai);
 				if (_mchai != 0) {
-					_cs = 0;
+					_searchCount = 0;
 					_heroSearching = true;
 					_menu.setSearchMenu();
 					tsuiv();
@@ -590,7 +590,7 @@ void MortevielleEngine::fctOpen() {
 		return;
 	}
 
-	if (_caff == 15) {
+	if (_caff == LANDING) {
 		showMoveMenuAlert();
 		return;
 	}
@@ -607,21 +607,31 @@ void MortevielleEngine::fctOpen() {
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
-		} while (!((tmpPlace > 6) || (ord(_touv[tmpPlace]) == 0) || (ord(_touv[tmpPlace]) == _num)));
-		if (ord(_touv[tmpPlace]) != _num) {
-			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == ROOM9) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM)))
-			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == RED_ROOM)))
+		} while (!((tmpPlace > 6) || (ord(_openObjects[tmpPlace]) == 0) || (ord(_openObjects[tmpPlace]) == _num)));
+		if (ord(_openObjects[tmpPlace]) != _num) {
+			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM)
+				                 || (_coreVar._currPlace == ROOM9) 
+								 || (_coreVar._currPlace == BLUE_ROOM) 
+								 || (_coreVar._currPlace == BATHROOM)))
+			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) 
+				                 || (_coreVar._currPlace == PURPLE_ROOM)
+								 || (_coreVar._currPlace == RED_ROOM)))
 				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (_num == 5))
-				|| ((_num == 6) && ((_coreVar._currPlace == BATHROOM) || (_coreVar._currPlace == DINING_ROOM) || (_coreVar._currPlace == GREEN_ROOM2) || (_coreVar._currPlace == ATTIC)))
+				|| ((_num == 6) && ((_coreVar._currPlace == BATHROOM)
+				                 || (_coreVar._currPlace == DINING_ROOM)
+								 || (_coreVar._currPlace == GREEN_ROOM2)
+								 || (_coreVar._currPlace == ATTIC)))
 				|| ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 2))
 				|| ((_coreVar._currPlace == KITCHEN) && (_num == 7))) ) {
 				if ( ((_coreVar._currPlace > DINING_ROOM) && (_coreVar._currPlace < CELLAR))
 				  || ((_coreVar._currPlace > RED_ROOM) && (_coreVar._currPlace < DINING_ROOM))
-				  || (_coreVar._currPlace == OWN_ROOM) || (_coreVar._currPlace == PURPLE_ROOM) || (_coreVar._currPlace == BLUE_ROOM)) {
+				  || (_coreVar._currPlace == OWN_ROOM)
+				  || (_coreVar._currPlace == PURPLE_ROOM)
+				  || (_coreVar._currPlace == BLUE_ROOM)) {
 					if (getRandomNumber(1, 4) == 3)
 						_speechManager.startSpeech(7, 9, 1);
 				}
-				_touv[tmpPlace] = chr(_num);
+				_openObjects[tmpPlace] = chr(_num);
 				aniof(1, _num);
 			}
 			tmpPlace = _coreVar._currPlace;
@@ -631,6 +641,7 @@ void MortevielleEngine::fctOpen() {
 			if (_crep == 254)
 				_crep = 999;
 		} else
+			// display "Already Opened"
 			_crep = 18;
 	}
 }
@@ -874,11 +885,11 @@ void MortevielleEngine::fctClose() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (_num != ord(_touv[cx])));
-			if (_num == ord(_touv[cx])) {
+			} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
+			if (_num == ord(_openObjects[cx])) {
 				aniof(2, _num);
 				_crep = 998;
-				_touv[cx] = chr(0);
+				_openObjects[cx] = chr(0);
 				--_openObjCount;
 				if (_openObjCount < 0)
 					_openObjCount = 0;
@@ -973,8 +984,8 @@ void MortevielleEngine::fctSelfPut() {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (_num != ord(_touv[cx])));
-				if (_num != ord(_touv[cx]))
+				} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
+				if (_num != ord(_openObjects[cx]))
 					_crep = 187;
 				else {
 					_mchai = chai;
@@ -1106,7 +1117,7 @@ void MortevielleEngine::fctEat() {
 					h = 1;
 			}
 
-			_jh += h;
+			_currentHourCount += h;
 			_crep = 135;
 			prepareRoom();
 		} else {
@@ -1138,15 +1149,15 @@ void MortevielleEngine::fctEnter() {
 			if ((_roomDoorId == TOILETS) || (_roomDoorId == BATHROOM))
 				_crep = 179;
 			else {
-				_x = (getRandomNumber(0, 10)) - 5;
-				_speechManager.startSpeech(7, _x, 1);
+				int randVal = (getRandomNumber(0, 10)) - 5;
+				_speechManager.startSpeech(7, randVal, 1);
 				aniof(1, 1);
 
-				_x = convertBitIndexToCharacterIndex(z);
+				int charIndex = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
 				_msg[3] = MENU_DISCUSS;
-				_msg[4] = _menu._discussMenu[_x];
+				_msg[4] = _menu._discussMenu[charIndex];
 				_syn = true;
 				if (_roomDoorId == ROOM9) {
 					_col = true;
@@ -1159,8 +1170,8 @@ void MortevielleEngine::fctEnter() {
 				_roomDoorId = OWN_ROOM;
 			}
 		} else {
-			_x = (getRandomNumber(0, 10)) - 5;
-			_speechManager.startSpeech(7, _x, 1);
+			int randVal = (getRandomNumber(0, 10)) - 5;
+			_speechManager.startSpeech(7, randVal, 1);
 			aniof(1, 1);
 
 			_coreVar._currPlace = _roomDoorId;
@@ -1206,10 +1217,10 @@ void MortevielleEngine::fctSleep() {
 			z = (7 - h) * 2;
 			if (m == 30)
 				--z;
-			_jh += z;
+			_currentHourCount += z;
 			h = 7;
 		}
-		_jh += 2;
+		_currentHourCount += 2;
 		++h;
 		if (h > 23)
 			h = 0;
@@ -1288,7 +1299,7 @@ void MortevielleEngine::fctWait() {
 
 	int answer;
 	do {
-		++_jh;
+		++_currentHourCount;
 		prepareRoom();
 		if (!_blo)
 			getPresence(_coreVar._currPlace);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index e4e9610..68889b4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -791,7 +791,7 @@ void MortevielleEngine::prepareScreenType3() {
  */
 void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
 	int newHour = readclock();
-	int th = _jh + ((newHour - _mh) / _t);
+	int th = _currentHourCount + ((newHour - _currentDayHour) / _inGameHourDuration);
 	minute = ((th % 2) + _currHalfHour) * 30;
 	hour = ((uint)th >> 1) + _currHour;
 	if (minute == 60) {
@@ -1455,11 +1455,11 @@ int MortevielleEngine::getPresenceBitIndex(int roomId) {
  */
 void MortevielleEngine::initGame() {
 	_place = MANOR_FRONT;
-	_jh = 0;
+	_currentHourCount = 0;
 	if (!_coreVar._alreadyEnteredManor)
 		_blo = true;
-	_t = kTime1;
-	_mh = readclock();
+	_inGameHourDuration = kTime1;
+	_currentDayHour = readclock();
 }
 
 /**
@@ -1649,10 +1649,10 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
 	if (so == 0) {
 		/* musik(0) */
 		;
-	} else if ((_prebru == 0) && (!_coreVar._alreadyEnteredManor)) {
+	} else if ((!_introSpeechPlayed) && (!_coreVar._alreadyEnteredManor)) {
 		// Type 1: Speech
 		_speechManager.startSpeech(10, 1, 1);
-		++_prebru;
+		_introSpeechPlayed = true;
 	} else {
 		if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
 			// Type 1: Speech
@@ -1752,7 +1752,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 void MortevielleEngine::endSearch() {
 	_heroSearching = false;
 	_obpart = false;
-	_cs = 0;
+	_searchCount = 0;
 	_menu.unsetSearchMenu();
 }
 
@@ -1882,13 +1882,13 @@ void MortevielleEngine::gameLoaded() {
 	_uptodatePresence = false;
 	_maff = 68;
 	_menuOpcode = OPCODE_NONE;
-	_prebru = 0;
+	_introSpeechPlayed = false;
 	_x = 0;
 	_y = 0;
 	_num = 0;
 	_startHour = 0;
 	_endHour = 0;
-	_cs = 0;
+	_searchCount = 0;
 	_roomDoorId = OWN_ROOM;
 	_syn = true;
 	_heroSearching = true;
@@ -2667,22 +2667,22 @@ void MortevielleEngine::prepareRoom() {
 
 	if (!_blo) {
 		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			_t = kTime2;
+			_inGameHourDuration = kTime2;
 		else
-			_t = kTime1;
+			_inGameHourDuration = kTime1;
 		cf = _coreVar._faithScore;
 		if ((cf > 33) && (cf < 66))
-			_t -= (_t / 3);
+			_inGameHourDuration -= (_inGameHourDuration / 3);
 
 		if (cf > 65)
-			_t -= ((_t / 3) * 2);
+			_inGameHourDuration -= ((_inGameHourDuration / 3) * 2);
 
-		int nh = readclock();
-		if ((nh - _mh) > _t) {
+		int newHour = readclock();
+		if ((newHour - _currentDayHour) > _inGameHourDuration) {
 			bool activeMenu = _menu._menuActive;
 			_menu.eraseMenu();
-			_jh += ((nh - _mh) / _t);
-			_mh = nh;
+			_currentHourCount += ((newHour - _currentDayHour) / _inGameHourDuration);
+			_currentDayHour = newHour;
 			switch (_place) {
 			case GREEN_ROOM:
 			case DARKBLUE_ROOM:
@@ -3050,7 +3050,7 @@ void MortevielleEngine::mapMessageId(int &mesgId) {
 
 void MortevielleEngine::initouv() {
 	for (int cx = 1; cx <= 7; ++cx)
-		_touv[cx] = chr(0);
+		_openObjects[cx] = chr(0);
 }
 
 void MortevielleEngine::ecr2(Common::String text) {
@@ -3323,8 +3323,8 @@ void MortevielleEngine::drawPicture() {
 		prepareScreenType1();
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
-				if (ord(_touv[cx]) != 0)
-					aniof(1, ord(_touv[cx]));
+				if (ord(_openObjects[cx]) != 0)
+					aniof(1, ord(_openObjects[cx]));
 			}
 
 			if (_caff == 13) {
@@ -3415,7 +3415,7 @@ void MortevielleEngine::exitRoom() {
 	}
 
 	for (int cx = 1; cx <= 7; ++cx)
-		_touv[cx] = chr(0);
+		_openObjects[cx] = chr(0);
 	_roomDoorId = OWN_ROOM;
 	_openObjCount = 0;
 	_mchai = 0;
@@ -3577,12 +3577,12 @@ void MortevielleEngine::tsuiv() {
 	int cx = 0;
 	do {
 		++cx;
-		++_cs;
-		int cl = cy + _cs;
+		++_searchCount;
+		int cl = cy + _searchCount;
 		tbcl = _tabdon[cl];
-	} while ((tbcl == 0) && (_cs <= 9));
+	} while ((tbcl == 0) && (_searchCount <= 9));
 
-	if ((tbcl != 0) && (_cs < 11)) {
+	if ((tbcl != 0) && (_searchCount < 11)) {
 		_caff = tbcl;
 		_crep = _caff + 400;
 		if (_currBitIndex != 0)
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 59fd6f6..a57a304 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -267,23 +267,22 @@ private:
 	int  _openObjCount;
 	int  _takeObjCount;
 	int  _num;
-	int  _cs;
-	int  _prebru;
-	int  _t;
+	int  _searchCount;
+	bool _introSpeechPlayed;
+	int  _inGameHourDuration;
 	int  _x;
 	int  _y;
-	int  _jh;
-	int  _mh;
-
+	int  _currentHourCount;
+	int  _currentDayHour;
 
 	Common::String _hintPctMessage;
-	byte *_cfiecBuffer;
-	int _cfiecBufferSize;
-	byte _touv[8];
-	int  _nbrep[9];
-	int  _nbrepm[9];
+	byte  *_cfiecBuffer;
+	int    _cfiecBufferSize;
+	byte   _openObjects[8];
+	int    _nbrep[9];
+	int    _nbrepm[9];
 	uint16 _inpBuffer[kMaxTi + 1];
-	Hint _ntpBuffer[kMaxTd + 1];
+	Hint   _ntpBuffer[kMaxTd + 1];
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();


Commit: 9486525bcded9b9926b83b6741b926967ac75266
    https://github.com/scummvm/scummvm/commit/9486525bcded9b9926b83b6741b926967ac75266
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-13T03:41:27-07:00

Commit Message:
MORTEVIELLE: rework _openObjects use, rename resetOpenObjects

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 1bf64cc..2f4af85 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -502,8 +502,8 @@ void MortevielleEngine::fctSearch() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
-			if (_num != ord(_openObjects[cx]))
+			} while ((cx <= 6) && (_num != _openObjects[cx]));
+			if (_num != _openObjects[cx])
 				_crep = 187;
 			else {
 				if (_currBitIndex > 0)
@@ -607,8 +607,8 @@ void MortevielleEngine::fctOpen() {
 		int tmpPlace = 0;
 		do {
 			++tmpPlace;
-		} while (!((tmpPlace > 6) || (ord(_openObjects[tmpPlace]) == 0) || (ord(_openObjects[tmpPlace]) == _num)));
-		if (ord(_openObjects[tmpPlace]) != _num) {
+		} while (!((tmpPlace > 6) || (_openObjects[tmpPlace] == 0) || (_openObjects[tmpPlace] == _num)));
+		if (_openObjects[tmpPlace] != _num) {
 			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM)
 				                 || (_coreVar._currPlace == ROOM9) 
 								 || (_coreVar._currPlace == BLUE_ROOM) 
@@ -631,7 +631,7 @@ void MortevielleEngine::fctOpen() {
 					if (getRandomNumber(1, 4) == 3)
 						_speechManager.startSpeech(7, 9, 1);
 				}
-				_openObjects[tmpPlace] = chr(_num);
+				_openObjects[tmpPlace] = _num;
 				aniof(1, _num);
 			}
 			tmpPlace = _coreVar._currPlace;
@@ -885,11 +885,11 @@ void MortevielleEngine::fctClose() {
 			int cx = 0;
 			do {
 				++cx;
-			} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
-			if (_num == ord(_openObjects[cx])) {
+			} while ((cx <= 6) && (_num != _openObjects[cx]));
+			if (_num == _openObjects[cx]) {
 				aniof(2, _num);
 				_crep = 998;
-				_openObjects[cx] = chr(0);
+				_openObjects[cx] = 0;
 				--_openObjCount;
 				if (_openObjCount < 0)
 					_openObjCount = 0;
@@ -984,8 +984,8 @@ void MortevielleEngine::fctSelfPut() {
 				int cx = 0;
 				do {
 					++cx;
-				} while ((cx <= 6) && (_num != ord(_openObjects[cx])));
-				if (_num != ord(_openObjects[cx]))
+				} while ((cx <= 6) && (_num != _openObjects[cx]));
+				if (_num != _openObjects[cx])
 					_crep = 187;
 				else {
 					_mchai = chai;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 68889b4..088c880 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -1677,9 +1677,8 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
  * @remarks	Originally called 'tperd'
  */
 void MortevielleEngine::loseGame() {
-	initouv();
+	resetOpenObjects();
 	_roomDoorId = OWN_ROOM;
-	_openObjCount = 0;
 	_mchai = 0;
 	_menu.unsetSearchMenu();
 	if (!_blo)
@@ -1894,8 +1893,7 @@ void MortevielleEngine::gameLoaded() {
 	_heroSearching = true;
 	_mchai = 0;
 	_manorDistance = 0;
-	initouv();
-	_openObjCount = 0;
+	resetOpenObjects();
 	_takeObjCount = 0;
 	affrep();
 	_hintPctMessage = getString(580);
@@ -3048,9 +3046,14 @@ void MortevielleEngine::mapMessageId(int &mesgId) {
 		mesgId -= 3976;
 }
 
-void MortevielleEngine::initouv() {
+/**
+ * Initialize open objects array
+ * @remarks	Originally called 'initouv'
+ */
+void MortevielleEngine::resetOpenObjects() {
 	for (int cx = 1; cx <= 7; ++cx)
-		_openObjects[cx] = chr(0);
+		_openObjects[cx] = 0;
+	_openObjCount = 0;
 }
 
 void MortevielleEngine::ecr2(Common::String text) {
@@ -3323,8 +3326,8 @@ void MortevielleEngine::drawPicture() {
 		prepareScreenType1();
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
-				if (ord(_openObjects[cx]) != 0)
-					aniof(1, ord(_openObjects[cx]));
+				if (_openObjects[cx] != 0)
+					aniof(1, _openObjects[cx]);
 			}
 
 			if (_caff == 13) {
@@ -3414,10 +3417,9 @@ void MortevielleEngine::exitRoom() {
 			_coreVar._faithScore += (_coreVar._faithScore / 10);
 	}
 
-	for (int cx = 1; cx <= 7; ++cx)
-		_openObjects[cx] = chr(0);
+	resetOpenObjects();
+
 	_roomDoorId = OWN_ROOM;
-	_openObjCount = 0;
 	_mchai = 0;
 	resetRoomVariables(_coreVar._currPlace);
 }
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index a57a304..7e0f717 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -278,7 +278,7 @@ private:
 	Common::String _hintPctMessage;
 	byte  *_cfiecBuffer;
 	int    _cfiecBufferSize;
-	byte   _openObjects[8];
+	int    _openObjects[8];
 	int    _nbrep[9];
 	int    _nbrepm[9];
 	uint16 _inpBuffer[kMaxTi + 1];
@@ -425,7 +425,7 @@ private:
 	void adzon();
 	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
 	void mapMessageId(int &mesgId);
-	void initouv();
+	void resetOpenObjects();
 	void phaz(int &rand, int &p, int cf);
 	void writetp(Common::String s, int t);
 	void premtet();


Commit: 30e60969c2c23b116ecf962e1f266eb714f8effc
    https://github.com/scummvm/scummvm/commit/30e60969c2c23b116ecf962e1f266eb714f8effc
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-14T01:28:03-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 2f4af85..6d8e095 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -298,19 +298,19 @@ void MortevielleEngine::fctTake() {
  * @remarks	Originally called 'tsprendre'
  */
 void MortevielleEngine::fctInventoryTake() {
-	int cx = 0;
+	int inventIndex = 0;
 	do {
-		++cx;
-	} while (_menu._inventoryMenu[cx] != _msg[4]);
+		++inventIndex;
+	} while (_menu._inventoryMenu[inventIndex] != _msg[4]);
 	int cz = 0;
 	int cy = 0;
 	do {
 		++cy;
-		if (ord(_coreVar._sjer[cy]) != 0)
+		if (_coreVar._inventory[cy] != 0)
 			++cz;
-	} while (cz != cx);
-	cz = ord(_coreVar._sjer[cy]);
-	_coreVar._sjer[cy] = chr(0);
+	} while (cz != inventIndex);
+	cz = _coreVar._inventory[cy];
+	_coreVar._inventory[cy] = 0;
 	_menu.setInventoryText();
 	putInHand(cz);
 	_crep = 998;
@@ -1342,15 +1342,18 @@ void MortevielleEngine::fctSound() {
  * @remarks	Originally called 'tparler'
  */
 void MortevielleEngine::fctDiscuss() {
-	bool te[47];
-	int cy, cx, max, suj, co, lig, icm, i, choi, x, y, c;
-	char tou;
+	bool questionAsked[47];
+	int cy, cx;
+	int x, y;
+//	int c;
 	Common::String lib[47];
-	bool f;
+
+	int choice; 
+	int displId;
 
 	endSearch();
 	if (_col)
-		suj = 128;
+		displId = 128;
 	else {
 		cx = 0;
 		do {
@@ -1359,54 +1362,55 @@ void MortevielleEngine::fctDiscuss() {
 		_caff = 69 + cx;
 		drawPictureWithText();
 		handleDescriptionText(2, _caff);
-		suj = _caff + 60;
+		displId = _caff + 60;
 	}
 	testKey(false);
 	mennor();
 	_mouse.hideMouse();
 	hirs();
 	premtet();
-	startDialog(suj);
+	startDialog(displId);
 	hirs();
 	for (int ix = 1; ix <= 46; ++ix)
-		te[ix] = false;
+		questionAsked[ix] = false;
 	for (int ix = 1; ix <= 45; ++ix) {
 		lib[ix] = getString(ix + kQuestionStringIndex);
-		for (i = lib[ix].size(); i <= 40; ++i)
+		for (int i = lib[ix].size(); i <= 40; ++i)
 			lib[ix] = lib[ix] + ' ';
 	}
 	lib[46] = lib[45];
 	lib[45] = ' ';
 	_mouse.showMouse();
 	do {
-		choi = 0;
-		icm = 0;
-		co = 0;
-		lig = 0;
-		do {
-			++icm;
-			_screenSurface.putxy(co, lig);
+		choice = 0;
+		int posX = 0;
+		int posY = 0;
+		for (int icm = 1; icm < 43; icm++) {
+			_screenSurface.putxy(posX, posY);
 			if (_coreVar._teauto[icm] == '*') {
-				if (te[icm])
+				// If question already asked, write it in reverse video
+				if (questionAsked[icm])
 					writetp(lib[icm], 1);
 				else
 					writetp(lib[icm], 0);
 			}
 
 			if (icm == 23)  {
-				lig = 0;
-				co = 320;
+				posY = 0;
+				posX = 320;
 			} else
-				lig = lig + 8;
-		} while (icm != 42);
+				posY += 8;
+		}
 		_screenSurface.putxy(320, 176);
 		writetp(lib[46], 0);
-		tou = '\0';
+		char retKey = '\0';
+		bool click;
 		do {
-			_mouse.moveMouse(f, tou);
+			bool dummyFl;
+			_mouse.moveMouse(dummyFl, retKey);
 			CHECK_QUIT;
 
-			_mouse.getMousePosition(x, y, c);
+			_mouse.getMousePosition(x, y, click);
 			x *= (3 - _res);
 			if (x > 319)
 				cx = 41;
@@ -1414,95 +1418,98 @@ void MortevielleEngine::fctDiscuss() {
 				cx = 1;
 			cy = ((uint)y >> 3) + 1;      // 0-199 => 1-25
 			if ((cy > 23) || ((cx == 41) && ((cy >= 20) && (cy <= 22)))) {
-				if (choi != 0) {
-					lig = ((choi - 1) % 23) << 3;
-					if (choi > 23)
-						co = 320;
+				if (choice != 0) {
+					posY = ((choice - 1) % 23) << 3;
+					if (choice > 23)
+						posX = 320;
 					else
-						co = 0;
-					_screenSurface.putxy(co, lig);
-					if (te[choi])
-						writetp(lib[choi], 0);
+						posX = 0;
+					_screenSurface.putxy(posX, posY);
+					if (questionAsked[choice])
+						writetp(lib[choice], 0);
 					else
-						writetp(lib[choi], 1);
-					te[choi] = !te[choi];
-					choi = 0;
+						writetp(lib[choice], 1);
+					questionAsked[choice] = !questionAsked[choice];
+					choice = 0;
 				}
 			} else {
 				int ix = cy;
 				if (cx == 41)
 					ix += 23;
-				if (ix != choi) {
-					if (choi != 0) {
-						lig = ((choi - 1) % 23) << 3;
-						if (choi > 23)
-							co = 320;
+				if (ix != choice) {
+					if (choice != 0) {
+						posY = ((choice - 1) % 23) << 3;
+						if (choice > 23)
+							posX = 320;
 						else
-							co = 0;
-						_screenSurface.putxy(co, lig);
-						if (te[choi])
-							writetp(lib[choi], 0);
+							posX = 0;
+						_screenSurface.putxy(posX, posY);
+						if (questionAsked[choice])
+							writetp(lib[choice], 0);
 						else
-							writetp(lib[choi], 1);
-						te[choi] = ! te[choi];
+							writetp(lib[choice], 1);
+						questionAsked[choice] = ! questionAsked[choice];
 					}
 					if ((_coreVar._teauto[ix] == '*') || (ix == 46)) {
-						lig = ((ix - 1) % 23) << 3;
+						posY = ((ix - 1) % 23) << 3;
 						if (ix > 23)
-							co = 320;
+							posX = 320;
 						else
-							co = 0;
-						_screenSurface.putxy(co, lig);
-						if (te[ix])
+							posX = 0;
+						_screenSurface.putxy(posX, posY);
+						if (questionAsked[ix])
 							writetp(lib[ix], 0);
 						else
 							writetp(lib[ix], 1);
-						te[ix] = ! te[ix];
-						choi = ix;
+						questionAsked[ix] = ! questionAsked[ix];
+						choice = ix;
 					} else
-						choi = 0;
+						choice = 0;
 				}
 			}
-		} while (!((tou == '\15') || (((c != 0) || getMouseClick()) && (choi != 0))));
+		} while (!((retKey == '\15') || (((click != 0) || getMouseClick()) && (choice != 0))));
 		setMouseClick(false);
-		if (choi != 46) {
-			int ix = choi - 1;
+
+		// If choice is not "End of Conversation"
+		if (choice != 46) {
+			int ix = choice - 1;
 			if (_col) {
 				_col = false;
 				_coreVar._currPlace = 15;
+				int maxRandVal;
 				if (_openObjCount > 0)
-					max = 8;
+					maxRandVal = 8;
 				else
-					max = 4;
-				if (getRandomNumber(1, max) == 2)
-					suj = 129;
+					maxRandVal = 4;
+				if (getRandomNumber(1, maxRandVal) == 2)
+					displId = 129;
 				else {
-					suj = 138;
+					displId = 138;
 					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
 			} else if (_nbrep[_caff - 69] < _nbrepm[_caff - 69]) {
-				suj = _tabdon[kArep + (ix << 3) + (_caff - 70)];
+				displId = _tabdon[kArep + (ix << 3) + (_caff - 70)];
 				_coreVar._faithScore += _tabdon[kArcf + ix];
 				++_nbrep[_caff - 69];
 			} else {
 				_coreVar._faithScore += 3;
-				suj = 139;
+				displId = 139;
 			}
 			_mouse.hideMouse();
 			hirs();
 			premtet();
-			startDialog(suj);
+			startDialog(displId);
 			_mouse.showMouse();
-			if ((suj == 84) || (suj == 86)) {
+			if ((displId == 84) || (displId == 86)) {
 				_coreVar._pourc[5] = '*';
 				_coreVar._teauto[7] = '*';
 			}
-			if ((suj == 106) || (suj == 108) || (suj == 94)) {
+			if ((displId == 106) || (displId == 108) || (displId == 94)) {
 				for (int indx = 29; indx <= 31; ++indx)
 					_coreVar._teauto[indx] = '*';
 				_coreVar._pourc[7] = '*';
 			}
-			if (suj == 70) {
+			if (displId == 70) {
 				_coreVar._pourc[8] = '*';
 				_coreVar._teauto[32] = '*';
 			}
@@ -1510,7 +1517,7 @@ void MortevielleEngine::fctDiscuss() {
 			hirs();
 			_mouse.showMouse();
 		}
-	} while ((choi != 46) && (suj != 138));
+	} while ((choice != 46) && (displId != 138));
 	if (_col) {
 		_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 		_mouse.hideMouse();
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 99509f8..f03d666 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -576,14 +576,13 @@ void Menu::unsetSearchMenu() {
  * @remarks	Originally called 'modinv'
  */
 void Menu::setInventoryText() {
-	int r;
 	Common::String nomp;
 
 	int cy = 0;
 	for (int i = 1; i <= 6; ++i) {
-		if (g_vm->_coreVar._sjer[i] != chr(0)) {
+		if (g_vm->_coreVar._inventory[i] != 0) {
 			++cy;
-			r = (ord(g_vm->_coreVar._sjer[i]) + 400);
+			int r = g_vm->_coreVar._inventory[i] + 400;
 			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
 			setText(_inventoryMenu[cy], nomp);
 			enableMenuItem(_inventoryMenu[i]);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 088c880..782c811 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -1702,7 +1702,7 @@ void MortevielleEngine::loseGame() {
 bool MortevielleEngine::checkInventory(int objectId) {
 	bool retVal = false;
 	for (int i = 1; i <= 6; ++i)
-		retVal = (retVal || (ord(_coreVar._sjer[i]) == objectId));
+		retVal = (retVal || (_coreVar._inventory[i] == objectId));
 
 	if (_coreVar._selectedObjectId == objectId)
 		retVal = true;
@@ -2234,7 +2234,7 @@ Common::String MortevielleEngine::getString(int num) {
 	Common::String wrkStr = "";
 
 	if (num < 0) {
-		warning("deline: num < 0! Skipping");
+		warning("getString(%d): num < 0! Skipping", num);
 	} else if (!_txxFileFl) {
 		wrkStr = getGameString(num);
 	} else {
@@ -2285,9 +2285,11 @@ void MortevielleEngine::resetVariables() {
 	_coreVar._currPlace = MANOR_FRONT;
 
 	for (int i = 2; i <= 6; ++i)
-		_coreVar._sjer[i] = chr(0);
+		_coreVar._inventory[i] = 0;
+
+	// Only object in inventory: a gun
+	_coreVar._inventory[1] = 113;
 
-	_coreVar._sjer[1] = chr(113);
 	_coreVar._fullHour = chr(20);
 
 	for (int i = 1; i <= 10; ++i)
@@ -3361,7 +3363,8 @@ void MortevielleEngine::drawPictureWithText() {
  */
 void MortevielleEngine::testKey(bool d) {
 	bool quest = false;
-	int x, y, c;
+	int x, y;
+	bool click;
 
 	_mouse.hideMouse();
 	fenat('K');
@@ -3371,18 +3374,18 @@ void MortevielleEngine::testKey(bool d) {
 		_key = testou();
 
 	do {
-		_mouse.getMousePosition(x, y, c);
+		_mouse.getMousePosition(x, y, click);
 		keyPressed();
-	} while (c != 0);
+	} while (click);
 
 	// Event loop
 	do {
 		if (d)
 			prepareRoom();
 		quest = keyPressed();
-		_mouse.getMousePosition(x, y, c);
+		_mouse.getMousePosition(x, y, click);
 		CHECK_QUIT;
-	} while (!(quest || (c != 0) || (d && _anyone)));
+	} while (!(quest || (click) || (d && _anyone)));
 	if (quest)
 		testou();
 	setMouseClick(false);
@@ -3506,16 +3509,21 @@ void MortevielleEngine::ajchai() {
 		_crep = 192;
 }
 
-void MortevielleEngine::ajjer(int ob) {
-	int cx = 0;
+/**
+ * Check if inventory is full and, if not, add object in it.
+ * @remarks	Originally called 'ajjer'
+ */
+void MortevielleEngine::addObjectToInventory(int objectId) {
+	int i = 0;
 	do {
-		++cx;
-	} while ((cx <= 5) && (ord(_coreVar._sjer[cx]) != 0));
+		++i;
+	} while ((i <= 5) && (_coreVar._inventory[i] != 0));
 
-	if (ord(_coreVar._sjer[cx]) == 0) {
-		_coreVar._sjer[(cx)] = chr(ob);
+	if (_coreVar._inventory[i] == 0) {
+		_coreVar._inventory[i] = objectId;
 		_menu.setInventoryText();
 	} else
+		// Inventory is full
 		_crep = 139;
 }
 
@@ -3715,8 +3723,9 @@ void MortevielleEngine::treg(int objId) {
 void MortevielleEngine::putInHand(int &objId) {
 	_crep = 999;
 	if (_coreVar._selectedObjectId != 0)
-		ajjer(_coreVar._selectedObjectId);
+		addObjectToInventory(_coreVar._selectedObjectId);
 
+	// If inventory wasn't full
 	if (_crep != 139) {
 		displayItemInHand(objId + 400);
 		_coreVar._selectedObjectId = objId;
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 7e0f717..1141f70 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -187,7 +187,7 @@ struct SaveStruct {
 	int _faithScore;
 	byte _pourc[11];
 	byte _teauto[43];
-	byte _sjer[31];
+	byte _inventory[31];
 	int _currPlace;
 	int _atticBallHoleObjectId;
 	int _atticRodHoleObjectId;
@@ -441,7 +441,7 @@ private:
 	void tlu(int af, int ob);
 	void affrep();
 	void mennor();
-	void ajjer(int ob);
+	void addObjectToInventory(int objectId);
 	void tsuiv();
 	void treg(int objId);
 	void putInHand(int &objId);
@@ -469,7 +469,6 @@ public:
 	int _res;
 	int _caff;
 	int _crep;
-//	byte _is;
 	byte _v_lieu[7][25];
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 598677f..96b40d8 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -238,10 +238,10 @@ void MouseHandler::setMousePosition(Common::Point newPos) {
  * Get mouse poisition
  * @remarks	Originally called 'read_pos_mouse'
  */
-void MouseHandler::getMousePosition(int &x, int &y, int &c) {
+void MouseHandler::getMousePosition(int &x, int &y, bool &click) {
 	x = g_vm->getMousePos().x;
 	y = g_vm->getMousePos().y;
-	c = g_vm->getMouseClick() ? 1 : 0;
+	click = g_vm->getMouseClick();
 }
 
 /**
@@ -251,7 +251,8 @@ void MouseHandler::getMousePosition(int &x, int &y, int &c) {
 void MouseHandler::moveMouse(bool &funct, char &key) {
 	bool p_key;
 	char in1, in2;
-	int cx, cy, cd;
+	int cx, cy;
+	bool click;
 
 	// Set defaults and check pending events
 	funct = false;
@@ -267,7 +268,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 		CHECK_QUIT;
 
 		in1 = g_vm->getChar();
-		getMousePosition(cx, cy, cd);
+		getMousePosition(cx, cy, click);
 		switch (toupper(in1)) {
 		case '4':
 			cx -= 8;
@@ -408,9 +409,10 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
  * @remarks	Originally called 'dans_rect'
  */
 bool MouseHandler::isMouseIn(Common::Rect r) {
-	int x, y, c;
+	int x, y;
+	bool click;
 
-	getMousePosition(x, y, c);
+	getMousePosition(x, y, click);
 	if ((x > r.left) && (x < r.right) && (y > r.top) && (y < r.bottom))
 		return true;
 
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index abfc315..58e3fc7 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -43,7 +43,7 @@ public:
 	void hideMouse();
 	void showMouse();
 	void setMousePosition(Common::Point newPos);
-	void getMousePosition(int &x, int &y, int &c);
+	void getMousePosition(int &x, int &y, bool &click);
 	void moveMouse(bool &funct, char &key);
 	bool isMouseIn(Common::Rect r);
 };
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 48ae046..e4fb38c 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -50,7 +50,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
 	for (int i = 0; i < 43; ++i)
 		sz.syncAsByte(g_vm->_saveStruct._teauto[i]);
 	for (int i = 0; i < 31; ++i)
-		sz.syncAsByte(g_vm->_saveStruct._sjer[i]);
+		sz.syncAsByte(g_vm->_saveStruct._inventory[i]);
 
 	sz.syncAsSint16LE(g_vm->_saveStruct._currPlace);
 	sz.syncAsSint16LE(g_vm->_saveStruct._atticBallHoleObjectId);


Commit: 85a83ae51be1bca683a7071febcef2ae08173d7a
    https://github.com/scummvm/scummvm/commit/85a83ae51be1bca683a7071febcef2ae08173d7a
Author: Strangerke (strangerke at scummvm.org)
Date: 2012-10-14T12:59:27-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 6d8e095..392ea17 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -48,7 +48,7 @@ void MortevielleEngine::fctMove() {
 	}
 	if ((_coreVar._currPlace == LANDING) && (_msg[4] == _menu._moveMenu[6])) {
 		if (!_syn)
-			ecr3(getEngineString(S_GO_TO));
+			displayTextInVerbBar(getEngineString(S_GO_TO));
 		tfleche();
 
 		if (_keyPressedEsc)
@@ -217,7 +217,7 @@ void MortevielleEngine::fctTake() {
 		return;
 	}
 	if (!_syn)
-		ecr3(getEngineString(S_TAKE));
+		displayTextInVerbBar(getEngineString(S_TAKE));
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
@@ -323,7 +323,7 @@ void MortevielleEngine::fctInventoryTake() {
  */
 void MortevielleEngine::fctLift() {
 	if (!_syn)
-		ecr3(getEngineString(S_LIFT));
+		displayTextInVerbBar(getEngineString(S_LIFT));
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
@@ -360,7 +360,7 @@ void MortevielleEngine::fctRead() {
 		getReadDescription(_caff);
 	else {
 		if (!_syn)
-			ecr3(getEngineString(S_READ));
+			displayTextInVerbBar(getEngineString(S_READ));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			setCoordinates(4);
@@ -393,7 +393,7 @@ void MortevielleEngine::fctLook() {
 		return;
 	}
 	if (!_syn)
-		ecr3(getEngineString(S_LOOK));
+		displayTextInVerbBar(getEngineString(S_LOOK));
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
@@ -483,7 +483,7 @@ void MortevielleEngine::fctSearch() {
 	}
 
 	if (!_syn)
-		ecr3(getEngineString(S_SEARCH));
+		displayTextInVerbBar(getEngineString(S_SEARCH));
 
 	tfleche();
 	if (_anyone || _keyPressedEsc)
@@ -579,7 +579,7 @@ void MortevielleEngine::fctSelfSearch() {
  */
 void MortevielleEngine::fctOpen() {
 	if (!_syn)
-		ecr3(getEngineString(S_OPEN));
+		displayTextInVerbBar(getEngineString(S_OPEN));
 
 	if (_caff == ROOM26) {
 		if (_roomDoorId != OWN_ROOM) {
@@ -657,7 +657,7 @@ void MortevielleEngine::fctPlace() {
 	}
 
 	if (!_syn)
-		ecr3(getEngineString(S_PUT));
+		displayTextInVerbBar(getEngineString(S_PUT));
 
 	tfleche();
 	if (_keyPressedEsc)
@@ -669,7 +669,7 @@ void MortevielleEngine::fctPlace() {
 	setCoordinates(8);
 	if (_num != 0) {
 		_crep = 999;
-		if (_caff == 13) {
+		if (_caff == ATTIC) {
 			if (_num == 1) {
 				if (_coreVar._atticBallHoleObjectId != 0) {
 					_crep = 188;
@@ -687,7 +687,7 @@ void MortevielleEngine::fctPlace() {
 			}
 		}
 
-		if (_caff == 14) {
+		if (_caff == CELLAR) {
 			if (_coreVar._cellarObjectId != 0) {
 				_crep = 188;
 			} else {
@@ -745,14 +745,14 @@ void MortevielleEngine::fctPlace() {
 			}
 		}
 
-		if (_caff == 16) {
+		if (_caff == CRYPT) {
 			if (_coreVar._cryptObjectId == 0)
 				_coreVar._cryptObjectId = _coreVar._selectedObjectId;
 			else
 				_crep = 188;
 		}
 
-		if (_caff == 17) {
+		if (_caff == SECRET_PASSAGE) {
 			if (_coreVar._secretPassageObjectId != 0) {
 				_crep = 188;
 			} else if (_coreVar._selectedObjectId == 143) {
@@ -764,7 +764,7 @@ void MortevielleEngine::fctPlace() {
 			}
 		}
 
-		if (_caff == 24) {
+		if (_caff == WELL) {
 			if (_coreVar._wellObjectId != 0) {
 				_crep = 188;
 			} else if ((_coreVar._selectedObjectId == 140) || (_coreVar._selectedObjectId == 120)) {
@@ -790,7 +790,7 @@ void MortevielleEngine::fctTurn() {
 		return;
 	}
 	if (!_syn)
-		ecr3(getEngineString(S_TURN));
+		displayTextInVerbBar(getEngineString(S_TURN));
 	tfleche();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
@@ -826,7 +826,7 @@ void MortevielleEngine::fctTurn() {
  */
 void MortevielleEngine::fctSelfHide() {
 	if (!_syn)
-		ecr3(getEngineString(S_HIDE_SELF));
+		displayTextInVerbBar(getEngineString(S_HIDE_SELF));
 	tfleche();
 	if (!(_anyone) && !(_keyPressedEsc)) {
 		setCoordinates(10);
@@ -848,7 +848,7 @@ void MortevielleEngine::fctAttach() {
 		_crep = 186;
 	else {
 		if (!_syn)
-			ecr3(getEngineString(S_TIE));
+			displayTextInVerbBar(getEngineString(S_TIE));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			setCoordinates(8);
@@ -872,7 +872,7 @@ void MortevielleEngine::fctAttach() {
  */
 void MortevielleEngine::fctClose() {
 	if (!_syn)
-		ecr3(getEngineString(S_CLOSE));
+		displayTextInVerbBar(getEngineString(S_CLOSE));
 
 	if (_caff < ROOM26) {
 		tfleche();
@@ -912,7 +912,7 @@ void MortevielleEngine::fctClose() {
  */
 void MortevielleEngine::fctKnock() {
 	if (!_syn)
-		ecr3(getEngineString(S_HIT));
+		displayTextInVerbBar(getEngineString(S_HIT));
 
 	if (_coreVar._currPlace == LANDING) {
 		Alert::show(getEngineString(S_BEFORE_USE_DEP_MENU), 1);
@@ -959,7 +959,7 @@ void MortevielleEngine::fctKnock() {
  */
 void MortevielleEngine::fctSelfPut() {
 	if (!_syn)
-		ecr3(getEngineString(S_POSE));
+		displayTextInVerbBar(getEngineString(S_POSE));
 	if (_coreVar._selectedObjectId == 0)
 		_crep = 186;
 	else {
@@ -1095,7 +1095,7 @@ void MortevielleEngine::fctEat() {
 	} else {
 		exitRoom();
 		_coreVar._currPlace = DINING_ROOM;
-		_caff = 10;
+		_caff = DINING_ROOM;
 		resetRoomVariables(_coreVar._currPlace);
 		_menu.setDestinationText(_coreVar._currPlace);
 
@@ -1140,7 +1140,7 @@ void MortevielleEngine::fctEnter() {
 		_crep = 997;
 	else if ((_roomDoorId == ROOM9) && (_coreVar._selectedObjectId != 136)) {
 			_crep = 189;
-			_coreVar._teauto[8] = '*';
+			_coreVar._availableQuestion[8] = '*';
 	} else {
 		int z = 0;
 		if (!_blo)
@@ -1238,8 +1238,8 @@ void MortevielleEngine::fctSleep() {
  */
 void MortevielleEngine::fctForce() {
 	if (!_syn)
-		ecr3(getEngineString(S_SMASH));
-	if (_caff < 25)
+		displayTextInVerbBar(getEngineString(S_SMASH));
+	if (_caff < DOOR)
 		tfleche();
 
 	if ((!_anyone) && (!_keyPressedEsc)) {
@@ -1328,7 +1328,7 @@ void MortevielleEngine::fctWait() {
  */
 void MortevielleEngine::fctSound() {
 	if (!_syn)
-		ecr3(getEngineString(S_PROBE2));
+		displayTextInVerbBar(getEngineString(S_PROBE2));
 	if (_caff < 27) {
 		tfleche();
 		if (!(_anyone) && (!_keyPressedEsc))
@@ -1387,7 +1387,7 @@ void MortevielleEngine::fctDiscuss() {
 		int posY = 0;
 		for (int icm = 1; icm < 43; icm++) {
 			_screenSurface.putxy(posX, posY);
-			if (_coreVar._teauto[icm] == '*') {
+			if (_coreVar._availableQuestion[icm] == '*') {
 				// If question already asked, write it in reverse video
 				if (questionAsked[icm])
 					writetp(lib[icm], 1);
@@ -1411,7 +1411,7 @@ void MortevielleEngine::fctDiscuss() {
 			CHECK_QUIT;
 
 			_mouse.getMousePosition(x, y, click);
-			x *= (3 - _res);
+			x *= (3 - _resolutionScaler);
 			if (x > 319)
 				cx = 41;
 			else
@@ -1450,7 +1450,7 @@ void MortevielleEngine::fctDiscuss() {
 							writetp(lib[choice], 1);
 						questionAsked[choice] = ! questionAsked[choice];
 					}
-					if ((_coreVar._teauto[ix] == '*') || (ix == 46)) {
+					if ((_coreVar._availableQuestion[ix] == '*') || (ix == 46)) {
 						posY = ((ix - 1) % 23) << 3;
 						if (ix > 23)
 							posX = 320;
@@ -1501,17 +1501,17 @@ void MortevielleEngine::fctDiscuss() {
 			startDialog(displId);
 			_mouse.showMouse();
 			if ((displId == 84) || (displId == 86)) {
-				_coreVar._pourc[5] = '*';
-				_coreVar._teauto[7] = '*';
+				_coreVar._pctHintFound[5] = '*';
+				_coreVar._availableQuestion[7] = '*';
 			}
 			if ((displId == 106) || (displId == 108) || (displId == 94)) {
 				for (int indx = 29; indx <= 31; ++indx)
-					_coreVar._teauto[indx] = '*';
-				_coreVar._pourc[7] = '*';
+					_coreVar._availableQuestion[indx] = '*';
+				_coreVar._pctHintFound[7] = '*';
 			}
 			if (displId == 70) {
-				_coreVar._pourc[8] = '*';
-				_coreVar._teauto[32] = '*';
+				_coreVar._pctHintFound[8] = '*';
+				_coreVar._availableQuestion[32] = '*';
 			}
 			_mouse.hideMouse();
 			hirs();
@@ -1550,10 +1550,10 @@ void MortevielleEngine::fctSmell() {
 	_crep = 119;
 	if (_caff < ROOM26) {
 		if (!_syn)
-			ecr3(getEngineString(S_SMELL));
+			displayTextInVerbBar(getEngineString(S_SMELL));
 		tfleche();
 		if (!(_anyone) && !(_keyPressedEsc))
-			if (_caff == 16)
+			if (_caff == CRYPT)
 				_crep = 153;
 	} else if (_caff == 123)
 		_crep = 110;
@@ -1568,7 +1568,7 @@ void MortevielleEngine::fctScratch() {
 	_crep = 155;
 	if (_caff < 27) {
 		if (!_syn)
-			ecr3(getEngineString(S_SCRATCH));
+			displayTextInVerbBar(getEngineString(S_SCRATCH));
 		tfleche();
 	}
 	_num = 0;
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index f0f4452..ee6eb69 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -71,7 +71,7 @@ int Alert::show(const Common::String &msg, int n) {
 			while ((alertStr[i + 1] != '\174') && (alertStr[i + 1] != '\135')) {
 				++i;
 				displayStr += alertStr[i];
-				if (g_vm->_res == 2)
+				if (g_vm->_resolutionScaler == 2)
 					curPos.x -= 3;
 				else
 					curPos.x -= 5;
@@ -95,12 +95,12 @@ int Alert::show(const Common::String &msg, int n) {
 	int limit[3][3];
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 
-	limit[1][1] = ((uint)(coldep) / 2) * g_vm->_res;
+	limit[1][1] = ((uint)(coldep) / 2) * g_vm->_resolutionScaler;
 	limit[1][2] = limit[1][1] + 40;
 	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * g_vm->_res;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * g_vm->_resolutionScaler;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
 	g_vm->_mouse.showMouse();
@@ -221,7 +221,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
 	}
 	++i;
 	choiceListStr = g_vm->copy(inputStr, i, 30);
-	if (g_vm->_res == 2)
+	if (g_vm->_resolutionScaler == 2)
 		col *= 6;
 	else
 		col *= 10;
@@ -303,7 +303,7 @@ bool KnowledgeCheck::show() {
 		g_vm->hirs();
 		g_vm->_mouse.showMouse();
 		int dialogHeight;
-		if (g_vm->_res == 1)
+		if (g_vm->_resolutionScaler == 1)
 			dialogHeight = 29;
 		else
 			dialogHeight = 23;
@@ -335,7 +335,7 @@ bool KnowledgeCheck::show() {
 		}
 
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			coor[j]._rect = Common::Rect(45 * g_vm->_res, 27 + j * 8, (maxLength * 3 + 55) * g_vm->_res, 34 + j * 8);
+			coor[j]._rect = Common::Rect(45 * g_vm->_resolutionScaler, 27 + j * 8, (maxLength * 3 + 55) * g_vm->_resolutionScaler, 34 + j * 8);
 			coor[j]._enabled = true;
 
 			while ((int)choiceArray[j].size() < maxLength) {
@@ -344,7 +344,7 @@ bool KnowledgeCheck::show() {
 		}
 		coor[lastOption - firstOption + 2]._enabled = false;
 		int rep;
-		if (g_vm->_res == 1)
+		if (g_vm->_resolutionScaler == 1)
 			rep = 10;
 		else
 			rep = 6;
@@ -473,7 +473,7 @@ void f3f8::ani50() {
 	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
 	g_vm->_crep = g_vm->animof(2, 1);
 	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
-	g_vm->_largestClearScreen = (g_vm->_res == 1);
+	g_vm->_largestClearScreen = (g_vm->_resolutionScaler == 1);
 	g_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
 
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index fec2cfb..5bf3aed 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -996,7 +996,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
-	if (g_vm->_res == 1) {
+	if (g_vm->_resolutionScaler == 1) {
 		x = (uint)x >> 1;
 		dx = (uint)dx >> 1;
 	}
@@ -1063,7 +1063,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	g_vm->_mouse.hideMouse();
 	pt = _textPos;
 
-	if (g_vm->_res == 2)
+	if (g_vm->_resolutionScaler == 2)
 		i = 6;
 	else
 		i = 10;
@@ -1105,7 +1105,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
  * Gets the width in pixels of the specified string
  */
 int ScreenSurface::getStringWidth(const Common::String &s) {
-	int charWidth = (g_vm->_res == 2) ? 6 : 10;
+	int charWidth = (g_vm->_resolutionScaler == 2) ? 6 : 10;
 
 	return s.size() * charWidth;
 }
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index f03d666..8e6d94c 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -93,8 +93,8 @@ void Menu::setDestinationText(int roomId) {
 		roomId = LANDING;
 
 	int destinationId = 0;
-	for (; (destinationId < 7) && (g_vm->_v_lieu[destinationId][roomId]); ++destinationId) {
-		nomp = g_vm->getString(g_vm->_v_lieu[destinationId][roomId] + kMenuPlaceStringIndex);
+	for (; (destinationId < 7) && (g_vm->_destinationArray[destinationId][roomId]); ++destinationId) {
+		nomp = g_vm->getString(g_vm->_destinationArray[destinationId][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		setText(_moveMenu[destinationId + 1], nomp);
@@ -178,7 +178,7 @@ void Menu::displayMenu() {
 	g_vm->_mouse.hideMouse();
 
 	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
-	col = 28 * g_vm->_res;
+	col = 28 * g_vm->_resolutionScaler;
 	if (g_vm->_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
@@ -207,7 +207,7 @@ void Menu::displayMenu() {
 			} while (k != 3);
 			++y;
 		} while (y != 9);
-		col += 48 * g_vm->_res;
+		col += 48 * g_vm->_resolutionScaler;
 	} while (num_letr != 6);
 	g_vm->_mouse.showMouse();
 }
@@ -284,14 +284,14 @@ void Menu::util(Common::Point pos) {
 
 	int ymx = (_menuConstants[_msg3 - 1][3] << 3) + 16;
 	int dxcar = _menuConstants[_msg3 - 1][2];
-	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_vm->_res;
+	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_vm->_resolutionScaler;
 
 	int ix;
-	if (g_vm->_res == 1)
+	if (g_vm->_resolutionScaler == 1)
 		ix = 5;
 	else
 		ix = 3;
-	int xmx = dxcar * ix * g_vm->_res + xmn + 2;
+	int xmx = dxcar * ix * g_vm->_resolutionScaler + xmn + 2;
 	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
 		ix = (((uint)pos.y >> 3) - 1) + (_msg3 << 8);
 		if (ix != _msg4) {
@@ -321,7 +321,7 @@ void Menu::menuDown(int ii) {
 	g_vm->_mouse.hideMouse();
 	g_vm->sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
-	if (g_vm->_res == 1)
+	if (g_vm->_resolutionScaler == 1)
 		cx = 10;
 	else
 		cx = 6;
@@ -433,24 +433,24 @@ void Menu::mdn() {
 			g_vm->_prevPos = curPos;
 
 		bool tes =  (curPos.y < 11)
-		   && ((curPos.x >= (28 * g_vm->_res) && curPos.x <= (28 * g_vm->_res + 24))
-		   ||  (curPos.x >= (76 * g_vm->_res) && curPos.x <= (76 * g_vm->_res + 24))
-		   || ((curPos.x > 124 * g_vm->_res) && (curPos.x < 124 * g_vm->_res + 24))
-		   || ((curPos.x > 172 * g_vm->_res) && (curPos.x < 172 * g_vm->_res + 24))
-		   || ((curPos.x > 220 * g_vm->_res) && (curPos.x < 220 * g_vm->_res + 24))
-		   || ((curPos.x > 268 * g_vm->_res) && (curPos.x < 268 * g_vm->_res + 24)));
+		   && ((curPos.x >= (28 * g_vm->_resolutionScaler) && curPos.x <= (28 * g_vm->_resolutionScaler + 24))
+		   ||  (curPos.x >= (76 * g_vm->_resolutionScaler) && curPos.x <= (76 * g_vm->_resolutionScaler + 24))
+		   || ((curPos.x > 124 * g_vm->_resolutionScaler) && (curPos.x < 124 * g_vm->_resolutionScaler + 24))
+		   || ((curPos.x > 172 * g_vm->_resolutionScaler) && (curPos.x < 172 * g_vm->_resolutionScaler + 24))
+		   || ((curPos.x > 220 * g_vm->_resolutionScaler) && (curPos.x < 220 * g_vm->_resolutionScaler + 24))
+		   || ((curPos.x > 268 * g_vm->_resolutionScaler) && (curPos.x < 268 * g_vm->_resolutionScaler + 24)));
 		if (tes) {
 			int ix;
 
-			if (curPos.x < 76 * g_vm->_res)
+			if (curPos.x < 76 * g_vm->_resolutionScaler)
 				ix = MENU_INVENTORY;
-			else if (curPos.x < 124 * g_vm->_res)
+			else if (curPos.x < 124 * g_vm->_resolutionScaler)
 				ix = MENU_MOVE;
-			else if (curPos.x < 172 * g_vm->_res)
+			else if (curPos.x < 172 * g_vm->_resolutionScaler)
 				ix = MENU_ACTION;
-			else if (curPos.x < 220 * g_vm->_res)
+			else if (curPos.x < 220 * g_vm->_resolutionScaler)
 				ix = MENU_SELF;
-			else if (curPos.x < 268 * g_vm->_res)
+			else if (curPos.x < 268 * g_vm->_resolutionScaler)
 				ix = MENU_DISCUSS;
 			else
 				ix = MENU_FILE;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 782c811..2b95bce 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -180,7 +180,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	// Set the screen mode
 	_currGraphicalDevice = MODE_EGA;
-	_res = 2;
+	_resolutionScaler = 2;
 
 	_txxFileFl = false;
 	// Load texts from TXX files
@@ -673,7 +673,7 @@ void MortevielleEngine::handleAction() {
 		} else if (inkey == '\77') {
 			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
 				_msg[4] = _menuOpcode;
-				ecr3(getEngineString(S_IDEM));
+				displayTextInVerbBar(getEngineString(S_IDEM));
 			} else
 				return;
 		} else if (inkey == '\104') {
@@ -746,7 +746,7 @@ void MortevielleEngine::loadPlaces() {
 
 	for (int i = 0; i < 7; ++i) {
 		for (int j = 0; j < 25; ++j)
-			_v_lieu[i][j] = f.readByte();
+			_destinationArray[i][j] = f.readByte();
 	}
 
 	f.close();
@@ -2004,8 +2004,8 @@ void MortevielleEngine::handleOpcode() {
 	}
 	int hour, day, minute;
 	updateHour(day, hour, minute);
-	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (_coreVar._currPlace != 10)) ||
-	        ((hour > 0) && (hour < 6) && (_coreVar._currPlace != 0)))
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (_coreVar._currPlace != DINING_ROOM)) ||
+	        ((hour > 0) && (hour < 6) && (_coreVar._currPlace != OWN_ROOM)))
 		++_coreVar._faithScore;
 	if (((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace > MOUNTAIN)) && (_coreVar._currPlace != INSIDE_WELL)
 	        && (_coreVar._currPlace != OWN_ROOM) && (_coreVar._selectedObjectId != 152) && (!_loseGame)) {
@@ -2104,7 +2104,7 @@ void MortevielleEngine::clearUpperRightPart() {
 	Common::String st;
 
 	_mouse.hideMouse();
-	if (_res == 1) {
+	if (_resolutionScaler == 1) {
 		x2 = 634;
 		x1 = 534;
 	} else {
@@ -2293,21 +2293,21 @@ void MortevielleEngine::resetVariables() {
 	_coreVar._fullHour = chr(20);
 
 	for (int i = 1; i <= 10; ++i)
-		_coreVar._pourc[i] = ' ';
+		_coreVar._pctHintFound[i] = ' ';
 
 	for (int i = 1; i <= 6; ++i)
-		_coreVar._teauto[i] = '*';
+		_coreVar._availableQuestion[i] = '*';
 
 	for (int i = 7; i <= 9; ++i)
-		_coreVar._teauto[i] = ' ';
+		_coreVar._availableQuestion[i] = ' ';
 
 	for (int i = 10; i <= 28; ++i)
-		_coreVar._teauto[i] = '*';
+		_coreVar._availableQuestion[i] = '*';
 
 	for (int i = 29; i <= 42; ++i)
-		_coreVar._teauto[i] = ' ';
+		_coreVar._availableQuestion[i] = ' ';
 
-	_coreVar._teauto[33] = '*';
+	_coreVar._availableQuestion[33] = '*';
 
 	for (int i = 1; i <= 8; ++i)
 		_nbrep[i] = 0;
@@ -2563,7 +2563,7 @@ void MortevielleEngine::showTitleScreen() {
 	draw(kAdrDes, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	_screenSurface.putxy(104 + 72 * _res, 185);
+	_screenSurface.putxy(104 + 72 * _resolutionScaler, 185);
 	_screenSurface.drawString(cpr, 0);
 }
 
@@ -2609,14 +2609,7 @@ int MortevielleEngine::readclock() {
  * @remarks	Originally called 'tinke'
  */
 void MortevielleEngine::prepareRoom() {
-	Common::String d1 = getEngineString(S_SHOULD_HAVE_NOTICED);
-	Common::String d2 = getEngineString(S_NUMBER_OF_HINTS);
-	const char d3 = '[';
-	const char d4 = ']';
-	const char d5 = '1';
-	Common::String d6 = getEngineString(S_OK);
-	int cf, day, hour, minute;
-	Common::String stpo;
+	int day, hour, minute;
 
 	_anyone = false;
 	updateHour(day, hour, minute);
@@ -2634,29 +2627,26 @@ void MortevielleEngine::prepareRoom() {
 		_hour = hour;
 		_minute = 0;
 		drawClock();
-		cf = 0;
+		int hintCount = 0;
 		for (int i = 1; i <= 10; ++i) {
-			if (_coreVar._pourc[i] == '*')
-				++cf;
+			if (_coreVar._pctHintFound[i] == '*')
+				++hintCount;
 		}
 
-		if (cf == 10)
-			stpo = "10";
+		Common::String pctStr;
+		if (hintCount == 10)
+			pctStr = "10";
 		else
-			stpo = chr(cf + 48);
-
-		_hintPctMessage = Common::String(d3);
-		_hintPctMessage += d5;
-		_hintPctMessage += d4;
-		_hintPctMessage += d3;
-		_hintPctMessage += d1;
-		_hintPctMessage += stpo;
+			pctStr = chr(hintCount + 48);
+
+		_hintPctMessage = "[1][";
+		_hintPctMessage += getEngineString(S_SHOULD_HAVE_NOTICED);
+		_hintPctMessage += pctStr;
 		_hintPctMessage += '0';
-		_hintPctMessage += d2;
-		_hintPctMessage += d4;
-		_hintPctMessage += d3;
-		_hintPctMessage += d6;
-		_hintPctMessage += d4;
+		_hintPctMessage += getEngineString(S_NUMBER_OF_HINTS);
+		_hintPctMessage += "][";
+		_hintPctMessage += getEngineString(S_OK);
+		_hintPctMessage += ']';
 	}
 	if (minute > _minute) {
 		_minute = 30;
@@ -2670,11 +2660,10 @@ void MortevielleEngine::prepareRoom() {
 			_inGameHourDuration = kTime2;
 		else
 			_inGameHourDuration = kTime1;
-		cf = _coreVar._faithScore;
-		if ((cf > 33) && (cf < 66))
+		if ((_coreVar._faithScore > 33) && (_coreVar._faithScore < 66))
 			_inGameHourDuration -= (_inGameHourDuration / 3);
 
-		if (cf > 65)
+		if (_coreVar._faithScore > 65)
 			_inGameHourDuration -= ((_inGameHourDuration / 3) * 2);
 
 		int newHour = readclock();
@@ -2686,40 +2675,40 @@ void MortevielleEngine::prepareRoom() {
 			switch (_place) {
 			case GREEN_ROOM:
 			case DARKBLUE_ROOM:
-				setRandomPresenceGreenRoom(cf);
+				setRandomPresenceGreenRoom(_coreVar._faithScore);
 				break;
 			case PURPLE_ROOM:
-				setRandomPresencePurpleRoom(cf);
+				setRandomPresencePurpleRoom(_coreVar._faithScore);
 				break;
 			case BLUE_ROOM:
-				setRandomPresenceBlueRoom(cf);
+				setRandomPresenceBlueRoom(_coreVar._faithScore);
 				break;
 			case RED_ROOM:
 			case GREEN_ROOM2:
-				setRandomPresenceRedRoom(cf);
+				setRandomPresenceRedRoom(_coreVar._faithScore);
 				break;
 			case ROOM9:
-				setRandomPresenceRoom9(cf);
+				setRandomPresenceRoom9(_coreVar._faithScore);
 				break;
 			case DINING_ROOM:
-				setRandomPresenceDiningRoom(cf);
+				setRandomPresenceDiningRoom(_coreVar._faithScore);
 				break;
 			case BUREAU:
-				setRandomPresenceBureau(cf);
+				setRandomPresenceBureau(_coreVar._faithScore);
 				break;
 			case KITCHEN:
-				setRandomPresenceKitchen(cf);
+				setRandomPresenceKitchen(_coreVar._faithScore);
 				break;
 			case ATTIC:
 			case CELLAR:
-				setRandomPresenceAttic(cf);
+				setRandomPresenceAttic(_coreVar._faithScore);
 				break;
 			case LANDING:
 			case ROOM26:
-				setRandomPresenceLanding(cf);
+				setRandomPresenceLanding(_coreVar._faithScore);
 				break;
 			case CHAPEL:
-				setRandomPresenceChapel(cf);
+				setRandomPresenceChapel(_coreVar._faithScore);
 				break;
 			}
 			if ((_savedBitIndex != 0) && (_currBitIndex != 10))
@@ -2736,7 +2725,7 @@ void MortevielleEngine::prepareRoom() {
 						if (getRandomNumber(1, 5) < 5) {
 							clearVerbBar();
 							prepareScreenType2();
-							ecr3(getEngineString(S_HEAR_NOISE));
+							displayTextInVerbBar(getEngineString(S_HEAR_NOISE));
 							int rand = (getRandomNumber(0, 4)) - 2;
 							_speechManager.startSpeech(1, rand, 1);
 							clearVerbBar();
@@ -2771,29 +2760,29 @@ void MortevielleEngine::drawClock() {
 	const int x = 580;
 	const int y = 123;
 	const int rg = 9;
-	int h, co;
+	int hourColor;
 
 	_mouse.hideMouse();
 
 	_screenSurface.drawRectangle(570, 118, 20, 10);
 	_screenSurface.drawRectangle(578, 114, 6, 18);
 	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
-		co = 0;
+		hourColor = 0;
 	else
-		co = 1;
+		hourColor = 1;
 
 	if (_minute == 0)
-		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y - rg), co);
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y - rg), hourColor);
 	else
-		_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)x >> 1) * _res, (y + rg), co);
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y + rg), hourColor);
 
-	h = _hour;
-	if (h > 12)
-		h -= 12;
-	if (h == 0)
-		h = 12;
+	int hour12 = _hour;
+	if (hour12 > 12)
+		hour12 -= 12;
+	if (hour12 == 0)
+		hour12 = 12;
 
-	_screenSurface.drawLine(((uint)x >> 1) * _res, y, ((uint)(x + cv[0][h - 1]) >> 1) * _res, y + cv[1][h - 1], co);
+	_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * _resolutionScaler, y + cv[1][hour12 - 1], hourColor);
 	_mouse.showMouse();
 	_screenSurface.putxy(568, 154);
 
@@ -2840,12 +2829,12 @@ void MortevielleEngine::hirs() {
 
 	if (_currGraphicalDevice == MODE_TANDY) {
 		_screenSurface.fillRect(0, Common::Rect(0, 0, 639, 200));
-		_res = 1;
+		_resolutionScaler = 1;
 	} else if (_currGraphicalDevice == MODE_CGA) {
 		palette(1);
-		_res = 1;
+		_resolutionScaler = 1;
 	} else
-		_res = 2;
+		_resolutionScaler = 2;
 
 	_screenSurface.clearScreen();
 }
@@ -2860,7 +2849,7 @@ void MortevielleEngine::initCaveOrCellar() {
 		_coreVar._faithScore += (_coreVar._faithScore / 10);
 	clearVerbBar();
 	prepareScreenType2();
-	ecr3(getEngineString(S_SOMEONE_ENTERS));
+	displayTextInVerbBar(getEngineString(S_SOMEONE_ENTERS));
 	int rand = (getRandomNumber(0, 4)) - 2;
 	_speechManager.startSpeech(2, rand, 1);
 
@@ -2938,7 +2927,7 @@ int MortevielleEngine::animof(int ouf, int num) {
 void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int mesgId) {
 	int co;
 
-	if (_res == 1)
+	if (_resolutionScaler == 1)
 		co = 10;
 	else
 		co = 6;
@@ -2956,7 +2945,7 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
 	if ((mesgId > 499) && (mesgId < 563)) {
 		Common::String tmpStr = getString(mesgId - 501 + kInventoryStringIndex);
 
-		if ((int) tmpStr.size() > ((58 + (_res - 1) * 37) << 1))
+		if ((int) tmpStr.size() > ((58 + (_resolutionScaler - 1) * 37) << 1))
 			_largestClearScreen = true;
 		else
 			_largestClearScreen = false;
@@ -2972,12 +2961,12 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
 			prepareScreenType2();
 			displayTextInDescriptionBar(8, 182, 103, mesgId);
 			if ((mesgId == 68) || (mesgId == 69))
-				_coreVar._teauto[40] = '*';
-			if ((mesgId == 104) && (_caff == 14)) {
-				_coreVar._teauto[36] = '*';
-				if (_coreVar._teauto[39] == '*') {
-					_coreVar._pourc[3] = '*';
-					_coreVar._teauto[38] = '*';
+				_coreVar._availableQuestion[40] = '*';
+			if ((mesgId == 104) && (_caff == CELLAR)) {
+				_coreVar._availableQuestion[36] = '*';
+				if (_coreVar._availableQuestion[39] == '*') {
+					_coreVar._pctHintFound[3] = '*';
+					_coreVar._availableQuestion[38] = '*';
 				}
 			}
 			break;
@@ -2994,9 +2983,9 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
 			_text.displayStr(tmpStr, 80, 40, 60, 25, i);
 
 			if (mesgId == 180)
-				_coreVar._pourc[6] = '*';
+				_coreVar._pctHintFound[6] = '*';
 			else if (mesgId == 179)
-				_coreVar._pourc[10] = '*';
+				_coreVar._pctHintFound[10] = '*';
 			}
 			break;
 		default:
@@ -3061,7 +3050,7 @@ void MortevielleEngine::resetOpenObjects() {
 void MortevielleEngine::ecr2(Common::String text) {
 	// Some dead code was present in the original: removed
 	_screenSurface.putxy(8, 177);
-	int tlig = 59 + (_res - 1) * 36;
+	int tlig = 59 + (_resolutionScaler - 1) * 36;
 
 	if ((int)text.size() < tlig)
 		_screenSurface.drawString(text, 5);
@@ -3082,7 +3071,7 @@ void MortevielleEngine::ecr2(Common::String text) {
 	}
 }
 
-void MortevielleEngine::ecr3(Common::String text) {
+void MortevielleEngine::displayTextInVerbBar(Common::String text) {
 	clearVerbBar();
 	_screenSurface.putxy(8, 192);
 	_screenSurface.drawString(text, 5);
@@ -3282,19 +3271,19 @@ int MortevielleEngine::getPresence(int roomId) {
 }
 
 void MortevielleEngine::writetp(Common::String s, int t) {
-	if (_res == 2)
+	if (_resolutionScaler == 2)
 		_screenSurface.drawString(s, t);
 	else
 		_screenSurface.drawString(copy(s, 1, 25), t);
 }
 
 void MortevielleEngine::aniof(int ouf, int num) {
-	if ((_caff == 7) && ((num == 4) || (num == 5)))
+	if ((_caff == BATHROOM) && ((num == 4) || (num == 5)))
 		return;
 
-	if ((_caff == 10) && (num == 7))
+	if ((_caff == DINING_ROOM) && (num == 7))
 		num = 6;
-	else if (_caff == 12) {
+	else if (_caff == KITCHEN) {
 		if (num == 3)
 			num = 4;
 		else if (num == 4)
@@ -3332,17 +3321,17 @@ void MortevielleEngine::drawPicture() {
 					aniof(1, _openObjects[cx]);
 			}
 
-			if (_caff == 13) {
+			if (_caff == ATTIC) {
 				if (_coreVar._atticBallHoleObjectId == 141)
 					aniof(1, 7);
 
 				if (_coreVar._atticRodHoleObjectId == 159)
 					aniof(1, 6);
-			} else if ((_caff == 14) && (_coreVar._cellarObjectId == 151))
+			} else if ((_caff == CELLAR) && (_coreVar._cellarObjectId == 151))
 				aniof(1, 2);
-			else if ((_caff == 17) && (_coreVar._secretPassageObjectId == 143))
+			else if ((_caff == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143))
 				aniof(1, 1);
-			else if ((_caff == 24) && (_coreVar._wellObjectId != 0))
+			else if ((_caff == WELL) && (_coreVar._wellObjectId != 0))
 				aniof(1, 1);
 		}
 
@@ -3622,7 +3611,7 @@ void MortevielleEngine::tfleche() {
 			CHECK_QUIT;
 
 			if (getMouseClick())
-				inRect = (_mouse._pos.x < 256 * _res) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
+				inRect = (_mouse._pos.x < 256 * _resolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
 			prepareRoom();
 		} while (!(qust || inRect || _anyone));
 
@@ -3679,10 +3668,10 @@ void MortevielleEngine::setCoordinates(int sx) {
 	cy = 1;
 	do {
 		cb += 2;
-		sx = _tabdon[a + cb] * _res;
+		sx = _tabdon[a + cb] * _resolutionScaler;
 		sy = _tabdon[(a + cb + 1)];
 		cb += 2;
-		ix = _tabdon[a + cb] * _res;
+		ix = _tabdon[a + cb] * _resolutionScaler;
 		iy = _tabdon[(a + cb + 1)];
 		++cy;
 	} while (!(((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) || (cy > ib)));
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 1141f70..81baab9 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -154,8 +154,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
 /*
 9   "A glance at the forbidden$",
 18  "It's already open$",
-26  "A photograph$",
-27  "The coat of arms$",
+26  "A photograph$"
 */
 enum Places {
 	OWN_ROOM = 0,     GREEN_ROOM = 1,   PURPLE_ROOM = 2,     TOILETS = 3,      DARKBLUE_ROOM = 4,
@@ -163,7 +162,7 @@ enum Places {
 	DINING_ROOM = 10, BUREAU = 11,      KITCHEN = 12,        ATTIC = 13,       CELLAR = 14,
 	LANDING = 15,     CRYPT = 16,       SECRET_PASSAGE = 17, ROOM18 = 18,      MOUNTAIN = 19,
 	CHAPEL = 20,      MANOR_FRONT = 21, MANOR_BACK = 22,     INSIDE_WELL = 23, WELL = 24,
-	DOOR = 25,        ROOM26 = 26,      ROOM27 = 27
+	DOOR = 25,        ROOM26 = 26,      COAT_ARMS = 27
 };
 
 enum GraphicModes { MODE_AMSTRAD1512 = 0, MODE_CGA = 1, MODE_EGA = 2, MODE_HERCULES = 3, MODE_TANDY = 4 };
@@ -185,8 +184,8 @@ struct Pattern {
 
 struct SaveStruct {
 	int _faithScore;
-	byte _pourc[11];
-	byte _teauto[43];
+	byte _pctHintFound[11];
+	byte _availableQuestion[43];
 	byte _inventory[31];
 	int _currPlace;
 	int _atticBallHoleObjectId;
@@ -420,31 +419,32 @@ private:
 	void delay(int amount);
 	void handleOpcode();
 
-	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
-	void copcha();
-	void adzon();
 	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
 	void mapMessageId(int &mesgId);
 	void resetOpenObjects();
+	void setCoordinates(int sx);
+	void displayTextInVerbBar(Common::String text);
+	void drawPicture();
+	void drawPictureWithText();
+	void addObjectToInventory(int objectId);
+	void putInHand(int &objId);
+
+	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
+	void copcha();
+	void adzon();
 	void phaz(int &rand, int &p, int cf);
 	void writetp(Common::String s, int t);
 	void premtet();
 	void ajchai();
 	void tfleche();
-	void setCoordinates(int sx);
 	void ecr2(Common::String text);
-	void ecr3(Common::String text);
 	void init_nbrepm();
 	void aniof(int ouf, int num);
-	void drawPicture();
-	void drawPictureWithText();
 	void tlu(int af, int ob);
 	void affrep();
 	void mennor();
-	void addObjectToInventory(int objectId);
 	void tsuiv();
 	void treg(int objId);
-	void putInHand(int &objId);
 	void rechai(int &ch);
 	void fenat(char ans);
 
@@ -466,10 +466,11 @@ public:
 	SaveStruct _coreVar, _saveStruct;
 
 	int _maff;
-	int _res;
 	int _caff;
 	int _crep;
-	byte _v_lieu[7][25];
+
+	int _resolutionScaler;
+	byte _destinationArray[7][25];
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 96b40d8..bc0f5fe 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -219,8 +219,8 @@ void MouseHandler::showMouse() {
  * @remarks	Originally called 'pos_mouse'
  */
 void MouseHandler::setMousePosition(Common::Point newPos) {
-	if (newPos.x > 314 * g_vm->_res)
-		newPos.x = 314 * g_vm->_res;
+	if (newPos.x > 314 * g_vm->_resolutionScaler)
+		newPos.x = 314 * g_vm->_resolutionScaler;
 	else if (newPos.x < 0)
 		newPos.x = 0;
 	if (newPos.y > 199)
@@ -291,16 +291,16 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			cy = 190;
 			break;
 		case '9':
-			cx = 315 * g_vm->_res;
+			cx = 315 * g_vm->_resolutionScaler;
 			cy = 1;
 			break;
 		case '3':
 			cy = 190;
-			cx = 315 * g_vm->_res;
+			cx = 315 * g_vm->_resolutionScaler;
 			break;
 		case '5':
 			cy = 100;
-			cx = 155 * g_vm->_res;
+			cx = 155 * g_vm->_resolutionScaler;
 			break;
 		case ' ':
 		case '\15':
@@ -354,27 +354,27 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			}
 			break;
 		case 'I':
-			cx = g_vm->_res * 32;
+			cx = g_vm->_resolutionScaler * 32;
 			cy = 8;
 			break;
 		case 'D':
-			cx = 80 * g_vm->_res;
+			cx = 80 * g_vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'A':
-			cx = 126 * g_vm->_res;
+			cx = 126 * g_vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'S':
-			cx = 174 * g_vm->_res;
+			cx = 174 * g_vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'P':
-			cx = 222 * g_vm->_res;
+			cx = 222 * g_vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'F':
-			cx = g_vm->_res * 270;
+			cx = g_vm->_resolutionScaler * 270;
 			cy = 8;
 			break;
 		case '\23':
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e18c5c1..4bdfcb4 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -60,7 +60,7 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
 	inputStr += '$';
 
 	g_vm->_screenSurface.putxy(x, y);
-	if (g_vm->_res == 1)
+	if (g_vm->_resolutionScaler == 1)
 		tab = 10;
 	else
 		tab = 6;
@@ -206,37 +206,37 @@ void TextHandler::taffich() {
 
 	switch (a) {
 	case 16:
-		g_vm->_coreVar._pourc[9] = '*';
-		g_vm->_coreVar._teauto[42] = '*';
+		g_vm->_coreVar._pctHintFound[9] = '*';
+		g_vm->_coreVar._availableQuestion[42] = '*';
 		break;
 	case 20:
-		g_vm->_coreVar._teauto[39] = '*';
-		if (g_vm->_coreVar._teauto[36] == '*') {
-			g_vm->_coreVar._pourc[3] = '*';
-			g_vm->_coreVar._teauto[38] = '*';
+		g_vm->_coreVar._availableQuestion[39] = '*';
+		if (g_vm->_coreVar._availableQuestion[36] == '*') {
+			g_vm->_coreVar._pctHintFound[3] = '*';
+			g_vm->_coreVar._availableQuestion[38] = '*';
 		}
 		break;
 	case 24:
-		g_vm->_coreVar._teauto[37] = '*';
+		g_vm->_coreVar._availableQuestion[37] = '*';
 		break;
 	case 30:
-		g_vm->_coreVar._teauto[9] = '*';
+		g_vm->_coreVar._availableQuestion[9] = '*';
 		break;
-	case 31:
-		g_vm->_coreVar._pourc[4] = '*';
-		g_vm->_coreVar._teauto[35] = '*';
+	case 31: // Coat of arms
+		g_vm->_coreVar._pctHintFound[4] = '*';
+		g_vm->_coreVar._availableQuestion[35] = '*';
 		break;
 	case 118:
-		g_vm->_coreVar._teauto[41] = '*';
+		g_vm->_coreVar._availableQuestion[41] = '*';
 		break;
 	case 143:
-		g_vm->_coreVar._pourc[1] = '*';
+		g_vm->_coreVar._pctHintFound[1] = '*';
 		break;
 	case 150:
-		g_vm->_coreVar._teauto[34] = '*';
+		g_vm->_coreVar._availableQuestion[34] = '*';
 		break;
 	case 151:
-		g_vm->_coreVar._pourc[2] = '*';
+		g_vm->_coreVar._pctHintFound[2] = '*';
 		break;
 	default:
 		break;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index e4fb38c..093f22e 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -46,9 +46,9 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
 void SavegameManager::sync_save(Common::Serializer &sz) {
 	sz.syncAsSint16LE(g_vm->_saveStruct._faithScore);
 	for (int i = 0; i < 11; ++i)
-		sz.syncAsByte(g_vm->_saveStruct._pourc[i]);
+		sz.syncAsByte(g_vm->_saveStruct._pctHintFound[i]);
 	for (int i = 0; i < 43; ++i)
-		sz.syncAsByte(g_vm->_saveStruct._teauto[i]);
+		sz.syncAsByte(g_vm->_saveStruct._availableQuestion[i]);
 	for (int i = 0; i < 31; ++i)
 		sz.syncAsByte(g_vm->_saveStruct._inventory[i]);
 


Commit: 87d97690095ef7cccfdce93a465ad7d4aa649c70
    https://github.com/scummvm/scummvm/commit/87d97690095ef7cccfdce93a465ad7d4aa649c70
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-20T14:54:14-08:00

Commit Message:
MORTEVIELLE:Add initial English translation

Changed paths:
    devtools/create_mortdat/gametext.h



diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index 0e0948e..9efb55b 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -320,149 +320,149 @@ const char *gameDataEn[] =  {
 	"$",
 	"$",
 	"END OF THE CONVERSATION$",
-	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
-	"TBT - Je n'en sais rien !$",
-	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
-	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
-	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
-	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
-	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
-	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
-	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
-	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
-	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
-	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
-	"TBT - Ce sont ses affaires ...$",
-	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
-	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
-	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
-	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
-	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
-	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
-	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
-	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
-	"TBT - Les bijoux ...$",
-	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
-	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
-	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
-	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
-	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
-	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
-	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
-	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
-	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
-	"TBT - Moi je n'ai rien … lui reprocher$",
-	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
-	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
-	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
-	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
-	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
-	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
-	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
-	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
-	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
-	"TBT - C'est pour un rendez-vous ?$",
-	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
-	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
-	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
-	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
-	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
-	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
-	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
-	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
-	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
-	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
-	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
-	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
-	"TBT - Elle aussi, faisait des recherches ...$",
-	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
-	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
-	"TBT - Je crois que tout le monde l'aimait bien$",
-	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
-	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
-	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
-	"TBT - A part sa famille, pas grand monde$",
-	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
-	"TBT - Non rien !$",
-	"TBT - Non ... Pas que le sache$",
-	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
-	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
-	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
-	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
-	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
-	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
-	"TBT - Son dernier pr‚sent m'a surpris$",
-	"TBT - Quel cadeau ?$",
-	"TBT - Un chandellier ...$",
-	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
-	"TBT - Et bien oui ! Comme tout le monde, je crois$",
-	"TBT - Un poignard$",
-	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
-	"TBT - Vous avez un don de double-vue ou un passe-partout$",
-	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
-	"TBT - Vous savez, je la connaissais assez peu$",
-	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
-	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
-	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
-	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
-	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
-	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
-	"TBT - Vous savez ce que c'est : Des relations familiales$",
-	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
-	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
-	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
-	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
-	"TBT - Je ne me rappelle pas$",
-	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
-	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
-	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
-	"TBT - Dommage que la devise soit manquante ...$",
-	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
-	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
-	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
-	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
-	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
-	"TBT - Ca reste pour moi le plus grand des mystŠres$",
-	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
-	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
-	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
-	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
-	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
-	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
-	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
-	"TBT - Julia aimait beaucoup la peinture$",
-	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
-	"TBT - Que faites-vous l… ?$",
-	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
-	"TBT - Je vous ‚coute$",
-	"TBT - Que d‚sirez-vous ?$",
-	"TBT - Oui ?$",
-	"TBT - Je suis … vous ...$",
-	"TBT - C'est pourquoi ?$",
-	"TBT - Allez-y$",
-	"TBT - C'est … quel sujet ?$",
-	"TBT - Max : … votre service, monsieur$",
-	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
-	"TBT - Vous ˆtes trop curieux !$",
-	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
-	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
-	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
-	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"That was the name old people gave to the mountain range that lies at the foot of the manor!$",
+	"These are the mountains one can see in front of the manor$",
+	"I don't know!$",
+	"She died from pulmonary embolism$",
+	"Mother died suddenly. And yet her health had seemed to improve‚$",
+	"Miss DEFRANCK died from a cold$",
+	"She died from pulmonary embolism$",
+	"Excuse me but I prefer to say nothing for now$",
+	"Only the good die young$",
+	"I loved my mother . My only regret is that she died in the DEFRANCK's manor$",
+	"That region has a lot of history and there is plenty to keep me busy. And also I love horses..$",
+	"He is a history enthusiast and a gambler. By the way he won a large sum one year ago$",
+	"He is already very busy with the management and maintenance of the mansion...$",
+	"I am the CEO of a small perfume company. But when I am here, I rest$",
+	"He is a dynamic man who has succeeded in perfurmes$",
+	"Him! He is an upstart rogue! Perfumes must have killed his common sense. Moreover, when he's here he spends his evenings in his room$",
+	"I was very concerned about my mother's health, and now I don't feel like doing anything at all$",
+	"He would have done better to look after me a bit more and a bit less after his mother$",
+	"(313) It is his business...$",
+	"He does not have much luck at the moment although his business is satisfactory$",
+	"I work with Pat but it's not going too well at the moment$",
+	"Oh really?! He has activities? He better take care of them seriously then$",
+	"Him and Pat are patners. I think it's going pretty well$",
+	"I take care of myself and that's already lots. How about you?$",
+	"(319) Oh that! I trust her. She knows how to keep herself busy$",
+	"(320) What! You have not yet discovered her main occupation..?$",
+	"She is working in the decoration business, and tastefully with that. She is always very well dressed$",
+	"If you like jewels, I have some good deals to propose for a short while$",
+	"The jewels...$",
+	"I don't know, but I'd like him to give me a bit more slack!$",
+	"When one is a housewife, one always find something to do...$",
+	"She could stay there doing nothing, but no! She sews, she reads ...$",
+	"She probably doesn't have very fulfilling occupations...$",
+	"A woman like there is no more: She is interested in everything!$",
+	"With the cooking and the cleaning I do not have much time for you$",
+	"I do not know how he manages to do everything. That's wonderful!$",
+	"He would do more if he showed less interest in gossip and alcohol$",
+	"I am very independant. As long as nobody interferes in my business: No problem$",
+	"He is selfish. I wonder if he likes something else than his horses and grimoires$",
+	"I think he gets along well with everyone, except, perhaps, with Guy$",
+	"He has a temper. You have to learn how to deal with him ..$",
+	"Business is business. As for the family, I leave it as it is ...$",
+	"Relations? Friendly relations? Financial relations, without a doubt$",
+	"Oh I don't have anything against him$",
+	"He is a resourceful businessman. He sometimes tries to swim upstream but … he will always find a way to make it work$",
+	"(340) They all bore me .. No! Not even that .. Even if .. some people ..$",
+	"Contrary to his mother, he is a very shy person ! So when you say relations ..$",
+	"He must be trying very hard to remain nice despite all his troubles$",
+	"(343) His romantic relationship: it's over. His relationship with me: hasn't really started. As for the other ones: I don't follow the \"other ones\"$",
+	"I like everyone, as long as they are not trying to screw me over$",
+	"It is not enough to have a bit of money and to know how to talk for everyone to like you$",
+	"Not much to say about him .. He is a nice and generous man. And what's more, he can be quite funny$",
+	"Nowadays I get along rather well with everyone. But, here, I am not going to say more about this$",
+	"(348) Nice feathers, but a bird's brain... Ask her husband$",
+	"Is it for an appointment?$",
+	"(350) She is very lively! She does not burden herself with stupids prejudices$",
+	"In my line of work, one mostly encounters beautiful women and gangsters$",
+	"The only sure thing he has going for him, it's his jewelery .. And his wife, but he doesn't realize that$",
+	"It's an interesting character. Who is not always very easy to follow, but worth knowing$",
+	"I hate no one, but I like things and people when they stay where they should be$",
+	"This stays between us. But you see: when I speak with her, I soon start to feel a bit uncomfortable!$",
+	"You'd have to try hard to not get along with her$",
+	"You know, in my line of work you hear everything but don't remember anything, and service is well done$",
+	"He's a submissive hypocrite! Personally I don't trust him$",
+	"I don't know what he thinks deep down inside, but he's always polite and impeccable$",
+	"Someone who lived in the manor, a year ago .. maybe more$",
+	"She was more than a friend to my mother. In these moments, I would have loved to have her by my side$",
+	"Murielle has been Julia's lady-in-waiting$",
+	"She, too, was doing some research ...$",
+	"She was a very educated person. Her abrupt leaving, a year ago, surprised me and caused me great sorrow$",
+	"Her and Leo shared a common passion for history and the local area$",
+	"I think everyone liked her$",
+	"She got along with everyone. She loved her son dearly. As for the relations between mother-in-law and daughter-in-law ..$",
+	"Apart from Leo, she got along very well with Max ...$",
+	"Even if your relations were unfrequent, Jerome, there was still a place for you in her heart ...$",
+	"(370) Apart from her family, not a lot of people$",
+	"Oh right! I think she deeply regretted this friend's leaving .. err! Marielle .. or Mireille ...$",
+	"No, nothing!$",
+	"No … Not that I know of$",
+	"I met Julia when buying the manor. It was the only thing she owned. But all my wealth was hers ...$",
+	"Apart from a few personal belongings, I think she didn't own anything anymore$",
+	"I think all her fortune came from Leo. So, pfft!$",
+	"(377) Apart from the letter for you I posted, nothing very important!$",
+	"I was very happy she gave me her bound bible as a present$",
+	"It happened fast and she didn't have time to make any particular will$",
+	"Her last gift suprised me$",
+	"Which gift?$",
+	"A chandelier ...$",
+	"Yes, I got a present. My wife even got a bible$",
+	"Well yes! Like everyone, I believe$",
+	"A dagger$",
+	"I have never been looking around in the attic!$",
+	"(387) You either can read the past or pick a door$",
+	"The portrait of a young girl: it's Murielle ...$",
+	"You know, I didn't know her that well$",
+	"She was very charming, but above all she was Julia's lady-in-waiting$",
+	"She was the only truly interesting woman I've met$",
+	"She had a great knowledge in history, and you learned a great deal when you asked her about it$",
+	"(393) I've always wondered why some people fancied her!$",
+	"If the room is closed, ask Leo$",
+	"(395) I closed her door after her death and I'd like it to remain this way for a while$",
+	"You know how it is: family relations$",
+	"All those years, I've never regretted serving her$",
+	"I loved her as much as she loved me, I think$",
+	"What made you think you could enter my wife's room?!!$",
+	"It must be the picture of Murielle with Julia's godson$",
+	"I don't remember$",
+	"This is Murielle. I took that picture, and actually they developed it backwards$",
+	"You sure are curious!... It's not worth anything$",
+	"(404) Grimoires, parchment and manuscripts: it is Leo's realm$",
+	"Too bad the motto doesn't appear here ...$",
+	"This is beautiful … And very old ...$",
+	"Hey! That's a place I've never visited$",
+	"According to Leo, it seems that the Moons are more recent$",
+	"Even under this weather, you managed to find a sun ...$",
+	"Profound and disturbing: Progress is good$",
+	"For me, it remains the biggest of all mysteries$",
+	"The last days she was talking about a trip. And then ...$",
+	"A little over a year ago, one night, she decided to leave ...$",
+	"In any case, she wasn't meant to live here$",
+	"What?! Whose body? Which crypt?$",
+	"If there are any, I have never found them ...$",
+	"Of course! And ghosts too ...$",
+	"It's the oldest in the area: it is from the 11th century$",
+	"It was slightly renovated after the French Revolution$",
+	"Julia loved paintings$",
+	"They are different in styles, but not all of them are worth a lot$",
+	"What are you doing h-$",
+	"I'm sure you are looking for something in here$",
+	"I'm listening$",
+	"What do you want?$",
+	"Yes?$",
+	"I'm all yours ...$",
+	"What's the matter?$",
+	"Go ahead$",
+	"What is it about?$",
+	"Max: at your service, sir$",
+	"In any case you have no business being in here! Get out!!$",
+	"You are too curious!$",
+	"Jerome! It's been a while … I'm very sad to announce you that Julia died. Her family is here: Guy, her son; Eva, her daughter-in-law; Leo, her husband, of course; her son-in-law Pat; cousins, too: Bob, Ida, Luc. The storm is getting stronger, you must stay here. Meals are served at 12am and 7pm, and there is a mass at the chapel every day at 10am$",
+	"When I saw you I knew you would uncover the truth … I knew why you were here: I had found the draft of Julia's letter. But I love to play, so … She hadn't wanted your task to be too easy, to protect me, probably, but she couldn't die knowing this mystery would remain unsolved. Did you find out that the wall of silence is the name the builders gave, during the construction of the manor, to the wall on which the coat of arms hangs? .. And those gifts Julia left before dying were as many false leads, and their true purpose was to highlight how important the parchments were … That's right, more than a year ago I was working with Murielle on the decryption of those manuscripts I had just found. My wife made the connection between our work and Murielle's disappearance, but she never had any proof. Except that ring she found one day while going through my belongings. One night, we went exploring the secret passage we had found. Murielle died by accident in the room of the Virgin.
  I quickly took the ring from her, found the treasure and ran away. I didn't think she was still alive, and I didn't say a word because I needed the money. I told everyone the money was coming from a winning bet at the horseraces … Leave now, since you're not a policeman. Leave me alone!$",
+	"February 1951 ,,, Occupation: private eye. The cold was freezing Paris off, and my cases as well, when ...$",
+	"A letter, a call, memories from a childhood not that long ago. Echoes of the many games we played in the disused rooms of Mortville Manor … And Julia, now an old woman.$",
 	" to the bureau$",
 	" to the kitchen$",
 	" to the cellar$",


Commit: f74600b50c7121827e6ca1e93393cbac229eb8a2
    https://github.com/scummvm/scummvm/commit/f74600b50c7121827e6ca1e93393cbac229eb8a2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-20T15:53:52-08:00

Commit Message:
MORTEVIELLE: Some renaming, remove useless variables, add debugger

Changed paths:
  A engines/mortevielle/debugger.cpp
  A engines/mortevielle/debugger.h
    engines/mortevielle/graphics.h
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
new file mode 100644
index 0000000..fc0e54a
--- /dev/null
+++ b/engines/mortevielle/debugger.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "mortevielle/debugger.h"
+#include "mortevielle/mortevielle.h"
+
+namespace Mortevielle {
+
+Debugger::Debugger() : GUI::Debugger() {
+	DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+}
+
+void Debugger::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
+
+} // End of namespace Mortevielle
diff --git a/engines/mortevielle/debugger.h b/engines/mortevielle/debugger.h
new file mode 100644
index 0000000..57ca94e
--- /dev/null
+++ b/engines/mortevielle/debugger.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.
+ *
+ */
+
+#ifndef MORTEVIELLE_DEBUGGER_H
+#define MORTEVIELLE_DEBUGGER_H
+
+#include "common/scummsys.h"
+#include "gui/debugger.h"
+
+namespace Mortevielle {
+
+class MortevielleEngine;
+
+class Debugger : public GUI::Debugger {
+private:
+	MortevielleEngine *_vm;
+
+public:
+	Debugger();
+	virtual ~Debugger() {}
+	void setParent(MortevielleEngine *vm);
+};
+
+} // End of namespace Mortevielle
+
+#endif
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 03e0d01..7bf39c3 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -48,8 +48,8 @@ public:
 class GfxSurface: public Graphics::Surface {
 private:
 	int _xp, _yp;
-	int _xSize, _ySize, _var12;
-	int _var14, _lookupIndex, _lookupValue;
+	int _xSize, _ySize;
+	int _lookupIndex, _lookupValue;
 	bool _nibbleFlag;
 	int _thickness;
 	int _yInc, _yEnd, _xInc, _xEnd;
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 8e6d94c..5d64961 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -390,9 +390,9 @@ void Menu::menuDown(int ii) {
 /**
  * Menu is being removed, so restore the previous background area.
  */
-void Menu::menuUp(int xx) {
+void Menu::menuUp(int msgId) {
 	if (_multiTitle) {
-		g_vm->charecr(10, (_menuConstants[xx - 1][1] + 1) << 1);
+		g_vm->charecr(10, (_menuConstants[msgId - 1][1] + 1) << 1);
 
 		/* Restore the background area */
 		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
@@ -420,8 +420,9 @@ void Menu::eraseMenu() {
 
 /**
  * Handle updates to the menu
+ * @remarks	Originally called 'mdn'
  */
-void Menu::mdn() {
+void Menu::updateMenu() {
 	if (!_menuActive)
 		return;
 
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 03c0919..712242e 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -68,9 +68,9 @@ public:
 	void enableMenuItem(int menuId);
 	void displayMenu();
 	void drawMenu();
-	void menuUp(int xx);
+	void menuUp(int msgId);
 	void eraseMenu();
-	void mdn();
+	void updateMenu();
 	void initMenu();
 
 	void setSearchMenu();
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 38e6e05..9cce597 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/mortevielle
 
 MODULE_OBJS := \
 	actions.o \
+	debugger.o \
 	detection.o \
 	dialogs.o \
 	graphics.o \
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 2b95bce..3875d8d 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -74,6 +74,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 		Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle"),
 		_soundManager(_mixer) {
 	g_vm = this;
+	_debugger.setParent(this);
 	_lastGameFrame = 0;
 	_mouseClick = false;
 	_inMainGameLoop = false;
@@ -345,6 +346,8 @@ bool MortevielleEngine::keyPressed() {
 		_lastGameFrame = g_system->getMillis();
 
 		_screenSurface.updateScreen();
+
+		_debugger.onFrame();
 	}
 
 	// Delay briefly to keep CPU usage down
@@ -409,8 +412,13 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
 	// Character to add
 	char ch = evt.kbd.ascii;
 
-	// Handle alphabetic keys
-	if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
+	// Check for debugger
+	if ((evt.kbd.keycode == Common::KEYCODE_d) && (evt.kbd.flags & Common::KBD_CTRL)) {
+		// Attach to the debugger
+		_debugger.attach();
+		_debugger.onFrame();
+	} else if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
+		// Handle alphabetic keys
 		if (evt.kbd.hasFlags(Common::KBD_CTRL))
 			ch = evt.kbd.keycode - Common::KEYCODE_a + 1;
 		else
@@ -523,6 +531,8 @@ void MortevielleEngine::delay(int amount) {
 		if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
 			_lastGameFrame = g_system->getMillis();
 			_screenSurface.updateScreen();
+
+			_debugger.onFrame();
 		}
 
 		g_system->delayMillis(10);
@@ -647,7 +657,7 @@ void MortevielleEngine::handleAction() {
 
 		_inMainGameLoop = true;
 		do {
-			_menu.mdn();
+			_menu.updateMenu();
 			prepareRoom();
 			_mouse.moveMouse(funct, inkey);
 			CHECK_QUIT;
@@ -982,7 +992,7 @@ int MortevielleEngine::getPresenceStatsGreenRoom() {
 	else if ((hour >= 0) && (hour < 8))
 		retVal = 70;
 
-	_menu.mdn();
+	_menu.updateMenu();
 
 	return retVal;
 }
@@ -2258,11 +2268,8 @@ Common::String MortevielleEngine::getString(int num) {
 }
 
 void MortevielleEngine::copcha() {
-	int i = kAcha;
-	do {
+	for (int i = kAcha; i < kAcha + 390; i++)
 		_tabdon[i] = _tabdon[i + 390];
-		++i;
-	} while (i != kAcha + 390);
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 81baab9..aeef3dd 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -37,6 +37,7 @@
 #include "engines/engine.h"
 #include "common/error.h"
 #include "graphics/surface.h"
+#include "mortevielle/debugger.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
@@ -475,6 +476,7 @@ public:
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
 
+	Debugger _debugger;
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
 	GfxSurface _backgroundSurface;


Commit: 4646c9eb992d1b4556893972777da303cd6c56d9
    https://github.com/scummvm/scummvm/commit/4646c9eb992d1b4556893972777da303cd6c56d9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-20T15:55:58-08:00

Commit Message:
MORTEVIELLE: Add new DAT file containing initial English translation

Changed paths:
    dists/engine-data/mort.dat



diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index 4415f57..f9cd1ec 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: 0a296783a4603fb4af1a76c0e69d46058d02ed16
    https://github.com/scummvm/scummvm/commit/0a296783a4603fb4af1a76c0e69d46058d02ed16
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-20T22:57:31-08:00

Commit Message:
MORTEVIELLE: Add two debug functions required to check the English translation

Changed paths:
    engines/mortevielle/debugger.cpp
    engines/mortevielle/debugger.h



diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index fc0e54a..b0b9dc7 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -27,8 +27,25 @@ namespace Mortevielle {
 
 Debugger::Debugger() : GUI::Debugger() {
 	DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+	DCmd_Register("show_questions", WRAP_METHOD(Debugger, Cmd_showAllQuestions));
+	DCmd_Register("reset_parano", WRAP_METHOD(Debugger, Cmd_resetParano));
 }
 
+bool Debugger::Cmd_showAllQuestions(int argc, const char **argv) {
+	for (int i = 1; i <= 10; ++i)
+		_vm->_coreVar._pctHintFound[i] = '*';
+
+	for (int i = 1; i <= 42; ++i)
+		_vm->_coreVar._availableQuestion[i] = '*';
+
+	return true;
+}
+
+bool Debugger::Cmd_resetParano(int argc, const char **argv) {
+	_vm->_coreVar._faithScore = 0;
+
+	return true;
+}
 void Debugger::setParent(MortevielleEngine *vm) {
 	_vm = vm;
 }
diff --git a/engines/mortevielle/debugger.h b/engines/mortevielle/debugger.h
index 57ca94e..9041d90 100644
--- a/engines/mortevielle/debugger.h
+++ b/engines/mortevielle/debugger.h
@@ -34,6 +34,10 @@ class Debugger : public GUI::Debugger {
 private:
 	MortevielleEngine *_vm;
 
+protected:
+	bool Cmd_showAllQuestions(int argc, const char **argv);
+	bool Cmd_resetParano(int argc, const char **argv);
+
 public:
 	Debugger();
 	virtual ~Debugger() {}


Commit: 15b0e969b2c7b63f0108acce769634158ed3ff80
    https://github.com/scummvm/scummvm/commit/15b0e969b2c7b63f0108acce769634158ed3ff80
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-22T04:42:01-08:00

Commit Message:
MORTEVIELLE: Fix minor glitches in DAT file

Changed paths:
    devtools/create_mortdat/gametext.h
    dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index 9efb55b..bd3c340 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -285,7 +285,7 @@ const char *gameDataEn[] =  {
 	"Julia's bedroom$",
 	"The photo at Julia's home$",
 	"Julia and yourself...$",
-	"L‚o's occupations$",
+	"Léo's occupations$",
 	"Pat's occupations$",
 	"Guy's occupations$",
 	"Bob's occupations$",
@@ -294,7 +294,7 @@ const char *gameDataEn[] =  {
 	"Ida's occupations$",
 	"Max's occupations$",
 	"Your occupations$",
-	"L‚o's relationships$",
+	"Léo's relationships$",
 	"Pat's relationships$",
 	"Guy's relationships$",
 	"Bob's relationships$",
@@ -324,7 +324,7 @@ const char *gameDataEn[] =  {
 	"These are the mountains one can see in front of the manor$",
 	"I don't know!$",
 	"She died from pulmonary embolism$",
-	"Mother died suddenly. And yet her health had seemed to improve‚$",
+	"Mother died suddenly. And yet her health had seemed to improve$",
 	"Miss DEFRANCK died from a cold$",
 	"She died from pulmonary embolism$",
 	"Excuse me but I prefer to say nothing for now$",
@@ -345,13 +345,13 @@ const char *gameDataEn[] =  {
 	"Him and Pat are patners. I think it's going pretty well$",
 	"I take care of myself and that's already lots. How about you?$",
 	"(319) Oh that! I trust her. She knows how to keep herself busy$",
-	"(320) What! You have not yet discovered her main occupation..?$",
+	"(320) What! You have not yet discovered her main occupation...?$",
 	"She is working in the decoration business, and tastefully with that. She is always very well dressed$",
 	"If you like jewels, I have some good deals to propose for a short while$",
 	"The jewels...$",
 	"I don't know, but I'd like him to give me a bit more slack!$",
 	"When one is a housewife, one always find something to do...$",
-	"She could stay there doing nothing, but no! She sews, she reads ...$",
+	"She could stay there doing nothing, but no! She sews, she reads...$",
 	"She probably doesn't have very fulfilling occupations...$",
 	"A woman like there is no more: She is interested in everything!$",
 	"With the cooking and the cleaning I do not have much time for you$",
@@ -360,24 +360,24 @@ const char *gameDataEn[] =  {
 	"I am very independant. As long as nobody interferes in my business: No problem$",
 	"He is selfish. I wonder if he likes something else than his horses and grimoires$",
 	"I think he gets along well with everyone, except, perhaps, with Guy$",
-	"He has a temper. You have to learn how to deal with him ..$",
-	"Business is business. As for the family, I leave it as it is ...$",
+	"He has a temper. You have to learn how to deal with him...$",
+	"Business is business. As for the family, I leave it as it is...$",
 	"Relations? Friendly relations? Financial relations, without a doubt$",
 	"Oh I don't have anything against him$",
-	"He is a resourceful businessman. He sometimes tries to swim upstream but … he will always find a way to make it work$",
-	"(340) They all bore me .. No! Not even that .. Even if .. some people ..$",
-	"Contrary to his mother, he is a very shy person ! So when you say relations ..$",
+	"He is a resourceful businessman. He sometimes tries to swim upstream but... he will always find a way to make it work$",
+	"(340) They all bore me... No! Not even that... Even if... some people...$",
+	"Contrary to his mother, he is a very shy person ! So when you say relations...$",
 	"He must be trying very hard to remain nice despite all his troubles$",
 	"(343) His romantic relationship: it's over. His relationship with me: hasn't really started. As for the other ones: I don't follow the \"other ones\"$",
 	"I like everyone, as long as they are not trying to screw me over$",
 	"It is not enough to have a bit of money and to know how to talk for everyone to like you$",
-	"Not much to say about him .. He is a nice and generous man. And what's more, he can be quite funny$",
+	"Not much to say about him... He is a nice and generous man. And what's more, he can be quite funny$",
 	"Nowadays I get along rather well with everyone. But, here, I am not going to say more about this$",
 	"(348) Nice feathers, but a bird's brain... Ask her husband$",
 	"Is it for an appointment?$",
 	"(350) She is very lively! She does not burden herself with stupids prejudices$",
 	"In my line of work, one mostly encounters beautiful women and gangsters$",
-	"The only sure thing he has going for him, it's his jewelery .. And his wife, but he doesn't realize that$",
+	"The only sure thing he has going for him, it's his jewelery... And his wife, but he doesn't realize that$",
 	"It's an interesting character. Who is not always very easy to follow, but worth knowing$",
 	"I hate no one, but I like things and people when they stay where they should be$",
 	"This stays between us. But you see: when I speak with her, I soon start to feel a bit uncomfortable!$",
@@ -385,21 +385,21 @@ const char *gameDataEn[] =  {
 	"You know, in my line of work you hear everything but don't remember anything, and service is well done$",
 	"He's a submissive hypocrite! Personally I don't trust him$",
 	"I don't know what he thinks deep down inside, but he's always polite and impeccable$",
-	"Someone who lived in the manor, a year ago .. maybe more$",
+	"Someone who lived in the manor, a year ago... maybe more$",
 	"She was more than a friend to my mother. In these moments, I would have loved to have her by my side$",
 	"Murielle has been Julia's lady-in-waiting$",
-	"She, too, was doing some research ...$",
+	"She, too, was doing some research...$",
 	"She was a very educated person. Her abrupt leaving, a year ago, surprised me and caused me great sorrow$",
 	"Her and Leo shared a common passion for history and the local area$",
 	"I think everyone liked her$",
-	"She got along with everyone. She loved her son dearly. As for the relations between mother-in-law and daughter-in-law ..$",
-	"Apart from Leo, she got along very well with Max ...$",
-	"Even if your relations were unfrequent, Jerome, there was still a place for you in her heart ...$",
+	"She got along with everyone. She loved her son dearly. As for the relations between mother-in-law and daughter-in-law...$",
+	"Apart from Leo, she got along very well with Max....$",
+	"Even if your relations were unfrequent, Jerome, there was still a place for you in her heart...$",
 	"(370) Apart from her family, not a lot of people$",
-	"Oh right! I think she deeply regretted this friend's leaving .. err! Marielle .. or Mireille ...$",
+	"Oh right! I think she deeply regretted this friend's leaving... err! Marielle... or Mireille...$",
 	"No, nothing!$",
-	"No … Not that I know of$",
-	"I met Julia when buying the manor. It was the only thing she owned. But all my wealth was hers ...$",
+	"No... Not that I know of$",
+	"I met Julia when buying the manor. It was the only thing she owned. But all my wealth was hers...$",
 	"Apart from a few personal belongings, I think she didn't own anything anymore$",
 	"I think all her fortune came from Leo. So, pfft!$",
 	"(377) Apart from the letter for you I posted, nothing very important!$",
@@ -407,13 +407,13 @@ const char *gameDataEn[] =  {
 	"It happened fast and she didn't have time to make any particular will$",
 	"Her last gift suprised me$",
 	"Which gift?$",
-	"A chandelier ...$",
+	"A chandelier...$",
 	"Yes, I got a present. My wife even got a bible$",
 	"Well yes! Like everyone, I believe$",
 	"A dagger$",
 	"I have never been looking around in the attic!$",
 	"(387) You either can read the past or pick a door$",
-	"The portrait of a young girl: it's Murielle ...$",
+	"The portrait of a young girl: it's Murielle...$",
 	"You know, I didn't know her that well$",
 	"She was very charming, but above all she was Julia's lady-in-waiting$",
 	"She was the only truly interesting woman I've met$",
@@ -430,19 +430,19 @@ const char *gameDataEn[] =  {
 	"This is Murielle. I took that picture, and actually they developed it backwards$",
 	"You sure are curious!... It's not worth anything$",
 	"(404) Grimoires, parchment and manuscripts: it is Leo's realm$",
-	"Too bad the motto doesn't appear here ...$",
-	"This is beautiful … And very old ...$",
+	"Too bad the motto doesn't appear here...$",
+	"This is beautiful... And very old...$",
 	"Hey! That's a place I've never visited$",
 	"According to Leo, it seems that the Moons are more recent$",
-	"Even under this weather, you managed to find a sun ...$",
+	"Even under this weather, you managed to find a sun...$",
 	"Profound and disturbing: Progress is good$",
 	"For me, it remains the biggest of all mysteries$",
-	"The last days she was talking about a trip. And then ...$",
-	"A little over a year ago, one night, she decided to leave ...$",
+	"The last days she was talking about a trip. And then...$",
+	"A little over a year ago, one night, she decided to leave...$",
 	"In any case, she wasn't meant to live here$",
 	"What?! Whose body? Which crypt?$",
-	"If there are any, I have never found them ...$",
-	"Of course! And ghosts too ...$",
+	"If there are any, I have never found them...$",
+	"Of course! And ghosts too...$",
 	"It's the oldest in the area: it is from the 11th century$",
 	"It was slightly renovated after the French Revolution$",
 	"Julia loved paintings$",
@@ -452,17 +452,17 @@ const char *gameDataEn[] =  {
 	"I'm listening$",
 	"What do you want?$",
 	"Yes?$",
-	"I'm all yours ...$",
+	"I'm all yours...$",
 	"What's the matter?$",
 	"Go ahead$",
 	"What is it about?$",
 	"Max: at your service, sir$",
 	"In any case you have no business being in here! Get out!!$",
 	"You are too curious!$",
-	"Jerome! It's been a while … I'm very sad to announce you that Julia died. Her family is here: Guy, her son; Eva, her daughter-in-law; Leo, her husband, of course; her son-in-law Pat; cousins, too: Bob, Ida, Luc. The storm is getting stronger, you must stay here. Meals are served at 12am and 7pm, and there is a mass at the chapel every day at 10am$",
-	"When I saw you I knew you would uncover the truth … I knew why you were here: I had found the draft of Julia's letter. But I love to play, so … She hadn't wanted your task to be too easy, to protect me, probably, but she couldn't die knowing this mystery would remain unsolved. Did you find out that the wall of silence is the name the builders gave, during the construction of the manor, to the wall on which the coat of arms hangs? .. And those gifts Julia left before dying were as many false leads, and their true purpose was to highlight how important the parchments were … That's right, more than a year ago I was working with Murielle on the decryption of those manuscripts I had just found. My wife made the connection between our work and Murielle's disappearance, but she never had any proof. Except that ring she found one day while going through my belongings. One night, we went exploring the secret passage we had found. Murielle died by accident in the room of the Virgin.
  I quickly took the ring from her, found the treasure and ran away. I didn't think she was still alive, and I didn't say a word because I needed the money. I told everyone the money was coming from a winning bet at the horseraces … Leave now, since you're not a policeman. Leave me alone!$",
-	"February 1951 ,,, Occupation: private eye. The cold was freezing Paris off, and my cases as well, when ...$",
-	"A letter, a call, memories from a childhood not that long ago. Echoes of the many games we played in the disused rooms of Mortville Manor … And Julia, now an old woman.$",
+	"Jerome! It's been a while... I'm very sad to announce you that Julia died. Her family is here: Guy, her son; Eva, her daughter-in-law; Leo, her husband, of course; her son-in-law Pat; cousins, too: Bob, Ida, Luc. The storm is getting stronger, you must stay here. Meals are served at 12am and 7pm, and there is a mass at the chapel every day at 10am$",
+	"When I saw you I knew you would uncover the truth... I knew why you were here: I had found the draft of Julia's letter. But I love to play, so à She hadn't wanted your task to be too easy, to protect me, probably, but she couldn't die knowing this mystery would remain unsolved. Did you find out that the wall of silence is the name the builders gave, during the construction of the manor, to the wall on which the coat of arms hangs?.. And those gifts Julia left before dying were as many false leads, and their true purpose was to highlight how important the parchments were à That's right, more than a year ago I was working with Murielle on the decryption of those manuscripts I had just found. My wife made the connection between our work and Murielle's disappearance, but she never had any proof. Except that ring she found one day while going through my belongings. One night, we went exploring the secret passage we had found. Murielle died by accident in the room of the Virgin.
  I quickly took the ring from her, found the treasure and ran away. I didn't think she was still alive, and I didn't say a word because I needed the money. I told everyone the money was coming from a winning bet at the horseraces à Leave now, since you're not a policeman. Leave me alone!$",
+	"February 1951... Occupation: private eye. The cold was freezing Paris off, and my cases as well, when...$",
+	"A letter, a call, memories from a childhood not that long ago. Echoes of the many games we played in the disused rooms of Mortville Manor... And Julia, now an old woman.$",
 	" to the bureau$",
 	" to the kitchen$",
 	" to the cellar$",
@@ -493,7 +493,7 @@ const char *gameDataEn[] =  {
 	"Directed by: KYILKHOR CREATION and LANGLOIS$",
 	"$",
 	"With the cooperation of...$",
-	"B‚atrice et Jean_Luc LANGLOIS$",
+	"Béatrice et Jean_Luc LANGLOIS$",
 	"for the music and the voices,$",
 	"Bernard GRELAUD for the graphic conception,$",
 	"MARIA-DOLORES for the graphic direction,$",
@@ -592,7 +592,7 @@ const char *gameDataEn[] =  {
 	"- 11$",
 	"What was the first name at of the unknown character?$",
 	"- Mireille$",
-	"- Fran‡oise$",
+	"- Françoise$",
 	"- Maguy$",
 	"- Emilie$",
 	"- Murielle$",
@@ -609,7 +609,7 @@ const char *gameDataEn[] =  {
 	"[1][ | Disk error | All stop... ][ok]$",
 	"[1][ | You should have noticed |00% of the clues ][ok]$",
 	"[3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
 	"TBT -  MASTER .$",
 	"TBT -   rorL$",
 	NULL
@@ -617,9 +617,9 @@ const char *gameDataEn[] =  {
 
 const char *gameDataFr[] = {
 	"Le calme dans la tourmente$",
-	"Des go—ts et des couleurs!$",
+	"Des goûts et des couleurs!$",
 	"Mauve qui peut!$",
-	"PriŠre de laisser en sortant...$",
+	"Prière de laisser en sortant...$",
 	"Trou noir troublant$",
 	"Bleu... comme \"peur bleue\"!$",
 	"Chambre de \"Saigneur\"!$",
@@ -629,33 +629,33 @@ const char *gameDataFr[] = {
 	"Odeur de feux de bois et de tabac$",
 	"Tabac et vieux bouquins$",
 	"Oignons, cannelle et spiritueux$",
-	"Un endroit bien peu visit‚$",
-	"Humidit‚ et moisissure$",
+	"Un endroit bien peu visité$",
+	"Humidité et moisissure$",
 	"Avis aux colporteurs...$",
-	"Corps putr‚fi‚ : cryptomanie mortelle!$",
-	"Et en plus... des piŠges d‚samorc‚s!$",
-	"C'est d‚j… ouvert$",
+	"Corps putréfié : cryptomanie mortelle!$",
+	"Et en plus... des pièges désamorcés!$",
+	"C'est déjà ouvert$",
 	"Danger : avalanches$",
-	"Une odeur de saintet‚!$",
+	"Une odeur de sainteté!$",
 	"Une bƒtisse imposante$",
-	"L'envers du mystŠre!$",
-	"Dr“le d'horoscope!$",
+	"L'envers du mystère!$",
+	"Drôle d'horoscope!$",
 	"Tant va la cruche...$",
-	"Une porte en chŠne$",
+	"Une porte en chène$",
 	"Une photo$",
 	"Les armoiries$",
 	"$",
-	"Max, le domestique, vous accueille puis vous conduit … votre chambre$",
-	"Mortevielle, le 16/2/51@         Mon cher J‚r“me,@ Suite … mon t‚l‚gramme, je vous fais part des raisons de mon inqui‚tude :il y a un an, Murielle, ma dame de compagnie, disparaissait . D‚part ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile … comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'… pr‚sent, faire le jour sur cette affaire, je compte sur vous pour la mener … bien . Si mon ‚tat de sant‚ ne s'am‚liorait pas, prenez les d‚cisions qui vous sembleront le plus  appropri‚es...@             Amiti‚s. JULIA DEFRANCK$",
-	"Plus tard, Guy vous apprendra le suicide de L‚o...  aprŠs un pari insens‚ aux courses!$",
+	"Max, le domestique, vous accueille puis vous conduit à votre chambre$",
+	"Mortevielle, le 16/2/51@         Mon cher Jérôme,@ Suite à mon télégramme, je vous fais part des raisons de mon inquiétude :il y a un an, Murielle, ma dame de compagnie, disparaissait . Départ ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile à comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'à présent, faire le jour sur cette affaire, je compte sur vous pour la mener à bien . Si mon état de santé ne s'améliorait pas, prenez les décisions qui vous sembleront le plus  appropriées...@             Amitiés. JULIA DEFRANCK$",
+	"Plus tard, Guy vous apprendra le suicide de Léo...  après un pari insensé aux courses!$",
 	"F3: encore at F8: suite$",
-	"Le maŒtre des lieux$",
-	"Le futur h‚ritier$",
+	"Le maître des lieux$",
+	"Le futur héritier$",
 	"Le fils de JULIA$",
 	"Joli brin!!!$",
 	"Superman!$",
 	"Le mari d'Ida$",
-	"Propos int‚ressants?$",
+	"Propos intéressants?$",
 	"Service compris...$",
 	"Rien dessous!$",
 	"Un ange passe...$",
@@ -663,61 +663,61 @@ const char *gameDataFr[] = {
 	"Admirez! Contemplez!$",
 	"Non ! Rien !$",
 	"Impossible$",
-	"‡a tache !$",
-	"Un trait‚ sur l'histoire de la r‚gion$",
-	"Quelques piŠces$",
+	"ça tache !$",
+	"Un traité sur l'histoire de la région$",
+	"Quelques pièces$",
 	"Premier commandement...$",
-	"Des p‚tales plein les narines !$",
+	"Des pétales plein les narines !$",
 	"Pique, Coeur...$",
-	"‡a ne manque pas de cachets !$",
+	"ça ne manque pas de cachets !$",
 	"Un roman d'amour$",
 	"Souffler n'est pas jouer$",
-	"Pas une r‚ussite!$",
+	"Pas une réussite!$",
 	"Gare aux rebondissements !$",
 	"Sombre et profond...$",
 	"Sensations normales$",
 	"Sniff!$",
 	"Pas discret ! Contentez-vous de regarder !$",
-	"Atchoum! De la p... poussiŠre$",
-	"La toile est sign‚e... pas le papier peint !$",
+	"Atchoum! De la p... poussière$",
+	"La toile est signée... pas le papier peint !$",
 	"Pas de chance, rien !$",
 	"Soyez plus discret !$",
 	"Les volets sont clos$",
 	"De la neige, encore de la neige !$",
-	"G‚nial : une toile de maŒtre !$",
-	"Aucun doute : une v‚ritable imitation$",
+	"Génial : une toile de maître !$",
+	"Aucun doute : une véritable imitation$",
 	"Hum ! Vous tiquez : de l'antique en toc !$",
-	"Une piŠce rare de valeur !$",
+	"Une pièce rare de valeur !$",
 	"Rien de remarquable$",
 	"Linge, objets personnels...$",
-	"Pas n'importe o— !$",
+	"Pas n'importe où !$",
 	"Ce n'est pas l'heure !$",
-	"On ne parle pas la bouche pleine ! Donc, une fois le repas termin‚...$",
+	"On ne parle pas la bouche pleine ! Donc, une fois le repas terminé...$",
 	"Quelqu'un entre, s'affaire, ressort...$",
 	"On s'approche de votre cachette !$",
 	"On vous surprend !$",
-	"Non : vous ˆtes trop charg‚ !$",
+	"Non : vous êtes trop chargé !$",
 	"Essayez de nouveau$",
 	"Vous restez perplexe !?$",
 	"Vous quittez le Manoir. A Paris, un message vous attend...$",
-	"A‹e, a‹e, a‹e !$",
+	"Aïe, aïe, aïe !$",
 	"Rien de plus$",
-	"Le son paraŒt normal$",
+	"Le son paraît normal$",
 	"Ca ne bouge pas$",
-	"On vous r‚pond$",
+	"On vous répond$",
 	"Pas le moment !$",
-	"Mˆme matiŠre, autre face !$",
-	"Le reflet est piqu‚, mais le cadre est d'or$",
+	"Même matière, autre face !$",
+	"Le reflet est piqué, mais le cadre est d'or$",
 	"Bibelots, babioles...$",
-	"Vous essuyez un ‚chec !$",
+	"Vous essuyez un échec !$",
 	"Il est des odeurs... qu'il vaut mieux ne pas voir !$",
-	"Des produits m‚nagers$",
-	"‡a vous d‚mange ?$",
-	"C'est coinc‚, gel‚ ! Brrrr...$",
-	"Les huisseries sont bloqu‚es !$",
+	"Des produits ménagers$",
+	"ça vous démange ?$",
+	"C'est coincé, gelé ! Brrrr...$",
+	"Les huisseries sont bloquées !$",
 	"Des papiers...$",
-	"Non ! Le pŠre Noˆl n'est pas coinc‚ !$",
-	"‡a donne sur un couloir$",
+	"Non ! Le père Noêl n'est pas coincé !$",
+	"ça donne sur un couloir$",
 	"Vaisselle, argenterie...$",
 	"Non ! Ce ne sont pas les restes de Julia !$",
 	"Une gravure ancienne$",
@@ -726,17 +726,17 @@ const char *gameDataFr[] = {
 	"Le passage se ferme$",
 	"Un tiroir secret... Un livret ! Le lisez-vous ?$",
 	"Le tiroir se referme$",
-	"Rien ! Sang et chairs collent … la pierre !$",
-	"Des d‚tails vous font supposer que... la mort ne fut pas imm‚diate !$",
-	"Des projets v‚reux ?$",
-	"Sa vie n'aurait-elle tenu qu'… un doigt ?$",
-	"Un tr‚sor se serait-il fait la malle ?$",
-	"Une fente de la taille d'une piŠce !$",
-	"Quelques pierres pivotent... Une crypte ! Y p‚n‚trez-vous ?$",
+	"Rien ! Sang et chairs collent à la pierre !$",
+	"Des détails vous font supposer que... la mort ne fut pas immédiate !$",
+	"Des projets véreux ?$",
+	"Sa vie n'aurait-elle tenu qu'à un doigt ?$",
+	"Un trésor se serait-il fait la malle ?$",
+	"Une fente de la taille d'une pièce !$",
+	"Quelques pierres pivotent... Une crypte ! Y pénétrez-vous ?$",
 	"La bague tourne, le mur se referme...$",
-	"Une colonne de pierres derriŠre l'autel$",
+	"Une colonne de pierres derrière l'autel$",
 	"Il y a du bruit...$",
-	"Occup‚ !$",
+	"Occupé !$",
 	"Retentez-vous votre chance ?$",
 	"Trop profond !$",
 	"Le mur de la cave pivote$",
@@ -745,45 +745,45 @@ const char *gameDataFr[] = {
 	"L'objet glisse au fond...$",
 	"Vous n'avez rien en main$",
 	"Ce n'est pas ouvert$",
-	"Il y a d‚j… quelque chose$",
-	"La porte est ferm‚e$",
-	"Pas de r‚ponse$",
+	"Il y a déjà quelque chose$",
+	"La porte est fermée$",
+	"Pas de réponse$",
 	"Une boule de bois pleine$",
 	"Il n'y a plus de place$",
-	"Une boule de bois perc‚e par le travers$",
+	"Une boule de bois percée par le travers$",
 	"? ?$",
 	"A vous de jouer$",
 	"OK !$",
-	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  D‚tective \"priv‚\"... de bon sens et de discr‚tion sans doute\" . D‚‡u d‚moralis‚, vous quittez le manoir at Vous Štes NUL !$",
-	"L‚o vous interrompt : \"la tempŠte est calm‚e. Je pars en ville dans 1 heure. Tenez-vous prˆt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
-	"Congestion, grippe fatale : vous y restez ! Votre enquŠte tombe … l'eau$",
-	"L'eau monte trŠs vite et refroidit vos derniŠres illusions...  Avant que vous n'ayez eu le temps de r‚agir, vous Štes mort!$",
-	"A peine Štes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
-	"La tempŠte recouvre vos traces . Un mur de silence s'abat sur vos ‚paules . Lentement vous succombez … la morsure du froid !$",
-	"Pas si seul que ‡a ! Une lame glac‚e s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
-	"Vous ignorez la responsabilit‚ exacte de L‚o dans la mort de Murielle... Est-elle morte sur le coup ? De toutes fa‡ons les problŠmes familiaux d‚couverts lors de votre enquŠte justifient l'attitude de L‚o... Vous n'Štes pas s—r que Julia vous ait appel‚ pour ‡a mais c'est suffisant pour vous ! Par respect pour elle, et aprŠs  certaines pr‚cautions, vous avez une entrevue r‚v‚latrice avec L‚o$",
+	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  Détective \"privé\"... de bon sens et de discrétion sans doute\" . Déçu démoralisé, vous quittez le manoir at Vous ètes NUL !$",
+	"Léo vous interrompt : \"la tempète est calmée. Je pars en ville dans 1 heure. Tenez-vous prêt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
+	"Congestion, grippe fatale : vous y restez ! Votre enquète tombe à l'eau$",
+	"L'eau monte très vite et refroidit vos dernières illusions...  Avant que vous n'ayez eu le temps de réagir, vous ètes mort!$",
+	"A peine ètes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
+	"La tempète recouvre vos traces . Un mur de silence s'abat sur vos épaules . Lentement vous succombez à la morsure du froid !$",
+	"Pas si seul que ça ! Une lame glacée s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
+	"Vous ignorez la responsabilité exacte de Léo dans la mort de Murielle... Est-elle morte sur le coup ? De toutes façons les problèmes familiaux découverts lors de votre enquète justifient l'attitude de Léo... Vous n'ètes pas sûr que Julia vous ait appelé pour ça mais c'est suffisant pour vous ! Par respect pour elle, et après  certaines précautions, vous avez une entrevue révélatrice avec Léo$",
 	"$",
-	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans r‚ponse . Vous allez attraper... la mort !$",
-	"D'un mouvement circulaire, l'‚p‚e vous fend par le travers : tripes et boyaux … l'air, bonjour les vers!$",
+	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans réponse . Vous allez attraper... la mort !$",
+	"D'un mouvement circulaire, l'épée vous fend par le travers : tripes et boyaux à l'air, bonjour les vers!$",
 	"Home, Sweet home !$",
-	"MystŠre d'une porte close$",
-	"Charme envo—tant de vieilles piŠces$",
+	"Mystère d'une porte close$",
+	"Charme envoûtant de vieilles pièces$",
 	"La faim au ventre$",
-	"Plus prŠs du ciel? Pas s—r !$",
+	"Plus près du ciel? Pas sûr !$",
 	"Peur du noir?$",
 	"Vieux tapis et reflets d'or$",
 	"Angoisse !$",
-	"Sauv‚ ? Pas certain !$",
-	"Mal … l'aise, hein !$",
+	"Sauvé ? Pas certain !$",
+	"Mal à l'aise, hein !$",
 	"Toujours plus loin !$",
 	"Votre chemin de croix !$",
-	"A la d‚couverte de...$",
-	"Attention … ce que cache...$",
+	"A la découverte de...$",
+	"Attention à ce que cache...$",
 	"Une descente aux Enfers !$",
 	"Si ce n'est pas dans vos cordes :@       ne soyez pas sot!$",
-	"Avant la mise en piŠce !$",
+	"Avant la mise en pièce !$",
 	"Gros plan sur :$",
-	"Vous remarquez particuliŠrement...$",
+	"Vous remarquez particulièrement...$",
 	"Et encore...$",
 	"C'est fini !$",
 	"Un peu de lecture$",
@@ -794,17 +794,17 @@ const char *gameDataFr[] = {
 	"Non ! Pas ce coup-ci$",
 	"Trop tard$",
 	"$",
-	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumiŠre, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artŠre comme un rat au coeur mˆme de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
-	"10/1/50: Nous avons r‚solu le mystŠre du manuscrit et localis‚ la crypte . Est-ce l'id‚e d'aboutir dans ce qui n'‚tait qu'un \"rŠve\" qui me rend si anxieuse ?@Je regrette de m'ˆtre engag‚e vis … vis de L‚o . Non! je dois continuer ! J'aurais d— mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
-	"Porte ta priŠre au lieu saint qui se doit, changes-en l'air, tu auras la matiŠre !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton …me s'ouvrira un chemin et gagnera son Šre . Avance comme un Orph‚e peu soucieux des t‚nŠbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'… la myst‚rieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse premiŠre.$",
-	"Les montagnes sont les crocs d'une gueule dantesque ouverte … l'infini de quelqu' orgie c‚leste, mastiquant des ‚toiles comme nous broyons du noir . at Tu d‚poseras l'accord de pierre … tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mŠtre . Tu passeras ainsi entre les deux croissants, par del… les abŒmes du Mur du Silence . La Cl‚ des champs est … ta port‚e, tu n'as qu'… retrouver la note qui d‚note.$",
+	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumière, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artère comme un rat au coeur même de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
+	"10/1/50: Nous avons résolu le mystère du manuscrit et localisé la crypte . Est-ce l'idée d'aboutir dans ce qui n'était qu'un \"rêve\" qui me rend si anxieuse ?@Je regrette de m'être engagée vis à vis de Léo . Non! je dois continuer ! J'aurais dû mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
+	"Porte ta prière au lieu saint qui se doit, changes-en l'air, tu auras la matière !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton âme s'ouvrira un chemin et gagnera son ère . Avance comme un Orphée peu soucieux des ténèbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'à la mystérieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse première.$",
+	"Les montagnes sont les crocs d'une gueule dantesque ouverte à l'infini de quelqu' orgie céleste, mastiquant des étoiles comme nous broyons du noir . at Tu déposeras l'accord de pierre à tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mètre . Tu passeras ainsi entre les deux croissants, par delà les abîmes du Mur du Silence . La Clé des champs est à ta portée, tu n'as qu'à retrouver la note qui dénote.$",
 	"                DECEMBRE@   9 REMISE     518    13 AGIOS       23@  19 VIREMENT  1203    17 TRESOR    1598@      TOTAL     1721        TOTAL    1721$",
-	"  Le 5/01/51@@              Luc, mon amour@ Guy connaŒt notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'… toi !  Max me relance mais j'ai d‚finitivement rompu avec lui . Qu'il reste … ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
-	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr‚t‚s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
-	"  Mortevielle, le 15/2/51@              MaŒtre,@ Je vous ‚cris au sujet de notre affaire.  Je suis d‚cid‚  … aller jusqu'au bout, certain que mon associ‚, Pat DEFRANCK, a falsifi‚  un livre de comptes . Malgr‚$",
+	"  Le 5/01/51@@              Luc, mon amour@ Guy connaît notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'à toi !  Max me relance mais j'ai définitivement rompu avec lui . Qu'il reste à ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
+	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai prétés pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
+	"  Mortevielle, le 15/2/51@              Maître,@ Je vous écris au sujet de notre affaire.  Je suis décidé  à aller jusqu'au bout, certain que mon associé, Pat DEFRANCK, a falsifié  un livre de comptes . Malgré$",
 	" Une pipe$",
-	" Un stylo … plume$",
-	" Un briquet … essence$",
+	" Un stylo à plume$",
+	" Un briquet à essence$",
 	" Une cornue$",
 	" Un blaireau$",
 	" Un pot de peinture$",
@@ -814,13 +814,13 @@ const char *gameDataFr[] = {
 	" Un vieux bouquin$",
 	" Un porte-monnaie$",
 	" Un poignard$",
-	" Un r‚volver$",
+	" Un révolver$",
 	" Une bible$",
 	" Une bougie$",
-	" Un coffret … bijoux$",
-	" Un fer … repasser$",
+	" Un coffret à bijoux$",
+	" Un fer à repasser$",
 	" Une photo$",
-	" Une montre … gousset$",
+	" Une montre à gousset$",
 	" Une corde$",
 	" Des clefs$",
 	" Un collier de perles$",
@@ -830,9 +830,9 @@ const char *gameDataFr[] = {
 	" Une bourse en cuir$",
 	" Une balle de tennis$",
 	" Des munitions$",
-	" Un rasoir … main$",
-	" Une brosse … cheveux$",
-	" Une brosse … linge$",
+	" Un rasoir à main$",
+	" Une brosse à cheveux$",
+	" Une brosse à linge$",
 	" Un jeu de cartes$",
 	" Un chausse pied$",
 	" Un tournevis$",
@@ -843,14 +843,14 @@ const char *gameDataFr[] = {
 	" Un pinceau$",
 	" Une corde$",
 	" Un objet en bois$",
-	" Des somnifŠres$",
+	" Des somnifères$",
 	" Une bague en or$",
-	" Un coffret … bijoux$",
-	" Un r‚veil matin$",
+	" Un coffret à bijoux$",
+	" Un réveil matin$",
 	" Une cotte de mailles$",
 	" Un chandellier$",
 	" Une paire de gants$",
-	" Une coupe cisel‚e$",
+	" Une coupe ciselée$",
 	" Un parchemin$",
 	" Un poignard$",
 	" Un dossier$",
@@ -868,13 +868,13 @@ const char *gameDataFr[] = {
 	"La mort de Julia$",
 	"Les relations de Julia$",
 	"Un message de Julia$",
-	"L'h‚ritage de Julia$",
+	"L'héritage de Julia$",
 	"Derniers actes de Julia$",
 	"Les cadeaux de Julia$",
 	"La chambre de Julia$",
 	"La photo chez Julia$",
 	"Julia et vous...$",
-	"Les occupations de L‚o$",
+	"Les occupations de Léo$",
 	"Les occupations de Pat$",
 	"Les occupations de Guy$",
 	"Les occupations de Bob$",
@@ -883,7 +883,7 @@ const char *gameDataFr[] = {
 	"Les occupations d'Ida$",
 	"Les occupations de Max$",
 	"Vos occupations$",
-	"Les relations de L‚o$",
+	"Les relations de Léo$",
 	"Les relations de Pat$",
 	"Les relations de Guy$",
 	"Les relations de Bob$",
@@ -910,169 +910,169 @@ const char *gameDataFr[] = {
 	"$",
 	"FIN DE LA CONVERSATION$",
 	"Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"C'est le massif montagneux que l'on aperçoit devant le manoir$",
 	"Je n'en sais rien !$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"Ma mére est morte soudainement . Son état semblait pourtant s'être amélioré$",
 	"Madame DEFRANCK est morte d'un coup de froid$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"Pardonnez moi mais je préfère, actuellement garder le silence$",
 	"Ce sont toujours les meilleurs qui partent les premiers$",
-	"J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
-	"Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
-	"C'est un homme dynamique qui a r‚ussi dans le parfum$",
-	"Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
-	"J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
-	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"J'aimais beaucoup ma mère . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"C'est une région qui a un passé chargé et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"C'est un passionné d'histoire et un joueur invétéré . D'ailleurs, voici un an il a gagné une grosse somme$",
+	"Il a déjà beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"Je suis PDG d'une petite société de parfums . Mais quand je suis ici, je me repose$",
+	"C'est un homme dynamique qui a réussi dans le parfum$",
+	"Lui ! C'est un arriviste véreux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soirées dans sa chambre$",
+	"J'ai été très préoccupé par la santé de ma mère, et maintenant je n'ai plus goût à rien$",
+	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mère$",
 	"Ce sont ses affaires ...$",
 	"Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
-	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
-	"Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
-	"Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
-	"Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
-	"Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
-	"Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
-	"Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"Je travaille avec Pat mais ça ne va pas très fort en ce moment$",
+	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper sérieusement alors$",
+	"Lui et Pat sont associés . Je crois que ça ne va pas trop mal$",
+	"Je m'occupe de moi et c'est déjà beaucoup . Et vous ?$",
+	"Oh ça ! Je lui fais confiance . Elle sait s'occuper$",
+	"Mais ! Vous n'avez pas encore découvert son occupation principale ...?$",
+	"Elle fait dans la décoration avec beaucoup degoût d'ailleurs . Elle est toujours très bien habillée$",
+	"Si les bijoux vous interessent, j'ai quelques affaires interessantes à saisir rapidement$",
 	"Les bijoux ...$",
 	"Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"Quand on est une femme d'intérieur on trouve toujours de quoi s'occuper...$",
 	"Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"Elle n'a sûrement pas des occupations très épanouissantes ...$",
 	"Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"Entre la cuisine et le ménage, je n'ai pas beaucoup de temps à vous accorder$",
 	"Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
-	"Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
-	"C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
-	"C'est un homme de caractŠre . Il faut savoir le prendre ..$",
-	"Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
-	"Relations ? Relations amicales ? Relations financiŠres sans doute$",
-	"Moi je n'ai rien … lui reprocher$",
-	"C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
-	"Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
-	"A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
-	"Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
-	"Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"Il en ferait plus si il s'occupait moins des ragôts et de la bouteille$",
+	"Je suis très indépendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problème$",
+	"C'est un égoïste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"Je crois qu'il s'entend bien avec tout le monde, mis à part, peut être, avec Guy$",
+	"C'est un homme de caractère . Il faut savoir le prendre ..$",
+	"Les affaires sont les affaires . Quant à la famille, je la laisse pour ce qu'elle est ...$",
+	"Relations ? Relations amicales ? Relations financières sans doute$",
+	"Moi je n'ai rien à lui reprocher$",
+	"C'est un homme d'affaire débrouillard . Il nage parfois à contre-courant mais ... il s'en sortira toujours$",
+	"Ils m'ennuient tous .. Non ! Ce n'est même pas ça .. Quoique .. certains ..$",
+	"A l'inverse de sa mère, c'est une personne très renfermée ! Alors question relations ..$",
+	"Il doit sans doute faire beaucoup d'effort pour rester agréable malgré tous ses ennuis$",
+	"Ses relations amoureuses : C'est terminé . Ses relations avec moi : Pas vraiment commencées . Quant aux autres : Je ne suis pas les \"autres\"$",
 	"J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
-	"Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
-	"Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
-	"Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"Il ne suffit pas d'avoir un peu d'argent et d'être beau parleur pour plaire à tout le monde$",
+	"Sans histoire .. C'est quelqu'un d'agréable et généreux . De plus, il ne manque pas d'humour$",
+	"Actuellement je m'entends plutôt bien avec tout le monde . Mais, ici, je ne vais pas m'étendre sur le sujet$",
+	"Beau plumage, mais ça ne vole pas haut ... Parlez en à son mari$",
 	"C'est pour un rendez-vous ?$",
-	"Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
-	"Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
-	"La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
-	"C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
-	"Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
-	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
-	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
-	"Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"Elle est très vivante ! Elle ne s'embarrasse pas de préjugés stupides$",
+	"Dans mon métier, on côtoit surtout des belles femmes et des truands$",
+	"La seule valeur sûre chez lui, c'est ses bijoux .. Et sa femme, mais ça il ne s'en rend pas compte$",
+	"C'est quelqu'un d'interessant . De pas toujours facile à comprendre, mais qui mérite le détour$",
+	"Je ne déteste personne, mais j'aime les choses et les gens quand ils sont à leur place$",
+	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite à l'étroit !$",
+	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volonté$",
+	"Vous savez dans mon métier on entend tout mais on ne retient rien, et le service est bien fait$",
 	"C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
-	"C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
-	"C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
-	"Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"Je ne connait pas le fond de sa pensée mais c'est quelqu'un de toujours très correct et impeccable$",
+	"C'était une personne qui a vécu au manoir, il y a un an .. peut être plus$",
+	"C'était plus qu'une amie pour ma mère . En ces moments, j'aurais aimé qu'elle soit à mes cotés$",
+	"Murielle a été la dame de compagnie de Julia$",
 	"Elle aussi, faisait des recherches ...$",
-	"C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
-	"Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"C'était une femme très cultivée . Son brusque départ, il y a un an, m'a surpris et beaucoup chagriné$",
+	"Elle partageait avec Léo sa passion de l'histoire et de la région$",
 	"Je crois que tout le monde l'aimait bien$",
-	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
-	"A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
-	"Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mère, belle-fille ..$",
+	"A part Léo, elle avait de très bon rapport avec Max ...$",
+	"Bien que vos relations furent peu soutenues, Jérôme, elle vous portait toujours dans son coeur ...$",
 	"A part sa famille, pas grand monde$",
-	"Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"Ah oui ! Je crois qu'elle a beaucoup regretté le départ de cette amie .. euh ! Marielle .. ou Mireille ...$",
 	"Non rien !$",
 	"Non ... Pas que le sache$",
-	"J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
-	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
-	"Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
-	"A part la lettre pour vous que j'ai post‚, rien de bien important !$",
-	"J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
-	"Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
-	"Son dernier pr‚sent m'a surpris$",
+	"J'ai connu Julia en achetant le manoir . C'était son seul bien . Mais toute ma fortune était la sienne ...$",
+	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien à elle$",
+	"Je crois que toute sa fortune venait de Léo . Alors, Pfuuut !$",
+	"A part la lettre pour vous que j'ai posté, rien de bien important !$",
+	"J'ai été très heureuse qu'elle m'offre sa bible reliée$",
+	"Ca a été rapide et elle n'a pas eu le temps de prendre des dispositions particulières$",
+	"Son dernier présent m'a surpris$",
 	"Quel cadeau ?$",
 	"Un chandellier ...$",
-	"Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"Oui, j'ai eu un cadeau . Ma femme a même eu une bible$",
 	"Et bien oui ! Comme tout le monde, je crois$",
 	"Un poignard$",
-	"Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"Je n'ai jamais été fouiller dans le grenier !$",
 	"Vous avez un don de double-vue ou un passe-partout$",
 	"Le portrait d'une jeune fille : C'est Murielle ...$",
 	"Vous savez, je la connaissais assez peu$",
-	"Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
-	"C'est la seule femme vraiment interessante que j'ai rencontr‚$",
-	"Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
-	"Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
-	"Si la chambre est ferm‚e, demandez … L‚o$",
-	"J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"Elle était très charmante, mais c'était surtout la dame de compagnie de Julia$",
+	"C'est la seule femme vraiment interessante que j'ai rencontré$",
+	"Elle avait de grandes connaissances historiques, et la consulter était très enrichissant$",
+	"Je me suis toujours demandé ce que certains pouvaient lui trouver !$",
+	"Si la chambre est fermée, demandez à Léo$",
+	"J'ai fermé sa chambre après sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
 	"Vous savez ce que c'est : Des relations familiales$",
-	"Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"Durant toutes ces années, je ne l'ai jamais servie à contre-coeur$",
 	"Je l'aimais autant qu'elle m'aimais, je crois$",
-	"De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"De quel droit avez-vous pénétré dans la chambre de ma femme ?!!$",
 	"C'est sans doute la photo de Murielle avec le filleul de Julia$",
 	"Je ne me rappelle pas$",
-	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
-	"Vous ˆtes bien curieux !... C'est sans valeur$",
-	"Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tirée à l'envers$",
+	"Vous êtes bien curieux !... C'est sans valeur$",
+	"Grimoires, parchemins et manuscrits : C'est le domaine de Léo$",
 	"Dommage que la devise soit manquante ...$",
-	"C'est trŠs beau ... Et trŠs vieux ...$",
-	"Tiens ! C'est un endroit que je n'ai jamais visit‚$",
-	"D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
-	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
-	"Profond et inqui‚tant : Le progrŠs a du bon$",
-	"Ca reste pour moi le plus grand des mystŠres$",
+	"C'est très beau ... Et très vieux ...$",
+	"Tiens ! C'est un endroit que je n'ai jamais visité$",
+	"D'aprés Léo, il semblerait que les Lunes soient plus récentes$",
+	"Même par ce temps, vous avez déniché un soleil ...$",
+	"Profond et inquiétant : Le progrès a du bon$",
+	"Ca reste pour moi le plus grand des mystères$",
 	"Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
-	"De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"Il y a un peu plus d'un an, un soir, elle a décidé de partir ...$",
+	"De toutes façons elle n'était pas faite pour vivre ici$",
 	"Quoi ?! Quel corps ? Quel crypte ?$",
-	"Si il y en a, je ne les ai jamais trouv‚ ...$",
-	"Bien s–r ! ... Et des fant“mes aussi ...$",
-	"C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
-	"Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"Si il y en a, je ne les ai jamais trouvé ...$",
+	"Bien sûr ! ... Et des fantômes aussi ...$",
+	"C'est la plus vielle de la région : Elle date du XI eme siècle$",
+	"Elle fut légèrement restaurée après la révolution$",
 	"Julia aimait beaucoup la peinture$",
-	"Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
-	"Que faites-vous l… ?$",
-	"Je suis s–r que vous cherchez quelque chose ici$",
-	"Je vous ‚coute$",
-	"Que d‚sirez-vous ?$",
+	"Ils ont différents styles, mais n'ont pas tous une très grande valeur$",
+	"Que faites-vous là ?$",
+	"Je suis sûr que vous cherchez quelque chose ici$",
+	"Je vous écoute$",
+	"Que désirez-vous ?$",
 	"Oui ?$",
-	"Je suis … vous ...$",
+	"Je suis à vous ...$",
 	"C'est pourquoi ?$",
 	"Allez-y$",
-	"C'est … quel sujet ?$",
-	"Max : … votre service, monsieur$",
-	"De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
-	"Vous ˆtes trop curieux !$",
-	"J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
-	"En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aventur‚s 
 dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
-	"F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
-	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"C'est à quel sujet ?$",
+	"Max : à votre service, monsieur$",
+	"De toutes façons vous n'avez rien à faire ici ! Sortez !!$",
+	"Vous êtes trop curieux !$",
+	"Jérôme ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . Léo, son mari bien sûr . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempète redouble, il vous faut rester . Les repas sont à 12h et 19h et il y a un recueillement à la chapelle tous les jours à 10h$",
+	"En vous voyant j'ai compris que vous decouvririez la vérité ... Car je savais pourquoi vous veniez : J'avais retrouvé le brouillon de la lettre de Julia . Mais je suis très joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me protéger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous découvert que le mur du silence est le nom que les maçons ont donné au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laissé avant de mourir étaient autant de faux indices qui ne servaient qu'à faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au décryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouvé un jour dans mes affaires . Une nuit, nous nous sommes aventurés 
 dans le passage secret que nous avions découvert . Murielle est morte par accident dans la pièce de la vierge . J'ai récupéré la bague rapidement, trouvé le trésor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'êtes pas de la police . Laissez moi seul !$",
+	"Février 1951 ... Profession : detective privé . Le froid figeait Paris et mes affaires lorsque ...$",
+	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les pièces délabrées du manoir de Mortevielle . Julia, une vieille femme a présent .$",
 	" au bureau$",
-	" … la cuisine$",
-	" … la cave$",
+	" à la cuisine$",
+	" à la cave$",
 	" dans le couloir$",
 	" dehors$",
-	" la salle … manger$",
+	" la salle à manger$",
 	" dans le manoir$",
 	" devant le manoir$",
-	" … la chapelle$",
+	" à la chapelle$",
 	" devant le puits$",
 	" au nord$",
-	" derriŠre le manoir$",
+	" derrière le manoir$",
 	" au sud$",
-	" … l'est$",
-	" … l'ouest$",
+	" à l'est$",
+	" à l'ouest$",
 	" vers le manoir$",
 	" plus loin$",
 	" dans l'eau$",
 	" hors du puits$",
 	" dans le puits$",
-	" choix sur ‚cran$",
+	" choix sur écran$",
 	" Dans la serie MYSTERE...$",
 	" LE MANOIR DE MORTEVIELLE$",
 	"$",
@@ -1095,9 +1095,9 @@ const char *gameDataFr[] = {
 	" A VOUS DE JOUER$",
 	" attacher$",
 	" attendre$",
-	" d‚foncer$",
+	" défoncer$",
 	" dormir$",
-	" ‚couter$",
+	" écouter$",
 	" entrer$",
 	" fermer$",
 	" fouiller$",
@@ -1119,7 +1119,7 @@ const char *gameDataFr[] = {
 	" lire$",
 	" poser$",
 	" regarder$",
-	" L‚o$",
+	" Léo$",
 	" Pat$",
 	" Guy$",
 	" Eva$",
@@ -1128,40 +1128,40 @@ const char *gameDataFr[] = {
 	" Ida$",
 	" Max$",
 	"Comment Julia est-elle morte ?$",
-	"Elle s'est suicid‚e$",
-	"Elle est morte assassin‚e$",
+	"Elle s'est suicidée$",
+	"Elle est morte assassinée$",
 	"Elle est morte accidentellement$",
 	"Elle est morte naturellement$",
-	"D'o— provenait l'argent qui a permis la restauration du manoir ?$",
+	"D'où provenait l'argent qui a permis la restauration du manoir ?$",
 	"chantage$",
 	"travail$",
-	"h‚ritage$",
+	"héritage$",
 	"courses$",
 	"rentes$",
 	"hold-up$",
-	"d‚couverte$",
-	"Quel est le hobby de L‚o ?$",
+	"découverte$",
+	"Quel est le hobby de Léo ?$",
 	"recherches historiques$",
 	"politique$",
 	"peinture$",
 	"drogue$",
 	"sciences occultes$",
 	"direction d'une secte$",
-	"Julia a laiss‚ une s‚rie d'indices . Ceux-ci sont repr‚sent‚s en un seul lieu . Lequel ?$",
+	"Julia a laissé une série d'indices . Ceux-ci sont représentés en un seul lieu . Lequel ?$",
 	"Chapelle$",
-	"Ext‚rieur$",
+	"Extérieur$",
 	"Cave$",
 	"Grenier$",
 	"Cuisine$",
-	"Salle … manger$",
+	"Salle à manger$",
 	"Chambre Julia$",
-	"Chambre L‚o$",
+	"Chambre Léo$",
 	"Chambre Pat$",
 	"Chambre Bob$",
 	"Chambre Max$",
 	"Chambre Luc/Ida$",
 	"Chambre Guy/Eva$",
-	"L'indice principal qui vous a permis d'arriver … la porte du souterrain est :$",
+	"L'indice principal qui vous a permis d'arriver à la porte du souterrain est :$",
 	"Un poignard$",
 	"Une bague$",
 	"Un livre$",
@@ -1175,30 +1175,30 @@ const char *gameDataFr[] = {
 	"Trois$",
 	"Quatre$",
 	"Cinq$",
-	"Combien de personnes sont m‚l‚es … cette histoire - Julia y comprise, vous except‚ - ?$",
+	"Combien de personnes sont mélées à cette histoire - Julia y comprise, vous excepté - ?$",
 	"Neuf$",
 	"Dix$",
 	"Onze$",
-	"Quel ‚tait le pr‚nom de la personne inconnue ?$",
+	"Quel était le prénom de la personne inconnue ?$",
 	"Mireille$",
-	"Fran‡oise$",
+	"Françoise$",
 	"Maguy$",
 	"Emilie$",
 	"Murielle$",
 	"Sophie$",
-	"De qui Murielle ‚tait-elle la maŒtresse ?$",
+	"De qui Murielle était-elle la maîtresse ?$",
 	"Bob$",
 	"Luc$",
 	"Guy$",
-	"L‚o$",
+	"Léo$",
 	"Max$",
 	"Murielle partageait une occupation avec une autre personne . Qui ?$",
-	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
-	"[1][ |Ins‚rez la disquette 1 dans le lecteur A][ok]$",
+	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous préférez|retourner enquéter afin de mieux comprendre ...][ok]$",
+	"[1][ |Insérez la disquette 1 dans le lecteur A][ok]$",
 	"[1][ |! ERREUR DISQUETTE !|On arrete tout][ok]$",
-	"[1][ |Vous devriez avoir remarqu‚|00% des indices][ok]$",
-	"[1][ |Ins‚rez la disquette 2 dans le lecteur A][ok]$",
-	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"[1][ |Vous devriez avoir remarqué|00% des indices][ok]$",
+	"[1][ |Insérez la disquette 2 dans le lecteur A][ok]$",
+	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
 	" MASTER .$",
 	"  rorL$",
 };
@@ -1462,7 +1462,7 @@ const char *gameDataDe[] =  {
 	"TBT - Julia's bedroom$",
 	"TBT - The photo at Julia's home$",
 	"TBT - Julia and yourself...$",
-	"TBT - L‚o's occupations$",
+	"TBT - Léo's occupations$",
 	"TBT - Pat's occupations$",
 	"TBT - Guy's occupations$",
 	"TBT - Bob's occupations$",
@@ -1471,7 +1471,7 @@ const char *gameDataDe[] =  {
 	"TBT - Ida's occupations$",
 	"TBT - Max's occupations$",
 	"TBT - Your occupations$",
-	"TBT - L‚o's relationships$",
+	"TBT - Léo's relationships$",
 	"TBT - Pat's relationships$",
 	"TBT - Guy's relationships$",
 	"TBT - Bob's relationships$",
@@ -1498,148 +1498,148 @@ const char *gameDataDe[] =  {
 	"TBT - $",
 	"TBT - END OF THE CONVERSATION$",
 	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"TBT - C'est le massif montagneux que l'on aperçoit devant le manoir$",
 	"TBT - Je n'en sais rien !$",
 	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"TBT - Ma mére est morte soudainement . Son état semblait pourtant s'être amélioré$",
 	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
 	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"TBT - Pardonnez moi mais je préfère, actuellement garder le silence$",
 	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
-	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
-	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
-	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
-	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
-	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
-	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"TBT - J'aimais beaucoup ma mère . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"TBT - C'est une région qui a un passé chargé et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"TBT - C'est un passionné d'histoire et un joueur invétéré . D'ailleurs, voici un an il a gagné une grosse somme$",
+	"TBT - Il a déjà beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"TBT - Je suis PDG d'une petite société de parfums . Mais quand je suis ici, je me repose$",
+	"TBT - C'est un homme dynamique qui a réussi dans le parfum$",
+	"TBT - Lui ! C'est un arriviste véreux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soirées dans sa chambre$",
+	"TBT - J'ai été très préoccupé par la santé de ma mère, et maintenant je n'ai plus goût à rien$",
+	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mère$",
 	"TBT - Ce sont ses affaires ...$",
 	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
-	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
-	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
-	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
-	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
-	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
-	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
-	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"TBT - Je travaille avec Pat mais ça ne va pas très fort en ce moment$",
+	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper sérieusement alors$",
+	"TBT - Lui et Pat sont associés . Je crois que ça ne va pas trop mal$",
+	"TBT - Je m'occupe de moi et c'est déjà beaucoup . Et vous ?$",
+	"TBT - Oh ça ! Je lui fais confiance . Elle sait s'occuper$",
+	"TBT - Mais ! Vous n'avez pas encore découvert son occupation principale ..?$",
+	"TBT - Elle fait dans la décoration avec beaucoup degoût d'ailleurs . Elle est toujours très bien habillée$",
+	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes à saisir rapidement$",
 	"TBT - Les bijoux ...$",
 	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"TBT - Quand on est une femme d'intérieur on trouve toujours de quoi s'occuper...$",
 	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"TBT - Elle n'a sûrement pas des occupations très épanouissantes ...$",
 	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"TBT - Entre la cuisine et le ménage, je n'ai pas beaucoup de temps à vous accorder$",
 	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
-	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
-	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
-	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
-	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
-	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
-	"TBT - Moi je n'ai rien … lui reprocher$",
-	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
-	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
-	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
-	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
-	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"TBT - Il en ferait plus si il s'occupait moins des ragôts et de la bouteille$",
+	"TBT - Je suis très indépendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problème$",
+	"TBT - C'est un égoïste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis à part, peut être, avec Guy$",
+	"TBT - C'est un homme de caractère . Il faut savoir le prendre ..$",
+	"TBT - Les affaires sont les affaires . Quant à la famille, je la laisse pour ce qu'elle est ...$",
+	"TBT - Relations ? Relations amicales ? Relations financières sans doute$",
+	"TBT - Moi je n'ai rien à lui reprocher$",
+	"TBT - C'est un homme d'affaire débrouillard . Il nage parfois à contre-courant mais ... il s'en sortira toujours$",
+	"TBT - Ils m'ennuient tous .. Non ! Ce n'est même pas ça .. Quoique .. certains ..$",
+	"TBT - A l'inverse de sa mère, c'est une personne très renfermée ! Alors question relations ..$",
+	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agréable malgré tous ses ennuis$",
+	"TBT - Ses relations amoureuses : C'est terminé . Ses relations avec moi : Pas vraiment commencées . Quant aux autres : Je ne suis pas les \"autres\"$",
 	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
-	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
-	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
-	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'être beau parleur pour plaire à tout le monde$",
+	"TBT - Sans histoire .. C'est quelqu'un d'agréable et généreux . De plus, il ne manque pas d'humour$",
+	"TBT - Actuellement je m'entends plutôt bien avec tout le monde . Mais, ici, je ne vais pas m'étendre sur le sujet$",
+	"TBT - Beau plumage, mais ça ne vole pas haut ... Parlez en à son mari$",
 	"TBT - C'est pour un rendez-vous ?$",
-	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
-	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
-	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
-	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
-	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
-	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
-	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
-	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"TBT - Elle est très vivante ! Elle ne s'embarrasse pas de préjugés stupides$",
+	"TBT - Dans mon métier, on côtoit surtout des belles femmes et des truands$",
+	"TBT - La seule valeur sûre chez lui, c'est ses bijoux .. Et sa femme, mais ça il ne s'en rend pas compte$",
+	"TBT - C'est quelqu'un d'interessant . De pas toujours facile à comprendre, mais qui mérite le détour$",
+	"TBT - Je ne déteste personne, mais j'aime les choses et les gens quand ils sont à leur place$",
+	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite à l'étroit !$",
+	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volonté$",
+	"TBT - Vous savez dans mon métier on entend tout mais on ne retient rien, et le service est bien fait$",
 	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
-	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
-	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
-	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"TBT - Je ne connait pas le fond de sa pensée mais c'est quelqu'un de toujours très correct et impeccable$",
+	"TBT - C'était une personne qui a vécu au manoir, il y a un an .. peut être plus$",
+	"TBT - C'était plus qu'une amie pour ma mère . En ces moments, j'aurais aimé qu'elle soit à mes cotés$",
+	"TBT - Murielle a été la dame de compagnie de Julia$",
 	"TBT - Elle aussi, faisait des recherches ...$",
-	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
-	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"TBT - C'était une femme très cultivée . Son brusque départ, il y a un an, m'a surpris et beaucoup chagriné$",
+	"TBT - Elle partageait avec Léo sa passion de l'histoire et de la région$",
 	"TBT - Je crois que tout le monde l'aimait bien$",
-	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
-	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
-	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mère, belle-fille ..$",
+	"TBT - A part Léo, elle avait de très bon rapport avec Max ...$",
+	"TBT - Bien que vos relations furent peu soutenues, Jérôme, elle vous portait toujours dans son coeur ...$",
 	"TBT - A part sa famille, pas grand monde$",
-	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"TBT - Ah oui ! Je crois qu'elle a beaucoup regretté le départ de cette amie .. euh ! Marielle .. ou Mireille ...$",
 	"TBT - Non rien !$",
 	"TBT - Non ... Pas que le sache$",
-	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
-	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
-	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
-	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
-	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
-	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
-	"TBT - Son dernier pr‚sent m'a surpris$",
+	"TBT - J'ai connu Julia en achetant le manoir . C'était son seul bien . Mais toute ma fortune était la sienne ...$",
+	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien à elle$",
+	"TBT - Je crois que toute sa fortune venait de Léo . Alors, Pfuuut !$",
+	"TBT - A part la lettre pour vous que j'ai posté, rien de bien important !$",
+	"TBT - J'ai été très heureuse qu'elle m'offre sa bible reliée$",
+	"TBT - Ca a été rapide et elle n'a pas eu le temps de prendre des dispositions particulières$",
+	"TBT - Son dernier présent m'a surpris$",
 	"TBT - Quel cadeau ?$",
 	"TBT - Un chandellier ...$",
-	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"TBT - Oui, j'ai eu un cadeau . Ma femme a même eu une bible$",
 	"TBT - Et bien oui ! Comme tout le monde, je crois$",
 	"TBT - Un poignard$",
-	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"TBT - Je n'ai jamais été fouiller dans le grenier !$",
 	"TBT - Vous avez un don de double-vue ou un passe-partout$",
 	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
 	"TBT - Vous savez, je la connaissais assez peu$",
-	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
-	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
-	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
-	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
-	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
-	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"TBT - Elle était très charmante, mais c'était surtout la dame de compagnie de Julia$",
+	"TBT - C'est la seule femme vraiment interessante que j'ai rencontré$",
+	"TBT - Elle avait de grandes connaissances historiques, et la consulter était très enrichissant$",
+	"TBT - Je me suis toujours demandé ce que certains pouvaient lui trouver !$",
+	"TBT - Si la chambre est fermée, demandez à Léo$",
+	"TBT - J'ai fermé sa chambre après sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
 	"TBT - Vous savez ce que c'est : Des relations familiales$",
-	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"TBT - Durant toutes ces années, je ne l'ai jamais servie à contre-coeur$",
 	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
-	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"TBT - De quel droit avez-vous pénétré dans la chambre de ma femme ?!!$",
 	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
 	"TBT - Je ne me rappelle pas$",
-	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
-	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
-	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tirée à l'envers$",
+	"TBT - Vous êtes bien curieux !... C'est sans valeur$",
+	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de Léo$",
 	"TBT - Dommage que la devise soit manquante ...$",
-	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
-	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
-	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
-	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
-	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
-	"TBT - Ca reste pour moi le plus grand des mystŠres$",
+	"TBT - C'est très beau ... Et très vieux ...$",
+	"TBT - Tiens ! C'est un endroit que je n'ai jamais visité$",
+	"TBT - D'aprés Léo, il semblerait que les Lunes soient plus récentes$",
+	"TBT - Même par ce temps, vous avez déniché un soleil ...$",
+	"TBT - Profond et inquiétant : Le progrès a du bon$",
+	"TBT - Ca reste pour moi le plus grand des mystères$",
 	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
-	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"TBT - Il y a un peu plus d'un an, un soir, elle a décidé de partir ...$",
+	"TBT - De toutes façons elle n'était pas faite pour vivre ici$",
 	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
-	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
-	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
-	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
-	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"TBT - Si il y en a, je ne les ai jamais trouvé ...$",
+	"TBT - Bien sûr ! ... Et des fantômes aussi ...$",
+	"TBT - C'est la plus vielle de la région : Elle date du XI eme siècle$",
+	"TBT - Elle fut légèrement restaurée après la révolution$",
 	"TBT - Julia aimait beaucoup la peinture$",
-	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
-	"TBT - Que faites-vous l… ?$",
-	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
-	"TBT - Je vous ‚coute$",
-	"TBT - Que d‚sirez-vous ?$",
+	"TBT - Ils ont différents styles, mais n'ont pas tous une très grande valeur$",
+	"TBT - Que faites-vous là ?$",
+	"TBT - Je suis sûr que vous cherchez quelque chose ici$",
+	"TBT - Je vous écoute$",
+	"TBT - Que désirez-vous ?$",
 	"TBT - Oui ?$",
-	"TBT - Je suis … vous ...$",
+	"TBT - Je suis à vous ...$",
 	"TBT - C'est pourquoi ?$",
 	"TBT - Allez-y$",
-	"TBT - C'est … quel sujet ?$",
-	"TBT - Max : … votre service, monsieur$",
-	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
-	"TBT - Vous ˆtes trop curieux !$",
-	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
-	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
-	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
-	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"TBT - C'est à quel sujet ?$",
+	"TBT - Max : à votre service, monsieur$",
+	"TBT - De toutes façons vous n'avez rien à faire ici ! Sortez !!$",
+	"TBT - Vous êtes trop curieux !$",
+	"TBT - Jérôme ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . Léo, son mari bien sûr . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempète redouble, il vous faut rester . Les repas sont à 12h et 19h et il y a un recueillement à la chapelle tous les jours à 10h$",
+	"TBT - En vous voyant j'ai compris que vous decouvririez la vérité ... Car je savais pourquoi vous veniez : J'avais retrouvé le brouillon de la lettre de Julia . Mais je suis très joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me protéger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous découvert que le mur du silence est le nom que les maçons ont donné au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laissé avant de mourir étaient autant de faux indices qui ne servaient qu'à faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au décryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouvé un jour dans mes affaires . Une nuit, nous nous sommes aven
 turés dans le passage secret que nous avions découvert . Murielle est morte par accident dans la pièce de la vierge . J'ai récupéré la bague rapidement, trouvé le trésor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'êtes pas de la police . Laissez moi seul !$",
+	"TBT - Février 1951 ... Profession : detective privé . Le froid figeait Paris et mes affaires lorsque ...$",
+	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les pièces délabrées du manoir de Mortevielle . Julia, une vieille femme a présent .$",
 	"TBT -  to the bureau$",
 	"TBT -  to the kitchen$",
 	"TBT -  to the cellar$",
@@ -1670,7 +1670,7 @@ const char *gameDataDe[] =  {
 	"TBT - Directed by: KYILKHOR CREATION and LANGLOIS$",
 	"TBT - $",
 	"TBT - With the cooperation of...$",
-	"TBT - B‚atrice et Jean_Luc LANGLOIS$",
+	"TBT - Béatrice et Jean_Luc LANGLOIS$",
 	"TBT - for the music and the voices,$",
 	"TBT - Bernard GRELAUD for the graphic conception,$",
 	"TBT - MARIA-DOLORES for the graphic direction,$",
@@ -1769,7 +1769,7 @@ const char *gameDataDe[] =  {
 	"TBT - - 11$",
 	"TBT - What was the first name at of the unknown character?$",
 	"TBT - - Mireille$",
-	"TBT - - Fran‡oise$",
+	"TBT - - Françoise$",
 	"TBT - - Maguy$",
 	"TBT - - Emilie$",
 	"TBT - - Murielle$",
@@ -1786,7 +1786,7 @@ const char *gameDataDe[] =  {
 	"TBT - [1][ | Disk error | All stop... ][ok]$",
 	"TBT - [1][ | You should have noticed |00% of the clues ][ok]$",
 	"TBT - [3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
 	"TBT -  MASTER .$",
 	"TBT -   rorL$",
 	NULL
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index f9cd1ec..0731d3c 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: 80047631fcaca8d570d0c75ce64c2ccd0956f2f3
    https://github.com/scummvm/scummvm/commit/80047631fcaca8d570d0c75ce64c2ccd0956f2f3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-24T23:21:38-08:00

Commit Message:
MORTEVIELLE: Integrate translations fixes.

Changed paths:
    devtools/create_mortdat/gametext.h
    dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index bd3c340..ebaa422 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -103,7 +103,7 @@ const char *gameDataEn[] =  {
 	"Linen, personal belongings...$",
 	"Not just anywhere!$",
 	"It's not time!$",
-	"One doesn't speak with ones mouth full!$",
+	"One doesn't speak with ones mouth full! So once the meal is over...$",
 	"Someone comes in, messes about then goes out again$",
 	"Someone's approaching your hiding-place$",
 	"Someone surprises you!$",
@@ -120,7 +120,7 @@ const char *gameDataEn[] =  {
 	"The same matter, from another angle!$",
 	"The reflection is tarnished, but the frame is gold!$",
 	"Bric-a-brac$",
-	"Face to face with failure!$",
+	"Facing failure!$",
 	"Smells like something you'd rather not see!$",
 	"Cleaning products$",
 	"Got an itch?$",
@@ -168,11 +168,11 @@ const char *gameDataEn[] =  {
 	"Suddenly  Max  arrives with your suitcase:  \"Thank  you  for your @visit!\".Mister discreet \"private eye\" (in need of a private optici at an!). Thoroughly demoralised, you at leave the manor. You are useless!$",
 	"Leo interrupts:  \"The storm has  died down,I am going into town in at 1 hour. Get ready\". You have lost at time...but not your life$",
 	"Congestion, the deadly flu... You at are stuck here! Your  whole  case at sinks slowly beneath the water$",
-	"The water is rising fast,freezing your last illusions. Before you at have time to react...you are dead$",
+	"The water is rising fast, freezing your last illusions. Before you at have time to react...you are dead$",
 	"As soon as you reach the bottom  of the well, a hand cuts the rope at Farewell sweet life!$",
 	"The storm covers your footprints.A wall of  silence falls heavily at on your shoulders. Slowly you  succumb to frosbite...$",
-	"You're not completely alone!  A  cold blade plunges into your backup at In future, be more care!$",
-	"You don't know what implication  Leo may have had  in  Murielle's at death. Was she dead outright? In at any case,the family problems thatyou have uncovered in the course at of your enquiries would explain  Leo's behaviour. You're not sure at that's the reason Julia had asked at for your help, but that's reason enough for you!Out of respect for at her, after taking certain precau- at tions you have a revealing  talk with Leo.$",
+	"You're not completely alone!  A  cold blade plunges into your back at In future, be more careful!$",
+	"You don't know what implication Leo may have had in Murielle's at death. Was she dead outright? In at any case, the family problems that you have uncovered in the course at of your enquiries would explain Leo's behaviour. You're not sure at that's the reason Julia had asked at for your help, but that's reason enough for you!Out of respect for at her, after taking certain precau- at tions you have a revealing talk with Leo.$",
 	"$",
 	"You don't have the keys to  the  manor. Your  cries  rest  unheard at You're   going   to   catch...             your death!$",
 	"With  a  circular  movement, the sword slices across you. Guts and at intestines spill out all over. A sorry state of affairs!$",
@@ -205,8 +205,8 @@ const char *gameDataEn[] =  {
 	"No, not just now$",
 	"Too late$",
 	"$",
-	"Like a deep stony stare, a solitary  eye  that points towards the at stars; the artery that links hea-ven and hell.  You  must  fathom at these depths keeping hold of that at which is, and will become. Monday, Tuesday, Wednesday, Sunday, from at Monday 1st to Sunday 1st,plunging from one  day  to  the next your@\"IS\" or \"WILL BECOME\".  Carrying your burden with love and light, at the smallest oversight will seal your fate.$",
-	"10/1/51: We think  we've  solved the mystery of the manuscript and at located the crypt. Is it the idea at of success in what seems like  a dream that disturbs me so? I feel at I have committed myself  rather  too much, as far as Leo is concer at ned... No! I should go on.       @I should have put Guy in the pic-ture but for a week now, I've had at no news of him$",
+	"Like a deep stony stare, a solitary eye that points towards the at stars; the artery that links hea-ven and hell. You must fathom at these depths keeping hold of that at which is, and will become. Monday, Tuesday, Wednesday, Sunday, from at the first Monday to the first Sunday,plunging from one day to the next your@\"IS\" or \"WILL BECOME\". Carrying your burden with love and light, at the smallest oversight will seal your fate.$",
+	"10/1/51: We think we've solved the mystery of the manuscript and at located the crypt. Is it the idea at of success in what seems like a dream that disturbs me so? I feel at I have committed myself rather too much, as far as Leo is @concerned... No! I mustgo on. @I should have put Guy in the picture but for a week now, I've had at no news of him$",
 	"Take your prayers as you would to the holy place.  From  the  pillar at of wisdom, bring the sun to  his at knees. Thus will it show you the place to  offer  alms of another at kind and like young Arthur, open the way of darkness.White is your at colour, golden your hearth.  So at advance with caution Orpheus and light  your  way  unto  the  sad at virgin. Offer her the circle  of the man with three faces. That he at may regain the  world  and  turn with it to its original at inglory!$",
 	"The mountains are the fangs in a monstrous mouth opening on the at finity of a celestial orgy, grin-ding the stars as we  grind  our at teeth into dust.  You  will drop your chord of stone at your feet. at The  laugh  of  silence  at  the at highest pitch, and in your right hand, the measure of genius. Thus at will you pass between  the  two  crescents beyond the abyss of the at wall of silence. The key to the  melody is within your grasp.  It at suffices to find the note  that  clashes.$",
 	"  9/12 INTER. 518  3/13 EXPENS.  23@  9/12 SALES 1203  7/12 CHEQUE 1598@      TOTAL 1721       TOTAL  1721$",
@@ -285,7 +285,7 @@ const char *gameDataEn[] =  {
 	"Julia's bedroom$",
 	"The photo at Julia's home$",
 	"Julia and yourself...$",
-	"Léo's occupations$",
+	"L‚o's occupations$",
 	"Pat's occupations$",
 	"Guy's occupations$",
 	"Bob's occupations$",
@@ -294,7 +294,7 @@ const char *gameDataEn[] =  {
 	"Ida's occupations$",
 	"Max's occupations$",
 	"Your occupations$",
-	"Léo's relationships$",
+	"L‚o's relationships$",
 	"Pat's relationships$",
 	"Guy's relationships$",
 	"Bob's relationships$",
@@ -324,7 +324,7 @@ const char *gameDataEn[] =  {
 	"These are the mountains one can see in front of the manor$",
 	"I don't know!$",
 	"She died from pulmonary embolism$",
-	"Mother died suddenly. And yet her health had seemed to improve$",
+	"Mother died suddenly. And yet her health had seemed to improve‚$",
 	"Miss DEFRANCK died from a cold$",
 	"She died from pulmonary embolism$",
 	"Excuse me but I prefer to say nothing for now$",
@@ -345,20 +345,20 @@ const char *gameDataEn[] =  {
 	"Him and Pat are patners. I think it's going pretty well$",
 	"I take care of myself and that's already lots. How about you?$",
 	"(319) Oh that! I trust her. She knows how to keep herself busy$",
-	"(320) What! You have not yet discovered her main occupation...?$",
+	"(320) What! You have not yet discovered her main occupation..?$",
 	"She is working in the decoration business, and tastefully with that. She is always very well dressed$",
 	"If you like jewels, I have some good deals to propose for a short while$",
 	"The jewels...$",
 	"I don't know, but I'd like him to give me a bit more slack!$",
 	"When one is a housewife, one always find something to do...$",
 	"She could stay there doing nothing, but no! She sews, she reads...$",
-	"She probably doesn't have very fulfilling occupations...$",
+	"She has probably not very fulfilling occupations...$",
 	"A woman like there is no more: She is interested in everything!$",
 	"With the cooking and the cleaning I do not have much time for you$",
-	"I do not know how he manages to do everything. That's wonderful!$",
+	"I do not know how he manages to do everything. That's wonderful!",
 	"He would do more if he showed less interest in gossip and alcohol$",
 	"I am very independant. As long as nobody interferes in my business: No problem$",
-	"He is selfish. I wonder if he likes something else than his horses and grimoires$",
+	"He is selfish. I wonder if he likes something other than his horses and grimoires$",
 	"I think he gets along well with everyone, except, perhaps, with Guy$",
 	"He has a temper. You have to learn how to deal with him...$",
 	"Business is business. As for the family, I leave it as it is...$",
@@ -388,12 +388,12 @@ const char *gameDataEn[] =  {
 	"Someone who lived in the manor, a year ago... maybe more$",
 	"She was more than a friend to my mother. In these moments, I would have loved to have her by my side$",
 	"Murielle has been Julia's lady-in-waiting$",
-	"She, too, was doing some research...$",
+	"She, too, was doing some research....$",
 	"She was a very educated person. Her abrupt leaving, a year ago, surprised me and caused me great sorrow$",
 	"Her and Leo shared a common passion for history and the local area$",
 	"I think everyone liked her$",
 	"She got along with everyone. She loved her son dearly. As for the relations between mother-in-law and daughter-in-law...$",
-	"Apart from Leo, she got along very well with Max....$",
+	"Apart from Leo, she got along very well with Max...$",
 	"Even if your relations were unfrequent, Jerome, there was still a place for you in her heart...$",
 	"(370) Apart from her family, not a lot of people$",
 	"Oh right! I think she deeply regretted this friend's leaving... err! Marielle... or Mireille...$",
@@ -460,10 +460,10 @@ const char *gameDataEn[] =  {
 	"In any case you have no business being in here! Get out!!$",
 	"You are too curious!$",
 	"Jerome! It's been a while... I'm very sad to announce you that Julia died. Her family is here: Guy, her son; Eva, her daughter-in-law; Leo, her husband, of course; her son-in-law Pat; cousins, too: Bob, Ida, Luc. The storm is getting stronger, you must stay here. Meals are served at 12am and 7pm, and there is a mass at the chapel every day at 10am$",
-	"When I saw you I knew you would uncover the truth... I knew why you were here: I had found the draft of Julia's letter. But I love to play, so à She hadn't wanted your task to be too easy, to protect me, probably, but she couldn't die knowing this mystery would remain unsolved. Did you find out that the wall of silence is the name the builders gave, during the construction of the manor, to the wall on which the coat of arms hangs?.. And those gifts Julia left before dying were as many false leads, and their true purpose was to highlight how important the parchments were à That's right, more than a year ago I was working with Murielle on the decryption of those manuscripts I had just found. My wife made the connection between our work and Murielle's disappearance, but she never had any proof. Except that ring she found one day while going through my belongings. One night, we went exploring the secret passage we had found. Murielle died by accident in the room of the Virgin.
  I quickly took the ring from her, found the treasure and ran away. I didn't think she was still alive, and I didn't say a word because I needed the money. I told everyone the money was coming from a winning bet at the horseraces à Leave now, since you're not a policeman. Leave me alone!$",
+	"When I saw you I knew you would uncover the truth... I knew why you were here: I had found the draft of Julia's letter. But I love to play, so... She hadn't wanted your task to be too easy, to protect me, probably, but she couldn't die knowing this mystery would remain unsolved. Did you find out that the wall of silence is the name the builders gave, during the construction of the manor, to the wall on which the coat of arms hangs?... And those gifts Julia left before dying were as many false leads, and their true purpose was to highlight how important the parchments were... That's right, more than a year ago I was working with Murielle on the decryption of those manuscripts I had just found. My wife made the connection between our work and Murielle's disappearance, but she never had any proof. Except that ring she found one day while going through my belongings. One night, we went exploring the secret passage we had found. Murielle died by accident in the room of the Virg
 in. I quickly took the ring from her, found the treasure and ran away. I didn't think she was still alive, and I didn't say a word because I needed the money. I told everyone the money was coming from a winning bet at the horseraces... Leave now, since you're not a policeman. Leave me alone!$",
 	"February 1951... Occupation: private eye. The cold was freezing Paris off, and my cases as well, when...$",
 	"A letter, a call, memories from a childhood not that long ago. Echoes of the many games we played in the disused rooms of Mortville Manor... And Julia, now an old woman.$",
-	" to the bureau$",
+	" to the office$",
 	" to the kitchen$",
 	" to the cellar$",
 	" to the landing$",
@@ -472,7 +472,7 @@ const char *gameDataEn[] =  {
 	" inside the manor$",
 	" front of the manor$",
 	" to the chapel$",
-	" to the weel$",
+	" to the well$",
 	" north$",
 	" behind the manor$",
 	" south$",
@@ -481,8 +481,8 @@ const char *gameDataEn[] =  {
 	" towards the manor$",
 	" further$",
 	" in the water$",
-	" out of the weel$",
-	" in the weel$",
+	" out of the well$",
+	" in the well$",
 	" choice on screen$",
 	"In the MYSTERY series...$",
 	"MORTVILLE MANOR$",
@@ -493,7 +493,7 @@ const char *gameDataEn[] =  {
 	"Directed by: KYILKHOR CREATION and LANGLOIS$",
 	"$",
 	"With the cooperation of...$",
-	"Béatrice et Jean_Luc LANGLOIS$",
+	"B‚atrice et Jean_Luc LANGLOIS$",
 	"for the music and the voices,$",
 	"Bernard GRELAUD for the graphic conception,$",
 	"MARIA-DOLORES for the graphic direction,$",
@@ -543,7 +543,7 @@ const char *gameDataEn[] =  {
 	"- Was she murdered?$",
 	"- Did she die by accident?$",
 	"- Did she die of natural causes?$",
-	"Where did the money come from at for the restoration of the manor?$",
+	"Where did the money used for the at restoration of the manor come from?$",
 	"- Blackmail$",
 	"- Honest work$",
 	"- Inheritance$",
@@ -557,8 +557,8 @@ const char *gameDataEn[] =  {
 	"- Painting$",
 	"- Drugs$",
 	"- Occult sciences$",
-	"- Management of a sect$",
-	"Julia left several clues that are at represented in one place. Which?$",
+	"- Leader of a sect$",
+	"Julia left several clues that are at represented in one place. Which one?$",
 	"- Chapel$",
 	"- Outside$",
 	"- Cellar$",
@@ -572,7 +572,7 @@ const char *gameDataEn[] =  {
 	"- Max's room$",
 	"- Luc/Ida's room$",
 	"- Guy/Eva's room$",
-	"The main clue that leads you at to the underground door is:$",
+	"The main clue that lead you at to the underground door is:$",
 	"- A dagger$",
 	"- A ring$",
 	"- A book$",
@@ -580,24 +580,24 @@ const char *gameDataEn[] =  {
 	"- A letter$",
 	"- A pendulum$",
 	"How many parchments were there in the manor?$",
-	"- 0$",
-	"- 1$",
-	"- 2$",
-	"- 3$",
-	"- 4$",
-	"- 5$",
-	"How many persons are involved in at this story?@(Julia included, but not yourself)$",
-	"- 9$",
-	"- 10$",
-	"- 11$",
+	"- None$",
+	"- Just one$",
+	"- Two$",
+	"- Three$",
+	"- Four$",
+	"- Five$",
+	"How many persons are involved in at this story?@(including Julia, but not yourself)$",
+	"- Nine$",
+	"- Ten$",
+	"- Eleven$",
 	"What was the first name at of the unknown character?$",
 	"- Mireille$",
-	"- Françoise$",
+	"- Fran‡oise$",
 	"- Maguy$",
 	"- Emilie$",
 	"- Murielle$",
 	"- Sophie$",
-	"Wo did Murielle have an affair with?$",
+	"Who did Murielle have an affair with?$",
 	"- Bob$",
 	"- Luc$",
 	"- Guy$",
@@ -609,7 +609,7 @@ const char *gameDataEn[] =  {
 	"[1][ | Disk error | All stop... ][ok]$",
 	"[1][ | You should have noticed |00% of the clues ][ok]$",
 	"[3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
+	"[1][ |Before going any further, you decide to| look back on the knowledge you gained][ok]$",
 	"TBT -  MASTER .$",
 	"TBT -   rorL$",
 	NULL
@@ -617,9 +617,9 @@ const char *gameDataEn[] =  {
 
 const char *gameDataFr[] = {
 	"Le calme dans la tourmente$",
-	"Des goûts et des couleurs!$",
+	"Des go—ts et des couleurs!$",
 	"Mauve qui peut!$",
-	"Prière de laisser en sortant...$",
+	"PriŠre de laisser en sortant...$",
 	"Trou noir troublant$",
 	"Bleu... comme \"peur bleue\"!$",
 	"Chambre de \"Saigneur\"!$",
@@ -629,33 +629,33 @@ const char *gameDataFr[] = {
 	"Odeur de feux de bois et de tabac$",
 	"Tabac et vieux bouquins$",
 	"Oignons, cannelle et spiritueux$",
-	"Un endroit bien peu visité$",
-	"Humidité et moisissure$",
+	"Un endroit bien peu visit‚$",
+	"Humidit‚ et moisissure$",
 	"Avis aux colporteurs...$",
-	"Corps putréfié : cryptomanie mortelle!$",
-	"Et en plus... des pièges désamorcés!$",
-	"C'est déjà ouvert$",
+	"Corps putr‚fi‚ : cryptomanie mortelle!$",
+	"Et en plus... des piŠges d‚samorc‚s!$",
+	"C'est d‚j… ouvert$",
 	"Danger : avalanches$",
-	"Une odeur de sainteté!$",
+	"Une odeur de saintet‚!$",
 	"Une bƒtisse imposante$",
-	"L'envers du mystère!$",
-	"Drôle d'horoscope!$",
+	"L'envers du mystŠre!$",
+	"Dr“le d'horoscope!$",
 	"Tant va la cruche...$",
-	"Une porte en chène$",
+	"Une porte en chŠne$",
 	"Une photo$",
 	"Les armoiries$",
 	"$",
-	"Max, le domestique, vous accueille puis vous conduit à votre chambre$",
-	"Mortevielle, le 16/2/51@         Mon cher Jérôme,@ Suite à mon télégramme, je vous fais part des raisons de mon inquiétude :il y a un an, Murielle, ma dame de compagnie, disparaissait . Départ ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile à comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'à présent, faire le jour sur cette affaire, je compte sur vous pour la mener à bien . Si mon état de santé ne s'améliorait pas, prenez les décisions qui vous sembleront le plus  appropriées...@             Amitiés. JULIA DEFRANCK$",
-	"Plus tard, Guy vous apprendra le suicide de Léo...  après un pari insensé aux courses!$",
+	"Max, le domestique, vous accueille puis vous conduit … votre chambre$",
+	"Mortevielle, le 16/2/51@         Mon cher J‚r“me,@ Suite … mon t‚l‚gramme, je vous fais part des raisons de mon inqui‚tude :il y a un an, Murielle, ma dame de compagnie, disparaissait . D‚part ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile … comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'… pr‚sent, faire le jour sur cette affaire, je compte sur vous pour la mener … bien . Si mon ‚tat de sant‚ ne s'am‚liorait pas, prenez les d‚cisions qui vous sembleront le plus  appropri‚es...@             Amiti‚s. JULIA DEFRANCK$",
+	"Plus tard, Guy vous apprendra le suicide de L‚o...  aprŠs un pari insens‚ aux courses!$",
 	"F3: encore at F8: suite$",
-	"Le maître des lieux$",
-	"Le futur héritier$",
+	"Le maŒtre des lieux$",
+	"Le futur h‚ritier$",
 	"Le fils de JULIA$",
 	"Joli brin!!!$",
 	"Superman!$",
 	"Le mari d'Ida$",
-	"Propos intéressants?$",
+	"Propos int‚ressants?$",
 	"Service compris...$",
 	"Rien dessous!$",
 	"Un ange passe...$",
@@ -663,61 +663,61 @@ const char *gameDataFr[] = {
 	"Admirez! Contemplez!$",
 	"Non ! Rien !$",
 	"Impossible$",
-	"ça tache !$",
-	"Un traité sur l'histoire de la région$",
-	"Quelques pièces$",
+	"‡a tache !$",
+	"Un trait‚ sur l'histoire de la r‚gion$",
+	"Quelques piŠces$",
 	"Premier commandement...$",
-	"Des pétales plein les narines !$",
+	"Des p‚tales plein les narines !$",
 	"Pique, Coeur...$",
-	"ça ne manque pas de cachets !$",
+	"‡a ne manque pas de cachets !$",
 	"Un roman d'amour$",
 	"Souffler n'est pas jouer$",
-	"Pas une réussite!$",
+	"Pas une r‚ussite!$",
 	"Gare aux rebondissements !$",
 	"Sombre et profond...$",
 	"Sensations normales$",
 	"Sniff!$",
 	"Pas discret ! Contentez-vous de regarder !$",
-	"Atchoum! De la p... poussière$",
-	"La toile est signée... pas le papier peint !$",
+	"Atchoum! De la p... poussiŠre$",
+	"La toile est sign‚e... pas le papier peint !$",
 	"Pas de chance, rien !$",
 	"Soyez plus discret !$",
 	"Les volets sont clos$",
 	"De la neige, encore de la neige !$",
-	"Génial : une toile de maître !$",
-	"Aucun doute : une véritable imitation$",
+	"G‚nial : une toile de maŒtre !$",
+	"Aucun doute : une v‚ritable imitation$",
 	"Hum ! Vous tiquez : de l'antique en toc !$",
-	"Une pièce rare de valeur !$",
+	"Une piŠce rare de valeur !$",
 	"Rien de remarquable$",
 	"Linge, objets personnels...$",
-	"Pas n'importe où !$",
+	"Pas n'importe o— !$",
 	"Ce n'est pas l'heure !$",
-	"On ne parle pas la bouche pleine ! Donc, une fois le repas terminé...$",
+	"On ne parle pas la bouche pleine ! Donc, une fois le repas termin‚...$",
 	"Quelqu'un entre, s'affaire, ressort...$",
 	"On s'approche de votre cachette !$",
 	"On vous surprend !$",
-	"Non : vous êtes trop chargé !$",
+	"Non : vous ˆtes trop charg‚ !$",
 	"Essayez de nouveau$",
 	"Vous restez perplexe !?$",
 	"Vous quittez le Manoir. A Paris, un message vous attend...$",
-	"Aïe, aïe, aïe !$",
+	"A‹e, a‹e, a‹e !$",
 	"Rien de plus$",
-	"Le son paraît normal$",
+	"Le son paraŒt normal$",
 	"Ca ne bouge pas$",
-	"On vous répond$",
+	"On vous r‚pond$",
 	"Pas le moment !$",
-	"Même matière, autre face !$",
-	"Le reflet est piqué, mais le cadre est d'or$",
+	"Mˆme matiŠre, autre face !$",
+	"Le reflet est piqu‚, mais le cadre est d'or$",
 	"Bibelots, babioles...$",
-	"Vous essuyez un échec !$",
+	"Vous essuyez un ‚chec !$",
 	"Il est des odeurs... qu'il vaut mieux ne pas voir !$",
-	"Des produits ménagers$",
-	"ça vous démange ?$",
-	"C'est coincé, gelé ! Brrrr...$",
-	"Les huisseries sont bloquées !$",
+	"Des produits m‚nagers$",
+	"‡a vous d‚mange ?$",
+	"C'est coinc‚, gel‚ ! Brrrr...$",
+	"Les huisseries sont bloqu‚es !$",
 	"Des papiers...$",
-	"Non ! Le père Noêl n'est pas coincé !$",
-	"ça donne sur un couloir$",
+	"Non ! Le pŠre Noˆl n'est pas coinc‚ !$",
+	"‡a donne sur un couloir$",
 	"Vaisselle, argenterie...$",
 	"Non ! Ce ne sont pas les restes de Julia !$",
 	"Une gravure ancienne$",
@@ -726,17 +726,17 @@ const char *gameDataFr[] = {
 	"Le passage se ferme$",
 	"Un tiroir secret... Un livret ! Le lisez-vous ?$",
 	"Le tiroir se referme$",
-	"Rien ! Sang et chairs collent à la pierre !$",
-	"Des détails vous font supposer que... la mort ne fut pas immédiate !$",
-	"Des projets véreux ?$",
-	"Sa vie n'aurait-elle tenu qu'à un doigt ?$",
-	"Un trésor se serait-il fait la malle ?$",
-	"Une fente de la taille d'une pièce !$",
-	"Quelques pierres pivotent... Une crypte ! Y pénétrez-vous ?$",
+	"Rien ! Sang et chairs collent … la pierre !$",
+	"Des d‚tails vous font supposer que... la mort ne fut pas imm‚diate !$",
+	"Des projets v‚reux ?$",
+	"Sa vie n'aurait-elle tenu qu'… un doigt ?$",
+	"Un tr‚sor se serait-il fait la malle ?$",
+	"Une fente de la taille d'une piŠce !$",
+	"Quelques pierres pivotent... Une crypte ! Y p‚n‚trez-vous ?$",
 	"La bague tourne, le mur se referme...$",
-	"Une colonne de pierres derrière l'autel$",
+	"Une colonne de pierres derriŠre l'autel$",
 	"Il y a du bruit...$",
-	"Occupé !$",
+	"Occup‚ !$",
 	"Retentez-vous votre chance ?$",
 	"Trop profond !$",
 	"Le mur de la cave pivote$",
@@ -745,45 +745,45 @@ const char *gameDataFr[] = {
 	"L'objet glisse au fond...$",
 	"Vous n'avez rien en main$",
 	"Ce n'est pas ouvert$",
-	"Il y a déjà quelque chose$",
-	"La porte est fermée$",
-	"Pas de réponse$",
+	"Il y a d‚j… quelque chose$",
+	"La porte est ferm‚e$",
+	"Pas de r‚ponse$",
 	"Une boule de bois pleine$",
 	"Il n'y a plus de place$",
-	"Une boule de bois percée par le travers$",
+	"Une boule de bois perc‚e par le travers$",
 	"? ?$",
 	"A vous de jouer$",
 	"OK !$",
-	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  Détective \"privé\"... de bon sens et de discrétion sans doute\" . Déçu démoralisé, vous quittez le manoir at Vous ètes NUL !$",
-	"Léo vous interrompt : \"la tempète est calmée. Je pars en ville dans 1 heure. Tenez-vous prêt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
-	"Congestion, grippe fatale : vous y restez ! Votre enquète tombe à l'eau$",
-	"L'eau monte très vite et refroidit vos dernières illusions...  Avant que vous n'ayez eu le temps de réagir, vous ètes mort!$",
-	"A peine ètes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
-	"La tempète recouvre vos traces . Un mur de silence s'abat sur vos épaules . Lentement vous succombez à la morsure du froid !$",
-	"Pas si seul que ça ! Une lame glacée s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
-	"Vous ignorez la responsabilité exacte de Léo dans la mort de Murielle... Est-elle morte sur le coup ? De toutes façons les problèmes familiaux découverts lors de votre enquète justifient l'attitude de Léo... Vous n'ètes pas sûr que Julia vous ait appelé pour ça mais c'est suffisant pour vous ! Par respect pour elle, et après  certaines précautions, vous avez une entrevue révélatrice avec Léo$",
+	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  D‚tective \"priv‚\"... de bon sens et de discr‚tion sans doute\" . D‚‡u d‚moralis‚, vous quittez le manoir at Vous Štes NUL !$",
+	"L‚o vous interrompt : \"la tempŠte est calm‚e. Je pars en ville dans 1 heure. Tenez-vous prˆt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
+	"Congestion, grippe fatale : vous y restez ! Votre enquŠte tombe … l'eau$",
+	"L'eau monte trŠs vite et refroidit vos derniŠres illusions...  Avant que vous n'ayez eu le temps de r‚agir, vous Štes mort!$",
+	"A peine Štes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
+	"La tempŠte recouvre vos traces . Un mur de silence s'abat sur vos ‚paules . Lentement vous succombez … la morsure du froid !$",
+	"Pas si seul que ‡a ! Une lame glac‚e s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
+	"Vous ignorez la responsabilit‚ exacte de L‚o dans la mort de Murielle... Est-elle morte sur le coup ? De toutes fa‡ons les problŠmes familiaux d‚couverts lors de votre enquŠte justifient l'attitude de L‚o... Vous n'Štes pas s—r que Julia vous ait appel‚ pour ‡a mais c'est suffisant pour vous ! Par respect pour elle, et aprŠs  certaines pr‚cautions, vous avez une entrevue r‚v‚latrice avec L‚o$",
 	"$",
-	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans réponse . Vous allez attraper... la mort !$",
-	"D'un mouvement circulaire, l'épée vous fend par le travers : tripes et boyaux à l'air, bonjour les vers!$",
+	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans r‚ponse . Vous allez attraper... la mort !$",
+	"D'un mouvement circulaire, l'‚p‚e vous fend par le travers : tripes et boyaux … l'air, bonjour les vers!$",
 	"Home, Sweet home !$",
-	"Mystère d'une porte close$",
-	"Charme envoûtant de vieilles pièces$",
+	"MystŠre d'une porte close$",
+	"Charme envo—tant de vieilles piŠces$",
 	"La faim au ventre$",
-	"Plus près du ciel? Pas sûr !$",
+	"Plus prŠs du ciel? Pas s—r !$",
 	"Peur du noir?$",
 	"Vieux tapis et reflets d'or$",
 	"Angoisse !$",
-	"Sauvé ? Pas certain !$",
-	"Mal à l'aise, hein !$",
+	"Sauv‚ ? Pas certain !$",
+	"Mal … l'aise, hein !$",
 	"Toujours plus loin !$",
 	"Votre chemin de croix !$",
-	"A la découverte de...$",
-	"Attention à ce que cache...$",
+	"A la d‚couverte de...$",
+	"Attention … ce que cache...$",
 	"Une descente aux Enfers !$",
 	"Si ce n'est pas dans vos cordes :@       ne soyez pas sot!$",
-	"Avant la mise en pièce !$",
+	"Avant la mise en piŠce !$",
 	"Gros plan sur :$",
-	"Vous remarquez particulièrement...$",
+	"Vous remarquez particuliŠrement...$",
 	"Et encore...$",
 	"C'est fini !$",
 	"Un peu de lecture$",
@@ -794,17 +794,17 @@ const char *gameDataFr[] = {
 	"Non ! Pas ce coup-ci$",
 	"Trop tard$",
 	"$",
-	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumière, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artère comme un rat au coeur même de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
-	"10/1/50: Nous avons résolu le mystère du manuscrit et localisé la crypte . Est-ce l'idée d'aboutir dans ce qui n'était qu'un \"rêve\" qui me rend si anxieuse ?@Je regrette de m'être engagée vis à vis de Léo . Non! je dois continuer ! J'aurais dû mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
-	"Porte ta prière au lieu saint qui se doit, changes-en l'air, tu auras la matière !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton âme s'ouvrira un chemin et gagnera son ère . Avance comme un Orphée peu soucieux des ténèbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'à la mystérieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse première.$",
-	"Les montagnes sont les crocs d'une gueule dantesque ouverte à l'infini de quelqu' orgie céleste, mastiquant des étoiles comme nous broyons du noir . at Tu déposeras l'accord de pierre à tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mètre . Tu passeras ainsi entre les deux croissants, par delà les abîmes du Mur du Silence . La Clé des champs est à ta portée, tu n'as qu'à retrouver la note qui dénote.$",
+	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumiŠre, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artŠre comme un rat au coeur mˆme de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
+	"10/1/50: Nous avons r‚solu le mystŠre du manuscrit et localis‚ la crypte . Est-ce l'id‚e d'aboutir dans ce qui n'‚tait qu'un \"rŠve\" qui me rend si anxieuse ?@Je regrette de m'ˆtre engag‚e vis … vis de L‚o . Non! je dois continuer ! J'aurais d— mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
+	"Porte ta priŠre au lieu saint qui se doit, changes-en l'air, tu auras la matiŠre !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton …me s'ouvrira un chemin et gagnera son Šre . Avance comme un Orph‚e peu soucieux des t‚nŠbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'… la myst‚rieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse premiŠre.$",
+	"Les montagnes sont les crocs d'une gueule dantesque ouverte … l'infini de quelqu' orgie c‚leste, mastiquant des ‚toiles comme nous broyons du noir . at Tu d‚poseras l'accord de pierre … tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mŠtre . Tu passeras ainsi entre les deux croissants, par del… les abŒmes du Mur du Silence . La Cl‚ des champs est … ta port‚e, tu n'as qu'… retrouver la note qui d‚note.$",
 	"                DECEMBRE@   9 REMISE     518    13 AGIOS       23@  19 VIREMENT  1203    17 TRESOR    1598@      TOTAL     1721        TOTAL    1721$",
-	"  Le 5/01/51@@              Luc, mon amour@ Guy connaît notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'à toi !  Max me relance mais j'ai définitivement rompu avec lui . Qu'il reste à ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
-	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai prétés pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
-	"  Mortevielle, le 15/2/51@              Maître,@ Je vous écris au sujet de notre affaire.  Je suis décidé  à aller jusqu'au bout, certain que mon associé, Pat DEFRANCK, a falsifié  un livre de comptes . Malgré$",
+	"  Le 5/01/51@@              Luc, mon amour@ Guy connaŒt notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'… toi !  Max me relance mais j'ai d‚finitivement rompu avec lui . Qu'il reste … ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
+	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr‚t‚s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
+	"  Mortevielle, le 15/2/51@              MaŒtre,@ Je vous ‚cris au sujet de notre affaire.  Je suis d‚cid‚  … aller jusqu'au bout, certain que mon associ‚, Pat DEFRANCK, a falsifi‚  un livre de comptes . Malgr‚$",
 	" Une pipe$",
-	" Un stylo à plume$",
-	" Un briquet à essence$",
+	" Un stylo … plume$",
+	" Un briquet … essence$",
 	" Une cornue$",
 	" Un blaireau$",
 	" Un pot de peinture$",
@@ -814,13 +814,13 @@ const char *gameDataFr[] = {
 	" Un vieux bouquin$",
 	" Un porte-monnaie$",
 	" Un poignard$",
-	" Un révolver$",
+	" Un r‚volver$",
 	" Une bible$",
 	" Une bougie$",
-	" Un coffret à bijoux$",
-	" Un fer à repasser$",
+	" Un coffret … bijoux$",
+	" Un fer … repasser$",
 	" Une photo$",
-	" Une montre à gousset$",
+	" Une montre … gousset$",
 	" Une corde$",
 	" Des clefs$",
 	" Un collier de perles$",
@@ -830,9 +830,9 @@ const char *gameDataFr[] = {
 	" Une bourse en cuir$",
 	" Une balle de tennis$",
 	" Des munitions$",
-	" Un rasoir à main$",
-	" Une brosse à cheveux$",
-	" Une brosse à linge$",
+	" Un rasoir … main$",
+	" Une brosse … cheveux$",
+	" Une brosse … linge$",
 	" Un jeu de cartes$",
 	" Un chausse pied$",
 	" Un tournevis$",
@@ -843,14 +843,14 @@ const char *gameDataFr[] = {
 	" Un pinceau$",
 	" Une corde$",
 	" Un objet en bois$",
-	" Des somnifères$",
+	" Des somnifŠres$",
 	" Une bague en or$",
-	" Un coffret à bijoux$",
-	" Un réveil matin$",
+	" Un coffret … bijoux$",
+	" Un r‚veil matin$",
 	" Une cotte de mailles$",
 	" Un chandellier$",
 	" Une paire de gants$",
-	" Une coupe ciselée$",
+	" Une coupe cisel‚e$",
 	" Un parchemin$",
 	" Un poignard$",
 	" Un dossier$",
@@ -868,13 +868,13 @@ const char *gameDataFr[] = {
 	"La mort de Julia$",
 	"Les relations de Julia$",
 	"Un message de Julia$",
-	"L'héritage de Julia$",
+	"L'h‚ritage de Julia$",
 	"Derniers actes de Julia$",
 	"Les cadeaux de Julia$",
 	"La chambre de Julia$",
 	"La photo chez Julia$",
 	"Julia et vous...$",
-	"Les occupations de Léo$",
+	"Les occupations de L‚o$",
 	"Les occupations de Pat$",
 	"Les occupations de Guy$",
 	"Les occupations de Bob$",
@@ -883,7 +883,7 @@ const char *gameDataFr[] = {
 	"Les occupations d'Ida$",
 	"Les occupations de Max$",
 	"Vos occupations$",
-	"Les relations de Léo$",
+	"Les relations de L‚o$",
 	"Les relations de Pat$",
 	"Les relations de Guy$",
 	"Les relations de Bob$",
@@ -910,169 +910,169 @@ const char *gameDataFr[] = {
 	"$",
 	"FIN DE LA CONVERSATION$",
 	"Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"C'est le massif montagneux que l'on aperçoit devant le manoir$",
+	"C'est le massif montagneux que l'on aper‡oit devant le manoir$",
 	"Je n'en sais rien !$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Ma mére est morte soudainement . Son état semblait pourtant s'être amélioré$",
+	"Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
 	"Madame DEFRANCK est morte d'un coup de froid$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Pardonnez moi mais je préfère, actuellement garder le silence$",
+	"Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
 	"Ce sont toujours les meilleurs qui partent les premiers$",
-	"J'aimais beaucoup ma mère . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"C'est une région qui a un passé chargé et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"C'est un passionné d'histoire et un joueur invétéré . D'ailleurs, voici un an il a gagné une grosse somme$",
-	"Il a déjà beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"Je suis PDG d'une petite société de parfums . Mais quand je suis ici, je me repose$",
-	"C'est un homme dynamique qui a réussi dans le parfum$",
-	"Lui ! C'est un arriviste véreux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soirées dans sa chambre$",
-	"J'ai été très préoccupé par la santé de ma mère, et maintenant je n'ai plus goût à rien$",
-	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mère$",
-	"Ce sont ses affaires ...$",
+	"J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
+	"Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir...$",
+	"Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
+	"C'est un homme dynamique qui a r‚ussi dans le parfum$",
+	"Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
+	"J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
+	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"Ce sont ses affaires...$",
 	"Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"Je travaille avec Pat mais ça ne va pas très fort en ce moment$",
-	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper sérieusement alors$",
-	"Lui et Pat sont associés . Je crois que ça ne va pas trop mal$",
-	"Je m'occupe de moi et c'est déjà beaucoup . Et vous ?$",
-	"Oh ça ! Je lui fais confiance . Elle sait s'occuper$",
-	"Mais ! Vous n'avez pas encore découvert son occupation principale ...?$",
-	"Elle fait dans la décoration avec beaucoup degoût d'ailleurs . Elle est toujours très bien habillée$",
-	"Si les bijoux vous interessent, j'ai quelques affaires interessantes à saisir rapidement$",
-	"Les bijoux ...$",
+	"Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
+	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
+	"Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
+	"Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
+	"Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
+	"Mais ! Vous n'avez pas encore d‚couvert son occupation principale..?$",
+	"Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs. Elle est toujours trŠs bien habill‚e$",
+	"Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"Les bijoux...$",
 	"Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"Quand on est une femme d'intérieur on trouve toujours de quoi s'occuper...$",
+	"Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
 	"Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"Elle n'a sûrement pas des occupations très épanouissantes ...$",
+	"Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
 	"Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"Entre la cuisine et le ménage, je n'ai pas beaucoup de temps à vous accorder$",
+	"Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
 	"Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"Il en ferait plus si il s'occupait moins des ragôts et de la bouteille$",
-	"Je suis très indépendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problème$",
-	"C'est un égoïste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"Je crois qu'il s'entend bien avec tout le monde, mis à part, peut être, avec Guy$",
-	"C'est un homme de caractère . Il faut savoir le prendre ..$",
-	"Les affaires sont les affaires . Quant à la famille, je la laisse pour ce qu'elle est ...$",
-	"Relations ? Relations amicales ? Relations financières sans doute$",
-	"Moi je n'ai rien à lui reprocher$",
-	"C'est un homme d'affaire débrouillard . Il nage parfois à contre-courant mais ... il s'en sortira toujours$",
-	"Ils m'ennuient tous .. Non ! Ce n'est même pas ça .. Quoique .. certains ..$",
-	"A l'inverse de sa mère, c'est une personne très renfermée ! Alors question relations ..$",
-	"Il doit sans doute faire beaucoup d'effort pour rester agréable malgré tous ses ennuis$",
-	"Ses relations amoureuses : C'est terminé . Ses relations avec moi : Pas vraiment commencées . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
+	"Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
+	"C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
+	"C'est un homme de caractŠre . Il faut savoir le prendre ..$",
+	"Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
+	"Relations ? Relations amicales ? Relations financiŠres sans doute$",
+	"Moi je n'ai rien … lui reprocher$",
+	"C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
+	"Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
+	"A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
+	"Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
+	"Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
 	"J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"Il ne suffit pas d'avoir un peu d'argent et d'être beau parleur pour plaire à tout le monde$",
-	"Sans histoire .. C'est quelqu'un d'agréable et généreux . De plus, il ne manque pas d'humour$",
-	"Actuellement je m'entends plutôt bien avec tout le monde . Mais, ici, je ne vais pas m'étendre sur le sujet$",
-	"Beau plumage, mais ça ne vole pas haut ... Parlez en à son mari$",
+	"Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
+	"Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
+	"Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
+	"Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
 	"C'est pour un rendez-vous ?$",
-	"Elle est très vivante ! Elle ne s'embarrasse pas de préjugés stupides$",
-	"Dans mon métier, on côtoit surtout des belles femmes et des truands$",
-	"La seule valeur sûre chez lui, c'est ses bijoux .. Et sa femme, mais ça il ne s'en rend pas compte$",
-	"C'est quelqu'un d'interessant . De pas toujours facile à comprendre, mais qui mérite le détour$",
-	"Je ne déteste personne, mais j'aime les choses et les gens quand ils sont à leur place$",
-	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite à l'étroit !$",
-	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volonté$",
-	"Vous savez dans mon métier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
+	"Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
+	"La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
+	"C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
+	"Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
+	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
+	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
+	"Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
 	"C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"Je ne connait pas le fond de sa pensée mais c'est quelqu'un de toujours très correct et impeccable$",
-	"C'était une personne qui a vécu au manoir, il y a un an .. peut être plus$",
-	"C'était plus qu'une amie pour ma mère . En ces moments, j'aurais aimé qu'elle soit à mes cotés$",
-	"Murielle a été la dame de compagnie de Julia$",
+	"Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
+	"C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
+	"C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
+	"Murielle a ‚t‚ la dame de compagnie de Julia$",
 	"Elle aussi, faisait des recherches ...$",
-	"C'était une femme très cultivée . Son brusque départ, il y a un an, m'a surpris et beaucoup chagriné$",
-	"Elle partageait avec Léo sa passion de l'histoire et de la région$",
+	"C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
+	"Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
 	"Je crois que tout le monde l'aimait bien$",
-	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mère, belle-fille ..$",
-	"A part Léo, elle avait de très bon rapport avec Max ...$",
-	"Bien que vos relations furent peu soutenues, Jérôme, elle vous portait toujours dans son coeur ...$",
+	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
+	"A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
+	"Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
 	"A part sa famille, pas grand monde$",
-	"Ah oui ! Je crois qu'elle a beaucoup regretté le départ de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
 	"Non rien !$",
 	"Non ... Pas que le sache$",
-	"J'ai connu Julia en achetant le manoir . C'était son seul bien . Mais toute ma fortune était la sienne ...$",
-	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien à elle$",
-	"Je crois que toute sa fortune venait de Léo . Alors, Pfuuut !$",
-	"A part la lettre pour vous que j'ai posté, rien de bien important !$",
-	"J'ai été très heureuse qu'elle m'offre sa bible reliée$",
-	"Ca a été rapide et elle n'a pas eu le temps de prendre des dispositions particulières$",
-	"Son dernier présent m'a surpris$",
+	"J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
+	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
+	"Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
+	"A part la lettre pour vous que j'ai post‚, rien de bien important !$",
+	"J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
+	"Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
+	"Son dernier pr‚sent m'a surpris$",
 	"Quel cadeau ?$",
 	"Un chandellier ...$",
-	"Oui, j'ai eu un cadeau . Ma femme a même eu une bible$",
+	"Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
 	"Et bien oui ! Comme tout le monde, je crois$",
 	"Un poignard$",
-	"Je n'ai jamais été fouiller dans le grenier !$",
+	"Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
 	"Vous avez un don de double-vue ou un passe-partout$",
 	"Le portrait d'une jeune fille : C'est Murielle ...$",
 	"Vous savez, je la connaissais assez peu$",
-	"Elle était très charmante, mais c'était surtout la dame de compagnie de Julia$",
-	"C'est la seule femme vraiment interessante que j'ai rencontré$",
-	"Elle avait de grandes connaissances historiques, et la consulter était très enrichissant$",
-	"Je me suis toujours demandé ce que certains pouvaient lui trouver !$",
-	"Si la chambre est fermée, demandez à Léo$",
-	"J'ai fermé sa chambre après sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
+	"C'est la seule femme vraiment interessante que j'ai rencontr‚$",
+	"Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
+	"Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
+	"Si la chambre est ferm‚e, demandez … L‚o$",
+	"J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
 	"Vous savez ce que c'est : Des relations familiales$",
-	"Durant toutes ces années, je ne l'ai jamais servie à contre-coeur$",
+	"Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
 	"Je l'aimais autant qu'elle m'aimais, je crois$",
-	"De quel droit avez-vous pénétré dans la chambre de ma femme ?!!$",
+	"De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
 	"C'est sans doute la photo de Murielle avec le filleul de Julia$",
 	"Je ne me rappelle pas$",
-	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tirée à l'envers$",
-	"Vous êtes bien curieux !... C'est sans valeur$",
-	"Grimoires, parchemins et manuscrits : C'est le domaine de Léo$",
+	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
+	"Vous ˆtes bien curieux !... C'est sans valeur$",
+	"Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
 	"Dommage que la devise soit manquante ...$",
-	"C'est très beau ... Et très vieux ...$",
-	"Tiens ! C'est un endroit que je n'ai jamais visité$",
-	"D'aprés Léo, il semblerait que les Lunes soient plus récentes$",
-	"Même par ce temps, vous avez déniché un soleil ...$",
-	"Profond et inquiétant : Le progrès a du bon$",
-	"Ca reste pour moi le plus grand des mystères$",
+	"C'est trŠs beau ... Et trŠs vieux ...$",
+	"Tiens ! C'est un endroit que je n'ai jamais visit‚$",
+	"D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
+	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"Profond et inqui‚tant : Le progrŠs a du bon$",
+	"Ca reste pour moi le plus grand des mystŠres$",
 	"Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"Il y a un peu plus d'un an, un soir, elle a décidé de partir ...$",
-	"De toutes façons elle n'était pas faite pour vivre ici$",
+	"Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
+	"De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
 	"Quoi ?! Quel corps ? Quel crypte ?$",
-	"Si il y en a, je ne les ai jamais trouvé ...$",
-	"Bien sûr ! ... Et des fantômes aussi ...$",
-	"C'est la plus vielle de la région : Elle date du XI eme siècle$",
-	"Elle fut légèrement restaurée après la révolution$",
+	"Si il y en a, je ne les ai jamais trouv‚ ...$",
+	"Bien s–r ! ... Et des fant“mes aussi ...$",
+	"C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
+	"Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
 	"Julia aimait beaucoup la peinture$",
-	"Ils ont différents styles, mais n'ont pas tous une très grande valeur$",
-	"Que faites-vous là ?$",
-	"Je suis sûr que vous cherchez quelque chose ici$",
-	"Je vous écoute$",
-	"Que désirez-vous ?$",
+	"Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
+	"Que faites-vous l… ?$",
+	"Je suis s–r que vous cherchez quelque chose ici$",
+	"Je vous ‚coute$",
+	"Que d‚sirez-vous ?$",
 	"Oui ?$",
-	"Je suis à vous ...$",
+	"Je suis … vous ...$",
 	"C'est pourquoi ?$",
 	"Allez-y$",
-	"C'est à quel sujet ?$",
-	"Max : à votre service, monsieur$",
-	"De toutes façons vous n'avez rien à faire ici ! Sortez !!$",
-	"Vous êtes trop curieux !$",
-	"Jérôme ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . Léo, son mari bien sûr . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempète redouble, il vous faut rester . Les repas sont à 12h et 19h et il y a un recueillement à la chapelle tous les jours à 10h$",
-	"En vous voyant j'ai compris que vous decouvririez la vérité ... Car je savais pourquoi vous veniez : J'avais retrouvé le brouillon de la lettre de Julia . Mais je suis très joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me protéger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous découvert que le mur du silence est le nom que les maçons ont donné au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laissé avant de mourir étaient autant de faux indices qui ne servaient qu'à faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au décryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouvé un jour dans mes affaires . Une nuit, nous nous sommes aventurés 
 dans le passage secret que nous avions découvert . Murielle est morte par accident dans la pièce de la vierge . J'ai récupéré la bague rapidement, trouvé le trésor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'êtes pas de la police . Laissez moi seul !$",
-	"Février 1951 ... Profession : detective privé . Le froid figeait Paris et mes affaires lorsque ...$",
-	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les pièces délabrées du manoir de Mortevielle . Julia, une vieille femme a présent .$",
+	"C'est … quel sujet ?$",
+	"Max : … votre service, monsieur$",
+	"De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
+	"Vous ˆtes trop curieux !$",
+	"J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
+	"En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aventur‚s 
 dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
+	"F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
+	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
 	" au bureau$",
-	" à la cuisine$",
-	" à la cave$",
+	" … la cuisine$",
+	" … la cave$",
 	" dans le couloir$",
 	" dehors$",
-	" la salle à manger$",
+	" la salle … manger$",
 	" dans le manoir$",
 	" devant le manoir$",
-	" à la chapelle$",
+	" … la chapelle$",
 	" devant le puits$",
 	" au nord$",
-	" derrière le manoir$",
+	" derriŠre le manoir$",
 	" au sud$",
-	" à l'est$",
-	" à l'ouest$",
+	" … l'est$",
+	" … l'ouest$",
 	" vers le manoir$",
 	" plus loin$",
 	" dans l'eau$",
 	" hors du puits$",
 	" dans le puits$",
-	" choix sur écran$",
+	" choix sur ‚cran$",
 	" Dans la serie MYSTERE...$",
 	" LE MANOIR DE MORTEVIELLE$",
 	"$",
@@ -1095,9 +1095,9 @@ const char *gameDataFr[] = {
 	" A VOUS DE JOUER$",
 	" attacher$",
 	" attendre$",
-	" défoncer$",
+	" d‚foncer$",
 	" dormir$",
-	" écouter$",
+	" ‚couter$",
 	" entrer$",
 	" fermer$",
 	" fouiller$",
@@ -1119,7 +1119,7 @@ const char *gameDataFr[] = {
 	" lire$",
 	" poser$",
 	" regarder$",
-	" Léo$",
+	" L‚o$",
 	" Pat$",
 	" Guy$",
 	" Eva$",
@@ -1128,40 +1128,40 @@ const char *gameDataFr[] = {
 	" Ida$",
 	" Max$",
 	"Comment Julia est-elle morte ?$",
-	"Elle s'est suicidée$",
-	"Elle est morte assassinée$",
+	"Elle s'est suicid‚e$",
+	"Elle est morte assassin‚e$",
 	"Elle est morte accidentellement$",
 	"Elle est morte naturellement$",
-	"D'où provenait l'argent qui a permis la restauration du manoir ?$",
+	"D'o— provenait l'argent qui a permis la restauration du manoir ?$",
 	"chantage$",
 	"travail$",
-	"héritage$",
+	"h‚ritage$",
 	"courses$",
 	"rentes$",
 	"hold-up$",
-	"découverte$",
-	"Quel est le hobby de Léo ?$",
+	"d‚couverte$",
+	"Quel est le hobby de L‚o ?$",
 	"recherches historiques$",
 	"politique$",
 	"peinture$",
 	"drogue$",
 	"sciences occultes$",
 	"direction d'une secte$",
-	"Julia a laissé une série d'indices . Ceux-ci sont représentés en un seul lieu . Lequel ?$",
+	"Julia a laiss‚ une s‚rie d'indices . Ceux-ci sont repr‚sent‚s en un seul lieu . Lequel ?$",
 	"Chapelle$",
-	"Extérieur$",
+	"Ext‚rieur$",
 	"Cave$",
 	"Grenier$",
 	"Cuisine$",
-	"Salle à manger$",
+	"Salle … manger$",
 	"Chambre Julia$",
-	"Chambre Léo$",
+	"Chambre L‚o$",
 	"Chambre Pat$",
 	"Chambre Bob$",
 	"Chambre Max$",
 	"Chambre Luc/Ida$",
 	"Chambre Guy/Eva$",
-	"L'indice principal qui vous a permis d'arriver à la porte du souterrain est :$",
+	"L'indice principal qui vous a permis d'arriver … la porte du souterrain est :$",
 	"Un poignard$",
 	"Une bague$",
 	"Un livre$",
@@ -1175,30 +1175,30 @@ const char *gameDataFr[] = {
 	"Trois$",
 	"Quatre$",
 	"Cinq$",
-	"Combien de personnes sont mélées à cette histoire - Julia y comprise, vous excepté - ?$",
+	"Combien de personnes sont m‚l‚es … cette histoire - Julia y comprise, vous except‚ - ?$",
 	"Neuf$",
 	"Dix$",
 	"Onze$",
-	"Quel était le prénom de la personne inconnue ?$",
+	"Quel ‚tait le pr‚nom de la personne inconnue ?$",
 	"Mireille$",
-	"Françoise$",
+	"Fran‡oise$",
 	"Maguy$",
 	"Emilie$",
 	"Murielle$",
 	"Sophie$",
-	"De qui Murielle était-elle la maîtresse ?$",
+	"De qui Murielle ‚tait-elle la maŒtresse ?$",
 	"Bob$",
 	"Luc$",
 	"Guy$",
-	"Léo$",
+	"L‚o$",
 	"Max$",
 	"Murielle partageait une occupation avec une autre personne . Qui ?$",
-	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous préférez|retourner enquéter afin de mieux comprendre ...][ok]$",
-	"[1][ |Insérez la disquette 1 dans le lecteur A][ok]$",
+	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
+	"[1][ |Ins‚rez la disquette 1 dans le lecteur A][ok]$",
 	"[1][ |! ERREUR DISQUETTE !|On arrete tout][ok]$",
-	"[1][ |Vous devriez avoir remarqué|00% des indices][ok]$",
-	"[1][ |Insérez la disquette 2 dans le lecteur A][ok]$",
-	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
+	"[1][ |Vous devriez avoir remarqu‚|00% des indices][ok]$",
+	"[1][ |Ins‚rez la disquette 2 dans le lecteur A][ok]$",
+	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
 	" MASTER .$",
 	"  rorL$",
 };
@@ -1280,7 +1280,7 @@ const char *gameDataDe[] =  {
 	"TBT - Linen, personal belongings...$",
 	"TBT - Not just anywhere!$",
 	"TBT - It's not time!$",
-	"TBT - One doesn't speak with ones mouth full!$",
+	"TBT - One doesn't speak with ones mouth full! So once the meal is over...$",
 	"TBT - Someone comes in, messes about then goes out again$",
 	"TBT - Someone's approaching your hiding-place$",
 	"TBT - Someone surprises you!$",
@@ -1297,7 +1297,7 @@ const char *gameDataDe[] =  {
 	"TBT - The same matter, from another angle!$",
 	"TBT - The reflection is tarnished, but the frame is gold!$",
 	"TBT - Bric-a-brac$",
-	"TBT - Face to face with failure!$",
+	"TBT - Facing failure!$",
 	"TBT - Smells like something you'd rather not see!$",
 	"TBT - Cleaning products$",
 	"TBT - Got an itch?$",
@@ -1462,7 +1462,7 @@ const char *gameDataDe[] =  {
 	"TBT - Julia's bedroom$",
 	"TBT - The photo at Julia's home$",
 	"TBT - Julia and yourself...$",
-	"TBT - Léo's occupations$",
+	"TBT - L‚o's occupations$",
 	"TBT - Pat's occupations$",
 	"TBT - Guy's occupations$",
 	"TBT - Bob's occupations$",
@@ -1471,7 +1471,7 @@ const char *gameDataDe[] =  {
 	"TBT - Ida's occupations$",
 	"TBT - Max's occupations$",
 	"TBT - Your occupations$",
-	"TBT - Léo's relationships$",
+	"TBT - L‚o's relationships$",
 	"TBT - Pat's relationships$",
 	"TBT - Guy's relationships$",
 	"TBT - Bob's relationships$",
@@ -1498,149 +1498,149 @@ const char *gameDataDe[] =  {
 	"TBT - $",
 	"TBT - END OF THE CONVERSATION$",
 	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"TBT - C'est le massif montagneux que l'on aperçoit devant le manoir$",
+	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
 	"TBT - Je n'en sais rien !$",
 	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Ma mére est morte soudainement . Son état semblait pourtant s'être amélioré$",
+	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
 	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
 	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Pardonnez moi mais je préfère, actuellement garder le silence$",
+	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
 	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
-	"TBT - J'aimais beaucoup ma mère . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"TBT - C'est une région qui a un passé chargé et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"TBT - C'est un passionné d'histoire et un joueur invétéré . D'ailleurs, voici un an il a gagné une grosse somme$",
-	"TBT - Il a déjà beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"TBT - Je suis PDG d'une petite société de parfums . Mais quand je suis ici, je me repose$",
-	"TBT - C'est un homme dynamique qui a réussi dans le parfum$",
-	"TBT - Lui ! C'est un arriviste véreux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soirées dans sa chambre$",
-	"TBT - J'ai été très préoccupé par la santé de ma mère, et maintenant je n'ai plus goût à rien$",
-	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mère$",
+	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
+	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
+	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
+	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
+	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
+	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
+	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
 	"TBT - Ce sont ses affaires ...$",
 	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"TBT - Je travaille avec Pat mais ça ne va pas très fort en ce moment$",
-	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper sérieusement alors$",
-	"TBT - Lui et Pat sont associés . Je crois que ça ne va pas trop mal$",
-	"TBT - Je m'occupe de moi et c'est déjà beaucoup . Et vous ?$",
-	"TBT - Oh ça ! Je lui fais confiance . Elle sait s'occuper$",
-	"TBT - Mais ! Vous n'avez pas encore découvert son occupation principale ..?$",
-	"TBT - Elle fait dans la décoration avec beaucoup degoût d'ailleurs . Elle est toujours très bien habillée$",
-	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes à saisir rapidement$",
+	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
+	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
+	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
+	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
+	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
+	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
+	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
+	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
 	"TBT - Les bijoux ...$",
 	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"TBT - Quand on est une femme d'intérieur on trouve toujours de quoi s'occuper...$",
+	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
 	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"TBT - Elle n'a sûrement pas des occupations très épanouissantes ...$",
+	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
 	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"TBT - Entre la cuisine et le ménage, je n'ai pas beaucoup de temps à vous accorder$",
+	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
 	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"TBT - Il en ferait plus si il s'occupait moins des ragôts et de la bouteille$",
-	"TBT - Je suis très indépendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problème$",
-	"TBT - C'est un égoïste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis à part, peut être, avec Guy$",
-	"TBT - C'est un homme de caractère . Il faut savoir le prendre ..$",
-	"TBT - Les affaires sont les affaires . Quant à la famille, je la laisse pour ce qu'elle est ...$",
-	"TBT - Relations ? Relations amicales ? Relations financières sans doute$",
-	"TBT - Moi je n'ai rien à lui reprocher$",
-	"TBT - C'est un homme d'affaire débrouillard . Il nage parfois à contre-courant mais ... il s'en sortira toujours$",
-	"TBT - Ils m'ennuient tous .. Non ! Ce n'est même pas ça .. Quoique .. certains ..$",
-	"TBT - A l'inverse de sa mère, c'est une personne très renfermée ! Alors question relations ..$",
-	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agréable malgré tous ses ennuis$",
-	"TBT - Ses relations amoureuses : C'est terminé . Ses relations avec moi : Pas vraiment commencées . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
+	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
+	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
+	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
+	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
+	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
+	"TBT - Moi je n'ai rien … lui reprocher$",
+	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
+	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
+	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
+	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
+	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
 	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'être beau parleur pour plaire à tout le monde$",
-	"TBT - Sans histoire .. C'est quelqu'un d'agréable et généreux . De plus, il ne manque pas d'humour$",
-	"TBT - Actuellement je m'entends plutôt bien avec tout le monde . Mais, ici, je ne vais pas m'étendre sur le sujet$",
-	"TBT - Beau plumage, mais ça ne vole pas haut ... Parlez en à son mari$",
+	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
+	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
+	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
+	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
 	"TBT - C'est pour un rendez-vous ?$",
-	"TBT - Elle est très vivante ! Elle ne s'embarrasse pas de préjugés stupides$",
-	"TBT - Dans mon métier, on côtoit surtout des belles femmes et des truands$",
-	"TBT - La seule valeur sûre chez lui, c'est ses bijoux .. Et sa femme, mais ça il ne s'en rend pas compte$",
-	"TBT - C'est quelqu'un d'interessant . De pas toujours facile à comprendre, mais qui mérite le détour$",
-	"TBT - Je ne déteste personne, mais j'aime les choses et les gens quand ils sont à leur place$",
-	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite à l'étroit !$",
-	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volonté$",
-	"TBT - Vous savez dans mon métier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
+	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
+	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
+	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
+	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
+	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
+	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
+	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
 	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"TBT - Je ne connait pas le fond de sa pensée mais c'est quelqu'un de toujours très correct et impeccable$",
-	"TBT - C'était une personne qui a vécu au manoir, il y a un an .. peut être plus$",
-	"TBT - C'était plus qu'une amie pour ma mère . En ces moments, j'aurais aimé qu'elle soit à mes cotés$",
-	"TBT - Murielle a été la dame de compagnie de Julia$",
+	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
+	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
+	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
+	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
 	"TBT - Elle aussi, faisait des recherches ...$",
-	"TBT - C'était une femme très cultivée . Son brusque départ, il y a un an, m'a surpris et beaucoup chagriné$",
-	"TBT - Elle partageait avec Léo sa passion de l'histoire et de la région$",
+	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
+	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
 	"TBT - Je crois que tout le monde l'aimait bien$",
-	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mère, belle-fille ..$",
-	"TBT - A part Léo, elle avait de très bon rapport avec Max ...$",
-	"TBT - Bien que vos relations furent peu soutenues, Jérôme, elle vous portait toujours dans son coeur ...$",
+	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
+	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
+	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
 	"TBT - A part sa famille, pas grand monde$",
-	"TBT - Ah oui ! Je crois qu'elle a beaucoup regretté le départ de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
 	"TBT - Non rien !$",
 	"TBT - Non ... Pas que le sache$",
-	"TBT - J'ai connu Julia en achetant le manoir . C'était son seul bien . Mais toute ma fortune était la sienne ...$",
-	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien à elle$",
-	"TBT - Je crois que toute sa fortune venait de Léo . Alors, Pfuuut !$",
-	"TBT - A part la lettre pour vous que j'ai posté, rien de bien important !$",
-	"TBT - J'ai été très heureuse qu'elle m'offre sa bible reliée$",
-	"TBT - Ca a été rapide et elle n'a pas eu le temps de prendre des dispositions particulières$",
-	"TBT - Son dernier présent m'a surpris$",
+	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
+	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
+	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
+	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
+	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
+	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
+	"TBT - Son dernier pr‚sent m'a surpris$",
 	"TBT - Quel cadeau ?$",
 	"TBT - Un chandellier ...$",
-	"TBT - Oui, j'ai eu un cadeau . Ma femme a même eu une bible$",
+	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
 	"TBT - Et bien oui ! Comme tout le monde, je crois$",
 	"TBT - Un poignard$",
-	"TBT - Je n'ai jamais été fouiller dans le grenier !$",
+	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
 	"TBT - Vous avez un don de double-vue ou un passe-partout$",
 	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
 	"TBT - Vous savez, je la connaissais assez peu$",
-	"TBT - Elle était très charmante, mais c'était surtout la dame de compagnie de Julia$",
-	"TBT - C'est la seule femme vraiment interessante que j'ai rencontré$",
-	"TBT - Elle avait de grandes connaissances historiques, et la consulter était très enrichissant$",
-	"TBT - Je me suis toujours demandé ce que certains pouvaient lui trouver !$",
-	"TBT - Si la chambre est fermée, demandez à Léo$",
-	"TBT - J'ai fermé sa chambre après sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
+	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
+	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
+	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
+	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
+	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
 	"TBT - Vous savez ce que c'est : Des relations familiales$",
-	"TBT - Durant toutes ces années, je ne l'ai jamais servie à contre-coeur$",
+	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
 	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
-	"TBT - De quel droit avez-vous pénétré dans la chambre de ma femme ?!!$",
+	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
 	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
 	"TBT - Je ne me rappelle pas$",
-	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tirée à l'envers$",
-	"TBT - Vous êtes bien curieux !... C'est sans valeur$",
-	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de Léo$",
+	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
+	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
+	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
 	"TBT - Dommage que la devise soit manquante ...$",
-	"TBT - C'est très beau ... Et très vieux ...$",
-	"TBT - Tiens ! C'est un endroit que je n'ai jamais visité$",
-	"TBT - D'aprés Léo, il semblerait que les Lunes soient plus récentes$",
-	"TBT - Même par ce temps, vous avez déniché un soleil ...$",
-	"TBT - Profond et inquiétant : Le progrès a du bon$",
-	"TBT - Ca reste pour moi le plus grand des mystères$",
+	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
+	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
+	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
+	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
+	"TBT - Ca reste pour moi le plus grand des mystŠres$",
 	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"TBT - Il y a un peu plus d'un an, un soir, elle a décidé de partir ...$",
-	"TBT - De toutes façons elle n'était pas faite pour vivre ici$",
+	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
+	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
 	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
-	"TBT - Si il y en a, je ne les ai jamais trouvé ...$",
-	"TBT - Bien sûr ! ... Et des fantômes aussi ...$",
-	"TBT - C'est la plus vielle de la région : Elle date du XI eme siècle$",
-	"TBT - Elle fut légèrement restaurée après la révolution$",
+	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
+	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
+	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
+	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
 	"TBT - Julia aimait beaucoup la peinture$",
-	"TBT - Ils ont différents styles, mais n'ont pas tous une très grande valeur$",
-	"TBT - Que faites-vous là ?$",
-	"TBT - Je suis sûr que vous cherchez quelque chose ici$",
-	"TBT - Je vous écoute$",
-	"TBT - Que désirez-vous ?$",
+	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
+	"TBT - Que faites-vous l… ?$",
+	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
+	"TBT - Je vous ‚coute$",
+	"TBT - Que d‚sirez-vous ?$",
 	"TBT - Oui ?$",
-	"TBT - Je suis à vous ...$",
+	"TBT - Je suis … vous ...$",
 	"TBT - C'est pourquoi ?$",
 	"TBT - Allez-y$",
-	"TBT - C'est à quel sujet ?$",
-	"TBT - Max : à votre service, monsieur$",
-	"TBT - De toutes façons vous n'avez rien à faire ici ! Sortez !!$",
-	"TBT - Vous êtes trop curieux !$",
-	"TBT - Jérôme ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . Léo, son mari bien sûr . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempète redouble, il vous faut rester . Les repas sont à 12h et 19h et il y a un recueillement à la chapelle tous les jours à 10h$",
-	"TBT - En vous voyant j'ai compris que vous decouvririez la vérité ... Car je savais pourquoi vous veniez : J'avais retrouvé le brouillon de la lettre de Julia . Mais je suis très joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me protéger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous découvert que le mur du silence est le nom que les maçons ont donné au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laissé avant de mourir étaient autant de faux indices qui ne servaient qu'à faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au décryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouvé un jour dans mes affaires . Une nuit, nous nous sommes aven
 turés dans le passage secret que nous avions découvert . Murielle est morte par accident dans la pièce de la vierge . J'ai récupéré la bague rapidement, trouvé le trésor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'êtes pas de la police . Laissez moi seul !$",
-	"TBT - Février 1951 ... Profession : detective privé . Le froid figeait Paris et mes affaires lorsque ...$",
-	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les pièces délabrées du manoir de Mortevielle . Julia, une vieille femme a présent .$",
-	"TBT -  to the bureau$",
+	"TBT - C'est … quel sujet ?$",
+	"TBT - Max : … votre service, monsieur$",
+	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
+	"TBT - Vous ˆtes trop curieux !$",
+	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
+	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
+	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
+	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"TBT -  to the office$",
 	"TBT -  to the kitchen$",
 	"TBT -  to the cellar$",
 	"TBT -  to the landing$",
@@ -1649,7 +1649,7 @@ const char *gameDataDe[] =  {
 	"TBT -  inside the manor$",
 	"TBT -  front of the manor$",
 	"TBT -  to the chapel$",
-	"TBT -  to the weel$",
+	"TBT -  to the well$",
 	"TBT -  north$",
 	"TBT -  behind the manor$",
 	"TBT -  south$",
@@ -1658,8 +1658,8 @@ const char *gameDataDe[] =  {
 	"TBT -  towards the manor$",
 	"TBT -  further$",
 	"TBT -  in the water$",
-	"TBT -  out of the weel$",
-	"TBT -  in the weel$",
+	"TBT -  out of the well$",
+	"TBT -  in the well$",
 	"TBT -  choice on screen$",
 	"TBT - In the MYSTERY series...$",
 	"TBT - MORTVILLE MANOR$",
@@ -1670,7 +1670,7 @@ const char *gameDataDe[] =  {
 	"TBT - Directed by: KYILKHOR CREATION and LANGLOIS$",
 	"TBT - $",
 	"TBT - With the cooperation of...$",
-	"TBT - Béatrice et Jean_Luc LANGLOIS$",
+	"TBT - B‚atrice et Jean_Luc LANGLOIS$",
 	"TBT - for the music and the voices,$",
 	"TBT - Bernard GRELAUD for the graphic conception,$",
 	"TBT - MARIA-DOLORES for the graphic direction,$",
@@ -1720,7 +1720,7 @@ const char *gameDataDe[] =  {
 	"TBT - - Was she murdered?$",
 	"TBT - - Did she die by accident?$",
 	"TBT - - Did she die of natural causes?$",
-	"TBT - Where did the money come from at for the restoration of the manor?$",
+	"TBT - Where did the money used at for the restoration of the manor come from?$",
 	"TBT - - Blackmail$",
 	"TBT - - Honest work$",
 	"TBT - - Inheritance$",
@@ -1769,7 +1769,7 @@ const char *gameDataDe[] =  {
 	"TBT - - 11$",
 	"TBT - What was the first name at of the unknown character?$",
 	"TBT - - Mireille$",
-	"TBT - - Françoise$",
+	"TBT - - Fran‡oise$",
 	"TBT - - Maguy$",
 	"TBT - - Emilie$",
 	"TBT - - Murielle$",
@@ -1786,7 +1786,7 @@ const char *gameDataDe[] =  {
 	"TBT - [1][ | Disk error | All stop... ][ok]$",
 	"TBT - [1][ | You should have noticed |00% of the clues ][ok]$",
 	"TBT - [3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'état de vos connaissances][ok]$",
+	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
 	"TBT -  MASTER .$",
 	"TBT -   rorL$",
 	NULL
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index 0731d3c..125d37f 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: 923729069f3c23494764726dded00df53b7c6cb4
    https://github.com/scummvm/scummvm/commit/923729069f3c23494764726dded00df53b7c6cb4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-25T14:22:07-08:00

Commit Message:
MORTEVIELLE: remove a magic value, initialize the last bytes of cfiecBuffer

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3875d8d..6649084 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -597,7 +597,7 @@ void MortevielleEngine::mainGame() {
 		loadCFIEC();
 
 	for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
-		decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);
+		decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
 
 	loadBRUIT5();
 	_menu.initMenu();
@@ -2498,6 +2498,9 @@ void MortevielleEngine::loadCFIEC() {
 	for (int32 i = 0; i < fileSize; ++i)
 		_cfiecBuffer[i] = f.readByte();
 
+	for (int i = fileSize; i < _cfiecBufferSize; i++)
+		_cfiecBuffer[i] = 0;
+
 	f.close();
 
 	_reloadCFIEC = false;


Commit: 872f4e5e9f6866324be2dbae6db53c5609769184
    https://github.com/scummvm/scummvm/commit/872f4e5e9f6866324be2dbae6db53c5609769184
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-24T14:48:00-07:00

Commit Message:
MORTEVIELLE: Remove CHECK_QUIT macros

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 392ea17..47ffb2e 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1408,7 +1408,8 @@ void MortevielleEngine::fctDiscuss() {
 		do {
 			bool dummyFl;
 			_mouse.moveMouse(dummyFl, retKey);
-			CHECK_QUIT;
+			if (g_vm->shouldQuit())
+				return;
 
 			_mouse.getMousePosition(x, y, click);
 			x *= (3 - _resolutionScaler);
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index ee6eb69..90c53d1 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -110,7 +110,8 @@ int Alert::show(const Common::String &msg, int n) {
 	do {
 		char dummyKey = '\377';
 		g_vm->_mouse.moveMouse(dummyFl, dummyKey);
-		CHECK_QUIT0;
+		if (g_vm->shouldQuit())
+			return 0;
 
 		curPos = g_vm->_mouse._pos;
 		bool newaff = false;
@@ -358,7 +359,8 @@ bool KnowledgeCheck::show() {
 			bool flag;
 			char key;
 			g_vm->_mouse.moveMouse(flag, key);
-			CHECK_QUIT0;
+			if (g_vm->shouldQuit())
+				return false;
 
 			currChoice = 1;
 			while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]._rect))
@@ -428,7 +430,8 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	do {
 		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
 		g_vm->_key = waitForF3F8();
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 
 		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
 			g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6649084..b013f87 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -576,13 +576,15 @@ void MortevielleEngine::showIntroduction() {
 	f3f8::aff50(false);
 	_speechManager._mlec = 0;
 	f3f8::checkForF8(142, false);
-	CHECK_QUIT;
+	if (g_vm->shouldQuit())
+		return;
 
 	f3f8::ani50();
 	f3f8::checkForF8(143, true);
-	CHECK_QUIT;
+	if (g_vm->shouldQuit())
+		return;
 
-	// TODO: Once music is implemented, only use the below delay if music is turned off
+	// TODO: Once music (Amiga/Atari ports) is implemented, only use the below delay if music is turned off
 	showTitleScreen();
 	delay(3000);
 	music();
@@ -611,7 +613,8 @@ void MortevielleEngine::mainGame() {
 	// Loop to play the game
 	do {
 		playGame();
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 	} while (!_quitGame);
 }
 
@@ -625,7 +628,8 @@ void MortevielleEngine::playGame() {
 	// Loop handling actions until the game has to be quit, or show the lose or end sequence
 	do {
 		handleAction();
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 	} while (!((_quitGame) || (_endGame) || (_loseGame)));
 
 	if (_endGame)
@@ -660,7 +664,8 @@ void MortevielleEngine::handleAction() {
 			_menu.updateMenu();
 			prepareRoom();
 			_mouse.moveMouse(funct, inkey);
-			CHECK_QUIT;
+			if (g_vm->shouldQuit())
+				return;
 			++temps;
 		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
 		_inMainGameLoop = false;
@@ -1748,7 +1753,8 @@ void MortevielleEngine::startDialog(int16 rep) {
 	do {
 		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
 		key = f3f8::waitForF3F8();
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 	} while (key != 66);
 	hirs();
 	_mouse.showMouse();
@@ -3383,7 +3389,8 @@ void MortevielleEngine::testKey(bool d) {
 			prepareRoom();
 		quest = keyPressed();
 		_mouse.getMousePosition(x, y, click);
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 	} while (!(quest || (click) || (d && _anyone)));
 	if (quest)
 		testou();
@@ -3618,7 +3625,8 @@ void MortevielleEngine::tfleche() {
 
 		do {
 			_mouse.moveMouse(qust, touch);
-			CHECK_QUIT;
+			if (g_vm->shouldQuit())
+				return;
 
 			if (getMouseClick())
 				inRect = (_mouse._pos.x < 256 * _resolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index aeef3dd..bdf28e4 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -533,9 +533,6 @@ public:
 
 extern MortevielleEngine *g_vm;
 
-#define CHECK_QUIT if (g_vm->shouldQuit()) { return; }
-#define CHECK_QUIT0 if (g_vm->shouldQuit()) { return 0; }
-
 } // End of namespace Mortevielle
 
 #endif
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index bc0f5fe..a6105d8 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -265,7 +265,8 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 
 	// Handle any pending keypresses
 	while (p_key) {
-		CHECK_QUIT;
+		if (g_vm->shouldQuit())
+			return;
 
 		in1 = g_vm->getChar();
 		getMousePosition(cx, cy, click);


Commit: 47067b23c3db67b2a62cb620648cd13eea440229
    https://github.com/scummvm/scummvm/commit/47067b23c3db67b2a62cb620648cd13eea440229
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-24T23:00:11-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in Menu

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 5d64961..8c9fc03 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -93,8 +93,8 @@ void Menu::setDestinationText(int roomId) {
 		roomId = LANDING;
 
 	int destinationId = 0;
-	for (; (destinationId < 7) && (g_vm->_destinationArray[destinationId][roomId]); ++destinationId) {
-		nomp = g_vm->getString(g_vm->_destinationArray[destinationId][roomId] + kMenuPlaceStringIndex);
+	for (; (destinationId < 7) && (_vm->_destinationArray[destinationId][roomId]); ++destinationId) {
+		nomp = _vm->getString(_vm->_destinationArray[destinationId][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
 		setText(_moveMenu[destinationId + 1], nomp);
@@ -175,11 +175,11 @@ void Menu::displayMenu() {
 
 	int pt, x, y, color, msk, num_letr;
 
-	g_vm->_mouse.hideMouse();
+	_vm->_mouse.hideMouse();
 
-	g_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
-	col = 28 * g_vm->_resolutionScaler;
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
+	_vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
+	col = 28 * _vm->_resolutionScaler;
+	if (_vm->_currGraphicalDevice == MODE_CGA)
 		color = 1;
 	else
 		color = 9;
@@ -195,9 +195,9 @@ void Menu::displayMenu() {
 				msk = 0x80;
 				for (pt = 0; pt <= 7; ++pt) {
 					if ((_charArr[num_letr - 1][ind_tabl] & msk) != 0) {
-						g_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
-						g_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
-						g_vm->_screenSurface.setPixel(Common::Point(x, y), color);
+						_vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
+						_vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
+						_vm->_screenSurface.setPixel(Common::Point(x, y), color);
 					}
 					msk = (uint)msk >> 1;
 					++x;
@@ -207,9 +207,9 @@ void Menu::displayMenu() {
 			} while (k != 3);
 			++y;
 		} while (y != 9);
-		col += 48 * g_vm->_resolutionScaler;
+		col += 48 * _vm->_resolutionScaler;
 	} while (num_letr != 6);
-	g_vm->_mouse.showMouse();
+	_vm->_mouse.showMouse();
 }
 
 /**
@@ -221,7 +221,7 @@ void Menu::drawMenu() {
 	_msg4 = OPCODE_NONE;
 	_msg3 = OPCODE_NONE;
 	_menuSelected = false;
-	g_vm->setMouseClick(false);
+	_vm->setMouseClick(false);
 	_multiTitle = false;
 }
 
@@ -235,7 +235,7 @@ void Menu::invert(int indx) {
 
 	int menuIndex = lo(_msg4);
 
-	g_vm->_screenSurface.putxy(_menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	_vm->_screenSurface.putxy(_menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 
 	Common::String str;
 	switch (_msg3) {
@@ -255,18 +255,18 @@ void Menu::invert(int indx) {
 		str = _discussStringArray[menuIndex];
 		break;
 	case 6:
-		str = g_vm->getEngineString(S_SAVE_LOAD + menuIndex);
+		str = _vm->getEngineString(S_SAVE_LOAD + menuIndex);
 		break;
 	case 7:
-		str = g_vm->getEngineString(S_SAVE_LOAD + 1);
+		str = _vm->getEngineString(S_SAVE_LOAD + 1);
 		str += ' ';
 		str += (char)(48 + menuIndex);
 		break;
 	case 8:
 		if (menuIndex == 1) {
-			str = g_vm->getEngineString(S_RESTART);
+			str = _vm->getEngineString(S_RESTART);
 		} else {
-			str = g_vm->getEngineString(S_SAVE_LOAD + 2);
+			str = _vm->getEngineString(S_SAVE_LOAD + 2);
 			str += ' ';
 			str += (char)(47 + menuIndex);
 		}
@@ -275,7 +275,7 @@ void Menu::invert(int indx) {
 		break;
 	}
 	if ((str[0] != '*') && (str[0] != '<'))
-		g_vm->_screenSurface.drawString(str, indx);
+		_vm->_screenSurface.drawString(str, indx);
 	else
 		_msg4 = OPCODE_NONE;
 }
@@ -284,14 +284,14 @@ void Menu::util(Common::Point pos) {
 
 	int ymx = (_menuConstants[_msg3 - 1][3] << 3) + 16;
 	int dxcar = _menuConstants[_msg3 - 1][2];
-	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * g_vm->_resolutionScaler;
+	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * _vm->_resolutionScaler;
 
 	int ix;
-	if (g_vm->_resolutionScaler == 1)
+	if (_vm->_resolutionScaler == 1)
 		ix = 5;
 	else
 		ix = 3;
-	int xmx = dxcar * ix * g_vm->_resolutionScaler + xmn + 2;
+	int xmx = dxcar * ix * _vm->_resolutionScaler + xmn + 2;
 	if ((pos.x > xmn) && (pos.x < xmx) && (pos.y < ymx) && (pos.y > 15)) {
 		ix = (((uint)pos.y >> 3) - 1) + (_msg3 << 8);
 		if (ix != _msg4) {
@@ -313,78 +313,78 @@ void Menu::menuDown(int ii) {
 	int lignNumb;
 
 	// Make a copy of the current screen surface for later restore
-	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
+	_vm->_backgroundSurface.copyFrom(_vm->_screenSurface);
 
 	// Draw the menu
 	xco = _menuConstants[ii - 1][0];
 	lignNumb = _menuConstants[ii - 1][3];
-	g_vm->_mouse.hideMouse();
-	g_vm->sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
+	_vm->_mouse.hideMouse();
+	_vm->sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
-	if (g_vm->_resolutionScaler == 1)
+	if (_vm->_resolutionScaler == 1)
 		cx = 10;
 	else
 		cx = 6;
 	xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
-	if ((ii == 4) && (g_vm->getLanguage() == Common::EN_ANY))
+	if ((ii == 4) && (_vm->getLanguage() == Common::EN_ANY))
 		// Extra width needed for Self menu in English version
 		xcc = 435;
 
-	g_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
-	g_vm->_screenSurface.putxy(xco, 16);
+	_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {
 		++cx;
 		switch (ii) {
 		case 1:
 			if (_inventoryStringArray[cx][0] != '*')
-				g_vm->_screenSurface.drawString(_inventoryStringArray[cx], 4);
+				_vm->_screenSurface.drawString(_inventoryStringArray[cx], 4);
 			break;
 		case 2:
 			if (_moveStringArray[cx][0] != '*')
-				g_vm->_screenSurface.drawString(_moveStringArray[cx], 4);
+				_vm->_screenSurface.drawString(_moveStringArray[cx], 4);
 			break;
 		case 3:
 			if (_actionStringArray[cx][0] != '*')
-				g_vm->_screenSurface.drawString(_actionStringArray[cx], 4);
+				_vm->_screenSurface.drawString(_actionStringArray[cx], 4);
 			break;
 		case 4:
 			if (_selfStringArray[cx][0] != '*')
-				g_vm->_screenSurface.drawString(_selfStringArray[cx], 4);
+				_vm->_screenSurface.drawString(_selfStringArray[cx], 4);
 			break;
 		case 5:
 			if (_discussStringArray[cx][0] != '*')
-				g_vm->_screenSurface.drawString(_discussStringArray[cx], 4);
+				_vm->_screenSurface.drawString(_discussStringArray[cx], 4);
 			break;
 		case 6:
-			g_vm->_screenSurface.drawString(g_vm->getEngineString(S_SAVE_LOAD + cx), 4);
+			_vm->_screenSurface.drawString(_vm->getEngineString(S_SAVE_LOAD + cx), 4);
 			break;
 		case 7: {
-			Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 1);
+			Common::String s = _vm->getEngineString(S_SAVE_LOAD + 1);
 			s += ' ';
 			s += (char)(48 + cx);
-			g_vm->_screenSurface.drawString(s, 4);
+			_vm->_screenSurface.drawString(s, 4);
 			}
 			break;
 		case 8:
 			if (cx == 1)
-				g_vm->_screenSurface.drawString(g_vm->getEngineString(S_RESTART), 4);
+				_vm->_screenSurface.drawString(_vm->getEngineString(S_RESTART), 4);
 			else {
-				Common::String s = g_vm->getEngineString(S_SAVE_LOAD + 2);
+				Common::String s = _vm->getEngineString(S_SAVE_LOAD + 2);
 				s += ' ';
 				s += (char)(47 + cx);
-				g_vm->_screenSurface.drawString(s, 4);
+				_vm->_screenSurface.drawString(s, 4);
 			}
 			break;
 		default:
 			break;
 		}
-		g_vm->_screenSurface.putxy(xco, g_vm->_screenSurface._textPos.y + 8);
+		_vm->_screenSurface.putxy(xco, _vm->_screenSurface._textPos.y + 8);
 	} while (cx != lignNumb);
 	_multiTitle = true;
-	g_vm->_mouse.showMouse();
+	_vm->_mouse.showMouse();
 }
 
 /**
@@ -392,14 +392,14 @@ void Menu::menuDown(int ii) {
  */
 void Menu::menuUp(int msgId) {
 	if (_multiTitle) {
-		g_vm->charecr(10, (_menuConstants[msgId - 1][1] + 1) << 1);
+		_vm->charecr(10, (_menuConstants[msgId - 1][1] + 1) << 1);
 
 		/* Restore the background area */
-		assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
+		assert(_vm->_screenSurface.pitch == _vm->_backgroundSurface.pitch);
 
 		// Get a pointer to the source and destination of the area to restore
-		const byte *pSrc = (const byte *)g_vm->_backgroundSurface.getBasePtr(0, 10);
-		Graphics::Surface destArea = g_vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
+		const byte *pSrc = (const byte *)_vm->_backgroundSurface.getBasePtr(0, 10);
+		Graphics::Surface destArea = _vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
 		byte *pDest = (byte *)destArea.getBasePtr(0, 0);
 
 		// Copy the data
@@ -414,7 +414,7 @@ void Menu::menuUp(int msgId) {
  */
 void Menu::eraseMenu() {
 	_menuActive = false;
-	g_vm->setMouseClick(false);
+	_vm->setMouseClick(false);
 	menuUp(_msg3);
 }
 
@@ -426,32 +426,32 @@ void Menu::updateMenu() {
 	if (!_menuActive)
 		return;
 
-	Common::Point curPos = g_vm->_mouse._pos;
-	if (!g_vm->getMouseClick()) {
-		if (curPos == g_vm->_prevPos)
+	Common::Point curPos = _vm->_mouse._pos;
+	if (!_vm->getMouseClick()) {
+		if (curPos == _vm->_prevPos)
 			return;
 		else
-			g_vm->_prevPos = curPos;
+			_vm->_prevPos = curPos;
 
 		bool tes =  (curPos.y < 11)
-		   && ((curPos.x >= (28 * g_vm->_resolutionScaler) && curPos.x <= (28 * g_vm->_resolutionScaler + 24))
-		   ||  (curPos.x >= (76 * g_vm->_resolutionScaler) && curPos.x <= (76 * g_vm->_resolutionScaler + 24))
-		   || ((curPos.x > 124 * g_vm->_resolutionScaler) && (curPos.x < 124 * g_vm->_resolutionScaler + 24))
-		   || ((curPos.x > 172 * g_vm->_resolutionScaler) && (curPos.x < 172 * g_vm->_resolutionScaler + 24))
-		   || ((curPos.x > 220 * g_vm->_resolutionScaler) && (curPos.x < 220 * g_vm->_resolutionScaler + 24))
-		   || ((curPos.x > 268 * g_vm->_resolutionScaler) && (curPos.x < 268 * g_vm->_resolutionScaler + 24)));
+		   && ((curPos.x >= (28 * _vm->_resolutionScaler) && curPos.x <= (28 * _vm->_resolutionScaler + 24))
+		   ||  (curPos.x >= (76 * _vm->_resolutionScaler) && curPos.x <= (76 * _vm->_resolutionScaler + 24))
+		   || ((curPos.x > 124 * _vm->_resolutionScaler) && (curPos.x < 124 * _vm->_resolutionScaler + 24))
+		   || ((curPos.x > 172 * _vm->_resolutionScaler) && (curPos.x < 172 * _vm->_resolutionScaler + 24))
+		   || ((curPos.x > 220 * _vm->_resolutionScaler) && (curPos.x < 220 * _vm->_resolutionScaler + 24))
+		   || ((curPos.x > 268 * _vm->_resolutionScaler) && (curPos.x < 268 * _vm->_resolutionScaler + 24)));
 		if (tes) {
 			int ix;
 
-			if (curPos.x < 76 * g_vm->_resolutionScaler)
+			if (curPos.x < 76 * _vm->_resolutionScaler)
 				ix = MENU_INVENTORY;
-			else if (curPos.x < 124 * g_vm->_resolutionScaler)
+			else if (curPos.x < 124 * _vm->_resolutionScaler)
 				ix = MENU_MOVE;
-			else if (curPos.x < 172 * g_vm->_resolutionScaler)
+			else if (curPos.x < 172 * _vm->_resolutionScaler)
 				ix = MENU_ACTION;
-			else if (curPos.x < 220 * g_vm->_resolutionScaler)
+			else if (curPos.x < 220 * _vm->_resolutionScaler)
 				ix = MENU_SELF;
-			else if (curPos.x < 268 * g_vm->_resolutionScaler)
+			else if (curPos.x < 268 * _vm->_resolutionScaler)
 				ix = MENU_DISCUSS;
 			else
 				ix = MENU_FILE;
@@ -470,7 +470,7 @@ void Menu::updateMenu() {
 	} else {       // There was a click
 		if ((_msg3 == MENU_FILE) && (_msg4 != OPCODE_NONE)) {
 			// Another menu to be _displayed
-			g_vm->setMouseClick(false);
+			_vm->setMouseClick(false);
 			menuUp(_msg3);
 			if (lo(_msg4) == 1)
 				_msg3 = 7;
@@ -478,22 +478,24 @@ void Menu::updateMenu() {
 				_msg3 = 8;
 			menuDown(_msg3);
 
-			g_vm->setMouseClick(false);
+			_vm->setMouseClick(false);
 		} else {
 			//  A menu was clicked on
 			_menuSelected = (_multiTitle) && (_msg4 != OPCODE_NONE);
 			menuUp(_msg3);
-			g_vm->_msg[4] = _msg4;
-			g_vm->_msg[3] = _msg3;
+			_vm->_msg[4] = _msg4;
+			_vm->_msg[3] = _msg3;
 			_msg3 = OPCODE_NONE;
 			_msg4 = OPCODE_NONE;
 
-			g_vm->setMouseClick(false);
+			_vm->setMouseClick(false);
 		}
 	}
 }
 
-void Menu::initMenu() {
+void Menu::initMenu(MortevielleEngine *vm) {
+	_vm = vm;
+
 	int i;
 	Common::File f;
 
@@ -514,18 +516,18 @@ void Menu::initMenu() {
 		_moveStringArray[i] = "*                       ";
 	i = 1;
 	do {
-		_actionStringArray[i] = g_vm->getString(i + kMenuActionStringIndex);
+		_actionStringArray[i] = _vm->getString(i + kMenuActionStringIndex);
 
 		while (_actionStringArray[i].size() < 10)
 			_actionStringArray[i] += ' ';
 
 		if (i < 9) {
 			if (i < 6) {
-				_selfStringArray[i] = g_vm->getString(i + kMenuSelfStringIndex);
+				_selfStringArray[i] = _vm->getString(i + kMenuSelfStringIndex);
 				while (_selfStringArray[i].size() < 10)
 					_selfStringArray[i] += ' ';
 			}
-			_discussStringArray[i] = g_vm->getString(i + kMenuSayStringIndex) + ' ';
+			_discussStringArray[i] = _vm->getString(i + kMenuSayStringIndex) + ' ';
 		}
 		++i;
 	} while (i != 22);
@@ -539,9 +541,9 @@ void Menu::initMenu() {
 	}
 	_msg3 = OPCODE_NONE;
 	_msg4 = OPCODE_NONE;
-	g_vm->_msg[3] = OPCODE_NONE;
-	g_vm->_msg[4] = OPCODE_NONE;
-	g_vm->setMouseClick(false);
+	_vm->_msg[3] = OPCODE_NONE;
+	_vm->_msg[4] = OPCODE_NONE;
+	_vm->setMouseClick(false);
 }
 
 /**
@@ -555,8 +557,8 @@ void Menu::setSearchMenu() {
 	for (int i = 1; i <= 11; ++i)
 		disableMenuItem(_actionMenu[i]);
 
-	setText(OPCODE_SOUND, g_vm->getEngineString(S_SUITE));
-	setText(OPCODE_LIFT, g_vm->getEngineString(S_STOP));
+	setText(OPCODE_SOUND, _vm->getEngineString(S_SUITE));
+	setText(OPCODE_LIFT, _vm->getEngineString(S_STOP));
 }
 
 /**
@@ -564,12 +566,12 @@ void Menu::setSearchMenu() {
  * @remarks	Originally called 'mfouen'
  */
 void Menu::unsetSearchMenu() {
-	setDestinationText(g_vm->_coreVar._currPlace);
+	setDestinationText(_vm->_coreVar._currPlace);
 	for (int i = 1; i <= 11; ++i)
 		enableMenuItem(_actionMenu[i]);
 
-	setText(OPCODE_SOUND, g_vm->getEngineString(S_PROBE));
-	setText(OPCODE_LIFT, g_vm->getEngineString(S_RAISE));
+	setText(OPCODE_SOUND, _vm->getEngineString(S_PROBE));
+	setText(OPCODE_LIFT, _vm->getEngineString(S_RAISE));
 }
 
 /**
@@ -581,10 +583,10 @@ void Menu::setInventoryText() {
 
 	int cy = 0;
 	for (int i = 1; i <= 6; ++i) {
-		if (g_vm->_coreVar._inventory[i] != 0) {
+		if (_vm->_coreVar._inventory[i] != 0) {
 			++cy;
-			int r = g_vm->_coreVar._inventory[i] + 400;
-			nomp = g_vm->getString(r - 501 + kInventoryStringIndex);
+			int r = _vm->_coreVar._inventory[i] + 400;
+			nomp = _vm->getString(r - 501 + kInventoryStringIndex);
 			setText(_inventoryMenu[cy], nomp);
 			enableMenuItem(_inventoryMenu[i]);
 		}
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 712242e..61430bf 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -32,6 +32,7 @@
 #include "common/str.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 enum {
 	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SELF = 4,
@@ -40,6 +41,8 @@ enum {
 
 class Menu {
 private:
+	MortevielleEngine *_vm;
+
 	byte _charArr[7][24];
 	int _msg3;
 	int _msg4;
@@ -71,7 +74,7 @@ public:
 	void menuUp(int msgId);
 	void eraseMenu();
 	void updateMenu();
-	void initMenu();
+	void initMenu(MortevielleEngine *vm);
 
 	void setSearchMenu();
 	void unsetSearchMenu();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index b013f87..86e7a12 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -602,7 +602,7 @@ void MortevielleEngine::mainGame() {
 		decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
 
 	loadBRUIT5();
-	_menu.initMenu();
+	_menu.initMenu(this);
 
 	charToHour();
 	initGame();


Commit: 861af32fffa7adf128656fa6aa30e8e67178cfa2
    https://github.com/scummvm/scummvm/commit/861af32fffa7adf128656fa6aa30e8e67178cfa2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T11:40:06-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in ScreenSurface

Changed paths:
    engines/mortevielle/debugger.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/graphics.h
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index b0b9dc7..9c24954 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -46,6 +46,7 @@ bool Debugger::Cmd_resetParano(int argc, const char **argv) {
 
 	return true;
 }
+
 void Debugger::setParent(MortevielleEngine *vm) {
 	_vm = vm;
 }
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 5bf3aed..39a38c2 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -917,7 +917,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &g_vm->_mem[0x7000 * 16 + 2];
+	const byte *paletteMap = &_vm->_mem[0x7000 * 16 + 2];
 
 	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
@@ -996,7 +996,7 @@ void ScreenSurface::writeCharacter(const Common::Point &pt, unsigned char ch, in
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
 void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
-	if (g_vm->_resolutionScaler == 1) {
+	if (_vm->_resolutionScaler == 1) {
 		x = (uint)x >> 1;
 		dx = (uint)dx >> 1;
 	}
@@ -1060,10 +1060,10 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	if (l == "")
 		return;
 
-	g_vm->_mouse.hideMouse();
+	_vm->_mouse.hideMouse();
 	pt = _textPos;
 
-	if (g_vm->_resolutionScaler == 2)
+	if (_vm->_resolutionScaler == 2)
 		i = 6;
 	else
 		i = 10;
@@ -1073,7 +1073,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	case 1:
 	case 3: {
 		cecr = 0;
-		g_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 		}
 		break;
 	case 4:
@@ -1085,7 +1085,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	case 0:
 	case 2: {
 		cecr = 15;
-		g_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 		}
 		break;
 	default:
@@ -1095,17 +1095,17 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	pt.x += 1;
 	pt.y += 1;
 	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
-		g_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
+		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
 		pt.x += i;
 	}
-	g_vm->_mouse.showMouse();
+	_vm->_mouse.showMouse();
 }
 
 /**
  * Gets the width in pixels of the specified string
  */
 int ScreenSurface::getStringWidth(const Common::String &s) {
-	int charWidth = (g_vm->_resolutionScaler == 2) ? 6 : 10;
+	int charWidth = (_vm->_resolutionScaler == 2) ? 6 : 10;
 
 	return s.size() * charWidth;
 }
@@ -1129,7 +1129,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 		else
 			step = 1;
 		do {
-			g_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
+			_vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
 			i += step;
 		} while (i != yy);
 	} else {
@@ -1141,7 +1141,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 		else
 			step = 1;
 		do {
-			g_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
+			_vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
 			i = i + step;
 		} while (i != xx);
 	}
@@ -1154,11 +1154,15 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
 void ScreenSurface::drawRectangle(int x, int y, int dx, int dy) {
 	int co;
 
-	if (g_vm->_currGraphicalDevice == MODE_CGA)
+	if (_vm->_currGraphicalDevice == MODE_CGA)
 		co = 3;
 	else
 		co = 11;
-	g_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
+	_vm->_screenSurface.fillRect(co, Common::Rect(x, y, x + dx, y + dy));
+}
+
+void ScreenSurface::setParent(MortevielleEngine *vm) {
+	_vm = vm;
 }
 
 
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 7bf39c3..026950e 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -34,10 +34,13 @@
 #include "graphics/surface.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 class PaletteManager {
-public:
+private:
 	void setPalette(const int *palette, uint idx, uint size);
+
+public:
 	void setDefaultPalette();
 };
 
@@ -74,7 +77,7 @@ public:
 	Common::Point _offset;
 	// Transparency palette index
 	int _transparency;
-public:
+
 	~GfxSurface();
 
 	void decode(const byte *pSrc);
@@ -82,11 +85,13 @@ public:
 
 class ScreenSurface: public Graphics::Surface {
 private:
+	MortevielleEngine *_vm;
+
 	Common::List<Common::Rect> _dirtyRects;
 	byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
+
 public:
 	Common::Point _textPos;		// Original called xwhere/ywhere
-public:
 	void readFontData(Common::File &f, int dataSize);
 	Graphics::Surface lockArea(const Common::Rect &bounds);
 	void updateScreen();
@@ -101,6 +106,7 @@ public:
 	int  getStringWidth(const Common::String &s);
 	void drawLine(int x, int y, int xx, int yy, int coul);
 	void drawRectangle(int x, int y, int dx, int dy);
+	void setParent(MortevielleEngine *vm);
 
 	// TODO: Refactor code to remove this method, for increased performance
 	void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 86e7a12..b651f43 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -75,6 +75,8 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 		_soundManager(_mixer) {
 	g_vm = this;
 	_debugger.setParent(this);
+	_screenSurface.setParent(this);
+
 	_lastGameFrame = 0;
 	_mouseClick = false;
 	_inMainGameLoop = false;


Commit: 418890e85978306cec8994ece7f0a8029d0c90e9
    https://github.com/scummvm/scummvm/commit/418890e85978306cec8994ece7f0a8029d0c90e9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T12:01:49-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in MouseHandler

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/mouse.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index b651f43..7834366 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -76,6 +76,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	g_vm = this;
 	_debugger.setParent(this);
 	_screenSurface.setParent(this);
+	_mouse.setParent(this);
 
 	_lastGameFrame = 0;
 	_mouseClick = false;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index a6105d8..4d3d8bb 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -40,7 +40,7 @@ void MouseHandler::initMouse() {
 	_counter = 0;
 	_pos = Common::Point(0, 0);
 
-	g_vm->setMouseClick(false);
+	_vm->setMouseClick(false);
 }
 
 /**
@@ -51,15 +51,15 @@ void MouseHandler::hideMouse() {
 	--_counter;
 	if (_counter == 0) {
 		int j = 0;
-		switch (g_vm->_currGraphicalDevice) {
+		switch (_vm->_currGraphicalDevice) {
 		case MODE_CGA: {
 			int k = 0;
 			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 			do {
-				WRITE_LE_UINT16(&g_vm->_mem[0xb000 * 16 + j], s_s[0][k]);
-				WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j + 2], s_s[1][k]);
-				WRITE_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j], s_s[2][k]);
-				WRITE_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j + 2], s_s[3][k]);
+				WRITE_LE_UINT16(&_vm->_mem[0xb000 * 16 + j], s_s[0][k]);
+				WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j + 2], s_s[1][k]);
+				WRITE_LE_UINT16(&_vm->_mem[0xba00 * 16 + j], s_s[2][k]);
+				WRITE_LE_UINT16(&_vm->_mem[0xba00 * 16 + j + 2], s_s[3][k]);
 				j += 80;
 				++k;
 			} while (k < 5);
@@ -72,10 +72,10 @@ void MouseHandler::hideMouse() {
 				j = 0;
 				do {
 					if (imp) {
-						WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 80 - 0x2000;
 					} else {
-						WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
+						WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
 						j += 0x2000;
 					}
 					imp = !imp;
@@ -92,11 +92,11 @@ void MouseHandler::hideMouse() {
 				do {
 					// Useless ?
 					// ps = mem[0xa000 * 16 + j];
-					g_vm->_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
+					_vm->_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
 
 					// Useless ??
 					// ps = mem[0xa000 * 16 + j + 1];
-					g_vm->_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
+					_vm->_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
 					j += 80;
 					++k;
 				} while (k < 8);
@@ -108,7 +108,7 @@ void MouseHandler::hideMouse() {
 			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 			for (int i = 0; i <= 5; ++i) {
 				for (int k = 0; k <= 3; ++k)
-					WRITE_LE_UINT16(&g_vm->_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
+					WRITE_LE_UINT16(&_vm->_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
 				j += 80;
 			}
 			break;
@@ -117,8 +117,8 @@ void MouseHandler::hideMouse() {
 			int k = 0;
 			do {
 				for (int i = 0; i <= 3; ++i) {
-					WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
-					WRITE_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
+					WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
+					WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
 				}
 				j += 160;
 				++k;
@@ -143,15 +143,15 @@ void MouseHandler::showMouse() {
 		return;
 	int j = 0;
 	int i = _pos.x & 7;
-	switch (g_vm->_currGraphicalDevice) {
+	switch (_vm->_currGraphicalDevice) {
 	case MODE_CGA:
 		k = 0;
 		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
 		do {
-			s_s[0][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
-			s_s[1][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j + 2]);
-			s_s[2][k] = READ_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j]);
-			s_s[3][k] = READ_LE_UINT16(&g_vm->_mem[0xba00 * 16 + j + 2]);
+			s_s[0][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
+			s_s[1][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j + 2]);
+			s_s[2][k] = READ_LE_UINT16(&_vm->_mem[0xba00 * 16 + j]);
+			s_s[3][k] = READ_LE_UINT16(&_vm->_mem[0xba00 * 16 + j + 2]);
 			j += 80;
 			++k;
 		} while (k < 5);
@@ -164,10 +164,10 @@ void MouseHandler::showMouse() {
 			k = 0;
 			do {
 				if (imp) {
-					s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
 					j += 80 - 0x2000;
 				} else {
-					s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + j]);
+					s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
 					j += 0x2000;
 				}
 				imp = !imp;
@@ -182,7 +182,7 @@ void MouseHandler::showMouse() {
 			k = 0;
 			j = 0;
 			do {
-				s_s[l][k] = g_vm->_mem[0xa000 * 16 + j] + (g_vm->_mem[(0xa000 * 16) + j + 1] << 8);
+				s_s[l][k] = _vm->_mem[0xa000 * 16 + j] + (_vm->_mem[(0xa000 * 16) + j + 1] << 8);
 				j += 80;
 				++k;
 			} while (k < 8);
@@ -193,7 +193,7 @@ void MouseHandler::showMouse() {
 		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
 		for (i = 0; i <= 5; ++i) {
 			for (k = 0; k <= 3; ++k)
-				s_s[i][k] = READ_LE_UINT16(&g_vm->_mem[0xb000 * 16 + k * 0x200 + j]);
+				s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb000 * 16 + k * 0x200 + j]);
 			j += 80;
 		}
 		break;
@@ -202,8 +202,8 @@ void MouseHandler::showMouse() {
 		k = 0;
 		do {
 			for (i = 0; i <= 3; ++i) {
-				s_s[k][i + (k << 2)] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j]);
-				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&g_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2]);
+				s_s[k][i + (k << 2)] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j]);
+				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2]);
 			}
 			j += 160;
 			++k;
@@ -219,8 +219,8 @@ void MouseHandler::showMouse() {
  * @remarks	Originally called 'pos_mouse'
  */
 void MouseHandler::setMousePosition(Common::Point newPos) {
-	if (newPos.x > 314 * g_vm->_resolutionScaler)
-		newPos.x = 314 * g_vm->_resolutionScaler;
+	if (newPos.x > 314 * _vm->_resolutionScaler)
+		newPos.x = 314 * _vm->_resolutionScaler;
 	else if (newPos.x < 0)
 		newPos.x = 0;
 	if (newPos.y > 199)
@@ -231,7 +231,7 @@ void MouseHandler::setMousePosition(Common::Point newPos) {
 		return;
 
 	// Set the new position
-	g_vm->setMousePos(newPos);
+	_vm->setMousePos(newPos);
 }
 
 /**
@@ -239,9 +239,9 @@ void MouseHandler::setMousePosition(Common::Point newPos) {
  * @remarks	Originally called 'read_pos_mouse'
  */
 void MouseHandler::getMousePosition(int &x, int &y, bool &click) {
-	x = g_vm->getMousePos().x;
-	y = g_vm->getMousePos().y;
-	click = g_vm->getMouseClick();
+	x = _vm->getMousePos().x;
+	y = _vm->getMousePos().y;
+	click = _vm->getMouseClick();
 }
 
 /**
@@ -257,18 +257,18 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 	// Set defaults and check pending events
 	funct = false;
 	key = '\377';
-	p_key = g_vm->keyPressed();
+	p_key = _vm->keyPressed();
 
 	// If mouse button clicked, return it
-	if (g_vm->getMouseClick())
+	if (_vm->getMouseClick())
 		return;
 
 	// Handle any pending keypresses
 	while (p_key) {
-		if (g_vm->shouldQuit())
+		if (_vm->shouldQuit())
 			return;
 
-		in1 = g_vm->getChar();
+		in1 = _vm->getChar();
 		getMousePosition(cx, cy, click);
 		switch (toupper(in1)) {
 		case '4':
@@ -292,27 +292,27 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			cy = 190;
 			break;
 		case '9':
-			cx = 315 * g_vm->_resolutionScaler;
+			cx = 315 * _vm->_resolutionScaler;
 			cy = 1;
 			break;
 		case '3':
 			cy = 190;
-			cx = 315 * g_vm->_resolutionScaler;
+			cx = 315 * _vm->_resolutionScaler;
 			break;
 		case '5':
 			cy = 100;
-			cx = 155 * g_vm->_resolutionScaler;
+			cx = 155 * _vm->_resolutionScaler;
 			break;
 		case ' ':
 		case '\15':
-			g_vm->setMouseClick(true);
+			_vm->setMouseClick(true);
 			return;
 			break;
 		case '\33':
-			p_key = g_vm->keyPressed();
+			p_key = _vm->keyPressed();
 
 			if (p_key) {
-				in2 = g_vm->getChar();
+				in2 = _vm->getChar();
 
 				if ((in2 >= ';') && (in2 <= 'D')) {
 					funct = true;
@@ -355,31 +355,31 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 			}
 			break;
 		case 'I':
-			cx = g_vm->_resolutionScaler * 32;
+			cx = _vm->_resolutionScaler * 32;
 			cy = 8;
 			break;
 		case 'D':
-			cx = 80 * g_vm->_resolutionScaler;
+			cx = 80 * _vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'A':
-			cx = 126 * g_vm->_resolutionScaler;
+			cx = 126 * _vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'S':
-			cx = 174 * g_vm->_resolutionScaler;
+			cx = 174 * _vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'P':
-			cx = 222 * g_vm->_resolutionScaler;
+			cx = 222 * _vm->_resolutionScaler;
 			cy = 8;
 			break;
 		case 'F':
-			cx = g_vm->_resolutionScaler * 270;
+			cx = _vm->_resolutionScaler * 270;
 			cy = 8;
 			break;
 		case '\23':
-			g_vm->_soundOff = !g_vm->_soundOff;
+			_vm->_soundOff = !_vm->_soundOff;
 			return;
 			break;
 		case '\24':           // ^T => mode tandy
@@ -401,7 +401,7 @@ void MouseHandler::moveMouse(bool &funct, char &key) {
 		}
 
 		setMousePosition(Common::Point(cx, cy));
-		p_key = g_vm->keyPressed();
+		p_key = _vm->keyPressed();
 	}
 }
 
@@ -420,4 +420,8 @@ bool MouseHandler::isMouseIn(Common::Rect r) {
 	return false;
 }
 
+void MouseHandler::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 58e3fc7..1b9856e 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -31,14 +31,18 @@
 #include "common/rect.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 class MouseHandler {
 private:
+	MortevielleEngine *_vm;
+
 	int s_s[12][6];
 	int _counter;
 public:
 	Common::Point _pos;
 
+	void setParent(MortevielleEngine *vm);
 	void initMouse();
 	void hideMouse();
 	void showMouse();


Commit: 2811607dd7c1c2d6372688b386d083d491062c51
    https://github.com/scummvm/scummvm/commit/2811607dd7c1c2d6372688b386d083d491062c51
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T12:49:30-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in TextHandler

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7834366..104a340 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -77,6 +77,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_debugger.setParent(this);
 	_screenSurface.setParent(this);
 	_mouse.setParent(this);
+	_text.setParent(this);
 
 	_lastGameFrame = 0;
 	_mouseClick = false;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 4bdfcb4..7778eb3 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -59,8 +59,8 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
 	// Safeguard: add $ just in case
 	inputStr += '$';
 
-	g_vm->_screenSurface.putxy(x, y);
-	if (g_vm->_resolutionScaler == 1)
+	_vm->_screenSurface.putxy(x, y);
+	if (_vm->_resolutionScaler == 1)
 		tab = 10;
 	else
 		tab = 6;
@@ -76,43 +76,43 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
 	while (!stringParsed) {
 		switch (inputStr[p]) {
 		case '@':
-			g_vm->_screenSurface.drawString(s, typ);
+			_vm->_screenSurface.drawString(s, typ);
 			s = "";
 			++p;
 			xc = x;
 			yc += 6;
-			g_vm->_screenSurface.putxy(xc, yc);
+			_vm->_screenSurface.putxy(xc, yc);
 			break;
 		case ' ':
 			s += ' ';
 			xc += tab;
 			++p;
 			if (nextWord(p, inputStr.c_str(), tab) + xc > xf) {
-				g_vm->_screenSurface.drawString(s, typ);
+				_vm->_screenSurface.drawString(s, typ);
 				s = "";
 				xc = x;
 				yc += 6;
 				if (yc > yf) {
-					while (!g_vm->keyPressed())
+					while (!_vm->keyPressed())
 						;
 					i = y;
 					do {
 						j = x;
 						do {
-							g_vm->_screenSurface.putxy(j, i);
-							g_vm->_screenSurface.drawString(" ", 0);
+							_vm->_screenSurface.putxy(j, i);
+							_vm->_screenSurface.drawString(" ", 0);
 							j += 6;
 						} while (j <= xf);
 						i += 6;
 					} while (i <= yf);
 					yc = y;
 				}
-				g_vm->_screenSurface.putxy(xc, yc);
+				_vm->_screenSurface.putxy(xc, yc);
 			}
 			break;
 		case '$':
 			stringParsed = true;
-			g_vm->_screenSurface.drawString(s, typ);
+			_vm->_screenSurface.drawString(s, typ);
 			break;
 		default:
 			s += inputStr[p];
@@ -144,14 +144,14 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	int totalLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (totalLength > 0) {
-		f.read(&g_vm->_mem[memIndx], 128);
+		f.read(&_vm->_mem[memIndx], 128);
 		totalLength -= 128;
 		memIndx += 128;
 	}
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		g_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
+		_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
 }
 
 /**
@@ -175,14 +175,14 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 	int fullLength = length + remainingSkipSize;
 	int memIndx = 0x6000 * 16;
 	while (fullLength > 0) {
-		f.read(&g_vm->_mem[memIndx], 128);
+		f.read(&_vm->_mem[memIndx], 128);
 		fullLength -= 128;
 		memIndx += 128;
 	}
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		g_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = g_vm->_mem[0x6000 * 16 + i];
+		_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
 }
 
 void TextHandler::taffich() {
@@ -195,60 +195,60 @@ void TextHandler::taffich() {
 	int32 lgt;
 	int alllum[16];
 
-	int a = g_vm->_caff;
+	int a = _vm->_caff;
 	if ((a >= 153) && (a <= 161))
 		a = tran2[a - 153];
 	else if ((a >= 136) && (a <= 140))
 		a = tran1[a - 136];
 	int b = a;
-	if (g_vm->_maff == a)
+	if (_vm->_maff == a)
 		return;
 
 	switch (a) {
 	case 16:
-		g_vm->_coreVar._pctHintFound[9] = '*';
-		g_vm->_coreVar._availableQuestion[42] = '*';
+		_vm->_coreVar._pctHintFound[9] = '*';
+		_vm->_coreVar._availableQuestion[42] = '*';
 		break;
 	case 20:
-		g_vm->_coreVar._availableQuestion[39] = '*';
-		if (g_vm->_coreVar._availableQuestion[36] == '*') {
-			g_vm->_coreVar._pctHintFound[3] = '*';
-			g_vm->_coreVar._availableQuestion[38] = '*';
+		_vm->_coreVar._availableQuestion[39] = '*';
+		if (_vm->_coreVar._availableQuestion[36] == '*') {
+			_vm->_coreVar._pctHintFound[3] = '*';
+			_vm->_coreVar._availableQuestion[38] = '*';
 		}
 		break;
 	case 24:
-		g_vm->_coreVar._availableQuestion[37] = '*';
+		_vm->_coreVar._availableQuestion[37] = '*';
 		break;
 	case 30:
-		g_vm->_coreVar._availableQuestion[9] = '*';
+		_vm->_coreVar._availableQuestion[9] = '*';
 		break;
 	case 31: // Coat of arms
-		g_vm->_coreVar._pctHintFound[4] = '*';
-		g_vm->_coreVar._availableQuestion[35] = '*';
+		_vm->_coreVar._pctHintFound[4] = '*';
+		_vm->_coreVar._availableQuestion[35] = '*';
 		break;
 	case 118:
-		g_vm->_coreVar._availableQuestion[41] = '*';
+		_vm->_coreVar._availableQuestion[41] = '*';
 		break;
 	case 143:
-		g_vm->_coreVar._pctHintFound[1] = '*';
+		_vm->_coreVar._pctHintFound[1] = '*';
 		break;
 	case 150:
-		g_vm->_coreVar._availableQuestion[34] = '*';
+		_vm->_coreVar._availableQuestion[34] = '*';
 		break;
 	case 151:
-		g_vm->_coreVar._pctHintFound[2] = '*';
+		_vm->_coreVar._pctHintFound[2] = '*';
 		break;
 	default:
 		break;
 	}
 
-	g_vm->_destinationOk = true;
-	g_vm->_mouse.hideMouse();
+	_vm->_destinationOk = true;
+	_vm->_mouse.hideMouse();
 	lgt = 0;
 	Common::String filename;
 
 	if ((a != 50) && (a != 51)) {
-		g_vm->_maff = a;
+		_vm->_maff = a;
 		if (a == 159)
 			a = 86;
 		else if (a > 140)
@@ -268,28 +268,28 @@ void TextHandler::taffich() {
 		npal = a;
 
 		for (cx = 0; cx <= (a - 1); ++cx)
-			lgt += g_vm->_fxxBuffer[cx];
-		handle = g_vm->_fxxBuffer[a];
+			lgt += _vm->_fxxBuffer[cx];
+		handle = _vm->_fxxBuffer[a];
 
 		filename = "DXX.mor";
 	} else {
-		if (g_vm->getLanguage() == Common::DE_DEU)
+		if (_vm->getLanguage() == Common::DE_DEU)
 			filename = "DZZALL";
 		else
 			filename = "DZZ.mor";
 
-		handle = g_vm->_fxxBuffer[87];
+		handle = _vm->_fxxBuffer[87];
 		if (a == 51) {
 			lgt = handle;
-			handle = g_vm->_fxxBuffer[88];
+			handle = _vm->_fxxBuffer[88];
 		}
-		g_vm->_maff = a;
+		_vm->_maff = a;
 		npal = a + 37;
 	}
 	loadDesFile(filename, lgt, handle);
-	if (g_vm->_currGraphicalDevice == MODE_HERCULES) {
+	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&g_vm->_mem[(0x7000 * 16) + ((i + 1) << 1)]);
+			int palh = READ_LE_UINT16(&_vm->_mem[(0x7000 * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -297,12 +297,12 @@ void TextHandler::taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			g_vm->_mem[(0x7000 * 16) + 2 + (k << 1)] = _rang[i];
+			_vm->_mem[(0x7000 * 16) + 2 + (k << 1)] = _rang[i];
 			alllum[k] = -1;
 		}
 	}
-	g_vm->_numpal = npal;
-	g_vm->setPal(npal);
+	_vm->_numpal = npal;
+	_vm->setPal(npal);
 
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
 		lgt = 0;
@@ -314,8 +314,8 @@ void TextHandler::taffich() {
 			else if (b > 15)
 				--b;
 			for (cx = 0; cx <= (b - 1); ++cx)
-				lgt += g_vm->_fxxBuffer[cx + 89];
-			handle = g_vm->_fxxBuffer[b + 89];
+				lgt += _vm->_fxxBuffer[cx + 89];
+			handle = _vm->_fxxBuffer[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
 			filename = "AZZ.mor";
@@ -323,14 +323,18 @@ void TextHandler::taffich() {
 		}
 		loadAniFile(filename, lgt, handle);
 	}
-	g_vm->_mouse.showMouse();
-	if ((a < 27) && ((g_vm->_maff < 27) || (g_vm->_coreVar._currPlace == LANDING)) && (g_vm->_msg[4] != OPCODE_ENTER)) {
+	_vm->_mouse.showMouse();
+	if ((a < 27) && ((_vm->_maff < 27) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_msg[4] != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
-			g_vm->displayAloneText();
-		else if (!g_vm->_blo)
-			g_vm->getPresence(g_vm->_coreVar._currPlace);
-		g_vm->_savedBitIndex =  0;
+			_vm->displayAloneText();
+		else if (!_vm->_blo)
+			_vm->getPresence(_vm->_coreVar._currPlace);
+		_vm->_savedBitIndex =  0;
 	}
 }
 
+void TextHandler::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
+
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 2516298..a4b0786 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -31,13 +31,16 @@
 #include "common/str.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 const int kAdrAni = 0x7314;
 
 class TextHandler {
 private:
+	MortevielleEngine *_vm;
 	int  nextWord(int p, const char *ch, int &tab);
 public:
+	void setParent(MortevielleEngine *vm);
 	void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
 	void loadDesFile(Common::String filename, int32 passe, int long_);
 	void loadAniFile(Common::String filename, int32 skipSize, int length);


Commit: 266c8cb08cf6acd21bb472dedc6b5bcaf5da1b0d
    https://github.com/scummvm/scummvm/commit/266c8cb08cf6acd21bb472dedc6b5bcaf5da1b0d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T16:06:22-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in SoundManager

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 104a340..54bd030 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -78,6 +78,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_screenSurface.setParent(this);
 	_mouse.setParent(this);
 	_text.setParent(this);
+	_soundManager.setParent(this);
 
 	_lastGameFrame = 0;
 	_mouseClick = false;
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index bb85221..478af41 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -192,10 +192,13 @@ void SoundManager::musyc(tablint &tb, int nbseg, int att) {
 	}
 
 	// Keep waiting until the song has been finished
-	while (_speakerStream->isPlaying() && !g_vm->shouldQuit()) {
-		g_vm->delay(10);
+	while (_speakerStream->isPlaying() && !_vm->shouldQuit()) {
+		_vm->delay(10);
 	}
 #endif
 }
 
+void SoundManager::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index 675fc78..a47e8db 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -34,6 +34,7 @@
 #include "common/queue.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 typedef int tablint[256];
 
@@ -93,6 +94,7 @@ public:
 
 class SoundManager {
 private:
+	MortevielleEngine *_vm;
 	Audio::Mixer *_mixer;
 	PCSpeaker *_speakerStream;
 	Audio::SoundHandle _speakerHandle;
@@ -100,6 +102,7 @@ public:
 	SoundManager(Audio::Mixer *mixer);
 	~SoundManager();
 
+	void setParent(MortevielleEngine *vm);
 	void playNote(int frequency, int32 length);
 
 	void decodeMusic(const byte *PSrc, byte *PDest, int NbreSeg);


Commit: 2e40ebae6f5b5c8b72ecf6427c42c9ed8bb86564
    https://github.com/scummvm/scummvm/commit/2e40ebae6f5b5c8b72ecf6427c42c9ed8bb86564
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T22:42:49-07:00

Commit Message:
MORTEVIELLE: Replace g_vm in SpeechManager

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 54bd030..61992526 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -79,6 +79,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_mouse.setParent(this);
 	_text.setParent(this);
 	_soundManager.setParent(this);
+	_speechManager.setParent(this);
 
 	_lastGameFrame = 0;
 	_mouseClick = false;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 853d6ba..1fe130a 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -81,7 +81,7 @@ void SpeechManager::spfrac(int wor) {
 }
 
 void SpeechManager::charg_car(int &currWordNumb) {
-	int wor = swap(READ_LE_UINT16(&g_vm->_mem[kAdrWord + currWordNumb]));
+	int wor = swap(READ_LE_UINT16(&_vm->_mem[kAdrWord + currWordNumb]));
 	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -121,7 +121,7 @@ void SpeechManager::charg_car(int &currWordNumb) {
 
 
 void SpeechManager::entroct(byte o) {
-	g_vm->_mem[kAdrTroct * 16 + _ptr_oct] = o;
+	_vm->_mem[kAdrTroct * 16 + _ptr_oct] = o;
 	++_ptr_oct;
 }
 
@@ -134,7 +134,7 @@ void SpeechManager::cctable(tablint &t) {
 
 	tb[0] = 0;
 	for (int k = 0; k <= 255; ++k) {
-		tb[k + 1] = g_vm->_addFix + tb[k];
+		tb[k + 1] = _vm->_addFix + tb[k];
 		t[255 - k] = abs((int)tb[k] + 1);
 	}
 }
@@ -143,7 +143,7 @@ void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		_cfiphBuffer[j] = READ_LE_UINT16(&g_vm->_mem[kAdrNoise3 + i]);
+		_cfiphBuffer[j] = READ_LE_UINT16(&_vm->_mem[kAdrNoise3 + i]);
 		i += 2;
 		++j;
 	} while (i < kOffsetB3 + 8790);
@@ -159,9 +159,9 @@ void SpeechManager::loadMusicSound() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 
-	f.read(&g_vm->_mem[0x7414 * 16 + 0], 273);
+	f.read(&_vm->_mem[0x7414 * 16 + 0], 273);
 
-	g_vm->_soundManager.decodeMusic(&g_vm->_mem[0x7414 * 16], &g_vm->_mem[kAdrNoise * 16], 273);
+	_vm->_soundManager.decodeMusic(&_vm->_mem[0x7414 * 16], &_vm->_mem[kAdrNoise * 16], 273);
 	f.close();
 }
 
@@ -192,10 +192,10 @@ void SpeechManager::loadNoise() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&g_vm->_mem[kAdrNoise * 16 + 0], 250);
+	f.read(&_vm->_mem[kAdrNoise * 16 + 0], 250);
 	for (i = 0; i <= 19013; ++i)
-		g_vm->_mem[kAdrNoise * 16 + 32000 + i] = g_vm->_mem[kAdrNoise5 + i];
-	f.read(&g_vm->_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
+		_vm->_mem[kAdrNoise * 16 + 32000 + i] = _vm->_mem[kAdrNoise5 + i];
+	f.read(&_vm->_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
 
 	f.close();
 }
@@ -531,7 +531,7 @@ void SpeechManager::handlePhoneme() {
 	int endPos = swap(_cfiphBuffer[_phonemeNumb]) + deca[_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&g_vm->_mem[kAdrWord + currWord], _cfiphBuffer[i]);
+		WRITE_LE_UINT16(&_vm->_mem[kAdrWord + currWord], _cfiphBuffer[i]);
 
 	_ptr_oct = 0;
 	int currWord = 0;
@@ -556,7 +556,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	int savph[501];
 	int tempo;
 
-	if (g_vm->_soundOff)
+	if (_vm->_soundOff)
 		return;
 
 	_phonemeNumb = rep;
@@ -570,7 +570,7 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		tempo = kTempoF;
 	else
 		tempo = kTempoM;
-	g_vm->_addFix = (float)((tempo - 8)) / 256;
+	_vm->_addFix = (float)((tempo - 8)) / 256;
 	cctable(_tbi);
 	switch (typ) {
 	case 1:
@@ -586,13 +586,16 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 		break;
 	}
 	handlePhoneme();
-	g_vm->_soundManager.litph(_tbi, typ, tempo);
+	_vm->_soundManager.litph(_tbi, typ, tempo);
 	if (_typlec != 0)
 		for (int i = 0; i <= 500; ++i) {
 			_cfiphBuffer[i] = savph[i];
 			_mlec = _typlec;
 		}
-	g_vm->setPal(g_vm->_numpal);
+	_vm->setPal(_vm->_numpal);
 }
 
+void SpeechManager::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index c27f2bf..4f98c4c 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -66,6 +66,8 @@ struct SpeechQueue {
 
 class SpeechManager {
 private:
+	MortevielleEngine *_vm;
+
 	int _typlec;
 	int _phonemeNumb;
 
@@ -78,6 +80,7 @@ public:
 	int _mlec;
 
 	SpeechManager();
+	void setParent(MortevielleEngine *vm);
 	void spfrac(int wor);
 	void charg_car(int &currWordNumb);
 	void entroct(byte o);


Commit: de4874412ce1015adcb71745d39df6610a7abe94
    https://github.com/scummvm/scummvm/commit/de4874412ce1015adcb71745d39df6610a7abe94
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T22:51:11-07:00

Commit Message:
MORTEVIELLE: Remove some useless g_vm

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 47ffb2e..3a27c27 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1408,7 +1408,7 @@ void MortevielleEngine::fctDiscuss() {
 		do {
 			bool dummyFl;
 			_mouse.moveMouse(dummyFl, retKey);
-			if (g_vm->shouldQuit())
+			if (shouldQuit())
 				return;
 
 			_mouse.getMousePosition(x, y, click);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 61992526..c6cafac 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -582,12 +582,12 @@ void MortevielleEngine::showIntroduction() {
 	f3f8::aff50(false);
 	_speechManager._mlec = 0;
 	f3f8::checkForF8(142, false);
-	if (g_vm->shouldQuit())
+	if (shouldQuit())
 		return;
 
 	f3f8::ani50();
 	f3f8::checkForF8(143, true);
-	if (g_vm->shouldQuit())
+	if (shouldQuit())
 		return;
 
 	// TODO: Once music (Amiga/Atari ports) is implemented, only use the below delay if music is turned off
@@ -619,7 +619,7 @@ void MortevielleEngine::mainGame() {
 	// Loop to play the game
 	do {
 		playGame();
-		if (g_vm->shouldQuit())
+		if (shouldQuit())
 			return;
 	} while (!_quitGame);
 }
@@ -634,7 +634,7 @@ void MortevielleEngine::playGame() {
 	// Loop handling actions until the game has to be quit, or show the lose or end sequence
 	do {
 		handleAction();
-		if (g_vm->shouldQuit())
+		if (shouldQuit())
 			return;
 	} while (!((_quitGame) || (_endGame) || (_loseGame)));
 
@@ -670,7 +670,7 @@ void MortevielleEngine::handleAction() {
 			_menu.updateMenu();
 			prepareRoom();
 			_mouse.moveMouse(funct, inkey);
-			if (g_vm->shouldQuit())
+			if (shouldQuit())
 				return;
 			++temps;
 		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
@@ -739,7 +739,7 @@ void MortevielleEngine::handleAction() {
 					handleOpcode();
 
 				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
-					g_vm->_text.taffich();
+					_text.taffich();
 					if (_destinationOk) {
 						_destinationOk = false;
 						drawPicture();
@@ -1759,7 +1759,7 @@ void MortevielleEngine::startDialog(int16 rep) {
 	do {
 		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
 		key = f3f8::waitForF3F8();
-		if (g_vm->shouldQuit())
+		if (shouldQuit())
 			return;
 	} while (key != 66);
 	hirs();
@@ -3395,7 +3395,7 @@ void MortevielleEngine::testKey(bool d) {
 			prepareRoom();
 		quest = keyPressed();
 		_mouse.getMousePosition(x, y, click);
-		if (g_vm->shouldQuit())
+		if (shouldQuit())
 			return;
 	} while (!(quest || (click) || (d && _anyone)));
 	if (quest)
@@ -3631,7 +3631,7 @@ void MortevielleEngine::tfleche() {
 
 		do {
 			_mouse.moveMouse(qust, touch);
-			if (g_vm->shouldQuit())
+			if (shouldQuit())
 				return;
 
 			if (getMouseClick())


Commit: 7a7d812e74859a8f0ae0f0d057b77f643a0918b6
    https://github.com/scummvm/scummvm/commit/7a7d812e74859a8f0ae0f0d057b77f643a0918b6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T23:29:09-07:00

Commit Message:
MORTEVIELLE: Introduce DialogManager and get rid of static functions

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 3a27c27..9026df8 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -701,12 +701,12 @@ void MortevielleEngine::fctPlace() {
 					_speechManager.startSpeech(6, -9, 1);
 
 					// Do you want to enter the hidden passage?
-					int answer = Alert::show(getEngineString(S_YES_NO), 1);
+					int answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 					if (answer == 1) {
 						Common::String alertTxt = getString(582);
-						Alert::show(alertTxt, 1);
+						_dialogManager.show(alertTxt, 1);
 
-						bool enterPassageFl = KnowledgeCheck::show();
+						bool enterPassageFl = _dialogManager.showKnowledgeCheck();
 						_mouse.hideMouse();
 						hirs();
 						drawRightFrame();
@@ -731,7 +731,7 @@ void MortevielleEngine::fctPlace() {
 							aniof(1, 2);
 							aniof(1, 1);
 							alertTxt = getString(577);
-							Alert::show(alertTxt, 1);
+							_dialogManager.show(alertTxt, 1);
 							aniof(2, 1);
 							_crep = 166;
 						}
@@ -800,7 +800,7 @@ void MortevielleEngine::fctTurn() {
 		if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
 			handleDescriptionText(2, 167);
 			_speechManager.startSpeech(7, 9, 1);
-			int answer = Alert::show(getEngineString(S_YES_NO), 1);
+			int answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 			if (answer == 1)
 				_endGame = true;
 			else
@@ -810,7 +810,7 @@ void MortevielleEngine::fctTurn() {
 			handleDescriptionText(2, 175);
 			clearVerbBar();
 			_speechManager.startSpeech(6, -9, 1);
-			int answer = Alert::show(getEngineString(S_YES_NO), 1);
+			int answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				_coreVar._currPlace = CRYPT;
 				affrep();
@@ -915,7 +915,7 @@ void MortevielleEngine::fctKnock() {
 		displayTextInVerbBar(getEngineString(S_HIT));
 
 	if (_coreVar._currPlace == LANDING) {
-		Alert::show(getEngineString(S_BEFORE_USE_DEP_MENU), 1);
+		_dialogManager.show(getEngineString(S_BEFORE_USE_DEP_MENU), 1);
 		return;
 	}
 
@@ -1225,7 +1225,7 @@ void MortevielleEngine::fctSleep() {
 		if (h > 23)
 			h = 0;
 		prepareRoom();
-		answer = Alert::show(getEngineString(S_YES_NO), 1);
+		answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 		_anyone = false;
 	} while (answer != 1);
 	_crep = 998;
@@ -1315,7 +1315,7 @@ void MortevielleEngine::fctWait() {
 			return;
 		}
 		handleDescriptionText(2, 102);
-		answer = Alert::show(getEngineString(S_YES_NO), 1);
+		answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 	} while (answer != 2);
 	_crep = 998;
 	if (!_anyone)
@@ -1632,7 +1632,7 @@ void MortevielleEngine::askRestart() {
 	_day = 0;
 	handleDescriptionText(2, 180);
 
-	int answer = Alert::show(getEngineString(S_YES_NO), 1);
+	int answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 	_quitGame = (answer != 1);
 }
 
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 90c53d1..4c7fddf 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -38,7 +38,7 @@ namespace Mortevielle {
  * Alert function - Show
  * @remarks	Originally called 'do_alert'
  */
-int Alert::show(const Common::String &msg, int n) {
+int DialogManager::show(const Common::String &msg, int n) {
 	// Make a copy of the current screen surface for later restore
 	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
 
@@ -188,7 +188,7 @@ int Alert::show(const Common::String &msg, int n) {
  * Alert function - Decode Alert Details
  * @remarks	Originally called 'decod'
  */
-void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr) {
+void DialogManager::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr) {
 	// The second character of the string contains the number of choices
 	choiceNumb = atoi(inputStr.c_str() + 1);
 
@@ -228,7 +228,7 @@ void Alert::decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &li
 		col *= 10;
 }
 
-void Alert::setPosition(int ji, int coldep, int esp) {
+void DialogManager::setPosition(int ji, int coldep, int esp) {
 	g_vm->_screenSurface.putxy(coldep + (40 + esp) * (ji - 1), 98);
 }
 
@@ -236,7 +236,7 @@ void Alert::setPosition(int ji, int coldep, int esp) {
  * Alert function - Draw Alert Box
  * @remarks	Originally called 'fait_boite'
  */
-void Alert::drawAlertBox(int lidep, int nli, int tx) {
+void DialogManager::drawAlertBox(int lidep, int nli, int tx) {
 	if (tx > 640)
 		tx = 640;
 	int x = 320 - ((uint)tx / 2);
@@ -252,7 +252,7 @@ void Alert::drawAlertBox(int lidep, int nli, int tx) {
  * Alert function - Set Button Text
  * @remarks	Originally called 'fait_choix'
  */
-void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
+void DialogManager::setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp) {
 	int i = 1;
 	int x = coldep;
 	for (int l = 1; l <= nbcase; ++l) {
@@ -283,7 +283,7 @@ void Alert::setButtonText(Common::String c, int coldep, int nbcase, Common::Stri
 /**
  * Questions asked before entering the hidden passage
  */
-bool KnowledgeCheck::show() {
+bool DialogManager::showKnowledgeCheck() {
 	const int textIndexArr[10] = {511, 516, 524, 531, 545, 552, 559, 563, 570, 576};
 	const int correctAnswerArr[10] = {4, 7, 1, 6, 4, 4, 2, 5, 3, 1 };
 
@@ -402,7 +402,7 @@ bool KnowledgeCheck::show() {
 /**
  * Draw the F3/F8 dialog
  */
-void f3f8::draw() {
+void DialogManager::drawF3F8() {
 	Common::String f3 = g_vm->getEngineString(S_F3);
 	Common::String f8 = g_vm->getEngineString(S_F8);
 
@@ -425,7 +425,7 @@ void f3f8::draw() {
  * Graphical Device if modified
  * @remarks	Originally called 'diver'
  */
-void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
+void DialogManager::checkForF8(int SpeechNum, bool drawAni50Fl) {
 	g_vm->testKeyboard();
 	do {
 		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
@@ -445,7 +445,7 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) {
  * Alert function - Loop until F3 or F8 is pressed
  * @remarks	Originally called 'atf3f8'
  */
-int f3f8::waitForF3F8() {
+int DialogManager::waitForF3F8() {
 	int key;
 
 	do {
@@ -457,7 +457,7 @@ int f3f8::waitForF3F8() {
 	return key;
 }
 
-void f3f8::aff50(bool drawAni50Fl) {
+void DialogManager::aff50(bool drawAni50Fl) {
 	g_vm->_caff = 50;
 	g_vm->_maff = 0;
 	g_vm->_text.taffich();
@@ -468,10 +468,10 @@ void f3f8::aff50(bool drawAni50Fl) {
 		g_vm->handleDescriptionText(2, kDialogStringIndex + 142);
 
 	// Draw the f3/f8 dialog
-	draw();
+	drawF3F8();
 }
 
-void f3f8::ani50() {
+void DialogManager::ani50() {
 	g_vm->_crep = g_vm->animof(1, 1);
 	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
 	g_vm->_crep = g_vm->animof(2, 1);
@@ -480,4 +480,7 @@ void f3f8::ani50() {
 	g_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
 
+void DialogManager::setParent(MortevielleEngine *vm) {
+	_vm = vm;
+}
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 9b980af..35c3c34 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -32,6 +32,7 @@
 #include "common/str.h"
 
 namespace Mortevielle {
+class MortevielleEngine;
 
 static const int NUM_LINES = 7;
 const int kMaxHotspots = 14;
@@ -41,28 +42,23 @@ struct Hotspot {
 	bool _enabled;
 };
 
-class Alert {
+class DialogManager {
 private:
-	static void decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr);
-	static void setPosition(int ji, int coldep, int esp);
-	static void drawAlertBox(int lidep, int nli, int tx);
-	static void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
-public:
-	static int show(const Common::String &msg, int n);
-};
-
-class KnowledgeCheck {
-public:
-	static bool show();
-};
+	MortevielleEngine *_vm;
 
-class f3f8 {
+	void decodeAlertDetails(Common::String inputStr, int &choiceNumb, int &lineNumb, int &col, Common::String &choiceStr, Common::String &choiceListStr);
+	void setPosition(int ji, int coldep, int esp);
+	void drawAlertBox(int lidep, int nli, int tx);
+	void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
 public:
-	static void draw();
-	static void checkForF8(int SpeechNum, bool drawAni50Fl);
-	static int waitForF3F8();
-	static void aff50(bool drawAni50Fl);
-	static void ani50();
+	void setParent(MortevielleEngine *vm);
+	int show(const Common::String &msg, int n);
+	void drawF3F8();
+	void checkForF8(int SpeechNum, bool drawAni50Fl);
+	int waitForF3F8();
+	void aff50(bool drawAni50Fl);
+	void ani50();
+	bool showKnowledgeCheck();
 };
 
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index c6cafac..95750f5 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -75,6 +75,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 		_soundManager(_mixer) {
 	g_vm = this;
 	_debugger.setParent(this);
+	_dialogManager.setParent(this);
 	_screenSurface.setParent(this);
 	_mouse.setParent(this);
 	_text.setParent(this);
@@ -579,14 +580,14 @@ Common::Error MortevielleEngine::run() {
  * Show the game introduction
  */
 void MortevielleEngine::showIntroduction() {
-	f3f8::aff50(false);
+	_dialogManager.aff50(false);
 	_speechManager._mlec = 0;
-	f3f8::checkForF8(142, false);
+	_dialogManager.checkForF8(142, false);
 	if (shouldQuit())
 		return;
 
-	f3f8::ani50();
-	f3f8::checkForF8(143, true);
+	_dialogManager.ani50();
+	_dialogManager.checkForF8(143, true);
 	if (shouldQuit())
 		return;
 
@@ -689,7 +690,7 @@ void MortevielleEngine::handleAction() {
 		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
 			_savegameManager.loadGame((_msg[4] & 15) - 1);
 		if (inkey == '\103') {       /* F9 */
-			temps = Alert::show(_hintPctMessage, 1);
+			temps = _dialogManager.show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
 			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
@@ -1753,12 +1754,12 @@ void MortevielleEngine::startDialog(int16 rep) {
 	_mouse.hideMouse();
 	Common::String dialogStr = getString(rep + kDialogStringIndex);
 	_text.displayStr(dialogStr, 230, 4, 65, 24, 5);
-	f3f8::draw();
+	_dialogManager.drawF3F8();
 
 	key = 0;
 	do {
 		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
-		key = f3f8::waitForF3F8();
+		key = _dialogManager.waitForF3F8();
 		if (shouldQuit())
 			return;
 	} while (key != 66);
@@ -2164,7 +2165,7 @@ int MortevielleEngine::getRandomNumber(int minval, int maxval) {
  * @remarks	Originally called 'aldepl'
  */
 void MortevielleEngine::showMoveMenuAlert() {
-	Alert::show(getEngineString(S_USE_DEP_MENU), 1);
+	_dialogManager.show(getEngineString(S_USE_DEP_MENU), 1);
 }
 
 /**
@@ -3640,7 +3641,7 @@ void MortevielleEngine::tfleche() {
 		} while (!(qust || inRect || _anyone));
 
 		if (qust && (touch == '\103'))
-			Alert::show(_hintPctMessage, 1);
+			_dialogManager.show(_hintPctMessage, 1);
 	} while (!((touch == '\73') || ((touch == '\104') && (_x != 0) && (_y != 0)) || (_anyone) || (inRect)));
 
 	if (touch == '\73')
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index bdf28e4..9facc5e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -38,6 +38,7 @@
 #include "common/error.h"
 #include "graphics/surface.h"
 #include "mortevielle/debugger.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/graphics.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
@@ -487,6 +488,7 @@ public:
 	Menu _menu;
 	MouseHandler _mouse;
 	TextHandler _text;
+	DialogManager _dialogManager;
 
 	MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
 	~MortevielleEngine();
@@ -528,7 +530,6 @@ public:
 	void pictout(int seg, int dep, int x, int y);
 	void sauvecr(int y, int dy);
 	void charecr(int y, int dy);
-
 };
 
 extern MortevielleEngine *g_vm;


Commit: 8b923043b6fb980fd5415d297ad714c8baa0b66f
    https://github.com/scummvm/scummvm/commit/8b923043b6fb980fd5415d297ad714c8baa0b66f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-25T23:30:47-07:00

Commit Message:
MORTEVIELLE: Use _vm instead of g_vm in DialogManager

Changed paths:
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 4c7fddf..1fadf1e 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -40,13 +40,13 @@ namespace Mortevielle {
  */
 int DialogManager::show(const Common::String &msg, int n) {
 	// Make a copy of the current screen surface for later restore
-	g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
+	_vm->_backgroundSurface.copyFrom(_vm->_screenSurface);
 
-	g_vm->_mouse.hideMouse();
-	while (g_vm->keyPressed())
-		g_vm->getChar();
+	_vm->_mouse.hideMouse();
+	while (_vm->keyPressed())
+		_vm->getChar();
 
-	g_vm->setMouseClick(false);
+	_vm->setMouseClick(false);
 
 	int colNumb = 0;
 	int lignNumb = 0;
@@ -55,7 +55,7 @@ int DialogManager::show(const Common::String &msg, int n) {
 	Common::String caseStr;
 
 	decodeAlertDetails(msg, caseNumb, lignNumb, colNumb, alertStr, caseStr);
-	g_vm->sauvecr(50, (NUM_LINES + 1) << 4);
+	_vm->sauvecr(50, (NUM_LINES + 1) << 4);
 
 	int i = 0;
 	Common::Point curPos;
@@ -64,21 +64,21 @@ int DialogManager::show(const Common::String &msg, int n) {
 	} else {
 		drawAlertBox(8, 7, colNumb);
 		i = 0;
-		g_vm->_screenSurface._textPos.y = 70;
+		_vm->_screenSurface._textPos.y = 70;
 		do {
 			curPos.x = 320;
 			Common::String displayStr = "";
 			while ((alertStr[i + 1] != '\174') && (alertStr[i + 1] != '\135')) {
 				++i;
 				displayStr += alertStr[i];
-				if (g_vm->_resolutionScaler == 2)
+				if (_vm->_resolutionScaler == 2)
 					curPos.x -= 3;
 				else
 					curPos.x -= 5;
 			}
-			g_vm->_screenSurface.putxy(curPos.x, g_vm->_screenSurface._textPos.y);
-			g_vm->_screenSurface._textPos.y += 6;
-			g_vm->_screenSurface.drawString(displayStr, 4);
+			_vm->_screenSurface.putxy(curPos.x, _vm->_screenSurface._textPos.y);
+			_vm->_screenSurface._textPos.y += 6;
+			_vm->_screenSurface.drawString(displayStr, 4);
 			++i;
 		} while (alertStr[i] != ']');
 	}
@@ -95,25 +95,25 @@ int DialogManager::show(const Common::String &msg, int n) {
 	int limit[3][3];
 	memset(&limit[0][0], 0, sizeof(int) * 3 * 3);
 
-	limit[1][1] = ((uint)(coldep) / 2) * g_vm->_resolutionScaler;
+	limit[1][1] = ((uint)(coldep) / 2) * _vm->_resolutionScaler;
 	limit[1][2] = limit[1][1] + 40;
 	if (caseNumb == 1) {
 		limit[2][1] = limit[2][2];
 	} else {
-		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * g_vm->_resolutionScaler;
+		limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * _vm->_resolutionScaler;
 		limit[2][2] = (limit[2][1]) + 40;
 	}
-	g_vm->_mouse.showMouse();
+	_vm->_mouse.showMouse();
 	int id = 0;
 	bool dummyFl = false;
 	bool test3;
 	do {
 		char dummyKey = '\377';
-		g_vm->_mouse.moveMouse(dummyFl, dummyKey);
-		if (g_vm->shouldQuit())
+		_vm->_mouse.moveMouse(dummyFl, dummyKey);
+		if (_vm->shouldQuit())
 			return 0;
 
-		curPos = g_vm->_mouse._pos;
+		curPos = _vm->_mouse._pos;
 		bool newaff = false;
 		if ((curPos.y > 95) && (curPos.y < 105)) {
 			bool test1 = (curPos.x > limit[1][1]) && (curPos.x < limit[1][2]);
@@ -129,57 +129,57 @@ int DialogManager::show(const Common::String &msg, int n) {
 				else
 					ix = 2;
 				if (ix != id) {
-					g_vm->_mouse.hideMouse();
+					_vm->_mouse.hideMouse();
 					if (id != 0) {
 						setPosition(id, coldep, esp);
 
 						Common::String tmpStr(" ");
 						tmpStr += buttonStr[id];
 						tmpStr += " ";
-						g_vm->_screenSurface.drawString(tmpStr, 0);
+						_vm->_screenSurface.drawString(tmpStr, 0);
 					}
 					setPosition(ix, coldep, esp);
 
 					Common::String tmp2 = " ";
 					tmp2 += buttonStr[ix];
 					tmp2 += " ";
-					g_vm->_screenSurface.drawString(tmp2, 1);
+					_vm->_screenSurface.drawString(tmp2, 1);
 
 					id = ix;
-					g_vm->_mouse.showMouse();
+					_vm->_mouse.showMouse();
 				}
 			}
 		}
 		if ((id != 0) && !newaff) {
-			g_vm->_mouse.hideMouse();
+			_vm->_mouse.hideMouse();
 			setPosition(id, coldep, esp);
 
 			Common::String tmp3(" ");
 			tmp3 += buttonStr[id];
 			tmp3 += " ";
-			g_vm->_screenSurface.drawString(tmp3, 0);
+			_vm->_screenSurface.drawString(tmp3, 0);
 
 			id = 0;
-			g_vm->_mouse.showMouse();
+			_vm->_mouse.showMouse();
 		}
 		test3 = (curPos.y > 95) && (curPos.y < 105) && (((curPos.x > limit[1][1]) && (curPos.x < limit[1][2]))
 		                                    || ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2])));
-	} while (!g_vm->getMouseClick());
-	g_vm->setMouseClick(false);
-	g_vm->_mouse.hideMouse();
+	} while (!_vm->getMouseClick());
+	_vm->setMouseClick(false);
+	_vm->_mouse.hideMouse();
 	if (!test3)  {
 		id = n;
 		setPosition(n, coldep, esp);
 		Common::String tmp4(" ");
 		tmp4 += buttonStr[n];
 		tmp4 += " ";
-		g_vm->_screenSurface.drawString(tmp4, 1);
+		_vm->_screenSurface.drawString(tmp4, 1);
 	}
-	g_vm->charecr(50, (NUM_LINES + 1) * 16);
-	g_vm->_mouse.showMouse();
+	_vm->charecr(50, (NUM_LINES + 1) * 16);
+	_vm->_mouse.showMouse();
 
 	/* Restore the background area */
-	g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0);
+	_vm->_screenSurface.copyFrom(_vm->_backgroundSurface, 0, 0);
 
 	return id;
 }
@@ -221,15 +221,15 @@ void DialogManager::decodeAlertDetails(Common::String inputStr, int &choiceNumb,
 		col += 6;
 	}
 	++i;
-	choiceListStr = g_vm->copy(inputStr, i, 30);
-	if (g_vm->_resolutionScaler == 2)
+	choiceListStr = _vm->copy(inputStr, i, 30);
+	if (_vm->_resolutionScaler == 2)
 		col *= 6;
 	else
 		col *= 10;
 }
 
 void DialogManager::setPosition(int ji, int coldep, int esp) {
-	g_vm->_screenSurface.putxy(coldep + (40 + esp) * (ji - 1), 98);
+	_vm->_screenSurface.putxy(coldep + (40 + esp) * (ji - 1), 98);
 }
 
 /**
@@ -243,9 +243,9 @@ void DialogManager::drawAlertBox(int lidep, int nli, int tx) {
 	int y = (lidep - 1) * 8;
 	int xx = x + tx;
 	int yy = y + (nli * 8);
-	g_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
-	g_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
+	_vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
+	_vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
+	_vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
 }
 
 /**
@@ -267,13 +267,13 @@ void DialogManager::setButtonText(Common::String c, int coldep, int nbcase, Comm
 		while (str[l].size() < 3)
 			str[l] += ' ';
 
-		g_vm->_screenSurface.putxy(x, 98);
+		_vm->_screenSurface.putxy(x, 98);
 
 		Common::String tmp(" ");
 		tmp += str[l];
 		tmp += " ";
 
-		g_vm->_screenSurface.drawString(tmp, 0);
+		_vm->_screenSurface.drawString(tmp, 0);
 		x += esp + 40;
 	}
 }
@@ -300,17 +300,17 @@ bool DialogManager::showKnowledgeCheck() {
 	int correctCount = 0;
 
 	for (int indx = 0; indx < 10; ++indx) {
-		g_vm->_mouse.hideMouse();
-		g_vm->hirs();
-		g_vm->_mouse.showMouse();
+		_vm->_mouse.hideMouse();
+		_vm->hirs();
+		_vm->_mouse.showMouse();
 		int dialogHeight;
-		if (g_vm->_resolutionScaler == 1)
+		if (_vm->_resolutionScaler == 1)
 			dialogHeight = 29;
 		else
 			dialogHeight = 23;
-		g_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
-		Common::String tmpStr = g_vm->getString(textIndexArr[indx]);
-		g_vm->_text.displayStr(tmpStr, 20, 15, 100, 2, 0);
+		_vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
+		Common::String tmpStr = _vm->getString(textIndexArr[indx]);
+		_vm->_text.displayStr(tmpStr, 20, 15, 100, 2, 0);
 
 		int firstOption;
 		int lastOption;
@@ -327,16 +327,16 @@ bool DialogManager::showKnowledgeCheck() {
 
 		prevChoice = 1;
 		for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
-			tmpStr = g_vm->getString(j);
+			tmpStr = _vm->getString(j);
 			if ((int) tmpStr.size() > maxLength)
 				maxLength = tmpStr.size();
-			g_vm->_text.displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
+			_vm->_text.displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
 			choiceArray[prevChoice] = tmpStr;
 			optionPosY += 8;
 		}
 
 		for (int j = 1; j <= lastOption - firstOption + 1; ++j) {
-			coor[j]._rect = Common::Rect(45 * g_vm->_resolutionScaler, 27 + j * 8, (maxLength * 3 + 55) * g_vm->_resolutionScaler, 34 + j * 8);
+			coor[j]._rect = Common::Rect(45 * _vm->_resolutionScaler, 27 + j * 8, (maxLength * 3 + 55) * _vm->_resolutionScaler, 34 + j * 8);
 			coor[j]._enabled = true;
 
 			while ((int)choiceArray[j].size() < maxLength) {
@@ -345,42 +345,42 @@ bool DialogManager::showKnowledgeCheck() {
 		}
 		coor[lastOption - firstOption + 2]._enabled = false;
 		int rep;
-		if (g_vm->_resolutionScaler == 1)
+		if (_vm->_resolutionScaler == 1)
 			rep = 10;
 		else
 			rep = 6;
-		g_vm->_screenSurface.drawBox(80, 33, 40 + (maxLength * rep), (lastOption - firstOption) * 8 + 16, 15);
+		_vm->_screenSurface.drawBox(80, 33, 40 + (maxLength * rep), (lastOption - firstOption) * 8 + 16, 15);
 		rep = 0;
 
 		prevChoice = 0;
 		warning("Expected answer: %d", correctAnswerArr[indx]);
 		do {
-			g_vm->setMouseClick(false);
+			_vm->setMouseClick(false);
 			bool flag;
 			char key;
-			g_vm->_mouse.moveMouse(flag, key);
-			if (g_vm->shouldQuit())
+			_vm->_mouse.moveMouse(flag, key);
+			if (_vm->shouldQuit())
 				return false;
 
 			currChoice = 1;
-			while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]._rect))
+			while (coor[currChoice]._enabled && !_vm->_mouse.isMouseIn(coor[currChoice]._rect))
 				++currChoice;
 			if (coor[currChoice]._enabled) {
 				if ((prevChoice != 0) && (prevChoice != currChoice)) {
 					tmpStr = choiceArray[prevChoice] + '$';
-					g_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+					_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				}
 				if (prevChoice != currChoice) {
 					tmpStr = choiceArray[currChoice] + '$';
-					g_vm->_text.displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
+					_vm->_text.displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
 					prevChoice = currChoice;
 				}
 			} else if (prevChoice != 0) {
 				tmpStr = choiceArray[prevChoice] + '$';
-				g_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+				_vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
 				prevChoice = 0;
 			}
-		} while (!((prevChoice != 0) && g_vm->getMouseClick()));
+		} while (!((prevChoice != 0) && _vm->getMouseClick()));
 
 		if (prevChoice == correctAnswerArr[indx])
 			// Answer is correct
@@ -403,21 +403,21 @@ bool DialogManager::showKnowledgeCheck() {
  * Draw the F3/F8 dialog
  */
 void DialogManager::drawF3F8() {
-	Common::String f3 = g_vm->getEngineString(S_F3);
-	Common::String f8 = g_vm->getEngineString(S_F8);
+	Common::String f3 = _vm->getEngineString(S_F3);
+	Common::String f8 = _vm->getEngineString(S_F8);
 
 	// Write the F3 and F8 text strings
-	g_vm->_screenSurface.putxy(3, 44);
-	g_vm->_screenSurface.drawString(f3, 5);
-	g_vm->_screenSurface._textPos.y = 51;
-	g_vm->_screenSurface.drawString(f8, 5);
+	_vm->_screenSurface.putxy(3, 44);
+	_vm->_screenSurface.drawString(f3, 5);
+	_vm->_screenSurface._textPos.y = 51;
+	_vm->_screenSurface.drawString(f8, 5);
 
 	// Get the width of the written text strings
-	int f3Width = g_vm->_screenSurface.getStringWidth(f3);
-	int f8Width = g_vm->_screenSurface.getStringWidth(f8);
+	int f3Width = _vm->_screenSurface.getStringWidth(f3);
+	int f8Width = _vm->_screenSurface.getStringWidth(f8);
 
 	// Write out the bounding box
-	g_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
+	_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
 }
 
 /**
@@ -426,19 +426,19 @@ void DialogManager::drawF3F8() {
  * @remarks	Originally called 'diver'
  */
 void DialogManager::checkForF8(int SpeechNum, bool drawAni50Fl) {
-	g_vm->testKeyboard();
+	_vm->testKeyboard();
 	do {
-		g_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
-		g_vm->_key = waitForF3F8();
-		if (g_vm->shouldQuit())
+		_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
+		_vm->_key = waitForF3F8();
+		if (_vm->shouldQuit())
 			return;
 
-		if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) {
-			g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice;
-			g_vm->hirs();
+		if (_vm->_newGraphicalDevice != _vm->_currGraphicalDevice) {
+			_vm->_currGraphicalDevice = _vm->_newGraphicalDevice;
+			_vm->hirs();
 			aff50(drawAni50Fl);
 		}
-	} while (g_vm->_key != 66); // keycode for F8
+	} while (_vm->_key != 66); // keycode for F8
 }
 
 /**
@@ -449,8 +449,8 @@ int DialogManager::waitForF3F8() {
 	int key;
 
 	do {
-		key = g_vm->testou();
-		if (g_vm->shouldQuit())
+		key = _vm->testou();
+		if (_vm->shouldQuit())
 			return key;
 	} while ((key != 61) && (key != 66));
 
@@ -458,26 +458,26 @@ int DialogManager::waitForF3F8() {
 }
 
 void DialogManager::aff50(bool drawAni50Fl) {
-	g_vm->_caff = 50;
-	g_vm->_maff = 0;
-	g_vm->_text.taffich();
-	g_vm->draw(kAdrDes, 63, 12);
+	_vm->_caff = 50;
+	_vm->_maff = 0;
+	_vm->_text.taffich();
+	_vm->draw(kAdrDes, 63, 12);
 	if (drawAni50Fl)
 		ani50();
 	else
-		g_vm->handleDescriptionText(2, kDialogStringIndex + 142);
+		_vm->handleDescriptionText(2, kDialogStringIndex + 142);
 
 	// Draw the f3/f8 dialog
 	drawF3F8();
 }
 
 void DialogManager::ani50() {
-	g_vm->_crep = g_vm->animof(1, 1);
-	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
-	g_vm->_crep = g_vm->animof(2, 1);
-	g_vm->pictout(kAdrAni, g_vm->_crep, 63, 12);
-	g_vm->_largestClearScreen = (g_vm->_resolutionScaler == 1);
-	g_vm->handleDescriptionText(2, kDialogStringIndex + 143);
+	_vm->_crep = _vm->animof(1, 1);
+	_vm->pictout(kAdrAni, _vm->_crep, 63, 12);
+	_vm->_crep = _vm->animof(2, 1);
+	_vm->pictout(kAdrAni, _vm->_crep, 63, 12);
+	_vm->_largestClearScreen = (_vm->_resolutionScaler == 1);
+	_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
 
 void DialogManager::setParent(MortevielleEngine *vm) {


Commit: b5fd4e44be67d9ca2134bd198a9aab0a762f2298
    https://github.com/scummvm/scummvm/commit/b5fd4e44be67d9ca2134bd198a9aab0a762f2298
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-26T14:11:34-07:00

Commit Message:
Merge branch 'master' of https://github.com/scummvm/scummvm into mortevielle

Conflicts:
	engines/engines.mk

Changed paths:
  A audio/midiparser_qt.cpp
  A audio/midiparser_qt.h
  A audio/softsynth/mt32/BReverbModel.cpp
  A audio/softsynth/mt32/BReverbModel.h
  A audio/softsynth/mt32/LA32WaveGenerator.cpp
  A audio/softsynth/mt32/LA32WaveGenerator.h
  A audio/softsynth/mt32/LegacyWaveGenerator.cpp
  A audio/softsynth/mt32/LegacyWaveGenerator.h
  A audio/softsynth/mt32/ROMInfo.cpp
  A audio/softsynth/mt32/ROMInfo.h
  A backends/platform/android/org/scummvm/scummvm/MouseHelper.java
  A backends/platform/symbian/mmp/scummvm_cge.mmp.in
  A backends/platform/symbian/mmp/scummvm_composer.mmp.in
  A backends/platform/symbian/mmp/scummvm_hopkins.mmp.in
  A backends/platform/symbian/mmp/scummvm_pegasus.mmp.in
  A backends/platform/symbian/mmp/scummvm_toltecs.mmp.in
  A backends/platform/symbian/mmp/scummvm_tony.mmp.in
  A backends/platform/symbian/mmp/scummvm_wintermute.mmp.in
  A common/c++11-compat.h
  A devtools/create_neverhood/create_neverhood.cpp
  A devtools/create_neverhood/create_neverhood.h
  A devtools/create_neverhood/md5.cpp
  A devtools/create_neverhood/md5.h
  A devtools/create_neverhood/module.mk
  A devtools/create_neverhood/tables.h
  A devtools/create_neverhood/util.cpp
  A devtools/create_neverhood/util.h
  A devtools/create_teenagent/static_tables.h
  A devtools/create_teenagent/util.cpp
  A dists/engine-data/neverhood.dat
  A dists/engine-data/wintermute.zip
  A engines/groovie/stuffit.cpp
  A engines/groovie/stuffit.h
  A engines/hopkins/anim.cpp
  A engines/hopkins/anim.h
  A engines/hopkins/computer.cpp
  A engines/hopkins/computer.h
  A engines/hopkins/debugger.cpp
  A engines/hopkins/debugger.h
  A engines/hopkins/detection.cpp
  A engines/hopkins/detection_tables.h
  A engines/hopkins/dialogs.cpp
  A engines/hopkins/dialogs.h
  A engines/hopkins/events.cpp
  A engines/hopkins/events.h
  A engines/hopkins/files.cpp
  A engines/hopkins/files.h
  A engines/hopkins/font.cpp
  A engines/hopkins/font.h
  A engines/hopkins/globals.cpp
  A engines/hopkins/globals.h
  A engines/hopkins/graphics.cpp
  A engines/hopkins/graphics.h
  A engines/hopkins/hopkins.cpp
  A engines/hopkins/hopkins.h
  A engines/hopkins/lines.cpp
  A engines/hopkins/lines.h
  A engines/hopkins/menu.cpp
  A engines/hopkins/menu.h
  A engines/hopkins/module.mk
  A engines/hopkins/objects.cpp
  A engines/hopkins/objects.h
  A engines/hopkins/saveload.cpp
  A engines/hopkins/saveload.h
  A engines/hopkins/script.cpp
  A engines/hopkins/script.h
  A engines/hopkins/sound.cpp
  A engines/hopkins/sound.h
  A engines/hopkins/talk.cpp
  A engines/hopkins/talk.h
  A engines/kyra/sequences_hof.h
  A engines/kyra/sound_digital.h
  A engines/neverhood/background.cpp
  A engines/neverhood/background.h
  A engines/neverhood/blbarchive.cpp
  A engines/neverhood/blbarchive.h
  A engines/neverhood/console.cpp
  A engines/neverhood/console.h
  A engines/neverhood/detection.cpp
  A engines/neverhood/diskplayerscene.cpp
  A engines/neverhood/diskplayerscene.h
  A engines/neverhood/entity.cpp
  A engines/neverhood/entity.h
  A engines/neverhood/gamemodule.cpp
  A engines/neverhood/gamemodule.h
  A engines/neverhood/gamevars.cpp
  A engines/neverhood/gamevars.h
  A engines/neverhood/graphics.cpp
  A engines/neverhood/graphics.h
  A engines/neverhood/klaymen.cpp
  A engines/neverhood/klaymen.h
  A engines/neverhood/menumodule.cpp
  A engines/neverhood/menumodule.h
  A engines/neverhood/messages.h
  A engines/neverhood/microtiles.cpp
  A engines/neverhood/microtiles.h
  A engines/neverhood/module.cpp
  A engines/neverhood/module.h
  A engines/neverhood/module.mk
  A engines/neverhood/modules/module1000.cpp
  A engines/neverhood/modules/module1000.h
  A engines/neverhood/modules/module1100.cpp
  A engines/neverhood/modules/module1100.h
  A engines/neverhood/modules/module1200.cpp
  A engines/neverhood/modules/module1200.h
  A engines/neverhood/modules/module1300.cpp
  A engines/neverhood/modules/module1300.h
  A engines/neverhood/modules/module1400.cpp
  A engines/neverhood/modules/module1400.h
  A engines/neverhood/modules/module1500.cpp
  A engines/neverhood/modules/module1500.h
  A engines/neverhood/modules/module1600.cpp
  A engines/neverhood/modules/module1600.h
  A engines/neverhood/modules/module1700.cpp
  A engines/neverhood/modules/module1700.h
  A engines/neverhood/modules/module1800.cpp
  A engines/neverhood/modules/module1800.h
  A engines/neverhood/modules/module1900.cpp
  A engines/neverhood/modules/module1900.h
  A engines/neverhood/modules/module2000.cpp
  A engines/neverhood/modules/module2000.h
  A engines/neverhood/modules/module2100.cpp
  A engines/neverhood/modules/module2100.h
  A engines/neverhood/modules/module2200.cpp
  A engines/neverhood/modules/module2200.h
  A engines/neverhood/modules/module2300.cpp
  A engines/neverhood/modules/module2300.h
  A engines/neverhood/modules/module2400.cpp
  A engines/neverhood/modules/module2400.h
  A engines/neverhood/modules/module2500.cpp
  A engines/neverhood/modules/module2500.h
  A engines/neverhood/modules/module2600.cpp
  A engines/neverhood/modules/module2600.h
  A engines/neverhood/modules/module2700.cpp
  A engines/neverhood/modules/module2700.h
  A engines/neverhood/modules/module2800.cpp
  A engines/neverhood/modules/module2800.h
  A engines/neverhood/modules/module2900.cpp
  A engines/neverhood/modules/module2900.h
  A engines/neverhood/modules/module3000.cpp
  A engines/neverhood/modules/module3000.h
  A engines/neverhood/mouse.cpp
  A engines/neverhood/mouse.h
  A engines/neverhood/navigationscene.cpp
  A engines/neverhood/navigationscene.h
  A engines/neverhood/neverhood.cpp
  A engines/neverhood/neverhood.h
  A engines/neverhood/palette.cpp
  A engines/neverhood/palette.h
  A engines/neverhood/resource.cpp
  A engines/neverhood/resource.h
  A engines/neverhood/resourceman.cpp
  A engines/neverhood/resourceman.h
  A engines/neverhood/saveload.cpp
  A engines/neverhood/scene.cpp
  A engines/neverhood/scene.h
  A engines/neverhood/screen.cpp
  A engines/neverhood/screen.h
  A engines/neverhood/smackerplayer.cpp
  A engines/neverhood/smackerplayer.h
  A engines/neverhood/smackerscene.cpp
  A engines/neverhood/smackerscene.h
  A engines/neverhood/sound.cpp
  A engines/neverhood/sound.h
  A engines/neverhood/sprite.cpp
  A engines/neverhood/sprite.h
  A engines/neverhood/staticdata.cpp
  A engines/neverhood/staticdata.h
  A engines/neverhood/todo.txt
  A engines/scumm/player_mac.cpp
  A engines/scumm/player_mac.h
  A engines/scumm/player_v3m.cpp
  A engines/scumm/player_v3m.h
  A engines/scumm/player_v5m.cpp
  A engines/scumm/player_v5m.h
  A engines/sword25/gfx/microtiles.cpp
  A engines/sword25/gfx/microtiles.h
  A engines/toltecs/console.cpp
  A engines/toltecs/console.h
  A engines/wintermute/base/base_game_music.cpp
  A engines/wintermute/base/base_game_music.h
  A engines/wintermute/base/base_game_settings.cpp
  A engines/wintermute/base/base_game_settings.h
  A engines/wintermute/base/gfx/osystem/render_ticket.cpp
  A engines/wintermute/base/gfx/osystem/render_ticket.h
  A engines/wintermute/base/save_thumb_helper.cpp
  A engines/wintermute/base/save_thumb_helper.h
  A engines/wintermute/base/timer.cpp
  A engines/wintermute/base/timer.h
  A engines/wintermute/debugger.cpp
  A engines/wintermute/debugger.h
  A graphics/decoders/iff.cpp
  A graphics/decoders/iff.h
  A gui/fluidsynth-dialog.cpp
  A gui/fluidsynth-dialog.h
  A po/be_BY.po
  A po/fi_FI.po
  A test/common/bitstream.h
  R devtools/create_teenagent/md5.cpp
  R devtools/create_teenagent/md5.h
  R engines/parallaction/disk.cpp
  R engines/wintermute/base/file/base_resources.cpp
  R engines/wintermute/base/base_save_thumb_helper.cpp
  R engines/wintermute/base/base_save_thumb_helper.h
  R engines/wintermute/base/file/base_resources.h
  R graphics/iff.cpp
  R graphics/iff.h
    .gitignore
    AUTHORS
    COPYRIGHT
    Makefile.common
    NEWS
    README
    audio/audiostream.cpp
    audio/decoders/adpcm.cpp
    audio/decoders/adpcm.h
    audio/decoders/adpcm_intern.h
    audio/decoders/aiff.h
    audio/decoders/qdm2.cpp
    audio/decoders/quicktime.cpp
    audio/decoders/quicktime_intern.h
    audio/fmopl.cpp
    audio/fmopl.h
    audio/mididrv.h
    audio/midiparser.cpp
    audio/midiparser.h
    audio/midiparser_smf.cpp
    audio/midiparser_xmidi.cpp
    audio/mixer.cpp
    audio/mixer_intern.h
    audio/mods/maxtrax.cpp
    audio/mods/maxtrax.h
    audio/mods/paula.cpp
    audio/mods/protracker.cpp
    audio/mods/protracker.h
    audio/mods/tfmx.cpp
    audio/mods/tfmx.h
    audio/module.mk
    audio/softsynth/adlib.cpp
    audio/softsynth/fluidsynth.cpp
    audio/softsynth/fmtowns_pc98/towns_midi.cpp
    audio/softsynth/mt32.cpp
    audio/softsynth/mt32/AReverbModel.cpp
    audio/softsynth/mt32/AReverbModel.h
    audio/softsynth/mt32/DelayReverb.cpp
    audio/softsynth/mt32/DelayReverb.h
    audio/softsynth/mt32/FreeverbModel.cpp
    audio/softsynth/mt32/FreeverbModel.h
    audio/softsynth/mt32/LA32Ramp.cpp
    audio/softsynth/mt32/LA32Ramp.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/TVA.cpp
    audio/softsynth/mt32/TVA.h
    audio/softsynth/mt32/TVF.cpp
    audio/softsynth/mt32/TVF.h
    audio/softsynth/mt32/TVP.cpp
    audio/softsynth/mt32/TVP.h
    audio/softsynth/mt32/Tables.cpp
    audio/softsynth/mt32/Tables.h
    audio/softsynth/mt32/mmath.h
    audio/softsynth/mt32/module.mk
    audio/softsynth/mt32/mt32emu.h
    audio/softsynth/opl/dosbox.cpp
    audio/softsynth/opl/mame.cpp
    audio/softsynth/sid.cpp
    backends/audiocd/audiocd.h
    backends/events/default/default-events.cpp
    backends/fs/abstract-fs.h
    backends/fs/ds/ds-fs.h
    backends/graphics/opengl/gltexture.cpp
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/keymapper/keymapper.h
    backends/midi/coreaudio.cpp
    backends/midi/seq.cpp
    backends/mixer/sdl/sdl-mixer.cpp
    backends/platform/android/android.cpp
    backends/platform/android/android.h
    backends/platform/android/android.mk
    backends/platform/android/asset-archive.cpp
    backends/platform/android/events.cpp
    backends/platform/android/jni.cpp
    backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
    backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
    backends/platform/ds/arm9/source/blitters.cpp
    backends/platform/ds/arm9/source/blitters.h
    backends/platform/ds/arm9/source/cdaudio.cpp
    backends/platform/ds/arm9/source/cdaudio.h
    backends/platform/ds/arm9/source/dsmain.cpp
    backends/platform/ds/arm9/source/dsmain.h
    backends/platform/ds/arm9/source/dsoptions.cpp
    backends/platform/ds/arm9/source/dsoptions.h
    backends/platform/ds/arm9/source/keys.cpp
    backends/platform/ds/arm9/source/keys.h
    backends/platform/ds/arm9/source/scummhelp.cpp
    backends/platform/ds/arm9/source/scummhelp.h
    backends/platform/ds/arm9/source/touchkeyboard.cpp
    backends/platform/ds/arm9/source/touchkeyboard.h
    backends/platform/ds/arm9/source/wordcompletion.cpp
    backends/platform/ds/arm9/source/wordcompletion.h
    backends/platform/iphone/iphone_video.mm
    backends/platform/iphone/osys_main.cpp
    backends/platform/iphone/osys_video.mm
    backends/platform/maemo/debian/changelog
    backends/platform/n64/osys_n64.h
    backends/platform/n64/osys_n64_base.cpp
    backends/platform/ps2/Gs2dScreen.cpp
    backends/platform/ps2/Gs2dScreen.h
    backends/platform/ps2/ps2pad.cpp
    backends/platform/psp/README.PSP
    backends/platform/psp/audio.cpp
    backends/platform/sdl/macosx/appmenu_osx.mm
    backends/platform/sdl/macosx/macosx.cpp
    backends/platform/symbian/AdaptAllMMPs.pl
    backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
    backends/platform/symbian/README
    backends/platform/symbian/S60/ScummVM_S60.mmp.in
    backends/platform/symbian/S60/ScummVM_S60_App.mmp
    backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
    backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
    backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
    backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3_split.pkg
    backends/platform/symbian/S80/ScummVM_S80.mmp.in
    backends/platform/symbian/S80/ScummVM_S80_App.mmp
    backends/platform/symbian/S90/Scummvm_S90.mmp.in
    backends/platform/symbian/S90/Scummvm_S90_App.mmp
    backends/platform/symbian/UIQ2/ScummVM.rss
    backends/platform/symbian/UIQ3/ScummVM.rss
    backends/platform/symbian/UIQ3/ScummVM_A0000658.rss
    backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in
    backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
    backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
    backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3_split.pkg
    backends/platform/symbian/UIQ3/scummvm_A0000658_loc.rss
    backends/platform/symbian/mmp/scummvm_agi.mmp.in
    backends/platform/symbian/mmp/scummvm_agos.mmp.in
    backends/platform/symbian/mmp/scummvm_base.mmp.in
    backends/platform/symbian/mmp/scummvm_cine.mmp.in
    backends/platform/symbian/mmp/scummvm_cruise.mmp.in
    backends/platform/symbian/mmp/scummvm_draci.mmp.in
    backends/platform/symbian/mmp/scummvm_drascula.mmp.in
    backends/platform/symbian/mmp/scummvm_gob.mmp.in
    backends/platform/symbian/mmp/scummvm_groovie.mmp.in
    backends/platform/symbian/mmp/scummvm_hugo.mmp.in
    backends/platform/symbian/mmp/scummvm_kyra.mmp.in
    backends/platform/symbian/mmp/scummvm_lastexpress.mmp.in
    backends/platform/symbian/mmp/scummvm_lure.mmp.in
    backends/platform/symbian/mmp/scummvm_m4.mmp.in
    backends/platform/symbian/mmp/scummvm_made.mmp.in
    backends/platform/symbian/mmp/scummvm_mohawk.mmp.in
    backends/platform/symbian/mmp/scummvm_parallaction.mmp.in
    backends/platform/symbian/mmp/scummvm_queen.mmp.in
    backends/platform/symbian/mmp/scummvm_saga.mmp.in
    backends/platform/symbian/mmp/scummvm_sci.mmp.in
    backends/platform/symbian/mmp/scummvm_scumm.mmp.in
    backends/platform/symbian/mmp/scummvm_sky.mmp.in
    backends/platform/symbian/mmp/scummvm_sword1.mmp.in
    backends/platform/symbian/mmp/scummvm_sword2.mmp.in
    backends/platform/symbian/mmp/scummvm_teenagent.mmp.in
    backends/platform/symbian/mmp/scummvm_tinsel.mmp.in
    backends/platform/symbian/mmp/scummvm_toon.mmp.in
    backends/platform/symbian/mmp/scummvm_touche.mmp.in
    backends/platform/symbian/mmp/scummvm_tsage.mmp.in
    backends/platform/symbian/mmp/scummvm_tucker.mmp.in
    backends/platform/symbian/res/ScummVmAif.rss
    backends/platform/symbian/res/scummvm.rss
    backends/platform/symbian/res/scummvm_A0000658.rss
    backends/platform/symbian/src/ScummVm.hrh
    backends/platform/wii/osystem_gfx.cpp
    backends/platform/wince/CEgui/GUIElement.cpp
    backends/platform/wince/CEgui/GUIElement.h
    backends/platform/wince/CEgui/ToolbarHandler.cpp
    backends/updates/macosx/macosx-updates.mm
    base/commandLine.cpp
    base/internal_version.h
    common/archive.cpp
    common/archive.h
    common/bufferedstream.h
    common/config-file.cpp
    common/config-file.h
    common/config-manager.h
    common/cosinetables.cpp
    common/cosinetables.h
    common/debug-channels.h
    common/debug.cpp
    common/fft.h
    common/file.cpp
    common/forbidden.h
    common/fs.cpp
    common/func.h
    common/hash-str.h
    common/hashmap.cpp
    common/hashmap.h
    common/iff_container.cpp
    common/iff_container.h
    common/language.h
    common/macresman.cpp
    common/memorypool.h
    common/memstream.h
    common/mutex.cpp
    common/platform.cpp
    common/platform.h
    common/quicktime.cpp
    common/quicktime.h
    common/random.cpp
    common/random.h
    common/rdft.h
    common/rect.h
    common/scummsys.h
    common/sinetables.cpp
    common/sinetables.h
    common/singleton.h
    common/str.cpp
    common/stream.cpp
    common/stream.h
    common/taskbar.h
    common/textconsole.cpp
    common/textconsole.h
    common/unzip.cpp
    common/unzip.h
    common/updates.h
    common/util.cpp
    common/util.h
    common/winexe.cpp
    common/winexe_ne.cpp
    common/winexe_ne.h
    common/xmlparser.cpp
    common/zlib.cpp
    common/zlib.h
    configure
    devtools/create_kyradat/create_kyradat.cpp
    devtools/create_kyradat/create_kyradat.h
    devtools/create_kyradat/extract.cpp
    devtools/create_kyradat/games.cpp
    devtools/create_kyradat/tables.cpp
    devtools/create_project/config.h
    devtools/create_teenagent/create_teenagent.cpp
    devtools/create_teenagent/module.mk
    devtools/create_teenagent/util.h
    devtools/credits.pl
    devtools/md5table.c
    devtools/scumm-md5.txt
    dists/android/AndroidManifest.xml
    dists/android/plugin-manifest.xml
    dists/bada/Res/scummmobile/scummmobile_layout.stx
    dists/debian/copyright
    dists/engine-data/kyra.dat
    dists/gph/README-GPH
    dists/gph/scummvm.ini
    dists/iphone/Info.plist
    dists/irix/scummvm.spec
    dists/macosx/Info.plist
    dists/macosx/Info.plist.in
    dists/openpandora/PXML.xml
    dists/openpandora/README-OPENPANDORA
    dists/openpandora/README-PND.txt
    dists/openpandora/index.html
    dists/redhat/scummvm-tools.spec
    dists/redhat/scummvm.spec
    dists/redhat/scummvm.spec.in
    dists/scummvm.rc
    dists/scummvm.rc.in
    dists/slackware/scummvm.SlackBuild
    dists/wii/meta.xml
    dists/win32/ScummVM.iss
    dists/win32/migration.bat
    dists/win32/scummvm.nsi
    dists/win32/scummvm.nsi.in
    doc/cz/PrectiMe
    doc/de/Liesmich
    doc/de/Neues
    doc/se/LasMig
    engines/advancedDetector.cpp
    engines/agi/agi.cpp
    engines/agi/agi.h
    engines/agi/console.cpp
    engines/agi/console.h
    engines/agi/cycle.cpp
    engines/agi/detection.cpp
    engines/agi/detection_tables.h
    engines/agi/loader_v1.cpp
    engines/agi/loader_v2.cpp
    engines/agi/loader_v3.cpp
    engines/agi/logic.h
    engines/agi/lzw.h
    engines/agi/op_cmd.cpp
    engines/agi/op_test.cpp
    engines/agi/opcodes.cpp
    engines/agi/preagi_winnie.cpp
    engines/agi/preagi_winnie.h
    engines/agi/saveload.cpp
    engines/agi/sound.cpp
    engines/agi/sound.h
    engines/agi/sound_2gs.cpp
    engines/agi/sound_2gs.h
    engines/agi/sound_midi.cpp
    engines/agi/sound_midi.h
    engines/agi/wagparser.cpp
    engines/agos/agos.cpp
    engines/agos/detection.cpp
    engines/agos/detection_tables.h
    engines/agos/feeble.cpp
    engines/agos/gfx.cpp
    engines/agos/icons.cpp
    engines/agos/res.cpp
    engines/agos/saveload.cpp
    engines/agos/sound.cpp
    engines/agos/verb.cpp
    engines/agos/vga_pn.cpp
    engines/cge/bitmap.cpp
    engines/cge/cge.h
    engines/cge/detection.cpp
    engines/cge/events.cpp
    engines/cge/snail.cpp
    engines/cge/text.cpp
    engines/cge/vga13h.cpp
    engines/cine/cine.cpp
    engines/cine/console.cpp
    engines/cine/detection.cpp
    engines/cine/detection_tables.h
    engines/cine/part.cpp
    engines/cine/script_fw.cpp
    engines/cine/script_os.cpp
    engines/cine/various.cpp
    engines/composer/composer.cpp
    engines/composer/composer.h
    engines/composer/detection.cpp
    engines/composer/graphics.cpp
    engines/composer/resource.cpp
    engines/configure.engines
    engines/cruise/cruise.h
    engines/cruise/dataLoader.cpp
    engines/cruise/detection.cpp
    engines/cruise/linker.h
    engines/cruise/staticres.cpp
    engines/cruise/volume.cpp
    engines/draci/console.cpp
    engines/draci/detection.cpp
    engines/drascula/animation.cpp
    engines/drascula/console.cpp
    engines/drascula/converse.cpp
    engines/drascula/detection.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/dreamweb/backdrop.cpp
    engines/dreamweb/console.cpp
    engines/dreamweb/detection_tables.h
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/keypad.cpp
    engines/dreamweb/monitor.cpp
    engines/dreamweb/newplace.cpp
    engines/dreamweb/object.cpp
    engines/dreamweb/pathfind.cpp
    engines/dreamweb/people.cpp
    engines/dreamweb/print.cpp
    engines/dreamweb/rain.cpp
    engines/dreamweb/saveload.cpp
    engines/dreamweb/sprite.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/titles.cpp
    engines/dreamweb/use.cpp
    engines/dreamweb/vgafades.cpp
    engines/dreamweb/vgagrafx.cpp
    engines/engine.cpp
    engines/engines.mk
    engines/gob/anifile.cpp
    engines/gob/cmpfile.cpp
    engines/gob/detection/tables_adi2.h
    engines/gob/detection/tables_adi4.h
    engines/gob/detection/tables_adibou.h
    engines/gob/detection/tables_ajworld.h
    engines/gob/detection/tables_bargon.h
    engines/gob/detection/tables_dynasty.h
    engines/gob/detection/tables_fallback.h
    engines/gob/detection/tables_fascin.h
    engines/gob/detection/tables_geisha.h
    engines/gob/detection/tables_gob1.h
    engines/gob/detection/tables_gob2.h
    engines/gob/detection/tables_gob3.h
    engines/gob/detection/tables_inca2.h
    engines/gob/detection/tables_lit.h
    engines/gob/detection/tables_littlered.h
    engines/gob/detection/tables_onceupon.h
    engines/gob/detection/tables_playtoons.h
    engines/gob/detection/tables_urban.h
    engines/gob/detection/tables_ween.h
    engines/gob/detection/tables_woodruff.h
    engines/gob/draw.cpp
    engines/gob/expression.cpp
    engines/gob/hotspots.cpp
    engines/gob/init_v2.cpp
    engines/gob/inter.h
    engines/gob/inter_fascin.cpp
    engines/gob/inter_playtoons.cpp
    engines/gob/inter_v2.cpp
    engines/gob/inter_v7.cpp
    engines/gob/map_v1.cpp
    engines/gob/mult_v2.cpp
    engines/gob/pregob/onceupon/stork.h
    engines/gob/pregob/onceupon/title.cpp
    engines/gob/save/saveconverter.cpp
    engines/gob/save/saveload.h
    engines/gob/sound/adlib.cpp
    engines/gob/sound/sound.cpp
    engines/gob/sound/soundblaster.cpp
    engines/gob/surface.cpp
    engines/gob/surface.h
    engines/groovie/cursor.cpp
    engines/groovie/detection.cpp
    engines/groovie/groovie.cpp
    engines/groovie/groovie.h
    engines/groovie/module.mk
    engines/groovie/music.cpp
    engines/groovie/music.h
    engines/groovie/vdx.cpp
    engines/groovie/vdx.h
    engines/hugo/detection.cpp
    engines/hugo/file.cpp
    engines/hugo/hugo.cpp
    engines/hugo/intro.cpp
    engines/hugo/mouse.cpp
    engines/hugo/parser.cpp
    engines/kyra/chargen.cpp
    engines/kyra/darkmoon.cpp
    engines/kyra/darkmoon.h
    engines/kyra/debugger.cpp
    engines/kyra/debugger.h
    engines/kyra/detection.cpp
    engines/kyra/detection_tables.h
    engines/kyra/eob.cpp
    engines/kyra/eob.h
    engines/kyra/eobcommon.cpp
    engines/kyra/eobcommon.h
    engines/kyra/gui_eob.cpp
    engines/kyra/gui_eob.h
    engines/kyra/gui_hof.cpp
    engines/kyra/gui_lol.cpp
    engines/kyra/gui_lol.h
    engines/kyra/gui_mr.cpp
    engines/kyra/gui_rpg.cpp
    engines/kyra/items_eob.cpp
    engines/kyra/items_hof.cpp
    engines/kyra/items_lok.cpp
    engines/kyra/items_lol.cpp
    engines/kyra/kyra_hof.cpp
    engines/kyra/kyra_hof.h
    engines/kyra/kyra_lok.cpp
    engines/kyra/kyra_lok.h
    engines/kyra/kyra_mr.cpp
    engines/kyra/kyra_mr.h
    engines/kyra/kyra_rpg.cpp
    engines/kyra/kyra_rpg.h
    engines/kyra/kyra_v1.cpp
    engines/kyra/kyra_v1.h
    engines/kyra/lol.cpp
    engines/kyra/lol.h
    engines/kyra/magic_eob.cpp
    engines/kyra/resource.cpp
    engines/kyra/resource.h
    engines/kyra/resource_intern.cpp
    engines/kyra/resource_intern.h
    engines/kyra/saveload.cpp
    engines/kyra/saveload_eob.cpp
    engines/kyra/saveload_lok.cpp
    engines/kyra/saveload_lol.cpp
    engines/kyra/scene_eob.cpp
    engines/kyra/scene_hof.cpp
    engines/kyra/scene_lol.cpp
    engines/kyra/scene_mr.cpp
    engines/kyra/scene_rpg.cpp
    engines/kyra/screen.cpp
    engines/kyra/screen.h
    engines/kyra/screen_eob.cpp
    engines/kyra/screen_eob.h
    engines/kyra/screen_hof.cpp
    engines/kyra/screen_hof.h
    engines/kyra/screen_lol.cpp
    engines/kyra/screen_lol.h
    engines/kyra/screen_v2.cpp
    engines/kyra/screen_v2.h
    engines/kyra/script_eob.cpp
    engines/kyra/script_eob.h
    engines/kyra/script_hof.cpp
    engines/kyra/script_lok.cpp
    engines/kyra/script_lol.cpp
    engines/kyra/script_mr.cpp
    engines/kyra/script_tim.cpp
    engines/kyra/sequences_darkmoon.cpp
    engines/kyra/sequences_eob.cpp
    engines/kyra/sequences_hof.cpp
    engines/kyra/sequences_lok.cpp
    engines/kyra/sequences_lol.cpp
    engines/kyra/sound.cpp
    engines/kyra/sound.h
    engines/kyra/sound_adlib.cpp
    engines/kyra/sound_adlib.h
    engines/kyra/sound_amiga.cpp
    engines/kyra/sound_digital.cpp
    engines/kyra/sound_intern.h
    engines/kyra/sound_lol.cpp
    engines/kyra/sound_midi.cpp
    engines/kyra/sound_towns.cpp
    engines/kyra/sprites_eob.cpp
    engines/kyra/sprites_lol.cpp
    engines/kyra/sprites_rpg.cpp
    engines/kyra/staticres.cpp
    engines/kyra/staticres_eob.cpp
    engines/kyra/staticres_lol.cpp
    engines/kyra/text_hof.cpp
    engines/kyra/text_lol.cpp
    engines/kyra/text_rpg.cpp
    engines/kyra/text_rpg.h
    engines/kyra/timer_eob.cpp
    engines/kyra/timer_lol.cpp
    engines/kyra/vqa.cpp
    engines/lastexpress/entities/august.cpp
    engines/lastexpress/entities/kahina.cpp
    engines/lure/debugger.cpp
    engines/lure/detection.cpp
    engines/lure/hotspots.cpp
    engines/lure/menu.cpp
    engines/lure/res_struct.cpp
    engines/lure/room.cpp
    engines/lure/scripts.cpp
    engines/made/console.cpp
    engines/made/database.cpp
    engines/made/detection.cpp
    engines/mohawk/console.cpp
    engines/mohawk/cursors.cpp
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h
    engines/mohawk/dialogs.cpp
    engines/mohawk/installer_archive.cpp
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks_code.cpp
    engines/mohawk/livingbooks_code.h
    engines/mohawk/livingbooks_lbx.cpp
    engines/mohawk/myst.cpp
    engines/mohawk/myst.h
    engines/mohawk/myst_areas.cpp
    engines/mohawk/myst_graphics.cpp
    engines/mohawk/myst_graphics.h
    engines/mohawk/myst_scripts.cpp
    engines/mohawk/myst_scripts.h
    engines/mohawk/myst_stacks/channelwood.cpp
    engines/mohawk/myst_stacks/demo.cpp
    engines/mohawk/myst_stacks/intro.cpp
    engines/mohawk/myst_stacks/mechanical.cpp
    engines/mohawk/myst_stacks/mechanical.h
    engines/mohawk/myst_stacks/myst.cpp
    engines/mohawk/myst_stacks/myst.h
    engines/mohawk/myst_stacks/preview.cpp
    engines/mohawk/myst_stacks/preview.h
    engines/mohawk/myst_stacks/selenitic.cpp
    engines/mohawk/myst_stacks/slides.cpp
    engines/mohawk/myst_stacks/stoneship.cpp
    engines/mohawk/resource.cpp
    engines/mohawk/riven.cpp
    engines/mohawk/riven_external.cpp
    engines/mohawk/video.cpp
    engines/mohawk/video.h
    engines/mohawk/view.cpp
    engines/parallaction/balloons.cpp
    engines/parallaction/callables_ns.cpp
    engines/parallaction/detection.cpp
    engines/parallaction/dialogue.cpp
    engines/parallaction/disk.h
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/font.cpp
    engines/parallaction/gfxbase.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/graphics.h
    engines/parallaction/gui_br.cpp
    engines/parallaction/input.cpp
    engines/parallaction/module.mk
    engines/parallaction/parallaction.cpp
    engines/parallaction/parallaction_br.cpp
    engines/parallaction/parallaction_ns.cpp
    engines/parallaction/parser_br.cpp
    engines/parallaction/parser_ns.cpp
    engines/parallaction/sound_br.cpp
    engines/parallaction/staticres.cpp
    engines/pegasus/cursor.cpp
    engines/pegasus/detection.cpp
    engines/pegasus/elements.cpp
    engines/pegasus/energymonitor.cpp
    engines/pegasus/interface.cpp
    engines/pegasus/interface.h
    engines/pegasus/items/inventorypicture.h
    engines/pegasus/menu.cpp
    engines/pegasus/movie.cpp
    engines/pegasus/neighborhood/caldoria/caldoria.cpp
    engines/pegasus/neighborhood/mars/mars.cpp
    engines/pegasus/neighborhood/mars/reactor.cpp
    engines/pegasus/neighborhood/neighborhood.cpp
    engines/pegasus/neighborhood/norad/delta/globegame.cpp
    engines/pegasus/neighborhood/norad/pressuredoor.cpp
    engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
    engines/pegasus/neighborhood/tsa/fulltsa.cpp
    engines/pegasus/neighborhood/wsc/wsc.cpp
    engines/pegasus/pegasus.cpp
    engines/pegasus/pegasus.h
    engines/pegasus/sound.cpp
    engines/pegasus/surface.cpp
    engines/pegasus/surface.h
    engines/pegasus/timers.cpp
    engines/pegasus/timers.h
    engines/plugins_table.h
    engines/queen/cutaway.cpp
    engines/queen/display.cpp
    engines/queen/display.h
    engines/queen/graphics.cpp
    engines/queen/input.cpp
    engines/queen/input.h
    engines/queen/journal.cpp
    engines/queen/logic.cpp
    engines/queen/queen.cpp
    engines/queen/resource.cpp
    engines/queen/sound.cpp
    engines/queen/sound.h
    engines/queen/talk.cpp
    engines/queen/talk.h
    engines/saga/actor.cpp
    engines/saga/detection.cpp
    engines/saga/detection_tables.h
    engines/saga/events.cpp
    engines/saga/interface.cpp
    engines/saga/music.cpp
    engines/saga/music.h
    engines/saga/resource.cpp
    engines/saga/saga.cpp
    engines/saga/saga.h
    engines/saga/saveload.cpp
    engines/saga/scene.cpp
    engines/saga/sfuncs_ihnm.cpp
    engines/saga/shorten.cpp
    engines/saga/sndres.cpp
    engines/saga/sndres.h
    engines/sci/console.cpp
    engines/sci/console.h
    engines/sci/decompressor.cpp
    engines/sci/detection.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/features.cpp
    engines/sci/engine/kernel.cpp
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kevent.cpp
    engines/sci/engine/kfile.cpp
    engines/sci/engine/kgraphics.cpp
    engines/sci/engine/kgraphics32.cpp
    engines/sci/engine/klists.cpp
    engines/sci/engine/kmath.cpp
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/ksound.cpp
    engines/sci/engine/kstring.cpp
    engines/sci/engine/message.cpp
    engines/sci/engine/message.h
    engines/sci/engine/savegame.cpp
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/state.h
    engines/sci/engine/workarounds.cpp
    engines/sci/event.cpp
    engines/sci/graphics/animate.cpp
    engines/sci/graphics/animate.h
    engines/sci/graphics/compare.cpp
    engines/sci/graphics/compare.h
    engines/sci/graphics/controls16.cpp
    engines/sci/graphics/controls16.h
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/controls32.h
    engines/sci/graphics/coordadjuster.h
    engines/sci/graphics/cursor.cpp
    engines/sci/graphics/cursor.h
    engines/sci/graphics/fontsjis.h
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h
    engines/sci/graphics/menu.cpp
    engines/sci/graphics/paint16.cpp
    engines/sci/graphics/paint16.h
    engines/sci/graphics/paint32.cpp
    engines/sci/graphics/paint32.h
    engines/sci/graphics/palette.cpp
    engines/sci/graphics/picture.cpp
    engines/sci/graphics/portrait.cpp
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/screen.cpp
    engines/sci/graphics/text16.cpp
    engines/sci/graphics/text16.h
    engines/sci/parser/grammar.cpp
    engines/sci/parser/vocabulary.cpp
    engines/sci/resource.cpp
    engines/sci/resource_audio.cpp
    engines/sci/resource_intern.h
    engines/sci/sci.cpp
    engines/sci/sci.h
    engines/sci/sound/audio.cpp
    engines/sci/sound/drivers/adlib.cpp
    engines/sci/sound/drivers/cms.cpp
    engines/sci/sound/drivers/fb01.cpp
    engines/sci/sound/drivers/midi.cpp
    engines/sci/sound/midiparser_sci.cpp
    engines/sci/sound/music.cpp
    engines/sci/sound/soundcmd.cpp
    engines/scumm/actor.cpp
    engines/scumm/debugger.cpp
    engines/scumm/debugger.h
    engines/scumm/detection.cpp
    engines/scumm/detection_tables.h
    engines/scumm/gfx.cpp
    engines/scumm/he/animation_he.h
    engines/scumm/he/intern_he.h
    engines/scumm/he/logic/football.cpp
    engines/scumm/he/script_v100he.cpp
    engines/scumm/he/script_v60he.cpp
    engines/scumm/he/sound_he.cpp
    engines/scumm/he/wiz_he.cpp
    engines/scumm/imuse/imuse.cpp
    engines/scumm/imuse/imuse.h
    engines/scumm/imuse/imuse_internal.h
    engines/scumm/imuse/imuse_part.cpp
    engines/scumm/imuse_digi/dimuse.cpp
    engines/scumm/insane/insane.cpp
    engines/scumm/insane/insane_ben.cpp
    engines/scumm/insane/insane_enemy.cpp
    engines/scumm/insane/insane_iact.cpp
    engines/scumm/insane/insane_scenes.cpp
    engines/scumm/module.mk
    engines/scumm/music.h
    engines/scumm/object.cpp
    engines/scumm/resource.cpp
    engines/scumm/saveload.cpp
    engines/scumm/saveload.h
    engines/scumm/script.cpp
    engines/scumm/script.h
    engines/scumm/script_v4.cpp
    engines/scumm/script_v5.cpp
    engines/scumm/script_v6.cpp
    engines/scumm/scumm-md5.h
    engines/scumm/scumm.cpp
    engines/scumm/smush/smush_player.cpp
    engines/scumm/sound.cpp
    engines/scumm/vars.cpp
    engines/sky/compact.cpp
    engines/sky/music/musicbase.cpp
    engines/sky/sky.cpp
    engines/sword1/animation.cpp
    engines/sword1/console.cpp
    engines/sword1/control.cpp
    engines/sword1/detection.cpp
    engines/sword1/resman.cpp
    engines/sword1/sound.cpp
    engines/sword1/sound.h
    engines/sword1/sword1.cpp
    engines/sword2/console.cpp
    engines/sword2/controls.cpp
    engines/sword2/memory.cpp
    engines/sword2/memory.h
    engines/sword2/palette.cpp
    engines/sword2/sound.h
    engines/sword2/sprite.cpp
    engines/sword2/sword2.cpp
    engines/sword25/console.cpp
    engines/sword25/gfx/animation.cpp
    engines/sword25/gfx/animation.h
    engines/sword25/gfx/bitmapresource.h
    engines/sword25/gfx/dynamicbitmap.cpp
    engines/sword25/gfx/dynamicbitmap.h
    engines/sword25/gfx/graphicengine.cpp
    engines/sword25/gfx/image/image.h
    engines/sword25/gfx/image/renderedimage.cpp
    engines/sword25/gfx/image/renderedimage.h
    engines/sword25/gfx/image/swimage.cpp
    engines/sword25/gfx/image/swimage.h
    engines/sword25/gfx/image/vectorimage.cpp
    engines/sword25/gfx/image/vectorimage.h
    engines/sword25/gfx/panel.cpp
    engines/sword25/gfx/panel.h
    engines/sword25/gfx/renderobject.cpp
    engines/sword25/gfx/renderobject.h
    engines/sword25/gfx/renderobjectmanager.cpp
    engines/sword25/gfx/renderobjectmanager.h
    engines/sword25/gfx/rootrenderobject.h
    engines/sword25/gfx/staticbitmap.cpp
    engines/sword25/gfx/staticbitmap.h
    engines/sword25/gfx/text.cpp
    engines/sword25/gfx/text.h
    engines/sword25/module.mk
    engines/sword25/util/lua/ldo.cpp
    engines/sword25/util/lua/llex.cpp
    engines/sword25/util/lua/lua.h
    engines/sword25/util/lua/luaconf.h
    engines/teenagent/actor.cpp
    engines/teenagent/actor.h
    engines/teenagent/animation.cpp
    engines/teenagent/animation.h
    engines/teenagent/callbacks.cpp
    engines/teenagent/detection.cpp
    engines/teenagent/dialog.cpp
    engines/teenagent/dialog.h
    engines/teenagent/font.cpp
    engines/teenagent/font.h
    engines/teenagent/inventory.cpp
    engines/teenagent/inventory.h
    engines/teenagent/music.cpp
    engines/teenagent/music.h
    engines/teenagent/objects.cpp
    engines/teenagent/objects.h
    engines/teenagent/pack.cpp
    engines/teenagent/resources.cpp
    engines/teenagent/resources.h
    engines/teenagent/scene.cpp
    engines/teenagent/scene.h
    engines/teenagent/segment.h
    engines/teenagent/surface.cpp
    engines/teenagent/surface.h
    engines/teenagent/surface_list.cpp
    engines/teenagent/surface_list.h
    engines/teenagent/teenagent.cpp
    engines/teenagent/teenagent.h
    engines/testbed/config-params.cpp
    engines/testbed/config.cpp
    engines/testbed/detection.cpp
    engines/testbed/midi.cpp
    engines/testbed/sound.cpp
    engines/tinsel/actors.cpp
    engines/tinsel/anim.cpp
    engines/tinsel/bg.cpp
    engines/tinsel/bmv.cpp
    engines/tinsel/cursor.cpp
    engines/tinsel/detection.cpp
    engines/tinsel/detection_tables.h
    engines/tinsel/dialogs.cpp
    engines/tinsel/dw.h
    engines/tinsel/events.cpp
    engines/tinsel/events.h
    engines/tinsel/faders.cpp
    engines/tinsel/faders.h
    engines/tinsel/font.cpp
    engines/tinsel/graphics.cpp
    engines/tinsel/handle.cpp
    engines/tinsel/multiobj.cpp
    engines/tinsel/music.cpp
    engines/tinsel/object.cpp
    engines/tinsel/palette.cpp
    engines/tinsel/palette.h
    engines/tinsel/pcode.cpp
    engines/tinsel/play.cpp
    engines/tinsel/polygons.cpp
    engines/tinsel/rince.cpp
    engines/tinsel/saveload.cpp
    engines/tinsel/savescn.cpp
    engines/tinsel/scene.cpp
    engines/tinsel/sched.cpp
    engines/tinsel/sound.cpp
    engines/tinsel/sound.h
    engines/tinsel/strres.cpp
    engines/tinsel/text.cpp
    engines/tinsel/timers.cpp
    engines/tinsel/tinlib.cpp
    engines/tinsel/tinsel.cpp
    engines/tinsel/tinsel.h
    engines/toltecs/detection.cpp
    engines/toltecs/menu.cpp
    engines/toltecs/menu.h
    engines/toltecs/microtiles.cpp
    engines/toltecs/module.mk
    engines/toltecs/movie.cpp
    engines/toltecs/movie.h
    engines/toltecs/palette.cpp
    engines/toltecs/palette.h
    engines/toltecs/resource.cpp
    engines/toltecs/resource.h
    engines/toltecs/screen.cpp
    engines/toltecs/screen.h
    engines/toltecs/script.cpp
    engines/toltecs/script.h
    engines/toltecs/sound.cpp
    engines/toltecs/toltecs.cpp
    engines/toltecs/toltecs.h
    engines/tony/custom.cpp
    engines/tony/debugger.cpp
    engines/tony/detection.cpp
    engines/tony/detection_tables.h
    engines/tony/font.cpp
    engines/tony/font.h
    engines/tony/game.cpp
    engines/tony/game.h
    engines/tony/gfxcore.cpp
    engines/tony/gfxcore.h
    engines/tony/gfxengine.cpp
    engines/tony/globals.h
    engines/tony/input.cpp
    engines/tony/input.h
    engines/tony/inventory.cpp
    engines/tony/inventory.h
    engines/tony/loc.cpp
    engines/tony/loc.h
    engines/tony/mpal/expr.cpp
    engines/tony/mpal/expr.h
    engines/tony/mpal/loadmpc.cpp
    engines/tony/mpal/lzo.cpp
    engines/tony/mpal/memory.cpp
    engines/tony/mpal/mpal.cpp
    engines/tony/mpal/mpal.h
    engines/tony/mpal/mpaldll.h
    engines/tony/mpal/mpalutils.h
    engines/tony/resid.h
    engines/tony/sound.cpp
    engines/tony/tony.cpp
    engines/tony/tony.h
    engines/tony/tonychar.cpp
    engines/tony/window.cpp
    engines/tony/window.h
    engines/toon/anim.cpp
    engines/toon/console.cpp
    engines/toon/detection.cpp
    engines/toon/font.cpp
    engines/toon/toon.cpp
    engines/toon/toon.h
    engines/touche/console.cpp
    engines/touche/console.h
    engines/touche/detection.cpp
    engines/touche/menu.cpp
    engines/touche/resource.cpp
    engines/touche/touche.cpp
    engines/touche/touche.h
    engines/tsage/blue_force/blueforce_scenes9.cpp
    engines/tsage/converse.cpp
    engines/tsage/core.cpp
    engines/tsage/core.h
    engines/tsage/detection_tables.h
    engines/tsage/events.h
    engines/tsage/graphics.h
    engines/tsage/ringworld/ringworld_scenes3.cpp
    engines/tsage/ringworld2/ringworld2_scenes0.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/sound.cpp
    engines/tucker/console.cpp
    engines/tucker/detection.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_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_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_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.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_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_file.h
    engines/wintermute/base/file/base_file_entry.cpp
    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/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_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/particles/part_emitter.cpp
    engines/wintermute/base/particles/part_emitter.h
    engines/wintermute/base/particles/part_particle.cpp
    engines/wintermute/base/particles/part_particle.h
    engines/wintermute/base/saveload.cpp
    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_file.cpp
    engines/wintermute/base/scriptables/script_ext_file.h
    engines/wintermute/base/scriptables/script_ext_math.cpp
    engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
    engines/wintermute/base/scriptables/script_ext_mem_buffer.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/coll_templ.h
    engines/wintermute/dcgf.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/matrix4.cpp
    engines/wintermute/math/vector2.cpp
    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_registry.cpp
    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/string_util.cpp
    engines/wintermute/utils/utils.cpp
    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/wintermute.h
    graphics/decoders/bmp.h
    graphics/decoders/jpeg.cpp
    graphics/decoders/jpeg.h
    graphics/decoders/pict.cpp
    graphics/decoders/png.cpp
    graphics/decoders/png.h
    graphics/decoders/tga.h
    graphics/module.mk
    graphics/primitives.cpp
    graphics/primitives.h
    graphics/scaler.cpp
    graphics/scaler/aspect.cpp
    graphics/thumbnail.cpp
    graphics/thumbnail.h
    gui/ThemeEngine.h
    gui/ThemeParser.cpp
    gui/about.cpp
    gui/browser.cpp
    gui/browser.h
    gui/browser_osx.mm
    gui/credits.h
    gui/debugger.cpp
    gui/debugger.h
    gui/launcher.cpp
    gui/module.mk
    gui/options.cpp
    gui/options.h
    gui/predictivedialog.cpp
    gui/saveload-dialog.cpp
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/themes/translations.dat
    gui/widget.cpp
    gui/widgets/list.cpp
    gui/widgets/list.h
    gui/widgets/popup.cpp
    po/POTFILES
    po/ca_ES.po
    po/cs_CZ.po
    po/da_DA.po
    po/de_DE.po
    po/es_ES.po
    po/eu.po
    po/fr_FR.po
    po/gl_ES.po
    po/hu_HU.po
    po/it_IT.po
    po/nb_NO.po
    po/nn_NO.po
    po/pl_PL.po
    po/pt_BR.po
    po/ru_RU.po
    po/scummvm.pot
    po/se_SE.po
    po/uk_UA.po
    ports.mk
    test/common/bufferedseekablereadstream.h
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/bink_decoder.cpp
    video/bink_decoder.h
    video/codecs/cdtoons.h
    video/codecs/cinepak.cpp
    video/codecs/cinepak.h
    video/codecs/codec.h
    video/codecs/indeo3.h
    video/codecs/mjpeg.h
    video/codecs/msrle.h
    video/codecs/msvideo1.h
    video/codecs/qtrle.h
    video/codecs/rpza.cpp
    video/codecs/rpza.h
    video/codecs/smc.h
    video/codecs/svq1.cpp
    video/codecs/svq1.h
    video/codecs/truemotion1.h
    video/coktel_decoder.cpp
    video/flic_decoder.cpp
    video/flic_decoder.h
    video/psx_decoder.cpp
    video/qt_decoder.cpp
    video/qt_decoder.h
    video/smk_decoder.cpp
    video/smk_decoder.h
    video/theora_decoder.h
    video/video_decoder.cpp
    video/video_decoder.h



diff --cc engines/engines.mk
index 9c83433,b905a28..f58dba0
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@@ -125,11 -130,11 +130,16 @@@ DEFINES += -DENABLE_RIVE
  endif
  endif
  
+ ifdef ENABLE_NEVERHOOD
+ DEFINES += -DENABLE_NEVERHOOD=$(ENABLE_NEVERHOOD)
+ MODULES += engines/neverhood
+ endif
+ 
 +ifdef ENABLE_MORTEVIELLE
 +DEFINES += -DENABLE_MORTEVIELLE=$(ENABLE_MORTEVIELLE)
 +MODULES += engines/mortevielle
 +endif
 +
  ifdef ENABLE_PARALLACTION
  DEFINES += -DENABLE_PARALLACTION=$(ENABLE_PARALLACTION)
  MODULES += engines/parallaction


Commit: 0ce3b91a9c1cd45e51f3dac4a0791d299e6afd47
    https://github.com/scummvm/scummvm/commit/0ce3b91a9c1cd45e51f3dac4a0791d299e6afd47
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-26T14:16:49-07:00

Commit Message:
MORTEVIELLE: Remove useless static

Changed paths:
    engines/mortevielle/saveload.h



diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index 2152210..140b039 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -57,7 +57,7 @@ public:
 	Common::Error loadGame(int n);
 	Common::Error saveGame(int n, const Common::String &saveName);
 
-	static void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
+	void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
 	static bool readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header);
 	static Common::String generateSaveName(int slotNumber);
 	static SaveStateList listSaves(const char *target);


Commit: 79d5bbc1b8dc70017ba594b7883a53e4c773cd0d
    https://github.com/scummvm/scummvm/commit/79d5bbc1b8dc70017ba594b7883a53e4c773cd0d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-26T14:31:54-07:00

Commit Message:
MORTEVIELLE: Fix compilation

Changed paths:
    engines/mortevielle/detection_tables.h



diff --git a/engines/mortevielle/detection_tables.h b/engines/mortevielle/detection_tables.h
index 2b9a451..689fee1 100644
--- a/engines/mortevielle/detection_tables.h
+++ b/engines/mortevielle/detection_tables.h
@@ -33,7 +33,7 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 			AD_LISTEND
 		},
 		Common::FR_FRA,
-		Common::kPlatformPC,
+		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
@@ -47,7 +47,7 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 			AD_LISTEND
 		},
 		Common::FR_FRA,
-		Common::kPlatformPC,
+		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
@@ -61,7 +61,7 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 			AD_LISTEND
 		},
 		Common::DE_DEU,
-		Common::kPlatformPC,
+		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},
@@ -77,7 +77,7 @@ static const ADGameDescription MortevielleGameDescriptions[] = {
 			AD_LISTEND
 		},
 		Common::EN_ANY,
-		Common::kPlatformPC,
+		Common::kPlatformDOS,
 		ADGF_NO_FLAGS,
 		GUIO0()
 	},


Commit: feda6e9b2b5e55a0c88b66b26077da6438563982
    https://github.com/scummvm/scummvm/commit/feda6e9b2b5e55a0c88b66b26077da6438563982
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-27T11:19:27-07:00

Commit Message:
MORTEVIELLE: Move misc functions from Mortevielle to Utils

Changed paths:
  A engines/mortevielle/utils.cpp
    engines/mortevielle/module.mk
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 9cce597..e18657c 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -12,7 +12,8 @@ MODULE_OBJS := \
 	outtext.o \
 	saveload.o \
 	sound.o \
-	speech.o
+	speech.o \
+	utils.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_MORTEVIELLE), DYNAMIC_PLUGIN)
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 95750f5..6977ab4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -30,7 +30,6 @@
 #include "common/debug-channels.h"
 #include "engines/util.h"
 #include "engines/engine.h"
-#include "graphics/cursorman.h"
 #include "graphics/palette.h"
 #include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
@@ -43,31 +42,6 @@
 
 namespace Mortevielle {
 
-const byte tabdr[32] = {
-	32, 101, 115,  97, 114, 105, 110,
-	117, 116, 111, 108,  13, 100,  99,
-	112, 109,  46, 118, 130,  39, 102,
-	98,  44, 113, 104, 103,  33,  76,
-	85, 106,  30,  31
-};
-
-
-const byte tab30[32] = {
-	69,  67,  74, 138, 133, 120,  77, 122,
-	121,  68,  65,  63,  73,  80,  83,  82,
-	156,  45,  58,  79,  49,  86,  78,  84,
-	71,  81,  64,  66, 135,  34, 136,  91
-};
-
-
-
-const byte tab31[32]= {
-	93,  47,  48,  53,  50,  70, 124,  75,
-	72, 147, 140, 150, 151,  57,  56,  51,
-	107, 139,  55,  89, 131,  37,  54,  88,
-	119,   0,   0,   0,   0,   0,   0,   0
-};
-
 MortevielleEngine *g_vm;
 
 MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
@@ -339,213 +313,6 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataTyp
 	assert(dataSize == 0);
 }
 
-/**
- * Check is a key was pressed
- * It also delays the engine and check if the screen has to be updated
- * @remarks	Originally called 'keypressed'
- */
-bool MortevielleEngine::keyPressed() {
-	// Check for any pending key presses
-	handleEvents();
-
-	// Check if it's time to draw the next frame
-	if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
-		_lastGameFrame = g_system->getMillis();
-
-		_screenSurface.updateScreen();
-
-		_debugger.onFrame();
-	}
-
-	// Delay briefly to keep CPU usage down
-	g_system->delayMillis(5);
-
-	// Return if there are any pending key presses
-	return !_keypresses.empty();
-}
-
-/**
- * Wait for a keypress
- * @remarks	Originally called 'get_ch'
- */
-int MortevielleEngine::getChar() {
-	// If there isn't any pending keypress, wait until there is
-	while (!shouldQuit() && _keypresses.empty()) {
-		keyPressed();
-	}
-
-	// Return the top keypress
-	return shouldQuit() ? 0 : _keypresses.pop();
-}
-
-/**
- * Handle pending events
- * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
- * the mouse Y position is divided by 2 to keep the game thinking the Y goes from 0 - 199
- */
-bool MortevielleEngine::handleEvents() {
-	Common::Event event;
-	if (!g_system->getEventManager()->pollEvent(event))
-		return false;
-
-	switch (event.type) {
-	case Common::EVENT_LBUTTONDOWN:
-	case Common::EVENT_LBUTTONUP:
-	case Common::EVENT_MOUSEMOVE:
-		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
-		_mouse._pos.x = event.mouse.x;
-		_mouse._pos.y = event.mouse.y / 2;
-
-		if (event.type == Common::EVENT_LBUTTONDOWN)
-			_mouseClick = true;
-		else if (event.type == Common::EVENT_LBUTTONUP)
-			_mouseClick = false;
-
-		break;
-	case Common::EVENT_KEYDOWN:
-		addKeypress(event);
-		break;
-	default:
-		break;
-	}
-
-	return true;
-}
-
-/**
- * Add the specified key to the pending keypress stack
- */
-void MortevielleEngine::addKeypress(Common::Event &evt) {
-	// Character to add
-	char ch = evt.kbd.ascii;
-
-	// Check for debugger
-	if ((evt.kbd.keycode == Common::KEYCODE_d) && (evt.kbd.flags & Common::KBD_CTRL)) {
-		// Attach to the debugger
-		_debugger.attach();
-		_debugger.onFrame();
-	} else if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
-		// Handle alphabetic keys
-		if (evt.kbd.hasFlags(Common::KBD_CTRL))
-			ch = evt.kbd.keycode - Common::KEYCODE_a + 1;
-		else
-			ch = evt.kbd.keycode - Common::KEYCODE_a + 'A';
-	} else if ((evt.kbd.keycode >= Common::KEYCODE_F1) && (evt.kbd.keycode <= Common::KEYCODE_F12)) {
-		// Handle function keys
-		ch = 59 + evt.kbd.keycode - Common::KEYCODE_F1;
-	} else {
-		// Series of special cases
-		switch (evt.kbd.keycode) {
-		case Common::KEYCODE_KP4:
-		case Common::KEYCODE_LEFT:
-			ch = '4';
-			break;
-		case Common::KEYCODE_KP2:
-		case Common::KEYCODE_DOWN:
-			ch = '2';
-			break;
-		case Common::KEYCODE_KP6:
-		case Common::KEYCODE_RIGHT:
-			ch = '6';
-			break;
-		case Common::KEYCODE_KP8:
-		case Common::KEYCODE_UP:
-			ch = '8';
-			break;
-		case Common::KEYCODE_KP7:
-			ch = '7';
-			break;
-		case Common::KEYCODE_KP1:
-			ch = '1';
-			break;
-		case Common::KEYCODE_KP9:
-			ch = '9';
-			break;
-		case Common::KEYCODE_KP3:
-			ch = '3';
-			break;
-		case Common::KEYCODE_KP5:
-			ch = '5';
-			break;
-		case Common::KEYCODE_RETURN:
-			ch = '\13';
-			break;
-		case Common::KEYCODE_ESCAPE:
-			ch = '\33';
-			break;
-		default:
-			break;
-		}
-	}
-
-	if (ch != 0)
-		_keypresses.push(ch);
-}
-
-static byte CURSOR_ARROW_DATA[16 * 16] = {
-	0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x00, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0x0f, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-};
-
-/**
- * Initialise the mouse
- */
-void MortevielleEngine::initMouse() {
-	CursorMan.replaceCursor(CURSOR_ARROW_DATA, 16, 16, 0, 0, 0xff);
-	CursorMan.showMouse(true);
-
-	_mouse.initMouse();
-}
-
-/**
- * Sets the mouse position
- * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
- * the mouse Y position is doubled to convert from 0-199 to 0-399
- */
-void MortevielleEngine::setMousePos(const Common::Point &pt) {
-	// Adjust the passed position from simulated 640x200 to 640x400 co-ordinates
-	Common::Point newPoint(pt.x, (pt.y == 199) ? 399 : pt.y * 2);
-
-	if (newPoint != _mousePos)
-		// Warp the mouse to the new position
-		g_system->warpMouse(newPoint.x, newPoint.y);
-
-	// Save the new position
-	_mousePos = newPoint;
-}
-
-/**
- * Delay by a given amount
- */
-void MortevielleEngine::delay(int amount) {
-	uint32 endTime = g_system->getMillis() + amount;
-
-	while (g_system->getMillis() < endTime) {
-		if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
-			_lastGameFrame = g_system->getMillis();
-			_screenSurface.updateScreen();
-
-			_debugger.onFrame();
-		}
-
-		g_system->delayMillis(10);
-	}
-}
-
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
@@ -645,3188 +412,4 @@ void MortevielleEngine::playGame() {
 		askRestart();
 }
 
-/**
- * Waits for the user to select an action, and then handles it
- * @remarks	Originally called tecran
- */
-void MortevielleEngine::handleAction() {
-	const int lim = 20000;
-	int temps = 0;
-	char inkey = '\0';
-	bool oo, funct = 0;
-
-	clearVerbBar();
-	oo = false;
-	_controlMenu = 0;
-	if (!_keyPressedEsc) {
-		_menu.drawMenu();
-		_menu._menuDisplayed = true;
-		temps = 0;
-		_key = 0;
-		funct = false;
-		inkey = '.';
-
-		_inMainGameLoop = true;
-		do {
-			_menu.updateMenu();
-			prepareRoom();
-			_mouse.moveMouse(funct, inkey);
-			if (shouldQuit())
-				return;
-			++temps;
-		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
-		_inMainGameLoop = false;
-
-		_menu.eraseMenu();
-		_menu._menuDisplayed = false;
-		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
-			return;
-		}
-		if (_menu._menuSelected && (_msg[3] == MENU_SAVE)) {
-			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 15);
-			_savegameManager.saveGame(_msg[4] & 15, saveName);
-		}
-		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
-			_savegameManager.loadGame((_msg[4] & 15) - 1);
-		if (inkey == '\103') {       /* F9 */
-			temps = _dialogManager.show(_hintPctMessage, 1);
-			return;
-		} else if (inkey == '\77') {
-			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
-				_msg[4] = _menuOpcode;
-				displayTextInVerbBar(getEngineString(S_IDEM));
-			} else
-				return;
-		} else if (inkey == '\104') {
-			if ((_x != 0) && (_y != 0))
-				_num = 9999;
-			return;
-		}
-	}
-	if (inkey == '\73') {
-		_quitGame = true;
-		hourToChar();
-	} else {
-		if ((funct) && (inkey != '\77'))
-			return;
-		if (temps > lim) {
-			handleDescriptionText(2, 141);
-			if (_num == 9999)
-				_num = 0;
-		} else {
-			_menuOpcode = _msg[3];
-			if ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))
-				_menuOpcode = _msg[4];
-			if (!_anyone) {
-				if ((_heroSearching) || (_obpart)) {
-					if (_mouse._pos.y < 12)
-						return;
-
-					if ((_msg[4] == OPCODE_SOUND) || (_msg[4] == OPCODE_LIFT)) {
-						oo = true;
-						if ((_msg[4] == OPCODE_LIFT) || (_obpart)) {
-							endSearch();
-							_caff = _coreVar._currPlace;
-							_crep = 998;
-						} else
-							tsuiv();
-						mennor();
-					}
-				}
-			}
-			do {
-				if (! oo)
-					handleOpcode();
-
-				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
-					_text.taffich();
-					if (_destinationOk) {
-						_destinationOk = false;
-						drawPicture();
-					}
-					if ((!_syn) || (_col))
-						handleDescriptionText(2, _crep);
-				}
-			} while (_syn);
-			if (_controlMenu != 0)
-				displayControlMenu();
-		}
-	}
-}
-
-/**
- * Engine function - Init Places
- * @remarks	Originally called 'init_lieu'
- */
-void MortevielleEngine::loadPlaces() {
-	Common::File f;
-
-	if (!f.open("MXX.mor"))
-		if (!f.open("MFXX.mor"))
-			error("Missing file - MXX.mor");
-
-	for (int i = 0; i < 7; ++i) {
-		for (int j = 0; j < 25; ++j)
-			_destinationArray[i][j] = f.readByte();
-	}
-
-	f.close();
-}
-
-/**
- * Set Text Color
- * @remarks	Originally called 'text_color'
- */
-void MortevielleEngine::setTextColor(int col) {
-	_textColor = col;
-}
-
-/**
- * Prepare screen - Type 1!
- * @remarks	Originally called 'ecrf1'
- */
-void MortevielleEngine::prepareScreenType1() {
-	// Large drawing
-	_screenSurface.drawBox(0, 11, 512, 163, 15);
-}
-
-/**
- * Prepare room - Type 2!
- * @remarks	Originally called 'ecrf2'
- */
-void MortevielleEngine::prepareScreenType2() {
-	setTextColor(5);
-}
-
-/**
- * Prepare room - Type 3!
- * @remarks	Originally called 'ecrf7'
- */
-void MortevielleEngine::prepareScreenType3() {
-	setTextColor(4);
-}
-
-/**
- * Engine function - Update hour
- * @remarks	Originally called 'calch'
- */
-void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
-	int newHour = readclock();
-	int th = _currentHourCount + ((newHour - _currentDayHour) / _inGameHourDuration);
-	minute = ((th % 2) + _currHalfHour) * 30;
-	hour = ((uint)th >> 1) + _currHour;
-	if (minute == 60) {
-		minute = 0;
-		++hour;
-	}
-	day = (hour / 24) + _currDay;
-	hour = hour - ((day - _currDay) * 24);
-}
-
-/**
- * Engine function - Convert character index to bit index
- * @remarks	Originally called 'conv'
- */
-int MortevielleEngine::convertCharacterIndexToBitIndex(int characterIndex) {
-	return 128 >> (characterIndex - 1);
-}
-
-/**
- * Engine function - Convert bit index to character index
- * @remarks	Originally called 'tip'
- */
-int MortevielleEngine::convertBitIndexToCharacterIndex(int bitIndex) {
-	int retVal = 0;
-
-	if (bitIndex == 128)
-		retVal = 1;
-	else if (bitIndex == 64)
-		retVal = 2;
-	else if (bitIndex == 32)
-		retVal = 3;
-	else if (bitIndex == 16)
-		retVal = 4;
-	else if (bitIndex == 8)
-		retVal = 5;
-	else if (bitIndex == 4)
-		retVal = 6;
-	else if (bitIndex == 2)
-		retVal = 7;
-	else if (bitIndex == 1)
-		retVal = 8;
-
-	return retVal;
-}
-
-/**
- * Engine function - Reset presence in other rooms
- * @remarks	Originally called 't5'
- */
-void MortevielleEngine::resetPresenceInRooms(int roomId) {
-	if (roomId == DINING_ROOM)
-		_blo = false;
-
-	if (roomId != GREEN_ROOM) {
-		_roomPresenceLuc = false;
-		_roomPresenceIda = false;
-	}
-
-	if (roomId != PURPLE_ROOM)
-		_purpleRoomPresenceLeo = false;
-
-	if (roomId != DARKBLUE_ROOM) {
-		_roomPresenceGuy = false;
-		_roomPresenceEva = false;
-	}
-
-	if (roomId != BLUE_ROOM)
-		_roomPresenceMax = false;
-	if (roomId != RED_ROOM)
-		_roomPresenceBob = false;
-	if (roomId != GREEN_ROOM2)
-		_roomPresencePat = false;
-	if (roomId != TOILETS)
-		_toiletsPresenceBobMax = false;
-	if (roomId != BATHROOM)
-		_bathRoomPresenceBobMax = false;
-	if (roomId != ROOM9)
-		_room9PresenceLeo = false;
-}
-
-/**
- * Engine function - Show the people present in the given room
- * @remarks	Originally called 'affper'
- */
-void MortevielleEngine::showPeoplePresent(int bitIndex) {
-	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
-
-	for (int i = 1; i <= 8; ++i)
-		_menu.disableMenuItem(_menu._discussMenu[i]);
-
-	clearUpperRightPart();
-	if ((bitIndex & 128) == 128) {
-		_screenSurface.putxy(xp, 24);
-		_screenSurface.drawString("LEO", 4);
-		_menu.enableMenuItem(_menu._discussMenu[1]);
-	}
-	if ((bitIndex & 64) == 64) {
-		_screenSurface.putxy(xp, 32);
-		_screenSurface.drawString("PAT", 4);
-		_menu.enableMenuItem(_menu._discussMenu[2]);
-	}
-	if ((bitIndex & 32) == 32) {
-		_screenSurface.putxy(xp, 40);
-		_screenSurface.drawString("GUY", 4);
-		_menu.enableMenuItem(_menu._discussMenu[3]);
-	}
-	if ((bitIndex & 16) == 16) {
-		_screenSurface.putxy(xp, 48);
-		_screenSurface.drawString("EVA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[4]);
-	}
-	if ((bitIndex & 8) == 8) {
-		_screenSurface.putxy(xp, 56);
-		_screenSurface.drawString("BOB", 4);
-		_menu.enableMenuItem(_menu._discussMenu[5]);
-	}
-	if ((bitIndex & 4) == 4) {
-		_screenSurface.putxy(xp, 64);
-		_screenSurface.drawString("LUC", 4);
-		_menu.enableMenuItem(_menu._discussMenu[6]);
-	}
-	if ((bitIndex & 2) == 2) {
-		_screenSurface.putxy(xp, 72);
-		_screenSurface.drawString("IDA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[7]);
-	}
-	if ((bitIndex & 1) == 1) {
-		_screenSurface.putxy(xp, 80);
-		_screenSurface.drawString("MAX", 4);
-		_menu.enableMenuItem(_menu._discussMenu[8]);
-	}
-	_currBitIndex = bitIndex;
-}
-
-/**
- * Engine function - Select random characters
- * @remarks	Originally called 'choix'
- */
-int MortevielleEngine::selectCharacters(int min, int max) {
-	bool invertSelection = false;
-	int rand = getRandomNumber(min, max);
-
-	if (rand > 4) {
-		rand = 8 - rand;
-		invertSelection = true;
-	}
-
-	int i = 0;
-	int retVal = 0;
-	while (i < rand) {
-		int charIndex = getRandomNumber(1, 8);
-		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
-		if ((retVal & charBitIndex) != charBitIndex) {
-			++i;
-			retVal |= charBitIndex;
-		}
-	}
-	if (invertSelection)
-		retVal = 255 - retVal;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Green Room
- * @remarks	Originally called 'cpl1'
- */
-int MortevielleEngine::getPresenceStatsGreenRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	// The original uses an || instead of an &&, resulting
-	// in an always true condition. Based on the other tests,
-	// and on other scenes, we use an && instead.
-	if ((hour > 7) && (hour < 11))
-		retVal = 25;
-	else if ((hour > 10) && (hour < 14))
-		retVal = 35;
-	else if ((hour > 13) && (hour < 16))
-		retVal = 50;
-	else if ((hour > 15) && (hour < 18))
-		retVal = 5;
-	else if ((hour > 17) && (hour < 22))
-		retVal = 35;
-	else if ((hour > 21) && (hour < 24))
-		retVal = 50;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 70;
-
-	_menu.updateMenu();
-
-	return retVal;
-}
-/**
- * Engine function - Get Presence Statistics - Purple Room
- * @remarks	Originally called 'cpl2'
- */
-int MortevielleEngine::getPresenceStatsPurpleRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 7) && (hour < 11))
-		retVal = -2;
-	else if (hour == 11)
-		retVal = 100;
-	else if ((hour > 11) && (hour < 23))
-		retVal = 10;
-	else if (hour == 23)
-		retVal = 20;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 50;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Toilets
- * @remarks	Originally called 'cpl3'
- */
-int MortevielleEngine::getPresenceStatsToilets() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
-		retVal = 34;
-	else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
-		retVal = 0;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Blue Room
- * @remarks	Originally called 'cpl5'
- */
-int MortevielleEngine::getPresenceStatsBlueRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 6) && (hour < 10))
-		retVal = 0;
-	else if (hour == 10)
-		retVal = 100;
-	else if ((hour > 10) && (hour < 24))
-		retVal = 15;
-	else if ((hour >= 0) && (hour < 7))
-		retVal = 50;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Red Room
- * @remarks	Originally called 'cpl6'
- */
-int MortevielleEngine::getPresenceStatsRedRoom() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
-		retVal = -2;
-	else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
-		retVal = 35;
-	else if (hour == 17)
-		retVal = 100;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 60;
-
-	return retVal;
-}
-
-/**
- * Shows the "you are alone" message in the status area
- * on the right hand side of the screen
- * @remarks	Originally called 'person'
- */
-void MortevielleEngine::displayAloneText() {
-	for (int cf = 1; cf <= 8; ++cf)
-		_menu.disableMenuItem(_menu._discussMenu[cf]);
-
-	Common::String sYou = getEngineString(S_YOU);
-	Common::String sAre = getEngineString(S_ARE);
-	Common::String sAlone = getEngineString(S_ALONE);
-
-	clearUpperRightPart();
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
-	_screenSurface.drawString(sYou, 4);
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
-	_screenSurface.drawString(sAre, 4);
-	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
-	_screenSurface.drawString(sAlone, 4);
-
-	_currBitIndex = 0;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Bureau
- * @remarks	Originally called 'cpl10'
- */
-int MortevielleEngine::getPresenceStatsDiningRoom(int &hour) {
-	int day, minute;
-
-	int retVal = 0;
-	updateHour(day, hour, minute);
-	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		retVal = 100;
-	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
-		retVal = 45;
-	else if (((hour > 13) && (hour < 17)) || (hour == 18))
-		retVal = 35;
-	else if (hour == 17)
-		retVal = 60;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = 5;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Bureau
- * @remarks	Originally called 'cpl11'
- */
-int MortevielleEngine::getPresenceStatsBureau(int &hour) {
-	int day, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
-		retVal = 25;
-	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
-		retVal = 5;
-	else if ((hour > 13) && (hour < 17))
-		retVal = 55;
-	else if ((hour > 16) && (hour < 19))
-		retVal = 45;
-	else if ((hour >= 0) && (hour < 9))
-		retVal = 0;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Kitchen
- * @remarks	Originally called 'cpl12'
- */
-int MortevielleEngine::getPresenceStatsKitchen() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
-		retVal = 55;
-	else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
-		retVal = 25;
-	else if ((hour >= 0) && (hour < 5))
-		retVal = 0;
-	else if ((hour > 4) && (hour < 9))
-		retVal = 15;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Attic
- * @remarks	Originally called 'cpl13'
- */
-int MortevielleEngine::getPresenceStatsAttic() {
-	return 0;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Landing
- * @remarks	Originally called 'cpl15'
- */
-int MortevielleEngine::getPresenceStatsLanding() {
-	int day, hour, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if ((hour > 7) && (hour < 12))
-		retVal = 25;
-	else if ((hour > 11) && (hour < 14))
-		retVal = 0;
-	else if ((hour > 13) && (hour < 18))
-		retVal = 10;
-	else if ((hour > 17) && (hour < 20))
-		retVal = 55;
-	else if ((hour > 19) && (hour < 22))
-		retVal = 5;
-	else if ((hour > 21) && (hour < 24))
-		retVal = 15;
-	else if ((hour >= 0) && (hour < 8))
-		retVal = -15;
-
-	return retVal;
-}
-
-/**
- * Engine function - Get Presence Statistics - Room Chapel
- * @remarks	Originally called 'cpl20'
- */
-int MortevielleEngine::getPresenceStatsChapel(int &hour) {
-	int day, minute;
-	int retVal = 0;
-
-	updateHour(day, hour, minute);
-	if (hour == 10)
-		retVal = 65;
-	else if ((hour > 10) && (hour < 21))
-		retVal = 5;
-	else if ((hour > 20) && (hour < 24))
-		retVal = -15;
-	else if ((hour >= 0) && (hour < 5))
-		retVal = -300;
-	else if ((hour > 4) && (hour < 10))
-		retVal = -5;
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Green Room
- * @remarks	Originally called 'quelq1'
- */
-void MortevielleEngine::setPresenceGreenRoom(int roomId) {
-	int rand = getRandomNumber(1, 2);
-	if (roomId == GREEN_ROOM) {
-		if (rand == 1)
-			_roomPresenceLuc = true;
-		else
-			_roomPresenceIda = true;
-	} else if (roomId == DARKBLUE_ROOM) {
-		if (rand == 1)
-			_roomPresenceGuy = true;
-		else
-			_roomPresenceEva = true;
-	}
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Purple Room
- * @remarks	Originally called 'quelq2'
- */
-void MortevielleEngine::setPresencePurpleRoom() {
-	if (_place == PURPLE_ROOM)
-		_purpleRoomPresenceLeo = true;
-	else
-		_room9PresenceLeo = true;
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Blue Room
- * @remarks	Originally called 'quelq5'
- */
-void MortevielleEngine::setPresenceBlueRoom() {
-	_roomPresenceMax = true;
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Red Room
- * @remarks	Originally called 'quelq6'
- */
-void MortevielleEngine::setPresenceRedRoom(int roomId) {
-	if (roomId == RED_ROOM)
-		_roomPresenceBob = true;
-	else if (roomId == GREEN_ROOM2)
-		_roomPresencePat = true;
-
-	_currBitIndex = 10;
-}
-
-/**
- * Engine function - Check who is in the Dining Room
- * @remarks	Originally called 'quelq10'
- */
-int MortevielleEngine::setPresenceDiningRoom(int hour) {
-	int retVal = 0;
-
-	if ((hour >= 0) && (hour < 8))
-		retVal = checkLeoMaxRandomPresence();
-	else {
-		int min = 0, max = 0;
-		if ((hour > 7) && (hour < 10)) {
-			min = 5;
-			max = 7;
-		} else if ((hour > 9) && (hour < 12)) {
-			min = 1;
-			max = 4;
-		} else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
-			min = 6;
-			max = 8;
-		} else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
-			min = 1;
-			max = 5;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Bureau
- * @remarks	Originally called 'quelq11'
- */
-int MortevielleEngine::setPresenceBureau(int hour) {
-	int retVal = 0;
-
-	if ((hour >= 0) && (hour < 8))
-		retVal = checkLeoMaxRandomPresence();
-	else {
-		int min = 0, max = 0;
-		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
-			min = 1;
-			max = 3;
-		} else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
-			min = 1;
-			max = 4;
-		} else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
-			min = 1;
-			max = 2;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Kitchen
- * @remarks	Originally called 'quelq12'
- */
-int MortevielleEngine::setPresenceKitchen() {
-	int retVal = checkLeoMaxRandomPresence();
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the Landing
- * @remarks	Originally called 'quelq15'
- */
-int MortevielleEngine::setPresenceLanding() {
-	bool test = false;
-	int rand = 0;
-	do {
-		rand = getRandomNumber(1, 8);
-		test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
-		        ((rand == 2) && _roomPresencePat) ||
-		        ((rand == 3) && _roomPresenceGuy) ||
-		        ((rand == 4) && _roomPresenceEva) ||
-		        ((rand == 5) && _roomPresenceBob) ||
-		        ((rand == 6) && _roomPresenceLuc) ||
-		        ((rand == 7) && _roomPresenceIda) ||
-		        ((rand == 8) && _roomPresenceMax));
-	} while (test);
-
-	int retVal = convertCharacterIndexToBitIndex(rand);
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Check who is in the chapel
- * @remarks	Originally called 'quelq20'
- */
-int MortevielleEngine::setPresenceChapel(int hour) {
-	int retVal = 0;
-
-	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
-		retVal = checkLeoMaxRandomPresence();
-	else {
-		int min = 0, max = 0;
-		if ((hour > 9) && (hour < 12)) {
-			min = 3;
-			max = 7;
-		} else if ((hour > 11) && (hour < 18)) {
-			min = 1;
-			max = 2;
-		} else if (hour == 18) {
-			min = 2;
-			max = 4;
-		}
-		retVal = selectCharacters(min, max);
-	}
-	showPeoplePresent(retVal);
-
-	return retVal;
-}
-
-/**
- * Engine function - Get the answer after you known a door
- * @remarks	Originally called 'frap'
- */
-void MortevielleEngine::getKnockAnswer() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if ((hour >= 0) && (hour < 8))
-		_crep = 190;
-	else {
-		if (getRandomNumber(1, 100) > 70)
-			_crep = 190;
-		else
-			_crep = 147;
-	}
-}
-
-/**
- * Engine function - Get Room Presence Bit Index
- * @remarks	Originally called 'nouvp'
- */
-int MortevielleEngine::getPresenceBitIndex(int roomId) {
-	int bitIndex = 0;
-	if (roomId == GREEN_ROOM) {
-		if (_roomPresenceLuc)
-			bitIndex = 4;  // LUC
-		if (_roomPresenceIda)
-			bitIndex = 2;  // IDA
-	} else if ( ((roomId == PURPLE_ROOM) && (_purpleRoomPresenceLeo))
-			 || ((roomId == ROOM9) && (_room9PresenceLeo)))
-		bitIndex = 128;    // LEO
-	else if (roomId == DARKBLUE_ROOM) {
-		if (_roomPresenceGuy)
-			bitIndex = 32; // GUY
-		if (_roomPresenceEva)
-			bitIndex = 16; // EVA
-	} else if ((roomId == BLUE_ROOM) && (_roomPresenceMax))
-		bitIndex = 1;      // MAX
-	else if ((roomId == RED_ROOM) && (_roomPresenceBob))
-		bitIndex = 8;      // BOB
-	else if ((roomId == GREEN_ROOM2) && (_roomPresencePat))
-		bitIndex = 64;     // PAT
-	else if ( ((roomId == TOILETS) && (_toiletsPresenceBobMax))
-		   || ((roomId == BATHROOM) && (_bathRoomPresenceBobMax)) )
-		bitIndex = 9;      // BOB + MAX
-
-	if (bitIndex != 9)
-		showPeoplePresent(bitIndex);
-
-	return bitIndex;
-}
-
-/**
- * Engine function - initGame
- * @remarks	Originally called 'dprog'
- */
-void MortevielleEngine::initGame() {
-	_place = MANOR_FRONT;
-	_currentHourCount = 0;
-	if (!_coreVar._alreadyEnteredManor)
-		_blo = true;
-	_inGameHourDuration = kTime1;
-	_currentDayHour = readclock();
-}
-
-/**
- * Engine function - Set Random Presence - Green Room
- * @remarks	Originally called 'pl1'
- */
-void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
-	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
-	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
-		int p = getPresenceStatsGreenRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceGreenRoom(_place);
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Purple Room
- * @remarks	Originally called 'pl2'
- */
-void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
-	if (!_purpleRoomPresenceLeo) {
-		int p = getPresenceStatsPurpleRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresencePurpleRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Blue Room
- * @remarks	Originally called 'pl5'
- */
-void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
-	if (!_roomPresenceMax) {
-		int p = getPresenceStatsBlueRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceBlueRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Red Room
- * @remarks	Originally called 'pl6'
- */
-void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
-	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
-	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
-		int p = getPresenceStatsRedRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresenceRedRoom(_place);
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Room 9
- * @remarks	Originally called 'pl9'
- */
-void MortevielleEngine::setRandomPresenceRoom9(int cf) {
-	if (!_room9PresenceLeo) {
-		cf = -10;
-		int p, rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
-			displayAloneText();
-		else
-			setPresencePurpleRoom();
-	}
-}
-
-/**
- * Engine function - Set Random Presence - Dining Room
- * @remarks	Originally called 'pl10'
- */
-void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
-	int h, rand;
-	int p = getPresenceStatsDiningRoom(h);
-	phaz(rand, p, cf);
-
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceDiningRoom(h);
-}
-
-/**
- * Engine function - Set Random Presence - Bureau
- * @remarks	Originally called 'pl11'
- */
-void MortevielleEngine::setRandomPresenceBureau(int cf) {
-	int h, rand;
-
-	int p = getPresenceStatsBureau(h);
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceBureau(h);
-}
-
-/**
- * Engine function - Set Random Presence - Kitchen
- * @remarks	Originally called 'pl12'
- */
-void MortevielleEngine::setRandomPresenceKitchen(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsKitchen();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceKitchen();
-}
-
-/**
- * Engine function - Set Random Presence - Attic / Cellar
- * @remarks	Originally called 'pl13'
- */
-void MortevielleEngine::setRandomPresenceAttic(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsAttic();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceKitchen();
-}
-
-/**
- * Engine function - Set Random Presence - Landing
- * @remarks	Originally called 'pl15'
- */
-void MortevielleEngine::setRandomPresenceLanding(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsLanding();
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceLanding();
-}
-
-/**
- * Engine function - Set Random Presence - Chapel
- * @remarks	Originally called 'pl20'
- */
-void MortevielleEngine::setRandomPresenceChapel(int cf) {
-	int h, rand;
-
-	int p = getPresenceStatsChapel(h);
-	phaz(rand, p, cf);
-	if (rand > p)
-		displayAloneText();
-	else
-		setPresenceChapel(h);
-}
-
-/**
- * Start music or speech
- * @remarks	Originally called 'musique'
- */
-void MortevielleEngine::startMusicOrSpeech(int so) {
-	if (so == 0) {
-		/* musik(0) */
-		;
-	} else if ((!_introSpeechPlayed) && (!_coreVar._alreadyEnteredManor)) {
-		// Type 1: Speech
-		_speechManager.startSpeech(10, 1, 1);
-		_introSpeechPlayed = true;
-	} else {
-		if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
-			// Type 1: Speech
-			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
-		else if ((_coreVar._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
-			// Type 1: Speech
-			_speechManager.startSpeech(8, 1, 1);
-		else if ((_coreVar._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
-			// Type 1: Speech
-			_speechManager.startSpeech(12, 1, 1);
-		else if (_coreVar._currPlace == INSIDE_WELL)
-			// Type 1: Speech
-			_speechManager.startSpeech(13, 1, 1);
-		else
-			// Type 2 : music
-			_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
-	}
-}
-
-/**
- * Engine function - You lose!
- * @remarks	Originally called 'tperd'
- */
-void MortevielleEngine::loseGame() {
-	resetOpenObjects();
-	_roomDoorId = OWN_ROOM;
-	_mchai = 0;
-	_menu.unsetSearchMenu();
-	if (!_blo)
-		getPresence(MANOR_FRONT);
-
-	_loseGame = true;
-	clearUpperLeftPart();
-	_screenSurface.drawBox(60, 35, 400, 50, 15);
-	handleDescriptionText(9, _crep);
-	clearDescriptionBar();
-	clearVerbBar();
-	_col = false;
-	_syn = false;
-	_destinationOk = false;
-}
-
-/**
- * Engine function - Check inventory for a given object
- * @remarks	Originally called 'cherjer'
- */
-bool MortevielleEngine::checkInventory(int objectId) {
-	bool retVal = false;
-	for (int i = 1; i <= 6; ++i)
-		retVal = (retVal || (_coreVar._inventory[i] == objectId));
-
-	if (_coreVar._selectedObjectId == objectId)
-		retVal = true;
-
-	return retVal;
-}
-
-/**
- * Engine function - Display Dining Room
- * @remarks	Originally called 'st1sama'
- */
-void MortevielleEngine::displayDiningRoom() {
-	_coreVar._currPlace = DINING_ROOM;
-	affrep();
-}
-
-/**
- * Engine function - Start non interactive Dialog
- * @remarks	Originally called 'sparl'
- */
-void MortevielleEngine::startDialog(int16 rep) {
-	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
-	int key;
-
-	assert(rep >= 0);
-
-	_mouse.hideMouse();
-	Common::String dialogStr = getString(rep + kDialogStringIndex);
-	_text.displayStr(dialogStr, 230, 4, 65, 24, 5);
-	_dialogManager.drawF3F8();
-
-	key = 0;
-	do {
-		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
-		key = _dialogManager.waitForF3F8();
-		if (shouldQuit())
-			return;
-	} while (key != 66);
-	hirs();
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - End of Search: reset globals
- * @remarks	Originally called 'finfouill'
- */
-void MortevielleEngine::endSearch() {
-	_heroSearching = false;
-	_obpart = false;
-	_searchCount = 0;
-	_menu.unsetSearchMenu();
-}
-
-/**
- * Engine function - Go to Dining room
- * @remarks	Originally called 't1sama'
- */
-void MortevielleEngine::gotoDiningRoom() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if ((hour < 5) && (_coreVar._currPlace > ROOM18)) {
-		if (!checkInventory(137)) {        //You don't have the keys, and it's late
-			_crep = 1511;
-			loseGame();
-		} else
-			displayDiningRoom();
-	} else if (!_coreVar._alreadyEnteredManor) {     //Is it your first time?
-		_currBitIndex = 255; // Everybody is present
-		showPeoplePresent(_currBitIndex);
-		_caff = 77;
-		drawPictureWithText();
-		_screenSurface.drawBox(223, 47, 155, 91, 15);
-		handleDescriptionText(2, 33);
-		testKey(false);
-		mennor();
-		_mouse.hideMouse();
-		hirs();
-		premtet();
-		startDialog(140);
-		drawRightFrame();
-		drawClock();
-		_mouse.showMouse();
-		_coreVar._currPlace = OWN_ROOM;
-		affrep();
-		resetPresenceInRooms(DINING_ROOM);
-		if (!_blo)
-			getPresence(OWN_ROOM);
-		_currBitIndex = 0;
-		_savedBitIndex = 0;
-		_coreVar._alreadyEnteredManor = true;
-	} else
-		displayDiningRoom();
-}
-
-/**
- * Engine function - Check Manor distance (in the mountains)
- * @remarks	Originally called 't1neig'
- */
-void MortevielleEngine::checkManorDistance() {
-	++_manorDistance;
-	if (_manorDistance > 2) {
-		_crep = 1506;
-		loseGame();
-	} else {
-		_destinationOk = true;
-		_coreVar._currPlace = MOUNTAIN;
-		affrep();
-	}
-}
-
-/**
- * Engine function - Go to Manor front
- * @remarks	Originally called 't1deva'
- */
-void MortevielleEngine::gotoManorFront() {
-	_manorDistance = 0;
-	_coreVar._currPlace = MANOR_FRONT;
-	affrep();
-}
-
-/**
- * Engine function - Go to Manor back
- * @remarks	Originally called 't1derr'
- */
-void MortevielleEngine::gotoManorBack() {
-	_coreVar._currPlace = MANOR_BACK;
-	affrep();
-}
-
-/**
- * Engine function - Dead : Flooded in Well
- * @remarks	Originally called 't1deau'
- */
-void MortevielleEngine::floodedInWell() {
-	_crep = 1503;
-	loseGame();
-}
-
-/**
- * Engine function - Change Graphical Device
- * @remarks	Originally called 'change_gd'
- */
-void MortevielleEngine::changeGraphicalDevice(int newDevice) {
-	_mouse.hideMouse();
-	_currGraphicalDevice = newDevice;
-	hirs();
-	_mouse.initMouse();
-	_mouse.showMouse();
-	drawRightFrame();
-	prepareRoom();
-	drawClock();
-	if (_currBitIndex != 0)
-		showPeoplePresent(_currBitIndex);
-	else
-		displayAloneText();
-	clearDescriptionBar();
-	clearVerbBar();
-	_maff = 68;
-	drawPictureWithText();
-	handleDescriptionText(2, _crep);
-	_menu.displayMenu();
-}
-
-/**
- * Called when a savegame has been loaded.
- * @remarks	Originally called 'antegame'
- */
-void MortevielleEngine::gameLoaded() {
-	_mouse.hideMouse();
-	_menu._menuDisplayed = false;
-	_loseGame = true;
-	_anyone = false;
-	_destinationOk = true;
-	_col = false;
-	_hiddenHero = false;
-	_uptodatePresence = false;
-	_maff = 68;
-	_menuOpcode = OPCODE_NONE;
-	_introSpeechPlayed = false;
-	_x = 0;
-	_y = 0;
-	_num = 0;
-	_startHour = 0;
-	_endHour = 0;
-	_searchCount = 0;
-	_roomDoorId = OWN_ROOM;
-	_syn = true;
-	_heroSearching = true;
-	_mchai = 0;
-	_manorDistance = 0;
-	resetOpenObjects();
-	_takeObjCount = 0;
-	affrep();
-	_hintPctMessage = getString(580);
-
-	_destinationOk = false;
-	_endGame = true;
-	_loseGame = false;
-	_heroSearching = false;
-
-	displayAloneText();
-	prepareRoom();
-	drawClock();
-	drawPictureWithText();
-	handleDescriptionText(2, _crep);
-	clearVerbBar();
-	_endGame = false;
-	_menu.setDestinationText(_coreVar._currPlace);
-	_menu.setInventoryText();
-	if (_coreVar._selectedObjectId != 0)
-		displayItemInHand(_coreVar._selectedObjectId + 400);
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - Handle OpCodes
- * @remarks	Originally called 'tsitu'
- */
-void MortevielleEngine::handleOpcode() {
-	if (!_col)
-		clearDescriptionBar();
-	_syn = false;
-	_keyPressedEsc = false;
-	if (!_anyone) {
-		if (_uptodatePresence) {
-			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
-				_controlMenu = 4;
-				mennor();
-				return;
-			}
-		}
-		if (_msg[3] == MENU_MOVE)
-			fctMove();
-		if (_msg[3] == MENU_DISCUSS)
-			fctDiscuss();
-		if (_msg[3] == MENU_INVENTORY)
-			fctInventoryTake();
-		if (_msg[4] == OPCODE_ATTACH)
-			fctAttach();
-		if (_msg[4] == OPCODE_WAIT)
-			fctWait();
-		if (_msg[4] == OPCODE_FORCE)
-			fctForce();
-		if (_msg[4] == OPCODE_SLEEP)
-			fctSleep();
-		if (_msg[4] == OPCODE_LISTEN)
-			fctListen();
-		if (_msg[4] == OPCODE_ENTER)
-			fctEnter();
-		if (_msg[4] == OPCODE_CLOSE)
-			fctClose();
-		if (_msg[4] == OPCODE_SEARCH)
-			fctSearch();
-		if (_msg[4] == OPCODE_KNOCK)
-			fctKnock();
-		if (_msg[4] == OPCODE_SCRATCH)
-			fctScratch();
-		if (_msg[4] == OPCODE_READ)
-			fctRead();
-		if (_msg[4] == OPCODE_EAT)
-			fctEat();
-		if (_msg[4] == OPCODE_PLACE)
-			fctPlace();
-		if (_msg[4] == OPCODE_OPEN)
-			fctOpen();
-		if (_msg[4] == OPCODE_TAKE)
-			fctTake();
-		if (_msg[4] == OPCODE_LOOK)
-			fctLook();
-		if (_msg[4] == OPCODE_SMELL)
-			fctSmell();
-		if (_msg[4] == OPCODE_SOUND)
-			fctSound();
-		if (_msg[4] == OPCODE_LEAVE)
-			fctLeave();
-		if (_msg[4] == OPCODE_LIFT)
-			fctLift();
-		if (_msg[4] == OPCODE_TURN)
-			fctTurn();
-		if (_msg[4] == OPCODE_SSEARCH)
-			fctSelfSearch();
-		if (_msg[4] == OPCODE_SREAD)
-			fctSelfRead();
-		if (_msg[4] == OPCODE_SPUT)
-			fctSelfPut();
-		if (_msg[4] == OPCODE_SLOOK)
-			fctSelftLook();
-		_hiddenHero = false;
-
-		if (_msg[4] == OPCODE_SHIDE)
-			fctSelfHide();
-	} else {
-		if (_anyone) {
-			interactNPC();
-			_anyone = false;
-			mennor();
-			return;
-		}
-	}
-	int hour, day, minute;
-	updateHour(day, hour, minute);
-	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (_coreVar._currPlace != DINING_ROOM)) ||
-	        ((hour > 0) && (hour < 6) && (_coreVar._currPlace != OWN_ROOM)))
-		++_coreVar._faithScore;
-	if (((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace > MOUNTAIN)) && (_coreVar._currPlace != INSIDE_WELL)
-	        && (_coreVar._currPlace != OWN_ROOM) && (_coreVar._selectedObjectId != 152) && (!_loseGame)) {
-		if ((_coreVar._faithScore > 99) && (hour > 8) && (hour < 16)) {
-			_crep = 1501;
-			loseGame();
-		}
-		if ((_coreVar._faithScore > 99) && (hour > 0) && (hour < 9)) {
-			_crep = 1508;
-			loseGame();
-		}
-		if ((day > 1) && (hour > 8) && (!_loseGame)) {
-			_crep = 1502;
-			loseGame();
-		}
-	}
-	mennor();
-}
-
-/**
- * Engine function - Transform time into a char
- * @remarks	Originally called 'tmaj3'
- */
-void MortevielleEngine::hourToChar() {
-	int day, hour, minute;
-
-	updateHour(day, hour, minute);
-	if (minute == 30)
-		minute = 1;
-	hour += day * 24;
-	minute += hour * 2;
-	_coreVar._fullHour = chr(minute);
-}
-
-/**
- * Engine function - extract time from a char
- * @remarks	Originally called 'theure'
- */
-void MortevielleEngine::charToHour() {
-	int fullHour = ord(_coreVar._fullHour);
-	int tmpHour = fullHour % 48;
-	_currDay = fullHour / 48;
-	_currHalfHour = tmpHour % 2;
-	_currHour = tmpHour / 2;
-	_hour = _currHour;
-	if (_currHalfHour == 1)
-		_minute = 30;
-	else
-		_minute = 0;
-}
-
-/**
- * Engine function - Clear upper left part of Screen - Type 1
- * @remarks	Originally called 'clsf1'
- */
-void MortevielleEngine::clearUpperLeftPart() {
-	_mouse.hideMouse();
-	_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - Clear low bar used by description
- * @remarks	Originally called 'clsf2'
- */
-void MortevielleEngine::clearDescriptionBar() {
-	_mouse.hideMouse();
-	if (_largestClearScreen) {
-		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
-		_screenSurface.drawBox(0, 175, 634, 24, 15);
-		_largestClearScreen = false;
-	} else {
-		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
-		_screenSurface.drawBox(0, 175, 634, 15, 15);
-	}
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - Clear lowest bar used by verbs
- * @remarks	Originally called 'clsf3'
- */
-void MortevielleEngine::clearVerbBar() {
-	_mouse.hideMouse();
-	_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
-	_screenSurface.drawBox(0, 191, 634, 8, 15);
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - Clear upper right part of the screen
- * @remarks	Originally called 'clsf10'
- */
-void MortevielleEngine::clearUpperRightPart() {
-	int x1, x2;
-	Common::String st;
-
-	_mouse.hideMouse();
-	if (_resolutionScaler == 1) {
-		x2 = 634;
-		x1 = 534;
-	} else {
-		x2 = 600;
-		x1 = 544;
-	}
-	// Clear ambiance description
-	_screenSurface.fillRect(15, Common::Rect(x1, 93, x2, 98));
-	if (_coreVar._faithScore < 33)
-		st = getEngineString(S_COOL);
-	else if (_coreVar._faithScore < 66)
-		st = getEngineString(S_LOURDE);
-	else if (_coreVar._faithScore > 65)
-		st = getEngineString(S_MALSAINE);
-
-	x1 = 580 - (_screenSurface.getStringWidth(st) / 2);
-	_screenSurface.putxy(x1, 92);
-	_screenSurface.drawString(st, 4);
-
-	// Clear person list
-	_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
-	_mouse.showMouse();
-}
-
-/**
- * Engine function - Get a random number between two values
- * @remarks	Originally called 'get_random_number' and 'hazard'
- */
-int MortevielleEngine::getRandomNumber(int minval, int maxval) {
-	return _randomSource.getRandomNumber(maxval - minval) + minval;
-}
-
-/**
- * Engine function - Show alert "use move menu"
- * @remarks	Originally called 'aldepl'
- */
-void MortevielleEngine::showMoveMenuAlert() {
-	_dialogManager.show(getEngineString(S_USE_DEP_MENU), 1);
-}
-
-/**
- * The original engine used this method to display a starting text screen letting the player
- * select the graphics mode to use
- * @remarks	Originally called 'dialpre'
- */
-void MortevielleEngine::showConfigScreen() {
-	_crep = 998;
-}
-
-/**
- * Decodes a number of 64 byte blocks
- * @param pStart	Start of data
- * @param count		Number of 64 byte blocks
- * @remarks	Originally called 'zzuul'
- */
-void MortevielleEngine::decodeNumber(byte *pStart, int count) {
-	while (count-- > 0) {
-		for (int idx = 0; idx < 64; ++pStart, ++idx) {
-			uint16 v = ((*pStart - 0x80) << 1) + 0x80;
-
-			if (v & 0x8000)
-				*pStart = 0;
-			else if (v & 0xff00)
-				*pStart = 0xff;
-			else
-				*pStart = (byte)v;
-		}
-	}
-}
-
-void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
-	uint16 oct, ocd;
-
-	/* 5-8 */
-	oct = _inpBuffer[idx];
-	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
-	if (pt < 6) {
-		++idx;
-		oct = oct << (5 - pt);
-		pt += 11;
-		oct = oct | ((uint)_inpBuffer[idx] >> pt);
-	} else {
-		pt -= 5;
-		oct = (uint)oct >> pt;
-	}
-
-	switch (oct) {
-	case 11:
-		c = '$';
-		the_end = true;
-		break;
-	case 30:
-	case 31:
-		ocd = _inpBuffer[idx];
-		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
-		if (pt < 6) {
-			++idx;
-			ocd = ocd << (5 - pt);
-			pt += 11;
-			ocd = ocd | ((uint)_inpBuffer[idx] >> pt);
-		} else {
-			pt -= 5;
-			ocd = (uint)ocd >> pt;
-		}
-
-		if (oct == 30)
-			c = chr(tab30[ocd]);
-		else
-			c = chr(tab31[ocd]);
-
-		if (c == '\0') {
-			the_end = true;
-			c = '#';
-		}
-		break;
-	default:
-		c = chr(tabdr[oct]);
-		break;
-	}
-}
-
-/**
- * Decode and extract the line with the given Id
- * @remarks	Originally called 'deline'
- */
-Common::String MortevielleEngine::getString(int num) {
-	Common::String wrkStr = "";
-
-	if (num < 0) {
-		warning("getString(%d): num < 0! Skipping", num);
-	} else if (!_txxFileFl) {
-		wrkStr = getGameString(num);
-	} else {
-		int hint = _ntpBuffer[num]._hintId;
-		byte point = _ntpBuffer[num]._point;
-		int length = 0;
-		bool endFl = false;
-		char let;
-		do {
-			cinq_huit(let, hint, point, endFl);
-			wrkStr += let;
-			++length;
-		} while (!endFl);
-	}
-
-	while (wrkStr.lastChar() == '$')
-		// Remove trailing '$'s
-		wrkStr.deleteLastChar();
-
-	return wrkStr;
-}
-
-void MortevielleEngine::copcha() {
-	for (int i = kAcha; i < kAcha + 390; i++)
-		_tabdon[i] = _tabdon[i + 390];
-}
-
-/**
- * Engine function - When restarting the game, reset the main variables used by the engine
- * @remarks	Originally called 'inzon'
- */
-void MortevielleEngine::resetVariables() {
-	copcha();
-
-	_coreVar._alreadyEnteredManor = false;
-	_coreVar._selectedObjectId = 0;
-	_coreVar._cellarObjectId = 0;
-	_coreVar._atticBallHoleObjectId = 0;
-	_coreVar._atticRodHoleObjectId = 0;
-	_coreVar._wellObjectId = 0;
-	_coreVar._secretPassageObjectId = 0;
-	_coreVar._purpleRoomObjectId = 136;
-	_coreVar._cryptObjectId = 141;
-	_coreVar._faithScore = getRandomNumber(4, 10);
-	_coreVar._currPlace = MANOR_FRONT;
-
-	for (int i = 2; i <= 6; ++i)
-		_coreVar._inventory[i] = 0;
-
-	// Only object in inventory: a gun
-	_coreVar._inventory[1] = 113;
-
-	_coreVar._fullHour = chr(20);
-
-	for (int i = 1; i <= 10; ++i)
-		_coreVar._pctHintFound[i] = ' ';
-
-	for (int i = 1; i <= 6; ++i)
-		_coreVar._availableQuestion[i] = '*';
-
-	for (int i = 7; i <= 9; ++i)
-		_coreVar._availableQuestion[i] = ' ';
-
-	for (int i = 10; i <= 28; ++i)
-		_coreVar._availableQuestion[i] = '*';
-
-	for (int i = 29; i <= 42; ++i)
-		_coreVar._availableQuestion[i] = ' ';
-
-	_coreVar._availableQuestion[33] = '*';
-
-	for (int i = 1; i <= 8; ++i)
-		_nbrep[i] = 0;
-
-	init_nbrepm();
-}
-
-/**
- * Engine function - Set the palette
- * @remarks	Originally called 'writepal'
- */
-void MortevielleEngine::setPal(int n) {
-	switch (_currGraphicalDevice) {
-	case MODE_TANDY:
-	case MODE_EGA:
-	case MODE_AMSTRAD1512:
-		for (int i = 1; i <= 16; ++i) {
-			_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
-			_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
-		}
-		break;
-	case MODE_CGA: {
-		nhom pal[16];
-		for (int i = 0; i < 16; ++i) {
-			pal[i] = _cgaPal[n]._a[i];
-		}
-
-		if (n < 89)
-			palette(_cgaPal[n]._p);
-
-		for (int i = 0; i <= 15; ++i)
-			displayCGAPattern(i, _patternArr[pal[i]._id], pal);
-		}
-		break;
-	default:
-		break;
-	}
-}
-
-/**
- * Engine function - Display a CGA pattern, using a specified palette
- * @remarks	Originally called 'outbloc'
- */
-void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
-	int addr = n * 404 + 0xd700;
-
-	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr], p._tax);
-	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr + 2], p._tay);
-	addr += 4;
-	for (int i = 0; i < p._tax; ++i) {
-		for (int j = 0; j < p._tay; ++j)
-			_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
-	}
-}
-
-/**
- * Engine function - Load Palette from File
- * @remarks	Originally called 'charpal'
- */
-void MortevielleEngine::loadPalette() {
-	Common::File f;
-	byte b;
-
-	if (!f.open("fxx.mor")) {
-		if (f.open("mfxx.mor"))
-			f.seek(7 * 25);
-		else
-			error("Missing file - fxx.mor");
-	}
-
-	for (int i = 0; i < 108; ++i)
-		_fxxBuffer[i] = f.readSint16LE();
-	f.close();
-
-	if (!f.open("plxx.mor"))
-		error("Missing file - plxx.mor");
-	for (int i = 0; i <= 90; ++i) {
-		for (int j = 1; j <= 16; ++j) {
-			_stdPal[i][j].x = f.readByte();
-			_stdPal[i][j].y = f.readByte();
-		}
-	}
-	f.close();
-
-	if (!f.open("cxx.mor"))
-		error("Missing file - cxx.mor");
-
-	for (int j = 0; j <= 90; ++j) {
-		_cgaPal[j]._p = f.readByte();
-		for (int i = 0; i <= 15; ++i) {
-			nhom &with = _cgaPal[j]._a[i];
-
-			b = f.readByte();
-			with._id = (uint)b >> 4;
-			with._hom[0] = ((uint)b >> 2) & 3;
-			with._hom[1] = b & 3;
-		}
-	}
-
-	_cgaPal[10]._a[9] = _cgaPal[10]._a[5];
-	for (int j = 0; j <= 14; ++j) {
-		_patternArr[j]._tax = f.readByte();
-		_patternArr[j]._tay = f.readByte();
-		for (int i = 1; i <= 20; ++i) {
-			for (int k = 1; k <= 20; ++k)
-				_patternArr[j]._des[i][k] = f.readByte();
-		}
-	}
-	f.close();
-}
-
-/**
- * Engine function - Load Texts from File
- * @remarks	Originally called 'chartex'
- */
-void MortevielleEngine::loadTexts() {
-	Common::File inpFile;
-	Common::File ntpFile;
-
-	_txxFileFl = false;
-	if (getLanguage() == Common::EN_ANY) {
-		warning("English version expected - Switching to DAT file");
-		return;
-	}
-
-	if (!inpFile.open("TXX.INP")) {
-		if (!inpFile.open("TXX.MOR")) {
-			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-			return;
-		}
-	}
-	if (!ntpFile.open("TXX.NTP")) {
-		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-		return;
-	}
-
-	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {
-		warning("TXX file - Unexpected format - Switching to DAT file");
-		return;
-	}
-
-	for (int i = 0; i < inpFile.size() / 2; ++i)
-		_inpBuffer[i] = inpFile.readUint16LE();
-
-	inpFile.close();
-	_txxFileFl = true;
-
-	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		_ntpBuffer[i]._hintId = ntpFile.readSint16LE();
-		_ntpBuffer[i]._point = ntpFile.readByte();
-	}
-
-	ntpFile.close();
-
-}
-
-void MortevielleEngine::loadBRUIT5() {
-	Common::File f;
-
-	if (!f.open("bruit5"))
-		error("Missing file - bruit5");
-
-	f.read(&_mem[kAdrNoise5 * 16 + 0], 149 * 128);
-	f.close();
-}
-
-void MortevielleEngine::loadCFIEC() {
-	Common::File f;
-
-	if (!f.open("cfiec.mor")) {
-		if (!f.open("alcfiec.mor"))
-			error("Missing file - *cfiec.mor");
-	}
-
-	_cfiecBufferSize = ((f.size() / 128) + 1) * 128;
-	int32 fileSize = f.size();
-
-	if (!_reloadCFIEC)
-		_cfiecBuffer = (byte *)malloc(sizeof(byte) * _cfiecBufferSize);
-
-	for (int32 i = 0; i < fileSize; ++i)
-		_cfiecBuffer[i] = f.readByte();
-
-	for (int i = fileSize; i < _cfiecBufferSize; i++)
-		_cfiecBuffer[i] = 0;
-
-	f.close();
-
-	_reloadCFIEC = false;
-}
-
-
-void MortevielleEngine::loadCFIPH() {
-	Common::File f;
-
-	if (!f.open("cfiph.mor")) {
-		if (!f.open("alcfiph.mor"))
-			error("Missing file - *cfiph.mor");
-	}
-
-	_speechManager._cfiphBuffer = (int16 *)malloc(sizeof(int16) * (f.size() / 2));
-
-	for (int i = 0; i < (f.size() / 2); ++i)
-		_speechManager._cfiphBuffer[i] = f.readSint16LE();
-
-	f.close();
-}
-
-/**
- * Engine function - Play Music
- * @remarks	Originally called 'music'
- */
-void MortevielleEngine::music() {
-	if (_soundOff)
-		return;
-
-	_reloadCFIEC = true;
-
-	Common::File fic;
-	if (!fic.open("mort.img"))
-		error("Missing file - mort.img");
-
-	fic.read(&_mem[0x3800 * 16 + 0], 500);
-	fic.read(&_mem[0x47a0 * 16 + 0], 123);
-	fic.close();
-
-	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[0x5000 * 16], 623);
-	_addFix = (float)((kTempoMusic - 8)) / 256;
-	_speechManager.cctable(_speechManager._tbi);
-
-	bool fin = false;
-	int k = 0;
-	do {
-		fin = keyPressed();
-		_soundManager.musyc(_speechManager._tbi, 9958, kTempoMusic);
-		++k;
-		fin = fin | keyPressed() | (k >= 5);
-	} while (!fin);
-	while (keyPressed())
-		getChar();
-}
-
-/**
- * Engine function - Show title screen
- * @remarks	Originally called 'suite'
- */
-void MortevielleEngine::showTitleScreen() {
-	hirs();
-	handleDescriptionText(7, 2035);
-	_caff = 51;
-	_text.taffich();
-	testKeyboard();
-	if (_newGraphicalDevice != _currGraphicalDevice)
-		_currGraphicalDevice = _newGraphicalDevice;
-	hirs();
-	draw(kAdrDes, 0, 0);
-
-	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
-	_screenSurface.putxy(104 + 72 * _resolutionScaler, 185);
-	_screenSurface.drawString(cpr, 0);
-}
-
-/**
- * Draw picture
- * @remarks	Originally called 'dessine'
- */
-void MortevielleEngine::draw(int ad, int x, int y) {
-	_mouse.hideMouse();
-	setPal(_numpal);
-	pictout(ad, 0, x, y);
-	_mouse.showMouse();
-}
-
-/**
- * Draw right frame
- * @remarks	Originally called 'dessine_rouleau'
- */
-void MortevielleEngine::drawRightFrame() {
-	setPal(89);
-	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[0x7000 * 16 + 14] = 15;
-	}
-	_mouse.hideMouse();
-	pictout(0x73a2, 0, 0, 0);
-	_mouse.showMouse();
-}
-
-/**
- * Read the current system time
- */
-int MortevielleEngine::readclock() {
-	TimeDate dateTime;
-	g_system->getTimeAndDate(dateTime);
-
-	int m = dateTime.tm_min * 60;
-	int h = dateTime.tm_hour * 3600;
-	return h + m + dateTime.tm_sec;
-}
-
-/**
- * Engine function - Prepare room and hint string
- * @remarks	Originally called 'tinke'
- */
-void MortevielleEngine::prepareRoom() {
-	int day, hour, minute;
-
-	_anyone = false;
-	updateHour(day, hour, minute);
-	if (day != _day) {
-		_day = day;
-		int i = 0;
-		do {
-			++i;
-			if (_nbrepm[i] != 0)
-				--_nbrepm[i];
-			_nbrep[i] = 0;
-		} while (i != 8);
-	}
-	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
-		_hour = hour;
-		_minute = 0;
-		drawClock();
-		int hintCount = 0;
-		for (int i = 1; i <= 10; ++i) {
-			if (_coreVar._pctHintFound[i] == '*')
-				++hintCount;
-		}
-
-		Common::String pctStr;
-		if (hintCount == 10)
-			pctStr = "10";
-		else
-			pctStr = chr(hintCount + 48);
-
-		_hintPctMessage = "[1][";
-		_hintPctMessage += getEngineString(S_SHOULD_HAVE_NOTICED);
-		_hintPctMessage += pctStr;
-		_hintPctMessage += '0';
-		_hintPctMessage += getEngineString(S_NUMBER_OF_HINTS);
-		_hintPctMessage += "][";
-		_hintPctMessage += getEngineString(S_OK);
-		_hintPctMessage += ']';
-	}
-	if (minute > _minute) {
-		_minute = 30;
-		drawClock();
-	}
-	if (_mouse._pos.y < 12)
-		return;
-
-	if (!_blo) {
-		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
-			_inGameHourDuration = kTime2;
-		else
-			_inGameHourDuration = kTime1;
-		if ((_coreVar._faithScore > 33) && (_coreVar._faithScore < 66))
-			_inGameHourDuration -= (_inGameHourDuration / 3);
-
-		if (_coreVar._faithScore > 65)
-			_inGameHourDuration -= ((_inGameHourDuration / 3) * 2);
-
-		int newHour = readclock();
-		if ((newHour - _currentDayHour) > _inGameHourDuration) {
-			bool activeMenu = _menu._menuActive;
-			_menu.eraseMenu();
-			_currentHourCount += ((newHour - _currentDayHour) / _inGameHourDuration);
-			_currentDayHour = newHour;
-			switch (_place) {
-			case GREEN_ROOM:
-			case DARKBLUE_ROOM:
-				setRandomPresenceGreenRoom(_coreVar._faithScore);
-				break;
-			case PURPLE_ROOM:
-				setRandomPresencePurpleRoom(_coreVar._faithScore);
-				break;
-			case BLUE_ROOM:
-				setRandomPresenceBlueRoom(_coreVar._faithScore);
-				break;
-			case RED_ROOM:
-			case GREEN_ROOM2:
-				setRandomPresenceRedRoom(_coreVar._faithScore);
-				break;
-			case ROOM9:
-				setRandomPresenceRoom9(_coreVar._faithScore);
-				break;
-			case DINING_ROOM:
-				setRandomPresenceDiningRoom(_coreVar._faithScore);
-				break;
-			case BUREAU:
-				setRandomPresenceBureau(_coreVar._faithScore);
-				break;
-			case KITCHEN:
-				setRandomPresenceKitchen(_coreVar._faithScore);
-				break;
-			case ATTIC:
-			case CELLAR:
-				setRandomPresenceAttic(_coreVar._faithScore);
-				break;
-			case LANDING:
-			case ROOM26:
-				setRandomPresenceLanding(_coreVar._faithScore);
-				break;
-			case CHAPEL:
-				setRandomPresenceChapel(_coreVar._faithScore);
-				break;
-			}
-			if ((_savedBitIndex != 0) && (_currBitIndex != 10))
-				_savedBitIndex = _currBitIndex;
-
-			if ((_savedBitIndex == 0) && (_currBitIndex > 0)) {
-				if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR)) {
-					initCaveOrCellar();
-				} else if (_currBitIndex == 10) {
-					_currBitIndex = 0;
-					if (!_uptodatePresence) {
-						_uptodatePresence = true;
-						_startHour = readclock();
-						if (getRandomNumber(1, 5) < 5) {
-							clearVerbBar();
-							prepareScreenType2();
-							displayTextInVerbBar(getEngineString(S_HEAR_NOISE));
-							int rand = (getRandomNumber(0, 4)) - 2;
-							_speechManager.startSpeech(1, rand, 1);
-							clearVerbBar();
-						}
-					}
-				}
-			}
-
-			if (activeMenu)
-				_menu.drawMenu();
-		}
-	}
-	_endHour = readclock();
-	if ((_uptodatePresence) && ((_endHour - _startHour) > 17)) {
-		getPresenceBitIndex(_place);
-		_uptodatePresence = false;
-		_startHour = 0;
-		if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
-			_anyone = true;
-	}
-}
-
-/**
- * Engine function - Draw Clock
- * @remarks	Originally called 'pendule'
- */
-void MortevielleEngine::drawClock() {
-	const int cv[2][12] = {
-		{  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
-		{ -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
-	};
-	const int x = 580;
-	const int y = 123;
-	const int rg = 9;
-	int hourColor;
-
-	_mouse.hideMouse();
-
-	_screenSurface.drawRectangle(570, 118, 20, 10);
-	_screenSurface.drawRectangle(578, 114, 6, 18);
-	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
-		hourColor = 0;
-	else
-		hourColor = 1;
-
-	if (_minute == 0)
-		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y - rg), hourColor);
-	else
-		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y + rg), hourColor);
-
-	int hour12 = _hour;
-	if (hour12 > 12)
-		hour12 -= 12;
-	if (hour12 == 0)
-		hour12 = 12;
-
-	_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * _resolutionScaler, y + cv[1][hour12 - 1], hourColor);
-	_mouse.showMouse();
-	_screenSurface.putxy(568, 154);
-
-	if (_hour > 11)
-		_screenSurface.drawString("PM ", 1);
-	else
-		_screenSurface.drawString("AM ", 1);
-
-	_screenSurface.putxy(550, 160);
-	if ((_day >= 0) && (_day <= 8)) {
-		Common::String tmp = getEngineString(S_DAY);
-		tmp.insertChar((char)(_day + 49), 0);
-		_screenSurface.drawString(tmp, 1);
-	}
-}
-
-void MortevielleEngine::palette(int v1) {
-	warning("TODO: palette");
-}
-
-/**
- * Returns a substring of the given string
- * @param s		Source string
- * @param idx	Starting index (1 based)
- * @param size	Number of characters to return
- */
-
-Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t size) {
-	// Copy the substring into a temporary buffer
-	char *tmp = new char[size + 1];
-	strncpy(tmp, s.c_str() + idx - 1, size);
-	tmp[size] = '\0';
-
-	Common::String result(tmp);
-	delete[] tmp;
-	return result;
-}
-
-void MortevielleEngine::hirs() {
-	// Note: The original used this to set the graphics mode and clear the screen, both at
-	// the start of the game, and whenever the screen need to be cleared. As such, this
-	// method is deprecated in favour of clearing the screen
-	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
-
-	if (_currGraphicalDevice == MODE_TANDY) {
-		_screenSurface.fillRect(0, Common::Rect(0, 0, 639, 200));
-		_resolutionScaler = 1;
-	} else if (_currGraphicalDevice == MODE_CGA) {
-		palette(1);
-		_resolutionScaler = 1;
-	} else
-		_resolutionScaler = 2;
-
-	_screenSurface.clearScreen();
-}
-
-/**
- * Init room : Cave or Cellar
- * @remarks	Originally called 'cavegre'
- */
-void MortevielleEngine::initCaveOrCellar() {
-	_coreVar._faithScore += 2;
-	if (_coreVar._faithScore > 69)
-		_coreVar._faithScore += (_coreVar._faithScore / 10);
-	clearVerbBar();
-	prepareScreenType2();
-	displayTextInVerbBar(getEngineString(S_SOMEONE_ENTERS));
-	int rand = (getRandomNumber(0, 4)) - 2;
-	_speechManager.startSpeech(2, rand, 1);
-
-	// The original was doing here a useless loop.
-	// It has been removed
-
-	clearVerbBar();
-	displayAloneText();
-}
-
-/**
- * Display control menu string
- * @remarks	Originally called 'tctrm'
- */
-void MortevielleEngine::displayControlMenu() {
-	handleDescriptionText(2, (3000 + _controlMenu));
-	_controlMenu = 0;
-}
-
-void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
-	GfxSurface surface;
-	surface.decode(&_mem[seg * 16 + dep]);
-
-	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[0x7000 * 16 + 2] = 0;
-		_mem[0x7000 * 16 + 32] = 15;
-	}
-
-	if ((_caff != 51) && (READ_LE_UINT16(&_mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&_mem[0x7000 * 16 + 0x4138], 0x100);
-
-	_screenSurface.drawPicture(surface, x, y);
-}
-
-void MortevielleEngine::adzon() {
-	Common::File f;
-
-	if (!f.open("don.mor"))
-		error("Missing file - don.mor");
-
-	f.read(_tabdon, 7 * 256);
-	f.close();
-
-	if (!f.open("bmor.mor"))
-		error("Missing file - bmor.mor");
-
-	f.read(&_tabdon[kFleche], 1 * 1916);
-	f.close();
-
-	if (!f.open("dec.mor"))
-		error("Missing file - dec.mor");
-
-	f.read(&_mem[0x73a2 * 16 + 0], 1 * 1664);
-	f.close();
-}
-
-/**
- * Returns the offset within the compressed image data resource of the desired image
- */
-int MortevielleEngine::animof(int ouf, int num) {
-	int nani = _mem[kAdrAni * 16 + 1];
-	int aux = num;
-	if (ouf != 1)
-		aux += nani;
-
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[kAdrAni * 16 + (aux << 1)]);
-
-	return animof_result;
-}
-
-/**
- * Display text in description bar
- * @remarks	Originally called 'text1'
- */
-void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int mesgId) {
-	int co;
-
-	if (_resolutionScaler == 1)
-		co = 10;
-	else
-		co = 6;
-	Common::String tmpStr = getString(mesgId);
-	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
-		y = 176;
-	_text.displayStr(tmpStr, x, y, nb, 20, _textColor);
-}
-
-/**
- * Display description text
- * @remarks	Originally called 'repon'
- */
-void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
-	if ((mesgId > 499) && (mesgId < 563)) {
-		Common::String tmpStr = getString(mesgId - 501 + kInventoryStringIndex);
-
-		if ((int) tmpStr.size() > ((58 + (_resolutionScaler - 1) * 37) << 1))
-			_largestClearScreen = true;
-		else
-			_largestClearScreen = false;
-
-		clearDescriptionBar();
-		_text.displayStr(tmpStr, 8, 176, 85, 3, 5);
-	} else {
-		mapMessageId(mesgId);
-		switch (f) {
-		case 2:
-		case 8:
-			clearDescriptionBar();
-			prepareScreenType2();
-			displayTextInDescriptionBar(8, 182, 103, mesgId);
-			if ((mesgId == 68) || (mesgId == 69))
-				_coreVar._availableQuestion[40] = '*';
-			if ((mesgId == 104) && (_caff == CELLAR)) {
-				_coreVar._availableQuestion[36] = '*';
-				if (_coreVar._availableQuestion[39] == '*') {
-					_coreVar._pctHintFound[3] = '*';
-					_coreVar._availableQuestion[38] = '*';
-				}
-			}
-			break;
-		case 1:
-		case 6:
-		case 9: {
-			int i;
-			if ((f == 1) || (f == 6))
-				i = 4;
-			else
-				i = 5;
-
-			Common::String tmpStr = getString(mesgId);
-			_text.displayStr(tmpStr, 80, 40, 60, 25, i);
-
-			if (mesgId == 180)
-				_coreVar._pctHintFound[6] = '*';
-			else if (mesgId == 179)
-				_coreVar._pctHintFound[10] = '*';
-			}
-			break;
-		default:
-			break;
-		}
-	}
-}
-
-/**
- * Recompute message Id
- * @remarks	Originally called 'modif'
- */
-void MortevielleEngine::mapMessageId(int &mesgId) {
-	if (mesgId == 26)
-		mesgId = 25;
-	else if ((mesgId > 29) && (mesgId < 36))
-		mesgId -= 4;
-	else if ((mesgId > 69) && (mesgId < 78))
-		mesgId -= 37;
-	else if ((mesgId > 99) && (mesgId < 194))
-		mesgId -= 59;
-	else if ((mesgId > 996) && (mesgId < 1000))
-		mesgId -= 862;
-	else if ((mesgId > 1500) && (mesgId < 1507))
-		mesgId -= 1363;
-	else if ((mesgId > 1507) && (mesgId < 1513))
-		mesgId -= 1364;
-	else if ((mesgId > 1999) && (mesgId < 2002))
-		mesgId -= 1851;
-	else if (mesgId == 2010)
-		mesgId = 151;
-	else if ((mesgId > 2011) && (mesgId < 2025))
-		mesgId -= 1860;
-	else if (mesgId == 2026)
-		mesgId = 165;
-	else if ((mesgId > 2029) && (mesgId < 2037))
-		mesgId -= 1864;
-	else if ((mesgId > 3000) && (mesgId < 3005))
-		mesgId -= 2828;
-	else if (mesgId == 4100)
-		mesgId = 177;
-	else if (mesgId == 4150)
-		mesgId = 178;
-	else if ((mesgId > 4151) && (mesgId < 4156))
-		mesgId -= 3973;
-	else if (mesgId == 4157)
-		mesgId = 183;
-	else if ((mesgId == 4160) || (mesgId == 4161))
-		mesgId -= 3976;
-}
-
-/**
- * Initialize open objects array
- * @remarks	Originally called 'initouv'
- */
-void MortevielleEngine::resetOpenObjects() {
-	for (int cx = 1; cx <= 7; ++cx)
-		_openObjects[cx] = 0;
-	_openObjCount = 0;
-}
-
-void MortevielleEngine::ecr2(Common::String text) {
-	// Some dead code was present in the original: removed
-	_screenSurface.putxy(8, 177);
-	int tlig = 59 + (_resolutionScaler - 1) * 36;
-
-	if ((int)text.size() < tlig)
-		_screenSurface.drawString(text, 5);
-	else if ((int)text.size() < (tlig << 1)) {
-		_screenSurface.putxy(8, 176);
-		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
-		_screenSurface.putxy(8, 182);
-		_screenSurface.drawString(copy(text, tlig, tlig << 1), 5);
-	} else {
-		_largestClearScreen = true;
-		clearDescriptionBar();
-		_screenSurface.putxy(8, 176);
-		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
-		_screenSurface.putxy(8, 182);
-		_screenSurface.drawString(copy(text, tlig, ((tlig << 1) - 1)), 5);
-		_screenSurface.putxy(8, 190);
-		_screenSurface.drawString(copy(text, tlig << 1, tlig * 3), 5);
-	}
-}
-
-void MortevielleEngine::displayTextInVerbBar(Common::String text) {
-	clearVerbBar();
-	_screenSurface.putxy(8, 192);
-	_screenSurface.drawString(text, 5);
-}
-
-/**
- * Display item in hand
- * @remarks	Originally called 'modobj'
- */
-void MortevielleEngine::displayItemInHand(int objId) {
-	Common::String strp = Common::String(' ');
-
-	if (objId != 500)
-		strp = getString(objId - 501 + kInventoryStringIndex);
-
-	_menu.setText(_menu._inventoryMenu[8], strp);
-	_menu.disableMenuItem(_menu._inventoryMenu[8]);
-}
-
-/**
- * Display empty hand
- * @remarks	Originally called 'maivid'
- */
-void MortevielleEngine::displayEmptyHand() {
-	_coreVar._selectedObjectId = 0;
-	displayItemInHand(500);
-}
-
-/**
- * Set a random presence: Leo or Max
- * @remarks	Originally called 'chlm'
- */
-int MortevielleEngine::checkLeoMaxRandomPresence() {
-	int retval = getRandomNumber(1, 2);
-	if (retval == 2)
-		retval = 128;
-
-	return retval;
-}
-
-/**
- * Reset room variables
- * @remarks	Originally called 'debloc'
- */
-void MortevielleEngine::resetRoomVariables(int roomId) {
-	_num = 0;
-	_x = 0;
-	_y = 0;
-	if ((roomId != ROOM26) && (roomId != LANDING))
-		resetPresenceInRooms(roomId);
-	_savedBitIndex = _currBitIndex;
-}
-
-/**
- * Compute presence stats
- * @remarks	Originally called 'ecfren'
- */
-int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
-	if (roomId == OWN_ROOM)
-		displayAloneText();
-	int retVal = -500;
-	rand = 0;
-	if ( ((roomId == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
-	  || ((roomId == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) )
-		retVal = getPresenceStatsGreenRoom();
-	if ((roomId == PURPLE_ROOM) && (!_purpleRoomPresenceLeo) && (!_room9PresenceLeo))
-		retVal = getPresenceStatsPurpleRoom();
-	if ( ((roomId == TOILETS) && (!_toiletsPresenceBobMax))
-	  || ((roomId == BATHROOM) && (!_bathRoomPresenceBobMax)) )
-		retVal = getPresenceStatsToilets();
-	if ((roomId == BLUE_ROOM) && (!_roomPresenceMax))
-		retVal = getPresenceStatsBlueRoom();
-	if ( ((roomId == RED_ROOM) && (!_roomPresenceBob))
-	  || ((roomId == GREEN_ROOM2) && (!_roomPresencePat)))
-		retVal = getPresenceStatsRedRoom();
-	if ((roomId == ROOM9) && (!_room9PresenceLeo) && (!_purpleRoomPresenceLeo))
-		retVal = 10;
-	if ( ((roomId == PURPLE_ROOM) && (_room9PresenceLeo))
-	  || ((roomId == ROOM9) && (_purpleRoomPresenceLeo)))
-		retVal = -400;
-	if (retVal != -500) {
-		retVal += cf;
-		rand = getRandomNumber(1, 100);
-	}
-
-	return retVal;
-}
-
-/**
- * Set presence flags
- * @remarks	Originally called 'becfren'
- */
-void MortevielleEngine::setPresenceFlags(int roomId) {
-	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
-		int rand = getRandomNumber(1, 2);
-		if (roomId == GREEN_ROOM) {
-			if (rand == 1)
-				_roomPresenceLuc = true;
-			else
-				_roomPresenceIda = true;
-		} else { // roomId == DARKBLUE_ROOM
-			if (rand == 1)
-				_roomPresenceGuy = true;
-			else
-				_roomPresenceEva = true;
-		}
-	} else if (roomId == PURPLE_ROOM)
-		_purpleRoomPresenceLeo = true;
-	else if (roomId == TOILETS)
-		_toiletsPresenceBobMax = true;
-	else if (roomId == BLUE_ROOM)
-		_roomPresenceMax = true;
-	else if (roomId == RED_ROOM)
-		_roomPresenceBob = true;
-	else if (roomId == BATHROOM)
-		_bathRoomPresenceBobMax = true;
-	else if (roomId == GREEN_ROOM2)
-		_roomPresencePat = true;
-	else if (roomId == ROOM9)
-		_room9PresenceLeo = true;
-}
-
-void MortevielleEngine::init_nbrepm() {
-	static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
-
-	for (int idx = 0; idx < 9; ++idx)
-		_nbrepm[idx] = ipm[idx];
-}
-
-void MortevielleEngine::phaz(int &rand, int &p, int cf) {
-	p += cf;
-	rand = getRandomNumber(1, 100);
-}
-
-/**
- * Get Presence
- * @remarks	Originally called 't11'
- */
-int MortevielleEngine::getPresence(int roomId) {
-	int retVal = 0;
-	int rand;
-
-	int p = getPresenceStats(rand, _coreVar._faithScore, roomId);
-	_place = roomId;
-	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
-		if (p != -500) {
-			if (rand > p) {
-				displayAloneText();
-				retVal = 0;
-			} else {
-				setPresenceFlags(_place);
-				retVal = getPresenceBitIndex(_place);
-			}
-		} else
-			retVal = getPresenceBitIndex(_place);
-	}
-
-	if (roomId > ROOM9) {
-		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != ROOM26))
-			displayAloneText();
-		else {
-			int h = 0;
-			if (roomId == DINING_ROOM)
-				p = getPresenceStatsDiningRoom(h);
-			else if (roomId == BUREAU)
-				p = getPresenceStatsBureau(h);
-			else if (roomId == KITCHEN)
-				p = getPresenceStatsKitchen();
-			else if ((roomId == ATTIC) || (roomId == CELLAR))
-				p = getPresenceStatsAttic();
-			else if ((roomId == LANDING) || (roomId == ROOM26))
-				p = getPresenceStatsLanding();
-			else if (roomId == CHAPEL)
-				p = getPresenceStatsChapel(h);
-			p += _coreVar._faithScore;
-			rand = getRandomNumber(1, 100);
-			if (rand > p) {
-				displayAloneText();
-				retVal = 0;
-			} else {
-				if (roomId == DINING_ROOM)
-					p = setPresenceDiningRoom(h);
-				else if (roomId == BUREAU)
-					p = setPresenceBureau(h);
-				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
-					p = setPresenceKitchen();
-				else if ((roomId == LANDING) || (roomId == ROOM26))
-					p = setPresenceLanding();
-				else if (roomId == CHAPEL)
-					p = setPresenceChapel(h);
-				retVal = p;
-			}
-		}
-	}
-
-	return retVal;
-}
-
-void MortevielleEngine::writetp(Common::String s, int t) {
-	if (_resolutionScaler == 2)
-		_screenSurface.drawString(s, t);
-	else
-		_screenSurface.drawString(copy(s, 1, 25), t);
-}
-
-void MortevielleEngine::aniof(int ouf, int num) {
-	if ((_caff == BATHROOM) && ((num == 4) || (num == 5)))
-		return;
-
-	if ((_caff == DINING_ROOM) && (num == 7))
-		num = 6;
-	else if (_caff == KITCHEN) {
-		if (num == 3)
-			num = 4;
-		else if (num == 4)
-			num = 3;
-	}
-
-	int ad = kAdrAni;
-	int offset = animof(ouf, num);
-
-	GfxSurface surface;
-	surface.decode(&_mem[ad * 16 + offset]);
-	_screenSurface.drawPicture(surface, 0, 12);
-
-	prepareScreenType1();
-}
-
-/**
- * Draw Picture
- * @remarks	Originally called 'dessin'
- */
-void MortevielleEngine::drawPicture() {
-	clearUpperLeftPart();
-	if (_caff > 99) {
-		draw(kAdrDes, 60, 33);
-		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
-	} else if (_caff > 69) {
-		draw(kAdrDes, 112, 48);           // Heads
-		_screenSurface.drawBox(222, 47, 155, 91, 15);
-	} else {
-		draw(kAdrDes, 0, 12);
-		prepareScreenType1();
-		if ((_caff < 30) || (_caff > 32)) {
-			for (int cx = 1; cx <= 6; ++cx) {
-				if (_openObjects[cx] != 0)
-					aniof(1, _openObjects[cx]);
-			}
-
-			if (_caff == ATTIC) {
-				if (_coreVar._atticBallHoleObjectId == 141)
-					aniof(1, 7);
-
-				if (_coreVar._atticRodHoleObjectId == 159)
-					aniof(1, 6);
-			} else if ((_caff == CELLAR) && (_coreVar._cellarObjectId == 151))
-				aniof(1, 2);
-			else if ((_caff == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143))
-				aniof(1, 1);
-			else if ((_caff == WELL) && (_coreVar._wellObjectId != 0))
-				aniof(1, 1);
-		}
-
-		if (_caff < ROOM26)
-			startMusicOrSpeech(1);
-	}
-}
-
-void MortevielleEngine::drawPictureWithText() {
-	_text.taffich();
-	drawPicture();
-	_destinationOk = false;
-}
-
-/**
- * Engine function - Place
- * @remarks	Originally called 'tkey1'
- */
-void MortevielleEngine::testKey(bool d) {
-	bool quest = false;
-	int x, y;
-	bool click;
-
-	_mouse.hideMouse();
-	fenat('K');
-
-	// Wait for release from any key or mouse button
-	while (keyPressed())
-		_key = testou();
-
-	do {
-		_mouse.getMousePosition(x, y, click);
-		keyPressed();
-	} while (click);
-
-	// Event loop
-	do {
-		if (d)
-			prepareRoom();
-		quest = keyPressed();
-		_mouse.getMousePosition(x, y, click);
-		if (shouldQuit())
-			return;
-	} while (!(quest || (click) || (d && _anyone)));
-	if (quest)
-		testou();
-	setMouseClick(false);
-	_mouse.showMouse();
-}
-
-void MortevielleEngine::tlu(int af, int ob) {
-	_caff = 32;
-	drawPictureWithText();
-	handleDescriptionText(6, ob + 4000);
-	handleDescriptionText(2, 999);
-	testKey(true);
-	_caff = af;
-	_msg[3] = OPCODE_NONE;
-	_crep = 998;
-}
-
-void MortevielleEngine::affrep() {
-	_caff = _coreVar._currPlace;
-	_crep = _coreVar._currPlace;
-}
-
-/**
- * Exit room
- * @remarks	Originally called 'tsort'
- */
-void MortevielleEngine::exitRoom() {
-	if ((_openObjCount > 0) && (_coreVar._currPlace != OWN_ROOM)) {
-		if (_coreVar._faithScore < 50)
-			_coreVar._faithScore += 2;
-		else
-			_coreVar._faithScore += (_coreVar._faithScore / 10);
-	}
-
-	resetOpenObjects();
-
-	_roomDoorId = OWN_ROOM;
-	_mchai = 0;
-	resetRoomVariables(_coreVar._currPlace);
-}
-
-/**
- * get 'read' description
- * @remarks	Originally called 'st4'
- */
-void MortevielleEngine::getReadDescription(int objId) {
-	_crep = 997;
-
-	switch (objId) {
-	case 114 :
-		_crep = 109;
-		break;
-	case 110 :
-		_crep = 107;
-		break;
-	case 158 :
-		_crep = 113;
-		break;
-	case 152:
-	case 153:
-	case 154:
-	case 155:
-	case 156:
-	case 150:
-	case 100:
-	case 157:
-	case 160:
-	case 161 :
-		tlu(_caff, objId);
-		break;
-	default:
-		break;
-	}
-}
-
-/**
- * get 'search' description
- * @remarks	Originally called 'st7'
- */
-void MortevielleEngine::getSearchDescription(int objId) {
-	switch (objId) {
-	case 116:
-	case 144:
-		_crep = 104;
-		break;
-	case 126:
-	case 111:
-		_crep = 108;
-		break;
-	case 132:
-		_crep = 111;
-		break;
-	case 142:
-		_crep = 112;
-		break;
-	default:
-		_crep = 183;
-		getReadDescription(objId);
-	}
-}
-
-void MortevielleEngine::mennor() {
-	_menu.menuUp(_msg[3]);
-}
-
-void MortevielleEngine::premtet() {
-	draw(kAdrDes, 10, 80);
-	_screenSurface.drawBox(18, 79, 155, 91, 15);
-}
-
-void MortevielleEngine::ajchai() {
-	int cy = kAcha + ((_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-	} while ((cx <= 9) && (_tabdon[cy + cx] != 0));
-
-	if (_tabdon[cy + cx] == 0)
-		_tabdon[cy + cx] = _coreVar._selectedObjectId;
-	else
-		_crep = 192;
-}
-
-/**
- * Check if inventory is full and, if not, add object in it.
- * @remarks	Originally called 'ajjer'
- */
-void MortevielleEngine::addObjectToInventory(int objectId) {
-	int i = 0;
-	do {
-		++i;
-	} while ((i <= 5) && (_coreVar._inventory[i] != 0));
-
-	if (_coreVar._inventory[i] == 0) {
-		_coreVar._inventory[i] = objectId;
-		_menu.setInventoryText();
-	} else
-		// Inventory is full
-		_crep = 139;
-}
-
-/**
- * Interact with NPC
- * @remarks	Originally called 'quelquun'
- */
-void MortevielleEngine::interactNPC() {
-	if (_menu._menuDisplayed)
-		_menu.eraseMenu();
-
-	endSearch();
-	_crep = 997;
-L1:
-	if (!_hiddenHero) {
-		if (_crep == 997)
-			_crep = 138;
-		handleDescriptionText(2, _crep);
-		if (_crep == 138)
-			_speechManager.startSpeech(5, 2, 1);
-		else
-			_speechManager.startSpeech(4, 4, 1);
-
-		if (_openObjCount == 0)
-			_coreVar._faithScore += 2;
-		else if (_coreVar._faithScore < 50)
-			_coreVar._faithScore += 4;
-		else
-			_coreVar._faithScore += 3 * (_coreVar._faithScore / 10);
-		exitRoom();
-		_menu.setDestinationText(LANDING);
-		int cx = convertBitIndexToCharacterIndex(_currBitIndex);
-		_caff = 69 + cx;
-		_crep = _caff;
-		_msg[3] = MENU_DISCUSS;
-		_msg[4] = _menu._discussMenu[cx];
-		_syn = true;
-		_col = true;
-	} else {
-		if (getRandomNumber(1, 3) == 2) {
-			_hiddenHero = false;
-			_crep = 137;
-			goto L1;
-		} else {
-			handleDescriptionText(2, 136);
-			int rand = (getRandomNumber(0, 4)) - 2;
-			_speechManager.startSpeech(3, rand, 1);
-			clearDescriptionBar();
-			displayAloneText();
-			resetRoomVariables(MANOR_FRONT);
-			affrep();
-		}
-	}
-	if (_menu._menuDisplayed)
-		_menu.drawMenu();
-}
-
-void MortevielleEngine::tsuiv() {
-	int tbcl;
-	int cy = kAcha + ((_mchai - 1) * 10) - 1;
-	int cx = 0;
-	do {
-		++cx;
-		++_searchCount;
-		int cl = cy + _searchCount;
-		tbcl = _tabdon[cl];
-	} while ((tbcl == 0) && (_searchCount <= 9));
-
-	if ((tbcl != 0) && (_searchCount < 11)) {
-		_caff = tbcl;
-		_crep = _caff + 400;
-		if (_currBitIndex != 0)
-			_coreVar._faithScore += 2;
-	} else {
-		affrep();
-		endSearch();
-		if (cx > 9)
-			_crep = 131;
-	}
-}
-
-void MortevielleEngine::tfleche() {
-	bool qust;
-	char touch;
-
-	if (_num == 9999)
-		return;
-
-	fenat(chr(152));
-	bool inRect = false;
-	do {
-		touch = '\0';
-
-		do {
-			_mouse.moveMouse(qust, touch);
-			if (shouldQuit())
-				return;
-
-			if (getMouseClick())
-				inRect = (_mouse._pos.x < 256 * _resolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
-			prepareRoom();
-		} while (!(qust || inRect || _anyone));
-
-		if (qust && (touch == '\103'))
-			_dialogManager.show(_hintPctMessage, 1);
-	} while (!((touch == '\73') || ((touch == '\104') && (_x != 0) && (_y != 0)) || (_anyone) || (inRect)));
-
-	if (touch == '\73')
-		_keyPressedEsc = true;
-
-	if (inRect) {
-		_x = _mouse._pos.x;
-		_y = _mouse._pos.y;
-	}
-}
-
-/**
- * Set coordinates
- * @remarks	Originally called 'tcoord'
- */
-void MortevielleEngine::setCoordinates(int sx) {
-	int sy, ix, iy;
-	int ib;
-
-
-	_num = 0;
-	_crep = 999;
-	int a = 0;
-	int atdon = kAmzon + 3;
-	int cy = 0;
-	while (cy < _caff) {
-		a += _tabdon[atdon];
-		atdon += 4;
-		++cy;
-	}
-
-	if (_tabdon[atdon] == 0) {
-		_crep = 997;
-		return;
-	}
-
-	a += kFleche;
-	int cb = 0;
-	for (cy = 0; cy <= (sx - 2); ++cy) {
-		ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
-		cb += (ib * 4) + 2;
-	}
-	ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
-	if (ib == 0) {
-		_crep = 997;
-		return;
-	}
-
-	cy = 1;
-	do {
-		cb += 2;
-		sx = _tabdon[a + cb] * _resolutionScaler;
-		sy = _tabdon[(a + cb + 1)];
-		cb += 2;
-		ix = _tabdon[a + cb] * _resolutionScaler;
-		iy = _tabdon[(a + cb + 1)];
-		++cy;
-	} while (!(((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) || (cy > ib)));
-
-	if ((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) {
-		_num = cy - 1;
-		return;
-	}
-
-	_crep = 997;
-}
-
-void MortevielleEngine::treg(int objId) {
-	int mdes = _caff;
-	_caff = objId;
-
-	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_msg[4] == OPCODE_SLOOK)) {
-		drawPictureWithText();
-		if ((_caff > 29) && (_caff < 33))
-			handleDescriptionText(2, _caff);
-		else
-			handleDescriptionText(2, _caff + 400);
-		testKey(true);
-		_caff = mdes;
-		_msg[3] = 0;
-		_crep = 998;
-	} else {
-		_obpart = true;
-		_crep = _caff + 400;
-		_menu.setSearchMenu();
-	}
-}
-
-/**
- * Engine function - Put in hand
- * @remarks	Originally called 'avpoing'
- */
-void MortevielleEngine::putInHand(int &objId) {
-	_crep = 999;
-	if (_coreVar._selectedObjectId != 0)
-		addObjectToInventory(_coreVar._selectedObjectId);
-
-	// If inventory wasn't full
-	if (_crep != 139) {
-		displayItemInHand(objId + 400);
-		_coreVar._selectedObjectId = objId;
-		objId = 0;
-	}
-}
-
-void MortevielleEngine::rechai(int &ch) {
-	int tmpPlace = _coreVar._currPlace;
-
-	if (_coreVar._currPlace == CRYPT)
-		tmpPlace = CELLAR;
-	ch = _tabdon[kAchai + (tmpPlace * 7) + _num - 1];
-}
-
-/**
- * Check before leaving the secret passage
- * @remarks	Originally called 't23coul'
- */
-int MortevielleEngine::checkLeaveSecretPassage() {
-	if (!checkInventory(143)) {
-		_crep = 1512;
-		loseGame();
-	}
-
-	return CELLAR;
-}
-
-void MortevielleEngine::fenat(char ans) {
-	int coul;
-
-	_mouse.hideMouse();
-	if (_currGraphicalDevice == MODE_CGA)
-		coul = 2;
-	else if (_currGraphicalDevice == MODE_HERCULES)
-		coul = 1;
-	else
-		coul = 12;
-
-	_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
-	_screenSurface.drawBox(300, 191, 16, 8, 15);
-	_mouse.showMouse();
-}
-
-/**
- * Test Keyboard
- * @remarks	Originally called 'teskbd'
- */
-void MortevielleEngine::testKeyboard() {
-	if (keyPressed())
-		testou();
-}
-
-int MortevielleEngine::testou() {
-	char ch = getChar();
-
-	switch (ch)  {
-	case '\23' :
-		_soundOff = !_soundOff;
-		break;
-	case '\26' :
-		if ((_x26KeyCount == 1) || (_x26KeyCount == 2)) {
-			decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
-			++_x26KeyCount;
-
-			return 61;
-		}
-		break;
-	case '\33' :
-		if (keyPressed())
-			ch = getChar();
-		break;
-	default:
-		break;
-	}
-
-	return ord(ch);
-}
-
-void MortevielleEngine::sauvecr(int y, int dy) {
-//	_mouse.hideMouse();
-//	_mouse.showMouse();
-}
-
-void MortevielleEngine::charecr(int y, int dy) {
-//	_mouse.hideMouse();
-//	_mouse.showMouse();
-}
-
 } // End of namespace Mortevielle
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
new file mode 100644
index 0000000..f2d0c95
--- /dev/null
+++ b/engines/mortevielle/utils.cpp
@@ -0,0 +1,3454 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/*
+ * This code is based on original Mortville Manor DOS source code
+ * Copyright (c) 1987-1989 Lankhor
+ */
+
+#include "common/scummsys.h"
+#include "graphics/cursorman.h"
+
+#include "mortevielle/dialogs.h"
+#include "mortevielle/menu.h"
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mouse.h"
+#include "mortevielle/outtext.h"
+#include "mortevielle/speech.h"
+
+namespace Mortevielle {
+
+/**
+ * Check is a key was pressed
+ * It also delays the engine and check if the screen has to be updated
+ * @remarks	Originally called 'keypressed'
+ */
+bool MortevielleEngine::keyPressed() {
+	// Check for any pending key presses
+	handleEvents();
+
+	// Check if it's time to draw the next frame
+	if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
+		_lastGameFrame = g_system->getMillis();
+
+		_screenSurface.updateScreen();
+
+		_debugger.onFrame();
+	}
+
+	// Delay briefly to keep CPU usage down
+	g_system->delayMillis(5);
+
+	// Return if there are any pending key presses
+	return !_keypresses.empty();
+}
+
+/**
+ * Wait for a keypress
+ * @remarks	Originally called 'get_ch'
+ */
+int MortevielleEngine::getChar() {
+	// If there isn't any pending keypress, wait until there is
+	while (!shouldQuit() && _keypresses.empty()) {
+		keyPressed();
+	}
+
+	// Return the top keypress
+	return shouldQuit() ? 0 : _keypresses.pop();
+}
+
+/**
+ * Handle pending events
+ * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
+ * the mouse Y position is divided by 2 to keep the game thinking the Y goes from 0 - 199
+ */
+bool MortevielleEngine::handleEvents() {
+	Common::Event event;
+	if (!g_system->getEventManager()->pollEvent(event))
+		return false;
+
+	switch (event.type) {
+	case Common::EVENT_LBUTTONDOWN:
+	case Common::EVENT_LBUTTONUP:
+	case Common::EVENT_MOUSEMOVE:
+		_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
+		_mouse._pos.x = event.mouse.x;
+		_mouse._pos.y = event.mouse.y / 2;
+
+		if (event.type == Common::EVENT_LBUTTONDOWN)
+			_mouseClick = true;
+		else if (event.type == Common::EVENT_LBUTTONUP)
+			_mouseClick = false;
+
+		break;
+	case Common::EVENT_KEYDOWN:
+		addKeypress(event);
+		break;
+	default:
+		break;
+	}
+
+	return true;
+}
+
+/**
+ * Add the specified key to the pending keypress stack
+ */
+void MortevielleEngine::addKeypress(Common::Event &evt) {
+	// Character to add
+	char ch = evt.kbd.ascii;
+
+	// Check for debugger
+	if ((evt.kbd.keycode == Common::KEYCODE_d) && (evt.kbd.flags & Common::KBD_CTRL)) {
+		// Attach to the debugger
+		_debugger.attach();
+		_debugger.onFrame();
+	} else if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
+		// Handle alphabetic keys
+		if (evt.kbd.hasFlags(Common::KBD_CTRL))
+			ch = evt.kbd.keycode - Common::KEYCODE_a + 1;
+		else
+			ch = evt.kbd.keycode - Common::KEYCODE_a + 'A';
+	} else if ((evt.kbd.keycode >= Common::KEYCODE_F1) && (evt.kbd.keycode <= Common::KEYCODE_F12)) {
+		// Handle function keys
+		ch = 59 + evt.kbd.keycode - Common::KEYCODE_F1;
+	} else {
+		// Series of special cases
+		switch (evt.kbd.keycode) {
+		case Common::KEYCODE_KP4:
+		case Common::KEYCODE_LEFT:
+			ch = '4';
+			break;
+		case Common::KEYCODE_KP2:
+		case Common::KEYCODE_DOWN:
+			ch = '2';
+			break;
+		case Common::KEYCODE_KP6:
+		case Common::KEYCODE_RIGHT:
+			ch = '6';
+			break;
+		case Common::KEYCODE_KP8:
+		case Common::KEYCODE_UP:
+			ch = '8';
+			break;
+		case Common::KEYCODE_KP7:
+			ch = '7';
+			break;
+		case Common::KEYCODE_KP1:
+			ch = '1';
+			break;
+		case Common::KEYCODE_KP9:
+			ch = '9';
+			break;
+		case Common::KEYCODE_KP3:
+			ch = '3';
+			break;
+		case Common::KEYCODE_KP5:
+			ch = '5';
+			break;
+		case Common::KEYCODE_RETURN:
+			ch = '\13';
+			break;
+		case Common::KEYCODE_ESCAPE:
+			ch = '\33';
+			break;
+		default:
+			break;
+		}
+	}
+
+	if (ch != 0)
+		_keypresses.push(ch);
+}
+
+
+static byte CURSOR_ARROW_DATA[16 * 16] = {
+	0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x00, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0x0f, 0x0f, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+/**
+ * Initialize the mouse
+ */
+void MortevielleEngine::initMouse() {
+	CursorMan.replaceCursor(CURSOR_ARROW_DATA, 16, 16, 0, 0, 0xff);
+	CursorMan.showMouse(true);
+
+	_mouse.initMouse();
+}
+
+/**
+ * Sets the mouse position
+ * @remarks		Since the ScummVM screen surface is double height to handle 640x200 using 640x400,
+ * the mouse Y position is doubled to convert from 0-199 to 0-399
+ */
+void MortevielleEngine::setMousePos(const Common::Point &pt) {
+	// Adjust the passed position from simulated 640x200 to 640x400 co-ordinates
+	Common::Point newPoint(pt.x, (pt.y == 199) ? 399 : pt.y * 2);
+
+	if (newPoint != _mousePos)
+		// Warp the mouse to the new position
+		g_system->warpMouse(newPoint.x, newPoint.y);
+
+	// Save the new position
+	_mousePos = newPoint;
+}
+
+/**
+ * Delay by a given amount
+ */
+void MortevielleEngine::delay(int amount) {
+	uint32 endTime = g_system->getMillis() + amount;
+
+	while (g_system->getMillis() < endTime) {
+		if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
+			_lastGameFrame = g_system->getMillis();
+			_screenSurface.updateScreen();
+
+			_debugger.onFrame();
+		}
+
+		g_system->delayMillis(10);
+	}
+}
+
+/**
+ * Waits for the user to select an action, and then handles it
+ * @remarks	Originally called tecran
+ */
+void MortevielleEngine::handleAction() {
+	const int lim = 20000;
+	int temps = 0;
+	char inkey = '\0';
+	bool oo, funct = 0;
+
+	clearVerbBar();
+	oo = false;
+	_controlMenu = 0;
+	if (!_keyPressedEsc) {
+		_menu.drawMenu();
+		_menu._menuDisplayed = true;
+		temps = 0;
+		_key = 0;
+		funct = false;
+		inkey = '.';
+
+		_inMainGameLoop = true;
+		do {
+			_menu.updateMenu();
+			prepareRoom();
+			_mouse.moveMouse(funct, inkey);
+			if (shouldQuit())
+				return;
+			++temps;
+		} while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
+		_inMainGameLoop = false;
+
+		_menu.eraseMenu();
+		_menu._menuDisplayed = false;
+		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
+			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
+			return;
+		}
+		if (_menu._menuSelected && (_msg[3] == MENU_SAVE)) {
+			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 15);
+			_savegameManager.saveGame(_msg[4] & 15, saveName);
+		}
+		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
+			_savegameManager.loadGame((_msg[4] & 15) - 1);
+		if (inkey == '\103') {       /* F9 */
+			temps = _dialogManager.show(_hintPctMessage, 1);
+			return;
+		} else if (inkey == '\77') {
+			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
+				_msg[4] = _menuOpcode;
+				displayTextInVerbBar(getEngineString(S_IDEM));
+			} else
+				return;
+		} else if (inkey == '\104') {
+			if ((_x != 0) && (_y != 0))
+				_num = 9999;
+			return;
+		}
+	}
+	if (inkey == '\73') {
+		_quitGame = true;
+		hourToChar();
+	} else {
+		if ((funct) && (inkey != '\77'))
+			return;
+		if (temps > lim) {
+			handleDescriptionText(2, 141);
+			if (_num == 9999)
+				_num = 0;
+		} else {
+			_menuOpcode = _msg[3];
+			if ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))
+				_menuOpcode = _msg[4];
+			if (!_anyone) {
+				if ((_heroSearching) || (_obpart)) {
+					if (_mouse._pos.y < 12)
+						return;
+
+					if ((_msg[4] == OPCODE_SOUND) || (_msg[4] == OPCODE_LIFT)) {
+						oo = true;
+						if ((_msg[4] == OPCODE_LIFT) || (_obpart)) {
+							endSearch();
+							_caff = _coreVar._currPlace;
+							_crep = 998;
+						} else
+							tsuiv();
+						mennor();
+					}
+				}
+			}
+			do {
+				if (! oo)
+					handleOpcode();
+
+				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
+					_text.taffich();
+					if (_destinationOk) {
+						_destinationOk = false;
+						drawPicture();
+					}
+					if ((!_syn) || (_col))
+						handleDescriptionText(2, _crep);
+				}
+			} while (_syn);
+			if (_controlMenu != 0)
+				displayControlMenu();
+		}
+	}
+}
+
+/**
+ * Engine function - Init Places
+ * @remarks	Originally called 'init_lieu'
+ */
+void MortevielleEngine::loadPlaces() {
+	Common::File f;
+
+	if (!f.open("MXX.mor"))
+		if (!f.open("MFXX.mor"))
+			error("Missing file - MXX.mor");
+
+	for (int i = 0; i < 7; ++i) {
+		for (int j = 0; j < 25; ++j)
+			_destinationArray[i][j] = f.readByte();
+	}
+
+	f.close();
+}
+
+/**
+ * Set Text Color
+ * @remarks	Originally called 'text_color'
+ */
+void MortevielleEngine::setTextColor(int col) {
+	_textColor = col;
+}
+
+/**
+ * Prepare screen - Type 1!
+ * @remarks	Originally called 'ecrf1'
+ */
+void MortevielleEngine::prepareScreenType1() {
+	// Large drawing
+	_screenSurface.drawBox(0, 11, 512, 163, 15);
+}
+
+/**
+ * Prepare room - Type 2!
+ * @remarks	Originally called 'ecrf2'
+ */
+void MortevielleEngine::prepareScreenType2() {
+	setTextColor(5);
+}
+
+/**
+ * Prepare room - Type 3!
+ * @remarks	Originally called 'ecrf7'
+ */
+void MortevielleEngine::prepareScreenType3() {
+	setTextColor(4);
+}
+
+/**
+ * Engine function - Update hour
+ * @remarks	Originally called 'calch'
+ */
+void MortevielleEngine::updateHour(int &day, int &hour, int &minute) {
+	int newHour = readclock();
+	int th = _currentHourCount + ((newHour - _currentDayHour) / _inGameHourDuration);
+	minute = ((th % 2) + _currHalfHour) * 30;
+	hour = ((uint)th >> 1) + _currHour;
+	if (minute == 60) {
+		minute = 0;
+		++hour;
+	}
+	day = (hour / 24) + _currDay;
+	hour = hour - ((day - _currDay) * 24);
+}
+
+/**
+ * Engine function - Convert character index to bit index
+ * @remarks	Originally called 'conv'
+ */
+int MortevielleEngine::convertCharacterIndexToBitIndex(int characterIndex) {
+	return 128 >> (characterIndex - 1);
+}
+
+/**
+ * Engine function - Convert bit index to character index
+ * @remarks	Originally called 'tip'
+ */
+int MortevielleEngine::convertBitIndexToCharacterIndex(int bitIndex) {
+	int retVal = 0;
+
+	if (bitIndex == 128)
+		retVal = 1;
+	else if (bitIndex == 64)
+		retVal = 2;
+	else if (bitIndex == 32)
+		retVal = 3;
+	else if (bitIndex == 16)
+		retVal = 4;
+	else if (bitIndex == 8)
+		retVal = 5;
+	else if (bitIndex == 4)
+		retVal = 6;
+	else if (bitIndex == 2)
+		retVal = 7;
+	else if (bitIndex == 1)
+		retVal = 8;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Reset presence in other rooms
+ * @remarks	Originally called 't5'
+ */
+void MortevielleEngine::resetPresenceInRooms(int roomId) {
+	if (roomId == DINING_ROOM)
+		_blo = false;
+
+	if (roomId != GREEN_ROOM) {
+		_roomPresenceLuc = false;
+		_roomPresenceIda = false;
+	}
+
+	if (roomId != PURPLE_ROOM)
+		_purpleRoomPresenceLeo = false;
+
+	if (roomId != DARKBLUE_ROOM) {
+		_roomPresenceGuy = false;
+		_roomPresenceEva = false;
+	}
+
+	if (roomId != BLUE_ROOM)
+		_roomPresenceMax = false;
+	if (roomId != RED_ROOM)
+		_roomPresenceBob = false;
+	if (roomId != GREEN_ROOM2)
+		_roomPresencePat = false;
+	if (roomId != TOILETS)
+		_toiletsPresenceBobMax = false;
+	if (roomId != BATHROOM)
+		_bathRoomPresenceBobMax = false;
+	if (roomId != ROOM9)
+		_room9PresenceLeo = false;
+}
+
+/**
+ * Engine function - Show the people present in the given room
+ * @remarks	Originally called 'affper'
+ */
+void MortevielleEngine::showPeoplePresent(int bitIndex) {
+	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
+
+	for (int i = 1; i <= 8; ++i)
+		_menu.disableMenuItem(_menu._discussMenu[i]);
+
+	clearUpperRightPart();
+	if ((bitIndex & 128) == 128) {
+		_screenSurface.putxy(xp, 24);
+		_screenSurface.drawString("LEO", 4);
+		_menu.enableMenuItem(_menu._discussMenu[1]);
+	}
+	if ((bitIndex & 64) == 64) {
+		_screenSurface.putxy(xp, 32);
+		_screenSurface.drawString("PAT", 4);
+		_menu.enableMenuItem(_menu._discussMenu[2]);
+	}
+	if ((bitIndex & 32) == 32) {
+		_screenSurface.putxy(xp, 40);
+		_screenSurface.drawString("GUY", 4);
+		_menu.enableMenuItem(_menu._discussMenu[3]);
+	}
+	if ((bitIndex & 16) == 16) {
+		_screenSurface.putxy(xp, 48);
+		_screenSurface.drawString("EVA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[4]);
+	}
+	if ((bitIndex & 8) == 8) {
+		_screenSurface.putxy(xp, 56);
+		_screenSurface.drawString("BOB", 4);
+		_menu.enableMenuItem(_menu._discussMenu[5]);
+	}
+	if ((bitIndex & 4) == 4) {
+		_screenSurface.putxy(xp, 64);
+		_screenSurface.drawString("LUC", 4);
+		_menu.enableMenuItem(_menu._discussMenu[6]);
+	}
+	if ((bitIndex & 2) == 2) {
+		_screenSurface.putxy(xp, 72);
+		_screenSurface.drawString("IDA", 4);
+		_menu.enableMenuItem(_menu._discussMenu[7]);
+	}
+	if ((bitIndex & 1) == 1) {
+		_screenSurface.putxy(xp, 80);
+		_screenSurface.drawString("MAX", 4);
+		_menu.enableMenuItem(_menu._discussMenu[8]);
+	}
+	_currBitIndex = bitIndex;
+}
+
+/**
+ * Engine function - Select random characters
+ * @remarks	Originally called 'choix'
+ */
+int MortevielleEngine::selectCharacters(int min, int max) {
+	bool invertSelection = false;
+	int rand = getRandomNumber(min, max);
+
+	if (rand > 4) {
+		rand = 8 - rand;
+		invertSelection = true;
+	}
+
+	int i = 0;
+	int retVal = 0;
+	while (i < rand) {
+		int charIndex = getRandomNumber(1, 8);
+		int charBitIndex = convertCharacterIndexToBitIndex(charIndex);
+		if ((retVal & charBitIndex) != charBitIndex) {
+			++i;
+			retVal |= charBitIndex;
+		}
+	}
+	if (invertSelection)
+		retVal = 255 - retVal;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Green Room
+ * @remarks	Originally called 'cpl1'
+ */
+int MortevielleEngine::getPresenceStatsGreenRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	// The original uses an || instead of an &&, resulting
+	// in an always true condition. Based on the other tests,
+	// and on other scenes, we use an && instead.
+	if ((hour > 7) && (hour < 11))
+		retVal = 25;
+	else if ((hour > 10) && (hour < 14))
+		retVal = 35;
+	else if ((hour > 13) && (hour < 16))
+		retVal = 50;
+	else if ((hour > 15) && (hour < 18))
+		retVal = 5;
+	else if ((hour > 17) && (hour < 22))
+		retVal = 35;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 50;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 70;
+
+	_menu.updateMenu();
+
+	return retVal;
+}
+/**
+ * Engine function - Get Presence Statistics - Purple Room
+ * @remarks	Originally called 'cpl2'
+ */
+int MortevielleEngine::getPresenceStatsPurpleRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 11))
+		retVal = -2;
+	else if (hour == 11)
+		retVal = 100;
+	else if ((hour > 11) && (hour < 23))
+		retVal = 10;
+	else if (hour == 23)
+		retVal = 20;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 50;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Toilets
+ * @remarks	Originally called 'cpl3'
+ */
+int MortevielleEngine::getPresenceStatsToilets() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 10)) || ((hour > 19) && (hour < 24)))
+		retVal = 34;
+	else if (((hour > 9) && (hour < 20)) || ((hour >= 0) && (hour < 9)))
+		retVal = 0;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Blue Room
+ * @remarks	Originally called 'cpl5'
+ */
+int MortevielleEngine::getPresenceStatsBlueRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 6) && (hour < 10))
+		retVal = 0;
+	else if (hour == 10)
+		retVal = 100;
+	else if ((hour > 10) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 7))
+		retVal = 50;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Red Room
+ * @remarks	Originally called 'cpl6'
+ */
+int MortevielleEngine::getPresenceStatsRedRoom() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 13)) || ((hour > 17) && (hour < 20)))
+		retVal = -2;
+	else if (((hour > 12) && (hour < 17)) || ((hour > 19) && (hour < 24)))
+		retVal = 35;
+	else if (hour == 17)
+		retVal = 100;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 60;
+
+	return retVal;
+}
+
+/**
+ * Shows the "you are alone" message in the status area
+ * on the right hand side of the screen
+ * @remarks	Originally called 'person'
+ */
+void MortevielleEngine::displayAloneText() {
+	for (int cf = 1; cf <= 8; ++cf)
+		_menu.disableMenuItem(_menu._discussMenu[cf]);
+
+	Common::String sYou = getEngineString(S_YOU);
+	Common::String sAre = getEngineString(S_ARE);
+	Common::String sAlone = getEngineString(S_ALONE);
+
+	clearUpperRightPart();
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
+	_screenSurface.drawString(sYou, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
+	_screenSurface.drawString(sAre, 4);
+	_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
+	_screenSurface.drawString(sAlone, 4);
+
+	_currBitIndex = 0;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl10'
+ */
+int MortevielleEngine::getPresenceStatsDiningRoom(int &hour) {
+	int day, minute;
+
+	int retVal = 0;
+	updateHour(day, hour, minute);
+	if (((hour > 7) && (hour < 11)) || ((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
+		retVal = 100;
+	else if ((hour == 11) || ((hour > 20) && (hour < 24)))
+		retVal = 45;
+	else if (((hour > 13) && (hour < 17)) || (hour == 18))
+		retVal = 35;
+	else if (hour == 17)
+		retVal = 60;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = 5;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Bureau
+ * @remarks	Originally called 'cpl11'
+ */
+int MortevielleEngine::getPresenceStatsBureau(int &hour) {
+	int day, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 12)) || ((hour > 20) && (hour < 24)))
+		retVal = 25;
+	else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21)))
+		retVal = 5;
+	else if ((hour > 13) && (hour < 17))
+		retVal = 55;
+	else if ((hour > 16) && (hour < 19))
+		retVal = 45;
+	else if ((hour >= 0) && (hour < 9))
+		retVal = 0;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Kitchen
+ * @remarks	Originally called 'cpl12'
+ */
+int MortevielleEngine::getPresenceStatsKitchen() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (((hour > 8) && (hour < 15)) || ((hour > 16) && (hour < 22)))
+		retVal = 55;
+	else if (((hour > 14) && (hour < 17)) || ((hour > 21) && (hour < 24)))
+		retVal = 25;
+	else if ((hour >= 0) && (hour < 5))
+		retVal = 0;
+	else if ((hour > 4) && (hour < 9))
+		retVal = 15;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Attic
+ * @remarks	Originally called 'cpl13'
+ */
+int MortevielleEngine::getPresenceStatsAttic() {
+	return 0;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Landing
+ * @remarks	Originally called 'cpl15'
+ */
+int MortevielleEngine::getPresenceStatsLanding() {
+	int day, hour, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if ((hour > 7) && (hour < 12))
+		retVal = 25;
+	else if ((hour > 11) && (hour < 14))
+		retVal = 0;
+	else if ((hour > 13) && (hour < 18))
+		retVal = 10;
+	else if ((hour > 17) && (hour < 20))
+		retVal = 55;
+	else if ((hour > 19) && (hour < 22))
+		retVal = 5;
+	else if ((hour > 21) && (hour < 24))
+		retVal = 15;
+	else if ((hour >= 0) && (hour < 8))
+		retVal = -15;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get Presence Statistics - Room Chapel
+ * @remarks	Originally called 'cpl20'
+ */
+int MortevielleEngine::getPresenceStatsChapel(int &hour) {
+	int day, minute;
+	int retVal = 0;
+
+	updateHour(day, hour, minute);
+	if (hour == 10)
+		retVal = 65;
+	else if ((hour > 10) && (hour < 21))
+		retVal = 5;
+	else if ((hour > 20) && (hour < 24))
+		retVal = -15;
+	else if ((hour >= 0) && (hour < 5))
+		retVal = -300;
+	else if ((hour > 4) && (hour < 10))
+		retVal = -5;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Green Room
+ * @remarks	Originally called 'quelq1'
+ */
+void MortevielleEngine::setPresenceGreenRoom(int roomId) {
+	int rand = getRandomNumber(1, 2);
+	if (roomId == GREEN_ROOM) {
+		if (rand == 1)
+			_roomPresenceLuc = true;
+		else
+			_roomPresenceIda = true;
+	} else if (roomId == DARKBLUE_ROOM) {
+		if (rand == 1)
+			_roomPresenceGuy = true;
+		else
+			_roomPresenceEva = true;
+	}
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Purple Room
+ * @remarks	Originally called 'quelq2'
+ */
+void MortevielleEngine::setPresencePurpleRoom() {
+	if (_place == PURPLE_ROOM)
+		_purpleRoomPresenceLeo = true;
+	else
+		_room9PresenceLeo = true;
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Blue Room
+ * @remarks	Originally called 'quelq5'
+ */
+void MortevielleEngine::setPresenceBlueRoom() {
+	_roomPresenceMax = true;
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Red Room
+ * @remarks	Originally called 'quelq6'
+ */
+void MortevielleEngine::setPresenceRedRoom(int roomId) {
+	if (roomId == RED_ROOM)
+		_roomPresenceBob = true;
+	else if (roomId == GREEN_ROOM2)
+		_roomPresencePat = true;
+
+	_currBitIndex = 10;
+}
+
+/**
+ * Engine function - Check who is in the Dining Room
+ * @remarks	Originally called 'quelq10'
+ */
+int MortevielleEngine::setPresenceDiningRoom(int hour) {
+	int retVal = 0;
+
+	if ((hour >= 0) && (hour < 8))
+		retVal = checkLeoMaxRandomPresence();
+	else {
+		int min = 0, max = 0;
+		if ((hour > 7) && (hour < 10)) {
+			min = 5;
+			max = 7;
+		} else if ((hour > 9) && (hour < 12)) {
+			min = 1;
+			max = 4;
+		} else if (((hour > 11) && (hour < 15)) || ((hour > 18) && (hour < 21))) {
+			min = 6;
+			max = 8;
+		} else if (((hour > 14) && (hour < 19)) || ((hour > 20) && (hour < 24))) {
+			min = 1;
+			max = 5;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Bureau
+ * @remarks	Originally called 'quelq11'
+ */
+int MortevielleEngine::setPresenceBureau(int hour) {
+	int retVal = 0;
+
+	if ((hour >= 0) && (hour < 8))
+		retVal = checkLeoMaxRandomPresence();
+	else {
+		int min = 0, max = 0;
+		if (((hour > 7) && (hour < 10)) || ((hour > 20) && (hour < 24))) {
+			min = 1;
+			max = 3;
+		} else if (((hour > 9) && (hour < 12)) || ((hour > 13) && (hour < 19))) {
+			min = 1;
+			max = 4;
+		} else if (((hour > 11) && (hour < 14)) || ((hour > 18) && (hour < 21))) {
+			min = 1;
+			max = 2;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Kitchen
+ * @remarks	Originally called 'quelq12'
+ */
+int MortevielleEngine::setPresenceKitchen() {
+	int retVal = checkLeoMaxRandomPresence();
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the Landing
+ * @remarks	Originally called 'quelq15'
+ */
+int MortevielleEngine::setPresenceLanding() {
+	bool test = false;
+	int rand = 0;
+	do {
+		rand = getRandomNumber(1, 8);
+		test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
+		        ((rand == 2) && _roomPresencePat) ||
+		        ((rand == 3) && _roomPresenceGuy) ||
+		        ((rand == 4) && _roomPresenceEva) ||
+		        ((rand == 5) && _roomPresenceBob) ||
+		        ((rand == 6) && _roomPresenceLuc) ||
+		        ((rand == 7) && _roomPresenceIda) ||
+		        ((rand == 8) && _roomPresenceMax));
+	} while (test);
+
+	int retVal = convertCharacterIndexToBitIndex(rand);
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Check who is in the chapel
+ * @remarks	Originally called 'quelq20'
+ */
+int MortevielleEngine::setPresenceChapel(int hour) {
+	int retVal = 0;
+
+	if (((hour >= 0) && (hour < 10)) || ((hour > 18) && (hour < 24)))
+		retVal = checkLeoMaxRandomPresence();
+	else {
+		int min = 0, max = 0;
+		if ((hour > 9) && (hour < 12)) {
+			min = 3;
+			max = 7;
+		} else if ((hour > 11) && (hour < 18)) {
+			min = 1;
+			max = 2;
+		} else if (hour == 18) {
+			min = 2;
+			max = 4;
+		}
+		retVal = selectCharacters(min, max);
+	}
+	showPeoplePresent(retVal);
+
+	return retVal;
+}
+
+/**
+ * Engine function - Get the answer after you known a door
+ * @remarks	Originally called 'frap'
+ */
+void MortevielleEngine::getKnockAnswer() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if ((hour >= 0) && (hour < 8))
+		_crep = 190;
+	else {
+		if (getRandomNumber(1, 100) > 70)
+			_crep = 190;
+		else
+			_crep = 147;
+	}
+}
+
+/**
+ * Engine function - Get Room Presence Bit Index
+ * @remarks	Originally called 'nouvp'
+ */
+int MortevielleEngine::getPresenceBitIndex(int roomId) {
+	int bitIndex = 0;
+	if (roomId == GREEN_ROOM) {
+		if (_roomPresenceLuc)
+			bitIndex = 4;  // LUC
+		if (_roomPresenceIda)
+			bitIndex = 2;  // IDA
+	} else if ( ((roomId == PURPLE_ROOM) && (_purpleRoomPresenceLeo))
+			 || ((roomId == ROOM9) && (_room9PresenceLeo)))
+		bitIndex = 128;    // LEO
+	else if (roomId == DARKBLUE_ROOM) {
+		if (_roomPresenceGuy)
+			bitIndex = 32; // GUY
+		if (_roomPresenceEva)
+			bitIndex = 16; // EVA
+	} else if ((roomId == BLUE_ROOM) && (_roomPresenceMax))
+		bitIndex = 1;      // MAX
+	else if ((roomId == RED_ROOM) && (_roomPresenceBob))
+		bitIndex = 8;      // BOB
+	else if ((roomId == GREEN_ROOM2) && (_roomPresencePat))
+		bitIndex = 64;     // PAT
+	else if ( ((roomId == TOILETS) && (_toiletsPresenceBobMax))
+		   || ((roomId == BATHROOM) && (_bathRoomPresenceBobMax)) )
+		bitIndex = 9;      // BOB + MAX
+
+	if (bitIndex != 9)
+		showPeoplePresent(bitIndex);
+
+	return bitIndex;
+}
+
+/**
+ * Engine function - initGame
+ * @remarks	Originally called 'dprog'
+ */
+void MortevielleEngine::initGame() {
+	_place = MANOR_FRONT;
+	_currentHourCount = 0;
+	if (!_coreVar._alreadyEnteredManor)
+		_blo = true;
+	_inGameHourDuration = kTime1;
+	_currentDayHour = readclock();
+}
+
+/**
+ * Engine function - Set Random Presence - Green Room
+ * @remarks	Originally called 'pl1'
+ */
+void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
+	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
+	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
+		int p = getPresenceStatsGreenRoom();
+		int rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceGreenRoom(_place);
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Purple Room
+ * @remarks	Originally called 'pl2'
+ */
+void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
+	if (!_purpleRoomPresenceLeo) {
+		int p = getPresenceStatsPurpleRoom();
+		int rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresencePurpleRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Blue Room
+ * @remarks	Originally called 'pl5'
+ */
+void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
+	if (!_roomPresenceMax) {
+		int p = getPresenceStatsBlueRoom();
+		int rand;
+
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceBlueRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Red Room
+ * @remarks	Originally called 'pl6'
+ */
+void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
+	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
+	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
+		int p = getPresenceStatsRedRoom();
+		int rand;
+
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresenceRedRoom(_place);
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Room 9
+ * @remarks	Originally called 'pl9'
+ */
+void MortevielleEngine::setRandomPresenceRoom9(int cf) {
+	if (!_room9PresenceLeo) {
+		cf = -10;
+		int p, rand;
+		phaz(rand, p, cf);
+
+		if (rand > p)
+			displayAloneText();
+		else
+			setPresencePurpleRoom();
+	}
+}
+
+/**
+ * Engine function - Set Random Presence - Dining Room
+ * @remarks	Originally called 'pl10'
+ */
+void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
+	int h, rand;
+	int p = getPresenceStatsDiningRoom(h);
+	phaz(rand, p, cf);
+
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceDiningRoom(h);
+}
+
+/**
+ * Engine function - Set Random Presence - Bureau
+ * @remarks	Originally called 'pl11'
+ */
+void MortevielleEngine::setRandomPresenceBureau(int cf) {
+	int h, rand;
+
+	int p = getPresenceStatsBureau(h);
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceBureau(h);
+}
+
+/**
+ * Engine function - Set Random Presence - Kitchen
+ * @remarks	Originally called 'pl12'
+ */
+void MortevielleEngine::setRandomPresenceKitchen(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsKitchen();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceKitchen();
+}
+
+/**
+ * Engine function - Set Random Presence - Attic / Cellar
+ * @remarks	Originally called 'pl13'
+ */
+void MortevielleEngine::setRandomPresenceAttic(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsAttic();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceKitchen();
+}
+
+/**
+ * Engine function - Set Random Presence - Landing
+ * @remarks	Originally called 'pl15'
+ */
+void MortevielleEngine::setRandomPresenceLanding(int cf) {
+	int p, rand;
+
+	p = getPresenceStatsLanding();
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceLanding();
+}
+
+/**
+ * Engine function - Set Random Presence - Chapel
+ * @remarks	Originally called 'pl20'
+ */
+void MortevielleEngine::setRandomPresenceChapel(int cf) {
+	int h, rand;
+
+	int p = getPresenceStatsChapel(h);
+	phaz(rand, p, cf);
+	if (rand > p)
+		displayAloneText();
+	else
+		setPresenceChapel(h);
+}
+
+/**
+ * Start music or speech
+ * @remarks	Originally called 'musique'
+ */
+void MortevielleEngine::startMusicOrSpeech(int so) {
+	if (so == 0) {
+		/* musik(0) */
+		;
+	} else if ((!_introSpeechPlayed) && (!_coreVar._alreadyEnteredManor)) {
+		// Type 1: Speech
+		_speechManager.startSpeech(10, 1, 1);
+		_introSpeechPlayed = true;
+	} else {
+		if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(9, getRandomNumber(2, 4), 1);
+		else if ((_coreVar._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
+			// Type 1: Speech
+			_speechManager.startSpeech(8, 1, 1);
+		else if ((_coreVar._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
+			// Type 1: Speech
+			_speechManager.startSpeech(12, 1, 1);
+		else if (_coreVar._currPlace == INSIDE_WELL)
+			// Type 1: Speech
+			_speechManager.startSpeech(13, 1, 1);
+		else
+			// Type 2 : music
+			_speechManager.startSpeech(getRandomNumber(1, 17), 1, 2);
+	}
+}
+
+/**
+ * Engine function - You lose!
+ * @remarks	Originally called 'tperd'
+ */
+void MortevielleEngine::loseGame() {
+	resetOpenObjects();
+	_roomDoorId = OWN_ROOM;
+	_mchai = 0;
+	_menu.unsetSearchMenu();
+	if (!_blo)
+		getPresence(MANOR_FRONT);
+
+	_loseGame = true;
+	clearUpperLeftPart();
+	_screenSurface.drawBox(60, 35, 400, 50, 15);
+	handleDescriptionText(9, _crep);
+	clearDescriptionBar();
+	clearVerbBar();
+	_col = false;
+	_syn = false;
+	_destinationOk = false;
+}
+
+/**
+ * Engine function - Check inventory for a given object
+ * @remarks	Originally called 'cherjer'
+ */
+bool MortevielleEngine::checkInventory(int objectId) {
+	bool retVal = false;
+	for (int i = 1; i <= 6; ++i)
+		retVal = (retVal || (_coreVar._inventory[i] == objectId));
+
+	if (_coreVar._selectedObjectId == objectId)
+		retVal = true;
+
+	return retVal;
+}
+
+/**
+ * Engine function - Display Dining Room
+ * @remarks	Originally called 'st1sama'
+ */
+void MortevielleEngine::displayDiningRoom() {
+	_coreVar._currPlace = DINING_ROOM;
+	affrep();
+}
+
+/**
+ * Engine function - Start non interactive Dialog
+ * @remarks	Originally called 'sparl'
+ */
+void MortevielleEngine::startDialog(int16 rep) {
+	const int haut[9] = { 0, 0, 1, -3, 6, -2, 2, 7, -1 };
+	int key;
+
+	assert(rep >= 0);
+
+	_mouse.hideMouse();
+	Common::String dialogStr = getString(rep + kDialogStringIndex);
+	_text.displayStr(dialogStr, 230, 4, 65, 24, 5);
+	_dialogManager.drawF3F8();
+
+	key = 0;
+	do {
+		_speechManager.startSpeech(rep, haut[_caff - 69], 0);
+		key = _dialogManager.waitForF3F8();
+		if (shouldQuit())
+			return;
+	} while (key != 66);
+	hirs();
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - End of Search: reset globals
+ * @remarks	Originally called 'finfouill'
+ */
+void MortevielleEngine::endSearch() {
+	_heroSearching = false;
+	_obpart = false;
+	_searchCount = 0;
+	_menu.unsetSearchMenu();
+}
+
+/**
+ * Engine function - Go to Dining room
+ * @remarks	Originally called 't1sama'
+ */
+void MortevielleEngine::gotoDiningRoom() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if ((hour < 5) && (_coreVar._currPlace > ROOM18)) {
+		if (!checkInventory(137)) {        //You don't have the keys, and it's late
+			_crep = 1511;
+			loseGame();
+		} else
+			displayDiningRoom();
+	} else if (!_coreVar._alreadyEnteredManor) {     //Is it your first time?
+		_currBitIndex = 255; // Everybody is present
+		showPeoplePresent(_currBitIndex);
+		_caff = 77;
+		drawPictureWithText();
+		_screenSurface.drawBox(223, 47, 155, 91, 15);
+		handleDescriptionText(2, 33);
+		testKey(false);
+		mennor();
+		_mouse.hideMouse();
+		hirs();
+		premtet();
+		startDialog(140);
+		drawRightFrame();
+		drawClock();
+		_mouse.showMouse();
+		_coreVar._currPlace = OWN_ROOM;
+		affrep();
+		resetPresenceInRooms(DINING_ROOM);
+		if (!_blo)
+			getPresence(OWN_ROOM);
+		_currBitIndex = 0;
+		_savedBitIndex = 0;
+		_coreVar._alreadyEnteredManor = true;
+	} else
+		displayDiningRoom();
+}
+
+/**
+ * Engine function - Check Manor distance (in the mountains)
+ * @remarks	Originally called 't1neig'
+ */
+void MortevielleEngine::checkManorDistance() {
+	++_manorDistance;
+	if (_manorDistance > 2) {
+		_crep = 1506;
+		loseGame();
+	} else {
+		_destinationOk = true;
+		_coreVar._currPlace = MOUNTAIN;
+		affrep();
+	}
+}
+
+/**
+ * Engine function - Go to Manor front
+ * @remarks	Originally called 't1deva'
+ */
+void MortevielleEngine::gotoManorFront() {
+	_manorDistance = 0;
+	_coreVar._currPlace = MANOR_FRONT;
+	affrep();
+}
+
+/**
+ * Engine function - Go to Manor back
+ * @remarks	Originally called 't1derr'
+ */
+void MortevielleEngine::gotoManorBack() {
+	_coreVar._currPlace = MANOR_BACK;
+	affrep();
+}
+
+/**
+ * Engine function - Dead : Flooded in Well
+ * @remarks	Originally called 't1deau'
+ */
+void MortevielleEngine::floodedInWell() {
+	_crep = 1503;
+	loseGame();
+}
+
+/**
+ * Engine function - Change Graphical Device
+ * @remarks	Originally called 'change_gd'
+ */
+void MortevielleEngine::changeGraphicalDevice(int newDevice) {
+	_mouse.hideMouse();
+	_currGraphicalDevice = newDevice;
+	hirs();
+	_mouse.initMouse();
+	_mouse.showMouse();
+	drawRightFrame();
+	prepareRoom();
+	drawClock();
+	if (_currBitIndex != 0)
+		showPeoplePresent(_currBitIndex);
+	else
+		displayAloneText();
+	clearDescriptionBar();
+	clearVerbBar();
+	_maff = 68;
+	drawPictureWithText();
+	handleDescriptionText(2, _crep);
+	_menu.displayMenu();
+}
+
+/**
+ * Called when a savegame has been loaded.
+ * @remarks	Originally called 'antegame'
+ */
+void MortevielleEngine::gameLoaded() {
+	_mouse.hideMouse();
+	_menu._menuDisplayed = false;
+	_loseGame = true;
+	_anyone = false;
+	_destinationOk = true;
+	_col = false;
+	_hiddenHero = false;
+	_uptodatePresence = false;
+	_maff = 68;
+	_menuOpcode = OPCODE_NONE;
+	_introSpeechPlayed = false;
+	_x = 0;
+	_y = 0;
+	_num = 0;
+	_startHour = 0;
+	_endHour = 0;
+	_searchCount = 0;
+	_roomDoorId = OWN_ROOM;
+	_syn = true;
+	_heroSearching = true;
+	_mchai = 0;
+	_manorDistance = 0;
+	resetOpenObjects();
+	_takeObjCount = 0;
+	affrep();
+	_hintPctMessage = getString(580);
+
+	_destinationOk = false;
+	_endGame = true;
+	_loseGame = false;
+	_heroSearching = false;
+
+	displayAloneText();
+	prepareRoom();
+	drawClock();
+	drawPictureWithText();
+	handleDescriptionText(2, _crep);
+	clearVerbBar();
+	_endGame = false;
+	_menu.setDestinationText(_coreVar._currPlace);
+	_menu.setInventoryText();
+	if (_coreVar._selectedObjectId != 0)
+		displayItemInHand(_coreVar._selectedObjectId + 400);
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Handle OpCodes
+ * @remarks	Originally called 'tsitu'
+ */
+void MortevielleEngine::handleOpcode() {
+	if (!_col)
+		clearDescriptionBar();
+	_syn = false;
+	_keyPressedEsc = false;
+	if (!_anyone) {
+		if (_uptodatePresence) {
+			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
+				_controlMenu = 4;
+				mennor();
+				return;
+			}
+		}
+		if (_msg[3] == MENU_MOVE)
+			fctMove();
+		if (_msg[3] == MENU_DISCUSS)
+			fctDiscuss();
+		if (_msg[3] == MENU_INVENTORY)
+			fctInventoryTake();
+		if (_msg[4] == OPCODE_ATTACH)
+			fctAttach();
+		if (_msg[4] == OPCODE_WAIT)
+			fctWait();
+		if (_msg[4] == OPCODE_FORCE)
+			fctForce();
+		if (_msg[4] == OPCODE_SLEEP)
+			fctSleep();
+		if (_msg[4] == OPCODE_LISTEN)
+			fctListen();
+		if (_msg[4] == OPCODE_ENTER)
+			fctEnter();
+		if (_msg[4] == OPCODE_CLOSE)
+			fctClose();
+		if (_msg[4] == OPCODE_SEARCH)
+			fctSearch();
+		if (_msg[4] == OPCODE_KNOCK)
+			fctKnock();
+		if (_msg[4] == OPCODE_SCRATCH)
+			fctScratch();
+		if (_msg[4] == OPCODE_READ)
+			fctRead();
+		if (_msg[4] == OPCODE_EAT)
+			fctEat();
+		if (_msg[4] == OPCODE_PLACE)
+			fctPlace();
+		if (_msg[4] == OPCODE_OPEN)
+			fctOpen();
+		if (_msg[4] == OPCODE_TAKE)
+			fctTake();
+		if (_msg[4] == OPCODE_LOOK)
+			fctLook();
+		if (_msg[4] == OPCODE_SMELL)
+			fctSmell();
+		if (_msg[4] == OPCODE_SOUND)
+			fctSound();
+		if (_msg[4] == OPCODE_LEAVE)
+			fctLeave();
+		if (_msg[4] == OPCODE_LIFT)
+			fctLift();
+		if (_msg[4] == OPCODE_TURN)
+			fctTurn();
+		if (_msg[4] == OPCODE_SSEARCH)
+			fctSelfSearch();
+		if (_msg[4] == OPCODE_SREAD)
+			fctSelfRead();
+		if (_msg[4] == OPCODE_SPUT)
+			fctSelfPut();
+		if (_msg[4] == OPCODE_SLOOK)
+			fctSelftLook();
+		_hiddenHero = false;
+
+		if (_msg[4] == OPCODE_SHIDE)
+			fctSelfHide();
+	} else {
+		if (_anyone) {
+			interactNPC();
+			_anyone = false;
+			mennor();
+			return;
+		}
+	}
+	int hour, day, minute;
+	updateHour(day, hour, minute);
+	if ((((hour == 12) || (hour == 13) || (hour == 19)) && (_coreVar._currPlace != DINING_ROOM)) ||
+	        ((hour > 0) && (hour < 6) && (_coreVar._currPlace != OWN_ROOM)))
+		++_coreVar._faithScore;
+	if (((_coreVar._currPlace < CRYPT) || (_coreVar._currPlace > MOUNTAIN)) && (_coreVar._currPlace != INSIDE_WELL)
+	        && (_coreVar._currPlace != OWN_ROOM) && (_coreVar._selectedObjectId != 152) && (!_loseGame)) {
+		if ((_coreVar._faithScore > 99) && (hour > 8) && (hour < 16)) {
+			_crep = 1501;
+			loseGame();
+		}
+		if ((_coreVar._faithScore > 99) && (hour > 0) && (hour < 9)) {
+			_crep = 1508;
+			loseGame();
+		}
+		if ((day > 1) && (hour > 8) && (!_loseGame)) {
+			_crep = 1502;
+			loseGame();
+		}
+	}
+	mennor();
+}
+
+/**
+ * Engine function - Transform time into a char
+ * @remarks	Originally called 'tmaj3'
+ */
+void MortevielleEngine::hourToChar() {
+	int day, hour, minute;
+
+	updateHour(day, hour, minute);
+	if (minute == 30)
+		minute = 1;
+	hour += day * 24;
+	minute += hour * 2;
+	_coreVar._fullHour = chr(minute);
+}
+
+/**
+ * Engine function - extract time from a char
+ * @remarks	Originally called 'theure'
+ */
+void MortevielleEngine::charToHour() {
+	int fullHour = ord(_coreVar._fullHour);
+	int tmpHour = fullHour % 48;
+	_currDay = fullHour / 48;
+	_currHalfHour = tmpHour % 2;
+	_currHour = tmpHour / 2;
+	_hour = _currHour;
+	if (_currHalfHour == 1)
+		_minute = 30;
+	else
+		_minute = 0;
+}
+
+/**
+ * Engine function - Clear upper left part of Screen - Type 1
+ * @remarks	Originally called 'clsf1'
+ */
+void MortevielleEngine::clearUpperLeftPart() {
+	_mouse.hideMouse();
+	_screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear low bar used by description
+ * @remarks	Originally called 'clsf2'
+ */
+void MortevielleEngine::clearDescriptionBar() {
+	_mouse.hideMouse();
+	if (_largestClearScreen) {
+		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
+		_screenSurface.drawBox(0, 175, 634, 24, 15);
+		_largestClearScreen = false;
+	} else {
+		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
+		_screenSurface.drawBox(0, 175, 634, 15, 15);
+	}
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear lowest bar used by verbs
+ * @remarks	Originally called 'clsf3'
+ */
+void MortevielleEngine::clearVerbBar() {
+	_mouse.hideMouse();
+	_screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
+	_screenSurface.drawBox(0, 191, 634, 8, 15);
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Clear upper right part of the screen
+ * @remarks	Originally called 'clsf10'
+ */
+void MortevielleEngine::clearUpperRightPart() {
+	int x1, x2;
+	Common::String st;
+
+	_mouse.hideMouse();
+	if (_resolutionScaler == 1) {
+		x2 = 634;
+		x1 = 534;
+	} else {
+		x2 = 600;
+		x1 = 544;
+	}
+	// Clear ambiance description
+	_screenSurface.fillRect(15, Common::Rect(x1, 93, x2, 98));
+	if (_coreVar._faithScore < 33)
+		st = getEngineString(S_COOL);
+	else if (_coreVar._faithScore < 66)
+		st = getEngineString(S_LOURDE);
+	else if (_coreVar._faithScore > 65)
+		st = getEngineString(S_MALSAINE);
+
+	x1 = 580 - (_screenSurface.getStringWidth(st) / 2);
+	_screenSurface.putxy(x1, 92);
+	_screenSurface.drawString(st, 4);
+
+	// Clear person list
+	_screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
+	_mouse.showMouse();
+}
+
+/**
+ * Engine function - Get a random number between two values
+ * @remarks	Originally called 'get_random_number' and 'hazard'
+ */
+int MortevielleEngine::getRandomNumber(int minval, int maxval) {
+	return _randomSource.getRandomNumber(maxval - minval) + minval;
+}
+
+/**
+ * Engine function - Show alert "use move menu"
+ * @remarks	Originally called 'aldepl'
+ */
+void MortevielleEngine::showMoveMenuAlert() {
+	_dialogManager.show(getEngineString(S_USE_DEP_MENU), 1);
+}
+
+/**
+ * The original engine used this method to display a starting text screen letting the player
+ * select the graphics mode to use
+ * @remarks	Originally called 'dialpre'
+ */
+void MortevielleEngine::showConfigScreen() {
+	_crep = 998;
+}
+
+/**
+ * Decodes a number of 64 byte blocks
+ * @param pStart	Start of data
+ * @param count		Number of 64 byte blocks
+ * @remarks	Originally called 'zzuul'
+ */
+void MortevielleEngine::decodeNumber(byte *pStart, int count) {
+	while (count-- > 0) {
+		for (int idx = 0; idx < 64; ++pStart, ++idx) {
+			uint16 v = ((*pStart - 0x80) << 1) + 0x80;
+
+			if (v & 0x8000)
+				*pStart = 0;
+			else if (v & 0xff00)
+				*pStart = 0xff;
+			else
+				*pStart = (byte)v;
+		}
+	}
+}
+
+const byte tabdr[32] = {
+	32, 101, 115,  97, 114, 105, 110,
+	117, 116, 111, 108,  13, 100,  99,
+	112, 109,  46, 118, 130,  39, 102,
+	98,  44, 113, 104, 103,  33,  76,
+	85, 106,  30,  31
+};
+
+const byte tab30[32] = {
+	69,  67,  74, 138, 133, 120,  77, 122,
+	121,  68,  65,  63,  73,  80,  83,  82,
+	156,  45,  58,  79,  49,  86,  78,  84,
+	71,  81,  64,  66, 135,  34, 136,  91
+};
+
+const byte tab31[32]= {
+	93,  47,  48,  53,  50,  70, 124,  75,
+	72, 147, 140, 150, 151,  57,  56,  51,
+	107, 139,  55,  89, 131,  37,  54,  88,
+	119,   0,   0,   0,   0,   0,   0,   0
+};
+
+void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
+	uint16 oct, ocd;
+
+	/* 5-8 */
+	oct = _inpBuffer[idx];
+	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
+	if (pt < 6) {
+		++idx;
+		oct = oct << (5 - pt);
+		pt += 11;
+		oct = oct | ((uint)_inpBuffer[idx] >> pt);
+	} else {
+		pt -= 5;
+		oct = (uint)oct >> pt;
+	}
+
+	switch (oct) {
+	case 11:
+		c = '$';
+		the_end = true;
+		break;
+	case 30:
+	case 31:
+		ocd = _inpBuffer[idx];
+		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
+		if (pt < 6) {
+			++idx;
+			ocd = ocd << (5 - pt);
+			pt += 11;
+			ocd = ocd | ((uint)_inpBuffer[idx] >> pt);
+		} else {
+			pt -= 5;
+			ocd = (uint)ocd >> pt;
+		}
+
+		if (oct == 30)
+			c = chr(tab30[ocd]);
+		else
+			c = chr(tab31[ocd]);
+
+		if (c == '\0') {
+			the_end = true;
+			c = '#';
+		}
+		break;
+	default:
+		c = chr(tabdr[oct]);
+		break;
+	}
+}
+
+/**
+ * Decode and extract the line with the given Id
+ * @remarks	Originally called 'deline'
+ */
+Common::String MortevielleEngine::getString(int num) {
+	Common::String wrkStr = "";
+
+	if (num < 0) {
+		warning("getString(%d): num < 0! Skipping", num);
+	} else if (!_txxFileFl) {
+		wrkStr = getGameString(num);
+	} else {
+		int hint = _ntpBuffer[num]._hintId;
+		byte point = _ntpBuffer[num]._point;
+		int length = 0;
+		bool endFl = false;
+		char let;
+		do {
+			cinq_huit(let, hint, point, endFl);
+			wrkStr += let;
+			++length;
+		} while (!endFl);
+	}
+
+	while (wrkStr.lastChar() == '$')
+		// Remove trailing '$'s
+		wrkStr.deleteLastChar();
+
+	return wrkStr;
+}
+
+void MortevielleEngine::copcha() {
+	for (int i = kAcha; i < kAcha + 390; i++)
+		_tabdon[i] = _tabdon[i + 390];
+}
+
+/**
+ * Engine function - When restarting the game, reset the main variables used by the engine
+ * @remarks	Originally called 'inzon'
+ */
+void MortevielleEngine::resetVariables() {
+	copcha();
+
+	_coreVar._alreadyEnteredManor = false;
+	_coreVar._selectedObjectId = 0;
+	_coreVar._cellarObjectId = 0;
+	_coreVar._atticBallHoleObjectId = 0;
+	_coreVar._atticRodHoleObjectId = 0;
+	_coreVar._wellObjectId = 0;
+	_coreVar._secretPassageObjectId = 0;
+	_coreVar._purpleRoomObjectId = 136;
+	_coreVar._cryptObjectId = 141;
+	_coreVar._faithScore = getRandomNumber(4, 10);
+	_coreVar._currPlace = MANOR_FRONT;
+
+	for (int i = 2; i <= 6; ++i)
+		_coreVar._inventory[i] = 0;
+
+	// Only object in inventory: a gun
+	_coreVar._inventory[1] = 113;
+
+	_coreVar._fullHour = chr(20);
+
+	for (int i = 1; i <= 10; ++i)
+		_coreVar._pctHintFound[i] = ' ';
+
+	for (int i = 1; i <= 6; ++i)
+		_coreVar._availableQuestion[i] = '*';
+
+	for (int i = 7; i <= 9; ++i)
+		_coreVar._availableQuestion[i] = ' ';
+
+	for (int i = 10; i <= 28; ++i)
+		_coreVar._availableQuestion[i] = '*';
+
+	for (int i = 29; i <= 42; ++i)
+		_coreVar._availableQuestion[i] = ' ';
+
+	_coreVar._availableQuestion[33] = '*';
+
+	for (int i = 1; i <= 8; ++i)
+		_nbrep[i] = 0;
+
+	init_nbrepm();
+}
+
+/**
+ * Engine function - Set the palette
+ * @remarks	Originally called 'writepal'
+ */
+void MortevielleEngine::setPal(int n) {
+	switch (_currGraphicalDevice) {
+	case MODE_TANDY:
+	case MODE_EGA:
+	case MODE_AMSTRAD1512:
+		for (int i = 1; i <= 16; ++i) {
+			_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
+			_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+		}
+		break;
+	case MODE_CGA: {
+		nhom pal[16];
+		for (int i = 0; i < 16; ++i) {
+			pal[i] = _cgaPal[n]._a[i];
+		}
+
+		if (n < 89)
+			palette(_cgaPal[n]._p);
+
+		for (int i = 0; i <= 15; ++i)
+			displayCGAPattern(i, _patternArr[pal[i]._id], pal);
+		}
+		break;
+	default:
+		break;
+	}
+}
+
+/**
+ * Engine function - Display a CGA pattern, using a specified palette
+ * @remarks	Originally called 'outbloc'
+ */
+void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
+	int addr = n * 404 + 0xd700;
+
+	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr], p._tax);
+	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr + 2], p._tay);
+	addr += 4;
+	for (int i = 0; i < p._tax; ++i) {
+		for (int j = 0; j < p._tay; ++j)
+			_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+	}
+}
+
+/**
+ * Engine function - Load Palette from File
+ * @remarks	Originally called 'charpal'
+ */
+void MortevielleEngine::loadPalette() {
+	Common::File f;
+	byte b;
+
+	if (!f.open("fxx.mor")) {
+		if (f.open("mfxx.mor"))
+			f.seek(7 * 25);
+		else
+			error("Missing file - fxx.mor");
+	}
+
+	for (int i = 0; i < 108; ++i)
+		_fxxBuffer[i] = f.readSint16LE();
+	f.close();
+
+	if (!f.open("plxx.mor"))
+		error("Missing file - plxx.mor");
+	for (int i = 0; i <= 90; ++i) {
+		for (int j = 1; j <= 16; ++j) {
+			_stdPal[i][j].x = f.readByte();
+			_stdPal[i][j].y = f.readByte();
+		}
+	}
+	f.close();
+
+	if (!f.open("cxx.mor"))
+		error("Missing file - cxx.mor");
+
+	for (int j = 0; j <= 90; ++j) {
+		_cgaPal[j]._p = f.readByte();
+		for (int i = 0; i <= 15; ++i) {
+			nhom &with = _cgaPal[j]._a[i];
+
+			b = f.readByte();
+			with._id = (uint)b >> 4;
+			with._hom[0] = ((uint)b >> 2) & 3;
+			with._hom[1] = b & 3;
+		}
+	}
+
+	_cgaPal[10]._a[9] = _cgaPal[10]._a[5];
+	for (int j = 0; j <= 14; ++j) {
+		_patternArr[j]._tax = f.readByte();
+		_patternArr[j]._tay = f.readByte();
+		for (int i = 1; i <= 20; ++i) {
+			for (int k = 1; k <= 20; ++k)
+				_patternArr[j]._des[i][k] = f.readByte();
+		}
+	}
+	f.close();
+}
+
+/**
+ * Engine function - Load Texts from File
+ * @remarks	Originally called 'chartex'
+ */
+void MortevielleEngine::loadTexts() {
+	Common::File inpFile;
+	Common::File ntpFile;
+
+	_txxFileFl = false;
+	if (getLanguage() == Common::EN_ANY) {
+		warning("English version expected - Switching to DAT file");
+		return;
+	}
+
+	if (!inpFile.open("TXX.INP")) {
+		if (!inpFile.open("TXX.MOR")) {
+			warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+			return;
+		}
+	}
+	if (!ntpFile.open("TXX.NTP")) {
+		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+		return;
+	}
+
+	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {
+		warning("TXX file - Unexpected format - Switching to DAT file");
+		return;
+	}
+
+	for (int i = 0; i < inpFile.size() / 2; ++i)
+		_inpBuffer[i] = inpFile.readUint16LE();
+
+	inpFile.close();
+	_txxFileFl = true;
+
+	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
+		_ntpBuffer[i]._hintId = ntpFile.readSint16LE();
+		_ntpBuffer[i]._point = ntpFile.readByte();
+	}
+
+	ntpFile.close();
+
+}
+
+void MortevielleEngine::loadBRUIT5() {
+	Common::File f;
+
+	if (!f.open("bruit5"))
+		error("Missing file - bruit5");
+
+	f.read(&_mem[kAdrNoise5 * 16 + 0], 149 * 128);
+	f.close();
+}
+
+void MortevielleEngine::loadCFIEC() {
+	Common::File f;
+
+	if (!f.open("cfiec.mor")) {
+		if (!f.open("alcfiec.mor"))
+			error("Missing file - *cfiec.mor");
+	}
+
+	_cfiecBufferSize = ((f.size() / 128) + 1) * 128;
+	int32 fileSize = f.size();
+
+	if (!_reloadCFIEC)
+		_cfiecBuffer = (byte *)malloc(sizeof(byte) * _cfiecBufferSize);
+
+	for (int32 i = 0; i < fileSize; ++i)
+		_cfiecBuffer[i] = f.readByte();
+
+	for (int i = fileSize; i < _cfiecBufferSize; i++)
+		_cfiecBuffer[i] = 0;
+
+	f.close();
+
+	_reloadCFIEC = false;
+}
+
+
+void MortevielleEngine::loadCFIPH() {
+	Common::File f;
+
+	if (!f.open("cfiph.mor")) {
+		if (!f.open("alcfiph.mor"))
+			error("Missing file - *cfiph.mor");
+	}
+
+	_speechManager._cfiphBuffer = (int16 *)malloc(sizeof(int16) * (f.size() / 2));
+
+	for (int i = 0; i < (f.size() / 2); ++i)
+		_speechManager._cfiphBuffer[i] = f.readSint16LE();
+
+	f.close();
+}
+
+/**
+ * Engine function - Play Music
+ * @remarks	Originally called 'music'
+ */
+void MortevielleEngine::music() {
+	if (_soundOff)
+		return;
+
+	_reloadCFIEC = true;
+
+	Common::File fic;
+	if (!fic.open("mort.img"))
+		error("Missing file - mort.img");
+
+	fic.read(&_mem[0x3800 * 16 + 0], 500);
+	fic.read(&_mem[0x47a0 * 16 + 0], 123);
+	fic.close();
+
+	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[0x5000 * 16], 623);
+	_addFix = (float)((kTempoMusic - 8)) / 256;
+	_speechManager.cctable(_speechManager._tbi);
+
+	bool fin = false;
+	int k = 0;
+	do {
+		fin = keyPressed();
+		_soundManager.musyc(_speechManager._tbi, 9958, kTempoMusic);
+		++k;
+		fin = fin | keyPressed() | (k >= 5);
+	} while (!fin);
+	while (keyPressed())
+		getChar();
+}
+
+/**
+ * Engine function - Show title screen
+ * @remarks	Originally called 'suite'
+ */
+void MortevielleEngine::showTitleScreen() {
+	hirs();
+	handleDescriptionText(7, 2035);
+	_caff = 51;
+	_text.taffich();
+	testKeyboard();
+	if (_newGraphicalDevice != _currGraphicalDevice)
+		_currGraphicalDevice = _newGraphicalDevice;
+	hirs();
+	draw(kAdrDes, 0, 0);
+
+	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
+	_screenSurface.putxy(104 + 72 * _resolutionScaler, 185);
+	_screenSurface.drawString(cpr, 0);
+}
+
+/**
+ * Draw picture
+ * @remarks	Originally called 'dessine'
+ */
+void MortevielleEngine::draw(int ad, int x, int y) {
+	_mouse.hideMouse();
+	setPal(_numpal);
+	pictout(ad, 0, x, y);
+	_mouse.showMouse();
+}
+
+/**
+ * Draw right frame
+ * @remarks	Originally called 'dessine_rouleau'
+ */
+void MortevielleEngine::drawRightFrame() {
+	setPal(89);
+	if (_currGraphicalDevice == MODE_HERCULES) {
+		_mem[0x7000 * 16 + 14] = 15;
+	}
+	_mouse.hideMouse();
+	pictout(0x73a2, 0, 0, 0);
+	_mouse.showMouse();
+}
+
+/**
+ * Read the current system time
+ */
+int MortevielleEngine::readclock() {
+	TimeDate dateTime;
+	g_system->getTimeAndDate(dateTime);
+
+	int m = dateTime.tm_min * 60;
+	int h = dateTime.tm_hour * 3600;
+	return h + m + dateTime.tm_sec;
+}
+
+/**
+ * Engine function - Prepare room and hint string
+ * @remarks	Originally called 'tinke'
+ */
+void MortevielleEngine::prepareRoom() {
+	int day, hour, minute;
+
+	_anyone = false;
+	updateHour(day, hour, minute);
+	if (day != _day) {
+		_day = day;
+		int i = 0;
+		do {
+			++i;
+			if (_nbrepm[i] != 0)
+				--_nbrepm[i];
+			_nbrep[i] = 0;
+		} while (i != 8);
+	}
+	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
+		_hour = hour;
+		_minute = 0;
+		drawClock();
+		int hintCount = 0;
+		for (int i = 1; i <= 10; ++i) {
+			if (_coreVar._pctHintFound[i] == '*')
+				++hintCount;
+		}
+
+		Common::String pctStr;
+		if (hintCount == 10)
+			pctStr = "10";
+		else
+			pctStr = chr(hintCount + 48);
+
+		_hintPctMessage = "[1][";
+		_hintPctMessage += getEngineString(S_SHOULD_HAVE_NOTICED);
+		_hintPctMessage += pctStr;
+		_hintPctMessage += '0';
+		_hintPctMessage += getEngineString(S_NUMBER_OF_HINTS);
+		_hintPctMessage += "][";
+		_hintPctMessage += getEngineString(S_OK);
+		_hintPctMessage += ']';
+	}
+	if (minute > _minute) {
+		_minute = 30;
+		drawClock();
+	}
+	if (_mouse._pos.y < 12)
+		return;
+
+	if (!_blo) {
+		if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
+			_inGameHourDuration = kTime2;
+		else
+			_inGameHourDuration = kTime1;
+		if ((_coreVar._faithScore > 33) && (_coreVar._faithScore < 66))
+			_inGameHourDuration -= (_inGameHourDuration / 3);
+
+		if (_coreVar._faithScore > 65)
+			_inGameHourDuration -= ((_inGameHourDuration / 3) * 2);
+
+		int newHour = readclock();
+		if ((newHour - _currentDayHour) > _inGameHourDuration) {
+			bool activeMenu = _menu._menuActive;
+			_menu.eraseMenu();
+			_currentHourCount += ((newHour - _currentDayHour) / _inGameHourDuration);
+			_currentDayHour = newHour;
+			switch (_place) {
+			case GREEN_ROOM:
+			case DARKBLUE_ROOM:
+				setRandomPresenceGreenRoom(_coreVar._faithScore);
+				break;
+			case PURPLE_ROOM:
+				setRandomPresencePurpleRoom(_coreVar._faithScore);
+				break;
+			case BLUE_ROOM:
+				setRandomPresenceBlueRoom(_coreVar._faithScore);
+				break;
+			case RED_ROOM:
+			case GREEN_ROOM2:
+				setRandomPresenceRedRoom(_coreVar._faithScore);
+				break;
+			case ROOM9:
+				setRandomPresenceRoom9(_coreVar._faithScore);
+				break;
+			case DINING_ROOM:
+				setRandomPresenceDiningRoom(_coreVar._faithScore);
+				break;
+			case BUREAU:
+				setRandomPresenceBureau(_coreVar._faithScore);
+				break;
+			case KITCHEN:
+				setRandomPresenceKitchen(_coreVar._faithScore);
+				break;
+			case ATTIC:
+			case CELLAR:
+				setRandomPresenceAttic(_coreVar._faithScore);
+				break;
+			case LANDING:
+			case ROOM26:
+				setRandomPresenceLanding(_coreVar._faithScore);
+				break;
+			case CHAPEL:
+				setRandomPresenceChapel(_coreVar._faithScore);
+				break;
+			}
+			if ((_savedBitIndex != 0) && (_currBitIndex != 10))
+				_savedBitIndex = _currBitIndex;
+
+			if ((_savedBitIndex == 0) && (_currBitIndex > 0)) {
+				if ((_coreVar._currPlace == ATTIC) || (_coreVar._currPlace == CELLAR)) {
+					initCaveOrCellar();
+				} else if (_currBitIndex == 10) {
+					_currBitIndex = 0;
+					if (!_uptodatePresence) {
+						_uptodatePresence = true;
+						_startHour = readclock();
+						if (getRandomNumber(1, 5) < 5) {
+							clearVerbBar();
+							prepareScreenType2();
+							displayTextInVerbBar(getEngineString(S_HEAR_NOISE));
+							int rand = (getRandomNumber(0, 4)) - 2;
+							_speechManager.startSpeech(1, rand, 1);
+							clearVerbBar();
+						}
+					}
+				}
+			}
+
+			if (activeMenu)
+				_menu.drawMenu();
+		}
+	}
+	_endHour = readclock();
+	if ((_uptodatePresence) && ((_endHour - _startHour) > 17)) {
+		getPresenceBitIndex(_place);
+		_uptodatePresence = false;
+		_startHour = 0;
+		if ((_coreVar._currPlace > OWN_ROOM) && (_coreVar._currPlace < DINING_ROOM))
+			_anyone = true;
+	}
+}
+
+/**
+ * Engine function - Draw Clock
+ * @remarks	Originally called 'pendule'
+ */
+void MortevielleEngine::drawClock() {
+	const int cv[2][12] = {
+		{  5,  8, 10,  8,  5,  0, -5, -8, -10, -8, -5,  0 },
+		{ -5, -3,  0,  3,  5,  6,  5,  3,   0, -3, -5, -6 }
+	};
+	const int x = 580;
+	const int y = 123;
+	const int rg = 9;
+	int hourColor;
+
+	_mouse.hideMouse();
+
+	_screenSurface.drawRectangle(570, 118, 20, 10);
+	_screenSurface.drawRectangle(578, 114, 6, 18);
+	if ((_currGraphicalDevice == MODE_CGA) || (_currGraphicalDevice == MODE_HERCULES))
+		hourColor = 0;
+	else
+		hourColor = 1;
+
+	if (_minute == 0)
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y - rg), hourColor);
+	else
+		_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)x >> 1) * _resolutionScaler, (y + rg), hourColor);
+
+	int hour12 = _hour;
+	if (hour12 > 12)
+		hour12 -= 12;
+	if (hour12 == 0)
+		hour12 = 12;
+
+	_screenSurface.drawLine(((uint)x >> 1) * _resolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * _resolutionScaler, y + cv[1][hour12 - 1], hourColor);
+	_mouse.showMouse();
+	_screenSurface.putxy(568, 154);
+
+	if (_hour > 11)
+		_screenSurface.drawString("PM ", 1);
+	else
+		_screenSurface.drawString("AM ", 1);
+
+	_screenSurface.putxy(550, 160);
+	if ((_day >= 0) && (_day <= 8)) {
+		Common::String tmp = getEngineString(S_DAY);
+		tmp.insertChar((char)(_day + 49), 0);
+		_screenSurface.drawString(tmp, 1);
+	}
+}
+
+void MortevielleEngine::palette(int v1) {
+	warning("TODO: palette");
+}
+
+/**
+ * Returns a substring of the given string
+ * @param s		Source string
+ * @param idx	Starting index (1 based)
+ * @param size	Number of characters to return
+ */
+
+Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t size) {
+	// Copy the substring into a temporary buffer
+	char *tmp = new char[size + 1];
+	strncpy(tmp, s.c_str() + idx - 1, size);
+	tmp[size] = '\0';
+
+	Common::String result(tmp);
+	delete[] tmp;
+	return result;
+}
+
+void MortevielleEngine::hirs() {
+	// Note: The original used this to set the graphics mode and clear the screen, both at
+	// the start of the game, and whenever the screen need to be cleared. As such, this
+	// method is deprecated in favour of clearing the screen
+	debugC(1, kMortevielleCore, "TODO: hirs is deprecated in favour of ScreenSurface::clearScreen");
+
+	if (_currGraphicalDevice == MODE_TANDY) {
+		_screenSurface.fillRect(0, Common::Rect(0, 0, 639, 200));
+		_resolutionScaler = 1;
+	} else if (_currGraphicalDevice == MODE_CGA) {
+		palette(1);
+		_resolutionScaler = 1;
+	} else
+		_resolutionScaler = 2;
+
+	_screenSurface.clearScreen();
+}
+
+/**
+ * Init room : Cave or Cellar
+ * @remarks	Originally called 'cavegre'
+ */
+void MortevielleEngine::initCaveOrCellar() {
+	_coreVar._faithScore += 2;
+	if (_coreVar._faithScore > 69)
+		_coreVar._faithScore += (_coreVar._faithScore / 10);
+	clearVerbBar();
+	prepareScreenType2();
+	displayTextInVerbBar(getEngineString(S_SOMEONE_ENTERS));
+	int rand = (getRandomNumber(0, 4)) - 2;
+	_speechManager.startSpeech(2, rand, 1);
+
+	// The original was doing here a useless loop.
+	// It has been removed
+
+	clearVerbBar();
+	displayAloneText();
+}
+
+/**
+ * Display control menu string
+ * @remarks	Originally called 'tctrm'
+ */
+void MortevielleEngine::displayControlMenu() {
+	handleDescriptionText(2, (3000 + _controlMenu));
+	_controlMenu = 0;
+}
+
+void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
+	GfxSurface surface;
+	surface.decode(&_mem[seg * 16 + dep]);
+
+	if (_currGraphicalDevice == MODE_HERCULES) {
+		_mem[0x7000 * 16 + 2] = 0;
+		_mem[0x7000 * 16 + 32] = 15;
+	}
+
+	if ((_caff != 51) && (READ_LE_UINT16(&_mem[0x7000 * 16 + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&_mem[0x7000 * 16 + 0x4138], 0x100);
+
+	_screenSurface.drawPicture(surface, x, y);
+}
+
+void MortevielleEngine::adzon() {
+	Common::File f;
+
+	if (!f.open("don.mor"))
+		error("Missing file - don.mor");
+
+	f.read(_tabdon, 7 * 256);
+	f.close();
+
+	if (!f.open("bmor.mor"))
+		error("Missing file - bmor.mor");
+
+	f.read(&_tabdon[kFleche], 1 * 1916);
+	f.close();
+
+	if (!f.open("dec.mor"))
+		error("Missing file - dec.mor");
+
+	f.read(&_mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.close();
+}
+
+/**
+ * Returns the offset within the compressed image data resource of the desired image
+ */
+int MortevielleEngine::animof(int ouf, int num) {
+	int nani = _mem[kAdrAni * 16 + 1];
+	int aux = num;
+	if (ouf != 1)
+		aux += nani;
+
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[kAdrAni * 16 + (aux << 1)]);
+
+	return animof_result;
+}
+
+/**
+ * Display text in description bar
+ * @remarks	Originally called 'text1'
+ */
+void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int mesgId) {
+	int co;
+
+	if (_resolutionScaler == 1)
+		co = 10;
+	else
+		co = 6;
+	Common::String tmpStr = getString(mesgId);
+	if ((y == 182) && ((int) tmpStr.size() * co > nb * 6))
+		y = 176;
+	_text.displayStr(tmpStr, x, y, nb, 20, _textColor);
+}
+
+/**
+ * Display description text
+ * @remarks	Originally called 'repon'
+ */
+void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
+	if ((mesgId > 499) && (mesgId < 563)) {
+		Common::String tmpStr = getString(mesgId - 501 + kInventoryStringIndex);
+
+		if ((int) tmpStr.size() > ((58 + (_resolutionScaler - 1) * 37) << 1))
+			_largestClearScreen = true;
+		else
+			_largestClearScreen = false;
+
+		clearDescriptionBar();
+		_text.displayStr(tmpStr, 8, 176, 85, 3, 5);
+	} else {
+		mapMessageId(mesgId);
+		switch (f) {
+		case 2:
+		case 8:
+			clearDescriptionBar();
+			prepareScreenType2();
+			displayTextInDescriptionBar(8, 182, 103, mesgId);
+			if ((mesgId == 68) || (mesgId == 69))
+				_coreVar._availableQuestion[40] = '*';
+			if ((mesgId == 104) && (_caff == CELLAR)) {
+				_coreVar._availableQuestion[36] = '*';
+				if (_coreVar._availableQuestion[39] == '*') {
+					_coreVar._pctHintFound[3] = '*';
+					_coreVar._availableQuestion[38] = '*';
+				}
+			}
+			break;
+		case 1:
+		case 6:
+		case 9: {
+			int i;
+			if ((f == 1) || (f == 6))
+				i = 4;
+			else
+				i = 5;
+
+			Common::String tmpStr = getString(mesgId);
+			_text.displayStr(tmpStr, 80, 40, 60, 25, i);
+
+			if (mesgId == 180)
+				_coreVar._pctHintFound[6] = '*';
+			else if (mesgId == 179)
+				_coreVar._pctHintFound[10] = '*';
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+/**
+ * Recompute message Id
+ * @remarks	Originally called 'modif'
+ */
+void MortevielleEngine::mapMessageId(int &mesgId) {
+	if (mesgId == 26)
+		mesgId = 25;
+	else if ((mesgId > 29) && (mesgId < 36))
+		mesgId -= 4;
+	else if ((mesgId > 69) && (mesgId < 78))
+		mesgId -= 37;
+	else if ((mesgId > 99) && (mesgId < 194))
+		mesgId -= 59;
+	else if ((mesgId > 996) && (mesgId < 1000))
+		mesgId -= 862;
+	else if ((mesgId > 1500) && (mesgId < 1507))
+		mesgId -= 1363;
+	else if ((mesgId > 1507) && (mesgId < 1513))
+		mesgId -= 1364;
+	else if ((mesgId > 1999) && (mesgId < 2002))
+		mesgId -= 1851;
+	else if (mesgId == 2010)
+		mesgId = 151;
+	else if ((mesgId > 2011) && (mesgId < 2025))
+		mesgId -= 1860;
+	else if (mesgId == 2026)
+		mesgId = 165;
+	else if ((mesgId > 2029) && (mesgId < 2037))
+		mesgId -= 1864;
+	else if ((mesgId > 3000) && (mesgId < 3005))
+		mesgId -= 2828;
+	else if (mesgId == 4100)
+		mesgId = 177;
+	else if (mesgId == 4150)
+		mesgId = 178;
+	else if ((mesgId > 4151) && (mesgId < 4156))
+		mesgId -= 3973;
+	else if (mesgId == 4157)
+		mesgId = 183;
+	else if ((mesgId == 4160) || (mesgId == 4161))
+		mesgId -= 3976;
+}
+
+/**
+ * Initialize open objects array
+ * @remarks	Originally called 'initouv'
+ */
+void MortevielleEngine::resetOpenObjects() {
+	for (int cx = 1; cx <= 7; ++cx)
+		_openObjects[cx] = 0;
+	_openObjCount = 0;
+}
+
+void MortevielleEngine::ecr2(Common::String text) {
+	// Some dead code was present in the original: removed
+	_screenSurface.putxy(8, 177);
+	int tlig = 59 + (_resolutionScaler - 1) * 36;
+
+	if ((int)text.size() < tlig)
+		_screenSurface.drawString(text, 5);
+	else if ((int)text.size() < (tlig << 1)) {
+		_screenSurface.putxy(8, 176);
+		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
+		_screenSurface.putxy(8, 182);
+		_screenSurface.drawString(copy(text, tlig, tlig << 1), 5);
+	} else {
+		_largestClearScreen = true;
+		clearDescriptionBar();
+		_screenSurface.putxy(8, 176);
+		_screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
+		_screenSurface.putxy(8, 182);
+		_screenSurface.drawString(copy(text, tlig, ((tlig << 1) - 1)), 5);
+		_screenSurface.putxy(8, 190);
+		_screenSurface.drawString(copy(text, tlig << 1, tlig * 3), 5);
+	}
+}
+
+void MortevielleEngine::displayTextInVerbBar(Common::String text) {
+	clearVerbBar();
+	_screenSurface.putxy(8, 192);
+	_screenSurface.drawString(text, 5);
+}
+
+/**
+ * Display item in hand
+ * @remarks	Originally called 'modobj'
+ */
+void MortevielleEngine::displayItemInHand(int objId) {
+	Common::String strp = Common::String(' ');
+
+	if (objId != 500)
+		strp = getString(objId - 501 + kInventoryStringIndex);
+
+	_menu.setText(_menu._inventoryMenu[8], strp);
+	_menu.disableMenuItem(_menu._inventoryMenu[8]);
+}
+
+/**
+ * Display empty hand
+ * @remarks	Originally called 'maivid'
+ */
+void MortevielleEngine::displayEmptyHand() {
+	_coreVar._selectedObjectId = 0;
+	displayItemInHand(500);
+}
+
+/**
+ * Set a random presence: Leo or Max
+ * @remarks	Originally called 'chlm'
+ */
+int MortevielleEngine::checkLeoMaxRandomPresence() {
+	int retval = getRandomNumber(1, 2);
+	if (retval == 2)
+		retval = 128;
+
+	return retval;
+}
+
+/**
+ * Reset room variables
+ * @remarks	Originally called 'debloc'
+ */
+void MortevielleEngine::resetRoomVariables(int roomId) {
+	_num = 0;
+	_x = 0;
+	_y = 0;
+	if ((roomId != ROOM26) && (roomId != LANDING))
+		resetPresenceInRooms(roomId);
+	_savedBitIndex = _currBitIndex;
+}
+
+/**
+ * Compute presence stats
+ * @remarks	Originally called 'ecfren'
+ */
+int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
+	if (roomId == OWN_ROOM)
+		displayAloneText();
+	int retVal = -500;
+	rand = 0;
+	if ( ((roomId == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
+	  || ((roomId == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) )
+		retVal = getPresenceStatsGreenRoom();
+	if ((roomId == PURPLE_ROOM) && (!_purpleRoomPresenceLeo) && (!_room9PresenceLeo))
+		retVal = getPresenceStatsPurpleRoom();
+	if ( ((roomId == TOILETS) && (!_toiletsPresenceBobMax))
+	  || ((roomId == BATHROOM) && (!_bathRoomPresenceBobMax)) )
+		retVal = getPresenceStatsToilets();
+	if ((roomId == BLUE_ROOM) && (!_roomPresenceMax))
+		retVal = getPresenceStatsBlueRoom();
+	if ( ((roomId == RED_ROOM) && (!_roomPresenceBob))
+	  || ((roomId == GREEN_ROOM2) && (!_roomPresencePat)))
+		retVal = getPresenceStatsRedRoom();
+	if ((roomId == ROOM9) && (!_room9PresenceLeo) && (!_purpleRoomPresenceLeo))
+		retVal = 10;
+	if ( ((roomId == PURPLE_ROOM) && (_room9PresenceLeo))
+	  || ((roomId == ROOM9) && (_purpleRoomPresenceLeo)))
+		retVal = -400;
+	if (retVal != -500) {
+		retVal += cf;
+		rand = getRandomNumber(1, 100);
+	}
+
+	return retVal;
+}
+
+/**
+ * Set presence flags
+ * @remarks	Originally called 'becfren'
+ */
+void MortevielleEngine::setPresenceFlags(int roomId) {
+	if ((roomId == GREEN_ROOM) || (roomId == DARKBLUE_ROOM)) {
+		int rand = getRandomNumber(1, 2);
+		if (roomId == GREEN_ROOM) {
+			if (rand == 1)
+				_roomPresenceLuc = true;
+			else
+				_roomPresenceIda = true;
+		} else { // roomId == DARKBLUE_ROOM
+			if (rand == 1)
+				_roomPresenceGuy = true;
+			else
+				_roomPresenceEva = true;
+		}
+	} else if (roomId == PURPLE_ROOM)
+		_purpleRoomPresenceLeo = true;
+	else if (roomId == TOILETS)
+		_toiletsPresenceBobMax = true;
+	else if (roomId == BLUE_ROOM)
+		_roomPresenceMax = true;
+	else if (roomId == RED_ROOM)
+		_roomPresenceBob = true;
+	else if (roomId == BATHROOM)
+		_bathRoomPresenceBobMax = true;
+	else if (roomId == GREEN_ROOM2)
+		_roomPresencePat = true;
+	else if (roomId == ROOM9)
+		_room9PresenceLeo = true;
+}
+
+void MortevielleEngine::init_nbrepm() {
+	static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
+
+	for (int idx = 0; idx < 9; ++idx)
+		_nbrepm[idx] = ipm[idx];
+}
+
+void MortevielleEngine::phaz(int &rand, int &p, int cf) {
+	p += cf;
+	rand = getRandomNumber(1, 100);
+}
+
+/**
+ * Get Presence
+ * @remarks	Originally called 't11'
+ */
+int MortevielleEngine::getPresence(int roomId) {
+	int retVal = 0;
+	int rand;
+
+	int p = getPresenceStats(rand, _coreVar._faithScore, roomId);
+	_place = roomId;
+	if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
+		if (p != -500) {
+			if (rand > p) {
+				displayAloneText();
+				retVal = 0;
+			} else {
+				setPresenceFlags(_place);
+				retVal = getPresenceBitIndex(_place);
+			}
+		} else
+			retVal = getPresenceBitIndex(_place);
+	}
+
+	if (roomId > ROOM9) {
+		if ((roomId > LANDING) && (roomId != CHAPEL) && (roomId != ROOM26))
+			displayAloneText();
+		else {
+			int h = 0;
+			if (roomId == DINING_ROOM)
+				p = getPresenceStatsDiningRoom(h);
+			else if (roomId == BUREAU)
+				p = getPresenceStatsBureau(h);
+			else if (roomId == KITCHEN)
+				p = getPresenceStatsKitchen();
+			else if ((roomId == ATTIC) || (roomId == CELLAR))
+				p = getPresenceStatsAttic();
+			else if ((roomId == LANDING) || (roomId == ROOM26))
+				p = getPresenceStatsLanding();
+			else if (roomId == CHAPEL)
+				p = getPresenceStatsChapel(h);
+			p += _coreVar._faithScore;
+			rand = getRandomNumber(1, 100);
+			if (rand > p) {
+				displayAloneText();
+				retVal = 0;
+			} else {
+				if (roomId == DINING_ROOM)
+					p = setPresenceDiningRoom(h);
+				else if (roomId == BUREAU)
+					p = setPresenceBureau(h);
+				else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
+					p = setPresenceKitchen();
+				else if ((roomId == LANDING) || (roomId == ROOM26))
+					p = setPresenceLanding();
+				else if (roomId == CHAPEL)
+					p = setPresenceChapel(h);
+				retVal = p;
+			}
+		}
+	}
+
+	return retVal;
+}
+
+void MortevielleEngine::writetp(Common::String s, int t) {
+	if (_resolutionScaler == 2)
+		_screenSurface.drawString(s, t);
+	else
+		_screenSurface.drawString(copy(s, 1, 25), t);
+}
+
+void MortevielleEngine::aniof(int ouf, int num) {
+	if ((_caff == BATHROOM) && ((num == 4) || (num == 5)))
+		return;
+
+	if ((_caff == DINING_ROOM) && (num == 7))
+		num = 6;
+	else if (_caff == KITCHEN) {
+		if (num == 3)
+			num = 4;
+		else if (num == 4)
+			num = 3;
+	}
+
+	int ad = kAdrAni;
+	int offset = animof(ouf, num);
+
+	GfxSurface surface;
+	surface.decode(&_mem[ad * 16 + offset]);
+	_screenSurface.drawPicture(surface, 0, 12);
+
+	prepareScreenType1();
+}
+
+/**
+ * Draw Picture
+ * @remarks	Originally called 'dessin'
+ */
+void MortevielleEngine::drawPicture() {
+	clearUpperLeftPart();
+	if (_caff > 99) {
+		draw(kAdrDes, 60, 33);
+		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
+	} else if (_caff > 69) {
+		draw(kAdrDes, 112, 48);           // Heads
+		_screenSurface.drawBox(222, 47, 155, 91, 15);
+	} else {
+		draw(kAdrDes, 0, 12);
+		prepareScreenType1();
+		if ((_caff < 30) || (_caff > 32)) {
+			for (int cx = 1; cx <= 6; ++cx) {
+				if (_openObjects[cx] != 0)
+					aniof(1, _openObjects[cx]);
+			}
+
+			if (_caff == ATTIC) {
+				if (_coreVar._atticBallHoleObjectId == 141)
+					aniof(1, 7);
+
+				if (_coreVar._atticRodHoleObjectId == 159)
+					aniof(1, 6);
+			} else if ((_caff == CELLAR) && (_coreVar._cellarObjectId == 151))
+				aniof(1, 2);
+			else if ((_caff == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143))
+				aniof(1, 1);
+			else if ((_caff == WELL) && (_coreVar._wellObjectId != 0))
+				aniof(1, 1);
+		}
+
+		if (_caff < ROOM26)
+			startMusicOrSpeech(1);
+	}
+}
+
+void MortevielleEngine::drawPictureWithText() {
+	_text.taffich();
+	drawPicture();
+	_destinationOk = false;
+}
+
+/**
+ * Engine function - Place
+ * @remarks	Originally called 'tkey1'
+ */
+void MortevielleEngine::testKey(bool d) {
+	bool quest = false;
+	int x, y;
+	bool click;
+
+	_mouse.hideMouse();
+	fenat('K');
+
+	// Wait for release from any key or mouse button
+	while (keyPressed())
+		_key = testou();
+
+	do {
+		_mouse.getMousePosition(x, y, click);
+		keyPressed();
+	} while (click);
+
+	// Event loop
+	do {
+		if (d)
+			prepareRoom();
+		quest = keyPressed();
+		_mouse.getMousePosition(x, y, click);
+		if (shouldQuit())
+			return;
+	} while (!(quest || (click) || (d && _anyone)));
+	if (quest)
+		testou();
+	setMouseClick(false);
+	_mouse.showMouse();
+}
+
+void MortevielleEngine::tlu(int af, int ob) {
+	_caff = 32;
+	drawPictureWithText();
+	handleDescriptionText(6, ob + 4000);
+	handleDescriptionText(2, 999);
+	testKey(true);
+	_caff = af;
+	_msg[3] = OPCODE_NONE;
+	_crep = 998;
+}
+
+void MortevielleEngine::affrep() {
+	_caff = _coreVar._currPlace;
+	_crep = _coreVar._currPlace;
+}
+
+/**
+ * Exit room
+ * @remarks	Originally called 'tsort'
+ */
+void MortevielleEngine::exitRoom() {
+	if ((_openObjCount > 0) && (_coreVar._currPlace != OWN_ROOM)) {
+		if (_coreVar._faithScore < 50)
+			_coreVar._faithScore += 2;
+		else
+			_coreVar._faithScore += (_coreVar._faithScore / 10);
+	}
+
+	resetOpenObjects();
+
+	_roomDoorId = OWN_ROOM;
+	_mchai = 0;
+	resetRoomVariables(_coreVar._currPlace);
+}
+
+/**
+ * get 'read' description
+ * @remarks	Originally called 'st4'
+ */
+void MortevielleEngine::getReadDescription(int objId) {
+	_crep = 997;
+
+	switch (objId) {
+	case 114 :
+		_crep = 109;
+		break;
+	case 110 :
+		_crep = 107;
+		break;
+	case 158 :
+		_crep = 113;
+		break;
+	case 152:
+	case 153:
+	case 154:
+	case 155:
+	case 156:
+	case 150:
+	case 100:
+	case 157:
+	case 160:
+	case 161 :
+		tlu(_caff, objId);
+		break;
+	default:
+		break;
+	}
+}
+
+/**
+ * get 'search' description
+ * @remarks	Originally called 'st7'
+ */
+void MortevielleEngine::getSearchDescription(int objId) {
+	switch (objId) {
+	case 116:
+	case 144:
+		_crep = 104;
+		break;
+	case 126:
+	case 111:
+		_crep = 108;
+		break;
+	case 132:
+		_crep = 111;
+		break;
+	case 142:
+		_crep = 112;
+		break;
+	default:
+		_crep = 183;
+		getReadDescription(objId);
+	}
+}
+
+void MortevielleEngine::mennor() {
+	_menu.menuUp(_msg[3]);
+}
+
+void MortevielleEngine::premtet() {
+	draw(kAdrDes, 10, 80);
+	_screenSurface.drawBox(18, 79, 155, 91, 15);
+}
+
+void MortevielleEngine::ajchai() {
+	int cy = kAcha + ((_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+	} while ((cx <= 9) && (_tabdon[cy + cx] != 0));
+
+	if (_tabdon[cy + cx] == 0)
+		_tabdon[cy + cx] = _coreVar._selectedObjectId;
+	else
+		_crep = 192;
+}
+
+/**
+ * Check if inventory is full and, if not, add object in it.
+ * @remarks	Originally called 'ajjer'
+ */
+void MortevielleEngine::addObjectToInventory(int objectId) {
+	int i = 0;
+	do {
+		++i;
+	} while ((i <= 5) && (_coreVar._inventory[i] != 0));
+
+	if (_coreVar._inventory[i] == 0) {
+		_coreVar._inventory[i] = objectId;
+		_menu.setInventoryText();
+	} else
+		// Inventory is full
+		_crep = 139;
+}
+
+/**
+ * Interact with NPC
+ * @remarks	Originally called 'quelquun'
+ */
+void MortevielleEngine::interactNPC() {
+	if (_menu._menuDisplayed)
+		_menu.eraseMenu();
+
+	endSearch();
+	_crep = 997;
+L1:
+	if (!_hiddenHero) {
+		if (_crep == 997)
+			_crep = 138;
+		handleDescriptionText(2, _crep);
+		if (_crep == 138)
+			_speechManager.startSpeech(5, 2, 1);
+		else
+			_speechManager.startSpeech(4, 4, 1);
+
+		if (_openObjCount == 0)
+			_coreVar._faithScore += 2;
+		else if (_coreVar._faithScore < 50)
+			_coreVar._faithScore += 4;
+		else
+			_coreVar._faithScore += 3 * (_coreVar._faithScore / 10);
+		exitRoom();
+		_menu.setDestinationText(LANDING);
+		int cx = convertBitIndexToCharacterIndex(_currBitIndex);
+		_caff = 69 + cx;
+		_crep = _caff;
+		_msg[3] = MENU_DISCUSS;
+		_msg[4] = _menu._discussMenu[cx];
+		_syn = true;
+		_col = true;
+	} else {
+		if (getRandomNumber(1, 3) == 2) {
+			_hiddenHero = false;
+			_crep = 137;
+			goto L1;
+		} else {
+			handleDescriptionText(2, 136);
+			int rand = (getRandomNumber(0, 4)) - 2;
+			_speechManager.startSpeech(3, rand, 1);
+			clearDescriptionBar();
+			displayAloneText();
+			resetRoomVariables(MANOR_FRONT);
+			affrep();
+		}
+	}
+	if (_menu._menuDisplayed)
+		_menu.drawMenu();
+}
+
+void MortevielleEngine::tsuiv() {
+	int tbcl;
+	int cy = kAcha + ((_mchai - 1) * 10) - 1;
+	int cx = 0;
+	do {
+		++cx;
+		++_searchCount;
+		int cl = cy + _searchCount;
+		tbcl = _tabdon[cl];
+	} while ((tbcl == 0) && (_searchCount <= 9));
+
+	if ((tbcl != 0) && (_searchCount < 11)) {
+		_caff = tbcl;
+		_crep = _caff + 400;
+		if (_currBitIndex != 0)
+			_coreVar._faithScore += 2;
+	} else {
+		affrep();
+		endSearch();
+		if (cx > 9)
+			_crep = 131;
+	}
+}
+
+void MortevielleEngine::tfleche() {
+	bool qust;
+	char touch;
+
+	if (_num == 9999)
+		return;
+
+	fenat(chr(152));
+	bool inRect = false;
+	do {
+		touch = '\0';
+
+		do {
+			_mouse.moveMouse(qust, touch);
+			if (shouldQuit())
+				return;
+
+			if (getMouseClick())
+				inRect = (_mouse._pos.x < 256 * _resolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
+			prepareRoom();
+		} while (!(qust || inRect || _anyone));
+
+		if (qust && (touch == '\103'))
+			_dialogManager.show(_hintPctMessage, 1);
+	} while (!((touch == '\73') || ((touch == '\104') && (_x != 0) && (_y != 0)) || (_anyone) || (inRect)));
+
+	if (touch == '\73')
+		_keyPressedEsc = true;
+
+	if (inRect) {
+		_x = _mouse._pos.x;
+		_y = _mouse._pos.y;
+	}
+}
+
+/**
+ * Set coordinates
+ * @remarks	Originally called 'tcoord'
+ */
+void MortevielleEngine::setCoordinates(int sx) {
+	int sy, ix, iy;
+	int ib;
+
+
+	_num = 0;
+	_crep = 999;
+	int a = 0;
+	int atdon = kAmzon + 3;
+	int cy = 0;
+	while (cy < _caff) {
+		a += _tabdon[atdon];
+		atdon += 4;
+		++cy;
+	}
+
+	if (_tabdon[atdon] == 0) {
+		_crep = 997;
+		return;
+	}
+
+	a += kFleche;
+	int cb = 0;
+	for (cy = 0; cy <= (sx - 2); ++cy) {
+		ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
+		cb += (ib * 4) + 2;
+	}
+	ib = (_tabdon[a + cb] << 8) + _tabdon[(a + cb + 1)];
+	if (ib == 0) {
+		_crep = 997;
+		return;
+	}
+
+	cy = 1;
+	do {
+		cb += 2;
+		sx = _tabdon[a + cb] * _resolutionScaler;
+		sy = _tabdon[(a + cb + 1)];
+		cb += 2;
+		ix = _tabdon[a + cb] * _resolutionScaler;
+		iy = _tabdon[(a + cb + 1)];
+		++cy;
+	} while (!(((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) || (cy > ib)));
+
+	if ((_x >= sx) && (_x <= ix) && (_y >= sy) && (_y <= iy)) {
+		_num = cy - 1;
+		return;
+	}
+
+	_crep = 997;
+}
+
+void MortevielleEngine::treg(int objId) {
+	int mdes = _caff;
+	_caff = objId;
+
+	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_msg[4] == OPCODE_SLOOK)) {
+		drawPictureWithText();
+		if ((_caff > 29) && (_caff < 33))
+			handleDescriptionText(2, _caff);
+		else
+			handleDescriptionText(2, _caff + 400);
+		testKey(true);
+		_caff = mdes;
+		_msg[3] = 0;
+		_crep = 998;
+	} else {
+		_obpart = true;
+		_crep = _caff + 400;
+		_menu.setSearchMenu();
+	}
+}
+
+/**
+ * Engine function - Put in hand
+ * @remarks	Originally called 'avpoing'
+ */
+void MortevielleEngine::putInHand(int &objId) {
+	_crep = 999;
+	if (_coreVar._selectedObjectId != 0)
+		addObjectToInventory(_coreVar._selectedObjectId);
+
+	// If inventory wasn't full
+	if (_crep != 139) {
+		displayItemInHand(objId + 400);
+		_coreVar._selectedObjectId = objId;
+		objId = 0;
+	}
+}
+
+void MortevielleEngine::rechai(int &ch) {
+	int tmpPlace = _coreVar._currPlace;
+
+	if (_coreVar._currPlace == CRYPT)
+		tmpPlace = CELLAR;
+	ch = _tabdon[kAchai + (tmpPlace * 7) + _num - 1];
+}
+
+/**
+ * Check before leaving the secret passage
+ * @remarks	Originally called 't23coul'
+ */
+int MortevielleEngine::checkLeaveSecretPassage() {
+	if (!checkInventory(143)) {
+		_crep = 1512;
+		loseGame();
+	}
+
+	return CELLAR;
+}
+
+void MortevielleEngine::fenat(char ans) {
+	int coul;
+
+	_mouse.hideMouse();
+	if (_currGraphicalDevice == MODE_CGA)
+		coul = 2;
+	else if (_currGraphicalDevice == MODE_HERCULES)
+		coul = 1;
+	else
+		coul = 12;
+
+	_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
+	_screenSurface.drawBox(300, 191, 16, 8, 15);
+	_mouse.showMouse();
+}
+
+/**
+ * Test Keyboard
+ * @remarks	Originally called 'teskbd'
+ */
+void MortevielleEngine::testKeyboard() {
+	if (keyPressed())
+		testou();
+}
+
+int MortevielleEngine::testou() {
+	char ch = getChar();
+
+	switch (ch)  {
+	case '\23' :
+		_soundOff = !_soundOff;
+		break;
+	case '\26' :
+		if ((_x26KeyCount == 1) || (_x26KeyCount == 2)) {
+			decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
+			++_x26KeyCount;
+
+			return 61;
+		}
+		break;
+	case '\33' :
+		if (keyPressed())
+			ch = getChar();
+		break;
+	default:
+		break;
+	}
+
+	return ord(ch);
+}
+
+void MortevielleEngine::sauvecr(int y, int dy) {
+//	_mouse.hideMouse();
+//	_mouse.showMouse();
+}
+
+void MortevielleEngine::charecr(int y, int dy) {
+//	_mouse.hideMouse();
+//	_mouse.showMouse();
+}
+
+} // End of namespace Mortevielle


Commit: 9294cd2277487070c0e4f7eb238db28cf3da4c97
    https://github.com/scummvm/scummvm/commit/9294cd2277487070c0e4f7eb238db28cf3da4c97
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-27T23:04:19-07:00

Commit Message:
MORTEVIELLE: Remove 2 useless functions

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 1fadf1e..c53b20f 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -55,7 +55,6 @@ int DialogManager::show(const Common::String &msg, int n) {
 	Common::String caseStr;
 
 	decodeAlertDetails(msg, caseNumb, lignNumb, colNumb, alertStr, caseStr);
-	_vm->sauvecr(50, (NUM_LINES + 1) << 4);
 
 	int i = 0;
 	Common::Point curPos;
@@ -175,7 +174,6 @@ int DialogManager::show(const Common::String &msg, int n) {
 		tmp4 += " ";
 		_vm->_screenSurface.drawString(tmp4, 1);
 	}
-	_vm->charecr(50, (NUM_LINES + 1) * 16);
 	_vm->_mouse.showMouse();
 
 	/* Restore the background area */
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 8c9fc03..408ea07 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -319,7 +319,6 @@ void Menu::menuDown(int ii) {
 	xco = _menuConstants[ii - 1][0];
 	lignNumb = _menuConstants[ii - 1][3];
 	_vm->_mouse.hideMouse();
-	_vm->sauvecr(10, (_menuConstants[ii - 1][1] + 1) << 1);
 	xco = xco << 3;
 	if (_vm->_resolutionScaler == 1)
 		cx = 10;
@@ -392,8 +391,6 @@ void Menu::menuDown(int ii) {
  */
 void Menu::menuUp(int msgId) {
 	if (_multiTitle) {
-		_vm->charecr(10, (_menuConstants[msgId - 1][1] + 1) << 1);
-
 		/* Restore the background area */
 		assert(_vm->_screenSurface.pitch == _vm->_backgroundSurface.pitch);
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 9facc5e..a07af42 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -528,8 +528,6 @@ public:
 	void handleDescriptionText(int f, int mesgId);
 	int  animof(int ouf, int num);
 	void pictout(int seg, int dep, int x, int y);
-	void sauvecr(int y, int dy);
-	void charecr(int y, int dy);
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index f2d0c95..bbafbca 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -3441,14 +3441,4 @@ int MortevielleEngine::testou() {
 	return ord(ch);
 }
 
-void MortevielleEngine::sauvecr(int y, int dy) {
-//	_mouse.hideMouse();
-//	_mouse.showMouse();
-}
-
-void MortevielleEngine::charecr(int y, int dy) {
-//	_mouse.hideMouse();
-//	_mouse.showMouse();
-}
-
 } // End of namespace Mortevielle


Commit: 0366de430bc6f6b70d047d2d7d4db211a41a97c4
    https://github.com/scummvm/scummvm/commit/0366de430bc6f6b70d047d2d7d4db211a41a97c4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-27T23:21:04-07:00

Commit Message:
MORTEVIELLE: Rename displayStatusInDescriptionBar()

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index a07af42..d4d57d8 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -448,7 +448,7 @@ private:
 	void tsuiv();
 	void treg(int objId);
 	void rechai(int &ch);
-	void fenat(char ans);
+	void displayStatusInDescriptionBar(char stat);
 
 public:
 	Common::Point _prevPos;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index bbafbca..a0b7cf3 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -3001,7 +3001,7 @@ void MortevielleEngine::testKey(bool d) {
 	bool click;
 
 	_mouse.hideMouse();
-	fenat('K');
+	displayStatusInDescriptionBar('K');
 
 	// Wait for release from any key or mouse button
 	while (keyPressed())
@@ -3247,7 +3247,7 @@ void MortevielleEngine::tfleche() {
 	if (_num == 9999)
 		return;
 
-	fenat(chr(152));
+	displayStatusInDescriptionBar(chr(152));
 	bool inRect = false;
 	do {
 		touch = '\0';
@@ -3390,18 +3390,22 @@ int MortevielleEngine::checkLeaveSecretPassage() {
 	return CELLAR;
 }
 
-void MortevielleEngine::fenat(char ans) {
-	int coul;
+/**
+ * Display status character in description bar
+ * @remarks	Originally called 'fenat'
+ */
+void MortevielleEngine::displayStatusInDescriptionBar(char stat) {
+	int color;
 
 	_mouse.hideMouse();
 	if (_currGraphicalDevice == MODE_CGA)
-		coul = 2;
+		color = 2;
 	else if (_currGraphicalDevice == MODE_HERCULES)
-		coul = 1;
+		color = 1;
 	else
-		coul = 12;
+		color = 12;
 
-	_screenSurface.writeCharacter(Common::Point(306, 193), ord(ans), coul);
+	_screenSurface.writeCharacter(Common::Point(306, 193), ord(stat), color);
 	_screenSurface.drawBox(300, 191, 16, 8, 15);
 	_mouse.showMouse();
 }


Commit: 358c2770c5a3d628b06885e080a92f3412aea206
    https://github.com/scummvm/scummvm/commit/358c2770c5a3d628b06885e080a92f3412aea206
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-28T11:08:24-07:00

Commit Message:
MORTEVIELLE: Rename displayStatusArrow()

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 9026df8..bc81181 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -49,7 +49,7 @@ void MortevielleEngine::fctMove() {
 	if ((_coreVar._currPlace == LANDING) && (_msg[4] == _menu._moveMenu[6])) {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_GO_TO));
-		tfleche();
+		displayStatusArrow();
 
 		if (_keyPressedEsc)
 			_destinationOk = false;
@@ -218,7 +218,7 @@ void MortevielleEngine::fctTake() {
 	}
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_TAKE));
-	tfleche();
+	displayStatusArrow();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	if (_caff == 3) {
@@ -324,7 +324,7 @@ void MortevielleEngine::fctInventoryTake() {
 void MortevielleEngine::fctLift() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_LIFT));
-	tfleche();
+	displayStatusArrow();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	setCoordinates(3);
@@ -361,7 +361,7 @@ void MortevielleEngine::fctRead() {
 	else {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_READ));
-		tfleche();
+		displayStatusArrow();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			setCoordinates(4);
 			if (_num != 0)
@@ -394,7 +394,7 @@ void MortevielleEngine::fctLook() {
 	}
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_LOOK));
-	tfleche();
+	displayStatusArrow();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	setCoordinates(5);
@@ -485,7 +485,7 @@ void MortevielleEngine::fctSearch() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_SEARCH));
 
-	tfleche();
+	displayStatusArrow();
 	if (_anyone || _keyPressedEsc)
 		return;
 
@@ -595,7 +595,7 @@ void MortevielleEngine::fctOpen() {
 		return;
 	}
 
-	tfleche();
+	displayStatusArrow();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 
@@ -659,7 +659,7 @@ void MortevielleEngine::fctPlace() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_PUT));
 
-	tfleche();
+	displayStatusArrow();
 	if (_keyPressedEsc)
 		_crep = 998;
 
@@ -791,7 +791,7 @@ void MortevielleEngine::fctTurn() {
 	}
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_TURN));
-	tfleche();
+	displayStatusArrow();
 	if ((_anyone) || (_keyPressedEsc))
 		return;
 	setCoordinates(9);
@@ -827,7 +827,7 @@ void MortevielleEngine::fctTurn() {
 void MortevielleEngine::fctSelfHide() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_HIDE_SELF));
-	tfleche();
+	displayStatusArrow();
 	if (!(_anyone) && !(_keyPressedEsc)) {
 		setCoordinates(10);
 		if (_num == 0)
@@ -849,7 +849,7 @@ void MortevielleEngine::fctAttach() {
 	else {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_TIE));
-		tfleche();
+		displayStatusArrow();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			setCoordinates(8);
 			_crep = 997;
@@ -875,7 +875,7 @@ void MortevielleEngine::fctClose() {
 		displayTextInVerbBar(getEngineString(S_CLOSE));
 
 	if (_caff < ROOM26) {
-		tfleche();
+		displayStatusArrow();
 		if (_keyPressedEsc)
 			_crep = 998;
 		if ((_anyone) || (_keyPressedEsc))
@@ -920,7 +920,7 @@ void MortevielleEngine::fctKnock() {
 	}
 
 	if (_coreVar._currPlace < DOOR) {
-		tfleche();
+		displayStatusArrow();
 		if (!(_anyone) && !(_keyPressedEsc)) {
 			if ((_coreVar._currPlace < MOUNTAIN) && (_coreVar._currPlace != LANDING))
 				_crep = 133;
@@ -970,7 +970,7 @@ void MortevielleEngine::fctSelfPut() {
 				displayEmptyHand();
 			return;
 		}
-		tfleche();
+		displayStatusArrow();
 		if ((_anyone) || (_keyPressedEsc))
 			return;
 		setCoordinates(7);
@@ -1240,7 +1240,7 @@ void MortevielleEngine::fctForce() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_SMASH));
 	if (_caff < DOOR)
-		tfleche();
+		displayStatusArrow();
 
 	if ((!_anyone) && (!_keyPressedEsc)) {
 		if (_coreVar._currPlace != ROOM26)
@@ -1330,7 +1330,7 @@ void MortevielleEngine::fctSound() {
 	if (!_syn)
 		displayTextInVerbBar(getEngineString(S_PROBE2));
 	if (_caff < 27) {
-		tfleche();
+		displayStatusArrow();
 		if (!(_anyone) && (!_keyPressedEsc))
 			_crep = 145;
 		_num = 0;
@@ -1552,7 +1552,7 @@ void MortevielleEngine::fctSmell() {
 	if (_caff < ROOM26) {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_SMELL));
-		tfleche();
+		displayStatusArrow();
 		if (!(_anyone) && !(_keyPressedEsc))
 			if (_caff == CRYPT)
 				_crep = 153;
@@ -1570,7 +1570,7 @@ void MortevielleEngine::fctScratch() {
 	if (_caff < 27) {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_SCRATCH));
-		tfleche();
+		displayStatusArrow();
 	}
 	_num = 0;
 }
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index d4d57d8..74c1bc7 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -420,6 +420,8 @@ private:
 	void askRestart();
 	void delay(int amount);
 	void handleOpcode();
+	void displayStatusArrow();
+	void displayStatusInDescriptionBar(char stat);
 
 	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
 	void mapMessageId(int &mesgId);
@@ -438,7 +440,6 @@ private:
 	void writetp(Common::String s, int t);
 	void premtet();
 	void ajchai();
-	void tfleche();
 	void ecr2(Common::String text);
 	void init_nbrepm();
 	void aniof(int ouf, int num);
@@ -448,7 +449,6 @@ private:
 	void tsuiv();
 	void treg(int objId);
 	void rechai(int &ch);
-	void displayStatusInDescriptionBar(char stat);
 
 public:
 	Common::Point _prevPos;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index a0b7cf3..bf524b6 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -3240,7 +3240,11 @@ void MortevielleEngine::tsuiv() {
 	}
 }
 
-void MortevielleEngine::tfleche() {
+/**
+ * Display Arrow status
+ * @remarks	Originally called 'tfleche'
+ */
+void MortevielleEngine::displayStatusArrow() {
 	bool qust;
 	char touch;
 


Commit: 234af13011b17d974d299c4b5a79bf843099c0db
    https://github.com/scummvm/scummvm/commit/234af13011b17d974d299c4b5a79bf843099c0db
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-28T12:13:01-07:00

Commit Message:
MORTEVIELLE: Some more renaming, introduce MENU_NONE constant

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index bc81181..7181d16 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -77,7 +77,7 @@ void MortevielleEngine::fctMove() {
 			_roomDoorId = _num - 3;
 
 		if (_num != 6)
-			affrep();
+			prepareDisplayText();
 		else
 			showMoveMenuAlert();
 		return;
@@ -164,11 +164,11 @@ void MortevielleEngine::fctMove() {
 			loseGame();
 		} else {
 			_coreVar._currPlace = INSIDE_WELL;
-			affrep();
+			prepareDisplayText();
 		}
 	}
 	if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
-		affrep();
+		prepareDisplayText();
 	resetRoomVariables(_coreVar._currPlace);
 	_menu.setDestinationText(_coreVar._currPlace);
 }
@@ -203,7 +203,7 @@ void MortevielleEngine::fctTake() {
 					_coreVar._wellObjectId = 0;
 				_menu.unsetSearchMenu();
 				_obpart = false;
-				affrep();
+				prepareDisplayText();
 			} else {
 				_tabdon[kAcha + ((_mchai - 1) * 10) + _searchCount - 1] = 0;
 				tsuiv();
@@ -735,7 +735,7 @@ void MortevielleEngine::fctPlace() {
 							aniof(2, 1);
 							_crep = 166;
 						}
-						affrep();
+						prepareDisplayText();
 					} else {
 						aniof(2, 1);
 						_crep = 166;
@@ -813,7 +813,7 @@ void MortevielleEngine::fctTurn() {
 			int answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
 			if (answer == 1) {
 				_coreVar._currPlace = CRYPT;
-				affrep();
+				prepareDisplayText();
 			} else
 				_crep = 176;
 		}
@@ -1175,7 +1175,7 @@ void MortevielleEngine::fctEnter() {
 			aniof(1, 1);
 
 			_coreVar._currPlace = _roomDoorId;
-			affrep();
+			prepareDisplayText();
 			resetRoomVariables(_coreVar._currPlace);
 			_menu.setDestinationText(_coreVar._currPlace);
 			_roomDoorId = OWN_ROOM;
@@ -1199,7 +1199,7 @@ void MortevielleEngine::fctSleep() {
 	if (_coreVar._currPlace != OWN_ROOM) {
 		exitRoom();
 		_coreVar._currPlace = OWN_ROOM;
-		affrep();
+		prepareDisplayText();
 		drawPictureWithText();
 		resetRoomVariables(_coreVar._currPlace);
 		_menu.setDestinationText(_coreVar._currPlace);
@@ -1537,7 +1537,7 @@ void MortevielleEngine::fctDiscuss() {
 	showPeoplePresent(_currBitIndex);
 	prepareRoom();
 	drawClock();
-	affrep();
+	prepareDisplayText();
 	/* chech;*/
 	_menu.setDestinationText(_coreVar._currPlace);
 	clearVerbBar();
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index 61430bf..d4538ef 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -35,8 +35,9 @@ namespace Mortevielle {
 class MortevielleEngine;
 
 enum {
-	MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3, MENU_SELF = 4,
-	MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,   MENU_LOAD = 8
+	MENU_NONE = 0, MENU_INVENTORY = 1, MENU_MOVE = 2, MENU_ACTION = 3,
+	MENU_SELF = 4, MENU_DISCUSS = 5,   MENU_FILE = 6, MENU_SAVE = 7,
+	MENU_LOAD = 8
 };
 
 class Menu {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 74c1bc7..ac86eb1 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -444,7 +444,7 @@ private:
 	void init_nbrepm();
 	void aniof(int ouf, int num);
 	void tlu(int af, int ob);
-	void affrep();
+	void prepareDisplayText();
 	void mennor();
 	void tsuiv();
 	void treg(int objId);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index bf524b6..8eef278 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1338,7 +1338,7 @@ bool MortevielleEngine::checkInventory(int objectId) {
  */
 void MortevielleEngine::displayDiningRoom() {
 	_coreVar._currPlace = DINING_ROOM;
-	affrep();
+	prepareDisplayText();
 }
 
 /**
@@ -1409,7 +1409,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		drawClock();
 		_mouse.showMouse();
 		_coreVar._currPlace = OWN_ROOM;
-		affrep();
+		prepareDisplayText();
 		resetPresenceInRooms(DINING_ROOM);
 		if (!_blo)
 			getPresence(OWN_ROOM);
@@ -1432,7 +1432,7 @@ void MortevielleEngine::checkManorDistance() {
 	} else {
 		_destinationOk = true;
 		_coreVar._currPlace = MOUNTAIN;
-		affrep();
+		prepareDisplayText();
 	}
 }
 
@@ -1443,7 +1443,7 @@ void MortevielleEngine::checkManorDistance() {
 void MortevielleEngine::gotoManorFront() {
 	_manorDistance = 0;
 	_coreVar._currPlace = MANOR_FRONT;
-	affrep();
+	prepareDisplayText();
 }
 
 /**
@@ -1452,7 +1452,7 @@ void MortevielleEngine::gotoManorFront() {
  */
 void MortevielleEngine::gotoManorBack() {
 	_coreVar._currPlace = MANOR_BACK;
-	affrep();
+	prepareDisplayText();
 }
 
 /**
@@ -1518,7 +1518,7 @@ void MortevielleEngine::gameLoaded() {
 	_manorDistance = 0;
 	resetOpenObjects();
 	_takeObjCount = 0;
-	affrep();
+	prepareDisplayText();
 	_hintPctMessage = getString(580);
 
 	_destinationOk = false;
@@ -3038,7 +3038,11 @@ void MortevielleEngine::tlu(int af, int ob) {
 	_crep = 998;
 }
 
-void MortevielleEngine::affrep() {
+/**
+ * Prepare Display Text
+ * @remarks	Originally called 'affrep'
+ */
+void MortevielleEngine::prepareDisplayText() {
 	_caff = _coreVar._currPlace;
 	_crep = _coreVar._currPlace;
 }
@@ -3209,7 +3213,7 @@ L1:
 			clearDescriptionBar();
 			displayAloneText();
 			resetRoomVariables(MANOR_FRONT);
-			affrep();
+			prepareDisplayText();
 		}
 	}
 	if (_menu._menuDisplayed)
@@ -3233,7 +3237,7 @@ void MortevielleEngine::tsuiv() {
 		if (_currBitIndex != 0)
 			_coreVar._faithScore += 2;
 	} else {
-		affrep();
+		prepareDisplayText();
 		endSearch();
 		if (cx > 9)
 			_crep = 131;
@@ -3347,7 +3351,7 @@ void MortevielleEngine::treg(int objId) {
 			handleDescriptionText(2, _caff + 400);
 		testKey(true);
 		_caff = mdes;
-		_msg[3] = 0;
+		_msg[3] = MENU_NONE;
 		_crep = 998;
 	} else {
 		_obpart = true;


Commit: e04e2452ce1abbdf01e2b4f9351aba929d03c39d
    https://github.com/scummvm/scummvm/commit/e04e2452ce1abbdf01e2b4f9351aba929d03c39d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-28T13:07:53-07:00

Commit Message:
MORTEVIELLE: Get rid of some magic values

Changed paths:
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 408ea07..6035c3a 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -239,30 +239,30 @@ void Menu::invert(int indx) {
 
 	Common::String str;
 	switch (_msg3) {
-	case 1:
+	case MENU_INVENTORY:
 		str = _inventoryStringArray[menuIndex];
 		break;
-	case 2:
+	case MENU_MOVE:
 		str = _moveStringArray[menuIndex];
 		break;
-	case 3:
+	case MENU_ACTION:
 		str = _actionStringArray[menuIndex];
 		break;
-	case 4:
+	case MENU_SELF:
 		str = _selfStringArray[menuIndex];
 		break;
-	case 5:
+	case MENU_DISCUSS:
 		str = _discussStringArray[menuIndex];
 		break;
-	case 6:
+	case MENU_FILE:
 		str = _vm->getEngineString(S_SAVE_LOAD + menuIndex);
 		break;
-	case 7:
+	case MENU_SAVE:
 		str = _vm->getEngineString(S_SAVE_LOAD + 1);
 		str += ' ';
 		str += (char)(48 + menuIndex);
 		break;
-	case 8:
+	case MENU_LOAD:
 		if (menuIndex == 1) {
 			str = _vm->getEngineString(S_RESTART);
 		} else {
@@ -470,9 +470,9 @@ void Menu::updateMenu() {
 			_vm->setMouseClick(false);
 			menuUp(_msg3);
 			if (lo(_msg4) == 1)
-				_msg3 = 7;
+				_msg3 = MENU_SAVE;
 			else
-				_msg3 = 8;
+				_msg3 = MENU_LOAD;
 			menuDown(_msg3);
 
 			_vm->setMouseClick(false);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index ac86eb1..e2d1a5e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -432,6 +432,7 @@ private:
 	void drawPictureWithText();
 	void addObjectToInventory(int objectId);
 	void putInHand(int &objId);
+	void prepareDisplayText();
 
 	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
 	void copcha();
@@ -444,7 +445,6 @@ private:
 	void init_nbrepm();
 	void aniof(int ouf, int num);
 	void tlu(int af, int ob);
-	void prepareDisplayText();
 	void mennor();
 	void tsuiv();
 	void treg(int objId);


Commit: c76d176809c172eb76c473152fb80290749928e3
    https://github.com/scummvm/scummvm/commit/c76d176809c172eb76c473152fb80290749928e3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-29T01:30:42-07:00

Commit Message:
MORTEVIELLE: More renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 7181d16..38cbb30 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -509,7 +509,7 @@ void MortevielleEngine::fctSearch() {
 				if (_currBitIndex > 0)
 					_coreVar._faithScore += 3;
 
-				rechai(_mchai);
+				_mchai = rechai();
 				if (_mchai != 0) {
 					_searchCount = 0;
 					_heroSearching = true;
@@ -893,8 +893,7 @@ void MortevielleEngine::fctClose() {
 				--_openObjCount;
 				if (_openObjCount < 0)
 					_openObjCount = 0;
-				int chai = 9999;
-				rechai(chai);
+				int chai = rechai();
 				if (_mchai == chai)
 					_mchai = 0;
 			} else {
@@ -976,8 +975,7 @@ void MortevielleEngine::fctSelfPut() {
 		setCoordinates(7);
 		_crep = 124;
 		if (_num != 0) {
-			int chai;
-			rechai(chai);
+			int chai = rechai();
 			if (chai == 0)
 				_crep = 997;
 			else {
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index c53b20f..69cb81b 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -447,7 +447,7 @@ int DialogManager::waitForF3F8() {
 	int key;
 
 	do {
-		key = _vm->testou();
+		key = _vm->gettKeyPressed();
 		if (_vm->shouldQuit())
 			return key;
 	} while ((key != 61) && (key != 66));
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e2d1a5e..e6f8a1f 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -418,7 +418,6 @@ private:
 	void fctScratch();
 	void endGame();
 	void askRestart();
-	void delay(int amount);
 	void handleOpcode();
 	void displayStatusArrow();
 	void displayStatusInDescriptionBar(char stat);
@@ -448,7 +447,7 @@ private:
 	void mennor();
 	void tsuiv();
 	void treg(int objId);
-	void rechai(int &ch);
+	int  rechai();
 
 public:
 	Common::Point _prevPos;
@@ -510,6 +509,7 @@ public:
 	Common::String getEngineString(int idx) const { return _engineStrings[idx]; }
 	Common::String getGameString(int idx) const { return _gameStrings[idx]; }
 
+	void delay(int amount);
 	void gameLoaded();
 	void initGame();
 	void displayAloneText();
@@ -524,7 +524,7 @@ public:
 	void displayEmptyHand();
 
 	void hirs();
-	int  testou();
+	int  gettKeyPressed();
 	void handleDescriptionText(int f, int mesgId);
 	int  animof(int ouf, int num);
 	void pictout(int seg, int dep, int x, int y);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 8eef278..7756d91 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -3005,7 +3005,7 @@ void MortevielleEngine::testKey(bool d) {
 
 	// Wait for release from any key or mouse button
 	while (keyPressed())
-		_key = testou();
+		_key = gettKeyPressed();
 
 	do {
 		_mouse.getMousePosition(x, y, click);
@@ -3022,7 +3022,7 @@ void MortevielleEngine::testKey(bool d) {
 			return;
 	} while (!(quest || (click) || (d && _anyone)));
 	if (quest)
-		testou();
+		gettKeyPressed();
 	setMouseClick(false);
 	_mouse.showMouse();
 }
@@ -3377,12 +3377,13 @@ void MortevielleEngine::putInHand(int &objId) {
 	}
 }
 
-void MortevielleEngine::rechai(int &ch) {
+int MortevielleEngine::rechai() {
 	int tmpPlace = _coreVar._currPlace;
 
 	if (_coreVar._currPlace == CRYPT)
 		tmpPlace = CELLAR;
-	ch = _tabdon[kAchai + (tmpPlace * 7) + _num - 1];
+
+	return _tabdon[kAchai + (tmpPlace * 7) + _num - 1];
 }
 
 /**
@@ -3424,10 +3425,14 @@ void MortevielleEngine::displayStatusInDescriptionBar(char stat) {
  */
 void MortevielleEngine::testKeyboard() {
 	if (keyPressed())
-		testou();
+		gettKeyPressed();
 }
 
-int MortevielleEngine::testou() {
+/**
+ * Test Key Pressed
+ * @remarks	Originally called 'testou'
+ */
+int MortevielleEngine::gettKeyPressed() {
 	char ch = getChar();
 
 	switch (ch)  {


Commit: b7035ad475d05b3122d86833c7b6a1504aaa4d1f
    https://github.com/scummvm/scummvm/commit/b7035ad475d05b3122d86833c7b6a1504aaa4d1f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-29T01:31:30-07:00

Commit Message:
MORTEVIELLE: Fix compilation of music code

Changed paths:
    engines/mortevielle/sound.cpp



diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 478af41..de5c4fe 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -177,7 +177,7 @@ void SoundManager::playNote(int frequency, int32 length) {
 
 void SoundManager::musyc(tablint &tb, int nbseg, int att) {
 #ifdef DEBUG
-	const byte *pSrc = &mem[0x5000 * 16];
+	const byte *pSrc = &_vm->_mem[0x5000 * 16];
 
 	// Convert the countdown amount to a tempo rate, and then to note length in microseconds
 	int tempo = TIMER_FREQUENCY / att;


Commit: 1912c4a844bcbe102d66afd0cbb82d6d8283136c
    https://github.com/scummvm/scummvm/commit/1912c4a844bcbe102d66afd0cbb82d6d8283136c
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-06-30T12:26:07-07:00

Commit Message:
MORTEVIELLE: Fix access to free'ed memory

Two buffers were allocated and then free'ed in initialise(), which caused
memory issues when accessed later on throughout the game. They are now
free'ed from the MortevielleEngine destructor.

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 6977ab4..7220cd6 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -101,6 +101,10 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 }
 
 MortevielleEngine::~MortevielleEngine() {
+	// Allocated from run() > initialise() > loadCFIPH()
+	free(_speechManager._cfiphBuffer);
+	// Allocated from run() > initialise() > loadCFIEC()
+	free(_cfiecBuffer);
 }
 
 /**
@@ -204,8 +208,6 @@ Common::ErrorCode MortevielleEngine::initialise() {
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
 
-	free(_cfiecBuffer);
-	free(_speechManager._cfiphBuffer);
 	return Common::kNoError;
 }
 


Commit: 313f06e53b3afc663183ce71eddf00de4f45f37f
    https://github.com/scummvm/scummvm/commit/313f06e53b3afc663183ce71eddf00de4f45f37f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-06-30T12:45:43-07:00

Commit Message:
MORTEVIELLE: Fix memory leak with the _screenSurface

The _screenSurface was not free'ed after being created. This is now
done at the end of run() (the Surface is created at the start of run()
when calling initialise()). Also moved a few free() from the destructor
to the end of run() in case run() can be called more than once on the
same engine.

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7220cd6..46c7c75 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -101,10 +101,6 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 }
 
 MortevielleEngine::~MortevielleEngine() {
-	// Allocated from run() > initialise() > loadCFIPH()
-	free(_speechManager._cfiphBuffer);
-	// Allocated from run() > initialise() > loadCFIEC()
-	free(_cfiecBuffer);
 }
 
 /**
@@ -174,8 +170,10 @@ Common::ErrorCode MortevielleEngine::initialise() {
 
 	// Load the mort.dat resource
 	Common::ErrorCode result = loadMortDat();
-	if (result != Common::kNoError)
+	if (result != Common::kNoError) {
+		_screenSurface.free();
 		return result;
+	}
 
 	// Load some error messages (was previously in chartex())
 	_hintPctMessage = getString(580);  // You should have noticed %d hints
@@ -341,6 +339,11 @@ Common::Error MortevielleEngine::run() {
 
 	// Run the main game loop
 	mainGame();
+	
+	// Cleanup (allocated in initialise())
+	_screenSurface.free();
+	free(_speechManager._cfiphBuffer);
+	free(_cfiecBuffer);
 
 	return Common::kNoError;
 }


Commit: e857c95cb572aa026090802597b0c8fa5acbc951
    https://github.com/scummvm/scummvm/commit/e857c95cb572aa026090802597b0c8fa5acbc951
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T13:25:55-07:00

Commit Message:
Merge pull request #1 from criezy/mortevielle

Mortevielle

Changed paths:
    engines/mortevielle/mortevielle.cpp





Commit: 7505b97b039c0eaf0f8d9c5c7e89186e53a31f99
    https://github.com/scummvm/scummvm/commit/7505b97b039c0eaf0f8d9c5c7e89186e53a31f99
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T16:18:14-07:00

Commit Message:
MORTEVIELLE: Some renaming GfxSurface

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 39a38c2..001c1cc 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -81,7 +81,7 @@ void PaletteManager::setDefaultPalette() {
  * of 18 different encoding methods.
  *-------------------------------------------------------------------------*/
 
-#define INCR_TAIX { if (_xSize & 1) ++_xSize; }
+#define INCR_XSIZE { if (_xSize & 1) ++_xSize; }
 #define DEFAULT_WIDTH (SCREEN_WIDTH / 2)
 #define BUFFER_SIZE 40000
 
@@ -171,7 +171,7 @@ void GfxSurface::decode(const byte *pSrc) {
 
 						for (int idx = 0; idx < innerCount; ++idx, ++tableOffset) {
 							assert(tableOffset < BUFFER_SIZE);
-							lookupTable[tableOffset] = suiv(pSrc);
+							lookupTable[tableOffset] = nextNibble(pSrc);
 						}
 					} while (--outerCount > 0);
 				} while (_lookupIndex < (lookupBytes - 1));
@@ -179,7 +179,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			} else {
 				assert(lookupBytes < BUFFER_SIZE);
 				for (int idx = 0; idx < (lookupBytes * 2); ++idx)
-					lookupTable[idx] = suiv(pSrc);
+					lookupTable[idx] = nextNibble(pSrc);
 			}
 
 			if (_nibbleFlag) {
@@ -240,12 +240,12 @@ void GfxSurface::decode(const byte *pSrc) {
 			// Draw rect at pos
 			pDest = &outputBuffer[_yp * DEFAULT_WIDTH + _xp];
 			pSrcStart = pSrc;
-			INCR_TAIX;
+			INCR_XSIZE;
 
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 				byte *pDestLine = pDest;
 				for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-					*pDestLine++ = suiv(pSrc);
+					*pDestLine++ = nextNibble(pSrc);
 				}
 			}
 
@@ -254,15 +254,15 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		case 1:
 			// Draw rect using horizontal lines alternating left to right, then right to left
-			INCR_TAIX;
+			INCR_XSIZE;
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
 				if ((yCtr % 2) == 0) {
 					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-						*pDest++ = csuiv(pSrc, pLookup);
+						*pDest++ = nextByte(pSrc, pLookup);
 					}
 				} else {
 					for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
-						*--pDest = csuiv(pSrc, pLookup);
+						*--pDest = nextByte(pSrc, pLookup);
 					}
 				}
 				pDest += DEFAULT_WIDTH;
@@ -274,12 +274,12 @@ void GfxSurface::decode(const byte *pSrc) {
 			for (int xCtr = 0; xCtr < _xSize; ++xCtr) {
 				if ((xCtr % 2) == 0) {
 					for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 					}
 				} else {
 					for (int yCtr = 0; yCtr < _ySize; ++yCtr) {
 						pDest -= DEFAULT_WIDTH;
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 					}
 				}
 				++pDest;
@@ -310,11 +310,11 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		case 7:
 			// Draw rect using horizontal lines left to right
-			INCR_TAIX;
+			INCR_XSIZE;
 			for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDest += DEFAULT_WIDTH) {
 				byte *pDestLine = pDest;
 				for (int xCtr = 0; xCtr < _xSize; ++xCtr)
-					*pDestLine++ = csuiv(pSrc, pLookup);
+					*pDestLine++ = nextByte(pSrc, pLookup);
 			}
 			break;
 
@@ -323,7 +323,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			for (int xCtr = 0; xCtr < _xSize; ++xCtr, ++pDest) {
 				byte *pDestLine = pDest;
 				for (int yCtr = 0; yCtr < _ySize; ++yCtr, pDestLine += DEFAULT_WIDTH)
-					*pDestLine = csuiv(pSrc, pLookup);
+					*pDestLine = nextByte(pSrc, pLookup);
 			}
 			break;
 
@@ -342,7 +342,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 12:
-			INCR_TAIX;
+			INCR_XSIZE;
 			_thickness = _xInc = 1;
 			_yInc = DEFAULT_WIDTH;
 			_yEnd = _ySize;
@@ -351,7 +351,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 13:
-			INCR_TAIX;
+			INCR_XSIZE;
 			_thickness = _xSize;
 			_yInc = 1;
 			_yEnd = _xSize;
@@ -369,7 +369,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 15:
-			INCR_TAIX;
+			INCR_XSIZE;
 			_thickness = 2;
 			_yInc = DEFAULT_WIDTH;
 			_yEnd = _ySize;
@@ -388,7 +388,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 17:
-			INCR_TAIX;
+			INCR_XSIZE;
 			_thickness = 3;
 			_yInc = DEFAULT_WIDTH;
 			_yEnd = _ySize;
@@ -398,7 +398,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			break;
 
 		case 18:
-			INCR_TAIX;
+			INCR_XSIZE;
 			_thickness = 5;
 			_yInc = DEFAULT_WIDTH;
 			_yEnd = _ySize;
@@ -436,7 +436,7 @@ void GfxSurface::majTtxTty() {
 		_height += _ySize;
 }
 
-byte GfxSurface::suiv(const byte *&pSrc) {
+byte GfxSurface::nextNibble(const byte *&pSrc) {
 	int v = *pSrc;
 	if (_nibbleFlag) {
 		++pSrc;
@@ -449,13 +449,13 @@ byte GfxSurface::suiv(const byte *&pSrc) {
 	}
 }
 
-byte GfxSurface::csuiv(const byte *&pSrc, const byte *&pLookup) {
+byte GfxSurface::nextByte(const byte *&pSrc, const byte *&pLookup) {
 	assert(pLookup);
 
 	while (!_lookupValue) {
 		int v;
 		do {
-			v = suiv(pSrc) & 0xff;
+			v = nextNibble(pSrc) & 0xff;
 			_lookupValue += v;
 		} while (v == 0xf);
 		++pLookup;
@@ -467,16 +467,16 @@ byte GfxSurface::csuiv(const byte *&pSrc, const byte *&pLookup) {
 
 int GfxSurface::desanalyse(const byte *&pSrc) {
 	int total = 0;
-	int v = suiv(pSrc);
-	if (v == 15) {
+	int v = nextNibble(pSrc);
+	if (v == 0xf) {
 		int v2;
 		do {
-			v2 = suiv(pSrc);
+			v2 = nextNibble(pSrc);
 			total += v2;
-		} while (v2 == 15);
+		} while (v2 == 0xf);
 
 		total *= 15;
-		v = suiv(pSrc);
+		v = nextNibble(pSrc);
 	}
 
 	total += v;
@@ -484,7 +484,7 @@ int GfxSurface::desanalyse(const byte *&pSrc) {
 }
 
 void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
-	INCR_TAIX;
+	INCR_XSIZE;
 	byte *pDestEnd = pDest + (_ySize - 1) * DEFAULT_WIDTH + _xSize;
 
 	for (;;) {
@@ -504,14 +504,14 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 
 					// Write out vertical slice top to bottom
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest += DEFAULT_WIDTH)
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 
 					++pDest;
 				} else {
 					// Write out vertical slice bottom to top
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex) {
 						pDest -= DEFAULT_WIDTH;
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 					}
 				}
 			}
@@ -538,12 +538,12 @@ void GfxSurface::horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLooku
 				if ((xIndex % 2) == 0) {
 					// Write out vertical slice top to bottom
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex, pDest += DEFAULT_WIDTH)
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 				} else {
 					// Write out vertical slice top to bottom
 					for (int yIndex = 0; yIndex < _thickness; ++yIndex) {
 						pDest -= DEFAULT_WIDTH;
-						*pDest = csuiv(pSrc, pLookup);
+						*pDest = nextByte(pSrc, pLookup);
 					}
 				}
 			}
@@ -591,12 +591,12 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 
 				drawIndex += _thickness;
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
-					*pDest++ = csuiv(pSrc, pLookup);
+					*pDest++ = nextByte(pSrc, pLookup);
 			} else {
 				pDest += DEFAULT_WIDTH;
 				drawIndex -= _thickness;
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
-					*--pDest = csuiv(pSrc, pLookup);
+					*--pDest = nextByte(pSrc, pLookup);
 			}
 		}
 		if ((_ySize % 2) == 0) {
@@ -618,13 +618,13 @@ void GfxSurface::vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				drawIndex += _thickness;
 
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
-					*pDest++ = csuiv(pSrc, pLookup);
+					*pDest++ = nextByte(pSrc, pLookup);
 			} else {
 				pDest -= DEFAULT_WIDTH;
 				drawIndex -= _thickness;
 
 				for (int xCtr = 0; xCtr < _thickness; ++xCtr)
-					*--pDest = csuiv(pSrc, pLookup);
+					*--pDest = nextByte(pSrc, pLookup);
 			}
 		}
 		if ((_ySize % 2) == 0) {
@@ -645,7 +645,7 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 	while (areaNum != -1) {
 		switch (areaNum) {
 		case 0:
-			*pDest = csuiv(pSrc, pLookup);
+			*pDest = nextByte(pSrc, pLookup);
 			areaNum = 1;
 			break;
 
@@ -663,7 +663,7 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 					++yPos;
 				}
 
-				*++pDest = csuiv(pSrc, pLookup);
+				*++pDest = nextByte(pSrc, pLookup);
 				areaNum = 2;
 			} else if (yPos != _ySize) {
 				++yPos;
@@ -675,7 +675,7 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				increments(pDest);
 				++drawIndex;
 
-				*++pDest = csuiv(pSrc, pLookup);
+				*++pDest = nextByte(pSrc, pLookup);
 
 				if (drawIndex == _xSize) {
 					areaNum = -1;
@@ -705,7 +705,7 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				++drawIndex;
 				--yPos;
 
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 				areaNum = 2;
 			} else {
 				pDest += DEFAULT_WIDTH;
@@ -714,7 +714,7 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				NIV();
 				increments(pDest);
 
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 
 				if (yPos == _ySize)
 					areaNum = -1;
@@ -734,7 +734,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 		for (;;) {
 			NIH();
 			for (int idx = 0; idx <= _thickness; ++idx) {
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 				NIH();
 				increments(pDest);
 			}
@@ -743,7 +743,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 				NIH();
 				increments(pDest);
 			}
@@ -771,7 +771,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 
 		for (;;) {
 			for (int idx = 0; idx <= _thickness; ++idx) {
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 				NIH();
 				increments(pDest);
 			}
@@ -780,7 +780,7 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
-				*pDest = csuiv(pSrc, pLookup);
+				*pDest = nextByte(pSrc, pLookup);
 				NIH();
 				increments(pDest);
 			}
@@ -842,7 +842,7 @@ void GfxSurface::TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int
 	v += _thickness + 1;
 
 	for (int idx = 0; idx <= _thickness; ++idx) {
-		*pDest = csuiv(pSrc, pLookup);
+		*pDest = nextByte(pSrc, pLookup);
 		pDest += _yInc;
 	}
 }
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 026950e..116eb22 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -58,9 +58,10 @@ private:
 	int _yInc, _yEnd, _xInc, _xEnd;
 	int _width, _height;
 
+	byte nextNibble(const byte *&pSrc);
+	byte nextByte(const byte *&pSrc, const byte *&pLookup);
+
 	void majTtxTty();
-	byte suiv(const byte *&pSrc);
-	byte csuiv(const byte *&pSrc, const byte *&pLookup);
 	int desanalyse(const byte *&pSrc);
 	void horizontal(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);


Commit: 0be08ea2c8f70db01ca8155d40250cabfad49431
    https://github.com/scummvm/scummvm/commit/0be08ea2c8f70db01ca8155d40250cabfad49431
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-06-30T23:03:19-07:00

Commit Message:
MORTEVIELLE: Some more renaming in GfxSurface

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 001c1cc..ff60145 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -436,6 +436,10 @@ void GfxSurface::majTtxTty() {
 		_height += _ySize;
 }
 
+/**
+ * Decompression Function - get next nibble
+ * @remarks	Originally called 'suiv'
+ */
 byte GfxSurface::nextNibble(const byte *&pSrc) {
 	int v = *pSrc;
 	if (_nibbleFlag) {
@@ -449,6 +453,10 @@ byte GfxSurface::nextNibble(const byte *&pSrc) {
 	}
 }
 
+/**
+ * Decompression Function - get next byte
+ * @remarks	Originally called 'csuiv'
+ */
 byte GfxSurface::nextByte(const byte *&pSrc, const byte *&pLookup) {
 	assert(pLookup);
 
@@ -650,14 +658,14 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 			break;
 
 		case 1:
-			increments(pDest);
+			nextDecompPtr(pDest);
 
 			if (!drawIndex) {
-				NIH();
-				NIV();
+				negXInc();
+				negYInc();
 
 				if (yPos == _ySize) {
-					increments(pDest);
+					nextDecompPtr(pDest);
 					++drawIndex;
 				} else {
 					++yPos;
@@ -670,9 +678,9 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 				--drawIndex;
 				areaNum = 0;
 			} else {
-				NIH();
-				NIV();
-				increments(pDest);
+				negXInc();
+				negYInc();
+				nextDecompPtr(pDest);
 				++drawIndex;
 
 				*++pDest = nextByte(pSrc, pLookup);
@@ -686,14 +694,14 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 			break;
 
 		case 2:
-			increments(pDest);
+			nextDecompPtr(pDest);
 
 			if (!yPos) {
-				NIH();
-				NIV();
+				negXInc();
+				negYInc();
 
 				if (drawIndex == _xSize) {
-					increments(pDest);
+					nextDecompPtr(pDest);
 					++yPos;
 				} else {
 					++drawIndex;
@@ -710,9 +718,9 @@ void GfxSurface::decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup)
 			} else {
 				pDest += DEFAULT_WIDTH;
 				++yPos;
-				NIH();
-				NIV();
-				increments(pDest);
+				negXInc();
+				negYInc();
+				nextDecompPtr(pDest);
 
 				*pDest = nextByte(pSrc, pLookup);
 
@@ -732,25 +740,25 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 
 	while (!TFP(diagIndex)) {
 		for (;;) {
-			NIH();
+			negXInc();
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = nextByte(pSrc, pLookup);
-				NIH();
-				increments(pDest);
+				negXInc();
+				nextDecompPtr(pDest);
 			}
 
-			NIV();
+			negYInc();
 			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = nextByte(pSrc, pLookup);
-				NIH();
-				increments(pDest);
+				negXInc();
+				nextDecompPtr(pDest);
 			}
 
-			NIH();
-			NIV();
-			increments(pDest);
+			negXInc();
+			negYInc();
+			nextDecompPtr(pDest);
 
 			++drawIndex;
 			if (_xEnd < (drawIndex + 1)) {
@@ -772,52 +780,63 @@ void GfxSurface::diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup) {
 		for (;;) {
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = nextByte(pSrc, pLookup);
-				NIH();
-				increments(pDest);
+				negXInc();
+				nextDecompPtr(pDest);
 			}
 
-			NIV();
+			negYInc();
 			pDest += _yInc;
 
 			for (int idx = 0; idx <= _thickness; ++idx) {
 				*pDest = nextByte(pSrc, pLookup);
-				NIH();
-				increments(pDest);
+				negXInc();
+				nextDecompPtr(pDest);
 			}
 
-			NIH();
-			NIV();
-			increments(pDest);
+			negXInc();
+			negYInc();
+			nextDecompPtr(pDest);
 
 			if (--drawIndex == 0) {
 				TF1(pDest, diagIndex);
-				NIH();
+				negXInc();
 				break;
 			} else {
 				pDest += _xInc;
 
 				if (--drawIndex == 0) {
 					TF2(pSrc, pDest, pLookup, diagIndex);
-					NIH();
+					negXInc();
 					break;
 				}
 			}
 
-			NIH();
+			negXInc();
 		}
 	}
 }
 
-
-void GfxSurface::increments(byte *&pDest) {
+/**
+ * Decompression Function - Move pDest ptr to next value to uncompress
+ * @remarks	Originally called 'increments'
+ */
+void GfxSurface::nextDecompPtr(byte *&pDest) {
 	pDest += _xInc + _yInc;
 }
 
-void GfxSurface::NIH() {
+/**
+ * Decompression Function - set xInc to its opposite value
+ * @remarks	Originally called 'NIH'
+ */
+void GfxSurface::negXInc() {
 	_xInc = -_xInc;
 }
 
-void GfxSurface::NIV() {
+/**
+ * Decompression Function - set yInc to its opposite value
+ * @remarks	Originally called 'NIV'
+ */
+void GfxSurface::negYInc() {
 	_yInc = -_yInc;
 }
 
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 116eb22..3a54f0c 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -67,9 +67,9 @@ private:
 	void vertical(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void decom11(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
 	void diag(const byte *&pSrc, byte *&pDest, const byte *&pLookup);
-	void increments(byte *&pDest);
-	void NIH();
-	void NIV();
+	void nextDecompPtr(byte *&pDest);
+	void negXInc();
+	void negYInc();
 	bool TFP(int v);
 	void TF1(byte *&pDest, int &v);
 	void TF2(const byte *&pSrc, byte *&pDest, const byte *&pLookup, int &v);


Commit: 80423487443b11d4fafcfb735a4dae77009884fb
    https://github.com/scummvm/scummvm/commit/80423487443b11d4fafcfb735a4dae77009884fb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-02T15:38:51-07:00

Commit Message:
MORTEVIELLE: The German version now starts with broken texts

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e6f8a1f..486f93f 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -125,7 +125,7 @@ const int kArep = 1314;
 const int kAmzon = 1650;
 const int kArega = 0;
 
-const int kMaxTi = 7975;
+const int kMaxTi = 9000;
 const int kMaxTd = 600;
 
 const int kDescriptionStringIndex = 0;                // Unused
@@ -136,7 +136,7 @@ const int kMenuPlaceStringIndex = 435;
 const int kMenuActionStringIndex = 476;
 const int kMenuSelfStringIndex = 497;
 const int kMenuSayStringIndex = 502;
-const int kSecretPassageQuestionStringIndex = 510;    // Unusued?
+const int kSecretPassageQuestionStringIndex = 510;    // Unused?
 const int kMaxPatt = 20;
 
 const int OPCODE_NONE = 0;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 7756d91..8c2d375 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2082,8 +2082,10 @@ void MortevielleEngine::loadTexts() {
 		}
 	}
 	if (!ntpFile.open("TXX.NTP")) {
-		warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
-		return;
+		if (!ntpFile.open("TXX.IND")) {
+			warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
+			return;
+		}
 	}
 
 	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {


Commit: 26f5ed607ff4a5470f0a7560fa09550e3e3b1fa3
    https://github.com/scummvm/scummvm/commit/26f5ed607ff4a5470f0a7560fa09550e3e3b1fa3
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-02T15:45:56-07:00

Commit Message:
MORTEVIELLE: Fix extraction tool to handle German DOS version

Changed paths:
    devtools/extract_mort/extract_mort.cpp



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index 477ca44..0d603f7 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -114,37 +114,63 @@ public:
 };
 
 File textFile, txxInp, txxNtp;
+int _version;
 
 /*-------------------------------------------------------------------------*/
 
 #define BUFFER_SIZE 32768
 
-const byte tabdr[32] = {
-	32, 101, 115,  97, 114, 105, 110,
+const byte tabdrFr[32] = {
+	32, 101, 115,  97, 114, 105, 110, // ' e♣arinutol
 	117, 116, 111, 108,  13, 100,  99,
 	112, 109,  46, 118, 130,  39, 102,
 	98,  44, 113, 104, 103,  33,  76,
 	85, 106,  30,  31
 };
 
-const byte tab30[32] = {
-	69,  67,  74, 138, 133, 120,  77, 122,
+const byte tabdrDe[32] = {
+	0x20, 0x65, 0x6E, 0x69, 0x73, 0x72, 0x74, // ' e♣arinutol
+	0x68, 0x61, 0x75, 0x0D, 0x63, 0x6C, 0x64,
+	0x6D, 0x6F, 0x67, 0x2E, 0x62, 0x66, 0x53,
+	0x2C, 0x77, 0x45, 0x7A, 0x6B, 0x44, 0x76,
+	0x9C, 0x47, 0x1E, 0x1F
+};
+
+const byte tab30Fr[32] = {
+	69,  67,  74, 138, 133, 120,  77, 122, //ECJèà¶M
 	121,  68,  65,  63,  73,  80,  83,  82,
 	156,  45,  58,  79,  49,  86,  78,  84,
 	71,  81,  64,  66, 135,  34, 136,  91
 };
 
-const byte tab31[32]= {
+const byte tab30De[32] = {
+	0x49, 0x4D, 0x21, 0x42, 0x4C, 0x70, 0x41, 0x52, //ECJèà¶M
+	0x57, 0x4E, 0x48, 0x3F, 0x46, 0x50, 0x55, 0x4B,
+	0x5A, 0x4A, 0x54, 0x31, 0x4F, 0x56, 0x79, 0x3A,
+	0x6A, 0x5B, 0x5D, 0x40, 0x22, 0x2F, 0x30, 0x35
+};
+
+const byte tab31Fr[32]= {
 	93,  47,  48,  53,  50,  70, 124,  75,
 	72, 147, 140, 150, 151,  57,  56,  51,
 	107, 139,  55,  89, 131,  37,  54,  88,
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
+const byte tab31De[32]= {
+	0x78, 0x2D, 0x32, 0x82, 0x43, 0x39, 0x33, 0x38,
+	0x7C, 0x27, 0x37, 0x3B, 0x25, 0x28, 0x29, 0x36,
+	0x51, 0x59, 0x71, 0x81, 0x87, 0x88, 0x93, 0,
+	0,    0,    0,    0,    0,    0,    0,    0
+};
+
+const byte *tabdr, *tab30, *tab31;
+uint16 ctrlChar;
+
 /**
  * Extracts a single character from the game data
  */
-static void extractCharacter(unsigned char &c, int &idx, int &pt, bool &the_end, const uint16 *strData) {
+static void extractCharacter(unsigned char &c, uint &idx, uint &pt, bool &the_end, const uint16 *strData) {
 	uint16 oct, ocd;
 
 	/* 5-8 */
@@ -161,14 +187,10 @@ static void extractCharacter(unsigned char &c, int &idx, int &pt, bool &the_end,
 		oct = (uint)oct >> pt;
 	}
 
-	switch (oct) {
-	case 11 : {
+	if (oct == ctrlChar) {
 		c = '$';
 		the_end = true;
-	}
-	break;
-	case 30:
-	case 31 : {
+	} else if (oct == 30 || oct == 31) {
 		ocd = FROM_LE_16(strData[idx]);
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
@@ -185,14 +207,11 @@ static void extractCharacter(unsigned char &c, int &idx, int &pt, bool &the_end,
 		else
 			c = (char)tab31[ocd];
 
-		if (c == '\0') {
+		if (c == '\0')
 			the_end = true;
-		}
-	}
-	break;
-	default:
+	} else {
 		c = (char)tabdr[oct];
-	}	
+	}
 }
 
 /**
@@ -293,8 +312,8 @@ static void export_strings(const char *textFilename) {
 
 	// Loop through getting each string
 	for (unsigned int strIndex = 0; strIndex < (txxNtp.size() / 3); ++strIndex) {
-		int indis = txxNtp.readWord();
-		int point = txxNtp.readByte();
+		uint indis = txxNtp.readWord();
+		uint point = txxNtp.readByte();
 
 		// Extract the string
 		int charIndex = 0;
@@ -330,8 +349,14 @@ static void export_strings(const char *textFilename) {
  */
 static void import_strings(const char *textFilename) {
 	// Open input and output files
-	txxInp.open("TXX.INP", kFileWriteMode);
-	txxNtp.open("TXX.NTP", kFileWriteMode);
+	if (!txxInp.open("TXX.INP", kFileWriteMode)) {
+		printf("Missing TXX data file");
+		exit(-1);
+	}
+	if (!txxNtp.open("TXX.NTP", kFileWriteMode)) {
+		printf("Missing TXX index file");
+		exit(-1);
+	}
 	textFile.open(textFilename, kFileReadMode);
 
 	// Set up a buffer for the output compressed strings
@@ -371,17 +396,33 @@ static void import_strings(const char *textFilename) {
 
 
 int main(int argc, char *argv[]) {
-	if (argc != 3) {
-		printf("Format: %s export|import output_file\n", argv[0]);
+	if (argc != 4) {
+		printf("Format: %s export|import v1|v2 output_file\n", argv[0]);
+		printf("where:\nv1: French DOS version\nv2: German DOS version\n");
 		printf("The program must be run from the directory with the Mortville Manor game files.\n");
 		exit(0);
 	}
 
+	if (!strcmp(argv[2], "v1")) {
+		tab30 = tab30Fr;
+		tab31 = tab31Fr;
+		tabdr = tabdrFr;
+		ctrlChar = 11;
+	} else if (!strcmp(argv[2], "v2")) {
+		tab30 = tab30De;
+		tab31 = tab31De;
+		tabdr = tabdrDe;
+		ctrlChar = 10;
+	} else {
+		printf("Unknown version");
+		exit(-1);
+	}
+
 	// Do the processing
 	if (!strcmp(argv[1], "export"))
-		export_strings(argv[2]);
+		export_strings(argv[3]);
 	else if (!strcmp(argv[1], "import"))
-		import_strings(argv[2]);
+		import_strings(argv[3]);
 	else
 		printf("Unknown operation specified\n");
 }


Commit: 2cb2ac25b9c1d32ac742fd17034c680cb2f11046
    https://github.com/scummvm/scummvm/commit/2cb2ac25b9c1d32ac742fd17034c680cb2f11046
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-02T22:33:32-07:00

Commit Message:
TOOL: Remove obsolete comments in extract_mort

Changed paths:
    devtools/extract_mort/extract_mort.cpp



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index 0d603f7..0164030 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -121,35 +121,20 @@ int _version;
 #define BUFFER_SIZE 32768
 
 const byte tabdrFr[32] = {
-	32, 101, 115,  97, 114, 105, 110, // ' e♣arinutol
+	32, 101, 115,  97, 114, 105, 110,
 	117, 116, 111, 108,  13, 100,  99,
 	112, 109,  46, 118, 130,  39, 102,
 	98,  44, 113, 104, 103,  33,  76,
 	85, 106,  30,  31
 };
 
-const byte tabdrDe[32] = {
-	0x20, 0x65, 0x6E, 0x69, 0x73, 0x72, 0x74, // ' e♣arinutol
-	0x68, 0x61, 0x75, 0x0D, 0x63, 0x6C, 0x64,
-	0x6D, 0x6F, 0x67, 0x2E, 0x62, 0x66, 0x53,
-	0x2C, 0x77, 0x45, 0x7A, 0x6B, 0x44, 0x76,
-	0x9C, 0x47, 0x1E, 0x1F
-};
-
 const byte tab30Fr[32] = {
-	69,  67,  74, 138, 133, 120,  77, 122, //ECJèà¶M
+	69,  67,  74, 138, 133, 120,  77, 122,
 	121,  68,  65,  63,  73,  80,  83,  82,
 	156,  45,  58,  79,  49,  86,  78,  84,
 	71,  81,  64,  66, 135,  34, 136,  91
 };
 
-const byte tab30De[32] = {
-	0x49, 0x4D, 0x21, 0x42, 0x4C, 0x70, 0x41, 0x52, //ECJèà¶M
-	0x57, 0x4E, 0x48, 0x3F, 0x46, 0x50, 0x55, 0x4B,
-	0x5A, 0x4A, 0x54, 0x31, 0x4F, 0x56, 0x79, 0x3A,
-	0x6A, 0x5B, 0x5D, 0x40, 0x22, 0x2F, 0x30, 0x35
-};
-
 const byte tab31Fr[32]= {
 	93,  47,  48,  53,  50,  70, 124,  75,
 	72, 147, 140, 150, 151,  57,  56,  51,
@@ -157,6 +142,21 @@ const byte tab31Fr[32]= {
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
+const byte tabdrDe[32] = {
+	0x20, 0x65, 0x6E, 0x69, 0x73, 0x72, 0x74,
+	0x68, 0x61, 0x75, 0x0D, 0x63, 0x6C, 0x64,
+	0x6D, 0x6F, 0x67, 0x2E, 0x62, 0x66, 0x53,
+	0x2C, 0x77, 0x45, 0x7A, 0x6B, 0x44, 0x76,
+	0x9C, 0x47, 0x1E, 0x1F
+};
+
+const byte tab30De[32] = {
+	0x49, 0x4D, 0x21, 0x42, 0x4C, 0x70, 0x41, 0x52,
+	0x57, 0x4E, 0x48, 0x3F, 0x46, 0x50, 0x55, 0x4B,
+	0x5A, 0x4A, 0x54, 0x31, 0x4F, 0x56, 0x79, 0x3A,
+	0x6A, 0x5B, 0x5D, 0x40, 0x22, 0x2F, 0x30, 0x35
+};
+
 const byte tab31De[32]= {
 	0x78, 0x2D, 0x32, 0x82, 0x43, 0x39, 0x33, 0x38,
 	0x7C, 0x27, 0x37, 0x3B, 0x25, 0x28, 0x29, 0x36,


Commit: 4c73b9158f483bf223df3d74846a236578f1a785
    https://github.com/scummvm/scummvm/commit/4c73b9158f483bf223df3d74846a236578f1a785
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-02T22:59:25-07:00

Commit Message:
MORTEVIELLE: Fix text decryption in German version

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 8c2d375..fcf55cb 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1798,7 +1798,7 @@ void MortevielleEngine::decodeNumber(byte *pStart, int count) {
 	}
 }
 
-const byte tabdr[32] = {
+const byte tabdrFr[32] = {
 	32, 101, 115,  97, 114, 105, 110,
 	117, 116, 111, 108,  13, 100,  99,
 	112, 109,  46, 118, 130,  39, 102,
@@ -1806,20 +1806,45 @@ const byte tabdr[32] = {
 	85, 106,  30,  31
 };
 
-const byte tab30[32] = {
+const byte tab30Fr[32] = {
 	69,  67,  74, 138, 133, 120,  77, 122,
 	121,  68,  65,  63,  73,  80,  83,  82,
 	156,  45,  58,  79,  49,  86,  78,  84,
 	71,  81,  64,  66, 135,  34, 136,  91
 };
 
-const byte tab31[32]= {
+const byte tab31Fr[32]= {
 	93,  47,  48,  53,  50,  70, 124,  75,
 	72, 147, 140, 150, 151,  57,  56,  51,
 	107, 139,  55,  89, 131,  37,  54,  88,
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
+const byte tabdrDe[32] = {
+	0x20, 0x65, 0x6E, 0x69, 0x73, 0x72, 0x74,
+	0x68, 0x61, 0x75, 0x0D, 0x63, 0x6C, 0x64,
+	0x6D, 0x6F, 0x67, 0x2E, 0x62, 0x66, 0x53,
+	0x2C, 0x77, 0x45, 0x7A, 0x6B, 0x44, 0x76,
+	0x9C, 0x47, 0x1E, 0x1F
+};
+
+const byte tab30De[32] = {
+	0x49, 0x4D, 0x21, 0x42, 0x4C, 0x70, 0x41, 0x52,
+	0x57, 0x4E, 0x48, 0x3F, 0x46, 0x50, 0x55, 0x4B,
+	0x5A, 0x4A, 0x54, 0x31, 0x4F, 0x56, 0x79, 0x3A,
+	0x6A, 0x5B, 0x5D, 0x40, 0x22, 0x2F, 0x30, 0x35
+};
+
+const byte tab31De[32]= {
+	0x78, 0x2D, 0x32, 0x82, 0x43, 0x39, 0x33, 0x38,
+	0x7C, 0x27, 0x37, 0x3B, 0x25, 0x28, 0x29, 0x36,
+	0x51, 0x59, 0x71, 0x81, 0x87, 0x88, 0x93, 0,
+	0,    0,    0,    0,    0,    0,    0,    0
+};
+
+const byte *tabdr, *tab30, *tab31;
+uint16 ctrlChar;
+
 void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	uint16 oct, ocd;
 
@@ -1836,13 +1861,10 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		oct = (uint)oct >> pt;
 	}
 
-	switch (oct) {
-	case 11:
+	if (oct == ctrlChar) {
 		c = '$';
 		the_end = true;
-		break;
-	case 30:
-	case 31:
+	} else if (oct == 30 || oct == 31) {
 		ocd = _inpBuffer[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
@@ -1864,10 +1886,8 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 			the_end = true;
 			c = '#';
 		}
-		break;
-	default:
+	} else {
 		c = chr(tabdr[oct]);
-		break;
 	}
 }
 
@@ -2081,11 +2101,19 @@ void MortevielleEngine::loadTexts() {
 			return;
 		}
 	}
-	if (!ntpFile.open("TXX.NTP")) {
-		if (!ntpFile.open("TXX.IND")) {
-			warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
-			return;
-		}
+	if (ntpFile.open("TXX.NTP")) {
+		tab30 = tab30Fr;
+		tab31 = tab31Fr;
+		tabdr = tabdrFr;
+		ctrlChar = 11;
+	} else if (ntpFile.open("TXX.IND")) {
+		tab30 = tab30De;
+		tab31 = tab31De;
+		tabdr = tabdrDe;
+		ctrlChar = 10;
+	} else {
+		warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
+		return;
 	}
 
 	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {


Commit: 3d92d1e99d8eee61535287741033b11bc3ab8c40
    https://github.com/scummvm/scummvm/commit/3d92d1e99d8eee61535287741033b11bc3ab8c40
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-02T23:30:04-07:00

Commit Message:
MORTEVIELLE: Some renaming in Utils

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index fcf55cb..9b140fc 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1798,7 +1798,7 @@ void MortevielleEngine::decodeNumber(byte *pStart, int count) {
 	}
 }
 
-const byte tabdrFr[32] = {
+const byte cryptoArrDefaultFr[32] = {
 	32, 101, 115,  97, 114, 105, 110,
 	117, 116, 111, 108,  13, 100,  99,
 	112, 109,  46, 118, 130,  39, 102,
@@ -1806,21 +1806,21 @@ const byte tabdrFr[32] = {
 	85, 106,  30,  31
 };
 
-const byte tab30Fr[32] = {
+const byte cryptoArr30Fr[32] = {
 	69,  67,  74, 138, 133, 120,  77, 122,
 	121,  68,  65,  63,  73,  80,  83,  82,
 	156,  45,  58,  79,  49,  86,  78,  84,
 	71,  81,  64,  66, 135,  34, 136,  91
 };
 
-const byte tab31Fr[32]= {
+const byte cryptoArr31Fr[32]= {
 	93,  47,  48,  53,  50,  70, 124,  75,
 	72, 147, 140, 150, 151,  57,  56,  51,
 	107, 139,  55,  89, 131,  37,  54,  88,
 	119,   0,   0,   0,   0,   0,   0,   0
 };
 
-const byte tabdrDe[32] = {
+const byte cryptoArrDefaultDe[32] = {
 	0x20, 0x65, 0x6E, 0x69, 0x73, 0x72, 0x74,
 	0x68, 0x61, 0x75, 0x0D, 0x63, 0x6C, 0x64,
 	0x6D, 0x6F, 0x67, 0x2E, 0x62, 0x66, 0x53,
@@ -1828,21 +1828,21 @@ const byte tabdrDe[32] = {
 	0x9C, 0x47, 0x1E, 0x1F
 };
 
-const byte tab30De[32] = {
+const byte cryptoArr30De[32] = {
 	0x49, 0x4D, 0x21, 0x42, 0x4C, 0x70, 0x41, 0x52,
 	0x57, 0x4E, 0x48, 0x3F, 0x46, 0x50, 0x55, 0x4B,
 	0x5A, 0x4A, 0x54, 0x31, 0x4F, 0x56, 0x79, 0x3A,
 	0x6A, 0x5B, 0x5D, 0x40, 0x22, 0x2F, 0x30, 0x35
 };
 
-const byte tab31De[32]= {
+const byte cryptoArr31De[32]= {
 	0x78, 0x2D, 0x32, 0x82, 0x43, 0x39, 0x33, 0x38,
 	0x7C, 0x27, 0x37, 0x3B, 0x25, 0x28, 0x29, 0x36,
 	0x51, 0x59, 0x71, 0x81, 0x87, 0x88, 0x93, 0,
 	0,    0,    0,    0,    0,    0,    0,    0
 };
 
-const byte *tabdr, *tab30, *tab31;
+const byte *cryptoArrDefault, *cryptoArr30, *cryptoArr31;
 uint16 ctrlChar;
 
 void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
@@ -1878,16 +1878,16 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		}
 
 		if (oct == 30)
-			c = chr(tab30[ocd]);
+			c = chr(cryptoArr30[ocd]);
 		else
-			c = chr(tab31[ocd]);
+			c = chr(cryptoArr31[ocd]);
 
 		if (c == '\0') {
 			the_end = true;
 			c = '#';
 		}
 	} else {
-		c = chr(tabdr[oct]);
+		c = chr(cryptoArrDefault[oct]);
 	}
 }
 
@@ -2102,14 +2102,14 @@ void MortevielleEngine::loadTexts() {
 		}
 	}
 	if (ntpFile.open("TXX.NTP")) {
-		tab30 = tab30Fr;
-		tab31 = tab31Fr;
-		tabdr = tabdrFr;
+		cryptoArr30 = cryptoArr30Fr;
+		cryptoArr31 = cryptoArr31Fr;
+		cryptoArrDefault = cryptoArrDefaultFr;
 		ctrlChar = 11;
 	} else if (ntpFile.open("TXX.IND")) {
-		tab30 = tab30De;
-		tab31 = tab31De;
-		tabdr = tabdrDe;
+		cryptoArr30 = cryptoArr30De;
+		cryptoArr31 = cryptoArr31De;
+		cryptoArrDefault = cryptoArrDefaultDe;
 		ctrlChar = 10;
 	} else {
 		warning("Missing file - TXX.NTP or .IND - Switching to DAT file");


Commit: e8a74932415b9d7c7399de386ed33cf00d59f31e
    https://github.com/scummvm/scummvm/commit/e8a74932415b9d7c7399de386ed33cf00d59f31e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-04T14:25:26-07:00

Commit Message:
MORTEVIELLE: Add German translation in the DAT file

Changed paths:
    devtools/create_mortdat/create_mortdat.h
    devtools/create_mortdat/gametext.h
    dists/engine-data/mort.dat



diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
index 0aa6b52..908cb61 100644
--- a/devtools/create_mortdat/create_mortdat.h
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -33,7 +33,8 @@ enum AccessMode {
 
 enum DataType {
 	kStaticStrings = 0,
-	kGameStrings = 1
+	kGameStrings = 1,
+	kEncryptionArrays = 2
 };
 
 #define MORT_DAT "mort.dat"
diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index ebaa422..6e43258 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -1204,591 +1204,591 @@ const char *gameDataFr[] = {
 };
 
 const char *gameDataDe[] =  {
-	"TBT - Calm within the storm$",
-	"TBT - Discussed in colours$",
-	"TBT - Your mauve!$",
-	"TBT - Be kind enough to leave the room...$",
-	"TBT - If you're NOT overdrawn...$",
-	"TBT - If you're feeling blue...$",
-	"TBT - Read what's on the walls?$",
-	"TBT - Water sports$",
-	"TBT - Room for envy?$",
-	"TBT - A glance at the forbidden$",
-	"TBT - Smell of a woodfire and tobacco$",
-	"TBT - Tobacco and old books$",
-	"TBT - Onions, cinnamon and spirits$",
-	"TBT - A place seldom visited$",
-	"TBT - Humidity and decay$",
-	"TBT - Sorry, no ""door to door""$",
-	"TBT - Rotting corpse: deady cryptomania$",
-	"TBT - And what's more, there are disused traps$",
-	"TBT - It's already open$",
-	"TBT - Danger: avalanches$",
-	"TBT - Proper Charlie's place?$",
-	"TBT - An imposing building$",
-	"TBT - The other side of the mystery$",
-	"TBT - Strange horoscope$",
-	"TBT - Look out... but she wishes well?$",
-	"TBT - An oak door$",
-	"TBT - A photograph$",
-	"TBT - The coat of arms$",
-	"TBT - $",
-	"TBT - Max, the servant, welcomes you and shows you to your room$",
-	"TBT - Mortville     6/2/51@         My dear Jerome at Regarding my telegram, I must tell  you  the reason for my wor- at ries. A year ago, Murielle, my lady companion, disappeared. The de at part may have had something to do at with the financial success of themanor, or... A silence hard to un at derstand for my son Guy.  Not  ha at ving been able to see the  light of day over this affair, I count @on you to sort things out. If my state of health doesn't improve, @take the decisions that you feel @are apropriate.@             Kind regards, Julia DEFRANCK$",
-	"TBT - Later, Guy will inform you of Leo's suicide after a at heavy bet at the races$",
-	"TBT - F3: AGAIN             F8: STOP$",
-	"TBT - The master of the premises$",
-	"TBT - The future heir$",
-	"TBT - JULIA's son$",
-	"TBT - A pretty picture$",
-	"TBT - Superman!$",
-	"TBT - Ida's husband$",
-	"TBT - Interesting remarks?$",
-	"TBT - Service included!$",
-	"TBT - Nothing underneath$",
-	"TBT - You could hear a pin drop$",
-	"TBT - Half an hour passes: nothing! Wait any longer?$",
-	"TBT - Admire! Contemplate!$",
-	"TBT - No! Nothing!$",
-	"TBT - Impossible$",
-	"TBT - That stains!$",
-	"TBT - A treatise on the history of the area$",
-	"TBT - A few coins...$",
-	"TBT - First commandment...$",
-	"TBT - Pleasing to the nostrils!$",
-	"TBT - Spades, Hearts...$",
-	"TBT - Just a spoonful of sugar...$",
-	"TBT - A romantic novel$",
-	"TBT - Worth more than a penny, (whistle)$",
-	"TBT - Just needs a little patience$",
-	"TBT - Watch the sharp bends$",
-	"TBT - Deep and dark$",
-	"TBT - Normal sensations$",
-	"TBT - Sniff!$",
-	"TBT - Not discreet! Be content to watch!$",
-	"TBT - Bless you! Dusty!$",
-	"TBT - The canvas is signed, the wallpaper is not!$",
-	"TBT - Nothing, Unlucky!$",
-	"TBT - Be more discreet!$",
-	"TBT - The shutters are closed$",
-	"TBT - Snow! And more snow!$",
-	"TBT - Brilliant! The work of a master!$",
-	"TBT - No doubt at all! A genuine fake!$",
-	"TBT - Hmm! A cheap reproduction!$",
-	"TBT - A rare and valuable piece$",
-	"TBT - Nothing special$",
-	"TBT - Linen, personal belongings...$",
-	"TBT - Not just anywhere!$",
-	"TBT - It's not time!$",
-	"TBT - One doesn't speak with ones mouth full! So once the meal is over...$",
-	"TBT - Someone comes in, messes about then goes out again$",
-	"TBT - Someone's approaching your hiding-place$",
-	"TBT - Someone surprises you!$",
-	"TBT - Impossible! You're too loaded!$",
-	"TBT - Try again!$",
-	"TBT - Still puzzled!?$",
-	"TBT - You leave Mortville.In Paris a message awaits you...$",
-	"TBT - You hurt yourself$",
-	"TBT - Nothing more here$",
-	"TBT - The sound seems normal$",
-	"TBT - It doesn't move$",
-	"TBT - You are answered$",
-	"TBT - Not the right moment!$",
-	"TBT - The same matter, from another angle!$",
-	"TBT - The reflection is tarnished, but the frame is gold!$",
-	"TBT - Bric-a-brac$",
-	"TBT - Facing failure!$",
-	"TBT - Smells like something you'd rather not see!$",
-	"TBT - Cleaning products$",
-	"TBT - Got an itch?$",
-	"TBT - It's stuck, frozen. Brrr!$",
-	"TBT - All the locks are jammed!$",
-	"TBT - Papers$",
-	"TBT - No! Father christmas hasn't got himself stuck!$",
-	"TBT - It leads onto a corridor$",
-	"TBT - China, silverware...$",
-	"TBT - No! It's not Julia's remains!$",
-	"TBT - An old engraving$",
-	"TBT - You find a deep diamond-shaped opening$",
-	"TBT - The wall slides open! A passage! Do you follow it?$",
-	"TBT - The passageway closes$",
-	"TBT - A secret drawer: a notebook! Do you read it?$",
-	"TBT - The drawer shuts$",
-	"TBT - Nothing! Flesh and blood stuck to the stone$",
-	"TBT - Certain details lead you to believe death was not immediate!$",
-	"TBT - A rotten affair!$",
-	"TBT - Did she cling to dear life with just one finger?$",
-	"TBT - Has the treasure packed its trunk?$",
-	"TBT - A slot the size of a coin$",
-	"TBT - Part of the stone wall pivots.A crypt! Do you enter?$",
-	"TBT - The ring turns, the wall closes$",
-	"TBT - A stone column behind the altar$",
-	"TBT - There is a noise!$",
-	"TBT - Occupied!$",
-	"TBT - Take another chance?$",
-	"TBT - Too deep!$",
-	"TBT - The cellar wall pivots$",
-	"TBT - Nothing$",
-	"TBT - The one and only!$",
-	"TBT - The object slides to the bottom$",
-	"TBT - You have nothing in hand$",
-	"TBT - It is not open$",
-	"TBT - There is already something$",
-	"TBT - The door is locked$",
-	"TBT - No reply$",
-	"TBT - A solid wooden ball$",
-	"TBT - There's no more space$",
-	"TBT - A wooden ball pierced through the side$",
-	"TBT - ? ?$",
-	"TBT - Your move$",
-	"TBT - OK !$",
-	"TBT - Suddenly  Max  arrives with your suitcase:  \"Thank  you  for your @visit!\".Mister discreet \"private eye\" (in need of a private optici at an!). Thoroughly demoralised, you at leave the manor. You are useless!$",
-	"TBT - Leo interrupts:  \"The storm has  died down,I am going into town in at 1 hour. Get ready\". You have lost at time...but not your life$",
-	"TBT - Congestion, the deadly flu... You at are stuck here! Your  whole  case at sinks slowly beneath the water$",
-	"TBT - The water is rising fast,freezing your last illusions. Before you at have time to react...you are dead$",
-	"TBT - As soon as you reach the bottom  of the well, a hand cuts the rope at Farewell sweet life!$",
-	"TBT - The storm covers your footprints.A wall of  silence falls heavily at on your shoulders. Slowly you  succumb to frosbite...$",
-	"TBT - You're not completely alone!  A  cold blade plunges into your backup at In future, be more care!$",
-	"TBT - You don't know what implication  Leo may have had  in  Murielle's at death. Was she dead outright? In at any case,the family problems thatyou have uncovered in the course at of your enquiries would explain  Leo's behaviour. You're not sure at that's the reason Julia had asked at for your help, but that's reason enough for you!Out of respect for at her, after taking certain precau- at tions you have a revealing  talk with Leo.$",
-	"TBT - $",
-	"TBT - You don't have the keys to  the  manor. Your  cries  rest  unheard at You're   going   to   catch...             your death!$",
-	"TBT - With  a  circular  movement, the sword slices across you. Guts and at intestines spill out all over. A sorry state of affairs!$",
-	"TBT - Home, Sweet home !$",
-	"TBT - The mystery behind a closed door$",
-	"TBT - Bewitching charm of these old rooms$",
-	"TBT - An empty stomach$",
-	"TBT - Closer to heaven? Not so sure$",
-	"TBT - Afraid of the dark?$",
-	"TBT - Old rugs and a glint of gold$",
-	"TBT - Anguish!$",
-	"TBT - Safe? Perhaps not!$",
-	"TBT - A little ill at ease, eh!?$",
-	"TBT - Always further$",
-	"TBT - Your way of the cross!$",
-	"TBT - On the trail of...$",
-	"TBT - Watch what's hiding$",
-	"TBT - The road down to hell$",
-	"TBT - Feeling well? You look a little pale$",
-	"TBT - What lurks behind...?$",
-	"TBT - Close-up on:$",
-	"TBT - You notice, amongst other things$",
-	"TBT - And...$",
-	"TBT - That's all!$",
-	"TBT - A bit of reading$",
-	"TBT - The adventure awaits, you set off!$",
-	"TBT - Don't mess up YOUR next ADVENTURE!$",
-	"TBT - I don't understand$",
-	"TBT - There is an easier way$",
-	"TBT - No, not just now$",
-	"TBT - Too late$",
-	"TBT - $",
-	"TBT - Like a deep stony stare, a solitary  eye  that points towards the at stars; the artery that links hea-ven and hell.  You  must  fathom at these depths keeping hold of that at which is, and will become. Monday, Tuesday, Wednesday, Sunday, from at Monday 1st to Sunday 1st,plunging from one  day  to  the next your@\"IS\" or \"WILL BECOME\".  Carrying your burden with love and light, at the smallest oversight will seal your fate.$",
-	"TBT - 10/1/51: We think  we've  solved the mystery of the manuscript and at located the crypt. Is it the idea at of success in what seems like  a dream that disturbs me so? I feel at I have committed myself  rather  too much, as far as Leo is concer at ned... No! I should go on.       @I should have put Guy in the pic-ture but for a week now, I've had at no news of him$",
-	"TBT - Take your prayers as you would to the holy place.  From  the  pillar at of wisdom, bring the sun to  his at knees. Thus will it show you the place to  offer  alms of another at kind and like young Arthur, open the way of darkness.White is your at colour, golden your hearth.  So at advance with caution Orpheus and light  your  way  unto  the  sad at virgin. Offer her the circle  of the man with three faces. That he at may regain the  world  and  turn with it to its original at inglory!$",
-	"TBT - The mountains are the fangs in a monstrous mouth opening on the at finity of a celestial orgy, grin-ding the stars as we  grind  our at teeth into dust.  You  will drop your chord of stone at your feet. at The  laugh  of  silence  at  the at highest pitch, and in your right hand, the measure of genius. Thus at will you pass between  the  two  crescents beyond the abyss of the at wall of silence. The key to the  melody is within your grasp.  It at suffices to find the note  that  clashes.$",
-	"TBT -   9/12 INTER. 518  3/13 EXPENS.  23@  9/12 SALES 1203  7/12 CHEQUE 1598@      TOTAL 1721       TOTAL  1721$",
-	"TBT -    5/1/51@@              Luc, my love@ Guy knows about us. After an argument I told  him  everything! I at think only of you. Max keeps pes-tering me, but it's finished with @him. He should stick to his pots and pans! When can you and I be  alone together? For you I  would at get a divorce. at I love you.@                             Eva$",
-	"TBT -              Mortville, 10/2/51@@              Pat@ I recall you owe me  50000 frs that I lent you for your business at I need that money, can you repay me quickly?@              Guy$",
-	"TBT -              Mortville, 15/2/51@           Dear Sir@ I am writing to you on the sub-ject of our business deal. I have at decided to go all the way in the certainty that  my  partner, Pat at DEFRANCK, has been forging the accounts. @In spite of$",
-	"TBT -  A pipe$",
-	"TBT -  A pen$",
-	"TBT -  A lighter$",
-	"TBT -  A retort$",
-	"TBT -  A shaving brush$",
-	"TBT -  A tin of paint$",
-	"TBT -  A flute$",
-	"TBT -  An expensive ring$",
-	"TBT -  A reel of thread$",
-	"TBT -  An old book$",
-	"TBT -  A wallet$",
-	"TBT -  A dagger$",
-	"TBT -  A pistol$",
-	"TBT -  A bible$",
-	"TBT -  A candle$",
-	"TBT -  A jewellery box$",
-	"TBT -  An iron$",
-	"TBT -  A photo$",
-	"TBT -  A pocket watch$",
-	"TBT -  A rope$",
-	"TBT -  Keys$",
-	"TBT -  A pearl necklace$",
-	"TBT -  A bottle of perfume$",
-	"TBT -  Binoculars$",
-	"TBT -  Glasses$",
-	"TBT -  A leather purse$",
-	"TBT -  A tennis ball$",
-	"TBT -  Ammunition$",
-	"TBT -  A cut-throat razor$",
-	"TBT -  A hairbrush$",
-	"TBT -  A clothes brush$",
-	"TBT -  A pack of cards$",
-	"TBT -  A shoe horn$",
-	"TBT -  A screwdriver$",
-	"TBT -  A hammer$",
-	"TBT -  Keys$",
-	"TBT -  Keys$",
-	"TBT -  An ashtray$",
-	"TBT -  A paintbrush$",
-	"TBT -  A rope$",
-	"TBT -  A wooden object$",
-	"TBT -  Sleeping pills$",
-	"TBT -  A gold ring$",
-	"TBT -  A jewellery box$",
-	"TBT -  An alarm clock$",
-	"TBT -  A coat of armour$",
-	"TBT -  A candlestick$",
-	"TBT -  A pair of gloves$",
-	"TBT -  A engraved goblet$",
-	"TBT -  A parchment$",
-	"TBT -  A dagger$",
-	"TBT -  A dossier$",
-	"TBT -  A parchment$",
-	"TBT -  A parchment$",
-	"TBT -  A dossier$",
-	"TBT -  A dossier$",
-	"TBT -  A letter$",
-	"TBT -  A novel$",
-	"TBT -  A wooden rod$",
-	"TBT -  An envelope$",
-	"TBT -  A letter$",
-	"TBT -  An envelope$",
-	"TBT - Julia$",
-	"TBT - Julia's death$",
-	"TBT - Julia's relationships$",
-	"TBT - A message from Julia$",
-	"TBT - Julia's inheritance$",
-	"TBT - Julia's final actions$",
-	"TBT - Julia's gifts$",
-	"TBT - Julia's bedroom$",
-	"TBT - The photo at Julia's home$",
-	"TBT - Julia and yourself...$",
-	"TBT - L‚o's occupations$",
-	"TBT - Pat's occupations$",
-	"TBT - Guy's occupations$",
-	"TBT - Bob's occupations$",
-	"TBT - Eva's occupations$",
-	"TBT - Luc's occupations$",
-	"TBT - Ida's occupations$",
-	"TBT - Max's occupations$",
-	"TBT - Your occupations$",
-	"TBT - L‚o's relationships$",
-	"TBT - Pat's relationships$",
-	"TBT - Guy's relationships$",
-	"TBT - Bob's relationships$",
-	"TBT - Eva's relationships$",
-	"TBT - Luc's relationships$",
-	"TBT - Ida's relationships$",
-	"TBT - Max's relationships$",
-	"TBT - Your relationships$",
-	"TBT - Murielle$",
-	"TBT - Murielle's relationships$",
-	"TBT - Murielle and yourself...$",
-	"TBT - Murielle's disappearance$",
-	"TBT - The wall of silence$",
-	"TBT - The manuscripts$",
-	"TBT - The coat of arms$",
-	"TBT - Engravings in the cellar$",
-	"TBT - The well$",
-	"TBT - The secret passages$",
-	"TBT - The chapel$",
-	"TBT - The paintings$",
-	"TBT - The photo of the attic$",
-	"TBT - The body in the crypt$",
-	"TBT - $",
-	"TBT - $",
-	"TBT - END OF THE CONVERSATION$",
-	"TBT - Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"TBT - C'est le massif montagneux que l'on aper‡oit devant le manoir$",
-	"TBT - Je n'en sais rien !$",
-	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
-	"TBT - Madame DEFRANCK est morte d'un coup de froid$",
-	"TBT - Elle est morte d'une embolie pulmonaire$",
-	"TBT - Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
-	"TBT - Ce sont toujours les meilleurs qui partent les premiers$",
-	"TBT - J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"TBT - C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"TBT - C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
-	"TBT - Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir ...$",
-	"TBT - Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
-	"TBT - C'est un homme dynamique qui a r‚ussi dans le parfum$",
-	"TBT - Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
-	"TBT - J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
-	"TBT - Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
-	"TBT - Ce sont ses affaires ...$",
-	"TBT - Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"TBT - Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
-	"TBT - Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
-	"TBT - Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
-	"TBT - Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
-	"TBT - Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
-	"TBT - Mais ! Vous n'avez pas encore d‚couvert son occupation principale ..?$",
-	"TBT - Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs . Elle est toujours trŠs bien habill‚e$",
-	"TBT - Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
-	"TBT - Les bijoux ...$",
-	"TBT - Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"TBT - Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
-	"TBT - Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"TBT - Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
-	"TBT - Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"TBT - Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
-	"TBT - Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"TBT - Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
-	"TBT - Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
-	"TBT - C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"TBT - Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
-	"TBT - C'est un homme de caractŠre . Il faut savoir le prendre ..$",
-	"TBT - Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
-	"TBT - Relations ? Relations amicales ? Relations financiŠres sans doute$",
-	"TBT - Moi je n'ai rien … lui reprocher$",
-	"TBT - C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
-	"TBT - Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
-	"TBT - A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
-	"TBT - Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
-	"TBT - Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
-	"TBT - J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"TBT - Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
-	"TBT - Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
-	"TBT - Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
-	"TBT - Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
-	"TBT - C'est pour un rendez-vous ?$",
-	"TBT - Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
-	"TBT - Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
-	"TBT - La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
-	"TBT - C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
-	"TBT - Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
-	"TBT - C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
-	"TBT - Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
-	"TBT - Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
-	"TBT - C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"TBT - Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
-	"TBT - C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
-	"TBT - C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
-	"TBT - Murielle a ‚t‚ la dame de compagnie de Julia$",
-	"TBT - Elle aussi, faisait des recherches ...$",
-	"TBT - C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
-	"TBT - Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
-	"TBT - Je crois que tout le monde l'aimait bien$",
-	"TBT - Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
-	"TBT - A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
-	"TBT - Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
-	"TBT - A part sa famille, pas grand monde$",
-	"TBT - Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
-	"TBT - Non rien !$",
-	"TBT - Non ... Pas que le sache$",
-	"TBT - J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
-	"TBT - Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
-	"TBT - Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
-	"TBT - A part la lettre pour vous que j'ai post‚, rien de bien important !$",
-	"TBT - J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
-	"TBT - Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
-	"TBT - Son dernier pr‚sent m'a surpris$",
-	"TBT - Quel cadeau ?$",
-	"TBT - Un chandellier ...$",
-	"TBT - Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
-	"TBT - Et bien oui ! Comme tout le monde, je crois$",
-	"TBT - Un poignard$",
-	"TBT - Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
-	"TBT - Vous avez un don de double-vue ou un passe-partout$",
-	"TBT - Le portrait d'une jeune fille : C'est Murielle ...$",
-	"TBT - Vous savez, je la connaissais assez peu$",
-	"TBT - Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
-	"TBT - C'est la seule femme vraiment interessante que j'ai rencontr‚$",
-	"TBT - Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
-	"TBT - Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
-	"TBT - Si la chambre est ferm‚e, demandez … L‚o$",
-	"TBT - J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
-	"TBT - Vous savez ce que c'est : Des relations familiales$",
-	"TBT - Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
-	"TBT - Je l'aimais autant qu'elle m'aimais, je crois$",
-	"TBT - De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
-	"TBT - C'est sans doute la photo de Murielle avec le filleul de Julia$",
-	"TBT - Je ne me rappelle pas$",
-	"TBT - C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
-	"TBT - Vous ˆtes bien curieux !... C'est sans valeur$",
-	"TBT - Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
-	"TBT - Dommage que la devise soit manquante ...$",
-	"TBT - C'est trŠs beau ... Et trŠs vieux ...$",
-	"TBT - Tiens ! C'est un endroit que je n'ai jamais visit‚$",
-	"TBT - D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
-	"TBT - Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
-	"TBT - Profond et inqui‚tant : Le progrŠs a du bon$",
-	"TBT - Ca reste pour moi le plus grand des mystŠres$",
-	"TBT - Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"TBT - Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
-	"TBT - De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
-	"TBT - Quoi ?! Quel corps ? Quel crypte ?$",
-	"TBT - Si il y en a, je ne les ai jamais trouv‚ ...$",
-	"TBT - Bien s–r ! ... Et des fant“mes aussi ...$",
-	"TBT - C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
-	"TBT - Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
-	"TBT - Julia aimait beaucoup la peinture$",
-	"TBT - Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
-	"TBT - Que faites-vous l… ?$",
-	"TBT - Je suis s–r que vous cherchez quelque chose ici$",
-	"TBT - Je vous ‚coute$",
-	"TBT - Que d‚sirez-vous ?$",
-	"TBT - Oui ?$",
-	"TBT - Je suis … vous ...$",
-	"TBT - C'est pourquoi ?$",
-	"TBT - Allez-y$",
-	"TBT - C'est … quel sujet ?$",
-	"TBT - Max : … votre service, monsieur$",
-	"TBT - De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
-	"TBT - Vous ˆtes trop curieux !$",
-	"TBT - J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
-	"TBT - En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aven
 tur‚s dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
-	"TBT - F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
-	"TBT - Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
-	"TBT -  to the office$",
-	"TBT -  to the kitchen$",
-	"TBT -  to the cellar$",
-	"TBT -  to the landing$",
-	"TBT -  outside$",
-	"TBT -  to the dining room$",
-	"TBT -  inside the manor$",
-	"TBT -  front of the manor$",
-	"TBT -  to the chapel$",
-	"TBT -  to the well$",
-	"TBT -  north$",
-	"TBT -  behind the manor$",
-	"TBT -  south$",
-	"TBT -  east$",
-	"TBT -  west$",
-	"TBT -  towards the manor$",
-	"TBT -  further$",
-	"TBT -  in the water$",
-	"TBT -  out of the well$",
-	"TBT -  in the well$",
-	"TBT -  choice on screen$",
-	"TBT - In the MYSTERY series...$",
-	"TBT - MORTVILLE MANOR$",
-	"TBT - $",
-	"TBT - From an original idea of...$",
-	"TBT - Bernard GRELAUD and Bruno GOURIER$",
-	"TBT - $",
-	"TBT - Directed by: KYILKHOR CREATION and LANGLOIS$",
-	"TBT - $",
-	"TBT - With the cooperation of...$",
-	"TBT - B‚atrice et Jean_Luc LANGLOIS$",
-	"TBT - for the music and the voices,$",
-	"TBT - Bernard GRELAUD for the graphic conception,$",
-	"TBT - MARIA-DOLORES for the graphic direction,$",
-	"TBT - Bruno GOURIER for the technical direction,$",
-	"TBT - Mick ANDON for the translation. $",
-	"TBT - $",
-	"TBT - Publisher: KYILKHOR and B&JL LANGLOIS $",
-	"TBT - COPYRIGHT 1987: KYILKHOR and B&JL LANGLOIS$",
-	"TBT - $",
-	"TBT - YOUR MOVE$",
-	"TBT -  attach$",
-	"TBT -  wait$",
-	"TBT -  force$",
-	"TBT -  sleep$",
-	"TBT -  listen$",
-	"TBT -  enter$",
-	"TBT -  close$",
-	"TBT -  search$",
-	"TBT -  knock$",
-	"TBT -  scratch$",
-	"TBT -  read$",
-	"TBT -  eat$",
-	"TBT -  place$",
-	"TBT -  open$",
-	"TBT -  take$",
-	"TBT -  look$",
-	"TBT -  smell$",
-	"TBT -  sound$",
-	"TBT -  leave$",
-	"TBT -  lift$",
-	"TBT -  turn$",
-	"TBT -  hide yourself$",
-	"TBT -  search$",
-	"TBT -  read$",
-	"TBT -  put$",
-	"TBT -  look$",
-	"TBT -  Leo$",
-	"TBT -  Pat$",
-	"TBT -  Guy$",
-	"TBT -  Eva$",
-	"TBT -  Bob$",
-	"TBT -  Luc$",
-	"TBT -  Ida$",
-	"TBT -  Max$",
-	"TBT - JULIA...$",
-	"TBT - - Did she commit suicide?$",
-	"TBT - - Was she murdered?$",
-	"TBT - - Did she die by accident?$",
-	"TBT - - Did she die of natural causes?$",
-	"TBT - Where did the money used at for the restoration of the manor come from?$",
-	"TBT - - Blackmail$",
-	"TBT - - Honest work$",
-	"TBT - - Inheritance$",
-	"TBT - - Races$",
-	"TBT - - Rents$",
-	"TBT - - Hold-up$",
-	"TBT - - Other$",
-	"TBT - What is Leo's hobby?$",
-	"TBT - - Historical research$",
-	"TBT - - Politics$",
-	"TBT - - Painting$",
-	"TBT - - Drugs$",
-	"TBT - - Occult sciences$",
-	"TBT - - Management of a sect$",
-	"TBT - Julia left several clues that are at represented in one place. Which?$",
-	"TBT - - Chapel$",
-	"TBT - - Outside$",
-	"TBT - - Cellar$",
-	"TBT - - Attic$",
-	"TBT - - Kitchen$",
-	"TBT - - Dining room$",
-	"TBT - - Julia's room$",
-	"TBT - - Leo's room$",
-	"TBT - - Pat's room$",
-	"TBT - - Bob's room$",
-	"TBT - - Max's room$",
-	"TBT - - Luc/Ida's room$",
-	"TBT - - Guy/Eva's room$",
-	"TBT - The main clue that leads you at to the underground door is:$",
-	"TBT - - A dagger$",
-	"TBT - - A ring$",
-	"TBT - - A book$",
-	"TBT - - A parchment$",
-	"TBT - - A letter$",
-	"TBT - - A pendulum$",
-	"TBT - How many parchments were there in the manor?$",
-	"TBT - - 0$",
-	"TBT - - 1$",
-	"TBT - - 2$",
-	"TBT - - 3$",
-	"TBT - - 4$",
-	"TBT - - 5$",
-	"TBT - How many persons are involved in at this story?@(Julia included, but not yourself)$",
-	"TBT - - 9$",
-	"TBT - - 10$",
-	"TBT - - 11$",
-	"TBT - What was the first name at of the unknown character?$",
-	"TBT - - Mireille$",
-	"TBT - - Fran‡oise$",
-	"TBT - - Maguy$",
-	"TBT - - Emilie$",
-	"TBT - - Murielle$",
-	"TBT - - Sophie$",
-	"TBT - Wo did Murielle have an affair with?$",
-	"TBT - - Bob$",
-	"TBT - - Luc$",
-	"TBT - - Guy$",
-	"TBT - - Leo$",
-	"TBT - - Max$",
-	"TBT - Murielle shared an occupation at with one other person. Who?$",
-	"TBT - [1][You realize that certain elements of|this investigation remain a mystery for you.|Therefore, you decide first to learn|more before undertaking new risks..][ok]$",
-	"TBT - [3][ | insert disk 1 | in drive A ][ok]$",
-	"TBT - [1][ | Disk error | All stop... ][ok]$",
-	"TBT - [1][ | You should have noticed |00% of the clues ][ok]$",
-	"TBT - [3][ | insert disk 2 | in drive A ][ok]$",
-	"TBT - [1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
-	"TBT -  MASTER .$",
-	"TBT -   rorL$",
+	"Ruhe vor dem Sturm$",
+	"Geschmacklose Farben$",
+	"Lila, der letzte Versuch$",
+	"Diesen Ort bitte sauberhalten...$",
+	"Beaengstigendes schwarzes Loch$",
+	"Der blaue Salon$",
+	"Das blutrote Zimmer$",
+	"Wassersport$",
+	"Der gruene Star$",
+	"Ein Auge aufs Verbotene werfen$",
+	"Geruch von Kaminfeuer und Tabak$",
+	"Tabak und alte Buecher$",
+	"Zwiebeln, Zimt und Spirituosen$",
+	"Ein wenig besuchter Ort$",
+	"Feuchtigkeit und Moder$",
+	"Hausieren verboten!$",
+	"Ein verwester Koerper: toedliche Kryptomanie!$",
+	"Da wird einem angst$",
+	"Es ist schon offen$",
+	"Achtung: Lawinen$",
+	"Ein Hauch von \"Heiligkeit\"$",
+	"Eine grosses eindrucksvolles Gemaeuer...$",
+	"Die Kehrseite des Geheimnisses!$",
+	"Ein merkwuerdiges Horoskop!$",
+	"Der Krug geht so lange...$",
+	"Eine Eichentuer$",
+	"Ein Foto$",
+	"Die Wappen$",
+	"$",
+	"Max, der Diener, empfaengt Sie und wird Sie dann in Ihr Zimmer begleiten$",
+	"             Morteville  16/2/51@      Mein lieber Jer“me at Im Anschluss an mein Telegramm teile ich Ihnen die Gruende meiner Unruhe mit: vor 1 Jahr verschwand meine Gesellschafterin Murielle. Eventuell hat das Verschwinden etwas mit dem finanziel len Umschwung auf dem Landsitz zu tun, oder... Eine Stille, die schwer zu verstehen ist fuer mei-nen Sohn Guy. Da ich bis heute nichts bezueglich dieser Sache unternehmen konnte, zaehle ich auf Sie, um die Affaere zu regeln. Falls sich mein Gesundheitszustand nicht bessert, treffen Sie bitte die Entscheidungen, die Sie fuer richtig halten. @            In Freundschaft.  JULIA DEFRANCK$",
+	"Spaeter erzaehlt Ihnen Guy von Leo's Selbstmord nach einer verrueckten Wette beim Rennen!$",
+	"F3: WIEDERHOLUNG at F8: STOP$",
+	"Der Hausherr$",
+	"Der Zukuenftige Erbe$",
+	"Julias Sohn$",
+	"Ein niedliches Maedchen!$",
+	"Superman!$",
+	"Der Mann von Ida$",
+	"Interessante Aeusserungen?$",
+	"Service inbegriffen!$",
+	"Nichts darunter!$",
+	"Kein Mucks...$",
+	"Eine halbe Stunde spaeter: nichts! Warten Sie immer noch?$",
+	"Bewundern Sie! Denken Sie nach!$",
+	"Nein! Nichts!$",
+	"Unmoeglich$",
+	"Das macht Flecken!$",
+	"Eine Abhandlung ueber die Geschichte der Gegend$",
+	"Einige Muenzen$",
+	"Erstes Gebot...$",
+	"Das riecht gut!$",
+	"Pik, Herz...$",
+	"Es mangelt nicht an Pillen!$",
+	"Ein Liebesroman$",
+	"Pusten heisst noch nicht spielen$",
+	"Kein Erfolg!$",
+	"Vorsicht vor Ueberraschungen!$",
+	"Dunkel und tief...$",
+	"Normale Gefuehle$",
+	"Sniff!$",
+	"Unverschaemt! Begnuegen Sie sich mit anschauen!$",
+	"Gesundheit! St... Staub$",
+	"Das Bild ist unterzeichnet... aber nicht die Tapeten$",
+	"Kein Glueck, Nichts!$",
+	"Seien Sie diskreter!$",
+	"Die Vorhaenge sind geschlossen$",
+	"Schnee! Und noch mehr Schnee!$",
+	"Genial: ein Bild vom Meister!$",
+	"Kein Zweifel, das ist eine Faelschung!$",
+	"Hum! Sie stutzen - Antikes oder Schund?$",
+	"Ein selten wertvolles Stueck!$",
+	"Nichts Bemerkenswertes$",
+	"Waesche, persoenliche Objekte...$",
+	"Nicht irgendwo!$",
+	"Das ist nicht der Zeitpunkt!$",
+	"Man spricht nicht mit vollem Mund! Nenn erst einmal das essen beendet ist$",
+	"Jemand kommt rein, beeilt sich und geht wieder raus$",
+	"Man naehert sich Ihrem Versteck!$",
+	"Man ueberrascht Sie!$",
+	"Unmoeglich! Sie sind ueberlastet!$",
+	"Versuchen Sie es aufs neue$",
+	"Sie sind perplex!?$",
+	"Sie verlassen Morteville. In Paris erwartet Sie eine Nachricht...$",
+	"Sie tun sich weh!$",
+	"Nichts weiteres mehr hier$",
+	"Der Ton erscheint normal$",
+	"Es bewegt sich nicht$",
+	"Man antwortet Ihnen$",
+	"Nicht der Augenblick!$",
+	"Gleiches Material, andere Seite!$",
+	"Der Widerschein ist fleckig, aber der Rahmen ist aus Gold$",
+	"Nippsachen, wertlose Dinge...$",
+	"Sie erleiden einen Misserfolg!$",
+	"Hier stinkt es... Besser nicht anschauen!$",
+	"Haushaltsprodukte$",
+	"Da juckt Ihnen das Fell?$",
+	"Das ist esklemmt, zugefroren! Brrrr...$",
+	"Die Fensterrahmen sind blockiert!$",
+	"Papiere...$",
+	"Nein! Der Weihnachtsmann hat keine Schwierigkeiten!$",
+	"Da geht es auf einen Flur$",
+	"Geschirr, Silber...$",
+	"Nein! Das sind nicht die Reste von Julia!$",
+	"Eine alte Gravur$",
+	"Sie entdecken eine tiefe rhombenfoermige Oeffnung$",
+	"Die Mauer gleitet zur Seite! Eine Passage! Benutzen Sie sie?$",
+	"Der Durchgang schliesst sich$",
+	"Eine Geheimschublade. Ein Buechlein... Lesen Sie es?$",
+	"Die Schublade schliesst sich wieder$",
+	"Nichts! Blut und Haut kleben am Stein!$",
+	"Die Details lassen Sie darauf schliessen, dass der Tod nicht unmitte lbar eingetreten ist!$",
+	"Verdorbene Vorhaben?$",
+	"Hing ihr Leben an einem \"Finger\"?$",
+	"Ein Schatz sei verschwunden?$",
+	"Eine Ritze in Groesse einer Muenze!$",
+	"Einige Steine bewegen sich... Eine Krypta! Gehen Siehinein?$",
+	"Der Ring dreht sich, die Mauer schliesst sich wieder$",
+	"Eine Steinsaeule hinter dem Altar$",
+	"Es war laut...$",
+	"Besetzt!$",
+	"Versuchen Sie noch einmal Ihr Glueck?$",
+	"Zu tief!$",
+	"Die Mauer am Ende des Ganges dreht sich$",
+	"Nothing!$",
+	"Der einzigue!$",
+	"Das Objekt faellt hinunter...$",
+	"Sie haben nichts in den Haenden$",
+	"Es ist nicht offen$",
+	"Das ist schon etwas$",
+	"Die Tuer ist zu$",
+	"Keine Antwort$",
+	"Eine volle Holzkugel$",
+	"Es ist kein Platz mehr$",
+	"Eine, in der Mitte durchbohrte, Holzkugel$",
+	"? ?$",
+	"Sie sind dran!$",
+	"OK!$",
+	"Ploetzlich erscheint Max mit Ihrem Koffer : \"Danke fuer Ihren Besuch\" Privatdetektiv mit gutem Gespuer und zweifellos diskret. Demoralisiert verlassen Sie den Landsitz. Sie sind UNBEDEUTEND!$",
+	"Leo unterbricht Sie:\"Das Unwetterhat sich beruhigt. In 1 Stunde gehe ich in die Stadt. Halten Siesich bereit.\" Sie haben Zeit verloren...aber noch nicht das Leben$",
+	"Hochrotes Gesicht, fatale Grippe.Sie bleiben da. Ihre Nachforschun gen fallen ins Wasser$",
+	"Das Wasser steigt sehr schnell und daempft Ihre letzten Illusionen ... Bevor Sie Zeit haben, zu reagiren, sind Sie tot!$",
+	"Sie sind kaum auf dem Grund des Brunnens, als eine Hand das Seil durchschneidet. Leben, adieu!$",
+	"Der Sturm verwischt Ihre Spuren. Eine Mauer des Schweigens huellt Sie ein. Langsam sterben Sie den Erfrierungstod!$",
+	"Sie sind nicht so allein wie Sie denken. Eine kalte Klinge bohrt sich in Ihren Ruecken. Seien Sie in Zukunft vorsichtiger!$",
+	"Sie ignorieren die Schuld von Leoam Tode Murielles. War sie sofort tot? Auf jeden Fall gerechtfertigen die familiaeren Probleme, die waehrend Ihrer Untersuchung aufgedeckt wurden, die Haltung Leos. Sie sind nicht sicher, ob Julia Sie deswegen angerufen hat,  aber es genuegt Ihnen. Aus Respekt fuer sie und nach einigen Vorsichtsmassnahmen, fuehren Sie ein aufschlussreiches Gespraech mit Leo.$",
+	"$",
+	"Sie haben keinen Schluessel fuer den Landsitz. Ihre Rufe bleiben ohne Antwort. Sie werden sterben.$",
+	"Mit einem fuerchterlichen Rundschlag spaltet Sie das Schwert entzwei - das Innere kehrt sich nach aussen.$",
+	"Home, Sweet home!$",
+	"Geheimnis einer geschlossenen Tuer$",
+	"Charme verzaubert die alten Zimmer$",
+	"Leerer Magen$",
+	"Naeher 'gen Himmel? Nicht sicher!$",
+	"Angst vorm Dunkeln?$",
+	"Alte Teppiche und Goldschimmer$",
+	"Angst!$",
+	"Gerettet? Nicht sicher!$",
+	"Man fuehlt sich unwohl, was!$",
+	"Immer noch weiter!$",
+	"Ihr Kreuzweg!$",
+	"Bei der Entdeckung von...$",
+	"Achtung, auf das was sich versteckt...$",
+	"Abstieg in die Hoelle!$",
+	"Na fuehlen Sie sich gut? Sie sehen etwas@             blass aus!$",
+	"Vor dem Eintreten!$",
+	"Zoom:$",
+	"Unter anderem bemerken Sie...$",
+	"Und noch mal...$",
+	"Es ist zu Ende!$",
+	"Ein wenig Lektuere$",
+	"Das Abenteuer wartet auf Sie: also los!$",
+	"Verpassen Sie nicht IHR naechstes ABENTEUER!$",
+	"Ich verstehe nicht$",
+	"Es gibt Einfacheres$",
+	"Nein! Nicht Diesmal$",
+	"Zu spaet$",
+	"$",
+	"Wie ein tiefer verschleierter Blick, sein lebloses Auge auf die Sterne gerichtet, ist er wie der Schlund, der Himmel und Hoelle verbindet. Du musst in diese Tiefe vordringen, so wie eine Ratte in die Erde. Montag, Dienstag, Mittwoch, Sonntag, vom 1. Montag bis zum 1. Sonntag -so wird jeder Tag durch das SEIN oder WERDEN bestimmt. Vebersieh nichts, denn sonst ist Dein Schicksal besiegelt.$",
+	"10/1/50: Wir haben das Mysterium des Manuskriptes geloest und die Krypta lokalisiert. Ist es der Gedanke, in diesem Traum mein Ziel zu erreichen, der mir so angst macht? Ich bedauere, dass ich mich gegenueber Leo so engagiert habe. Nein, ich muss weitermachen Ich haette Guy informieren muessen, aber ich habe seit einer Woche nichts mehr von ihm gehoert$",
+	"Trag deine Bitte an den heiligen Ort - so wirst Du mehr erfahren! Der Pfeiler der Weisheit und die Sonne an den Knien werden Dir die Stelle zeigen , die Deiner Seele den Weg in eine neue Welt oeffnen Vorwaerts Orpheus, ohne Angst vordem Ungewissen:  Weiss ist Deine Farbe, Gold ist Dein Zuhause. Be-leuchte Deinen Weg,  bis hin zur traurigen Jungfrau. Gib ihr den  Kreis  des  Mannes  mit den drei Gesichtern, auf dass er die Welt wieder erreicht und sich dreht in seinem urspruenglichen Reichtum$",
+	"Die Berge sind die Zaehne eines gigantischen unendlichen Schlundes, einer himmlischen Orgie, die Sterne verschlingend, so wie uns die Dunkelheit verschlingt. Du laesst das Seil der Steine zu Dei nen Fuessen fallen. Das  Lachen der Stille und in Deiner rechten Hand das Werk eines Meisters. Anschliessend wirst Du zwischen den beiden Monden hindurchgehen; jenseits des Abgrundes der Mauer des Schweigens wirst Du den Schluessel zur Melodie findenes fehlt nur noch die passende Note...$",
+	"           DEZEMBER@ 9 ABZUG     518  13 ZINSEN   23 at 19 VEBERWE. 1203  17 GUTHAB 1598@   TOTAL    1721     TOTAL  1721@$",
+	"                        5/01/51@       Luc, mein Liebling@ Guy weiss von unserer Beziehung.Nach einem Streit habe ich ihm alles gesagt. Ich liebe nur Dich. Max sitzt mir dauernd auf dem Hals, aber ich habe definitiv mitihm gebrochen. Soll er doch bei seinen Toepfen bleiben. Wann koennen wir uns allein sehen? Wegen dir wuerde ich mich scheiden lassen@              Deine Eva$",
+	"            Morteville, 10/2/51@               Pat@     Ich erinnere Dich daran, dass Du mir noch FF 5000,- schuldest, die ich Dir fuer Dein Geschaeft geliehen habe. Ich brauche sie jetzt. Kannst Du sie mir bitte moeglichst schnell wiedergeben?@                Guy$",
+	"            Morteville, 15/2/51@          Lieber Herr@     Ich schreibe Ihnen unser Geschaeft betreffend. Ich bin entschlossen, bis zum Aeusserstenzu gehen, da ich mir sicher bin, dass mein Teilhaber, Pat Defranck ein Rechnungsbuch gefaelscht hat.$",
+	"Eine Pfeife$",
+	"Ein Fuellfederhalter$",
+	"Ein Gasfeuerzeug$",
+	"Eine Retorte$",
+	"Ein Rasierpinsel$",
+	"Ein Farbeimer$",
+	"Eine Floete$",
+	"Ein wertvoller Ring$",
+	"Eine Garnrolle$",
+	"Ein altes Buch$",
+	"Ein Portemonnaie$",
+	"Ein Dolch$",
+	"Ein Revolver$",
+	"Eine Bibel$",
+	"Eine Kerze$",
+	"Ein Schmuckkoffer$",
+	"Ein Buegeleisen$",
+	"Ein Foto$",
+	"Eine Taschenuhr$",
+	"Ein Seil$",
+	"Schluessel$",
+	"Ein Perlenkollier$",
+	"Ein Parfumflakon$",
+	"Ein Fernglas$",
+	"Eine Brille$",
+	"Ein Ledergeldbeutel$",
+	"Ein Tennisball$",
+	"Munition$",
+	"Ein Nassrasierer$",
+	"Eine Haarbuerste$",
+	"Eine Kleiderbuerste$",
+	"Ein Kartenspiel$",
+	"Ein Schuhanzieher$",
+	"Ein Schraubenzieher$",
+	"Ein Hammer$",
+	"Schluessel$",
+	"Schluessel$",
+	"Ein Aschenbecher$",
+	"Ein Pinsel$",
+	"Ein Seil$",
+	"Ein Gegenstand aus Holz$",
+	"Schlafmittel$",
+	"Ein goldener Ring$",
+	"Ein Schmuckkoffer$",
+	"Ein Wecker$",
+	"Ein Panzerhemd$",
+	"Ein Kerzenhalter$",
+	"Ein Paar Handschuhe$",
+	"Ein Ziselierter Becher$",
+	"Ein Pergament$",
+	"Ein Dolch$",
+	"Ein Dossier$",
+	"Ein Pergament$",
+	"Ein Pergament$",
+	"Ein Dossier$",
+	"Ein Dossier$",
+	"Ein Brief$",
+	"Ein Roman$",
+	"Ein Holzstock$",
+	"Ein Umschlag$",
+	"Ein Brief$",
+	"Ein Umschlag$",
+	"Julia$",
+	"Julias Tod$",
+	"Julias Beziehungen$",
+	"eine Nachricht von Julia$",
+	"Julias Erbschaft$",
+	"letzte Handlungen Julias$",
+	"Geschenk von Julia$",
+	"Julias Zimmer$",
+	"die Fotos bei Julia$",
+	"Julia und Sie...$",
+	"die Geschaefte von Leo$",
+	"die Geschaefte von Pat$",
+	"die Geschaefte von Guy$",
+	"die Geschaefte von Bob$",
+	"die Geschaefte von Eva$",
+	"die Geschaefte von Luc$",
+	"die Geschaefte von Ida$",
+	"die Geschaefte von Max$",
+	"Ihre Geschaefte$",
+	"Leos Beziehungen$",
+	"Pats Beziehungen$",
+	"Guys Beziehungen$",
+	"Bobs Beziehungen$",
+	"Evas Beziehungen$",
+	"Lucs Beziehungen$",
+	"Idas Beziehungen$",
+	"Maxs Beziehungen$",
+	"Ihre Beziehungen$",
+	"Murielle$",
+	"Murielles Beziehungen$",
+	"Murielle und Sie...$",
+	"Murielles Vershwinden$",
+	"Die Mauer des Schweigens$",
+	"Die manuskripte$",
+	"Das Wappen$",
+	"Die Inschriften im Keller$",
+	"Der Brunnen$",
+	"Die Geheimgaenge$",
+	"Die Kapelle$",
+	"Die Bilder$",
+	"Die Fotos vom Dachboden$",
+	"Koerper in der Krypta$",
+	"$",
+	"$",
+	"ENDE DER UNTERHALTUNG$",
+	"Die Alten nannten die Bergkette am Fusse des Landsitzes so.$",
+	"Das ist das Bergmassiv, das man vor dem Landsitz sieht.$",
+	"Ich weiss nichts davon.$",
+	"Sie ist an einer Lungenembolie gestorben.$",
+	"Meine Mutter ist ploetzlich gestorben, obwohl es schien, dass sich ihr Zustand verbesserte.$",
+	"Frau Defranck ist gestorben.$",
+	"Sie ist an einer Lungenembolie gestorben.$",
+	"Verzeihen Sie mir, aber ich ziehe es vor, im Moment Schweigen zu bewahren.$",
+	"Es sind immer die Guten, die als erste gehen muessen.$",
+	"Ich habe meine Mutter sehr geliebt; ich bedauere, dass sie auf dem Gut der Defrancks gestorben ist.$",
+	"Dies ist  eine Gegend, die eine sehr bewegte Vergangenheit hat und es gibt genug Dinge, um die ich mich kuemmern kann und ausserdem liebe ich Pferde.$",
+	"Er interessiert sich sehr fuer Geschichte und er ist ein erfolgloser Spieler. Uebrigens hat er vor einem Jahr eine bedeutende Summe gewonnen.$",
+	"Er hat schon viel zu tun mit der Buchhaltung und der Verwaltung des Gutes.$",
+	"Ich bin Direktor einer Parfumfirma. Aber hier... Erholung.$",
+	"Ein dymamischer Mann, der in der Parfumbranche viel erreicht hat.$",
+	"Das ist ein uebler Emporkoemmling. Die Parfums muessen seinen gesunden Menschenverstand eingeschlaefert haben. Hier verbringt er seine Abende in seinem Zimmer.$",
+	"Vorher galt meine Hauptsorge der Gesundheit meiner Mutter. Jetzt finde ich an nichts mehr Gefallen.$",
+	"Er haette gut daran getan, sich ein bisschen mehr um mich zu kuemmern und etwas weniger um seine Mutter.$",
+	"Das sind seine Angelegenheiten.$",
+	"Er hat nicht viel Glueck im Moment, obwohl seine Geschaefte zufriedenstellend sind.$",
+	"Ich arbeite mit Pat. Es geht nicht besonders gut im Moment.$",
+	"Ah ja! Hat er Beschaeftigungen? Er taete besser daran, sich ernsthaft zu beschaeftigen.$",
+	"Er und Pat sind Geschaeftspartner. Ich glaube, es laeuft gar nicht mal schlecht.$",
+	"Ich kuemmere mich um mich und das ist schon genug. Und Sie?$",
+	"Oh, ich vetraue ihr. Sie versteht, sich zu beschaeftigen.$",
+	"Aber haben Sie noch nicht ihre Hauptbeschaeftigung entdeckt?$",
+	"Sie arbeitet in der Dekoration mit sehr viel Geschmack. Ausserdem ist sie immer sehr gut angezogen.$",
+	"Interessiert sie der Schmuck. Ich habe ein Geschaeft vorzuschlagen.$",
+	"Der Schmuck...$",
+	"Ich weiss nicht, aber ich glaube, ich wuerde es vorziehen, wenn er sich ein bisschen weniger um meine Angelegenheiten kuemmern wuerde.$",
+	"Eine Hausfrau hat immer zu tun.$",
+	"Sie koennte auch ohne Arbeit auskommen. Aber nein, sie naeht, sie liest...$",
+	"Sie hat sicherlich keine sehr erheiternden Taetigkeiten.$",
+	"Eine aussergewoehnliche Frau. Sie interessiert sich fuer alles.$",
+	"Zwischen Kueche und Haushalt habe ich nicht viel Zeit fuer sie.$",
+	"Wie schafft er es nur, alles zu machen? Oh Wunder!$",
+	"Er taete gut daran, wenn er sich weniger mit Klatsch und der Flasche beschaeftigen wuerde.$",
+	"Ich bin sehr selbstaendig. Solange man sich nicht um meine Angelegenheiten kuemmert, gibt es keine Probleme.$",
+	"Er ist ein Egoist. Ich frage mich, ob es fuer ihn noch etwas anderes gibt, als seine Pferde und seine Maerchenbuecher.$",
+	"Er versteht sich gut mit allen, ausser vielleicht mit Guy.$",
+	"Er ist ein Mann mit Charakter. Man muss ihn zu nehmen wissen.$",
+	"Geschaeft ist Geschaeft. Was die Familie anbetrifft...$",
+	"Beziehungen? Freundschaften? Finanzen zweifellos.$",
+	"Ich habe ihm nichts vorzuwerfen.$",
+	"Er ist ein pfiffiger Geschaeftsmann. Manchmal schwimmt er gegen den Strom, aber er weiss sich immer zu helfen.$",
+	"Sie langweilen mich alle. Nein, obwohl... einige...$",
+	"Im Gegensatz zur Mutter ist es eine sehr verschlossene Person. Also Frage: Beziehung.$",
+	"Er muss sich zweifellos sehr anstrengen, um trotz seiner Sorgen freundlich zu bleiben.$",
+	"Seine Liebesaffairen? Aus und vorbei. Mit mir? Es hat nie richtig angefangen. Was die anderen betrifft... ich bin nicht \"die anderen\".$",
+	"Ich mag jeden, solange man mich nicht betruegt.$",
+	"Es reicht nicht, ein bisschen Geld zu haben und ein guter Redner zu sein, um bei allen beliebt zu sein.$",
+	"Jemand, der nett ist und ausserdem noch Humor hat.$",
+	"Ueber diese Sache kann ich mich nicht auslassen.$",
+	"Das ist nicht besonders intelligent. Sprechen Sie mit dem Ehemann darueber.$",
+	"Ist es wegen eines Rendez-vous?$",
+	"Sie ist sehr lebhaft. sie laesst sich nicht durch Vorurteile in Verwirrung brignen.$",
+	"In meinem Beruf ist man vor allem schoenen Frauen und Gaunern sehr nahe.$",
+	"Sein einziges Vermoegen sind sein Schmuck und seine Frau, aber er ist sich dessen nicht bewusst.$",
+	"Jemand interessantes, aber nicht immer leicht zu verstehen, der aber die Muehe wert ist.$",
+	"Ich verachte niemanden, aber ich mag es sehr, wenn alles und alle dort sind, wo sie hingehoeren.$",
+	"Unter uns.. sehen Sie, wenn ich mit ihr spreche, fuehle ich mich schnell beengt.$",
+	"Um sich nicht mit ihr zu verstehen, braucht man wirklich viel schlechten Willen.$",
+	"In meinem Beruf hoert man alles, aber behaelt nichts. Nur der Service zaehlt.$",
+	"Das ist ein Heuchler, ein Kriecher. Ich persoenlich habe kein Vertrauen zu Ihm.$",
+	"Ich kenne seine wahren Gedanken nicht, aber er war stets korrekt.$",
+	"Sie hat vor einem Jahr, vielleicht laenger, auf dem Landsitz gewohnt.$",
+	"Mehr als eine Freundin fuer meine Mutter. In solchen Augenblicken haette ich gewuenscht, dass sie da ist.$",
+	"Sie war die Hausdame von Julia.$",
+	"Sie hat ebenfalls Recherchen angestellt. Aber Guy, der sie besser kennt als jeder andere, kann Ihnen mehr sagen.$",
+	"Ihre Beziehungen?... Sie war sehr kultiviert. Ihr ploetzliches Verschwinden vor einem Jahr hat mich erstaunt.$",
+	"Sie teilte mit Leo ihre Leidenschaft fuer Geschichte und fuer die Gegend.$",
+	"Ich glaube, jeder hatte sie gern.$",
+	"Sie verstand sich mit allen gut, aber ganz besonders liebte sie ihren Sohn. Was die Beziehungen Schwiegermutter Scwiegertochter anbetrifft...$",
+	"Ausser zu Leo hatte sie auch gute Beziehungen zu Max.$",
+	"Obwohl ihre Beziehungen nicht von Dauer waren, lag ihr immer viel an ihnen.$",
+	"Ausser ihrer Familie, nicht viele.$",
+	"Aber ja. Sie hat das Weggehen dieser Freundin sehr bedauert. Eh, Mireille, oder Marielle.$",
+	"Nein, nichts.$",
+	"Nein, nicht das ich wuesste.$",
+	"Ich habe Julia kennengelernt, als ich das Landgut kaufte. Es war das einzige, was ihr gehoerte, aber mein Besitz war auch der ihre.$",
+	"Wenn nicht einige persoenliche Dinge gewesen waeren, ich glaube, dann haette sie nichts eigenes mehr gehabt.$",
+	"Ich glaube, all ihr Reichtum kam von Leo. Also!$",
+	"Ausser des Briefes, den ich fuer sie aufgegeben habe, nichts wichtiges.$",
+	"Ich war gluecklich, als sie mir ihre eingebundene Bibel schenkte.$",
+	"Es ging schnell und sie hatte nicht die Zeit, um spezielle Entscheidungen zu treffen.$",
+	"Ihr letztes Geschenk hat mich ueberrascht.$",
+	"Was fuer ein Geschenk?$",
+	"Ein Kerzenleuchter.$",
+	"Ja, ich habe ein Geschenk bekommen. Meine Frau hat sogar eine Bibel bekommen.$",
+	"Aber ja. wie jeder, glaube ich.$",
+	"Ein Dolch$",
+	"Ich habe nie den Dachboden durchwuehlt.$",
+	"Haben Sie die Gabe eines Hellsehers, oder haben Sie einen Dietrich?$",
+	"Das Portrait einer jungen Frau? Das ist Murielle.$",
+	"Ich kannte sie zu wenig.$",
+	"Sehr charmant. Sie war vor allem die Hausdame von Julia.$",
+	"Das war die einzige wirklich interessante Frau, die ich getroffen habe.$",
+	"Sie hatte ein grosses Wissen vorzuweisen. Sie zu besuchen, war stets sehr bereichernd.$",
+	"Ich habe mich immer gefragt, was manche an ihr fanden.$",
+	"Das Zimmer ist verschlossen? Fragen Sie Leo.$",
+	"Ich habe ihr Zimmer nach ihrem Tod abgeschlossen und ich moechte, dass das auch noch eine zeitlang so bleibt.$",
+	"Wissen Sie, was das sind? Familienbeziehungen.$",
+	"In all den Jahren habe ich sie niemals gegen meinen Willen bedient.$",
+	"Ich habe sie so sehr geliebt, wie sie mich, glaube ich.$",
+	"Mit welchem Recht sind Sie in das Zimmer meiner Frau eingedrungen?$",
+	"Zweifellos das Foto von Murielle mit dem Patenkind von Julia.$",
+	"Ich erinnere mich nicht.$",
+	"Das ist Murielle. Ich war es, der sie fotografiert hat. Uebrigens ist das Foto seitenverkehrt abgezogen.$",
+	"Sie sind wirklich neugierig. Das ist wertlos.$",
+	"Maerchen, Pergamente und Manuskripte das ist Leos Spezialitaet.$",
+	"Schade, dass die Losung fehlt.$",
+	"Das ist sehr schoen und sehr alt.$",
+	"Das ist ein Ort, den ich nie gesehen habe.$",
+	"Leos Meinung nach schien es, als seien die Monde spaeter gemacht worden.$",
+	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"Tief und beunruhigend. Der Fortschritt hat gutes an sich.$",
+	"Der Rest bleibt fuer mich eines der groessten Raetsel.$",
+	"In letzter Zeit sprach sie oft von einer Reise und dann...$",
+	"An einem Abend vor mehr als einem Jahr hat sie sich entschieden wegzugehen.$",
+	"Auf jeden Fall war sie fuer das Leben hier nicht geschaffen.$",
+	"Welcher Koerper? Welche Krypta?$",
+	"Wenn es sie ueberhaupt gibt, ich habe sie nie gefunden.$",
+	"Aber sicher! Und die Fantome auch.$",
+	"Es ist die aelteste der Stadt. Sie stammt aus dem 11. Jahrhundert.$",
+	"Nach der Revolution wurde sie leicht restauriert.$",
+	"Julia liebte die Malerei sehr.$",
+	"Sie haben verschiedene Stilrichtungen, aber sie haben nicht alle Wert.$",
+	"Was machen Sie da ?$",
+	"Ich bin sicher, Sie suchen etwas!$",
+	"Ich hoere.$",
+	"Was wuenschen Sie?$",
+	"Ja ?$",
+	"Ich stehe zu Ihrer Verfuegung.$",
+	"Weswegen?$",
+	"Na los doch!$",
+	"Wegen was?$",
+	"Max: Zu Ihren Diensten, Monsieur.$",
+	"Auf jeden Fall haben Sie hier nichts zu suchen! Gehen  Sie raus!$",
+	"Sie sind zu neugierig!$",
+	"Jerome, es ist lange her. Wie traurig, Julia ist tot. Ihre Familie ist hier. Guy, ihr Sohn, und Eva, ihre Schwiegertochter. Leo, ihr Mann, sowie  ihr Schwiegersohn Pat und die Cousins Bob, Ida und Luc. Das Unwetter verstaerkt sich. Sie muessen noch bleiben. Die Mahlzeiten sind um 12 Uhr und um 19 Uhr und es findet jeden Tag um 10 Uhr eine Andacht in der Kapelle statt.$",
+	"Als ich Sie sah, habe ich sofort begriffen, dass Sie die Wahrheit aufdecken wuerden, da ich wusste, warum Sie gekommen sind. Ich hatte den Entwurf von Julias Brief gefunden. Aber ich bin ein begeisterter Spieler, also.... Sie haette nicht gewollte, dass ihre Aufgabe zu leicht ausfaellt, zweifellos, um mich zu schuetzen, aber sie konnten nicht sterben mit dieser Ungewissheit.Haben Sie herausgefunden, dass die \"Mauer des Schweigens\" der Name ist, den  die Maurer waehrend des Baus des Landsitzes der Mauer gegeben haben, die das Wappen traegt...? Und die Geschenke, die Julia vor ihrem Tod hinterlassen hat waren sowohl falsche Hinweise wie auch ein Mittel, um die Wichtigkeit der Pergamente herauszustellen. Tatsaechlich arbeitete ich vor mehr als einem Jahr mit Murielle an der Entzifferung dieser Pergamente, die ich gefunden hatte. Meine Frau sah einen Zusammenhang zwischen unserer Arbeit und dem Verschwinden Murielles,aber sie hat nie Beweise dafuer gehabt; wenn da nicht dies
 er Ring gewesen waere, den sie eines Tages unter meinen Sachen wiedergefunden hat. Eines nachts sind wir in dem Geheimgang, den wir entdeckt hatten,auf Erkundung gegangen. Murielle ist durch einen Unfall im \"Jungfrauenzimmer\" ums Leben gekommen. Ich habe ihren Ring schnell an mich genommen, habe den Schatz entdeckt und mich dann aus dem Staub gemacht. Ich dachte nicht daran, dass  sie unter Umstaenden noch leben koennte, und ich habe nichts gesagt, da ich Geld brauchte. Ich habe das Geld beim Pferderennen verspielt. Gehen Sie jetzt, da sie ja nicht von der Polizei sind. Lassen Sie mich allein.$",
+	"Februar '51, Beruf: Privatdetektiv. Die Kaelte laesst Paris und meine Unternehmungen erstarren, als...$",
+	"Julia, heute eine alte Frau. Nichts als Erinnerungen und Spiele in den alten Zimmern des Landsitzes von Morteville.$",
+	"im Buero$",
+	"in der Kueche$",
+	"im Keller$",
+	"auf dem Flur$",
+	"draussen$",
+	"im Esszimmer$",
+	"im Landsitz$",
+	"vor dem Landsitz$",
+	"in der Kapelle$",
+	"vor dem Brunnen$",
+	"im Norden$",
+	"hinter dem Landsitz$",
+	"im Sueden$",
+	"im Osten$",
+	"im Westen$",
+	"in Richtung Landsitz$",
+	"noch weiter$",
+	"im Wasser$",
+	"ausser des Brunnens$",
+	"im Brunnen$",
+	"Wahl auf dem Bild$",
+	" In der Reihe RAETSEL...$",
+	" DER LANDSITZ VON MORTEVILLE$",
+	"$",
+	" Nach einer Idee von...$",
+	" Bernard GRELAUD und Bruno GOURIER$",
+	"$",
+	" Realisation: LANKHOR$",
+	"$",
+	" in Zusammenarbeit mit...$",
+	" Beatrice und Jean-Luc LANGLOIS Musik und Stimmen,$",
+	" Bernard GRELAUD graphische Gestaltung,$",
+	" Dominique SABLONS graphische Realisation ,$",
+	" Bruno GOURIER technische Realisation,$",
+	" Gabi NURGE Uebersetzung,$",
+	" Clement ROQUES IBM PC Realisation.$",
+	"$",
+	" Ausgabe: LANKHOR$",
+	" COPYRIGHT 1989: LANKHOR$",
+	"$",
+	" SIE SIND AM ZUG$",
+	"abkratzen$",
+	"anschauen$",
+	"ausgehen$",
+	"befestig.$",
+	"drehen$",
+	"durchsuch$",
+	"eindrueck$",
+	"eintreten$",
+	"essen$",
+	"fuehlen$",
+	"hochheben$",
+	"klopfen$",
+	"lesen$",
+	"nehmen$",
+	"oeffnen$",
+	"schlafen$",
+	"schliess.$",
+	"setzen$",
+	"sondieren$",
+	"warten$",
+	"zuhoeren$",
+	"anschauen$",
+	"durchsuch.$",
+	"hinlegen$",
+	"lesen$",
+	"s. verstec$",
+	"Leo$",
+	"Pat$",
+	"Guy$",
+	"Eva$",
+	"Bob$",
+	"Luc$",
+	"Ida$",
+	"Max$",
+	" JULIA$",
+	"hat sie Selbstmord begangen ?$",
+	"ist sie ermordet worden ?$",
+	"ist sie durch Unfall gestorben ?$",
+	"ist sie eines natuerlichen Todes gestorben ?$",
+	" Woher kam das Geld, das die restaurierung des landsitzes erlaubte ?$",
+	"Erpressung$",
+	"Arbeit$",
+	"Erbschaft$",
+	"Rennen$",
+	"Renten$",
+	"Raub$",
+	"Verschiedenes$",
+	" Was ist Leos Hobby ?$",
+	"Historische Recherchen$",
+	"Politik$",
+	"Malerei$",
+	"Drogen$",
+	"Okkultismus$",
+	"Fuehrung einer Sekte$",
+	" Julia Hat verschiedene Indizien hinterlassen. Diese befinden sich an einem einzigen Ort. Welchem ?$",
+	"Kapelle$",
+	"Draussen$",
+	"Keller$",
+	"Dachboden$",
+	"Kueche$",
+	"Esszimmer$",
+	"Julias Zimmer$",
+	"Leos Zimmer$",
+	"Pats Zimmer$",
+	"Bobs Zimmer$",
+	"Maxs Zimmer$",
+	"Luc/Idas Zimmer$",
+	"Guy/Evas Zimmer$",
+	" Der entscheidende Hinweis, der es Ihnen ermoeglichte, bis an die Tuer des Souterrains zu gelangen, war :$",
+	"ein Dolch$",
+	"ein Ring$",
+	"ein Buch$",
+	"ein Pergament$",
+	"ein Brief$",
+	"ein Pendel$",
+	" Wievele Pergamente befinden sich auf dem Landsitz ?$",
+	"kein$",
+	"eins$",
+	"zwei$",
+	"drei$",
+	"vier$",
+	"fnf$",
+	" Wieviele Personen sind in die Geschichte verwickelt ? (Julia eingeschlossen, ausgenommen Sie)$",
+	"neun$",
+	"zehn$",
+	"elf$",
+	" Wie war der Name der unbekannten Person ?$",
+	"Mireille$",
+	"Fran‡oise$",
+	"Maguy$",
+	"Emilie$",
+	"Murielle$",
+	"Sophie$",
+	" Wessen Geliebte war Murielle ?$",
+	"Bob$",
+	"Luc$",
+	"Guy$",
+	"Leo$",
+	"Max$",
+	" Murielle teilte eine Beschaeftigung mit einer anderen Person. Mit wem ?$",
+	"[1][Allein der Zufall hat es Ihnen ermoeglicht bis hierher zu komen.| Gehen Sie zurueck und forschen Sie noch einmal nach,|damit Sie das Gaze besser verstehen...][ok]$",
+	"[1][Legen Sie die Diskette 1 ein][ok]$",
+	"[1][Problem mit der Diskette | Alles abstellen...][OK]$",
+	"[1][Sie haetten 00% der Hinweise|      bemerken muessen][ OK ]$",
+	"[1][Legen Sie die Diskette 2 ein][ok]$",
+	"[1][Bevor Sie weitermachen, fassen Sie Ihre Kenntnisse Zusammen][ok]$",
+	" MASTER .$",
+	" sgaf",
 	NULL
 };
 #endif
diff --git a/dists/engine-data/mort.dat b/dists/engine-data/mort.dat
index 125d37f..23e06fe 100644
Binary files a/dists/engine-data/mort.dat and b/dists/engine-data/mort.dat differ


Commit: ca3396970cdc77482e86e14b1ac739a3666174d2
    https://github.com/scummvm/scummvm/commit/ca3396970cdc77482e86e14b1ac739a3666174d2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-04T14:46:52-07:00

Commit Message:
MORTEVIELLE: Update misc files to include mort.dat

Changed paths:
    Makefile.common
    devtools/README
    dists/engine-data/README
    dists/scummvm.rc
    dists/scummvm.rc.in



diff --git a/Makefile.common b/Makefile.common
index aec033f..02c3408 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -253,6 +253,9 @@ endif
 ifdef ENABLE_LURE
 DIST_FILES_ENGINEDATA+=lure.dat
 endif
+ifdef ENABLE_MORTEVIELLE
+DIST_FILES_ENGINEDATA+=mort.dat
+endif
 ifdef ENABLE_NEVERHOOD
 DIST_FILES_ENGINEDATA+=neverhood.dat
 endif
diff --git a/devtools/README b/devtools/README
index c7f08d6..482c24e 100644
--- a/devtools/README
+++ b/devtools/README
@@ -63,6 +63,13 @@ create_lure (dreammaster)
     the lure.dat file.
 
 
+create_mort (Strangerke)
+-----------
+    Gathers several information found in the original DOS executable:
+    - Font data
+    - French, German and fan-made English translation
+
+
 create_project (LordHoto, Littleboy)
 --------------
     Creates project files for Visual Studio 2005, 2008, 2010, 2012, Xcode and
diff --git a/dists/engine-data/README b/dists/engine-data/README
index c9c4bd4..9bbb006 100644
--- a/dists/engine-data/README
+++ b/dists/engine-data/README
@@ -16,6 +16,11 @@ scripts, from.
 lure.dat
 TODO
 
+mort.dat:
+File created partially by extracting font data from the French executable. It
+also contains the French and German translation, as well as a custom-made
+English translation.
+
 queen.tbl:
 'queen.tbl' contains a list of filenames, filesizes and offsets for the
 individual files saved in QUEEN.1. This data was originally included in the
diff --git a/dists/scummvm.rc b/dists/scummvm.rc
index f3fa14c..037db3e 100644
--- a/dists/scummvm.rc
+++ b/dists/scummvm.rc
@@ -32,6 +32,9 @@ kyra.dat               FILE    "dists/engine-data/kyra.dat"
 #if ENABLE_LURE       == STATIC_PLUGIN
 lure.dat               FILE    "dists/engine-data/lure.dat"
 #endif
+#if ENABLE_MORTEVIELLE == STATIC_PLUGIN
+mort.dat               FILE    "dists/engine-data/mort.dat"
+#endif
 #if ENABLE_NEVERHOOD  == STATIC_PLUGIN
 neverhood.dat          FILE    "dists/engine-data/neverhood.dat"
 #endif
diff --git a/dists/scummvm.rc.in b/dists/scummvm.rc.in
index b7a87f4..c18c18e 100644
--- a/dists/scummvm.rc.in
+++ b/dists/scummvm.rc.in
@@ -32,6 +32,9 @@ kyra.dat               FILE    "dists/engine-data/kyra.dat"
 #if ENABLE_LURE       == STATIC_PLUGIN
 lure.dat               FILE    "dists/engine-data/lure.dat"
 #endif
+#if ENABLE_MORTEVIELLE == STATIC_PLUGIN
+mort.dat               FILE    "dists/engine-data/mort.dat"
+#endif
 #if ENABLE_NEVERHOOD  == STATIC_PLUGIN
 neverhood.dat          FILE    "dists/engine-data/neverhood.dat"
 #endif


Commit: 1bd1a8ab612abb077c9318f7f881cd70a2ed2753
    https://github.com/scummvm/scummvm/commit/1bd1a8ab612abb077c9318f7f881cd70a2ed2753
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-06T14:59:47-07:00

Commit Message:
MORTEVIELLE: Remove unused const

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 486f93f..8f9df4a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -136,7 +136,6 @@ const int kMenuPlaceStringIndex = 435;
 const int kMenuActionStringIndex = 476;
 const int kMenuSelfStringIndex = 497;
 const int kMenuSayStringIndex = 502;
-const int kSecretPassageQuestionStringIndex = 510;    // Unused?
 const int kMaxPatt = 20;
 
 const int OPCODE_NONE = 0;


Commit: 5d56de9c76ed8e82a7f3e9b4d1003939e0203aa8
    https://github.com/scummvm/scummvm/commit/5d56de9c76ed8e82a7f3e9b4d1003939e0203aa8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-07T07:09:42-07:00

Commit Message:
MORTEVIELLE: Some renaming in Mortevielle.h

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 8f9df4a..dcb61a6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -125,8 +125,8 @@ const int kArep = 1314;
 const int kAmzon = 1650;
 const int kArega = 0;
 
-const int kMaxTi = 9000;
-const int kMaxTd = 600;
+const int kMaxDialogIndex = 9000;
+const int kMaxDialogHint = 600;
 
 const int kDescriptionStringIndex = 0;                // Unused
 const int kInventoryStringIndex = 186;
@@ -281,8 +281,8 @@ private:
 	int    _openObjects[8];
 	int    _nbrep[9];
 	int    _nbrepm[9];
-	uint16 _inpBuffer[kMaxTi + 1];
-	Hint   _ntpBuffer[kMaxTd + 1];
+	uint16 _dialogIndexArray[kMaxDialogIndex + 1];
+	Hint   _dialogHintArray[kMaxDialogHint + 1];
 
 	Common::ErrorCode initialise();
 	Common::ErrorCode loadMortDat();
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 9b140fc..78a4db8 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1849,13 +1849,13 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 	uint16 oct, ocd;
 
 	/* 5-8 */
-	oct = _inpBuffer[idx];
+	oct = _dialogIndexArray[idx];
 	oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
 	if (pt < 6) {
 		++idx;
 		oct = oct << (5 - pt);
 		pt += 11;
-		oct = oct | ((uint)_inpBuffer[idx] >> pt);
+		oct = oct | ((uint)_dialogIndexArray[idx] >> pt);
 	} else {
 		pt -= 5;
 		oct = (uint)oct >> pt;
@@ -1865,13 +1865,13 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 		c = '$';
 		the_end = true;
 	} else if (oct == 30 || oct == 31) {
-		ocd = _inpBuffer[idx];
+		ocd = _dialogIndexArray[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
 		if (pt < 6) {
 			++idx;
 			ocd = ocd << (5 - pt);
 			pt += 11;
-			ocd = ocd | ((uint)_inpBuffer[idx] >> pt);
+			ocd = ocd | ((uint)_dialogIndexArray[idx] >> pt);
 		} else {
 			pt -= 5;
 			ocd = (uint)ocd >> pt;
@@ -1903,8 +1903,8 @@ Common::String MortevielleEngine::getString(int num) {
 	} else if (!_txxFileFl) {
 		wrkStr = getGameString(num);
 	} else {
-		int hint = _ntpBuffer[num]._hintId;
-		byte point = _ntpBuffer[num]._point;
+		int hint = _dialogHintArray[num]._hintId;
+		byte point = _dialogHintArray[num]._point;
 		int length = 0;
 		bool endFl = false;
 		char let;
@@ -2116,20 +2116,20 @@ void MortevielleEngine::loadTexts() {
 		return;
 	}
 
-	if ((inpFile.size() > (kMaxTi * 2)) || (ntpFile.size() > (kMaxTd * 3))) {
+	if ((inpFile.size() > (kMaxDialogIndex * 2)) || (ntpFile.size() > (kMaxDialogHint * 3))) {
 		warning("TXX file - Unexpected format - Switching to DAT file");
 		return;
 	}
 
 	for (int i = 0; i < inpFile.size() / 2; ++i)
-		_inpBuffer[i] = inpFile.readUint16LE();
+		_dialogIndexArray[i] = inpFile.readUint16LE();
 
 	inpFile.close();
 	_txxFileFl = true;
 
 	for (int i = 0; i < (ntpFile.size() / 3); ++i) {
-		_ntpBuffer[i]._hintId = ntpFile.readSint16LE();
-		_ntpBuffer[i]._point = ntpFile.readByte();
+		_dialogHintArray[i]._hintId = ntpFile.readSint16LE();
+		_dialogHintArray[i]._point = ntpFile.readByte();
 	}
 
 	ntpFile.close();


Commit: 175a13e65a5bea387ad23188811e7ae2b27aeb84
    https://github.com/scummvm/scummvm/commit/175a13e65a5bea387ad23188811e7ae2b27aeb84
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-12T18:28:22-07:00

Commit Message:
MORTEVIELLE: Fixed ifdef header guard naming

Changed paths:
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 4f98c4c..73f8e16 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#ifndef MORTEVIELLE_PAROLE_H
-#define MORTEVIELLE_PAROLE_H
+#ifndef MORTEVIELLE_SPEECH_H
+#define MORTEVIELLE_SPEECH_H
 
 #include "common/scummsys.h"
 #include "mortevielle/sound.h"
@@ -99,4 +99,5 @@ public:
 };
 
 } // End of namespace Mortevielle
+
 #endif


Commit: a6b1d4a8b5ba872427270675f5ef6f72345c4b75
    https://github.com/scummvm/scummvm/commit/a6b1d4a8b5ba872427270675f5ef6f72345c4b75
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-13T13:22:57-07:00

Commit Message:
MORTEVIELLE: Fix some typos identified by wjp

Changed paths:
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 46c7c75..2734f8c 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -210,14 +210,14 @@ Common::ErrorCode MortevielleEngine::initialise() {
 }
 
 /**
- * Loads the contents of the Mort.dat data file
+ * Loads the contents of the mort.dat data file
  */
 Common::ErrorCode MortevielleEngine::loadMortDat() {
 	Common::File f;
 
 	// Open the mort.dat file
 	if (!f.open(MORT_DAT)) {
-		GUIErrorMessage("Could not locate Mort.dat file");
+		GUIErrorMessage("Could not locate 'mort.dat'.");
 		return Common::kReadingFailed;
 	}
 
@@ -231,7 +231,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
 
 	// Check the version
 	if (f.readByte() < MORT_DAT_REQUIRED_VERSION) {
-		GUIErrorMessage("The located mort.dat data file is too a version");
+		GUIErrorMessage("The located mort.dat data file is too old, please download an updated version on scummvm.org");
 		return Common::kReadingFailed;
 	}
 	f.readByte();		// Minor version


Commit: e2b192b839bdf0ac591825b88f07b61c566ada3d
    https://github.com/scummvm/scummvm/commit/e2b192b839bdf0ac591825b88f07b61c566ada3d
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-07-13T14:40:49-07:00

Commit Message:
MORTEVIELLE: Add missing eol character in devtool usage message

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 6fe115d..2dff398 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -149,7 +149,7 @@ void process() {
  */
 int main(int argc, char *argv[]) {
 	if (argc != 2) {
-		printf("Usage:\n%s input_filename\nWhere input_filename is the name of the Mortevielle DOS executable", argv[0]);
+		printf("Usage:\n%s input_filename\nWhere input_filename is the name of the Mortevielle DOS executable.\n", argv[0]);
 		exit(0);
 	}
 


Commit: dcb2f69bbfa2e84335ce1a8bf10524efb3936e37
    https://github.com/scummvm/scummvm/commit/dcb2f69bbfa2e84335ce1a8bf10524efb3936e37
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-07-13T14:41:25-07:00

Commit Message:
MORTEVIELLE: Convert non-ASCII characters to their octal value

Changed paths:
    devtools/create_mortdat/enginetext.h
    devtools/create_mortdat/gametext.h



diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index c492914..f785c4d 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -82,19 +82,19 @@ const char *engineDataEn[] =  {
 const char *engineDataFr[] = {
 	"[2][ ][OUI][NON]",
 	"aller",
-	"quelqu'un entre, parait ‚tonn‚ mais ne dit rien",
+	"quelqu'un entre, parait \202tonn\202 mais ne dit rien",
 	"Cool",
 	" Lourde ",
 	"Malsaine",
 	"Idem",
 	"Vous",
-	"ˆtes",
+	"\210tes",
 	"SEUL",
 
 	"Mince! Vous entendez du bruit...",
-	" | Vous devriez avoir remarqu‚|       ",
+	" | Vous devriez avoir remarqu\202|       ",
 	"% des indices...",
-	"D‚sirez-vous vous r‚veiller?",
+	"D\202sirez-vous vous r\202veiller?",
 	"OK",
 	"", 
 	" Sauvegarde",
@@ -123,7 +123,7 @@ const char *engineDataFr[] = {
 	"fermer",
 	"frapper",
 	"poser",
-	"d‚foncer",
+	"d\202foncer",
 
 	"sentir",
 	"gratter",
diff --git a/devtools/create_mortdat/gametext.h b/devtools/create_mortdat/gametext.h
index 6e43258..f8fe070 100644
--- a/devtools/create_mortdat/gametext.h
+++ b/devtools/create_mortdat/gametext.h
@@ -285,7 +285,7 @@ const char *gameDataEn[] =  {
 	"Julia's bedroom$",
 	"The photo at Julia's home$",
 	"Julia and yourself...$",
-	"L‚o's occupations$",
+	"L\202o's occupations$",
 	"Pat's occupations$",
 	"Guy's occupations$",
 	"Bob's occupations$",
@@ -294,7 +294,7 @@ const char *gameDataEn[] =  {
 	"Ida's occupations$",
 	"Max's occupations$",
 	"Your occupations$",
-	"L‚o's relationships$",
+	"L\202o's relationships$",
 	"Pat's relationships$",
 	"Guy's relationships$",
 	"Bob's relationships$",
@@ -324,7 +324,7 @@ const char *gameDataEn[] =  {
 	"These are the mountains one can see in front of the manor$",
 	"I don't know!$",
 	"She died from pulmonary embolism$",
-	"Mother died suddenly. And yet her health had seemed to improve‚$",
+	"Mother died suddenly. And yet her health had seemed to improve\202$",
 	"Miss DEFRANCK died from a cold$",
 	"She died from pulmonary embolism$",
 	"Excuse me but I prefer to say nothing for now$",
@@ -493,7 +493,7 @@ const char *gameDataEn[] =  {
 	"Directed by: KYILKHOR CREATION and LANGLOIS$",
 	"$",
 	"With the cooperation of...$",
-	"B‚atrice et Jean_Luc LANGLOIS$",
+	"B\202atrice et Jean_Luc LANGLOIS$",
 	"for the music and the voices,$",
 	"Bernard GRELAUD for the graphic conception,$",
 	"MARIA-DOLORES for the graphic direction,$",
@@ -592,7 +592,7 @@ const char *gameDataEn[] =  {
 	"- Eleven$",
 	"What was the first name at of the unknown character?$",
 	"- Mireille$",
-	"- Fran‡oise$",
+	"- Fran\207oise$",
 	"- Maguy$",
 	"- Emilie$",
 	"- Murielle$",
@@ -617,9 +617,9 @@ const char *gameDataEn[] =  {
 
 const char *gameDataFr[] = {
 	"Le calme dans la tourmente$",
-	"Des go—ts et des couleurs!$",
+	"Des go\227ts et des couleurs!$",
 	"Mauve qui peut!$",
-	"PriŠre de laisser en sortant...$",
+	"Pri\212re de laisser en sortant...$",
 	"Trou noir troublant$",
 	"Bleu... comme \"peur bleue\"!$",
 	"Chambre de \"Saigneur\"!$",
@@ -629,33 +629,33 @@ const char *gameDataFr[] = {
 	"Odeur de feux de bois et de tabac$",
 	"Tabac et vieux bouquins$",
 	"Oignons, cannelle et spiritueux$",
-	"Un endroit bien peu visit‚$",
-	"Humidit‚ et moisissure$",
+	"Un endroit bien peu visit\202$",
+	"Humidit\202 et moisissure$",
 	"Avis aux colporteurs...$",
-	"Corps putr‚fi‚ : cryptomanie mortelle!$",
-	"Et en plus... des piŠges d‚samorc‚s!$",
-	"C'est d‚j… ouvert$",
+	"Corps putr\202fi\202 : cryptomanie mortelle!$",
+	"Et en plus... des pi\212ges d\202samorc\202s!$",
+	"C'est d\202j\205 ouvert$",
 	"Danger : avalanches$",
-	"Une odeur de saintet‚!$",
-	"Une bƒtisse imposante$",
-	"L'envers du mystŠre!$",
-	"Dr“le d'horoscope!$",
+	"Une odeur de saintet\202!$",
+	"Une b\203tisse imposante$",
+	"L'envers du myst\212re!$",
+	"Dr\223le d'horoscope!$",
 	"Tant va la cruche...$",
-	"Une porte en chŠne$",
+	"Une porte en ch\212ne$",
 	"Une photo$",
 	"Les armoiries$",
 	"$",
-	"Max, le domestique, vous accueille puis vous conduit … votre chambre$",
-	"Mortevielle, le 16/2/51@         Mon cher J‚r“me,@ Suite … mon t‚l‚gramme, je vous fais part des raisons de mon inqui‚tude :il y a un an, Murielle, ma dame de compagnie, disparaissait . D‚part ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile … comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'… pr‚sent, faire le jour sur cette affaire, je compte sur vous pour la mener … bien . Si mon ‚tat de sant‚ ne s'am‚liorait pas, prenez les d‚cisions qui vous sembleront le plus  appropri‚es...@             Amiti‚s. JULIA DEFRANCK$",
-	"Plus tard, Guy vous apprendra le suicide de L‚o...  aprŠs un pari insens‚ aux courses!$",
+	"Max, le domestique, vous accueille puis vous conduit \205 votre chambre$",
+	"Mortevielle, le 16/2/51@         Mon cher J\202r\223me,@ Suite \205 mon t\202l\202gramme, je vous fais part des raisons de mon inqui\202tude :il y a un an, Murielle, ma dame de compagnie, disparaissait . D\202part ayant rapport avec le renouveau financier du Manoir, ou... Silence difficile \205 comprendre, surtout pour mon fils Guy . N'ayant pu jusqu'\205 pr\202sent, faire le jour sur cette affaire, je compte sur vous pour la mener \205 bien . Si mon \202tat de sant\202 ne s'am\202liorait pas, prenez les d\202cisions qui vous sembleront le plus  appropri\202es...@             Amiti\202s. JULIA DEFRANCK$",
+	"Plus tard, Guy vous apprendra le suicide de L\202o...  apr\212s un pari insens\202 aux courses!$",
 	"F3: encore at F8: suite$",
-	"Le maŒtre des lieux$",
-	"Le futur h‚ritier$",
+	"Le ma\214tre des lieux$",
+	"Le futur h\202ritier$",
 	"Le fils de JULIA$",
 	"Joli brin!!!$",
 	"Superman!$",
 	"Le mari d'Ida$",
-	"Propos int‚ressants?$",
+	"Propos int\202ressants?$",
 	"Service compris...$",
 	"Rien dessous!$",
 	"Un ange passe...$",
@@ -663,61 +663,61 @@ const char *gameDataFr[] = {
 	"Admirez! Contemplez!$",
 	"Non ! Rien !$",
 	"Impossible$",
-	"‡a tache !$",
-	"Un trait‚ sur l'histoire de la r‚gion$",
-	"Quelques piŠces$",
+	"\207a tache !$",
+	"Un trait\202 sur l'histoire de la r\202gion$",
+	"Quelques pi\212ces$",
 	"Premier commandement...$",
-	"Des p‚tales plein les narines !$",
+	"Des p\202tales plein les narines !$",
 	"Pique, Coeur...$",
-	"‡a ne manque pas de cachets !$",
+	"\207a ne manque pas de cachets !$",
 	"Un roman d'amour$",
 	"Souffler n'est pas jouer$",
-	"Pas une r‚ussite!$",
+	"Pas une r\202ussite!$",
 	"Gare aux rebondissements !$",
 	"Sombre et profond...$",
 	"Sensations normales$",
 	"Sniff!$",
 	"Pas discret ! Contentez-vous de regarder !$",
-	"Atchoum! De la p... poussiŠre$",
-	"La toile est sign‚e... pas le papier peint !$",
+	"Atchoum! De la p... poussi\212re$",
+	"La toile est sign\202e... pas le papier peint !$",
 	"Pas de chance, rien !$",
 	"Soyez plus discret !$",
 	"Les volets sont clos$",
 	"De la neige, encore de la neige !$",
-	"G‚nial : une toile de maŒtre !$",
-	"Aucun doute : une v‚ritable imitation$",
+	"G\202nial : une toile de ma\214tre !$",
+	"Aucun doute : une v\202ritable imitation$",
 	"Hum ! Vous tiquez : de l'antique en toc !$",
-	"Une piŠce rare de valeur !$",
+	"Une pi\212ce rare de valeur !$",
 	"Rien de remarquable$",
 	"Linge, objets personnels...$",
-	"Pas n'importe o— !$",
+	"Pas n'importe o\227 !$",
 	"Ce n'est pas l'heure !$",
-	"On ne parle pas la bouche pleine ! Donc, une fois le repas termin‚...$",
+	"On ne parle pas la bouche pleine ! Donc, une fois le repas termin\202...$",
 	"Quelqu'un entre, s'affaire, ressort...$",
 	"On s'approche de votre cachette !$",
 	"On vous surprend !$",
-	"Non : vous ˆtes trop charg‚ !$",
+	"Non : vous \210tes trop charg\202 !$",
 	"Essayez de nouveau$",
 	"Vous restez perplexe !?$",
 	"Vous quittez le Manoir. A Paris, un message vous attend...$",
-	"A‹e, a‹e, a‹e !$",
+	"A\213e, a\213e, a\213e !$",
 	"Rien de plus$",
-	"Le son paraŒt normal$",
+	"Le son para\214t normal$",
 	"Ca ne bouge pas$",
-	"On vous r‚pond$",
+	"On vous r\202pond$",
 	"Pas le moment !$",
-	"Mˆme matiŠre, autre face !$",
-	"Le reflet est piqu‚, mais le cadre est d'or$",
+	"M\210me mati\212re, autre face !$",
+	"Le reflet est piqu\202, mais le cadre est d'or$",
 	"Bibelots, babioles...$",
-	"Vous essuyez un ‚chec !$",
+	"Vous essuyez un \202chec !$",
 	"Il est des odeurs... qu'il vaut mieux ne pas voir !$",
-	"Des produits m‚nagers$",
-	"‡a vous d‚mange ?$",
-	"C'est coinc‚, gel‚ ! Brrrr...$",
-	"Les huisseries sont bloqu‚es !$",
+	"Des produits m\202nagers$",
+	"\207a vous d\202mange ?$",
+	"C'est coinc\202, gel\202 ! Brrrr...$",
+	"Les huisseries sont bloqu\202es !$",
 	"Des papiers...$",
-	"Non ! Le pŠre Noˆl n'est pas coinc‚ !$",
-	"‡a donne sur un couloir$",
+	"Non ! Le p\212re No\210l n'est pas coinc\202 !$",
+	"\207a donne sur un couloir$",
 	"Vaisselle, argenterie...$",
 	"Non ! Ce ne sont pas les restes de Julia !$",
 	"Une gravure ancienne$",
@@ -726,17 +726,17 @@ const char *gameDataFr[] = {
 	"Le passage se ferme$",
 	"Un tiroir secret... Un livret ! Le lisez-vous ?$",
 	"Le tiroir se referme$",
-	"Rien ! Sang et chairs collent … la pierre !$",
-	"Des d‚tails vous font supposer que... la mort ne fut pas imm‚diate !$",
-	"Des projets v‚reux ?$",
-	"Sa vie n'aurait-elle tenu qu'… un doigt ?$",
-	"Un tr‚sor se serait-il fait la malle ?$",
-	"Une fente de la taille d'une piŠce !$",
-	"Quelques pierres pivotent... Une crypte ! Y p‚n‚trez-vous ?$",
+	"Rien ! Sang et chairs collent \205 la pierre !$",
+	"Des d\202tails vous font supposer que... la mort ne fut pas imm\202diate !$",
+	"Des projets v\202reux ?$",
+	"Sa vie n'aurait-elle tenu qu'\205 un doigt ?$",
+	"Un tr\202sor se serait-il fait la malle ?$",
+	"Une fente de la taille d'une pi\212ce !$",
+	"Quelques pierres pivotent... Une crypte ! Y p\202n\202trez-vous ?$",
 	"La bague tourne, le mur se referme...$",
-	"Une colonne de pierres derriŠre l'autel$",
+	"Une colonne de pierres derri\212re l'autel$",
 	"Il y a du bruit...$",
-	"Occup‚ !$",
+	"Occup\202 !$",
 	"Retentez-vous votre chance ?$",
 	"Trop profond !$",
 	"Le mur de la cave pivote$",
@@ -745,45 +745,45 @@ const char *gameDataFr[] = {
 	"L'objet glisse au fond...$",
 	"Vous n'avez rien en main$",
 	"Ce n'est pas ouvert$",
-	"Il y a d‚j… quelque chose$",
-	"La porte est ferm‚e$",
-	"Pas de r‚ponse$",
+	"Il y a d\202j\205 quelque chose$",
+	"La porte est ferm\202e$",
+	"Pas de r\202ponse$",
 	"Une boule de bois pleine$",
 	"Il n'y a plus de place$",
-	"Une boule de bois perc‚e par le travers$",
+	"Une boule de bois perc\202e par le travers$",
 	"? ?$",
 	"A vous de jouer$",
 	"OK !$",
-	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  D‚tective \"priv‚\"... de bon sens et de discr‚tion sans doute\" . D‚‡u d‚moralis‚, vous quittez le manoir at Vous Štes NUL !$",
-	"L‚o vous interrompt : \"la tempŠte est calm‚e. Je pars en ville dans 1 heure. Tenez-vous prˆt!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
-	"Congestion, grippe fatale : vous y restez ! Votre enquŠte tombe … l'eau$",
-	"L'eau monte trŠs vite et refroidit vos derniŠres illusions...  Avant que vous n'ayez eu le temps de r‚agir, vous Štes mort!$",
-	"A peine Štes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
-	"La tempŠte recouvre vos traces . Un mur de silence s'abat sur vos ‚paules . Lentement vous succombez … la morsure du froid !$",
-	"Pas si seul que ‡a ! Une lame glac‚e s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
-	"Vous ignorez la responsabilit‚ exacte de L‚o dans la mort de Murielle... Est-elle morte sur le coup ? De toutes fa‡ons les problŠmes familiaux d‚couverts lors de votre enquŠte justifient l'attitude de L‚o... Vous n'Štes pas s—r que Julia vous ait appel‚ pour ‡a mais c'est suffisant pour vous ! Par respect pour elle, et aprŠs  certaines pr‚cautions, vous avez une entrevue r‚v‚latrice avec L‚o$",
+	"Soudain Max survient avec votre  valise : \"Merci de votre visite !  D\202tective \"priv\202\"... de bon sens et de discr\202tion sans doute\" . D\202\207u d\202moralis\202, vous quittez le manoir at Vous \212tes NUL !$",
+	"L\202o vous interrompt : \"la temp\212te est calm\202e. Je pars en ville dans 1 heure. Tenez-vous pr\210t!\"... Bon... Vous avez perdu du temps...  mais pas la vie$",
+	"Congestion, grippe fatale : vous y restez ! Votre enqu\212te tombe \205 l'eau$",
+	"L'eau monte tr\212s vite et refroidit vos derni\212res illusions...  Avant que vous n'ayez eu le temps de r\202agir, vous \212tes mort!$",
+	"A peine \212tes-vous au fond du puits qu'une main tranche la corde... Adieu la vie!$",
+	"La temp\212te recouvre vos traces . Un mur de silence s'abat sur vos \202paules . Lentement vous succombez \205 la morsure du froid !$",
+	"Pas si seul que \207a ! Une lame glac\202e s'enfonce dans votre dos. A l'avenir, soyez plus prudent!$",
+	"Vous ignorez la responsabilit\202 exacte de L\202o dans la mort de Murielle... Est-elle morte sur le coup ? De toutes fa\207ons les probl\212mes familiaux d\202couverts lors de votre enqu\212te justifient l'attitude de L\202o... Vous n'\212tes pas s\227r que Julia vous ait appel\202 pour \207a mais c'est suffisant pour vous ! Par respect pour elle, et apr\212s  certaines pr\202cautions, vous avez une entrevue r\202v\202latrice avec L\202o$",
 	"$",
-	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans r‚ponse . Vous allez attraper... la mort !$",
-	"D'un mouvement circulaire, l'‚p‚e vous fend par le travers : tripes et boyaux … l'air, bonjour les vers!$",
+	"Vous n'avez pas les clefs du Manoir . Vos appels restent sans r\202ponse . Vous allez attraper... la mort !$",
+	"D'un mouvement circulaire, l'\202p\202e vous fend par le travers : tripes et boyaux \205 l'air, bonjour les vers!$",
 	"Home, Sweet home !$",
-	"MystŠre d'une porte close$",
-	"Charme envo—tant de vieilles piŠces$",
+	"Myst\212re d'une porte close$",
+	"Charme envo\227tant de vieilles pi\212ces$",
 	"La faim au ventre$",
-	"Plus prŠs du ciel? Pas s—r !$",
+	"Plus pr\212s du ciel? Pas s\227r !$",
 	"Peur du noir?$",
 	"Vieux tapis et reflets d'or$",
 	"Angoisse !$",
-	"Sauv‚ ? Pas certain !$",
-	"Mal … l'aise, hein !$",
+	"Sauv\202 ? Pas certain !$",
+	"Mal \205 l'aise, hein !$",
 	"Toujours plus loin !$",
 	"Votre chemin de croix !$",
-	"A la d‚couverte de...$",
-	"Attention … ce que cache...$",
+	"A la d\202couverte de...$",
+	"Attention \205 ce que cache...$",
 	"Une descente aux Enfers !$",
 	"Si ce n'est pas dans vos cordes :@       ne soyez pas sot!$",
-	"Avant la mise en piŠce !$",
+	"Avant la mise en pi\212ce !$",
 	"Gros plan sur :$",
-	"Vous remarquez particuliŠrement...$",
+	"Vous remarquez particuli\212rement...$",
 	"Et encore...$",
 	"C'est fini !$",
 	"Un peu de lecture$",
@@ -794,17 +794,17 @@ const char *gameDataFr[] = {
 	"Non ! Pas ce coup-ci$",
 	"Trop tard$",
 	"$",
-	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumiŠre, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette artŠre comme un rat au coeur mˆme de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
-	"10/1/50: Nous avons r‚solu le mystŠre du manuscrit et localis‚ la crypte . Est-ce l'id‚e d'aboutir dans ce qui n'‚tait qu'un \"rŠve\" qui me rend si anxieuse ?@Je regrette de m'ˆtre engag‚e vis … vis de L‚o . Non! je dois continuer ! J'aurais d— mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
-	"Porte ta priŠre au lieu saint qui se doit, changes-en l'air, tu auras la matiŠre !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton …me s'ouvrira un chemin et gagnera son Šre . Avance comme un Orph‚e peu soucieux des t‚nŠbres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'… la myst‚rieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse premiŠre.$",
-	"Les montagnes sont les crocs d'une gueule dantesque ouverte … l'infini de quelqu' orgie c‚leste, mastiquant des ‚toiles comme nous broyons du noir . at Tu d‚poseras l'accord de pierre … tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un mŠtre . Tu passeras ainsi entre les deux croissants, par del… les abŒmes du Mur du Silence . La Cl‚ des champs est … ta port‚e, tu n'as qu'… retrouver la note qui d‚note.$",
+	"Comme un regard profond tout couvert de peaux-pierres, pointant  son oeil obscur aux astres de lumi\212re, il est la gorge reliant le ciel et les enfers . Il faut aller au fond de cette art\212re comme un rat au coeur m\210me de la terre !@Lundi,  Mardi,  Mercredi, Dimanche du 1e lundi au 1e dimanche, tu installeras \"ce rat\" entre chacun des jours . N'omets rien car ta venue serait ta retenue !@Porte ton fardeau comme un oeuf nouveau et donne lui le jour avec force et amour.$",
+	"10/1/50: Nous avons r\202solu le myst\212re du manuscrit et localis\202 la crypte . Est-ce l'id\202e d'aboutir dans ce qui n'\202tait qu'un \"r\212ve\" qui me rend si anxieuse ?@Je regrette de m'\210tre engag\202e vis \205 vis de L\202o . Non! je dois continuer ! J'aurais d\227 mettre Guy au courant... mais, depuis une semaine, je n'ai aucune nouvelle .$",
+	"Porte ta pri\212re au lieu saint qui se doit, changes-en l'air, tu auras la mati\212re !@Du pilier de la haute sagesse, le soleil aux genoux te montrera l'espace par lequel ton \205me s'ouvrira un chemin et gagnera son \212re . Avance comme un Orph\202e peu soucieux des t\202n\212bres : le blanc est ta couleur, l'or ta demeure . Eclaire ton chemin jusqu'\205 la myst\202rieuse . Offre-lui le cercle de l'homme aux trois facettes . Qu'il regagne le monde et qu'il tourne avec lui dans la richesse premi\212re.$",
+	"Les montagnes sont les crocs d'une gueule dantesque ouverte \205 l'infini de quelqu' orgie c\202leste, mastiquant des \202toiles comme nous broyons du noir . at Tu d\202poseras l'accord de pierre \205 tes pieds, le rire du silence sur la gamme d'en haut et dans ta main droite, une toile d'un m\212tre . Tu passeras ainsi entre les deux croissants, par del\205 les ab\214mes du Mur du Silence . La Cl\202 des champs est \205 ta port\202e, tu n'as qu'\205 retrouver la note qui d\202note.$",
 	"                DECEMBRE@   9 REMISE     518    13 AGIOS       23@  19 VIREMENT  1203    17 TRESOR    1598@      TOTAL     1721        TOTAL    1721$",
-	"  Le 5/01/51@@              Luc, mon amour@ Guy connaŒt notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'… toi !  Max me relance mais j'ai d‚finitivement rompu avec lui . Qu'il reste … ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
-	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr‚t‚s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
-	"  Mortevielle, le 15/2/51@              MaŒtre,@ Je vous ‚cris au sujet de notre affaire.  Je suis d‚cid‚  … aller jusqu'au bout, certain que mon associ‚, Pat DEFRANCK, a falsifi‚  un livre de comptes . Malgr‚$",
+	"  Le 5/01/51@@              Luc, mon amour@ Guy conna\214t notre liaison . A la suite d'une dispute, je lui ai tout dit . Je ne pense qu'\205 toi !  Max me relance mais j'ai d\202finitivement rompu avec lui . Qu'il reste \205 ses gamelles . Quand pourrons-nous nous voir seuls ? Pour toi je divorcerai...   Je t'aime .@             ton Eva$",
+	"  Mortevielle, le 10/2/51@@              Pat,@ Je te rappelle que tu me dois  50000 F que je t'ai pr\202t\202s pour ton affaire . J'en ai besoin, peux-tu me les rendre assez vite?@              Guy$",
+	"  Mortevielle, le 15/2/51@              Ma\214tre,@ Je vous \202cris au sujet de notre affaire.  Je suis d\202cid\202  \205 aller jusqu'au bout, certain que mon associ\202, Pat DEFRANCK, a falsifi\202  un livre de comptes . Malgr\202$",
 	" Une pipe$",
-	" Un stylo … plume$",
-	" Un briquet … essence$",
+	" Un stylo \205 plume$",
+	" Un briquet \205 essence$",
 	" Une cornue$",
 	" Un blaireau$",
 	" Un pot de peinture$",
@@ -814,13 +814,13 @@ const char *gameDataFr[] = {
 	" Un vieux bouquin$",
 	" Un porte-monnaie$",
 	" Un poignard$",
-	" Un r‚volver$",
+	" Un r\202volver$",
 	" Une bible$",
 	" Une bougie$",
-	" Un coffret … bijoux$",
-	" Un fer … repasser$",
+	" Un coffret \205 bijoux$",
+	" Un fer \205 repasser$",
 	" Une photo$",
-	" Une montre … gousset$",
+	" Une montre \205 gousset$",
 	" Une corde$",
 	" Des clefs$",
 	" Un collier de perles$",
@@ -830,9 +830,9 @@ const char *gameDataFr[] = {
 	" Une bourse en cuir$",
 	" Une balle de tennis$",
 	" Des munitions$",
-	" Un rasoir … main$",
-	" Une brosse … cheveux$",
-	" Une brosse … linge$",
+	" Un rasoir \205 main$",
+	" Une brosse \205 cheveux$",
+	" Une brosse \205 linge$",
 	" Un jeu de cartes$",
 	" Un chausse pied$",
 	" Un tournevis$",
@@ -843,14 +843,14 @@ const char *gameDataFr[] = {
 	" Un pinceau$",
 	" Une corde$",
 	" Un objet en bois$",
-	" Des somnifŠres$",
+	" Des somnif\212res$",
 	" Une bague en or$",
-	" Un coffret … bijoux$",
-	" Un r‚veil matin$",
+	" Un coffret \205 bijoux$",
+	" Un r\202veil matin$",
 	" Une cotte de mailles$",
 	" Un chandellier$",
 	" Une paire de gants$",
-	" Une coupe cisel‚e$",
+	" Une coupe cisel\202e$",
 	" Un parchemin$",
 	" Un poignard$",
 	" Un dossier$",
@@ -868,13 +868,13 @@ const char *gameDataFr[] = {
 	"La mort de Julia$",
 	"Les relations de Julia$",
 	"Un message de Julia$",
-	"L'h‚ritage de Julia$",
+	"L'h\202ritage de Julia$",
 	"Derniers actes de Julia$",
 	"Les cadeaux de Julia$",
 	"La chambre de Julia$",
 	"La photo chez Julia$",
 	"Julia et vous...$",
-	"Les occupations de L‚o$",
+	"Les occupations de L\202o$",
 	"Les occupations de Pat$",
 	"Les occupations de Guy$",
 	"Les occupations de Bob$",
@@ -883,7 +883,7 @@ const char *gameDataFr[] = {
 	"Les occupations d'Ida$",
 	"Les occupations de Max$",
 	"Vos occupations$",
-	"Les relations de L‚o$",
+	"Les relations de L\202o$",
 	"Les relations de Pat$",
 	"Les relations de Guy$",
 	"Les relations de Bob$",
@@ -910,169 +910,169 @@ const char *gameDataFr[] = {
 	"$",
 	"FIN DE LA CONVERSATION$",
 	"Les vieux appelaient ainsi la chaine de montagne qui se dresse au pied du manoir !$",
-	"C'est le massif montagneux que l'on aper‡oit devant le manoir$",
+	"C'est le massif montagneux que l'on aper\207oit devant le manoir$",
 	"Je n'en sais rien !$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Ma m‚re est morte soudainement . Son ‚tat semblait pourtant s'ˆtre am‚lior‚$",
+	"Ma m\202re est morte soudainement . Son \202tat semblait pourtant s'\210tre am\202lior\202$",
 	"Madame DEFRANCK est morte d'un coup de froid$",
 	"Elle est morte d'une embolie pulmonaire$",
-	"Pardonnez moi mais je pr‚fŠre, actuellement garder le silence$",
+	"Pardonnez moi mais je pr\202f\212re, actuellement garder le silence$",
 	"Ce sont toujours les meilleurs qui partent les premiers$",
-	"J'aimais beaucoup ma mŠre . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
-	"C'est une r‚gion qui a un pass‚ charg‚ et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
-	"C'est un passionn‚ d'histoire et un joueur inv‚t‚r‚ . D'ailleurs, voici un an il a gagn‚ une grosse somme$",
-	"Il a d‚j… beaucoup a faire avec la gestion et l'entretien du manoir...$",
-	"Je suis PDG d'une petite soci‚t‚ de parfums . Mais quand je suis ici, je me repose$",
-	"C'est un homme dynamique qui a r‚ussi dans le parfum$",
-	"Lui ! C'est un arriviste v‚reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir‚es dans sa chambre$",
-	"J'ai ‚t‚ trŠs pr‚occup‚ par la sant‚ de ma mŠre, et maintenant je n'ai plus go–t … rien$",
-	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa mŠre$",
+	"J'aimais beaucoup ma m\212re . Je regrette seulement qu'elle soit morte dans le manoir des DEFRANCK$",
+	"C'est une r\202gion qui a un pass\202 charg\202 et j'ai largement de quoi m'occuper . Et puis j'aime beaucoup les chevaux..$",
+	"C'est un passionn\202 d'histoire et un joueur inv\202t\202r\202 . D'ailleurs, voici un an il a gagn\202 une grosse somme$",
+	"Il a d\202j\205 beaucoup a faire avec la gestion et l'entretien du manoir...$",
+	"Je suis PDG d'une petite soci\202t\202 de parfums . Mais quand je suis ici, je me repose$",
+	"C'est un homme dynamique qui a r\202ussi dans le parfum$",
+	"Lui ! C'est un arriviste v\202reux ! Les parfums ont du endormir son bon sens . D'ailleurs ici il passe ses soir\202es dans sa chambre$",
+	"J'ai \202t\202 tr\212s pr\202occup\202 par la sant\202 de ma m\212re, et maintenant je n'ai plus go\226t \205 rien$",
+	"Il aurait mieux fait de s'occuper un peu plus de moi et un peu moins de sa m\212re$",
 	"Ce sont ses affaires...$",
 	"Il n'a pas trop de chance en ce moment bien que ses affaires soient satisfaisantes$",
-	"Je travaille avec Pat mais ‡a ne va pas trŠs fort en ce moment$",
-	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s‚rieusement alors$",
-	"Lui et Pat sont associ‚s . Je crois que ‡a ne va pas trop mal$",
-	"Je m'occupe de moi et c'est d‚j… beaucoup . Et vous ?$",
-	"Oh ‡a ! Je lui fais confiance . Elle sait s'occuper$",
-	"Mais ! Vous n'avez pas encore d‚couvert son occupation principale..?$",
-	"Elle fait dans la d‚coration avec beaucoup dego–t d'ailleurs. Elle est toujours trŠs bien habill‚e$",
-	"Si les bijoux vous interessent, j'ai quelques affaires interessantes … saisir rapidement$",
+	"Je travaille avec Pat mais \207a ne va pas tr\212s fort en ce moment$",
+	"Ah oui ?! Il a des occupations ? Il ferait bien de s'en occuper s\202rieusement alors$",
+	"Lui et Pat sont associ\202s . Je crois que \207a ne va pas trop mal$",
+	"Je m'occupe de moi et c'est d\202j\205 beaucoup . Et vous ?$",
+	"Oh \207a ! Je lui fais confiance . Elle sait s'occuper$",
+	"Mais ! Vous n'avez pas encore d\202couvert son occupation principale..?$",
+	"Elle fait dans la d\202coration avec beaucoup dego\226t d'ailleurs. Elle est toujours tr\212s bien habill\202e$",
+	"Si les bijoux vous interessent, j'ai quelques affaires interessantes \205 saisir rapidement$",
 	"Les bijoux...$",
 	"Je ne sais pas, mais j'aimerais bien qu'il s'occupe un peu moins de mes affaires !$",
-	"Quand on est une femme d'int‚rieur on trouve toujours de quoi s'occuper...$",
+	"Quand on est une femme d'int\202rieur on trouve toujours de quoi s'occuper...$",
 	"Elle pourrait rester sans rien faire, mais non ! Elle coud, elle lit ...$",
-	"Elle n'a s–rement pas des occupations trŠs ‚panouissantes ...$",
+	"Elle n'a s\226rement pas des occupations tr\212s \202panouissantes ...$",
 	"Une femme comme il n'y en a plus : Elle s'interesse a tout !$",
-	"Entre la cuisine et le m‚nage, je n'ai pas beaucoup de temps … vous accorder$",
+	"Entre la cuisine et le m\202nage, je n'ai pas beaucoup de temps \205 vous accorder$",
 	"Je ne sais pas comment il s'y prend pour tout faire . C'est merveilleux !$",
-	"Il en ferait plus si il s'occupait moins des rag“ts et de la bouteille$",
-	"Je suis trŠs ind‚pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de problŠme$",
-	"C'est un ‚go‹ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
-	"Je crois qu'il s'entend bien avec tout le monde, mis … part, peut ˆtre, avec Guy$",
-	"C'est un homme de caractŠre . Il faut savoir le prendre ..$",
-	"Les affaires sont les affaires . Quant … la famille, je la laisse pour ce qu'elle est ...$",
-	"Relations ? Relations amicales ? Relations financiŠres sans doute$",
-	"Moi je n'ai rien … lui reprocher$",
-	"C'est un homme d'affaire d‚brouillard . Il nage parfois … contre-courant mais ... il s'en sortira toujours$",
-	"Ils m'ennuient tous .. Non ! Ce n'est mˆme pas ‡a .. Quoique .. certains ..$",
-	"A l'inverse de sa mŠre, c'est une personne trŠs renferm‚e ! Alors question relations ..$",
-	"Il doit sans doute faire beaucoup d'effort pour rester agr‚able malgr‚ tous ses ennuis$",
-	"Ses relations amoureuses : C'est termin‚ . Ses relations avec moi : Pas vraiment commenc‚es . Quant aux autres : Je ne suis pas les \"autres\"$",
+	"Il en ferait plus si il s'occupait moins des rag\223ts et de la bouteille$",
+	"Je suis tr\212s ind\202pendant . Tant qu'on ne s'occupe pas de mes affaires : Pas de probl\212me$",
+	"C'est un \202go\213ste . Je me demande si il aime autre chose que ses chevaux et ses grimoires$",
+	"Je crois qu'il s'entend bien avec tout le monde, mis \205 part, peut \210tre, avec Guy$",
+	"C'est un homme de caract\212re . Il faut savoir le prendre ..$",
+	"Les affaires sont les affaires . Quant \205 la famille, je la laisse pour ce qu'elle est ...$",
+	"Relations ? Relations amicales ? Relations financi\212res sans doute$",
+	"Moi je n'ai rien \205 lui reprocher$",
+	"C'est un homme d'affaire d\202brouillard . Il nage parfois \205 contre-courant mais ... il s'en sortira toujours$",
+	"Ils m'ennuient tous .. Non ! Ce n'est m\210me pas \207a .. Quoique .. certains ..$",
+	"A l'inverse de sa m\212re, c'est une personne tr\212s renferm\202e ! Alors question relations ..$",
+	"Il doit sans doute faire beaucoup d'effort pour rester agr\202able malgr\202 tous ses ennuis$",
+	"Ses relations amoureuses : C'est termin\202 . Ses relations avec moi : Pas vraiment commenc\202es . Quant aux autres : Je ne suis pas les \"autres\"$",
 	"J'aime bien tout le monde, tant qu'on ne m'escroque pas$",
-	"Il ne suffit pas d'avoir un peu d'argent et d'ˆtre beau parleur pour plaire … tout le monde$",
-	"Sans histoire .. C'est quelqu'un d'agr‚able et g‚n‚reux . De plus, il ne manque pas d'humour$",
-	"Actuellement je m'entends plut“t bien avec tout le monde . Mais, ici, je ne vais pas m'‚tendre sur le sujet$",
-	"Beau plumage, mais ‡a ne vole pas haut ... Parlez en … son mari$",
+	"Il ne suffit pas d'avoir un peu d'argent et d'\210tre beau parleur pour plaire \205 tout le monde$",
+	"Sans histoire .. C'est quelqu'un d'agr\202able et g\202n\202reux . De plus, il ne manque pas d'humour$",
+	"Actuellement je m'entends plut\223t bien avec tout le monde . Mais, ici, je ne vais pas m'\202tendre sur le sujet$",
+	"Beau plumage, mais \207a ne vole pas haut ... Parlez en \205 son mari$",
 	"C'est pour un rendez-vous ?$",
-	"Elle est trŠs vivante ! Elle ne s'embarrasse pas de pr‚jug‚s stupides$",
-	"Dans mon m‚tier, on c“toit surtout des belles femmes et des truands$",
-	"La seule valeur s–re chez lui, c'est ses bijoux .. Et sa femme, mais ‡a il ne s'en rend pas compte$",
-	"C'est quelqu'un d'interessant . De pas toujours facile … comprendre, mais qui m‚rite le d‚tour$",
-	"Je ne d‚teste personne, mais j'aime les choses et les gens quand ils sont … leur place$",
-	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite … l'‚troit !$",
-	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont‚$",
-	"Vous savez dans mon m‚tier on entend tout mais on ne retient rien, et le service est bien fait$",
+	"Elle est tr\212s vivante ! Elle ne s'embarrasse pas de pr\202jug\202s stupides$",
+	"Dans mon m\202tier, on c\223toit surtout des belles femmes et des truands$",
+	"La seule valeur s\226re chez lui, c'est ses bijoux .. Et sa femme, mais \207a il ne s'en rend pas compte$",
+	"C'est quelqu'un d'interessant . De pas toujours facile \205 comprendre, mais qui m\202rite le d\202tour$",
+	"Je ne d\202teste personne, mais j'aime les choses et les gens quand ils sont \205 leur place$",
+	"C'est entre nous . Mais voyez : quand je parle avec elle, je me sens vite \205 l'\202troit !$",
+	"Pour ne pas s'entendre avec elle, faut y mettre de la mauvaise volont\202$",
+	"Vous savez dans mon m\202tier on entend tout mais on ne retient rien, et le service est bien fait$",
 	"C'est un hypocrite, un larbin ! Personnellement je ne lui fais pas confiance$",
-	"Je ne connait pas le fond de sa pens‚e mais c'est quelqu'un de toujours trŠs correct et impeccable$",
-	"C'‚tait une personne qui a v‚cu au manoir, il y a un an .. peut ˆtre plus$",
-	"C'‚tait plus qu'une amie pour ma mŠre . En ces moments, j'aurais aim‚ qu'elle soit … mes cot‚s$",
-	"Murielle a ‚t‚ la dame de compagnie de Julia$",
+	"Je ne connait pas le fond de sa pens\202e mais c'est quelqu'un de toujours tr\212s correct et impeccable$",
+	"C'\202tait une personne qui a v\202cu au manoir, il y a un an .. peut \210tre plus$",
+	"C'\202tait plus qu'une amie pour ma m\212re . En ces moments, j'aurais aim\202 qu'elle soit \205 mes cot\202s$",
+	"Murielle a \202t\202 la dame de compagnie de Julia$",
 	"Elle aussi, faisait des recherches ...$",
-	"C'‚tait une femme trŠs cultiv‚e . Son brusque d‚part, il y a un an, m'a surpris et beaucoup chagrin‚$",
-	"Elle partageait avec L‚o sa passion de l'histoire et de la r‚gion$",
+	"C'\202tait une femme tr\212s cultiv\202e . Son brusque d\202part, il y a un an, m'a surpris et beaucoup chagrin\202$",
+	"Elle partageait avec L\202o sa passion de l'histoire et de la r\202gion$",
 	"Je crois que tout le monde l'aimait bien$",
-	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-mŠre, belle-fille ..$",
-	"A part L‚o, elle avait de trŠs bon rapport avec Max ...$",
-	"Bien que vos relations furent peu soutenues, J‚r“me, elle vous portait toujours dans son coeur ...$",
+	"Elle s'entendait bien avec tout le monde . Elle aimait beaucoup son fils . Quant aux relations belle-m\212re, belle-fille ..$",
+	"A part L\202o, elle avait de tr\212s bon rapport avec Max ...$",
+	"Bien que vos relations furent peu soutenues, J\202r\223me, elle vous portait toujours dans son coeur ...$",
 	"A part sa famille, pas grand monde$",
-	"Ah oui ! Je crois qu'elle a beaucoup regrett‚ le d‚part de cette amie .. euh ! Marielle .. ou Mireille ...$",
+	"Ah oui ! Je crois qu'elle a beaucoup regrett\202 le d\202part de cette amie .. euh ! Marielle .. ou Mireille ...$",
 	"Non rien !$",
 	"Non ... Pas que le sache$",
-	"J'ai connu Julia en achetant le manoir . C'‚tait son seul bien . Mais toute ma fortune ‚tait la sienne ...$",
-	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien … elle$",
-	"Je crois que toute sa fortune venait de L‚o . Alors, Pfuuut !$",
-	"A part la lettre pour vous que j'ai post‚, rien de bien important !$",
-	"J'ai ‚t‚ trŠs heureuse qu'elle m'offre sa bible reli‚e$",
-	"Ca a ‚t‚ rapide et elle n'a pas eu le temps de prendre des dispositions particuliŠres$",
-	"Son dernier pr‚sent m'a surpris$",
+	"J'ai connu Julia en achetant le manoir . C'\202tait son seul bien . Mais toute ma fortune \202tait la sienne ...$",
+	"Si ce n'est quelques objets personnels, je crois qu'elle n'avait plus rien \205 elle$",
+	"Je crois que toute sa fortune venait de L\202o . Alors, Pfuuut !$",
+	"A part la lettre pour vous que j'ai post\202, rien de bien important !$",
+	"J'ai \202t\202 tr\212s heureuse qu'elle m'offre sa bible reli\202e$",
+	"Ca a \202t\202 rapide et elle n'a pas eu le temps de prendre des dispositions particuli\212res$",
+	"Son dernier pr\202sent m'a surpris$",
 	"Quel cadeau ?$",
 	"Un chandellier ...$",
-	"Oui, j'ai eu un cadeau . Ma femme a mˆme eu une bible$",
+	"Oui, j'ai eu un cadeau . Ma femme a m\210me eu une bible$",
 	"Et bien oui ! Comme tout le monde, je crois$",
 	"Un poignard$",
-	"Je n'ai jamais ‚t‚ fouiller dans le grenier !$",
+	"Je n'ai jamais \202t\202 fouiller dans le grenier !$",
 	"Vous avez un don de double-vue ou un passe-partout$",
 	"Le portrait d'une jeune fille : C'est Murielle ...$",
 	"Vous savez, je la connaissais assez peu$",
-	"Elle ‚tait trŠs charmante, mais c'‚tait surtout la dame de compagnie de Julia$",
-	"C'est la seule femme vraiment interessante que j'ai rencontr‚$",
-	"Elle avait de grandes connaissances historiques, et la consulter ‚tait trŠs enrichissant$",
-	"Je me suis toujours demand‚ ce que certains pouvaient lui trouver !$",
-	"Si la chambre est ferm‚e, demandez … L‚o$",
-	"J'ai ferm‚ sa chambre aprŠs sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
+	"Elle \202tait tr\212s charmante, mais c'\202tait surtout la dame de compagnie de Julia$",
+	"C'est la seule femme vraiment interessante que j'ai rencontr\202$",
+	"Elle avait de grandes connaissances historiques, et la consulter \202tait tr\212s enrichissant$",
+	"Je me suis toujours demand\202 ce que certains pouvaient lui trouver !$",
+	"Si la chambre est ferm\202e, demandez \205 L\202o$",
+	"J'ai ferm\202 sa chambre apr\212s sa mort et j'aimerais qu'il en soit ainsi encore un certain temps$",
 	"Vous savez ce que c'est : Des relations familiales$",
-	"Durant toutes ces ann‚es, je ne l'ai jamais servie … contre-coeur$",
+	"Durant toutes ces ann\202es, je ne l'ai jamais servie \205 contre-coeur$",
 	"Je l'aimais autant qu'elle m'aimais, je crois$",
-	"De quel droit avez-vous p‚n‚tr‚ dans la chambre de ma femme ?!!$",
+	"De quel droit avez-vous p\202n\202tr\202 dans la chambre de ma femme ?!!$",
 	"C'est sans doute la photo de Murielle avec le filleul de Julia$",
 	"Je ne me rappelle pas$",
-	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir‚e … l'envers$",
-	"Vous ˆtes bien curieux !... C'est sans valeur$",
-	"Grimoires, parchemins et manuscrits : C'est le domaine de L‚o$",
+	"C'est Murielle . C'est moi qui l'ai prise. et d'ailleurs elle est tir\202e \205 l'envers$",
+	"Vous \210tes bien curieux !... C'est sans valeur$",
+	"Grimoires, parchemins et manuscrits : C'est le domaine de L\202o$",
 	"Dommage que la devise soit manquante ...$",
-	"C'est trŠs beau ... Et trŠs vieux ...$",
-	"Tiens ! C'est un endroit que je n'ai jamais visit‚$",
-	"D'apr‚s L‚o, il semblerait que les Lunes soient plus r‚centes$",
-	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
-	"Profond et inqui‚tant : Le progrŠs a du bon$",
-	"Ca reste pour moi le plus grand des mystŠres$",
+	"C'est tr\212s beau ... Et tr\212s vieux ...$",
+	"Tiens ! C'est un endroit que je n'ai jamais visit\202$",
+	"D'apr\202s L\202o, il semblerait que les Lunes soient plus r\202centes$",
+	"M\210me par ce temps, vous avez d\202nich\202 un soleil ...$",
+	"Profond et inqui\202tant : Le progr\212s a du bon$",
+	"Ca reste pour moi le plus grand des myst\212res$",
 	"Les derniers temps elle parlait d'un voyage . Et puis ...$",
-	"Il y a un peu plus d'un an, un soir, elle a d‚cid‚ de partir ...$",
-	"De toutes fa‡ons elle n'‚tait pas faite pour vivre ici$",
+	"Il y a un peu plus d'un an, un soir, elle a d\202cid\202 de partir ...$",
+	"De toutes fa\207ons elle n'\202tait pas faite pour vivre ici$",
 	"Quoi ?! Quel corps ? Quel crypte ?$",
-	"Si il y en a, je ne les ai jamais trouv‚ ...$",
-	"Bien s–r ! ... Et des fant“mes aussi ...$",
-	"C'est la plus vielle de la r‚gion : Elle date du XI eme siŠcle$",
-	"Elle fut l‚gŠrement restaur‚e aprŠs la r‚volution$",
+	"Si il y en a, je ne les ai jamais trouv\202 ...$",
+	"Bien s\226r ! ... Et des fant\223mes aussi ...$",
+	"C'est la plus vielle de la r\202gion : Elle date du XI eme si\212cle$",
+	"Elle fut l\202g\212rement restaur\202e apr\212s la r\202volution$",
 	"Julia aimait beaucoup la peinture$",
-	"Ils ont diff‚rents styles, mais n'ont pas tous une trŠs grande valeur$",
-	"Que faites-vous l… ?$",
-	"Je suis s–r que vous cherchez quelque chose ici$",
-	"Je vous ‚coute$",
-	"Que d‚sirez-vous ?$",
+	"Ils ont diff\202rents styles, mais n'ont pas tous une tr\212s grande valeur$",
+	"Que faites-vous l\205 ?$",
+	"Je suis s\226r que vous cherchez quelque chose ici$",
+	"Je vous \202coute$",
+	"Que d\202sirez-vous ?$",
 	"Oui ?$",
-	"Je suis … vous ...$",
+	"Je suis \205 vous ...$",
 	"C'est pourquoi ?$",
 	"Allez-y$",
-	"C'est … quel sujet ?$",
-	"Max : … votre service, monsieur$",
-	"De toutes fa‡ons vous n'avez rien … faire ici ! Sortez !!$",
-	"Vous ˆtes trop curieux !$",
-	"J‚r“me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L‚o, son mari bien s–r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La tempŠte redouble, il vous faut rester . Les repas sont … 12h et 19h et il y a un recueillement … la chapelle tous les jours … 10h$",
-	"En vous voyant j'ai compris que vous decouvririez la v‚rit‚ ... Car je savais pourquoi vous veniez : J'avais retrouv‚ le brouillon de la lettre de Julia . Mais je suis trŠs joueur, alors ... Elle n'avait pas voulu que votre tƒche soit trop facile, pour me prot‚ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d‚couvert que le mur du silence est le nom que les ma‡ons ont donn‚ au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss‚ avant de mourir ‚taient autant de faux indices qui ne servaient qu'… faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d‚cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv‚ un jour dans mes affaires . Une nuit, nous nous sommes aventur‚s 
 dans le passage secret que nous avions d‚couvert . Murielle est morte par accident dans la piŠce de la vierge . J'ai r‚cup‚r‚ la bague rapidement, trouv‚ le tr‚sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'ˆtes pas de la police . Laissez moi seul !$",
-	"F‚vrier 1951 ... Profession : detective priv‚ . Le froid figeait Paris et mes affaires lorsque ...$",
-	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les piŠces d‚labr‚es du manoir de Mortevielle . Julia, une vieille femme a pr‚sent .$",
+	"C'est \205 quel sujet ?$",
+	"Max : \205 votre service, monsieur$",
+	"De toutes fa\207ons vous n'avez rien \205 faire ici ! Sortez !!$",
+	"Vous \210tes trop curieux !$",
+	"J\202r\223me ! Il y a longtemps ... Quelle tristesse, Julia est morte . Sa famille est ici : Guy, son fils . Eva, sa brue . L\202o, son mari bien s\226r . Son beau fils, Pat . Des cousins : Bob, Ida, Luc . La temp\212te redouble, il vous faut rester . Les repas sont \205 12h et 19h et il y a un recueillement \205 la chapelle tous les jours \205 10h$",
+	"En vous voyant j'ai compris que vous decouvririez la v\202rit\202 ... Car je savais pourquoi vous veniez : J'avais retrouv\202 le brouillon de la lettre de Julia . Mais je suis tr\212s joueur, alors ... Elle n'avait pas voulu que votre t\203che soit trop facile, pour me prot\202ger, sans doute, mais elle n'a pu mourir avec cette incertitude sur la conscience . Avez vous d\202couvert que le mur du silence est le nom que les ma\207ons ont donn\202 au mur qui porte ce blason, lors de la construction du manoir ? .. Et ces cadeaux que Julia a laiss\202 avant de mourir \202taient autant de faux indices qui ne servaient qu'\205 faire ressortir l'importance des parchemins ... Effectivement, il y a plus d'un an, je travailais avec Murielle au d\202cryptage de ces manuscrits que je venais de trouver . Ma femme a fait la relation entre notre travail et la disparition de Murielle mais elle n'a jamais eu de preuves . Si ce n'est cette bague qu'elle a retrouv\202 un jour dans mes affair
 es . Une nuit, nous nous sommes aventur\202s dans le passage secret que nous avions d\202couvert . Murielle est morte par accident dans la pi\212ce de la vierge . J'ai r\202cup\202r\202 la bague rapidement, trouv\202 le tr\202sor et me suis enfuis . Je ne pensais pas qu'elle vivait encore, et je n'ai rien dit car j'avais besoin d'argent . J'ai fait passer cette somme sur le compte des courses de chevaux ...Partez maintenant, puisque vous n'\210tes pas de la police . Laissez moi seul !$",
+	"F\202vrier 1951 ... Profession : detective priv\202 . Le froid figeait Paris et mes affaires lorsque ...$",
+	"Une lettre, un appel, des souvenirs d'une enfance encore proche . Que de jeux dans les pi\212ces d\202labr\202es du manoir de Mortevielle . Julia, une vieille femme a pr\202sent .$",
 	" au bureau$",
-	" … la cuisine$",
-	" … la cave$",
+	" \205 la cuisine$",
+	" \205 la cave$",
 	" dans le couloir$",
 	" dehors$",
-	" la salle … manger$",
+	" la salle \205 manger$",
 	" dans le manoir$",
 	" devant le manoir$",
-	" … la chapelle$",
+	" \205 la chapelle$",
 	" devant le puits$",
 	" au nord$",
-	" derriŠre le manoir$",
+	" derri\212re le manoir$",
 	" au sud$",
-	" … l'est$",
-	" … l'ouest$",
+	" \205 l'est$",
+	" \205 l'ouest$",
 	" vers le manoir$",
 	" plus loin$",
 	" dans l'eau$",
 	" hors du puits$",
 	" dans le puits$",
-	" choix sur ‚cran$",
+	" choix sur \202cran$",
 	" Dans la serie MYSTERE...$",
 	" LE MANOIR DE MORTEVIELLE$",
 	"$",
@@ -1095,9 +1095,9 @@ const char *gameDataFr[] = {
 	" A VOUS DE JOUER$",
 	" attacher$",
 	" attendre$",
-	" d‚foncer$",
+	" d\202foncer$",
 	" dormir$",
-	" ‚couter$",
+	" \202couter$",
 	" entrer$",
 	" fermer$",
 	" fouiller$",
@@ -1119,7 +1119,7 @@ const char *gameDataFr[] = {
 	" lire$",
 	" poser$",
 	" regarder$",
-	" L‚o$",
+	" L\202o$",
 	" Pat$",
 	" Guy$",
 	" Eva$",
@@ -1128,40 +1128,40 @@ const char *gameDataFr[] = {
 	" Ida$",
 	" Max$",
 	"Comment Julia est-elle morte ?$",
-	"Elle s'est suicid‚e$",
-	"Elle est morte assassin‚e$",
+	"Elle s'est suicid\202e$",
+	"Elle est morte assassin\202e$",
 	"Elle est morte accidentellement$",
 	"Elle est morte naturellement$",
-	"D'o— provenait l'argent qui a permis la restauration du manoir ?$",
+	"D'o\227 provenait l'argent qui a permis la restauration du manoir ?$",
 	"chantage$",
 	"travail$",
-	"h‚ritage$",
+	"h\202ritage$",
 	"courses$",
 	"rentes$",
 	"hold-up$",
-	"d‚couverte$",
-	"Quel est le hobby de L‚o ?$",
+	"d\202couverte$",
+	"Quel est le hobby de L\202o ?$",
 	"recherches historiques$",
 	"politique$",
 	"peinture$",
 	"drogue$",
 	"sciences occultes$",
 	"direction d'une secte$",
-	"Julia a laiss‚ une s‚rie d'indices . Ceux-ci sont repr‚sent‚s en un seul lieu . Lequel ?$",
+	"Julia a laiss\202 une s\202rie d'indices . Ceux-ci sont repr\202sent\202s en un seul lieu . Lequel ?$",
 	"Chapelle$",
-	"Ext‚rieur$",
+	"Ext\202rieur$",
 	"Cave$",
 	"Grenier$",
 	"Cuisine$",
-	"Salle … manger$",
+	"Salle \205 manger$",
 	"Chambre Julia$",
-	"Chambre L‚o$",
+	"Chambre L\202o$",
 	"Chambre Pat$",
 	"Chambre Bob$",
 	"Chambre Max$",
 	"Chambre Luc/Ida$",
 	"Chambre Guy/Eva$",
-	"L'indice principal qui vous a permis d'arriver … la porte du souterrain est :$",
+	"L'indice principal qui vous a permis d'arriver \205 la porte du souterrain est :$",
 	"Un poignard$",
 	"Une bague$",
 	"Un livre$",
@@ -1175,30 +1175,30 @@ const char *gameDataFr[] = {
 	"Trois$",
 	"Quatre$",
 	"Cinq$",
-	"Combien de personnes sont m‚l‚es … cette histoire - Julia y comprise, vous except‚ - ?$",
+	"Combien de personnes sont m\202l\202es \205 cette histoire - Julia y comprise, vous except\202 - ?$",
 	"Neuf$",
 	"Dix$",
 	"Onze$",
-	"Quel ‚tait le pr‚nom de la personne inconnue ?$",
+	"Quel \202tait le pr\202nom de la personne inconnue ?$",
 	"Mireille$",
-	"Fran‡oise$",
+	"Fran\207oise$",
 	"Maguy$",
 	"Emilie$",
 	"Murielle$",
 	"Sophie$",
-	"De qui Murielle ‚tait-elle la maŒtresse ?$",
+	"De qui Murielle \202tait-elle la ma\214tresse ?$",
 	"Bob$",
 	"Luc$",
 	"Guy$",
-	"L‚o$",
+	"L\202o$",
 	"Max$",
 	"Murielle partageait une occupation avec une autre personne . Qui ?$",
-	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous pr‚f‚rez|retourner enqu‚ter afin de mieux comprendre ...][ok]$",
-	"[1][ |Ins‚rez la disquette 1 dans le lecteur A][ok]$",
+	"[1][ |Seul le hazard vous a permis d'arriver ici . Vous pr\202f\202rez|retourner enqu\202ter afin de mieux comprendre ...][ok]$",
+	"[1][ |Ins\202rez la disquette 1 dans le lecteur A][ok]$",
 	"[1][ |! ERREUR DISQUETTE !|On arrete tout][ok]$",
-	"[1][ |Vous devriez avoir remarqu‚|00% des indices][ok]$",
-	"[1][ |Ins‚rez la disquette 2 dans le lecteur A][ok]$",
-	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'‚tat de vos connaissances][ok]$",
+	"[1][ |Vous devriez avoir remarqu\202|00% des indices][ok]$",
+	"[1][ |Ins\202rez la disquette 2 dans le lecteur A][ok]$",
+	"[1][ |Avant d'aller plus loin, vous faites|un point sur l'\202tat de vos connaissances][ok]$",
 	" MASTER .$",
 	"  rorL$",
 };
@@ -1234,7 +1234,7 @@ const char *gameDataDe[] =  {
 	"Die Wappen$",
 	"$",
 	"Max, der Diener, empfaengt Sie und wird Sie dann in Ihr Zimmer begleiten$",
-	"             Morteville  16/2/51@      Mein lieber Jer“me at Im Anschluss an mein Telegramm teile ich Ihnen die Gruende meiner Unruhe mit: vor 1 Jahr verschwand meine Gesellschafterin Murielle. Eventuell hat das Verschwinden etwas mit dem finanziel len Umschwung auf dem Landsitz zu tun, oder... Eine Stille, die schwer zu verstehen ist fuer mei-nen Sohn Guy. Da ich bis heute nichts bezueglich dieser Sache unternehmen konnte, zaehle ich auf Sie, um die Affaere zu regeln. Falls sich mein Gesundheitszustand nicht bessert, treffen Sie bitte die Entscheidungen, die Sie fuer richtig halten. @            In Freundschaft.  JULIA DEFRANCK$",
+	"             Morteville  16/2/51@      Mein lieber Jer\223me at Im Anschluss an mein Telegramm teile ich Ihnen die Gruende meiner Unruhe mit: vor 1 Jahr verschwand meine Gesellschafterin Murielle. Eventuell hat das Verschwinden etwas mit dem finanziel len Umschwung auf dem Landsitz zu tun, oder... Eine Stille, die schwer zu verstehen ist fuer mei-nen Sohn Guy. Da ich bis heute nichts bezueglich dieser Sache unternehmen konnte, zaehle ich auf Sie, um die Affaere zu regeln. Falls sich mein Gesundheitszustand nicht bessert, treffen Sie bitte die Entscheidungen, die Sie fuer richtig halten. @            In Freundschaft.  JULIA DEFRANCK$",
 	"Spaeter erzaehlt Ihnen Guy von Leo's Selbstmord nach einer verrueckten Wette beim Rennen!$",
 	"F3: WIEDERHOLUNG at F8: STOP$",
 	"Der Hausherr$",
@@ -1611,7 +1611,7 @@ const char *gameDataDe[] =  {
 	"Das ist sehr schoen und sehr alt.$",
 	"Das ist ein Ort, den ich nie gesehen habe.$",
 	"Leos Meinung nach schien es, als seien die Monde spaeter gemacht worden.$",
-	"Mˆme par ce temps, vous avez d‚nich‚ un soleil ...$",
+	"M\210me par ce temps, vous avez d\202nich\202 un soleil ...$",
 	"Tief und beunruhigend. Der Fortschritt hat gutes an sich.$",
 	"Der Rest bleibt fuer mich eines der groessten Raetsel.$",
 	"In letzter Zeit sprach sie oft von einer Reise und dann...$",
@@ -1762,14 +1762,14 @@ const char *gameDataDe[] =  {
 	"zwei$",
 	"drei$",
 	"vier$",
-	"fnf$",
+	"f\201nf$",
 	" Wieviele Personen sind in die Geschichte verwickelt ? (Julia eingeschlossen, ausgenommen Sie)$",
 	"neun$",
 	"zehn$",
 	"elf$",
 	" Wie war der Name der unbekannten Person ?$",
 	"Mireille$",
-	"Fran‡oise$",
+	"Fran\207oise$",
 	"Maguy$",
 	"Emilie$",
 	"Murielle$",


Commit: 84a13eab01db5a1d8f370d6b6847c5062b704c63
    https://github.com/scummvm/scummvm/commit/84a13eab01db5a1d8f370d6b6847c5062b704c63
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-07-13T14:44:07-07:00

Commit Message:
MORTEVIELLE: Fix typo in English text

Changed paths:
    devtools/create_mortdat/enginetext.h



diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index f785c4d..6095f09 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -29,7 +29,7 @@
 const char *engineDataEn[] =  {
 	"[2][ ][YES][NO]",
 	"Go to",
-	"Someone enters, looks surised, but says nothing",
+	"Someone enters, looks surprised, but says nothing",
 	"   Cool   ",
 	"Oppressive",
 	"  Tense   ",
@@ -136,7 +136,7 @@ const char *engineDataFr[] = {
 const char *engineDataDe[] =  {
 	"[2][ ][JA][NEIN]",
 	"Go to",
-	"Someone enters, looks surised, but says nothing",
+	"Someone enters, looks surprised, but says nothing",
 	"Cool",
 	"Schwer",
 	"Ungesund",


Commit: 5e5e8a9c57d334a690367e129eabb05f729334f9
    https://github.com/scummvm/scummvm/commit/5e5e8a9c57d334a690367e129eabb05f729334f9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-13T16:10:03-07:00

Commit Message:
MORTEVIELLE: Changed savegames to use the game target to generate filenames

Changed paths:
    engines/mortevielle/detection.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/saveload.cpp
    engines/mortevielle/saveload.h



diff --git a/engines/mortevielle/detection.cpp b/engines/mortevielle/detection.cpp
index 9fe0927..28cbc77 100644
--- a/engines/mortevielle/detection.cpp
+++ b/engines/mortevielle/detection.cpp
@@ -89,7 +89,8 @@ SaveStateList MortevielleMetaEngine::listSaves(const char *target) const {
 }
 
 SaveStateDescriptor MortevielleMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
-	return Mortevielle::SavegameManager::querySaveMetaInfos(slot);
+	Common::String filename = Mortevielle::MortevielleEngine::generateSaveFilename(target, slot);
+	return Mortevielle::SavegameManager::querySaveMetaInfos(filename);
 }
 
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 2734f8c..8ed6751 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -55,6 +55,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_text.setParent(this);
 	_soundManager.setParent(this);
 	_speechManager.setParent(this);
+	_savegameManager.setParent(this);
 
 	_lastGameFrame = 0;
 	_mouseClick = false;
@@ -147,6 +148,18 @@ Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &d
 }
 
 /**
+ * Support method that generates a savegame name
+ * @param slot		Slot number
+ */
+Common::String MortevielleEngine::generateSaveFilename(const Common::String &target, int slot) {
+	if (slot == 0)
+		// Initial game state loaded when the game starts
+		return "sav0.mor";
+
+	return Common::String::format("%s.%03d", target.c_str(), slot);
+}
+
+/**
  * Initialise the game state
  */
 Common::ErrorCode MortevielleEngine::initialise() {
@@ -335,7 +348,7 @@ Common::Error MortevielleEngine::run() {
 
 	// Either load the initial game state savegame, or the specified savegame number
 	adzon();
-	_savegameManager.loadSavegame(loadSlot);
+	_savegameManager.loadSavegame(generateSaveFilename(loadSlot));
 
 	// Run the main game loop
 	mainGame();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index dcb61a6..5255865 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -498,6 +498,8 @@ public:
 	virtual Common::Error run();
 	uint32 getGameFlags() const;
 	Common::Language getLanguage() const;
+	static Common::String generateSaveFilename(const Common::String &target, int slot);
+	Common::String generateSaveFilename(int slot) { return generateSaveFilename(_targetName, slot); }
 
 	int getChar();
 	bool keyPressed();
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 093f22e..382fd14 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -36,8 +36,8 @@ namespace Mortevielle {
 
 static const char SAVEGAME_ID[4] = { 'M', 'O', 'R', 'T' };
 
-Common::String SavegameManager::generateSaveName(int slotNumber) {
-	return Common::String::format("sav%d.mor", slotNumber);
+void SavegameManager::setParent(MortevielleEngine *vm) {
+	_vm = vm;
 }
 
 /**
@@ -71,14 +71,10 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
  * Inner code for loading a saved game
  * @remarks	Originally called 'takesav'
  */
-void SavegameManager::loadSavegame(int n) {
-	// -- Load the file
-	Common::String filename = generateSaveName(n);
-
+void SavegameManager::loadSavegame(const Common::String &filename) {
 	// Try loading first from the save area
 	Common::SeekableReadStream *stream = g_system->getSavefileManager()->openForLoading(filename);
 
-	// If not present, try loading from the program folder
 	Common::File f;
 	if (stream == NULL) {
 		if (!f.open(filename))
@@ -115,10 +111,10 @@ void SavegameManager::loadSavegame(int n) {
 /**
  * Load a saved game
  */
-Common::Error SavegameManager::loadGame(int n) {
+Common::Error SavegameManager::loadGame(const Common::String &filename) {
 	g_vm->_mouse.hideMouse();
 	g_vm->displayEmptyHand();
-	loadSavegame(n);
+	loadSavegame(filename);
 
 	/* Initialization */
 	g_vm->charToHour();
@@ -144,7 +140,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	if (g_vm->_saveStruct._currPlace == ROOM26)
 		g_vm->_saveStruct._currPlace = LANDING;
 
-	Common::String filename = generateSaveName(n);
+	Common::String filename = _vm->generateSaveFilename(n);
 	f = g_system->getSavefileManager()->openForSaving(filename);
 
 	// Write out the savegame header
@@ -168,6 +164,14 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
 	return Common::kNoError;
 }
 
+Common::Error SavegameManager::loadGame(int slot) {
+	return loadGame(_vm->generateSaveFilename(slot));
+}
+
+Common::Error SavegameManager::saveGame(int slot) {
+	return saveGame(slot, _vm->generateSaveFilename(slot));
+}
+
 void SavegameManager::writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
 	// Write out a savegame header
 	out->writeByte(SAVEGAME_VERSION);
@@ -226,8 +230,10 @@ bool SavegameManager::readSavegameHeader(Common::InSaveFile *in, SavegameHeader
 	return true;
 }
 
-SaveStateList SavegameManager::listSaves(const char *target) {
-	Common::String pattern = "sav*.mor";
+SaveStateList SavegameManager::listSaves(const Common::String &target) {
+	Common::String pattern = target;
+	pattern += ".???";
+
 	Common::StringArray files = g_system->getSavefileManager()->listSavefiles(pattern);
 	sort(files.begin(), files.end());	// Sort (hopefully ensuring we are sorted numerically..)
 
@@ -235,7 +241,7 @@ SaveStateList SavegameManager::listSaves(const char *target) {
 	for (Common::StringArray::const_iterator file = files.begin(); file != files.end(); ++file) {
 		// Obtain the last 3 digits of the filename, since they correspond to the save slot
 		const Common::String &fname = *file;
-		int slotNumber = atoi(fname.c_str() + 3);
+		int slotNumber = atoi(fname.c_str() + fname.size() - 3);
 
 		Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname);
 		if (in) {
@@ -274,11 +280,15 @@ SaveStateList SavegameManager::listSaves(const char *target) {
 	return saveList;
 }
 
-SaveStateDescriptor SavegameManager::querySaveMetaInfos(int slot) {
-	Common::String fileName = Mortevielle::SavegameManager::generateSaveName(slot);
+SaveStateDescriptor SavegameManager::querySaveMetaInfos(const Common::String &fileName) {
 	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName);
 
 	if (f) {
+		// Get the slot number
+		int slot = 1;
+		if (fileName.size() > 4 && fileName[fileName.size() - 4] == '.')
+			slot = atoi(fileName.c_str() + fileName.size() - 3);
+
 		// Check to see if it's a ScummVM savegame or not
 		char buffer[4];
 		f->read(buffer, 4);
@@ -289,7 +299,7 @@ SaveStateDescriptor SavegameManager::querySaveMetaInfos(int slot) {
 			// Original savegame perhaps?
 			delete f;
 
-			SaveStateDescriptor desc(slot, Common::String::format("Savegame #%d", slot));
+			SaveStateDescriptor desc(slot, Common::String::format("Savegame - %s", slot));
 			desc.setDeletableFlag(slot != 0);
 			desc.setWriteProtectedFlag(slot == 0);
 			return desc;
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index 140b039..6613b62 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -47,21 +47,26 @@ struct SavegameHeader {
 	int totalFrames;
 };
 
+class MortevielleEngine;
+
 class SavegameManager {
 private:
+	MortevielleEngine *_vm;
 	byte _tabdonSaveBuffer[391];
 
 	void sync_save(Common::Serializer &sz);
 public:
-	void loadSavegame(int n);
-	Common::Error loadGame(int n);
+	void setParent(MortevielleEngine *vm);
+	void loadSavegame(const Common::String &filename);
+	Common::Error loadGame(const Common::String &filename);
 	Common::Error saveGame(int n, const Common::String &saveName);
+	Common::Error loadGame(int slot);
+	Common::Error saveGame(int slot);	
 
 	void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
 	static bool readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header);
-	static Common::String generateSaveName(int slotNumber);
-	static SaveStateList listSaves(const char *target);
-	static SaveStateDescriptor querySaveMetaInfos(int slot);
+	static SaveStateList listSaves(const Common::String &target);
+	static SaveStateDescriptor querySaveMetaInfos(const Common::String &fileName);
 };
 
 } // End of namespace Mortevielle


Commit: 0a91aee2f724334bc128748121d50a525d151fb3
    https://github.com/scummvm/scummvm/commit/0a91aee2f724334bc128748121d50a525d151fb3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-13T18:50:23-07:00

Commit Message:
Merge pull request #2 from criezy/mortevielle

Mortevielle create_mortdat textual fixes

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/enginetext.h
    devtools/create_mortdat/gametext.h





Commit: 44e62709bb5e608f19ba042e7ce7286d988ffddd
    https://github.com/scummvm/scummvm/commit/44e62709bb5e608f19ba042e7ce7286d988ffddd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-18T06:27:55-07:00

Commit Message:
DEVTOOLS: Moved implementation of create_mortdat File class from the header file

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp
    devtools/create_mortdat/create_mortdat.h



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index 2dff398..cb7d6aa 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -42,6 +42,68 @@
 #include "enginetext.h"
 #include "gametext.h"
 
+
+bool File::open(const char *filename, AccessMode mode) {
+	f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
+	return (f != NULL);
+}
+
+void File::close() {
+	fclose(f);
+	f = NULL;
+}
+
+int File::seek(int32 offset, int whence) {
+	return fseek(f, offset, whence);
+}
+
+long File::read(void *buffer, int len) {
+	return fread(buffer, 1, len, f);
+}
+void File::write(const void *buffer, int len) {
+	fwrite(buffer, 1, len, f);
+}
+
+byte File::readByte() {
+	byte v;
+	read(&v, sizeof(byte));
+	return v;
+}
+
+uint16 File::readWord() {
+	uint16 v;
+	read(&v, sizeof(uint16));
+	return FROM_LE_16(v);
+}
+
+uint32 File::readLong() {
+	uint32 v;
+	read(&v, sizeof(uint32));
+	return FROM_LE_32(v);
+}
+
+void File::writeByte(byte v) {
+	write(&v, sizeof(byte));
+}
+
+void File::writeWord(uint16 v) {
+	uint16 vTemp = TO_LE_16(v);
+	write(&vTemp, sizeof(uint16));
+}
+
+void File::writeLong(uint32 v) {
+	uint32 vTemp = TO_LE_32(v);
+	write(&vTemp, sizeof(uint32));
+}
+
+void File::writeString(const char *s) {
+	write(s, strlen(s) + 1);
+}
+
+uint32 File::pos() {
+	return ftell(f);
+}
+
 /*-------------------------------------------------------------------------*/
 
 void openOutputFile(const char *outFilename) {
diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h
index 908cb61..8c210d3 100644
--- a/devtools/create_mortdat/create_mortdat.h
+++ b/devtools/create_mortdat/create_mortdat.h
@@ -43,55 +43,20 @@ class File {
 private:
 	FILE *f;
 public:
-	bool open(const char *filename, AccessMode mode = kFileReadMode) {
-		f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb");
-		return (f != NULL);
-	}
-	void close() {
-		fclose(f);
-		f = NULL;
-	}
-	int seek(int32 offset, int whence = SEEK_SET) {
-		return fseek(f, offset, whence);
-	}
-	long read(void *buffer, int len) {
-		return fread(buffer, 1, len, f);
-	}
-	void write(const void *buffer, int len) {
-		fwrite(buffer, 1, len, f);
-	}
-	byte readByte() {
-		byte v;
-		read(&v, sizeof(byte));
-		return v;
-	}
-	uint16 readWord() {
-		uint16 v;
-		read(&v, sizeof(uint16));
-		return FROM_LE_16(v);
-	}
-	uint32 readLong() {
-		uint32 v;
-		read(&v, sizeof(uint32));
-		return FROM_LE_32(v);
-	}
-	void writeByte(byte v) {
-		write(&v, sizeof(byte));
-	}
-	void writeWord(uint16 v) {
-		uint16 vTemp = TO_LE_16(v);
-		write(&vTemp, sizeof(uint16));
-	}
-	void writeLong(uint32 v) {
-		uint32 vTemp = TO_LE_32(v);
-		write(&vTemp, sizeof(uint32));
-	}
-	void writeString(const char *s) {
-		write(s, strlen(s) + 1);
-	}
-	uint32 pos() {
-		return ftell(f);
-	}
+	bool open(const char *filename, AccessMode mode = kFileReadMode);
+	void close();
+	int seek(int32 offset, int whence = SEEK_SET);
+	uint32 pos();
+	long read(void *buffer, int len);
+	void write(const void *buffer, int len);
+
+	byte readByte();
+	uint16 readWord();
+	uint32 readLong();
+	void writeByte(byte v);
+	void writeWord(uint16 v);
+	void writeLong(uint32 v);
+	void writeString(const char *s);
 };
 
 File outputFile, mortCom;


Commit: 552b04f4fd5132f7f1e6aa1e66453194ad94595f
    https://github.com/scummvm/scummvm/commit/552b04f4fd5132f7f1e6aa1e66453194ad94595f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-18T11:29:18-07:00

Commit Message:
MORTEVIELLE: Improve German engine texts

Changed paths:
    devtools/create_mortdat/enginetext.h



diff --git a/devtools/create_mortdat/enginetext.h b/devtools/create_mortdat/enginetext.h
index 6095f09..e1c40f8 100644
--- a/devtools/create_mortdat/enginetext.h
+++ b/devtools/create_mortdat/enginetext.h
@@ -135,52 +135,52 @@ const char *engineDataFr[] = {
 
 const char *engineDataDe[] =  {
 	"[2][ ][JA][NEIN]",
-	"Go to",
-	"Someone enters, looks surprised, but says nothing",
+	"gehen",
+	"Jemand kommt herein, scheint erstaunt, sagt nichts",
 	"Cool",
 	"Schwer",
 	"Ungesund",
 	"Idem",
-	"You",
-	"are",
-	"Alone",
+	"Sie",
+	"sind",
+	"allein",
 
 	"Verdammt! Sie hoeren ein Geraeush...",
 	"Sie haetten ",
 	"% der Hinweise|      bemerken muessen...",
-	"Do you want to wake up?",
+	"Moechten Sie aufwachen?",
 	"OK",
 	"", 
 	" schreiben",
 
 	" lesen",
-	" Restart     ",
-	"F3 nochmals",
+	" wieder      ",
+	"F3: nochmals",
 	"F8: stop",
-	"Hide self",
-	"take",
-	" probe    ",
-	" raise    ",
+	" sich verstecken",
+	" nehmen",
+	" sondieren",
+	" hochheben",
 	" -WEITER- ",
 	" -STOP-  ",
 	"[1][ Benutzen Sie jetzt das Menue DEP...][OK]",
-	"lift",
-	"read",
-
-	"look",
-	"search",
-	"open",
-	"put",
-	"turn",
-	"tie",
-	"close",
-	"hit",
-	"pose",
-	"smash",
-
-	"smell",
-	"scratch",
-	"probe",
+	"hochheben",
+	"lesen",
+
+	"anschauen",
+	"durchsuchen",
+	"oeffnen",
+	"setzen",
+	"drehen",
+	"befestigen",
+	"schliessen",
+	"klopfen",
+	"hinlegen",
+	"eindruecken",
+
+	"fuehlen",
+	"abkratzen",
+	"sondieren",
 	"[1][ Benutzen Sie jetzt das Menue DEP...][OK]",
 	"& tag",
 	NULL


Commit: da57665c018d00db1e37286038227ec24583483a
    https://github.com/scummvm/scummvm/commit/da57665c018d00db1e37286038227ec24583483a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-18T11:29:19-07:00

Commit Message:
MORTEVIELLE: Some renaming in intro functions

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/dialogs.h
    engines/mortevielle/mortevielle.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 69cb81b..1e82863 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -423,7 +423,7 @@ void DialogManager::drawF3F8() {
  * Graphical Device if modified
  * @remarks	Originally called 'diver'
  */
-void DialogManager::checkForF8(int SpeechNum, bool drawAni50Fl) {
+void DialogManager::checkForF8(int SpeechNum, bool drawFrame2Fl) {
 	_vm->testKeyboard();
 	do {
 		_vm->_speechManager.startSpeech(SpeechNum, 0, 0);
@@ -434,7 +434,7 @@ void DialogManager::checkForF8(int SpeechNum, bool drawAni50Fl) {
 		if (_vm->_newGraphicalDevice != _vm->_currGraphicalDevice) {
 			_vm->_currGraphicalDevice = _vm->_newGraphicalDevice;
 			_vm->hirs();
-			aff50(drawAni50Fl);
+			displayIntroScreen(drawFrame2Fl);
 		}
 	} while (_vm->_key != 66); // keycode for F8
 }
@@ -455,13 +455,17 @@ int DialogManager::waitForF3F8() {
 	return key;
 }
 
-void DialogManager::aff50(bool drawAni50Fl) {
+/**
+ * Intro function - display intro screen
+ * @remarks	Originally called 'aff50'
+ */
+void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
 	_vm->_caff = 50;
 	_vm->_maff = 0;
 	_vm->_text.taffich();
 	_vm->draw(kAdrDes, 63, 12);
-	if (drawAni50Fl)
-		ani50();
+	if (drawFrame2Fl)
+		displayIntroFrame2();
 	else
 		_vm->handleDescriptionText(2, kDialogStringIndex + 142);
 
@@ -469,7 +473,11 @@ void DialogManager::aff50(bool drawAni50Fl) {
 	drawF3F8();
 }
 
-void DialogManager::ani50() {
+/**
+ * Intro function - display 2nd frame of intro
+ * @remarks	Originally called 'ani50'
+ */
+void DialogManager::displayIntroFrame2() {
 	_vm->_crep = _vm->animof(1, 1);
 	_vm->pictout(kAdrAni, _vm->_crep, 63, 12);
 	_vm->_crep = _vm->animof(2, 1);
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 35c3c34..af667e4 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -54,10 +54,10 @@ public:
 	void setParent(MortevielleEngine *vm);
 	int show(const Common::String &msg, int n);
 	void drawF3F8();
-	void checkForF8(int SpeechNum, bool drawAni50Fl);
+	void checkForF8(int SpeechNum, bool drawFrame2Fl);
 	int waitForF3F8();
-	void aff50(bool drawAni50Fl);
-	void ani50();
+	void displayIntroScreen(bool drawFrame2Fl);
+	void displayIntroFrame2();
 	bool showKnowledgeCheck();
 };
 
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8ed6751..3505205 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -365,13 +365,13 @@ Common::Error MortevielleEngine::run() {
  * Show the game introduction
  */
 void MortevielleEngine::showIntroduction() {
-	_dialogManager.aff50(false);
+	_dialogManager.displayIntroScreen(false);
 	_speechManager._mlec = 0;
 	_dialogManager.checkForF8(142, false);
 	if (shouldQuit())
 		return;
 
-	_dialogManager.ani50();
+	_dialogManager.displayIntroFrame2();
 	_dialogManager.checkForF8(143, true);
 	if (shouldQuit())
 		return;


Commit: 3b4f4f41b4fc3b7eb5d00a5b4e2b302a23fe4415
    https://github.com/scummvm/scummvm/commit/3b4f4f41b4fc3b7eb5d00a5b4e2b302a23fe4415
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-18T11:29:20-07:00

Commit Message:
MORTEVIELLE: Enlarge F3/F8 dialog

Changed paths:
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 1e82863..d2f9274 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -415,7 +415,7 @@ void DialogManager::drawF3F8() {
 	int f8Width = _vm->_screenSurface.getStringWidth(f8);
 
 	// Write out the bounding box
-	_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 16, 7);
+	_vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 18, 7);
 }
 
 /**


Commit: 3004c27e8a9da54ea7d8ee76066a40ddb98e392c
    https://github.com/scummvm/scummvm/commit/3004c27e8a9da54ea7d8ee76066a40ddb98e392c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-18T11:29:21-07:00

Commit Message:
MORTEVIELLE: Enlarge box around screens in order to avoid to display a line of the picture below the border

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 78a4db8..cc75f2a 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -388,7 +388,7 @@ void MortevielleEngine::setTextColor(int col) {
  */
 void MortevielleEngine::prepareScreenType1() {
 	// Large drawing
-	_screenSurface.drawBox(0, 11, 512, 163, 15);
+	_screenSurface.drawBox(0, 11, 512, 164, 15);
 }
 
 /**


Commit: 2105acfb97e2e1ad4b4f86298fa69a7b748034b7
    https://github.com/scummvm/scummvm/commit/2105acfb97e2e1ad4b4f86298fa69a7b748034b7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-18T11:29:22-07:00

Commit Message:
MORTEVIELLE: Modify some more boxes

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index cc75f2a..6469939 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1698,11 +1698,11 @@ void MortevielleEngine::clearDescriptionBar() {
 	_mouse.hideMouse();
 	if (_largestClearScreen) {
 		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
-		_screenSurface.drawBox(0, 175, 634, 24, 15);
+		_screenSurface.drawBox(0, 176, 634, 23, 15);
 		_largestClearScreen = false;
 	} else {
 		_screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
-		_screenSurface.drawBox(0, 175, 634, 15, 15);
+		_screenSurface.drawBox(0, 176, 634, 14, 15);
 	}
 	_mouse.showMouse();
 }
@@ -2986,7 +2986,7 @@ void MortevielleEngine::drawPicture() {
 		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 	} else if (_caff > 69) {
 		draw(kAdrDes, 112, 48);           // Heads
-		_screenSurface.drawBox(222, 47, 155, 91, 15);
+		_screenSurface.drawBox(222, 47, 155, 92, 15);
 	} else {
 		draw(kAdrDes, 0, 12);
 		prepareScreenType1();


Commit: 541697fe8d6dee1e90361f0471dd7a8f6a8cc4c4
    https://github.com/scummvm/scummvm/commit/541697fe8d6dee1e90361f0471dd7a8f6a8cc4c4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T01:41:09-07:00

Commit Message:
MORTEVIELLE: Constify an array in actions, reduce the scope of some variables

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 38cbb30..c3b82b7 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -386,8 +386,6 @@ void MortevielleEngine::fctSelfRead() {
  * @remarks	Originally called 'tregarder'
  */
 void MortevielleEngine::fctLook() {
-	int cx;
-
 	if (_caff > 99) {
 		_crep = 103;
 		return;
@@ -433,7 +431,7 @@ void MortevielleEngine::fctLook() {
 		}
 		return;
 	}
-	cx = _coreVar._currPlace;
+	int cx = _coreVar._currPlace;
 	if (_coreVar._currPlace == CHAPEL)
 		cx = 17;
 	if ((_coreVar._currPlace > MANOR_FRONT) && (_coreVar._currPlace < DOOR))
@@ -475,7 +473,7 @@ void MortevielleEngine::fctSelftLook() {
  * @remarks	Originally called 'tfouiller'
  */
 void MortevielleEngine::fctSearch() {
-	const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
+	static const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
 	if (_caff > 99) {
 		getSearchDescription(_caff);
@@ -1188,7 +1186,7 @@ void MortevielleEngine::fctEnter() {
  * @remarks	Originally called 'tdormir'
  */
 void MortevielleEngine::fctSleep() {
-	int z, j, h, m;
+	int j, h, m;
 
 	if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
 		_crep = 148;
@@ -1212,7 +1210,7 @@ void MortevielleEngine::fctSleep() {
 	do {
 		if (h < 8) {
 			_coreVar._faithScore -= (_coreVar._faithScore / 20);
-			z = (7 - h) * 2;
+			int z = (7 - h) * 2;
 			if (m == 30)
 				--z;
 			_currentHourCount += z;
@@ -1343,7 +1341,6 @@ void MortevielleEngine::fctDiscuss() {
 	bool questionAsked[47];
 	int cy, cx;
 	int x, y;
-//	int c;
 	Common::String lib[47];
 
 	int choice; 


Commit: 7b044ea75b95bcaab1bbc1106689bbb472ab209f
    https://github.com/scummvm/scummvm/commit/7b044ea75b95bcaab1bbc1106689bbb472ab209f
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T01:59:20-07:00

Commit Message:
MORTEVIELLE: Replace some British words by US ones

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index ff60145..d47b6b5 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -40,7 +40,7 @@ namespace Mortevielle {
  *-------------------------------------------------------------------------*/
 
 /**
- * Set palette entries from the 64 colour available EGA palette
+ * Set palette entries from the 64 color available EGA palette
  */
 void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
 	assert((idx + size) <= 16);
@@ -55,7 +55,7 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
 		*p++ = (i      & 1) * 0xaa + (i >> 3 & 1) * 0x55;
 	}
 
-	// Loop through setting palette colours based on the passed indexes
+	// Loop through setting palette colors based on the passed indexes
 	for (; size > 0; --size, ++idx) {
 		int palIndex = palette[idx];
 		assert(palIndex < 64);
@@ -416,7 +416,7 @@ void GfxSurface::decode(const byte *pSrc) {
 			entryIndex + 1, _xp, _yp, _width, _height, decomIndex);
 	}
 
-	// At this point, the outputBuffer has the data for the image. Initialise the surface
+	// At this point, the outputBuffer has the data for the image. Initialize the surface
 	// with the calculated size, and copy the lines to the surface
 	create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
 
@@ -1033,16 +1033,16 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) {
 }
 
 /**
- * Fills an area with the specified colour
+ * Fills an area with the specified color
  * @remarks		Because the ScummVM surface is using a double height 640x400 surface to
  *		simulate the original 640x400 surface, all Y values have to be doubled
  */
-void ScreenSurface::fillRect(int colour, const Common::Rect &bounds) {
+void ScreenSurface::fillRect(int color, const Common::Rect &bounds) {
 	Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2,
 		bounds.right, bounds.bottom * 2));
 
 	// Fill the area
-	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), colour);
+	destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), color);
 }
 
 /**
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 3a54f0c..6548146 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -100,7 +100,7 @@ public:
 	void copyFrom(Graphics::Surface &src, int x, int y);
 	void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex);
 	void drawBox(int x, int y, int dx, int dy, int col);
-	void fillRect(int colour, const Common::Rect &bounds);
+	void fillRect(int color, const Common::Rect &bounds);
 	void clearScreen();
 	void putxy(int x, int y) { _textPos = Common::Point(x, y); }
 	void drawString(const Common::String &l, int command);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3505205..7829fab 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -160,10 +160,10 @@ Common::String MortevielleEngine::generateSaveFilename(const Common::String &tar
 }
 
 /**
- * Initialise the game state
+ * Initialize the game state
  */
-Common::ErrorCode MortevielleEngine::initialise() {
-	// Initialise graphics mode
+Common::ErrorCode MortevielleEngine::initialize() {
+	// Initialize graphics mode
 	initGraphics(SCREEN_WIDTH, SCREEN_HEIGHT, true);
 
 	// Set debug channels
@@ -329,8 +329,8 @@ void MortevielleEngine::readStaticStrings(Common::File &f, int dataSize, DataTyp
 /*-------------------------------------------------------------------------*/
 
 Common::Error MortevielleEngine::run() {
-	// Initialise the game
-	Common::ErrorCode err = initialise();
+	// Initialize the game
+	Common::ErrorCode err = initialize();
 	if (err != Common::kNoError)
 		return err;
 
@@ -353,7 +353,7 @@ Common::Error MortevielleEngine::run() {
 	// Run the main game loop
 	mainGame();
 	
-	// Cleanup (allocated in initialise())
+	// Cleanup (allocated in initialize())
 	_screenSurface.free();
 	free(_speechManager._cfiphBuffer);
 	free(_cfiecBuffer);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 5255865..18cf274 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -284,7 +284,7 @@ private:
 	uint16 _dialogIndexArray[kMaxDialogIndex + 1];
 	Hint   _dialogHintArray[kMaxDialogHint + 1];
 
-	Common::ErrorCode initialise();
+	Common::ErrorCode initialize();
 	Common::ErrorCode loadMortDat();
 	void readStaticStrings(Common::File &f, int dataSize, DataType dataType);
 	void loadFont(Common::File &f);


Commit: 0bc631aa93ef1d962febd680b507757ccf98359b
    https://github.com/scummvm/scummvm/commit/0bc631aa93ef1d962febd680b507757ccf98359b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T02:21:05-07:00

Commit Message:
MORTEVIELLE: Constify an array in graphics, reduce the scope of some variables

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index d47b6b5..c6356f4 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -69,7 +69,7 @@ void PaletteManager::setPalette(const int *palette, uint idx, uint size) {
  * Set the default EGA palette
  */
 void PaletteManager::setDefaultPalette() {
-	int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63 };
+	const int defaultPalette[16] = { 0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63 };
 	setPalette(defaultPalette, 0, 16);
 }
 
@@ -1072,21 +1072,20 @@ void ScreenSurface::setPixel(const Common::Point &pt, int palIndex) {
  * @remarks	Originally called 'writeg'
  */
 void ScreenSurface::drawString(const Common::String &l, int command) {
-	int i, x;
-	Common::Point pt;
-	int cecr = 0;
-
 	if (l == "")
 		return;
 
 	_vm->_mouse.hideMouse();
-	pt = _textPos;
+	Common::Point pt = _textPos;
 
+	int i;
 	if (_vm->_resolutionScaler == 2)
 		i = 6;
 	else
 		i = 10;
-	x = pt.x + i * l.size();
+
+	int x = pt.x + i * l.size();
+	int cecr = 0;
 
 	switch (command) {
 	case 1:


Commit: be03a9c92b3d11faee77ddf742e8228b50efb9c0
    https://github.com/scummvm/scummvm/commit/be03a9c92b3d11faee77ddf742e8228b50efb9c0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T02:24:42-07:00

Commit Message:
MORTEVIELLE: Fix formatting glitch

Changed paths:
    engines/mortevielle/graphics.h



diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index 6548146..fe8b365 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -48,7 +48,7 @@ public:
 #define FONT_HEIGHT 6
 #define FONT_NUM_CHARS 121
 
-class GfxSurface: public Graphics::Surface {
+class GfxSurface : public Graphics::Surface {
 private:
 	int _xp, _yp;
 	int _xSize, _ySize;


Commit: e4a9b71b8ff6fd692457e5713f61bc906f7b7b78
    https://github.com/scummvm/scummvm/commit/e4a9b71b8ff6fd692457e5713f61bc906f7b7b78
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T02:31:19-07:00

Commit Message:
MORTEVIELLE: Use width and height provided by Graphics::Surface

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



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index c6356f4..0ac43a6 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -86,7 +86,7 @@ void PaletteManager::setDefaultPalette() {
 #define BUFFER_SIZE 40000
 
 void GfxSurface::decode(const byte *pSrc) {
-	_width = _height = 0;
+	w = h = 0;
 	// If no transparency, use invalid (for EGA) palette index of 16. Otherwise get index to use
 	_transparency = (*pSrc == 0) ? 16 : *(pSrc + 2);
 	bool offsetFlag = *pSrc++ == 0;
@@ -413,27 +413,27 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		pSrc = pSrcStart;
 		debugC(2, kMortevielleGraphics, "Decoding image block %d position %d,%d size %d,%d method %d",
-			entryIndex + 1, _xp, _yp, _width, _height, decomIndex);
+			entryIndex + 1, _xp, _yp, w, h, decomIndex);
 	}
 
 	// At this point, the outputBuffer has the data for the image. Initialize the surface
 	// with the calculated size, and copy the lines to the surface
-	create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
+	create(w, h, Graphics::PixelFormat::createFormatCLUT8());
 
-	for (int yCtr = 0; yCtr < _height; ++yCtr) {
+	for (int yCtr = 0; yCtr < h; ++yCtr) {
 		const byte *copySrc = &outputBuffer[yCtr * DEFAULT_WIDTH];
 		byte *copyDest = (byte *)getBasePtr(0, yCtr);
 
-		Common::copy(copySrc, copySrc + _width, copyDest);
+		Common::copy(copySrc, copySrc + w, copyDest);
 	}
 }
 
 void GfxSurface::majTtxTty() {
 	if (!_yp)
-		_width += _xSize;
+		w += _xSize;
 
 	if (!_xp)
-		_height += _ySize;
+		h += _ySize;
 }
 
 /**
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index fe8b365..e31f5da 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -56,7 +56,6 @@ private:
 	bool _nibbleFlag;
 	int _thickness;
 	int _yInc, _yEnd, _xInc, _xEnd;
-	int _width, _height;
 
 	byte nextNibble(const byte *&pSrc);
 	byte nextByte(const byte *&pSrc, const byte *&pLookup);


Commit: c8b35de0a95fa4bd10da9ccf3b2e9a168130707c
    https://github.com/scummvm/scummvm/commit/c8b35de0a95fa4bd10da9ccf3b2e9a168130707c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T02:33:42-07:00

Commit Message:
MORTEVIELLE: Rename menu constant

Changed paths:
    engines/mortevielle/menu.cpp



diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 6035c3a..c856f0e 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -35,7 +35,7 @@
 
 namespace Mortevielle {
 
-const byte _menuConstants[8][4] = {
+const byte menuConstants[8][4] = {
 	{ 7, 37, 23,  8},
 	{19, 33, 23,  7},
 	{31, 89, 10, 21},
@@ -235,7 +235,7 @@ void Menu::invert(int indx) {
 
 	int menuIndex = lo(_msg4);
 
-	_vm->_screenSurface.putxy(_menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+	_vm->_screenSurface.putxy(menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 
 	Common::String str;
 	switch (_msg3) {
@@ -282,9 +282,9 @@ void Menu::invert(int indx) {
 
 void Menu::util(Common::Point pos) {
 
-	int ymx = (_menuConstants[_msg3 - 1][3] << 3) + 16;
-	int dxcar = _menuConstants[_msg3 - 1][2];
-	int xmn = (_menuConstants[_msg3 - 1][0] << 2) * _vm->_resolutionScaler;
+	int ymx = (menuConstants[_msg3 - 1][3] << 3) + 16;
+	int dxcar = menuConstants[_msg3 - 1][2];
+	int xmn = (menuConstants[_msg3 - 1][0] << 2) * _vm->_resolutionScaler;
 
 	int ix;
 	if (_vm->_resolutionScaler == 1)
@@ -316,22 +316,22 @@ void Menu::menuDown(int ii) {
 	_vm->_backgroundSurface.copyFrom(_vm->_screenSurface);
 
 	// Draw the menu
-	xco = _menuConstants[ii - 1][0];
-	lignNumb = _menuConstants[ii - 1][3];
+	xco = menuConstants[ii - 1][0];
+	lignNumb = menuConstants[ii - 1][3];
 	_vm->_mouse.hideMouse();
 	xco = xco << 3;
 	if (_vm->_resolutionScaler == 1)
 		cx = 10;
 	else
 		cx = 6;
-	xcc = xco + (_menuConstants[ii - 1][2] * cx) + 6;
+	xcc = xco + (menuConstants[ii - 1][2] * cx) + 6;
 	if ((ii == 4) && (_vm->getLanguage() == Common::EN_ANY))
 		// Extra width needed for Self menu in English version
 		xcc = 435;
 
-	_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (_menuConstants[ii - 1][1] << 1)));
-	_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (_menuConstants[ii - 1][1] << 1)));
-	_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (_menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (_menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.fillRect(15, Common::Rect(xco, 12, xcc, 10 + (menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.fillRect(0, Common::Rect(xcc, 12, xcc + 4, 10 + (menuConstants[ii - 1][1] << 1)));
+	_vm->_screenSurface.fillRect(0, Common::Rect(xco, 8 + (menuConstants[ii - 1][1] << 1), xcc + 4, 12 + (menuConstants[ii - 1][1] << 1)));
 	_vm->_screenSurface.putxy(xco, 16);
 	cx = 0;
 	do {


Commit: 8462eb7cfb908195031518d44b5979705526b86b
    https://github.com/scummvm/scummvm/commit/8462eb7cfb908195031518d44b5979705526b86b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T02:51:10-07:00

Commit Message:
MORTEVIELLE: Reorder includes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/debugger.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mouse.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/saveload.cpp
    engines/mortevielle/sound.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index c3b82b7..4fea263 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -25,14 +25,15 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/scummsys.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
-#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/speech.h"
 
+#include "common/scummsys.h"
+
 namespace Mortevielle {
 
 /**
diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index 9c24954..042eb0e 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -20,8 +20,8 @@
  *
  */
 
-#include "mortevielle/debugger.h"
 #include "mortevielle/mortevielle.h"
+#include "mortevielle/debugger.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index d2f9274..2c644bc 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -25,13 +25,15 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/str.h"
-#include "mortevielle/dialogs.h"
 #include "mortevielle/mortevielle.h"
+
+#include "mortevielle/dialogs.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/speech.h"
 
+#include "common/str.h"
+
 namespace Mortevielle {
 
 /**
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 0ac43a6..1ced300 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -25,12 +25,13 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/graphics.h"
+#include "mortevielle/mouse.h"
+
 #include "common/endian.h"
 #include "common/system.h"
 #include "graphics/palette.h"
-#include "mortevielle/graphics.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/mouse.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index c856f0e..a289655 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -25,14 +25,16 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/scummsys.h"
-#include "common/str.h"
-#include "common/textconsole.h"
-#include "mortevielle/menu.h"
 #include "mortevielle/mortevielle.h"
+
+#include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 
+#include "common/scummsys.h"
+#include "common/str.h"
+#include "common/textconsole.h"
+
 namespace Mortevielle {
 
 const byte menuConstants[8][4] = {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7829fab..418b0a0 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -25,14 +25,8 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/system.h"
-#include "common/config-manager.h"
-#include "common/debug-channels.h"
-#include "engines/util.h"
-#include "engines/engine.h"
-#include "graphics/palette.h"
-#include "graphics/pixelformat.h"
 #include "mortevielle/mortevielle.h"
+
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
 #include "mortevielle/mouse.h"
@@ -40,6 +34,14 @@
 #include "mortevielle/saveload.h"
 #include "mortevielle/outtext.h"
 
+#include "common/system.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+#include "engines/util.h"
+#include "engines/engine.h"
+#include "graphics/palette.h"
+#include "graphics/pixelformat.h"
+
 namespace Mortevielle {
 
 MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 4d3d8bb..139ccbe 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -25,10 +25,11 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
+#include "mortevielle/mortevielle.h"
+#include "mortevielle/mouse.h"
+
 #include "common/endian.h"
 #include "common/rect.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/mortevielle.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 7778eb3..81760d1 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -25,12 +25,13 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/file.h"
-#include "common/str.h"
+#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/graphics.h"
-#include "mortevielle/mortevielle.h"
+
+#include "common/file.h"
+#include "common/str.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 382fd14..ff3bee5 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -25,13 +25,14 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/file.h"
-#include "common/system.h"
-#include "mortevielle/dialogs.h"
 #include "mortevielle/mortevielle.h"
+#include "mortevielle/dialogs.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/saveload.h"
 
+#include "common/file.h"
+#include "common/system.h"
+
 namespace Mortevielle {
 
 static const char SAVEGAME_ID[4] = { 'M', 'O', 'R', 'T' };
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index de5c4fe..d54ab71 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -25,9 +25,10 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/scummsys.h"
-#include "mortevielle/sound.h"
 #include "mortevielle/mortevielle.h"
+#include "mortevielle/sound.h"
+
+#include "common/scummsys.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 1fe130a..aea49d8 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -25,11 +25,13 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/endian.h"
-#include "common/file.h"
+#include "mortevielle/mortevielle.h"
+
 #include "mortevielle/speech.h"
 #include "mortevielle/sound.h"
-#include "mortevielle/mortevielle.h"
+
+#include "common/endian.h"
+#include "common/file.h"
 
 namespace Mortevielle {
 
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 73f8e16..7f779a8 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -28,9 +28,10 @@
 #ifndef MORTEVIELLE_SPEECH_H
 #define MORTEVIELLE_SPEECH_H
 
-#include "common/scummsys.h"
 #include "mortevielle/sound.h"
 
+#include "common/scummsys.h"
+
 namespace Mortevielle {
 
 const int kAdrNoise  = 0x5cb0;/*2C00;*/
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 6469939..ca6bdcd 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -25,16 +25,17 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#include "common/scummsys.h"
-#include "graphics/cursorman.h"
+#include "mortevielle/mortevielle.h"
 
 #include "mortevielle/dialogs.h"
 #include "mortevielle/menu.h"
-#include "mortevielle/mortevielle.h"
 #include "mortevielle/mouse.h"
 #include "mortevielle/outtext.h"
 #include "mortevielle/speech.h"
 
+#include "common/scummsys.h"
+#include "graphics/cursorman.h"
+
 namespace Mortevielle {
 
 /**


Commit: cf6f2ed85d48f03b355da15e90426070cc80f3bc
    https://github.com/scummvm/scummvm/commit/cf6f2ed85d48f03b355da15e90426070cc80f3bc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T05:03:53-07:00

Commit Message:
MORTEVIELLE: Fix define name in Mortevielle.h

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 18cf274..eb245c6 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -25,8 +25,8 @@
  * Copyright (c) 1987-1989 Lankhor
  */
 
-#ifndef MORTEVIELLE_H
-#define MORTEVIELLE_H
+#ifndef MORTEVIELLE_MORTEVIELLE_H
+#define MORTEVIELLE_MORTEVIELLE_H
 
 #include "common/events.h"
 #include "common/file.h"


Commit: 0b70159f9f7b76855af32e10e9b7ac087731f80a
    https://github.com/scummvm/scummvm/commit/0b70159f9f7b76855af32e10e9b7ac087731f80a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T05:08:17-07:00

Commit Message:
TOOLS: Janitorial: remove trailing spaces in extract_mort

Changed paths:
    devtools/extract_mort/extract_mort.cpp



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index 0164030..fd6d884 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -40,7 +40,7 @@
 #include "common/endian.h"
 
 enum AccessMode {
-	kFileReadMode = 1,
+	kFileReadMode  = 1,
 	kFileWriteMode = 2
 };
 
@@ -108,7 +108,7 @@ public:
 		fseek (f, 0, SEEK_END);
 		int end = ftell (f);
 		fseek (f, pos, SEEK_SET);
-	
+
 		return end;
 	}
 };
@@ -228,7 +228,7 @@ static void addCompressedValue(int oct, int &indis, int &point, uint16 *strData)
 	if (point < 5) {
 		// Overlapping into next word
 		++indis;
-		
+
 		// Get the bits that fall into the next word and set it
 		int remainder = oct & ((1 << (5 - point)) - 1);
 		strData[indis] |= remainder << (16 - (5 - point));


Commit: c87881a22b9f94dd8ad3912ed9b878b83b1fb0eb
    https://github.com/scummvm/scummvm/commit/c87881a22b9f94dd8ad3912ed9b878b83b1fb0eb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T05:22:28-07:00

Commit Message:
MORTEVIELLE: Constify 3 more arrays

Changed paths:
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 81760d1..6bb775a 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -189,8 +189,8 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 void TextHandler::taffich() {
 	static const byte _rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
-	byte tran1[] = { 121, 121, 138, 139, 120 };
-	byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
+	static const byte tran1[] = { 121, 121, 138, 139, 120 };
+	static const byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
 
 	int cx, handle, npal;
 	int32 lgt;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index ca6bdcd..2c1a501 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -182,7 +182,7 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
 }
 
 
-static byte CURSOR_ARROW_DATA[16 * 16] = {
+static const byte CURSOR_ARROW_DATA[16 * 16] = {
 	0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 	0x0f, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 	0x0f, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,


Commit: dcea5f433c9269343cf62e994e21c73853e09bbd
    https://github.com/scummvm/scummvm/commit/dcea5f433c9269343cf62e994e21c73853e09bbd
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T08:29:33-07:00

Commit Message:
MORTEVIELLE: Simplify the way skip info is computed, as pointed by LordHoto

Changed paths:
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 6bb775a..d9d47a9 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -133,11 +133,9 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
 
-	int skipBlock = 0;
-	while (skipSize > 127) {
-		++skipBlock;
-		skipSize -= 128;
-	}
+	int skipBlock = skipSize / 128;
+	skipSize %= 128;
+
 	if (skipBlock != 0)
 		f.seek(skipBlock * 0x80);
 


Commit: 536fcb96b32490ce3141ddc4b80118a10b5b5d93
    https://github.com/scummvm/scummvm/commit/536fcb96b32490ce3141ddc4b80118a10b5b5d93
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T08:43:55-07:00

Commit Message:
MORTEVIELLE: Fix glitch detected by criezy

Changed paths:
    devtools/extract_mort/extract_mort.cpp



diff --git a/devtools/extract_mort/extract_mort.cpp b/devtools/extract_mort/extract_mort.cpp
index fd6d884..159309c 100644
--- a/devtools/extract_mort/extract_mort.cpp
+++ b/devtools/extract_mort/extract_mort.cpp
@@ -322,7 +322,7 @@ static void export_strings(const char *textFilename) {
 		do {
 			extractCharacter(ch, indis, point, endFlag, strData);
 			buffer[charIndex++] = ch;
-			if (ch == BUFFER_SIZE) {
+			if (charIndex == BUFFER_SIZE) {
 				printf("Extracted string exceeded allowed buffer size.\n");
 				exit(1);
 			}


Commit: 4f8ac0b337d88ac1bbe4a218f648ef49b33aa2bd
    https://github.com/scummvm/scummvm/commit/4f8ac0b337d88ac1bbe4a218f648ef49b33aa2bd
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T08:54:09-07:00

Commit Message:
MORTEVIELLE: Add a safeguard in Copy()

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 2c1a501..28f3e4f 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2487,6 +2487,8 @@ void MortevielleEngine::palette(int v1) {
  */
 
 Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t size) {
+	assert(idx + size < s.size());
+
 	// Copy the substring into a temporary buffer
 	char *tmp = new char[size + 1];
 	strncpy(tmp, s.c_str() + idx - 1, size);


Commit: ef9353002637027dab5113c9987902fb665e4d6e
    https://github.com/scummvm/scummvm/commit/ef9353002637027dab5113c9987902fb665e4d6e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-19T09:00:15-07:00

Commit Message:
MORTEVIELLE: Fix glitch in constant name. Thanks to LordHoto for pointing it out

Changed paths:
    engines/mortevielle/speech.h



diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index 7f779a8..b3d7c15 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -43,7 +43,7 @@ const int kAdrWord   = 0x4000;
 const int kOffsetB1  = 6;
 const int kOffsetB3  = 6;
 
-const float freq0 = 1.19318e6;
+const float kfreq0 = 1.19318e6;
 const int kNullValue = 255;
 const int kTempoMusic = 71;
 const int kTempoNoise = 78;


Commit: b8313325954dba25e5e11190472240d755720859
    https://github.com/scummvm/scummvm/commit/b8313325954dba25e5e11190472240d755720859
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-07-19T19:51:25-07:00

Commit Message:
MORTEVIELLE: Removed redundant mouse drawing code

Changed paths:
    engines/mortevielle/mouse.cpp



diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 139ccbe..dfc9ccd 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -45,174 +45,19 @@ void MouseHandler::initMouse() {
 }
 
 /**
- * Hide the mouse
+ * Backs up the area behind where the mouse cursor is to be drawn
  * @remarks	Originally called 'hide_mouse'
  */
 void MouseHandler::hideMouse() {
-	--_counter;
-	if (_counter == 0) {
-		int j = 0;
-		switch (_vm->_currGraphicalDevice) {
-		case MODE_CGA: {
-			int k = 0;
-			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
-			do {
-				WRITE_LE_UINT16(&_vm->_mem[0xb000 * 16 + j], s_s[0][k]);
-				WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j + 2], s_s[1][k]);
-				WRITE_LE_UINT16(&_vm->_mem[0xba00 * 16 + j], s_s[2][k]);
-				WRITE_LE_UINT16(&_vm->_mem[0xba00 * 16 + j + 2], s_s[3][k]);
-				j += 80;
-				++k;
-			} while (k < 5);
-			}
-			break;
-		case MODE_AMSTRAD1512: {
-			bool imp = odd(_pos.y);
-			for (int i = 0; i <= 3; ++i) {
-				int k = 0;
-				j = 0;
-				do {
-					if (imp) {
-						WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
-						j += 80 - 0x2000;
-					} else {
-						WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + j], s_s[i][k]);
-						j += 0x2000;
-					}
-					imp = !imp;
-					++k;
-				} while (k < 8);
-			}
-			break;
-			}
-		case MODE_EGA: {
-			int i = 0;
-			do {
-				int k = 0;
-				j = 0;
-				do {
-					// Useless ?
-					// ps = mem[0xa000 * 16 + j];
-					_vm->_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
-
-					// Useless ??
-					// ps = mem[0xa000 * 16 + j + 1];
-					_vm->_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
-					j += 80;
-					++k;
-				} while (k < 8);
-				++i;
-			} while (i != 4);
-			}
-			break;
-		case MODE_HERCULES:
-			j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
-			for (int i = 0; i <= 5; ++i) {
-				for (int k = 0; k <= 3; ++k)
-					WRITE_LE_UINT16(&_vm->_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
-				j += 80;
-			}
-			break;
-		case MODE_TANDY: {
-			j = ((uint)_pos.y >> 2) * 160 + ((uint)_pos.x >> 1);
-			int k = 0;
-			do {
-				for (int i = 0; i <= 3; ++i) {
-					WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
-					WRITE_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
-				}
-				j += 160;
-				++k;
-			} while (k != 3);
-			}
-			break;
-		default:
-			break;
-		}     // case Gd
-	}
+	// No implementation needed in ScummVM
 }
 
 /**
- * Show mouse
+ * Draws the mouse cursor
  * @remarks	Originally called 'show_mouse'
  */
 void MouseHandler::showMouse() {
-	int k, l;
-
-	++_counter;
-	if (_counter != 1)
-		return;
-	int j = 0;
-	int i = _pos.x & 7;
-	switch (_vm->_currGraphicalDevice) {
-	case MODE_CGA:
-		k = 0;
-		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 2);
-		do {
-			s_s[0][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
-			s_s[1][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j + 2]);
-			s_s[2][k] = READ_LE_UINT16(&_vm->_mem[0xba00 * 16 + j]);
-			s_s[3][k] = READ_LE_UINT16(&_vm->_mem[0xba00 * 16 + j + 2]);
-			j += 80;
-			++k;
-		} while (k < 5);
-		break;
-	case MODE_AMSTRAD1512: {
-		bool imp = odd(_pos.y);
-		for (i = 0; i <= 3; ++i) {
-			j = 0;
-			imp = odd(_pos.y);
-			k = 0;
-			do {
-				if (imp) {
-					s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
-					j += 80 - 0x2000;
-				} else {
-					s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + j]);
-					j += 0x2000;
-				}
-				imp = !imp;
-				++k;
-			} while (k < 8);
-		}
-		break;
-		}
-	case MODE_EGA:
-		l = 0;
-		do {
-			k = 0;
-			j = 0;
-			do {
-				s_s[l][k] = _vm->_mem[0xa000 * 16 + j] + (_vm->_mem[(0xa000 * 16) + j + 1] << 8);
-				j += 80;
-				++k;
-			} while (k < 8);
-			++l;
-		} while (l != 4);
-		break;
-	case MODE_HERCULES:
-		j = ((uint)_pos.y >> 1) * 80 + ((uint)_pos.x >> 3);
-		for (i = 0; i <= 5; ++i) {
-			for (k = 0; k <= 3; ++k)
-				s_s[i][k] = READ_LE_UINT16(&_vm->_mem[0xb000 * 16 + k * 0x200 + j]);
-			j += 80;
-		}
-		break;
-	case MODE_TANDY:
-		j = ((uint)_pos.y >> 2) * 160 + ((uint)_pos.x >> 1);
-		k = 0;
-		do {
-			for (i = 0; i <= 3; ++i) {
-				s_s[k][i + (k << 2)] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j]);
-				s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&_vm->_mem[0xb800 * 16 + 0x200 * i + j + 2]);
-			}
-			j += 160;
-			++k;
-		} while (k != 3);
-		break;
-	default:
-		break;
-	}    //  case Gd
+	// ScummVM implementation uses CursorMan for drawing the cursor
 }
 
 /**


Commit: 34e556e5f9eb4b2bc46e39c7426220bcca62a2a8
    https://github.com/scummvm/scummvm/commit/34e556e5f9eb4b2bc46e39c7426220bcca62a2a8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:38-07:00

Commit Message:
MORTEVIELLE: Little refactoring of decryptNextChar()

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index eb245c6..e941a86 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -432,7 +432,7 @@ private:
 	void putInHand(int &objId);
 	void prepareDisplayText();
 
-	void cinq_huit(char &c, int &idx, byte &pt, bool &the_end);
+	bool decryptNextChar(char &c, int &idx, byte &pt);
 	void copcha();
 	void adzon();
 	void phaz(int &rand, int &p, int cf);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 28f3e4f..994376b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1846,7 +1846,15 @@ const byte cryptoArr31De[32]= {
 const byte *cryptoArrDefault, *cryptoArr30, *cryptoArr31;
 uint16 ctrlChar;
 
-void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
+/**
+ * Decrypt the next character
+ * @param c		OUT, next decrypted char
+ * @param idx	IN/OUT, current buffer index
+ * @param pt	IN/OUT, current encryption point
+ * @return a boolean specifying if a stop character has been encountered
+ * @remarks	Originally called 'cinq_huit'
+ */
+bool MortevielleEngine::decryptNextChar(char &c, int &idx, byte &pt) {
 	uint16 oct, ocd;
 
 	/* 5-8 */
@@ -1864,7 +1872,7 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 
 	if (oct == ctrlChar) {
 		c = '$';
-		the_end = true;
+		return true;
 	} else if (oct == 30 || oct == 31) {
 		ocd = _dialogIndexArray[idx];
 		ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
@@ -1884,12 +1892,13 @@ void MortevielleEngine::cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
 			c = chr(cryptoArr31[ocd]);
 
 		if (c == '\0') {
-			the_end = true;
 			c = '#';
+			return true;
 		}
 	} else {
 		c = chr(cryptoArrDefault[oct]);
 	}
+	return false;
 }
 
 /**
@@ -1910,7 +1919,7 @@ Common::String MortevielleEngine::getString(int num) {
 		bool endFl = false;
 		char let;
 		do {
-			cinq_huit(let, hint, point, endFl);
+			endFl = decryptNextChar(let, hint, point);
 			wrkStr += let;
 			++length;
 		} while (!endFl);


Commit: bd7a381d7df5c4d516495a2a02411bb972ef6ba2
    https://github.com/scummvm/scummvm/commit/bd7a381d7df5c4d516495a2a02411bb972ef6ba2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:39-07:00

Commit Message:
MORTEVIELLE: Reorder some functions in mortevielle.h

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index e941a86..0f3d724 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -418,21 +418,20 @@ private:
 	void endGame();
 	void askRestart();
 	void handleOpcode();
+	void prepareDisplayText();
+	bool decryptNextChar(char &c, int &idx, byte &pt);
 	void displayStatusArrow();
 	void displayStatusInDescriptionBar(char stat);
-
 	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
+	void displayTextInVerbBar(Common::String text);
 	void mapMessageId(int &mesgId);
 	void resetOpenObjects();
 	void setCoordinates(int sx);
-	void displayTextInVerbBar(Common::String text);
 	void drawPicture();
 	void drawPictureWithText();
 	void addObjectToInventory(int objectId);
 	void putInHand(int &objId);
-	void prepareDisplayText();
 
-	bool decryptNextChar(char &c, int &idx, byte &pt);
 	void copcha();
 	void adzon();
 	void phaz(int &rand, int &p, int cf);


Commit: 48bd13a719a20e9e2e2c1f995256e0c8a9f74b71
    https://github.com/scummvm/scummvm/commit/48bd13a719a20e9e2e2c1f995256e0c8a9f74b71
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:40-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 4fea263..71f0d8f 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1386,9 +1386,9 @@ void MortevielleEngine::fctDiscuss() {
 			if (_coreVar._availableQuestion[icm] == '*') {
 				// If question already asked, write it in reverse video
 				if (questionAsked[icm])
-					writetp(lib[icm], 1);
+					displayQuestionText(lib[icm], 1);
 				else
-					writetp(lib[icm], 0);
+					displayQuestionText(lib[icm], 0);
 			}
 
 			if (icm == 23)  {
@@ -1398,7 +1398,7 @@ void MortevielleEngine::fctDiscuss() {
 				posY += 8;
 		}
 		_screenSurface.putxy(320, 176);
-		writetp(lib[46], 0);
+		displayQuestionText(lib[46], 0);
 		char retKey = '\0';
 		bool click;
 		do {
@@ -1423,9 +1423,9 @@ void MortevielleEngine::fctDiscuss() {
 						posX = 0;
 					_screenSurface.putxy(posX, posY);
 					if (questionAsked[choice])
-						writetp(lib[choice], 0);
+						displayQuestionText(lib[choice], 0);
 					else
-						writetp(lib[choice], 1);
+						displayQuestionText(lib[choice], 1);
 					questionAsked[choice] = !questionAsked[choice];
 					choice = 0;
 				}
@@ -1442,9 +1442,9 @@ void MortevielleEngine::fctDiscuss() {
 							posX = 0;
 						_screenSurface.putxy(posX, posY);
 						if (questionAsked[choice])
-							writetp(lib[choice], 0);
+							displayQuestionText(lib[choice], 0);
 						else
-							writetp(lib[choice], 1);
+							displayQuestionText(lib[choice], 1);
 						questionAsked[choice] = ! questionAsked[choice];
 					}
 					if ((_coreVar._availableQuestion[ix] == '*') || (ix == 46)) {
@@ -1455,9 +1455,9 @@ void MortevielleEngine::fctDiscuss() {
 							posX = 0;
 						_screenSurface.putxy(posX, posY);
 						if (questionAsked[ix])
-							writetp(lib[ix], 0);
+							displayQuestionText(lib[ix], 0);
 						else
-							writetp(lib[ix], 1);
+							displayQuestionText(lib[ix], 1);
 						questionAsked[ix] = ! questionAsked[ix];
 						choice = ix;
 					} else
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 1ced300..e94e1ce 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1086,24 +1086,24 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 		i = 10;
 
 	int x = pt.x + i * l.size();
-	int cecr = 0;
+	int color = 0;
 
 	switch (command) {
 	case 1:
 	case 3: {
-		cecr = 0;
+		color = 0;
 		_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 		}
 		break;
 	case 4:
-		cecr = 0;
+		color = 0;
 		break;
 	case 5:
-		cecr = 15;
+		color = 15;
 		break;
 	case 0:
 	case 2: {
-		cecr = 15;
+		color = 15;
 		_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
 		}
 		break;
@@ -1114,7 +1114,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	pt.x += 1;
 	pt.y += 1;
 	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
-		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), cecr);
+		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), color);
 		pt.x += i;
 	}
 	_vm->_mouse.showMouse();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0f3d724..b990859 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -422,6 +422,7 @@ private:
 	bool decryptNextChar(char &c, int &idx, byte &pt);
 	void displayStatusArrow();
 	void displayStatusInDescriptionBar(char stat);
+	void displayQuestionText(Common::String s, int cmd);
 	void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
 	void displayTextInVerbBar(Common::String text);
 	void mapMessageId(int &mesgId);
@@ -435,7 +436,6 @@ private:
 	void copcha();
 	void adzon();
 	void phaz(int &rand, int &p, int cf);
-	void writetp(Common::String s, int t);
 	void premtet();
 	void ajchai();
 	void ecr2(Common::String text);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 994376b..8e0e76f 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2957,11 +2957,15 @@ int MortevielleEngine::getPresence(int roomId) {
 	return retVal;
 }
 
-void MortevielleEngine::writetp(Common::String s, int t) {
+/**
+ * Display Question String
+ * @remarks	Originally called 'writetp'
+ */
+void MortevielleEngine::displayQuestionText(Common::String s, int cmd) {
 	if (_resolutionScaler == 2)
-		_screenSurface.drawString(s, t);
+		_screenSurface.drawString(s, cmd);
 	else
-		_screenSurface.drawString(copy(s, 1, 25), t);
+		_screenSurface.drawString(copy(s, 1, 25), cmd);
 }
 
 void MortevielleEngine::aniof(int ouf, int num) {


Commit: 7fef5f09950f0fc90a5b49460bc7486f7d2d1409
    https://github.com/scummvm/scummvm/commit/7fef5f09950f0fc90a5b49460bc7486f7d2d1409
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:46-07:00

Commit Message:
MORTEVIELLE: Simplify drawString code

Changed paths:
    engines/mortevielle/graphics.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e94e1ce..cf15b07 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1079,43 +1079,38 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	_vm->_mouse.hideMouse();
 	Common::Point pt = _textPos;
 
-	int i;
+	int charWidth;
 	if (_vm->_resolutionScaler == 2)
-		i = 6;
+		charWidth = 6;
 	else
-		i = 10;
+		charWidth = 10;
 
-	int x = pt.x + i * l.size();
+	int x = pt.x + charWidth * l.size();
 	int color = 0;
 
 	switch (command) {
+	case 0:
+	case 2:
+		color = 15;
+		_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+		break;
 	case 1:
-	case 3: {
-		color = 0;
+	case 3:
 		_vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
-		}
-		break;
-	case 4:
-		color = 0;
 		break;
 	case 5:
 		color = 15;
 		break;
-	case 0:
-	case 2: {
-		color = 15;
-		_vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
-		}
-		break;
 	default:
+		// Default: Color set to zero (already done)
 		break;
 	}
 
 	pt.x += 1;
 	pt.y += 1;
-	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
+	for (x = 1; (x <= l.size()) && (l[x - 1] != 0); ++x) {
 		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), color);
-		pt.x += i;
+		pt.x += charWidth;
 	}
 	_vm->_mouse.showMouse();
 }


Commit: abc3177c7da9684431cff84777a29a72506dc202
    https://github.com/scummvm/scummvm/commit/abc3177c7da9684431cff84777a29a72506dc202
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:47-07:00

Commit Message:
MORTEVIELLE: Get rid of magic value 0x7000

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 2c644bc..d992fa0 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -465,7 +465,7 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
 	_vm->_caff = 50;
 	_vm->_maff = 0;
 	_vm->_text.taffich();
-	_vm->draw(kAdrDes, 63, 12);
+	_vm->draw(kAdrPictureComp, 63, 12);
 	if (drawFrame2Fl)
 		displayIntroFrame2();
 	else
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index cf15b07..d5036cb 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -937,7 +937,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &_vm->_mem[0x7000 * 16 + 2];
+	const byte *paletteMap = &_vm->_mem[kAdrPictureComp * 16 + 2];
 
 	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
@@ -1108,7 +1108,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 
 	pt.x += 1;
 	pt.y += 1;
-	for (x = 1; (x <= l.size()) && (l[x - 1] != 0); ++x) {
+	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
 		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), color);
 		pt.x += charWidth;
 	}
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b990859..d95f2dc 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -63,6 +63,7 @@ namespace Mortevielle {
  * 7000:2 - 16 words representing palette map
  * 7000:4138 - width, height, x/y offset of decoded image
  */
+const int kAdrPictureComp = 0x7000;
 
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
@@ -114,7 +115,6 @@ const int kTime1 = 410;
 const int kTime2 = 250;
 
 const int kAcha = 492;
-const int kAdrDes = 0x7000;
 const int kFleche = 1758;
 
 const int kAsoul = 154;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index d9d47a9..6e37250 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -150,7 +150,7 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[0x7000 * 16 + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
+		_vm->_mem[(kAdrPictureComp * 16) + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
 }
 
 /**
@@ -288,7 +288,7 @@ void TextHandler::taffich() {
 	loadDesFile(filename, lgt, handle);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&_vm->_mem[(0x7000 * 16) + ((i + 1) << 1)]);
+			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrPictureComp * 16) + ((i + 1) << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -296,7 +296,7 @@ void TextHandler::taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			_vm->_mem[(0x7000 * 16) + 2 + (k << 1)] = _rang[i];
+			_vm->_mem[(kAdrPictureComp * 16) + 2 + (k << 1)] = _rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 8e0e76f..2a39e4b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1997,8 +1997,8 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			_mem[(0x7000 * 16) + (2 * i)] = _stdPal[n][i].x;
-			_mem[(0x7000 * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+			_mem[(kAdrPictureComp * 16) + (2 * i)] = _stdPal[n][i].x;
+			_mem[(kAdrPictureComp * 16) + (2 * i) + 1] = _stdPal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
@@ -2245,7 +2245,7 @@ void MortevielleEngine::showTitleScreen() {
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
-	draw(kAdrDes, 0, 0);
+	draw(kAdrPictureComp, 0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
 	_screenSurface.putxy(104 + 72 * _resolutionScaler, 185);
@@ -2270,7 +2270,7 @@ void MortevielleEngine::draw(int ad, int x, int y) {
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[0x7000 * 16 + 14] = 15;
+		_mem[(kAdrPictureComp * 16) + 14] = 15;
 	}
 	_mouse.hideMouse();
 	pictout(0x73a2, 0, 0, 0);
@@ -2561,12 +2561,12 @@ void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
 	surface.decode(&_mem[seg * 16 + dep]);
 
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[0x7000 * 16 + 2] = 0;
-		_mem[0x7000 * 16 + 32] = 15;
+		_mem[(kAdrPictureComp * 16) + 2] = 0;
+		_mem[(kAdrPictureComp * 16) + 32] = 15;
 	}
 
-	if ((_caff != 51) && (READ_LE_UINT16(&_mem[0x7000 * 16 + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&_mem[0x7000 * 16 + 0x4138], 0x100);
+	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrPictureComp * 16) + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + 0x4138], 0x100);
 
 	_screenSurface.drawPicture(surface, x, y);
 }
@@ -2998,13 +2998,13 @@ void MortevielleEngine::aniof(int ouf, int num) {
 void MortevielleEngine::drawPicture() {
 	clearUpperLeftPart();
 	if (_caff > 99) {
-		draw(kAdrDes, 60, 33);
+		draw(kAdrPictureComp, 60, 33);
 		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 	} else if (_caff > 69) {
-		draw(kAdrDes, 112, 48);           // Heads
+		draw(kAdrPictureComp, 112, 48);           // Heads
 		_screenSurface.drawBox(222, 47, 155, 92, 15);
 	} else {
-		draw(kAdrDes, 0, 12);
+		draw(kAdrPictureComp, 0, 12);
 		prepareScreenType1();
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
@@ -3177,7 +3177,7 @@ void MortevielleEngine::mennor() {
 }
 
 void MortevielleEngine::premtet() {
-	draw(kAdrDes, 10, 80);
+	draw(kAdrPictureComp, 10, 80);
 	_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 


Commit: 7d26f5cc3d753375f143d391cd292b7259a35648
    https://github.com/scummvm/scummvm/commit/7d26f5cc3d753375f143d391cd292b7259a35648
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:48-07:00

Commit Message:
MORTEVIELLE: Get rid of magic value 0x6000

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index d95f2dc..2d2f598 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -63,6 +63,7 @@ namespace Mortevielle {
  * 7000:2 - 16 words representing palette map
  * 7000:4138 - width, height, x/y offset of decoded image
  */
+const int kAdrPictureDecomp = 0x6000;
 const int kAdrPictureComp = 0x7000;
 
 #define ord(v) ((int) v)
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 6e37250..0bb59a6 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -141,7 +141,7 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 
 	int remainingSkipSize = abs(skipSize);
 	int totalLength = length + remainingSkipSize;
-	int memIndx = 0x6000 * 16;
+	int memIndx = kAdrPictureDecomp * 16;
 	while (totalLength > 0) {
 		f.read(&_vm->_mem[memIndx], 128);
 		totalLength -= 128;
@@ -150,7 +150,7 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[(kAdrPictureComp * 16) + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
+		_vm->_mem[(kAdrPictureComp * 16) + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
 }
 
 /**
@@ -172,7 +172,7 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 
 	int remainingSkipSize = abs(skipSize);
 	int fullLength = length + remainingSkipSize;
-	int memIndx = 0x6000 * 16;
+	int memIndx = kAdrPictureDecomp * 16;
 	while (fullLength > 0) {
 		f.read(&_vm->_mem[memIndx], 128);
 		fullLength -= 128;
@@ -181,7 +181,7 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = _vm->_mem[0x6000 * 16 + i];
+		_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
 }
 
 void TextHandler::taffich() {
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 2a39e4b..dafdcbe 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2026,12 +2026,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr], p._tax);
-	WRITE_LE_UINT16(&_mem[0x6000 * 16 + addr + 2], p._tay);
+	WRITE_LE_UINT16(&_mem[(kAdrPictureDecomp * 16) + addr], p._tax);
+	WRITE_LE_UINT16(&_mem[(kAdrPictureDecomp * 16) + addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			_mem[(0x6000 * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			_mem[(kAdrPictureDecomp * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 


Commit: 590edf7de3d7ea4b26b9cd2b11a63170f4305541
    https://github.com/scummvm/scummvm/commit/590edf7de3d7ea4b26b9cd2b11a63170f4305541
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T09:59:49-07:00

Commit Message:
MORTEVIELLE: Get rid of magic value 0x5000

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/sound.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 2d2f598..b5bb74a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -63,6 +63,7 @@ namespace Mortevielle {
  * 7000:2 - 16 words representing palette map
  * 7000:4138 - width, height, x/y offset of decoded image
  */
+const int kAdrMusic = 0x5000;
 const int kAdrPictureDecomp = 0x6000;
 const int kAdrPictureComp = 0x7000;
 
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index d54ab71..f9b53ff 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -178,7 +178,7 @@ void SoundManager::playNote(int frequency, int32 length) {
 
 void SoundManager::musyc(tablint &tb, int nbseg, int att) {
 #ifdef DEBUG
-	const byte *pSrc = &_vm->_mem[0x5000 * 16];
+	const byte *pSrc = &_vm->_mem[kAdrMusic * 16];
 
 	// Convert the countdown amount to a tempo rate, and then to note length in microseconds
 	int tempo = TIMER_FREQUENCY / att;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index dafdcbe..216bd72 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2216,7 +2216,7 @@ void MortevielleEngine::music() {
 	fic.read(&_mem[0x47a0 * 16 + 0], 123);
 	fic.close();
 
-	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[0x5000 * 16], 623);
+	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[kAdrMusic * 16], 623);
 	_addFix = (float)((kTempoMusic - 8)) / 256;
 	_speechManager.cctable(_speechManager._tbi);
 


Commit: fb448d7d64bed332606240f2614dab5350ed00dc
    https://github.com/scummvm/scummvm/commit/fb448d7d64bed332606240f2614dab5350ed00dc
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T10:02:36-07:00

Commit Message:
MORTEVIELLE: Make use of _mem more homogeneous, fix a couple of errors in phoneme handling

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/speech.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index d5036cb..f967ad9 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -937,7 +937,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &_vm->_mem[kAdrPictureComp * 16 + 2];
+	const byte *paletteMap = &_vm->_mem[(kAdrPictureComp * 16) + 2];
 
 	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 0bb59a6..8e27e47 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -181,7 +181,7 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 	f.close();
 
 	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[kAdrAni * 16 + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
+		_vm->_mem[(kAdrAni * 16) + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
 }
 
 void TextHandler::taffich() {
@@ -288,7 +288,7 @@ void TextHandler::taffich() {
 	loadDesFile(filename, lgt, handle);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrPictureComp * 16) + ((i + 1) << 1)]);
+			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrPictureComp * 16) + 2 + (i << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index aea49d8..7f11ea2 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -83,7 +83,7 @@ void SpeechManager::spfrac(int wor) {
 }
 
 void SpeechManager::charg_car(int &currWordNumb) {
-	int wor = swap(READ_LE_UINT16(&_vm->_mem[kAdrWord + currWordNumb]));
+	int wor = swap(READ_LE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWordNumb]));
 	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {
@@ -123,7 +123,7 @@ void SpeechManager::charg_car(int &currWordNumb) {
 
 
 void SpeechManager::entroct(byte o) {
-	_vm->_mem[kAdrTroct * 16 + _ptr_oct] = o;
+	_vm->_mem[(kAdrTroct * 16) + _ptr_oct] = o;
 	++_ptr_oct;
 }
 
@@ -145,7 +145,7 @@ void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		_cfiphBuffer[j] = READ_LE_UINT16(&_vm->_mem[kAdrNoise3 + i]);
+		_cfiphBuffer[j] = READ_LE_UINT16(&_vm->_mem[(kAdrNoise3 * 16) + i]);
 		i += 2;
 		++j;
 	} while (i < kOffsetB3 + 8790);
@@ -161,7 +161,7 @@ void SpeechManager::loadMusicSound() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 
-	f.read(&_vm->_mem[0x7414 * 16 + 0], 273);
+	f.read(&_vm->_mem[0x7414 * 16], 273);
 
 	_vm->_soundManager.decodeMusic(&_vm->_mem[0x7414 * 16], &_vm->_mem[kAdrNoise * 16], 273);
 	f.close();
@@ -194,10 +194,10 @@ void SpeechManager::loadNoise() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&_vm->_mem[kAdrNoise * 16 + 0], 250);
+	f.read(&_vm->_mem[kAdrNoise * 16], 250);
 	for (i = 0; i <= 19013; ++i)
-		_vm->_mem[kAdrNoise * 16 + 32000 + i] = _vm->_mem[kAdrNoise5 + i];
-	f.read(&_vm->_mem[kAdrNoise1 * 16 + kOffsetB1], 149);
+		_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _vm->_mem[(kAdrNoise5 * 16) + i];
+	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149);
 
 	f.close();
 }
@@ -533,7 +533,7 @@ void SpeechManager::handlePhoneme() {
 	int endPos = swap(_cfiphBuffer[_phonemeNumb]) + deca[_typlec];
 	int wordCount = endPos - startPos;
 	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&_vm->_mem[kAdrWord + currWord], _cfiphBuffer[i]);
+		WRITE_LE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWord], _cfiphBuffer[i]);
 
 	_ptr_oct = 0;
 	int currWord = 0;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 216bd72..20ba38b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2152,7 +2152,7 @@ void MortevielleEngine::loadBRUIT5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&_mem[kAdrNoise5 * 16 + 0], 149 * 128);
+	f.read(&_mem[kAdrNoise5 * 16], 149 * 128);
 	f.close();
 }
 
@@ -2212,8 +2212,8 @@ void MortevielleEngine::music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&_mem[0x3800 * 16 + 0], 500);
-	fic.read(&_mem[0x47a0 * 16 + 0], 123);
+	fic.read(&_mem[0x3800 * 16], 500);
+	fic.read(&_mem[0x47a0 * 16], 123);
 	fic.close();
 
 	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[kAdrMusic * 16], 623);
@@ -2558,7 +2558,7 @@ void MortevielleEngine::displayControlMenu() {
 
 void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
 	GfxSurface surface;
-	surface.decode(&_mem[seg * 16 + dep]);
+	surface.decode(&_mem[(seg * 16) + dep]);
 
 	if (_currGraphicalDevice == MODE_HERCULES) {
 		_mem[(kAdrPictureComp * 16) + 2] = 0;
@@ -2589,7 +2589,7 @@ void MortevielleEngine::adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&_mem[0x73a2 * 16 + 0], 1 * 1664);
+	f.read(&_mem[0x73a2 * 16], 1664);
 	f.close();
 }
 
@@ -2597,12 +2597,12 @@ void MortevielleEngine::adzon() {
  * Returns the offset within the compressed image data resource of the desired image
  */
 int MortevielleEngine::animof(int ouf, int num) {
-	int nani = _mem[kAdrAni * 16 + 1];
+	int nani = _mem[(kAdrAni * 16) + 1];
 	int aux = num;
 	if (ouf != 1)
 		aux += nani;
 
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[kAdrAni * 16 + (aux << 1)]);
+	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[(kAdrAni * 16) + (aux << 1)]);
 
 	return animof_result;
 }
@@ -2981,11 +2981,10 @@ void MortevielleEngine::aniof(int ouf, int num) {
 			num = 3;
 	}
 
-	int ad = kAdrAni;
 	int offset = animof(ouf, num);
 
 	GfxSurface surface;
-	surface.decode(&_mem[ad * 16 + offset]);
+	surface.decode(&_mem[(kAdrAni * 16) + offset]);
 	_screenSurface.drawPicture(surface, 0, 12);
 
 	prepareScreenType1();


Commit: 54459f383a9520bc15b15ec7de6c0fe21e8d1000
    https://github.com/scummvm/scummvm/commit/54459f383a9520bc15b15ec7de6c0fe21e8d1000
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T10:06:25-07:00

Commit Message:
MORTEVIELLE: Get rid of some more magic values

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index b5bb74a..28aa018 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -67,6 +67,11 @@ const int kAdrMusic = 0x5000;
 const int kAdrPictureDecomp = 0x6000;
 const int kAdrPictureComp = 0x7000;
 
+const int kAdrEGA = 0xA000;
+const int kAdrHERC = 0xB000;
+const int kAdrCGA1 = 0xB800;
+const int kAdrCGA2 = 0xBA00;
+
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
 #define lo(v) ((v) & 0xff)


Commit: e5721949608e33947e4026eab85eeb3f71deef4e
    https://github.com/scummvm/scummvm/commit/e5721949608e33947e4026eab85eeb3f71deef4e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T10:07:12-07:00

Commit Message:
MORTEVIELLE: Remove dead code, update comment

Changed paths:
    engines/mortevielle/actions.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 71f0d8f..b95e3eb 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1603,9 +1603,7 @@ void MortevielleEngine::endGame() {
 	testKey(false);
 	// A wait message was displayed.
 	// testKey (aka tkey1) was called before and after.
-	// Most likely the double call is useless, thus removed
-	//
-	// testKey(false);
+	// This double call is useless, thus removed
 	resetVariables();
 }
 


Commit: 7926ab440d75fc3130ef526a3e1cf9e0b79a1303
    https://github.com/scummvm/scummvm/commit/7926ab440d75fc3130ef526a3e1cf9e0b79a1303
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-20T14:58:47-07:00

Commit Message:
MORTEVIELLE: Remove one more magic value, simplify draw()

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index d992fa0..29722a1 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -465,7 +465,7 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
 	_vm->_caff = 50;
 	_vm->_maff = 0;
 	_vm->_text.taffich();
-	_vm->draw(kAdrPictureComp, 63, 12);
+	_vm->draw(63, 12);
 	if (drawFrame2Fl)
 		displayIntroFrame2();
 	else
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 28aa018..44db0d2 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -67,6 +67,8 @@ const int kAdrMusic = 0x5000;
 const int kAdrPictureDecomp = 0x6000;
 const int kAdrPictureComp = 0x7000;
 
+const int kAdrDecBuffer = 0x73A2;
+
 const int kAdrEGA = 0xA000;
 const int kAdrHERC = 0xB000;
 const int kAdrCGA1 = 0xB800;
@@ -520,7 +522,7 @@ public:
 	void gameLoaded();
 	void initGame();
 	void displayAloneText();
-	void draw(int ad, int x, int y);
+	void draw(int x, int y);
 	void charToHour();
 	void hourToChar();
 	Common::String getString(int num);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 20ba38b..d5b777b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2245,7 +2245,7 @@ void MortevielleEngine::showTitleScreen() {
 	if (_newGraphicalDevice != _currGraphicalDevice)
 		_currGraphicalDevice = _newGraphicalDevice;
 	hirs();
-	draw(kAdrPictureComp, 0, 0);
+	draw(0, 0);
 
 	Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
 	_screenSurface.putxy(104 + 72 * _resolutionScaler, 185);
@@ -2256,10 +2256,10 @@ void MortevielleEngine::showTitleScreen() {
  * Draw picture
  * @remarks	Originally called 'dessine'
  */
-void MortevielleEngine::draw(int ad, int x, int y) {
+void MortevielleEngine::draw(int x, int y) {
 	_mouse.hideMouse();
 	setPal(_numpal);
-	pictout(ad, 0, x, y);
+	pictout(kAdrPictureComp, 0, x, y);
 	_mouse.showMouse();
 }
 
@@ -2273,7 +2273,7 @@ void MortevielleEngine::drawRightFrame() {
 		_mem[(kAdrPictureComp * 16) + 14] = 15;
 	}
 	_mouse.hideMouse();
-	pictout(0x73a2, 0, 0, 0);
+	pictout(kAdrDecBuffer, 0, 0, 0);
 	_mouse.showMouse();
 }
 
@@ -2589,7 +2589,7 @@ void MortevielleEngine::adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&_mem[0x73a2 * 16], 1664);
+	f.read(&_mem[kAdrDecBuffer * 16], 1664);
 	f.close();
 }
 
@@ -2997,13 +2997,13 @@ void MortevielleEngine::aniof(int ouf, int num) {
 void MortevielleEngine::drawPicture() {
 	clearUpperLeftPart();
 	if (_caff > 99) {
-		draw(kAdrPictureComp, 60, 33);
+		draw(60, 33);
 		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
 	} else if (_caff > 69) {
-		draw(kAdrPictureComp, 112, 48);           // Heads
+		draw(112, 48);           // Heads
 		_screenSurface.drawBox(222, 47, 155, 92, 15);
 	} else {
-		draw(kAdrPictureComp, 0, 12);
+		draw(0, 12);
 		prepareScreenType1();
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
@@ -3176,7 +3176,7 @@ void MortevielleEngine::mennor() {
 }
 
 void MortevielleEngine::premtet() {
-	draw(kAdrPictureComp, 10, 80);
+	draw(10, 80);
 	_screenSurface.drawBox(18, 79, 155, 91, 15);
 }
 


Commit: a086170d50611e1d9f634063a45a843eaddb2f11
    https://github.com/scummvm/scummvm/commit/a086170d50611e1d9f634063a45a843eaddb2f11
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-21T00:27:15-07:00

Commit Message:
MORTEVIELLE: Remove constants previously used by the mouse code

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 44db0d2..d264942 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -69,11 +69,6 @@ const int kAdrPictureComp = 0x7000;
 
 const int kAdrDecBuffer = 0x73A2;
 
-const int kAdrEGA = 0xA000;
-const int kAdrHERC = 0xB000;
-const int kAdrCGA1 = 0xB800;
-const int kAdrCGA2 = 0xBA00;
-
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
 #define lo(v) ((v) & 0xff)


Commit: 6e0588abf5dd7825e410bc974950bae3a70d92f4
    https://github.com/scummvm/scummvm/commit/6e0588abf5dd7825e410bc974950bae3a70d92f4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-21T10:59:58-07:00

Commit Message:
MORTEVIELLE: Get rid of the last remaining magic values used with _mem

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index d264942..28e342c 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -67,6 +67,9 @@ const int kAdrMusic = 0x5000;
 const int kAdrPictureDecomp = 0x6000;
 const int kAdrPictureComp = 0x7000;
 
+const int kAdrCompMusicBuf1 = 0x7414;
+const int kAdrCompMusicBuf2 = 0x3800;
+const int kAdrUnknownBuf = 0x47a0;
 const int kAdrDecBuffer = 0x73A2;
 
 #define ord(v) ((int) v)
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 7f11ea2..70b017c 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -161,9 +161,9 @@ void SpeechManager::loadMusicSound() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 
-	f.read(&_vm->_mem[0x7414 * 16], 273);
+	f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273);
 
-	_vm->_soundManager.decodeMusic(&_vm->_mem[0x7414 * 16], &_vm->_mem[kAdrNoise * 16], 273);
+	_vm->_soundManager.decodeMusic(&_vm->_mem[kAdrCompMusicBuf1 * 16], &_vm->_mem[kAdrNoise * 16], 273);
 	f.close();
 }
 
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index d5b777b..1a3b1f1 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2212,11 +2212,11 @@ void MortevielleEngine::music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&_mem[0x3800 * 16], 500);
-	fic.read(&_mem[0x47a0 * 16], 123);
+	fic.read(&_mem[kAdrCompMusicBuf2 * 16], 500);
+	fic.read(&_mem[kAdrUnknownBuf * 16], 123);
 	fic.close();
 
-	_soundManager.decodeMusic(&_mem[0x3800 * 16], &_mem[kAdrMusic * 16], 623);
+	_soundManager.decodeMusic(&_mem[kAdrCompMusicBuf2 * 16], &_mem[kAdrMusic * 16], 623);
 	_addFix = (float)((kTempoMusic - 8)) / 256;
 	_speechManager.cctable(_speechManager._tbi);
 


Commit: dd1d81acb3b1fcda519dfdc129d5e8722e9696e4
    https://github.com/scummvm/scummvm/commit/dd1d81acb3b1fcda519dfdc129d5e8722e9696e4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T00:25:08-07:00

Commit Message:
MORTEVIELLE: Fix invalid read size in music code

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 28e342c..5c43894 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -69,7 +69,6 @@ const int kAdrPictureComp = 0x7000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
 const int kAdrCompMusicBuf2 = 0x3800;
-const int kAdrUnknownBuf = 0x47a0;
 const int kAdrDecBuffer = 0x73A2;
 
 #define ord(v) ((int) v)
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 1a3b1f1..a23c444 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2212,8 +2212,7 @@ void MortevielleEngine::music() {
 	if (!fic.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&_mem[kAdrCompMusicBuf2 * 16], 500);
-	fic.read(&_mem[kAdrUnknownBuf * 16], 123);
+	fic.read(&_mem[kAdrCompMusicBuf2 * 16], 623 * 128);
 	fic.close();
 
 	_soundManager.decodeMusic(&_mem[kAdrCompMusicBuf2 * 16], &_mem[kAdrMusic * 16], 623);


Commit: 43a5ed614ea1907122ba29a22ce3c01a953c8263
    https://github.com/scummvm/scummvm/commit/43a5ed614ea1907122ba29a22ce3c01a953c8263
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T01:10:56-07:00

Commit Message:
MORTEVIELLE: Fix some more invalid read sizes

Changed paths:
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 70b017c..7fe8c54 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -161,7 +161,7 @@ void SpeechManager::loadMusicSound() {
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 
-	f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273);
+	f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273 * 128);
 
 	_vm->_soundManager.decodeMusic(&_vm->_mem[kAdrCompMusicBuf1 * 16], &_vm->_mem[kAdrNoise * 16], 273);
 	f.close();
@@ -177,7 +177,7 @@ void SpeechManager::loadPhonemeSounds() {
 	if (!f.open("phbrui.mor"))
 		error("Missing file - phbrui.mor");
 
-	for (int i = 1; i <= 3; ++i)
+	for (int i = 1; i <= f.size() / 2; ++i)
 		_cfiphBuffer[i] = f.readSint16LE();
 
 	f.close();
@@ -194,10 +194,10 @@ void SpeechManager::loadNoise() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&_vm->_mem[kAdrNoise * 16], 250);
+	f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128);
 	for (i = 0; i <= 19013; ++i)
 		_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _vm->_mem[(kAdrNoise5 * 16) + i];
-	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149);
+	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128);
 
 	f.close();
 }


Commit: ecb62e26c1c4e15d364c19be888aa60834ea6bb0
    https://github.com/scummvm/scummvm/commit/ecb62e26c1c4e15d364c19be888aa60834ea6bb0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T01:42:02-07:00

Commit Message:
MORTEVIELLE: Use kAdrPictureComp in displayCGAPattern

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index a23c444..33f9b9b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2026,12 +2026,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&_mem[(kAdrPictureDecomp * 16) + addr], p._tax);
-	WRITE_LE_UINT16(&_mem[(kAdrPictureDecomp * 16) + addr + 2], p._tay);
+	WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + addr], p._tax);
+	WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			_mem[(kAdrPictureDecomp * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			_mem[(kAdrPictureComp * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 


Commit: 60856680d26203dfb2c527e0a2067fe051ac2bc2
    https://github.com/scummvm/scummvm/commit/60856680d26203dfb2c527e0a2067fe051ac2bc2
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T01:59:52-07:00

Commit Message:
MORTEVIELLE: Simplify loadDesFile and loadAniFile

Changed paths:
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 8e27e47..1e25aea 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -133,24 +133,10 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
 
-	int skipBlock = skipSize / 128;
-	skipSize %= 128;
-
-	if (skipBlock != 0)
-		f.seek(skipBlock * 0x80);
-
-	int remainingSkipSize = abs(skipSize);
-	int totalLength = length + remainingSkipSize;
-	int memIndx = kAdrPictureDecomp * 16;
-	while (totalLength > 0) {
-		f.read(&_vm->_mem[memIndx], 128);
-		totalLength -= 128;
-		memIndx += 128;
-	}
+	assert(skipSize + length <= f.size());
+	f.seek(skipSize);
+	f.read(&_vm->_mem[(kAdrPictureComp * 16)], length);
 	f.close();
-
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[(kAdrPictureComp * 16) + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
 }
 
 /**
@@ -162,26 +148,10 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 	if (!f.open(filename))
 		error("Missing file - %s", filename.c_str());
 
-	int skipBlock = 0;
-	while (skipSize > 127) {
-		skipSize = skipSize - 128;
-		++skipBlock;
-	}
-	if (skipBlock != 0)
-		f.seek(skipBlock * 0x80);
-
-	int remainingSkipSize = abs(skipSize);
-	int fullLength = length + remainingSkipSize;
-	int memIndx = kAdrPictureDecomp * 16;
-	while (fullLength > 0) {
-		f.read(&_vm->_mem[memIndx], 128);
-		fullLength -= 128;
-		memIndx += 128;
-	}
+	assert(skipSize + length <= f.size());
+	f.seek(skipSize);
+	f.read(&_vm->_mem[(kAdrAni * 16)], length);
 	f.close();
-
-	for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
-		_vm->_mem[(kAdrAni * 16) + i - remainingSkipSize] = _vm->_mem[(kAdrPictureDecomp * 16) + i];
 }
 
 void TextHandler::taffich() {


Commit: d9893942117c2fcf1679abbc2f9ba6a9809e43bb
    https://github.com/scummvm/scummvm/commit/d9893942117c2fcf1679abbc2f9ba6a9809e43bb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T02:19:02-07:00

Commit Message:
MORTEVIELLE: rename variable name not following naming conventions

Changed paths:
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 1e25aea..c998e68 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -155,7 +155,7 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 }
 
 void TextHandler::taffich() {
-	static const byte _rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
+	static const byte rang[16] = {15, 14, 11, 7, 13, 12, 10, 6, 9, 5, 3, 1, 2, 4, 8, 0};
 
 	static const byte tran1[] = { 121, 121, 138, 139, 120 };
 	static const byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
@@ -266,7 +266,7 @@ void TextHandler::taffich() {
 			for (int j = 0; j <= 15; ++j)
 				if (alllum[j] > alllum[k])
 					k = j;
-			_vm->_mem[(kAdrPictureComp * 16) + 2 + (k << 1)] = _rang[i];
+			_vm->_mem[(kAdrPictureComp * 16) + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
 	}


Commit: b6e74961c251f7b880889ba3da754770ebd3086d
    https://github.com/scummvm/scummvm/commit/b6e74961c251f7b880889ba3da754770ebd3086d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T05:28:53-07:00

Commit Message:
MORTEVIELLE: Fix glitch in one of the head display functions

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 33f9b9b..9961758 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -3176,7 +3176,7 @@ void MortevielleEngine::mennor() {
 
 void MortevielleEngine::premtet() {
 	draw(10, 80);
-	_screenSurface.drawBox(18, 79, 155, 91, 15);
+	_screenSurface.drawBox(18, 79, 155, 92, 15);
 }
 
 void MortevielleEngine::ajchai() {


Commit: 4c66d381d275b282cba72a4c55c66fc510144eb6
    https://github.com/scummvm/scummvm/commit/4c66d381d275b282cba72a4c55c66fc510144eb6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T06:55:21-07:00

Commit Message:
MORTEVIELLE: Fix another glitch in the head display functions

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 9961758..4111a7c 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1398,7 +1398,7 @@ void MortevielleEngine::gotoDiningRoom() {
 		showPeoplePresent(_currBitIndex);
 		_caff = 77;
 		drawPictureWithText();
-		_screenSurface.drawBox(223, 47, 155, 91, 15);
+		_screenSurface.drawBox(223, 47, 155, 92, 15);
 		handleDescriptionText(2, 33);
 		testKey(false);
 		mennor();


Commit: 273a163d834dbae50298cd1bbc8c78dbecc35b20
    https://github.com/scummvm/scummvm/commit/273a163d834dbae50298cd1bbc8c78dbecc35b20
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T14:37:33-07:00

Commit Message:
MORTEVIELLE: Fix Wait and Sleep alerts

Changed paths:
    engines/mortevielle/dialogs.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 29722a1..2536533 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -220,8 +220,8 @@ void DialogManager::decodeAlertDetails(Common::String inputStr, int &choiceNumb,
 		choiceStr += ']';
 		col += 6;
 	}
-	++i;
-	choiceListStr = _vm->copy(inputStr, i, 30);
+
+	choiceListStr = Common::String(inputStr.c_str() + i);
 	if (_vm->_resolutionScaler == 2)
 		col *= 6;
 	else


Commit: 1d3b2db3753f275c28c97d36f9b05dedfa691636
    https://github.com/scummvm/scummvm/commit/1d3b2db3753f275c28c97d36f9b05dedfa691636
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-22T14:59:43-07:00

Commit Message:
MORTEVIELLE: Remove _msg array

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b95e3eb..b2adebf 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -41,13 +41,13 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((_coreVar._currPlace == ROOM26) && (_msg[4] == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == ROOM26) && (_currAction == _menu._moveMenu[6])) {
 		_coreVar._currPlace = LANDING;
 		_caff = _coreVar._currPlace;
 		drawPictureWithText();
 		handleDescriptionText(2, _coreVar._currPlace);
 	}
-	if ((_coreVar._currPlace == LANDING) && (_msg[4] == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == LANDING) && (_currAction == _menu._moveMenu[6])) {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_GO_TO));
 		displayStatusArrow();
@@ -86,7 +86,7 @@ void MortevielleEngine::fctMove() {
 	exitRoom();
 	int menuChoice = 1;
 
-	while (_menu._moveMenu[menuChoice] != _msg[4])
+	while (_menu._moveMenu[menuChoice] != _currAction)
 		++menuChoice;
 
 	if (_coreVar._currPlace == MOUNTAIN) {
@@ -302,7 +302,7 @@ void MortevielleEngine::fctInventoryTake() {
 	int inventIndex = 0;
 	do {
 		++inventIndex;
-	} while (_menu._inventoryMenu[inventIndex] != _msg[4]);
+	} while (_menu._inventoryMenu[inventIndex] != _currAction);
 	int cz = 0;
 	int cy = 0;
 	do {
@@ -582,7 +582,7 @@ void MortevielleEngine::fctOpen() {
 
 	if (_caff == ROOM26) {
 		if (_roomDoorId != OWN_ROOM) {
-			_msg[4] = OPCODE_ENTER;
+			_currAction = OPCODE_ENTER;
 			_syn = true;
 		} else
 			_crep = 997;
@@ -1153,8 +1153,8 @@ void MortevielleEngine::fctEnter() {
 				int charIndex = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
-				_msg[3] = MENU_DISCUSS;
-				_msg[4] = _menu._discussMenu[charIndex];
+				_currMenu = MENU_DISCUSS;
+				_currAction = _menu._discussMenu[charIndex];
 				_syn = true;
 				if (_roomDoorId == ROOM9) {
 					_col = true;
@@ -1354,7 +1354,7 @@ void MortevielleEngine::fctDiscuss() {
 		cx = 0;
 		do {
 			++cx;
-		} while (_menu._discussMenu[cx] != _msg[4]);
+		} while (_menu._discussMenu[cx] != _currAction);
 		_caff = 69 + cx;
 		drawPictureWithText();
 		handleDescriptionText(2, _caff);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a289655..a1f6289 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -482,8 +482,8 @@ void Menu::updateMenu() {
 			//  A menu was clicked on
 			_menuSelected = (_multiTitle) && (_msg4 != OPCODE_NONE);
 			menuUp(_msg3);
-			_vm->_msg[4] = _msg4;
-			_vm->_msg[3] = _msg3;
+			_vm->_currAction = _msg4;
+			_vm->_currMenu = _msg3;
 			_msg3 = OPCODE_NONE;
 			_msg4 = OPCODE_NONE;
 
@@ -540,8 +540,8 @@ void Menu::initMenu(MortevielleEngine *vm) {
 	}
 	_msg3 = OPCODE_NONE;
 	_msg4 = OPCODE_NONE;
-	_vm->_msg[3] = OPCODE_NONE;
-	_vm->_msg[4] = OPCODE_NONE;
+	_vm->_currMenu = OPCODE_NONE;
+	_vm->_currAction = OPCODE_NONE;
 	_vm->setMouseClick(false);
 }
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 5c43894..f12d55b 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -455,7 +455,8 @@ private:
 
 public:
 	Common::Point _prevPos;
-	int  _msg[5];
+	int  _currMenu;
+	int  _currAction;
 	int  _fxxBuffer[108];
 	byte _tabdon[4001];
 	bool _soundOff;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index c998e68..9673917 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -293,7 +293,7 @@ void TextHandler::taffich() {
 		loadAniFile(filename, lgt, handle);
 	}
 	_vm->_mouse.showMouse();
-	if ((a < 27) && ((_vm->_maff < 27) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_msg[4] != OPCODE_ENTER)) {
+	if ((a < 27) && ((_vm->_maff < 27) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != OPCODE_ENTER)) {
 		if ((a == 13) || (a == 14))
 			_vm->displayAloneText();
 		else if (!_vm->_blo)
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 4111a7c..63cd7b3 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -284,18 +284,18 @@ void MortevielleEngine::handleAction() {
 			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
 			return;
 		}
-		if (_menu._menuSelected && (_msg[3] == MENU_SAVE)) {
-			Common::String saveName = Common::String::format("Savegame #%d", _msg[4] & 15);
-			_savegameManager.saveGame(_msg[4] & 15, saveName);
+		if (_menu._menuSelected && (_currMenu == MENU_SAVE)) {
+			Common::String saveName = Common::String::format("Savegame #%d", _currAction & 15);
+			_savegameManager.saveGame(_currAction & 15, saveName);
 		}
-		if (_menu._menuSelected && (_msg[3] == MENU_LOAD))
-			_savegameManager.loadGame((_msg[4] & 15) - 1);
+		if (_menu._menuSelected && (_currMenu == MENU_LOAD))
+			_savegameManager.loadGame((_currAction & 15) - 1);
 		if (inkey == '\103') {       /* F9 */
 			temps = _dialogManager.show(_hintPctMessage, 1);
 			return;
 		} else if (inkey == '\77') {
-			if ((_menuOpcode != OPCODE_NONE) && ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))) {
-				_msg[4] = _menuOpcode;
+			if ((_menuOpcode != OPCODE_NONE) && ((_currMenu == MENU_ACTION) || (_currMenu == MENU_SELF))) {
+				_currAction = _menuOpcode;
 				displayTextInVerbBar(getEngineString(S_IDEM));
 			} else
 				return;
@@ -316,17 +316,17 @@ void MortevielleEngine::handleAction() {
 			if (_num == 9999)
 				_num = 0;
 		} else {
-			_menuOpcode = _msg[3];
-			if ((_msg[3] == MENU_ACTION) || (_msg[3] == MENU_SELF))
-				_menuOpcode = _msg[4];
+			_menuOpcode = _currMenu;
+			if ((_currMenu == MENU_ACTION) || (_currMenu == MENU_SELF))
+				_menuOpcode = _currAction;
 			if (!_anyone) {
 				if ((_heroSearching) || (_obpart)) {
 					if (_mouse._pos.y < 12)
 						return;
 
-					if ((_msg[4] == OPCODE_SOUND) || (_msg[4] == OPCODE_LIFT)) {
+					if ((_currAction == OPCODE_SOUND) || (_currAction == OPCODE_LIFT)) {
 						oo = true;
-						if ((_msg[4] == OPCODE_LIFT) || (_obpart)) {
+						if ((_currAction == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
 							_caff = _coreVar._currPlace;
 							_crep = 998;
@@ -1552,71 +1552,71 @@ void MortevielleEngine::handleOpcode() {
 	_keyPressedEsc = false;
 	if (!_anyone) {
 		if (_uptodatePresence) {
-			if ((_msg[3] == MENU_MOVE) || (_msg[4] == OPCODE_LEAVE) || (_msg[4] == OPCODE_SLEEP) || (_msg[4] == OPCODE_EAT)) {
+			if ((_currMenu == MENU_MOVE) || (_currAction == OPCODE_LEAVE) || (_currAction == OPCODE_SLEEP) || (_currAction == OPCODE_EAT)) {
 				_controlMenu = 4;
 				mennor();
 				return;
 			}
 		}
-		if (_msg[3] == MENU_MOVE)
+		if (_currMenu == MENU_MOVE)
 			fctMove();
-		if (_msg[3] == MENU_DISCUSS)
+		if (_currMenu == MENU_DISCUSS)
 			fctDiscuss();
-		if (_msg[3] == MENU_INVENTORY)
+		if (_currMenu == MENU_INVENTORY)
 			fctInventoryTake();
-		if (_msg[4] == OPCODE_ATTACH)
+		if (_currAction == OPCODE_ATTACH)
 			fctAttach();
-		if (_msg[4] == OPCODE_WAIT)
+		if (_currAction == OPCODE_WAIT)
 			fctWait();
-		if (_msg[4] == OPCODE_FORCE)
+		if (_currAction == OPCODE_FORCE)
 			fctForce();
-		if (_msg[4] == OPCODE_SLEEP)
+		if (_currAction == OPCODE_SLEEP)
 			fctSleep();
-		if (_msg[4] == OPCODE_LISTEN)
+		if (_currAction == OPCODE_LISTEN)
 			fctListen();
-		if (_msg[4] == OPCODE_ENTER)
+		if (_currAction == OPCODE_ENTER)
 			fctEnter();
-		if (_msg[4] == OPCODE_CLOSE)
+		if (_currAction == OPCODE_CLOSE)
 			fctClose();
-		if (_msg[4] == OPCODE_SEARCH)
+		if (_currAction == OPCODE_SEARCH)
 			fctSearch();
-		if (_msg[4] == OPCODE_KNOCK)
+		if (_currAction == OPCODE_KNOCK)
 			fctKnock();
-		if (_msg[4] == OPCODE_SCRATCH)
+		if (_currAction == OPCODE_SCRATCH)
 			fctScratch();
-		if (_msg[4] == OPCODE_READ)
+		if (_currAction == OPCODE_READ)
 			fctRead();
-		if (_msg[4] == OPCODE_EAT)
+		if (_currAction == OPCODE_EAT)
 			fctEat();
-		if (_msg[4] == OPCODE_PLACE)
+		if (_currAction == OPCODE_PLACE)
 			fctPlace();
-		if (_msg[4] == OPCODE_OPEN)
+		if (_currAction == OPCODE_OPEN)
 			fctOpen();
-		if (_msg[4] == OPCODE_TAKE)
+		if (_currAction == OPCODE_TAKE)
 			fctTake();
-		if (_msg[4] == OPCODE_LOOK)
+		if (_currAction == OPCODE_LOOK)
 			fctLook();
-		if (_msg[4] == OPCODE_SMELL)
+		if (_currAction == OPCODE_SMELL)
 			fctSmell();
-		if (_msg[4] == OPCODE_SOUND)
+		if (_currAction == OPCODE_SOUND)
 			fctSound();
-		if (_msg[4] == OPCODE_LEAVE)
+		if (_currAction == OPCODE_LEAVE)
 			fctLeave();
-		if (_msg[4] == OPCODE_LIFT)
+		if (_currAction == OPCODE_LIFT)
 			fctLift();
-		if (_msg[4] == OPCODE_TURN)
+		if (_currAction == OPCODE_TURN)
 			fctTurn();
-		if (_msg[4] == OPCODE_SSEARCH)
+		if (_currAction == OPCODE_SSEARCH)
 			fctSelfSearch();
-		if (_msg[4] == OPCODE_SREAD)
+		if (_currAction == OPCODE_SREAD)
 			fctSelfRead();
-		if (_msg[4] == OPCODE_SPUT)
+		if (_currAction == OPCODE_SPUT)
 			fctSelfPut();
-		if (_msg[4] == OPCODE_SLOOK)
+		if (_currAction == OPCODE_SLOOK)
 			fctSelftLook();
 		_hiddenHero = false;
 
-		if (_msg[4] == OPCODE_SHIDE)
+		if (_currAction == OPCODE_SHIDE)
 			fctSelfHide();
 	} else {
 		if (_anyone) {
@@ -3078,7 +3078,7 @@ void MortevielleEngine::tlu(int af, int ob) {
 	handleDescriptionText(2, 999);
 	testKey(true);
 	_caff = af;
-	_msg[3] = OPCODE_NONE;
+	_currMenu = OPCODE_NONE;
 	_crep = 998;
 }
 
@@ -3171,7 +3171,7 @@ void MortevielleEngine::getSearchDescription(int objId) {
 }
 
 void MortevielleEngine::mennor() {
-	_menu.menuUp(_msg[3]);
+	_menu.menuUp(_currMenu);
 }
 
 void MortevielleEngine::premtet() {
@@ -3241,8 +3241,8 @@ L1:
 		int cx = convertBitIndexToCharacterIndex(_currBitIndex);
 		_caff = 69 + cx;
 		_crep = _caff;
-		_msg[3] = MENU_DISCUSS;
-		_msg[4] = _menu._discussMenu[cx];
+		_currMenu = MENU_DISCUSS;
+		_currAction = _menu._discussMenu[cx];
 		_syn = true;
 		_col = true;
 	} else {
@@ -3387,7 +3387,7 @@ void MortevielleEngine::treg(int objId) {
 	int mdes = _caff;
 	_caff = objId;
 
-	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_msg[4] == OPCODE_SLOOK)) {
+	if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_currAction == OPCODE_SLOOK)) {
 		drawPictureWithText();
 		if ((_caff > 29) && (_caff < 33))
 			handleDescriptionText(2, _caff);
@@ -3395,7 +3395,7 @@ void MortevielleEngine::treg(int objId) {
 			handleDescriptionText(2, _caff + 400);
 		testKey(true);
 		_caff = mdes;
-		_msg[3] = MENU_NONE;
+		_currMenu = MENU_NONE;
 		_crep = 998;
 	} else {
 		_obpart = true;


Commit: 631ed56ba606397d83c362a12ebe110759ca0b4e
    https://github.com/scummvm/scummvm/commit/631ed56ba606397d83c362a12ebe110759ca0b4e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T00:13:32-07:00

Commit Message:
MORTEVIELLE: Janitorial: Misc cosmetic changes

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/saveload.h



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b2adebf..62caa48 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -609,10 +609,10 @@ void MortevielleEngine::fctOpen() {
 		} while (!((tmpPlace > 6) || (_openObjects[tmpPlace] == 0) || (_openObjects[tmpPlace] == _num)));
 		if (_openObjects[tmpPlace] != _num) {
 			if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM)
-				                 || (_coreVar._currPlace == ROOM9) 
-								 || (_coreVar._currPlace == BLUE_ROOM) 
+				                 || (_coreVar._currPlace == ROOM9)
+								 || (_coreVar._currPlace == BLUE_ROOM)
 								 || (_coreVar._currPlace == BATHROOM)))
-			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) 
+			    || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM)
 				                 || (_coreVar._currPlace == PURPLE_ROOM)
 								 || (_coreVar._currPlace == RED_ROOM)))
 				|| ((_coreVar._currPlace == DARKBLUE_ROOM) && (_num == 5))
@@ -1344,7 +1344,7 @@ void MortevielleEngine::fctDiscuss() {
 	int x, y;
 	Common::String lib[47];
 
-	int choice; 
+	int choice;
 	int displId;
 
 	endSearch();
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 418b0a0..3a839a2 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -354,7 +354,7 @@ Common::Error MortevielleEngine::run() {
 
 	// Run the main game loop
 	mainGame();
-	
+
 	// Cleanup (allocated in initialize())
 	_screenSurface.free();
 	free(_speechManager._cfiphBuffer);
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 9673917..c74165e 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -263,9 +263,10 @@ void TextHandler::taffich() {
 		}
 		for (int i = 0; i <= 15; ++i) {
 			int k = 0;
-			for (int j = 0; j <= 15; ++j)
+			for (int j = 0; j <= 15; ++j) {
 				if (alllum[j] > alllum[k])
 					k = j;
+			}
 			_vm->_mem[(kAdrPictureComp * 16) + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index a4b0786..514aae3 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -42,7 +42,7 @@ private:
 public:
 	void setParent(MortevielleEngine *vm);
 	void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-	void loadDesFile(Common::String filename, int32 passe, int long_);
+	void loadDesFile(Common::String filename, int32 skipSize, int length);
 	void loadAniFile(Common::String filename, int32 skipSize, int length);
 	void taffich();
 };
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index 6613b62..0121a04 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -61,7 +61,7 @@ public:
 	Common::Error loadGame(const Common::String &filename);
 	Common::Error saveGame(int n, const Common::String &saveName);
 	Common::Error loadGame(int slot);
-	Common::Error saveGame(int slot);	
+	Common::Error saveGame(int slot);
 
 	void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
 	static bool readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header);


Commit: 54d33bea2cca1a5d7fa4f344a8776d78d934d480
    https://github.com/scummvm/scummvm/commit/54d33bea2cca1a5d7fa4f344a8776d78d934d480
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T00:31:47-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index f12d55b..04ecd56 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -457,7 +457,7 @@ public:
 	Common::Point _prevPos;
 	int  _currMenu;
 	int  _currAction;
-	int  _fxxBuffer[108];
+	int  _drawingSizeArr[108];
 	byte _tabdon[4001];
 	bool _soundOff;
 	bool _blo;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index c74165e..3164b51 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -160,8 +160,8 @@ void TextHandler::taffich() {
 	static const byte tran1[] = { 121, 121, 138, 139, 120 };
 	static const byte tran2[] = { 150, 150, 152, 152, 100, 110, 159, 100, 100 };
 
-	int cx, handle, npal;
-	int32 lgt;
+	int cx, drawingSize, npal;
+	int32 drawingStartPos;
 	int alllum[16];
 
 	int a = _vm->_caff;
@@ -213,7 +213,7 @@ void TextHandler::taffich() {
 
 	_vm->_destinationOk = true;
 	_vm->_mouse.hideMouse();
-	lgt = 0;
+	drawingStartPos = 0;
 	Common::String filename;
 
 	if ((a != 50) && (a != 51)) {
@@ -237,8 +237,8 @@ void TextHandler::taffich() {
 		npal = a;
 
 		for (cx = 0; cx <= (a - 1); ++cx)
-			lgt += _vm->_fxxBuffer[cx];
-		handle = _vm->_fxxBuffer[a];
+			drawingStartPos += _vm->_drawingSizeArr[cx];
+		drawingSize = _vm->_drawingSizeArr[a];
 
 		filename = "DXX.mor";
 	} else {
@@ -247,15 +247,15 @@ void TextHandler::taffich() {
 		else
 			filename = "DZZ.mor";
 
-		handle = _vm->_fxxBuffer[87];
+		drawingSize = _vm->_drawingSizeArr[87];
 		if (a == 51) {
-			lgt = handle;
-			handle = _vm->_fxxBuffer[88];
+			drawingStartPos = drawingSize;
+			drawingSize = _vm->_drawingSizeArr[88];
 		}
 		_vm->_maff = a;
 		npal = a + 37;
 	}
-	loadDesFile(filename, lgt, handle);
+	loadDesFile(filename, drawingStartPos, drawingSize);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
 			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrPictureComp * 16) + 2 + (i << 1)]);
@@ -275,7 +275,7 @@ void TextHandler::taffich() {
 	_vm->setPal(npal);
 
 	if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26) || (b == 50)) {
-		lgt = 0;
+		drawingStartPos = 0;
 		if ((b < 15) || (b == 16) || (b == 17) || (b == 24) || (b == 26)) {
 			if (b == 26)
 				b = 18;
@@ -284,14 +284,17 @@ void TextHandler::taffich() {
 			else if (b > 15)
 				--b;
 			for (cx = 0; cx <= (b - 1); ++cx)
-				lgt += _vm->_fxxBuffer[cx + 89];
-			handle = _vm->_fxxBuffer[b + 89];
+				drawingStartPos += _vm->_drawingSizeArr[cx + 89];
+			drawingSize = _vm->_drawingSizeArr[b + 89];
 			filename = "AXX.mor";
 		} else if (b == 50) {
+			// CHECKME: the size of AZZ.mor is 1280 for the DOS version
+			//          and 1260 for the Amiga version. Maybe the 20 bytes 
+			//          are a filler, or the size should be variable.
+			drawingSize = 1260;
 			filename = "AZZ.mor";
-			handle = 1260;
 		}
-		loadAniFile(filename, lgt, handle);
+		loadAniFile(filename, drawingStartPos, drawingSize);
 	}
 	_vm->_mouse.showMouse();
 	if ((a < 27) && ((_vm->_maff < 27) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != OPCODE_ENTER)) {
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 63cd7b3..a0749a9 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2051,7 +2051,7 @@ void MortevielleEngine::loadPalette() {
 	}
 
 	for (int i = 0; i < 108; ++i)
-		_fxxBuffer[i] = f.readSint16LE();
+		_drawingSizeArr[i] = f.readSint16LE();
 	f.close();
 
 	if (!f.open("plxx.mor"))


Commit: ba78fcbe748838ad95c920e3e612d6a583832fa7
    https://github.com/scummvm/scummvm/commit/ba78fcbe748838ad95c920e3e612d6a583832fa7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T00:41:59-07:00

Commit Message:
MORTEVIELLE: Clarify a part of taffich

Changed paths:
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 3164b51..e14fff0 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -247,9 +247,11 @@ void TextHandler::taffich() {
 		else
 			filename = "DZZ.mor";
 
-		drawingSize = _vm->_drawingSizeArr[87];
-		if (a == 51) {
-			drawingStartPos = drawingSize;
+		if (a == 50) {
+			drawingStartPos = 0;
+			drawingSize = _vm->_drawingSizeArr[87];
+		} else { // a == 51
+			drawingStartPos = _vm->_drawingSizeArr[87];
 			drawingSize = _vm->_drawingSizeArr[88];
 		}
 		_vm->_maff = a;
@@ -290,7 +292,8 @@ void TextHandler::taffich() {
 		} else if (b == 50) {
 			// CHECKME: the size of AZZ.mor is 1280 for the DOS version
 			//          and 1260 for the Amiga version. Maybe the 20 bytes 
-			//          are a filler, or the size should be variable.
+			//          are a filler (to get 10 blocks of 128 bytes), 
+			//          or the size should be variable.
 			drawingSize = 1260;
 			filename = "AZZ.mor";
 		}


Commit: aca4d016289dc653206f4e3644f35b5884274a14
    https://github.com/scummvm/scummvm/commit/aca4d016289dc653206f4e3644f35b5884274a14
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T01:18:08-07:00

Commit Message:
MORTEVIELLE: Some more renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 62caa48..0d2d8b4 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -474,7 +474,7 @@ void MortevielleEngine::fctSelftLook() {
  * @remarks	Originally called 'tfouiller'
  */
 void MortevielleEngine::fctSearch() {
-	static const byte r[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
+	static const byte answerArr[14] = {123, 104, 123, 131, 131, 123, 104, 131, 123, 123, 106, 123, 123, 107};
 
 	if (_caff > 99) {
 		getSearchDescription(_caff);
@@ -542,7 +542,7 @@ void MortevielleEngine::fctSearch() {
 			_coreVar._faithScore += 3;
 		_crep = 997;
 		if (_coreVar._currPlace < CELLAR)
-			_crep = r[_coreVar._currPlace];
+			_crep = answerArr[_coreVar._currPlace];
 
 		if ((_coreVar._currPlace == TOILETS) && (_num == 2))
 			_crep = 162;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index e14fff0..3afab7c 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -289,7 +289,7 @@ void TextHandler::taffich() {
 				drawingStartPos += _vm->_drawingSizeArr[cx + 89];
 			drawingSize = _vm->_drawingSizeArr[b + 89];
 			filename = "AXX.mor";
-		} else if (b == 50) {
+		} else { // b == 50
 			// CHECKME: the size of AZZ.mor is 1280 for the DOS version
 			//          and 1260 for the Amiga version. Maybe the 20 bytes 
 			//          are a filler (to get 10 blocks of 128 bytes), 
@@ -300,8 +300,8 @@ void TextHandler::taffich() {
 		loadAniFile(filename, drawingStartPos, drawingSize);
 	}
 	_vm->_mouse.showMouse();
-	if ((a < 27) && ((_vm->_maff < 27) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != OPCODE_ENTER)) {
-		if ((a == 13) || (a == 14))
+	if ((a < COAT_ARMS) && ((_vm->_maff < COAT_ARMS) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != OPCODE_ENTER)) {
+		if ((a == ATTIC) || (a == CELLAR))
 			_vm->displayAloneText();
 		else if (!_vm->_blo)
 			_vm->getPresence(_vm->_coreVar._currPlace);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index a0749a9..c9b40c4 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -254,10 +254,11 @@ void MortevielleEngine::handleAction() {
 	const int lim = 20000;
 	int temps = 0;
 	char inkey = '\0';
-	bool oo, funct = 0;
+	bool funct = false;
 
 	clearVerbBar();
-	oo = false;
+
+	bool handledOpcodeFl = false;
 	_controlMenu = 0;
 	if (!_keyPressedEsc) {
 		_menu.drawMenu();
@@ -325,7 +326,7 @@ void MortevielleEngine::handleAction() {
 						return;
 
 					if ((_currAction == OPCODE_SOUND) || (_currAction == OPCODE_LIFT)) {
-						oo = true;
+						handledOpcodeFl = true;
 						if ((_currAction == OPCODE_LIFT) || (_obpart)) {
 							endSearch();
 							_caff = _coreVar._currPlace;
@@ -337,7 +338,7 @@ void MortevielleEngine::handleAction() {
 				}
 			}
 			do {
-				if (! oo)
+				if (!handledOpcodeFl)
 					handleOpcode();
 
 				if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {


Commit: 392ab0e9ab4ab73fe4221fff5c70c4fa167bc22b
    https://github.com/scummvm/scummvm/commit/392ab0e9ab4ab73fe4221fff5c70c4fa167bc22b
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T01:44:33-07:00

Commit Message:
MORTEVIELLE: Improve question cheat in debugger

Changed paths:
    engines/mortevielle/debugger.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index 042eb0e..5e1e335 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -38,6 +38,11 @@ bool Debugger::Cmd_showAllQuestions(int argc, const char **argv) {
 	for (int i = 1; i <= 42; ++i)
 		_vm->_coreVar._availableQuestion[i] = '*';
 
+	for (int i = 0; i < 9; i++) {
+		_vm->_nbrep[i] = 0;
+		_vm->_nbrepm[i] = 999;
+	}
+
 	return true;
 }
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 04ecd56..c198b24 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -285,8 +285,6 @@ private:
 	byte  *_cfiecBuffer;
 	int    _cfiecBufferSize;
 	int    _openObjects[8];
-	int    _nbrep[9];
-	int    _nbrepm[9];
 	uint16 _dialogIndexArray[kMaxDialogIndex + 1];
 	Hint   _dialogHintArray[kMaxDialogHint + 1];
 
@@ -471,6 +469,8 @@ public:
 	int  _key;
 	SaveStruct _coreVar, _saveStruct;
 
+	int _nbrep[9];
+	int _nbrepm[9];
 	int _maff;
 	int _caff;
 	int _crep;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index c9b40c4..e07623b 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2300,13 +2300,11 @@ void MortevielleEngine::prepareRoom() {
 	updateHour(day, hour, minute);
 	if (day != _day) {
 		_day = day;
-		int i = 0;
-		do {
-			++i;
-			if (_nbrepm[i] != 0)
+		for (int i = 0; i < 9; i++) {
+			if (_nbrepm[i] > 0)
 				--_nbrepm[i];
 			_nbrep[i] = 0;
-		} while (i != 8);
+		}
 	}
 	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
 		_hour = hour;


Commit: b1389f85ec6165646f5120fe23fc89acd273d4e7
    https://github.com/scummvm/scummvm/commit/b1389f85ec6165646f5120fe23fc89acd273d4e7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T01:51:42-07:00

Commit Message:
MORTEVIELLE: Renaming fields and functions related to the number of answers per character

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/debugger.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 0d2d8b4..9a29bbf 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -1484,10 +1484,10 @@ void MortevielleEngine::fctDiscuss() {
 					displId = 138;
 					_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
 				}
-			} else if (_nbrep[_caff - 69] < _nbrepm[_caff - 69]) {
+			} else if (_charAnswerCount[_caff - 69] < _charAnswerMax[_caff - 69]) {
 				displId = _tabdon[kArep + (ix << 3) + (_caff - 70)];
 				_coreVar._faithScore += _tabdon[kArcf + ix];
-				++_nbrep[_caff - 69];
+				++_charAnswerCount[_caff - 69];
 			} else {
 				_coreVar._faithScore += 3;
 				displId = 139;
diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index 5e1e335..4ef5151 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -39,8 +39,8 @@ bool Debugger::Cmd_showAllQuestions(int argc, const char **argv) {
 		_vm->_coreVar._availableQuestion[i] = '*';
 
 	for (int i = 0; i < 9; i++) {
-		_vm->_nbrep[i] = 0;
-		_vm->_nbrepm[i] = 999;
+		_vm->_charAnswerCount[i] = 0;
+		_vm->_charAnswerMax[i] = 999;
 	}
 
 	return true;
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 3a839a2..c13eba4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -206,7 +206,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
 	loadCFIEC();
 	decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
 	_x26KeyCount = 1;
-	init_nbrepm();
+	initMaxAnswer();
 	initMouse();
 
 	loadPlaces();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index c198b24..45a0614 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -443,7 +443,7 @@ private:
 	void premtet();
 	void ajchai();
 	void ecr2(Common::String text);
-	void init_nbrepm();
+	void initMaxAnswer();
 	void aniof(int ouf, int num);
 	void tlu(int af, int ob);
 	void mennor();
@@ -456,6 +456,8 @@ public:
 	int  _currMenu;
 	int  _currAction;
 	int  _drawingSizeArr[108];
+	int  _charAnswerCount[9];
+	int  _charAnswerMax[9];
 	byte _tabdon[4001];
 	bool _soundOff;
 	bool _blo;
@@ -469,8 +471,6 @@ public:
 	int  _key;
 	SaveStruct _coreVar, _saveStruct;
 
-	int _nbrep[9];
-	int _nbrepm[9];
 	int _maff;
 	int _caff;
 	int _crep;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index e07623b..094e102 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1983,9 +1983,9 @@ void MortevielleEngine::resetVariables() {
 	_coreVar._availableQuestion[33] = '*';
 
 	for (int i = 1; i <= 8; ++i)
-		_nbrep[i] = 0;
+		_charAnswerCount[i] = 0;
 
-	init_nbrepm();
+	initMaxAnswer();
 }
 
 /**
@@ -2301,9 +2301,9 @@ void MortevielleEngine::prepareRoom() {
 	if (day != _day) {
 		_day = day;
 		for (int i = 0; i < 9; i++) {
-			if (_nbrepm[i] > 0)
-				--_nbrepm[i];
-			_nbrep[i] = 0;
+			if (_charAnswerMax[i] > 0)
+				--_charAnswerMax[i];
+			_charAnswerCount[i] = 0;
 		}
 	}
 	if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
@@ -2879,11 +2879,15 @@ void MortevielleEngine::setPresenceFlags(int roomId) {
 		_room9PresenceLeo = true;
 }
 
-void MortevielleEngine::init_nbrepm() {
-	static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
+/**
+ * Initialize max answers per character
+ * @remarks	Originally called 'init_nbrepm'
+ */
+void MortevielleEngine::initMaxAnswer() {
+	static const byte maxAnswer[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
 
 	for (int idx = 0; idx < 9; ++idx)
-		_nbrepm[idx] = ipm[idx];
+		_charAnswerMax[idx] = maxAnswer[idx];
 }
 
 void MortevielleEngine::phaz(int &rand, int &p, int cf) {


Commit: 2955347cd781f28c389f9e7f9264ab993c421f80
    https://github.com/scummvm/scummvm/commit/2955347cd781f28c389f9e7f9264ab993c421f80
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T06:03:47-07:00

Commit Message:
MORTEVIELLE: Get rid of phaz, Fix an uninitialized variable in setRandomPresenceRoom9

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 45a0614..371c812 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -314,7 +314,7 @@ private:
 	void displayControlMenu();
 	void displayItemInHand(int objId);
 	void resetRoomVariables(int roomId);
-	int  getPresenceStats(int &rand, int cf, int roomId);
+	int  getPresenceStats(int &rand, int faithScore, int roomId);
 	void setPresenceFlags(int roomId);
 	void testKey(bool d);
 	void exitRoom();
@@ -375,17 +375,17 @@ private:
 	int  setPresenceKitchen();
 	int  setPresenceLanding();
 	int  setPresenceChapel(int hour);
-	void setRandomPresenceGreenRoom(int cf);
-	void setRandomPresencePurpleRoom(int cf);
-	void setRandomPresenceBlueRoom(int cf);
-	void setRandomPresenceRedRoom(int cf);
-	void setRandomPresenceRoom9(int cf);
-	void setRandomPresenceDiningRoom(int cf);
-	void setRandomPresenceBureau(int cf);
-	void setRandomPresenceKitchen(int cf);
-	void setRandomPresenceAttic(int cf);
-	void setRandomPresenceLanding(int cf);
-	void setRandomPresenceChapel(int cf);
+	void setRandomPresenceGreenRoom(int faithScore);
+	void setRandomPresencePurpleRoom(int faithScore);
+	void setRandomPresenceBlueRoom(int faithScore);
+	void setRandomPresenceRedRoom(int faithScore);
+	void setRandomPresenceRoom9(int faithScore);
+	void setRandomPresenceDiningRoom(int faithScore);
+	void setRandomPresenceBureau(int faithScore);
+	void setRandomPresenceKitchen(int faithScore);
+	void setRandomPresenceAttic(int faithScore);
+	void setRandomPresenceLanding(int faithScore);
+	void setRandomPresenceChapel(int faithScore);
 	void loadPlaces();
 	void resetPresenceInRooms(int roomId);
 	void showPeoplePresent(int bitIndex);
@@ -439,7 +439,6 @@ private:
 
 	void copcha();
 	void adzon();
-	void phaz(int &rand, int &p, int cf);
 	void premtet();
 	void ajchai();
 	void ecr2(Common::String text);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 094e102..5bf84d9 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -698,8 +698,8 @@ int MortevielleEngine::getPresenceStatsRedRoom() {
  * @remarks	Originally called 'person'
  */
 void MortevielleEngine::displayAloneText() {
-	for (int cf = 1; cf <= 8; ++cf)
-		_menu.disableMenuItem(_menu._discussMenu[cf]);
+	for (int i = 1; i <= 8; ++i)
+		_menu.disableMenuItem(_menu._discussMenu[i]);
 
 	Common::String sYou = getEngineString(S_YOU);
 	Common::String sAre = getEngineString(S_ARE);
@@ -1090,14 +1090,12 @@ void MortevielleEngine::initGame() {
  * Engine function - Set Random Presence - Green Room
  * @remarks	Originally called 'pl1'
  */
-void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
+void MortevielleEngine::setRandomPresenceGreenRoom(int faithScore) {
 	if ( ((_place == GREEN_ROOM) && (!_roomPresenceLuc) && (!_roomPresenceIda))
 	  || ((_place == DARKBLUE_ROOM) && (!_roomPresenceGuy) && (!_roomPresenceEva)) ) {
 		int p = getPresenceStatsGreenRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
+		p += faithScore;
+		if (getRandomNumber(1, 100) > p)
 			displayAloneText();
 		else
 			setPresenceGreenRoom(_place);
@@ -1108,13 +1106,11 @@ void MortevielleEngine::setRandomPresenceGreenRoom(int cf) {
  * Engine function - Set Random Presence - Purple Room
  * @remarks	Originally called 'pl2'
  */
-void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
+void MortevielleEngine::setRandomPresencePurpleRoom(int faithScore) {
 	if (!_purpleRoomPresenceLeo) {
 		int p = getPresenceStatsPurpleRoom();
-		int rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
+		p += faithScore;
+		if (getRandomNumber(1, 100) > p)
 			displayAloneText();
 		else
 			setPresencePurpleRoom();
@@ -1125,14 +1121,11 @@ void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
  * Engine function - Set Random Presence - Blue Room
  * @remarks	Originally called 'pl5'
  */
-void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
+void MortevielleEngine::setRandomPresenceBlueRoom(int faithScore) {
 	if (!_roomPresenceMax) {
 		int p = getPresenceStatsBlueRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
+		p += faithScore;
+		if (getRandomNumber(1, 100) > p)
 			displayAloneText();
 		else
 			setPresenceBlueRoom();
@@ -1143,15 +1136,12 @@ void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
  * Engine function - Set Random Presence - Red Room
  * @remarks	Originally called 'pl6'
  */
-void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
+void MortevielleEngine::setRandomPresenceRedRoom(int faithScore) {
 	if ( ((_place == RED_ROOM) && (!_roomPresenceBob))
 	  || ((_place == GREEN_ROOM2) && (!_roomPresencePat)) ) {
 		int p = getPresenceStatsRedRoom();
-		int rand;
-
-		phaz(rand, p, cf);
-
-		if (rand > p)
+		p += faithScore;
+		if (getRandomNumber(1, 100) > p)
 			displayAloneText();
 		else
 			setPresenceRedRoom(_place);
@@ -1162,13 +1152,10 @@ void MortevielleEngine::setRandomPresenceRedRoom(int cf) {
  * Engine function - Set Random Presence - Room 9
  * @remarks	Originally called 'pl9'
  */
-void MortevielleEngine::setRandomPresenceRoom9(int cf) {
+void MortevielleEngine::setRandomPresenceRoom9(int faithScore) {
 	if (!_room9PresenceLeo) {
-		cf = -10;
-		int p, rand;
-		phaz(rand, p, cf);
-
-		if (rand > p)
+		faithScore = -10;
+		if (getRandomNumber(1, 100) > faithScore) // always true?
 			displayAloneText();
 		else
 			setPresencePurpleRoom();
@@ -1179,12 +1166,11 @@ void MortevielleEngine::setRandomPresenceRoom9(int cf) {
  * Engine function - Set Random Presence - Dining Room
  * @remarks	Originally called 'pl10'
  */
-void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
-	int h, rand;
+void MortevielleEngine::setRandomPresenceDiningRoom(int faithScore) {
+	int h;
 	int p = getPresenceStatsDiningRoom(h);
-	phaz(rand, p, cf);
-
-	if (rand > p)
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceDiningRoom(h);
@@ -1194,12 +1180,12 @@ void MortevielleEngine::setRandomPresenceDiningRoom(int cf) {
  * Engine function - Set Random Presence - Bureau
  * @remarks	Originally called 'pl11'
  */
-void MortevielleEngine::setRandomPresenceBureau(int cf) {
-	int h, rand;
+void MortevielleEngine::setRandomPresenceBureau(int faithScore) {
+	int h;
 
 	int p = getPresenceStatsBureau(h);
-	phaz(rand, p, cf);
-	if (rand > p)
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceBureau(h);
@@ -1209,12 +1195,11 @@ void MortevielleEngine::setRandomPresenceBureau(int cf) {
  * Engine function - Set Random Presence - Kitchen
  * @remarks	Originally called 'pl12'
  */
-void MortevielleEngine::setRandomPresenceKitchen(int cf) {
-	int p, rand;
+void MortevielleEngine::setRandomPresenceKitchen(int faithScore) {
 
-	p = getPresenceStatsKitchen();
-	phaz(rand, p, cf);
-	if (rand > p)
+	int p = getPresenceStatsKitchen();
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceKitchen();
@@ -1224,12 +1209,10 @@ void MortevielleEngine::setRandomPresenceKitchen(int cf) {
  * Engine function - Set Random Presence - Attic / Cellar
  * @remarks	Originally called 'pl13'
  */
-void MortevielleEngine::setRandomPresenceAttic(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsAttic();
-	phaz(rand, p, cf);
-	if (rand > p)
+void MortevielleEngine::setRandomPresenceAttic(int faithScore) {
+	int p = getPresenceStatsAttic();
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceKitchen();
@@ -1239,12 +1222,10 @@ void MortevielleEngine::setRandomPresenceAttic(int cf) {
  * Engine function - Set Random Presence - Landing
  * @remarks	Originally called 'pl15'
  */
-void MortevielleEngine::setRandomPresenceLanding(int cf) {
-	int p, rand;
-
-	p = getPresenceStatsLanding();
-	phaz(rand, p, cf);
-	if (rand > p)
+void MortevielleEngine::setRandomPresenceLanding(int faithScore) {
+	int p = getPresenceStatsLanding();
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceLanding();
@@ -1254,12 +1235,12 @@ void MortevielleEngine::setRandomPresenceLanding(int cf) {
  * Engine function - Set Random Presence - Chapel
  * @remarks	Originally called 'pl20'
  */
-void MortevielleEngine::setRandomPresenceChapel(int cf) {
-	int h, rand;
+void MortevielleEngine::setRandomPresenceChapel(int faithScore) {
+	int h;
 
 	int p = getPresenceStatsChapel(h);
-	phaz(rand, p, cf);
-	if (rand > p)
+	p += faithScore;
+	if (getRandomNumber(1, 100) > p)
 		displayAloneText();
 	else
 		setPresenceChapel(h);
@@ -2814,7 +2795,7 @@ void MortevielleEngine::resetRoomVariables(int roomId) {
  * Compute presence stats
  * @remarks	Originally called 'ecfren'
  */
-int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
+int MortevielleEngine::getPresenceStats(int &rand, int faithScore, int roomId) {
 	if (roomId == OWN_ROOM)
 		displayAloneText();
 	int retVal = -500;
@@ -2838,7 +2819,7 @@ int MortevielleEngine::getPresenceStats(int &rand, int cf, int roomId) {
 	  || ((roomId == ROOM9) && (_purpleRoomPresenceLeo)))
 		retVal = -400;
 	if (retVal != -500) {
-		retVal += cf;
+		retVal += faithScore;
 		rand = getRandomNumber(1, 100);
 	}
 
@@ -2890,11 +2871,6 @@ void MortevielleEngine::initMaxAnswer() {
 		_charAnswerMax[idx] = maxAnswer[idx];
 }
 
-void MortevielleEngine::phaz(int &rand, int &p, int cf) {
-	p += cf;
-	rand = getRandomNumber(1, 100);
-}
-
 /**
  * Get Presence
  * @remarks	Originally called 't11'


Commit: 628cd26487c3596b4560c6d83b1ca23c6bdbbdf6
    https://github.com/scummvm/scummvm/commit/628cd26487c3596b4560c6d83b1ca23c6bdbbdf6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-23T08:19:16-07:00

Commit Message:
MORTEVIELLE: Give a better name to kAdrDecBuffer

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 371c812..6f77643 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -69,7 +69,7 @@ const int kAdrPictureComp = 0x7000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
 const int kAdrCompMusicBuf2 = 0x3800;
-const int kAdrDecBuffer = 0x73A2;
+const int kAdrRightFramePic = 0x73A2;
 
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 5bf84d9..0cad163 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2254,7 +2254,7 @@ void MortevielleEngine::drawRightFrame() {
 		_mem[(kAdrPictureComp * 16) + 14] = 15;
 	}
 	_mouse.hideMouse();
-	pictout(kAdrDecBuffer, 0, 0, 0);
+	pictout(kAdrRightFramePic, 0, 0, 0);
 	_mouse.showMouse();
 }
 
@@ -2562,13 +2562,14 @@ void MortevielleEngine::adzon() {
 	if (!f.open("bmor.mor"))
 		error("Missing file - bmor.mor");
 
-	f.read(&_tabdon[kFleche], 1 * 1916);
+	f.read(&_tabdon[kFleche], 1916);
 	f.close();
 
+	// Read Right Frame Drawing
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&_mem[kAdrDecBuffer * 16], 1664);
+	f.read(&_mem[kAdrRightFramePic * 16], 1664);
 	f.close();
 }
 


Commit: 14aa4b7a93f9074ab0a3b8bbb9ea3cffe04959c7
    https://github.com/scummvm/scummvm/commit/14aa4b7a93f9074ab0a3b8bbb9ea3cffe04959c7
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T03:30:58-07:00

Commit Message:
MORTEVIELLE: Remove useless constant, rename another one

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index f967ad9..cb674a2 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -937,7 +937,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &_vm->_mem[(kAdrPictureComp * 16) + 2];
+	const byte *paletteMap = &_vm->_mem[(kAdrCurrentPicture * 16) + 2];
 
 	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6f77643..347b921 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -64,8 +64,7 @@ namespace Mortevielle {
  * 7000:4138 - width, height, x/y offset of decoded image
  */
 const int kAdrMusic = 0x5000;
-const int kAdrPictureDecomp = 0x6000;
-const int kAdrPictureComp = 0x7000;
+const int kAdrCurrentPicture = 0x7000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
 const int kAdrCompMusicBuf2 = 0x3800;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 3afab7c..311a4c2 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -135,7 +135,7 @@ void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int lengt
 
 	assert(skipSize + length <= f.size());
 	f.seek(skipSize);
-	f.read(&_vm->_mem[(kAdrPictureComp * 16)], length);
+	f.read(&_vm->_mem[(kAdrCurrentPicture * 16)], length);
 	f.close();
 }
 
@@ -260,7 +260,7 @@ void TextHandler::taffich() {
 	loadDesFile(filename, drawingStartPos, drawingSize);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrPictureComp * 16) + 2 + (i << 1)]);
+			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrCurrentPicture * 16) + 2 + (i << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -269,7 +269,7 @@ void TextHandler::taffich() {
 				if (alllum[j] > alllum[k])
 					k = j;
 			}
-			_vm->_mem[(kAdrPictureComp * 16) + 2 + (k << 1)] = rang[i];
+			_vm->_mem[(kAdrCurrentPicture * 16) + 2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 0cad163..87bcc87 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1979,8 +1979,8 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			_mem[(kAdrPictureComp * 16) + (2 * i)] = _stdPal[n][i].x;
-			_mem[(kAdrPictureComp * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+			_mem[(kAdrCurrentPicture * 16) + (2 * i)] = _stdPal[n][i].x;
+			_mem[(kAdrCurrentPicture * 16) + (2 * i) + 1] = _stdPal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
@@ -2008,12 +2008,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + addr], p._tax);
-	WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + addr + 2], p._tay);
+	WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + addr], p._tax);
+	WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			_mem[(kAdrPictureComp * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			_mem[(kAdrCurrentPicture * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 
@@ -2240,7 +2240,7 @@ void MortevielleEngine::showTitleScreen() {
 void MortevielleEngine::draw(int x, int y) {
 	_mouse.hideMouse();
 	setPal(_numpal);
-	pictout(kAdrPictureComp, 0, x, y);
+	pictout(kAdrCurrentPicture, 0, x, y);
 	_mouse.showMouse();
 }
 
@@ -2251,7 +2251,7 @@ void MortevielleEngine::draw(int x, int y) {
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[(kAdrPictureComp * 16) + 14] = 15;
+		_mem[(kAdrCurrentPicture * 16) + 14] = 15;
 	}
 	_mouse.hideMouse();
 	pictout(kAdrRightFramePic, 0, 0, 0);
@@ -2540,12 +2540,12 @@ void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
 	surface.decode(&_mem[(seg * 16) + dep]);
 
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[(kAdrPictureComp * 16) + 2] = 0;
-		_mem[(kAdrPictureComp * 16) + 32] = 15;
+		_mem[(kAdrCurrentPicture * 16) + 2] = 0;
+		_mem[(kAdrCurrentPicture * 16) + 32] = 15;
 	}
 
-	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrPictureComp * 16) + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&_mem[(kAdrPictureComp * 16) + 0x4138], 0x100);
+	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138]) > 0x100))
+		WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138], 0x100);
 
 	_screenSurface.drawPicture(surface, x, y);
 }


Commit: 3f21318cea0a0fbe8aa4d565bb2bdb52743228b4
    https://github.com/scummvm/scummvm/commit/3f21318cea0a0fbe8aa4d565bb2bdb52743228b4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T04:16:28-07:00

Commit Message:
MORTEVIELLE: Remove useless define

Changed paths:
    engines/mortevielle/mortevielle.h



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 347b921..4fd096a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -75,7 +75,6 @@ const int kAdrRightFramePic = 0x73A2;
 #define lo(v) ((v) & 0xff)
 #define hi(v) (((v) >> 8) & 0xff)
 #define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8))
-#define odd(v) (((v) % 2) == 1)
 
 // Debug channels
 enum {


Commit: a38d437b47b40bd13fe0da80cdbf7ab7d7b2225e
    https://github.com/scummvm/scummvm/commit/a38d437b47b40bd13fe0da80cdbf7ab7d7b2225e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T06:16:56-07:00

Commit Message:
MORTEVIELLE: Start working on displayPicture, misc renaming and refactoring

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 9a29bbf..91d9177 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -241,17 +241,17 @@ void MortevielleEngine::fctTake() {
 			if ((_coreVar._currPlace == ATTIC) && (_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
 				putInHand(_coreVar._atticBallHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					aniof(2, 7);
+					drawAnimFrame(2, 7);
 			}
 			if ((_coreVar._currPlace == ATTIC) && (_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
 				putInHand(_coreVar._atticRodHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					aniof(2, 6);
+					drawAnimFrame(2, 6);
 			}
 			if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
 				putInHand(_coreVar._cellarObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					aniof(2, 2);
+					drawAnimFrame(2, 2);
 			}
 			if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
 				putInHand(_coreVar._cryptObjectId);
@@ -260,13 +260,13 @@ void MortevielleEngine::fctTake() {
 				putInHand(_coreVar._secretPassageObjectId);
 				if ((_crep != 997) && (_crep != 139)) {
 					_crep = 182;
-					aniof(2, 1);
+					drawAnimFrame(2, 1);
 				}
 			}
 			if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
 				putInHand(_coreVar._wellObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					aniof(2, 1);
+					drawAnimFrame(2, 1);
 			}
 			if ((_crep != 997) && (_crep != 182) && (_crep != 139))
 				_crep = 999;
@@ -631,7 +631,7 @@ void MortevielleEngine::fctOpen() {
 						_speechManager.startSpeech(7, 9, 1);
 				}
 				_openObjects[tmpPlace] = _num;
-				aniof(1, _num);
+				drawAnimFrame(1, _num);
 			}
 			tmpPlace = _coreVar._currPlace;
 			if (_coreVar._currPlace == CRYPT)
@@ -675,14 +675,14 @@ void MortevielleEngine::fctPlace() {
 				} else {
 					_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
 					if (_coreVar._selectedObjectId == 141)
-						aniof(1, 7);
+						drawAnimFrame(1, 7);
 				}
 			} else if (_coreVar._atticRodHoleObjectId != 0) {
 				_crep = 188;
 			} else {
 				_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 159)
-					aniof(1, 6);
+					drawAnimFrame(1, 6);
 			}
 		}
 
@@ -693,8 +693,8 @@ void MortevielleEngine::fctPlace() {
 				_coreVar._cellarObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 151) {
 					// Open hidden passage
-					aniof(1, 2);
-					aniof(1, 1);
+					drawAnimFrame(1, 2);
+					drawAnimFrame(1, 1);
 					handleDescriptionText(2, 165);
 					displayEmptyHand();
 					_speechManager.startSpeech(6, -9, 1);
@@ -727,16 +727,16 @@ void MortevielleEngine::fctPlace() {
 							_menu.setDestinationText(_coreVar._currPlace);
 							setPal(14);
 							drawPicture();
-							aniof(1, 2);
-							aniof(1, 1);
+							drawAnimFrame(1, 2);
+							drawAnimFrame(1, 1);
 							alertTxt = getString(577);
 							_dialogManager.show(alertTxt, 1);
-							aniof(2, 1);
+							drawAnimFrame(2, 1);
 							_crep = 166;
 						}
 						prepareDisplayText();
 					} else {
-						aniof(2, 1);
+						drawAnimFrame(2, 1);
 						_crep = 166;
 					}
 					return;
@@ -756,7 +756,7 @@ void MortevielleEngine::fctPlace() {
 				_crep = 188;
 			} else if (_coreVar._selectedObjectId == 143) {
 				_coreVar._secretPassageObjectId = 143;
-				aniof(1, 1);
+				drawAnimFrame(1, 1);
 			} else {
 				_crep = 1512;
 				loseGame();
@@ -768,7 +768,7 @@ void MortevielleEngine::fctPlace() {
 				_crep = 188;
 			} else if ((_coreVar._selectedObjectId == 140) || (_coreVar._selectedObjectId == 120)) {
 				_coreVar._wellObjectId = _coreVar._selectedObjectId;
-				aniof(1, 1);
+				drawAnimFrame(1, 1);
 			} else {
 				_crep = 185;
 			}
@@ -856,7 +856,7 @@ void MortevielleEngine::fctAttach() {
 				_crep = 999;
 				if ((_coreVar._selectedObjectId == 120) || (_coreVar._selectedObjectId == 140)) {
 					_coreVar._wellObjectId = _coreVar._selectedObjectId;
-					aniof(1, 1);
+					drawAnimFrame(1, 1);
 				} else
 					_crep = 185;
 				displayEmptyHand();
@@ -886,7 +886,7 @@ void MortevielleEngine::fctClose() {
 				++cx;
 			} while ((cx <= 6) && (_num != _openObjects[cx]));
 			if (_num == _openObjects[cx]) {
-				aniof(2, _num);
+				drawAnimFrame(2, _num);
 				_crep = 998;
 				_openObjects[cx] = 0;
 				--_openObjCount;
@@ -1148,7 +1148,7 @@ void MortevielleEngine::fctEnter() {
 			else {
 				int randVal = (getRandomNumber(0, 10)) - 5;
 				_speechManager.startSpeech(7, randVal, 1);
-				aniof(1, 1);
+				drawAnimFrame(1, 1);
 
 				int charIndex = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
@@ -1169,7 +1169,7 @@ void MortevielleEngine::fctEnter() {
 		} else {
 			int randVal = (getRandomNumber(0, 10)) - 5;
 			_speechManager.startSpeech(7, randVal, 1);
-			aniof(1, 1);
+			drawAnimFrame(1, 1);
 
 			_coreVar._currPlace = _roomDoorId;
 			prepareDisplayText();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 2536533..f6fe966 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -480,10 +480,10 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
  * @remarks	Originally called 'ani50'
  */
 void DialogManager::displayIntroFrame2() {
-	_vm->_crep = _vm->animof(1, 1);
-	_vm->pictout(kAdrAni, _vm->_crep, 63, 12);
-	_vm->_crep = _vm->animof(2, 1);
-	_vm->pictout(kAdrAni, _vm->_crep, 63, 12);
+	_vm->_crep = _vm->getAnimOffset(1, 1);
+	_vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12);
+	_vm->_crep = _vm->getAnimOffset(2, 1);
+	_vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12);
 	_vm->_largestClearScreen = (_vm->_resolutionScaler == 1);
 	_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 4fd096a..27d590d 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -434,14 +434,14 @@ private:
 	void drawPictureWithText();
 	void addObjectToInventory(int objectId);
 	void putInHand(int &objId);
+	void initMaxAnswer();
+	void drawAnimFrame(int frameNum, int animId);
 
 	void copcha();
 	void adzon();
 	void premtet();
 	void ajchai();
 	void ecr2(Common::String text);
-	void initMaxAnswer();
-	void aniof(int ouf, int num);
 	void tlu(int af, int ob);
 	void mennor();
 	void tsuiv();
@@ -526,12 +526,13 @@ public:
 	void testKeyboard();
 	int  getPresence(int roomId);
 	void displayEmptyHand();
+	void displayPicture(const byte *pic, int x, int y);
 
-	void hirs();
 	int  gettKeyPressed();
 	void handleDescriptionText(int f, int mesgId);
-	int  animof(int ouf, int num);
-	void pictout(int seg, int dep, int x, int y);
+	int  getAnimOffset(int frameNum, int animNum);
+
+	void hirs();
 };
 
 extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 87bcc87..0dd1978 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2240,7 +2240,7 @@ void MortevielleEngine::showTitleScreen() {
 void MortevielleEngine::draw(int x, int y) {
 	_mouse.hideMouse();
 	setPal(_numpal);
-	pictout(kAdrCurrentPicture, 0, x, y);
+	displayPicture(&_mem[kAdrCurrentPicture * 16], x, y);
 	_mouse.showMouse();
 }
 
@@ -2254,7 +2254,7 @@ void MortevielleEngine::drawRightFrame() {
 		_mem[(kAdrCurrentPicture * 16) + 14] = 15;
 	}
 	_mouse.hideMouse();
-	pictout(kAdrRightFramePic, 0, 0, 0);
+	displayPicture(&_mem[kAdrRightFramePic * 16], 0, 0);
 	_mouse.showMouse();
 }
 
@@ -2535,9 +2535,13 @@ void MortevielleEngine::displayControlMenu() {
 	_controlMenu = 0;
 }
 
-void MortevielleEngine::pictout(int seg, int dep, int x, int y) {
+/**
+ * Display picture at a given coordinate
+ * @remarks	Originally called 'pictout'
+ */
+void MortevielleEngine::displayPicture(const byte *pic, int x, int y) {
 	GfxSurface surface;
-	surface.decode(&_mem[(seg * 16) + dep]);
+	surface.decode(pic);
 
 	if (_currGraphicalDevice == MODE_HERCULES) {
 		_mem[(kAdrCurrentPicture * 16) + 2] = 0;
@@ -2575,16 +2579,15 @@ void MortevielleEngine::adzon() {
 
 /**
  * Returns the offset within the compressed image data resource of the desired image
+ * @remarks	Originally called 'animof'
  */
-int MortevielleEngine::animof(int ouf, int num) {
-	int nani = _mem[(kAdrAni * 16) + 1];
-	int aux = num;
-	if (ouf != 1)
-		aux += nani;
-
-	int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&_mem[(kAdrAni * 16) + (aux << 1)]);
+int MortevielleEngine::getAnimOffset(int frameNum, int animNum) {
+	int animCount = _mem[(kAdrAni * 16) + 1];
+	int aux = animNum;
+	if (frameNum != 1)
+		aux += animCount;
 
-	return animof_result;
+	return (animCount << 2) + 2 + READ_BE_UINT16(&_mem[(kAdrAni * 16) + (aux << 1)]);
 }
 
 /**
@@ -2947,20 +2950,24 @@ void MortevielleEngine::displayQuestionText(Common::String s, int cmd) {
 		_screenSurface.drawString(copy(s, 1, 25), cmd);
 }
 
-void MortevielleEngine::aniof(int ouf, int num) {
-	if ((_caff == BATHROOM) && ((num == 4) || (num == 5)))
+/**
+ * Display animation frame
+ * @remarks	Originally called 'aniof'
+ */
+void MortevielleEngine::drawAnimFrame(int frameNum, int animId) {
+	if ((_caff == BATHROOM) && ((animId == 4) || (animId == 5)))
 		return;
 
-	if ((_caff == DINING_ROOM) && (num == 7))
-		num = 6;
+	if ((_caff == DINING_ROOM) && (animId == 7))
+		animId = 6;
 	else if (_caff == KITCHEN) {
-		if (num == 3)
-			num = 4;
-		else if (num == 4)
-			num = 3;
+		if (animId == 3)
+			animId = 4;
+		else if (animId == 4)
+			animId = 3;
 	}
 
-	int offset = animof(ouf, num);
+	int offset = getAnimOffset(frameNum, animId);
 
 	GfxSurface surface;
 	surface.decode(&_mem[(kAdrAni * 16) + offset]);
@@ -2987,21 +2994,21 @@ void MortevielleEngine::drawPicture() {
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
 				if (_openObjects[cx] != 0)
-					aniof(1, _openObjects[cx]);
+					drawAnimFrame(1, _openObjects[cx]);
 			}
 
 			if (_caff == ATTIC) {
 				if (_coreVar._atticBallHoleObjectId == 141)
-					aniof(1, 7);
+					drawAnimFrame(1, 7);
 
 				if (_coreVar._atticRodHoleObjectId == 159)
-					aniof(1, 6);
+					drawAnimFrame(1, 6);
 			} else if ((_caff == CELLAR) && (_coreVar._cellarObjectId == 151))
-				aniof(1, 2);
+				drawAnimFrame(1, 2);
 			else if ((_caff == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143))
-				aniof(1, 1);
+				drawAnimFrame(1, 1);
 			else if ((_caff == WELL) && (_coreVar._wellObjectId != 0))
-				aniof(1, 1);
+				drawAnimFrame(1, 1);
 		}
 
 		if (_caff < ROOM26)


Commit: c4237ed81a2d882d4f826f6589fd9a15be6873c5
    https://github.com/scummvm/scummvm/commit/c4237ed81a2d882d4f826f6589fd9a15be6873c5
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T09:22:35-07:00

Commit Message:
MORTEVIELLE: Move Current Picture out of _mem buffer, some renaming

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 91d9177..88eee0c 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -241,17 +241,17 @@ void MortevielleEngine::fctTake() {
 			if ((_coreVar._currPlace == ATTIC) && (_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
 				putInHand(_coreVar._atticBallHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					drawAnimFrame(2, 7);
+					displayAnimFrame(2, 7);
 			}
 			if ((_coreVar._currPlace == ATTIC) && (_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
 				putInHand(_coreVar._atticRodHoleObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					drawAnimFrame(2, 6);
+					displayAnimFrame(2, 6);
 			}
 			if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
 				putInHand(_coreVar._cellarObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					drawAnimFrame(2, 2);
+					displayAnimFrame(2, 2);
 			}
 			if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
 				putInHand(_coreVar._cryptObjectId);
@@ -260,13 +260,13 @@ void MortevielleEngine::fctTake() {
 				putInHand(_coreVar._secretPassageObjectId);
 				if ((_crep != 997) && (_crep != 139)) {
 					_crep = 182;
-					drawAnimFrame(2, 1);
+					displayAnimFrame(2, 1);
 				}
 			}
 			if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
 				putInHand(_coreVar._wellObjectId);
 				if ((_crep != 997) && (_crep != 139))
-					drawAnimFrame(2, 1);
+					displayAnimFrame(2, 1);
 			}
 			if ((_crep != 997) && (_crep != 182) && (_crep != 139))
 				_crep = 999;
@@ -631,7 +631,7 @@ void MortevielleEngine::fctOpen() {
 						_speechManager.startSpeech(7, 9, 1);
 				}
 				_openObjects[tmpPlace] = _num;
-				drawAnimFrame(1, _num);
+				displayAnimFrame(1, _num);
 			}
 			tmpPlace = _coreVar._currPlace;
 			if (_coreVar._currPlace == CRYPT)
@@ -675,14 +675,14 @@ void MortevielleEngine::fctPlace() {
 				} else {
 					_coreVar._atticBallHoleObjectId = _coreVar._selectedObjectId;
 					if (_coreVar._selectedObjectId == 141)
-						drawAnimFrame(1, 7);
+						displayAnimFrame(1, 7);
 				}
 			} else if (_coreVar._atticRodHoleObjectId != 0) {
 				_crep = 188;
 			} else {
 				_coreVar._atticRodHoleObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 159)
-					drawAnimFrame(1, 6);
+					displayAnimFrame(1, 6);
 			}
 		}
 
@@ -693,8 +693,8 @@ void MortevielleEngine::fctPlace() {
 				_coreVar._cellarObjectId = _coreVar._selectedObjectId;
 				if (_coreVar._selectedObjectId == 151) {
 					// Open hidden passage
-					drawAnimFrame(1, 2);
-					drawAnimFrame(1, 1);
+					displayAnimFrame(1, 2);
+					displayAnimFrame(1, 1);
 					handleDescriptionText(2, 165);
 					displayEmptyHand();
 					_speechManager.startSpeech(6, -9, 1);
@@ -727,16 +727,16 @@ void MortevielleEngine::fctPlace() {
 							_menu.setDestinationText(_coreVar._currPlace);
 							setPal(14);
 							drawPicture();
-							drawAnimFrame(1, 2);
-							drawAnimFrame(1, 1);
+							displayAnimFrame(1, 2);
+							displayAnimFrame(1, 1);
 							alertTxt = getString(577);
 							_dialogManager.show(alertTxt, 1);
-							drawAnimFrame(2, 1);
+							displayAnimFrame(2, 1);
 							_crep = 166;
 						}
 						prepareDisplayText();
 					} else {
-						drawAnimFrame(2, 1);
+						displayAnimFrame(2, 1);
 						_crep = 166;
 					}
 					return;
@@ -756,7 +756,7 @@ void MortevielleEngine::fctPlace() {
 				_crep = 188;
 			} else if (_coreVar._selectedObjectId == 143) {
 				_coreVar._secretPassageObjectId = 143;
-				drawAnimFrame(1, 1);
+				displayAnimFrame(1, 1);
 			} else {
 				_crep = 1512;
 				loseGame();
@@ -768,7 +768,7 @@ void MortevielleEngine::fctPlace() {
 				_crep = 188;
 			} else if ((_coreVar._selectedObjectId == 140) || (_coreVar._selectedObjectId == 120)) {
 				_coreVar._wellObjectId = _coreVar._selectedObjectId;
-				drawAnimFrame(1, 1);
+				displayAnimFrame(1, 1);
 			} else {
 				_crep = 185;
 			}
@@ -856,7 +856,7 @@ void MortevielleEngine::fctAttach() {
 				_crep = 999;
 				if ((_coreVar._selectedObjectId == 120) || (_coreVar._selectedObjectId == 140)) {
 					_coreVar._wellObjectId = _coreVar._selectedObjectId;
-					drawAnimFrame(1, 1);
+					displayAnimFrame(1, 1);
 				} else
 					_crep = 185;
 				displayEmptyHand();
@@ -886,7 +886,7 @@ void MortevielleEngine::fctClose() {
 				++cx;
 			} while ((cx <= 6) && (_num != _openObjects[cx]));
 			if (_num == _openObjects[cx]) {
-				drawAnimFrame(2, _num);
+				displayAnimFrame(2, _num);
 				_crep = 998;
 				_openObjects[cx] = 0;
 				--_openObjCount;
@@ -1148,7 +1148,7 @@ void MortevielleEngine::fctEnter() {
 			else {
 				int randVal = (getRandomNumber(0, 10)) - 5;
 				_speechManager.startSpeech(7, randVal, 1);
-				drawAnimFrame(1, 1);
+				displayAnimFrame(1, 1);
 
 				int charIndex = convertBitIndexToCharacterIndex(z);
 				++_coreVar._faithScore;
@@ -1169,7 +1169,7 @@ void MortevielleEngine::fctEnter() {
 		} else {
 			int randVal = (getRandomNumber(0, 10)) - 5;
 			_speechManager.startSpeech(7, randVal, 1);
-			drawAnimFrame(1, 1);
+			displayAnimFrame(1, 1);
 
 			_coreVar._currPlace = _roomDoorId;
 			prepareDisplayText();
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index cb674a2..e5edeed 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -937,7 +937,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
 		(x + surface.w) * 2, (y + surface.h) * 2));
 
 	// Get a lookup for the palette mapping
-	const byte *paletteMap = &_vm->_mem[(kAdrCurrentPicture * 16) + 2];
+	const byte *paletteMap = &_vm->_curPict[2];
 
 	// Loop through writing
 	for (int yp = 0; yp < surface.h; ++yp) {
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index c13eba4..f98832f 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -101,9 +101,11 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_day = 0;
 
 	memset(_mem, 0, sizeof(_mem));
+	_curPict = nullptr;
 }
 
 MortevielleEngine::~MortevielleEngine() {
+	free(_curPict);
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 27d590d..91a65c1 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -64,7 +64,6 @@ namespace Mortevielle {
  * 7000:4138 - width, height, x/y offset of decoded image
  */
 const int kAdrMusic = 0x5000;
-const int kAdrCurrentPicture = 0x7000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
 const int kAdrCompMusicBuf2 = 0x3800;
@@ -435,7 +434,7 @@ private:
 	void addObjectToInventory(int objectId);
 	void putInHand(int &objId);
 	void initMaxAnswer();
-	void drawAnimFrame(int frameNum, int animId);
+	void displayAnimFrame(int frameNum, int animId);
 
 	void copcha();
 	void adzon();
@@ -477,6 +476,7 @@ public:
 
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
+	byte *_curPict;
 
 	Debugger _debugger;
 	ScreenSurface _screenSurface;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 311a4c2..37ea06e 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -125,17 +125,20 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
 }
 
 /**
- * Load DES file
+ * Load DES (picture container) file
  * @remarks	Originally called 'chardes'
  */
-void TextHandler::loadDesFile(Common::String filename, int32 skipSize, int length) {
+void TextHandler::loadPictureFile(Common::String filename, int32 skipSize, int length) {
 	Common::File f;
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
 
 	assert(skipSize + length <= f.size());
+
+	free(_vm->_curPict);
+	_vm->_curPict = (byte *)malloc(sizeof(byte) * length);
 	f.seek(skipSize);
-	f.read(&_vm->_mem[(kAdrCurrentPicture * 16)], length);
+	f.read(_vm->_curPict, length);
 	f.close();
 }
 
@@ -257,10 +260,10 @@ void TextHandler::taffich() {
 		_vm->_maff = a;
 		npal = a + 37;
 	}
-	loadDesFile(filename, drawingStartPos, drawingSize);
+	loadPictureFile(filename, drawingStartPos, drawingSize);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
-			int palh = READ_LE_UINT16(&_vm->_mem[(kAdrCurrentPicture * 16) + 2 + (i << 1)]);
+			int palh = READ_LE_UINT16(&_vm->_curPict[2 + (i << 1)]);
 			alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
 		}
 		for (int i = 0; i <= 15; ++i) {
@@ -269,7 +272,7 @@ void TextHandler::taffich() {
 				if (alllum[j] > alllum[k])
 					k = j;
 			}
-			_vm->_mem[(kAdrCurrentPicture * 16) + 2 + (k << 1)] = rang[i];
+			_vm->_curPict[2 + (k << 1)] = rang[i];
 			alllum[k] = -1;
 		}
 	}
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 514aae3..1689e01 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -42,7 +42,7 @@ private:
 public:
 	void setParent(MortevielleEngine *vm);
 	void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-	void loadDesFile(Common::String filename, int32 skipSize, int length);
+	void loadPictureFile(Common::String filename, int32 skipSize, int length);
 	void loadAniFile(Common::String filename, int32 skipSize, int length);
 	void taffich();
 };
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 0dd1978..c6dd3f9 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1979,8 +1979,8 @@ void MortevielleEngine::setPal(int n) {
 	case MODE_EGA:
 	case MODE_AMSTRAD1512:
 		for (int i = 1; i <= 16; ++i) {
-			_mem[(kAdrCurrentPicture * 16) + (2 * i)] = _stdPal[n][i].x;
-			_mem[(kAdrCurrentPicture * 16) + (2 * i) + 1] = _stdPal[n][i].y;
+			_curPict[(2 * i)] = _stdPal[n][i].x;
+			_curPict[(2 * i) + 1] = _stdPal[n][i].y;
 		}
 		break;
 	case MODE_CGA: {
@@ -2008,12 +2008,12 @@ void MortevielleEngine::setPal(int n) {
 void MortevielleEngine::displayCGAPattern(int n, Pattern p, nhom *pal) {
 	int addr = n * 404 + 0xd700;
 
-	WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + addr], p._tax);
-	WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + addr + 2], p._tay);
+	WRITE_LE_UINT16(&_curPict[addr], p._tax);
+	WRITE_LE_UINT16(&_curPict[addr + 2], p._tay);
 	addr += 4;
 	for (int i = 0; i < p._tax; ++i) {
 		for (int j = 0; j < p._tay; ++j)
-			_mem[(kAdrCurrentPicture * 16) + addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
+			_curPict[addr + j * p._tax + i] = pal[n]._hom[p._des[i + 1][j + 1]];
 	}
 }
 
@@ -2240,7 +2240,7 @@ void MortevielleEngine::showTitleScreen() {
 void MortevielleEngine::draw(int x, int y) {
 	_mouse.hideMouse();
 	setPal(_numpal);
-	displayPicture(&_mem[kAdrCurrentPicture * 16], x, y);
+	displayPicture(_curPict, x, y);
 	_mouse.showMouse();
 }
 
@@ -2250,9 +2250,9 @@ void MortevielleEngine::draw(int x, int y) {
  */
 void MortevielleEngine::drawRightFrame() {
 	setPal(89);
-	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[(kAdrCurrentPicture * 16) + 14] = 15;
-	}
+	if (_currGraphicalDevice == MODE_HERCULES)
+		_curPict[14] = 15;
+
 	_mouse.hideMouse();
 	displayPicture(&_mem[kAdrRightFramePic * 16], 0, 0);
 	_mouse.showMouse();
@@ -2544,12 +2544,13 @@ void MortevielleEngine::displayPicture(const byte *pic, int x, int y) {
 	surface.decode(pic);
 
 	if (_currGraphicalDevice == MODE_HERCULES) {
-		_mem[(kAdrCurrentPicture * 16) + 2] = 0;
-		_mem[(kAdrCurrentPicture * 16) + 32] = 15;
+		_curPict[2] = 0;
+		_curPict[32] = 15;
 	}
 
-	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138]) > 0x100))
-		WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138], 0x100);
+	// CHECKME: Is it useful?
+	//	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138]) > 0x100))
+	//		WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138], 0x100);
 
 	_screenSurface.drawPicture(surface, x, y);
 }
@@ -2954,7 +2955,7 @@ void MortevielleEngine::displayQuestionText(Common::String s, int cmd) {
  * Display animation frame
  * @remarks	Originally called 'aniof'
  */
-void MortevielleEngine::drawAnimFrame(int frameNum, int animId) {
+void MortevielleEngine::displayAnimFrame(int frameNum, int animId) {
 	if ((_caff == BATHROOM) && ((animId == 4) || (animId == 5)))
 		return;
 
@@ -2994,21 +2995,21 @@ void MortevielleEngine::drawPicture() {
 		if ((_caff < 30) || (_caff > 32)) {
 			for (int cx = 1; cx <= 6; ++cx) {
 				if (_openObjects[cx] != 0)
-					drawAnimFrame(1, _openObjects[cx]);
+					displayAnimFrame(1, _openObjects[cx]);
 			}
 
 			if (_caff == ATTIC) {
 				if (_coreVar._atticBallHoleObjectId == 141)
-					drawAnimFrame(1, 7);
+					displayAnimFrame(1, 7);
 
 				if (_coreVar._atticRodHoleObjectId == 159)
-					drawAnimFrame(1, 6);
+					displayAnimFrame(1, 6);
 			} else if ((_caff == CELLAR) && (_coreVar._cellarObjectId == 151))
-				drawAnimFrame(1, 2);
+				displayAnimFrame(1, 2);
 			else if ((_caff == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143))
-				drawAnimFrame(1, 1);
+				displayAnimFrame(1, 1);
 			else if ((_caff == WELL) && (_coreVar._wellObjectId != 0))
-				drawAnimFrame(1, 1);
+				displayAnimFrame(1, 1);
 		}
 
 		if (_caff < ROOM26)


Commit: c07c3f0a131d781353ef541ce518ffde69c51923
    https://github.com/scummvm/scummvm/commit/c07c3f0a131d781353ef541ce518ffde69c51923
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T09:24:28-07:00

Commit Message:
MORTEVIELLE: Remove unused code from the original compression scheme

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index c6dd3f9..9cda39e 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2548,10 +2548,6 @@ void MortevielleEngine::displayPicture(const byte *pic, int x, int y) {
 		_curPict[32] = 15;
 	}
 
-	// CHECKME: Is it useful?
-	//	if ((_caff != 51) && (READ_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138]) > 0x100))
-	//		WRITE_LE_UINT16(&_mem[(kAdrCurrentPicture * 16) + 0x4138], 0x100);
-
 	_screenSurface.drawPicture(surface, x, y);
 }
 


Commit: 2c0a99bbe1d47470da50799d1783e1556152e9bb
    https://github.com/scummvm/scummvm/commit/2c0a99bbe1d47470da50799d1783e1556152e9bb
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-24T15:50:08-07:00

Commit Message:
MORTEVIELLE: Fix box height when searching

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 9cda39e..a8394f5 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2981,7 +2981,7 @@ void MortevielleEngine::drawPicture() {
 	clearUpperLeftPart();
 	if (_caff > 99) {
 		draw(60, 33);
-		_screenSurface.drawBox(118, 32, 291, 121, 15);         // Medium box
+		_screenSurface.drawBox(118, 32, 291, 122, 15);         // Medium box
 	} else if (_caff > 69) {
 		draw(112, 48);           // Heads
 		_screenSurface.drawBox(222, 47, 155, 92, 15);


Commit: 5858f82564ac286b7f5ceb71a083af05e025d972
    https://github.com/scummvm/scummvm/commit/5858f82564ac286b7f5ceb71a083af05e025d972
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T00:49:43-07:00

Commit Message:
MORTEVIELLE: Fix the German 2nd intro screen (original bug)

Changed paths:
    engines/mortevielle/outtext.cpp



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 37ea06e..9bc6d8f 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -129,10 +129,17 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
  * @remarks	Originally called 'chardes'
  */
 void TextHandler::loadPictureFile(Common::String filename, int32 skipSize, int length) {
+	warning("%s - pos %d size %d", filename.c_str(), skipSize, length);
 	Common::File f;
 	if (!f.open(filename))
 		error("Missing file %s", filename.c_str());
 
+	// HACK: The original game contains a bug in the intro screen, in German DOS version.
+	// The size specified in the fxx array is wrong (too short). In order to fix it, we are using
+	// the value -1 to force a variable read length.
+	if (length < 0)
+		length = f.size() - skipSize;
+
 	assert(skipSize + length <= f.size());
 
 	free(_vm->_curPict);
@@ -251,11 +258,14 @@ void TextHandler::taffich() {
 			filename = "DZZ.mor";
 
 		if (a == 50) {
+			// First intro screen
 			drawingStartPos = 0;
 			drawingSize = _vm->_drawingSizeArr[87];
 		} else { // a == 51
+			// Second intro screen
 			drawingStartPos = _vm->_drawingSizeArr[87];
-			drawingSize = _vm->_drawingSizeArr[88];
+			// HACK: Force a variable size in order to fix the wrong size used by the German version
+			drawingSize = -1;
 		}
 		_vm->_maff = a;
 		npal = a + 37;


Commit: 917af38269ed1ce58a622e3298f472115ee82322
    https://github.com/scummvm/scummvm/commit/917af38269ed1ce58a622e3298f472115ee82322
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T00:59:25-07:00

Commit Message:
MORTEVIELLE: Remove the check on German for the intro filename by using an alternate filename in loading code

Changed paths:
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h



diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 9bc6d8f..85cc580 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -128,16 +128,16 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
  * Load DES (picture container) file
  * @remarks	Originally called 'chardes'
  */
-void TextHandler::loadPictureFile(Common::String filename, int32 skipSize, int length) {
-	warning("%s - pos %d size %d", filename.c_str(), skipSize, length);
+void TextHandler::loadPictureFile(Common::String filename, Common::String altFilename, int32 skipSize, int length) {
 	Common::File f;
-	if (!f.open(filename))
-		error("Missing file %s", filename.c_str());
-
-	// HACK: The original game contains a bug in the intro screen, in German DOS version.
+	if (!f.open(filename)) {
+		if (!f.open(altFilename))
+			error("Missing file: Either %s or %s", filename.c_str(), altFilename.c_str());
+	}
+	// HACK: The original game contains a bug in the 2nd intro screen, in German DOS version.
 	// The size specified in the fxx array is wrong (too short). In order to fix it, we are using
 	// the value -1 to force a variable read length.
-	if (length < 0)
+	if (length == -1)
 		length = f.size() - skipSize;
 
 	assert(skipSize + length <= f.size());
@@ -224,7 +224,7 @@ void TextHandler::taffich() {
 	_vm->_destinationOk = true;
 	_vm->_mouse.hideMouse();
 	drawingStartPos = 0;
-	Common::String filename;
+	Common::String filename, altFilename;
 
 	if ((a != 50) && (a != 51)) {
 		_vm->_maff = a;
@@ -250,12 +250,10 @@ void TextHandler::taffich() {
 			drawingStartPos += _vm->_drawingSizeArr[cx];
 		drawingSize = _vm->_drawingSizeArr[a];
 
-		filename = "DXX.mor";
+		altFilename = filename = "DXX.mor";
 	} else {
-		if (_vm->getLanguage() == Common::DE_DEU)
-			filename = "DZZALL";
-		else
-			filename = "DZZ.mor";
+		filename = "DZZ.mor";
+		altFilename = "DZZALL";
 
 		if (a == 50) {
 			// First intro screen
@@ -270,7 +268,7 @@ void TextHandler::taffich() {
 		_vm->_maff = a;
 		npal = a + 37;
 	}
-	loadPictureFile(filename, drawingStartPos, drawingSize);
+	loadPictureFile(filename, altFilename, drawingStartPos, drawingSize);
 	if (_vm->_currGraphicalDevice == MODE_HERCULES) {
 		for (int i = 0; i <= 15; ++i) {
 			int palh = READ_LE_UINT16(&_vm->_curPict[2 + (i << 1)]);
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 1689e01..1c69d9b 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -42,7 +42,7 @@ private:
 public:
 	void setParent(MortevielleEngine *vm);
 	void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
-	void loadPictureFile(Common::String filename, int32 skipSize, int length);
+	void loadPictureFile(Common::String filename, Common::String altFilename, int32 skipSize, int length);
 	void loadAniFile(Common::String filename, int32 skipSize, int length);
 	void taffich();
 };


Commit: 825b29fa5321e150744f2768c8a33c5e672be179
    https://github.com/scummvm/scummvm/commit/825b29fa5321e150744f2768c8a33c5e672be179
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T01:10:09-07:00

Commit Message:
MORTEVIELLE: Use a specific buffer instead of _mem for the right frame

Changed paths:
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 91a65c1..ae35b20 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -67,7 +67,6 @@ const int kAdrMusic = 0x5000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
 const int kAdrCompMusicBuf2 = 0x3800;
-const int kAdrRightFramePic = 0x73A2;
 
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
@@ -477,7 +476,7 @@ public:
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
 	byte *_curPict;
-
+	byte _rightFramePict[1664];
 	Debugger _debugger;
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index a8394f5..36b2d61 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2254,7 +2254,7 @@ void MortevielleEngine::drawRightFrame() {
 		_curPict[14] = 15;
 
 	_mouse.hideMouse();
-	displayPicture(&_mem[kAdrRightFramePic * 16], 0, 0);
+	displayPicture(_rightFramePict, 0, 0);
 	_mouse.showMouse();
 }
 
@@ -2570,7 +2570,7 @@ void MortevielleEngine::adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(&_mem[kAdrRightFramePic * 16], 1664);
+	f.read(_rightFramePict, 1664);
 	f.close();
 }
 


Commit: d9757e985c6fd210a7018275cbcf1e217f9c103a
    https://github.com/scummvm/scummvm/commit/d9757e985c6fd210a7018275cbcf1e217f9c103a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T01:24:25-07:00

Commit Message:
MORTEVIELLE: Use variable size for _rightFramePict in order to handle the different sizes of the Amiga and Atari versions

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f98832f..7e73d11 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -102,10 +102,12 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 
 	memset(_mem, 0, sizeof(_mem));
 	_curPict = nullptr;
+	_rightFramePict = nullptr;
 }
 
 MortevielleEngine::~MortevielleEngine() {
 	free(_curPict);
+	free(_rightFramePict);
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index ae35b20..dbd0449 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -476,7 +476,8 @@ public:
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
 	byte *_curPict;
-	byte _rightFramePict[1664];
+	byte *_rightFramePict;
+
 	Debugger _debugger;
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 36b2d61..f82f6f7 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2570,7 +2570,9 @@ void MortevielleEngine::adzon() {
 	if (!f.open("dec.mor"))
 		error("Missing file - dec.mor");
 
-	f.read(_rightFramePict, 1664);
+	free(_rightFramePict);
+	_rightFramePict = (byte *)malloc(sizeof(byte) * f.size());
+	f.read(_rightFramePict, f.size());
 	f.close();
 }
 


Commit: fd467658acb0c7a6000c07eac7d48d222d306785
    https://github.com/scummvm/scummvm/commit/fd467658acb0c7a6000c07eac7d48d222d306785
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T01:32:21-07:00

Commit Message:
MORTEVIELLE: Use a specific buffer instead of _mem for the animations

Changed paths:
    engines/mortevielle/dialogs.cpp
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/outtext.cpp
    engines/mortevielle/outtext.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index f6fe966..ba5d984 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -481,9 +481,9 @@ void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
  */
 void DialogManager::displayIntroFrame2() {
 	_vm->_crep = _vm->getAnimOffset(1, 1);
-	_vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12);
+	_vm->displayPicture(&_vm->_curAnim[_vm->_crep], 63, 12);
 	_vm->_crep = _vm->getAnimOffset(2, 1);
-	_vm->displayPicture(&_vm->_mem[(kAdrAni * 16) + _vm->_crep], 63, 12);
+	_vm->displayPicture(&_vm->_curAnim[_vm->_crep], 63, 12);
 	_vm->_largestClearScreen = (_vm->_resolutionScaler == 1);
 	_vm->handleDescriptionText(2, kDialogStringIndex + 143);
 }
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 7e73d11..8eea0ca 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -102,11 +102,13 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 
 	memset(_mem, 0, sizeof(_mem));
 	_curPict = nullptr;
+	_curAnim = nullptr;
 	_rightFramePict = nullptr;
 }
 
 MortevielleEngine::~MortevielleEngine() {
 	free(_curPict);
+	free(_curAnim);
 	free(_rightFramePict);
 }
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index dbd0449..94e9716 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -476,8 +476,9 @@ public:
 	// TODO: Replace the following with proper implementations, or refactor out the code using them
 	byte _mem[65536 * 16];
 	byte *_curPict;
+	byte *_curAnim;
 	byte *_rightFramePict;
-
+	
 	Debugger _debugger;
 	ScreenSurface _screenSurface;
 	PaletteManager _paletteManager;
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index 85cc580..99c06c7 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -159,8 +159,11 @@ void TextHandler::loadAniFile(Common::String filename, int32 skipSize, int lengt
 		error("Missing file - %s", filename.c_str());
 
 	assert(skipSize + length <= f.size());
+
+	free(_vm->_curAnim);
+	_vm->_curAnim = (byte *)malloc(sizeof(byte) * length);
 	f.seek(skipSize);
-	f.read(&_vm->_mem[(kAdrAni * 16)], length);
+	f.read(_vm->_curAnim, length);
 	f.close();
 }
 
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 1c69d9b..4486803 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -33,8 +33,6 @@
 namespace Mortevielle {
 class MortevielleEngine;
 
-const int kAdrAni = 0x7314;
-
 class TextHandler {
 private:
 	MortevielleEngine *_vm;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index f82f6f7..001b2d3 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2581,12 +2581,12 @@ void MortevielleEngine::adzon() {
  * @remarks	Originally called 'animof'
  */
 int MortevielleEngine::getAnimOffset(int frameNum, int animNum) {
-	int animCount = _mem[(kAdrAni * 16) + 1];
+	int animCount = _curAnim[1];
 	int aux = animNum;
 	if (frameNum != 1)
 		aux += animCount;
 
-	return (animCount << 2) + 2 + READ_BE_UINT16(&_mem[(kAdrAni * 16) + (aux << 1)]);
+	return (animCount << 2) + 2 + READ_BE_UINT16(&_curAnim[aux << 1]);
 }
 
 /**
@@ -2969,7 +2969,7 @@ void MortevielleEngine::displayAnimFrame(int frameNum, int animId) {
 	int offset = getAnimOffset(frameNum, animId);
 
 	GfxSurface surface;
-	surface.decode(&_mem[(kAdrAni * 16) + offset]);
+	surface.decode(&_curAnim[offset]);
 	_screenSurface.drawPicture(surface, 0, 12);
 
 	prepareScreenType1();


Commit: 0e59907b9b22043a27440312206f52474705f4e8
    https://github.com/scummvm/scummvm/commit/0e59907b9b22043a27440312206f52474705f4e8
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-25T06:47:31-07:00

Commit Message:
MORTEVIELLE: Use a specific buffer instead of _mem for noise5 file

Changed paths:
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 7fe8c54..3a42c95 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -68,6 +68,11 @@ SpeechManager::SpeechManager() {
 		_queue[i]._freq = 0;
 		_queue[i]._rep = 0;
 	}
+	_noise5Buf = nullptr;
+}
+
+SpeechManager::~SpeechManager() {
+	free(_noise5Buf);
 }
 
 void SpeechManager::spfrac(int wor) {
@@ -194,10 +199,10 @@ void SpeechManager::loadNoise() {
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
-	f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128);
+	f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128); // 32000
 	for (i = 0; i <= 19013; ++i)
-		_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _vm->_mem[(kAdrNoise5 * 16) + i];
-	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128);
+		_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _noise5Buf[i];
+	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128); // 19072
 
 	f.close();
 }
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index b3d7c15..ef3211d 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -37,7 +37,6 @@ namespace Mortevielle {
 const int kAdrNoise  = 0x5cb0;/*2C00;*/
 const int kAdrNoise1 = 0x6924;
 const int kAdrNoise3 = 0x6ba6;/*3AF6;*/
-const int kAdrNoise5 = 0x3b50;
 const int kAdrTroct  = 0x406b;
 const int kAdrWord   = 0x4000;
 const int kOffsetB1  = 6;
@@ -79,8 +78,11 @@ public:
 	int16 *_cfiphBuffer;
 	int _tbi[256];
 	int _mlec;
+	byte *_noise5Buf;
+	int _noise5Size;
 
 	SpeechManager();
+	~SpeechManager();
 	void setParent(MortevielleEngine *vm);
 	void spfrac(int wor);
 	void charg_car(int &currWordNumb);
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 001b2d3..2211a6d 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2134,7 +2134,10 @@ void MortevielleEngine::loadBRUIT5() {
 	if (!f.open("bruit5"))
 		error("Missing file - bruit5");
 
-	f.read(&_mem[kAdrNoise5 * 16], 149 * 128);
+	free(_speechManager._noise5Buf);
+	_speechManager._noise5Size = f.size();
+	_speechManager._noise5Buf = (byte *)malloc(sizeof(byte) * _speechManager._noise5Size);
+	f.read(_speechManager._noise5Buf, _speechManager._noise5Size);
 	f.close();
 }
 


Commit: 62eae32277113a1fb29f5011a1999f187e8d37ac
    https://github.com/scummvm/scummvm/commit/62eae32277113a1fb29f5011a1999f187e8d37ac
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-26T04:10:54-07:00

Commit Message:
MORTEVIELLE: Remove another use of _mem

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 8eea0ca..616bee1 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -104,12 +104,14 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_curPict = nullptr;
 	_curAnim = nullptr;
 	_rightFramePict = nullptr;
+	_compMusicBuf2 = nullptr;
 }
 
 MortevielleEngine::~MortevielleEngine() {
 	free(_curPict);
 	free(_curAnim);
 	free(_rightFramePict);
+	free(_compMusicBuf2);
 }
 
 /**
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 94e9716..2300371 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -66,7 +66,6 @@ namespace Mortevielle {
 const int kAdrMusic = 0x5000;
 
 const int kAdrCompMusicBuf1 = 0x7414;
-const int kAdrCompMusicBuf2 = 0x3800;
 
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
@@ -478,6 +477,7 @@ public:
 	byte *_curPict;
 	byte *_curAnim;
 	byte *_rightFramePict;
+	byte *_compMusicBuf2;
 	
 	Debugger _debugger;
 	ScreenSurface _screenSurface;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 3a42c95..899cd80 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -194,13 +194,12 @@ void SpeechManager::loadPhonemeSounds() {
  */
 void SpeechManager::loadNoise() {
 	Common::File f;
-	int i;
 
 	if (!f.open("bruits"))               //Translation: "noise"
 		error("Missing file - bruits");
 
 	f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128); // 32000
-	for (i = 0; i <= 19013; ++i)
+	for (int i = 0; i < _noise5Size; ++i)
 		_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _noise5Buf[i];
 	f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128); // 19072
 
@@ -582,7 +581,6 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) {
 	switch (typ) {
 	case 1:
 		loadNoise();
-		/*if zuul then zzuul(kAdrNoise,0,1095);*/
 		regenbruit();
 		break;
 	case 2:
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 2211a6d..7a83060 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2193,14 +2193,17 @@ void MortevielleEngine::music() {
 
 	_reloadCFIEC = true;
 
-	Common::File fic;
-	if (!fic.open("mort.img"))
+	Common::File f;
+	if (!f.open("mort.img"))
 		error("Missing file - mort.img");
 
-	fic.read(&_mem[kAdrCompMusicBuf2 * 16], 623 * 128);
-	fic.close();
+	free(_compMusicBuf2);
+	int size = f.size();
+	_compMusicBuf2 = (byte *)malloc(sizeof(byte) * size);
+	f.read(_compMusicBuf2, size);
+	f.close();
 
-	_soundManager.decodeMusic(&_mem[kAdrCompMusicBuf2 * 16], &_mem[kAdrMusic * 16], 623);
+	_soundManager.decodeMusic(_compMusicBuf2, &_mem[kAdrMusic * 16], size / 128);
 	_addFix = (float)((kTempoMusic - 8)) / 256;
 	_speechManager.cctable(_speechManager._tbi);
 


Commit: 0af5305a8a453bded313c021cd66ed2373fff741
    https://github.com/scummvm/scummvm/commit/0af5305a8a453bded313c021cd66ed2373fff741
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-26T15:08:56-07:00

Commit Message:
MORTEVIELLE: Remove another use of _mem

Changed paths:
    engines/mortevielle/mortevielle.cpp
    engines/mortevielle/mortevielle.h
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 616bee1..b4b46a4 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -104,6 +104,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
 	_curPict = nullptr;
 	_curAnim = nullptr;
 	_rightFramePict = nullptr;
+	_compMusicBuf1 = nullptr;
 	_compMusicBuf2 = nullptr;
 }
 
@@ -111,6 +112,7 @@ MortevielleEngine::~MortevielleEngine() {
 	free(_curPict);
 	free(_curAnim);
 	free(_rightFramePict);
+	free(_compMusicBuf1);
 	free(_compMusicBuf2);
 }
 
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 2300371..6f5d4b4 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -65,8 +65,6 @@ namespace Mortevielle {
  */
 const int kAdrMusic = 0x5000;
 
-const int kAdrCompMusicBuf1 = 0x7414;
-
 #define ord(v) ((int) v)
 #define chr(v) ((unsigned char) v)
 #define lo(v) ((v) & 0xff)
@@ -477,6 +475,7 @@ public:
 	byte *_curPict;
 	byte *_curAnim;
 	byte *_rightFramePict;
+	byte *_compMusicBuf1;
 	byte *_compMusicBuf2;
 	
 	Debugger _debugger;
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 899cd80..445f7fa 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -162,13 +162,15 @@ void SpeechManager::regenbruit() {
  */
 void SpeechManager::loadMusicSound() {
 	Common::File f;
-
 	if (!f.open("sonmus.mor"))
 		error("Missing file - sonmus.mor");
 
-	f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273 * 128);
+	free(_vm->_compMusicBuf1);
+	int size = f.size();
+	_vm->_compMusicBuf1 = (byte *)malloc(sizeof(byte) * size);
+	f.read(_vm->_compMusicBuf1, size);
 
-	_vm->_soundManager.decodeMusic(&_vm->_mem[kAdrCompMusicBuf1 * 16], &_vm->_mem[kAdrNoise * 16], 273);
+	_vm->_soundManager.decodeMusic(_vm->_compMusicBuf1, &_vm->_mem[kAdrNoise * 16], size / 128);
 	f.close();
 }
 


Commit: 93fe1c60d23fd2f014d9f531879eb0e2f66af1c4
    https://github.com/scummvm/scummvm/commit/93fe1c60d23fd2f014d9f531879eb0e2f66af1c4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-28T14:35:26-07:00

Commit Message:
MORTEVIELLE: Use heap allocation in GfxSurface::decode, remove one use of swap

Changed paths:
    engines/mortevielle/graphics.cpp
    engines/mortevielle/speech.cpp



diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index e5edeed..3a41169 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -120,15 +120,15 @@ void GfxSurface::decode(const byte *pSrc) {
 	}
 
 	// Temporary output buffer
-	byte outputBuffer[65536];
-	Common::fill(&outputBuffer[0], &outputBuffer[65536], _transparency);
+	byte *outputBuffer = (byte *)malloc(sizeof(byte) * 65536);
+	memset(outputBuffer, _transparency, 65536);
 
 	byte *pDest = &outputBuffer[0];
 	const byte *pSrcStart = pSrc;
 	const byte *pLookup = NULL;
 
-	byte lookupTable[BUFFER_SIZE];
-	byte srcBuffer[BUFFER_SIZE];
+	byte *lookupTable = (byte *)malloc(sizeof(byte) * BUFFER_SIZE);
+	byte *srcBuffer   = (byte *)malloc(sizeof(byte) * BUFFER_SIZE);
 
 	// Main processing loop
 	for (int entryIndex = 0; entryIndex < entryCount; ++entryIndex) {
@@ -427,6 +427,10 @@ void GfxSurface::decode(const byte *pSrc) {
 
 		Common::copy(copySrc, copySrc + w, copyDest);
 	}
+
+	::free(outputBuffer);
+	::free(lookupTable);
+	::free(srcBuffer);
 }
 
 void GfxSurface::majTtxTty() {
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 445f7fa..08c92c6 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -88,7 +88,7 @@ void SpeechManager::spfrac(int wor) {
 }
 
 void SpeechManager::charg_car(int &currWordNumb) {
-	int wor = swap(READ_LE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWordNumb]));
+	int wor = READ_BE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWordNumb]);
 	int int_ = wor & 0x3f; // 63
 
 	if ((int_ >= 0) && (int_ <= 13)) {


Commit: eb1164539d43cf32400614d613a6724da20bc7b4
    https://github.com/scummvm/scummvm/commit/eb1164539d43cf32400614d613a6724da20bc7b4
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-28T16:58:03-07:00

Commit Message:
MORTEVIELLE: Remove remaining macros, start refactoring menus, modify the way _cfiphBuffer is read/written

Changed paths:
    engines/mortevielle/actions.cpp
    engines/mortevielle/graphics.cpp
    engines/mortevielle/menu.cpp
    engines/mortevielle/menu.h
    engines/mortevielle/mortevielle.h
    engines/mortevielle/speech.cpp
    engines/mortevielle/speech.h
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 88eee0c..5738a8f 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -41,13 +41,14 @@ namespace Mortevielle {
  * @remarks	Originally called 'taller'
  */
 void MortevielleEngine::fctMove() {
-	if ((_coreVar._currPlace == ROOM26) && (_currAction == _menu._moveMenu[6])) {
+	int oldMenu = (_menu._moveMenu[6]._menuId << 8) | _menu._moveMenu[6]._actionId;
+	if ((_coreVar._currPlace == ROOM26) && (_currAction == oldMenu)) {
 		_coreVar._currPlace = LANDING;
 		_caff = _coreVar._currPlace;
 		drawPictureWithText();
 		handleDescriptionText(2, _coreVar._currPlace);
 	}
-	if ((_coreVar._currPlace == LANDING) && (_currAction == _menu._moveMenu[6])) {
+	if ((_coreVar._currPlace == LANDING) && (_currAction == oldMenu)) {
 		if (!_syn)
 			displayTextInVerbBar(getEngineString(S_GO_TO));
 		displayStatusArrow();
@@ -85,9 +86,11 @@ void MortevielleEngine::fctMove() {
 	}
 	exitRoom();
 	int menuChoice = 1;
-
-	while (_menu._moveMenu[menuChoice] != _currAction)
+	oldMenu = (_menu._moveMenu[menuChoice]._menuId << 8) | _menu._moveMenu[menuChoice]._actionId;
+	while (oldMenu != _currAction) {
 		++menuChoice;
+		oldMenu = (_menu._moveMenu[menuChoice]._menuId << 8) | _menu._moveMenu[menuChoice]._actionId;
+	}
 
 	if (_coreVar._currPlace == MOUNTAIN) {
 		if (menuChoice == 1)
@@ -300,9 +303,11 @@ void MortevielleEngine::fctTake() {
  */
 void MortevielleEngine::fctInventoryTake() {
 	int inventIndex = 0;
+	int oldMenu = 0;
 	do {
 		++inventIndex;
-	} while (_menu._inventoryMenu[inventIndex] != _currAction);
+		oldMenu = (_menu._inventoryMenu[inventIndex]._menuId << 8) | _menu._inventoryMenu[inventIndex]._actionId;
+	} while (oldMenu != _currAction);
 	int cz = 0;
 	int cy = 0;
 	do {
@@ -1154,7 +1159,7 @@ void MortevielleEngine::fctEnter() {
 				++_coreVar._faithScore;
 				_coreVar._currPlace = LANDING;
 				_currMenu = MENU_DISCUSS;
-				_currAction = _menu._discussMenu[charIndex];
+				_currAction = (_menu._discussMenu[charIndex]._menuId << 8) | _menu._discussMenu[charIndex]._actionId;
 				_syn = true;
 				if (_roomDoorId == ROOM9) {
 					_col = true;
@@ -1352,9 +1357,11 @@ void MortevielleEngine::fctDiscuss() {
 		displId = 128;
 	else {
 		cx = 0;
+		int oldMenu;
 		do {
 			++cx;
-		} while (_menu._discussMenu[cx] != _currAction);
+			oldMenu = (_menu._discussMenu[cx]._menuId << 8) | _menu._discussMenu[cx]._actionId;
+		} while (oldMenu != _currAction);
 		_caff = 69 + cx;
 		drawPictureWithText();
 		handleDescriptionText(2, _caff);
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index 3a41169..8392fab 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -1113,7 +1113,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
 	pt.x += 1;
 	pt.y += 1;
 	for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
-		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), ord(l[x - 1]), color);
+		_vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), l[x - 1], color);
 		pt.x += charWidth;
 	}
 	_vm->_mouse.showMouse();
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a1f6289..f86fd20 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -52,32 +52,30 @@ const byte menuConstants[8][4] = {
  * Setup a menu's contents
  * @remarks	Originally called 'menut'
  */
-void Menu::setText(int menuId, Common::String name) {
-	byte h = hi(menuId);
-	byte l = lo(menuId);
+void Menu::setText(int menuId, int actionId, Common::String name) {
 	Common::String s = name;
 
 	while (s.size() < 22)
 		s += ' ';
 
-	switch (h) {
+	switch (menuId) {
 	case MENU_INVENTORY:
-		if (l != 7) {
-			_inventoryStringArray[l] = s;
-			_inventoryStringArray[l].insertChar(' ', 0);
+		if (actionId != 7) {
+			_inventoryStringArray[actionId] = s;
+			_inventoryStringArray[actionId].insertChar(' ', 0);
 		}
 		break;
 	case MENU_MOVE:
-		_moveStringArray[l] = s;
+		_moveStringArray[actionId] = s;
 		break;
 	case MENU_ACTION:
-		_actionStringArray[l] = s;
+		_actionStringArray[actionId] = s;
 		break;
 	case MENU_SELF:
-		_selfStringArray[l] = s;
+		_selfStringArray[actionId] = s;
 		break;
 	case MENU_DISCUSS:
-		_discussStringArray[l] = s;
+		_discussStringArray[actionId] = s;
 		break;
 	default:
 		break;
@@ -99,40 +97,38 @@ void Menu::setDestinationText(int roomId) {
 		nomp = _vm->getString(_vm->_destinationArray[destinationId][roomId] + kMenuPlaceStringIndex);
 		while (nomp.size() < 20)
 			nomp += ' ';
-		setText(_moveMenu[destinationId + 1], nomp);
+		setText(_moveMenu[destinationId + 1]._menuId, _moveMenu[destinationId + 1]._actionId, nomp);
 	}
 	nomp = "*                   ";
 	for (int i = 7; i >= destinationId + 1; --i)
-		setText(_moveMenu[i], nomp);
+		setText(_moveMenu[i]._menuId, _moveMenu[i]._actionId, nomp);
 }
 
 /**
  * _disable a menu item
- * @param menuId	Hi byte represents menu number, lo byte reprsents item index
+ * @param menuId	Menu number
+ * @param actionId  Item index
  */
-void Menu::disableMenuItem(int menuId) {
-	byte h = hi(menuId);
-	byte l = lo(menuId);
-
-	switch (h) {
+void Menu::disableMenuItem(int menuId, int actionId) {
+	switch (menuId) {
 	case MENU_INVENTORY:
-		if (l > 6) {
-			_inventoryStringArray[l].setChar('<', 0);
-			_inventoryStringArray[l].setChar('>', 21);
+		if (actionId > 6) {
+			_inventoryStringArray[actionId].setChar('<', 0);
+			_inventoryStringArray[actionId].setChar('>', 21);
 		} else
-			_inventoryStringArray[l].setChar('*', 0);
+			_inventoryStringArray[actionId].setChar('*', 0);
 		break;
 	case MENU_MOVE:
-		_moveStringArray[l].setChar('*', 0);
+		_moveStringArray[actionId].setChar('*', 0);
 		break;
 	case MENU_ACTION:
-		_actionStringArray[l].setChar('*', 0);
+		_actionStringArray[actionId].setChar('*', 0);
 		break;
 	case MENU_SELF:
-		_selfStringArray[l].setChar('*', 0);
+		_selfStringArray[actionId].setChar('*', 0);
 		break;
 	case MENU_DISCUSS:
-		_discussStringArray[l].setChar('*', 0);
+		_discussStringArray[actionId].setChar('*', 0);
 		break;
 	default:
 		break;
@@ -141,31 +137,29 @@ void Menu::disableMenuItem(int menuId) {
 
 /**
  * Enable a menu item
- * @param menuId	Hi byte represents menu number, lo byte reprsents item index
+ * @param menuId	Menu number
+ * @param actionId  Item index
  * @remarks	Originally called menu_enable
  */
-void Menu::enableMenuItem(int menuId) {
-	byte h = hi(menuId);
-	byte l = lo(menuId);
-
-	switch (h) {
+void Menu::enableMenuItem(int menuId, int actionId) {
+	switch (menuId) {
 	case MENU_INVENTORY:
-		_inventoryStringArray[l].setChar(' ', 0);
-		_inventoryStringArray[l].setChar(' ', 21);
+		_inventoryStringArray[actionId].setChar(' ', 0);
+		_inventoryStringArray[actionId].setChar(' ', 21);
 		break;
 	case MENU_MOVE:
-		_moveStringArray[l].setChar(' ', 0);
+		_moveStringArray[actionId].setChar(' ', 0);
 		break;
 	case MENU_ACTION:
-		_actionStringArray[l].setChar(' ', 0);
+		_actionStringArray[actionId].setChar(' ', 0);
 		break;
 	case MENU_SELF:
-		_selfStringArray[l].setChar(' ', 0);
+		_selfStringArray[actionId].setChar(' ', 0);
 		// The original sets two times the same value. Skipped
 		// _selfStringArray[l].setChar(' ', 0);
 		break;
 	case MENU_DISCUSS:
-		_discussStringArray[l].setChar(' ', 0);
+		_discussStringArray[actionId].setChar(' ', 0);
 		break;
 	default:
 		break;
@@ -235,7 +229,7 @@ void Menu::invert(int indx) {
 	if (_msg4 == OPCODE_NONE)
 		return;
 
-	int menuIndex = lo(_msg4);
+	int menuIndex = _msg4 & 0xFF;
 
 	_vm->_screenSurface.putxy(menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
 
@@ -471,7 +465,7 @@ void Menu::updateMenu() {
 			// Another menu to be _displayed
 			_vm->setMouseClick(false);
 			menuUp(_msg3);
-			if (lo(_msg4) == 1)
+			if ((_msg4 & 0xFF) == 1)
 				_msg3 = MENU_SAVE;
 			else
 				_msg3 = MENU_LOAD;
@@ -531,12 +525,16 @@ void Menu::initMenu(MortevielleEngine *vm) {
 		++i;
 	} while (i != 22);
 	for (i = 1; i <= 8; ++i) {
-		_discussMenu[i] = 0x500 + i;
-		if (i < 8)
-			_moveMenu[i] = 0x200 + i;
-		_inventoryMenu[i] = 0x100 + i;
+		_discussMenu[i]._menuId = MENU_DISCUSS;
+		_discussMenu[i]._actionId = i;
+		if (i < 8) {
+			_moveMenu[i]._menuId = MENU_MOVE;
+			_moveMenu[i]._actionId = i;
+		}
+		_inventoryMenu[i]._menuId = MENU_INVENTORY;
+		_inventoryMenu[i]._actionId = i;
 		if (i > 6)
-			disableMenuItem(_inventoryMenu[i]);
+			disableMenuItem(_inventoryMenu[i]._menuId, _inventoryMenu[i]._actionId);
 	}
 	_msg3 = OPCODE_NONE;
 	_msg4 = OPCODE_NONE;
@@ -551,13 +549,13 @@ void Menu::initMenu(MortevielleEngine *vm) {
  */
 void Menu::setSearchMenu() {
 	for (int i = 1; i <= 7; ++i)
-		disableMenuItem(_moveMenu[i]);
+		disableMenuItem(MENU_MOVE, _moveMenu[i]._actionId);
 
 	for (int i = 1; i <= 11; ++i)
-		disableMenuItem(_actionMenu[i]);
+		disableMenuItem(_actionMenu[i]._menuId, _actionMenu[i]._actionId);
 
-	setText(OPCODE_SOUND, _vm->getEngineString(S_SUITE));
-	setText(OPCODE_LIFT, _vm->getEngineString(S_STOP));
+	setText(OPCODE_SOUND >> 8, OPCODE_SOUND & 0xFF, _vm->getEngineString(S_SUITE));
+	setText(OPCODE_LIFT  >> 8, OPCODE_LIFT  & 0xFF, _vm->getEngineString(S_STOP));
 }
 
 /**
@@ -567,10 +565,10 @@ void Menu::setSearchMenu() {
 void Menu::unsetSearchMenu() {
 	setDestinationText(_vm->_coreVar._currPlace);
 	for (int i = 1; i <= 11; ++i)
-		enableMenuItem(_actionMenu[i]);
+		enableMenuItem(_actionMenu[i]._menuId, _actionMenu[i]._actionId);
 
-	setText(OPCODE_SOUND, _vm->getEngineString(S_PROBE));
-	setText(OPCODE_LIFT, _vm->getEngineString(S_RAISE));
+	setText(OPCODE_SOUND >> 8, OPCODE_SOUND & 0xFF, _vm->getEngineString(S_PROBE));
+	setText(OPCODE_LIFT  >> 8, OPCODE_LIFT  & 0xFF, _vm->getEngineString(S_RAISE));
 }
 
 /**
@@ -586,15 +584,15 @@ void Menu::setInventoryText() {
 			++cy;
 			int r = _vm->_coreVar._inventory[i] + 400;
 			nomp = _vm->getString(r - 501 + kInventoryStringIndex);
-			setText(_inventoryMenu[cy], nomp);
-			enableMenuItem(_inventoryMenu[i]);
+			setText(_inventoryMenu[cy]._menuId, _inventoryMenu[cy]._actionId, nomp);
+			enableMenuItem(_inventoryMenu[i]._menuId, _inventoryMenu[i]._actionId);
 		}
 	}
 
 	if (cy < 6) {
 		for (int i = cy + 1; i <= 6; ++i) {
-			setText(_inventoryMenu[i], "                       ");
-			disableMenuItem(_inventoryMenu[i]);
+			setText(_inventoryMenu[i]._menuId, _inventoryMenu[i]._actionId, "                       ");
+			disableMenuItem(_inventoryMenu[i]._menuId, _inventoryMenu[i]._actionId);
 		}
 	}
 }
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index d4538ef..2428d89 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -40,6 +40,33 @@ enum {
 	MENU_LOAD = 8
 };
 
+enum verbs {OPCODE_NONE = 0, OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305,
+OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
+OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
+OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
+OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
+OPCODE_SLOOK = 0x405};
+
+struct menuItem {
+	int _menuId;
+	int _actionId;
+};
+
+static const menuItem _actionMenu[12] = {
+	{OPCODE_NONE   >> 8, OPCODE_NONE & 0xFF},
+	{OPCODE_SHIDE  >> 8, OPCODE_SHIDE & 0xFF},
+	{OPCODE_ATTACH >> 8, OPCODE_ATTACH & 0xFF}, 
+	{OPCODE_FORCE  >> 8, OPCODE_FORCE & 0xFF}, 
+	{OPCODE_SLEEP  >> 8, OPCODE_SLEEP & 0xFF},
+	{OPCODE_ENTER  >> 8, OPCODE_ENTER & 0xFF}, 
+	{OPCODE_CLOSE  >> 8, OPCODE_CLOSE & 0xFF},  
+	{OPCODE_KNOCK  >> 8, OPCODE_KNOCK & 0xFF},
+	{OPCODE_EAT    >> 8, OPCODE_EAT & 0xFF},
+	{OPCODE_PLACE  >> 8, OPCODE_PLACE & 0xFF},
+	{OPCODE_OPEN   >> 8, OPCODE_OPEN & 0xFF},
+	{OPCODE_LEAVE  >> 8, OPCODE_LEAVE & 0xFF}
+};
+
 class Menu {
 private:
 	MortevielleEngine *_vm;
@@ -61,15 +88,15 @@ public:
 	Common::String _actionStringArray[22];
 	Common::String _selfStringArray[7];
 	Common::String _discussStringArray[9];
-	int _discussMenu[9];
-	int _inventoryMenu[9];
-	int _moveMenu[8];
+	menuItem _discussMenu[9];
+	menuItem _inventoryMenu[9];
+	menuItem _moveMenu[8];
 
-	void setText(int menuId, Common::String name);
+	void setText(int menuId, int actionId, Common::String name);
 	void setDestinationText(int roomId);
 	void setInventoryText();
-	void disableMenuItem(int menuId);
-	void enableMenuItem(int menuId);
+	void disableMenuItem(int menuId, int actionId);
+	void enableMenuItem(int menuId, int actionId);
 	void displayMenu();
 	void drawMenu();
 	void menuUp(int msgId);
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 6f5d4b4..4d07d30 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -65,12 +65,6 @@ namespace Mortevielle {
  */
 const int kAdrMusic = 0x5000;
 
-#define ord(v) ((int) v)
-#define chr(v) ((unsigned char) v)
-#define lo(v) ((v) & 0xff)
-#define hi(v) (((v) >> 8) & 0xff)
-#define swap(v) (((lo(v)) << 8) | ((hi(v)) >> 8))
-
 // Debug channels
 enum {
 	kMortevielleCore = 1 << 0,
@@ -137,20 +131,6 @@ const int kMenuSelfStringIndex = 497;
 const int kMenuSayStringIndex = 502;
 const int kMaxPatt = 20;
 
-const int OPCODE_NONE = 0;
-enum verbs {OPCODE_ATTACH = 0x301, OPCODE_WAIT = 0x302,  OPCODE_FORCE = 0x303,   OPCODE_SLEEP = 0x304, OPCODE_LISTEN = 0x305,
-            OPCODE_ENTER = 0x306,  OPCODE_CLOSE = 0x307, OPCODE_SEARCH = 0x308,  OPCODE_KNOCK = 0x309, OPCODE_SCRATCH = 0x30a,
-			OPCODE_READ = 0x30b,   OPCODE_EAT = 0x30c,   OPCODE_PLACE = 0x30d,   OPCODE_OPEN = 0x30e,  OPCODE_TAKE = 0x30f,
-			OPCODE_LOOK = 0x310,   OPCODE_SMELL = 0x311, OPCODE_SOUND = 0x312,   OPCODE_LEAVE = 0x313, OPCODE_LIFT = 0x314,
-			OPCODE_TURN = 0x315,   OPCODE_SHIDE = 0x401, OPCODE_SSEARCH = 0x402, OPCODE_SREAD = 0x403, OPCODE_SPUT = 0x404,
-			OPCODE_SLOOK = 0x405};
-
-static const int _actionMenu[12] = { OPCODE_NONE,
-		OPCODE_SHIDE, OPCODE_ATTACH, OPCODE_FORCE, OPCODE_SLEEP,
-		OPCODE_ENTER, OPCODE_CLOSE,  OPCODE_KNOCK, OPCODE_EAT,
-		OPCODE_PLACE, OPCODE_OPEN,   OPCODE_LEAVE
-};
-
 /*
 9   "A glance at the forbidden$",
 18  "It's already open$",
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 08c92c6..68ae3da 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -150,7 +150,7 @@ void SpeechManager::regenbruit() {
 	int i = kOffsetB3 + 8590;
 	int j = 0;
 	do {
-		_cfiphBuffer[j] = READ_LE_UINT16(&_vm->_mem[(kAdrNoise3 * 16) + i]);
+		_cfiphBuffer[j] = READ_BE_UINT16(&_vm->_mem[(kAdrNoise3 * 16) + i]);
 		i += 2;
 		++j;
 	} while (i < kOffsetB3 + 8790);
@@ -185,7 +185,7 @@ void SpeechManager::loadPhonemeSounds() {
 		error("Missing file - phbrui.mor");
 
 	for (int i = 1; i <= f.size() / 2; ++i)
-		_cfiphBuffer[i] = f.readSint16LE();
+		_cfiphBuffer[i] = f.readUint16BE();
 
 	f.close();
 }
@@ -214,7 +214,7 @@ void SpeechManager::trait_car() {
 
 	switch (_queue[1]._code) {
 	case 9:
-		if (_queue[1]._val != ord('#'))
+		if (_queue[1]._val != (int)'#')
 			for (i = 0; i <= _queue[1]._rep; ++i)
 				entroct(_queue[1]._val);
 		break;
@@ -533,13 +533,16 @@ void SpeechManager::initQueue() {
  * @remarks	Originally called 'trait_ph'
  */
 void SpeechManager::handlePhoneme() {
-	const int deca[3] = {300, 30, 40};
+	const uint16 deca[3] = {300, 30, 40};
 
-	int startPos = swap(_cfiphBuffer[_phonemeNumb - 1]) + deca[_typlec];
-	int endPos = swap(_cfiphBuffer[_phonemeNumb]) + deca[_typlec];
+	uint16 startPos = _cfiphBuffer[_phonemeNumb - 1] + deca[_typlec];
+	uint16 endPos = _cfiphBuffer[_phonemeNumb] + deca[_typlec];
 	int wordCount = endPos - startPos;
-	for (int i = (uint)startPos >> 1, currWord = 0; i < (int)((uint)endPos >> 1); i++, currWord += 2)
-		WRITE_LE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWord], _cfiphBuffer[i]);
+	
+	startPos /= 2;
+	endPos /= 2;
+	for (int i = startPos, currWord = 0; i < endPos; i++, currWord += 2)
+		WRITE_BE_UINT16(&_vm->_mem[(kAdrWord * 16) + currWord], _cfiphBuffer[i]);
 
 	_ptr_oct = 0;
 	int currWord = 0;
@@ -553,7 +556,7 @@ void SpeechManager::handlePhoneme() {
 
 	moveQueue();
 	trait_car();
-	entroct(ord('#'));
+	entroct((int)'#');
 }
 
 /**
@@ -561,7 +564,7 @@ void SpeechManager::handlePhoneme() {
  * @remarks	Originally called 'parole'
  */
 void SpeechManager::startSpeech(int rep, int ht, int typ) {
-	int savph[501];
+	uint16 savph[501];
 	int tempo;
 
 	if (_vm->_soundOff)
diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h
index ef3211d..c3c4c32 100644
--- a/engines/mortevielle/speech.h
+++ b/engines/mortevielle/speech.h
@@ -75,7 +75,7 @@ private:
 	int _ptr_oct;
 
 public:
-	int16 *_cfiphBuffer;
+	uint16 *_cfiphBuffer;
 	int _tbi[256];
 	int _mlec;
 	byte *_noise5Buf;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 7a83060..2316d1e 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -282,7 +282,7 @@ void MortevielleEngine::handleAction() {
 		_menu.eraseMenu();
 		_menu._menuDisplayed = false;
 		if ((inkey == '\1') || (inkey == '\3') || (inkey == '\5') || (inkey == '\7') || (inkey == '\11')) {
-			changeGraphicalDevice((uint)(ord(inkey) - 1) >> 1);
+			changeGraphicalDevice((uint)((int)inkey - 1) >> 1);
 			return;
 		}
 		if (_menu._menuSelected && (_currMenu == MENU_SAVE)) {
@@ -504,48 +504,48 @@ void MortevielleEngine::showPeoplePresent(int bitIndex) {
 	int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
 
 	for (int i = 1; i <= 8; ++i)
-		_menu.disableMenuItem(_menu._discussMenu[i]);
+		_menu.disableMenuItem(_menu._discussMenu[i]._menuId, _menu._discussMenu[i]._actionId);
 
 	clearUpperRightPart();
 	if ((bitIndex & 128) == 128) {
 		_screenSurface.putxy(xp, 24);
 		_screenSurface.drawString("LEO", 4);
-		_menu.enableMenuItem(_menu._discussMenu[1]);
+		_menu.enableMenuItem(_menu._discussMenu[1]._menuId, _menu._discussMenu[1]._actionId);
 	}
 	if ((bitIndex & 64) == 64) {
 		_screenSurface.putxy(xp, 32);
 		_screenSurface.drawString("PAT", 4);
-		_menu.enableMenuItem(_menu._discussMenu[2]);
+		_menu.enableMenuItem(_menu._discussMenu[2]._menuId, _menu._discussMenu[2]._actionId);
 	}
 	if ((bitIndex & 32) == 32) {
 		_screenSurface.putxy(xp, 40);
 		_screenSurface.drawString("GUY", 4);
-		_menu.enableMenuItem(_menu._discussMenu[3]);
+		_menu.enableMenuItem(_menu._discussMenu[3]._menuId, _menu._discussMenu[3]._actionId);
 	}
 	if ((bitIndex & 16) == 16) {
 		_screenSurface.putxy(xp, 48);
 		_screenSurface.drawString("EVA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[4]);
+		_menu.enableMenuItem(_menu._discussMenu[4]._menuId, _menu._discussMenu[4]._actionId);
 	}
 	if ((bitIndex & 8) == 8) {
 		_screenSurface.putxy(xp, 56);
 		_screenSurface.drawString("BOB", 4);
-		_menu.enableMenuItem(_menu._discussMenu[5]);
+		_menu.enableMenuItem(_menu._discussMenu[5]._menuId, _menu._discussMenu[5]._actionId);
 	}
 	if ((bitIndex & 4) == 4) {
 		_screenSurface.putxy(xp, 64);
 		_screenSurface.drawString("LUC", 4);
-		_menu.enableMenuItem(_menu._discussMenu[6]);
+		_menu.enableMenuItem(_menu._discussMenu[6]._menuId, _menu._discussMenu[6]._actionId);
 	}
 	if ((bitIndex & 2) == 2) {
 		_screenSurface.putxy(xp, 72);
 		_screenSurface.drawString("IDA", 4);
-		_menu.enableMenuItem(_menu._discussMenu[7]);
+		_menu.enableMenuItem(_menu._discussMenu[7]._menuId, _menu._discussMenu[7]._actionId);
 	}
 	if ((bitIndex & 1) == 1) {
 		_screenSurface.putxy(xp, 80);
 		_screenSurface.drawString("MAX", 4);
-		_menu.enableMenuItem(_menu._discussMenu[8]);
+		_menu.enableMenuItem(_menu._discussMenu[8]._menuId, _menu._discussMenu[8]._actionId);
 	}
 	_currBitIndex = bitIndex;
 }
@@ -699,7 +699,7 @@ int MortevielleEngine::getPresenceStatsRedRoom() {
  */
 void MortevielleEngine::displayAloneText() {
 	for (int i = 1; i <= 8; ++i)
-		_menu.disableMenuItem(_menu._discussMenu[i]);
+		_menu.disableMenuItem(_menu._discussMenu[i]._menuId, _menu._discussMenu[i]._actionId);
 
 	Common::String sYou = getEngineString(S_YOU);
 	Common::String sAre = getEngineString(S_ARE);
@@ -1643,7 +1643,7 @@ void MortevielleEngine::hourToChar() {
 		minute = 1;
 	hour += day * 24;
 	minute += hour * 2;
-	_coreVar._fullHour = chr(minute);
+	_coreVar._fullHour = (unsigned char)minute;
 }
 
 /**
@@ -1651,7 +1651,7 @@ void MortevielleEngine::hourToChar() {
  * @remarks	Originally called 'theure'
  */
 void MortevielleEngine::charToHour() {
-	int fullHour = ord(_coreVar._fullHour);
+	int fullHour = _coreVar._fullHour;
 	int tmpHour = fullHour % 48;
 	_currDay = fullHour / 48;
 	_currHalfHour = tmpHour % 2;
@@ -1869,16 +1869,16 @@ bool MortevielleEngine::decryptNextChar(char &c, int &idx, byte &pt) {
 		}
 
 		if (oct == 30)
-			c = chr(cryptoArr30[ocd]);
+			c = (unsigned char)cryptoArr30[ocd];
 		else
-			c = chr(cryptoArr31[ocd]);
+			c = (unsigned char)cryptoArr31[ocd];
 
 		if (c == '\0') {
 			c = '#';
 			return true;
 		}
 	} else {
-		c = chr(cryptoArrDefault[oct]);
+		c = (unsigned char)cryptoArrDefault[oct];
 	}
 	return false;
 }
@@ -1944,7 +1944,7 @@ void MortevielleEngine::resetVariables() {
 	// Only object in inventory: a gun
 	_coreVar._inventory[1] = 113;
 
-	_coreVar._fullHour = chr(20);
+	_coreVar._fullHour = (unsigned char)20;
 
 	for (int i = 1; i <= 10; ++i)
 		_coreVar._pctHintFound[i] = ' ';
@@ -2175,10 +2175,10 @@ void MortevielleEngine::loadCFIPH() {
 			error("Missing file - *cfiph.mor");
 	}
 
-	_speechManager._cfiphBuffer = (int16 *)malloc(sizeof(int16) * (f.size() / 2));
+	_speechManager._cfiphBuffer = (uint16 *)malloc(sizeof(uint16) * (f.size() / 2));
 
 	for (int i = 0; i < (f.size() / 2); ++i)
-		_speechManager._cfiphBuffer[i] = f.readSint16LE();
+		_speechManager._cfiphBuffer[i] = f.readUint16BE();
 
 	f.close();
 }
@@ -2307,7 +2307,7 @@ void MortevielleEngine::prepareRoom() {
 		if (hintCount == 10)
 			pctStr = "10";
 		else
-			pctStr = chr(hintCount + 48);
+			pctStr = (unsigned char)(hintCount + 48);
 
 		_hintPctMessage = "[1][";
 		_hintPctMessage += getEngineString(S_SHOULD_HAVE_NOTICED);
@@ -2762,8 +2762,8 @@ void MortevielleEngine::displayItemInHand(int objId) {
 	if (objId != 500)
 		strp = getString(objId - 501 + kInventoryStringIndex);
 
-	_menu.setText(_menu._inventoryMenu[8], strp);
-	_menu.disableMenuItem(_menu._inventoryMenu[8]);
+	_menu.setText(_menu._inventoryMenu[8]._menuId, _menu._inventoryMenu[8]._actionId, strp);
+	_menu.disableMenuItem(_menu._inventoryMenu[8]._menuId, _menu._inventoryMenu[8]._actionId);
 }
 
 /**
@@ -3234,7 +3234,7 @@ L1:
 		_caff = 69 + cx;
 		_crep = _caff;
 		_currMenu = MENU_DISCUSS;
-		_currAction = _menu._discussMenu[cx];
+		_currAction = (_menu._discussMenu[cx]._menuId << 8) | _menu._discussMenu[cx]._actionId;
 		_syn = true;
 		_col = true;
 	} else {
@@ -3291,7 +3291,7 @@ void MortevielleEngine::displayStatusArrow() {
 	if (_num == 9999)
 		return;
 
-	displayStatusInDescriptionBar(chr(152));
+	displayStatusInDescriptionBar((unsigned char)152);
 	bool inRect = false;
 	do {
 		touch = '\0';
@@ -3450,7 +3450,7 @@ void MortevielleEngine::displayStatusInDescriptionBar(char stat) {
 	else
 		color = 12;
 
-	_screenSurface.writeCharacter(Common::Point(306, 193), ord(stat), color);
+	_screenSurface.writeCharacter(Common::Point(306, 193), stat, color);
 	_screenSurface.drawBox(300, 191, 16, 8, 15);
 	_mouse.showMouse();
 }
@@ -3491,7 +3491,7 @@ int MortevielleEngine::gettKeyPressed() {
 		break;
 	}
 
-	return ord(ch);
+	return (int)ch;
 }
 
 } // End of namespace Mortevielle


Commit: 477a90f93ef203d9a5a366fe30bb7e85874e082a
    https://github.com/scummvm/scummvm/commit/477a90f93ef203d9a5a366fe30bb7e85874e082a
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-28T22:27:31-07:00

Commit Message:
DEVTOOLS: Add support to another DOS executable for Mortevielle

Changed paths:
    devtools/create_mortdat/create_mortdat.cpp



diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp
index cb7d6aa..653a075 100644
--- a/devtools/create_mortdat/create_mortdat.cpp
+++ b/devtools/create_mortdat/create_mortdat.cpp
@@ -119,13 +119,13 @@ void openOutputFile(const char *outFilename) {
  * Write out the data for the font 
  */
 void writeFontBlock() {
-	const int knownAddr[2] = {0x36b0, 0x36c0};
+	const int knownAddr[3] = {0x30cd, 0x36b0, 0x36c0};
 	byte checkBuffer[7];
 	byte fontBuffer[121 * 6];
 
 	// Move to just prior the font data and verify that we're reading the known mort.com
-	for (int i = 0; i <= 2; ++i) {
-		if ( i == 2) {
+	for (int i = 0; i <= 3; ++i) {
+		if ( i == 3) {
 			printf("Invalid mort.com input file");
 			exit(0);
 		}


Commit: 350210dd90b134112378573827a8c309210cf9f9
    https://github.com/scummvm/scummvm/commit/350210dd90b134112378573827a8c309210cf9f9
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-07-29T12:02:06-07:00

Commit Message:
Merge pull request #347 from Strangerke/mortevielle

New Engine : Mortevielle

Changed paths:
  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/module.mk
  A devtools/extract_mort/extract_mort.cpp
  A devtools/extract_mort/module.mk
  A dists/engine-data/mort.dat
  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/speech.cpp
  A engines/mortevielle/speech.h
  A engines/mortevielle/utils.cpp
    Makefile.common
    devtools/README
    dists/engine-data/README
    dists/scummvm.rc
    dists/scummvm.rc.in
    engines/configure.engines
    engines/engines.mk
    engines/plugins_table.h









More information about the Scummvm-git-logs mailing list