From a7e19d1d6b2b32e82fb1dbf97b27d260673396c7 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Mon, 22 Aug 2022 09:35:53 +0200 Subject: [PATCH 1/2] fixed multiple images crash when no images exist --- src/gui/RomImageWidget.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/RomImageWidget.cxx b/src/gui/RomImageWidget.cxx index 166696ece..a8b97334f 100644 --- a/src/gui/RomImageWidget.cxx +++ b/src/gui/RomImageWidget.cxx @@ -188,7 +188,7 @@ bool RomImageWidget::changeImage(int direction) #ifdef IMAGE_SUPPORT if(direction == -1 && myImageIdx) return loadImage(myImageList[--myImageIdx].getPath()); - else if(direction == 1 && myImageIdx < myImageList.size() - 1) + else if(direction == 1 && myImageIdx + 1 < myImageList.size()) return loadImage(myImageList[++myImageIdx].getPath()); #endif return false; From c0bea2763b04dc17df2575a871044065ec5407e7 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Mon, 22 Aug 2022 09:36:38 +0200 Subject: [PATCH 2/2] disabled random start bank for MDM bankswitching ROMs --- src/emucore/CartMDM.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/emucore/CartMDM.hxx b/src/emucore/CartMDM.hxx index a8c39f833..13a264372 100644 --- a/src/emucore/CartMDM.hxx +++ b/src/emucore/CartMDM.hxx @@ -137,6 +137,12 @@ class CartridgeMDM : public CartridgeEnhanced bool poke(uInt16 address, uInt8 value) override; private: + /** + Checks if startup bank randomization is enabled. For this scheme, + randomization is not supported (see above). + */ + bool randomStartBank() const override { return false; } + bool checkSwitchBank(uInt16 address, uInt8) override; private: