Skip to content

Improve RTC support, implement RTC write command#205

Merged
sp1187 merged 2 commits inton64dev:masterfrom
meeq:feature/rtc-write
Sep 4, 2021
Merged

Improve RTC support, implement RTC write command#205
sp1187 merged 2 commits inton64dev:masterfrom
meeq:feature/rtc-write

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!
@meeq meeq force-pushed the feature/rtc-write branch from db8a21f to 8b06e62 Compare July 26, 2021 21:54
@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