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
 
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::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 ()
 
BooleanSettingsuppressMessages ()
 
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)
 
void registerMediaInfo (std::string_view name, MediaInfoProvider &provider)
 Register and unregister providers of media info, for the media info topic. More...
 
void unregisterMediaInfo (MediaInfoProvider &provider)
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Friends

class DeviceInfo
 
class SettingObserver
 

Detailed Description

Definition at line 80 of file MSXMotherBoard.hh.

Member Typedef Documentation

◆ Extensions

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

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

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

Member Function Documentation

◆ activate()

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

Definition at line 676 of file MSXMotherBoard.cc.

◆ addDevice()

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

All MSXDevices should be registered by the MotherBoard.

Definition at line 591 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 705 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 545 of file MSXMotherBoard.cc.

References getCPU(), and getMachineConfig().

◆ exitCPULoopAsync()

void openmsx::MSXMotherBoard::exitCPULoopAsync ( )

See CPU::exitCPULoopAsync().

Definition at line 687 of file MSXMotherBoard.cc.

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

◆ exitCPULoopSync()

void openmsx::MSXMotherBoard::exitCPULoopSync ( )

Definition at line 694 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 556 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 699 of file MSXMotherBoard.cc.

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

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

References move_pop_back(), and rfind_unguarded().

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

◆ getCassettePort()

CassettePortInterface & openmsx::MSXMotherBoard::getCassettePort ( )

Definition at line 463 of file MSXMotherBoard.cc.

References getMachineConfig().

Referenced by 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() [1/2]

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

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

◆ getMachineName()

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

Definition at line 90 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 207 of file MSXMotherBoard.hh.

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

◆ getMSXCliComm()

CliComm & openmsx::MSXMotherBoard::getMSXCliComm ( )

◆ getMSXCommandController()

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

Definition at line 140 of file MSXMotherBoard.hh.

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

◆ getMSXEventDistributor()

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

◆ getMSXMixer()

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

Definition at line 147 of file MSXMotherBoard.hh.

◆ getPanasonicMemory()

PanasonicMemory & openmsx::MSXMotherBoard::getPanasonicMemory ( )

Definition at line 447 of file MSXMotherBoard.cc.

◆ getPluggingController()

PluggingController & openmsx::MSXMotherBoard::getPluggingController ( )

Definition at line 425 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 145 of file MSXMotherBoard.hh.

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

◆ getRenShaTurbo()

RenShaTurbo & openmsx::MSXMotherBoard::getRenShaTurbo ( )

Definition at line 507 of file MSXMotherBoard.cc.

References getMachineConfig().

◆ getReverseManager()

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

Definition at line 157 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 192 of file MSXMotherBoard.hh.

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

References contains(), and strCat().

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

◆ getVideoSource()

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

Definition at line 159 of file MSXMotherBoard.hh.

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

◆ 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

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

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

◆ powerUp()

void openmsx::MSXMotherBoard::powerUp ( )

◆ readIRQVector()

byte openmsx::MSXMotherBoard::readIRQVector ( )

Definition at line 618 of file MSXMotherBoard.cc.

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

◆ registerMediaInfo()

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

◆ removeDevice()

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

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

References getMachineConfig().

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

◆ suppressMessages()

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

Definition at line 160 of file MSXMotherBoard.hh.

◆ unpause()

void openmsx::MSXMotherBoard::unpause ( )

Definition at line 583 of file MSXMotherBoard.cc.

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

◆ unregisterMediaInfo()

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

Friends And Related Function Documentation

◆ DeviceInfo

friend class DeviceInfo
friend

Definition at line 297 of file MSXMotherBoard.hh.

◆ SettingObserver

friend class SettingObserver
friend

Definition at line 302 of file MSXMotherBoard.hh.


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