summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index d5554d917..b4e3ad964 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -20,7 +20,9 @@
20#include "debugger/callstack.hxx" 20#include "debugger/callstack.hxx"
21#include "debugger/ramview.hxx" 21#include "debugger/ramview.hxx"
22#include "debugger/graphics.hxx" 22#include "debugger/graphics.hxx"
23#include "debugger/graphics_breakpoints.hxx"
23#include "debugger/graphics_cmdlists.hxx" 24#include "debugger/graphics_cmdlists.hxx"
25#include "debugger/graphics_framebuffer.hxx"
24 26
25#include "core/settings.h" 27#include "core/settings.h"
26#include "core/system.h" 28#include "core/system.h"
@@ -36,6 +38,8 @@ GMainWindow::GMainWindow()
36{ 38{
37 LogManager::Init(); 39 LogManager::Init();
38 40
41 Pica::g_debug_context = Pica::DebugContext::Construct();
42
39 Config config; 43 Config config;
40 44
41 if (!Settings::values.enable_log) 45 if (!Settings::values.enable_log)
@@ -67,12 +71,22 @@ GMainWindow::GMainWindow()
67 addDockWidget(Qt::RightDockWidgetArea, graphicsCommandsWidget); 71 addDockWidget(Qt::RightDockWidgetArea, graphicsCommandsWidget);
68 graphicsCommandsWidget->hide(); 72 graphicsCommandsWidget->hide();
69 73
74 auto graphicsBreakpointsWidget = new GraphicsBreakPointsWidget(Pica::g_debug_context, this);
75 addDockWidget(Qt::RightDockWidgetArea, graphicsBreakpointsWidget);
76 graphicsBreakpointsWidget->hide();
77
78 auto graphicsFramebufferWidget = new GraphicsFramebufferWidget(Pica::g_debug_context, this);
79 addDockWidget(Qt::RightDockWidgetArea, graphicsFramebufferWidget);
80 graphicsFramebufferWidget->hide();
81
70 QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging")); 82 QMenu* debug_menu = ui.menu_View->addMenu(tr("Debugging"));
71 debug_menu->addAction(disasmWidget->toggleViewAction()); 83 debug_menu->addAction(disasmWidget->toggleViewAction());
72 debug_menu->addAction(registersWidget->toggleViewAction()); 84 debug_menu->addAction(registersWidget->toggleViewAction());
73 debug_menu->addAction(callstackWidget->toggleViewAction()); 85 debug_menu->addAction(callstackWidget->toggleViewAction());
74 debug_menu->addAction(graphicsWidget->toggleViewAction()); 86 debug_menu->addAction(graphicsWidget->toggleViewAction());
75 debug_menu->addAction(graphicsCommandsWidget->toggleViewAction()); 87 debug_menu->addAction(graphicsCommandsWidget->toggleViewAction());
88 debug_menu->addAction(graphicsBreakpointsWidget->toggleViewAction());
89 debug_menu->addAction(graphicsFramebufferWidget->toggleViewAction());
76 90
77 // Set default UI state 91 // Set default UI state
78 // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half 92 // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half
@@ -131,8 +145,10 @@ GMainWindow::GMainWindow()
131GMainWindow::~GMainWindow() 145GMainWindow::~GMainWindow()
132{ 146{
133 // will get automatically deleted otherwise 147 // will get automatically deleted otherwise
134 if (render_window->parent() == NULL) 148 if (render_window->parent() == nullptr)
135 delete render_window; 149 delete render_window;
150
151 Pica::g_debug_context.reset();
136} 152}
137 153
138void GMainWindow::BootGame(std::string filename) 154void GMainWindow::BootGame(std::string filename)
@@ -164,7 +180,7 @@ void GMainWindow::BootGame(std::string filename)
164 180
165void GMainWindow::OnMenuLoadFile() 181void GMainWindow::OnMenuLoadFile()
166{ 182{
167 QString filename = QFileDialog::getOpenFileName(this, tr("Load file"), QString(), tr("3DS executable (*.elf *.axf *.bin *.cci *.cxi)")); 183 QString filename = QFileDialog::getOpenFileName(this, tr("Load file"), QString(), tr("3DS executable (*.3dsx *.elf *.axf *.bin *.cci *.cxi)"));
168 if (filename.size()) 184 if (filename.size())
169 BootGame(filename.toLatin1().data()); 185 BootGame(filename.toLatin1().data());
170} 186}
@@ -213,14 +229,14 @@ void GMainWindow::OnOpenHotkeysDialog()
213void GMainWindow::ToggleWindowMode() 229void GMainWindow::ToggleWindowMode()
214{ 230{
215 bool enable = ui.action_Popout_Window_Mode->isChecked(); 231 bool enable = ui.action_Popout_Window_Mode->isChecked();
216 if (enable && render_window->parent() != NULL) 232 if (enable && render_window->parent() != nullptr)
217 { 233 {
218 ui.horizontalLayout->removeWidget(render_window); 234 ui.horizontalLayout->removeWidget(render_window);
219 render_window->setParent(NULL); 235 render_window->setParent(nullptr);
220 render_window->setVisible(true); 236 render_window->setVisible(true);
221 render_window->RestoreGeometry(); 237 render_window->RestoreGeometry();
222 } 238 }
223 else if (!enable && render_window->parent() == NULL) 239 else if (!enable && render_window->parent() == nullptr)
224 { 240 {
225 render_window->BackupGeometry(); 241 render_window->BackupGeometry();
226 ui.horizontalLayout->addWidget(render_window); 242 ui.horizontalLayout->addWidget(render_window);