tms5110.c and tms5220.c: fix missing cast for chirp/excitation values, fix a potential off-by-one for tms5110.c as well. [Lord Nightmare]

This commit is contained in:
Lord-Nightmare 2015-06-14 04:37:17 -04:00
parent d9d51741d1
commit ce595bc9fa
2 changed files with 9 additions and 13 deletions

View File

@ -497,21 +497,17 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
} }
else else
{ {
/* generate voiced samples here */ // generate voiced samples here
/* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp /* 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. * function has a chirp/peak and then a long chain of zeroes.
* The last entry of the chirp rom is at address 0b110011 (50d), the 51st sample, * 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 * and if the address reaches that point the ADDRESS incrementer is
* disabled, forcing all samples beyond 50d to be == 50d * disabled, forcing all samples beyond 51d to be == 51d
* (address 50d holds zeroes)
*/ */
if (m_pitch_count >= 51)
/*if (m_coeff->subtype & (SUBTYPE_TMS5100 | SUBTYPE_M58817))*/ current_val = (INT8)m_coeff->chirptable[51];
else /*m_pitch_count < 51*/
if (m_pitch_count > 50) current_val = (INT8)m_coeff->chirptable[m_pitch_count];
current_val = m_coeff->chirptable[50];
else
current_val = m_coeff->chirptable[m_pitch_count];
} }
/* Update LFSR *20* times every sample, like patent shows */ /* Update LFSR *20* times every sample, like patent shows */

View File

@ -920,9 +920,9 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
* disabled, forcing all samples beyond 51d to be == 51d * disabled, forcing all samples beyond 51d to be == 51d
*/ */
if (m_pitch_count >= 51) if (m_pitch_count >= 51)
m_excitation_data = m_coeff->chirptable[51]; m_excitation_data = (INT8)m_coeff->chirptable[51];
else /*m_pitch_count < 51*/ else /*m_pitch_count < 51*/
m_excitation_data = m_coeff->chirptable[m_pitch_count]; m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
} }
// Update LFSR *20* times every sample (once per T cycle), like patent shows // Update LFSR *20* times every sample (once per T cycle), like patent shows