Syncing ST/STE clock with host

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.2.0

Moderators: simonsunnyboy, thothy, Moderator Team

Post Reply
User avatar
Count
Atari freak
Atari freak
Posts: 66
Joined: Sat Sep 16, 2017 9:15 am
Location: Germany

Syncing ST/STE clock with host

Post 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.
czietz
Hardware Guru
Hardware Guru
Posts: 1228
Joined: Tue May 24, 2016 6:47 pm

Re: Syncing ST/STE clock with host

Post by czietz »

Switch Hatari to MegaST (or MegaSTE) and you get an emulated RTC that is sync'ed to the host.
User avatar
Count
Atari freak
Atari freak
Posts: 66
Joined: Sat Sep 16, 2017 9:15 am
Location: Germany

Re: Syncing ST/STE clock with host

Post by Count »

That's what I am doing so far. But I cannot run a Mega STE with TOS 1.62, for example.
User avatar
DoG
Captain Atari
Captain Atari
Posts: 158
Joined: Sun Apr 01, 2018 11:02 pm

Re: Syncing ST/STE clock with host

Post by DoG »

Run Mega STe with TOS 2.06.
simonsunnyboy
Moderator
Moderator
Posts: 5235
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Syncing ST/STE clock with host

Post by simonsunnyboy »

Anything requiring TOS 1.62 will not care about a clock anyway being games and demos.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
User avatar
Count
Atari freak
Atari freak
Posts: 66
Joined: Sat Sep 16, 2017 9:15 am
Location: Germany

Re: Syncing ST/STE clock with host

Post 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.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2161
Joined: Sun Jul 31, 2011 1:11 pm

Re: Syncing ST/STE clock with host

Post 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).
User avatar
Count
Atari freak
Atari freak
Posts: 66
Joined: Sat Sep 16, 2017 9:15 am
Location: Germany

Re: Syncing ST/STE clock with host

Post by Count »

I think that isn't necessary anymore. My "hack" described above works pretty well.
tzok
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Jun 30, 2017 7:22 pm
Location: Bielsko-Biala, PL
Contact:

Re: Syncing ST/STE clock with host

Post 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
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2161
Joined: Sun Jul 31, 2011 1:11 pm

Re: Syncing ST/STE clock with host

Post 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.
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2704
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Syncing ST/STE clock with host

Post by charles »

should be able to sync because st timer uses delay or pulse mode
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Post Reply

Return to “Hatari”