128 lines
2.3 KiB
C
Raw Permalink Normal View History

2016-03-06 11:11:17 +00:00
/**
* @file nevent.h
* @brief Interface of the event
*/
#pragma once
enum
{
NEVENT_MAXCLOCK = 0x400000,
};
/**
* NEvent ID
*/
enum tagNEventId
{
NEVENT_FLAMES = 0,
NEVENT_ITIMER = 1,
NEVENT_BEEP = 2,
NEVENT_RS232C = 3,
NEVENT_MUSICGEN = 4,
NEVENT_FMTIMERA = 5,
NEVENT_FMTIMERB = 6,
NEVENT_FMTIMER2A = 7,
NEVENT_FMTIMER2B = 8,
// NEVENT_FMTIMER3A = 9,
// NEVENT_FMTIMER3B = 10,
// NEVENT_FMTIMER4A = 11,
// NEVENT_FMTIMER4B = 12,
NEVENT_MOUSE = 13,
NEVENT_KEYBOARD = 14,
NEVENT_MIDIWAIT = 15,
NEVENT_MIDIINT = 16,
NEVENT_PICMASK = 17,
NEVENT_S98TIMER = 18,
NEVENT_CS4231 = 19,
NEVENT_GDCSLAVE = 20,
NEVENT_FDBIOSBUSY = 21,
NEVENT_FDCINT = 22,
NEVENT_PC9861CH1 = 23,
NEVENT_PC9861CH2 = 24,
NEVENT_86PCM = 25,
NEVENT_SASIIO = 26,
NEVENT_SCSIIO = 27,
/* ---- */
NEVENT_MAXEVENTS = 32
};
typedef enum tagNEventId NEVENTID;
enum
{
NEVENT_ENABLE = 0x0001,
NEVENT_SETEVENT = 0x0002,
NEVENT_WAIT = 0x0004
};
/**
* event position
*/
enum tagNEventPosition
{
NEVENT_RELATIVE = 0, /*!< relative */
NEVENT_ABSOLUTE = 1 /*!< absolute */
};
typedef enum tagNEventPosition NEVENTPOSITION; /*!< the defines of position */
struct _neventitem;
typedef struct _neventitem _NEVENTITEM;
typedef struct _neventitem *NEVENTITEM;
typedef void (*NEVENTCB)(NEVENTITEM item);
struct _neventitem
{
SINT32 clock;
UINT32 flag;
NEVENTCB proc;
INTPTR userData;
};
typedef struct {
UINT readyevents;
UINT waitevents;
NEVENTID level[NEVENT_MAXEVENTS];
NEVENTID waitevent[NEVENT_MAXEVENTS];
_NEVENTITEM item[NEVENT_MAXEVENTS];
} _NEVENT, *NEVENT;
#ifdef __cplusplus
extern "C" {
#endif
extern _NEVENT g_nevent;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void nevent_allreset(void);
// <20>ŒZ<C592>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>̃Z<CC83>b<EFBFBD>g
void nevent_get1stevent(void);
// <20><><EFBFBD>Ԃ<EFBFBD><D482>i<EFBFBD>߂<EFBFBD>
void nevent_progress(void);
// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>̎<EFBFBD><CC8E>s
void nevent_execule(void);
// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>̒lj<CC92>
void nevent_set(NEVENTID id, SINT32 eventclock, NEVENTCB proc, NEVENTPOSITION absolute);
void nevent_setbyms(NEVENTID id, SINT32 ms, NEVENTCB proc, NEVENTPOSITION absolute);
// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>̍폜
void nevent_reset(NEVENTID id);
void nevent_waitreset(NEVENTID id);
// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD>̓<EFBFBD><CC93><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԏ擾
BOOL nevent_iswork(NEVENTID id);
// <20>C<EFBFBD>x<EFBFBD><78><EFBFBD>g<EFBFBD><67><EFBFBD>s<EFBFBD>܂ł̃N<CC83><4E><EFBFBD>b<EFBFBD>N<EFBFBD><4E><EFBFBD>̎擾
SINT32 nevent_getremain(NEVENTID id);
// NEVENT<4E>̋<EFBFBD><CC8B><EFBFBD><EFBFBD>E<EFBFBD>o
void nevent_forceexit(void);
#ifdef __cplusplus
}
#endif