From 537eef73847ac01b4ecb3734a7d3a9cb3ea488d5 Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 13 Oct 2014 23:59:49 +0000 Subject: [PATCH] '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 --- Changes.txt | 3 +++ src/debugger/gui/RiotWidget.cxx | 2 +- src/emucore/M6502.cxx | 8 +++++--- src/emucore/Settings.cxx | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Changes.txt b/Changes.txt index f16366028..678016802 100644 --- a/Changes.txt +++ b/Changes.txt @@ -19,6 +19,9 @@ and they will be added and removed automatically. Also fixed is 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 (previously it only triggered on reads). Also, the scheme has been modified as originally designed by E. Blink; hotspots are now in the diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx index cb39bcbba..630d381d2 100644 --- a/src/debugger/gui/RiotWidget.cxx +++ b/src/debugger/gui/RiotWidget.cxx @@ -221,7 +221,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont, // Randomize CPU xpos += 30; ypos += lineHeight + 4; 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->setTarget(this); addFocusWidget(myRandomizeCPU); diff --git a/src/emucore/M6502.cxx b/src/emucore/M6502.cxx index c927e72af..198f95c6a 100644 --- a/src/emucore/M6502.cxx +++ b/src/emucore/M6502.cxx @@ -113,13 +113,15 @@ void M6502::reset() SP = 0xff; if(mySettings.getBool("cpurandom")) { - A = mySystem->randGenerator().next(); - X = mySystem->randGenerator().next(); - Y = mySystem->randGenerator().next(); + SP = mySystem->randGenerator().next(); + A = mySystem->randGenerator().next(); + X = mySystem->randGenerator().next(); + Y = mySystem->randGenerator().next(); PS(mySystem->randGenerator().next()); } else { + SP = 0xff; A = X = Y = 0; PS(0x20); } diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 4dd2fe18c..9ef16ebcc 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -130,7 +130,7 @@ Settings::Settings(OSystem& osystem) setInternal("loglevel", "1"); setInternal("logtoconsole", "0"); setInternal("tiadriven", "false"); - setInternal("cpurandom", "true"); + setInternal("cpurandom", "false"); setInternal("ramrandom", "true"); setInternal("avoxport", ""); setInternal("stats", "false");