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

[RTC] Update for setdatetime and settime #23

Merged
merged 7 commits into from
Nov 29, 2023

Conversation

Lorenzooone
Copy link
Contributor

No description provided.

@Lorenzooone
Copy link
Contributor Author

Do note: the second commit can be axed, if it's not good enough.
The RTC status is queried only when setting the time, as, when reading the time, it's implicit in the way the AM/PM flag works (in theory).

@Lorenzooone
Copy link
Contributor Author

I have honestly no idea whether 1d3460c should be kept or not. Regular carts work without it, but the EZ Flash Omegas don't. Up to you, honestly.
Just sharing this knowledge is already good.

@felixjones
Copy link
Owner

I have honestly no idea whether 1d3460c should be kept or not. Regular carts work without it, but the EZ Flash Omegas don't. Up to you, honestly. Just sharing this knowledge is already good.

I have some EZO detection code lying around somewhere, might be worth wrapping this in a check for that

Do we know exactly how many cycles need to be waited before the writes are good? I would prefer a loop written in assembly to make it obvious that N cycles of delay is required

@Lorenzooone
Copy link
Contributor Author

I haven't measured the cycles precisely. However, if we want really precise waiting, it should be moved to IWRAM as well...?

@felixjones
Copy link
Owner

I haven't measured the cycles precisely. However, if we want really precise waiting, it should be moved to IWRAM as well...?

Eh, definitely don't want this in IWRAM. I was thinking make the delay as short as possible, but really it's just RTC time set code, I'm sure a short delay doesn't matter

@Lorenzooone
Copy link
Contributor Author

I haven't measured the cycles precisely. However, if we want really precise waiting, it should be moved to IWRAM as well...?

Eh, definitely don't want this in IWRAM. I was thinking make the delay as short as possible, but really it's just RTC time set code, I'm sure a short delay doesn't matter

I was more thinking about having a small "delay function" in IWRAM, that, regardless of what the EWRAM/ROM settings are, always executes the same number of requested cycles. It could be useful for other stuff as well. But I understand it's kind of weird...?

@Lorenzooone
Copy link
Contributor Author

Lorenzooone commented Nov 20, 2023

Another way would be to implement a backoff mechanism. Though that would mean adding a read of the rtc to the function that sets it.
It would be faster for regular carts, though.

@felixjones
Copy link
Owner

Going to merge this into rtc2, and I'll do a cleaning pass over it

Great work!

@felixjones felixjones merged commit 3076bf6 into felixjones:rtc2 Nov 29, 2023
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