3
3
#ifndef __TMS5220_H__
4
4
#define __TMS5220_H__
6
void *tms5220_create(const device_config *device);
7
void tms5220_destroy(void *chip);
9
void tms5220_reset_chip(void *chip);
10
void tms5220_set_irq(void *chip, void (*func)(const device_config *, int));
12
void tms5220_data_write(void *chip, int data);
13
int tms5220_status_read(void *chip);
14
int tms5220_ready_read(void *chip);
15
int tms5220_cycles_to_ready(void *chip);
16
int tms5220_int_read(void *chip);
18
void tms5220_process(void *chip, INT16 *buffer, unsigned int size);
20
/* three variables added by R Nabet */
21
void tms5220_set_read(void *chip, int (*func)(const device_config *, int));
22
void tms5220_set_load_address(void *chip, void (*func)(const device_config *, int));
23
void tms5220_set_read_and_branch(void *chip, void (*func)(const device_config *));
8
/* clock rate = 80 * output sample rate, */
9
/* usually 640000 for 8000 Hz sample rate or */
10
/* usually 800000 for 10000 Hz sample rate. */
12
typedef struct _tms5220_interface tms5220_interface;
13
struct _tms5220_interface
28
variant_tms5220, /* TMS5220_IS_TMS5220, TMS5220_IS_TMS5220C, TMS5220_IS_TSP5220C */
29
variant_tmc0285 /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */
15
devcb_write_line irq_func; /* IRQ callback function */
17
int (*read)(const device_config *device, int count); /* speech ROM read callback */
18
void (*load_address)(const device_config *device, int data); /* speech ROM load address callback */
19
void (*read_and_branch)(const device_config *device); /* speech ROM read and branch callback */
31
typedef enum _tms5220_variant tms5220_variant;
33
void tms5220_set_variant(void *chip, tms5220_variant new_variant);
22
/* Control lines - once written to will switch interface into
23
* "true" timing behaviour.
26
/* all lines with suffix q are active low! */
28
WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w );
29
WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w );
31
WRITE8_DEVICE_HANDLER( tms5220_data_w );
32
READ8_DEVICE_HANDLER( tms5220_status_r );
34
READ_LINE_DEVICE_HANDLER( tms5220_readyq_r );
35
READ_LINE_DEVICE_HANDLER( tms5220_intq_r );
38
double tms5220_time_to_ready(const device_config *device);
40
void tms5220_set_frequency(const device_config *device, int frequency);
42
DEVICE_GET_INFO( tms5220c );
43
DEVICE_GET_INFO( tms5220 );
44
DEVICE_GET_INFO( tmc0285 );
45
DEVICE_GET_INFO( tms5200 );
47
#define SOUND_TMS5220C DEVICE_GET_INFO_NAME( tms5220c )
48
#define SOUND_TMS5220 DEVICE_GET_INFO_NAME( tms5220 )
49
#define SOUND_TMC0285 DEVICE_GET_INFO_NAME( tmc0285 )
50
#define SOUND_TMS5200 DEVICE_GET_INFO_NAME( tms5200 )
35
53
#endif /* __TMS5220_H__ */