i8214: devcb2. (nw)
This commit is contained in:
parent
ea77cb9af7
commit
1d53738dea
@ -44,11 +44,11 @@ inline void i8214_device::trigger_interrupt(int level)
|
|||||||
m_int_dis = 1;
|
m_int_dis = 1;
|
||||||
|
|
||||||
// disable next level group
|
// disable next level group
|
||||||
m_out_enlg_func(0);
|
m_write_enlg(0);
|
||||||
|
|
||||||
// toggle interrupt line
|
// toggle interrupt line
|
||||||
m_out_int_func(ASSERT_LINE);
|
m_write_irq(ASSERT_LINE);
|
||||||
m_out_int_func(CLEAR_LINE);
|
m_write_irq(CLEAR_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,34 +91,14 @@ inline void i8214_device::check_interrupt()
|
|||||||
// i8214_device - constructor
|
// i8214_device - constructor
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
i8214_device::i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
i8214_device::i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
: device_t(mconfig, I8214, "I8214", tag, owner, clock, "i8214", __FILE__)
|
device_t(mconfig, I8214, "I8214", tag, owner, clock, "i8214", __FILE__),
|
||||||
|
m_write_irq(*this),
|
||||||
|
m_write_enlg(*this)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
|
||||||
// device_config_complete - perform any
|
|
||||||
// operations now that the configuration is
|
|
||||||
// complete
|
|
||||||
//-------------------------------------------------
|
|
||||||
|
|
||||||
void i8214_device::device_config_complete()
|
|
||||||
{
|
|
||||||
// inherit a copy of the static data
|
|
||||||
const i8214_interface *intf = reinterpret_cast<const i8214_interface *>(static_config());
|
|
||||||
if (intf != NULL)
|
|
||||||
*static_cast<i8214_interface *>(this) = *intf;
|
|
||||||
|
|
||||||
// or initialize to defaults if none provided
|
|
||||||
else
|
|
||||||
{
|
|
||||||
memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
|
|
||||||
memset(&m_out_enlg_cb, 0, sizeof(m_out_enlg_cb));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_start - device-specific startup
|
// device_start - device-specific startup
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -126,8 +106,8 @@ void i8214_device::device_config_complete()
|
|||||||
void i8214_device::device_start()
|
void i8214_device::device_start()
|
||||||
{
|
{
|
||||||
// resolve callbacks
|
// resolve callbacks
|
||||||
m_out_int_func.resolve(m_out_int_cb, *this);
|
m_write_irq.resolve_safe();
|
||||||
m_out_enlg_func.resolve(m_out_enlg_cb, *this);
|
m_write_enlg.resolve_safe();
|
||||||
|
|
||||||
m_int_dis = 0;
|
m_int_dis = 0;
|
||||||
|
|
||||||
@ -170,7 +150,7 @@ void i8214_device::b_w(UINT8 data)
|
|||||||
m_int_dis = 0;
|
m_int_dis = 0;
|
||||||
|
|
||||||
// enable next level group
|
// enable next level group
|
||||||
m_out_enlg_func(1);
|
m_write_enlg(1);
|
||||||
|
|
||||||
check_interrupt();
|
check_interrupt();
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,11 @@
|
|||||||
// INTERFACE CONFIGURATION MACROS
|
// INTERFACE CONFIGURATION MACROS
|
||||||
///*************************************************************************
|
///*************************************************************************
|
||||||
|
|
||||||
#define MCFG_I8214_ADD(_tag, _clock, _config) \
|
#define MCFG_I8214_IRQ_CALLBACK(_write) \
|
||||||
MCFG_DEVICE_ADD(_tag, I8214, _clock) \
|
devcb = &i8214_device::set_irq_wr_callback(*device, DEVCB2_##_write);
|
||||||
MCFG_DEVICE_CONFIG(_config)
|
|
||||||
|
|
||||||
|
#define MCFG_I8214_ENLG_CALLBACK(_write) \
|
||||||
#define I8214_INTERFACE(name) \
|
devcb = &i8214_device::set_enlg_wr_callback(*device, DEVCB2_##_write);
|
||||||
const i8214_interface (name) =
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -51,23 +49,17 @@
|
|||||||
// TYPE DEFINITIONS
|
// TYPE DEFINITIONS
|
||||||
///*************************************************************************
|
///*************************************************************************
|
||||||
|
|
||||||
// ======================> i8214_interface
|
|
||||||
|
|
||||||
struct i8214_interface
|
|
||||||
{
|
|
||||||
devcb_write_line m_out_int_cb;
|
|
||||||
devcb_write_line m_out_enlg_cb;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// ======================> i8214_device
|
// ======================> i8214_device
|
||||||
|
|
||||||
class i8214_device : public device_t, public i8214_interface
|
class i8214_device : public device_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
|
|
||||||
|
template<class _Object> static devcb2_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<i8214_device &>(device).m_write_irq.set_callback(object); }
|
||||||
|
template<class _Object> static devcb2_base &set_enlg_wr_callback(device_t &device, _Object object) { return downcast<i8214_device &>(device).m_write_enlg.set_callback(object); }
|
||||||
|
|
||||||
DECLARE_WRITE_LINE_MEMBER( sgs_w );
|
DECLARE_WRITE_LINE_MEMBER( sgs_w );
|
||||||
DECLARE_WRITE_LINE_MEMBER( etlg_w );
|
DECLARE_WRITE_LINE_MEMBER( etlg_w );
|
||||||
DECLARE_WRITE_LINE_MEMBER( inte_w );
|
DECLARE_WRITE_LINE_MEMBER( inte_w );
|
||||||
@ -78,15 +70,14 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_config_complete();
|
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline void trigger_interrupt(int level);
|
inline void trigger_interrupt(int level);
|
||||||
inline void check_interrupt();
|
inline void check_interrupt();
|
||||||
|
|
||||||
devcb_resolved_write_line m_out_int_func;
|
devcb2_write_line m_write_irq;
|
||||||
devcb_resolved_write_line m_out_enlg_func;
|
devcb2_write_line m_write_enlg;
|
||||||
|
|
||||||
int m_inte; // interrupt enable
|
int m_inte; // interrupt enable
|
||||||
int m_int_dis; // interrupt disable flip-flop
|
int m_int_dis; // interrupt disable flip-flop
|
||||||
|
@ -666,12 +666,6 @@ WRITE_LINE_MEMBER(v1050_state::pic_int_w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static I8214_INTERFACE( pic_intf )
|
|
||||||
{
|
|
||||||
DEVCB_DRIVER_LINE_MEMBER(v1050_state,pic_int_w),
|
|
||||||
DEVCB_NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
// Display 8255A Interface
|
// Display 8255A Interface
|
||||||
|
|
||||||
WRITE8_MEMBER(v1050_state::disp_ppi_pc_w)
|
WRITE8_MEMBER(v1050_state::disp_ppi_pc_w)
|
||||||
@ -1120,7 +1114,8 @@ static MACHINE_CONFIG_START( v1050, v1050_state )
|
|||||||
MCFG_FRAGMENT_ADD(v1050_video)
|
MCFG_FRAGMENT_ADD(v1050_video)
|
||||||
|
|
||||||
// devices
|
// devices
|
||||||
MCFG_I8214_ADD(UPB8214_TAG, XTAL_16MHz/4, pic_intf)
|
MCFG_DEVICE_ADD(UPB8214_TAG, I8214, XTAL_16MHz/4)
|
||||||
|
MCFG_I8214_IRQ_CALLBACK(WRITELINE(v1050_state, pic_int_w))
|
||||||
|
|
||||||
MCFG_DEVICE_ADD(MSM58321RS_TAG, MSM58321, XTAL_32_768kHz)
|
MCFG_DEVICE_ADD(MSM58321RS_TAG, MSM58321, XTAL_32_768kHz)
|
||||||
MCFG_MSM58321_D0_HANDLER(WRITELINE(v1050_state, rtc_ppi_pa_0_w))
|
MCFG_MSM58321_D0_HANDLER(WRITELINE(v1050_state, rtc_ppi_pa_0_w))
|
||||||
|
Loading…
Reference in New Issue
Block a user