From a83c794d1b183d82e6468ce9536b3ca372232e0a Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 5 Oct 2020 16:18:34 -0230 Subject: [PATCH] Startup bank randomization is now disabled for BUS and DPC+ too (similar reasoning as for CDF). --- Changes.txt | 4 +++- src/emucore/CartBUS.hxx | 7 +++++++ src/emucore/CartCDF.hxx | 8 ++++---- src/emucore/CartDPCPlus.hxx | 7 +++++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Changes.txt b/Changes.txt index 0276a60e7..dee6dc44a 100644 --- a/Changes.txt +++ b/Changes.txt @@ -53,12 +53,14 @@ * Added option to disable aspect correct scaling. + * Bankswitching schemes BUS, DPC+ and CDFx now work when startup bank + randomization is enabled (these schemes now ignore that setting). + * Replaced "Re-disassemble" with "Disassemble @ current line" in debugger. * Fixed bug when taking fullscreen snapshots; the dimensions were sometimes cut off. - -Have fun! diff --git a/src/emucore/CartBUS.hxx b/src/emucore/CartBUS.hxx index 054324353..86947ed19 100644 --- a/src/emucore/CartBUS.hxx +++ b/src/emucore/CartBUS.hxx @@ -181,6 +181,13 @@ class CartridgeBUS : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: + /** + Checks if startup bank randomization is enabled. For this scheme, + randomization is not supported, since the ARM code is always in a + pre-defined bank, and we *must* start from there. + */ + bool randomStartBank() const override { return false; } + /** Sets the initial state of the DPC pointers and RAM */ diff --git a/src/emucore/CartCDF.hxx b/src/emucore/CartCDF.hxx index 812792f3f..e02b8a83d 100644 --- a/src/emucore/CartCDF.hxx +++ b/src/emucore/CartCDF.hxx @@ -177,7 +177,7 @@ class CartridgeCDF : public Cartridge /** Size of SRAM (RAM) area in cart - */ + */ uInt32 ramSize() const; /** @@ -215,9 +215,9 @@ class CartridgeCDF : public Cartridge private: /** - Checks if startup bank randomization is enabled. - - @return Whether the startup bank(s) should be randomized + Checks if startup bank randomization is enabled. For this scheme, + randomization is not supported, since the ARM code is always in a + pre-defined bank, and we *must* start from there. */ bool randomStartBank() const override { return false; } diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index 5c83da263..3cef0a47a 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -175,6 +175,13 @@ class CartridgeDPCPlus : public Cartridge bool poke(uInt16 address, uInt8 value) override; private: + /** + Checks if startup bank randomization is enabled. For this scheme, + randomization is not supported, since the ARM code is always in a + pre-defined bank, and we *must* start from there. + */ + bool randomStartBank() const override { return false; } + /** Sets the initial state of the DPC pointers and RAM */