added option to display detected settings info when a ROM is loaded (resolves #684)

This commit is contained in:
thrust26 2020-07-28 09:40:44 +02:00
parent 28751b0732
commit 3cc7d9b655
8 changed files with 39 additions and 3 deletions

View File

@ -35,6 +35,8 @@
* Added option to select the audio device.
* Added option to display detected settings info when a ROM is loaded.
* Replaced "Re-disassemble" with "Disassemble @ current line" in debugger.
* Fix bug when taking fullscreen snapshots; the dimensions were sometimes

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -2893,6 +2893,9 @@
</tr><tr>
<td><pre>-&lt;plr.|dev.&gt;stats &lt;1|0&gt;</pre></td>
<td>Overlay console info on the TIA image during emulation.</td>
</tr><tr>
<td><pre>-&lt;plr.|dev.&gt;detectedinfo &lt;1|0&gt;</pre></td>
<td>Display detected settings info when a ROM is loaded.</td>
</tr><tr>
<td><pre>-&lt;plr.|dev.&gt;console &lt;2600|7800&gt;</pre></td>
<td>Select console for B/W and Pause key handling and RAM initialization.</td>
@ -3606,6 +3609,7 @@
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
<tr><td>Player/Developer settings</td><td>Selects the active settings set</td><td>-dev.settings</td></tr>
<tr><td>Console info overlay</td><td>Overlay console info on the TIA image during emulation.</td><td>-plr.stats<br/>-dev.stats</td></tr>
<tr><td>Detected settings info</td><td>Display detected settings when a ROM is loaded.</td><td>-plr.detectedinfo<br/>-dev.detectedinfo</td></tr>
<tr><td>Console</td><td>Select the console type, this affects Color/B&W/Pause key emulation and zero-page RAM initialization</td><td>-plr.console <br/>-dev.console</td></tr>
<tr><td>Random startup bank</td><td>Randomize the startup bank (only for selected bankswitch types)</td><td>-plr.bankrandom<br/>-dev.bankrandom</td></tr>
<tr><td>Randomize zero-page ...</td><td>When loading a ROM, randomize all RAM content instead of initializing with all zeroes (for 'Console' = 'Atari 2600' only)</td><td>-plr.ramrandom<br/>-dev.ramrandom</td></tr>

View File

@ -451,8 +451,8 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
myConsole->initializeAudio();
string saveOnExit = settings().getString("saveonexit");
bool activeTM = settings().getBool(
settings().getBool("dev.settings") ? "dev.timemachine" : "plr.timemachine");
bool devSettings = settings().getBool("dev.settings");
bool activeTM = settings().getBool(devSettings ? "dev.timemachine" : "plr.timemachine");
if (saveOnExit == "all" && activeTM)
myEventHandler->handleEvent(Event::LoadAllStates);
@ -483,7 +483,19 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
if(mySettings->getBool("debug"))
myEventHandler->enterDebugMode();
#endif
if(!showmessage &&
settings().getBool(devSettings ? "dev.detectedinfo" : "plr.detectedinfo"))
{
ostringstream msg;
msg << myConsole->leftController().name() << "/" << myConsole->rightController().name()
<< " - " << myConsole->cartridge().detectedType()
<< " - " << myConsole->getFormatString();
myFrameBuffer->showMessage(msg.str());
}
}
return EmptyString;
}

View File

@ -198,6 +198,7 @@ Settings::Settings()
setPermanent("plr.tm.uncompressed", 60);
setPermanent("plr.tm.interval", "30f"); // = 0.5 seconds
setPermanent("plr.tm.horizon", "10m"); // = ~10 minutes
setPermanent("plr.detectedinfo", "false");
setPermanent("plr.eepromaccess", "false");
// Developer settings
@ -227,6 +228,7 @@ Settings::Settings()
setPermanent("dev.tm.horizon", "30s"); // = ~30 seconds
// Thumb ARM emulation options
setPermanent("dev.thumb.trapfatal", "true");
setPermanent("dev.detectedinfo", "true");
setPermanent("dev.eepromaccess", "true");
}
@ -616,6 +618,7 @@ void Settings::usage() const
<< " mode\n"
<< endl
<< " -plr.stats <1|0> Overlay console info during emulation\n"
<< " -plr.detectedinfo <1|0> Enable initial detected settings info\n"
<< " -plr.console <2600|7800> Select console for B/W and Pause key\n"
<< " handling and RAM initialization\n"
<< " -plr.bankrandom <1|0> Randomize the startup bank on reset\n"
@ -631,6 +634,7 @@ void Settings::usage() const
<< endl
<< " The same parameters but for developer settings mode\n"
<< " -dev.stats <1|0> Overlay console info during emulation\n"
<< " -dev.detectedinfo <1|0> Enable initial detected settings info\n"
<< " -dev.console <2600|7800> Select console for B/W and Pause key\n"
<< " handling and RAM initialization\n"
<< " -dev.bankrandom <1|0> Randomize the startup bank on reset\n"

View File

@ -111,8 +111,15 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
wid.push_back(r);
ypos += lineHeight + VGAP * 1;
myFrameStatsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Console info overlay");
myFrameStatsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
"Console info overlay");
wid.push_back(myFrameStatsWidget);
myDetectedInfoWidget = new CheckboxWidget(myTab, font,
myFrameStatsWidget->getRight() + fontWidth * 2.5, ypos + 1,
"Detected settings info");
wid.push_back(myDetectedInfoWidget);
ypos += lineHeight + VGAP;
// 2600/7800 mode
@ -611,6 +618,7 @@ void DeveloperDialog::loadSettings(SettingsSet set)
const string& prefix = devSettings ? "dev." : "plr.";
myFrameStats[set] = instance().settings().getBool(prefix + "stats");
myDetectedInfo[set] = instance().settings().getBool(prefix + "detectedinfo");
myConsole[set] = instance().settings().getString(prefix + "console") == "7800" ? 1 : 0;
// Randomization
myRandomBank[set] = instance().settings().getBool(prefix + "bankrandom");
@ -662,6 +670,7 @@ void DeveloperDialog::saveSettings(SettingsSet set)
const string& prefix = devSettings ? "dev." : "plr.";
instance().settings().setValue(prefix + "stats", myFrameStats[set]);
instance().settings().setValue(prefix + "detectedinfo", myDetectedInfo[set]);
instance().settings().setValue(prefix + "console", myConsole[set] == 1 ? "7800" : "2600");
if(instance().hasConsole())
instance().eventHandler().set7800Mode();
@ -724,6 +733,7 @@ void DeveloperDialog::saveSettings(SettingsSet set)
void DeveloperDialog::getWidgetStates(SettingsSet set)
{
myFrameStats[set] = myFrameStatsWidget->getState();
myDetectedInfo[set] = myDetectedInfoWidget->getState();
myConsole[set] = myConsoleWidget->getSelected() == 1;
// Randomization
myRandomBank[set] = myRandomBankWidget->getState();
@ -775,6 +785,7 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
void DeveloperDialog::setWidgetStates(SettingsSet set)
{
myFrameStatsWidget->setState(myFrameStats[set]);
myDetectedInfoWidget->setState(myDetectedInfo[set]);
myConsoleWidget->setSelectedIndex(myConsole[set]);
// Randomization
myRandomBankWidget->setState(myRandomBank[set]);
@ -955,6 +966,7 @@ void DeveloperDialog::setDefaults()
{
case 0: // Emulation
myFrameStats[set] = devSettings ? true : false;
myDetectedInfo[set] = devSettings ? true : false;
myConsole[set] = 0;
// Randomization
myRandomBank[set] = devSettings ? true : false;

View File

@ -90,6 +90,7 @@ class DeveloperDialog : public Dialog
// Emulator widgets
RadioButtonGroup* mySettingsGroupEmulation{nullptr};
CheckboxWidget* myFrameStatsWidget{nullptr};
CheckboxWidget* myDetectedInfoWidget{nullptr};
PopUpWidget* myConsoleWidget{nullptr};
StaticTextWidget* myLoadingROMLabel{nullptr};
CheckboxWidget* myRandomBankWidget{nullptr};
@ -148,6 +149,7 @@ class DeveloperDialog : public Dialog
bool mySettings;
// Emulator sets
std::array<bool, 2> myFrameStats;
std::array<bool, 2> myDetectedInfo;
std::array<int, 2> myConsole;
std::array<bool, 2> myRandomBank;
std::array<bool, 2> myRandomizeRAM;