Merge remote-tracking branch 'stella-emu/master'

This commit is contained in:
Darrell Spice, Jr 2017-05-06 09:32:12 -05:00
commit e3514a9f80
43 changed files with 531 additions and 272 deletions

View File

@ -19,6 +19,14 @@
#define SDL_LIB_HXX
#include <SDL.h>
#undef bool // Seems to be needed for ppc64le, doesn't hurt other archs
/*
Seems to be needed for ppc64le, doesn't hurt other archs
Note that this is a problem in SDL2, which includes <altivec.h>
https://bugzilla.redhat.com/show_bug.cgi?id=1419452
*/
#undef vector
#undef pixel
#undef bool
#endif

View File

@ -18,7 +18,7 @@
#ifndef VERSION_HXX
#define VERSION_HXX
#define STELLA_VERSION "5.0.0-pre6"
#define STELLA_BUILD "3284"
#define STELLA_VERSION "5.0.0-pre7"
#define STELLA_BUILD "3350"
#endif

View File

@ -37,7 +37,7 @@ class BinAndExpression : public Expression
{
public:
BinAndExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() & myRHS->evaluate(); }
};
@ -46,7 +46,7 @@ class BinNotExpression : public Expression
{
public:
BinNotExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return ~(myLHS->evaluate()); }
};
@ -55,7 +55,7 @@ class BinOrExpression : public Expression
{
public:
BinOrExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() | myRHS->evaluate(); }
};
@ -64,7 +64,7 @@ class BinXorExpression : public Expression
{
public:
BinXorExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() ^ myRHS->evaluate(); }
};
@ -73,7 +73,7 @@ class ByteDerefExpression : public Expression
{
public:
ByteDerefExpression(Expression* left): Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return Debugger::debugger().peek(myLHS->evaluate()); }
};
@ -82,7 +82,7 @@ class ByteDerefOffsetExpression : public Expression
{
public:
ByteDerefOffsetExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return Debugger::debugger().peek(myLHS->evaluate() + myRHS->evaluate()); }
};
@ -91,7 +91,7 @@ class ConstExpression : public Expression
{
public:
ConstExpression(const int value) : Expression(), myValue(value) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myValue; }
private:
@ -103,7 +103,7 @@ class CpuMethodExpression : public Expression
{
public:
CpuMethodExpression(CpuMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cpuDebug()); }
private:
@ -115,7 +115,7 @@ class DivExpression : public Expression
{
public:
DivExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ int denom = myRHS->evaluate();
return denom == 0 ? 0 : myLHS->evaluate() / denom; }
};
@ -125,7 +125,7 @@ class EqualsExpression : public Expression
{
public:
EqualsExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() == myRHS->evaluate(); }
};
@ -134,7 +134,7 @@ class EquateExpression : public Expression
{
public:
EquateExpression(const string& label) : Expression(), myLabel(label) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return Debugger::debugger().cartDebug().getAddress(myLabel); }
private:
@ -146,7 +146,7 @@ class FunctionExpression : public Expression
{
public:
FunctionExpression(const string& label) : Expression(), myLabel(label) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return Debugger::debugger().getFunction(myLabel).evaluate(); }
private:
@ -158,7 +158,7 @@ class GreaterEqualsExpression : public Expression
{
public:
GreaterEqualsExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() >= myRHS->evaluate(); }
};
@ -167,7 +167,7 @@ class GreaterExpression : public Expression
{
public:
GreaterExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() > myRHS->evaluate(); }
};
@ -176,7 +176,7 @@ class HiByteExpression : public Expression
{
public:
HiByteExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return 0xff & (myLHS->evaluate() >> 8); }
};
@ -185,7 +185,7 @@ class LessEqualsExpression : public Expression
{
public:
LessEqualsExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() <= myRHS->evaluate(); }
};
@ -194,7 +194,7 @@ class LessExpression : public Expression
{
public:
LessExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() < myRHS->evaluate(); }
};
@ -203,7 +203,7 @@ class LoByteExpression : public Expression
{
public:
LoByteExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return 0xff & myLHS->evaluate(); }
};
@ -212,7 +212,7 @@ class LogAndExpression : public Expression
{
public:
LogAndExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() && myRHS->evaluate(); }
};
@ -221,7 +221,7 @@ class LogNotExpression : public Expression
{
public:
LogNotExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return !(myLHS->evaluate()); }
};
@ -230,7 +230,7 @@ class LogOrExpression : public Expression
{
public:
LogOrExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() || myRHS->evaluate(); }
};
@ -239,7 +239,7 @@ class MinusExpression : public Expression
{
public:
MinusExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() - myRHS->evaluate(); }
};
@ -248,7 +248,7 @@ class ModExpression : public Expression
{
public:
ModExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ int rhs = myRHS->evaluate();
return rhs == 0 ? 0 : myLHS->evaluate() % rhs; }
};
@ -258,7 +258,7 @@ class MultExpression : public Expression
{
public:
MultExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() * myRHS->evaluate(); }
};
@ -267,7 +267,7 @@ class NotEqualsExpression : public Expression
{
public:
NotEqualsExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() != myRHS->evaluate(); }
};
@ -276,7 +276,7 @@ class PlusExpression : public Expression
{
public:
PlusExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() + myRHS->evaluate(); }
};
@ -285,7 +285,7 @@ class CartMethodExpression : public Expression
{
public:
CartMethodExpression(CartMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().cartDebug()); }
private:
@ -297,7 +297,7 @@ class ShiftLeftExpression : public Expression
{
public:
ShiftLeftExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() << myRHS->evaluate(); }
};
@ -306,7 +306,7 @@ class ShiftRightExpression : public Expression
{
public:
ShiftRightExpression(Expression* left, Expression* right) : Expression(left, right) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myLHS->evaluate() >> myRHS->evaluate(); }
};
@ -315,7 +315,7 @@ class TiaMethodExpression : public Expression
{
public:
TiaMethodExpression(TiaMethod method) : Expression(), myMethod(std::mem_fn(method)) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return myMethod(Debugger::debugger().tiaDebug()); }
private:
@ -327,7 +327,7 @@ class UnaryMinusExpression : public Expression
{
public:
UnaryMinusExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return -(myLHS->evaluate()); }
};
@ -336,7 +336,7 @@ class WordDerefExpression : public Expression
{
public:
WordDerefExpression(Expression* left) : Expression(left) { }
uInt32 evaluate() const override
Int32 evaluate() const override
{ return Debugger::debugger().dpeek(myLHS->evaluate()); }
};

View File

@ -35,7 +35,7 @@ class Expression
: myLHS(lhs), myRHS(rhs) { }
virtual ~Expression() = default;
virtual uInt32 evaluate() const { return 0; }
virtual Int32 evaluate() const { return 0; }
protected:
unique_ptr<Expression> myLHS, myRHS;

View File

@ -51,12 +51,39 @@ const DebuggerState& TIADebug::getState()
myState.coluRegs.push_back(coluPF());
myState.coluRegs.push_back(coluBK());
// Player 1 & 2 graphics registers
// Debug Colors
myState.fixedCols.clear();
if(myTIA.myFrameManager.layout() == FrameLayout::ntsc)
{
myState.fixedCols.push_back(myTIA.P0ColorNTSC);
myState.fixedCols.push_back(myTIA.P1ColorNTSC);
myState.fixedCols.push_back(myTIA.PFColorNTSC);
myState.fixedCols.push_back(myTIA.BKColorNTSC);
myState.fixedCols.push_back(myTIA.M0ColorNTSC);
myState.fixedCols.push_back(myTIA.M1ColorNTSC);
myState.fixedCols.push_back(myTIA.BLColorNTSC);
myState.fixedCols.push_back(myTIA.HBLANKColor);
}
else
{
myState.fixedCols.push_back(myTIA.P0ColorPAL);
myState.fixedCols.push_back(myTIA.P1ColorPAL);
myState.fixedCols.push_back(myTIA.PFColorPAL);
myState.fixedCols.push_back(myTIA.BKColorPAL);
myState.fixedCols.push_back(myTIA.M0ColorPAL);
myState.fixedCols.push_back(myTIA.M1ColorPAL);
myState.fixedCols.push_back(myTIA.BLColorPAL);
myState.fixedCols.push_back(myTIA.HBLANKColor);
}
// Player 0 & 1 and Ball graphics registers
myState.gr.clear();
myState.gr.push_back(myTIA.myPlayer0.getGRPNew());
myState.gr.push_back(myTIA.myPlayer1.getGRPNew());
myState.gr.push_back(myTIA.myPlayer0.getGRPOld());
myState.gr.push_back(myTIA.myPlayer1.getGRPOld());
myState.gr.push_back(myTIA.myBall.getENABLNew());
myState.gr.push_back(myTIA.myBall.getENABLOld());
// Position registers
myState.pos.clear();
@ -114,12 +141,14 @@ void TIADebug::saveOldState()
myOldState.coluRegs.push_back(coluPF());
myOldState.coluRegs.push_back(coluBK());
// Player 1 & 2 graphics registers
// Player 0 & 1 graphics registers
myOldState.gr.clear();
myOldState.gr.push_back(myTIA.myPlayer0.getGRPNew());
myOldState.gr.push_back(myTIA.myPlayer1.getGRPNew());
myOldState.gr.push_back(myTIA.myPlayer0.getGRPOld());
myOldState.gr.push_back(myTIA.myPlayer1.getGRPOld());
myOldState.gr.push_back(myTIA.myBall.getENABLNew());
myOldState.gr.push_back(myTIA.myBall.getENABLOld());
// Position registers
myOldState.pos.clear();
@ -775,8 +804,8 @@ string TIADebug::debugColors() const
<< " Orange " << colorSwatch(myTIA.M0ColorNTSC) << " Missile 0\n"
<< " Yellow " << colorSwatch(myTIA.P1ColorNTSC) << " Player 1\n"
<< " Green " << colorSwatch(myTIA.M1ColorNTSC) << " Missile 1\n"
<< " Blue " << colorSwatch(myTIA.BLColorNTSC) << " Ball\n"
<< " Purple " << colorSwatch(myTIA.PFColorNTSC) << " Playfield\n"
<< " Blue " << colorSwatch(myTIA.PFColorNTSC) << " Playfield\n"
<< " Purple " << colorSwatch(myTIA.BLColorNTSC) << " Ball\n"
<< " Grey " << colorSwatch(myTIA.BKColorNTSC) << " Background\n"
<< " White " << colorSwatch(myTIA.HBLANKColor) << " HMOVE\n";
}
@ -786,8 +815,8 @@ string TIADebug::debugColors() const
<< " Orange " << colorSwatch(myTIA.M0ColorPAL) << " Missile 0\n"
<< " Yellow " << colorSwatch(myTIA.P1ColorPAL) << " Player 1\n"
<< " Green " << colorSwatch(myTIA.M1ColorPAL) << " Missile 1\n"
<< " Blue " << colorSwatch(myTIA.BLColorPAL) << " Ball\n"
<< " Purple " << colorSwatch(myTIA.PFColorPAL) << " Playfield\n"
<< " Blue " << colorSwatch(myTIA.PFColorPAL) << " Playfield\n"
<< " Purple " << colorSwatch(myTIA.BLColorPAL) << " Ball\n"
<< " Grey " << colorSwatch(myTIA.BKColorPAL) << " Background\n"
<< " White " << colorSwatch(myTIA.HBLANKColor) << " HMOVE\n";
}

View File

@ -40,6 +40,7 @@ class TiaState : public DebuggerState
public:
IntArray ram;
IntArray coluRegs;
IntArray fixedCols;
IntArray gr;
IntArray pos;
IntArray hm;

View File

@ -34,12 +34,12 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
const int fontWidth = lfont.getMaxCharWidth(),
fontHeight = lfont.getFontHeight(),
lineHeight = lfont.getLineHeight();
int xpos = 10, ypos = 25, lwidth = lfont.getStringWidth("AUDW: ");
int xpos = 10, ypos = 25, lwidth = lfont.getStringWidth("AUDW ");
// AudF registers
new StaticTextWidget(boss, lfont, xpos, ypos+2,
lwidth, fontHeight,
"AUDF:", kTextAlignLeft);
"AUDF", kTextAlignLeft);
xpos += lwidth;
myAudF = new DataGridWidget(boss, nfont, xpos, ypos,
2, 1, 2, 5, Common::Base::F_16);
@ -59,7 +59,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
// AudC registers
xpos = 10; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight,
"AUDC:", kTextAlignLeft);
"AUDC", kTextAlignLeft);
xpos += lwidth;
myAudC = new DataGridWidget(boss, nfont, xpos, ypos,
2, 1, 2, 4, Common::Base::F_16);
@ -71,7 +71,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont,
// AudV registers
xpos = 10; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight,
"AUDV:", kTextAlignLeft);
"AUDV", kTextAlignLeft);
xpos += lwidth;
myAudV = new DataGridWidget(boss, nfont, xpos, ypos,
2, 1, 2, 4, Common::Base::F_16);

View File

@ -80,11 +80,11 @@ CartridgeCDFWidget::CartridgeCDFWidget(
myDatastreamPointers = new DataGridWidget(boss, _nfont, DS_X, ypos+myLineHeight-2, 4, 8, 6, 32, Common::Base::F_16_3_2);
myDatastreamPointers->setTarget(this);
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)
@ -106,7 +106,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
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
xpos = DS_X + myDatastreamPointers->getWidth() + 20;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
@ -115,7 +115,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
myDatastreamIncrements = new DataGridWidget(boss, _nfont, xpos, ypos+myLineHeight-2, 4, 8, 5, 32, Common::Base::F_16_2_2);
myDatastreamIncrements->setTarget(this);
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);
@ -154,11 +154,11 @@ CartridgeCDFWidget::CartridgeCDFWidget(
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
xpos = 10; ypos += myLineHeight + 4;
new StaticTextWidget(boss, _font, xpos, ypos, lwidth,
@ -174,7 +174,7 @@ CartridgeCDFWidget::CartridgeCDFWidget(
myFastFetch = new CheckboxWidget(boss, _font, xpos, ypos, "Fast Fetcher enabled");
myFastFetch->setTarget(this);
myFastFetch->setEditable(false);
myDigitalSample = new CheckboxWidget(boss, _font, xpossp, ypos, "Digital Sample mode");
myDigitalSample->setTarget(this);
myDigitalSample->setEditable(false);
@ -225,7 +225,7 @@ void CartridgeCDFWidget::saveOldState()
for(uInt32 i = 0; i < internalRamSize(); ++i)
myOldState.internalram.push_back(myCart.myCDFRAM[i]);
myOldState.samplepointer.push_back(myCart.getSample());
}
@ -266,7 +266,7 @@ void CartridgeCDFWidget::loadConfig()
changed.push_back(pointervalue != myOldState.datastreampointers[i]);
}
myDatastreamPointers2->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear();
for(int i = 0; i < 32; ++i)
{
@ -284,7 +284,7 @@ void CartridgeCDFWidget::loadConfig()
changed.push_back(incrementvalue != myOldState.datastreamincrements[i]);
}
myDatastreamIncrements2->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear();
for(int i = 0; i < 3; ++i)
{
@ -321,10 +321,10 @@ void CartridgeCDFWidget::loadConfig()
alist.push_back(0); vlist.push_back(myCart.getSample());
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);

View File

@ -64,7 +64,7 @@ class CartridgeCDFWidget : public CartDebugWidget
DataGridWidget* myMusicWaveformSizes;
DataGridWidget* mySamplePointer;
StaticTextWidget* myDatastreamLabels[10];
// done differently than in DPC+, need to rethink debugger support
CheckboxWidget* myFastFetch;
CheckboxWidget* myDigitalSample;

View File

@ -55,4 +55,9 @@ void ColorWidget::drawWidget(bool hilite)
// Show the currently selected color
s.fillRect(_x+1, _y+1, _w-2, _h-1, _color);
// Cross out the grid?
if(_crossGrid)
for(uInt32 row = 1; row < 4; ++row)
s.hLine(_x, _y + (row * _h/4), _x + _w - 2, kColor);
}

View File

@ -42,6 +42,8 @@ class ColorWidget : public Widget, public CommandSender
void setColor(int color);
int getColor() const { return _color; }
void setCrossed(bool enable) { _crossGrid = enable; }
protected:
void drawWidget(bool hilite) override;
@ -49,6 +51,8 @@ class ColorWidget : public Widget, public CommandSender
int _color;
int _cmd;
bool _crossGrid;
private:
// Following constructors and assignment operators not supported
ColorWidget() = delete;

View File

@ -43,7 +43,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
// Create a 1x1 grid with label for the PC register
xpos = x; ypos = y; lwidth = 4 * fontWidth;
new StaticTextWidget(boss, lfont, xpos, ypos+1, lwidth-2, fontHeight,
"PC:", kTextAlignLeft);
"PC ", kTextAlignLeft);
myPCGrid =
new DataGridWidget(boss, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::F_16);
myPCGrid->setTarget(this);
@ -99,7 +99,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
// Add labels for other CPU registers
xpos = x;
string labels[4] = { "SP:", "A:", "X:", "Y:" };
string labels[4] = { "SP ", "A ", "X ", "Y " };
for(int row = 0; row < 4; ++row)
{
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 1,
@ -110,7 +110,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
// Create a bitfield widget for changing the processor status
xpos = x; ypos += 4*lineHeight + 2;
new StaticTextWidget(boss, lfont, xpos, ypos+1, lwidth-2, fontHeight,
"PS:", kTextAlignLeft);
"PS ", kTextAlignLeft);
myPSRegister = new ToggleBitWidget(boss, nfont, xpos+lwidth, ypos, 8, 1);
myPSRegister->setTarget(this);
addFocusWidget(myPSRegister);

View File

@ -636,11 +636,11 @@ void DataGridWidget::drawWidget(bool hilite)
// Draw the scrollbar
if(_scrollBar)
_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);
if(_crossGrid)
for(row = 1; row < 4; ++row)
s.hLine(_x, _y + (row * lineheight/4), _x + linewidth, kColor);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -81,7 +81,7 @@ class DataGridWidget : public EditableWidget
int colWidth() { return _colWidth; }
void setOpsWidget(DataGridOpsWidget* w) { _opsWidget = w; }
void setCrossed(bool enable) { _crossGrid = enable; }
protected:

View File

@ -97,7 +97,7 @@ void DelayQueueWidget::drawWidget(bool hilite)
y += 1;
x += 1;
w -= 1;
surface.fillRect(x, y, w - 1, _h - 2, kBGColorLo);
surface.fillRect(x, y, w - 1, _h - 2, kBGColorHi);
y += 2;
x += 2;

View File

@ -43,9 +43,9 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
// Show current bank state
xpos = x; ypos = y + 7;
t = new StaticTextWidget(boss, lfont, xpos, ypos,
lfont.getStringWidth("Bank:"),
lfont.getStringWidth("Bank"),
lfont.getFontHeight(),
"Bank:", kTextAlignLeft);
"Bank", kTextAlignLeft);
xpos += t->getWidth() + 5;
myBank = new EditTextWidget(boss, nfont, xpos, ypos-1,

View File

@ -38,12 +38,12 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
x += 5;
const int lineHeight = lfont.getLineHeight();
int xpos = x, ypos = y + 10;
int lwidth = lfont.getStringWidth(longstr ? "Frame Cycle:" : "F. Cycle:");
int lwidth = lfont.getStringWidth(longstr ? "Frame Cycle " : "F. Cycle ");
int fwidth = 5 * lfont.getMaxCharWidth() + 4;
// Add frame info
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Frame Count:" : "Frame:",
longstr ? "Frame Count " : "Frame ",
kTextAlignLeft);
xpos += lwidth;
myFrameCount = new EditTextWidget(boss, nfont, xpos, ypos-1, fwidth, lineHeight, "");
@ -51,7 +51,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
xpos = x; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Frame Cycle:" : "F. Cycle:",
longstr ? "Frame Cycle " : "F. Cycle ",
kTextAlignLeft);
xpos += lwidth;
myFrameCycles = new EditTextWidget(boss, nfont, xpos, ypos-1, fwidth, lineHeight, "");
@ -66,10 +66,10 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
myVBlank->setEditable(false);
xpos = x + lwidth + myFrameCycles->getWidth() + 8; ypos = y + 10;
lwidth = lfont.getStringWidth(longstr ? "Color Clock:" : "Pixel Pos:");
lwidth = lfont.getStringWidth(longstr ? "Color Clock " : "Pixel Pos ");
fwidth = 3 * lfont.getMaxCharWidth() + 4;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
"Scanline:", kTextAlignLeft);
"Scanline ", kTextAlignLeft);
myScanlineCount = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, "");
@ -77,7 +77,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Scan Cycle:" : "S. Cycle:", kTextAlignLeft);
longstr ? "Scan Cycle " : "S. Cycle ", kTextAlignLeft);
myScanlineCycles = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, "");
@ -85,7 +85,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
"Pixel Pos:", kTextAlignLeft);
"Pixel Pos ", kTextAlignLeft);
myPixelPosition = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, "");
@ -93,7 +93,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Color Clock:" : "Color Clk:", kTextAlignLeft);
longstr ? "Color Clock " : "Color Clk ", kTextAlignLeft);
myColorClocks = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, "");

View File

@ -46,7 +46,6 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
VarList::push_back(l, "Set breakpoint", "bp");
VarList::push_back(l, "Set zoom position", "zoom");
VarList::push_back(l, "Save snapshot", "snap");
VarList::push_back(l, "Toggle fixed debug colors (from beam pos)", "fixed");
myMenu = make_ptr<ContextMenu>(this, font, l);
}
@ -135,10 +134,6 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
{
instance().debugger().parser().run("savesnap");
}
else if(rmb == "fixed")
{
instance().console().tia().toggleFixedColors();
}
break;
}
}

View File

@ -39,18 +39,20 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
{
const int fontWidth = lfont.getMaxCharWidth(),
fontHeight = lfont.getFontHeight(),
lineHeight = lfont.getLineHeight();
int xpos = 10, ypos = 15 + lineHeight;
lineHeight = lfont.getLineHeight(),
buttonW = 7 * fontWidth;
int xpos = 10, ypos = 10 + lineHeight, buttonX = 0, buttonY = 0;
StaticTextWidget* t = nullptr;
ButtonWidget* b = nullptr;
// Color registers
const char* regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" };
for(int row = 0; row < 4; ++row)
{
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2,
7*fontWidth, fontHeight, regNames[row], kTextAlignLeft);
6*fontWidth, fontHeight, regNames[row], kTextAlignLeft);
}
xpos += 7*fontWidth + 5;
xpos += 6*fontWidth + 8;
myColorRegs = new DataGridWidget(boss, nfont, xpos, ypos,
1, 4, 2, 8, Common::Base::F_16);
myColorRegs->setTarget(this);
@ -58,27 +60,60 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myColorRegs);
xpos += myColorRegs->colWidth() + 5;
myCOLUP0Color = new ColorWidget(boss, nfont, xpos, ypos+2, 20, lineHeight - 4);
myCOLUP0Color = new ColorWidget(boss, nfont, xpos, ypos+2,
uInt32(1.5*lineHeight), lineHeight - 4);
myCOLUP0Color->setTarget(this);
ypos += lineHeight;
myCOLUP1Color = new ColorWidget(boss, nfont, xpos, ypos+2, 20, lineHeight - 4);
myCOLUP1Color = new ColorWidget(boss, nfont, xpos, ypos+2,
uInt32(1.5*lineHeight), lineHeight - 4);
myCOLUP1Color->setTarget(this);
ypos += lineHeight;
myCOLUPFColor = new ColorWidget(boss, nfont, xpos, ypos+2, 20, lineHeight - 4);
myCOLUPFColor = new ColorWidget(boss, nfont, xpos, ypos+2,
uInt32(1.5*lineHeight), lineHeight - 4);
myCOLUPFColor->setTarget(this);
ypos += lineHeight;
myCOLUBKColor = new ColorWidget(boss, nfont, xpos, ypos+2, 20, lineHeight - 4);
myCOLUBKColor = new ColorWidget(boss, nfont, xpos, ypos+2,
uInt32(1.5*lineHeight), lineHeight - 4);
myCOLUBKColor->setTarget(this);
// Fixed debug colors
xpos += myCOLUP0Color->getWidth() + 30; ypos = 10;
myFixedEnabled = new CheckboxWidget(boss, lfont, xpos, ypos, "Debug Colors", kDbgClCmd);
myFixedEnabled->setTarget(this);
addFocusWidget(myFixedEnabled);
const char* dbgLabels[] = { "P0", "P1", "PF", "BK", "M0", "M1", "BL", "HM" };
for(uInt32 row = 0; row <= 3; ++row)
{
ypos += lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos + 2, 2*fontWidth, fontHeight,
dbgLabels[row], kTextAlignLeft);
myFixedColors[row] = new ColorWidget(boss, nfont, xpos + 2 + t->getWidth() + 4,
ypos + 2, uInt32(1.5*lineHeight), lineHeight - 4);
myFixedColors[row]->setTarget(this);
}
xpos += t->getWidth() + myFixedColors[0]->getWidth() + 24;
ypos = 10;
for(uInt32 row = 4; row <= 7; ++row)
{
ypos += lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos + 2, 2*fontWidth, fontHeight,
dbgLabels[row], kTextAlignLeft);
myFixedColors[row] = new ColorWidget(boss, nfont, xpos + 2 + t->getWidth() + 4,
ypos + 2, uInt32(1.5*lineHeight), lineHeight - 4);
myFixedColors[row]->setTarget(this);
}
////////////////////////////
// Collision register bits
////////////////////////////
xpos += myCOLUBKColor->getWidth() + 2*fontWidth + 30; ypos -= 4*lineHeight + 5;
xpos += myFixedColors[0]->getWidth() + 2*fontWidth + 60; ypos = 10;
// Add all 15 collision bits (with labels)
uInt32 cxclrY = 0;
xpos -= 2*fontWidth + 5; ypos += lineHeight;
const char* rowLabel[] = { "P0", "P1", "M0", "M1", "BL" };
const char* colLabel[] = { "PF", "BL", "M1", "M0", "P1" };
@ -95,7 +130,12 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myCollision[idx] = new CheckboxWidget(boss, lfont, collX, collY, "");
myCollision[idx]->setTarget(this);
myCollision[idx]->setID(idx);
myCollision[idx]->setEditable(false); // TODO - enable this
myCollision[idx]->setEditable(false); // TODO - enable this?
// We need to know where the PF_BL register is, to properly position
// the CXCLR button
if(idx == kBL_PFID)
cxclrY = collY;
// Add horizontal label
uInt32 labelx = collX;
@ -114,72 +154,19 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
collY += lineHeight+3;
}
////////////////////////////
// Strobe buttons
////////////////////////////
ButtonWidget* b;
uInt32 buttonX, buttonY, buttonW;
buttonX = collX + 5*(myCollision[0]->getWidth() + 10) + 14; buttonY = ypos;
buttonW = 7 * fontWidth;
new StaticTextWidget(boss, lfont, buttonX + (2*buttonW+4 - 7*fontWidth)/2,
ypos - lineHeight, 7*fontWidth, fontHeight, "Strobes",
kTextAlignLeft);
// Clear all collision bits
buttonX = collX + 5*(myCollision[0]->getWidth() + 10) - buttonW - 10;
buttonY = lineHeight == 15 ? cxclrY : cxclrY - 4;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"WSync", kWsyncCmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"ResP0", kResP0Cmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"ResM0", kResM0Cmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"ResBL", kResBLCmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"HmClr", kHmclrCmd);
b->setTarget(this);
buttonX += buttonW + 4; buttonY = ypos;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"RSync", kRsyncCmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"ResP1", kResP1Cmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"ResM1", kResM1Cmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"HMove", kHmoveCmd);
b->setTarget(this);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"CxClr", kCxclrCmd);
"CXCLR", kCxclrCmd);
b->setTarget(this);
addFocusWidget(b);
////////////////////////////
// P0 register info
////////////////////////////
// grP0 (new)
xpos = 10; ypos = buttonY + 2*lineHeight;
xpos = 10; ypos = collY + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"P0", kTextAlignLeft);
xpos += 2*fontWidth + 5;
@ -220,6 +207,14 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myRefP0->setID(kRefP0ID);
addFocusWidget(myRefP0);
// P0 reset
xpos += myRefP0->getWidth() + 12;
buttonX = xpos;
b = new ButtonWidget(boss, lfont, xpos, ypos, buttonW, lineHeight,
"RESP0", kResP0Cmd);
b->setTarget(this);
addFocusWidget(b);
// grP0 (old)
xpos = 10 + 2*fontWidth + 5; ypos += myGRP0->getHeight() + 5;
myGRP0Old = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1);
@ -256,7 +251,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// P1 register info
////////////////////////////
// grP1 (new)
xpos = 10; ypos += 2*lineHeight;
xpos = 10; ypos += lineHeight + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"P1", kTextAlignLeft);
xpos += 2*fontWidth + 5;
@ -297,6 +292,13 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myRefP1->setID(kRefP1ID);
addFocusWidget(myRefP1);
// P1 reset
xpos += myRefP1->getWidth() + 12;
b = new ButtonWidget(boss, lfont, xpos, ypos, buttonW, lineHeight,
"RESP1", kResP1Cmd);
b->setTarget(this);
addFocusWidget(b);
// grP1 (old)
xpos = 10 + 2*fontWidth + 5; ypos += myGRP1->getHeight() + 5;
myGRP1Old = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1);
@ -333,14 +335,14 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// M0 register info
////////////////////////////
// enaM0
xpos = 10; ypos += 2*lineHeight;
xpos = 10; ypos += lineHeight + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"M0", kTextAlignLeft);
xpos += 2*fontWidth + 8;
myEnaM0 = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd);
xpos += 2*fontWidth + 5;
myEnaM0 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
myEnaM0->setTarget(this);
myEnaM0->setID(kEnaM0ID);
myEnaM0->setBackgroundColor(-1);
addFocusWidget(myEnaM0);
// posM0
@ -377,26 +379,33 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myNusizM0->setID(kNusizM0ID);
addFocusWidget(myNusizM0);
// M0 reset
// M0 reset to player 0
xpos += myNusizM0->getWidth() + 15;
myResMP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Reset", kCheckActionCmd);
"Reset to P0", kCheckActionCmd);
myResMP0->setTarget(this);
myResMP0->setID(kResMP0ID);
addFocusWidget(myResMP0);
// M0 reset
xpos = buttonX;
b = new ButtonWidget(boss, lfont, xpos, ypos, buttonW, lineHeight,
"RESM0", kResM0Cmd);
b->setTarget(this);
addFocusWidget(b);
////////////////////////////
// M1 register info
////////////////////////////
// enaM1
xpos = 10; ypos += lineHeight + 6;
xpos = 10; ypos += lineHeight + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"M1", kTextAlignLeft);
xpos += 2*fontWidth + 8;
myEnaM1 = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd);
xpos += 2*fontWidth + 5;
myEnaM1 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
myEnaM1->setTarget(this);
myEnaM1->setID(kEnaM1ID);
myEnaM1->setBackgroundColor(-1);
addFocusWidget(myEnaM1);
// posM0
@ -433,26 +442,33 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myNusizM1->setID(kNusizM1ID);
addFocusWidget(myNusizM1);
// M1 reset
// M1 reset to player 0
xpos += myNusizM1->getWidth() + 15;
myResMP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Reset", kCheckActionCmd);
"Reset to P1", kCheckActionCmd);
myResMP1->setTarget(this);
myResMP1->setID(kResMP1ID);
addFocusWidget(myResMP1);
// M1 reset
xpos = buttonX;
b = new ButtonWidget(boss, lfont, xpos, ypos, buttonW, lineHeight,
"RESM1", kResM1Cmd);
b->setTarget(this);
addFocusWidget(b);
////////////////////////////
// BL register info
////////////////////////////
// enaBL
xpos = 10; ypos += lineHeight + 6;
xpos = 10; ypos += lineHeight + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"BL", kTextAlignLeft);
xpos += 2*fontWidth + 8;
myEnaBL = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd);
xpos += 2*fontWidth + 5;
myEnaBL = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
myEnaBL->setTarget(this);
myEnaBL->setID(kEnaBLID);
myEnaBL->setBackgroundColor(-1);
addFocusWidget(myEnaBL);
// posBL
@ -489,10 +505,25 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
mySizeBL->setID(kSizeBLID);
addFocusWidget(mySizeBL);
// BL delay
xpos += mySizeBL->getWidth() + 15;
// Reset ball
xpos = buttonX;
b = new ButtonWidget(boss, lfont, xpos, ypos, buttonW, lineHeight,
"RESBL", kResBLCmd);
b->setTarget(this);
addFocusWidget(b);
// Ball (old)
xpos = 10 + 2*fontWidth + 5; ypos += myEnaBL->getHeight() + 5;
myEnaBLOld = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
myEnaBLOld->setTarget(this);
myEnaBLOld->setID(kEnaBLOldID);
myEnaBLOld->setBackgroundColor(-1);
addFocusWidget(myEnaBLOld);
// Ball delay
xpos += myEnaBLOld->getWidth() + 12;
myDelBL = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Delay", kCheckActionCmd);
"VDel", kCheckActionCmd);
myDelBL->setTarget(this);
myDelBL->setID(kDelBLID);
addFocusWidget(myDelBL);
@ -580,12 +611,40 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
xpos = 10;
ypos += 2 * lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos, 14*fontWidth, fontHeight,
"Queued Writes:", kTextAlignLeft);
t = new StaticTextWidget(boss, lfont, xpos, ypos, 13*fontWidth, fontHeight,
"Queued Writes", kTextAlignLeft);
xpos += t->getWidth() + 10;
myDelayQueueWidget = new DelayQueueWidget(boss, lfont, xpos, ypos);
////////////////////////////
// Strobe buttons
////////////////////////////
buttonX = xpos + myDelayQueueWidget->getWidth() + 20;
buttonY = ypos;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"WSYNC", kWsyncCmd);
b->setTarget(this);
addFocusWidget(b);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"RSYNC", kRsyncCmd);
b->setTarget(this);
addFocusWidget(b);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"HMOVE", kHmoveCmd);
b->setTarget(this);
addFocusWidget(b);
buttonY += lineHeight + 3;
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"HMCLR", kHmclrCmd);
b->setTarget(this);
addFocusWidget(b);
// How to handle undriven pins
xpos = 10; ypos += (myDelayQueueWidget->getHeight() + lineHeight);
myUndrivenPins = new CheckboxWidget(boss, lfont, xpos, ypos+1,
@ -642,6 +701,10 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
tia.strobeCxclr();
break;
case kDbgClCmd:
myFixedEnabled->setState(tia.tia().toggleFixedColors());
break;
case kPPinCmd:
tia.tia().driveUnusedPinsRandom(myUndrivenPins->getState());
break;
@ -740,6 +803,22 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
tia.setGRP1Old(myGRP1Old->getIntState());
break;
case kEnaM0ID:
tia.enaM0(myEnaM0->getIntState());
break;
case kEnaM1ID:
tia.enaM1(myEnaM1->getIntState());
break;
case kEnaBLID:
tia.enaBL(myEnaBL->getIntState());
break;
case kEnaBLOldID:
tia.setENABLOld(myEnaBLOld->getIntState() != 0);
break;
case kPF0ID:
tia.pf0(myPF[0]->getIntState());
break;
@ -823,10 +902,24 @@ void TiaWidget::loadConfig()
}
myColorRegs->setList(alist, vlist, changed);
bool fixed = tia.tia().usingFixedColors();
myCOLUP0Color->setColor(state.coluRegs[0]);
myCOLUP1Color->setColor(state.coluRegs[1]);
myCOLUPFColor->setColor(state.coluRegs[2]);
myCOLUBKColor->setColor(state.coluRegs[3]);
myCOLUP0Color->setCrossed(fixed);
myCOLUP1Color->setCrossed(fixed);
myCOLUPFColor->setCrossed(fixed);
myCOLUBKColor->setCrossed(fixed);
// Fixed debug colors
myFixedEnabled->setState(fixed);
for(uInt32 c = 0; c < 8; ++c)
{
myFixedColors[c]->setColor(state.fixedCols[c]);
myFixedColors[c]->setCrossed(!fixed);
}
////////////////////////////
// Collision register bits
@ -919,7 +1012,16 @@ void TiaWidget::loadConfig()
// M0 register info
////////////////////////////
// enaM0
myEnaM0->setState(tia.enaM0());
if(tia.enaM0())
{
myEnaM0->setColor(state.coluRegs[0]);
myEnaM0->setIntState(1, false);
}
else
{
myEnaM0->setColor(kBGColorLo);
myEnaM0->setIntState(0, false);
}
// posM0
myPosM0->setList(0, state.pos[M0], state.pos[M0] != oldstate.pos[M0]);
@ -937,7 +1039,16 @@ void TiaWidget::loadConfig()
// M1 register info
////////////////////////////
// enaM1
myEnaM1->setState(tia.enaM1());
if(tia.enaM1())
{
myEnaM1->setColor(state.coluRegs[1]);
myEnaM1->setIntState(1, false);
}
else
{
myEnaM1->setColor(kBGColorLo);
myEnaM1->setIntState(0, false);
}
// posM1
myPosM1->setList(0, state.pos[M1], state.pos[M1] != oldstate.pos[M1]);
@ -954,8 +1065,21 @@ void TiaWidget::loadConfig()
////////////////////////////
// BL register info
////////////////////////////
// enaBL
myEnaBL->setState(tia.enaBL());
// enaBL (new and old)
if(tia.vdelBL())
{
myEnaBL->setColor(kBGColorLo);
myEnaBLOld->setColor(state.coluRegs[2]);
myEnaBLOld->setCrossed(false);
}
else
{
myEnaBL->setColor(state.coluRegs[2]);
myEnaBLOld->setColor(kBGColorLo);
myEnaBLOld->setCrossed(true);
}
myEnaBL->setIntState(state.gr[4], false);
myEnaBLOld->setIntState(state.gr[5], false);
// posBL
myPosBL->setList(0, state.pos[BL], state.pos[BL] != oldstate.pos[BL]);

View File

@ -46,6 +46,9 @@ class TiaWidget : public Widget, public CommandSender
ColorWidget* myCOLUPFColor;
ColorWidget* myCOLUBKColor;
CheckboxWidget* myFixedEnabled;
ColorWidget* myFixedColors[8];
TogglePixelWidget* myGRP0;
TogglePixelWidget* myGRP0Old;
TogglePixelWidget* myGRP1;
@ -77,9 +80,10 @@ class TiaWidget : public Widget, public CommandSender
CheckboxWidget* myDelP1;
CheckboxWidget* myDelBL;
CheckboxWidget* myEnaM0;
CheckboxWidget* myEnaM1;
CheckboxWidget* myEnaBL;
TogglePixelWidget* myEnaM0;
TogglePixelWidget* myEnaM1;
TogglePixelWidget* myEnaBL;
TogglePixelWidget* myEnaBLOld;
CheckboxWidget* myResMP0;
CheckboxWidget* myResMP1;
@ -117,7 +121,7 @@ class TiaWidget : public Widget, public CommandSender
kDelP0ID, kDelP1ID, kDelBLID,
kNusizP0ID, kNusizP1ID,
kNusizM0ID, kNusizM1ID, kSizeBLID,
kEnaM0ID, kEnaM1ID, kEnaBLID,
kEnaM0ID, kEnaM1ID, kEnaBLID, kEnaBLOldID,
kResMP0ID, kResMP1ID,
kPF0ID, kPF1ID, kPF2ID,
kRefPFID, kScorePFID, kPriorityPFID
@ -135,6 +139,7 @@ class TiaWidget : public Widget, public CommandSender
kHmoveCmd = 'Shmv',
kHmclrCmd = 'Shmc',
kCxclrCmd = 'Scxl',
kDbgClCmd = 'DBGc',
kPPinCmd = 'PPin'
};

View File

@ -114,7 +114,7 @@ void ToggleBitWidget::drawWidget(bool hilite)
}
else
{
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kBGColorLo);
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kBGColorHi);
s.drawString(_font, buffer, x, y, _colWidth, kTextColor);
}
}

View File

@ -138,6 +138,6 @@ void TogglePixelWidget::drawWidget(bool hilite)
// Cross out the bits?
if(_crossBits)
for (row = 0; row < 4; ++row)
for(row = 1; row < 4; ++row)
s.hLine(_x, _y + (row * lineheight/4), _x + linewidth, kColor);
}

View File

@ -98,14 +98,14 @@ void CartridgeCDF::setInitialState()
for (int i=0; i < 3; ++i)
myMusicWaveformSize[i] = 27;
// CDF always starts in bank 6
myStartBank = 6;
// Assuming mode starts out with Fast Fetch off and 3-Voice music,
// need to confirm with Chris
myMode = 0xFF;
myFastJumpActive = 0;
}
@ -152,15 +152,11 @@ inline void CartridgeCDF::updateMusicModeDataFetchers()
myFractionalClocks = clocks - double(wholeClocks);
if(wholeClocks <= 0)
{
return;
}
// Let's update counters and flags of the music mode data fetchers
for(int x = 0; x <= 2; ++x)
{
myMusicCounters[x] += myMusicFrequencies[x] * wholeClocks;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -205,20 +201,20 @@ uInt8 CartridgeCDF::peek(uInt16 address)
// anything that can change the internal state of the cart
if(bankLocked())
return peekvalue;
// implement JMP FASTJMP which fetches the destination address from stream 33
if (myFastJumpActive)
{
uInt32 pointer;
uInt8 value;
myFastJumpActive--;
pointer = getDatastreamPointer(JUMPSTREAM);
value = myDisplayImage[ pointer >> 20 ];
pointer += 0x100000; // always increment by 1
setDatastreamPointer(JUMPSTREAM, pointer);
return value;
}
@ -240,13 +236,13 @@ uInt8 CartridgeCDF::peek(uInt16 address)
if (peekvalue == AMPLITUDE)
{
updateMusicModeDataFetchers();
if DIGITAL_AUDIO_ON
{
// retrieve packed sample (max size is 2K, or 4K of unpacked data)
address = getSample() + (myMusicCounters[0] >> 21);
peekvalue = myImage[address];
//
if ((myMusicCounters[0] & (1<<20)) == 0)
peekvalue >>= 4;
@ -274,44 +270,44 @@ uInt8 CartridgeCDF::peek(uInt16 address)
// Set the current bank to the first 4k bank
bank(0);
break;
case 0x0FF6:
// Set the current bank to the second 4k bank
bank(1);
break;
case 0x0FF7:
// Set the current bank to the third 4k bank
bank(2);
break;
case 0x0FF8:
// Set the current bank to the fourth 4k bank
bank(3);
break;
case 0x0FF9:
// Set the current bank to the fifth 4k bank
bank(4);
break;
case 0x0FFA:
// Set the current bank to the sixth 4k bank
bank(5);
break;
case 0x0FFB:
// Set the current bank to the last 4k bank
bank(6);
break;
default:
break;
}
if(FAST_FETCH_ON && peekvalue == 0xA9)
myLDAimmediateOperandAddress = address + 1;
return peekvalue;
}
@ -319,7 +315,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
bool CartridgeCDF::poke(uInt16 address, uInt8 value)
{
uInt32 pointer;
address &= 0x0FFF;
// Switch banks if necessary
@ -331,7 +327,7 @@ bool CartridgeCDF::poke(uInt16 address, uInt8 value)
pointer += 0x100000; // always increment by 1 when writing
setDatastreamPointer(WRITESTREAM, pointer);
break;
case 0xFF1: // DSPTR
pointer = getDatastreamPointer(WRITESTREAM);
pointer <<=8;
@ -339,50 +335,50 @@ bool CartridgeCDF::poke(uInt16 address, uInt8 value)
pointer |= (value << 20);
setDatastreamPointer(WRITESTREAM, pointer);
break;
case 0xFF2: // SETMODE
myMode = value;
break;
case 0xFF3: // CALLFN
callFunction(value);
break;
case 0xFF5:
// Set the current bank to the first 4k bank
bank(0);
break;
case 0x0FF6:
// Set the current bank to the second 4k bank
bank(1);
break;
case 0x0FF7:
// Set the current bank to the third 4k bank
bank(2);
break;
case 0x0FF8:
// Set the current bank to the fourth 4k bank
bank(3);
break;
case 0x0FF9:
// Set the current bank to the fifth 4k bank
bank(4);
break;
case 0x0FFA:
// Set the current bank to the sixth 4k bank
bank(5);
break;
case 0x0FFB:
// Set the current bank to the last 4k bank
bank(6);
break;
default:
break;
}
@ -490,13 +486,13 @@ bool CartridgeCDF::save(Serializer& out) const
// Indicates current mode
out.putByte(myMode);
// State of FastJump
out.putByte(myFastJumpActive);
// Address of LDA # operand
out.putShort(myLDAimmediateOperandAddress);
// Harmony RAM
out.putByteArray(myCDFRAM, 8192);
@ -504,7 +500,7 @@ bool CartridgeCDF::save(Serializer& out) const
out.putIntArray(myMusicCounters, 3);
out.putIntArray(myMusicFrequencies, 3);
out.putByteArray(myMusicWaveformSize, 3);
// Save cycles and clocks
out.putInt(myAudioCycles);
out.putInt((uInt32)(myFractionalClocks * 100000000.0));
@ -529,19 +525,19 @@ bool CartridgeCDF::load(Serializer& in)
// Indicates which bank is currently active
myCurrentBank = in.getShort();
// Indicates current mode
myMode = in.getByte();
// State of FastJump
myFastJumpActive = in.getByte();
// Address of LDA # operand
myLDAimmediateOperandAddress = in.getShort();
// Harmony RAM
in.getByteArray(myCDFRAM, 8192);
// Audio info
in.getIntArray(myMusicCounters, 3);
in.getIntArray(myMusicFrequencies, 3);
@ -625,12 +621,12 @@ uInt32 CartridgeCDF::getWaveform(uInt8 index) const
uInt32 CartridgeCDF::getSample()
{
uInt32 result;
result = myCDFRAM[WAVEFORM + 0] + // low byte
(myCDFRAM[WAVEFORM + 1] << 8) +
(myCDFRAM[WAVEFORM + 2] << 16) +
(myCDFRAM[WAVEFORM + 3] << 24); // high byte
return result;
}

View File

@ -258,7 +258,7 @@ class CartridgeCDF : public Cartridge
r12 = channel1 frequency
r13 = channel2 frequency
r14 = timer base */
// The music counters, ARM FIQ shadow registers r8, r9, r10
uInt32 myMusicCounters[3];
@ -282,7 +282,7 @@ class CartridgeCDF : public Cartridge
uInt16 myLDAimmediateOperandAddress;
TIA* myTIA;
uInt8 myFastJumpActive;
private:

View File

@ -885,7 +885,8 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
// Base colors
kColor Normal foreground color (non-text)
kBGColor Normal background color (non-text)
kBGColorLo Disabled background color (non-text)
kBGColorLo Disabled background color dark (non-text)
kBGColorHi Disabled background color light (non-text)
kShadowColor Item is disabled
kTextColor Normal text color
kTextColorHi Highlighted text color
@ -916,7 +917,7 @@ void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
*/
uInt32 FrameBuffer::ourGUIColors[2][kNumColors-256] = {
// Standard
{ 0x686868, 0x000000, 0xdccfa5, 0x404040, 0x000000, 0x62a108, 0x9f0000,
{ 0x686868, 0x000000, 0xa38c61, 0xdccfa5, 0x404040, 0x000000, 0x62a108, 0x9f0000,
0xc9af7c, 0xf0f0cf, 0xc80000,
0xac3410, 0xd55941, 0xffffff, 0xffd652,
0xac3410,
@ -926,7 +927,7 @@ uInt32 FrameBuffer::ourGUIColors[2][kNumColors-256] = {
},
// Classic
{ 0x686868, 0x000000, 0x404040, 0x404040, 0x20a020, 0x00ff00, 0xc80000,
{ 0x686868, 0x000000, 0x404040, 0x404040, 0x404040, 0x20a020, 0x00ff00, 0xc80000,
0x000000, 0x000000, 0xc80000,
0x000000, 0x000000, 0x20a020, 0x00ff00,
0x20a020,

View File

@ -62,6 +62,7 @@ enum {
kColor = 256,
kBGColor,
kBGColorLo,
kBGColorHi,
kShadowColor,
kTextColor,
kTextColorHi,

View File

@ -46,7 +46,7 @@ Settings::Settings(OSystem& osystem)
setInternal("uimessages", "true");
// TIA specific options
setInternal("tia.zoom", "2");
setInternal("tia.zoom", "3");
setInternal("tia.inter", "false");
setInternal("tia.aspectn", "90");
setInternal("tia.aspectp", "100");
@ -109,10 +109,10 @@ Settings::Settings(OSystem& osystem)
// ROM browser options
setInternal("exitlauncher", "false");
setInternal("launcherres", GUI::Size(640, 480));
setInternal("launcherres", GUI::Size(900, 600));
setInternal("launcherfont", "medium");
setInternal("launcherexts", "allroms");
setInternal("romviewer", "0");
setInternal("romviewer", "1");
setInternal("lastrom", "");
// UI-related options

View File

@ -872,6 +872,12 @@ bool TIA::toggleFixedColors(uInt8 mode)
return on;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::usingFixedColors() const
{
return myColorHBlank != 0x00;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::driveUnusedPinsRandom(uInt8 mode)
{

View File

@ -266,7 +266,7 @@ class TIA : public Device
bool toggleCollisions();
/**
Enables/disable/toggle 'fixed debug colors' mode.
Enables/disable/toggle/query 'fixed debug colors' mode.
@param mode 1/0 indicates on/off, otherwise flip from
its current state
@ -274,6 +274,7 @@ class TIA : public Device
@return Whether the mode was enabled or disabled
*/
bool toggleFixedColors(uInt8 mode = 2);
bool usingFixedColors() const;
/**
Enable/disable/query state of 'undriven/floating TIA pins'.
@ -366,16 +367,16 @@ class TIA : public Device
M0ColorNTSC = 0x38, // orange
P1ColorNTSC = 0x1c, // yellow
M1ColorNTSC = 0xc4, // green
BLColorNTSC = 0x9e, // blue
PFColorNTSC = 0x66, // purple
PFColorNTSC = 0x9e, // blue
BLColorNTSC = 0x66, // purple
BKColorNTSC = 0x0a, // grey
P0ColorPAL = 0x62, // red
M0ColorPAL = 0x4a, // orange
P1ColorPAL = 0x2e, // yellow
M1ColorPAL = 0x34, // green
BLColorPAL = 0xbc, // blue
PFColorPAL = 0xa6, // purple
PFColorPAL = 0xbc, // blue
BLColorPAL = 0xa6, // purple
BKColorPAL = 0x0a, // grey
HBLANKColor = 0x0e // white

View File

@ -29,10 +29,10 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConfigPathDialog::ConfigPathDialog(
OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h)
const GUI::Font& font, GuiObject* boss)
: Dialog(osystem, parent),
CommandSender(boss),
myFont(font),
myBrowser(nullptr),
myIsGlobal(boss != nullptr)
{
@ -126,9 +126,6 @@ ConfigPathDialog::ConfigPathDialog(
romButton->clearFlags(WIDGET_ENABLED);
myRomPath->setEditable(false);
}
// Create file browser dialog
myBrowser = make_ptr<BrowserDialog>(this, font, max_w, max_h);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -190,7 +187,7 @@ void ConfigPathDialog::setDefaults()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id)
int data, int id)
{
switch (cmd)
{
@ -206,31 +203,49 @@ void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kChooseRomDirCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select ROM directory:", myRomPath->getText(),
BrowserDialog::Directories, LauncherDialog::kRomDirChosenCmd);
break;
case kChooseCheatFileCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select cheat file:", myCheatFile->getText(),
BrowserDialog::FileLoad, kCheatFileChosenCmd);
break;
case kChoosePaletteFileCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select palette file:", myPaletteFile->getText(),
BrowserDialog::FileLoad, kPaletteFileChosenCmd);
break;
case kChoosePropsFileCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select properties file:", myPropsFile->getText(),
BrowserDialog::FileLoad, kPropsFileChosenCmd);
break;
case kChooseNVRamDirCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select NVRAM directory:", myNVRamPath->getText(),
BrowserDialog::Directories, kNVRamDirChosenCmd);
break;
case kChooseStateDirCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select state directory:", myStatePath->getText(),
BrowserDialog::Directories, kStateDirChosenCmd);
break;
@ -268,3 +283,15 @@ void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
break;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ConfigPathDialog::createBrowser()
{
uInt32 w = 0, h = 0;
getResizableBounds(w, h);
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_ptr<BrowserDialog>(this, myFont, w, h);
}

View File

@ -35,12 +35,12 @@ class ConfigPathDialog : public Dialog, public CommandSender
{
public:
ConfigPathDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h);
const GUI::Font& font, GuiObject* boss);
virtual ~ConfigPathDialog() = default;
private:
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
void createBrowser();
void loadConfig() override;
void saveConfig() override;
@ -61,7 +61,7 @@ class ConfigPathDialog : public Dialog, public CommandSender
kNVRamDirChosenCmd = 'LOnc' // nvram (flash/eeprom) dir changed
};
unique_ptr<BrowserDialog> myBrowser;
const GUI::Font& myFont;
// Config paths
EditTextWidget* myRomPath;
@ -71,6 +71,8 @@ class ConfigPathDialog : public Dialog, public CommandSender
EditTextWidget* myPaletteFile;
EditTextWidget* myPropsFile;
unique_ptr<BrowserDialog> myBrowser;
// Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal;

View File

@ -723,3 +723,21 @@ Widget* Dialog::TabFocus::getNewFocus()
return (currentTab < focus.size()) ? focus[currentTab].widget : nullptr;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Dialog::getResizableBounds(uInt32& w, uInt32& h) const
{
const GUI::Rect& r = instance().frameBuffer().imageRect();
if(r.width() <= FrameBuffer::kFBMinW || r.height() <= FrameBuffer::kFBMinH)
{
w = uInt32(0.8 * FrameBuffer::kTIAMinW) * 2;
h = FrameBuffer::kTIAMinH * 2;
return false;
}
else
{
w = std::max(uInt32(0.8 * r.width()), uInt32(FrameBuffer::kFBMinW));
h = std::max(uInt32(0.8 * r.height()), uInt32(FrameBuffer::kFBMinH));
return true;
}
}

View File

@ -105,6 +105,11 @@ class Dialog : public GuiObject
void processCancelWithoutWidget(bool state) { _processCancel = state; }
/** Determine the maximum bounds based on the given width and height
Returns whether or not a large font can be used within these bounds.
*/
bool getResizableBounds(uInt32& w, uInt32& h) const;
private:
void buildCurrentFocusList(int tabID = -1);
bool handleNavEvent(Event::Type e);

View File

@ -19,6 +19,7 @@
#include "Dialog.hxx"
#include "Stack.hxx"
#include "EventHandler.hxx"
#include "FrameBuffer.hxx"
#include "Joystick.hxx"
#include "bspf.hxx"
#include "DialogContainer.hxx"
@ -114,7 +115,12 @@ void DialogContainer::draw(bool full)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DialogContainer::addDialog(Dialog* d)
{
myDialogStack.push(d);
GUI::Rect r = myOSystem.frameBuffer().imageRect();
if(uInt32(d->getWidth()) > r.width() || uInt32(d->getHeight()) > r.height())
myOSystem.frameBuffer().showMessage(
"Unable to show dialog box; resize current window");
else
myDialogStack.push(d);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -72,7 +72,7 @@ void EditableWidget::setEditable(bool editable, bool hiliteBG)
else
{
clearFlags(WIDGET_WANTS_RAWDATA | WIDGET_RETAIN_FOCUS);
_bgcolor = hiliteBG ? kBGColorLo : kWidColor;
_bgcolor = hiliteBG ? kBGColorHi : kWidColor;
}
}

View File

@ -34,7 +34,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
const GUI::Font& font, int max_w, int max_h,
bool uselargefont)
: Dialog(osystem, parent),
myLogInfo(nullptr)
{
@ -51,10 +52,9 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
// Test listing of the log output
xpos = 10; ypos = 10;
myLogInfo = new StringListWidget(this, instance().frameBuffer().infoFont(),
xpos, ypos, _w - 2 * xpos,
_h - buttonHeight - ypos - 20 - 2 * lineHeight,
false);
myLogInfo = new StringListWidget(this, uselargefont ? font :
instance().frameBuffer().infoFont(), xpos, ypos, _w - 2 * xpos,
_h - buttonHeight - ypos - 20 - 2 * lineHeight, false);
myLogInfo->setEditable(false);
wid.push_back(myLogInfo);
ypos += myLogInfo->getHeight() + 8;

View File

@ -31,7 +31,8 @@ class LoggerDialog : public Dialog
{
public:
LoggerDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h);
const GUI::Font& font, int max_w, int max_h,
bool useLargeFont = true);
virtual ~LoggerDialog() = default;
private:

View File

@ -21,8 +21,6 @@
#include "bspf.hxx"
#include "Menu.hxx"
class Properties;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Menu::Menu(OSystem& osystem)
: DialogContainer(osystem)

View File

@ -120,8 +120,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
myAudioDialog = make_ptr<AudioDialog>(osystem, parent, font);
myInputDialog = make_ptr<InputDialog>(osystem, parent, font, max_w, max_h);
myUIDialog = make_ptr<UIDialog>(osystem, parent, font);
mySnapshotDialog = make_ptr<SnapshotDialog>(osystem, parent, font, boss, max_w, max_h);
myConfigPathDialog = make_ptr<ConfigPathDialog>(osystem, parent, font, boss, max_w, max_h);
mySnapshotDialog = make_ptr<SnapshotDialog>(osystem, parent, font, boss);
myConfigPathDialog = make_ptr<ConfigPathDialog>(osystem, parent, font, boss);
myRomAuditDialog = make_ptr<RomAuditDialog>(osystem, parent, font, max_w, max_h);
myGameInfoDialog = make_ptr<GameInfoDialog>(osystem, parent, font, this);
#ifdef CHEATCODE_SUPPORT
@ -211,6 +211,16 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
#endif
case kLoggerCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
if(!myIsGlobal)
{
uInt32 w = 0, h = 0;
bool uselargefont = getResizableBounds(w, h);
myLoggerDialog = make_ptr<LoggerDialog>(instance(), parent(),
instance().frameBuffer().font(), w, h, uselargefont);
}
myLoggerDialog->open();
break;

View File

@ -29,10 +29,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SnapshotDialog::SnapshotDialog(
OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h)
const GUI::Font& font, GuiObject* boss)
: Dialog(osystem, parent),
myBrowser(nullptr)
myFont(font)
{
const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(),
@ -124,9 +123,6 @@ SnapshotDialog::SnapshotDialog(
addOKCancelBGroup(wid, font);
addToFocusList(wid);
// Create file browser dialog
myBrowser = make_ptr<BrowserDialog>(this, font, max_w, max_h);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -185,11 +181,17 @@ void SnapshotDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kChooseSnapSaveDirCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select snapshot save directory:", mySnapSavePath->getText(),
BrowserDialog::Directories, kSnapSaveDirChosenCmd);
break;
case kChooseSnapLoadDirCmd:
// This dialog is resizable under certain conditions, so we need
// to re-create it as necessary
createBrowser();
myBrowser->show("Select snapshot load directory:", mySnapLoadPath->getText(),
BrowserDialog::Directories, kSnapLoadDirChosenCmd);
break;
@ -207,3 +209,15 @@ void SnapshotDialog::handleCommand(CommandSender* sender, int cmd,
break;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SnapshotDialog::createBrowser()
{
uInt32 w = 0, h = 0;
getResizableBounds(w, h);
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_ptr<BrowserDialog>(this, myFont, w, h);
}

View File

@ -35,8 +35,7 @@ class SnapshotDialog : public Dialog
{
public:
SnapshotDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss,
int max_w, int max_h);
const GUI::Font& font, GuiObject* boss);
virtual ~SnapshotDialog() = default;
private:
@ -45,6 +44,7 @@ class SnapshotDialog : public Dialog
void setDefaults() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
void createBrowser();
private:
enum {
@ -54,7 +54,7 @@ class SnapshotDialog : public Dialog
kSnapLoadDirChosenCmd = 'snlc' // snap chosen (load files)
};
unique_ptr<BrowserDialog> myBrowser;
const GUI::Font& myFont;
// Config paths
EditTextWidget* mySnapSavePath;
@ -66,6 +66,8 @@ class SnapshotDialog : public Dialog
CheckboxWidget* mySnapSingle;
CheckboxWidget* mySnap1x;
unique_ptr<BrowserDialog> myBrowser;
private:
// Following constructors and assignment operators not supported
SnapshotDialog() = delete;

View File

@ -415,7 +415,7 @@ void UIDialog::setDefaults()
{
case 0: // Launcher options
{
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, 1000u);
uInt32 w = std::min(instance().frameBuffer().desktopSize().w, 900u);
uInt32 h = std::min(instance().frameBuffer().desktopSize().h, 600u);
myLauncherWidthSlider->setValue(w);
myLauncherWidthLabel->setValue(w);

View File

@ -492,7 +492,7 @@ void CheckboxWidget::setEditable(bool editable)
}
else
{
_bgcolor = kBGColorLo;
_bgcolor = kBGColorHi;
setFill(CheckboxWidget::Inactive);
}
}