Added FA scheme to debugger ROM tab. Now begins the more difficult work;

adding the more esoteric schemes to the debugger ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2686 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-06 22:13:26 +00:00
parent 1ff7568c68
commit 368c26c371
6 changed files with 149 additions and 6 deletions

View File

@ -0,0 +1,82 @@
//============================================================================
//
// 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 "CartFA.hxx"
#include "PopUpWidget.hxx"
#include "CartFAWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeFAWidget::CartridgeFAWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeFA& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = 3 * 4096;
ostringstream info;
info << "CBS RAM+ FA cartridge, three 4K banks\n"
<< "256 bytes RAM @ $F000 - $F1FF\n"
<< " $F100 - $F1FF (R), $F000 - $F0FF (W)\n"
<< "Startup bank = " << cart.myStartBank << "\n";
// Eventually, we should query this from the debugger/disassembler
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFF8; i < 3; ++i, offset += 0x1000)
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
int xpos = 10,
ypos = addBaseInformation(size, "CBS", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
items.push_back("2 ($FFA)", "2");
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 CartridgeFAWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFAWidget::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 CARTRIDGEFA_WIDGET_HXX
#define CARTRIDGEFA_WIDGET_HXX
class CartridgeFA;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeFAWidget : public CartDebugWidget
{
public:
CartridgeFAWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeFA& cart);
virtual ~CartridgeFAWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeFA& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -26,6 +26,7 @@ MODULE_OBJS := \
src/debugger/gui/CartEFWidget.o \
src/debugger/gui/CartEFSCWidget.o \
src/debugger/gui/CartF0Widget.o \
src/debugger/gui/CartFAWidget.o \
src/debugger/gui/CartF4Widget.o \
src/debugger/gui/CartF6Widget.o \
src/debugger/gui/CartF8Widget.o \

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx"
#include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartFAWidget.hxx"
#endif
/**
Cartridge class used for CBS' RAM Plus cartridges. There are
@ -34,6 +37,8 @@ class System;
*/
class CartridgeFA : public Cartridge
{
friend class CartridgeFAWidget;
public:
/**
Create a new cartridge using the specified image
@ -120,6 +125,18 @@ class CartridgeFA : public Cartridge
*/
string name() const { return "CartridgeFA"; }
#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 CartridgeFAWidget(boss, font, x, y, w, h, *this);
}
#endif
public:
/**
Get the byte at the specified address.

View File

@ -129,15 +129,12 @@ bool CartridgeFE::bankChanged()
if(myLastAddressChanged)
{
// A bankswitch occurs when the addresses transition from state to another
bool a1 = ((myLastAddress1 & 0x2000) == 0),
a2 = ((myLastAddress2 & 0x2000) == 0);
myBankChanged = (a1 && !a2) || (a2 && !a1);
myBankChanged = ((myLastAddress1 & 0x2000) == 0) !=
((myLastAddress2 & 0x2000) == 0);
myLastAddressChanged = false;
}
else
{
myBankChanged = false;
}
// In any event, let the base class know about it
return Cartridge::bankChanged();

View File

@ -26,7 +26,7 @@ class System;
#include "Cart.hxx"
/**
Bankswitching method used by Activison's Robot Tank and Decathlon.
Bankswitching method used by Activision's Robot Tank and Decathlon.
Kevin Horton describes FE as follows: