26 #ifndef AUDIO_SOFTSYNTH_OPL_MAME_H 27 #define AUDIO_SOFTSYNTH_OPL_MAME_H 29 #include "common/scummsys.h" 30 #include "common/random.h" 32 #include "audio/fmopl.h" 38 FMOPL_ENV_BITS_HQ = 16,
39 FMOPL_ENV_BITS_MQ = 8,
40 FMOPL_ENV_BITS_LQ = 8,
41 FMOPL_EG_ENT_HQ = 4096,
42 FMOPL_EG_ENT_MQ = 1024,
47 typedef void (*OPL_TIMERHANDLER)(
int channel,
double interval_Sec);
48 typedef void (*OPL_IRQHANDLER)(
int param,
int irq);
49 typedef void (*OPL_UPDATEHANDLER)(
int param,
int min_interval_us);
51 #define OPL_TYPE_WAVESEL 0x01 143 OPL_TIMERHANDLER TimerHandler;
145 OPL_IRQHANDLER IRQHandler;
147 OPL_UPDATEHANDLER UpdateHandler;
154 #define OPL_TYPE_YM3526 (0) 155 #define OPL_TYPE_YM3812 (OPL_TYPE_WAVESEL) 157 void OPLBuildTables(
int ENV_BITS_PARAM,
int EG_ENT_PARAM);
159 FM_OPL *OPLCreate(
int type,
int clock,
int rate);
161 void OPLSetTimerHandler(
FM_OPL *OPL, OPL_TIMERHANDLER TimerHandler,
int channelOffset);
162 void OPLSetIRQHandler(
FM_OPL *OPL, OPL_IRQHANDLER IRQHandler,
int param);
163 void OPLSetUpdateHandler(
FM_OPL *OPL, OPL_UPDATEHANDLER UpdateHandler,
int param);
165 void OPLResetChip(
FM_OPL *OPL);
166 int OPLWrite(
FM_OPL *OPL,
int a,
int v);
167 unsigned char OPLRead(
FM_OPL *OPL,
int a);
168 int OPLTimerOver(
FM_OPL *OPL,
int c);
169 void OPLWriteReg(
FM_OPL *OPL,
int r,
int v);
170 void YM3812UpdateOne(
FM_OPL *OPL, int16 *buffer,
int length);
173 FM_OPL *makeAdLibOPL(
int rate);
186 void write(
int a,
int v);
188 void writeReg(
int r,
int v);
193 void generateSamples(int16 *buffer,
int length);
bool isStereo() const
Definition: mame.h:190