diff --git a/pcsx2/GS/GS.h b/pcsx2/GS/GS.h index 4c27ec70e8..9b54e91126 100644 --- a/pcsx2/GS/GS.h +++ b/pcsx2/GS/GS.h @@ -247,7 +247,7 @@ #if !defined(_MSC_VER) // http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin_x86.h?view=markup - __forceinline int _BitScanForward(unsigned long* const Index, const unsigned long Mask) + static int _BitScanForward(unsigned long* const Index, const unsigned long Mask) { #if defined(__GCC_ASM_FLAG_OUTPUTS__) && 0 // Need GCC6 to test the code validity @@ -265,8 +265,8 @@ // gcc 4.8 define __rdtsc but unfortunately the compiler crash... // The redefine allow to skip the gcc __rdtsc version -- Gregory #define __rdtsc _lnx_rdtsc - //__forceinline unsigned long long __rdtsc() - __forceinline unsigned long long _lnx_rdtsc() + //static unsigned long long __rdtsc() + static unsigned long long _lnx_rdtsc() { #if defined(__amd64__) || defined(__x86_64__) unsigned long long low, high; diff --git a/pcsx2/GS/GSVector.h b/pcsx2/GS/GSVector.h index 4fc6b5dba7..b64030f2f4 100644 --- a/pcsx2/GS/GSVector.h +++ b/pcsx2/GS/GSVector.h @@ -23,6 +23,12 @@ #pragma once +#ifdef _WIN32 +# define gsforceinline __forceinline +#else +# define gsforceinline __forceinline __inline__ +#endif + enum Align_Mode { Align_Outside, @@ -105,24 +111,24 @@ class GSVector8i; // conversion -__forceinline GSVector4i::GSVector4i(const GSVector4& v, bool truncate) +gsforceinline GSVector4i::GSVector4i(const GSVector4& v, bool truncate) { m = truncate ? _mm_cvttps_epi32(v) : _mm_cvtps_epi32(v); } -__forceinline GSVector4::GSVector4(const GSVector4i& v) +gsforceinline GSVector4::GSVector4(const GSVector4i& v) { m = _mm_cvtepi32_ps(v); } #if _M_SSE >= 0x501 -__forceinline GSVector8i::GSVector8i(const GSVector8& v, bool truncate) +gsforceinline GSVector8i::GSVector8i(const GSVector8& v, bool truncate) { m = truncate ? _mm256_cvttps_epi32(v) : _mm256_cvtps_epi32(v); } -__forceinline GSVector8::GSVector8(const GSVector8i& v) +gsforceinline GSVector8::GSVector8(const GSVector8i& v) { m = _mm256_cvtepi32_ps(v); } @@ -131,34 +137,34 @@ __forceinline GSVector8::GSVector8(const GSVector8i& v) // casting -__forceinline GSVector4i GSVector4i::cast(const GSVector4& v) +gsforceinline GSVector4i GSVector4i::cast(const GSVector4& v) { return GSVector4i(_mm_castps_si128(v.m)); } -__forceinline GSVector4 GSVector4::cast(const GSVector4i& v) +gsforceinline GSVector4 GSVector4::cast(const GSVector4i& v) { return GSVector4(_mm_castsi128_ps(v.m)); } #if _M_SSE >= 0x500 -__forceinline GSVector4i GSVector4i::cast(const GSVector8& v) +gsforceinline GSVector4i GSVector4i::cast(const GSVector8& v) { return GSVector4i(_mm_castps_si128(_mm256_castps256_ps128(v))); } -__forceinline GSVector4 GSVector4::cast(const GSVector8& v) +gsforceinline GSVector4 GSVector4::cast(const GSVector8& v) { return GSVector4(_mm256_castps256_ps128(v)); } -__forceinline GSVector8 GSVector8::cast(const GSVector4i& v) +gsforceinline GSVector8 GSVector8::cast(const GSVector4i& v) { return GSVector8(_mm256_castps128_ps256(_mm_castsi128_ps(v.m))); } -__forceinline GSVector8 GSVector8::cast(const GSVector4& v) +gsforceinline GSVector8 GSVector8::cast(const GSVector4& v) { return GSVector8(_mm256_castps128_ps256(v.m)); } @@ -167,32 +173,32 @@ __forceinline GSVector8 GSVector8::cast(const GSVector4& v) #if _M_SSE >= 0x501 -__forceinline GSVector4i GSVector4i::cast(const GSVector8i& v) +gsforceinline GSVector4i GSVector4i::cast(const GSVector8i& v) { return GSVector4i(_mm256_castsi256_si128(v)); } -__forceinline GSVector4 GSVector4::cast(const GSVector8i& v) +gsforceinline GSVector4 GSVector4::cast(const GSVector8i& v) { return GSVector4(_mm_castsi128_ps(_mm256_castsi256_si128(v))); } -__forceinline GSVector8i GSVector8i::cast(const GSVector4i& v) +gsforceinline GSVector8i GSVector8i::cast(const GSVector4i& v) { return GSVector8i(_mm256_castsi128_si256(v.m)); } -__forceinline GSVector8i GSVector8i::cast(const GSVector4& v) +gsforceinline GSVector8i GSVector8i::cast(const GSVector4& v) { return GSVector8i(_mm256_castsi128_si256(_mm_castps_si128(v.m))); } -__forceinline GSVector8i GSVector8i::cast(const GSVector8& v) +gsforceinline GSVector8i GSVector8i::cast(const GSVector8& v) { return GSVector8i(_mm256_castps_si256(v.m)); } -__forceinline GSVector8 GSVector8::cast(const GSVector8i& v) +gsforceinline GSVector8 GSVector8::cast(const GSVector8i& v) { return GSVector8(_mm256_castsi256_ps(v.m)); } diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index c653675bfc..55d249a7be 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -84,7 +84,6 @@ public: virtual SaveStateBase& FreezeMainMemory(); virtual SaveStateBase& FreezeBios(); virtual SaveStateBase& FreezeInternals(); - virtual SaveStateBase& FreezePlugins(); // Loads or saves an arbitrary data type. Usable on atomic types, structs, and arrays. // For dynamically allocated pointers use FreezeMem instead. diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 4b486c92cc..745cc20d66 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -45,7 +45,7 @@ typedef struct _keyEvent u32 evt; } keyEvent; -uptr pDsp[2]; +extern uptr pDsp[2]; typedef void FnType_OnThreadComplete(const wxCommandEvent& evt); typedef void (Pcsx2App::*FnPtr_Pcsx2App)(); diff --git a/pcsx2/gui/AppEventListeners.h b/pcsx2/gui/AppEventListeners.h index f0a29a024d..a2d12bff22 100644 --- a/pcsx2/gui/AppEventListeners.h +++ b/pcsx2/gui/AppEventListeners.h @@ -39,18 +39,6 @@ enum AppEventType AppStatus_Exiting }; -enum PluginEventType -{ - CorePlugins_Loaded, - CorePlugins_Init, - CorePlugins_Opening, // dispatched prior to plugins being opened - CorePlugins_Opened, // dispatched after plugins are opened - CorePlugins_Closing, // dispatched prior to plugins being closed - CorePlugins_Closed, // dispatched after plugins are closed - CorePlugins_Shutdown, - CorePlugins_Unloaded, -}; - struct AppEventInfo { AppEventType evt_type; @@ -101,37 +89,6 @@ public: virtual ~EventListener_CoreThread(); }; -// -------------------------------------------------------------------------------------- -// IEventListener_Plugins -// -------------------------------------------------------------------------------------- -class IEventListener_Plugins : public IEventDispatcher -{ -public: - typedef PluginEventType EvtParams; - -public: - virtual ~IEventListener_Plugins() = default; - - virtual void DispatchEvent( const PluginEventType& pevt ); - -protected: - virtual void CorePlugins_OnLoaded() {} - virtual void CorePlugins_OnInit() {} - virtual void CorePlugins_OnOpening() {} // dispatched prior to plugins being opened - virtual void CorePlugins_OnOpened() {} // dispatched after plugins are opened - virtual void CorePlugins_OnClosing() {} // dispatched prior to plugins being closed - virtual void CorePlugins_OnClosed() {} // dispatched after plugins are closed - virtual void CorePlugins_OnShutdown() {} - virtual void CorePlugins_OnUnloaded() {} -}; - -class EventListener_Plugins : public IEventListener_Plugins -{ -public: - EventListener_Plugins(); - virtual ~EventListener_Plugins(); -}; - // -------------------------------------------------------------------------------------- // IEventListener_AppStatus // -------------------------------------------------------------------------------------- @@ -202,35 +159,6 @@ protected: void CoreThread_OnStopped() { Owner.OnCoreThread_Stopped(); } }; -template< typename TypeToDispatchTo > -class EventListenerHelper_Plugins : public EventListener_Plugins -{ -public: - TypeToDispatchTo& Owner; - -public: - EventListenerHelper_Plugins( TypeToDispatchTo& dispatchTo ) - : Owner( dispatchTo ) { } - - EventListenerHelper_Plugins( TypeToDispatchTo* dispatchTo ) - : Owner( *dispatchTo ) - { - pxAssert(dispatchTo != NULL); - } - - virtual ~EventListenerHelper_Plugins() = default; - -protected: - void CorePlugins_OnLoaded() { Owner.OnCorePlugins_Loaded(); } - void CorePlugins_OnInit() { Owner.OnCorePlugins_Init(); } - void CorePlugins_OnOpening() { Owner.OnCorePlugins_Opening(); } - void CorePlugins_OnOpened() { Owner.OnCorePlugins_Opened(); } - void CorePlugins_OnClosing() { Owner.OnCorePlugins_Closing(); } - void CorePlugins_OnClosed() { Owner.OnCorePlugins_Closed(); } - void CorePlugins_OnShutdown() { Owner.OnCorePlugins_Shutdown(); } - void CorePlugins_OnUnloaded() { Owner.OnCorePlugins_Unloaded(); } -}; - template< typename TypeToDispatchTo > class EventListenerHelper_AppStatus : public EventListener_AppStatus { diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 2a7195ebfb..32c17d8b01 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -74,6 +74,8 @@ std::unique_ptr g_Conf; AspectRatioType iniAR; bool switchAR; +uptr pDsp[2]; + // Returns a string message telling the user to consult guides for obtaining a legal BIOS. // This message is in a function because it's used as part of several dialogs in PCSX2 (there // are multiple variations on the BIOS and BIOS folder checks). diff --git a/pcsx2/gui/GSFrame.h b/pcsx2/gui/GSFrame.h index 0591d5b611..eb5f63836c 100644 --- a/pcsx2/gui/GSFrame.h +++ b/pcsx2/gui/GSFrame.h @@ -87,7 +87,6 @@ protected: class GSFrame : public wxFrame , public EventListener_AppStatus , public EventListener_CoreThread - , public EventListener_Plugins { typedef wxFrame _parent;