/***************************************************************************

  ym2151.h

  Header file for software emulation for YAMAHA YM-2151 sound generator

***************************************************************************/

#ifndef YM2151_H
#define YM2151_H

typedef s16 FMSAMPLE;
typedef s32 FMSAMPLE_MIX;

typedef void (*FM_IRQHANDLER)(int irq);

void YM2151Init(int clock, int rate, FM_IRQHANDLER IRQHandler);
void YM2151Reset(void);
void YM2151Update(int p);
void YM2151WriteReg(int reg, int value);
int YM2151ReadStatus(void);

void timer_callback_2151_a(int param);
void timer_callback_2151_b(int param);

#ifdef SAVE_STATE
STATE_SAVE( ym2151 );
STATE_LOAD( ym2151 );
#endif


int get_ym2151_size(void);
int save_ym2152_to_mem(unsigned char *stor);


#endif /* YM2151_H */
