diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 79aab03149..237b148dac 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -941,7 +941,7 @@ int cellSysCacheClear(void) Emu.GetVFS().GetDevice(wxString("/dev_hdd1/cache/"), localPath); if (wxDirExists(localPath)){ WxDirDeleteTraverser deleter; - wxString f = wxFindFirstFile(localPath+"\*",wxDIR); + wxString f = wxFindFirstFile(localPath+"\\*",wxDIR); while (!f.empty()) { wxDir dir(f); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index c69c716a59..9739d62468 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -76,19 +76,19 @@ struct sceNpTrophyInternal } }; -sceNpTrophyInternal* s_npTrophyInstance = new sceNpTrophyInternal(); +sceNpTrophyInternal s_npTrophyInstance; // Functions int sceNpTrophyInit(u32 pool_addr, u32 poolSize, u32 containerId, u64 options) { sceNpTrophy.Log("sceNpTrophyInit(pool_addr=0x%x, poolSize=%d, containerId=%d, options=0x%llx)", pool_addr, poolSize, containerId, options); - if (s_npTrophyInstance->m_bInitialized) + if (s_npTrophyInstance.m_bInitialized) return SCE_NP_TROPHY_ERROR_ALREADY_INITIALIZED; if (options) return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED; - s_npTrophyInstance->m_bInitialized = true; + s_npTrophyInstance.m_bInitialized = true; return CELL_OK; } @@ -97,7 +97,7 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t co sceNpTrophy.Warning("sceNpTrophyCreateContext(context_addr=0x%x, commID_addr=0x%x, commSign_addr=0x%x, options=0x%llx)", context.GetAddr(), commID.GetAddr(), commSign.GetAddr(), options); - if (!(s_npTrophyInstance->m_bInitialized)) + if (!s_npTrophyInstance.m_bInitialized) return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED; if (!context.IsGood()) return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT; @@ -111,14 +111,13 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t co Emu.GetVFS().GetDevice(ps3_path, local_path); vfsLocalDir dir(local_path); - if(!dir.Open(local_path)) + if(!dir.IsOpened()) return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST; // TODO: Following method will retrieve the TROPHY.TRP of the first folder that contains such file - const DirEntryInfo* entry = dir.Read(); - while (entry) + for(const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read()) { - if (!(entry->flags & DirEntry_TypeFile)) + if (entry->flags & DirEntry_TypeDir) { vfsStream* stream = Emu.GetVFS().Open(ps3_path + entry->name + "/TROPHY.TRP", vfsRead); if (stream) @@ -126,12 +125,10 @@ int sceNpTrophyCreateContext(mem32_t context, mem_ptr_t co sceNpTrophyInternalContext ctxt; ctxt.trp_stream = stream; ctxt.trp_name = entry->name; - s_npTrophyInstance->contexts.push_back(ctxt); + s_npTrophyInstance.contexts.push_back(ctxt); return CELL_OK; } } - entry->name; - entry = dir.Read(); } return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST; @@ -141,7 +138,7 @@ int sceNpTrophyCreateHandle(mem32_t handle) { sceNpTrophy.Warning("sceNpTrophyCreateHandle(handle_addr=0x%x)", handle.GetAddr()); - if (!(s_npTrophyInstance->m_bInitialized)) + if (!s_npTrophyInstance.m_bInitialized) return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED; if (!handle.IsGood()) return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT; @@ -157,7 +154,7 @@ int sceNpTrophyRegisterContext(u32 context, u32 handle, u32 statusCb_addr, u32 a sceNpTrophy.Warning("sceNpTrophyRegisterContext(context=%d, handle=%d, statusCb_addr=0x%x, arg_addr=0x%x, options=0x%llx)", context, handle, statusCb_addr, arg_addr, options); - if (!(s_npTrophyInstance->m_bInitialized)) + if (!(s_npTrophyInstance.m_bInitialized)) return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED; if (!Memory.IsGoodAddr(statusCb_addr)) return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT; @@ -166,7 +163,7 @@ int sceNpTrophyRegisterContext(u32 context, u32 handle, u32 statusCb_addr, u32 a // TODO: There are other possible errors int ret; - sceNpTrophyInternalContext& ctxt = s_npTrophyInstance->contexts[context]; + sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context]; TRPLoader trp(*(ctxt.trp_stream)); // TODO: Get the path of the current user @@ -261,7 +258,7 @@ int sceNpTrophyGetGameIcon() void sceNpTrophy_unload() { - s_npTrophyInstance->m_bInitialized = false; + s_npTrophyInstance.m_bInitialized = false; } void sceNpTrophy_init() diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 9570acf1b8..e0d5433366 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -307,8 +307,8 @@ extern int cellMouseGetRawData(u32 port_no, mem_class_t data); extern int cellGcmCallback(u32 context_addr, u32 count); //sys_tty -extern int sys_tty_read(s32 ch, u64 buf_addr, u32 len, u64 preadlen_addr); -extern int sys_tty_write(s32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr); +extern int sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr); +extern int sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr); //sys_heap extern int sys_heap_create_heap(const u32 heap_addr, const u32 start_addr, const u32 size); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp index b4760efcf4..60a7f561ef 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp @@ -148,8 +148,11 @@ int cellFsOpendir(u32 path_addr, mem32_t fd) wxString localPath; Emu.GetVFS().GetDevice(path, localPath); vfsLocalDir* dir = new vfsLocalDir(localPath); - if(!dir->Open(localPath)) + if(!dir->IsOpened()) + { + delete dir; return CELL_ENOENT; + } fd = sys_fs.GetNewId(dir); return CELL_OK; diff --git a/rpcs3/Emu/SysCalls/lv2/SC_TTY.cpp b/rpcs3/Emu/SysCalls/lv2/SC_TTY.cpp index 2317aeb767..0eb3dcce12 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_TTY.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_TTY.cpp @@ -1,17 +1,18 @@ #include "stdafx.h" #include "Emu/SysCalls/SysCalls.h" -int sys_tty_read(s32 ch, u64 buf_addr, u32 len, u64 preadlen_addr) +int sys_tty_read(u32 ch, u64 buf_addr, u32 len, u64 preadlen_addr) { ConLog.Warning("sys_tty_read: ch: %d, buf addr: %llx, len: %d", ch, buf_addr, len); Memory.Write32NN(preadlen_addr, len); + Emu.Pause(); return CELL_OK; } -int sys_tty_write(s32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr) +int sys_tty_write(u32 ch, u64 buf_addr, u32 len, u64 pwritelen_addr) { - if(ch < 0 || ch > 15 || (s32)len <= 0) return CELL_EINVAL; + if(ch > 15 || (s32)len <= 0) return CELL_EINVAL; if(!Memory.IsGoodAddr(buf_addr)) return CELL_EFAULT; Emu.GetDbgCon().Write(ch, Memory.ReadString(buf_addr, len)); diff --git a/rpcs3/Gui/CompilerELF.cpp b/rpcs3/Gui/CompilerELF.cpp index 5cc0c44804..d455da5390 100644 --- a/rpcs3/Gui/CompilerELF.cpp +++ b/rpcs3/Gui/CompilerELF.cpp @@ -12,7 +12,7 @@ enum CompilerIDs wxFont GetFont(int size) { - return wxFont(size, wxMODERN, wxNORMAL, wxNORMAL); + return wxFont(size, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); } CompilerELF::CompilerELF(wxWindow* parent)