1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Provides extended ROM details for the VIC-20 and Oric.

This commit is contained in:
Thomas Harte 2019-07-22 22:15:44 -04:00
parent a3ad0ab09b
commit dbee37ab34
5 changed files with 47 additions and 28 deletions

View File

@ -11,11 +11,18 @@
using namespace Apple::II;
DiskIICard::DiskIICard(const ROMMachine::ROMFetcher &rom_fetcher, bool is_16_sector) : diskii_(2045454) {
const auto roms = rom_fetcher(
{
{"DiskII", is_16_sector ? "boot-16.rom" : "boot-13.rom"},
{"DiskII", is_16_sector ? "state-machine-16.rom" : "state-machine-13.rom"}
std::vector<std::unique_ptr<std::vector<uint8_t>>> roms;
if(is_16_sector) {
roms = rom_fetcher({
{"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 } }
});
} else {
roms = rom_fetcher({
{"DiskII", "the Disk II 13-sector boot ROM", "boot-13.rom", 256, 0xd34eb2ff},
{"DiskII", "the Disk II 13-sector state machine ROM", "state-machine-13.rom", 256, 0x62e22620 }
});
}
boot_ = std::move(*roms[0]);
diskii_.set_state_machine(*roms[1]);
set_select_constraints(None);

View File

@ -324,27 +324,29 @@ class ConcreteMachine:
joysticks_.emplace_back(new Joystick(*user_port_via_port_handler_, *keyboard_via_port_handler_));
const std::string machine_name = "Vic20";
std::vector<ROMMachine::ROM> rom_names = { {machine_name, "basic.bin"} };
std::vector<ROMMachine::ROM> rom_names = {
{machine_name, "the VIC-20 BASIC ROM", "basic.bin", 8*1024, 0xdb4c43c1}
};
switch(target.region) {
default:
rom_names.emplace_back(machine_name, "characters-english.bin");
rom_names.emplace_back(machine_name, "kernel-pal.bin");
rom_names.emplace_back(machine_name, "the English-language VIC-20 character ROM", "characters-english.bin", 4*1024, 0x83e032a6);
rom_names.emplace_back(machine_name, "the English-language PAL VIC-20 kernel ROM", "kernel-pal.bin", 8*1024, 0x4be07cb4);
break;
case Analyser::Static::Commodore::Target::Region::American:
rom_names.emplace_back(machine_name, "characters-english.bin");
rom_names.emplace_back(machine_name, "kernel-ntsc.bin");
rom_names.emplace_back(machine_name, "the English-language VIC-20 character ROM", "characters-english.bin", 4*1024, 0x83e032a6);
rom_names.emplace_back(machine_name, "the English-language NTSC VIC-20 kernel ROM", "kernel-ntsc.bin", 8*1024, 0xe5e7c174);
break;
case Analyser::Static::Commodore::Target::Region::Danish:
rom_names.emplace_back(machine_name, "characters-danish.bin");
rom_names.emplace_back(machine_name, "kernel-danish.bin");
rom_names.emplace_back(machine_name, "the Danish VIC-20 character ROM", "characters-danish.bin", 4*1024, 0x7fc11454);
rom_names.emplace_back(machine_name, "the Danish VIC-20 kernel ROM", "kernel-danish.bin", 8*1024, 0x02adaf16);
break;
case Analyser::Static::Commodore::Target::Region::Japanese:
rom_names.emplace_back(machine_name, "characters-japanese.bin");
rom_names.emplace_back(machine_name, "kernel-japanese.bin");
rom_names.emplace_back(machine_name, "the Japanese VIC-20 character ROM", "characters-japanese.bin", 4*1024, 0xfcfd8a4b);
rom_names.emplace_back(machine_name, "the Japanese VIC-20 kernel ROM", "kernel-japanese.bin", 8*1024, 0x336900d7);
break;
case Analyser::Static::Commodore::Target::Region::Swedish:
rom_names.emplace_back(machine_name, "characters-swedish.bin");
rom_names.emplace_back(machine_name, "kernel-japanese.bin");
rom_names.emplace_back(machine_name, "the Swedish VIC-20 character ROM", "characters-swedish.bin", 4*1024, 0xd808551d);
rom_names.emplace_back(machine_name, "the Swedish VIC-20 kernel ROM", "kernel-swedish.bin", 8*1024, 0xb2a60662);
break;
}

View File

@ -133,8 +133,11 @@ class ConcreteMachine:
// Load the BIOS if relevant.
if(has_bios()) {
// TODO: there's probably a million other versions of the Master System BIOS; try to build a
// CRC32 catalogue of those.
const auto roms = rom_fetcher({ {"MasterSystem", "the Master System BIOS", "bios.sms", 8*1024, 0x0072ed54} });
// CRC32 catalogue of those. So far:
//
// 0072ed54 = US/European BIOS 1.3
// 48d44a13 = Japanese BIOS 2.1
const auto roms = rom_fetcher({ {"MasterSystem", "the Master System BIOS", "bios.sms", 8*1024, { 0x0072ed54, 0x48d44a13 } } });
if(!roms[0]) {
// No BIOS found; attempt to boot as though it has already disabled itself.
memory_control_ |= 0x08;

View File

@ -229,16 +229,26 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
}
const std::string machine_name = "Oric";
std::vector<ROMMachine::ROM> rom_names = { {machine_name, "colour.rom"} };
std::vector<ROMMachine::ROM> rom_names = { {machine_name, "the Oric colour ROM", "colour.rom", 128, 0xd50fca65} };
switch(target.rom) {
case Analyser::Static::Oric::Target::ROM::BASIC10: rom_names.emplace_back(machine_name, "basic10.rom"); break;
case Analyser::Static::Oric::Target::ROM::BASIC11: rom_names.emplace_back(machine_name, "basic11.rom"); break;
case Analyser::Static::Oric::Target::ROM::Pravetz: rom_names.emplace_back(machine_name, "pravetz.rom"); break;
case Analyser::Static::Oric::Target::ROM::BASIC10:
rom_names.emplace_back(machine_name, "Oric BASIC 1.0", "basic10.rom", 16*1024, 0xf18710b4);
break;
case Analyser::Static::Oric::Target::ROM::BASIC11:
rom_names.emplace_back(machine_name, "Oric BASIC 1.1", "basic11.rom", 16*1024, 0xc3a92bef);
break;
case Analyser::Static::Oric::Target::ROM::Pravetz:
rom_names.emplace_back(machine_name, "Pravetz BASIC", "pravetz.rom", 16*1024, 0x58079502);
break;
}
switch(disk_interface) {
default: break;
case Analyser::Static::Oric::Target::DiskInterface::Microdisc: rom_names.emplace_back(machine_name, "microdisc.rom"); break;
case Analyser::Static::Oric::Target::DiskInterface::Pravetz: rom_names.emplace_back(machine_name, "8dos.rom"); break;
case Analyser::Static::Oric::Target::DiskInterface::Microdisc:
rom_names.emplace_back(machine_name, "the ORIC Microdisc ROM", "microdisc.rom", 8*1024, 0xa9664a9c);
break;
case Analyser::Static::Oric::Target::DiskInterface::Pravetz:
rom_names.emplace_back(machine_name, "the 8DOS boot ROM", "8dos.rom", 512, 0x49a74c06);
break;
}
const auto roms = rom_fetcher(rom_names);
@ -262,7 +272,8 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
pravetz_rom_ = std::move(*roms[2]);
pravetz_rom_.resize(512);
auto state_machine_rom = rom_fetcher({ {"DiskII", "state-machine-16.rom"} });
// This ROM name is coupled with that in the DiskIICard.
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;
}

View File

@ -36,10 +36,6 @@ struct ROM {
/// to exclude ROMs where the user's intent is otherwise clear.
std::vector<uint32_t> crc32s;
/// This is a temporary constructor provided for transitional purposes.
ROM(std::string machine_name, std::string file_name) :
machine_name(machine_name), file_name(file_name) {}
ROM(std::string machine_name, std::string descriptive_name, std::string file_name, size_t size, uint32_t crc32) :
machine_name(machine_name), descriptive_name(descriptive_name), file_name(file_name), size(size), crc32s({crc32}) {}
ROM(std::string machine_name, std::string descriptive_name, std::string file_name, size_t size, std::initializer_list<uint32_t> crc32s) :