diff --git a/Utilities/SMutex.h b/Utilities/SMutex.h index 9ca53ce0e9..a769fe5469 100644 --- a/Utilities/SMutex.h +++ b/Utilities/SMutex.h @@ -1,5 +1,6 @@ #pragma once #include "BEType.h" +#include "Emu/System.h" extern void SM_Sleep(); extern size_t SM_GetCurrentThreadId(); @@ -123,7 +124,7 @@ public: default: return res; } - if (wait) wait(); + if (wait != nullptr) wait(); if (timeout && counter++ > timeout) { diff --git a/rpcs3/Emu/DbgCommand.cpp b/rpcs3/Emu/DbgCommand.cpp index 211195e1cf..adc4b58bfe 100644 --- a/rpcs3/Emu/DbgCommand.cpp +++ b/rpcs3/Emu/DbgCommand.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" +#include "rpcs3.h" void SendDbgCommand(DbgCommand id, CPUThread* thr ) { wxGetApp().SendDbgCommand(id, thr); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/GS/GCM.h b/rpcs3/Emu/GS/GCM.h index 1b444ae079..5c766ebf46 100644 --- a/rpcs3/Emu/GS/GCM.h +++ b/rpcs3/Emu/GS/GCM.h @@ -1330,10 +1330,8 @@ static const std::string GetMethodName(const u32 id) { NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } , }; - for (u32 i = 0; i < SARRSIZEOF(METHOD_NAME_LIST); ++i) - { - if(METHOD_NAME_LIST[i].id == id) return "cellGcm" + METHOD_NAME_LIST[i].name; - } + for(auto& s: METHOD_NAME_LIST) + if(s.id == id) return "cellGcm" + s.name; return fmt::Format("unknown/illegal method [0x%08x]", id); } diff --git a/rpcs3/Emu/GS/GL/GLVertexProgram.cpp b/rpcs3/Emu/GS/GL/GLVertexProgram.cpp index cc6f14312e..82f08dc5b7 100644 --- a/rpcs3/Emu/GS/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLVertexProgram.cpp @@ -77,7 +77,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n) ret += m_parr.AddParam(PARAM_NONE, "vec4", "tmp" + std::to_string(src[n].tmp_src)); break; case 2: //input - if (d1.input_src < SARRSIZEOF(reg_table)) + if (d1.input_src < (sizeof(reg_table)/sizeof(reg_table[0]))) { ret += m_parr.AddParam(PARAM_IN, "vec4", reg_table[d1.input_src], d1.input_src); } diff --git a/rpcs3/Emu/Io/Windows/WindowsKeyboardHandler.h b/rpcs3/Emu/Io/Windows/WindowsKeyboardHandler.h index 3ecb827d4b..92012237f3 100644 --- a/rpcs3/Emu/Io/Windows/WindowsKeyboardHandler.h +++ b/rpcs3/Emu/Io/Windows/WindowsKeyboardHandler.h @@ -3,6 +3,7 @@ #include #include #include "Emu/Io/KeyboardHandler.h" +#include "rpcs3.h" class WindowsKeyboardHandler final : public wxWindow @@ -171,4 +172,4 @@ public: m_keyboards[0].m_buttons.emplace_back('\\', CELL_KEYC_BACKSLASH_106); //m_keyboards[0].m_buttons.emplace_back(, CELL_KEYC_YEN_106); } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp index e339a6143e..7fcc039748 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp @@ -5,6 +5,7 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/Modules.h" +#include "rpcs3.h" #include "cellSysutil.h" #include "cellMsgDialog.h" @@ -442,4 +443,4 @@ int cellMsgDialogProgressBarInc(u32 progressBarIndex, u32 delta) } }); return CELL_OK; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 8f99e5b284..d64cc2e592 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -8,9 +8,18 @@ #include "Emu/GS/GSManager.h" #include "Emu/Audio/AudioManager.h" #include "Emu/FS/VFS.h" +#include "Emu/DbgCommand.h" #include "Loader/Loader.h" #include "SysCalls/Callback.h" +enum Status +{ + Running, + Paused, + Stopped, + Ready, +}; + class EventManager; class ModuleManager; class StaticFuncManager; diff --git a/rpcs3/Gui/CompilerELF.h b/rpcs3/Gui/CompilerELF.h index 6e1c4df161..6608f4d8c3 100644 --- a/rpcs3/Gui/CompilerELF.h +++ b/rpcs3/Gui/CompilerELF.h @@ -4,6 +4,7 @@ #include "Loader/ELF64.h" #include #include +#include "Gui/MainFrame.h" class CompilerELF : public FrameBase { diff --git a/rpcs3/Gui/GSFrame.cpp b/rpcs3/Gui/GSFrame.cpp index b180c0c54d..0a3f53f92f 100644 --- a/rpcs3/Gui/GSFrame.cpp +++ b/rpcs3/Gui/GSFrame.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "GSFrame.h" +#include "rpcs3.h" BEGIN_EVENT_TABLE(GSFrame, wxFrame) EVT_PAINT(GSFrame::OnPaint) @@ -79,4 +80,4 @@ m_size.SetHeight(height); //wxFrame::SetSize(width, height); OnSize(wxSizeEvent()); } -*/ \ No newline at end of file +*/ diff --git a/rpcs3/Gui/MainFrame.h b/rpcs3/Gui/MainFrame.h index 9a11d02f13..975230eef7 100644 --- a/rpcs3/Gui/MainFrame.h +++ b/rpcs3/Gui/MainFrame.h @@ -2,6 +2,7 @@ #include "Gui/Debugger.h" #include "Gui/ConLogFrame.h" +#include "Gui/FrameBase.h" #include diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 618f526901..302c56290f 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -6,9 +6,6 @@ #include #endif -/* size of statically declared array */ -#define SARRSIZEOF(array) (sizeof(array)/sizeof(array[0])) - #define NOMINMAX #ifndef QT_UI #include @@ -41,14 +38,10 @@ #include #endif -#ifdef MSVC_CRT_MEMLEAK_DETECTION - #ifdef _DEBUG - #ifndef DBG_NEW - #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) - #define new DBG_NEW - #endif - #endif // _DEBUG -#endif // MSVC_CRT_MEMLEAK_DETECTION +#if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && !defined(DBG_NEW) + #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) + #define new DBG_NEW +#endif // This header should be frontend-agnostic, so don't assume wx includes everything #include @@ -68,14 +61,6 @@ typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; -enum Status -{ - Running, - Paused, - Stopped, - Ready, -}; - #include "Utilities/StrFmt.h" #include "Utilities/Log.h" #include "Utilities/BEType.h" @@ -90,15 +75,11 @@ enum Status #include "Utilities/Timer.h" #include "Utilities/IdManager.h" -#include "Gui/FrameBase.h" -#include "Emu/System.h" #include "Emu/SysCalls/Callback.h" -#include "Emu/DbgCommand.h" #include "Emu/Cell/PPUThread.h" #include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/Modules.h" - #include "Emu/FS/vfsDirBase.h" #include "Emu/FS/vfsFileBase.h" #include "Emu/FS/vfsLocalDir.h" @@ -107,9 +88,6 @@ enum Status #include "Emu/FS/vfsStreamMemory.h" #include "Emu/FS/vfsFile.h" #include "Emu/FS/vfsDir.h" -#ifndef QT_UI -#include "rpcs3.h" -#endif #define _PRGNAME_ "RPCS3" #define _PRGVER_ "0.0.0.4"