1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Improved CBS RAM Plus and Super Chip detection exclusion, reducing error count to 15.

This commit is contained in:
Thomas Harte 2017-03-12 14:03:17 -04:00
parent a4bba8a92e
commit de347ad7c8
2 changed files with 14 additions and 15 deletions

View File

@ -598,10 +598,7 @@ static NSDictionary<NSString *, AtariROMRecord *> *romRecordsBySHA1 = @{
// grab the ROM record
AtariROMRecord *romRecord = [self romRecordForSHA1:sha1];
if(!romRecord)
{
continue;
}
if(!romRecord) continue;
// assert equality
XCTAssert(targets.front().atari.paging_model == romRecord.pagingModel, @"%@; should be %d, is %d", testFile, romRecord.pagingModel, targets.front().atari.paging_model);

View File

@ -148,6 +148,9 @@ static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const St
case 8192:
DeterminePagingFor8kCartridge(target, segment, disassemblies);
break;
case 12288:
target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus;
break;
case 16384:
target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::Atari16k;
break;
@ -158,22 +161,21 @@ static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const St
break;
}
// check for any sort of on-cartridge RAM; that might imply a Super Chip or else immediately tip the
// hat that this is a CBS RAM+ cartridge. Atari ROM images always have the same value stored over RAM
// check for a Super Chip. Atari ROM images [almost] always have the same value stored over RAM
// regions.
if(target.atari.paging_model != StaticAnalyser::Atari2600PagingModel::CBSRamPlus)
{
bool has_superchip = true;
bool is_ram_plus = true;
for(size_t address = 0; address < 512; address++)
for(size_t address = 0; address < 256; address++)
{
if(segment.data[address] != segment.data[0])
{
if(address < 256) has_superchip = false;
is_ram_plus = false;
if(!has_superchip && !is_ram_plus) break;
has_superchip = false;
break;
}
}
target.atari.uses_superchip = has_superchip;
if(is_ram_plus) target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus;
}
// check for a Tigervision or Tigervision-esque scheme
if(target.atari.paging_model == StaticAnalyser::Atari2600PagingModel::None && segment.data.size() > 4096)