From dbee37ab34c877f8bde399667b378a0925aab7ad Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 22 Jul 2019 22:15:44 -0400 Subject: [PATCH] Provides extended ROM details for the VIC-20 and Oric. --- Machines/Apple/AppleII/DiskIICard.cpp | 15 +++++++++++---- Machines/Commodore/Vic-20/Vic20.cpp | 24 +++++++++++++----------- Machines/MasterSystem/MasterSystem.cpp | 7 +++++-- Machines/Oric/Oric.cpp | 25 ++++++++++++++++++------- Machines/ROMMachine.hpp | 4 ---- 5 files changed, 47 insertions(+), 28 deletions(-) diff --git a/Machines/Apple/AppleII/DiskIICard.cpp b/Machines/Apple/AppleII/DiskIICard.cpp index 4bb530d27..dae7b30cf 100644 --- a/Machines/Apple/AppleII/DiskIICard.cpp +++ b/Machines/Apple/AppleII/DiskIICard.cpp @@ -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>> 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); diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 84c1b05f1..2ac58a2e5 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -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 rom_names = { {machine_name, "basic.bin"} }; + std::vector 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; } diff --git a/Machines/MasterSystem/MasterSystem.cpp b/Machines/MasterSystem/MasterSystem.cpp index 05b37493e..0f5f89eda 100644 --- a/Machines/MasterSystem/MasterSystem.cpp +++ b/Machines/MasterSystem/MasterSystem.cpp @@ -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; diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 37bf52b4f..bbeea6290 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -229,16 +229,26 @@ template class Co } const std::string machine_name = "Oric"; - std::vector rom_names = { {machine_name, "colour.rom"} }; + std::vector 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 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; } diff --git a/Machines/ROMMachine.hpp b/Machines/ROMMachine.hpp index 071eb68f4..b1b9cb818 100644 --- a/Machines/ROMMachine.hpp +++ b/Machines/ROMMachine.hpp @@ -36,10 +36,6 @@ struct ROM { /// to exclude ROMs where the user's intent is otherwise clear. std::vector 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 crc32s) :