DeveloperDialog added

- developer only options now have "dev." prefix
- options relevant for players and developers are duplicated ("dev." prefix)
This commit is contained in:
thrust26 2017-11-17 14:02:10 +01:00
parent 39f839021e
commit b5c9842716
13 changed files with 72 additions and 26 deletions

View File

@ -361,9 +361,9 @@ void RiotWidget::loadConfig()
myLeftControl->loadConfig();
myRightControl->loadConfig();
myRandomizeRAM->setState(instance().settings().getBool("ramrandom"));
myRandomizeRAM->setState(instance().settings().getBool("dev.ramrandom"));
const string& cpurandom = instance().settings().getString("cpurandom");
const string& cpurandom = instance().settings().getString("dev.cpurandom");
const char* const cpuregs[] = { "S", "A", "X", "Y", "P" };
for(int i = 0; i < 5; ++i)
myRandomizeCPU[i]->setState(BSPF::containsIgnoreCase(cpurandom, cpuregs[i]));
@ -451,7 +451,7 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
handleConsole();
break;
case kRandRAMID:
instance().settings().setValue("ramrandom", myRandomizeRAM->getState());
instance().settings().setValue("dev.ramrandom", myRandomizeRAM->getState());
break;
case kRandCPUID:
handleRandomCPU();
@ -523,7 +523,7 @@ void RiotWidget::handleConsole()
{
myTVType->setSelectedIndex(myPause->getState() ? 0 : 1);
myRandomizeRAM->setState(false);
instance().settings().setValue("ramrandom", 0);
instance().settings().setValue("dev.ramrandom", 0);
}
else
{
@ -541,5 +541,5 @@ void RiotWidget::handleRandomCPU()
if(myRandomizeCPU[i]->getState())
cpurandom += cpuregs[i];
instance().settings().setValue("cpurandom", cpurandom);
instance().settings().setValue("dev.cpurandom", cpurandom);
}

View File

@ -91,7 +91,7 @@ void Cartridge::createCodeAccessBase(uInt32 size)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge::initializeRAM(uInt8* arr, uInt32 size, uInt8 val) const
{
if(mySettings.getBool("ramrandom"))
if(mySettings.getBool("dev.ramrandom"))
for(uInt32 i = 0; i < size; ++i)
arr[i] = mySystem->randGenerator().next();
else

View File

@ -366,10 +366,11 @@ void Console::toggleFormat(int direction)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleColorLoss()
{
bool colorloss = !myOSystem.settings().getBool("colorloss");
bool devSettings = myOSystem.settings().getBool("dev.settings");
bool colorloss = !myOSystem.settings().getBool(devSettings ? "dev.colorloss" : "colorloss");
if(myTIA->enableColorLoss(colorloss))
{
myOSystem.settings().setValue("colorloss", colorloss);
myOSystem.settings().setValue(devSettings ? "dev.colorloss" : "colorloss", colorloss);
string message = string("PAL color-loss ") +
(colorloss ? "enabled" : "disabled");
myOSystem.frameBuffer().showMessage(message);

View File

@ -85,7 +85,7 @@ void M6502::reset()
myExecutionStatus = 0;
// Set registers to random or default values
const string& cpurandom = mySettings.getString("cpurandom");
const string& cpurandom = mySettings.getString("dev.cpurandom");
SP = BSPF::containsIgnoreCase(cpurandom, "S") ?
mySystem->randGenerator().next() : 0xfd;
A = BSPF::containsIgnoreCase(cpurandom, "A") ?

View File

@ -61,7 +61,7 @@ void M6532::reset()
if(mySettings.getString("console") == "7800")
for(uInt32 t = 0; t < 128; ++t)
myRAM[t] = RAM_7800[t];
else if(mySettings.getBool("ramrandom"))
else if(mySettings.getBool("dev.ramrandom"))
for(uInt32 t = 0; t < 128; ++t)
myRAM[t] = mySystem->randGenerator().next();
else

View File

@ -61,6 +61,7 @@ class OSystem
{
friend class EventHandler;
friend class VideoDialog;
friend class DeveloperDialog;
public:
OSystem();

View File

@ -130,10 +130,7 @@ Settings::Settings(OSystem& osystem)
setInternal("autoslot", "false");
setInternal("loglevel", "1");
setInternal("logtoconsole", "0");
setInternal("tiadriven", "false");
setInternal("console", "2600"); // 7800
setInternal("cpurandom", "");
setInternal("ramrandom", "true");
setInternal("avoxport", "");
setInternal("stats", "false");
setInternal("fastscbios", "true");
@ -151,6 +148,17 @@ Settings::Settings(OSystem& osystem)
setInternal("dis.relocate", "false");
#endif
// developer settings
setInternal("dev.settings", "false");
setInternal("dev.bankrandom", "true");
setInternal("dev.ramrandom", "true");
setInternal("dev.cpurandom", "SAXYP");
setInternal("dev.colorloss", "true");
setInternal("dev.tv.jitter", "true");
setInternal("dev.tv.jitter_recovery", "1");
setInternal("dev.debugcolors", "false");
setInternal("dev.tiadriven", "true");
#ifdef DTHUMB_SUPPORT
// Thumb ARM emulation options
setInternal("thumb.trapfatal", "true");
@ -291,6 +299,8 @@ void Settings::validate()
i = getInt("tv.jitter_recovery");
if(i < 1 || i > 20) setInternal("tv.jitter_recovery", "10");
i = getInt("dev.tv.jitter_recovery");
if(i < 1 || i > 20) setInternal("dev.tv.jitter_recovery", "10");
#ifdef SOUND_SUPPORT
i = getInt("volume");
@ -455,9 +465,6 @@ void Settings::usage() const
<< " -holdselect Start the emulator with the Game Select switch held down\n"
<< " -holdjoy0 <U,D,L,R,F> Start the emulator with the left joystick direction/fire button held down\n"
<< " -holdjoy1 <U,D,L,R,F> Start the emulator with the right joystick direction/fire button held down\n"
<< " -tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
<< " -cpurandom <1|0> Randomize the contents of CPU registers on reset\n"
<< " -ramrandom <1|0> Randomize the contents of RAM on reset\n"
<< " -maxres <WxH> Used by developers to force the maximum size of the application window\n"
<< " -help Show the text you're now reading\n"
#ifdef DEBUGGER_SUPPORT
@ -492,8 +499,17 @@ void Settings::usage() const
<< " -pp <arg> Sets the 'Display.Phosphor' property\n"
<< " -ppblend <arg> Sets the 'Display.PPBlend' property\n"
#endif
<< " -dev.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
<< " -dev.cpurandom <1|0> Randomize the contents of CPU registers on reset\n"
<< " -dev.ramrandom <1|0> Randomize the contents of RAM on reset\n"
<< " -dev.colorloss <1|0> Enable PAL color-loss effect\n"
<< " -dev.tv.jitter <1|0> Enable TV jitter effect\n"
<< " -dev.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n"
<< " -dev.debugcolors <1|0> Enable debug colors\n"
#ifdef DTHUMB_SUPPORT
<< " -thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n"
<< " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n"
#endif
<< endl << std::flush;
}

View File

@ -79,7 +79,7 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
mySpriteEnabledBits(0xFF),
myCollisionsEnabledBits(0xFF)
{
myTIAPinsDriven = mySettings.getBool("tiadriven");
myTIAPinsDriven = mySettings.getBool("dev.tiadriven");
myBackground.setTIA(this);
myPlayfield.setTIA(this);
@ -89,8 +89,9 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
myMissile1.setTIA(this);
myBall.setTIA(this);
myEnableJitter = mySettings.getBool("tv.jitter");
myJitterFactor = mySettings.getInt("tv.jitter_recovery");
bool devSettings = mySettings.getBool("dev.settings");
myEnableJitter = mySettings.getBool(devSettings ? "dev.tv.jitter" : "tv.jitter");
myJitterFactor = mySettings.getInt(devSettings ? "dev.tv.jitter_recovery" : "tv.jitter_recovery");
reset();
}
@ -172,7 +173,7 @@ void TIA::reset()
frameReset(); // Recalculate the size of the display
// Must be done last, after all other items have reset
enableFixedColors(false);
enableFixedColors(mySettings.getBool("dev.settings") && mySettings.getBool("dev.debugcolors"));
setFixedColorPalette(mySettings.getString("tia.dbgcolors"));
#ifdef DEBUGGER_SUPPORT
@ -185,7 +186,7 @@ void TIA::frameReset()
{
memset(myFramebuffer, 0, 160 * TIAConstants::frameBufferHeight);
myAutoFrameEnabled = mySettings.getInt("framerate") <= 0;
enableColorLoss(mySettings.getBool("colorloss"));
enableColorLoss(mySettings.getBool(mySettings.getBool("dev.settings") ? "dev.colorloss" : "colorloss"));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -1006,7 +1007,7 @@ bool TIA::driveUnusedPinsRandom(uInt8 mode)
if (mode == 0 || mode == 1)
{
myTIAPinsDriven = bool(mode);
mySettings.setValue("tiadriven", myTIAPinsDriven);
mySettings.setValue("dev.tiadriven", myTIAPinsDriven);
}
return myTIAPinsDriven;
}

View File

@ -29,6 +29,7 @@
#include "RomAuditDialog.hxx"
#include "GameInfoDialog.hxx"
#include "LoggerDialog.hxx"
#include "DeveloperDialog.hxx"
#include "HelpDialog.hxx"
#include "AboutDialog.hxx"
#include "OptionsDialog.hxx"
@ -47,7 +48,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
myIsGlobal(global)
{
const GUI::Font& font = instance().frameBuffer().font();
const int buttonWidth = font.getStringWidth("Snapshot Settings" + ELLIPSIS) + 20,
const int buttonWidth = font.getStringWidth("Developer Settings" + ELLIPSIS) + 20,
buttonHeight = font.getLineHeight() + 6,
rowHeight = font.getLineHeight() + 10;
@ -105,6 +106,9 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
b = ADD_OD_BUTTON("System Logs" + ELLIPSIS, kLoggerCmd);
wid.push_back(b);
b = ADD_OD_BUTTON("Developer Settings" + ELLIPSIS, kDevelopCmd);
wid.push_back(b);
b = ADD_OD_BUTTON("Help" + ELLIPSIS, kHelpCmd);
wid.push_back(b);
@ -128,6 +132,7 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
myCheatCodeDialog = make_unique<CheatCodeDialog>(osystem, parent, font);
#endif
myLoggerDialog = make_unique<LoggerDialog>(osystem, parent, font, max_w, max_h);
myDeveloperDialog = make_unique<DeveloperDialog>(osystem, parent, font, max_w, max_h);
myHelpDialog = make_unique<HelpDialog>(osystem, parent, font);
myAboutDialog = make_unique<AboutDialog>(osystem, parent, font);
@ -224,6 +229,10 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
myLoggerDialog->open();
break;
case kDevelopCmd:
myDeveloperDialog->open();
break;
case kHelpCmd:
myHelpDialog->open();
break;

View File

@ -40,6 +40,8 @@ class OSystem;
#include "LoggerDialog.hxx"
#include "bspf.hxx"
class DeveloperDialog;
class OptionsDialog : public Dialog
{
public:
@ -64,6 +66,7 @@ class OptionsDialog : public Dialog
unique_ptr<CheatCodeDialog> myCheatCodeDialog;
#endif
unique_ptr<LoggerDialog> myLoggerDialog;
unique_ptr<DeveloperDialog> myDeveloperDialog;
unique_ptr<HelpDialog> myHelpDialog;
unique_ptr<AboutDialog> myAboutDialog;
@ -85,6 +88,7 @@ class OptionsDialog : public Dialog
kInfoCmd = 'INFO',
kCheatCmd = 'CHET',
kLoggerCmd = 'LOGG',
kDevelopCmd = 'DEVL',
kHelpCmd = 'HELP',
kAboutCmd = 'ABOU',
kExitCmd = 'EXIM'

View File

@ -436,6 +436,7 @@ void VideoDialog::loadConfig()
// PAL color-loss effect
myColorLoss->setState(instance().settings().getBool("colorloss"));
myColorLoss->setEnabled(!instance().settings().getBool("dev.settings"));
// Show UI messages
myUIMessages->setState(instance().settings().getBool("uimessages"));
@ -485,6 +486,8 @@ void VideoDialog::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::saveConfig()
{
bool devSettings = instance().settings().getBool("dev.settings");
// Renderer setting
instance().settings().setValue("video",
myRenderer->getSelectedTag().toString());
@ -524,7 +527,7 @@ void VideoDialog::saveConfig()
// PAL color-loss effect
instance().settings().setValue("colorloss", myColorLoss->getState());
if(instance().hasConsole())
if(instance().hasConsole() && !devSettings)
instance().console().toggleColorLoss(myColorLoss->getState());
// Fullscreen stretch setting
@ -576,7 +579,7 @@ void VideoDialog::saveConfig()
// TV jitter
instance().settings().setValue("tv.jitter", myTVJitter->getState());
instance().settings().setValue("tv.jitter_recovery", myTVJitterRecLabel->getLabel());
if(instance().hasConsole())
if(instance().hasConsole() && !devSettings)
{
instance().console().tia().toggleJitter(myTVJitter->getState() ? 1 : 0);
instance().console().tia().setJitterRecoveryFactor(myTVJitterRec->getValue());
@ -708,7 +711,10 @@ void VideoDialog::handleTVModeChange(NTSCFilter::Preset preset)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleTVJitterChange(bool enable)
{
bool devSettings = instance().settings().getBool("dev.settings");
myTVJitter->setState(enable);
enable &= !devSettings;
myTVJitter->setEnabled(!devSettings);
myTVJitterRec->setEnabled(enable);
myTVJitterRecLabel->setEnabled(enable);
}

View File

@ -339,6 +339,7 @@
<ClCompile Include="..\gui\JoystickDialog.cxx" />
<ClCompile Include="..\gui\LoggerDialog.cxx" />
<ClCompile Include="..\gui\SnapshotDialog.cxx" />
<ClCompile Include="DeveloperDialog.cxx" />
<ClCompile Include="FSNodeWINDOWS.cxx" />
<ClCompile Include="OSystemWINDOWS.cxx" />
<ClCompile Include="..\common\PNGLibrary.cxx" />
@ -637,6 +638,7 @@
<ClInclude Include="..\libpng\pnginfo.h" />
<ClInclude Include="..\libpng\pnglibconf.h" />
<ClInclude Include="..\libpng\pngstruct.h" />
<ClInclude Include="DeveloperDialog.hxx" />
<ClInclude Include="FSNodeWINDOWS.hxx" />
<ClInclude Include="HomeFinder.hxx" />
<ClInclude Include="OSystemWINDOWS.hxx" />

View File

@ -864,6 +864,9 @@
<ClCompile Include="..\emucore\tia\frame-manager\YStartDetector.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DeveloperDialog.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@ -1763,6 +1766,9 @@
<ClInclude Include="..\emucore\tia\frame-manager\YStartDetector.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DeveloperDialog.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">