1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-12 00:30:31 +00:00

Load ROMs.

This commit is contained in:
Thomas Harte 2024-12-09 17:31:00 -05:00
parent 06a005321e
commit 949cfcfa69
3 changed files with 26 additions and 4 deletions

View File

@ -19,11 +19,17 @@ namespace {
class ConcreteMachine: class ConcreteMachine:
public MachineTypes::TimedMachine, public MachineTypes::TimedMachine,
public MachineTypes::ScanProducer, public MachineTypes::ScanProducer,
public MachineTypes::MediaTarget,
public Machine { public Machine {
public: public:
ConcreteMachine(const Analyser::Static::Commodore::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) { ConcreteMachine(const Analyser::Static::Commodore::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) {
(void)target; const ROM::Request request = ROM::Request(ROM::Name::Plus4BASIC) && ROM::Request(ROM::Name::Plus4KernelPALv5);
(void)rom_fetcher; auto roms = rom_fetcher(request);
if(!request.validate(roms)) {
throw ROMMachine::Error::MissingROMs;
}
insert_media(target.media);
} }
private: private:
@ -36,6 +42,10 @@ private:
void run_for(const Cycles) final { void run_for(const Cycles) final {
} }
bool insert_media(const Analyser::Static::Media &) final {
return true;
}
}; };
} }

View File

@ -256,7 +256,7 @@ struct Request {
bool empty(); bool empty();
/// @returns what remains of this ROM request given that everything in @c map has been found. /// @returns what remains of this ROM request given that everything in @c map has been found.
Request subtract(const ROM::Map &map) const; Request subtract(const Map &map) const;
enum class ListType { enum class ListType {
Any, All, Single Any, All, Single
@ -303,7 +303,7 @@ private:
const std::function<void(void)> &exit_list, const std::function<void(void)> &exit_list,
const std::function<void(ROM::Request::ListType type, const ROM::Description &, bool is_optional, size_t remaining)> &add_item const std::function<void(ROM::Request::ListType type, const ROM::Description &, bool is_optional, size_t remaining)> &add_item
) const; ) const;
bool subtract(const ROM::Map &map); bool subtract(const Map &map);
void sort() { void sort() {
// Don't do a full sort, but move anything optional to the back. // Don't do a full sort, but move anything optional to the back.
// This makes them print more nicely; it's a human-facing tweak only. // This makes them print more nicely; it's a human-facing tweak only.

View File

@ -0,0 +1,12 @@
ROM files would ordinarily go here; the copyright status of these is uncertain so they have not been included in this repository.
Expected files:
At least one of:
kernal.318004-03.bin — the PAL kernel, v3;
kernal.318004-04.bin — the PAL kernel, v4; and
kernal.318004-05.bin — the PAL kernel, v5.
And:
basic.318006-01.bin — the BASIC 3.5 ROM.