diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx index a7074cb11..cdcb5cef3 100644 --- a/src/emucore/CartCV.cxx +++ b/src/emucore/CartCV.cxx @@ -27,11 +27,12 @@ CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size, myRamSize = RAM_SIZE; myRamWpHigh = RAM_HIGH_WP; - if (size <= 2_KB) + if(size <= 2_KB) { - // Move the ROM of <=2K files to the 2nd half of the 4K ROM - // The 1st half is used for RAM - std::copy_n(image.get(), size, myImage.get() + 4_KB - size); + for(size_t i = 0; i < 2_KB; i += size) + // Copy the ROM of <=2K files to the 2nd half of the 4K ROM + // The 1st half is used for RAM + std::copy_n(image.get(), size, myImage.get() + 2_KB + i); } else if(size == 4_KB) { diff --git a/src/emucore/CartDetector.cxx b/src/emucore/CartDetector.cxx index 5cc9e7bdb..8a29a424f 100644 --- a/src/emucore/CartDetector.cxx +++ b/src/emucore/CartDetector.cxx @@ -34,10 +34,6 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, size_t si else type = Bankswitch::Type::_AR; } - //else if(size < 2_KB) // Sub2K images - //{ - // type = isProbablyCV(image, size) ? Bankswitch::Type::_CV : Bankswitch::Type::_2K; - //} else if((size <= 2_KB) || (size == 4_KB && std::memcmp(image.get(), image.get() + 2_KB, 2_KB) == 0)) {