home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
multikit.zip
/
CLOCK.DOC
< prev
next >
Wrap
Text File
|
1996-03-01
|
3KB
|
72 lines
Documentation ─────────────────────────────────────────────────────────────┐
│ Clock Handler │
└───────────────────────────────────────────────────────────── MULTIKIT v1.0
This unit is the "heart" of MULTIKIT. Though it's very small the unit pro-
vides MULTIKITS' most important function: internal timing. User procedures
must access CLOCK.TPU when they need some timing. (for sound mixing i.e.)
Programming the hardware directly by redirecting the INT 8h may cause the
crash of the program if others handlers are already working in background.
Public procedures and functions
───────────────────────────────
Procedure ClockInit(Freq: Word);
Inits the internal timer handler by redirecting the INT 8. Sets
timer speed to FREQ. Please note that FREQ is the maximum fre-
quency for any user handlers which can be installed after ini-
tialising the clock.
This procedure takes care of the original INT 8 by installing
it as the first user handler so that it will be called at 18 Hz
anymore.
Procedure ClockDone;
Resets the PIT to its' default speed and gives the control of
INT 8 back to the original handlers. You must call this proce-
dure before exiting your program. Of course all user handlers
are removed.
Function ClockDemand(Freq: Word; Handler: Pointer): Word;
Installs a user timer handler. Maximum number of user handlers
which can be installed is four since one handler is reserved for
the call to the original INT 8. Every user handler procedure
must be declared as INTERRUPT. FREQ is the frequency at which
the user handler will be called, HANDLER points to the user
handler procedure. The internal handle number is returned. If it
is zero then an error has occured. The following reasons are
possible: internal timer not initialised, FREQ to high (see
CLOCKINIT), no more handles available.
Procedure ClockRemove(HNum: Word);
Removes a user timer handler. HNUM is the internal handler num-
ber (which is returned by CLOCKDEMAND).
Notes
─────
Call CLOCKINIT at beginning of your program and CLOCKDONE at the end. It's
not recommended to call them more than one time since you can install user
handlers everywhere within your program.
Install the most important handler as the first one because the handlers
will be called in order.
If the chosen handler frequency is not a multiple of the intialised timer
frequency the handler will be called at a little bit higher frequency.
The unit SOUND.TPU needs CLOCK.TPU for internal timing processes. So make
sure that CLOCK.TPU is reachable for this unit.
This unit is part of MULTIKIT.
(C) Copyright by TSC-Software, 1995.