openMSX
|
#include <HardwareConfig.hh>
Public Types | |
enum class | Type { MACHINE , EXTENSION , ROM } |
Public Member Functions | |
HardwareConfig (MSXMotherBoard &motherBoard, std::string hwName) | |
HardwareConfig (const HardwareConfig &)=delete | |
HardwareConfig (HardwareConfig &&)=delete | |
HardwareConfig & | operator= (const HardwareConfig &)=delete |
HardwareConfig & | operator= (HardwareConfig &&)=delete |
~HardwareConfig () | |
MSXMotherBoard & | getMotherBoard () const |
const FileContext & | getFileContext () const |
void | setFileContext (FileContext &&ctxt) |
XMLDocument & | getXMLDocument () |
const XMLElement & | getConfig () const |
const std::string & | getName () const |
const std::string & | getConfigName () const |
std::string_view | getRomFilename () const |
const XMLElement & | getDevicesElem () const |
Type | getType () const |
byte | parseSlotMap () const |
Parses a slot mapping. | |
void | parseSlots () |
void | createDevices () |
const auto & | getDevices () const |
void | testRemove () const |
Checks whether this HardwareConfig can be deleted. | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Member Functions | |
static void | loadConfig (XMLDocument &doc, std::string_view type, std::string_view name) |
static std::unique_ptr< HardwareConfig > | createMachineConfig (MSXMotherBoard &motherBoard, std::string machineName) |
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_view romFile, std::string_view slotName, std::span< const TclObject > options) |
Friends | |
struct | SerializeConstructorArgs< HardwareConfig > |
Definition at line 23 of file HardwareConfig.hh.
|
strong |
Enumerator | |
---|---|
MACHINE | |
EXTENSION | |
ROM |
Definition at line 26 of file HardwareConfig.hh.
openmsx::HardwareConfig::HardwareConfig | ( | MSXMotherBoard & | motherBoard, |
std::string | hwName | ||
) |
Definition at line 155 of file HardwareConfig.cc.
References ranges::fill(), and openmsx::MSXMotherBoard::getUserName().
|
delete |
|
delete |
openmsx::HardwareConfig::~HardwareConfig | ( | ) |
Definition at line 168 of file HardwareConfig.cc.
References openmsx::MSXMotherBoard::freeUserName(), openmsx::MSXMotherBoard::getCPUInterface(), openmsx::MSXMotherBoard::getSlotManager(), openmsx::MSXMotherBoard::removeDevice(), openmsx::CartridgeSlotManager::removeExternalSlot(), testRemove(), openmsx::MSXCPUInterface::unsetExpanded(), and xrange().
void openmsx::HardwareConfig::createDevices | ( | ) |
Definition at line 371 of file HardwareConfig.cc.
References createDevices(), and getDevicesElem().
Referenced by createDevices(), openmsx::MSXMotherBoard::loadMachine(), and serialize().
|
static |
Definition at line 36 of file HardwareConfig.cc.
References EXTENSION.
Referenced by openmsx::MSXMotherBoard::loadExtension().
|
static |
Definition at line 26 of file HardwareConfig.cc.
References MACHINE.
Referenced by openmsx::MSXMotherBoard::loadMachine().
|
static |
Definition at line 48 of file HardwareConfig.cc.
References openmsx::XMLDocument::allocateAttribute(), openmsx::XMLDocument::allocateElement(), openmsx::XMLDocument::allocateString(), openmsx::XMLDocument::generateList(), openmsx::FileOperations::getAbsolutePath(), openmsx::MSXMotherBoard::getCommandController(), openmsx::FileOperations::getFilename(), openmsx::CommandController::getInterpreter(), openmsx::FileOperations::isRegularFile(), openmsx::parseTclArgs(), openmsx::FileContext::resolve(), ROM, openmsx::XMLElement::setData(), tmpStrCat(), openmsx::userFileContext(), and openmsx::valueArg().
|
inline |
Definition at line 56 of file HardwareConfig.hh.
References openmsx::XMLDocument::getRoot().
Referenced by openmsx::MachineExtensionInfo::execute(), getDevicesElem(), openmsx::MSXMotherBoard::getJoystickPort(), getRomFilename(), openmsx::MSXMotherBoard::hasToshibaEngine(), openmsx::MSXMotherBoard::isTurboR(), and parseSlotMap().
|
inline |
Definition at line 58 of file HardwareConfig.hh.
Referenced by openmsx::ImGuiMedia::displayNameForHardwareConfig(), and openmsx::MachineExtensionInfo::execute().
|
inline |
Definition at line 72 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute().
const XMLElement & openmsx::HardwareConfig::getDevicesElem | ( | ) | const |
Definition at line 235 of file HardwareConfig.cc.
References openmsx::XMLElement::getChild(), and getConfig().
Referenced by createDevices(), and parseSlots().
|
inline |
Definition at line 52 of file HardwareConfig.hh.
Referenced by openmsx::DeviceConfig::getFileContext().
|
inline |
Definition at line 50 of file HardwareConfig.hh.
Referenced by openmsx::DeviceConfig::getMotherBoard(), and openmsx::MSXDevice::getMotherBoard().
|
inline |
Definition at line 57 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute(), openmsx::ListExtCmd::execute(), openmsx::MSXMotherBoard::findExtension(), and openmsx::MSXMotherBoard::removeExtension().
std::string_view openmsx::HardwareConfig::getRomFilename | ( | ) | const |
Definition at line 142 of file HardwareConfig.cc.
References openmsx::XMLElement::findChild(), getConfig(), and ROM.
Referenced by openmsx::ImGuiMedia::displayNameForHardwareConfig().
|
inline |
Definition at line 61 of file HardwareConfig.hh.
Referenced by openmsx::ImGuiMedia::displayNameForHardwareConfig(), and openmsx::MachineExtensionInfo::execute().
|
inline |
Definition at line 55 of file HardwareConfig.hh.
|
static |
Definition at line 270 of file HardwareConfig.cc.
Referenced by openmsx::ConfigInfo::execute().
|
delete |
|
delete |
byte openmsx::HardwareConfig::parseSlotMap | ( | ) | const |
Parses a slot mapping.
Returns the slot selection: two bits per page for the slot to be selected in that page, like MSX port 0xA8.
Definition at line 350 of file HardwareConfig.cc.
References getConfig().
Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().
void openmsx::HardwareConfig::parseSlots | ( | ) |
Definition at line 285 of file HardwareConfig.cc.
References openmsx::XMLDocument::allocateString(), openmsx::XMLElement::getChildren(), openmsx::MSXMotherBoard::getCPUInterface(), getDevicesElem(), openmsx::CartridgeSlotManager::getSlotNum(), openmsx::MSXCPUInterface::isExpanded(), openmsx::XMLAttribute::setValue(), and strCat().
Referenced by openmsx::MSXMotherBoard::loadMachine(), and serialize().
void openmsx::HardwareConfig::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 478 of file HardwareConfig.cc.
References createDevices(), EXTENSION, openmsx::OldXMLElement::getLastSerializedFileContext(), openmsx::MSXMotherBoard::getMachineConfig(), openmsx::XMLDocument::load(), parseSlots(), ROM, and openmsx::MSXMotherBoard::setMachineConfig().
|
inline |
Definition at line 53 of file HardwareConfig.hh.
void openmsx::HardwareConfig::testRemove | ( | ) | const |
Checks whether this HardwareConfig can be deleted.
Throws an exception if not.
Definition at line 202 of file HardwareConfig.cc.
References openmsx::MSXMotherBoard::getCPUInterface(), openmsx::MSXMotherBoard::getSlotManager(), openmsx::CartridgeSlotManager::testRemoveExternalSlot(), openmsx::MSXCPUInterface::testUnsetExpanded(), and xrange().
Referenced by openmsx::MSXMotherBoard::removeExtension(), and ~HardwareConfig().
|
friend |
Definition at line 112 of file HardwareConfig.hh.