mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Enhances the amount of ROM information posted by the Apple machines.
This commit is contained in:
parent
20670bab2f
commit
3c68a5ca65
@ -347,29 +347,29 @@ template <Analyser::Static::AppleII::Target::Model model> class ConcreteMachine:
|
|||||||
|
|
||||||
// Pick the required ROMs.
|
// Pick the required ROMs.
|
||||||
using Target = Analyser::Static::AppleII::Target;
|
using Target = Analyser::Static::AppleII::Target;
|
||||||
std::vector<ROMMachine::ROM> rom_names;
|
std::vector<ROMMachine::ROM> rom_descriptions;
|
||||||
size_t rom_size = 12*1024;
|
size_t rom_size = 12*1024;
|
||||||
switch(target.model) {
|
switch(target.model) {
|
||||||
default:
|
default:
|
||||||
rom_names.emplace_back("apple2-character.rom");
|
rom_descriptions.emplace_back("the basic Apple II character ROM", "apple2-character.rom", 2*1024, 0x64f415c6);
|
||||||
rom_names.emplace_back("apple2o.rom");
|
rom_descriptions.emplace_back("the original Apple II ROM", "apple2o.rom", 12*1024, 0xba210588);
|
||||||
break;
|
break;
|
||||||
case Target::Model::IIplus:
|
case Target::Model::IIplus:
|
||||||
rom_names.emplace_back("apple2-character.rom");
|
rom_descriptions.emplace_back("the basic Apple II character ROM", "apple2-character.rom", 2*1024, 0x64f415c6);
|
||||||
rom_names.emplace_back("apple2.rom");
|
rom_descriptions.emplace_back("the Apple II+ ROM", "apple2.rom", 12*1024, 0xf66f9c26);
|
||||||
break;
|
break;
|
||||||
case Target::Model::IIe:
|
case Target::Model::IIe:
|
||||||
rom_size += 3840;
|
rom_size += 3840;
|
||||||
rom_names.emplace_back("apple2eu-character.rom");
|
rom_descriptions.emplace_back("the Apple IIe character ROM", "apple2eu-character.rom", 4*1024, 0x816a86f1);
|
||||||
rom_names.emplace_back("apple2eu.rom");
|
rom_descriptions.emplace_back("the Apple IIe ROM", "apple2eu.rom", 32*1024, 0xe12be18d);
|
||||||
break;
|
break;
|
||||||
case Target::Model::EnhancedIIe:
|
case Target::Model::EnhancedIIe:
|
||||||
rom_size += 3840;
|
rom_size += 3840;
|
||||||
rom_names.emplace_back("apple2e-character.rom");
|
rom_descriptions.emplace_back("the Enhanced Apple IIe character ROM", "apple2e-character.rom", 4*1024, 0x2651014d);
|
||||||
rom_names.emplace_back("apple2e.rom");
|
rom_descriptions.emplace_back("the Enhanced Apple IIe ROM", "apple2e.rom", 32*1024, 0x65989942);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const auto roms = rom_fetcher("AppleII", rom_names);
|
const auto roms = rom_fetcher("AppleII", rom_descriptions);
|
||||||
|
|
||||||
if(!roms[0] || !roms[1]) {
|
if(!roms[0] || !roms[1]) {
|
||||||
throw ROMMachine::Error::MissingROMs;
|
throw ROMMachine::Error::MissingROMs;
|
||||||
|
@ -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
|
// Select a ROM name and determine the proper ROM and RAM sizes
|
||||||
// based on the machine model.
|
// based on the machine model.
|
||||||
using Model = Analyser::Static::Macintosh::Target::Model;
|
using Model = Analyser::Static::Macintosh::Target::Model;
|
||||||
std::string rom_name;
|
|
||||||
uint32_t ram_size, rom_size;
|
uint32_t ram_size, rom_size;
|
||||||
|
std::vector<ROMMachine::ROM> rom_descriptions;
|
||||||
switch(model) {
|
switch(model) {
|
||||||
default:
|
default:
|
||||||
case Model::Mac128k:
|
case Model::Mac128k:
|
||||||
ram_size = 128*1024;
|
ram_size = 128*1024;
|
||||||
rom_size = 64*1024;
|
rom_size = 64*1024;
|
||||||
rom_name = "mac128k.rom";
|
rom_descriptions.emplace_back("the Macintosh 128k ROM", "mac128k.rom", 64*1024, 0x6d0c8a28);
|
||||||
break;
|
break;
|
||||||
case Model::Mac512k:
|
case Model::Mac512k:
|
||||||
ram_size = 512*1024;
|
ram_size = 512*1024;
|
||||||
rom_size = 64*1024;
|
rom_size = 64*1024;
|
||||||
rom_name = "mac512k.rom";
|
rom_descriptions.emplace_back("the Macintosh 512k ROM", "mac512k.rom", 64*1024, 0xcf759e0d);
|
||||||
break;
|
break;
|
||||||
case Model::Mac512ke:
|
case Model::Mac512ke:
|
||||||
case Model::MacPlus:
|
case Model::MacPlus: {
|
||||||
ram_size = 512*1024;
|
ram_size = 512*1024;
|
||||||
rom_size = 128*1024;
|
rom_size = 128*1024;
|
||||||
rom_name = "macplus.rom";
|
const std::initializer_list<uint32_t> crc32s = { 0x4fa5b399, 0x7cacd18f, 0xb2102e8e };
|
||||||
break;
|
rom_descriptions.emplace_back("the Macintosh Plus ROM", "macplus.rom", 128*1024, crc32s);
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
ram_mask_ = (ram_size >> 1) - 1;
|
ram_mask_ = (ram_size >> 1) - 1;
|
||||||
rom_mask_ = (rom_size >> 1) - 1;
|
rom_mask_ = (rom_size >> 1) - 1;
|
||||||
video_.set_ram_mask(ram_mask_);
|
video_.set_ram_mask(ram_mask_);
|
||||||
|
|
||||||
// Grab a copy of the ROM and convert it into big-endian data.
|
// 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]) {
|
if(!roms[0]) {
|
||||||
throw ROMMachine::Error::MissingROMs;
|
throw ROMMachine::Error::MissingROMs;
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ struct ROM {
|
|||||||
|
|
||||||
ROM(std::string descriptive_name, std::string file_name, size_t size, uint32_t crc32) :
|
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}) {}
|
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) :
|
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(std::move(crc32s)) {}
|
descriptive_name(descriptive_name), file_name(file_name), size(size), crc32s(crc32s) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user