-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnevent.h
81 lines (58 loc) · 1.43 KB
/
nevent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
enum {
NEVENT_MAXEVENTS = 16,
NEVENT_MAXCLOCK = 0x400000,
NEVENT_FRAMES = 0,
NEVENT_RTC = 1,
NEVENT_FDC = 2,
NEVENT_CTC0 = 3,
NEVENT_CTC1 = 4,
NEVENT_CTC2 = 5,
NEVENT_SUBCPU = 6,
NEVENT_RELATIVE = 0,
NEVENT_ABSOLUTE = 1
};
struct _neventitem;
typedef struct _neventitem _NEVENTITEM;
typedef struct _neventitem *NEVENTITEM;
typedef void (*NEVENTCB)(UINT id);
#define NEVENTITEM_NONE ((NEVENTITEM)-1)
#define NEVENTITEM_TERM ((NEVENTITEM)0)
struct _neventitem {
NEVENTITEM next;
SINT32 clock;
SINT32 baseclock;
NEVENTCB proc;
};
typedef struct {
_NEVENTITEM item[NEVENT_MAXEVENTS];
NEVENTITEM first;
} _NEVENT, *NEVENT;
#ifdef __cplusplus
extern "C" {
#endif
extern _NEVENT nevent;
/* 初期化 */
void nevent_allreset(void);
/* 最短イベントのセット */
void nevent_get1stevent(void);
/* 時間を進める */
void nevent_progress(void);
/* イベントの実行 */
void nevent_execule(void);
/* イベントの追加 */
void nevent_set(UINT id, SINT32 eventclock, NEVENTCB proc, BRESULT absolute);
void nevent_repeat(UINT id);
void nevent_setbyms(UINT id, SINT32 ms, NEVENTCB proc, BRESULT absolute);
/* イベントの削除 */
void nevent_reset(UINT id);
/* イベントの動作状態取得 */
BRESULT nevent_iswork(UINT id);
/* 実行したクロック数の取得 */
SINT32 nevent_getwork(UINT id);
/* イベント実行までのクロック数の取得 */
SINT32 nevent_getremain(UINT id);
/* NEVENTの強制脱出 */
void nevent_forceexit(void);
#ifdef __cplusplus
}
#endif