Added Supercharger/AR scheme to the debugger ROM tab.

No extra functionality is present; this will have to wait
until a future release after I have a better understanding
of the AR scheme.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2707 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-24 16:50:24 +00:00
parent bbba4926d4
commit 0d7df2d0ae
5 changed files with 167 additions and 1 deletions

View File

@ -0,0 +1,100 @@
//============================================================================
//
// 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 "CartAR.hxx"
#include "PopUpWidget.hxx"
#include "CartARWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeARWidget::CartridgeARWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeAR& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = myCart.mySize;
string info =
"Supercharger cartridge, four 2K slices (3 RAM, 1 ROM)\n"
"\nTHIS SCHEME IS NOT FULLY IMPLEMENTED OR TESTED\n";
int xpos = 10,
ypos = addBaseInformation(size, "Starpath", info) + myLineHeight;
StringMap items;
items.push_back(" 0", "0");
items.push_back(" 1", "1");
items.push_back(" 2", "2");
items.push_back(" 3", "3");
items.push_back(" 4", "4");
items.push_back(" 5", "5");
items.push_back(" 6", "6");
items.push_back(" 7", "7");
items.push_back(" 8", "8");
items.push_back(" 9", "9");
items.push_back(" 10", "10");
items.push_back(" 11", "11");
items.push_back(" 12", "12");
items.push_back(" 13", "13");
items.push_back(" 14", "14");
items.push_back(" 15", "15");
items.push_back(" 16", "16");
items.push_back(" 17", "17");
items.push_back(" 18", "18");
items.push_back(" 19", "19");
items.push_back(" 20", "20");
items.push_back(" 21", "21");
items.push_back(" 22", "22");
items.push_back(" 23", "23");
items.push_back(" 24", "24");
items.push_back(" 25", "25");
items.push_back(" 26", "26");
items.push_back(" 27", "27");
items.push_back(" 28", "28");
items.push_back(" 29", "29");
items.push_back(" 30", "30");
items.push_back(" 31", "31");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" XX "),
myLineHeight, items, "Set bank: ",
font.getStringWidth("Set bank: "), kBankChanged);
myBank->setTarget(this);
addFocusWidget(myBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeARWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeARWidget::handleCommand(CommandSender* sender,
int cmd, int data, int id)
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.bank(myBank->getSelected());
myCart.lockBank();
invalidate();
}
}

View File

@ -0,0 +1,46 @@
//============================================================================
//
// 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 CARTRIDGEAR_WIDGET_HXX
#define CARTRIDGEAR_WIDGET_HXX
class CartridgeAR;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeARWidget : public CartDebugWidget
{
public:
CartridgeARWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeAR& cart);
virtual ~CartridgeARWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeAR& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -25,6 +25,7 @@ MODULE_OBJS := \
src/debugger/gui/Cart3FWidget.o \ src/debugger/gui/Cart3FWidget.o \
src/debugger/gui/Cart4A50Widget.o \ src/debugger/gui/Cart4A50Widget.o \
src/debugger/gui/Cart4KWidget.o \ src/debugger/gui/Cart4KWidget.o \
src/debugger/gui/CartARWidget.o \
src/debugger/gui/CartCMWidget.o \ src/debugger/gui/CartCMWidget.o \
src/debugger/gui/CartCVWidget.o \ src/debugger/gui/CartCVWidget.o \
src/debugger/gui/CartDPCWidget.o \ src/debugger/gui/CartDPCWidget.o \

View File

@ -59,10 +59,12 @@ CartridgeAR::~CartridgeAR()
void CartridgeAR::reset() void CartridgeAR::reset()
{ {
// Initialize RAM // Initialize RAM
#if 0 // TODO - figure out actual behaviour of the real cart
if(mySettings.getBool("ramrandom")) if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 6 * 1024; ++i) for(uInt32 i = 0; i < 6 * 1024; ++i)
myImage[i] = mySystem->randGenerator().next(); myImage[i] = mySystem->randGenerator().next();
else else
#endif
memset(myImage, 0, 6 * 1024); memset(myImage, 0, 6 * 1024);
// Initialize SC BIOS ROM // Initialize SC BIOS ROM

View File

@ -25,6 +25,9 @@ class System;
#include "bspf.hxx" #include "bspf.hxx"
#include "Cart.hxx" #include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartARWidget.hxx"
#endif
/** /**
This is the cartridge class for Arcadia (aka Starpath) Supercharger This is the cartridge class for Arcadia (aka Starpath) Supercharger
@ -40,6 +43,8 @@ class System;
*/ */
class CartridgeAR : public Cartridge class CartridgeAR : public Cartridge
{ {
friend class CartridgeARWidget;
public: public:
/** /**
Create a new cartridge using the specified image and size Create a new cartridge using the specified image and size
@ -133,6 +138,18 @@ class CartridgeAR : public Cartridge
*/ */
string name() const { return "CartridgeAR"; } string name() const { return "CartridgeAR"; }
#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 CartridgeARWidget(boss, font, x, y, w, h, *this);
}
#endif
public: public:
/** /**
Get the byte at the specified address Get the byte at the specified address
@ -176,7 +193,7 @@ class CartridgeAR : public Cartridge
// Pointer to the 6502 processor in the system // Pointer to the 6502 processor in the system
M6502* my6502; M6502* my6502;
// Indicates the offest within the image for the corresponding bank // Indicates the offset within the image for the corresponding bank
uInt32 myImageOffset[2]; uInt32 myImageOffset[2];
// The 6K of RAM and 2K of ROM contained in the Supercharger // The 6K of RAM and 2K of ROM contained in the Supercharger