From c3a8543dc4e1b99a520a39c9569ff54c18dfc197 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 13 Dec 2019 20:21:20 -0330 Subject: [PATCH] Properly handle 'Cart.StartBank' set to 'AUTO' in the ROM properties. --- src/emucore/Console.cxx | 3 ++- src/emucore/Props.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index c45f4644d..d9a1030a8 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -119,7 +119,8 @@ Console::Console(OSystem& osystem, unique_ptr& cart, // Let the cart know how to query for the 'Cartridge.StartBank' property myCart->setStartBankFromPropsFunc([this]() { const string& startbank = myProperties.get(PropType::Cart_StartBank); - return startbank == EmptyString ? -1 : atoi(startbank.c_str()); + return (startbank == EmptyString || BSPF::equalsIgnoreCase(startbank, "AUTO")) + ? -1 : atoi(startbank.c_str()); }); // We can only initialize after all the devices/components have been created diff --git a/src/emucore/Props.cxx b/src/emucore/Props.cxx index 5490ea59b..1ab74542c 100644 --- a/src/emucore/Props.cxx +++ b/src/emucore/Props.cxx @@ -314,7 +314,7 @@ string Properties::ourDefaultProperties[static_cast(PropType::NumTypes)] "", // Cart.Note "", // Cart.Rarity "MONO", // Cart.Sound - "", // Cart.StartBank + "AUTO", // Cart.StartBank "AUTO", // Cart.Type "B", // Console.LeftDiff "B", // Console.RightDiff