<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 06 Jan 1999 01:29:31 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: [BBC Micro] Real Time Clock

Andrew Benham <adsb@...> wrote:
> Over Christmas I realised that the Real Time Clock on the BBC Master 128
> is only supported up to 31 December 1999.
 
I think you mean 'the time returned only goes up to 13-12-1999'.
 
> Looking at the chip there's no problem, so it's just the way the MOS
> firmware interacts with it. So I've started to look at what's involved
> in fixing the firmware, and making reasonable progress.
 
The RTC read call has /never/ been guaranteed to return the correct date. 
Programs reading the date should always do something along the lines of:
'get date, is it sensible?, if not, do something with it'.  Unfortunately,
too many lazy programmers just did: 'get date, use date/show to user'
without doing anything with it.
 
All my programs check the date, and specifically, they do: 'read date, if
year-within-century > 80 then use century 19, else use century 20'.
 
> My plan is to come up with a patch. Then anyone with a Vine Micros
> overlay board can blow an EPROM to map in the new code.
 
Yes, this would fix it at the source and allow *TIME to display correcty.
 
> I don't know if anyone else has looked at this - if there is a fix
> already, I'll stop!
 
I've been going through various date-related software and have been
producing patches for them.  I have been uploading them to Arcade file
area 71 - BBC Micro Area.
 
> I was also responsible for the maintenance of Beebug's Master ROM. This
> will need updating to handle years >= 2000, but I can do this as I have
> the source code. I take it Beebug are long gone ??
 
At machine code level when dealing with the date as a string, the easiest
thing to do is check the decade number.  If it is 8 or 9, force the
century to be '19', otherwise force the century to be '20'.  When dealing
with the date as a number, you should always use 80/81 as the boundary
point as the Short Acorn Era is defined as year 0 being 1981.
 
PS: In future try to ensure that your posts are in clear-text and not
inside an encoded embedment.
 
-- 
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@...                --- BBC+Master / Z80+6502 / CoPro+Tubes / Econet+SJ
Devolution / Transport / Planning - - - - - - - - - - - - - http//mdfs.net
Walkley Focus Editor:  http://homepages.nildram.co.uk/~amilton/walkley.htm
Death->By-Election->Lots of work->Arrgghh!!->Slow Email Replies->Sorry->:)
-- 
    ___  ___  ___  ___  ___  ___   |  Free Internet E-mail and Usenet News  | 
|  /   \/   \/   \/   \/   \/   \  | +44 181 654 2212 also +44 181 655 4412 |
|    A    R    C    A    D    E    |   Croydon  UK  -  Fidonet#2:254/27.0   |
|     The Definitive Acorn BBS     | http://arcade.demon.co.uk  at weekends |
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>