mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-12 02:59:51 +00:00
Minor changes: GCM command, PKG loader & SysCalls
* Fixed incorrect time displayed on NV4097_GET_REPORT. * Fixed small bug in PKGLoader::UnpackEntry * Moved some code in SC_Time.cpp * Auxiliary function declarations of SC_Time.cpp in SC_Time.h * Updated cellFsUnlink. *This won't work until ExistsFile is fully implemented*.
This commit is contained in:
parent
696e00a570
commit
7379b0e2ed
6 changed files with 36 additions and 18 deletions
|
@ -1198,6 +1198,7 @@ static const wxString GetMethodName(const u32 id)
|
||||||
{ NV4097_SET_TRANSFORM_CONSTANT_LOAD , "SetTransformConstantLoad" } ,
|
{ NV4097_SET_TRANSFORM_CONSTANT_LOAD , "SetTransformConstantLoad" } ,
|
||||||
{ NV4097_SET_FREQUENCY_DIVIDER_OPERATION , "SetFrequencyDividerOperation" } ,
|
{ NV4097_SET_FREQUENCY_DIVIDER_OPERATION , "SetFrequencyDividerOperation" } ,
|
||||||
{ NV4097_INVALIDATE_L2 , "InvalidateL2" } ,
|
{ NV4097_INVALIDATE_L2 , "InvalidateL2" } ,
|
||||||
|
{ NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } ,
|
||||||
};
|
};
|
||||||
|
|
||||||
for(u32 i = 0; i < WXSIZEOF(METHOD_NAME_LIST); ++i)
|
for(u32 i = 0; i < WXSIZEOF(METHOD_NAME_LIST); ++i)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "RSXThread.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))))
|
#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)
|
switch(type)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
data = std::chrono::steady_clock::now().time_since_epoch().count();
|
data = get_system_time();
|
||||||
data *= 1000000;
|
data *= 1000; // Microseconds to nanoseconds
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -323,9 +323,18 @@ int cellFsUnlink(u32 path_addr)
|
||||||
const wxString& ps3_path = Memory.ReadString(path_addr);
|
const wxString& ps3_path = Memory.ReadString(path_addr);
|
||||||
sys_fs.Warning("cellFsUnlink(path=\"%s\")", ps3_path.wx_str());
|
sys_fs.Warning("cellFsUnlink(path=\"%s\")", ps3_path.wx_str());
|
||||||
|
|
||||||
//wxString localPath;
|
if (ps3_path.empty())
|
||||||
//Emu.GetVFS().GetDevice(ps3_path, localPath);
|
return CELL_EFAULT;
|
||||||
//wxRemoveFile(localPath);
|
|
||||||
|
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;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,23 +7,14 @@
|
||||||
* */
|
* */
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/SysCalls/SysCalls.h"
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
#include <sys/timeb.h>
|
#include "SC_Time.h"
|
||||||
|
|
||||||
SysCallBase sys_time("sys_time");
|
SysCallBase sys_time("sys_time");
|
||||||
|
|
||||||
//static const u64 timebase_frequency = 79800000;
|
//static const u64 timebase_frequency = 79800000;
|
||||||
extern int cellSysutilGetSystemParamInt(int id, mem32_t value);
|
extern int cellSysutilGetSystemParamInt(int id, mem32_t value);
|
||||||
|
|
||||||
int sys_time_get_timezone(mem32_t timezone, mem32_t summertime)
|
// Auxiliary functions
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
u64 get_time()
|
u64 get_time()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -39,12 +30,24 @@ u64 get_time()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns some relative time in microseconds, don't change this fact
|
||||||
u64 get_system_time()
|
u64 get_system_time()
|
||||||
{
|
{
|
||||||
// returns some relative time in microseconds, don't change this fact
|
|
||||||
return get_time() / 10;
|
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)
|
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);
|
sys_time.Log("sys_time_get_current_time(sec_addr=0x%x, nsec_addr=0x%x)", sec_addr, nsec_addr);
|
||||||
|
|
4
rpcs3/Emu/SysCalls/lv2/SC_Time.h
Normal file
4
rpcs3/Emu/SysCalls/lv2/SC_Time.h
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
u64 get_time();
|
||||||
|
u64 get_system_time();
|
|
@ -150,7 +150,7 @@ bool PKGLoader::UnpackEntry(wxFile& dec, const PKGEntry& entry, std::string dir)
|
||||||
dec.Read(buf, entry.name_size);
|
dec.Read(buf, entry.name_size);
|
||||||
buf[entry.name_size] = 0;
|
buf[entry.name_size] = 0;
|
||||||
|
|
||||||
switch (entry.type & (0xffff))
|
switch (entry.type & (0xff))
|
||||||
{
|
{
|
||||||
case PKG_FILE_ENTRY_NPDRM:
|
case PKG_FILE_ENTRY_NPDRM:
|
||||||
case PKG_FILE_ENTRY_NPDRMEDAT:
|
case PKG_FILE_ENTRY_NPDRMEDAT:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue