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

Enhances the amount of ROM information posted by the Apple machines.

This commit is contained in:
Thomas Harte 2019-07-20 16:08:40 -04:00
parent 20670bab2f
commit 3c68a5ca65
3 changed files with 20 additions and 19 deletions

View File

@ -347,29 +347,29 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
// Pick the required ROMs.
using Target = Analyser::Static::AppleII::Target;
std::vector<ROMMachine::ROM> rom_names;
std::vector<ROMMachine::ROM> rom_descriptions;
size_t rom_size = 12*1024;
switch(target.model) {
default:
rom_names.emplace_back("apple2-character.rom");
rom_names.emplace_back("apple2o.rom");
rom_descriptions.emplace_back("the basic Apple II character ROM", "apple2-character.rom", 2*1024, 0x64f415c6);
rom_descriptions.emplace_back("the original Apple II ROM", "apple2o.rom", 12*1024, 0xba210588);
break;
case Target::Model::IIplus:
rom_names.emplace_back("apple2-character.rom");
rom_names.emplace_back("apple2.rom");
rom_descriptions.emplace_back("the basic Apple II character ROM", "apple2-character.rom", 2*1024, 0x64f415c6);
rom_descriptions.emplace_back("the Apple II+ ROM", "apple2.rom", 12*1024, 0xf66f9c26);
break;
case Target::Model::IIe:
rom_size += 3840;
rom_names.emplace_back("apple2eu-character.rom");
rom_names.emplace_back("apple2eu.rom");
rom_descriptions.emplace_back("the Apple IIe character ROM", "apple2eu-character.rom", 4*1024, 0x816a86f1);
rom_descriptions.emplace_back("the Apple IIe ROM", "apple2eu.rom", 32*1024, 0xe12be18d);
break;
case Target::Model::EnhancedIIe:
rom_size += 3840;
rom_names.emplace_back("apple2e-character.rom");
rom_names.emplace_back("apple2e.rom");
rom_descriptions.emplace_back("the Enhanced Apple IIe character ROM", "apple2e-character.rom", 4*1024, 0x2651014d);
rom_descriptions.emplace_back("the Enhanced Apple IIe ROM", "apple2e.rom", 32*1024, 0x65989942);
break;
}
const auto roms = rom_fetcher("AppleII", rom_names);
const auto roms = rom_fetcher("AppleII", rom_descriptions);
if(!roms[0] || !roms[1]) {
throw ROMMachine::Error::MissingROMs;

View File

@ -70,33 +70,34 @@ template <Analyser::Static::Macintosh::Target::Model model> class ConcreteMachin
// Select a ROM name and determine the proper ROM and RAM sizes
// based on the machine model.
using Model = Analyser::Static::Macintosh::Target::Model;
std::string rom_name;
uint32_t ram_size, rom_size;
std::vector<ROMMachine::ROM> rom_descriptions;
switch(model) {
default:
case Model::Mac128k:
ram_size = 128*1024;
rom_size = 64*1024;
rom_name = "mac128k.rom";
rom_descriptions.emplace_back("the Macintosh 128k ROM", "mac128k.rom", 64*1024, 0x6d0c8a28);
break;
case Model::Mac512k:
ram_size = 512*1024;
rom_size = 64*1024;
rom_name = "mac512k.rom";
rom_descriptions.emplace_back("the Macintosh 512k ROM", "mac512k.rom", 64*1024, 0xcf759e0d);
break;
case Model::Mac512ke:
case Model::MacPlus:
case Model::MacPlus: {
ram_size = 512*1024;
rom_size = 128*1024;
rom_name = "macplus.rom";
break;
const std::initializer_list<uint32_t> crc32s = { 0x4fa5b399, 0x7cacd18f, 0xb2102e8e };
rom_descriptions.emplace_back("the Macintosh Plus ROM", "macplus.rom", 128*1024, crc32s);
} break;
}
ram_mask_ = (ram_size >> 1) - 1;
rom_mask_ = (rom_size >> 1) - 1;
video_.set_ram_mask(ram_mask_);
// Grab a copy of the ROM and convert it into big-endian data.
const auto roms = rom_fetcher("Macintosh", { rom_name });
const auto roms = rom_fetcher("Macintosh", rom_descriptions);
if(!roms[0]) {
throw ROMMachine::Error::MissingROMs;
}

View File

@ -38,8 +38,8 @@ struct ROM {
ROM(std::string descriptive_name, std::string file_name, size_t size, uint32_t crc32) :
descriptive_name(descriptive_name), file_name(file_name), size(size), crc32s({crc32}) {}
ROM(std::string descriptive_name, std::string file_name, size_t size, std::vector<uint32_t> &crc32s) :
descriptive_name(descriptive_name), file_name(file_name), size(size), crc32s(std::move(crc32s)) {}
ROM(std::string descriptive_name, std::string file_name, size_t size, std::initializer_list<uint32_t> crc32s) :
descriptive_name(descriptive_name), file_name(file_name), size(size), crc32s(crc32s) {}
};
/*!