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

Add DolphinDevice::GetSystemTime to allow for accurate Unix timestamp generation #11269

Merged
merged 2 commits into from Nov 15, 2022

Conversation

vabold
Copy link
Contributor

@vabold vabold commented Nov 11, 2022

Upstream's current GetSystemTime function returns the elapsed time. According to the comment, the change was made with the goal of making "buggy emulated code less likely to have issues". However, the old functionality is applicable when generating Unix timestamps for Discord rich presence.

If this implementation of generating these timestamps is not preferred, I am open to suggestions on alternative methods.

@JosJuice

This comment has been hidden.

@vabold

This comment has been hidden.

@JosJuice

This comment has been hidden.

Source/Core/Core/IOS/DolphinDevice.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/DolphinDevice.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

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

Seems fine to me, untested.

@AdmiralCurtiss AdmiralCurtiss merged commit c9e7480 into dolphin-emu:master Nov 15, 2022
11 checks passed
@shuffle2
Copy link
Contributor

I don't understand why the change for Discord would require changing the ioctl?
It's too late now, but I think renaming an enum value in this way should never be done...fwiw.

@jordan-woyak
Copy link
Member

I don't understand why the change for Discord would require changing the ioctl? It's too late now, but I think renaming an enum value in this way should never be done...fwiw.

This is just the "dolphin" device, for emulation-aware software to get host information. I guess they wanted unix time from the host instead of using libogc's time function? Gross to change an enum value, but probably only 3 people in the universe are using this feature at least.

@Leseratte10
Copy link
Contributor

Well, Wiimmfi uses it to get accurate in-game timings even if the game lags, so quite a few players are going to be using this feature. But that's using a hardcoded value of 0x01 for the time request through the emulated game, so as long as the behaviour of Ioctl 0x01 doesn't change, no matter what it's called, that should continue working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants