Added F4SC/F6SC/F8SC schemes to debugger ROM tab.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2684 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-06 14:09:16 +00:00
parent 3cfe7218dc
commit 4c227932f1
13 changed files with 440 additions and 3 deletions

View File

@ -0,0 +1,85 @@
//============================================================================
//
// 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 "CartF4SC.hxx"
#include "PopUpWidget.hxx"
#include "CartF4SCWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4SCWidget::CartridgeF4SCWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeF4SC& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = 8 * 4096;
ostringstream info;
info << "Standard F4SC cartridge, eight 4K banks\n"
<< "128 bytes RAM @ $F000 - $F0FF\n"
<< " $F080 - $F0FF (R), $F000 - $F07F (W)\n"
<< "Startup bank = " << cart.myStartBank << "\n";
// Eventually, we should query this from the debugger/disassembler
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFF4; i < 8; ++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, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF4)", "0");
items.push_back("1 ($FF5)", "1");
items.push_back("2 ($FF6)", "2");
items.push_back("3 ($FF7)", "3");
items.push_back("4 ($FF8)", "0");
items.push_back("5 ($FF9)", "1");
items.push_back("6 ($FFA)", "2");
items.push_back("7 ($FFB)", "3");
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 CartridgeF4SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4SCWidget::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 CARTRIDGEF4SC_WIDGET_HXX
#define CARTRIDGEF4SC_WIDGET_HXX
class CartridgeF4SC;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeF4SCWidget : public CartDebugWidget
{
public:
CartridgeF4SCWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeF4SC& cart);
virtual ~CartridgeF4SCWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeF4SC& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -56,7 +56,7 @@ CartridgeF4Widget::CartridgeF4Widget(
items.push_back("6 ($FFA)", "2"); items.push_back("6 ($FFA)", "2");
items.push_back("7 ($FFB)", "3"); items.push_back("7 ($FFB)", "3");
myBank = myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("1 ($FF9)"), new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ", myLineHeight, items, "Set bank: ",
font.getStringWidth("Set bank: "), kBankChanged); font.getStringWidth("Set bank: "), kBankChanged);
myBank->setTarget(this); myBank->setTarget(this);

View File

@ -0,0 +1,81 @@
//============================================================================
//
// 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 "CartF6SC.hxx"
#include "PopUpWidget.hxx"
#include "CartF6SCWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6SCWidget::CartridgeF6SCWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeF6SC& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = 4 * 4096;
ostringstream info;
info << "Standard F6SC cartridge, four 4K banks\n"
<< "128 bytes RAM @ $F000 - $F0FF\n"
<< " $F080 - $F0FF (R), $F000 - $F07F (W)\n"
<< "Startup bank = " << cart.myStartBank << "\n";
// Eventually, we should query this from the debugger/disassembler
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFF6; i < 4; ++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, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF6)", "0");
items.push_back("1 ($FF7)", "1");
items.push_back("2 ($FF8)", "2");
items.push_back("3 ($FF9)", "3");
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 CartridgeF6SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6SCWidget::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 CARTRIDGEF6SC_WIDGET_HXX
#define CARTRIDGEF6SC_WIDGET_HXX
class CartridgeF6SC;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeF6SCWidget : public CartDebugWidget
{
public:
CartridgeF6SCWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeF6SC& cart);
virtual ~CartridgeF6SCWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeF6SC& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -52,7 +52,7 @@ CartridgeF6Widget::CartridgeF6Widget(
items.push_back("2 ($FF8)", "2"); items.push_back("2 ($FF8)", "2");
items.push_back("3 ($FF9)", "3"); items.push_back("3 ($FF9)", "3");
myBank = myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FF6) "), new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ", myLineHeight, items, "Set bank: ",
font.getStringWidth("Set bank: "), kBankChanged); font.getStringWidth("Set bank: "), kBankChanged);
myBank->setTarget(this); myBank->setTarget(this);

View File

@ -0,0 +1,79 @@
//============================================================================
//
// 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 "CartF8SC.hxx"
#include "PopUpWidget.hxx"
#include "CartF8SCWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8SCWidget::CartridgeF8SCWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeF8SC& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = 8192;
ostringstream info;
info << "Standard F8SC cartridge, two 4K banks\n"
<< "128 bytes RAM @ $F000 - $F0FF\n"
<< " $F080 - $F0FF (R), $F000 - $F07F (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 < 2; ++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, "Atari", info.str()) + myLineHeight;
StringMap items;
items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1");
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 CartridgeF8SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8SCWidget::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 CARTRIDGEF8SC_WIDGET_HXX
#define CARTRIDGEF8SC_WIDGET_HXX
class CartridgeF8SC;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeF8SCWidget : public CartDebugWidget
{
public:
CartridgeF8SCWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeF8SC& cart);
virtual ~CartridgeF8SCWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeF8SC& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -50,7 +50,7 @@ CartridgeF8Widget::CartridgeF8Widget(
items.push_back("0 ($FF8)", "0"); items.push_back("0 ($FF8)", "0");
items.push_back("1 ($FF9)", "1"); items.push_back("1 ($FF9)", "1");
myBank = myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FF8) "), new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($FFx) "),
myLineHeight, items, "Set bank: ", myLineHeight, items, "Set bank: ",
font.getStringWidth("Set bank: "), kBankChanged); font.getStringWidth("Set bank: "), kBankChanged);
myBank->setTarget(this); myBank->setTarget(this);

View File

@ -24,6 +24,9 @@ MODULE_OBJS := \
src/debugger/gui/CartF4Widget.o \ src/debugger/gui/CartF4Widget.o \
src/debugger/gui/CartF6Widget.o \ src/debugger/gui/CartF6Widget.o \
src/debugger/gui/CartF8Widget.o \ src/debugger/gui/CartF8Widget.o \
src/debugger/gui/CartF4SCWidget.o \
src/debugger/gui/CartF6SCWidget.o \
src/debugger/gui/CartF8SCWidget.o \
src/debugger/gui/JoystickWidget.o \ src/debugger/gui/JoystickWidget.o \
src/debugger/gui/PaddleWidget.o \ src/debugger/gui/PaddleWidget.o \
src/debugger/gui/BoosterWidget.o \ src/debugger/gui/BoosterWidget.o \

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx" #include "bspf.hxx"
#include "Cart.hxx" #include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartF4SCWidget.hxx"
#endif
/** /**
Cartridge class used for Atari's 32K bankswitched games with Cartridge class used for Atari's 32K bankswitched games with
@ -34,6 +37,8 @@ class System;
*/ */
class CartridgeF4SC : public Cartridge class CartridgeF4SC : public Cartridge
{ {
friend class CartridgeF4SCWidget;
public: public:
/** /**
Create a new cartridge using the specified image Create a new cartridge using the specified image
@ -120,6 +125,18 @@ class CartridgeF4SC : public Cartridge
*/ */
string name() const { return "CartridgeF4SC"; } string name() const { return "CartridgeF4SC"; }
#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 CartridgeF4SCWidget(boss, font, x, y, w, h, *this);
}
#endif
public: public:
/** /**
Get the byte at the specified address. Get the byte at the specified address.

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx" #include "bspf.hxx"
#include "Cart.hxx" #include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartF6SCWidget.hxx"
#endif
/** /**
Cartridge class used for Atari's 16K bankswitched games with Cartridge class used for Atari's 16K bankswitched games with
@ -34,6 +37,8 @@ class System;
*/ */
class CartridgeF6SC : public Cartridge class CartridgeF6SC : public Cartridge
{ {
friend class CartridgeF6SCWidget;
public: public:
/** /**
Create a new cartridge using the specified image Create a new cartridge using the specified image
@ -120,6 +125,18 @@ class CartridgeF6SC : public Cartridge
*/ */
string name() const { return "CartridgeF6SC"; } string name() const { return "CartridgeF6SC"; }
#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 CartridgeF6SCWidget(boss, font, x, y, w, h, *this);
}
#endif
public: public:
/** /**
Get the byte at the specified address. Get the byte at the specified address.

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx" #include "bspf.hxx"
#include "Cart.hxx" #include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartF8SCWidget.hxx"
#endif
/** /**
Cartridge class used for Atari's 8K bankswitched games with Cartridge class used for Atari's 8K bankswitched games with
@ -34,6 +37,8 @@ class System;
*/ */
class CartridgeF8SC : public Cartridge class CartridgeF8SC : public Cartridge
{ {
friend class CartridgeF8SCWidget;
public: public:
/** /**
Create a new cartridge using the specified image Create a new cartridge using the specified image
@ -120,6 +125,18 @@ class CartridgeF8SC : public Cartridge
*/ */
string name() const { return "CartridgeF8SC"; } string name() const { return "CartridgeF8SC"; }
#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 CartridgeF8SCWidget(boss, font, x, y, w, h, *this);
}
#endif
public: public:
/** /**
Get the byte at the specified address. Get the byte at the specified address.