openMSX
|
#include <HardwareConfig.hh>
Public Types | |
enum class | Type { MACHINE , EXTENSION , ROM } |
Public Member Functions | |
HardwareConfig (const HardwareConfig &)=delete | |
HardwareConfig & | operator= (const HardwareConfig &)=delete |
HardwareConfig (MSXMotherBoard &motherBoard, std::string hwName) | |
~HardwareConfig () | |
MSXMotherBoard & | getMotherBoard () const |
const FileContext & | getFileContext () const |
void | setFileContext (FileContext &&ctxt) |
const XMLElement & | getConfig () const |
const std::string & | getName () const |
const std::string & | getConfigName () const |
Type | getType () const |
byte | parseSlotMap () const |
Parses a slot mapping. More... | |
void | parseSlots () |
void | createDevices () |
const std::vector< std::unique_ptr< MSXDevice > > & | getDevices () const |
void | testRemove () const |
Checks whether this HardwareConfig can be deleted. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Member Functions | |
static XMLElement | loadConfig (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 romfile, std::string slotname, span< const TclObject > options) |
Friends | |
struct | SerializeConstructorArgs< HardwareConfig > |
Definition at line 21 of file HardwareConfig.hh.
|
strong |
Enumerator | |
---|---|
MACHINE | |
EXTENSION | |
ROM |
Definition at line 24 of file HardwareConfig.hh.
|
delete |
openmsx::HardwareConfig::HardwareConfig | ( | MSXMotherBoard & | motherBoard, |
std::string | hwName | ||
) |
Definition at line 115 of file HardwareConfig.cc.
References ranges::fill(), and openmsx::MSXMotherBoard::getUserName().
openmsx::HardwareConfig::~HardwareConfig | ( | ) |
Definition at line 128 of file HardwareConfig.cc.
References openmsx::MSXMotherBoard::freeUserName(), openmsx::MSXMotherBoard::getCPUInterface(), openmsx::MSXException::getMessage(), openmsx::MSXMotherBoard::getSlotManager(), openmsx::MSXMotherBoard::removeDevice(), openmsx::CartridgeSlotManager::removeExternalSlot(), testRemove(), UNREACHABLE, openmsx::MSXCPUInterface::unsetExpanded(), and xrange().
void openmsx::HardwareConfig::createDevices | ( | ) |
Definition at line 322 of file HardwareConfig.cc.
Referenced by openmsx::MSXMotherBoard::loadMachine(), and serialize().
|
static |
Definition at line 40 of file HardwareConfig.cc.
References EXTENSION.
Referenced by openmsx::MSXMotherBoard::loadExtension().
|
static |
Definition at line 30 of file HardwareConfig.cc.
References MACHINE.
Referenced by openmsx::MSXMotherBoard::loadMachine().
|
static |
Definition at line 52 of file HardwareConfig.cc.
References openmsx::XMLElement::addChild(), openmsx::FileOperations::getAbsolutePath(), openmsx::MSXMotherBoard::getCommandController(), openmsx::FileOperations::getFilename(), openmsx::CommandController::getInterpreter(), openmsx::FileOperations::isRegularFile(), openmsx::parseTclArgs(), openmsx::FileContext::resolve(), ROM, strCat(), tmpStrCat(), openmsx::userFileContext(), and openmsx::valueArg().
|
inline |
Definition at line 52 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute(), openmsx::MSXMotherBoard::getJoystickPort(), openmsx::MSXMotherBoard::getMachineType(), openmsx::MSXMotherBoard::isTurboR(), and parseSlotMap().
|
inline |
Definition at line 54 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute().
|
inline |
Definition at line 66 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute().
|
inline |
Definition at line 49 of file HardwareConfig.hh.
Referenced by openmsx::DeviceConfig::getFileContext().
|
inline |
Definition at line 47 of file HardwareConfig.hh.
Referenced by openmsx::DeviceConfig::getMotherBoard(), and openmsx::MSXDevice::getMotherBoard().
|
inline |
Definition at line 53 of file HardwareConfig.hh.
Referenced by openmsx::MSXMotherBoard::removeExtension().
|
inline |
Definition at line 55 of file HardwareConfig.hh.
Referenced by openmsx::MachineExtensionInfo::execute().
|
static |
Definition at line 221 of file HardwareConfig.cc.
Referenced by openmsx::ConfigInfo::execute().
|
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 301 of file HardwareConfig.cc.
References getConfig().
Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().
void openmsx::HardwareConfig::parseSlots | ( | ) |
Definition at line 236 of file HardwareConfig.cc.
References openmsx::MSXMotherBoard::getCPUInterface(), openmsx::CartridgeSlotManager::getSlotNum(), openmsx::MSXCPUInterface::isExpanded(), openmsx::XMLElement::setAttribute(), and strCat().
Referenced by openmsx::MSXMotherBoard::loadMachine(), and serialize().
void openmsx::HardwareConfig::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 428 of file HardwareConfig.cc.
References createDevices(), EXTENSION, openmsx::XMLElement::getLastSerializedFileContext(), openmsx::MSXMotherBoard::getMachineConfig(), parseSlots(), ROM, and openmsx::MSXMotherBoard::setMachineConfig().
|
inline |
Definition at line 50 of file HardwareConfig.hh.
void openmsx::HardwareConfig::testRemove | ( | ) | const |
Checks whether this HardwareConfig can be deleted.
Throws an exception if not.
Definition at line 162 of file HardwareConfig.cc.
References openmsx::MSXMotherBoard::getCPUInterface(), openmsx::MSXMotherBoard::getSlotManager(), view::reverse(), openmsx::CartridgeSlotManager::testRemoveExternalSlot(), openmsx::MSXCPUInterface::testUnsetExpanded(), and xrange().
Referenced by openmsx::MSXMotherBoard::removeExtension(), and ~HardwareConfig().
|
friend |
Definition at line 107 of file HardwareConfig.hh.