Added CTY scheme to the debugger ROM tab. Just as with the last

commit (AR), this one isn't yet fully implemented.

That's it for the bankswitch schemes.  Now I can move on to the
remaining items for the 3.9 release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2709 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-24 22:24:41 +00:00
parent 3839b54d22
commit e3903ca2b8
4 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,77 @@
//============================================================================
//
// 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 "CartCTY.hxx"
#include "PopUpWidget.hxx"
#include "CartCTYWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCTYWidget::CartridgeCTYWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeCTY& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = 8 * 4096;
string info =
"Chetiry cartridge, eight 4K banks (bank 0 is ARM code and is ignored)\n"
"64 bytes RAM @ $F000 - $F080\n"
" $F040 - $F07F (R), $F000 - $F03F (W)\n"
"\nTHIS SCHEME IS NOT FULLY IMPLEMENTED OR TESTED\n";
int xpos = 10,
ypos = addBaseInformation(size, "Chris D. Walton", info) + myLineHeight;
StringMap items;
items.push_back("1 ($FF5)", "1");
items.push_back("2 ($FF6)", "2");
items.push_back("3 ($FF7)", "3");
items.push_back("4 ($FF8)", "4");
items.push_back("5 ($FF9)", "5");
items.push_back("6 ($FFA)", "6");
items.push_back("7 ($FFB)", "7");
myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ",
font.getStringWidth("Set bank: "), kBankChanged);
myBank->setTarget(this);
addFocusWidget(myBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCTYWidget::loadConfig()
{
myBank->setSelected(myCart.bank()-1);
CartDebugWidget::loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCTYWidget::handleCommand(CommandSender* sender,
int cmd, int data, int id)
{
if(cmd == kBankChanged)
{
myCart.unlockBank();
myCart.bank(myBank->getSelected()+1);
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 CARTRIDGECTY_WIDGET_HXX
#define CARTRIDGECTY_WIDGET_HXX
class CartridgeCTY;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeCTYWidget : public CartDebugWidget
{
public:
CartridgeCTYWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeCTY& cart);
virtual ~CartridgeCTYWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeCTY& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -27,6 +27,7 @@ MODULE_OBJS := \
src/debugger/gui/Cart4KWidget.o \
src/debugger/gui/CartARWidget.o \
src/debugger/gui/CartCMWidget.o \
src/debugger/gui/CartCTYWidget.o \
src/debugger/gui/CartCVWidget.o \
src/debugger/gui/CartDPCWidget.o \
src/debugger/gui/CartDPCPlusWidget.o \

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx"
#include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartCTYWidget.hxx"
#endif
/**
The 'Chetiry' bankswitch scheme was developed by Chris D. Walton for a
@ -109,6 +112,8 @@ class System;
*/
class CartridgeCTY : public Cartridge
{
friend class CartridgeCTYWidget;
public:
/**
Create a new cartridge using the specified image
@ -210,6 +215,18 @@ class CartridgeCTY : public Cartridge
*/
void setRomName(const string& name);
#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 CartridgeCTYWidget(boss, font, x, y, w, h, *this);
}
#endif
public:
/**
Get the byte at the specified address.