[Scummvm-git-logs] scummvm master -> f1a8e67906e5343c3ff489454b0bd056ddbda180

dreammaster noreply at scummvm.org
Tue Jul 21 12:09:17 UTC 2026


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

Summary:
f1a8e67906 MADS: Merge MADSEngine and MADSV2Engine


Commit: f1a8e67906e5343c3ff489454b0bd056ddbda180
    https://github.com/scummvm/scummvm/commit/f1a8e67906e5343c3ff489454b0bd056ddbda180
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-21T22:09:02+10:00

Commit Message:
MADS: Merge MADSEngine and MADSV2Engine

Changed paths:
  R engines/mads/engine.cpp
  R engines/mads/engine.h
    engines/mads/animview/anim_timer.cpp
    engines/mads/animview/animview.cpp
    engines/mads/core/config.cpp
    engines/mads/core/conv.cpp
    engines/mads/core/echo.h
    engines/mads/core/game.cpp
    engines/mads/core/global.cpp
    engines/mads/core/imath.cpp
    engines/mads/core/inter.cpp
    engines/mads/core/keys.cpp
    engines/mads/core/magic.cpp
    engines/mads/core/matte.cpp
    engines/mads/core/mcga.cpp
    engines/mads/core/mouse.cpp
    engines/mads/core/object.cpp
    engines/mads/core/pal.cpp
    engines/mads/core/player.cpp
    engines/mads/core/popup.cpp
    engines/mads/core/room.cpp
    engines/mads/core/sound.cpp
    engines/mads/core/speech.cpp
    engines/mads/core/text.cpp
    engines/mads/core/timer.cpp
    engines/mads/core/video.cpp
    engines/mads/dragonsphere/dragonsphere.h
    engines/mads/dragonsphere/main.cpp
    engines/mads/dragonsphere/main_menu.cpp
    engines/mads/dragonsphere/rooms/room106.cpp
    engines/mads/dragonsphere/rooms/room110.cpp
    engines/mads/dragonsphere/rooms/room113.cpp
    engines/mads/dragonsphere/rooms/section1.cpp
    engines/mads/forest/forest.cpp
    engines/mads/forest/forest.h
    engines/mads/forest/journal.h
    engines/mads/forest/main.cpp
    engines/mads/forest/rooms/room104.cpp
    engines/mads/forest/rooms/room107.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/room904.cpp
    engines/mads/mads.cpp
    engines/mads/mads.h
    engines/mads/module.mk
    engines/mads/nebular/extra.cpp
    engines/mads/nebular/main.cpp
    engines/mads/nebular/main_menu.cpp
    engines/mads/nebular/nebular.cpp
    engines/mads/nebular/nebular.h
    engines/mads/nebular/rooms/dialog.h
    engines/mads/nebular/rooms/forcefield.cpp
    engines/mads/nebular/rooms/section3.cpp
    engines/mads/phantom/main.cpp
    engines/mads/phantom/main_menu.cpp
    engines/mads/phantom/phantom.h
    engines/mads/phantom/rooms/room102.cpp
    engines/mads/phantom/rooms/room202.cpp
    engines/mads/textview/textview.cpp


diff --git a/engines/mads/animview/anim_timer.cpp b/engines/mads/animview/anim_timer.cpp
index 3d77ff3ba87..d78f8d7d6cf 100644
--- a/engines/mads/animview/anim_timer.cpp
+++ b/engines/mads/animview/anim_timer.cpp
@@ -28,7 +28,7 @@
 #include "mads/core/mouse.h"
 #include "mads/core/pal.h"
 #include "mads/core/timer.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace AnimView {
diff --git a/engines/mads/animview/animview.cpp b/engines/mads/animview/animview.cpp
index 4ffc617554e..4f1568c782b 100644
--- a/engines/mads/animview/animview.cpp
+++ b/engines/mads/animview/animview.cpp
@@ -35,7 +35,7 @@
 #include "mads/animview/animview.h"
 #include "mads/animview/anim_timer.h"
 #include "mads/animview/functions.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace AnimView {
diff --git a/engines/mads/core/config.cpp b/engines/mads/core/config.cpp
index e2bc12518ea..eb9f6fc6eea 100644
--- a/engines/mads/core/config.cpp
+++ b/engines/mads/core/config.cpp
@@ -24,7 +24,7 @@
 #include "mads/core/env.h"
 #include "mads/core/inter.h"
 #include "mads/core/kernel.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/conv.cpp b/engines/mads/core/conv.cpp
index 469ecae3c2a..4629b0e0725 100644
--- a/engines/mads/core/conv.cpp
+++ b/engines/mads/core/conv.cpp
@@ -38,7 +38,7 @@
 #include "mads/core/mem.h"
 #include "mads/core/popup.h"
 #include "mads/core/speech.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/echo.h b/engines/mads/core/echo.h
index dbec100b038..0529bfbb703 100644
--- a/engines/mads/core/echo.h
+++ b/engines/mads/core/echo.h
@@ -23,7 +23,7 @@
 #define MADS_CORE_ECHO_H
 
 #include "gui/debugger.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/game.cpp b/engines/mads/core/game.cpp
index 7385f25ac1b..d4e00d91358 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/core/game.cpp
@@ -20,7 +20,7 @@
  */
 
 #include "common/debug.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/game.h"
 #include "mads/core/mads.h"
 #include "mads/core/attr.h"
diff --git a/engines/mads/core/global.cpp b/engines/mads/core/global.cpp
index 15fa61e7294..a52af4badaa 100644
--- a/engines/mads/core/global.cpp
+++ b/engines/mads/core/global.cpp
@@ -22,7 +22,7 @@
 #include "common/textconsole.h"
 #include "mads/core/config.h"
 #include "mads/core/global.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/imath.cpp b/engines/mads/core/imath.cpp
index 5910c6d8bff..3204cf9df1c 100644
--- a/engines/mads/core/imath.cpp
+++ b/engines/mads/core/imath.cpp
@@ -21,7 +21,7 @@
 
 #include "common/util.h"
 #include "mads/core/imath.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/inter.cpp b/engines/mads/core/inter.cpp
index af79189431f..d077feaa1af 100644
--- a/engines/mads/core/inter.cpp
+++ b/engines/mads/core/inter.cpp
@@ -48,7 +48,7 @@
 #include "mads/forest/extra.h"
 #include "mads/dragonsphere/mads/inventory.h"
 #include "mads/dragonsphere/global.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/keys.cpp b/engines/mads/core/keys.cpp
index 6d4a1c6a83c..f0bf026272a 100644
--- a/engines/mads/core/keys.cpp
+++ b/engines/mads/core/keys.cpp
@@ -22,7 +22,7 @@
 #include "mads/core/keys.h"
 #include "mads/core/general.h"
 #include "mads/core/mem.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/magic.cpp b/engines/mads/core/magic.cpp
index efd95480644..c3326986277 100644
--- a/engines/mads/core/magic.cpp
+++ b/engines/mads/core/magic.cpp
@@ -31,7 +31,7 @@
 #include "mads/core/sort.h"
 #include "mads/core/timer.h"
 #include "mads/core/video.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/matte.cpp b/engines/mads/core/matte.cpp
index 93638c5b68f..9860e742b1f 100644
--- a/engines/mads/core/matte.cpp
+++ b/engines/mads/core/matte.cpp
@@ -35,7 +35,7 @@
 #include "mads/core/keys.h"
 #include "mads/core/timer.h"
 #include "mads/core/sound.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/video.h"
 #include "mads/core/anim.h"
 #include "mads/core/matte.h"
diff --git a/engines/mads/core/mcga.cpp b/engines/mads/core/mcga.cpp
index ffcdca30cb3..9fda820c726 100644
--- a/engines/mads/core/mcga.cpp
+++ b/engines/mads/core/mcga.cpp
@@ -24,7 +24,7 @@
 #include "mads/core/general.h"
 #include "mads/core/mem.h"
 #include "mads/core/pal.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/mouse.cpp b/engines/mads/core/mouse.cpp
index 51e79deb69e..cb7764cfcc0 100644
--- a/engines/mads/core/mouse.cpp
+++ b/engines/mads/core/mouse.cpp
@@ -27,7 +27,7 @@
 #include "mads/core/mouse.h"
 #include "mads/core/timer.h"
 #include "mads/core/video.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/object.cpp b/engines/mads/core/object.cpp
index 7b9f42575c2..ba49f7d339d 100644
--- a/engines/mads/core/object.cpp
+++ b/engines/mads/core/object.cpp
@@ -44,7 +44,7 @@
 #include "mads/core/text.h"
 #include "mads/core/tile.h"
 #include "mads/core/video.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/pal.cpp b/engines/mads/core/pal.cpp
index 8c54d302158..d578fb7772b 100644
--- a/engines/mads/core/pal.cpp
+++ b/engines/mads/core/pal.cpp
@@ -20,7 +20,7 @@
  */
 
 #include "common/debug.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/pal.h"
 #include "mads/core/mcga.h"
 #include "mads/core/color.h"
diff --git a/engines/mads/core/player.cpp b/engines/mads/core/player.cpp
index 12ac9318725..2ce4bc6131a 100644
--- a/engines/mads/core/player.cpp
+++ b/engines/mads/core/player.cpp
@@ -33,7 +33,7 @@
 #include "mads/core/pal.h"
 #include "mads/core/himem.h"
 #include "mads/core/object.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/nebular/extra.h"
 
 namespace MADS {
diff --git a/engines/mads/core/popup.cpp b/engines/mads/core/popup.cpp
index 15822d336c6..d178d253b72 100644
--- a/engines/mads/core/popup.cpp
+++ b/engines/mads/core/popup.cpp
@@ -39,7 +39,7 @@
 #include "mads/core/game.h"
 #include "mads/core/pal.h"
 #include "mads/core/mcga.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/nebular/popup.h"
 
 namespace MADS {
diff --git a/engines/mads/core/room.cpp b/engines/mads/core/room.cpp
index bedb20e474d..bdf65181148 100644
--- a/engines/mads/core/room.cpp
+++ b/engines/mads/core/room.cpp
@@ -42,7 +42,7 @@
 #include "mads/core/kernel.h"
 #include "mads/core/inter.h"
 #include "mads/nebular/extra.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/sound.cpp b/engines/mads/core/sound.cpp
index d1029b1fe35..076ff63531f 100644
--- a/engines/mads/core/sound.cpp
+++ b/engines/mads/core/sound.cpp
@@ -21,7 +21,7 @@
 
 #include "common/textconsole.h"
 #include "mads/core/sound.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/speech.cpp b/engines/mads/core/speech.cpp
index 19835cf9d78..78d296c6b55 100644
--- a/engines/mads/core/speech.cpp
+++ b/engines/mads/core/speech.cpp
@@ -26,7 +26,7 @@
 #include "mads/core/env.h"
 #include "mads/core/mem.h"
 #include "mads/core/pack.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/text.cpp b/engines/mads/core/text.cpp
index 4d7efc575ab..a348d8043ef 100644
--- a/engines/mads/core/text.cpp
+++ b/engines/mads/core/text.cpp
@@ -38,7 +38,7 @@
 #include "mads/core/object.h"
 #include "mads/core/text.h"
 #include "mads/core/global.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/timer.cpp b/engines/mads/core/timer.cpp
index a0ba8cec0f1..b9b01f771dd 100644
--- a/engines/mads/core/timer.cpp
+++ b/engines/mads/core/timer.cpp
@@ -22,7 +22,7 @@
 #include "common/textconsole.h"
 #include "mads/core/general.h"
 #include "mads/core/timer.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/core/video.cpp b/engines/mads/core/video.cpp
index c225dd5f632..b42b02f3486 100644
--- a/engines/mads/core/video.cpp
+++ b/engines/mads/core/video.cpp
@@ -20,7 +20,7 @@
  */
 
 #include "mads/core/video.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 
diff --git a/engines/mads/dragonsphere/dragonsphere.h b/engines/mads/dragonsphere/dragonsphere.h
index b242c40516c..0fbcbdf1782 100644
--- a/engines/mads/dragonsphere/dragonsphere.h
+++ b/engines/mads/dragonsphere/dragonsphere.h
@@ -22,18 +22,18 @@
 #ifndef MADS_DRAGONSPHERE_H
 #define MADS_DRAGONSPHERE_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
 
-class DragonsphereEngine : public MADSV2Engine {
+class DragonsphereEngine : public MADSEngine {
 private:
 	static void global_object_examine();
 
 public:
 	DragonsphereEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
-		MADSV2Engine(syst, gameDesc) {}
+		MADSEngine(syst, gameDesc) {}
 	~DragonsphereEngine() override {}
 
 	Common::Error run() override;
diff --git a/engines/mads/dragonsphere/main.cpp b/engines/mads/dragonsphere/main.cpp
index 397020e9626..6d2ffc9b700 100644
--- a/engines/mads/dragonsphere/main.cpp
+++ b/engines/mads/dragonsphere/main.cpp
@@ -40,7 +40,7 @@
 #include "mads/core/speech.h"
 #include "mads/dragonsphere/main_menu.h"
 #include "mads/dragonsphere/menus.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
diff --git a/engines/mads/dragonsphere/main_menu.cpp b/engines/mads/dragonsphere/main_menu.cpp
index 9e57f0b01cd..a8607bcc1b3 100644
--- a/engines/mads/dragonsphere/main_menu.cpp
+++ b/engines/mads/dragonsphere/main_menu.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/general.h"
 #include "mads/core/config.h"
 #include "mads/core/font.h"
diff --git a/engines/mads/dragonsphere/rooms/room106.cpp b/engines/mads/dragonsphere/rooms/room106.cpp
index 16e8538f8ac..8b0de28eea9 100644
--- a/engines/mads/dragonsphere/rooms/room106.cpp
+++ b/engines/mads/dragonsphere/rooms/room106.cpp
@@ -34,7 +34,7 @@
 #include "mads/dragonsphere/global.h"
 #include "mads/dragonsphere/rooms/section1.h"
 #include "mads/dragonsphere/rooms/room106.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
diff --git a/engines/mads/dragonsphere/rooms/room110.cpp b/engines/mads/dragonsphere/rooms/room110.cpp
index 59e269ace95..9aef46f2510 100644
--- a/engines/mads/dragonsphere/rooms/room110.cpp
+++ b/engines/mads/dragonsphere/rooms/room110.cpp
@@ -34,7 +34,7 @@
 #include "mads/dragonsphere/global.h"
 #include "mads/dragonsphere/rooms/section1.h"
 #include "mads/dragonsphere/rooms/room110.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
diff --git a/engines/mads/dragonsphere/rooms/room113.cpp b/engines/mads/dragonsphere/rooms/room113.cpp
index 43ccd1a19dd..fb7bdabd9a1 100644
--- a/engines/mads/dragonsphere/rooms/room113.cpp
+++ b/engines/mads/dragonsphere/rooms/room113.cpp
@@ -34,7 +34,7 @@
 #include "mads/dragonsphere/global.h"
 #include "mads/dragonsphere/rooms/section1.h"
 #include "mads/dragonsphere/rooms/room113.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
diff --git a/engines/mads/dragonsphere/rooms/section1.cpp b/engines/mads/dragonsphere/rooms/section1.cpp
index 2767bbe6f05..2f3fc2f311d 100644
--- a/engines/mads/dragonsphere/rooms/section1.cpp
+++ b/engines/mads/dragonsphere/rooms/section1.cpp
@@ -30,7 +30,7 @@
 #include "mads/dragonsphere/global.h"
 #include "mads/dragonsphere/rooms/section1.h"
 #include "mads/dragonsphere/mads/sounds.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Dragonsphere {
diff --git a/engines/mads/engine.cpp b/engines/mads/engine.cpp
deleted file mode 100644
index ab5ac9a9e91..00000000000
--- a/engines/mads/engine.cpp
+++ /dev/null
@@ -1,517 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 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/config-manager.h"
-#include "common/memstream.h"
-#include "engines/util.h"
-#include "mads/mads.h"
-#include "mads/engine.h"
-#include "mads/core/anim.h"
-#include "mads/core/attr.h"
-#include "mads/core/camera.h"
-#include "mads/core/config.h"
-#include "mads/core/conv.h"
-#include "mads/core/cursor.h"
-#include "mads/core/cycle.h"
-#include "mads/core/dialog.h"
-#include "mads/core/font.h"
-#include "mads/core/game.h"
-#include "mads/core/global.h"
-#include "mads/core/hspot.h"
-#include "mads/core/inter.h"
-#include "mads/core/kernel.h"
-#include "mads/core/keys.h"
-#include "mads/core/matte.h"
-#include "mads/core/mcga.h"
-#include "mads/core/object.h"
-#include "mads/core/pal.h"
-#include "mads/core/player.h"
-#include "mads/core/popup.h"
-#include "mads/core/quote.h"
-#include "mads/core/rail.h"
-#include "mads/core/room.h"
-#include "mads/core/speech.h"
-#include "mads/core/sprite.h"
-#include "mads/core/timer.h"
-#include "mads/core/vocab.h"
-#include "mads/phantom/main.h"
-#include "mads/forest/extra.h"
-#include "mads/forest/global.h"
-#include "mads/core/sound_manager.h"
-
-namespace MADS {
-
-constexpr int SAVEGAME_VERSION = 1;
-constexpr int GAME_FRAME_RATE = 50;
-constexpr int GAME_FRAME_TIME = 1000 / GAME_FRAME_RATE;
-
-MADSV2Engine *g_engine;
-
-static const Common::KeyCode KEYBINDING_ACTIONS[kActionRestartAnimation + 1] = {
-	Common::KEYCODE_INVALID, Common::KEYCODE_ESCAPE, Common::KEYCODE_F1,
-	Common::KEYCODE_F5, Common::KEYCODE_F7, Common::KEYCODE_PAGEUP,
-	Common::KEYCODE_PAGEDOWN, Common::KEYCODE_F1, Common::KEYCODE_F2,
-	Common::KEYCODE_F3, Common::KEYCODE_F4, Common::KEYCODE_F5,
-	Common::KEYCODE_INVALID
-};
-
-
-MADSV2Engine::MADSV2Engine(OSystem *syst, const MADSGameDescription *gameDesc) :
-	MADSEngine(syst, gameDesc) {
-	g_engine = this;
-	_speechFlag = true;
-
-	initGlobals();
-}
-
-MADSV2Engine::~MADSV2Engine() {
-	g_engine = nullptr;
-	delete _screen;
-	delete _soundManager;
-}
-
-void MADSV2Engine::initializePath(const Common::FSNode &gamePath) {
-	MADSEngine::initializePath(gamePath);
-	Common::FSNode folder = gamePath.getChild("resource");
-	if (folder.exists())
-		SearchMan.addDirectory(folder);
-}
-
-void MADSV2Engine::initGlobals() {
-	init_anim();
-	init_attr();
-	init_camera();
-	init_conv();
-	init_cursor();
-	init_cycle();
-	init_dialog();
-	init_font();
-	init_game();
-	init_global();
-	init_hspot();
-	init_inter();
-	init_kernel();
-	init_keys();
-	init_matte();
-	init_object();
-	init_pal();
-	init_player();
-	init_popup();
-	init_quote();
-	init_rail();
-	init_room();
-	init_speech();
-	init_sprite();
-	init_timer();
-	init_vocab();
-	Forest::init_extra();
-}
-
-void MADSV2Engine::readConfigFile() {
-	read_config_file();
-	_musicFlag = config_file.music_flag;
-	_soundFlag = config_file.sound_flag;
-	_speechFlag = config_file.speech_flag;
-
-	if (ConfMan.hasKey("save_slot"))
-		savegame_slot = ConfMan.getInt("save_slot");
-}
-
-bool MADSV2Engine::canLoadGameStateCurrently(Common::U32String *msg) {
-	return game.going && !win_status && !kernel.activate_menu &&
-		inter_input_mode == INTER_BUILDING_SENTENCES &&
-		conv_control.running == -1;
-}
-
-Common::Error MADSV2Engine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
-	stream->writeByte(SAVEGAME_VERSION);
-	Common::Serializer s(nullptr, stream);
-	s.setVersion(SAVEGAME_VERSION);
-
-	// Sync main game data
-	syncGame(s);
-
-	// Save conversation data
-	conv_append(stream);
-
-	return Common::kNoError;
-}
-
-Common::Error MADSV2Engine::loadGameStream(Common::SeekableReadStream *stream) {
-	int save = player.walker_is_loaded;
-
-	byte version = stream->readByte();
-	if (version != SAVEGAME_VERSION)
-		error("Invalid savegame version");
-
-
-	// Sync main game data
-	Common::Serializer s(stream, nullptr);
-	syncGame(s);
-
-	// Load conversation data
-	if (conv_expand(stream))
-		goto done;
-
-	if (inven_num_objects > 0) {
-		active_inven = 0;
-	} else {
-		active_inven = -1;
-	}
-
-	first_inven = 0;
-
-	section_id = KERNEL_RESTORING_GAME;
-	room_id = KERNEL_RESTORING_GAME;
-
-	new_section = new_room / 100;
-
-	kernel.clock = timer_read();
-	game.going = true;
-
-done:
-	player.walker_is_loaded = save;
-	return Common::kNoError;
-}
-	
-void MADSV2Engine::syncGame(Common::Serializer &s) {
-	if (s.isSaving()) {
-		// Write the room specific locals to the game scratchpad
-		Common::fill(game.scratch, game.scratch + KERNEL_SCRATCH_SIZE, 0);
-		Common::MemoryWriteStream scratchStream(game.scratch, KERNEL_SCRATCH_SIZE);
-		Common::Serializer s2(nullptr, &scratchStream);
-		syncRoom(s2);
-	}
-
-	game.synchronize(s);
-	s.syncAsSint16LE(new_room);
-
-	if (s.isLoading()) {
-		// Unpack the loaded scratch data for the room
-		Common::MemoryReadStream scratchStream(game.scratch, KERNEL_SCRATCH_SIZE);
-		Common::Serializer s2(&scratchStream, nullptr);
-		syncRoom(s2);
-	}
-
-	player2.synchronize(s);
-
-	s.syncAsSint16LE(inven_num_objects);
-	for (int i = 0; i < inven_num_objects; ++i)
-		s.syncAsSint16LE(inven[i]);
-
-	player.synchronize(s);
-	for (int i = 0; i < global_list_size; ++i)
-		s.syncAsSint16LE(global[i]);
-
-	for (int i = 0; i < num_objects; ++i)
-		object[i].synchronize(s);
-
-	s.syncAsSint16LE(conv_restore_running);
-
-	if (s.isSaving()) {
-		s.syncAsSint16LE(picture_view_x);
-		s.syncAsSint16LE(picture_view_y);
-	} else {
-		s.syncAsSint16LE(camera_old_x_target);
-		s.syncAsSint16LE(camera_old_y_target);
-	}
-
-	if (getGameID() == GType_Forest)
-		s.syncMultipleLE(Forest::flags);
-
-	for (int i = 0; i < OMR; ++i)
-		s.syncAsSint16LE(room_state[i]);
-	s.syncAsSint16LE(previous_room);
-}
-
-void MADSV2Engine::pollEvents() {
-	// Check for screen update time
-	uint32 time = g_system->getMillis();
-	if (time >= _nextFrameTime) {
-		updateScreen();
-		_nextFrameTime = time + GAME_FRAME_TIME;
-	}
-
-	// Handle calling any set timer function
-	checkForTimerFunction();
-
-	// Poll for events
-	Common::Event e;
-	while (g_system->getEventManager()->pollEvent(e)) {
-		bool isMouse = false;
-		switch (e.type) {
-		case Common::EVENT_LBUTTONDOWN:
-			_mouseButtons |= 1;
-			isMouse = true;
-			break;
-		case Common::EVENT_LBUTTONUP:
-			_mouseButtons &= ~1;
-			isMouse = true;
-			break;
-		case Common::EVENT_RBUTTONDOWN:
-			_mouseButtons |= 2;
-			isMouse = true;
-			break;
-		case Common::EVENT_RBUTTONUP:
-			_mouseButtons &= ~2;
-			isMouse = true;
-			break;
-		case Common::EVENT_MBUTTONDOWN:
-			_mouseButtons |= 4;
-			isMouse = true;
-			break;
-		case Common::EVENT_MBUTTONUP:
-			_mouseButtons &= ~4;
-			isMouse = true;
-			break;
-		case Common::EVENT_MOUSEMOVE:
-			isMouse = true;
-			break;
-		case Common::EVENT_RETURN_TO_LAUNCHER:
-		case Common::EVENT_QUIT:
-			game.going = false;
-			break;
-		default:
-			break;
-		}
-
-		if (isMouse)
-			_mousePos = e.mouse;
-
-		if (e.type == Common::EVENT_KEYDOWN && !isSpecialKey(e.kbd.keycode))
-			_keyEvents.push(e.kbd);
-		if (e.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START &&
-				KEYBINDING_ACTIONS[e.customType] != Common::KEYCODE_INVALID)
-			_keyEvents.push(Common::KeyState(KEYBINDING_ACTIONS[e.customType]));
-	}
-}
-
-void MADSV2Engine::updateScreen() {
-	// Handle any screen shaking
-	if (mcga_shakes) {
-		_shakeRandom = _shakeRandom * 5 + 1;
-		int offset = (_shakeRandom >> 8) & 3;
-		if (--mcga_shakes == 0)
-			offset = 0;
-
-		// Manually copy the screen with the left hand hide side of the screen of a given offset width shown
-		// at the very right. The offset changes to give an effect of shaking the screen
-		offset *= 4;
-		const byte *buf = (const byte *)_screen->getBasePtr(offset, 0);
-		g_system->copyRectToScreen(buf, 320, 0, 0, 320 - offset, 200);
-		if (offset > 0)
-			g_system->copyRectToScreen(_screen->getPixels(), 320, 320 - offset, 0, offset, 200);
-		g_system->updateScreen();
-
-	} else {
-		// Because the screen is accessed directly via Buffer objects, we need to do a full screen update each frame
-		_screen->markAllDirty();
-		_screen->update();
-	}
-}
-
-bool MADSV2Engine::isSpecialKey(Common::KeyCode key) const {
-	static const Common::KeyCode KEYS[] = {
-		Common::KEYCODE_LCTRL, Common::KEYCODE_LALT, Common::KEYCODE_RSHIFT, Common::KEYCODE_RALT,
-	};
-
-	for (const Common::KeyCode &kc : KEYS) {
-		if (kc == key)
-			return true;
-	}
-
-	return false;
-}
-
-void MADSV2Engine::checkForTimerFunction() {
-	if (_timerFunction && _nextTimerTime != (uint32)-1) {
-		uint32 time = g_system->getMillis();
-		if (time >= _nextTimerTime) {
-			// Flag the timer as disabled to prevent recursive calls
-			_nextTimerTime = (uint32)-1;
-
-			// Call the timer
-			_timerFunction();
-
-			// Determine the next time to call the function at 60Hz
-			_nextTimerTime = time + (1000 / 60);
-		}
-	}
-}
-
-bool MADSV2Engine::hasPendingKey() {
-	pollEvents();
-
-	return !_keyEvents.empty();
-}
-
-int MADSV2Engine::getKey() {
-	pollEvents();
-
-	if (!_keyEvents.empty()) {
-		Common::KeyState ks = _keyEvents.pop();
-		return ks.ascii && (ks.flags == 0) ? ks.ascii : (ks.flags << 16) | ks.keycode;
-	}
-
-	return 0;
-}
-
-void MADSV2Engine::flushKeys() {
-	pollEvents();
-
-	_keyEvents.clear();
-}
-
-int MADSV2Engine::getMouseState(int &x, int &y) {
-	pollEvents();
-
-	x = _mousePos.x;
-	y = _mousePos.y;
-	return _mouseButtons;
-}
-
-uint32 MADSV2Engine::getMillis() {
-	pollEvents();
-	return g_system->getMillis();
-}
-
-void MADSV2Engine::playSpeech(Audio::AudioStream *stream) {
-	_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream);
-}
-
-void MADSV2Engine::stopSpeech() {
-	_mixer->stopHandle(_speechHandle);
-}
-
-bool MADSV2Engine::isSpeechPlaying() const {
-	return _mixer->isSoundHandleActive(_speechHandle);
-}
-
-SaveStateList MADSV2Engine::listSaves() const {
-	return getMetaEngine()->listSaves(_targetName.c_str());
-}
-
-void MADSV2Engine::player_keep_walking() {
-	int at_x, at_y;
-	int walk_code;
-	int id;
-	int new_facing = false;
-	int temp_velocity;
-	int angle_scale;
-	int angle_range;
-
-	while (player.walking && !player.walk_off_edge && (player.x == player.target_x) && (player.y == player.target_y)) {
-		if (rail_solution_stack_pointer == 0) {
-			if (player.walk_off_edge_to_room) {
-				player.walk_off_edge = player.walk_off_edge_to_room;
-				player.walk_anywhere = true;
-				player.walk_off_edge_to_room = 0;
-				player.commands_allowed = false;
-				new_facing = false;
-			} else {
-				player.walking = false;
-				player_set_final_facing();
-				new_facing = true;
-			}
-		} else {
-			id = rail_solution_stack[--rail_solution_stack_pointer];
-			player.target_x = room->rail[id].x;
-			player.target_y = room->rail[id].y;
-			new_facing = true;
-		}
-	}
-
-	if (new_facing) {
-		if (player.walking) player_set_facing();
-	}
-
-	if (player.facing != player.turn_to_facing) {
-		player_keep_turning();
-	} else {
-		if (!player.walking) {
-			player_new_stop_walker();
-			player_activate_trigger();
-		}
-	}
-
-	temp_velocity = player.velocity;
-
-	if (player.scaling_velocity && (player.total_distance > 0)) {
-		angle_range = 100 - player.scale;
-		angle_scale = player.scale + ((angle_range * (player.x_count - 1)) / player.total_distance);
-		temp_velocity = (int)(((long)temp_velocity * ((long)player.scale * (long)angle_scale)) / 10000L);
-		temp_velocity = MAX(temp_velocity, 1);
-	}
-
-	if (player.walking && (player.facing == player.turn_to_facing)) {
-		at_x = player.x;
-		at_y = player.y;
-		walk_code = false;
-		player.special_code = 0;
-
-		if (player.dist_accum < temp_velocity) {
-
-			do {
-				if (player.pixel_accum < player.x_count) {
-					player.pixel_accum += player.y_count;
-				}
-				if (player.pixel_accum >= player.x_count) {
-					if ((player.y_counter > 0) || player.walk_off_edge) at_y += player.sign_y;
-					player.y_counter--;
-					player.pixel_accum -= player.x_count;
-				}
-				if (player.pixel_accum < player.x_count) {
-					if ((player.x_counter > 0) || player.walk_off_edge) at_x += player.sign_x;
-					player.x_counter--;
-				}
-
-				if (!player.walk_anywhere && !(player.walk_off_edge || player.walk_off_edge_to_room)) {
-					walk_code |= attr_walk(&scr_walk, at_x, at_y);
-					if (!player.special_code) {
-						player.special_code = (g_engine->getGameID() == GType_RexNebular) ?
-							rex_attr_special(&scr_special, at_x, at_y) :
-							attr_special(&scr_special, at_x, at_y);
-					}
-				}
-
-				player.dist_accum += player.delta_distance;
-			} while ((player.dist_accum < temp_velocity) && (!walk_code) &&
-				((player.x_counter > 0) || (player.y_counter > 0) || (player.walk_off_edge)));
-
-		}
-
-		player.dist_accum -= temp_velocity;
-
-		if (walk_code) {
-			player_cancel_command();
-		} else {
-			if (!player.walk_off_edge) {
-				if (player.x_counter <= 0) at_x = player.target_x;
-				if (player.y_counter <= 0) at_y = player.target_y;
-			}
-			player.x = at_x;
-			player.y = at_y;
-		}
-	}
-}
-
-} // namespace MADS
diff --git a/engines/mads/engine.h b/engines/mads/engine.h
deleted file mode 100644
index c1889717346..00000000000
--- a/engines/mads/engine.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 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_ENGINE_H
-#define MADS_ENGINE_H
-
-#include "audio/mixer.h"
-#include "common/events.h"
-#include "common/serializer.h"
-#include "common/stack.h"
-#include "common/random.h"
-#include "graphics/screen.h"
-#include "mads/mads.h"
-#include "mads/core/sound_manager.h"
-#include "mads/core/game.h"
-#include "mads/core/speech.h"
-
-namespace MADS {
-
-typedef void (*TimerFunction)();
-
-class MADSV2Engine : public MADSEngine {
-private:
-	uint16 _shakeRandom = 0x4D2;
-
-	void initGlobals();
-	void syncGame(Common::Serializer &s);
-	bool isSpecialKey(Common::KeyCode key) const;
-	void updateScreen();
-	
-protected:
-	Graphics::Screen *_screen = nullptr;
-	Common::Stack<Common::KeyState> _keyEvents;
-	uint32 _nextFrameTime = 0;
-	Common::Point _mousePos;
-	int _mouseButtons = 0;
-	Audio::SoundHandle _speechHandle;
-	TimerFunction _timerFunction = nullptr;
-	uint32 _nextTimerTime = 0;
-
-	void pollEvents();
-	void checkForTimerFunction();
-
-public:
-	MADS::SoundManager *_soundManager = nullptr;
-	bool _musicFlag = true;
-	bool _soundFlag = true;
-	bool &_speechFlag = speech_on;
-
-public:
-	MADSV2Engine(OSystem *syst, const MADSGameDescription *gameDesc);
-	~MADSV2Engine() override;
-	void initializePath(const Common::FSNode &gamePath) override;
-
-	void readConfigFile();
-
-	Graphics::Screen *getScreen() const {
-		return _screen;
-	}
-
-	bool hasPendingKey();
-	int getKey();
-	void flushKeys();
-
-	int getMouseState(int &x, int &y);
-
-	/**
-	 * Get the elapsed time in milliseconds
-	 */
-	uint32 getMillis();
-
-	/* Callback routines in game-specific MAIN module */
-	int main_cheating_key(int mykey) const {
-		return mykey;
-	}
-	int main_normal_key(int mykey) const {
-		return mykey;
-	}
-	virtual int main_copy_verify() {
-		return COPY_SUCCEED;
-	}
-
-	bool canLoadGameStateCurrently(Common::U32String *msg) override;
-	bool canSaveGameStateCurrently(Common::U32String *msg) override {
-		return canLoadGameStateCurrently(msg);
-	}
-	Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override;
-	Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
-	virtual void syncRoom(Common::Serializer &s) = 0;
-	SaveStateList listSaves() const;
-
-	virtual void global_init_code() = 0;
-	virtual void section_music(int section_num) = 0;
-	virtual void global_section_constructor() = 0;
-	virtual void global_daemon_code() = 0;
-	virtual void global_pre_parser_code() = 0;
-	virtual void global_parser_code() = 0;
-	virtual void global_error_code() = 0;
-	virtual void global_room_init() = 0;
-	virtual void global_sound_driver() = 0;
-	virtual void global_game_main_loop() {}
-	virtual void global_verb_filter() {}
-	virtual void player_keep_walking();
-
-	void playSpeech(Audio::AudioStream *stream);
-	void stopSpeech();
-	bool isSpeechPlaying() const;
-
-	/**
-	 * Sets the timer function to call at 60Hz
-	 */
-	void setTimerFunction(TimerFunction fn) {
-		_timerFunction = fn;
-	}
-};
-
-extern MADSV2Engine *g_engine;
-
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/forest/forest.cpp b/engines/mads/forest/forest.cpp
index a8913afbf4c..2e5cd41a9b9 100644
--- a/engines/mads/forest/forest.cpp
+++ b/engines/mads/forest/forest.cpp
@@ -59,7 +59,7 @@ namespace Forest {
 ForestEngine *g_engine;
 
 ForestEngine::ForestEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
-		MADSV2Engine(syst, gameDesc) {
+		MADSEngine(syst, gameDesc) {
 	g_engine = this;
 	init_extra();
 	init_inventory();
diff --git a/engines/mads/forest/forest.h b/engines/mads/forest/forest.h
index 35de735a117..622af4b3f08 100644
--- a/engines/mads/forest/forest.h
+++ b/engines/mads/forest/forest.h
@@ -22,14 +22,14 @@
 #ifndef MADS_FOREST_H
 #define MADS_FOREST_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/forest/digi.h"
 #include "mads/forest/midi.h"
 
 namespace MADS {
 namespace Forest {
 
-class ForestEngine : public MADSV2Engine {
+class ForestEngine : public MADSEngine {
 public:
 	DigiPlayer _digiPlayer = DigiPlayer(_mixer);
 	MidiPlayer _midiPlayer;
diff --git a/engines/mads/forest/journal.h b/engines/mads/forest/journal.h
index 95bc76c7664..2b84a494274 100644
--- a/engines/mads/forest/journal.h
+++ b/engines/mads/forest/journal.h
@@ -22,7 +22,7 @@
 #ifndef MADS_FOREST_JOURNAL_H
 #define MADS_FOREST_JOURNAL_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/main.cpp b/engines/mads/forest/main.cpp
index 0b13d75c1c3..32a8de13cb9 100644
--- a/engines/mads/forest/main.cpp
+++ b/engines/mads/forest/main.cpp
@@ -39,7 +39,7 @@
 #include "mads/core/quote.h"
 #include "mads/core/speech.h"
 #include "mads/forest/menus.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room104.cpp b/engines/mads/forest/rooms/room104.cpp
index 43b1353223c..c630695b84b 100644
--- a/engines/mads/forest/rooms/room104.cpp
+++ b/engines/mads/forest/rooms/room104.cpp
@@ -36,7 +36,7 @@
 #include "mads/core/player.h"
 #include "mads/core/sound.h"
 #include "mads/core/text.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room107.cpp b/engines/mads/forest/rooms/room107.cpp
index 730deacf4ef..bed3367644a 100644
--- a/engines/mads/forest/rooms/room107.cpp
+++ b/engines/mads/forest/rooms/room107.cpp
@@ -27,7 +27,7 @@
 #include "mads/core/matte.h"
 #include "mads/core/mouse.h"
 #include "mads/core/player.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room503.cpp b/engines/mads/forest/rooms/room503.cpp
index 3e019392cb2..62cacfc7e5e 100644
--- a/engines/mads/forest/rooms/room503.cpp
+++ b/engines/mads/forest/rooms/room503.cpp
@@ -36,7 +36,7 @@
 #include "mads/core/player.h"
 #include "mads/core/sound.h"
 #include "mads/core/text.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room509.cpp b/engines/mads/forest/rooms/room509.cpp
index 285105f2720..57faf8eefaf 100644
--- a/engines/mads/forest/rooms/room509.cpp
+++ b/engines/mads/forest/rooms/room509.cpp
@@ -27,7 +27,7 @@
 #include "mads/core/mouse.h"
 #include "mads/core/player.h"
 #include "mads/core/sprite.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room510.cpp b/engines/mads/forest/rooms/room510.cpp
index 9ab5654bf3c..cd1032f4513 100644
--- a/engines/mads/forest/rooms/room510.cpp
+++ b/engines/mads/forest/rooms/room510.cpp
@@ -31,7 +31,7 @@
 #include "mads/core/player.h"
 #include "mads/core/quote.h"
 #include "mads/core/sprite.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room520.cpp b/engines/mads/forest/rooms/room520.cpp
index 60a3daeb0d4..aa62391318d 100644
--- a/engines/mads/forest/rooms/room520.cpp
+++ b/engines/mads/forest/rooms/room520.cpp
@@ -27,7 +27,7 @@
 #include "mads/core/mouse.h"
 #include "mads/core/player.h"
 #include "mads/core/sprite.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/forest/rooms/room904.cpp b/engines/mads/forest/rooms/room904.cpp
index ac848a0ae13..18023e5cd31 100644
--- a/engines/mads/forest/rooms/room904.cpp
+++ b/engines/mads/forest/rooms/room904.cpp
@@ -30,7 +30,7 @@
 #include "mads/core/mouse.h"
 #include "mads/core/object.h"
 #include "mads/core/player.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Forest {
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index 80b21847d7a..a9468ae30c7 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -19,15 +19,498 @@
  *
  */
 
+#include "common/system.h"
+#include "common/config-manager.h"
+#include "common/memstream.h"
+#include "engines/util.h"
 #include "mads/mads.h"
+#include "mads/mads.h"
+#include "mads/core/anim.h"
+#include "mads/core/attr.h"
+#include "mads/core/camera.h"
+#include "mads/core/config.h"
+#include "mads/core/conv.h"
+#include "mads/core/cursor.h"
+#include "mads/core/cycle.h"
+#include "mads/core/dialog.h"
+#include "mads/core/font.h"
+#include "mads/core/game.h"
+#include "mads/core/global.h"
+#include "mads/core/hspot.h"
+#include "mads/core/inter.h"
+#include "mads/core/kernel.h"
+#include "mads/core/keys.h"
+#include "mads/core/matte.h"
+#include "mads/core/mcga.h"
+#include "mads/core/object.h"
+#include "mads/core/pal.h"
+#include "mads/core/player.h"
+#include "mads/core/popup.h"
+#include "mads/core/quote.h"
+#include "mads/core/rail.h"
+#include "mads/core/room.h"
+#include "mads/core/speech.h"
+#include "mads/core/sprite.h"
+#include "mads/core/timer.h"
+#include "mads/core/vocab.h"
+#include "mads/phantom/main.h"
+#include "mads/forest/extra.h"
+#include "mads/forest/global.h"
+#include "mads/core/sound_manager.h"
 
 namespace MADS {
 
+constexpr int SAVEGAME_VERSION = 1;
+constexpr int GAME_FRAME_RATE = 50;
+constexpr int GAME_FRAME_TIME = 1000 / GAME_FRAME_RATE;
+
+MADSEngine *g_engine;
+
+static const Common::KeyCode KEYBINDING_ACTIONS[kActionRestartAnimation + 1] = {
+	Common::KEYCODE_INVALID, Common::KEYCODE_ESCAPE, Common::KEYCODE_F1,
+	Common::KEYCODE_F5, Common::KEYCODE_F7, Common::KEYCODE_PAGEUP,
+	Common::KEYCODE_PAGEDOWN, Common::KEYCODE_F1, Common::KEYCODE_F2,
+	Common::KEYCODE_F3, Common::KEYCODE_F4, Common::KEYCODE_F5,
+	Common::KEYCODE_INVALID
+};
+
 MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
 		Engine(syst), _gameDescription(gameDesc), _randomSource("MADS") {
+	g_engine = this;
+	_speechFlag = true;
+
+	initGlobals();
 }
 
 MADSEngine::~MADSEngine() {
+	g_engine = nullptr;
+	delete _screen;
+	delete _soundManager;
+}
+
+void MADSEngine::initializePath(const Common::FSNode &gamePath) {
+	Engine::initializePath(gamePath);
+	Common::FSNode folder = gamePath.getChild("resource");
+	if (folder.exists())
+		SearchMan.addDirectory(folder);
+}
+
+void MADSEngine::initGlobals() {
+	init_anim();
+	init_attr();
+	init_camera();
+	init_conv();
+	init_cursor();
+	init_cycle();
+	init_dialog();
+	init_font();
+	init_game();
+	init_global();
+	init_hspot();
+	init_inter();
+	init_kernel();
+	init_keys();
+	init_matte();
+	init_object();
+	init_pal();
+	init_player();
+	init_popup();
+	init_quote();
+	init_rail();
+	init_room();
+	init_speech();
+	init_sprite();
+	init_timer();
+	init_vocab();
+	Forest::init_extra();
+}
+
+void MADSEngine::readConfigFile() {
+	read_config_file();
+	_musicFlag = config_file.music_flag;
+	_soundFlag = config_file.sound_flag;
+	_speechFlag = config_file.speech_flag;
+
+	if (ConfMan.hasKey("save_slot"))
+		savegame_slot = ConfMan.getInt("save_slot");
+}
+
+bool MADSEngine::canLoadGameStateCurrently(Common::U32String *msg) {
+	return game.going && !win_status && !kernel.activate_menu &&
+		inter_input_mode == INTER_BUILDING_SENTENCES &&
+		conv_control.running == -1;
+}
+
+Common::Error MADSEngine::saveGameStream(Common::WriteStream *stream, bool isAutosave) {
+	stream->writeByte(SAVEGAME_VERSION);
+	Common::Serializer s(nullptr, stream);
+	s.setVersion(SAVEGAME_VERSION);
+
+	// Sync main game data
+	syncGame(s);
+
+	// Save conversation data
+	conv_append(stream);
+
+	return Common::kNoError;
+}
+
+Common::Error MADSEngine::loadGameStream(Common::SeekableReadStream *stream) {
+	int save = player.walker_is_loaded;
+
+	byte version = stream->readByte();
+	if (version != SAVEGAME_VERSION)
+		error("Invalid savegame version");
+
+
+	// Sync main game data
+	Common::Serializer s(stream, nullptr);
+	syncGame(s);
+
+	// Load conversation data
+	if (conv_expand(stream))
+		goto done;
+
+	if (inven_num_objects > 0) {
+		active_inven = 0;
+	} else {
+		active_inven = -1;
+	}
+
+	first_inven = 0;
+
+	section_id = KERNEL_RESTORING_GAME;
+	room_id = KERNEL_RESTORING_GAME;
+
+	new_section = new_room / 100;
+
+	kernel.clock = timer_read();
+	game.going = true;
+
+done:
+	player.walker_is_loaded = save;
+	return Common::kNoError;
+}
+	
+void MADSEngine::syncGame(Common::Serializer &s) {
+	if (s.isSaving()) {
+		// Write the room specific locals to the game scratchpad
+		Common::fill(game.scratch, game.scratch + KERNEL_SCRATCH_SIZE, 0);
+		Common::MemoryWriteStream scratchStream(game.scratch, KERNEL_SCRATCH_SIZE);
+		Common::Serializer s2(nullptr, &scratchStream);
+		syncRoom(s2);
+	}
+
+	game.synchronize(s);
+	s.syncAsSint16LE(new_room);
+
+	if (s.isLoading()) {
+		// Unpack the loaded scratch data for the room
+		Common::MemoryReadStream scratchStream(game.scratch, KERNEL_SCRATCH_SIZE);
+		Common::Serializer s2(&scratchStream, nullptr);
+		syncRoom(s2);
+	}
+
+	player2.synchronize(s);
+
+	s.syncAsSint16LE(inven_num_objects);
+	for (int i = 0; i < inven_num_objects; ++i)
+		s.syncAsSint16LE(inven[i]);
+
+	player.synchronize(s);
+	for (int i = 0; i < global_list_size; ++i)
+		s.syncAsSint16LE(global[i]);
+
+	for (int i = 0; i < num_objects; ++i)
+		object[i].synchronize(s);
+
+	s.syncAsSint16LE(conv_restore_running);
+
+	if (s.isSaving()) {
+		s.syncAsSint16LE(picture_view_x);
+		s.syncAsSint16LE(picture_view_y);
+	} else {
+		s.syncAsSint16LE(camera_old_x_target);
+		s.syncAsSint16LE(camera_old_y_target);
+	}
+
+	if (getGameID() == GType_Forest)
+		s.syncMultipleLE(Forest::flags);
+
+	for (int i = 0; i < OMR; ++i)
+		s.syncAsSint16LE(room_state[i]);
+	s.syncAsSint16LE(previous_room);
+}
+
+void MADSEngine::pollEvents() {
+	// Check for screen update time
+	uint32 time = g_system->getMillis();
+	if (time >= _nextFrameTime) {
+		updateScreen();
+		_nextFrameTime = time + GAME_FRAME_TIME;
+	}
+
+	// Handle calling any set timer function
+	checkForTimerFunction();
+
+	// Poll for events
+	Common::Event e;
+	while (g_system->getEventManager()->pollEvent(e)) {
+		bool isMouse = false;
+		switch (e.type) {
+		case Common::EVENT_LBUTTONDOWN:
+			_mouseButtons |= 1;
+			isMouse = true;
+			break;
+		case Common::EVENT_LBUTTONUP:
+			_mouseButtons &= ~1;
+			isMouse = true;
+			break;
+		case Common::EVENT_RBUTTONDOWN:
+			_mouseButtons |= 2;
+			isMouse = true;
+			break;
+		case Common::EVENT_RBUTTONUP:
+			_mouseButtons &= ~2;
+			isMouse = true;
+			break;
+		case Common::EVENT_MBUTTONDOWN:
+			_mouseButtons |= 4;
+			isMouse = true;
+			break;
+		case Common::EVENT_MBUTTONUP:
+			_mouseButtons &= ~4;
+			isMouse = true;
+			break;
+		case Common::EVENT_MOUSEMOVE:
+			isMouse = true;
+			break;
+		case Common::EVENT_RETURN_TO_LAUNCHER:
+		case Common::EVENT_QUIT:
+			game.going = false;
+			break;
+		default:
+			break;
+		}
+
+		if (isMouse)
+			_mousePos = e.mouse;
+
+		if (e.type == Common::EVENT_KEYDOWN && !isSpecialKey(e.kbd.keycode))
+			_keyEvents.push(e.kbd);
+		if (e.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START &&
+				KEYBINDING_ACTIONS[e.customType] != Common::KEYCODE_INVALID)
+			_keyEvents.push(Common::KeyState(KEYBINDING_ACTIONS[e.customType]));
+	}
+}
+
+void MADSEngine::updateScreen() {
+	// Handle any screen shaking
+	if (mcga_shakes) {
+		_shakeRandom = _shakeRandom * 5 + 1;
+		int offset = (_shakeRandom >> 8) & 3;
+		if (--mcga_shakes == 0)
+			offset = 0;
+
+		// Manually copy the screen with the left hand hide side of the screen of a given offset width shown
+		// at the very right. The offset changes to give an effect of shaking the screen
+		offset *= 4;
+		const byte *buf = (const byte *)_screen->getBasePtr(offset, 0);
+		g_system->copyRectToScreen(buf, 320, 0, 0, 320 - offset, 200);
+		if (offset > 0)
+			g_system->copyRectToScreen(_screen->getPixels(), 320, 320 - offset, 0, offset, 200);
+		g_system->updateScreen();
+
+	} else {
+		// Because the screen is accessed directly via Buffer objects, we need to do a full screen update each frame
+		_screen->markAllDirty();
+		_screen->update();
+	}
+}
+
+bool MADSEngine::isSpecialKey(Common::KeyCode key) const {
+	static const Common::KeyCode KEYS[] = {
+		Common::KEYCODE_LCTRL, Common::KEYCODE_LALT, Common::KEYCODE_RSHIFT, Common::KEYCODE_RALT,
+	};
+
+	for (const Common::KeyCode &kc : KEYS) {
+		if (kc == key)
+			return true;
+	}
+
+	return false;
+}
+
+void MADSEngine::checkForTimerFunction() {
+	if (_timerFunction && _nextTimerTime != (uint32)-1) {
+		uint32 time = g_system->getMillis();
+		if (time >= _nextTimerTime) {
+			// Flag the timer as disabled to prevent recursive calls
+			_nextTimerTime = (uint32)-1;
+
+			// Call the timer
+			_timerFunction();
+
+			// Determine the next time to call the function at 60Hz
+			_nextTimerTime = time + (1000 / 60);
+		}
+	}
+}
+
+bool MADSEngine::hasPendingKey() {
+	pollEvents();
+
+	return !_keyEvents.empty();
+}
+
+int MADSEngine::getKey() {
+	pollEvents();
+
+	if (!_keyEvents.empty()) {
+		Common::KeyState ks = _keyEvents.pop();
+		return ks.ascii && (ks.flags == 0) ? ks.ascii : (ks.flags << 16) | ks.keycode;
+	}
+
+	return 0;
+}
+
+void MADSEngine::flushKeys() {
+	pollEvents();
+
+	_keyEvents.clear();
+}
+
+int MADSEngine::getMouseState(int &x, int &y) {
+	pollEvents();
+
+	x = _mousePos.x;
+	y = _mousePos.y;
+	return _mouseButtons;
+}
+
+uint32 MADSEngine::getMillis() {
+	pollEvents();
+	return g_system->getMillis();
+}
+
+void MADSEngine::playSpeech(Audio::AudioStream *stream) {
+	_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream);
+}
+
+void MADSEngine::stopSpeech() {
+	_mixer->stopHandle(_speechHandle);
+}
+
+bool MADSEngine::isSpeechPlaying() const {
+	return _mixer->isSoundHandleActive(_speechHandle);
+}
+
+SaveStateList MADSEngine::listSaves() const {
+	return getMetaEngine()->listSaves(_targetName.c_str());
+}
+
+void MADSEngine::player_keep_walking() {
+	int at_x, at_y;
+	int walk_code;
+	int id;
+	int new_facing = false;
+	int temp_velocity;
+	int angle_scale;
+	int angle_range;
+
+	while (player.walking && !player.walk_off_edge && (player.x == player.target_x) && (player.y == player.target_y)) {
+		if (rail_solution_stack_pointer == 0) {
+			if (player.walk_off_edge_to_room) {
+				player.walk_off_edge = player.walk_off_edge_to_room;
+				player.walk_anywhere = true;
+				player.walk_off_edge_to_room = 0;
+				player.commands_allowed = false;
+				new_facing = false;
+			} else {
+				player.walking = false;
+				player_set_final_facing();
+				new_facing = true;
+			}
+		} else {
+			id = rail_solution_stack[--rail_solution_stack_pointer];
+			player.target_x = room->rail[id].x;
+			player.target_y = room->rail[id].y;
+			new_facing = true;
+		}
+	}
+
+	if (new_facing) {
+		if (player.walking) player_set_facing();
+	}
+
+	if (player.facing != player.turn_to_facing) {
+		player_keep_turning();
+	} else {
+		if (!player.walking) {
+			player_new_stop_walker();
+			player_activate_trigger();
+		}
+	}
+
+	temp_velocity = player.velocity;
+
+	if (player.scaling_velocity && (player.total_distance > 0)) {
+		angle_range = 100 - player.scale;
+		angle_scale = player.scale + ((angle_range * (player.x_count - 1)) / player.total_distance);
+		temp_velocity = (int)(((long)temp_velocity * ((long)player.scale * (long)angle_scale)) / 10000L);
+		temp_velocity = MAX(temp_velocity, 1);
+	}
+
+	if (player.walking && (player.facing == player.turn_to_facing)) {
+		at_x = player.x;
+		at_y = player.y;
+		walk_code = false;
+		player.special_code = 0;
+
+		if (player.dist_accum < temp_velocity) {
+
+			do {
+				if (player.pixel_accum < player.x_count) {
+					player.pixel_accum += player.y_count;
+				}
+				if (player.pixel_accum >= player.x_count) {
+					if ((player.y_counter > 0) || player.walk_off_edge) at_y += player.sign_y;
+					player.y_counter--;
+					player.pixel_accum -= player.x_count;
+				}
+				if (player.pixel_accum < player.x_count) {
+					if ((player.x_counter > 0) || player.walk_off_edge) at_x += player.sign_x;
+					player.x_counter--;
+				}
+
+				if (!player.walk_anywhere && !(player.walk_off_edge || player.walk_off_edge_to_room)) {
+					walk_code |= attr_walk(&scr_walk, at_x, at_y);
+					if (!player.special_code) {
+						player.special_code = (g_engine->getGameID() == GType_RexNebular) ?
+							rex_attr_special(&scr_special, at_x, at_y) :
+							attr_special(&scr_special, at_x, at_y);
+					}
+				}
+
+				player.dist_accum += player.delta_distance;
+			} while ((player.dist_accum < temp_velocity) && (!walk_code) &&
+				((player.x_counter > 0) || (player.y_counter > 0) || (player.walk_off_edge)));
+
+		}
+
+		player.dist_accum -= temp_velocity;
+
+		if (walk_code) {
+			player_cancel_command();
+		} else {
+			if (!player.walk_off_edge) {
+				if (player.x_counter <= 0) at_x = player.target_x;
+				if (player.y_counter <= 0) at_y = player.target_y;
+			}
+			player.x = at_x;
+			player.y = at_y;
+		}
+	}
 }
 
 int MADSEngine::getRandomNumber(int maxNumber) {
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index ada76f9b170..24539d4e439 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -19,16 +19,21 @@
  *
  */
 
-#ifndef MADS_MADS_H
-#define MADS_MADS_H
+#ifndef MADS_ENGINE_H
+#define MADS_ENGINE_H
 
-#include "common/scummsys.h"
-#include "common/system.h"
-#include "common/error.h"
+#include "audio/mixer.h"
+#include "common/events.h"
+#include "common/serializer.h"
+#include "common/stack.h"
 #include "common/random.h"
 #include "common/util.h"
 #include "engines/engine.h"
 #include "mads/detection.h"
+#include "graphics/screen.h"
+#include "mads/core/sound_manager.h"
+#include "mads/core/game.h"
+#include "mads/core/speech.h"
 
 namespace MADS {
 
@@ -59,16 +64,44 @@ enum MADSActions {
 	kActionRestartAnimation
 };
 
+typedef void (*TimerFunction)();
+
 class MADSEngine : public Engine {
+private:
+	uint16 _shakeRandom = 0x4D2;
+
+	void initGlobals();
+	void syncGame(Common::Serializer &s);
+	bool isSpecialKey(Common::KeyCode key) const;
+	void updateScreen();
+	
 protected:
 	const MADSGameDescription *_gameDescription;
 	Common::RandomSource _randomSource;
+	Graphics::Screen *_screen = nullptr;
+	Common::Stack<Common::KeyState> _keyEvents;
+	uint32 _nextFrameTime = 0;
+	Common::Point _mousePos;
+	int _mouseButtons = 0;
+	Audio::SoundHandle _speechHandle;
+	TimerFunction _timerFunction = nullptr;
+	uint32 _nextTimerTime = 0;
 
 	bool hasFeature(EngineFeature f) const override;
 
+	void pollEvents();
+	void checkForTimerFunction();
+
+public:
+	MADS::SoundManager *_soundManager = nullptr;
+	bool _musicFlag = true;
+	bool _soundFlag = true;
+	bool &_speechFlag = speech_on;
+
 public:
 	MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
 	~MADSEngine() override;
+	void initializePath(const Common::FSNode &gamePath) override;
 
 	uint32 getFeatures() const;
 	Common::Language getLanguage() const;
@@ -79,10 +112,72 @@ public:
 	bool isDemo() const;
 	bool isCDROM() const;
 
+	void readConfigFile();
 	int getRandomNumber(int maxNumber);
 	int getRandomNumber(int minNumber, int maxNumber);
+
+	Graphics::Screen *getScreen() const {
+		return _screen;
+	}
+
+	bool hasPendingKey();
+	int getKey();
+	void flushKeys();
+
+	int getMouseState(int &x, int &y);
+
+	/**
+	 * Get the elapsed time in milliseconds
+	 */
+	uint32 getMillis();
+
+	/* Callback routines in game-specific MAIN module */
+	int main_cheating_key(int mykey) const {
+		return mykey;
+	}
+	int main_normal_key(int mykey) const {
+		return mykey;
+	}
+	virtual int main_copy_verify() {
+		return COPY_SUCCEED;
+	}
+
+	bool canLoadGameStateCurrently(Common::U32String *msg) override;
+	bool canSaveGameStateCurrently(Common::U32String *msg) override {
+		return canLoadGameStateCurrently(msg);
+	}
+	Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override;
+	Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
+	virtual void syncRoom(Common::Serializer &s) = 0;
+	SaveStateList listSaves() const;
+
+	virtual void global_init_code() = 0;
+	virtual void section_music(int section_num) = 0;
+	virtual void global_section_constructor() = 0;
+	virtual void global_daemon_code() = 0;
+	virtual void global_pre_parser_code() = 0;
+	virtual void global_parser_code() = 0;
+	virtual void global_error_code() = 0;
+	virtual void global_room_init() = 0;
+	virtual void global_sound_driver() = 0;
+	virtual void global_game_main_loop() {}
+	virtual void global_verb_filter() {}
+	virtual void player_keep_walking();
+
+	void playSpeech(Audio::AudioStream *stream);
+	void stopSpeech();
+	bool isSpeechPlaying() const;
+
+	/**
+	 * Sets the timer function to call at 60Hz
+	 */
+	void setTimerFunction(TimerFunction fn) {
+		_timerFunction = fn;
+	}
 };
 
+extern MADSEngine *g_engine;
+
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 43650535b9d..f9c9f7a3803 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -2,7 +2,6 @@ MODULE := engines/mads
 
 MODULE_OBJS := \
 	console.o \
-	engine.o \
 	metaengine.o \
 	mads.o \
 	animview/anim_timer.o \
diff --git a/engines/mads/nebular/extra.cpp b/engines/mads/nebular/extra.cpp
index 7e33c62baa7..5271ef13599 100644
--- a/engines/mads/nebular/extra.cpp
+++ b/engines/mads/nebular/extra.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/attr.h"
 #include "mads/core/buffer.h"
 #include "mads/core/env.h"
diff --git a/engines/mads/nebular/main.cpp b/engines/mads/nebular/main.cpp
index 019eb62cf78..31c3257e28c 100644
--- a/engines/mads/nebular/main.cpp
+++ b/engines/mads/nebular/main.cpp
@@ -46,7 +46,7 @@
 #include "mads/core/video.h"
 #include "mads/nebular/main_menu.h"
 #include "mads/nebular/menus.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
diff --git a/engines/mads/nebular/main_menu.cpp b/engines/mads/nebular/main_menu.cpp
index a32fefa8e55..2040c394bf8 100644
--- a/engines/mads/nebular/main_menu.cpp
+++ b/engines/mads/nebular/main_menu.cpp
@@ -37,7 +37,7 @@
 #include "mads/nebular/main_menu.h"
 #include "mads/nebular/extra.h"
 #include "mads/nebular/mads/sounds.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
diff --git a/engines/mads/nebular/nebular.cpp b/engines/mads/nebular/nebular.cpp
index 8e433fffe92..cfa2c35f675 100644
--- a/engines/mads/nebular/nebular.cpp
+++ b/engines/mads/nebular/nebular.cpp
@@ -58,7 +58,7 @@ namespace MADS {
 namespace RexNebular {
 
 RexNebularEngine::RexNebularEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
-		MADSV2Engine(syst, gameDesc) {
+		MADSEngine(syst, gameDesc) {
 	// Initialize globals
 	RexNebular::popup_init();
 }
diff --git a/engines/mads/nebular/nebular.h b/engines/mads/nebular/nebular.h
index 37af6d48cb3..80a720c09c7 100644
--- a/engines/mads/nebular/nebular.h
+++ b/engines/mads/nebular/nebular.h
@@ -22,7 +22,7 @@
 #ifndef MADS_NEBULAR_H
 #define MADS_NEBULAR_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
@@ -39,7 +39,7 @@ struct MADSSavegameHeader {
 	void writeSavegameHeader(Common::WriteStream *dest);
 };
 
-class RexNebularEngine : public MADSV2Engine {
+class RexNebularEngine : public MADSEngine {
 private:
 	void showRecipe();
 
diff --git a/engines/mads/nebular/rooms/dialog.h b/engines/mads/nebular/rooms/dialog.h
index 93dd11b0699..d198af18381 100644
--- a/engines/mads/nebular/rooms/dialog.h
+++ b/engines/mads/nebular/rooms/dialog.h
@@ -22,7 +22,7 @@
 #ifndef MADS_NEBULAR_ROOMS_DIALOG_H
 #define MADS_NEBULAR_ROOMS_DIALOG_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
diff --git a/engines/mads/nebular/rooms/forcefield.cpp b/engines/mads/nebular/rooms/forcefield.cpp
index 33cc5446210..567ab1ef145 100644
--- a/engines/mads/nebular/rooms/forcefield.cpp
+++ b/engines/mads/nebular/rooms/forcefield.cpp
@@ -21,7 +21,7 @@
 
 #include "mads/nebular/rooms/forcefield.h"
 #include "mads/nebular/rooms/thunks.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
diff --git a/engines/mads/nebular/rooms/section3.cpp b/engines/mads/nebular/rooms/section3.cpp
index 225484af618..c1f2b271287 100644
--- a/engines/mads/nebular/rooms/section3.cpp
+++ b/engines/mads/nebular/rooms/section3.cpp
@@ -27,7 +27,7 @@
 #include "mads/core/kernel.h"
 #include "mads/core/pal.h"
 #include "mads/core/player.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace RexNebular {
diff --git a/engines/mads/phantom/main.cpp b/engines/mads/phantom/main.cpp
index 0e6bfec9c2d..6e8b47a736b 100644
--- a/engines/mads/phantom/main.cpp
+++ b/engines/mads/phantom/main.cpp
@@ -40,7 +40,7 @@
 #include "mads/core/speech.h"
 #include "mads/phantom/main_menu.h"
 #include "mads/phantom/menus.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Phantom {
diff --git a/engines/mads/phantom/main_menu.cpp b/engines/mads/phantom/main_menu.cpp
index 2d1c62cfb1c..3fd8c3fc266 100644
--- a/engines/mads/phantom/main_menu.cpp
+++ b/engines/mads/phantom/main_menu.cpp
@@ -19,7 +19,7 @@
  *
  */
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 #include "mads/core/general.h"
 #include "mads/core/config.h"
 #include "mads/core/font.h"
diff --git a/engines/mads/phantom/phantom.h b/engines/mads/phantom/phantom.h
index b4febde1803..b8ea6bc6a76 100644
--- a/engines/mads/phantom/phantom.h
+++ b/engines/mads/phantom/phantom.h
@@ -22,12 +22,12 @@
 #ifndef MADS_PHANTOM_PHANTOM_H
 #define MADS_PHANTOM_PHANTOM_H
 
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Phantom {
 
-class PhantomEngine : public MADSV2Engine {
+class PhantomEngine : public MADSEngine {
 private:
 	static void global_object_sprite();
 	static void stop_walker_basic();
@@ -36,7 +36,7 @@ private:
 
 public:
 	PhantomEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
-		MADSV2Engine(syst, gameDesc) {}
+		MADSEngine(syst, gameDesc) {}
 	~PhantomEngine() override {}
 
 	Common::Error run() override;
diff --git a/engines/mads/phantom/rooms/room102.cpp b/engines/mads/phantom/rooms/room102.cpp
index 60ec93dd2e2..f985b6fc633 100644
--- a/engines/mads/phantom/rooms/room102.cpp
+++ b/engines/mads/phantom/rooms/room102.cpp
@@ -29,7 +29,7 @@
 #include "mads/phantom/mads/sounds.h"
 #include "mads/phantom/rooms/section1.h"
 #include "mads/phantom/rooms/room102.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Phantom {
diff --git a/engines/mads/phantom/rooms/room202.cpp b/engines/mads/phantom/rooms/room202.cpp
index c6ef1ce3fbc..c4ca04e8554 100644
--- a/engines/mads/phantom/rooms/room202.cpp
+++ b/engines/mads/phantom/rooms/room202.cpp
@@ -37,7 +37,7 @@
 #include "mads/phantom/mads/text.h"
 #include "mads/phantom/rooms/section2.h"
 #include "mads/phantom/rooms/room202.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace Phantom {
diff --git a/engines/mads/textview/textview.cpp b/engines/mads/textview/textview.cpp
index d32fb759fb0..ac14145feb8 100644
--- a/engines/mads/textview/textview.cpp
+++ b/engines/mads/textview/textview.cpp
@@ -32,7 +32,7 @@
 #include "mads/core/timer.h"
 #include "mads/core/video.h"
 #include "mads/textview/textview.h"
-#include "mads/engine.h"
+#include "mads/mads.h"
 
 namespace MADS {
 namespace TextView {




More information about the Scummvm-git-logs mailing list