From edb9a5ba3cdf967ca81f093a97885b1a04adee1e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 23 Nov 2022 21:21:20 +1000 Subject: [PATCH] Qt: Add -testconfig option --- pcsx2-qt/QtHost.cpp | 15 +++++++++++++++ pcsx2/MTVU.h | 1 + pcsx2/x86/microVU.cpp | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index 221ab5c8a7..3675c7a3bc 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -94,6 +94,7 @@ static bool s_batch_mode = false; static bool s_nogui_mode = false; static bool s_start_fullscreen_ui = false; static bool s_start_fullscreen_ui_fullscreen = false; +static bool s_test_config_and_exit = false; ////////////////////////////////////////////////////////////////////////// // CPU Thread @@ -1604,6 +1605,7 @@ void QtHost::PrintCommandLineHelp(const std::string_view& progname) std::fprintf(stderr, " -fullscreen: Enters fullscreen mode immediately after starting.\n"); std::fprintf(stderr, " -nofullscreen: Prevents fullscreen mode from triggering if enabled.\n"); std::fprintf(stderr, " -earlyconsolelog: Forces logging of early console messages to console.\n"); + std::fprintf(stderr, " -testconfig: Initializes configuration and checks version, then exits.\n"); #ifdef ENABLE_RAINTEGRATION std::fprintf(stderr, " -raintegration: Use RAIntegration instead of built-in achievement support.\n"); #endif @@ -1721,6 +1723,11 @@ bool QtHost::ParseCommandLineOptions(const QStringList& args, std::shared_ptrIsDirty()) + s_base_settings_interface->Save(); + // Ensure emulog is flushed. if (emuLog) { diff --git a/pcsx2/MTVU.h b/pcsx2/MTVU.h index fce40e786b..f48e33c131 100644 --- a/pcsx2/MTVU.h +++ b/pcsx2/MTVU.h @@ -66,6 +66,7 @@ public: ~VU_Thread(); __fi const Threading::ThreadHandle& GetThreadHandle() const { return m_thread; } + __fi bool IsOpen() const { return m_thread.Joinable(); } /// Ensures the VU thread is started. void Open(); diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index c48e0325ab..75eeb57aab 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -381,7 +381,8 @@ void recMicroVU0::Shutdown() } void recMicroVU1::Shutdown() { - vu1Thread.WaitVU(); + if (vu1Thread.IsOpen()) + vu1Thread.WaitVU(); mVUclose(microVU1); }