[hatari-devel] Re: Captain Blood IKBD clock

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


Le 20/09/2012 17:58, Thomas Huth a écrit :

There were indeed two problems left, first IKBD_FromBCD had a bug,
calculating wrong values for the year 99, and second the mktime
function created a timestamp that was one hour off. After having a
closer look at the man-page, I discovered that I missed to set the
"daylight saving time" field in the tm structure, so I guess that
caused the difference of one hour. After setting the "tm_isdst" field,
Captain Blood seems is working fine for me now.


Good, thanks.


Also, independantly of this bug, the ikbd's year is returned as :

IKBD_ToBCD(SystemTime->tm_year)

which is wrong for tm_year>= 100. 2012 gives tm_year = 112 and a BCD
value of 0xB2. The correct way would be to return :

IKBD_ToBCD( SystemTime->tm_year % 100 )

which correctly returns 0x12. But even with this modification, time
is still wrong in Captain Blood.

That "bug" is on purpose, see the comment of the IKBD_ToBCD() function.

OK, I wondered what the comment wrt overflow meant. Does it means that only TOS >= 2 are able to handle years >= 2000 ?


Nicolas



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