vip: Give the expansion bus full access to N and TPB (nw)

This commit is contained in:
AJR 2018-07-19 10:46:32 -04:00
parent 375427dcee
commit d6c366d8c6
8 changed files with 141 additions and 100 deletions

View File

@ -140,7 +140,7 @@ void vip_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8_
// dma_r - dma read
//-------------------------------------------------
uint8_t vip_expansion_slot_device::dma_r(address_space &space, offs_t offset)
READ8_MEMBER(vip_expansion_slot_device::dma_r)
{
uint8_t data = 0;
@ -157,7 +157,7 @@ uint8_t vip_expansion_slot_device::dma_r(address_space &space, offs_t offset)
// dma_w - dma write
//-------------------------------------------------
void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, uint8_t data)
WRITE8_MEMBER(vip_expansion_slot_device::dma_w)
{
if (m_card != nullptr)
{
@ -182,12 +182,53 @@ uint32_t vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_
return value;
}
READ_LINE_MEMBER( vip_expansion_slot_device::ef1_r ) { int state = CLEAR_LINE; if (m_card != nullptr) state = m_card->vip_ef1_r(); return state; }
READ_LINE_MEMBER( vip_expansion_slot_device::ef3_r ) { int state = CLEAR_LINE; if (m_card != nullptr) state = m_card->vip_ef3_r(); return state; }
READ_LINE_MEMBER( vip_expansion_slot_device::ef4_r ) { int state = CLEAR_LINE; if (m_card != nullptr) state = m_card->vip_ef4_r(); return state; }
void vip_expansion_slot_device::sc_w(int data) { if (m_card != nullptr) m_card->vip_sc_w(data); }
WRITE_LINE_MEMBER( vip_expansion_slot_device::q_w ) { if (m_card != nullptr) m_card->vip_q_w(state); }
WRITE_LINE_MEMBER( vip_expansion_slot_device::run_w ) { if (m_card != nullptr) m_card->vip_run_w(state); }
READ_LINE_MEMBER(vip_expansion_slot_device::ef1_r)
{
int state = CLEAR_LINE;
if (m_card != nullptr)
state = m_card->vip_ef1_r();
return state;
}
READ_LINE_MEMBER(vip_expansion_slot_device::ef3_r)
{
int state = CLEAR_LINE;
if (m_card != nullptr)
state = m_card->vip_ef3_r();
return state;
}
READ_LINE_MEMBER(vip_expansion_slot_device::ef4_r)
{
int state = CLEAR_LINE;
if (m_card != nullptr)
state = m_card->vip_ef4_r();
return state;
}
WRITE8_MEMBER(vip_expansion_slot_device::sc_w)
{
if (m_card != nullptr)
m_card->vip_sc_w(offset, data);
}
WRITE_LINE_MEMBER(vip_expansion_slot_device::q_w)
{
if (m_card != nullptr)
m_card->vip_q_w(state);
}
WRITE_LINE_MEMBER(vip_expansion_slot_device::tpb_w)
{
if (m_card != nullptr)
m_card->vip_tpb_w(state);
}
WRITE_LINE_MEMBER(vip_expansion_slot_device::run_w)
{
if (m_card != nullptr)
m_card->vip_run_w(state);
}

View File

@ -91,14 +91,15 @@ public:
void program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh);
uint8_t io_r(address_space &space, offs_t offset);
void io_w(address_space &space, offs_t offset, uint8_t data);
uint8_t dma_r(address_space &space, offs_t offset);
void dma_w(address_space &space, offs_t offset, uint8_t data);
DECLARE_READ8_MEMBER(dma_r);
DECLARE_WRITE8_MEMBER(dma_w);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ_LINE_MEMBER(ef1_r);
DECLARE_READ_LINE_MEMBER(ef3_r);
DECLARE_READ_LINE_MEMBER(ef4_r);
void sc_w(int data);
DECLARE_WRITE8_MEMBER(sc_w);
DECLARE_WRITE_LINE_MEMBER(q_w);
DECLARE_WRITE_LINE_MEMBER(tpb_w);
DECLARE_WRITE_LINE_MEMBER(run_w);
// cartridge interface
@ -144,10 +145,12 @@ protected:
virtual int vip_ef3_r() { return CLEAR_LINE; }
virtual int vip_ef4_r() { return CLEAR_LINE; }
virtual void vip_sc_w(int data) { }
virtual void vip_sc_w(int n, int sc) { }
virtual void vip_q_w(int state) { }
virtual void vip_tpb_w(int state) { }
virtual void vip_run_w(int state) { }
vip_expansion_slot_device *m_slot;

View File

@ -136,9 +136,9 @@ void vp550_device::vip_program_w(address_space &space, offs_t offset, uint8_t da
// vip_sc_w - status code write
//-------------------------------------------------
void vp550_device::vip_sc_w(int data)
void vp550_device::vip_sc_w(int n, int sc)
{
if (BIT(data, 1))
if (BIT(sc, 1))
{
if (LOG) logerror("VP550 '%s' Clear Interrupt\n", tag());

View File

@ -37,7 +37,7 @@ protected:
// device_vip_expansion_card_interface overrides
virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) override;
virtual void vip_sc_w(int data) override;
virtual void vip_sc_w(int n, int sc) override;
virtual void vip_q_w(int state) override;
virtual void vip_run_w(int state) override;

View File

@ -267,11 +267,12 @@ int vp575_device::vip_ef4_r()
// vip_sc_w - status code write
//-------------------------------------------------
void vp575_device::vip_sc_w(int data)
void vp575_device::vip_sc_w(int n, int sc)
{
address_space &space = machine().dummy_space();
for (auto & elem : m_expansion_slot)
{
elem->sc_w(data);
elem->sc_w(space, n, sc);
}
}
@ -289,6 +290,19 @@ void vp575_device::vip_q_w(int state)
}
//-------------------------------------------------
// vip_tpb_w - TPB write
//-------------------------------------------------
void vp575_device::vip_tpb_w(int state)
{
for (auto & elem : m_expansion_slot)
{
elem->tpb_w(state);
}
}
//-------------------------------------------------
// vip_run_w - RUN write
//-------------------------------------------------

View File

@ -44,8 +44,9 @@ protected:
virtual int vip_ef1_r() override;
virtual int vip_ef3_r() override;
virtual int vip_ef4_r() override;
virtual void vip_sc_w(int data) override;
virtual void vip_sc_w(int n, int sc) override;
virtual void vip_q_w(int state) override;
virtual void vip_tpb_w(int state) override;
virtual void vip_run_w(int state) override;
private:

View File

@ -494,23 +494,6 @@ WRITE_LINE_MEMBER( vip_state::q_w )
m_exp->q_w(state);
}
READ8_MEMBER( vip_state::dma_r )
{
return m_exp->dma_r(space, offset);
}
WRITE8_MEMBER( vip_state::dma_w )
{
m_vdc->dma_w(space, offset, data);
m_exp->dma_w(space, offset, data);
}
WRITE8_MEMBER( vip_state::sc_w )
{
m_exp->sc_w(data);
}
//-------------------------------------------------
// CDP1861_INTERFACE( vdc_intf )
@ -716,26 +699,28 @@ QUICKLOAD_LOAD_MEMBER( vip_state, vip )
MACHINE_CONFIG_START(vip_state::vip)
// basic machine hardware
MCFG_DEVICE_ADD(CDP1802_TAG, CDP1802, XTAL(3'521'280)/2)
MCFG_DEVICE_PROGRAM_MAP(vip_mem)
MCFG_DEVICE_IO_MAP(vip_io)
MCFG_COSMAC_WAIT_CALLBACK(CONSTANT(1))
MCFG_COSMAC_CLEAR_CALLBACK(READLINE(*this, vip_state, clear_r))
MCFG_COSMAC_EF1_CALLBACK(READLINE(*this, vip_state, ef1_r))
MCFG_COSMAC_EF2_CALLBACK(READLINE(*this, vip_state, ef2_r))
MCFG_COSMAC_EF3_CALLBACK(READLINE(*this, vip_state, ef3_r))
MCFG_COSMAC_EF4_CALLBACK(READLINE(*this, vip_state, ef4_r))
MCFG_COSMAC_Q_CALLBACK(WRITELINE(*this, vip_state, q_w))
MCFG_COSMAC_DMAR_CALLBACK(READ8(*this, vip_state, dma_r))
MCFG_COSMAC_DMAW_CALLBACK(WRITE8(*this, vip_state, dma_w))
MCFG_COSMAC_SC_CALLBACK(WRITE8(*this, vip_state, sc_w))
CDP1802(config, m_maincpu, 3.52128_MHz_XTAL / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &vip_state::vip_mem);
m_maincpu->set_addrmap(AS_IO, &vip_state::vip_io);
m_maincpu->wait_cb().set_constant(1);
m_maincpu->clear_cb().set(FUNC(vip_state::clear_r));
m_maincpu->ef1_cb().set(FUNC(vip_state::ef1_r));
m_maincpu->ef2_cb().set(FUNC(vip_state::ef2_r));
m_maincpu->ef3_cb().set(FUNC(vip_state::ef3_r));
m_maincpu->ef4_cb().set(FUNC(vip_state::ef4_r));
m_maincpu->q_cb().set(FUNC(vip_state::q_w));
m_maincpu->dma_rd_cb().set(m_exp, FUNC(vip_expansion_slot_device::dma_r));
m_maincpu->dma_wr_cb().set(m_vdc, FUNC(cdp1861_device::dma_w));
m_maincpu->dma_wr_cb().append(m_exp, FUNC(vip_expansion_slot_device::dma_w));
m_maincpu->sc_cb().set(m_exp, FUNC(vip_expansion_slot_device::sc_w));
m_maincpu->tpb_cb().set(m_exp, FUNC(vip_expansion_slot_device::tpb_w));
// video hardware
MCFG_DEVICE_ADD(CDP1861_TAG, CDP1861, XTAL(3'521'280)/2)
MCFG_DEVICE_ADD(CDP1861_TAG, CDP1861, 3.52128_MHz_XTAL / 2)
MCFG_CDP1861_IRQ_CALLBACK(WRITELINE(*this, vip_state, vdc_int_w))
MCFG_CDP1861_DMA_OUT_CALLBACK(WRITELINE(*this, vip_state, vdc_dma_out_w))
MCFG_CDP1861_EFX_CALLBACK(WRITELINE(*this, vip_state, vdc_ef1_w))
MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, XTAL(3'521'280)/2)
MCFG_CDP1861_SCREEN_ADD(CDP1861_TAG, SCREEN_TAG, 3.52128_MHz_XTAL / 2)
MCFG_SCREEN_UPDATE_DRIVER(vip_state, screen_update)
// sound hardware
@ -745,7 +730,7 @@ MACHINE_CONFIG_START(vip_state::vip)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MCFG_VIP_BYTEIO_PORT_ADD(VIP_BYTEIO_PORT_TAG, vip_byteio_cards, nullptr, WRITELINE(*this, vip_state, byteio_inst_w))
MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, XTAL(3'521'280)/2, vip_expansion_cards, nullptr)
MCFG_VIP_EXPANSION_SLOT_ADD(VIP_EXPANSION_SLOT_TAG, 3.52128_MHz_XTAL / 2, vip_expansion_cards, nullptr)
MCFG_VIP_EXPANSION_SLOT_INT_CALLBACK(WRITELINE(*this, vip_state, exp_int_w))
MCFG_VIP_EXPANSION_SLOT_DMA_OUT_CALLBACK(WRITELINE(*this, vip_state, exp_dma_out_w))
MCFG_VIP_EXPANSION_SLOT_DMA_IN_CALLBACK(WRITELINE(*this, vip_state, exp_dma_in_w))

View File

@ -75,9 +75,6 @@ private:
DECLARE_READ_LINE_MEMBER(ef3_r);
DECLARE_READ_LINE_MEMBER(ef4_r);
DECLARE_WRITE_LINE_MEMBER(q_w);
DECLARE_READ8_MEMBER( dma_r );
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE8_MEMBER( sc_w );
DECLARE_WRITE_LINE_MEMBER(vdc_int_w);
DECLARE_WRITE_LINE_MEMBER(vdc_dma_out_w);