TMS5110: Purge process() of gotos to hopefully make the compiler's optimizer happier. [Lord Nightmare]

This commit is contained in:
Lord-Nightmare 2015-08-28 03:43:30 -04:00
parent 66b36b336f
commit 017ebde24e

View File

@ -350,15 +350,11 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
int i, bitout;
INT32 this_sample;
/* if we're not speaking, fill with nothingness */
if (!m_TALKD)
goto empty;
render:
/* loop until the buffer is full or we've stopped speaking */
while ((size > 0) && m_TALKD)
while (size > 0)
{
if(m_TALKD) // speaking
{
/* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
* (In reality, the frame was really loaded incrementally during the entire IP=0
* PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
@ -601,16 +597,8 @@ render:
m_pitch_count++;
if ((m_pitch_count >= m_current_pitch)||(m_pitch_zero == 1)) m_pitch_count = 0;
m_pitch_count &= 0x1FF;
buf_count++;
size--;
}
empty:
#ifdef VERBOSE
fprintf(stderr,"empty called with size of %d; IP=%d, PC=%d, subcycle=%d, m_SPEN=%d, m_TALK=%d, m_TALKD=%d\n", size, m_IP, m_PC, m_subcycle, m_SPEN, m_TALK, m_TALKD);
#endif
while (size > 0)
else // m_TALKD == 0
{
m_subcycle++;
if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
@ -624,7 +612,6 @@ empty:
m_PC = 0;
m_IP++;
m_IP&=0x7;
if (m_TALKD) goto render;
}
else if (m_subcycle == 3)
{
@ -632,6 +619,7 @@ empty:
m_PC++;
}
buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
}
buf_count++;
size--;
}