Merge branch 'release/6.0'

This commit is contained in:
Christian Speckner 2018-08-06 17:53:59 +02:00
commit da222de5d2
17 changed files with 89 additions and 69 deletions

View File

@ -14,6 +14,9 @@
5.1.3 to 6.0: (MMM d, 2018)
* Note: because of major TIA sound changes, the state file format has
changed, and old state files will not work with this release.
* New cycle exact audio core based on work by Chris Brenner (crispy); greatly
improved audio emulation accuracy (i.e. E.T., Ms. Pacman).
@ -34,7 +37,10 @@
* Fixes for collision corner cases (during HBlank).
* UI modernization (new widget look, dialog titles added, dialogs refactored).
* UI modernization (new widget look, dialog titles added, dialogs
refactored).
* Fixed excessive CPU usage while in UI modes (ROM launcher, debugger, etc).
* Changes in 'Game Properties' dialog
- 'Default' button now affects only current tab like in all other dialogs.
@ -52,8 +58,11 @@
* Fixed emulator crash when starting SaveKey ROMs from commandline with
SaveKey messages enabled.
* Fixed missing TV format update in frame stats dialog when switching display
type.
* Fixed missing TV format update in frame stats dialog when switching
display type.
* For UNIX systems: in the ROM launcher, when using symlinks use the
symlink pathname instead of the underlying filesystem pathname.
* Updated PAL palette.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -593,9 +593,10 @@ void DataGridWidget::handleCommand(CommandSender* sender, int cmd,
void DataGridWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int row, col;
s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : _bgcolor);
s.fillRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? _bgcolorhi : onTop ? _bgcolor : _bgcolorlo);
// Draw the internal grid and labels
int linewidth = _cols * _colWidth;
s.frameRect(_x, _y, _w, _h, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
@ -614,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 = kTextColor;
uInt32 textColor = onTop ? kTextColor : kColor;
// Draw the selected item inverted, on a highlighted background.
if (_currentRow == row && _currentCol == col &&
@ -634,12 +635,12 @@ void DataGridWidget::drawWidget(bool hilite)
{
if(_changedList[pos])
{
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kDbgChangedColor);
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, onTop ? kDbgChangedColor : _bgcolorlo);
if(_hiliteList[pos])
textColor = kDbgColorHi;
else
textColor = kDbgChangedTextColor;
textColor = onTop ? kDbgChangedTextColor : textColor;
}
else if(_hiliteList[pos])
textColor = kDbgColorHi;

View File

@ -45,6 +45,7 @@ PromptWidget::PromptWidget(GuiObject* boss, const GUI::Font& font,
WIDGET_WANTS_TAB | WIDGET_WANTS_RAWDATA;
_textcolor = kTextColor;
_bgcolor = kWidColor;
_bgcolorlo = kDlgColor;
_kConsoleCharWidth = font.getMaxCharWidth();
_kConsoleCharHeight = font.getFontHeight();
@ -74,6 +75,7 @@ void PromptWidget::drawWidget(bool hilite)
uInt32 fgcolor, bgcolor;
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
// Draw text
int start = _scrollLine - _linesPerPage + 1;
@ -94,7 +96,7 @@ void PromptWidget::drawWidget(bool hilite)
else
fgcolor = c >> 8;
s.drawChar(_font, c & 0x7f, x, y, fgcolor);
s.drawChar(_font, c & 0x7f, x, y, onTop ? fgcolor : kColor);
x += _kConsoleCharWidth;
}
y += _kConsoleLineHeight;

View File

@ -465,8 +465,10 @@ void RomListWidget::lostFocusWidget()
void RomListWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
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;
const GUI::Rect& r = getEditRect();
const GUI::Rect& l = getLineRect();
@ -487,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 = kTextColor;
uInt32 bytesColor = textColor;
// Draw checkboxes for correct lines (takes scrolling into account)
myCheckList[i]->setState(myBPState->isSet(dlist[pos].address));
@ -496,7 +498,7 @@ void RomListWidget::drawWidget(bool hilite)
// Draw highlighted item in a frame
if (_highlightedItem == pos)
s.frameRect(_x + l.x() - 3, ypos - 1, _w - l.x(), _fontHeight, kWidColorHi);
s.frameRect(_x + l.x() - 3, ypos - 1, _w - l.x(), _fontHeight, onTop ? kWidColorHi : kBGColorLo);
// Draw the selected item inverted, on a highlighted background.
if(_selectedItem == pos && _hasFocus)
@ -512,7 +514,7 @@ void RomListWidget::drawWidget(bool hilite)
// Draw labels
s.drawString(_font, dlist[pos].label, xpos, ypos, _labelWidth,
dlist[pos].hllabel ? kTextColor : kColor);
dlist[pos].hllabel ? textColor : kColor);
// Bytes are only editable if they represent code, graphics, or accessible data
// Otherwise, the disassembly should get all remaining space
@ -522,14 +524,14 @@ void RomListWidget::drawWidget(bool hilite)
{
// Draw mnemonic
s.drawString(_font, dlist[pos].disasm.substr(0, 7), xpos + _labelWidth, ypos,
7 * _fontWidth, kTextColor);
7 * _fontWidth, textColor);
// Draw operand
if (dlist[pos].disasm.length() > 8)
s.drawString(_font, dlist[pos].disasm.substr(8), xpos + _labelWidth + 7 * _fontWidth, ypos,
codeDisasmW - 7 * _fontWidth, kTextColor);
codeDisasmW - 7 * _fontWidth, textColor);
// Draw cycle count
s.drawString(_font, dlist[pos].ccount, xpos + _labelWidth + codeDisasmW, ypos,
cycleCountW, kTextColor);
cycleCountW, textColor);
}
else
{
@ -546,7 +548,7 @@ void RomListWidget::drawWidget(bool hilite)
if (_selectedItem == pos && _editMode)
{
adjustOffset();
s.drawString(_font, editString(), _x + r.x(), ypos, r.width(), kTextColor,
s.drawString(_font, editString(), _x + r.x(), ypos, r.width(), textColor,
TextAlign::Left, -_editScrollOffset, false);
drawCaret();
@ -561,7 +563,7 @@ void RomListWidget::drawWidget(bool hilite)
{
// Draw disassembly, giving it all remaining horizontal space
s.drawString(_font, dlist[pos].disasm, xpos + _labelWidth, ypos,
noTypeDisasmW, kTextColor);
noTypeDisasmW, textColor);
}
}
}

View File

@ -73,6 +73,7 @@ void ToggleBitWidget::drawWidget(bool hilite)
{
//cerr << "ToggleBitWidget::drawWidget\n";
FBSurface& s = dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int row, col;
string buffer;
@ -114,11 +115,11 @@ void ToggleBitWidget::drawWidget(bool hilite)
// Highlight changes
if(_changedList[pos])
{
s.fillRect(x - 3, y - 1, _colWidth-1, _rowHeight-1, kDbgChangedColor);
s.drawString(_font, buffer, x, y, _colWidth, kDbgChangedTextColor);
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, textColor);
s.drawString(_font, buffer, x, y, _colWidth, onTop ? textColor : kColor);
}
else
{

View File

@ -92,8 +92,6 @@ class FilesystemNode
*/
explicit FilesystemNode(const string& path);
virtual ~FilesystemNode() = default;
/**
* Assignment operators.
*/
@ -136,7 +134,7 @@ class FilesystemNode
*
* @return bool true if the path exists, false otherwise.
*/
virtual bool exists() const;
bool exists() const;
/**
* Return a list of child nodes of this directory node. If called on a node
@ -145,8 +143,8 @@ class FilesystemNode
* @return true if successful, false otherwise (e.g. when the directory
* does not exist).
*/
virtual bool getChildren(FSList& fslist, ListMode mode = kListDirectoriesOnly,
bool hidden = false) const;
bool getChildren(FSList& fslist, ListMode mode = kListDirectoriesOnly,
bool hidden = false) const;
/**
* Return a string representation of the name of the file. This is can be
@ -156,7 +154,7 @@ class FilesystemNode
*
* @return the file name
*/
virtual const string& getName() const;
const string& getName() const;
/**
* Return a string representation of the file which can be passed to fopen().
@ -165,7 +163,7 @@ class FilesystemNode
*
* @return the 'path' represented by this filesystem node
*/
virtual const string& getPath() const;
const string& getPath() const;
/**
* Return a string representation of the file which contains the '~'
@ -174,7 +172,7 @@ class FilesystemNode
*
* @return the 'path' represented by this filesystem node
*/
virtual string getShortPath() const;
string getShortPath() const;
/**
* Determine whether this node has a parent.
@ -190,14 +188,14 @@ class FilesystemNode
/**
* Indicates whether the path refers to a directory or not.
*/
virtual bool isDirectory() const;
bool isDirectory() const;
/**
* Indicates whether the path refers to a real file or not.
*
* Currently, a symlink or pipe is not considered a file.
*/
virtual bool isFile() const;
bool isFile() const;
/**
* Indicates whether the object referred by this path can be read from or not.
@ -210,7 +208,7 @@ class FilesystemNode
*
* @return bool true if the object can be read, false otherwise.
*/
virtual bool isReadable() const;
bool isReadable() const;
/**
* Indicates whether the object referred by this path can be written to or not.
@ -224,21 +222,21 @@ class FilesystemNode
*
* @return bool true if the object can be written to, false otherwise.
*/
virtual bool isWritable() const;
bool isWritable() const;
/**
* Create a directory from the current node path.
*
* @return bool true if the directory was created, false otherwise.
*/
virtual bool makeDir();
bool makeDir();
/**
* Rename the current node path with the new given name.
*
* @return bool true if the node was renamed, false otherwise.
*/
virtual bool rename(const string& newfile);
bool rename(const string& newfile);
/**
* Read data (binary format) into the given buffer.
@ -249,7 +247,7 @@ class FilesystemNode
* This method can throw exceptions, and should be used inside
* a try-catch block.
*/
virtual uInt32 read(BytePtr& buffer) const;
uInt32 read(BytePtr& buffer) const;
/**
* The following methods are almost exactly the same as the various

View File

@ -96,6 +96,7 @@ void CheckListWidget::drawWidget(bool hilite)
{
//cerr << "CheckListWidget::drawWidget\n";
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int i, pos, len = int(_list.size());
// Draw a thin frame around the list and to separate columns
@ -126,17 +127,17 @@ void CheckListWidget::drawWidget(bool hilite)
}
else
s.frameRect(_x + r.left - 3, _y + 1 + _fontHeight * i,
_w - r.left, _fontHeight, kTextColorHi);
_w - r.left, _fontHeight, onTop ? kTextColorHi : kColor);
}
if (_selectedItem == pos && _editMode)
{
adjustOffset();
s.drawString(_font, editString(), _x + r.left, y, r.width(), kTextColor,
s.drawString(_font, editString(), _x + r.left, y, r.width(), onTop ? kTextColor : kColor,
TextAlign::Left, -_editScrollOffset, false);
}
else
s.drawString(_font, _list[pos], _x + r.left, y, r.width(), textColor);
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

View File

@ -46,12 +46,13 @@ void ColorWidget::setColor(int color)
void ColorWidget::drawWidget(bool hilite)
{
FBSurface& s = dialog().surface();
bool onTop = _boss->dialog().isOnTop();
// Draw a thin frame around us.
s.frameRect(_x, _y, _w, _h + 1, kColor);
// Show the currently selected color
s.fillRect(_x+1, _y+1, _w-2, _h-1, isEnabled() ? _color : kWidColor);
s.fillRect(_x+1, _y+1, _w-2, _h-1, onTop ? isEnabled() ? _color : kWidColor : kDlgColor);
// Cross out the grid?
if(_crossGrid)

View File

@ -28,7 +28,7 @@ EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
_changed(false)
{
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
startEditMode(); // We're always in edit mode
}
@ -80,15 +80,13 @@ void EditTextWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount
void EditTextWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
// Highlight changes
if(_changed)
if(_changed && onTop)
s.fillRect(_x, _y, _w, _h, kDbgChangedColor);
else if(!isEditable())
{
bool onTop = _boss->dialog().isOnTop();
s.fillRect(_x, _y, _w, _h, onTop ? kDlgColor : kBGColorLo);
}
// Draw a thin frame around us.
s.frameRect(_x, _y, _w, _h, hilite && isEditable() && isEnabled() ? kWidColorHi : kColor);
@ -96,7 +94,9 @@ void EditTextWidget::drawWidget(bool hilite)
// Draw the text
adjustOffset();
s.drawString(_font, editString(), _x + 2, _y + 2, getEditRect().width(),
!_changed ? _textcolor : uInt32(kDbgChangedTextColor),
_changed && onTop
? uInt32(kDbgChangedTextColor)
: onTop ? _textcolor : kColor,
TextAlign::Left, -_editScrollOffset, false);
// Draw the caret

View File

@ -198,6 +198,7 @@ void PopUpWidget::drawWidget(bool hilite)
{
//cerr << "PopUpWidget::drawWidget\n";
FBSurface& s = dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int x = _x + _labelWidth;
int w = _w - _labelWidth;
@ -205,23 +206,23 @@ void PopUpWidget::drawWidget(bool hilite)
// Draw the label, if any
if(_labelWidth > 0)
s.drawString(_font, _label, _x, _y + myTextY, _labelWidth,
isEnabled() ? _textcolor : uInt32(kColor), TextAlign::Left);
isEnabled() && onTop ? _textcolor : uInt32(kColor), TextAlign::Left);
// Draw a thin frame around us.
s.frameRect(x, _y, w, _h, isEnabled() && hilite ? kWidColorHi : kColor);
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, isEnabled() && hilite ? kWidColorHi : kBGColorLo);
// Fill the background
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, _changed ? kDbgChangedColor : kWidColor);
s.fillRect(x + w - 15, _y + 2, 13, _h - 4, isEnabled() && hilite ? kWidColor : kBGColorHi);
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, onTop ? _changed ? kDbgChangedColor : kWidColor : kDlgColor);
s.fillRect(x + w - 15, _y + 2, 13, _h - 4, onTop ? isEnabled() && hilite ? kWidColor : kBGColorHi : kBGColorLo);
// Draw an arrow pointing down at the right end to signal this is a dropdown/popup
s.drawBitmap(down_arrow, x + w - 13, _y + myArrowsY + 1,
!isEnabled() ? kColor : kTextColor, 9u, 8u);
!(isEnabled() && onTop) ? kColor : kTextColor, 9u, 8u);
// Draw the selected entry, if any
const string& name = myMenu->getSelectedName();
TextAlign align = (_font.getStringWidth(name) > w-6) ?
TextAlign::Right : TextAlign::Left;
s.drawString(_font, name, x+2, _y+myTextY, w-6,
!isEnabled() ? kColor : kTextColor, align);
!(isEnabled() && onTop) ? kColor : kTextColor, align);
}

View File

@ -166,13 +166,13 @@ void RomInfoWidget::drawWidget(bool hilite)
const GUI::Font& font = instance().frameBuffer().font();
uInt32 x = _x + ((_w - font.getStringWidth(mySurfaceErrorMsg)) >> 1);
uInt32 y = _y + ((yoff - font.getLineHeight()) >> 1);
s.drawString(font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor);
s.drawString(font, mySurfaceErrorMsg, x, y, _w - 10, onTop ? _textcolor : _shadowcolor);
}
int xpos = _x + 8, ypos = _y + yoff + 10;
for(const auto& info: myRomInfo)
{
s.drawString(_font, info, xpos, ypos, _w - 16, _textcolor);
s.drawString(_font, info, xpos, ypos, _w - 16, onTop ? _textcolor : _shadowcolor);
ypos += _font.getLineHeight();
}
}

View File

@ -249,6 +249,7 @@ void ScrollBarWidget::drawWidget(bool hilite)
{
//cerr << "ScrollBarWidget::drawWidget\n";
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int bottomY = _y + _h;
bool isSinglePage = (_numEntries <= _entriesPerPage);
@ -273,7 +274,7 @@ void ScrollBarWidget::drawWidget(bool hilite)
if(!isSinglePage)
{
s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2,
(hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor);
onTop ? (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor : kColor);
}
}

View File

@ -58,6 +58,7 @@ void StringListWidget::handleMouseLeft()
void StringListWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
int i, pos, len = int(_list.size());
// Draw a thin frame around the list.
@ -67,7 +68,7 @@ void StringListWidget::drawWidget(bool hilite)
for (i = 0, pos = _currentPos; i < _rows && pos < len; i++, pos++)
{
const int y = _y + 2 + _fontHeight * i;
uInt32 textColor = kTextColor;
uInt32 textColor = onTop ? kTextColor : kShadowColor;
// Draw the selected item inverted, on a highlighted background.
if (_selectedItem == pos && _hilite)
@ -78,10 +79,7 @@ void StringListWidget::drawWidget(bool hilite)
textColor = kTextColorInv;
}
else
{
bool onTop = _boss->dialog().isOnTop();
s.frameRect(_x + 1, _y + 1 + _fontHeight * i, _w - 1, _fontHeight, onTop ? kWidColorHi : kBGColorLo);
}
}
GUI::Rect r(getEditRect());

View File

@ -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 ? kTextColor : kColor;
uInt32 fontcolor = _tabs[i].enabled && onTop? kTextColor : kColor;
int yOffset = (i == _activeTab) ? 0 : 1;
s.fillRect(x, _y + 1, _tabWidth, _tabHeight - 1,
(i == _activeTab)

View File

@ -354,8 +354,9 @@ void StaticTextWidget::setLabel(const string& label)
void StaticTextWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
s.drawString(_font, _label, _x, _y, _w,
isEnabled() ? _textcolor : uInt32(kColor), _align, 0, true, _shadowcolor);
isEnabled() && onTop ? _textcolor : uInt32(kColor), _align, 0, true, _shadowcolor);
setDirty();
}
@ -542,6 +543,7 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
{
_flags = WIDGET_ENABLED;
_bgcolor = _bgcolorhi = kWidColor;
_bgcolorlo = kDlgColor;
_editable = true;
@ -638,19 +640,20 @@ void CheckboxWidget::setState(bool state, bool changed)
void CheckboxWidget::drawWidget(bool hilite)
{
FBSurface& s = _boss->dialog().surface();
bool onTop = _boss->dialog().isOnTop();
if(_drawBox)
s.frameRect(_x, _y + _boxY, 14, 14, hilite && isEnabled() && isEditable() ? kWidColorHi : kColor);
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 ? uInt32(kDbgChangedColor)
: isEnabled() ? _bgcolor : uInt32(kColor));
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? onTop ? uInt32(kDbgChangedColor) : kDlgColor
: isEnabled() ? onTop ? _bgcolor : kDlgColor : uInt32(kColor));
if(_state)
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, onTop && isEnabled() ? hilite && isEditable() ? kWidColorHi : kCheckColor
: kColor, 10);
// Finally draw the label
s.drawString(_font, _label, _x + 20, _y + _textY, _w,
isEnabled() ? kTextColor : kColor);
onTop && isEnabled() ? kTextColor : kColor);
setDirty();
}

View File

@ -59,14 +59,16 @@ FilesystemNodePOSIX::FilesystemNodePOSIX(const string& p, bool verify)
if(_path[0] == '~')
{
const char* home = getenv("HOME");
if (home != nullptr)
if(home != nullptr)
_path.replace(0, 1, home);
}
// Get absolute path
char buf[MAXPATHLEN];
if(realpath(_path.c_str(), buf))
_path = buf;
// Get absolute path (only used for relative directories)
else if(_path[0] == '.')
{
char buf[MAXPATHLEN];
if(realpath(_path.c_str(), buf))
_path = buf;
}
_displayName = lastPathComponent(_path);