mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-29 04:33:04 +00:00
Add Archimedes-specific target class.
This commit is contained in:
parent
18ffb9294f
commit
0b11fc259b
@ -60,8 +60,8 @@ static std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>>
|
||||
}
|
||||
|
||||
Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
|
||||
auto target8bit = std::make_unique<Target>();
|
||||
auto targetArchimedes = std::make_unique<Analyser::Static::Target>(Machine::Archimedes);
|
||||
auto target8bit = std::make_unique<ElectronTarget>();
|
||||
auto targetArchimedes = std::make_unique<ArchimedesTarget>();
|
||||
|
||||
// Copy appropriate cartridges to the 8-bit target.
|
||||
target8bit->media.cartridges = AcornCartridgesFrom(media.cartridges);
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace Analyser::Static::Acorn {
|
||||
|
||||
struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<Target> {
|
||||
struct ElectronTarget: public ::Analyser::Static::Target, public Reflection::StructImpl<ElectronTarget> {
|
||||
bool has_acorn_adfs = false;
|
||||
bool has_pres_adfs = false;
|
||||
bool has_dfs = false;
|
||||
@ -23,7 +23,7 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
|
||||
bool should_shift_restart = false;
|
||||
std::string loading_command;
|
||||
|
||||
Target() : Analyser::Static::Target(Machine::Electron) {
|
||||
ElectronTarget() : Analyser::Static::Target(Machine::Electron) {
|
||||
if(needs_declare()) {
|
||||
DeclareField(has_pres_adfs);
|
||||
DeclareField(has_acorn_adfs);
|
||||
@ -34,4 +34,11 @@ struct Target: public ::Analyser::Static::Target, public Reflection::StructImpl<
|
||||
}
|
||||
};
|
||||
|
||||
struct ArchimedesTarget: public ::Analyser::Static::Target, public Reflection::StructImpl<ArchimedesTarget> {
|
||||
bool should_shift_restart = false;
|
||||
std::string main_program;
|
||||
|
||||
ArchimedesTarget() : Analyser::Static::Target(Machine::Archimedes) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -29,13 +29,13 @@
|
||||
#include "../../../Outputs/Log.hpp"
|
||||
#include "../../../Components/I2C/I2C.hpp"
|
||||
|
||||
#include "../../../Analyser/Static/Acorn/Target.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "../../../Analyser/Static/Acorn/SWIIndex.hpp"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
class ConcreteMachine:
|
||||
@ -109,7 +109,7 @@ class ConcreteMachine:
|
||||
|
||||
public:
|
||||
ConcreteMachine(
|
||||
const Analyser::Static::Target &target,
|
||||
const Analyser::Static::Acorn::ArchimedesTarget &target,
|
||||
const ROMMachine::ROMFetcher &rom_fetcher
|
||||
) : executor_(*this, *this, *this) {
|
||||
set_clock_rate(ClockRate);
|
||||
@ -161,8 +161,6 @@ class ConcreteMachine:
|
||||
|
||||
switch(pipeline_.swi_subversion()) {
|
||||
case Pipeline::SWISubversion::None: {
|
||||
[[maybe_unused]] Analyser::Static::Acorn::SWIDescription description(comment);
|
||||
|
||||
// TODO: 400C1 to intercept create window 400C1 and positioning; then
|
||||
// plot icon 400e2 to listen for icons in window. That'll give a click area.
|
||||
// Probably also 400c2 which seems to be used to add icons to the icon bar.
|
||||
@ -546,5 +544,6 @@ class ConcreteMachine:
|
||||
using namespace Archimedes;
|
||||
|
||||
std::unique_ptr<Machine> Machine::Archimedes(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
|
||||
return std::make_unique<ConcreteMachine>(*target, rom_fetcher);
|
||||
const auto archimedes_target = dynamic_cast<const Analyser::Static::Acorn::ArchimedesTarget *>(target);
|
||||
return std::make_unique<ConcreteMachine>(*archimedes_target, rom_fetcher);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ template <bool has_scsi_bus> class ConcreteMachine:
|
||||
public SCSI::Bus::Observer,
|
||||
public ClockingHint::Observer {
|
||||
public:
|
||||
ConcreteMachine(const Analyser::Static::Acorn::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
|
||||
ConcreteMachine(const Analyser::Static::Acorn::ElectronTarget &target, const ROMMachine::ROMFetcher &rom_fetcher) :
|
||||
m6502_(*this),
|
||||
scsi_bus_(4'000'000),
|
||||
hard_drive_(scsi_bus_, 0),
|
||||
@ -787,7 +787,7 @@ template <bool has_scsi_bus> class ConcreteMachine:
|
||||
using namespace Electron;
|
||||
|
||||
std::unique_ptr<Machine> Machine::Electron(const Analyser::Static::Target *target, const ROMMachine::ROMFetcher &rom_fetcher) {
|
||||
using Target = Analyser::Static::Acorn::Target;
|
||||
using Target = Analyser::Static::Acorn::ElectronTarget;
|
||||
const Target *const acorn_target = dynamic_cast<const Target *>(target);
|
||||
|
||||
if(acorn_target->media.mass_storage_devices.empty()) {
|
||||
|
@ -252,7 +252,8 @@ std::map<std::string, std::unique_ptr<Analyser::Static::Target>> Machine::Target
|
||||
Add(AppleIIgs);
|
||||
options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Archimedes), new Analyser::Static::Target(Analyser::Machine::Archimedes)));
|
||||
Add(AtariST);
|
||||
AddMapped(Electron, Acorn);
|
||||
options.emplace(std::make_pair(LongNameForTargetMachine(Analyser::Machine::Electron), new Analyser::Static::Acorn::ElectronTarget));
|
||||
options.emplace(LongNameForTargetMachine(Analyser::Machine::Archimedes), new Analyser::Static::Acorn::ArchimedesTarget);
|
||||
Add(Enterprise);
|
||||
Add(Macintosh);
|
||||
Add(MSX);
|
||||
|
@ -136,11 +136,10 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (instancetype)initWithArchimedesModel:(CSMachineArchimedesModel)model {
|
||||
self = [super init];
|
||||
if(self) {
|
||||
auto target = std::make_unique<Analyser::Static::Target>(Analyser::Machine::Archimedes);
|
||||
auto target = std::make_unique<Analyser::Static::Acorn::ArchimedesTarget>();
|
||||
_targets.push_back(std::move(target));
|
||||
}
|
||||
return self;
|
||||
@ -164,8 +163,7 @@
|
||||
- (instancetype)initWithElectronDFS:(BOOL)dfs adfs:(BOOL)adfs ap6:(BOOL)ap6 sidewaysRAM:(BOOL)sidewaysRAM {
|
||||
self = [super init];
|
||||
if(self) {
|
||||
using Target = Analyser::Static::Acorn::Target;
|
||||
auto target = std::make_unique<Target>();
|
||||
auto target = std::make_unique<Analyser::Static::Acorn::ElectronTarget>();
|
||||
target->has_dfs = dfs;
|
||||
target->has_pres_adfs = adfs;
|
||||
target->has_ap6_rom = ap6;
|
||||
|
Loading…
x
Reference in New Issue
Block a user