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 ()
 
const std::string & getMachineID () const
 
const std::string & 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)
 
bool isTurboR () const
 
std::string loadMachine (const std::string &machine)
 
const ExtensionsgetExtensions () const
 
HardwareConfigfindExtension (string_ref extensionName)
 
std::string loadExtension (string_ref extensionName, string_ref slotname)
 
std::string insertExtension (string_ref 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 (string_ref name)
 Find a MSXDevice by name. More...
 
template<typename T , typename ... Args>
std::shared_ptr< T > getSharedStuff (string_ref 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...
 
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 59 of file MSXMotherBoard.hh.

Member Typedef Documentation

◆ Extensions

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

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

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

Referenced by openmsx::HardwareConfig::createDevices(), and getVideoSource().

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

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

Referenced by getSharedStuff().

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

References getCPU(), and getMachineConfig().

Referenced by getMachineName(), and openmsx::Reactor::run().

◆ exitCPULoopAsync()

void openmsx::MSXMotherBoard::exitCPULoopAsync ( )

See CPU::exitCPULoopAsync().

Definition at line 624 of file MSXMotherBoard.cc.

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

Referenced by openmsx::Reactor::enterMainLoop(), and getMachineName().

◆ exitCPULoopSync()

void openmsx::MSXMotherBoard::exitCPULoopSync ( )

◆ fastForward()

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

Run emulation until a certain time in fast forward mode.

Definition at line 493 of file MSXMotherBoard.cc.

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

Referenced by getMachineName().

◆ findDevice()

MSXDevice * openmsx::MSXMotherBoard::findDevice ( string_ref  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 636 of file MSXMotherBoard.cc.

Referenced by openmsx::DeviceInfo::execute(), getVideoSource(), and openmsx::MSXDevice::testRemove().

◆ findExtension()

HardwareConfig * openmsx::MSXMotherBoard::findExtension ( string_ref  extensionName)

◆ freeUserName()

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

◆ getCassettePort()

CassettePortInterface & openmsx::MSXMotherBoard::getCassettePort ( )

Definition at line 399 of file MSXMotherBoard.cc.

References getMachineConfig().

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

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

const std::string& openmsx::MSXMotherBoard::getMachineID ( ) const
inline

◆ getMachineInfoCommand()

InfoCommand & openmsx::MSXMotherBoard::getMachineInfoCommand ( )

Definition at line 472 of file MSXMotherBoard.cc.

Referenced by openmsx::VDP::getMSX1Palette(), and getVideoSource().

◆ getMachineName()

const std::string& openmsx::MSXMotherBoard::getMachineName ( ) const
inline

◆ getMSXCliComm()

CliComm & openmsx::MSXMotherBoard::getMSXCliComm ( )

◆ getMSXCommandController()

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

Definition at line 116 of file MSXMotherBoard.hh.

Referenced by openmsx::ProxyCmd::ProxyCmd().

◆ getMSXEventDistributor()

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

◆ getMSXMixer()

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

◆ getPanasonicMemory()

PanasonicMemory & openmsx::MSXMotherBoard::getPanasonicMemory ( )

Definition at line 383 of file MSXMotherBoard.cc.

Referenced by getMSXMixer(), openmsx::Rom::Rom(), and openmsx::MSXS1990::writeIO().

◆ getPluggingController()

PluggingController & openmsx::MSXMotherBoard::getPluggingController ( )

◆ getReactor()

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

◆ getRealTime()

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

Definition at line 121 of file MSXMotherBoard.hh.

◆ getRenShaTurbo()

RenShaTurbo & openmsx::MSXMotherBoard::getRenShaTurbo ( )

Definition at line 444 of file MSXMotherBoard.cc.

References openmsx::HardwareConfig::getConfig(), and getMachineConfig().

Referenced by getMSXMixer().

◆ getReverseManager()

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

Definition at line 133 of file MSXMotherBoard.hh.

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

◆ getScheduler()

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

◆ getSharedStuff()

template<typename T , typename ... Args>
std::shared_ptr<T> openmsx::MSXMotherBoard::getSharedStuff ( string_ref  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 167 of file MSXMotherBoard.hh.

References createMapperIO(), destroyMapperIO(), freeUserName(), getUserName(), and serialize().

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

References begin(), and end().

Referenced by getSharedStuff(), and openmsx::HardwareConfig::HardwareConfig().

◆ getVideoSource()

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

◆ insertExtension()

string openmsx::MSXMotherBoard::insertExtension ( string_ref  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 ( string_ref  extensionName,
string_ref  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 512 of file MSXMotherBoard.cc.

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

Referenced by getMachineName(), and openmsx::MSXTurboRPause::writeIO().

◆ powerUp()

void openmsx::MSXMotherBoard::powerUp ( )

◆ readIRQVector()

byte openmsx::MSXMotherBoard::readIRQVector ( )

Definition at line 555 of file MSXMotherBoard.cc.

Referenced by isFastForwarding(), and openmsx::MSXCPUInterface::readIRQVector().

◆ removeDevice()

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

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

◆ unpause()

void openmsx::MSXMotherBoard::unpause ( )

Friends And Related Function Documentation

◆ DeviceInfo

friend class DeviceInfo
friend

Definition at line 256 of file MSXMotherBoard.hh.

◆ SettingObserver

friend class SettingObserver
friend

Definition at line 261 of file MSXMotherBoard.hh.


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