mirror of https://github.com/stella-emu/stella.git
enhanced CartCV to support small ROMs (Part 2)
This commit is contained in:
parent
811bcfdf30
commit
3043acba1e
|
@ -164,7 +164,7 @@ Bankswitch::Sizes = {{
|
||||||
{ 32_KB, 512_KB }, // _CDF
|
{ 32_KB, 512_KB }, // _CDF
|
||||||
{ 16_KB, 16_KB }, // _CM
|
{ 16_KB, 16_KB }, // _CM
|
||||||
{ 32_KB, 32_KB }, // _CTY
|
{ 32_KB, 32_KB }, // _CTY
|
||||||
{ 2_KB, 4_KB }, // _CV
|
{ 0_KB, 4_KB }, // _CV
|
||||||
{ 128_KB, 128_KB }, // _DF
|
{ 128_KB, 128_KB }, // _DF
|
||||||
{ 128_KB, 128_KB }, // _DFSC
|
{ 128_KB, 128_KB }, // _DFSC
|
||||||
{ 10_KB, 11_KB }, // _DPC
|
{ 10_KB, 11_KB }, // _DPC
|
||||||
|
|
|
@ -34,11 +34,11 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, size_t si
|
||||||
else
|
else
|
||||||
type = Bankswitch::Type::_AR;
|
type = Bankswitch::Type::_AR;
|
||||||
}
|
}
|
||||||
else if(size < 2_KB) // Sub2K images
|
//else if(size < 2_KB) // Sub2K images
|
||||||
{
|
//{
|
||||||
type = Bankswitch::Type::_2K;
|
// type = isProbablyCV(image, size) ? Bankswitch::Type::_CV : Bankswitch::Type::_2K;
|
||||||
}
|
//}
|
||||||
else if((size == 2_KB) ||
|
else if((size <= 2_KB) ||
|
||||||
(size == 4_KB && std::memcmp(image.get(), image.get() + 2_KB, 2_KB) == 0))
|
(size == 4_KB && std::memcmp(image.get(), image.get() + 2_KB, 2_KB) == 0))
|
||||||
{
|
{
|
||||||
type = isProbablyCV(image, size) ? Bankswitch::Type::_CV : Bankswitch::Type::_2K;
|
type = isProbablyCV(image, size) ? Bankswitch::Type::_CV : Bankswitch::Type::_2K;
|
||||||
|
@ -516,8 +516,8 @@ bool CartDetector::isProbablyCV(const ByteBuffer& image, size_t size)
|
||||||
// CV RAM access occurs at addresses $f3ff and $f400
|
// CV RAM access occurs at addresses $f3ff and $f400
|
||||||
// These signatures are attributed to the MESS project
|
// These signatures are attributed to the MESS project
|
||||||
static constexpr uInt8 signature[2][3] = {
|
static constexpr uInt8 signature[2][3] = {
|
||||||
{ 0x9D, 0xFF, 0xF3 }, // STA $F3FF,X
|
{ 0x9D, 0xFF, 0xF3 }, // STA $F3FF,X MagiCard
|
||||||
{ 0x99, 0x00, 0xF4 } // STA $F400,Y
|
{ 0x99, 0x00, 0xF4 } // STA $F400,Y Video Life
|
||||||
};
|
};
|
||||||
if(searchForBytes(image, size, signature[0], 3))
|
if(searchForBytes(image, size, signature[0], 3))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue