mirror of
https://github.com/TomHarte/CLK.git
synced 2025-12-20 06:16:41 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ac4bbea9d | ||
|
|
7d8bdb33bb |
@@ -297,7 +297,10 @@ std::unique_ptr<Analyser::Static::Target> get_target<TargetPlatform::Plus4>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Attach a 1541 if there are any disks here.
|
// Attach a 1541 if there are any disks here.
|
||||||
target->has_c1541 = !target->media.disks.empty();
|
// TODO: prefer a 1551, once implemented.
|
||||||
|
if(!target->media.disks.empty()) {
|
||||||
|
target->disk_drive = Plus4Target::DiskDrive::C1541;
|
||||||
|
}
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,14 +18,21 @@ namespace Analyser::Static::Commodore {
|
|||||||
struct Plus4Target: public Analyser::Static::Target, public Reflection::StructImpl<Plus4Target> {
|
struct Plus4Target: public Analyser::Static::Target, public Reflection::StructImpl<Plus4Target> {
|
||||||
// TODO: region, etc.
|
// TODO: region, etc.
|
||||||
std::string loading_command;
|
std::string loading_command;
|
||||||
bool has_c1541 = false;
|
|
||||||
|
ReflectableEnum(DiskDrive,
|
||||||
|
None,
|
||||||
|
C1541,
|
||||||
|
C1551,
|
||||||
|
);
|
||||||
|
DiskDrive disk_drive = DiskDrive::None;
|
||||||
|
|
||||||
Plus4Target() : Analyser::Static::Target(Machine::Plus4) {}
|
Plus4Target() : Analyser::Static::Target(Machine::Plus4) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend Reflection::StructImpl<Plus4Target>;
|
friend Reflection::StructImpl<Plus4Target>;
|
||||||
void declare_fields() {
|
void declare_fields() {
|
||||||
DeclareField(has_c1541);
|
AnnounceEnum(DiskDrive);
|
||||||
|
DeclareField(disk_drive);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -198,8 +198,16 @@ public:
|
|||||||
const auto kernel = ROM::Name::Plus4KernelPALv5;
|
const auto kernel = ROM::Name::Plus4KernelPALv5;
|
||||||
const auto basic = ROM::Name::Plus4BASIC;
|
const auto basic = ROM::Name::Plus4BASIC;
|
||||||
ROM::Request request = ROM::Request(basic) && ROM::Request(kernel);
|
ROM::Request request = ROM::Request(basic) && ROM::Request(kernel);
|
||||||
if(target.has_c1541) {
|
using DiskDrive = Analyser::Static::Commodore::Plus4Target::DiskDrive;
|
||||||
request = request && C1540::Machine::rom_request(C1540::Personality::C1541);
|
switch(target.disk_drive) {
|
||||||
|
case DiskDrive::C1541:
|
||||||
|
request = request && C1540::Machine::rom_request(C1540::Personality::C1541);
|
||||||
|
break;
|
||||||
|
case DiskDrive::None:
|
||||||
|
break;
|
||||||
|
case DiskDrive::C1551:
|
||||||
|
Logger::error().append("TODO: load 1551 ROM");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto roms = rom_fetcher(request);
|
auto roms = rom_fetcher(request);
|
||||||
@@ -216,11 +224,18 @@ public:
|
|||||||
|
|
||||||
video_map_.page<PagerSide::ReadWrite, 0, 65536>(ram_.data());
|
video_map_.page<PagerSide::ReadWrite, 0, 65536>(ram_.data());
|
||||||
|
|
||||||
if(target.has_c1541) {
|
switch(target.disk_drive) {
|
||||||
c1541_ = std::make_unique<C1540::Machine>(C1540::Personality::C1541, roms);
|
case DiskDrive::None:
|
||||||
c1541_->set_serial_bus(serial_bus_);
|
break;
|
||||||
Serial::attach(serial_port_, serial_bus_);
|
case DiskDrive::C1541:
|
||||||
c1541_->run_for(Cycles(2000000));
|
c1541_ = std::make_unique<C1540::Machine>(C1540::Personality::C1541, roms);
|
||||||
|
c1541_->set_serial_bus(serial_bus_);
|
||||||
|
Serial::attach(serial_port_, serial_bus_);
|
||||||
|
c1541_->run_for(Cycles(2000000));
|
||||||
|
break;
|
||||||
|
case DiskDrive::C1551:
|
||||||
|
Logger::error().append("TODO: install 1551");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tape_handler_.set_clock_rate(clock);
|
tape_handler_.set_clock_rate(clock);
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ typedef NS_ENUM(NSInteger, CSMachineAppleIIModel) {
|
|||||||
CSMachineAppleIIModelAppleII,
|
CSMachineAppleIIModelAppleII,
|
||||||
CSMachineAppleIIModelAppleIIPlus,
|
CSMachineAppleIIModelAppleIIPlus,
|
||||||
CSMachineAppleIIModelAppleIIe,
|
CSMachineAppleIIModelAppleIIe,
|
||||||
CSMachineAppleIIModelAppleEnhancedIIe
|
CSMachineAppleIIModelAppleEnhancedIIe,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineAppleIIDiskController) {
|
typedef NS_ENUM(NSInteger, CSMachineAppleIIDiskController) {
|
||||||
CSMachineAppleIIDiskControllerNone,
|
CSMachineAppleIIDiskControllerNone,
|
||||||
CSMachineAppleIIDiskControllerSixteenSector,
|
CSMachineAppleIIDiskControllerSixteenSector,
|
||||||
CSMachineAppleIIDiskControllerThirteenSector
|
CSMachineAppleIIDiskControllerThirteenSector,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineAppleIIgsModel) {
|
typedef NS_ENUM(NSInteger, CSMachineAppleIIgsModel) {
|
||||||
@@ -63,7 +63,7 @@ typedef NS_ENUM(NSInteger, CSMachineCommodoreTEDModel) {
|
|||||||
typedef NS_ENUM(NSInteger, CSMachineCPCModel) {
|
typedef NS_ENUM(NSInteger, CSMachineCPCModel) {
|
||||||
CSMachineCPCModel464,
|
CSMachineCPCModel464,
|
||||||
CSMachineCPCModel664,
|
CSMachineCPCModel664,
|
||||||
CSMachineCPCModel6128
|
CSMachineCPCModel6128,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineEnterpriseModel) {
|
typedef NS_ENUM(NSInteger, CSMachineEnterpriseModel) {
|
||||||
@@ -74,7 +74,7 @@ typedef NS_ENUM(NSInteger, CSMachineEnterpriseModel) {
|
|||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineEnterpriseSpeed) {
|
typedef NS_ENUM(NSInteger, CSMachineEnterpriseSpeed) {
|
||||||
CSMachineEnterpriseSpeed4MHz,
|
CSMachineEnterpriseSpeed4MHz,
|
||||||
CSMachineEnterpriseSpeed6MHz
|
CSMachineEnterpriseSpeed6MHz,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineEnterpriseEXOS) {
|
typedef NS_ENUM(NSInteger, CSMachineEnterpriseEXOS) {
|
||||||
@@ -105,7 +105,7 @@ typedef NS_ENUM(NSInteger, CSMachineMacintoshModel) {
|
|||||||
typedef NS_ENUM(NSInteger, CSMachineOricModel) {
|
typedef NS_ENUM(NSInteger, CSMachineOricModel) {
|
||||||
CSMachineOricModelOric1,
|
CSMachineOricModelOric1,
|
||||||
CSMachineOricModelOricAtmos,
|
CSMachineOricModelOricAtmos,
|
||||||
CSMachineOricModelPravetz
|
CSMachineOricModelPravetz,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineOricDiskInterface) {
|
typedef NS_ENUM(NSInteger, CSMachineOricDiskInterface) {
|
||||||
@@ -113,7 +113,13 @@ typedef NS_ENUM(NSInteger, CSMachineOricDiskInterface) {
|
|||||||
CSMachineOricDiskInterfaceMicrodisc,
|
CSMachineOricDiskInterfaceMicrodisc,
|
||||||
CSMachineOricDiskInterfacePravetz,
|
CSMachineOricDiskInterfacePravetz,
|
||||||
CSMachineOricDiskInterfaceJasmin,
|
CSMachineOricDiskInterfaceJasmin,
|
||||||
CSMachineOricDiskInterfaceBD500
|
CSMachineOricDiskInterfaceBD500,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, CSMachinePlus4DiskDrive) {
|
||||||
|
CSMachinePlus4DiskDriveNone,
|
||||||
|
CSMachinePlus4DiskDriveC1541,
|
||||||
|
CSMachinePlus4DiskDriveC1551,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, CSMachineSpectrumModel) {
|
typedef NS_ENUM(NSInteger, CSMachineSpectrumModel) {
|
||||||
@@ -184,7 +190,7 @@ typedef int Kilobytes;
|
|||||||
secondProcessor:(CSMachineBBCMicroSecondProcessor)secondProcessor;
|
secondProcessor:(CSMachineBBCMicroSecondProcessor)secondProcessor;
|
||||||
|
|
||||||
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model
|
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model
|
||||||
hasC1541:(BOOL)hasC1541;
|
diskDrive:(CSMachinePlus4DiskDrive)diskDrive;
|
||||||
|
|
||||||
- (instancetype)initWithElectronDFS:(BOOL)dfs
|
- (instancetype)initWithElectronDFS:(BOOL)dfs
|
||||||
adfs:(BOOL)adfs
|
adfs:(BOOL)adfs
|
||||||
|
|||||||
@@ -352,13 +352,18 @@ PermissionDelegate permission_delegate;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model
|
- (instancetype)initWithCommodoreTEDModel:(CSMachineCommodoreTEDModel)model
|
||||||
hasC1541:(BOOL)hasC1541
|
diskDrive:(CSMachinePlus4DiskDrive)diskDrive
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if(self) {
|
if(self) {
|
||||||
using Target = Analyser::Static::Commodore::Plus4Target;
|
using Target = Analyser::Static::Commodore::Plus4Target;
|
||||||
auto target = std::make_unique<Target>();
|
auto target = std::make_unique<Target>();
|
||||||
target->has_c1541 = hasC1541;
|
switch(diskDrive) {
|
||||||
|
case CSMachinePlus4DiskDriveNone: target->disk_drive = Target::DiskDrive::None; break;
|
||||||
|
case CSMachinePlus4DiskDriveC1541: target->disk_drive = Target::DiskDrive::C1541; break;
|
||||||
|
case CSMachinePlus4DiskDriveC1551: target->disk_drive = Target::DiskDrive::C1551; break;
|
||||||
|
}
|
||||||
|
|
||||||
_targets.push_back(std::move(target));
|
_targets.push_back(std::move(target));
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ class MachinePicker: NSObject, NSTableViewDataSource, NSTableViewDelegate, NSPat
|
|||||||
|
|
||||||
case "c16plus4":
|
case "c16plus4":
|
||||||
let hasC1541 = plus4HasC1541Button.state == .on
|
let hasC1541 = plus4HasC1541Button.state == .on
|
||||||
return CSStaticAnalyser(commodoreTEDModel: .C16, hasC1541: hasC1541)
|
return CSStaticAnalyser(commodoreTEDModel: .C16, diskDrive: hasC1541 ? .C1541 : .none)
|
||||||
|
|
||||||
case "cpc":
|
case "cpc":
|
||||||
switch cpcModelTypeButton.selectedTag() {
|
switch cpcModelTypeButton.selectedTag() {
|
||||||
|
|||||||
@@ -1229,7 +1229,7 @@ void MainWindow::start_spectrum() {
|
|||||||
void MainWindow::start_plus4() {
|
void MainWindow::start_plus4() {
|
||||||
using Target = Analyser::Static::Commodore::Plus4Target;
|
using Target = Analyser::Static::Commodore::Plus4Target;
|
||||||
auto target = std::make_unique<Target>();
|
auto target = std::make_unique<Target>();
|
||||||
target->has_c1541 = ui->plus4C1541CheckBox->isChecked();
|
target->disk_drive = ui->plus4C1541CheckBox->isChecked() ? Target::DiskDrive::C1541 : Target::DiskDrive::None;
|
||||||
launchTarget(std::move(target));
|
launchTarget(std::move(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user