From 56692e23f5036f0338e17748b792f49111aa5a1d Mon Sep 17 00:00:00 2001 From: capriots <29807355+capriots@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:18:59 +0200 Subject: [PATCH] lv2: stub sys_time syscalls, add error code to sys_ss --- rpcs3/Emu/Cell/lv2/lv2.cpp | 4 ++-- rpcs3/Emu/Cell/lv2/sys_ss.cpp | 1 + rpcs3/Emu/Cell/lv2/sys_ss.h | 1 + rpcs3/Emu/Cell/lv2/sys_time.cpp | 14 ++++++++++++++ rpcs3/Emu/Cell/lv2/sys_time.h | 2 ++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index 32541981b3..dfc139c7db 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -268,10 +268,10 @@ const std::array, 1024> g_ppu_sysc BIND_SYSC(sys_event_port_connect_ipc), //140 (0x08C) BIND_SYSC(sys_timer_usleep), //141 (0x08D) BIND_SYSC(sys_timer_sleep), //142 (0x08E) - NULL_FUNC(sys_time_set_timezone), //143 (0x08F) ROOT + BIND_SYSC(sys_time_set_timezone), //143 (0x08F) ROOT BIND_SYSC(sys_time_get_timezone), //144 (0x090) BIND_SYSC(sys_time_get_current_time), //145 (0x091) - NULL_FUNC(sys_time_get_system_time), //146 (0x092) ROOT + BIND_SYSC(sys_time_set_current_time), //146 (0x092) ROOT BIND_SYSC(sys_time_get_timebase_frequency), //147 (0x093) BIND_SYSC(_sys_rwlock_trywlock), //148 (0x094) uns_func, //149 (0x095) UNS diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.cpp b/rpcs3/Emu/Cell/lv2/sys_ss.cpp index 3a50cef761..e0e23ab234 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ss.cpp @@ -98,6 +98,7 @@ void fmt_class_string::format(std::string& out, u64 arg) STR_CASE(SYS_SS_RNG_ERROR_ENOMEM); STR_CASE(SYS_SS_RNG_ERROR_EAGAIN); STR_CASE(SYS_SS_RNG_ERROR_EFAULT); + STR_CASE(SYS_SS_RTC_ERROR_UNK); } return unknown; diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.h b/rpcs3/Emu/Cell/lv2/sys_ss.h index 734a52dc05..0925cacc03 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.h +++ b/rpcs3/Emu/Cell/lv2/sys_ss.h @@ -10,6 +10,7 @@ enum sys_ss_rng_error : u32 SYS_SS_RNG_ERROR_ENOMEM = 0x80010501, SYS_SS_RNG_ERROR_EAGAIN = 0x80010503, SYS_SS_RNG_ERROR_EFAULT = 0x80010509, + SYS_SS_RTC_ERROR_UNK = 0x8001050f, }; struct CellSsOpenPSID diff --git a/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp index fc3004799a..ab5727104a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_time.cpp @@ -218,6 +218,13 @@ u64 get_guest_system_time(u64 time) } // Functions +error_code sys_time_set_timezone(s32 timezone, s32 summertime) +{ + sys_time.todo("sys_time_set_timezone(timezone=0x%x, summertime=0x%x)", timezone, summertime); + + return CELL_OK; +} + error_code sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime) { sys_time.trace("sys_time_get_timezone(timezone=*0x%x, summertime=*0x%x)", timezone, summertime); @@ -374,6 +381,13 @@ error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec) return CELL_OK; } +error_code sys_time_set_current_time(s64 sec, s64 nsec) +{ + sys_time.todo("sys_time_set_current_time(sec=0x%x, nsec=0x%x)", sec, nsec); + + return CELL_OK; +} + u64 sys_time_get_timebase_frequency() { sys_time.trace("sys_time_get_timebase_frequency()"); diff --git a/rpcs3/Emu/Cell/lv2/sys_time.h b/rpcs3/Emu/Cell/lv2/sys_time.h index 3e72ee1aae..63a0d1b4b6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.h +++ b/rpcs3/Emu/Cell/lv2/sys_time.h @@ -5,7 +5,9 @@ // SysCalls +error_code sys_time_set_timezone(s32 timezone, s32 summertime); error_code sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); +error_code sys_time_set_current_time(s64 sec, s64 nsec); u64 sys_time_get_timebase_frequency(); error_code sys_time_get_rtc(vm::ptr rtc);