diff options
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index bf010a2ba..144f11117 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #include "core/settings.h" | 44 | #include "core/settings.h" |
| 45 | #include "core/system.h" | 45 | #include "core/system.h" |
| 46 | #include "core/arm/disassembler/load_symbol_map.h" | 46 | #include "core/arm/disassembler/load_symbol_map.h" |
| 47 | #include "core/gdbstub/gdbstub.h" | ||
| 47 | #include "core/loader/loader.h" | 48 | #include "core/loader/loader.h" |
| 48 | 49 | ||
| 49 | #include "video_core/video_core.h" | 50 | #include "video_core/video_core.h" |
| @@ -143,6 +144,11 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) | |||
| 143 | 144 | ||
| 144 | game_list->LoadInterfaceLayout(settings); | 145 | game_list->LoadInterfaceLayout(settings); |
| 145 | 146 | ||
| 147 | ui.action_Use_Gdbstub->setChecked(Settings::values.use_gdbstub); | ||
| 148 | SetGdbstubEnabled(ui.action_Use_Gdbstub->isChecked()); | ||
| 149 | |||
| 150 | GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port)); | ||
| 151 | |||
| 146 | ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer); | 152 | ui.action_Use_Hardware_Renderer->setChecked(Settings::values.use_hw_renderer); |
| 147 | SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked()); | 153 | SetHardwareRendererEnabled(ui.action_Use_Hardware_Renderer->isChecked()); |
| 148 | 154 | ||
| @@ -175,6 +181,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) | |||
| 175 | connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame())); | 181 | connect(ui.action_Stop, SIGNAL(triggered()), this, SLOT(OnStopGame())); |
| 176 | connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool))); | 182 | connect(ui.action_Use_Hardware_Renderer, SIGNAL(triggered(bool)), this, SLOT(SetHardwareRendererEnabled(bool))); |
| 177 | connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool))); | 183 | connect(ui.action_Use_Shader_JIT, SIGNAL(triggered(bool)), this, SLOT(SetShaderJITEnabled(bool))); |
| 184 | connect(ui.action_Use_Gdbstub, SIGNAL(triggered(bool)), this, SLOT(SetGdbstubEnabled(bool))); | ||
| 178 | connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode())); | 185 | connect(ui.action_Single_Window_Mode, SIGNAL(triggered(bool)), this, SLOT(ToggleWindowMode())); |
| 179 | connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); | 186 | connect(ui.action_Hotkeys, SIGNAL(triggered()), this, SLOT(OnOpenHotkeysDialog())); |
| 180 | 187 | ||
| @@ -201,7 +208,7 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) | |||
| 201 | 208 | ||
| 202 | show(); | 209 | show(); |
| 203 | 210 | ||
| 204 | game_list->PopulateAsync(settings.value("gameListRootDir").toString(), settings.value("gameListDeepScan").toBool()); | 211 | game_list->PopulateAsync(settings.value("gameListRootDir", ".").toString(), settings.value("gameListDeepScan", false).toBool()); |
| 205 | 212 | ||
| 206 | QStringList args = QApplication::arguments(); | 213 | QStringList args = QApplication::arguments(); |
| 207 | if (args.length() >= 2) { | 214 | if (args.length() >= 2) { |
| @@ -240,7 +247,7 @@ void GMainWindow::OnDisplayTitleBars(bool show) | |||
| 240 | } | 247 | } |
| 241 | 248 | ||
| 242 | void GMainWindow::BootGame(const std::string& filename) { | 249 | void GMainWindow::BootGame(const std::string& filename) { |
| 243 | LOG_INFO(Frontend, "Citra starting...\n"); | 250 | LOG_INFO(Frontend, "Citra starting..."); |
| 244 | 251 | ||
| 245 | // Shutdown previous session if the emu thread is still active... | 252 | // Shutdown previous session if the emu thread is still active... |
| 246 | if (emu_thread != nullptr) | 253 | if (emu_thread != nullptr) |
| @@ -355,7 +362,7 @@ void GMainWindow::UpdateRecentFiles() { | |||
| 355 | } | 362 | } |
| 356 | 363 | ||
| 357 | void GMainWindow::OnGameListLoadFile(QString game_path) { | 364 | void GMainWindow::OnGameListLoadFile(QString game_path) { |
| 358 | BootGame(game_path.toLatin1().data()); | 365 | BootGame(game_path.toLocal8Bit().data()); |
| 359 | } | 366 | } |
| 360 | 367 | ||
| 361 | void GMainWindow::OnMenuLoadFile() { | 368 | void GMainWindow::OnMenuLoadFile() { |
| @@ -367,7 +374,7 @@ void GMainWindow::OnMenuLoadFile() { | |||
| 367 | settings.setValue("romsPath", QFileInfo(filename).path()); | 374 | settings.setValue("romsPath", QFileInfo(filename).path()); |
| 368 | StoreRecentFile(filename); | 375 | StoreRecentFile(filename); |
| 369 | 376 | ||
| 370 | BootGame(filename.toLatin1().data()); | 377 | BootGame(filename.toLocal8Bit().data()); |
| 371 | } | 378 | } |
| 372 | } | 379 | } |
| 373 | 380 | ||
| @@ -379,7 +386,7 @@ void GMainWindow::OnMenuLoadSymbolMap() { | |||
| 379 | if (!filename.isEmpty()) { | 386 | if (!filename.isEmpty()) { |
| 380 | settings.setValue("symbolsPath", QFileInfo(filename).path()); | 387 | settings.setValue("symbolsPath", QFileInfo(filename).path()); |
| 381 | 388 | ||
| 382 | LoadSymbolMap(filename.toLatin1().data()); | 389 | LoadSymbolMap(filename.toLocal8Bit().data()); |
| 383 | } | 390 | } |
| 384 | } | 391 | } |
| 385 | 392 | ||
| @@ -400,7 +407,7 @@ void GMainWindow::OnMenuRecentFile() { | |||
| 400 | QString filename = action->data().toString(); | 407 | QString filename = action->data().toString(); |
| 401 | QFileInfo file_info(filename); | 408 | QFileInfo file_info(filename); |
| 402 | if (file_info.exists()) { | 409 | if (file_info.exists()) { |
| 403 | BootGame(filename.toLatin1().data()); | 410 | BootGame(filename.toLocal8Bit().data()); |
| 404 | StoreRecentFile(filename); // Put the filename on top of the list | 411 | StoreRecentFile(filename); // Put the filename on top of the list |
| 405 | } else { | 412 | } else { |
| 406 | // Display an error message and remove the file from the list. | 413 | // Display an error message and remove the file from the list. |
| @@ -443,10 +450,22 @@ void GMainWindow::OnOpenHotkeysDialog() { | |||
| 443 | 450 | ||
| 444 | void GMainWindow::SetHardwareRendererEnabled(bool enabled) { | 451 | void GMainWindow::SetHardwareRendererEnabled(bool enabled) { |
| 445 | VideoCore::g_hw_renderer_enabled = enabled; | 452 | VideoCore::g_hw_renderer_enabled = enabled; |
| 453 | |||
| 454 | Config config; | ||
| 455 | Settings::values.use_hw_renderer = enabled; | ||
| 456 | config.Save(); | ||
| 457 | } | ||
| 458 | |||
| 459 | void GMainWindow::SetGdbstubEnabled(bool enabled) { | ||
| 460 | GDBStub::ToggleServer(enabled); | ||
| 446 | } | 461 | } |
| 447 | 462 | ||
| 448 | void GMainWindow::SetShaderJITEnabled(bool enabled) { | 463 | void GMainWindow::SetShaderJITEnabled(bool enabled) { |
| 449 | VideoCore::g_shader_jit_enabled = enabled; | 464 | VideoCore::g_shader_jit_enabled = enabled; |
| 465 | |||
| 466 | Config config; | ||
| 467 | Settings::values.use_shader_jit = enabled; | ||
| 468 | config.Save(); | ||
| 450 | } | 469 | } |
| 451 | 470 | ||
| 452 | void GMainWindow::ToggleWindowMode() { | 471 | void GMainWindow::ToggleWindowMode() { |