mirror of https://github.com/stella-emu/stella.git
Merge branch 'release/6.0'
This commit is contained in:
commit
5a705ad4e9
|
@ -46,7 +46,7 @@ FBSurfaceSDL2::~FBSurfaceSDL2()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurfaceSDL2::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
|
||||
void FBSurfaceSDL2::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId color)
|
||||
{
|
||||
// Fill the rectangle
|
||||
SDL_Rect tmp;
|
||||
|
|
|
@ -38,7 +38,7 @@ class FBSurfaceSDL2 : public FBSurface
|
|||
// Most of the surface drawing primitives are implemented in FBSurface;
|
||||
// the ones implemented here use SDL-specific code for extra performance
|
||||
//
|
||||
void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color) override;
|
||||
void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId color) override;
|
||||
// With hardware surfaces, it's faster to just update the entire surface
|
||||
void setDirty() override { mySurfaceIsDirty = true; }
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ void RewindManager::setup()
|
|||
{
|
||||
myLastTimeMachineAdd = false;
|
||||
|
||||
string prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr.";
|
||||
const string& prefix = myOSystem.settings().getBool("dev.settings") ? "dev." : "plr.";
|
||||
|
||||
mySize = myOSystem.settings().getInt(prefix + "tm.size");
|
||||
if(mySize != myStateList.capacity())
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "StateManager.hxx"
|
||||
|
||||
#define STATE_HEADER "05019000state"
|
||||
#define STATE_HEADER "05099000state"
|
||||
// #define MOVIE_HEADER "03030000movie"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
#define VERSION_HXX
|
||||
|
||||
#define STELLA_VERSION "6.0_pre1"
|
||||
#define STELLA_BUILD "4409"
|
||||
#define STELLA_BUILD "4434"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2018 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#include <cmath>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846f
|
||||
#endif
|
||||
|
||||
#include "HighPass.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
HighPass::HighPass(float cutOffFrequency, float frequency)
|
||||
: myLastValueIn(0),
|
||||
myLastValueOut(0),
|
||||
myAlpha(1.f / (1.f + 2.f*M_PI*cutOffFrequency/frequency))
|
||||
{}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
float HighPass::apply(float valueIn)
|
||||
{
|
||||
float valueOut = myAlpha * (myLastValueOut + valueIn - myLastValueIn);
|
||||
|
||||
myLastValueIn = valueIn;
|
||||
myLastValueOut = valueOut;
|
||||
|
||||
return valueOut;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2018 by Bradford W. Mott, Stephen Anthony
|
||||
// and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//============================================================================
|
||||
|
||||
#ifndef HIGH_PASS_HXX
|
||||
#define HIGH_PASS_HXX
|
||||
|
||||
class HighPass
|
||||
{
|
||||
public:
|
||||
|
||||
HighPass(float cutOffFrequency, float frequency);
|
||||
|
||||
float apply(float value);
|
||||
|
||||
private:
|
||||
|
||||
float myLastValueIn;
|
||||
|
||||
float myLastValueOut;
|
||||
|
||||
float myAlpha;
|
||||
|
||||
private:
|
||||
|
||||
HighPass() = delete;
|
||||
};
|
||||
|
||||
#endif // HIGH_PASS_HXX
|
|
@ -25,6 +25,7 @@
|
|||
namespace {
|
||||
|
||||
constexpr float CLIPPING_FACTOR = 0.75;
|
||||
constexpr float HIGH_PASS_CUT_OFF = 10;
|
||||
|
||||
uInt32 reducedDenominator(uInt32 n, uInt32 d)
|
||||
{
|
||||
|
@ -78,6 +79,9 @@ LanczosResampler::LanczosResampler(
|
|||
myCurrentFragment(nullptr),
|
||||
myFragmentIndex(0),
|
||||
myIsUnderrun(true),
|
||||
myHighPassL(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
||||
myHighPassR(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
||||
myHighPass(HIGH_PASS_CUT_OFF, float(formatFrom.sampleRate)),
|
||||
myTimeIndex(0)
|
||||
{
|
||||
myPrecomputedKernels = make_unique<float[]>(myPrecomputedKernelCount * myKernelSize);
|
||||
|
@ -184,11 +188,11 @@ inline void LanczosResampler::shiftSamples(uInt32 samplesToShift)
|
|||
{
|
||||
while (samplesToShift-- > 0) {
|
||||
if (myFormatFrom.stereo) {
|
||||
myBufferL->shift(myCurrentFragment[2*myFragmentIndex] / static_cast<float>(0x7fff));
|
||||
myBufferR->shift(myCurrentFragment[2*myFragmentIndex + 1] / static_cast<float>(0x7fff));
|
||||
myBufferL->shift(myHighPassL.apply(myCurrentFragment[2*myFragmentIndex] / static_cast<float>(0x7fff)));
|
||||
myBufferR->shift(myHighPassR.apply(myCurrentFragment[2*myFragmentIndex + 1] / static_cast<float>(0x7fff)));
|
||||
}
|
||||
else
|
||||
myBuffer->shift(myCurrentFragment[myFragmentIndex] / static_cast<float>(0x7fff));
|
||||
myBuffer->shift(myHighPass.apply(myCurrentFragment[myFragmentIndex] / static_cast<float>(0x7fff)));
|
||||
|
||||
myFragmentIndex++;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "bspf.hxx"
|
||||
#include "Resampler.hxx"
|
||||
#include "ConvolutionBuffer.hxx"
|
||||
#include "HighPass.hxx"
|
||||
|
||||
class LanczosResampler : public Resampler
|
||||
{
|
||||
|
@ -59,6 +60,10 @@ class LanczosResampler : public Resampler
|
|||
uInt32 myFragmentIndex;
|
||||
bool myIsUnderrun;
|
||||
|
||||
HighPass myHighPassL;
|
||||
HighPass myHighPassR;
|
||||
HighPass myHighPass;
|
||||
|
||||
uInt32 myTimeIndex;
|
||||
};
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ MODULE := src/common/audio
|
|||
MODULE_OBJS := \
|
||||
src/common/audio/SimpleResampler.o \
|
||||
src/common/audio/ConvolutionBuffer.o \
|
||||
src/common/audio/LanczosResampler.o
|
||||
src/common/audio/LanczosResampler.o \
|
||||
src/common/audio/HighPass.o
|
||||
|
||||
MODULE_DIRS += \
|
||||
src/emucore/tia
|
||||
|
|
|
@ -49,15 +49,17 @@ const DebuggerState& TIADebug::getState()
|
|||
myState.coluRegs.push_back(coluBK());
|
||||
|
||||
// Debug Colors
|
||||
int mode = myTIA.frameLayout() == FrameLayout::ntsc ? 0 : 1;
|
||||
int timing = myTIA.consoleTiming() == ConsoleTiming::ntsc ? 0
|
||||
: myTIA.consoleTiming() == ConsoleTiming::pal ? 1 : 2;
|
||||
|
||||
myState.fixedCols.clear();
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::P0]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::P1]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::PF]);
|
||||
myState.fixedCols.push_back(TIA::FixedColor::BK_GREY);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::M0]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::M1]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[mode][TIA::BL]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::P0]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::P1]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::PF]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::BK]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::M0]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::M1]);
|
||||
myState.fixedCols.push_back(myTIA.myFixedColorPalette[timing][TIA::BL]);
|
||||
myState.fixedCols.push_back(TIA::FixedColor::HBLANK_WHITE);
|
||||
|
||||
// Collisions
|
||||
|
@ -1012,20 +1014,22 @@ string TIADebug::debugColors() const
|
|||
{
|
||||
ostringstream buf;
|
||||
|
||||
int mode = myTIA.frameLayout() == FrameLayout::ntsc ? 0 : 1;
|
||||
buf << " " << myTIA.myFixedColorNames[TIA::P0] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::P0])
|
||||
int timing = myTIA.consoleTiming() == ConsoleTiming::ntsc ? 0
|
||||
: myTIA.consoleTiming() == ConsoleTiming::pal ? 1 : 2;
|
||||
|
||||
buf << " " << myTIA.myFixedColorNames[TIA::P0] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::P0])
|
||||
<< " Player 0\n"
|
||||
<< " " << myTIA.myFixedColorNames[TIA::M0] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::M0])
|
||||
<< " " << myTIA.myFixedColorNames[TIA::M0] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::M0])
|
||||
<< " Missile 0\n"
|
||||
<< " " << myTIA.myFixedColorNames[TIA::P1] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::P1])
|
||||
<< " " << myTIA.myFixedColorNames[TIA::P1] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::P1])
|
||||
<< " Player 1\n"
|
||||
<< " " << myTIA.myFixedColorNames[TIA::M1] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::M1])
|
||||
<< " " << myTIA.myFixedColorNames[TIA::M1] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::M1])
|
||||
<< " Missile 1\n"
|
||||
<< " " << myTIA.myFixedColorNames[TIA::PF] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::PF])
|
||||
<< " " << myTIA.myFixedColorNames[TIA::PF] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::PF])
|
||||
<< " Playfield\n"
|
||||
<< " " << myTIA.myFixedColorNames[TIA::BL] << " " << colorSwatch(myTIA.myFixedColorPalette[mode][TIA::BL])
|
||||
<< " " << myTIA.myFixedColorNames[TIA::BL] << " " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::BL])
|
||||
<< " Ball\n"
|
||||
<< " Grey " << colorSwatch(TIA::FixedColor::BK_GREY)
|
||||
<< " Grey " << colorSwatch(myTIA.myFixedColorPalette[timing][TIA::BK])
|
||||
<< " Background\n"
|
||||
<< " White " << colorSwatch(TIA::FixedColor::HBLANK_WHITE)
|
||||
<< " HMOVE\n";
|
||||
|
|
|
@ -596,7 +596,7 @@ void DataGridWidget::drawWidget(bool hilite)
|
|||
bool onTop = _boss->dialog().isOnTop();
|
||||
int row, col;
|
||||
|
||||
s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : onTop ? _bgcolor : _bgcolorlo);
|
||||
s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : onTop ? _bgcolor : kBGColorHi);
|
||||
// Draw the internal grid and labels
|
||||
int linewidth = _cols * _colWidth;
|
||||
s.frameRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
||||
|
@ -615,7 +615,7 @@ void DataGridWidget::drawWidget(bool hilite)
|
|||
int x = _x + 4 + (col * _colWidth);
|
||||
int y = _y + 2 + (row * _rowHeight);
|
||||
int pos = row*_cols + col;
|
||||
uInt32 textColor = onTop ? kTextColor : kColor;
|
||||
ColorId textColor = onTop ? kTextColor : kColor;
|
||||
|
||||
// Draw the selected item inverted, on a highlighted background.
|
||||
if (_currentRow == row && _currentCol == col &&
|
||||
|
@ -635,7 +635,8 @@ void DataGridWidget::drawWidget(bool hilite)
|
|||
{
|
||||
if(_changedList[pos])
|
||||
{
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kDbgChangedColor : _bgcolorlo);
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1,
|
||||
onTop ? kDbgChangedColor : _bgcolorlo);
|
||||
|
||||
if(_hiliteList[pos])
|
||||
textColor = kDbgColorHi;
|
||||
|
|
|
@ -90,6 +90,7 @@ void DelayQueueWidget::loadConfig() {
|
|||
void DelayQueueWidget::drawWidget(bool hilite)
|
||||
{
|
||||
FBSurface& surface = _boss->dialog().surface();
|
||||
bool onTop = _boss->dialog().isOnTop();
|
||||
|
||||
int y = _y,
|
||||
x = _x,
|
||||
|
@ -101,14 +102,14 @@ void DelayQueueWidget::drawWidget(bool hilite)
|
|||
y += 1;
|
||||
x += 1;
|
||||
w -= 1;
|
||||
surface.fillRect(x, y, w - 1, _h - 2, kDlgColor);
|
||||
surface.fillRect(x, y, w - 1, _h - 2, onTop ? kDlgColor : _bgcolorlo);
|
||||
|
||||
y += 2;
|
||||
x += 2;
|
||||
w -= 3;
|
||||
|
||||
for (const auto& line : myLines) {
|
||||
surface.drawString(_font, line, x, y, w, _textcolor);
|
||||
surface.drawString(_font, line, x, y, w, onTop ? _textcolor : kColor);
|
||||
y += lineHeight;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
|
|||
void PromptWidget::drawWidget(bool hilite)
|
||||
{
|
||||
//cerr << "PromptWidget::drawWidget\n";
|
||||
uInt32 fgcolor, bgcolor;
|
||||
ColorId fgcolor, bgcolor;
|
||||
|
||||
FBSurface& s = _boss->dialog().surface();
|
||||
bool onTop = _boss->dialog().isOnTop();
|
||||
|
@ -90,11 +90,11 @@ void PromptWidget::drawWidget(bool hilite)
|
|||
if(c & (1 << 17)) // inverse video flag
|
||||
{
|
||||
fgcolor = _bgcolor;
|
||||
bgcolor = (c & 0x1ffff) >> 8;
|
||||
bgcolor = ColorId((c & 0x1ffff) >> 8);
|
||||
s.fillRect(x, y, _kConsoleCharWidth, _kConsoleCharHeight, bgcolor);
|
||||
}
|
||||
else
|
||||
fgcolor = c >> 8;
|
||||
fgcolor = ColorId(c >> 8);
|
||||
|
||||
s.drawChar(_font, c & 0x7f, x, y, onTop ? fgcolor : kColor);
|
||||
x += _kConsoleCharWidth;
|
||||
|
@ -833,13 +833,11 @@ void PromptWidget::putcharIntern(int c)
|
|||
nextLine();
|
||||
else if(c & 0x80) { // set foreground color to TIA color
|
||||
// don't print or advance cursor
|
||||
// there are only 128 TIA colors, but
|
||||
// OverlayColor contains 256 of them
|
||||
_textcolor = (c & 0x7f) << 1;
|
||||
_textcolor = ColorId((c & 0x7f) << 1);
|
||||
}
|
||||
else if(c && c < 0x1e) { // first actual character is large dash
|
||||
// More colors (the regular GUI ones)
|
||||
_textcolor = c + 0x100;
|
||||
_textcolor = ColorId(c + 0x100);
|
||||
}
|
||||
else if(c == 0x7f) { // toggle inverse video (DEL char)
|
||||
_inverse = !_inverse;
|
||||
|
@ -869,6 +867,7 @@ void PromptWidget::drawCaret()
|
|||
{
|
||||
//cerr << "PromptWidget::drawCaret()\n";
|
||||
FBSurface& s = _boss->dialog().surface();
|
||||
bool onTop = _boss->dialog().isOnTop();
|
||||
|
||||
int line = _currentPos / _lineWidth;
|
||||
|
||||
|
@ -881,7 +880,7 @@ void PromptWidget::drawCaret()
|
|||
int y = _y + displayLine * _kConsoleLineHeight;
|
||||
|
||||
char c = buffer(_currentPos);
|
||||
s.fillRect(x, y, _kConsoleCharWidth, _kConsoleLineHeight, kTextColor);
|
||||
s.fillRect(x, y, _kConsoleCharWidth, _kConsoleLineHeight, onTop ? kTextColor : kColor);
|
||||
s.drawChar(_font, c, x, y + 2, kBGColor);
|
||||
}
|
||||
|
||||
|
|
|
@ -468,7 +468,7 @@ void RomListWidget::drawWidget(bool hilite)
|
|||
bool onTop = _boss->dialog().isOnTop();
|
||||
const CartDebug::DisassemblyList& dlist = myDisasm->list;
|
||||
int i, pos, xpos, ypos, len = int(dlist.size());
|
||||
uInt32 textColor = onTop ? kTextColor : kColor;
|
||||
ColorId textColor = onTop ? kTextColor : kColor;
|
||||
|
||||
const GUI::Rect& r = getEditRect();
|
||||
const GUI::Rect& l = getLineRect();
|
||||
|
@ -489,7 +489,7 @@ void RomListWidget::drawWidget(bool hilite)
|
|||
xpos = _x + CheckboxWidget::boxSize() + 10; ypos = _y + 2;
|
||||
for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++, ypos += _fontHeight)
|
||||
{
|
||||
uInt32 bytesColor = textColor;
|
||||
ColorId bytesColor = textColor;
|
||||
|
||||
// Draw checkboxes for correct lines (takes scrolling into account)
|
||||
myCheckList[i]->setState(myBPState->isSet(dlist[pos].address));
|
||||
|
|
|
@ -273,7 +273,7 @@ void TiaZoomWidget::drawWidget(bool hilite)
|
|||
for(x = myXOff, col = 0; x < myNumCols+myXOff; ++x, col += wzoom)
|
||||
{
|
||||
uInt32 idx = y*width + x;
|
||||
uInt32 color = currentFrame[idx] | (idx > scanoffset ? 1 : 0);
|
||||
ColorId color = ColorId(currentFrame[idx] | (idx > scanoffset ? 1 : 0));
|
||||
s.fillRect(_x + col + 1, _y + row + 1, wzoom, hzoom, color);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ ToggleBitWidget::ToggleBitWidget(GuiObject* boss, const GUI::Font& font,
|
|||
{
|
||||
_rowHeight = font.getLineHeight();
|
||||
_colWidth = colchars * font.getMaxCharWidth() + 8;
|
||||
_bgcolorlo = kDlgColor;
|
||||
|
||||
// Make sure all lists contain some default values
|
||||
int size = _rows * _cols;
|
||||
|
@ -93,7 +94,7 @@ void ToggleBitWidget::drawWidget(bool hilite)
|
|||
{
|
||||
for (col = 0; col < _cols; col++)
|
||||
{
|
||||
uInt32 textColor = kTextColor;
|
||||
ColorId textColor = kTextColor;
|
||||
int x = _x + 4 + (col * _colWidth);
|
||||
int y = _y + 2 + (row * _rowHeight);
|
||||
int pos = row*_cols + col;
|
||||
|
@ -115,16 +116,18 @@ void ToggleBitWidget::drawWidget(bool hilite)
|
|||
// Highlight changes
|
||||
if(_changedList[pos])
|
||||
{
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kDbgChangedColor : _bgcolorlo);
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1,
|
||||
onTop ? kDbgChangedColor : _bgcolorlo);
|
||||
s.drawString(_font, buffer, x, y, _colWidth, onTop ? kDbgChangedTextColor : kColor);
|
||||
}
|
||||
else
|
||||
s.drawString(_font, buffer, x, y, _colWidth, onTop ? textColor : kColor);
|
||||
s.drawString(_font, buffer, x, y, _colWidth,
|
||||
onTop ? textColor : kColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kBGColorHi);
|
||||
s.drawString(_font, buffer, x, y, _colWidth, kTextColor);
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kBGColorHi : kDlgColor);
|
||||
s.drawString(_font, buffer, x, y, _colWidth, onTop ? kTextColor : kColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,6 +121,7 @@ void TogglePixelWidget::drawWidget(bool hilite)
|
|||
{
|
||||
//cerr << "TogglePixelWidget::drawWidget\n";
|
||||
FBSurface& s = dialog().surface();
|
||||
bool onTop = _boss->dialog().isOnTop();
|
||||
int row, col;
|
||||
|
||||
s.frameRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
||||
|
@ -148,7 +149,7 @@ void TogglePixelWidget::drawWidget(bool hilite)
|
|||
|
||||
// Either draw the pixel in given color, or erase (show background)
|
||||
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1,
|
||||
_stateList[pos] ? _pixelColor : _backgroundColor);
|
||||
_stateList[pos] ? onTop ? _pixelColor : kColor : onTop ? _backgroundColor : kBGColorLo);
|
||||
if (_changedList[pos])
|
||||
s.frameRect(x - 3, y - 1, _colWidth - 1, _rowHeight - 1, kDbgChangedColor);
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ class TogglePixelWidget : public ToggleWidget
|
|||
int x, int y, int cols, int rows);
|
||||
virtual ~TogglePixelWidget() = default;
|
||||
|
||||
void setColor(int color) {
|
||||
_pixelColor = (color >= 0 && color <= kNumColors) ? color : kDlgColor;
|
||||
void setColor(ColorId color) {
|
||||
_pixelColor = color <= kNumColors ? color : kDlgColor;
|
||||
}
|
||||
void setBackgroundColor(int color) {
|
||||
_backgroundColor = (color >= 0 && color <= kNumColors) ? color : kDlgColor;
|
||||
void setBackgroundColor(ColorId color) {
|
||||
_backgroundColor = color <= kNumColors ? color : kDlgColor;
|
||||
}
|
||||
void setState(const BoolArray& state);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class TogglePixelWidget : public ToggleWidget
|
|||
void setCrossed(bool enable) { _crossBits = enable; }
|
||||
|
||||
private:
|
||||
int _pixelColor, _backgroundColor;
|
||||
ColorId _pixelColor, _backgroundColor;
|
||||
bool _swapBits;
|
||||
bool _crossBits;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ CartridgeBUS::CartridgeBUS(const BytePtr& image, uInt32 size,
|
|||
myDisplayImage = myBUSRAM + DSRAM;
|
||||
|
||||
// Create Thumbulator ARM emulator
|
||||
string prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
const string& prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
myThumbEmulator = make_unique<Thumbulator>(
|
||||
reinterpret_cast<uInt16*>(myImage), reinterpret_cast<uInt16*>(myBUSRAM),
|
||||
settings.getBool(prefix + "thumb.trapfatal"), Thumbulator::ConfigureFor::BUS, this
|
||||
|
|
|
@ -67,7 +67,7 @@ CartridgeCDF::CartridgeCDF(const BytePtr& image, uInt32 size,
|
|||
setVersion();
|
||||
|
||||
// Create Thumbulator ARM emulator
|
||||
string prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
const string& prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
myThumbEmulator = make_unique<Thumbulator>(
|
||||
reinterpret_cast<uInt16*>(myImage), reinterpret_cast<uInt16*>(myCDFRAM),
|
||||
settings.getBool(prefix + "thumb.trapfatal"), myVersion ?
|
||||
|
|
|
@ -53,7 +53,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
|
|||
myFrequencyImage = myDisplayImage + 0x1000;
|
||||
|
||||
// Create Thumbulator ARM emulator
|
||||
string prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
const string& prefix = settings.getBool("dev.settings") ? "plr." : "dev.";
|
||||
myThumbEmulator = make_unique<Thumbulator>
|
||||
(reinterpret_cast<uInt16*>(myImage),
|
||||
reinterpret_cast<uInt16*>(myDPCRAM),
|
||||
|
|
|
@ -491,6 +491,9 @@ void Console::setPalette(const string& type)
|
|||
palettes[paletteNum][0];
|
||||
|
||||
myOSystem.frameBuffer().setPalette(palette);
|
||||
|
||||
if(myTIA->usingFixedColors())
|
||||
myTIA->enableFixedColors(true);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -35,7 +35,7 @@ class DispatchResult
|
|||
|
||||
const string& getMessage() const { assertStatus(Status::debugger); return myMessage; }
|
||||
|
||||
uInt16 getAddress() const { assertStatus(Status::debugger); return myAddress; }
|
||||
int getAddress() const { assertStatus(Status::debugger); return myAddress; }
|
||||
|
||||
bool wasReadTrap() const { assertStatus(Status::debugger); return myWasReadTrap; }
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ void FBSurface::readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) c
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::pixel(uInt32 x, uInt32 y, uInt32 color)
|
||||
void FBSurface::pixel(uInt32 x, uInt32 y, ColorId color)
|
||||
{
|
||||
uInt32* buffer = myPixels + y * myPitch + x;
|
||||
|
||||
|
@ -68,7 +68,7 @@ void FBSurface::pixel(uInt32 x, uInt32 y, uInt32 color)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color)
|
||||
void FBSurface::line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, ColorId color)
|
||||
{
|
||||
// draw line using Bresenham algorithm
|
||||
Int32 dx = (x2 - x);
|
||||
|
@ -127,7 +127,7 @@ void FBSurface::line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color)
|
||||
void FBSurface::hLine(uInt32 x, uInt32 y, uInt32 x2, ColorId color)
|
||||
{
|
||||
uInt32* buffer = myPixels + y * myPitch + x;
|
||||
while(x++ <= x2)
|
||||
|
@ -135,7 +135,7 @@ void FBSurface::hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color)
|
||||
void FBSurface::vLine(uInt32 x, uInt32 y, uInt32 y2, ColorId color)
|
||||
{
|
||||
uInt32* buffer = static_cast<uInt32*>(myPixels + y * myPitch + x);
|
||||
while(y++ <= y2)
|
||||
|
@ -146,7 +146,7 @@ void FBSurface::vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
|
||||
void FBSurface::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, ColorId color)
|
||||
{
|
||||
while(h--)
|
||||
hLine(x, y+h, x+w-1, color);
|
||||
|
@ -154,9 +154,9 @@ void FBSurface::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::drawChar(const GUI::Font& font, uInt8 chr,
|
||||
uInt32 tx, uInt32 ty, uInt32 color, uInt32 shadowColor)
|
||||
uInt32 tx, uInt32 ty, ColorId color, ColorId shadowColor)
|
||||
{
|
||||
if(shadowColor != 0)
|
||||
if(shadowColor != kNone)
|
||||
{
|
||||
drawChar(font, chr, tx + 1, ty + 0, shadowColor);
|
||||
drawChar(font, chr, tx + 0, ty + 1, shadowColor);
|
||||
|
@ -208,14 +208,14 @@ void FBSurface::drawChar(const GUI::Font& font, uInt8 chr,
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::drawBitmap(uInt32* bitmap, uInt32 tx, uInt32 ty,
|
||||
uInt32 color, uInt32 h)
|
||||
ColorId color, uInt32 h)
|
||||
{
|
||||
drawBitmap(bitmap, tx, ty, color, h, h);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::drawBitmap(uInt32* bitmap, uInt32 tx, uInt32 ty,
|
||||
uInt32 color, uInt32 w, uInt32 h)
|
||||
ColorId color, uInt32 w, uInt32 h)
|
||||
{
|
||||
uInt32* buffer = myPixels + ty * myPitch + tx;
|
||||
|
||||
|
@ -241,7 +241,7 @@ void FBSurface::drawPixels(uInt32* data, uInt32 tx, uInt32 ty, uInt32 numpixels)
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||
uInt32 colorA, uInt32 colorB)
|
||||
ColorId colorA, ColorId colorB)
|
||||
{
|
||||
hLine(x + 1, y, x + w - 2, colorA);
|
||||
hLine(x, y + 1, x + w - 1, colorA);
|
||||
|
@ -256,7 +256,7 @@ void FBSurface::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||
uInt32 color, FrameStyle style)
|
||||
ColorId color, FrameStyle style)
|
||||
{
|
||||
switch(style)
|
||||
{
|
||||
|
@ -285,8 +285,8 @@ void FBSurface::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FBSurface::drawString(const GUI::Font& font, const string& s,
|
||||
int x, int y, int w,
|
||||
uInt32 color, TextAlign align,
|
||||
int deltax, bool useEllipsis, uInt32 shadowColor)
|
||||
ColorId color, TextAlign align,
|
||||
int deltax, bool useEllipsis, ColorId shadowColor)
|
||||
{
|
||||
const string ELLIPSIS = "\x1d"; // "..."
|
||||
const int leftX = x, rightX = x + w;
|
||||
|
|
|
@ -79,7 +79,7 @@ class FBSurface
|
|||
@param y The y coordinate
|
||||
@param color The color of the line
|
||||
*/
|
||||
virtual void pixel(uInt32 x, uInt32 y, uInt32 color);
|
||||
virtual void pixel(uInt32 x, uInt32 y, ColorId color);
|
||||
|
||||
/**
|
||||
This method should be called to draw a line.
|
||||
|
@ -90,7 +90,7 @@ class FBSurface
|
|||
@param y2 The second y coordinate
|
||||
@param color The color of the line
|
||||
*/
|
||||
virtual void line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, uInt32 color);
|
||||
virtual void line(uInt32 x, uInt32 y, uInt32 x2, uInt32 y2, ColorId color);
|
||||
|
||||
/**
|
||||
This method should be called to draw a horizontal line.
|
||||
|
@ -100,7 +100,7 @@ class FBSurface
|
|||
@param x2 The second x coordinate
|
||||
@param color The color of the line
|
||||
*/
|
||||
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color);
|
||||
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, ColorId color);
|
||||
|
||||
/**
|
||||
This method should be called to draw a vertical line.
|
||||
|
@ -110,7 +110,7 @@ class FBSurface
|
|||
@param y2 The second y coordinate
|
||||
@param color The color of the line
|
||||
*/
|
||||
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color);
|
||||
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, ColorId color);
|
||||
|
||||
/**
|
||||
This method should be called to draw a filled rectangle.
|
||||
|
@ -122,7 +122,7 @@ class FBSurface
|
|||
@param color The fill color of the rectangle
|
||||
*/
|
||||
virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||
uInt32 color);
|
||||
ColorId color);
|
||||
|
||||
/**
|
||||
This method should be called to draw the specified character.
|
||||
|
@ -134,7 +134,7 @@ class FBSurface
|
|||
@param color The color of the character
|
||||
*/
|
||||
virtual void drawChar(const GUI::Font& font, uInt8 c, uInt32 x, uInt32 y,
|
||||
uInt32 color, uInt32 shadowColor = 0);
|
||||
ColorId color, ColorId shadowColor = kNone);
|
||||
|
||||
/**
|
||||
This method should be called to draw the bitmap image.
|
||||
|
@ -145,7 +145,7 @@ class FBSurface
|
|||
@param color The color of the bitmap
|
||||
@param h The height of the data image
|
||||
*/
|
||||
virtual void drawBitmap(uInt32* bitmap, uInt32 x, uInt32 y, uInt32 color,
|
||||
virtual void drawBitmap(uInt32* bitmap, uInt32 x, uInt32 y, ColorId color,
|
||||
uInt32 h = 8);
|
||||
|
||||
/**
|
||||
|
@ -158,7 +158,7 @@ class FBSurface
|
|||
@param w The width of the data image
|
||||
@param h The height of the data image
|
||||
*/
|
||||
virtual void drawBitmap(uInt32* bitmap, uInt32 x, uInt32 y, uInt32 color,
|
||||
virtual void drawBitmap(uInt32* bitmap, uInt32 x, uInt32 y, ColorId color,
|
||||
uInt32 w, uInt32 h);
|
||||
|
||||
/**
|
||||
|
@ -185,7 +185,7 @@ class FBSurface
|
|||
@param colorB Darker color for inside line.
|
||||
*/
|
||||
virtual void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||
uInt32 colorA, uInt32 colorB);
|
||||
ColorId colorA, ColorId colorB);
|
||||
|
||||
/**
|
||||
This method should be called to draw a framed rectangle with
|
||||
|
@ -199,7 +199,7 @@ class FBSurface
|
|||
@param style The 'FrameStyle' to use for the surrounding frame
|
||||
*/
|
||||
virtual void frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||
uInt32 color, FrameStyle style = FrameStyle::Solid);
|
||||
ColorId color, FrameStyle style = FrameStyle::Solid);
|
||||
|
||||
/**
|
||||
This method should be called to draw the specified string.
|
||||
|
@ -216,8 +216,8 @@ class FBSurface
|
|||
*/
|
||||
virtual void drawString(
|
||||
const GUI::Font& font, const string& s, int x, int y, int w,
|
||||
uInt32 color, TextAlign align = TextAlign::Left,
|
||||
int deltax = 0, bool useEllipsis = true, uInt32 shadowColor = 0);
|
||||
ColorId color, TextAlign align = TextAlign::Left,
|
||||
int deltax = 0, bool useEllipsis = true, ColorId shadowColor = kNone);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Note: The following methods are FBSurface-specific, and must be
|
||||
|
|
|
@ -138,7 +138,7 @@ bool FrameBuffer::initialize()
|
|||
else if(myOSystem.settings().getString("uipalette") == "light")
|
||||
palID = 2;
|
||||
|
||||
for(int i = 0, j = 256; i < kNumColors-256; ++i, ++j)
|
||||
for(uInt32 i = 0, j = 256; i < kNumColors-256; ++i, ++j)
|
||||
{
|
||||
uInt8 r = (ourGUIColors[palID][i] >> 16) & 0xff;
|
||||
uInt8 g = (ourGUIColors[palID][i] >> 8) & 0xff;
|
||||
|
@ -413,7 +413,6 @@ void FrameBuffer::showMessage(const string& message, MessagePosition position,
|
|||
void FrameBuffer::drawFrameStats(float framesPerSecond)
|
||||
{
|
||||
const ConsoleInfo& info = myOSystem.console().about();
|
||||
uInt32 color;
|
||||
int xPos = 2, yPos = 0;
|
||||
const int dy = font().getFontHeight() + 2;
|
||||
|
||||
|
@ -422,8 +421,8 @@ void FrameBuffer::drawFrameStats(float framesPerSecond)
|
|||
myStatsMsg.surface->invalidate();
|
||||
|
||||
// draw scanlines
|
||||
color = myOSystem.console().tia().frameBufferScanlinesLastFrame() != myLastScanlines ?
|
||||
uInt32(kDbgColorRed) : myStatsMsg.color;
|
||||
ColorId color = myOSystem.console().tia().frameBufferScanlinesLastFrame() != myLastScanlines ?
|
||||
kDbgColorRed : myStatsMsg.color;
|
||||
|
||||
ss
|
||||
<< myOSystem.console().tia().frameBufferScanlinesLastFrame()
|
||||
|
|
|
@ -518,13 +518,13 @@ class FrameBuffer
|
|||
int counter;
|
||||
int x, y, w, h;
|
||||
MessagePosition position;
|
||||
uInt32 color;
|
||||
ColorId color;
|
||||
shared_ptr<FBSurface> surface;
|
||||
bool enabled;
|
||||
|
||||
Message()
|
||||
: counter(-1), x(0), y(0), w(0), h(0), position(MessagePosition::BottomCenter),
|
||||
color(0), enabled(false) { }
|
||||
color(kNone), enabled(false) { }
|
||||
};
|
||||
Message myMsg;
|
||||
Message myStatsMsg;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#ifndef FRAMEBUFFER_CONSTANTS_HXX
|
||||
#define FRAMEBUFFER_CONSTANTS_HXX
|
||||
|
||||
#include "bspf.hxx"
|
||||
|
||||
// Return values for initialization of framebuffer window
|
||||
enum class FBInitStatus {
|
||||
Success,
|
||||
|
@ -39,47 +41,50 @@ enum class MessagePosition {
|
|||
BottomRight
|
||||
};
|
||||
|
||||
// TODO - make this 'enum class'
|
||||
// Colors indices to use for the various GUI elements
|
||||
enum {
|
||||
// Abstract away what a color actually is, so we can easily change it in
|
||||
// the future, if necessary
|
||||
using ColorId = uInt32;
|
||||
static constexpr ColorId
|
||||
kColor = 256,
|
||||
kBGColor,
|
||||
kBGColorLo,
|
||||
kBGColorHi,
|
||||
kShadowColor,
|
||||
kTextColor,
|
||||
kTextColorHi,
|
||||
kTextColorEm,
|
||||
kTextColorInv,
|
||||
kDlgColor,
|
||||
kWidColor,
|
||||
kWidColorHi,
|
||||
kWidFrameColor,
|
||||
kBtnColor,
|
||||
kBtnColorHi,
|
||||
kBtnBorderColor,
|
||||
kBtnBorderColorHi,
|
||||
kBtnTextColor,
|
||||
kBtnTextColorHi,
|
||||
kCheckColor,
|
||||
kScrollColor,
|
||||
kScrollColorHi,
|
||||
kSliderColor,
|
||||
kSliderColorHi,
|
||||
kSliderBGColor,
|
||||
kSliderBGColorHi,
|
||||
kSliderBGColorLo,
|
||||
kDbgChangedColor,
|
||||
kDbgChangedTextColor,
|
||||
kDbgColorHi,
|
||||
kDbgColorRed,
|
||||
kColorInfo,
|
||||
kColorTitleBar,
|
||||
kColorTitleText,
|
||||
kColorTitleBarLo,
|
||||
kColorTitleTextLo,
|
||||
kNumColors
|
||||
};
|
||||
kBGColor = 257,
|
||||
kBGColorLo = 258,
|
||||
kBGColorHi = 259,
|
||||
kShadowColor = 260,
|
||||
kTextColor = 261,
|
||||
kTextColorHi = 262,
|
||||
kTextColorEm = 263,
|
||||
kTextColorInv = 264,
|
||||
kDlgColor = 265,
|
||||
kWidColor = 266,
|
||||
kWidColorHi = 267,
|
||||
kWidFrameColor = 268,
|
||||
kBtnColor = 269,
|
||||
kBtnColorHi = 270,
|
||||
kBtnBorderColor = 271,
|
||||
kBtnBorderColorHi = 272,
|
||||
kBtnTextColor = 273,
|
||||
kBtnTextColorHi = 274,
|
||||
kCheckColor = 275,
|
||||
kScrollColor = 276,
|
||||
kScrollColorHi = 277,
|
||||
kSliderColor = 278,
|
||||
kSliderColorHi = 279,
|
||||
kSliderBGColor = 280,
|
||||
kSliderBGColorHi = 281,
|
||||
kSliderBGColorLo = 282,
|
||||
kDbgChangedColor = 283,
|
||||
kDbgChangedTextColor = 284,
|
||||
kDbgColorHi = 285,
|
||||
kDbgColorRed = 286,
|
||||
kColorInfo = 287,
|
||||
kColorTitleBar = 288,
|
||||
kColorTitleText = 289,
|
||||
kColorTitleBarLo = 290,
|
||||
kColorTitleTextLo = 291,
|
||||
kNumColors = 292,
|
||||
kNone = 0 // placeholder to represent default/no color
|
||||
;
|
||||
|
||||
// Text alignment modes for drawString()
|
||||
enum class TextAlign {
|
||||
|
|
|
@ -95,7 +95,6 @@ OSystem::OSystem()
|
|||
|
||||
mySettings = MediaFactory::createSettings(*this);
|
||||
myAudioSettings = AudioSettings(mySettings.get());
|
||||
myRandom = make_unique<Random>(*this);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -158,8 +157,8 @@ bool OSystem::create()
|
|||
// a real serial port on the system
|
||||
mySerialPort = MediaFactory::createSerialPort();
|
||||
|
||||
// Re-initialize random seed
|
||||
myRandom->initSeed();
|
||||
// Create random number generator
|
||||
myRandom = make_unique<Random>(uInt32(getTicks()));
|
||||
|
||||
// Create PNG handler
|
||||
myPNGLib = make_unique<PNGLibrary>(*this);
|
||||
|
|
|
@ -149,7 +149,7 @@ void PointingDevice::updateDirection(int counter, float& counterRemainder,
|
|||
scanCount = INT_MAX;
|
||||
|
||||
// Define offset factor for first change, move randomly forward by up to 1/8th
|
||||
firstScanOffset = (((firstScanOffset << 3) + rand() %
|
||||
firstScanOffset = (((firstScanOffset << 3) + mySystem.randGenerator().next() %
|
||||
(1 << 12)) >> 3) & ((1 << 12) - 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#define RANDOM_HXX
|
||||
|
||||
#include "bspf.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "Serializable.hxx"
|
||||
|
||||
/**
|
||||
|
@ -35,15 +34,15 @@ class Random : public Serializable
|
|||
/**
|
||||
Create a new random number generator
|
||||
*/
|
||||
Random(const OSystem& osystem) : myOSystem(osystem) { initSeed(); }
|
||||
Random(uInt32 seed) { initSeed(seed); }
|
||||
|
||||
/**
|
||||
Re-initialize the random number generator with a new seed,
|
||||
to generate a different set of random numbers.
|
||||
*/
|
||||
void initSeed()
|
||||
void initSeed(uInt32 seed)
|
||||
{
|
||||
myValue = uInt32(myOSystem.getTicks());
|
||||
myValue = seed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,9 +109,6 @@ class Random : public Serializable
|
|||
string name() const override { return "Random"; }
|
||||
|
||||
private:
|
||||
// Set the OSystem we're using
|
||||
const OSystem& myOSystem;
|
||||
|
||||
// Indicates the next random number
|
||||
// We make this mutable, since it's not immediately obvious that
|
||||
// calling next() should change internal state (ie, the *logical*
|
||||
|
|
|
@ -39,7 +39,7 @@ System::System(const OSystem& osystem, M6502& m6502, M6532& m6532,
|
|||
mySystemInAutodetect(false)
|
||||
{
|
||||
// Re-initialize random generator
|
||||
randGenerator().initSeed();
|
||||
randGenerator().initSeed(uInt32(myOSystem.getTicks()));
|
||||
|
||||
// Initialize page access table
|
||||
PageAccess access(&myNullDevice, System::PA_READ);
|
||||
|
|
|
@ -27,6 +27,7 @@ class NullDevice;
|
|||
#include "bspf.hxx"
|
||||
#include "Device.hxx"
|
||||
#include "NullDev.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "Random.hxx"
|
||||
#include "Serializable.hxx"
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@ void Ball::enabl(uInt8 value)
|
|||
myTIA->flushLineCache();
|
||||
|
||||
updateEnabled();
|
||||
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
|
||||
myTIA->updateCollision();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +243,7 @@ void Ball::updateEnabled()
|
|||
myIsEnabled = !myIsSuppressed && (myIsDelaying ? myIsEnabledOld : myIsEnabledNew);
|
||||
|
||||
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
|
||||
myTIA->updateCollision();
|
||||
myTIA->scheduleCollisionUpdate();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -260,7 +260,7 @@ void Missile::updateEnabled()
|
|||
myIsEnabled = !myIsSuppressed && myEnam && !myResmp;
|
||||
|
||||
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
|
||||
myTIA->updateCollision();
|
||||
myTIA->scheduleCollisionUpdate();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -385,7 +385,7 @@ void Player::updatePattern()
|
|||
|
||||
if (myIsRendering && myRenderCounter >= myRenderCounterTripPoint) {
|
||||
collision = (myPattern & (1 << mySampleCounter)) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
|
||||
myTIA->updateCollision();
|
||||
myTIA->scheduleCollisionUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ void TIA::frameReset()
|
|||
memset(myBackBuffer, 0, 160 * TIAConstants::frameBufferHeight);
|
||||
memset(myFrontBuffer, 0, 160 * TIAConstants::frameBufferHeight);
|
||||
memset(myFramebuffer, 0, 160 * TIAConstants::frameBufferHeight);
|
||||
enableColorLoss(mySettings.getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss");
|
||||
enableColorLoss(mySettings.getBool(mySettings.getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss"));
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -266,6 +266,7 @@ bool TIA::save(Serializer& out) const
|
|||
out.putInt(myXAtRenderingStart);
|
||||
|
||||
out.putBool(myCollisionUpdateRequired);
|
||||
out.putBool(myCollisionUpdateScheduled);
|
||||
out.putInt(myCollisionMask);
|
||||
|
||||
out.putInt(myMovementClock);
|
||||
|
@ -337,6 +338,7 @@ bool TIA::load(Serializer& in)
|
|||
myXAtRenderingStart = in.getInt();
|
||||
|
||||
myCollisionUpdateRequired = in.getBool();
|
||||
myCollisionUpdateScheduled = in.getBool();
|
||||
myCollisionMask = in.getInt();
|
||||
|
||||
myMovementClock = in.getInt();
|
||||
|
@ -971,18 +973,16 @@ bool TIA::toggleCollisions()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool TIA::enableFixedColors(bool enable)
|
||||
{
|
||||
// This will be called during reset at a point where no frame manager
|
||||
// instance is available, so we guard aginst this here.
|
||||
int layout = 0;
|
||||
if (myFrameManager) layout = myFrameManager->layout() == FrameLayout::pal ? 1 : 0;
|
||||
int timing = consoleTiming() == ConsoleTiming::ntsc ? 0
|
||||
: consoleTiming() == ConsoleTiming::pal ? 1 : 2;
|
||||
|
||||
myMissile0.setDebugColor(myFixedColorPalette[layout][FixedObject::M0]);
|
||||
myMissile1.setDebugColor(myFixedColorPalette[layout][FixedObject::M1]);
|
||||
myPlayer0.setDebugColor(myFixedColorPalette[layout][FixedObject::P0]);
|
||||
myPlayer1.setDebugColor(myFixedColorPalette[layout][FixedObject::P1]);
|
||||
myBall.setDebugColor(myFixedColorPalette[layout][FixedObject::BL]);
|
||||
myPlayfield.setDebugColor(myFixedColorPalette[layout][FixedObject::PF]);
|
||||
myBackground.setDebugColor(FixedColor::BK_GREY);
|
||||
myMissile0.setDebugColor(myFixedColorPalette[timing][FixedObject::M0]);
|
||||
myMissile1.setDebugColor(myFixedColorPalette[timing][FixedObject::M1]);
|
||||
myPlayer0.setDebugColor(myFixedColorPalette[timing][FixedObject::P0]);
|
||||
myPlayer1.setDebugColor(myFixedColorPalette[timing][FixedObject::P1]);
|
||||
myBall.setDebugColor(myFixedColorPalette[timing][FixedObject::BL]);
|
||||
myPlayfield.setDebugColor(myFixedColorPalette[timing][FixedObject::PF]);
|
||||
myBackground.setDebugColor(myFixedColorPalette[timing][FixedObject::BK]);
|
||||
|
||||
myMissile0.enableDebugColors(enable);
|
||||
myMissile1.enableDebugColors(enable);
|
||||
|
@ -1011,35 +1011,44 @@ bool TIA::setFixedColorPalette(const string& colors)
|
|||
case 'r':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_RED;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_RED;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_RED;
|
||||
myFixedColorNames[i] = "Red ";
|
||||
break;
|
||||
case 'o':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_ORANGE;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_ORANGE;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_ORANGE;
|
||||
myFixedColorNames[i] = "Orange";
|
||||
break;
|
||||
case 'y':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_YELLOW;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_YELLOW;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_YELLOW;
|
||||
myFixedColorNames[i] = "Yellow";
|
||||
break;
|
||||
case 'g':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_GREEN;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_GREEN;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_GREEN;
|
||||
myFixedColorNames[i] = "Green ";
|
||||
break;
|
||||
case 'b':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_BLUE;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_BLUE;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_BLUE;
|
||||
myFixedColorNames[i] = "Blue ";
|
||||
break;
|
||||
case 'p':
|
||||
myFixedColorPalette[0][i] = FixedColor::NTSC_PURPLE;
|
||||
myFixedColorPalette[1][i] = FixedColor::PAL_PURPLE;
|
||||
myFixedColorPalette[2][i] = FixedColor::SECAM_PURPLE;
|
||||
myFixedColorNames[i] = "Purple";
|
||||
break;
|
||||
}
|
||||
}
|
||||
myFixedColorPalette[0][TIA::BK] = FixedColor::NTSC_GREY;
|
||||
myFixedColorPalette[1][TIA::BK] = FixedColor::PAL_GREY;
|
||||
myFixedColorPalette[2][TIA::BK] = FixedColor::SECAM_GREY;
|
||||
|
||||
// If already in fixed debug colours mode, update the current palette
|
||||
if(usingFixedColors())
|
||||
|
@ -1216,7 +1225,8 @@ void TIA::cycle(uInt32 colorClocks)
|
|||
[this] (uInt8 address, uInt8 value) {delayedWrite(address, value);}
|
||||
);
|
||||
|
||||
myCollisionUpdateRequired = false;
|
||||
myCollisionUpdateRequired = myCollisionUpdateScheduled;
|
||||
myCollisionUpdateScheduled = false;
|
||||
|
||||
if (myLinesSinceChange < 2) {
|
||||
tickMovement();
|
||||
|
@ -1351,6 +1361,12 @@ void TIA::cloneLastLine()
|
|||
memcpy(buffer + y * 160, buffer + (y-1) * 160, 160);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TIA::scheduleCollisionUpdate()
|
||||
{
|
||||
myCollisionUpdateScheduled = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TIA::updateCollision()
|
||||
{
|
||||
|
|
|
@ -73,22 +73,31 @@ class TIA : public Device
|
|||
* Possible palette entries for objects in "fixed debug color mode".
|
||||
*/
|
||||
enum FixedColor {
|
||||
NTSC_RED = 0x30,
|
||||
NTSC_ORANGE = 0x38,
|
||||
NTSC_YELLOW = 0x1c,
|
||||
NTSC_GREEN = 0xc4,
|
||||
NTSC_BLUE = 0x9e,
|
||||
NTSC_PURPLE = 0x66,
|
||||
NTSC_RED = 0x30,
|
||||
NTSC_ORANGE = 0x38,
|
||||
NTSC_YELLOW = 0x1c,
|
||||
NTSC_GREEN = 0xc4,
|
||||
NTSC_BLUE = 0x9c,
|
||||
NTSC_PURPLE = 0x66,
|
||||
NTSC_GREY = 0x04,
|
||||
|
||||
PAL_RED = 0x62,
|
||||
PAL_ORANGE = 0x4a,
|
||||
PAL_YELLOW = 0x2e,
|
||||
PAL_GREEN = 0x34,
|
||||
PAL_BLUE = 0xbc,
|
||||
PAL_PURPLE = 0xa6,
|
||||
PAL_RED = 0x62,
|
||||
PAL_ORANGE = 0x4a,
|
||||
PAL_YELLOW = 0x2e,
|
||||
PAL_GREEN = 0x34,
|
||||
PAL_BLUE = 0xbc,
|
||||
PAL_PURPLE = 0xa6,
|
||||
PAL_GREY = 0x06,
|
||||
|
||||
BK_GREY = 0x0a,
|
||||
HBLANK_WHITE = 0x0e
|
||||
SECAM_RED = 0x04,
|
||||
SECAM_ORANGE = 0x06, // purple
|
||||
SECAM_YELLOW = 0x0c,
|
||||
SECAM_GREEN = 0x08,
|
||||
SECAM_BLUE = 0x02,
|
||||
SECAM_PURPLE = 0x0a, // cyan
|
||||
SECAM_GREY = 0x00,
|
||||
|
||||
HBLANK_WHITE = 0x0e
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -448,9 +457,9 @@ class TIA : public Device
|
|||
void flushLineCache();
|
||||
|
||||
/**
|
||||
* Update the collision bitfield.
|
||||
Schedule a collision update
|
||||
*/
|
||||
void updateCollision();
|
||||
void scheduleCollisionUpdate();
|
||||
|
||||
/**
|
||||
Create a new delayQueueIterator for the debugger.
|
||||
|
@ -500,9 +509,9 @@ class TIA : public Device
|
|||
/**
|
||||
* Palette and indices for fixed debug colors.
|
||||
*/
|
||||
enum FixedObject { P0, M0, P1, M1, PF, BL };
|
||||
FixedColor myFixedColorPalette[2][6];
|
||||
string myFixedColorNames[6];
|
||||
enum FixedObject { P0, M0, P1, M1, PF, BL, BK };
|
||||
FixedColor myFixedColorPalette[3][7];
|
||||
string myFixedColorNames[7];
|
||||
|
||||
private:
|
||||
|
||||
|
@ -543,6 +552,11 @@ class TIA : public Device
|
|||
*/
|
||||
void tickHframe();
|
||||
|
||||
/**
|
||||
* Update the collision bitfield.
|
||||
*/
|
||||
void updateCollision();
|
||||
|
||||
/**
|
||||
* Execute a RSYNC.
|
||||
*/
|
||||
|
@ -815,6 +829,9 @@ class TIA : public Device
|
|||
bool myEnableJitter;
|
||||
uInt8 myJitterFactor;
|
||||
|
||||
// Force schedule a collision update
|
||||
bool myCollisionUpdateScheduled;
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
// The arrays containing information about every byte of TIA
|
||||
// indicating whether and how (RW) it is used.
|
||||
|
|
|
@ -169,7 +169,7 @@ void AboutDialog::displayInfo()
|
|||
{
|
||||
const char* str = myDescStr[i].c_str();
|
||||
TextAlign align = TextAlign::Center;
|
||||
uInt32 color = kTextColor;
|
||||
ColorId color = kTextColor;
|
||||
|
||||
while (str[0] == '\\')
|
||||
{
|
||||
|
|
|
@ -112,7 +112,7 @@ void CheckListWidget::drawWidget(bool hilite)
|
|||
_checkList[i]->draw();
|
||||
|
||||
const int y = _y + 2 + _fontHeight * i + 2;
|
||||
uInt32 textColor = kTextColor;
|
||||
ColorId textColor = kTextColor;
|
||||
|
||||
GUI::Rect r(getEditRect());
|
||||
|
||||
|
@ -137,7 +137,8 @@ void CheckListWidget::drawWidget(bool hilite)
|
|||
TextAlign::Left, -_editScrollOffset, false);
|
||||
}
|
||||
else
|
||||
s.drawString(_font, _list[pos], _x + r.left, y, r.width(), onTop ? textColor : kColor);
|
||||
s.drawString(_font, _list[pos], _x + r.left, y, r.width(),
|
||||
onTop ? textColor : kColor);
|
||||
}
|
||||
|
||||
// Only draw the caret while editing, and if it's in the current viewport
|
||||
|
|
|
@ -28,7 +28,7 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font,
|
|||
int x, int y, int w, int h, int cmd)
|
||||
: Widget(boss, font, x, y, w, h),
|
||||
CommandSender(boss),
|
||||
_color(0),
|
||||
_color(kNone),
|
||||
_cmd(cmd),
|
||||
_crossGrid(false)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ColorWidget::setColor(int color)
|
||||
void ColorWidget::setColor(ColorId color)
|
||||
{
|
||||
_color = color;
|
||||
setDirty();
|
||||
|
@ -52,7 +52,7 @@ void ColorWidget::drawWidget(bool hilite)
|
|||
s.frameRect(_x, _y, _w, _h + 1, kColor);
|
||||
|
||||
// Show the currently selected color
|
||||
s.fillRect(_x+1, _y+1, _w-2, _h-1, onTop ? isEnabled() ? _color : kWidColor : kDlgColor);
|
||||
s.fillRect(_x+1, _y+1, _w-2, _h-1, onTop ? isEnabled() ? _color : kWidColor : kBGColorLo);
|
||||
|
||||
// Cross out the grid?
|
||||
if(_crossGrid)
|
||||
|
|
|
@ -39,8 +39,8 @@ class ColorWidget : public Widget, public CommandSender
|
|||
int x, int y, int w, int h, int cmd = 0);
|
||||
virtual ~ColorWidget() = default;
|
||||
|
||||
void setColor(int color);
|
||||
int getColor() const { return _color; }
|
||||
void setColor(ColorId color);
|
||||
ColorId getColor() const { return _color; }
|
||||
|
||||
void setCrossed(bool enable) { _crossGrid = enable; }
|
||||
|
||||
|
@ -48,7 +48,7 @@ class ColorWidget : public Widget, public CommandSender
|
|||
void drawWidget(bool hilite) override;
|
||||
|
||||
protected:
|
||||
int _color;
|
||||
ColorId _color;
|
||||
int _cmd;
|
||||
|
||||
bool _crossGrid;
|
||||
|
|
|
@ -118,7 +118,7 @@ class ContextMenu : public Dialog, public CommandSender
|
|||
int _selectedOffset, _selectedItem;
|
||||
bool _showScroll;
|
||||
bool _isScrolling;
|
||||
uInt32 _scrollUpColor, _scrollDnColor;
|
||||
ColorId _scrollUpColor, _scrollDnColor;
|
||||
|
||||
int _cmd;
|
||||
|
||||
|
|
|
@ -1090,7 +1090,7 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
|
|||
return;
|
||||
}
|
||||
|
||||
static constexpr int dbg_color[2][DEBUG_COLORS] = {
|
||||
static constexpr ColorId dbg_color[3][DEBUG_COLORS] = {
|
||||
{
|
||||
TIA::FixedColor::NTSC_RED,
|
||||
TIA::FixedColor::NTSC_ORANGE,
|
||||
|
@ -1106,11 +1106,21 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
|
|||
TIA::FixedColor::PAL_GREEN,
|
||||
TIA::FixedColor::PAL_PURPLE,
|
||||
TIA::FixedColor::PAL_BLUE
|
||||
},
|
||||
{
|
||||
TIA::FixedColor::SECAM_RED,
|
||||
TIA::FixedColor::SECAM_ORANGE,
|
||||
TIA::FixedColor::SECAM_YELLOW,
|
||||
TIA::FixedColor::SECAM_GREEN,
|
||||
TIA::FixedColor::SECAM_PURPLE,
|
||||
TIA::FixedColor::SECAM_BLUE
|
||||
}
|
||||
};
|
||||
|
||||
int mode = instance().console().tia().frameLayout() == FrameLayout::ntsc ? 0 : 1;
|
||||
myDbgColourSwatch[idx]->setColor(dbg_color[mode][color]);
|
||||
int timing = instance().console().tia().consoleTiming() == ConsoleTiming::ntsc ? 0
|
||||
: instance().console().tia().consoleTiming() == ConsoleTiming::pal ? 1 : 2;
|
||||
|
||||
myDbgColourSwatch[idx]->setColor(dbg_color[timing][color]);
|
||||
myDbgColour[idx]->setSelectedIndex(color);
|
||||
|
||||
// make sure the selected debug colors are all different
|
||||
|
@ -1122,7 +1132,7 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
|
|||
usedCol[i] = false;
|
||||
for(int j = 0; j < DEBUG_COLORS; ++j)
|
||||
{
|
||||
if(myDbgColourSwatch[j]->getColor() == dbg_color[mode][i])
|
||||
if(myDbgColourSwatch[j]->getColor() == dbg_color[timing][i])
|
||||
{
|
||||
usedCol[i] = true;
|
||||
break;
|
||||
|
@ -1132,14 +1142,14 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
|
|||
// check if currently changed color was used somewhere else
|
||||
for(int i = 0; i < DEBUG_COLORS; ++i)
|
||||
{
|
||||
if (i != idx && myDbgColourSwatch[i]->getColor() == dbg_color[mode][color])
|
||||
if (i != idx && myDbgColourSwatch[i]->getColor() == dbg_color[timing][color])
|
||||
{
|
||||
// if already used, change the other color to an unused one
|
||||
for(int j = 0; j < DEBUG_COLORS; ++j)
|
||||
{
|
||||
if(!usedCol[j])
|
||||
{
|
||||
myDbgColourSwatch[i]->setColor(dbg_color[mode][j]);
|
||||
myDbgColourSwatch[i]->setColor(dbg_color[timing][j]);
|
||||
myDbgColour[i]->setSelectedIndex(j);
|
||||
break;
|
||||
}
|
||||
|
@ -1155,12 +1165,12 @@ void DeveloperDialog::handleDebugColours(const string& colors)
|
|||
{
|
||||
switch(colors[i])
|
||||
{
|
||||
case 'r': handleDebugColours(i, 0); break;
|
||||
case 'o': handleDebugColours(i, 1); break;
|
||||
case 'y': handleDebugColours(i, 2); break;
|
||||
case 'g': handleDebugColours(i, 3); break;
|
||||
case 'p': handleDebugColours(i, 4); break;
|
||||
case 'b': handleDebugColours(i, 5); break;
|
||||
case 'r': handleDebugColours(i, 0); break;
|
||||
case 'o': handleDebugColours(i, 1); break;
|
||||
case 'y': handleDebugColours(i, 2); break;
|
||||
case 'g': handleDebugColours(i, 3); break;
|
||||
case 'p': handleDebugColours(i, 4); break;
|
||||
case 'b': handleDebugColours(i, 5); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class Dialog : public GuiObject
|
|||
void close();
|
||||
|
||||
bool isVisible() const override { return _visible; }
|
||||
bool isOnTop() { return _onTop; }
|
||||
bool isOnTop() const { return _onTop; }
|
||||
|
||||
virtual void center();
|
||||
virtual void drawDialog();
|
||||
|
|
|
@ -95,7 +95,7 @@ void EditTextWidget::drawWidget(bool hilite)
|
|||
adjustOffset();
|
||||
s.drawString(_font, editString(), _x + 2, _y + 2, getEditRect().width(),
|
||||
_changed && onTop
|
||||
? uInt32(kDbgChangedTextColor)
|
||||
? kDbgChangedTextColor
|
||||
: onTop ? _textcolor : kColor,
|
||||
TextAlign::Left, -_editScrollOffset, false);
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ void PopUpWidget::drawWidget(bool hilite)
|
|||
// Draw the label, if any
|
||||
if(_labelWidth > 0)
|
||||
s.drawString(_font, _label, _x, _y + myTextY, _labelWidth,
|
||||
isEnabled() && onTop ? _textcolor : uInt32(kColor), TextAlign::Left);
|
||||
isEnabled() && onTop ? _textcolor : kColor, TextAlign::Left);
|
||||
|
||||
// Draw a thin frame around us.
|
||||
s.frameRect(x, _y, w, _h, isEnabled() && hilite ? kWidColorHi : kColor);
|
||||
|
|
|
@ -164,7 +164,7 @@ void RadioButtonWidget::drawWidget(bool hilite)
|
|||
|
||||
// Draw the inner bounding circle with enabled color
|
||||
s.drawBitmap(radio_img_innercircle, _x + 1, _y + _boxY + 1, isEnabled()
|
||||
? _bgcolor : uInt32(kColor), 12, 12);
|
||||
? _bgcolor : kColor, 12, 12);
|
||||
|
||||
// draw state
|
||||
if(_state)
|
||||
|
|
|
@ -261,14 +261,18 @@ void ScrollBarWidget::drawWidget(bool hilite)
|
|||
// Up arrow
|
||||
if(hilite && _part == kUpArrowPart)
|
||||
s.fillRect(_x + 1, _y + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor);
|
||||
s.drawBitmap(up_arrow, _x+4, _y+5, isSinglePage ? kColor :
|
||||
(hilite && _part == kUpArrowPart) ? kWidColor : kTextColor, 8);
|
||||
s.drawBitmap(up_arrow, _x+4, _y+5,
|
||||
onTop
|
||||
? isSinglePage ? kColor : (hilite && _part == kUpArrowPart) ? kWidColor : kTextColor
|
||||
: kColor, 8);
|
||||
|
||||
// Down arrow
|
||||
if(hilite && _part == kDownArrowPart)
|
||||
s.fillRect(_x + 1, bottomY - UP_DOWN_BOX_HEIGHT + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor);
|
||||
s.drawBitmap(down_arrow, _x+4, bottomY - UP_DOWN_BOX_HEIGHT + 5, isSinglePage ? kColor :
|
||||
(hilite && _part == kDownArrowPart) ? kWidColor : kTextColor, 8);
|
||||
s.drawBitmap(down_arrow, _x+4, bottomY - UP_DOWN_BOX_HEIGHT + 5,
|
||||
onTop
|
||||
? isSinglePage ? kColor : (hilite && _part == kDownArrowPart) ? kWidColor : kTextColor
|
||||
: kColor, 8);
|
||||
|
||||
// Slider
|
||||
if(!isSinglePage)
|
||||
|
|
|
@ -62,16 +62,16 @@ void StringListWidget::drawWidget(bool hilite)
|
|||
int i, pos, len = int(_list.size());
|
||||
|
||||
// Draw a thin frame around the list.
|
||||
s.frameRect(_x, _y, _w + 1, _h, hilite && _hilite ? kWidColorHi : kColor);
|
||||
s.frameRect(_x, _y, _w + 1, _h, onTop && hilite && _hilite ? kWidColorHi : kColor);
|
||||
|
||||
// Draw the list items
|
||||
for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++)
|
||||
{
|
||||
const int y = _y + 2 + _fontHeight * i;
|
||||
uInt32 textColor = onTop ? kTextColor : kShadowColor;
|
||||
ColorId textColor = onTop ? kTextColor : kShadowColor;
|
||||
|
||||
// Draw the selected item inverted, on a highlighted background.
|
||||
if (_selectedItem == pos && _hilite)
|
||||
if (onTop && _selectedItem == pos && _hilite)
|
||||
{
|
||||
if(_hasFocus && !_editMode)
|
||||
{
|
||||
|
|
|
@ -268,7 +268,7 @@ void TabWidget::drawWidget(bool hilite)
|
|||
int i, x = _x + kTabLeftOffset;
|
||||
for (i = 0; i < int(_tabs.size()); ++i)
|
||||
{
|
||||
uInt32 fontcolor = _tabs[i].enabled && onTop? kTextColor : kColor;
|
||||
ColorId fontcolor = _tabs[i].enabled && onTop? kTextColor : kColor;
|
||||
int yOffset = (i == _activeTab) ? 0 : 1;
|
||||
s.fillRect(x, _y + 1, _tabWidth, _tabHeight - 1,
|
||||
(i == _activeTab)
|
||||
|
|
|
@ -181,7 +181,7 @@ void TimeLineWidget::drawWidget(bool hilite)
|
|||
if(idx > 1)
|
||||
{
|
||||
int xt = x + valueToPos(idx - 1);
|
||||
uInt32 color;
|
||||
ColorId color = kNone;
|
||||
|
||||
if(isEnabled())
|
||||
{
|
||||
|
|
|
@ -307,7 +307,7 @@ void Widget::setDirtyInChain(Widget* start)
|
|||
StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h,
|
||||
const string& text, TextAlign align,
|
||||
uInt32 shadowColor)
|
||||
ColorId shadowColor)
|
||||
: Widget(boss, font, x, y, w, h),
|
||||
_align(align)
|
||||
{
|
||||
|
@ -326,7 +326,7 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
|||
StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y,
|
||||
const string& text, TextAlign align,
|
||||
uInt32 shadowColor)
|
||||
ColorId shadowColor)
|
||||
: StaticTextWidget(boss, font, x, y, font.getStringWidth(text), font.getLineHeight(),
|
||||
text, align, shadowColor)
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ void StaticTextWidget::drawWidget(bool hilite)
|
|||
FBSurface& s = _boss->dialog().surface();
|
||||
bool onTop = _boss->dialog().isOnTop();
|
||||
s.drawString(_font, _label, _x, _y, _w,
|
||||
isEnabled() && onTop ? _textcolor : uInt32(kColor), _align, 0, true, _shadowcolor);
|
||||
isEnabled() && onTop ? _textcolor : kColor, _align, 0, true, _shadowcolor);
|
||||
|
||||
setDirty();
|
||||
}
|
||||
|
@ -645,8 +645,9 @@ void CheckboxWidget::drawWidget(bool hilite)
|
|||
if(_drawBox)
|
||||
s.frameRect(_x, _y + _boxY, 14, 14, onTop && hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
|
||||
// Do we draw a square or cross?
|
||||
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? onTop ? uInt32(kDbgChangedColor) : kDlgColor
|
||||
: isEnabled() ? onTop ? _bgcolor : kDlgColor : uInt32(kColor));
|
||||
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12,
|
||||
_changed ? onTop ? kDbgChangedColor : kDlgColor :
|
||||
isEnabled() ? onTop ? _bgcolor : kDlgColor : kColor);
|
||||
if(_state)
|
||||
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, onTop && isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor
|
||||
: kColor, 10);
|
||||
|
@ -867,7 +868,7 @@ void SliderWidget::drawWidget(bool hilite)
|
|||
for(int i = 1; i < _numIntervals; ++i)
|
||||
{
|
||||
int xt = x + (_w - _labelWidth - _valueLabelGap - _valueLabelWidth) * i / _numIntervals - 1;
|
||||
uInt32 color;
|
||||
ColorId color = kNone;
|
||||
|
||||
if(isEnabled())
|
||||
{
|
||||
|
|
|
@ -109,11 +109,11 @@ class Widget : public GuiObject
|
|||
|
||||
virtual const GUI::Font& font() const { return _font; }
|
||||
|
||||
void setTextColor(uInt32 color) { _textcolor = color; setDirty(); }
|
||||
void setTextColorHi(uInt32 color) { _textcolorhi = color; setDirty(); }
|
||||
void setBGColor(uInt32 color) { _bgcolor = color; setDirty(); }
|
||||
void setBGColorHi(uInt32 color) { _bgcolorhi = color; setDirty(); }
|
||||
void setShadowColor(uInt32 color) { _shadowcolor = color; setDirty(); }
|
||||
void setTextColor(ColorId color) { _textcolor = color; setDirty(); }
|
||||
void setTextColorHi(ColorId color) { _textcolorhi = color; setDirty(); }
|
||||
void setBGColor(ColorId color) { _bgcolor = color; setDirty(); }
|
||||
void setBGColorHi(ColorId color) { _bgcolorhi = color; setDirty(); }
|
||||
void setShadowColor(ColorId color) { _shadowcolor = color; setDirty(); }
|
||||
|
||||
virtual void loadConfig() { }
|
||||
|
||||
|
@ -140,13 +140,13 @@ class Widget : public GuiObject
|
|||
bool _hasFocus;
|
||||
int _fontWidth;
|
||||
int _fontHeight;
|
||||
uInt32 _bgcolor;
|
||||
uInt32 _bgcolorhi;
|
||||
uInt32 _bgcolorlo;
|
||||
uInt32 _textcolor;
|
||||
uInt32 _textcolorhi;
|
||||
uInt32 _textcolorlo;
|
||||
uInt32 _shadowcolor;
|
||||
ColorId _bgcolor;
|
||||
ColorId _bgcolorhi;
|
||||
ColorId _bgcolorlo;
|
||||
ColorId _textcolor;
|
||||
ColorId _textcolorhi;
|
||||
ColorId _textcolorlo;
|
||||
ColorId _shadowcolor;
|
||||
|
||||
public:
|
||||
static Widget* findWidgetInChain(Widget* start, int x, int y);
|
||||
|
@ -183,11 +183,11 @@ class StaticTextWidget : public Widget
|
|||
StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h,
|
||||
const string& text = "", TextAlign align = TextAlign::Left,
|
||||
uInt32 shadowColor = 0);
|
||||
ColorId shadowColor = kNone);
|
||||
StaticTextWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y,
|
||||
const string& text = "", TextAlign align = TextAlign::Left,
|
||||
uInt32 shadowColor = 0);
|
||||
ColorId shadowColor = kNone);
|
||||
void setValue(int value);
|
||||
void setLabel(const string& label);
|
||||
void setAlign(TextAlign align) { _align = align; setDirty(); }
|
||||
|
@ -293,7 +293,7 @@ class CheckboxWidget : public ButtonWidget
|
|||
bool _changed;
|
||||
|
||||
uInt32* _img;
|
||||
uInt32 _fillColor;
|
||||
ColorId _fillColor;
|
||||
int _boxY;
|
||||
int _textY;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<key>CFBundleSignature</key>
|
||||
<string>StLa</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5.1</string>
|
||||
<string>6.0</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.games</string>
|
||||
<key>LSMinimumSystemVersionByArchitecture</key>
|
||||
|
|
|
@ -635,6 +635,8 @@
|
|||
E034A5EF209FB25D00C89E9E /* EmulationTiming.hxx in Headers */ = {isa = PBXBuildFile; fileRef = E034A5ED209FB25C00C89E9E /* EmulationTiming.hxx */; };
|
||||
E0406FB61F81A85400A82AE0 /* AbstractFrameManager.cxx in Sources */ = {isa = PBXBuildFile; fileRef = E0DFDD781F81A358000F3505 /* AbstractFrameManager.cxx */; };
|
||||
E0406FB81F81A85400A82AE0 /* FrameManager.cxx in Sources */ = {isa = PBXBuildFile; fileRef = E0DFDD7B1F81A358000F3505 /* FrameManager.cxx */; };
|
||||
E0893AF2211B9842008B170D /* HighPass.cxx in Sources */ = {isa = PBXBuildFile; fileRef = E0893AF0211B9841008B170D /* HighPass.cxx */; };
|
||||
E0893AF3211B9842008B170D /* HighPass.hxx in Headers */ = {isa = PBXBuildFile; fileRef = E0893AF1211B9841008B170D /* HighPass.hxx */; };
|
||||
E09F413B201E901D004A3391 /* AudioQueue.hxx in Headers */ = {isa = PBXBuildFile; fileRef = E09F4139201E901C004A3391 /* AudioQueue.hxx */; };
|
||||
E09F413C201E901D004A3391 /* AudioQueue.cxx in Sources */ = {isa = PBXBuildFile; fileRef = E09F413A201E901D004A3391 /* AudioQueue.cxx */; };
|
||||
E09F4141201E9050004A3391 /* Audio.hxx in Headers */ = {isa = PBXBuildFile; fileRef = E09F413D201E904F004A3391 /* Audio.hxx */; };
|
||||
|
@ -1330,6 +1332,8 @@
|
|||
E0306E0B1F93E916003DDD52 /* JitterEmulation.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JitterEmulation.hxx; sourceTree = "<group>"; };
|
||||
E034A5EC209FB25C00C89E9E /* EmulationTiming.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulationTiming.cxx; sourceTree = "<group>"; };
|
||||
E034A5ED209FB25C00C89E9E /* EmulationTiming.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = EmulationTiming.hxx; sourceTree = "<group>"; };
|
||||
E0893AF0211B9841008B170D /* HighPass.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HighPass.cxx; path = audio/HighPass.cxx; sourceTree = "<group>"; };
|
||||
E0893AF1211B9841008B170D /* HighPass.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = HighPass.hxx; path = audio/HighPass.hxx; sourceTree = "<group>"; };
|
||||
E09F4139201E901C004A3391 /* AudioQueue.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AudioQueue.hxx; sourceTree = "<group>"; };
|
||||
E09F413A201E901D004A3391 /* AudioQueue.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioQueue.cxx; sourceTree = "<group>"; };
|
||||
E09F413D201E904F004A3391 /* Audio.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Audio.hxx; sourceTree = "<group>"; };
|
||||
|
@ -2076,6 +2080,8 @@
|
|||
DCC6A4AD20A2620D00863C59 /* audio */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E0893AF0211B9841008B170D /* HighPass.cxx */,
|
||||
E0893AF1211B9841008B170D /* HighPass.hxx */,
|
||||
E0DCD3A620A64E96000B614E /* ConvolutionBuffer.cxx */,
|
||||
E0DCD3A520A64E96000B614E /* ConvolutionBuffer.hxx */,
|
||||
E0DCD3A420A64E95000B614E /* LanczosResampler.cxx */,
|
||||
|
@ -2235,6 +2241,7 @@
|
|||
DCACBAD11C54296300703A9B /* CartCVPlusWidget.hxx in Headers */,
|
||||
DC1B2EC81E50036100F62837 /* TrakBall.hxx in Headers */,
|
||||
2D9173E709BA90380026E9FF /* M6532.hxx in Headers */,
|
||||
E0893AF3211B9842008B170D /* HighPass.hxx in Headers */,
|
||||
2D9173E809BA90380026E9FF /* MD5.hxx in Headers */,
|
||||
2D9173EA09BA90380026E9FF /* Paddles.hxx in Headers */,
|
||||
2D9173EB09BA90380026E9FF /* Props.hxx in Headers */,
|
||||
|
@ -2797,6 +2804,7 @@
|
|||
DCF3A6EF1DFC75E3008A8AF3 /* DrawCounterDecodes.cxx in Sources */,
|
||||
DC5AAC2C1FCB24DF00C420A6 /* RadioButtonWidget.cxx in Sources */,
|
||||
DC9EA8870F729A36000452B5 /* KidVid.cxx in Sources */,
|
||||
E0893AF2211B9842008B170D /* HighPass.cxx in Sources */,
|
||||
DCF467C20F939A1400B25D7A /* CartEF.cxx in Sources */,
|
||||
DCF467C40F939A1400B25D7A /* CartEFSC.cxx in Sources */,
|
||||
DCF7B0DD10A762FC007A2870 /* CartF0.cxx in Sources */,
|
||||
|
|
|
@ -233,6 +233,7 @@
|
|||
<ClCompile Include="..\common\AudioQueue.cxx" />
|
||||
<ClCompile Include="..\common\AudioSettings.cxx" />
|
||||
<ClCompile Include="..\common\audio\ConvolutionBuffer.cxx" />
|
||||
<ClCompile Include="..\common\audio\HighPass.cxx" />
|
||||
<ClCompile Include="..\common\audio\LanczosResampler.cxx" />
|
||||
<ClCompile Include="..\common\audio\SimpleResampler.cxx" />
|
||||
<ClCompile Include="..\common\Base.cxx" />
|
||||
|
@ -526,6 +527,7 @@
|
|||
<ClInclude Include="..\common\AudioQueue.hxx" />
|
||||
<ClInclude Include="..\common\AudioSettings.hxx" />
|
||||
<ClInclude Include="..\common\audio\ConvolutionBuffer.hxx" />
|
||||
<ClInclude Include="..\common\audio\HighPass.hxx" />
|
||||
<ClInclude Include="..\common\audio\LanczosResampler.hxx" />
|
||||
<ClInclude Include="..\common\audio\Resampler.hxx" />
|
||||
<ClInclude Include="..\common\audio\SimpleResampler.hxx" />
|
||||
|
|
|
@ -936,6 +936,9 @@
|
|||
<ClCompile Include="..\common\FpsMeter.cxx">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\audio\HighPass.cxx">
|
||||
<Filter>Source Files\audio</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common\bspf.hxx">
|
||||
|
@ -1913,6 +1916,9 @@
|
|||
<ClInclude Include="..\common\FpsMeter.hxx">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\audio\HighPass.hxx">
|
||||
<Filter>Header Files\audio</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="stella.ico">
|
||||
|
|
Loading…
Reference in New Issue