From dc2fd8c39e6ac94385691c6f38507c8327431ebd Mon Sep 17 00:00:00 2001 From: DH Date: Sun, 19 Jan 2014 18:05:27 +0200 Subject: [PATCH] Improved vfsDevice. Minor fixes. --- Utilities/BEType.h | 2 +- rpcs3/Emu/FS/vfsDevice.cpp | 11 ++++++++- rpcs3/Emu/FS/vfsLocalFile.cpp | 29 ++++++++++++++++++++---- rpcs3/Emu/GS/RSXThread.cpp | 6 +++-- rpcs3/Emu/Memory/Memory.h | 6 ++--- rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp | 25 +------------------- rpcs3/rpcs3.cpp | 1 + rpcs3/rpcs3.vcxproj | 2 +- 8 files changed, 46 insertions(+), 36 deletions(-) diff --git a/Utilities/BEType.h b/Utilities/BEType.h index 7f6745b949..cc6a6fed62 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -63,7 +63,7 @@ public: FromBE(value.ToBE()); } - T ToBE() const + const T& ToBE() const { return m_data; } diff --git a/rpcs3/Emu/FS/vfsDevice.cpp b/rpcs3/Emu/FS/vfsDevice.cpp index d7fbc464a1..f9e8af0eeb 100644 --- a/rpcs3/Emu/FS/vfsDevice.cpp +++ b/rpcs3/Emu/FS/vfsDevice.cpp @@ -42,12 +42,18 @@ u32 vfsDevice::CmpPs3Path(const wxString& ps3_path) u32 vfsDevice::CmpLocalPath(const wxString& local_path) { + if(local_path.Len() < m_local_path.Len()) + return 0; + const u32 lim = min(m_local_path.Len(), local_path.Len()); u32 ret = 0; for(u32 i=0; iget); - const u32 put = re(m_ctrl->put); + u32 put, get; + se_t::func(put, std::atomic_load((volatile std::atomic*)((u8*)m_ctrl + offsetof(CellGcmControl, put)))); + se_t::func(get, std::atomic_load((volatile std::atomic*)((u8*)m_ctrl + offsetof(CellGcmControl, get)))); + if(put == get || !Emu.IsRunning()) { if(put == get) diff --git a/rpcs3/Emu/Memory/Memory.h b/rpcs3/Emu/Memory/Memory.h index 461c4440b1..f8ebb5e112 100644 --- a/rpcs3/Emu/Memory/Memory.h +++ b/rpcs3/Emu/Memory/Memory.h @@ -305,12 +305,12 @@ public: if(len) memcpy(wxStringBuffer(ret, len), GetMemFromAddr(addr), len); - return ret; + return wxString(ret, wxConvUTF8); } wxString ReadString(const u64 addr) { - return wxString((const char*)GetMemFromAddr(addr)); + return wxString((const char*)GetMemFromAddr(addr), wxConvUTF8); } void WriteString(const u64 addr, const wxString& str) @@ -737,7 +737,7 @@ class mem_func_ptr_t : public mem_base_t { Callback cb; cb.SetAddr(m_addr); - cb.Handle(_get_func_arg(a1)); + cb.Handle(_func_arg::get_value(a1)); cb.Branch(!is_async); } diff --git a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp index 480264c8bd..d78c3bc5c7 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp @@ -6,7 +6,7 @@ extern Module sys_fs; int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size) { - const wxString& path = wxString(Memory.ReadString(path_addr), wxConvUTF8); + const wxString& path = Memory.ReadString(path_addr); sys_fs.Log("cellFsOpen(path: %s, flags: 0x%x, fd_addr: 0x%x, arg_addr: 0x%x, size: 0x%llx)", path.mb_str(), flags, fd.GetAddr(), arg.GetAddr(), size); @@ -17,29 +17,6 @@ int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size) if(flags & CELL_O_CREAT) { _oflags &= ~CELL_O_CREAT; - /* - //create path - for(uint p=1;pShow(); m_MainFrame->DoSettings(true); + return true; } diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index b8f4753d1e..a90474b87e 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -131,7 +131,7 @@ false - $(SolutionDir)\Utilities\git-version-gen.cmd + "$(SolutionDir)\Utilities\git-version-gen.cmd"