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

dreammaster noreply at scummvm.org
Mon Apr 27 12:13:38 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:
ca469bca5d MADS: NEBULAR: Move most of core/ to nebular/core/


Commit: ca469bca5d5cafe057bbc0370e1e4f869cfbe844
    https://github.com/scummvm/scummvm/commit/ca469bca5d5cafe057bbc0370e1e4f869cfbe844
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-04-27T22:13:27+10:00

Commit Message:
MADS: NEBULAR: Move most of core/ to nebular/core/

The bulk of the core/ folder which is refactored engine code
only used by the Rex Nebular sub-engine. As such, I've added
it to be under the Nebular sub-namespace, and moved it to
nebular/core/

Changed paths:
  A engines/mads/nebular/core/action.cpp
  A engines/mads/nebular/core/action.h
  A engines/mads/nebular/core/animation.cpp
  A engines/mads/nebular/core/animation.h
  A engines/mads/nebular/core/assets.cpp
  A engines/mads/nebular/core/assets.h
  A engines/mads/nebular/core/audio.cpp
  A engines/mads/nebular/core/audio.h
  A engines/mads/nebular/core/camera.cpp
  A engines/mads/nebular/core/camera.h
  A engines/mads/nebular/core/compression.cpp
  A engines/mads/nebular/core/compression.h
  A engines/mads/nebular/core/conversations.cpp
  A engines/mads/nebular/core/conversations.h
  A engines/mads/nebular/core/dialogs.cpp
  A engines/mads/nebular/core/dialogs.h
  A engines/mads/nebular/core/events.cpp
  A engines/mads/nebular/core/events.h
  A engines/mads/nebular/core/font.cpp
  A engines/mads/nebular/core/font.h
  A engines/mads/nebular/core/game.cpp
  A engines/mads/nebular/core/game.h
  A engines/mads/nebular/core/game_data.cpp
  A engines/mads/nebular/core/game_data.h
  A engines/mads/nebular/core/globals.cpp
  A engines/mads/nebular/core/globals.h
  A engines/mads/nebular/core/hag.cpp
  A engines/mads/nebular/core/hag.h
  A engines/mads/nebular/core/hotspots.cpp
  A engines/mads/nebular/core/hotspots.h
  A engines/mads/nebular/core/inventory.cpp
  A engines/mads/nebular/core/inventory.h
  A engines/mads/nebular/core/menu_views.cpp
  A engines/mads/nebular/core/menu_views.h
  A engines/mads/nebular/core/messages.cpp
  A engines/mads/nebular/core/messages.h
  A engines/mads/nebular/core/mps_installer.cpp
  A engines/mads/nebular/core/mps_installer.h
  A engines/mads/nebular/core/msurface.cpp
  A engines/mads/nebular/core/msurface.h
  A engines/mads/nebular/core/palette.cpp
  A engines/mads/nebular/core/palette.h
  A engines/mads/nebular/core/player.cpp
  A engines/mads/nebular/core/player.h
  A engines/mads/nebular/core/rails.cpp
  A engines/mads/nebular/core/rails.h
  A engines/mads/nebular/core/resources.cpp
  A engines/mads/nebular/core/resources.h
  A engines/mads/nebular/core/scene.cpp
  A engines/mads/nebular/core/scene.h
  A engines/mads/nebular/core/scene_data.cpp
  A engines/mads/nebular/core/scene_data.h
  A engines/mads/nebular/core/screen.cpp
  A engines/mads/nebular/core/screen.h
  A engines/mads/nebular/core/sequence.cpp
  A engines/mads/nebular/core/sequence.h
  A engines/mads/nebular/core/sprites.cpp
  A engines/mads/nebular/core/sprites.h
  A engines/mads/nebular/core/staticres.cpp
  A engines/mads/nebular/core/staticres.h
  A engines/mads/nebular/core/user_interface.cpp
  A engines/mads/nebular/core/user_interface.h
  R engines/mads/core/action.cpp
  R engines/mads/core/action.h
  R engines/mads/core/animation.cpp
  R engines/mads/core/animation.h
  R engines/mads/core/assets.cpp
  R engines/mads/core/assets.h
  R engines/mads/core/audio.cpp
  R engines/mads/core/audio.h
  R engines/mads/core/camera.cpp
  R engines/mads/core/camera.h
  R engines/mads/core/compression.cpp
  R engines/mads/core/compression.h
  R engines/mads/core/conversations.cpp
  R engines/mads/core/conversations.h
  R engines/mads/core/dialogs.cpp
  R engines/mads/core/dialogs.h
  R engines/mads/core/events.cpp
  R engines/mads/core/events.h
  R engines/mads/core/font.cpp
  R engines/mads/core/font.h
  R engines/mads/core/game.cpp
  R engines/mads/core/game.h
  R engines/mads/core/game_data.cpp
  R engines/mads/core/game_data.h
  R engines/mads/core/globals.cpp
  R engines/mads/core/globals.h
  R engines/mads/core/hag.cpp
  R engines/mads/core/hag.h
  R engines/mads/core/hotspots.cpp
  R engines/mads/core/hotspots.h
  R engines/mads/core/inventory.cpp
  R engines/mads/core/inventory.h
  R engines/mads/core/menu_views.cpp
  R engines/mads/core/menu_views.h
  R engines/mads/core/messages.cpp
  R engines/mads/core/messages.h
  R engines/mads/core/mps_installer.cpp
  R engines/mads/core/mps_installer.h
  R engines/mads/core/msurface.cpp
  R engines/mads/core/msurface.h
  R engines/mads/core/palette.cpp
  R engines/mads/core/palette.h
  R engines/mads/core/player.cpp
  R engines/mads/core/player.h
  R engines/mads/core/rails.cpp
  R engines/mads/core/rails.h
  R engines/mads/core/resources.cpp
  R engines/mads/core/resources.h
  R engines/mads/core/scene.cpp
  R engines/mads/core/scene.h
  R engines/mads/core/scene_data.cpp
  R engines/mads/core/scene_data.h
  R engines/mads/core/screen.cpp
  R engines/mads/core/screen.h
  R engines/mads/core/sequence.cpp
  R engines/mads/core/sequence.h
  R engines/mads/core/sprites.cpp
  R engines/mads/core/sprites.h
  R engines/mads/core/staticres.cpp
  R engines/mads/core/staticres.h
  R engines/mads/core/user_interface.cpp
  R engines/mads/core/user_interface.h
    engines/mads/core/sound.cpp
    engines/mads/metaengine.cpp
    engines/mads/module.mk
    engines/mads/nebular/debugger.cpp
    engines/mads/nebular/debugger.h
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/dialogs_nebular.h
    engines/mads/nebular/game_nebular.cpp
    engines/mads/nebular/game_nebular.h
    engines/mads/nebular/globals_nebular.h
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/menu_nebular.h
    engines/mads/nebular/nebular.cpp
    engines/mads/nebular/nebular.h
    engines/mads/nebular/nebular_scenes.cpp
    engines/mads/nebular/nebular_scenes.h
    engines/mads/nebular/nebular_scenes1.cpp
    engines/mads/nebular/nebular_scenes1.h
    engines/mads/nebular/nebular_scenes2.cpp
    engines/mads/nebular/nebular_scenes2.h
    engines/mads/nebular/nebular_scenes3.cpp
    engines/mads/nebular/nebular_scenes3.h
    engines/mads/nebular/nebular_scenes4.cpp
    engines/mads/nebular/nebular_scenes4.h
    engines/mads/nebular/nebular_scenes5.cpp
    engines/mads/nebular/nebular_scenes5.h
    engines/mads/nebular/nebular_scenes6.cpp
    engines/mads/nebular/nebular_scenes6.h
    engines/mads/nebular/nebular_scenes7.cpp
    engines/mads/nebular/nebular_scenes7.h
    engines/mads/nebular/nebular_scenes8.cpp
    engines/mads/nebular/nebular_scenes8.h


diff --git a/engines/mads/core/sound.cpp b/engines/mads/core/sound.cpp
index 78a1013889e..5f9387d1ed6 100644
--- a/engines/mads/core/sound.cpp
+++ b/engines/mads/core/sound.cpp
@@ -22,8 +22,6 @@
 #include "audio/fmopl.h"
 #include "common/memstream.h"
 #include "mads/core/sound.h"
-#include "mads/nebular/nebular.h"
-#include "mads/nebular/sound_nebular.h"
 
 namespace Audio {
 class Mixer;
diff --git a/engines/mads/metaengine.cpp b/engines/mads/metaengine.cpp
index f358e3c348f..56dea28a691 100644
--- a/engines/mads/metaengine.cpp
+++ b/engines/mads/metaengine.cpp
@@ -36,8 +36,8 @@
 #include "common/translation.h"
 #include "graphics/surface.h"
 
-#include "mads/core/events.h"
-#include "mads/core/game.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/game.h"
 #include "mads/detection.h"
 #ifdef ENABLE_MADSV2
 #include "mads/madsv2/phantom/phantom.h"
@@ -227,7 +227,7 @@ Common::Error MADSMetaEngine::createInstance(OSystem *syst, Engine **engine, con
 	else
 #endif
 
-	*engine = new MADS::RexNebularEngine(syst,desc);
+	*engine = new MADS::Nebular::RexNebularEngine(syst,desc);
 	return Common::kNoError;
 }
 
@@ -239,7 +239,7 @@ SaveStateList MADSMetaEngine::listSaves(const char *target) const {
 	Common::StringArray filenames;
 	Common::String saveDesc;
 	Common::String pattern = Common::String::format("%s.0##", target);
-	MADS::MADSSavegameHeader header;
+	MADS::Nebular::MADSSavegameHeader header;
 
 	filenames = saveFileMan->listSavefiles(pattern);
 
@@ -252,7 +252,7 @@ SaveStateList MADSMetaEngine::listSaves(const char *target) const {
 			Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
 
 			if (in) {
-				if (MADS::Game::readSavegameHeader(in, header))
+				if (MADS::Nebular::Game::readSavegameHeader(in, header))
 					saveList.push_back(SaveStateDescriptor(this, slot, header._saveName));
 				delete in;
 			}
@@ -285,8 +285,8 @@ SaveStateDescriptor MADSMetaEngine::querySaveMetaInfos(const char *target, int s
 	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(filename);
 
 	if (f) {
-		MADS::MADSSavegameHeader header;
-		if (!MADS::Game::readSavegameHeader(f, header, false)) {
+		MADS::Nebular::MADSSavegameHeader header;
+		if (!MADS::Nebular::Game::readSavegameHeader(f, header, false)) {
 			delete f;
 			return SaveStateDescriptor();
 		}
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 2c841d37102..ee122aec664 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -1,6 +1,7 @@
 MODULE := engines/mads
 
 MODULE_OBJS := \
+	core/sound.o \
 	nebular/nebular.o \
 	nebular/debugger.o \
 	nebular/dialogs_nebular.o \
@@ -17,38 +18,37 @@ MODULE_OBJS := \
 	nebular/nebular_scenes6.o \
 	nebular/nebular_scenes7.o \
 	nebular/nebular_scenes8.o \
-	core/action.o \
-	core/animation.o \
-	core/assets.o \
-	core/audio.o \
-	core/camera.o \
-	core/compression.o \
-	core/conversations.o \
-	core/dialogs.o \
-	core/events.o \
-	core/font.o \
-	core/game.o \
-	core/game_data.o \
-	core/globals.o \
-	core/hag.o \
-	core/hotspots.o \
-	core/inventory.o \
-	core/menu_views.o \
-	core/messages.o \
-	core/msurface.o \
-	core/mps_installer.o \
-	core/palette.o \
-	core/player.o \
-	core/rails.o \
-	core/resources.o \
-	core/scene.o \
-	core/scene_data.o \
-	core/screen.o \
-	core/sequence.o \
-	core/sound.o \
-	core/sprites.o \
-	core/staticres.o \
-	core/user_interface.o \
+	nebular/core/action.o \
+	nebular/core/animation.o \
+	nebular/core/assets.o \
+	nebular/core/audio.o \
+	nebular/core/camera.o \
+	nebular/core/compression.o \
+	nebular/core/conversations.o \
+	nebular/core/dialogs.o \
+	nebular/core/events.o \
+	nebular/core/font.o \
+	nebular/core/game.o \
+	nebular/core/game_data.o \
+	nebular/core/globals.o \
+	nebular/core/hag.o \
+	nebular/core/hotspots.o \
+	nebular/core/inventory.o \
+	nebular/core/menu_views.o \
+	nebular/core/messages.o \
+	nebular/core/msurface.o \
+	nebular/core/mps_installer.o \
+	nebular/core/palette.o \
+	nebular/core/player.o \
+	nebular/core/rails.o \
+	nebular/core/resources.o \
+	nebular/core/scene.o \
+	nebular/core/scene_data.o \
+	nebular/core/screen.o \
+	nebular/core/sequence.o \
+	nebular/core/sprites.o \
+	nebular/core/staticres.o \
+	nebular/core/user_interface.o \
 	metaengine.o \
 	mads.o
 
diff --git a/engines/mads/core/action.cpp b/engines/mads/nebular/core/action.cpp
similarity index 96%
rename from engines/mads/core/action.cpp
rename to engines/mads/nebular/core/action.cpp
index 2fefb25c5e2..0a8b07c5763 100644
--- a/engines/mads/core/action.cpp
+++ b/engines/mads/nebular/core/action.cpp
@@ -20,13 +20,14 @@
  */
 
 #include "mads/nebular/nebular.h"
-#include "mads/core/action.h"
-#include "mads/core/inventory.h"
-#include "mads/core/resources.h"
-#include "mads/core/scene.h"
-#include "mads/core/staticres.h"
+#include "mads/nebular/core/action.h"
+#include "mads/nebular/core/inventory.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/staticres.h"
 
 namespace MADS {
+namespace Nebular {
 
 void ActionDetails::synchronize(Common::Serializer &s) {
 	s.syncAsUint16LE(_verbId);
@@ -134,7 +135,7 @@ void MADSAction::set() {
 	} else {
 		bool flag = false;
 		if ((_commandSource == CAT_INV_VOCAB) && (_selectedRow >= 0)
-				&& (_verbType == VERB_THAT) && (_prepType == PREP_NONE)) {
+			&& (_verbType == VERB_THAT) && (_prepType == PREP_NONE)) {
 			// Use/to action
 			int invIndex = userInterface._selectedInvIndex;
 			InventoryObject &objEntry = _vm->_game->_objects.getItem(invIndex);
@@ -283,7 +284,7 @@ void MADSAction::refresh() {
 
 	if (!_statusText.empty()) {
 		if ((_vm->_game->_screenObjects._inputMode == kInputBuildingSentences) ||
-				(_vm->_game->_screenObjects._inputMode == kInputLimitedSentences)) {
+			(_vm->_game->_screenObjects._inputMode == kInputLimitedSentences)) {
 			Font *font = _vm->_font->getFont(FONT_MAIN);
 			int textSpacing = -1;
 
@@ -404,7 +405,7 @@ void MADSAction::checkActionAtMousePos() {
 	UserInterface &userInterface = scene._userInterface;
 
 	if ((userInterface._category == CAT_COMMAND || userInterface._category == CAT_INV_VOCAB) &&
-			_interAwaiting != AWAITING_COMMAND && _pickedWord >= 0) {
+		_interAwaiting != AWAITING_COMMAND && _pickedWord >= 0) {
 		if (_recentCommandSource == userInterface._category || _recentCommand != _pickedWord ||
 			(_interAwaiting != AWAITING_THIS && _interAwaiting != 3))
 			clear();
@@ -443,7 +444,7 @@ void MADSAction::checkActionAtMousePos() {
 					_articleNumber = _prepType;
 
 					if ((_verbType == VERB_THIS && _prepType == PREP_NONE) ||
-							(_verbType == VERB_THAT && _prepType != PREP_NONE))
+						(_verbType == VERB_THAT && _prepType != PREP_NONE))
 						_interAwaiting = AWAITING_RIGHT_MOUSE;
 					else
 						_interAwaiting = AWAITING_THAT;
@@ -543,8 +544,8 @@ void MADSAction::leftClick() {
 
 	if ((userInterface._category == CAT_COMMAND || userInterface._category == CAT_INV_VOCAB) &&
 		_interAwaiting != 1 && _pickedWord >= 0 &&
-			_recentCommandSource == userInterface._category && _recentCommand == _pickedWord &&
-			(_interAwaiting == 2 || userInterface._category == CAT_INV_VOCAB)) {
+		_recentCommandSource == userInterface._category && _recentCommand == _pickedWord &&
+		(_interAwaiting == 2 || userInterface._category == CAT_INV_VOCAB)) {
 		abortFlag = true;
 		if (_selectedRow == 0 && userInterface._category == CAT_COMMAND) {
 			_selectedAction = CAT_COMMAND;
@@ -557,7 +558,7 @@ void MADSAction::leftClick() {
 	}
 
 	if (abortFlag || (_vm->_events->_rightMousePressed && (userInterface._category == CAT_COMMAND ||
-			userInterface._category == CAT_INV_VOCAB)))
+		userInterface._category == CAT_INV_VOCAB)))
 		return;
 
 	switch (_interAwaiting) {
@@ -702,4 +703,5 @@ void MADSAction::synchronize(Common::Serializer &s) {
 	s.syncAsByte(_inProgress);
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/action.h b/engines/mads/nebular/core/action.h
similarity index 95%
rename from engines/mads/core/action.h
rename to engines/mads/nebular/core/action.h
index 2aea5595160..109b0174b81 100644
--- a/engines/mads/core/action.h
+++ b/engines/mads/nebular/core/action.h
@@ -26,6 +26,7 @@
 #include "common/str.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum TriggerMode {
 	SEQUENCE_TRIGGER_NONE = -1,
@@ -57,7 +58,9 @@ enum {
 	VERB_WALKTO = 13
 };
 
-enum VerbType { VERB_ONLY, VERB_THIS, VERB_THAT, VERB_INIT };
+enum VerbType {
+	VERB_ONLY, VERB_THIS, VERB_THAT, VERB_INIT
+};
 
 enum PrepType {
 	PREP_NONE, PREP_WITH, PREP_TO, PREP_AT, PREP_FROM, PREP_ON, PREP_IN,
@@ -138,7 +141,9 @@ public:
 
 	void clear();
 	void set();
-	const Common::String &statusText() const { return _statusText; }
+	const Common::String &statusText() const {
+		return _statusText;
+	}
 	void refresh();
 
 	/**
@@ -170,6 +175,7 @@ public:
 	void synchronize(Common::Serializer &s);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_ACTION_H */
+#endif
diff --git a/engines/mads/core/animation.cpp b/engines/mads/nebular/core/animation.cpp
similarity index 98%
rename from engines/mads/core/animation.cpp
rename to engines/mads/nebular/core/animation.cpp
index 316c427b29f..52cce24d5be 100644
--- a/engines/mads/core/animation.cpp
+++ b/engines/mads/nebular/core/animation.cpp
@@ -19,13 +19,14 @@
  *
  */
 
-#include "mads/core/animation.h"
-#include "mads/core/compression.h"
+#include "mads/nebular/core/animation.h"
+#include "mads/nebular/core/compression.h"
 #include "mads/nebular/nebular.h"
 
 #define FILENAME_SIZE 13
 
 namespace MADS {
+namespace Nebular {
 
 void AAHeader::load(Common::SeekableReadStream *f) {
 	_spriteSetsCount = f->readUint16LE();
@@ -194,8 +195,8 @@ Animation::~Animation() {
 }
 
 void Animation::load(MSurface &backSurface, DepthSurface &depthSurface,
-		const Common::Path &resName, int flags, Common::Array<PaletteCycle> *palCycles,
-		SceneInfo *sceneInfo) {
+	const Common::Path &resName, int flags, Common::Array<PaletteCycle> *palCycles,
+	SceneInfo *sceneInfo) {
 	Common::Path resourceName = resName;
 	if (!resourceName.baseName().contains("."))
 		resourceName.appendInPlace(".AA");
@@ -389,7 +390,7 @@ bool Animation::drawFrame(SpriteAsset &spriteSet, const Common::Point &pt, int f
 }
 
 void Animation::loadBackground(MSurface &backSurface, DepthSurface &depthSurface,
-		AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo) {
+	AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo) {
 	_scene->_depthStyle = 0;
 	if (header._bgType <= ANIMBG_FULL_SIZE) {
 		if (!sceneInfo) {
@@ -628,4 +629,6 @@ Common::Point Animation::getFramePosAdjust(int idx) {
 
 	return Common::Point(0, 0);
 }
+
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/animation.h b/engines/mads/nebular/core/animation.h
similarity index 85%
rename from engines/mads/core/animation.h
rename to engines/mads/nebular/core/animation.h
index 4cfc883ce9f..f0749ce3e6f 100644
--- a/engines/mads/core/animation.h
+++ b/engines/mads/nebular/core/animation.h
@@ -24,19 +24,20 @@
 
 #include "common/array.h"
 #include "common/rect.h"
-#include "mads/core/msurface.h"
-#include "mads/core/scene_data.h"
-#include "mads/core/font.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/scene_data.h"
+#include "mads/nebular/core/font.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum AnimFlag {
-	ANIMFLAG_LOAD_BACKGROUND	  = 0x0100,	// Load background
+	ANIMFLAG_LOAD_BACKGROUND = 0x0100,	// Load background
 	ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200,	// Load background only
 
-	ANIMFLAG_DITHER				  = 0x0001,	// Dither to 16 colors
-	ANIMFLAG_CUSTOM_FONT		  = 0x2000,	// Load custom fonts
-	ANIMFLAG_ANIMVIEW			  = 0x4000	// Cutscene animation
+	ANIMFLAG_DITHER = 0x0001,	// Dither to 16 colors
+	ANIMFLAG_CUSTOM_FONT = 0x2000,	// Load custom fonts
+	ANIMFLAG_ANIMVIEW = 0x4000	// Cutscene animation
 };
 
 enum AnimBgType {
@@ -226,20 +227,33 @@ public:
 	void eraseSprites();
 
 	void setNextFrameTimer(uint32 newTimer);
-	uint32 getNextFrameTimer() const { return _nextFrameTimer; }
+	uint32 getNextFrameTimer() const {
+		return _nextFrameTimer;
+	}
 	void setCurrentFrame(int frameNumber);
-	int getCurrentFrame() const { return _currentFrame; }
+	int getCurrentFrame() const {
+		return _currentFrame;
+	}
 
-	bool freeFlag() const { return _freeFlag; }
-	int roomNumber() const { return _header._roomNumber; }
+	bool freeFlag() const {
+		return _freeFlag;
+	}
+	int roomNumber() const {
+		return _header._roomNumber;
+	}
 
-	void resetSpriteSetsCount() { _header._spriteSetsCount = 0; } // CHECKME: See if it doesn't leak the memory when the destructor is called
+	void resetSpriteSetsCount() {
+		_header._spriteSetsCount = 0;
+	} // CHECKME: See if it doesn't leak the memory when the destructor is called
 
-	SpriteAsset *getSpriteSet(int idx) { return _spriteSets[idx]; }
+	SpriteAsset *getSpriteSet(int idx) {
+		return _spriteSets[idx];
+	}
 
 	Common::Point getFramePosAdjust(int idx);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_ANIMATION_H */
+#endif
diff --git a/engines/mads/core/assets.cpp b/engines/mads/nebular/core/assets.cpp
similarity index 94%
rename from engines/mads/core/assets.cpp
rename to engines/mads/nebular/core/assets.cpp
index 4553e876657..84f12d18e66 100644
--- a/engines/mads/core/assets.cpp
+++ b/engines/mads/nebular/core/assets.cpp
@@ -20,12 +20,13 @@
  */
 
 #include "mads/nebular/nebular.h"
-#include "mads/core/assets.h"
-#include "mads/core/compression.h"
-#include "mads/core/palette.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/palette.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 SpriteAsset::SpriteAsset(RexNebularEngine *vm, const Common::Path &resourceName, int flags) : _vm(vm) {
 	Common::Path resName = resourceName;
@@ -147,14 +148,14 @@ void SpriteAsset::load(Common::SeekableReadStream *stream, int flags) {
 		frameSizes.push_back(frameSize);
 
 		frame._bounds.left = spriteStream->readSint16LE();
-		frame._bounds.top  = spriteStream->readSint16LE();
+		frame._bounds.top = spriteStream->readSint16LE();
 		frame._bounds.setWidth(spriteStream->readUint16LE());
 		frame._bounds.setHeight(spriteStream->readUint16LE());
 
 		if (curFrame == 0)
 			debugC(1, kDebugGraphics, "%i frames, x = %i, y = %i, w = %i, h = %i\n",
-			_frameCount, frame._bounds.left, frame._bounds.top,
-			frame._bounds.width(), frame._bounds.height());
+				_frameCount, frame._bounds.left, frame._bounds.top,
+				frame._bounds.width(), frame._bounds.height());
 
 		if (_mode == 0) {
 			// Create a frame and decompress the raw pixel data
@@ -224,4 +225,5 @@ SpriteSetCharInfo::SpriteSetCharInfo(Common::SeekableReadStream *s) {
 	_centerOfGravity = s->readByte();
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/assets.h b/engines/mads/nebular/core/assets.h
similarity index 73%
rename from engines/mads/core/assets.h
rename to engines/mads/nebular/core/assets.h
index 59d2c13a6b5..9aace16fd52 100644
--- a/engines/mads/core/assets.h
+++ b/engines/mads/nebular/core/assets.h
@@ -25,9 +25,10 @@
 #include "common/array.h"
 #include "common/path.h"
 #include "common/rect.h"
-#include "mads/core/palette.h"
+#include "mads/nebular/core/palette.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum AssetFlags {
 	ASSET_TRANSLATE = 1, ASSET_HEADER_ONLY = 2, ASSET_CHAR_INFO = 4,
@@ -97,20 +98,43 @@ public:
 	 */
 	~SpriteAsset();
 
-	int getCount() { return _frameCount; }
-	int getFrameRate() const { return _frameRate; }
-	int getPixelSpeed() const { return _pixelSpeed; }
-	Common::Point getFramePos(int index) { assert (index < _frameCount); return Common::Point(_frames[index]._bounds.left, _frames[index]._bounds.top); }
-	int getFrameWidth(int index) { assert (index < _frameCount); return _frames[index]._bounds.width(); }
-	int getFrameHeight(int index) { assert (index < _frameCount); return _frames[index]._bounds.height(); }
-	int getMaxFrameWidth() const { return _maxWidth; }
-	int getMaxFrameHeight() const { return _maxHeight; }
+	int getCount() {
+		return _frameCount;
+	}
+	int getFrameRate() const {
+		return _frameRate;
+	}
+	int getPixelSpeed() const {
+		return _pixelSpeed;
+	}
+	Common::Point getFramePos(int index) {
+		assert(index < _frameCount); return Common::Point(_frames[index]._bounds.left, _frames[index]._bounds.top);
+	}
+	int getFrameWidth(int index) {
+		assert(index < _frameCount); return _frames[index]._bounds.width();
+	}
+	int getFrameHeight(int index) {
+		assert(index < _frameCount); return _frames[index]._bounds.height();
+	}
+	int getMaxFrameWidth() const {
+		return _maxWidth;
+	}
+	int getMaxFrameHeight() const {
+		return _maxHeight;
+	}
 	MSprite *getFrame(int frameIndex);
-	byte *getPalette() { return _palette; }
-	int getColorCount() { return _colorCount; }
-	bool isBackground() const { return _isBackground; }
+	byte *getPalette() {
+		return _palette;
+	}
+	int getColorCount() {
+		return _colorCount;
+	}
+	bool isBackground() const {
+		return _isBackground;
+	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_ASSETS_H */
+#endif
diff --git a/engines/mads/core/audio.cpp b/engines/mads/nebular/core/audio.cpp
similarity index 91%
rename from engines/mads/core/audio.cpp
rename to engines/mads/nebular/core/audio.cpp
index 0266d4e3e69..999fe696cbe 100644
--- a/engines/mads/core/audio.cpp
+++ b/engines/mads/nebular/core/audio.cpp
@@ -19,8 +19,8 @@
  *
  */
 
-#include "mads/core/audio.h"
-#include "mads/core/compression.h"
+#include "mads/nebular/core/audio.h"
+#include "mads/nebular/core/compression.h"
 #include "mads/detection.h"
 #include "common/stream.h"
 #include "audio/audiostream.h"
@@ -28,6 +28,7 @@
 #include "audio/decoders/raw.h"
 
 namespace MADS {
+namespace Nebular {
 
 AudioPlayer::AudioPlayer(Audio::Mixer *mixer, uint32 gameID) : _mixer(mixer), _gameID(gameID) {
 	setVolume(Audio::Mixer::kMaxChannelVolume);
@@ -98,7 +99,7 @@ void AudioPlayer::playSound(int soundIndex, bool loop) {
 		return;
 	}
 
-	if (soundIndex < 0 || soundIndex > (int)_dsrEntries.size() - 1) {
+	if (soundIndex < 0 || soundIndex >(int)_dsrEntries.size() - 1) {
 		warning("Invalid sound index: %i (max %i), not playing sound", soundIndex, _dsrEntries.size() - 1);
 		return;
 	}
@@ -120,9 +121,9 @@ void AudioPlayer::playSound(int soundIndex, bool loop) {
 
 	// Play sound
 	Audio::AudioStream *stream = Audio::makeLoopingAudioStream(
-				Audio::makeRawStream(buffer, uncompSize, frequency, Audio::FLAG_UNSIGNED),
-				loop ? 0 : 1);
-	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_handle, stream, -1,  Audio::Mixer::kMaxChannelVolume);
+		Audio::makeRawStream(buffer, uncompSize, frequency, Audio::FLAG_UNSIGNED),
+		loop ? 0 : 1);
+	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_handle, stream, -1, Audio::Mixer::kMaxChannelVolume);
 
 	/*
 	// Dump the sound file
@@ -136,4 +137,5 @@ void AudioPlayer::stop() {
 	_mixer->stopHandle(_handle);
 }
 
-} // namespace M4
+} // namespace Nebular
+} // namespace MADS
diff --git a/engines/mads/core/audio.h b/engines/mads/nebular/core/audio.h
similarity index 94%
rename from engines/mads/core/audio.h
rename to engines/mads/nebular/core/audio.h
index cef2a8ad081..9b0fc8cf3ef 100644
--- a/engines/mads/core/audio.h
+++ b/engines/mads/nebular/core/audio.h
@@ -22,12 +22,13 @@
 #ifndef MADS_AUDIO_H
 #define MADS_AUDIO_H
 
-#include "mads/core/resources.h"
+#include "mads/nebular/core/resources.h"
 
 #include "common/array.h"
 #include "audio/mixer.h"
 
 namespace MADS {
+namespace Nebular {
 
 struct DSREntry {
 	int16 frequency;
@@ -49,7 +50,7 @@ public:
 	void setVolume(int volume);
 	bool isPlaying() const;
 
- private:
+private:
 	Audio::Mixer *_mixer;
 	Audio::SoundHandle _handle;
 	uint32 _gameID;
@@ -59,6 +60,7 @@ public:
 	Common::Array<DSREntry> _dsrEntries;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/camera.cpp b/engines/mads/nebular/core/camera.cpp
similarity index 96%
rename from engines/mads/core/camera.cpp
rename to engines/mads/nebular/core/camera.cpp
index 48d20face99..3c8208e6d61 100644
--- a/engines/mads/core/camera.cpp
+++ b/engines/mads/nebular/core/camera.cpp
@@ -20,9 +20,10 @@
  */
 
 #include "mads/nebular/nebular.h"
-#include "mads/core/camera.h"
+#include "mads/nebular/core/camera.h"
 
 namespace MADS {
+namespace Nebular {
 
 Camera::Camera(RexNebularEngine *vm) : _vm(vm) {
 	_panAllowedFl = false;
@@ -91,7 +92,7 @@ bool Camera::camPan(int16 *picture_view, int16 *player_loc, int display_size, in
 		_currentFrameFl = false;
 
 		uint32 timer;
-		if ((abs((int32) (_timer - player._priorTimer)) < _rate) && (player._ticksAmount == _rate))
+		if ((abs((int32)(_timer - player._priorTimer)) < _rate) && (player._ticksAmount == _rate))
 			timer = player._priorTimer;
 		else
 			timer = _timer;
@@ -188,4 +189,5 @@ bool Camera::camPan(int16 *picture_view, int16 *player_loc, int display_size, in
 	return (panningFl);
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/camera.h b/engines/mads/nebular/core/camera.h
similarity index 89%
rename from engines/mads/core/camera.h
rename to engines/mads/nebular/core/camera.h
index 56939245fbc..ab27b01d52c 100644
--- a/engines/mads/core/camera.h
+++ b/engines/mads/nebular/core/camera.h
@@ -22,11 +22,12 @@
 #ifndef MADS_CAMERA_H
 #define MADS_CAMERA_H
 
-#include "mads/core/scene.h"
-#include "mads/core/player.h"
-#include "mads/core/camera.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/player.h"
+#include "mads/nebular/core/camera.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
@@ -57,6 +58,7 @@ public:
 	void setDefaultPanY();
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_CAMERA_H */
+#endif
diff --git a/engines/mads/core/compression.cpp b/engines/mads/nebular/core/compression.cpp
similarity index 92%
rename from engines/mads/core/compression.cpp
rename to engines/mads/nebular/core/compression.cpp
index 775d74bc425..fcdf007236d 100644
--- a/engines/mads/core/compression.cpp
+++ b/engines/mads/nebular/core/compression.cpp
@@ -19,10 +19,11 @@
  *
  */
 
-#include "mads/core/compression.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 const char *const madsPackString = "MADSPACK";
 const char *const FabInputExceededError = "FabDecompressor - Passed end of input buffer during decompression";
@@ -79,15 +80,16 @@ void MadsPack::initialize(Common::SeekableReadStream *stream) {
 			_items[i]._data = sourceData;
 			break;
 
-		case COMPRESS_FAB: {
-				// Decompress the entry
-				_items[i]._data = new byte[_items[i]._size];
+		case COMPRESS_FAB:
+		{
+			// Decompress the entry
+			_items[i]._data = new byte[_items[i]._size];
 
-				FabDecompressor fab;
-				fab.decompress(sourceData, _items[i]._compressedSize, _items[i]._data, _items[i]._size);
-				delete[] sourceData;
-				break;
-			}
+			FabDecompressor fab;
+			fab.decompress(sourceData, _items[i]._compressedSize, _items[i]._data, _items[i]._size);
+			delete[] sourceData;
+			break;
+		}
 
 		default:
 			error("Unknown compression type encountered");
@@ -191,4 +193,5 @@ int FabDecompressor::getBit() {
 	return bit;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/compression.h b/engines/mads/nebular/core/compression.h
similarity index 90%
rename from engines/mads/core/compression.h
rename to engines/mads/nebular/core/compression.h
index 1cc8891dece..992b847ab76 100644
--- a/engines/mads/core/compression.h
+++ b/engines/mads/nebular/core/compression.h
@@ -27,10 +27,13 @@
 #include "common/stream.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
-enum CompressionType { COMPRESS_NONE = 0, COMPRESS_FAB = 1 };
+enum CompressionType {
+	COMPRESS_NONE = 0, COMPRESS_FAB = 1
+};
 
 struct MadsPackEntry {
 public:
@@ -54,10 +57,13 @@ public:
 	MadsPack(const Common::Path &resourceName, RexNebularEngine *_vm);
 	~MadsPack();
 
-	int getCount() const { return _count; }
+	int getCount() const {
+		return _count;
+	}
 	MadsPackEntry &getItem(int index) const {
 		assert(index < _count);
-		return _items[index]; }
+		return _items[index];
+	}
 	MadsPackEntry &operator[](int index) const {
 		assert(index < _count);
 		return _items[index];
@@ -67,7 +73,9 @@ public:
 		return new Common::MemoryReadStream(_items[index]._data, _items[index]._size,
 			DisposeAfterUse::NO);
 	}
-	int getDataOffset() const { return _dataOffset; }
+	int getDataOffset() const {
+		return _dataOffset;
+	}
 };
 
 class FabDecompressor {
@@ -82,6 +90,7 @@ public:
 	void decompress(const byte *srcData, int srcSize, byte *destData, int destSize);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/conversations.cpp b/engines/mads/nebular/core/conversations.cpp
similarity index 98%
rename from engines/mads/core/conversations.cpp
rename to engines/mads/nebular/core/conversations.cpp
index abc509b5550..f6321b176ba 100644
--- a/engines/mads/core/conversations.cpp
+++ b/engines/mads/nebular/core/conversations.cpp
@@ -19,13 +19,14 @@
  *
  */
 
-#include "mads/core/conversations.h"
+#include "mads/nebular/core/conversations.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
+#include "mads/nebular/core/compression.h"
 #include "common/file.h"
 #include "common/util.h"	// for Common::hexdump
 
 namespace MADS {
+namespace Nebular {
 
 GameConversations::GameConversations(RexNebularEngine *vm) : _vm(vm) {
 	_runningConv = nullptr;
@@ -511,7 +512,8 @@ int GameConversations::executeEntry(int index) {
 			flag = !scriptNode(scrEntry);
 			break;
 
-		case CMD_GOTO: {
+		case CMD_GOTO:
+		{
 			bool gotoFlag = scrEntry._conditionals[0].evaluate();
 			if (gotoFlag) {
 				scriptIdx = scrEntry._index;
@@ -520,7 +522,8 @@ int GameConversations::executeEntry(int index) {
 			break;
 		}
 
-		case CMD_ASSIGN: {
+		case CMD_ASSIGN:
+		{
 			bool setFlag = scrEntry._conditionals[0].evaluate();
 			if (setFlag) {
 				int *ptr = _runningConv->_cnd._vars[scrEntry._index].getValue();
@@ -571,8 +574,7 @@ void GameConversations::scriptMessage(ScriptEntry &scrEntry) {
 		if (scrEntry._entries2.size() <= 1) {
 			for (uint idx = 0; idx < scrEntry._entries.size(); ++idx)
 				_runningConv->_cnd._actorSpeechList.push_back(scrEntry._entries[idx]);
-		}
-		else if (scrEntry._entries.size() > 0 && randomIndex < (int)scrEntry._entries.size()) {
+		} else if (scrEntry._entries.size() > 0 && randomIndex < (int)scrEntry._entries.size()) {
 			_runningConv->_cnd._actorSpeechList.push_back(entryVal);
 		}
 	} else {
@@ -895,7 +897,8 @@ void ScriptEntry::load(Common::SeekableReadStream &s) {
 	switch (_command) {
 	case CMD_1:
 	case CMD_HIDE:
-	case CMD_UNHIDE: {
+	case CMD_UNHIDE:
+	{
 		// Read in the list of entries whose flags are to be updated
 		int count = s.readByte();
 		for (int idx = 0; idx < count; ++idx)
@@ -904,7 +907,8 @@ void ScriptEntry::load(Common::SeekableReadStream &s) {
 	}
 
 	case CMD_MESSAGE1:
-	case CMD_MESSAGE2: {
+	case CMD_MESSAGE2:
+	{
 		int count2 = s.readByte();
 		int count1 = s.readByte();
 		_entries2.resize(count2);
@@ -1016,7 +1020,5 @@ int ScriptEntry::Conditional::get(int paramNum) const {
 	return p._isVariable ? *(*_vars)[p._val].getValue() : p._val;
 }
 
-/*------------------------------------------------------------------------*/
-
-
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/conversations.h b/engines/mads/nebular/core/conversations.h
similarity index 91%
rename from engines/mads/core/conversations.h
rename to engines/mads/nebular/core/conversations.h
index ec48f4660c6..d2adcf77023 100644
--- a/engines/mads/core/conversations.h
+++ b/engines/mads/nebular/core/conversations.h
@@ -25,10 +25,11 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/str-array.h"
-#include "mads/core/screen.h"
-#include "mads/core/dialogs.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/dialogs.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define MAX_CONVERSATIONS 5
 #define MAX_SPEAKERS 5
@@ -97,7 +98,8 @@ struct ConversationVar {
 	/**
 	 * Constructor
 	 */
-	ConversationVar() : _isPtr(false), _val(0), _valPtr(nullptr) {}
+	ConversationVar() : _isPtr(false), _val(0), _valPtr(nullptr) {
+	}
 
 	/**
 	 * Sets a numeric value
@@ -112,17 +114,23 @@ struct ConversationVar {
 	/**
 	 * Return either the variable's pointer, or a pointer to it's direct value
 	 */
-	int *getValue() { return _isPtr ? _valPtr : &_val; }
+	int *getValue() {
+		return _isPtr ? _valPtr : &_val;
+	}
 
 	/**
 	 * Returns true if variable is a pointer
 	 */
-	bool isPtr() const { return _isPtr; }
+	bool isPtr() const {
+		return _isPtr;
+	}
 
 	/**
 	 * Returns true if variable is numeric
 	 */
-	bool isNumeric() const { return !_isPtr; }
+	bool isNumeric() const {
+		return !_isPtr;
+	}
 };
 
 struct ScriptEntry {
@@ -134,7 +142,8 @@ struct ScriptEntry {
 			/**
 			 * Constructor
 			 */
-			CondtionalParamEntry() : _isVariable(false), _val(0) {}
+			CondtionalParamEntry() : _isVariable(false), _val(0) {
+			}
 		};
 
 		static Common::Array<ConversationVar> *_vars;
@@ -145,7 +154,8 @@ struct ScriptEntry {
 		/**
 		 * Constructor
 		 */
-		Conditional() : _operation(CONDOP_NONE) {}
+		Conditional() : _operation(CONDOP_NONE) {
+		}
 
 		/**
 		 * Loads data from a passed stream into the parameters structure
@@ -167,7 +177,8 @@ struct ScriptEntry {
 		int _size;
 		int _v2;
 
-		MessageEntry() : _size(0), _v2(0) {}
+		MessageEntry() : _size(0), _v2(0) {
+		}
 	};
 
 	DialogCommand _command;
@@ -181,7 +192,8 @@ struct ScriptEntry {
 	/**
 	 * Constructor
 	 */
-	ScriptEntry() : _command(CMD_END), _index(0) {}
+	ScriptEntry() : _command(CMD_END), _index(0) {
+	}
 
 	/**
 	 * Loads data from a passed stream into the parameters structure
@@ -236,7 +248,8 @@ struct ConvMessage {
 	uint _stringIndex;
 	uint _count;
 
-	ConvMessage() : _stringIndex(0), _count(0) {}
+	ConvMessage() : _stringIndex(0), _count(0) {
+	}
 };
 
 /**
@@ -482,24 +495,33 @@ public:
 	/**
 	 * Returns true if any conversation is currently atcive
 	 */
-	bool active() const { return _runningConv != nullptr; }
+	bool active() const {
+		return _runningConv != nullptr;
+	}
 
 	/**
 	 * Returns the currently active conversation Id
 	 */
-	int activeConvId() const { return !active() ? -1 : _runningConv->_convId; }
+	int activeConvId() const {
+		return !active() ? -1 : _runningConv->_convId;
+	}
 
 	/**
 	 * Returns _restoreRunning value
 	 */
-	int restoreRunning() const { return _restoreRunning; }
+	int restoreRunning() const {
+		return _restoreRunning;
+	}
 
 	/**
 	 * Returns the current conversation mode
 	 */
-	ConversationMode currentMode() const { return _currentMode; }
+	ConversationMode currentMode() const {
+		return _currentMode;
+	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_CONVERSATIONS_H */
+#endif
diff --git a/engines/mads/core/dialogs.cpp b/engines/mads/nebular/core/dialogs.cpp
similarity index 96%
rename from engines/mads/core/dialogs.cpp
rename to engines/mads/nebular/core/dialogs.cpp
index 9ad550e7bfd..b890288a0a6 100644
--- a/engines/mads/core/dialogs.cpp
+++ b/engines/mads/nebular/core/dialogs.cpp
@@ -23,11 +23,12 @@
 #include "common/config-manager.h"
 #include "common/text-to-speech.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
 #include "mads/nebular/dialogs_nebular.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum PopupEdge {
 	EDGE_UPPER_LEFT = 0, EDGE_UPPER_RIGHT = 1, EDGE_LOWER_LEFT = 2,
@@ -36,7 +37,7 @@ enum PopupEdge {
 };
 
 Dialog::Dialog(RexNebularEngine *vm) : _vm(vm), _savedSurface(nullptr), _position(Common::Point(-1, -1)),
-	  _width(0), _height(0) {
+_width(0), _height(0) {
 	TEXTDIALOG_CONTENT1 = 0XF8;
 	TEXTDIALOG_CONTENT2 = 0XF9;
 	TEXTDIALOG_EDGE = 0XFA;
@@ -57,7 +58,7 @@ void Dialog::save() {
 		Common::Rect(_position.x, _position.y, _position.x + _width, _position.y + _height),
 		Common::Point());
 
-//	_vm->_screen->copyRectToScreen(getBounds());
+	//	_vm->_screen->copyRectToScreen(getBounds());
 }
 
 void Dialog::restore() {
@@ -142,7 +143,7 @@ void Dialog::drawContent(const Common::Rect &r, int seed, byte color1, byte colo
 /*------------------------------------------------------------------------*/
 
 TextDialog::TextDialog(RexNebularEngine *vm, const Common::String &fontName,
-		const Common::Point &pos, int maxChars)
+	const Common::Point &pos, int maxChars)
 	: Dialog(vm) {
 	_font = _vm->_font->getFont(fontName);
 	_position = pos;
@@ -157,7 +158,7 @@ TextDialog::TextDialog(RexNebularEngine *vm, const Common::String &fontName,
 }
 
 TextDialog::TextDialog(RexNebularEngine *vm, const Common::String &fontName,
-		const Common::Point &pos, MSurface *portrait, int maxTextChars): Dialog(vm) {
+	const Common::Point &pos, MSurface *portrait, int maxTextChars) : Dialog(vm) {
 	_font = _vm->_font->getFont(fontName);
 	_position = pos;
 	_portrait = portrait;
@@ -194,7 +195,7 @@ int TextDialog::estimatePieces(int maxLen) {
 
 TextDialog::~TextDialog() {
 	if (ConfMan.getBool("tts_narrator")) {
-		Common::TextToSpeechManager* ttsMan = g_system->getTextToSpeechManager();
+		Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
 		if (ttsMan != nullptr)
 			ttsMan->stop();
 	}
@@ -280,7 +281,7 @@ void TextDialog::wordWrap(const Common::String &line) {
 
 			int lineWidth = _font->getWidth(tempLine2, 1);
 			if (((_currentX + (int)tempLine2.size()) > _lineSize) ||
-					((_lineWidth + lineWidth) > _innerWidth)) {
+				((_lineWidth + lineWidth) > _innerWidth)) {
 				incNumLines();
 				appendLine(tempLine);
 			} else {
@@ -348,7 +349,7 @@ void TextDialog::draw() {
 		if (_lineXp[lineNum] == -1) {
 			// Draw a line across the entire dialog
 			_vm->_screen->hLine(_position.x + 2,
-				lineYp + (_font->getHeight() + 1)  / 2,
+				lineYp + (_font->getHeight() + 1) / 2,
 				_position.x + _width - 4, TEXTDIALOG_BLACK);
 		} else {
 			// Draw a text line
@@ -547,4 +548,5 @@ void FullScreenDialog::display() {
 		scene._spriteSlots.fullRefresh();
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/dialogs.h b/engines/mads/nebular/core/dialogs.h
similarity index 94%
rename from engines/mads/core/dialogs.h
rename to engines/mads/nebular/core/dialogs.h
index f8f5662d87b..b6ec75004ff 100644
--- a/engines/mads/core/dialogs.h
+++ b/engines/mads/nebular/core/dialogs.h
@@ -23,11 +23,12 @@
 #define MADS_DIALOGS_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/font.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/font.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define DIALOG_TOP 22
 #define POPUP_CENTER 0x8000
@@ -225,7 +226,8 @@ class MessageDialog : public TextDialog {
 public:
 	MessageDialog(RexNebularEngine *vm, int lines, ...);
 
-	~MessageDialog() override {}
+	~MessageDialog() override {
+	}
 };
 
 enum DialogId {
@@ -247,7 +249,8 @@ public:
 	DialogId _pendingDialog;
 	int _indexList[10];
 
-	virtual ~Dialogs() {}
+	virtual ~Dialogs() {
+	}
 
 	virtual void showDialog() = 0;
 	virtual void showItem(int objectId, int messageId, int speech = 0) = 0;
@@ -257,10 +260,12 @@ public:
 	/**
 	* Show a spinning picture of an object, used in V2+ games
 	*/
-	virtual void spinObject(int idx) { warning("TODO: spinObject"); }
+	virtual void spinObject(int idx) {
+		warning("TODO: spinObject");
+	}
 };
 
-class FullScreenDialog: public EventTarget {
+class FullScreenDialog : public EventTarget {
 protected:
 	/**
 	 * Engine reference
@@ -290,6 +295,7 @@ public:
 	~FullScreenDialog() override;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_DIALOGS_H */
+#endif
diff --git a/engines/mads/core/events.cpp b/engines/mads/nebular/core/events.cpp
similarity index 98%
rename from engines/mads/core/events.cpp
rename to engines/mads/nebular/core/events.cpp
index a26ea2e948c..9ea8d4a7af4 100644
--- a/engines/mads/core/events.cpp
+++ b/engines/mads/nebular/core/events.cpp
@@ -24,10 +24,11 @@
 #include "common/events.h"
 #include "engines/util.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/events.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/scene.h"
 
 namespace MADS {
+namespace Nebular {
 
 EventsManager::EventsManager(RexNebularEngine *vm) {
 	_vm = vm;
@@ -196,7 +197,7 @@ void EventsManager::pollEvents() {
 			_mouseMoved = true;
 			break;
 		default:
- 			break;
+			break;
 		}
 	}
 }
@@ -270,5 +271,5 @@ void EventsManager::clearEvents() {
 	_pendingActions.clear();
 }
 
-
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/events.h b/engines/mads/nebular/core/events.h
similarity index 78%
rename from engines/mads/core/events.h
rename to engines/mads/nebular/core/events.h
index 75d1d4bb32b..f1fc1aa06b4 100644
--- a/engines/mads/core/events.h
+++ b/engines/mads/nebular/core/events.h
@@ -25,13 +25,16 @@
 #include "common/scummsys.h"
 #include "common/events.h"
 #include "common/stack.h"
-#include "mads/core/assets.h"
-#include "mads/core/sprites.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/sprites.h"
 
 namespace MADS {
+namespace Nebular {
 
-enum CursorType { CURSOR_NONE = 0, CURSOR_ARROW = 1, CURSOR_WAIT = 2, CURSOR_GO_DOWN = 3,
-	CURSOR_GO_UP = 4, CURSOR_GO_LEFT = 5, CURSOR_GO_RIGHT = 6 };
+enum CursorType {
+	CURSOR_NONE = 0, CURSOR_ARROW = 1, CURSOR_WAIT = 2, CURSOR_GO_DOWN = 3,
+	CURSOR_GO_UP = 4, CURSOR_GO_LEFT = 5, CURSOR_GO_RIGHT = 6
+};
 
 #define GAME_FRAME_RATE 50
 #define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
@@ -40,8 +43,11 @@ class RexNebularEngine;
 
 class EventTarget {
 public:
-	virtual ~EventTarget() {}
-	virtual bool onEvent(Common::Event &event) { return false; }
+	virtual ~EventTarget() {
+	}
+	virtual bool onEvent(Common::Event &event) {
+		return false;
+	}
 };
 
 class EventsManager {
@@ -130,17 +136,23 @@ public:
 	/**
 	 * Sets an event handler other than the events manager
 	 */
-	void setEventTarget(EventTarget *target) { _eventTarget = target; }
+	void setEventTarget(EventTarget *target) {
+		_eventTarget = target;
+	}
 
 	/**
 	 * Return the current mouse position
 	 */
-	Common::Point mousePos() const { return _mousePos; }
+	Common::Point mousePos() const {
+		return _mousePos;
+	}
 
 	/**
 	* Return the current mouse position
 	*/
-	Common::Point currentPos() const { return _currentPos; }
+	Common::Point currentPos() const {
+		return _currentPos;
+	}
 
 	/**
 	 * Delay for a given number of frames
@@ -160,7 +172,9 @@ public:
 	/**
 	 * Gets the current frame counter
 	 */
-	uint32 getFrameCounter() const { return _frameCounter; }
+	uint32 getFrameCounter() const {
+		return _frameCounter;
+	}
 
 	void initVars();
 
@@ -172,24 +186,33 @@ public:
 	/**
 	 * Returns true if there's any pending keys to be processed
 	 */
-	bool isKeyPressed() const { return !_pendingKeys.empty(); }
+	bool isKeyPressed() const {
+		return !_pendingKeys.empty();
+	}
 
 	/**
 	 * Returns true if there's any pending actions to be processed
 	 */
-	bool isActionTriggered() const { return !_pendingActions.empty(); }
+	bool isActionTriggered() const {
+		return !_pendingActions.empty();
+	}
 
 	/**
 	 * Gets the next pending keypress
 	 */
-	Common::KeyState getKey() { return _pendingKeys.pop(); }
+	Common::KeyState getKey() {
+		return _pendingKeys.pop();
+	}
 
 	/**
 	 * Gets the next pending action
 	 */
-	Common::CustomEventType getAction() { return _pendingActions.pop(); }
+	Common::CustomEventType getAction() {
+		return _pendingActions.pop();
+	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_EVENTS_H */
+#endif
diff --git a/engines/mads/core/font.cpp b/engines/mads/nebular/core/font.cpp
similarity index 96%
rename from engines/mads/core/font.cpp
rename to engines/mads/nebular/core/font.cpp
index d0f4703f242..88d791abcbb 100644
--- a/engines/mads/core/font.cpp
+++ b/engines/mads/nebular/core/font.cpp
@@ -21,11 +21,12 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
-#include "mads/core/font.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/font.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 RexNebularEngine *Font::_vm;
 
@@ -145,7 +146,7 @@ void Font::setColorMode(SelectionMode mode) {
 }
 
 int Font::writeString(BaseSurface *surface, const Common::String &msg, const Common::Point &pt,
-		int spaceWidth, int width) {
+	int spaceWidth, int width) {
 	int xEnd;
 	if (width > 0)
 		xEnd = MIN((int)surface->w, pt.x + width);
@@ -243,4 +244,5 @@ int Font::getBpp(int charWidth) {
 		return 1;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/font.h b/engines/mads/nebular/core/font.h
similarity index 93%
rename from engines/mads/core/font.h
rename to engines/mads/nebular/core/font.h
index 37573cde2c4..0595a54454d 100644
--- a/engines/mads/core/font.h
+++ b/engines/mads/nebular/core/font.h
@@ -26,9 +26,10 @@
 #include "common/hashmap.h"
 #include "common/endian.h"
 #include "common/util.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define FONT_CONVERSATION "*FONTCONV.FF"
 #define FONT_INTERFACE "*FONTINTR.FF"
@@ -82,13 +83,18 @@ public:
 	void setColors(uint8 v1, uint8 v2, uint8 v3, uint8 v4);
 	void setColorMode(SelectionMode mode);
 
-	int maxWidth() const { return _maxWidth; }
+	int maxWidth() const {
+		return _maxWidth;
+	}
 	int getWidth(const Common::String &msg, int spaceWidth = -1);
-	int getHeight() const { return _maxHeight; }
+	int getHeight() const {
+		return _maxHeight;
+	}
 	int writeString(BaseSurface *surface, const Common::String &msg, const Common::Point &pt,
 		int spaceWidth = 0, int width = 0);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_FONT_H */
+#endif
diff --git a/engines/mads/core/game.cpp b/engines/mads/nebular/core/game.cpp
similarity index 97%
rename from engines/mads/core/game.cpp
rename to engines/mads/nebular/core/game.cpp
index a914105ac44..23388aee58a 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/nebular/core/game.cpp
@@ -26,16 +26,17 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
-#include "mads/core/game.h"
-#include "mads/core/game_data.h"
-#include "mads/core/events.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/game_data.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/resources.h"
 #include "mads/nebular/game_nebular.h"
 
 namespace MADS {
+namespace Nebular {
 
 Game *Game::init(RexNebularEngine *vm) {
 	switch (vm->getGameID()) {
@@ -166,7 +167,7 @@ void Game::gameLoop() {
 
 void Game::sectionLoop() {
 	while (!_vm->shouldQuit() && _statusFlag && !_winStatus &&
-			(_sectionNumber == _currentSectionNumber)) {
+		(_sectionNumber == _currentSectionNumber)) {
 		_kernelMode = KERNEL_ROOM_PRELOAD;
 		_player._spritesChanged = true;
 		_quoteEmergency = false;
@@ -415,7 +416,7 @@ void Game::handleKeypress(const Common::KeyState &kbd) {
 			// Implement original game cheating keys here someday
 		} else {
 			if (kbd.keycode == (Common::KEYCODE_a +
-					(DEBUG_STRING[_widepipeCtr] - 'a'))) {
+				(DEBUG_STRING[_widepipeCtr] - 'a'))) {
 				if (++_widepipeCtr == 8) {
 					MessageDialog *dlg = new MessageDialog(_vm, 2,
 						"CHEATING ENABLED", "(for your convenience).");
@@ -685,4 +686,5 @@ void Game::camUpdate() {
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/game.h b/engines/mads/nebular/core/game.h
similarity index 87%
rename from engines/mads/core/game.h
rename to engines/mads/nebular/core/game.h
index 2afcdd51d30..7e534d890de 100644
--- a/engines/mads/core/game.h
+++ b/engines/mads/nebular/core/game.h
@@ -26,16 +26,17 @@
 #include "common/savefile.h"
 #include "common/str-array.h"
 #include "common/serializer.h"
-#include "mads/core/audio.h"
-#include "mads/core/scene.h"
-#include "mads/core/game_data.h"
-#include "mads/core/globals.h"
-#include "mads/core/inventory.h"
-#include "mads/core/player.h"
-#include "mads/core/screen.h"
-#include "mads/core/camera.h"
+#include "mads/nebular/core/audio.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/game_data.h"
+#include "mads/nebular/core/globals.h"
+#include "mads/nebular/core/inventory.h"
+#include "mads/nebular/core/player.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/camera.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
@@ -161,12 +162,16 @@ public:
 	/**
 	 * Return the number of quotes
 	 */
-	uint32 getQuotesSize() { return _quotes.size(); }
+	uint32 getQuotesSize() {
+		return _quotes.size();
+	}
 
 	/**
 	 * Get a specific quote string
 	 */
-	const Common::String &getQuote(uint32 index) { return _quotes[index - 1]; }
+	const Common::String &getQuote(uint32 index) {
+		return _quotes[index - 1];
+	}
 
 	/**
 	 * Split a quote into two lines for display on-screen
@@ -202,14 +207,21 @@ public:
 	 */
 	virtual void synchronize(Common::Serializer &s, bool phase1);
 
-	virtual void setNaughtyMode(bool naughtyMode) {}
-	virtual bool getNaughtyMode() const { return true; }
+	virtual void setNaughtyMode(bool naughtyMode) {
+	}
+	virtual bool getNaughtyMode() const {
+		return true;
+	}
 
 	// DEPRECATED: ScummVM re-implementation keeps all the quotes loaded, so the methods below are stubs
-	void clearQuotes() {}
-	void loadQuoteRange(int startNum, int endNum) {}
-	void loadQuoteSet(...) {}
-	void loadQuote(int quoteNum) {}
+	void clearQuotes() {
+	}
+	void loadQuoteRange(int startNum, int endNum) {
+	}
+	void loadQuoteSet(...) {
+	}
+	void loadQuote(int quoteNum) {
+	}
 
 	/**
 	* Handle a keyboard event
@@ -255,6 +267,7 @@ public:
 	void camUpdate();
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_GAME_H */
+#endif
diff --git a/engines/mads/core/game_data.cpp b/engines/mads/nebular/core/game_data.cpp
similarity index 89%
rename from engines/mads/core/game_data.cpp
rename to engines/mads/nebular/core/game_data.cpp
index 4a4b708b34f..3800b5f8060 100644
--- a/engines/mads/core/game_data.cpp
+++ b/engines/mads/nebular/core/game_data.cpp
@@ -21,13 +21,14 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/game.h"
+#include "mads/nebular/core/game.h"
 #include "mads/nebular/game_nebular.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 void VisitedScenes::add(int sceneId) {
 	_sceneRevisited = exists(sceneId);
@@ -62,4 +63,5 @@ void VisitedScenes::synchronize(Common::Serializer &s, int sceneId) {
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/game_data.h b/engines/mads/nebular/core/game_data.h
similarity index 89%
rename from engines/mads/core/game_data.h
rename to engines/mads/nebular/core/game_data.h
index bc63e0bc65b..15d6c431cdc 100644
--- a/engines/mads/core/game_data.h
+++ b/engines/mads/nebular/core/game_data.h
@@ -24,9 +24,10 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 class Game;
@@ -58,15 +59,19 @@ class SectionHandler {
 protected:
 	RexNebularEngine *_vm;
 public:
-	SectionHandler(RexNebularEngine *vm) : _vm(vm) {}
-	virtual ~SectionHandler() {}
+	SectionHandler(RexNebularEngine *vm) : _vm(vm) {
+	}
+	virtual ~SectionHandler() {
+	}
 
 	virtual void preLoadSection() = 0;
 	virtual void sectionPtr2() = 0;
 	virtual void postLoadSection() = 0;
-	virtual void step() {}
+	virtual void step() {
+	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_GAME_DATA_H */
+#endif
diff --git a/engines/mads/core/globals.cpp b/engines/mads/nebular/core/globals.cpp
similarity index 92%
rename from engines/mads/core/globals.cpp
rename to engines/mads/nebular/core/globals.cpp
index 2cf62984077..48db3e54f60 100644
--- a/engines/mads/core/globals.cpp
+++ b/engines/mads/nebular/core/globals.cpp
@@ -20,13 +20,15 @@
  */
 
 #include "common/scummsys.h"
-#include "mads/core/globals.h"
+#include "mads/nebular/core/globals.h"
 
 namespace MADS {
+namespace Nebular {
 
 void Globals::reset() {
 	for (uint i = 0; i < size(); ++i)
 		(*this)[i] = 0;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/globals.h b/engines/mads/nebular/core/globals.h
similarity index 89%
rename from engines/mads/core/globals.h
rename to engines/mads/nebular/core/globals.h
index d2c6cd44654..889f14de8d9 100644
--- a/engines/mads/core/globals.h
+++ b/engines/mads/nebular/core/globals.h
@@ -25,15 +25,18 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/serializer.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 class Globals : public SynchronizedList {
 public:
-	Globals() {}
+	Globals() {
+	}
 
-	virtual ~Globals() {}
+	virtual ~Globals() {
+	}
 
 	/*
 	 * Resets all the globals to empty
@@ -41,6 +44,7 @@ public:
 	void reset();
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_GLOBALS_H */
+#endif
diff --git a/engines/mads/core/hag.cpp b/engines/mads/nebular/core/hag.cpp
similarity index 94%
rename from engines/mads/core/hag.cpp
rename to engines/mads/nebular/core/hag.cpp
index 26c3dfa9f0e..c57e82cf6ed 100644
--- a/engines/mads/core/hag.cpp
+++ b/engines/mads/nebular/core/hag.cpp
@@ -20,10 +20,11 @@
  */
 
 #include "common/file.h"
-#include "mads/core/hag.h"
+#include "mads/nebular/core/hag.h"
 #include "mads/detection.h"
 
 namespace MADS {
+namespace Nebular {
 
 const char *const MADSCONCAT_STRING = "MADSCONCAT";
 
@@ -87,29 +88,29 @@ void HagArchive::loadIndex(int gameID, bool isDemo) {
 	Common::File hagFile;
 
 	for (int sectionIndex = -1; sectionIndex < 11; ++sectionIndex) {
- 		if (sectionIndex == 0 && !Common::File::exists("SECTION0.HAG"))
+		if (sectionIndex == 0 && !Common::File::exists("SECTION0.HAG"))
 			continue;
 
 		// Rex Nebular and Dragonsphere demos only have sections 1 and 9 - skip the rest
-		if ((gameID == GType_RexNebular || gameID == GType_Dragonsphere) && isDemo)  {
+		if ((gameID == GType_RexNebular || gameID == GType_Dragonsphere) && isDemo) {
 			if (sectionIndex != 1 && sectionIndex != 9)
 				continue;
 		}
 
 		// Phantom demo only has sections 1, 2 and 9 - skip the rest
-		if (gameID == GType_Phantom && isDemo)  {
+		if (gameID == GType_Phantom && isDemo) {
 			if (sectionIndex != 1 && sectionIndex != 2 && sectionIndex != 9)
 				continue;
 		}
 
 		// Dragonsphere does not have some sections - skip them
-		if (gameID == GType_Dragonsphere)  {
+		if (gameID == GType_Dragonsphere) {
 			if (sectionIndex == 7 || sectionIndex == 8)
 				continue;
 		}
 
 		// Phantom and Forest don't have some sections - skip them
-		if (gameID == GType_Phantom || gameID == GType_Forest)  {
+		if (gameID == GType_Phantom || gameID == GType_Forest) {
 			if (sectionIndex == 6 || sectionIndex == 7 || sectionIndex == 8)
 				continue;
 		}
@@ -129,7 +130,7 @@ void HagArchive::loadIndex(int gameID, bool isDemo) {
 		// Check for header
 		char headerBuffer[16];
 		if ((hagFile.read(headerBuffer, 16) != 16) ||
-				(strncmp(headerBuffer, MADSCONCAT_STRING, 10) != 0))
+			(strncmp(headerBuffer, MADSCONCAT_STRING, 10) != 0))
 			error("Invalid HAG file opened");
 
 		// Scan through the HAG index
@@ -154,7 +155,7 @@ void HagArchive::loadIndex(int gameID, bool isDemo) {
 }
 
 bool HagArchive::getHeaderEntry(const Common::Path &resourceName,
-		HagIndex &hagIndex, HagEntry &hagEntry) const {
+	HagIndex &hagIndex, HagEntry &hagEntry) const {
 	Common::Path resName = resourceName;
 	resName.toUppercase();
 	Common::String baseName(resName.baseName());
@@ -244,4 +245,5 @@ ResourceType HagArchive::getResourceType(const Common::String &resourceName) con
 	return RESTYPE_NO_EXT;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/hag.h b/engines/mads/nebular/core/hag.h
similarity index 98%
rename from engines/mads/core/hag.h
rename to engines/mads/nebular/core/hag.h
index 849af6eee23..2b03184da92 100644
--- a/engines/mads/core/hag.h
+++ b/engines/mads/nebular/core/hag.h
@@ -25,6 +25,7 @@
 #include "common/archive.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum ResourceType {
 	RESTYPE_ROOM, RESTYPE_SC, RESTYPE_TEXT, RESTYPE_QUO, RESTYPE_I,
@@ -90,6 +91,7 @@ public:
 	Common::SeekableReadStream *createReadStreamForMember(const Common::Path &path) const override;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/hotspots.cpp b/engines/mads/nebular/core/hotspots.cpp
similarity index 96%
rename from engines/mads/core/hotspots.cpp
rename to engines/mads/nebular/core/hotspots.cpp
index 7dfff09a5d7..c95b6136878 100644
--- a/engines/mads/core/hotspots.cpp
+++ b/engines/mads/nebular/core/hotspots.cpp
@@ -20,9 +20,10 @@
  */
 
 #include "mads/nebular/nebular.h"
-#include "mads/core/hotspots.h"
+#include "mads/nebular/core/hotspots.h"
 
 namespace MADS {
+namespace Nebular {
 
 DynamicHotspot::DynamicHotspot() {
 	_seqIndex = 0;
@@ -166,7 +167,7 @@ void DynamicHotspots::refresh() {
 	ScreenObjects &scrObjects = _vm->_game->_screenObjects;
 	scrObjects.resize(scrObjects._uiCount);
 
-	 bool isV2 = (_vm->getGameID() != GType_RexNebular);
+	bool isV2 = (_vm->getGameID() != GType_RexNebular);
 
 	// Loop through adding hotspots
 	for (uint i = 0; i < _entries.size(); ++i) {
@@ -255,12 +256,13 @@ void Hotspots::activateAtPos(int vocabId, bool active, Common::Point pos) {
 	for (uint idx = 0; idx < size(); ++idx) {
 		Hotspot &hotspot = (*this)[idx];
 		if ((hotspot._vocabId == vocabId) && (pos.x >= hotspot._bounds.left) &&
-		    (pos.x <= hotspot._bounds.right) && (pos.y >= hotspot._bounds.top) &&
-		    (pos.y <= hotspot._bounds.bottom)) {
+			(pos.x <= hotspot._bounds.right) && (pos.y >= hotspot._bounds.top) &&
+			(pos.y <= hotspot._bounds.bottom)) {
 			hotspot._active = active;
 			_vm->_game->_screenObjects.setActive(CAT_HOTSPOT, idx, active);
 		}
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/hotspots.h b/engines/mads/nebular/core/hotspots.h
similarity index 90%
rename from engines/mads/core/hotspots.h
rename to engines/mads/nebular/core/hotspots.h
index 2370b28b1e5..9ee13720244 100644
--- a/engines/mads/core/hotspots.h
+++ b/engines/mads/nebular/core/hotspots.h
@@ -23,10 +23,11 @@
 #define MADS_HOTSPOTS_H
 
 #include "common/scummsys.h"
-#include "mads/core/events.h"
-#include "mads/core/player.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/player.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
@@ -78,8 +79,12 @@ public:
 public:
 	DynamicHotspots(RexNebularEngine *vm);
 
-	Common::Array<MADS::DynamicHotspot>::size_type size() const { return _entries.size(); }
-	DynamicHotspot &operator[](uint idx) { return _entries[idx]; }
+	Common::Array<DynamicHotspot>::size_type size() const {
+		return _entries.size();
+	}
+	DynamicHotspot &operator[](uint idx) {
+		return _entries[idx];
+	}
 	int add(int descId, int verbId, byte syntax, int seqIndex, const Common::Rect &bounds);	// V2
 	int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
 	int setPosition(int index, const Common::Point &pos, Facing facing);
@@ -121,7 +126,8 @@ class Hotspots : public Common::Array<Hotspot> {
 private:
 	RexNebularEngine *_vm;
 public:
-	Hotspots(RexNebularEngine *vm) : _vm(vm) {}
+	Hotspots(RexNebularEngine *vm) : _vm(vm) {
+	}
 
 	/**
 	 * Sets the active state of a given hotspot
@@ -135,6 +141,7 @@ public:
 
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif	/* MADS_HOTSPOTS_H */
+#endif
diff --git a/engines/mads/core/inventory.cpp b/engines/mads/nebular/core/inventory.cpp
similarity index 96%
rename from engines/mads/core/inventory.cpp
rename to engines/mads/nebular/core/inventory.cpp
index f094d88c47e..5c5f7721f11 100644
--- a/engines/mads/core/inventory.cpp
+++ b/engines/mads/nebular/core/inventory.cpp
@@ -21,9 +21,10 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/inventory.h"
+#include "mads/nebular/core/inventory.h"
 
 namespace MADS {
+namespace Nebular {
 
 void InventoryObject::synchronize(Common::Serializer &s) {
 	s.syncAsUint16LE(_descId);
@@ -158,7 +159,7 @@ void InventoryObjects::addToInventory(int objectId) {
 		(*this)[objectId]._roomNumber = PLAYER_INVENTORY;
 
 		if (_vm->_game->_kernelMode == KERNEL_ACTIVE_CODE &&
-				_vm->_game->_screenObjects._inputMode == kInputBuildingSentences) {
+			_vm->_game->_screenObjects._inputMode == kInputBuildingSentences) {
 			userInterface.categoryChanged();
 			userInterface.selectObject(userInterface._selectedInvIndex);
 		}
@@ -184,7 +185,7 @@ void InventoryObjects::removeFromInventory(int objectId, int newScene) {
 	bool noSelection = selectedIndex < 0;
 
 	if (_vm->_game->_kernelMode == KERNEL_ACTIVE_CODE &&
-			_vm->_game->_screenObjects._inputMode == kInputBuildingSentences)
+		_vm->_game->_screenObjects._inputMode == kInputBuildingSentences)
 		userInterface.selectObject(-1);
 
 	// Remove the item from the inventory list
@@ -205,7 +206,7 @@ void InventoryObjects::removeFromInventory(int objectId, int newScene) {
 	(*this)[objectId]._roomNumber = newScene;
 
 	if (_vm->_game->_kernelMode == KERNEL_ACTIVE_CODE &&
-			_vm->_game->_screenObjects._inputMode == kInputBuildingSentences) {
+		_vm->_game->_screenObjects._inputMode == kInputBuildingSentences) {
 		userInterface.categoryChanged();
 		userInterface.selectObject(selectedIndex);
 	}
@@ -221,4 +222,5 @@ int InventoryObjects::getIdFromDesc(int descId) {
 	return -1;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/inventory.h b/engines/mads/nebular/core/inventory.h
similarity index 95%
rename from engines/mads/core/inventory.h
rename to engines/mads/nebular/core/inventory.h
index 381f30f5364..71326260a16 100644
--- a/engines/mads/core/inventory.h
+++ b/engines/mads/nebular/core/inventory.h
@@ -25,9 +25,10 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/serializer.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum {
 	PLAYER_INVENTORY = 2, NOWHERE = 1
@@ -87,7 +88,8 @@ public:
 	/**
 	 * Constructor
 	 */
-	InventoryObjects(RexNebularEngine *vm) : _vm(vm) {}
+	InventoryObjects(RexNebularEngine *vm) : _vm(vm) {
+	}
 
 	/**
 	 * Loads the game's object list
@@ -136,6 +138,7 @@ public:
 	int getIdFromDesc(int objectId);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_INVENTORY_H */
+#endif
diff --git a/engines/mads/core/menu_views.cpp b/engines/mads/nebular/core/menu_views.cpp
similarity index 97%
rename from engines/mads/core/menu_views.cpp
rename to engines/mads/nebular/core/menu_views.cpp
index d01205b7478..1b7e92e51b3 100644
--- a/engines/mads/core/menu_views.cpp
+++ b/engines/mads/nebular/core/menu_views.cpp
@@ -20,14 +20,15 @@
  */
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
+#include "mads/nebular/core/game.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/menu_views.h"
-#include "mads/core/resources.h"
-#include "mads/core/scene.h"
-#include "mads/core/screen.h"
+#include "mads/nebular/core/menu_views.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/screen.h"
 
 namespace MADS {
+namespace Nebular {
 
 MenuView::MenuView(RexNebularEngine *vm) : FullScreenDialog(vm) {
 	_breakFlag = false;
@@ -36,7 +37,7 @@ MenuView::MenuView(RexNebularEngine *vm) : FullScreenDialog(vm) {
 }
 
 void MenuView::show() {
- 	Scene &scene = _vm->_game->_scene;
+	Scene &scene = _vm->_game->_scene;
 	EventsManager &events = *_vm->_events;
 	_vm->_screenFade = SCREEN_FADE_FAST;
 
@@ -71,7 +72,7 @@ void MenuView::display() {
 
 bool MenuView::onEvent(Common::Event &event) {
 	if (event.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START || event.type == Common::EVENT_KEYDOWN
-			|| event.type == Common::EVENT_JOYBUTTON_DOWN || event.type == Common::EVENT_LBUTTONDOWN) {
+		|| event.type == Common::EVENT_JOYBUTTON_DOWN || event.type == Common::EVENT_LBUTTONDOWN) {
 		_breakFlag = true;
 		_vm->_dialogs->_pendingDialog = DIALOG_MAIN_MENU;
 		return true;
@@ -231,7 +232,7 @@ void TextView::processCommand() {
 		_vm->_sound->command(soundId);
 
 	} else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') ||
-			(commandStr[5] == '1'))) {
+		(commandStr[5] == '1'))) {
 		// Set the text colors
 		int index = commandStr[5] - '0';
 		paramP = commandStr + 6;
@@ -527,7 +528,7 @@ void AnimationView::display() {
 bool AnimationView::onEvent(Common::Event &event) {
 	// Wait for the Escape key or a mouse press
 	if (((event.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START) && (event.customType == kActionEscape)) ||
-			(event.type == Common::EVENT_LBUTTONUP)) {
+		(event.type == Common::EVENT_LBUTTONUP)) {
 		scriptDone();
 		return true;
 	}
@@ -745,7 +746,8 @@ void AnimationView::processCommand() {
 	case 'P':
 		// Switch to CONCAT mode, which is ignored anyway
 		break;
-	case 'R': {
+	case 'R':
+	{
 		// Resynch timer (always, beginning, never)
 		assert(_currentLine[0] == ':');
 		_currentLine.deleteChar(0);
@@ -834,4 +836,5 @@ int AnimationView::scanResourceIndex(const Common::String &resourceName) {
 	return -1;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/menu_views.h b/engines/mads/nebular/core/menu_views.h
similarity index 92%
rename from engines/mads/core/menu_views.h
rename to engines/mads/nebular/core/menu_views.h
index 76557a51803..cccb7e70424 100644
--- a/engines/mads/core/menu_views.h
+++ b/engines/mads/nebular/core/menu_views.h
@@ -23,15 +23,16 @@
 #define MADS_MENU_VIEWS_H
 
 #include "common/scummsys.h"
-#include "mads/core/dialogs.h"
-#include "mads/core/game.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/dialogs.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
-class MenuView: public FullScreenDialog {
+class MenuView : public FullScreenDialog {
 protected:
 	bool _breakFlag;
 	bool _redrawFlag;
@@ -48,7 +49,8 @@ protected:
 public:
 	MenuView(RexNebularEngine *vm);
 
-	~MenuView() override {}
+	~MenuView() override {
+	}
 
 	virtual void show();
 
@@ -132,7 +134,9 @@ public:
 	~TextView() override;
 };
 
-enum ResyncMode { NEVER, ALWAYS, BEGINNING };
+enum ResyncMode {
+	NEVER, ALWAYS, BEGINNING
+};
 
 struct ResourceEntry {
 	Common::Path _resourceName;
@@ -141,9 +145,10 @@ struct ResourceEntry {
 	bool _bgFlag;
 	bool _showWhiteBars;
 
-	ResourceEntry() {}
+	ResourceEntry() {
+	}
 	ResourceEntry(const Common::Path &resName, int fx, bool soundFlag,
-			bool bgFlag, bool showWhiteBars) {
+		bool bgFlag, bool showWhiteBars) {
 		_resourceName = resName;
 		_fx = fx;
 		_soundFlag = soundFlag;
@@ -157,7 +162,8 @@ struct ResIndexEntry {
 	int _v;
 	Common::String _resourceName;
 
-	ResIndexEntry() {}
+	ResIndexEntry() {
+	}
 };
 
 /**
@@ -227,6 +233,7 @@ public:
 	~AnimationView() override;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_MENU_VIEWS_H */
+#endif
diff --git a/engines/mads/core/messages.cpp b/engines/mads/nebular/core/messages.cpp
similarity index 96%
rename from engines/mads/core/messages.cpp
rename to engines/mads/nebular/core/messages.cpp
index 7f594c83914..911d980db9e 100644
--- a/engines/mads/core/messages.cpp
+++ b/engines/mads/nebular/core/messages.cpp
@@ -21,12 +21,13 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/font.h"
-#include "mads/core/screen.h"
-#include "mads/core/messages.h"
-#include "mads/core/scene_data.h"
+#include "mads/nebular/core/font.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/messages.h"
+#include "mads/nebular/core/scene_data.h"
 
 namespace MADS {
+namespace Nebular {
 
 RandomMessages::RandomMessages() {
 	reserve(RANDOM_MESSAGE_SIZE);
@@ -68,7 +69,7 @@ void KernelMessages::clear() {
 }
 
 int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags,
-		int endTrigger, uint32 timeout, const Common::String &msg) {
+	int endTrigger, uint32 timeout, const Common::String &msg) {
 	Scene &scene = _vm->_game->_scene;
 
 	// Find a free slot
@@ -98,7 +99,7 @@ int KernelMessages::add(const Common::Point &pt, uint fontColor, uint8 flags,
 
 	if (flags & KMSG_PLAYER_TIMEOUT)
 		rec._frameTimer = _vm->_game->_player._ticksAmount +
-			_vm->_game->_player._priorTimer;
+		_vm->_game->_player._priorTimer;
 
 	return idx;
 }
@@ -274,7 +275,7 @@ void KernelMessages::processText(int msgIndex) {
 	if (x1 < 0)
 		x1 = 0;
 
-	if (y1 >(MADS_SCENE_HEIGHT - 1))
+	if (y1 > (MADS_SCENE_HEIGHT - 1))
 		y1 = MADS_SCENE_HEIGHT - 1;
 	if (y1 < 0)
 		y1 = 0;
@@ -329,7 +330,7 @@ void KernelMessages::setQuoted(int msgIndex, int numTicks, bool quoted) {
 
 void KernelMessages::randomServer() {
 	if ((_vm->_game->_trigger >= RANDOM_MESSAGE_TRIGGER) &&
-		(_vm->_game->_trigger <  (RANDOM_MESSAGE_TRIGGER + (int)_randomMessages.size()))) {
+		(_vm->_game->_trigger < (RANDOM_MESSAGE_TRIGGER + (int)_randomMessages.size()))) {
 		_randomMessages[_vm->_game->_trigger - RANDOM_MESSAGE_TRIGGER]._handle = -1;
 		_randomMessages[_vm->_game->_trigger - RANDOM_MESSAGE_TRIGGER]._quoteId = -1;
 	}
@@ -441,8 +442,8 @@ done:
 }
 
 void KernelMessages::initRandomMessages(int maxSimultaneousMessages,
-		const Common::Rect &bounds, int minYSpacing, int scrollRate,
-		int color, int duration, int quoteId, ...) {
+	const Common::Rect &bounds, int minYSpacing, int scrollRate,
+	int color, int duration, int quoteId, ...) {
 	// Reset the random messages list
 	_randomMessages.clear();
 	_randomMessages.resize(maxSimultaneousMessages);
@@ -507,7 +508,7 @@ void TextDisplayList::reset() {
 }
 
 int TextDisplayList::add(int xp, int yp, uint fontColor, int charSpacing,
-		const Common::String &msg, Font *font) {
+	const Common::String &msg, Font *font) {
 	int usedSlot = -1;
 
 	for (int idx = 0; idx < TEXT_DISPLAY_SIZE; ++idx) {
@@ -581,4 +582,5 @@ void TextDisplayList::expire(int idx) {
 	(*this)[idx]._expire = -1;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/messages.h b/engines/mads/nebular/core/messages.h
similarity index 95%
rename from engines/mads/core/messages.h
rename to engines/mads/nebular/core/messages.h
index d88c3a15ce0..ff368370243 100644
--- a/engines/mads/core/messages.h
+++ b/engines/mads/nebular/core/messages.h
@@ -24,11 +24,12 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "mads/core/action.h"
-#include "mads/core/font.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/action.h"
+#include "mads/nebular/core/font.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define KERNEL_MESSAGES_SIZE 10
 #define INDEFINITE_TIMEOUT 9999999
@@ -68,7 +69,9 @@ struct RandomEntry {
 	int _handle;
 	int _quoteId;
 
-	RandomEntry() { _handle = _quoteId = -1; }
+	RandomEntry() {
+		_handle = _quoteId = -1;
+	}
 };
 
 class RandomMessages : public Common::Array<RandomEntry> {
@@ -187,6 +190,7 @@ public:
 	void cleanUp();
 };
 
+} // namsepace Nebular
 } // namespace MADS
 
-#endif /* MADS_MESSAGES_H */
+#endif
diff --git a/engines/mads/core/mps_installer.cpp b/engines/mads/nebular/core/mps_installer.cpp
similarity index 85%
rename from engines/mads/core/mps_installer.cpp
rename to engines/mads/nebular/core/mps_installer.cpp
index 7e6dd29ed8d..591674184cc 100644
--- a/engines/mads/core/mps_installer.cpp
+++ b/engines/mads/nebular/core/mps_installer.cpp
@@ -26,11 +26,12 @@
 #include "common/util.h"
 #include "common/memstream.h"
 #include "common/compression/dcl.h"
-#include "mads/core/mps_installer.h"
+#include "mads/nebular/core/mps_installer.h"
 
 namespace MADS {
+namespace Nebular {
 
-MpsInstaller* MpsInstaller::open(const Common::Path& baseName) {
+MpsInstaller *MpsInstaller::open(const Common::Path &baseName) {
 	Common::File indexFile;
 	FileMap _files;
 
@@ -89,7 +90,7 @@ Common::SharedArchiveContents MpsInstaller::readContentsForPath(const Common::Pa
 	FileDescriptor desc = _files.getVal(translated);
 
 	if (desc._compressionAlgo != 0 && desc._compressionAlgo != 1) {
-		debug ("Unsupported compression algorithm %d for %s", desc._compressionAlgo, desc._fileName.toString().c_str());
+		debug("Unsupported compression algorithm %d for %s", desc._compressionAlgo, desc._fileName.toString().c_str());
 		return Common::SharedArchiveContents();
 	}
 
@@ -131,19 +132,20 @@ Common::SharedArchiveContents MpsInstaller::readContentsForPath(const Common::Pa
 		uncompressedSize = desc._compressedSize;
 		compressedBuf = nullptr;
 		break;
-	case 1: {
-			Common::MemoryReadStream compressedReadStream(compressedBuf, desc._compressedSize);
-			uncompressedBuf = new byte[uncompressedSize];
-			if (!Common::decompressDCL(&compressedReadStream, uncompressedBuf, desc._compressedSize, uncompressedSize)) {
-				delete[] compressedBuf;
-				delete[] uncompressedBuf;
-				error("Unable to decompress %s", desc._fileName.toString().c_str());
-				return Common::SharedArchiveContents();
-			}
+	case 1:
+	{
+		Common::MemoryReadStream compressedReadStream(compressedBuf, desc._compressedSize);
+		uncompressedBuf = new byte[uncompressedSize];
+		if (!Common::decompressDCL(&compressedReadStream, uncompressedBuf, desc._compressedSize, uncompressedSize)) {
 			delete[] compressedBuf;
-			compressedBuf = nullptr;
+			delete[] uncompressedBuf;
+			error("Unable to decompress %s", desc._fileName.toString().c_str());
+			return Common::SharedArchiveContents();
+		}
+		delete[] compressedBuf;
+		compressedBuf = nullptr;
 
-		} break;
+	} break;
 	default:
 		error("Unsupported compression algorithm");
 		uncompressedBuf = nullptr;
@@ -153,4 +155,6 @@ Common::SharedArchiveContents MpsInstaller::readContentsForPath(const Common::Pa
 	// TODO: Make it configurable to read directly from disk, at least in the uncompressed case
 	return Common::SharedArchiveContents(uncompressedBuf, desc._uncompressedSize);
 }
-}
+
+} // namespace Nebular
+} // namespace MADS
diff --git a/engines/mads/core/mps_installer.h b/engines/mads/nebular/core/mps_installer.h
similarity index 81%
rename from engines/mads/core/mps_installer.h
rename to engines/mads/nebular/core/mps_installer.h
index b5d285709b9..3e78d55bbf7 100644
--- a/engines/mads/core/mps_installer.h
+++ b/engines/mads/nebular/core/mps_installer.h
@@ -29,6 +29,7 @@
 #include "common/hash-str.h"
 
 namespace MADS {
+namespace Nebular {
 
 class MpsInstaller : public Common::MemcachingCaseInsensitiveArchive {
 public:
@@ -37,7 +38,7 @@ public:
 	const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override;
 	Common::SharedArchiveContents readContentsForPath(const Common::Path &translatedPath) const override;
 
-	static MpsInstaller* open(const Common::Path &baseName);
+	static MpsInstaller *open(const Common::Path &baseName);
 
 private:
 	// Similar to FileDescriptionBin but in native-endian and native strings.
@@ -45,24 +46,26 @@ private:
 	public:
 		// Public for hashmap
 		FileDescriptor() : _compressedSize(0),
-				   _uncompressedSize(),
-				   _compressionAlgo(0),
-				   _offsetInVolume(0),
-				   _volumeNumber(0) {}
+			_uncompressedSize(),
+			_compressionAlgo(0),
+			_offsetInVolume(0),
+			_volumeNumber(0) {
+		}
 	protected:
 		FileDescriptor(const Common::Path &name,
-			       uint16 compression,
-			       uint16 volumeNumber,
-			       uint32 offsetInVolume,
-			       uint32 compressedSize,
-			       uint32 uncompressedSize) :
+			uint16 compression,
+			uint16 volumeNumber,
+			uint32 offsetInVolume,
+			uint32 compressedSize,
+			uint32 uncompressedSize) :
 			_fileName(name),
 			_compressionAlgo(compression),
 			_volumeNumber(volumeNumber),
 			_offsetInVolume(offsetInVolume),
 			_compressedSize(compressedSize),
-			_uncompressedSize(uncompressedSize) {}
-		
+			_uncompressedSize(uncompressedSize) {
+		}
+
 		Common::Path _fileName;
 		uint _compressionAlgo;
 		uint _volumeNumber;
@@ -75,12 +78,15 @@ private:
 
 	typedef Common::HashMap<Common::Path, FileDescriptor, Common::Path::IgnoreCase_Hash, Common::Path::IgnoreCase_EqualTo> FileMap;
 
-	MpsInstaller(const FileMap& files,
-		     const Common::Path& baseName) : _files(files), _baseName(baseName) {}
+	MpsInstaller(const FileMap &files,
+		const Common::Path &baseName) : _files(files), _baseName(baseName) {
+	}
 
 	FileMap _files;
 	Common::Path _baseName;
 };
-}
+
+} // namespace Nebular
+} // namespace MADS
 
 #endif
diff --git a/engines/mads/core/msurface.cpp b/engines/mads/nebular/core/msurface.cpp
similarity index 97%
rename from engines/mads/core/msurface.cpp
rename to engines/mads/nebular/core/msurface.cpp
index 8ebb76098e1..b9b3d915568 100644
--- a/engines/mads/core/msurface.cpp
+++ b/engines/mads/nebular/core/msurface.cpp
@@ -20,14 +20,15 @@
  */
 
 #include "engines/util.h"
-#include "mads/core/compression.h"
-#include "mads/core/screen.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/screen.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/msurface.h"
-#include "mads/core/resources.h"
-#include "mads/core/sprites.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/sprites.h"
 
 namespace MADS {
+namespace Nebular {
 
 RexNebularEngine *BaseSurface::_vm = nullptr;
 
@@ -255,7 +256,7 @@ void BaseSurface::translate(byte map[PALETTE_COUNT]) {
 		byte *pDest = (byte *)getBasePtr(0, y);
 
 		for (int x = 0; x < this->w; ++x, ++pDest) {
-				*pDest = map[*pDest];
+			*pDest = map[*pDest];
 		}
 	}
 
@@ -277,7 +278,7 @@ BaseSurface *BaseSurface::flipHorizontal() const {
 }
 
 void BaseSurface::copyRectTranslate(BaseSurface &srcSurface, const byte *paletteMap,
-		const Common::Point &destPos, const Common::Rect &srcRect) {
+	const Common::Point &destPos, const Common::Rect &srcRect) {
 	// Loop through the lines
 	for (int yCtr = 0; yCtr < srcRect.height(); ++yCtr) {
 		const byte *srcP = (const byte *)srcSurface.getBasePtr(srcRect.left, srcRect.top + yCtr);
@@ -311,8 +312,7 @@ void BaseSurface::copyFrom(BaseSurface &src, const Common::Point &destPos, int d
 			distCtr += scale;
 			if (distCtr < 100) {
 				lineDist[distIndex] = false;
-			}
-			else {
+			} else {
 				lineDist[distIndex] = true;
 				distCtr -= 100;
 
@@ -497,4 +497,5 @@ int DepthSurface::getDepthHighBit(const Common::Point &pt) {
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/msurface.h b/engines/mads/nebular/core/msurface.h
similarity index 83%
rename from engines/mads/core/msurface.h
rename to engines/mads/nebular/core/msurface.h
index 3862aa88696..6d589a7c055 100644
--- a/engines/mads/core/msurface.h
+++ b/engines/mads/nebular/core/msurface.h
@@ -26,9 +26,10 @@
 #include "common/path.h"
 #include "common/rect.h"
 #include "graphics/screen.h"
-#include "mads/core/palette.h"
+#include "mads/nebular/core/palette.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 class MSprite;
@@ -64,12 +65,15 @@ public:
 	/**
 	 * Sets the engine reference used all surfaces
 	 */
-	static void setVm(RexNebularEngine *vm) { _vm = vm; }
+	static void setVm(RexNebularEngine *vm) {
+		_vm = vm;
+	}
 
 	/**
 	* Base method for descendents to load their contents
 	*/
-	virtual void load(const Common::Path &resName) {}
+	virtual void load(const Common::Path &resName) {
+	}
 public:
 	/**
 	 * Basic constructor
@@ -81,37 +85,49 @@ public:
 	/**
 	 * Constructor for a surface with fixed dimensions
 	 */
-	BaseSurface(int width, int height) : Graphics::Screen(width, height) {}
+	BaseSurface(int width, int height) : Graphics::Screen(width, height) {
+	}
 
 	/**
 	 * Destructor
 	 */
-	~BaseSurface() override {}
+	~BaseSurface() override {
+	}
 
 	/**
 	 * Return a rect containing the bounds of the surface
 	 */
-	Common::Rect getBounds() { return Common::Rect(0, 0, this->w, this->h); }
+	Common::Rect getBounds() {
+		return Common::Rect(0, 0, this->w, this->h);
+	}
 
 	/**
 	 * Return the pixels for the surface
 	 */
-	inline byte *getPixels() { return (byte *)Graphics::ManagedSurface::getPixels(); }
+	inline byte *getPixels() {
+		return (byte *)Graphics::ManagedSurface::getPixels();
+	}
 
 	/**
 	 * Return the pixels for the surface
 	 */
-	inline const void *getPixels() const { return (const byte *)Graphics::ManagedSurface::getPixels(); }
+	inline const void *getPixels() const {
+		return (const byte *)Graphics::ManagedSurface::getPixels();
+	}
 
 	/**
 	 * Return a pointer to a given position on the surface
 	 */
-	byte *getBasePtr(int x, int y) { return (byte *)Graphics::ManagedSurface::getBasePtr(x, y); }
+	byte *getBasePtr(int x, int y) {
+		return (byte *)Graphics::ManagedSurface::getBasePtr(x, y);
+	}
 
 	/**
 	 * Return a pointer to a given position on the surface
 	 */
-	inline const byte *getBasePtr(int x, int y) const { return (const byte *)Graphics::ManagedSurface::getBasePtr(x, y); }
+	inline const byte *getBasePtr(int x, int y) const {
+		return (const byte *)Graphics::ManagedSurface::getBasePtr(x, y);
+	}
 
 	/**
 	 * Draws a sprite
@@ -175,10 +191,13 @@ protected:
 	 * Override the addDirtyRect from Graphics::Screen, since for standard
 	 * surfaces we don't need dirty rects to be tracked
 	 */
-	void addDirtyRect(const Common::Rect &r) override {}
+	void addDirtyRect(const Common::Rect &r) override {
+	}
 public:
-	MSurface() : BaseSurface() {}
-	MSurface(int width, int height) : BaseSurface(width, height) {}
+	MSurface() : BaseSurface() {
+	}
+	MSurface(int width, int height) : BaseSurface(width, height) {
+	}
 };
 
 class DepthSurface : public MSurface {
@@ -191,7 +210,8 @@ public:
 	/**
 	 * Constructor
 	 */
-	DepthSurface() : MSurface(), _depthStyle(0) {}
+	DepthSurface() : MSurface(), _depthStyle(0) {
+	}
 
 	/**
 	 * Returns the depth at a given position
@@ -203,6 +223,7 @@ public:
 	int getDepthHighBit(const Common::Point &pt);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_MSURFACE_H */
+#endif
diff --git a/engines/mads/core/palette.cpp b/engines/mads/nebular/core/palette.cpp
similarity index 96%
rename from engines/mads/core/palette.cpp
rename to engines/mads/nebular/core/palette.cpp
index ce571b7d29b..0ac5b2f48a4 100644
--- a/engines/mads/core/palette.cpp
+++ b/engines/mads/nebular/core/palette.cpp
@@ -24,10 +24,11 @@
 #include "graphics/palette.h"
 #include "graphics/paletteman.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/msurface.h"
-#include "mads/core/staticres.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/staticres.h"
 
 namespace MADS {
+namespace Nebular {
 
 void RGB6::load(Common::SeekableReadStream *f) {
 	r = PALETTE_6BIT_TO_8BIT(f->readByte());
@@ -52,12 +53,12 @@ void PaletteUsage::load(Common::Array<UsageEntry> *data) {
 void PaletteUsage::getKeyEntries(Common::Array<RGB6> &palette) {
 	_data->clear();
 
-	 for (uint i = 0; i < palette.size(); ++i) {
-		 byte *uPtr = &palette[i]._flags;
-		 if ((*uPtr & 0x10) && _data->size() < 3) {
-			 _data->push_back(UsageEntry(i));
-		 }
-	 }
+	for (uint i = 0; i < palette.size(); ++i) {
+		byte *uPtr = &palette[i]._flags;
+		if ((*uPtr & 0x10) && _data->size() < 3) {
+			_data->push_back(UsageEntry(i));
+		}
+	}
 }
 
 static bool sortHelper(const PaletteUsage::UsageEntry &ue1, const PaletteUsage::UsageEntry &ue2) {
@@ -178,7 +179,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
 		if (!changed && !noUsageFlag) {
 			int bestHash = (palette[palIndex]._flags & 0x20) ||
 				(((flags & 0x2000) || (palette[palIndex]._flags & 0x40)) &&
-				((flags & 0x1000) || (palCount == 0))) ? 0x7fff : 1;
+					((flags & 0x1000) || (palCount == 0))) ? 0x7fff : 1;
 			int var36 = (palette[palIndex]._flags & 0x80) ? 0 : 2;
 
 			for (int idx = palLow; idx < palIdx; ++idx) {
@@ -188,8 +189,8 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
 					if (bestHash > 1) {
 						hash = rgbFactor(&_vm->_palette->_mainPalette[idx * 3], palette[palIndex]);
 					} else if (_vm->_palette->_mainPalette[idx * 3] != palette[palIndex].r ||
-							_vm->_palette->_mainPalette[idx * 3 + 1] != palette[palIndex].g ||
-							_vm->_palette->_mainPalette[idx * 3 + 2] != palette[palIndex].b) {
+						_vm->_palette->_mainPalette[idx * 3 + 1] != palette[palIndex].g ||
+						_vm->_palette->_mainPalette[idx * 3 + 2] != palette[palIndex].b) {
 						hash = 1;
 					} else {
 						hash = 0;
@@ -435,8 +436,8 @@ void Fader::setFullPalette(byte palette[PALETTE_SIZE]) {
 }
 
 void Fader::fadeOut(byte palette[PALETTE_SIZE], byte *paletteMap,
-		int baseColor, int numColors, int baseGrey, int numGreys,
-		int tickDelay, int steps) {
+	int baseColor, int numColors, int baseGrey, int numGreys,
+	int tickDelay, int steps) {
 	GreyEntry map[PALETTE_COUNT];
 	int intensity;
 	byte palIndex[PALETTE_COUNT][3];
@@ -546,7 +547,7 @@ void Fader::fadeIn(byte palette[PALETTE_SIZE], byte destPalette[PALETTE_SIZE],
 }
 
 void Fader::mapToGreyRamp(byte palette[PALETTE_SIZE], int baseColor, int numColors,
-		int baseGrey, int numGreys, GreyEntry *map) {
+	int baseGrey, int numGreys, GreyEntry *map) {
 	byte greyList[PALETTE_COUNT];
 	byte greyMapping[PALETTE_COUNT];
 	byte greyTable[64];
@@ -621,7 +622,7 @@ void Fader::mapToGreyRamp(byte palette[PALETTE_SIZE], int baseColor, int numColo
 }
 
 void Fader::getGreyValues(const byte palette[PALETTE_SIZE],
-		byte greyList[PALETTE_COUNT], int baseColor, int numColors) {
+	byte greyList[PALETTE_COUNT], int baseColor, int numColors) {
 	const byte *palP = &palette[baseColor * 3];
 
 	for (int i = 0; i < numColors; ++i, palP += 3) {
@@ -631,7 +632,7 @@ void Fader::getGreyValues(const byte palette[PALETTE_SIZE],
 }
 
 void Fader::greyPopularity(const byte greyList[PALETTE_COUNT],
-		byte greyTable[64], int numColors) {
+	byte greyTable[64], int numColors) {
 	Common::fill(&greyTable[0], &greyTable[64], 0);
 	for (int i = 0; i < numColors; ++i) {
 		int idx = greyList[i];
@@ -745,7 +746,7 @@ void Palette::setGradient(byte *palette, int start, int count, int rgbValue1, in
 	int rgbCurrent = rgbValue2;
 	int rgbDiff = -(rgbValue2 - rgbValue1);
 
-	if (count >  0) {
+	if (count > 0) {
 		byte *pDest = palette + start * 3;
 		int endVal = count - 1;
 		int numLeft = count;
@@ -892,7 +893,7 @@ void Palette::refreshSceneColors() {
 }
 
 int Palette::closestColor(const byte *matchColor, const byte *refPalette,
-		int paletteInc, int count) {
+	int paletteInc, int count) {
 	int bestColor = 0;
 	int bestDistance = 0x7fff;
 
@@ -916,5 +917,5 @@ int Palette::closestColor(const byte *matchColor, const byte *refPalette,
 	return bestColor;
 }
 
-
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/palette.h b/engines/mads/nebular/core/palette.h
similarity index 86%
rename from engines/mads/core/palette.h
rename to engines/mads/nebular/core/palette.h
index cecb0c23eea..e733e3835d7 100644
--- a/engines/mads/core/palette.h
+++ b/engines/mads/nebular/core/palette.h
@@ -26,6 +26,7 @@
 #include "common/stream.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
@@ -42,13 +43,13 @@ constexpr int PALETTE_SIZE = (256 * 3);
  * Palette mapping options
  */
 enum {
-	PALFLAG_BACKGROUND		= 0x8000,  // Loading initial background
-	PALFLAG_RESERVED		= 0x4000,  // Enable mapping reserved colors
-	PALFLAG_ANY_TO_CLOSEST	= 0x2000,  // Any color can map to closest
-	PALFLAG_ALL_TO_CLOSEST	= 0x1000,  // Any colors that can map must map
-	PALFLAG_TOP_COLORS		= 0x0800,  // Allow mapping to high four colors
-	PALFLAG_DEFINE_RESERVED	= 0x0400,  // Define initial reserved color
-	PALFLAG_MASK			= 0xfc00   // Mask for all the palette flags
+	PALFLAG_BACKGROUND = 0x8000,  // Loading initial background
+	PALFLAG_RESERVED = 0x4000,  // Enable mapping reserved colors
+	PALFLAG_ANY_TO_CLOSEST = 0x2000,  // Any color can map to closest
+	PALFLAG_ALL_TO_CLOSEST = 0x1000,  // Any colors that can map must map
+	PALFLAG_TOP_COLORS = 0x0800,  // Allow mapping to high four colors
+	PALFLAG_DEFINE_RESERVED = 0x0400,  // Define initial reserved color
+	PALFLAG_MASK = 0xfc00   // Mask for all the palette flags
 };
 
 struct PaletteCycle {
@@ -57,7 +58,9 @@ struct PaletteCycle {
 	byte _firstColorIndex;
 	byte _ticks;
 
-	PaletteCycle() { _colorCount = _firstListColor = _firstColorIndex = _ticks = 0; }
+	PaletteCycle() {
+		_colorCount = _firstListColor = _firstColorIndex = _ticks = 0;
+	}
 };
 
 struct RGB6 {
@@ -80,13 +83,19 @@ public:
 		uint16 _palIndex;
 		int _sortValue;
 
-		UsageEntry(int palIndex) { _palIndex = palIndex; _sortValue = -1; }
-		UsageEntry() { _palIndex = 0; _sortValue = 0; }
+		UsageEntry(int palIndex) {
+			_palIndex = palIndex; _sortValue = -1;
+		}
+		UsageEntry() {
+			_palIndex = 0; _sortValue = 0;
+		}
 	};
 	struct UsageRange {
 		byte _v1, _v2;
 
-		UsageRange(byte v1, byte v2) { _v1 = v1; _v2 = v2; }
+		UsageRange(byte v1, byte v2) {
+			_v1 = v1; _v2 = v2;
+		}
 	};
 private:
 	RexNebularEngine *_vm;
@@ -108,14 +117,20 @@ public:
 	/**
 	 * Returns whether the usage list is empty
 	 */
-	bool empty() const { return _data == nullptr; }
+	bool empty() const {
+		return _data == nullptr;
+	}
 
-	uint16 &operator[](int index) { return (*_data)[index]._palIndex; }
+	uint16 &operator[](int index) {
+		return (*_data)[index]._palIndex;
+	}
 
 	/**
 	 * Assigns the class to an empty usage array
 	 */
-	void setEmpty() { _data = &_nullUsage; }
+	void setEmpty() {
+		_data = &_nullUsage;
+	}
 
 	/**
 	 * Gets key entries from the passed palette
@@ -144,7 +159,9 @@ class RGBList {
 private:
 	bool _data[32];
 public:
-	RGBList() { clear(); }
+	RGBList() {
+		clear();
+	}
 
 	void clear();
 
@@ -160,7 +177,9 @@ public:
 	 */
 	int scan();
 
-	bool &operator[](int idx) { return _data[idx]; }
+	bool &operator[](int idx) {
+		return _data[idx];
+	}
 };
 
 class Fader {
@@ -269,7 +288,8 @@ public:
 	/**
 	 * Destructor
 	 */
-	virtual ~Palette() {}
+	virtual ~Palette() {
+	}
 
 	/**
 	* Set a palette entry
@@ -319,6 +339,7 @@ public:
 		int paletteInc, int count);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_PALETTE_H */
+#endif
diff --git a/engines/mads/core/player.cpp b/engines/mads/nebular/core/player.cpp
similarity index 98%
rename from engines/mads/core/player.cpp
rename to engines/mads/nebular/core/player.cpp
index a0c256403c1..1d2aa94b3d2 100644
--- a/engines/mads/core/player.cpp
+++ b/engines/mads/nebular/core/player.cpp
@@ -21,9 +21,10 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/player.h"
+#include "mads/nebular/core/player.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define PLAYER_SEQ_INDEX -2
 
@@ -157,7 +158,7 @@ bool Player::loadSprites(const Common::String &prefix) {
 			if (Common::File::exists(setName)) {
 				setIndex = _vm->_game->_scene._sprites.addSprites(setName, 4);
 				++_numSprites;
-			}  else if (fileIndex < 5) {
+			} else if (fileIndex < 5) {
 				_highSprites = false;
 				return true;
 			} else {
@@ -398,7 +399,7 @@ void Player::update() {
 				int playerY = slot._position.y;
 
 				if ((playerX + xScale) < 0 || (playerX + xScale) >= MADS_SCREEN_WIDTH ||
-						playerY < 0 || (playerY + yScale) >= MADS_SCENE_HEIGHT) {
+					playerY < 0 || (playerY + yScale) >= MADS_SCENE_HEIGHT) {
 					scene._nextSceneId = _walkOffScreen;
 					_walkOffScreen = 0;
 					_walkAnywhere = false;
@@ -583,7 +584,7 @@ void Player::idle() {
 	if (frameIndex >= spriteSet._charInfo->_numEntries) {
 		// Reset back to the start of the list
 		_frameListIndex = 0;
-	}  else {
+	} else {
 		_frameNumber += direction;
 		_forceRefresh = true;
 
@@ -614,11 +615,11 @@ int Player::getSpriteSlot() {
 
 	for (uint idx = 0; idx < spriteSlots.size(); ++idx) {
 		if (spriteSlots[idx]._seqIndex == PLAYER_SEQ_INDEX &&
-				spriteSlots[idx]._flags >= IMG_STATIC)
+			spriteSlots[idx]._flags >= IMG_STATIC)
 			return idx;
 	}
 
-	return - 1;
+	return -1;
 }
 
 int Player::getScale(int yp) {
@@ -696,7 +697,8 @@ void Player::startMovement() {
 	case 1:
 		_turnToFacing = (_yDirection <= 0) ? FACING_NORTH : FACING_SOUTH;
 		break;
-	case 2: {
+	case 2:
+	{
 		_turnToFacing = (Facing)(((_yDirection <= 0) ? 9 : 3) - ((_xDirection <= 0) ? 2 : 0));
 		break;
 	}
@@ -867,4 +869,5 @@ void Player::resetFacing(Facing facing) {
 	selectSeries();
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/player.h b/engines/mads/nebular/core/player.h
similarity index 96%
rename from engines/mads/core/player.h
rename to engines/mads/nebular/core/player.h
index 658913826dc..9ab5e87a6a5 100644
--- a/engines/mads/core/player.h
+++ b/engines/mads/nebular/core/player.h
@@ -27,6 +27,7 @@
 #include "common/serializer.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 class MADSAction;
@@ -48,15 +49,18 @@ struct StopWalkerEntry {
 	int _stack;
 	int _trigger;
 
-	StopWalkerEntry() : _stack(0), _trigger(0) {}
-	StopWalkerEntry(int stack, int trigger) : _stack(stack), _trigger(trigger) {}
+	StopWalkerEntry() : _stack(0), _trigger(0) {
+	}
+	StopWalkerEntry(int stack, int trigger) : _stack(stack), _trigger(trigger) {
+	}
 
 	void synchronize(Common::Serializer &s);
 };
 
 class StopWalkers : public Common::FixedStack<StopWalkerEntry, 12> {
 public:
-	StopWalkers() : Common::FixedStack<StopWalkerEntry, 12>() {}
+	StopWalkers() : Common::FixedStack<StopWalkerEntry, 12>() {
+	}
 
 	void synchronize(Common::Serializer &s);
 };
@@ -256,6 +260,7 @@ public:
 
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_PLAYER_H */
+#endif
diff --git a/engines/mads/core/rails.cpp b/engines/mads/nebular/core/rails.cpp
similarity index 98%
rename from engines/mads/core/rails.cpp
rename to engines/mads/nebular/core/rails.cpp
index f2fd09bcb40..0ea70ed25be 100644
--- a/engines/mads/core/rails.cpp
+++ b/engines/mads/nebular/core/rails.cpp
@@ -21,9 +21,10 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/rails.h"
+#include "mads/nebular/core/rails.h"
 
 namespace MADS {
+namespace Nebular {
 
 WalkNode::WalkNode() {
 	_active = false;
@@ -287,4 +288,5 @@ void Rails::disableLine(int from, int to) {
 	_nodes[to]._distances[from] = 0x3FFF;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/rails.h b/engines/mads/nebular/core/rails.h
similarity index 90%
rename from engines/mads/core/rails.h
rename to engines/mads/nebular/core/rails.h
index 516c729013f..2773cebc727 100644
--- a/engines/mads/core/rails.h
+++ b/engines/mads/nebular/core/rails.h
@@ -27,9 +27,10 @@
 #include "common/rect.h"
 #include "common/serializer.h"
 #include "common/stack.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 class WalkNode {
 public:
@@ -105,22 +106,32 @@ public:
 	/*
 	 * Return the number of walk nodes in the calculated route
 	 */
-	int size() const { return _routeIndexes.size(); }
+	int size() const {
+		return _routeIndexes.size();
+	}
 
 	/**
 	 * Returns true if the current calculated walk route is empty
 	 */
-	bool empty() const { return _routeIndexes.empty(); }
+	bool empty() const {
+		return _routeIndexes.empty();
+	}
 
 	/**
 	 * Returns the data for a given walk node
 	 */
-	const WalkNode &operator[](int idx) { return _nodes[_routeIndexes[idx]]; }
+	const WalkNode &operator[](int idx) {
+		return _nodes[_routeIndexes[idx]];
+	}
 
 	const WalkNode &popNode();
 
-	void resetNext() { _next = 0; }
-	int  getNext() { return _next; }
+	void resetNext() {
+		_next = 0;
+	}
+	int  getNext() {
+		return _next;
+	}
 
 	/**
 	 * Synchronize the data for the route
@@ -132,6 +143,7 @@ public:
 
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_RAILS_H */
+#endif
diff --git a/engines/mads/core/resources.cpp b/engines/mads/nebular/core/resources.cpp
similarity index 94%
rename from engines/mads/core/resources.cpp
rename to engines/mads/nebular/core/resources.cpp
index ae7631b448b..8d73b195f1c 100644
--- a/engines/mads/core/resources.cpp
+++ b/engines/mads/nebular/core/resources.cpp
@@ -24,10 +24,11 @@
 #include "common/textconsole.h"
 #include "mads/mads.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/resources.h"
-#include "mads/core/hag.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/hag.h"
 
 namespace MADS {
+namespace Nebular {
 
 void Resources::init(RexNebularEngine *vm) {
 	SearchMan.add("HAG", new HagArchive(vm->getGameID(), vm->isDemo()));
@@ -62,7 +63,7 @@ Common::Path Resources::formatName(RESPREFIX resType, int id, const Common::Stri
 }
 
 Common::Path Resources::formatName(int prefix, char asciiCh, int id, EXTTYPE extType,
-		const Common::String &suffix) {
+	const Common::String &suffix) {
 	Common::String result;
 	if (prefix <= 0) {
 		result = "*";
@@ -104,8 +105,8 @@ Common::Path Resources::formatName(int prefix, char asciiCh, int id, EXTTYPE ext
 }
 
 Common::Path Resources::formatResource(const Common::String &resName,
-		const Common::String &hagFilename) {
-//	int v1 = 0, v2 = 0;
+	const Common::String &hagFilename) {
+	//	int v1 = 0, v2 = 0;
 
 	if (resName.hasPrefix("*")) {
 		// Resource file specified
@@ -149,4 +150,5 @@ void SynchronizedList::synchronize(Common::Serializer &s) {
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/resources.h b/engines/mads/nebular/core/resources.h
similarity index 94%
rename from engines/mads/core/resources.h
rename to engines/mads/nebular/core/resources.h
index b6f9cf6ad61..5307001758b 100644
--- a/engines/mads/core/resources.h
+++ b/engines/mads/nebular/core/resources.h
@@ -28,6 +28,7 @@
 #include "common/str.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum RESPREFIX {
 	RESPREFIX_GL = 1, RESPREFIX_SC = 2, RESPREFIX_RM = 3
@@ -62,12 +63,15 @@ public:
 	/**
 	 * Constructor
 	 */
-	File() : Common::File() {}
+	File() : Common::File() {
+	}
 
 	/**
 	 * Constructor
 	 */
-	File(const Common::Path &filename) { openFile(filename); }
+	File(const Common::Path &filename) {
+		openFile(filename);
+	}
 
 	/**
 	 * Opens the given file, throwing an error if it can't be opened
@@ -83,6 +87,7 @@ public:
 	void synchronize(Common::Serializer &s);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/core/scene.cpp b/engines/mads/nebular/core/scene.cpp
similarity index 96%
rename from engines/mads/core/scene.cpp
rename to engines/mads/nebular/core/scene.cpp
index e5e3c50767f..cd5837757f6 100644
--- a/engines/mads/core/scene.cpp
+++ b/engines/mads/nebular/core/scene.cpp
@@ -20,19 +20,20 @@
  */
 
 #include "common/scummsys.h"
-#include "mads/core/scene.h"
-#include "mads/core/compression.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/compression.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/audio.h"
+#include "mads/nebular/core/audio.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
+namespace Nebular {
 
 Scene::Scene(RexNebularEngine *vm)
 	: _vm(vm), _action(_vm), _depthSurface(),
-	  _dirtyAreas(_vm),  _dynamicHotspots(vm), _hotspots(vm),
-	  _kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm),
-	  _textDisplay(vm), _userInterface(vm) {
+	_dirtyAreas(_vm), _dynamicHotspots(vm), _hotspots(vm),
+	_kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm),
+	_textDisplay(vm), _userInterface(vm) {
 	_priorSceneId = 0;
 	_nextSceneId = 0;
 	_currentSceneId = 0;
@@ -116,7 +117,7 @@ void Scene::clearSequenceList() {
 void Scene::clearMessageList() {
 	_kernelMessages.clear();
 	_talkFont = FONT_CONVERSATION;
-	_textSpacing  = -1;
+	_textSpacing = -1;
 }
 
 void Scene::loadSceneLogic() {
@@ -227,7 +228,7 @@ void Scene::loadVocab() {
 		InventoryObject &io = _vm->_game->_objects[objIndex];
 		addActiveVocab(io._descId);
 
-		for (int vocabIndex = 0; vocabIndex <io._vocabCount; ++vocabIndex) {
+		for (int vocabIndex = 0; vocabIndex < io._vocabCount; ++vocabIndex) {
 			addActiveVocab(io._vocabList[vocabIndex]._vocabId);
 		}
 	}
@@ -378,12 +379,12 @@ void Scene::doFrame() {
 
 		// Check all on-screen visual objects
 		_vm->_game->_screenObjects.check(player._stepEnabled && !player._needToWalk &&
-				!_vm->_game->_fx);
+			!_vm->_game->_fx);
 	}
 
 	_vm->_game->camUpdate();
 	if (_action._selectedAction && player._stepEnabled && !player._needToWalk &&
-			!_vm->_game->_trigger && !player._trigger) {
+		!_vm->_game->_trigger && !player._trigger) {
 		_action.startAction();
 		if (_action._activeAction._verbId == Nebular::VERB_LOOK_AT) {
 			_action._activeAction._verbId = VERB_LOOK;
@@ -403,8 +404,8 @@ void Scene::doFrame() {
 
 	// Handle parser actions as well as game triggers
 	if ((_action._inProgress && !player._moving && !player._needToWalk &&
-			(player._facing == player._turnToFacing) && !_vm->_game->_trigger) ||
-			(_vm->_game->_trigger && (_vm->_game->_triggerMode == SEQUENCE_TRIGGER_PARSER))) {
+		(player._facing == player._turnToFacing) && !_vm->_game->_trigger) ||
+		(_vm->_game->_trigger && (_vm->_game->_triggerMode == SEQUENCE_TRIGGER_PARSER))) {
 		doAction();
 	}
 
@@ -535,7 +536,7 @@ void  Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) {
 
 void Scene::doPreactions() {
 	if (_vm->_game->_screenObjects._inputMode == kInputBuildingSentences ||
-			_vm->_game->_screenObjects._inputMode == kInputLimitedSentences) {
+		_vm->_game->_screenObjects._inputMode == kInputLimitedSentences) {
 		_vm->_game->_triggerSetupMode = SEQUENCE_TRIGGER_PREPARE;
 		_action.checkAction();
 		_sceneLogic->preActions();
@@ -571,7 +572,7 @@ void Scene::doAction() {
 		}
 
 		if ((_action._inProgress || _vm->_game->_trigger) &&
-				(!flag || _action._savedFields._commandError == flag)) {
+			(!flag || _action._savedFields._commandError == flag)) {
 			_vm->_game->doObjectAction();
 		}
 
@@ -596,7 +597,7 @@ void Scene::doAction() {
 		_vm->_game->_trigger = 0;
 
 	if (_vm->_gameConv->active() && (_vm->_gameConv->currentMode() == CONVMODE_WAIT_AUTO ||
-			_vm->_gameConv->currentMode() == CONVMODE_WAIT_ENTRY))
+		_vm->_gameConv->currentMode() == CONVMODE_WAIT_ENTRY))
 		_vm->_gameConv->update(true);
 }
 
@@ -675,7 +676,7 @@ void Scene::updateCursor() {
 		}
 
 		cursorId = _vm->_events->_newCursorId == CURSOR_NONE ?
-		CURSOR_ARROW : _vm->_events->_newCursorId;
+			CURSOR_ARROW : _vm->_events->_newCursorId;
 	}
 
 	if (!player._stepEnabled)
@@ -860,7 +861,7 @@ void Scene::playSpeech(int idx) {
 	_vm->_audio->playSound(idx - 1);
 }
 
-void Scene::sceneScale(int yFront, int maxScale, int yBack,  int minScale) {
+void Scene::sceneScale(int yFront, int maxScale, int yBack, int minScale) {
 	_sceneInfo->_yBandsEnd = yFront;
 	_sceneInfo->_maxScale = maxScale;
 	_sceneInfo->_yBandsStart = yBack;
@@ -878,4 +879,5 @@ void Scene::animations_tick() {
 	}
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/scene.h b/engines/mads/nebular/core/scene.h
similarity index 88%
rename from engines/mads/core/scene.h
rename to engines/mads/nebular/core/scene.h
index fad7902ba0d..9acde59a750 100644
--- a/engines/mads/core/scene.h
+++ b/engines/mads/nebular/core/scene.h
@@ -25,21 +25,24 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/rect.h"
-#include "mads/core/assets.h"
-#include "mads/core/screen.h"
-#include "mads/core/hotspots.h"
-#include "mads/core/messages.h"
-#include "mads/core/msurface.h"
-#include "mads/core/scene_data.h"
-#include "mads/core/animation.h"
-#include "mads/core/rails.h"
-#include "mads/core/sequence.h"
-#include "mads/core/sprites.h"
-#include "mads/core/user_interface.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/hotspots.h"
+#include "mads/nebular/core/messages.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/scene_data.h"
+#include "mads/nebular/core/animation.h"
+#include "mads/nebular/core/rails.h"
+#include "mads/nebular/core/sequence.h"
+#include "mads/nebular/core/sprites.h"
+#include "mads/nebular/core/user_interface.h"
 
 namespace MADS {
+namespace Nebular {
 
-enum { RETURNING_FROM_DIALOG = -2, RETURNING_FROM_LOADING = -1 };
+enum {
+	RETURNING_FROM_DIALOG = -2, RETURNING_FROM_LOADING = -1
+};
 
 class Scene {
 private:
@@ -217,7 +220,9 @@ public:
 	/**
 	 * Returns a vocab entry
 	 */
-	Common::String getVocab(int vocabId) { return _vocabStrings[vocabId - 1]; }
+	Common::String getVocab(int vocabId) {
+		return _vocabStrings[vocabId - 1];
+	}
 
 	/**
 	 * Clear the data for the currently loaded scene
@@ -261,12 +266,13 @@ public:
 	void deleteSequence(int idx);
 	void loadSpeech(int idx);
 	void playSpeech(int idx);
-	void sceneScale(int yFront, int maxScale, int yBack,  int minScale);
+	void sceneScale(int yFront, int maxScale, int yBack, int minScale);
 	void animations_tick();
 
 	int _speechReady;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_SCENE_H */
+#endif
diff --git a/engines/mads/core/scene_data.cpp b/engines/mads/nebular/core/scene_data.cpp
similarity index 97%
rename from engines/mads/core/scene_data.cpp
rename to engines/mads/nebular/core/scene_data.cpp
index 55679e2ceba..fd5a6b6fc44 100644
--- a/engines/mads/core/scene_data.cpp
+++ b/engines/mads/nebular/core/scene_data.cpp
@@ -20,14 +20,15 @@
  */
 
 #include "common/scummsys.h"
-#include "mads/core/scene_data.h"
+#include "mads/nebular/core/scene_data.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
-#include "mads/core/screen.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/resources.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
+namespace Nebular {
 
 KernelMessage::KernelMessage() {
 	_flags = 0;
@@ -121,7 +122,7 @@ SceneInfo *SceneInfo::init(RexNebularEngine *vm) {
 }
 
 void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
-		int flags, DepthSurface &depthSurface, BaseSurface &bgSurface) {
+	int flags, DepthSurface &depthSurface, BaseSurface &bgSurface) {
 	bool sceneFlag = sceneId >= 0;
 
 	// Figure out the resource to use
@@ -361,7 +362,7 @@ void SceneInfo::loadMadsV1Background(int sceneId, const Common::String &resName,
 	MadsPack artResource(&artFile);
 
 	// Read inhh the background surface data
-	assert(_width  && _height == bgSurface.h);
+	assert(_width && _height == bgSurface.h);
 	stream = artResource.getItemStream(1);
 	stream->read(bgSurface.getPixels(), bgSurface.w * bgSurface.h);
 	delete stream;
@@ -461,7 +462,7 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName,
 	for (int i = 0; i < tileCount; i++) {
 		tileDataUncomp->seek(i * 4, SEEK_SET);
 		uint32 tileOfs = tileDataUncomp->readUint32LE();
-		MSurface* newTile = new MSurface(tileWidth, tileHeight);
+		MSurface *newTile = new MSurface(tileWidth, tileHeight);
 
 		if (i == tileCount - 1)
 			compressedTileDataSize = tileDataFile.size() - tileOfs;
@@ -477,7 +478,7 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName,
 		tileDataFile.seek(tileDataPack.getDataOffset() + tileOfs, SEEK_SET);
 		tileDataFile.read(compressedTileData, compressedTileDataSize);
 
-		fab.decompress(compressedTileData, compressedTileDataSize, (byte*)newTile->getPixels(), tileWidth * tileHeight);
+		fab.decompress(compressedTileData, compressedTileDataSize, (byte *)newTile->getPixels(), tileWidth * tileHeight);
 		tileSet.push_back(TileSetList::value_type(newTile));
 		delete[] compressedTileData;
 	}
@@ -513,4 +514,5 @@ SceneLogic::SceneLogic(RexNebularEngine *vm) : _vm(vm) {
 	_scene = &_vm->_game->_scene;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/scene_data.h b/engines/mads/nebular/core/scene_data.h
similarity index 84%
rename from engines/mads/core/scene_data.h
rename to engines/mads/nebular/core/scene_data.h
index ce8fc85debc..e3b15ce2d37 100644
--- a/engines/mads/core/scene_data.h
+++ b/engines/mads/nebular/core/scene_data.h
@@ -28,16 +28,17 @@
 #include "common/str.h"
 #include "common/str-array.h"
 #include "common/rect.h"
-#include "mads/core/action.h"
-#include "mads/core/assets.h"
-#include "mads/core/events.h"
-#include "mads/core/game_data.h"
-#include "mads/core/hotspots.h"
-#include "mads/core/messages.h"
-#include "mads/core/rails.h"
-#include "mads/core/user_interface.h"
+#include "mads/nebular/core/action.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/game_data.h"
+#include "mads/nebular/core/hotspots.h"
+#include "mads/nebular/core/messages.h"
+#include "mads/nebular/core/rails.h"
+#include "mads/nebular/core/user_interface.h"
 
 namespace MADS {
+namespace Nebular {
 
 class MADSEngine;
 class Scene;
@@ -53,9 +54,9 @@ class SpriteSlot;
 #define DIRTY_AREAS_SIZE (SPRITE_SLOTS_MAX_SIZE + TEXT_DISPLAY_MAX_SIZE)
 
 enum {
-	SCENEFLAG_DITHER		= 0x01,     // Dither to 16 colors
-	SCENEFLAG_LOAD_SHADOW	= 0x10,		// Load hard shadows
-	SCENEFLAG_TRANSLATE		= 0x10000	// Translate palette of loaded background
+	SCENEFLAG_DITHER = 0x01,     // Dither to 16 colors
+	SCENEFLAG_LOAD_SHADOW = 0x10,		// Load hard shadows
+	SCENEFLAG_TRANSLATE = 0x10000	// Translate palette of loaded background
 };
 
 class VerbInit {
@@ -64,7 +65,8 @@ public:
 	VerbType _verbType;
 	PrepType _prepType;
 
-	VerbInit() {}
+	VerbInit() {
+	}
 	VerbInit(int id, VerbType verbType, PrepType prepType)
 		: _id(id), _verbType(verbType), _prepType(prepType) {
 	}
@@ -83,7 +85,8 @@ public:
 	/**
 	 * Destructor
 	 */
-	virtual ~SceneLogic() {}
+	virtual ~SceneLogic() {
+	}
 
 	/**
 	 * Called to initially setup a scene
@@ -98,12 +101,14 @@ public:
 	/**
 	 * Called one per frame
 	 */
-	virtual void step() {}
+	virtual void step() {
+	}
 
 	/**
 	 * Called before an action is started
 	 */
-	virtual void preActions() {}
+	virtual void preActions() {
+	}
 
 	/**
 	 * Handles scene actions
@@ -113,17 +118,20 @@ public:
 	/**
 	 * Post-action handling
 	 */
-	virtual void postActions() {}
+	virtual void postActions() {
+	}
 
 	/**
 	 * Unhandled action handling
 	 */
-	virtual void unhandledAction() {}
+	virtual void unhandledAction() {
+	}
 
 	/**
 	 * Synchronize any local data for the scene
 	 */
-	virtual void synchronize(Common::Serializer &s) {}
+	virtual void synchronize(Common::Serializer &s) {
+	}
 };
 
 struct ARTHeader {
@@ -177,7 +185,8 @@ public:
 	/**
 	 * Destructor
 	 */
-	virtual ~SceneInfo() {}
+	virtual ~SceneInfo() {
+	}
 
 	/**
 	 * Instantiates the class
@@ -220,6 +229,7 @@ public:
 	virtual void loadCodes(BaseSurface &depthSurface, Common::SeekableReadStream *stream) = 0;
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_SCENE_DATA_H */
+#endif
diff --git a/engines/mads/core/screen.cpp b/engines/mads/nebular/core/screen.cpp
similarity index 94%
rename from engines/mads/core/screen.cpp
rename to engines/mads/nebular/core/screen.cpp
index 85efca2174d..a8aaca10459 100644
--- a/engines/mads/core/screen.cpp
+++ b/engines/mads/nebular/core/screen.cpp
@@ -21,12 +21,13 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/game.h"
-#include "mads/core/screen.h"
-#include "mads/core/palette.h"
-#include "mads/core/user_interface.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/palette.h"
+#include "mads/nebular/core/user_interface.h"
 
 namespace MADS {
+namespace Nebular {
 
 RexNebularEngine *DirtyArea::_vm = nullptr;
 
@@ -132,7 +133,8 @@ void DirtyArea::setUISlot(const UISlot *slot) {
 		setArea(slot->_width, slot->_height, intSurface.w, intSurface.h);
 		break;
 
-	default: {
+	default:
+	{
 		SpriteAsset *asset = _vm->_game->_scene._sprites[slot->_spritesIndex];
 		MSprite *frame = asset->getFrame(slot->_frameNumber - 1);
 		int w = frame->w;
@@ -219,19 +221,19 @@ void DirtyAreas::copy(BaseSurface *srcSurface, BaseSurface *destSurface, const C
 }
 
 void DirtyAreas::copyToScreen() {
-/*
-	for (uint i = 0; i < size(); ++i) {
-		const Common::Rect &bounds = (*this)[i]._bounds;
+	/*
+		for (uint i = 0; i < size(); ++i) {
+			const Common::Rect &bounds = (*this)[i]._bounds;
 
-		// Check if this is a sane rectangle before attempting to create it
-		if (bounds.left >= bounds.right || bounds.top >= bounds.bottom)
-			continue;
+			// Check if this is a sane rectangle before attempting to create it
+			if (bounds.left >= bounds.right || bounds.top >= bounds.bottom)
+				continue;
 
-		if ((*this)[i]._active && (*this)[i]._bounds.isValidRect()) {
-			_vm->_screen->copyRectToScreen(bounds);
+			if ((*this)[i]._active && (*this)[i]._bounds.isValidRect()) {
+				_vm->_screen->copyRectToScreen(bounds);
+			}
 		}
-	}
-	*/
+		*/
 }
 
 void DirtyAreas::reset() {
@@ -286,7 +288,7 @@ void ScreenObjects::check(bool scanFlag) {
 		_vm->_events->_rightMousePressed = false;
 
 	if ((_vm->_events->_mouseMoved || userInterface._scrollbarActive
-			|| _v8332A || _forceRescan) && scanFlag) {
+		|| _v8332A || _forceRescan) && scanFlag) {
 		_category = CAT_NONE;
 		_selectedObject = scanBackwards(_vm->_events->currentPos(), SCREENMODE_VGA);
 		if (_selectedObject > 0) {
@@ -343,12 +345,12 @@ void ScreenObjects::check(bool scanFlag) {
 	if (currentTicks >= _baseTime) {
 		// Check the user interface slots to see if there's any slots that need to be expired
 		UISlots &uiSlots = userInterface._uiSlots;
-		for (uint idx = 0; idx <  uiSlots.size(); ++idx) {
+		for (uint idx = 0; idx < uiSlots.size(); ++idx) {
 			UISlot &slot = uiSlots[idx];
 
 			if (slot._flags != IMG_REFRESH && slot._flags > IMG_UPDATE_ONLY
 				&& slot._segmentId != IMG_SPINNING_OBJECT)
-					slot._flags = IMG_ERASE;
+				slot._flags = IMG_ERASE;
 		}
 
 		// Any background animation in the user interface
@@ -527,12 +529,12 @@ void ScreenObjects::elementHighlighted() {
 
 	if (_category == CAT_INV_LIST || _category == CAT_INV_ANIM) {
 		if (action._interAwaiting == AWAITING_COMMAND && newIndex >= 0 && _released &&
-				(!_vm->_events->_mouseReleased || !_vm->_easyMouse))
+			(!_vm->_events->_mouseReleased || !_vm->_easyMouse))
 			newIndex = -1;
 	}
 
 	if (_released && !_vm->_events->_rightMousePressed &&
-			(_vm->_events->_mouseReleased || !_vm->_easyMouse))
+		(_vm->_events->_mouseReleased || !_vm->_easyMouse))
 		newIndex = -1;
 
 	if (_category != CAT_HOTSPOT && _category != CAT_INV_ANIM)
@@ -554,7 +556,7 @@ void ScreenObjects::synchronize(Common::Serializer &s) {
 
 /*------------------------------------------------------------------------*/
 
-Screen::Screen(): BaseSurface() {
+Screen::Screen() : BaseSurface() {
 	// Create the screen surface separately on another surface, since the screen
 	// surface will be subject to change as the clipping area is altered
 	_rawSurface.create(MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT);
@@ -605,9 +607,10 @@ void Screen::transition(ScreenTransition transitionType, bool surfaceFlag) {
 	Common::Rect clipBounds = getClipBounds();
 	clearDirtyRects();
 
- 	switch (transitionType) {
+	switch (transitionType) {
 	case kTransitionFadeIn:
-	case kTransitionFadeOutIn: {
+	case kTransitionFadeOutIn:
+	{
 		Common::fill(&pal._colorValues[0], &pal._colorValues[3], 0);
 		Common::fill(&pal._colorFlags[0], &pal._colorFlags[3], false);
 		resetClipBounds();
@@ -669,8 +672,8 @@ void Screen::transition(ScreenTransition transitionType, bool surfaceFlag) {
 }
 
 void Screen::panTransition(MSurface &newScreen, byte *palData, int entrySide,
-		const Common::Point &srcPos, const Common::Point &destPos,
-		ThroughBlack throughBlack, bool setPalette_, int numTicks) {
+	const Common::Point &srcPos, const Common::Point &destPos,
+	ThroughBlack throughBlack, bool setPalette_, int numTicks) {
 	EventsManager &events = *_vm->_events;
 	Palette &palette = *_vm->_palette;
 	Common::Point size;
@@ -678,7 +681,7 @@ void Screen::panTransition(MSurface &newScreen, byte *palData, int entrySide,
 	int startX = 0;
 	int deltaX;
 	int loopStart;
-//	uint32 baseTicks, currentTicks;
+	//	uint32 baseTicks, currentTicks;
 	byte paletteMap[256];
 
 	size.x = MIN(newScreen.w, (int16)MADS_SCREEN_WIDTH);
@@ -702,7 +705,7 @@ void Screen::panTransition(MSurface &newScreen, byte *palData, int entrySide,
 
 	y1 = 0;
 	y2 = size.y - 1;
-//	sizeY = y2 - y1 + 1;
+	//	sizeY = y2 - y1 + 1;
 
 	if (throughBlack == THROUGH_BLACK2)
 		swapForeground(palData, &paletteMap[0]);
@@ -718,11 +721,11 @@ void Screen::panTransition(MSurface &newScreen, byte *palData, int entrySide,
 				copyRectTranslate(newScreen, paletteMap,
 					Common::Point(xAt, destPos.y),
 					Common::Rect(srcPos.x + xAt, srcPos.y,
-					srcPos.x + xAt + 1, srcPos.y + size.y));
+						srcPos.x + xAt + 1, srcPos.y + size.y));
 			} else {
 				newScreen.copyRectToSurface(*this, xAt, destPos.y,
 					Common::Rect(srcPos.x + xAt, srcPos.y,
-					srcPos.x + xAt + 1, srcPos.y + size.y));
+						srcPos.x + xAt + 1, srcPos.y + size.y));
 			}
 
 			// Slight delay
@@ -781,7 +784,7 @@ void Screen::swapForeground(byte newPalette[PALETTE_SIZE], byte *paletteMap) {
  * respectively, with the two interleaved together. So the start
  */
 void Screen::swapPalette(const byte *palData, byte swapTable[PALETTE_COUNT],
-		bool foreground) {
+	bool foreground) {
 	int start = foreground ? 1 : 0;
 	const byte *dynamicList = &palData[start * RGB_SIZE];
 	int staticStart = 1 - start;
@@ -813,4 +816,5 @@ void Screen::resetClipBounds() {
 	setClipBounds(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT));
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/screen.h b/engines/mads/nebular/core/screen.h
similarity index 96%
rename from engines/mads/core/screen.h
rename to engines/mads/nebular/core/screen.h
index 0e395a6cf11..0d3ff5f32eb 100644
--- a/engines/mads/core/screen.h
+++ b/engines/mads/nebular/core/screen.h
@@ -24,10 +24,11 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "mads/core/msurface.h"
-#include "mads/core/action.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/action.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define MADS_SCREEN_WIDTH 320
 #define MADS_SCREEN_HEIGHT 200
@@ -96,8 +97,8 @@ public:
 };
 
 class DirtyAreas : public Common::Array<DirtyArea> {
-//private:
-//	RexNebularEngine *_vm;
+	//private:
+	//	RexNebularEngine *_vm;
 public:
 	DirtyAreas(RexNebularEngine *vm);
 
@@ -229,7 +230,8 @@ public:
 	/**
 	 * Destructor
 	 */
-	~Screen() override {}
+	~Screen() override {
+	}
 
 	/**
 	 * Updates the physical screen with contents of the internal surface
@@ -260,6 +262,7 @@ public:
 	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_SCREEN_H */
+#endif
diff --git a/engines/mads/core/sequence.cpp b/engines/mads/nebular/core/sequence.cpp
similarity index 97%
rename from engines/mads/core/sequence.cpp
rename to engines/mads/nebular/core/sequence.cpp
index 7938be87bf4..879b32a1af9 100644
--- a/engines/mads/core/sequence.cpp
+++ b/engines/mads/nebular/core/sequence.cpp
@@ -21,11 +21,12 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/assets.h"
-#include "mads/core/sequence.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/sequence.h"
+#include "mads/nebular/core/scene.h"
 
 namespace MADS {
+namespace Nebular {
 
 SequenceEntry::SequenceEntry() {
 	_spritesIndex = 0;
@@ -94,8 +95,8 @@ bool SequenceList::addSubEntry(int index, SequenceTrigger mode, int frameIndex,
 }
 
 int SequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks,
-		int msgX, int msgY, bool nonFixed, int scale, int depth, int frameInc, SpriteAnimType animType, int numSprites,
-		int frameStart) {
+	int msgX, int msgY, bool nonFixed, int scale, int depth, int frameInc, SpriteAnimType animType, int numSprites,
+	int frameStart) {
 	Scene &scene = _vm->_game->_scene;
 
 	// Find a free slot
@@ -268,7 +269,7 @@ bool SequenceList::loadSprites(int seqIndex) {
 			if (seqEntry._flags & 2) {
 				// Check for object having moved off-screen
 				if ((pt.x + width) < 0 || (pt.x + width) >= MADS_SCREEN_WIDTH ||
-						pt.y < 0 || (pt.y - height) >= MADS_SCENE_HEIGHT) {
+					pt.y < 0 || (pt.y - height) >= MADS_SCENE_HEIGHT) {
 					result = true;
 					seqEntry._doneFlag = true;
 				}
@@ -335,7 +336,8 @@ bool SequenceList::loadSprites(int seqIndex) {
 				idx = i;
 			break;
 
-		case SEQUENCE_TRIGGER_SPRITE: {
+		case SEQUENCE_TRIGGER_SPRITE:
+		{
 			int v = seqEntry._entries._frameIndex[i];
 			if ((v == seqEntry._frameIndex) || (v == 0))
 				idx = i;
@@ -464,7 +466,7 @@ int SequenceList::addSpriteCycle(int srcSpriteIdx, bool flipped, int numTicks, i
 }
 
 int SequenceList::addReverseSpriteCycle(int srcSpriteIdx, bool flipped, int numTicks,
-		int triggerCountdown, int timeoutTicks, int extraTicks) {
+	int triggerCountdown, int timeoutTicks, int extraTicks) {
 	Scene &scene = _vm->_game->_scene;
 
 	SpriteAsset *asset = scene._sprites[srcSpriteIdx];
@@ -487,7 +489,7 @@ int SequenceList::startCycle(int srcSpriteIndex, bool flipped, int cycleIndex) {
 }
 
 int SequenceList::startPingPongCycle(int srcSpriteIndex, bool flipped, int numTicks,
-		int triggerCountdown, int timeoutTicks, int extraTicks) {
+	int triggerCountdown, int timeoutTicks, int extraTicks) {
 	SpriteAsset *sprites = _vm->_game->_scene._sprites[srcSpriteIndex];
 	MSprite *frame = sprites->getFrame(0);
 	int depth = _vm->_game->_scene._depthSurface.getDepth(Common::Point(
@@ -579,4 +581,5 @@ void SequenceList::setSeqPlayer(int idx, bool flag) {
 		_vm->_game->syncTimers(SYNC_SEQ, idx, SYNC_PLAYER, 0);
 }
 
-} // End of namespace
+} // namespace Nebular
+} // namespace MADS
diff --git a/engines/mads/core/sequence.h b/engines/mads/nebular/core/sequence.h
similarity index 93%
rename from engines/mads/core/sequence.h
rename to engines/mads/nebular/core/sequence.h
index 043db3aea93..cb1e18c8dfd 100644
--- a/engines/mads/core/sequence.h
+++ b/engines/mads/nebular/core/sequence.h
@@ -25,9 +25,10 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/rect.h"
-#include "mads/core/action.h"
+#include "mads/nebular/core/action.h"
 
 namespace MADS {
+namespace Nebular {
 
 class SpriteSlot;
 
@@ -37,7 +38,9 @@ enum SequenceTrigger {
 	SEQUENCE_TRIGGER_SPRITE = 2		// Trigger when sequence reaches specific sprite
 };
 
-enum SpriteAnimType { ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_PING_PONG = 2, ANIMTYPE_STAMP = 9 };
+enum SpriteAnimType {
+	ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_PING_PONG = 2, ANIMTYPE_STAMP = 9
+};
 
 #define SEQUENCE_ENTRY_SUBSET_MAX 5
 
@@ -93,7 +96,9 @@ private:
 public:
 	SequenceList(RexNebularEngine *vm);
 
-	SequenceEntry &operator[](int index) { return _entries[index]; }
+	SequenceEntry &operator[](int index) {
+		return _entries[index];
+	}
 	void clear();
 	bool addSubEntry(int index, SequenceTrigger mode, int frameIndex, int trigger);
 	int add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks,
@@ -129,6 +134,7 @@ public:
 	void setSeqPlayer(int idx, bool flag);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_SEQUENCE_H */
+#endif
diff --git a/engines/mads/core/sprites.cpp b/engines/mads/nebular/core/sprites.cpp
similarity index 96%
rename from engines/mads/core/sprites.cpp
rename to engines/mads/nebular/core/sprites.cpp
index 7cdbd75fb15..6cbdd55821c 100644
--- a/engines/mads/core/sprites.cpp
+++ b/engines/mads/nebular/core/sprites.cpp
@@ -22,14 +22,15 @@
 #include "common/scummsys.h"
 #include "engines/util.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/sprites.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/sprites.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum {
-	kEndOfLine   = 0,
+	kEndOfLine = 0,
 	kEndOfSprite = 1,
 	kMarker = 2
 };
@@ -41,7 +42,9 @@ public:
 	int depth;
 	int index;
 
-	DepthEntry(int depthAmt, int indexVal) { depth = depthAmt; index = indexVal; }
+	DepthEntry(int depthAmt, int indexVal) {
+		depth = depthAmt; index = indexVal;
+	}
 };
 
 bool sortHelper(const DepthEntry &entry1, const DepthEntry &entry2) {
@@ -57,8 +60,8 @@ MSprite::MSprite() : MSurface() {
 }
 
 MSprite::MSprite(Common::SeekableReadStream *source, const Common::Array<RGB6> &palette,
-		const Common::Rect &bounds): MSurface(), _transparencyIndex(TRANSPARENT_COLOR_INDEX),
-	  _offset(Common::Point(bounds.left, bounds.top)) {
+	const Common::Rect &bounds) : MSurface(), _transparencyIndex(TRANSPARENT_COLOR_INDEX),
+	_offset(Common::Point(bounds.left, bounds.top)) {
 	// Load the sprite data
 	create(bounds.width(), bounds.height());
 	loadSprite(source, palette);
@@ -68,7 +71,7 @@ MSprite::~MSprite() {
 }
 
 void MSprite::loadSprite(Common::SeekableReadStream *source,
-		const Common::Array<RGB6> &palette) {
+	const Common::Array<RGB6> &palette) {
 	byte *outp, *lineStart;
 	bool newLine = false;
 
@@ -420,4 +423,5 @@ SpriteAsset *&SpriteSets::operator[](int idx) {
 		Common::Array<SpriteAsset *>::operator[](idx);
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/sprites.h b/engines/mads/nebular/core/sprites.h
similarity index 93%
rename from engines/mads/core/sprites.h
rename to engines/mads/nebular/core/sprites.h
index c4253e48820..f45fe26434a 100644
--- a/engines/mads/core/sprites.h
+++ b/engines/mads/nebular/core/sprites.h
@@ -24,10 +24,11 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "mads/core/assets.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/assets.h"
+#include "mads/nebular/core/msurface.h"
 
 namespace MADS {
+namespace Nebular {
 
 enum SpriteFlags {
 	IMG_STATIC = 0,			// Item should remain fixed on the screen
@@ -51,9 +52,9 @@ typedef struct {
 	int32	y;			// y position relative	to GrBuff(0, 0)
 	int32	scale_x;	// x scale factor (can be negative for reverse draw)
 	int32	scale_y;	// y scale factor (can't be negative)
-	uint8*	depth_map;	// depth code array for destination (doesn't care if srcDepth is 0)
-	BGR8*	Pal;		// palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
-	uint8*	ICT;		// Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
+	uint8 *depth_map;	// depth code array for destination (doesn't care if srcDepth is 0)
+	BGR8 *Pal;		// palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
+	uint8 *ICT;		// Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
 	uint8	depth;		// depth code for source (0 if no depth processing)
 } DrawRequestX;
 
@@ -66,7 +67,7 @@ typedef struct {
 	uint32 Height;
 	uint32 Comp;
 	uint32 Reserved[8];
-	uint8* data;
+	uint8 *data;
 } RendCell;
 
 #define SS_HEADER_NUM_FIELDS 14
@@ -206,7 +207,8 @@ public:
 	/**
 	 * Constructor
 	 */
-	SpriteSets(RexNebularEngine *vm) : _vm(vm), _uiSprites(nullptr) {}
+	SpriteSets(RexNebularEngine *vm) : _vm(vm), _uiSprites(nullptr) {
+	}
 
 	/**
 	 * Destructor
@@ -236,6 +238,7 @@ public:
 	SpriteAsset *&operator[](int idx);
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_SPRITES_H */
+#endif
diff --git a/engines/mads/core/staticres.cpp b/engines/mads/nebular/core/staticres.cpp
similarity index 95%
rename from engines/mads/core/staticres.cpp
rename to engines/mads/nebular/core/staticres.cpp
index 0391bb292df..468c32f6011 100644
--- a/engines/mads/core/staticres.cpp
+++ b/engines/mads/nebular/core/staticres.cpp
@@ -20,9 +20,10 @@
  */
 
 #include "common/scummsys.h"
-#include "mads/core/staticres.h"
+#include "mads/nebular/core/staticres.h"
 
 namespace MADS {
+namespace Nebular {
 
 const char *const kArticleList[9] = {
 	nullptr, "with", "to", "at", "from", "on", "in", "under", "behind"
@@ -54,4 +55,5 @@ const uint32 DEFAULT_VGA_HIGH_PALETTE[16] = {
 	0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
 };
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/staticres.h b/engines/mads/nebular/core/staticres.h
similarity index 96%
rename from engines/mads/core/staticres.h
rename to engines/mads/nebular/core/staticres.h
index f17123af2c6..97c77b9c25b 100644
--- a/engines/mads/core/staticres.h
+++ b/engines/mads/nebular/core/staticres.h
@@ -23,6 +23,7 @@
 #define MADS_STATICRES_H
 
 namespace MADS {
+namespace Nebular {
 
 extern const char *const kArticleList[9];
 
@@ -41,6 +42,7 @@ extern const char *const kGameReleaseTitleStr;
 extern const uint32 DEFAULT_VGA_LOW_PALETTE[16];
 extern const uint32 DEFAULT_VGA_HIGH_PALETTE[16];
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_STATICRES_H */
+#endif
diff --git a/engines/mads/core/user_interface.cpp b/engines/mads/nebular/core/user_interface.cpp
similarity index 99%
rename from engines/mads/core/user_interface.cpp
rename to engines/mads/nebular/core/user_interface.cpp
index 7062a4825e3..7b28df920d1 100644
--- a/engines/mads/core/user_interface.cpp
+++ b/engines/mads/nebular/core/user_interface.cpp
@@ -21,11 +21,12 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
-#include "mads/core/user_interface.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/user_interface.h"
 #include "mads/nebular/game_nebular.h"
 
 namespace MADS {
+namespace Nebular {
 
 UISlot::UISlot() {
 	_flags = IMG_STATIC;
@@ -1113,4 +1114,5 @@ void UserInterface::synchronize(Common::Serializer &s) {
 		s.syncAsSint16LE(_categoryIndexes[i]);
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/core/user_interface.h b/engines/mads/nebular/core/user_interface.h
similarity index 96%
rename from engines/mads/core/user_interface.h
rename to engines/mads/nebular/core/user_interface.h
index 0d28b4cae96..4bdb92e7481 100644
--- a/engines/mads/core/user_interface.h
+++ b/engines/mads/nebular/core/user_interface.h
@@ -25,12 +25,15 @@
 #include "common/scummsys.h"
 #include "common/rect.h"
 #include "common/str.h"
-#include "mads/core/msurface.h"
-#include "mads/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/screen.h"
 
 namespace MADS {
+namespace Nebular {
 
-enum { IMG_SPINNING_OBJECT = 200, IMG_TEXT_UPDATE = 201 };
+enum {
+	IMG_SPINNING_OBJECT = 200, IMG_TEXT_UPDATE = 201
+};
 
 enum ScrollbarActive {
 	SCROLLBAR_NONE = 0,		// No state
@@ -68,7 +71,8 @@ public:
 	/**
 	 * Constructor
 	 */
-	UISlots(RexNebularEngine *vm) : _vm(vm) {}
+	UISlots(RexNebularEngine *vm) : _vm(vm) {
+	}
 
 	/**
 	 * Add an overprint (text) entry to the list
@@ -303,6 +307,7 @@ public:
 	void refresh();
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif /* MADS_USER_INTERFACE_H */
+#endif
diff --git a/engines/mads/nebular/debugger.cpp b/engines/mads/nebular/debugger.cpp
index ea561dbc16e..0465af6baf4 100644
--- a/engines/mads/nebular/debugger.cpp
+++ b/engines/mads/nebular/debugger.cpp
@@ -20,17 +20,18 @@
  */
 
 #include "common/file.h"
-#include "mads/core/compression.h"
+#include "mads/nebular/core/compression.h"
 #include "mads/nebular/nebular.h"
 #include "mads/nebular/debugger.h"
 #include "mads/nebular/menu_nebular.h"
 
 namespace MADS {
+namespace Nebular {
 
 Debugger::Debugger(RexNebularEngine *vm) : GUI::Debugger(), _vm(vm) {
 	_showMousePos = false;
 
-	registerCmd("continue",		WRAP_METHOD(Debugger, cmdExit));
+	registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
 	registerCmd("mouse", WRAP_METHOD(Debugger, Cmd_Mouse));
 	registerCmd("scene", WRAP_METHOD(Debugger, Cmd_LoadScene));
 	registerCmd("show_hotspots", WRAP_METHOD(Debugger, Cmd_ShowHotSpots));
@@ -404,4 +405,6 @@ bool Debugger::Cmd_SetCamera(int argc, const char **argv) {
 		return false;
 	}
 }
+
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/nebular/debugger.h b/engines/mads/nebular/debugger.h
index 27e8d79e145..8f95bd8c935 100644
--- a/engines/mads/nebular/debugger.h
+++ b/engines/mads/nebular/debugger.h
@@ -19,13 +19,14 @@
  *
  */
 
-#ifndef MADS_DEBUGGER_H
-#define MADS_DEBUGGER_H
+#ifndef MADS_NEBULAR_DEBUGGER_H
+#define MADS_NEBULAR_DEBUGGER_H
 
 #include "common/scummsys.h"
 #include "gui/debugger.h"
 
 namespace MADS {
+namespace Nebular {
 
 class RexNebularEngine;
 
@@ -56,9 +57,11 @@ public:
 	bool _showMousePos;
 public:
 	Debugger(RexNebularEngine *vm);
-	~Debugger() override {}
+	~Debugger() override {
+	}
 };
 
+} // namespace Nebular
 } // namespace MADS
 
-#endif	/* MADS_DEBUGGER_H */
+#endif
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index d8a759832d6..fe9966cf09e 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -28,9 +28,9 @@
 #include "gui/saveload.h"
 
 #include "mads/nebular/nebular.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/staticres.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/staticres.h"
 #include "mads/nebular/dialogs_nebular.h"
 #include "mads/nebular/game_nebular.h"
 #include "mads/nebular/menu_nebular.h"
@@ -288,7 +288,7 @@ void DialogsNebular::showDialog() {
 		_pendingDialog = DIALOG_NONE;
 
 		Common::Keymapper *keymapper = _vm->getEventManager()->getKeymapper();
-		if (dialogId == MADS::DIALOG_MAIN_MENU) {
+		if (dialogId == DIALOG_MAIN_MENU) {
 			keymapper->getKeymap("menu-shortcuts")->setEnabled(true);
 		} else {
 			keymapper->getKeymap("menu-shortcuts")->setEnabled(false);
diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h
index 007329db4ba..9b5a5207664 100644
--- a/engines/mads/nebular/dialogs_nebular.h
+++ b/engines/mads/nebular/dialogs_nebular.h
@@ -23,8 +23,8 @@
 #define MADS_DIALOGS_NEBULAR_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/dialogs.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/dialogs.h"
 
 namespace MADS {
 
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 562492100e5..be539b5e4a3 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -23,10 +23,10 @@
 #include "common/config-manager.h"
 #include "graphics/scaler.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/game.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/menu_views.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/menu_views.h"
 #include "mads/nebular/game_nebular.h"
 #include "mads/nebular/dialogs_nebular.h"
 #include "mads/nebular/globals_nebular.h"
diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h
index 9e538102723..73e24253d5b 100644
--- a/engines/mads/nebular/game_nebular.h
+++ b/engines/mads/nebular/game_nebular.h
@@ -23,12 +23,11 @@
 #define MADS_GAME_NEBULAR_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/globals.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/globals.h"
 #include "mads/nebular/globals_nebular.h"
 
 namespace MADS {
-
 namespace Nebular {
 
 enum StoryMode { STORYMODE_NAUGHTY = 1, STORYMODE_NICE = 2 };
@@ -42,7 +41,7 @@ enum ProtectionResult {
 	PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2
 };
 
-enum InventoryObject {
+enum {
 	OBJ_NONE = -1,
 	OBJ_BINOCULARS = 0,
 	OBJ_BURGER = 1,
@@ -154,7 +153,6 @@ typedef Section1Handler Section7Handler;
 typedef Section1Handler Section8Handler;
 
 } // namespace Nebular
-
 } // namespace MADS
 
-#endif /* MADS_GAME_NEBULAR_H */
+#endif
diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h
index eae8a6597af..b26b7e29508 100644
--- a/engines/mads/nebular/globals_nebular.h
+++ b/engines/mads/nebular/globals_nebular.h
@@ -24,8 +24,8 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "mads/core/game.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/resources.h"
 
 namespace MADS {
 
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 772b05ac870..a2e777d71bb 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -21,12 +21,12 @@
 
 #include "common/scummsys.h"
 #include "common/config-manager.h"
-#include "mads/core/game.h"
+#include "mads/nebular/core/game.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/menu_views.h"
-#include "mads/core/resources.h"
-#include "mads/core/scene.h"
-#include "mads/core/screen.h"
+#include "mads/nebular/core/menu_views.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/scene.h"
+#include "mads/nebular/core/screen.h"
 #include "mads/nebular/menu_nebular.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h
index 339ef084aa9..a58b7b5ab88 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -23,9 +23,9 @@
 #define MADS_MENU_NEBULAR_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/menu_views.h"
-#include "mads/core/msurface.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/menu_views.h"
+#include "mads/nebular/core/msurface.h"
 #include "mads/nebular/dialogs_nebular.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular.cpp b/engines/mads/nebular/nebular.cpp
index 5ce97f81b49..50ee1214252 100644
--- a/engines/mads/nebular/nebular.cpp
+++ b/engines/mads/nebular/nebular.cpp
@@ -27,20 +27,21 @@
 #include "engines/util.h"
 #include "mads/nebular/nebular.h"
 #include "mads/nebular/sound_nebular.h"
-#include "mads/core/game.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/resources.h"
 #include "mads/core/sound.h"
-#include "mads/core/sprites.h"
-#include "mads/core/mps_installer.h"
+#include "mads/nebular/core/sprites.h"
+#include "mads/nebular/core/mps_installer.h"
 
 namespace MADS {
+namespace Nebular {
 
 RexNebularEngine *g_engine;
 
 RexNebularEngine::RexNebularEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
-		MADSEngine(syst, gameDesc) {
+	MADSEngine(syst, gameDesc) {
 	// Initialize game/engine options
 	_easyMouse = true;
 	_invObjectsAnimated = true;
@@ -81,7 +82,7 @@ RexNebularEngine::~RexNebularEngine() {
 void RexNebularEngine::initialize() {
 	if (_gameDescription->desc.flags & GF_INSTALLER) {
 		// Right now used only by Rex Nebular
-		Common::Archive* arch = MpsInstaller::open("MPSLABS");
+		Common::Archive *arch = MpsInstaller::open("MPSLABS");
 		if (arch)
 			SearchMan.add("mpslabs", arch);
 	}
@@ -208,4 +209,5 @@ Common::Error RexNebularEngine::saveGameState(int slot, const Common::String &de
 	return Common::kNoError;
 }
 
+} // namespace Nebular
 } // namespace MADS
diff --git a/engines/mads/nebular/nebular.h b/engines/mads/nebular/nebular.h
index 34ea200eecc..fbead86bb9b 100644
--- a/engines/mads/nebular/nebular.h
+++ b/engines/mads/nebular/nebular.h
@@ -31,23 +31,24 @@
 #include "graphics/surface.h"
 #include "mads/mads.h"
 #include "mads/nebular/debugger.h"
-#include "mads/core/conversations.h"
-#include "mads/core/dialogs.h"
-#include "mads/core/events.h"
-#include "mads/core/font.h"
-#include "mads/core/game.h"
-#include "mads/core/screen.h"
-#include "mads/core/msurface.h"
-#include "mads/core/resources.h"
+#include "mads/nebular/core/conversations.h"
+#include "mads/nebular/core/dialogs.h"
+#include "mads/nebular/core/events.h"
+#include "mads/nebular/core/font.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/screen.h"
+#include "mads/nebular/core/msurface.h"
+#include "mads/nebular/core/resources.h"
 #include "mads/core/sound.h"
 
 namespace MADS {
+namespace Nebular {
 
 #define DEBUG_BASIC 1
 #define DEBUG_INTERMEDIATE 2
 #define DEBUG_DETAILED 3
 
-class RexNebularEngine : public MADSEngine {
+class RexNebularEngine : public MADS::MADSEngine {
 private:
 	/**
 	 * Handles basic initialisation
@@ -66,7 +67,7 @@ public:
 	EventsManager *_events;
 	Font *_font;
 	Game *_game;
-	GameConversations * _gameConv;
+	GameConversations *_gameConv;
 	Palette *_palette;
 	Resources *_resources;
 	Screen *_screen;
@@ -112,6 +113,7 @@ public:
 	void saveOptions();
 };
 
+} // namespace Nebular
 } // namespace MADS
 
 #endif
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index 484a0314cc3..c2caa4743eb 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -22,9 +22,9 @@
 #include "common/scummsys.h"
 #include "common/config-manager.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/compression.h"
-#include "mads/core/resources.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/compression.h"
+#include "mads/nebular/core/resources.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/game_nebular.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes1.h"
diff --git a/engines/mads/nebular/nebular_scenes.h b/engines/mads/nebular/nebular_scenes.h
index 58980ed8076..fb4a9bf9eab 100644
--- a/engines/mads/nebular/nebular_scenes.h
+++ b/engines/mads/nebular/nebular_scenes.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/game_nebular.h"
 #include "mads/nebular/globals_nebular.h"
 
diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp
index 17679268945..348361da200 100644
--- a/engines/mads/nebular/nebular_scenes1.cpp
+++ b/engines/mads/nebular/nebular_scenes1.cpp
@@ -22,7 +22,7 @@
 #include "common/scummsys.h"
 #include "math/utils.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes1.h"
 
diff --git a/engines/mads/nebular/nebular_scenes1.h b/engines/mads/nebular/nebular_scenes1.h
index 1e43c3a568e..bfc0cdaae20 100644
--- a/engines/mads/nebular/nebular_scenes1.h
+++ b/engines/mads/nebular/nebular_scenes1.h
@@ -24,8 +24,8 @@
 
 #include "common/scummsys.h"
 #include "common/serializer.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp
index 8f72e3e7ab1..ba3a37441f3 100644
--- a/engines/mads/nebular/nebular_scenes2.cpp
+++ b/engines/mads/nebular/nebular_scenes2.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes2.h"
 
diff --git a/engines/mads/nebular/nebular_scenes2.h b/engines/mads/nebular/nebular_scenes2.h
index ed498f018b7..feb42937ca3 100644
--- a/engines/mads/nebular/nebular_scenes2.h
+++ b/engines/mads/nebular/nebular_scenes2.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES2_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp
index 67ebbf25678..1f8c42170a8 100644
--- a/engines/mads/nebular/nebular_scenes3.cpp
+++ b/engines/mads/nebular/nebular_scenes3.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes3.h"
 
diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h
index 85e9b5b023c..1928765c2b1 100644
--- a/engines/mads/nebular/nebular_scenes3.h
+++ b/engines/mads/nebular/nebular_scenes3.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES3_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp
index 95b035e393d..673bf0c58cd 100644
--- a/engines/mads/nebular/nebular_scenes4.cpp
+++ b/engines/mads/nebular/nebular_scenes4.cpp
@@ -22,7 +22,7 @@
 #include "common/scummsys.h"
 #include "math/utils.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes4.h"
 
diff --git a/engines/mads/nebular/nebular_scenes4.h b/engines/mads/nebular/nebular_scenes4.h
index 0db1618330a..d868578b475 100644
--- a/engines/mads/nebular/nebular_scenes4.h
+++ b/engines/mads/nebular/nebular_scenes4.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES4_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp
index ad6aa542784..87283e43c3a 100644
--- a/engines/mads/nebular/nebular_scenes5.cpp
+++ b/engines/mads/nebular/nebular_scenes5.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes5.h"
 
diff --git a/engines/mads/nebular/nebular_scenes5.h b/engines/mads/nebular/nebular_scenes5.h
index 189fe0d341d..7d8f074b351 100644
--- a/engines/mads/nebular/nebular_scenes5.h
+++ b/engines/mads/nebular/nebular_scenes5.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES5_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp
index 48ac8e9ff27..2e9adcb2452 100644
--- a/engines/mads/nebular/nebular_scenes6.cpp
+++ b/engines/mads/nebular/nebular_scenes6.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes6.h"
 
diff --git a/engines/mads/nebular/nebular_scenes6.h b/engines/mads/nebular/nebular_scenes6.h
index a74f009ed1d..12672ca90d5 100644
--- a/engines/mads/nebular/nebular_scenes6.h
+++ b/engines/mads/nebular/nebular_scenes6.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES6_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp
index 2d639248eeb..9f07ea82d4a 100644
--- a/engines/mads/nebular/nebular_scenes7.cpp
+++ b/engines/mads/nebular/nebular_scenes7.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes7.h"
 
diff --git a/engines/mads/nebular/nebular_scenes7.h b/engines/mads/nebular/nebular_scenes7.h
index 8db5c958d3f..fb2370658aa 100644
--- a/engines/mads/nebular/nebular_scenes7.h
+++ b/engines/mads/nebular/nebular_scenes7.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES7_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index ea67b7855e5..4767dcb0e32 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -21,7 +21,7 @@
 
 #include "common/scummsys.h"
 #include "mads/nebular/nebular.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 #include "mads/nebular/nebular_scenes8.h"
 
diff --git a/engines/mads/nebular/nebular_scenes8.h b/engines/mads/nebular/nebular_scenes8.h
index 19beb48584d..d0810198343 100644
--- a/engines/mads/nebular/nebular_scenes8.h
+++ b/engines/mads/nebular/nebular_scenes8.h
@@ -23,8 +23,8 @@
 #define MADS_NEBULAR_SCENES8_H
 
 #include "common/scummsys.h"
-#include "mads/core/game.h"
-#include "mads/core/scene.h"
+#include "mads/nebular/core/game.h"
+#include "mads/nebular/core/scene.h"
 #include "mads/nebular/nebular_scenes.h"
 
 namespace MADS {




More information about the Scummvm-git-logs mailing list