[Scummvm-git-logs] scummvm master -> 3c0be1d7a6be347cadaf80ba72657efca57b32db

dreammaster paulfgilbert at gmail.com
Sun Feb 9 03:55:12 UTC 2020


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

Summary:
3c0be1d7a6 ULTIMA: Added skeleton debugger classes


Commit: 3c0be1d7a6be347cadaf80ba72657efca57b32db
    https://github.com/scummvm/scummvm/commit/3c0be1d7a6be347cadaf80ba72657efca57b32db
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-08T19:55:02-08:00

Commit Message:
ULTIMA: Added skeleton debugger classes

Changed paths:
  A engines/ultima/nuvie/core/debugger.cpp
  A engines/ultima/nuvie/core/debugger.h
  A engines/ultima/ultima1/core/debugger.cpp
  A engines/ultima/ultima1/core/debugger.h
  A engines/ultima/ultima8/misc/debugger.cpp
  A engines/ultima/ultima8/misc/debugger.h
    engines/ultima/module.mk
    engines/ultima/nuvie/nuvie.cpp
    engines/ultima/nuvie/nuvie.h
    engines/ultima/shared/early/ultima_early.h
    engines/ultima/shared/engine/debugger.cpp
    engines/ultima/shared/engine/debugger.h
    engines/ultima/shared/engine/events.h
    engines/ultima/ultima8/ultima8.cpp
    engines/ultima/ultima8/ultima8.h


diff --git a/engines/ultima/module.mk b/engines/ultima/module.mk
index 9da51b9..9039dc7 100644
--- a/engines/ultima/module.mk
+++ b/engines/ultima/module.mk
@@ -61,6 +61,7 @@ MODULE_OBJS := \
 	ultima1/actions/quit.o \
 	ultima1/actions/ready.o \
 	ultima1/actions/stats.o \
+	ultima1/core/debugger.o \
 	ultima1/core/party.o \
 	ultima1/core/quests.o \
 	ultima1/core/resources.o \
@@ -150,6 +151,7 @@ MODULE_OBJS := \
 	nuvie/core/converse_speech.o \
 	nuvie/core/cursor.o \
 	nuvie/core/debug.o \
+	nuvie/core/debugger.o \
 	nuvie/core/effect.o \
 	nuvie/core/effect_manager.o \
 	nuvie/core/egg_manager.o \
@@ -451,6 +453,7 @@ MODULE_OBJS := \
 	ultima8/kernel/segmented_pool.o \
 	ultima8/misc/args.o \
 	ultima8/misc/console.o \
+	ultima8/misc/debugger.o \
 	ultima8/misc/encoding.o \
 	ultima8/misc/id_man.o \
 	ultima8/misc/istring.o \
diff --git a/engines/ultima/nuvie/core/debugger.cpp b/engines/ultima/nuvie/core/debugger.cpp
new file mode 100644
index 0000000..0542d8e
--- /dev/null
+++ b/engines/ultima/nuvie/core/debugger.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ultima/nuvie/core/debugger.h"
+
+namespace Ultima {
+namespace Nuvie {
+
+Debugger::Debugger() : Shared::Debugger() {
+}
+
+} // End of namespace Ultima8
+} // End of namespace Ultima
diff --git a/engines/ultima/nuvie/core/debugger.h b/engines/ultima/nuvie/core/debugger.h
new file mode 100644
index 0000000..de2cbfb
--- /dev/null
+++ b/engines/ultima/nuvie/core/debugger.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ULTIMA_NUVIE_ENGINE_DEBUGGER_H
+#define ULTIMA_NUVIE_ENGINE_DEBUGGER_H
+
+#include "ultima/shared/engine/debugger.h"
+
+namespace Ultima {
+namespace Nuvie {
+
+/**
+ * Debugger base class
+ */
+class Debugger : public Shared::Debugger {
+public:
+	Debugger();
+    virtual ~Debugger() {}
+};
+
+} // End of namespace Nuvie
+} // End of namespace Ultima
+
+#endif
diff --git a/engines/ultima/nuvie/nuvie.cpp b/engines/ultima/nuvie/nuvie.cpp
index 015b005..876ea07 100644
--- a/engines/ultima/nuvie/nuvie.cpp
+++ b/engines/ultima/nuvie/nuvie.cpp
@@ -25,6 +25,7 @@
 #include "ultima/nuvie/core/events.h"
 #include "ultima/nuvie/actors/actor.h"
 #include "ultima/nuvie/core/nuvie_defs.h"
+#include "ultima/nuvie/core/debugger.h"
 #include "ultima/nuvie/conf/configuration.h"
 #include "ultima/nuvie/misc/u6_misc.h"
 #include "ultima/nuvie/files/nuvie_io_file.h"
@@ -48,7 +49,7 @@ NuvieEngine *g_engine;
 
 NuvieEngine::NuvieEngine(OSystem *syst, const Ultima::UltimaGameDescription *gameDesc) :
 		Ultima::Shared::UltimaEngine(syst, gameDesc),  _config(nullptr), _savegame(nullptr),
-		_screen(nullptr), _script(nullptr), _game(nullptr) {
+		_screen(nullptr), _script(nullptr), _game(nullptr), _debugger(nullptr) {
 	g_engine = this;
 }
 
@@ -59,6 +60,7 @@ NuvieEngine::~NuvieEngine() {
 	delete _screen;
 	delete _script;
 	delete _game;
+	delete _debugger;
 
 	g_engine = nullptr;
 }
@@ -105,6 +107,9 @@ bool NuvieEngine::initialize() {
 	// Setup savegame handler
 	_savegame = new SaveGame(_config);
 
+	// Setup debugger
+	_debugger = new Debugger();
+
 	// Setup screen
 	_screen = new Screen(_config);
 
diff --git a/engines/ultima/nuvie/nuvie.h b/engines/ultima/nuvie/nuvie.h
index 0e44f8e..894b02d 100644
--- a/engines/ultima/nuvie/nuvie.h
+++ b/engines/ultima/nuvie/nuvie.h
@@ -29,6 +29,7 @@
 #include "common/archive.h"
 #include "common/random.h"
 #include "engines/engine.h"
+#include "gui/debugger.h"
 
 namespace Ultima {
 namespace Nuvie {
@@ -45,6 +46,7 @@ private:
 	Script *_script;
 	Game *_game;
 	SaveGame *_savegame;
+	::GUI::Debugger *_debugger;
 private:
 	void initConfig();
 	void assignGameConfigValues(uint8 game_type);
@@ -98,6 +100,10 @@ public:
 	 */
 	virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
 
+	virtual ::GUI::Debugger *getDebugger() const override {
+		return _debugger;
+	}
+
 	/**
 	 * Either starts the most recently saved game, or falls back on starting a new game
 	 */
diff --git a/engines/ultima/shared/early/ultima_early.h b/engines/ultima/shared/early/ultima_early.h
index f52869a..0d4c62f 100644
--- a/engines/ultima/shared/early/ultima_early.h
+++ b/engines/ultima/shared/early/ultima_early.h
@@ -131,6 +131,8 @@ public:
 	 * Creates a new hierarchy for the game, that contains all the logic for playing that particular game.
 	 */
 	Game *createGame() const;
+
+	virtual GUI::Debugger *getDebugger() const override { return nullptr; }
 };
 
 } // End of namespace Shared
diff --git a/engines/ultima/shared/engine/debugger.cpp b/engines/ultima/shared/engine/debugger.cpp
index 3f44f77..639e85f 100644
--- a/engines/ultima/shared/engine/debugger.cpp
+++ b/engines/ultima/shared/engine/debugger.cpp
@@ -29,8 +29,6 @@ namespace Ultima {
 namespace Shared {
 
 Debugger::Debugger() : GUI::Debugger() {
-	registerCmd("continue",	     WRAP_METHOD(Debugger, cmdExit));
-	registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell));
 }
 
 int Debugger::strToInt(const char *s) {
@@ -49,19 +47,5 @@ int Debugger::strToInt(const char *s) {
 	return (int)tmp;
 }
 
-bool Debugger::cmdSpell(int argc, const char **argv) {
-	if (argc != 2) {
-		debugPrintf("spell <spell number>\n");
-		return true;
-	} else {
-		int spellId = strToInt(argv[1]);
-		Shared::Game *game = dynamic_cast<Shared::Game *>(g_vm->_game);
-		assert(game);
-
-		game->_map->castSpell(spellId);
-		return false;
-	}
-}
-
 } // End of namespace Shared
 } // End of namespace Ultima
diff --git a/engines/ultima/shared/engine/debugger.h b/engines/ultima/shared/engine/debugger.h
index 6b90c47..49c16fd 100644
--- a/engines/ultima/shared/engine/debugger.h
+++ b/engines/ultima/shared/engine/debugger.h
@@ -40,8 +40,6 @@ protected:
 	 * Converts a string to an integer
 	 */
 	int strToInt(const char *s);
-
-	bool cmdSpell(int argc, const char **argv);
 public:
 	Debugger();
     virtual ~Debugger() {}
diff --git a/engines/ultima/shared/engine/events.h b/engines/ultima/shared/engine/events.h
index 21c6c64..721a4ef 100644
--- a/engines/ultima/shared/engine/events.h
+++ b/engines/ultima/shared/engine/events.h
@@ -137,7 +137,7 @@ public:
 	/**
 	 * Get the debugger
 	 */
-	virtual GUI::Debugger *getDebugger() = 0;
+	virtual GUI::Debugger *getDebugger() const = 0;
 
 	/**
 	 * Get the screen
diff --git a/engines/ultima/ultima1/core/debugger.cpp b/engines/ultima/ultima1/core/debugger.cpp
new file mode 100644
index 0000000..6b4b9dd
--- /dev/null
+++ b/engines/ultima/ultima1/core/debugger.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ultima/ultima1/core/debugger.h"
+#include "ultima/shared/early/game.h"
+#include "ultima/shared/early/ultima_early.h"
+#include "ultima/shared/maps/map.h"
+
+namespace Ultima {
+namespace Ultima1 {
+
+Debugger::Debugger() : Shared::Debugger() {
+	registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell));
+}
+
+bool Debugger::cmdSpell(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("spell <spell number>\n");
+		return true;
+	} else {
+		int spellId = strToInt(argv[1]);
+		Shared::Game *game = dynamic_cast<Shared::Game *>(g_vm->_game);
+		assert(game);
+
+		game->_map->castSpell(spellId);
+		return false;
+	}
+}
+
+} // End of namespace Ultima1
+} // End of namespace Ultima
diff --git a/engines/ultima/ultima1/core/debugger.h b/engines/ultima/ultima1/core/debugger.h
new file mode 100644
index 0000000..b55aa15
--- /dev/null
+++ b/engines/ultima/ultima1/core/debugger.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ULTIMA_ULTIMA1_ENGINE_DEBUGGER_H
+#define ULTIMA_ULTIMA1_ENGINE_DEBUGGER_H
+
+#include "ultima/shared/engine/debugger.h"
+
+namespace Ultima {
+namespace Ultima1 {
+
+/**
+ * Debugger base class
+ */
+class Debugger : public Shared::Debugger {
+private:
+	bool cmdSpell(int argc, const char **argv);
+public:
+	Debugger();
+    virtual ~Debugger() {}
+};
+
+} // End of namespace Ultima1
+} // End of namespace Ultima
+
+#endif
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
new file mode 100644
index 0000000..f6ecb46
--- /dev/null
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ultima/ultima8/misc/debugger.h"
+
+namespace Ultima {
+namespace Ultima8 {
+
+Debugger::Debugger() : Shared::Debugger() {
+}
+
+} // End of namespace Ultima8
+} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
new file mode 100644
index 0000000..a5f90f1
--- /dev/null
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ULTIMA_ULTIMA8_ENGINE_DEBUGGER_H
+#define ULTIMA_ULTIMA8_ENGINE_DEBUGGER_H
+
+#include "ultima/shared/engine/debugger.h"
+
+namespace Ultima {
+namespace Ultima8 {
+
+class Ultima1Engine;
+
+/**
+ * Debugger base class
+ */
+class Debugger : public Shared::Debugger {
+private:
+	bool cmdSpell(int argc, const char **argv);
+public:
+	Debugger();
+    virtual ~Debugger() {}
+};
+
+} // End of namespace Ultima8
+} // End of namespace Ultima
+
+#endif
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 693b49a..6070592 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -51,6 +51,7 @@
 #include "ultima/ultima8/graphics/palette.h"
 #include "ultima/ultima8/games/game_data.h"
 #include "ultima/ultima8/world/world.h"
+#include "ultima/ultima8/misc/debugger.h"
 #include "ultima/ultima8/misc/direction.h"
 #include "ultima/ultima8/games/game.h"
 #include "ultima/ultima8/world/get_object.h"
@@ -126,9 +127,9 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(Ultima8Engine, CoreApp)
 
 Ultima8Engine::Ultima8Engine(OSystem *syst, const Ultima::UltimaGameDescription *gameDesc) : 
 		Shared::UltimaEngine(syst, gameDesc), CoreApp(gameDesc), _saveCount(0), _game(0),
-		_kernel(0), _objectManager(0), _hidManager(0), _mouse(0), _ucMachine(0), _screen(0),
-		_fontManager(0), _fullScreen(false), _paletteManager(0), _gameData(0), _world(0),
-		_desktopGump(0), _consoleGump(0), _gameMapGump(0), _avatarMoverProcess(0),
+		_kernel(0), _objectManager(0), _debugger(0), _hidManager(0), _mouse(0), _ucMachine(0),
+		_screen(0), _fontManager(0), _fullScreen(false), _paletteManager(0), _gameData(0),
+		_world(0), _desktopGump(0), _consoleGump(0), _gameMapGump(0), _avatarMoverProcess(0),
 		_frameSkip(false), _frameLimit(true), _interpolate(true), _animationRate(100),
 		_avatarInStasis(false), _paintEditorItems(false), _inversion(0), _painting(false),
 		_showTouching(false), _timeOffset(0), _hasCheated(false), _cheatsEnabled(false),
@@ -156,6 +157,7 @@ Ultima8Engine::~Ultima8Engine() {
 	FORGET_OBJECT(_fontManager);
 	FORGET_OBJECT(_screen);
 	FORGET_OBJECT(_memoryManager);
+	FORGET_OBJECT(_debugger);
 }
 
 Common::Error Ultima8Engine::run() {
@@ -342,6 +344,7 @@ void Ultima8Engine::startup() {
 
 	_kernel = new Kernel();
 	_memoryManager = new MemoryManager();
+	_debugger = new Debugger();
 
 	//!! move this elsewhere
 	_kernel->addProcessLoader("DelayProcess",
@@ -2054,6 +2057,10 @@ bool Ultima8Engine::isDataRequired(Common::String &folder, int &majorVersion, in
 	return true;
 }
 
+GUI::Debugger *Ultima8Engine::getDebugger() const {
+	return _debugger;
+}
+
 Graphics::Screen *Ultima8Engine::getScreen() const {
 	Graphics::Screen *scr = dynamic_cast<Graphics::Screen *>(_screen->getRawSurface());
 	assert(scr);
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index 2b2cab8..01151d2 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -32,6 +32,7 @@
 #include "common/util.h"
 #include "engines/engine.h"
 #include "graphics/surface.h"
+#include "gui/debugger.h"
 #include "ultima/detection.h"
 #include "ultima/shared/std/containers.h"
 #include "ultima/shared/engine/ultima.h"
@@ -91,6 +92,7 @@ private:
 	Kernel *_kernel;
 	MemoryManager *_memoryManager;
 	ObjectManager *_objectManager;
+	GUI::Debugger *_debugger;
 	HIDManager *_hidManager;
 	UCMachine *_ucMachine;
 	RenderSurface *_screen;
@@ -238,6 +240,7 @@ public:
 		return _screen;
 	}
 
+	virtual GUI::Debugger *getDebugger() const override;
 	virtual Graphics::Screen *getScreen() const override;
 
 	virtual void runGame() override;




More information about the Scummvm-git-logs mailing list