[Feature Request] Add "Sync to computer" time setting #355

Closed
opened 2024-12-06 19:02:17 +00:00 by MarioSwitch · 14 comments
MarioSwitch commented 2024-12-06 19:02:17 +00:00 (Migrated from github.com)

Overview

image

Add a "Sync to computer" / "Auto" checkbox for emulated Nintendo Switch Date/Time.

When this checkbox is enabled, hide (or disable) "System Time Zone" and "System Time", and set Switch Date/Time/Timezone according to computer clock.

This checkbox will, for example, check and re-sync Switch clock at every Ryujinx boot.

Smaller details

This would avoid slight difference appearing after some time...
Check attached picture: Switch is set to 19:47 while my PC says 19:49...

Nature of request

Small QoL update

Why would this feature be useful?

  • Avoid unexpected differences (few minutes) between games and computer
  • Automatically change timezone when travelling (as, by default, many computers are set to change timezone automatically)
### Overview ![image](https://github.com/user-attachments/assets/b4f549d8-cc22-440d-bab6-ddc22c8869a6) Add a "Sync to computer" / "Auto" checkbox for emulated Nintendo Switch Date/Time. When this checkbox is enabled, hide (or disable) "System Time Zone" and "System Time", and set Switch Date/Time/Timezone according to computer clock. This checkbox will, for example, check and re-sync Switch clock at every Ryujinx boot. ### Smaller details This would avoid slight difference appearing after some time... Check attached picture: Switch is set to 19:47 while my PC says 19:49... ### Nature of request Small QoL update ### Why would this feature be useful? - Avoid unexpected differences (few minutes) between games and computer - Automatically change timezone when travelling (as, by default, many computers are set to change timezone automatically)
Rifl33 commented 2024-12-07 01:44:58 +00:00 (Migrated from github.com)

Canyou assign this to me @GreemDev

Canyou assign this to me @GreemDev
GreemDev commented 2024-12-07 01:46:49 +00:00 (Migrated from github.com)

Canyou assign this to me @GreemDev

If you want to work on it then do :p
You don't need to be assigned to open a PR that targets an issue

> Canyou assign this to me @GreemDev If you want to work on it then do :p You don't need to be assigned to open a PR that targets an issue
Rifl33 commented 2024-12-07 02:34:31 +00:00 (Migrated from github.com)

Ok il do it

Ok il do it
Rifl33 commented 2024-12-09 06:25:52 +00:00 (Migrated from github.com)

@GreemDev @MarioSwitch I cant do this so dont expect me to do this something broke in my computer and i need to fix it and i wont be able to do this for a while. If nobody does this till i fix my computer i will do this

@GreemDev @MarioSwitch I cant do this so dont expect me to do this something broke in my computer and i need to fix it and i wont be able to do this for a while. If nobody does this till i fix my computer i will do this
MarioSwitch commented 2024-12-09 08:48:28 +00:00 (Migrated from github.com)

@GreemDev @MarioSwitch I cant do this so dont expect me to do this something broke in my computer and i need to fix it and i wont be able to do this for a while. If nobody does this till i fix my computer i will do this

No problem! 😊
It was just a suggestion, feel free to do that when you can, don't worry 😅

> @GreemDev @MarioSwitch I cant do this so dont expect me to do this something broke in my computer and i need to fix it and i wont be able to do this for a while. If nobody does this till i fix my computer i will do this No problem! 😊 It was just a suggestion, feel free to do that when you can, don't worry 😅
GreemDev commented 2024-12-22 01:44:32 +00:00 (Migrated from github.com)

As per that commit message: Partially resolves https://github.com/GreemDev/Ryujinx/issues/355. I think that wanted automatic. If automatic functionality is still desired even with this change then that will be considered.

As per that commit message: `Partially resolves https://github.com/GreemDev/Ryujinx/issues/355. I think that wanted automatic. If automatic functionality is still desired even with this change then that will be considered.`
MarioSwitch commented 2024-12-22 13:51:03 +00:00 (Migrated from github.com)

@GreemDev The update is interesting...

  1. Clicked "Match PC time" in Settings (this instantly corrects time delta)
  2. Closed the app
  3. Changed PC time
  4. Reopened the app, new PC time is automatically shown in Settings, but time zone still shows "Europe/Paris" despite have changed it in PC time settings
  5. Overwrote Switch Time by a fake time
  6. Closed and reopened the app, fake time persists (correct behaviour)

So, behaviours are what I wanted, but:

  • Please clarify when System Time matches PC time
    • For example, convert button to checkbox. When the checkbox is checked, grey out system date/time/timezone and prevent them to be changed.
    • You can also add a "Time Mode" dropdown: "Automatic (PC time)" or "Manual / Custom". When "Automatic" is selected, system date/time/timezone are hidden. When "Manual" is selected, they reappear to be able to change them.
  • Also match timezone when "Match PC time"
@GreemDev The update is interesting... 1. Clicked "Match PC time" in Settings (this instantly corrects time delta) 2. Closed the app 3. Changed PC time 4. Reopened the app, new PC time is automatically shown in Settings, **but time zone still shows "Europe/Paris" despite have changed it in PC time settings** 5. Overwrote Switch Time by a fake time 6. Closed and reopened the app, fake time persists **(correct behaviour)** So, behaviours are what I wanted, but: - Please clarify when System Time matches PC time - For example, convert button to checkbox. When the checkbox is checked, grey out system date/time/timezone and prevent them to be changed. - You can also add a "Time Mode" dropdown: "Automatic (PC time)" or "Manual / Custom". When "Automatic" is selected, system date/time/timezone are hidden. When "Manual" is selected, they reappear to be able to change them. - Also match timezone when "Match PC time"
GreemDev commented 2024-12-22 15:48:52 +00:00 (Migrated from github.com)

TimeZone isn't matched because it's not normal time zones. it's specifically ones supported in the switch firmware, and it would be a nightmare to try and convert

TimeZone isn't matched because it's not normal time zones. it's specifically ones supported in the switch firmware, and it would be a nightmare to try and convert
GreemDev commented 2024-12-22 15:53:02 +00:00 (Migrated from github.com)

Also, as it is it won't be converted to a checkbox. This is what I meant by automatic.

You click the box when time is out of sync, that's it.

I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct.

Also, as it is it won't be converted to a checkbox. This is what I meant by automatic. You click the box when time is out of sync, that's it. I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct.
InstantRamenPack commented 2024-12-22 18:03:23 +00:00 (Migrated from github.com)

@GreemDev Perhaps a resync on game launch? This could be its own button option.

Also, I suggest renaming the button to "resync to PC time", and a tooltip that sort of explains what you said above. I think using the word "resync" makes it clear that it will drift away again after syncing.

@GreemDev Perhaps a resync on game launch? This could be its own button option. Also, I suggest renaming the button to "resync to PC time", and a tooltip that sort of explains what you said above. I think using the word "resync" makes it clear that it will drift away again after syncing.
GreemDev commented 2024-12-22 18:54:15 +00:00 (Migrated from github.com)

@GreemDev Perhaps a resync on game launch? This could be its own button option.

Also, I suggest renaming the button to "resync to PC time", and a tooltip that sort of explains what you said above. I think using the word "resync" makes it clear that it will drift away again after syncing.

1ea345faa7

> @GreemDev Perhaps a resync on game launch? This could be its own button option. > > Also, I suggest renaming the button to "resync to PC time", and a tooltip that sort of explains what you said above. I think using the word "resync" makes it clear that it will drift away again after syncing. https://github.com/GreemDev/Ryujinx/commit/1ea345faa7a908125ecdb278873451b5920cfed1
MarioSwitch commented 2024-12-23 11:13:31 +00:00 (Migrated from github.com)

Also, as it is it won't be converted to a checkbox. This is what I meant by automatic.

You click the box when time is out of sync, that's it.

I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct.

I understand, but when I've tested, it seems "System Time" already auto-sync on Ryujinx startup.
As explained above, I selected "Match PC time", then changed my PC time, closed and reopened Ryujinx and, when I checked in the Settings, the updated time was shown, without re-clicking on "Match PC time"... 🤔

> Also, as it is it won't be converted to a checkbox. This is what I meant by automatic. > > You click the box when time is out of sync, that's it. > > I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct. I understand, but when I've tested, it seems "System Time" already auto-sync on Ryujinx startup. As explained above, I selected "Match PC time", then changed my PC time, closed and reopened Ryujinx and, when I checked in the Settings, the updated time was shown, without re-clicking on "Match PC time"... 🤔
GottemHams commented 2025-01-01 12:25:51 +00:00 (Migrated from github.com)

Actually, I would still prefer the syncing to happen automatically, instead of having to do it manually every time. My main problem is that when you just want to change your controller settings, the time won't update. The addition of the sync button doesn't really help with that, you still need to remember to use that before clicking OK every time you adjust other settings. I have an old controller so I frequently need to adjust the sticks' deadzones, for example (different setting per game). Or change the memory mode/hypervisor/default docked setting for certain games.

Also, does the sync button account for seconds? Like if I press it (and OK) on 13:37:37 and wait 23 seconds, will Ryujinx be at 13:38:00 or 13:37:23? The UI doesn't have an input for seconds so you can't really tell without timing it yourself.

I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct.

Would it not be possible to simply answer the Switch's system call directly with data from the host itself (DateTime.Now)? That way Ryujinx wouldn't even have to keep time separately. The time zone is not really used as far as I can tell, since Ryujinx still has to tell the firmware exactly what time it is? Which means that changing the time zone shouldn't affect the time anyway, so it's really only there because the firmware needs some value for it. I think you can safely assume that the time should always be the host's own time, regardless of time zone. Unless of course someone opts out of the automatic sync in the first place.

Alternatively: Wouldn't it be an option to just not re-save the time if you didn't even touch it? Sync the time with your computer once, then if you change any other setting the time won't be re-saved (and thus won't drift). Should be fairly simple to keep track of whether the user changed the time manually. At least that way you can still change other settings in the same tab without affecting the time (VSync and hacks). I haven't experienced drift without touching the settings panel though, so I'm not sure if that would help @MarioSwitch.

Actually, I would still prefer the syncing to happen automatically, instead of having to do it manually every time. My main problem is that when you just want to change your controller settings, the time won't update. The addition of the sync button doesn't really help with that, you still need to remember to use that before clicking `OK` every time you adjust other settings. I have an old controller so I frequently need to adjust the sticks' deadzones, for example (different setting per game). Or change the memory mode/hypervisor/default docked setting for certain games. Also, does the sync button account for seconds? Like if I press it (and `OK`) on 13:37:37 and wait 23 seconds, will Ryujinx be at 13:38:00 or 13:37:23? The UI doesn't have an input for seconds so you can't really tell without timing it yourself. > I can't really think of a way to make it automatic that isn't a damn mess. Fixing it whenever you open settings? Well that "works", but it'd lead you into thinking games just aren't respecting the settings because it's out of sync, then when you go to check the time it looks correct. Would it not be possible to simply answer the Switch's system call directly with data from the host itself (`DateTime.Now`)? That way Ryujinx wouldn't even have to keep time separately. The **time zone** is not really used as far as I can tell, since Ryujinx still has to tell the firmware exactly what time it is? Which means that changing the time zone shouldn't affect the time anyway, so it's really only there because the firmware needs **some** value for it. I think you can safely assume that the time should always be the host's own time, regardless of time zone. Unless of course someone opts out of the automatic sync in the first place. Alternatively: Wouldn't it be an option to just not re-save the time if you didn't even touch it? Sync the time with your computer once, then if you change any other setting the time won't be re-saved (and thus won't drift). Should be fairly simple to keep track of whether the user changed the time manually. At least that way you can still change other settings in the same tab without affecting the time (VSync and hacks). I haven't experienced drift **without** touching the settings panel though, so I'm not sure if that would help @MarioSwitch.
GreemDev commented 2025-02-03 05:49:03 +00:00 (Migrated from github.com)

@GottemHams @MarioSwitch Your wish has been granted, for real this time.

An active setting has been added in commit 774edb7.
You can get this feature in Canary 332 and later.

@GottemHams @MarioSwitch Your wish has been granted, for real this time. An active setting has been added in commit [774edb7](https://github.com/Ryubing/Ryujinx/commit/774edb7b29bf8ba44b0cea331977b37017ac6499). You can get this feature in Canary 332 and later.
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MeloNX/Ryujinx-ryubing#355
No description provided.