enhanced CartCV to support small ROMs (Part 3)

This commit is contained in:
thrust26 2023-09-12 11:22:45 +02:00
parent 140657c453
commit 2754edd176
2 changed files with 5 additions and 8 deletions

View File

@ -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
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() + 4_KB - size);
std::copy_n(image.get(), size, myImage.get() + 2_KB + i);
}
else if(size == 4_KB)
{

View File

@ -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))
{