コード例 #1
0
ファイル: dectalk.c プロジェクト: Ilgrim/MAMEHub
void dectalk_state::dectalk_clear_all_fifos(  )
{
	// clear fifos (TODO: memset would work better here...)
	int i;
	for (i=0; i<16; i++) m_outfifo[i] = 0;
	for (i=0; i<32; i++) m_infifo[i] = 0;
	m_outfifo_tail_ptr = m_outfifo_head_ptr = 0;
	m_infifo_tail_ptr = m_infifo_head_ptr = 0;
	dectalk_outfifo_check();
}
コード例 #2
0
ファイル: dectalk.c プロジェクト: clobber/UME
static void dectalk_clear_all_fifos( running_machine &machine )
{
	dectalk_state *state = machine.driver_data<dectalk_state>();
	// clear fifos (TODO: memset would work better here...)
	int i;
	for (i=0; i<16; i++) state->m_outfifo[i] = 0;
	for (i=0; i<32; i++) state->m_infifo[i] = 0;
	state->m_outfifo_tail_ptr = state->m_outfifo_head_ptr = 0;
	state->m_infifo_tail_ptr = state->m_infifo_head_ptr = 0;
	dectalk_outfifo_check(machine);
}
コード例 #3
0
ファイル: dectalk.c プロジェクト: Ilgrim/MAMEHub
// read the output fifo and set the interrupt line active on the dsp
UINT16 dectalk_state::dectalk_outfifo_r (  )
{
	UINT16 data = 0xFFFF;
	data = m_outfifo[m_outfifo_tail_ptr];
	// if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do.
	//if (m_outfifo_tail_ptr != m_outfifo_head_ptr) m_outfifo_tail_ptr++; // technically correct but doesn't match sn74ls224 sheet
	if (((m_outfifo_head_ptr-1)&0xF) != m_outfifo_tail_ptr) m_outfifo_tail_ptr++; // matches sn74ls224 sheet
	m_outfifo_tail_ptr&=0xF;
	dectalk_outfifo_check();
	return ((data&0xfff0)^0x8000); // yes this is right, top bit is inverted and bottom 4 are ignored
	//return data; // not right but want to get it working first
}
コード例 #4
0
ファイル: dectalk.c プロジェクト: clobber/UME
// read the output fifo and set the interrupt line active on the dsp
static UINT16 dectalk_outfifo_r ( running_machine &machine )
{
	dectalk_state *state = machine.driver_data<dectalk_state>();
	UINT16 data = 0xFFFF;
	data = state->m_outfifo[state->m_outfifo_tail_ptr];
	// if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do.
	//if (state->m_outfifo_tail_ptr != state->m_outfifo_head_ptr) state->m_outfifo_tail_ptr++; // technically correct but doesn't match sn74ls224 sheet
	if (((state->m_outfifo_head_ptr-1)&0xF) != state->m_outfifo_tail_ptr) state->m_outfifo_tail_ptr++; // matches sn74ls224 sheet
	state->m_outfifo_tail_ptr&=0xF;
	dectalk_outfifo_check(machine);
	return ((data&0xfff0)^0x8000); // yes this is right, top bit is inverted and bottom 4 are ignored
	//return data; // not right but want to get it working first
}
コード例 #5
0
ファイル: dectalk.cpp プロジェクト: crazii/mameui
// read the output fifo and set the interrupt line active on the dsp
uint16_t dectalk_state::dectalk_outfifo_r (  )
{
	uint16_t data = 0xFFFF;
#ifdef USE_LOOSE_TIMING_OUTPUT
	// if outfifo count is less than two, boost the interleave to prevent running the fifo out
	if (m_outfifo_count < 2)
	machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(25));
#endif
#ifdef VERBOSE
	if (m_outfifo_count == 0) logerror("output fifo is EMPTY! repeating previous sample!\n");
#endif
	data = m_outfifo[m_outfifo_tail_ptr];
	// if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do.
	if (m_outfifo_count > 0)
	{
		m_outfifo_tail_ptr++;
		m_outfifo_count--;
	}
	m_outfifo_tail_ptr&=0xF;
	dectalk_outfifo_check();
	return ((data&0xfff0)^0x8000); // yes this is right, top bit is inverted and bottom 4 are ignored
	//return data; // not right but want to get it working first
}