mirror of https://github.com/stella-emu/stella.git
added ARM stats to BUS and DPC+ debug widgets
This commit is contained in:
parent
47e9269cf2
commit
756b6ff207
|
@ -18,6 +18,7 @@
|
||||||
#include "CartBUS.hxx"
|
#include "CartBUS.hxx"
|
||||||
#include "DataGridWidget.hxx"
|
#include "DataGridWidget.hxx"
|
||||||
#include "PopUpWidget.hxx"
|
#include "PopUpWidget.hxx"
|
||||||
|
#include "EditTextWidget.hxx"
|
||||||
#include "CartBUSWidget.hxx"
|
#include "CartBUSWidget.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -49,8 +50,7 @@ CartridgeBUSWidget::CartridgeBUSWidget(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int xpos = 2,
|
int xpos = 2,
|
||||||
ypos = addBaseInformation(size, "AtariAge", info.str(), 4) +
|
ypos = addBaseInformation(size, "AtariAge", info.str(), 4) + 4;
|
||||||
myLineHeight;
|
|
||||||
|
|
||||||
VariantList items;
|
VariantList items;
|
||||||
VarList::push_back(items, "0 ($FFF5)");
|
VarList::push_back(items, "0 ($FFF5)");
|
||||||
|
@ -184,6 +184,34 @@ CartridgeBUSWidget::CartridgeBUSWidget(
|
||||||
myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode");
|
myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode");
|
||||||
myDigitalSample->setTarget(this);
|
myDigitalSample->setTarget(this);
|
||||||
myDigitalSample->setEditable(false);
|
myDigitalSample->setEditable(false);
|
||||||
|
|
||||||
|
xpos = 10; ypos += myLineHeight + 4 * 2;
|
||||||
|
new StaticTextWidget(boss, _font, xpos, ypos + 1, "Last ARM run stats:");
|
||||||
|
xpos = 10 + _font.getMaxCharWidth() * 2; ypos += myLineHeight + 4;
|
||||||
|
StaticTextWidget* s = new StaticTextWidget(boss, _font, xpos, ypos + 1, "Mem. cycles ");
|
||||||
|
myThumbMemCycles = new EditTextWidget(boss, _font, s->getRight(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbMemCycles->setEditable(false);
|
||||||
|
myThumbMemCycles->setToolTip("Number of memory cycles of last ARM run.");
|
||||||
|
|
||||||
|
s = new StaticTextWidget(boss, _font, myThumbMemCycles->getRight() + _fontWidth * 2, ypos + 1, "Fetches ");
|
||||||
|
myThumbFetches = new EditTextWidget(boss, _font, s->getRight(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbFetches->setEditable(false);
|
||||||
|
myThumbFetches->setToolTip("Number of fetches/instructions of last ARM run.");
|
||||||
|
|
||||||
|
ypos += myLineHeight + 4;
|
||||||
|
s = new StaticTextWidget(boss, _font, xpos, ypos + 1, "Reads ");
|
||||||
|
myThumbReads = new EditTextWidget(boss, _font, myThumbMemCycles->getLeft(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbReads->setEditable(false);
|
||||||
|
myThumbReads->setToolTip("Number of reads of last ARM run.");
|
||||||
|
|
||||||
|
s = new StaticTextWidget(boss, _font, myThumbReads->getRight() + _fontWidth * 2, ypos + 1, "Writes ");
|
||||||
|
myThumbWrites = new EditTextWidget(boss, _font, myThumbFetches->getLeft(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbWrites->setEditable(false);
|
||||||
|
myThumbWrites->setToolTip("Number of write of last ARM run.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -366,6 +394,16 @@ void CartridgeBUSWidget::loadConfig()
|
||||||
mySamplePointer->setCrossed(true);
|
mySamplePointer->setCrossed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myThumbMemCycles->setText(Common::Base::toString(myCart.stats().fetches
|
||||||
|
+ myCart.stats().reads + myCart.stats().writes,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbFetches->setText(Common::Base::toString(myCart.stats().fetches,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbReads->setText(Common::Base::toString(myCart.stats().reads,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbWrites->setText(Common::Base::toString(myCart.stats().writes,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
|
||||||
CartDebugWidget::loadConfig();
|
CartDebugWidget::loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ class CartridgeBUS;
|
||||||
class PopUpWidget;
|
class PopUpWidget;
|
||||||
class CheckboxWidget;
|
class CheckboxWidget;
|
||||||
class DataGridWidget;
|
class DataGridWidget;
|
||||||
|
class EditTextWidget;
|
||||||
|
|
||||||
#include "CartDebugWidget.hxx"
|
#include "CartDebugWidget.hxx"
|
||||||
|
|
||||||
|
@ -65,6 +66,10 @@ class CartridgeBUSWidget : public CartDebugWidget
|
||||||
DataGridWidget* mySamplePointer{nullptr};
|
DataGridWidget* mySamplePointer{nullptr};
|
||||||
CheckboxWidget* myBusOverdrive{nullptr};
|
CheckboxWidget* myBusOverdrive{nullptr};
|
||||||
CheckboxWidget* myDigitalSample{nullptr};
|
CheckboxWidget* myDigitalSample{nullptr};
|
||||||
|
EditTextWidget* myThumbMemCycles{nullptr};
|
||||||
|
EditTextWidget* myThumbFetches{nullptr};
|
||||||
|
EditTextWidget* myThumbReads{nullptr};
|
||||||
|
EditTextWidget* myThumbWrites{nullptr};
|
||||||
std::array<StaticTextWidget*, 6> myDatastreamLabels{nullptr};
|
std::array<StaticTextWidget*, 6> myDatastreamLabels{nullptr};
|
||||||
CartState myOldState;
|
CartState myOldState;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "CartDPCPlus.hxx"
|
#include "CartDPCPlus.hxx"
|
||||||
#include "DataGridWidget.hxx"
|
#include "DataGridWidget.hxx"
|
||||||
#include "PopUpWidget.hxx"
|
#include "PopUpWidget.hxx"
|
||||||
|
#include "EditTextWidget.hxx"
|
||||||
#include "CartDPCPlusWidget.hxx"
|
#include "CartDPCPlusWidget.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -178,6 +179,35 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget(
|
||||||
myIMLDA = new CheckboxWidget(boss, _font, xpos, ypos, "Immediate mode LDA");
|
myIMLDA = new CheckboxWidget(boss, _font, xpos, ypos, "Immediate mode LDA");
|
||||||
myIMLDA->setTarget(this);
|
myIMLDA->setTarget(this);
|
||||||
myIMLDA->setEditable(false);
|
myIMLDA->setEditable(false);
|
||||||
|
|
||||||
|
xpos = 2; ypos += myLineHeight + 4 * 1;
|
||||||
|
new StaticTextWidget(boss, _font, xpos, ypos + 1, "Last ARM run stats:");
|
||||||
|
xpos = 2 + _font.getMaxCharWidth() * 2; ypos += myLineHeight + 4;
|
||||||
|
StaticTextWidget* s = new StaticTextWidget(boss, _font, xpos, ypos + 1, "Mem. cycles ");
|
||||||
|
myThumbMemCycles = new EditTextWidget(boss, _font, s->getRight(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbMemCycles->setEditable(false);
|
||||||
|
myThumbMemCycles->setToolTip("Number of memory cycles of last ARM run.");
|
||||||
|
|
||||||
|
s = new StaticTextWidget(boss, _font, myThumbMemCycles->getRight() + _fontWidth * 2, ypos + 1, "Fetches ");
|
||||||
|
myThumbFetches = new EditTextWidget(boss, _font, s->getRight(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbFetches->setEditable(false);
|
||||||
|
myThumbFetches->setToolTip("Number of fetches/instructions of last ARM run.");
|
||||||
|
|
||||||
|
ypos += myLineHeight + 4;
|
||||||
|
s = new StaticTextWidget(boss, _font, xpos, ypos + 1, "Reads ");
|
||||||
|
myThumbReads = new EditTextWidget(boss, _font, myThumbMemCycles->getLeft(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbReads->setEditable(false);
|
||||||
|
myThumbReads->setToolTip("Number of reads of last ARM run.");
|
||||||
|
|
||||||
|
s = new StaticTextWidget(boss, _font, myThumbReads->getRight() + _fontWidth * 2, ypos + 1, "Writes ");
|
||||||
|
myThumbWrites = new EditTextWidget(boss, _font, myThumbFetches->getLeft(), ypos - 1,
|
||||||
|
EditTextWidget::calcWidth(_font, 6), myLineHeight, "");
|
||||||
|
myThumbWrites->setEditable(false);
|
||||||
|
myThumbWrites->setToolTip("Number of write of last ARM run.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -306,6 +336,16 @@ void CartridgeDPCPlusWidget::loadConfig()
|
||||||
myFastFetch->setState(myCart.myFastFetch);
|
myFastFetch->setState(myCart.myFastFetch);
|
||||||
myIMLDA->setState(myCart.myLDAimmediate);
|
myIMLDA->setState(myCart.myLDAimmediate);
|
||||||
|
|
||||||
|
myThumbMemCycles->setText(Common::Base::toString(myCart.stats().fetches
|
||||||
|
+ myCart.stats().reads + myCart.stats().writes,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbFetches->setText(Common::Base::toString(myCart.stats().fetches,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbReads->setText(Common::Base::toString(myCart.stats().reads,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
myThumbWrites->setText(Common::Base::toString(myCart.stats().writes,
|
||||||
|
Common::Base::Fmt::_10_6));
|
||||||
|
|
||||||
CartDebugWidget::loadConfig();
|
CartDebugWidget::loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ class CartridgeDPCPlus;
|
||||||
class PopUpWidget;
|
class PopUpWidget;
|
||||||
class CheckboxWidget;
|
class CheckboxWidget;
|
||||||
class DataGridWidget;
|
class DataGridWidget;
|
||||||
|
class EditTextWidget;
|
||||||
|
|
||||||
#include "CartDebugWidget.hxx"
|
#include "CartDebugWidget.hxx"
|
||||||
|
|
||||||
|
@ -65,6 +66,10 @@ class CartridgeDPCPlusWidget : public CartDebugWidget
|
||||||
CheckboxWidget* myFastFetch{nullptr};
|
CheckboxWidget* myFastFetch{nullptr};
|
||||||
CheckboxWidget* myIMLDA{nullptr};
|
CheckboxWidget* myIMLDA{nullptr};
|
||||||
DataGridWidget* myRandom{nullptr};
|
DataGridWidget* myRandom{nullptr};
|
||||||
|
EditTextWidget* myThumbMemCycles{nullptr};
|
||||||
|
EditTextWidget* myThumbFetches{nullptr};
|
||||||
|
EditTextWidget* myThumbReads{nullptr};
|
||||||
|
EditTextWidget* myThumbWrites{nullptr};
|
||||||
|
|
||||||
CartState myOldState;
|
CartState myOldState;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ class Thumbulator;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
#include "Thumbulator.hxx"
|
||||||
#include "Cart.hxx"
|
#include "Cart.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -233,6 +234,9 @@ class CartridgeBUS : public Cartridge
|
||||||
uInt32 getWaveformSize(uInt8 index) const;
|
uInt32 getWaveformSize(uInt8 index) const;
|
||||||
uInt32 getSample();
|
uInt32 getSample();
|
||||||
|
|
||||||
|
// Get number of memory accesses of last ARM run.
|
||||||
|
const Thumbulator::Stats& stats() const { return myThumbEmulator->stats(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The 32K ROM image of the cartridge
|
// The 32K ROM image of the cartridge
|
||||||
ByteBuffer myImage;
|
ByteBuffer myImage;
|
||||||
|
|
|
@ -827,9 +827,3 @@ uInt32 CartridgeCDF::romSize() const
|
||||||
return new CartridgeCDFInfoWidget(boss, lfont, nfont, x, y, w, h, *this);
|
return new CartridgeCDFInfoWidget(boss, lfont, nfont, x, y, w, h, *this);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
const Thumbulator::Stats& CartridgeCDF::stats() const
|
|
||||||
{
|
|
||||||
return myThumbEmulator->stats();
|
|
||||||
}
|
|
||||||
|
|
|
@ -264,8 +264,8 @@ class CartridgeCDF : public Cartridge
|
||||||
uInt32 getSample();
|
uInt32 getSample();
|
||||||
void setupVersion();
|
void setupVersion();
|
||||||
|
|
||||||
// Get number of instructions of last ARM run.
|
// Get number of memory accesses of last ARM run.
|
||||||
const Thumbulator::Stats& stats() const;
|
const Thumbulator::Stats& stats() const { return myThumbEmulator->stats(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The ROM image of the cartridge
|
// The ROM image of the cartridge
|
||||||
|
|
|
@ -223,6 +223,9 @@ class CartridgeDPCPlus : public Cartridge
|
||||||
*/
|
*/
|
||||||
void callFunction(uInt8 value);
|
void callFunction(uInt8 value);
|
||||||
|
|
||||||
|
// Get number of memory accesses of last ARM run.
|
||||||
|
const Thumbulator::Stats& stats() const { return myThumbEmulator->stats(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The ROM image and size
|
// The ROM image and size
|
||||||
ByteBuffer myImage;
|
ByteBuffer myImage;
|
||||||
|
|
Loading…
Reference in New Issue