summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/debugger
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra_qt/debugger/callstack.cpp2
-rw-r--r--src/citra_qt/debugger/callstack.h4
-rw-r--r--src/citra_qt/debugger/disassembler.cpp10
-rw-r--r--src/citra_qt/debugger/disassembler.h6
-rw-r--r--src/citra_qt/debugger/graphics/graphics.cpp (renamed from src/citra_qt/debugger/graphics.cpp)18
-rw-r--r--src/citra_qt/debugger/graphics/graphics.h (renamed from src/citra_qt/debugger/graphics.h)2
-rw-r--r--src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp (renamed from src/citra_qt/debugger/graphics_breakpoint_observer.cpp)2
-rw-r--r--src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h (renamed from src/citra_qt/debugger/graphics_breakpoint_observer.h)0
-rw-r--r--src/citra_qt/debugger/graphics/graphics_breakpoints.cpp (renamed from src/citra_qt/debugger/graphics_breakpoints.cpp)4
-rw-r--r--src/citra_qt/debugger/graphics/graphics_breakpoints.h (renamed from src/citra_qt/debugger/graphics_breakpoints.h)4
-rw-r--r--src/citra_qt/debugger/graphics/graphics_breakpoints_p.h (renamed from src/citra_qt/debugger/graphics_breakpoints_p.h)0
-rw-r--r--src/citra_qt/debugger/graphics/graphics_cmdlists.cpp (renamed from src/citra_qt/debugger/graphics_cmdlists.cpp)44
-rw-r--r--src/citra_qt/debugger/graphics/graphics_cmdlists.h (renamed from src/citra_qt/debugger/graphics_cmdlists.h)4
-rw-r--r--src/citra_qt/debugger/graphics/graphics_surface.cpp (renamed from src/citra_qt/debugger/graphics_surface.cpp)2
-rw-r--r--src/citra_qt/debugger/graphics/graphics_surface.h (renamed from src/citra_qt/debugger/graphics_surface.h)9
-rw-r--r--src/citra_qt/debugger/graphics/graphics_tracing.cpp (renamed from src/citra_qt/debugger/graphics_tracing.cpp)2
-rw-r--r--src/citra_qt/debugger/graphics/graphics_tracing.h (renamed from src/citra_qt/debugger/graphics_tracing.h)6
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp (renamed from src/citra_qt/debugger/graphics_vertex_shader.cpp)2
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.h (renamed from src/citra_qt/debugger/graphics_vertex_shader.h)4
-rw-r--r--src/citra_qt/debugger/profiler.h6
-rw-r--r--src/citra_qt/debugger/ramview.h4
-rw-r--r--src/citra_qt/debugger/registers.cpp16
-rw-r--r--src/citra_qt/debugger/registers.h4
-rw-r--r--src/citra_qt/debugger/wait_tree.cpp6
-rw-r--r--src/citra_qt/debugger/wait_tree.h26
25 files changed, 101 insertions, 86 deletions
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp
index c66f2b96a..c1db93583 100644
--- a/src/citra_qt/debugger/callstack.cpp
+++ b/src/citra_qt/debugger/callstack.cpp
@@ -25,7 +25,7 @@ CallstackWidget::CallstackWidget(QWidget* parent) : QDockWidget(parent) {
void CallstackWidget::OnDebugModeEntered() {
// Stack pointer
- const u32 sp = Core::g_app_core->GetReg(13);
+ const u32 sp = Core::CPU().GetReg(13);
Clear();
diff --git a/src/citra_qt/debugger/callstack.h b/src/citra_qt/debugger/callstack.h
index 765757986..f04ab9c7e 100644
--- a/src/citra_qt/debugger/callstack.h
+++ b/src/citra_qt/debugger/callstack.h
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#pragma once
+
#include <QDockWidget>
#include "ui_callstack.h"
@@ -11,7 +13,7 @@ class CallstackWidget : public QDockWidget {
Q_OBJECT
public:
- CallstackWidget(QWidget* parent = nullptr);
+ explicit CallstackWidget(QWidget* parent = nullptr);
public slots:
void OnDebugModeEntered();
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp
index 1ee6bbd6a..e9c8ad858 100644
--- a/src/citra_qt/debugger/disassembler.cpp
+++ b/src/citra_qt/debugger/disassembler.cpp
@@ -185,13 +185,13 @@ DisassemblerWidget::DisassemblerWidget(QWidget* parent, EmuThread* emu_thread)
}
void DisassemblerWidget::Init() {
- model->ParseFromAddress(Core::g_app_core->GetPC());
+ model->ParseFromAddress(Core::CPU().GetPC());
disasm_ui.treeView->resizeColumnToContents(0);
disasm_ui.treeView->resizeColumnToContents(1);
disasm_ui.treeView->resizeColumnToContents(2);
- QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::g_app_core->GetPC());
+ QModelIndex model_index = model->IndexFromAbsoluteAddress(Core::CPU().GetPC());
disasm_ui.treeView->scrollTo(model_index);
disasm_ui.treeView->selectionModel()->setCurrentIndex(
model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
@@ -214,8 +214,8 @@ void DisassemblerWidget::OnPause() {
emu_thread->SetRunning(false);
// TODO: By now, the CPU might not have actually stopped...
- if (Core::g_app_core) {
- model->SetNextInstruction(Core::g_app_core->GetPC());
+ if (Core::System::GetInstance().IsPoweredOn()) {
+ model->SetNextInstruction(Core::CPU().GetPC());
}
}
@@ -224,7 +224,7 @@ void DisassemblerWidget::OnToggleStartStop() {
}
void DisassemblerWidget::OnDebugModeEntered() {
- u32 next_instr = Core::g_app_core->GetPC();
+ u32 next_instr = Core::CPU().GetPC();
if (model->GetBreakPoints().IsAddressBreakPoint(next_instr))
emu_thread->SetRunning(false);
diff --git a/src/citra_qt/debugger/disassembler.h b/src/citra_qt/debugger/disassembler.h
index 2ca6c2bd4..a6e59515c 100644
--- a/src/citra_qt/debugger/disassembler.h
+++ b/src/citra_qt/debugger/disassembler.h
@@ -17,7 +17,7 @@ class DisassemblerModel : public QAbstractListModel {
Q_OBJECT
public:
- DisassemblerModel(QObject* parent);
+ explicit DisassemblerModel(QObject* parent);
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
@@ -38,9 +38,7 @@ private:
unsigned int program_counter;
QModelIndex selection;
-
- // TODO: Make BreakPoints less crappy (i.e. const-correct) so that this needn't be mutable.
- mutable BreakPoints breakpoints;
+ BreakPoints breakpoints;
};
class DisassemblerWidget : public QDockWidget {
diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics/graphics.cpp
index ef6712bfa..6a76adeae 100644
--- a/src/citra_qt/debugger/graphics.cpp
+++ b/src/citra_qt/debugger/graphics/graphics.cpp
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include <QListView>
-#include "citra_qt/debugger/graphics.h"
+#include "citra_qt/debugger/graphics/graphics.h"
#include "citra_qt/util/util.h"
extern GraphicsDebugger g_debugger;
@@ -22,15 +22,15 @@ QVariant GPUCommandStreamItemModel::data(const QModelIndex& index, int role) con
return QVariant();
int command_index = index.row();
- const GSP_GPU::Command& command = GetDebugger()->ReadGXCommandHistory(command_index);
+ const Service::GSP::Command& command = GetDebugger()->ReadGXCommandHistory(command_index);
if (role == Qt::DisplayRole) {
- std::map<GSP_GPU::CommandId, const char*> command_names = {
- {GSP_GPU::CommandId::REQUEST_DMA, "REQUEST_DMA"},
- {GSP_GPU::CommandId::SUBMIT_GPU_CMDLIST, "SUBMIT_GPU_CMDLIST"},
- {GSP_GPU::CommandId::SET_MEMORY_FILL, "SET_MEMORY_FILL"},
- {GSP_GPU::CommandId::SET_DISPLAY_TRANSFER, "SET_DISPLAY_TRANSFER"},
- {GSP_GPU::CommandId::SET_TEXTURE_COPY, "SET_TEXTURE_COPY"},
- {GSP_GPU::CommandId::CACHE_FLUSH, "CACHE_FLUSH"},
+ std::map<Service::GSP::CommandId, const char*> command_names = {
+ {Service::GSP::CommandId::REQUEST_DMA, "REQUEST_DMA"},
+ {Service::GSP::CommandId::SUBMIT_GPU_CMDLIST, "SUBMIT_GPU_CMDLIST"},
+ {Service::GSP::CommandId::SET_MEMORY_FILL, "SET_MEMORY_FILL"},
+ {Service::GSP::CommandId::SET_DISPLAY_TRANSFER, "SET_DISPLAY_TRANSFER"},
+ {Service::GSP::CommandId::SET_TEXTURE_COPY, "SET_TEXTURE_COPY"},
+ {Service::GSP::CommandId::CACHE_FLUSH, "CACHE_FLUSH"},
};
const u32* command_data = reinterpret_cast<const u32*>(&command);
QString str = QString("%1 %2 %3 %4 %5 %6 %7 %8 %9")
diff --git a/src/citra_qt/debugger/graphics.h b/src/citra_qt/debugger/graphics/graphics.h
index bedf3e596..8837fb792 100644
--- a/src/citra_qt/debugger/graphics.h
+++ b/src/citra_qt/debugger/graphics/graphics.h
@@ -13,7 +13,7 @@ class GPUCommandStreamItemModel : public QAbstractListModel,
Q_OBJECT
public:
- GPUCommandStreamItemModel(QObject* parent);
+ explicit GPUCommandStreamItemModel(QObject* parent);
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp
index e01d3440e..dc6070dea 100644
--- a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp
@@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#include <QMetaType>
-#include "citra_qt/debugger/graphics_breakpoint_observer.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"
BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context,
const QString& title, QWidget* parent)
diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.h b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h
index e77df4f5b..e77df4f5b 100644
--- a/src/citra_qt/debugger/graphics_breakpoint_observer.h
+++ b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h
diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp
index d2a036dfa..030828ba8 100644
--- a/src/citra_qt/debugger/graphics_breakpoints.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp
@@ -7,8 +7,8 @@
#include <QPushButton>
#include <QTreeView>
#include <QVBoxLayout>
-#include "citra_qt/debugger/graphics_breakpoints.h"
-#include "citra_qt/debugger/graphics_breakpoints_p.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoints.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoints_p.h"
#include "common/assert.h"
BreakPointModel::BreakPointModel(std::shared_ptr<Pica::DebugContext> debug_context, QObject* parent)
diff --git a/src/citra_qt/debugger/graphics_breakpoints.h b/src/citra_qt/debugger/graphics/graphics_breakpoints.h
index 5fc40c916..bec72a2db 100644
--- a/src/citra_qt/debugger/graphics_breakpoints.h
+++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.h
@@ -20,8 +20,8 @@ class GraphicsBreakPointsWidget : public QDockWidget, Pica::DebugContext::BreakP
using Event = Pica::DebugContext::Event;
public:
- GraphicsBreakPointsWidget(std::shared_ptr<Pica::DebugContext> debug_context,
- QWidget* parent = nullptr);
+ explicit GraphicsBreakPointsWidget(std::shared_ptr<Pica::DebugContext> debug_context,
+ QWidget* parent = nullptr);
void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override;
void OnPicaResume() override;
diff --git a/src/citra_qt/debugger/graphics_breakpoints_p.h b/src/citra_qt/debugger/graphics/graphics_breakpoints_p.h
index dc64706bd..dc64706bd 100644
--- a/src/citra_qt/debugger/graphics_breakpoints_p.h
+++ b/src/citra_qt/debugger/graphics/graphics_breakpoints_p.h
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
index 8a784d108..dab529e3a 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
@@ -13,7 +13,7 @@
#include <QSpinBox>
#include <QTreeView>
#include <QVBoxLayout>
-#include "citra_qt/debugger/graphics_cmdlists.h"
+#include "citra_qt/debugger/graphics/graphics_cmdlists.h"
#include "citra_qt/util/spinbox.h"
#include "citra_qt/util/util.h"
#include "common/vector_math.h"
@@ -21,7 +21,8 @@
#include "video_core/pica.h"
#include "video_core/pica_state.h"
-QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) {
+namespace {
+QImage LoadTexture(const u8* src, const Pica::DebugUtils::TextureInfo& info) {
QImage decoded_image(info.width, info.height, QImage::Format_ARGB32);
for (int y = 0; y < info.height; ++y) {
for (int x = 0; x < info.width; ++x) {
@@ -35,7 +36,8 @@ QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) {
class TextureInfoWidget : public QWidget {
public:
- TextureInfoWidget(u8* src, const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr)
+ TextureInfoWidget(const u8* src, const Pica::DebugUtils::TextureInfo& info,
+ QWidget* parent = nullptr)
: QWidget(parent) {
QLabel* image_widget = new QLabel;
QPixmap image_pixmap = QPixmap::fromImage(LoadTexture(src, info));
@@ -47,6 +49,7 @@ public:
setLayout(layout);
}
};
+} // Anonymous namespace
GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {}
@@ -65,7 +68,6 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
const auto& write = pica_trace.writes[index.row()];
if (role == Qt::DisplayRole) {
- QString content;
switch (index.column()) {
case 0:
return QString::fromLatin1(Pica::Regs::GetCommandName(write.cmd_id).c_str());
@@ -122,19 +124,21 @@ void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) ||
COMMAND_IN_RANGE(command_id, texture2)) {
- unsigned index;
+ unsigned texture_index;
if (COMMAND_IN_RANGE(command_id, texture0)) {
- index = 0;
+ texture_index = 0;
} else if (COMMAND_IN_RANGE(command_id, texture1)) {
- index = 1;
+ texture_index = 1;
} else if (COMMAND_IN_RANGE(command_id, texture2)) {
- index = 2;
+ texture_index = 2;
} else {
UNREACHABLE_MSG("Unknown texture command");
}
- auto config = Pica::g_state.regs.GetTextures()[index].config;
- auto format = Pica::g_state.regs.GetTextures()[index].format;
- auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
+
+ const auto texture = Pica::g_state.regs.GetTextures()[texture_index];
+ const auto config = texture.config;
+ const auto format = texture.format;
+ const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
// TODO: Open a surface debugger
}
@@ -148,19 +152,21 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) ||
COMMAND_IN_RANGE(command_id, texture2)) {
- unsigned index;
+ unsigned texture_index;
if (COMMAND_IN_RANGE(command_id, texture0)) {
- index = 0;
+ texture_index = 0;
} else if (COMMAND_IN_RANGE(command_id, texture1)) {
- index = 1;
+ texture_index = 1;
} else {
- index = 2;
+ texture_index = 2;
}
- auto config = Pica::g_state.regs.GetTextures()[index].config;
- auto format = Pica::g_state.regs.GetTextures()[index].format;
- auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
- u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress());
+ const auto texture = Pica::g_state.regs.GetTextures()[texture_index];
+ const auto config = texture.config;
+ const auto format = texture.format;
+
+ const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
+ const u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress());
new_info_widget = new TextureInfoWidget(src, info);
}
if (command_info_widget) {
diff --git a/src/citra_qt/debugger/graphics_cmdlists.h b/src/citra_qt/debugger/graphics/graphics_cmdlists.h
index fa2b9122b..8f40b94c5 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.h
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.h
@@ -20,7 +20,7 @@ public:
CommandIdRole = Qt::UserRole,
};
- GPUCommandListModel(QObject* parent);
+ explicit GPUCommandListModel(QObject* parent);
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
@@ -39,7 +39,7 @@ class GPUCommandListWidget : public QDockWidget {
Q_OBJECT
public:
- GPUCommandListWidget(QWidget* parent = nullptr);
+ explicit GPUCommandListWidget(QWidget* parent = nullptr);
public slots:
void OnToggleTracing();
diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp
index 906daaa50..4efd95d3c 100644
--- a/src/citra_qt/debugger/graphics_surface.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp
@@ -11,7 +11,7 @@
#include <QPushButton>
#include <QScrollArea>
#include <QSpinBox>
-#include "citra_qt/debugger/graphics_surface.h"
+#include "citra_qt/debugger/graphics/graphics_surface.h"
#include "citra_qt/util/spinbox.h"
#include "common/color.h"
#include "core/hw/gpu.h"
diff --git a/src/citra_qt/debugger/graphics_surface.h b/src/citra_qt/debugger/graphics/graphics_surface.h
index 21e6b5b8b..28f5650a7 100644
--- a/src/citra_qt/debugger/graphics_surface.h
+++ b/src/citra_qt/debugger/graphics/graphics_surface.h
@@ -6,7 +6,7 @@
#include <QLabel>
#include <QPushButton>
-#include "citra_qt/debugger/graphics_breakpoint_observer.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"
class QComboBox;
class QSpinBox;
@@ -18,7 +18,8 @@ class SurfacePicture : public QLabel {
Q_OBJECT
public:
- SurfacePicture(QWidget* parent = 0, GraphicsSurfaceWidget* surface_widget = nullptr);
+ explicit SurfacePicture(QWidget* parent = nullptr,
+ GraphicsSurfaceWidget* surface_widget = nullptr);
~SurfacePicture();
protected slots:
@@ -71,8 +72,8 @@ class GraphicsSurfaceWidget : public BreakPointObserverDock {
static unsigned int NibblesPerPixel(Format format);
public:
- GraphicsSurfaceWidget(std::shared_ptr<Pica::DebugContext> debug_context,
- QWidget* parent = nullptr);
+ explicit GraphicsSurfaceWidget(std::shared_ptr<Pica::DebugContext> debug_context,
+ QWidget* parent = nullptr);
void Pick(int x, int y);
public slots:
diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics/graphics_tracing.cpp
index 5c6b74034..716ed50b8 100644
--- a/src/citra_qt/debugger/graphics_tracing.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_tracing.cpp
@@ -12,7 +12,7 @@
#include <QMessageBox>
#include <QPushButton>
#include <boost/range/algorithm/copy.hpp>
-#include "citra_qt/debugger/graphics_tracing.h"
+#include "citra_qt/debugger/graphics/graphics_tracing.h"
#include "common/common_types.h"
#include "core/hw/gpu.h"
#include "core/hw/lcd.h"
diff --git a/src/citra_qt/debugger/graphics_tracing.h b/src/citra_qt/debugger/graphics/graphics_tracing.h
index e04a3dac3..3f73bcd2e 100644
--- a/src/citra_qt/debugger/graphics_tracing.h
+++ b/src/citra_qt/debugger/graphics/graphics_tracing.h
@@ -4,7 +4,7 @@
#pragma once
-#include "citra_qt/debugger/graphics_breakpoint_observer.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"
class EmuThread;
@@ -12,8 +12,8 @@ class GraphicsTracingWidget : public BreakPointObserverDock {
Q_OBJECT
public:
- GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context,
- QWidget* parent = nullptr);
+ explicit GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context,
+ QWidget* parent = nullptr);
private slots:
void StartRecording();
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
index 96b40db1e..b75b94ef8 100644
--- a/src/citra_qt/debugger/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
@@ -14,7 +14,7 @@
#include <QSignalMapper>
#include <QSpinBox>
#include <QTreeView>
-#include "citra_qt/debugger/graphics_vertex_shader.h"
+#include "citra_qt/debugger/graphics/graphics_vertex_shader.h"
#include "citra_qt/util/util.h"
#include "video_core/pica.h"
#include "video_core/pica_state.h"
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h
index ec42f24bb..bedea0bed 100644
--- a/src/citra_qt/debugger/graphics_vertex_shader.h
+++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h
@@ -6,7 +6,7 @@
#include <QAbstractTableModel>
#include <QTreeView>
-#include "citra_qt/debugger/graphics_breakpoint_observer.h"
+#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h"
#include "nihstro/parser_shbin.h"
#include "video_core/shader/shader.h"
@@ -19,7 +19,7 @@ class GraphicsVertexShaderModel : public QAbstractTableModel {
Q_OBJECT
public:
- GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent);
+ explicit GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent);
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
diff --git a/src/citra_qt/debugger/profiler.h b/src/citra_qt/debugger/profiler.h
index d8c6487aa..c8912fd5a 100644
--- a/src/citra_qt/debugger/profiler.h
+++ b/src/citra_qt/debugger/profiler.h
@@ -15,7 +15,7 @@ class ProfilerModel : public QAbstractItemModel {
Q_OBJECT
public:
- ProfilerModel(QObject* parent);
+ explicit ProfilerModel(QObject* parent);
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
@@ -37,7 +37,7 @@ class ProfilerWidget : public QDockWidget {
Q_OBJECT
public:
- ProfilerWidget(QWidget* parent = nullptr);
+ explicit ProfilerWidget(QWidget* parent = nullptr);
private slots:
void setProfilingInfoUpdateEnabled(bool enable);
@@ -53,7 +53,7 @@ class MicroProfileDialog : public QWidget {
Q_OBJECT
public:
- MicroProfileDialog(QWidget* parent = nullptr);
+ explicit MicroProfileDialog(QWidget* parent = nullptr);
/// Returns a QAction that can be used to toggle visibility of this dialog.
QAction* toggleViewAction();
diff --git a/src/citra_qt/debugger/ramview.h b/src/citra_qt/debugger/ramview.h
index 8043c59e8..d01cea93b 100644
--- a/src/citra_qt/debugger/ramview.h
+++ b/src/citra_qt/debugger/ramview.h
@@ -2,13 +2,15 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#pragma once
+
#include "qhexedit.h"
class GRamView : public QHexEdit {
Q_OBJECT
public:
- GRamView(QWidget* parent = nullptr);
+ explicit GRamView(QWidget* parent = nullptr);
public slots:
void OnCPUStepped();
diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp
index 4c529d3c3..b982bc58b 100644
--- a/src/citra_qt/debugger/registers.cpp
+++ b/src/citra_qt/debugger/registers.cpp
@@ -58,16 +58,16 @@ RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) {
}
void RegistersWidget::OnDebugModeEntered() {
- if (!Core::g_app_core)
+ if (!Core::System::GetInstance().IsPoweredOn())
return;
for (int i = 0; i < core_registers->childCount(); ++i)
core_registers->child(i)->setText(
- 1, QString("0x%1").arg(Core::g_app_core->GetReg(i), 8, 16, QLatin1Char('0')));
+ 1, QString("0x%1").arg(Core::CPU().GetReg(i), 8, 16, QLatin1Char('0')));
for (int i = 0; i < vfp_registers->childCount(); ++i)
vfp_registers->child(i)->setText(
- 1, QString("0x%1").arg(Core::g_app_core->GetVFPReg(i), 8, 16, QLatin1Char('0')));
+ 1, QString("0x%1").arg(Core::CPU().GetVFPReg(i), 8, 16, QLatin1Char('0')));
UpdateCPSRValues();
UpdateVFPSystemRegisterValues();
@@ -127,7 +127,7 @@ void RegistersWidget::CreateCPSRChildren() {
}
void RegistersWidget::UpdateCPSRValues() {
- const u32 cpsr_val = Core::g_app_core->GetCPSR();
+ const u32 cpsr_val = Core::CPU().GetCPSR();
cpsr->setText(1, QString("0x%1").arg(cpsr_val, 8, 16, QLatin1Char('0')));
cpsr->child(0)->setText(
@@ -191,10 +191,10 @@ void RegistersWidget::CreateVFPSystemRegisterChildren() {
}
void RegistersWidget::UpdateVFPSystemRegisterValues() {
- const u32 fpscr_val = Core::g_app_core->GetVFPSystemReg(VFP_FPSCR);
- const u32 fpexc_val = Core::g_app_core->GetVFPSystemReg(VFP_FPEXC);
- const u32 fpinst_val = Core::g_app_core->GetVFPSystemReg(VFP_FPINST);
- const u32 fpinst2_val = Core::g_app_core->GetVFPSystemReg(VFP_FPINST2);
+ const u32 fpscr_val = Core::CPU().GetVFPSystemReg(VFP_FPSCR);
+ const u32 fpexc_val = Core::CPU().GetVFPSystemReg(VFP_FPEXC);
+ const u32 fpinst_val = Core::CPU().GetVFPSystemReg(VFP_FPINST);
+ const u32 fpinst2_val = Core::CPU().GetVFPSystemReg(VFP_FPINST2);
QTreeWidgetItem* const fpscr = vfp_system_registers->child(0);
fpscr->setText(1, QString("0x%1").arg(fpscr_val, 8, 16, QLatin1Char('0')));
diff --git a/src/citra_qt/debugger/registers.h b/src/citra_qt/debugger/registers.h
index 54c9a8155..55bda5b59 100644
--- a/src/citra_qt/debugger/registers.h
+++ b/src/citra_qt/debugger/registers.h
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#pragma once
+
#include <QDockWidget>
#include "ui_registers.h"
@@ -13,7 +15,7 @@ class RegistersWidget : public QDockWidget {
Q_OBJECT
public:
- RegistersWidget(QWidget* parent = nullptr);
+ explicit RegistersWidget(QWidget* parent = nullptr);
public slots:
void OnDebugModeEntered();
diff --git a/src/citra_qt/debugger/wait_tree.cpp b/src/citra_qt/debugger/wait_tree.cpp
index be5a51e52..1d2de5185 100644
--- a/src/citra_qt/debugger/wait_tree.cpp
+++ b/src/citra_qt/debugger/wait_tree.cpp
@@ -8,7 +8,6 @@
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/mutex.h"
#include "core/hle/kernel/semaphore.h"
-#include "core/hle/kernel/session.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h"
@@ -230,7 +229,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
list.push_back(std::make_unique<WaitTreeMutexList>(thread.held_mutexes));
}
if (thread.status == THREADSTATUS_WAIT_SYNCH) {
- list.push_back(std::make_unique<WaitTreeObjectList>(thread.wait_objects, thread.wait_all));
+ list.push_back(std::make_unique<WaitTreeObjectList>(thread.wait_objects,
+ thread.IsSleepingOnWaitAll()));
}
return list;
@@ -391,7 +391,7 @@ WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), p
}
void WaitTreeWidget::OnDebugModeEntered() {
- if (!Core::g_app_core)
+ if (!Core::System::GetInstance().IsPoweredOn())
return;
model->InitItems();
view->setModel(model);
diff --git a/src/citra_qt/debugger/wait_tree.h b/src/citra_qt/debugger/wait_tree.h
index 5d1d964d1..ee9708fc1 100644
--- a/src/citra_qt/debugger/wait_tree.h
+++ b/src/citra_qt/debugger/wait_tree.h
@@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#pragma once
+
#include <boost/container/flat_set.hpp>
#include <QAbstractItemModel>
@@ -49,7 +51,7 @@ private:
class WaitTreeText : public WaitTreeItem {
Q_OBJECT
public:
- WaitTreeText(const QString& text);
+ explicit WaitTreeText(const QString& text);
QString GetText() const override;
private:
@@ -65,7 +67,7 @@ public:
class WaitTreeWaitObject : public WaitTreeExpandableItem {
Q_OBJECT
public:
- WaitTreeWaitObject(const Kernel::WaitObject& object);
+ explicit WaitTreeWaitObject(const Kernel::WaitObject& object);
static std::unique_ptr<WaitTreeWaitObject> make(const Kernel::WaitObject& object);
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -92,7 +94,7 @@ private:
class WaitTreeThread : public WaitTreeWaitObject {
Q_OBJECT
public:
- WaitTreeThread(const Kernel::Thread& thread);
+ explicit WaitTreeThread(const Kernel::Thread& thread);
QString GetText() const override;
QColor GetColor() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -101,35 +103,37 @@ public:
class WaitTreeEvent : public WaitTreeWaitObject {
Q_OBJECT
public:
- WaitTreeEvent(const Kernel::Event& object);
+ explicit WaitTreeEvent(const Kernel::Event& object);
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
class WaitTreeMutex : public WaitTreeWaitObject {
Q_OBJECT
public:
- WaitTreeMutex(const Kernel::Mutex& object);
+ explicit WaitTreeMutex(const Kernel::Mutex& object);
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
class WaitTreeSemaphore : public WaitTreeWaitObject {
Q_OBJECT
public:
- WaitTreeSemaphore(const Kernel::Semaphore& object);
+ explicit WaitTreeSemaphore(const Kernel::Semaphore& object);
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
class WaitTreeTimer : public WaitTreeWaitObject {
Q_OBJECT
public:
- WaitTreeTimer(const Kernel::Timer& object);
+ explicit WaitTreeTimer(const Kernel::Timer& object);
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
};
class WaitTreeMutexList : public WaitTreeExpandableItem {
Q_OBJECT
public:
- WaitTreeMutexList(const boost::container::flat_set<Kernel::SharedPtr<Kernel::Mutex>>& list);
+ explicit WaitTreeMutexList(
+ const boost::container::flat_set<Kernel::SharedPtr<Kernel::Mutex>>& list);
+
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -140,7 +144,7 @@ private:
class WaitTreeThreadList : public WaitTreeExpandableItem {
Q_OBJECT
public:
- WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list);
+ explicit WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list);
QString GetText() const override;
std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override;
@@ -152,7 +156,7 @@ class WaitTreeModel : public QAbstractItemModel {
Q_OBJECT
public:
- WaitTreeModel(QObject* parent = nullptr);
+ explicit WaitTreeModel(QObject* parent = nullptr);
QVariant data(const QModelIndex& index, int role) const override;
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
@@ -171,7 +175,7 @@ class WaitTreeWidget : public QDockWidget {
Q_OBJECT
public:
- WaitTreeWidget(QWidget* parent = nullptr);
+ explicit WaitTreeWidget(QWidget* parent = nullptr);
public slots:
void OnDebugModeEntered();