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.
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.