From 359f40028e3b1850929cba3fbffe5a36ac265774 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 7 Mar 2024 18:28:52 +0100 Subject: [PATCH] Fixed PlusROM detection (fixes #1021) --- src/emucore/CartDetector.cxx | 2 +- src/emucore/PlusROM.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/emucore/CartDetector.cxx b/src/emucore/CartDetector.cxx index 7a903d25a..523904a62 100755 --- a/src/emucore/CartDetector.cxx +++ b/src/emucore/CartDetector.cxx @@ -849,7 +849,7 @@ bool CartDetector::isProbablyX07(const ByteBuffer& image, size_t size) bool CartDetector::isProbablyPlusROM(const ByteBuffer& image, size_t size) { // PlusCart uses this pattern to detect a PlusROM - static constexpr uInt8 signature[3] = { 0x8d, 0xf0, 0x1f }; // STA $1FF0 + static constexpr uInt8 signature[3] = { 0x8d, 0xf1, 0x1f }; // STA $1FF1 return searchForBytes(image, size, signature, 3); } diff --git a/src/emucore/PlusROM.cxx b/src/emucore/PlusROM.cxx index e8e0151f4..f5c78c5e6 100644 --- a/src/emucore/PlusROM.cxx +++ b/src/emucore/PlusROM.cxx @@ -24,6 +24,7 @@ #include "Logger.hxx" #include "Version.hxx" #include "Settings.hxx" +#include "CartDetector.hxx" #if defined(HTTP_LIB_SUPPORT) #include "http_lib.hxx" @@ -238,7 +239,7 @@ bool PlusROM::initialize(const ByteBuffer& image, size_t size) reset(); - return myIsPlusROM = true; + return myIsPlusROM = CartDetector::isProbablyPlusROM(image, size); #else return myIsPlusROM = false; #endif