Merge pull request #83 from Bigpet/master

Make buildable with GCC in Linux
This commit is contained in:
DHrpcs3 2014-02-24 09:14:21 +02:00
commit d9d80d8fb4
50 changed files with 232 additions and 192 deletions

View File

@ -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)
{

View File

@ -1,8 +1,8 @@
#pragma once
#if defined(__GNUG__)
#include <math.h>
#define _fpclass(x) fpclassify(x)
#include <cmath>
#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

View File

@ -96,7 +96,11 @@ public:
m_cur_id = s_first_id;
}
template<typename T>
template<typename T
#ifdef __GNUG__
= char
#endif
>
ID_TYPE GetNewID(const std::string& name = "", T* data = nullptr, const u32 attr = 0)
{
std::lock_guard<std::mutex> lock(m_mtx_main);

View File

@ -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()

View File

@ -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<u32> 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,7 +164,7 @@ typedef SMutexBase<u32>
typedef SMutexBase<be_t<u32>>
SMutexBE;
typedef SMutexLockerBase<DWORD, SM_GetCurrentThreadId>
typedef SMutexLockerBase<std::thread::id, SM_GetCurrentThreadId>
SMutexGeneralLocker;
typedef SMutexLockerBase<u32, SM_GetCurrentCPUThreadId>
SMutexLocker;

View File

@ -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<void()> func)
catch(...)
{
ConLog.Error("Crash :(");
terminate();
std::terminate();
}
});
}

View File

@ -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)
{

View File

@ -4,13 +4,14 @@ project(rpcs3)
if (CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=gnu++11)
add_definitions(-D__WXGTK__)
#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
endif()
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin")
add_definitions(-DGL_GLEXT_PROTOTYPES)
add_definitions(-DGLX_GLXEXT_PROTOTYPES)

View File

@ -21,7 +21,7 @@ struct reservation_struct
extern reservation_struct reservation;
enum CPUThreadType
enum CPUThreadType :unsigned char
{
CPU_THREAD_PPU,
CPU_THREAD_SPU,

View File

@ -1,5 +1,6 @@
#pragma once
#include "CPUThread.h"
class CPUThread;
enum CPUThreadType : unsigned char;
class CPUThreadManager
{

View File

@ -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

View File

@ -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<float>(1.0 / CPU.FPR[frb]);

View File

@ -2,6 +2,7 @@
#include "Emu/Cell/PPCThread.h"
#include "Emu/SysCalls/SysCalls.h"
#include "rpcs3.h"
#include <cmath>
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

View File

@ -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;

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "vfsLocalDir.h"
#include <direct.h>
vfsLocalDir::vfsLocalDir(vfsDevice* device) : vfsDirBase(device)
{

View File

@ -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())
if (GLXDrawable drawable = glXGetCurrentDrawable()){
glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0);
}
#endif
glGenTextures(1, &g_depth_tex);
glGenTextures(1, &g_flip_tex);
}

View File

@ -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)

View File

@ -1,5 +1,6 @@
#pragma once
#include "MemoryBlock.h"
#include <vector>
enum MemoryType
{

View File

@ -557,7 +557,8 @@ struct CellAdecM4AacInfo
be_t<u32> pad1; // TODO: check alignment
union {
struct { struct
struct {
struct
{
be_t<u32> copyrightIdPresent;
char copyrightId[9];
@ -567,9 +568,11 @@ struct CellAdecM4AacInfo
be_t<u32> bitrate;
be_t<u32> numberOfProgramConfigElements;
be_t<u32> bufferFullness;
} adif; };
} adif;
};
struct { struct
struct {
struct
{
be_t<u32> id;
be_t<u32> layer;
@ -586,7 +589,8 @@ struct CellAdecM4AacInfo
be_t<u32> bufferFullness;
be_t<u32> numberOfRawDataBlocks;
be_t<u32> crcCheck;
} adts; };
} adts;
};
} bsi;
be_t<u32> pad2; // TODO: check alignment

View File

@ -96,20 +96,7 @@ struct CellDmuxResource2
be_t<u32> memSize;
be_t<u32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
union
{
struct
{
be_t<u32> noex_spuThreadPriority;
be_t<u32> noex_numOfSpus;
};
struct
{
be_t<u32> ex_spurs_addr;
u8 ex_priority[8];
be_t<u32> ex_maxContention;
};
};
be_t<u32> shit[4];
};
struct CellDmuxCb

View File

@ -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;
}

View File

@ -25,12 +25,10 @@ enum
#pragma pack(push, 1)
struct CellSyncMutex {
union {
struct {
be_t<u16> m_freed;
be_t<u16> m_order;
};
volatile u32 m_data;
volatile u32& m_data(){
return *reinterpret_cast<u32*>(this);
};
/*
(???) Initialize: set zeros
@ -61,7 +59,7 @@ int cellSyncMutexInitialize(mem_ptr_t<CellSyncMutex> mutex)
{
reservation.clear();
}
mutex->m_data = 0;
mutex->m_data() = 0;
return CELL_OK;
}
}

View File

@ -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

View File

@ -129,8 +129,8 @@ int cellFsSdataOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
return CELL_OK;
}
std::atomic<u32> g_FsAioReadID = 0;
std::atomic<u32> g_FsAioReadCur = 0;
std::atomic<u32> g_FsAioReadID( 0 );
std::atomic<u32> g_FsAioReadCur( 0 );
bool aio_init = false;
void fsAioRead(u32 fd, mem_ptr_t<CellFsAio> aio, int xid, mem_func_ptr_t<void (*)(mem_ptr_t<CellFsAio> xaio, int error, int xid, u64 size)> func)

View File

@ -1,4 +1,5 @@
#pragma once
#include "Modules.h"
#define RESULT(x) SC_ARGS_1 = (x)

View File

@ -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);

View File

@ -14,6 +14,20 @@
#define declCPU PPUThread& CPU = GetCurrentPPUThread
class SysCallBase;
namespace detail{
template<typename T> 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<T>();
return true;
}
template<> bool CheckId<ID>(u32 id, ID*& _id,const std::string &name);
}
class SysCallBase //Module
{
private:
@ -94,18 +108,7 @@ public:
template<typename T> bool CheckId(u32 id, T*& data)
{
ID* id_data;
if(!CheckId(id, id_data)) return false;
data = id_data->m_data->get<T>();
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<typename T>

View File

@ -86,11 +86,11 @@ int sys_lwcond_signal(mem_ptr_t<sys_lwcond_t> lwcond)
if (be_t<u32> 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<sys_lwcond_t> lwcond)
while (be_t<u32> 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<sys_lwcond_t> lwcond, u32 ppu_thread_id)
be_t<u32> 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<sys_lwcond_t> lwcond, u64 timeout)
u32 tid_le = GetCurrentPPUThread().GetId();
be_t<u32> 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<sys_lwcond_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<sys_lwcond_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;

View File

@ -28,8 +28,9 @@ int sys_lwmutex_create(mem_ptr_t<sys_lwmutex_t> lwmutex, mem_ptr_t<sys_lwmutex_a
}
lwmutex->attribute = 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<sys_lwmutex_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<sys_lwmutex_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<sys_lwmutex_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<u32> 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<u32> 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<u32> tid)
int sys_lwmutex_t::unlock(be_t<u32> tid)
{
if (tid != owner.GetOwner())
if (tid != mutex.owner.GetOwner())
{
return CELL_EPERM;
}
@ -250,8 +251,8 @@ int sys_lwmutex_t::unlock(be_t<u32> 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<u32> tid, u64 timeout)
default: break;
}
switch (owner.lock(tid, timeout))
switch (mutex.owner.lock(tid, timeout))
{
case SMR_OK:
sq->invalidate(tid);

View File

@ -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<be_t<u32>, 0xffffffff, 0> owner;
/* volatile */ be_t<u32> waiter; // not used
};
struct
{
/* volatile */ be_t<u64> all_info;
};
};
u64 &all_info(){return *(reinterpret_cast<u64*>(this));
}
}mutex;
be_t<u32> attribute;
be_t<u32> recursive_count;
be_t<u32> sleep_queue;

View File

@ -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

View File

@ -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<m_vfs.m_devices.GetCount(); ++i)
{
ConLog.Write("%s -> %s", m_vfs.m_devices[i].GetPs3Path().wx_str(), m_vfs.m_devices[i].GetLocalPath().wx_str());
ConLog.Write("%s -> %s", static_cast<const char *>(m_vfs.m_devices[i].GetPs3Path()), static_cast<const char *>(m_vfs.m_devices[i].GetLocalPath().ToAscii()));
}
ConLog.SkipLn();

View File

@ -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<EventManager> m_event_manager;
VFS m_vfs;
@ -120,7 +121,7 @@ public:
Array<u64>& GetBreakPoints() { return m_break_points; }
Array<u64>& 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)
{

View File

@ -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())

View File

@ -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);

View File

@ -1,5 +1,4 @@
#pragma once
#include "Gui/MainFrame.h"
template<typename T> T min(const T a, const T b) { return a < b ? a : b; }

View File

@ -3,19 +3,33 @@
#define NOMINMAX
#ifndef QT_UI
#ifdef _WIN32
#include <wx/msw/setup.h>
#include <wx/wx.h>
#endif
#include <wx/config.h>
#include <wx/string.h>
#include <wx/propdlg.h>
#include <wx/stdpaths.h>
#include <wx/filename.h>
#include <wx/filefn.h>
#include <wx/dcclient.h>
#include <wx/wfstream.h>
#include <wx/dir.h>
#include <wx/spinctrl.h>
#include <wx/datetime.h>
#include <wx/filepicker.h>
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/stattext.h>
#include <wx/msgdlg.h>
#include "wx/gauge.h"
#include <wx/stattext.h>
#include "wx/scrolbar.h"
#include "wx/frame.h"
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include "wx/app.h"
#include <wx/wxprec.h>
#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"