mirror of
https://github.com/holub/mame
synced 2025-05-05 05:53:05 +03:00
minor cleanups to tms5220 so savestate and member variables are in the same order, and add a missing savestate entry (nw)
This commit is contained in:
parent
c1a312eea3
commit
3f2b5a229d
@ -353,6 +353,8 @@ void tms5220_device::set_variant(int variant)
|
|||||||
|
|
||||||
void tms5220_device::register_for_save_states()
|
void tms5220_device::register_for_save_states()
|
||||||
{
|
{
|
||||||
|
save_item(NAME(m_variant));
|
||||||
|
|
||||||
save_item(NAME(m_fifo));
|
save_item(NAME(m_fifo));
|
||||||
save_item(NAME(m_fifo_head));
|
save_item(NAME(m_fifo_head));
|
||||||
save_item(NAME(m_fifo_tail));
|
save_item(NAME(m_fifo_tail));
|
||||||
@ -796,6 +798,7 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* if the new frame is a stop frame, set an interrupt and set talk status to 0 */
|
/* if the new frame is a stop frame, set an interrupt and set talk status to 0 */
|
||||||
|
/** TODO: investigate this later! **/
|
||||||
if (NEW_FRAME_STOP_FLAG == 1)
|
if (NEW_FRAME_STOP_FLAG == 1)
|
||||||
{
|
{
|
||||||
m_talk_status = m_speak_external = 0;
|
m_talk_status = m_speak_external = 0;
|
||||||
@ -1264,7 +1267,7 @@ void tms5220_device::process_command(unsigned char cmd)
|
|||||||
|
|
||||||
void tms5220_device::parse_frame()
|
void tms5220_device::parse_frame()
|
||||||
{
|
{
|
||||||
int indx, i, rep_flag;
|
int i, rep_flag;
|
||||||
|
|
||||||
// We actually don't care how many bits are left in the fifo here; the frame subpart will be processed normally, and any bits extracted 'past the end' of the fifo will be read as zeroes; the fifo being emptied will set the /BE latch which will halt speech exactly as if a stop frame had been encountered (instead of whatever partial frame was read); the same exact circuitry is used for both on the real chip, see us patent 4335277 sheet 16, gates 232a (decode stop frame) and 232b (decode /BE plus DDIS (decode disable) which is active during speak external).
|
// We actually don't care how many bits are left in the fifo here; the frame subpart will be processed normally, and any bits extracted 'past the end' of the fifo will be read as zeroes; the fifo being emptied will set the /BE latch which will halt speech exactly as if a stop frame had been encountered (instead of whatever partial frame was read); the same exact circuitry is used for both on the real chip, see us patent 4335277 sheet 16, gates 232a (decode stop frame) and 232b (decode /BE plus DDIS (decode disable) which is active during speak external).
|
||||||
|
|
||||||
@ -1272,12 +1275,12 @@ void tms5220_device::parse_frame()
|
|||||||
has a 2 bit rate preceding it, grab two bits here and store them as the rate; */
|
has a 2 bit rate preceding it, grab two bits here and store them as the rate; */
|
||||||
if ((TMS5220_HAS_RATE_CONTROL) && (m_c_variant_rate & 0x04))
|
if ((TMS5220_HAS_RATE_CONTROL) && (m_c_variant_rate & 0x04))
|
||||||
{
|
{
|
||||||
indx = extract_bits(2);
|
i = extract_bits(2);
|
||||||
#ifdef DEBUG_PARSE_FRAME_DUMP
|
#ifdef DEBUG_PARSE_FRAME_DUMP
|
||||||
printbits(indx,2);
|
printbits(i,2);
|
||||||
fprintf(stderr," ");
|
fprintf(stderr," ");
|
||||||
#endif
|
#endif
|
||||||
m_IP = reload_table[indx];
|
m_IP = reload_table[i];
|
||||||
}
|
}
|
||||||
else // non-5220C and 5220C in fixed rate mode
|
else // non-5220C and 5220C in fixed rate mode
|
||||||
m_IP = reload_table[m_c_variant_rate&0x3];
|
m_IP = reload_table[m_c_variant_rate&0x3];
|
||||||
|
@ -172,6 +172,15 @@ private:
|
|||||||
UINT8 m_data_register; /* data register, used by read command */
|
UINT8 m_data_register; /* data register, used by read command */
|
||||||
UINT8 m_RDB_flag; /* whether we should read data register or status register */
|
UINT8 m_RDB_flag; /* whether we should read data register or status register */
|
||||||
|
|
||||||
|
/* The TMS52xx has two different ways of providing output data: the
|
||||||
|
analog speaker pin (which was usually used) and the Digital I/O pin.
|
||||||
|
The internal DAC used to feed the analog pin is only 8 bits, and has the
|
||||||
|
funny clipping/clamping logic, while the digital pin gives full 10 bit
|
||||||
|
resolution of the output data.
|
||||||
|
TODO: add a way to set/reset this other than the FORCE_DIGITAL define
|
||||||
|
*/
|
||||||
|
UINT8 m_digital_select;
|
||||||
|
|
||||||
/* io_ready: page 3 of the datasheet specifies that READY will be asserted until
|
/* io_ready: page 3 of the datasheet specifies that READY will be asserted until
|
||||||
* data is available or processed by the system.
|
* data is available or processed by the system.
|
||||||
*/
|
*/
|
||||||
@ -185,15 +194,6 @@ private:
|
|||||||
UINT8 m_read_latch;
|
UINT8 m_read_latch;
|
||||||
UINT8 m_write_latch;
|
UINT8 m_write_latch;
|
||||||
|
|
||||||
/* The TMS52xx has two different ways of providing output data: the
|
|
||||||
analog speaker pin (which was usually used) and the Digital I/O pin.
|
|
||||||
The internal DAC used to feed the analog pin is only 8 bits, and has the
|
|
||||||
funny clipping/clamping logic, while the digital pin gives full 10 bit
|
|
||||||
resolution of the output data.
|
|
||||||
TODO: add a way to set/reset this other than the FORCE_DIGITAL define
|
|
||||||
*/
|
|
||||||
UINT8 m_digital_select;
|
|
||||||
|
|
||||||
sound_stream *m_stream;
|
sound_stream *m_stream;
|
||||||
int m_clock;
|
int m_clock;
|
||||||
emu_timer *m_timer_io_ready;
|
emu_timer *m_timer_io_ready;
|
||||||
|
Loading…
Reference in New Issue
Block a user