RewindManager fix for ROM startup rewind

-bankrandom support for E7(8K) added
This commit is contained in:
thrust26 2017-11-28 23:20:06 +01:00
parent a239d94df9
commit 30cb1fe14d
3 changed files with 7 additions and 3 deletions

View File

@ -2458,7 +2458,7 @@
<tr>
<td><pre>-&lt;plr.|dev.&gt;bankrandom &lt;1|0&gt;</pre></td>
<td>On reset, randomize the startup bank.</td>
<td>On reset, randomize the startup bank (only for selected bankswitch types).</td>
</tr>
<tr>
@ -3019,7 +3019,7 @@
<tr><td>Player/Developer settings</td><td>Selects the active settings set</td><td>-dev.settings</td></tr>
<tr><td>Frame Statistics</td><td>Overlay console info on the TIA image during emulation.</td><td>-plr.stats<br/>-dev.stats</td></tr>
<tr><td>Console</td><td>Select the console type, this affects Color/B&W/Pause key emulation and zero-page RAM initialzation</td><td>-plr.console <br/>-dev.console</td></tr>
<tr><td>Random startup bank</td><td>Randomize the startup bank for several bankswitch types</td><td>-plr.bankrandom<br/>-dev.bankrandom</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>
<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>PAL color-loss</td><td>Use PAL color-loss effect</td><td>-plr.colorloss<br/>-dev.colorloss</td></tr>

View File

@ -185,7 +185,7 @@ string RewindManager::getMessage(RewindState& state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string RewindManager::getUnitString(Int64 cycles)
{
const Int64 scanlines = myOSystem.console().tia().scanlinesLastFrame();
const Int64 scanlines = std::max(myOSystem.console().tia().scanlinesLastFrame(), 240u);
const bool isNTSC = scanlines <= 285; // TODO: replace magic number
const Int64 NTSC_FREQ = 1193182; // ~76*262*60
const Int64 PAL_FREQ = 1182298; // ~76*312*50

View File

@ -43,6 +43,10 @@ void CartridgeMNetwork::reset()
// Install some default banks for the RAM and first segment
bankRAM(0);
// define random startup bank
randomizeStartBank();
bank(myStartBank);
myBankChanged = true;