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

Improve RTC support, implement RTC write command #205

Merged
merged 2 commits into from
Sep 4, 2021

Conversation

meeq
Copy link
Contributor

@meeq meeq commented Jul 18, 2021

The Joybus commands to read/write to RTC are based off of the UltraPIF implementation (thanks @jago85!)

The N64DD commands to read/write to RTC are based off of LuigiBlood's research (thanks @LuigiBlood)

Note that RTC writes are currently not persistent after the emulator quits and will always revert to system local time on the next launch.

Reading Writing
rtctest rtctest_edit

Changes to get_local_time

get_local_time now supports an offset (in seconds) so that the RTC clock can be adjusted relative to local time.

Note that the implementation of getting the operating system time has been unified using ISO C Time functions; I have made a best-effort to implement this for Windows but I do not run Windows so I have not tested it. I would greatly appreciate it if a Windows user could build this and run my test ROM.

Test ROM

rtctest.zip (For more information about this test ROM, please see DragonMinded/libdragon#152)

Note that the test ROM does not currently support the N64DD RTC, you can test reading/writing to the 64DD RTC using the DD IPL ROM (holding down A while booting).

* Set local time offset when writing to Joybus or 64DD RTC.
* Refactor get_local_time to use ISO C Time APIs.

Special thanks to @jago85 and @LuigiBlood for their research!
@sp1187 sp1187 merged commit 95f8dd1 into n64dev:master Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants