mirror of https://github.com/stella-emu/stella.git
CDF updates
* Implemented load/save state. * Updated the debugger tab, which required the following: - removal of : from RAM labels (part of the debugger overhaul) - setCrossed() functionality in the DataGrid
This commit is contained in:
parent
47a2f66e11
commit
42c762ae92
|
@ -30,11 +30,11 @@ CartridgeCDFWidget::CartridgeCDFWidget(
|
||||||
uInt16 size = 8 * 4096;
|
uInt16 size = 8 * 4096;
|
||||||
|
|
||||||
ostringstream info;
|
ostringstream info;
|
||||||
info << "CDF Stuffing cartridge\n"
|
info << "CDF cartridge\n"
|
||||||
<< "32K ROM, seven 4K banks are accessible to 2600\n"
|
<< "32K ROM, seven 4K banks are accessible to 2600\n"
|
||||||
<< "8K CDF RAM\n"
|
<< "8K CDF RAM\n"
|
||||||
<< "CDF registers accessible @ $F000 - $F03F\n"
|
<< "CDF registers accessible @ $FFF0 - $FFF3\n"
|
||||||
<< "Banks accessible at hotspots $FF5 to $FFB\n"
|
<< "Banks accessible at hotspots $FFF5 to $FFFB\n"
|
||||||
<< "Startup bank = " << cart.myStartBank << "\n";
|
<< "Startup bank = " << cart.myStartBank << "\n";
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -53,45 +53,77 @@ CartridgeCDFWidget::CartridgeCDFWidget(
|
||||||
myLineHeight;
|
myLineHeight;
|
||||||
|
|
||||||
VariantList items;
|
VariantList items;
|
||||||
VarList::push_back(items, "0 ($FF5)");
|
VarList::push_back(items, "0 ($FFF5)");
|
||||||
VarList::push_back(items, "1 ($FF6)");
|
VarList::push_back(items, "1 ($FFF6)");
|
||||||
VarList::push_back(items, "2 ($FF7)");
|
VarList::push_back(items, "2 ($FFF7)");
|
||||||
VarList::push_back(items, "3 ($FF8)");
|
VarList::push_back(items, "3 ($FFF8)");
|
||||||
VarList::push_back(items, "4 ($FF9)");
|
VarList::push_back(items, "4 ($FFF9)");
|
||||||
VarList::push_back(items, "5 ($FFA)");
|
VarList::push_back(items, "5 ($FFFA)");
|
||||||
VarList::push_back(items, "6 ($FFB)");
|
VarList::push_back(items, "6 ($FFFB)");
|
||||||
myBank =
|
myBank =
|
||||||
new PopUpWidget(boss, _font, xpos, ypos-2, _font.getStringWidth("0 ($FFx) "),
|
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);
|
||||||
addFocusWidget(myBank);
|
addFocusWidget(myBank);
|
||||||
|
|
||||||
int lwidth = _font.getStringWidth("Datastream Increments: "); // get width of the widest label
|
int lwidth = _font.getStringWidth("Datastream Increments"); // get width of the widest label
|
||||||
|
|
||||||
// Datastream Pointers
|
// Datastream Pointers
|
||||||
xpos = 0; ypos += myLineHeight + 4;
|
#define DS_X 30
|
||||||
|
xpos = DS_X;
|
||||||
|
ypos += myLineHeight + 4;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Datastream Pointers: ", kTextAlignLeft);
|
myFontHeight, "Datastream Pointers", kTextAlignLeft);
|
||||||
xpos += lwidth;
|
xpos += lwidth;
|
||||||
|
|
||||||
myDatastreamPointers = new DataGridWidget(boss, _nfont, 0, ypos+myLineHeight-2, 4, 8, 6, 32, Common::Base::F_16_3_2);
|
myDatastreamPointers = new DataGridWidget(boss, _nfont, DS_X, ypos+myLineHeight-2, 4, 8, 6, 32, Common::Base::F_16_3_2);
|
||||||
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 + 8*myLineHeight, 1, 2, 6, 32, Common::Base::F_16_3_2);
|
||||||
|
myDatastreamPointers2->setTarget(this);
|
||||||
|
myDatastreamPointers2->setEditable(false);
|
||||||
|
|
||||||
|
|
||||||
|
uInt32 row;
|
||||||
|
for(row = 0; row < 8; ++row)
|
||||||
|
{
|
||||||
|
myDatastreamLabels[row] =
|
||||||
|
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
|
||||||
|
ypos+myLineHeight-2 + row*myLineHeight + 2,
|
||||||
|
myFontWidth*2, myFontHeight, "", kTextAlignLeft);
|
||||||
|
myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::F_16_2));
|
||||||
|
}
|
||||||
|
lwidth = _font.getStringWidth("Write Data (stream 20)");
|
||||||
|
myDatastreamLabels[row] =
|
||||||
|
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
|
||||||
|
ypos+myLineHeight-2 + 8*myLineHeight + 2,
|
||||||
|
lwidth, myFontHeight, "Write Data (stream 20)", kTextAlignLeft);
|
||||||
|
// myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::F_16_2));
|
||||||
|
myDatastreamLabels[row] =
|
||||||
|
new StaticTextWidget(_boss, _font, DS_X - _font.getStringWidth("xx "),
|
||||||
|
ypos+myLineHeight-2 + 9*myLineHeight + 2,
|
||||||
|
lwidth, myFontHeight, "Jump Data (stream 21)", kTextAlignLeft);
|
||||||
|
// myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::F_16_2));
|
||||||
|
|
||||||
// Datastream Increments
|
// Datastream Increments
|
||||||
xpos = 0 + myDatastreamPointers->getWidth();
|
xpos = DS_X + myDatastreamPointers->getWidth() + 20;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Datastream Increments: ", kTextAlignLeft);
|
myFontHeight, "Datastream Increments", kTextAlignLeft);
|
||||||
|
|
||||||
myDatastreamIncrements = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2, 4, 8, 5, 32, Common::Base::F_16_2_2);
|
myDatastreamIncrements = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2, 4, 8, 5, 32, Common::Base::F_16_2_2);
|
||||||
myDatastreamIncrements->setTarget(this);
|
myDatastreamIncrements->setTarget(this);
|
||||||
myDatastreamIncrements->setEditable(false);
|
myDatastreamIncrements->setEditable(false);
|
||||||
|
|
||||||
|
myDatastreamIncrements2 = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2 + 8*myLineHeight, 1, 2, 5, 32, Common::Base::F_16_2_2);
|
||||||
|
myDatastreamIncrements2->setTarget(this);
|
||||||
|
myDatastreamIncrements2->setEditable(false);
|
||||||
|
|
||||||
// Music counters
|
// Music counters
|
||||||
xpos = 10; ypos += myLineHeight*10 + 4;
|
xpos = 10; ypos += myLineHeight*12 + 4;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Music Counters: ", kTextAlignLeft);
|
myFontHeight, "Music Counters", kTextAlignLeft);
|
||||||
xpos += lwidth;
|
xpos += lwidth;
|
||||||
|
|
||||||
myMusicCounters = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 8, 32, Common::Base::F_16_8);
|
myMusicCounters = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 8, 32, Common::Base::F_16_8);
|
||||||
|
@ -101,7 +133,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
|
||||||
// Music frequencies
|
// Music frequencies
|
||||||
xpos = 10; ypos += myLineHeight + 4;
|
xpos = 10; ypos += myLineHeight + 4;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Music Frequencies: ", kTextAlignLeft);
|
myFontHeight, "Music Frequencies", kTextAlignLeft);
|
||||||
xpos += lwidth;
|
xpos += lwidth;
|
||||||
|
|
||||||
myMusicFrequencies = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 8, 32, Common::Base::F_16_8);
|
myMusicFrequencies = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 8, 32, Common::Base::F_16_8);
|
||||||
|
@ -111,33 +143,41 @@ CartridgeCDFWidget::CartridgeCDFWidget(
|
||||||
// Music waveforms
|
// Music waveforms
|
||||||
xpos = 10; ypos += myLineHeight + 4;
|
xpos = 10; ypos += myLineHeight + 4;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Music Waveforms: ", kTextAlignLeft);
|
myFontHeight, "Music Waveforms", kTextAlignLeft);
|
||||||
xpos += lwidth;
|
xpos += lwidth;
|
||||||
|
|
||||||
myMusicWaveforms = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 4, 16, Common::Base::F_16_2);
|
myMusicWaveforms = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 4, 16, Common::Base::F_16_2);
|
||||||
myMusicWaveforms->setTarget(this);
|
myMusicWaveforms->setTarget(this);
|
||||||
myMusicWaveforms->setEditable(false);
|
myMusicWaveforms->setEditable(false);
|
||||||
|
|
||||||
|
int xpossp = xpos + myMusicWaveforms->getWidth() + 20;
|
||||||
|
int lwidth2 = _font.getStringWidth("Sample Pointer ");
|
||||||
|
new StaticTextWidget(boss, _font, xpossp, ypos, lwidth2,
|
||||||
|
myFontHeight, "Sample Pointer ", kTextAlignLeft);
|
||||||
|
|
||||||
|
mySamplePointer = new DataGridWidget(boss, _nfont, xpossp + lwidth2, ypos-2, 1, 1, 8, 32, Common::Base::F_16_8);
|
||||||
|
mySamplePointer->setTarget(this);
|
||||||
|
mySamplePointer->setEditable(false);
|
||||||
|
|
||||||
// Music waveform sizes
|
// Music waveform sizes
|
||||||
xpos = 10; ypos += myLineHeight + 4;
|
xpos = 10; ypos += myLineHeight + 4;
|
||||||
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Music Waveform Sizes: ", kTextAlignLeft);
|
myFontHeight, "Music Waveform Sizes", kTextAlignLeft);
|
||||||
xpos += lwidth;
|
xpos += lwidth;
|
||||||
|
|
||||||
myMusicWaveformSizes = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 4, 16, Common::Base::F_16_2);
|
myMusicWaveformSizes = new DataGridWidget(boss, _nfont, xpos, ypos-2, 3, 1, 4, 16, Common::Base::F_16_2);
|
||||||
myMusicWaveformSizes->setTarget(this);
|
myMusicWaveformSizes->setTarget(this);
|
||||||
myMusicWaveformSizes->setEditable(false);
|
myMusicWaveformSizes->setEditable(false);
|
||||||
|
|
||||||
// done differently than in DPC+, need to rethink debugger support
|
// Fast Fetch and Digital Audio flags
|
||||||
// // Fast fetch and immediate mode LDA flags
|
xpos = 10; ypos += myLineHeight + 4;
|
||||||
// xpos = 10; ypos += myLineHeight + 4;
|
myFastFetch = new CheckboxWidget(boss, _font, xpos, ypos, "Fast Fetcher enabled");
|
||||||
// myFastFetch = new CheckboxWidget(boss, _font, xpos, ypos, "Fast Fetcher enabled");
|
myFastFetch->setTarget(this);
|
||||||
// myFastFetch->setTarget(this);
|
myFastFetch->setEditable(false);
|
||||||
// myFastFetch->setEditable(false);
|
|
||||||
// ypos += myLineHeight + 4;
|
myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode");
|
||||||
// myIMLDA = new CheckboxWidget(boss, _font, xpos, ypos, "Immediate mode LDA");
|
myDigitalSample->setTarget(this);
|
||||||
// myIMLDA->setTarget(this);
|
myDigitalSample->setEditable(false);
|
||||||
// myIMLDA->setEditable(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -153,8 +193,9 @@ void CartridgeCDFWidget::saveOldState()
|
||||||
myOldState.mwaves.clear();
|
myOldState.mwaves.clear();
|
||||||
myOldState.mwavesizes.clear();
|
myOldState.mwavesizes.clear();
|
||||||
myOldState.internalram.clear();
|
myOldState.internalram.clear();
|
||||||
|
myOldState.samplepointer.clear();
|
||||||
|
|
||||||
for(uInt32 i = 0; i < 32; i++)
|
for(uInt32 i = 0; i < 34; i++)
|
||||||
{
|
{
|
||||||
// Pointers are stored as:
|
// Pointers are stored as:
|
||||||
// PPPFF---
|
// PPPFF---
|
||||||
|
@ -184,6 +225,8 @@ void CartridgeCDFWidget::saveOldState()
|
||||||
|
|
||||||
for(uInt32 i = 0; i < internalRamSize(); ++i)
|
for(uInt32 i = 0; i < internalRamSize(); ++i)
|
||||||
myOldState.internalram.push_back(myCart.myCDFRAM[i]);
|
myOldState.internalram.push_back(myCart.myCDFRAM[i]);
|
||||||
|
|
||||||
|
myOldState.samplepointer.push_back(myCart.getSample());
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -215,6 +258,15 @@ void CartridgeCDFWidget::loadConfig()
|
||||||
}
|
}
|
||||||
myDatastreamPointers->setList(alist, vlist, changed);
|
myDatastreamPointers->setList(alist, vlist, changed);
|
||||||
|
|
||||||
|
alist.clear(); vlist.clear(); changed.clear();
|
||||||
|
for(int i = 32; i < 34; ++i)
|
||||||
|
{
|
||||||
|
Int32 pointervalue = myCart.getDatastreamPointer(i) >> 12;
|
||||||
|
alist.push_back(0); vlist.push_back(pointervalue);
|
||||||
|
changed.push_back(pointervalue != myOldState.datastreampointers[i]);
|
||||||
|
}
|
||||||
|
myDatastreamPointers2->setList(alist, vlist, changed);
|
||||||
|
|
||||||
alist.clear(); vlist.clear(); changed.clear();
|
alist.clear(); vlist.clear(); changed.clear();
|
||||||
for(int i = 0; i < 32; ++i)
|
for(int i = 0; i < 32; ++i)
|
||||||
{
|
{
|
||||||
|
@ -224,6 +276,15 @@ void CartridgeCDFWidget::loadConfig()
|
||||||
}
|
}
|
||||||
myDatastreamIncrements->setList(alist, vlist, changed);
|
myDatastreamIncrements->setList(alist, vlist, changed);
|
||||||
|
|
||||||
|
alist.clear(); vlist.clear(); changed.clear();
|
||||||
|
for(int i = 32; i < 34; ++i)
|
||||||
|
{
|
||||||
|
Int32 incrementvalue = myCart.getDatastreamIncrement(i);
|
||||||
|
alist.push_back(0); vlist.push_back(incrementvalue);
|
||||||
|
changed.push_back(incrementvalue != myOldState.datastreamincrements[i]);
|
||||||
|
}
|
||||||
|
myDatastreamIncrements2->setList(alist, vlist, changed);
|
||||||
|
|
||||||
alist.clear(); vlist.clear(); changed.clear();
|
alist.clear(); vlist.clear(); changed.clear();
|
||||||
for(int i = 0; i < 3; ++i)
|
for(int i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
|
@ -256,9 +317,26 @@ void CartridgeCDFWidget::loadConfig()
|
||||||
}
|
}
|
||||||
myMusicWaveformSizes->setList(alist, vlist, changed);
|
myMusicWaveformSizes->setList(alist, vlist, changed);
|
||||||
|
|
||||||
// done differently than in DPC+, need to rethink debugger support
|
alist.clear(); vlist.clear(); changed.clear();
|
||||||
// myFastFetch->setState(myCart.myFastFetch);
|
alist.push_back(0); vlist.push_back(myCart.getSample());
|
||||||
// myIMLDA->setState(myCart.myLDAimmediate);
|
changed.push_back((myCart.getSample()) != uInt32(myOldState.samplepointer[0]));
|
||||||
|
mySamplePointer->setList(alist, vlist, changed);
|
||||||
|
|
||||||
|
myFastFetch->setState((myCart.myMode & 0x0f) == 0);
|
||||||
|
myDigitalSample->setState((myCart.myMode & 0xf0) == 0);
|
||||||
|
|
||||||
|
if ((myCart.myMode & 0xf0) == 0)
|
||||||
|
{
|
||||||
|
myMusicWaveforms->setCrossed(true);
|
||||||
|
myMusicWaveformSizes->setCrossed(true);
|
||||||
|
mySamplePointer->setCrossed(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myMusicWaveforms->setCrossed(false);
|
||||||
|
myMusicWaveformSizes->setCrossed(false);
|
||||||
|
mySamplePointer->setCrossed(true);
|
||||||
|
}
|
||||||
|
|
||||||
CartDebugWidget::loadConfig();
|
CartDebugWidget::loadConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ class CartridgeCDF;
|
||||||
class PopUpWidget;
|
class PopUpWidget;
|
||||||
class CheckboxWidget;
|
class CheckboxWidget;
|
||||||
class DataGridWidget;
|
class DataGridWidget;
|
||||||
|
class StaticTextWidget;
|
||||||
|
|
||||||
#include "CartDebugWidget.hxx"
|
#include "CartDebugWidget.hxx"
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ class CartridgeCDFWidget : public CartDebugWidget
|
||||||
IntArray mfreqs;
|
IntArray mfreqs;
|
||||||
IntArray mwaves;
|
IntArray mwaves;
|
||||||
IntArray mwavesizes;
|
IntArray mwavesizes;
|
||||||
|
IntArray samplepointer;
|
||||||
uInt32 random;
|
uInt32 random;
|
||||||
ByteArray internalram;
|
ByteArray internalram;
|
||||||
};
|
};
|
||||||
|
@ -54,13 +56,18 @@ class CartridgeCDFWidget : public CartDebugWidget
|
||||||
|
|
||||||
DataGridWidget* myDatastreamPointers;
|
DataGridWidget* myDatastreamPointers;
|
||||||
DataGridWidget* myDatastreamIncrements;
|
DataGridWidget* myDatastreamIncrements;
|
||||||
|
DataGridWidget* myDatastreamPointers2;
|
||||||
|
DataGridWidget* myDatastreamIncrements2;
|
||||||
DataGridWidget* myMusicCounters;
|
DataGridWidget* myMusicCounters;
|
||||||
DataGridWidget* myMusicFrequencies;
|
DataGridWidget* myMusicFrequencies;
|
||||||
DataGridWidget* myMusicWaveforms;
|
DataGridWidget* myMusicWaveforms;
|
||||||
DataGridWidget* myMusicWaveformSizes;
|
DataGridWidget* myMusicWaveformSizes;
|
||||||
|
DataGridWidget* mySamplePointer;
|
||||||
|
StaticTextWidget* myDatastreamLabels[10];
|
||||||
|
|
||||||
// done differently than in DPC+, need to rethink debugger support
|
// done differently than in DPC+, need to rethink debugger support
|
||||||
// CheckboxWidget* myFastFetch;
|
CheckboxWidget* myFastFetch;
|
||||||
// CheckboxWidget* myIMLDA;
|
CheckboxWidget* myDigitalSample;
|
||||||
CartState myOldState;
|
CartState myOldState;
|
||||||
|
|
||||||
enum { kBankChanged = 'bkCH' };
|
enum { kBankChanged = 'bkCH' };
|
||||||
|
|
|
@ -52,7 +52,7 @@ class CartDebugWidget : public Widget, public CommandSender
|
||||||
int addBaseInformation(int bytes, const string& manufacturer,
|
int addBaseInformation(int bytes, const string& manufacturer,
|
||||||
const string& desc, const uInt16 maxlines = 10)
|
const string& desc, const uInt16 maxlines = 10)
|
||||||
{
|
{
|
||||||
const int lwidth = _font.getStringWidth("Manufacturer: "),
|
const int lwidth = _font.getStringWidth("Manufacturer "),
|
||||||
fwidth = _w - lwidth - 20;
|
fwidth = _w - lwidth - 20;
|
||||||
EditTextWidget* w = nullptr;
|
EditTextWidget* w = nullptr;
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
@ -61,7 +61,7 @@ class CartDebugWidget : public Widget, public CommandSender
|
||||||
|
|
||||||
// Add ROM size, manufacturer and bankswitch info
|
// Add ROM size, manufacturer and bankswitch info
|
||||||
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
||||||
myFontHeight, "ROM Size: ", kTextAlignLeft);
|
myFontHeight, "ROM Size ", kTextAlignLeft);
|
||||||
buf << bytes << " bytes";
|
buf << bytes << " bytes";
|
||||||
if(bytes >= 1024)
|
if(bytes >= 1024)
|
||||||
buf << " / " << (bytes/1024) << "KB";
|
buf << " / " << (bytes/1024) << "KB";
|
||||||
|
@ -72,7 +72,7 @@ class CartDebugWidget : public Widget, public CommandSender
|
||||||
y += myLineHeight + 4;
|
y += myLineHeight + 4;
|
||||||
|
|
||||||
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
||||||
myFontHeight, "Manufacturer: ", kTextAlignLeft);
|
myFontHeight, "Manufacturer ", kTextAlignLeft);
|
||||||
w = new EditTextWidget(_boss, _nfont, x+lwidth, y,
|
w = new EditTextWidget(_boss, _nfont, x+lwidth, y,
|
||||||
fwidth, myLineHeight, manufacturer);
|
fwidth, myLineHeight, manufacturer);
|
||||||
w->setEditable(false);
|
w->setEditable(false);
|
||||||
|
@ -85,7 +85,7 @@ class CartDebugWidget : public Widget, public CommandSender
|
||||||
if(lines > maxlines) lines = maxlines;
|
if(lines > maxlines) lines = maxlines;
|
||||||
|
|
||||||
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
new StaticTextWidget(_boss, _font, x, y, lwidth,
|
||||||
myFontHeight, "Description: ", kTextAlignLeft);
|
myFontHeight, "Description ", kTextAlignLeft);
|
||||||
myDesc = new StringListWidget(_boss, _nfont, x+lwidth, y,
|
myDesc = new StringListWidget(_boss, _nfont, x+lwidth, y,
|
||||||
fwidth, lines * myLineHeight, false);
|
fwidth, lines * myLineHeight, false);
|
||||||
myDesc->setEditable(false);
|
myDesc->setEditable(false);
|
||||||
|
|
|
@ -35,7 +35,7 @@ CartRamWidget::CartRamWidget(
|
||||||
myLineHeight(lfont.getLineHeight()),
|
myLineHeight(lfont.getLineHeight()),
|
||||||
myButtonHeight(myLineHeight + 4)
|
myButtonHeight(myLineHeight + 4)
|
||||||
{
|
{
|
||||||
int lwidth = lfont.getStringWidth("Description: "),
|
int lwidth = lfont.getStringWidth("Description "),
|
||||||
fwidth = w - lwidth - 20;
|
fwidth = w - lwidth - 20;
|
||||||
|
|
||||||
EditTextWidget* etw = nullptr;
|
EditTextWidget* etw = nullptr;
|
||||||
|
@ -44,7 +44,7 @@ CartRamWidget::CartRamWidget(
|
||||||
|
|
||||||
// Add RAM size
|
// Add RAM size
|
||||||
new StaticTextWidget(_boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(_boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "RAM Size: ", kTextAlignLeft);
|
myFontHeight, "RAM Size ", kTextAlignLeft);
|
||||||
|
|
||||||
uInt32 ramsize = cartDebug.internalRamSize();
|
uInt32 ramsize = cartDebug.internalRamSize();
|
||||||
buf << ramsize << " bytes";
|
buf << ramsize << " bytes";
|
||||||
|
@ -66,7 +66,7 @@ CartRamWidget::CartRamWidget(
|
||||||
if(lines > maxlines) lines = maxlines;
|
if(lines > maxlines) lines = maxlines;
|
||||||
|
|
||||||
new StaticTextWidget(_boss, _font, xpos, ypos, lwidth,
|
new StaticTextWidget(_boss, _font, xpos, ypos, lwidth,
|
||||||
myFontHeight, "Description: ", kTextAlignLeft);
|
myFontHeight, "Description ", kTextAlignLeft);
|
||||||
myDesc = new StringListWidget(boss, nfont, xpos+lwidth, ypos,
|
myDesc = new StringListWidget(boss, nfont, xpos+lwidth, ypos,
|
||||||
fwidth, lines * myLineHeight, false);
|
fwidth, lines * myLineHeight, false);
|
||||||
myDesc->setEditable(false);
|
myDesc->setEditable(false);
|
||||||
|
|
|
@ -41,6 +41,7 @@ DataGridWidget::DataGridWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
_rowHeight(font.getLineHeight()),
|
_rowHeight(font.getLineHeight()),
|
||||||
_colWidth(colchars * font.getMaxCharWidth() + 8),
|
_colWidth(colchars * font.getMaxCharWidth() + 8),
|
||||||
_bits(bits),
|
_bits(bits),
|
||||||
|
_crossGrid(false),
|
||||||
_base(base),
|
_base(base),
|
||||||
_selectedItem(0),
|
_selectedItem(0),
|
||||||
_currentKeyDown(KBDK_UNKNOWN),
|
_currentKeyDown(KBDK_UNKNOWN),
|
||||||
|
@ -635,6 +636,11 @@ void DataGridWidget::drawWidget(bool hilite)
|
||||||
// Draw the scrollbar
|
// Draw the scrollbar
|
||||||
if(_scrollBar)
|
if(_scrollBar)
|
||||||
_scrollBar->recalc(); // takes care of the draw
|
_scrollBar->recalc(); // takes care of the draw
|
||||||
|
|
||||||
|
// Cross out the grid?
|
||||||
|
if (_crossGrid)
|
||||||
|
for (row = 0; row < 4; ++row)
|
||||||
|
s.hLine(_x, _y + (row * lineheight/4), _x + linewidth, kColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -82,6 +82,8 @@ class DataGridWidget : public EditableWidget
|
||||||
|
|
||||||
void setOpsWidget(DataGridOpsWidget* w) { _opsWidget = w; }
|
void setOpsWidget(DataGridOpsWidget* w) { _opsWidget = w; }
|
||||||
|
|
||||||
|
void setCrossed(bool enable) { _crossGrid = enable; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void drawWidget(bool hilite) override;
|
void drawWidget(bool hilite) override;
|
||||||
|
|
||||||
|
@ -114,6 +116,7 @@ class DataGridWidget : public EditableWidget
|
||||||
int _bits;
|
int _bits;
|
||||||
int _lowerBound;
|
int _lowerBound;
|
||||||
int _upperBound;
|
int _upperBound;
|
||||||
|
bool _crossGrid;
|
||||||
|
|
||||||
Common::Base::Format _base;
|
Common::Base::Format _base;
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
||||||
// Add Binary display of selected RAM cell
|
// Add Binary display of selected RAM cell
|
||||||
xpos = x + w - 13*myFontWidth - 20;
|
xpos = x + w - 13*myFontWidth - 20;
|
||||||
new StaticTextWidget(boss, lfont, xpos, ypos, 4*myFontWidth, myFontHeight,
|
new StaticTextWidget(boss, lfont, xpos, ypos, 4*myFontWidth, myFontHeight,
|
||||||
"Bin:", kTextAlignLeft);
|
"Bin", kTextAlignLeft);
|
||||||
myBinValue = new DataGridWidget(boss, nfont, xpos + 4*myFontWidth + 5, ypos-2,
|
myBinValue = new DataGridWidget(boss, nfont, xpos + 4*myFontWidth + 5, ypos-2,
|
||||||
1, 1, 8, 8, Common::Base::F_2);
|
1, 1, 8, 8, Common::Base::F_2);
|
||||||
myBinValue->setTarget(this);
|
myBinValue->setTarget(this);
|
||||||
|
@ -125,7 +125,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
||||||
// Add Decimal display of selected RAM cell
|
// Add Decimal display of selected RAM cell
|
||||||
xpos -= 8*myFontWidth + 5 + 20;
|
xpos -= 8*myFontWidth + 5 + 20;
|
||||||
new StaticTextWidget(boss, lfont, xpos, ypos, 4*myFontWidth, myFontHeight,
|
new StaticTextWidget(boss, lfont, xpos, ypos, 4*myFontWidth, myFontHeight,
|
||||||
"Dec:", kTextAlignLeft);
|
"Dec", kTextAlignLeft);
|
||||||
myDecValue = new DataGridWidget(boss, nfont, xpos + 4*myFontWidth + 5, ypos-2,
|
myDecValue = new DataGridWidget(boss, nfont, xpos + 4*myFontWidth + 5, ypos-2,
|
||||||
1, 1, 3, 8, Common::Base::F_10);
|
1, 1, 3, 8, Common::Base::F_10);
|
||||||
myDecValue->setTarget(this);
|
myDecValue->setTarget(this);
|
||||||
|
@ -138,14 +138,14 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
||||||
int xpos_r = xpos - 20;
|
int xpos_r = xpos - 20;
|
||||||
xpos = x + 10;
|
xpos = x + 10;
|
||||||
new StaticTextWidget(boss, lfont, xpos, ypos, 6*myFontWidth, myFontHeight,
|
new StaticTextWidget(boss, lfont, xpos, ypos, 6*myFontWidth, myFontHeight,
|
||||||
"Label:", kTextAlignLeft);
|
"Label", kTextAlignLeft);
|
||||||
xpos += 6*myFontWidth + 5;
|
xpos += 6*myFontWidth + 5;
|
||||||
myLabel = new EditTextWidget(boss, nfont, xpos, ypos-2, xpos_r-xpos,
|
myLabel = new EditTextWidget(boss, nfont, xpos, ypos-2, xpos_r-xpos,
|
||||||
myLineHeight);
|
myLineHeight);
|
||||||
myLabel->setEditable(false, true);
|
myLabel->setEditable(false, true);
|
||||||
|
|
||||||
// Inputbox which will pop up when searching RAM
|
// Inputbox which will pop up when searching RAM
|
||||||
StringList labels = { "Search: " };
|
StringList labels = { "Search " };
|
||||||
myInputBox = make_ptr<InputTextDialog>(boss, lfont, nfont, labels);
|
myInputBox = make_ptr<InputTextDialog>(boss, lfont, nfont, labels);
|
||||||
myInputBox->setTarget(this);
|
myInputBox->setTarget(this);
|
||||||
|
|
||||||
|
|
|
@ -488,9 +488,24 @@ bool CartridgeCDF::save(Serializer& out) const
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
out.putShort(myCurrentBank);
|
out.putShort(myCurrentBank);
|
||||||
|
|
||||||
|
// Indicates current mode
|
||||||
|
out.putByte(myMode);
|
||||||
|
|
||||||
|
// State of FastJump
|
||||||
|
out.putByte(myFastJumpActive);
|
||||||
|
|
||||||
|
// Address of LDA # operand
|
||||||
|
out.putShort(myLDAimmediateOperandAddress);
|
||||||
|
|
||||||
// Harmony RAM
|
// Harmony RAM
|
||||||
out.putByteArray(myCDFRAM, 8192);
|
out.putByteArray(myCDFRAM, 8192);
|
||||||
|
|
||||||
|
// Audio info
|
||||||
|
out.putIntArray(myMusicCounters, 3);
|
||||||
|
out.putIntArray(myMusicFrequencies, 3);
|
||||||
|
out.putByteArray(myMusicWaveformSize, 3);
|
||||||
|
|
||||||
|
// Save cycles and clocks
|
||||||
out.putInt(myAudioCycles);
|
out.putInt(myAudioCycles);
|
||||||
out.putInt((uInt32)(myFractionalClocks * 100000000.0));
|
out.putInt((uInt32)(myFractionalClocks * 100000000.0));
|
||||||
out.putInt(myARMCycles);
|
out.putInt(myARMCycles);
|
||||||
|
@ -515,13 +530,26 @@ bool CartridgeCDF::load(Serializer& in)
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
myCurrentBank = in.getShort();
|
myCurrentBank = in.getShort();
|
||||||
|
|
||||||
|
// Indicates current mode
|
||||||
|
myMode = in.getByte();
|
||||||
|
|
||||||
|
// State of FastJump
|
||||||
|
myFastJumpActive = in.getByte();
|
||||||
|
|
||||||
|
// Address of LDA # operand
|
||||||
|
myLDAimmediateOperandAddress = in.getShort();
|
||||||
|
|
||||||
// Harmony RAM
|
// Harmony RAM
|
||||||
in.getByteArray(myCDFRAM, 8192);
|
in.getByteArray(myCDFRAM, 8192);
|
||||||
|
|
||||||
// Get system cycles and fractional clocks
|
// Audio info
|
||||||
|
in.getIntArray(myMusicCounters, 3);
|
||||||
|
in.getIntArray(myMusicFrequencies, 3);
|
||||||
|
in.getByteArray(myMusicWaveformSize, 3);
|
||||||
|
|
||||||
|
// Get cycles and clocks
|
||||||
myAudioCycles = (Int32)in.getInt();
|
myAudioCycles = (Int32)in.getInt();
|
||||||
myFractionalClocks = (double)in.getInt() / 100000000.0;
|
myFractionalClocks = (double)in.getInt() / 100000000.0;
|
||||||
|
|
||||||
myARMCycles = (Int32)in.getInt();
|
myARMCycles = (Int32)in.getInt();
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
|
|
|
@ -237,13 +237,12 @@ class CartridgeCDF : public Cartridge
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
uInt16 myCurrentBank;
|
uInt16 myCurrentBank;
|
||||||
|
|
||||||
// System cycle count when the last update to music data fetchers occurred
|
// System cycle count from when the last update to music data fetchers occurred
|
||||||
Int32 myAudioCycles;
|
Int32 myAudioCycles;
|
||||||
|
|
||||||
|
// ARM cycle count from when the last callFunction() occurred
|
||||||
Int32 myARMCycles;
|
Int32 myARMCycles;
|
||||||
|
|
||||||
uInt8 mySetAddress;
|
|
||||||
|
|
||||||
// The audio routines in the driver run in 32-bit mode and take advantage
|
// The audio routines in the driver run in 32-bit mode and take advantage
|
||||||
// of the FIQ Shadow Registers which are not accessible to 16-bit thumb
|
// of the FIQ Shadow Registers which are not accessible to 16-bit thumb
|
||||||
// code. As such, Thumbulator does not support them. The driver supplies a
|
// code. As such, Thumbulator does not support them. The driver supplies a
|
||||||
|
@ -260,12 +259,7 @@ class CartridgeCDF : public Cartridge
|
||||||
r13 = channel2 frequency
|
r13 = channel2 frequency
|
||||||
r14 = timer base */
|
r14 = timer base */
|
||||||
|
|
||||||
// The music mode counters
|
// The music counters, ARM FIQ shadow registers r8, r9, r10
|
||||||
// In the driver these are stored in ARM FIQ shadow registers r8, r9 and r10
|
|
||||||
// which are not accessible to Thumb code. Thumbulator will use
|
|
||||||
// callFunction() to pass back values that end up in them so so the Thumbulator does not
|
|
||||||
// support these. So the
|
|
||||||
//
|
|
||||||
uInt32 myMusicCounters[3];
|
uInt32 myMusicCounters[3];
|
||||||
|
|
||||||
// The music frequency, ARM FIQ shadow registers r11, r12, r13
|
// The music frequency, ARM FIQ shadow registers r11, r12, r13
|
||||||
|
@ -274,7 +268,7 @@ class CartridgeCDF : public Cartridge
|
||||||
// The music waveform sizes
|
// The music waveform sizes
|
||||||
uInt8 myMusicWaveformSize[3];
|
uInt8 myMusicWaveformSize[3];
|
||||||
|
|
||||||
// Fractional DPC music OSC clocks unused during the last update
|
// Fractional CDF music, OSC clocks unused during the last update
|
||||||
double myFractionalClocks;
|
double myFractionalClocks;
|
||||||
|
|
||||||
// Controls mode, lower nybble sets Fast Fetch, upper nybble sets audio
|
// Controls mode, lower nybble sets Fast Fetch, upper nybble sets audio
|
||||||
|
|
Loading…
Reference in New Issue