openMSX
Public Types | Public Member Functions | Friends | List of all members
openmsx::MSXMotherBoard Class Referencefinal

#include <MSXMotherBoard.hh>

Public Types

using Extensions = std::vector< std::unique_ptr< HardwareConfig > >
 

Public Member Functions

 MSXMotherBoard (const MSXMotherBoard &)=delete
 
 MSXMotherBoard (MSXMotherBoard &&)=delete
 
MSXMotherBoardoperator= (const MSXMotherBoard &)=delete
 
MSXMotherBoardoperator= (MSXMotherBoard &&)=delete
 
 MSXMotherBoard (Reactor &reactor)
 
 ~MSXMotherBoard ()
 
std::string_view getMachineID () const
 
std::string_view getMachineName () const
 
bool execute ()
 Run emulation.
 
void fastForward (EmuTime::param time, bool fast)
 Run emulation until a certain time in fast forward mode.
 
void exitCPULoopAsync ()
 See CPU::exitCPULoopAsync().
 
void exitCPULoopSync ()
 
void pause ()
 Pause MSX machine.
 
void unpause ()
 
void powerUp ()
 
bool isPowered () const
 
void doReset ()
 
void activate (bool active)
 
bool isActive () const
 
bool isFastForwarding () const
 
byte readIRQVector () const
 
const HardwareConfiggetMachineConfig () const
 
HardwareConfiggetMachineConfig ()
 
void setMachineConfig (HardwareConfig *machineConfig)
 
std::string_view getMachineType () const
 
bool isTurboR () const
 
bool hasToshibaEngine () const
 
std::string loadMachine (const std::string &machine)
 
const ExtensionsgetExtensions () const
 
HardwareConfigfindExtension (std::string_view extensionName)
 
std::unique_ptr< HardwareConfigloadExtension (std::string_view extensionName, std::string_view slotName)
 
std::string insertExtension (std::string_view name, std::unique_ptr< HardwareConfig > extension)
 
void removeExtension (const HardwareConfig &extension)
 
MSXCliCommgetMSXCliComm ()
 
MSXCommandControllergetMSXCommandController ()
 
SchedulergetScheduler ()
 
MSXEventDistributorgetMSXEventDistributor ()
 
StateChangeDistributorgetStateChangeDistributor ()
 
CartridgeSlotManagergetSlotManager ()
 
RealTimegetRealTime ()
 
DebuggergetDebugger ()
 
MSXMixergetMSXMixer ()
 
PluggingControllergetPluggingController ()
 
MSXCPUgetCPU ()
 
MSXCPUInterfacegetCPUInterface ()
 
PanasonicMemorygetPanasonicMemory ()
 
MSXDeviceSwitchgetDeviceSwitch ()
 
CassettePortInterfacegetCassettePort ()
 
JoystickPortIfgetJoystickPort (unsigned port)
 
RenShaTurbogetRenShaTurbo ()
 
LedStatusgetLedStatus ()
 
ReverseManagergetReverseManager ()
 
ReactorgetReactor ()
 
VideoSourceSettinggetVideoSource ()
 
BooleanSettingsuppressMessages ()
 
CommandControllergetCommandController ()
 
InfoCommandgetMachineInfoCommand ()
 
EmuTime::param getCurrentTime () const
 Convenience method: This is the same as getScheduler().getCurrentTime().
 
void addDevice (MSXDevice &device)
 All MSXDevices should be registered by the MotherBoard.
 
void removeDevice (MSXDevice &device)
 
MSXDevicefindDevice (std::string_view name)
 Find a MSXDevice by name.
 
template<typename T , typename ... Args>
std::shared_ptr< T > getSharedStuff (std::string_view name, Args &&...args)
 Some MSX device parts are shared between several MSX devices (e.g.
 
MSXMapperIOcreateMapperIO ()
 All memory mappers in one MSX machine share the same four (logical) memory mapper registers.
 
MSXMapperIOgetMapperIO () const
 
void destroyMapperIO ()
 
std::string getUserName (const std::string &hwName)
 Keep track of which 'usernames' are in use.
 
void freeUserName (const std::string &hwName, const std::string &userName)
 
void registerMediaInfo (std::string_view name, MediaInfoProvider &provider)
 Register and unregister providers of media info, for the media info topic.
 
void unregisterMediaInfo (MediaInfoProvider &provider)
 
void registerKeyboard (Keyboard &keyboard)
 
void unregisterKeyboard (Keyboard &keyboard)
 
KeyboardgetKeyboard () const
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Friends

class DeviceInfo
 
class SettingObserver
 

Detailed Description

Definition at line 83 of file MSXMotherBoard.hh.

Member Typedef Documentation

◆ Extensions

using openmsx::MSXMotherBoard::Extensions = std::vector<std::unique_ptr<HardwareConfig> >

Definition at line 136 of file MSXMotherBoard.hh.

Constructor & Destructor Documentation

◆ MSXMotherBoard() [1/3]

openmsx::MSXMotherBoard::MSXMotherBoard ( const MSXMotherBoard )
delete

◆ MSXMotherBoard() [2/3]

openmsx::MSXMotherBoard::MSXMotherBoard ( MSXMotherBoard &&  )
delete

◆ MSXMotherBoard() [3/3]

openmsx::MSXMotherBoard::MSXMotherBoard ( Reactor reactor)
explicit

◆ ~MSXMotherBoard()

openmsx::MSXMotherBoard::~MSXMotherBoard ( )

Definition at line 276 of file MSXMotherBoard.cc.

References openmsx::Subject< T >::detach(), and getMachineConfig().

Member Function Documentation

◆ activate()

void openmsx::MSXMotherBoard::activate ( bool  active)

Definition at line 677 of file MSXMotherBoard.cc.

◆ addDevice()

void openmsx::MSXMotherBoard::addDevice ( MSXDevice device)

All MSXDevices should be registered by the MotherBoard.

Definition at line 594 of file MSXMotherBoard.cc.

◆ createMapperIO()

MSXMapperIO & openmsx::MSXMotherBoard::createMapperIO ( )

All memory mappers in one MSX machine share the same four (logical) memory mapper registers.

These two methods handle this sharing.

Definition at line 706 of file MSXMotherBoard.cc.

References openmsx::DeviceFactory::createMapperIO(), getCPUInterface(), getMachineConfig(), openmsx::MSXCPUInterface::register_IO_In(), and openmsx::MSXCPUInterface::register_IO_Out().

Referenced by openmsx::MSXMapperIOClient::MSXMapperIOClient(), and openmsx::MSXS1985::MSXS1985().

◆ destroyMapperIO()

void openmsx::MSXMotherBoard::destroyMapperIO ( )

◆ doReset()

void openmsx::MSXMotherBoard::doReset ( )

◆ execute()

bool openmsx::MSXMotherBoard::execute ( )

Run emulation.

Returns
True if emulation steps were done, false if emulation is suspended.

Definition at line 548 of file MSXMotherBoard.cc.

References getCPU(), and getMachineConfig().

◆ exitCPULoopAsync()

void openmsx::MSXMotherBoard::exitCPULoopAsync ( )

See CPU::exitCPULoopAsync().

Definition at line 688 of file MSXMotherBoard.cc.

References openmsx::MSXCPU::exitCPULoopAsync(), getCPU(), and getMachineConfig().

◆ exitCPULoopSync()

void openmsx::MSXMotherBoard::exitCPULoopSync ( )

Definition at line 695 of file MSXMotherBoard.cc.

References openmsx::MSXCPU::exitCPULoopSync(), and getCPU().

◆ fastForward()

void openmsx::MSXMotherBoard::fastForward ( EmuTime::param  time,
bool  fast 
)

Run emulation until a certain time in fast forward mode.

Definition at line 559 of file MSXMotherBoard.cc.

References getCPU(), getCurrentTime(), and getMachineConfig().

◆ findDevice()

MSXDevice * openmsx::MSXMotherBoard::findDevice ( std::string_view  name)

Find a MSXDevice by name.

Parameters
nameThe name of the device as returned by MSXDevice::getName()
Returns
A pointer to the device or nullptr if the device could not be found.

Definition at line 700 of file MSXMotherBoard.cc.

References end(), ranges::find(), and openmsx::MSXDevice::getName().

Referenced by openmsx::DeviceInfo::execute(), openmsx::ImGuiBitmapViewer::paint(), openmsx::ImGuiCharacter::paint(), openmsx::ImGuiPalette::paint(), openmsx::ImGuiSpriteViewer::paint(), and openmsx::ImGuiVdpRegs::paint().

◆ findExtension()

HardwareConfig * openmsx::MSXMotherBoard::findExtension ( std::string_view  extensionName)

◆ freeUserName()

void openmsx::MSXMotherBoard::freeUserName ( const std::string &  hwName,
const std::string &  userName 
)

Definition at line 749 of file MSXMotherBoard.cc.

References move_pop_back(), and rfind_unguarded().

Referenced by openmsx::HardwareConfig::~HardwareConfig().

◆ getCassettePort()

CassettePortInterface & openmsx::MSXMotherBoard::getCassettePort ( )

Definition at line 466 of file MSXMotherBoard.cc.

References getMachineConfig().

Referenced by openmsx::LaserdiscPlayer::LaserdiscPlayer(), and serialize().

◆ getCommandController()

CommandController & openmsx::MSXMotherBoard::getCommandController ( )

◆ getCPU()

MSXCPU & openmsx::MSXMotherBoard::getCPU ( )

◆ getCPUInterface()

MSXCPUInterface & openmsx::MSXMotherBoard::getCPUInterface ( )

◆ getCurrentTime()

EmuTime::param openmsx::MSXMotherBoard::getCurrentTime ( ) const

◆ getDebugger()

Debugger & openmsx::MSXMotherBoard::getDebugger ( )
inline

◆ getDeviceSwitch()

MSXDeviceSwitch & openmsx::MSXMotherBoard::getDeviceSwitch ( )

◆ getExtensions()

const Extensions & openmsx::MSXMotherBoard::getExtensions ( ) const
inline

◆ getJoystickPort()

JoystickPortIf & openmsx::MSXMotherBoard::getJoystickPort ( unsigned  port)

◆ getKeyboard()

Keyboard * openmsx::MSXMotherBoard::getKeyboard ( ) const
inline

Definition at line 245 of file MSXMotherBoard.hh.

Referenced by openmsx::ImGuiKeyboard::paint().

◆ getLedStatus()

LedStatus & openmsx::MSXMotherBoard::getLedStatus ( )

◆ getMachineConfig() [1/2]

HardwareConfig * openmsx::MSXMotherBoard::getMachineConfig ( )
inline

Definition at line 128 of file MSXMotherBoard.hh.

◆ getMachineConfig() [2/2]

const HardwareConfig * openmsx::MSXMotherBoard::getMachineConfig ( ) const
inline

◆ getMachineID()

std::string_view openmsx::MSXMotherBoard::getMachineID ( ) const
inline

◆ getMachineInfoCommand()

InfoCommand & openmsx::MSXMotherBoard::getMachineInfoCommand ( )

Definition at line 538 of file MSXMotherBoard.cc.

◆ getMachineName()

std::string_view openmsx::MSXMotherBoard::getMachineName ( ) const
inline

Definition at line 95 of file MSXMotherBoard.hh.

Referenced by openmsx::MachineNameInfo::execute().

◆ getMachineType()

std::string_view openmsx::MSXMotherBoard::getMachineType ( ) const

◆ getMapperIO()

MSXMapperIO & openmsx::MSXMotherBoard::getMapperIO ( ) const
inline

Definition at line 213 of file MSXMotherBoard.hh.

Referenced by openmsx::MSXMapperIOClient::~MSXMapperIOClient().

◆ getMSXCliComm()

MSXCliComm & openmsx::MSXMotherBoard::getMSXCliComm ( )

◆ getMSXCommandController()

MSXCommandController & openmsx::MSXMotherBoard::getMSXCommandController ( )
inline

◆ getMSXEventDistributor()

MSXEventDistributor & openmsx::MSXMotherBoard::getMSXEventDistributor ( )
inline

◆ getMSXMixer()

MSXMixer & openmsx::MSXMotherBoard::getMSXMixer ( )
inline

◆ getPanasonicMemory()

PanasonicMemory & openmsx::MSXMotherBoard::getPanasonicMemory ( )

Definition at line 450 of file MSXMotherBoard.cc.

◆ getPluggingController()

PluggingController & openmsx::MSXMotherBoard::getPluggingController ( )

◆ getReactor()

Reactor & openmsx::MSXMotherBoard::getReactor ( )
inline

◆ getRealTime()

RealTime & openmsx::MSXMotherBoard::getRealTime ( )
inline

Definition at line 151 of file MSXMotherBoard.hh.

Referenced by openmsx::MSXCPUInterface::doContinue().

◆ getRenShaTurbo()

RenShaTurbo & openmsx::MSXMotherBoard::getRenShaTurbo ( )

Definition at line 510 of file MSXMotherBoard.cc.

References getMachineConfig().

◆ getReverseManager()

ReverseManager & openmsx::MSXMotherBoard::getReverseManager ( )
inline

◆ getScheduler()

Scheduler & openmsx::MSXMotherBoard::getScheduler ( )
inline

◆ getSharedStuff()

template<typename T , typename ... Args>
std::shared_ptr< T > openmsx::MSXMotherBoard::getSharedStuff ( std::string_view  name,
Args &&...  args 
)
inline

Some MSX device parts are shared between several MSX devices (e.g.

all memory mappers share IO ports 0xFC-0xFF). But this sharing is limited to one MSX machine. This method offers the storage to implement per-machine reference counted objects. TODO This doesn't play nicely with savestates. For example memory mappers don't use this mechanism anymore because of this. Maybe this method can be removed when savestates are finished.

Definition at line 198 of file MSXMotherBoard.hh.

Referenced by openmsx::RealDrive::getDrivesInUse(), openmsx::HD::getDrivesInUse(), openmsx::IDECDROM::getDrivesInUse(), openmsx::SCSILS120::SCSILS120(), and openmsx::V9990CmdEngine::V9990CmdEngine().

◆ getSlotManager()

CartridgeSlotManager & openmsx::MSXMotherBoard::getSlotManager ( )
inline

◆ getStateChangeDistributor()

StateChangeDistributor & openmsx::MSXMotherBoard::getStateChangeDistributor ( )
inline

◆ getUserName()

string openmsx::MSXMotherBoard::getUserName ( const std::string &  hwName)

Keep track of which 'usernames' are in use.

For example to be able to use several fmpac extensions at once, each with its own SRAM file, we need to generate unique filenames. We also want to reuse existing filenames as much as possible. ATM the usernames always have the format 'untitled[N]'. In the future we might allow really user specified names.

Definition at line 737 of file MSXMotherBoard.cc.

References contains(), and strCat().

Referenced by openmsx::HardwareConfig::HardwareConfig().

◆ getVideoSource()

VideoSourceSetting & openmsx::MSXMotherBoard::getVideoSource ( )
inline

◆ hasToshibaEngine()

bool openmsx::MSXMotherBoard::hasToshibaEngine ( ) const

◆ insertExtension()

string openmsx::MSXMotherBoard::insertExtension ( std::string_view  name,
std::unique_ptr< HardwareConfig extension 
)

◆ isActive()

bool openmsx::MSXMotherBoard::isActive ( ) const
inline

◆ isFastForwarding()

bool openmsx::MSXMotherBoard::isFastForwarding ( ) const
inline

◆ isPowered()

bool openmsx::MSXMotherBoard::isPowered ( ) const
inline

Definition at line 118 of file MSXMotherBoard.hh.

◆ isTurboR()

bool openmsx::MSXMotherBoard::isTurboR ( ) const

◆ loadExtension()

std::unique_ptr< HardwareConfig > openmsx::MSXMotherBoard::loadExtension ( std::string_view  extensionName,
std::string_view  slotName 
)

◆ loadMachine()

string openmsx::MSXMotherBoard::loadMachine ( const std::string &  machine)

◆ operator=() [1/2]

MSXMotherBoard & openmsx::MSXMotherBoard::operator= ( const MSXMotherBoard )
delete

◆ operator=() [2/2]

MSXMotherBoard & openmsx::MSXMotherBoard::operator= ( MSXMotherBoard &&  )
delete

◆ pause()

void openmsx::MSXMotherBoard::pause ( )

Pause MSX machine.

Only CPU is paused, other devices continue running. Used by turbor hardware pause.

Definition at line 578 of file MSXMotherBoard.cc.

References getCPU(), getMachineConfig(), and openmsx::MSXCPU::setPaused().

◆ powerUp()

void openmsx::MSXMotherBoard::powerUp ( )

◆ readIRQVector()

byte openmsx::MSXMotherBoard::readIRQVector ( ) const

Definition at line 620 of file MSXMotherBoard.cc.

Referenced by openmsx::MSXCPUInterface::readIRQVector().

◆ registerKeyboard()

void openmsx::MSXMotherBoard::registerKeyboard ( Keyboard keyboard)
inline

Definition at line 236 of file MSXMotherBoard.hh.

Referenced by openmsx::Keyboard::Keyboard().

◆ registerMediaInfo()

void openmsx::MSXMotherBoard::registerMediaInfo ( std::string_view  name,
MediaInfoProvider provider 
)

◆ removeDevice()

void openmsx::MSXMotherBoard::removeDevice ( MSXDevice device)

Definition at line 599 of file MSXMotherBoard.cc.

References move_pop_back(), and rfind_unguarded().

Referenced by openmsx::HardwareConfig::~HardwareConfig().

◆ removeExtension()

void openmsx::MSXMotherBoard::removeExtension ( const HardwareConfig extension)

◆ serialize()

template<typename Archive >
void openmsx::MSXMotherBoard::serialize ( Archive &  ar,
unsigned  version 
)

◆ setMachineConfig()

void openmsx::MSXMotherBoard::setMachineConfig ( HardwareConfig machineConfig)

Definition at line 306 of file MSXMotherBoard.cc.

References getMachineConfig().

Referenced by loadMachine(), and openmsx::HardwareConfig::serialize().

◆ suppressMessages()

BooleanSetting & openmsx::MSXMotherBoard::suppressMessages ( )
inline

Definition at line 166 of file MSXMotherBoard.hh.

◆ unpause()

void openmsx::MSXMotherBoard::unpause ( )

Definition at line 586 of file MSXMotherBoard.cc.

References getCPU(), getMachineConfig(), and openmsx::MSXCPU::setPaused().

◆ unregisterKeyboard()

void openmsx::MSXMotherBoard::unregisterKeyboard ( Keyboard keyboard)
inline

Definition at line 241 of file MSXMotherBoard.hh.

References find_unguarded().

◆ unregisterMediaInfo()

void openmsx::MSXMotherBoard::unregisterMediaInfo ( MediaInfoProvider provider)

Friends And Related Symbol Documentation

◆ DeviceInfo

friend class DeviceInfo
friend

Definition at line 320 of file MSXMotherBoard.hh.

◆ SettingObserver

friend class SettingObserver
friend

Definition at line 325 of file MSXMotherBoard.hh.


The documentation for this class was generated from the following files: