sp0256.c: [Wilbert Pol]

- Added a little delay before settling LRQ when resetting the device. Fixes MT05103.
- When reading the LRQ signal, force an update of the stream. This fixes support for
  'The Voice' in 'Turtles' for the odyssey2.
This commit is contained in:
Wilbert Pol 2013-02-20 20:06:48 +00:00
parent dfccb0a2f7
commit 7f7a6a084a
3 changed files with 24 additions and 2 deletions

View file

@ -1275,6 +1275,9 @@ READ_LINE_DEVICE_HANDLER( sp0256_lrq_r )
{
sp0256_state *sp = get_safe_token(device);
// force stream update
sp->stream->update();
return sp->lrq == 0x8000;
}
@ -1282,6 +1285,8 @@ READ_LINE_DEVICE_HANDLER( sp0256_sby_r )
{
sp0256_state *sp = get_safe_token(device);
// TODO: force stream update??
return sp->sby_line;
}
@ -1390,8 +1395,18 @@ void sp0256_device::device_config_complete()
void sp0256_device::device_start()
{
DEVICE_START_NAME( sp0256 )(this);
m_lrq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sp0256_device::set_lrq_timer_proc),this));
}
TIMER_CALLBACK_MEMBER(sp0256_device::set_lrq_timer_proc)
{
sp0256_state *sp = get_safe_token(this);
sp->lrq = 0x8000;
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
@ -1399,6 +1414,10 @@ void sp0256_device::device_start()
void sp0256_device::device_reset()
{
DEVICE_RESET_NAME( sp0256 )(this);
sp0256_state *sp = get_safe_token(this);
sp->lrq = 0;
m_lrq_timer->adjust( attotime::from_ticks( 50, m_clock ) );
}
//-------------------------------------------------

View file

@ -79,6 +79,9 @@ public:
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
TIMER_CALLBACK_MEMBER(set_lrq_timer_proc);
protected:
// device-level overrides
virtual void device_config_complete();
@ -90,6 +93,7 @@ protected:
private:
// internal state
void *m_token;
emu_timer *m_lrq_timer;
};
extern const device_type SP0256;

View file

@ -333,7 +333,7 @@ WRITE_LINE_MEMBER(odyssey2_state::the_voice_lrq_callback)
READ8_MEMBER(odyssey2_state::t0_read)
{
return sp0256_lrq_r( m_sp0256 ) ? 1 : 0;
return sp0256_lrq_r( m_sp0256 ) ? 0 : 1;
}
@ -438,7 +438,6 @@ WRITE8_MEMBER(odyssey2_state::io_write)
}
else
{
/* TODO: Reset sp0256 in this case */
m_sp0256->reset();
}
}