openMSX
|
Contains the main loop of openMSX. More...
#include <Reactor.hh>
Public Types | |
using | Board = std::shared_ptr< MSXMotherBoard > |
Static Public Member Functions | |
static std::vector< std::string > | getHwConfigs (std::string_view type) |
Friends | |
class | MachineCommand |
class | TestMachineCommand |
class | CreateMachineCommand |
class | DeleteMachineCommand |
class | ListMachinesCommand |
class | ActivateMachineCommand |
class | StoreMachineCommand |
class | RestoreMachineCommand |
Contains the main loop of openMSX.
openMSX is almost single threaded: the main thread does most of the work, we create additional threads only if we need blocking calls for communicating with peripherals. This class serializes all incoming requests so they can be handled by the main thread.
Definition at line 66 of file Reactor.hh.
using openmsx::Reactor::Board = std::shared_ptr<MSXMotherBoard> |
Definition at line 110 of file Reactor.hh.
|
default |
openmsx::Reactor::~Reactor | ( | ) |
Definition at line 286 of file Reactor.cc.
References openmsx::Subject< T >::detach(), getGlobalSettings(), openmsx::GlobalSettings::getPauseSetting(), openmsx::OPENMSX_FOCUS_EVENT, and openmsx::OPENMSX_QUIT_EVENT.
void openmsx::Reactor::block | ( | ) |
Definition at line 604 of file Reactor.cc.
References enterMainLoop(), getMixer(), and openmsx::Mixer::mute().
Referenced by openmsx::MSXCPUInterface::doBreak().
Reactor::Board openmsx::Reactor::createEmptyMotherBoard | ( | ) |
Definition at line 404 of file Reactor.cc.
Referenced by openmsx::CreateMachineCommand::execute(), openmsx::RestoreMachineCommand::execute(), openmsx::Replay::serialize(), and switchMachine().
void openmsx::Reactor::enterMainLoop | ( | ) |
Definition at line 496 of file Reactor.cc.
References openmsx::Thread::isMainThread().
Referenced by block(), and openmsx::EventDistributor::distributeEvent().
CliComm & openmsx::Reactor::getCliComm | ( | ) |
Definition at line 315 of file Reactor.cc.
Referenced by openmsx::AviRecorder::addImage(), openmsx::AviRecorder::addWave(), openmsx::MSXCPUInterface::doBreak(), openmsx::MSXCPUInterface::doContinue(), openmsx::Display::getCliComm(), and openmsx::CommandLineParser::parse().
CommandController & openmsx::Reactor::getCommandController | ( | ) |
Definition at line 325 of file Reactor.cc.
Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().
|
inline |
Definition at line 87 of file Reactor.hh.
|
inline |
Definition at line 88 of file Reactor.hh.
Referenced by openmsx::DiskChanger::~DiskChanger().
|
inline |
Definition at line 85 of file Reactor.hh.
Referenced by openmsx::RendererFactory::createVideoSystem(), openmsx::GetClipboardCommand::execute(), openmsx::SetClipboardCommand::execute(), openmsx::LaserdiscPlayer::LaserdiscPlayer(), openmsx::Video9000::Video9000(), openmsx::LaserdiscPlayer::~LaserdiscPlayer(), and openmsx::Video9000::~Video9000().
|
inline |
Definition at line 81 of file Reactor.hh.
Referenced by openmsx::CassettePlayer::CassettePlayer(), openmsx::Display::Display(), openmsx::MSXCPUInterface::doBreak(), openmsx::MSXMotherBoard::doReset(), openmsx::LaserdiscPlayer::LaserdiscPlayer(), openmsx::MSXMotherBoard::MSXMotherBoard(), openmsx::MSXMotherBoard::powerUp(), openmsx::SDLVideoSystem::SDLVideoSystem(), openmsx::Video9000::Video9000(), openmsx::CassettePlayer::~CassettePlayer(), openmsx::Display::~Display(), openmsx::FilePool::~FilePool(), openmsx::LaserdiscPlayer::~LaserdiscPlayer(), openmsx::SDLVideoSystem::~SDLVideoSystem(), and openmsx::Video9000::~Video9000().
|
inline |
Definition at line 90 of file Reactor.hh.
Referenced by openmsx::CassettePlayer::serialize(), and openmsx::HD::serialize().
|
inline |
Definition at line 82 of file Reactor.hh.
Referenced by openmsx::AddRemoveUpdate::AddRemoveUpdate(), openmsx::CommandLineParser::parse(), run(), and openmsx::AddRemoveUpdate::~AddRemoveUpdate().
|
inline |
Definition at line 83 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::getGlobalCommandController(), getInterpreter(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 103 of file Reactor.hh.
Referenced by openmsx::DeviceConfig::getGlobalSettings(), openmsx::HD::HD(), init(), openmsx::MSXMotherBoard::MSXMotherBoard(), openmsx::SDLSoundDriver::uploadBuffer(), and ~Reactor().
|
static |
Definition at line 335 of file Reactor.cc.
References end(), StringOp::endsWith(), openmsx::foreach_file_and_directory(), openmsx::FileOperations::isRegularFile(), openmsx::FileOperations::join(), utf8::unchecked::size(), ranges::sort(), openmsx::systemFileContext(), and ranges::unique().
Referenced by openmsx::ConfigInfo::execute(), openmsx::ExtCmd::tabCompletion(), openmsx::LoadMachineCmd::tabCompletion(), openmsx::MachineCommand::tabCompletion(), openmsx::TestMachineCommand::tabCompletion(), and openmsx::ConfigInfo::tabCompletion().
|
inline |
Definition at line 84 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents().
Interpreter & openmsx::Reactor::getInterpreter | ( | ) |
Definition at line 320 of file Reactor.cc.
References getGlobalCommandController(), and openmsx::GlobalCommandController::getInterpreter().
Referenced by openmsx::EventDistributor::deliverEvents(), and openmsx::CommandLineParser::getInterpreter().
string_view openmsx::Reactor::getMachineID | ( | ) | const |
Definition at line 383 of file Reactor.cc.
Referenced by openmsx::MachineCommand::execute(), openmsx::ActivateMachineCommand::execute(), and openmsx::StoreMachineCommand::execute().
|
inline |
Definition at line 89 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::parse().
Mixer & openmsx::Reactor::getMixer | ( | ) |
Definition at line 299 of file Reactor.cc.
MSXMotherBoard * openmsx::Reactor::getMotherBoard | ( | ) | const |
Definition at line 377 of file Reactor.cc.
References openmsx::Thread::isMainThread().
Referenced by openmsx::CommandLineParser::getMotherBoard(), openmsx::Display::getWindowTitle(), openmsx::MSXCommandController::isActive(), and openmsx::SDLSoundDriver::uploadBuffer().
InfoCommand & openmsx::Reactor::getOpenMSXInfoCommand | ( | ) |
Definition at line 330 of file Reactor.cc.
Referenced by init(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 80 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents(), and openmsx::MSXMotherBoard::getLedStatus().
RomDatabase & openmsx::Reactor::getSoftwareDatabase | ( | ) |
Definition at line 307 of file Reactor.cc.
Referenced by openmsx::RomFactory::create(), and openmsx::SoftwareInfoTopic::execute().
void openmsx::Reactor::init | ( | ) |
Definition at line 217 of file Reactor.cc.
References openmsx::Subject< T >::attach(), getGlobalSettings(), getOpenMSXInfoCommand(), openmsx::GlobalSettings::getPauseSetting(), openmsx::OPENMSX_FOCUS_EVENT, and openmsx::OPENMSX_QUIT_EVENT.
Referenced by openmsx::CommandLineParser::parse().
void openmsx::Reactor::replaceBoard | ( | MSXMotherBoard & | oldBoard, |
Board | newBoard | ||
) |
Definition at line 409 of file Reactor.cc.
References find_if_unguarded(), openmsx::Thread::isMainThread(), and move_pop_back().
void openmsx::Reactor::run | ( | CommandLineParser & | parser | ) |
Main loop.
Definition at line 512 of file Reactor.cc.
References getGlobalCliComm(), openmsx::MSXException::getMessage(), openmsx::CommandLineParser::getParseStatus(), openmsx::CommandLineParser::getStartupCommands(), openmsx::CommandLineParser::getStartupScripts(), openmsx::preferSystemFileContext(), openmsx::CommandLineParser::RUN, openmsx::GlobalCliComm::setAllowExternalCommands(), and openmsx::userFileContext().
void openmsx::Reactor::switchMachine | ( | const std::string & | machine | ) |
Definition at line 429 of file Reactor.cc.
References createEmptyMotherBoard(), and openmsx::Thread::isMainThread().
Referenced by openmsx::MachineCommand::execute(), and openmsx::CommandLineParser::parse().
void openmsx::Reactor::unblock | ( | ) |
Definition at line 611 of file Reactor.cc.
References getMixer(), and openmsx::Mixer::unmute().
Referenced by openmsx::MSXCPUInterface::doContinue().
|
friend |
Definition at line 205 of file Reactor.hh.
|
friend |
Definition at line 202 of file Reactor.hh.
|
friend |
Definition at line 203 of file Reactor.hh.
|
friend |
Definition at line 204 of file Reactor.hh.
|
friend |
Definition at line 200 of file Reactor.hh.
|
friend |
Definition at line 207 of file Reactor.hh.
|
friend |
Definition at line 206 of file Reactor.hh.
|
friend |
Definition at line 201 of file Reactor.hh.