Updated BUS to support some of the older demos. (#898)

This commit is contained in:
Darrell Spice, Jr 2022-06-11 18:10:12 -05:00 committed by GitHub
parent 20ca8efd1f
commit cb892a91bf
7 changed files with 960 additions and 311 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-2022 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.
//============================================================================
#include "CartBUSInfoWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeBUSInfoWidget::CartridgeBUSInfoWidget(
GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont,
int x, int y, int w, int h, CartridgeBUS& cart)
: CartDebugWidget(boss, lfont, nfont, x, y, w, h)
{
constexpr uInt16 size = 8 * 4096;
ostringstream info;
if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0)
{
info << "BUS Stuffing cartridge (EXPERIMENTAL)\n"
<< "32K ROM, six 4K banks are accessible to 2600\n"
<< "8K BUS RAM\n"
<< "BUS registers accessible @ $F000 - $F03F\n"
<< "Banks accessible at hotspots $FFF6 to $FFFB\n"
<< "Startup bank = " << cart.startBank() << "\n";
}
else
{
info << "BUS Stuffing cartridge (EXPERIMENTAL)\n"
<< "32K ROM, seven 4K banks are accessible to 2600\n"
<< "8K BUS RAM\n"
<< (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3 ?
"BUS registers accessible @ $FFEE - $FFF3\n" : // BUS3
"BUS registers accessible @ $F000 - $F01A\n") // BUS1, BUS2
<< "Banks accessible at hotspots $FFF5 to $FFFB\n"
<< "Startup bank = " << cart.startBank() << "\n";
}
#if 0
// Eventually, we should query this from the debugger/disassembler
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFF5; i < 7; ++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";
}
#endif
addBaseInformation(size, "AtariAge", info.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeBUSInfoWidget::describeBUSVersion(CartridgeBUS::BUSSubtype subtype)
{
switch(subtype)
{
case CartridgeBUS::BUSSubtype::BUS0:
return "BUS (v0)";
case CartridgeBUS::BUSSubtype::BUS1:
return "BUS (v1)";
case CartridgeBUS::BUSSubtype::BUS2:
return "BUS (v2)";
case CartridgeBUS::BUSSubtype::BUS3:
return "BUS (v3)";
default:
throw runtime_error("unreachable");
}
}

View File

@ -0,0 +1,43 @@
//============================================================================
//
// 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-2022 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.
//============================================================================
#ifndef CARTRIDGEBUS_INFO_WIDGET_HXX
#define CARTRIDGEBUS_INFO_WIDGET_HXX
#include "CartBUS.hxx"
#include "CartDebugWidget.hxx"
class CartridgeBUSInfoWidget : public CartDebugWidget
{
public:
CartridgeBUSInfoWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont,
int x, int y, int w, int h,
CartridgeBUS& cart);
~CartridgeBUSInfoWidget() override = default;
private:
static string describeBUSVersion(CartridgeBUS::BUSSubtype subtype);
// Following constructors and assignment operators not supported
CartridgeBUSInfoWidget() = delete;
CartridgeBUSInfoWidget(const CartridgeBUSInfoWidget&) = delete;
CartridgeBUSInfoWidget(CartridgeBUSInfoWidget&&) = delete;
CartridgeBUSInfoWidget& operator=(const CartridgeBUSInfoWidget&) = delete;
CartridgeBUSInfoWidget& operator=(CartridgeBUSInfoWidget&&) = delete;
};
#endif

View File

@ -28,38 +28,53 @@ CartridgeBUSWidget::CartridgeBUSWidget(
: CartridgeARMWidget(boss, lfont, nfont, x, y, w, h, cart), : CartridgeARMWidget(boss, lfont, nfont, x, y, w, h, cart),
myCart{cart} myCart{cart}
{ {
constexpr uInt16 size = 8 * 4096; constexpr int VBORDER = 8,
HBORDER = 2,
INDENT = 20,
VGAP = 4;
ostringstream info; int xpos = HBORDER, ypos = VBORDER;
info << "BUS Stuffing cartridge (EXPERIMENTAL)\n" int ds2_rows;
<< "32K ROM, seven 4K banks are accessible to 2600\n"
<< "8K BUS RAM\n" // if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0)
<< "BUS registers accessible @ $FFEE - $FFF3\n" // {
<< "Banks accessible at hotspots $FFFF to $FFFB\n" // int lwidth = _font.getStringWidth("Unsupported version of BUS"); // get width of the widest label
<< "Startup bank = " << cart.startBank() << "\n"; // new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
// myFontHeight, "Unsupported version of BUS", TextAlign::Left);
#if 0 // return;
// Eventually, we should query this from the debugger/disassembler // }
for(uInt32 i = 0, offset = 0xFFC, spot = 0xFF5; i < 7; ++i, offset += 0x1000)
if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
{ {
uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; ds2_rows = 2;
start -= start % 0x1000; myDatastreamCount = 18;
info << "Bank " << i << " @ $" << HEX4 << (start + 0x80) << " - "
<< "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n";
} }
#endif else
{
int xpos = 2, ds2_rows = 4;
ypos = addBaseInformation(size, "AtariAge", info.str(), 4) + 4; myDatastreamCount = 20;
}
VariantList items; VariantList items;
VarList::push_back(items, "0 ($FFF5)"); if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0)
VarList::push_back(items, "1 ($FFF6)"); {
VarList::push_back(items, "2 ($FFF7)"); VarList::push_back(items, "0 ($FFF6)");
VarList::push_back(items, "3 ($FFF8)"); VarList::push_back(items, "1 ($FFF7)");
VarList::push_back(items, "4 ($FFF9)"); VarList::push_back(items, "2 ($FFF8)");
VarList::push_back(items, "5 ($FFFA)"); VarList::push_back(items, "3 ($FFF9)");
VarList::push_back(items, "6 ($FFFB)"); VarList::push_back(items, "4 ($FFFA)");
VarList::push_back(items, "5 ($FFFB)");
}
else
{
VarList::push_back(items, "0 ($FFF5)");
VarList::push_back(items, "1 ($FFF6)");
VarList::push_back(items, "2 ($FFF7)");
VarList::push_back(items, "3 ($FFF8)");
VarList::push_back(items, "4 ($FFF9)");
VarList::push_back(items, "5 ($FFFA)");
VarList::push_back(items, "6 ($FFFB)");
}
myBank = myBank =
new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("0 ($FFFx)"), new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("0 ($FFFx)"),
myLineHeight, items, "Set bank ", myLineHeight, items, "Set bank ",
@ -72,7 +87,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
// Datastream Pointers // Datastream Pointers
#define DS_X 30 #define DS_X 30
xpos = DS_X; xpos = DS_X;
ypos += myLineHeight + 4; ypos += myLineHeight + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Datastream Pointers", TextAlign::Left); myFontHeight, "Datastream Pointers", TextAlign::Left);
@ -80,7 +95,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myDatastreamPointers->setTarget(this); myDatastreamPointers->setTarget(this);
myDatastreamPointers->setEditable(false); myDatastreamPointers->setEditable(false);
myDatastreamPointers2 = new DataGridWidget(boss, _nfont, DS_X + myDatastreamPointers->getWidth() * 3 / 4, ypos+myLineHeight-2 + 4*myLineHeight, 1, 2, 6, 32, Common::Base::Fmt::_16_3_2); myDatastreamPointers2 = new DataGridWidget(boss, _nfont, DS_X + myDatastreamPointers->getWidth() * 3 / 4, ypos+myLineHeight-2 + 4*myLineHeight, 1, ds2_rows, 6, 32, Common::Base::Fmt::_16_3_2);
myDatastreamPointers2->setTarget(this); myDatastreamPointers2->setTarget(this);
myDatastreamPointers2->setEditable(false); myDatastreamPointers2->setEditable(false);
@ -93,18 +108,42 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myFontWidth*2, myFontHeight, "", TextAlign::Left); myFontWidth*2, myFontHeight, "", TextAlign::Left);
myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::Fmt::_16_2)); myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::Fmt::_16_2));
} }
lwidth = _font.getStringWidth("Write Data (stream 16)");
myDatastreamLabels[4] = if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "), {
ypos+myLineHeight-2 + 4*myLineHeight + 2, lwidth = _font.getStringWidth("Write Data (stream 16)");
lwidth, myFontHeight, "Write Data (stream 16)", TextAlign::Left); myDatastreamLabels[4] =
myDatastreamLabels[5] = new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "), ypos+myLineHeight-2 + 4*myLineHeight + 2,
ypos+myLineHeight-2 + 5*myLineHeight + 2, lwidth, myFontHeight, "Write Data (stream 16)", TextAlign::Left);
lwidth, myFontHeight, "Jump Data (stream 17)", TextAlign::Left); myDatastreamLabels[5] =
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
ypos+myLineHeight-2 + 5*myLineHeight + 2,
lwidth, myFontHeight, "Jump Data (stream 17)", TextAlign::Left);
}
else
{
lwidth = _font.getStringWidth("Write Data 0 (stream 16)");
myDatastreamLabels[4] =
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
ypos+myLineHeight-2 + 4*myLineHeight + 2,
lwidth, myFontHeight, "Write Data 0(stream 16)", TextAlign::Left);
myDatastreamLabels[5] =
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
ypos+myLineHeight-2 + 5*myLineHeight + 2,
lwidth, myFontHeight, "Write Data 1(stream 17)", TextAlign::Left);
myDatastreamLabels[6] =
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
ypos+myLineHeight-2 + 6*myLineHeight + 2,
lwidth, myFontHeight, "Write Data 2(stream 18)", TextAlign::Left);
myDatastreamLabels[7] =
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
ypos+myLineHeight-2 + 7*myLineHeight + 2,
lwidth, myFontHeight, "Write Data 3(stream 19)", TextAlign::Left);
}
// Datastream Increments // Datastream Increments
xpos = DS_X + myDatastreamPointers->getWidth() + 20; xpos = DS_X + myDatastreamPointers->getWidth() + INDENT;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Datastream Increments", TextAlign::Left); myFontHeight, "Datastream Increments", TextAlign::Left);
@ -112,12 +151,12 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myDatastreamIncrements->setTarget(this); myDatastreamIncrements->setTarget(this);
myDatastreamIncrements->setEditable(false); myDatastreamIncrements->setEditable(false);
myDatastreamIncrements2 = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2 + 4*myLineHeight, 1, 2, 5, 32, Common::Base::Fmt::_16_2_2); myDatastreamIncrements2 = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2 + 4*myLineHeight, 1, ds2_rows, 5, 32, Common::Base::Fmt::_16_2_2);
myDatastreamIncrements2->setTarget(this); myDatastreamIncrements2->setTarget(this);
myDatastreamIncrements2->setEditable(false); myDatastreamIncrements2->setEditable(false);
// Datastream Maps // Datastream Maps
xpos = 0; ypos += myLineHeight*7 + 4; xpos = 0; ypos += myLineHeight*(5 + ds2_rows) + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Address Maps", TextAlign::Left); myFontHeight, "Address Maps", TextAlign::Left);
@ -126,7 +165,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myAddressMaps->setEditable(false); myAddressMaps->setEditable(false);
// Music counters // Music counters
xpos = 10; ypos += myLineHeight*6 + 4; xpos = 10; ypos += myLineHeight*6 + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Music Counters", TextAlign::Left); myFontHeight, "Music Counters", TextAlign::Left);
xpos += lwidth; xpos += lwidth;
@ -136,7 +175,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myMusicCounters->setEditable(false); myMusicCounters->setEditable(false);
// Music frequencies // Music frequencies
xpos = 10; ypos += myLineHeight + 4; xpos = 10; ypos += myLineHeight + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Music Frequencies", TextAlign::Left); myFontHeight, "Music Frequencies", TextAlign::Left);
xpos += lwidth; xpos += lwidth;
@ -146,7 +185,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myMusicFrequencies->setEditable(false); myMusicFrequencies->setEditable(false);
// Music waveforms // Music waveforms
xpos = 10; ypos += myLineHeight + 4; xpos = 10; ypos += myLineHeight + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Music Waveforms", TextAlign::Left); myFontHeight, "Music Waveforms", TextAlign::Left);
xpos += lwidth; xpos += lwidth;
@ -155,17 +194,20 @@ CartridgeBUSWidget::CartridgeBUSWidget(
myMusicWaveforms->setTarget(this); myMusicWaveforms->setTarget(this);
myMusicWaveforms->setEditable(false); myMusicWaveforms->setEditable(false);
const int xpossp = xpos + myMusicWaveforms->getWidth() + 20; const int xpossp = xpos + myMusicWaveforms->getWidth() + INDENT;
const int lwidth2 = _font.getStringWidth("Sample Pointer "); if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
new StaticTextWidget(boss, _font, xpossp, ypos, lwidth2, {
myFontHeight, "Sample Pointer ", TextAlign::Left); const int lwidth2 = _font.getStringWidth("Sample Pointer ");
new StaticTextWidget(boss, _font, xpossp, ypos, lwidth2,
myFontHeight, "Sample Pointer ", TextAlign::Left);
mySamplePointer = new DataGridWidget(boss, _nfont, xpossp + lwidth2, ypos-2, 1, 1, 8, 32, Common::Base::Fmt::_16_8); mySamplePointer = new DataGridWidget(boss, _nfont, xpossp + lwidth2, ypos-2, 1, 1, 8, 32, Common::Base::Fmt::_16_8);
mySamplePointer->setTarget(this); mySamplePointer->setTarget(this);
mySamplePointer->setEditable(false); mySamplePointer->setEditable(false);
}
// Music waveform sizes // Music waveform sizes
xpos = 10; ypos += myLineHeight + 4; xpos = 10; ypos += myLineHeight + VGAP;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth, new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
myFontHeight, "Music Waveform Sizes", TextAlign::Left); myFontHeight, "Music Waveform Sizes", TextAlign::Left);
xpos += lwidth; xpos += lwidth;
@ -176,16 +218,18 @@ CartridgeBUSWidget::CartridgeBUSWidget(
// BUS stuff and Digital Audio flags // BUS stuff and Digital Audio flags
xpos = 10; ypos += myLineHeight + 4; xpos = 10; ypos += myLineHeight + VGAP;
myBusOverdrive = new CheckboxWidget(boss, _font, xpos, ypos, "BUS Overdrive enabled"); myBusOverdrive = new CheckboxWidget(boss, _font, xpos, ypos, "BUS Overdrive enabled");
myBusOverdrive->setTarget(this); myBusOverdrive->setTarget(this);
myBusOverdrive->setEditable(false); myBusOverdrive->setEditable(false);
myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode"); if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
myDigitalSample->setTarget(this); {
myDigitalSample->setEditable(false); myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode");
myDigitalSample->setTarget(this);
xpos = 10; ypos += myLineHeight + 4 * 2; myDigitalSample->setEditable(false);
}
xpos = 10; ypos += myLineHeight + VGAP * 2;
addCycleWidgets(xpos, ypos); addCycleWidgets(xpos, ypos);
} }
@ -204,7 +248,7 @@ void CartridgeBUSWidget::saveOldState()
myOldState.internalram.clear(); myOldState.internalram.clear();
myOldState.samplepointer.clear(); myOldState.samplepointer.clear();
for(uInt32 i = 0; i < 18; ++i) for(int i = 0; i < myDatastreamCount; ++i)
{ {
// Pointers are stored as: // Pointers are stored as:
// PPPFF--- // PPPFF---
@ -250,6 +294,9 @@ void CartridgeBUSWidget::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeBUSWidget::loadConfig() void CartridgeBUSWidget::loadConfig()
{ {
// if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0)
// return;
myBank->setSelectedIndex(myCart.getBank()); myBank->setSelectedIndex(myCart.getBank());
// Get registers, using change tracking // Get registers, using change tracking
@ -277,7 +324,7 @@ void CartridgeBUSWidget::loadConfig()
myDatastreamPointers->setList(alist, vlist, changed); myDatastreamPointers->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear(); alist.clear(); vlist.clear(); changed.clear();
for(int i = 16; i < 18; ++i) for(int i = 16; i < myDatastreamCount; ++i)
{ {
const Int32 pointervalue = myCart.getDatastreamPointer(i) >> 12; const Int32 pointervalue = myCart.getDatastreamPointer(i) >> 12;
alist.push_back(0); vlist.push_back(pointervalue); alist.push_back(0); vlist.push_back(pointervalue);
@ -295,7 +342,7 @@ void CartridgeBUSWidget::loadConfig()
myDatastreamIncrements->setList(alist, vlist, changed); myDatastreamIncrements->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear(); alist.clear(); vlist.clear(); changed.clear();
for(int i = 16; i < 18; ++i) for(int i = 16; i < myDatastreamCount; ++i)
{ {
constexpr Int32 incrementvalue = 0x100; constexpr Int32 incrementvalue = 0x100;
alist.push_back(0); vlist.push_back(incrementvalue); alist.push_back(0); vlist.push_back(incrementvalue);
@ -350,25 +397,32 @@ void CartridgeBUSWidget::loadConfig()
} }
myMusicWaveformSizes->setList(alist, vlist, changed); myMusicWaveformSizes->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear();
alist.push_back(0); vlist.push_back(myCart.getSample()); if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
changed.push_back((myCart.getSample()) != uInt32(myOldState.samplepointer[0])); {
mySamplePointer->setList(alist, vlist, changed); alist.clear(); vlist.clear(); changed.clear();
alist.push_back(0); vlist.push_back(myCart.getSample());
changed.push_back((myCart.getSample()) != uInt32(myOldState.samplepointer[0]));
mySamplePointer->setList(alist, vlist, changed);
}
myBusOverdrive->setState((myCart.myMode & 0x0f) == 0); myBusOverdrive->setState((myCart.myMode & 0x0f) == 0);
myDigitalSample->setState((myCart.myMode & 0xf0) == 0); if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
myDigitalSample->setState((myCart.myMode & 0xf0) == 0);
if ((myCart.myMode & 0xf0) == 0) if ((myCart.myMode & 0xf0) == 0)
{ {
myMusicWaveforms->setCrossed(true); myMusicWaveforms->setCrossed(true);
myMusicWaveformSizes->setCrossed(true); myMusicWaveformSizes->setCrossed(true);
mySamplePointer->setCrossed(false); if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
mySamplePointer->setCrossed(false);
} }
else else
{ {
myMusicWaveforms->setCrossed(false); myMusicWaveforms->setCrossed(false);
myMusicWaveformSizes->setCrossed(false); myMusicWaveformSizes->setCrossed(false);
mySamplePointer->setCrossed(true); if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3)
mySamplePointer->setCrossed(true);
} }
CartridgeARMWidget::loadConfig(); CartridgeARMWidget::loadConfig();
@ -394,11 +448,22 @@ string CartridgeBUSWidget::bankState()
{ {
ostringstream& buf = buffer(); ostringstream& buf = buffer();
static constexpr std::array<const char*, 7> spot = { if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0)
"$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB" {
}; static constexpr std::array<const char*, 6> spot = {
buf << "Bank = " << std::dec << myCart.getBank() "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
<< ", hotspot = " << spot[myCart.getBank()]; };
buf << "Bank = " << std::dec << myCart.getBank()
<< ", hotspot = " << spot[myCart.getBank()];
}
else
{
static constexpr std::array<const char*, 7> spot = {
"$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
};
buf << "Bank = " << std::dec << myCart.getBank()
<< ", hotspot = " << spot[myCart.getBank()];
}
return buf.str(); return buf.str();
} }

View File

@ -53,6 +53,7 @@ class CartridgeBUSWidget : public CartridgeARMWidget
CartridgeBUS& myCart; CartridgeBUS& myCart;
PopUpWidget* myBank{nullptr}; PopUpWidget* myBank{nullptr};
int myDatastreamCount;
DataGridWidget* myDatastreamPointers{nullptr}; DataGridWidget* myDatastreamPointers{nullptr};
DataGridWidget* myDatastreamIncrements{nullptr}; DataGridWidget* myDatastreamIncrements{nullptr};
@ -66,7 +67,7 @@ class CartridgeBUSWidget : public CartridgeARMWidget
DataGridWidget* mySamplePointer{nullptr}; DataGridWidget* mySamplePointer{nullptr};
CheckboxWidget* myBusOverdrive{nullptr}; CheckboxWidget* myBusOverdrive{nullptr};
CheckboxWidget* myDigitalSample{nullptr}; CheckboxWidget* myDigitalSample{nullptr};
std::array<StaticTextWidget*, 6> myDatastreamLabels{nullptr}; std::array<StaticTextWidget*, 8> myDatastreamLabels{nullptr};
CartState myOldState; CartState myOldState;
enum { kBankChanged = 'bkCH' }; enum { kBankChanged = 'bkCH' };

File diff suppressed because it is too large Load Diff

View File

@ -20,10 +20,6 @@
class System; class System;
#ifdef DEBUGGER_SUPPORT
#include "CartBUSWidget.hxx"
#endif
#include "bspf.hxx" #include "bspf.hxx"
#include "CartARM.hxx" #include "CartARM.hxx"
@ -43,7 +39,16 @@ class System;
class CartridgeBUS : public CartridgeARM class CartridgeBUS : public CartridgeARM
{ {
friend class CartridgeBUSWidget; friend class CartridgeBUSWidget;
friend class CartridgeBUSInfoWidget;
friend class CartridgeRamBUSWidget; friend class CartridgeRamBUSWidget;
enum class BUSSubtype {
BUS0, // very old demos when BUS was in flux, not supported in Stella
BUS1, // draconian_20161102.bin
BUS2, // 128bus_20170120.bin, 128chronocolour_20170101.bin, parrot_20161231_NTSC.bin
BUS3 // rpg_20170616_NTSC.bin
};
public: public:
/** /**
@ -132,7 +137,7 @@ class CartridgeBUS : public CartridgeARM
@return The name of the object @return The name of the object
*/ */
string name() const override { return "CartridgeBUS"; } string name() const override;
uInt8 busOverdrive(uInt16 address); uInt8 busOverdrive(uInt16 address);
@ -162,12 +167,13 @@ class CartridgeBUS : public CartridgeARM
of the cart. of the cart.
*/ */
CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont, CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w, int h) override const GUI::Font& nfont, int x, int y, int w, int h) override;
{
return new CartridgeBUSWidget(boss, lfont, nfont, x, y, w, h, *this); CartDebugWidget* infoWidget(GuiObject* boss, const GUI::Font& lfont,
} const GUI::Font& nfont, int x, int y, int w, int h) override;
#endif
#endif
public: public:
/** /**
Get the byte at the specified address. Get the byte at the specified address.
@ -213,7 +219,8 @@ class CartridgeBUS : public CartridgeARM
void setDatastreamPointer(uInt8 index, uInt32 value); void setDatastreamPointer(uInt8 index, uInt32 value);
uInt32 getDatastreamIncrement(uInt8 index) const; uInt32 getDatastreamIncrement(uInt8 index) const;
void setDatastreamIncrement(uInt8 index, uInt32 value);
uInt32 getAddressMap(uInt8 index) const; uInt32 getAddressMap(uInt8 index) const;
void setAddressMap(uInt8 index, uInt32 value); void setAddressMap(uInt8 index, uInt32 value);
@ -222,6 +229,8 @@ class CartridgeBUS : public CartridgeARM
uInt32 getWaveform(uInt8 index) const; uInt32 getWaveform(uInt8 index) const;
uInt32 getWaveformSize(uInt8 index) const; uInt32 getWaveformSize(uInt8 index) const;
uInt32 getSample(); uInt32 getSample();
void setupVersion();
uInt32 scanBUSDriver(uInt32 value);
private: private:
// The 32K ROM image of the cartridge // The 32K ROM image of the cartridge
@ -260,6 +269,18 @@ class CartridgeBUS : public CartridgeARM
// ARM cycle count from when the last callFunction() occurred // ARM cycle count from when the last callFunction() occurred
uInt64 myARMCycles{0}; uInt64 myARMCycles{0};
// Pointer to the array of datastream pointers
uInt16 myDatastreamBase{0}; // was DSxPTR
// Pointer to the array of datastream increments
uInt16 myDatastreamIncrementBase{0}; // was DSxINC
// Pointer to the array of datastream maps
uInt16 myDatastreamMapBase{0}; // was DSMAPS
// Pointer to the beginning of the waveform data block
uInt16 myWaveformBase{0}; // was WAVEFORM
// The music mode counters // The music mode counters
std::array<uInt32, 3> myMusicCounters{0}; std::array<uInt32, 3> myMusicCounters{0};
@ -281,6 +302,9 @@ class CartridgeBUS : public CartridgeARM
uInt8 myMode{0}; uInt8 myMode{0};
uInt8 myFastJumpActive{false}; uInt8 myFastJumpActive{false};
// BUS subtype
BUSSubtype myBUSSubtype{BUSSubtype::BUS1};
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -195,6 +195,8 @@
2DEFB40C09C3386F00754289 /* Cart.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2DEFB40B09C3386F00754289 /* Cart.icns */; }; 2DEFB40C09C3386F00754289 /* Cart.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2DEFB40B09C3386F00754289 /* Cart.icns */; };
55FE2A321EE4856B00078ADE /* SDL2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCDAF4D818CA9AAB00D3865D /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 55FE2A321EE4856B00078ADE /* SDL2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCDAF4D818CA9AAB00D3865D /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
55FE2A501EE4880500078ADE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 55FE2A3C1EE487CA00078ADE /* InfoPlist.strings */; }; 55FE2A501EE4880500078ADE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 55FE2A3C1EE487CA00078ADE /* InfoPlist.strings */; };
CFB521D72853A2590083B9CE /* CartBUSInfoWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CFB521D52853A2590083B9CE /* CartBUSInfoWidget.cxx */; };
CFB521D82853A2590083B9CE /* CartBUSInfoWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = CFB521D62853A2590083B9CE /* CartBUSInfoWidget.hxx */; };
CFE3F60B1E84A9A200A8204E /* CartBUSWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */; }; CFE3F60B1E84A9A200A8204E /* CartBUSWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */; };
CFE3F60C1E84A9A200A8204E /* CartBUSWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */; }; CFE3F60C1E84A9A200A8204E /* CartBUSWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */; };
CFE3F60D1E84A9A200A8204E /* CartCDFWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CFE3F6091E84A9A200A8204E /* CartCDFWidget.cxx */; }; CFE3F60D1E84A9A200A8204E /* CartCDFWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CFE3F6091E84A9A200A8204E /* CartCDFWidget.cxx */; };
@ -1021,6 +1023,8 @@
2DF971D70892CEA400F64D23 /* DebuggerSystem.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = DebuggerSystem.hxx; sourceTree = "<group>"; }; 2DF971D70892CEA400F64D23 /* DebuggerSystem.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = DebuggerSystem.hxx; sourceTree = "<group>"; };
2DF971DF0892CEA400F64D23 /* Expression.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = Expression.hxx; sourceTree = "<group>"; }; 2DF971DF0892CEA400F64D23 /* Expression.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = Expression.hxx; sourceTree = "<group>"; };
B2F367C504C7ADC700A80002 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SDLMain.nib; sourceTree = "<group>"; }; B2F367C504C7ADC700A80002 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SDLMain.nib; sourceTree = "<group>"; };
CFB521D52853A2590083B9CE /* CartBUSInfoWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartBUSInfoWidget.cxx; sourceTree = "<group>"; };
CFB521D62853A2590083B9CE /* CartBUSInfoWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CartBUSInfoWidget.hxx; sourceTree = "<group>"; };
CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartBUSWidget.cxx; sourceTree = "<group>"; }; CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartBUSWidget.cxx; sourceTree = "<group>"; };
CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CartBUSWidget.hxx; sourceTree = "<group>"; }; CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CartBUSWidget.hxx; sourceTree = "<group>"; };
CFE3F6091E84A9A200A8204E /* CartCDFWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartCDFWidget.cxx; sourceTree = "<group>"; }; CFE3F6091E84A9A200A8204E /* CartCDFWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartCDFWidget.cxx; sourceTree = "<group>"; };
@ -1751,6 +1755,8 @@
DCAACB07188D636F00A4D282 /* CartBFSCWidget.hxx */, DCAACB07188D636F00A4D282 /* CartBFSCWidget.hxx */,
DCAACB08188D636F00A4D282 /* CartBFWidget.cxx */, DCAACB08188D636F00A4D282 /* CartBFWidget.cxx */,
DCAACB09188D636F00A4D282 /* CartBFWidget.hxx */, DCAACB09188D636F00A4D282 /* CartBFWidget.hxx */,
CFB521D52853A2590083B9CE /* CartBUSInfoWidget.cxx */,
CFB521D62853A2590083B9CE /* CartBUSInfoWidget.hxx */,
CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */, CFE3F6071E84A9A200A8204E /* CartBUSWidget.cxx */,
CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */, CFE3F6081E84A9A200A8204E /* CartBUSWidget.hxx */,
E0A755772244294600101889 /* CartCDFInfoWidget.cxx */, E0A755772244294600101889 /* CartCDFInfoWidget.cxx */,
@ -2734,6 +2740,7 @@
DC816CF72572F92A00FBCCDA /* json_lib.hxx in Headers */, DC816CF72572F92A00FBCCDA /* json_lib.hxx in Headers */,
2D91741B09BA90380026E9FF /* OSystem.hxx in Headers */, 2D91741B09BA90380026E9FF /* OSystem.hxx in Headers */,
DC6A18F919B3E65500DEB242 /* CartMDMWidget.hxx in Headers */, DC6A18F919B3E65500DEB242 /* CartMDMWidget.hxx in Headers */,
CFB521D82853A2590083B9CE /* CartBUSInfoWidget.hxx in Headers */,
2D91741F09BA90380026E9FF /* AboutBox.h in Headers */, 2D91741F09BA90380026E9FF /* AboutBox.h in Headers */,
DC84FC572677C64200E60ADE /* CartARMWidget.hxx in Headers */, DC84FC572677C64200E60ADE /* CartARMWidget.hxx in Headers */,
2D91742009BA90380026E9FF /* ConsoleFont.hxx in Headers */, 2D91742009BA90380026E9FF /* ConsoleFont.hxx in Headers */,
@ -3420,6 +3427,7 @@
DCA233B423BAB1300032ABF3 /* Lightgun.cxx in Sources */, DCA233B423BAB1300032ABF3 /* Lightgun.cxx in Sources */,
DCAAE5DE1715887B0080BB82 /* CartEFSCWidget.cxx in Sources */, DCAAE5DE1715887B0080BB82 /* CartEFSCWidget.cxx in Sources */,
DCAAE5E01715887B0080BB82 /* CartEFWidget.cxx in Sources */, DCAAE5E01715887B0080BB82 /* CartEFWidget.cxx in Sources */,
CFB521D72853A2590083B9CE /* CartBUSInfoWidget.cxx in Sources */,
DCAAE5E21715887B0080BB82 /* CartF0Widget.cxx in Sources */, DCAAE5E21715887B0080BB82 /* CartF0Widget.cxx in Sources */,
DCB2ECAF1F0AECA3009738A6 /* CartDetector.cxx in Sources */, DCB2ECAF1F0AECA3009738A6 /* CartDetector.cxx in Sources */,
DCAAE5E41715887B0080BB82 /* CartF4SCWidget.cxx in Sources */, DCAAE5E41715887B0080BB82 /* CartF4SCWidget.cxx in Sources */,