When compiled for R77, use 'minimal_ui' mode.

This commit is contained in:
Stephen Anthony 2019-03-09 14:35:22 -03:30
parent fa59b6b9d2
commit 51981d633d
5 changed files with 74 additions and 49 deletions

View File

@ -2919,7 +2919,7 @@
least 640x480. If the launcher isn't large enough, the functionality least 640x480. If the launcher isn't large enough, the functionality
will be disabled.</li> will be disabled.</li>
<li>To view snapshots in 2x mode, the ROM launcher window must be sized at <li>To view snapshots in 2x mode, the ROM launcher window must be sized at
least 1000x760. If the launcher isn't large enough, an attempt will least 1000x720. If the launcher isn't large enough, an attempt will
be made to use 1x mode.</li> be made to use 1x mode.</li>
</ol> </ol>
@ -2929,7 +2929,7 @@
<p>ROM Info Viewer in 1x mode, UI sized 800x480, small launcher font:</p> <p>ROM Info Viewer in 1x mode, UI sized 800x480, small launcher font:</p>
<img src="graphics/rominfo_1x_small.png"> <img src="graphics/rominfo_1x_small.png">
<p>ROM Info Viewer in 1x mode, UI sized 1000x760, medium launcher font:</p> <p>ROM Info Viewer in 1x mode, UI sized 1000x720, medium launcher font:</p>
<img src="graphics/rominfo_1x_large.png"> <img src="graphics/rominfo_1x_large.png">
<p>ROM Info Viewer in 2x mode, UI sized 1280x900, large launcher font:</p> <p>ROM Info Viewer in 2x mode, UI sized 1280x900, large launcher font:</p>

View File

@ -24,7 +24,7 @@ namespace TIAConstants {
constexpr uInt32 frameBufferHeight = 320; constexpr uInt32 frameBufferHeight = 320;
constexpr uInt32 maxYStart = 64; constexpr uInt32 maxYStart = 64;
constexpr uInt32 minViewableHeight = 210, maxViewableHeight = 256; constexpr uInt32 minViewableHeight = 240, maxViewableHeight = 240; // FIXME - remove this (or at least use only one)
constexpr uInt32 initialGarbageFrames = 10; constexpr uInt32 initialGarbageFrames = 10;
static constexpr uInt16 static constexpr uInt16

View File

@ -39,6 +39,7 @@
#include "StringListWidget.hxx" #include "StringListWidget.hxx"
#include "Widget.hxx" #include "Widget.hxx"
#include "Font.hxx" #include "Font.hxx"
#include "Version.hxx"
#include "LauncherDialog.hxx" #include "LauncherDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -51,6 +52,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
myQuitButton(nullptr), myQuitButton(nullptr),
myList(nullptr), myList(nullptr),
myPattern(nullptr), myPattern(nullptr),
myAllFiles(nullptr),
myRomInfoWidget(nullptr), myRomInfoWidget(nullptr),
mySelectedItem(0) mySelectedItem(0)
{ {
@ -64,9 +66,11 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
bwidth = (_w - 2 * HBORDER - BUTTON_GAP * (4 - 1)), bwidth = (_w - 2 * HBORDER - BUTTON_GAP * (4 - 1)),
bheight = lineHeight + 4, bheight = lineHeight + 4,
LBL_GAP = fontWidth; LBL_GAP = fontWidth;
int xpos, ypos = 0, lwidth = 0, lwidth2 = 0; int xpos = 0, ypos = 0, lwidth = 0, lwidth2 = 0;
WidgetArray wid; WidgetArray wid;
const bool useMinimalUI = instance().settings().getBool("minimal_ui");
string lblRom = "Select a ROM from the list" + ELLIPSIS; string lblRom = "Select a ROM from the list" + ELLIPSIS;
const string& lblFilter = "Filter"; const string& lblFilter = "Filter";
const string& lblAllFiles = "Show all files"; const string& lblAllFiles = "Show all files";
@ -84,17 +88,31 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
lwidth = font.getStringWidth(lblRom); lwidth = font.getStringWidth(lblRom);
} }
if(useMinimalUI)
{
#if defined(RETRON77)
// App information
ostringstream ver;
ver << "Stella " << STELLA_VERSION << " for RetroN 77";
ypos += 8;
new StaticTextWidget(this, font, xpos, ypos, _w - 20, fontHeight,
ver.str(), TextAlign::Center);
ypos += fontHeight;
#endif
}
// Show the header // Show the header
xpos = HBORDER; ypos += 8; xpos += HBORDER; ypos += 8;
new StaticTextWidget(this, font, xpos, ypos, lblRom); new StaticTextWidget(this, font, xpos, ypos, lblRom);
// Shop the files counter // Shop the files counter
xpos = _w - HBORDER - lwidth4; xpos = _w - HBORDER - lwidth4;
myRomCount = new StaticTextWidget(this, font, xpos, ypos, myRomCount = new StaticTextWidget(this, font, xpos, ypos,
lwidth4, fontHeight, lwidth4, fontHeight,
"", TextAlign::Right); "", TextAlign::Right);
// Add filter that can narrow the results shown in the listing // Add filter that can narrow the results shown in the listing
// It has to fit between both labels // It has to fit between both labels
if(w >= 640) if(!useMinimalUI && w >= 640)
{ {
int fwidth = std::min(15 * fontWidth, xpos - lwidth3 - lwidth2 - lwidth - HBORDER - LBL_GAP * 8); int fwidth = std::min(15 * fontWidth, xpos - lwidth3 - lwidth2 - lwidth - HBORDER - LBL_GAP * 8);
// Show the filter input field // Show the filter input field
@ -113,7 +131,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
xpos = HBORDER; ypos += lineHeight + 4; xpos = HBORDER; ypos += lineHeight + 4;
int romWidth = 0; int romWidth = 0;
int romSize = instance().settings().getInt("romviewer"); int romSize = instance().settings().getInt("romviewer");
if(romSize > 1 && w >= 1000 && h >= 760) if(romSize > 1 && w >= 1000 && h >= 720)
romWidth = 660; romWidth = 660;
else if(romSize > 0 && w >= 640 && h >= 480) else if(romSize > 0 && w >= 640 && h >= 480)
romWidth = 365; romWidth = 365;
@ -146,41 +164,44 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
myDir->setEditable(false, true); myDir->setEditable(false, true);
myDir->clearFlags(WIDGET_RETAIN_FOCUS); myDir->clearFlags(WIDGET_RETAIN_FOCUS);
// Add four buttons at the bottom if(!useMinimalUI)
xpos = HBORDER; ypos += myDir->getHeight() + 8; {
#ifndef BSPF_MACOS // Add four buttons at the bottom
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight, xpos = HBORDER; ypos += myDir->getHeight() + 8;
"Select", kLoadROMCmd); #ifndef BSPF_MACOS
wid.push_back(myStartButton); myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
xpos += (bwidth + 0) / 4 + BUTTON_GAP; "Select", kLoadROMCmd);
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight, wid.push_back(myStartButton);
"Go Up", kPrevDirCmd); xpos += (bwidth + 0) / 4 + BUTTON_GAP;
wid.push_back(myPrevDirButton); myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
xpos += (bwidth + 1) / 4 + BUTTON_GAP; "Go Up", kPrevDirCmd);
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight, wid.push_back(myPrevDirButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
#else
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
"Quit", kQuitCmd);
wid.push_back(myQuitButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
"Options" + ELLIPSIS, kOptionsCmd); "Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton); wid.push_back(myOptionsButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP; xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight, myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Quit", kQuitCmd); "Go Up", kPrevDirCmd);
wid.push_back(myQuitButton); wid.push_back(myPrevDirButton);
#else xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight, myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Quit", kQuitCmd); "Select", kLoadROMCmd);
wid.push_back(myQuitButton); wid.push_back(myStartButton);
xpos += (bwidth + 0) / 4 + BUTTON_GAP; #endif
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight, }
"Options" + ELLIPSIS, kOptionsCmd);
wid.push_back(myOptionsButton);
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
"Go Up", kPrevDirCmd);
wid.push_back(myPrevDirButton);
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
"Select", kLoadROMCmd);
wid.push_back(myStartButton);
#endif
mySelectedItem = 0; // Highlight 'Rom Listing' mySelectedItem = 0; // Highlight 'Rom Listing'
// Create an options dialog, similar to the in-game one // Create an options dialog, similar to the in-game one
@ -205,7 +226,8 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
// Do we show only ROMs or all files? // Do we show only ROMs or all files?
bool onlyROMs = instance().settings().getBool("launcherroms"); bool onlyROMs = instance().settings().getBool("launcherroms");
showOnlyROMs(onlyROMs); showOnlyROMs(onlyROMs);
myAllFiles->setState(!onlyROMs); if(myAllFiles)
myAllFiles->setState(!onlyROMs);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -249,7 +271,8 @@ void LauncherDialog::loadConfig()
// has been called (and we should reload the list) // has been called (and we should reload the list)
if(myList->getList().empty()) if(myList->getList().empty())
{ {
myPrevDirButton->setEnabled(false); if(myPrevDirButton)
myPrevDirButton->setEnabled(false);
myCurrentNode = FilesystemNode(romdir == "" ? "~" : romdir); myCurrentNode = FilesystemNode(romdir == "" ? "~" : romdir);
if(!(myCurrentNode.exists() && myCurrentNode.isDirectory())) if(!(myCurrentNode.exists() && myCurrentNode.isDirectory()))
myCurrentNode = FilesystemNode("~"); myCurrentNode = FilesystemNode("~");
@ -278,7 +301,8 @@ void LauncherDialog::updateListing(const string& nameToSelect)
loadDirListing(); loadDirListing();
// Only hilite the 'up' button if there's a parent directory // Only hilite the 'up' button if there's a parent directory
myPrevDirButton->setEnabled(myCurrentNode.hasParent()); if(myPrevDirButton)
myPrevDirButton->setEnabled(myCurrentNode.hasParent());
// Show current directory // Show current directory
myDir->setText(myCurrentNode.getShortPath()); myDir->setText(myCurrentNode.getShortPath());
@ -455,7 +479,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
switch (cmd) switch (cmd)
{ {
case kAllfilesCmd: case kAllfilesCmd:
showOnlyROMs(!myAllFiles->getState()); showOnlyROMs(myAllFiles ? !myAllFiles->getState() : true);
updateListing(); updateListing();
break; break;
case kLoadROMCmd: case kLoadROMCmd:

View File

@ -152,7 +152,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
ypos += lineHeight + V_GAP; ypos += lineHeight + V_GAP;
// Launcher font // Launcher font
pwidth = font.getStringWidth("2x (1000x760)"); pwidth = font.getStringWidth("2x (1000x720)");
items.clear(); items.clear();
VarList::push_back(items, "Small", "small"); VarList::push_back(items, "Small", "small");
VarList::push_back(items, "Medium", "medium"); VarList::push_back(items, "Medium", "medium");
@ -167,7 +167,7 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
items.clear(); items.clear();
VarList::push_back(items, "Off", "0"); VarList::push_back(items, "Off", "0");
VarList::push_back(items, "1x (640x480) ", "1"); VarList::push_back(items, "1x (640x480) ", "1");
VarList::push_back(items, "2x (1000x760)", "2"); VarList::push_back(items, "2x (1000x720)", "2");
myRomViewerPopup = myRomViewerPopup =
new PopUpWidget(myTab, font, xpos, ypos + 1, pwidth, lineHeight, items, new PopUpWidget(myTab, font, xpos, ypos + 1, pwidth, lineHeight, items,
"ROM info viewer ", lwidth, kRomViewer); "ROM info viewer ", lwidth, kRomViewer);
@ -441,7 +441,7 @@ void UIDialog::handleRomViewer()
if(myLauncherWidthSlider->getValue() >= 1000 && if(myLauncherWidthSlider->getValue() >= 1000 &&
myLauncherHeightSlider->getValue() >= 760) myLauncherHeightSlider->getValue() >= 760)
{ {
VarList::push_back(items, "2x (1000x760)", "2"); VarList::push_back(items, "2x (1000x720)", "2");
} }
myRomViewerPopup->addItems(items); myRomViewerPopup->addItems(items);

View File

@ -59,7 +59,8 @@ SettingsR77::SettingsR77()
setPermanent("romviewer", "2"); setPermanent("romviewer", "2");
setPermanent("exitlauncher", "true"); setPermanent("exitlauncher", "true");
setPermanent("dev.settings", "false"); setTemporary("minimal_ui", true);
setPermanent("dev.settings", false);
setPermanent("plr.timemachine", false); setPermanent("plr.timemachine", false);
// FIXME - these are out of date, since the # of events has changed since 3.x // FIXME - these are out of date, since the # of events has changed since 3.x