diff --git a/mupen64plus-gui/README.md b/mupen64plus-gui/README.md index 18a25a3..ca65bee 100644 --- a/mupen64plus-gui/README.md +++ b/mupen64plus-gui/README.md @@ -7,7 +7,7 @@ It supports everything you'd expect from a mupen64plus frontend (plugin selection, configuration editing, save state management, screenshots, pausing, etc). You can try this out by downloading [**m64p**](https://m64p.github.io/). -**m64p** is mupen64plus + GLideN64 + this GUI +**m64p** is mupen64plus + ParaLLEl + this GUI It is [free/libre software](https://www.fsf.org/blogs/rms/20140407-geneva-tedx-talk-free-software-free-society) under [license GPL](https://www.gnu.org/licenses/gpl)v3.0. @@ -15,7 +15,7 @@ Enjoy and happy hacking! ## Dependencies -- [Qt](https://www.qt.io/) 5.4 +- [Qt](https://www.qt.io/) 5.10 (this comes statically linked with the Windows binary build in m64p, so you don't need to worry about this on Windows) - [SDL2](https://www.libsdl.org/) ***Your copy of mupen64plus-core (libmupen64plus.so.2) also needs to be linked against SDL2*** - 7za binary must be installed on your system for 7z/zip support diff --git a/mupen64plus-gui/mainwindow.cpp b/mupen64plus-gui/mainwindow.cpp index c29f992..698f84a 100644 --- a/mupen64plus-gui/mainwindow.cpp +++ b/mupen64plus-gui/mainwindow.cpp @@ -50,42 +50,6 @@ void MainWindow::updatePlugins() QStringList current; QString default_value; - if (!settings->contains("videoPlugin")) { - Filter.replace(0,"mupen64plus-video*"); - current = PluginDir.entryList(Filter); - default_value = "mupen64plus-video-GLideN64"; - default_value += OSAL_DLL_EXTENSION; - if (current.isEmpty()) - settings->setValue("videoPlugin", "dummy"); - else if (current.indexOf(default_value) != -1) - settings->setValue("videoPlugin", default_value); - else - settings->setValue("videoPlugin", current.at(0)); - } - if (!settings->contains("audioPlugin")) { - Filter.replace(0,"mupen64plus-audio*"); - current = PluginDir.entryList(Filter); - default_value = "mupen64plus-audio-sdl2"; - default_value += OSAL_DLL_EXTENSION; - if (current.isEmpty()) - settings->setValue("audioPlugin", "dummy"); - else if (current.indexOf(default_value) != -1) - settings->setValue("audioPlugin", default_value); - else - settings->setValue("audioPlugin", current.at(0)); - } - if (!settings->contains("rspPlugin")) { - Filter.replace(0,"mupen64plus-rsp*"); - current = PluginDir.entryList(Filter); - default_value = "mupen64plus-rsp-hle"; - default_value += OSAL_DLL_EXTENSION; - if (current.isEmpty()) - settings->setValue("rspPlugin", "dummy"); - else if (current.indexOf(default_value) != -1) - settings->setValue("rspPlugin", default_value); - else - settings->setValue("rspPlugin", current.at(0)); - } if (!settings->contains("inputPlugin")) { Filter.replace(0,"mupen64plus-input*"); current = PluginDir.entryList(Filter); @@ -430,8 +394,6 @@ MainWindow::MainWindow(QWidget *parent) : loadCoreLib(); loadPlugins(); - setupLLE(); - if (coreLib) { m64p_handle coreConfigHandle; @@ -464,55 +426,6 @@ void MainWindow::updateApp() #endif } -void MainWindow::setupLLE() -{ - if (!settings->contains("LLE")) - { - settings->setValue("LLE", 0); - } - - ui->actionVideo_Settings->setEnabled(!settings->value("LLE").toInt()); - ui->actionLLE_Graphics->setChecked(settings->value("LLE").toInt()); - - if (coreLib) - { - m64p_handle lionConfigHandle; - m64p_error res = (*ConfigOpenSection)("Video-Angrylion-Plus", &lionConfigHandle); - if (res == M64ERR_SUCCESS) - { - int vimode = (*ConfigGetParamInt)(lionConfigHandle, "ViMode"); - ui->actionVI_Filter->setChecked(!vimode); - } - } - ui->actionVI_Filter->setEnabled(settings->value("LLE").toInt()); - - connect(ui->actionLLE_Graphics, &QAction::toggled, - [=]( bool checked ) { - settings->setValue("LLE", checked ? 1 : 0); - ui->actionVI_Filter->setEnabled(checked); - ui->actionVideo_Settings->setEnabled(!checked); - if (coreLib) - { - int response; - (*CoreDoCommand)(M64CMD_CORE_STATE_QUERY, M64CORE_EMU_STATE, &response); - if (response == M64EMU_STOPPED) - resetCore(); - } - }); - - connect(ui->actionVI_Filter, &QAction::toggled, - [=]( bool checked ) { - m64p_handle lionConfigHandle; - m64p_error res = (*ConfigOpenSection)("Video-Angrylion-Plus", &lionConfigHandle); - if (res == M64ERR_SUCCESS) - { - int vimode = checked == true ? 0 : 1; - (*ConfigSetParameter)(lionConfigHandle, "ViMode", M64TYPE_INT, &vimode); - } - }); - -} - void MainWindow::setupDiscord() { QLibrary *discordLib = new QLibrary((QDir(QCoreApplication::applicationDirPath()).filePath("discord_game_sdk")), this); @@ -1013,14 +926,6 @@ void MainWindow::on_actionView_Log_triggered() logViewer.show(); } -void MainWindow::on_actionVideo_Settings_triggered() -{ - typedef void (*Config_Func)(); - Config_Func PluginConfig = (Config_Func) osal_dynlib_getproc(gfxPlugin, "PluginConfig"); - if (PluginConfig) - PluginConfig(); -} - void MainWindow::on_actionCreate_Room_triggered() { CreateRoom *createRoom = new CreateRoom(this); @@ -1118,7 +1023,7 @@ void MainWindow::loadCoreLib() ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(coreLib, "ConfigGetUserConfigPath"); ConfigSaveFile = (ptr_ConfigSaveFile) osal_dynlib_getproc(coreLib, "ConfigSaveFile"); - ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(coreLib, "ConfigSaveFile"); + ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(coreLib, "ConfigGetParameterHelp"); ConfigGetParamInt = (ptr_ConfigGetParamInt) osal_dynlib_getproc(coreLib, "ConfigGetParamInt"); ConfigGetParamFloat = (ptr_ConfigGetParamFloat) osal_dynlib_getproc(coreLib, "ConfigGetParamFloat"); ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(coreLib, "ConfigGetParamBool"); @@ -1187,16 +1092,13 @@ void MainWindow::loadPlugins() QString pluginPath = settings->value("pluginDirPath").toString(); pluginPath.replace("$APP_PATH$", QCoreApplication::applicationDirPath()); - QString lle_path; + QString file_path; QString plugin_path; - if (settings->value("LLE").toInt()) - { - lle_path = "mupen64plus-video-angrylion-plus"; - lle_path += OSAL_DLL_EXTENSION; - plugin_path = QDir(pluginPath).filePath(lle_path); - } - else - plugin_path = QDir(pluginPath).filePath(settings->value("videoPlugin").toString()); + + file_path = "mupen64plus-video-parallel"; + file_path += OSAL_DLL_EXTENSION; + plugin_path = QDir(pluginPath).filePath(file_path); + res = osal_dynlib_open(&gfxPlugin, plugin_path.toUtf8().constData()); if (res != M64ERR_SUCCESS) { @@ -1206,7 +1108,12 @@ void MainWindow::loadPlugins() } PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(gfxPlugin, "PluginStartup"); (*PluginStartup)(coreLib, (char*)"Video", DebugCallback); - res = osal_dynlib_open(&audioPlugin, QDir(pluginPath).filePath(settings->value("audioPlugin").toString()).toUtf8().constData()); + + file_path = "mupen64plus-audio-sdl2"; + file_path += OSAL_DLL_EXTENSION; + plugin_path = QDir(pluginPath).filePath(file_path); + + res = osal_dynlib_open(&audioPlugin, plugin_path.toUtf8().constData()); if (res != M64ERR_SUCCESS) { msgBox.setText("Failed to load audio plugin"); @@ -1215,6 +1122,7 @@ void MainWindow::loadPlugins() } PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(audioPlugin, "PluginStartup"); (*PluginStartup)(coreLib, (char*)"Audio", DebugCallback); + res = osal_dynlib_open(&inputPlugin, QDir(pluginPath).filePath(settings->value("inputPlugin").toString()).toUtf8().constData()); if (res != M64ERR_SUCCESS) { @@ -1228,14 +1136,11 @@ void MainWindow::loadPlugins() else (*PluginStartup)(coreLib, (char*)"Input", DebugCallback); - if (settings->value("LLE").toInt()) - { - lle_path = "mupen64plus-rsp-parallel"; - lle_path += OSAL_DLL_EXTENSION; - plugin_path = QDir(pluginPath).filePath(lle_path); - } - else - plugin_path = QDir(pluginPath).filePath(settings->value("rspPlugin").toString()); + + file_path = "mupen64plus-rsp-parallel"; + file_path += OSAL_DLL_EXTENSION; + plugin_path = QDir(pluginPath).filePath(file_path); + res = osal_dynlib_open(&rspPlugin, plugin_path.toUtf8().constData()); if (res != M64ERR_SUCCESS) { diff --git a/mupen64plus-gui/mainwindow.h b/mupen64plus-gui/mainwindow.h index e99b1c7..0671215 100644 --- a/mupen64plus-gui/mainwindow.h +++ b/mupen64plus-gui/mainwindow.h @@ -119,8 +119,6 @@ private slots: void on_actionView_Log_triggered(); - void on_actionVideo_Settings_triggered(); - void on_actionCreate_Room_triggered(); void on_actionJoin_Room_triggered(); @@ -130,7 +128,6 @@ private slots: void on_actionOpen_Discord_Channel_triggered(); private: - void setupLLE(); void setupDiscord(); void stopGame(); void updateOpenRecent(); diff --git a/mupen64plus-gui/mainwindow.ui b/mupen64plus-gui/mainwindow.ui index 12f5a3f..a329847 100644 --- a/mupen64plus-gui/mainwindow.ui +++ b/mupen64plus-gui/mainwindow.ui @@ -20,7 +20,7 @@ 0 0 640 - 32 + 22 @@ -47,10 +47,6 @@ - - - - @@ -105,7 +101,7 @@ - Advanced Settings + Core and Video Settings @@ -183,11 +179,6 @@ View Log - - - Video Settings - - Create Room @@ -208,22 +199,6 @@ Join Discord Channel - - - true - - - LLE Graphics - - - - - true - - - VI Filter - - diff --git a/mupen64plus-gui/netplay/createroom.cpp b/mupen64plus-gui/netplay/createroom.cpp index fe4642f..a5aa086 100644 --- a/mupen64plus-gui/netplay/createroom.cpp +++ b/mupen64plus-gui/netplay/createroom.cpp @@ -195,7 +195,7 @@ void CreateRoom::createRoom() json.insert("game_name", QString(rom_settings.goodname)); json.insert("client_sha", QStringLiteral(GUI_VERSION)); json.insert("netplay_version", NETPLAY_VER); - json.insert("lle", w->getSettings()->value("LLE").toInt() ? "Yes" : "No"); + json.insert("lle", "Yes"); json.insert("use_input_delay", useInputDelay->isChecked()); if (useInputDelay->isChecked()) json.insert("input_delay", inputDelay->text().toInt()); diff --git a/mupen64plus-gui/netplay/joinroom.cpp b/mupen64plus-gui/netplay/joinroom.cpp index ce3393a..369192b 100644 --- a/mupen64plus-gui/netplay/joinroom.cpp +++ b/mupen64plus-gui/netplay/joinroom.cpp @@ -175,18 +175,6 @@ void JoinRoom::joinGame() msgBox.setText("ROM does not match room ROM"); msgBox.exec(); } - else if (json.value("lle").toString() == "Yes" && w->getSettings()->value("LLE").toInt() != 1) - { - (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); - msgBox.setText("You must enable LLE graphics"); - msgBox.exec(); - } - else if (json.value("lle").toString() == "No" && w->getSettings()->value("LLE").toInt() != 0) - { - (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); - msgBox.setText("You must disable LLE graphics"); - msgBox.exec(); - } else if (roomRequiresInputDelay && inputDelay->text().isEmpty()) { (*CoreDoCommand)(M64CMD_ROM_CLOSE, 0, NULL); diff --git a/mupen64plus-gui/plugindialog.cpp b/mupen64plus-gui/plugindialog.cpp index 399aa83..a25af26 100644 --- a/mupen64plus-gui/plugindialog.cpp +++ b/mupen64plus-gui/plugindialog.cpp @@ -12,8 +12,11 @@ #include "settingclasses.h" m64p_handle coreConfigHandle; +m64p_handle videoConfigHandle; QGridLayout *coreLayout; int coreLayoutRow; +QGridLayout *videoLayout; +int videoRow; static void paramListCallback(void * context, const char *ParamName, m64p_type ParamType) { @@ -24,6 +27,10 @@ static void paramListCallback(void * context, const char *ParamName, m64p_type P my_layout = coreLayout; my_row = &coreLayoutRow; current_handle = coreConfigHandle; + } else if (strcmp((char*)context, "Video") == 0) { + my_layout = videoLayout; + my_row = &videoRow; + current_handle = videoConfigHandle; } int l_ParamInt; bool l_ParamBool; @@ -90,7 +97,7 @@ void PluginDialog::handleResetButton() (*CoreDoCommand)(M64CMD_CORE_STATE_QUERY, M64CORE_EMU_STATE, &value); if (value == M64EMU_STOPPED) { (*ConfigDeleteSection)("Core"); - (*ConfigDeleteSection)("Video-General"); + (*ConfigDeleteSection)("Video-Parallel"); (*ConfigSaveFile)(); w->resetCore(); this->close(); @@ -115,7 +122,7 @@ PluginDialog::PluginDialog(QWidget *parent) tabWidget->setUsesScrollButtons(false); QWidget *coreSettings = new QWidget(this); - coreLayout = new QGridLayout(this); + coreLayout = new QGridLayout(coreSettings); coreSettings->setLayout(coreLayout); res = (*ConfigOpenSection)("Core", &coreConfigHandle); if (res == M64ERR_SUCCESS) @@ -126,6 +133,18 @@ PluginDialog::PluginDialog(QWidget *parent) coreScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); tabWidget->addTab(coreScroll, tr("Core")); + QWidget *videoSettings = new QWidget(this); + videoLayout = new QGridLayout(videoSettings); + videoSettings->setLayout(videoLayout); + res = (*ConfigOpenSection)("Video-Parallel", &videoConfigHandle); + if (res == M64ERR_SUCCESS) + (*ConfigListParameters)(videoConfigHandle, (char*)"Video", paramListCallback); + QScrollArea *videoScroll = new QScrollArea(this); + videoScroll->setWidget(videoSettings); + videoScroll->setMinimumWidth(videoSettings->sizeHint().width() + 20); + videoScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + tabWidget->addTab(videoScroll, tr("ParaLLEl Video")); + QLabel *myLabel = new QLabel("Hover your mouse over the configuration item name for a description.\n", this); myLabel->setStyleSheet("font-weight: bold"); mainLayout->addWidget(myLabel); diff --git a/mupen64plus-gui/settingsdialog.cpp b/mupen64plus-gui/settingsdialog.cpp index 8bfdf30..0fce986 100644 --- a/mupen64plus-gui/settingsdialog.cpp +++ b/mupen64plus-gui/settingsdialog.cpp @@ -28,9 +28,6 @@ void SettingsDialog::handlePluginButton() w->getSettings()->setValue("pluginDirPath", fileName); w->getSettings()->remove("inputPlugin"); - w->getSettings()->remove("videoPlugin"); - w->getSettings()->remove("audioPlugin"); - w->getSettings()->remove("rspPlugin"); w->updatePlugins(); } } @@ -63,9 +60,6 @@ void SettingsDialog::handlePluginEdit() w->getSettings()->setValue("pluginDirPath", pluginPath->text()); w->getSettings()->remove("inputPlugin"); - w->getSettings()->remove("videoPlugin"); - w->getSettings()->remove("audioPlugin"); - w->getSettings()->remove("rspPlugin"); w->updatePlugins(); }