Qt: Fix changing whether a BIOS is used while the game is running

This commit is contained in:
Jeffrey Pfau 2015-08-13 20:01:59 -07:00
parent 4fd479897c
commit 0eb76806be
2 changed files with 12 additions and 2 deletions

View File

@ -670,9 +670,14 @@ void GameController::setSkipBIOS(bool set) {
} }
void GameController::setUseBIOS(bool use) { void GameController::setUseBIOS(bool use) {
threadInterrupt(); if (use == m_useBios) {
return;
}
m_useBios = use; m_useBios = use;
threadContinue(); if (m_gameOpen) {
closeGame();
openGame();
}
} }
void GameController::loadState(int slot) { void GameController::loadState(int slot) {

View File

@ -1123,6 +1123,11 @@ void Window::setupMenu(QMenuBar* menubar) {
m_controller->setSkipBIOS(value.toBool()); m_controller->setSkipBIOS(value.toBool());
}, this); }, this);
ConfigOption* useBios = m_config->addOption("useBios");
useBios->connect([this](const QVariant& value) {
m_controller->setUseBIOS(value.toBool());
}, this);
ConfigOption* buffers = m_config->addOption("audioBuffers"); ConfigOption* buffers = m_config->addOption("audioBuffers");
buffers->connect([this](const QVariant& value) { buffers->connect([this](const QVariant& value) {
emit audioBufferSamplesChanged(value.toInt()); emit audioBufferSamplesChanged(value.toInt());