mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	citra-qt: service: add convenient LLE service module configuration (#3967)
* citra-qt: service: add convenient LLE service module configuration * fix SDL settings * unexpose AttemptLLE * static * fix array includes * use default with writesetting
This commit is contained in:
		
							parent
							
								
									dceb4150a8
								
							
						
					
					
						commit
						d09646ab9d
					
				
					 11 changed files with 171 additions and 40 deletions
				
			
		|  | @ -60,6 +60,8 @@ add_executable(citra-qt | |||
|     debugger/graphics/graphics_tracing.h | ||||
|     debugger/graphics/graphics_vertex_shader.cpp | ||||
|     debugger/graphics/graphics_vertex_shader.h | ||||
|     debugger/lle_service_modules.cpp | ||||
|     debugger/lle_service_modules.h | ||||
|     debugger/profiler.cpp | ||||
|     debugger/profiler.h | ||||
|     debugger/registers.cpp | ||||
|  |  | |||
|  | @ -2,10 +2,12 @@ | |||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <unordered_map> | ||||
| #include <QSettings> | ||||
| #include "citra_qt/configuration/config.h" | ||||
| #include "citra_qt/ui_settings.h" | ||||
| #include "common/file_util.h" | ||||
| #include "core/hle/service/service.h" | ||||
| #include "input_common/main.h" | ||||
| #include "input_common/udp/client.h" | ||||
| #include "network/network.h" | ||||
|  | @ -174,6 +176,13 @@ void Config::ReadValues() { | |||
|     qt_config->beginGroup("Debugging"); | ||||
|     Settings::values.use_gdbstub = ReadSetting("use_gdbstub", false).toBool(); | ||||
|     Settings::values.gdbstub_port = ReadSetting("gdbstub_port", 24689).toInt(); | ||||
| 
 | ||||
|     qt_config->beginGroup("LLE"); | ||||
|     for (const auto& service_module : Service::service_module_map) { | ||||
|         bool use_lle = ReadSetting(QString::fromStdString(service_module.name), false).toBool(); | ||||
|         Settings::values.lle_modules.emplace(service_module.name, use_lle); | ||||
|     } | ||||
|     qt_config->endGroup(); | ||||
|     qt_config->endGroup(); | ||||
| 
 | ||||
|     qt_config->beginGroup("WebService"); | ||||
|  | @ -403,6 +412,12 @@ void Config::SaveValues() { | |||
|     qt_config->beginGroup("Debugging"); | ||||
|     WriteSetting("use_gdbstub", Settings::values.use_gdbstub, false); | ||||
|     WriteSetting("gdbstub_port", Settings::values.gdbstub_port, 24689); | ||||
| 
 | ||||
|     qt_config->beginGroup("LLE"); | ||||
|     for (const auto& service_module : Settings::values.lle_modules) { | ||||
|         WriteSetting(QString::fromStdString(service_module.first), service_module.second, false); | ||||
|     } | ||||
|     qt_config->endGroup(); | ||||
|     qt_config->endGroup(); | ||||
| 
 | ||||
|     qt_config->beginGroup("WebService"); | ||||
|  |  | |||
							
								
								
									
										32
									
								
								src/citra_qt/debugger/lle_service_modules.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/citra_qt/debugger/lle_service_modules.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| // Copyright 2018 Citra Emulator Project
 | ||||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include <QCheckBox> | ||||
| #include <QLabel> | ||||
| #include <QLayout> | ||||
| #include <QScrollArea> | ||||
| #include "citra_qt/debugger/lle_service_modules.h" | ||||
| #include "core/settings.h" | ||||
| 
 | ||||
| LLEServiceModulesWidget::LLEServiceModulesWidget(QWidget* parent) | ||||
|     : QDockWidget(tr("Toggle LLE Service Modules"), parent) { | ||||
|     QScrollArea* scroll_area = new QScrollArea; | ||||
|     QLayout* scroll_layout = new QVBoxLayout; | ||||
|     for (const auto& service_module : Settings::values.lle_modules) { | ||||
|         QCheckBox* check_box = | ||||
|             new QCheckBox(QString::fromStdString(service_module.first), scroll_area); | ||||
|         check_box->setChecked(service_module.second); | ||||
|         connect(check_box, &QCheckBox::toggled, [check_box] { | ||||
|             Settings::values.lle_modules.find(check_box->text().toStdString())->second = | ||||
|                 check_box->isChecked(); | ||||
|         }); | ||||
|         scroll_layout->addWidget(check_box); | ||||
|     } | ||||
|     QWidget* scroll_area_contents = new QWidget; | ||||
|     scroll_area_contents->setLayout(scroll_layout); | ||||
|     scroll_area->setWidget(scroll_area_contents); | ||||
|     setWidget(scroll_area); | ||||
| } | ||||
| 
 | ||||
| LLEServiceModulesWidget::~LLEServiceModulesWidget() = default; | ||||
							
								
								
									
										15
									
								
								src/citra_qt/debugger/lle_service_modules.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/citra_qt/debugger/lle_service_modules.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| // Copyright 2018 Citra Emulator Project
 | ||||
| // Licensed under GPLv2 or any later version
 | ||||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <QDockWidget> | ||||
| 
 | ||||
| class LLEServiceModulesWidget : public QDockWidget { | ||||
|     Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|     explicit LLEServiceModulesWidget(QWidget* parent = nullptr); | ||||
|     ~LLEServiceModulesWidget(); | ||||
| }; | ||||
|  | @ -30,6 +30,7 @@ | |||
| #include "citra_qt/debugger/graphics/graphics_surface.h" | ||||
| #include "citra_qt/debugger/graphics/graphics_tracing.h" | ||||
| #include "citra_qt/debugger/graphics/graphics_vertex_shader.h" | ||||
| #include "citra_qt/debugger/lle_service_modules.h" | ||||
| #include "citra_qt/debugger/profiler.h" | ||||
| #include "citra_qt/debugger/registers.h" | ||||
| #include "citra_qt/debugger/wait_tree.h" | ||||
|  | @ -304,6 +305,15 @@ void GMainWindow::InitializeDebugWidgets() { | |||
|             &WaitTreeWidget::OnEmulationStarting); | ||||
|     connect(this, &GMainWindow::EmulationStopping, waitTreeWidget, | ||||
|             &WaitTreeWidget::OnEmulationStopping); | ||||
| 
 | ||||
|     lleServiceModulesWidget = new LLEServiceModulesWidget(this); | ||||
|     addDockWidget(Qt::RightDockWidgetArea, lleServiceModulesWidget); | ||||
|     lleServiceModulesWidget->hide(); | ||||
|     debug_menu->addAction(lleServiceModulesWidget->toggleViewAction()); | ||||
|     connect(this, &GMainWindow::EmulationStarting, | ||||
|             [this] { lleServiceModulesWidget->setDisabled(true); }); | ||||
|     connect(this, &GMainWindow::EmulationStopping, waitTreeWidget, | ||||
|             [this] { lleServiceModulesWidget->setDisabled(false); }); | ||||
| } | ||||
| 
 | ||||
| void GMainWindow::InitializeRecentFileMenuActions() { | ||||
|  |  | |||
|  | @ -28,6 +28,7 @@ class GraphicsBreakPointsWidget; | |||
| class GraphicsTracingWidget; | ||||
| class GraphicsVertexShaderWidget; | ||||
| class GRenderWindow; | ||||
| class LLEServiceModulesWidget; | ||||
| class MicroProfileDialog; | ||||
| class MultiplayerState; | ||||
| class ProfilerWidget; | ||||
|  | @ -217,6 +218,7 @@ private: | |||
|     GraphicsBreakPointsWidget* graphicsBreakpointsWidget; | ||||
|     GraphicsVertexShaderWidget* graphicsVertexShaderWidget; | ||||
|     GraphicsTracingWidget* graphicsTracingWidget; | ||||
|     LLEServiceModulesWidget* lleServiceModulesWidget; | ||||
|     WaitTreeWidget* waitTreeWidget; | ||||
|     Updater* updater; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue