🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #38034

Re: Wordperfect revision -- Now clock problem & fix.

#38034
From: Diane Barlow Close
Date: Fri, 14 Apr 1989 17:13
45 lines
2352 bytes
In article <3229@cs.dal.ca> silvert@cs.dal.ca (Bill Silvert) writes:
>- I asked about a bug I have run into, and they hadn't run into it --
>  have any of you?  My date function doesn't work, it always generates a
>  date on Jan. 1 some year in the 21st century (which year I forget).
>  The guy I spoke for said it works for him.  Perhaps it involves my
>  clock-setting software -- I use the clock that comes with the Supra
>  60-Meg hard drive, which seems to work fine for everything else.
>  Anyone have any idea what the problem might be?  It would be a very
>  useful function if I could get it to work!

I had the same problem when I got my new hard drive.  It does, indeed, seem
to be a problem with the clock-setting software (I use Supra software even
though my drive is a Micropolis 1335 with a BMS 200 card). 

There are actually 3 clocks in the ST.  They are the keyboard clock, the TOS
clock, and the BIOS clock.  Some hard drives set only one clock.  My BMS card
sets only the TOS clock.  If I remember correctly, I think WP uses the BIOS 
clock (a leftover from PC days, perhaps?).  Since the BMS clock only sets the 
TOS clock, my time and date in WP are screwed up (Jan 20 20??, way in the 
future).

To fix this irritating problem, my husband wrote a small program in Mark 
William's C that sets the BIOS clock.  Since it's a small program, I'll 
include it here:

/*	set all clocks according to TOS time	*/

#include <time.h>
#include <osbind.h>

main() {
    tetd_t td;

    td = ((long)Tgetdate()<<16) | (unsigned)Tgettime();
    Settime(td);
    Ksettime(tetd_to_tm(td));
}

That's it.  Try it out and see if it works.  Run it *after* you've run your
setclock program. 
-- 
Diane Barlow Close
      {uunet, crash, ucsd}!cacilj!close
      close@cacilj.uucp
      Free Canada -- Trade Mulroney
Technical Details
Message-ID: <959@cacilj.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!cacilj!close
References: <3229@cs.dal.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!cacilj!close
From: close@cacilj.UUCP (Diane Barlow Close)
Newsgroups: comp.sys.atari.st
Subject: Re: Wordperfect revision -- Now clock problem & fix.
Keywords: Not yet, date bug
Message-ID: <959@cacilj.UUCP>
Date: 14 Apr 89 17:13:13 GMT
References: <3229@cs.dal.ca>
Reply-To: close@cacilj.UUCP (Diane Barlow Close)
Distribution: na
Organization: CACI, Inc. - Federal, La Jolla, CA
Lines: 45