mirror of https://github.com/stella-emu/stella.git
Introduced 'tia.dbgcolors' commandline argument, which allows to set
the fixed debug colors to user-defined preferences. Note that there are 6 registers (P0,M0,P1,M1,PF,BL), and the option takes a string of 6 characters, where each represents a colour for the respective positional register (ROYGBP are the choices). I may add a UI item for this, but this is as far as I will go with allowing user editing.
This commit is contained in:
parent
bd78683274
commit
2e776b05b8
|
@ -20,6 +20,10 @@
|
||||||
- RSYNC
|
- RSYNC
|
||||||
- YStart autodetection
|
- YStart autodetection
|
||||||
- Proper emulation of RDY during write cycles (WSYNC).
|
- Proper emulation of RDY during write cycles (WSYNC).
|
||||||
|
- Fixed debug colors can now be set for each graphical object, from a
|
||||||
|
choice of 'red', 'orange', 'yellow', 'green', 'blue' and 'purple'.
|
||||||
|
This is accessible through the new 'tia.dbgcolors' commandline
|
||||||
|
argument.
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
* Implemented new phosphor emulation mode, which is much closer to real
|
* Implemented new phosphor emulation mode, which is much closer to real
|
||||||
|
|
|
@ -52,29 +52,16 @@ const DebuggerState& TIADebug::getState()
|
||||||
myState.coluRegs.push_back(coluBK());
|
myState.coluRegs.push_back(coluBK());
|
||||||
|
|
||||||
// Debug Colors
|
// Debug Colors
|
||||||
|
int mode = myTIA.myFrameManager.layout() == FrameLayout::ntsc ? 0 : 1;
|
||||||
myState.fixedCols.clear();
|
myState.fixedCols.clear();
|
||||||
if(myTIA.myFrameManager.layout() == FrameLayout::ntsc)
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::P0]);
|
||||||
{
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::P1]);
|
||||||
myState.fixedCols.push_back(myTIA.P0ColorNTSC);
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::PF]);
|
||||||
myState.fixedCols.push_back(myTIA.P1ColorNTSC);
|
myState.fixedCols.push_back(TIA::FixedColor::BK_GREY);
|
||||||
myState.fixedCols.push_back(myTIA.PFColorNTSC);
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::M0]);
|
||||||
myState.fixedCols.push_back(myTIA.BKColorNTSC);
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::M1]);
|
||||||
myState.fixedCols.push_back(myTIA.M0ColorNTSC);
|
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::BL]);
|
||||||
myState.fixedCols.push_back(myTIA.M1ColorNTSC);
|
myState.fixedCols.push_back(TIA::FixedColor::HBLANK_WHITE);
|
||||||
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
|
// Player 0 & 1 and Ball graphics registers
|
||||||
myState.gr.clear();
|
myState.gr.clear();
|
||||||
|
@ -758,7 +745,7 @@ string TIADebug::colorSwatch(uInt8 c) const
|
||||||
|
|
||||||
ret += char((c >> 1) | 0x80);
|
ret += char((c >> 1) | 0x80);
|
||||||
ret += "\177 ";
|
ret += "\177 ";
|
||||||
ret += "\177\003 ";
|
ret += "\177\001 ";
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -804,28 +791,24 @@ string TIADebug::debugColors() const
|
||||||
{
|
{
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
|
|
||||||
if(myTIA.myFrameManager.layout() == FrameLayout::ntsc)
|
int mode = myTIA.myFrameManager.layout() == FrameLayout::ntsc ? 0 : 1;
|
||||||
{
|
buf << " Red " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::P0])
|
||||||
buf << " Red " << colorSwatch(myTIA.P0ColorNTSC) << " Player 0\n"
|
<< " Player 0\n"
|
||||||
<< " Orange " << colorSwatch(myTIA.M0ColorNTSC) << " Missile 0\n"
|
<< " Orange " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::M0])
|
||||||
<< " Yellow " << colorSwatch(myTIA.P1ColorNTSC) << " Player 1\n"
|
<< " Missile 0\n"
|
||||||
<< " Green " << colorSwatch(myTIA.M1ColorNTSC) << " Missile 1\n"
|
<< " Yellow " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::P1])
|
||||||
<< " Blue " << colorSwatch(myTIA.PFColorNTSC) << " Playfield\n"
|
<< " Player 1\n"
|
||||||
<< " Purple " << colorSwatch(myTIA.BLColorNTSC) << " Ball\n"
|
<< " Green " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::M1])
|
||||||
<< " Grey " << colorSwatch(myTIA.BKColorNTSC) << " Background\n"
|
<< " Missile 1\n"
|
||||||
<< " White " << colorSwatch(myTIA.HBLANKColor) << " HMOVE\n";
|
<< " Blue " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::PF])
|
||||||
}
|
<< " Playfield\n"
|
||||||
else
|
<< " Purple " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::BL])
|
||||||
{
|
<< " Ball\n"
|
||||||
buf << " Red " << colorSwatch(myTIA.P0ColorPAL) << " Player 0\n"
|
<< " Grey " << colorSwatch(TIA::FixedColor::BK_GREY)
|
||||||
<< " Orange " << colorSwatch(myTIA.M0ColorPAL) << " Missile 0\n"
|
<< " Background\n"
|
||||||
<< " Yellow " << colorSwatch(myTIA.P1ColorPAL) << " Player 1\n"
|
<< " White " << colorSwatch(TIA::FixedColor::HBLANK_WHITE)
|
||||||
<< " Green " << colorSwatch(myTIA.M1ColorPAL) << " Missile 1\n"
|
<< " HMOVE\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";
|
|
||||||
}
|
|
||||||
return buf.str();
|
return buf.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ Settings::Settings(OSystem& osystem)
|
||||||
setInternal("tia.aspectn", "90");
|
setInternal("tia.aspectn", "90");
|
||||||
setInternal("tia.aspectp", "100");
|
setInternal("tia.aspectp", "100");
|
||||||
setInternal("tia.fsfill", "false");
|
setInternal("tia.fsfill", "false");
|
||||||
|
setInternal("tia.dbgcolors", "roygpb");
|
||||||
|
|
||||||
// TV filtering options
|
// TV filtering options
|
||||||
setInternal("tv.filter", "0");
|
setInternal("tv.filter", "0");
|
||||||
|
@ -273,6 +274,10 @@ void Settings::validate()
|
||||||
i = getInt("tia.aspectp");
|
i = getInt("tia.aspectp");
|
||||||
if(i < 80 || i > 120) setInternal("tia.aspectp", "100");
|
if(i < 80 || i > 120) setInternal("tia.aspectp", "100");
|
||||||
|
|
||||||
|
s = getString("tia.dbgcolors");
|
||||||
|
sort(s.begin(), s.end());
|
||||||
|
if(s != "bgopry") setInternal("tia.dbgcolors", "roygpb");
|
||||||
|
|
||||||
i = getInt("tv.filter");
|
i = getInt("tv.filter");
|
||||||
if(i < 0 || i > 5) setInternal("tv.filter", "0");
|
if(i < 0 || i > 5) setInternal("tv.filter", "0");
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,7 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
setFixedColorPalette(mySettings.getString("tia.dbgcolors"));
|
||||||
myTIAPinsDriven = mySettings.getBool("tiadriven");
|
myTIAPinsDriven = mySettings.getBool("tiadriven");
|
||||||
|
|
||||||
myBackground.setTIA(this);
|
myBackground.setTIA(this);
|
||||||
|
@ -865,14 +866,14 @@ bool TIA::toggleFixedColors(uInt8 mode)
|
||||||
// Otherwise, flip the state
|
// Otherwise, flip the state
|
||||||
bool on = (mode == 0 || mode == 1) ? bool(mode) : myColorHBlank == 0;
|
bool on = (mode == 0 || mode == 1) ? bool(mode) : myColorHBlank == 0;
|
||||||
|
|
||||||
bool pal = myFrameManager.layout() == FrameLayout::pal;
|
int layout = myFrameManager.layout() == FrameLayout::pal ? 1 : 0;
|
||||||
myMissile0.setDebugColor(pal ? M0ColorPAL : M0ColorNTSC);
|
myMissile0.setDebugColor(myFixedColorPalette[layout][FixedObject::M0]);
|
||||||
myMissile1.setDebugColor(pal ? M1ColorPAL : M1ColorNTSC);
|
myMissile1.setDebugColor(myFixedColorPalette[layout][FixedObject::M1]);
|
||||||
myPlayer0.setDebugColor(pal ? P0ColorPAL : P0ColorNTSC);
|
myPlayer0.setDebugColor(myFixedColorPalette[layout][FixedObject::P0]);
|
||||||
myPlayer1.setDebugColor(pal ? P1ColorPAL : P1ColorNTSC);
|
myPlayer1.setDebugColor(myFixedColorPalette[layout][FixedObject::P1]);
|
||||||
myBall.setDebugColor(pal ? BLColorPAL : BLColorNTSC);
|
myBall.setDebugColor(myFixedColorPalette[layout][FixedObject::BL]);
|
||||||
myPlayfield.setDebugColor(pal ? PFColorPAL : PFColorNTSC);
|
myPlayfield.setDebugColor(myFixedColorPalette[layout][FixedObject::PF]);
|
||||||
myBackground.setDebugColor(pal ? BKColorPAL : BKColorNTSC);
|
myBackground.setDebugColor(FixedColor::BK_GREY);
|
||||||
|
|
||||||
myMissile0.enableDebugColors(on);
|
myMissile0.enableDebugColors(on);
|
||||||
myMissile1.enableDebugColors(on);
|
myMissile1.enableDebugColors(on);
|
||||||
|
@ -881,11 +882,46 @@ bool TIA::toggleFixedColors(uInt8 mode)
|
||||||
myBall.enableDebugColors(on);
|
myBall.enableDebugColors(on);
|
||||||
myPlayfield.enableDebugColors(on);
|
myPlayfield.enableDebugColors(on);
|
||||||
myBackground.enableDebugColors(on);
|
myBackground.enableDebugColors(on);
|
||||||
myColorHBlank = on ? HBLANKColor : 0x00;
|
myColorHBlank = on ? FixedColor::HBLANK_WHITE : 0x00;
|
||||||
|
|
||||||
return on;
|
return on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void TIA::setFixedColorPalette(const string& colors)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 6; ++i)
|
||||||
|
{
|
||||||
|
switch(colors[i])
|
||||||
|
{
|
||||||
|
case 'r':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_RED;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_RED;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_ORANGE;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_ORANGE;
|
||||||
|
break;
|
||||||
|
case 'y':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_YELLOW;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_YELLOW;
|
||||||
|
break;
|
||||||
|
case 'g':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_GREEN;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_GREEN;
|
||||||
|
break;
|
||||||
|
case 'b':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_BLUE;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_BLUE;
|
||||||
|
break;
|
||||||
|
case 'p':
|
||||||
|
myFixedColorPalette[0][i] = FixedColor::NTSC_PURPLE;
|
||||||
|
myFixedColorPalette[1][i] = FixedColor::PAL_PURPLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool TIA::driveUnusedPinsRandom(uInt8 mode)
|
bool TIA::driveUnusedPinsRandom(uInt8 mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -283,6 +283,17 @@ class TIA : public Device
|
||||||
bool toggleFixedColors(uInt8 mode = 2);
|
bool toggleFixedColors(uInt8 mode = 2);
|
||||||
bool usingFixedColors() const { return myColorHBlank != 0x00; }
|
bool usingFixedColors() const { return myColorHBlank != 0x00; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the color of each object in 'fixed debug colors' mode.
|
||||||
|
Note that this doesn't enable/disable fixed colors; it simply
|
||||||
|
updates the palette that is used.
|
||||||
|
|
||||||
|
@param colors Each character in the 6-char string represents the
|
||||||
|
first letter of the color to use for
|
||||||
|
P0/M0/P1/M1/PF/BL, respectively.
|
||||||
|
*/
|
||||||
|
void setFixedColorPalette(const string& colors);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable/disable/query state of 'undriven/floating TIA pins'.
|
Enable/disable/query state of 'undriven/floating TIA pins'.
|
||||||
|
|
||||||
|
@ -373,25 +384,26 @@ class TIA : public Device
|
||||||
enum HState {blank, frame};
|
enum HState {blank, frame};
|
||||||
enum Priority {pfp, score, normal};
|
enum Priority {pfp, score, normal};
|
||||||
|
|
||||||
enum FixedColors {
|
enum FixedColor {
|
||||||
P0ColorNTSC = 0x30, // red
|
NTSC_RED = 0x30,
|
||||||
M0ColorNTSC = 0x38, // orange
|
NTSC_ORANGE = 0x38,
|
||||||
P1ColorNTSC = 0x1c, // yellow
|
NTSC_YELLOW = 0x1c,
|
||||||
M1ColorNTSC = 0xc4, // green
|
NTSC_GREEN = 0xc4,
|
||||||
PFColorNTSC = 0x9e, // blue
|
NTSC_BLUE = 0x9e,
|
||||||
BLColorNTSC = 0x66, // purple
|
NTSC_PURPLE = 0x66,
|
||||||
BKColorNTSC = 0x0a, // grey
|
|
||||||
|
|
||||||
P0ColorPAL = 0x62, // red
|
PAL_RED = 0x62,
|
||||||
M0ColorPAL = 0x4a, // orange
|
PAL_ORANGE = 0x4a,
|
||||||
P1ColorPAL = 0x2e, // yellow
|
PAL_YELLOW = 0x2e,
|
||||||
M1ColorPAL = 0x34, // green
|
PAL_GREEN = 0x34,
|
||||||
PFColorPAL = 0xbc, // blue
|
PAL_BLUE = 0xbc,
|
||||||
BLColorPAL = 0xa6, // purple
|
PAL_PURPLE = 0xa6,
|
||||||
BKColorPAL = 0x0a, // grey
|
|
||||||
|
|
||||||
HBLANKColor = 0x0e // white
|
BK_GREY = 0x0a,
|
||||||
|
HBLANK_WHITE = 0x0e
|
||||||
};
|
};
|
||||||
|
enum FixedObject { P0, M0, P1, M1, PF, BL };
|
||||||
|
FixedColor myFixedColorPalette[2][6];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue