1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Simplifies CPC ROM input mechanism.

This commit is contained in:
Thomas Harte 2017-11-25 08:18:01 -05:00
parent a46a37fba9
commit ee9f89ccb5

View File

@ -929,12 +929,6 @@ class ConcreteMachine:
return !media.tapes.empty() || (!media.disks.empty() && has_fdc_);
}
// See header; provides the system ROMs.
void set_rom(ROMType type, const std::vector<uint8_t> &data) {
roms_[static_cast<int>(type)] = std::move(data);
roms_[static_cast<int>(type)].resize(16384);
}
// Obtains the system ROMs.
bool set_rom_fetcher(const std::function<std::vector<std::unique_ptr<std::vector<uint8_t>>>(const std::string &machine, const std::vector<std::string> &names)> &roms_with_names) override {
auto roms = roms_with_names(
@ -949,7 +943,8 @@ class ConcreteMachine:
for(std::size_t index = 0; index < roms.size(); ++index) {
auto &data = roms[index];
if(!data) return false;
set_rom(static_cast<ROMType>(index), *data);
roms_[static_cast<int>(index)] = std::move(*data);
roms_[static_cast<int>(index)].resize(16384);
}
return true;