thumb.trapfatal added to developer settings dialog
restructured developer settings dialog duplicated debug colors are changed automatically updated doc and screenshots accordingly
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 5.2 KiB |
188
docs/index.html
|
@ -2421,15 +2421,6 @@
|
|||
<td>Set "Display.PPBlend" property, used for phosphor effect (0-100).
|
||||
Default is whatever is specified for tv.phosblend.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>-thumb.trapfatal <1|0></pre></td>
|
||||
<td>The default of true allows the Thumb ARM emulation to
|
||||
throw an exception and enter the debugger on fatal errors. When disabled, such
|
||||
fatal errors are simply logged, and emulation continues. Do not use this
|
||||
unless you know exactly what you're doing, as it changes the behaviour as compared
|
||||
to real hardware.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>The following are available in two sets, one for players (prefixed by "plr.") and one
|
||||
|
@ -2440,64 +2431,67 @@
|
|||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-dev.settings <1|0></pre></td>
|
||||
<td>Select developer (1) or player (0) set.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>stats <1|0></pre></td>
|
||||
<td>Overlay console info on the TIA image during emulation.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>console <2600|7800></pre></td>
|
||||
<td>Select console for B/W and Pause key handling and RAM initialization.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>bankrandom <1|0></pre></td>
|
||||
<td>On reset, randomize the startup bank (only for selected bankswitch types).</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>ramrandom <1|0></pre></td>
|
||||
<td>On reset, either randomize all RAM content, or initialize with zero (console = 2600)/startup values (console = 7800) instead.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>cpurandom <S,A,X,Y,P></pre></td>
|
||||
<td>On reset, randomize the content of the specified CPU registers.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>-<plr.|dev.>debugcolors <1|0></pre></td>
|
||||
<td>Enable/disable the fixed debug colors.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>-<plr.|dev.>colorloss <1|0></pre></td>
|
||||
<td>Enable/disable the PAL color-loss effect.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>-<plr.|dev.>tv.jitter <1|0></pre></td>
|
||||
<td>Enable TV jitter/roll effect, when there are too many or too few scanlines
|
||||
per frame.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>-<plr.|dev.>tv.jitter_recovery <1 - 20></pre></td>
|
||||
<td>When TV jitter/roll effect is enabled, determines how long to delay recovery
|
||||
time (recovery spread over multiple frames).</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>tiadriven <1|0></pre></td>
|
||||
<td>Set unused TIA pins to be randomly driven high or low on a read/peek.
|
||||
If disabled, use the last databus value for those pins instead.</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>thumb.trapfatal <1|0></pre></td>
|
||||
<td>The default of true allows the Thumb ARM emulation to
|
||||
throw an exception and enter the debugger on fatal errors. When disabled, such
|
||||
fatal errors are simply logged, and emulation continues. Do not use this
|
||||
unless you know exactly what you're doing, as it changes the behaviour as compared
|
||||
to real hardware.</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>tv.jitter <1|0></pre></td>
|
||||
<td>Enable TV jitter/roll effect, when there are too many or too few scanlines
|
||||
per frame.</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>tv.jitter_recovery <1 - 20></pre></td>
|
||||
<td>When TV jitter/roll effect is enabled, determines how long to delay recovery
|
||||
time (recovery spread over multiple frames).</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>colorloss <1|0></pre></td>
|
||||
<td>Enable/disable the PAL color-loss effect.</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>debugcolors <1|0></pre></td>
|
||||
<td>Enable/disable the fixed debug colors.</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>rewind <1|0></pre></td>
|
||||
<td>Enables continuous rewind</td>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>rewind.size <100 - 1000></pre></td>
|
||||
<td>Defines the rewind buffer size.</td>
|
||||
</tr><tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>rewind.uncompressed <100 - 1000></pre></td>
|
||||
<td>Defines the uncompressed rewind buffer size. Must be <= rewind buffer size.</td>
|
||||
</tr><tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>rewind.interval <0 - 5></pre></td>
|
||||
<td>Defines the interval between two save states.</td>
|
||||
</tr><tr>
|
||||
</tr><tr>
|
||||
<td><pre>-<plr.|dev.>rewind.horizon <0 - 6></pre></td>
|
||||
<td>Defines the horizon of the rewind buffer.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
@ -3023,11 +3017,28 @@
|
|||
<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>
|
||||
<tr><td>Randomize CPU</td><td>When loading a ROM, randomize the content of the specified CPU registers</td><td>-plr.cpurandom<br/>-dev.cpurandom</td></tr>
|
||||
<tr><td>Drive unused TIA pins ...</td><td>Unused TIA pins are read random instead of the last databus values</td><td>-plr.tiadriven<br/>-dev.tiadriven</td></tr>
|
||||
<tr><td>Fatal ARM emulation ...</td><td>Thumb ARM emulation throws an exception and enters the debugger on fatal errors.</td><td><span style="white-space:nowrap">-plr.thumb.trapfatal<br/>-dev.thumb.trapfatal</span></td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Developer Settings</b> dialog (Video):</p>
|
||||
<table border="5" cellpadding="2" frame="box" rules="none">
|
||||
<tr>
|
||||
<td><img src="graphics/options_developer_dbgcolors.png"></td>
|
||||
<td> </td>
|
||||
<td valign="top">
|
||||
<table border="1" cellpadding="4">
|
||||
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
|
||||
<tr><td>Jitter/roll effect</td><td>Emulate screen roll with inconsistent scanline count</td><td>-plr.tv.jitter<br/>-dev.tv.jitter</td></tr>
|
||||
<tr><td>(Jitter/roll) Recovery</td><td>Determines recovery time for screen rolling</td><td><span style="white-space:nowrap">-plr.tv.jitter_recovery<br/>-dev.tv.jitter_recovery</span></td></tr>
|
||||
<tr><td>PAL color-loss</td><td>Use PAL color-loss effect</td><td>-plr.colorloss<br/>-dev.colorloss</td></tr>
|
||||
<tr><td>Debug colors</td><td>Use fixed debug colors</td><td>-plr.debugcolors<br/>-dev.debugcolors</td></tr>
|
||||
<tr><td>Jitter/roll effect</td><td>Emulate screen roll with inconsistent scanline count</td><td>-plr.tv.jitter<br/>-dev.tv.jitter</td></tr>
|
||||
<tr><td>(Jitter/roll) Recovery</td><td>Determines recovery time for screen rolling</td><td>-plr.tv.jitter_recovery<br/>-dev.tv.jitter_recovery</td></tr>
|
||||
<tr><td>Drive unused TIA pins ...</td><td>Unused TIA pins are read random instead of the last databus values</td><td>-plr.tiadriven<br/>-dev.tiadriven</td></tr>
|
||||
<tr><td>Player 0 <br/>Missile 0 <br/>Player 1 <br/>
|
||||
Missile 1 <br/>Playfield <br/>Ball </td>
|
||||
<td>Set color for specific object in debug colors mode<br/>(PF0, PF1 and PF2 are have slightly different luminance,<br/>disabled in ROM launcher mode)</td><td>-tia.dbgcolors</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -3036,39 +3047,56 @@
|
|||
<p><b>Developer Settings</b> dialog (States) <b>TODO</b></p>
|
||||
<table border="5" cellpadding="2" frame="box" rules="none">
|
||||
<tr>
|
||||
|
||||
<td><img src="graphics/options_developer_states.png"></td>
|
||||
<td> </td>
|
||||
<td valign="top">
|
||||
<table border="1" cellpadding="4">
|
||||
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
|
||||
<tr><td></td><td></td><td>-.plr<br>-.dev</td></tr>
|
||||
<tr><td></td><td></td><td>-.plr<br>-.dev</td></tr>
|
||||
<tr><td></td><td></td><td>-.plr<br>-.dev</td></tr>
|
||||
<tr><td></td><td></td><td>-.plr<br>-.dev</td></tr>
|
||||
<tr><td></td><td></td><td>-.plr<br>-.dev</td></tr>
|
||||
<tr>
|
||||
<th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th>
|
||||
</tr><tr>
|
||||
<td>Continuous rewind</td>
|
||||
<td>
|
||||
When continuous rewind is enabled, Stella will automatically
|
||||
create new save states in the interval described below.</br>
|
||||
Note: This buffer is identical with the one described in
|
||||
<a href="debugger.html#GlobalButtons"><b>Debugger/Global Buttons</b></a>.
|
||||
It is independent from the save states manually created
|
||||
with F9.
|
||||
</td>
|
||||
<td>-plr.rewind<br>-dev.rewind</td>
|
||||
</tr><tr>
|
||||
<td>Buffer size</td>
|
||||
<td>
|
||||
Defines the rewind buffer size. The larger the buffer, the less
|
||||
save states have to be compressed to reach the horizon.
|
||||
</td>
|
||||
<td>-plr.rewind.size<br>-dev.rewind.size</td>
|
||||
</tr><tr>
|
||||
<td>Uncompressed size</td>
|
||||
<td>
|
||||
Defines the uncompressed rewind buffer size. States within this
|
||||
area will not be compressed and keep their initial interval.</td>
|
||||
<td><span style="white-space:nowrap">-plr.rewind.uncompressed<br>-dev.rewind.uncompressed</span></td>
|
||||
</tr><tr>
|
||||
<td>Interval</td>
|
||||
<td>Defines the interval between two save states when they are created.</td>
|
||||
<td>-plr.rewind.interval<br>-dev.rewind.interval</td>
|
||||
</tr><tr>
|
||||
<td>Horizon</td>
|
||||
<td>
|
||||
Defines the horizon of the rewind buffer. A large horizon allows
|
||||
going back further in time. To reach the horizon, save states
|
||||
will be compressed. This means that more and more intermediate
|
||||
states will be removed and the interval between compressed states
|
||||
becomes larger the further they are back in time.
|
||||
</td>
|
||||
<td>-plr.rewind.horizon<br>-dev.rewind.horizon</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Developer Settings</b> dialog (Debug Colors):</p>
|
||||
<table border="5" cellpadding="2" frame="box" rules="none">
|
||||
<tr>
|
||||
<td><img src="graphics/options_developer_dbgcolors.png"></td>
|
||||
<td> </td>
|
||||
<td valign="top">
|
||||
<table border="1" cellpadding="4">
|
||||
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
|
||||
<tr><td>Player 0 <br/>Missile 0 <br/>Player 1 <br/>
|
||||
Missile 1 <br/>Playfield <br/>Ball </td>
|
||||
<td>Set color for specific object in debug colors mode<br/>(PF0, PF1 and PF2 are have slightly different luminance,<br/>disabled in ROM launcher mode)</td><td>-tia.dbgcolors</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
<p><b>Developer Settings</b> dialog (Debugger)</p>
|
||||
<table border="5" cellpadding="2" frame="box" rules="none">
|
||||
<tr>
|
||||
|
|
|
@ -157,8 +157,13 @@ Settings::Settings(OSystem& osystem)
|
|||
setInternal("plr.console", "2600"); // 7800
|
||||
setInternal("plr.rewind", false);
|
||||
setInternal("plr.rewind.size", 100);
|
||||
setInternal("plr.rewind.uncompressed", 30);
|
||||
setInternal("plr.rewind.interval", 4); // = 1 second
|
||||
setInternal("plr.rewind.horizon", 5); // = ~10 minutes
|
||||
#ifdef DTHUMB_SUPPORT
|
||||
// Thumb ARM emulation options
|
||||
setInternal("plr.thumb.trapfatal", "false");
|
||||
#endif
|
||||
|
||||
// developer settings
|
||||
setInternal("dev.settings", "false");
|
||||
|
@ -174,12 +179,13 @@ Settings::Settings(OSystem& osystem)
|
|||
setInternal("dev.console", "2600"); // 7800
|
||||
setInternal("dev.rewind", true);
|
||||
setInternal("dev.rewind.size", 100);
|
||||
setInternal("dev.rewind.uncompressed", 60);
|
||||
setInternal("dev.rewind.interval", 2); // = 1 frame
|
||||
setInternal("dev.rewind.horizon", 3); // = ~10 seconds
|
||||
|
||||
#ifdef DTHUMB_SUPPORT
|
||||
// Thumb ARM emulation options
|
||||
setInternal("thumb.trapfatal", "true");
|
||||
setInternal("dev.thumb.trapfatal", "true");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -318,8 +324,15 @@ void Settings::validate()
|
|||
i = getInt("dev.tv.jitter_recovery");
|
||||
if(i < 1 || i > 20) setInternal("dev.tv.jitter_recovery", "2");
|
||||
|
||||
i = getInt("dev.rewind.size");
|
||||
if (i < 100 ||i > 1000) setInternal("dev.rewind.size", 100);
|
||||
int size = getInt("dev.rewind.size");
|
||||
if(size < 100 || size > 1000)
|
||||
{
|
||||
setInternal("dev.rewind.size", 100);
|
||||
size = 100;
|
||||
}
|
||||
|
||||
i = getInt("dev.rewind.uncompressed");
|
||||
if(i < 0 || i > size) setInternal("dev.rewind.uncompressed", size);
|
||||
|
||||
i = getInt("dev.rewind.interval");
|
||||
if(i < 0 || i > 5) setInternal("dev.rewind.interval", 2);
|
||||
|
@ -330,8 +343,15 @@ void Settings::validate()
|
|||
i = getInt("plr.tv.jitter_recovery");
|
||||
if(i < 1 || i > 20) setInternal("plr.tv.jitter_recovery", "10");
|
||||
|
||||
i = getInt("plr.rewind.size");
|
||||
if(i < 100 || i > 1000) setInternal("plr.rewind.size", 100);
|
||||
size = getInt("plr.rewind.size");
|
||||
if(size < 100 || size > 1000)
|
||||
{
|
||||
setInternal("plr.rewind.size", 100);
|
||||
size = 100;
|
||||
}
|
||||
|
||||
i = getInt("plr.rewind.uncompressed");
|
||||
if(i < 0 || i > size) setInternal("plr.rewind.uncompressed", size);
|
||||
|
||||
i = getInt("plr.rewind.interval");
|
||||
if(i < 0 || i > 5) setInternal("plr.rewind.interval", 4);
|
||||
|
|
|
@ -47,6 +47,7 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
|||
myMaxWidth(max_w),
|
||||
myMaxHeight(max_h)
|
||||
{
|
||||
const int VGAP = 4;
|
||||
const int lineHeight = font.getLineHeight(),
|
||||
fontWidth = font.getMaxCharWidth(),
|
||||
buttonHeight = font.getLineHeight() + 4;
|
||||
|
@ -54,7 +55,7 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
|||
|
||||
// Set real dimensions
|
||||
_w = std::min(53 * fontWidth + 10, max_w);
|
||||
_h = std::min(15 * (lineHeight + 4) + 14, max_h);
|
||||
_h = std::min(15 * (lineHeight + VGAP) + 14, max_h);
|
||||
|
||||
// The tab widget
|
||||
xpos = 2; ypos = 4;
|
||||
|
@ -62,8 +63,8 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
|
|||
addTabWidget(myTab);
|
||||
|
||||
addEmulationTab(font);
|
||||
addVideoTab(font);
|
||||
addStatesTab(font);
|
||||
addDebugColorsTab(font);
|
||||
addDebuggerTab(font);
|
||||
addDefaultOKCancelButtons(font);
|
||||
|
||||
|
@ -83,7 +84,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
|||
int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight();
|
||||
WidgetArray wid;
|
||||
VariantList items;
|
||||
int tabID = myTab->addTab("Emulation");
|
||||
int tabID = myTab->addTab(" Emulation ");
|
||||
|
||||
// settings set
|
||||
mySettingsGroup0 = new RadioButtonGroup();
|
||||
|
@ -92,7 +93,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
|||
ypos += lineHeight + VGAP;
|
||||
r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Developer settings", mySettingsGroup0, kDevSettings);
|
||||
wid.push_back(r);
|
||||
ypos += lineHeight + VGAP * 2;
|
||||
ypos += lineHeight + VGAP * 1;
|
||||
|
||||
myFrameStatsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Frame statistics");
|
||||
wid.push_back(myFrameStatsWidget);
|
||||
|
@ -105,22 +106,24 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
|||
int lwidth = font.getStringWidth("Console ");
|
||||
int pwidth = font.getStringWidth("Atari 2600");
|
||||
|
||||
myConsoleWidget = new PopUpWidget(myTab, font, HBORDER + INDENT * 1, ypos, pwidth, lineHeight, items, "Console ", lwidth, kConsole);
|
||||
myConsoleWidget = new PopUpWidget(myTab, font, HBORDER + INDENT * 1, ypos, pwidth, lineHeight, items,
|
||||
"Console ", lwidth, kConsole);
|
||||
wid.push_back(myConsoleWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// Randomize items
|
||||
myLoadingROMLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT*1, ypos + 1, "When loading a ROM:", kTextAlignLeft);
|
||||
myLoadingROMLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT*1, ypos + 1, "When loading a ROM:");
|
||||
wid.push_back(myLoadingROMLabel);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myRandomBankWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1, "Random startup bank");
|
||||
myRandomBankWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
|
||||
"Random startup bank");
|
||||
wid.push_back(myRandomBankWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// Randomize RAM
|
||||
myRandomizeRAMWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 2, ypos + 1,
|
||||
"Randomize zero-page and extended RAM", kRandRAMID);
|
||||
"Randomize zero-page and extended RAM", kRandRAMID);
|
||||
wid.push_back(myRandomizeRAMWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
|
@ -140,37 +143,119 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
|
|||
}
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// debug colors
|
||||
myDebugColorsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Debug colors");
|
||||
wid.push_back(myDebugColorsWidget);
|
||||
|
||||
// How to handle undriven TIA pins
|
||||
myUndrivenPinsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
|
||||
"Drive unused TIA pins randomly on a read/peek");
|
||||
wid.push_back(myUndrivenPinsWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
#ifdef DTHUMB_SUPPORT
|
||||
// Thumb ARM emulation exception
|
||||
myThumbExceptionWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
|
||||
"Fatal ARM emulation error throws exception");
|
||||
wid.push_back(myThumbExceptionWidget);
|
||||
#endif
|
||||
|
||||
// Add items for tab 0
|
||||
addToFocusList(wid, myTab, tabID);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::addVideoTab(const GUI::Font& font)
|
||||
{
|
||||
const int HBORDER = 10;
|
||||
const int INDENT = 16 + 4;
|
||||
const int VBORDER = 8;
|
||||
const int VGAP = 4;
|
||||
int ypos = VBORDER;
|
||||
int lineHeight = font.getLineHeight();
|
||||
int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight();
|
||||
int lwidth = font.getStringWidth("Intensity ");
|
||||
int pwidth = font.getMaxCharWidth() * 6;
|
||||
WidgetArray wid;
|
||||
VariantList items;
|
||||
int tabID = myTab->addTab("Video");
|
||||
|
||||
wid.clear();
|
||||
ypos = VBORDER;
|
||||
|
||||
// settings set
|
||||
mySettingsGroup1 = new RadioButtonGroup();
|
||||
RadioButtonWidget* r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Player settings", mySettingsGroup1, kPlrSettings);
|
||||
wid.push_back(r);
|
||||
ypos += lineHeight + VGAP;
|
||||
r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Developer settings", mySettingsGroup1, kDevSettings);
|
||||
wid.push_back(r);
|
||||
ypos += lineHeight + VGAP * 1;
|
||||
|
||||
// TV jitter effect
|
||||
myTVJitterWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Jitter/roll effect", kTVJitter);
|
||||
wid.push_back(myTVJitterWidget);
|
||||
myTVJitterRecWidget = new SliderWidget(myTab, font,
|
||||
myTVJitterWidget->getRight() + fontWidth * 3, ypos - 1,
|
||||
8 * fontWidth, lineHeight, "Recovery ",
|
||||
font.getStringWidth("Recovery "), kTVJitterChanged);
|
||||
myTVJitterRecWidget->setMinValue(1); myTVJitterRecWidget->setMaxValue(20);
|
||||
wid.push_back(myTVJitterRecWidget);
|
||||
myTVJitterRecLabelWidget = new StaticTextWidget(myTab, font,
|
||||
myTVJitterRecWidget->getRight() + 4, myTVJitterRecWidget->getTop() + 2,
|
||||
5 * fontWidth, fontHeight, "", kTextAlignLeft);
|
||||
myTVJitterRecLabelWidget->setFlags(WIDGET_CLEARBG);
|
||||
wid.push_back(myTVJitterRecLabelWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myColorLossWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "PAL color-loss");
|
||||
wid.push_back(myColorLossWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// TV jitter effect
|
||||
myTVJitterWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Jitter/roll effect", kTVJitter);
|
||||
wid.push_back(myTVJitterWidget);
|
||||
myTVJitterRecWidget = new SliderWidget(myTab, font,
|
||||
myTVJitterWidget->getRight() + fontWidth * 3, ypos - 1,
|
||||
8 * fontWidth, lineHeight, "Recovery ",
|
||||
font.getStringWidth("Recovery "), kTVJitterChanged);
|
||||
myTVJitterRecWidget->setMinValue(1); myTVJitterRecWidget->setMaxValue(20);
|
||||
wid.push_back(myTVJitterRecWidget);
|
||||
myTVJitterRecLabelWidget = new StaticTextWidget(myTab, font,
|
||||
myTVJitterRecWidget->getRight() + 4, myTVJitterRecWidget->getTop() + 2,
|
||||
5 * fontWidth, fontHeight, "", kTextAlignLeft);
|
||||
myTVJitterRecLabelWidget->setFlags(WIDGET_CLEARBG);
|
||||
wid.push_back(myTVJitterRecLabelWidget);
|
||||
ypos += lineHeight + VGAP;
|
||||
// debug colors
|
||||
myDebugColorsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Debug colors (*)");
|
||||
wid.push_back(myDebugColorsWidget);
|
||||
ypos += lineHeight + VGAP + 2;
|
||||
|
||||
// How to handle undriven TIA pins
|
||||
myUndrivenPinsWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
|
||||
"Drive unused TIA pins randomly on a read/peek");
|
||||
wid.push_back(myUndrivenPinsWidget);
|
||||
//StaticTextWidget* s = new StaticTextWidget(myTab, font, HBORDER, ypos, "Debug Colors ");
|
||||
//ypos += lineHeight + VGAP;
|
||||
|
||||
// Add items for tab 0
|
||||
items.clear();
|
||||
VarList::push_back(items, "Red", "r");
|
||||
VarList::push_back(items, "Orange", "o");
|
||||
VarList::push_back(items, "Yellow", "y");
|
||||
VarList::push_back(items, "Green", "g");
|
||||
VarList::push_back(items, "Purple", "p");
|
||||
VarList::push_back(items, "Blue", "b");
|
||||
|
||||
static constexpr int dbg_cmds[DEBUG_COLORS] = {
|
||||
kP0ColourChangedCmd, kM0ColourChangedCmd, kP1ColourChangedCmd,
|
||||
kM1ColourChangedCmd, kPFColourChangedCmd, kBLColourChangedCmd
|
||||
};
|
||||
|
||||
auto createDebugColourWidgets = [&](int idx, const string& desc)
|
||||
{
|
||||
int x = HBORDER + INDENT * 1;
|
||||
myDbgColour[idx] = new PopUpWidget(myTab, font, x, ypos - 1,
|
||||
pwidth, lineHeight, items, desc, lwidth, dbg_cmds[idx]);
|
||||
wid.push_back(myDbgColour[idx]);
|
||||
x += myDbgColour[idx]->getWidth() + 10;
|
||||
myDbgColourSwatch[idx] = new ColorWidget(myTab, font, x, ypos - 1,
|
||||
uInt32(2 * lineHeight), lineHeight);
|
||||
ypos += lineHeight + VGAP * 1;
|
||||
};
|
||||
|
||||
createDebugColourWidgets(0, "Player 0 ");
|
||||
createDebugColourWidgets(1, "Missile 0 ");
|
||||
createDebugColourWidgets(2, "Player 1 ");
|
||||
createDebugColourWidgets(3, "Missile 1 ");
|
||||
createDebugColourWidgets(4, "Playfield ");
|
||||
createDebugColourWidgets(5, "Ball ");
|
||||
|
||||
// Add message concerning usage
|
||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
||||
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
|
||||
//new StaticTextWidget(myTab, infofont, 10, ypos, "(*) Colors must be different for each object");
|
||||
new StaticTextWidget(myTab, infofont, HBORDER, ypos, "(*) colors identical for player and developer settings");
|
||||
|
||||
// Add items for tab 2
|
||||
addToFocusList(wid, myTab, tabID);
|
||||
}
|
||||
|
||||
|
@ -188,13 +273,13 @@ void DeveloperDialog::addStatesTab(const GUI::Font& font)
|
|||
int tabID = myTab->addTab("States");
|
||||
|
||||
// settings set
|
||||
mySettingsGroup1 = new RadioButtonGroup();
|
||||
RadioButtonWidget* r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Player settings", mySettingsGroup1, kPlrSettings);
|
||||
mySettingsGroup2 = new RadioButtonGroup();
|
||||
RadioButtonWidget* r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Player settings", mySettingsGroup2, kPlrSettings);
|
||||
wid.push_back(r);
|
||||
ypos += lineHeight + VGAP;
|
||||
r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Developer settings", mySettingsGroup1, kDevSettings);
|
||||
r = new RadioButtonWidget(myTab, font, HBORDER, ypos + 1, "Developer settings", mySettingsGroup2, kDevSettings);
|
||||
wid.push_back(r);
|
||||
ypos += lineHeight + VGAP * 2;
|
||||
ypos += lineHeight + VGAP * 1;
|
||||
|
||||
myContinuousRewindWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT, ypos + 1, "Continuous rewind", kRewind);
|
||||
wid.push_back(myContinuousRewindWidget);
|
||||
|
@ -202,29 +287,42 @@ void DeveloperDialog::addStatesTab(const GUI::Font& font)
|
|||
|
||||
int sWidth = font.getMaxCharWidth() * 8;
|
||||
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
||||
"Buffer size (*) ", 0, kSizeChanged);
|
||||
"Buffer size (*) ", 0, kSizeChanged);
|
||||
myStateSizeWidget->setMinValue(100);
|
||||
myStateSizeWidget->setMaxValue(1000);
|
||||
myStateSizeWidget->setStepValue(100);
|
||||
myStateSizeWidget->setStepValue(20);
|
||||
wid.push_back(myStateSizeWidget);
|
||||
myStateSizeLabelWidget = new StaticTextWidget(myTab, font, myStateSizeWidget->getRight() + 4, myStateSizeWidget->getTop() + 2, "100 ");
|
||||
|
||||
myStateSizeLabelWidget = new StaticTextWidget(myTab, font, myStateSizeWidget->getRight() + 4,
|
||||
myStateSizeWidget->getTop() + 2, "100 ");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myUncompressedWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
||||
"Uncompressed size (*) ", 0, kUncompressedChanged);
|
||||
myUncompressedWidget->setMinValue(0);
|
||||
myUncompressedWidget->setMaxValue(1000);
|
||||
myUncompressedWidget->setStepValue(20);
|
||||
wid.push_back(myUncompressedWidget);
|
||||
myUncompressedLabelWidget = new StaticTextWidget(myTab, font, myUncompressedWidget->getRight() + 4,
|
||||
myUncompressedWidget->getTop() + 2, "50 ");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myStateIntervalWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
||||
"Interval ", 0, kIntervalChanged);
|
||||
"Interval ", 0, kIntervalChanged);
|
||||
|
||||
myStateIntervalWidget->setMinValue(0);
|
||||
myStateIntervalWidget->setMaxValue(NUM_INTERVALS - 1);
|
||||
wid.push_back(myStateIntervalWidget);
|
||||
myStateIntervalLabelWidget = new StaticTextWidget(myTab, font, myStateIntervalWidget->getRight() + 4, myStateIntervalWidget->getTop() + 2, "50 scanlines");
|
||||
|
||||
myStateIntervalLabelWidget = new StaticTextWidget(myTab, font, myStateIntervalWidget->getRight() + 4,
|
||||
myStateIntervalWidget->getTop() + 2, "50 scanlines");
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
myStateHorizonWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
||||
"Horizon ", 0, kHorizonChanged);
|
||||
"Horizon ", 0, kHorizonChanged);
|
||||
myStateHorizonWidget->setMinValue(0);
|
||||
myStateHorizonWidget->setMaxValue(NUM_HORIZONS - 1);
|
||||
wid.push_back(myStateHorizonWidget);
|
||||
myStateHorizonLabelWidget = new StaticTextWidget(myTab, font, myStateHorizonWidget->getRight() + 4, myStateHorizonWidget->getTop() + 2, "~60 minutes");
|
||||
myStateHorizonLabelWidget = new StaticTextWidget(myTab, font, myStateHorizonWidget->getRight() + 4,
|
||||
myStateHorizonWidget->getTop() + 2, "~60 minutes");
|
||||
|
||||
// Add message concerning usage
|
||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
||||
|
@ -234,67 +332,6 @@ void DeveloperDialog::addStatesTab(const GUI::Font& font)
|
|||
addToFocusList(wid, myTab, tabID);
|
||||
}
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::addDebugColorsTab(const GUI::Font& font)
|
||||
{
|
||||
const int HBORDER = 10;
|
||||
const int INDENT = 16 + 4;
|
||||
const int VBORDER = 8;
|
||||
const int VGAP = 4;
|
||||
int ypos = VBORDER;
|
||||
int lineHeight = font.getLineHeight();
|
||||
int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight();
|
||||
int lwidth = font.getStringWidth("Intensity ");
|
||||
int pwidth = font.getMaxCharWidth() * 6;
|
||||
WidgetArray wid;
|
||||
VariantList items;
|
||||
int tabID = myTab->addTab("Debug Colors");
|
||||
|
||||
wid.clear();
|
||||
ypos = VBORDER;
|
||||
|
||||
items.clear();
|
||||
VarList::push_back(items, "Red", "r");
|
||||
VarList::push_back(items, "Orange", "o");
|
||||
VarList::push_back(items, "Yellow", "y");
|
||||
VarList::push_back(items, "Green", "g");
|
||||
VarList::push_back(items, "Blue", "b");
|
||||
VarList::push_back(items, "Purple", "p");
|
||||
|
||||
static constexpr int dbg_cmds[6] = {
|
||||
kP0ColourChangedCmd, kM0ColourChangedCmd, kP1ColourChangedCmd,
|
||||
kM1ColourChangedCmd, kPFColourChangedCmd, kBLColourChangedCmd
|
||||
};
|
||||
|
||||
auto createDebugColourWidgets = [&](int idx, const string& desc)
|
||||
{
|
||||
int x = HBORDER;
|
||||
myDbgColour[idx] = new PopUpWidget(myTab, font, x, ypos,
|
||||
pwidth, lineHeight, items, desc, lwidth, dbg_cmds[idx]);
|
||||
wid.push_back(myDbgColour[idx]);
|
||||
x += myDbgColour[idx]->getWidth() + 10;
|
||||
myDbgColourSwatch[idx] = new ColorWidget(myTab, font, x, ypos,
|
||||
uInt32(2 * lineHeight), lineHeight);
|
||||
ypos += lineHeight + VGAP * 1;
|
||||
};
|
||||
|
||||
createDebugColourWidgets(0, "Player 0 ");
|
||||
createDebugColourWidgets(1, "Missile 0 ");
|
||||
createDebugColourWidgets(2, "Player 1 ");
|
||||
createDebugColourWidgets(3, "Missile 1 ");
|
||||
createDebugColourWidgets(4, "Playfield ");
|
||||
createDebugColourWidgets(5, "Ball ");
|
||||
|
||||
// Add message concerning usage
|
||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
||||
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
|
||||
new StaticTextWidget(myTab, infofont, 10, ypos, "(*) Colors must be different for each object");
|
||||
|
||||
// Add items for tab 2
|
||||
addToFocusList(wid, myTab, tabID);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||
{
|
||||
|
@ -429,6 +466,11 @@ void DeveloperDialog::loadSettings(SettingsSet set)
|
|||
myRandomBank[set] = instance().settings().getBool(prefix + "bankrandom");
|
||||
myRandomizeRAM[set] = instance().settings().getBool(prefix + "ramrandom");
|
||||
myRandomizeCPU[set] = instance().settings().getString(prefix + "cpurandom");
|
||||
// Undriven TIA pins
|
||||
myUndrivenPins[set] = instance().settings().getBool(prefix + "tiadriven");
|
||||
// Thumb ARM emulation exception
|
||||
myThumbException[set] = instance().settings().getBool(prefix + "thumb.trapfatal");
|
||||
|
||||
// Debug colors
|
||||
myDebugColors[set] = instance().settings().getBool(prefix + "debugcolors");
|
||||
// PAL color-loss effect
|
||||
|
@ -436,12 +478,11 @@ void DeveloperDialog::loadSettings(SettingsSet set)
|
|||
// Jitter
|
||||
myTVJitter[set] = instance().settings().getBool(prefix + "tv.jitter");
|
||||
myTVJitterRec[set] = instance().settings().getInt(prefix + "tv.jitter_recovery");
|
||||
// Undriven TIA pins
|
||||
myUndrivenPins[set] = instance().settings().getBool(prefix + "tiadriven");
|
||||
|
||||
// States
|
||||
myContinuousRewind[set] = instance().settings().getBool(prefix + "rewind");
|
||||
myStateSize[set] = instance().settings().getInt(prefix + "rewind.size");
|
||||
myUncompressed[set] = instance().settings().getInt(prefix + "rewind.uncompressed");
|
||||
myStateInterval[set] = instance().settings().getInt(prefix + "rewind.interval");
|
||||
myStateHorizon[set] = instance().settings().getInt(prefix + "rewind.horizon");
|
||||
}
|
||||
|
@ -457,6 +498,11 @@ void DeveloperDialog::saveSettings(SettingsSet set)
|
|||
instance().settings().setValue(prefix + "bankrandom", myRandomBank[set]);
|
||||
instance().settings().setValue(prefix + "ramrandom", myRandomizeRAM[set]);
|
||||
instance().settings().setValue(prefix + "cpurandom", myRandomizeCPU[set]);
|
||||
// Undriven TIA pins
|
||||
instance().settings().setValue(prefix + "tiadriven", myUndrivenPins[set]);
|
||||
// Thumb ARM emulation exception
|
||||
instance().settings().setValue(prefix + "thumb.trapfatal", myThumbException[set]);
|
||||
|
||||
// Debug colors
|
||||
instance().settings().setValue(prefix + "debugcolors", myDebugColors[set]);
|
||||
// PAL color loss
|
||||
|
@ -464,12 +510,11 @@ void DeveloperDialog::saveSettings(SettingsSet set)
|
|||
// Jitter
|
||||
instance().settings().setValue(prefix + "tv.jitter", myTVJitter[set]);
|
||||
instance().settings().setValue(prefix + "tv.jitter_recovery", myTVJitterRec[set]);
|
||||
// Undriven TIA pins
|
||||
instance().settings().setValue(prefix + "tiadriven", myUndrivenPins[set]);
|
||||
|
||||
// States
|
||||
instance().settings().setValue(prefix + "rewind", myContinuousRewind[set]);
|
||||
instance().settings().setValue(prefix + "rewind.size", myStateSize[set]);
|
||||
instance().settings().setValue(prefix + "rewind.uncompressed", myUncompressed[set]);
|
||||
instance().settings().setValue(prefix + "rewind.interval", myStateInterval[set]);
|
||||
instance().settings().setValue(prefix + "rewind.horizon", myStateHorizon[set]);
|
||||
}
|
||||
|
@ -488,6 +533,11 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
|
|||
if(myRandomizeCPUWidget[i]->getState())
|
||||
cpurandom += cpuregs[i];
|
||||
myRandomizeCPU[set] = cpurandom;
|
||||
// Undriven TIA pins
|
||||
myUndrivenPins[set] = myUndrivenPinsWidget->getState();
|
||||
// Thumb ARM emulation exception
|
||||
myThumbException[set] = myThumbExceptionWidget->getState();
|
||||
|
||||
// Debug colors
|
||||
myDebugColors[set] = myDebugColorsWidget->getState();
|
||||
// PAL color-loss effect
|
||||
|
@ -495,12 +545,11 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
|
|||
// Jitter
|
||||
myTVJitter[set] = myTVJitterWidget->getState();
|
||||
myTVJitterRec[set] = myTVJitterRecWidget->getValue();
|
||||
// Undriven TIA pins
|
||||
myUndrivenPins[set] = myUndrivenPinsWidget->getState();
|
||||
|
||||
// States
|
||||
myContinuousRewind[set] = myContinuousRewindWidget->getState();
|
||||
myStateSize[set] = myStateSizeWidget->getValue();
|
||||
myUncompressed[set] = myUncompressedWidget->getValue();
|
||||
myStateInterval[set] = myStateIntervalWidget->getValue();
|
||||
myStateHorizon[set] = myStateHorizonWidget->getValue();
|
||||
}
|
||||
|
@ -518,6 +567,13 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
|
|||
const char* const cpuregs[] = { "S", "A", "X", "Y", "P" };
|
||||
for(int i = 0; i < 5; ++i)
|
||||
myRandomizeCPUWidget[i]->setState(BSPF::containsIgnoreCase(cpurandom, cpuregs[i]));
|
||||
// Undriven TIA pins
|
||||
myUndrivenPinsWidget->setState(myUndrivenPins[set]);
|
||||
// Thumb ARM emulation exception
|
||||
myThumbExceptionWidget->setState(myThumbException[set]);
|
||||
|
||||
handleConsole();
|
||||
|
||||
// Debug colors
|
||||
myDebugColorsWidget->setState(myDebugColors[set]);
|
||||
// PAL color-loss effect
|
||||
|
@ -525,21 +581,20 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
|
|||
// Jitter
|
||||
myTVJitterWidget->setState(myTVJitter[set]);
|
||||
myTVJitterRecWidget->setValue(myTVJitterRec[set]);
|
||||
// Undriven TIA pins
|
||||
myUndrivenPinsWidget->setState(myUndrivenPins[set]);
|
||||
|
||||
handleConsole();
|
||||
handleTVJitterChange(myTVJitterWidget->getState());
|
||||
handleEnableDebugColors();
|
||||
|
||||
// States
|
||||
myContinuousRewindWidget->setState(myContinuousRewind[set]);
|
||||
myStateSizeWidget->setValue(myStateSize[set]);
|
||||
myUncompressedWidget->setValue(myUncompressed[set]);
|
||||
myStateIntervalWidget->setValue(myStateInterval[set]);
|
||||
myStateHorizonWidget->setValue(myStateHorizon[set]);
|
||||
|
||||
handleRewind();
|
||||
handleSize();
|
||||
handleUncompressed();
|
||||
handleInterval();
|
||||
handleHorizon();
|
||||
}
|
||||
|
@ -551,6 +606,7 @@ void DeveloperDialog::loadConfig()
|
|||
mySettings = devSettings;
|
||||
mySettingsGroup0->setSelected(devSettings ? 1 : 0);
|
||||
mySettingsGroup1->setSelected(devSettings ? 1 : 0);
|
||||
mySettingsGroup2->setSelected(devSettings ? 1 : 0);
|
||||
|
||||
// load both setting sets...
|
||||
loadSettings(SettingsSet::player);
|
||||
|
@ -612,7 +668,7 @@ void DeveloperDialog::saveConfig()
|
|||
|
||||
// Debug colours
|
||||
string dbgcolors;
|
||||
for(int i = 0; i < 6; ++i)
|
||||
for(int i = 0; i < DEBUG_COLORS; ++i)
|
||||
dbgcolors += myDbgColour[i]->getSelectedTag().toString();
|
||||
if(instance().hasConsole() &&
|
||||
instance().console().tia().setFixedColorPalette(dbgcolors))
|
||||
|
@ -627,17 +683,18 @@ void DeveloperDialog::saveConfig()
|
|||
|
||||
// define interval growth factor
|
||||
uInt32 size = myStateSizeWidget->getValue();
|
||||
uInt32 uncompressed = myUncompressedWidget->getValue();
|
||||
uInt64 horizon = HORIZON_CYCLES[myStateHorizonWidget->getValue()];
|
||||
double factor, minFactor = 1, maxFactor = 2;
|
||||
|
||||
while(true)
|
||||
{
|
||||
double interval = INTERVAL_CYCLES[myStateIntervalWidget->getValue()];
|
||||
double cycleSum = 0.0;
|
||||
double cycleSum = interval * uncompressed;
|
||||
// calculate next factor
|
||||
factor = (minFactor + maxFactor) / 2;
|
||||
// sum up interval cycles
|
||||
for(uInt32 i = 0; i < size; ++i)
|
||||
for(uInt32 i = uncompressed; i < size; ++i)
|
||||
{
|
||||
cycleSum += interval;
|
||||
interval *= factor;
|
||||
|
@ -686,32 +743,37 @@ void DeveloperDialog::setDefaults()
|
|||
myRandomBank[set] = devSettings ? true : false;
|
||||
myRandomizeRAM[set] = devSettings ? true : false;
|
||||
myRandomizeCPU[set] = devSettings ? "SAXYP" : "";
|
||||
// Debug colors
|
||||
myDebugColors[set] = false;
|
||||
// PAL color-loss effect
|
||||
myColorLoss[set] = devSettings ? true : false;
|
||||
// Jitter
|
||||
myTVJitter[set] = true;
|
||||
myTVJitterRec[set] = devSettings ? 2 : 10;
|
||||
// Undriven TIA pins
|
||||
myUndrivenPins[set] = devSettings ? true : false;
|
||||
// Thumb ARM emulation exception
|
||||
myThumbException[set] = devSettings ? true : false;
|
||||
|
||||
setWidgetStates(set);
|
||||
break;
|
||||
|
||||
case 1: // States
|
||||
case 1: // Video
|
||||
// Jitter
|
||||
myTVJitter[set] = true;
|
||||
myTVJitterRec[set] = devSettings ? 2 : 10;
|
||||
// PAL color-loss effect
|
||||
myColorLoss[set] = devSettings ? true : false;
|
||||
// Debug colors
|
||||
myDebugColors[set] = false;
|
||||
handleDebugColours("roygpb");
|
||||
|
||||
setWidgetStates(set);
|
||||
break;
|
||||
|
||||
case 2: // States
|
||||
myContinuousRewind[set] = devSettings ? true : false;
|
||||
myStateSize[set] = 100;
|
||||
myUncompressed[set] = devSettings ? 60 : 30;
|
||||
myStateInterval[set] = devSettings ? 2 : 4;
|
||||
myStateHorizon[set] = devSettings ? 3 : 5;
|
||||
|
||||
setWidgetStates(set);
|
||||
break;
|
||||
|
||||
case 2: // Debug colours
|
||||
handleDebugColours("roygpb");
|
||||
break;
|
||||
|
||||
case 3: // Debugger options
|
||||
{
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
|
@ -770,6 +832,10 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
|
|||
handleSize();
|
||||
break;
|
||||
|
||||
case kUncompressedChanged:
|
||||
handleUncompressed();
|
||||
break;
|
||||
|
||||
case kIntervalChanged:
|
||||
handleInterval();
|
||||
break;
|
||||
|
@ -843,6 +909,7 @@ void DeveloperDialog::handleSettings(bool devSettings)
|
|||
mySettings = devSettings; // block redundant events first!
|
||||
mySettingsGroup0->setSelected(devSettings ? 1 : 0);
|
||||
mySettingsGroup1->setSelected(devSettings ? 1 : 0);
|
||||
mySettingsGroup2->setSelected(devSettings ? 1 : 0);
|
||||
getWidgetStates(devSettings ? SettingsSet::player : SettingsSet::developer);
|
||||
setWidgetStates(devSettings ? SettingsSet::developer : SettingsSet::player);
|
||||
}
|
||||
|
@ -884,6 +951,9 @@ void DeveloperDialog::handleRewind()
|
|||
myStateSizeWidget->setEnabled(enable);
|
||||
myStateSizeLabelWidget->setEnabled(enable);
|
||||
|
||||
myUncompressedWidget->setEnabled(enable);
|
||||
myUncompressedLabelWidget->setEnabled(enable);
|
||||
|
||||
myStateIntervalWidget->setEnabled(enable);
|
||||
myStateIntervalLabelWidget->setEnabled(enable);
|
||||
|
||||
|
@ -896,6 +966,7 @@ void DeveloperDialog::handleSize()
|
|||
{
|
||||
bool found = false;
|
||||
uInt64 size = myStateSizeWidget->getValue();
|
||||
uInt64 uncompressed = myUncompressedWidget->getValue();
|
||||
uInt64 interval = myStateIntervalWidget->getValue();
|
||||
uInt64 horizon = myStateHorizonWidget->getValue();
|
||||
Int32 i;
|
||||
|
@ -916,17 +987,38 @@ void DeveloperDialog::handleSize()
|
|||
interval--;
|
||||
} while(!found);
|
||||
|
||||
if(size < uncompressed)
|
||||
{
|
||||
myUncompressedWidget->setValue(size);
|
||||
myUncompressedLabelWidget->setValue(myStateSizeWidget->getValue());
|
||||
}
|
||||
|
||||
myStateHorizonWidget->setValue(i);
|
||||
myStateHorizonLabelWidget->setLabel(HORIZONS[i]);
|
||||
myStateIntervalWidget->setValue(interval);
|
||||
myStateIntervalLabelWidget->setLabel(INTERVALS[interval]);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::handleUncompressed()
|
||||
{
|
||||
uInt64 size = myStateSizeWidget->getValue();
|
||||
uInt64 uncompressed = myUncompressedWidget->getValue();
|
||||
|
||||
myUncompressedLabelWidget->setValue(myUncompressedWidget->getValue());
|
||||
if(uncompressed > size)
|
||||
{
|
||||
myStateSizeWidget->setValue(uncompressed);
|
||||
myStateSizeLabelWidget->setValue(myUncompressedWidget->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::handleInterval()
|
||||
{
|
||||
bool found = false;
|
||||
uInt64 size = myStateSizeWidget->getValue();
|
||||
uInt64 uncompressed = myUncompressedWidget->getValue();
|
||||
uInt64 interval = myStateIntervalWidget->getValue();
|
||||
uInt64 horizon = myStateHorizonWidget->getValue();
|
||||
Int32 i;
|
||||
|
@ -951,6 +1043,12 @@ void DeveloperDialog::handleInterval()
|
|||
myStateHorizonLabelWidget->setLabel(HORIZONS[i]);
|
||||
myStateSizeWidget->setValue(size);
|
||||
myStateSizeLabelWidget->setValue(myStateSizeWidget->getValue());
|
||||
|
||||
if(size < uncompressed)
|
||||
{
|
||||
myUncompressedWidget->setValue(size);
|
||||
myUncompressedLabelWidget->setValue(myStateSizeWidget->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -958,6 +1056,7 @@ void DeveloperDialog::handleHorizon()
|
|||
{
|
||||
bool found = false;
|
||||
uInt64 size = myStateSizeWidget->getValue();
|
||||
uInt64 uncompressed = myUncompressedWidget->getValue();
|
||||
uInt64 interval = myStateIntervalWidget->getValue();
|
||||
uInt64 horizon = myStateHorizonWidget->getValue();
|
||||
Int32 i;
|
||||
|
@ -981,13 +1080,15 @@ void DeveloperDialog::handleHorizon()
|
|||
myStateIntervalWidget->setValue(i);
|
||||
myStateIntervalLabelWidget->setLabel(INTERVALS[i]);
|
||||
myStateSizeWidget->setValue(size);
|
||||
if(size < uncompressed)
|
||||
myUncompressedWidget->setValue(size);
|
||||
myStateSizeLabelWidget->setValue(myStateSizeWidget->getValue());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::handleDebugColours(int idx, int color)
|
||||
{
|
||||
if(idx < 0 || idx > 5)
|
||||
if(idx < 0 || idx >= DEBUG_COLORS)
|
||||
return;
|
||||
|
||||
if(!instance().hasConsole())
|
||||
|
@ -997,31 +1098,68 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
|
|||
return;
|
||||
}
|
||||
|
||||
static constexpr int dbg_color[2][6] = {
|
||||
{ TIA::FixedColor::NTSC_RED,
|
||||
TIA::FixedColor::NTSC_ORANGE,
|
||||
TIA::FixedColor::NTSC_YELLOW,
|
||||
TIA::FixedColor::NTSC_GREEN,
|
||||
TIA::FixedColor::NTSC_BLUE,
|
||||
TIA::FixedColor::NTSC_PURPLE
|
||||
static constexpr int dbg_color[2][DEBUG_COLORS] = {
|
||||
{
|
||||
TIA::FixedColor::NTSC_RED,
|
||||
TIA::FixedColor::NTSC_ORANGE,
|
||||
TIA::FixedColor::NTSC_YELLOW,
|
||||
TIA::FixedColor::NTSC_GREEN,
|
||||
TIA::FixedColor::NTSC_PURPLE,
|
||||
TIA::FixedColor::NTSC_BLUE
|
||||
},
|
||||
{ TIA::FixedColor::PAL_RED,
|
||||
TIA::FixedColor::PAL_ORANGE,
|
||||
TIA::FixedColor::PAL_YELLOW,
|
||||
TIA::FixedColor::PAL_GREEN,
|
||||
TIA::FixedColor::PAL_BLUE,
|
||||
TIA::FixedColor::PAL_PURPLE
|
||||
{
|
||||
TIA::FixedColor::PAL_RED,
|
||||
TIA::FixedColor::PAL_ORANGE,
|
||||
TIA::FixedColor::PAL_YELLOW,
|
||||
TIA::FixedColor::PAL_GREEN,
|
||||
TIA::FixedColor::PAL_PURPLE,
|
||||
TIA::FixedColor::PAL_BLUE
|
||||
}
|
||||
};
|
||||
|
||||
int mode = instance().console().tia().frameLayout() == FrameLayout::ntsc ? 0 : 1;
|
||||
myDbgColourSwatch[idx]->setColor(dbg_color[mode][color]);
|
||||
myDbgColour[idx]->setSelectedIndex(color);
|
||||
|
||||
// make sure the selected debug colors are all different
|
||||
bool usedCol[DEBUG_COLORS];
|
||||
|
||||
// identify used colors
|
||||
for(int i = 0; i < DEBUG_COLORS; ++i)
|
||||
{
|
||||
usedCol[i] = false;
|
||||
for(int j = 0; j < DEBUG_COLORS; ++j)
|
||||
{
|
||||
if(myDbgColourSwatch[j]->getColor() == dbg_color[mode][i])
|
||||
{
|
||||
usedCol[i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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 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]);
|
||||
myDbgColour[i]->setSelectedIndex(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DeveloperDialog::handleDebugColours(const string& colors)
|
||||
{
|
||||
for(int i = 0; i < 6; ++i)
|
||||
for(int i = 0; i < DEBUG_COLORS; ++i)
|
||||
{
|
||||
switch(colors[i])
|
||||
{
|
||||
|
@ -1029,8 +1167,8 @@ void DeveloperDialog::handleDebugColours(const string& colors)
|
|||
case 'o': handleDebugColours(i, 1); break;
|
||||
case 'y': handleDebugColours(i, 2); break;
|
||||
case 'g': handleDebugColours(i, 3); break;
|
||||
case 'b': handleDebugColours(i, 4); break;
|
||||
case 'p': handleDebugColours(i, 5); break;
|
||||
case 'p': handleDebugColours(i, 4); break;
|
||||
case 'b': handleDebugColours(i, 5); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,28 +55,29 @@ class DeveloperDialog : public Dialog
|
|||
private:
|
||||
enum
|
||||
{
|
||||
kPlrSettings = 'DVpl',
|
||||
kDevSettings = 'DVdv',
|
||||
kConsole = 'DVco',
|
||||
kRandRAMID = 'DVrm',
|
||||
kRandCPUID = 'DVcp',
|
||||
kTVJitter = 'DVjt',
|
||||
kTVJitterChanged = 'DVjr',
|
||||
kPPinCmd = 'DVpn',
|
||||
kRewind = 'DSrw',
|
||||
kSizeChanged = 'DSsz',
|
||||
kIntervalChanged = 'DSin',
|
||||
kHorizonChanged = 'DShz',
|
||||
kP0ColourChangedCmd = 'GOp0',
|
||||
kM0ColourChangedCmd = 'GOm0',
|
||||
kP1ColourChangedCmd = 'GOp1',
|
||||
kM1ColourChangedCmd = 'GOm1',
|
||||
kPFColourChangedCmd = 'GOpf',
|
||||
kBLColourChangedCmd = 'GObl',
|
||||
kPlrSettings = 'DVpl',
|
||||
kDevSettings = 'DVdv',
|
||||
kConsole = 'DVco',
|
||||
kRandRAMID = 'DVrm',
|
||||
kRandCPUID = 'DVcp',
|
||||
kTVJitter = 'DVjt',
|
||||
kTVJitterChanged = 'DVjr',
|
||||
kPPinCmd = 'DVpn',
|
||||
kRewind = 'DSrw',
|
||||
kSizeChanged = 'DSsz',
|
||||
kUncompressedChanged = 'DSuc',
|
||||
kIntervalChanged = 'DSin',
|
||||
kHorizonChanged = 'DShz',
|
||||
kP0ColourChangedCmd = 'GOp0',
|
||||
kM0ColourChangedCmd = 'GOm0',
|
||||
kP1ColourChangedCmd = 'GOp1',
|
||||
kM1ColourChangedCmd = 'GOm1',
|
||||
kPFColourChangedCmd = 'GOpf',
|
||||
kBLColourChangedCmd = 'GObl',
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
kDWidthChanged = 'UIdw',
|
||||
kDHeightChanged = 'UIdh',
|
||||
kDFontSizeChanged = 'UIfs',
|
||||
kDWidthChanged = 'UIdw',
|
||||
kDHeightChanged = 'UIdh',
|
||||
kDFontSizeChanged = 'UIfs',
|
||||
#endif
|
||||
};
|
||||
enum SettingsSet
|
||||
|
@ -97,6 +98,8 @@ class DeveloperDialog : public Dialog
|
|||
const uInt64 HORIZON_CYCLES[NUM_HORIZONS] = { 76 * 262, 76 * 262 * 10, 76 * 262 * 60, 76 * 262 * 60 * 10,
|
||||
76 * 262 * 60 * 60, 76 * 262 * 60 * 60 * 10, (uInt64)76 * 262 * 60 * 60 * 60 };
|
||||
|
||||
static const int DEBUG_COLORS = 6;
|
||||
|
||||
TabWidget* myTab;
|
||||
// Emulator widgets
|
||||
RadioButtonGroup* mySettingsGroup0;
|
||||
|
@ -107,26 +110,31 @@ class DeveloperDialog : public Dialog
|
|||
CheckboxWidget* myRandomizeRAMWidget;
|
||||
StaticTextWidget* myRandomizeCPULabel;
|
||||
CheckboxWidget* myRandomizeCPUWidget[5];
|
||||
CheckboxWidget* myColorLossWidget;
|
||||
CheckboxWidget* myUndrivenPinsWidget;
|
||||
CheckboxWidget* myThumbExceptionWidget;
|
||||
|
||||
// Video widgets
|
||||
RadioButtonGroup* mySettingsGroup1;
|
||||
CheckboxWidget* myTVJitterWidget;
|
||||
SliderWidget* myTVJitterRecWidget;
|
||||
StaticTextWidget* myTVJitterRecLabelWidget;
|
||||
CheckboxWidget* myColorLossWidget;
|
||||
CheckboxWidget* myDebugColorsWidget;
|
||||
CheckboxWidget* myUndrivenPinsWidget;
|
||||
PopUpWidget* myDbgColour[DEBUG_COLORS];
|
||||
ColorWidget* myDbgColourSwatch[DEBUG_COLORS];
|
||||
|
||||
// States widgets
|
||||
RadioButtonGroup* mySettingsGroup1;
|
||||
RadioButtonGroup* mySettingsGroup2;
|
||||
CheckboxWidget* myContinuousRewindWidget;
|
||||
SliderWidget* myStateSizeWidget;
|
||||
StaticTextWidget* myStateSizeLabelWidget;
|
||||
SliderWidget* myUncompressedWidget;
|
||||
StaticTextWidget* myUncompressedLabelWidget;
|
||||
SliderWidget* myStateIntervalWidget;
|
||||
StaticTextWidget* myStateIntervalLabelWidget;
|
||||
SliderWidget* myStateHorizonWidget;
|
||||
StaticTextWidget* myStateHorizonLabelWidget;
|
||||
|
||||
// Debug colours selection
|
||||
PopUpWidget* myDbgColour[6];
|
||||
ColorWidget* myDbgColourSwatch[6];
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
// Debugger UI widgets
|
||||
SliderWidget* myDebuggerWidthSlider;
|
||||
|
@ -151,16 +159,18 @@ class DeveloperDialog : public Dialog
|
|||
int myTVJitterRec[2];
|
||||
bool myDebugColors[2];
|
||||
bool myUndrivenPins[2];
|
||||
bool myThumbException[2];
|
||||
// States sets
|
||||
bool myContinuousRewind[2];
|
||||
int myStateSize[2];
|
||||
int myUncompressed[2];
|
||||
int myStateInterval[2];
|
||||
int myStateHorizon[2];
|
||||
|
||||
private:
|
||||
void addEmulationTab(const GUI::Font& font);
|
||||
void addStatesTab(const GUI::Font& font);
|
||||
void addDebugColorsTab(const GUI::Font& font);
|
||||
void addVideoTab(const GUI::Font& font);
|
||||
void addDebuggerTab(const GUI::Font& font);
|
||||
// Add Defaults, OK and Cancel buttons
|
||||
void addDefaultOKCancelButtons(const GUI::Font& font);
|
||||
|
@ -180,6 +190,7 @@ class DeveloperDialog : public Dialog
|
|||
|
||||
void handleRewind();
|
||||
void handleSize();
|
||||
void handleUncompressed();
|
||||
void handleInterval();
|
||||
void handleHorizon();
|
||||
void handleFontSize();
|
||||
|
|