mirror of https://github.com/stella-emu/stella.git
Added X07 scheme to the debugger ROM tab. Since I have only one
test ROM, and it is extremely basic, I can't be sure how well this new functionality works. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2691 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
1b0b6a9f20
commit
2872b6be03
|
@ -0,0 +1,96 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// 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 "CartX07.hxx"
|
||||||
|
#include "PopUpWidget.hxx"
|
||||||
|
#include "CartX07Widget.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
CartridgeX07Widget::CartridgeX07Widget(
|
||||||
|
GuiObject* boss, const GUI::Font& font,
|
||||||
|
int x, int y, int w, int h, CartridgeX07& cart)
|
||||||
|
: CartDebugWidget(boss, font, x, y, w, h),
|
||||||
|
myCart(cart)
|
||||||
|
{
|
||||||
|
uInt32 size = 16 * 4096;
|
||||||
|
|
||||||
|
ostringstream info;
|
||||||
|
info << "64K X07 cartridge, 16 4K banks\n"
|
||||||
|
<< "Startup bank = " << cart.myStartBank << "\n"
|
||||||
|
<< "Multiple hotspots, all below $1000\n"
|
||||||
|
<< "See documentation for further details\n";
|
||||||
|
|
||||||
|
// Eventually, we should query this from the debugger/disassembler
|
||||||
|
for(uInt32 i = 0, offset = 0xFFC; i < 16; ++i, offset += 0x1000)
|
||||||
|
{
|
||||||
|
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
|
||||||
|
start -= start % 0x1000;
|
||||||
|
info << "Bank " << dec << i << " @ $" << HEX4 << start << " - "
|
||||||
|
<< "$" << (start + 0xFFF) << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
int xpos = 10,
|
||||||
|
ypos = addBaseInformation(size, "AtariAge / John Payson / Fred Quimby",
|
||||||
|
info.str()) + 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");
|
||||||
|
myBank =
|
||||||
|
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "),
|
||||||
|
myLineHeight, items, "Set bank: ",
|
||||||
|
font.getStringWidth("Set bank: "), kBankChanged);
|
||||||
|
myBank->setTarget(this);
|
||||||
|
addFocusWidget(myBank);
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void CartridgeX07Widget::loadConfig()
|
||||||
|
{
|
||||||
|
myBank->setSelected(myCart.myCurrentBank);
|
||||||
|
|
||||||
|
CartDebugWidget::loadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void CartridgeX07Widget::handleCommand(CommandSender* sender,
|
||||||
|
int cmd, int data, int id)
|
||||||
|
{
|
||||||
|
if(cmd == kBankChanged)
|
||||||
|
{
|
||||||
|
myCart.unlockBank();
|
||||||
|
myCart.bank(myBank->getSelected());
|
||||||
|
myCart.lockBank();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 CARTRIDGEX07_WIDGET_HXX
|
||||||
|
#define CARTRIDGEX07_WIDGET_HXX
|
||||||
|
|
||||||
|
class CartridgeX07;
|
||||||
|
class PopUpWidget;
|
||||||
|
|
||||||
|
#include "CartDebugWidget.hxx"
|
||||||
|
|
||||||
|
class CartridgeX07Widget : public CartDebugWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CartridgeX07Widget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
int x, int y, int w, int h,
|
||||||
|
CartridgeX07& cart);
|
||||||
|
virtual ~CartridgeX07Widget() { }
|
||||||
|
|
||||||
|
void loadConfig();
|
||||||
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
CartridgeX07& myCart;
|
||||||
|
PopUpWidget* myBank;
|
||||||
|
|
||||||
|
enum { kBankChanged = 'bkCH' };
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -38,6 +38,7 @@ MODULE_OBJS := \
|
||||||
src/debugger/gui/CartF6SCWidget.o \
|
src/debugger/gui/CartF6SCWidget.o \
|
||||||
src/debugger/gui/CartF8SCWidget.o \
|
src/debugger/gui/CartF8SCWidget.o \
|
||||||
src/debugger/gui/CartUAWidget.o \
|
src/debugger/gui/CartUAWidget.o \
|
||||||
|
src/debugger/gui/CartX07Widget.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 \
|
||||||
|
|
|
@ -24,6 +24,9 @@ class System;
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
#include "Cart.hxx"
|
#include "Cart.hxx"
|
||||||
|
#ifdef DEBUGGER_SUPPORT
|
||||||
|
#include "CartX07Widget.hxx"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Bankswitching method as defined/created by John Payson (aka Supercat)
|
Bankswitching method as defined/created by John Payson (aka Supercat)
|
||||||
|
@ -44,6 +47,8 @@ class System;
|
||||||
*/
|
*/
|
||||||
class CartridgeX07 : public Cartridge
|
class CartridgeX07 : public Cartridge
|
||||||
{
|
{
|
||||||
|
friend class CartridgeX07Widget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Create a new cartridge using the specified image
|
Create a new cartridge using the specified image
|
||||||
|
@ -130,6 +135,18 @@ class CartridgeX07 : public Cartridge
|
||||||
*/
|
*/
|
||||||
string name() const { return "CartridgeX07"; }
|
string name() const { return "CartridgeX07"; }
|
||||||
|
|
||||||
|
#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 CartridgeX07Widget(boss, font, x, y, w, h, *this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Get the byte at the specified address.
|
Get the byte at the specified address.
|
||||||
|
|
Loading…
Reference in New Issue