VERY experimental Nintendo Switch 2 emulator
C++
Add `override` keyword through the code.
Yuri Kunde Schlesnerd72708c1f582
diff --git a/src/citra/emu_window/emu_window_glfw.h b/src/citra/emu_window/emu_window_glfw.hindex 638e026ef7..7c3072145f 100644--- a/src/citra/emu_window/emu_window_glfw.h+++ b/src/citra/emu_window/emu_window_glfw.h@@ -14,16 +14,16 @@ public:~EmuWindow_GLFW();/// Swap buffers to display the next frame- void SwapBuffers();+ void SwapBuffers() override;/// Polls window events- void PollEvents();+ void PollEvents() override;/// Makes the graphics context current for the caller thread- void MakeCurrent();+ void MakeCurrent() override;/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread- void DoneCurrent();+ void DoneCurrent() override;static void OnKeyEvent(GLFWwindow* win, int key, int scancode, int action, int mods);diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cppindex 0430aa1edf..8f3799351b 100644--- a/src/citra_qt/bootmanager.cpp+++ b/src/citra_qt/bootmanager.cpp@@ -90,10 +90,10 @@ public:parent_ = parent;}- void paintEvent(QPaintEvent* ev)+ void paintEvent(QPaintEvent* ev) override{}- void resizeEvent(QResizeEvent* ev) {+ void resizeEvent(QResizeEvent* ev) override {parent_->SetClientAreaWidth(size().width());parent_->SetClientAreaHeight(size().height());}diff --git a/src/citra_qt/bootmanager.hxx b/src/citra_qt/bootmanager.hxxindex 816ffed2e8..f8afc403eb 100644--- a/src/citra_qt/bootmanager.hxx+++ b/src/citra_qt/bootmanager.hxx@@ -25,7 +25,7 @@ public:** @warning Only call when not running!*/- void run();+ void run() override;/*** Allow the CPU to process a single instruction (if cpu is not running)@@ -89,13 +89,13 @@ public:GRenderWindow(QWidget* parent = NULL);~GRenderWindow();- void closeEvent(QCloseEvent*);+ void closeEvent(QCloseEvent*) override;// EmuWindow implementation- void SwapBuffers();- void MakeCurrent();- void DoneCurrent();- void PollEvents();+ void SwapBuffers() override;+ void MakeCurrent() override;+ void DoneCurrent() override;+ void PollEvents() override;void BackupGeometry();void RestoreGeometry();@@ -104,8 +104,8 @@ public:EmuThread& GetEmuThread();- void keyPressEvent(QKeyEvent* event);- void keyReleaseEvent(QKeyEvent* event);+ void keyPressEvent(QKeyEvent* event) override;+ void keyReleaseEvent(QKeyEvent* event) override;void ReloadSetKeymaps() override;diff --git a/src/citra_qt/debugger/graphics_cmdlists.hxx b/src/citra_qt/debugger/graphics_cmdlists.hxxindex 479ef03264..1523e724f1 100644--- a/src/citra_qt/debugger/graphics_cmdlists.hxx+++ b/src/citra_qt/debugger/graphics_cmdlists.hxx@@ -17,7 +17,7 @@ class GPUCommandListModel : public QAbstractListModelpublic:GPUCommandListModel(QObject* parent);- int columnCount(const QModelIndex& parent = QModelIndex()) const;+ 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;diff --git a/src/citra_qt/main.hxx b/src/citra_qt/main.hxxindex a0b41f5f4c..b1b40df464 100644--- a/src/citra_qt/main.hxx+++ b/src/citra_qt/main.hxx@@ -32,7 +32,7 @@ public:private:void BootGame(std::string filename);- void closeEvent(QCloseEvent* event);+ void closeEvent(QCloseEvent* event) override;private slots:void OnStartGame();diff --git a/src/common/console_listener.h b/src/common/console_listener.hindex 3c0e420c68..ebd90a1050 100644--- a/src/common/console_listener.h+++ b/src/common/console_listener.h@@ -26,7 +26,7 @@ public:#ifdef _WIN32COORD GetCoordinates(int BytesRead, int BufferWidth);#endif- void Log(LogTypes::LOG_LEVELS, const char *Text);+ void Log(LogTypes::LOG_LEVELS, const char *Text) override;void ClearScreen(bool Cursor = true);private:diff --git a/src/common/log_manager.h b/src/common/log_manager.hindex ce62d03614..de1d16ee5c 100644--- a/src/common/log_manager.h+++ b/src/common/log_manager.h@@ -30,7 +30,7 @@ class FileLogListener : public LogListenerpublic:FileLogListener(const char *filename);- void Log(LogTypes::LOG_LEVELS, const char *msg);+ void Log(LogTypes::LOG_LEVELS, const char *msg) override;bool IsValid() { return !m_logfile.fail(); }bool IsEnabled() const { return m_enable; }@@ -47,7 +47,7 @@ private:class DebuggerLogListener : public LogListener{public:- void Log(LogTypes::LOG_LEVELS, const char *msg);+ void Log(LogTypes::LOG_LEVELS, const char *msg) override;};class LogContainerdiff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.hindex 9f88dd139e..1f8cd3a3a4 100644--- a/src/core/arm/dyncom/arm_dyncom.h+++ b/src/core/arm/dyncom/arm_dyncom.h@@ -21,7 +21,7 @@ public:* Set the Program Counter to an address* @param addr Address to set PC to*/- void SetPC(u32 pc);+ void SetPC(u32 pc) override;/** Get the current Program Counter@@ -41,7 +41,7 @@ public:* @param index Register index (0-15)* @param value Value to set register to*/- void SetReg(int index, u32 value);+ void SetReg(int index, u32 value) override;/*** Get the current CPSR register@@ -53,7 +53,7 @@ public:* Set the current CPSR register* @param cpsr Value to set CPSR to*/- void SetCPSR(u32 cpsr);+ void SetCPSR(u32 cpsr) override;/*** Returns the number of clock ticks since the last reset@@ -65,22 +65,22 @@ public:* Saves the current CPU context* @param ctx Thread context to save*/- void SaveContext(ThreadContext& ctx);+ void SaveContext(ThreadContext& ctx) override;/*** Loads a CPU context* @param ctx Thread context to load*/- void LoadContext(const ThreadContext& ctx);+ void LoadContext(const ThreadContext& ctx) override;/// Prepare core for thread reschedule (if needed to correctly handle state)- void PrepareReschedule();+ void PrepareReschedule() override;/*** Executes the given number of instructions* @param num_instructions Number of instructions to executes*/- void ExecuteInstructions(int num_instructions);+ void ExecuteInstructions(int num_instructions) override;private:diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.hindex 49ae01a0c9..ceb1be438d 100644--- a/src/core/arm/interpreter/arm_interpreter.h+++ b/src/core/arm/interpreter/arm_interpreter.h@@ -20,60 +20,60 @@ public:* Set the Program Counter to an address* @param addr Address to set PC to*/- void SetPC(u32 pc);+ void SetPC(u32 pc) override;/** Get the current Program Counter* @return Returns current PC*/- u32 GetPC() const;+ u32 GetPC() const override;/*** Get an ARM register* @param index Register index (0-15)* @return Returns the value in the register*/- u32 GetReg(int index) const;+ u32 GetReg(int index) const override;/*** Set an ARM register* @param index Register index (0-15)* @param value Value to set register to*/- void SetReg(int index, u32 value);+ void SetReg(int index, u32 value) override;/*** Get the current CPSR register* @return Returns the value of the CPSR register*/- u32 GetCPSR() const;+ u32 GetCPSR() const override;/*** Set the current CPSR register* @param cpsr Value to set CPSR to*/- void SetCPSR(u32 cpsr);+ void SetCPSR(u32 cpsr) override;/*** Returns the number of clock ticks since the last reset* @return Returns number of clock ticks*/- u64 GetTicks() const;+ u64 GetTicks() const override;/*** Saves the current CPU context* @param ctx Thread context to save*/- void SaveContext(ThreadContext& ctx);+ void SaveContext(ThreadContext& ctx) override;/*** Loads a CPU context* @param ctx Thread context to load*/- void LoadContext(const ThreadContext& ctx);+ void LoadContext(const ThreadContext& ctx) override;/// Prepare core for thread reschedule (if needed to correctly handle state)- void PrepareReschedule();+ void PrepareReschedule() override;protected:@@ -81,7 +81,7 @@ protected:* Executes the given number of instructions* @param num_instructions Number of instructions to executes*/- void ExecuteInstructions(int num_instructions);+ void ExecuteInstructions(int num_instructions) override;private:diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cppindex 174d4cd6e4..2b21657da1 100644--- a/src/core/hle/kernel/address_arbiter.cpp+++ b/src/core/hle/kernel/address_arbiter.cpp@@ -17,11 +17,11 @@ namespace Kernel {class AddressArbiter : public Object {public:- std::string GetTypeName() const { return "Arbiter"; }- std::string GetName() const { return name; }+ std::string GetTypeName() const override { return "Arbiter"; }+ std::string GetName() const override { return name; }static Kernel::HandleType GetStaticHandleType() { return HandleType::AddressArbiter; }- Kernel::HandleType GetHandleType() const { return HandleType::AddressArbiter; }+ Kernel::HandleType GetHandleType() const override { return HandleType::AddressArbiter; }std::string name; ///< Name of address arbiter object (optional)@@ -30,7 +30,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "(UNIMPLEMENTED)");return 0;diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cppindex 86aba74893..09b4e75a53 100644--- a/src/core/hle/kernel/archive.cpp+++ b/src/core/hle/kernel/archive.cpp@@ -42,11 +42,11 @@ enum class DirectoryCommand : u32 {class Archive : public Object {public:- std::string GetTypeName() const { return "Archive"; }- std::string GetName() const { return name; }+ std::string GetTypeName() const override { return "Archive"; }+ std::string GetName() const override { return name; }static Kernel::HandleType GetStaticHandleType() { return HandleType::Archive; }- Kernel::HandleType GetHandleType() const { return HandleType::Archive; }+ Kernel::HandleType GetHandleType() const override { return HandleType::Archive; }std::string name; ///< Name of archive (optional)FileSys::Archive* backend; ///< Archive backend interface@@ -56,7 +56,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result SyncRequest(bool* wait) {+ Result SyncRequest(bool* wait) override {u32* cmd_buff = Service::GetCommandBuffer();FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]);@@ -119,7 +119,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "(UNIMPLEMENTED)");return 0;@@ -128,11 +128,11 @@ public:class File : public Object {public:- std::string GetTypeName() const { return "File"; }- std::string GetName() const { return path; }+ std::string GetTypeName() const override { return "File"; }+ std::string GetName() const override { return path; }static Kernel::HandleType GetStaticHandleType() { return HandleType::File; }- Kernel::HandleType GetHandleType() const { return HandleType::File; }+ Kernel::HandleType GetHandleType() const override { return HandleType::File; }std::string path; ///< Path of the filestd::unique_ptr<FileSys::File> backend; ///< File backend interface@@ -142,7 +142,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result SyncRequest(bool* wait) {+ Result SyncRequest(bool* wait) override {u32* cmd_buff = Service::GetCommandBuffer();FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]);switch (cmd) {@@ -211,7 +211,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "(UNIMPLEMENTED)");return 0;@@ -220,11 +220,11 @@ public:class Directory : public Object {public:- std::string GetTypeName() const { return "Directory"; }- std::string GetName() const { return path; }+ std::string GetTypeName() const override { return "Directory"; }+ std::string GetName() const override { return path; }static Kernel::HandleType GetStaticHandleType() { return HandleType::Directory; }- Kernel::HandleType GetHandleType() const { return HandleType::Directory; }+ Kernel::HandleType GetHandleType() const override { return HandleType::Directory; }std::string path; ///< Path of the directorystd::unique_ptr<FileSys::Directory> backend; ///< File backend interface@@ -234,7 +234,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result SyncRequest(bool* wait) {+ Result SyncRequest(bool* wait) override {u32* cmd_buff = Service::GetCommandBuffer();DirectoryCommand cmd = static_cast<DirectoryCommand>(cmd_buff[0]);switch (cmd) {@@ -274,7 +274,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "(UNIMPLEMENTED)");return 0;diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cppindex 64f6a96499..45ed79be83 100644--- a/src/core/hle/kernel/event.cpp+++ b/src/core/hle/kernel/event.cpp@@ -16,11 +16,11 @@ namespace Kernel {class Event : public Object {public:- std::string GetTypeName() const { return "Event"; }- std::string GetName() const { return name; }+ std::string GetTypeName() const override { return "Event"; }+ std::string GetName() const override { return name; }static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Event; }- Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Event; }+ Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Event; }ResetType intitial_reset_type; ///< ResetType specified at Event initializationResetType reset_type; ///< Current ResetType@@ -35,7 +35,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {*wait = locked;if (locked) {Handle thread = GetCurrentThreadHandle();diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cppindex 5d7d65dd95..fcfd061ac7 100644--- a/src/core/hle/kernel/mutex.cpp+++ b/src/core/hle/kernel/mutex.cpp@@ -15,11 +15,11 @@ namespace Kernel {class Mutex : public Object {public:- std::string GetTypeName() const { return "Mutex"; }- std::string GetName() const { return name; }+ std::string GetTypeName() const override { return "Mutex"; }+ std::string GetName() const override { return name; }static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Mutex; }- Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Mutex; }+ Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Mutex; }bool initial_locked; ///< Initial lock state when mutex was createdbool locked; ///< Current locked state@@ -32,7 +32,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result SyncRequest(bool* wait) {+ Result SyncRequest(bool* wait) override {// TODO(bunnei): ImplementMelocked = true;return 0;@@ -43,7 +43,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMe*wait = locked;diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cppindex 2a6a483a10..6bd5e2728a 100644--- a/src/core/hle/kernel/shared_memory.cpp+++ b/src/core/hle/kernel/shared_memory.cpp@@ -11,17 +11,17 @@ namespace Kernel {class SharedMemory : public Object {public:- std::string GetTypeName() const { return "SharedMemory"; }+ std::string GetTypeName() const override { return "SharedMemory"; }static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::SharedMemory; }- Kernel::HandleType GetHandleType() const { return Kernel::HandleType::SharedMemory; }+ Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::SharedMemory; }/*** Wait for kernel object to synchronize* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "(UNIMPLEMENTED)");return 0;diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cppindex 33c0b2a472..e15590c498 100644--- a/src/core/hle/kernel/thread.cpp+++ b/src/core/hle/kernel/thread.cpp@@ -21,11 +21,11 @@ namespace Kernel {class Thread : public Kernel::Object {public:- std::string GetName() const { return name; }- std::string GetTypeName() const { return "Thread"; }+ std::string GetName() const override { return name; }+ std::string GetTypeName() const override { return "Thread"; }static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Thread; }- Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Thread; }+ Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Thread; }inline bool IsRunning() const { return (status & THREADSTATUS_RUNNING) != 0; }inline bool IsStopped() const { return (status & THREADSTATUS_DORMANT) != 0; }@@ -38,7 +38,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {if (status != THREADSTATUS_DORMANT) {Handle thread = GetCurrentThreadHandle();if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {diff --git a/src/core/hle/service/apt.h b/src/core/hle/service/apt.hindex 4c7dd07e7b..5af39e0851 100644--- a/src/core/hle/service/apt.h+++ b/src/core/hle/service/apt.h@@ -29,7 +29,7 @@ public:* Gets the string port name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "APT:U";}};diff --git a/src/core/hle/service/fs.h b/src/core/hle/service/fs.hindex 36f3697d3f..0053825405 100644--- a/src/core/hle/service/fs.h+++ b/src/core/hle/service/fs.h@@ -23,7 +23,7 @@ public:* Gets the string port name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "fs:USER";}};diff --git a/src/core/hle/service/gsp.h b/src/core/hle/service/gsp.hindex a09d59dbb7..177ce8da67 100644--- a/src/core/hle/service/gsp.h+++ b/src/core/hle/service/gsp.h@@ -167,7 +167,7 @@ public:* Gets the string port name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "gsp::Gpu";}diff --git a/src/core/hle/service/hid.h b/src/core/hle/service/hid.hindex a077e25cd3..9f6c4d5ed6 100644--- a/src/core/hle/service/hid.h+++ b/src/core/hle/service/hid.h@@ -111,7 +111,7 @@ public:* Gets the string port name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "hid:USER";}diff --git a/src/core/hle/service/ndm.h b/src/core/hle/service/ndm.hindex d5ec28f5ba..2ca9fcf221 100644--- a/src/core/hle/service/ndm.h+++ b/src/core/hle/service/ndm.h@@ -24,7 +24,7 @@ public:* Gets the string port name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "ndm:u";}diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.hindex c0e803bda1..2f5a866c99 100644--- a/src/core/hle/service/service.h+++ b/src/core/hle/service/service.h@@ -39,11 +39,11 @@ class Interface : public Kernel::Object {friend class Manager;public:- std::string GetName() const { return GetPortName(); }- std::string GetTypeName() const { return GetPortName(); }+ std::string GetName() const override { return GetPortName(); }+ std::string GetTypeName() const override { return GetPortName(); }static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Service; }- Kernel::HandleType GetHandleType() const { return Kernel::HandleType::Service; }+ Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Service; }typedef void (*Function)(Interface*);@@ -80,7 +80,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result SyncRequest(bool* wait) {+ Result SyncRequest(bool* wait) override {u32* cmd_buff = GetCommandBuffer();auto itr = m_functions.find(cmd_buff[0]);@@ -113,7 +113,7 @@ public:* @param wait Boolean wait set if current thread should wait as a result of sync operation* @return Result of operation, 0 on success, otherwise error code*/- Result WaitSynchronization(bool* wait) {+ Result WaitSynchronization(bool* wait) override {// TODO(bunnei): ImplementMeERROR_LOG(OSHLE, "unimplemented function");return 0;diff --git a/src/core/hle/service/srv.h b/src/core/hle/service/srv.hindex 9451472de8..6d5fe50485 100644--- a/src/core/hle/service/srv.h+++ b/src/core/hle/service/srv.h@@ -22,7 +22,7 @@ public:* Gets the string name used by CTROS for the service* @return Port name of service*/- std::string GetPortName() const {+ std::string GetPortName() const override {return "srv:";}diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.hindex 82ef4b14be..eed201a950 100644--- a/src/video_core/renderer_opengl/renderer_opengl.h+++ b/src/video_core/renderer_opengl/renderer_opengl.h@@ -21,19 +21,19 @@ public:~RendererOpenGL() override;/// Swap buffers (render frame)- void SwapBuffers();+ void SwapBuffers() override;/*** Set the emulator window to use for renderer* @param window EmuWindow handle to emulator window to use for rendering*/- void SetWindow(EmuWindow* window);+ void SetWindow(EmuWindow* window) override;/// Initialize the renderer- void Init();+ void Init() override;/// Shutdown the renderer- void ShutDown();+ void ShutDown() override;private:/// Structure used for storing information about the textures for each 3DS screen