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
 
MSXMotherBoardoperator= (const MSXMotherBoard &)=delete
 
 MSXMotherBoard (Reactor &reactor)
 
 ~MSXMotherBoard ()
 
std::string_view getMachineID () const
 
std::string_view getMachineName () const
 
bool execute ()
 Run emulation. More...
 
void fastForward (EmuTime::param time, bool fast)
 Run emulation until a certain time in fast forward mode. More...
 
void exitCPULoopAsync ()
 See CPU::exitCPULoopAsync(). More...
 
void exitCPULoopSync ()
 
void pause ()
 Pause MSX machine. More...
 
void unpause ()
 
void powerUp ()
 
void doReset ()
 
void activate (bool active)
 
bool isActive () const
 
bool isFastForwarding () const
 
byte readIRQVector ()
 
const HardwareConfiggetMachineConfig () const
 
void setMachineConfig (HardwareConfig *machineConfig)
 
std::string getMachineType () const
 
bool isTurboR () const
 
std::string loadMachine (const std::string &machine)
 
const ExtensionsgetExtensions () const
 
HardwareConfigfindExtension (std::string_view extensionName)
 
std::string loadExtension (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)
 
CliCommgetMSXCliComm ()
 
MSXCommandControllergetMSXCommandController ()
 
SchedulergetScheduler ()
 
MSXEventDistributorgetMSXEventDistributor ()
 
StateChangeDistributorgetStateChangeDistributor ()
 
CartridgeSlotManagergetSlotManager ()
 
RealTimegetRealTime ()
 
DebuggergetDebugger ()
 
MSXMixergetMSXMixer ()
 
PluggingControllergetPluggingController ()
 
MSXCPUgetCPU ()
 
MSXCPUInterfacegetCPUInterface ()
 
PanasonicMemorygetPanasonicMemory ()
 
MSXDeviceSwitchgetDeviceSwitch ()
 
CassettePortInterfacegetCassettePort ()
 
JoystickPortIfgetJoystickPort (unsigned port)
 
RenShaTurbogetRenShaTurbo ()
 
LedStatusgetLedStatus ()
 
ReverseManagergetReverseManager ()
 
ReactorgetReactor ()
 
VideoSourceSettinggetVideoSource ()
 
CommandControllergetCommandController ()
 
InfoCommandgetMachineInfoCommand ()
 
EmuTime::param getCurrentTime ()
 Convenience method: This is the same as getScheduler().getCurrentTime(). More...
 
void addDevice (MSXDevice &device)
 All MSXDevices should be registered by the MotherBoard. More...
 
void removeDevice (MSXDevice &device)
 
MSXDevicefindDevice (std::string_view name)
 Find a MSXDevice by name. More...
 
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. More...
 
MSXMapperIOcreateMapperIO ()
 All memory mappers in one MSX machine share the same four (logical) memory mapper registers. More...
 
MSXMapperIOgetMapperIO () const
 
void destroyMapperIO ()
 
std::string getUserName (const std::string &hwName)
 Keep track of which 'usernames' are in use. More...
 
void freeUserName (const std::string &hwName, const std::string &userName)
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Friends

class DeviceInfo
 
class SettingObserver
 

Detailed Description

Definition at line 60 of file MSXMotherBoard.hh.

Member Typedef Documentation

◆ Extensions

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

Definition at line 108 of file MSXMotherBoard.hh.

Constructor & Destructor Documentation

◆ MSXMotherBoard() [1/2]

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

◆ MSXMotherBoard() [2/2]

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

◆ ~MSXMotherBoard()

openmsx::MSXMotherBoard::~MSXMotherBoard ( )

Definition at line 248 of file MSXMotherBoard.cc.

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

Member Function Documentation

◆ activate()

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

◆ addDevice()

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

All MSXDevices should be registered by the MotherBoard.

Definition at line 555 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 670 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 509 of file MSXMotherBoard.cc.

References getCPU(), and getMachineConfig().

◆ exitCPULoopAsync()

void openmsx::MSXMotherBoard::exitCPULoopAsync ( )

See CPU::exitCPULoopAsync().

Definition at line 651 of file MSXMotherBoard.cc.

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

◆ exitCPULoopSync()

void openmsx::MSXMotherBoard::exitCPULoopSync ( )

Definition at line 658 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 520 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 663 of file MSXMotherBoard.cc.

References end(), and ranges::find_if().

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

◆ 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 721 of file MSXMotherBoard.cc.

References move_pop_back(), and rfind_unguarded().

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

◆ getCassettePort()

CassettePortInterface & openmsx::MSXMotherBoard::getCassettePort ( )

Definition at line 427 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 ( )

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

◆ getLedStatus()

LedStatus & openmsx::MSXMotherBoard::getLedStatus ( )

◆ getMachineConfig()

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

◆ getMachineID()

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

◆ getMachineInfoCommand()

InfoCommand & openmsx::MSXMotherBoard::getMachineInfoCommand ( )

Definition at line 499 of file MSXMotherBoard.cc.

◆ getMachineName()

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

Definition at line 70 of file MSXMotherBoard.hh.

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

◆ getMachineType()

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

◆ getMapperIO()

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

Definition at line 184 of file MSXMotherBoard.hh.

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

◆ getMSXCliComm()

CliComm & openmsx::MSXMotherBoard::getMSXCliComm ( )

◆ getMSXCommandController()

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

Definition at line 118 of file MSXMotherBoard.hh.

Referenced by openmsx::RealDrive::RealDrive().

◆ getMSXEventDistributor()

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

◆ getMSXMixer()

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

Definition at line 125 of file MSXMotherBoard.hh.

◆ getPanasonicMemory()

PanasonicMemory & openmsx::MSXMotherBoard::getPanasonicMemory ( )

Definition at line 411 of file MSXMotherBoard.cc.

◆ getPluggingController()

PluggingController & openmsx::MSXMotherBoard::getPluggingController ( )

Definition at line 389 of file MSXMotherBoard.cc.

References getMachineConfig().

Referenced by getJoystickPort(), and openmsx::MSXDevice::getPluggingController().

◆ getReactor()

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

◆ getRealTime()

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

Definition at line 123 of file MSXMotherBoard.hh.

◆ getRenShaTurbo()

RenShaTurbo & openmsx::MSXMotherBoard::getRenShaTurbo ( )

Definition at line 471 of file MSXMotherBoard.cc.

References getMachineConfig().

◆ getReverseManager()

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

Definition at line 135 of file MSXMotherBoard.hh.

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

◆ 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 169 of file MSXMotherBoard.hh.

Referenced by openmsx::HD::HD(), openmsx::IDECDROM::IDECDROM(), openmsx::ImagePrinter::ImagePrinter(), openmsx::RealDrive::RealDrive(), 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 709 of file MSXMotherBoard.cc.

References contains(), and strCat().

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

◆ getVideoSource()

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

Definition at line 137 of file MSXMotherBoard.hh.

Referenced by openmsx::LDPixelRenderer::frameEnd().

◆ 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

◆ isTurboR()

bool openmsx::MSXMotherBoard::isTurboR ( ) const

◆ loadExtension()

string openmsx::MSXMotherBoard::loadExtension ( std::string_view  extensionName,
std::string_view  slotname 
)

◆ loadMachine()

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

◆ operator=()

MSXMotherBoard& openmsx::MSXMotherBoard::operator= ( const 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 539 of file MSXMotherBoard.cc.

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

◆ powerUp()

void openmsx::MSXMotherBoard::powerUp ( )

◆ readIRQVector()

byte openmsx::MSXMotherBoard::readIRQVector ( )

Definition at line 582 of file MSXMotherBoard.cc.

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

◆ removeDevice()

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

Definition at line 560 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 277 of file MSXMotherBoard.cc.

References getMachineConfig().

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

◆ unpause()

void openmsx::MSXMotherBoard::unpause ( )

Definition at line 547 of file MSXMotherBoard.cc.

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

Friends And Related Function Documentation

◆ DeviceInfo

friend class DeviceInfo
friend

Definition at line 265 of file MSXMotherBoard.hh.

◆ SettingObserver

friend class SettingObserver
friend

Definition at line 270 of file MSXMotherBoard.hh.


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