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 67 of file Reactor.hh.
using openmsx::Reactor::Board = std::shared_ptr<MSXMotherBoard> |
Definition at line 111 of file Reactor.hh.
|
default |
openmsx::Reactor::~Reactor | ( | ) |
Definition at line 284 of file Reactor.cc.
References openmsx::Subject< T >::detach(), openmsx::FOCUS, getGlobalSettings(), openmsx::GlobalSettings::getPauseSetting(), and openmsx::QUIT.
void openmsx::Reactor::block | ( | ) |
Definition at line 601 of file Reactor.cc.
References enterMainLoop(), getMixer(), and openmsx::Mixer::mute().
Referenced by openmsx::MSXCPUInterface::doBreak().
Reactor::Board openmsx::Reactor::createEmptyMotherBoard | ( | ) |
Definition at line 395 of file Reactor.cc.
Referenced by openmsx::CreateMachineCommand::execute(), openmsx::RestoreMachineCommand::execute(), openmsx::Replay::serialize(), and switchMachine().
void openmsx::Reactor::enterMainLoop | ( | ) |
Definition at line 487 of file Reactor.cc.
References openmsx::Thread::isMainThread().
Referenced by block(), and openmsx::EventDistributor::distributeEvent().
CliComm & openmsx::Reactor::getCliComm | ( | ) |
Definition at line 313 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 323 of file Reactor.cc.
Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().
|
inline |
Definition at line 88 of file Reactor.hh.
|
inline |
Definition at line 89 of file Reactor.hh.
Referenced by openmsx::DiskChanger::~DiskChanger().
|
inline |
Definition at line 86 of file Reactor.hh.
Referenced by openmsx::RendererFactory::createVideoSystem(), openmsx::GetClipboardCommand::execute(), openmsx::SetClipboardCommand::execute(), openmsx::Video9000::Video9000(), openmsx::LaserdiscPlayer::~LaserdiscPlayer(), and openmsx::Video9000::~Video9000().
|
inline |
Definition at line 82 of file Reactor.hh.
Referenced by openmsx::CassettePlayer::CassettePlayer(), openmsx::Display::Display(), openmsx::MSXCPUInterface::doBreak(), openmsx::MSXMotherBoard::doReset(), 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 91 of file Reactor.hh.
Referenced by openmsx::CassettePlayer::serialize(), openmsx::DiskChanger::serialize(), and openmsx::HD::serialize().
|
inline |
Definition at line 83 of file Reactor.hh.
Referenced by openmsx::AddRemoveUpdate::AddRemoveUpdate(), openmsx::CommandLineParser::parse(), run(), and openmsx::AddRemoveUpdate::~AddRemoveUpdate().
|
inline |
Definition at line 84 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::getGlobalCommandController(), getInterpreter(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 104 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 333 of file Reactor.cc.
References end(), 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 85 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents().
Interpreter & openmsx::Reactor::getInterpreter | ( | ) |
Definition at line 318 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 381 of file Reactor.cc.
Referenced by openmsx::MachineCommand::execute(), openmsx::ActivateMachineCommand::execute(), and openmsx::StoreMachineCommand::execute().
|
inline |
Definition at line 90 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::parse().
Mixer & openmsx::Reactor::getMixer | ( | ) |
Definition at line 297 of file Reactor.cc.
MSXMotherBoard * openmsx::Reactor::getMotherBoard | ( | ) | const |
Definition at line 375 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 328 of file Reactor.cc.
Referenced by init(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 81 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents(), and openmsx::MSXMotherBoard::getLedStatus().
RomDatabase & openmsx::Reactor::getSoftwareDatabase | ( | ) |
Definition at line 305 of file Reactor.cc.
Referenced by openmsx::RomFactory::create(), and openmsx::SoftwareInfoTopic::execute().
void openmsx::Reactor::init | ( | ) |
Definition at line 215 of file Reactor.cc.
References openmsx::Subject< T >::attach(), openmsx::FOCUS, getGlobalSettings(), getOpenMSXInfoCommand(), openmsx::GlobalSettings::getPauseSetting(), and openmsx::QUIT.
Referenced by openmsx::CommandLineParser::parse().
|
inline |
Definition at line 115 of file Reactor.hh.
void openmsx::Reactor::replaceBoard | ( | MSXMotherBoard & | oldBoard, |
Board | newBoard | ||
) |
Definition at line 400 of file Reactor.cc.
References find_unguarded(), openmsx::Thread::isMainThread(), and move_pop_back().
void openmsx::Reactor::run | ( | CommandLineParser & | parser | ) |
Main loop.
Definition at line 503 of file Reactor.cc.
References Math::e, getGlobalCliComm(), 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 420 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 608 of file Reactor.cc.
References getMixer(), and openmsx::Mixer::unmute().
Referenced by openmsx::MSXCPUInterface::doContinue().
|
friend |
Definition at line 212 of file Reactor.hh.
|
friend |
Definition at line 209 of file Reactor.hh.
|
friend |
Definition at line 210 of file Reactor.hh.
|
friend |
Definition at line 211 of file Reactor.hh.
|
friend |
Definition at line 207 of file Reactor.hh.
|
friend |
Definition at line 214 of file Reactor.hh.
|
friend |
Definition at line 213 of file Reactor.hh.
|
friend |
Definition at line 208 of file Reactor.hh.