19 , syncDirAsDSKSetting(
20 reactor.getCommandController(),
"DirAsDSKmode",
21 "type of synchronisation between host directory and dir-as-dsk disk image",
26 reactor.getCommandController(),
"bootsector",
27 "boot sector type for dir-as-dsk",
28 DirAsDSK::BootSectorType::DOS2, EnumSetting<DirAsDSK::BootSectorType>::Map{
29 {
"DOS1", DirAsDSK::BootSectorType::DOS1},
30 {
"DOS2", DirAsDSK::BootSectorType::DOS2}})
34std::unique_ptr<Disk> DiskFactory::createDisk(
35 const std::string& diskImage,
DiskChanger& diskChanger)
37 if (diskImage ==
"ramdsk") {
38 return std::make_unique<RamDSKDiskImage>();
44 return std::make_unique<DirAsDSK>(
48 syncDirAsDSKSetting.getEnum(),
49 bootSectorSetting.getEnum());
54 auto file = std::make_shared<File>(filename, File::OpenMode::PRE_CACHE);
57 return std::make_unique<XSADiskImage>(filename, *file);
64 return std::make_unique<DMKDiskImage>(filename, file);
69 return std::make_unique<DSKDiskImage>(filename, std::move(file));
79 auto pos = diskImage.find_last_of(
':');
80 if (pos == std::string::npos) {
84 std::shared_ptr<SectorAccessibleDisk> wholeDisk;
86 Filename filename2(diskImage.substr(0, pos));
87 wholeDisk = std::make_shared<DSKDiskImage>(filename2);
95 auto n = StringOp::stringToBase<10, unsigned>(std::string_view(diskImage).substr(pos + 1));
103 return std::make_unique<DiskPartition>(disk, num, std::move(wholeDisk));