New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cellRtc: misc. improvements, set to HLE by default #15496
Conversation
capriots
commented
Apr 21, 2024
- Fixed hopefully any inaccuracies that were left
- Stubbed two syscalls used in cellRtc
- Simplified a bunch of functions, especially cellRtcTickAddMonths() and cellRtcTickAddYears()
- Implemented the rest of cellRtcGetCurrentSecureTick()
- To fix Ghidra's decompilation you need to nop the instructions at 0x3b20 and 0x3b24 (removes the initializers for two variables)
- Added sanity checks where there are no nullptr checks on LLE
- Moved constants into header file
- Removed unused functions
- Replaced vm::check_addr() with sys_memory_get_page_attribute() everywhere to be more accurate to LLE
- Set log level to notice everywhere (trace if I found a game where it was being spammed)
} | ||
|
||
error_code cellRtcIsLeapYear(s32 year) | ||
{ | ||
cellRtc.todo("cellRtcIsLeapYear(year=%d)", year); | ||
cellRtc.notice("cellRtcIsLeapYear(year=%d)", year); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just set them all to trace, syscalls are already logged anyways.
@@ -268,10 +268,10 @@ const std::array<std::pair<ppu_intrp_func_t, std::string_view>, 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a root syscall though, games do not have access to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are used in cellRtc, so I need them defined as a function. Do you want me to add a root check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
I'll review the rtc changes sometime this week. |
rpcs3/Emu/Cell/Modules/cellRtc.cpp
Outdated
if (ret >= CELL_OK) | ||
{ | ||
tick->tick += *time * cellRtcGetTickResolution(); | ||
} | ||
else if (ret == static_cast<s32>(SYS_SS_RTC_ERROR_UNK)) | ||
{ | ||
switch (*status) | ||
{ | ||
case 1: ret = CELL_RTC_ERROR_NO_CLOCK; break; | ||
case 2: ret = CELL_RTC_ERROR_NOT_INITIALIZED; break; | ||
case 4: ret = CELL_RTC_ERROR_INVALID_VALUE; break; | ||
case 8: ret = CELL_RTC_ERROR_NO_CLOCK; break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really verify this. maybe my analyser is borked. But whatever...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right click the instruction at 0x3b20 > click "Patch Instruction" > type in ori r0,r0,0
Do the same for the next instruction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing default in switch btw