mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-05 21:32:55 +00:00
Simplifies CPC ROM input mechanism.
This commit is contained in:
parent
a46a37fba9
commit
ee9f89ccb5
@ -929,12 +929,6 @@ class ConcreteMachine:
|
|||||||
return !media.tapes.empty() || (!media.disks.empty() && has_fdc_);
|
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.
|
// 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 {
|
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(
|
auto roms = roms_with_names(
|
||||||
@ -949,7 +943,8 @@ class ConcreteMachine:
|
|||||||
for(std::size_t index = 0; index < roms.size(); ++index) {
|
for(std::size_t index = 0; index < roms.size(); ++index) {
|
||||||
auto &data = roms[index];
|
auto &data = roms[index];
|
||||||
if(!data) return false;
|
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;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user