annotate include/timer.h @ 15:ca72d2b59bf4

Kill this stuff.. Rewriting the frontend
author darius
date Thu, 23 Apr 1998 07:22:22 +0000
parents 55420dceb8e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
1 /*
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
2 FILE : TIMER.H
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
3
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
4 DOS-based Timer Interrupt functions
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
5 Includes defines for TIMER.C and VTIMER.C
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
6 */
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
7
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
8 #ifndef VTIMER_H
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
9 #define VTIMER_H
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
10
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
11 #include "tdefs.h"
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
12
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
13 #define VT_VRSYNC 1
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
14 #define VT_CALLOLD 2
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
15
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
16 #ifdef __cplusplus
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
17 extern "C" {
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
18 #endif
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
19
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
20 // Defined in TIMER.C
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
21
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
22 void Timer_Exit(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
23 void Timer_Init(int rate, void (*handler)(void));
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
24 void Timer_SetSpeed(UWORD rate);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
25 void Timer_Start(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
26 void Timer_Stop(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
27
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
28
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
29 // Defined in VTIMER.C
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
30 void VT_Exit(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
31 void VT_Init(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
32 SWORD VT_Alloc(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
33 void VT_Free(SWORD handle);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
34 void VT_SetHandler(SWORD handle,void (*handler)(void));
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
35 void VT_SetSpeed(SWORD handle,SLONG speed);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
36 void VT_SetBPM(SWORD handle,UBYTE bpm);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
37 void VT_Start(SWORD handle);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
38 void VT_Stop(SWORD handle);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
39 void VT_Mode(UBYTE flags);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
40 void VT_V0Handler(void (*handler)(void));
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
41 void VT_V1Handler(void (*handler)(void));
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
42
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
43 #ifdef __cplusplus
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
44 }
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
45 #endif
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
46
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
47
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
48 extern volatile int framecount;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
49 void framecounter(void);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
50
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
51 // COUNTER.C defnitions
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
52 // (ObjectGraphics Library)
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
53
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
54 #define CNT_ACTIVE 16
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
55 #define CNT_VALUE 0
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
56 #define CNT_POINTER 1
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
57 #define CNT_FUNCTION 2
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
58 #define CNT_TYPE 15
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
59
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
60 typedef struct COUNTER
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
61 { struct COUNTER *next, *prev;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
62 UBYTE flags;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
63 ULONG counter;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
64 ULONG resetcount;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
65 int increment;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
66 int value;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
67 int stopvalue;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
68 } COUNTER;
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
69
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
70
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
71 // Defined in COUNTER.C
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
72 // (ObjectGraphics Library)
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
73
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
74 COUNTER *RegisterCounter(ULONG initcount, ULONG resetcount, int value, int increment, int stopvalue, UBYTE flags);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
75 void RemoveCounter(COUNTER *counter);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
76 void StartCounter(COUNTER *counter);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
77 void StopCounter(COUNTER *counter);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
78
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
79 #ifdef DJGPP
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
80 #include <dpmi.h>
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
81 typedef void (*PVI)();
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
82 #define interrupt
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
83 #define far
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
84 void _dos_setvect(unsigned vector, PVI handler);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
85 PVI _dos_getvect(unsigned vector);
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
86 #endif
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
87
55420dceb8e0 Initial entry of mikmod into the CVS tree.
darius
parents:
diff changeset
88 #endif