1 /*********************************************************/ 2 /* SEGA 8bit PCM */ 3 /*********************************************************/ 4 5 #ifndef __SEGAPCM_H__ 6 #define __SEGAPCM_H__ 7 8 9 /************************************************/ 10 #define BANK_256 (11) 11 #define BANK_512 (12) 12 #define BANK_12M (13) 13 #define BANK_MASK7 (0x70<<16) 14 #define BANK_MASKF (0xf0<<16) 15 #define BANK_MASKF8 (0xf8<<16) 16 17 #define SEGAPCM_MAX (16) 18 enum 19 { 20 L_PAN = 0, 21 R_PAN = 1, 22 LR_PAN = 2 23 }; 24 25 26 typedef struct segapcm 27 { 28 char writeram[0x1000]; 29 30 unsigned char gain[SEGAPCM_MAX][LR_PAN]; 31 unsigned char addr_l[SEGAPCM_MAX]; 32 unsigned char addr_h[SEGAPCM_MAX]; 33 unsigned char bank[SEGAPCM_MAX]; 34 unsigned char end_h[SEGAPCM_MAX]; 35 unsigned char delta_t[SEGAPCM_MAX]; 36 37 int vol[SEGAPCM_MAX][LR_PAN]; 38 39 unsigned int add_addr[SEGAPCM_MAX]; 40 unsigned int step[SEGAPCM_MAX]; 41 int flag[SEGAPCM_MAX]; 42 int bankshift; 43 int bankmask; 44 45 int pcmd[SEGAPCM_MAX]; 46 int pcma[SEGAPCM_MAX]; 47 } SEGAPCM; 48 49 struct SEGAPCMinterface 50 { 51 int mode; 52 int bank; 53 int region; 54 int volume; 55 }; 56 57 enum SEGAPCM_samplerate 58 { 59 SEGAPCM_SAMPLE15K, 60 SEGAPCM_SAMPLE32K 61 }; 62 63 /**************** prottype ****************/ 64 int SEGAPCM_sh_start( const struct MachineSound *msound ); 65 void SEGAPCM_sh_stop( void ); 66 void SEGAPCM_sh_update( void ); 67 68 int SEGAPCMInit( const struct MachineSound *msound, int banksize, int mode, unsigned char *inpcm, int volume ); 69 void SEGAPCMShutdown( void ); 70 void SEGAPCMResetChip( void ); 71 WRITE_HANDLER( SegaPCM_w ); 72 READ_HANDLER( SegaPCM_r ); 73 74 /************************************************/ 75 #endif 76 /**************** end of file ****************/ 77