summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/tms5110.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/tms5110.h')
-rw-r--r--src/devices/sound/tms5110.h172
1 files changed, 86 insertions, 86 deletions
diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h
index 8cba11e64f3..ac7ec87d1d4 100644
--- a/src/devices/sound/tms5110.h
+++ b/src/devices/sound/tms5110.h
@@ -46,8 +46,8 @@ class tms5110_device : public device_t,
public device_sound_interface
{
public:
- tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
template<class _Object> static devcb_base &set_m0_callback(device_t &device, _Object object) { return downcast<tms5110_device &>(device).m_m0_cb.set_callback(object); }
template<class _Object> static devcb_base &set_m1_callback(device_t &device, _Object object) { return downcast<tms5110_device &>(device).m_m1_cb.set_callback(object); }
@@ -78,27 +78,27 @@ protected:
void set_variant(int variant);
- UINT8 m_SPEN; /* set on speak command, cleared on stop command or reset command */
- UINT8 m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */
+ uint8_t m_SPEN; /* set on speak command, cleared on stop command or reset command */
+ uint8_t m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */
#define TALK_STATUS (m_SPEN|m_TALKD)
- UINT8 m_TALKD; /* TALK(TCON) value, latched every RESETL4 */
+ uint8_t m_TALKD; /* TALK(TCON) value, latched every RESETL4 */
sound_stream *m_stream;
private:
- void new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr);
- void new_int_write_addr(UINT8 addr);
- UINT8 new_int_read();
+ void new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr);
+ void new_int_write_addr(uint8_t addr);
+ uint8_t new_int_read();
void register_for_save_states();
int extract_bits(int count);
void perform_dummy_read();
- INT32 lattice_filter();
- void process(INT16 *buffer, unsigned int size);
+ int32_t lattice_filter();
+ void process(int16_t *buffer, unsigned int size);
void PDC_set(int data);
void parse_frame();
// internal state
/* table */
- optional_region_ptr<UINT8> m_table;
+ optional_region_ptr<uint8_t> m_table;
/* coefficient tables */
int m_variant; /* Variant of the 5110 - see tms5110.h */
@@ -107,17 +107,17 @@ private:
const struct tms5100_coeffs *m_coeff;
/* these contain global status bits */
- UINT8 m_PDC;
- UINT8 m_CTL_pins;
- UINT8 m_state;
+ uint8_t m_PDC;
+ uint8_t m_CTL_pins;
+ uint8_t m_state;
/* Rom interface */
- UINT32 m_address;
- UINT8 m_next_is_address;
- UINT8 m_schedule_dummy_read;
- UINT8 m_addr_bit;
+ uint32_t m_address;
+ uint8_t m_next_is_address;
+ uint8_t m_schedule_dummy_read;
+ uint8_t m_addr_bit;
/* read byte */
- UINT8 m_CTL_buffer;
+ uint8_t m_CTL_buffer;
/* callbacks */
devcb_write_line m_m0_cb; // the M0 line
@@ -132,52 +132,52 @@ private:
/* these contain data describing the current and previous voice frames */
#define OLD_FRAME_SILENCE_FLAG m_OLDE // 1 if E=0, 0 otherwise.
#define OLD_FRAME_UNVOICED_FLAG m_OLDP // 1 if P=0 (unvoiced), 0 if voiced
- UINT8 m_OLDE;
- UINT8 m_OLDP;
+ uint8_t m_OLDE;
+ uint8_t m_OLDP;
#define NEW_FRAME_STOP_FLAG (m_new_frame_energy_idx == 0xF) // 1 if this is a stop (Energy = 0xF) frame
#define NEW_FRAME_SILENCE_FLAG (m_new_frame_energy_idx == 0) // ditto as above
#define NEW_FRAME_UNVOICED_FLAG (m_new_frame_pitch_idx == 0) // ditto as above
- UINT8 m_new_frame_energy_idx;
- UINT8 m_new_frame_pitch_idx;
- UINT8 m_new_frame_k_idx[10];
+ uint8_t m_new_frame_energy_idx;
+ uint8_t m_new_frame_pitch_idx;
+ uint8_t m_new_frame_k_idx[10];
/* these are all used to contain the current state of the sound generation */
#ifndef PERFECT_INTERPOLATION_HACK
- INT16 m_current_energy;
- INT16 m_current_pitch;
- INT16 m_current_k[10];
+ int16_t m_current_energy;
+ int16_t m_current_pitch;
+ int16_t m_current_k[10];
#else
- UINT8 m_old_frame_energy_idx;
- UINT8 m_old_frame_pitch_idx;
- UINT8 m_old_frame_k_idx[10];
- UINT8 m_old_zpar;
- UINT8 m_old_uv_zpar;
-
- INT32 m_current_energy;
- INT32 m_current_pitch;
- INT32 m_current_k[10];
+ uint8_t m_old_frame_energy_idx;
+ uint8_t m_old_frame_pitch_idx;
+ uint8_t m_old_frame_k_idx[10];
+ uint8_t m_old_zpar;
+ uint8_t m_old_uv_zpar;
+
+ int32_t m_current_energy;
+ int32_t m_current_pitch;
+ int32_t m_current_k[10];
#endif
- UINT16 m_previous_energy; /* needed for lattice filter to match patent */
+ uint16_t m_previous_energy; /* needed for lattice filter to match patent */
- UINT8 m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */
- UINT8 m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */
- UINT8 m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */
+ uint8_t m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */
+ uint8_t m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */
+ uint8_t m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */
/* NOTE: the interpolation period counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */
- UINT8 m_IP; /* the current interpolation period */
- UINT8 m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */
- UINT8 m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */
- UINT8 m_zpar; /* If 1, zero ALL parameters. */
- UINT8 m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */
- UINT16 m_pitch_count; /* pitch counter; provides chirp rom address */
+ uint8_t m_IP; /* the current interpolation period */
+ uint8_t m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */
+ uint8_t m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */
+ uint8_t m_zpar; /* If 1, zero ALL parameters. */
+ uint8_t m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */
+ uint16_t m_pitch_count; /* pitch counter; provides chirp rom address */
- INT32 m_u[11];
- INT32 m_x[10];
+ int32_t m_u[11];
+ int32_t m_x[10];
- UINT16 m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */
- INT16 m_excitation_data;
+ uint16_t m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */
+ int16_t m_excitation_data;
/* The TMS51xx has two different ways of providing output data: the
analog speaker pins (which were usually used) and the Digital I/O pin.
@@ -186,12 +186,12 @@ private:
resolution of the output data.
TODO: add a way to set/reset this other than the FORCE_DIGITAL define
*/
- UINT8 m_digital_select;
+ uint8_t m_digital_select;
- INT32 m_speech_rom_bitnum;
+ int32_t m_speech_rom_bitnum;
- UINT8 m_romclk_hack_timer_started;
- UINT8 m_romclk_hack_state;
+ uint8_t m_romclk_hack_timer_started;
+ uint8_t m_romclk_hack_state;
emu_timer *m_romclk_hack_timer;
};
@@ -201,7 +201,7 @@ extern const device_type TMS5110;
class tms5100_device : public tms5110_device
{
public:
- tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -212,7 +212,7 @@ extern const device_type TMS5100;
class tmc0281_device : public tms5110_device
{
public:
- tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -223,7 +223,7 @@ extern const device_type TMC0281;
class tms5100a_device : public tms5110_device
{
public:
- tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -234,7 +234,7 @@ extern const device_type TMS5100A;
class tmc0281d_device : public tms5110_device
{
public:
- tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -245,7 +245,7 @@ extern const device_type TMC0281D;
class cd2801_device : public tms5110_device
{
public:
- cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -256,7 +256,7 @@ extern const device_type CD2801;
class cd2802_device : public tms5110_device
{
public:
- cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -267,7 +267,7 @@ extern const device_type CD2802;
class tms5110a_device : public tms5110_device
{
public:
- tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override;
@@ -278,7 +278,7 @@ extern const device_type TMS5110A;
class m58817_device : public tms5110_device
{
public:
- m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_READ8_MEMBER( status_r );
@@ -296,17 +296,17 @@ extern const device_type M58817;
class tmsprom_device : public device_t
{
public:
- tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static void set_region(device_t &device, const char *region) { downcast<tmsprom_device &>(device).m_prom.set_tag(region); }
- static void set_rom_size(device_t &device, UINT32 rom_size) { downcast<tmsprom_device &>(device).m_rom_size = rom_size; }
- static void set_pdc_bit(device_t &device, UINT8 pdc_bit) { downcast<tmsprom_device &>(device).m_pdc_bit = pdc_bit; }
- static void set_ctl1_bit(device_t &device, UINT8 ctl1_bit) { downcast<tmsprom_device &>(device).m_ctl1_bit = ctl1_bit; }
- static void set_ctl2_bit(device_t &device, UINT8 ctl2_bit) { downcast<tmsprom_device &>(device).m_ctl2_bit = ctl2_bit; }
- static void set_ctl4_bit(device_t &device, UINT8 ctl4_bit) { downcast<tmsprom_device &>(device).m_ctl4_bit = ctl4_bit; }
- static void set_ctl8_bit(device_t &device, UINT8 ctl8_bit) { downcast<tmsprom_device &>(device).m_ctl8_bit = ctl8_bit; }
- static void set_reset_bit(device_t &device, UINT8 reset_bit) { downcast<tmsprom_device &>(device).m_reset_bit = reset_bit; }
- static void set_stop_bit(device_t &device, UINT8 stop_bit) { downcast<tmsprom_device &>(device).m_stop_bit = stop_bit; }
+ static void set_rom_size(device_t &device, uint32_t rom_size) { downcast<tmsprom_device &>(device).m_rom_size = rom_size; }
+ static void set_pdc_bit(device_t &device, uint8_t pdc_bit) { downcast<tmsprom_device &>(device).m_pdc_bit = pdc_bit; }
+ static void set_ctl1_bit(device_t &device, uint8_t ctl1_bit) { downcast<tmsprom_device &>(device).m_ctl1_bit = ctl1_bit; }
+ static void set_ctl2_bit(device_t &device, uint8_t ctl2_bit) { downcast<tmsprom_device &>(device).m_ctl2_bit = ctl2_bit; }
+ static void set_ctl4_bit(device_t &device, uint8_t ctl4_bit) { downcast<tmsprom_device &>(device).m_ctl4_bit = ctl4_bit; }
+ static void set_ctl8_bit(device_t &device, uint8_t ctl8_bit) { downcast<tmsprom_device &>(device).m_ctl8_bit = ctl8_bit; }
+ static void set_reset_bit(device_t &device, uint8_t reset_bit) { downcast<tmsprom_device &>(device).m_reset_bit = reset_bit; }
+ static void set_stop_bit(device_t &device, uint8_t stop_bit) { downcast<tmsprom_device &>(device).m_stop_bit = stop_bit; }
template<class _Object> static devcb_base &set_pdc_callback(device_t &device, _Object object) { return downcast<tmsprom_device &>(device).m_pdc_cb.set_callback(object); }
template<class _Object> static devcb_base &set_ctl_callback(device_t &device, _Object object) { return downcast<tmsprom_device &>(device).m_ctl_cb.set_callback(object); }
@@ -330,26 +330,26 @@ private:
// internal state
/* Rom interface */
- UINT32 m_address;
+ uint32_t m_address;
/* ctl lines */
- UINT8 m_m0;
- UINT8 m_enable;
- UINT32 m_base_address;
- UINT8 m_bit;
+ uint8_t m_m0;
+ uint8_t m_enable;
+ uint32_t m_base_address;
+ uint8_t m_bit;
int m_prom_cnt;
- required_region_ptr<UINT8> m_rom;
- required_region_ptr<UINT8> m_prom;
- UINT32 m_rom_size; /* individual rom_size */
- UINT8 m_pdc_bit; /* bit # of pdc line */
+ required_region_ptr<uint8_t> m_rom;
+ required_region_ptr<uint8_t> m_prom;
+ uint32_t m_rom_size; /* individual rom_size */
+ uint8_t m_pdc_bit; /* bit # of pdc line */
/* virtual bit 8: constant 0, virtual bit 9:constant 1 */
- UINT8 m_ctl1_bit; /* bit # of ctl1 line */
- UINT8 m_ctl2_bit; /* bit # of ctl2 line */
- UINT8 m_ctl4_bit; /* bit # of ctl4 line */
- UINT8 m_ctl8_bit; /* bit # of ctl8 line */
- UINT8 m_reset_bit; /* bit # of rom reset */
- UINT8 m_stop_bit; /* bit # of stop */
+ uint8_t m_ctl1_bit; /* bit # of ctl1 line */
+ uint8_t m_ctl2_bit; /* bit # of ctl2 line */
+ uint8_t m_ctl4_bit; /* bit # of ctl4 line */
+ uint8_t m_ctl8_bit; /* bit # of ctl8 line */
+ uint8_t m_reset_bit; /* bit # of rom reset */
+ uint8_t m_stop_bit; /* bit # of stop */
devcb_write_line m_pdc_cb; /* tms pdc func */
devcb_write8 m_ctl_cb; /* tms ctl func */