Re: [hatari-devel] Hatari clock question

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 15.8.2022 10.15, Uwe Seimet wrote:
Hatari RTC code reads the time from host:
https://git.tuxfamily.org/hatari/hatari.git/tree/src/rtc.c

And allowing emulation to write host time seems rather bad form...

I did not mean that the host time should be modified when you set the time
in the emulation. If you set the time in Hatari the host time should not be
affected.

For modifiable, host derived RTC, Hatari would need to calculated offset
from host time whenever emulation program tries to change RTC values,
and use that offset on all reads.

That is a solution that also crossed my mind.

If you are interested on adding patch like that, it would be good if
others could befoe that comment whether supporting such behavior is good
idea, or are there potential issues?

I don't intend to provide a patch, I just noticed a potential problem where
Hatari's behavior differs from real hardware and reported it. It turned out
that the software problem I stumbled upon is not caused by the date/time.

Ok, I added note about that to Hatari "todo.txt".


But I would not be surprised if (maybe not now but in the future) this will actually become an issue.

In Hatari v0.40 (in 2003), Thomas added (MegaST compatible) RTC functionality.

In Hatari v0.70 (in 2005), Thomas added config and SDL GUI option to toggle RTC support, with it being _enabled by default_.

In Hatari v1.5 (in 2011), I added also CLI option for RTC.

In Hatari v1.7 (in 2013), Nicolas changed clock to be handled internally in IKBD, so that host date / time is used only to initialize RTC at boot (for ST/STE).

In Hatari v1.8 (in 2014), Nicolas disables RTC by default as it breaks some ST/STE demos. This would obviously affect only new Hatari installations.

In Hatari v2.0 (in 2016) when MegaST / MegaSTE emulation was added, RTC option was removed by Thomas as only difference (at that time) between Mega vs non-Mega was RTC. Only ST / STE do not have RTC enabled.


I.e. there have been no functional changes in how RTC functionality works since 2003, and it has been enabled by default for most of that time, and on most machine types.

It seems unlikely that there would be problems that haven't been reported since?


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/