summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2015-06-14 04:37:17 -0400
committer Lord-Nightmare <Lord-Nightmare@users.noreply.github.com>2015-06-14 04:39:53 -0400
commitce595bc9fab3e97208e744d1e88b1c1d4b13391d (patch)
tree74b85f81a32016360e2c7b47a073e043620e2b7c
parentd9d51741d14db64e178d1e70fbfde65ed2942990 (diff)
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]
-rw-r--r--src/emu/sound/tms5110.c18
-rw-r--r--src/emu/sound/tms5220.c4
2 files changed, 9 insertions, 13 deletions
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 0df81b1d56d..c5861e2d7c6 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -497,21 +497,17 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
}
else
{
- /* generate voiced samples here */
+ // 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 (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
- * disabled, forcing all samples beyond 50d to be == 50d
- * (address 50d holds zeroes)
+ * disabled, forcing all samples beyond 51d to be == 51d
*/
-
- /*if (m_coeff->subtype & (SUBTYPE_TMS5100 | SUBTYPE_M58817))*/
-
- if (m_pitch_count > 50)
- current_val = m_coeff->chirptable[50];
- else
- current_val = m_coeff->chirptable[m_pitch_count];
+ if (m_pitch_count >= 51)
+ current_val = (INT8)m_coeff->chirptable[51];
+ else /*m_pitch_count < 51*/
+ current_val = (INT8)m_coeff->chirptable[m_pitch_count];
}
/* Update LFSR *20* times every sample, like patent shows */
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index 004925d031f..d71344a01e8 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -920,9 +920,9 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
* disabled, forcing all samples beyond 51d to be == 51d
*/
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*/
- 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