7 #define BUILD_YM3812 (HAS_YM3812)
13 #define OPL_OUTPUT_BIT 16
18 typedef unsigned char UINT8;
19 typedef unsigned short UINT16;
20 typedef unsigned int UINT32;
21 typedef signed char INT8;
22 typedef signed short INT16;
23 typedef signed int INT32;
26 #if (OPL_OUTPUT_BIT==16)
27 typedef INT16 OPLSAMPLE;
29 #if (OPL_OUTPUT_BIT==8)
30 typedef unsigned char OPLSAMPLE;
38 typedef void (*OPL_TIMERHANDLER)(
int channel,
double interval_Sec);
39 typedef void (*OPL_IRQHANDLER)(
int param,
int irq);
40 typedef void (*OPL_UPDATEHANDLER)(
int param,
int min_interval_us);
41 typedef void (*OPL_PORTHANDLER_W)(
int param,
unsigned char data);
42 typedef unsigned char (*OPL_PORTHANDLER_R)(
int param);
46 #define OPL_TYPE_WAVESEL 0x01
47 #define OPL_TYPE_ADPCM 0x02
48 #define OPL_TYPE_KEYBOARD 0x04
49 #define OPL_TYPE_IO 0x08
124 OPL_PORTHANDLER_R porthandler_r;
125 OPL_PORTHANDLER_W porthandler_w;
127 OPL_PORTHANDLER_R keyboardhandler_r;
128 OPL_PORTHANDLER_W keyboardhandler_w;
133 UINT32 FN_TABLE[1024];
144 OPL_TIMERHANDLER TimerHandler;
146 OPL_IRQHANDLER IRQHandler;
148 OPL_UPDATEHANDLER UpdateHandler;
153 #define OPL_TYPE_YM3526 (0)
154 #define OPL_TYPE_YM3812 (OPL_TYPE_WAVESEL)
155 #define OPL_TYPE_Y8950 (OPL_TYPE_ADPCM|OPL_TYPE_KEYBOARD|OPL_TYPE_IO)
157 FM_OPL *OPLCreate(
int type,
int clock,
int rate);
158 void OPLReInit(
FM_OPL *OPL,
int clock,
int rate);
159 void OPLDestroy(
FM_OPL *OPL);
160 void OPLSetTimerHandler(
FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,
int channelOffset);
161 void OPLSetIRQHandler(
FM_OPL *OPL,OPL_IRQHANDLER IRQHandler,
int param);
162 void OPLSetUpdateHandler(
FM_OPL *OPL,OPL_UPDATEHANDLER UpdateHandler,
int param);
164 void OPLSetPortHandler(
FM_OPL *OPL,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,
int param);
165 void OPLSetKeyboardHandler(
FM_OPL *OPL,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,
int param);
167 void OPLResetChip(
FM_OPL *OPL);
168 int OPLWrite(
FM_OPL *OPL,
int a,
int v);
169 unsigned char OPLRead(
FM_OPL *OPL,
int a);
170 int OPLTimerOver(
FM_OPL *OPL,
int c);
173 void YM3812UpdateOne(
FM_OPL *OPL, INT16 *buffer,
int length,
int stripe,
float volume);
175 void Y8950UpdateOne(
FM_OPL *OPL, INT16 *buffer,
int length);