'cpurandom' includes the SP register, and is now turned off by default.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3005 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-10-13 23:59:49 +00:00
parent 7247f64b8d
commit 537eef7384
4 changed files with 10 additions and 5 deletions

View File

@ -19,6 +19,9 @@
and they will be added and removed automatically. Also fixed is and they will be added and removed automatically. Also fixed is
a bug whereby sometimes custom joystick mappings weren't being saved. a bug whereby sometimes custom joystick mappings weren't being saved.
* The 'cpurandom' option now also randomizes the SP register, and the
randomization is now disabled by default.
* Fixed 'MDM' scheme to trigger bankswitching on writes to hotspots * Fixed 'MDM' scheme to trigger bankswitching on writes to hotspots
(previously it only triggered on reads). Also, the scheme has been (previously it only triggered on reads). Also, the scheme has been
modified as originally designed by E. Blink; hotspots are now in the modified as originally designed by E. Blink; hotspots are now in the

View File

@ -221,7 +221,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
// Randomize CPU // Randomize CPU
xpos += 30; ypos += lineHeight + 4; xpos += 30; ypos += lineHeight + 4;
myRandomizeCPU = new CheckboxWidget(boss, lfont, xpos, ypos+1, myRandomizeCPU = new CheckboxWidget(boss, lfont, xpos, ypos+1,
"Randomize CPU registers (A/X/Y/PS)", kCheckActionCmd); "Randomize CPU registers (SP/A/X/Y/PS)", kCheckActionCmd);
myRandomizeCPU->setID(kRandCPUID); myRandomizeCPU->setID(kRandCPUID);
myRandomizeCPU->setTarget(this); myRandomizeCPU->setTarget(this);
addFocusWidget(myRandomizeCPU); addFocusWidget(myRandomizeCPU);

View File

@ -113,6 +113,7 @@ void M6502::reset()
SP = 0xff; SP = 0xff;
if(mySettings.getBool("cpurandom")) if(mySettings.getBool("cpurandom"))
{ {
SP = mySystem->randGenerator().next();
A = mySystem->randGenerator().next(); A = mySystem->randGenerator().next();
X = mySystem->randGenerator().next(); X = mySystem->randGenerator().next();
Y = mySystem->randGenerator().next(); Y = mySystem->randGenerator().next();
@ -120,6 +121,7 @@ void M6502::reset()
} }
else else
{ {
SP = 0xff;
A = X = Y = 0; A = X = Y = 0;
PS(0x20); PS(0x20);
} }

View File

@ -130,7 +130,7 @@ Settings::Settings(OSystem& osystem)
setInternal("loglevel", "1"); setInternal("loglevel", "1");
setInternal("logtoconsole", "0"); setInternal("logtoconsole", "0");
setInternal("tiadriven", "false"); setInternal("tiadriven", "false");
setInternal("cpurandom", "true"); setInternal("cpurandom", "false");
setInternal("ramrandom", "true"); setInternal("ramrandom", "true");
setInternal("avoxport", ""); setInternal("avoxport", "");
setInternal("stats", "false"); setInternal("stats", "false");