annotate Plugins/Input/adplug/core/fmopl.h @ 359:8df427a314a8 trunk

[svn] Adlib synthesizer (AdPlug) support.
author chainsaw
date Fri, 30 Dec 2005 16:31:39 -0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
359
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
1 #ifndef __FMOPL_H_
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
2 #define __FMOPL_H_
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
3
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
4 /* --- select emulation chips --- */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
5 #define BUILD_YM3812 (HAS_YM3812)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
6 //#define BUILD_YM3526 (HAS_YM3526)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
7 //#define BUILD_Y8950 (HAS_Y8950)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
8
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
9 /* --- system optimize --- */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
10 /* select bit size of output : 8 or 16 */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
11 #define OPL_OUTPUT_BIT 16
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
12
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
13 /* compiler dependence */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
14 #ifndef OSD_CPU_H
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
15 #define OSD_CPU_H
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
16 typedef unsigned char UINT8; /* unsigned 8bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
17 typedef unsigned short UINT16; /* unsigned 16bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
18 typedef unsigned int UINT32; /* unsigned 32bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
19 typedef signed char INT8; /* signed 8bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
20 typedef signed short INT16; /* signed 16bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
21 typedef signed int INT32; /* signed 32bit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
22 #endif
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
23
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
24 #if (OPL_OUTPUT_BIT==16)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
25 typedef INT16 OPLSAMPLE;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
26 #endif
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
27 #if (OPL_OUTPUT_BIT==8)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
28 typedef unsigned char OPLSAMPLE;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
29 #endif
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
30
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
31
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
32 #if BUILD_Y8950
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
33 #include "ymdeltat.h"
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
34 #endif
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
35
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
36 typedef void (*OPL_TIMERHANDLER)(int channel,double interval_Sec);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
37 typedef void (*OPL_IRQHANDLER)(int param,int irq);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
38 typedef void (*OPL_UPDATEHANDLER)(int param,int min_interval_us);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
39 typedef void (*OPL_PORTHANDLER_W)(int param,unsigned char data);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
40 typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
41
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
42 /* !!!!! here is private section , do not access there member direct !!!!! */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
43
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
44 #define OPL_TYPE_WAVESEL 0x01 /* waveform select */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
45 #define OPL_TYPE_ADPCM 0x02 /* DELTA-T ADPCM unit */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
46 #define OPL_TYPE_KEYBOARD 0x04 /* keyboard interface */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
47 #define OPL_TYPE_IO 0x08 /* I/O port */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
48
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
49 /* Saving is necessary for member of the 'R' mark for suspend/resume */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
50 /* ---------- OPL one of slot ---------- */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
51 typedef struct fm_opl_slot {
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
52 INT32 TL; /* total level :TL << 8 */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
53 INT32 TLL; /* adjusted now TL */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
54 UINT8 KSR; /* key scale rate :(shift down bit) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
55 INT32 *AR; /* attack rate :&AR_TABLE[AR<<2] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
56 INT32 *DR; /* decay rate :&DR_TALBE[DR<<2] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
57 INT32 SL; /* sustin level :SL_TALBE[SL] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
58 INT32 *RR; /* release rate :&DR_TABLE[RR<<2] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
59 UINT8 ksl; /* keyscale level :(shift down bits) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
60 UINT8 ksr; /* key scale rate :kcode>>KSR */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
61 UINT32 mul; /* multiple :ML_TABLE[ML] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
62 UINT32 Cnt; /* frequency count : */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
63 UINT32 Incr; /* frequency step : */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
64 /* envelope generator state */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
65 UINT8 eg_typ; /* envelope type flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
66 UINT8 evm; /* envelope phase */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
67 INT32 evc; /* envelope counter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
68 INT32 eve; /* envelope counter end point */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
69 INT32 evs; /* envelope counter step */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
70 INT32 evsa; /* envelope step for AR :AR[ksr] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
71 INT32 evsd; /* envelope step for DR :DR[ksr] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
72 INT32 evsr; /* envelope step for RR :RR[ksr] */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
73 /* LFO */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
74 UINT8 ams; /* ams flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
75 UINT8 vib; /* vibrate flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
76 /* wave selector */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
77 INT32 **wavetable;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
78 }OPL_SLOT;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
79
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
80 /* ---------- OPL one of channel ---------- */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
81 typedef struct fm_opl_channel {
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
82 OPL_SLOT SLOT[2];
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
83 UINT8 CON; /* connection type */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
84 UINT8 FB; /* feed back :(shift down bit) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
85 INT32 *connect1; /* slot1 output pointer */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
86 INT32 *connect2; /* slot2 output pointer */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
87 INT32 op1_out[2]; /* slot1 output for selfeedback */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
88 /* phase generator state */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
89 UINT32 block_fnum; /* block+fnum : */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
90 UINT8 kcode; /* key code : KeyScaleCode */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
91 UINT32 fc; /* Freq. Increment base */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
92 UINT32 ksl_base; /* KeyScaleLevel Base step */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
93 UINT8 keyon; /* key on/off flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
94 } OPL_CH;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
95
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
96 /* OPL state */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
97 typedef struct fm_opl_f {
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
98 UINT8 type; /* chip type */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
99 int clock; /* master clock (Hz) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
100 int rate; /* sampling rate (Hz) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
101 double freqbase; /* frequency base */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
102 double TimerBase; /* Timer base time (==sampling time) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
103 UINT8 address; /* address register */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
104 UINT8 status; /* status flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
105 UINT8 statusmask; /* status mask */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
106 UINT32 mode; /* Reg.08 : CSM , notesel,etc. */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
107 /* Timer */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
108 int T[2]; /* timer counter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
109 UINT8 st[2]; /* timer enable */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
110 /* FM channel slots */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
111 OPL_CH *P_CH; /* pointer of CH */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
112 int max_ch; /* maximum channel */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
113 /* Rythm sention */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
114 UINT8 rythm; /* Rythm mode , key flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
115 #if BUILD_Y8950
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
116 /* Delta-T ADPCM unit (Y8950) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
117 YM_DELTAT *deltat; /* DELTA-T ADPCM */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
118 #endif
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
119 /* Keyboard / I/O interface unit (Y8950) */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
120 UINT8 portDirection;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
121 UINT8 portLatch;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
122 OPL_PORTHANDLER_R porthandler_r;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
123 OPL_PORTHANDLER_W porthandler_w;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
124 int port_param;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
125 OPL_PORTHANDLER_R keyboardhandler_r;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
126 OPL_PORTHANDLER_W keyboardhandler_w;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
127 int keyboard_param;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
128 /* time tables */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
129 INT32 AR_TABLE[75]; /* atttack rate tables */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
130 INT32 DR_TABLE[75]; /* decay rate tables */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
131 UINT32 FN_TABLE[1024]; /* fnumber -> increment counter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
132 /* LFO */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
133 INT32 *ams_table;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
134 INT32 *vib_table;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
135 INT32 amsCnt;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
136 INT32 amsIncr;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
137 INT32 vibCnt;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
138 INT32 vibIncr;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
139 /* wave selector enable flag */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
140 UINT8 wavesel;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
141 /* external event callback handler */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
142 OPL_TIMERHANDLER TimerHandler; /* TIMER handler */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
143 int TimerParam; /* TIMER parameter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
144 OPL_IRQHANDLER IRQHandler; /* IRQ handler */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
145 int IRQParam; /* IRQ parameter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
146 OPL_UPDATEHANDLER UpdateHandler; /* stream update handler */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
147 int UpdateParam; /* stream update parameter */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
148 } FM_OPL;
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
149
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
150 /* ---------- Generic interface section ---------- */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
151 #define OPL_TYPE_YM3526 (0)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
152 #define OPL_TYPE_YM3812 (OPL_TYPE_WAVESEL)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
153 #define OPL_TYPE_Y8950 (OPL_TYPE_ADPCM|OPL_TYPE_KEYBOARD|OPL_TYPE_IO)
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
154
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
155 FM_OPL *OPLCreate(int type, int clock, int rate);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
156 void OPLDestroy(FM_OPL *OPL);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
157 void OPLSetTimerHandler(FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,int channelOffset);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
158 void OPLSetIRQHandler(FM_OPL *OPL,OPL_IRQHANDLER IRQHandler,int param);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
159 void OPLSetUpdateHandler(FM_OPL *OPL,OPL_UPDATEHANDLER UpdateHandler,int param);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
160 /* Y8950 port handlers */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
161 void OPLSetPortHandler(FM_OPL *OPL,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,int param);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
162 void OPLSetKeyboardHandler(FM_OPL *OPL,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,int param);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
163
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
164 void OPLResetChip(FM_OPL *OPL);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
165 int OPLWrite(FM_OPL *OPL,int a,int v);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
166 unsigned char OPLRead(FM_OPL *OPL,int a);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
167 int OPLTimerOver(FM_OPL *OPL,int c);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
168
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
169 /* YM3626/YM3812 local section */
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
170 void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
171
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
172 void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
173
8df427a314a8 [svn] Adlib synthesizer (AdPlug) support.
chainsaw
parents:
diff changeset
174 #endif