1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 15:29:36 +00:00

Adds extended Introduces extended ROM details for the C1540, Electron, Master System and MSX.

This commit is contained in:
Thomas Harte 2019-07-20 21:30:37 -04:00
parent 712cb473f7
commit f3aac603f8
4 changed files with 33 additions and 18 deletions

View File

@ -39,13 +39,20 @@ MachineBase::MachineBase(Personality personality, const ROMMachine::ROMFetcher &
// attach the only drive there is
set_drive(drive_);
std::string rom_name;
std::string device_name;
uint32_t crc = 0;
switch(personality) {
case Personality::C1540: rom_name = "1540.bin"; break;
case Personality::C1541: rom_name = "1541.bin"; break;
case Personality::C1540:
device_name = "1540";
crc = 0x718d42b1;
break;
case Personality::C1541:
device_name = "1541";
crc = 0xfb760019;
break;
}
auto roms = rom_fetcher("Commodore1540", {rom_name});
auto roms = rom_fetcher("Commodore1540", { ROMMachine::ROM("the " + device_name + " ROM", device_name + ".bin", 16*1024, crc) });
if(!roms[0]) {
throw ROMMachine::Error::MissingROMs;
}

View File

@ -64,16 +64,19 @@ class ConcreteMachine:
speaker_.set_input_rate(2000000 / SoundGenerator::clock_rate_divider);
speaker_.set_high_frequency_cutoff(7000);
std::vector<ROMMachine::ROM> rom_names = { {"basic.rom"}, {"os.rom"} };
std::vector<ROMMachine::ROM> required_roms = {
{"the Acorn BASIC II ROM", "basic.rom", 16*1024, 0x79434781},
{"the Electron MOS ROM", "os.rom", 16*1024, 0xbf63fb1f}
};
if(target.has_adfs) {
rom_names.emplace_back("ADFS-E00_1.rom");
rom_names.emplace_back("ADFS-E00_2.rom");
required_roms.emplace_back("the E00 ADFS ROM, first slot", "ADFS-E00_1.rom", 16*1024, 0x51523993);
required_roms.emplace_back("the E00 ADFS ROM, second slot", "ADFS-E00_2.rom", 16*1024, 0x8d17de0e);
}
const size_t dfs_rom_position = rom_names.size();
const size_t dfs_rom_position = required_roms.size();
if(target.has_dfs) {
rom_names.emplace_back("DFS-1770-2.20.rom");
required_roms.emplace_back("the 1770 DFS ROM", "DFS-1770-2.20.rom", 16*1024, 0xf3dc9bc5);
}
const auto roms = rom_fetcher("Electron", rom_names);
const auto roms = rom_fetcher("Electron", required_roms);
for(const auto &rom: roms) {
if(!rom) {

View File

@ -173,16 +173,19 @@ class ConcreteMachine:
mixer_.set_relative_volumes({0.5f, 0.1f, 0.4f});
// Install the proper TV standard and select an ideal BIOS name.
std::vector<ROMMachine::ROM> rom_names = { {"msx.rom"} };
std::vector<ROMMachine::ROM> required_roms = {
{"any MSX BIOS", "msx.rom", 32*1024, 0x94ee12f3}
};
bool is_ntsc = true;
uint8_t character_generator = 1; /* 0 = Japan, 1 = USA, etc, 2 = USSR */
uint8_t date_format = 1; /* 0 = Y/M/D, 1 = M/D/Y, 2 = D/M/Y */
uint8_t keyboard = 1; /* 0 = Japan, 1 = USA, 2 = France, 3 = UK, 4 = Germany, 5 = USSR, 6 = Spain */
// TODO: CRCs below are incomplete, at best.
switch(target.region) {
case Target::Region::Japan:
rom_names.emplace_back("msx-japanese.rom");
required_roms.emplace_back("a Japanese MSX BIOS", "msx-japanese.rom", 32*1024, 0xee229390);
vdp_.set_tv_standard(TI::TMS::TVStandard::NTSC);
is_ntsc = true;
@ -190,7 +193,7 @@ class ConcreteMachine:
date_format = 0;
break;
case Target::Region::USA:
rom_names.emplace_back("msx-american.rom");
required_roms.emplace_back("an American MSX BIOS", "msx-american.rom", 32*1024, 0);
vdp_.set_tv_standard(TI::TMS::TVStandard::NTSC);
is_ntsc = true;
@ -198,7 +201,7 @@ class ConcreteMachine:
date_format = 1;
break;
case Target::Region::Europe:
rom_names.emplace_back("msx-european.rom");
required_roms.emplace_back("a European MSX BIOS", "msx-european.rom", 32*1024, 0);
vdp_.set_tv_standard(TI::TMS::TVStandard::PAL);
is_ntsc = false;
@ -211,10 +214,10 @@ class ConcreteMachine:
// but failing that fall back on patching the main one.
size_t disk_index = 0;
if(target.has_disk_drive) {
disk_index = rom_names.size();
rom_names.emplace_back("disk.rom");
disk_index = required_roms.size();
required_roms.emplace_back("the MSX-DOS ROM", "disk.rom", 16*1024, 0x721f61df);
}
const auto roms = rom_fetcher("MSX", rom_names);
const auto roms = rom_fetcher("MSX", required_roms);
if((!roms[0] && !roms[1]) || (target.has_disk_drive && !roms[2])) {
throw ROMMachine::Error::MissingROMs;

View File

@ -132,7 +132,9 @@ class ConcreteMachine:
// Load the BIOS if relevant.
if(has_bios()) {
const auto roms = rom_fetcher("MasterSystem", { ROMMachine::ROM("bios.sms") });
// 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} });
if(!roms[0]) {
// No BIOS found; attempt to boot as though it has already disabled itself.
memory_control_ |= 0x08;