Re: [hatari-devel] Re: Captain Blood IKBD clock

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


Am Thu, 20 Sep 2012 18:11:09 +0200
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:

> Le 20/09/2012 17:58, Thomas Huth a écrit :
> 
> >
> >> 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 ?

IIRC the problem only showed up with TOS 2.0x ... I just tried to
reproduce it (time was wrong in XCONTROL), but I did not manage to see
it anymore. Anyway, unless we hit another problem in this area, I think
we should keep the IKBD_ToBCD function as it is right now.

 Thomas



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