diff --git a/Source/3rdParty/CMakeLists.txt b/Source/3rdParty/CMakeLists.txt index d727a3e3..117a280a 100644 --- a/Source/3rdParty/CMakeLists.txt +++ b/Source/3rdParty/CMakeLists.txt @@ -51,21 +51,21 @@ ExternalProject_Add(mupen64plus-audio-sdl DEPENDS mupen64plus-core ) -ExternalProject_Add(mupen64plus-rsp-hle - SOURCE_DIR mupen64plus-rsp-hle/ +ExternalProject_Add(mupen64plus-rsp-cxd4 + SOURCE_DIR mupen64plus-rsp-cxd4/ CONFIGURE_COMMAND "" INSTALL_COMMAND "" - GIT_REPOSITORY https://github.com/mupen64plus/mupen64plus-rsp-hle - GIT_TAG 72a1deca7d57f688cf20569790077bf7ab2cbe7c + GIT_REPOSITORY https://github.com/mupen64plus/mupen64plus-rsp-cxd4 + GIT_TAG 094c6642d0571b683571a27f3118749d03f37b13 - BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$ + BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$ SSE=SSE2 BUILD_IN_SOURCE False - BINARY_DIR ${THIRDPARTY_DIR}/mupen64plus-rsp-hle/projects/unix + BINARY_DIR ${THIRDPARTY_DIR}/mupen64plus-rsp-cxd4/projects/unix - BUILD_BYPRODUCTS ${THIRDPARTY_DIR}/mupen64plus-rsp-hle/projects/unix/mupen64plus-rsp-hle.${SO_EXT} + BUILD_BYPRODUCTS ${THIRDPARTY_DIR}/mupen64plus-rsp-cxd4/projects/unix/mupen64plus-rsp-cxd4-sse2.${SO_EXT} DEPENDS mupen64plus-core ) @@ -120,7 +120,7 @@ set(MUPEN64PLUSCORE_CHT ${M64P_CORE_DIR}/data/mupencheat.txt PARENT_SCOPE) ExternalProject_Get_property(mupen64plus-audio-sdl BUILD_BYPRODUCTS) set(MUPEN64PLUS_PLUGIN_AUDIO ${BUILD_BYPRODUCTS} PARENT_SCOPE) -ExternalProject_Get_property(mupen64plus-rsp-hle BUILD_BYPRODUCTS) +ExternalProject_Get_property(mupen64plus-rsp-cxd4 BUILD_BYPRODUCTS) set(MUPEN64PLUS_PLUGIN_RSP ${BUILD_BYPRODUCTS} PARENT_SCOPE) ExternalProject_Get_property(mupen64plus-input-raphnetraw BUILD_BYPRODUCTS) diff --git a/Source/RMG/M64P/Wrapper/Config.cpp b/Source/RMG/M64P/Wrapper/Config.cpp index 272a95a8..5c3bdcab 100644 --- a/Source/RMG/M64P/Wrapper/Config.cpp +++ b/Source/RMG/M64P/Wrapper/Config.cpp @@ -101,6 +101,20 @@ bool Config::GetOption(QString section, QString key, QString *value) return true; } +bool Config::Save(void) +{ + m64p_error ret; + + ret = M64P::Config.SaveFile(); + if (ret != M64ERR_SUCCESS) + { + this->error_Message = "Config::Save: M64P::Config.SaveFile Failed: "; + this->error_Message += M64P::Core.ErrorMessage(ret); + } + + return ret == M64ERR_SUCCESS; +} + bool Config::section_Open(QString section) { m64p_error ret; diff --git a/Source/RMG/M64P/Wrapper/Config.hpp b/Source/RMG/M64P/Wrapper/Config.hpp index 0a23020c..3c5dbfe2 100644 --- a/Source/RMG/M64P/Wrapper/Config.hpp +++ b/Source/RMG/M64P/Wrapper/Config.hpp @@ -37,6 +37,8 @@ namespace M64P bool GetOption(QString section, QString key, bool* value); bool GetOption(QString section, QString key, QString* value); + bool Save(void); + QString GetLastError(void); private: diff --git a/Source/RMG/M64P/Wrapper/Core.cpp b/Source/RMG/M64P/Wrapper/Core.cpp index a294ac38..51ac4faf 100644 --- a/Source/RMG/M64P/Wrapper/Core.cpp +++ b/Source/RMG/M64P/Wrapper/Core.cpp @@ -466,7 +466,7 @@ bool Core::emulation_SpeedLimited(bool enabled) int value = enabled ? 1 : 0; - ret = M64P::Core.DoCommand(M64CMD_CORE_STATE_SET, M64CORE_SPEED_LIMITER, &enabled); + ret = M64P::Core.DoCommand(M64CMD_CORE_STATE_SET, M64CORE_SPEED_LIMITER, &value); if (ret != M64ERR_SUCCESS) { this->error_Message = "Core::emulation_SpeedLimited: M64P::Core.DoCommand(M64CMD_CORE_STATE_SET) Failed: "; diff --git a/Source/RMG/M64P/Wrapper/VidExt.cpp b/Source/RMG/M64P/Wrapper/VidExt.cpp index 10ae7fc3..cca0e168 100644 --- a/Source/RMG/M64P/Wrapper/VidExt.cpp +++ b/Source/RMG/M64P/Wrapper/VidExt.cpp @@ -21,6 +21,8 @@ static QThread* renderThread; static bool ogl_setup = false; static void VidExt_OglSetup(void) { + std::cout << __FUNCTION__ << std::endl; + g_EmuThread->on_VidExt_SetupOGL(format, QThread::currentThread()); while (!g_OGLWidget->isValid()) @@ -83,20 +85,22 @@ m64p_error VidExt_ListRates(m64p_2d_size Size, int *NumRates, int *Rates) m64p_error VidExt_SetMode(int Width, int Height, int BitsPerPixel, int ScreenMode, int Flags) { + std::cout << __FUNCTION__ << std::endl; + if (!ogl_setup) VidExt_OglSetup(); - std::cout << __FUNCTION__ << std::endl; g_EmuThread->on_VidExt_SetMode(Width, Height, BitsPerPixel, ScreenMode, Flags); return M64ERR_SUCCESS; } m64p_error VidExt_SetModeWithRate(int Width, int Height, int RefreshRate, int BitsPerPixel, int ScreenMode, int Flags) { + std::cout << __FUNCTION__ << std::endl; + if (!ogl_setup) VidExt_OglSetup(); - std::cout << __FUNCTION__ << std::endl; g_EmuThread->on_VidExt_SetModeWithRate(Width, Height, RefreshRate, BitsPerPixel, ScreenMode, Flags); return M64ERR_SUCCESS; } @@ -261,7 +265,7 @@ m64p_error VidExt_ToggleFS(void) m64p_error VidExt_ResizeWindow(int Width, int Height) { - std::cout << "VidExt_ResizeWindow" << std::endl; + std::cout << __FUNCTION__ << std::endl; g_EmuThread->on_VidExt_ResizeWindow(Width, Height); return M64ERR_SUCCESS; } diff --git a/Source/RMG/UserInterface/MainWindow.cpp b/Source/RMG/UserInterface/MainWindow.cpp index cdd4e2c4..65080e51 100644 --- a/Source/RMG/UserInterface/MainWindow.cpp +++ b/Source/RMG/UserInterface/MainWindow.cpp @@ -55,7 +55,7 @@ bool MainWindow::Init(void) g_MupenApi.Core.GetPlugins(M64P::Wrapper::PluginType::Audio); g_MupenApi.Core.GetPlugins(M64P::Wrapper::PluginType::Input); - g_MupenApi.Config.SetOption("Core", "ScreenshotPath", "Screenshots"); + // g_MupenApi.Config.SetOption("Core", "ScreenshotPath", "Screenshots"); this->ui_Init(); this->ui_Setup(); @@ -273,6 +273,8 @@ void MainWindow::emulationThread_Connect(void) void MainWindow::emulationThread_Launch(QString file) { + g_MupenApi.Config.Save(); + this->emulationThread->SetRomFile(file); this->emulationThread->start(); } @@ -375,7 +377,7 @@ void MainWindow::menuBar_Actions_Setup(bool inEmulation, bool isPaused) this->action_Options_ConfigGfx->setEnabled(g_MupenApi.Core.HasPluginConfig(M64P::Wrapper::PluginType::Gfx)); this->action_Options_ConfigAudio->setText("Configure Audio Plugin..."); this->action_Options_ConfigAudio->setEnabled(g_MupenApi.Core.HasPluginConfig(M64P::Wrapper::PluginType::Audio)); - this->action_Options_ConfigRsp->setText("Configure RSP..."); + this->action_Options_ConfigRsp->setText("Configure RSP Plugin..."); this->action_Options_ConfigRsp->setEnabled(g_MupenApi.Core.HasPluginConfig(M64P::Wrapper::PluginType::Rsp)); this->action_Options_ConfigControl->setText("Configure Controller Plugin..."); this->action_Options_ConfigControl->setEnabled(g_MupenApi.Core.HasPluginConfig(M64P::Wrapper::PluginType::Input));