1 #ifndef HARDWARECONFIG_HH
2 #define HARDWARECONFIG_HH
11 #include <string_view>
39 std::string_view slotname);
53 [[nodiscard]]
const std::string&
getName()
const {
return name; }
54 [[nodiscard]]
const std::string&
getConfigName()
const {
return hwName; }
66 [[nodiscard]]
const std::vector<std::unique_ptr<MSXDevice>>&
getDevices()
const {
return devices; };
73 template<
typename Archive>
74 void serialize(Archive& ar,
unsigned version);
77 void setConfig(
XMLElement config_) { config = std::move(config_); }
78 void load(std::string_view type);
80 [[nodiscard]]
const XMLElement& getDevicesElem()
const;
83 void createExternalSlot(
int ps);
84 void createExternalSlot(
int ps,
int ss);
85 void createExpandedSlot(
int ps);
86 [[nodiscard]]
int getAnyFreePrimarySlot();
87 [[nodiscard]]
int getSpecificFreePrimarySlot(
unsigned slot);
88 void addDevice(std::unique_ptr<MSXDevice> device);
89 void setName(std::string_view proposedName);
90 void setSlot(std::string_view slotname);
93 MSXMotherBoard& motherBoard;
100 bool externalSlots[4][4];
101 bool externalPrimSlots[4];
102 bool expandedSlots[4];
103 bool allocatedPrimarySlots[4];
105 std::vector<std::unique_ptr<MSXDevice>> devices;
115 using type = std::tuple<std::string>;
117 template<
typename Archive>
120 ar.serialize(
"hwname", config.hwName);
123 template<
typename Archive>
127 ar.serialize(
"hwname", name);
128 return std::tuple(name);
const XMLElement & getConfig() const
static XMLElement loadConfig(std::string_view type, std::string_view name)
HardwareConfig(const HardwareConfig &)=delete
const std::vector< std::unique_ptr< MSXDevice > > & getDevices() const
const std::string & getConfigName() const
MSXMotherBoard & getMotherBoard() const
const std::string & getName() const
void serialize(Archive &ar, unsigned version)
void setFileContext(FileContext &&ctxt)
HardwareConfig & operator=(const HardwareConfig &)=delete
static std::unique_ptr< HardwareConfig > createExtensionConfig(MSXMotherBoard &motherBoard, std::string extensionName, std::string_view slotname)
static std::unique_ptr< HardwareConfig > createRomConfig(MSXMotherBoard &motherBoard, std::string romfile, std::string slotname, span< const TclObject > options)
const FileContext & getFileContext() const
byte parseSlotMap() const
Parses a slot mapping.
static std::unique_ptr< HardwareConfig > createMachineConfig(MSXMotherBoard &motherBoard, std::string machineName)
void testRemove() const
Checks whether this HardwareConfig can be deleted.
This file implemented 3 utility functions:
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
type load(Archive &ar, unsigned)
void save(Archive &ar, const HardwareConfig &config)
std::tuple< std::string > type
Serialize (local) constructor arguments.