[Scummvm-git-logs] scummvm master -> 071073ea20df39ba1ed822a3e95ec19373f03c97

dreammaster noreply at scummvm.org
Tue Jul 21 11:50:06 UTC 2026


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

Summary:
d2e1304fe4 MADS: Move all games' logic out of madsv2/ subfolder
071073ea20 MADS: Merge MADSV2 sub-namespace into main MADS namespace


Commit: d2e1304fe4a00e2a90753c49b3143e29536716d7
    https://github.com/scummvm/scummvm/commit/d2e1304fe4a00e2a90753c49b3143e29536716d7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-21T21:49:48+10:00

Commit Message:
MADS: Move all games' logic out of madsv2/ subfolder

Changed paths:
  A engines/mads/animview/anim_timer.cpp
  A engines/mads/animview/anim_timer.h
  A engines/mads/animview/animview.cpp
  A engines/mads/animview/animview.h
  A engines/mads/animview/functions.cpp
  A engines/mads/animview/functions.h
  A engines/mads/console.cpp
  A engines/mads/console.h
  A engines/mads/core/anim.cpp
  A engines/mads/core/anim.h
  A engines/mads/core/attr.cpp
  A engines/mads/core/attr.h
  A engines/mads/core/btype.h
  A engines/mads/core/buffer.cpp
  A engines/mads/core/buffer.h
  A engines/mads/core/camera.cpp
  A engines/mads/core/camera.h
  A engines/mads/core/color.cpp
  A engines/mads/core/color.h
  A engines/mads/core/concat.h
  A engines/mads/core/config.cpp
  A engines/mads/core/config.h
  A engines/mads/core/conv.cpp
  A engines/mads/core/conv.h
  A engines/mads/core/cursor.cpp
  A engines/mads/core/cursor.h
  A engines/mads/core/cycle.cpp
  A engines/mads/core/cycle.h
  A engines/mads/core/dialog.cpp
  A engines/mads/core/dialog.h
  A engines/mads/core/echo.h
  A engines/mads/core/ems.cpp
  A engines/mads/core/ems.h
  A engines/mads/core/env.cpp
  A engines/mads/core/env.h
  A engines/mads/core/error.cpp
  A engines/mads/core/error.h
  A engines/mads/core/fileio.cpp
  A engines/mads/core/fileio.h
  A engines/mads/core/font.cpp
  A engines/mads/core/font.h
  A engines/mads/core/game.cpp
  A engines/mads/core/game.h
  A engines/mads/core/general.h
  A engines/mads/core/global.cpp
  A engines/mads/core/global.h
  A engines/mads/core/heap.cpp
  A engines/mads/core/heap.h
  A engines/mads/core/himem.cpp
  A engines/mads/core/himem.h
  A engines/mads/core/hspot.cpp
  A engines/mads/core/hspot.h
  A engines/mads/core/image.cpp
  A engines/mads/core/image.h
  A engines/mads/core/imath.cpp
  A engines/mads/core/imath.h
  A engines/mads/core/implode.cpp
  A engines/mads/core/implode.h
  A engines/mads/core/inter.cpp
  A engines/mads/core/inter.h
  A engines/mads/core/kernel.cpp
  A engines/mads/core/kernel.h
  A engines/mads/core/keys.cpp
  A engines/mads/core/keys.h
  A engines/mads/core/lib.cpp
  A engines/mads/core/lib.h
  A engines/mads/core/loader.cpp
  A engines/mads/core/loader.h
  A engines/mads/core/mads.h
  A engines/mads/core/magic.cpp
  A engines/mads/core/magic.h
  A engines/mads/core/matte.cpp
  A engines/mads/core/matte.h
  A engines/mads/core/mcga.cpp
  A engines/mads/core/mcga.h
  A engines/mads/core/mem.cpp
  A engines/mads/core/mem.h
  A engines/mads/core/mouse.cpp
  A engines/mads/core/mouse.h
  A engines/mads/core/mps_archive.cpp
  A engines/mads/core/mps_archive.h
  A engines/mads/core/object.cpp
  A engines/mads/core/object.h
  A engines/mads/core/pack.cpp
  A engines/mads/core/pack.h
  A engines/mads/core/pal.cpp
  A engines/mads/core/pal.h
  A engines/mads/core/pfab.cpp
  A engines/mads/core/pfab.h
  A engines/mads/core/player.cpp
  A engines/mads/core/player.h
  A engines/mads/core/popup.cpp
  A engines/mads/core/popup.h
  A engines/mads/core/qual.h
  A engines/mads/core/quote.cpp
  A engines/mads/core/quote.h
  A engines/mads/core/rail.cpp
  A engines/mads/core/rail.h
  A engines/mads/core/room.cpp
  A engines/mads/core/room.h
  A engines/mads/core/screen.cpp
  A engines/mads/core/screen.h
  A engines/mads/core/sort.cpp
  A engines/mads/core/sort.h
  A engines/mads/core/sound.cpp
  A engines/mads/core/sound.h
  A engines/mads/core/speech.cpp
  A engines/mads/core/speech.h
  A engines/mads/core/sprite.cpp
  A engines/mads/core/sprite.h
  A engines/mads/core/sprite_0.cpp
  A engines/mads/core/sprite_h.h
  A engines/mads/core/sprite_k.cpp
  A engines/mads/core/text.cpp
  A engines/mads/core/text.h
  A engines/mads/core/tile.cpp
  A engines/mads/core/tile.h
  A engines/mads/core/timer.cpp
  A engines/mads/core/timer.h
  A engines/mads/core/video.cpp
  A engines/mads/core/video.h
  A engines/mads/core/vocab.cpp
  A engines/mads/core/vocab.h
  A engines/mads/core/vocabh.h
  A engines/mads/core/window.cpp
  A engines/mads/core/window.h
  A engines/mads/core/xms.cpp
  A engines/mads/core/xms.h
  A engines/mads/dragonsphere/asound.cpp
  A engines/mads/dragonsphere/asound.h
  A engines/mads/dragonsphere/dragonsphere.cpp
  A engines/mads/dragonsphere/dragonsphere.h
  A engines/mads/dragonsphere/global.cpp
  A engines/mads/dragonsphere/global.h
  A engines/mads/dragonsphere/mads/conv.h
  A engines/mads/dragonsphere/mads/inventory.h
  A engines/mads/dragonsphere/mads/mads.cpp
  A engines/mads/dragonsphere/mads/quotes.h
  A engines/mads/dragonsphere/mads/sounds.h
  A engines/mads/dragonsphere/mads/words.h
  A engines/mads/dragonsphere/main.cpp
  A engines/mads/dragonsphere/main.h
  A engines/mads/dragonsphere/main_menu.cpp
  A engines/mads/dragonsphere/main_menu.h
  A engines/mads/dragonsphere/menus.cpp
  A engines/mads/dragonsphere/menus.h
  A engines/mads/dragonsphere/rooms/room101.cpp
  A engines/mads/dragonsphere/rooms/room101.h
  A engines/mads/dragonsphere/rooms/room102.cpp
  A engines/mads/dragonsphere/rooms/room102.h
  A engines/mads/dragonsphere/rooms/room103.cpp
  A engines/mads/dragonsphere/rooms/room103.h
  A engines/mads/dragonsphere/rooms/room104.cpp
  A engines/mads/dragonsphere/rooms/room104.h
  A engines/mads/dragonsphere/rooms/room105.cpp
  A engines/mads/dragonsphere/rooms/room105.h
  A engines/mads/dragonsphere/rooms/room106.cpp
  A engines/mads/dragonsphere/rooms/room106.h
  A engines/mads/dragonsphere/rooms/room107.cpp
  A engines/mads/dragonsphere/rooms/room107.h
  A engines/mads/dragonsphere/rooms/room108.cpp
  A engines/mads/dragonsphere/rooms/room108.h
  A engines/mads/dragonsphere/rooms/room109.cpp
  A engines/mads/dragonsphere/rooms/room109.h
  A engines/mads/dragonsphere/rooms/room110.cpp
  A engines/mads/dragonsphere/rooms/room110.h
  A engines/mads/dragonsphere/rooms/room111.cpp
  A engines/mads/dragonsphere/rooms/room111.h
  A engines/mads/dragonsphere/rooms/room112.cpp
  A engines/mads/dragonsphere/rooms/room112.h
  A engines/mads/dragonsphere/rooms/room113.cpp
  A engines/mads/dragonsphere/rooms/room113.h
  A engines/mads/dragonsphere/rooms/room114.cpp
  A engines/mads/dragonsphere/rooms/room114.h
  A engines/mads/dragonsphere/rooms/room115.cpp
  A engines/mads/dragonsphere/rooms/room115.h
  A engines/mads/dragonsphere/rooms/room116.cpp
  A engines/mads/dragonsphere/rooms/room116.h
  A engines/mads/dragonsphere/rooms/room117.cpp
  A engines/mads/dragonsphere/rooms/room117.h
  A engines/mads/dragonsphere/rooms/room118.cpp
  A engines/mads/dragonsphere/rooms/room118.h
  A engines/mads/dragonsphere/rooms/room119.cpp
  A engines/mads/dragonsphere/rooms/room119.h
  A engines/mads/dragonsphere/rooms/room120.cpp
  A engines/mads/dragonsphere/rooms/room120.h
  A engines/mads/dragonsphere/rooms/room201.cpp
  A engines/mads/dragonsphere/rooms/room201.h
  A engines/mads/dragonsphere/rooms/room203.cpp
  A engines/mads/dragonsphere/rooms/room203.h
  A engines/mads/dragonsphere/rooms/room204.cpp
  A engines/mads/dragonsphere/rooms/room204.h
  A engines/mads/dragonsphere/rooms/room205.cpp
  A engines/mads/dragonsphere/rooms/room205.h
  A engines/mads/dragonsphere/rooms/room206.cpp
  A engines/mads/dragonsphere/rooms/room206.h
  A engines/mads/dragonsphere/rooms/room301.cpp
  A engines/mads/dragonsphere/rooms/room301.h
  A engines/mads/dragonsphere/rooms/room302.cpp
  A engines/mads/dragonsphere/rooms/room302.h
  A engines/mads/dragonsphere/rooms/room303.cpp
  A engines/mads/dragonsphere/rooms/room303.h
  A engines/mads/dragonsphere/rooms/room401.cpp
  A engines/mads/dragonsphere/rooms/room401.h
  A engines/mads/dragonsphere/rooms/room402.cpp
  A engines/mads/dragonsphere/rooms/room402.h
  A engines/mads/dragonsphere/rooms/room403.cpp
  A engines/mads/dragonsphere/rooms/room403.h
  A engines/mads/dragonsphere/rooms/room404.cpp
  A engines/mads/dragonsphere/rooms/room404.h
  A engines/mads/dragonsphere/rooms/room405.cpp
  A engines/mads/dragonsphere/rooms/room405.h
  A engines/mads/dragonsphere/rooms/room406.cpp
  A engines/mads/dragonsphere/rooms/room406.h
  A engines/mads/dragonsphere/rooms/room407.cpp
  A engines/mads/dragonsphere/rooms/room407.h
  A engines/mads/dragonsphere/rooms/room408.cpp
  A engines/mads/dragonsphere/rooms/room408.h
  A engines/mads/dragonsphere/rooms/room409.cpp
  A engines/mads/dragonsphere/rooms/room409.h
  A engines/mads/dragonsphere/rooms/room410.cpp
  A engines/mads/dragonsphere/rooms/room410.h
  A engines/mads/dragonsphere/rooms/room411.cpp
  A engines/mads/dragonsphere/rooms/room411.h
  A engines/mads/dragonsphere/rooms/room412.cpp
  A engines/mads/dragonsphere/rooms/room412.h
  A engines/mads/dragonsphere/rooms/room454.cpp
  A engines/mads/dragonsphere/rooms/room454.h
  A engines/mads/dragonsphere/rooms/room501.cpp
  A engines/mads/dragonsphere/rooms/room501.h
  A engines/mads/dragonsphere/rooms/room502.cpp
  A engines/mads/dragonsphere/rooms/room502.h
  A engines/mads/dragonsphere/rooms/room503.cpp
  A engines/mads/dragonsphere/rooms/room503.h
  A engines/mads/dragonsphere/rooms/room504.cpp
  A engines/mads/dragonsphere/rooms/room504.h
  A engines/mads/dragonsphere/rooms/room505.cpp
  A engines/mads/dragonsphere/rooms/room505.h
  A engines/mads/dragonsphere/rooms/room506.cpp
  A engines/mads/dragonsphere/rooms/room506.h
  A engines/mads/dragonsphere/rooms/room507.cpp
  A engines/mads/dragonsphere/rooms/room507.h
  A engines/mads/dragonsphere/rooms/room508.cpp
  A engines/mads/dragonsphere/rooms/room508.h
  A engines/mads/dragonsphere/rooms/room509.cpp
  A engines/mads/dragonsphere/rooms/room509.h
  A engines/mads/dragonsphere/rooms/room510.cpp
  A engines/mads/dragonsphere/rooms/room510.h
  A engines/mads/dragonsphere/rooms/room511.cpp
  A engines/mads/dragonsphere/rooms/room511.h
  A engines/mads/dragonsphere/rooms/room512.cpp
  A engines/mads/dragonsphere/rooms/room512.h
  A engines/mads/dragonsphere/rooms/room557.cpp
  A engines/mads/dragonsphere/rooms/room557.h
  A engines/mads/dragonsphere/rooms/room601.cpp
  A engines/mads/dragonsphere/rooms/room601.h
  A engines/mads/dragonsphere/rooms/room603.cpp
  A engines/mads/dragonsphere/rooms/room603.h
  A engines/mads/dragonsphere/rooms/room604.cpp
  A engines/mads/dragonsphere/rooms/room604.h
  A engines/mads/dragonsphere/rooms/room605.cpp
  A engines/mads/dragonsphere/rooms/room605.h
  A engines/mads/dragonsphere/rooms/room606.cpp
  A engines/mads/dragonsphere/rooms/room606.h
  A engines/mads/dragonsphere/rooms/room607.cpp
  A engines/mads/dragonsphere/rooms/room607.h
  A engines/mads/dragonsphere/rooms/room609.cpp
  A engines/mads/dragonsphere/rooms/room609.h
  A engines/mads/dragonsphere/rooms/room612.cpp
  A engines/mads/dragonsphere/rooms/room612.h
  A engines/mads/dragonsphere/rooms/room613.cpp
  A engines/mads/dragonsphere/rooms/room613.h
  A engines/mads/dragonsphere/rooms/room614.cpp
  A engines/mads/dragonsphere/rooms/room614.h
  A engines/mads/dragonsphere/rooms/room909.cpp
  A engines/mads/dragonsphere/rooms/room909.h
  A engines/mads/dragonsphere/rooms/section1.cpp
  A engines/mads/dragonsphere/rooms/section1.h
  A engines/mads/dragonsphere/rooms/section2.cpp
  A engines/mads/dragonsphere/rooms/section2.h
  A engines/mads/dragonsphere/rooms/section3.cpp
  A engines/mads/dragonsphere/rooms/section3.h
  A engines/mads/dragonsphere/rooms/section4.cpp
  A engines/mads/dragonsphere/rooms/section4.h
  A engines/mads/dragonsphere/rooms/section5.cpp
  A engines/mads/dragonsphere/rooms/section5.h
  A engines/mads/dragonsphere/rooms/section6.cpp
  A engines/mads/dragonsphere/rooms/section6.h
  A engines/mads/dragonsphere/rooms/section9.cpp
  A engines/mads/dragonsphere/rooms/section9.h
  A engines/mads/dragonsphere/sound_dragonsphere.cpp
  A engines/mads/dragonsphere/sound_dragonsphere.h
  A engines/mads/engine.cpp
  A engines/mads/engine.h
  A engines/mads/forest/digi.cpp
  A engines/mads/forest/digi.h
  A engines/mads/forest/extra.cpp
  A engines/mads/forest/extra.h
  A engines/mads/forest/forest.cpp
  A engines/mads/forest/forest.h
  A engines/mads/forest/global.cpp
  A engines/mads/forest/global.h
  A engines/mads/forest/inventory.cpp
  A engines/mads/forest/inventory.h
  A engines/mads/forest/journal.cpp
  A engines/mads/forest/journal.h
  A engines/mads/forest/mads/inventory.h
  A engines/mads/forest/mads/mads.cpp
  A engines/mads/forest/mads/quotes.h
  A engines/mads/forest/mads/sounds.h
  A engines/mads/forest/mads/words.h
  A engines/mads/forest/main.cpp
  A engines/mads/forest/main.h
  A engines/mads/forest/menus.cpp
  A engines/mads/forest/menus.h
  A engines/mads/forest/midi.cpp
  A engines/mads/forest/midi.h
  A engines/mads/forest/rooms/room101.cpp
  A engines/mads/forest/rooms/room103.cpp
  A engines/mads/forest/rooms/room104.cpp
  A engines/mads/forest/rooms/room106.cpp
  A engines/mads/forest/rooms/room107.cpp
  A engines/mads/forest/rooms/room199.cpp
  A engines/mads/forest/rooms/room201.cpp
  A engines/mads/forest/rooms/room203.cpp
  A engines/mads/forest/rooms/room204.cpp
  A engines/mads/forest/rooms/room205.cpp
  A engines/mads/forest/rooms/room210.cpp
  A engines/mads/forest/rooms/room211.cpp
  A engines/mads/forest/rooms/room220.cpp
  A engines/mads/forest/rooms/room221.cpp
  A engines/mads/forest/rooms/room301.cpp
  A engines/mads/forest/rooms/room302.cpp
  A engines/mads/forest/rooms/room303.cpp
  A engines/mads/forest/rooms/room304.cpp
  A engines/mads/forest/rooms/room305.cpp
  A engines/mads/forest/rooms/room306.cpp
  A engines/mads/forest/rooms/room307.cpp
  A engines/mads/forest/rooms/room308.cpp
  A engines/mads/forest/rooms/room321.cpp
  A engines/mads/forest/rooms/room322.cpp
  A engines/mads/forest/rooms/room401.cpp
  A engines/mads/forest/rooms/room402.cpp
  A engines/mads/forest/rooms/room403.cpp
  A engines/mads/forest/rooms/room404.cpp
  A engines/mads/forest/rooms/room405.cpp
  A engines/mads/forest/rooms/room420.cpp
  A engines/mads/forest/rooms/room501.cpp
  A engines/mads/forest/rooms/room503.cpp
  A engines/mads/forest/rooms/room509.cpp
  A engines/mads/forest/rooms/room510.cpp
  A engines/mads/forest/rooms/room520.cpp
  A engines/mads/forest/rooms/room901.cpp
  A engines/mads/forest/rooms/room903.cpp
  A engines/mads/forest/rooms/room904.cpp
  A engines/mads/forest/rooms/section1.cpp
  A engines/mads/forest/rooms/section1.h
  A engines/mads/forest/rooms/section2.cpp
  A engines/mads/forest/rooms/section2.h
  A engines/mads/forest/rooms/section3.cpp
  A engines/mads/forest/rooms/section3.h
  A engines/mads/forest/rooms/section4.cpp
  A engines/mads/forest/rooms/section4.h
  A engines/mads/forest/rooms/section5.cpp
  A engines/mads/forest/rooms/section5.h
  A engines/mads/forest/rooms/section9.cpp
  A engines/mads/forest/rooms/section9.h
  A engines/mads/nebular/asound.cpp
  A engines/mads/nebular/asound.h
  A engines/mads/nebular/console.cpp
  A engines/mads/nebular/console.h
  A engines/mads/nebular/copy.cpp
  A engines/mads/nebular/copy.h
  A engines/mads/nebular/extra.cpp
  A engines/mads/nebular/extra.h
  A engines/mads/nebular/global.cpp
  A engines/mads/nebular/global.h
  A engines/mads/nebular/mads/inventory.h
  A engines/mads/nebular/mads/mads.cpp
  A engines/mads/nebular/mads/quotes.h
  A engines/mads/nebular/mads/sounds.h
  A engines/mads/nebular/mads/words.h
  A engines/mads/nebular/main.cpp
  A engines/mads/nebular/main.h
  A engines/mads/nebular/main_menu.cpp
  A engines/mads/nebular/main_menu.h
  A engines/mads/nebular/menus.cpp
  A engines/mads/nebular/menus.h
  A engines/mads/nebular/popup.cpp
  A engines/mads/nebular/popup.h
  A engines/mads/nebular/rooms/dialog.cpp
  A engines/mads/nebular/rooms/dialog.h
  A engines/mads/nebular/rooms/forcefield.cpp
  A engines/mads/nebular/rooms/forcefield.h
  A engines/mads/nebular/rooms/room101.cpp
  A engines/mads/nebular/rooms/room102.cpp
  A engines/mads/nebular/rooms/room103.cpp
  A engines/mads/nebular/rooms/room104.cpp
  A engines/mads/nebular/rooms/room105.cpp
  A engines/mads/nebular/rooms/room106.cpp
  A engines/mads/nebular/rooms/room107.cpp
  A engines/mads/nebular/rooms/room108.cpp
  A engines/mads/nebular/rooms/room109.cpp
  A engines/mads/nebular/rooms/room110.cpp
  A engines/mads/nebular/rooms/room111.cpp
  A engines/mads/nebular/rooms/room112.cpp
  A engines/mads/nebular/rooms/room201.cpp
  A engines/mads/nebular/rooms/room202.cpp
  A engines/mads/nebular/rooms/room203.cpp
  A engines/mads/nebular/rooms/room205.cpp
  A engines/mads/nebular/rooms/room207.cpp
  A engines/mads/nebular/rooms/room208.cpp
  A engines/mads/nebular/rooms/room209.cpp
  A engines/mads/nebular/rooms/room210.cpp
  A engines/mads/nebular/rooms/room211.cpp
  A engines/mads/nebular/rooms/room212.cpp
  A engines/mads/nebular/rooms/room213.cpp
  A engines/mads/nebular/rooms/room214.cpp
  A engines/mads/nebular/rooms/room215.cpp
  A engines/mads/nebular/rooms/room216.cpp
  A engines/mads/nebular/rooms/room301.cpp
  A engines/mads/nebular/rooms/room302.cpp
  A engines/mads/nebular/rooms/room303.cpp
  A engines/mads/nebular/rooms/room304.cpp
  A engines/mads/nebular/rooms/room307.cpp
  A engines/mads/nebular/rooms/room308.cpp
  A engines/mads/nebular/rooms/room309.cpp
  A engines/mads/nebular/rooms/room310.cpp
  A engines/mads/nebular/rooms/room311.cpp
  A engines/mads/nebular/rooms/room313.cpp
  A engines/mads/nebular/rooms/room316.cpp
  A engines/mads/nebular/rooms/room318.cpp
  A engines/mads/nebular/rooms/room319.cpp
  A engines/mads/nebular/rooms/room320.cpp
  A engines/mads/nebular/rooms/room321.cpp
  A engines/mads/nebular/rooms/room322.cpp
  A engines/mads/nebular/rooms/room351.cpp
  A engines/mads/nebular/rooms/room352.cpp
  A engines/mads/nebular/rooms/room353.cpp
  A engines/mads/nebular/rooms/room354.cpp
  A engines/mads/nebular/rooms/room357.cpp
  A engines/mads/nebular/rooms/room358.cpp
  A engines/mads/nebular/rooms/room359.cpp
  A engines/mads/nebular/rooms/room360.cpp
  A engines/mads/nebular/rooms/room361.cpp
  A engines/mads/nebular/rooms/room366.cpp
  A engines/mads/nebular/rooms/room387.cpp
  A engines/mads/nebular/rooms/room388.cpp
  A engines/mads/nebular/rooms/room389.cpp
  A engines/mads/nebular/rooms/room390.cpp
  A engines/mads/nebular/rooms/room391.cpp
  A engines/mads/nebular/rooms/room399.cpp
  A engines/mads/nebular/rooms/room401.cpp
  A engines/mads/nebular/rooms/room402.cpp
  A engines/mads/nebular/rooms/room405.cpp
  A engines/mads/nebular/rooms/room406.cpp
  A engines/mads/nebular/rooms/room407.cpp
  A engines/mads/nebular/rooms/room408.cpp
  A engines/mads/nebular/rooms/room409.cpp
  A engines/mads/nebular/rooms/room410.cpp
  A engines/mads/nebular/rooms/room411.cpp
  A engines/mads/nebular/rooms/room413.cpp
  A engines/mads/nebular/rooms/room501.cpp
  A engines/mads/nebular/rooms/room502.cpp
  A engines/mads/nebular/rooms/room503.cpp
  A engines/mads/nebular/rooms/room504.cpp
  A engines/mads/nebular/rooms/room505.cpp
  A engines/mads/nebular/rooms/room506.cpp
  A engines/mads/nebular/rooms/room507.cpp
  A engines/mads/nebular/rooms/room508.cpp
  A engines/mads/nebular/rooms/room511.cpp
  A engines/mads/nebular/rooms/room512.cpp
  A engines/mads/nebular/rooms/room513.cpp
  A engines/mads/nebular/rooms/room515.cpp
  A engines/mads/nebular/rooms/room551.cpp
  A engines/mads/nebular/rooms/room601.cpp
  A engines/mads/nebular/rooms/room602.cpp
  A engines/mads/nebular/rooms/room603.cpp
  A engines/mads/nebular/rooms/room604.cpp
  A engines/mads/nebular/rooms/room605.cpp
  A engines/mads/nebular/rooms/room607.cpp
  A engines/mads/nebular/rooms/room608.cpp
  A engines/mads/nebular/rooms/room609.cpp
  A engines/mads/nebular/rooms/room610.cpp
  A engines/mads/nebular/rooms/room611.cpp
  A engines/mads/nebular/rooms/room612.cpp
  A engines/mads/nebular/rooms/room620.cpp
  A engines/mads/nebular/rooms/room701.cpp
  A engines/mads/nebular/rooms/room702.cpp
  A engines/mads/nebular/rooms/room703.cpp
  A engines/mads/nebular/rooms/room704.cpp
  A engines/mads/nebular/rooms/room705.cpp
  A engines/mads/nebular/rooms/room706.cpp
  A engines/mads/nebular/rooms/room707.cpp
  A engines/mads/nebular/rooms/room710.cpp
  A engines/mads/nebular/rooms/room711.cpp
  A engines/mads/nebular/rooms/room751.cpp
  A engines/mads/nebular/rooms/room752.cpp
  A engines/mads/nebular/rooms/room801.cpp
  A engines/mads/nebular/rooms/room802.cpp
  A engines/mads/nebular/rooms/room803.cpp
  A engines/mads/nebular/rooms/room804.cpp
  A engines/mads/nebular/rooms/room805.cpp
  A engines/mads/nebular/rooms/room807.cpp
  A engines/mads/nebular/rooms/room808.cpp
  A engines/mads/nebular/rooms/room810.cpp
  A engines/mads/nebular/rooms/section1.cpp
  A engines/mads/nebular/rooms/section1.h
  A engines/mads/nebular/rooms/section2.cpp
  A engines/mads/nebular/rooms/section2.h
  A engines/mads/nebular/rooms/section3.cpp
  A engines/mads/nebular/rooms/section3.h
  A engines/mads/nebular/rooms/section4.cpp
  A engines/mads/nebular/rooms/section4.h
  A engines/mads/nebular/rooms/section5.cpp
  A engines/mads/nebular/rooms/section5.h
  A engines/mads/nebular/rooms/section6.cpp
  A engines/mads/nebular/rooms/section6.h
  A engines/mads/nebular/rooms/section7.cpp
  A engines/mads/nebular/rooms/section7.h
  A engines/mads/nebular/rooms/section8.cpp
  A engines/mads/nebular/rooms/section8.h
  A engines/mads/nebular/rooms/teleporter.cpp
  A engines/mads/nebular/rooms/teleporter.h
  A engines/mads/nebular/rooms/thunks.cpp
  A engines/mads/nebular/rooms/thunks.h
  A engines/mads/nebular/sound_nebular.cpp
  A engines/mads/nebular/sound_nebular.h
  A engines/mads/phantom/asound.cpp
  A engines/mads/phantom/asound.h
  A engines/mads/phantom/catacombs.cpp
  A engines/mads/phantom/catacombs.h
  A engines/mads/phantom/global.cpp
  A engines/mads/phantom/global.h
  A engines/mads/phantom/mads/conv.h
  A engines/mads/phantom/mads/inventory.h
  A engines/mads/phantom/mads/mads.cpp
  A engines/mads/phantom/mads/quotes.h
  A engines/mads/phantom/mads/sounds.h
  A engines/mads/phantom/mads/speeches.h
  A engines/mads/phantom/mads/text.h
  A engines/mads/phantom/mads/words.h
  A engines/mads/phantom/main.cpp
  A engines/mads/phantom/main.h
  A engines/mads/phantom/main_menu.cpp
  A engines/mads/phantom/main_menu.h
  A engines/mads/phantom/menus.cpp
  A engines/mads/phantom/menus.h
  A engines/mads/phantom/phantom.cpp
  A engines/mads/phantom/phantom.h
  A engines/mads/phantom/rooms/room101.cpp
  A engines/mads/phantom/rooms/room101.h
  A engines/mads/phantom/rooms/room102.cpp
  A engines/mads/phantom/rooms/room102.h
  A engines/mads/phantom/rooms/room103.cpp
  A engines/mads/phantom/rooms/room103.h
  A engines/mads/phantom/rooms/room104.cpp
  A engines/mads/phantom/rooms/room104.h
  A engines/mads/phantom/rooms/room105.cpp
  A engines/mads/phantom/rooms/room105.h
  A engines/mads/phantom/rooms/room106.cpp
  A engines/mads/phantom/rooms/room106.h
  A engines/mads/phantom/rooms/room107.cpp
  A engines/mads/phantom/rooms/room107.h
  A engines/mads/phantom/rooms/room108.cpp
  A engines/mads/phantom/rooms/room108.h
  A engines/mads/phantom/rooms/room109.cpp
  A engines/mads/phantom/rooms/room109.h
  A engines/mads/phantom/rooms/room110.cpp
  A engines/mads/phantom/rooms/room110.h
  A engines/mads/phantom/rooms/room111.cpp
  A engines/mads/phantom/rooms/room111.h
  A engines/mads/phantom/rooms/room112.cpp
  A engines/mads/phantom/rooms/room112.h
  A engines/mads/phantom/rooms/room113.cpp
  A engines/mads/phantom/rooms/room113.h
  A engines/mads/phantom/rooms/room114.cpp
  A engines/mads/phantom/rooms/room114.h
  A engines/mads/phantom/rooms/room150.cpp
  A engines/mads/phantom/rooms/room150.h
  A engines/mads/phantom/rooms/room201.cpp
  A engines/mads/phantom/rooms/room201.h
  A engines/mads/phantom/rooms/room202.cpp
  A engines/mads/phantom/rooms/room202.h
  A engines/mads/phantom/rooms/room203.cpp
  A engines/mads/phantom/rooms/room203.h
  A engines/mads/phantom/rooms/room204.cpp
  A engines/mads/phantom/rooms/room204.h
  A engines/mads/phantom/rooms/room205.cpp
  A engines/mads/phantom/rooms/room205.h
  A engines/mads/phantom/rooms/room206.cpp
  A engines/mads/phantom/rooms/room206.h
  A engines/mads/phantom/rooms/room207.cpp
  A engines/mads/phantom/rooms/room207.h
  A engines/mads/phantom/rooms/room208.cpp
  A engines/mads/phantom/rooms/room208.h
  A engines/mads/phantom/rooms/room250.cpp
  A engines/mads/phantom/rooms/room250.h
  A engines/mads/phantom/rooms/room301.cpp
  A engines/mads/phantom/rooms/room301.h
  A engines/mads/phantom/rooms/room302.cpp
  A engines/mads/phantom/rooms/room302.h
  A engines/mads/phantom/rooms/room303.cpp
  A engines/mads/phantom/rooms/room303.h
  A engines/mads/phantom/rooms/room304.cpp
  A engines/mads/phantom/rooms/room304.h
  A engines/mads/phantom/rooms/room305.cpp
  A engines/mads/phantom/rooms/room305.h
  A engines/mads/phantom/rooms/room306.cpp
  A engines/mads/phantom/rooms/room306.h
  A engines/mads/phantom/rooms/room307.cpp
  A engines/mads/phantom/rooms/room307.h
  A engines/mads/phantom/rooms/room308.cpp
  A engines/mads/phantom/rooms/room308.h
  A engines/mads/phantom/rooms/room309.cpp
  A engines/mads/phantom/rooms/room309.h
  A engines/mads/phantom/rooms/room310.cpp
  A engines/mads/phantom/rooms/room310.h
  A engines/mads/phantom/rooms/room401.cpp
  A engines/mads/phantom/rooms/room401.h
  A engines/mads/phantom/rooms/room403.cpp
  A engines/mads/phantom/rooms/room403.h
  A engines/mads/phantom/rooms/room404.cpp
  A engines/mads/phantom/rooms/room404.h
  A engines/mads/phantom/rooms/room406.cpp
  A engines/mads/phantom/rooms/room406.h
  A engines/mads/phantom/rooms/room407.cpp
  A engines/mads/phantom/rooms/room407.h
  A engines/mads/phantom/rooms/room408.cpp
  A engines/mads/phantom/rooms/room408.h
  A engines/mads/phantom/rooms/room409.cpp
  A engines/mads/phantom/rooms/room409.h
  A engines/mads/phantom/rooms/room410.cpp
  A engines/mads/phantom/rooms/room410.h
  A engines/mads/phantom/rooms/room453.cpp
  A engines/mads/phantom/rooms/room453.h
  A engines/mads/phantom/rooms/room456.cpp
  A engines/mads/phantom/rooms/room456.h
  A engines/mads/phantom/rooms/room501.cpp
  A engines/mads/phantom/rooms/room501.h
  A engines/mads/phantom/rooms/room502.cpp
  A engines/mads/phantom/rooms/room502.h
  A engines/mads/phantom/rooms/room504.cpp
  A engines/mads/phantom/rooms/room504.h
  A engines/mads/phantom/rooms/room505.cpp
  A engines/mads/phantom/rooms/room505.h
  A engines/mads/phantom/rooms/room506.cpp
  A engines/mads/phantom/rooms/room506.h
  A engines/mads/phantom/rooms/section1.cpp
  A engines/mads/phantom/rooms/section1.h
  A engines/mads/phantom/rooms/section2.cpp
  A engines/mads/phantom/rooms/section2.h
  A engines/mads/phantom/rooms/section3.cpp
  A engines/mads/phantom/rooms/section3.h
  A engines/mads/phantom/rooms/section4.cpp
  A engines/mads/phantom/rooms/section4.h
  A engines/mads/phantom/rooms/section5.cpp
  A engines/mads/phantom/rooms/section5.h
  A engines/mads/phantom/sound_phantom.cpp
  A engines/mads/phantom/sound_phantom.h
  A engines/mads/textview/textview.cpp
  A engines/mads/textview/textview.h
  R engines/mads/madsv2/animview/anim_timer.cpp
  R engines/mads/madsv2/animview/anim_timer.h
  R engines/mads/madsv2/animview/animview.cpp
  R engines/mads/madsv2/animview/animview.h
  R engines/mads/madsv2/animview/functions.cpp
  R engines/mads/madsv2/animview/functions.h
  R engines/mads/madsv2/console.cpp
  R engines/mads/madsv2/console.h
  R engines/mads/madsv2/core/anim.cpp
  R engines/mads/madsv2/core/anim.h
  R engines/mads/madsv2/core/attr.cpp
  R engines/mads/madsv2/core/attr.h
  R engines/mads/madsv2/core/btype.h
  R engines/mads/madsv2/core/buffer.cpp
  R engines/mads/madsv2/core/buffer.h
  R engines/mads/madsv2/core/camera.cpp
  R engines/mads/madsv2/core/camera.h
  R engines/mads/madsv2/core/color.cpp
  R engines/mads/madsv2/core/color.h
  R engines/mads/madsv2/core/concat.h
  R engines/mads/madsv2/core/config.cpp
  R engines/mads/madsv2/core/config.h
  R engines/mads/madsv2/core/conv.cpp
  R engines/mads/madsv2/core/conv.h
  R engines/mads/madsv2/core/cursor.cpp
  R engines/mads/madsv2/core/cursor.h
  R engines/mads/madsv2/core/cycle.cpp
  R engines/mads/madsv2/core/cycle.h
  R engines/mads/madsv2/core/dialog.cpp
  R engines/mads/madsv2/core/dialog.h
  R engines/mads/madsv2/core/echo.h
  R engines/mads/madsv2/core/ems.cpp
  R engines/mads/madsv2/core/ems.h
  R engines/mads/madsv2/core/env.cpp
  R engines/mads/madsv2/core/env.h
  R engines/mads/madsv2/core/error.cpp
  R engines/mads/madsv2/core/error.h
  R engines/mads/madsv2/core/fileio.cpp
  R engines/mads/madsv2/core/fileio.h
  R engines/mads/madsv2/core/font.cpp
  R engines/mads/madsv2/core/font.h
  R engines/mads/madsv2/core/game.cpp
  R engines/mads/madsv2/core/game.h
  R engines/mads/madsv2/core/general.h
  R engines/mads/madsv2/core/global.cpp
  R engines/mads/madsv2/core/global.h
  R engines/mads/madsv2/core/heap.cpp
  R engines/mads/madsv2/core/heap.h
  R engines/mads/madsv2/core/himem.cpp
  R engines/mads/madsv2/core/himem.h
  R engines/mads/madsv2/core/hspot.cpp
  R engines/mads/madsv2/core/hspot.h
  R engines/mads/madsv2/core/image.cpp
  R engines/mads/madsv2/core/image.h
  R engines/mads/madsv2/core/imath.cpp
  R engines/mads/madsv2/core/imath.h
  R engines/mads/madsv2/core/implode.cpp
  R engines/mads/madsv2/core/implode.h
  R engines/mads/madsv2/core/inter.cpp
  R engines/mads/madsv2/core/inter.h
  R engines/mads/madsv2/core/kernel.cpp
  R engines/mads/madsv2/core/kernel.h
  R engines/mads/madsv2/core/keys.cpp
  R engines/mads/madsv2/core/keys.h
  R engines/mads/madsv2/core/lib.cpp
  R engines/mads/madsv2/core/lib.h
  R engines/mads/madsv2/core/loader.cpp
  R engines/mads/madsv2/core/loader.h
  R engines/mads/madsv2/core/mads.h
  R engines/mads/madsv2/core/magic.cpp
  R engines/mads/madsv2/core/magic.h
  R engines/mads/madsv2/core/matte.cpp
  R engines/mads/madsv2/core/matte.h
  R engines/mads/madsv2/core/mcga.cpp
  R engines/mads/madsv2/core/mcga.h
  R engines/mads/madsv2/core/mem.cpp
  R engines/mads/madsv2/core/mem.h
  R engines/mads/madsv2/core/mouse.cpp
  R engines/mads/madsv2/core/mouse.h
  R engines/mads/madsv2/core/mps_archive.cpp
  R engines/mads/madsv2/core/mps_archive.h
  R engines/mads/madsv2/core/object.cpp
  R engines/mads/madsv2/core/object.h
  R engines/mads/madsv2/core/pack.cpp
  R engines/mads/madsv2/core/pack.h
  R engines/mads/madsv2/core/pal.cpp
  R engines/mads/madsv2/core/pal.h
  R engines/mads/madsv2/core/pfab.cpp
  R engines/mads/madsv2/core/pfab.h
  R engines/mads/madsv2/core/player.cpp
  R engines/mads/madsv2/core/player.h
  R engines/mads/madsv2/core/popup.cpp
  R engines/mads/madsv2/core/popup.h
  R engines/mads/madsv2/core/qual.h
  R engines/mads/madsv2/core/quote.cpp
  R engines/mads/madsv2/core/quote.h
  R engines/mads/madsv2/core/rail.cpp
  R engines/mads/madsv2/core/rail.h
  R engines/mads/madsv2/core/room.cpp
  R engines/mads/madsv2/core/room.h
  R engines/mads/madsv2/core/screen.cpp
  R engines/mads/madsv2/core/screen.h
  R engines/mads/madsv2/core/sort.cpp
  R engines/mads/madsv2/core/sort.h
  R engines/mads/madsv2/core/sound.cpp
  R engines/mads/madsv2/core/sound.h
  R engines/mads/madsv2/core/speech.cpp
  R engines/mads/madsv2/core/speech.h
  R engines/mads/madsv2/core/sprite.cpp
  R engines/mads/madsv2/core/sprite.h
  R engines/mads/madsv2/core/sprite_0.cpp
  R engines/mads/madsv2/core/sprite_h.h
  R engines/mads/madsv2/core/sprite_k.cpp
  R engines/mads/madsv2/core/text.cpp
  R engines/mads/madsv2/core/text.h
  R engines/mads/madsv2/core/tile.cpp
  R engines/mads/madsv2/core/tile.h
  R engines/mads/madsv2/core/timer.cpp
  R engines/mads/madsv2/core/timer.h
  R engines/mads/madsv2/core/video.cpp
  R engines/mads/madsv2/core/video.h
  R engines/mads/madsv2/core/vocab.cpp
  R engines/mads/madsv2/core/vocab.h
  R engines/mads/madsv2/core/vocabh.h
  R engines/mads/madsv2/core/window.cpp
  R engines/mads/madsv2/core/window.h
  R engines/mads/madsv2/core/xms.cpp
  R engines/mads/madsv2/core/xms.h
  R engines/mads/madsv2/dragonsphere/asound.cpp
  R engines/mads/madsv2/dragonsphere/asound.h
  R engines/mads/madsv2/dragonsphere/dragonsphere.cpp
  R engines/mads/madsv2/dragonsphere/dragonsphere.h
  R engines/mads/madsv2/dragonsphere/global.cpp
  R engines/mads/madsv2/dragonsphere/global.h
  R engines/mads/madsv2/dragonsphere/mads/conv.h
  R engines/mads/madsv2/dragonsphere/mads/inventory.h
  R engines/mads/madsv2/dragonsphere/mads/mads.cpp
  R engines/mads/madsv2/dragonsphere/mads/quotes.h
  R engines/mads/madsv2/dragonsphere/mads/sounds.h
  R engines/mads/madsv2/dragonsphere/mads/words.h
  R engines/mads/madsv2/dragonsphere/main.cpp
  R engines/mads/madsv2/dragonsphere/main.h
  R engines/mads/madsv2/dragonsphere/main_menu.cpp
  R engines/mads/madsv2/dragonsphere/main_menu.h
  R engines/mads/madsv2/dragonsphere/menus.cpp
  R engines/mads/madsv2/dragonsphere/menus.h
  R engines/mads/madsv2/dragonsphere/rooms/room101.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room101.h
  R engines/mads/madsv2/dragonsphere/rooms/room102.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room102.h
  R engines/mads/madsv2/dragonsphere/rooms/room103.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room103.h
  R engines/mads/madsv2/dragonsphere/rooms/room104.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room104.h
  R engines/mads/madsv2/dragonsphere/rooms/room105.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room105.h
  R engines/mads/madsv2/dragonsphere/rooms/room106.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room106.h
  R engines/mads/madsv2/dragonsphere/rooms/room107.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room107.h
  R engines/mads/madsv2/dragonsphere/rooms/room108.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room108.h
  R engines/mads/madsv2/dragonsphere/rooms/room109.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room109.h
  R engines/mads/madsv2/dragonsphere/rooms/room110.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room110.h
  R engines/mads/madsv2/dragonsphere/rooms/room111.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room111.h
  R engines/mads/madsv2/dragonsphere/rooms/room112.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room112.h
  R engines/mads/madsv2/dragonsphere/rooms/room113.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room113.h
  R engines/mads/madsv2/dragonsphere/rooms/room114.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room114.h
  R engines/mads/madsv2/dragonsphere/rooms/room115.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room115.h
  R engines/mads/madsv2/dragonsphere/rooms/room116.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room116.h
  R engines/mads/madsv2/dragonsphere/rooms/room117.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room117.h
  R engines/mads/madsv2/dragonsphere/rooms/room118.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room118.h
  R engines/mads/madsv2/dragonsphere/rooms/room119.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room119.h
  R engines/mads/madsv2/dragonsphere/rooms/room120.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room120.h
  R engines/mads/madsv2/dragonsphere/rooms/room201.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room201.h
  R engines/mads/madsv2/dragonsphere/rooms/room203.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room203.h
  R engines/mads/madsv2/dragonsphere/rooms/room204.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room204.h
  R engines/mads/madsv2/dragonsphere/rooms/room205.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room205.h
  R engines/mads/madsv2/dragonsphere/rooms/room206.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room206.h
  R engines/mads/madsv2/dragonsphere/rooms/room301.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room301.h
  R engines/mads/madsv2/dragonsphere/rooms/room302.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room302.h
  R engines/mads/madsv2/dragonsphere/rooms/room303.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room303.h
  R engines/mads/madsv2/dragonsphere/rooms/room401.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room401.h
  R engines/mads/madsv2/dragonsphere/rooms/room402.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room402.h
  R engines/mads/madsv2/dragonsphere/rooms/room403.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room403.h
  R engines/mads/madsv2/dragonsphere/rooms/room404.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room404.h
  R engines/mads/madsv2/dragonsphere/rooms/room405.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room405.h
  R engines/mads/madsv2/dragonsphere/rooms/room406.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room406.h
  R engines/mads/madsv2/dragonsphere/rooms/room407.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room407.h
  R engines/mads/madsv2/dragonsphere/rooms/room408.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room408.h
  R engines/mads/madsv2/dragonsphere/rooms/room409.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room409.h
  R engines/mads/madsv2/dragonsphere/rooms/room410.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room410.h
  R engines/mads/madsv2/dragonsphere/rooms/room411.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room411.h
  R engines/mads/madsv2/dragonsphere/rooms/room412.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room412.h
  R engines/mads/madsv2/dragonsphere/rooms/room454.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room454.h
  R engines/mads/madsv2/dragonsphere/rooms/room501.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room501.h
  R engines/mads/madsv2/dragonsphere/rooms/room502.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room502.h
  R engines/mads/madsv2/dragonsphere/rooms/room503.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room503.h
  R engines/mads/madsv2/dragonsphere/rooms/room504.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room504.h
  R engines/mads/madsv2/dragonsphere/rooms/room505.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room505.h
  R engines/mads/madsv2/dragonsphere/rooms/room506.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room506.h
  R engines/mads/madsv2/dragonsphere/rooms/room507.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room507.h
  R engines/mads/madsv2/dragonsphere/rooms/room508.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room508.h
  R engines/mads/madsv2/dragonsphere/rooms/room509.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room509.h
  R engines/mads/madsv2/dragonsphere/rooms/room510.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room510.h
  R engines/mads/madsv2/dragonsphere/rooms/room511.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room511.h
  R engines/mads/madsv2/dragonsphere/rooms/room512.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room512.h
  R engines/mads/madsv2/dragonsphere/rooms/room557.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room557.h
  R engines/mads/madsv2/dragonsphere/rooms/room601.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room601.h
  R engines/mads/madsv2/dragonsphere/rooms/room603.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room603.h
  R engines/mads/madsv2/dragonsphere/rooms/room604.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room604.h
  R engines/mads/madsv2/dragonsphere/rooms/room605.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room605.h
  R engines/mads/madsv2/dragonsphere/rooms/room606.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room606.h
  R engines/mads/madsv2/dragonsphere/rooms/room607.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room607.h
  R engines/mads/madsv2/dragonsphere/rooms/room609.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room609.h
  R engines/mads/madsv2/dragonsphere/rooms/room612.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room612.h
  R engines/mads/madsv2/dragonsphere/rooms/room613.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room613.h
  R engines/mads/madsv2/dragonsphere/rooms/room614.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room614.h
  R engines/mads/madsv2/dragonsphere/rooms/room909.cpp
  R engines/mads/madsv2/dragonsphere/rooms/room909.h
  R engines/mads/madsv2/dragonsphere/rooms/section1.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section1.h
  R engines/mads/madsv2/dragonsphere/rooms/section2.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section2.h
  R engines/mads/madsv2/dragonsphere/rooms/section3.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section3.h
  R engines/mads/madsv2/dragonsphere/rooms/section4.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section4.h
  R engines/mads/madsv2/dragonsphere/rooms/section5.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section5.h
  R engines/mads/madsv2/dragonsphere/rooms/section6.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section6.h
  R engines/mads/madsv2/dragonsphere/rooms/section9.cpp
  R engines/mads/madsv2/dragonsphere/rooms/section9.h
  R engines/mads/madsv2/dragonsphere/sound_dragonsphere.cpp
  R engines/mads/madsv2/dragonsphere/sound_dragonsphere.h
  R engines/mads/madsv2/engine.cpp
  R engines/mads/madsv2/engine.h
  R engines/mads/madsv2/forest/digi.cpp
  R engines/mads/madsv2/forest/digi.h
  R engines/mads/madsv2/forest/extra.cpp
  R engines/mads/madsv2/forest/extra.h
  R engines/mads/madsv2/forest/forest.cpp
  R engines/mads/madsv2/forest/forest.h
  R engines/mads/madsv2/forest/global.cpp
  R engines/mads/madsv2/forest/global.h
  R engines/mads/madsv2/forest/inventory.cpp
  R engines/mads/madsv2/forest/inventory.h
  R engines/mads/madsv2/forest/journal.cpp
  R engines/mads/madsv2/forest/journal.h
  R engines/mads/madsv2/forest/mads/inventory.h
  R engines/mads/madsv2/forest/mads/mads.cpp
  R engines/mads/madsv2/forest/mads/quotes.h
  R engines/mads/madsv2/forest/mads/sounds.h
  R engines/mads/madsv2/forest/mads/words.h
  R engines/mads/madsv2/forest/main.cpp
  R engines/mads/madsv2/forest/main.h
  R engines/mads/madsv2/forest/menus.cpp
  R engines/mads/madsv2/forest/menus.h
  R engines/mads/madsv2/forest/midi.cpp
  R engines/mads/madsv2/forest/midi.h
  R engines/mads/madsv2/forest/rooms/room101.cpp
  R engines/mads/madsv2/forest/rooms/room103.cpp
  R engines/mads/madsv2/forest/rooms/room104.cpp
  R engines/mads/madsv2/forest/rooms/room106.cpp
  R engines/mads/madsv2/forest/rooms/room107.cpp
  R engines/mads/madsv2/forest/rooms/room199.cpp
  R engines/mads/madsv2/forest/rooms/room201.cpp
  R engines/mads/madsv2/forest/rooms/room203.cpp
  R engines/mads/madsv2/forest/rooms/room204.cpp
  R engines/mads/madsv2/forest/rooms/room205.cpp
  R engines/mads/madsv2/forest/rooms/room210.cpp
  R engines/mads/madsv2/forest/rooms/room211.cpp
  R engines/mads/madsv2/forest/rooms/room220.cpp
  R engines/mads/madsv2/forest/rooms/room221.cpp
  R engines/mads/madsv2/forest/rooms/room301.cpp
  R engines/mads/madsv2/forest/rooms/room302.cpp
  R engines/mads/madsv2/forest/rooms/room303.cpp
  R engines/mads/madsv2/forest/rooms/room304.cpp
  R engines/mads/madsv2/forest/rooms/room305.cpp
  R engines/mads/madsv2/forest/rooms/room306.cpp
  R engines/mads/madsv2/forest/rooms/room307.cpp
  R engines/mads/madsv2/forest/rooms/room308.cpp
  R engines/mads/madsv2/forest/rooms/room321.cpp
  R engines/mads/madsv2/forest/rooms/room322.cpp
  R engines/mads/madsv2/forest/rooms/room401.cpp
  R engines/mads/madsv2/forest/rooms/room402.cpp
  R engines/mads/madsv2/forest/rooms/room403.cpp
  R engines/mads/madsv2/forest/rooms/room404.cpp
  R engines/mads/madsv2/forest/rooms/room405.cpp
  R engines/mads/madsv2/forest/rooms/room420.cpp
  R engines/mads/madsv2/forest/rooms/room501.cpp
  R engines/mads/madsv2/forest/rooms/room503.cpp
  R engines/mads/madsv2/forest/rooms/room509.cpp
  R engines/mads/madsv2/forest/rooms/room510.cpp
  R engines/mads/madsv2/forest/rooms/room520.cpp
  R engines/mads/madsv2/forest/rooms/room901.cpp
  R engines/mads/madsv2/forest/rooms/room903.cpp
  R engines/mads/madsv2/forest/rooms/room904.cpp
  R engines/mads/madsv2/forest/rooms/section1.cpp
  R engines/mads/madsv2/forest/rooms/section1.h
  R engines/mads/madsv2/forest/rooms/section2.cpp
  R engines/mads/madsv2/forest/rooms/section2.h
  R engines/mads/madsv2/forest/rooms/section3.cpp
  R engines/mads/madsv2/forest/rooms/section3.h
  R engines/mads/madsv2/forest/rooms/section4.cpp
  R engines/mads/madsv2/forest/rooms/section4.h
  R engines/mads/madsv2/forest/rooms/section5.cpp
  R engines/mads/madsv2/forest/rooms/section5.h
  R engines/mads/madsv2/forest/rooms/section9.cpp
  R engines/mads/madsv2/forest/rooms/section9.h
  R engines/mads/madsv2/nebular/asound.cpp
  R engines/mads/madsv2/nebular/asound.h
  R engines/mads/madsv2/nebular/console.cpp
  R engines/mads/madsv2/nebular/console.h
  R engines/mads/madsv2/nebular/copy.cpp
  R engines/mads/madsv2/nebular/copy.h
  R engines/mads/madsv2/nebular/extra.cpp
  R engines/mads/madsv2/nebular/extra.h
  R engines/mads/madsv2/nebular/global.cpp
  R engines/mads/madsv2/nebular/global.h
  R engines/mads/madsv2/nebular/mads/inventory.h
  R engines/mads/madsv2/nebular/mads/mads.cpp
  R engines/mads/madsv2/nebular/mads/quotes.h
  R engines/mads/madsv2/nebular/mads/sounds.h
  R engines/mads/madsv2/nebular/mads/words.h
  R engines/mads/madsv2/nebular/main.cpp
  R engines/mads/madsv2/nebular/main.h
  R engines/mads/madsv2/nebular/main_menu.cpp
  R engines/mads/madsv2/nebular/main_menu.h
  R engines/mads/madsv2/nebular/menus.cpp
  R engines/mads/madsv2/nebular/menus.h
  R engines/mads/madsv2/nebular/nebular.cpp
  R engines/mads/madsv2/nebular/nebular.h
  R engines/mads/madsv2/nebular/popup.cpp
  R engines/mads/madsv2/nebular/popup.h
  R engines/mads/madsv2/nebular/rooms/dialog.cpp
  R engines/mads/madsv2/nebular/rooms/dialog.h
  R engines/mads/madsv2/nebular/rooms/forcefield.cpp
  R engines/mads/madsv2/nebular/rooms/forcefield.h
  R engines/mads/madsv2/nebular/rooms/room101.cpp
  R engines/mads/madsv2/nebular/rooms/room102.cpp
  R engines/mads/madsv2/nebular/rooms/room103.cpp
  R engines/mads/madsv2/nebular/rooms/room104.cpp
  R engines/mads/madsv2/nebular/rooms/room105.cpp
  R engines/mads/madsv2/nebular/rooms/room106.cpp
  R engines/mads/madsv2/nebular/rooms/room107.cpp
  R engines/mads/madsv2/nebular/rooms/room108.cpp
  R engines/mads/madsv2/nebular/rooms/room109.cpp
  R engines/mads/madsv2/nebular/rooms/room110.cpp
  R engines/mads/madsv2/nebular/rooms/room111.cpp
  R engines/mads/madsv2/nebular/rooms/room112.cpp
  R engines/mads/madsv2/nebular/rooms/room201.cpp
  R engines/mads/madsv2/nebular/rooms/room202.cpp
  R engines/mads/madsv2/nebular/rooms/room203.cpp
  R engines/mads/madsv2/nebular/rooms/room205.cpp
  R engines/mads/madsv2/nebular/rooms/room207.cpp
  R engines/mads/madsv2/nebular/rooms/room208.cpp
  R engines/mads/madsv2/nebular/rooms/room209.cpp
  R engines/mads/madsv2/nebular/rooms/room210.cpp
  R engines/mads/madsv2/nebular/rooms/room211.cpp
  R engines/mads/madsv2/nebular/rooms/room212.cpp
  R engines/mads/madsv2/nebular/rooms/room213.cpp
  R engines/mads/madsv2/nebular/rooms/room214.cpp
  R engines/mads/madsv2/nebular/rooms/room215.cpp
  R engines/mads/madsv2/nebular/rooms/room216.cpp
  R engines/mads/madsv2/nebular/rooms/room301.cpp
  R engines/mads/madsv2/nebular/rooms/room302.cpp
  R engines/mads/madsv2/nebular/rooms/room303.cpp
  R engines/mads/madsv2/nebular/rooms/room304.cpp
  R engines/mads/madsv2/nebular/rooms/room307.cpp
  R engines/mads/madsv2/nebular/rooms/room308.cpp
  R engines/mads/madsv2/nebular/rooms/room309.cpp
  R engines/mads/madsv2/nebular/rooms/room310.cpp
  R engines/mads/madsv2/nebular/rooms/room311.cpp
  R engines/mads/madsv2/nebular/rooms/room313.cpp
  R engines/mads/madsv2/nebular/rooms/room316.cpp
  R engines/mads/madsv2/nebular/rooms/room318.cpp
  R engines/mads/madsv2/nebular/rooms/room319.cpp
  R engines/mads/madsv2/nebular/rooms/room320.cpp
  R engines/mads/madsv2/nebular/rooms/room321.cpp
  R engines/mads/madsv2/nebular/rooms/room322.cpp
  R engines/mads/madsv2/nebular/rooms/room351.cpp
  R engines/mads/madsv2/nebular/rooms/room352.cpp
  R engines/mads/madsv2/nebular/rooms/room353.cpp
  R engines/mads/madsv2/nebular/rooms/room354.cpp
  R engines/mads/madsv2/nebular/rooms/room357.cpp
  R engines/mads/madsv2/nebular/rooms/room358.cpp
  R engines/mads/madsv2/nebular/rooms/room359.cpp
  R engines/mads/madsv2/nebular/rooms/room360.cpp
  R engines/mads/madsv2/nebular/rooms/room361.cpp
  R engines/mads/madsv2/nebular/rooms/room366.cpp
  R engines/mads/madsv2/nebular/rooms/room387.cpp
  R engines/mads/madsv2/nebular/rooms/room388.cpp
  R engines/mads/madsv2/nebular/rooms/room389.cpp
  R engines/mads/madsv2/nebular/rooms/room390.cpp
  R engines/mads/madsv2/nebular/rooms/room391.cpp
  R engines/mads/madsv2/nebular/rooms/room399.cpp
  R engines/mads/madsv2/nebular/rooms/room401.cpp
  R engines/mads/madsv2/nebular/rooms/room402.cpp
  R engines/mads/madsv2/nebular/rooms/room405.cpp
  R engines/mads/madsv2/nebular/rooms/room406.cpp
  R engines/mads/madsv2/nebular/rooms/room407.cpp
  R engines/mads/madsv2/nebular/rooms/room408.cpp
  R engines/mads/madsv2/nebular/rooms/room409.cpp
  R engines/mads/madsv2/nebular/rooms/room410.cpp
  R engines/mads/madsv2/nebular/rooms/room411.cpp
  R engines/mads/madsv2/nebular/rooms/room413.cpp
  R engines/mads/madsv2/nebular/rooms/room501.cpp
  R engines/mads/madsv2/nebular/rooms/room502.cpp
  R engines/mads/madsv2/nebular/rooms/room503.cpp
  R engines/mads/madsv2/nebular/rooms/room504.cpp
  R engines/mads/madsv2/nebular/rooms/room505.cpp
  R engines/mads/madsv2/nebular/rooms/room506.cpp
  R engines/mads/madsv2/nebular/rooms/room507.cpp
  R engines/mads/madsv2/nebular/rooms/room508.cpp
  R engines/mads/madsv2/nebular/rooms/room511.cpp
  R engines/mads/madsv2/nebular/rooms/room512.cpp
  R engines/mads/madsv2/nebular/rooms/room513.cpp
  R engines/mads/madsv2/nebular/rooms/room515.cpp
  R engines/mads/madsv2/nebular/rooms/room551.cpp
  R engines/mads/madsv2/nebular/rooms/room601.cpp
  R engines/mads/madsv2/nebular/rooms/room602.cpp
  R engines/mads/madsv2/nebular/rooms/room603.cpp
  R engines/mads/madsv2/nebular/rooms/room604.cpp
  R engines/mads/madsv2/nebular/rooms/room605.cpp
  R engines/mads/madsv2/nebular/rooms/room607.cpp
  R engines/mads/madsv2/nebular/rooms/room608.cpp
  R engines/mads/madsv2/nebular/rooms/room609.cpp
  R engines/mads/madsv2/nebular/rooms/room610.cpp
  R engines/mads/madsv2/nebular/rooms/room611.cpp
  R engines/mads/madsv2/nebular/rooms/room612.cpp
  R engines/mads/madsv2/nebular/rooms/room620.cpp
  R engines/mads/madsv2/nebular/rooms/room701.cpp
  R engines/mads/madsv2/nebular/rooms/room702.cpp
  R engines/mads/madsv2/nebular/rooms/room703.cpp
  R engines/mads/madsv2/nebular/rooms/room704.cpp
  R engines/mads/madsv2/nebular/rooms/room705.cpp
  R engines/mads/madsv2/nebular/rooms/room706.cpp
  R engines/mads/madsv2/nebular/rooms/room707.cpp
  R engines/mads/madsv2/nebular/rooms/room710.cpp
  R engines/mads/madsv2/nebular/rooms/room711.cpp
  R engines/mads/madsv2/nebular/rooms/room751.cpp
  R engines/mads/madsv2/nebular/rooms/room752.cpp
  R engines/mads/madsv2/nebular/rooms/room801.cpp
  R engines/mads/madsv2/nebular/rooms/room802.cpp
  R engines/mads/madsv2/nebular/rooms/room803.cpp
  R engines/mads/madsv2/nebular/rooms/room804.cpp
  R engines/mads/madsv2/nebular/rooms/room805.cpp
  R engines/mads/madsv2/nebular/rooms/room807.cpp
  R engines/mads/madsv2/nebular/rooms/room808.cpp
  R engines/mads/madsv2/nebular/rooms/room810.cpp
  R engines/mads/madsv2/nebular/rooms/section1.cpp
  R engines/mads/madsv2/nebular/rooms/section1.h
  R engines/mads/madsv2/nebular/rooms/section2.cpp
  R engines/mads/madsv2/nebular/rooms/section2.h
  R engines/mads/madsv2/nebular/rooms/section3.cpp
  R engines/mads/madsv2/nebular/rooms/section3.h
  R engines/mads/madsv2/nebular/rooms/section4.cpp
  R engines/mads/madsv2/nebular/rooms/section4.h
  R engines/mads/madsv2/nebular/rooms/section5.cpp
  R engines/mads/madsv2/nebular/rooms/section5.h
  R engines/mads/madsv2/nebular/rooms/section6.cpp
  R engines/mads/madsv2/nebular/rooms/section6.h
  R engines/mads/madsv2/nebular/rooms/section7.cpp
  R engines/mads/madsv2/nebular/rooms/section7.h
  R engines/mads/madsv2/nebular/rooms/section8.cpp
  R engines/mads/madsv2/nebular/rooms/section8.h
  R engines/mads/madsv2/nebular/rooms/teleporter.cpp
  R engines/mads/madsv2/nebular/rooms/teleporter.h
  R engines/mads/madsv2/nebular/rooms/thunks.cpp
  R engines/mads/madsv2/nebular/rooms/thunks.h
  R engines/mads/madsv2/nebular/sound_nebular.cpp
  R engines/mads/madsv2/nebular/sound_nebular.h
  R engines/mads/madsv2/phantom/asound.cpp
  R engines/mads/madsv2/phantom/asound.h
  R engines/mads/madsv2/phantom/catacombs.cpp
  R engines/mads/madsv2/phantom/catacombs.h
  R engines/mads/madsv2/phantom/global.cpp
  R engines/mads/madsv2/phantom/global.h
  R engines/mads/madsv2/phantom/mads/conv.h
  R engines/mads/madsv2/phantom/mads/inventory.h
  R engines/mads/madsv2/phantom/mads/mads.cpp
  R engines/mads/madsv2/phantom/mads/quotes.h
  R engines/mads/madsv2/phantom/mads/sounds.h
  R engines/mads/madsv2/phantom/mads/speeches.h
  R engines/mads/madsv2/phantom/mads/text.h
  R engines/mads/madsv2/phantom/mads/words.h
  R engines/mads/madsv2/phantom/main.cpp
  R engines/mads/madsv2/phantom/main.h
  R engines/mads/madsv2/phantom/main_menu.cpp
  R engines/mads/madsv2/phantom/main_menu.h
  R engines/mads/madsv2/phantom/menus.cpp
  R engines/mads/madsv2/phantom/menus.h
  R engines/mads/madsv2/phantom/phantom.cpp
  R engines/mads/madsv2/phantom/phantom.h
  R engines/mads/madsv2/phantom/rooms/room101.cpp
  R engines/mads/madsv2/phantom/rooms/room101.h
  R engines/mads/madsv2/phantom/rooms/room102.cpp
  R engines/mads/madsv2/phantom/rooms/room102.h
  R engines/mads/madsv2/phantom/rooms/room103.cpp
  R engines/mads/madsv2/phantom/rooms/room103.h
  R engines/mads/madsv2/phantom/rooms/room104.cpp
  R engines/mads/madsv2/phantom/rooms/room104.h
  R engines/mads/madsv2/phantom/rooms/room105.cpp
  R engines/mads/madsv2/phantom/rooms/room105.h
  R engines/mads/madsv2/phantom/rooms/room106.cpp
  R engines/mads/madsv2/phantom/rooms/room106.h
  R engines/mads/madsv2/phantom/rooms/room107.cpp
  R engines/mads/madsv2/phantom/rooms/room107.h
  R engines/mads/madsv2/phantom/rooms/room108.cpp
  R engines/mads/madsv2/phantom/rooms/room108.h
  R engines/mads/madsv2/phantom/rooms/room109.cpp
  R engines/mads/madsv2/phantom/rooms/room109.h
  R engines/mads/madsv2/phantom/rooms/room110.cpp
  R engines/mads/madsv2/phantom/rooms/room110.h
  R engines/mads/madsv2/phantom/rooms/room111.cpp
  R engines/mads/madsv2/phantom/rooms/room111.h
  R engines/mads/madsv2/phantom/rooms/room112.cpp
  R engines/mads/madsv2/phantom/rooms/room112.h
  R engines/mads/madsv2/phantom/rooms/room113.cpp
  R engines/mads/madsv2/phantom/rooms/room113.h
  R engines/mads/madsv2/phantom/rooms/room114.cpp
  R engines/mads/madsv2/phantom/rooms/room114.h
  R engines/mads/madsv2/phantom/rooms/room150.cpp
  R engines/mads/madsv2/phantom/rooms/room150.h
  R engines/mads/madsv2/phantom/rooms/room201.cpp
  R engines/mads/madsv2/phantom/rooms/room201.h
  R engines/mads/madsv2/phantom/rooms/room202.cpp
  R engines/mads/madsv2/phantom/rooms/room202.h
  R engines/mads/madsv2/phantom/rooms/room203.cpp
  R engines/mads/madsv2/phantom/rooms/room203.h
  R engines/mads/madsv2/phantom/rooms/room204.cpp
  R engines/mads/madsv2/phantom/rooms/room204.h
  R engines/mads/madsv2/phantom/rooms/room205.cpp
  R engines/mads/madsv2/phantom/rooms/room205.h
  R engines/mads/madsv2/phantom/rooms/room206.cpp
  R engines/mads/madsv2/phantom/rooms/room206.h
  R engines/mads/madsv2/phantom/rooms/room207.cpp
  R engines/mads/madsv2/phantom/rooms/room207.h
  R engines/mads/madsv2/phantom/rooms/room208.cpp
  R engines/mads/madsv2/phantom/rooms/room208.h
  R engines/mads/madsv2/phantom/rooms/room250.cpp
  R engines/mads/madsv2/phantom/rooms/room250.h
  R engines/mads/madsv2/phantom/rooms/room301.cpp
  R engines/mads/madsv2/phantom/rooms/room301.h
  R engines/mads/madsv2/phantom/rooms/room302.cpp
  R engines/mads/madsv2/phantom/rooms/room302.h
  R engines/mads/madsv2/phantom/rooms/room303.cpp
  R engines/mads/madsv2/phantom/rooms/room303.h
  R engines/mads/madsv2/phantom/rooms/room304.cpp
  R engines/mads/madsv2/phantom/rooms/room304.h
  R engines/mads/madsv2/phantom/rooms/room305.cpp
  R engines/mads/madsv2/phantom/rooms/room305.h
  R engines/mads/madsv2/phantom/rooms/room306.cpp
  R engines/mads/madsv2/phantom/rooms/room306.h
  R engines/mads/madsv2/phantom/rooms/room307.cpp
  R engines/mads/madsv2/phantom/rooms/room307.h
  R engines/mads/madsv2/phantom/rooms/room308.cpp
  R engines/mads/madsv2/phantom/rooms/room308.h
  R engines/mads/madsv2/phantom/rooms/room309.cpp
  R engines/mads/madsv2/phantom/rooms/room309.h
  R engines/mads/madsv2/phantom/rooms/room310.cpp
  R engines/mads/madsv2/phantom/rooms/room310.h
  R engines/mads/madsv2/phantom/rooms/room401.cpp
  R engines/mads/madsv2/phantom/rooms/room401.h
  R engines/mads/madsv2/phantom/rooms/room403.cpp
  R engines/mads/madsv2/phantom/rooms/room403.h
  R engines/mads/madsv2/phantom/rooms/room404.cpp
  R engines/mads/madsv2/phantom/rooms/room404.h
  R engines/mads/madsv2/phantom/rooms/room406.cpp
  R engines/mads/madsv2/phantom/rooms/room406.h
  R engines/mads/madsv2/phantom/rooms/room407.cpp
  R engines/mads/madsv2/phantom/rooms/room407.h
  R engines/mads/madsv2/phantom/rooms/room408.cpp
  R engines/mads/madsv2/phantom/rooms/room408.h
  R engines/mads/madsv2/phantom/rooms/room409.cpp
  R engines/mads/madsv2/phantom/rooms/room409.h
  R engines/mads/madsv2/phantom/rooms/room410.cpp
  R engines/mads/madsv2/phantom/rooms/room410.h
  R engines/mads/madsv2/phantom/rooms/room453.cpp
  R engines/mads/madsv2/phantom/rooms/room453.h
  R engines/mads/madsv2/phantom/rooms/room456.cpp
  R engines/mads/madsv2/phantom/rooms/room456.h
  R engines/mads/madsv2/phantom/rooms/room501.cpp
  R engines/mads/madsv2/phantom/rooms/room501.h
  R engines/mads/madsv2/phantom/rooms/room502.cpp
  R engines/mads/madsv2/phantom/rooms/room502.h
  R engines/mads/madsv2/phantom/rooms/room504.cpp
  R engines/mads/madsv2/phantom/rooms/room504.h
  R engines/mads/madsv2/phantom/rooms/room505.cpp
  R engines/mads/madsv2/phantom/rooms/room505.h
  R engines/mads/madsv2/phantom/rooms/room506.cpp
  R engines/mads/madsv2/phantom/rooms/room506.h
  R engines/mads/madsv2/phantom/rooms/section1.cpp
  R engines/mads/madsv2/phantom/rooms/section1.h
  R engines/mads/madsv2/phantom/rooms/section2.cpp
  R engines/mads/madsv2/phantom/rooms/section2.h
  R engines/mads/madsv2/phantom/rooms/section3.cpp
  R engines/mads/madsv2/phantom/rooms/section3.h
  R engines/mads/madsv2/phantom/rooms/section4.cpp
  R engines/mads/madsv2/phantom/rooms/section4.h
  R engines/mads/madsv2/phantom/rooms/section5.cpp
  R engines/mads/madsv2/phantom/rooms/section5.h
  R engines/mads/madsv2/phantom/sound_phantom.cpp
  R engines/mads/madsv2/phantom/sound_phantom.h
  R engines/mads/madsv2/textview/textview.cpp
  R engines/mads/madsv2/textview/textview.h
  R engines/mads/nebular/core/action.cpp
  R engines/mads/nebular/core/action.h
  R engines/mads/nebular/core/animation.cpp
  R engines/mads/nebular/core/animation.h
  R engines/mads/nebular/core/assets.cpp
  R engines/mads/nebular/core/assets.h
  R engines/mads/nebular/core/audio.cpp
  R engines/mads/nebular/core/audio.h
  R engines/mads/nebular/core/camera.cpp
  R engines/mads/nebular/core/camera.h
  R engines/mads/nebular/core/compression.cpp
  R engines/mads/nebular/core/compression.h
  R engines/mads/nebular/core/conversations.cpp
  R engines/mads/nebular/core/conversations.h
  R engines/mads/nebular/core/dialogs.cpp
  R engines/mads/nebular/core/dialogs.h
  R engines/mads/nebular/core/events.cpp
  R engines/mads/nebular/core/events.h
  R engines/mads/nebular/core/font.cpp
  R engines/mads/nebular/core/font.h
  R engines/mads/nebular/core/game.cpp
  R engines/mads/nebular/core/game.h
  R engines/mads/nebular/core/game_data.cpp
  R engines/mads/nebular/core/game_data.h
  R engines/mads/nebular/core/globals.cpp
  R engines/mads/nebular/core/globals.h
  R engines/mads/nebular/core/hag.cpp
  R engines/mads/nebular/core/hag.h
  R engines/mads/nebular/core/hotspots.cpp
  R engines/mads/nebular/core/hotspots.h
  R engines/mads/nebular/core/inventory.cpp
  R engines/mads/nebular/core/inventory.h
  R engines/mads/nebular/core/menu_views.cpp
  R engines/mads/nebular/core/menu_views.h
  R engines/mads/nebular/core/messages.cpp
  R engines/mads/nebular/core/messages.h
  R engines/mads/nebular/core/msurface.cpp
  R engines/mads/nebular/core/msurface.h
  R engines/mads/nebular/core/palette.cpp
  R engines/mads/nebular/core/palette.h
  R engines/mads/nebular/core/player.cpp
  R engines/mads/nebular/core/player.h
  R engines/mads/nebular/core/rails.cpp
  R engines/mads/nebular/core/rails.h
  R engines/mads/nebular/core/resources.cpp
  R engines/mads/nebular/core/resources.h
  R engines/mads/nebular/core/scene.cpp
  R engines/mads/nebular/core/scene.h
  R engines/mads/nebular/core/scene_data.cpp
  R engines/mads/nebular/core/scene_data.h
  R engines/mads/nebular/core/screen.cpp
  R engines/mads/nebular/core/screen.h
  R engines/mads/nebular/core/sequence.cpp
  R engines/mads/nebular/core/sequence.h
  R engines/mads/nebular/core/sprites.cpp
  R engines/mads/nebular/core/sprites.h
  R engines/mads/nebular/core/staticres.cpp
  R engines/mads/nebular/core/staticres.h
  R engines/mads/nebular/core/user_interface.cpp
  R engines/mads/nebular/core/user_interface.h
  R engines/mads/nebular/debugger.cpp
  R engines/mads/nebular/debugger.h
  R engines/mads/nebular/dialogs_nebular.cpp
  R engines/mads/nebular/dialogs_nebular.h
  R engines/mads/nebular/game_nebular.cpp
  R engines/mads/nebular/game_nebular.h
  R engines/mads/nebular/globals_nebular.cpp
  R engines/mads/nebular/globals_nebular.h
  R engines/mads/nebular/menu_nebular.cpp
  R engines/mads/nebular/menu_nebular.h
  R engines/mads/nebular/nebular_scenes.cpp
  R engines/mads/nebular/nebular_scenes.h
    engines/mads/configure.engine
    engines/mads/metaengine.cpp
    engines/mads/module.mk
    engines/mads/nebular/nebular.cpp
    engines/mads/nebular/nebular.h


diff --git a/engines/mads/animview/anim_timer.cpp b/engines/mads/animview/anim_timer.cpp
new file mode 100644
index 00000000000..a15924315ee
--- /dev/null
+++ b/engines/mads/animview/anim_timer.cpp
@@ -0,0 +1,299 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/animview/anim_timer.h"
+#include "mads/animview/animview.h"
+#include "mads/animview/functions.h"
+#include "mads/core/cycle.h"
+#include "mads/core/matte.h"
+#include "mads/core/mcga.h"
+#include "mads/core/mouse.h"
+#include "mads/core/pal.h"
+#include "mads/core/timer.h"
+#include "mads/engine.h"
+
+namespace MADS {
+namespace MADSV2 {
+namespace AnimView {
+
+static const byte FX_TIMES[16] = {
+	0, 110, 110, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0
+};
+
+constexpr int MESSAGES_COUNT = 8;
+static int messageHandle[MESSAGES_COUNT];
+
+static int paletteHandle;
+static int palIndex1, palIndex2;
+static int matteId;
+static int normalTimer1, imageCount;
+static int messageCount;
+static int frameViewX, frameViewY;
+
+void anim_timer_init() {
+	paletteHandle = 0;
+	palIndex1 = palIndex2 = 0;
+	matteId = 0;
+	normalTimer1 = messageCount = 0;
+	frameViewX = frameViewY = 0;
+	currentViewX = currentViewY = 0;
+	normalTimer1 = imageCount = 0;
+}
+
+void anim_timer() {
+	bool flag = false;
+	long currTimer = timer_read();
+	Speech *speech;
+	Frame *frame;
+	int sound, count;
+
+	if (current_error_code || speechStream)
+		goto done;
+	if (currentFrame < 0 || currentFrame >= maxFrame)
+		goto done;
+	if (foundSeries && currentFrame > seriesMinFrame && currentFrame <= seriesMaxFrame)
+		goto done;
+
+	if (timerFlag1) {
+		timerFlag1 = false;
+		flag = g_engine->isSpeechPlaying();
+		goto block1;
+	}
+
+	if (normalTimer1)
+		goto block3;
+
+	++runCtr1;
+
+	if (runFx == 0) {
+		if (peelFlag && currTimer >= timer2 && currTimer <= timer1) {
+			anim_peel();
+
+			timer2 += current_anim->misc_peel_rate;
+
+			if (currTimer < timer1) {
+				matte_frame(runFx, false);
+				mouse_hide();
+			}
+		}
+
+		if (currTimer < timer1)
+			goto done;
+	} else {
+		long time = timer1 - FX_TIMES[runFx];
+		if (time > currTimer)
+			goto done;
+	}
+
+	sound = current_anim->frame[currentFrame].sound;
+	if (sound && g_engine->_soundManager->isLoaded() && runFx == 0)
+		g_engine->_soundManager->command(sound);
+
+	if (speechIndex != -1)
+		goto block2;
+	speechIndex = current_anim->frame[currentFrame].speech;
+	if (speechIndex == -1)
+		goto block2;
+
+	speech = &current_anim->speech[speechIndex];
+	flag = speech->display_condition != 0x4000 &&
+		speech->display_condition != 0x800 &&
+		speech->resource_id >= 0;
+
+	if (speech->sound /*&& (!flag || sound_var1 == '1')*/) {
+		g_engine->_soundManager->command(speech->sound);
+		flag = false;
+	}
+
+	if (flag) {
+		speechStream = speech->speech;
+		speechFlags = speech->flags;
+		goto done;
+	}
+
+block1:
+	speechLoops = flag ? current_anim->speech[speechIndex].speech_loops :
+		current_anim->speech[speechIndex].non_speech_loops;
+	runVal6 = 0;
+	runVal7 = -1;
+
+	speech = &current_anim->speech[speechIndex];
+	if (loadFontFlag && speech->display_condition != 0x8000 &&
+			speech->display_condition != 0x800) {
+		paletteHandle = pal_alloc_color(-1, 0, &palIndex1, &speech->color[0]);
+		paletteHandle = pal_alloc_color(paletteHandle, -1, &palIndex2, &speech->color[1]);
+
+		mcga_setpal_range(&master_palette, MIN(palIndex1, palIndex2), ABS(palIndex2 - palIndex1) + 1);
+		runVal8 = -1;
+		matteId = matte_add_message(current_anim->font, speech->text,
+			speech->x, speech->y, (palIndex2 << 8) | palIndex1,
+			current_anim->font_auto_spacing);
+		messageCount = 0;
+
+		for (count = 0; count < current_anim->num_speech; ++count) {
+			Speech *s = &current_anim->speech[count];
+			if (count != speechIndex && messageCount < MESSAGES_COUNT &&
+					s->first_frame <= currentFrame && s->last_frame >= currentFrame) {
+				messageHandle[messageCount++] = matte_add_message(current_anim->font, s->text,
+					s->x, s->y, (palIndex2 << 8) | palIndex1,
+					current_anim->font_auto_spacing);
+			}
+		}
+	}
+
+block2:
+	frameViewX = current_anim->frame[currentFrame].view_x;
+	frameViewY = current_anim->frame[currentFrame].view_y;
+
+	if (frameViewX != currentViewX || frameViewY != currentViewY) {
+		if (!picture_map.one_to_one) {
+			tile_pan(&picture_map, frameViewX, frameViewY);
+			tile_pan(&depth_map, frameViewX, frameViewY);
+		}
+
+		image_marker = 1;
+		image_list[0].flags = IMAGE_REFRESH;
+		image_list[0].segment_id = 0xff;
+		currentViewX = frameViewX;
+		currentViewY = frameViewY;
+	} else {
+		for (count = 0; count < image_marker; ++count) {
+			if (image_list[count].flags != IMAGE_REFRESH)
+				image_list[count].flags = IMAGE_ERASE;
+		}
+	}
+
+	imageCount = image_marker;
+	for (; imageFrame < current_anim->num_images; ++imageFrame) {
+		Image *img = &current_anim->image[imageFrame];
+
+		if (img->flags > currentFrame)
+			break;
+		if (img->flags != currentFrame)
+			continue;
+
+		bool found = false;
+		for (count = 0; !found && count < imageCount; ++count) {
+			Image *img2 = &image_list[count];
+
+			found = img->series_id == img2->series_id &&
+				img->sprite_id == img2->sprite_id &&
+				img->x == img2->x &&
+				img->y == img2->y &&
+				img->depth == img2->depth &&
+				img->scale == img2->scale;
+			if (found)
+				img2->flags = IMAGE_STATIC;
+		}
+
+		if (!found) {
+			assert(image_marker < IMAGE_LIST_SIZE);
+			image_list[image_marker] = *img;
+			Series *series = series_list[img->series_id];
+			image_list[image_marker].flags = (series->delta_series >= 1) ?
+				IMAGE_DELTA : IMAGE_UPDATE;
+			++image_marker;
+		}
+	}
+
+	if (currentFrame == 0)
+		anim_setup_cycle(runFx);
+
+	frame = &current_anim->frame[currentFrame];
+	if (frame->yank_x) {
+		buffer_peel_horiz(&scr_orig, frame->yank_x);
+		matte_refresh_work();
+	}
+	if (frame->yank_y) {
+		buffer_peel_vert(&scr_orig, frame->yank_y, scr_orig.data, 320 * 200);
+		matte_refresh_work();
+	}
+
+	matte_frame(runFx, 0);
+	mouse_hide();
+
+block3:
+	if (runFx) {
+		currTimer = timer_read();
+		if (currTimer < timer1) {
+			normalTimer1 = -1;
+			goto done;
+		}
+
+		frame = &current_anim->frame[currentFrame];
+		if (frame->sound && g_engine->_soundManager->isLoaded()) {
+			g_engine->_soundManager->command(frame->sound);
+			timer1 = currTimer;
+		}
+
+		timer2 = currTimer + current_anim->misc_peel_rate;
+		cycling_active = has_cycles;
+	}
+
+	normalTimer1 = 0;
+
+	if (current_anim->misc_no_catchup || !resync_timer1 || runVal7 ||
+			(currentFrame == 0 && resync_timer2))
+		timer1 = currTimer;
+
+	runFx = 0;
+	runVal7 = 0;
+	runCtr1 = 0;
+
+	if (++currentFrame < maxFrame) {
+		frame = &current_anim->frame[currentFrame];
+		timer1 += frame->ticks;
+	}
+
+	if (speechIndex == -1)
+		goto done;
+	speech = &current_anim->speech[speechIndex];
+	if (speech->last_frame >= currentFrame)
+		goto done;
+	if (++runVal6 < speechLoops) {
+		if (currentFrame == maxFrame) {
+			frame = &current_anim->frame[runVal6 - 1];
+			timer1 += frame->ticks;
+		}
+
+		currentFrame = speech->first_frame;
+		imageFrame = speech->first_image;
+	} else {
+		speechIndex = -1;
+
+		if (runVal8) {
+			matte_clear_message(matteId);
+			pal_deallocate(paletteHandle);
+			runVal8 = 0;
+
+			for (count = 0; count < messageCount; ++count)
+				matte_clear_message(messageHandle[count]);
+			messageCount = 0;
+		}
+	}
+
+done:
+	cycle_colors();
+}
+
+} // namespace AnimView
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/madsv2/animview/anim_timer.h b/engines/mads/animview/anim_timer.h
similarity index 100%
rename from engines/mads/madsv2/animview/anim_timer.h
rename to engines/mads/animview/anim_timer.h
diff --git a/engines/mads/animview/animview.cpp b/engines/mads/animview/animview.cpp
new file mode 100644
index 00000000000..780e9237667
--- /dev/null
+++ b/engines/mads/animview/animview.cpp
@@ -0,0 +1,650 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "audio/audiostream.h"
+#include "common/file.h"
+#include "mads/core/env.h"
+#include "mads/core/himem.h"
+#include "mads/core/kernel.h"
+#include "mads/core/matte.h"
+#include "mads/core/mcga.h"
+#include "mads/core/mouse.h"
+#include "mads/core/pack.h"
+#include "mads/core/pal.h"
+#include "mads/core/speech.h"
+#include "mads/core/tile.h"
+#include "mads/core/timer.h"
+#include "mads/animview/animview.h"
+#include "mads/animview/anim_timer.h"
+#include "mads/animview/functions.h"
+#include "mads/engine.h"
+
+namespace MADS {
+namespace MADSV2 {
+namespace AnimView {
+
+#define MADS_FORMAT(BUF, SRC) Common::strcpy_s(BUF, in_mads_mode ? "*" : ""); \
+	Common::strcat_s(BUF, SRC)
+
+constexpr bool in_mads_mode = true;
+
+Audio::AudioStream *speechStream;
+int speechFlags;
+int current_error_code;
+int currentFrame;
+int minFrame, maxFrame;
+bool foundSeries;
+int seriesMinFrame, seriesMaxFrame;
+bool timerFlag1;
+bool peelFlag;
+int runCtr1;
+int runFx;
+long timer1, timer2;
+AnimPtr current_anim;
+AnimInterPtr current_anim_inter;
+int speechIndex;
+int speechLoops;
+int runVal6, runVal7, runVal8;
+bool loadFontFlag;
+int imageFrame;
+CycleList anim_cycle_list;
+bool has_cycles;
+int currentViewX, currentViewY;
+int concat_mode;
+bool stop_music_at_end;
+bool wait_for_music_at_end;
+
+static const byte FX_TIMES[16] = {
+	0, 110, 110, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0
+};
+
+static bool has_sound_file;
+static char sound_file_name[80];
+static TileResource picture_res, depth_res;
+static Buffer scr_work_orig;
+static Room *room;
+static int viewing_at_y2;
+constexpr int SPEECH_LINES_COUNT = 10;
+static Audio::AudioStream *speech_lines[SPEECH_LINES_COUNT];
+static int speech_lines_count;
+static SeriesPtr animSeries;
+static SpritePageInfoPtr pageInfo;
+static SpritePageTablePtr pageTable;
+static int imageFrame1, imageFrame2;
+static int largeBufferSize;
+static byte *largeBuffer, *largeBufferEnd;
+static byte *largeBuffer1, *largeBuffer2, *largeBuffer3;
+static bool seriesFlag1, seriesFlag2;
+static bool hasAnimInited;
+static int runVal1, runVal2, runVal3;
+static int runVal12;
+static int error_code;
+
+/**
+ * Initializes animview global variables
+ */
+static void init_globals() {
+	anim_timer_init();
+	functions_init();
+	concat_mode = 0;
+	has_sound_file = false;
+	*sound_file_name = '\0';
+	memset(&picture_map, 0, sizeof(TileMapHeader));
+	memset(&depth_map, 0, sizeof(TileMapHeader));
+	memset(&picture_res, 0, sizeof(TileResource));
+	memset(&depth_res, 0, sizeof(TileResource));
+	memset(&anim_cycle_list, 0, sizeof(CycleList));
+	memset(&scr_work_orig, 0, sizeof(Buffer));
+	room = nullptr;
+	current_anim = nullptr;
+	current_anim_inter = nullptr;
+	has_cycles = false;
+	viewing_at_y2 = 0;
+	memset(speech_lines, 0, sizeof(speech_lines));
+	speech_lines_count = 0;
+	animSeries = nullptr;
+	pageInfo = nullptr;
+	pageTable = nullptr;
+	foundSeries = false;
+	imageFrame1 = imageFrame2 = seriesMaxFrame = 0;
+	seriesMinFrame = 0;
+	largeBufferSize = 0;
+	largeBuffer = largeBufferEnd = nullptr;
+	largeBuffer1 = largeBuffer2 = nullptr;
+	largeBuffer3 = nullptr;
+	seriesFlag1 = false;
+	seriesFlag2 = true;
+	hasAnimInited = false;
+	minFrame = maxFrame = -1;
+	timer1 = timer2 = 0;
+	runVal1 = 0;
+	runVal2 = runVal3 = -1;
+	speechIndex = speechLoops = runVal6 = 0;
+	runVal7 = runVal8 = 0;
+	speechStream = nullptr;
+	timerFlag1 = false;
+	runVal12 = 0;
+	loadFontFlag = 0;
+	runFx = 0;
+	runCtr1 = 0;
+	currentFrame = 0;
+	peelFlag = false;
+	error_code = current_error_code = 0;
+	wait_for_music_at_end = false;
+	exit_immediately_at_end = false;
+	imageFrame = 0;
+}
+
+static void anim_inter_timer() {
+	error("TODO: Inter anim timer");
+}
+
+/**
+ * Responsible for running a loaded animation
+ */
+static void run_animation(int animIndex) {
+	int ctr;
+
+	if (!hasAnimInited) {
+		hasAnimInited = true;
+		mouse_set_work_buffer(scr_work.data, scr_work.x);
+		mouse_set_view_port_loc(0, viewing_at_y, scr_work.x, scr_work.y + viewing_at_y - 1);
+		mouse_set_view_port(0, 0);
+	}
+
+	auto &screen = *g_engine->getScreen();
+	if (viewing_at_y && anim_list[animIndex].show_bars) {
+		screen.hLine(0, viewing_at_y - 2, 319, 253);
+		screen.hLine(0, viewing_at_y + scr_work.y + 1, 319, 253);
+	} else if (viewing_at_y) {
+		screen.hLine(0, viewing_at_y - 2, 319, 0);
+		screen.hLine(0, viewing_at_y + scr_work.y + 1, 319, 0);
+	}
+
+	buffer_fill(scr_work, 0);
+
+	imageFrame = 0;
+	currentViewX = currentViewY = -1;
+	current_error_code = error_code;
+
+	if (minFrame == -1)
+		minFrame = 0;
+	if (maxFrame == -1)
+		maxFrame = current_anim->num_frames;
+
+	minFrame = CLIP<int>(minFrame, 0, current_anim->num_frames);
+	maxFrame = CLIP<int>(maxFrame, 0, current_anim->num_frames);
+	if (maxFrame < minFrame)
+		maxFrame = minFrame;
+
+	if (animIndex == 0)
+		timer1 = timer_read();
+
+	speechIndex = -1;
+	loadFontFlag = (current_anim->load_flags & AA_LOAD_FONT) != 0;
+
+	speechLoops = runVal6 = runVal7 = runVal8 = 0;
+	speechStream = 0;
+	timerFlag1 = false;
+
+	if (current_anim->background_type == AA_INTERFACE) {
+		currentFrame = -1;
+		runVal12 = -1;
+		runFx = 0;
+
+		for (ctr = 0; ctr < current_anim_inter->num_frames; ++ctr)
+			current_anim_inter->segment[ctr].counter = -1;
+
+		image_inter_marker = 1;
+		image_inter_list[0].flags = -2;
+		image_inter_list[0].segment_id = KERNEL_SEGMENT_SYSTEM;
+
+		timer_activate_low_priority(anim_inter_timer);
+
+	} else {
+		timer1 += current_anim->frame[minFrame].ticks;
+		runFx = anim_list[animIndex].fx;
+		currentFrame = minFrame;
+		runCtr1 = 0;
+		peelFlag = current_anim->misc_peel_x || current_anim->misc_peel_y;
+		timer2 = timer1;
+		timer_activate_low_priority(anim_timer);
+	}
+
+	// Main animation loop
+	while (currentFrame < maxFrame && !current_error_code) {
+		if (speechStream) {
+			if (current_anim->load_flags & AA_LOAD_SPEECH) {
+				//char speechName[80];
+				//MADS_FORMAT(speechName, current_anim->speech_file);
+
+				g_engine->playSpeech(speechStream);
+				//speech_play(speechName, speechStream);
+			}
+
+			timerFlag1 = true;
+			speechStream = 0;
+		}
+
+		if (foundSeries && seriesMinFrame < seriesMaxFrame) {
+			// Get the memory needed for the page, rounded up
+			int frameIndex = seriesMinFrame - imageFrame1 + 2;
+			int pageMemNeeded = (pageTable[frameIndex - 1].memory_needed & ~15) + 16;
+			bool flag1 = false;
+
+			if (!seriesFlag1) {
+				if ((largeBufferEnd - largeBuffer2) <= pageMemNeeded) {
+					flag1 = true;
+				} else {
+					seriesFlag1 = true;
+					largeBuffer2 = largeBuffer;
+				}
+			}
+			if (seriesFlag1) {
+				if ((largeBuffer2 - largeBuffer1) <= pageMemNeeded)
+					flag1 = true;
+			}
+
+			if (seriesFlag2 && currentFrame <= seriesMinFrame && !picture_map.one_to_one)
+				flag1 = false;
+
+			if (flag1)
+				seriesFlag2 = false;
+
+			if (flag1) {
+				(void)sprite_data_load(animSeries, frameIndex, largeBuffer2);
+				largeBuffer2 += pageMemNeeded;
+				++seriesMinFrame;
+			}
+
+			while (((speechIndex == -1 && currentFrame > imageFrame2) ||
+					(speechIndex != -1 && current_anim->speech[speechIndex].first_frame > imageFrame2)) &&
+					imageFrame2 < seriesMaxFrame) {
+				frameIndex = imageFrame2 - imageFrame1 + 1;
+				pageMemNeeded = (pageTable[frameIndex - 1].memory_needed & ~15) + 16;
+				largeBuffer1 += pageMemNeeded;
+				++imageFrame2;
+
+				if (animSeries->index[frameIndex].data != largeBuffer1) {
+					largeBuffer1 = largeBuffer;
+					seriesFlag1 = false;
+
+					if (seriesMinFrame < imageFrame2)
+						largeBuffer2 = largeBuffer;
+				}
+			}
+		}
+
+		if (g_engine->shouldQuit())
+			current_error_code = 1;
+		if (g_engine->hasPendingKey()) {
+			g_engine->flushKeys();
+			error_code = 1;
+			current_error_code = 1;
+		}
+		if (mouse_get_status(&mouse_x, &mouse_y)) {
+			current_error_code = -1;
+			error_code = 3;
+		}
+
+		// Animation loop delay
+		g_system->delayMillis(10);
+	}
+
+	cycling_threshold = 3;
+	timer_activate_low_priority(cycling_active ? cycle_colors : nullptr);
+
+	if (!current_error_code && current_anim->misc_slow_fade) {
+		timer_activate_low_priority(nullptr);
+		timer2 = timer_read();
+		bool fadeFlag = true;
+
+		while (fadeFlag && !current_error_code) {
+			do {
+				// Brief pause
+				g_system->delayMillis(10);
+
+				// Check for any keypress
+				if (g_engine->hasPendingKey()) {
+					g_engine->flushKeys();
+					error_code = 1;
+					current_error_code = 1;
+				}
+
+				if (g_engine->shouldQuit())
+					current_error_code = 1;
+			} while (timer_read() < timer2);
+
+			if (peelFlag) {
+				anim_peel();
+				matte_frame(0, 0);
+			}
+
+			fadeFlag = anim_fade(&cycling_palette, current_anim->misc_slow_fade);
+			mcga_setpal(&cycling_palette);
+			timer2 += current_anim->misc_peel_rate;
+		}
+	}
+
+	if ((animIndex == (anim_count - 1)) &&
+			(wait_for_music_at_end || !exit_immediately_at_end)) {
+		while (current_error_code == 0) {
+			// Check for any keypress or mouse clicks
+			if (g_engine->hasPendingKey()) {
+				g_engine->flushKeys();
+				error_code = 1;
+				current_error_code = 1;
+			}
+
+			int mouseX = 0, mouseY = 0;
+			if (mouse_get_status(&mouseX, &mouseY))
+				current_error_code = 1;
+
+			if (g_engine->shouldQuit())
+				current_error_code = 1;
+
+			if (!exit_immediately_at_end)
+				continue;
+			if (g_engine->_soundManager->command(8))
+				continue;
+			current_error_code = 1;
+		}
+	}
+
+	// Teardown for final animation
+	if (animIndex == (anim_count - 1) || current_error_code) {
+		timer_activate_low_priority(nullptr);
+	}
+
+	g_engine->stopSpeech();
+}
+
+/**
+ * Iterate over the entries in the anim_list, animating each
+ * in sequence
+ */
+static void animate() {
+	char buf[80];
+	AnimFile anim_in;
+	int count, series_ctr, ctr;
+	int soundLoadFlag = 0;
+	int imageIndex;
+	static int packIndex = 0;
+	bool found_sound = false;
+
+	himem_startup();
+	(void)tile_setup();
+
+	mcga_compute_retrace_parameters();
+	memset(cycling_palette, 0, sizeof(Palette));
+	pal_init(1, 8);
+	mouse_hard_cursor_mode(2, master_palette);
+
+	timer_install();
+	matte_init(-1);
+	cycle_list.num_cycles = 0;
+
+	// Preload resources used by the animations
+	for (count = 0; count < anim_count; ++count) {
+		AnimEntry &entry = anim_list[count];
+
+		MADS_FORMAT(buf, entry.name);
+		himem_preload_series(buf, 0);
+
+		if (anim_get_header_info(buf, &anim_in))
+			continue;
+
+		// Preload resources used by the animation
+		if (anim_in.load_flags & AA_LOAD_FONT) {
+			*buf = '\0';
+			if (in_mads_mode)
+				Common::strcpy_s(buf, "*");
+			Common::strcat_s(buf, anim_in.font_file);
+			himem_preload_series(buf, 0);
+		}
+
+		for (series_ctr = 0; series_ctr < anim_in.num_series; ++series_ctr) {
+			MADS_FORMAT(buf, anim_in.series_name[series_ctr]);
+			himem_preload_series(buf, 0);
+		}
+
+		if (anim_in.background_type == AA_ROOM) {
+			static const char *EXT[5] = { ".dat", ".tt", ".mm", ".tt0", ".mm0" };
+			for (int i = 0; i < 5; ++i) {
+				env_get_level_path(buf, anim_in.background_room, EXT[i], 3, 0);
+				himem_preload_series(buf, 0);
+			}
+		}
+
+		if (g_engine->shouldQuit())
+			error_code = 1;
+	}
+
+	if (!do_not_clear_screen) {
+		mcga_setpal(&cycling_palette);
+	}
+
+	speech_init();
+
+	for (count = 0; count < anim_count && !error_code; ++count) {
+		MADS_FORMAT(buf, anim_list[count].name);
+
+		if (!has_sound_file) {
+			if (anim_get_sound_info(buf, sound_file_name, &soundLoadFlag))
+				goto done;
+
+			Common::String name(sound_file_name);
+			has_sound_file = !name.empty();
+			found_sound = true;
+		}
+
+		if ((!stop_music_at_end || found_sound) && !g_engine->_soundManager->isLoaded()) {
+			// Initialize the sound driver
+			char ext = sound_file_name[strlen(sound_file_name) - 1];
+			int section = (g_engine->isDemo() && !Common::isDigit(ext)) ? 1 : ext - '0';
+			g_engine->_soundManager->init(section);
+		}
+
+		if (anim_list[count].bg_load_status) {
+			buffer_free(&scr_depth);
+			buffer_free(&scr_orig);
+			tile_map_free(&picture_map);
+			tile_map_free(&depth_map);
+
+			if (room) {
+				pal_deallocate(room->color_handle);
+				mem_free(room);
+			} else {
+				pal_init(1, 8);
+				mouse_hard_cursor_mode(2, &master_palette);
+			}
+		}
+
+		int loadFlags = anim_list[count].bg_load_status ? ANIM_LOAD_BACKGROUND : 0;
+		current_anim = anim_load(buf, &scr_orig, &scr_depth,
+			&picture_map, &depth_map, &picture_res, &depth_res, &room,
+			&anim_cycle_list, loadFlags);
+		scr_inter_orig = scr_orig;
+
+		if (!current_anim)
+			error("Could not load anim for - %s", buf);
+
+		tile_pan(&picture_map, current_anim->frame->view_x, current_anim->frame->view_y);
+		tile_pan(&depth_map, current_anim->frame->view_x, current_anim->frame->view_y);
+
+		if (current_anim->misc_any_packed) {
+			packIndex = current_anim->misc_packed_series;
+			animSeries = current_anim->series[packIndex];
+			pageInfo = animSeries->page_info;
+			pageTable = animSeries->page_table;
+			mem_free(animSeries->arena);
+			animSeries->arena = nullptr;
+		}
+
+		has_cycles = anim_cycle_list.num_cycles > 0;
+		current_anim_inter = (AnimInterPtr)current_anim;
+
+		int height = (scr_orig.y == 200) ? 200 : 156;
+		buffer_init(&scr_work, 320, height);
+		scr_inter = scr_work;
+		assert(scr_work.data);
+
+		viewing_at_y = (height == 200) ? 0 : (200 - height) / 2;
+		viewing_at_y2 = viewing_at_y;
+
+		buffer_fill(scr_work, 0);
+
+		// Speech handling
+		speech_lines_count = 0;
+		for (ctr = 0; ctr < current_anim->num_speech; ++ctr) {
+			Speech &speech = current_anim->speech[ctr];
+			speech.speech = nullptr;
+
+			if ((speech.flags & 0x2000) && speech_lines_count < SPEECH_LINES_COUNT) {
+				// Load the speech audio
+				MADS_FORMAT(buf, current_anim->speech_file);
+				speech_lines[speech_lines_count] = speech.speech =
+					speech_load(buf, speech.resource_id);
+
+				++speech_lines_count;
+			}
+		}
+
+		if (current_anim->misc_any_packed) {
+			largeBufferSize = 0xfffff;	// Aribitrarily large value
+			largeBuffer = (byte *)mem_get(largeBufferSize);
+			assert(largeBuffer);
+
+			largeBufferEnd = largeBuffer + largeBufferSize - 1;
+			largeBuffer1 = largeBuffer2 = largeBuffer;
+
+			foundSeries = true;
+			imageIndex = -1;
+			seriesFlag1 = false;
+
+			for (ctr = 0; ctr < current_anim->num_images; ++ctr) {
+				int seriesId = current_anim->series_id[packIndex];
+				if (current_anim->image[ctr].series_id == seriesId) {
+					imageIndex = ctr;
+					break;
+				}
+			}
+
+			if (imageIndex < 0)
+				foundSeries = false;
+
+			if (foundSeries) {
+				Image &img = current_anim->image[imageIndex];
+				imageFrame1 = imageFrame2 = img.flags;
+				seriesMinFrame = img.flags - 1;
+				seriesMaxFrame = img.flags + img.sprite_id - 1;
+			}
+		}
+
+		// Run the animation
+		run_animation(count);
+
+		for (auto &line : speech_lines) {
+			mem_free(line);
+			line = nullptr;
+		}
+
+		mem_free(largeBuffer);
+		largeBuffer = nullptr;
+
+		minFrame = maxFrame = -1;
+
+		if (has_sound_file && stop_music_at_end) {
+			// Free the allocated sound driver
+			g_engine->_soundManager->closeDriver();
+		}
+
+		if (stop_music_at_end && found_sound)
+			has_sound_file = false;
+
+		// Free surface
+		buffer_free(&scr_work);
+		anim_unload(current_anim);
+		current_anim = nullptr;
+
+		if (g_engine->shouldQuit())
+			error_code = 1;
+	}
+done:
+	timer_activate_low_priority(nullptr);
+	buffer_free(&scr_work);
+	anim_unload(current_anim);
+	buffer_free(&scr_depth);
+	buffer_free(&scr_orig);
+	tile_map_free(&picture_map);
+	tile_map_free(&depth_map);
+
+	if (room)
+		mem_free(room);
+	timer_set_sound_flag(false);
+
+	if (g_engine->_soundManager->isLoaded())
+		g_engine->_soundManager->removeDriver();
+
+	timer_remove();
+	himem_shutdown();
+}
+
+void animview_main(const char *resName) {
+	char name[16];
+
+	init_globals();
+
+	pack_enable_pfab_explode();
+	(void)env_verify();
+	mouse_hide();
+
+	Common::strcpy_s(name, resName);
+	if (*name == '@') {
+		Common::strcpy_s(name, resName + 1);
+		Common::strcat_s(name, ".res");
+	}
+
+	if (!Common::File::exists(name)) {
+		Common::strcpy_s(name, "*");
+		Common::strcat_s(name, resName);
+	}
+
+	Common::SeekableReadStream *file = env_open(name);
+	if (!file)
+		error("Could not open animview resource - %s", name);
+
+	// Read in the resource lines
+	read_resource(file);
+	delete file;
+
+	if (has_sound_file) {
+		char snd_name[80];
+		MADS_FORMAT(snd_name, sound_file_name);
+		env_get_path(sound_file_name, snd_name);
+	}
+
+	animate();
+}
+
+} // namespace AnimView
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/animview/animview.h b/engines/mads/animview/animview.h
new file mode 100644
index 00000000000..b6526108c86
--- /dev/null
+++ b/engines/mads/animview/animview.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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADSV2_ANIMVIEW_H
+#define MADSV2_ANIMVIEW_H
+
+#include "audio/audiostream.h"
+#include "mads/core/anim.h"
+#include "mads/core/cycle.h"
+
+namespace MADS {
+namespace MADSV2 {
+namespace AnimView {
+
+// Variables shared with other AnimView namespace files
+extern Audio::AudioStream *speechStream;
+extern int speechFlags;
+extern int current_error_code;
+extern int currentFrame, minFrame, maxFrame;
+extern bool foundSeries;
+extern int seriesMinFrame, seriesMaxFrame;
+extern bool timerFlag1;
+extern bool peelFlag;
+extern int runCtr1;
+extern int runFx;
+extern long timer1, timer2;;
+extern AnimPtr current_anim;
+extern AnimInterPtr current_anim_inter;
+extern int speechIndex;
+extern int speechLoops;
+extern int runVal6, runVal7, runVal8;
+extern bool loadFontFlag;
+extern int imageFrame;
+extern CycleList anim_cycle_list;
+extern bool has_cycles;
+extern int currentViewX, currentViewY;
+extern int concat_mode;
+extern bool wait_for_music_at_end;
+extern bool stop_music_at_end;
+
+// Main animview function
+extern void animview_main(const char *resName);
+
+} // namespace AnimView
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/animview/functions.cpp b/engines/mads/animview/functions.cpp
new file mode 100644
index 00000000000..40a0b112b3d
--- /dev/null
+++ b/engines/mads/animview/functions.cpp
@@ -0,0 +1,232 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "graphics/palette.h"
+#include "mads/animview/functions.h"
+#include "mads/animview/animview.h"
+#include "mads/core/cycle.h"
+#include "mads/core/matte.h"
+#include "mads/core/mcga.h"
+#include "mads/core/pal.h"
+
+namespace MADS {
+namespace MADSV2 {
+namespace AnimView {
+
+int anim_count;
+AnimEntry anim_list[MAX_ANIM];
+bool background_load_status;
+int16 sound_interrupts_mode;
+bool show_white_bars;
+bool resync_timer1, resync_timer2;
+bool exit_immediately_at_end;
+bool do_not_clear_screen;
+
+/**
+ * Initialize globals
+ */
+void functions_init() {
+	anim_count = 0;
+	background_load_status = true;
+	sound_interrupts_mode = 0;
+	show_white_bars = false;
+	resync_timer1 = true;
+	resync_timer2 = false;
+	exit_immediately_at_end = false;
+	do_not_clear_screen = false;
+}
+
+/**
+ * Adds an animation to the list of .aa files to show in sequence
+ * @param name		Animation resource name
+ */
+void add_anim(const char *name) {
+	static char buf[16];
+
+	if (strlen(name) > 0 && anim_count < MAX_ANIM) {
+		Common::strcpy_s(buf, name);
+		if (!strchr(buf, '.'))
+			Common::strcat_s(buf, ".aa");
+
+		Common::strcpy_s(anim_list[anim_count].name, buf);
+		anim_list[anim_count].bg_load_status = background_load_status;
+		anim_list[anim_count].sound_mode = sound_interrupts_mode;
+		anim_list[anim_count].show_bars = show_white_bars;
+		++anim_count;
+	}
+}
+
+/**
+ * Parses a flag from an animation line in the resource file
+ */
+void flag_parse(const char *param) {
+	char c = tolower(*param++);
+	switch (c) {
+	case 'd':
+		stop_music_at_end = true;
+		break;
+
+	case 'j':
+		wait_for_music_at_end = true;
+		break;
+
+	case 'k':
+		// Toggle whether keypress jumps to end. Not implemented in ScummVM
+		break;
+
+	case 'o':
+		// Specify opening special effect
+		assert(anim_count < MAX_ANIM);
+		if (*param == ':')
+			anim_list[anim_count].fx = atoi(param + 1);
+		break;
+
+	case 'p':
+		// Switch MADS path mode to CONCAT
+		concat_mode = 1;
+		break;
+
+	case 'r':
+		// -r[:abn] Resynch timer (always, beginning, never)
+		if (*param == ':') {
+			switch (tolower(*++param)) {
+			case 'n':
+				resync_timer1 = true;
+				resync_timer2 = false;
+				break;
+			case 'a':
+				resync_timer1 = false;
+				break;
+			case 'b':
+				resync_timer1 = true;
+				resync_timer2 = true;
+				break;
+			default:
+				break;
+			}
+		}
+		break;
+
+	case 'w':
+		// Toggle white bars on or off
+		show_white_bars = !show_white_bars;
+		break;
+
+	case 'x':
+		// Exit immediately after last frame
+		exit_immediately_at_end = true;
+		break;
+
+	case 'y':
+		// Do not clear screen at start
+		do_not_clear_screen = true;
+		break;
+
+	default:
+		error("Unsupported animview flag - %c", c);
+		break;
+	}
+}
+
+/**
+ * Reads the contents of the resource file stream, and adds
+ * entries to the anim_list for what to display
+ */
+void read_resource(Common::SeekableReadStream *src) {
+	while (!src->eos()) {
+		Common::String line = src->readLine();
+		line.trim();
+		if (line.empty())
+			continue;
+
+		// Handle any flags at the start of the line
+		const char *lineP = line.c_str();
+		while (strchr("/-", *lineP)) {
+			// It's a flag
+			++lineP;
+			const char *switchEnd = strchr(lineP, ' ');
+			Common::String param;
+
+			if (switchEnd) {
+				// There's more line after the flag
+				param = Common::String(lineP, switchEnd);
+				for (lineP = switchEnd; *lineP == ' '; ++lineP) {
+				}
+			} else {
+				// This is the last flag of the line
+				param = Common::String(lineP);
+				lineP = lineP + strlen(lineP);
+			}
+
+			flag_parse(param.c_str());
+		}
+
+		// As long as we're not at the end of the line, any remainder
+		// should be the name of the animation resource to play
+		if (*lineP)
+			add_anim(lineP);
+	}
+}
+
+void anim_peel() {
+	int peelX = current_anim->misc_peel_x;
+	if (peelX) {
+		buffer_peel_horiz(&scr_work, peelX);
+		matte_refresh_work();
+	}
+
+	int peelY = current_anim->misc_peel_y;
+	if (peelY) {
+		buffer_peel_vert(&scr_work, peelY, scr_inter_orig.data, 320 * 200);
+		matte_refresh_work();
+	}
+}
+
+void anim_setup_cycle(int fx) {
+	cycling_active = false;
+	memcpy(cycling_palette, master_palette, sizeof(Palette));
+
+	if (fx)
+		mcga_setpal(&master_palette);
+
+	cycle_init(&anim_cycle_list, has_cycles && !fx);
+}
+
+/**
+ * Handleas incremental fading by subtracting an amount from each palette
+ * entries' RGB values down towards zero
+ */
+bool anim_fade(Palette *pal, int fadeAmount) {
+	bool palChanged = false;
+	byte *rgb = (byte *)pal;
+	for (int count = 0; count < Graphics::PALETTE_SIZE; ++count, ++rgb) {
+		if (*rgb)
+			palChanged = true;
+		*rgb = MAX((int)*rgb - fadeAmount, 0);
+	}
+
+	return palChanged;
+}
+
+} // namespace AnimView
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/animview/functions.h b/engines/mads/animview/functions.h
new file mode 100644
index 00000000000..70680b30253
--- /dev/null
+++ b/engines/mads/animview/functions.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADSV2_ANIMVIEW_FUNCTIONS_H
+#define MADSV2_ANIMVIEW_FUNCTIONS_H
+
+#include "common/stream.h"
+#include "mads/core/pal.h"
+
+namespace MADS {
+namespace MADSV2 {
+namespace AnimView {
+
+struct AnimEntry {
+	char name[16];
+	bool bg_load_status;
+	uint8 sound_mode;
+	uint8 show_bars;
+	uint8 fx;
+};
+constexpr int MAX_ANIM = 40;
+
+extern int anim_count;
+extern AnimEntry anim_list[MAX_ANIM];
+extern bool background_load_status;
+extern int16 sound_interrupts_mode;
+extern bool show_white_bars;
+extern bool resync_timer1, resync_timer2;
+extern bool exit_immediately_at_end;
+extern bool do_not_clear_screen;
+
+
+/**
+ * Initialize globals
+ */
+extern void functions_init();
+
+/**
+ * Adds an animation to the list of .aa files to show in sequence
+ * @param name		Animation resource name
+ */
+extern void add_anim(const char *name);
+
+/**
+ * Parses a flag from an animation line in the resource file
+ */
+extern void flag_parse(const char *param);
+
+/**
+ * Reads the contents of the resource file stream, and adds
+ * entries to the anim_list for what to display
+ */
+extern void read_resource(Common::SeekableReadStream *src);
+
+extern void anim_peel();
+
+extern void anim_setup_cycle(int fx);
+extern bool anim_fade(Palette *pal, int fadeAmount);
+
+} // namespace AnimView
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/configure.engine b/engines/mads/configure.engine
index 12640c8c631..911539063d2 100644
--- a/engines/mads/configure.engine
+++ b/engines/mads/configure.engine
@@ -1,4 +1,3 @@
 # This file is included from the main "configure" script
 # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] [components]
-add_engine mads "MADS" yes "madsv2" "Rex Nebular"
-add_engine madsv2 "MADS V2" no "" "Return of the Phantom, Dragonsphere"
+add_engine mads "MADS" no "" "Microprose Software Inc."
diff --git a/engines/mads/console.cpp b/engines/mads/console.cpp
new file mode 100644
index 00000000000..5405c83a3a4
--- /dev/null
+++ b/engines/mads/console.cpp
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/console.h"
+#include "mads/core/imath.h"
+#include "mads/core/kernel.h"
+#include "mads/core/matte.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+Console::Console() : GUI::Debugger() {
+	registerCmd("depth", WRAP_METHOD(Console, cmdDepth));
+	registerCmd("teleport", WRAP_METHOD(Console, cmdTeleport));
+	registerCmd("walkable", WRAP_METHOD(Console, cmdWalkable));
+}
+
+int strToInt(const char *s) {
+	if (!*s)
+		// No string at all
+		return 0;
+	else if (toupper(s[strlen(s) - 1]) != 'H')
+		// Standard decimal string
+		return atoi(s);
+
+	// Hexadecimal string
+	uint tmp = 0;
+	int read = sscanf(s, "%xh", &tmp);
+	if (read < 1)
+		error("strToInt failed on string \"%s\"", s);
+	return (int)tmp;
+}
+
+bool Console::cmdDepth(int argc, const char **argv) {
+	const byte *srcP = scr_depth.data;
+	byte *destP = scr_orig.data;
+
+	for (int i = 0; i < scr_orig.x * scr_orig.y; i += 2, ++srcP) {
+		*destP++ = *srcP >> 4;
+		*destP++ = *srcP & 0xf;
+	}
+
+	matte_refresh_work();
+	return false;
+}
+
+bool Console::cmdTeleport(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("Current room is: %d\n", new_room);
+		debugPrintf("Usage: %s <room number> [<previous room>]\n", argv[0]);
+		return true;
+	} else {
+		if (argc >= 3)
+			room_id = strToInt(argv[2]);
+		new_room = strToInt(argv[1]);
+
+		return false;
+	}
+}
+
+bool Console::cmdWalkable(int argc, const char **argv) {
+	const byte *srcP = scr_walk.data - 1;
+	byte *destP = scr_orig.data;
+	assert((scr_walk.x * 8) == scr_orig.x);
+
+	// Draw the walkable areas
+	for (int i = 0; i < scr_orig.x * scr_orig.y; ++i, ++destP) {
+		if ((i % 8) == 0)
+			++srcP;
+		if (!(*srcP & (1 << (7 - (i % 8)))))
+			*destP = 10;
+	}
+
+	// Draw cross-hairs at the locations of the rails within the room
+	for (int i = 0; i < room->num_rails; ++i) {
+		const Rail &r = room->rail[i];
+
+		buffer_hline(scr_orig, r.x - 2, r.x + 2, r.y, 0);
+		buffer_vline(scr_orig, r.x, r.y - 2, r.y + 2, 0);
+	}
+
+	matte_refresh_work();
+	return false;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/madsv2/console.h b/engines/mads/console.h
similarity index 100%
rename from engines/mads/madsv2/console.h
rename to engines/mads/console.h
diff --git a/engines/mads/core/anim.cpp b/engines/mads/core/anim.cpp
new file mode 100644
index 00000000000..65f5908b6b0
--- /dev/null
+++ b/engines/mads/core/anim.cpp
@@ -0,0 +1,627 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "common/memstream.h"
+#include "mads/core/anim.h"
+#include "mads/core/himem.h"
+#include "mads/core/env.h"
+#include "mads/core/sprite.h"
+#include "mads/core/room.h"
+#include "mads/core/color.h"
+#include "mads/core/fileio.h"
+#include "mads/core/buffer.h"
+#include "mads/core/matte.h"
+#include "mads/core/inter.h"
+#include "mads/core/pal.h"
+#include "mads/core/mads.h"
+#include "mads/core/tile.h"
+#include "mads/core/error.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+ShadowList anim_shadow = { 0, { 0, 0, 0 } };
+int anim_error;
+
+void AnimFile::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(num_series, num_frames, num_images, num_speech,
+		load_flags, font_auto_spacing, background_type, background_room);
+	src->readMultipleLE(misc);
+	src->read(background_name, 13);
+
+	for (int i = 0; i < AA_MAX_SERIES; ++i)
+		src->read(&series_name[i][0], 13);
+
+	src->read(sound_file_name, 13);
+	src->read(background_depth, 13);
+	src->read(speech_file, 13);
+	src->read(font_file, 13);
+	src->skip(1);
+}
+
+void Speech::load(Common::SeekableReadStream *src) {
+	resource_id = src->readSint16LE();
+	src->read(text, 60);
+	src->read(misc, 3);
+	src->readMultipleLE(sound);
+
+	speech = nullptr;
+	src->skip(4);
+
+	src->readMultipleLE(x, y, display_condition);
+
+	for (int i = 0; i < 2; ++i)
+		color[i].load(src);
+
+	src->readMultipleLE(flags, speech_loops, non_speech_loops, segment_to_loop,
+		first_frame, last_frame, first_image);
+}
+
+void ImageInter::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(flags, segment_id, series_id, sprite_id);
+	src->skip(1);
+	x = src->readSint16LE();
+	y = src->readByte();
+	src->skip(1);
+}
+
+void Frame::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(sound, speech, ticks, view_x, view_y, yank_x, yank_y);
+}
+
+void SegmentInter::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(probability, num_images, first_image, last_image, counter);
+	src->read(spawn, AA_MAX_SPAWNED);
+	src->readMultipleLE(spawn_frame);
+	sound = src->readByte();
+	src->skip(1);
+	sound_frame = src->readSint16LE();
+}
+
+
+//====================================================================
+
+int anim_load_background(AnimFile *anim_in, Buffer *this_orig,
+		Buffer *this_depth, TileMapHeader *pictureMap, TileMapHeader *depthMap,
+		TileResource *pictureResource, TileResource *depthResource,
+		RoomPtr *room, CycleListPtr cycle_list, int load_flags, int star_search) {
+	int error_flag;
+	char temp_buf[80];
+	RoomPtr my_room = NULL;
+
+	error_flag = false;
+
+	if (anim_in->background_type <= AA_FULLSIZE) {
+
+		pal_activate_shadow(&anim_shadow);
+
+		my_room = room_load(anim_in->background_room, 0, anim_in->background_name,
+			this_orig, this_depth, NULL, NULL,
+			pictureMap,
+			depthMap,
+			pictureResource,
+			depthResource,
+			-1,
+			-1,
+			load_flags);
+
+		if (my_room == NULL) {
+			error_flag = true;
+		} else {
+			if (cycle_list != NULL) {
+				memcpy(cycle_list, &my_room->cycle_list, sizeof(CycleList));
+			}
+		}
+
+	} else if (anim_in->background_type == AA_INTERFACE) {
+		temp_buf[0] = 0;
+		if (star_search) {
+			Common::strcat_s(temp_buf, "*");
+		}
+		Common::strcat_s(temp_buf, anim_in->background_name);
+		error_flag = inter_load_background(temp_buf, this_orig);
+		if (cycle_list != NULL) {
+			cycle_list->num_cycles = 0;
+		}
+
+		if (pictureMap != NULL) {
+			tile_fake_map(TILE_PICTURE,
+				pictureMap,
+				this_orig,
+				this_orig->x,
+				this_orig->y);
+		}
+
+		if (depthMap != NULL) depthMap->map = NULL;
+
+	} else {
+		buffer_init_name(this_orig, video_x, video_y, "$anmorig");
+		if (this_depth != NULL) buffer_init_name(this_depth, video_x, video_y >> 1, "$anmdpth");
+		if (this_orig->data != NULL) {
+			buffer_fill(*this_orig, 0);
+		} else {
+			error_flag = true;
+		}
+
+		if (this_depth != NULL) {
+			if (this_depth->data != NULL) {
+				buffer_fill(*this_depth, 0xff);
+			}
+		}
+
+		if (pictureMap != NULL) {
+			tile_fake_map(TILE_PICTURE,
+				pictureMap,
+				this_orig,
+				this_orig->x, this_orig->y);
+		}
+
+		if (depthMap != NULL) {
+			tile_fake_map(TILE_ATTRIBUTE,
+				depthMap,
+				this_depth,
+				this_orig->x, this_orig->y);
+		}
+
+	}
+
+	if (error_flag) {
+		if (this_depth != NULL) buffer_free(this_depth);
+		buffer_free(this_orig);
+		if (pictureMap != NULL) tile_map_free(pictureMap);
+		if (pictureMap != NULL) tile_map_free(depthMap);
+	}
+
+	if (room != NULL) *room = my_room;
+
+	return error_flag;
+}
+
+void anim_unload(AnimPtr anim) {
+	int count;
+
+	if (anim != NULL) {
+		if (anim->misc_any_packed) {
+			matte_deallocate_series(anim->series_id[anim->misc_packed_series], true);
+		}
+		for (count = anim->num_series - 1; count >= 0; count--) {
+			if (!anim->misc_any_packed || (count != anim->misc_packed_series)) {
+				matte_deallocate_series(anim->series_id[count], true);
+			}
+		}
+		if (anim->font != NULL) {
+			mem_free(anim->font);
+		}
+
+		mem_free(anim);
+	}
+}
+
+AnimPtr anim_load(const char *file_name, Buffer *orig, Buffer *depth,
+		TileMapHeader *pictureMap, TileMapHeader *depthMap,
+		TileResource *pictureResource, TileResource *depthResource,
+		RoomPtr *room, CycleListPtr cycle_list, int load_flags) {
+	int count;
+	int error_flag = true;
+	int star_search;
+	char temp_buf[80];
+	char block_name[20];
+	char *mark;
+	int16 *color_slaves = (int16 *)temp_buf;
+	word num_color_slaves;
+	long image_size, frame_size, speech_size, anim_size;
+	AnimPtr anim = NULL;
+	AnimInterPtr anim2 = NULL;
+	AnimFile anim_in;
+	Load load_handle;
+
+	mem_last_alloc_loader = MODULE_ANIM_LOADER;
+
+	load_handle.open = false;
+
+	Common::strcpy_s(temp_buf, file_name);
+	if (strchr(temp_buf, '.') == NULL) {
+		Common::strcat_s(temp_buf, ".AA");
+	}
+
+	star_search = (temp_buf[0] == '*');
+
+	anim_error = 1;
+	if (loader_open(&load_handle, temp_buf, "rb", true))
+		goto done;
+
+	{
+		anim_error = 2;
+		byte buffer[AnimFile::SIZE];
+		if (!loader_read(buffer, AnimFile::SIZE, 1, &load_handle))
+			goto done;
+
+		Common::MemoryReadStream src(buffer, AnimFile::SIZE);
+		anim_in.load(&src);
+	}
+
+	if (anim_in.background_type == AA_INTERFACE) {
+		load_flags |= PAL_MAP_RESERVED;
+	}
+
+	if (load_flags & ANIM_LOAD_BACKGROUND) {
+		if (anim_load_background(&anim_in,
+			orig, depth,
+			pictureMap, depthMap,
+			pictureResource, depthResource,
+			room, cycle_list,
+			load_flags, star_search)) {
+			anim_error = 20000 + room_load_error;
+			goto done;
+		}
+	}
+
+	if (load_flags & ANIM_LOAD_BACK_ONLY) {
+		anim_in.num_speech = 0;
+		anim_in.num_images = 0;
+		anim_in.num_frames = 0;
+	}
+
+	// get how much memory we need to load all the bits
+	// AA_INTERFACE are like the fish in the interface in rex... (quasi supported)
+
+	if (anim_in.background_type != AA_INTERFACE) {
+		speech_size = (long)sizeof(Speech) * (long)anim_in.num_speech;
+		image_size = (long)sizeof(Image) * (long)anim_in.num_images;
+		frame_size = (long)sizeof(Frame) * (long)anim_in.num_frames;
+		anim_size = (long)sizeof(Anim) + speech_size + image_size + frame_size;
+	} else {
+		speech_size = (long)sizeof(Speech) * (long)anim_in.num_speech;
+		image_size = (long)sizeof(ImageInter) * (long)anim_in.num_images;
+		frame_size = (long)sizeof(SegmentInter) * (long)anim_in.num_frames;
+		anim_size = (long)sizeof(AnimInter) + speech_size + image_size + frame_size;
+	}
+
+	Common::strcpy_s(block_name, "A$");
+	mark = temp_buf;
+	if (*mark == '*') mark++;
+	if ((*mark == 'R') && (*(mark + 1) == 'M')) {
+		mark += 2;
+	}
+	strncat(block_name, mark, 6);
+
+	anim = (AnimPtr)mem_get_name(anim_size, block_name);
+	anim2 = (AnimInterPtr)anim;
+
+	anim_error = 4;
+	if (anim == NULL) goto done;
+
+	anim->font = NULL;
+
+	if (anim_in.background_type != AA_INTERFACE) {
+		anim->speech = (SpeechPtr)mem_normalize(((char *)anim) + sizeof(Anim));
+		anim->image = (ImagePtr)mem_normalize(((char *)anim->speech) + speech_size);
+		anim->frame = (FramePtr)mem_normalize(((char *)anim->image) + image_size);
+	} else {
+		anim2->speech = (SpeechPtr)mem_normalize(((char *)anim2) + sizeof(AnimInter));
+		anim2->image = (ImageInterPtr)mem_normalize(((char *)anim2->speech) + speech_size);
+		anim2->segment = (SegmentInterPtr)mem_normalize(((char *)anim2->image) + image_size);
+	}
+
+	// get ready for loading some series
+	Common::fill(anim->series, anim->series + AA_MAX_SERIES, (SeriesPtr)nullptr);
+	Common::fill(anim->series_id, anim->series_id + AA_MAX_SERIES, -1);
+
+	// we read the header before, now get it into our new structure
+	memcpy(anim, &anim_in, sizeof(AnimFile));
+
+	if (speech_size > 0) {
+		anim_error = 5;
+
+		size_t size = Speech::SIZE * anim_in.num_speech;
+		byte *buffer = (byte *)malloc(size);
+		if (!loader_read(buffer, size, 1, &load_handle)) {
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, size);
+
+		if (anim_in.background_type == AA_INTERFACE) {
+			for (int i = 0; i < anim_in.num_speech; ++i)
+				anim2->speech[i].load(&src);
+		} else {
+			for (int i = 0; i < anim_in.num_speech; ++i)
+				anim->speech[i].load(&src);
+		}
+
+		free(buffer);
+	}
+
+	// x, y, depth, s, series and sprite id comprise an image
+	// read in all images here. image_size is sizeof(Image)* number of images
+
+	if (image_size > 0) {
+		anim_error = 6;
+
+		size_t size = (anim_in.background_type == AA_INTERFACE ? ImageInter::SIZE : Image::SIZE) * anim_in.num_images;
+		byte *buffer = (byte *)malloc(size);
+		if (!loader_read(buffer, size, 1, &load_handle)) {
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, size);
+
+		if (anim_in.background_type == AA_INTERFACE) {
+			for (int i = 0; i < anim_in.num_images; ++i)
+				anim2->image[i].load(&src);
+		} else {
+			for (int i = 0; i < anim_in.num_images; ++i)
+				anim->image[i].load(&src);
+		}
+
+		free(buffer);
+	}
+
+	// a frame contains timing information and sound effect information
+	// images know which frame they are a part of
+
+	if (frame_size > 0) {
+		anim_error = 7;
+
+		size_t size = (anim_in.background_type == AA_INTERFACE ? SegmentInter::SIZE : Frame::SIZE) * anim_in.num_frames;
+		byte *buffer = (byte *)malloc(size);
+		if (!loader_read(buffer, size, 1, &load_handle)) {
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, size);
+
+		if (anim_in.background_type == AA_INTERFACE) {
+			for (int i = 0; i < anim_in.num_frames; ++i)
+				anim2->segment[i].load(&src);
+		} else {
+			for (int i = 0; i < anim_in.num_frames; ++i)
+				anim->frame[i].load(&src);
+		}
+
+		free(buffer);
+	}
+
+	loader_close(&load_handle);
+
+	if (anim->load_flags & AA_LOAD_FONT) {
+		temp_buf[0] = 0;
+		if (star_search)
+			Common::strcat_s(temp_buf, "*");
+
+		Common::strcat_s(temp_buf, anim_in.font_file);
+		anim->font = font_load(temp_buf);
+		anim_error = 8;
+
+		if (anim->font == NULL)
+			goto done;
+	}
+
+	// we've loaded the anim file, now load the series
+
+	for (count = 0; count < anim->num_series; count++) {
+		if (!anim->misc_any_packed || (count != anim->misc_packed_series)) {
+			temp_buf[0] = 0;
+			if (star_search) {
+				Common::strcat_s(temp_buf, "*");
+			}
+			Common::strcat_s(temp_buf, anim_in.series_name[count]);
+
+			// matte_load_series will check to see if a series was
+			// previously loaded before it goes and gets it from the disk
+			// we'll get back a pointer to the actual sprite series for      
+			// each id number
+
+			anim->series_id[count] = matte_load_series(temp_buf, load_flags, 0);
+			if (anim->series_id[count] < 0) {
+				anim_error = 9;
+				goto done;
+			}
+			anim->series[count] = series_list[anim->series_id[count]];
+
+		}
+	}
+
+	// if a separate load was needed for some reason
+	// if we're stream loading, we might need to allocate memory
+	// last so that it is at the end of memory - decrease fragmentation
+	// problems
+
+	if (anim->misc_any_packed) {
+		temp_buf[0] = 0;
+		if (star_search) {
+			Common::strcat_s(temp_buf, "*");
+		}
+		Common::strcat_s(temp_buf, anim_in.series_name[anim->misc_packed_series]);
+
+		count = anim->misc_packed_series;
+		anim->series_id[count] = matte_load_series(temp_buf, load_flags, 0);
+		if (anim->series_id[count] < 0) {
+			anim_error = 11;
+			goto done;
+		}
+
+		anim->series[count] = series_list[anim->series_id[count]];
+	}
+
+	// compact all the colors in the series to a single color handle
+	// so it doesn't take up lots of palette space
+
+	num_color_slaves = 0;
+	for (count = 1; count < anim->num_series; count++) {
+		color_slaves[num_color_slaves] = anim->series[count]->color_handle;
+		num_color_slaves++;
+	}
+
+	if (num_color_slaves > 0) {
+		pal_compact(anim->series[0]->color_handle, num_color_slaves, color_slaves);
+	}
+
+	// translate the numbers we have into actual runtime numbers
+	// in the file they were 0, 1, 2, ... When we translate them they'll
+	// have to be moved not to conflict with series that we might already
+	// have loaded
+
+	if (anim_in.background_type != AA_INTERFACE) {
+		for (count = 0; count < anim->num_images; count++) {
+			anim->image[count].series_id = (byte)anim->series_id[anim->image[count].series_id];
+		}
+	} else {
+		for (count = 0; count < anim2->num_images; count++) {
+			anim2->image[count].series_id = (byte)anim2->series_id[anim2->image[count].series_id];
+		}
+	}
+
+	error_flag = false;
+	anim_error = 0;
+
+done:
+	if (error_flag) {
+		anim_unload(anim);
+		anim = NULL;
+
+		if (load_flags & ANIM_LOAD_BACKGROUND) {
+			if (depth != NULL)       buffer_free(depth);
+			if (orig != NULL)       buffer_free(orig);
+			if (depthMap != NULL)   tile_map_free(depthMap);
+			if (pictureMap != NULL) tile_map_free(pictureMap);
+		}
+	}
+	if (load_handle.open) loader_close(&load_handle);
+
+	return anim;
+}
+
+int anim_get_sound_info(const char *file_name, char *sound_file_buffer, int *sound_load_flag) {
+	int error_flag = true;
+	AnimFile anim_in;
+	Load load_handle;
+
+	load_handle.open = false;
+
+	// Open up the source animation file
+	if (loader_open(&load_handle, file_name, "rb", true)) goto done;
+
+	// Load the file header contents
+	byte buffer[AnimFile::SIZE];
+	if (!loader_read(buffer, AnimFile::SIZE, 1, &load_handle)) goto done;
+
+	{
+		Common::MemoryReadStream src(buffer, AnimFile::SIZE);
+		anim_in.load(&src);
+	}
+
+	// Copy out the sound filename
+	Common::strcpy_s(sound_file_buffer, 65536, anim_in.sound_file_name);
+	*sound_load_flag = (anim_in.load_flags & AA_LOAD_SOUND);
+
+	error_flag = false;
+
+done:
+	if (load_handle.open)
+		loader_close(&load_handle);
+	return error_flag;
+}
+
+int anim_get_header_info(char *file_name,
+	AnimFile *anim_in) {
+	int error_flag = true;
+	Load load_handle;
+
+	load_handle.open = false;
+
+	if (!loader_open(&load_handle, file_name, "rb", true)) {
+		byte buffer[AnimFile::SIZE];
+		if (loader_read(buffer, AnimFile::SIZE, 1, &load_handle)) {
+			Common::MemoryReadStream src(buffer, AnimFile::SIZE);
+			anim_in->load(&src);
+			error_flag = false;
+		}
+	}
+
+	if (load_handle.open)
+		loader_close(&load_handle);
+
+	return error_flag;
+}
+
+int anim_himem_preload(char *name, int level) {
+	int error_flag = true;
+	char temp_buf[80];
+	AnimFile anim_in;
+	int count2;
+	int mads_mode;
+
+	mads_mode = (name[0] == '*');
+
+	himem_preload_series(name, level);
+
+	if (anim_get_header_info(name, &anim_in)) goto done;
+
+	if (anim_in.load_flags & AA_LOAD_FONT) {
+		temp_buf[0] = 0;
+		if (mads_mode) Common::strcat_s(temp_buf, "*");
+		Common::strcat_s(temp_buf, anim_in.font_file);
+		himem_preload_series(temp_buf, level);
+	}
+
+	for (count2 = 0; count2 < anim_in.num_series; count2++) {
+		temp_buf[0] = 0;
+		if (mads_mode) Common::strcpy_s(temp_buf, "*");
+		Common::strcat_s(temp_buf, anim_in.series_name[count2]);
+		himem_preload_series(temp_buf, level);
+	}
+
+	if (anim_in.background_type == AA_ROOM) {
+		env_get_level_path(temp_buf, ROOM, ".DAT", 0, anim_in.background_room);
+		himem_preload_series(temp_buf, level);
+		env_get_level_path(temp_buf, ROOM, ".TT", 0, anim_in.background_room);
+		himem_preload_series(temp_buf, level);
+		env_get_level_path(temp_buf, ROOM, ".MM", 0, anim_in.background_room);
+		himem_preload_series(temp_buf, level);
+		env_get_level_path(temp_buf, ROOM, ".TT0", 0, anim_in.background_room);
+		himem_preload_series(temp_buf, level);
+		env_get_level_path(temp_buf, ROOM, ".MM0", 0, anim_in.background_room);
+		himem_preload_series(temp_buf, level);
+	} else if (anim_in.background_type == AA_INTERFACE) {
+		temp_buf[0] = 0;
+		if (mads_mode) Common::strcat_s(temp_buf, "*");
+		Common::strcat_s(temp_buf, anim_in.background_name);
+		himem_preload_series(temp_buf, level);
+	}
+
+	error_flag = false;
+
+done:
+	return error_flag;
+}
+
+void init_anim() {
+	memset(&anim_shadow, 0, sizeof(ShadowList));
+	anim_error = 0;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/anim.h b/engines/mads/core/anim.h
new file mode 100644
index 00000000000..8bfab57123f
--- /dev/null
+++ b/engines/mads/core/anim.h
@@ -0,0 +1,466 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_ANIM_H
+#define MADS_CORE_ANIM_H
+
+#include "audio/audiostream.h"
+#include "common/stream.h"
+#include "mads/core/general.h"
+#include "mads/core/font.h"
+#include "mads/core/image.h"
+#include "mads/core/room.h"
+#include "mads/core/sprite.h"
+#include "mads/core/tile.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+/* Flags to be passed to anim_load().  Note that all PAL_MAP... flags */
+/* can be passed through as well.                                     */
+
+#define ANIM_LOAD_TRANSLATE   0x0001    /* Translate to 16 colors     */
+#define ANIM_LOAD_BACKGROUND  0x0100    /* Load background picture    */
+#define ANIM_LOAD_BACK_ONLY   0x0200    /* Load background only       */
+#define ANIM_INTERFACE        0x4000
+
+/* these are mapped to misc[] in the AnimFile structure below */
+
+#define depth_coded         misc[0]
+#define misc_any_packed     misc[1]
+#define misc_packed_series  misc[2]
+#define misc_peel_x         misc[3]
+#define misc_peel_y         misc[4]
+#define misc_peel_rate      misc[5]
+#define misc_slow_fade      misc[6]
+
+#define misc_no_catchup     misc[7]
+
+#define seg_misc_coordinate_style       misc[0]
+#define seg_misc_displace_x             misc[1]
+#define seg_misc_displace_y             misc[2]
+
+#define seg_misc_disp_good_1            misc[3]  /* holds magic number (problem w/ uninitialized data) */
+#define seg_misc_disp_good_2            misc[4]
+#define SEG_MAGIC_1                     0x1234
+#define SEG_MAGIC_2                     0x5678
+
+#define seg_misc_accel_x                misc[5]
+#define seg_misc_accel_y                misc[6]
+
+#define seg_misc_special_scale          misc[7]
+
+#define SEG_SPECIAL_SCALE_UP          0x8000
+#define SEG_SPECIAL_SCALE_DOWN        0x4000
+#define SEG_SPECIAL_SCALE_MASK        0xf000
+
+#define AA_MAX_SERIES            50     /* Maximum # of series        */
+#define AA_MAX_SEGMENTS          25     /* Maximum # of segments      */
+#define AA_MAX_FRAMES           500     /* Maximum # of frames        */
+#define AA_MAX_IMAGES           500     /* Maximum # of images        */
+#define AA_MAX_SPEECH            25     /* Maximum # of speech queues */
+
+#define AA_MAX_IMAGES_PER_FRAME 250     /* Maximum images in one frame */
+
+#define AA_MAX_SPAWNED          2       /* Maximum # of spawns in random */
+
+#define AA_MAX_CHANGES          100     /* Maximum # of speech changes   */
+
+
+#define AA_ROOM                 1       /* Use MADS room as background */
+#define AA_FULLSIZE             2       /* Use MADS full screen room   */
+#define AA_BLACKSCREEN          3       /* Black screen background     */
+#define AA_INTERFACE            4       /* Use MADS interface screen   */
+
+
+#define AA_DONTCARE             -1
+
+#define AA_LINEAR               1       /* loop_mode settings */
+#define AA_PINGPONG             2
+#define AA_STAMP                9       /* FOR KERNEL SEQUENCES ONLY */
+
+#define AA_ONCE                 1       /* repeat_mode settings */
+#define AA_MULTIPLE             2
+
+#define AA_ROOMBASED            -1      /* depth/scale settings */
+#define AA_MANUAL               -2
+
+#define AA_ABSOLUTEFRAME        1       /* framing settings */
+#define AA_DELTAFIRST           2
+#define AA_DELTALAST            3
+#define AA_ABSOLUTEFIRST        4
+#define AA_ABSOLUTELAST         5
+#define AA_RANDOMACCESS         6
+
+#define AA_NOTHING              0             /* No timing marks      */
+#define AA_MARK                 0x8000        /* Timing MARK portion  */
+#define AA_TIMING               0x7fff        /* Timing TICKS portion */
+
+#define AA_LOAD_SOUND         0x8000          /* Load sound file  */
+#define AA_LOAD_SPEECH        0x4000          /* Load speech file */
+#define AA_LOAD_FONT          0x2000          /* Load font file   */
+
+#define AA_NO_SPEECH          (-1)            /* No speech queue       */
+
+#define AA_SPEECH             0x8000          /* Use speech always     */
+#define AA_TEXT               0x4000          /* Use text always       */
+#define AA_SPEECH_XOR_TEXT    0x2000          /* Use speech or text    */
+#define AA_SPEECH_AND_TEXT    0x1000          /* Use speech and text   */
+#define AA_SPEECH_NOR_TEXT    0x0800          /* Use neither           */
+
+#define AA_ABORTABLE          0x8000          /* Segment can be aborted           */
+#define AA_CONVENTIONAL       0x4000          /* Segment uses conventional memory */
+#define AA_PRELOAD            0x2000          /* Segment preloads (conv. only)    */
+
+
+#define AA_ERR_OPENFILE                 -128
+#define AA_ERR_WRITEFILE                -129
+#define AA_ERR_READFILE                 -130
+#define AA_ERR_NOMOREMEMORY             -131
+#define AA_ERR_MAKEDIALOG               -132
+#define AA_ERR_TOOMANYIMAGES            -133
+#define AA_ERR_TOOMANYFRAMES            -134
+#define AA_ERR_TOOMANYSEGMENTS          -135
+#define AA_ERR_TOOMANYSPEECH            -136
+#define AA_ERR_NODAMNFONT               -137
+#define AA_ERR_BADDEFINITION            -138
+#define AA_ERR_OLDDEFINITION            -139
+
+
+#define IMAGE_UNSCALED                  0xff
+
+#define IMAGE_UPDATE_READY              0x40  /* Ready for live screen   */
+
+#define IMAGE_UPDATE                     1    /* Image needs redraw      */
+#define IMAGE_STATIC                     0    /* Image remains on screen */
+#define IMAGE_ERASE                     -1    /* Image erased & removed  */
+#define IMAGE_REFRESH                   -2    /* Full buffer refresh     */
+#define IMAGE_OVERPRINT                 -3    /* Interface overprint     */
+#define IMAGE_DELTA                     -4    /* Image drawn to scr_orig */
+#define IMAGE_FULLUPDATE                -5    /* Interface area erasure  */
+
+#define IMAGE_UPDATE_ONLY               -20   /* Update live screen only */
+
+
+struct SegmentBuf {
+	int    seg_id;
+
+	char   name[32];
+
+	int    series_id;
+	int    mirror_series;
+	int    start_sprite;
+	int    end_sprite;
+	int    sprite_loop_mode;
+	int    sprite_repeat_mode;
+	double loop_direction;
+
+	int    framing;
+	int    first_frame;
+	int    last_frame;
+
+	byte   depth_mode;
+	byte   low_level_change;
+
+	int    scale_mode;
+	int    front_y, back_y;
+	int    front_scale, back_scale;
+
+	int    probability;
+
+	byte   spawn[AA_MAX_SPAWNED];
+	int    spawn_frame[AA_MAX_SPAWNED];
+	byte   sound;
+	int    sound_frame;
+
+	int    start_x, start_y;
+	int    end_x, end_y;
+
+	double delta_x, delta_y;
+
+	int    auto_locating;
+
+	int    speech;
+
+	word   misc[10];
+
+	int    num_sprite_changes;
+	word   sprite_change_frame[AA_MAX_CHANGES];
+	word   sprite_change_target[AA_MAX_CHANGES];
+};
+
+typedef SegmentBuf Segment;
+typedef Segment *SegmentPtr;
+
+
+#define zone_low      spawn_frame[0]
+#define zone_high     spawn_frame[1]
+
+
+struct ImageEditBuf {
+	int frame_id;
+	byte segment_id;
+
+	byte series_id;
+	int sprite_id;
+	int x, y;
+	byte depth;
+	byte scale;
+};
+
+typedef ImageEditBuf ImageEdit;
+typedef ImageEdit *ImageEditPtr;
+
+struct ImageInter {
+	int16 flags;
+	byte segment_id;
+	byte series_id;
+	byte sprite_id;
+	// byte padding
+	int16 x;
+	byte y;
+	// byte padding
+
+	static constexpr size_t SIZE = 2 + 1 + 1 + 1 + 1 + 2 + 1 + 1;
+	void load(Common::SeekableReadStream *src);
+};
+typedef ImageInter *ImageInterPtr;
+
+
+struct MessageBuf {
+	char active;
+	char spacing;
+	int x, y;
+	int xs, ys;
+	int status;
+	int main_color;
+	FontPtr font;
+	char *text;
+};
+
+typedef MessageBuf Message;
+typedef Message *MessagePtr;
+
+
+
+struct FrameEditBuf {
+	byte sound;
+	word ticks;
+	word timing;
+	word view_x;
+	word view_y;
+	int8 yank_x;
+	int8 yank_y;
+};
+
+typedef FrameEditBuf FrameEdit;
+typedef FrameEdit *FrameEditPtr;
+
+
+struct Frame {
+	byte sound;         /* what sound cue to play                             */
+	int8 speech;        /* what speech record to activate                     */
+	word ticks;         /* how many ticks for this frame (before? after?)     */
+	word view_x;        /* where the pan set currently                        */
+	word view_y;
+	int8 yank_x;        /* for backgrounds which wrap around, like starfields */
+	int8 yank_y;
+
+	static constexpr size_t SIZE = 1 + 1 + 2 + 2 + 2 + 1 + 1;
+	void load(Common::SeekableReadStream *src);
+};
+typedef Frame *FramePtr;
+
+
+struct SegmentInter {
+	int16 probability;
+	int16 num_images;
+	int16 first_image;
+	int16 last_image;
+	int16 counter;
+	byte spawn[AA_MAX_SPAWNED];
+	int16 spawn_frame[AA_MAX_SPAWNED];
+	byte sound;
+	//byte padding;
+	int16 sound_frame;
+
+	static constexpr size_t SIZE = 5 * 2 + AA_MAX_SPAWNED + AA_MAX_SPAWNED * 2 + 2 + 2;
+	void load(Common::SeekableReadStream *src);
+};
+typedef SegmentInter *SegmentInterPtr;
+
+
+struct Speech {
+	int16 resource_id;            /* Speech segment id in resource file */
+	char text[60];                /* Text to be displayed     */
+	byte misc[3];                 /* 3 extra bonus bytes      */
+	byte sound;                   /* Sound to be used         */
+	Audio::AudioStream *speech;	  /* Speech audio stream      */
+	int16 x, y;                   /* Text coordinates         */
+	uint16 display_condition;     /* Condition for display    */
+	RGBcolor color[2];            /* Colors for text display  */
+	word flags;                   /* Segment flags            */
+	int16 speech_loops;           /* Loops if speech active   */
+	int16 non_speech_loops;       /* Loops if speech inactive */
+	int16 segment_to_loop;        /* Segment ID to be looped  */
+	int16 first_frame;            /* First frame of segment   */
+	int16 last_frame;             /* Last frame of segment    */
+	int16 first_image;            /* First image number       */
+
+	static constexpr size_t SIZE = 2 + 60 + 3 + 1 + 4 + 2 + 2 + 2 + 2 * RGBcolor::SIZE + 7 * 2;
+	void load(Common::SeekableReadStream *src);
+};
+
+typedef Speech *SpeechPtr;
+
+/* daa file header */
+
+struct AnimDefBuf {
+	int num_series;
+	int num_segments;
+	int num_frames;
+	int num_images;
+	int num_speech;
+
+	int timing_mode;
+
+	int misc[10];
+
+	word load_flags;
+	int font_auto_spacing;
+
+	int background_type;
+	int background_xs;
+	int background_ys;
+	int background_room;
+	char background_name[80];
+
+	char sound_file_name[80];
+
+	char name[80];
+	char desc[80];
+
+	char series_name[AA_MAX_SERIES][80];
+
+	char background_depth[80];
+
+	char speech_file[80];
+	char font_file[80];
+};
+
+
+typedef AnimDefBuf AnimDef;
+typedef AnimDef *AnimDefPtr;
+
+/* aa file header */
+
+struct AnimFile {
+	uint16 num_series;
+	uint16 num_frames;
+	uint16 num_images;
+	uint16 num_speech;
+	word load_flags;
+	uint16 font_auto_spacing;
+	uint16 background_type;                 /* black, or room, or whatever    */
+	uint16 background_room;                 /* room number to load            */
+	uint16 misc[10];                        /* see MISC_ defines above        */
+	char background_name[13];            /* if needed                      */
+	char series_name[AA_MAX_SERIES][13]; /* filenames for all your series  */
+	char sound_file_name[13];
+	char background_depth[13];
+	char speech_file[13];
+	char font_file[13];
+
+	static constexpr size_t SIZE = (8 * 2) + (10 * 2) + 13 +
+		(AA_MAX_SERIES * 13) + 13 + 13 + 13 + 13 +
+		1; // structure padding
+	void load(Common::SeekableReadStream *src);
+};
+
+/* runtime memory image for an animation */
+
+struct Anim : public AnimFile {
+	FontPtr font;
+	SpeechPtr speech;
+
+	ImagePtr image;						/* to the array of images */
+	FramePtr frame;						/* to the array of frames */
+	SeriesPtr series[AA_MAX_SERIES];	/* pointers to series     */
+
+	int series_id[AA_MAX_SERIES];
+};
+typedef Anim *AnimPtr;
+
+/* the interface version of the above */
+
+struct AnimInter : public AnimFile {
+	FontPtr font;
+	SpeechPtr speech;
+
+	ImageInterPtr image;
+	SegmentInterPtr segment;
+	SeriesPtr series[AA_MAX_SERIES];
+
+	int series_id[AA_MAX_SERIES];
+};
+typedef AnimInter *AnimInterPtr;
+
+
+extern int anim_error;
+
+int anim_load_background(AnimFile *anim_in,
+	Buffer *this_orig,
+	Buffer *this_depth,
+	TileMapHeader *picture_map,
+	TileMapHeader *depth_map,
+	TileResource *picture_resource,
+	TileResource *depth_resource,
+	RoomPtr *room,
+	CycleListPtr cycle_list,
+	int load_flags, int star_search);
+
+
+void    anim_unload(AnimPtr anim);
+
+AnimPtr anim_load(const char *file_name,
+	Buffer *orig, Buffer *depth,
+	TileMapHeader *picture_map,
+	TileMapHeader *depth_map,
+	TileResource *picture_resource,
+	TileResource *depth_resource,
+	RoomPtr *room, CycleListPtr cycle_list,
+	int load_flags);
+
+int anim_get_sound_info(const char *file_name, char *sound_file_buffer,
+	int *sound_load_flag);
+
+int anim_get_header_info(char *file_name,
+	AnimFile *anim_in);
+
+
+int anim_himem_preload(char *name, int level);
+
+extern void init_anim();
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/core/attr.cpp b/engines/mads/core/attr.cpp
new file mode 100644
index 00000000000..11b5835a3de
--- /dev/null
+++ b/engines/mads/core/attr.cpp
@@ -0,0 +1,207 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/core/attr.h"
+#include "mads/core/buffer.h"
+#include "mads/core/loader.h"
+#include "mads/core/fileio.h"
+#include "mads/core/room.h"
+#include "mads/core/env.h"
+#include "mads/core/dialog.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+int attr_load_error = 0;
+
+int attr_walk(Buffer *attr, int x, int y) {
+	byte walk_code = 0;
+	byte *scan;
+	int shift_count;
+	int byte_number;
+
+	if (attr == NULL) goto done;
+	if (attr->data == NULL) goto done;
+
+	byte_number = (x >> 3);
+	shift_count = 7 - (x - (byte_number << 3));
+	scan = buffer_pointer(attr, byte_number, y);
+	walk_code = (byte)((*scan >> shift_count) & 1);
+
+done:
+	return (int)walk_code;
+}
+
+int rex_attr_depth(Buffer *depth, int x, int y) {
+	assert(depth);
+	if (x < 0 || y < 0 || (x / 2) >= depth->x || y >= depth->y)
+		return 0;
+
+	byte *scan = buffer_pointer(depth, (x >> 1), y);
+	int shift_count = (byte)((x & 1) ? 0 : 4);
+	int depth_code = (byte)((*scan >> shift_count) & 0x0f);
+
+	return depth_code;
+}
+
+int attr_depth(TileMapHeader *depth_map, int x, int y) {
+	byte depth_code = 0x0f;
+	byte *scan;
+	byte shift_count;
+	int  pan_to_x = 0, pan_to_y = 0;
+	int  view_changed = false;
+
+	if ((depth_map == NULL) || (depth_map->buffer == NULL)) goto done;
+
+	if (!(((x >= depth_map->pan_base_x) && (x < (depth_map->pan_base_x + depth_map->orig_x_size))) &&
+		((y >= depth_map->pan_base_y) && (y < (depth_map->pan_base_y + depth_map->orig_y_size))))) {
+		view_changed = true;
+		pan_to_x = depth_map->pan_x;
+		pan_to_y = depth_map->pan_y;
+		tile_pan(depth_map, x, y);
+	}
+
+	x = x - depth_map->pan_base_x;
+	y = y - depth_map->pan_base_y;
+
+	// WORKAROUND: Fixes crash in ROTP entering Box 5
+	if (x < 0 || y < 0 || (x >> 1) >= depth_map->buffer->x ||
+			y >= depth_map->buffer->y) {
+		depth_code = 0;
+	} else {
+		scan = buffer_pointer(depth_map->buffer, (x >> 1), y);
+		shift_count = (byte)((x & 1) ? 0 : 4);
+		depth_code = (byte)((*scan >> shift_count) & 0x0f);
+	}
+
+	if (view_changed) {
+		tile_pan(depth_map, pan_to_x, pan_to_y);
+	}
+
+done:
+	return (int)depth_code;
+}
+
+int attr_special(Buffer *attr, int x, int y) {
+	byte special_code = 0;
+	byte *scan;
+	int shift_count;
+	int byte_number;
+
+	if (attr == NULL) goto done;
+	if (attr->data == NULL) goto done;
+
+	byte_number = (x >> 3);
+	shift_count = 7 - (x - (byte_number << 3));
+	scan = buffer_pointer(attr, byte_number, y);
+	special_code = (byte)((*scan >> shift_count) & 1);
+
+done:
+	return (int)special_code;
+}
+
+int rex_attr_special(Buffer *special, int x, int y) {
+	assert(special);
+	if (x < 0 || y < 0 || (x / 2) >= special->x || y >= special->y)
+		return 0;
+
+	byte *scan = buffer_pointer(special, (x >> 1), y);
+	int shift_count = (byte)((x & 1) ? 0 : 4);
+	int special_code = (byte)((*scan >> shift_count) & 0x0f);
+
+	return special_code;
+}
+
+int attr_load(char *base_name,
+	int item_type,
+	int variant,
+	Buffer *target,
+	int size_x,
+	int size_y) {
+	int error_flag = true;
+	long read_size;
+	char temp_buf[80];
+	char block_name[20];
+	Load load_handle;
+
+	load_handle.open = false;
+	attr_load_error = 1;
+
+	size_x = ((size_x - 1) >> 3) + 1;
+
+	switch (item_type) {
+	case ROOM_WALK:
+		Common::strcpy_s(block_name, "$scrwalk");
+		break;
+	case ROOM_SPECIAL:
+	default:
+		Common::strcpy_s(block_name, "$scrspec");
+		break;
+	}
+
+	buffer_init_name(target, size_x, size_y, block_name);
+	if (target->data == NULL) goto done;
+
+	buffer_fill(*target, 0);
+
+	Common::strcpy_s(temp_buf, base_name);
+	if (item_type == ROOM_SPECIAL) {
+		fileio_add_ext(temp_buf, "PP");
+	} else {
+		fileio_add_ext(temp_buf, "WW");
+	}
+
+	env_catint(temp_buf, variant, 1);
+
+	if (!env_exist(temp_buf)) {
+		if (variant > 0) {
+			temp_buf[strlen(temp_buf) - 1] = '0';
+		}
+
+		if (!env_exist(temp_buf)) {
+			attr_load_error = 0;
+			goto done;
+		}
+	}
+
+	if (loader_open(&load_handle, temp_buf, "rb", false)) goto done;
+
+	read_size = (long)size_x * (long)size_y;
+
+	if (!loader_read(target->data, read_size, 1, &load_handle)) goto done;
+
+	error_flag = false;
+
+done:
+	if (load_handle.open) loader_close(&load_handle);
+	if (error_flag) {
+		if (target->data != NULL) buffer_free(target);
+	}
+
+	return error_flag;
+}
+
+void init_attr() {
+	attr_load_error = 0;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/attr.h b/engines/mads/core/attr.h
new file mode 100644
index 00000000000..b120c1e86bb
--- /dev/null
+++ b/engines/mads/core/attr.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_ATTR_H
+#define MADS_CORE_ATTR_H
+
+#include "mads/core/buffer.h"
+#include "mads/core/room.h"
+#include "mads/core/tile.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+#define ATTR_WALK_MASK         0x80
+#define ATTR_SPECIAL_MASK      0x70
+#define ATTR_DEPTH_MASK        0x0f
+
+#define ATTR_PACKED_ATTR_MASK  0x03
+#define ATTR_PACKED_WALK_MASK  0x02
+#define ATTR_PACKED_DEPTH_MASK 0x01
+
+extern int attr_walk(Buffer *attr, int x, int y);
+
+extern int rex_attr_depth(Buffer *depth, int x, int y);
+extern int attr_depth(TileMapHeader *depth_map, int x, int y);
+
+extern int attr_special(Buffer *attr, int x, int y);
+extern int rex_attr_special(Buffer *special, int x, int y);
+
+extern int attr_load(char *base_name, int item_type, int variant,
+	Buffer *target, int size_x, int size_y);
+
+extern int attr_load_error;
+
+extern void init_attr();
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/madsv2/core/btype.h b/engines/mads/core/btype.h
similarity index 100%
rename from engines/mads/madsv2/core/btype.h
rename to engines/mads/core/btype.h
diff --git a/engines/mads/core/buffer.cpp b/engines/mads/core/buffer.cpp
new file mode 100644
index 00000000000..0ee8f48dd56
--- /dev/null
+++ b/engines/mads/core/buffer.cpp
@@ -0,0 +1,964 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+#include "common/savefile.h"
+#include "common/util.h"
+#include "mads/core/general.h"
+#include "mads/core/buffer.h"
+#include "mads/core/env.h"
+#include "mads/core/ems.h"
+#include "mads/core/fileio.h"
+#include "mads/core/mem.h"
+#include "mads/core/room.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+word pattern_control_value = 0x181d;
+word pattern_initial_value = 0xb78e;
+int  auto_pattern = true;
+int buffer_restore_keep_flag = false;
+
+static word accum;                    // Pattern accumulator
+static Buffer buffer_preserve_conventional;
+
+char buffer_disk_filename[8] = "$MPOP.$";
+byte buffer_accum = 0;
+byte buffer_tracking[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+
+bool buffer_init(Buffer *buf, word x, word y) {
+	buf->data = (byte *)mem_get((long)x * y);
+	if (buf->data == NULL)
+		return false;
+
+	buf->x = x;
+	buf->y = y;
+	return true;
+}
+
+bool buffer_init_name(Buffer *buf, word x, word y, const char *block_name) {
+	buf->data = (byte *)mem_get_name((long)x * y, block_name);
+	if (buf->data == NULL)
+		return false;
+
+	buf->x = x;
+	buf->y = y;
+	return true;
+}
+
+bool buffer_free(Buffer *buf) {
+	bool flag = false;
+
+	if (buf->data != NULL) {
+		mem_free(buf->data);
+		flag = true;
+	}
+
+	buf->data = NULL;
+	buf->x = 0;
+	buf->y = 0;
+
+	return flag;
+}
+
+bool buffer_fill(Buffer &target, byte value) {
+	return buffer_rect_fill(target, 0, 0, target.x, target.y, value);
+}
+
+bool buffer_rect_copy(Buffer from, Buffer unto,
+	int ul_x, int ul_y, int size_x, int size_y) {
+	bool result;
+
+	result = ((from.data != NULL) && (unto.data != NULL));
+
+	if (result && size_x > 0 && size_y > 0) {
+		byte *from_ptr = buffer_pointer(&from, ul_x, ul_y);
+		byte *unto_ptr = buffer_pointer(&unto, ul_x, ul_y);
+		int   from_wrap = from.x - size_x;
+		int   unto_wrap = unto.x - size_x;
+
+		for (int row = 0; row < size_y; row++) {
+			memcpy(unto_ptr, from_ptr, size_x);
+			from_ptr += from_wrap + size_x;   // advance by full source stride
+			unto_ptr += unto_wrap + size_x;   // advance by full dest stride
+		}
+	}
+
+	return result;
+}
+
+bool buffer_rect_fill(Buffer &target, int ul_x, int  ul_y, int  size_x, int  size_y, byte value) {
+	bool result;
+
+	if (buffer_conform(&target, &ul_x, &ul_y, &size_x, &size_y))
+		return false;
+
+	result = (target.data != NULL);
+
+	if (result && size_x > 0 && size_y > 0) {
+		byte *target_ptr = buffer_pointer(&target, ul_x, ul_y);
+		int   target_wrap = target.x - size_x;
+
+		for (int row = 0; row < size_y; row++) {
+			memset(target_ptr, value, size_x);
+			target_ptr += target_wrap + size_x;
+		}
+	}
+
+	return result;
+}
+
+bool buffer_rect_copy_2(const Buffer &from, Buffer &unto,
+		int from_x, int from_y, int unto_x, int unto_y, int size_x, int size_y) {
+	bool result;
+
+	result = ((from.data != NULL) && (unto.data != NULL));
+
+	if (result && size_x > 0 && size_y > 0)
+	{
+		const byte *from_ptr = buffer_pointer(&from, from_x, from_y);
+		byte *unto_ptr = buffer_pointer(&unto, unto_x, unto_y);
+		int   from_wrap = from.x - size_x;
+		int   unto_wrap = unto.x - size_x;
+
+		for (int row = 0; row < size_y; row++)
+		{
+			memcpy(unto_ptr, from_ptr, size_x);
+			from_ptr += from_wrap + size_x;
+			unto_ptr += unto_wrap + size_x;
+		}
+	}
+
+	return result;
+}
+
+void buffer_put_pixel(Buffer &buf, word x, word y, byte c) {
+	buf.data[y * buf.x + x] = c;
+}
+
+byte buffer_get_pixel(const Buffer &buf, word x, word y) {
+	return buf.data[y * buf.x + x];
+}
+
+void buffer_hline(Buffer &buf, word x1, word x2, word y, byte color) {
+	byte *ptr = buf.data + (y * buf.x) + x1;
+	int   count = x2 - x1 + 1;
+
+	memset(ptr, color, count);
+}
+
+void buffer_vline(Buffer &buf, word x, word y1, word y2, byte color) {
+	byte *ptr = buf.data + (y1 * buf.x) + x;
+	int   count = y2 - y1 + 1;
+
+	for (int i = 0; i < count; i++, ptr += buf.x)
+		*ptr = color;
+}
+
+void buffer_draw_box(Buffer &buf, word x1, word y1, word x2, word y2, byte color) {
+	int tmp;
+
+	if (x1 > x2) {
+		tmp = x1; x1 = x2; x2 = tmp;
+	}
+	if (y1 > y2) {
+		tmp = y1; y1 = y2; y2 = tmp;
+	}
+
+	buffer_hline(buf, x1, x2, y1, color); buffer_hline(buf, x1, x2, y2, color);
+	buffer_vline(buf, x1, y1, y2, color); buffer_vline(buf, x2, y1, y2, color);
+}
+
+void buffer_hline_xor(Buffer &buf, int x1, int x2, int y) {
+	if (x1 > x2)
+	{
+		int tmp = x1;
+		x1 = x2;
+		x2 = tmp;
+	}
+
+	int   len = x2 - x1 + 1;
+	byte *ptr = buf.data + y * buf.x + x1;
+
+	for (int i = 0; i < len; i++)
+		ptr[i] ^= 0xFF;
+}
+
+void buffer_vline_xor(Buffer &buf, int x, int y1, int y2) {
+	if (y1 > y2)
+	{
+		int tmp = y1;
+		y1 = y2;
+		y2 = tmp;
+	}
+
+	int   len = y2 - y1 + 1;
+	byte *ptr = buf.data + y1 * buf.x + x;
+
+	for (int i = 0; i < len; i++, ptr += buf.x)
+		*ptr ^= 0xFF;
+}
+
+void buffer_draw_crosshair(Buffer &buf, int x, int y) {
+	buffer_hline_xor(buf, 0, buf.x - 1, y);
+	buffer_vline_xor(buf, x, 0, buf.y - 1);
+}
+
+void buffer_draw_box_xor(Buffer &buf, int x1, int y1, int x2, int y2) {
+	int tmp;
+
+	if (x1 > x2) {
+		tmp = x1; x1 = x2; x2 = tmp;
+	}
+	if (y1 > y2) {
+		tmp = y1; y1 = y2; y2 = tmp;
+	}
+
+	buffer_hline_xor(buf, x1, x2, y1);
+	buffer_hline_xor(buf, x1, x2, y2);
+	buffer_vline_xor(buf, x1, y1 + 1, y2 - 1);
+	buffer_vline_xor(buf, x2, y1 + 1, y2 - 1);
+}
+
+int buffer_get_delta_bounds(Buffer &buf1, Buffer buf2, int newcol,
+	word *xl, word *xh, word *yl, word *yh) {
+	if (buf1.x != buf2.x || buf1.y != buf2.y)
+		return -1;
+
+	word xxl = buf1.x, xxh = 0;
+	word yyl = buf1.y, yyh = 0;
+
+	byte *p1 = buf1.data;
+	byte *p2 = buf2.data;
+
+	for (word runy = 0; runy < buf1.y; runy++) {
+		for (word runx = 0; runx < buf1.x; runx++, p1++, p2++) {
+			if (*p1 != *p2) {
+				if (newcol == 0)
+					*p1 = 0;
+
+				if (runx > xxh) xxh = runx;
+				if (runx < xxl) xxl = runx;
+				if (runy > yyh) yyh = runy;
+				if (runy < yyl) yyl = runy;
+			}
+		}
+	}
+
+	*xl = xxl;
+	*xh = xxh;
+	*yl = yyl;
+	*yh = yyh;
+
+	return 0;
+}
+
+byte *buffer_pointer(Buffer *buf, int x, int y) {
+	return buf->data + y * buf->x + x;
+}
+const byte *buffer_pointer(const Buffer *buf, int x, int y) {
+	return buf->data + y * buf->x + x;
+}
+
+bool buffer_conform(Buffer *buffer, int *x, int *y, int *xs, int *ys) {
+	if (*x < 0) {
+		*xs += *x;
+		*x = 0;
+	}
+	if (*y < 0) {
+		*ys += *y;
+		*y = 0;
+	}
+
+	int temp_x = MIN(*x + *xs - 1, buffer->x - 1);
+	int temp_y = MIN(*y + *ys - 1, buffer->y - 1);
+
+	*xs = (temp_x - *x) + 1;
+	*ys = (temp_y - *y) + 1;
+
+	return ((*xs <= 0) || (*ys <= 0));
+}
+
+int buffer_inter_merge_2(Buffer from, Buffer unto,
+	int from_x, int from_y,
+	int unto_x, int unto_y,
+	int size_x, int size_y) {
+	int result;
+
+	result = ((from.data != NULL) && (unto.data != NULL));
+
+	if (result && size_x > 0 && size_y > 0) {
+		byte *from_ptr = buffer_pointer(&from, from_x, from_y);
+		byte *unto_ptr = buffer_pointer(&unto, unto_x, unto_y);
+		int   from_wrap = from.x - size_x;
+		int   unto_wrap = unto.x - size_x;
+
+		for (int row = 0; row < size_y; row++) {
+			for (int col = 0; col < size_x; col++) {
+				byte dst = unto_ptr[col];
+				if (dst >= 8 && dst <= 15)
+					unto_ptr[col] = from_ptr[col];
+			}
+
+			from_ptr += from_wrap + size_x;
+			unto_ptr += unto_wrap + size_x;
+		}
+	}
+
+	return result;
+}
+
+void buffer_line(Buffer target, int x1, int y1, int x2, int y2, int color) {
+	int delta_x = abs(x2 - x1);
+	int delta_y = abs(y2 - y1);
+	int x_inc = (x2 >= x1) ? 1 : -1;
+	int y_inc = (y2 >= y1) ? target.x : -target.x;
+
+	byte *ptr = target.data + y1 * target.x + x1;
+
+	int x_count = delta_x + 1;
+	int y_count = delta_y + 1;
+
+	int lineAccum = (delta_x >= delta_y) ? delta_y : delta_x;
+
+	for (int col = 0; col < x_count; col++)
+	{
+		lineAccum += y_count;
+		*ptr = (byte)color;
+
+		while (lineAccum >= x_count)
+		{
+			lineAccum -= x_count;
+			*ptr = (byte)color;
+			ptr += y_inc;
+		}
+
+		ptr += x_inc;
+	}
+}
+
+void buffer_line_xor(Buffer target, int x1, int y1, int x2, int y2) {
+	int delta_x = abs(x2 - x1);
+	int delta_y = abs(y2 - y1);
+	int x_inc = (x2 >= x1) ? 1 : -1;
+	int y_inc = (y2 >= y1) ? target.x : -target.x;
+
+	byte *ptr = target.data + y1 * target.x + x1;
+
+	int x_count = delta_x + 1;
+	int y_count = delta_y + 1;
+
+	int lineAccum = (delta_x >= delta_y) ? delta_y : delta_x;
+
+	for (int col = 0; col < x_count; col++) {
+		lineAccum += y_count;
+		bool written = false;
+		*ptr ^= 0xFF;
+
+		while (lineAccum >= x_count) {
+			lineAccum -= x_count;
+			if (!written) {
+				*ptr ^= 0xFF;
+				written = true;
+			}
+			ptr += y_inc;
+		}
+
+		ptr += x_inc;
+	}
+}
+
+int buffer_legal(const Buffer &walk, int orig_wrap,
+	int x1, int y1, int x2, int y2) {
+	word legality = LEGAL;
+	word currently_illegal = false;
+
+	if (walk.data == NULL)
+		return legality;
+	if (x1 < 0 || x2 < 0 || y1 < 0 || y2 < 0)
+		return legality;
+	if (x1 >= orig_wrap || x2 >= orig_wrap)
+		return legality;
+	if (y1 >= walk.y || y2 >= walk.y)
+		return legality;
+
+	int delta_y = y2 - y1;
+	int y_sign = walk.x;
+	if (delta_y < 0) {
+		delta_y = -delta_y; y_sign = -y_sign;
+	}
+
+	int delta_x = x2 - x1;
+	int x_sign = 1;
+	int dAccum = 0;
+
+	if (delta_x < 0) {
+		delta_x = -delta_x;
+		x_sign = -1;
+		dAccum = MIN(delta_x, delta_y);
+	}
+
+	int x_count = delta_x + 1;
+	int y_count = delta_y + 1;
+
+	byte *ptr = walk.data + y1 * walk.x + (x1 / 8);
+	uint bit_pos = 8 - (x1 % 8);
+
+	for (int col = x_count; col > 0; col--) {
+		dAccum += y_count;
+
+		bool blocked = ((*ptr >> (bit_pos - 1)) & 1) != 0;
+
+		if (blocked) {
+			if (!currently_illegal) {
+				currently_illegal = true;
+				legality -= ILLEGAL;
+				if (legality == 0) return legality;
+			}
+		} else {
+			currently_illegal = false;
+		}
+
+		while (dAccum >= x_count) {
+			dAccum -= x_count;
+			blocked = ((*ptr >> (bit_pos - 1)) & 1) != 0;
+			if (blocked) {
+				if (!currently_illegal) {
+					currently_illegal = true;
+					legality -= ILLEGAL;
+					if (legality == 0) return legality;
+				}
+			} else {
+				currently_illegal = false;
+			}
+
+			ptr += y_sign;
+		}
+
+		// Advance one pixel in X
+		uint new_cl = ((bit_pos - x_sign - 1) & 7) + 1;
+		if ((bit_pos - x_sign - 1) & ~7)
+			// ie. bit_pos < 0 or > 7
+			ptr += x_sign;
+		bit_pos = new_cl;
+	}
+
+	return legality;
+}
+
+/**
+ * Advance the pattern accumulator one step.
+ */
+static void pattern_math() {
+	word bx = accum;
+	accum += pattern_control_value;
+	bx = (bx >> 9) | (bx << 7);  // ror 9
+	accum ^= bx;
+	bx = (bx >> 3) | (bx << 13);  // ror 3
+	accum += bx;
+}
+
+static void scale_coord(int *coord, int *size, int boundary, int less_than) {
+	int condition;
+	int difference;
+
+	if (less_than) {
+		difference = boundary - *coord;
+		condition = *coord < boundary;
+	} else {
+		condition = *coord > (boundary - 1);
+		difference = *coord - (boundary - 1);
+	}
+
+	if (condition) {
+		*size = MAX(0, *size - difference);
+		if (less_than)
+			*coord += difference;
+		else
+			*coord -= difference;
+	}
+}
+
+word buffer_rect_fill_pattern(Buffer target, int ul_x, int ul_y, int size_x, int size_y,
+		int base_x, int base_y, int base_xs, byte value1, byte value2,
+		word start_accum, word note_line) {
+	int result;
+	int target_wrap;
+	int x2, base_x2;
+	int y2;
+	int base_ys = 0;
+	int line_wrap;
+	word noted_accum = 0;
+	word line_count = 0;
+
+	x2 = ul_x + size_x - 1;
+	y2 = ul_y + size_y - 1;
+
+	scale_coord(&ul_x, &size_x, 0, true);
+	scale_coord(&x2, &size_x, target.x, false);
+	scale_coord(&ul_y, &size_y, 0, true);
+	scale_coord(&y2, &size_y, target.y, false);
+
+	x2 = base_x + base_xs - 1;
+	y2 = base_y + base_ys;
+
+	scale_coord(&base_x, &base_xs, 0, true);
+	scale_coord(&x2, &base_xs, target.x, false);
+	scale_coord(&base_y, &base_ys, 0, true);
+	scale_coord(&y2, &base_ys, target.y, false);
+
+	if (!size_x || !size_y || !base_xs)
+		goto done;
+
+	if (auto_pattern) {
+		pattern_control_value = 0x181d;
+		pattern_initial_value = 0xb78e;
+
+		if (((base_xs >= 71) && (base_xs <= 73)) ||
+			((base_xs >= 83) && (base_xs <= 87)) ||
+			((base_xs >= 107) && (base_xs <= 110)) ||
+			((base_xs >= 139) && (base_xs <= 148)) ||
+			((base_xs >= 171) && (base_xs <= 173)) ||
+			((base_xs >= 212) && (base_xs <= 220)) ||
+			(base_xs == 268)) {
+			pattern_control_value = 0x6164;
+			pattern_initial_value = 0xdd00;
+		}
+
+		if (((base_xs >= 105) && (base_xs <= 106)) ||
+			((base_xs >= 120) && (base_xs <= 124))) {
+			pattern_control_value = 0x5124;
+			pattern_initial_value = 0xe1e4;
+		}
+
+		if (((base_xs >= 207) && (base_xs <= 211)) ||
+			(base_xs == 184)) {
+			pattern_control_value = 0x90d6;
+			pattern_initial_value = 0x89e0;
+		}
+
+		if (((base_xs >= 256) && (base_xs <= 260)) ||
+			((base_xs >= 280) && (base_xs <= 291)) ||
+			(base_xs == 161)) {
+			pattern_control_value = 0x6d90;
+			pattern_initial_value = 0xecd7;
+		}
+	}
+
+	target_wrap = target.x - size_x;
+	result = (target.data != NULL);
+
+	if (result) {
+		accum = pattern_initial_value;
+
+		// Wind the accumulator forward to account for rows above ul_y
+		for (int row = 0; row < (ul_y - base_y); row++)
+			for (int col = 0; col < base_xs; col++)
+				pattern_math();
+
+		// Wind the accumulator forward to account for columns left of ul_x
+		for (int col = 0; col < (ul_x - base_x); col++)
+			pattern_math();
+
+		x2 = ul_x + size_x - 1;
+		base_x2 = base_x + base_xs - 1;
+
+		line_wrap = (base_x2 - x2) + (ul_x - base_x);
+
+		if (start_accum)
+			accum = start_accum;
+
+		byte *target_ptr = buffer_pointer(&target, ul_x, ul_y);
+
+		for (int row = 0; row < size_y; row++)
+		{
+			if (line_count == note_line)
+				noted_accum = accum;
+
+			line_count++;
+
+			for (int col = 0; col < size_x; col++)
+			{
+				pattern_math();
+				*target_ptr++ = (accum & 16) ? value2 : value1;
+			}
+
+			target_ptr += target_wrap;
+
+			// Wind accumulator past the columns not being drawn
+			for (int col = 0; col < line_wrap; col++)
+				pattern_math();
+		}
+	}
+
+done:
+	return noted_accum;
+}
+
+bool buffer_rect_fill_swap(Buffer target,
+	int  ul_x, int  ul_y,
+	int  size_x, int size_y,
+	byte value1, byte value2) {
+	bool result = (target.data != NULL);
+
+	if (result && size_x > 0 && size_y > 0) {
+		byte *target_ptr = buffer_pointer(&target, ul_x, ul_y);
+		int   target_wrap = target.x - size_x;
+
+		for (int row = 0; row < size_y; row++)
+		{
+			for (int col = 0; col < size_x; col++)
+			{
+				if (target_ptr[col] == value1)
+					target_ptr[col] = value2;
+			}
+			target_ptr += target_wrap + size_x;
+		}
+	}
+
+	return result;
+}
+
+void buffer_peel_horiz(Buffer *target, int peel) {
+	if (!peel) return;
+
+	int peel_sign = (peel > 0) ? 1 : -1;
+	int peel_val = abs(peel);
+
+	if (peel_val > MAX_PEEL_VALUE) return;
+
+	byte  temp_buf[MAX_PEEL_VALUE];
+	byte *scan = target->data;
+	int   x = target->x;
+	int   y = target->y;
+
+	for (int row = 0; row < y; row++)
+	{
+		if (peel_sign > 0) {
+			// Save the first peel_val bytes, shift row left, append saved bytes at end
+			memcpy(temp_buf, scan, peel_val);
+			memmove(scan, scan + peel_val, x - peel_val);
+			memcpy(scan + x - peel_val, temp_buf, peel_val);
+		} else {
+			// Save the last peel_val bytes, shift row right, prepend saved bytes at start
+			memcpy(temp_buf, scan + x - peel_val, peel_val);
+			memmove(scan + peel_val, scan, x - peel_val);
+			memcpy(scan, temp_buf, peel_val);
+		}
+
+		scan += x;
+	}
+}
+
+void buffer_peel_vert(Buffer *target, int peel, byte *work_memory, long work_size) {
+	if (!peel)
+		return;
+
+	byte *scan = target->data;
+	int x = target->x;
+	int y = target->y;
+
+	int peel_sign = (peel > 0) ? 1 : -1;
+	int peel_val = abs(peel);
+	int peel_memory = peel_val * x;
+
+	byte *work_area = NULL;
+
+	if (work_memory == NULL) {
+		work_area = (byte *)mem_get_name(peel_memory, "$PEEL");
+		if (work_area == NULL) return;
+	} else {
+		work_area = work_memory;
+		if ((long)peel_memory > work_size) return;
+	}
+
+	if (peel_sign > 0) {
+		// Positive peel: rotate buffer upward by peel_val rows.
+		// Save the bottom peel_val rows, shift everything down,
+		// then place the saved rows at the top.
+		byte *deep_scan = buffer_pointer(target, 0, (y - 1) - (peel_val - 1));
+
+		memcpy(work_area, deep_scan, peel_memory);
+
+		for (int count = 0; count < (y - peel_val); count++)
+		{
+			byte *from = buffer_pointer(target, 0, (y - 1) - (count + peel_val));
+			byte *unto = from + peel_memory;
+			memcpy(unto, from, x);
+		}
+
+		memcpy(scan, work_area, peel_memory);
+	} else {
+		// Negative peel: rotate buffer downward by peel_val rows.
+		// Save the top peel_val rows, shift everything up,
+		// then place the saved rows at the bottom.
+		byte *deep_scan = buffer_pointer(target, 0, (y - 1) - (peel_val - 1));
+
+		memcpy(work_area, scan, peel_memory);
+
+		byte *unto = scan;
+		byte *from = scan + peel_memory;
+
+		for (int count = 0; count < (y - peel_val); count++) {
+			memcpy(unto, from, x);
+			unto += x;
+			from += x;
+		}
+
+		memcpy(deep_scan, work_area, peel_memory);
+	}
+
+	if (work_area != NULL && work_memory == NULL)
+		mem_free(work_area);
+}
+
+int buffer_preserve(Buffer *source, int flags, int source_ems_handle, int x, int y, int xs, int ys) {
+	int preserve_handle = BUFFER_NOT_PRESERVED;
+	int disk_number;
+
+	if (buffer_conform(source, &x, &y, &xs, &ys)) {
+		goto done;
+	}
+
+	// Try to preserve in conventional memory, if requested
+	if (flags == BUFFER_ATTEMPT_CONVENTIONAL) {
+		buffer_init_name(&buffer_preserve_conventional, xs, ys, "$preserv");
+		if (buffer_preserve_conventional.data != NULL) {
+			buffer_rect_copy_2(*source, buffer_preserve_conventional,
+				x, y, 0, 0, xs, ys);
+			preserve_handle = BUFFER_PRESERVED_CONVENTIONAL;
+			goto done;
+		}
+	}
+
+	// Try to preserve in EMS memory
+	preserve_handle = buffer_to_ems(source, flags, source_ems_handle, x, y, xs, ys);
+	if (preserve_handle >= 0) {
+		goto done;
+	}
+
+	// Try to preserve on disk
+	if (flags != BUFFER_PRESERVE_RAM) {
+		disk_number = buffer_to_disk(source, x, y, xs, ys);
+		if (disk_number >= 0) {
+			preserve_handle = BUFFER_PRESERVED_DISK - disk_number;
+			goto done;
+		}
+	}
+
+	preserve_handle = BUFFER_NOT_PRESERVED;
+
+done:
+	return preserve_handle;
+}
+
+void buffer_restore(Buffer *source, int preserve_handle, int target_ems_handle, int x, int y, int xs, int ys) {
+	if (buffer_conform(source, &x, &y, &xs, &ys)) {
+		goto done;
+	}
+
+	switch (preserve_handle) {
+	case BUFFER_PRESERVED_CONVENTIONAL:
+		buffer_rect_copy_2(buffer_preserve_conventional, *source,
+			0, 0, x, y, xs, ys);
+		if (!buffer_restore_keep_flag)
+			buffer_free(&buffer_preserve_conventional);
+		break;
+
+	case BUFFER_PRESERVED_DISK:
+	case BUFFER_PRESERVED_DISK - 1:
+	case BUFFER_PRESERVED_DISK - 2:
+	case BUFFER_PRESERVED_DISK - 3:
+	case BUFFER_PRESERVED_DISK - 4:
+	case BUFFER_PRESERVED_DISK - 5:
+	case BUFFER_PRESERVED_DISK - 6:
+	case BUFFER_PRESERVED_DISK - 7:
+	case BUFFER_PRESERVED_DISK - 8:
+	case BUFFER_PRESERVED_DISK - 9:
+		buffer_from_disk(source, neg(preserve_handle - BUFFER_PRESERVED_DISK), x, y, xs, ys);
+		break;
+
+	case BUFFER_NOT_PRESERVED:
+		break;
+
+	default:
+		if (buffer_restore_keep_flag) preserve_handle &= ~BUFFER_CREATED_PAGE_HANDLE;
+		buffer_from_ems(source, preserve_handle, target_ems_handle, x, y, xs, ys);
+		break;
+	}
+
+done:
+	;
+}
+
+bool buffer_to_ems(Buffer *source, int page_handle, int source_ems_handle,
+		int x, int y, int xs, int ys) {
+	int special_page_handle = 0;
+	Buffer ems_buffer = { video_y, video_x, NULL };
+
+	if (page_handle < 0) {
+		page_handle = ems_get_page_handle(4);
+		special_page_handle = BUFFER_CREATED_PAGE_HANDLE;
+	}
+	if (page_handle < 0) {
+		goto done;
+	}
+
+	if (source_ems_handle < 0) {
+		ems_map_buffer(page_handle);
+		ems_buffer.data = ems_page[0];
+
+		buffer_rect_copy_2(*source, ems_buffer, x, y, x, y, xs, ys);
+	} else {
+		ems_buffer_to_buffer(source_ems_handle, page_handle);
+	}
+
+	page_handle |= special_page_handle;
+
+	ems_unmap_all();
+
+done:
+	return page_handle;
+}
+
+bool buffer_from_ems(Buffer *source, int page_handle, int target_ems_handle,
+		int x, int y, int xs, int ys) {
+	Buffer ems_buffer = { video_y, video_x, NULL };
+	int special_page_handle;
+
+	special_page_handle = page_handle & BUFFER_CREATED_PAGE_HANDLE;
+
+	page_handle &= ~(BUFFER_CREATED_PAGE_HANDLE);
+
+	if (target_ems_handle < 0) {
+		ems_map_buffer(page_handle);
+		ems_buffer.data = ems_page[0];
+
+		buffer_rect_copy_2(ems_buffer, *source, x, y, x, y, xs, ys);
+	} else {
+		ems_buffer_to_buffer(page_handle, target_ems_handle);
+	}
+
+	if (special_page_handle) ems_free_page_handle(page_handle);
+
+	ems_unmap_all();
+
+	return page_handle;
+}
+
+bool buffer_rect_translate(Buffer from, Buffer unto, int from_x, int from_y,
+		int unto_x, int unto_y, int size_x, int size_y, byte *table) {
+	int from_wrap, unto_wrap;
+	int row_count;
+	int result;
+	byte *from_ptr;
+	byte *unto_ptr;
+
+	from_wrap = from.x - size_x;
+	unto_wrap = unto.x - size_x;
+
+	result = ((from.data != NULL) && (unto.data != NULL));
+	if (result) {
+		if (size_y == 0 || size_x == 0)
+			return result;
+
+		from_ptr = buffer_pointer(&from, from_x, from_y);
+		unto_ptr = buffer_pointer(&unto, unto_x, unto_y);
+
+		for (row_count = size_y; row_count > 0; row_count--) {
+			for (int col = 0; col < size_x; col++) {
+				*unto_ptr++ = table[*from_ptr++];
+			}
+			from_ptr += from_wrap;
+			unto_ptr += unto_wrap;
+		}
+	}
+
+	return result;
+}
+
+int buffer_to_disk(Buffer *source, int x, int y, int xs, int ys) {
+	int buffer_id = -1;
+	Common::OutSaveFile *handle = nullptr;
+	byte *scan;
+	int count;
+	int error_count = 0;
+	int a_ok = false;
+	char file_name[40];
+
+	do {
+		buffer_accum = (byte)((buffer_accum + 1) % 10);
+
+		Common::strcpy_s(file_name, buffer_disk_filename);
+		env_catint(file_name, buffer_accum, 1);
+
+		if (!buffer_tracking[buffer_accum]) {
+			a_ok = true;
+		} else {
+			error_count++;
+			if (error_count > 10) goto done;
+		}
+	} while (!a_ok);
+
+	buffer_tracking[buffer_accum] = true;
+
+	handle = g_system->getSavefileManager()->openForSaving(file_name, false);
+	if (handle == nullptr)
+		goto done;
+
+	for (count = 0; count < ys; count++) {
+		scan = buffer_pointer(source, x, y + count);
+		if (!fileio_fwrite_f(scan, xs, 1, handle)) goto done;
+	}
+
+	buffer_id = buffer_accum;
+
+done:
+	delete handle;
+	return buffer_id;
+}
+
+void buffer_from_disk(Buffer *source, int buffer_id, int x, int y, int xs, int ys) {
+	Common::InSaveFile *handle = nullptr;
+	byte *scan;
+	int count;
+	char file_name[40];
+
+	Common::strcpy_s(file_name, buffer_disk_filename);
+	env_catint(file_name, buffer_id, 1);
+
+	handle = g_system->getSavefileManager()->openForLoading(file_name);
+	if (handle == NULL) goto done;
+
+	for (count = 0; count < ys; count++) {
+		scan = buffer_pointer(source, x, y + count);
+		if (!fileio_fread_f(scan, xs, 1, handle)) goto done;
+	}
+
+done:
+	if (handle != NULL)
+		delete handle;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/buffer.h b/engines/mads/core/buffer.h
new file mode 100644
index 00000000000..21ec14e3705
--- /dev/null
+++ b/engines/mads/core/buffer.h
@@ -0,0 +1,270 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_BUFFER_H
+#define MADS_CORE_BUFFER_H
+
+#include "mads/core/general.h"
+#include "mads/core/font.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+#define MAX_PEEL_VALUE                  80
+
+#define BUFFER_CREATED_PAGE_HANDLE      16384   /* Mask if EMS page handle created on the fly */
+
+#define BUFFER_PRESERVE                 -1      /* Normal preserve attempt (EMS or disk) */
+#define BUFFER_PRESERVE_RAM             -2      /* Disallows disk preservation           */
+#define BUFFER_ATTEMPT_CONVENTIONAL     -8      /* Attempt conventional preserve         */
+
+#define BUFFER_PRESERVED_CONVENTIONAL   -1      /* Preserved in conventional memory */
+#define BUFFER_NOT_PRESERVED            -3      /* All attempts to preserve failed  */
+#define BUFFER_PRESERVED_DISK           -10     /* Preserved on disk                */
+
+
+extern int buffer_restore_keep_flag;
+extern word pattern_control_value;
+extern int  auto_pattern;
+
+
+/**
+ * Allocates space for a buffer, and fills in embedded data.
+ * Returns TRUE if successful.
+ */
+extern bool buffer_init(Buffer *buf, word x, word y);
+
+/**
+ * Allocates space for a buffer, and fills in embedded data.
+ * Returns TRUE if successful.
+ */
+extern bool buffer_init_name(Buffer *buf, word x, word y, const char *block_name);
+
+/**
+ * De-allocates the data associated with the buffer
+ * @param buf 
+ * @return	Returns true if successful.
+ */
+extern bool buffer_free(Buffer *buf);
+
+/**
+ * Fills an entire buffer with a single byte value.
+ * @return	Returns true if successful.
+ */
+extern bool buffer_fill(Buffer &target, byte value);
+
+/**
+ * Copies a "rectangular" buffer area from "from" to "unto".  Size
+ * of copied rectangle is determined by "size_x, size_y".  Upper left
+ * corner in BOTH buffers is indicated by "ul_x, ul_y".  (To copy
+ * using separate corner coordinates in each buffer, use
+ * buf_rect_copy_2 ().
+ *
+ *      * Handles "null" copies (e.g. one or both sizes are 0) correctly.
+ *      * Optimizes for word copies.
+ * @return	Returns TRUE if successful.
+ */
+extern bool buffer_rect_copy(Buffer from, Buffer unto,
+	int ul_x, int ul_y, int size_x, int size_y);
+
+/**
+ * Fills a "rectangular" buffer area with the specified byte value.
+ * Upper left corner is determined by "ul_x, ul_y", and sizes are
+ * determined by "size_x, size_y."  No range checking is performed,
+ * but "null" copies (x or y size 0) are handled correctly.
+ * @return	Returns TRUE if successful; false if buffer invalid.
+ */
+extern bool buffer_rect_fill(Buffer &target,
+	int ul_x, int ul_y, int size_x, int size_y, byte value);
+
+/**
+ * Copies a "rectangular" buffer area from "from" to "unto".  Size
+ * of copied rectangle is determined by "size_x, size_y".  Upper left
+ * corner in source buffer is indicated by "from_x, from_y", and
+ * "unto_x, unto_y" determines upper left corner in destination
+ * buffer (if upper left corner coordinates are the same in both
+ * buffers, buf_rect_copy() can be used instead).
+ *
+ * @return	Returns TRUE if successful.
+ */
+extern bool buffer_rect_copy_2(const Buffer &from, Buffer &unto,
+	int    from_x, int    from_y,
+	int    unto_x, int    unto_y,
+	int    size_x, int    size_y);
+
+/**
+ * Given X and Y, sets pixel to color C
+ */
+extern void buffer_put_pixel(Buffer &buf, word x, word y, byte c);
+
+/**
+ * Given X and Y, gets the pixel at that position.
+ */
+extern byte buffer_get_pixel(const Buffer &buf, word x, word y);
+
+/**
+ * Given starting and ending points on the X axis, and the constant
+ * Y value, draws a line in the given color on the live MCGA screen.
+ */
+extern void buffer_hline(Buffer &buf, word x1, word x2, word y, byte color);
+
+/**
+ * Given starting and ending points on the Y axis, and the constant
+ * X value, draws a line in the given color on the live MCGA screen.
+ */
+extern void buffer_vline(Buffer &buf, word x, word y1, word y2, byte color);
+
+/**
+ * Draws outside edge of retangle given home and size along both axis.
+ */
+extern void buffer_draw_box(Buffer &buf, word x1, word y1, word x2, word y2, byte color);
+
+/**
+ * Draws a horizontal line by xoring/inverting the existing pixels
+ */
+extern void buffer_hline_xor(Buffer &buf, int x1, int x2, int y);
+
+/**
+ * Draws a vertical line by xoring/inverting the existing pixels
+ */
+extern void buffer_vline_xor(Buffer &buf, int x, int y1, int y2);
+
+/**
+ * Draws a cross-hairs at the specified x, y
+ */
+extern void buffer_draw_crosshair(Buffer &buf, int x, int y);
+
+/**
+ * Draws a box using pixel xor inversion
+ */
+extern void buffer_draw_box_xor(Buffer &buf, int x1, int y1, int x2, int y2);
+
+/**
+ * Scans the two buffers.  Locations that are not the same on both buffers
+ * are changed (in buffer 1) to color <newcol>.  The outside bounds are returned
+ * in the words pointed to by *XL,*XH,*YL,*YH.
+ * @return	Returns -1 if an error occurs.
+ */
+extern bool buffer_get_delta_bounds(Buffer &buf1, Buffer buf2,
+	byte newcol, word *xl, word *xh, word *yl, word *yh);
+
+/**
+ * Returns a pointer to the pixels starting at a given X, Y position
+ * @param buf	Buffer
+ * @param x		x
+ * @param y		y
+ * @return		Pointer
+ */
+extern byte *buffer_pointer(Buffer *buf, int x, int y);
+extern const byte *buffer_pointer(const Buffer *buf, int x, int y);
+
+extern bool buffer_conform(Buffer *buffer, int *x, int *y,
+	int *xs, int *ys);
+
+/**
+ * Copies a "rectangular" buffer area from "from" to "unto".  Size
+ * of copied rectangle is determined by "size_x, size_y".  Upper left
+ * corner in source buffer is indicated by "from_x, from_y", and
+ * "unto_x, unto_y" determines upper left corner in destination
+ * buffer (if upper left corner coordinates are the same in both
+ * buffers, buf_rect_copy() can be used instead).
+ *
+ * Only copies on top of values 8-11 (the interface background colors)
+ *
+ * @return	Returns TRUE if successful.
+ */
+extern int buffer_inter_merge_2(Buffer from, Buffer unto,
+	int from_x, int from_y, int unto_x, int unto_y, int size_x, int size_y);
+
+/**
+ * This is a column-major Bresenham line drawing algorithm - it iterates along X
+ * as the outer loop and uses the accumulator to decide when to step in Y,
+ * which suits lines that are wider than they are tall.
+ */
+extern void buffer_line(Buffer target, int x1, int y1, int x2, int y2,
+	int color);
+
+/**
+ * This is a column-major Bresenham line drawing algorithm - it iterates along X
+ * as the outer loop and uses the accumulator to decide when to step in Y,
+ * which suits lines that are wider than they are tall. The only difference between
+ * it and buffer_line, is that this version uses an xor rather than storing a color.
+ */
+extern void buffer_line_xor(Buffer target, int x1, int y1, int x2, int y2);
+
+/**
+ * Traces a Bresenham line from (x1,y1) to (x2,y2) across a packed-bit walk
+ * buffer (8 walk-code bits per byte) and determines whether the path is
+ * legally walkable.  Each time the line enters a new contiguous run of blocked
+ * pixels the legality counter is decremented by ILLEGAL; if it reaches zero
+ * the function returns immediately with that value.  Paths that stay entirely
+ * clear, or whose legality counter never bottoms out, return LEGAL.  Basic
+ * bounds checking is performed first: a NULL buffer or any coordinate outside
+ * the buffer dimensions short-circuits to LEGAL without scanning.
+ */
+extern int buffer_legal(const Buffer &walk, int orig_wrap, int x1, int y1, int x2, int y2);
+
+extern word buffer_rect_fill_pattern(Buffer target, int ul_x, int ul_y, int size_x, int size_y,
+	int base_x, int base_y, int base_xs, byte value1, byte value2,
+	word start_accum, word note_line);
+
+/**
+ * Fills a "rectangular" buffer area with the specified byte value.
+ * Upper left corner is determined by "ul_x, ul_y", and sizes are
+ * determined by "size_x, size_y."  No range checking is performed,
+ * but "null" copies (x or y size 0) are handled correctly.
+ * @return	Returns TRUE if successful; false if buffer invalid.
+ */
+extern bool buffer_rect_fill_swap(Buffer target, int ul_x, int ul_y,
+	int size_x, int size_y, byte value1, byte value2);
+
+extern void buffer_peel_horiz(Buffer *target, int peel);
+
+extern void buffer_peel_vert(Buffer *target, int peel,
+	byte *work_memory, long work_size);
+
+extern int buffer_to_disk(Buffer *source, int x, int y, int xs, int ys);
+extern void buffer_from_disk(Buffer *source, int buffer_id, int x, int y, int xs, int ys);
+
+extern bool buffer_to_ems(Buffer *source, int page_handle,
+	int source_ems_handle, int x, int y, int xs, int ys);
+extern bool buffer_from_ems(Buffer *source, int page_handle,
+	int target_ems_handle, int x, int y, int xs, int ys);
+
+extern int buffer_preserve(Buffer *source, int flags,
+	int source_ems_handle, int x, int y, int xs, int ys);
+extern void buffer_restore(Buffer *source, int preserve_handle,
+	int target_ems_handle, int x, int y, int xs, int ys);
+
+extern bool buffer_rect_translate(Buffer from, Buffer unto,
+	int from_x, int from_y, int unto_x, int unto_y,
+	int size_x, int size_y, byte *table);
+
+extern bool buffer_scan(Buffer *buffer, int magic,
+	int base_x, int base_y, int size_x, int size_y);
+
+extern bool buffer_compare(Buffer *buffer0, Buffer *buffer1,
+	int base_x, int base_y, int base_x2, int base_y2, int size_x, int size_y);
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/core/camera.cpp b/engines/mads/core/camera.cpp
new file mode 100644
index 00000000000..ba9bc52e1c3
--- /dev/null
+++ b/engines/mads/core/camera.cpp
@@ -0,0 +1,221 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/core/camera.h"
+#include "mads/core/tile.h"
+#include "mads/core/matte.h"
+#include "mads/core/player.h"
+#include "mads/core/error.h"
+#include "mads/core/kernel.h"
+#include "mads/core/inter.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+
+Camera camera_x;        /* Horizontal panning camera */
+Camera camera_y;        /* Vertical panning camera   */
+
+int camera_old_x_target = 0;/* For saving/restoring game */
+int camera_old_y_target = 0;
+
+
+void camera_init_default() {
+	camera_x.panning = false;
+	camera_y.panning = false;
+
+	if (picture_map.one_to_one) {
+		camera_x.pans = false;
+		camera_y.pans = false;
+		goto done;
+	}
+
+	camera_x.pans = (picture_map.total_x_size > video_x);
+	camera_y.pans = (picture_map.total_y_size > display_y);
+
+	if (camera_x.pans) {
+		camera_x.pan_mode = CAMERA_PLAYER;
+		camera_x.pan_rate = 4;
+		camera_x.pan_velocity = CAMERA_DEFAULT_X_VELOCITY;
+		camera_x.pan_target = 0;
+		camera_x.pan_off_center = CAMERA_DEFAULT_X_OFF_CENTER;
+		camera_x.pan_on_tolerance = CAMERA_DEFAULT_X_START;
+		camera_x.pan_off_tolerance = CAMERA_DEFAULT_X_STOP;
+		camera_x.pan_clock = kernel.clock;
+	}
+
+	if (camera_y.pans) {
+		camera_y.pan_mode = CAMERA_MANUAL;
+		camera_y.pan_rate = 4;
+		camera_y.pan_velocity = CAMERA_DEFAULT_Y_VELOCITY;
+		camera_y.pan_target = 0;
+		camera_y.pan_off_center = CAMERA_DEFAULT_Y_OFF_CENTER;
+		camera_y.pan_on_tolerance = CAMERA_DEFAULT_Y_START;
+		camera_y.pan_off_tolerance = CAMERA_DEFAULT_Y_STOP;
+		camera_y.pan_clock = kernel.clock;
+	}
+
+done:
+	;
+}
+
+static int camera_pan(Camera *camera, int *picture_view, int *player_loc,
+		int display_size, int picture_size) {
+	int any_pan = false;
+	int loc;
+	int high_edge, low_edge;
+	int dif;
+	int direction;
+	int magnitude;
+	int pan_me = 0;
+	long determining_clock;
+
+	if (camera->pans) {
+		camera->pan_this_frame = false;
+
+		// Try to keep player & panning in synch
+		if ((abs(camera->pan_clock - player.clock) < camera->pan_rate) &&
+			(player.frame_delay == camera->pan_rate)) {
+			determining_clock = player.clock;
+		} else {
+			determining_clock = camera->pan_clock;
+		}
+
+		if (camera->panning && (kernel.clock < determining_clock)) goto done;
+
+		camera->pan_clock = kernel.clock + camera->pan_rate;
+
+		if (camera->pan_mode == CAMERA_MANUAL) {
+			if (camera->panning) {
+				dif = camera->pan_target - *picture_view;
+				direction = sgn(dif);
+				magnitude = abs(dif);
+
+				magnitude = MIN(magnitude, camera->pan_velocity);
+
+				if (magnitude == 0) {
+					camera->panning = false;
+				} else {
+					pan_me = sgn_in(magnitude, direction);
+					*picture_view += pan_me;
+
+					any_pan = true;
+					camera->pan_this_frame = true;
+				}
+			}
+		} else {
+			assert(player_loc);
+
+			if (!camera->panning) {
+				low_edge = *picture_view + camera->pan_on_tolerance;
+				high_edge = *picture_view - camera->pan_on_tolerance + display_size - 1;
+
+				if (*player_loc < low_edge) {
+					if (picture_view) {
+						camera->panning = true;
+						camera->pan_direction = -1;
+					}
+				}
+
+				if (*player_loc > high_edge) {
+					if (*picture_view < (picture_size - display_size)) {
+						camera->panning = true;
+						camera->pan_direction = 1;
+					}
+				}
+			}
+
+			loc = *player_loc - (display_size >> 1);
+
+			loc += sgn_in(camera->pan_off_center, camera->pan_direction);
+
+			loc = MAX(0, loc);
+			loc = MIN(loc, (picture_size - display_size));
+
+			camera->pan_target = loc;
+
+			dif = loc - *picture_view;
+			magnitude = abs(dif);
+			direction = sgn(dif);
+
+
+			if (camera->panning) {
+				if (magnitude <= camera->pan_off_tolerance) {
+					camera->panning = false;
+				}
+			}
+
+			if (camera->panning) {
+				magnitude = MIN(magnitude, camera->pan_velocity);
+				pan_me = sgn_in(magnitude, direction);
+
+				if (pan_me) {
+					*picture_view += pan_me;
+					any_pan = true;
+					camera->pan_this_frame = true;
+				}
+			}
+		}
+	}
+
+done:
+	return any_pan;
+}
+
+void camera_jump_to(int x, int y) {
+	picture_view_x = x;
+	picture_view_y = y;
+
+	tile_pan(&picture_map, picture_view_x, picture_view_y);
+	tile_pan(&depth_map, picture_view_x, picture_view_y);
+	matte_refresh_work();
+}
+
+void camera_pan_to(Camera *camera, int target) {
+	if (camera->pans) {
+		camera->panning = true;
+		camera->pan_mode = CAMERA_MANUAL;
+		camera->pan_target = target;
+		camera->pan_clock = kernel.clock;
+	}
+}
+
+void camera_update() {
+	int any_pan = false;
+
+	any_pan |= camera_pan(&camera_x, &picture_view_x, &player.x, video_x, picture_map.total_x_size);
+	any_pan |= camera_pan(&camera_y, &picture_view_y, &player.y, display_y, picture_map.total_y_size);
+
+	if (any_pan) {
+		camera_jump_to(picture_view_x, picture_view_y);
+		inter_force_rescan = true;
+	}
+}
+
+void init_camera() {
+	memset(&camera_x, 0, sizeof(Camera));
+	memset(&camera_y, 0, sizeof(Camera));
+	camera_old_x_target = 0;
+	camera_old_y_target = 0;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/camera.h b/engines/mads/core/camera.h
new file mode 100644
index 00000000000..c99eaa8b511
--- /dev/null
+++ b/engines/mads/core/camera.h
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_CAMERA_H
+#define MADS_CORE_CAMERA_H
+
+#include "mads/core/general.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+
+#define CAMERA_PLAYER           0               /* Camera follows player  */
+#define CAMERA_MANUAL           1               /* Camera manually panned */
+
+#define CAMERA_DEFAULT_X_VELOCITY       4       /* Camera defaults        */
+#define CAMERA_DEFAULT_X_START          80
+#define CAMERA_DEFAULT_X_STOP           4
+#define CAMERA_DEFAULT_X_OFF_CENTER     80
+
+#define CAMERA_DEFAULT_Y_VELOCITY       2
+#define CAMERA_DEFAULT_Y_START          60
+#define CAMERA_DEFAULT_Y_STOP           4
+#define CAMERA_DEFAULT_Y_OFF_CENTER     80
+
+
+struct Camera {
+	int pans;                     /* Flag if camera can pan in this room */
+	int panning;                  /* Flag if camera now panning          */
+	int pan_mode;                 /* Panning mode (CAMERA_PLAYER, etc.)  */
+	int pan_velocity;             /* Pixel velocity of pan               */
+	int pan_rate;                 /* Pan frame rate                      */
+	int pan_target;               /* Pan X or Y target for manual pans   */
+	int pan_off_center;           /* Pan distance off center             */
+	int pan_on_tolerance;         /* Pan initiator tolerance             */
+	int pan_off_tolerance;        /* Pan terminator tolerance            */
+	int pan_direction;            /* Pan initial direction               */
+	long pan_clock;               /* Pan clock for next update           */
+	int pan_this_frame;           /* Flag if panned this frame           */
+};
+
+
+extern Camera camera_x;        /* Horizontal panning camera */
+extern Camera camera_y;        /* Vertical panning camera   */
+
+extern int camera_old_x_target;/* For saving/restoring game */
+extern int camera_old_y_target;
+
+extern void camera_init_default();
+extern void camera_jump_to(int x, int y);
+extern void camera_pan_to(Camera *camera, int target);
+extern void camera_update();
+
+extern void init_camera();
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/core/color.cpp b/engines/mads/core/color.cpp
new file mode 100644
index 00000000000..4dc14557a2a
--- /dev/null
+++ b/engines/mads/core/color.cpp
@@ -0,0 +1,624 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/memstream.h"
+#include "mads/core/color.h"
+#include "mads/core/screen.h"
+#include "mads/core/sort.h"
+#include "mads/core/mem.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+void Color::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(r, g, b, x16, cycle, group);
+}
+
+//====================================================================
+
+void ColorList::load(Common::SeekableReadStream *src) {
+	num_colors = src->readUint16LE();
+
+	for (int i = 0; i < COLOR_MAX_USER_COLORS; ++i)
+		table[i].load(src);
+}
+
+//====================================================================
+
+void Cycle::synchronize(Common::Serializer &s) {
+	s.syncMultipleLE(num_colors, first_list_color, first_palette_color, ticks);
+}
+
+//====================================================================
+
+void CycleList::synchronize(Common::Serializer &s) {
+	s.syncAsUint16LE(num_cycles);
+
+	for (int i = 0; i < COLOR_MAX_CYCLES; ++i)
+		table[i].synchronize(s);
+}
+
+//====================================================================
+
+void ShadowList::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(num_shadow_colors);
+	for (int i = 0; i < COLOR_MAX_SHADOW_COLORS; ++i)
+		shadow_color[i] = src->readSint16LE();
+}
+
+//====================================================================
+
+byte color_thatch(int color, int thatching) {
+	byte thatch;
+
+	if (color == 16) {
+		thatch = COLOR_NO_X16;
+	} else if (color == thatching) {
+		thatch = (byte)color;
+	} else {
+		if (thatching == 0) {
+			thatch = (byte)(((COLOR_BLACK_THATCH) << 4) + color);
+		} else {
+			thatch = (byte)((thatching << 4) + color);
+		}
+	}
+
+	return thatch;
+}
+
+void color_list_start_scan(byte *list_flags) {
+	int count;
+
+	for (count = 0; count < COLOR_MAX_USER_COLORS; count++) {
+		list_flags[count] = false;
+	}
+}
+
+int color_list_update(ColorListPtr list, Buffer *scan_buf, Palette *scan_pal, byte *list_flags, byte *palette_map, CycleListPtr cycle) {
+	int count;
+	int row, col;
+	int found;
+	int result;
+	int hi, lo;
+	int num;
+	int cycle_color;
+	int cycle_count;
+	byte color_flags[256];
+	byte *scan;
+	byte color;
+	byte r, g, b;
+	word cycle_value;
+	word value[256];
+	byte reverse_map[256];
+	ColorList temp_list;
+
+	result = 0;
+
+	for (count = 0; count <= COLOR_HIGHEST; count++) {
+		color_flags[count] = (byte)false;
+	}
+
+	for (count = COLOR_HIGHEST + 1; count < 256; count++) {
+		color_flags[count] = (byte)true;
+	}
+
+	// First, deal with any colors involved in cycling
+	if (cycle != NULL) {
+		for (cycle_count = 0; cycle_count < cycle->num_cycles; cycle_count++) {
+			lo = cycle->table[cycle_count].first_palette_color;
+			num = cycle->table[cycle_count].num_colors;
+			hi = lo + num - 1;
+			for (cycle_color = lo; cycle_color <= hi; cycle_color++) {
+				if (!color_flags[cycle_color]) {
+					color_flags[cycle_color] = true;
+					r = (*scan_pal)[cycle_color].r;
+					g = (*scan_pal)[cycle_color].g;
+					b = (*scan_pal)[cycle_color].b;
+					found = false;
+					
+					if (!found) {
+						if (list->num_colors < COLOR_MAX_USER_COLORS) {
+							count = list->num_colors;
+							list->table[count].r = r;
+							list->table[count].g = g;
+							list->table[count].b = b;
+							list->table[count].x16 = (byte)COLOR_NO_X16;
+							list->table[count].cycle = (byte)(cycle_count + 1);
+							list->table[count].group = 0;
+							list_flags[count] = true;
+							if (palette_map != NULL) {
+								palette_map[cycle_color] = (byte)count;
+							}
+							reverse_map[count] = (byte)cycle_color;
+							list->num_colors++;
+						} else {
+							result = COLOR_ERR_LISTOVERFLOW;
+						}
+					}
+				}
+			}
+		}
+	}
+
+	// Now deal with any other colors used in the picture
+	scan = (byte *)mem_normalize(scan_buf->data);
+
+	for (row = 0; row < scan_buf->y; row++) {
+		for (col = 0; col < scan_buf->x; col++) {
+			color = *scan;
+			if (!color_flags[color]) {
+				r = (*scan_pal)[color].r;
+				g = (*scan_pal)[color].g;
+				b = (*scan_pal)[color].b;
+				found = false;
+				for (count = 0; (count < list->num_colors) && (!found); count++) {
+					if ((r == list->table[count].r) &&
+						(g == list->table[count].g) &&
+						(b == list->table[count].b) &&
+						(list->table[count].cycle == 0)) {
+						found = true;
+						list_flags[count] = true;
+						if (palette_map != NULL) {
+							palette_map[color] = (byte)count;
+						}
+						reverse_map[count] = color;
+					}
+				}
+				if (!found) {
+					if (list->num_colors < COLOR_MAX_USER_COLORS) {
+						count = list->num_colors;
+						list->table[count].r = r;
+						list->table[count].g = g;
+						list->table[count].b = b;
+						list->table[count].x16 = (byte)COLOR_NO_X16;
+						list->table[count].cycle = 0;
+						list->table[count].group = 0;
+						list_flags[count] = true;
+						if (palette_map != NULL) {
+							palette_map[color] = (byte)count;
+						}
+						reverse_map[count] = color;
+						list->num_colors++;
+					} else {
+						result = COLOR_ERR_LISTOVERFLOW;
+					}
+				}
+				color_flags[color] = (byte)true;
+			}
+			scan++;
+		}
+		scan = (byte *)mem_check_overflow(scan);
+	}
+
+	// Sort color list so that cycle colors appear first
+	// The various tables must also be corrected.
+	if (cycle != NULL) {
+		for (count = 0; count < list->num_colors; count++) {
+			cycle_value = list->table[count].cycle;
+			if ((cycle_value == 0) || (!list_flags[count])) cycle_value = 100;
+			value[count] = (cycle_value << 8) + reverse_map[count];
+			color_flags[count] = (byte)count;
+		}
+		sort_insertion_16(list->num_colors, color_flags, value);
+		temp_list.num_colors = list->num_colors;
+		for (count = 0; count < list->num_colors; count++) {
+			memcpy(&temp_list.table[count], &list->table[color_flags[count]], sizeof(Color));
+		}
+		if (palette_map != NULL) {
+			for (count = 0; count < 256; count++) {
+				palette_map[count] = color_flags[palette_map[count]];
+			}
+		}
+		for (count = 0; count < list->num_colors; count++) {
+			value[count] = list_flags[count];
+		}
+		for (count = 0; count < list->num_colors; count++) {
+			list_flags[count] = (byte)value[color_flags[count]];
+		}
+		memcpy(list, &temp_list, sizeof(ColorList));
+
+		// Switch cycle list color #'s from palette to list
+		for (cycle_count = 0; cycle_count < cycle->num_cycles; cycle_count++) {
+			found = false;
+			for (count = 0; !found && (count < list->num_colors); count++) {
+				if (list->table[count].cycle == (byte)(cycle_count + 1)) {
+					found = true;
+					cycle->table[cycle_count].first_list_color = (byte)count;
+				}
+			}
+		}
+	}
+
+	if (result == 0) {
+		result = list->num_colors;
+	}
+
+	return result;
+}
+
+int color_list_purge(ColorListPtr list, byte *list_flags) {
+	int count, count2;
+
+	for (count = 0; count < list->num_colors; count++) {
+		if (!list_flags[count]) {
+			for (count2 = count; count2 < list->num_colors - 1; count2++) {
+				list_flags[count2] = list_flags[count2 + 1];
+				memcpy(&list->table[count2], &list->table[count2 + 1], sizeof(Color));
+			}
+			list->num_colors--;
+			count--;
+		}
+	}
+
+	return list->num_colors;
+}
+
+int color_list_palette(ColorListPtr list, Buffer *scan_buf, Palette *scan_pal, int base_color, byte *palette_map, CycleListPtr cycle) {
+	int error_flag = false;
+	int mark;
+	int count, count2;
+	int cycle_count;
+	int cycle_id;
+	int row, col;
+	int map_me;
+	int stop_doing_this;
+	byte map[256];
+	byte flags[256];
+	byte r, g, b;
+	byte *scan;
+	RGBcolor *c2ptr;
+	Color *c1ptr;
+	Palette out_pal;
+
+	// Make a copy of our starting palette
+	memcpy(out_pal, *scan_pal, sizeof(RGBcolor) * 256);
+
+	// Mark all list colors as unmapped
+	for (count = 0; count < 256; count++) {
+		flags[count] = (byte)false;
+	}
+
+	mark = base_color;
+	for (count = 0; count < list->num_colors; count++) {
+		if (mark > 255) {
+			mark = 255;
+			error_flag = true;
+		}
+		c1ptr = &list->table[count];
+		c2ptr = &out_pal[mark];
+		memcpy(c2ptr, c1ptr, sizeof(RGBcolor));
+		palette_map[mark] = (byte)count;
+		stop_doing_this = false;
+		for (count2 = 0; (count2 <= COLOR_HIGHEST) && (!stop_doing_this); count2++) {
+			r = (*scan_pal)[count2].r;
+			g = (*scan_pal)[count2].g;
+			b = (*scan_pal)[count2].b;
+			if ((r == c2ptr->r) && (g == c2ptr->g) && (b == c2ptr->b)) {
+				if (cycle != NULL) {
+					cycle_id = 0;
+					for (cycle_count = 0; cycle_count < cycle->num_cycles; cycle_count++) {
+						if ((count2 >= (int)cycle->table[cycle_count].first_palette_color) &&
+							(count2 <= (int)(cycle->table[cycle_count].first_palette_color + (cycle->table[cycle_count].num_colors - 1)))) {
+							cycle_id = cycle_count + 1;
+						}
+					}
+					map_me = (list->table[count].cycle == (byte)cycle_id);
+					if (cycle_id != 0) {
+						map_me &= (!flags[count2]);
+						stop_doing_this = map_me;
+					}
+				} else {
+					map_me = true;
+				}
+				if (map_me) {
+					map[count2] = (byte)mark;
+					flags[count2] = (byte)true;
+				}
+			}
+		}
+		mark++;
+	}
+
+	map[COLOR_TRANSPARENT] = COLOR_TRANSPARENT;
+
+	scan = (byte *)mem_normalize(scan_buf->data);
+
+	for (row = 0; row < scan_buf->y; row++) {
+		for (col = 0; col < scan_buf->x; col++) {
+			*scan = map[*scan];
+			scan++;
+		}
+		scan = (byte *)mem_check_overflow(scan);
+	}
+	memcpy(*scan_pal, out_pal, sizeof(RGBcolor) * 256);
+
+	if (cycle != NULL) {
+		mark = base_color;
+		for (cycle_count = 0; cycle_count < cycle->num_cycles; cycle_count++) {
+			cycle->table[cycle_count].first_palette_color = (byte)mark;
+			mark += cycle->table[cycle_count].num_colors;
+		}
+	}
+
+	return error_flag;
+}
+
+void color_list_conform(ColorListPtr list, Buffer *scan_buf, Palette *scan_pal, Palette *main_pal, int base_color) {
+	int mark;
+	int count, count2;
+	int row, col;
+	int found;
+	int finish;
+	byte map[256];
+	byte r, g, b;
+	byte *scan;
+	Palette out_pal;
+
+	memcpy(out_pal, *main_pal, sizeof(RGBcolor) * 256);
+
+	mark = base_color + list->num_colors;
+	for (count = 0; count <= COLOR_HIGHEST; count++) {
+		r = (*scan_pal)[count].r;
+		g = (*scan_pal)[count].g;
+		b = (*scan_pal)[count].b;
+		found = false;
+		finish = (count < 16) ? 0 : COLOR_FIRST_USER_COLOR - 1;
+		for (count2 = COLOR_FIRST_USER_COLOR; (!found) && (count2 != finish); ) {
+			if ((r == out_pal[count2].r) &&
+				(g == out_pal[count2].g) &&
+				(b == out_pal[count2].b)) {
+				found = true;
+				map[count] = (byte)count2;
+			}
+			count2 = (count2 + 1) % mark;
+		}
+		if (!found) {
+			if (mark < 255) {
+				out_pal[mark].r = r;
+				out_pal[mark].g = g;
+				out_pal[mark].b = b;
+				map[count] = (byte)mark;
+				mark++;
+			} else {
+				map[count] = 15;
+			}
+		}
+	}
+
+	for (count = 0; count < 16; count++) {
+		map[count] = (byte)count;
+	}
+
+	scan = (byte *)mem_normalize(scan_buf->data);
+
+	map[COLOR_TRANSPARENT] = COLOR_TRANSPARENT;
+
+	for (row = 0; row < scan_buf->y; row++) {
+		for (col = 0; col < scan_buf->x; col++) {
+			*scan = map[*scan];
+			scan++;
+		}
+		scan = (byte *)mem_check_overflow(scan);
+	}
+
+	memcpy(*main_pal, out_pal, sizeof(RGBcolor) * 256);
+}
+
+void color_trans_show_buf(Buffer from, Buffer unto,
+	int from_x, int from_y,
+	int unto_x, int unto_y,
+	int size_x, int size_y,
+	ColorListPtr list,
+	byte *palette_map, int mask_flag) {
+	int row, col;
+	int hi;
+	byte *source, *dest;
+	byte *source_scan, *dest_scan;
+	byte item;
+	byte trans;
+	byte thatch;
+	int color, thatching;
+
+	source = (byte *)mem_normalize(from.data);
+	for (row = 0; row < from_y; row++) {
+		source = (byte *)mem_check_overflow(source + from.x);
+	}
+	source = source + from_x;
+
+	dest = (byte *)mem_normalize(unto.data);
+	for (row = 0; row < unto_y; row++) {
+		dest = (byte *)mem_check_overflow(dest + unto.x);
+	}
+	dest = dest + unto_x;
+
+	for (row = 0; row < size_y; row++) {
+		source_scan = source;
+		dest_scan = dest;
+		for (col = 0; col < size_x; col++) {
+			item = *source_scan;
+			trans = list->table[palette_map[item]].x16;
+			color_split_thatch((int)trans, &color, &thatching);
+			if (item == COLOR_TRANSPARENT) color = 16;
+			if (color != 16) {
+				hi = ((row + from_y) ^ (col + from_x)) & 1;
+				if (hi) {
+					thatch = (byte)thatching;
+				} else {
+					thatch = (byte)color;
+				}
+				if (mask_flag) {
+					*dest_scan = hi_white;
+				} else {
+					*dest_scan = thatch;
+				}
+			} else {
+				if (mask_flag) {
+					*dest_scan = black;
+				} else {
+					*dest_scan = item;
+				}
+			}
+			source_scan++;
+			dest_scan++;
+		}
+		source = (byte *)mem_check_overflow(source + from.x);
+		dest = (byte *)mem_check_overflow(dest + unto.x);
+	}
+}
+
+void color_trans_fill_buf(Buffer unto, int unto_x, int unto_y,
+		int size_x, int size_y, byte thatch_color) {
+	int row, col;
+	int hi;
+	int color, thatching;
+	byte thatch[2];
+	byte *dest;
+	byte *dest_scan;
+
+	dest = (byte *)mem_normalize(unto.data);
+	for (row = 0; row < unto_y; row++) {
+		dest = (byte *)mem_check_overflow(dest + unto.x);
+	}
+	dest += unto_x;
+
+	color_split_thatch((int)thatch_color, &color, &thatching);
+	thatch[0] = (byte)color;
+	thatch[1] = (byte)thatching;
+	if (thatch[0] == 16) {
+		thatch[0] = 0;
+		thatch[1] = 0;
+	}
+
+	for (row = 0; row < size_y; row++) {
+		dest_scan = dest;
+		for (col = 0; col < size_x; col++) {
+			hi = ((row + unto_y) ^ (col + unto_x)) & 1;
+			*dest_scan = thatch[hi];
+			dest_scan++;
+		}
+		dest = (byte *)mem_check_overflow(dest + unto.x);
+	}
+}
+
+void color_buffer_palette_to_list(ColorListPtr list, Buffer *scan_buf, byte *palette_map) {
+	int row, col;
+	byte *scan_ptr;
+	byte scan;
+
+	scan_ptr = (byte *)mem_normalize(scan_buf->data);
+
+	for (row = 0; row < scan_buf->y; row++) {
+		for (col = 0; col < scan_buf->x; col++) {
+			scan = *scan_ptr;
+			*scan_ptr = palette_map[scan];
+			scan_ptr++;
+		}
+		scan_ptr = (byte *)mem_check_overflow(scan_ptr);
+	}
+}
+
+void color_buffer_list_to_palette(Buffer *scan_buf, int marker) {
+	int row, col;
+	byte scan;
+	byte *scan_ptr;
+
+	scan_ptr = (byte *)mem_normalize(scan_buf->data);
+
+	for (row = 0; row < scan_buf->y; row++) {
+		for (col = 0; col < scan_buf->x; col++) {
+			scan = *scan_ptr;
+			*scan_ptr = (byte)marker + scan;
+			scan_ptr++;
+		}
+		scan_ptr = (byte *)mem_check_overflow(scan_ptr);
+	}
+}
+
+void color_transparent_swap(Buffer *scan_buf, Palette *scan_pal, byte transparent) {
+	byte *scan = scan_buf->data;
+	word mysize = scan_buf->x * scan_buf->y;
+
+	for (word i = 0; i < mysize; i++) {
+		if (scan[i] == transparent)
+			scan[i] = COLOR_TRANSPARENT;
+	}
+
+	memcpy(&(*scan_pal)[COLOR_TRANSPARENT], &(*scan_pal)[transparent], sizeof(RGBcolor));
+}
+void color_buffer_list_to_main(ColorListPtr color_list, Buffer *scan_buf) {
+	byte *scan_ptr = (byte *)mem_normalize(scan_buf->data);
+	int   row = scan_buf->y;
+	int   col = scan_buf->x;
+	Color *table_ptr = &color_list->table[0];
+
+	// table_ptr->x16 is at offset +3 in the Color struct (skipping 3 bytes
+	// to reach the X16 translated colour field, as the ASM does "add si, 3")
+	byte *table_x16 = (byte *)table_ptr + 3;
+
+	for (int r = 0; r < row; r++) {
+		for (int c = 0; c < col; c++) {
+			byte pixel = scan_ptr[c];
+			int offset = (int)pixel * 6;
+			scan_ptr[c] = table_x16[offset];
+		}
+		scan_ptr += col;
+	}
+}
+
+void color_split_thatch(int thatch, int *color, int *thatching) {
+	if (thatch == COLOR_NO_X16) {
+		*color = 16;
+		*thatching = *color;
+	} else {
+		*color = thatch & 0x0f;
+		*thatching = thatch >> 4;
+		if (*thatching == 0) {
+			*thatching = *color;
+		} else if (*thatching == COLOR_BLACK_THATCH) {
+			*thatching = 0;
+		}
+	}
+}
+
+void color_buffer_list_to_x16(ColorListPtr color_list, Buffer *scan_buf) {
+	int row, col;
+	int thatch, color_1, color_2;
+	byte thatching;
+	byte scan;
+	byte *scan_ptr;
+
+	scan_ptr = (byte *)mem_normalize(scan_buf->data);
+
+	for (row = 0; row < scan_buf->y; row++) {
+		thatching = (byte)(row & 1);
+		for (col = 0; col < scan_buf->x; col++) {
+			scan = *scan_ptr;
+			thatch = color_list->table[scan].x16;
+			color_split_thatch(thatch, &color_1, &color_2);
+			*scan_ptr = (byte)(thatching ? color_2 : color_1);
+			scan_ptr++;
+			thatching = (byte)(!thatching);
+		}
+	}
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/color.h b/engines/mads/core/color.h
new file mode 100644
index 00000000000..4c53aa61eee
--- /dev/null
+++ b/engines/mads/core/color.h
@@ -0,0 +1,225 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_COLOR_H
+#define MADS_CORE_COLOR_H
+
+#include "common/serializer.h"
+#include "common/stream.h"
+#include "mads/core/loader.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+
+#define COLOR_MAX_USER_COLORS           256
+#define COLOR_FIRST_USER_COLOR          16
+
+#define COLOR_MAX_SHADOW_COLORS         3
+
+#define COLOR_MAX_CYCLES                8
+
+#define COLOR_HIGHEST                   254
+#define COLOR_TRANSPARENT               255
+
+#define COLOR_SOLID                     0
+#define COLOR_BLACK_THATCH              0x0d
+#define COLOR_NO_X16                    0x0ff
+
+#define COLOR_ERR_LISTOVERFLOW          -1
+
+#define COLOR_GROUP_MAP_TO_CYCLE        0x80  /* Map to cycling colors  */
+#define COLOR_GROUP_MAP_TO_CLOSEST      0x40  /* Map to closest color   */
+#define COLOR_GROUP_FORCE_TO_CLOSEST    0x20  /* Force to closest color */
+#define COLOR_GROUP_MAP_TO_SHADOW       0x10  /* Map to shadow color    */
+#define COLOR_GROUP_FORCE_TO_SKIP       0x08  /* Force to skip code     */
+
+#define COLOR_GROUP_SPECIAL_2           0x02  /* Special color group 2  */
+#define COLOR_GROUP_SPECIAL_1           0x01  /* Special color group 1  */
+
+#define COLOR_DP(x) (((((x + 1) * 101) + 26) / 64) - 1)
+
+
+/* A fully parameterized color (in contrast to a plain RGBcolor as */
+/* defined in general.mac)                                         */
+
+struct Color {
+	byte r, g, b;         /* RGB values                  */
+	byte x16;           /* 16 color dither translation */
+	byte cycle;         /* Color cycling handle        */
+	byte group;         /* Color grouping flags        */
+
+	static constexpr size_t SIZE = 1 + 1 + 1 + 1 + 1 + 1;
+	void load(Common::SeekableReadStream *src);
+};
+
+typedef Color *ColorPtr;
+
+
+/* Palette-independent color list; ready to map into palette */
+
+struct ColorList {
+	uint16 num_colors;
+	Color table[COLOR_MAX_USER_COLORS];
+
+	static constexpr size_t SIZE = 2 + (Color::SIZE * COLOR_MAX_USER_COLORS);
+	void load(Common::SeekableReadStream *src);
+};
+
+typedef ColorList *ColorListPtr;
+
+
+/* Palette-independent color cycling range & timing information */
+
+struct Cycle {
+	byte num_colors;                    /* Number of colors in the cycle */
+	byte first_list_color;              /* First color in color list     */
+	byte first_palette_color;           /* First color in final palette  */
+	byte ticks;                         /* 60/s ticks between cycles     */
+
+	static constexpr size_t SIZE = 1 + 1 + 1 + 1;
+	void synchronize(Common::Serializer &s);
+};
+
+typedef Cycle *CyclePtr;
+
+
+/* List of color cycling ranges */
+
+struct CycleList {
+	int16 num_cycles;
+	Cycle table[COLOR_MAX_CYCLES];
+
+	static constexpr size_t SIZE = 2 + (Cycle::SIZE * COLOR_MAX_CYCLES);
+	void synchronize(Common::Serializer &s);
+	void load(Common::SeekableReadStream *src) {
+		Common::Serializer s(src, nullptr);
+		synchronize(s);
+	}
+	void save(Common::WriteStream *dest) {
+		Common::Serializer s(nullptr, dest);
+		synchronize(s);
+	}
+};
+
+typedef CycleList *CycleListPtr;
+
+
+struct ShadowList {
+	uint16 num_shadow_colors;
+	int shadow_color[COLOR_MAX_SHADOW_COLORS];
+
+	static constexpr size_t SIZE = 2 + (2 * COLOR_MAX_SHADOW_COLORS);
+	void load(Common::SeekableReadStream *src);
+};
+
+typedef ShadowList *ShadowListPtr;
+
+/**
+ * Given a main color (0-15, or 16 for "no translation") and a
+ * thatching color (0-15, same as main color for solid thatch),
+ * produces a valid "thatch" byte.
+ */
+extern byte color_thatch(int color, int thatching);
+extern void color_list_start_scan(byte *list_flags);
+
+/**
+ * Updates a color list <list>, based on colors used in <scan_buf>
+ * and defined in <scan_pal>.  Adds any colors used in picture but
+ * not defined in list to the list; sets the corresponding color flag
+ * for each color that is used in the buffer.
+ *
+ * @return		Returns # of colors in updated list, or negative for error.
+ */
+extern int color_list_update(ColorListPtr list, Buffer *scan_buf,
+	Palette *scan_pal, byte *list_flags,
+	byte *palette_map, CycleListPtr cycle);
+
+/**
+ * Removes from color list "list" any colors whose corresponding
+ * flags are not set.  (Use after color_list_update to remove colors
+ * no longer being used).  Voids any previously existing palette_map.
+*/
+extern int color_list_purge(ColorListPtr list, byte *list_flags);
+
+/**
+ * Adds the colors in the given list to the given palette, filling
+ * from the specified "base color".  Also generates a palette_map
+ * which can be used to map palette colors back into the color list.
+*/
+extern int color_list_palette(ColorListPtr list, Buffer *scan_buf,
+	Palette *scan_pal, int base_color,
+	byte *palette_map, CycleListPtr cycle);
+
+/**
+ * Used by roomedit when loading attribute buffers whose colors
+ * are often based on the main image, but which are not necessarily
+ * consistent and may contain additional, if irrelevant, colors.
+ * Conforms the incoming picture with the available palette.  Priority
+ * of actions for each color used is:
+ *         (1) Use equivalent color already existing in palette.
+ *         (2) Allocate a new palette color if available.
+ *         (3) Use "white".
+ */
+extern void color_list_conform(ColorListPtr list, Buffer *scan_buf,
+	Palette *scan_pal, Palette *main_pal,
+	int base_color);
+
+/**
+ * Fills the specified area of the specified buffer with the
+ * specified 16-color thatch (analogous to buffer_rect_fill).
+ */
+extern void color_trans_fill_buf(Buffer unto, int unto_x, int unto_y,
+	int size_x, int size_y, byte thatch_color);
+
+/**
+ * Copies a rectangle of the buffer "from" into the buffer "unto",
+ * But uses the specified color list and palette map to perform
+ * 256-to-16 color translations.  If "mask_flag" is true, then
+ * displays "white" if a translation exists for a pixel, "black"
+ * otherwise.  If "mask_flag" is false, then translated color is
+ * displayed if available, and untranslated color is displayed
+ * otherwise.
+ *
+ *      Analogous to buffer_rect_copy();
+ */
+extern void color_trans_show_buf(Buffer from, Buffer unto,
+	int from_x, int from_y, int unto_x, int unto_y,
+	int size_x, int size_y, ColorListPtr list,
+	byte *palette_map, int mask_flag);
+
+extern void color_buffer_palette_to_list(ColorListPtr list,
+	Buffer *scan_buf, byte *palette_map);
+extern void color_buffer_list_to_palette(Buffer *scan_buf, int marker);
+extern void color_transparent_swap(Buffer *scan_buf, Palette *scan_pal, byte transparent);
+extern void color_buffer_list_to_main(ColorListPtr color_list, Buffer *scan_buf);
+extern void color_buffer_list_to_x16(ColorListPtr color_list, Buffer *scan_buf);
+
+/**
+ * Given a valid thatch byte, returns a primary "color" and
+ * secondary "thatching" color.
+ */
+extern void color_split_thatch(int thatch, int *color, int *thatching);
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/madsv2/core/concat.h b/engines/mads/core/concat.h
similarity index 100%
rename from engines/mads/madsv2/core/concat.h
rename to engines/mads/core/concat.h
diff --git a/engines/mads/core/config.cpp b/engines/mads/core/config.cpp
new file mode 100644
index 00000000000..7fa379b342a
--- /dev/null
+++ b/engines/mads/core/config.cpp
@@ -0,0 +1,121 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/config-manager.h"
+#include "mads/core/config.h"
+#include "mads/core/env.h"
+#include "mads/core/inter.h"
+#include "mads/core/kernel.h"
+#include "mads/engine.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+ConfigFile config_file = {
+	0, 0x220,
+	0, 0x220, 7, 1,
+	true, true, 1,
+	0, 0,
+	0, 0,
+	0, true,
+	0, 0,
+	false, 'D',
+	false,
+	false,
+	7, 0, 0, 0, 0,
+	false
+};
+
+void read_config_file() {
+	ConfMan.registerDefault("music_mute", false);
+	ConfMan.registerDefault("sfx_mute", false);
+	ConfMan.registerDefault("speech_mute", false);
+
+	ConfMan.registerDefault("interface_hotspots", true);
+	ConfMan.registerDefault("inventory_mode", true);
+	ConfMan.registerDefault("animated_interface", true);
+	ConfMan.registerDefault("show_speech_boxes", true);
+	ConfMan.registerDefault("naughtiness", true);
+	ConfMan.registerDefault("difficulty", -1);
+
+	config_file.music_flag = !ConfMan.getBool("music_mute") && !ConfMan.getBool("mute");
+	config_file.sound_flag = !ConfMan.getBool("sfx_mute") && !ConfMan.getBool("mute");
+	config_file.speech_flag = !ConfMan.getBool("speech_mute") && !ConfMan.getBool("mute");
+
+	config_file.interface_hotspots = ConfMan.getBool("interface_hotspots") ? INTERFACE_BRAINDEAD : INTERFACE_MACINTOSH;
+	config_file.inventory_mode = ConfMan.getBool("inventory_mode") ? INVENTORY_SPINNING : INVENTORY_SQUAT;
+	config_file.animated_interface = ConfMan.getBool("animated_interface") ? INTERFACE_ANIMATED : INTERFACE_STILL;
+	config_file.naughtiness = ConfMan.getBool("naughtiness") ? NAUGHTY : NICE;
+
+	config_file.quotes_enabled = ConfMan.getBool("quotes_enabled");
+	config_file.screen_fade = ConfMan.getBool("screen_fade");
+	config_file.panning_speed = ConfMan.getBool("panning_speed");
+
+	config_file.show_speech_boxes = ConfMan.getBool("show_speech_boxes");
+	config_file.original_save_load = ConfMan.getBool("original_menus");
+
+	if (ConfMan.hasKey("difficulty") && !g_engine->isDemo())
+		game.difficulty = ConfMan.getInt("difficulty");
+}
+
+void write_config_file() {
+	ConfMan.setBool("music_mute", !config_file.music_flag);
+	ConfMan.setBool("sfx_mute", !config_file.sound_flag);
+	ConfMan.setBool("speech_mute", !config_file.speech_flag);
+
+	ConfMan.setInt("interface_hotspots", config_file.interface_hotspots);
+	ConfMan.setInt("inventory_spinning", config_file.inventory_mode);
+	ConfMan.setBool("animated_interface", config_file.animated_interface);
+
+	ConfMan.setBool("quotes_enabled", config_file.quotes_enabled);
+	ConfMan.setBool("screen_fade", config_file.screen_fade);
+	ConfMan.setBool("panning_speed", config_file.panning_speed);
+
+	ConfMan.setBool("show_speech_boxes", config_file.show_speech_boxes);
+	if (g_engine->getGameID() == GType_RexNebular)
+	ConfMan.setInt("naughtiness", config_file.naughtiness);
+
+	ConfMan.flushToDisk();
+}
+
+void global_load_config_parameters() {
+	inter_report_hotspots = (config_file.interface_hotspots == INTERFACE_BRAINDEAD);
+	inter_spinning_objects = true;
+	inter_animation_running = true;
+
+	kernel_panning_speed = config_file.panning_speed;
+	kernel_screen_fade = config_file.screen_fade;
+
+	if (config_file.cd_version_installed) {
+		env_search_cd = true;
+		env_cd_drive = (char)config_file.cd_drive;
+	}
+}
+
+void global_unload_config_parameters() {
+	config_file.interface_hotspots = inter_report_hotspots ? INTERFACE_BRAINDEAD : INTERFACE_MACINTOSH;
+
+	config_file.panning_speed = kernel_panning_speed;
+	config_file.screen_fade = kernel_screen_fade;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/madsv2/core/config.h b/engines/mads/core/config.h
similarity index 100%
rename from engines/mads/madsv2/core/config.h
rename to engines/mads/core/config.h
diff --git a/engines/mads/core/conv.cpp b/engines/mads/core/conv.cpp
new file mode 100644
index 00000000000..9016c29867a
--- /dev/null
+++ b/engines/mads/core/conv.cpp
@@ -0,0 +1,1847 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "common/debug.h"
+#include "common/hashmap.h"
+#include "common/hash-str.h"
+#include "common/memstream.h"
+#include "common/textconsole.h"
+#include "mads/core/conv.h"
+#include "mads/core/general.h"
+#include "mads/core/env.h"
+#include "mads/core/error.h"
+#include "mads/core/fileio.h"
+#include "mads/core/game.h"
+#include "mads/core/imath.h"
+#include "mads/core/inter.h"
+#include "mads/core/kernel.h"
+#include "mads/core/matte.h"
+#include "mads/core/mem.h"
+#include "mads/core/popup.h"
+#include "mads/core/speech.h"
+#include "mads/engine.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+Conv *conv[CONV_MAX_DATA];
+ConvData *conv_data[CONV_MAX_DATA];
+Conv *active_conv;
+ConvData *active_conv_data;
+int16 *conv_imports;
+uint16 *conv_entry_flags;
+ConvVariable *conv_varsDataPtr;
+int16 *conv_vars0ValPtr;
+int conv_restore_running;
+ConvControl conv_control;
+Box conv_box;
+int16 *conv_my_next_start;
+int conv_error_code;
+int conv_dlg_script_ptr, conv_dlg_script_end;
+bool conv_show_boxes;
+
+struct MemoryWriteStreamDynamic : public Common::MemoryWriteStreamDynamic {
+public:
+	MemoryWriteStreamDynamic() : Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES) {}
+};
+Common::HashMap<Common::String, MemoryWriteStreamDynamic,
+	Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> *savedConv;
+
+static int conv_indexes[CONV_MAX_SLOTS];
+static bool conv_slots[CONV_MAX_DATA];
+
+
+// ====================================================================
+// Struct serialization methods
+// ====================================================================
+
+void Conv::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(node_count, dialog_count, message_count, text_line_count,
+		num_variables, max_imports, speaker_count);
+	for (int i = 0; i < 5; ++i)
+		src->read(speaker_portraits[i], 16);
+	for (int i = 0; i < 5; ++i)
+		speaker_frame[i] = src->readSint16LE();
+	src->read(speech_file, 14);
+	src->readMultipleLE(text_length, commands_length);
+
+	// Skip over original padding for pointer fields
+	src->skip(6 * sizeof(uint32));
+
+	nodes.clear();
+	dialogs.clear();
+	messages.clear();
+	text.clear();
+	scripts.clear();
+	textLines.clear();
+}
+
+void ConvNode::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(index, dialog_count, active, field_6, field_8);
+}
+
+void ConvDialog::load(Common::SeekableReadStream *src) {
+	src->readMultipleLE(text_line_index, speech_index, script_offset, script_size);
+}
+
+void ConvScriptParams::load(Common::SeekableReadStream *src) {
+	operation = (ConvOp)src->readSint16LE();
+	param1IsVar = src->readByte();
+	param2IsVar = src->readByte();
+	src->readMultipleLE(param1, param2);
+}
+
+void ConvVariable::load(Common::SeekableReadStream *src) {
+	uint16 flag = src->readUint16LE();
+	isPtr = flag == MKTAG16('V', 'M');
+
+	val = src->readSint16LE();
+	type = src->readSint16LE();
+
+	if (flag == 0xffff) {
+		// Originals can have placeholder entries for pointers. Such as for Phantom in Manager's Office,
+		// and in Dragonsphere at the Hightower entrance. For ScummVM we simply reset them to be
+		// standard immediate values until such time as a proper pointer is set
+		val = type = 0;
+
+	} else if (isPtr) {
+		switch (type) {
+		case PTRTYPE_GLOBAL:
+			ptr = global + val;
+			break;
+		case PTRTYPE_CONV_CONTROL:
+			if (val >= 0 && val < 20) {
+				// Index into one of the four 5-element arrays in turn:
+				// speaker_frame[5], x[5], y[5], width[5]
+				int16 *const fieldArrays[] = {
+					conv_control.speaker_frame, conv_control.x, conv_control.y, conv_control.width
+				};
+				ptr = &fieldArrays[val / CONV_MAX_DATA][val % CONV_MAX_DATA];
+			} else if (val == 20) {
+				ptr = &conv_control.speaker_val;
+			} else {
+				error("Unknown ConvVariable conv_control pointer");
+			}
+			break;
+		default:
+			error("Unknown ConvVariable pointer type");
+			break;
+		}
+	}
+}
+
+void ConvVariable::save(Common::WriteStream *dest) const {
+	if (isPtr) {
+		dest->writeUint16LE(MKTAG16('V', 'M'));
+		dest->writeSint16LE(val);
+		dest->writeSint16LE(type);
+	} else {
+		dest->writeUint16LE(0);
+		dest->writeSint16LE(val);
+		dest->writeSint16LE(0);
+	}
+}
+
+void ConvData::load(Common::SeekableReadStream *src) {
+	{
+		byte buffer[SIZE];
+		if (!src->read(buffer, SIZE))
+			return;
+
+		Common::MemoryReadStream mrs(buffer, SIZE);
+		mrs.readMultipleLE(currentNode, entryFlagsCount, variablesCount,
+			importsCount, numImports, optionListSize,
+			messageList1Size, messageList2Size, speechList1Size, speechList2Size);
+		mrs.readMultipleLE(optionList);
+		mrs.readMultipleLE(messageList1);
+		mrs.readMultipleLE(messageList2);
+		mrs.readMultipleLE(speechList1);
+		mrs.readMultipleLE(speechList2);
+		mrs.readMultipleLE(importsOffset, entryFlagsOffset, variablesOffset);
+	}
+
+	// Imports: conditional — the original skips the loader_read when count <= 0
+	imports.clear();
+	if (importsCount > 0) {
+		int16 *buffer = (int16 *)malloc(importsCount * 2);
+		src->read(buffer, importsCount * 2);
+
+		imports.resize(importsCount);
+		for (int i = 0; i < importsCount; ++i)
+			imports[i] = FROM_LE_16(buffer[i]);
+		free(buffer);
+	}
+
+	// Entry flags: always read (no count guard in the original)
+	{
+		int16 *buffer = (int16 *)malloc(entryFlagsCount * 2);
+		src->read(buffer, entryFlagsCount * 2);
+
+		entryFlags.resize(entryFlagsCount);
+		for (int i = 0; i < entryFlagsCount; ++i)
+			entryFlags[i] = FROM_LE_16(buffer[i]);
+		free(buffer);
+	}
+
+	// Variables
+	{
+		byte *buffer = (byte *)malloc(variablesCount * ConvVariable::SIZE);
+		src->read(buffer, (long)variablesCount * ConvVariable::SIZE);
+
+		Common::MemoryReadStream mrs(buffer, variablesCount * ConvVariable::SIZE);
+		variables.resize(variablesCount);
+		for (int i = 0; i < variablesCount; ++i) {
+			variables[i].load(&mrs);
+
+			// Zero the runtime isPtr flag for every variable; it is not meaningful as stored on disk
+			variables[i].isPtr = false;
+		}
+		free(buffer);
+	}
+}
+
+void ConvData::save(Common::WriteStream *dest) const {
+	dest->writeMultipleLE(currentNode, entryFlagsCount, variablesCount,
+		importsCount, numImports, optionListSize,
+		messageList1Size, messageList2Size, speechList1Size, speechList2Size);
+	dest->writeMultipleLE(optionList);
+	dest->writeMultipleLE(messageList1);
+	dest->writeMultipleLE(messageList2);
+	dest->writeMultipleLE(speechList1);
+	dest->writeMultipleLE(speechList2);
+
+	// Figure out offset fields
+	uint16 importsOffset1 = SIZE;
+	uint16 entryFlagsOffset1 = importsOffset1 + (importsCount * 2);
+	uint16 variablesOffset1 = entryFlagsOffset1 + (entryFlagsCount * 2);
+	dest->writeMultipleLE(importsOffset1, entryFlagsOffset1, variablesOffset1);
+
+	for (int i = 0; i < importsCount; ++i)
+		dest->writeSint16LE(imports[i]);
+
+	for (int i = 0; i < entryFlagsCount; ++i)
+		dest->writeSint16LE(entryFlags[i]);
+
+	for (int i = 0; i < variablesCount; ++i)
+		variables[i].save(dest);
+}
+
+
+// ====================================================================
+// Static helpers (ordered so no forward declarations are needed)
+// ====================================================================
+
+static const char *conv_get_filename(int convNum, int extType, char *name) {
+	*name = '\0';
+
+	if (extType != 2)
+		Common::strcat_s(name, 40, "*");
+	Common::strcat_s(name, 40, "conv");
+	Common::strcat_s(name, 40, Common::String::format("%.3d", convNum).c_str());
+	if (extType == 2)
+		Common::strcat_s(name, 40, ".dat");
+
+	return name;
+}
+
+// conv_open version for when mode is "rb"
+static Common::SeekableReadStream *conv_open(int convNum) {
+	char name[40];
+	conv_get_filename(convNum, 2, name);
+	Common::String fname = name;
+
+	// If there's a pretend temporary file for it, use that instead
+	if (savedConv->contains(fname))
+		return new Common::MemoryReadStream((*savedConv)[fname].getData(),
+			(*savedConv)[fname].size());
+
+	// Fall back on normal resource open
+	return env_open(name);
+}
+
+// conv_open version for when mode is "wb"
+static Common::WriteStream *conv_open_write(int convNum) {
+	char name[40];
+	conv_get_filename(convNum, 2, name);
+	Common::String fname = name;
+
+	(*savedConv)[fname] = MemoryWriteStreamDynamic();
+	return &(*savedConv)[fname];
+}
+
+
+// ---------------------------------------------------------------------------
+// string_trim — strips trailing whitespace from a mutable C string in-place.
+// ---------------------------------------------------------------------------
+static void string_trim(char *str) {
+	if (!str) return;
+	size_t len = strlen(str);
+	while (len > 0 && (unsigned char)str[len - 1] <= ' ')
+		str[--len] = '\0';
+}
+
+// ---------------------------------------------------------------------------
+// conv_string — returns a pointer to the null-terminated dialog string
+// identified by textIdx.  textLines[textIdx] is a byte offset into the flat
+// text character pool stored in conv->text.
+// ---------------------------------------------------------------------------
+static const char *conv_string(Conv *convIn, int textIdx) {
+	uint16 strOffset = convIn->textLines[textIdx];
+	return &convIn->text[0] + strOffset;
+}
+
+// Version to use if the isPtr parameter is true (-1)
+static void conv_set_variable(int idx, int16 *ptr) {
+	if (conv_control.running >= 0) {
+		ConvData &cd = *conv_data[conv_control.index];
+		ConvVariable &var = cd.variables[idx];
+
+		var.isPtr = true;
+		var.ptr = ptr;
+
+		// We need to know what kind of pointer it is so it can be properly serialized
+		if (ptr >= global && ptr < (global + GLOBAL_LIST_SIZE)) {
+			var.type = ConvVariable::PTRTYPE_GLOBAL;
+			var.val = ptr - global;
+		} else if (ptr >= conv_control.speaker_frame && ptr < conv_control.speaker_frame + 20) {
+			// Index into one of the sequential 5 element arrays:
+			// speaker_frame[5], x[5], y[5], width[5]
+			var.type = ConvVariable::PTRTYPE_CONV_CONTROL;
+			var.val = ptr - conv_control.speaker_frame;
+		} else if (ptr == &conv_control.speaker_val) {
+			var.type = ConvVariable::PTRTYPE_CONV_CONTROL;
+			var.val = 20;
+		} else {
+			error("Unhandled ConvVariable pointer type");
+		}
+	}
+}
+
+// Version to use if the isPtr parameter is false (0)
+static void conv_set_variable(int idx, int16 val) {
+	if (conv_control.running >= 0) {
+		ConvData &cd = *conv_data[conv_control.index];
+		ConvVariable &var = cd.variables[idx];
+
+		var.isPtr = false;
+		var.val = val;
+		var.type = 0;
+	}
+}
+
+static Conv *load_conv(const char *fname) {
+	Load file;
+	Conv *dataPtr = nullptr;
+	Conv *result = nullptr;
+	char filename[80];
+
+	file.open = false;
+
+	Common::strcpy_s(filename, fname);
+	fileio_add_ext(filename, "cnv");
+
+	if (loader_open(&file, filename, "rb", true)) {
+		conv_error_code = 1;
+		goto done;
+	}
+
+	dataPtr = new Conv();
+
+	{
+		// Read the fixed-size Conv header through a MemoryReadStream so that
+		// the load() function handles field sizes and endianness correctly.
+		byte buffer[Conv::SIZE];
+		if (!loader_read(buffer, Conv::SIZE, 1, &file)) {
+			conv_error_code = 2;
+			goto done;
+		}
+		Common::MemoryReadStream hdrStream(buffer, Conv::SIZE);
+		dataPtr->load(&hdrStream);
+	}
+
+	// Read each section from the file.  Error codes deliberately match the
+	// originals (note: 6 is skipped, matching the disassembly).
+
+	// Nodes
+	{
+		byte *buffer = (byte *)malloc(dataPtr->node_count * ConvNode::SIZE);
+		if (!loader_read(buffer, dataPtr->node_count * ConvNode::SIZE, 1, &file)) {
+			conv_error_code = 4;
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, dataPtr->node_count * ConvNode::SIZE);
+		dataPtr->nodes.resize(dataPtr->node_count);
+		for (int i = 0; i < dataPtr->node_count; ++i)
+			dataPtr->nodes[i].load(&src);
+
+		free(buffer);
+	}
+
+	// Dialogs
+	{
+		byte *buffer = (byte *)malloc(dataPtr->dialog_count * ConvDialog::SIZE);
+		if (!loader_read(buffer, dataPtr->dialog_count * ConvDialog::SIZE, 1, &file)) {
+			conv_error_code = 5;
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, dataPtr->dialog_count * ConvDialog::SIZE);
+		dataPtr->dialogs.resize(dataPtr->dialog_count);
+		for (int i = 0; i < dataPtr->dialog_count; ++i)
+			dataPtr->dialogs[i].load(&src);
+
+		free(buffer);
+	}
+
+	// Messages
+	{
+		byte *buffer = (byte *)malloc(dataPtr->message_count * 4);
+		if (!loader_read(buffer, dataPtr->message_count * 4, 1, &file)) {
+			conv_error_code = 7;
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, dataPtr->message_count * 4);
+		dataPtr->messages.resize(dataPtr->message_count);
+		for (int i = 0; i < dataPtr->message_count; ++i) {
+			dataPtr->messages[i].lineStart = src.readSint16LE();
+			dataPtr->messages[i].lineCount = src.readSint16LE();
+		}
+
+		free(buffer);
+	}
+
+	// Text lines
+	{
+		byte *buffer = (byte *)malloc(dataPtr->text_line_count * 2);
+		if (!loader_read(buffer, dataPtr->text_line_count * 2, 1, &file)) {
+			conv_error_code = 8;
+			free(buffer);
+			goto done;
+		}
+
+		Common::MemoryReadStream src(buffer, dataPtr->text_line_count * 2);
+		dataPtr->textLines.resize(dataPtr->text_line_count);
+		for (int i = 0; i < dataPtr->text_line_count; ++i)
+			dataPtr->textLines[i] = src.readUint16LE();
+
+		free(buffer);
+	}
+
+	// Text block
+	{
+		dataPtr->text.resize(dataPtr->text_length);
+		if (!loader_read(&dataPtr->text[0], dataPtr->text_length, 1, &file)) {
+			conv_error_code = 9;
+			goto done;
+		}
+	}
+
+	// Scripts
+	{
+		dataPtr->scripts.resize(dataPtr->commands_length);
+		if (!loader_read(&dataPtr->scripts[0], dataPtr->commands_length, 1, &file)) {
+			conv_error_code = 10;
+			goto done;
+		}
+	}
+
+	result = dataPtr;
+
+done:
+	if (file.open)
+		loader_close(&file);
+
+	// Free the block if we bailed out before completing the load
+	if (dataPtr && dataPtr != result)
+		delete dataPtr;
+
+	return result;
+}
+
+static ConvData *load_conv_data(const char *fname) {
+	Load file;
+	ConvData *convData = nullptr;
+	char filename[80];
+
+	file.open = false;
+
+	Common::strcpy_s(filename, fname);
+	fileio_add_ext(filename, "cnd");
+
+	if (loader_open(&file, filename, "rb", true))
+		return nullptr;
+
+	convData = new ConvData();
+	LoaderReadStream src(&file);
+	convData->load(&src);
+
+	loader_close(&file);
+	return convData;
+}
+
+static ConvData *conv_read(Common::SeekableReadStream *src) {
+	ConvData *cd = new ConvData();
+	cd->load(src);
+	return cd;
+}
+
+static int conv_write(Common::WriteStream *dest, const ConvData *convData) {
+	convData->save(dest);
+	return 0;
+}
+
+static void conv_init(ConvData *convData, int val) {
+	conv_start(convData, nullptr);
+
+	for (uint i = 0; i < convData->entryFlags.size(); ++i) {
+		uint16 &flag = convData->entryFlags[i];
+		flag &= 0x3fff;
+
+		if ((flag & 1) || ((flag & 4) && val))
+			flag |= 0x8000;
+	}
+}
+
+static ConvData *conv_get_data(int convNum) {
+	ConvData *convData = nullptr;
+	char name[80];
+
+	if (conv_indexes[convNum]) {
+		Common::SeekableReadStream *handle = conv_open(convNum);
+		if (handle) {
+			convData = conv_read(handle);
+			delete handle;
+		}
+	} else {
+		convData = load_conv_data(conv_get_filename(convNum, 1, name));
+		conv_init(convData, 0);
+	}
+
+	return convData;
+}
+
+static void conv_purge_any_popup() {
+	if (conv_control.popup_is_up) {
+		Box *my_box = box;
+		box = &conv_box;
+		popup_destroy();
+		matte_frame(0, 0);
+
+		if ((box->y + box->ys) >= 156)
+			matte_inter_frame(-1, -1);
+
+		box = my_box;
+		conv_control.popup_is_up = 0;
+		conv_control.popup_clock = kernel.clock;
+
+		// TODO: Determine where original turns off speech.
+		// There may be a more appropriate place
+		speech_all_off();
+	}
+}
+
+// ---------------------------------------------------------------------------
+// conv_generate_text
+//
+// Builds and displays a conversation-line popup for the current speaker, then
+// triggers the associated speech audio (if the speech system is active and at
+// least one speech index was supplied).
+//
+// Parameters
+//   convIn      — active Conv (provides the text pool and speech filename)
+//   convData    — active ConvData (unused; callers already route through
+//                 conv_control)
+//   textIdx     — index into convIn->textLines that selects the dialog string
+//   speechList  — array of speech-audio indices; speechList[0] is played
+//   speechCount — number of valid entries in speechList (0 = no speech)
+// ---------------------------------------------------------------------------
+static void conv_generate_text(Conv *convIn, ConvData * /*convData*/,
+		int textIdx, int16 *speechList, int speechCount) {
+	int  person = conv_control.person_speaking;
+	char textBuf[512];
+	Box *savedBox;
+	bool showBox = conv_show_boxes;
+
+	conv_control.has_text = true;
+
+	// TODO: Hook this up to ScummVM subtitles - original disabled reply boxes if in voice only mode
+	//if (speech_system_active && speech_on && speechCount > 0 && !show_subtitles) showBox = false;
+
+	if (showBox) {
+		// Redirect popup operations to the conversation-private box so that the
+		// bounds recorded by popup_draw can be used later by conv_purge_any_popup.
+		savedBox = box;
+		box = &conv_box;
+
+		// Size and position the popup from the current speaker's slot data.
+		int horiz_pieces = popup_estimate_pieces(conv_control.width[person]);
+		(void)popup_create(horiz_pieces,
+			conv_control.x[person],
+			conv_control.y[person]);
+
+		// Attach the speaker portrait icon if a series was loaded for this slot.
+		// The icon_id is the 1-based frame stored in speaker_frame.
+		// center=0: left-aligned within the popup box.
+		if (conv_control.speaker_series[person] >= 0) {
+			popup_add_icon(series_list[conv_control.speaker_series[person]],
+				conv_control.speaker_frame[person],
+				0);
+		}
+
+		// Copy the dialog string to a local mutable buffer, strip trailing
+		// whitespace (the raw text pool can have padding bytes), then write it.
+		Common::strlcpy(textBuf, conv_string(convIn, textIdx), sizeof(textBuf));
+		string_trim(textBuf);
+		popup_write_string(textBuf);
+
+		// Render the popup, saving the underlying screen region.
+		popup_draw(true, true);
+
+		// Restore the caller's box
+		box = savedBox;
+	}
+
+	// Record that a conversation popup is live.
+	conv_control.popup_is_up  = -1;
+
+	// Play the associated speech audio when the speech system is on.
+	if (speech_system_active && speech_on && speechCount > 0) {
+		speech_play(convIn->speech_file, speechList[0]);
+	}
+
+	if (showBox)
+		conv_control.popup_clock = kernel.clock + conv_control.popup_duration;
+	else
+		// TODO: If speech is allowed with no box showing, this needs to allow time for the speech duration
+		conv_control.popup_clock = kernel.clock;
+}
+
+static int conv_next_node() {
+	active_conv_data->currentNode = *conv_vars0ValPtr;
+	return active_conv->nodes[active_conv_data->currentNode].active;
+}
+
+// ---------------------------------------------------------------------------
+// conv_list_options
+//
+// Scans the dialogs belonging to the current conversation node and builds the
+// list of active (visible) options in active_conv_data->optionList[].
+//
+// A dialog entry is "active" when bit 15 of its entryFlags word is set.  Up
+// to 10 active entries are recorded; when hasMore is zero the list is capped
+// at 5 (normal single-page display), otherwise the full 10 are collected
+// (extended/scrolled display).  The final count of ALL active entries (not
+// just the ones stored) is written to active_conv_data->optionListSize.
+//
+// Parameters
+//   hasMore — non-zero when more than one page of options should be collected
+// ---------------------------------------------------------------------------
+static int16 conv_list_options(int16 hasMore) {
+	int16 nodeIndex  = *conv_vars0ValPtr;
+	int   count      = 0;
+	int   dialogIter = 0;
+
+	int dialogBase  = active_conv->nodes[nodeIndex].index;
+	int dialogCount = active_conv->nodes[nodeIndex].dialog_count;
+
+	while (dialogIter < dialogCount) {
+		int16 dialogIdx = (int16)(dialogBase + dialogIter);
+
+		if (active_conv_data->entryFlags[dialogIdx] & 0x8000) {
+			// Include in optionList only if within the allowed window size
+			if ((count < 5 || hasMore) && count < 10)
+				active_conv_data->optionList[count] = dialogIdx;
+			++count;
+		}
+		++dialogIter;
+	}
+
+	active_conv_data->optionListSize = (int16)count;
+	return (int16)count;
+}
+
+static void conv_flag_entry(int action, int index) {
+	uint16 &entry = active_conv_data->entryFlags[index];
+
+	switch (action) {
+	case 1:
+		entry |= 0x4000;
+		entry &= 0x7fff;
+		break;
+
+	case 2:
+		entry &= 0x7fff;
+		break;
+
+	case 3:
+		if (!(entry & 0x4000))
+			entry |= 0x8000;
+
+	default:
+		break;
+	}
+}
+
+static byte conv_get_script_byte() {
+	byte val = active_conv->scripts[conv_dlg_script_ptr];
+	if (conv_dlg_script_ptr <= conv_dlg_script_end)
+		++conv_dlg_script_ptr;
+
+	return val;
+}
+
+static void conv_get_script_bytes(byte *dest, int count) {
+	while (count-- > 0)
+		*dest++ = conv_get_script_byte();
+}
+
+static int16 conv_get_script_word() {
+	byte buffer[2];
+	conv_get_script_bytes(buffer, 2);
+	return READ_LE_INT16(buffer);
+}
+
+static void conv_param_load(ConvScriptParams *params) {
+	params->operation = (ConvOp)conv_get_script_word();
+
+	if (params->operation == CONV_OP_NONE) {
+		params->param1IsVar = false;
+		params->param1 = 0;
+	} else {
+		params->param1IsVar = conv_get_script_byte();
+		params->param1 = conv_get_script_word();
+	}
+
+	if (params->operation == CONV_OP_VALUE || params->operation == CONV_OP_NONE) {
+		params->param2IsVar = false;
+		params->param2 = 0;
+	} else {
+		params->param2IsVar = conv_get_script_byte();
+		params->param2 = conv_get_script_word();
+	}
+}
+
+// ---------------------------------------------------------------------------
+// conv_scr_get_param
+//
+// Resolves one operand of a script expression.  If the corresponding IsVar
+// flag is set the stored value is treated as a variable index and the live
+// value is fetched from conv_varsDataPtr; otherwise the value is used
+// directly.
+//
+// paramNum: 0 = param1, 1 = param2
+// ---------------------------------------------------------------------------
+static int16 conv_scr_get_param(ConvScriptParams *params, int paramNum) {
+	int16 result;
+
+	if (paramNum) {
+		if (params->param2IsVar < 1) {
+			result = params->param2;
+		} else {
+			result = *conv_get_variable(params->param2);
+			if (params->param2IsVar == 2)
+				result = !result ? 1 : 0;
+		}
+	} else {
+		if (params->param1IsVar < 1) {
+			result = params->param1;
+		} else {
+			result = *conv_get_variable(params->param1);
+			if (params->param1IsVar == 2)
+				result = !result ? 1 : 0;
+		}
+	}
+
+	return result;
+}
+
+// ---------------------------------------------------------------------------
+// conv_param_evaluate
+//
+// Evaluates a script expression encoded in *params and returns the result as
+// an int16.
+//
+// Special operation codes:
+//   CONV_OP_NONE  (255) — no expression; returns -1 without reading params.
+//   CONV_OP_VALUE (  0) — identity; returns param1 (resolved variable or
+//                         literal) without a second operand.
+//
+// Operations 1–13 take two resolved operands (param1, param2) and compute
+// arithmetic or logical results.  An out-of-range operation code is a
+// non-fatal error (WARNING); the initialised result of -1 is returned.
+// ---------------------------------------------------------------------------
+static int16 conv_param_evaluate(ConvScriptParams *params) {
+	int16 result = -1;
+
+	if (params->operation == CONV_OP_NONE)
+		return result;
+
+	int16 param1 = conv_scr_get_param(params, 0);
+
+	if (params->operation == CONV_OP_VALUE)
+		return param1;
+
+	int16 param2 = conv_scr_get_param(params, 1);
+
+	switch (params->operation) {
+	case CONV_OP_ADD:
+		result = param1 + param2;
+		break;
+	case CONV_OP_SUB:
+		result = param1 - param2;
+		break;
+	case CONV_OP_MUL:
+		result = param1 * param2;
+		break;
+	case CONV_OP_DIV:
+		result = param2 ? param1 / param2 : 0;
+		break;
+	case CONV_OP_MOD:
+		result = param2 ? param1 % param2 : 0;
+		break;
+	case CONV_OP_GE:
+		result = (param1 >= param2) ? 1 : 0;
+		break;
+	case CONV_OP_LE:
+		result = (param1 <= param2) ? 1 : 0;
+		break;
+	case CONV_OP_GT:
+		result = (param1 > param2) ? 1 : 0;
+		break;
+	case CONV_OP_LT:
+		result = (param1 < param2) ? 1 : 0;
+		break;
+	case CONV_OP_NE:
+		result = (param1 != param2) ? 1 : 0;
+		break;
+	case CONV_OP_EQ:
+		result = (param1 == param2) ? 1 : 0;
+		break;
+	case CONV_OP_AND:
+		result = (param1 != 0 && param2 != 0) ? 1 : 0;
+		break;
+	case CONV_OP_OR:
+		result = (param1 != 0 || param2 != 0) ? 1 : 0;
+		break;
+	default:
+		// Unknown operator — non-fatal; report and return the initialised -1.
+		error_report(ERROR_CONV_BAD_OPERATOR, WARNING, MODULE_CONV,
+		             conv_dlg_script_ptr, (int)params->operation);
+		break;
+	}
+
+	return result;
+}
+
+// ---------------------------------------------------------------------------
+// conv_generate_menu
+//
+// Prepares the player-choice menu for the current conversation node.
+//
+// Calls conv_list_options(0) to populate convData->optionList[] with the global
+// dialog indices of all active entries for the current node and to obtain the
+// total active count.
+//
+// If the node's field_8 value is >= count it acts as a redirect: variables
+// are updated to the target node stored in field_6 and the function returns 0
+// so the caller (conv_update) can loop and re-evaluate.
+//
+// Otherwise the function initialises the dialog interface, registers each
+// active entry's display text with inter_add_dialog(), enables command input,
+// and returns 2.
+//
+// Parameters
+//   convData — ConvData for the active conversation (provides optionList)
+//   convIn   — Conv for the active conversation (provides nodes and dialogs)
+//
+// Returns
+//   0 — node redirected to another node (caller should re-run)
+//   2 — menu built and ready for player input
+// ---------------------------------------------------------------------------
+static int conv_generate_menu(ConvData *convData, Conv *convIn) {
+	int16 count     = conv_list_options(0);
+	int16 nodeIndex = *conv_vars0ValPtr;
+	ConvNode *node  = &convIn->nodes[nodeIndex];
+
+	// If field_8 >= count the node is a redirect: jump to the node index
+	// stored in field_6 and tell the caller to re-evaluate.
+	if (node->field_8 >= count) {
+		*conv_vars0ValPtr   = node->field_6;
+		*conv_my_next_start = *conv_vars0ValPtr;
+		return 0;
+	}
+
+	// Sanity-check: there should be at least one active dialog entry.
+	if (count < 1)
+		error_report(ERROR_CONV_MENU, ERROR, MODULE_CONV, nodeIndex, count);
+
+	conv_control.popup_clock = kernel.clock;
+	kernel_init_dialog();
+
+	for (int i = 0; i < count; ++i) {
+		int16 dialogIdx   = convData->optionList[i];
+		int16 textLineIdx = convIn->dialogs[dialogIdx].text_line_index;
+
+		if (textLineIdx < 0) {
+			// Dialog entry has no associated text — report and skip.
+			error_report(ERROR_CONV_NO_TEXT_LINE, ERROR, MODULE_CONV, dialogIdx, textLineIdx);
+			continue;
+		}
+
+		inter_add_dialog(const_cast<char *>(conv_string(convIn, textLineIdx)), dialogIdx);
+	}
+
+	kernel_set_interface_mode(INTER_CONVERSATION);
+	player.commands_allowed = true;
+	return 2;
+}
+
+static void conv_handle_cmd123(int cmd) {
+	ConvScriptParams params;
+	conv_param_load(&params);
+	int value = conv_param_evaluate(&params);
+	int numFlags = conv_get_script_byte();
+
+	for (int i = 0; i < numFlags; ++i) {
+		int entryIndex = conv_get_script_word();
+		if (value)
+			conv_flag_entry(cmd, entryIndex);
+	}
+}
+
+static void conv_message(int cmd) {
+	ConvScriptParams params;
+	conv_param_load(&params);
+	int value = conv_param_evaluate(&params);
+	int count1 = conv_get_script_byte();
+	int count2 = conv_get_script_byte();
+	int total = 0;
+	int val1 = 0;
+	int array1[10], array2[10], array3[10];
+
+	for (int i = 0; i < count1; ++i) {
+		val1 = conv_get_script_byte();
+		if (i < 10) {
+			array1[i] = val1;
+			total += val1;
+		}
+	}
+
+	for (int i = 0; i < count1; ++i) {
+		val1 = conv_get_script_word();
+		if (i < 10)
+			array2[i] = val1;
+	}
+
+	for (int i = 0; i < count2; ++i) {
+		val1 = conv_get_script_word();
+		if (i < 10)
+			array3[i] = val1;
+	}
+
+	if (!value)
+		return;
+
+	// Weighted random selection: pick one of the count1 choices using the
+	// byte weights in array1.  randomIndex starts at -1 and is incremented
+	// before each subtraction so that the first iteration checks array1[0].
+	// The loop exits (jg / jump-if-greater) when randomVal drops to <= 0,
+	// leaving randomIndex pointing at the selected entry.
+	int randomVal   = imath_random(1, total);
+	int randomIndex = -1;
+	do {
+		++randomIndex;
+		randomVal -= array1[randomIndex];
+	} while (randomVal > 0);
+
+	int entryVal = array2[randomIndex];
+
+	if (cmd == 4) {
+		// Player/"you" line
+		if (active_conv_data->messageList2Size < 10)
+			active_conv_data->messageList2[active_conv_data->messageList2Size++] = (int16)entryVal;
+
+		if (count1 > 1) {
+			// Multiple weighted choices: append only the matching data entry
+			if (randomIndex < count2 && active_conv_data->speechList2Size < 10)
+				active_conv_data->speechList2[active_conv_data->speechList2Size++] = (int16)array3[randomIndex];
+		} else {
+			// Single choice: append every data entry from array3
+			for (int i = 0; i < count2; ++i) {
+				if (active_conv_data->speechList2Size < 10)
+					active_conv_data->speechList2[active_conv_data->speechList2Size++] = (int16)array3[i];
+			}
+		}
+	} else {
+		// NPC/"me" line
+		if (active_conv_data->messageList1Size < 10)
+			active_conv_data->messageList1[active_conv_data->messageList1Size++] = (int16)entryVal;
+
+		if (count1 > 1) {
+			// Multiple weighted choices: append only the matching speech entry
+			if (randomIndex < count2 && active_conv_data->speechList1Size < 10)
+				active_conv_data->speechList1[active_conv_data->speechList1Size++] = (int16)array3[randomIndex];
+		} else {
+			// Single choice: append every speech entry from array3
+			for (int i = 0; i < count2; ++i) {
+				if (active_conv_data->speechList1Size < 10)
+					active_conv_data->speechList1[active_conv_data->speechList1Size++] = (int16)array3[i];
+			}
+		}
+	}
+}
+
+static int conv_cmd_node() {
+	ConvScriptParams params1, params2, params3;
+	int result = 0;
+	conv_param_load(&params1);
+	conv_param_load(&params2);
+	conv_param_load(&params3);
+
+	if (conv_param_evaluate(&params1)) {
+		int val2 = conv_param_evaluate(&params2);
+		int val3 = conv_param_evaluate(&params3);
+
+		*conv_vars0ValPtr = val2;
+		if (val2 >= 0)
+			*conv_my_next_start = val2;
+		else if (val3 >= 0)
+			*conv_my_next_start = val3;
+
+		result = -1;
+	}
+
+	return result;
+}
+
+static void conv_cmd_assign() {
+	ConvScriptParams params1, params2;
+	conv_param_load(&params1);
+	conv_param_load(&params2);
+	int varIndex = conv_get_script_word();
+
+	if (conv_param_evaluate(&params1)) {
+		int val = conv_param_evaluate(&params2);
+		int16 *varPtr = conv_get_variable(varIndex);
+		*varPtr = val;
+	}
+}
+
+static void conv_cmd_goto() {
+	ConvScriptParams params1;
+	conv_param_load(&params1);
+	int newOffset = conv_get_script_word();
+
+	if (conv_param_evaluate(&params1))
+		conv_dlg_script_ptr = newOffset;
+}
+
+// ---------------------------------------------------------------------------
+// conv_execute_entry
+//
+// Executes the byte-code script attached to dialog entry 'index' within the
+// active conversation.  The script is consumed as a stream of command bytes,
+// each optionally followed by parameters read via the conv_get_script_*
+// helpers.  Command byte values:
+//
+//   0         — no-op (continue to next command)
+//   1, 2, 3  — flag/show/hide entry           → conv_handle_cmd123(cmd)
+//   4, 5     — NPC/player message             → conv_message(cmd)
+//   6        — invalid command (error)
+//   7        — conditional node jump          → conv_cmd_node()
+//   8        — conditional script goto        → conv_cmd_goto()
+//   9        — conditional variable assign    → conv_cmd_assign()
+//   >9       — invalid (same error path as 6)
+//
+// Execution continues until the script pointer advances past the end of the
+// script block, or until conv_cmd_node() signals "done" by returning
+// non-zero (which sets flag → 0 → loop exit).
+//
+// Returns *conv_vars0ValPtr: set to -1 when the script ran to natural
+// completion; left at whatever conv_cmd_node() wrote there when a node
+// jump caused an early exit.
+// ---------------------------------------------------------------------------
+static int16 conv_execute_entry(int index) {
+	// Point the script stream at this dialog entry's byte-code block.
+	ConvDialog &dlg     = active_conv->dialogs[index];
+	conv_dlg_script_ptr = dlg.script_offset;
+	conv_dlg_script_end = dlg.script_offset + dlg.script_size;
+
+	// Reset per-execution message lists.
+	active_conv_data->messageList1Size = 0;
+	active_conv_data->messageList2Size = 0;
+	active_conv_data->speechList1Size    = 0;
+	active_conv_data->speechList2Size = 0;
+
+	// Restore the current node pointer from the saved "next start" slot.
+	*conv_vars0ValPtr = *conv_my_next_start;
+
+	// flag: -1 = keep looping; 0 = early exit requested by cmd7.
+	int16 flag = -1;
+
+	for (;;) {
+		// Exit when the script pointer has advanced past the end of the block
+		// (matches: cmp conv_dlg_script_end, ax; jnb; else jmp exit).
+		if (conv_dlg_script_ptr > conv_dlg_script_end)
+			break;
+
+		int commandId = (uint8)conv_get_script_byte();
+
+		if (commandId > 9) {
+			// Unknown command — non-fatal error; loop will naturally exhaust
+			// the script or hit a real end.
+			error_report(-50, ERROR, MODULE_CONV, conv_dlg_script_ptr, commandId);
+		} else {
+			switch (commandId) {
+			case 0:
+				// No-op: read next command.
+				break;
+			case 1:
+			case 2:
+			case 3:
+				conv_handle_cmd123(commandId);
+				break;
+			case 4:
+			case 5:
+				conv_message(commandId);
+				break;
+			case 6:
+				error_report(-50, ERROR, MODULE_CONV, conv_dlg_script_ptr, commandId);
+				break;
+			case 7:
+				// conv_cmd_node returns non-zero when a node jump was taken
+				// (signal done → flag=0 → exit loop); 0 means no jump taken
+				// (flag=1 → continue).
+				// Matches: cmp ax,1; sbb ax,ax; neg ax
+				flag = conv_cmd_node() ? 0 : 1;
+				break;
+			case 8:
+				conv_cmd_goto();
+				break;
+			case 9:
+				conv_cmd_assign();
+				break;
+			}
+		}
+
+		// Exit early if a command set flag to 0.
+		if (flag == 0)
+			break;
+	}
+
+	// Natural completion (flag still non-zero): mark node as finished.
+	// Early exit (flag == 0): conv_cmd_node already wrote the new target node.
+	if (flag != 0)
+		*conv_vars0ValPtr = -1;
+
+	return *conv_vars0ValPtr;
+}
+
+// ====================================================================
+// Public API
+// ====================================================================
+
+void conv_system_init() {
+	Common::fill((byte *)&conv_control, (byte *)&conv_control + sizeof(ConvControl), 0);
+	conv_control.running = -1;
+
+	Common::fill(conv_indexes, conv_indexes + CONV_MAX_SLOTS, 0);
+	Common::fill(conv_slots, conv_slots + CONV_MAX_DATA, false);
+	Common::fill(conv, conv + CONV_MAX_DATA, (Conv *)nullptr);
+	Common::fill(conv_data, conv_data + CONV_MAX_DATA, (ConvData *)nullptr);
+
+	savedConv = new Common::HashMap<Common::String, MemoryWriteStreamDynamic,
+		Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>();
+}
+
+void conv_system_cleanup() {
+	delete savedConv;
+}
+
+
+void conv_start(ConvData *convData, Conv *convIn) {
+	active_conv      = convIn;
+	active_conv_data = convData;
+
+	// Resolve the byte-offset sub-array pointers stored in the ConvData block
+	conv_imports = convData->imports.empty() ? nullptr : &convData->imports[0];
+	conv_entry_flags = convData->entryFlags.empty() ? nullptr : & convData->entryFlags[0];
+	conv_varsDataPtr = &convData->variables[0];
+
+	// conv_vars0ValPtr -> variables[0].val (skips the isPtr field)
+	conv_vars0ValPtr   = &conv_varsDataPtr[0].val;
+
+	// conv_my_next_start -> variables[1].val
+	// (offset = offsetof(ConvVariable, val) + sizeof(ConvVariable) from base)
+	conv_my_next_start = &conv_varsDataPtr[1].val;
+
+	convData->currentNode = -1;
+	convData->numImports  = 0;
+
+	// Initialise variables[0].val from variables[1].val
+	*conv_vars0ValPtr = (int16)*conv_my_next_start;
+}
+
+void conv_get(int convNum) {
+	char fname[40];
+	int free_slot = -1;
+	int error_occurred = -1;
+	int stage_error   = 0;	// which stage failed (1/2/3); used as data2 in error_report
+
+	// Find first free slot (stops as soon as one is found, matching original loop)
+	for (int i = 0; i < CONV_MAX_DATA; ++i) {
+		if (!conv_slots[i]) {
+			free_slot = i;
+			break;
+		}
+	}
+
+	if (free_slot < 0) {
+		stage_error = 1;
+		goto report;
+	}
+
+	conv_slots[free_slot] = true;
+
+	conv[free_slot] = load_conv(conv_get_filename(convNum, 0, fname));
+	if (!conv[free_slot]) {
+		stage_error = 2;
+		goto report;
+	}
+
+	conv_data[free_slot] = conv_get_data(convNum);
+	if (!conv_data[free_slot]) {
+		stage_error = 3;
+		goto report;
+	}
+
+	// Encode slot as (free_slot + 2) so that 0 means "not loaded"
+	conv_indexes[convNum] = free_slot + 2;
+	error_occurred = 0;
+
+report:
+	if (error_occurred)
+		error_report(ERROR_CONV_GET, ERROR, MODULE_CONV, convNum, stage_error);
+}
+
+void conv_run(int convId) {
+	char name[80];
+	int idx;
+
+	conv_show_boxes = true;
+
+	// Validate convId is loaded (non-fatal: report error but continue, matching original)
+	if (conv_indexes[convId] < 2)
+		error_report(ERROR_CONV_RUN, ERROR, MODULE_CONV, convId, 0);
+
+	// Stop any conversation already in progress
+	if (conv_control.running >= 0)
+		conv_abort();
+
+	conv_control.running          = convId;
+	conv_control.index            = conv_indexes[convId] - 2;
+	conv_control.status           = CONV_STATUS_NEXT_NODE;
+	conv_control.popup_duration   = 0x7FFF;			// Display for a long time
+	conv_control.popup_clock      = kernel.clock;
+	conv_control.entry            = -1;
+	conv_control.commands_allowed = player.commands_allowed;
+	conv_control.input_mode       = inter_input_mode;
+	conv_control.popup_is_up      = 0;
+	conv_control.me_trigger       = 0;
+	conv_control.you_trigger      = 0;
+
+	// Initialise per-speaker slots.
+	// speaker_val and person_speaking are written inside the loop in the original
+	// (compiler artefact from an unrolled version); preserved here for fidelity.
+	for (idx = 0; idx < CONV_MAX_DATA; ++idx) {
+		conv_control.speaker_active[idx] = 0;
+		conv_control.speaker_series[idx] = -1;
+		conv_control.speaker_frame[idx]  = 1;
+		conv_control.x[idx]              = (int16)0x8000;
+		conv_control.y[idx]              = (int16)0x8000;
+		conv_control.width[idx]          = 30;
+		conv_control.speaker_val         = 1;
+		conv_control.person_speaking     = 1;
+	}
+
+	int slot = conv_control.index;
+	conv_start(conv_data[slot], conv[slot]);
+
+	// Bind conv variables 2–22 to live ConvControl fields.
+	// Variable 2 maps to speaker_val (not contiguous with the arrays below).
+	// Variables 3–22 map to speaker_frame[5], x[5], y[5], width[5] in turn.
+	conv_set_variable(2, &conv_control.speaker_val);
+
+	int16 *const fieldArrays[] = {
+		conv_control.speaker_frame, conv_control.x, conv_control.y, conv_control.width
+	};
+
+	int varIdx = 3;
+	for (int16 *field : fieldArrays) {
+		for (int j = 0; j < CONV_MAX_DATA; ++j)
+			conv_set_variable(varIdx++, &field[j]);
+	}
+
+	// Load speaker portrait series for each declared speaker
+	for (idx = 0; idx < conv[slot]->speaker_count; ++idx) {
+		Common::strcpy_s(name, conv[slot]->speaker_portraits[idx]);
+		int series = kernel_load_series(name, 0x4000);
+		conv_control.speaker_series[idx] = series;
+		if (series > 0) {
+			conv_control.speaker_active[idx] = -1;
+			conv_control.speaker_frame[idx]  = conv[slot]->speaker_frame[idx];
+		}
+	}
+
+	if (kernel_mode == KERNEL_ACTIVE_CODE)
+		kernel_new_palette();
+
+	player.commands_allowed = 0;
+
+	if (g_engine->getGameID() == GType_Dragonsphere) {
+		kernel_init_dialog();
+		kernel_set_interface_mode(INTER_CONVERSATION);
+	}
+}
+
+// ---------------------------------------------------------------------------
+// conv_generate_message
+//
+// Generates and displays a conversation message popup for either the NPC
+// ("me") or player ("you") side, drawing from message and voice/data index
+// lists that conv_execute_entry populated.
+//
+// Parameters (DOS push order — rightmost pushed first):
+//   convIn        — active Conv
+//   convData      — active ConvData
+//   msgList       — array of dialog text indices  (messageList1 or messageList2)
+//   msgListSize   — number of valid entries in msgList  (in ax)
+//   voiceList     — array of speech/data indices (speechList1 or speechList2)
+//   voiceListSize — number of valid entries in voiceList (in dx)
+// ---------------------------------------------------------------------------
+static void conv_generate_message(Conv *convIn, ConvData *convData,
+		int16 *msgList, int msgListSize, int16 *voiceList, int voiceListSize) {
+	Box *priorBox = box;
+	box = &conv_box;
+	conv_control.has_text = 0;
+	int personSpeaking;
+	int messageId;
+	int lineStart, lineCount;
+	char tempString[256];
+	bool showBox = conv_show_boxes;
+
+	conv_control.has_text = false;
+	if (msgListSize == 0)
+		goto done;
+
+	if (showBox) {
+		// Create the popup
+		personSpeaking = conv_control.person_speaking;
+		if (popup_create(popup_estimate_pieces(conv_control.width[personSpeaking]),
+			conv_control.x[personSpeaking], conv_control.y[personSpeaking]))
+			goto done;
+
+		if (conv_control.speaker_series[personSpeaking] >= 0) {
+			popup_add_icon(series_list[conv_control.speaker_series[personSpeaking]],
+				conv_control.speaker_frame[personSpeaking], 0);
+		}
+
+		for (int msgIndex = 0; msgIndex < msgListSize; ++msgIndex) {
+			messageId = msgList[msgIndex];
+			lineStart = convIn->messages[messageId].lineStart;
+			lineCount = convIn->messages[messageId].lineCount;
+
+			for (int lineCtr = 0; lineCtr < lineCount; ++lineCtr) {
+				Common::strcpy_s(tempString, conv_string(convIn, lineStart + lineCtr));
+				string_trim(tempString);
+				popup_write_string(tempString);
+			}
+		}
+
+		popup_next_line();
+		if (popup_draw(-1, -1))
+			goto done;
+	}
+
+	// Record that a conversation popup is live.
+	conv_control.popup_is_up = -1;
+
+	// Play the associated speech audio when the speech system is on.
+	if (speech_system_active && speech_on && voiceListSize > 0) {
+		speech_play(convIn->speech_file, voiceList[0]);
+	}
+
+	if (showBox)
+		conv_control.popup_clock = kernel.clock + conv_control.popup_duration;
+	else
+		// TODO: If speech is allowed with no box showing, this needs to allow time for the speech duration
+		conv_control.popup_clock = kernel.clock;
+
+done:
+	box = priorBox;
+}
+
+// ---------------------------------------------------------------------------
+// conv_update
+//
+// Main per-tick conversation state machine.  Called once per game tick while
+// a conversation is running.  The 'flag' parameter indicates whether the
+// engine has a pending player command ready (mirrors player.command_ready in
+// the callers for modes 1 and 2).
+//
+// Status dispatch table (off_2D438):
+//   0  (NEXT_NODE)   — advance to next node or build player menu
+//   1  (WAIT_AUTO)   — wait for auto-trigger then advance to EXECUTE
+//   2  (WAIT_ENTRY)  — player chose an option; execute it + show NPC portrait
+//   3  (EXECUTE)     — (clock-gated) execute entry script + show NPC message
+//   4  (REPLY)       — (clock-gated) show player reply message
+//   5–9              — no-op (exit)
+//   10 (DONE)        — call conv_abort
+//   >10              — no-op (exit)
+// ---------------------------------------------------------------------------
+void conv_update(bool flag) {
+	if (conv_control.running < 0)
+		return;
+
+	int slot = conv_control.index;
+	Conv     *my_conv      = conv[slot];
+	ConvData *my_conv_data = conv_data[slot];
+
+	switch (conv_control.status) {
+
+	// ------------------------------------------------------------------
+	// Mode 0 — NEXT_NODE
+	// ------------------------------------------------------------------
+	case CONV_STATUS_NEXT_NODE: {
+		if (*conv_vars0ValPtr < 0) {
+			// Node is exhausted — wait for the popup clock then clean up.
+			if (kernel.clock < conv_control.popup_clock)
+				return;
+
+			conv_purge_any_popup();
+
+			if (conv_control.me_trigger) {
+				player_verb            = conv_control.entry;
+				kernel.trigger         = conv_control.me_trigger;
+				kernel.trigger_mode    = conv_control.me_trigger_mode;
+				conv_control.me_trigger = 0;
+			}
+
+			conv_control.status = CONV_STATUS_DONE;
+			return;
+		}
+
+		// Advance to the next node in the script.
+		int var_4 = conv_next_node();
+		conv_control.node = *conv_vars0ValPtr;
+
+		if (!var_4) {
+			// Node is a player-choice menu node.
+			conv_control.status = (ConvStatus)conv_generate_menu(my_conv_data, my_conv);
+			return;
+		}
+
+		// Node is an auto-play NPC node: pick the first dialog entry and
+		// fire a synthetic player command so mode 1 can advance to EXECUTE.
+		int16 nodeIndex       = *conv_vars0ValPtr;
+		conv_control.entry    = my_conv->nodes[nodeIndex].index;
+		conv_control.status   = CONV_STATUS_WAIT_AUTO;
+		player_verb           = conv_control.entry;
+		player.command_ready  = -1;
+		player.command_error  = 0;
+		return;
+	}
+
+	// ------------------------------------------------------------------
+	// Mode 10 — DONE: conversation finished, tear everything down.
+	// ------------------------------------------------------------------
+	case CONV_STATUS_DONE:
+		conv_abort();
+		return;
+
+	// ------------------------------------------------------------------
+	// Mode 1 — WAIT_AUTO: waiting for the synthetic command to fire.
+	// ------------------------------------------------------------------
+	case CONV_STATUS_WAIT_AUTO:
+		if (!flag)
+			return;
+		conv_control.status = CONV_STATUS_EXECUTE;
+		return;
+
+	// ------------------------------------------------------------------
+	// Mode 2 — WAIT_ENTRY: player has chosen a dialog option.
+	// ------------------------------------------------------------------
+	case CONV_STATUS_WAIT_ENTRY: {
+		if (!flag)
+			return;
+
+		player.commands_allowed = 0;
+		conv_control.entry      = player_verb;
+
+		// Auto-hide the entry unless it is flagged as always-visible (bit 1).
+		if (!(active_conv_data->entryFlags[conv_control.entry] & 2))
+			conv_flag_entry(2, conv_control.entry);
+
+		conv_purge_any_popup();
+		kernel_init_dialog();
+		kernel_set_interface_mode(INTER_CONVERSATION);
+		conv_control.person_speaking = 0;
+
+		conv_execute_entry(conv_control.entry);
+
+		// If the dialog has a dedicated speech index, override the speech list
+		// with that single index (takes priority over anything conv_execute_entry
+		// populated via conv_message).
+		int16 speech_idx = my_conv->dialogs[conv_control.entry].speech_index;
+		if (speech_idx) {
+			my_conv_data->speechList1[0] = speech_idx;
+			my_conv_data->speechList1Size = 1;
+		}
+
+		conv_generate_text(my_conv, my_conv_data,
+			my_conv->dialogs[conv_control.entry].text_line_index,
+			my_conv_data->speechList1, my_conv_data->speechList1Size);
+
+		conv_control.status = CONV_STATUS_REPLY;
+
+		if (conv_control.me_trigger) {
+			player_verb            = conv_control.entry;
+			kernel.trigger         = conv_control.me_trigger;
+			kernel.trigger_mode    = conv_control.me_trigger_mode;
+			conv_control.me_trigger = 0;
+			return;
+		}
+		return;
+	}
+
+	// ------------------------------------------------------------------
+	// Mode 3 — EXECUTE: execute the NPC entry's script and show message.
+	// ------------------------------------------------------------------
+	case CONV_STATUS_EXECUTE: {
+		if (kernel.clock < conv_control.popup_clock)
+			return;
+
+		conv_purge_any_popup();
+		conv_control.person_speaking = 0;
+
+		conv_execute_entry(conv_control.entry);
+
+		conv_generate_message(my_conv, my_conv_data,
+			my_conv_data->messageList1, my_conv_data->messageList1Size,
+			my_conv_data->speechList1, my_conv_data->speechList1Size);
+
+		// Fire me_trigger if one is pending and a popup is visible.
+		if (conv_control.me_trigger && conv_control.popup_is_up) {
+			player_verb            = conv_control.entry;
+			kernel.trigger         = conv_control.me_trigger;
+			kernel.trigger_mode    = conv_control.me_trigger_mode;
+			conv_control.me_trigger = 0;
+		}
+
+		conv_control.status = CONV_STATUS_REPLY;
+		return;
+	}
+
+	// ------------------------------------------------------------------
+	// Mode 4 — REPLY: show the player's reply message.
+	// ------------------------------------------------------------------
+	case CONV_STATUS_REPLY: {
+		if (kernel.clock < conv_control.popup_clock)
+			return;
+
+		conv_purge_any_popup();
+		conv_control.person_speaking = conv_control.speaker_val;
+
+		conv_generate_message(my_conv, my_conv_data,
+			my_conv_data->messageList2, my_conv_data->messageList2Size,
+			my_conv_data->speechList2, my_conv_data->speechList2Size);
+
+		conv_control.status = CONV_STATUS_NEXT_NODE;
+
+		if (conv_control.you_trigger && conv_control.popup_is_up) {
+			player_verb             = conv_control.entry;
+			kernel.trigger          = conv_control.you_trigger;
+			kernel.trigger_mode     = conv_control.you_trigger_mode;
+			conv_control.you_trigger = 0;
+			return;
+		}
+		return;
+	}
+
+	default:
+		// Statuses 5–9 and anything above 10: no-op.
+		return;
+	}
+}
+
+void conv_regenerate_last_message() {
+	if (conv_control.running && conv_control.popup_is_up) {
+		Conv &c = *conv[conv_control.index];
+		ConvData &cd = *conv_data[conv_control.index];
+
+		conv_purge_any_popup();
+
+		if (conv_control.has_text) {
+			conv_generate_text(&c, &cd, c.dialogs[conv_control.entry].text_line_index,
+				cd.speechList1, cd.speechList1Size);
+		} else if (conv_control.person_speaking) {
+			conv_generate_message(&c, &cd, cd.messageList2, cd.messageList2Size,
+				cd.speechList2, cd.speechList2Size);
+		} else {
+
+		}
+	}
+}
+
+void conv_export_pointer(int16 *ptr) {
+	if (conv_control.running) {
+		Conv &c = *conv[conv_control.index];
+		ConvData &cd = *conv_data[conv_control.index];
+
+		if (cd.numImports < c.max_imports) {
+			int idx = conv_imports[cd.numImports++];
+			conv_set_variable(idx, ptr);
+		}
+	}
+}
+
+void conv_abort() {
+	if (conv_control.running >= 0) {
+		if (kernel_mode == KERNEL_ACTIVE_CODE)
+			player.commands_allowed = conv_control.commands_allowed;
+
+		conv_control.running = -1;
+		conv_purge_any_popup();
+
+		for (int i = conv[conv_control.index]->speaker_count - 1; i >= 0; --i) {
+			if (conv_control.speaker_active[i])
+				matte_deallocate_series(conv_control.speaker_series[i], -1);
+		}
+
+		if (conv_control.input_mode == INTER_CONVERSATION)
+			kernel_init_dialog();
+
+		kernel_set_interface_mode(conv_control.input_mode);
+	}
+}
+
+void conv_me_trigger(int trigger) {
+	conv_control.me_trigger = trigger;
+	conv_control.me_trigger_mode = kernel.trigger_setup_mode;
+}
+
+void conv_you_trigger(int trigger) {
+	conv_control.you_trigger = trigger;
+	conv_control.you_trigger_mode = kernel.trigger_setup_mode;
+}
+
+int16 *conv_get_variable(int varNum) {
+	assert(varNum >= 0 && varNum < active_conv_data->variablesCount);
+	ConvVariable &var = active_conv_data->variables[varNum];
+
+	return var.isPtr ? var.ptr : &var.val;
+}
+
+void conv_export_value(int16 value) {
+	if (conv_control.running >= 0) {
+		Conv &c = *conv[conv_control.index];
+		ConvData &cd = *conv_data[conv_control.index];
+
+		if (cd.numImports < c.max_imports) {
+			int idx = conv_imports[cd.numImports++];
+			conv_set_variable(idx, value);
+		}
+	}
+}
+
+void conv_hold() {
+	if (conv_control.status != CONV_STATUS_HOLDING) {
+		conv_control.hold_status = conv_control.status;
+		conv_control.status = CONV_STATUS_HOLDING;
+	}
+}
+
+void conv_release() {
+	if (conv_control.status == CONV_STATUS_HOLDING) {
+		conv_control.status = conv_control.hold_status;
+
+		if (conv_control.status == CONV_STATUS_WAIT_AUTO ||
+			conv_control.status == CONV_STATUS_WAIT_ENTRY)
+			conv_update(true);
+	}
+}
+
+void conv_flush() {
+	bool errorFlag = true;
+	int errCode = 0;
+	Common::WriteStream *dest;
+	int i;
+
+	for (i = 0; i < CONV_MAX_SLOTS; ++i) {
+		if (conv_indexes[i] >= 2) {
+			dest = conv_open_write(i);
+			if (!dest)
+				goto done;
+
+			ConvData *convData = conv_data[conv_indexes[i] - 2];
+			errCode = conv_write(dest, convData);
+			if (errCode) goto done;
+
+			conv_indexes[i] = 1;
+		}
+	}
+
+	for (i = CONV_MAX_DATA - 1; i >= 0; --i) {
+		if (conv_slots[i]) {
+			delete conv_data[i];
+			delete conv[i];
+			conv_data[i] = nullptr;
+			conv[i] = nullptr;
+			conv_slots[i] = false;
+		}
+	}
+
+	errorFlag = false;
+done:
+	if (errorFlag)
+		error("Error flushing conversation data");
+}
+
+void conv_reset(int id) {
+	// WORKAROUND: Only allowing freeing by slot within the allowed range
+	if (id < CONV_MAX_DATA && conv_slots[id]) {
+		mem_free(conv_data[id]);
+		mem_free(conv[id]);
+		conv_data[id] = nullptr;
+		conv[id] = nullptr;
+		conv_slots[id] = 0;
+	}
+
+	conv_indexes[id] = 0;
+}
+
+int conv_append(Common::WriteStream *handle) {
+	int count = 0;
+	int16 list[CONV_MAX_SLOTS];
+	ConvData *convData;
+	int convNum, convIndex;
+	int i, errCode;
+
+	// Generate a list of conv_indexes that are present
+	for (i = 0; i < CONV_MAX_SLOTS; ++i) {
+		if (conv_indexes[i])
+			list[count++] = i;
+	}
+
+	// Write out count and list
+	handle->writeUint16LE(count);
+	for (i = 0; i < count; ++i)
+		handle->writeSint16LE(list[i]);
+
+	for (i = 0; i < count; ++i) {
+		convNum = list[i];
+		convIndex = conv_indexes[convNum];
+
+		if (convIndex == 1) {
+			convData = conv_get_data(convNum);
+			if (!convData)
+				break;
+
+			errCode = conv_write(handle, convData);
+			delete convData;
+		} else {
+			convData = conv_data[convIndex - 2];
+			errCode = conv_write(handle, convData);
+		}
+
+		if (errCode)
+			break;
+	}
+
+	return 0;
+}
+
+int conv_expand(Common::SeekableReadStream *handle) {
+	int count;
+	int16 list[CONV_MAX_SLOTS];
+	ConvData *convData;
+
+	Common::fill(conv_indexes, conv_indexes + CONV_MAX_SLOTS, 0);
+
+	// Read count and list
+	count = handle->readUint16LE();
+	for (int i = 0; i < count; ++i)
+		list[i] = handle->readSint16LE();
+
+	for (int i = 0; i < count; ++i) {
+		int index = list[i];
+		conv_indexes[index] = 1;
+
+		// Open a temporary file for the conversation
+		Common::WriteStream *dest = conv_open_write(index);
+		if (!dest)
+			break;
+
+		// Read it's data from the savegame
+		convData = conv_read(handle);
+
+		// Write it out to the temporary file
+		bool success = false;
+		if (convData)
+			success = !conv_write(dest, convData);
+
+		if (!success) {
+			delete convData;
+			break;
+		}
+	}
+
+	return 0;
+}
+
+void init_conv() {
+	conv_system_cleanup();
+	active_conv = NULL;
+	active_conv_data = NULL;
+	conv_imports = NULL;
+	conv_entry_flags = NULL;
+	conv_varsDataPtr = NULL;
+	conv_vars0ValPtr = NULL;
+	conv_restore_running = -1;
+	Common::fill((byte *)&conv_control, (byte *)&conv_control + sizeof(ConvControl), 0);
+	conv_control.running = -1;
+	memset(&conv_box, 0, sizeof(Box));
+	conv_my_next_start = NULL;
+	conv_error_code = 0;
+	conv_dlg_script_ptr = 0;
+	conv_dlg_script_end = 0;
+	Common::fill(conv, conv + CONV_MAX_DATA, (Conv *)nullptr);
+	Common::fill(conv_data, conv_data + CONV_MAX_DATA, (ConvData *)nullptr);
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/madsv2/core/conv.h b/engines/mads/core/conv.h
similarity index 100%
rename from engines/mads/madsv2/core/conv.h
rename to engines/mads/core/conv.h
diff --git a/engines/mads/core/cursor.cpp b/engines/mads/core/cursor.cpp
new file mode 100644
index 00000000000..a3fae5d97fc
--- /dev/null
+++ b/engines/mads/core/cursor.cpp
@@ -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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/core/cursor.h"
+#include "mads/core/screen.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+int cursor_mode;             /* global cursor mode (insert/overwrite) */
+int cursor_follow = false;
+int text_x = 0, text_y = 0;
+
+void cursor_set_size(short start, short finish) {
+	// No implementation
+}
+
+void cursor_set_pos(short x, short y) {
+	// No implementation
+}
+
+void cursor_get_pos(int *x, int *y) {
+	*x = *y = 0;
+}
+
+void cursor_set_mode(int my_type) {
+	// No implementation
+}
+
+void cursor_toggle_insert() {
+	if (cursor_mode == CURSOR_OVERWRITE) {
+		cursor_set_mode(CURSOR_INSERT);
+	} else {
+		cursor_set_mode(CURSOR_OVERWRITE);
+	}
+}
+
+void cursor_set_follow(int follow) {
+	cursor_follow = follow;
+}
+
+void init_cursor() {
+	cursor_mode = 0;
+	cursor_follow = false;
+	text_x = 0;
+	text_y = 0;
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/cursor.h b/engines/mads/core/cursor.h
new file mode 100644
index 00000000000..fd9bf5a1258
--- /dev/null
+++ b/engines/mads/core/cursor.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_CURSOR_H
+#define MADS_CORE_CURSOR_H
+
+#include "mads/core/general.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+#define CURSOR_OFF                   0       /* Cursor off                     */
+#define CURSOR_ON                    1       /* Cursor on                      */
+#define CURSOR_INSERT                2       /* Cursor in insert mode          */
+#define CURSOR_OVERWRITE             3       /* Cursor in overwrite mode       */
+
+extern int cursor_mode;          /* global cursor insert mode flag */
+extern int cursor_follow;        /* global cursor follow flag      */
+
+/**
+ * Sets text cursor size
+ */
+extern void cursor_set_size(short start, short finish);
+
+/**
+ * Sets text cursor position
+ */
+extern void cursor_set_pos(short x, short y);
+
+extern void cursor_get_pos(int *x, int *y);
+extern void cursor_set_mode(int my_type);
+extern void cursor_toggle_insert();
+extern void cursor_set_follow(int follow);
+
+extern void init_cursor();
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/core/cycle.cpp b/engines/mads/core/cycle.cpp
new file mode 100644
index 00000000000..2cbb21ddebd
--- /dev/null
+++ b/engines/mads/core/cycle.cpp
@@ -0,0 +1,138 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mads/core/general.h"
+#include "mads/core/cycle.h"
+#include "mads/core/color.h"
+#include "mads/core/timer.h"
+#include "mads/core/mcga.h"
+#include "mads/core/pal.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+Palette cycling_palette;
+
+CycleList cycle_list;
+int cycling_active = false;
+int cycling_delay = 0;
+int cycling_threshold;
+int total_cycle_colors;
+
+long cycle_timing[COLOR_MAX_CYCLES];
+
+void cycle_init(CycleListPtr new_cycle_list, int activate) {
+	int count;
+	long current_time;
+
+	current_time = timer_read();
+	for (count = 0; count < COLOR_MAX_CYCLES; count++) {
+		cycle_timing[count] = current_time;
+	}
+
+	memcpy(&cycle_list, new_cycle_list, sizeof(CycleList));
+	memcpy(cycling_palette, master_palette, sizeof(Palette));
+
+	total_cycle_colors = 0;
+	for (count = 0; count < cycle_list.num_cycles; count++) {
+		total_cycle_colors += cycle_list.table[count].num_colors;
+		cycle_list.table[count].first_list_color = 0;
+	}
+
+	cycling_threshold = 3;
+	if (total_cycle_colors <= 16) cycling_threshold = 0;
+
+	cycling_active = activate;
+}
+
+void cycle_colors() {
+	int num;
+	int first;
+	int count;
+	int any_changes;
+	int mark;
+	long this_timing;
+
+	if (!cycling_active)
+		return;
+
+	cycling_delay++;
+	if (cycling_delay < cycling_threshold)
+		return;
+
+	if (mcga_palette_update)
+		return;
+
+	this_timing = timer_read();
+	any_changes = false;
+
+	for (count = 0; count < cycle_list.num_cycles; count++) {
+		if (this_timing >= (cycle_timing[count] + cycle_list.table[count].ticks)) {
+			cycle_timing[count] = this_timing;
+			num = cycle_list.table[count].num_colors;
+			first = cycle_list.table[count].first_palette_color;
+			mark = cycle_list.table[count].first_list_color;
+			any_changes = true;
+
+			if (num > 1) {
+				RGBcolor *base = &cycling_palette[first];
+				RGBcolor tmp;
+
+				// Save the last color
+				tmp = base[num - 1];
+
+				// Shift all colors forward by one
+				memmove(&base[1], &base[0], (num - 1) * sizeof(RGBcolor));
+
+				// Write saved last color into the first slot
+				base[0] = tmp;
+
+				// Advance and wrap the cycle position marker
+				mark++;
+				if (mark >= num)
+					mark = 0;
+			}
+
+			cycle_list.table[count].first_list_color = (byte)mark;
+		}
+	}
+
+	if (any_changes) {
+		mcga_setpal_range(&cycling_palette,
+			cycle_list.table[0].first_palette_color,
+			total_cycle_colors);
+	}
+
+	cycling_delay = 0;
+}
+
+void init_cycle() {
+	memset(&cycling_palette, 0, sizeof(Palette));
+	memset(&cycle_list, 0, sizeof(CycleList));
+	cycling_active = false;
+	cycling_delay = 0;
+	cycling_threshold = 0;
+	total_cycle_colors = 0;
+	memset(cycle_timing, 0, sizeof(cycle_timing));
+}
+
+} // namespace MADSV2
+} // namespace MADS
diff --git a/engines/mads/core/cycle.h b/engines/mads/core/cycle.h
new file mode 100644
index 00000000000..cc9a4251851
--- /dev/null
+++ b/engines/mads/core/cycle.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MADS_CORE_CYCLE_H
+#define MADS_CORE_CYCLE_H
+
+#include "mads/core/color.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+extern Palette cycling_palette;         /* Palette being used for cycling */
+
+extern CycleList cycle_list;            /* List of cycles being performed */
+extern int cycling_active;              /* Flag if cycling active         */
+extern int cycling_delay;               /* Cycling delay countdown        */
+extern int cycling_threshold;           /* Cycling reset threshold        */
+extern int total_cycle_colors;          /* Total # of colors being cycled */
+
+extern long cycle_timing[COLOR_MAX_CYCLES];     /* Timing for each cycle  */
+
+void cycle_init(CycleListPtr new_cycle_list, int activate);
+void cycle_colors();
+
+extern void init_cycle();
+
+} // namespace MADSV2
+} // namespace MADS
+
+#endif
diff --git a/engines/mads/core/dialog.cpp b/engines/mads/core/dialog.cpp
new file mode 100644
index 00000000000..331511e354c
--- /dev/null
+++ b/engines/mads/core/dialog.cpp
@@ -0,0 +1,3344 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "mads/core/dialog.h"
+#include "mads/core/fileio.h"
+#include "mads/core/mouse.h"
+#include "mads/core/screen.h"
+#include "mads/core/cursor.h"
+#include "mads/core/window.h"
+#include "mads/core/keys.h"
+#include "mads/core/mem.h"
+#include "mads/core/timer.h"
+
+namespace MADS {
+namespace MADSV2 {
+
+
+/* public global variables */
+
+int dialog_error;
+bool dialog_quicksearch_flag = true;
+bool dialog_wildcard_exits = false;
+
+/* private global variables */
+
+static int mouse_stroke_type;           /* Where the stroke originated    */
+static int mouse_orig_stroke_type;      /* First radio button pressed     */
+static int mouse_override;              /* Override repeat damper         */
+static int stroke_going;                /* Currently processing a stroke  */
+static int resolved_mouse;              /* Have resolved stroke this pass */
+static ItemPtr mouse_scroll_item;       /* Recent mouse item              */
+static ListPtr mouse_scroll_list;       /* Recent mouse list              */
+static char temp_buf[80];               /* A convenient buffer            */
+
+static MouseCallback mouse_callback;	/* Mouse callback vector          */
+static int mouse_callback_double_only;  /* Mouse callback double only flag*/
+
+/* Page callback vector           */
+static PageCallback page_callback;
+
+static int allow_list_callbacks;        /* Flag if list callbacks allowed */
+
+static int dialog_default_normal = DD_DEFAULT_NORMAL_COLOR;
+static int dialog_default_select = DD_DEFAULT_SELECT_COLOR;
+static int dialog_default_hilite = DD_DEFAULT_HILITE_COLOR;
+static int dialog_default_greyed = DD_DEFAULT_GREYED_COLOR;
+
+static long dialog_string_space = DIALOG_DEFAULT_STRING_SPACE;
+
+long dialog_timeout = 0;
+
+int dialog_language = DIALOG_ENGLISH;
+
+#define ATTR_DIR        10h             /* Attribute for subdirectory */
+#define DTA_ATTR        15h             /* offset in DTA of attribute */
+#define DTA_NAME        1eh             /* offset in DTA of filename  */
+
+int alert_normal_color = DD_DEFAULT_NORMAL_COLOR;
+int alert_select_color = DD_DEFAULT_SELECT_COLOR;
+int alert_hilite_color = DD_DEFAULT_HILITE_COLOR;
+
+#define SAY_DIALOG_SIZE 1024
+
+static Dialog say_dialog_box;
+static DialogPtr say_dialog = &say_dialog_box;
+static char say_dialog_work[SAY_DIALOG_SIZE];
+
+#define write_flag      0x01
+#define error_mask      0x06
+#define fail_flag       0x08
+#define retry_flag      0x10
+#define ignore_flag     0x20
+
+#define ignore_option   0x00
+#define retry_option    0x01
+#define abort_option    0x02
+#define fail_option     0x03
+
+
+int dialog_read_dir_to_list(ListPtr target, const char *wild, int dirflag) {
+	warning("TODO: dialog_read_dir_to_list");
+	target->elements = 0;
+	return 0;
+}
+
+/**
+ * Appends a list of valid drive letters to the end of the specified
+ * list structure.  This is done by attempting to "change drive" to
+ * each drive letter beginning with "A", and stopping when an attempt fails.
+ *
+ * @param dirslist		Directory list structure
+ */
+static void dialog_read_drives_to_list(ListPtr dirslist) {
+	char *myptr;
+
+	myptr = dirslist->list + (dirslist->elements * dirslist->element_offset);
+	Common::strcpy_s(myptr, 4, "C:\\");
+	dirslist->elements++;
+}
+
+/**
+ * Loads directory (and subdirectory list w/ drives) for a filename item
+ *
+ * @param dialog	Dialog
+ * @param item		Filename item
+ */
+static void dialog_load_directory(DialogPtr dialog, ItemPtr item) {
+	ItemPtr fileitem, dirsitem;
+	ListPtr filelist, dirslist;
+
+	// Get our file list item and dirs list item
+	fileitem = &dialog->item[item->status];
+	dirsitem = &dialog->item[fileitem->id + 1];
+
+	// Get the associated list structures
+	filelist = &dialog->lists[fileitem->buf_id];
+	dirslist = &dialog->lists[dirsitem->buf_id];
+
+	filelist->elements = 0;
+	dirslist->elements = 0;
+
+	// Try to read them in
+	dialog_read_dir_to_list(dirslist, "*.*", true);
+	dialog_read_dir_to_list(filelist, dialog->buffer[item->buf_id], false);
+
+	dialog_read_drives_to_list(dirslist);
+
+	// Reset window cursors
+	filelist->base_entry = 0;
+	dirslist->base_entry = 0;
+
+	filelist->picked_entry = -1;
+	dirslist->picked_entry = -1;
+}
+
+/**
+ * Item to determine the proper X and Y values for an item based
+ * on the X and Y values passed by the user (handles the various
+ * special codes).
+ *
+ * @param dialog	Dialog
+ * @param item		Filename item
+ * @param x			X position
+ * @param y			Y position
+ */
+static void item_locate(DialogPtr dialog, ItemPtr item, int x, int y) {
+	switch (x) {
+	case DD_IX_CENTER:
+		x = 0;
+		break;
+
+	case DD_IX_LEFT:
+		if (y == DD_IY_BUTTON) {
+			x = dialog->button_left;
+			dialog->button_left += item->width + 1;
+		} else {
+			x = 1;
+		}
+		break;
+
+	case DD_IX_RIGHT:
+		if (y == DD_IY_BUTTON) {
+			x = dialog->button_right - (item->width + 1);
+			dialog->button_right = x;
+		} else {
+			x = 0 - (item->width + 1);
+		}
+		break;
+	}
+
+	switch (y) {
+	case DD_IY_AUTOFILL:
+		y = dialog->fill_marker++;
+		break;
+
+	default:
+		if (y >= dialog->fill_marker) {
+			dialog->fill_marker = y + 1;
+		}
+		break;
+	}
+
+	item->x = x;
+	item->y = y;
+}
+
+/**
+ * Attempts to allocate a new item handle from the dialog box's
+ * item array. Returns NULL if fails.
+ *
+ * @param dialog	Dialog	Dialog
+ * @param item_type		Item type
+ * @return	New item
+ */
+static ItemPtr item_allocate(DialogPtr dialog, int item_type) {
+	ItemPtr item;
+
+	if (dialog->num_items < DIALOG_MAX_ITEM) {
+		item = &dialog->item[dialog->num_items];
+		item->type = item_type;
+		item->id = (dialog->num_items++);
+		return item;
+	} else {
+		dialog_error = DD_ERR_NOMOREITEMS;
+		return NULL;
+	}
+}
+
+static char *string_allocate(DialogPtr dialog, int length) {
+	char *result = NULL;
+
+	if (dialog->string_space_remaining < (length + 1)) {
+		dialog_error = DD_ERR_NOMORESTRINGS;
+		goto done;
+	}
+
+	result = dialog->string_marker;
+
+	dialog->string_marker += (length + 1);
+	dialog->string_space_remaining -= (length + 1);
+
+done:
+	return result;
+}
+
+/**
+ * Attempts to allocate one of the dialog box's string buffers.
+ * Returns -1 if no buffer was available.
+ *
+ * @param dialog	Dialog
+ * @return	Buffer handle
+ */
+static int buffer_allocate(DialogPtr dialog) {
+	int my_buffer = -1;
+	char *space;
+
+	if (dialog->buffers_allocated >= DIALOG_MAX_BUFFER) {
+		dialog_error = DD_ERR_NOMOREBUFFERS;
+		goto done;
+	}
+
+	space = string_allocate(dialog, 80);
+	if (space == NULL) goto done;
+
+	my_buffer = dialog->buffers_allocated;
+	dialog->buffers_allocated++;
+
+	dialog->buffer[my_buffer] = space;
+
+done:
+	return my_buffer;
+}
+
+/**
+ * Attempts to allocate one of the dialog box's list window structures.
+ * Returns -1 if all are in use.
+ *
+ * @param dialog	Dialog
+ * @return	List window structure handle
+ */
+static int list_allocate(DialogPtr dialog) {
+	int my_list;
+
+	if (dialog->lists_allocated < DIALOG_MAX_LIST) {
+		my_list = dialog->lists_allocated;
+		dialog->lists_allocated++;
+	} else {
+		dialog_error = DD_ERR_NOMORELISTS;
+		my_list = -1;
+	}
+
+	return my_list;
+}
+
+/**
+ * Returns the "hotkey" keystroke value, if any, for the
+ * passed string.  Returns 0 if no hotkey found.  Hotkeys
+ * are marked by preceding "~" characters.
+ *
+ * @param prompt	Prompt
+ * @return	Keystroke value
+ */
+static int get_keystroke(const char *prompt) {
+	const char *key_finder;
+	int key_stroke;
+
+	key_finder = strchr(prompt, '~');
+	if (key_finder != NULL) {
+		key_finder++;
+		key_stroke = *key_finder;
+	} else {
+		key_stroke = 0;
+	}
+
+	return key_stroke;
+}
+
+ItemPtr dialog_add_button(DialogPtr dialog, int x, int y, const char *prompt) {
+	ItemPtr item = NULL;
+	char *space;
+	int space_look;
+
+	space = string_allocate(dialog, strlen(prompt));
+	if (space == NULL) goto done;
+
+	item = item_allocate(dialog, DD_I_BUTTON);
+
+	if (item != NULL) {
+
+		item->prompt = space;
+		Common::strcpy_s(item->prompt, 65536, prompt);
+
+		item->width = strlen(prompt) + 2;
+
+		item_locate(dialog, item, x, y);
+
+		item->x2 = -1;
+
+		// Adjust cursor location to appear over the first letter (not
+		// over a space).
+		for (space_look = 0; ((unsigned)space_look < strlen(prompt)) && (item->x2 < 0); space_look++) {
+			if (prompt[space_look] != ' ') item->x2 = space_look + 1;
+		}
+
+		if (item->x2 < 0) item->x2 = 0;
+
+		item->status = 0;
+
+		item->keystroke = get_keystroke(prompt);
+
+		Common::strcpy_s(item->prompt, 65536, prompt);
+
+		if (dialog_language == DIALOG_GERMAN) {
+			if (strcmp(prompt, CANCEL_GERMAN) == 0) {
+				dialog->cancel_item = item;
+			}
+		} else {
+			if (strcmp(prompt, CANCEL_BUTTON) == 0) {
+				dialog->cancel_item = item;
+			}
+		}
+
+	}
+
+done:
+	return item;
+}
+
+ItemPtr dialog_add_checkbox(DialogPtr dialog, int x, int y, const char *prompt,
+		int default_val, int class_) {
+	ItemPtr item = NULL;
+	char *space;
+
+	space = string_allocate(dialog, strlen(prompt));
+	if (space == NULL) goto done;
+
+	item = item_allocate(dialog, DD_I_CHECKBOX);
+
+	if (item != NULL) {
+		item->width = strlen(prompt) + 4;
+
+		item_locate(dialog, item, x, y);
+
+		item->x2 = 1;
+		item->status = (!!default_val) & DD_CHECK_TRUE;  // (sic)
+
+		dialog->width = MAX<short>(dialog->width, (item->x + item->width + 1));
+
+		item->prompt = space;
+		Common::strcpy_s(item->prompt, 65536, prompt);
+
+		item->keystroke = get_keystroke(prompt);
+
+		item->_class = class_;
+
+	}
+
+done:
+	return item;
+}
+
+void dialog_grey_checkbox(ItemPtr item) {
+	if (item->type == DD_I_CHECKBOX) {
+		item->status |= DD_CHECK_GREY;
+	}
+}
+
+ItemPtr dialog_add_message(DialogPtr dialog, int x, int y, const char *prompt) {
+	ItemPtr item = NULL;
+	char *space = NULL;
+
+	if (prompt != NULL) {
+		space = string_allocate(dialog, strlen(prompt));
+		if (space == NULL) goto done;
+	}
+
+	item = item_allocate(dialog, DD_I_MESSAGE);
+
+	if (item != NULL) {
+		item->prompt = space;
+		if (prompt == NULL) {
+			item->width = DD_LINEACROSS;
+		} else {
+			item->width = strlen(prompt);
+			Common::strcpy_s(item->prompt, 65536, prompt);
+		}
+		item_locate(dialog, item, x, y);
+		dialog->width = MAX<short>(dialog->width, (item->x + item->width + 1));
+		item->status = 0;
+	}
+
+done:
+	return item;
+}
+
+void dialog_add_blank(DialogPtr dialog) {
+	dialog->fill_marker++;
+}
+
+ItemPtr dialog_add_string(DialogPtr dialog, int x, int y, const char *prompt,
+		const char *default_val, int width) {
+	ItemPtr item = NULL;
+	char *space;
+
+	space = string_allocate(dialog, strlen(prompt));
+	if (space == NULL) goto done;
+
+	item = item_allocate(dialog, DD_I_STRING);
+
+	if (item != NULL) {
+
+		item->width = strlen(prompt) + 2 + width;
+
+		item_locate(dialog, item, x, y);
+
+		dialog->width = MAX<short>(dialog->width, (item->x + item->width));
+
+		item->x2 = strlen(prompt) + 1;
+
+		// Account for any hotkey stroke in setting proper cursor location
+		if (strchr(prompt, '~') != NULL) {
+			item->width--;
+			item->x2--;
+		}
+
+		item->status = 0;
+		item->keystroke = get_keystroke(prompt);
+
+		item->prompt = space;
+		Common::strcpy_s(item->prompt, 65536, prompt);
+
+		// Set up a buffer in the dialog's buffer space
+		item->buf_width = width;
+		item->buf_id = buffer_allocate(dialog);
+
+		if (item->buf_id < 0) {
+
+			dialog->num_items--;
+			item = NULL;
+
+		} else {
+
+			// Copy the default value (if any) into the buffer
+			if (default_val != NULL) {
+				Common::strcpy_s(dialog->buffer[item->buf_id], 65536, default_val);
+				if (strlen(default_val) > (unsigned)width) {
+					dialog->buffer[item->buf_id][width] = 0;
+				}
+				dialog->buf_cursor[item->buf_id] = strlen(default_val);
+			} else {
+				dialog->buffer[item->buf_id][0] = 0;
+				default_val = &dialog->buffer[item->buf_id][0];
+			}
+
+			// Mark the entire buffer contents as "selected"
+			dialog->buf_status[item->buf_id] = 0;
+			dialog->buf_base_x[item->buf_id] = item->x2;
+			if (strlen(default_val) > 0) {
+				dialog->buf_select[item->buf_id] = true;
+				dialog->buf_selbase[item->buf_id] = 0;
+				dialog->buf_seltarget[item->buf_id] = strlen(default_val);
+			} else {
+				dialog->buf_select[item->buf_id] = false;
+			}
+		}
+	}
+
+done:
+	return item;
+}
+
+ItemPtr dialog_add_listbased(DialogPtr dialog, int x, int y, const char *prompt,
+		const char *default_val, int width, const char *title, char *mylist,
+		int elements, int element_offset, int entry_width, int rows, int columns) {
+	ItemPtr item, listitem;
+	ListPtr list;
+	int listnum;
+	int temp_width;
+
+	// First, just add the normal string entry area part
+	item = dialog_add_string(dialog, x, y, prompt, default_val, width);
+
+	// Then, do all the additional stuff for a list window
+	if (item != NULL) {
+		item->type = DD_I_LISTBASED;
+
+		listitem = item_allocate(dialog, DD_I_LIST);
+
+		if (listitem != NULL) {
+
+			listnum = list_allocate(dialog);
+
+			if (listnum >= 0) {
+
+				dialog_add_blank(dialog);
+				dialog_add_message(dialog, DD_IX_LEFT, DD_IY_AUTOFILL, title);
+
+				list = &(dialog->lists[listnum]);
+
+				list->rows = rows;
+				list->columns = columns;
+
+				temp_width = (columns * (entry_width + 1)) + 2;
+
+				dialog->width = MAX<short>(dialog->width, (temp_width + 4));
+
+				list->window.ul_x = 0;
+				list->window.ul_y = dialog->fill_marker;
+
+				dialog->fill_marker += (rows + 2);
+
+				listitem->keystroke = get_keystroke(title);
+
+				list->elements = elements;
+				list->element_offset = element_offset;
+				list->entry_width = entry_width;
+
+				list->base_entry = 0;
+				list->picked_entry = -1;
+				list->thumb = -1;
+
+				// Set items up to point at one another
+				item->status = listitem->id;
+				listitem->status = item->id;
+				listitem->buf_id = listnum;
+
+				list->list = mylist;
+
+			} else {
+				dialog->num_items -= 2;
+				item = NULL;
+			}
+		} else {
+			dialog->num_items--;
+			item = NULL;
+		}
+	}
+
+	return item;
+}
+
+ItemPtr dialog_append_list(DialogPtr dialog, int x, int y, ItemPtr base_string,
+	char *title,
+	char *mylist, int elements, int element_offset,
+	int entry_width, int rows, int columns) {
+	ItemPtr item, listitem = nullptr;
+	ListPtr list;
+	int listnum;
+	int temp_width;
+
+	// First, just add the normal string entry area part
+	item = base_string;
+
+	// Then, do all the additional stuff for a list window
+	if (item != NULL) {
+		listitem = item_allocate(dialog, DD_I_LIST);
+
+		if (listitem != NULL) {
+
+			listnum = list_allocate(dialog);
+
+			if (listnum >= 0) {
+
+				dialog_add_blank(dialog);
+				dialog_add_message(dialog, DD_IX_LEFT, DD_IY_AUTOFILL, title);
+
+				list = &(dialog->lists[listnum]);
+
+				list->rows = rows;
+				list->columns = columns;
+
+				temp_width = (columns * (entry_width + 1)) + 2;
+
+				dialog->width = MAX<short>(dialog->width, (temp_width + 4));
+
+				list->window.ul_x = 0;
+				list->window.ul_y = dialog->fill_marker;
+
+				dialog->fill_marker += (rows + 2);
+
+				listitem->keystroke = get_keystroke(title);
+
+				list->elements = elements;
+				list->element_offset = element_offset;
+				list->entry_width = entry_width;
+
+				list->base_entry = 0;
+				list->picked_entry = -1;
+				list->thumb = -1;
+
+				// Set items up to point at one another
+				listitem->status = item->id;
+				listitem->buf_id = listnum;
+
+				list->list = mylist;
+
+			} else {
+				dialog->num_items -= 1;
+			}
+		}
+	}
+
+	return listitem;
+}
+
+void dialog_set_colors(int normal, int select, int hilite, int greyed) {
+	dialog_default_normal = normal;
+	dialog_default_select = select;
+	dialog_default_hilite = hilite;
+	dialog_default_greyed = greyed;
+}
+
+void dialog_set_workspace_size(long workspace) {
+	dialog_string_space = workspace;
+}
+
+void dialog_set_string_space(DialogPtr dialog, char *space, long size) {
+	dialog->string_space = space;
+	dialog->string_space_remaining = size;
+	dialog->string_marker = space;
+}
+
+DialogPtr dialog_create(DialogPtr dialog, int ul_x, int ul_y, int width,
+	int normal_color, int select_color, int hilite_color) {
+
+	// Allocate memory for dialog if necessary
+	if (dialog == NULL) {
+		dialog = (DialogPtr)mem_get(sizeof(struct DialogBox));
+		dialog->status = DD_DYNAMIC;
+		dialog->string_space = NULL;
+	} else {
+		dialog->status = DD_STATIC;
+	}
+
+	mouse_callback = NULL;
+	page_callback = NULL;
+
+	if (dialog->string_space == NULL) {
+		dialog->status |= DD_DYNAMICSTRINGS;
+		dialog->string_space = (char *)mem_get(dialog_string_space);
+		dialog->string_space_remaining = dialog_string_space;
+		if (dialog->string_space == NULL) {
+			dialog_error = DD_ERR_NOMOREMEMORY;
+			if (dialog->status & DD_DYNAMIC) {
+				mem_free(dialog);
+			}
+			return nullptr;
+		}
+	}
+
+	if (normal_color == DD_DEFAULT) {
+		dialog->normal_color = dialog_default_normal;
+	} else {
+		dialog->normal_color = normal_color;
+	}
+
+	if (select_color == DD_DEFAULT) {
+		dialog->select_color = dialog_default_select;
+	} else {
+		dialog->select_color = select_color;
+	}
+
+	if (hilite_color == DD_DEFAULT) {
+		if (screen_video_mode == mono_text_mode) {
+			dialog->hilite_color = dialog_default_select;
+		} else {
+			dialog->hilite_color = dialog_default_hilite;
+		}
+	} else {
+		dialog->hilite_color = hilite_color;
+	}
+
+	dialog->width = width;
+
+	window_set(&dialog->window, ul_x, ul_y, ul_x + width + 1, ul_y);
+
+	dialog->base_x = ul_x + 1;
+	dialog->base_y = ul_y + 1;
+
+	dialog->num_items = 0;
+	dialog->fill_marker = 0;
+	dialog->active_button = dialog->active_item = 0;
+
+	dialog->cursor_x = dialog->cursor_y = 0;
+
+	dialog->button_left = 1;
+	dialog->button_right = 0;
+
+	dialog->buffers_allocated = 0;
+	dialog->lists_allocated = 0;
+
+	dialog->callback = NULL;
+	dialog->checkbox_callback = NULL;
+
+	dialog->cancel_item = NULL;
+	dialog->path_item = NULL;
+	dialog->default_item = NULL;
+
+	dialog->string_marker = dialog->string_space;
+
+	return  dialog;
+}
+
+void dialog_destroy(DialogPtr dialog) {
+	if (dialog != NULL) {
+		if (dialog->status & DD_SCREENSAVED) {
+			window_destroy(&dialog->window);
+			dialog->status &= ~DD_SCREENSAVED;
+		}
+		if (dialog->status & DD_DYNAMICSTRINGS) {
+			mem_free(dialog->string_space);
+			dialog->string_space = NULL;
+		}
+		if (dialog->status & DD_DYNAMIC) {
+			mem_free(dialog);
+		}
+	}
+}
+
+void dialog_destroy_persist(DialogPtr dialog) {
+	if (dialog != NULL) {
+		if (dialog->status & DD_SCREENSAVED) {
+			mem_free(dialog->window.storage);
+			dialog->status &= ~DD_SCREENSAVED;
+		}
+		if (dialog->status & DD_DYNAMICSTRINGS) {
+			mem_free(dialog->string_space);
+			dialog->string_space = NULL;
+		}
+		if (dialog->status & DD_DYNAMIC) {
+			mem_free(dialog);
+		}
+	}
+}
+
+void dialog_set_list_callback(DialogPtr dialog, void (*(callback))()) {
+	dialog->callback = callback;
+}
+
+void dialog_set_mouse_callback(MouseCallback callback, int double_only) {
+	mouse_callback = callback;
+	mouse_callback_double_only = double_only;
+}
+
+void dialog_set_page_callback(PageCallback callback) {
+	page_callback = callback;
+}
+
+void dialog_set_checkbox_callback(DialogPtr dialog, void (*(callback))()) {
+	dialog->checkbox_callback = callback;
+}
+
+/**
+ * Computes all necessary item coordinates and sizes => resolves
+ * all "indefinite" coordinates (i.e. centered dialogs, etc) into
+ * proper absolute screen coordinates (or dialog-relative coordinates)
+ * in preparation for actually executing the dialog.
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_compute_window(DialogPtr dialog) {
+	int height;
+	int count;
+	int count2;
+	int center;
+	int button_width;
+	int extra_height;
+	ItemPtr item;
+	ListPtr list;
+
+	// Find out if there's anything scheduled for the "button row"
+	dialog->button_flag = false;
+	extra_height = 2;
+
+	for (count = 0; count < dialog->num_items; count++) {
+		if (dialog->item[count].y == DD_IY_BUTTON) {
+			dialog->button_flag = true;
+			extra_height = 4;
+		}
+	}
+
+	// Figure out which checkbox items are in the same class as another
+	for (count = 0; count < dialog->num_items; count++) {
+		if (dialog->item[count].type == DD_I_CHECKBOX) {
+			for (count2 = 0; count2 < dialog->num_items; count2++) {
+				if (count != count2) {
+					if (dialog->item[count2].type == DD_I_CHECKBOX) {
+						if (dialog->item[count]._class == dialog->item[count2]._class) {
+							dialog->item[count].status |= DD_CHECK_RADIO;
+							dialog->item[count2].status |= DD_CHECK_RADIO;
+						}
+					}
+				}
+			}
+		}
+	}
+
+	// Conform the dialog to the width of the button row, if necessary
+	button_width = (dialog->button_left + abs(dialog->button_right) + 1);
+	dialog->width = MAX<short>(dialog->width, button_width);
+
+	// Center the dialog box, if requested
+	if (dialog->window.ul_x == DD_CENTER) {
+		center = screen_center_x ? screen_center_x : ((screen_max_x + 1) >> 1);
+		dialog->window.ul_x = (center - ((dialog->width + 3) >> 1));
+		dialog->base_x = dialog->window.ul_x + 1;
+	}
+
+	height = dialog->fill_marker + extra_height;
+
+	if (dialog->window.ul_y == DD_CENTER) {
+		center = screen_center_y ? screen_center_y : ((screen_max_y + 1) >> 1);
+		dialog->window.ul_y = (center - ((height + 1) >> 1));
+		dialog->base_y = dialog->window.ul_y + 1;
+	}
+
+	// Get the lower left dialog coordinates
+	dialog->window.lr_x = dialog->window.ul_x + dialog->width + 1;
+	dialog->window.lr_y = dialog->window.ul_y + height - 1;
+
+	// Resolve any right-margin relative items and compute all list windows
+	for (count = 0; count < dialog->num_items; count++) {
+		item = &dialog->item[count];
+
+		if (item->x < 0) {
+			item->x += dialog->width;
+		} else if (item->x == 0) {
+			item->x = ((dialog->width + 1) >> 1) - ((item->width + 1) >> 1);
+		}
+
+		switch (item->type) {
+
+		case DD_I_LIST:
+		case DD_I_FILELIST:
+		case DD_I_DIRSLIST:
+			list = &dialog->lists[item->buf_id];
+			item->x = (list->window.ul_x += dialog->window.ul_x + 2);
+			item->y = (list->window.ul_y += dialog->base_y);
+			list->window.lr_x = list->window.ul_x + (list->columns * (list->entry_width + 1)) + 2;
+			list->window.lr_y = list->window.ul_y + list->rows + 1;
+			item->x2 = list->base_x = list->window.ul_x + 1;
+			list->base_y = list->window.ul_y + 1;
+			break;
+
+		default:
+			item->x2 += item->x;
+			break;
+
+		}
+	}
+}
+
+int dialog_read_checkbox(DialogPtr dialog, ItemPtr item) {
+	return item->status & DD_CHECK_TRUE;
+}
+
+char *dialog_read_string(DialogPtr dialog, ItemPtr item) {
+	return dialog->buffer[item->buf_id];
+}
+
+char *dialog_read_list(DialogPtr dialog, ItemPtr item) {
+	return dialog->buffer[item->buf_id];
+}
+
+char *dialog_read_filename(DialogPtr dialog, ItemPtr item) {
+	return dialog->buffer[item->buf_id];
+}
+
+/**
+ * Updates the status of a dialog box based on its status flag
+ *
+ * @param dialog	Dialog
+ * @param item	
+ */
+static void dialog_update_checkbox(DialogPtr dialog, ItemPtr item) {
+	char temp1[2];
+	int color;
+
+	mouse_hide();
+
+	Common::strcpy_s(temp1, "X");
+
+	if (item->status & DD_CHECK_RADIO) {
+		temp1[0] = (char)0x07;
+	}
+
+	color = (item->status & DD_CHECK_GREY) ? dialog_default_greyed : dialog->normal_color;
+
+	if (item->status & DD_CHECK_TRUE) {
+		screen_put(temp1, color, 0, item->x2 + dialog->base_x, item->y + dialog->base_y);
+	} else {
+		screen_put(" ", color, 0, item->x2 + dialog->base_x, item->y + dialog->base_y);
+	}
+
+	mouse_show();
+}
+
+/**
+ * Displays the specified dialog string item's buffer, highlighting
+ * any selected text if the item is currently active.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ */
+static void dialog_update_string(DialogPtr dialog, ItemPtr item) {
+	int buf;
+	int cx, cy;
+	int out_count;
+	char *textptr;
+	byte *screenptr;
+
+	mouse_hide();
+
+	buf = item->buf_id;
+	cx = item->x2 + dialog->base_x;
+	cy = item->y + dialog->base_y;
+
+	out_count = 0;
+
+	screenptr = screen + screen_char_add(cx, cy);
+	textptr = dialog->buffer[buf];
+
+	// First, output as much of the string as we can
+	while ((*textptr != 0) && (out_count < item->buf_width)) {
+		*(screenptr++) = *(textptr++);
+		if (dialog->buf_select[buf] && (item->id == dialog->active_item) &&
+			(((out_count >= dialog->buf_selbase[buf]) && (out_count < dialog->buf_seltarget[buf])) ||
+				((out_count >= dialog->buf_seltarget[buf]) && (out_count < dialog->buf_selbase[buf])))) {
+			*(screenptr++) = (char)dialog->select_color;
+		} else {
+			*(screenptr++) = (char)dialog->normal_color;
+		}
+		out_count++;
+	}
+
+	// Then, be sure the rest of the entry area is cleared
+	while (out_count < item->buf_width) {
+		*(screenptr++) = 0x20;
+		if (dialog->buf_select[buf] &&
+			(((out_count >= dialog->buf_selbase[buf]) && (out_count < dialog->buf_seltarget[buf])) ||
+				((out_count >= dialog->buf_seltarget[buf]) && (out_count < dialog->buf_selbase[buf])))) {
+			*(screenptr++) = (char)dialog->select_color;
+		} else {
+			*(screenptr++) = (char)dialog->normal_color;
+		}
+		out_count++;
+	}
+
+	mouse_show();
+}
+
+/**
+ * Updates the list window associated with an item.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ */
+static void dialog_update_window(DialogPtr dialog, ItemPtr item) {
+	int row, col;
+	ListPtr list;
+	int out_count;
+	int my_color;
+	int id;
+	int start, dist, new_thumb;
+	int temp_pick;
+	int return_code;
+	byte *screenptr;
+	char *textptr;
+	typedef int (*CallbackFn)(ListPtr list, DialogPtr dialog);
+	CallbackFn callback;
+
+	mouse_hide();
+
+	if ((item->type == DD_I_LISTBASED) || (item->type == DD_I_FILENAME)) {
+		item = &dialog->item[item->status];
+	}
+
+	list = &dialog->lists[item->buf_id];
+
+	// Clear our old cursor off by wipe-ing the window in a single color
+	window_color(&list->window, dialog->normal_color);
+
+	// Now, go through the rows and columns one by one, displaying each entry
+	for (col = 0; col < list->columns; col++) {
+		for (row = 0; row < list->rows; row++) {
+			screenptr = screen + screen_char_add(list->base_x + (col * (list->entry_width + 1)),
+				list->base_y + row);
+			id = list->base_entry + row + (col * list->rows);
+
+			// Point at the text for this entry
+			textptr = list->list + (id * list->element_offset);
+
+			// Check if the cursor is on this item
+			if (id != list->picked_entry) {
+				my_color = dialog->normal_color;
+			} else {
+				my_color = dialog->select_color;
+			}
+
+			screenptr++;
+
+			if (*screenptr != (char)dialog->select_color) {
+				*(screenptr++) = (char)my_color;
+			} else {
+				screenptr++;
+			}
+
+			out_count = 0;
+
+			if (id < list->elements) {
+				while ((out_count < list->entry_width) && (*textptr != 0)) {
+					*(screenptr++) = *(textptr++);
+					*(screenptr++) = (char)my_color;
+					out_count++;
+				}
+			}
+			while (out_count < list->entry_width) {
+				*(screenptr++) = 0x20;
+				*(screenptr++) = (char)my_color;
+				out_count++;
+			}
+
+			screenptr++;
+
+			if (*screenptr != (char)dialog->select_color) {
+				*(screenptr++) = (char)my_color;
+			}
+		}
+	}
+
+
+	// Update the thumb mark in a scroll bar; routine is different
+	// depending on whether bar is vertical or horizontal
+	temp_pick = list->picked_entry;
+	if (temp_pick < 0) temp_pick = 0;
+
+	if (list->elements > 0) {
+
+		if (list->columns > 1) {
+
+			start = list->window.ul_x + 2;
+			dist = list->window.lr_x - list->window.ul_x - 3;
+
+			new_thumb = (dist * temp_pick) / list->elements;
+
+			if (new_thumb != list->thumb) {
+				if (list->thumb >= 0) {
+					screenptr = screen + screen_char_add(start + list->thumb, list->window.lr_y);
+					*screenptr = scroll_bar;
+				}
+				screenptr = screen + screen_char_add(start + new_thumb, list->window.lr_y);
+				*screenptr = thumb_mark;
+				list->thumb = new_thumb;
+			}
+
+		} else {
+
+			start = list->window.ul_y + 2;
+			dist = list->window.lr_y - list->window.ul_y - 3;
+
+			new_thumb = (dist * temp_pick) / list->elements;
+
+			if (new_thumb != list->thumb) {
+				if (list->thumb >= 0) {
+					screenptr = screen + screen_char_add(list->window.lr_x, start + list->thumb);
+					*screenptr = scroll_bar;
+				}
+				screenptr = screen + screen_char_add(list->window.lr_x, start + new_thumb);
+				*screenptr = thumb_mark;
+				list->thumb = new_thumb;
+			}
+
+		}
+
+	}
+
+	if ((dialog->callback != NULL) && (allow_list_callbacks)) {
+		callback = (CallbackFn)dialog->callback;
+		return_code = callback(list, dialog);
+		if (return_code) {
+			dialog->status |= DD_EXITFLAG;
+			dialog_error = DD_ERR_ABORTEDBYCALLBACK;
+		}
+	}
+
+	mouse_show();
+}
+
+/**
+ * Shows a dialog button.  "Selected" flags whether the item is
+ * currently being picked by the mouse.  Otherwise, the angle
+ * brackets are automatically highlighted if the button is the
+ * active button.
+ *
+ * @param dialog	Dialog
+ * @param item		Button item
+ * @param selected	Selected flag
+ */
+static void dialog_show_button(DialogPtr dialog, ItemPtr item, int selected) {
+	int angle_color, text_color, hi_color;
+	int cx, cy;
+
+	mouse_hide();
+
+	if (selected) {
+		angle_color = text_color = hi_color = dialog->select_color;
+	} else {
+		text_color = dialog->normal_color;
+		hi_color = dialog->hilite_color;
+		if (item->id == dialog->active_button) {
+			angle_color = dialog->hilite_color;
+		} else {
+			angle_color = dialog->normal_color;
+		}
+	}
+
+	if (item->y == DD_IY_BUTTON) {
+		cy = dialog->window.lr_y - 1;
+	} else {
+		cy = item->y + dialog->base_y;
+	}
+	cx = item->x + dialog->base_x;
+
+	cx = screen_put("<", angle_color, 0, cx, cy);
+	cx = screen_put(item->prompt, text_color, hi_color, cx, cy);
+	cx = screen_put(">", angle_color, 0, cx, cy);
+
+	mouse_show();
+}
+
+/**
+ * Outputs a dialog message string at the appropriate location
+ * in the dialog box.
+ *
+ * @param dialog	Dialog
+ * @param item		Message string
+ */
+static void dialog_show_message(DialogPtr dialog, ItemPtr item) {
+	mouse_hide();
+
+	if (item->width != DD_LINEACROSS) {
+		screen_put(item->prompt, dialog->normal_color, dialog->hilite_color,
+			item->x + dialog->base_x, item->y + dialog->base_y);
+	} else {
+		window_line_across(&(dialog->window), item->y + dialog->base_y);
+	}
+
+	mouse_show();
+}
+
+/**
+ * Displays (and updates) a checkbox item
+ *
+ * @param dialog	Dialog
+ * @param item		Checkbox item
+ */
+static void dialog_show_checkbox(DialogPtr dialog, ItemPtr item) {
+	int cx;
+	int color;
+	int hi_color;
+	char temp1[4];
+	char temp2[4];
+
+	mouse_hide();
+
+	if (item->status & DD_CHECK_RADIO) {
+		Common::strcpy_s(temp1, "(");
+		Common::strcpy_s(temp2, ") ");
+	} else {
+		Common::strcpy_s(temp1, "[");
+		Common::strcpy_s(temp2, "] ");
+	}
+
+	color = (item->status & DD_CHECK_GREY) ? dialog_default_greyed : dialog->normal_color;
+	hi_color = (item->status & DD_CHECK_GREY) ? dialog_default_greyed : dialog->hilite_color;
+
+	cx = screen_put(temp1, color, 0, item->x + dialog->base_x, item->y + dialog->base_y);
+	cx++;
+	cx = screen_put(temp2, color, 0, cx, item->y + dialog->base_y);
+	cx = screen_put(item->prompt, color, hi_color,
+		cx, item->y + dialog->base_y);
+
+	dialog_update_checkbox(dialog, item);
+
+	mouse_show();
+}
+
+/**
+ * Displays (and updates) a string item
+ *
+ * @param dialog	Dialog
+ * @param item		String item
+ */
+static void dialog_show_string(DialogPtr dialog, ItemPtr item) {
+	int cx;
+
+	mouse_hide();
+
+	cx = screen_put(item->prompt, dialog->normal_color, dialog->hilite_color,
+		item->x + dialog->base_x, item->y + dialog->base_y);
+	cx = screen_put("[", dialog->normal_color, 0, cx, item->y + dialog->base_y);
+
+	cx = screen_put("]", dialog->normal_color, 0, cx + item->buf_width, item->y + dialog->base_y);
+
+	dialog_update_string(dialog, item);
+
+	mouse_show();
+}
+
+/**
+ * Displays (and updates) a list-based item (including file lists)
+ *
+ * @param dialog	Dialog
+ * @param item		List-based item
+ */
+static void dialog_show_window(DialogPtr dialog, ItemPtr item) {
+	ListPtr list;
+
+	mouse_hide();
+
+	if ((item->type == DD_I_LISTBASED) || (item->type == DD_I_FILENAME)) {
+		item = &dialog->item[item->status];
+	}
+
+	list = &dialog->lists[item->buf_id];
+
+	window_wipe(&list->window);
+	window_color(&list->window, dialog->normal_color);
+	window_draw_box(&list->window, WINDOW_SINGLE);
+
+	if (list->columns == 1) {
+		window_vert_scrollbar(&list->window, dialog->normal_color);
+	} else {
+		window_horiz_scrollbar(&list->window, dialog->normal_color);
+	}
+
+	dialog_update_window(dialog, item);
+
+	mouse_show();
+}
+
+/**
+ * Displays the item whose handle is passed, no matter what type
+ * of item it is (calls the appropriate one of the above routines)
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ */
+static void dialog_show_any(DialogPtr dialog, ItemPtr item) {
+	switch (item->type) {
+	case DD_I_BUTTON:
+		dialog_show_button(dialog, item, false);
+		break;
+
+	case DD_I_MESSAGE:
+		dialog_show_message(dialog, item);
+		break;
+
+	case DD_I_CHECKBOX:
+		dialog_show_checkbox(dialog, item);
+		break;
+
+	case DD_I_STRING:
+		dialog_show_string(dialog, item);
+		break;
+
+	case DD_I_FILENAME:
+		dialog_show_string(dialog, item);
+		break;
+
+	case DD_I_LISTBASED:
+		dialog_show_string(dialog, item);
+		break;
+
+	case DD_I_LIST:
+	case DD_I_FILELIST:
+	case DD_I_DIRSLIST:
+		dialog_show_window(dialog, item);
+		break;
+	}
+}
+
+void dialog_show_all(DialogPtr dialog) {
+	ItemPtr item;
+	int item_num;
+
+	if (!(dialog->status & DD_COMPUTED)) {
+		dialog_compute_window(dialog);
+		dialog->status |= DD_COMPUTED;
+	}
+
+	mouse_hide();
+
+	if (!(dialog->status & DD_SCREENSAVED)) {
+		window_create(&dialog->window);
+		dialog->status |= DD_SCREENSAVED;
+	}
+
+	window_wipe(&dialog->window);
+	window_color(&dialog->window, dialog->normal_color);
+	window_draw_box(&dialog->window, WINDOW_SINGLE);
+	window_shadow(&dialog->window);
+
+	if (dialog->button_flag) {
+		window_line_across(&dialog->window, dialog->window.lr_y - 2);
+	}
+
+	for (item_num = 0; item_num < dialog->num_items; item_num++) {
+		item = &dialog->item[item_num];
+		dialog_show_any(dialog, item);
+	}
+
+	mouse_show();
+}
+
+/**
+ * Routine to update the item whose handle is passed to it, no matter
+ * what type of item it is.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ * @param mouse_button_flag		Mouse button flag
+ */
+static void dialog_update_any(DialogPtr dialog, ItemPtr item, int mouse_button_flag) {
+	switch (item->type) {
+	case DD_I_BUTTON:
+		dialog_show_button(dialog, item, mouse_button_flag);
+		break;
+
+	case DD_I_CHECKBOX:
+		dialog_update_checkbox(dialog, item);
+		break;
+
+	case DD_I_STRING:
+	case DD_I_FILENAME:
+	case DD_I_LISTBASED:
+		if (item->id != dialog->active_item) {
+			dialog->buf_select[item->buf_id] = false;
+		}
+		dialog_update_string(dialog, item);
+		break;
+
+	case DD_I_LIST:
+	case DD_I_FILELIST:
+	case DD_I_DIRSLIST:
+		dialog_update_window(dialog, item);
+		break;
+	}
+}
+
+/**
+ * Moves the cursor to the active item, at the appropriate place
+ * within that item (appropriate place depends on item type)
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_update_cursor(DialogPtr dialog) {
+	ListPtr list;
+	int relval, relcol, relrow, relx, rely;
+
+	switch (dialog->item[dialog->active_item].type) {
+	case DD_I_BUTTON:
+		if (dialog->item[dialog->active_item].y == DD_IY_BUTTON) {
+			cursor_set_pos(dialog->base_x + dialog->item[dialog->active_item].x2,
+				dialog->window.lr_y - 1);
+		} else {
+			cursor_set_pos(dialog->base_x + dialog->item[dialog->active_item].x2,
+				dialog->base_y + dialog->item[dialog->active_item].y);
+		}
+		break;
+
+	case DD_I_STRING:
+	case DD_I_LISTBASED:
+	case DD_I_FILENAME:
+		cursor_set_pos(dialog->base_x + dialog->item[dialog->active_item].x2
+			+ dialog->buf_cursor[dialog->item[dialog->active_item].buf_id],
+			dialog->base_y + dialog->item[dialog->active_item].y);
+		break;
+
+	case DD_I_LIST:
+	case DD_I_FILELIST:
+	case DD_I_DIRSLIST:
+		list = &dialog->lists[dialog->item[dialog->active_item].buf_id];
+		if (list->picked_entry >= list->base_entry) {
+			relval = list->picked_entry - list->base_entry;
+		} else {
+			relval = 0;
+		}
+		relcol = relval / list->rows;
+		relrow = relval - (relcol * list->rows);
+		relx = list->base_x + 1 + (relcol * (list->entry_width + 1));
+		rely = list->base_y + relrow;
+		cursor_set_pos(relx, rely);
+		break;
+
+	default:
+		cursor_set_pos(dialog->base_x + dialog->item[dialog->active_item].x2,
+			dialog->base_y + dialog->item[dialog->active_item].y);
+		break;
+	}
+}
+
+/**
+ * Routine to update & move the cursor to the active item, after
+ * possibly changing the active item.
+ * If active item changes, then the old active item will be
+ * updated also, to make sure its appearance conforms to its
+ * new, inactive, status.
+ *
+ * @param dialog				Dialog
+ * @param displace				"Displacement" by which to change the active
+ * item #. 0 to leave active item unchanged.  Item #'s will loop around.
+ * @param mouse_button_flag		Mouse button flag
+ * @param out_of_class			Out of class flag
+ */
+static void dialog_update_active(DialogPtr dialog, int displace, int mouse_button_flag, int out_of_class) {
+	int old_item;
+	int old_button;
+	int buf_num;
+	int prohibited;
+	ItemPtr item;
+	ItemPtr old;
+
+	old_item = dialog->active_item;
+	old_button = dialog->active_button;
+
+	do {
+		dialog->active_item += displace;
+		if (dialog->active_item < 0) dialog->active_item = dialog->num_items - 1;
+		if (dialog->active_item >= dialog->num_items) dialog->active_item = 0;
+		item = &dialog->item[dialog->active_item];
+		old = &dialog->item[old_item];
+		prohibited = (item->type == DD_I_MESSAGE) ||
+			(out_of_class &&
+				((item->type == DD_I_CHECKBOX) &&
+					(old->type == DD_I_CHECKBOX) &&
+					(item->_class == old->_class)));
+	} while (prohibited && (displace != 0));
+
+	if ((displace != 0) && (!mouse_button_flag)) {
+		if (DialogString(dialog)) {
+			buf_num = dialog->item[dialog->active_item].buf_id;
+			dialog->buf_select[buf_num] = true;
+			dialog->buf_selbase[buf_num] = 0;
+			dialog->buf_seltarget[buf_num] = strlen(dialog->buffer[buf_num]);
+			dialog->buf_cursor[buf_num] = dialog->buf_seltarget[buf_num];
+		}
+	}
+
+	if (item->type == DD_I_BUTTON) {
+		dialog->active_button = dialog->active_item;
+	}
+
+	if (old_item != dialog->active_item) {
+		dialog_update_any(dialog, &dialog->item[old_item], false);
+		dialog_update_any(dialog, item, mouse_button_flag);
+		if ((old_button == old_item) && (item->type != DD_I_BUTTON)) {
+			if (dialog->default_item != NULL) {
+				dialog->active_button = (dialog->default_item)->id;
+				dialog_update_any(dialog, dialog->default_item, false);
+				dialog_update_any(dialog, &dialog->item[old_button], false);
+			}
+		}
+		if ((old_button != old_item) && (old_button != dialog->active_button)) {
+			dialog_update_any(dialog, &dialog->item[old_button], false);
+		}
+	} else {
+		dialog_update_any(dialog, item, mouse_button_flag);
+	}
+
+	dialog_update_cursor(dialog);
+}
+
+void dialog_go_sideways(DialogPtr dialog, int direction) {
+	ItemPtr current;
+	ItemPtr item;
+	int where_to, nearest_x, nearest_y;
+	int x, y;
+	int count;
+	int dx, dy;
+
+	direction = sgn(direction);
+
+	where_to = -1;
+	nearest_x = 99;
+	nearest_y = 99;
+
+	current = &dialog->item[dialog->active_item];
+	x = current->x;
+	y = current->y;
+
+	for (count = 0; count < dialog->num_items; count++) {
+		item = &dialog->item[count];
+		dx = item->x - x;
+		dy = item->y - y;
+		if (item->type != DD_I_MESSAGE) {
+			if (count != current->id) {
+				if ((sgn(dx) == direction) && (dy <= 0)) {
+					if (abs(dx) <= nearest_x) {
+						if ((abs(dx) < nearest_x) || (abs(dy) < nearest_y)) {
+							where_to = count;
+							nearest_x = abs(dx);
+							nearest_y = abs(dy);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	if (where_to >= 0) {
+		dialog_update_active(dialog, where_to - dialog->active_item, false, false);
+	} else {
+		dialog_update_active(dialog, direction, false, true);
+	}
+}
+
+void dialog_toggle_checkbox(DialogPtr dialog, ItemPtr item) {
+	int count;
+	int status, class_;
+	int return_code;
+	typedef int(*CallbackFn)(ItemPtr item, DialogPtr dialog);
+	CallbackFn callback;
+
+	if (item->status & DD_CHECK_RADIO) {
+		if (item->status & DD_CHECK_TRUE) goto done;
+	}
+
+	item->status ^= DD_CHECK_TRUE;
+	status = (item->status & DD_CHECK_TRUE);
+
+	dialog_update_active(dialog, 0, false, false);
+
+	if (status) {
+		class_ = item->_class;
+
+		for (count = 0; count < dialog->num_items; count++) {
+			if (dialog->item[count]._class == class_) {
+				if (dialog->item[count].id != item->id) {
+					if (dialog->item[count].status & DD_CHECK_TRUE) {
+						dialog->item[count].status &= (~DD_CHECK_TRUE);
+						dialog_update_any(dialog, &dialog->item[count], false);
+					}
+				}
+			}
+		}
+	}
+
+	if (dialog->checkbox_callback != NULL) {
+		callback = (CallbackFn)dialog->checkbox_callback;
+		return_code = callback(item, dialog);
+
+		if (return_code) {
+			dialog->status |= DD_EXITFLAG;
+			dialog_error = DD_ERR_ABORTEDBYCALLBACK;
+		}
+	}
+
+done:
+	;
+}
+
+/**
+ * If a sub-string was being selected in the dialog box, cancel
+ * that selection.
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_cancel_selection(DialogPtr dialog) {
+	ItemPtr item;
+	int buf;
+
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	if (DialogString(dialog)) {
+		if (dialog->buf_select[buf]) {
+			dialog->buf_select[buf] = false;
+			if (dialog->buf_selbase[buf] != dialog->buf_seltarget[buf]) {
+				dialog_update_string(dialog, item);
+			}
+		}
+	}
+}
+
+/**
+ * If a substring was being selected in the dialog, erase that substring.
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_wipe_selection(DialogPtr dialog) {
+	ItemPtr item;
+	int buf;
+	int buflen;
+	int from, unto;
+	char *src, *dest;
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	if (DialogString(dialog)) {
+		if (dialog->buf_select[buf]) {
+			dialog_cancel_selection(dialog);
+			if (dialog->buf_selbase[buf] != dialog->buf_seltarget[buf]) {
+				if (dialog->buf_selbase[buf] < dialog->buf_seltarget[buf]) {
+					from = dialog->buf_selbase[buf];
+					unto = dialog->buf_seltarget[buf] - 1;
+				} else {
+					from = dialog->buf_seltarget[buf];
+					unto = dialog->buf_selbase[buf] - 1;
+				}
+				buflen = strlen(dialog->buffer[buf]);
+				if (from >= buflen) {
+					from = buflen - 1;
+				}
+				if (unto >= buflen) {
+					unto = buflen - 1;
+				}
+				if ((from >= 0) && (unto >= 0)) {
+					dest = &dialog->buffer[buf][from];
+					src = &dialog->buffer[buf][unto + 1];
+					*dest = 0x00;
+					Common::strcpy_s(dest, 65536, src);
+					dialog->buf_cursor[buf] = from;
+					dialog_update_string(dialog, item);
+				}
+			}
+		}
+	}
+}
+
+/**
+ * Routine to move the cursor within a string item
+ *
+ * @param dialog	Dialog
+ * @param displace	Displacement amount
+ */
+static void dialog_move_cursor(DialogPtr dialog, int displace) {
+	ItemPtr item;
+	int buf;
+
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	dialog_cancel_selection(dialog);
+
+	switch (displace) {
+	case DD_C_HOME:
+		dialog->buf_cursor[buf] = 0;
+		break;
+
+	case DD_C_END:
+		dialog->buf_cursor[buf] = strlen(dialog->buffer[buf]);
+		break;
+
+	default:
+		dialog->buf_cursor[buf] += displace;
+		break;
+	}
+
+	if (dialog->buf_cursor[buf] < 0) dialog->buf_cursor[buf] = 0;
+	if (dialog->buf_cursor[buf] > item->buf_width - 1) dialog->buf_cursor[buf] = item->buf_width - 1;
+
+	dialog_update_cursor(dialog);
+}
+
+/**
+ * Routine to insert a character into the active string item,
+ * at the current cursor location.
+ *
+ * @param dialog	Dialog
+ * @param mykey		Character
+ */
+static void dialog_string_insert(DialogPtr dialog, int mykey) {
+	ItemPtr item;
+	int buf;
+	char *dest, *src;
+	int buflen, count;
+
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	if (DialogString(dialog)) {
+		if (dialog->buf_select[buf]) {
+			dialog_wipe_selection(dialog);
+		}
+
+		buflen = strlen(dialog->buffer[buf]);
+
+		if (dialog->buf_cursor[buf] > buflen) {
+			for (count = buflen; count < dialog->buf_cursor[buf]; count++) {
+				dialog->buffer[buf][count] = 0x20;
+			}
+			buflen = dialog->buf_cursor[buf];
+		}
+
+		if (dialog->buf_cursor[buf] == buflen) {
+			if (buflen < item->buf_width) {
+				dialog->buffer[buf][buflen++] = (char)mykey;
+				dialog->buffer[buf][buflen] = 0x00;
+				dialog->buf_cursor[buf]++;
+			}
+		} else {
+			if (cursor_mode == CURSOR_OVERWRITE) {
+				dialog->buffer[buf][dialog->buf_cursor[buf]++] = (char)mykey;
+			} else if (buflen < item->buf_width) {
+				dest = dialog->buffer[buf] + buflen + 1;
+				src = dest - 1;
+				count = (buflen - dialog->buf_cursor[buf]) + 1;
+				memmove(dest, src, count);
+				dialog->buffer[buf][dialog->buf_cursor[buf]++] = (char)mykey;
+			}
+		}
+
+		if (item->buf_width == 1) {
+			dialog->buf_select[buf] = true;
+			dialog->buf_selbase[buf] = 0;
+			dialog->buf_seltarget[buf] = 1;
+			dialog->buf_cursor[buf] = 0;
+		}
+
+		dialog_update_string(dialog, item);
+		dialog_update_cursor(dialog);
+	}
+}
+
+/**
+ * Routine to delete a character or selection from the active
+ * string item, at the current cursor location.
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_string_delete(DialogPtr dialog) {
+	ItemPtr item;
+	int buf;
+
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	if (DialogString(dialog)) {
+		if (!dialog->buf_select[buf]) {
+			if ((unsigned)dialog->buf_cursor[buf] < strlen(dialog->buffer[buf])) {
+				dialog->buf_select[buf] = true;
+				dialog->buf_selbase[buf] = dialog->buf_cursor[buf];
+				dialog->buf_seltarget[buf] = dialog->buf_cursor[buf] + 1;
+			}
+		}
+		dialog_wipe_selection(dialog);
+		dialog_update_cursor(dialog);
+	}
+}
+
+/**
+ * Routine to execute the "backspace key" function on the active
+ * string item
+ *
+ * @param dialog	Dialog
+ */
+static void dialog_string_backspace(DialogPtr dialog) {
+	ItemPtr item;
+	int buf;
+	char *dest, *src;
+	int buflen;
+
+	item = &dialog->item[dialog->active_item];
+	buf = item->buf_id;
+
+	if (DialogString(dialog)) {
+		if ((dialog->buf_cursor[buf] >= dialog->buf_selbase[buf]) &&
+			(dialog->buf_cursor[buf] >= dialog->buf_seltarget[buf])) {
+			dialog_cancel_selection(dialog);
+		}
+		dialog_wipe_selection(dialog);
+		if (dialog->buf_cursor[buf] > 0) {
+			buflen = strlen(dialog->buffer[buf]);
+			if (dialog->buf_cursor[buf] > buflen) {
+				dialog->buf_cursor[buf]--;
+			} else {
+				dest = &dialog->buffer[buf][dialog->buf_cursor[buf] - 1];
+				src = dest + 1;
+				Common::strcpy_s(dest, 65536, src);
+				dialog->buf_cursor[buf]--;
+			}
+			dialog_update_string(dialog, item);
+		}
+		dialog_update_cursor(dialog);
+	}
+}
+
+/**
+ * Routine to check if two strings are equivalent for at least
+ * the entire length of the second, shorter, string.  Compare
+ * is done without regard for case.
+ *
+ * @param big		Big string
+ * @param little	Substring
+ * @return Comparison result
+ */
+static int dialog_quick_compare(const char *big, const char *little) {
+	int biglen, litlen;
+	int count, going;
+	char biggie, littlie;
+
+	biglen = strlen(big);
+	litlen = strlen(little);
+
+	if (biglen >= litlen) {
+		going = true;
+		for (count = 0; going && (count < litlen); count++) {
+			biggie = *(big++);
+			littlie = *(little++);
+			going = (toupper(biggie) == toupper(littlie));
+		}
+		return going;
+	} else {
+		return false;
+	}
+}
+
+/**
+ * Routine to find the item in a list window that most closely matches
+ * a given string.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ * @param checkstring	Matching string
+ * @return	Item index
+ */
+static int dialog_quick_search(DialogPtr dialog, ItemPtr item, const char *checkstring) {
+	ListPtr list;
+	char *search;
+	int result;
+	int count;
+
+	list = &dialog->lists[item->buf_id];
+
+	result = -1;
+	if (!dialog_quicksearch_flag) goto done;
+
+	for (count = 0; (count < list->elements) && (result < 0); count++) {
+		search = list->list + (count * list->element_offset);
+		if (dialog_quick_compare(search, checkstring)) {
+			result = count;
+		}
+	}
+
+done:
+	return result;
+}
+
+/**
+ * Routine to perform the above quick-search function and load
+ * the appropriate string into the item's string entry area.  The
+ * extra text of the found entry is loaded to the right of the cursor
+ * and is "selected" so that if the user types another letter key the
+ * extraneous text will be automatically removed.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ */
+static void dialog_do_search(DialogPtr dialog, ItemPtr item) {
+	ItemPtr listitem;
+	ListPtr list;
+	int buf;
+	int match;
+	int mylen;
+	int newlen;
+	int count;
+
+	int case_magic;
+	int magic_number = 0;
+	int magic_upper = 0;
+
+	buf = item->buf_id;
+	listitem = &dialog->item[item->status];
+	list = &dialog->lists[listitem->buf_id];
+
+	match = dialog_quick_search(dialog, listitem, dialog->buffer[buf]);
+
+	// Get an appropriate view of the window which will make our entry visible
+	if (match >= 0) {
+		if ((match >= list->base_entry) && (match < (list->base_entry + (list->rows * list->columns)))) {
+			list->picked_entry = match;
+		} else {
+			list->picked_entry = match;
+			if (list->columns == 1) {
+				list->base_entry = list->picked_entry;
+			} else {
+				if (list->base_entry < list->picked_entry) {
+					while (list->picked_entry >= (list->base_entry + (list->rows * list->columns))) {
+						list->base_entry += list->rows;
+					}
+				} else {
+					while (list->picked_entry < list->base_entry) {
+						list->base_entry -= list->rows;
+						if (list->base_entry < 0) list->base_entry = 0;
+					}
+				}
+			}
+		}
+
+		allow_list_callbacks = true;
+
+		dialog_update_any(dialog, listitem, false);
+
+		allow_list_callbacks = false;
+
+		mylen = strlen(dialog->buffer[buf]);
+
+		Common::strcpy_s(temp_buf, dialog->buffer[buf]);
+		strncpy(dialog->buffer[buf], list->list + (list->element_offset * list->picked_entry), item->buf_width);
+		dialog->buffer[buf][item->buf_width] = 0;
+
+		for (count = 0; count < mylen; count++) {
+			dialog->buffer[buf][count] = temp_buf[count];
+		}
+
+		newlen = strlen(dialog->buffer[buf]);
+
+		// Now, "case magic" attempts to conform the case of the searched-in
+		// string to the case format that the user is typing.
+		case_magic = false;
+
+		if (mylen > 0) {
+			if ((mylen > 1) && (Common::isAlpha(dialog->buffer[buf][1]))) {
+				magic_number = 1;
+				case_magic = true;
+			} else if (Common::isAlpha(dialog->buffer[buf][0])) {
+				magic_number = 0;
+				case_magic = true;
+			}
+		}
+
+		if (case_magic) {
+			magic_upper = (Common::isUpper(dialog->buffer[buf][magic_number]));
+		}
+
+		for (count = mylen; (case_magic) && (count < newlen); count++) {
+			if (magic_upper) {
+				dialog->buffer[buf][count] = (char)toupper((char)dialog->buffer[buf][count]);
+			} else {
+				dialog->buffer[buf][count] = (char)tolower((char)dialog->buffer[buf][count]);
+			}
+		}
+
+		dialog->buf_select[buf] = true;
+		dialog->buf_selbase[buf] = mylen;
+		dialog->buf_seltarget[buf] = newlen;
+
+		if (item->buf_width == 1) {
+			dialog->buf_selbase[buf] = 0;
+			dialog->buf_seltarget[buf] = 1;
+		}
+
+		dialog_update_any(dialog, item, false);
+	}
+}
+
+/**
+ * Routine to handle scrolling around in a list window.  Used to
+ * drive both mouse and cursor scroll routines.
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ * @param direction	Scroll direction
+ */
+static void dialog_scroll_list(DialogPtr dialog, ItemPtr item, int direction) {
+	int my_dif, my_col, my_row;
+	int scroll_factor;
+	ListPtr list;
+
+	list = &dialog->lists[item->buf_id];
+
+	if (list->picked_entry < 0) {
+		list->picked_entry = list->base_entry;
+	} else {
+		my_dif = list->picked_entry - list->base_entry;
+		my_col = my_dif / list->rows;
+		my_row = my_dif % list->rows;
+
+		switch (direction) {
+		case DD_MC_SCROLL_UP:
+			if (my_row > 0) {
+				list->picked_entry--;
+			} else {
+				if ((list->columns == 1) && (list->base_entry > 0)) {
+					list->base_entry--;
+					list->picked_entry--;
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_DOWN:
+			if (my_row < list->rows - 1) {
+				if (list->picked_entry < list->elements - 1) {
+					list->picked_entry++;
+				} else {
+					if ((list->columns == 1) && (list->base_entry < list->elements - 1)) {
+						list->base_entry++;
+					}
+				}
+			} else {
+				if ((list->columns == 1) && (list->base_entry < list->elements - 1)) {
+					list->base_entry++;
+					list->picked_entry++;
+					if (list->picked_entry >= list->elements) list->picked_entry = list->elements - 1;
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_LEFT:
+			if (my_col > 0) {
+				list->picked_entry -= list->rows;
+			} else {
+				if ((list->columns > 1) && (list->base_entry > 0)) {
+					list->base_entry -= list->rows;
+					list->picked_entry -= list->rows;
+					if (list->base_entry < 0) list->base_entry = 0;
+					if (list->picked_entry < 0) list->picked_entry = 0;
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_RIGHT:
+			if (my_col < list->columns - 1) {
+				list->picked_entry += list->rows;
+				if (list->picked_entry >= list->elements) {
+					list->picked_entry = list->elements - 1;
+				}
+			} else {
+				if ((list->columns > 1) && (list->base_entry < list->elements - 1)) {
+					list->base_entry += list->rows;
+					list->picked_entry += list->rows;
+					if (list->base_entry >= list->elements) {
+						list->base_entry -= list->rows;
+					}
+					if (list->picked_entry >= list->elements) {
+						list->picked_entry = list->elements - 1;
+					}
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_PAGE_UP:
+			list->base_entry -= list->rows;
+			if (list->base_entry < 0) {
+				list->base_entry = 0;
+				list->picked_entry = 0;
+			} else {
+				if ((list->picked_entry - list->base_entry) >= list->rows) {
+					list->picked_entry = list->base_entry + list->rows - 1;
+				} else {
+					list->picked_entry = list->base_entry;
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_PAGE_DOWN:
+			list->base_entry += list->rows;
+			if (list->base_entry >= list->elements) {
+				list->base_entry = list->elements - 1;
+				list->picked_entry = list->elements - 1;
+			} else {
+				if (list->picked_entry < list->base_entry) {
+					list->picked_entry = list->base_entry;
+				} else {
+					list->picked_entry = list->base_entry + list->rows - 1;
+					if (list->picked_entry >= list->elements) {
+						list->picked_entry = list->elements;
+					}
+				}
+			}
+			break;
+
+		case DD_MC_SCROLL_PAGE_LEFT:
+			scroll_factor = list->rows * (list->columns - 1);
+			list->base_entry -= scroll_factor;
+			list->picked_entry -= scroll_factor;
+			if (list->base_entry < 0) list->base_entry = 0;
+			if (list->picked_entry < list->base_entry) list->picked_entry = list->base_entry;
+			break;
+
+		case DD_MC_SCROLL_PAGE_RIGHT:
+			scroll_factor = list->rows * (list->columns - 1);
+			if (list->base_entry + scroll_factor < list->elements) {
+				list->base_entry += scroll_factor;
+				list->picked_entry += scroll_factor;
+				if (list->picked_entry >= list->elements) {
+					list->picked_entry = list->elements - 1;
+				}
+			} else {
+				list->picked_entry = list->elements - 1;
+			}
+			break;
+		}
+	}
+}
+
+/**
+ * Routine to allow keyboard scrolling within a list window
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ * @param mykey		Scrolling character
+ */
+static void dialog_key_exec_list(DialogPtr dialog, ItemPtr item, int mykey) {
+	ItemPtr baseitem;
+	ListPtr list;
+	int buf;
+
+	switch (mykey) {
+	case up_key:
+		dialog_scroll_list(dialog, item, DD_MC_SCROLL_UP);
+		break;
+
+	case down_key:
+		dialog_scroll_list(dialog, item, DD_MC_SCROLL_DOWN);
+		break;
+
+	case left_key:
+		dialog_scroll_list(dialog, item, DD_MC_SCROLL_LEFT);
+		break;
+
+	case right_key:
+		dialog_scroll_list(dialog, item, DD_MC_SCROLL_RIGHT);
+		break;
+
+	case pgup_key:
+		list = &dialog->lists[item->buf_id];
+		if (list->columns > 1) {
+			dialog_scroll_list(dialog, item, DD_MC_SCROLL_PAGE_LEFT);
+		} else {
+			dialog_scroll_list(dialog, item, DD_MC_SCROLL_PAGE_UP);
+		}
+		break;
+
+	case pgdn_key:
+		list = &dialog->lists[item->buf_id];
+		if (list->columns > 1) {
+			dialog_scroll_list(dialog, item, DD_MC_SCROLL_PAGE_RIGHT);
+		} else {
+			dialog_scroll_list(dialog, item, DD_MC_SCROLL_PAGE_DOWN);
+		}
+		break;
+	}
+
+	baseitem = &dialog->item[item->status];
+	list = &dialog->lists[item->buf_id];
+	buf = baseitem->buf_id;
+	strncpy(dialog->buffer[buf], list->list + (list->picked_entry * list->element_offset), baseitem->buf_width);
+	dialog->buffer[buf][baseitem->buf_width] = 0;
+	fileio_purge_trailing_spaces(dialog->buffer[buf]);
+	allow_list_callbacks = true;
+	dialog_update_any(dialog, baseitem, false);
+	dialog_update_active(dialog, 0, false, false);
+	allow_list_callbacks = false;
+}
+
+/**
+ * Returns true if the mouse is in the specified item.
+ *
+ * @param dialog	Dialog
+ * @param count		Item index
+ * @return True if mouse is within the item
+ */
+static int in_item(DialogPtr dialog, int count) {
+	ItemPtr item;
+	ListPtr list;
+	int result;
+
+	item = &dialog->item[count];
+
+	switch (item->type) {
+	case DD_I_MESSAGE:
+		result = false;
+		break;
+
+	case DD_I_BUTTON:
+		if (item->y == DD_IY_BUTTON) {
+			result = mouse_in_box(dialog->base_x + item->x, dialog->window.lr_y - 1,
+				dialog->base_x + item->x + item->width - 1, dialog->window.lr_y);
+		} else {
+			result = mouse_in_box(dialog->base_x + item->x, dialog->base_y + item->y,
+				dialog->base_x + item->x + item->width - 1, dialog->base_y + item->y);
+		}
+		break;
+
+	case DD_I_CHECKBOX:
+		result = mouse_in_box(dialog->base_x + item->x, dialog->base_y + item->y,
+			dialog->base_x + item->x + item->width - 1, dialog->base_y + item->y);
+		break;
+
+	case DD_I_STRING:
+	case DD_I_LISTBASED:
+	case DD_I_FILENAME:
+		result = mouse_in_box(dialog->base_x + item->x2, dialog->base_y + item->y,
+			dialog->base_x + item->x2 + item->buf_width, dialog->base_y + item->y);
+		break;
+
+	case DD_I_LIST:
+	case DD_I_FILELIST:
+	case DD_I_DIRSLIST:
+		list = &dialog->lists[item->buf_id];
+		result = mouse_in_box(list->base_x, list->base_y,
+			list->window.lr_x, list->window.lr_y);
+		if ((mouse_x == list->window.lr_x) && (mouse_y == list->window.lr_y)) {
+			result = false;
+		}
+		if (list->elements == 0) result = false;
+
+		break;
+
+	default:
+		result = false;
+		break;
+	}
+
+	return result;
+}
+
+/**
+ * If the mouse has been pressed within a scroll bar area, returns
+ * the proper type of action to be taken.
+ *
+ * @param list		Listbox
+ * @param button	Button number
+ * @return	Action to be taken
+ */
+static int in_scroll_box(ListPtr list, int button) {
+	int result;
+	int relx, rely;
+
+	result = 0;
+
+	if (list->columns > 1) {
+		if (mouse_in_box(list->window.ul_x + 1, list->window.lr_y,
+			list->window.lr_x - 1, list->window.lr_y)) {
+			if (mouse_x == list->window.ul_x + 1) {
+				result = DD_MC_SCROLL_LEFT;
+			} else if (mouse_x == list->window.lr_x - 1) {
+				result = DD_MC_SCROLL_RIGHT;
+			} else {
+				relx = mouse_x - (list->window.ul_x + 2);
+				if (((relx < list->thumb) || ((relx == list->thumb) && (mouse_stroke_type == DD_MC_SCROLL_PAGE_LEFT) && (!mouse_start_stroke))) && (button == 0)) {
+					result = DD_MC_SCROLL_PAGE_LEFT;
+				} else if (((relx > list->thumb) || ((relx == list->thumb) && (mouse_stroke_type == DD_MC_SCROLL_PAGE_RIGHT) && (!mouse_start_stroke))) && (button == 0)) {
+					result = DD_MC_SCROLL_PAGE_RIGHT;
+				} else {
+					result = DD_MC_SCROLL;
+				}
+			}
+		}
+	} else {
+		if (mouse_in_box(list->window.lr_x, list->window.ul_y + 1,
+			list->window.lr_x, list->window.lr_y - 1)) {
+			if (mouse_y == list->window.ul_y + 1) {
+				result = DD_MC_SCROLL_UP;
+			} else if (mouse_y == list->window.lr_y - 1) {
+				result = DD_MC_SCROLL_DOWN;
+			} else {
+				rely = mouse_y - (list->window.ul_y + 2);
+				if (((rely < list->thumb) || ((rely == list->thumb) && (mouse_stroke_type == DD_MC_SCROLL_PAGE_UP) && (!mouse_start_stroke))) && (button == 0)) {
+					result = DD_MC_SCROLL_PAGE_UP;
+				} else if (((rely > list->thumb) || ((rely == list->thumb) && (mouse_stroke_type == DD_MC_SCROLL_PAGE_DOWN) && (!mouse_start_stroke))) && (button == 0)) {
+					result = DD_MC_SCROLL_PAGE_DOWN;
+				} else {
+					result = DD_MC_SCROLL;
+				}
+			}
+		}
+	}
+
+	return result;
+}
+
+/**
+ * Routine to handle selection of a substring with the mouse
+ *
+ * @param dialog	Dialog
+ * @param item		String item
+ */
+static void dialog_exec_mouse_string(DialogPtr dialog, ItemPtr item) {
+	int buf;
+
+	if (mouse_y == (dialog->base_y + item->y)) {
+		buf = item->buf_id;
+		dialog->buf_cursor[buf] = mouse_x - (dialog->base_x + item->x2);
+		if (dialog->buf_cursor[buf] < 0) dialog->buf_cursor[buf] = 0;
+		if (dialog->buf_cursor[buf] > item->buf_width) dialog->buf_cursor[buf] = item->buf_width;
+		if (mouse_start_stroke) {
+			if (dialog->active_item != item->id) {
+				dialog->buf_select[buf] = true;
+				dialog->buf_selbase[buf] = 0;
+				dialog->buf_seltarget[buf] = strlen(dialog->buffer[buf]);
+				dialog->buf_cursor[buf] = dialog->buf_seltarget[buf];
+			} else {
+				dialog->buf_select[buf] = true;
+				dialog->buf_selbase[buf] = dialog->buf_cursor[buf];
+				dialog->buf_seltarget[buf] = dialog->buf_cursor[buf];
+			}
+		} else {
+			dialog->buf_seltarget[buf] = dialog->buf_cursor[buf];
+		}
+	}
+}
+
+/**
+ * Routine to deal with the mouse when it is doing something
+ * in a list window (clicking, double-clicking, or dragging).
+ *
+ * @param dialog	Dialog
+ * @param item		Item
+ */
+static void dialog_exec_mouse_list(DialogPtr dialog, ItemPtr item) {
+	ListPtr list;
+	ItemPtr baseitem;
+	int test;
+	int looking, look_x, look_y, look_x2, look_y2;
+	int row, col;
+	int buf;
+	int old_pick;
+	int abort;
+	static long mouse_list_timing;
+	static long mouse_drag_timing;
+
+	if (mouse_start_stroke) mouse_drag_timing = timer_read_dos() + MOUSE_TIMING_TWO;
+
+	list = &dialog->lists[item->buf_id];
+	test = in_scroll_box(list, mouse_button);
+	if (test && mouse_start_stroke) {
+		mouse_stroke_type = test;
+		mouse_scroll_list = list;
+		mouse_scroll_item = item;
+	} else {
+		looking = true;
+
+		// Find out which list entry is being picked


Commit: 071073ea20df39ba1ed822a3e95ec19373f03c97
    https://github.com/scummvm/scummvm/commit/071073ea20df39ba1ed822a3e95ec19373f03c97
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-21T21:49:50+10:00

Commit Message:
MADS: Merge MADSV2 sub-namespace into main MADS namespace

Changed paths:
    engines/mads/animview/anim_timer.cpp
    engines/mads/animview/anim_timer.h
    engines/mads/animview/animview.cpp
    engines/mads/animview/animview.h
    engines/mads/animview/functions.cpp
    engines/mads/animview/functions.h
    engines/mads/console.cpp
    engines/mads/console.h
    engines/mads/core/anim.cpp
    engines/mads/core/anim.h
    engines/mads/core/attr.cpp
    engines/mads/core/attr.h
    engines/mads/core/btype.h
    engines/mads/core/buffer.cpp
    engines/mads/core/buffer.h
    engines/mads/core/camera.cpp
    engines/mads/core/camera.h
    engines/mads/core/color.cpp
    engines/mads/core/color.h
    engines/mads/core/concat.h
    engines/mads/core/config.cpp
    engines/mads/core/config.h
    engines/mads/core/conv.cpp
    engines/mads/core/conv.h
    engines/mads/core/cursor.cpp
    engines/mads/core/cursor.h
    engines/mads/core/cycle.cpp
    engines/mads/core/cycle.h
    engines/mads/core/dialog.cpp
    engines/mads/core/dialog.h
    engines/mads/core/echo.h
    engines/mads/core/ems.cpp
    engines/mads/core/ems.h
    engines/mads/core/env.cpp
    engines/mads/core/env.h
    engines/mads/core/error.cpp
    engines/mads/core/error.h
    engines/mads/core/fileio.cpp
    engines/mads/core/fileio.h
    engines/mads/core/font.cpp
    engines/mads/core/font.h
    engines/mads/core/game.cpp
    engines/mads/core/game.h
    engines/mads/core/general.h
    engines/mads/core/global.cpp
    engines/mads/core/global.h
    engines/mads/core/heap.cpp
    engines/mads/core/heap.h
    engines/mads/core/himem.cpp
    engines/mads/core/himem.h
    engines/mads/core/hspot.cpp
    engines/mads/core/hspot.h
    engines/mads/core/image.cpp
    engines/mads/core/image.h
    engines/mads/core/imath.cpp
    engines/mads/core/imath.h
    engines/mads/core/implode.cpp
    engines/mads/core/implode.h
    engines/mads/core/inter.cpp
    engines/mads/core/inter.h
    engines/mads/core/kernel.cpp
    engines/mads/core/kernel.h
    engines/mads/core/keys.cpp
    engines/mads/core/keys.h
    engines/mads/core/lib.cpp
    engines/mads/core/lib.h
    engines/mads/core/loader.cpp
    engines/mads/core/loader.h
    engines/mads/core/mads.h
    engines/mads/core/magic.cpp
    engines/mads/core/magic.h
    engines/mads/core/matte.cpp
    engines/mads/core/matte.h
    engines/mads/core/mcga.cpp
    engines/mads/core/mcga.h
    engines/mads/core/mem.cpp
    engines/mads/core/mem.h
    engines/mads/core/mouse.cpp
    engines/mads/core/mouse.h
    engines/mads/core/mps_archive.cpp
    engines/mads/core/mps_archive.h
    engines/mads/core/object.cpp
    engines/mads/core/object.h
    engines/mads/core/pack.cpp
    engines/mads/core/pack.h
    engines/mads/core/pal.cpp
    engines/mads/core/pal.h
    engines/mads/core/pfab.cpp
    engines/mads/core/pfab.h
    engines/mads/core/player.cpp
    engines/mads/core/player.h
    engines/mads/core/popup.cpp
    engines/mads/core/popup.h
    engines/mads/core/qual.h
    engines/mads/core/quote.cpp
    engines/mads/core/quote.h
    engines/mads/core/rail.cpp
    engines/mads/core/rail.h
    engines/mads/core/room.cpp
    engines/mads/core/room.h
    engines/mads/core/screen.cpp
    engines/mads/core/screen.h
    engines/mads/core/sort.cpp
    engines/mads/core/sort.h
    engines/mads/core/sound.cpp
    engines/mads/core/sound.h
    engines/mads/core/speech.cpp
    engines/mads/core/speech.h
    engines/mads/core/sprite.cpp
    engines/mads/core/sprite.h
    engines/mads/core/sprite_h.h
    engines/mads/core/sprite_k.cpp
    engines/mads/core/text.cpp
    engines/mads/core/text.h
    engines/mads/core/tile.cpp
    engines/mads/core/tile.h
    engines/mads/core/timer.cpp
    engines/mads/core/timer.h
    engines/mads/core/video.cpp
    engines/mads/core/video.h
    engines/mads/core/vocab.cpp
    engines/mads/core/vocab.h
    engines/mads/core/vocabh.h
    engines/mads/core/window.cpp
    engines/mads/core/window.h
    engines/mads/core/xms.cpp
    engines/mads/core/xms.h
    engines/mads/dragonsphere/asound.cpp
    engines/mads/dragonsphere/asound.h
    engines/mads/dragonsphere/dragonsphere.cpp
    engines/mads/dragonsphere/dragonsphere.h
    engines/mads/dragonsphere/global.cpp
    engines/mads/dragonsphere/global.h
    engines/mads/dragonsphere/mads/conv.h
    engines/mads/dragonsphere/mads/inventory.h
    engines/mads/dragonsphere/mads/quotes.h
    engines/mads/dragonsphere/mads/sounds.h
    engines/mads/dragonsphere/mads/words.h
    engines/mads/dragonsphere/main.cpp
    engines/mads/dragonsphere/main.h
    engines/mads/dragonsphere/main_menu.cpp
    engines/mads/dragonsphere/main_menu.h
    engines/mads/dragonsphere/menus.cpp
    engines/mads/dragonsphere/menus.h
    engines/mads/dragonsphere/rooms/room101.cpp
    engines/mads/dragonsphere/rooms/room101.h
    engines/mads/dragonsphere/rooms/room102.cpp
    engines/mads/dragonsphere/rooms/room102.h
    engines/mads/dragonsphere/rooms/room103.cpp
    engines/mads/dragonsphere/rooms/room103.h
    engines/mads/dragonsphere/rooms/room104.cpp
    engines/mads/dragonsphere/rooms/room104.h
    engines/mads/dragonsphere/rooms/room105.cpp
    engines/mads/dragonsphere/rooms/room105.h
    engines/mads/dragonsphere/rooms/room106.cpp
    engines/mads/dragonsphere/rooms/room106.h
    engines/mads/dragonsphere/rooms/room107.cpp
    engines/mads/dragonsphere/rooms/room107.h
    engines/mads/dragonsphere/rooms/room108.cpp
    engines/mads/dragonsphere/rooms/room108.h
    engines/mads/dragonsphere/rooms/room109.cpp
    engines/mads/dragonsphere/rooms/room109.h
    engines/mads/dragonsphere/rooms/room110.cpp
    engines/mads/dragonsphere/rooms/room110.h
    engines/mads/dragonsphere/rooms/room111.cpp
    engines/mads/dragonsphere/rooms/room111.h
    engines/mads/dragonsphere/rooms/room112.cpp
    engines/mads/dragonsphere/rooms/room112.h
    engines/mads/dragonsphere/rooms/room113.cpp
    engines/mads/dragonsphere/rooms/room113.h
    engines/mads/dragonsphere/rooms/room114.cpp
    engines/mads/dragonsphere/rooms/room114.h
    engines/mads/dragonsphere/rooms/room115.cpp
    engines/mads/dragonsphere/rooms/room115.h
    engines/mads/dragonsphere/rooms/room116.cpp
    engines/mads/dragonsphere/rooms/room116.h
    engines/mads/dragonsphere/rooms/room117.cpp
    engines/mads/dragonsphere/rooms/room117.h
    engines/mads/dragonsphere/rooms/room118.cpp
    engines/mads/dragonsphere/rooms/room118.h
    engines/mads/dragonsphere/rooms/room119.cpp
    engines/mads/dragonsphere/rooms/room119.h
    engines/mads/dragonsphere/rooms/room120.cpp
    engines/mads/dragonsphere/rooms/room120.h
    engines/mads/dragonsphere/rooms/room201.cpp
    engines/mads/dragonsphere/rooms/room201.h
    engines/mads/dragonsphere/rooms/room203.cpp
    engines/mads/dragonsphere/rooms/room203.h
    engines/mads/dragonsphere/rooms/room204.cpp
    engines/mads/dragonsphere/rooms/room204.h
    engines/mads/dragonsphere/rooms/room205.cpp
    engines/mads/dragonsphere/rooms/room205.h
    engines/mads/dragonsphere/rooms/room206.cpp
    engines/mads/dragonsphere/rooms/room206.h
    engines/mads/dragonsphere/rooms/room301.cpp
    engines/mads/dragonsphere/rooms/room301.h
    engines/mads/dragonsphere/rooms/room302.cpp
    engines/mads/dragonsphere/rooms/room302.h
    engines/mads/dragonsphere/rooms/room303.cpp
    engines/mads/dragonsphere/rooms/room303.h
    engines/mads/dragonsphere/rooms/room401.cpp
    engines/mads/dragonsphere/rooms/room401.h
    engines/mads/dragonsphere/rooms/room402.cpp
    engines/mads/dragonsphere/rooms/room402.h
    engines/mads/dragonsphere/rooms/room403.cpp
    engines/mads/dragonsphere/rooms/room403.h
    engines/mads/dragonsphere/rooms/room404.cpp
    engines/mads/dragonsphere/rooms/room404.h
    engines/mads/dragonsphere/rooms/room405.cpp
    engines/mads/dragonsphere/rooms/room405.h
    engines/mads/dragonsphere/rooms/room406.cpp
    engines/mads/dragonsphere/rooms/room406.h
    engines/mads/dragonsphere/rooms/room407.cpp
    engines/mads/dragonsphere/rooms/room407.h
    engines/mads/dragonsphere/rooms/room408.cpp
    engines/mads/dragonsphere/rooms/room408.h
    engines/mads/dragonsphere/rooms/room409.cpp
    engines/mads/dragonsphere/rooms/room409.h
    engines/mads/dragonsphere/rooms/room410.cpp
    engines/mads/dragonsphere/rooms/room410.h
    engines/mads/dragonsphere/rooms/room411.cpp
    engines/mads/dragonsphere/rooms/room411.h
    engines/mads/dragonsphere/rooms/room412.cpp
    engines/mads/dragonsphere/rooms/room412.h
    engines/mads/dragonsphere/rooms/room454.cpp
    engines/mads/dragonsphere/rooms/room454.h
    engines/mads/dragonsphere/rooms/room501.cpp
    engines/mads/dragonsphere/rooms/room501.h
    engines/mads/dragonsphere/rooms/room502.cpp
    engines/mads/dragonsphere/rooms/room502.h
    engines/mads/dragonsphere/rooms/room503.cpp
    engines/mads/dragonsphere/rooms/room503.h
    engines/mads/dragonsphere/rooms/room504.cpp
    engines/mads/dragonsphere/rooms/room504.h
    engines/mads/dragonsphere/rooms/room505.cpp
    engines/mads/dragonsphere/rooms/room505.h
    engines/mads/dragonsphere/rooms/room506.cpp
    engines/mads/dragonsphere/rooms/room506.h
    engines/mads/dragonsphere/rooms/room507.cpp
    engines/mads/dragonsphere/rooms/room507.h
    engines/mads/dragonsphere/rooms/room508.cpp
    engines/mads/dragonsphere/rooms/room508.h
    engines/mads/dragonsphere/rooms/room509.cpp
    engines/mads/dragonsphere/rooms/room509.h
    engines/mads/dragonsphere/rooms/room510.cpp
    engines/mads/dragonsphere/rooms/room510.h
    engines/mads/dragonsphere/rooms/room511.cpp
    engines/mads/dragonsphere/rooms/room511.h
    engines/mads/dragonsphere/rooms/room512.cpp
    engines/mads/dragonsphere/rooms/room512.h
    engines/mads/dragonsphere/rooms/room557.cpp
    engines/mads/dragonsphere/rooms/room557.h
    engines/mads/dragonsphere/rooms/room601.cpp
    engines/mads/dragonsphere/rooms/room601.h
    engines/mads/dragonsphere/rooms/room603.cpp
    engines/mads/dragonsphere/rooms/room603.h
    engines/mads/dragonsphere/rooms/room604.cpp
    engines/mads/dragonsphere/rooms/room604.h
    engines/mads/dragonsphere/rooms/room605.cpp
    engines/mads/dragonsphere/rooms/room605.h
    engines/mads/dragonsphere/rooms/room606.cpp
    engines/mads/dragonsphere/rooms/room606.h
    engines/mads/dragonsphere/rooms/room607.cpp
    engines/mads/dragonsphere/rooms/room607.h
    engines/mads/dragonsphere/rooms/room609.cpp
    engines/mads/dragonsphere/rooms/room609.h
    engines/mads/dragonsphere/rooms/room612.cpp
    engines/mads/dragonsphere/rooms/room612.h
    engines/mads/dragonsphere/rooms/room613.cpp
    engines/mads/dragonsphere/rooms/room613.h
    engines/mads/dragonsphere/rooms/room614.cpp
    engines/mads/dragonsphere/rooms/room614.h
    engines/mads/dragonsphere/rooms/room909.cpp
    engines/mads/dragonsphere/rooms/room909.h
    engines/mads/dragonsphere/rooms/section1.cpp
    engines/mads/dragonsphere/rooms/section1.h
    engines/mads/dragonsphere/rooms/section2.cpp
    engines/mads/dragonsphere/rooms/section2.h
    engines/mads/dragonsphere/rooms/section3.cpp
    engines/mads/dragonsphere/rooms/section3.h
    engines/mads/dragonsphere/rooms/section4.cpp
    engines/mads/dragonsphere/rooms/section4.h
    engines/mads/dragonsphere/rooms/section5.cpp
    engines/mads/dragonsphere/rooms/section5.h
    engines/mads/dragonsphere/rooms/section6.cpp
    engines/mads/dragonsphere/rooms/section6.h
    engines/mads/dragonsphere/rooms/section9.cpp
    engines/mads/dragonsphere/rooms/section9.h
    engines/mads/dragonsphere/sound_dragonsphere.cpp
    engines/mads/dragonsphere/sound_dragonsphere.h
    engines/mads/engine.cpp
    engines/mads/engine.h
    engines/mads/forest/digi.cpp
    engines/mads/forest/digi.h
    engines/mads/forest/extra.cpp
    engines/mads/forest/extra.h
    engines/mads/forest/forest.cpp
    engines/mads/forest/forest.h
    engines/mads/forest/global.cpp
    engines/mads/forest/global.h
    engines/mads/forest/inventory.cpp
    engines/mads/forest/inventory.h
    engines/mads/forest/journal.cpp
    engines/mads/forest/journal.h
    engines/mads/forest/mads/inventory.h
    engines/mads/forest/mads/quotes.h
    engines/mads/forest/mads/sounds.h
    engines/mads/forest/mads/words.h
    engines/mads/forest/main.cpp
    engines/mads/forest/main.h
    engines/mads/forest/menus.cpp
    engines/mads/forest/menus.h
    engines/mads/forest/midi.cpp
    engines/mads/forest/midi.h
    engines/mads/forest/rooms/room101.cpp
    engines/mads/forest/rooms/room103.cpp
    engines/mads/forest/rooms/room104.cpp
    engines/mads/forest/rooms/room106.cpp
    engines/mads/forest/rooms/room107.cpp
    engines/mads/forest/rooms/room199.cpp
    engines/mads/forest/rooms/room201.cpp
    engines/mads/forest/rooms/room203.cpp
    engines/mads/forest/rooms/room204.cpp
    engines/mads/forest/rooms/room205.cpp
    engines/mads/forest/rooms/room210.cpp
    engines/mads/forest/rooms/room211.cpp
    engines/mads/forest/rooms/room220.cpp
    engines/mads/forest/rooms/room221.cpp
    engines/mads/forest/rooms/room301.cpp
    engines/mads/forest/rooms/room302.cpp
    engines/mads/forest/rooms/room303.cpp
    engines/mads/forest/rooms/room304.cpp
    engines/mads/forest/rooms/room305.cpp
    engines/mads/forest/rooms/room306.cpp
    engines/mads/forest/rooms/room307.cpp
    engines/mads/forest/rooms/room308.cpp
    engines/mads/forest/rooms/room321.cpp
    engines/mads/forest/rooms/room322.cpp
    engines/mads/forest/rooms/room401.cpp
    engines/mads/forest/rooms/room402.cpp
    engines/mads/forest/rooms/room403.cpp
    engines/mads/forest/rooms/room404.cpp
    engines/mads/forest/rooms/room405.cpp
    engines/mads/forest/rooms/room420.cpp
    engines/mads/forest/rooms/room501.cpp
    engines/mads/forest/rooms/room503.cpp
    engines/mads/forest/rooms/room509.cpp
    engines/mads/forest/rooms/room510.cpp
    engines/mads/forest/rooms/room520.cpp
    engines/mads/forest/rooms/room901.cpp
    engines/mads/forest/rooms/room903.cpp
    engines/mads/forest/rooms/room904.cpp
    engines/mads/forest/rooms/section1.cpp
    engines/mads/forest/rooms/section1.h
    engines/mads/forest/rooms/section2.cpp
    engines/mads/forest/rooms/section2.h
    engines/mads/forest/rooms/section3.cpp
    engines/mads/forest/rooms/section3.h
    engines/mads/forest/rooms/section4.cpp
    engines/mads/forest/rooms/section4.h
    engines/mads/forest/rooms/section5.cpp
    engines/mads/forest/rooms/section5.h
    engines/mads/forest/rooms/section9.cpp
    engines/mads/forest/rooms/section9.h
    engines/mads/mads.h
    engines/mads/metaengine.cpp
    engines/mads/nebular/asound.cpp
    engines/mads/nebular/asound.h
    engines/mads/nebular/console.cpp
    engines/mads/nebular/console.h
    engines/mads/nebular/copy.cpp
    engines/mads/nebular/copy.h
    engines/mads/nebular/extra.cpp
    engines/mads/nebular/extra.h
    engines/mads/nebular/global.cpp
    engines/mads/nebular/global.h
    engines/mads/nebular/mads/inventory.h
    engines/mads/nebular/mads/quotes.h
    engines/mads/nebular/mads/sounds.h
    engines/mads/nebular/mads/words.h
    engines/mads/nebular/main.cpp
    engines/mads/nebular/main.h
    engines/mads/nebular/main_menu.cpp
    engines/mads/nebular/main_menu.h
    engines/mads/nebular/menus.cpp
    engines/mads/nebular/menus.h
    engines/mads/nebular/nebular.cpp
    engines/mads/nebular/nebular.h
    engines/mads/nebular/popup.cpp
    engines/mads/nebular/popup.h
    engines/mads/nebular/rooms/dialog.cpp
    engines/mads/nebular/rooms/dialog.h
    engines/mads/nebular/rooms/forcefield.cpp
    engines/mads/nebular/rooms/forcefield.h
    engines/mads/nebular/rooms/room101.cpp
    engines/mads/nebular/rooms/room102.cpp
    engines/mads/nebular/rooms/room103.cpp
    engines/mads/nebular/rooms/room104.cpp
    engines/mads/nebular/rooms/room105.cpp
    engines/mads/nebular/rooms/room106.cpp
    engines/mads/nebular/rooms/room107.cpp
    engines/mads/nebular/rooms/room108.cpp
    engines/mads/nebular/rooms/room109.cpp
    engines/mads/nebular/rooms/room110.cpp
    engines/mads/nebular/rooms/room111.cpp
    engines/mads/nebular/rooms/room112.cpp
    engines/mads/nebular/rooms/room201.cpp
    engines/mads/nebular/rooms/room202.cpp
    engines/mads/nebular/rooms/room203.cpp
    engines/mads/nebular/rooms/room205.cpp
    engines/mads/nebular/rooms/room207.cpp
    engines/mads/nebular/rooms/room208.cpp
    engines/mads/nebular/rooms/room209.cpp
    engines/mads/nebular/rooms/room210.cpp
    engines/mads/nebular/rooms/room211.cpp
    engines/mads/nebular/rooms/room212.cpp
    engines/mads/nebular/rooms/room213.cpp
    engines/mads/nebular/rooms/room214.cpp
    engines/mads/nebular/rooms/room215.cpp
    engines/mads/nebular/rooms/room216.cpp
    engines/mads/nebular/rooms/room301.cpp
    engines/mads/nebular/rooms/room302.cpp
    engines/mads/nebular/rooms/room303.cpp
    engines/mads/nebular/rooms/room304.cpp
    engines/mads/nebular/rooms/room307.cpp
    engines/mads/nebular/rooms/room308.cpp
    engines/mads/nebular/rooms/room309.cpp
    engines/mads/nebular/rooms/room310.cpp
    engines/mads/nebular/rooms/room311.cpp
    engines/mads/nebular/rooms/room313.cpp
    engines/mads/nebular/rooms/room316.cpp
    engines/mads/nebular/rooms/room318.cpp
    engines/mads/nebular/rooms/room319.cpp
    engines/mads/nebular/rooms/room320.cpp
    engines/mads/nebular/rooms/room321.cpp
    engines/mads/nebular/rooms/room322.cpp
    engines/mads/nebular/rooms/room351.cpp
    engines/mads/nebular/rooms/room352.cpp
    engines/mads/nebular/rooms/room353.cpp
    engines/mads/nebular/rooms/room354.cpp
    engines/mads/nebular/rooms/room357.cpp
    engines/mads/nebular/rooms/room358.cpp
    engines/mads/nebular/rooms/room359.cpp
    engines/mads/nebular/rooms/room360.cpp
    engines/mads/nebular/rooms/room361.cpp
    engines/mads/nebular/rooms/room366.cpp
    engines/mads/nebular/rooms/room387.cpp
    engines/mads/nebular/rooms/room388.cpp
    engines/mads/nebular/rooms/room389.cpp
    engines/mads/nebular/rooms/room390.cpp
    engines/mads/nebular/rooms/room391.cpp
    engines/mads/nebular/rooms/room399.cpp
    engines/mads/nebular/rooms/room401.cpp
    engines/mads/nebular/rooms/room402.cpp
    engines/mads/nebular/rooms/room405.cpp
    engines/mads/nebular/rooms/room406.cpp
    engines/mads/nebular/rooms/room407.cpp
    engines/mads/nebular/rooms/room408.cpp
    engines/mads/nebular/rooms/room409.cpp
    engines/mads/nebular/rooms/room410.cpp
    engines/mads/nebular/rooms/room411.cpp
    engines/mads/nebular/rooms/room413.cpp
    engines/mads/nebular/rooms/room501.cpp
    engines/mads/nebular/rooms/room502.cpp
    engines/mads/nebular/rooms/room503.cpp
    engines/mads/nebular/rooms/room504.cpp
    engines/mads/nebular/rooms/room505.cpp
    engines/mads/nebular/rooms/room506.cpp
    engines/mads/nebular/rooms/room507.cpp
    engines/mads/nebular/rooms/room508.cpp
    engines/mads/nebular/rooms/room511.cpp
    engines/mads/nebular/rooms/room512.cpp
    engines/mads/nebular/rooms/room513.cpp
    engines/mads/nebular/rooms/room515.cpp
    engines/mads/nebular/rooms/room551.cpp
    engines/mads/nebular/rooms/room601.cpp
    engines/mads/nebular/rooms/room602.cpp
    engines/mads/nebular/rooms/room603.cpp
    engines/mads/nebular/rooms/room604.cpp
    engines/mads/nebular/rooms/room605.cpp
    engines/mads/nebular/rooms/room607.cpp
    engines/mads/nebular/rooms/room608.cpp
    engines/mads/nebular/rooms/room609.cpp
    engines/mads/nebular/rooms/room610.cpp
    engines/mads/nebular/rooms/room611.cpp
    engines/mads/nebular/rooms/room612.cpp
    engines/mads/nebular/rooms/room620.cpp
    engines/mads/nebular/rooms/room701.cpp
    engines/mads/nebular/rooms/room702.cpp
    engines/mads/nebular/rooms/room703.cpp
    engines/mads/nebular/rooms/room704.cpp
    engines/mads/nebular/rooms/room705.cpp
    engines/mads/nebular/rooms/room706.cpp
    engines/mads/nebular/rooms/room707.cpp
    engines/mads/nebular/rooms/room710.cpp
    engines/mads/nebular/rooms/room711.cpp
    engines/mads/nebular/rooms/room751.cpp
    engines/mads/nebular/rooms/room752.cpp
    engines/mads/nebular/rooms/room801.cpp
    engines/mads/nebular/rooms/room802.cpp
    engines/mads/nebular/rooms/room803.cpp
    engines/mads/nebular/rooms/room804.cpp
    engines/mads/nebular/rooms/room805.cpp
    engines/mads/nebular/rooms/room807.cpp
    engines/mads/nebular/rooms/room808.cpp
    engines/mads/nebular/rooms/room810.cpp
    engines/mads/nebular/rooms/section1.cpp
    engines/mads/nebular/rooms/section1.h
    engines/mads/nebular/rooms/section2.cpp
    engines/mads/nebular/rooms/section2.h
    engines/mads/nebular/rooms/section3.cpp
    engines/mads/nebular/rooms/section3.h
    engines/mads/nebular/rooms/section4.cpp
    engines/mads/nebular/rooms/section4.h
    engines/mads/nebular/rooms/section5.cpp
    engines/mads/nebular/rooms/section5.h
    engines/mads/nebular/rooms/section6.cpp
    engines/mads/nebular/rooms/section6.h
    engines/mads/nebular/rooms/section7.cpp
    engines/mads/nebular/rooms/section7.h
    engines/mads/nebular/rooms/section8.cpp
    engines/mads/nebular/rooms/section8.h
    engines/mads/nebular/rooms/teleporter.cpp
    engines/mads/nebular/rooms/teleporter.h
    engines/mads/nebular/rooms/thunks.cpp
    engines/mads/nebular/rooms/thunks.h
    engines/mads/nebular/sound_nebular.cpp
    engines/mads/nebular/sound_nebular.h
    engines/mads/phantom/asound.cpp
    engines/mads/phantom/asound.h
    engines/mads/phantom/catacombs.cpp
    engines/mads/phantom/catacombs.h
    engines/mads/phantom/global.cpp
    engines/mads/phantom/global.h
    engines/mads/phantom/mads/conv.h
    engines/mads/phantom/mads/inventory.h
    engines/mads/phantom/mads/quotes.h
    engines/mads/phantom/mads/sounds.h
    engines/mads/phantom/mads/speeches.h
    engines/mads/phantom/mads/text.h
    engines/mads/phantom/mads/words.h
    engines/mads/phantom/main.cpp
    engines/mads/phantom/main.h
    engines/mads/phantom/main_menu.cpp
    engines/mads/phantom/main_menu.h
    engines/mads/phantom/menus.cpp
    engines/mads/phantom/menus.h
    engines/mads/phantom/phantom.cpp
    engines/mads/phantom/phantom.h
    engines/mads/phantom/rooms/room101.cpp
    engines/mads/phantom/rooms/room101.h
    engines/mads/phantom/rooms/room102.cpp
    engines/mads/phantom/rooms/room102.h
    engines/mads/phantom/rooms/room103.cpp
    engines/mads/phantom/rooms/room103.h
    engines/mads/phantom/rooms/room104.cpp
    engines/mads/phantom/rooms/room104.h
    engines/mads/phantom/rooms/room105.cpp
    engines/mads/phantom/rooms/room105.h
    engines/mads/phantom/rooms/room106.cpp
    engines/mads/phantom/rooms/room106.h
    engines/mads/phantom/rooms/room107.cpp
    engines/mads/phantom/rooms/room107.h
    engines/mads/phantom/rooms/room108.cpp
    engines/mads/phantom/rooms/room108.h
    engines/mads/phantom/rooms/room109.cpp
    engines/mads/phantom/rooms/room109.h
    engines/mads/phantom/rooms/room110.cpp
    engines/mads/phantom/rooms/room110.h
    engines/mads/phantom/rooms/room111.cpp
    engines/mads/phantom/rooms/room111.h
    engines/mads/phantom/rooms/room112.cpp
    engines/mads/phantom/rooms/room112.h
    engines/mads/phantom/rooms/room113.cpp
    engines/mads/phantom/rooms/room113.h
    engines/mads/phantom/rooms/room114.cpp
    engines/mads/phantom/rooms/room114.h
    engines/mads/phantom/rooms/room150.cpp
    engines/mads/phantom/rooms/room150.h
    engines/mads/phantom/rooms/room201.cpp
    engines/mads/phantom/rooms/room201.h
    engines/mads/phantom/rooms/room202.cpp
    engines/mads/phantom/rooms/room202.h
    engines/mads/phantom/rooms/room203.cpp
    engines/mads/phantom/rooms/room203.h
    engines/mads/phantom/rooms/room204.cpp
    engines/mads/phantom/rooms/room204.h
    engines/mads/phantom/rooms/room205.cpp
    engines/mads/phantom/rooms/room205.h
    engines/mads/phantom/rooms/room206.cpp
    engines/mads/phantom/rooms/room206.h
    engines/mads/phantom/rooms/room207.cpp
    engines/mads/phantom/rooms/room207.h
    engines/mads/phantom/rooms/room208.cpp
    engines/mads/phantom/rooms/room208.h
    engines/mads/phantom/rooms/room250.cpp
    engines/mads/phantom/rooms/room250.h
    engines/mads/phantom/rooms/room301.cpp
    engines/mads/phantom/rooms/room301.h
    engines/mads/phantom/rooms/room302.cpp
    engines/mads/phantom/rooms/room302.h
    engines/mads/phantom/rooms/room303.cpp
    engines/mads/phantom/rooms/room303.h
    engines/mads/phantom/rooms/room304.cpp
    engines/mads/phantom/rooms/room304.h
    engines/mads/phantom/rooms/room305.cpp
    engines/mads/phantom/rooms/room305.h
    engines/mads/phantom/rooms/room306.cpp
    engines/mads/phantom/rooms/room306.h
    engines/mads/phantom/rooms/room307.cpp
    engines/mads/phantom/rooms/room307.h
    engines/mads/phantom/rooms/room308.cpp
    engines/mads/phantom/rooms/room308.h
    engines/mads/phantom/rooms/room309.cpp
    engines/mads/phantom/rooms/room309.h
    engines/mads/phantom/rooms/room310.cpp
    engines/mads/phantom/rooms/room310.h
    engines/mads/phantom/rooms/room401.cpp
    engines/mads/phantom/rooms/room401.h
    engines/mads/phantom/rooms/room403.cpp
    engines/mads/phantom/rooms/room403.h
    engines/mads/phantom/rooms/room404.cpp
    engines/mads/phantom/rooms/room404.h
    engines/mads/phantom/rooms/room406.cpp
    engines/mads/phantom/rooms/room406.h
    engines/mads/phantom/rooms/room407.cpp
    engines/mads/phantom/rooms/room407.h
    engines/mads/phantom/rooms/room408.cpp
    engines/mads/phantom/rooms/room408.h
    engines/mads/phantom/rooms/room409.cpp
    engines/mads/phantom/rooms/room409.h
    engines/mads/phantom/rooms/room410.cpp
    engines/mads/phantom/rooms/room410.h
    engines/mads/phantom/rooms/room453.cpp
    engines/mads/phantom/rooms/room453.h
    engines/mads/phantom/rooms/room456.cpp
    engines/mads/phantom/rooms/room456.h
    engines/mads/phantom/rooms/room501.cpp
    engines/mads/phantom/rooms/room501.h
    engines/mads/phantom/rooms/room502.cpp
    engines/mads/phantom/rooms/room502.h
    engines/mads/phantom/rooms/room504.cpp
    engines/mads/phantom/rooms/room504.h
    engines/mads/phantom/rooms/room505.cpp
    engines/mads/phantom/rooms/room505.h
    engines/mads/phantom/rooms/room506.cpp
    engines/mads/phantom/rooms/room506.h
    engines/mads/phantom/rooms/section1.cpp
    engines/mads/phantom/rooms/section1.h
    engines/mads/phantom/rooms/section2.cpp
    engines/mads/phantom/rooms/section2.h
    engines/mads/phantom/rooms/section3.cpp
    engines/mads/phantom/rooms/section3.h
    engines/mads/phantom/rooms/section4.cpp
    engines/mads/phantom/rooms/section4.h
    engines/mads/phantom/rooms/section5.cpp
    engines/mads/phantom/rooms/section5.h
    engines/mads/phantom/sound_phantom.cpp
    engines/mads/phantom/sound_phantom.h
    engines/mads/textview/textview.cpp
    engines/mads/textview/textview.h


diff --git a/engines/mads/animview/anim_timer.cpp b/engines/mads/animview/anim_timer.cpp
index a15924315ee..3d77ff3ba87 100644
--- a/engines/mads/animview/anim_timer.cpp
+++ b/engines/mads/animview/anim_timer.cpp
@@ -31,7 +31,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 static const byte FX_TIMES[16] = {
@@ -295,5 +294,4 @@ done:
 }
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/animview/anim_timer.h b/engines/mads/animview/anim_timer.h
index 5bb8fdf9de2..c623c6afb19 100644
--- a/engines/mads/animview/anim_timer.h
+++ b/engines/mads/animview/anim_timer.h
@@ -25,14 +25,12 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 extern void anim_timer_init();
 extern void anim_timer();
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/animview/animview.cpp b/engines/mads/animview/animview.cpp
index 780e9237667..4ffc617554e 100644
--- a/engines/mads/animview/animview.cpp
+++ b/engines/mads/animview/animview.cpp
@@ -38,7 +38,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 #define MADS_FORMAT(BUF, SRC) Common::strcpy_s(BUF, in_mads_mode ? "*" : ""); \
@@ -646,5 +645,4 @@ void animview_main(const char *resName) {
 }
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/animview/animview.h b/engines/mads/animview/animview.h
index b6526108c86..67b9f63a037 100644
--- a/engines/mads/animview/animview.h
+++ b/engines/mads/animview/animview.h
@@ -27,7 +27,6 @@
 #include "mads/core/cycle.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 // Variables shared with other AnimView namespace files
@@ -60,7 +59,6 @@ extern bool stop_music_at_end;
 extern void animview_main(const char *resName);
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/animview/functions.cpp b/engines/mads/animview/functions.cpp
index 40a0b112b3d..86d9bfcd7e5 100644
--- a/engines/mads/animview/functions.cpp
+++ b/engines/mads/animview/functions.cpp
@@ -29,7 +29,6 @@
 #include "mads/core/pal.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 int anim_count;
@@ -228,5 +227,4 @@ bool anim_fade(Palette *pal, int fadeAmount) {
 }
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/animview/functions.h b/engines/mads/animview/functions.h
index 70680b30253..36b797301db 100644
--- a/engines/mads/animview/functions.h
+++ b/engines/mads/animview/functions.h
@@ -26,7 +26,6 @@
 #include "mads/core/pal.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace AnimView {
 
 struct AnimEntry {
@@ -76,7 +75,6 @@ extern void anim_setup_cycle(int fx);
 extern bool anim_fade(Palette *pal, int fadeAmount);
 
 } // namespace AnimView
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/console.cpp b/engines/mads/console.cpp
index 5405c83a3a4..c765ab60d1e 100644
--- a/engines/mads/console.cpp
+++ b/engines/mads/console.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/matte.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 Console::Console() : GUI::Debugger() {
 	registerCmd("depth", WRAP_METHOD(Console, cmdDepth));
@@ -101,5 +100,4 @@ bool Console::cmdWalkable(int argc, const char **argv) {
 	return false;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/console.h b/engines/mads/console.h
index ea01c480c9d..03def51c272 100644
--- a/engines/mads/console.h
+++ b/engines/mads/console.h
@@ -25,7 +25,6 @@
 #include "gui/debugger.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern int strToInt(const char *s);
 
@@ -40,7 +39,6 @@ public:
 	~Console() override {}
 };
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/anim.cpp b/engines/mads/core/anim.cpp
index 65f5908b6b0..90d4bf3661b 100644
--- a/engines/mads/core/anim.cpp
+++ b/engines/mads/core/anim.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 ShadowList anim_shadow = { 0, { 0, 0, 0 } };
 int anim_error;
@@ -623,5 +622,4 @@ void init_anim() {
 	anim_error = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/anim.h b/engines/mads/core/anim.h
index 8bfab57123f..eb89daf805f 100644
--- a/engines/mads/core/anim.h
+++ b/engines/mads/core/anim.h
@@ -32,7 +32,6 @@
 #include "mads/core/tile.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* Flags to be passed to anim_load().  Note that all PAL_MAP... flags */
 /* can be passed through as well.                                     */
@@ -460,7 +459,6 @@ int anim_himem_preload(char *name, int level);
 
 extern void init_anim();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/attr.cpp b/engines/mads/core/attr.cpp
index 11b5835a3de..a5a73f93eea 100644
--- a/engines/mads/core/attr.cpp
+++ b/engines/mads/core/attr.cpp
@@ -28,7 +28,6 @@
 #include "mads/core/dialog.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int attr_load_error = 0;
 
@@ -203,5 +202,4 @@ void init_attr() {
 	attr_load_error = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/attr.h b/engines/mads/core/attr.h
index b120c1e86bb..f7b40942b71 100644
--- a/engines/mads/core/attr.h
+++ b/engines/mads/core/attr.h
@@ -27,7 +27,6 @@
 #include "mads/core/tile.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define ATTR_WALK_MASK         0x80
 #define ATTR_SPECIAL_MASK      0x70
@@ -52,7 +51,6 @@ extern int attr_load_error;
 
 extern void init_attr();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/btype.h b/engines/mads/core/btype.h
index 818f41ba631..c516c436adf 100644
--- a/engines/mads/core/btype.h
+++ b/engines/mads/core/btype.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern byte upcaseb(byte inp);
 
@@ -37,7 +36,6 @@ extern int btoi(char *string);
 
 extern int stoi(char *string);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/buffer.cpp b/engines/mads/core/buffer.cpp
index 0ee8f48dd56..f7c0b1c50f1 100644
--- a/engines/mads/core/buffer.cpp
+++ b/engines/mads/core/buffer.cpp
@@ -31,7 +31,6 @@
 #include "mads/core/room.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 word pattern_control_value = 0x181d;
 word pattern_initial_value = 0xb78e;
@@ -960,5 +959,4 @@ done:
 		delete handle;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/buffer.h b/engines/mads/core/buffer.h
index 21ec14e3705..dca2363e532 100644
--- a/engines/mads/core/buffer.h
+++ b/engines/mads/core/buffer.h
@@ -26,7 +26,6 @@
 #include "mads/core/font.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MAX_PEEL_VALUE                  80
 
@@ -264,7 +263,6 @@ extern bool buffer_scan(Buffer *buffer, int magic,
 extern bool buffer_compare(Buffer *buffer0, Buffer *buffer1,
 	int base_x, int base_y, int base_x2, int base_y2, int size_x, int size_y);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/camera.cpp b/engines/mads/core/camera.cpp
index ba9bc52e1c3..5fd6666d84e 100644
--- a/engines/mads/core/camera.cpp
+++ b/engines/mads/core/camera.cpp
@@ -28,7 +28,6 @@
 #include "mads/core/inter.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 Camera camera_x;        /* Horizontal panning camera */
@@ -217,5 +216,4 @@ void init_camera() {
 	camera_old_y_target = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/camera.h b/engines/mads/core/camera.h
index c99eaa8b511..d4513ab14c9 100644
--- a/engines/mads/core/camera.h
+++ b/engines/mads/core/camera.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 #define CAMERA_PLAYER           0               /* Camera follows player  */
@@ -71,7 +70,6 @@ extern void camera_update();
 
 extern void init_camera();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/color.cpp b/engines/mads/core/color.cpp
index 4dc14557a2a..507865a3ac7 100644
--- a/engines/mads/core/color.cpp
+++ b/engines/mads/core/color.cpp
@@ -26,7 +26,6 @@
 #include "mads/core/mem.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 void Color::load(Common::SeekableReadStream *src) {
 	src->readMultipleLE(r, g, b, x16, cycle, group);
@@ -620,5 +619,4 @@ void color_buffer_list_to_x16(ColorListPtr color_list, Buffer *scan_buf) {
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/color.h b/engines/mads/core/color.h
index 4c53aa61eee..aff8a12ea71 100644
--- a/engines/mads/core/color.h
+++ b/engines/mads/core/color.h
@@ -27,7 +27,6 @@
 #include "mads/core/loader.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 #define COLOR_MAX_USER_COLORS           256
@@ -219,7 +218,6 @@ extern void color_buffer_list_to_x16(ColorListPtr color_list, Buffer *scan_buf);
  */
 extern void color_split_thatch(int thatch, int *color, int *thatching);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/concat.h b/engines/mads/core/concat.h
index b60e85329be..9d5d40e7cd3 100644
--- a/engines/mads/core/concat.h
+++ b/engines/mads/core/concat.h
@@ -25,7 +25,6 @@
 #include "common/stream.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define CONCAT_ID_STRING                "MADSCONCAT 1.0\032"
 #define CONCAT_ID_LENGTH                16
@@ -54,7 +53,6 @@ struct Concat {
 
 typedef Concat *ConcatPtr;
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/config.cpp b/engines/mads/core/config.cpp
index 7fa379b342a..e2bc12518ea 100644
--- a/engines/mads/core/config.cpp
+++ b/engines/mads/core/config.cpp
@@ -27,7 +27,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 ConfigFile config_file = {
 	0, 0x220,
@@ -117,5 +116,4 @@ void global_unload_config_parameters() {
 	config_file.screen_fade = kernel_screen_fade;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/config.h b/engines/mads/core/config.h
index 662456b138e..841d5982a38 100644
--- a/engines/mads/core/config.h
+++ b/engines/mads/core/config.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 enum {
 	INTERFACE_MACINTOSH			= 0,      /* Macintosh interface   */
@@ -125,7 +124,6 @@ extern void write_config_file();
 //extern void global_load_config_parameters();
 //extern void global_unload_config_parameters();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/conv.cpp b/engines/mads/core/conv.cpp
index 9016c29867a..469ecae3c2a 100644
--- a/engines/mads/core/conv.cpp
+++ b/engines/mads/core/conv.cpp
@@ -41,7 +41,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 Conv *conv[CONV_MAX_DATA];
 ConvData *conv_data[CONV_MAX_DATA];
@@ -1843,5 +1842,4 @@ void init_conv() {
 	Common::fill(conv_data, conv_data + CONV_MAX_DATA, (ConvData *)nullptr);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/conv.h b/engines/mads/core/conv.h
index 9827c23cbd0..e333bd5464d 100644
--- a/engines/mads/core/conv.h
+++ b/engines/mads/core/conv.h
@@ -26,7 +26,6 @@
 #include "common/stream.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 // Return of the Phantom needs 40, Dragonsphere needs 70
 constexpr int CONV_MAX_SLOTS = 70;
@@ -234,7 +233,6 @@ extern int conv_expand(Common::SeekableReadStream *handle);
 
 extern void init_conv();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/cursor.cpp b/engines/mads/core/cursor.cpp
index a3fae5d97fc..ac791863a67 100644
--- a/engines/mads/core/cursor.cpp
+++ b/engines/mads/core/cursor.cpp
@@ -23,7 +23,6 @@
 #include "mads/core/screen.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int cursor_mode;             /* global cursor mode (insert/overwrite) */
 int cursor_follow = false;
@@ -64,5 +63,4 @@ void init_cursor() {
 	text_y = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/cursor.h b/engines/mads/core/cursor.h
index fd9bf5a1258..59489045aab 100644
--- a/engines/mads/core/cursor.h
+++ b/engines/mads/core/cursor.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define CURSOR_OFF                   0       /* Cursor off                     */
 #define CURSOR_ON                    1       /* Cursor on                      */
@@ -52,7 +51,6 @@ extern void cursor_set_follow(int follow);
 
 extern void init_cursor();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/cycle.cpp b/engines/mads/core/cycle.cpp
index 2cbb21ddebd..68aa0246522 100644
--- a/engines/mads/core/cycle.cpp
+++ b/engines/mads/core/cycle.cpp
@@ -27,7 +27,6 @@
 #include "mads/core/pal.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 Palette cycling_palette;
 
@@ -134,5 +133,4 @@ void init_cycle() {
 	memset(cycle_timing, 0, sizeof(cycle_timing));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/cycle.h b/engines/mads/core/cycle.h
index cc9a4251851..f6541075aac 100644
--- a/engines/mads/core/cycle.h
+++ b/engines/mads/core/cycle.h
@@ -25,7 +25,6 @@
 #include "mads/core/color.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern Palette cycling_palette;         /* Palette being used for cycling */
 
@@ -42,7 +41,6 @@ void cycle_colors();
 
 extern void init_cycle();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/dialog.cpp b/engines/mads/core/dialog.cpp
index 331511e354c..d6e820efaa2 100644
--- a/engines/mads/core/dialog.cpp
+++ b/engines/mads/core/dialog.cpp
@@ -31,7 +31,6 @@
 #include "mads/core/timer.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 /* public global variables */
@@ -3340,5 +3339,4 @@ void init_dialog() {
 	alert_hilite_color = DD_DEFAULT_HILITE_COLOR;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/dialog.h b/engines/mads/core/dialog.h
index 1f0d8569ad9..a2373b2f250 100644
--- a/engines/mads/core/dialog.h
+++ b/engines/mads/core/dialog.h
@@ -27,7 +27,6 @@
 #include "mads/core/keys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define DIALOG_ENGLISH          0       /* English language                */
 #define DIALOG_GERMAN           1       /* German  language                */
@@ -416,7 +415,6 @@ extern void dialog_watch_point(const char *string, long x, long y);
 
 extern void init_dialog();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/echo.h b/engines/mads/core/echo.h
index 00dff87ee77..dbec100b038 100644
--- a/engines/mads/core/echo.h
+++ b/engines/mads/core/echo.h
@@ -26,7 +26,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 inline void echo(const char *item, bool carriage_return) {
 	auto &dbg = *g_engine->getDebugger();
@@ -36,7 +35,6 @@ inline void echo(const char *item, bool carriage_return) {
 		dbg.debugPrintf("\n");
 }
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/ems.cpp b/engines/mads/core/ems.cpp
index 7ccd2ba0daf..9c819f5e83f 100644
--- a/engines/mads/core/ems.cpp
+++ b/engines/mads/core/ems.cpp
@@ -22,7 +22,6 @@
 #include "mads/core/ems.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 word ems_page_frame = 0;
 word ems_handle = 0;
@@ -76,5 +75,4 @@ void ems_shutdown() {
 	ems_exists = false;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/ems.h b/engines/mads/core/ems.h
index 3e378b893a7..36472f5b4b8 100644
--- a/engines/mads/core/ems.h
+++ b/engines/mads/core/ems.h
@@ -25,7 +25,6 @@
 #include "mads/core/pack.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define EMS_PAGING_CLASSES      4       /* # of paging classes            */
 
@@ -126,7 +125,6 @@ inline int ems_map_buffer(int buffer_page_handle) { return 0; }
 inline int ems_search_page(int ems_handle_, int page_number) { return 0; }
 inline void ems_buffer_to_buffer(int source_handle, int target_handle) {}
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/env.cpp b/engines/mads/core/env.cpp
index 3c89f9a45b0..fb36f42651e 100644
--- a/engines/mads/core/env.cpp
+++ b/engines/mads/core/env.cpp
@@ -29,7 +29,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern int art_hags_are_on_hd;
 
@@ -740,5 +739,4 @@ done:
 	return error_flag;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/env.h b/engines/mads/core/env.h
index c2e59b73046..da5e1cbc156 100644
--- a/engines/mads/core/env.h
+++ b/engines/mads/core/env.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MADS_ENV        "MADS"
 #define MADS_PRIV_ENV   "MADSPRIV"
@@ -128,7 +127,6 @@ extern void env_delete(char *environment, const char *variable);
  */
 extern int env_insert(char *environment, const char *variable, const char *value);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/error.cpp b/engines/mads/core/error.cpp
index 7eac23f0c5c..1d0a290410e 100644
--- a/engines/mads/core/error.cpp
+++ b/engines/mads/core/error.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/mem.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define disable_popup_errors DISABLED
 
@@ -229,5 +228,4 @@ void error_check_memory() {
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/error.h b/engines/mads/core/error.h
index 33eeabacd99..be2913e2949 100644
--- a/engines/mads/core/error.h
+++ b/engines/mads/core/error.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define NONE            0
 #define WARNING         1
@@ -146,7 +145,6 @@ extern void error_entry(char *name, char *message);
 extern void error_exit(char *name, char *message);
 extern void error_put(char *name, int item);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/fileio.cpp b/engines/mads/core/fileio.cpp
index e65d366a6a4..680b6ff065c 100644
--- a/engines/mads/core/fileio.cpp
+++ b/engines/mads/core/fileio.cpp
@@ -26,7 +26,6 @@
 #include "mads/core/fileio.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define SLOW_BUFFER_SIZE        256
 
@@ -464,5 +463,4 @@ void fileio_purge_all_spaces(char *text) {
 	Common::strcpy_s(text, 65536, work);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/fileio.h b/engines/mads/core/fileio.h
index eb053be9f57..8f8dc4d6494 100644
--- a/engines/mads/core/fileio.h
+++ b/engines/mads/core/fileio.h
@@ -25,7 +25,6 @@
 #include "common/stream.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define fread_bufsize  1024
 
@@ -78,7 +77,6 @@ extern char *fileio_prepend(char *target, const char *source, const char *prepen
 extern char *fileio_chop_ext(char *target, const char *source);
 extern void fileio_purge_all_spaces(char *text);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/font.cpp b/engines/mads/core/font.cpp
index d7e68f42cd3..549e2179e43 100644
--- a/engines/mads/core/font.cpp
+++ b/engines/mads/core/font.cpp
@@ -29,7 +29,6 @@
 #include "mads/core/color.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 constexpr int OFFSETS_OFFSET = 2 + FONT_SIZE;
 constexpr int HEADER_SIZE = 2 + FONT_SIZE + (FONT_SIZE * 2);
@@ -260,5 +259,4 @@ void init_font() {
 	font_misc = NULL;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/font.h b/engines/mads/core/font.h
index 9a8df9fe7a1..91f0ab7e64b 100644
--- a/engines/mads/core/font.h
+++ b/engines/mads/core/font.h
@@ -25,7 +25,6 @@
 #include "mads/core/buffer.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define FONT_SIZE       128
 #define FONT_MAX_WIDTH  255
@@ -59,7 +58,6 @@ extern int font_string_width(FontPtr font, const char *out_string, int auto_spac
 
 extern void init_font();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/game.cpp b/engines/mads/core/game.cpp
index 81a809b29a5..7385f25ac1b 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/core/game.cpp
@@ -67,7 +67,6 @@
 #include "mads/forest/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern long mem_used;
 extern long mem_avail_at_start;
@@ -2689,5 +2688,4 @@ void init_game() {
 	memset(debugger_watch_index, 0, sizeof(debugger_watch_index));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/game.h b/engines/mads/core/game.h
index 7192b493336..0d4d6f8f96e 100644
--- a/engines/mads/core/game.h
+++ b/engines/mads/core/game.h
@@ -31,7 +31,6 @@
 #include "mads/core/popup.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define game_version    "1.22"          /* Version of game control code */
 #define game_date       "27-Jul-92"
@@ -278,7 +277,6 @@ extern void show_version();
 
 extern void init_game();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/general.h b/engines/mads/core/general.h
index 8a682f16ce5..4292ba3b487 100644
--- a/engines/mads/core/general.h
+++ b/engines/mads/core/general.h
@@ -25,7 +25,6 @@
 #include "common/stream.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* Code optimization parameters */
 
@@ -164,7 +163,6 @@ inline char *mads_getcwd(char *buffer, int count) {
 	return buffer;
 }
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/global.cpp b/engines/mads/core/global.cpp
index a6cea10f3c1..15fa61e7294 100644
--- a/engines/mads/core/global.cpp
+++ b/engines/mads/core/global.cpp
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int16 global[GLOBAL_LIST_SIZE];
 int global_list_size = GLOBAL_LIST_SIZE;
@@ -80,5 +79,4 @@ void init_global() {
 	memset(global, 0, sizeof(global));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/global.h b/engines/mads/core/global.h
index a3d3b9563cd..10a751f0a31 100644
--- a/engines/mads/core/global.h
+++ b/engines/mads/core/global.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern char global_release_name[];
 extern char global_release_version[];
@@ -90,7 +89,6 @@ extern void global_unload_config_parameters();
 
 extern void init_global();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/heap.cpp b/engines/mads/core/heap.cpp
index a4ef6a09325..2f27491087d 100644
--- a/engines/mads/core/heap.cpp
+++ b/engines/mads/core/heap.cpp
@@ -24,7 +24,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int heap_create(Heap *heap, int module_id, long heap_size, const char *heap_name) {
 	int error_flag = true;
@@ -82,5 +81,4 @@ done:
 	return (void *)result;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/heap.h b/engines/mads/core/heap.h
index e2cbd0cd31b..1014c807a0b 100644
--- a/engines/mads/core/heap.h
+++ b/engines/mads/core/heap.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 struct Heap {
 	byte module;		/* Identifier for heap module   */
@@ -42,7 +41,6 @@ extern void heap_declare(Heap *heap, int module_id, char *buffer, long heap_size
 
 extern void *heap_get(Heap *heap, long size);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/himem.cpp b/engines/mads/core/himem.cpp
index 738f6a68ba8..72c5e73cfea 100644
--- a/engines/mads/core/himem.cpp
+++ b/engines/mads/core/himem.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/env.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 // EMS/XMS disabled in ScummVM
 byte                himem_preload_ems_disabled = true;
@@ -670,5 +669,4 @@ void himem_flush(int level) {
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/himem.h b/engines/mads/core/himem.h
index fc405a629f7..ea942f52a92 100644
--- a/engines/mads/core/himem.h
+++ b/engines/mads/core/himem.h
@@ -27,7 +27,6 @@
 #include "mads/core/mem.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define         HIMEM_MAX_RESIDENT        150
 
@@ -72,7 +71,6 @@ extern int himem_preload(char *filename, int level);
 extern int himem_preload_series(const char *filename, int level);
 extern void himem_flush(int level);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/hspot.cpp b/engines/mads/core/hspot.cpp
index ca614f9be8f..e8691a98ff1 100644
--- a/engines/mads/core/hspot.cpp
+++ b/engines/mads/core/hspot.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/screen.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 Spot spot[max_hot_spots + 1];                    /* The list    */
 int  numspots = 0;
@@ -223,5 +222,4 @@ void init_hspot() {
 	memset(hotkeys, 0, sizeof(hotkeys));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/hspot.h b/engines/mads/core/hspot.h
index 11158a9dac3..c4e4decbe45 100644
--- a/engines/mads/core/hspot.h
+++ b/engines/mads/core/hspot.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define max_hot_spots   120     /* Size of hotspot list */
 #define max_hot_lists   2       /* Maximum # of lists   */
@@ -95,7 +94,6 @@ extern int hspot_which_reverse(int x, int y, int video_mode);
 
 extern void init_hspot();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/image.cpp b/engines/mads/core/image.cpp
index 4c9be1a5ce9..535ff36da84 100644
--- a/engines/mads/core/image.cpp
+++ b/engines/mads/core/image.cpp
@@ -22,11 +22,9 @@
 #include "mads/core/image.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 void Image::load(Common::SeekableReadStream *src) {
 	src->readMultipleLE(flags, segment_id, series_id, sprite_id, x, y, depth, scale);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/image.h b/engines/mads/core/image.h
index e86280679fe..2a78fa1f116 100644
--- a/engines/mads/core/image.h
+++ b/engines/mads/core/image.h
@@ -25,7 +25,6 @@
 #include "common/stream.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 struct Image {
 	int16  flags;         /* refers to the index of the corresponding frame in the anim struct */
@@ -51,7 +50,6 @@ struct Image {
 
 typedef Image *ImagePtr;
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/imath.cpp b/engines/mads/core/imath.cpp
index 464f802827a..5910c6d8bff 100644
--- a/engines/mads/core/imath.cpp
+++ b/engines/mads/core/imath.cpp
@@ -24,7 +24,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int imath_isqrt(long square) {
 	if (square <= 0)
@@ -91,5 +90,4 @@ int imath_random(int from, int unto) {
 	return g_engine->getRandomNumber(from, unto);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/imath.h b/engines/mads/core/imath.h
index f5af2154a2c..b51db77d15d 100644
--- a/engines/mads/core/imath.h
+++ b/engines/mads/core/imath.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /**
  * Distance: fast approximate hypotenuse with exact fallback.
@@ -50,7 +49,6 @@ extern void imath_circular_arc(word *buffer, int radius);
 
 extern int imath_random(int from, int unto);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/implode.cpp b/engines/mads/core/implode.cpp
index b5891225a9b..fbbb99a5fe4 100644
--- a/engines/mads/core/implode.cpp
+++ b/engines/mads/core/implode.cpp
@@ -24,7 +24,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /*
  * implode_explode.c
@@ -953,5 +952,4 @@ long crc32(unsigned char *buffer, word *size, long *old_crc) {
 	return *old_crc;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/implode.h b/engines/mads/core/implode.h
index 1ef7c52e3fe..27a521f331b 100644
--- a/engines/mads/core/implode.h
+++ b/engines/mads/core/implode.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern word implode(
 	word (*read_buff)(char *buffer, word *size),
@@ -61,7 +60,6 @@ extern long crc32(unsigned char *buffer, word *size, long *old_crc);
 #define CMP_BAD_DATA           3
 #define CMP_ABORT              4
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/inter.cpp b/engines/mads/core/inter.cpp
index 42ef6f7eb87..af79189431f 100644
--- a/engines/mads/core/inter.cpp
+++ b/engines/mads/core/inter.cpp
@@ -51,7 +51,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define disable_error_check
 
@@ -2244,5 +2243,4 @@ done:
 	return error_flag;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/inter.h b/engines/mads/core/inter.h
index 6f25dd7df60..e0c5e5cbd06 100644
--- a/engines/mads/core/inter.h
+++ b/engines/mads/core/inter.h
@@ -27,7 +27,6 @@
 #include "mads/core/anim.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define inter_columns           5
 #define inter_delta_y           8
@@ -339,7 +338,6 @@ extern int inter_load_background(const char *name, Buffer *target);
 
 extern void init_inter();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/kernel.cpp b/engines/mads/core/kernel.cpp
index d485b98b0ea..2cf094f315c 100644
--- a/engines/mads/core/kernel.cpp
+++ b/engines/mads/core/kernel.cpp
@@ -61,7 +61,6 @@
 #include "mads/nebular/extra.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MESSAGE_COLOR_3 (((KERNEL_MESSAGE_COLOR_BASE_3 + 1) << 8) + KERNEL_MESSAGE_COLOR_BASE_3)
 #define MESSAGE_COLOR           (((KERNEL_MESSAGE_COLOR_BASE   + 1) << 8) + KERNEL_MESSAGE_COLOR_BASE)
@@ -3015,5 +3014,4 @@ void init_kernel() {
 	memset(kernel_interface_loaded, 0, sizeof(kernel_interface_loaded));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/kernel.h b/engines/mads/core/kernel.h
index b56878bb0a1..391d3c16dac 100644
--- a/engines/mads/core/kernel.h
+++ b/engines/mads/core/kernel.h
@@ -30,7 +30,6 @@
 #include "mads/core/room.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* Some handy location macros */
 
@@ -619,7 +618,6 @@ extern void init_kernel();
 extern void kernel_random_frame(int handle, int16 *frame, int mode);
 extern void kernel_translate_anim(int handle, int delta_x, int delta_y, int delta_scale);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/keys.cpp b/engines/mads/core/keys.cpp
index cd50c789cd8..6d4a1c6a83c 100644
--- a/engines/mads/core/keys.cpp
+++ b/engines/mads/core/keys.cpp
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 word keys_special_button;
 
@@ -154,5 +153,4 @@ void init_keys() {
 	keys_special_button = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/keys.h b/engines/mads/core/keys.h
index 831479cea7a..e90f316568b 100644
--- a/engines/mads/core/keys.h
+++ b/engines/mads/core/keys.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* keystroke defines */
 
@@ -260,7 +259,6 @@ extern void keys_disable();
 
 extern void init_keys();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/lib.cpp b/engines/mads/core/lib.cpp
index e695906a4d0..c047126ebfe 100644
--- a/engines/mads/core/lib.cpp
+++ b/engines/mads/core/lib.cpp
@@ -23,7 +23,6 @@
 #include "mads/core/lib.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 char mads_dev_lib_version[5] = lib_version;
 char mads_dev_lib_date[11] = lib_date;
@@ -33,5 +32,4 @@ void lib_show_version() {
 		mads_dev_lib_version, mads_dev_lib_date);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/lib.h b/engines/mads/core/lib.h
index fdbc2173e4c..4fbffb52cad 100644
--- a/engines/mads/core/lib.h
+++ b/engines/mads/core/lib.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define lib_version          "4.35"
 #define lib_date             "10-Aug-93"
@@ -35,7 +34,6 @@ extern char mads_dev_lib_date[11];
 
 void lib_show_version();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/loader.cpp b/engines/mads/core/loader.cpp
index d4f091bda30..dceb93ad998 100644
--- a/engines/mads/core/loader.cpp
+++ b/engines/mads/core/loader.cpp
@@ -34,7 +34,6 @@
 #include "mads/core/pack.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 /* debug stuff */
@@ -380,5 +379,4 @@ long loader_write_2(Common::WriteStream *source_handle, long total_size, LoadHan
 	return result == total_size;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/loader.h b/engines/mads/core/loader.h
index 5df7f7c821a..b766723ae21 100644
--- a/engines/mads/core/loader.h
+++ b/engines/mads/core/loader.h
@@ -28,7 +28,6 @@
 #include "mads/core/pack.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define LOADER_DISK     0       /* File being read from disk */
 #define LOADER_EMS      1       /* File being read from ems  */
@@ -105,7 +104,6 @@ extern void loader_skip_entries(LoadHandle handle, int count);
 extern long loader_write(void *target, long record_size, long record_count, LoadHandle handle);
 extern long loader_write_2(Common::WriteStream *source_handle, long total_size, LoadHandle handle);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/mads.h b/engines/mads/core/mads.h
index 72e81053e96..5659bd92453 100644
--- a/engines/mads/core/mads.h
+++ b/engines/mads/core/mads.h
@@ -23,14 +23,12 @@
 #define MADS_CORE_MADS_H
 
 namespace MADS {
-namespace MADSV2 {
 
 #define GLOBAL          1
 #define SECTION         2
 #define ROOM            3
 #define OBJECT          4
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/magic.cpp b/engines/mads/core/magic.cpp
index 335cd702dc4..efd95480644 100644
--- a/engines/mads/core/magic.cpp
+++ b/engines/mads/core/magic.cpp
@@ -34,7 +34,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define magic_red       30
 #define magic_green     59
@@ -1095,5 +1094,4 @@ int magic_hash_color(RGBcolor *hash_color) {
 	return (hash_color->r * 38) + (hash_color->g * 76) + (hash_color->b * 14);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/magic.h b/engines/mads/core/magic.h
index 9ee2191ae0c..e740f1e0cde 100644
--- a/engines/mads/core/magic.h
+++ b/engines/mads/core/magic.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MAGIC_LOWER_LEFT      1
 #define MAGIC_LOWER_RIGHT     2
@@ -164,7 +163,6 @@ extern int  magic_closest_color(RGBcolor *match_color, byte *list, int list_wrap
  */
 extern int magic_hash_color(RGBcolor *hash_color);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/matte.cpp b/engines/mads/core/matte.cpp
index 58469b9546c..93638c5b68f 100644
--- a/engines/mads/core/matte.cpp
+++ b/engines/mads/core/matte.cpp
@@ -44,7 +44,6 @@
 #endif
 
 namespace MADS {
-namespace MADSV2 {
 
 #define word_align_mattes
 
@@ -1259,5 +1258,4 @@ void init_matte() {
 	image_inter_marker = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/matte.h b/engines/mads/core/matte.h
index e765377c08b..863d0b92475 100644
--- a/engines/mads/core/matte.h
+++ b/engines/mads/core/matte.h
@@ -27,7 +27,6 @@
 #include "mads/core/tile.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define SERIES_LIST_SIZE        50
 
@@ -146,7 +145,6 @@ extern void matte_refresh_inter();
 
 extern void init_matte();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/mcga.cpp b/engines/mads/core/mcga.cpp
index 5e1d50b72ec..ffcdca30cb3 100644
--- a/engines/mads/core/mcga.cpp
+++ b/engines/mads/core/mcga.cpp
@@ -27,7 +27,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define mcga_retrace_magic      14      /* Dave McKibbin's magic heuristic # */
 
@@ -159,5 +158,4 @@ void mcga_reset() {
 	mcga_setpal(&temp_palette);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/mcga.h b/engines/mads/core/mcga.h
index 98ee9c5a7dc..80a7ef19316 100644
--- a/engines/mads/core/mcga.h
+++ b/engines/mads/core/mcga.h
@@ -26,7 +26,6 @@
 #include "mads/core/font.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern int  mcga_retrace_computed;
 extern word mcga_retrace_ticks;
@@ -75,7 +74,6 @@ extern void mcga_compute_retrace_parameters();
 
 extern void mcga_reset();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/mem.cpp b/engines/mads/core/mem.cpp
index b23eae19a68..4fc528bb624 100644
--- a/engines/mads/core/mem.cpp
+++ b/engines/mads/core/mem.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 byte  mem_initialized = false;
 
@@ -96,5 +95,4 @@ void mem_set_video_mode(int mode) {
 	// No implementation
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/mem.h b/engines/mads/core/mem.h
index 348b04eb4f4..4e5d848afcf 100644
--- a/engines/mads/core/mem.h
+++ b/engines/mads/core/mem.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MEM_NONE        0xff    /* Undefined (himem)   */
 
@@ -89,7 +88,6 @@ extern long mem_get_avail();
 extern long mem_conv_get_avail();
 extern void mem_set_video_mode(int mode);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/mouse.cpp b/engines/mads/core/mouse.cpp
index e2d9a0a472a..51e79deb69e 100644
--- a/engines/mads/core/mouse.cpp
+++ b/engines/mads/core/mouse.cpp
@@ -30,7 +30,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int mouse_button = -1;
 int mouse_status = 0;
@@ -251,7 +250,6 @@ void mouse_hard_cursor_mode(int mode, Palette *mypal) {
 void mouse_hard_cursor_mode(int mode, Palette mypal) {
 }
 
-} // namespace MADSV2
 } // namespace MADS
 
 
diff --git a/engines/mads/core/mouse.h b/engines/mads/core/mouse.h
index 10ab4f28867..06ebac6f331 100644
--- a/engines/mads/core/mouse.h
+++ b/engines/mads/core/mouse.h
@@ -27,7 +27,6 @@
 #include "mads/core/sprite.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define MOUSE_TIMING_ONE        7       /* Mouse 1st repeat delay (ticks) */
 #define MOUSE_TIMING_TWO        2       /* Mouse 2nd repeat delay (ticks) */
@@ -114,7 +113,6 @@ extern void mouse_video_update(int from_x, int from_y,
 	int unto_x, int unto_y, int size_x, int size_y);
 extern void mouse_hard_cursor_mode(int mode, Palette mypal);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/mps_archive.cpp b/engines/mads/core/mps_archive.cpp
index 72d1b355dd8..d809831cbcd 100644
--- a/engines/mads/core/mps_archive.cpp
+++ b/engines/mads/core/mps_archive.cpp
@@ -24,7 +24,6 @@
 #include "mads/core/mps_archive.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 static constexpr int HEADER_SIZE = 30;
 static constexpr int ENTRY_SIZE = 98;
@@ -124,5 +123,4 @@ Common::SeekableReadStream *MpsArchive::createReadStreamForMember(const Common::
 	return nullptr;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/mps_archive.h b/engines/mads/core/mps_archive.h
index 17f450379f9..b5d0153697b 100644
--- a/engines/mads/core/mps_archive.h
+++ b/engines/mads/core/mps_archive.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 class MpsArchive : public Common::Archive {
@@ -44,7 +43,6 @@ public:
 	Common::SeekableReadStream *createReadStreamForMember(const Common::Path &path) const override;
 };
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/object.cpp b/engines/mads/core/object.cpp
index 840a0050b83..7b9f42575c2 100644
--- a/engines/mads/core/object.cpp
+++ b/engines/mads/core/object.cpp
@@ -47,7 +47,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define object_extra_colors     10
 
@@ -449,5 +448,4 @@ void init_object() {
 	object_ems_handle = BUFFER_PRESERVE;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/object.h b/engines/mads/core/object.h
index 3e248ed72d9..494e0c9139c 100644
--- a/engines/mads/core/object.h
+++ b/engines/mads/core/object.h
@@ -30,7 +30,6 @@
 #include "mads/core/inter.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define OBJECT_MAX_VERBS        5
 #define OBJECT_MAX_QUALITIES    4
@@ -115,7 +114,6 @@ extern int object_examine(int number, long message, int speech = 0);
 
 extern void init_object();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/pack.cpp b/engines/mads/core/pack.cpp
index 27535a0920f..01c5245a33d 100644
--- a/engines/mads/core/pack.cpp
+++ b/engines/mads/core/pack.cpp
@@ -31,7 +31,6 @@
 #include "mads/core/pfab.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 byte *pack_special_buffer = NULL;
 void (*pack_special_function)() = NULL;
@@ -633,5 +632,4 @@ done:
 	return write_this_time;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/pack.h b/engines/mads/core/pack.h
index 077d5d204ab..1efa85334dc 100644
--- a/engines/mads/core/pack.h
+++ b/engines/mads/core/pack.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define PACK_ID_STRING                "MADSPACK 2.0\032"
 #define PACK_ID_LENGTH                14
@@ -251,7 +250,6 @@ extern void pack_enable_zip_explode();
 extern long pack_rle(byte *target, byte *source, word source_size);
 extern word pack_write_ems(char *buffer, word *mysize);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/pal.cpp b/engines/mads/core/pal.cpp
index d050450b083..8c54d302158 100644
--- a/engines/mads/core/pal.cpp
+++ b/engines/mads/core/pal.cpp
@@ -31,7 +31,6 @@
 #include "mads/core/magic.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern int kidney;
 
@@ -754,5 +753,4 @@ int pal_alloc_color(int slot, int allow_shared, int *out_index, const RGBcolor *
 	return slot_num;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/pal.h b/engines/mads/core/pal.h
index 0ee2805518c..ee43dfd34f1 100644
--- a/engines/mads/core/pal.h
+++ b/engines/mads/core/pal.h
@@ -26,7 +26,6 @@
 #include "mads/core/color.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* Palette mapping options to be passed to pal_allocate */
 
@@ -180,7 +179,6 @@ extern void init_pal();
  */
 extern int pal_alloc_color(int slot, int allow_shared, int *out_index, const RGBcolor *color);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/pfab.cpp b/engines/mads/core/pfab.cpp
index 3984e89a9d2..d7b1906edd1 100644
--- a/engines/mads/core/pfab.cpp
+++ b/engines/mads/core/pfab.cpp
@@ -23,7 +23,6 @@
 #include "mads/core/pfab.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /*
  * pfab.cpp  --  LZ77 sliding-dictionary compressor/expander
@@ -811,5 +810,4 @@ word pFABexp2(byte *read_buf, byte *write_buf, char *work_buff) {
 	return 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/pfab.h b/engines/mads/core/pfab.h
index 10986a59bee..5706f7fb6e6 100644
--- a/engines/mads/core/pfab.h
+++ b/engines/mads/core/pfab.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define CMP_BINARY             0
 #define CMP_ASCII              1
@@ -82,7 +81,6 @@ extern word pFABexp2(
 	byte *write_buf,
 	char *work_buff);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/player.cpp b/engines/mads/core/player.cpp
index 88ab2e5c048..12ac9318725 100644
--- a/engines/mads/core/player.cpp
+++ b/engines/mads/core/player.cpp
@@ -37,7 +37,6 @@
 #include "mads/nebular/extra.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 Player player;
 Player2 player2;
@@ -1076,5 +1075,4 @@ void restore_player() {
 	player.enable_at_target   = saved_player.enable_at_target;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/player.h b/engines/mads/core/player.h
index 8b8b63bcc23..75ea5ccbe4c 100644
--- a/engines/mads/core/player.h
+++ b/engines/mads/core/player.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define player_verb             player2.words[0]/* Player's recent verb   */
 #define player_main_noun        player2.words[1]/* Player's recent noun 1 */
@@ -358,7 +357,6 @@ extern void save_player();
  */
 extern void restore_player();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/popup.cpp b/engines/mads/core/popup.cpp
index 48edc0d7d37..15822d336c6 100644
--- a/engines/mads/core/popup.cpp
+++ b/engines/mads/core/popup.cpp
@@ -43,7 +43,6 @@
 #include "mads/nebular/popup.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define popup_padding_width     3       /* Extra space on each side */
 
@@ -3361,5 +3360,4 @@ done:
 	return result_item;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/popup.h b/engines/mads/core/popup.h
index c4aed69d968..546bd613fa2 100644
--- a/engines/mads/core/popup.h
+++ b/engines/mads/core/popup.h
@@ -28,7 +28,6 @@
 #include "mads/core/heap.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define POPUP_UPPER_LEFT      1       /* Pieces of border box */
 #define POPUP_UPPER_RIGHT     2
@@ -484,7 +483,6 @@ extern PopupItem *popup_menu(const char *prompt,
 
 extern PopupItem *popup_sprite(SeriesPtr series, int sprite, int x, int y);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/qual.h b/engines/mads/core/qual.h
index e3752d99428..16dcb80109c 100644
--- a/engines/mads/core/qual.h
+++ b/engines/mads/core/qual.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 struct QualBuf {
 	word id;
@@ -88,7 +87,6 @@ int        qual_load_active();
 extern char *qual_text;
 extern word qual_active;
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/quote.cpp b/engines/mads/core/quote.cpp
index f2a0518fdf0..0ac99917166 100644
--- a/engines/mads/core/quote.cpp
+++ b/engines/mads/core/quote.cpp
@@ -28,7 +28,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int quote_emergency = false;
 
@@ -181,5 +180,4 @@ void init_quote() {
 	quote_emergency = false;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/quote.h b/engines/mads/core/quote.h
index c5b8c9e90e0..6e8d62a3e04 100644
--- a/engines/mads/core/quote.h
+++ b/engines/mads/core/quote.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define QUOTE_MAX_LIST_LENGTH           200
 
@@ -38,7 +37,6 @@ extern void quote_split_string(const char *source, char *target1, char *target2)
 
 extern void init_quote();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/rail.cpp b/engines/mads/core/rail.cpp
index 14f3849baa8..8f7321df5dc 100644
--- a/engines/mads/core/rail.cpp
+++ b/engines/mads/core/rail.cpp
@@ -30,7 +30,6 @@
 #include "mads/core/kernel.h"
 
 namespace MADS {
-namespace MADSV2 {
 
  /* -------------------------------------------------------------------------
   * Constants
@@ -258,5 +257,4 @@ void init_rail() {
 	memset(rail_active, 0, sizeof(rail_active));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/rail.h b/engines/mads/core/rail.h
index b1eb2473787..c8966bd150b 100644
--- a/engines/mads/core/rail.h
+++ b/engines/mads/core/rail.h
@@ -23,7 +23,6 @@
 #include "mads/core/room.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define RAIL_MAX_NODES          ROOM_MAX_RAILS + 2
 
@@ -64,5 +63,4 @@ extern void rail_check_path(int allow_one_illegal);
 
 extern void init_rail();
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/room.cpp b/engines/mads/core/room.cpp
index 0dafc62124b..bedb20e474d 100644
--- a/engines/mads/core/room.cpp
+++ b/engines/mads/core/room.cpp
@@ -45,7 +45,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 RoomDef roomdef;
 int room_load_error = 0;
@@ -755,5 +754,4 @@ void init_room() {
 	memset(&roompict, 0, sizeof(RoomPict));
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/room.h b/engines/mads/core/room.h
index 48e16f7564f..94ab43be1d2 100644
--- a/engines/mads/core/room.h
+++ b/engines/mads/core/room.h
@@ -31,7 +31,6 @@
 #include "mads/core/tile.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define room_file_version "4.01"
 #define pict_file_version "4.01"
@@ -278,7 +277,6 @@ extern int room_invert();
 
 extern void init_room();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/screen.cpp b/engines/mads/core/screen.cpp
index 49bb37d7607..2a8414cd11c 100644
--- a/engines/mads/core/screen.cpp
+++ b/engines/mads/core/screen.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/mouse.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int screen_normal_color;
 int screen_hilite_color;
@@ -173,5 +172,4 @@ int screen_print(const char *string, ...) {
 	return 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/screen.h b/engines/mads/core/screen.h
index 4e1cd7dd253..1d23503ab5e 100644
--- a/engines/mads/core/screen.h
+++ b/engines/mads/core/screen.h
@@ -25,7 +25,6 @@
 #include "mads/core/window.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* some colors */
 
@@ -112,7 +111,6 @@ extern void screen_save();
 extern void screen_restore();
 extern short screen_show_wide(const char *outstring, short locx, short locy, short width);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/sort.cpp b/engines/mads/core/sort.cpp
index b6a4b2a44a8..17e275a722b 100644
--- a/engines/mads/core/sort.cpp
+++ b/engines/mads/core/sort.cpp
@@ -22,7 +22,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 void sort_insertion(int elements, int *id, long *value) {
 	int going, count, count2, my_id;
@@ -177,5 +176,4 @@ void sort_insertion_8(int elements, byte *id, byte *value) {
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/sort.h b/engines/mads/core/sort.h
index 7a4bd03f8c9..ef302fd74c9 100644
--- a/engines/mads/core/sort.h
+++ b/engines/mads/core/sort.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern void sort_insertion(int elements, int *id, long *value);
 
@@ -33,7 +32,6 @@ extern void sort_insertion_16(int elements, byte *id, word *value);
 
 extern void sort_insertion_8(int elements, byte *id, byte *value);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/sound.cpp b/engines/mads/core/sound.cpp
index 17abc629fda..d1029b1fe35 100644
--- a/engines/mads/core/sound.cpp
+++ b/engines/mads/core/sound.cpp
@@ -24,7 +24,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int sound_play(int soundNum) {
 	return sound_queue(soundNum);
@@ -44,5 +43,4 @@ void sound_queue_flush() {
 		g_engine->_soundManager->startQueuedCommands();
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/sound.h b/engines/mads/core/sound.h
index 831c852b4cb..496522f4919 100644
--- a/engines/mads/core/sound.h
+++ b/engines/mads/core/sound.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 constexpr int sound_board_roland = 1;
 constexpr bool global_prefer_roland = false;
@@ -35,7 +34,6 @@ extern int sound_queue(int soundNum, int distance = 0);
 extern void sound_queue_hold();
 extern void sound_queue_flush();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/speech.cpp b/engines/mads/core/speech.cpp
index 0dc8c93f80e..19835cf9d78 100644
--- a/engines/mads/core/speech.cpp
+++ b/engines/mads/core/speech.cpp
@@ -29,7 +29,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 bool speech_system_active = false;
 bool speech_on = false;
@@ -188,5 +187,4 @@ int speech_status() {
 	return g_engine->isSpeechPlaying() ? 1 : 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/speech.h b/engines/mads/core/speech.h
index 646a99691ea..7f75e2b16de 100644
--- a/engines/mads/core/speech.h
+++ b/engines/mads/core/speech.h
@@ -27,7 +27,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern bool speech_system_active;
 extern bool speech_on;
@@ -51,7 +50,6 @@ inline void speech_ems_play(const char *resName, int id, bool /*memFlag?*/) {
 	speech_play(resName, id);
 }
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/sprite.cpp b/engines/mads/core/sprite.cpp
index 8246c0bd157..50da3b87215 100644
--- a/engines/mads/core/sprite.cpp
+++ b/engines/mads/core/sprite.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/fileio.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int sprite_error = 0;
 byte *sprite_force_memory = NULL;
@@ -1212,5 +1211,4 @@ void init_sprite() {
 	kidney = false;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/sprite.h b/engines/mads/core/sprite.h
index 4b4a6ffb422..c9c3e7d1164 100644
--- a/engines/mads/core/sprite.h
+++ b/engines/mads/core/sprite.h
@@ -27,7 +27,6 @@
 #include "mads/core/loader.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define misc_largest_block            misc[0]
 /* LONG ... uses misc[1] also */
@@ -381,7 +380,6 @@ extern void sprite_free(SeriesPtr *series, int free_memory);
 
 extern void init_sprite();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/sprite_h.h b/engines/mads/core/sprite_h.h
index b2a98ffe158..95b2a9301ed 100644
--- a/engines/mads/core/sprite_h.h
+++ b/engines/mads/core/sprite_h.h
@@ -26,11 +26,9 @@
 #include "mads/core/color.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern void sprite_color_translate(SeriesPtr series, ColorListPtr list);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/sprite_k.cpp b/engines/mads/core/sprite_k.cpp
index 566f7630c91..7de4dcb5faa 100644
--- a/engines/mads/core/sprite_k.cpp
+++ b/engines/mads/core/sprite_k.cpp
@@ -27,7 +27,6 @@
 #include "mads/core/keys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int kidney = false;
 
@@ -74,5 +73,4 @@ done:
 	;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/text.cpp b/engines/mads/core/text.cpp
index 6b19063dca7..4d7efc575ab 100644
--- a/engines/mads/core/text.cpp
+++ b/engines/mads/core/text.cpp
@@ -41,7 +41,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 char text_filename[80] = TEXT_FILENAME;  /* Filename to load from  */
 long text_last_id = 0;              /* Last ID used           */
@@ -596,5 +595,4 @@ done:
 	return error_flag;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/text.h b/engines/mads/core/text.h
index 24dff012c45..3d891436efc 100644
--- a/engines/mads/core/text.h
+++ b/engines/mads/core/text.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 
 #define TEXT_FILENAME           "*MESSAGES"
@@ -122,7 +121,6 @@ extern int text_build(int build_header);
 extern void text_copy_vocab(char **mark, int vocab_id);
 extern int text_show(long id);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/tile.cpp b/engines/mads/core/tile.cpp
index 129de45b862..ce144e87b98 100644
--- a/engines/mads/core/tile.cpp
+++ b/engines/mads/core/tile.cpp
@@ -40,7 +40,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 int tile_load_error;
 ShadowList tile_shadow;
@@ -652,5 +651,4 @@ int tile_fake_map(int tile_type, TileMapHeader *tile_map, Buffer *buffer, int x,
 	return error_flag;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/tile.h b/engines/mads/core/tile.h
index 5c2f27797d6..dedd4f6fde8 100644
--- a/engines/mads/core/tile.h
+++ b/engines/mads/core/tile.h
@@ -26,7 +26,6 @@
 #include "mads/core/color.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define DEFAULT_TILE_X          20
 #define DEFAULT_TILE_Y          12
@@ -108,7 +107,6 @@ extern void tile_pan(TileMapHeader *tile_map, int x, int y);
 extern int tile_fake_map(int tile_type, TileMapHeader *tile_map,
 	Buffer *buffer, int x, int y);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/timer.cpp b/engines/mads/core/timer.cpp
index 6a6e9e65326..a0ba8cec0f1 100644
--- a/engines/mads/core/timer.cpp
+++ b/engines/mads/core/timer.cpp
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 long _timer_clock = 0;          /* Backing store for *timer_address writes */
 
@@ -110,5 +109,4 @@ void init_timer() {
 	timer_low_deferred = 0;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/timer.h b/engines/mads/core/timer.h
index 10cdc02ca2c..5ede9aba434 100644
--- a/engines/mads/core/timer.h
+++ b/engines/mads/core/timer.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern long *timer_address;         /* "Default" timer count address */
 extern word timer_rate;                 /* Current timer ticks/sec       */
@@ -83,7 +82,6 @@ extern int timer_get_copy_protect();
 
 extern void init_timer();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/video.cpp b/engines/mads/core/video.cpp
index 621ced7490e..c225dd5f632 100644
--- a/engines/mads/core/video.cpp
+++ b/engines/mads/core/video.cpp
@@ -23,7 +23,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 void video_init(int mode, int set_mode) {
 	// No implementation in ScummVM
@@ -48,5 +47,4 @@ void video_update(Buffer *from, int from_x, int from_y,
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/video.h b/engines/mads/core/video.h
index bdd512d6d89..53c2d738513 100644
--- a/engines/mads/core/video.h
+++ b/engines/mads/core/video.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 extern byte video_mode;
 
@@ -53,7 +52,6 @@ extern void video_update_tandy(Buffer *from, int from_x, int from_y,
 	int unto_x, int unto_y,
 	int size_x, int size_y);
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/vocab.cpp b/engines/mads/core/vocab.cpp
index 2b80e2101b2..20a296b8fcf 100644
--- a/engines/mads/core/vocab.cpp
+++ b/engines/mads/core/vocab.cpp
@@ -33,7 +33,6 @@
 #include "mads/core/mouse.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define background      colorbyte(white, blue)
 
@@ -543,5 +542,4 @@ void init_vocab() {
 	vocab_active = false;
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/vocab.h b/engines/mads/core/vocab.h
index d154bf0ca51..33d39863576 100644
--- a/engines/mads/core/vocab.h
+++ b/engines/mads/core/vocab.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define vocab_version           "1.01"
 #define vocab_date              "13-Jun-91"
@@ -81,7 +80,6 @@ extern char *vocab_string(int vocab_id);
 
 extern void init_vocab();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/vocabh.h b/engines/mads/core/vocabh.h
index 8d63fa42e0b..5927b719a0f 100644
--- a/engines/mads/core/vocabh.h
+++ b/engines/mads/core/vocabh.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 /* Hardcoded vocabulary words */
 enum {
@@ -44,7 +43,6 @@ enum {
 	words_walk_to                     = 13
 };
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/window.cpp b/engines/mads/core/window.cpp
index d80840aa72d..2d7d5345512 100644
--- a/engines/mads/core/window.cpp
+++ b/engines/mads/core/window.cpp
@@ -27,7 +27,6 @@
 #include "mads/core/screen.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define text_wrap  160
 
@@ -840,5 +839,4 @@ int window_show_color(WindowPtr window, char *text, int xx, int yy, int color) {
 	return xx - (window->ul_x + 1);
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/window.h b/engines/mads/core/window.h
index 2d239689da0..8da04e4f4a8 100644
--- a/engines/mads/core/window.h
+++ b/engines/mads/core/window.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define WINDOW_DETECT_VALID              0
 #define WINDOW_DETECT_START             -1
@@ -205,7 +204,6 @@ extern int window_show_color(WindowPtr window, const char *text, int xx, int yy,
 extern void window_10_install();
 extern void window_10_remove();
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/xms.cpp b/engines/mads/core/xms.cpp
index dacf1379ebc..344e4da237f 100644
--- a/engines/mads/core/xms.cpp
+++ b/engines/mads/core/xms.cpp
@@ -22,7 +22,6 @@
 #include "mads/core/xms.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 bool xms_exists = false;
 bool xms_disabled = false;
@@ -32,5 +31,4 @@ word xms_chain_seg = 0;
 word xms_umb_list[XMS_MAX_UMB] = {};
 word xms_umb_mark = 0;
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/core/xms.h b/engines/mads/core/xms.h
index 5998387fcb2..29b2a0abac0 100644
--- a/engines/mads/core/xms.h
+++ b/engines/mads/core/xms.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 #define XMS_MAX_UMB     16              /* Max UMB blocks to allocate */
 
@@ -74,7 +73,6 @@ inline void xms_free(int xms_handle) {}
  */
 inline int xms_copy(long copy_size, word source_handle, void *source, word dest_handle, void *dest) { return 0; }
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/asound.cpp b/engines/mads/dragonsphere/asound.cpp
index f89644db8b7..da2b586283e 100644
--- a/engines/mads/dragonsphere/asound.cpp
+++ b/engines/mads/dragonsphere/asound.cpp
@@ -23,7 +23,6 @@
 #include "mads/dragonsphere/asound.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 
@@ -1801,5 +1800,4 @@ void ASound::playSound(int offset) {
 }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/asound.h b/engines/mads/dragonsphere/asound.h
index e1ecf5f3f50..335b099af8a 100644
--- a/engines/mads/dragonsphere/asound.h
+++ b/engines/mads/dragonsphere/asound.h
@@ -28,7 +28,6 @@
 #include "mads/core/sound_manager.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 #define ADLIB_CHANNEL_COUNT 9
@@ -643,7 +642,6 @@ public:
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/dragonsphere.cpp b/engines/mads/dragonsphere/dragonsphere.cpp
index 1c4f0b3ddab..0a88cb4aee8 100644
--- a/engines/mads/dragonsphere/dragonsphere.cpp
+++ b/engines/mads/dragonsphere/dragonsphere.cpp
@@ -53,7 +53,6 @@
 #include "mads/core/mps_installer.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 Common::Error DragonsphereEngine::run() {
@@ -1484,5 +1483,4 @@ over:
 }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/dragonsphere.h b/engines/mads/dragonsphere/dragonsphere.h
index d68f50863b1..b242c40516c 100644
--- a/engines/mads/dragonsphere/dragonsphere.h
+++ b/engines/mads/dragonsphere/dragonsphere.h
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 class DragonsphereEngine : public MADSV2Engine {
@@ -53,7 +52,6 @@ public:
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/global.cpp b/engines/mads/dragonsphere/global.cpp
index ee73d7485c6..e7d2ed092db 100644
--- a/engines/mads/dragonsphere/global.cpp
+++ b/engines/mads/dragonsphere/global.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 namespace Rooms {
@@ -221,5 +220,4 @@ void sync_room(Common::Serializer &s) {
 }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/global.h b/engines/mads/dragonsphere/global.h
index ddd2fa07e8c..72222a681ff 100644
--- a/engines/mads/dragonsphere/global.h
+++ b/engines/mads/dragonsphere/global.h
@@ -26,7 +26,6 @@
 #include "mads/core/vocabh.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 enum {
@@ -263,7 +262,6 @@ extern void global_section_constructor();
 extern void sync_room(Common::Serializer &s);
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/mads/conv.h b/engines/mads/dragonsphere/mads/conv.h
index 559a9d968f8..f35a0174505 100644
--- a/engines/mads/dragonsphere/mads/conv.h
+++ b/engines/mads/dragonsphere/mads/conv.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 // Conversation node IDs are added here as each conversation is ported.
@@ -540,7 +539,6 @@ enum {
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/mads/inventory.h b/engines/mads/dragonsphere/mads/inventory.h
index d05e940b1df..6c298e5f82e 100644
--- a/engines/mads/dragonsphere/mads/inventory.h
+++ b/engines/mads/dragonsphere/mads/inventory.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 enum {
@@ -78,7 +77,6 @@ enum {
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/mads/quotes.h b/engines/mads/dragonsphere/mads/quotes.h
index 5bb247d59fe..07a43ef89e6 100644
--- a/engines/mads/dragonsphere/mads/quotes.h
+++ b/engines/mads/dragonsphere/mads/quotes.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 enum {
@@ -178,7 +177,6 @@ enum {
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/mads/sounds.h b/engines/mads/dragonsphere/mads/sounds.h
index 98f1602a975..48859bb93eb 100644
--- a/engines/mads/dragonsphere/mads/sounds.h
+++ b/engines/mads/dragonsphere/mads/sounds.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 enum {
@@ -161,7 +160,6 @@ enum {
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/mads/words.h b/engines/mads/dragonsphere/mads/words.h
index 8b2c963cb2d..028fabcf53f 100644
--- a/engines/mads/dragonsphere/mads/words.h
+++ b/engines/mads/dragonsphere/mads/words.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 enum {
@@ -598,7 +597,6 @@ enum {
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/main.cpp b/engines/mads/dragonsphere/main.cpp
index d26fa28ea16..397020e9626 100644
--- a/engines/mads/dragonsphere/main.cpp
+++ b/engines/mads/dragonsphere/main.cpp
@@ -43,7 +43,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 constexpr bool SHOW_LINES = true;
@@ -287,5 +286,4 @@ void dragonsphere_main() {
 }
 
 } // namespace Dragonspheree
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/main.h b/engines/mads/dragonsphere/main.h
index b2851a42dc7..f0dda64b575 100644
--- a/engines/mads/dragonsphere/main.h
+++ b/engines/mads/dragonsphere/main.h
@@ -25,13 +25,11 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 extern void dragonsphere_main();
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/main_menu.cpp b/engines/mads/dragonsphere/main_menu.cpp
index bfd74b0726f..9e57f0b01cd 100644
--- a/engines/mads/dragonsphere/main_menu.cpp
+++ b/engines/mads/dragonsphere/main_menu.cpp
@@ -56,7 +56,6 @@
 #include "mads/dragonsphere/main_menu.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 #define CONFIG_FILE_NAME "CONFIG.PHA"
@@ -441,5 +440,4 @@ void menu_control() {
 }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/main_menu.h b/engines/mads/dragonsphere/main_menu.h
index c69d7cb0d1e..d0d6e503f93 100644
--- a/engines/mads/dragonsphere/main_menu.h
+++ b/engines/mads/dragonsphere/main_menu.h
@@ -25,7 +25,6 @@
 #include "common/str.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 struct MenuItem {
@@ -40,7 +39,6 @@ extern int selected_item;
 extern void menu_control();
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/menus.cpp b/engines/mads/dragonsphere/menus.cpp
index 9ccbb3106b9..6d5ef6d5d35 100644
--- a/engines/mads/dragonsphere/menus.cpp
+++ b/engines/mads/dragonsphere/menus.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/mads/quotes.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 #define SAVE_MENU_PIXEL_WIDTH           200
@@ -760,5 +759,4 @@ done:
 }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/menus.h b/engines/mads/dragonsphere/menus.h
index 5876ffa2af8..0f61c12fa69 100644
--- a/engines/mads/dragonsphere/menus.h
+++ b/engines/mads/dragonsphere/menus.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 extern void global_menu_system_init();
@@ -34,7 +33,6 @@ extern void global_emergency_save();
 extern void global_game_menu();
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room101.cpp b/engines/mads/dragonsphere/rooms/room101.cpp
index 5360fae1bbe..f45705f0612 100644
--- a/engines/mads/dragonsphere/rooms/room101.cpp
+++ b/engines/mads/dragonsphere/rooms/room101.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/rooms/room101.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -811,5 +810,4 @@ void room_101_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room101.h b/engines/mads/dragonsphere/rooms/room101.h
index c291d3d71e2..a21595edffb 100644
--- a/engines/mads/dragonsphere/rooms/room101.h
+++ b/engines/mads/dragonsphere/rooms/room101.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_101_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room102.cpp b/engines/mads/dragonsphere/rooms/room102.cpp
index 72b250cc2d1..5328cb876d7 100644
--- a/engines/mads/dragonsphere/rooms/room102.cpp
+++ b/engines/mads/dragonsphere/rooms/room102.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room102.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -488,5 +487,4 @@ void room_102_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room102.h b/engines/mads/dragonsphere/rooms/room102.h
index 17c2e5a86df..b49b7fce34d 100644
--- a/engines/mads/dragonsphere/rooms/room102.h
+++ b/engines/mads/dragonsphere/rooms/room102.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_102_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room103.cpp b/engines/mads/dragonsphere/rooms/room103.cpp
index 2081f8127e2..e16465da96c 100644
--- a/engines/mads/dragonsphere/rooms/room103.cpp
+++ b/engines/mads/dragonsphere/rooms/room103.cpp
@@ -33,7 +33,6 @@
 #include "mads/dragonsphere/rooms/room103.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -422,5 +421,4 @@ void room_103_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room103.h b/engines/mads/dragonsphere/rooms/room103.h
index 7c19a3847ff..3d6eccb53a0 100644
--- a/engines/mads/dragonsphere/rooms/room103.h
+++ b/engines/mads/dragonsphere/rooms/room103.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_103_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room104.cpp b/engines/mads/dragonsphere/rooms/room104.cpp
index b1bb75da2d4..a2009f35c40 100644
--- a/engines/mads/dragonsphere/rooms/room104.cpp
+++ b/engines/mads/dragonsphere/rooms/room104.cpp
@@ -42,7 +42,6 @@
 #include "mads/dragonsphere/rooms/room104.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -2315,5 +2314,4 @@ void room_104_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room104.h b/engines/mads/dragonsphere/rooms/room104.h
index 2a54c401230..78dcd03a999 100644
--- a/engines/mads/dragonsphere/rooms/room104.h
+++ b/engines/mads/dragonsphere/rooms/room104.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_104_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room105.cpp b/engines/mads/dragonsphere/rooms/room105.cpp
index 217149a7c2e..ee95dadd426 100644
--- a/engines/mads/dragonsphere/rooms/room105.cpp
+++ b/engines/mads/dragonsphere/rooms/room105.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room105.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -778,5 +777,4 @@ void room_105_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room105.h b/engines/mads/dragonsphere/rooms/room105.h
index 3d8befc4dff..e0bd4c32ee3 100644
--- a/engines/mads/dragonsphere/rooms/room105.h
+++ b/engines/mads/dragonsphere/rooms/room105.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_105_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room106.cpp b/engines/mads/dragonsphere/rooms/room106.cpp
index c917be4ffd3..16e8538f8ac 100644
--- a/engines/mads/dragonsphere/rooms/room106.cpp
+++ b/engines/mads/dragonsphere/rooms/room106.cpp
@@ -37,7 +37,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1479,5 +1478,4 @@ void room_106_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room106.h b/engines/mads/dragonsphere/rooms/room106.h
index 262592cdd69..e8f468a4e46 100644
--- a/engines/mads/dragonsphere/rooms/room106.h
+++ b/engines/mads/dragonsphere/rooms/room106.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_106_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room107.cpp b/engines/mads/dragonsphere/rooms/room107.cpp
index e88f8aae9db..7cd9d0e107a 100644
--- a/engines/mads/dragonsphere/rooms/room107.cpp
+++ b/engines/mads/dragonsphere/rooms/room107.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room107.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -743,5 +742,4 @@ void room_107_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room107.h b/engines/mads/dragonsphere/rooms/room107.h
index c8b141a1177..780030cc2b0 100644
--- a/engines/mads/dragonsphere/rooms/room107.h
+++ b/engines/mads/dragonsphere/rooms/room107.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_107_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room108.cpp b/engines/mads/dragonsphere/rooms/room108.cpp
index 24527d9b9dd..365b8351612 100644
--- a/engines/mads/dragonsphere/rooms/room108.cpp
+++ b/engines/mads/dragonsphere/rooms/room108.cpp
@@ -34,7 +34,6 @@
 #include "mads/dragonsphere/rooms/room108.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -460,5 +459,4 @@ void room_108_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room108.h b/engines/mads/dragonsphere/rooms/room108.h
index ae2372be5ee..e80e460da7b 100644
--- a/engines/mads/dragonsphere/rooms/room108.h
+++ b/engines/mads/dragonsphere/rooms/room108.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_108_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room109.cpp b/engines/mads/dragonsphere/rooms/room109.cpp
index b4308dab375..c541f199d6d 100644
--- a/engines/mads/dragonsphere/rooms/room109.cpp
+++ b/engines/mads/dragonsphere/rooms/room109.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room109.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -481,5 +480,4 @@ void room_109_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room109.h b/engines/mads/dragonsphere/rooms/room109.h
index 551342d0211..475c8db29ec 100644
--- a/engines/mads/dragonsphere/rooms/room109.h
+++ b/engines/mads/dragonsphere/rooms/room109.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_109_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room110.cpp b/engines/mads/dragonsphere/rooms/room110.cpp
index a9d5d7944f8..59e269ace95 100644
--- a/engines/mads/dragonsphere/rooms/room110.cpp
+++ b/engines/mads/dragonsphere/rooms/room110.cpp
@@ -37,7 +37,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -2888,5 +2887,4 @@ void room_110_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room110.h b/engines/mads/dragonsphere/rooms/room110.h
index a460c1b7bf2..54967799d1d 100644
--- a/engines/mads/dragonsphere/rooms/room110.h
+++ b/engines/mads/dragonsphere/rooms/room110.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_110_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room111.cpp b/engines/mads/dragonsphere/rooms/room111.cpp
index f4006f6176e..18848c0aa02 100644
--- a/engines/mads/dragonsphere/rooms/room111.cpp
+++ b/engines/mads/dragonsphere/rooms/room111.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room111.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -264,5 +263,4 @@ void room_111_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room111.h b/engines/mads/dragonsphere/rooms/room111.h
index f7ace121919..0bce3856ac1 100644
--- a/engines/mads/dragonsphere/rooms/room111.h
+++ b/engines/mads/dragonsphere/rooms/room111.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_111_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room112.cpp b/engines/mads/dragonsphere/rooms/room112.cpp
index 4d64a72fc29..9953be2871f 100644
--- a/engines/mads/dragonsphere/rooms/room112.cpp
+++ b/engines/mads/dragonsphere/rooms/room112.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room112.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -119,5 +118,4 @@ void room_112_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room112.h b/engines/mads/dragonsphere/rooms/room112.h
index d23ce9f53a3..93bf21525d6 100644
--- a/engines/mads/dragonsphere/rooms/room112.h
+++ b/engines/mads/dragonsphere/rooms/room112.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_112_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room113.cpp b/engines/mads/dragonsphere/rooms/room113.cpp
index d508bff4be8..43ccd1a19dd 100644
--- a/engines/mads/dragonsphere/rooms/room113.cpp
+++ b/engines/mads/dragonsphere/rooms/room113.cpp
@@ -37,7 +37,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -929,5 +928,4 @@ void room_113_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room113.h b/engines/mads/dragonsphere/rooms/room113.h
index 93a98ed07e5..09cd32d70d3 100644
--- a/engines/mads/dragonsphere/rooms/room113.h
+++ b/engines/mads/dragonsphere/rooms/room113.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_113_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room114.cpp b/engines/mads/dragonsphere/rooms/room114.cpp
index 8de58433ccf..55cac7b283c 100644
--- a/engines/mads/dragonsphere/rooms/room114.cpp
+++ b/engines/mads/dragonsphere/rooms/room114.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room114.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -538,5 +537,4 @@ void room_114_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room114.h b/engines/mads/dragonsphere/rooms/room114.h
index 3ac30176896..51e04c666f1 100644
--- a/engines/mads/dragonsphere/rooms/room114.h
+++ b/engines/mads/dragonsphere/rooms/room114.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_114_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room115.cpp b/engines/mads/dragonsphere/rooms/room115.cpp
index 1468e570dd8..1758f2e4f0f 100644
--- a/engines/mads/dragonsphere/rooms/room115.cpp
+++ b/engines/mads/dragonsphere/rooms/room115.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room115.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -726,5 +725,4 @@ void room_115_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room115.h b/engines/mads/dragonsphere/rooms/room115.h
index b705d6b2185..cb5ae2f3357 100644
--- a/engines/mads/dragonsphere/rooms/room115.h
+++ b/engines/mads/dragonsphere/rooms/room115.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_115_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room116.cpp b/engines/mads/dragonsphere/rooms/room116.cpp
index b9c27a3d554..011d5f323d7 100644
--- a/engines/mads/dragonsphere/rooms/room116.cpp
+++ b/engines/mads/dragonsphere/rooms/room116.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room116.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -901,5 +900,4 @@ void room_116_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room116.h b/engines/mads/dragonsphere/rooms/room116.h
index 7c2aad4062c..562ab164afb 100644
--- a/engines/mads/dragonsphere/rooms/room116.h
+++ b/engines/mads/dragonsphere/rooms/room116.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_116_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room117.cpp b/engines/mads/dragonsphere/rooms/room117.cpp
index f7249319d88..a900813af5e 100644
--- a/engines/mads/dragonsphere/rooms/room117.cpp
+++ b/engines/mads/dragonsphere/rooms/room117.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room117.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -157,5 +156,4 @@ void room_117_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room117.h b/engines/mads/dragonsphere/rooms/room117.h
index 75b332ea7aa..8dd86ae41c3 100644
--- a/engines/mads/dragonsphere/rooms/room117.h
+++ b/engines/mads/dragonsphere/rooms/room117.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_117_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room118.cpp b/engines/mads/dragonsphere/rooms/room118.cpp
index 6eec023c0d2..6800ce62c33 100644
--- a/engines/mads/dragonsphere/rooms/room118.cpp
+++ b/engines/mads/dragonsphere/rooms/room118.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room118.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -193,5 +192,4 @@ void room_118_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room118.h b/engines/mads/dragonsphere/rooms/room118.h
index 80cf7a3c3f9..efa489240c4 100644
--- a/engines/mads/dragonsphere/rooms/room118.h
+++ b/engines/mads/dragonsphere/rooms/room118.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_118_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room119.cpp b/engines/mads/dragonsphere/rooms/room119.cpp
index 1d87c266656..a0afa10de05 100644
--- a/engines/mads/dragonsphere/rooms/room119.cpp
+++ b/engines/mads/dragonsphere/rooms/room119.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room119.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -665,5 +664,4 @@ void room_119_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room119.h b/engines/mads/dragonsphere/rooms/room119.h
index 7370fa8edd2..32b1c712576 100644
--- a/engines/mads/dragonsphere/rooms/room119.h
+++ b/engines/mads/dragonsphere/rooms/room119.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_119_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room120.cpp b/engines/mads/dragonsphere/rooms/room120.cpp
index ca536f4aefb..c5ff46564ff 100644
--- a/engines/mads/dragonsphere/rooms/room120.cpp
+++ b/engines/mads/dragonsphere/rooms/room120.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room120.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -686,5 +685,4 @@ void room_120_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room120.h b/engines/mads/dragonsphere/rooms/room120.h
index fcaad81702e..3704ef2c8e7 100644
--- a/engines/mads/dragonsphere/rooms/room120.h
+++ b/engines/mads/dragonsphere/rooms/room120.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_120_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room201.cpp b/engines/mads/dragonsphere/rooms/room201.cpp
index b08d7ba5e23..e75fef3510f 100644
--- a/engines/mads/dragonsphere/rooms/room201.cpp
+++ b/engines/mads/dragonsphere/rooms/room201.cpp
@@ -39,7 +39,6 @@
 #include "mads/dragonsphere/rooms/room201.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -2699,5 +2698,4 @@ void room_201_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room201.h b/engines/mads/dragonsphere/rooms/room201.h
index 0af5b458f1e..d8f1b7c902b 100644
--- a/engines/mads/dragonsphere/rooms/room201.h
+++ b/engines/mads/dragonsphere/rooms/room201.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_201_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room203.cpp b/engines/mads/dragonsphere/rooms/room203.cpp
index 4febf05f6a9..62dd49e952d 100644
--- a/engines/mads/dragonsphere/rooms/room203.cpp
+++ b/engines/mads/dragonsphere/rooms/room203.cpp
@@ -39,7 +39,6 @@
 #include "mads/dragonsphere/rooms/room203.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -908,5 +907,4 @@ void room_203_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room203.h b/engines/mads/dragonsphere/rooms/room203.h
index 4497f0275eb..715ec0e5a5f 100644
--- a/engines/mads/dragonsphere/rooms/room203.h
+++ b/engines/mads/dragonsphere/rooms/room203.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_203_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room204.cpp b/engines/mads/dragonsphere/rooms/room204.cpp
index a94dcd03dd6..25fa9daf494 100644
--- a/engines/mads/dragonsphere/rooms/room204.cpp
+++ b/engines/mads/dragonsphere/rooms/room204.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room204.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -335,5 +334,4 @@ void room_204_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room204.h b/engines/mads/dragonsphere/rooms/room204.h
index 1ec836d1067..9db60747df2 100644
--- a/engines/mads/dragonsphere/rooms/room204.h
+++ b/engines/mads/dragonsphere/rooms/room204.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_204_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room205.cpp b/engines/mads/dragonsphere/rooms/room205.cpp
index fe9c1f61972..c9da219f3b4 100644
--- a/engines/mads/dragonsphere/rooms/room205.cpp
+++ b/engines/mads/dragonsphere/rooms/room205.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room205.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -906,5 +905,4 @@ void room_205_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room205.h b/engines/mads/dragonsphere/rooms/room205.h
index b524f6d0c92..8e359a4718f 100644
--- a/engines/mads/dragonsphere/rooms/room205.h
+++ b/engines/mads/dragonsphere/rooms/room205.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_205_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room206.cpp b/engines/mads/dragonsphere/rooms/room206.cpp
index 7eebcad56d6..071760015d1 100644
--- a/engines/mads/dragonsphere/rooms/room206.cpp
+++ b/engines/mads/dragonsphere/rooms/room206.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room206.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -749,5 +748,4 @@ void room_206_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room206.h b/engines/mads/dragonsphere/rooms/room206.h
index 95b38934985..19ff0376b92 100644
--- a/engines/mads/dragonsphere/rooms/room206.h
+++ b/engines/mads/dragonsphere/rooms/room206.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_206_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room301.cpp b/engines/mads/dragonsphere/rooms/room301.cpp
index a5c45d6cb69..766890d4050 100644
--- a/engines/mads/dragonsphere/rooms/room301.cpp
+++ b/engines/mads/dragonsphere/rooms/room301.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room301.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -573,5 +572,4 @@ void room_301_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room301.h b/engines/mads/dragonsphere/rooms/room301.h
index c5a0163310c..bd6999ac1aa 100644
--- a/engines/mads/dragonsphere/rooms/room301.h
+++ b/engines/mads/dragonsphere/rooms/room301.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_301_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room302.cpp b/engines/mads/dragonsphere/rooms/room302.cpp
index ae7c9e3b2f1..df5fcda8203 100644
--- a/engines/mads/dragonsphere/rooms/room302.cpp
+++ b/engines/mads/dragonsphere/rooms/room302.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room302.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -946,5 +945,4 @@ void room_302_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room302.h b/engines/mads/dragonsphere/rooms/room302.h
index 8f7d9b4132d..d88f6d9b80c 100644
--- a/engines/mads/dragonsphere/rooms/room302.h
+++ b/engines/mads/dragonsphere/rooms/room302.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_302_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room303.cpp b/engines/mads/dragonsphere/rooms/room303.cpp
index 94272cc3459..a1b9057fb8f 100644
--- a/engines/mads/dragonsphere/rooms/room303.cpp
+++ b/engines/mads/dragonsphere/rooms/room303.cpp
@@ -40,7 +40,6 @@
 #include "mads/dragonsphere/rooms/room303.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1678,5 +1677,4 @@ void room_303_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room303.h b/engines/mads/dragonsphere/rooms/room303.h
index d9d57641c6c..a04385775d1 100644
--- a/engines/mads/dragonsphere/rooms/room303.h
+++ b/engines/mads/dragonsphere/rooms/room303.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_303_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room401.cpp b/engines/mads/dragonsphere/rooms/room401.cpp
index ca95306a998..79fdb58482e 100644
--- a/engines/mads/dragonsphere/rooms/room401.cpp
+++ b/engines/mads/dragonsphere/rooms/room401.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room401.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1369,5 +1368,4 @@ void room_401_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room401.h b/engines/mads/dragonsphere/rooms/room401.h
index d5bc99addd5..38fe83e45b1 100644
--- a/engines/mads/dragonsphere/rooms/room401.h
+++ b/engines/mads/dragonsphere/rooms/room401.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_401_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room402.cpp b/engines/mads/dragonsphere/rooms/room402.cpp
index 615cbdb0625..c9b1c0b7198 100644
--- a/engines/mads/dragonsphere/rooms/room402.cpp
+++ b/engines/mads/dragonsphere/rooms/room402.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room402.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -690,5 +689,4 @@ void room_402_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room402.h b/engines/mads/dragonsphere/rooms/room402.h
index f0d3afff5ef..7c2e84d3f0e 100644
--- a/engines/mads/dragonsphere/rooms/room402.h
+++ b/engines/mads/dragonsphere/rooms/room402.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_402_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room403.cpp b/engines/mads/dragonsphere/rooms/room403.cpp
index a7cb2e0222a..bb6a2b87307 100644
--- a/engines/mads/dragonsphere/rooms/room403.cpp
+++ b/engines/mads/dragonsphere/rooms/room403.cpp
@@ -34,7 +34,6 @@
 #include "mads/dragonsphere/rooms/room403.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -653,5 +652,4 @@ void room_403_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room403.h b/engines/mads/dragonsphere/rooms/room403.h
index eea286ffe7d..82a16c42342 100644
--- a/engines/mads/dragonsphere/rooms/room403.h
+++ b/engines/mads/dragonsphere/rooms/room403.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_403_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room404.cpp b/engines/mads/dragonsphere/rooms/room404.cpp
index e07f9597892..2adbfa8cf7c 100644
--- a/engines/mads/dragonsphere/rooms/room404.cpp
+++ b/engines/mads/dragonsphere/rooms/room404.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room404.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -423,5 +422,4 @@ void room_404_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room404.h b/engines/mads/dragonsphere/rooms/room404.h
index c17eee857ae..0fce0b81af3 100644
--- a/engines/mads/dragonsphere/rooms/room404.h
+++ b/engines/mads/dragonsphere/rooms/room404.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_404_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room405.cpp b/engines/mads/dragonsphere/rooms/room405.cpp
index 56b869588da..e428c3cdd74 100644
--- a/engines/mads/dragonsphere/rooms/room405.cpp
+++ b/engines/mads/dragonsphere/rooms/room405.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room405.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1425,5 +1424,4 @@ void room_405_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room405.h b/engines/mads/dragonsphere/rooms/room405.h
index fb1e78a40c4..bb1093b4d60 100644
--- a/engines/mads/dragonsphere/rooms/room405.h
+++ b/engines/mads/dragonsphere/rooms/room405.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_405_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room406.cpp b/engines/mads/dragonsphere/rooms/room406.cpp
index 8e727c03fe2..e0b770f4548 100644
--- a/engines/mads/dragonsphere/rooms/room406.cpp
+++ b/engines/mads/dragonsphere/rooms/room406.cpp
@@ -39,7 +39,6 @@
 #include "mads/dragonsphere/rooms/room406.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1563,5 +1562,4 @@ void room_406_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room406.h b/engines/mads/dragonsphere/rooms/room406.h
index ddba27c90ef..4f744ec4d43 100644
--- a/engines/mads/dragonsphere/rooms/room406.h
+++ b/engines/mads/dragonsphere/rooms/room406.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_406_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room407.cpp b/engines/mads/dragonsphere/rooms/room407.cpp
index ff983be5749..0a27cd04dd4 100644
--- a/engines/mads/dragonsphere/rooms/room407.cpp
+++ b/engines/mads/dragonsphere/rooms/room407.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room407.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -889,5 +888,4 @@ void room_407_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room407.h b/engines/mads/dragonsphere/rooms/room407.h
index 120c9dfd9e9..8747176ce21 100644
--- a/engines/mads/dragonsphere/rooms/room407.h
+++ b/engines/mads/dragonsphere/rooms/room407.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_407_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room408.cpp b/engines/mads/dragonsphere/rooms/room408.cpp
index d8cf495c53c..b30c59f5339 100644
--- a/engines/mads/dragonsphere/rooms/room408.cpp
+++ b/engines/mads/dragonsphere/rooms/room408.cpp
@@ -34,7 +34,6 @@
 #include "mads/dragonsphere/rooms/room408.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -575,5 +574,4 @@ void room_408_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room408.h b/engines/mads/dragonsphere/rooms/room408.h
index 391ccbfc18c..6cc8b2ec63b 100644
--- a/engines/mads/dragonsphere/rooms/room408.h
+++ b/engines/mads/dragonsphere/rooms/room408.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_408_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room409.cpp b/engines/mads/dragonsphere/rooms/room409.cpp
index ba8eaf8cf0a..d7b12f60d55 100644
--- a/engines/mads/dragonsphere/rooms/room409.cpp
+++ b/engines/mads/dragonsphere/rooms/room409.cpp
@@ -33,7 +33,6 @@
 #include "mads/dragonsphere/rooms/room409.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1325,5 +1324,4 @@ void room_409_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room409.h b/engines/mads/dragonsphere/rooms/room409.h
index 056907246c8..c4926db8a06 100644
--- a/engines/mads/dragonsphere/rooms/room409.h
+++ b/engines/mads/dragonsphere/rooms/room409.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_409_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room410.cpp b/engines/mads/dragonsphere/rooms/room410.cpp
index 703c1d4d781..7ce8c41e0d0 100644
--- a/engines/mads/dragonsphere/rooms/room410.cpp
+++ b/engines/mads/dragonsphere/rooms/room410.cpp
@@ -34,7 +34,6 @@
 #include "mads/dragonsphere/rooms/room410.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -646,5 +645,4 @@ void room_410_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room410.h b/engines/mads/dragonsphere/rooms/room410.h
index 7029d567a78..320da1633a4 100644
--- a/engines/mads/dragonsphere/rooms/room410.h
+++ b/engines/mads/dragonsphere/rooms/room410.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_410_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room411.cpp b/engines/mads/dragonsphere/rooms/room411.cpp
index e256f1ee909..a17f95cc6a5 100644
--- a/engines/mads/dragonsphere/rooms/room411.cpp
+++ b/engines/mads/dragonsphere/rooms/room411.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room411.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1042,5 +1041,4 @@ void room_411_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room411.h b/engines/mads/dragonsphere/rooms/room411.h
index 357926e207f..aa6457e7942 100644
--- a/engines/mads/dragonsphere/rooms/room411.h
+++ b/engines/mads/dragonsphere/rooms/room411.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_411_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room412.cpp b/engines/mads/dragonsphere/rooms/room412.cpp
index 6ff9fe36def..c024644b4df 100644
--- a/engines/mads/dragonsphere/rooms/room412.cpp
+++ b/engines/mads/dragonsphere/rooms/room412.cpp
@@ -30,7 +30,6 @@
 #include "mads/dragonsphere/rooms/room412.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -100,5 +99,4 @@ void room_412_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room412.h b/engines/mads/dragonsphere/rooms/room412.h
index eb3dcdbdfc8..9ef3fd1c2cf 100644
--- a/engines/mads/dragonsphere/rooms/room412.h
+++ b/engines/mads/dragonsphere/rooms/room412.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_412_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room454.cpp b/engines/mads/dragonsphere/rooms/room454.cpp
index 26bdde83bdc..544a679eeb1 100644
--- a/engines/mads/dragonsphere/rooms/room454.cpp
+++ b/engines/mads/dragonsphere/rooms/room454.cpp
@@ -31,7 +31,6 @@
 #include "mads/dragonsphere/rooms/room454.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -345,5 +344,4 @@ void room_454_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room454.h b/engines/mads/dragonsphere/rooms/room454.h
index 4bfa46fc0d3..411b1887894 100644
--- a/engines/mads/dragonsphere/rooms/room454.h
+++ b/engines/mads/dragonsphere/rooms/room454.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_454_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room501.cpp b/engines/mads/dragonsphere/rooms/room501.cpp
index 20211570639..841deb8441a 100644
--- a/engines/mads/dragonsphere/rooms/room501.cpp
+++ b/engines/mads/dragonsphere/rooms/room501.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room501.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -134,5 +133,4 @@ void room_501_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room501.h b/engines/mads/dragonsphere/rooms/room501.h
index 90d789e9f3e..44fe2762225 100644
--- a/engines/mads/dragonsphere/rooms/room501.h
+++ b/engines/mads/dragonsphere/rooms/room501.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_501_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room502.cpp b/engines/mads/dragonsphere/rooms/room502.cpp
index 12a2d446951..6fa1483dc4c 100644
--- a/engines/mads/dragonsphere/rooms/room502.cpp
+++ b/engines/mads/dragonsphere/rooms/room502.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room502.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -846,5 +845,4 @@ void room_502_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room502.h b/engines/mads/dragonsphere/rooms/room502.h
index 5ad0feefa06..74152f19102 100644
--- a/engines/mads/dragonsphere/rooms/room502.h
+++ b/engines/mads/dragonsphere/rooms/room502.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_502_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room503.cpp b/engines/mads/dragonsphere/rooms/room503.cpp
index c6de3269fb6..6682b8abde6 100644
--- a/engines/mads/dragonsphere/rooms/room503.cpp
+++ b/engines/mads/dragonsphere/rooms/room503.cpp
@@ -39,7 +39,6 @@
 #include "mads/dragonsphere/rooms/room503.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -532,5 +531,4 @@ void room_503_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room503.h b/engines/mads/dragonsphere/rooms/room503.h
index ff41e2ff3b5..b4d3b6fb3ca 100644
--- a/engines/mads/dragonsphere/rooms/room503.h
+++ b/engines/mads/dragonsphere/rooms/room503.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_503_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room504.cpp b/engines/mads/dragonsphere/rooms/room504.cpp
index d3f6b45351f..921cc77cec6 100644
--- a/engines/mads/dragonsphere/rooms/room504.cpp
+++ b/engines/mads/dragonsphere/rooms/room504.cpp
@@ -39,7 +39,6 @@
 #include "mads/dragonsphere/rooms/room504.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1964,5 +1963,4 @@ void room_504_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room504.h b/engines/mads/dragonsphere/rooms/room504.h
index 1d5f16aee83..8f43f2fdea2 100644
--- a/engines/mads/dragonsphere/rooms/room504.h
+++ b/engines/mads/dragonsphere/rooms/room504.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_504_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room505.cpp b/engines/mads/dragonsphere/rooms/room505.cpp
index 5d7936ff630..b5ae0bec9b6 100644
--- a/engines/mads/dragonsphere/rooms/room505.cpp
+++ b/engines/mads/dragonsphere/rooms/room505.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room505.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -179,5 +178,4 @@ void room_505_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room505.h b/engines/mads/dragonsphere/rooms/room505.h
index e842c98acd3..02537638f3c 100644
--- a/engines/mads/dragonsphere/rooms/room505.h
+++ b/engines/mads/dragonsphere/rooms/room505.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_505_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room506.cpp b/engines/mads/dragonsphere/rooms/room506.cpp
index 15bd9446049..2944c571288 100644
--- a/engines/mads/dragonsphere/rooms/room506.cpp
+++ b/engines/mads/dragonsphere/rooms/room506.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room506.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -860,5 +859,4 @@ void room_506_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room506.h b/engines/mads/dragonsphere/rooms/room506.h
index df9e04f6100..7f12014aca9 100644
--- a/engines/mads/dragonsphere/rooms/room506.h
+++ b/engines/mads/dragonsphere/rooms/room506.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_506_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room507.cpp b/engines/mads/dragonsphere/rooms/room507.cpp
index fb825f135ad..47ebb5c07d9 100644
--- a/engines/mads/dragonsphere/rooms/room507.cpp
+++ b/engines/mads/dragonsphere/rooms/room507.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room507.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -97,5 +96,4 @@ void room_507_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room507.h b/engines/mads/dragonsphere/rooms/room507.h
index 2c4fe755bc8..2333053a87e 100644
--- a/engines/mads/dragonsphere/rooms/room507.h
+++ b/engines/mads/dragonsphere/rooms/room507.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_507_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room508.cpp b/engines/mads/dragonsphere/rooms/room508.cpp
index 843ea732835..58ffc119ab0 100644
--- a/engines/mads/dragonsphere/rooms/room508.cpp
+++ b/engines/mads/dragonsphere/rooms/room508.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room508.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -982,5 +981,4 @@ void room_508_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room508.h b/engines/mads/dragonsphere/rooms/room508.h
index c4f068d2e3b..c4589f3a5cf 100644
--- a/engines/mads/dragonsphere/rooms/room508.h
+++ b/engines/mads/dragonsphere/rooms/room508.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_508_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room509.cpp b/engines/mads/dragonsphere/rooms/room509.cpp
index c04f0a69966..d25827014b7 100644
--- a/engines/mads/dragonsphere/rooms/room509.cpp
+++ b/engines/mads/dragonsphere/rooms/room509.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room509.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -681,5 +680,4 @@ void room_509_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room509.h b/engines/mads/dragonsphere/rooms/room509.h
index 289e33c79d9..98fb2545403 100644
--- a/engines/mads/dragonsphere/rooms/room509.h
+++ b/engines/mads/dragonsphere/rooms/room509.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_509_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room510.cpp b/engines/mads/dragonsphere/rooms/room510.cpp
index e98fc2c0334..e66f08b1f9c 100644
--- a/engines/mads/dragonsphere/rooms/room510.cpp
+++ b/engines/mads/dragonsphere/rooms/room510.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room510.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1136,5 +1135,4 @@ void room_510_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room510.h b/engines/mads/dragonsphere/rooms/room510.h
index 50f6d03dfb6..39a8a31f38f 100644
--- a/engines/mads/dragonsphere/rooms/room510.h
+++ b/engines/mads/dragonsphere/rooms/room510.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_510_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room511.cpp b/engines/mads/dragonsphere/rooms/room511.cpp
index 1d06aaa5e0a..46ce91a1026 100644
--- a/engines/mads/dragonsphere/rooms/room511.cpp
+++ b/engines/mads/dragonsphere/rooms/room511.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room511.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -149,5 +148,4 @@ void room_511_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room511.h b/engines/mads/dragonsphere/rooms/room511.h
index d4637ce5b71..2f530ae53a2 100644
--- a/engines/mads/dragonsphere/rooms/room511.h
+++ b/engines/mads/dragonsphere/rooms/room511.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_511_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room512.cpp b/engines/mads/dragonsphere/rooms/room512.cpp
index 0e02b0c360a..b18a1aff010 100644
--- a/engines/mads/dragonsphere/rooms/room512.cpp
+++ b/engines/mads/dragonsphere/rooms/room512.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room512.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -441,5 +440,4 @@ void room_512_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room512.h b/engines/mads/dragonsphere/rooms/room512.h
index ee94d8029f3..90aae42d290 100644
--- a/engines/mads/dragonsphere/rooms/room512.h
+++ b/engines/mads/dragonsphere/rooms/room512.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_512_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room557.cpp b/engines/mads/dragonsphere/rooms/room557.cpp
index e05c8d53c43..b701138b22c 100644
--- a/engines/mads/dragonsphere/rooms/room557.cpp
+++ b/engines/mads/dragonsphere/rooms/room557.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room557.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -139,5 +138,4 @@ void room_557_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room557.h b/engines/mads/dragonsphere/rooms/room557.h
index 009fda45bfe..a8925c6c434 100644
--- a/engines/mads/dragonsphere/rooms/room557.h
+++ b/engines/mads/dragonsphere/rooms/room557.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_557_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room601.cpp b/engines/mads/dragonsphere/rooms/room601.cpp
index 1283569e180..85e281bf9aa 100644
--- a/engines/mads/dragonsphere/rooms/room601.cpp
+++ b/engines/mads/dragonsphere/rooms/room601.cpp
@@ -41,7 +41,6 @@
 #include "mads/dragonsphere/rooms/room601.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1750,5 +1749,4 @@ void room_601_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room601.h b/engines/mads/dragonsphere/rooms/room601.h
index b1ca23219be..e9ce36cf2c0 100644
--- a/engines/mads/dragonsphere/rooms/room601.h
+++ b/engines/mads/dragonsphere/rooms/room601.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_601_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room603.cpp b/engines/mads/dragonsphere/rooms/room603.cpp
index 561354e40e1..6d14a8f62c1 100644
--- a/engines/mads/dragonsphere/rooms/room603.cpp
+++ b/engines/mads/dragonsphere/rooms/room603.cpp
@@ -36,7 +36,6 @@
 #include "mads/dragonsphere/rooms/room603.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -698,5 +697,4 @@ void room_603_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room603.h b/engines/mads/dragonsphere/rooms/room603.h
index 0c2aacfa7c9..6871b3d6359 100644
--- a/engines/mads/dragonsphere/rooms/room603.h
+++ b/engines/mads/dragonsphere/rooms/room603.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_603_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room604.cpp b/engines/mads/dragonsphere/rooms/room604.cpp
index 165d71d0445..a42d54db294 100644
--- a/engines/mads/dragonsphere/rooms/room604.cpp
+++ b/engines/mads/dragonsphere/rooms/room604.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room604.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -402,5 +401,4 @@ void room_604_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room604.h b/engines/mads/dragonsphere/rooms/room604.h
index 3b1732a8b66..73b90e8ad23 100644
--- a/engines/mads/dragonsphere/rooms/room604.h
+++ b/engines/mads/dragonsphere/rooms/room604.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_604_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room605.cpp b/engines/mads/dragonsphere/rooms/room605.cpp
index 160e79833f2..62a592b4660 100644
--- a/engines/mads/dragonsphere/rooms/room605.cpp
+++ b/engines/mads/dragonsphere/rooms/room605.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room605.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1606,5 +1605,4 @@ void room_605_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room605.h b/engines/mads/dragonsphere/rooms/room605.h
index 8e21b9a64e0..5df4e93f7bc 100644
--- a/engines/mads/dragonsphere/rooms/room605.h
+++ b/engines/mads/dragonsphere/rooms/room605.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_605_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room606.cpp b/engines/mads/dragonsphere/rooms/room606.cpp
index b36af0e3bd2..f7f9e6aba4f 100644
--- a/engines/mads/dragonsphere/rooms/room606.cpp
+++ b/engines/mads/dragonsphere/rooms/room606.cpp
@@ -38,7 +38,6 @@
 #include "mads/dragonsphere/rooms/room606.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1179,5 +1178,4 @@ void room_606_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room606.h b/engines/mads/dragonsphere/rooms/room606.h
index 892a9f72a39..43baafa4067 100644
--- a/engines/mads/dragonsphere/rooms/room606.h
+++ b/engines/mads/dragonsphere/rooms/room606.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_606_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room607.cpp b/engines/mads/dragonsphere/rooms/room607.cpp
index 46f2271e5cb..812fab56783 100644
--- a/engines/mads/dragonsphere/rooms/room607.cpp
+++ b/engines/mads/dragonsphere/rooms/room607.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room607.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -702,5 +701,4 @@ void room_607_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room607.h b/engines/mads/dragonsphere/rooms/room607.h
index 5fbd43ec193..f7bc949129c 100644
--- a/engines/mads/dragonsphere/rooms/room607.h
+++ b/engines/mads/dragonsphere/rooms/room607.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_607_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room609.cpp b/engines/mads/dragonsphere/rooms/room609.cpp
index ea65f58e25d..4395eac9064 100644
--- a/engines/mads/dragonsphere/rooms/room609.cpp
+++ b/engines/mads/dragonsphere/rooms/room609.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room609.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -487,5 +486,4 @@ void room_609_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room609.h b/engines/mads/dragonsphere/rooms/room609.h
index 9c7f475b14c..ba838e608c3 100644
--- a/engines/mads/dragonsphere/rooms/room609.h
+++ b/engines/mads/dragonsphere/rooms/room609.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_609_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room612.cpp b/engines/mads/dragonsphere/rooms/room612.cpp
index bdd332277ea..dedf58bb0f5 100644
--- a/engines/mads/dragonsphere/rooms/room612.cpp
+++ b/engines/mads/dragonsphere/rooms/room612.cpp
@@ -35,7 +35,6 @@
 #include "mads/dragonsphere/rooms/room612.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -454,5 +453,4 @@ void room_612_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room612.h b/engines/mads/dragonsphere/rooms/room612.h
index 157e4a57218..0270c90c4f9 100644
--- a/engines/mads/dragonsphere/rooms/room612.h
+++ b/engines/mads/dragonsphere/rooms/room612.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_612_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room613.cpp b/engines/mads/dragonsphere/rooms/room613.cpp
index 9e5313070d7..4809e23b1a7 100644
--- a/engines/mads/dragonsphere/rooms/room613.cpp
+++ b/engines/mads/dragonsphere/rooms/room613.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room613.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -438,5 +437,4 @@ void room_613_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room613.h b/engines/mads/dragonsphere/rooms/room613.h
index 26449c60340..54906f5eacf 100644
--- a/engines/mads/dragonsphere/rooms/room613.h
+++ b/engines/mads/dragonsphere/rooms/room613.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_613_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room614.cpp b/engines/mads/dragonsphere/rooms/room614.cpp
index 5f721af6745..5578deb006e 100644
--- a/engines/mads/dragonsphere/rooms/room614.cpp
+++ b/engines/mads/dragonsphere/rooms/room614.cpp
@@ -37,7 +37,6 @@
 #include "mads/dragonsphere/rooms/room614.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -1902,5 +1901,4 @@ void room_614_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room614.h b/engines/mads/dragonsphere/rooms/room614.h
index 639d94e8587..479c65edc9f 100644
--- a/engines/mads/dragonsphere/rooms/room614.h
+++ b/engines/mads/dragonsphere/rooms/room614.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_614_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/room909.cpp b/engines/mads/dragonsphere/rooms/room909.cpp
index e94055f7bb3..84e314a5916 100644
--- a/engines/mads/dragonsphere/rooms/room909.cpp
+++ b/engines/mads/dragonsphere/rooms/room909.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/rooms/room909.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -227,5 +226,4 @@ void room_909_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/room909.h b/engines/mads/dragonsphere/rooms/room909.h
index 133cc123563..6d84a9f5745 100644
--- a/engines/mads/dragonsphere/rooms/room909.h
+++ b/engines/mads/dragonsphere/rooms/room909.h
@@ -26,7 +26,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void room_909_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section1.cpp b/engines/mads/dragonsphere/rooms/section1.cpp
index a1698183f1c..2767bbe6f05 100644
--- a/engines/mads/dragonsphere/rooms/section1.cpp
+++ b/engines/mads/dragonsphere/rooms/section1.cpp
@@ -33,7 +33,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -332,5 +331,4 @@ void section_1_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section1.h b/engines/mads/dragonsphere/rooms/section1.h
index 7fd7eb8bc24..fb93a883ead 100644
--- a/engines/mads/dragonsphere/rooms/section1.h
+++ b/engines/mads/dragonsphere/rooms/section1.h
@@ -26,7 +26,6 @@
 #include "mads/dragonsphere/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -36,7 +35,6 @@ extern void section_1_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section2.cpp b/engines/mads/dragonsphere/rooms/section2.cpp
index c75d1753eda..3fa5c86c9ee 100644
--- a/engines/mads/dragonsphere/rooms/section2.cpp
+++ b/engines/mads/dragonsphere/rooms/section2.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -162,5 +161,4 @@ void section_2_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section2.h b/engines/mads/dragonsphere/rooms/section2.h
index 555bc903911..5ce72757fe8 100644
--- a/engines/mads/dragonsphere/rooms/section2.h
+++ b/engines/mads/dragonsphere/rooms/section2.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_2_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section3.cpp b/engines/mads/dragonsphere/rooms/section3.cpp
index 9bee8eb18bd..9c35eb7e2f5 100644
--- a/engines/mads/dragonsphere/rooms/section3.cpp
+++ b/engines/mads/dragonsphere/rooms/section3.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -148,5 +147,4 @@ void section_3_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section3.h b/engines/mads/dragonsphere/rooms/section3.h
index 5d7896a35a6..c427dfb8485 100644
--- a/engines/mads/dragonsphere/rooms/section3.h
+++ b/engines/mads/dragonsphere/rooms/section3.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_3_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section4.cpp b/engines/mads/dragonsphere/rooms/section4.cpp
index bfd9d3c7209..48e95891eb0 100644
--- a/engines/mads/dragonsphere/rooms/section4.cpp
+++ b/engines/mads/dragonsphere/rooms/section4.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -233,5 +232,4 @@ void section_4_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section4.h b/engines/mads/dragonsphere/rooms/section4.h
index fc19142d410..dfe4174ad8c 100644
--- a/engines/mads/dragonsphere/rooms/section4.h
+++ b/engines/mads/dragonsphere/rooms/section4.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_4_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section5.cpp b/engines/mads/dragonsphere/rooms/section5.cpp
index 28392f0b796..45e6908c35d 100644
--- a/engines/mads/dragonsphere/rooms/section5.cpp
+++ b/engines/mads/dragonsphere/rooms/section5.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -211,5 +210,4 @@ void section_5_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section5.h b/engines/mads/dragonsphere/rooms/section5.h
index ac1c4aca9a2..f9b1ab04435 100644
--- a/engines/mads/dragonsphere/rooms/section5.h
+++ b/engines/mads/dragonsphere/rooms/section5.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_5_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section6.cpp b/engines/mads/dragonsphere/rooms/section6.cpp
index a8e8cb2defb..6e176b56eb9 100644
--- a/engines/mads/dragonsphere/rooms/section6.cpp
+++ b/engines/mads/dragonsphere/rooms/section6.cpp
@@ -32,7 +32,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -211,5 +210,4 @@ void section_6_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section6.h b/engines/mads/dragonsphere/rooms/section6.h
index 4fea84e65ce..bea5e300714 100644
--- a/engines/mads/dragonsphere/rooms/section6.h
+++ b/engines/mads/dragonsphere/rooms/section6.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_6_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/rooms/section9.cpp b/engines/mads/dragonsphere/rooms/section9.cpp
index 34bed2fd412..c2b81e7abe4 100644
--- a/engines/mads/dragonsphere/rooms/section9.cpp
+++ b/engines/mads/dragonsphere/rooms/section9.cpp
@@ -33,7 +33,6 @@
 #include "mads/dragonsphere/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -96,5 +95,4 @@ void section_9_preload() {
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/rooms/section9.h b/engines/mads/dragonsphere/rooms/section9.h
index 0c6674e7cad..ad291422236 100644
--- a/engines/mads/dragonsphere/rooms/section9.h
+++ b/engines/mads/dragonsphere/rooms/section9.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_9_music();
 
 } // namespace Rooms
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/dragonsphere/sound_dragonsphere.cpp b/engines/mads/dragonsphere/sound_dragonsphere.cpp
index 64372c04fe0..7e169b59f88 100644
--- a/engines/mads/dragonsphere/sound_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/sound_dragonsphere.cpp
@@ -26,7 +26,6 @@
 #include "mads/dragonsphere/sound_dragonsphere.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 void DragonSoundManager::validate() {
@@ -3940,5 +3939,4 @@ int ASoundDemo9::command49() { findFreeChannel(loadData(0x5E8E)); return 0; }
 int ASoundDemo9::command50() { findFreeChannel(loadData(0x5E98)); return 0; }
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/dragonsphere/sound_dragonsphere.h b/engines/mads/dragonsphere/sound_dragonsphere.h
index 73e38ee3377..e1fb6b29e41 100644
--- a/engines/mads/dragonsphere/sound_dragonsphere.h
+++ b/engines/mads/dragonsphere/sound_dragonsphere.h
@@ -25,7 +25,6 @@
 #include "mads/dragonsphere/asound.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Dragonsphere {
 
 class DragonSoundManager : public SoundManager {
@@ -624,7 +623,6 @@ public:
 };
 
 } // namespace Dragonsphere
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/engine.cpp b/engines/mads/engine.cpp
index 9134542a7df..ab5ac9a9e91 100644
--- a/engines/mads/engine.cpp
+++ b/engines/mads/engine.cpp
@@ -59,7 +59,6 @@
 #include "mads/core/sound_manager.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 constexpr int SAVEGAME_VERSION = 1;
 constexpr int GAME_FRAME_RATE = 50;
@@ -515,5 +514,4 @@ void MADSV2Engine::player_keep_walking() {
 	}
 }
 
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/engine.h b/engines/mads/engine.h
index 0be35f5c432..3d173cd1221 100644
--- a/engines/mads/engine.h
+++ b/engines/mads/engine.h
@@ -34,7 +34,6 @@
 #include "mads/core/speech.h"
 
 namespace MADS {
-namespace MADSV2 {
 
 typedef void (*TimerFunction)();
 
@@ -135,7 +134,6 @@ public:
 
 extern MADSV2Engine *g_engine;
 
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/digi.cpp b/engines/mads/forest/digi.cpp
index 7e50f0dca50..09641cf5c18 100644
--- a/engines/mads/forest/digi.cpp
+++ b/engines/mads/forest/digi.cpp
@@ -27,7 +27,6 @@
 #include "mads/core/kernel.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 int digi_val2;
@@ -144,5 +143,4 @@ void digi_set_volume(int vol, int slot) {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/digi.h b/engines/mads/forest/digi.h
index 2975587b802..b023c3d5ef3 100644
--- a/engines/mads/forest/digi.h
+++ b/engines/mads/forest/digi.h
@@ -26,7 +26,6 @@
 #include "audio/mixer.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 #define MAX_DIGI_CHANNELS 3
@@ -90,7 +89,6 @@ extern void digi_set_volume(int vol, int slot);
 extern void digi_read_another_chunk();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/extra.cpp b/engines/mads/forest/extra.cpp
index c47f72be5a5..1b1a5fec5d7 100644
--- a/engines/mads/forest/extra.cpp
+++ b/engines/mads/forest/extra.cpp
@@ -37,7 +37,6 @@
 #include "mads/forest/midi.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 int int_sprite[6];
@@ -307,5 +306,4 @@ void extra_change_animation(int handle, int x, int y, int scale, int depth) {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/extra.h b/engines/mads/forest/extra.h
index 848245233a9..59a92ff98e3 100644
--- a/engines/mads/forest/extra.h
+++ b/engines/mads/forest/extra.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 // Interface sprites
@@ -85,7 +84,6 @@ extern void close_interface(InterfaceButton button);
 extern void extra_change_animation(int handle, int x, int y, int scale, int depth);
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/forest.cpp b/engines/mads/forest/forest.cpp
index 13a1e10660d..a8913afbf4c 100644
--- a/engines/mads/forest/forest.cpp
+++ b/engines/mads/forest/forest.cpp
@@ -54,7 +54,6 @@
 #include "mads/core/mps_installer.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 ForestEngine *g_engine;
@@ -202,5 +201,4 @@ void ForestEngine::global_game_main_loop() {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/forest.h b/engines/mads/forest/forest.h
index 35223aeec9b..35de735a117 100644
--- a/engines/mads/forest/forest.h
+++ b/engines/mads/forest/forest.h
@@ -27,7 +27,6 @@
 #include "mads/forest/midi.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 class ForestEngine : public MADSV2Engine {
@@ -60,7 +59,6 @@ public:
 extern ForestEngine *g_engine;
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/global.cpp b/engines/mads/forest/global.cpp
index ba1ef0fff20..a4e64c242dd 100644
--- a/engines/mads/forest/global.cpp
+++ b/engines/mads/forest/global.cpp
@@ -36,7 +36,6 @@
 #include "mads/forest/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 #define MOVE_YOUR_BUTT_TIMEOUT 3600
@@ -1352,5 +1351,4 @@ void global_game_main_loop() {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/global.h b/engines/mads/forest/global.h
index 05fd3af7e30..8acc06e3c6b 100644
--- a/engines/mads/forest/global.h
+++ b/engines/mads/forest/global.h
@@ -27,7 +27,6 @@
 #include "mads/forest/extra.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 enum {	
@@ -278,7 +277,6 @@ extern void global_daemon_code();
 extern void global_game_main_loop();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/inventory.cpp b/engines/mads/forest/inventory.cpp
index 31b3136261d..88493cc7c08 100644
--- a/engines/mads/forest/inventory.cpp
+++ b/engines/mads/forest/inventory.cpp
@@ -42,7 +42,6 @@
 #include "mads/forest/midi.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 char interface_name[40];
@@ -415,5 +414,4 @@ restore_interface:
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/inventory.h b/engines/mads/forest/inventory.h
index 492e78c0b6b..17ea4d9534a 100644
--- a/engines/mads/forest/inventory.h
+++ b/engines/mads/forest/inventory.h
@@ -25,14 +25,12 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 extern void init_inventory();
 extern void display_inventory();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/journal.cpp b/engines/mads/forest/journal.cpp
index 7cf44fa9bc6..ab5a282f638 100644
--- a/engines/mads/forest/journal.cpp
+++ b/engines/mads/forest/journal.cpp
@@ -28,7 +28,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 static int prior_room;
@@ -56,5 +55,4 @@ void leave_journal() {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/journal.h b/engines/mads/forest/journal.h
index 3d1feac42d6..95bc76c7664 100644
--- a/engines/mads/forest/journal.h
+++ b/engines/mads/forest/journal.h
@@ -25,14 +25,12 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 extern void display_journal();
 extern void leave_journal();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/mads/inventory.h b/engines/mads/forest/mads/inventory.h
index 46eac214777..c54c11e9467 100644
--- a/engines/mads/forest/mads/inventory.h
+++ b/engines/mads/forest/mads/inventory.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 enum {
@@ -47,7 +46,6 @@ enum {
 };
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/mads/quotes.h b/engines/mads/forest/mads/quotes.h
index 483cb3d2a0c..8c8518fb669 100644
--- a/engines/mads/forest/mads/quotes.h
+++ b/engines/mads/forest/mads/quotes.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 enum {
@@ -57,7 +56,6 @@ enum {
 };
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/mads/sounds.h b/engines/mads/forest/mads/sounds.h
index 184b0c02101..96abb60f8c4 100644
--- a/engines/mads/forest/mads/sounds.h
+++ b/engines/mads/forest/mads/sounds.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 enum {
@@ -37,7 +36,6 @@ enum {
 };
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/mads/words.h b/engines/mads/forest/mads/words.h
index 5de407c1596..cb012acf8ab 100644
--- a/engines/mads/forest/mads/words.h
+++ b/engines/mads/forest/mads/words.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 enum {
@@ -220,7 +219,6 @@ enum {
 };
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/main.cpp b/engines/mads/forest/main.cpp
index 5be2ebb839e..0b13d75c1c3 100644
--- a/engines/mads/forest/main.cpp
+++ b/engines/mads/forest/main.cpp
@@ -42,7 +42,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 constexpr bool SHOW_LINES = true;
@@ -157,5 +156,4 @@ void forest_main() {
 }
 
 } // namespace Foreste
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/main.h b/engines/mads/forest/main.h
index 7d74c096016..5e706eecc7c 100644
--- a/engines/mads/forest/main.h
+++ b/engines/mads/forest/main.h
@@ -25,13 +25,11 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 extern void forest_main();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/menus.cpp b/engines/mads/forest/menus.cpp
index 6d173e611a1..b674f977b2a 100644
--- a/engines/mads/forest/menus.cpp
+++ b/engines/mads/forest/menus.cpp
@@ -36,7 +36,6 @@
 #include "mads/forest/midi.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 #define SAVE_SUCCESSFUL                 1
@@ -376,5 +375,4 @@ done:
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/menus.h b/engines/mads/forest/menus.h
index 2b0635f7cb3..7c767641194 100644
--- a/engines/mads/forest/menus.h
+++ b/engines/mads/forest/menus.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 extern void global_menu_system_init();
@@ -34,7 +33,6 @@ extern void global_emergency_save();
 extern void global_game_menu();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/midi.cpp b/engines/mads/forest/midi.cpp
index d6a45cad499..31c9049892c 100644
--- a/engines/mads/forest/midi.cpp
+++ b/engines/mads/forest/midi.cpp
@@ -29,7 +29,6 @@
 #include "mads/forest/forest.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 bool midi_playing;
@@ -229,5 +228,4 @@ void midi_loop() {
 }
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/midi.h b/engines/mads/forest/midi.h
index 2b4f78257e1..68945d810c9 100644
--- a/engines/mads/forest/midi.h
+++ b/engines/mads/forest/midi.h
@@ -26,7 +26,6 @@
 #include "audio/midiparser.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 
 extern bool midi_playing;
@@ -66,7 +65,6 @@ extern void midi_stop();
 extern void midi_loop();
 
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/room101.cpp b/engines/mads/forest/rooms/room101.cpp
index 6d808dd8b7c..b429184ae25 100644
--- a/engines/mads/forest/rooms/room101.cpp
+++ b/engines/mads/forest/rooms/room101.cpp
@@ -39,7 +39,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1142,5 +1141,4 @@ void room_101_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room103.cpp b/engines/mads/forest/rooms/room103.cpp
index 5140064cb4f..75d1f8913d1 100644
--- a/engines/mads/forest/rooms/room103.cpp
+++ b/engines/mads/forest/rooms/room103.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -433,5 +432,4 @@ void room_103_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room104.cpp b/engines/mads/forest/rooms/room104.cpp
index e5abef4ea4e..43b1353223c 100644
--- a/engines/mads/forest/rooms/room104.cpp
+++ b/engines/mads/forest/rooms/room104.cpp
@@ -39,7 +39,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -979,5 +978,4 @@ void room_104_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room106.cpp b/engines/mads/forest/rooms/room106.cpp
index 7421c3da21e..b246d9909b1 100644
--- a/engines/mads/forest/rooms/room106.cpp
+++ b/engines/mads/forest/rooms/room106.cpp
@@ -39,7 +39,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -827,5 +826,4 @@ void room_106_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room107.cpp b/engines/mads/forest/rooms/room107.cpp
index ffedcf624d3..730deacf4ef 100644
--- a/engines/mads/forest/rooms/room107.cpp
+++ b/engines/mads/forest/rooms/room107.cpp
@@ -30,7 +30,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -170,5 +169,4 @@ void room_107_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room199.cpp b/engines/mads/forest/rooms/room199.cpp
index d9b5b7d11e3..2da241a1cbb 100644
--- a/engines/mads/forest/rooms/room199.cpp
+++ b/engines/mads/forest/rooms/room199.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -617,5 +616,4 @@ void room_199_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room201.cpp b/engines/mads/forest/rooms/room201.cpp
index 59424260993..1755a2ebc45 100644
--- a/engines/mads/forest/rooms/room201.cpp
+++ b/engines/mads/forest/rooms/room201.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -697,5 +696,4 @@ void room_201_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room203.cpp b/engines/mads/forest/rooms/room203.cpp
index 072210ff2b5..104abbc1e6a 100644
--- a/engines/mads/forest/rooms/room203.cpp
+++ b/engines/mads/forest/rooms/room203.cpp
@@ -35,7 +35,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1896,5 +1895,4 @@ void room_203_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room204.cpp b/engines/mads/forest/rooms/room204.cpp
index db853505c0a..52d5313ab50 100644
--- a/engines/mads/forest/rooms/room204.cpp
+++ b/engines/mads/forest/rooms/room204.cpp
@@ -34,7 +34,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -637,5 +636,4 @@ void room_204_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room205.cpp b/engines/mads/forest/rooms/room205.cpp
index bb059ee05af..89c9bdca270 100644
--- a/engines/mads/forest/rooms/room205.cpp
+++ b/engines/mads/forest/rooms/room205.cpp
@@ -35,7 +35,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -497,5 +496,4 @@ void room_205_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room210.cpp b/engines/mads/forest/rooms/room210.cpp
index 47f24e3ef95..4f1b25a114e 100644
--- a/engines/mads/forest/rooms/room210.cpp
+++ b/engines/mads/forest/rooms/room210.cpp
@@ -35,7 +35,6 @@
 #include "mads/core/speech.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -687,5 +686,4 @@ void room_210_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room211.cpp b/engines/mads/forest/rooms/room211.cpp
index dd9b82c6f73..34dac219a68 100644
--- a/engines/mads/forest/rooms/room211.cpp
+++ b/engines/mads/forest/rooms/room211.cpp
@@ -30,7 +30,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -136,5 +135,4 @@ void room_211_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room220.cpp b/engines/mads/forest/rooms/room220.cpp
index ec6d0eb494e..98161536488 100644
--- a/engines/mads/forest/rooms/room220.cpp
+++ b/engines/mads/forest/rooms/room220.cpp
@@ -30,7 +30,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -269,5 +268,4 @@ void room_220_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room221.cpp b/engines/mads/forest/rooms/room221.cpp
index 258f377815d..6efa8fb6ad1 100644
--- a/engines/mads/forest/rooms/room221.cpp
+++ b/engines/mads/forest/rooms/room221.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -675,5 +674,4 @@ void room_221_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room301.cpp b/engines/mads/forest/rooms/room301.cpp
index a00b78cfa7c..cf0cb00c6e8 100644
--- a/engines/mads/forest/rooms/room301.cpp
+++ b/engines/mads/forest/rooms/room301.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -872,5 +871,4 @@ void room_301_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room302.cpp b/engines/mads/forest/rooms/room302.cpp
index 2384368939c..0244b40157b 100644
--- a/engines/mads/forest/rooms/room302.cpp
+++ b/engines/mads/forest/rooms/room302.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -966,5 +965,4 @@ void room_302_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room303.cpp b/engines/mads/forest/rooms/room303.cpp
index 745f716da4d..9bb532ae0aa 100644
--- a/engines/mads/forest/rooms/room303.cpp
+++ b/engines/mads/forest/rooms/room303.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -950,5 +949,4 @@ void room_303_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room304.cpp b/engines/mads/forest/rooms/room304.cpp
index ad922717464..4089080b22e 100644
--- a/engines/mads/forest/rooms/room304.cpp
+++ b/engines/mads/forest/rooms/room304.cpp
@@ -38,7 +38,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -659,5 +658,4 @@ void room_304_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room305.cpp b/engines/mads/forest/rooms/room305.cpp
index 07161b419d8..c7b619c06c4 100644
--- a/engines/mads/forest/rooms/room305.cpp
+++ b/engines/mads/forest/rooms/room305.cpp
@@ -33,7 +33,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1170,5 +1169,4 @@ void room_305_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room306.cpp b/engines/mads/forest/rooms/room306.cpp
index 3b40cd9a4fa..d61da85138a 100644
--- a/engines/mads/forest/rooms/room306.cpp
+++ b/engines/mads/forest/rooms/room306.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1030,5 +1029,4 @@ void room_306_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room307.cpp b/engines/mads/forest/rooms/room307.cpp
index 44d8f9dc287..d7e5a639cd3 100644
--- a/engines/mads/forest/rooms/room307.cpp
+++ b/engines/mads/forest/rooms/room307.cpp
@@ -39,7 +39,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -972,5 +971,4 @@ void room_307_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room308.cpp b/engines/mads/forest/rooms/room308.cpp
index fd5a7301ec1..7c8d37dc325 100644
--- a/engines/mads/forest/rooms/room308.cpp
+++ b/engines/mads/forest/rooms/room308.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/sprite.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1369,5 +1368,4 @@ void room_308_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room321.cpp b/engines/mads/forest/rooms/room321.cpp
index 862ebd55856..d300610f7c0 100644
--- a/engines/mads/forest/rooms/room321.cpp
+++ b/engines/mads/forest/rooms/room321.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -901,5 +900,4 @@ void room_321_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room322.cpp b/engines/mads/forest/rooms/room322.cpp
index bf8302c297c..910d2006faf 100644
--- a/engines/mads/forest/rooms/room322.cpp
+++ b/engines/mads/forest/rooms/room322.cpp
@@ -38,7 +38,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -823,5 +822,4 @@ void room_322_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room401.cpp b/engines/mads/forest/rooms/room401.cpp
index 82b0b19bea6..f7630c4e601 100644
--- a/engines/mads/forest/rooms/room401.cpp
+++ b/engines/mads/forest/rooms/room401.cpp
@@ -38,7 +38,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -671,5 +670,4 @@ void room_401_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room402.cpp b/engines/mads/forest/rooms/room402.cpp
index 542342cf7e7..28e541457c4 100644
--- a/engines/mads/forest/rooms/room402.cpp
+++ b/engines/mads/forest/rooms/room402.cpp
@@ -38,7 +38,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -866,5 +865,4 @@ void room_402_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room403.cpp b/engines/mads/forest/rooms/room403.cpp
index c55259cdb5a..7d69a1bd266 100644
--- a/engines/mads/forest/rooms/room403.cpp
+++ b/engines/mads/forest/rooms/room403.cpp
@@ -39,7 +39,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -830,5 +829,4 @@ void room_403_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room404.cpp b/engines/mads/forest/rooms/room404.cpp
index 85425e5a745..b20b477be55 100644
--- a/engines/mads/forest/rooms/room404.cpp
+++ b/engines/mads/forest/rooms/room404.cpp
@@ -37,7 +37,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -973,5 +972,4 @@ void room_404_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room405.cpp b/engines/mads/forest/rooms/room405.cpp
index 9dbe37cd478..3f0c426a814 100644
--- a/engines/mads/forest/rooms/room405.cpp
+++ b/engines/mads/forest/rooms/room405.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -533,5 +532,4 @@ void room_405_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room420.cpp b/engines/mads/forest/rooms/room420.cpp
index e5f18a3be04..4e475ec61db 100644
--- a/engines/mads/forest/rooms/room420.cpp
+++ b/engines/mads/forest/rooms/room420.cpp
@@ -28,7 +28,6 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -236,5 +235,4 @@ void room_420_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room501.cpp b/engines/mads/forest/rooms/room501.cpp
index 17f86b9086a..55b0f3e36fc 100644
--- a/engines/mads/forest/rooms/room501.cpp
+++ b/engines/mads/forest/rooms/room501.cpp
@@ -36,7 +36,6 @@
 #include "mads/core/text.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -637,5 +636,4 @@ void room_501_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room503.cpp b/engines/mads/forest/rooms/room503.cpp
index 98d1a9b4923..3e019392cb2 100644
--- a/engines/mads/forest/rooms/room503.cpp
+++ b/engines/mads/forest/rooms/room503.cpp
@@ -39,7 +39,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -1181,5 +1180,4 @@ void room_503_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room509.cpp b/engines/mads/forest/rooms/room509.cpp
index dec4a1170fa..285105f2720 100644
--- a/engines/mads/forest/rooms/room509.cpp
+++ b/engines/mads/forest/rooms/room509.cpp
@@ -30,7 +30,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -301,5 +300,4 @@ void room_509_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room510.cpp b/engines/mads/forest/rooms/room510.cpp
index 0800faf8411..9ab5654bf3c 100644
--- a/engines/mads/forest/rooms/room510.cpp
+++ b/engines/mads/forest/rooms/room510.cpp
@@ -34,7 +34,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -370,5 +369,4 @@ void room_510_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room520.cpp b/engines/mads/forest/rooms/room520.cpp
index 78b6908fc37..60a3daeb0d4 100644
--- a/engines/mads/forest/rooms/room520.cpp
+++ b/engines/mads/forest/rooms/room520.cpp
@@ -30,7 +30,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -157,5 +156,4 @@ void room_520_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room901.cpp b/engines/mads/forest/rooms/room901.cpp
index 64fdc526487..6bcb5d45c4f 100644
--- a/engines/mads/forest/rooms/room901.cpp
+++ b/engines/mads/forest/rooms/room901.cpp
@@ -29,7 +29,6 @@
 #include "mads/core/mouse.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -84,5 +83,4 @@ void room_901_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room903.cpp b/engines/mads/forest/rooms/room903.cpp
index ec8fc1e837a..d4c363b5384 100644
--- a/engines/mads/forest/rooms/room903.cpp
+++ b/engines/mads/forest/rooms/room903.cpp
@@ -30,7 +30,6 @@
 #include "mads/core/mouse.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -83,5 +82,4 @@ void room_903_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/room904.cpp b/engines/mads/forest/rooms/room904.cpp
index 4d77525e82e..ac848a0ae13 100644
--- a/engines/mads/forest/rooms/room904.cpp
+++ b/engines/mads/forest/rooms/room904.cpp
@@ -33,7 +33,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -357,5 +356,4 @@ void room_904_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section1.cpp b/engines/mads/forest/rooms/section1.cpp
index aa0df71955f..6fe5b6b84be 100644
--- a/engines/mads/forest/rooms/section1.cpp
+++ b/engines/mads/forest/rooms/section1.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -92,5 +91,4 @@ void section_1_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section1.h b/engines/mads/forest/rooms/section1.h
index 8019e741ce3..17e1413e100 100644
--- a/engines/mads/forest/rooms/section1.h
+++ b/engines/mads/forest/rooms/section1.h
@@ -26,7 +26,6 @@
 #include "mads/forest/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -34,7 +33,6 @@ extern void section_1_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/section2.cpp b/engines/mads/forest/rooms/section2.cpp
index ff8951d7128..6d3b766d93e 100644
--- a/engines/mads/forest/rooms/section2.cpp
+++ b/engines/mads/forest/rooms/section2.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -101,5 +100,4 @@ void section_2_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section2.h b/engines/mads/forest/rooms/section2.h
index 926e5c02c8c..5fdfdcd376e 100644
--- a/engines/mads/forest/rooms/section2.h
+++ b/engines/mads/forest/rooms/section2.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -33,7 +32,6 @@ extern void section_2_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/section3.cpp b/engines/mads/forest/rooms/section3.cpp
index 96768f4dc9f..e68be0952e3 100644
--- a/engines/mads/forest/rooms/section3.cpp
+++ b/engines/mads/forest/rooms/section3.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -108,5 +107,4 @@ void section_3_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section3.h b/engines/mads/forest/rooms/section3.h
index ddc604e22ef..5f00da8992c 100644
--- a/engines/mads/forest/rooms/section3.h
+++ b/engines/mads/forest/rooms/section3.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -33,7 +32,6 @@ extern void section_3_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/section4.cpp b/engines/mads/forest/rooms/section4.cpp
index 2cfc45ea548..51446865c53 100644
--- a/engines/mads/forest/rooms/section4.cpp
+++ b/engines/mads/forest/rooms/section4.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -92,5 +91,4 @@ void section_4_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section4.h b/engines/mads/forest/rooms/section4.h
index 5f7fed54c21..b9b79fd8e67 100644
--- a/engines/mads/forest/rooms/section4.h
+++ b/engines/mads/forest/rooms/section4.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -33,7 +32,6 @@ extern void section_4_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/section5.cpp b/engines/mads/forest/rooms/section5.cpp
index c002ddd0b83..46be896da83 100644
--- a/engines/mads/forest/rooms/section5.cpp
+++ b/engines/mads/forest/rooms/section5.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/mads/sounds.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -89,5 +88,4 @@ void section_5_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section5.h b/engines/mads/forest/rooms/section5.h
index b1ac0c583b5..3432dd3a891 100644
--- a/engines/mads/forest/rooms/section5.h
+++ b/engines/mads/forest/rooms/section5.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -33,7 +32,6 @@ extern void section_5_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/forest/rooms/section9.cpp b/engines/mads/forest/rooms/section9.cpp
index 6d9eb013a4e..d8fa48ac0c9 100644
--- a/engines/mads/forest/rooms/section9.cpp
+++ b/engines/mads/forest/rooms/section9.cpp
@@ -32,7 +32,6 @@
 #include "mads/forest/forest.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -101,5 +100,4 @@ void section_9_preload() {
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/forest/rooms/section9.h b/engines/mads/forest/rooms/section9.h
index 66cd962f068..8384311a40a 100644
--- a/engines/mads/forest/rooms/section9.h
+++ b/engines/mads/forest/rooms/section9.h
@@ -25,7 +25,6 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Forest {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_9_music();
 
 } // namespace Rooms
 } // namespace Forest
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index b591b1ea824..ada76f9b170 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -43,12 +43,6 @@ enum MADSDebugChannels {
 	kDebugConversations
 };
 
-enum ScreenFade {
-	SCREEN_FADE_SMOOTH = 0,
-	SCREEN_FADE_MEDIUM = 1,
-	SCREEN_FADE_FAST = 2
-};
-
 enum MADSActions {
 	kActionNone,
 	kActionEscape,
diff --git a/engines/mads/metaengine.cpp b/engines/mads/metaengine.cpp
index 3f5fcee36b2..76127226a36 100644
--- a/engines/mads/metaengine.cpp
+++ b/engines/mads/metaengine.cpp
@@ -200,13 +200,13 @@ bool MADS::MADSEngine::hasFeature(EngineFeature f) const {
 
 Common::Error MADSMetaEngine::createInstance(OSystem *syst, Engine **engine, const MADS::MADSGameDescription *desc) const {
 	if (desc->gameID == MADS::GType_RexNebular)
-		*engine = new MADS::MADSV2::RexNebular::RexNebularEngine(syst, desc);
+		*engine = new MADS::RexNebular::RexNebularEngine(syst, desc);
 	else if (desc->gameID == MADS::GType_Phantom)
-		*engine = new MADS::MADSV2::Phantom::PhantomEngine(syst, desc);
+		*engine = new MADS::Phantom::PhantomEngine(syst, desc);
 	else if (desc->gameID == MADS::GType_Forest)
-		*engine = new MADS::MADSV2::Forest::ForestEngine(syst, desc);
+		*engine = new MADS::Forest::ForestEngine(syst, desc);
 	else if (desc->gameID == MADS::GType_Dragonsphere)
-		*engine = new MADS::MADSV2::Dragonsphere::DragonsphereEngine(syst, desc);
+		*engine = new MADS::Dragonsphere::DragonsphereEngine(syst, desc);
 	else
 		error("Unsupported game specified");
 
diff --git a/engines/mads/nebular/asound.cpp b/engines/mads/nebular/asound.cpp
index cb1df8bafb6..3a8825ee158 100644
--- a/engines/mads/nebular/asound.cpp
+++ b/engines/mads/nebular/asound.cpp
@@ -24,7 +24,6 @@
 #include "mads/nebular/asound.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 bool AdlibChannel::_channelsEnabled;
@@ -736,5 +735,4 @@ int ASound::command8() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/asound.h b/engines/mads/nebular/asound.h
index 04bf47f3555..e90b6c8f229 100644
--- a/engines/mads/nebular/asound.h
+++ b/engines/mads/nebular/asound.h
@@ -25,7 +25,6 @@
 #include "mads/core/sound_manager.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 class ASound;
@@ -381,7 +380,6 @@ public:
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/console.cpp b/engines/mads/nebular/console.cpp
index ac43ac13172..787beb85ef1 100644
--- a/engines/mads/nebular/console.cpp
+++ b/engines/mads/nebular/console.cpp
@@ -30,10 +30,9 @@
 #include "mads/core/player.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
-Console::Console() : MADS::MADSV2::Console() {
+Console::Console() : MADS::Console() {
 	registerCmd("load", WRAP_METHOD(Console, cmdLoad));
 }
 
@@ -186,5 +185,4 @@ bool Console::cmdLoad(int argc, const char **argv) {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/console.h b/engines/mads/nebular/console.h
index 9e4963a73cf..337ea16eae0 100644
--- a/engines/mads/nebular/console.h
+++ b/engines/mads/nebular/console.h
@@ -25,10 +25,9 @@
 #include "mads/console.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
-class Console : public MADS::MADSV2::Console {
+class Console : public MADS::Console {
 private:
 	bool cmdLoad(int argc, const char **argv);
 
@@ -39,7 +38,6 @@ public:
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/copy.cpp b/engines/mads/nebular/copy.cpp
index 543d5cf07ae..ef98fa42523 100644
--- a/engines/mads/nebular/copy.cpp
+++ b/engines/mads/nebular/copy.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/popup.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 #define COPY_TRIES_ALLOWED      2
@@ -217,5 +216,4 @@ int global_copy_verify() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/copy.h b/engines/mads/nebular/copy.h
index 7a409ff5671..8ad5ada1aed 100644
--- a/engines/mads/nebular/copy.h
+++ b/engines/mads/nebular/copy.h
@@ -25,13 +25,11 @@
 #include "mads/core/general.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 extern int global_copy_verify();
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/extra.cpp b/engines/mads/nebular/extra.cpp
index 5a14feed8e3..7e33c62baa7 100644
--- a/engines/mads/nebular/extra.cpp
+++ b/engines/mads/nebular/extra.cpp
@@ -31,7 +31,6 @@
 #include "mads/nebular/extra.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 #define REX_ROOM_MAX_SERIES 10
@@ -527,5 +526,4 @@ int buffer_legal(const Buffer &special, int orig_wrap,
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/extra.h b/engines/mads/nebular/extra.h
index 69317675633..2f45bdee869 100644
--- a/engines/mads/nebular/extra.h
+++ b/engines/mads/nebular/extra.h
@@ -25,7 +25,6 @@
 #include "mads/core/room.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 /**
@@ -66,7 +65,6 @@ extern int room_load_variant(Load *load_handle, Buffer *depth, Buffer *walk, Buf
 extern int buffer_legal(const Buffer &special, int orig_wrap, int x1, int y1, int x2, int y2);
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/global.cpp b/engines/mads/nebular/global.cpp
index 7f20302b262..1077c202ee1 100644
--- a/engines/mads/nebular/global.cpp
+++ b/engines/mads/nebular/global.cpp
@@ -32,7 +32,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -477,5 +476,4 @@ void sync_room(Common::Serializer &s) {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/global.h b/engines/mads/nebular/global.h
index fd1b7b62a3e..3eea86078e2 100644
--- a/engines/mads/nebular/global.h
+++ b/engines/mads/nebular/global.h
@@ -26,7 +26,6 @@
 #include "mads/core/vocabh.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum GlobalId {
@@ -329,7 +328,6 @@ extern void global_section_constructor();
 extern void sync_room(Common::Serializer &s);
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/mads/inventory.h b/engines/mads/nebular/mads/inventory.h
index 88a2abe530d..a35bf14e6ee 100644
--- a/engines/mads/nebular/mads/inventory.h
+++ b/engines/mads/nebular/mads/inventory.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum {
@@ -87,7 +86,6 @@ enum {
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/mads/quotes.h b/engines/mads/nebular/mads/quotes.h
index fedc9cc2dd9..97571d3436d 100644
--- a/engines/mads/nebular/mads/quotes.h
+++ b/engines/mads/nebular/mads/quotes.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum {
@@ -71,7 +70,6 @@ enum {
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/mads/sounds.h b/engines/mads/nebular/mads/sounds.h
index eac50d720f0..c0295ce74c7 100644
--- a/engines/mads/nebular/mads/sounds.h
+++ b/engines/mads/nebular/mads/sounds.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum {
@@ -40,7 +39,6 @@ enum {
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/mads/words.h b/engines/mads/nebular/mads/words.h
index 35464e50b30..e0f27e9b255 100644
--- a/engines/mads/nebular/mads/words.h
+++ b/engines/mads/nebular/mads/words.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum {
@@ -1232,7 +1231,6 @@ enum {
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/main.cpp b/engines/mads/nebular/main.cpp
index 1cd36408bbb..019eb62cf78 100644
--- a/engines/mads/nebular/main.cpp
+++ b/engines/mads/nebular/main.cpp
@@ -49,7 +49,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 constexpr bool SHOW_LINES = true;
@@ -394,5 +393,4 @@ void nebular_main() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/main.h b/engines/mads/nebular/main.h
index dae4bde91be..efe055c8f33 100644
--- a/engines/mads/nebular/main.h
+++ b/engines/mads/nebular/main.h
@@ -25,13 +25,11 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 extern void nebular_main();
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/main_menu.cpp b/engines/mads/nebular/main_menu.cpp
index 0e35b8181b2..a32fefa8e55 100644
--- a/engines/mads/nebular/main_menu.cpp
+++ b/engines/mads/nebular/main_menu.cpp
@@ -40,7 +40,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 #define CONFIG_FILE_NAME "CONFIG.REX"
@@ -444,5 +443,4 @@ void menu_control() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/main_menu.h b/engines/mads/nebular/main_menu.h
index 587f0db14f1..ca71cd25cae 100644
--- a/engines/mads/nebular/main_menu.h
+++ b/engines/mads/nebular/main_menu.h
@@ -25,7 +25,6 @@
 #include "common/str.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 #define COMMAND_LINE_MAX        10
@@ -53,7 +52,6 @@ extern int selected_item;
 extern void menu_control();
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/menus.cpp b/engines/mads/nebular/menus.cpp
index 2ce5d259353..4cd03a0a306 100644
--- a/engines/mads/nebular/menus.cpp
+++ b/engines/mads/nebular/menus.cpp
@@ -44,7 +44,6 @@
 #include "mads/nebular/nebular.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 #define MENU_MESSAGE_COLOR_BASE       10    /* 1st color to use for messages          */
@@ -143,7 +142,7 @@ static void choose_menu_background() {
 static void game_menu_setup() {
 	Palette specialPal;
 
-	MADS::MADSV2::game_menu_setup();
+	MADS::game_menu_setup();
 
 	menu = (MenuMessage *)malloc(MAX_MENU_MESSAGE * sizeof(MenuMessage));
 
@@ -233,7 +232,7 @@ static void game_menu_setup() {
 }
 
 static void game_menu_shutdown() {
-	MADS::MADSV2::game_menu_shutdown();
+	MADS::game_menu_shutdown();
 
 	viewing_at_y = 0;
 
@@ -1796,5 +1795,4 @@ void global_game_menu() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/menus.h b/engines/mads/nebular/menus.h
index 364b0d06165..e0dfeb2b94d 100644
--- a/engines/mads/nebular/menus.h
+++ b/engines/mads/nebular/menus.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 extern void global_menu_system_init();
@@ -34,7 +33,6 @@ extern void global_emergency_save();
 extern void global_game_menu();
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/nebular.cpp b/engines/mads/nebular/nebular.cpp
index c3af287b055..8e433fffe92 100644
--- a/engines/mads/nebular/nebular.cpp
+++ b/engines/mads/nebular/nebular.cpp
@@ -55,7 +55,6 @@
 #include "mads/nebular/rooms/section8.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 RexNebularEngine::RexNebularEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
@@ -665,5 +664,4 @@ void RexNebularEngine::global_sound_driver() {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/nebular.h b/engines/mads/nebular/nebular.h
index b518f15db6f..37af6d48cb3 100644
--- a/engines/mads/nebular/nebular.h
+++ b/engines/mads/nebular/nebular.h
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 struct MADSSavegameHeader {
@@ -65,7 +64,6 @@ public:
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/popup.cpp b/engines/mads/nebular/popup.cpp
index 2dc62cbdb85..10f0f383bd3 100644
--- a/engines/mads/nebular/popup.cpp
+++ b/engines/mads/nebular/popup.cpp
@@ -33,7 +33,6 @@
 #include "mads/nebular/popup.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 enum {
@@ -194,5 +193,4 @@ void popup_update_ask(const char *string, int maxlen) {
 }
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/popup.h b/engines/mads/nebular/popup.h
index b0781e5a990..5d35612617c 100644
--- a/engines/mads/nebular/popup.h
+++ b/engines/mads/nebular/popup.h
@@ -26,7 +26,6 @@
 #include "mads/core/popup.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 extern void popup_init();
@@ -35,7 +34,6 @@ extern void popup_setup_cycle();
 extern void popup_update_ask(const char *string, int maxlen);
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/dialog.cpp b/engines/mads/nebular/rooms/dialog.cpp
index a96e875f453..f0e37568a00 100644
--- a/engines/mads/nebular/rooms/dialog.cpp
+++ b/engines/mads/nebular/rooms/dialog.cpp
@@ -26,7 +26,6 @@
 #include "mads/nebular/rooms/dialog.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -125,5 +124,4 @@ void Dialog::start() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/dialog.h b/engines/mads/nebular/rooms/dialog.h
index 9caf77264dd..93dd11b0699 100644
--- a/engines/mads/nebular/rooms/dialog.h
+++ b/engines/mads/nebular/rooms/dialog.h
@@ -25,7 +25,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -66,7 +65,6 @@ public:
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/forcefield.cpp b/engines/mads/nebular/rooms/forcefield.cpp
index 6f8095e628d..33cc5446210 100644
--- a/engines/mads/nebular/rooms/forcefield.cpp
+++ b/engines/mads/nebular/rooms/forcefield.cpp
@@ -24,7 +24,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -132,5 +131,4 @@ void handle_forcefield(Forcefield *force, int16 *sprites) {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/forcefield.h b/engines/mads/nebular/rooms/forcefield.h
index 4d9a1e7e880..00c102121a5 100644
--- a/engines/mads/nebular/rooms/forcefield.h
+++ b/engines/mads/nebular/rooms/forcefield.h
@@ -25,7 +25,6 @@
 #include "common/serializer.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -59,7 +58,6 @@ extern void handle_forcefield(Forcefield *force, int16 *sprites);
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/room101.cpp b/engines/mads/nebular/rooms/room101.cpp
index 2cbbbcd7ee2..ec4549d4aa1 100644
--- a/engines/mads/nebular/rooms/room101.cpp
+++ b/engines/mads/nebular/rooms/room101.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -583,5 +582,4 @@ void room_101_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room102.cpp b/engines/mads/nebular/rooms/room102.cpp
index 8d1cc4884a0..ce1d452127f 100644
--- a/engines/mads/nebular/rooms/room102.cpp
+++ b/engines/mads/nebular/rooms/room102.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -675,5 +674,4 @@ void room_102_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room103.cpp b/engines/mads/nebular/rooms/room103.cpp
index 2fee9e0a9d9..2c032e5f532 100644
--- a/engines/mads/nebular/rooms/room103.cpp
+++ b/engines/mads/nebular/rooms/room103.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -372,5 +371,4 @@ void room_103_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room104.cpp b/engines/mads/nebular/rooms/room104.cpp
index 2f21585ad4e..06d05d0b45b 100644
--- a/engines/mads/nebular/rooms/room104.cpp
+++ b/engines/mads/nebular/rooms/room104.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -254,5 +253,4 @@ void room_104_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room105.cpp b/engines/mads/nebular/rooms/room105.cpp
index f788a11e637..e1766e06647 100644
--- a/engines/mads/nebular/rooms/room105.cpp
+++ b/engines/mads/nebular/rooms/room105.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -199,5 +198,4 @@ void room_105_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room106.cpp b/engines/mads/nebular/rooms/room106.cpp
index 36d8be28e09..a7cc83f5898 100644
--- a/engines/mads/nebular/rooms/room106.cpp
+++ b/engines/mads/nebular/rooms/room106.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -262,5 +261,4 @@ void room_106_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room107.cpp b/engines/mads/nebular/rooms/room107.cpp
index 42bb5cd1be1..eef0836edec 100644
--- a/engines/mads/nebular/rooms/room107.cpp
+++ b/engines/mads/nebular/rooms/room107.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -159,5 +158,4 @@ void room_107_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room108.cpp b/engines/mads/nebular/rooms/room108.cpp
index 3aae7628952..77d31950899 100644
--- a/engines/mads/nebular/rooms/room108.cpp
+++ b/engines/mads/nebular/rooms/room108.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -133,5 +132,4 @@ void room_108_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room109.cpp b/engines/mads/nebular/rooms/room109.cpp
index 03d7243afec..0ea040a8c87 100644
--- a/engines/mads/nebular/rooms/room109.cpp
+++ b/engines/mads/nebular/rooms/room109.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -471,5 +470,4 @@ void room_109_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room110.cpp b/engines/mads/nebular/rooms/room110.cpp
index d42bd8fa318..6d00b33f8b3 100644
--- a/engines/mads/nebular/rooms/room110.cpp
+++ b/engines/mads/nebular/rooms/room110.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -172,5 +171,4 @@ void room_110_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room111.cpp b/engines/mads/nebular/rooms/room111.cpp
index 0de2349dc64..83e2f02c25a 100644
--- a/engines/mads/nebular/rooms/room111.cpp
+++ b/engines/mads/nebular/rooms/room111.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -198,5 +197,4 @@ void room_111_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room112.cpp b/engines/mads/nebular/rooms/room112.cpp
index e42810c4e6d..dc678a665e5 100644
--- a/engines/mads/nebular/rooms/room112.cpp
+++ b/engines/mads/nebular/rooms/room112.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -88,5 +87,4 @@ void room_112_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room201.cpp b/engines/mads/nebular/rooms/room201.cpp
index a56ff66aace..a67649c18d0 100644
--- a/engines/mads/nebular/rooms/room201.cpp
+++ b/engines/mads/nebular/rooms/room201.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -258,5 +257,4 @@ void room_201_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room202.cpp b/engines/mads/nebular/rooms/room202.cpp
index 9a552eebc8e..212523c3905 100644
--- a/engines/mads/nebular/rooms/room202.cpp
+++ b/engines/mads/nebular/rooms/room202.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -729,5 +728,4 @@ void room_202_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room203.cpp b/engines/mads/nebular/rooms/room203.cpp
index 6877be4f9c8..337b5aa0938 100644
--- a/engines/mads/nebular/rooms/room203.cpp
+++ b/engines/mads/nebular/rooms/room203.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -162,5 +161,4 @@ void room_203_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room205.cpp b/engines/mads/nebular/rooms/room205.cpp
index c36063126fd..da0bb9e048c 100644
--- a/engines/mads/nebular/rooms/room205.cpp
+++ b/engines/mads/nebular/rooms/room205.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -341,5 +340,4 @@ void room_205_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room207.cpp b/engines/mads/nebular/rooms/room207.cpp
index eea72dea824..6001b0b2638 100644
--- a/engines/mads/nebular/rooms/room207.cpp
+++ b/engines/mads/nebular/rooms/room207.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -254,5 +253,4 @@ void room_207_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room208.cpp b/engines/mads/nebular/rooms/room208.cpp
index 82e8dec8eeb..a3d93721cf4 100644
--- a/engines/mads/nebular/rooms/room208.cpp
+++ b/engines/mads/nebular/rooms/room208.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -351,5 +350,4 @@ void room_208_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room209.cpp b/engines/mads/nebular/rooms/room209.cpp
index b4d525c161a..d676addcaf5 100644
--- a/engines/mads/nebular/rooms/room209.cpp
+++ b/engines/mads/nebular/rooms/room209.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -1794,5 +1793,4 @@ void room_209_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room210.cpp b/engines/mads/nebular/rooms/room210.cpp
index b8c29ccd76c..171ec2a4d3c 100644
--- a/engines/mads/nebular/rooms/room210.cpp
+++ b/engines/mads/nebular/rooms/room210.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -1109,5 +1108,4 @@ void room_210_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room211.cpp b/engines/mads/nebular/rooms/room211.cpp
index bbd6ec8955f..f7b25b91969 100644
--- a/engines/mads/nebular/rooms/room211.cpp
+++ b/engines/mads/nebular/rooms/room211.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -343,5 +342,4 @@ void room_211_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room212.cpp b/engines/mads/nebular/rooms/room212.cpp
index 7d39a8f35d8..39072fce165 100644
--- a/engines/mads/nebular/rooms/room212.cpp
+++ b/engines/mads/nebular/rooms/room212.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -99,5 +98,4 @@ void room_212_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room213.cpp b/engines/mads/nebular/rooms/room213.cpp
index 75497d277fa..d7004aab085 100644
--- a/engines/mads/nebular/rooms/room213.cpp
+++ b/engines/mads/nebular/rooms/room213.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -95,5 +94,4 @@ void room_213_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room214.cpp b/engines/mads/nebular/rooms/room214.cpp
index b1d08d84222..79c9b538021 100644
--- a/engines/mads/nebular/rooms/room214.cpp
+++ b/engines/mads/nebular/rooms/room214.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -263,5 +262,4 @@ void room_214_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room215.cpp b/engines/mads/nebular/rooms/room215.cpp
index a6c47865693..464107a51b7 100644
--- a/engines/mads/nebular/rooms/room215.cpp
+++ b/engines/mads/nebular/rooms/room215.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -164,5 +163,4 @@ void room_215_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room216.cpp b/engines/mads/nebular/rooms/room216.cpp
index 8ef5c8962c6..eea4316b663 100644
--- a/engines/mads/nebular/rooms/room216.cpp
+++ b/engines/mads/nebular/rooms/room216.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -62,5 +61,4 @@ void room_216_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room301.cpp b/engines/mads/nebular/rooms/room301.cpp
index 8c6743ab6ad..cd69b180078 100644
--- a/engines/mads/nebular/rooms/room301.cpp
+++ b/engines/mads/nebular/rooms/room301.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -65,5 +64,4 @@ void room_301_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room302.cpp b/engines/mads/nebular/rooms/room302.cpp
index 6cd7c2b1514..03e0aeee41e 100644
--- a/engines/mads/nebular/rooms/room302.cpp
+++ b/engines/mads/nebular/rooms/room302.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -84,5 +83,4 @@ void room_302_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room303.cpp b/engines/mads/nebular/rooms/room303.cpp
index a46cdc531b3..9190115fbc9 100644
--- a/engines/mads/nebular/rooms/room303.cpp
+++ b/engines/mads/nebular/rooms/room303.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -66,5 +65,4 @@ void room_303_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room304.cpp b/engines/mads/nebular/rooms/room304.cpp
index b39c75d9067..52a6a0b8e3d 100644
--- a/engines/mads/nebular/rooms/room304.cpp
+++ b/engines/mads/nebular/rooms/room304.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -174,5 +173,4 @@ void room_304_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room307.cpp b/engines/mads/nebular/rooms/room307.cpp
index 88de821d9cf..e0f5ac1119c 100644
--- a/engines/mads/nebular/rooms/room307.cpp
+++ b/engines/mads/nebular/rooms/room307.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/rooms/dialog.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -777,5 +776,4 @@ void room_307_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room308.cpp b/engines/mads/nebular/rooms/room308.cpp
index 0a4564c07ac..f1337515ced 100644
--- a/engines/mads/nebular/rooms/room308.cpp
+++ b/engines/mads/nebular/rooms/room308.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -178,5 +177,4 @@ void room_308_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room309.cpp b/engines/mads/nebular/rooms/room309.cpp
index d69597271bf..abdff05f604 100644
--- a/engines/mads/nebular/rooms/room309.cpp
+++ b/engines/mads/nebular/rooms/room309.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -255,5 +254,4 @@ void room_309_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room310.cpp b/engines/mads/nebular/rooms/room310.cpp
index 689cdc09607..0abdbd8af0e 100644
--- a/engines/mads/nebular/rooms/room310.cpp
+++ b/engines/mads/nebular/rooms/room310.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -81,5 +80,4 @@ void room_310_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room311.cpp b/engines/mads/nebular/rooms/room311.cpp
index 4f90eeec65e..cfd450e2802 100644
--- a/engines/mads/nebular/rooms/room311.cpp
+++ b/engines/mads/nebular/rooms/room311.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -340,5 +339,4 @@ void room_311_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room313.cpp b/engines/mads/nebular/rooms/room313.cpp
index 53f5a90a071..d444cf24adf 100644
--- a/engines/mads/nebular/rooms/room313.cpp
+++ b/engines/mads/nebular/rooms/room313.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -113,5 +112,4 @@ void room_313_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room316.cpp b/engines/mads/nebular/rooms/room316.cpp
index 778666e48e6..13aae897412 100644
--- a/engines/mads/nebular/rooms/room316.cpp
+++ b/engines/mads/nebular/rooms/room316.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -507,5 +506,4 @@ void room_316_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room318.cpp b/engines/mads/nebular/rooms/room318.cpp
index a52e2ad19fb..aa2f559359b 100644
--- a/engines/mads/nebular/rooms/room318.cpp
+++ b/engines/mads/nebular/rooms/room318.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/dialog.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -678,5 +677,4 @@ void room_318_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room319.cpp b/engines/mads/nebular/rooms/room319.cpp
index 2a902be2064..9762d3881dd 100644
--- a/engines/mads/nebular/rooms/room319.cpp
+++ b/engines/mads/nebular/rooms/room319.cpp
@@ -31,7 +31,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -550,5 +549,4 @@ void room_319_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room320.cpp b/engines/mads/nebular/rooms/room320.cpp
index 9a65a092e66..0cfc5c3a63d 100644
--- a/engines/mads/nebular/rooms/room320.cpp
+++ b/engines/mads/nebular/rooms/room320.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -369,5 +368,4 @@ void room_320_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room321.cpp b/engines/mads/nebular/rooms/room321.cpp
index 064a42f55ce..ef325be0564 100644
--- a/engines/mads/nebular/rooms/room321.cpp
+++ b/engines/mads/nebular/rooms/room321.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -76,5 +75,4 @@ void room_321_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room322.cpp b/engines/mads/nebular/rooms/room322.cpp
index 2075affe302..080bc4f5fa4 100644
--- a/engines/mads/nebular/rooms/room322.cpp
+++ b/engines/mads/nebular/rooms/room322.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -101,5 +100,4 @@ void room_322_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room351.cpp b/engines/mads/nebular/rooms/room351.cpp
index b62a72ba264..39fa7e35637 100644
--- a/engines/mads/nebular/rooms/room351.cpp
+++ b/engines/mads/nebular/rooms/room351.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -204,5 +203,4 @@ void room_351_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room352.cpp b/engines/mads/nebular/rooms/room352.cpp
index 2342fe46c37..f6fe7036e41 100644
--- a/engines/mads/nebular/rooms/room352.cpp
+++ b/engines/mads/nebular/rooms/room352.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -616,5 +615,4 @@ void room_352_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room353.cpp b/engines/mads/nebular/rooms/room353.cpp
index d652f2f3af0..fc7c8469cf7 100644
--- a/engines/mads/nebular/rooms/room353.cpp
+++ b/engines/mads/nebular/rooms/room353.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -95,5 +94,4 @@ void room_353_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room354.cpp b/engines/mads/nebular/rooms/room354.cpp
index 7add5fdfb8c..f9817bfad22 100644
--- a/engines/mads/nebular/rooms/room354.cpp
+++ b/engines/mads/nebular/rooms/room354.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -113,5 +112,4 @@ void room_354_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room357.cpp b/engines/mads/nebular/rooms/room357.cpp
index 970d7f4a405..79ddc0686b1 100644
--- a/engines/mads/nebular/rooms/room357.cpp
+++ b/engines/mads/nebular/rooms/room357.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -107,5 +106,4 @@ void room_357_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room358.cpp b/engines/mads/nebular/rooms/room358.cpp
index ef7b2ad5a99..271ad38fb7f 100644
--- a/engines/mads/nebular/rooms/room358.cpp
+++ b/engines/mads/nebular/rooms/room358.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -92,5 +91,4 @@ void room_358_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room359.cpp b/engines/mads/nebular/rooms/room359.cpp
index 6175f05f14f..81e00f2d619 100644
--- a/engines/mads/nebular/rooms/room359.cpp
+++ b/engines/mads/nebular/rooms/room359.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -184,5 +183,4 @@ void room_359_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room360.cpp b/engines/mads/nebular/rooms/room360.cpp
index 734da665248..9a4542cc5cf 100644
--- a/engines/mads/nebular/rooms/room360.cpp
+++ b/engines/mads/nebular/rooms/room360.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -94,5 +93,4 @@ void room_360_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room361.cpp b/engines/mads/nebular/rooms/room361.cpp
index 97171f95f4a..610d0561c10 100644
--- a/engines/mads/nebular/rooms/room361.cpp
+++ b/engines/mads/nebular/rooms/room361.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -435,5 +434,4 @@ void room_361_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room366.cpp b/engines/mads/nebular/rooms/room366.cpp
index 0aaeb002776..a7cd8a6ae52 100644
--- a/engines/mads/nebular/rooms/room366.cpp
+++ b/engines/mads/nebular/rooms/room366.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -74,5 +73,4 @@ void room_366_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room387.cpp b/engines/mads/nebular/rooms/room387.cpp
index 98d67f402a9..b851b4db872 100644
--- a/engines/mads/nebular/rooms/room387.cpp
+++ b/engines/mads/nebular/rooms/room387.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -67,5 +66,4 @@ void room_387_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room388.cpp b/engines/mads/nebular/rooms/room388.cpp
index 8f88cf8daf1..f2b3e75aee5 100644
--- a/engines/mads/nebular/rooms/room388.cpp
+++ b/engines/mads/nebular/rooms/room388.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -103,5 +102,4 @@ void room_388_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room389.cpp b/engines/mads/nebular/rooms/room389.cpp
index e82c422b08c..adfca5d713f 100644
--- a/engines/mads/nebular/rooms/room389.cpp
+++ b/engines/mads/nebular/rooms/room389.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -130,5 +129,4 @@ void room_389_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room390.cpp b/engines/mads/nebular/rooms/room390.cpp
index b87e0c7f317..9a8e02118a7 100644
--- a/engines/mads/nebular/rooms/room390.cpp
+++ b/engines/mads/nebular/rooms/room390.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -67,5 +66,4 @@ void room_390_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room391.cpp b/engines/mads/nebular/rooms/room391.cpp
index eacfa9ff20d..0e7b08600db 100644
--- a/engines/mads/nebular/rooms/room391.cpp
+++ b/engines/mads/nebular/rooms/room391.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -79,5 +78,4 @@ void room_391_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room399.cpp b/engines/mads/nebular/rooms/room399.cpp
index 251d9bed777..47e8a5ec506 100644
--- a/engines/mads/nebular/rooms/room399.cpp
+++ b/engines/mads/nebular/rooms/room399.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -75,5 +74,4 @@ void room_399_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room401.cpp b/engines/mads/nebular/rooms/room401.cpp
index 201e298062e..0022c4bd236 100644
--- a/engines/mads/nebular/rooms/room401.cpp
+++ b/engines/mads/nebular/rooms/room401.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -188,5 +187,4 @@ void room_401_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room402.cpp b/engines/mads/nebular/rooms/room402.cpp
index a002be7695d..775d0a4157e 100644
--- a/engines/mads/nebular/rooms/room402.cpp
+++ b/engines/mads/nebular/rooms/room402.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -2240,5 +2239,4 @@ void room_402_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room405.cpp b/engines/mads/nebular/rooms/room405.cpp
index a2d9150c0c0..8b9962628ce 100644
--- a/engines/mads/nebular/rooms/room405.cpp
+++ b/engines/mads/nebular/rooms/room405.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -210,5 +209,4 @@ void room_405_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room406.cpp b/engines/mads/nebular/rooms/room406.cpp
index 12adf0f8d16..df471253278 100644
--- a/engines/mads/nebular/rooms/room406.cpp
+++ b/engines/mads/nebular/rooms/room406.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -253,5 +252,4 @@ void room_406_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room407.cpp b/engines/mads/nebular/rooms/room407.cpp
index 6b757c97a38..2b19fe4c3b0 100644
--- a/engines/mads/nebular/rooms/room407.cpp
+++ b/engines/mads/nebular/rooms/room407.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -162,5 +161,4 @@ void room_407_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room408.cpp b/engines/mads/nebular/rooms/room408.cpp
index 87c83fe7789..cb147150a01 100644
--- a/engines/mads/nebular/rooms/room408.cpp
+++ b/engines/mads/nebular/rooms/room408.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -194,5 +193,4 @@ void room_408_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room409.cpp b/engines/mads/nebular/rooms/room409.cpp
index 28571005a99..02ad474197c 100644
--- a/engines/mads/nebular/rooms/room409.cpp
+++ b/engines/mads/nebular/rooms/room409.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -91,5 +90,4 @@ void room_409_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room410.cpp b/engines/mads/nebular/rooms/room410.cpp
index b58d22e84ad..7680fd8992e 100644
--- a/engines/mads/nebular/rooms/room410.cpp
+++ b/engines/mads/nebular/rooms/room410.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -203,5 +202,4 @@ void room_410_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room411.cpp b/engines/mads/nebular/rooms/room411.cpp
index caee2287208..d9fa724964f 100644
--- a/engines/mads/nebular/rooms/room411.cpp
+++ b/engines/mads/nebular/rooms/room411.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -815,5 +814,4 @@ void room_411_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room413.cpp b/engines/mads/nebular/rooms/room413.cpp
index f9221738bfb..1720bcef329 100644
--- a/engines/mads/nebular/rooms/room413.cpp
+++ b/engines/mads/nebular/rooms/room413.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -195,5 +194,4 @@ void room_413_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room501.cpp b/engines/mads/nebular/rooms/room501.cpp
index 01a9371a1d9..899e1795ad6 100644
--- a/engines/mads/nebular/rooms/room501.cpp
+++ b/engines/mads/nebular/rooms/room501.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -424,5 +423,4 @@ void room_501_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room502.cpp b/engines/mads/nebular/rooms/room502.cpp
index 150e97b484e..66a832c0dfa 100644
--- a/engines/mads/nebular/rooms/room502.cpp
+++ b/engines/mads/nebular/rooms/room502.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -98,5 +97,4 @@ void room_502_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room503.cpp b/engines/mads/nebular/rooms/room503.cpp
index 25b4012c22a..abe20f17d66 100644
--- a/engines/mads/nebular/rooms/room503.cpp
+++ b/engines/mads/nebular/rooms/room503.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -169,5 +168,4 @@ void room_503_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room504.cpp b/engines/mads/nebular/rooms/room504.cpp
index 3db1ecd2b04..90f4eb3857d 100644
--- a/engines/mads/nebular/rooms/room504.cpp
+++ b/engines/mads/nebular/rooms/room504.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -249,5 +248,4 @@ void room_504_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room505.cpp b/engines/mads/nebular/rooms/room505.cpp
index 72a1d8d1db7..4725dc6a346 100644
--- a/engines/mads/nebular/rooms/room505.cpp
+++ b/engines/mads/nebular/rooms/room505.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -317,5 +316,4 @@ void room_505_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room506.cpp b/engines/mads/nebular/rooms/room506.cpp
index 44a85493a86..f1c031c7162 100644
--- a/engines/mads/nebular/rooms/room506.cpp
+++ b/engines/mads/nebular/rooms/room506.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -345,5 +344,4 @@ void room_506_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room507.cpp b/engines/mads/nebular/rooms/room507.cpp
index 8487542e358..75a975e190b 100644
--- a/engines/mads/nebular/rooms/room507.cpp
+++ b/engines/mads/nebular/rooms/room507.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -161,5 +160,4 @@ void room_507_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room508.cpp b/engines/mads/nebular/rooms/room508.cpp
index 351e7355c87..df3a075e0fc 100644
--- a/engines/mads/nebular/rooms/room508.cpp
+++ b/engines/mads/nebular/rooms/room508.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -308,5 +307,4 @@ void room_508_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room511.cpp b/engines/mads/nebular/rooms/room511.cpp
index 7b41720a479..51a1c415145 100644
--- a/engines/mads/nebular/rooms/room511.cpp
+++ b/engines/mads/nebular/rooms/room511.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -383,5 +382,4 @@ void room_511_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room512.cpp b/engines/mads/nebular/rooms/room512.cpp
index f6f416e4ea3..ce0f01d1609 100644
--- a/engines/mads/nebular/rooms/room512.cpp
+++ b/engines/mads/nebular/rooms/room512.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -346,5 +345,4 @@ void room_512_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room513.cpp b/engines/mads/nebular/rooms/room513.cpp
index adca8481106..a9a1688ac6e 100644
--- a/engines/mads/nebular/rooms/room513.cpp
+++ b/engines/mads/nebular/rooms/room513.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -266,5 +265,4 @@ void room_513_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room515.cpp b/engines/mads/nebular/rooms/room515.cpp
index ff586845233..e7a15fead9b 100644
--- a/engines/mads/nebular/rooms/room515.cpp
+++ b/engines/mads/nebular/rooms/room515.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -62,5 +61,4 @@ void room_515_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room551.cpp b/engines/mads/nebular/rooms/room551.cpp
index 1e33ddf702c..721ed7949c8 100644
--- a/engines/mads/nebular/rooms/room551.cpp
+++ b/engines/mads/nebular/rooms/room551.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -182,5 +181,4 @@ void room_551_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room601.cpp b/engines/mads/nebular/rooms/room601.cpp
index 4bb371263b0..784415caad9 100644
--- a/engines/mads/nebular/rooms/room601.cpp
+++ b/engines/mads/nebular/rooms/room601.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -176,5 +175,4 @@ void room_601_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room602.cpp b/engines/mads/nebular/rooms/room602.cpp
index 676bf93fb60..5b9cdee905b 100644
--- a/engines/mads/nebular/rooms/room602.cpp
+++ b/engines/mads/nebular/rooms/room602.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -367,5 +366,4 @@ void room_602_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room603.cpp b/engines/mads/nebular/rooms/room603.cpp
index af27653a14d..868bd895823 100644
--- a/engines/mads/nebular/rooms/room603.cpp
+++ b/engines/mads/nebular/rooms/room603.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -189,5 +188,4 @@ void room_603_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room604.cpp b/engines/mads/nebular/rooms/room604.cpp
index 27afcb16ad2..d7d5ee8d818 100644
--- a/engines/mads/nebular/rooms/room604.cpp
+++ b/engines/mads/nebular/rooms/room604.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -334,5 +333,4 @@ void room_604_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room605.cpp b/engines/mads/nebular/rooms/room605.cpp
index 164955fc840..11aefc91a6a 100644
--- a/engines/mads/nebular/rooms/room605.cpp
+++ b/engines/mads/nebular/rooms/room605.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -81,5 +80,4 @@ void room_605_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room607.cpp b/engines/mads/nebular/rooms/room607.cpp
index 7f5c16c8ec0..664fb77f27e 100644
--- a/engines/mads/nebular/rooms/room607.cpp
+++ b/engines/mads/nebular/rooms/room607.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -505,5 +504,4 @@ void room_607_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room608.cpp b/engines/mads/nebular/rooms/room608.cpp
index 65eef09ec2a..ae2af30540f 100644
--- a/engines/mads/nebular/rooms/room608.cpp
+++ b/engines/mads/nebular/rooms/room608.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -1039,5 +1038,4 @@ void room_608_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room609.cpp b/engines/mads/nebular/rooms/room609.cpp
index 4398c830edf..b726b3a3511 100644
--- a/engines/mads/nebular/rooms/room609.cpp
+++ b/engines/mads/nebular/rooms/room609.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -373,5 +372,4 @@ void room_609_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room610.cpp b/engines/mads/nebular/rooms/room610.cpp
index 96de1ca02d5..f01c6af129e 100644
--- a/engines/mads/nebular/rooms/room610.cpp
+++ b/engines/mads/nebular/rooms/room610.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -240,5 +239,4 @@ void room_610_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room611.cpp b/engines/mads/nebular/rooms/room611.cpp
index 0a732b367bf..32b24221c58 100644
--- a/engines/mads/nebular/rooms/room611.cpp
+++ b/engines/mads/nebular/rooms/room611.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -1502,5 +1501,4 @@ void room_611_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room612.cpp b/engines/mads/nebular/rooms/room612.cpp
index 8bced97edec..fb405568660 100644
--- a/engines/mads/nebular/rooms/room612.cpp
+++ b/engines/mads/nebular/rooms/room612.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -261,5 +260,4 @@ void room_612_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room620.cpp b/engines/mads/nebular/rooms/room620.cpp
index c8e7d65203f..a4392bfdf79 100644
--- a/engines/mads/nebular/rooms/room620.cpp
+++ b/engines/mads/nebular/rooms/room620.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -91,5 +90,4 @@ void room_620_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room701.cpp b/engines/mads/nebular/rooms/room701.cpp
index 77894e4458a..e8d594f83f6 100644
--- a/engines/mads/nebular/rooms/room701.cpp
+++ b/engines/mads/nebular/rooms/room701.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -402,5 +401,4 @@ void room_701_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room702.cpp b/engines/mads/nebular/rooms/room702.cpp
index 5ee1bffc2ef..53ba9af4457 100644
--- a/engines/mads/nebular/rooms/room702.cpp
+++ b/engines/mads/nebular/rooms/room702.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -142,5 +141,4 @@ void room_702_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room703.cpp b/engines/mads/nebular/rooms/room703.cpp
index 5372e7c2b2b..4ad15f32c85 100644
--- a/engines/mads/nebular/rooms/room703.cpp
+++ b/engines/mads/nebular/rooms/room703.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -598,5 +597,4 @@ void room_703_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room704.cpp b/engines/mads/nebular/rooms/room704.cpp
index 483f3aa6726..8c9fb0e273b 100644
--- a/engines/mads/nebular/rooms/room704.cpp
+++ b/engines/mads/nebular/rooms/room704.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -397,5 +396,4 @@ void room_704_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room705.cpp b/engines/mads/nebular/rooms/room705.cpp
index 3e8474a31e9..5ba1bec02fb 100644
--- a/engines/mads/nebular/rooms/room705.cpp
+++ b/engines/mads/nebular/rooms/room705.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -316,5 +315,4 @@ void room_705_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room706.cpp b/engines/mads/nebular/rooms/room706.cpp
index 55b2e32e32e..81b60f3f12d 100644
--- a/engines/mads/nebular/rooms/room706.cpp
+++ b/engines/mads/nebular/rooms/room706.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -329,5 +328,4 @@ void room_706_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room707.cpp b/engines/mads/nebular/rooms/room707.cpp
index d9b696dc70e..6f784506604 100644
--- a/engines/mads/nebular/rooms/room707.cpp
+++ b/engines/mads/nebular/rooms/room707.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -91,5 +90,4 @@ void room_707_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room710.cpp b/engines/mads/nebular/rooms/room710.cpp
index 98c99b22ad8..ee7e5388739 100644
--- a/engines/mads/nebular/rooms/room710.cpp
+++ b/engines/mads/nebular/rooms/room710.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -83,5 +82,4 @@ void room_710_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room711.cpp b/engines/mads/nebular/rooms/room711.cpp
index fead94ca3cb..3058b6a609b 100644
--- a/engines/mads/nebular/rooms/room711.cpp
+++ b/engines/mads/nebular/rooms/room711.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -73,5 +72,4 @@ void room_711_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room751.cpp b/engines/mads/nebular/rooms/room751.cpp
index 613a55fe421..b3b2e7fc83f 100644
--- a/engines/mads/nebular/rooms/room751.cpp
+++ b/engines/mads/nebular/rooms/room751.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -376,5 +375,4 @@ void room_751_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room752.cpp b/engines/mads/nebular/rooms/room752.cpp
index 71adeed0c45..94ec316c068 100644
--- a/engines/mads/nebular/rooms/room752.cpp
+++ b/engines/mads/nebular/rooms/room752.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -217,5 +216,4 @@ void room_752_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room801.cpp b/engines/mads/nebular/rooms/room801.cpp
index 77a3c0cf05a..e9d4108ed11 100644
--- a/engines/mads/nebular/rooms/room801.cpp
+++ b/engines/mads/nebular/rooms/room801.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -272,5 +271,4 @@ void room_801_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room802.cpp b/engines/mads/nebular/rooms/room802.cpp
index e8b83ea9b8d..c1ded204857 100644
--- a/engines/mads/nebular/rooms/room802.cpp
+++ b/engines/mads/nebular/rooms/room802.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -249,5 +248,4 @@ void room_802_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room803.cpp b/engines/mads/nebular/rooms/room803.cpp
index 35ea0ac9ec5..05dfb25a1fc 100644
--- a/engines/mads/nebular/rooms/room803.cpp
+++ b/engines/mads/nebular/rooms/room803.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -358,5 +357,4 @@ void room_803_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room804.cpp b/engines/mads/nebular/rooms/room804.cpp
index 482226daf17..c30ed034519 100644
--- a/engines/mads/nebular/rooms/room804.cpp
+++ b/engines/mads/nebular/rooms/room804.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -395,5 +394,4 @@ void room_804_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room805.cpp b/engines/mads/nebular/rooms/room805.cpp
index 0f2b818d5c9..fe1dc631cfd 100644
--- a/engines/mads/nebular/rooms/room805.cpp
+++ b/engines/mads/nebular/rooms/room805.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -162,5 +161,4 @@ void room_805_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room807.cpp b/engines/mads/nebular/rooms/room807.cpp
index 012b8f182a1..1cf76274318 100644
--- a/engines/mads/nebular/rooms/room807.cpp
+++ b/engines/mads/nebular/rooms/room807.cpp
@@ -29,7 +29,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -91,5 +90,4 @@ void room_807_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room808.cpp b/engines/mads/nebular/rooms/room808.cpp
index 4337c3719e7..d1f61b9ad0a 100644
--- a/engines/mads/nebular/rooms/room808.cpp
+++ b/engines/mads/nebular/rooms/room808.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -252,5 +251,4 @@ void room_808_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/room810.cpp b/engines/mads/nebular/rooms/room810.cpp
index ce7f1e843f8..207107dc0a2 100644
--- a/engines/mads/nebular/rooms/room810.cpp
+++ b/engines/mads/nebular/rooms/room810.cpp
@@ -28,7 +28,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -74,5 +73,4 @@ void room_810_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section1.cpp b/engines/mads/nebular/rooms/section1.cpp
index 924d9e24768..54a2cd11b74 100644
--- a/engines/mads/nebular/rooms/section1.cpp
+++ b/engines/mads/nebular/rooms/section1.cpp
@@ -26,7 +26,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -175,5 +174,4 @@ void section_1_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section1.h b/engines/mads/nebular/rooms/section1.h
index 0024619209b..3408b48248e 100644
--- a/engines/mads/nebular/rooms/section1.h
+++ b/engines/mads/nebular/rooms/section1.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_1_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section2.cpp b/engines/mads/nebular/rooms/section2.cpp
index c81f5081aff..966695f98fa 100644
--- a/engines/mads/nebular/rooms/section2.cpp
+++ b/engines/mads/nebular/rooms/section2.cpp
@@ -23,7 +23,6 @@
 #include "mads/nebular/rooms/thunks.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -198,5 +197,4 @@ void section_2_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section2.h b/engines/mads/nebular/rooms/section2.h
index d97502fc67b..b4b38376e18 100644
--- a/engines/mads/nebular/rooms/section2.h
+++ b/engines/mads/nebular/rooms/section2.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_2_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section3.cpp b/engines/mads/nebular/rooms/section3.cpp
index 9cf7ecf905e..225484af618 100644
--- a/engines/mads/nebular/rooms/section3.cpp
+++ b/engines/mads/nebular/rooms/section3.cpp
@@ -30,7 +30,6 @@
 #include "mads/engine.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -228,5 +227,4 @@ void section_3_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section3.h b/engines/mads/nebular/rooms/section3.h
index 63573528b21..49c8a989531 100644
--- a/engines/mads/nebular/rooms/section3.h
+++ b/engines/mads/nebular/rooms/section3.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -36,7 +35,6 @@ extern void section_3_pre_parser();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section4.cpp b/engines/mads/nebular/rooms/section4.cpp
index e22550fc7f5..a3acc8e0eda 100644
--- a/engines/mads/nebular/rooms/section4.cpp
+++ b/engines/mads/nebular/rooms/section4.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -145,5 +144,4 @@ void section_4_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section4.h b/engines/mads/nebular/rooms/section4.h
index 17aa7751baa..6838d1efa20 100644
--- a/engines/mads/nebular/rooms/section4.h
+++ b/engines/mads/nebular/rooms/section4.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_4_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section5.cpp b/engines/mads/nebular/rooms/section5.cpp
index 325b7e4751f..92d473c7178 100644
--- a/engines/mads/nebular/rooms/section5.cpp
+++ b/engines/mads/nebular/rooms/section5.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -146,5 +145,4 @@ void section_5_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section5.h b/engines/mads/nebular/rooms/section5.h
index aff64b74fc2..56e8d74ff54 100644
--- a/engines/mads/nebular/rooms/section5.h
+++ b/engines/mads/nebular/rooms/section5.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_5_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section6.cpp b/engines/mads/nebular/rooms/section6.cpp
index f170226873f..5e717b33b0f 100644
--- a/engines/mads/nebular/rooms/section6.cpp
+++ b/engines/mads/nebular/rooms/section6.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -139,5 +138,4 @@ void section_6_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section6.h b/engines/mads/nebular/rooms/section6.h
index f4bf05a3219..b0c071fc421 100644
--- a/engines/mads/nebular/rooms/section6.h
+++ b/engines/mads/nebular/rooms/section6.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_6_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section7.cpp b/engines/mads/nebular/rooms/section7.cpp
index 1a4036cf4ce..23f3fb715e2 100644
--- a/engines/mads/nebular/rooms/section7.cpp
+++ b/engines/mads/nebular/rooms/section7.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -143,5 +142,4 @@ void section_7_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section7.h b/engines/mads/nebular/rooms/section7.h
index 34a37d66455..5de3b43754e 100644
--- a/engines/mads/nebular/rooms/section7.h
+++ b/engines/mads/nebular/rooms/section7.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_7_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/section8.cpp b/engines/mads/nebular/rooms/section8.cpp
index 80e2cd13b5b..e3ca3b74fe0 100644
--- a/engines/mads/nebular/rooms/section8.cpp
+++ b/engines/mads/nebular/rooms/section8.cpp
@@ -30,7 +30,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -128,5 +127,4 @@ void section_8_preload() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/section8.h b/engines/mads/nebular/rooms/section8.h
index 0cfef45e90d..c4f589fe57b 100644
--- a/engines/mads/nebular/rooms/section8.h
+++ b/engines/mads/nebular/rooms/section8.h
@@ -25,7 +25,6 @@
 #include "common/scummsys.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -35,7 +34,6 @@ extern void section_8_music();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/teleporter.cpp b/engines/mads/nebular/rooms/teleporter.cpp
index 33d96acc91a..1730f7246d3 100644
--- a/engines/mads/nebular/rooms/teleporter.cpp
+++ b/engines/mads/nebular/rooms/teleporter.cpp
@@ -25,7 +25,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -322,5 +321,4 @@ void teleporter_daemon() {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/teleporter.h b/engines/mads/nebular/rooms/teleporter.h
index 88c1a5bc17e..86997794ece 100644
--- a/engines/mads/nebular/rooms/teleporter.h
+++ b/engines/mads/nebular/rooms/teleporter.h
@@ -25,7 +25,6 @@
 #include "common/rect.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -38,7 +37,6 @@ extern void teleporter_daemon();
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/rooms/thunks.cpp b/engines/mads/nebular/rooms/thunks.cpp
index b9fd6412529..9f6286ad66e 100644
--- a/engines/mads/nebular/rooms/thunks.cpp
+++ b/engines/mads/nebular/rooms/thunks.cpp
@@ -35,7 +35,6 @@
 #include "mads/nebular/nebular.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -497,5 +496,4 @@ char *formAnimName(char type, int num) {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/rooms/thunks.h b/engines/mads/nebular/rooms/thunks.h
index 9a958f66f5b..6e6d3b0fa21 100644
--- a/engines/mads/nebular/rooms/thunks.h
+++ b/engines/mads/nebular/rooms/thunks.h
@@ -35,7 +35,6 @@
 #include "mads/nebular/global.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 namespace Rooms {
 
@@ -682,7 +681,6 @@ enum {
 
 } // namespace Rooms
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif /* MADS_NEBULAR_SCENES8_H */
diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp
index 485deb03fcb..a9e4056820d 100644
--- a/engines/mads/nebular/sound_nebular.cpp
+++ b/engines/mads/nebular/sound_nebular.cpp
@@ -30,7 +30,6 @@ class Mixer;
 }
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 void RexSoundManager::validate() {
@@ -2767,5 +2766,4 @@ int ASound9::command51() {
 
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h
index c958419d541..50792d67cc5 100644
--- a/engines/mads/nebular/sound_nebular.h
+++ b/engines/mads/nebular/sound_nebular.h
@@ -25,7 +25,6 @@
 #include "mads/nebular/asound.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace RexNebular {
 
 class RexSoundManager : public SoundManager {
@@ -458,7 +457,6 @@ public:
 };
 
 } // namespace RexNebular
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/phantom/asound.cpp b/engines/mads/phantom/asound.cpp
index 7e587fcd4ee..964c92b90b4 100644
--- a/engines/mads/phantom/asound.cpp
+++ b/engines/mads/phantom/asound.cpp
@@ -23,7 +23,6 @@
 #include "mads/phantom/asound.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Phantom {
 
 bool AdlibChannel::_isDisabled;
@@ -1892,5 +1891,4 @@ uint16 ASound::readWord_impl() {
 }
 
 } // namespace Phantom
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/phantom/asound.h b/engines/mads/phantom/asound.h
index 726dd7c9d50..e93798dd274 100644
--- a/engines/mads/phantom/asound.h
+++ b/engines/mads/phantom/asound.h
@@ -28,7 +28,6 @@
 #include "mads/core/sound_manager.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Phantom {
 
 #define ADLIB_CHANNEL_COUNT 9
@@ -471,7 +470,6 @@ public:
 };
 
 } // namespace Phantom
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/phantom/catacombs.cpp b/engines/mads/phantom/catacombs.cpp
index 5b278c8d532..df41dce37ff 100644
--- a/engines/mads/phantom/catacombs.cpp
+++ b/engines/mads/phantom/catacombs.cpp
@@ -26,7 +26,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Phantom {
 
 /* Fun stuff for the catacombs */
@@ -276,5 +275,4 @@ void global_catacombs_move(int exit) {
 }
 
 } // namespace Phantom
-} // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/phantom/catacombs.h b/engines/mads/phantom/catacombs.h
index 82ced1cee52..b82d85927c7 100644
--- a/engines/mads/phantom/catacombs.h
+++ b/engines/mads/phantom/catacombs.h
@@ -25,7 +25,6 @@
 #include "mads/core/vocabh.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Phantom {
 
 constexpr int NORTH = 0;
@@ -53,7 +52,6 @@ extern int global_catacombs_exit(int exit);
 extern void global_catacombs_move(int exit);
 
 } // namespace Phantom
-} // namespace MADSV2
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/phantom/global.cpp b/engines/mads/phantom/global.cpp
index ca2fc6c0b57..e1678e5b610 100644
--- a/engines/mads/phantom/global.cpp
+++ b/engines/mads/phantom/global.cpp
@@ -25,7 +25,6 @@
 #include "mads/core/error.h"
 
 namespace MADS {
-namespace MADSV2 {
 namespace Phantom {
 
 namespace Rooms {
@@ -285,5 +284,4 @@ void sync_room(Common::Serializer &s) {




More information about the Scummvm-git-logs mailing list