mirror of https://github.com/stella-emu/stella.git
Added 3F scheme to the debugger ROM tab.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2687 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
368c26c371
commit
40e4687372
|
@ -31,7 +31,7 @@ Cartridge0840Widget::Cartridge0840Widget(
|
|||
uInt16 size = 2 * 4096;
|
||||
|
||||
ostringstream info;
|
||||
info << "0840 Econobanking, two 4K banks\n"
|
||||
info << "0840 ECONObanking, two 4K banks\n"
|
||||
<< "Startup bank = " << cart.myStartBank << "\n";
|
||||
|
||||
// Eventually, we should query this from the debugger/disassembler
|
||||
|
|
|
@ -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 "Cart3F.hxx"
|
||||
#include "PopUpWidget.hxx"
|
||||
#include "Cart3FWidget.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge3FWidget::Cartridge3FWidget(
|
||||
GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h, Cartridge3F& cart)
|
||||
: CartDebugWidget(boss, font, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "Tigervision 3F cartridge, 2-256 2K banks\n"
|
||||
<< "Startup bank = " << cart.myStartBank << "\n"
|
||||
<< "First 2K bank selected by writing to $3F\n"
|
||||
<< "Last 2K always points to last 2K of ROM\n";
|
||||
|
||||
// Eventually, we should query this from the debugger/disassembler
|
||||
uInt16 start = (cart.myImage[size-3] << 8) | cart.myImage[size-4];
|
||||
start -= start % 0x1000;
|
||||
info << "Bank RORG" << " = $" << HEX4 << start << "\n";
|
||||
|
||||
int xpos = 10,
|
||||
ypos = addBaseInformation(size, "TigerVision", info.str()) + myLineHeight;
|
||||
|
||||
StringMap items;
|
||||
for(uInt16 i = 0; i < cart.bankCount(); ++i)
|
||||
{
|
||||
const string& b = BSPF_toString(i);
|
||||
items.push_back(b + " ($3F)", b);
|
||||
}
|
||||
ostringstream label;
|
||||
label << "Set bank ($" << HEX4 << start << " - $" << (start+0x7FF) << "): ";
|
||||
myBank =
|
||||
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("0 ($3F) "),
|
||||
myLineHeight, items, label.str(),
|
||||
font.getStringWidth(label.str()), kBankChanged);
|
||||
myBank->setTarget(this);
|
||||
addFocusWidget(myBank);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge3FWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelected(myCart.myCurrentBank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge3FWidget::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 CARTRIDGE3F_WIDGET_HXX
|
||||
#define CARTRIDGE3F_WIDGET_HXX
|
||||
|
||||
class Cartridge3F;
|
||||
class PopUpWidget;
|
||||
|
||||
#include "CartDebugWidget.hxx"
|
||||
|
||||
class Cartridge3FWidget : public CartDebugWidget
|
||||
{
|
||||
public:
|
||||
Cartridge3FWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h,
|
||||
Cartridge3F& cart);
|
||||
virtual ~Cartridge3FWidget() { }
|
||||
|
||||
void loadConfig();
|
||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||
|
||||
private:
|
||||
Cartridge3F& myCart;
|
||||
PopUpWidget* myBank;
|
||||
|
||||
enum { kBankChanged = 'bkCH' };
|
||||
};
|
||||
|
||||
#endif
|
|
@ -21,6 +21,7 @@ MODULE_OBJS := \
|
|||
src/debugger/gui/ToggleWidget.o \
|
||||
src/debugger/gui/Cart0840Widget.o \
|
||||
src/debugger/gui/Cart2KWidget.o \
|
||||
src/debugger/gui/Cart3FWidget.o \
|
||||
src/debugger/gui/Cart4KWidget.o \
|
||||
src/debugger/gui/CartCVWidget.o \
|
||||
src/debugger/gui/CartEFWidget.o \
|
||||
|
|
|
@ -47,7 +47,7 @@ class System;
|
|||
instead, store the RAM bank number into $3E.
|
||||
|
||||
This implementation of 3E bankswitching numbers the ROM banks 0 to
|
||||
256, and the RAM banks 256 to 287. This is done because the public
|
||||
255, and the RAM banks 256 to 287. This is done because the public
|
||||
bankswitching interface requires us to use one bank number, not one
|
||||
bank number plus the knowledge of whether it's RAM or ROM.
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ class System;
|
|||
|
||||
#include "bspf.hxx"
|
||||
#include "Cart.hxx"
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
#include "Cart3FWidget.hxx"
|
||||
#endif
|
||||
|
||||
/**
|
||||
This is the cartridge class for Tigervision's bankswitched
|
||||
|
@ -40,6 +43,8 @@ class System;
|
|||
*/
|
||||
class Cartridge3F : public Cartridge
|
||||
{
|
||||
friend class Cartridge3FWidget;
|
||||
|
||||
public:
|
||||
/**
|
||||
Create a new cartridge using the specified image and size
|
||||
|
@ -126,6 +131,18 @@ class Cartridge3F : public Cartridge
|
|||
*/
|
||||
string name() const { return "Cartridge3F"; }
|
||||
|
||||
#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 Cartridge3FWidget(boss, font, x, y, w, h, *this);
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
/**
|
||||
Get the byte at the specified address
|
||||
|
|
Loading…
Reference in New Issue