diff --git a/rpcs3/Emu/GS/GCM.h b/rpcs3/Emu/GS/GCM.h index da9c068027..8494862523 100644 --- a/rpcs3/Emu/GS/GCM.h +++ b/rpcs3/Emu/GS/GCM.h @@ -1198,6 +1198,7 @@ static const wxString GetMethodName(const u32 id) { NV4097_SET_TRANSFORM_CONSTANT_LOAD , "SetTransformConstantLoad" } , { NV4097_SET_FREQUENCY_DIVIDER_OPERATION , "SetFrequencyDividerOperation" } , { NV4097_INVALIDATE_L2 , "InvalidateL2" } , + { NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } , }; for(u32 i = 0; i < WXSIZEOF(METHOD_NAME_LIST); ++i) diff --git a/rpcs3/Emu/GS/RSXThread.cpp b/rpcs3/Emu/GS/RSXThread.cpp index 7fb5238fb4..79ea127c73 100644 --- a/rpcs3/Emu/GS/RSXThread.cpp +++ b/rpcs3/Emu/GS/RSXThread.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "RSXThread.h" +#include "Emu/SysCalls/lv2/SC_Time.h" #define ARGS(x) (x >= count ? OutOfArgsCount(x, cmd, count) : Memory.Read32(Memory.RSXIOMem.GetStartAddr() + re(m_ctrl->get) + (4*(x+1)))) @@ -1195,8 +1196,8 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3 switch(type) { case 1: - data = std::chrono::steady_clock::now().time_since_epoch().count(); - data *= 1000000; + data = get_system_time(); + data *= 1000; // Microseconds to nanoseconds break; default: diff --git a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp index e688a46d74..5a40ca84d6 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_FileSystem.cpp @@ -323,9 +323,18 @@ int cellFsUnlink(u32 path_addr) const wxString& ps3_path = Memory.ReadString(path_addr); sys_fs.Warning("cellFsUnlink(path=\"%s\")", ps3_path.wx_str()); - //wxString localPath; - //Emu.GetVFS().GetDevice(ps3_path, localPath); - //wxRemoveFile(localPath); + if (ps3_path.empty()) + return CELL_EFAULT; + + if (Emu.GetVFS().ExistsDir(ps3_path)) + return CELL_EISDIR; + + if (!Emu.GetVFS().ExistsFile(ps3_path)) + return CELL_ENOENT; + + if (!Emu.GetVFS().RemoveFile(ps3_path)) + return CELL_EACCES; + return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp index 764b47f71e..f8d2a3c148 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp @@ -7,23 +7,14 @@ * */ #include "stdafx.h" #include "Emu/SysCalls/SysCalls.h" -#include +#include "SC_Time.h" SysCallBase sys_time("sys_time"); //static const u64 timebase_frequency = 79800000; extern int cellSysutilGetSystemParamInt(int id, mem32_t value); -int sys_time_get_timezone(mem32_t timezone, mem32_t summertime) -{ - int ret; - ret = cellSysutilGetSystemParamInt(0x0116, timezone); //0x0116 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE - if (ret != CELL_OK) return ret; - ret = cellSysutilGetSystemParamInt(0x0117, summertime); //0x0117 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE - if (ret != CELL_OK) return ret; - return CELL_OK; -} - +// Auxiliary functions u64 get_time() { #ifdef _WIN32 @@ -39,12 +30,24 @@ u64 get_time() #endif } +// Returns some relative time in microseconds, don't change this fact u64 get_system_time() { - // returns some relative time in microseconds, don't change this fact return get_time() / 10; } + +// Functions +int sys_time_get_timezone(mem32_t timezone, mem32_t summertime) +{ + int ret; + ret = cellSysutilGetSystemParamInt(0x0116, timezone); //0x0116 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE + if (ret != CELL_OK) return ret; + ret = cellSysutilGetSystemParamInt(0x0117, summertime); //0x0117 = CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE + if (ret != CELL_OK) return ret; + return CELL_OK; +} + int sys_time_get_current_time(u32 sec_addr, u32 nsec_addr) { sys_time.Log("sys_time_get_current_time(sec_addr=0x%x, nsec_addr=0x%x)", sec_addr, nsec_addr); diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Time.h b/rpcs3/Emu/SysCalls/lv2/SC_Time.h new file mode 100644 index 0000000000..4d5b326e74 --- /dev/null +++ b/rpcs3/Emu/SysCalls/lv2/SC_Time.h @@ -0,0 +1,4 @@ +#pragma once + +u64 get_time(); +u64 get_system_time(); diff --git a/rpcs3/Loader/PKG.cpp b/rpcs3/Loader/PKG.cpp index fba5988eb6..d55b1e5f95 100644 --- a/rpcs3/Loader/PKG.cpp +++ b/rpcs3/Loader/PKG.cpp @@ -150,7 +150,7 @@ bool PKGLoader::UnpackEntry(wxFile& dec, const PKGEntry& entry, std::string dir) dec.Read(buf, entry.name_size); buf[entry.name_size] = 0; - switch (entry.type & (0xffff)) + switch (entry.type & (0xff)) { case PKG_FILE_ENTRY_NPDRM: case PKG_FILE_ENTRY_NPDRMEDAT: