On 6 Apr 2016 at 10:28, Nicolas Pomarède wrote:
Le 06/04/2016 03:15, Roger Burrows a écrit :
I was doing some work on EmuTOS time and date handling, and noticed that
setting the time on the MegaST real time clock does nothing. That's not a
very
good emulation ;-). Looking at Hatari source, it seems to be deliberate.
Why?
Hi
stupid question, but did you enable real time clock into "system"
settings :) ?
Not a stupid question, since I'm not smart enough to know what it means ;-).
What do you mean by "system settings"? If you mean the page that is displayed
by clicking on the "System" button, then yes, it's enabled there. And FWIW,
EmuTOS detects the system as a Mega ST.
From a user program perspective, if I do a Tsettime()/Tsetdate() and then read
the data back with Tgettime()/Tgetdate(), I expect it to be the same (well
perhaps differing by a couple of seconds). But this doesn't work for me. So I
looked at the EmuTOS code and see that Tsettime()/Tsetdate() writes the time to
the RTC, and Tgettime()/Tgetdate() reads it back. The time/date read back is
unchanged from what it was before the write.
I'm also not very familiar with Hatari internals, so I may be misunderstanding
the code, but in rtc.c, all the time/date data appears to come directly from
the host clock (e.g. Rtc_SecondsUnits_ReadByte()), and apart from the a couple
of interceptions for compatibility reasons, all the writes go to
IoMem_WriteWithoutInterception() (see ioMemTabSTE.c) which does nothing.