========================================================================
Unit:    RTCs
VCL:     TRtcTimer
Version: 0.5
Copyright (C) 1996, Immo Wache

========================================================================
Component Idea

Since a lot of time I'm looking for a function save solution to use 
hardware interrupts of standard PC-realtime-clock. I'm searching for 
a Solution with regular and delayed so short as possible calls a user 
function. This should be happen while DOS-Box is activ or an other 
application is loading. For this my suggestion.

========================================================================
Component Overview

- TRtcTimer is descended from Tcomponent and is designated for use of
  realtime clock and use of it's hardware interrupts.
- TRtcTimers use is similar to use of Ttimer.
- Additional it owns a property Resolution for determine accuracy of 
  interrupt time distance.
- There is only one instance allowed.(I did'nt found a better solution 
  yet.)
- Ther is no need to a interrupt function inside a DLL.
- The OnTimerEvent is performed inside interrupt routine. Thats why no 
  API-function calls are allowed inside.

========================================================================
Methods and Properties


TRtcTimer is descend from TComponent but ownes all properties of
TTimer with exceptions as follows:
Create:  - it is checked for only one instance of TRtcTimer in a program
OnTimer: - The Event is performed inside the interrupt routine. Thats why 
           no API-function calls are allowed inside.
           All Units, which functions are called inside of OnTimer 
           should be compiled with options:
                                          {$C FIXED, PRELOAD, PERMANENT}

new methods and properties of THexEdit are:

Property Resolution
===================
declaration
  property Resolution: Word;

description
  Property Resolution determine maximum value of interrupt time delay
  (in ms). 
  A delay mainly occure in time critical situations of operation system
  (e.g.loading of an application, data transfer on network).
..Auxillary great delays occure while video adapter mode changes
  (e.g.switch to a Dos-box). This apperars especially with older video 
  adapters.

description
  Use of Resolution look for demo program.

========================================================================
Files:
  README.TXT      this description file
  RTCS.PAS        source for TRtcTimer
  RTCS.DCR        Resource containing Component bitmap
  RTCS.TXT        short description of component

  RTCDEMO.DPR     demo program of TRtcTimer use
  RTCDEMO.RES
  RTCMAIN.PAS
  RTCMAIN.DFM

========================================================================
To Install:
1)  Copy/Move RTCS.PAS & RTCS.DCR to a directory
    (i.e. C:\DELPHI\SOURCE\MY_VCL)
2)  Run Delphi and select the Tools|Install Components menu option.
3)  In the 'Search Path' add the directory where you copied the files.
4)  Click on Browse and locate the RTCS.PAS file. Hit OK.
5)  Click on OK to rebuild your Component library (COMPLIB.DCL).

Description of use
  Project RtcDemo contains a example for use of component.

========================================================================
Structure and method of working

Component TTimer did'nt meed my needs mentioned above (e.g. while moving 
a window with mouse).

Fortunately I found some tips on Internet. There are a Multimedia 
extention wich allows among other things access on realtime-clock (ref. 
to MMSystem.Hlp). There are some helpful hints of use too.

Especially this is:

- every timer interrupt calls a special call back function (CBF),
- creation of CBF don't need use of MakeProcInstance,
- CBF should be inside a DLL,
- DLL should be compiled with options FIXED, PRELOAD and PERMANENT,
- there are almost no API function calls allowed inside CBF,

On DSP (Delphi Super Page) I found shareware component FastTimer
(Copyright (c) 1995 Eric Nielsen).Unfortunately there is no source 
code. Since there a DLL I think it perform Timer in MMSystem manner.
Component is designed similar to standard component Ttimer. But 
inside OnTimerEvent its possible to use API-function calls. So I 
assume OnTimerEvent isn't called inside CBF. I guess, CBF only 
generates a user message and TFastTimer responds to it.
But it works only while messages are process (i.e. not in all 
circumstances mentioned above).

This reason why I did some tests. Result is component TRtcTimer. 
Unfortunately I had to insert some limitations because not all worked 
as I like. So it is a kind of alpha version which needs some 
improvements.

Hand over of data segment solution isn't good performed. There are also 
opportunity of hand over a TRtcTimer instance data adress. But I didn't 
found a solution to get data segment of its owner. This has to be set 
before calling its method. I'm would be verry grateful for some hints 
and improvements for these problems.

========================================================================
Remarks, Sources, Copyrights

You may use TRtcTimer any way you like. The code is copyrighted but 
released into the public domain. If you spot any bug, have any idea how 
to improve, want to let me know anything else, you can mail me at:

immo.wache@mbst.uni-rostock.de
snail mail Immo Wache
           Willem-Barents-Str. 28
           18106 Rostock
           Deutschland

========================================================================
History

  version 0.5
    Mar 10, 1996     alpha release

========================================================================
