1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Switched to image inspection for RAM guesses rather than disassembly. Which fixes the other Parker Bros titles.

This commit is contained in:
Thomas Harte 2017-03-11 13:04:23 -05:00
parent 2b5e3a600e
commit 33bda2d40c
2 changed files with 28 additions and 15 deletions

View File

@ -93,8 +93,8 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
}
break;
case StaticAnalyser::Atari2600PagingModel::ParkerBros:
if(masked_address >= 0x1fe0 && masked_address <= 0x1ff8) {
int slot = (masked_address - 0x1fe0) >> 3;
if(masked_address >= 0x1fe0 && masked_address < 0x1ff8) {
int slot = (masked_address >> 3) & 3;
int target = masked_address & 7;
rom_pages_[slot] = &rom_[target * 1024];
}
@ -290,13 +290,13 @@ void Machine::configure_as_target(const StaticAnalyser::Target &target)
// On a real paged cartridge, any page may initially be visible. Various homebrew authors appear to have
// decided the last page will always be initially visible. So do that.
size_t romMask = rom_size_ - 1;
size_t rom_mask = rom_size_ - 1;
uint8_t *rom_base = rom_;
if(rom_size_ > 4096) rom_base = &rom_[rom_size_ - 4096];
rom_pages_[0] = rom_base;
rom_pages_[1] = &rom_base[1024 & romMask];
rom_pages_[2] = &rom_base[2048 & romMask];
rom_pages_[3] = &rom_base[3072 & romMask];
rom_pages_[1] = &rom_base[1024 & rom_mask];
rom_pages_[2] = &rom_base[2048 & rom_mask];
rom_pages_[3] = &rom_base[3072 & rom_mask];
switch(target.atari.paging_model)
{

View File

@ -145,19 +145,32 @@ static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const St
}
// 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
if(internal_stores.size() > 4)
// hat that this is a CBS RAM+ cartridge. Atari ROM images always have the same value stored over RAM
// regions.
bool has_superchip = true;
bool is_ram_plus = true;
for(size_t address = 0; address < 256; address++)
{
bool writes_above_128 = false;
for(uint16_t address : internal_stores)
if(segment.data[address] != segment.data[0])
{
writes_above_128 |= ((address & 0x1fff) > 0x10ff) && ((address & 0x1fff) < 0x1200);
if(address < 128) has_superchip = false;
is_ram_plus = false;
}
if(writes_above_128)
target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus;
else
target.atari.uses_superchip = true;
}
target.atari.uses_superchip = has_superchip;
if(is_ram_plus) target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus;
// if(internal_stores.size() > 4)
// {
// bool writes_above_128 = false;
// for(uint16_t address : internal_stores)
// {
// writes_above_128 |= ((address & 0x1fff) > 0x10ff) && ((address & 0x1fff) < 0x1200);
// }
// if(writes_above_128)
// target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus;
// else
// target.atari.uses_superchip = true;
// }
}
void StaticAnalyser::Atari::AddTargets(