home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
SLOWRUNS.ZIP
/
SLOWSRC.ZIP
/
MAGIC8.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-11
|
1KB
|
38 lines
#define TIME_KEEPER_INT 0x1C // gets control of the timer
#define PIC_ICR 0x20 // the interrupt control register
#define PIC_IMR 0x21 // the interrupt mask register
#define PIC_EOI 0x20 // end of interrupt command
#define TIMER_120HZ 0x26D7 // 120 hz
#define TIMER_100HZ 0x2E9B // 100 hz
#define TIMER_60HZ 0x4DAE // 60 hz
#define TIMER_50HZ 0x5D37 // 50 hz
#define TIMER_40HZ 0x7486 // 40 hz
#define TIMER_30HZ 0x965C // 30 hz
#define TIMER_20HZ 0xE90B // 20 hz
#define TIMER_18HZ 0xFFFF // 18.2 hz (slowest possible)
#define TIMER_CONTROL 0x43 // the 8253's control register
#define TIMER_SET_BITS 0x3C // the bit pattern that will place the timer into
// binary counting with counter load sequence
// low byte then high byte
#define TIMER_COUNTER_0 0x40 // counter 1
#define TIMER_COUNTER_1 0x41 // counter 2
#define TIMER_COUNTER_2 0x42 // counter 3
// M A C R O S ///////////////////////////////////////////////////////////////
#define LOW_BYTE(n) (n & 0x00FF) // extracts the low-byte of a word
#define HI_BYTE(n) ((n>>8) & 0x00FF) // extracts the hi-byte of a word
// E X T E R N A L S//////////////////////////////////////////////////////////
extern long starting_time, // these are used to compute the length of some event
ending_time;
// F U N C T I O N P R O T O T Y P E S ///////////////////////////
void Timer_Program(int timer, unsigned int rate);
long Timer_Query(void);