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 #define SDL_LIB_HXX
#include <SDL.h> #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 #endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,4 +55,9 @@ void ColorWidget::drawWidget(bool hilite)
// Show the currently selected color // Show the currently selected color
s.fillRect(_x+1, _y+1, _w-2, _h-1, _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); void setColor(int color);
int getColor() const { return _color; } int getColor() const { return _color; }
void setCrossed(bool enable) { _crossGrid = enable; }
protected: protected:
void drawWidget(bool hilite) override; void drawWidget(bool hilite) override;
@ -49,6 +51,8 @@ class ColorWidget : public Widget, public CommandSender
int _color; int _color;
int _cmd; int _cmd;
bool _crossGrid;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
ColorWidget() = delete; 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 // Create a 1x1 grid with label for the PC register
xpos = x; ypos = y; lwidth = 4 * fontWidth; xpos = x; ypos = y; lwidth = 4 * fontWidth;
new StaticTextWidget(boss, lfont, xpos, ypos+1, lwidth-2, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+1, lwidth-2, fontHeight,
"PC:", kTextAlignLeft); "PC ", kTextAlignLeft);
myPCGrid = myPCGrid =
new DataGridWidget(boss, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::F_16); new DataGridWidget(boss, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::F_16);
myPCGrid->setTarget(this); 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 // Add labels for other CPU registers
xpos = x; xpos = x;
string labels[4] = { "SP:", "A:", "X:", "Y:" }; string labels[4] = { "SP ", "A ", "X ", "Y " };
for(int row = 0; row < 4; ++row) for(int row = 0; row < 4; ++row)
{ {
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 1, 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 // Create a bitfield widget for changing the processor status
xpos = x; ypos += 4*lineHeight + 2; xpos = x; ypos += 4*lineHeight + 2;
new StaticTextWidget(boss, lfont, xpos, ypos+1, lwidth-2, fontHeight, 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 = new ToggleBitWidget(boss, nfont, xpos+lwidth, ypos, 8, 1);
myPSRegister->setTarget(this); myPSRegister->setTarget(this);
addFocusWidget(myPSRegister); addFocusWidget(myPSRegister);

View File

@ -639,7 +639,7 @@ void DataGridWidget::drawWidget(bool hilite)
// Cross out the grid? // Cross out the grid?
if(_crossGrid) if(_crossGrid)
for (row = 0; row < 4; ++row) for(row = 1; row < 4; ++row)
s.hLine(_x, _y + (row * lineheight/4), _x + linewidth, kColor); s.hLine(_x, _y + (row * lineheight/4), _x + linewidth, kColor);
} }

View File

@ -97,7 +97,7 @@ void DelayQueueWidget::drawWidget(bool hilite)
y += 1; y += 1;
x += 1; x += 1;
w -= 1; w -= 1;
surface.fillRect(x, y, w - 1, _h - 2, kBGColorLo); surface.fillRect(x, y, w - 1, _h - 2, kBGColorHi);
y += 2; y += 2;
x += 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 // Show current bank state
xpos = x; ypos = y + 7; xpos = x; ypos = y + 7;
t = new StaticTextWidget(boss, lfont, xpos, ypos, t = new StaticTextWidget(boss, lfont, xpos, ypos,
lfont.getStringWidth("Bank:"), lfont.getStringWidth("Bank"),
lfont.getFontHeight(), lfont.getFontHeight(),
"Bank:", kTextAlignLeft); "Bank", kTextAlignLeft);
xpos += t->getWidth() + 5; xpos += t->getWidth() + 5;
myBank = new EditTextWidget(boss, nfont, xpos, ypos-1, myBank = new EditTextWidget(boss, nfont, xpos, ypos-1,

View File

@ -38,12 +38,12 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
x += 5; x += 5;
const int lineHeight = lfont.getLineHeight(); const int lineHeight = lfont.getLineHeight();
int xpos = x, ypos = y + 10; 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; int fwidth = 5 * lfont.getMaxCharWidth() + 4;
// Add frame info // Add frame info
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Frame Count:" : "Frame:", longstr ? "Frame Count " : "Frame ",
kTextAlignLeft); kTextAlignLeft);
xpos += lwidth; xpos += lwidth;
myFrameCount = new EditTextWidget(boss, nfont, xpos, ypos-1, fwidth, lineHeight, ""); 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; xpos = x; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Frame Cycle:" : "F. Cycle:", longstr ? "Frame Cycle " : "F. Cycle ",
kTextAlignLeft); kTextAlignLeft);
xpos += lwidth; xpos += lwidth;
myFrameCycles = new EditTextWidget(boss, nfont, xpos, ypos-1, fwidth, lineHeight, ""); 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); myVBlank->setEditable(false);
xpos = x + lwidth + myFrameCycles->getWidth() + 8; ypos = y + 10; 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; fwidth = 3 * lfont.getMaxCharWidth() + 4;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
"Scanline:", kTextAlignLeft); "Scanline ", kTextAlignLeft);
myScanlineCount = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth, myScanlineCount = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, ""); lineHeight, "");
@ -77,7 +77,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, 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, myScanlineCycles = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, ""); lineHeight, "");
@ -85,7 +85,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
"Pixel Pos:", kTextAlignLeft); "Pixel Pos ", kTextAlignLeft);
myPixelPosition = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth, myPixelPosition = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, ""); lineHeight, "");
@ -93,7 +93,7 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
ypos += lineHeight + 5; ypos += lineHeight + 5;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, 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, myColorClocks = new EditTextWidget(boss, nfont, xpos+lwidth, ypos-1, fwidth,
lineHeight, ""); 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 breakpoint", "bp");
VarList::push_back(l, "Set zoom position", "zoom"); VarList::push_back(l, "Set zoom position", "zoom");
VarList::push_back(l, "Save snapshot", "snap"); 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); 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"); instance().debugger().parser().run("savesnap");
} }
else if(rmb == "fixed")
{
instance().console().tia().toggleFixedColors();
}
break; break;
} }
} }

View File

@ -39,18 +39,20 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
{ {
const int fontWidth = lfont.getMaxCharWidth(), const int fontWidth = lfont.getMaxCharWidth(),
fontHeight = lfont.getFontHeight(), fontHeight = lfont.getFontHeight(),
lineHeight = lfont.getLineHeight(); lineHeight = lfont.getLineHeight(),
int xpos = 10, ypos = 15 + lineHeight; buttonW = 7 * fontWidth;
int xpos = 10, ypos = 10 + lineHeight, buttonX = 0, buttonY = 0;
StaticTextWidget* t = nullptr; StaticTextWidget* t = nullptr;
ButtonWidget* b = nullptr;
// Color registers // Color registers
const char* regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" }; const char* regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" };
for(int row = 0; row < 4; ++row) for(int row = 0; row < 4; ++row)
{ {
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2, 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, myColorRegs = new DataGridWidget(boss, nfont, xpos, ypos,
1, 4, 2, 8, Common::Base::F_16); 1, 4, 2, 8, Common::Base::F_16);
myColorRegs->setTarget(this); myColorRegs->setTarget(this);
@ -58,27 +60,60 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
addFocusWidget(myColorRegs); addFocusWidget(myColorRegs);
xpos += myColorRegs->colWidth() + 5; 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); myCOLUP0Color->setTarget(this);
ypos += lineHeight; 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); myCOLUP1Color->setTarget(this);
ypos += lineHeight; 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); myCOLUPFColor->setTarget(this);
ypos += lineHeight; 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); 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 // 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) // Add all 15 collision bits (with labels)
uInt32 cxclrY = 0;
xpos -= 2*fontWidth + 5; ypos += lineHeight; xpos -= 2*fontWidth + 5; ypos += lineHeight;
const char* rowLabel[] = { "P0", "P1", "M0", "M1", "BL" }; const char* rowLabel[] = { "P0", "P1", "M0", "M1", "BL" };
const char* colLabel[] = { "PF", "BL", "M1", "M0", "P1" }; 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] = new CheckboxWidget(boss, lfont, collX, collY, "");
myCollision[idx]->setTarget(this); myCollision[idx]->setTarget(this);
myCollision[idx]->setID(idx); 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 // Add horizontal label
uInt32 labelx = collX; uInt32 labelx = collX;
@ -114,72 +154,19 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
collY += lineHeight+3; collY += lineHeight+3;
} }
//////////////////////////// // Clear all collision bits
// Strobe buttons buttonX = collX + 5*(myCollision[0]->getWidth() + 10) - buttonW - 10;
//////////////////////////// buttonY = lineHeight == 15 ? cxclrY : cxclrY - 4;
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);
b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight, b = new ButtonWidget(boss, lfont, buttonX, buttonY, buttonW, lineHeight,
"WSync", kWsyncCmd); "CXCLR", kCxclrCmd);
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);
b->setTarget(this); b->setTarget(this);
addFocusWidget(b);
//////////////////////////// ////////////////////////////
// P0 register info // P0 register info
//////////////////////////// ////////////////////////////
// grP0 (new) // grP0 (new)
xpos = 10; ypos = buttonY + 2*lineHeight; xpos = 10; ypos = collY + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"P0", kTextAlignLeft); "P0", kTextAlignLeft);
xpos += 2*fontWidth + 5; xpos += 2*fontWidth + 5;
@ -220,6 +207,14 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myRefP0->setID(kRefP0ID); myRefP0->setID(kRefP0ID);
addFocusWidget(myRefP0); 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) // grP0 (old)
xpos = 10 + 2*fontWidth + 5; ypos += myGRP0->getHeight() + 5; xpos = 10 + 2*fontWidth + 5; ypos += myGRP0->getHeight() + 5;
myGRP0Old = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); 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 // P1 register info
//////////////////////////// ////////////////////////////
// grP1 (new) // grP1 (new)
xpos = 10; ypos += 2*lineHeight; xpos = 10; ypos += lineHeight + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"P1", kTextAlignLeft); "P1", kTextAlignLeft);
xpos += 2*fontWidth + 5; xpos += 2*fontWidth + 5;
@ -297,6 +292,13 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myRefP1->setID(kRefP1ID); myRefP1->setID(kRefP1ID);
addFocusWidget(myRefP1); 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) // grP1 (old)
xpos = 10 + 2*fontWidth + 5; ypos += myGRP1->getHeight() + 5; xpos = 10 + 2*fontWidth + 5; ypos += myGRP1->getHeight() + 5;
myGRP1Old = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); 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 // M0 register info
//////////////////////////// ////////////////////////////
// enaM0 // enaM0
xpos = 10; ypos += 2*lineHeight; xpos = 10; ypos += lineHeight + 12;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"M0", kTextAlignLeft); "M0", kTextAlignLeft);
xpos += 2*fontWidth + 8; xpos += 2*fontWidth + 5;
myEnaM0 = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaM0 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
"Enable", kCheckActionCmd);
myEnaM0->setTarget(this); myEnaM0->setTarget(this);
myEnaM0->setID(kEnaM0ID); myEnaM0->setID(kEnaM0ID);
myEnaM0->setBackgroundColor(-1);
addFocusWidget(myEnaM0); addFocusWidget(myEnaM0);
// posM0 // posM0
@ -377,26 +379,33 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myNusizM0->setID(kNusizM0ID); myNusizM0->setID(kNusizM0ID);
addFocusWidget(myNusizM0); addFocusWidget(myNusizM0);
// M0 reset // M0 reset to player 0
xpos += myNusizM0->getWidth() + 15; xpos += myNusizM0->getWidth() + 15;
myResMP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1, myResMP0 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Reset", kCheckActionCmd); "Reset to P0", kCheckActionCmd);
myResMP0->setTarget(this); myResMP0->setTarget(this);
myResMP0->setID(kResMP0ID); myResMP0->setID(kResMP0ID);
addFocusWidget(myResMP0); 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 // M1 register info
//////////////////////////// ////////////////////////////
// enaM1 // enaM1
xpos = 10; ypos += lineHeight + 6; xpos = 10; ypos += lineHeight + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"M1", kTextAlignLeft); "M1", kTextAlignLeft);
xpos += 2*fontWidth + 8; xpos += 2*fontWidth + 5;
myEnaM1 = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaM1 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
"Enable", kCheckActionCmd);
myEnaM1->setTarget(this); myEnaM1->setTarget(this);
myEnaM1->setID(kEnaM1ID); myEnaM1->setID(kEnaM1ID);
myEnaM1->setBackgroundColor(-1);
addFocusWidget(myEnaM1); addFocusWidget(myEnaM1);
// posM0 // posM0
@ -433,26 +442,33 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
myNusizM1->setID(kNusizM1ID); myNusizM1->setID(kNusizM1ID);
addFocusWidget(myNusizM1); addFocusWidget(myNusizM1);
// M1 reset // M1 reset to player 0
xpos += myNusizM1->getWidth() + 15; xpos += myNusizM1->getWidth() + 15;
myResMP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1, myResMP1 = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Reset", kCheckActionCmd); "Reset to P1", kCheckActionCmd);
myResMP1->setTarget(this); myResMP1->setTarget(this);
myResMP1->setID(kResMP1ID); myResMP1->setID(kResMP1ID);
addFocusWidget(myResMP1); 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 // BL register info
//////////////////////////// ////////////////////////////
// enaBL // enaBL
xpos = 10; ypos += lineHeight + 6; xpos = 10; ypos += lineHeight + 4;
new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 2*fontWidth, fontHeight,
"BL", kTextAlignLeft); "BL", kTextAlignLeft);
xpos += 2*fontWidth + 8; xpos += 2*fontWidth + 5;
myEnaBL = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaBL = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 1, 1);
"Enable", kCheckActionCmd);
myEnaBL->setTarget(this); myEnaBL->setTarget(this);
myEnaBL->setID(kEnaBLID); myEnaBL->setID(kEnaBLID);
myEnaBL->setBackgroundColor(-1);
addFocusWidget(myEnaBL); addFocusWidget(myEnaBL);
// posBL // posBL
@ -489,10 +505,25 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
mySizeBL->setID(kSizeBLID); mySizeBL->setID(kSizeBLID);
addFocusWidget(mySizeBL); addFocusWidget(mySizeBL);
// BL delay // Reset ball
xpos += mySizeBL->getWidth() + 15; 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, myDelBL = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Delay", kCheckActionCmd); "VDel", kCheckActionCmd);
myDelBL->setTarget(this); myDelBL->setTarget(this);
myDelBL->setID(kDelBLID); myDelBL->setID(kDelBLID);
addFocusWidget(myDelBL); addFocusWidget(myDelBL);
@ -580,12 +611,40 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
xpos = 10; xpos = 10;
ypos += 2 * lineHeight; ypos += 2 * lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos, 14*fontWidth, fontHeight, t = new StaticTextWidget(boss, lfont, xpos, ypos, 13*fontWidth, fontHeight,
"Queued Writes:", kTextAlignLeft); "Queued Writes", kTextAlignLeft);
xpos += t->getWidth() + 10; xpos += t->getWidth() + 10;
myDelayQueueWidget = new DelayQueueWidget(boss, lfont, xpos, ypos); 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 // How to handle undriven pins
xpos = 10; ypos += (myDelayQueueWidget->getHeight() + lineHeight); xpos = 10; ypos += (myDelayQueueWidget->getHeight() + lineHeight);
myUndrivenPins = new CheckboxWidget(boss, lfont, xpos, ypos+1, 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(); tia.strobeCxclr();
break; break;
case kDbgClCmd:
myFixedEnabled->setState(tia.tia().toggleFixedColors());
break;
case kPPinCmd: case kPPinCmd:
tia.tia().driveUnusedPinsRandom(myUndrivenPins->getState()); tia.tia().driveUnusedPinsRandom(myUndrivenPins->getState());
break; break;
@ -740,6 +803,22 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
tia.setGRP1Old(myGRP1Old->getIntState()); tia.setGRP1Old(myGRP1Old->getIntState());
break; 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: case kPF0ID:
tia.pf0(myPF[0]->getIntState()); tia.pf0(myPF[0]->getIntState());
break; break;
@ -823,10 +902,24 @@ void TiaWidget::loadConfig()
} }
myColorRegs->setList(alist, vlist, changed); myColorRegs->setList(alist, vlist, changed);
bool fixed = tia.tia().usingFixedColors();
myCOLUP0Color->setColor(state.coluRegs[0]); myCOLUP0Color->setColor(state.coluRegs[0]);
myCOLUP1Color->setColor(state.coluRegs[1]); myCOLUP1Color->setColor(state.coluRegs[1]);
myCOLUPFColor->setColor(state.coluRegs[2]); myCOLUPFColor->setColor(state.coluRegs[2]);
myCOLUBKColor->setColor(state.coluRegs[3]); 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 // Collision register bits
@ -919,7 +1012,16 @@ void TiaWidget::loadConfig()
// M0 register info // M0 register info
//////////////////////////// ////////////////////////////
// enaM0 // 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 // posM0
myPosM0->setList(0, state.pos[M0], state.pos[M0] != oldstate.pos[M0]); myPosM0->setList(0, state.pos[M0], state.pos[M0] != oldstate.pos[M0]);
@ -937,7 +1039,16 @@ void TiaWidget::loadConfig()
// M1 register info // M1 register info
//////////////////////////// ////////////////////////////
// enaM1 // 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 // posM1
myPosM1->setList(0, state.pos[M1], state.pos[M1] != oldstate.pos[M1]); myPosM1->setList(0, state.pos[M1], state.pos[M1] != oldstate.pos[M1]);
@ -954,8 +1065,21 @@ void TiaWidget::loadConfig()
//////////////////////////// ////////////////////////////
// BL register info // BL register info
//////////////////////////// ////////////////////////////
// enaBL // enaBL (new and old)
myEnaBL->setState(tia.enaBL()); 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 // posBL
myPosBL->setList(0, state.pos[BL], state.pos[BL] != oldstate.pos[BL]); 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* myCOLUPFColor;
ColorWidget* myCOLUBKColor; ColorWidget* myCOLUBKColor;
CheckboxWidget* myFixedEnabled;
ColorWidget* myFixedColors[8];
TogglePixelWidget* myGRP0; TogglePixelWidget* myGRP0;
TogglePixelWidget* myGRP0Old; TogglePixelWidget* myGRP0Old;
TogglePixelWidget* myGRP1; TogglePixelWidget* myGRP1;
@ -77,9 +80,10 @@ class TiaWidget : public Widget, public CommandSender
CheckboxWidget* myDelP1; CheckboxWidget* myDelP1;
CheckboxWidget* myDelBL; CheckboxWidget* myDelBL;
CheckboxWidget* myEnaM0; TogglePixelWidget* myEnaM0;
CheckboxWidget* myEnaM1; TogglePixelWidget* myEnaM1;
CheckboxWidget* myEnaBL; TogglePixelWidget* myEnaBL;
TogglePixelWidget* myEnaBLOld;
CheckboxWidget* myResMP0; CheckboxWidget* myResMP0;
CheckboxWidget* myResMP1; CheckboxWidget* myResMP1;
@ -117,7 +121,7 @@ class TiaWidget : public Widget, public CommandSender
kDelP0ID, kDelP1ID, kDelBLID, kDelP0ID, kDelP1ID, kDelBLID,
kNusizP0ID, kNusizP1ID, kNusizP0ID, kNusizP1ID,
kNusizM0ID, kNusizM1ID, kSizeBLID, kNusizM0ID, kNusizM1ID, kSizeBLID,
kEnaM0ID, kEnaM1ID, kEnaBLID, kEnaM0ID, kEnaM1ID, kEnaBLID, kEnaBLOldID,
kResMP0ID, kResMP1ID, kResMP0ID, kResMP1ID,
kPF0ID, kPF1ID, kPF2ID, kPF0ID, kPF1ID, kPF2ID,
kRefPFID, kScorePFID, kPriorityPFID kRefPFID, kScorePFID, kPriorityPFID
@ -135,6 +139,7 @@ class TiaWidget : public Widget, public CommandSender
kHmoveCmd = 'Shmv', kHmoveCmd = 'Shmv',
kHmclrCmd = 'Shmc', kHmclrCmd = 'Shmc',
kCxclrCmd = 'Scxl', kCxclrCmd = 'Scxl',
kDbgClCmd = 'DBGc',
kPPinCmd = 'PPin' kPPinCmd = 'PPin'
}; };

View File

@ -114,7 +114,7 @@ void ToggleBitWidget::drawWidget(bool hilite)
} }
else 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); s.drawString(_font, buffer, x, y, _colWidth, kTextColor);
} }
} }

View File

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

View File

@ -152,16 +152,12 @@ inline void CartridgeCDF::updateMusicModeDataFetchers()
myFractionalClocks = clocks - double(wholeClocks); myFractionalClocks = clocks - double(wholeClocks);
if(wholeClocks <= 0) if(wholeClocks <= 0)
{
return; return;
}
// Let's update counters and flags of the music mode data fetchers // Let's update counters and flags of the music mode data fetchers
for(int x = 0; x <= 2; ++x) for(int x = 0; x <= 2; ++x)
{
myMusicCounters[x] += myMusicFrequencies[x] * wholeClocks; myMusicCounters[x] += myMusicFrequencies[x] * wholeClocks;
} }
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline void CartridgeCDF::callFunction(uInt8 value) inline void CartridgeCDF::callFunction(uInt8 value)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,10 +29,10 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConfigPathDialog::ConfigPathDialog( ConfigPathDialog::ConfigPathDialog(
OSystem& osystem, DialogContainer& parent, OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss)
int max_w, int max_h)
: Dialog(osystem, parent), : Dialog(osystem, parent),
CommandSender(boss), CommandSender(boss),
myFont(font),
myBrowser(nullptr), myBrowser(nullptr),
myIsGlobal(boss != nullptr) myIsGlobal(boss != nullptr)
{ {
@ -126,9 +126,6 @@ ConfigPathDialog::ConfigPathDialog(
romButton->clearFlags(WIDGET_ENABLED); romButton->clearFlags(WIDGET_ENABLED);
myRomPath->setEditable(false); myRomPath->setEditable(false);
} }
// Create file browser dialog
myBrowser = make_ptr<BrowserDialog>(this, font, max_w, max_h);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -206,31 +203,49 @@ void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
break; break;
case kChooseRomDirCmd: 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(), myBrowser->show("Select ROM directory:", myRomPath->getText(),
BrowserDialog::Directories, LauncherDialog::kRomDirChosenCmd); BrowserDialog::Directories, LauncherDialog::kRomDirChosenCmd);
break; break;
case kChooseCheatFileCmd: 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(), myBrowser->show("Select cheat file:", myCheatFile->getText(),
BrowserDialog::FileLoad, kCheatFileChosenCmd); BrowserDialog::FileLoad, kCheatFileChosenCmd);
break; break;
case kChoosePaletteFileCmd: 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(), myBrowser->show("Select palette file:", myPaletteFile->getText(),
BrowserDialog::FileLoad, kPaletteFileChosenCmd); BrowserDialog::FileLoad, kPaletteFileChosenCmd);
break; break;
case kChoosePropsFileCmd: 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(), myBrowser->show("Select properties file:", myPropsFile->getText(),
BrowserDialog::FileLoad, kPropsFileChosenCmd); BrowserDialog::FileLoad, kPropsFileChosenCmd);
break; break;
case kChooseNVRamDirCmd: 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(), myBrowser->show("Select NVRAM directory:", myNVRamPath->getText(),
BrowserDialog::Directories, kNVRamDirChosenCmd); BrowserDialog::Directories, kNVRamDirChosenCmd);
break; break;
case kChooseStateDirCmd: 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(), myBrowser->show("Select state directory:", myStatePath->getText(),
BrowserDialog::Directories, kStateDirChosenCmd); BrowserDialog::Directories, kStateDirChosenCmd);
break; break;
@ -268,3 +283,15 @@ void ConfigPathDialog::handleCommand(CommandSender* sender, int cmd,
break; 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: public:
ConfigPathDialog(OSystem& osystem, DialogContainer& parent, ConfigPathDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss);
int max_w, int max_h);
virtual ~ConfigPathDialog() = default; virtual ~ConfigPathDialog() = default;
private: private:
void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
void createBrowser();
void loadConfig() override; void loadConfig() override;
void saveConfig() override; void saveConfig() override;
@ -61,7 +61,7 @@ class ConfigPathDialog : public Dialog, public CommandSender
kNVRamDirChosenCmd = 'LOnc' // nvram (flash/eeprom) dir changed kNVRamDirChosenCmd = 'LOnc' // nvram (flash/eeprom) dir changed
}; };
unique_ptr<BrowserDialog> myBrowser; const GUI::Font& myFont;
// Config paths // Config paths
EditTextWidget* myRomPath; EditTextWidget* myRomPath;
@ -71,6 +71,8 @@ class ConfigPathDialog : public Dialog, public CommandSender
EditTextWidget* myPaletteFile; EditTextWidget* myPaletteFile;
EditTextWidget* myPropsFile; EditTextWidget* myPropsFile;
unique_ptr<BrowserDialog> myBrowser;
// Indicates if this dialog is used for global (vs. in-game) settings // Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal; bool myIsGlobal;

View File

@ -723,3 +723,21 @@ Widget* Dialog::TabFocus::getNewFocus()
return (currentTab < focus.size()) ? focus[currentTab].widget : nullptr; 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; } 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: private:
void buildCurrentFocusList(int tabID = -1); void buildCurrentFocusList(int tabID = -1);
bool handleNavEvent(Event::Type e); bool handleNavEvent(Event::Type e);

View File

@ -19,6 +19,7 @@
#include "Dialog.hxx" #include "Dialog.hxx"
#include "Stack.hxx" #include "Stack.hxx"
#include "EventHandler.hxx" #include "EventHandler.hxx"
#include "FrameBuffer.hxx"
#include "Joystick.hxx" #include "Joystick.hxx"
#include "bspf.hxx" #include "bspf.hxx"
#include "DialogContainer.hxx" #include "DialogContainer.hxx"
@ -114,6 +115,11 @@ void DialogContainer::draw(bool full)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DialogContainer::addDialog(Dialog* d) void DialogContainer::addDialog(Dialog* 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); myDialogStack.push(d);
} }

View File

@ -72,7 +72,7 @@ void EditableWidget::setEditable(bool editable, bool hiliteBG)
else else
{ {
clearFlags(WIDGET_WANTS_RAWDATA | WIDGET_RETAIN_FOCUS); 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, 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), : Dialog(osystem, parent),
myLogInfo(nullptr) myLogInfo(nullptr)
{ {
@ -51,10 +52,9 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent,
// Test listing of the log output // Test listing of the log output
xpos = 10; ypos = 10; xpos = 10; ypos = 10;
myLogInfo = new StringListWidget(this, instance().frameBuffer().infoFont(), myLogInfo = new StringListWidget(this, uselargefont ? font :
xpos, ypos, _w - 2 * xpos, instance().frameBuffer().infoFont(), xpos, ypos, _w - 2 * xpos,
_h - buttonHeight - ypos - 20 - 2 * lineHeight, _h - buttonHeight - ypos - 20 - 2 * lineHeight, false);
false);
myLogInfo->setEditable(false); myLogInfo->setEditable(false);
wid.push_back(myLogInfo); wid.push_back(myLogInfo);
ypos += myLogInfo->getHeight() + 8; ypos += myLogInfo->getHeight() + 8;

View File

@ -31,7 +31,8 @@ class LoggerDialog : public Dialog
{ {
public: public:
LoggerDialog(OSystem& osystem, DialogContainer& parent, 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; virtual ~LoggerDialog() = default;
private: private:

View File

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

View File

@ -120,8 +120,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
myAudioDialog = make_ptr<AudioDialog>(osystem, parent, font); myAudioDialog = make_ptr<AudioDialog>(osystem, parent, font);
myInputDialog = make_ptr<InputDialog>(osystem, parent, font, max_w, max_h); myInputDialog = make_ptr<InputDialog>(osystem, parent, font, max_w, max_h);
myUIDialog = make_ptr<UIDialog>(osystem, parent, font); myUIDialog = make_ptr<UIDialog>(osystem, parent, font);
mySnapshotDialog = make_ptr<SnapshotDialog>(osystem, parent, font, boss, max_w, max_h); mySnapshotDialog = make_ptr<SnapshotDialog>(osystem, parent, font, boss);
myConfigPathDialog = make_ptr<ConfigPathDialog>(osystem, parent, font, boss, max_w, max_h); myConfigPathDialog = make_ptr<ConfigPathDialog>(osystem, parent, font, boss);
myRomAuditDialog = make_ptr<RomAuditDialog>(osystem, parent, font, max_w, max_h); myRomAuditDialog = make_ptr<RomAuditDialog>(osystem, parent, font, max_w, max_h);
myGameInfoDialog = make_ptr<GameInfoDialog>(osystem, parent, font, this); myGameInfoDialog = make_ptr<GameInfoDialog>(osystem, parent, font, this);
#ifdef CHEATCODE_SUPPORT #ifdef CHEATCODE_SUPPORT
@ -211,6 +211,16 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
#endif #endif
case kLoggerCmd: 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(); myLoggerDialog->open();
break; break;

View File

@ -29,10 +29,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SnapshotDialog::SnapshotDialog( SnapshotDialog::SnapshotDialog(
OSystem& osystem, DialogContainer& parent, OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss)
int max_w, int max_h)
: Dialog(osystem, parent), : Dialog(osystem, parent),
myBrowser(nullptr) myFont(font)
{ {
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(), fontWidth = font.getMaxCharWidth(),
@ -124,9 +123,6 @@ SnapshotDialog::SnapshotDialog(
addOKCancelBGroup(wid, font); addOKCancelBGroup(wid, font);
addToFocusList(wid); 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; break;
case kChooseSnapSaveDirCmd: 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(), myBrowser->show("Select snapshot save directory:", mySnapSavePath->getText(),
BrowserDialog::Directories, kSnapSaveDirChosenCmd); BrowserDialog::Directories, kSnapSaveDirChosenCmd);
break; break;
case kChooseSnapLoadDirCmd: 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(), myBrowser->show("Select snapshot load directory:", mySnapLoadPath->getText(),
BrowserDialog::Directories, kSnapLoadDirChosenCmd); BrowserDialog::Directories, kSnapLoadDirChosenCmd);
break; break;
@ -207,3 +209,15 @@ void SnapshotDialog::handleCommand(CommandSender* sender, int cmd,
break; 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: public:
SnapshotDialog(OSystem& osystem, DialogContainer& parent, SnapshotDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss, const GUI::Font& font, GuiObject* boss);
int max_w, int max_h);
virtual ~SnapshotDialog() = default; virtual ~SnapshotDialog() = default;
private: private:
@ -45,6 +44,7 @@ class SnapshotDialog : public Dialog
void setDefaults() override; void setDefaults() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override; void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
void createBrowser();
private: private:
enum { enum {
@ -54,7 +54,7 @@ class SnapshotDialog : public Dialog
kSnapLoadDirChosenCmd = 'snlc' // snap chosen (load files) kSnapLoadDirChosenCmd = 'snlc' // snap chosen (load files)
}; };
unique_ptr<BrowserDialog> myBrowser; const GUI::Font& myFont;
// Config paths // Config paths
EditTextWidget* mySnapSavePath; EditTextWidget* mySnapSavePath;
@ -66,6 +66,8 @@ class SnapshotDialog : public Dialog
CheckboxWidget* mySnapSingle; CheckboxWidget* mySnapSingle;
CheckboxWidget* mySnap1x; CheckboxWidget* mySnap1x;
unique_ptr<BrowserDialog> myBrowser;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
SnapshotDialog() = delete; SnapshotDialog() = delete;

View File

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

View File

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