1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-11 04:28:58 +00:00

Corrects DiskII boot ROM CRCs and improves corresponding declarations.

This commit is contained in:
Thomas Harte 2019-07-22 23:07:23 -04:00
parent dbee37ab34
commit b4191b6225
3 changed files with 18 additions and 12 deletions

View File

@ -372,6 +372,14 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
} }
const auto roms = rom_fetcher(rom_descriptions); const auto roms = rom_fetcher(rom_descriptions);
// Try to install a Disk II card now, before checking the ROM list,
// to make sure that Disk II dependencies have been communicated.
if(target.disk_controller != Target::DiskController::None) {
// Apple recommended slot 6 for the (first) Disk II.
install_card(6, new Apple::II::DiskIICard(rom_fetcher, target.disk_controller == Target::DiskController::SixteenSector));
}
// Now, check and move the ROMs.
if(!roms[0] || !roms[1]) { if(!roms[0] || !roms[1]) {
throw ROMMachine::Error::MissingROMs; throw ROMMachine::Error::MissingROMs;
} }
@ -383,11 +391,6 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
video_.set_character_rom(*roms[0]); video_.set_character_rom(*roms[0]);
if(target.disk_controller != Target::DiskController::None) {
// Apple recommended slot 6 for the (first) Disk II.
install_card(6, new Apple::II::DiskIICard(rom_fetcher, target.disk_controller == Target::DiskController::SixteenSector));
}
// Set up the default memory blocks. On a II or II+ these values will never change. // Set up the default memory blocks. On a II or II+ these values will never change.
// On a IIe they'll be affected by selection of auxiliary RAM. // On a IIe they'll be affected by selection of auxiliary RAM.
set_main_paging(); set_main_paging();

View File

@ -15,7 +15,7 @@ DiskIICard::DiskIICard(const ROMMachine::ROMFetcher &rom_fetcher, bool is_16_sec
if(is_16_sector) { if(is_16_sector) {
roms = rom_fetcher({ roms = rom_fetcher({
{"DiskII", "the Disk II 16-sector boot ROM", "boot-16.rom", 256, 0xce7144f6}, {"DiskII", "the Disk II 16-sector boot ROM", "boot-16.rom", 256, 0xce7144f6},
{"DiskII", "the Disk II 16-sector state machine ROM", "state-machine-16.rom", 256, { 0xce7144f6, 0xb72a2c70 } } {"DiskII", "the Disk II 16-sector state machine ROM", "state-machine-16.rom", 256, { 0x9796a238, 0xb72a2c70 } }
}); });
} else { } else {
roms = rom_fetcher({ roms = rom_fetcher({
@ -23,6 +23,10 @@ DiskIICard::DiskIICard(const ROMMachine::ROMFetcher &rom_fetcher, bool is_16_sec
{"DiskII", "the Disk II 13-sector state machine ROM", "state-machine-13.rom", 256, 0x62e22620 } {"DiskII", "the Disk II 13-sector state machine ROM", "state-machine-13.rom", 256, 0x62e22620 }
}); });
} }
if(!roms[0] || !roms[1]) {
throw ROMMachine::Error::MissingROMs;
}
boot_ = std::move(*roms[0]); boot_ = std::move(*roms[0]);
diskii_.set_state_machine(*roms[1]); diskii_.set_state_machine(*roms[1]);
set_select_constraints(None); set_select_constraints(None);

View File

@ -241,6 +241,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
rom_names.emplace_back(machine_name, "Pravetz BASIC", "pravetz.rom", 16*1024, 0x58079502); rom_names.emplace_back(machine_name, "Pravetz BASIC", "pravetz.rom", 16*1024, 0x58079502);
break; break;
} }
size_t diskii_state_machine_index = 0;
switch(disk_interface) { switch(disk_interface) {
default: break; default: break;
case Analyser::Static::Oric::Target::DiskInterface::Microdisc: case Analyser::Static::Oric::Target::DiskInterface::Microdisc:
@ -248,6 +249,9 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
break; break;
case Analyser::Static::Oric::Target::DiskInterface::Pravetz: case Analyser::Static::Oric::Target::DiskInterface::Pravetz:
rom_names.emplace_back(machine_name, "the 8DOS boot ROM", "8dos.rom", 512, 0x49a74c06); rom_names.emplace_back(machine_name, "the 8DOS boot ROM", "8dos.rom", 512, 0x49a74c06);
// These ROM details are coupled with those in the DiskIICard.
diskii_state_machine_index = rom_names.size();
rom_names.push_back({"DiskII", "the Disk II 16-sector state machine ROM", "state-machine-16.rom", 256, { 0x9796a238, 0xb72a2c70 }});
break; break;
} }
@ -272,12 +276,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
pravetz_rom_ = std::move(*roms[2]); pravetz_rom_ = std::move(*roms[2]);
pravetz_rom_.resize(512); pravetz_rom_.resize(512);
// This ROM name is coupled with that in the DiskIICard. diskii_.set_state_machine(*roms[diskii_state_machine_index]);
const auto state_machine_rom = rom_fetcher({ {"DiskII", "the Disk II 16-sector state machine ROM", "state-machine-16.rom", 256, { 0xce7144f6, 0xb72a2c70 } } });
if(!state_machine_rom[0]) {
throw ROMMachine::Error::MissingROMs;
}
diskii_.set_state_machine(*state_machine_rom[0]);
} break; } break;
} }