home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / multikit.zip / CLOCK.DOC < prev    next >
Text File  |  1996-03-01  |  3KB  |  72 lines

  1.  
  2.  Documentation ─────────────────────────────────────────────────────────────┐
  3.  │                               Clock Handler                              │
  4.  └───────────────────────────────────────────────────────────── MULTIKIT v1.0
  5.  
  6.  
  7.  
  8.  This unit is the "heart" of MULTIKIT. Though it's very small the unit pro-
  9.  vides MULTIKITS' most important function: internal timing. User procedures
  10.  must access CLOCK.TPU when they need some timing.  (for sound mixing i.e.)
  11.  Programming the hardware directly by redirecting the INT 8h may cause  the
  12.  crash of the program if others handlers are already working in background.
  13.  
  14.  
  15.  
  16.  Public procedures and functions
  17.  ───────────────────────────────
  18.  
  19.  Procedure ClockInit(Freq: Word);
  20.            Inits the internal timer handler by redirecting the INT 8.  Sets
  21.            timer speed to FREQ. Please note that FREQ is the  maximum  fre-
  22.            quency for any user handlers which can be installed  after  ini-
  23.            tialising the clock.
  24.            This procedure takes care of the original INT  8  by  installing
  25.            it as the first user handler so that it will be called at 18  Hz
  26.            anymore.
  27.  
  28.  Procedure ClockDone;
  29.            Resets the PIT to its' default speed and gives  the  control  of
  30.            INT 8 back to the original handlers. You must call  this  proce-
  31.            dure before exiting your program. Of course  all  user  handlers
  32.            are removed.
  33.  
  34.  Function  ClockDemand(Freq: Word; Handler: Pointer): Word;
  35.            Installs a user timer handler. Maximum number of  user  handlers
  36.            which can be installed is four since one handler is reserved for
  37.            the call to the original INT 8.  Every  user  handler  procedure
  38.            must be declared as INTERRUPT. FREQ is the  frequency  at  which
  39.            the user handler will be called,  HANDLER  points  to  the  user
  40.            handler procedure. The internal handle number is returned. If it
  41.            is zero then an error has occured.  The  following  reasons  are
  42.            possible: internal timer not  initialised,  FREQ  to  high  (see
  43.            CLOCKINIT), no more handles available.
  44.  
  45.  Procedure ClockRemove(HNum: Word);
  46.            Removes a user timer handler. HNUM is the internal handler  num-
  47.            ber (which is returned by CLOCKDEMAND).
  48.  
  49.  
  50.  
  51.  Notes
  52.  ─────
  53.  
  54.  Call CLOCKINIT at beginning of your program and CLOCKDONE at the end. It's
  55.  not recommended to call them more than one time since you can install user
  56.  handlers everywhere within your program.
  57.  
  58.  Install the most important handler as the first one because  the  handlers
  59.  will be called in order.
  60.  
  61.  If the chosen handler frequency is not a multiple of the intialised  timer
  62.  frequency the handler will be called at a little bit higher frequency.
  63.  
  64.  The unit SOUND.TPU needs CLOCK.TPU for internal timing processes. So  make
  65.  sure that CLOCK.TPU is reachable for this unit.
  66.  
  67.  
  68.  
  69.  This unit is part of MULTIKIT.   
  70.  (C) Copyright by TSC-Software, 1995.
  71.  
  72.