1#ifndef HARDWARECONFIG_HH
2#define HARDWARECONFIG_HH
40 std::string_view slotName);
43 std::string_view slotName, std::span<const TclObject> options);
55 [[nodiscard]]
const std::string&
getName()
const {
return name; }
56 [[nodiscard]]
const std::string&
getConfigName()
const {
return hwName; }
69 [[nodiscard]]
const auto&
getDevices()
const {
return devices; };
76 template<
typename Archive>
77 void serialize(Archive& ar,
unsigned version);
81 void load(std::string_view type);
84 const XMLElement* primary,
const XMLElement* secondary);
85 void createExternalSlot(
int ps);
86 void createExternalSlot(
int ps,
int ss);
87 void createExpandedSlot(
int ps);
88 [[nodiscard]]
int getAnyFreePrimarySlot();
89 [[nodiscard]]
int getSpecificFreePrimarySlot(
unsigned slot);
90 void addDevice(std::unique_ptr<MSXDevice> device);
91 void setName(std::string_view proposedName);
92 void setSlot(std::string_view slotName);
95 MSXMotherBoard& motherBoard;
102 std::array<std::array<bool, 4>, 4> externalSlots;
103 std::array<bool, 4> externalPrimSlots;
104 std::array<bool, 4> expandedSlots;
105 std::array<bool, 4> allocatedPrimarySlots;
107 std::vector<std::unique_ptr<MSXDevice>> devices;
117 using type = std::tuple<std::string>;
119 template<
typename Archive>
122 ar.serialize(
"hwname", config.hwName);
125 template<
typename Archive>
129 ar.serialize(
"hwname", name);
HardwareConfig(const HardwareConfig &)=delete
const std::string & getConfigName() const
HardwareConfig & operator=(const HardwareConfig &)=delete
static std::unique_ptr< HardwareConfig > createRomConfig(MSXMotherBoard &motherBoard, std::string_view romFile, std::string_view slotName, std::span< const TclObject > options)
static std::unique_ptr< HardwareConfig > createMachineConfig(MSXMotherBoard &motherBoard, std::string machineName)
void serialize(Archive &ar, unsigned version)
void setFileContext(FileContext &&ctxt)
const auto & getDevices() const
const std::string & getName() const
const FileContext & getFileContext() const
const XMLElement & getConfig() const
byte parseSlotMap() const
Parses a slot mapping.
MSXMotherBoard & getMotherBoard() const
static void loadConfig(XMLDocument &doc, std::string_view type, std::string_view name)
XMLDocument & getXMLDocument()
static std::unique_ptr< HardwareConfig > createExtensionConfig(MSXMotherBoard &motherBoard, std::string extensionName, std::string_view slotName)
void testRemove() const
Checks whether this HardwareConfig can be deleted.
const XMLElement & getDevicesElem() const
void setRoot(XMLElement *root_)
const XMLElement * getRoot() const
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.