[hatari-devel] IKBD clock year

Eero Tamminen oak at helsinkinet.fi
Tue Apr 19 20:56:58 CEST 2011


Hi,

On tiistai 19 huhtikuu 2011, Vincent Rivière wrote:
> The IKBD read date command is supposed to retrieve the current date and
> time in packed BCD format. In Hatari, the year 2011 is returned as 0xb1,
> which is obviously illegal (B is not a decimal digit).
> Fortunately (or not), EmuTOS converts 0xb1 as 11*10+1 = 111 and adds
> 1900 which finally gives 2011.
> 
> As a comparison, Steem returns 0x11 for 2011 (it actually returns bogus
> year values after 16h00 but this is another bug).
> 
> EmuTOS had a bug and did not handle years from 00 to 79 correctly.

Maybe somebody had before year 2000 some reason to set clock a lot
backwards? :-)


> I have just fixed it in CVS, so they are now respectively handled as 2000
> to 2079. The range 80 to 99 is still handled as 1980 to 1999.
> 
> So my question is:
> Does Hatari return 0xb1 intentionally, or is this a bug ?

I think it's a bug.  Could you try the attached patch?


> Does it behave well with TOS ?

I tried with old EmuTOS and some >=1.6 TOS versions that are compatible
with xcontrol.acc.  Date was correct in xcontrol.acc both for current &
patched Hatari.  What did you use to test the date?

(I tried using Clocky v2.36 to test older TOS versions but it's buggy
and shows ";1" for year both for current & patched Hatari.)


> Anyway, regarding to EmuTOS, now you can return either 0xb1 or 0x11,
> both work as expected.


	- Eero

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ikbd-date.diff
Type: text/x-patch
Size: 823 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20110419/74e636e4/attachment.bin>


More information about the hatari-devel mailing list