mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
add some notes about the tms51xx interpolator bug (nw)
This commit is contained in:
parent
2f45c4203a
commit
f22a1892c6
@ -387,14 +387,17 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
|
||||
}
|
||||
|
||||
/* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
|
||||
Interpolation inhibit cases:
|
||||
* Interpolation inhibit cases:
|
||||
* Old frame was voiced, new is unvoiced
|
||||
* Old frame was silence/zero energy, new has nonzero energy
|
||||
* Old frame was unvoiced, new is voiced (note this is the case on the patent but may not be correct on the real final chip)
|
||||
* Old frame was silence/zero energy, new has non-zero energy
|
||||
* Old frame was unvoiced, new is voiced
|
||||
* Old frame was unvoiced, new frame is silence/zero energy (non-existent on tms51xx rev D and F (present and working on tms52xx, present but buggy on tms51xx rev A and B))
|
||||
*/
|
||||
if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
|
||||
|| ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
|
||||
|| ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
|
||||
//|| ((m_inhibit == 1) && (OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) ) //TMS51xx INTERP BUG1
|
||||
//|| ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
|
||||
m_inhibit = 1;
|
||||
else // normal frame, normal interpolation
|
||||
m_inhibit = 0;
|
||||
@ -558,14 +561,15 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
|
||||
* The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
|
||||
* and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
|
||||
* which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
|
||||
* (and hence INHIBIT itself 2 t-cycles later).
|
||||
* According to testing the pitch zeroing lasts approximately 2 samples.
|
||||
* We set the zeroing latch here, and unset it on PC=1 in the generator.
|
||||
*/
|
||||
* (and hence INHIBIT itself 2 t-cycles later).
|
||||
* According to testing the pitch zeroing lasts approximately 2 samples.
|
||||
* We set the zeroing latch here, and unset it on PC=1 in the generator.
|
||||
*/
|
||||
if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
|
||||
if (m_IP == 7) // RESETL4
|
||||
{
|
||||
// Latch OLDE and OLDP
|
||||
//if (OLD_FRAME_SILENCE_FLAG) m_uv_zpar = 0; // TMS51xx INTERP BUG2
|
||||
OLD_FRAME_SILENCE_FLAG = NEW_FRAME_SILENCE_FLAG; // m_OLDE
|
||||
OLD_FRAME_UNVOICED_FLAG = NEW_FRAME_UNVOICED_FLAG; // m_OLDP
|
||||
/* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
|
||||
|
@ -781,15 +781,16 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
|
||||
}
|
||||
|
||||
/* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
|
||||
Interpolation inhibit cases:
|
||||
* Old frame was voiced, new is unvoiced
|
||||
* Old frame was silence/zero energy, new has nonzero energy
|
||||
* Old frame was unvoiced, new is voiced
|
||||
* Old frame was unvoiced, new frame is silence/zero energy (unique to tms52xx)
|
||||
*/
|
||||
* Interpolation inhibit cases:
|
||||
* Old frame was voiced, new is unvoiced
|
||||
* Old frame was silence/zero energy, new has non-zero energy
|
||||
* Old frame was unvoiced, new is voiced
|
||||
* Old frame was unvoiced, new frame is silence/zero energy (non-existent on tms51xx rev D and F (present and working on tms52xx, present but buggy on tms51xx rev A and B))
|
||||
*/
|
||||
if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
|
||||
|| ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
|
||||
|| ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0))
|
||||
//|| ((m_inhibit == 1) && (OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) ) //TMS51xx INTERP BUG1
|
||||
|| ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
|
||||
m_inhibit = 1;
|
||||
else // normal frame, normal interpolation
|
||||
@ -888,11 +889,11 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
|
||||
{
|
||||
// generate voiced samples here
|
||||
/* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
|
||||
* function has a chirp/peak and then a long chain of zeroes.
|
||||
* The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
|
||||
* and if the address reaches that point the ADDRESS incrementer is
|
||||
* disabled, forcing all samples beyond 51d to be == 51d
|
||||
*/
|
||||
* function has a chirp/peak and then a long chain of zeroes.
|
||||
* The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
|
||||
* and if the address reaches that point the ADDRESS incrementer is
|
||||
* disabled, forcing all samples beyond 51d to be == 51d
|
||||
*/
|
||||
if (m_pitch_count >= 51)
|
||||
m_excitation_data = (INT8)m_coeff->chirptable[51];
|
||||
else /*m_pitch_count < 51*/
|
||||
@ -950,18 +951,19 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
|
||||
if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
|
||||
{
|
||||
/* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
|
||||
* if INHIBIT was true during the most recent frame transition.
|
||||
* The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
|
||||
* and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
|
||||
* which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
|
||||
* (and hence INHIBIT itself 2 t-cycles later).
|
||||
* According to testing the pitch zeroing lasts approximately 2 samples.
|
||||
* We set the zeroing latch here, and unset it on PC=1 in the generator.
|
||||
*/
|
||||
* if INHIBIT was true during the most recent frame transition.
|
||||
* The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
|
||||
* and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
|
||||
* which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
|
||||
* (and hence INHIBIT itself 2 t-cycles later).
|
||||
* According to testing the pitch zeroing lasts approximately 2 samples.
|
||||
* We set the zeroing latch here, and unset it on PC=1 in the generator.
|
||||
*/
|
||||
if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
|
||||
if (m_IP == 7) // RESETL4
|
||||
{
|
||||
// Latch OLDE and OLDP
|
||||
//if (OLD_FRAME_SILENCE_FLAG) m_uv_zpar = 0; // TMS51xx INTERP BUG2
|
||||
OLD_FRAME_SILENCE_FLAG = NEW_FRAME_SILENCE_FLAG; // m_OLDE
|
||||
OLD_FRAME_UNVOICED_FLAG = NEW_FRAME_UNVOICED_FLAG; // m_OLDP
|
||||
/* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
|
||||
|
Loading…
Reference in New Issue
Block a user