From b0a14cfe7f0075d0758371276b7f6384856aa6ff Mon Sep 17 00:00:00 2001 From: chrisvj Date: Sat, 3 Jan 2015 15:51:14 -0800 Subject: citra-qt: Renamed all .hxx headers to .h --- src/citra_qt/CMakeLists.txt | 30 ++--- src/citra_qt/bootmanager.cpp | 2 +- src/citra_qt/bootmanager.h | 138 +++++++++++++++++++++++ src/citra_qt/bootmanager.hxx | 138 ----------------------- src/citra_qt/config/controller_config.cpp | 4 +- src/citra_qt/config/controller_config.h | 56 +++++++++ src/citra_qt/config/controller_config.hxx | 56 --------- src/citra_qt/config/controller_config_util.cpp | 2 +- src/citra_qt/config/controller_config_util.h | 82 ++++++++++++++ src/citra_qt/config/controller_config_util.hxx | 82 -------------- src/citra_qt/debugger/callstack.cpp | 2 +- src/citra_qt/debugger/callstack.h | 23 ++++ src/citra_qt/debugger/callstack.hxx | 23 ---- src/citra_qt/debugger/disassembler.cpp | 6 +- src/citra_qt/debugger/disassembler.h | 77 +++++++++++++ src/citra_qt/debugger/disassembler.hxx | 77 ------------- src/citra_qt/debugger/graphics.cpp | 2 +- src/citra_qt/debugger/graphics.h | 43 +++++++ src/citra_qt/debugger/graphics.hxx | 43 ------- src/citra_qt/debugger/graphics_breakpoints.cpp | 4 +- src/citra_qt/debugger/graphics_breakpoints.h | 53 +++++++++ src/citra_qt/debugger/graphics_breakpoints.hxx | 53 --------- src/citra_qt/debugger/graphics_breakpoints_p.h | 38 +++++++ src/citra_qt/debugger/graphics_breakpoints_p.hxx | 38 ------- src/citra_qt/debugger/graphics_cmdlists.cpp | 4 +- src/citra_qt/debugger/graphics_cmdlists.h | 83 ++++++++++++++ src/citra_qt/debugger/graphics_cmdlists.hxx | 83 -------------- src/citra_qt/debugger/graphics_framebuffer.cpp | 4 +- src/citra_qt/debugger/graphics_framebuffer.h | 92 +++++++++++++++ src/citra_qt/debugger/graphics_framebuffer.hxx | 92 --------------- src/citra_qt/debugger/ramview.cpp | 2 +- src/citra_qt/debugger/ramview.h | 16 +++ src/citra_qt/debugger/ramview.hxx | 16 --- src/citra_qt/debugger/registers.cpp | 2 +- src/citra_qt/debugger/registers.h | 29 +++++ src/citra_qt/debugger/registers.hxx | 29 ----- src/citra_qt/hotkeys.cpp | 2 +- src/citra_qt/hotkeys.h | 54 +++++++++ src/citra_qt/hotkeys.hxx | 54 --------- src/citra_qt/main.cpp | 22 ++-- src/citra_qt/main.h | 63 +++++++++++ src/citra_qt/main.hxx | 63 ----------- src/citra_qt/util/spinbox.cpp | 2 +- src/citra_qt/util/spinbox.h | 88 +++++++++++++++ src/citra_qt/util/spinbox.hxx | 88 --------------- 45 files changed, 980 insertions(+), 980 deletions(-) create mode 100644 src/citra_qt/bootmanager.h delete mode 100644 src/citra_qt/bootmanager.hxx create mode 100644 src/citra_qt/config/controller_config.h delete mode 100644 src/citra_qt/config/controller_config.hxx create mode 100644 src/citra_qt/config/controller_config_util.h delete mode 100644 src/citra_qt/config/controller_config_util.hxx create mode 100644 src/citra_qt/debugger/callstack.h delete mode 100644 src/citra_qt/debugger/callstack.hxx create mode 100644 src/citra_qt/debugger/disassembler.h delete mode 100644 src/citra_qt/debugger/disassembler.hxx create mode 100644 src/citra_qt/debugger/graphics.h delete mode 100644 src/citra_qt/debugger/graphics.hxx create mode 100644 src/citra_qt/debugger/graphics_breakpoints.h delete mode 100644 src/citra_qt/debugger/graphics_breakpoints.hxx create mode 100644 src/citra_qt/debugger/graphics_breakpoints_p.h delete mode 100644 src/citra_qt/debugger/graphics_breakpoints_p.hxx create mode 100644 src/citra_qt/debugger/graphics_cmdlists.h delete mode 100644 src/citra_qt/debugger/graphics_cmdlists.hxx create mode 100644 src/citra_qt/debugger/graphics_framebuffer.h delete mode 100644 src/citra_qt/debugger/graphics_framebuffer.hxx create mode 100644 src/citra_qt/debugger/ramview.h delete mode 100644 src/citra_qt/debugger/ramview.hxx create mode 100644 src/citra_qt/debugger/registers.h delete mode 100644 src/citra_qt/debugger/registers.hxx create mode 100644 src/citra_qt/hotkeys.h delete mode 100644 src/citra_qt/hotkeys.hxx create mode 100644 src/citra_qt/main.h delete mode 100644 src/citra_qt/main.hxx create mode 100644 src/citra_qt/util/spinbox.h delete mode 100644 src/citra_qt/util/spinbox.hxx diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 8a511e02..a0ba252b 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -21,22 +21,22 @@ set(SRCS ) set(HEADERS - config/controller_config.hxx - config/controller_config_util.hxx + config/controller_config.h + config/controller_config_util.h config.h - debugger/callstack.hxx - debugger/disassembler.hxx - debugger/graphics.hxx - debugger/graphics_breakpoints.hxx - debugger/graphics_breakpoints_p.hxx - debugger/graphics_cmdlists.hxx - debugger/graphics_framebuffer.hxx - debugger/ramview.hxx - debugger/registers.hxx - util/spinbox.hxx - bootmanager.hxx - hotkeys.hxx - main.hxx + debugger/callstack.h + debugger/disassembler.h + debugger/graphics.h + debugger/graphics_breakpoints.h + debugger/graphics_breakpoints_p.h + debugger/graphics_cmdlists.h + debugger/graphics_framebuffer.h + debugger/ramview.h + debugger/registers.h + util/spinbox.h + bootmanager.h + hotkeys.h + main.h version.h ) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index e753ea10..3e24da59 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -9,7 +9,7 @@ #endif #include "common/common.h" -#include "bootmanager.hxx" +#include "bootmanager.h" #include "core/core.h" #include "core/settings.h" diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h new file mode 100644 index 00000000..1c893384 --- /dev/null +++ b/src/citra_qt/bootmanager.h @@ -0,0 +1,138 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include + +#include +#include + +#include "common/common.h" +#include "common/emu_window.h" + +class QScreen; +class QKeyEvent; + +class GRenderWindow; + +class EmuThread : public QThread +{ + Q_OBJECT + +public: + /** + * Set image filename + * + * @param filename + * @warning Only call when not running! + */ + void SetFilename(std::string filename); + + /** + * Start emulation (on new thread) + * + * @warning Only call when not running! + */ + void run() override; + + /** + * Allow the CPU to process a single instruction (if cpu is not running) + * + * @note This function is thread-safe + */ + void ExecStep() { exec_cpu_step = true; } + + /** + * Allow the CPU to continue processing instructions without interruption + * + * @note This function is thread-safe + */ + void SetCpuRunning(bool running) { cpu_running = running; } + + /** + * Allow the CPU to continue processing instructions without interruption + * + * @note This function is thread-safe + */ + bool IsCpuRunning() { return cpu_running; } + + +public slots: + /** + * Stop emulation and wait for the thread to finish. + * + * @details: This function will wait a second for the thread to finish; if it hasn't finished until then, we'll terminate() it and wait another second, hoping that it will be terminated by then. + * @note: This function is thread-safe. + */ + void Stop(); + +private: + friend class GRenderWindow; + + EmuThread(GRenderWindow* render_window); + + std::string filename; + + bool exec_cpu_step; + bool cpu_running; + std::atomic stop_run; + + GRenderWindow* render_window; + +signals: + /** + * Emitted when CPU when we've finished processing a single Gekko instruction + * + * @warning This will only be emitted when the CPU is not running (SetCpuRunning(false)) + * @warning When connecting to this signal from other threads, make sure to specify either Qt::QueuedConnection (invoke slot within the destination object's message thread) or even Qt::BlockingQueuedConnection (additionally block source thread until slot returns) + */ + void CPUStepped(); +}; + +class GRenderWindow : public QWidget, public EmuWindow +{ + Q_OBJECT + +public: + GRenderWindow(QWidget* parent = NULL); + ~GRenderWindow(); + + void closeEvent(QCloseEvent*) override; + + // EmuWindow implementation + void SwapBuffers() override; + void MakeCurrent() override; + void DoneCurrent() override; + void PollEvents() override; + + void BackupGeometry(); + void RestoreGeometry(); + void restoreGeometry(const QByteArray& geometry); // overridden + QByteArray saveGeometry(); // overridden + + EmuThread& GetEmuThread(); + + void keyPressEvent(QKeyEvent* event) override; + void keyReleaseEvent(QKeyEvent* event) override; + + void ReloadSetKeymaps() override; + + void OnClientAreaResized(unsigned width, unsigned height); + + void OnFramebufferSizeChanged(); + +public slots: + void moveContext(); // overridden + +private: + void OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; + + QGLWidget* child; + + EmuThread emu_thread; + + QByteArray geometry; + + /// Device id of keyboard for use with KeyMap + int keyboard_id; +}; diff --git a/src/citra_qt/bootmanager.hxx b/src/citra_qt/bootmanager.hxx deleted file mode 100644 index 1c893384..00000000 --- a/src/citra_qt/bootmanager.hxx +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include - -#include -#include - -#include "common/common.h" -#include "common/emu_window.h" - -class QScreen; -class QKeyEvent; - -class GRenderWindow; - -class EmuThread : public QThread -{ - Q_OBJECT - -public: - /** - * Set image filename - * - * @param filename - * @warning Only call when not running! - */ - void SetFilename(std::string filename); - - /** - * Start emulation (on new thread) - * - * @warning Only call when not running! - */ - void run() override; - - /** - * Allow the CPU to process a single instruction (if cpu is not running) - * - * @note This function is thread-safe - */ - void ExecStep() { exec_cpu_step = true; } - - /** - * Allow the CPU to continue processing instructions without interruption - * - * @note This function is thread-safe - */ - void SetCpuRunning(bool running) { cpu_running = running; } - - /** - * Allow the CPU to continue processing instructions without interruption - * - * @note This function is thread-safe - */ - bool IsCpuRunning() { return cpu_running; } - - -public slots: - /** - * Stop emulation and wait for the thread to finish. - * - * @details: This function will wait a second for the thread to finish; if it hasn't finished until then, we'll terminate() it and wait another second, hoping that it will be terminated by then. - * @note: This function is thread-safe. - */ - void Stop(); - -private: - friend class GRenderWindow; - - EmuThread(GRenderWindow* render_window); - - std::string filename; - - bool exec_cpu_step; - bool cpu_running; - std::atomic stop_run; - - GRenderWindow* render_window; - -signals: - /** - * Emitted when CPU when we've finished processing a single Gekko instruction - * - * @warning This will only be emitted when the CPU is not running (SetCpuRunning(false)) - * @warning When connecting to this signal from other threads, make sure to specify either Qt::QueuedConnection (invoke slot within the destination object's message thread) or even Qt::BlockingQueuedConnection (additionally block source thread until slot returns) - */ - void CPUStepped(); -}; - -class GRenderWindow : public QWidget, public EmuWindow -{ - Q_OBJECT - -public: - GRenderWindow(QWidget* parent = NULL); - ~GRenderWindow(); - - void closeEvent(QCloseEvent*) override; - - // EmuWindow implementation - void SwapBuffers() override; - void MakeCurrent() override; - void DoneCurrent() override; - void PollEvents() override; - - void BackupGeometry(); - void RestoreGeometry(); - void restoreGeometry(const QByteArray& geometry); // overridden - QByteArray saveGeometry(); // overridden - - EmuThread& GetEmuThread(); - - void keyPressEvent(QKeyEvent* event) override; - void keyReleaseEvent(QKeyEvent* event) override; - - void ReloadSetKeymaps() override; - - void OnClientAreaResized(unsigned width, unsigned height); - - void OnFramebufferSizeChanged(); - -public slots: - void moveContext(); // overridden - -private: - void OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; - - QGLWidget* child; - - EmuThread emu_thread; - - QByteArray geometry; - - /// Device id of keyboard for use with KeyMap - int keyboard_id; -}; diff --git a/src/citra_qt/config/controller_config.cpp b/src/citra_qt/config/controller_config.cpp index 41000e29..892995bb 100644 --- a/src/citra_qt/config/controller_config.cpp +++ b/src/citra_qt/config/controller_config.cpp @@ -4,8 +4,8 @@ #include -#include "controller_config.hxx" -#include "controller_config_util.hxx" +#include "controller_config.h" +#include "controller_config_util.h" /* TODO(bunnei): ImplementMe diff --git a/src/citra_qt/config/controller_config.h b/src/citra_qt/config/controller_config.h new file mode 100644 index 00000000..451593de --- /dev/null +++ b/src/citra_qt/config/controller_config.h @@ -0,0 +1,56 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#ifndef _CONTROLLER_CONFIG_HXX_ +#define _CONTROLLER_CONFIG_HXX_ + +#include + +//#include "ui_controller_config.h" + +/* TODO(bunnei): ImplementMe + +#include "config.h" + +class GControllerConfig : public QWidget +{ + Q_OBJECT + +public: + GControllerConfig(common::Config::ControllerPort* initial_config, QWidget* parent = NULL); + + const common::Config::ControllerPort& GetControllerConfig(int index) const { return config[index]; } + +signals: + void ActivePortChanged(const common::Config::ControllerPort&); + +public slots: + void OnKeyConfigChanged(common::Config::Control id, int key, const QString& name); + +private: + int GetActiveController(); + bool InputSourceJoypad(); + + Ui::ControllerConfig ui; + common::Config::ControllerPort config[4]; +}; + +class GControllerConfigDialog : public QDialog +{ + Q_OBJECT + +public: + GControllerConfigDialog(common::Config::ControllerPort* controller_ports, QWidget* parent = NULL); + +public slots: + void EnableChanges(); + +private: + GControllerConfig* config_widget; + common::Config::ControllerPort* config_ptr; +}; + +*/ + +#endif // _CONTROLLER_CONFIG_HXX_ diff --git a/src/citra_qt/config/controller_config.hxx b/src/citra_qt/config/controller_config.hxx deleted file mode 100644 index 451593de..00000000 --- a/src/citra_qt/config/controller_config.hxx +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#ifndef _CONTROLLER_CONFIG_HXX_ -#define _CONTROLLER_CONFIG_HXX_ - -#include - -//#include "ui_controller_config.h" - -/* TODO(bunnei): ImplementMe - -#include "config.h" - -class GControllerConfig : public QWidget -{ - Q_OBJECT - -public: - GControllerConfig(common::Config::ControllerPort* initial_config, QWidget* parent = NULL); - - const common::Config::ControllerPort& GetControllerConfig(int index) const { return config[index]; } - -signals: - void ActivePortChanged(const common::Config::ControllerPort&); - -public slots: - void OnKeyConfigChanged(common::Config::Control id, int key, const QString& name); - -private: - int GetActiveController(); - bool InputSourceJoypad(); - - Ui::ControllerConfig ui; - common::Config::ControllerPort config[4]; -}; - -class GControllerConfigDialog : public QDialog -{ - Q_OBJECT - -public: - GControllerConfigDialog(common::Config::ControllerPort* controller_ports, QWidget* parent = NULL); - -public slots: - void EnableChanges(); - -private: - GControllerConfig* config_widget; - common::Config::ControllerPort* config_ptr; -}; - -*/ - -#endif // _CONTROLLER_CONFIG_HXX_ diff --git a/src/citra_qt/config/controller_config_util.cpp b/src/citra_qt/config/controller_config_util.cpp index 272e8d41..d68b119d 100644 --- a/src/citra_qt/config/controller_config_util.cpp +++ b/src/citra_qt/config/controller_config_util.cpp @@ -9,7 +9,7 @@ #include #include -#include "controller_config_util.hxx" +#include "controller_config_util.h" /* TODO(bunnei): ImplementMe GStickConfig::GStickConfig(common::Config::Control leftid, common::Config::Control rightid, common::Config::Control upid, common::Config::Control downid, QObject* change_receiver, QWidget* parent) : QWidget(parent) diff --git a/src/citra_qt/config/controller_config_util.h b/src/citra_qt/config/controller_config_util.h new file mode 100644 index 00000000..15e025b5 --- /dev/null +++ b/src/citra_qt/config/controller_config_util.h @@ -0,0 +1,82 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#ifndef _CONTROLLER_CONFIG_UTIL_HXX_ +#define _CONTROLLER_CONFIG_UTIL_HXX_ + +#include +#include + +/* TODO(bunnei): ImplementMe + +#include "config.h" + +class GStickConfig : public QWidget +{ + Q_OBJECT + +public: + // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! + GStickConfig(common::Config::Control leftid, common::Config::Control rightid, common::Config::Control upid, common::Config::Control downid, QObject* change_receiver, QWidget* parent = NULL); + +signals: + void LeftChanged(); + void RightChanged(); + void UpChanged(); + void DownChanged(); + +private: + QPushButton* left; + QPushButton* right; + QPushButton* up; + QPushButton* down; + + QPushButton* clear; +}; + +class GKeyConfigButton : public QPushButton +{ + Q_OBJECT + +public: + // TODO: change_receiver also needs to have an ActivePortChanged(const common::Config::ControllerPort&) signal + // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! + GKeyConfigButton(common::Config::Control id, const QIcon& icon, const QString& text, QObject* change_receiver, QWidget* parent); + GKeyConfigButton(common::Config::Control id, const QString& text, QObject* change_receiver, QWidget* parent); + +signals: + void KeyAssigned(common::Config::Control id, int key, const QString& text); + +private slots: + void OnActivePortChanged(const common::Config::ControllerPort& config); + + void OnClicked(); + + void keyPressEvent(QKeyEvent* event); // TODO: bGrabbed? + void mousePressEvent(QMouseEvent* event); + +private: + common::Config::Control id; + bool inputGrabbed; + + QString old_text; +}; + +class GButtonConfigGroup : public QWidget +{ + Q_OBJECT + +public: + // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! + GButtonConfigGroup(const QString& name, common::Config::Control id, QObject* change_receiver, QWidget* parent = NULL); + +private: + GKeyConfigButton* config_button; + + common::Config::Control id; +}; + +*/ + +#endif // _CONTROLLER_CONFIG_HXX_ diff --git a/src/citra_qt/config/controller_config_util.hxx b/src/citra_qt/config/controller_config_util.hxx deleted file mode 100644 index 15e025b5..00000000 --- a/src/citra_qt/config/controller_config_util.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#ifndef _CONTROLLER_CONFIG_UTIL_HXX_ -#define _CONTROLLER_CONFIG_UTIL_HXX_ - -#include -#include - -/* TODO(bunnei): ImplementMe - -#include "config.h" - -class GStickConfig : public QWidget -{ - Q_OBJECT - -public: - // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! - GStickConfig(common::Config::Control leftid, common::Config::Control rightid, common::Config::Control upid, common::Config::Control downid, QObject* change_receiver, QWidget* parent = NULL); - -signals: - void LeftChanged(); - void RightChanged(); - void UpChanged(); - void DownChanged(); - -private: - QPushButton* left; - QPushButton* right; - QPushButton* up; - QPushButton* down; - - QPushButton* clear; -}; - -class GKeyConfigButton : public QPushButton -{ - Q_OBJECT - -public: - // TODO: change_receiver also needs to have an ActivePortChanged(const common::Config::ControllerPort&) signal - // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! - GKeyConfigButton(common::Config::Control id, const QIcon& icon, const QString& text, QObject* change_receiver, QWidget* parent); - GKeyConfigButton(common::Config::Control id, const QString& text, QObject* change_receiver, QWidget* parent); - -signals: - void KeyAssigned(common::Config::Control id, int key, const QString& text); - -private slots: - void OnActivePortChanged(const common::Config::ControllerPort& config); - - void OnClicked(); - - void keyPressEvent(QKeyEvent* event); // TODO: bGrabbed? - void mousePressEvent(QMouseEvent* event); - -private: - common::Config::Control id; - bool inputGrabbed; - - QString old_text; -}; - -class GButtonConfigGroup : public QWidget -{ - Q_OBJECT - -public: - // change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot! - GButtonConfigGroup(const QString& name, common::Config::Control id, QObject* change_receiver, QWidget* parent = NULL); - -private: - GKeyConfigButton* config_button; - - common::Config::Control id; -}; - -*/ - -#endif // _CONTROLLER_CONFIG_HXX_ diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 4a47ad46..bcc5d214 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -4,7 +4,7 @@ #include -#include "callstack.hxx" +#include "callstack.h" #include "core/core.h" #include "core/arm/arm_interface.h" diff --git a/src/citra_qt/debugger/callstack.h b/src/citra_qt/debugger/callstack.h new file mode 100644 index 00000000..4f4f7482 --- /dev/null +++ b/src/citra_qt/debugger/callstack.h @@ -0,0 +1,23 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include "ui_callstack.h" + +class QStandardItemModel; + +class CallstackWidget : public QDockWidget +{ + Q_OBJECT + +public: + CallstackWidget(QWidget* parent = 0); + +public slots: + void OnCPUStepped(); + +private: + Ui::CallStack ui; + QStandardItemModel* callstack_model; +}; diff --git a/src/citra_qt/debugger/callstack.hxx b/src/citra_qt/debugger/callstack.hxx deleted file mode 100644 index 4f4f7482..00000000 --- a/src/citra_qt/debugger/callstack.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include -#include "ui_callstack.h" - -class QStandardItemModel; - -class CallstackWidget : public QDockWidget -{ - Q_OBJECT - -public: - CallstackWidget(QWidget* parent = 0); - -public slots: - void OnCPUStepped(); - -private: - Ui::CallStack ui; - QStandardItemModel* callstack_model; -}; diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 636a0f18..8db73752 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "disassembler.hxx" +#include "disassembler.h" -#include "../bootmanager.hxx" -#include "../hotkeys.hxx" +#include "../bootmanager.h" +#include "../hotkeys.h" #include "common/common.h" #include "core/mem_map.h" diff --git a/src/citra_qt/debugger/disassembler.h b/src/citra_qt/debugger/disassembler.h new file mode 100644 index 00000000..6d3cef10 --- /dev/null +++ b/src/citra_qt/debugger/disassembler.h @@ -0,0 +1,77 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include +#include "ui_disassembler.h" + +#include "common/common.h" +#include "common/break_points.h" + +class QAction; +class EmuThread; + +class DisassemblerModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + DisassemblerModel(QObject* parent); + + QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& child) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + + QModelIndex IndexFromAbsoluteAddress(unsigned int address) const; + const BreakPoints& GetBreakPoints() const; + +public slots: + void ParseFromAddress(unsigned int address); + void OnSelectionChanged(const QModelIndex&); + void OnSetOrUnsetBreakpoint(); + void SetNextInstruction(unsigned int address); + +private: + unsigned int base_address; + unsigned int code_size; + 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; +}; + +class DisassemblerWidget : public QDockWidget +{ + Q_OBJECT + +public: + DisassemblerWidget(QWidget* parent, EmuThread& emu_thread); + + void Init(); + +public slots: + void OnContinue(); + void OnStep(); + void OnStepInto(); + void OnPause(); + void OnToggleStartStop(); + + void OnCPUStepped(); + +private: + // returns -1 if no row is selected + int SelectedRow(); + + Ui::DockWidget disasm_ui; + + DisassemblerModel* model; + + u32 base_addr; + + EmuThread& emu_thread; +}; diff --git a/src/citra_qt/debugger/disassembler.hxx b/src/citra_qt/debugger/disassembler.hxx deleted file mode 100644 index 6d3cef10..00000000 --- a/src/citra_qt/debugger/disassembler.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include -#include -#include "ui_disassembler.h" - -#include "common/common.h" -#include "common/break_points.h" - -class QAction; -class EmuThread; - -class DisassemblerModel : public QAbstractItemModel -{ - Q_OBJECT - -public: - DisassemblerModel(QObject* parent); - - QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex& child) const override; - int columnCount(const QModelIndex& parent = QModelIndex()) const override; - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - - QModelIndex IndexFromAbsoluteAddress(unsigned int address) const; - const BreakPoints& GetBreakPoints() const; - -public slots: - void ParseFromAddress(unsigned int address); - void OnSelectionChanged(const QModelIndex&); - void OnSetOrUnsetBreakpoint(); - void SetNextInstruction(unsigned int address); - -private: - unsigned int base_address; - unsigned int code_size; - 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; -}; - -class DisassemblerWidget : public QDockWidget -{ - Q_OBJECT - -public: - DisassemblerWidget(QWidget* parent, EmuThread& emu_thread); - - void Init(); - -public slots: - void OnContinue(); - void OnStep(); - void OnStepInto(); - void OnPause(); - void OnToggleStartStop(); - - void OnCPUStepped(); - -private: - // returns -1 if no row is selected - int SelectedRow(); - - Ui::DockWidget disasm_ui; - - DisassemblerModel* model; - - u32 base_addr; - - EmuThread& emu_thread; -}; diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics.cpp index 9633d367..7424671f 100644 --- a/src/citra_qt/debugger/graphics.cpp +++ b/src/citra_qt/debugger/graphics.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "graphics.hxx" +#include "graphics.h" #include #include #include diff --git a/src/citra_qt/debugger/graphics.h b/src/citra_qt/debugger/graphics.h new file mode 100644 index 00000000..8119b4c8 --- /dev/null +++ b/src/citra_qt/debugger/graphics.h @@ -0,0 +1,43 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#include "video_core/gpu_debugger.h" + +class GPUCommandStreamItemModel : public QAbstractListModel, public GraphicsDebugger::DebuggerObserver +{ + Q_OBJECT + +public: + GPUCommandStreamItemModel(QObject* parent); + + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + +public: + void GXCommandProcessed(int total_command_count) override; + +public slots: + void OnGXCommandFinishedInternal(int total_command_count); + +signals: + void GXCommandFinished(int total_command_count); + +private: + int command_count; +}; + +class GPUCommandStreamWidget : public QDockWidget +{ + Q_OBJECT + +public: + GPUCommandStreamWidget(QWidget* parent = 0); + +private: +}; diff --git a/src/citra_qt/debugger/graphics.hxx b/src/citra_qt/debugger/graphics.hxx deleted file mode 100644 index 8119b4c8..00000000 --- a/src/citra_qt/debugger/graphics.hxx +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -#include "video_core/gpu_debugger.h" - -class GPUCommandStreamItemModel : public QAbstractListModel, public GraphicsDebugger::DebuggerObserver -{ - Q_OBJECT - -public: - GPUCommandStreamItemModel(QObject* parent); - - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - -public: - void GXCommandProcessed(int total_command_count) override; - -public slots: - void OnGXCommandFinishedInternal(int total_command_count); - -signals: - void GXCommandFinished(int total_command_count); - -private: - int command_count; -}; - -class GPUCommandStreamWidget : public QDockWidget -{ - Q_OBJECT - -public: - GPUCommandStreamWidget(QWidget* parent = 0); - -private: -}; diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index 170aa736..262e2e77 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp @@ -8,8 +8,8 @@ #include #include -#include "graphics_breakpoints.hxx" -#include "graphics_breakpoints_p.hxx" +#include "graphics_breakpoints.h" +#include "graphics_breakpoints_p.h" BreakPointModel::BreakPointModel(std::shared_ptr debug_context, QObject* parent) : QAbstractListModel(parent), context_weak(debug_context), diff --git a/src/citra_qt/debugger/graphics_breakpoints.h b/src/citra_qt/debugger/graphics_breakpoints.h new file mode 100644 index 00000000..5b9ba324 --- /dev/null +++ b/src/citra_qt/debugger/graphics_breakpoints.h @@ -0,0 +1,53 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include + +#include +#include + +#include "video_core/debug_utils/debug_utils.h" + +class QLabel; +class QPushButton; +class QTreeView; + +class BreakPointModel; + +class GraphicsBreakPointsWidget : public QDockWidget, Pica::DebugContext::BreakPointObserver { + Q_OBJECT + + using Event = Pica::DebugContext::Event; + +public: + GraphicsBreakPointsWidget(std::shared_ptr debug_context, + QWidget* parent = nullptr); + + void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; + void OnPicaResume() override; + +public slots: + void OnBreakPointHit(Pica::DebugContext::Event event, void* data); + void OnResumeRequested(); + void OnResumed(); + void OnBreakpointSelectionChanged(const QModelIndex&); + void OnToggleBreakpointEnabled(); + +signals: + void Resumed(); + void BreakPointHit(Pica::DebugContext::Event event, void* data); + void BreakPointsChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); + +private: + void UpdateToggleBreakpointButton(const QModelIndex& index); + + QLabel* status_text; + QPushButton* resume_button; + QPushButton* toggle_breakpoint_button; + + BreakPointModel* breakpoint_model; + QTreeView* breakpoint_list; +}; diff --git a/src/citra_qt/debugger/graphics_breakpoints.hxx b/src/citra_qt/debugger/graphics_breakpoints.hxx deleted file mode 100644 index 5b9ba324..00000000 --- a/src/citra_qt/debugger/graphics_breakpoints.hxx +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include - -#include -#include - -#include "video_core/debug_utils/debug_utils.h" - -class QLabel; -class QPushButton; -class QTreeView; - -class BreakPointModel; - -class GraphicsBreakPointsWidget : public QDockWidget, Pica::DebugContext::BreakPointObserver { - Q_OBJECT - - using Event = Pica::DebugContext::Event; - -public: - GraphicsBreakPointsWidget(std::shared_ptr debug_context, - QWidget* parent = nullptr); - - void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; - void OnPicaResume() override; - -public slots: - void OnBreakPointHit(Pica::DebugContext::Event event, void* data); - void OnResumeRequested(); - void OnResumed(); - void OnBreakpointSelectionChanged(const QModelIndex&); - void OnToggleBreakpointEnabled(); - -signals: - void Resumed(); - void BreakPointHit(Pica::DebugContext::Event event, void* data); - void BreakPointsChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); - -private: - void UpdateToggleBreakpointButton(const QModelIndex& index); - - QLabel* status_text; - QPushButton* resume_button; - QPushButton* toggle_breakpoint_button; - - BreakPointModel* breakpoint_model; - QTreeView* breakpoint_list; -}; diff --git a/src/citra_qt/debugger/graphics_breakpoints_p.h b/src/citra_qt/debugger/graphics_breakpoints_p.h new file mode 100644 index 00000000..232bfc86 --- /dev/null +++ b/src/citra_qt/debugger/graphics_breakpoints_p.h @@ -0,0 +1,38 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include + +#include + +#include "video_core/debug_utils/debug_utils.h" + +class BreakPointModel : public QAbstractListModel { + Q_OBJECT + +public: + enum { + Role_IsEnabled = Qt::UserRole, + }; + + BreakPointModel(std::shared_ptr context, QObject* parent); + + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + +public slots: + void OnBreakPointHit(Pica::DebugContext::Event event); + void OnResumed(); + +private: + std::weak_ptr context_weak; + bool at_breakpoint; + Pica::DebugContext::Event active_breakpoint; +}; diff --git a/src/citra_qt/debugger/graphics_breakpoints_p.hxx b/src/citra_qt/debugger/graphics_breakpoints_p.hxx deleted file mode 100644 index 232bfc86..00000000 --- a/src/citra_qt/debugger/graphics_breakpoints_p.hxx +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include - -#include - -#include "video_core/debug_utils/debug_utils.h" - -class BreakPointModel : public QAbstractListModel { - Q_OBJECT - -public: - enum { - Role_IsEnabled = Qt::UserRole, - }; - - BreakPointModel(std::shared_ptr context, QObject* parent); - - int columnCount(const QModelIndex& parent = QModelIndex()) const override; - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - - bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); - -public slots: - void OnBreakPointHit(Pica::DebugContext::Event event); - void OnResumed(); - -private: - std::weak_ptr context_weak; - bool at_breakpoint; - Pica::DebugContext::Event active_breakpoint; -}; diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 708b805a..4a6159fd 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -16,9 +16,9 @@ #include "video_core/debug_utils/debug_utils.h" -#include "graphics_cmdlists.hxx" +#include "graphics_cmdlists.h" -#include "util/spinbox.hxx" +#include "util/spinbox.h" QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { QImage decoded_image(info.width, info.height, QImage::Format_ARGB32); diff --git a/src/citra_qt/debugger/graphics_cmdlists.h b/src/citra_qt/debugger/graphics_cmdlists.h new file mode 100644 index 00000000..a465d044 --- /dev/null +++ b/src/citra_qt/debugger/graphics_cmdlists.h @@ -0,0 +1,83 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#include "video_core/gpu_debugger.h" +#include "video_core/debug_utils/debug_utils.h" + +class QPushButton; +class QTreeView; + +class GPUCommandListModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum { + CommandIdRole = Qt::UserRole, + }; + + GPUCommandListModel(QObject* parent); + + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + +public slots: + void OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace& trace); + +private: + Pica::DebugUtils::PicaTrace pica_trace; +}; + +class GPUCommandListWidget : public QDockWidget +{ + Q_OBJECT + +public: + GPUCommandListWidget(QWidget* parent = 0); + +public slots: + void OnToggleTracing(); + void OnCommandDoubleClicked(const QModelIndex&); + + void SetCommandInfo(const QModelIndex&); + +signals: + void TracingFinished(const Pica::DebugUtils::PicaTrace&); + +private: + std::unique_ptr pica_trace; + + QTreeView* list_widget; + QWidget* command_info_widget; + QPushButton* toggle_tracing; +}; + +class TextureInfoDockWidget : public QDockWidget { + Q_OBJECT + +public: + TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr); + +signals: + void UpdatePixmap(const QPixmap& pixmap); + +private slots: + void OnAddressChanged(qint64 value); + void OnFormatChanged(int value); + void OnWidthChanged(int value); + void OnHeightChanged(int value); + void OnStrideChanged(int value); + +private: + QPixmap ReloadPixmap() const; + + Pica::DebugUtils::TextureInfo info; +}; diff --git a/src/citra_qt/debugger/graphics_cmdlists.hxx b/src/citra_qt/debugger/graphics_cmdlists.hxx deleted file mode 100644 index a465d044..00000000 --- a/src/citra_qt/debugger/graphics_cmdlists.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -#include "video_core/gpu_debugger.h" -#include "video_core/debug_utils/debug_utils.h" - -class QPushButton; -class QTreeView; - -class GPUCommandListModel : public QAbstractListModel -{ - Q_OBJECT - -public: - enum { - CommandIdRole = Qt::UserRole, - }; - - GPUCommandListModel(QObject* parent); - - int columnCount(const QModelIndex& parent = QModelIndex()) const override; - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - -public slots: - void OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace& trace); - -private: - Pica::DebugUtils::PicaTrace pica_trace; -}; - -class GPUCommandListWidget : public QDockWidget -{ - Q_OBJECT - -public: - GPUCommandListWidget(QWidget* parent = 0); - -public slots: - void OnToggleTracing(); - void OnCommandDoubleClicked(const QModelIndex&); - - void SetCommandInfo(const QModelIndex&); - -signals: - void TracingFinished(const Pica::DebugUtils::PicaTrace&); - -private: - std::unique_ptr pica_trace; - - QTreeView* list_widget; - QWidget* command_info_widget; - QPushButton* toggle_tracing; -}; - -class TextureInfoDockWidget : public QDockWidget { - Q_OBJECT - -public: - TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr); - -signals: - void UpdatePixmap(const QPixmap& pixmap); - -private slots: - void OnAddressChanged(qint64 value); - void OnFormatChanged(int value); - void OnWidthChanged(int value); - void OnHeightChanged(int value); - void OnStrideChanged(int value); - -private: - QPixmap ReloadPixmap() const; - - Pica::DebugUtils::TextureInfo info; -}; diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 7ef699f3..caa6896f 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -13,9 +13,9 @@ #include "video_core/color.h" #include "video_core/pica.h" -#include "graphics_framebuffer.hxx" +#include "graphics_framebuffer.h" -#include "util/spinbox.hxx" +#include "util/spinbox.h" BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr debug_context, const QString& title, QWidget* parent) diff --git a/src/citra_qt/debugger/graphics_framebuffer.h b/src/citra_qt/debugger/graphics_framebuffer.h new file mode 100644 index 00000000..02813525 --- /dev/null +++ b/src/citra_qt/debugger/graphics_framebuffer.h @@ -0,0 +1,92 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include + +#include "video_core/debug_utils/debug_utils.h" + +class QComboBox; +class QLabel; +class QSpinBox; + +class CSpinBox; + +// Utility class which forwards calls to OnPicaBreakPointHit and OnPicaResume to public slots. +// This is because the Pica breakpoint callbacks are called from a non-GUI thread, while +// the widget usually wants to perform reactions in the GUI thread. +class BreakPointObserverDock : public QDockWidget, Pica::DebugContext::BreakPointObserver { + Q_OBJECT + +public: + BreakPointObserverDock(std::shared_ptr debug_context, const QString& title, + QWidget* parent = nullptr); + + void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; + void OnPicaResume() override; + +private slots: + virtual void OnBreakPointHit(Pica::DebugContext::Event event, void* data) = 0; + virtual void OnResumed() = 0; + +signals: + void Resumed(); + void BreakPointHit(Pica::DebugContext::Event event, void* data); +}; + +class GraphicsFramebufferWidget : public BreakPointObserverDock { + Q_OBJECT + + using Event = Pica::DebugContext::Event; + + enum class Source { + PicaTarget = 0, + Custom = 1, + + // TODO: Add GPU framebuffer sources! + }; + + enum class Format { + RGBA8 = 0, + RGB8 = 1, + RGBA5551 = 2, + RGB565 = 3, + RGBA4 = 4, + }; + +public: + GraphicsFramebufferWidget(std::shared_ptr debug_context, QWidget* parent = nullptr); + +public slots: + void OnFramebufferSourceChanged(int new_value); + void OnFramebufferAddressChanged(qint64 new_value); + void OnFramebufferWidthChanged(unsigned int new_value); + void OnFramebufferHeightChanged(unsigned int new_value); + void OnFramebufferFormatChanged(int new_value); + void OnUpdate(); + +private slots: + void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override; + void OnResumed() override; + +signals: + void Update(); + +private: + + QComboBox* framebuffer_source_list; + CSpinBox* framebuffer_address_control; + QSpinBox* framebuffer_width_control; + QSpinBox* framebuffer_height_control; + QComboBox* framebuffer_format_control; + + QLabel* framebuffer_picture_label; + + Source framebuffer_source; + unsigned framebuffer_address; + unsigned framebuffer_width; + unsigned framebuffer_height; + Format framebuffer_format; +}; diff --git a/src/citra_qt/debugger/graphics_framebuffer.hxx b/src/citra_qt/debugger/graphics_framebuffer.hxx deleted file mode 100644 index 02813525..00000000 --- a/src/citra_qt/debugger/graphics_framebuffer.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include - -#include "video_core/debug_utils/debug_utils.h" - -class QComboBox; -class QLabel; -class QSpinBox; - -class CSpinBox; - -// Utility class which forwards calls to OnPicaBreakPointHit and OnPicaResume to public slots. -// This is because the Pica breakpoint callbacks are called from a non-GUI thread, while -// the widget usually wants to perform reactions in the GUI thread. -class BreakPointObserverDock : public QDockWidget, Pica::DebugContext::BreakPointObserver { - Q_OBJECT - -public: - BreakPointObserverDock(std::shared_ptr debug_context, const QString& title, - QWidget* parent = nullptr); - - void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; - void OnPicaResume() override; - -private slots: - virtual void OnBreakPointHit(Pica::DebugContext::Event event, void* data) = 0; - virtual void OnResumed() = 0; - -signals: - void Resumed(); - void BreakPointHit(Pica::DebugContext::Event event, void* data); -}; - -class GraphicsFramebufferWidget : public BreakPointObserverDock { - Q_OBJECT - - using Event = Pica::DebugContext::Event; - - enum class Source { - PicaTarget = 0, - Custom = 1, - - // TODO: Add GPU framebuffer sources! - }; - - enum class Format { - RGBA8 = 0, - RGB8 = 1, - RGBA5551 = 2, - RGB565 = 3, - RGBA4 = 4, - }; - -public: - GraphicsFramebufferWidget(std::shared_ptr debug_context, QWidget* parent = nullptr); - -public slots: - void OnFramebufferSourceChanged(int new_value); - void OnFramebufferAddressChanged(qint64 new_value); - void OnFramebufferWidthChanged(unsigned int new_value); - void OnFramebufferHeightChanged(unsigned int new_value); - void OnFramebufferFormatChanged(int new_value); - void OnUpdate(); - -private slots: - void OnBreakPointHit(Pica::DebugContext::Event event, void* data) override; - void OnResumed() override; - -signals: - void Update(); - -private: - - QComboBox* framebuffer_source_list; - CSpinBox* framebuffer_address_control; - QSpinBox* framebuffer_width_control; - QSpinBox* framebuffer_height_control; - QComboBox* framebuffer_format_control; - - QLabel* framebuffer_picture_label; - - Source framebuffer_source; - unsigned framebuffer_address; - unsigned framebuffer_width; - unsigned framebuffer_height; - Format framebuffer_format; -}; diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp index d3ff69a6..2b199bad 100644 --- a/src/citra_qt/debugger/ramview.cpp +++ b/src/citra_qt/debugger/ramview.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "ramview.hxx" +#include "ramview.h" #include "common/common.h" #include "core/mem_map.h" diff --git a/src/citra_qt/debugger/ramview.h b/src/citra_qt/debugger/ramview.h new file mode 100644 index 00000000..18423036 --- /dev/null +++ b/src/citra_qt/debugger/ramview.h @@ -0,0 +1,16 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "qhexedit.h" + +class GRamView : public QHexEdit +{ + Q_OBJECT + +public: + GRamView(QWidget* parent = NULL); + +public slots: + void OnCPUStepped(); +}; diff --git a/src/citra_qt/debugger/ramview.hxx b/src/citra_qt/debugger/ramview.hxx deleted file mode 100644 index 18423036..00000000 --- a/src/citra_qt/debugger/ramview.hxx +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "qhexedit.h" - -class GRamView : public QHexEdit -{ - Q_OBJECT - -public: - GRamView(QWidget* parent = NULL); - -public slots: - void OnCPUStepped(); -}; diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp index f798495b..e982dfb3 100644 --- a/src/citra_qt/debugger/registers.cpp +++ b/src/citra_qt/debugger/registers.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "registers.hxx" +#include "registers.h" #include "core/core.h" #include "core/arm/arm_interface.h" diff --git a/src/citra_qt/debugger/registers.h b/src/citra_qt/debugger/registers.h new file mode 100644 index 00000000..ac8429f2 --- /dev/null +++ b/src/citra_qt/debugger/registers.h @@ -0,0 +1,29 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "ui_registers.h" + +#include +#include + +class QTreeWidget; + +class RegistersWidget : public QDockWidget +{ + Q_OBJECT + +public: + RegistersWidget(QWidget* parent = NULL); + +public slots: + void OnCPUStepped(); + +private: + Ui::ARMRegisters cpu_regs_ui; + + QTreeWidget* tree; + + QTreeWidgetItem* registers; + QTreeWidgetItem* CSPR; +}; diff --git a/src/citra_qt/debugger/registers.hxx b/src/citra_qt/debugger/registers.hxx deleted file mode 100644 index ac8429f2..00000000 --- a/src/citra_qt/debugger/registers.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "ui_registers.h" - -#include -#include - -class QTreeWidget; - -class RegistersWidget : public QDockWidget -{ - Q_OBJECT - -public: - RegistersWidget(QWidget* parent = NULL); - -public slots: - void OnCPUStepped(); - -private: - Ui::ARMRegisters cpu_regs_ui; - - QTreeWidget* tree; - - QTreeWidgetItem* registers; - QTreeWidgetItem* CSPR; -}; diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 08be7ff7..322c25c9 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp @@ -4,7 +4,7 @@ #include #include -#include "hotkeys.hxx" +#include "hotkeys.h" #include struct Hotkey diff --git a/src/citra_qt/hotkeys.h b/src/citra_qt/hotkeys.h new file mode 100644 index 00000000..75c7cc62 --- /dev/null +++ b/src/citra_qt/hotkeys.h @@ -0,0 +1,54 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include +#include "ui_hotkeys.h" + +class QKeySequence; +class QSettings; + +/** + * Register a hotkey. + * + * @param group General group this hotkey belongs to (e.g. "Main Window", "Debugger") + * @param action Name of the action (e.g. "Start Emulation", "Load Image") + * @param default_keyseq Default key sequence to assign if the hotkey wasn't present in the settings file before + * @param default_context Default context to assign if the hotkey wasn't present in the settings file before + * @warning Both the group and action strings will be displayed in the hotkey settings dialog + */ +void RegisterHotkey(const QString& group, const QString& action, const QKeySequence& default_keyseq = QKeySequence(), Qt::ShortcutContext default_context = Qt::WindowShortcut); + +/** + * Returns a QShortcut object whose activated() signal can be connected to other QObjects' slots. + * + * @param widget Parent widget of the returned QShortcut. + * @warning If multiple QWidgets' call this function for the same action, the returned QShortcut will be the same. Thus, you shouldn't rely on the caller really being the QShortcut's parent. + */ +QShortcut* GetHotkey(const QString& group, const QString& action, QWidget* widget); + +/** + * Saves all registered hotkeys to the settings file. + * + * @note Each hotkey group will be stored a settings group; For each hotkey inside that group, a settings group will be created to store the key sequence and the hotkey context. + */ +void SaveHotkeys(QSettings& settings); + +/** + * Loads hotkeys from the settings file. + * + * @note Yet unregistered hotkeys which are present in the settings will automatically be registered. + */ +void LoadHotkeys(QSettings& settings); + +class GHotkeysDialog : public QDialog +{ + Q_OBJECT + +public: + GHotkeysDialog(QWidget* parent = NULL); + +private: + Ui::hotkeys ui; +}; diff --git a/src/citra_qt/hotkeys.hxx b/src/citra_qt/hotkeys.hxx deleted file mode 100644 index 75c7cc62..00000000 --- a/src/citra_qt/hotkeys.hxx +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include -#include -#include "ui_hotkeys.h" - -class QKeySequence; -class QSettings; - -/** - * Register a hotkey. - * - * @param group General group this hotkey belongs to (e.g. "Main Window", "Debugger") - * @param action Name of the action (e.g. "Start Emulation", "Load Image") - * @param default_keyseq Default key sequence to assign if the hotkey wasn't present in the settings file before - * @param default_context Default context to assign if the hotkey wasn't present in the settings file before - * @warning Both the group and action strings will be displayed in the hotkey settings dialog - */ -void RegisterHotkey(const QString& group, const QString& action, const QKeySequence& default_keyseq = QKeySequence(), Qt::ShortcutContext default_context = Qt::WindowShortcut); - -/** - * Returns a QShortcut object whose activated() signal can be connected to other QObjects' slots. - * - * @param widget Parent widget of the returned QShortcut. - * @warning If multiple QWidgets' call this function for the same action, the returned QShortcut will be the same. Thus, you shouldn't rely on the caller really being the QShortcut's parent. - */ -QShortcut* GetHotkey(const QString& group, const QString& action, QWidget* widget); - -/** - * Saves all registered hotkeys to the settings file. - * - * @note Each hotkey group will be stored a settings group; For each hotkey inside that group, a settings group will be created to store the key sequence and the hotkey context. - */ -void SaveHotkeys(QSettings& settings); - -/** - * Loads hotkeys from the settings file. - * - * @note Yet unregistered hotkeys which are present in the settings will automatically be registered. - */ -void LoadHotkeys(QSettings& settings); - -class GHotkeysDialog : public QDialog -{ - Q_OBJECT - -public: - GHotkeysDialog(QWidget* parent = NULL); - -private: - Ui::hotkeys ui; -}; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 64e389f2..c6671bef 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -8,7 +8,7 @@ #include #include #include "qhexedit.h" -#include "main.hxx" +#include "main.h" #include "common/common.h" #include "common/logging/text_formatter.h" @@ -22,18 +22,18 @@ #include #endif -#include "bootmanager.hxx" -#include "hotkeys.hxx" +#include "bootmanager.h" +#include "hotkeys.h" //debugger -#include "debugger/disassembler.hxx" -#include "debugger/registers.hxx" -#include "debugger/callstack.hxx" -#include "debugger/ramview.hxx" -#include "debugger/graphics.hxx" -#include "debugger/graphics_breakpoints.hxx" -#include "debugger/graphics_cmdlists.hxx" -#include "debugger/graphics_framebuffer.hxx" +#include "debugger/disassembler.h" +#include "debugger/registers.h" +#include "debugger/callstack.h" +#include "debugger/ramview.h" +#include "debugger/graphics.h" +#include "debugger/graphics_breakpoints.h" +#include "debugger/graphics_cmdlists.h" +#include "debugger/graphics_framebuffer.h" #include "core/settings.h" #include "core/system.h" diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h new file mode 100644 index 00000000..72df17c5 --- /dev/null +++ b/src/citra_qt/main.h @@ -0,0 +1,63 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#ifndef _CITRA_QT_MAIN_HXX_ +#define _CITRA_QT_MAIN_HXX_ + +#include + +#include "ui_main.h" + +class GImageInfo; +class GRenderWindow; +class DisassemblerWidget; +class RegistersWidget; +class CallstackWidget; +class GPUCommandStreamWidget; +class GPUCommandListWidget; + +class GMainWindow : public QMainWindow +{ + Q_OBJECT + + // TODO: Make use of this! + enum { + UI_IDLE, + UI_EMU_BOOTING, + UI_EMU_RUNNING, + UI_EMU_STOPPING, + }; + +public: + GMainWindow(); + ~GMainWindow(); + +private: + void BootGame(std::string filename); + + void closeEvent(QCloseEvent* event) override; + +private slots: + void OnStartGame(); + void OnPauseGame(); + void OnStopGame(); + void OnMenuLoadFile(); + void OnMenuLoadSymbolMap(); + void OnOpenHotkeysDialog(); + void OnConfigure(); + void ToggleWindowMode(); + +private: + Ui::MainWindow ui; + + GRenderWindow* render_window; + + DisassemblerWidget* disasmWidget; + RegistersWidget* registersWidget; + CallstackWidget* callstackWidget; + GPUCommandStreamWidget* graphicsWidget; + GPUCommandListWidget* graphicsCommandsWidget; +}; + +#endif // _CITRA_QT_MAIN_HXX_ diff --git a/src/citra_qt/main.hxx b/src/citra_qt/main.hxx deleted file mode 100644 index 72df17c5..00000000 --- a/src/citra_qt/main.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#ifndef _CITRA_QT_MAIN_HXX_ -#define _CITRA_QT_MAIN_HXX_ - -#include - -#include "ui_main.h" - -class GImageInfo; -class GRenderWindow; -class DisassemblerWidget; -class RegistersWidget; -class CallstackWidget; -class GPUCommandStreamWidget; -class GPUCommandListWidget; - -class GMainWindow : public QMainWindow -{ - Q_OBJECT - - // TODO: Make use of this! - enum { - UI_IDLE, - UI_EMU_BOOTING, - UI_EMU_RUNNING, - UI_EMU_STOPPING, - }; - -public: - GMainWindow(); - ~GMainWindow(); - -private: - void BootGame(std::string filename); - - void closeEvent(QCloseEvent* event) override; - -private slots: - void OnStartGame(); - void OnPauseGame(); - void OnStopGame(); - void OnMenuLoadFile(); - void OnMenuLoadSymbolMap(); - void OnOpenHotkeysDialog(); - void OnConfigure(); - void ToggleWindowMode(); - -private: - Ui::MainWindow ui; - - GRenderWindow* render_window; - - DisassemblerWidget* disasmWidget; - RegistersWidget* registersWidget; - CallstackWidget* callstackWidget; - GPUCommandStreamWidget* graphicsWidget; - GPUCommandListWidget* graphicsCommandsWidget; -}; - -#endif // _CITRA_QT_MAIN_HXX_ diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp index f9988409..54f628e4 100644 --- a/src/citra_qt/util/spinbox.cpp +++ b/src/citra_qt/util/spinbox.cpp @@ -34,7 +34,7 @@ #include "common/log.h" -#include "spinbox.hxx" +#include "spinbox.h" CSpinBox::CSpinBox(QWidget* parent) : QAbstractSpinBox(parent), base(10), min_value(-100), max_value(100), value(0), num_digits(0) { diff --git a/src/citra_qt/util/spinbox.h b/src/citra_qt/util/spinbox.h new file mode 100644 index 00000000..ee7f08ec --- /dev/null +++ b/src/citra_qt/util/spinbox.h @@ -0,0 +1,88 @@ +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + + +// Copyright 2014 Tony Wasserka +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of the owner nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#pragma once + +#include +#include + +class QVariant; + +/** + * A custom spin box widget with enhanced functionality over Qt's QSpinBox + */ +class CSpinBox : public QAbstractSpinBox { + Q_OBJECT + +public: + CSpinBox(QWidget* parent = nullptr); + + void stepBy(int steps) override; + StepEnabled stepEnabled() const override; + + void SetValue(qint64 val); + + void SetRange(qint64 min, qint64 max); + + void SetBase(int base); + + void SetPrefix(const QString& prefix); + void SetSuffix(const QString& suffix); + + void SetNumDigits(int num_digits); + + QValidator::State validate(QString& input, int& pos) const override; + +signals: + void ValueChanged(qint64 val); + +private slots: + void OnEditingFinished(); + +private: + void UpdateText(); + + bool HasSign() const; + + QString TextFromValue(); + qint64 ValueFromText(); + + qint64 min_value, max_value; + + qint64 value; + + QString prefix, suffix; + + int base; + + int num_digits; +}; diff --git a/src/citra_qt/util/spinbox.hxx b/src/citra_qt/util/spinbox.hxx deleted file mode 100644 index ee7f08ec..00000000 --- a/src/citra_qt/util/spinbox.hxx +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - - -// Copyright 2014 Tony Wasserka -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// * Neither the name of the owner nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#pragma once - -#include -#include - -class QVariant; - -/** - * A custom spin box widget with enhanced functionality over Qt's QSpinBox - */ -class CSpinBox : public QAbstractSpinBox { - Q_OBJECT - -public: - CSpinBox(QWidget* parent = nullptr); - - void stepBy(int steps) override; - StepEnabled stepEnabled() const override; - - void SetValue(qint64 val); - - void SetRange(qint64 min, qint64 max); - - void SetBase(int base); - - void SetPrefix(const QString& prefix); - void SetSuffix(const QString& suffix); - - void SetNumDigits(int num_digits); - - QValidator::State validate(QString& input, int& pos) const override; - -signals: - void ValueChanged(qint64 val); - -private slots: - void OnEditingFinished(); - -private: - void UpdateText(); - - bool HasSign() const; - - QString TextFromValue(); - qint64 ValueFromText(); - - qint64 min_value, max_value; - - qint64 value; - - QString prefix, suffix; - - int base; - - int num_digits; -}; -- cgit v1.2.3