From 9a30ce5f18a26886d272059a2f2cb0a02365ef70 Mon Sep 17 00:00:00 2001 From: Bigpet Date: Sun, 23 Feb 2014 17:52:52 +0100 Subject: [PATCH] Make buildable with GCC in Linux * replace GetThreadID with std::this_thread.getId() * name all anonymous structs and unions that contain non-trivially constructable objects * made default constructor for big endian type noexcept to make it work with std::atomic * move instantiated specialized template function members ouside of the class definition to comply with the standard * added default instantiation for template parameter "=nullptr" * used the C++11 standardized thread_local instead of the __declspec(thread) * added transitional definitions to bridge the microsoft specific calls (compare and exchange and aligned alloc) * removed cyclic dependency between Emulator->CPUThreadManager->CPUThread->SMutex->Emulator->... * fixed some instances of indentation by space instead of tabs * surrounded some unused code with an #if 0 block to make sure it doesn't compile --- Utilities/BEType.h | 4 +--- Utilities/GNU.h | 9 +++++-- Utilities/IdManager.h | 4 ++-- Utilities/MTProgressDialog.h | 2 +- Utilities/SMutex.cpp | 6 ++--- Utilities/SMutex.h | 8 +++---- Utilities/Thread.cpp | 6 ++--- Utilities/Thread.h | 2 +- rpcs3/CMakeLists.txt | 13 +++++----- rpcs3/Emu/CPU/CPUThread.h | 2 +- rpcs3/Emu/CPU/CPUThreadManager.h | 5 ++-- rpcs3/Emu/Cell/PPCThreadManager.cpp | 4 +++- rpcs3/Emu/Cell/PPCThreadManager.h | 8 +++---- rpcs3/Emu/Cell/PPUInterpreter.h | 4 ++-- rpcs3/Emu/Cell/PPUThread.h | 9 +++---- rpcs3/Emu/FS/vfsLocalDir.cpp | 3 +-- rpcs3/Emu/GS/GL/GLGSRender.cpp | 9 ++++--- rpcs3/Emu/GS/GSManager.cpp | 4 ++-- rpcs3/Emu/GS/GSRender.cpp | 2 +- rpcs3/Emu/GS/sysutil_video.h | 2 +- rpcs3/Emu/HDD/HDD.h | 6 ++--- rpcs3/Emu/Memory/Memory.h | 9 +++---- rpcs3/Emu/SysCalls/Modules/cellDmux.h | 20 ++++++++-------- rpcs3/Emu/SysCalls/Modules/cellGame.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 8 +++---- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 28 ++++++++++------------ rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/sceNp.cpp | 6 ++++- rpcs3/Emu/SysCalls/Modules/sys_fs.cpp | 4 ++-- rpcs3/Emu/SysCalls/SC_FUNC.h | 1 + rpcs3/Emu/SysCalls/SysCalls.cpp | 9 ++++++- rpcs3/Emu/SysCalls/SysCalls.h | 27 +++++++++++---------- rpcs3/Emu/SysCalls/lv2/SC_Event.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/SC_Lwcond.cpp | 24 +++++++++---------- rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp | 18 +++++++------- rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h | 13 ++++------ rpcs3/Emu/SysCalls/lv2/SC_sys_spu.cpp | 2 ++ rpcs3/Emu/System.cpp | 6 ++--- rpcs3/Emu/System.h | 9 +++---- rpcs3/Gui/InterpreterDisAsm.cpp | 4 ++-- rpcs3/Gui/MainFrame.cpp | 2 +- rpcs3/Gui/MemoryViewer.cpp | 4 ++-- rpcs3/Gui/VFSManager.cpp | 2 +- rpcs3/Gui/VHDDManager.cpp | 4 ++-- rpcs3/Ini.cpp | 2 +- rpcs3/Loader/PKG.cpp | 2 +- rpcs3/rpcs3.h | 3 +-- rpcs3/stdafx.h | 19 ++++++++++++++- 48 files changed, 190 insertions(+), 154 deletions(-) diff --git a/Utilities/BEType.h b/Utilities/BEType.h index cfd2c4265e..688c9858ba 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -52,9 +52,7 @@ class be_t T m_data; public: - be_t() - { - } + be_t() noexcept = default; 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 d543769356..ff1185c415 100644 --- a/Utilities/IdManager.h +++ b/Utilities/IdManager.h @@ -96,7 +96,7 @@ public: m_cur_id = s_first_id; } - template + template ID_TYPE GetNewID(const std::string& name = "", T* data = nullptr, const u8 attr = 0) { std::lock_guard lock(m_mtx_main); @@ -155,4 +155,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 3746620526..9cb03be3d9 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 { @@ -149,9 +149,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 793e963be9..ad8633a6b6 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Thread.h" -__declspec(thread) NamedThreadBase* g_tls_this_thread = nullptr; +/*__declspec(thread)*/ thread_local NamedThreadBase* g_tls_this_thread = nullptr; NamedThreadBase* GetCurrentNamedThread() { @@ -124,7 +124,7 @@ void thread::start(std::function func) catch(...) { ConLog.Error("Crash :("); - terminate(); + std::terminate(); } }); } @@ -142,4 +142,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 47ab964606..6784e2d1b5 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; @@ -3361,7 +3361,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/FS/vfsLocalDir.cpp b/rpcs3/Emu/FS/vfsLocalDir.cpp index 144e5d46a4..d35de98a51 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 afeb7e8998..b4c08c40c9 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 @@ -649,12 +650,10 @@ void GLGSRender::OnInitThread() #ifdef _WIN32 glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0); - - glGenTextures(1, &g_depth_tex); - glGenTextures(1, &g_flip_tex); #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 } 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 d4b5108e1c..b90be6a2d8 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 { @@ -912,10 +913,10 @@ public: return m_ptr; } - T operator [](int index) - { - return *(m_ptr + index); - } + T operator [](int index) + { + return *(m_ptr + index); + } template operator const mem_t() const diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.h b/rpcs3/Emu/SysCalls/Modules/cellDmux.h index 77bab0fcdb..08616f565c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.h +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.h @@ -96,20 +96,20 @@ struct CellDmuxResource2 be_t memSize; be_t ppuThreadPriority; be_t ppuThreadStackSize; - union + union cell_info { - struct + struct spu_info { be_t noex_spuThreadPriority; be_t noex_numOfSpus; - }; - struct + }spu_inf; + struct spurs_info { be_t ex_spurs_addr; u8 ex_priority[8]; be_t ex_maxContention; - }; - }; + }spurs_inf; + }cell_inf; }; struct CellDmuxCb @@ -140,8 +140,8 @@ struct CellDmuxEsAttr struct CellDmuxEsResource { - be_t memAddr; - be_t memSize; + be_t memAddr; + be_t memSize; }; struct CellDmuxAuInfo @@ -149,7 +149,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 +165,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..da3c545199 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -24,14 +24,12 @@ enum }; #pragma pack(push, 1) -struct CellSyncMutex { - union { - struct { - be_t m_freed; - be_t m_order; - }; - volatile u32 m_data; - }; +union CellSyncMutex { + struct cell_sync_mutex_info{ + be_t m_freed; + be_t m_order; + }parts; + volatile u32 m_data; /* (???) Initialize: set zeros (???) Lock: increase m_order and wait until m_freed == old m_order @@ -87,9 +85,9 @@ int cellSyncMutexLock(mem_ptr_t mutex) { reservation.clear(); } - old_order = mutex->m_order; - mutex->m_order = mutex->m_order + 1; - if (old_order == mutex->m_freed) + old_order = mutex->parts.m_order; + mutex->parts.m_order = mutex->parts.m_order + 1; + if (old_order == mutex->parts.m_freed) { return CELL_OK; } @@ -127,11 +125,11 @@ int cellSyncMutexTryLock(mem_ptr_t mutex) { reservation.clear(); } - if (mutex->m_order != mutex->m_freed) + if (mutex->parts.m_order != mutex->parts.m_freed) { return CELL_SYNC_ERROR_BUSY; } - mutex->m_order = mutex->m_order + 1; + mutex->parts.m_order = mutex->parts.m_order + 1; return CELL_OK; } } @@ -156,7 +154,7 @@ int cellSyncMutexUnlock(mem_ptr_t mutex) { reservation.clear(); } - mutex->m_freed = mutex->m_freed + 1; + mutex->parts.m_freed = mutex->parts.m_freed + 1; 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 7f83764416..51c4165363 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -1007,4 +1007,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 27f22ab243..c840f18f57 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; void fsAioRead(u32 fd, mem_ptr_t aio, int xid, mem_func_ptr_t xaio, u32 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 531cb88f88..8632ab062b 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 b900be9046..0aea42d6cf 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Event.cpp @@ -430,4 +430,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 89dd8c7409..6a7524a88b 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->vars.parts.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->vars.parts.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->vars.parts.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->vars.parts.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->vars.parts.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->vars.parts.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->vars.parts.owner.trylock(target) != SMR_OK) { - mutex->owner.lock(tid); + mutex->vars.parts.owner.lock(tid); mutex->recursive_count = 1; - mutex->owner.unlock(tid, target); + mutex->vars.parts.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->vars.parts.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->vars.parts.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->vars.parts.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 db07fbed3b..9a2a900905 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp @@ -28,7 +28,7 @@ int sys_lwmutex_create(mem_ptr_t lwmutex, mem_ptr_tattribute = attr->attr_protocol | attr->attr_recursive; - lwmutex->all_info = 0; + lwmutex->vars.all_info = 0; lwmutex->pad = 0; lwmutex->recursive_count = 0; @@ -68,7 +68,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); } @@ -89,7 +89,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()); } @@ -204,7 +204,7 @@ int sys_lwmutex_t::trylock(be_t tid) { if (!attribute.ToBE()) return CELL_EINVAL; - if (tid == owner.GetOwner()) + if (tid == vars.parts.owner.GetOwner()) { if (attribute.ToBE() & se32(SYS_SYNC_RECURSIVE)) { @@ -218,7 +218,7 @@ int sys_lwmutex_t::trylock(be_t tid) } } - switch (owner.trylock(tid)) + switch (vars.parts.owner.trylock(tid)) { case SMR_OK: recursive_count = 1; return CELL_OK; case SMR_FAILED: return CELL_EBUSY; @@ -228,7 +228,7 @@ int sys_lwmutex_t::trylock(be_t tid) int sys_lwmutex_t::unlock(be_t tid) { - if (tid != owner.GetOwner()) + if (tid != vars.parts.owner.GetOwner()) { return CELL_EPERM; } @@ -245,7 +245,7 @@ int sys_lwmutex_t::unlock(be_t tid) SleepQueue* sq; if (!Emu.GetIdManager().GetIDData(sleep_queue, sq)) return CELL_ESRCH; target = attribute.ToBE() & se32(SYS_SYNC_FIFO) ? sq->pop() : sq->pop_prio(); - case se32(SYS_SYNC_RETRY): default: owner.unlock(tid, target); break; + case se32(SYS_SYNC_RETRY): default: vars.parts.owner.unlock(tid, target); break; } } return CELL_OK; @@ -271,7 +271,7 @@ int sys_lwmutex_t::lock(be_t tid, u64 timeout) default: break; } - switch (owner.lock(tid, timeout)) + switch (vars.parts.owner.lock(tid, timeout)) { case SMR_OK: sq->invalidate(tid); @@ -284,4 +284,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 4d104a556b..2d569a7494 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.h @@ -65,18 +65,15 @@ struct SleepQueue struct sys_lwmutex_t { - union // sys_lwmutex_variable_t + union sys_lwmutex_variable_t { - struct // sys_lwmutex_lock_info_t + struct sys_lwmutex_lock_info_t { /* volatile */ SMutexBE owner; /* volatile */ be_t waiter; // not used - }; - struct - { + }parts; /* volatile */ be_t all_info; - }; - }; + }vars; be_t attribute; be_t recursive_count; be_t sleep_queue; @@ -85,4 +82,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..33c527fb92 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -190,8 +190,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 +216,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..603936d4bf 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; + EventManager &m_event_manager; VFS m_vfs; @@ -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 150c4be1e3..9473644526 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 fba5988eb6..95438b7716 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"