mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
mos6526: WIP. (nw)
This commit is contained in:
parent
7a1ecf48c9
commit
c1a1912dde
@ -778,15 +778,8 @@ void mos6526_device::device_reset()
|
|||||||
|
|
||||||
void mos6526_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
void mos6526_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||||
{
|
{
|
||||||
if (!m_tod_stopped)
|
tod_w(1);
|
||||||
{
|
tod_w(0);
|
||||||
clock_tod();
|
|
||||||
|
|
||||||
if (m_tod == m_alarm)
|
|
||||||
{
|
|
||||||
m_icr |= ICR_ALARM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1099,46 +1092,6 @@ WRITE8_MEMBER( mos8520_device::write )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// pa_r - port A read
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
UINT8 mos6526_device::pa_r()
|
|
||||||
{
|
|
||||||
return m_pa;
|
|
||||||
}
|
|
||||||
|
|
||||||
READ8_MEMBER( mos6526_device::pa_r )
|
|
||||||
{
|
|
||||||
return pa_r();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// pb_r - port B read
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
UINT8 mos6526_device::pb_r()
|
|
||||||
{
|
|
||||||
return m_pb;
|
|
||||||
}
|
|
||||||
|
|
||||||
READ8_MEMBER( mos6526_device::pb_r )
|
|
||||||
{
|
|
||||||
return pb_r();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// sp_r - serial port read
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
READ_LINE_MEMBER( mos6526_device::sp_r )
|
|
||||||
{
|
|
||||||
return m_sp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// sp_w - serial port write
|
// sp_w - serial port write
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1149,16 +1102,6 @@ WRITE_LINE_MEMBER( mos6526_device::sp_w )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// cnt_r - serial counter read
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
READ_LINE_MEMBER( mos6526_device::cnt_r )
|
|
||||||
{
|
|
||||||
return m_cnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// cnt_w - serial counter write
|
// cnt_w - serial counter write
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1190,3 +1133,21 @@ WRITE_LINE_MEMBER( mos6526_device::flag_w )
|
|||||||
|
|
||||||
m_flag = state;
|
m_flag = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// tod_w - time-of-day clock write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER( mos6526_device::tod_w )
|
||||||
|
{
|
||||||
|
if (state && !m_tod_stopped)
|
||||||
|
{
|
||||||
|
clock_tod();
|
||||||
|
|
||||||
|
if (m_tod == m_alarm)
|
||||||
|
{
|
||||||
|
m_icr |= ICR_ALARM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -128,16 +128,18 @@ public:
|
|||||||
DECLARE_READ8_MEMBER( read );
|
DECLARE_READ8_MEMBER( read );
|
||||||
DECLARE_WRITE8_MEMBER( write );
|
DECLARE_WRITE8_MEMBER( write );
|
||||||
|
|
||||||
UINT8 pa_r();
|
UINT8 pa_r() { return m_pa; }
|
||||||
DECLARE_READ8_MEMBER( pa_r );
|
DECLARE_READ8_MEMBER( pa_r ) { return pa_r(); }
|
||||||
UINT8 pb_r();
|
UINT8 pb_r() { return m_pb; }
|
||||||
DECLARE_READ8_MEMBER( pb_r );
|
DECLARE_READ8_MEMBER( pb_r ) { return pb_r(); }
|
||||||
|
|
||||||
DECLARE_READ_LINE_MEMBER( sp_r );
|
DECLARE_READ_LINE_MEMBER( sp_r ) { return m_sp; }
|
||||||
DECLARE_WRITE_LINE_MEMBER( sp_w );
|
DECLARE_WRITE_LINE_MEMBER( sp_w );
|
||||||
DECLARE_READ_LINE_MEMBER( cnt_r );
|
DECLARE_READ_LINE_MEMBER( cnt_r ) { return m_cnt; }
|
||||||
DECLARE_WRITE_LINE_MEMBER( cnt_w );
|
DECLARE_WRITE_LINE_MEMBER( cnt_w );
|
||||||
DECLARE_WRITE_LINE_MEMBER( flag_w );
|
DECLARE_WRITE_LINE_MEMBER( flag_w );
|
||||||
|
DECLARE_READ_LINE_MEMBER( irq_r ) { return m_irq; }
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( tod_w );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum
|
enum
|
||||||
|
Loading…
Reference in New Issue
Block a user