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);