From c472e07d18ec7d7602ab87c3d474b92d001545ba Mon Sep 17 00:00:00 2001 From: clobber Date: Thu, 21 Nov 2019 14:45:47 -0600 Subject: [PATCH] Correctly load supergame cart types This was a long-standing issue with ProSystem and the "supergame" cart types. Fixes loading of good ROM dumps where previously only their overdumps would load (Tower Toppler, Realsports Baseball, Water Ski, etc) Patch credits to Joseph Zatarski of ##Atari on Freenode IRC --- Core/Cartridge.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/Cartridge.cpp b/Core/Cartridge.cpp index 0334239..6d17524 100644 --- a/Core/Cartridge.cpp +++ b/Core/Cartridge.cpp @@ -70,6 +70,12 @@ static bool cartridge_CC2(const byte* header) { // GetBankOffset // ---------------------------------------------------------------------------- static uint cartridge_GetBankOffset(byte bank) { + if ((cartridge_type == CARTRIDGE_TYPE_SUPERCART || cartridge_type == CARTRIDGE_TYPE_SUPERCART_ROM || cartridge_type == CARTRIDGE_TYPE_SUPERCART_RAM) && cartridge_size <= 65536) { + // for some of these carts, there are only 4 banks. in this case we ignore bit 3 + // previously, games of this type had to be doubled. The first 4 banks needed to be duplicated at the end of the ROM + return (bank & 3) * 16384; + } + return bank * 16384; }