diff --git a/src/debugger/gui/Cart2KWidget.cxx b/src/debugger/gui/Cart2KWidget.cxx new file mode 100644 index 000000000..9b70fb85e --- /dev/null +++ b/src/debugger/gui/Cart2KWidget.cxx @@ -0,0 +1,31 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id$ +//============================================================================ + +#include "Cart2K.hxx" +#include "Cart2KWidget.hxx" + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Cartridge2KWidget::Cartridge2KWidget( + GuiObject* boss, const GUI::Font& font, + int x, int y, int w, int h, Cartridge2K& cart) + : CartDebugWidget(boss, font, x, y, w, h) +{ + addBaseInformation(2048, "Atari", "Standard 2K cartridge, non-bankswitched\n" + "Accessible @ $1000 - $1FFF"); +} diff --git a/src/debugger/gui/Cart2KWidget.hxx b/src/debugger/gui/Cart2KWidget.hxx new file mode 100644 index 000000000..a4ded625d --- /dev/null +++ b/src/debugger/gui/Cart2KWidget.hxx @@ -0,0 +1,39 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id$ +//============================================================================ + +#ifndef CARTRIDGE2K_WIDGET_HXX +#define CARTRIDGE2K_WIDGET_HXX + +class Cartridge2K; +#include "CartDebugWidget.hxx" + +class Cartridge2KWidget : public CartDebugWidget +{ + public: + Cartridge2KWidget(GuiObject* boss, const GUI::Font& font, + int x, int y, int w, int h, + Cartridge2K& cart); + virtual ~Cartridge2KWidget() { } + + // No implementation for non-bankswitched ROMs + void loadConfig() { } + void handleCommand(CommandSender* sender, int cmd, int data, int id) { } +}; + +#endif diff --git a/src/debugger/gui/Cart4KWidget.cxx b/src/debugger/gui/Cart4KWidget.cxx new file mode 100644 index 000000000..149b95ca9 --- /dev/null +++ b/src/debugger/gui/Cart4KWidget.cxx @@ -0,0 +1,32 @@ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony +// and the Stella Team +// +// See the file "License.txt" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id$ +//============================================================================ + +#include "Cart4K.hxx" +#include "Cart4KWidget.hxx" + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Cartridge4KWidget::Cartridge4KWidget( + GuiObject* boss, const GUI::Font& font, + int x, int y, int w, int h, Cartridge4K& cart) + : CartDebugWidget(boss, font, x, y, w, h) +{ + uInt16 offset = (cart.myImage[0xFFD] << 8) | cart.myImage[0xFFC]; + addBaseInformation(4096, "Atari", "Standard 4K cartridge, non-bankswitched\n" + "Accessible @ $1000 - $1FFF"); +} diff --git a/src/debugger/gui/Cart4KWidget.hxx b/src/debugger/gui/Cart4KWidget.hxx index 9ccaa3dc1..d07e25a5b 100644 --- a/src/debugger/gui/Cart4KWidget.hxx +++ b/src/debugger/gui/Cart4KWidget.hxx @@ -21,7 +21,6 @@ #define CARTRIDGE4K_WIDGET_HXX class Cartridge4K; - #include "CartDebugWidget.hxx" class Cartridge4KWidget : public CartDebugWidget @@ -29,13 +28,7 @@ class Cartridge4KWidget : public CartDebugWidget public: Cartridge4KWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, - Cartridge4K& cart) - : CartDebugWidget(boss, font, x, y, w, h) - { - addBaseInformation(4096, "Atari", "Standard 4K cartridge, non-bankswitched\n" - "Accessible @ $1000 - $1FFF"); - } - + Cartridge4K& cart); virtual ~Cartridge4KWidget() { } // No implementation for non-bankswitched ROMs diff --git a/src/debugger/gui/module.mk b/src/debugger/gui/module.mk index d6a1d1741..080970947 100644 --- a/src/debugger/gui/module.mk +++ b/src/debugger/gui/module.mk @@ -19,6 +19,8 @@ MODULE_OBJS := \ src/debugger/gui/ToggleBitWidget.o \ src/debugger/gui/TogglePixelWidget.o \ src/debugger/gui/ToggleWidget.o \ + src/debugger/gui/Cart2KWidget.o \ + src/debugger/gui/Cart4KWidget.o \ src/debugger/gui/JoystickWidget.o \ src/debugger/gui/PaddleWidget.o \ src/debugger/gui/BoosterWidget.o \ diff --git a/src/emucore/Cart2K.hxx b/src/emucore/Cart2K.hxx index 0b5c47dcf..9392972a9 100644 --- a/src/emucore/Cart2K.hxx +++ b/src/emucore/Cart2K.hxx @@ -24,6 +24,9 @@ class System; #include "bspf.hxx" #include "Cart.hxx" +#ifdef DEBUGGER_SUPPORT + #include "Cart2KWidget.hxx" +#endif /** This is the standard Atari 2K cartridge. These cartridges @@ -35,6 +38,8 @@ class System; */ class Cartridge2K : public Cartridge { + friend class Cart2KWidget; + public: /** Create a new cartridge using the specified image @@ -121,6 +126,18 @@ class Cartridge2K : public Cartridge */ string name() const { return "Cartridge2K"; } + #ifdef DEBUGGER_SUPPORT + /** + Get debugger widget responsible for accessing the inner workings + of the cart. + */ + CartDebugWidget* debugWidget(GuiObject* boss, + const GUI::Font& font, int x, int y, int w, int h) + { + return new Cartridge2KWidget(boss, font, x, y, w, h, *this); + } + #endif + public: /** Get the byte at the specified address diff --git a/src/emucore/Cart4K.hxx b/src/emucore/Cart4K.hxx index bc5041b1e..eabb3ad0c 100644 --- a/src/emucore/Cart4K.hxx +++ b/src/emucore/Cart4K.hxx @@ -37,6 +37,8 @@ class System; */ class Cartridge4K : public Cartridge { + friend class Cartridge4KWidget; + public: /** Create a new cartridge using the specified image