Skip to content
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: some improvements #15408

Merged
merged 4 commits into from
Apr 8, 2024
Merged

cellRtc: some improvements #15408

merged 4 commits into from
Apr 8, 2024

Conversation

Megamouse
Copy link
Contributor

  • implement Rfc3339 part of cellRtcParseDateTime
  • simplify cellRtcParseRfc3339
  • return a value in cellRtcGetCurrentSecureTick

@Megamouse Megamouse added Firmware: HLE Refactoring Refactors or simplifies existing code labels Apr 5, 2024
@capriots
Copy link
Contributor

capriots commented Apr 6, 2024

I actually implemented cellRtc ~90% a year ago or so but didn't have time to finish it and just kinda forgot about it.
https://github.com/capriots/rpcs3/tree/cellRtc
I can review this PR in a day or two. I should have time to finish my own implementation next month.

Also here is my Ghidra export, maybe this is useful for you (doesn't include the actual binary, don't worry):
librtc.prx.xml.zip

@Megamouse Megamouse force-pushed the cellGAmer branch 2 times, most recently from a2e0382 to 5b5f3b9 Compare April 7, 2024 07:32
This would have increased pos by one too many.
@@ -1189,6 +1187,8 @@ error_code cellRtcGetCurrentSecureTick(vm::ptr<CellRtcTick> tick)

// TODO

tick->tick = 0xe01d003a63a000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use cellRtcGetCurrentTick() for now if you want.
The syscall here returns the hardware clock corrected for drift. It is unaffected by the date and time settings in the XMB/VSH settings, which makes it "secure" I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not gonna add stuff I haven't personally confirmed and I'm not gonna look into this any more for now.

@capriots
Copy link
Contributor

capriots commented Apr 7, 2024

I went over the decompilation for cellRtcParseRfc3339() again and your implementation seems correct. You can actually change the log level to notice, as there is nothing more to add I believe.

Edit: not quite, see below

@Megamouse Megamouse merged commit 412db75 into RPCS3:master Apr 8, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Firmware: HLE Refactoring Refactors or simplifies existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants