From 811bcfdf307fd253418584b2568ae0707975b744 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 11 Sep 2023 22:26:01 +0200 Subject: [PATCH] enhanced CartCV to support small ROMs --- src/emucore/CartCV.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emucore/CartCV.cxx b/src/emucore/CartCV.cxx index bed4b10a9..a7074cb11 100644 --- a/src/emucore/CartCV.cxx +++ b/src/emucore/CartCV.cxx @@ -27,11 +27,11 @@ 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 + // 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(), 2_KB, myImage.get() + 2_KB); + std::copy_n(image.get(), size, myImage.get() + 4_KB - size); } else if(size == 4_KB) {