1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 03:29:40 +00:00

Starts to introduce a new grammar for ROM requests.

They can be optional, and chained together in AND or OR combinations. A central catalogue knows the definitions of all ROMs.
This commit is contained in:
Thomas Harte
2021-06-03 21:55:59 -04:00
parent 3858e79579
commit a30eeaab6a
23 changed files with 795 additions and 338 deletions
+5 -7
View File
@@ -74,15 +74,13 @@ class ConcreteMachine:
video_->set_ram(reinterpret_cast<uint16_t *>(ram_.data()), ram_.size());
Memory::Fuzz(ram_);
std::vector<ROMMachine::ROM> rom_descriptions = {
{"AtariST", "the UK TOS 1.00 ROM", "tos100.img", 192*1024, 0x1a586c64}
// {"AtariST", "the UK TOS 1.04 ROM", "tos104.img", 192*1024, 0xa50d1d43}
};
const auto roms = rom_fetcher(rom_descriptions);
if(!roms[0]) {
constexpr ROM::Name rom_name = ROM::Name::AtariSTTOS100;
ROM::Request request(rom_name);
const auto roms = rom_fetcher(request);
if(!request.validate(roms)) {
throw ROMMachine::Error::MissingROMs;
}
Memory::PackBigEndian16(*roms[0], rom_);
Memory::PackBigEndian16(roms.find(rom_name)->second, rom_);
// Set up basic memory map.
memory_map_[0] = BusDevice::MostlyRAM;