Previous 199869 Revisions Next

r21397 Saturday 23rd February, 2013 at 14:31:51 UTC by Curt Coder
(MESS) cbm2: Fixed 6509<>8088 comms. (nw)
[src/emu/machine]6525tpi.c 6525tpi.h
[src/mess/drivers]cbm2.c
[src/mess/includes]cbm2.h

trunk/src/emu/machine/6525tpi.c
r21396r21397
391391}
392392
393393
394READ8_MEMBER( tpi6525_device::pa_r ) { return tpi6525_porta_r(this, space, 0); }
395READ8_MEMBER( tpi6525_device::pb_r ) { return tpi6525_portb_r(this, space, 0); }
396READ8_MEMBER( tpi6525_device::pc_r ) { return tpi6525_portc_r(this, space, 0); }
397
398
394399READ8_DEVICE_HANDLER( tpi6525_r )
395400{
396401   tpi6525_state *tpi6525 = get_safe_token(device);
trunk/src/emu/machine/6525tpi.h
r21396r21397
7474   DECLARE_WRITE_LINE_MEMBER( i3_w );
7575   DECLARE_WRITE_LINE_MEMBER( i4_w );
7676
77   DECLARE_READ8_MEMBER( pa_r );
78   DECLARE_READ8_MEMBER( pb_r );
79   DECLARE_READ8_MEMBER( pc_r );
80
7781protected:
7882   // device-level overrides
7983   virtual void device_config_complete();
trunk/src/mess/includes/cbm2.h
r21396r21397
175175      int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs);
176176
177177   UINT8 read_keyboard();
178   void set_busy2(int state);
178179
179180   DECLARE_READ8_MEMBER( read );
180181   DECLARE_WRITE8_MEMBER( write );
r21396r21397
206207   DECLARE_WRITE8_MEMBER( ext_tpi_pb_w );
207208   DECLARE_WRITE8_MEMBER( ext_tpi_pc_w );
208209
210   DECLARE_WRITE_LINE_MEMBER( ext_cia_irq_w );
209211   DECLARE_READ8_MEMBER( ext_cia_pb_r );
210212   DECLARE_WRITE8_MEMBER( ext_cia_pb_w );
211213
r21396r21397
234236   UINT8 m_tpi2_pb;
235237   UINT8 m_cia_pa;
236238
239   UINT8 m_ext_cia_pb;
240   UINT8 m_ext_tpi_pb;
241
237242   // timers
238243   emu_timer *m_todclk_timer;
239244};
trunk/src/mess/drivers/cbm2.c
r21396r21397
16961696//  tpi6525_interface ext_tpi_intf
16971697//-------------------------------------------------
16981698
1699void cbm2_state::set_busy2(int state)
1700{
1701   m_busy2 = state;
1702
1703   if (m_busy2)
1704   {
1705      m_busen1 = m_dramon;
1706   }
1707   else
1708   {
1709      m_busen1 = 0;
1710   }
1711}
1712
16991713READ8_MEMBER( cbm2_state::ext_tpi_pb_r )
17001714{
17011715   /*
r21396r21397
17031717       bit     description
17041718
17051719       0       _BUSY1
1706       1       CIA PB1
1707       2       CIA PB2
1708       3       CIA PB3
1709       4       CIA PB4
1710       5       CIA PB5
1720       1       _BUSY2
1721       2       _REQ
1722       3       _ACK
1723       4       DATA/_CMD
1724       5       DIR
17111725       6       1
17121726       7       1
17131727
r21396r21397
17181732   // _BUSY1
17191733   data |= !m_busen1;
17201734
1735   // _BUSY2
1736   data |= m_busy2 << 1;
1737
17211738   // CIA
1722   data = m_ext_cia->pb_r() & 0x3e;
1739   data |= m_ext_tpi_pb & m_ext_cia_pb & 0x3c;
17231740
17241741   return data;
17251742}
r21396r21397
17301747
17311748       bit     description
17321749
1733       0       U22B CL
1734       1
1750       0       
1751       1       _BUSY2
17351752       2
17361753       3
17371754       4
r21396r21397
17411758
17421759   */
17431760
1761   m_ext_tpi_pb = data;
1762
17441763   // _BUSY2
1745   if (!BIT(data, 0))
1764   if (!BIT(data, 1))
17461765   {
1747      logerror("BUSY2 1\n");
1748      m_busy2 = 1;
1749      m_busen1 = m_dramon;
1766      set_busy2(0);
17501767   }
17511768
1769   // FLAG
17521770   m_ext_cia->flag_w(BIT(data, 6));
17531771}
17541772
r21396r21397
17631781       2
17641782       3
17651783       4
1766       5       U22B CLK
1784       5       BSYCLK
17671785       6
17681786       7
17691787
r21396r21397
17721790   // _BUSY2
17731791   if (BIT(data, 5))
17741792   {
1775      logerror("BUSY2 1\n");
1776      m_busy2 = 1;
1777      m_busen1 = m_dramon;
1793      set_busy2(1);
17781794   }
17791795}
17801796
r21396r21397
17961812//  MOS6526_INTERFACE( ext_cia_intf )
17971813//-------------------------------------------------
17981814
1815WRITE_LINE_MEMBER( cbm2_state::ext_cia_irq_w )
1816{
1817   m_tpi1->i3_w(!state);
1818}
1819
17991820READ8_MEMBER( cbm2_state::ext_cia_pb_r )
18001821{
18011822   /*
r21396r21397
18031824       bit     description
18041825
18051826       0       _BUSY1
1806       1       TPI PB1
1807       2       TPI PB2
1808       3       TPI PB3
1809       4       TPI PB4
1810       5       TPI PB5
1827       1       _BUSY2
1828       2       _REQ
1829       3       _ACK
1830       4       DATA/_CMD
1831       5       DIR
18111832       6       1
18121833       7       1
18131834
r21396r21397
18181839   // _BUSY1
18191840   data |= !m_busen1;
18201841
1842   // _BUSY2
1843   data |= m_busy2 << 1;
1844
18211845   // TPI
1822   data |= tpi6525_portb_r(m_ext_tpi, space, 0) & 0x3e;
1846   data |= m_ext_tpi_pb & m_ext_cia_pb & 0x3c;
18231847
18241848   return data;
18251849}
r21396r21397
18301854
18311855       bit     description
18321856
1833       0       U22B CL
1834       1
1857       0       
1858       1       _BUSY2
18351859       2
18361860       3
18371861       4
18381862       5
1839       6       PIC IR0, U29B CL, U22B PR
1840       7       PIC IR7
1863       6       _INT1
1864       7       _INT2
18411865
18421866   */
18431867
1868   m_ext_cia_pb = data;
1869
18441870   // _BUSY2
1845   if (!BIT(data, 0))
1871   if (!BIT(data, 1))
18461872   {
1847      logerror("BUSY2 1\n");
1848      m_busy2 = 1;
1849      m_busen1 = m_dramon;
1873      set_busy2(0);
18501874   }
1851   else if (!BIT(data, 6))
1875
1876   if (!BIT(data, 6))
18521877   {
1853      logerror("BUSY2 0\n");
1854      m_busy2 = 0;
1855      m_busen1 = 0;
1878      set_busy2(0);
18561879   }
18571880
18581881   m_ext_pic->ir0_w(!BIT(data, 6));
r21396r21397
20772100   m_tpi1_irq = CLEAR_LINE;
20782101   m_user_irq = CLEAR_LINE;
20792102
2103m_ext_tpi_pb = 0xff;
2104m_ext_cia_pb = 0xff;
2105
20802106   m_maincpu->reset();
20812107
20822108   if (m_crtc) m_crtc->reset();
r21396r21397
23992425
24002426   MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
24012427   MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
2402   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i3_w))
2428   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, DEVWRITELINE(DEVICE_SELF, cbm2_state, ext_cia_irq_w))
24032429   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
2404   //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
2430   MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r), NULL)
24052431   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
24062432
24072433   MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop")
r21396r21397
24582484
24592485   MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
24602486   MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
2461   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i3_w))
2487   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, DEVWRITELINE(DEVICE_SELF, cbm2_state, ext_cia_irq_w))
24622488   MCFG_MOS6526_SERIAL_CALLBACKS(DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, cnt_w), DEVWRITELINE(CBM2_USER_PORT_TAG, cbm2_user_port_device, sp_w))
2463   //MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_porta_r), NULL)
2489   MCFG_MOS6526_PORT_A_CALLBACKS(DEVREAD8(EXT_MOS6525_TAG, tpi6525_device, pa_r), NULL)
24642490   MCFG_MOS6526_PORT_B_CALLBACKS(DEVREAD8(DEVICE_SELF, cbm2_state, ext_cia_pb_r), DEVWRITE8(DEVICE_SELF, cbm2_state, ext_cia_pb_w), NULL)
24652491
24662492   MCFG_SOFTWARE_LIST_ADD("flop_list2", "bx256hp_flop")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team