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: tick conversion improvements #15425

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

capriots
Copy link
Contributor

  • Both date_time_to_tick() and tick_to_date_time() now have constant run time
  • date_time_to_tick():
    • Replaced with implementation from cellRtcGetTick() which already is exactly what LLE does
    • Instead of counting the days that have passed in previous months in a loop, it now uses a lookup table since those values are always the same for each month
  • tick_to_date_time():
    • Microseconds, seconds, minutes, and hours are already calculated the same way as LLE
    • Day, month, and year are calculated differently from LLE but produces the same result for every input and is less complex
    • The amount of days that fit into a u64 tick is small enough that I was able to test this for every single possible day
  • Fixed the null pointer check in cellRtcGetTick(). LLE actually returns CELL_OK here.
  • Set log level for cellRtcGetTick() and cellRtcSetTick() to notice as these functions are fully implemented

@Megamouse Megamouse added Firmware: HLE Optimization Optimizes existing code labels Apr 11, 2024
@Megamouse
Copy link
Contributor

Otherwise it seems to be fine, based on some quick tests compared to old behaviour.

@Megamouse Megamouse merged commit 1ec2752 into RPCS3:master Apr 11, 2024
6 checks passed
@capriots capriots deleted the cellRtc2 branch April 11, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Firmware: HLE Optimization Optimizes existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants