diff --git a/Utilities/BEType.h b/Utilities/BEType.h index afca12b1f1..17e8e61beb 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -50,10 +50,10 @@ class be_t public: typedef T type; - - be_t() - { - } +#ifdef __GNUG__ + be_t() noexcept = default +#endif + be_t(){} be_t(const T& value) { diff --git a/Utilities/GNU.h b/Utilities/GNU.h index f3678958d8..a21c99c726 100644 --- a/Utilities/GNU.h +++ b/Utilities/GNU.h @@ -1,8 +1,8 @@ #pragma once #if defined(__GNUG__) -#include -#define _fpclass(x) fpclassify(x) +#include +#define _fpclass(x) std::fpclassify(x) #define __forceinline __attribute__((always_inline)) #define _byteswap_ushort(x) __builtin_bswap16(x) #define _byteswap_ulong(x) __builtin_bswap32(x) @@ -11,4 +11,9 @@ #define mkdir(x) mkdir(x, 0777) #define INFINITE 0xFFFFFFFF #define _CRT_ALIGN(x) __attribute__((aligned(x))) +#define InterlockedCompareExchange(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val) +#define InterlockedCompareExchange64(ptr,new_val,old_val) __sync_val_compare_and_swap(ptr,old_val,new_val) +#define _aligned_malloc(size,alignment) aligned_alloc(alignment,size) +#define _aligned_free(pointer) free(pointer) +#define DWORD int64_t #endif diff --git a/Utilities/IdManager.h b/Utilities/IdManager.h index fb8529c241..9ceb8ae66e 100644 --- a/Utilities/IdManager.h +++ b/Utilities/IdManager.h @@ -96,7 +96,11 @@ public: m_cur_id = s_first_id; } - template + template ID_TYPE GetNewID(const std::string& name = "", T* data = nullptr, const u32 attr = 0) { std::lock_guard lock(m_mtx_main); @@ -155,4 +159,4 @@ public: return true; } -}; \ No newline at end of file +}; diff --git a/Utilities/MTProgressDialog.h b/Utilities/MTProgressDialog.h index 5fb9f467a7..72ef148805 100644 --- a/Utilities/MTProgressDialog.h +++ b/Utilities/MTProgressDialog.h @@ -95,4 +95,4 @@ public: wxDialog::Close(force); } -}; \ No newline at end of file +}; diff --git a/Utilities/SMutex.cpp b/Utilities/SMutex.cpp index 3c1eecb3fc..7d9e9fdbd7 100644 --- a/Utilities/SMutex.cpp +++ b/Utilities/SMutex.cpp @@ -6,9 +6,9 @@ __forceinline void SM_Sleep() Sleep(1); } -__forceinline DWORD SM_GetCurrentThreadId() +__forceinline std::thread::id SM_GetCurrentThreadId() { - return GetCurrentThreadId(); + return std::this_thread::get_id(); } __forceinline u32 SM_GetCurrentCPUThreadId() @@ -23,4 +23,4 @@ __forceinline u32 SM_GetCurrentCPUThreadId() __forceinline be_t SM_GetCurrentCPUThreadIdBE() { return SM_GetCurrentCPUThreadId(); -} \ No newline at end of file +} diff --git a/Utilities/SMutex.h b/Utilities/SMutex.h index cd987b27f6..2f934d4c96 100644 --- a/Utilities/SMutex.h +++ b/Utilities/SMutex.h @@ -1,7 +1,7 @@ #pragma once extern void SM_Sleep(); -extern DWORD SM_GetCurrentThreadId(); +extern std::thread::id SM_GetCurrentThreadId(); extern u32 SM_GetCurrentCPUThreadId(); extern be_t SM_GetCurrentCPUThreadIdBE(); @@ -22,7 +22,7 @@ template typename T, u32 free_value = 0, u32 dead_value = ~0, - void (wait)() = SM_Sleep + void (*wait)() = SM_Sleep > class SMutexBase { @@ -164,9 +164,9 @@ typedef SMutexBase typedef SMutexBase> SMutexBE; -typedef SMutexLockerBase +typedef SMutexLockerBase SMutexGeneralLocker; typedef SMutexLockerBase SMutexLocker; typedef SMutexLockerBase, SM_GetCurrentCPUThreadIdBE> - SMutexBELocker; \ No newline at end of file + SMutexBELocker; diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index e3e76a6b84..6bd33d6b86 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1,7 +1,12 @@ #include "stdafx.h" #include "Thread.h" -__declspec(thread) NamedThreadBase* g_tls_this_thread = nullptr; +#ifdef _WIN32 +__declspec(thread) +#else +thread_local +#endif +NamedThreadBase* g_tls_this_thread = nullptr; NamedThreadBase* GetCurrentNamedThread() { @@ -125,7 +130,7 @@ void thread::start(std::function func) catch(...) { ConLog.Error("Crash :("); - terminate(); + std::terminate(); } }); } @@ -143,4 +148,4 @@ void thread::join() bool thread::joinable() const { return m_thr.joinable(); -} \ No newline at end of file +} diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 33b45911c4..da04de0051 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -141,7 +141,7 @@ class StepThread : public ThreadBase volatile bool m_exit; protected: - StepThread(const wxString& name = "Unknown StepThread") + StepThread(const std::string& name = "Unknown StepThread") : ThreadBase(true, name) , m_exit(false) { diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index e9e5502f41..3f041c074e 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -3,14 +3,15 @@ cmake_minimum_required(VERSION 2.8) project(rpcs3) if (CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-std=gnu++11) - add_definitions(-D__WXGTK__) - #add_definitions(-Wfatal-errors) - add_definitions(-w) # TODO: remove me - add_definitions(-DwxUSE_UNICODE=0) - add_definitions(-fpermissive) # TODO: remove me + add_definitions(-std=gnu++11) + #add_definitions(-D__WXGTK__) + #add_definitions(-Wfatal-errors) + add_definitions(-w) # TODO: remove me + add_definitions(-fpermissive) # TODO: remove me endif() +SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin") + add_definitions(-DGL_GLEXT_PROTOTYPES) add_definitions(-DGLX_GLXEXT_PROTOTYPES) diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index c7e369fbad..88470283bc 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -21,7 +21,7 @@ struct reservation_struct extern reservation_struct reservation; -enum CPUThreadType +enum CPUThreadType :unsigned char { CPU_THREAD_PPU, CPU_THREAD_SPU, diff --git a/rpcs3/Emu/CPU/CPUThreadManager.h b/rpcs3/Emu/CPU/CPUThreadManager.h index 45081d3625..1dd312ecbf 100644 --- a/rpcs3/Emu/CPU/CPUThreadManager.h +++ b/rpcs3/Emu/CPU/CPUThreadManager.h @@ -1,5 +1,6 @@ #pragma once -#include "CPUThread.h" +class CPUThread; +enum CPUThreadType : unsigned char; class CPUThreadManager { @@ -24,4 +25,4 @@ public: void Exec(); void Task(); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/Cell/PPCThreadManager.cpp b/rpcs3/Emu/Cell/PPCThreadManager.cpp index 2be6a26806..52e8b83ae7 100644 --- a/rpcs3/Emu/Cell/PPCThreadManager.cpp +++ b/rpcs3/Emu/Cell/PPCThreadManager.cpp @@ -1,3 +1,4 @@ +#if 0 #include "stdafx.h" #include "PPCThreadManager.h" #include "PPUThread.h" @@ -33,7 +34,7 @@ PPCThread& PPCThreadManager::AddThread(PPCThreadType type) default: assert(0); } - new_thread->SetId(Emu.GetIdManager().GetNewID(wxString::Format("%s Thread", name), new_thread)); + new_thread->SetId(Emu.GetIdManager().GetNewID(wxString::Format("%s Thread", name).ToStdString(), new_thread)); m_threads.Add(new_thread); wxGetApp().SendDbgCommand(DID_CREATE_THREAD, new_thread); @@ -106,3 +107,4 @@ void PPCThreadManager::Exec() m_threads[i].Exec(); } } +#endif diff --git a/rpcs3/Emu/Cell/PPCThreadManager.h b/rpcs3/Emu/Cell/PPCThreadManager.h index 3d2754302b..e1bea459cb 100644 --- a/rpcs3/Emu/Cell/PPCThreadManager.h +++ b/rpcs3/Emu/Cell/PPCThreadManager.h @@ -3,9 +3,9 @@ enum PPCThreadType { - PPC_THREAD_PPU, - PPC_THREAD_SPU, - PPC_THREAD_RAW_SPU + PPC_THREAD_PPU, + PPC_THREAD_SPU, + PPC_THREAD_RAW_SPU }; class PPCThreadManager @@ -17,7 +17,7 @@ class PPCThreadManager std::mutex m_mtx_thread; wxSemaphore m_sem_task; Stack m_delete_threads; - u32 m_raw_spu_num; + u32 m_raw_spu_num; public: PPCThreadManager(); diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index c7d76cf523..daba8dccef 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -97,7 +97,7 @@ private: const int fpc = _fpclass(v); #ifdef __GNUG__ if(fpc == FP_SUBNORMAL) - return signbit(v) ? -0.0f : 0.0f; + return std::signbit(v) ? -0.0f : 0.0f; #else if(fpc & _FPCLASS_ND) return -0.0f; if(fpc & _FPCLASS_PD) return 0.0f; @@ -3364,7 +3364,7 @@ private: #ifdef _MSC_VER if(_fpclass(CPU.FPR[frb]) >= _FPCLASS_NZ) #else - if(_fpclass(CPU.FPR[frb]) == FP_ZERO || signbit(CPU.FPR[frb]) == 0) + if(_fpclass(CPU.FPR[frb]) == FP_ZERO || std::signbit(CPU.FPR[frb]) == 0) #endif { res = static_cast(1.0 / CPU.FPR[frb]); diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index ddbb04945a..b4a12efedf 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -2,6 +2,7 @@ #include "Emu/Cell/PPCThread.h" #include "Emu/SysCalls/SysCalls.h" #include "rpcs3.h" +#include enum { @@ -373,10 +374,10 @@ struct PPCdouble switch (fpc) { case FP_NAN: return FPR_QNAN; - case FP_INFINITE: return signbit(_double) ? FPR_NINF : FPR_PINF; - case FP_SUBNORMAL: return signbit(_double) ? FPR_ND : FPR_PD; - case FP_ZERO: return signbit(_double) ? FPR_NZ : FPR_PZ; - default: return signbit(_double) ? FPR_NN : FPR_PN; + case FP_INFINITE: return std::signbit(_double) ? FPR_NINF : FPR_PINF; + case FP_SUBNORMAL: return std::signbit(_double) ? FPR_ND : FPR_PD; + case FP_ZERO: return std::signbit(_double) ? FPR_NZ : FPR_PZ; + default: return std::signbit(_double) ? FPR_NN : FPR_PN; } #endif diff --git a/rpcs3/Emu/Event.cpp b/rpcs3/Emu/Event.cpp index e31e2601fa..a1fee9d086 100644 --- a/rpcs3/Emu/Event.cpp +++ b/rpcs3/Emu/Event.cpp @@ -26,9 +26,9 @@ bool EventManager::RegisterKey(EventQueue* data, u64 key) if (key_map.find(key) != key_map.end()) return false; - for (auto& v = key_map.begin(); v != key_map.end(); ++v) + for (auto& v : key_map) { - if (v->second == data) return false; + if (v.second == data) return false; } key_map[key] = data; @@ -79,4 +79,4 @@ bool EventManager::SendEvent(u64 key, u64 source, u64 d1, u64 d2, u64 d3) eq->events.push(source, d1, d2, d3); return true; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/FS/vfsLocalDir.cpp b/rpcs3/Emu/FS/vfsLocalDir.cpp index b1a2b84438..6ae8009a21 100644 --- a/rpcs3/Emu/FS/vfsLocalDir.cpp +++ b/rpcs3/Emu/FS/vfsLocalDir.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" #include "vfsLocalDir.h" -#include vfsLocalDir::vfsLocalDir(vfsDevice* device) : vfsDirBase(device) { @@ -50,4 +49,4 @@ bool vfsLocalDir::Rename(const wxString& from, const wxString& to) bool vfsLocalDir::Remove(const wxString& path) { return wxRmdir(path); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index 82bfd43dac..442942f881 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -2,6 +2,7 @@ #include "GLGSRender.h" #include "Emu/Cell/PPCInstrTable.h" #include "Gui/RSXDebugger.h" +#include "OpenGL.h" #define CMD_DEBUG 0 #define DUMP_VERTEX_DATA 0 @@ -650,10 +651,10 @@ void GLGSRender::OnInitThread() #ifdef _WIN32 glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0); #else - if (GLXDrawable drawable = glXGetCurrentDrawable()) - glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0); + if (GLXDrawable drawable = glXGetCurrentDrawable()){ + glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0); + } #endif - glGenTextures(1, &g_depth_tex); glGenTextures(1, &g_flip_tex); } diff --git a/rpcs3/Emu/GS/GSManager.cpp b/rpcs3/Emu/GS/GSManager.cpp index ad6ac2bedf..0d2c1b0451 100644 --- a/rpcs3/Emu/GS/GSManager.cpp +++ b/rpcs3/Emu/GS/GSManager.cpp @@ -4,7 +4,7 @@ #include "GL/GLGSRender.h" BEGIN_EVENT_TABLE(GSFrame, wxFrame) - EVT_PAINT(GSFrame::OnPaint) + EVT_PAINT(GSFrame::OnPaint) EVT_SIZE(GSFrame::OnSize) END_EVENT_TABLE() @@ -45,4 +45,4 @@ u8 GSManager::GetState() u8 GSManager::GetColorSpace() { return CELL_VIDEO_OUT_COLOR_SPACE_RGB; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/GS/GSRender.cpp b/rpcs3/Emu/GS/GSRender.cpp index 5a1fc4bceb..e07efaff07 100644 --- a/rpcs3/Emu/GS/GSRender.cpp +++ b/rpcs3/Emu/GS/GSRender.cpp @@ -78,4 +78,4 @@ void GSFrame::SetSize(int width, int height) GSLockCurrent::GSLockCurrent(GSLockType type) : GSLock(Emu.GetGSManager().GetRender(), type) { -} \ No newline at end of file +} diff --git a/rpcs3/Emu/GS/sysutil_video.h b/rpcs3/Emu/GS/sysutil_video.h index 6ec3f0de63..630106116e 100644 --- a/rpcs3/Emu/GS/sysutil_video.h +++ b/rpcs3/Emu/GS/sysutil_video.h @@ -75,7 +75,7 @@ enum CellVideoOutPortType enum CellVideoOutDisplayAspect { - CELL_VIDEO_OUT_ASPECT_AUTO, + CELL_VIDEO_OUT_ASPECT_AUTO, CELL_VIDEO_OUT_ASPECT_4_3, CELL_VIDEO_OUT_ASPECT_16_9, }; diff --git a/rpcs3/Emu/HDD/HDD.h b/rpcs3/Emu/HDD/HDD.h index 3478d30fbb..ed3650ed54 100644 --- a/rpcs3/Emu/HDD/HDD.h +++ b/rpcs3/Emu/HDD/HDD.h @@ -482,7 +482,7 @@ public: int OpenDir(const wxString& name) { - ConLog.Warning("OpenDir(%s)", name.mb_str()); + ConLog.Warning("OpenDir(%s)", name.wx_str()); u64 entry_block; if(!SearchEntry(name, entry_block)) return -1; @@ -769,7 +769,7 @@ public: if(entry.type == vfsHDD_Entry_Dir && name != "." && name != "..") { - ConLog.Warning("removing sub folder '%s'", name.mb_str()); + ConLog.Warning("removing sub folder '%s'", name.wx_str()); RemoveBlocksDir(entry.data_block); } else if(entry.type == vfsHDD_Entry_File) @@ -869,4 +869,4 @@ public: { return m_file.GetSize(); } -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/Memory/Memory.h b/rpcs3/Emu/Memory/Memory.h index ff3f886e65..5e9ae0e863 100644 --- a/rpcs3/Emu/Memory/Memory.h +++ b/rpcs3/Emu/Memory/Memory.h @@ -1,5 +1,6 @@ #pragma once #include "MemoryBlock.h" +#include enum MemoryType { diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.h b/rpcs3/Emu/SysCalls/Modules/cellAdec.h index 9f9e633110..2aa17ead21 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.h +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.h @@ -557,36 +557,40 @@ struct CellAdecM4AacInfo be_t pad1; // TODO: check alignment union { - struct { struct - { - be_t copyrightIdPresent; - char copyrightId[9]; - be_t originalCopy; - be_t home; - be_t bitstreamType; - be_t bitrate; - be_t numberOfProgramConfigElements; - be_t bufferFullness; - } adif; }; + struct { + struct + { + be_t copyrightIdPresent; + char copyrightId[9]; + be_t originalCopy; + be_t home; + be_t bitstreamType; + be_t bitrate; + be_t numberOfProgramConfigElements; + be_t bufferFullness; + } adif; + }; - struct { struct - { - be_t id; - be_t layer; - be_t protectionAbsent; - be_t profile; - be_t samplingFreqIndex; - be_t privateBit; - be_t channelConfiguration; - be_t originalCopy; - be_t home; - be_t copyrightIdBit; - be_t copyrightIdStart; - be_t frameLength; - be_t bufferFullness; - be_t numberOfRawDataBlocks; - be_t crcCheck; - } adts; }; + struct { + struct + { + be_t id; + be_t layer; + be_t protectionAbsent; + be_t profile; + be_t samplingFreqIndex; + be_t privateBit; + be_t channelConfiguration; + be_t originalCopy; + be_t home; + be_t copyrightIdBit; + be_t copyrightIdStart; + be_t frameLength; + be_t bufferFullness; + be_t numberOfRawDataBlocks; + be_t crcCheck; + } adts; + }; } bsi; be_t pad2; // TODO: check alignment @@ -980,4 +984,4 @@ struct CellAdecMpmcInfo be_t multiCodecMode; be_t lfePresent; be_t channelCoufiguration; -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.h b/rpcs3/Emu/SysCalls/Modules/cellDmux.h index 77bab0fcdb..9fa0067ee0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.h +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.h @@ -96,20 +96,7 @@ struct CellDmuxResource2 be_t memSize; be_t ppuThreadPriority; be_t ppuThreadStackSize; - union - { - struct - { - be_t noex_spuThreadPriority; - be_t noex_numOfSpus; - }; - struct - { - be_t ex_spurs_addr; - u8 ex_priority[8]; - be_t ex_maxContention; - }; - }; + be_t shit[4]; }; struct CellDmuxCb @@ -140,8 +127,8 @@ struct CellDmuxEsAttr struct CellDmuxEsResource { - be_t memAddr; - be_t memSize; + be_t memAddr; + be_t memSize; }; struct CellDmuxAuInfo @@ -149,7 +136,7 @@ struct CellDmuxAuInfo be_t auAddr; be_t auSize; be_t auMaxSize; - be_t userData; + be_t userData; be_t ptsUpper; be_t ptsLower; be_t dtsUpper; @@ -165,4 +152,4 @@ struct CellDmuxAuInfoEx be_t userData; CellCodecTimeStamp pts; CellCodecTimeStamp dts; -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index 912acc1282..a42dcb14fe 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -292,7 +292,7 @@ int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, u32 dirName_addr) } std::string errorMsg = wxString::Format("%s\nSpace needed: %d KB\nDirectory name: %s", - wxString(errorName).wx_str(), errNeedSizeKB, wxString(dirName).wx_str()); + wxString(errorName).wx_str(), errNeedSizeKB, wxString(dirName).wx_str()).ToStdString(); wxMessageBox(errorMsg, wxGetApp().GetAppName(), wxICON_ERROR | wxOK); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index 2f38d070e8..99fc56d3ed 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -728,9 +728,9 @@ int cellRescSetBufferAddress(mem32_t colorBuffers, mem32_t vertexArray, mem32_t if(!colorBuffers.IsGood() || !vertexArray.IsGood() || !fragmentShader.IsGood()) return CELL_RESC_ERROR_BAD_ARGUMENT; if(colorBuffers.GetAddr() % COLOR_BUFFER_ALIGNMENT || - vertexArray.GetAddr() % VERTEX_BUFFER_ALIGNMENT || - fragmentShader.GetAddr() % FRAGMENT_SHADER_ALIGNMENT) - return CELL_RESC_ERROR_BAD_ALIGNMENT; + vertexArray.GetAddr() % VERTEX_BUFFER_ALIGNMENT || + fragmentShader.GetAddr() % FRAGMENT_SHADER_ALIGNMENT) + return CELL_RESC_ERROR_BAD_ALIGNMENT; s_rescInternalInstance->m_colorBuffersEA_addr = colorBuffers.GetAddr(); s_rescInternalInstance->m_vertexArrayEA_addr = vertexArray.GetAddr(); @@ -813,4 +813,4 @@ void cellResc_init() void cellResc_unload() { s_rescInternalInstance->m_bInitialized = false; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 95ecd1e8d2..ba812cb2cb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -25,13 +25,11 @@ enum #pragma pack(push, 1) struct CellSyncMutex { - union { - struct { - be_t m_freed; - be_t m_order; + be_t m_freed; + be_t m_order; + volatile u32& m_data(){ + return *reinterpret_cast(this); }; - volatile u32 m_data; - }; /* (???) Initialize: set zeros (???) Lock: increase m_order and wait until m_freed == old m_order @@ -61,7 +59,7 @@ int cellSyncMutexInitialize(mem_ptr_t mutex) { reservation.clear(); } - mutex->m_data = 0; + mutex->m_data() = 0; return CELL_OK; } } @@ -167,4 +165,4 @@ void cellSync_init() cellSync.AddFunc(0x1bb675c2, cellSyncMutexLock); cellSync.AddFunc(0xd06918c4, cellSyncMutexTryLock); cellSync.AddFunc(0x91f2b7b0, cellSyncMutexUnlock); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index ccbd0e3c08..033dec04c5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -1010,4 +1010,4 @@ void cellSysutil_init() cellSysutil.AddFunc(0x1e7bff94, cellSysCacheMount); cellSysutil.AddFunc(0x744c1544, cellSysCacheClear); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index 7d019f813b..8f3960e36d 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -1,12 +1,16 @@ +#if 0 #include "stdafx.h" #include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SC_FUNC.h" #include "sceNp.h" -void sceNp_init(); +void sceNpTrophy_init(); Module sceNp(0x0016, sceNpTrophy_init); void sceNpTrophy_init() { } +#endif + + diff --git a/rpcs3/Emu/SysCalls/Modules/sys_fs.cpp b/rpcs3/Emu/SysCalls/Modules/sys_fs.cpp index 776dab9ee4..9aefb67151 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_fs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_fs.cpp @@ -129,8 +129,8 @@ int cellFsSdataOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size) return CELL_OK; } -std::atomic g_FsAioReadID = 0; -std::atomic g_FsAioReadCur = 0; +std::atomic g_FsAioReadID( 0 ); +std::atomic g_FsAioReadCur( 0 ); bool aio_init = false; void fsAioRead(u32 fd, mem_ptr_t aio, int xid, mem_func_ptr_t xaio, int error, int xid, u64 size)> func) diff --git a/rpcs3/Emu/SysCalls/SC_FUNC.h b/rpcs3/Emu/SysCalls/SC_FUNC.h index 0157a8bf2f..c77c80af7b 100644 --- a/rpcs3/Emu/SysCalls/SC_FUNC.h +++ b/rpcs3/Emu/SysCalls/SC_FUNC.h @@ -1,4 +1,5 @@ #pragma once +#include "Modules.h" #define RESULT(x) SC_ARGS_1 = (x) diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index 5b24a0e199..4014f859d2 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -3,6 +3,13 @@ #include "Modules.h" #include "SC_FUNC.h" +namespace detail{ +template<> bool CheckId(u32 id, ID*& _id,const std::string &name) +{ + return Emu.GetIdManager().CheckID(id) && (_id = &Emu.GetIdManager().GetID(id))->m_name == name; +} +} + void default_syscall(); static func_caller *null_func = bind_func(default_syscall); @@ -358,4 +365,4 @@ void SysCalls::DoSyscall(u32 code) //TODO: remove this declCPU(); RESULT(DoFunc(code)); -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 01e491f7b9..37149bde17 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -14,6 +14,20 @@ #define declCPU PPUThread& CPU = GetCurrentPPUThread +class SysCallBase; + +namespace detail{ + template bool CheckId(u32 id, T*& data,const std::string &name) + { + ID* id_data; + if(!CheckId(id, id_data,name)) return false; + data = id_data->m_data->get(); + return true; + } + + template<> bool CheckId(u32 id, ID*& _id,const std::string &name); +} + class SysCallBase //Module { private: @@ -94,18 +108,7 @@ public: template bool CheckId(u32 id, T*& data) { - ID* id_data; - - if(!CheckId(id, id_data)) return false; - - data = id_data->m_data->get(); - - return true; - } - - template<> bool CheckId(u32 id, ID*& _id) - { - return Emu.GetIdManager().CheckID(id) && (_id = &Emu.GetIdManager().GetID(id))->m_name == GetName(); + return detail::CheckId(id,data,GetName()); } template diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp index 8d9d9c2350..2e0e9abc2b 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp @@ -386,4 +386,4 @@ int sys_event_port_send(u32 eport_id, u64 data1, u64 data2, u64 data3) } return CELL_OK; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp index fc367333a3..64539b0002 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp @@ -86,11 +86,11 @@ int sys_lwcond_signal(mem_ptr_t lwcond) if (be_t target = (mutex->attribute.ToBE() == se32(SYS_SYNC_PRIORITY) ? sq->pop_prio() : sq->pop())) { - if (mutex->owner.trylock(target) != SMR_OK) + if (mutex->mutex.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->mutex.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->mutex.owner.unlock(tid, target); } } @@ -122,11 +122,11 @@ int sys_lwcond_signal_all(mem_ptr_t lwcond) while (be_t target = (mutex->attribute.ToBE() == se32(SYS_SYNC_PRIORITY) ? sq->pop_prio() : sq->pop())) { - if (mutex->owner.trylock(target) != SMR_OK) + if (mutex->mutex.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->mutex.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->mutex.owner.unlock(tid, target); } } @@ -163,11 +163,11 @@ int sys_lwcond_signal_to(mem_ptr_t lwcond, u32 ppu_thread_id) be_t target = ppu_thread_id; - if (mutex->owner.trylock(target) != SMR_OK) + if (mutex->mutex.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->mutex.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->mutex.owner.unlock(tid, target); } if (Emu.IsStopped()) @@ -197,7 +197,7 @@ int sys_lwcond_wait(mem_ptr_t lwcond, u64 timeout) u32 tid_le = GetCurrentPPUThread().GetId(); be_t tid = tid_le; - if (mutex->owner.GetOwner() != tid) + if (mutex->mutex.owner.GetOwner() != tid) { return CELL_EPERM; // caller must own this lwmutex } @@ -205,7 +205,7 @@ int sys_lwcond_wait(mem_ptr_t lwcond, u64 timeout) sq->push(tid_le); mutex->recursive_count = 0; - mutex->owner.unlock(tid); + mutex->mutex.owner.unlock(tid); u32 counter = 0; const u32 max_counter = timeout ? (timeout / 1000) : ~0; @@ -216,7 +216,7 @@ int sys_lwcond_wait(mem_ptr_t lwcond, u64 timeout) case SMR_OK: mutex->unlock(tid); break; case SMR_SIGNAL: return CELL_OK; } */ - if (mutex->owner.GetOwner() == tid) + if (mutex->mutex.owner.GetOwner() == tid) { _mm_mfence(); mutex->recursive_count = 1; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp index b6783d63cd..97de2549d0 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp @@ -28,8 +28,9 @@ int sys_lwmutex_create(mem_ptr_t lwmutex, mem_ptr_tattribute = attr->attr_protocol | attr->attr_recursive; - lwmutex->all_info = 0; - lwmutex->owner.initialize(); + lwmutex->mutex.all_info() = 0; + lwmutex->mutex.all_info() = 0; + lwmutex->mutex.owner.initialize(); //lwmutex->waiter = lwmutex->owner.GetOwner(); lwmutex->pad = 0; lwmutex->recursive_count = 0; @@ -53,10 +54,10 @@ int sys_lwmutex_destroy(mem_ptr_t lwmutex) if (!Emu.GetIdManager().CheckID(sq_id)) return CELL_ESRCH; // try to make it unable to lock - switch (int res = lwmutex->trylock(lwmutex->owner.GetDeadValue())) + switch (int res = lwmutex->trylock(lwmutex->mutex.owner.GetDeadValue())) { case CELL_OK: - lwmutex->all_info = 0; + lwmutex->mutex.all_info() = 0; lwmutex->attribute = 0; lwmutex->sleep_queue = 0; Emu.GetIdManager().RemoveID(sq_id); @@ -71,7 +72,7 @@ int sys_lwmutex_lock(mem_ptr_t lwmutex, u64 timeout) if (!lwmutex.IsGood()) return CELL_EFAULT; //ConLog.Write("*** lock mutex (addr=0x%x, attr=0x%x, Nrec=%d, owner=%d, waiter=%d)", - //lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, lwmutex->owner.GetOwner(), (u32)lwmutex->waiter); + //lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, lwmutex->vars.parts.owner.GetOwner(), (u32)lwmutex->waiter); return lwmutex->lock(GetCurrentPPUThread().GetId(), timeout ? ((timeout < 1000) ? 1 : (timeout / 1000)) : 0); } @@ -92,7 +93,7 @@ int sys_lwmutex_unlock(mem_ptr_t lwmutex) if (!lwmutex.IsGood()) return CELL_EFAULT; //ConLog.Write("*** unlocking mutex (addr=0x%x, attr=0x%x, Nrec=%d, owner=%d, waiter=%d)", - //lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, (u32)lwmutex->owner.GetOwner(), (u32)lwmutex->waiter); + //lwmutex.GetAddr(), (u32)lwmutex->attribute, (u32)lwmutex->recursive_count, (u32)lwmutex->vars.parts.owner.GetOwner(), (u32)lwmutex->waiter); return lwmutex->unlock(GetCurrentPPUThread().GetId()); } @@ -207,7 +208,7 @@ int sys_lwmutex_t::trylock(be_t tid) { if (!attribute.ToBE()) return CELL_EINVAL; - if (tid == owner.GetOwner()) + if (tid == mutex.owner.GetOwner()) { if (attribute.ToBE() & se32(SYS_SYNC_RECURSIVE)) { @@ -221,7 +222,7 @@ int sys_lwmutex_t::trylock(be_t tid) } } - switch (owner.trylock(tid)) + switch (mutex.owner.trylock(tid)) { case SMR_OK: recursive_count = 1; return CELL_OK; case SMR_FAILED: return CELL_EBUSY; @@ -231,7 +232,7 @@ int sys_lwmutex_t::trylock(be_t tid) int sys_lwmutex_t::unlock(be_t tid) { - if (tid != owner.GetOwner()) + if (tid != mutex.owner.GetOwner()) { return CELL_EPERM; } @@ -250,8 +251,8 @@ int sys_lwmutex_t::unlock(be_t tid) target = attribute.ToBE() & se32(SYS_SYNC_FIFO) ? sq->pop() : sq->pop_prio(); case se32(SYS_SYNC_RETRY): break; } - if (target) owner.unlock(tid, target); - else owner.unlock(tid); + if (target) mutex.owner.unlock(tid, target); + else mutex.owner.unlock(tid); } return CELL_OK; } @@ -276,7 +277,7 @@ int sys_lwmutex_t::lock(be_t tid, u64 timeout) default: break; } - switch (owner.lock(tid, timeout)) + switch (mutex.owner.lock(tid, timeout)) { case SMR_OK: sq->invalidate(tid); @@ -289,4 +290,4 @@ int sys_lwmutex_t::lock(be_t tid, u64 timeout) default: sq->invalidate(tid); return CELL_EINVAL; } -} \ No newline at end of file +} diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h index 6ec67c0cc6..24c4f30edb 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h @@ -65,18 +65,13 @@ struct SleepQueue struct sys_lwmutex_t { - union // sys_lwmutex_variable_t + struct sys_lwmutex_lock_info_t { - struct // sys_lwmutex_lock_info_t - { - /* volatile */ SMutexBase, 0xffffffff, 0> owner; - /* volatile */ be_t waiter; // not used - }; - struct - { - /* volatile */ be_t all_info; - }; - }; + /* volatile */ SMutexBase, 0xffffffff, 0> owner; + /* volatile */ be_t waiter; // not used + u64 &all_info(){return *(reinterpret_cast(this)); + } + }mutex; be_t attribute; be_t recursive_count; be_t sleep_queue; @@ -85,4 +80,4 @@ struct sys_lwmutex_t int trylock(be_t tid); int unlock(be_t tid); int lock(be_t tid, u64 timeout); -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/SC_sys_spu.cpp index 0f12143b20..0565f8bbd8 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_sys_spu.cpp @@ -1,3 +1,4 @@ +#if 0 #include "stdafx.h" #include "Emu/SysCalls/SysCalls.h" @@ -19,3 +20,4 @@ int sys_raw_spu_create(u32 id_addr, u32 attr_addr) Memory.Write32(id_addr, Emu.GetIdManager().GetNewID("raw_spu")); return CELL_OK; } +#endif diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index bff251bd08..f3ce2765ad 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -28,6 +28,7 @@ Emulator::Emulator() , m_dbg_console(nullptr) , m_rsx_callback(0) , m_ppu_callback_thr(0) + , m_event_manager(new EventManager()) { } @@ -190,8 +191,8 @@ void Emulator::Load() if(IsSelf(m_path.ToStdString())) { - std::string self_path = m_path.mb_str(); - std::string elf_path = wxFileName(m_path).GetPath().c_str(); + std::string self_path = m_path.ToStdString(); + std::string elf_path = wxFileName(m_path).GetPath().ToStdString(); if(wxFileName(m_path).GetFullName().CmpNoCase("EBOOT.BIN") == 0) { @@ -216,7 +217,7 @@ void Emulator::Load() ConLog.Write("Mount info:"); for(uint i=0; i %s", m_vfs.m_devices[i].GetPs3Path().wx_str(), m_vfs.m_devices[i].GetLocalPath().wx_str()); + ConLog.Write("%s -> %s", static_cast(m_vfs.m_devices[i].GetPs3Path()), static_cast(m_vfs.m_devices[i].GetLocalPath().ToAscii())); } ConLog.SkipLn(); diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 20c6baa4cc..4887f4ef75 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -12,8 +12,9 @@ #include "Emu/DbgConsole.h" #include "Loader/Loader.h" #include "SysCalls/Callback.h" -#include "SysCalls/Modules.h" -#include "event.h" + +class EventManager; +extern void UnloadModules(); struct EmuInfo { @@ -90,7 +91,7 @@ class Emulator AudioManager m_audio_manager; CallbackManager m_callback_manager; CPUThread* m_ppu_callback_thr; - EventManager m_event_manager; + std::unique_ptr m_event_manager; VFS m_vfs; @@ -120,7 +121,7 @@ public: Array& GetBreakPoints() { return m_break_points; } Array& GetMarkedPoints() { return m_marked_points; } CPUThread& GetCallbackThread() { return *m_ppu_callback_thr; } - EventManager& GetEventManager() { return m_event_manager; } + EventManager& GetEventManager() { return *m_event_manager; } void AddModuleInit(ModuleInitializer* m) { @@ -164,4 +165,4 @@ public: __forceinline bool IsReady() const { return m_status == Ready; } }; -extern Emulator Emu; \ No newline at end of file +extern Emulator Emu; diff --git a/rpcs3/Gui/InterpreterDisAsm.cpp b/rpcs3/Gui/InterpreterDisAsm.cpp index d862d1dc42..362c01dd64 100644 --- a/rpcs3/Gui/InterpreterDisAsm.cpp +++ b/rpcs3/Gui/InterpreterDisAsm.cpp @@ -167,7 +167,7 @@ void InterpreterDisAsmFrame::OnKeyDown(wxKeyEvent& event) { if(event.GetKeyCode() == WXK_SPACE) { - wxCommandEvent ce; + wxCommandEvent ce; DoStep(ce); return; } @@ -222,7 +222,7 @@ void InterpreterDisAsmFrame::OnResize(wxSizeEvent& event) void InterpreterDisAsmFrame::DoUpdate() { - wxCommandEvent ce; + wxCommandEvent ce; Show_PC(ce); WriteRegs(); WriteCallStack(); diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 846bac285c..7a82da8cd6 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -228,7 +228,7 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event)) Emu.Stop(); // Open and install PKG file - std::string filePath = ctrl.GetPath(); + std::string filePath = ctrl.GetPath().ToStdString(); wxFile pkg_f(filePath, wxFile::read); // TODO: Use VFS to install PKG files if (pkg_f.IsOpened()) diff --git a/rpcs3/Gui/MemoryViewer.cpp b/rpcs3/Gui/MemoryViewer.cpp index c3a95a74ad..41d2fc85fb 100644 --- a/rpcs3/Gui/MemoryViewer.cpp +++ b/rpcs3/Gui/MemoryViewer.cpp @@ -25,7 +25,7 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent) wxStaticBoxSizer& s_tools_mem_bytes = *new wxStaticBoxSizer(wxHORIZONTAL, this, "Bytes"); sc_bytes = new wxSpinCtrl(this, wxID_ANY, "16", wxDefaultPosition, wxSize(44,-1)); - sc_bytes->SetRange(1, 16); + sc_bytes->SetRange(1, 16); s_tools_mem_bytes.Add(sc_bytes); wxStaticBoxSizer& s_tools_mem_buttons = *new wxStaticBoxSizer(wxHORIZONTAL, this, "Control"); @@ -52,7 +52,7 @@ MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent) s_tools_img_size.Add(new wxStaticText(this, wxID_ANY, " x ")); s_tools_img_size.Add(sc_img_size_y); - sc_img_size_x->SetRange(1, 8192); + sc_img_size_x->SetRange(1, 8192); sc_img_size_y->SetRange(1, 8192); wxStaticBoxSizer& s_tools_img_mode = *new wxStaticBoxSizer(wxHORIZONTAL, this, "Mode"); diff --git a/rpcs3/Gui/VFSManager.cpp b/rpcs3/Gui/VFSManager.cpp index 2215be3949..9b61daf0c5 100644 --- a/rpcs3/Gui/VFSManager.cpp +++ b/rpcs3/Gui/VFSManager.cpp @@ -58,7 +58,7 @@ VFSEntrySettingsDialog::VFSEntrySettingsDialog(wxWindow* parent, VFSManagerEntry m_tctrl_mount->SetValue(m_entry.mount); m_ch_type->SetSelection(m_entry.device); - wxCommandEvent ce; + wxCommandEvent ce; OnSelectType(ce); } diff --git a/rpcs3/Gui/VHDDManager.cpp b/rpcs3/Gui/VHDDManager.cpp index 59916e26e6..bc16439916 100644 --- a/rpcs3/Gui/VHDDManager.cpp +++ b/rpcs3/Gui/VHDDManager.cpp @@ -347,10 +347,10 @@ VHDDSetInfoDialog::VHDDSetInfoDialog(wxWindow* parent) : wxDialog(parent, wxID_A m_ch_type->Append("MB"); m_ch_type->Append("GB"); - m_spin_size->SetRange(1, 0x7fffffff); + m_spin_size->SetRange(1, 0x7fffffff); m_spin_size->SetValue(64); m_ch_type->SetSelection(3); - m_spin_block_size->SetRange(64, 0x7fffffff); + m_spin_block_size->SetRange(64, 0x7fffffff); m_spin_block_size->SetValue(2048); Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(VHDDSetInfoDialog::OnOk)); } diff --git a/rpcs3/Ini.cpp b/rpcs3/Ini.cpp index 292f8d0f13..e5b84d76af 100644 --- a/rpcs3/Ini.cpp +++ b/rpcs3/Ini.cpp @@ -155,7 +155,7 @@ Ini::Ini() wxGetCwd() + "\\rpcs3.ini", wxEmptyString, wxCONFIG_USE_LOCAL_FILE ); #else - m_Config = new wxConfig("rpcs3"); + m_Config = new wxConfig("rpcs3"); #endif } diff --git a/rpcs3/Loader/PKG.cpp b/rpcs3/Loader/PKG.cpp index d55b1e5f95..6d62b25b97 100644 --- a/rpcs3/Loader/PKG.cpp +++ b/rpcs3/Loader/PKG.cpp @@ -23,7 +23,7 @@ bool PKGLoader::Install(std::string dest, bool show) return false; std::string titleID = std::string(m_header.title_id).substr(7, 9); - std::string decryptedFile = wxGetCwd() + "/dev_hdd1/" + titleID + ".dec"; + std::string decryptedFile = wxGetCwd().ToStdString() + "/dev_hdd1/" + titleID + ".dec"; if (wxDirExists(dest+titleID)) { wxMessageDialog d_overwrite(NULL, "Another installation was found. Do you want to overwrite it?", "PKG Decrypter / Installer", wxYES_NO|wxCENTRE); diff --git a/rpcs3/rpcs3.h b/rpcs3/rpcs3.h index 7100b182f0..876c931e0b 100644 --- a/rpcs3/rpcs3.h +++ b/rpcs3/rpcs3.h @@ -1,5 +1,4 @@ #pragma once - #include "Gui/MainFrame.h" template T min(const T a, const T b) { return a < b ? a : b; } @@ -66,4 +65,4 @@ DECLARE_APP(Rpcs3App) //extern CPUThread& GetCPU(const u8 core); extern Rpcs3App* TheApp; -static const u64 PS3_CLK = 3200000000; \ No newline at end of file +static const u64 PS3_CLK = 3200000000; diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 71ac10705d..3a9515c24f 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -3,19 +3,33 @@ #define NOMINMAX #ifndef QT_UI +#ifdef _WIN32 #include -#include +#endif +#include #include #include #include #include +#include +#include #include #include #include #include #include +#include #include +#include +#include +#include "wx/gauge.h" +#include +#include "wx/scrolbar.h" +#include "wx/frame.h" +#include +#include +#include "wx/app.h" #include #endif @@ -199,12 +213,15 @@ enum Status #include "AppConnector.h" +#include "Emu/SysCalls/Callback.h" #include "Ini.h" #include "Gui/FrameBase.h" #include "Gui/ConLog.h" #include "Emu/Memory/Memory.h" #include "Emu/System.h" #include "Emu/Cell/PPUThread.h" +#include "Emu/SysCalls/Modules.h" + #include "Emu/FS/vfsDirBase.h" #include "Emu/FS/vfsFileBase.h"