Page 1 of 1

Syncing ST/STE clock with host

Posted: Tue Dec 31, 2019 5:35 pm
by Count
Is it possible to synchronize the clock of an ST/STE with the host to have the current time? As these machines don't have native RTC, I would like to use an AUTO folder programme, for example, as I used to do back in 1990 to read the RTC of the attached hard disk host adapter. Maybe Hatari offers a native feature I could use. Unfortunately I couldn't find any information in the docs.

Re: Syncing ST/STE clock with host

Posted: Tue Dec 31, 2019 5:43 pm
by czietz
Switch Hatari to MegaST (or MegaSTE) and you get an emulated RTC that is sync'ed to the host.

Re: Syncing ST/STE clock with host

Posted: Tue Dec 31, 2019 5:52 pm
by Count
That's what I am doing so far. But I cannot run a Mega STE with TOS 1.62, for example.

Re: Syncing ST/STE clock with host

Posted: Tue Dec 31, 2019 6:34 pm
by DoG
Run Mega STe with TOS 2.06.

Re: Syncing ST/STE clock with host

Posted: Wed Jan 01, 2020 10:41 am
by simonsunnyboy
Anything requiring TOS 1.62 will not care about a clock anyway being games and demos.

Re: Syncing ST/STE clock with host

Posted: Wed Jan 01, 2020 1:30 pm
by Count
I just want to ensure compatibility. But I think I can solve this problem with a host process (e.g. shell script) which writes the time to a file every two seconds and an AUTO folder program that reads this file.

Re: Syncing ST/STE clock with host

Posted: Wed Jan 01, 2020 3:48 pm
by Eero Tamminen
Count wrote:, I would like to use an AUTO folder programme, for example, as I used to do back in 1990 to read the RTC of the attached hard disk host adapter. Maybe Hatari offers a native feature I could use. Unfortunately I couldn't find any information in the docs.
HW interface to ST real time clock devices differs from the RTC used in Mega ST and newer machines, and nobody has developed support for former. Mainly because they need both HW & auto-folder SW, there's no TOS version supporting them directly. I don't how well /whether the actual HW interfaces were even documented, or whether any of the SW came with (freely distributable) sources.

If you would still like NatFeats host time API, send you API spec proposal to hatari-devel mailing list (some patches to implement and test it would help too).

Re: Syncing ST/STE clock with host

Posted: Wed Jan 01, 2020 4:30 pm
by Count
I think that isn't necessary anymore. My "hack" described above works pretty well.

Re: Syncing ST/STE clock with host

Posted: Thu Jan 02, 2020 10:51 am
by tzok
Count wrote:As these machines don't have native RTC, I would like to use an AUTO folder programme, for example, as I used to do back in 1990 to read the RTC of the attached hard disk host adapter.
That's not true, these machines do have RTC, it is only not battery backed up.

Using the inbuilt RTC is also a little bit tricky, because the main clock is GEMDOS software RTC, but XBIOS queries the hardware RTC each time current time info is requested by GEMDOS function. The problem is the hardware RTC is not Y2K compliant.

Please read more here: https://www.exxoshost.co.uk/forum/viewt ... 281#p28281

Based upon that information STeven has adopted the host clock synchronization in STEeM SSE:
Image

Re: Syncing ST/STE clock with host

Posted: Sun Jan 12, 2020 4:41 pm
by Eero Tamminen
Originally emulated Hatari clock was synched to host, but that breaks some (ST) demos [1]. So, nowadays ST & STE clocks aren't synced to host, only emulated Mega and TT/Falcon models are (which have RTC + battery).

[1] Host clock can slightly change when synched to network time, and there's anyway some run-time drift between host clock and what's being emulated, at least when emulation is speeded up or slowed down.

Re: Syncing ST/STE clock with host

Posted: Sun Jan 12, 2020 10:18 pm
by charles
should be able to sync because st timer uses delay or pulse mode