home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / vbi / vbi.h < prev   
Text File  |  1987-01-01  |  2KB  |  55 lines

  1. /* vbi.h -- vertical blank interrupt handler [Version 1.0  01/01/87]
  2.  *
  3.  * Copyright (C) 1987 by Amgem, Inc.
  4.  *
  5.  * Permission is hereby granted for anyone to make or distribute copies of
  6.  * this program provided the copyright notice and this permission notice are
  7.  * retained.
  8.  * 
  9.  * This software, or software containing all or part of it, may not be sold
  10.  * except with express permission of the authors.
  11.  *
  12.  * Authors:  Bill Dorsey & John Iarocci
  13.  *
  14.  * If you have any questions or comments, the authors may be reached at
  15.  * The Tanj BBS, (301)-251-0675.  Updates and bug fixes may also be obtained
  16.  * through the above service.
  17.  *
  18.  * The code which follows was compiled using the Mark Williams C compiler,
  19.  * but should be portable with little work to other C compilers.  See the
  20.  * associated documentation for notes on how to convert it for use with other
  21.  * C compilers
  22.  */
  23.  
  24. /* operating system variables */
  25. #define    VBLSEM        ((int *) 0x452L)
  26. #define VBLQUEUE    ((int (***)()) 0x456L)
  27. #define PSG        ((char *) 0xff8800L)
  28. #define PSG2        ((char *) 0xff8802L)
  29. #define GPIP        ((char *) 0xfffa01L)
  30.  
  31. /* process states */
  32. #define    FREE        0
  33. #define READY        1
  34. #define SLEEP        2
  35.  
  36. /* return values */
  37. #define OK        (-1)
  38. #define SYSERR        (-2)
  39.  
  40. /* system values */
  41. #define TICKSPERSEC    70    /* 70 for MONO, 50 for RGB */
  42. #define QUANTUM        5    /* should be a factor of tickspersec */
  43. #define INTERVAL    (TICKSPERSEC/QUANTUM)
  44. #define NPROC        8    /* maximum number of processes */
  45.  
  46. /* misc macros */
  47. #define DISABLE        *VBLSEM=0
  48. #define ENABLE        *VBLSEM=1
  49.  
  50. typedef struct {
  51.   int state;
  52.   int (*func)();
  53.   int count;
  54. } PROC;
  55.