1 /***************************************************************************
2 
3   ym2610.h
4 
5   Header file for software emulation for YAMAHA YM-2610 sound generator
6 
7 ***************************************************************************/
8 
9 #ifndef _YM2610_H_
10 #define _YM2610_H_
11 
12 #include "mvs.h"
13 #include "timer.h"
14 
15 /* for busy flag emulation , function FM_GET_TIME_NOW() should be */
16 /* return the present time in second unit with (double) value     */
17 /* in timer.c */
18 #define FM_GET_TIME_NOW() timer_get_time()
19 
20 typedef s16 FMSAMPLE;
21 typedef s32 FMSAMPLE_MIX;
22 #define TIMER_SH		16  /* 16.16 fixed point (timers calculations)    */
23 
24 typedef void (*FM_TIMERHANDLER)(int channel, int count, double stepTime);
25 //typedef void (*FM_TIMERHANDLER)(int channel, int count, Uint32 stepTime);
26 typedef void (*FM_IRQHANDLER)(int irq);
27 
28 void YM2610Init(int baseclock, int rate,
29 		void *pcmroma, int pcmsizea,
30 		void *pcmromb, int pcmsizeb,
31 		FM_TIMERHANDLER TimerHandler,
32 		FM_IRQHANDLER IRQHandler);
33 
34 void YM2610Reset(void);
35 int  YM2610Write(int addr, u8 value);
36 u8   YM2610Read(int addr);
37 int  YM2610TimerOver(int channel);
38 
39 void YM2610Update_stream(int length);
40 void YM2610Update(int p);
41 #ifdef SOUND_TEST
42 void YM2610Update_SoundTest(int p);
43 #endif
44 
45 #ifdef SAVE_STATE
46 STATE_SAVE( ym2610 );
47 STATE_LOAD( ym2610 );
48 #endif
49 
50 #endif /* _YM2610_H_ */
51