home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SLOWRUNS.ZIP / SLOWSRC.ZIP / MAGIC8.H < prev    next >
C/C++ Source or Header  |  1995-12-11  |  1KB  |  38 lines

  1. #define TIME_KEEPER_INT    0x1C     // gets control of the timer
  2.  
  3. #define PIC_ICR            0x20    // the interrupt control register
  4. #define PIC_IMR            0x21    // the interrupt mask register
  5. #define PIC_EOI            0x20    // end of interrupt command
  6.  
  7. #define TIMER_120HZ        0x26D7    // 120 hz
  8. #define TIMER_100HZ        0x2E9B    // 100 hz
  9. #define TIMER_60HZ        0x4DAE    // 60 hz
  10. #define TIMER_50HZ        0x5D37    // 50 hz
  11. #define TIMER_40HZ        0x7486    // 40 hz
  12. #define TIMER_30HZ        0x965C    // 30 hz
  13. #define TIMER_20HZ        0xE90B    // 20 hz
  14. #define TIMER_18HZ        0xFFFF    // 18.2 hz (slowest possible)
  15.  
  16. #define TIMER_CONTROL    0x43    // the 8253's control register
  17. #define TIMER_SET_BITS    0x3C    // the bit pattern that will place the timer into
  18.                                 // binary counting with counter load sequence
  19.                                 // low byte then high byte
  20.  
  21. #define TIMER_COUNTER_0    0x40    // counter 1
  22. #define TIMER_COUNTER_1 0x41    // counter 2
  23. #define TIMER_COUNTER_2    0x42    // counter 3
  24.  
  25. // M A C R O S ///////////////////////////////////////////////////////////////
  26.  
  27. #define LOW_BYTE(n) (n & 0x00FF)       // extracts the low-byte of a word
  28. #define HI_BYTE(n)  ((n>>8) & 0x00FF)  // extracts the hi-byte of a word
  29.  
  30. // E X T E R N A L S//////////////////////////////////////////////////////////
  31.  
  32. extern long starting_time, // these are used to compute the length of some event
  33.             ending_time;
  34.  
  35. // F U N C T I O N   P R O T O T Y P E S ///////////////////////////
  36.  
  37. void Timer_Program(int timer, unsigned int rate);
  38. long Timer_Query(void);