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 71 of file Reactor.hh.
using openmsx::Reactor::Board = std::shared_ptr<MSXMotherBoard> |
Definition at line 121 of file Reactor.hh.
|
default |
openmsx::Reactor::~Reactor | ( | ) |
Definition at line 295 of file Reactor.cc.
References openmsx::Subject< T >::detach(), getGlobalSettings(), openmsx::GlobalSettings::getPauseSetting(), openmsx::QUIT, and openmsx::WINDOW.
void openmsx::Reactor::block | ( | ) |
Definition at line 634 of file Reactor.cc.
References enterMainLoop(), getMixer(), and openmsx::Mixer::mute().
Referenced by openmsx::MSXCPUInterface::doBreak().
Reactor::Board openmsx::Reactor::createEmptyMotherBoard | ( | ) |
Definition at line 429 of file Reactor.cc.
Referenced by openmsx::CreateMachineCommand::execute(), openmsx::RestoreMachineCommand::execute(), openmsx::Replay::serialize(), and switchMachine().
void openmsx::Reactor::enterMainLoop | ( | ) |
Definition at line 520 of file Reactor.cc.
References openmsx::Thread::isMainThread().
Referenced by block(), and openmsx::EventDistributor::distributeEvent().
CliComm & openmsx::Reactor::getCliComm | ( | ) |
Definition at line 324 of file Reactor.cc.
Referenced by openmsx::AviRecorder::addImage(), openmsx::AviRecorder::addWave(), openmsx::MSXCPUInterface::doBreak(), openmsx::MSXCPUInterface::doContinue(), openmsx::ImGuiManager::getCliComm(), openmsx::Display::getCliComm(), openmsx::FilePool::getDirectories(), openmsx::CommandLineParser::parse(), and openmsx::SDLVideoSystem::SDLVideoSystem().
CommandController & openmsx::Reactor::getCommandController | ( | ) |
Definition at line 334 of file Reactor.cc.
Referenced by openmsx::MSXCPUInterface::MSXCPUInterface().
|
inline |
Definition at line 92 of file Reactor.hh.
|
inline |
Definition at line 93 of file Reactor.hh.
Referenced by openmsx::DiskChanger::~DiskChanger().
|
inline |
Definition at line 90 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 86 of file Reactor.hh.
Referenced by openmsx::CassettePlayer::CassettePlayer(), openmsx::Display::Display(), openmsx::MSXCPUInterface::doBreak(), openmsx::MSXMotherBoard::doReset(), openmsx::ImGuiManager::executeDelayed(), openmsx::ImGuiManager::ImGuiManager(), openmsx::LaserdiscPlayer::LaserdiscPlayer(), openmsx::MSXMotherBoard::MSXMotherBoard(), openmsx::ImGuiManager::paintImGui(), openmsx::MSXMotherBoard::powerUp(), openmsx::SDLVideoSystem::SDLVideoSystem(), openmsx::Video9000::Video9000(), openmsx::CassettePlayer::~CassettePlayer(), openmsx::Display::~Display(), openmsx::FilePool::~FilePool(), openmsx::ImGuiManager::~ImGuiManager(), openmsx::LaserdiscPlayer::~LaserdiscPlayer(), and openmsx::Video9000::~Video9000().
|
inline |
Definition at line 95 of file Reactor.hh.
Referenced by openmsx::ImGuiManager::paintImGui(), openmsx::CassettePlayer::serialize(), openmsx::DiskChanger::serialize(), and openmsx::HD::serialize().
|
inline |
Definition at line 87 of file Reactor.hh.
Referenced by openmsx::AddRemoveUpdate::AddRemoveUpdate(), openmsx::ImGuiMessages::ImGuiMessages(), openmsx::CommandLineParser::parse(), run(), openmsx::AddRemoveUpdate::~AddRemoveUpdate(), and openmsx::ImGuiMessages::~ImGuiMessages().
|
inline |
Definition at line 88 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::getGlobalCommandController(), getInterpreter(), openmsx::ImGuiConsole::paint(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 114 of file Reactor.hh.
Referenced by openmsx::DeviceConfig::getGlobalSettings(), openmsx::HD::HD(), init(), openmsx::MSXMotherBoard::MSXMotherBoard(), openmsx::ImGuiSettings::showMenu(), openmsx::SDLSoundDriver::uploadBuffer(), and ~Reactor().
const HotKey & openmsx::Reactor::getHotKey | ( | ) | const |
Definition at line 344 of file Reactor.cc.
Referenced by openmsx::ImGuiMachine::showMenu().
|
static |
Definition at line 349 of file Reactor.cc.
References end(), openmsx::foreach_file_and_directory(), openmsx::FileContext::getPaths(), openmsx::FileOperations::isRegularFile(), openmsx::FileOperations::join(), ranges::sort(), openmsx::systemFileContext(), and ranges::unique().
Referenced by openmsx::ConfigInfo::execute(), openmsx::parseAllConfigFiles(), openmsx::ExtCmd::tabCompletion(), openmsx::LoadMachineCmd::tabCompletion(), openmsx::MachineCommand::tabCompletion(), openmsx::TestMachineCommand::tabCompletion(), and openmsx::ConfigInfo::tabCompletion().
|
inline |
Definition at line 96 of file Reactor.hh.
Referenced by openmsx::Display::retrieveWindowPosition(), openmsx::SDLVideoSystem::SDLVideoSystem(), and openmsx::Display::storeWindowPosition().
|
inline |
Definition at line 89 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents(), and openmsx::SDLVideoSystem::SDLVideoSystem().
Interpreter & openmsx::Reactor::getInterpreter | ( | ) |
Definition at line 329 of file Reactor.cc.
References getGlobalCommandController(), and openmsx::GlobalCommandController::getInterpreter().
Referenced by openmsx::EventDistributor::deliverEvents(), openmsx::ImGuiManager::getInterpreter(), and openmsx::CommandLineParser::getInterpreter().
Reactor::Board openmsx::Reactor::getMachine | ( | std::string_view | machineID | ) | const |
Definition at line 420 of file Reactor.cc.
References ranges::find(), and openmsx::MSXMotherBoard::getMachineID().
Referenced by openmsx::DeleteMachineCommand::execute(), openmsx::ActivateMachineCommand::execute(), and openmsx::StoreMachineCommand::execute().
string_view openmsx::Reactor::getMachineID | ( | ) | const |
Definition at line 415 of file Reactor.cc.
Referenced by openmsx::MachineCommand::execute(), openmsx::ActivateMachineCommand::execute(), and openmsx::StoreMachineCommand::execute().
|
inline |
Definition at line 128 of file Reactor.hh.
References view::transform().
Referenced by openmsx::ListMachinesCommand::execute(), openmsx::DeleteMachineCommand::tabCompletion(), openmsx::ActivateMachineCommand::tabCompletion(), and openmsx::StoreMachineCommand::tabCompletion().
|
inline |
Definition at line 94 of file Reactor.hh.
Referenced by openmsx::CommandLineParser::parse().
Mixer & openmsx::Reactor::getMixer | ( | ) |
Definition at line 308 of file Reactor.cc.
MSXMotherBoard * openmsx::Reactor::getMotherBoard | ( | ) | const |
Definition at line 409 of file Reactor.cc.
References openmsx::Thread::isMainThread().
Referenced by openmsx::CommandLineParser::getMotherBoard(), getMsxChar2Unicode(), openmsx::Display::getWindowTitle(), openmsx::MSXCommandController::isActive(), openmsx::ImGuiBreakPoints::loadStart(), openmsx::ImGuiManager::paintImGui(), and openmsx::SDLSoundDriver::uploadBuffer().
const MsxChar2Unicode & openmsx::Reactor::getMsxChar2Unicode | ( | ) | const |
Definition at line 375 of file Reactor.cc.
References getMotherBoard().
InfoCommand & openmsx::Reactor::getOpenMSXInfoCommand | ( | ) |
Definition at line 339 of file Reactor.cc.
Referenced by init(), and openmsx::CommandLineParser::parse().
|
inline |
Definition at line 99 of file Reactor.hh.
|
inline |
Definition at line 85 of file Reactor.hh.
Referenced by openmsx::EventDistributor::deliverEvents(), openmsx::MSXMotherBoard::getLedStatus(), and openmsx::SDLVideoSystem::SDLVideoSystem().
RomDatabase & openmsx::Reactor::getSoftwareDatabase | ( | ) |
Definition at line 316 of file Reactor.cc.
Referenced by openmsx::RomFactory::create(), openmsx::ImGuiMedia::displayNameForRom(), openmsx::SoftwareInfoTopic::execute(), and openmsx::ImGuiManager::paintImGui().
|
inline |
Definition at line 98 of file Reactor.hh.
void openmsx::Reactor::init | ( | ) |
Definition at line 223 of file Reactor.cc.
References openmsx::Subject< T >::attach(), getGlobalSettings(), getOpenMSXInfoCommand(), openmsx::GlobalSettings::getPauseSetting(), openmsx::QUIT, and openmsx::WINDOW.
Referenced by openmsx::CommandLineParser::parse().
|
inline |
Definition at line 126 of file Reactor.hh.
Referenced by openmsx::ImGuiTrainer::paint().
void openmsx::Reactor::replaceBoard | ( | MSXMotherBoard & | oldBoard, |
Board | newBoard | ||
) |
Definition at line 434 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 536 of file Reactor.cc.
References getGlobalCliComm(), openmsx::CommandLineParser::getParseStatus(), openmsx::CommandLineParser::getStartupCommands(), openmsx::CommandLineParser::getStartupScripts(), openmsx::preferSystemFileContext(), openmsx::FileContext::resolve(), openmsx::CommandLineParser::RUN, openmsx::GlobalCliComm::setAllowExternalCommands(), and openmsx::userFileContext().
void openmsx::Reactor::switchMachine | ( | const std::string & | machine | ) |
Definition at line 454 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 641 of file Reactor.cc.
References getMixer(), and openmsx::Mixer::unmute().
Referenced by openmsx::MSXCPUInterface::doContinue().
|
friend |
Definition at line 224 of file Reactor.hh.
|
friend |
Definition at line 221 of file Reactor.hh.
|
friend |
Definition at line 222 of file Reactor.hh.
|
friend |
Definition at line 223 of file Reactor.hh.
|
friend |
Definition at line 219 of file Reactor.hh.
|
friend |
Definition at line 226 of file Reactor.hh.
|
friend |
Definition at line 225 of file Reactor.hh.
|
friend |
Definition at line 220 of file Reactor.hh.