Added first pass of DPC scheme to the debugger ROM tab. For now,

it only contains the same functionality as F8; it needs to be
expanded to show more DPC-specific stuff.

Updated all schemes that contain a fixed RAM address range
(mostly the Superchip ones) to exclude that range from the
accessible ROM area.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2700 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-18 16:57:33 +00:00
parent ff09b61c55
commit de6dbc060c
13 changed files with 165 additions and 12 deletions

View File

@ -35,7 +35,8 @@ CartridgeCVWidget::CartridgeCVWidget(
info << "CV 2K ROM + 1K RAM , non-bankswitched\n"
<< "1024 bytes RAM @ $F000 - $F7FF\n"
<< " $F000 - $F3FF (R), $F400 - $F7FF (W)\n"
<< "ROM accessible @ $" << HEX4 << start << " - " << "$" << (start + size - 1);
<< "ROM accessible @ $" << HEX4 << start << " - "
<< "$" << (start + size - 1);
addBaseInformation(cart.mySize, "CommaVid", info.str());
}

View File

@ -0,0 +1,83 @@
//============================================================================
//
// 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 "CartDPC.hxx"
#include "PopUpWidget.hxx"
#include "CartDPCWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDPCWidget::CartridgeDPCWidget(
GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeDPC& cart)
: CartDebugWidget(boss, font, x, y, w, h),
myCart(cart)
{
uInt16 size = cart.mySize;
ostringstream info;
info << "DPC cartridge, two 4K banks + 2K display bank\n"
<< "DPC registers accessible @ $F000 - $F07F\n"
<< " $F000 - $F03F (R), $F040 - $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 + 0x80) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}
int xpos = 10,
ypos = addBaseInformation(size, "Activision (Pitfall II)", 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 CartridgeDPCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCWidget::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 CARTRIDGEDPC_WIDGET_HXX
#define CARTRIDGEDPC_WIDGET_HXX
class CartridgeDPC;
class PopUpWidget;
#include "CartDebugWidget.hxx"
class CartridgeDPCWidget : public CartDebugWidget
{
public:
CartridgeDPCWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
CartridgeDPC& cart);
virtual ~CartridgeDPCWidget() { }
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
private:
CartridgeDPC& myCart;
PopUpWidget* myBank;
enum { kBankChanged = 'bkCH' };
};
#endif

View File

@ -40,7 +40,7 @@ CartridgeE7Widget::CartridgeE7Widget(
<< " Hotspots $FE8 - $FEB (256B of RAM slice 1)\n"
<< " $F400 - $F7FF (R), $F000 - $F3FF (W)\n"
<< "Upper 1.5K ROM accessible @ $FA00 - $FFFF\n"
<< " Always points to last 2K (1.5) of ROM\n"
<< " Always points to last 1.5K of ROM\n"
<< "Startup slices = " << cart.myStartBank << " / 0\n";
#if 0
@ -50,7 +50,8 @@ CartridgeE7Widget::CartridgeE7Widget(
info << "Bank RORG" << " = $" << HEX4 << start << "\n";
#endif
int xpos = 10,
ypos = addBaseInformation(size, "M-Network", info.str(), 15) + myLineHeight;
ypos = addBaseInformation(size, "M-Network", info.str(), 15) +
myLineHeight;
StringMap items0, items1;
items0.push_back("0 - ROM ($FE0)", "0");

View File

@ -41,7 +41,7 @@ CartridgeEFSCWidget::CartridgeEFSCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << dec << i << " @ $" << HEX4 << start << " - "
info << "Bank " << dec << i << " @ $" << HEX4 << (start + 0x100) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -41,7 +41,7 @@ CartridgeF4SCWidget::CartridgeF4SCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
info << "Bank " << i << " @ $" << HEX4 << (start + 0x100) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -41,7 +41,7 @@ CartridgeF6SCWidget::CartridgeF6SCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
info << "Bank " << i << " @ $" << HEX4 << (start + 0x100) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -41,7 +41,7 @@ CartridgeF8SCWidget::CartridgeF8SCWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
info << "Bank " << i << " @ $" << HEX4 << (start + 0x100) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -43,7 +43,7 @@ CartridgeFA2Widget::CartridgeFA2Widget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
info << "Bank " << i << " @ $" << HEX4 << (start + 0x200) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -41,7 +41,7 @@ CartridgeFAWidget::CartridgeFAWidget(
{
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset];
start -= start % 0x1000;
info << "Bank " << i << " @ $" << HEX4 << start << " - "
info << "Bank " << i << " @ $" << HEX4 << (start + 0x200) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
}

View File

@ -26,6 +26,7 @@ MODULE_OBJS := \
src/debugger/gui/Cart4A50Widget.o \
src/debugger/gui/Cart4KWidget.o \
src/debugger/gui/CartCVWidget.o \
src/debugger/gui/CartDPCWidget.o \
src/debugger/gui/CartE0Widget.o \
src/debugger/gui/CartE7Widget.o \
src/debugger/gui/CartEFWidget.o \

View File

@ -27,11 +27,12 @@
CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
mySize(size),
mySystemCycles(0),
myFractionalClocks(0.0)
{
// Make a copy of the entire image
memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 255u));
memcpy(myImage, image, BSPF_min(size, 8192u + 2048u + 256u));
createCodeAccessBase(8192);
// Pointer to the program ROM (8K @ 0 byte offset)
@ -467,7 +468,7 @@ bool CartridgeDPC::patch(uInt16 address, uInt8 value)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt8* CartridgeDPC::getImage(int& size) const
{
size = 8192 + 2048 + 255;
size = mySize;
return myImage;
}

View File

@ -24,6 +24,9 @@ class System;
#include "bspf.hxx"
#include "Cart.hxx"
#ifdef DEBUGGER_SUPPORT
#include "CartDPCWidget.hxx"
#endif
/**
Cartridge class used for Pitfall II. There are two 4K program banks, a
@ -35,6 +38,8 @@ class System;
*/
class CartridgeDPC : public Cartridge
{
friend class CartridgeDPCWidget;
public:
/**
Create a new cartridge using the specified image
@ -128,6 +133,18 @@ class CartridgeDPC : public Cartridge
*/
string name() const { return "CartridgeDPC"; }
#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 CartridgeDPCWidget(boss, font, x, y, w, h, *this);
}
#endif
public:
/**
Get the byte at the specified address.
@ -159,7 +176,10 @@ class CartridgeDPC : public Cartridge
private:
// The ROM image
uInt8 myImage[8192 + 2048 + 255];
uInt8 myImage[8192 + 2048 + 256];
// (Actual) Size of the ROM image
uInt32 mySize;
// Pointer to the 8K program ROM image of the cartridge
uInt8* myProgramImage;