6 #ifdef EMU2413_DLL_EXPORTS
7 #define EMU2413_API __declspec(dllexport)
8 #elif defined(EMU2413_DLL_IMPORTS)
9 #define EMU2413_API __declspec(dllimport)
18 #define PI 3.14159265358979323846
20 enum {OPLL_VRC7_TONE=0} ;
24 e_uint32 TL,FB,EG,ML,AR,DR,SL,RR,KR,KL,AM,PM,WF ;
32 e_int32 type ; /* 0 : modulator 1 : carrier */
36 e_int32 output[2] ; /* Output value of slot */
38 /* for Phase Generator (PG) */
39 e_uint16 *sintbl ; /* Wavetable */
40 e_uint32 phase ; /* Phase */
41 e_uint32 dphase ; /* Phase increment amount */
42 e_uint32 pgout ; /* output */
44 /* for Envelope Generator (EG) */
45 e_int32 fnum ; /* F-Number */
46 e_int32 block ; /* Block */
47 e_int32 volume ; /* Current volume */
48 e_int32 sustine ; /* Sustine 1 = ON, 0 = OFF */
49 e_uint32 tll ; /* Total Level + Key scale level*/
50 e_uint32 rks ; /* Key scale offset (Rks) */
51 e_int32 eg_mode ; /* Current state */
52 e_uint32 eg_phase ; /* Phase */
53 e_uint32 eg_dphase ; /* Phase increment amount */
54 e_uint32 egout ; /* output */
59 #define OPLL_MASK_CH(x) (1<<(x))
67 #ifndef EMU2413_COMPACTION
81 e_int32 slot_on_flag[6 * 2] ;
94 e_int32 patch_number[6];
95 e_int32 key_status[6] ;
98 OPLL_SLOT slot[6 * 2] ;
105 EMU2413_API OPLL *OPLL_new(e_uint32 clk, e_uint32 rate) ;
106 EMU2413_API void OPLL_delete(OPLL *) ;
109 EMU2413_API void OPLL_reset(OPLL *) ;
110 EMU2413_API void OPLL_set_rate(OPLL *opll, e_uint32 r) ;
111 EMU2413_API void OPLL_set_quality(OPLL *opll, e_uint32 q) ;
113 /* Port/Register access */
114 EMU2413_API void OPLL_writeIO(OPLL *, e_uint32 reg, e_uint32 val) ;
115 EMU2413_API void OPLL_writeReg(OPLL *, e_uint32 reg, e_uint32 val) ;
118 EMU2413_API e_int16 OPLL_calc(OPLL *) ;
121 EMU2413_API void OPLL_forceRefresh(OPLL *) ;
124 EMU2413_API e_uint32 OPLL_setMask(OPLL *, e_uint32 mask) ;
125 EMU2413_API e_uint32 OPLL_toggleMask(OPLL *, e_uint32 mask) ;
128 void moocow(OPLL* opll, e_int32 *buf, e_int32 len, int shift);