mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
pofo: Expansion port slot interface WIP. (nw)
This commit is contained in:
parent
241c32eae4
commit
666c523700
@ -32,6 +32,11 @@ device_portfolio_expansion_slot_interface::device_portfolio_expansion_slot_inter
|
|||||||
m_slot = dynamic_cast<portfolio_expansion_slot_t *>(device.owner());
|
m_slot = dynamic_cast<portfolio_expansion_slot_t *>(device.owner());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::iint_w ) { m_slot->iint_w(state); }
|
||||||
|
WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::eint_w ) { m_slot->eint_w(state); }
|
||||||
|
WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::nmio_w ) { m_slot->nmio_w(state); }
|
||||||
|
WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::wake_w ) { m_slot->wake_w(state); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
@ -93,15 +93,20 @@ public:
|
|||||||
device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device);
|
device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device);
|
||||||
virtual ~device_portfolio_expansion_slot_interface() { }
|
virtual ~device_portfolio_expansion_slot_interface() { }
|
||||||
|
|
||||||
bool nmd1() { return 1; }
|
virtual bool nmd1() { return 1; }
|
||||||
bool pdet() { return 0; }
|
virtual bool pdet() { return 0; }
|
||||||
bool cdet() { return 1; }
|
virtual bool cdet() { return 1; }
|
||||||
|
|
||||||
UINT8 iack_r() { return 0xff; }
|
virtual UINT8 iack_r() { return 0xff; }
|
||||||
UINT8 eack_r() { return 0xff; }
|
virtual UINT8 eack_r() { return 0xff; }
|
||||||
|
|
||||||
UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; };
|
virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; };
|
||||||
void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { };
|
virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { };
|
||||||
|
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( iint_w );
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( eint_w );
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( nmio_w );
|
||||||
|
DECLARE_WRITE_LINE_MEMBER( wake_w );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
portfolio_expansion_slot_t *m_slot;
|
portfolio_expansion_slot_t *m_slot;
|
||||||
|
@ -98,4 +98,44 @@ void hpc101_t::device_start()
|
|||||||
|
|
||||||
void hpc101_t::device_reset()
|
void hpc101_t::device_reset()
|
||||||
{
|
{
|
||||||
|
m_ppi->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// nrdi_r - read
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
UINT8 hpc101_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
|
||||||
|
{
|
||||||
|
if (!bcom)
|
||||||
|
{
|
||||||
|
if ((offset & 0x0f) == 0x0f)
|
||||||
|
{
|
||||||
|
data = 0x02;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((offset & 0x0c) == 0x08)
|
||||||
|
{
|
||||||
|
data = m_ppi->read(space, offset & 0x03);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// nwri_w - write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void hpc101_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
|
||||||
|
{
|
||||||
|
if (!bcom)
|
||||||
|
{
|
||||||
|
if ((offset & 0x0c) == 0x08)
|
||||||
|
{
|
||||||
|
m_ppi->write(space, offset & 0x03, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ protected:
|
|||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
|
|
||||||
// device_portfolio_expansion_slot_interface overrides
|
// device_portfolio_expansion_slot_interface overrides
|
||||||
|
bool pdet() override { return 1; }
|
||||||
|
|
||||||
|
virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
|
||||||
|
virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
required_device<i8255_device> m_ppi;
|
required_device<i8255_device> m_ppi;
|
||||||
|
@ -37,7 +37,7 @@ static MACHINE_CONFIG_FRAGMENT( hpc102 )
|
|||||||
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
|
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
|
||||||
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
|
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
|
||||||
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
|
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
|
||||||
//MCFG_INS8250_OUT_INT_CB(WRITELINE(portfolio_state, i8250_intrpt_w))
|
MCFG_INS8250_OUT_INT_CB(WRITELINE(device_portfolio_expansion_slot_interface, eint_w))
|
||||||
|
|
||||||
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr)
|
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr)
|
||||||
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, rx_w))
|
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, rx_w))
|
||||||
@ -90,4 +90,59 @@ void hpc102_t::device_start()
|
|||||||
|
|
||||||
void hpc102_t::device_reset()
|
void hpc102_t::device_reset()
|
||||||
{
|
{
|
||||||
|
m_uart->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// eack_r - external interrupt acknowledge
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
UINT8 hpc102_t::eack_r()
|
||||||
|
{
|
||||||
|
return m_vector;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// nrdi_r - read
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
UINT8 hpc102_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
|
||||||
|
{
|
||||||
|
if (!bcom)
|
||||||
|
{
|
||||||
|
if ((offset & 0x0f) == 0x0f)
|
||||||
|
{
|
||||||
|
data = 0x01;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(offset & 0x08))
|
||||||
|
{
|
||||||
|
data = m_uart->ins8250_r(space, offset & 0x07);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// nwri_w - write
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void hpc102_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
|
||||||
|
{
|
||||||
|
if (!bcom)
|
||||||
|
{
|
||||||
|
if ((offset & 0x0f) == 0x0f)
|
||||||
|
{
|
||||||
|
m_vector = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(offset & 0x08))
|
||||||
|
{
|
||||||
|
m_uart->ins8250_w(space, offset & 0x07, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,17 @@ protected:
|
|||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
|
|
||||||
// device_portfolio_expansion_slot_interface overrides
|
// device_portfolio_expansion_slot_interface overrides
|
||||||
|
bool pdet() override { return 1; }
|
||||||
|
|
||||||
|
virtual UINT8 eack_r() override;
|
||||||
|
|
||||||
|
virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
|
||||||
|
virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
required_device<ins8250_device> m_uart;
|
required_device<ins8250_device> m_uart;
|
||||||
|
|
||||||
|
UINT8 m_vector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +117,6 @@ public:
|
|||||||
/* interrupt state */
|
/* interrupt state */
|
||||||
UINT8 m_ip; /* interrupt pending */
|
UINT8 m_ip; /* interrupt pending */
|
||||||
UINT8 m_ie; /* interrupt enable */
|
UINT8 m_ie; /* interrupt enable */
|
||||||
UINT8 m_sivr; /* serial interrupt vector register */
|
|
||||||
|
|
||||||
/* counter state */
|
/* counter state */
|
||||||
UINT16 m_counter;
|
UINT16 m_counter;
|
||||||
@ -207,7 +206,7 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w )
|
|||||||
|
|
||||||
IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
|
IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
|
||||||
{
|
{
|
||||||
UINT8 vector = m_sivr;
|
UINT8 vector = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
@ -217,7 +216,7 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
|
|||||||
m_ip &= ~(1 << i);
|
m_ip &= ~(1 << i);
|
||||||
|
|
||||||
if (i == 3)
|
if (i == 3)
|
||||||
vector = m_sivr;
|
vector = m_exp->eack_r();
|
||||||
else
|
else
|
||||||
vector = INTERRUPT_VECTOR[i];
|
vector = INTERRUPT_VECTOR[i];
|
||||||
|
|
||||||
@ -716,12 +715,10 @@ void portfolio_state::machine_start()
|
|||||||
|
|
||||||
/* set initial values */
|
/* set initial values */
|
||||||
m_keylatch = 0xff;
|
m_keylatch = 0xff;
|
||||||
m_sivr = 0x2a;
|
|
||||||
|
|
||||||
/* register for state saving */
|
/* register for state saving */
|
||||||
save_item(NAME(m_ip));
|
save_item(NAME(m_ip));
|
||||||
save_item(NAME(m_ie));
|
save_item(NAME(m_ie));
|
||||||
save_item(NAME(m_sivr));
|
|
||||||
save_item(NAME(m_counter));
|
save_item(NAME(m_counter));
|
||||||
save_item(NAME(m_keylatch));
|
save_item(NAME(m_keylatch));
|
||||||
save_pointer(NAME(m_contrast.target()), m_contrast.bytes());
|
save_pointer(NAME(m_contrast.target()), m_contrast.bytes());
|
||||||
|
Loading…
Reference in New Issue
Block a user