trunk/src/mess/machine/ne1000.c
| r21774 | r21775 | |
| 38 | 38 | |
| 39 | 39 | void ne1000_device::device_reset() { |
| 40 | 40 | memcpy(m_prom, m_dp8390->get_mac(), 6); |
| 41 | m_irq = ioport("CONFIG")->read() & 3; |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | READ8_MEMBER(ne1000_device::ne1000_port_r) { |
| r21774 | r21775 | |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | 82 | WRITE_LINE_MEMBER(ne1000_device::ne1000_irq_w) { |
| 82 | | m_isa->irq3_w(state); |
| 83 | switch(m_irq) { |
| 84 | case 0: |
| 85 | m_isa->irq2_w(state); |
| 86 | break; |
| 87 | case 1: |
| 88 | m_isa->irq3_w(state); |
| 89 | break; |
| 90 | case 2: |
| 91 | m_isa->irq4_w(state); |
| 92 | break; |
| 93 | case 3: |
| 94 | m_isa->irq5_w(state); |
| 95 | break; |
| 96 | } |
| 83 | 97 | } |
| 84 | 98 | |
| 85 | 99 | READ8_MEMBER(ne1000_device::ne1000_mem_read) { |
| r21774 | r21775 | |
| 98 | 112 | } |
| 99 | 113 | m_board_ram[offset - (8*1024)] = data; |
| 100 | 114 | } |
| 115 | |
| 116 | static INPUT_PORTS_START( ne1000 ) |
| 117 | PORT_START("CONFIG") |
| 118 | PORT_CONFNAME(0x03, 0x01, "NE1000 IRQ jumper (W12-15)") |
| 119 | PORT_CONFSETTING( 0x00, "IRQ2") |
| 120 | PORT_CONFSETTING( 0x01, "IRQ3") |
| 121 | PORT_CONFSETTING( 0x02, "IRQ4") |
| 122 | PORT_CONFSETTING( 0x03, "IRQ5") |
| 123 | //PORT_CONFNAME(0x30, 0x00, "NE1000 IO port jumper (W9-10)") |
| 124 | //PORT_CONFSETTING( 0x00, "300") |
| 125 | //PORT_CONFSETTING( 0x00, "320") |
| 126 | //PORT_CONFSETTING( 0x00, "340") |
| 127 | //PORT_CONFSETTING( 0x00, "360") |
| 128 | INPUT_PORTS_END |
| 129 | |
| 130 | ioport_constructor ne1000_device::device_input_ports() const |
| 131 | { |
| 132 | return INPUT_PORTS_NAME(ne1000); |
| 133 | } |
| 134 | |
trunk/src/mess/machine/ne1000.h
| r21774 | r21775 | |
| 13 | 13 | public: |
| 14 | 14 | ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 15 | 15 | virtual machine_config_constructor device_mconfig_additions() const; |
| 16 | virtual ioport_constructor device_input_ports() const; |
| 16 | 17 | |
| 17 | 18 | void ne1000_irq_w(int state); |
| 18 | 19 | DECLARE_READ8_MEMBER(ne1000_mem_read); |
| r21774 | r21775 | |
| 25 | 26 | virtual void device_config_complete() { m_shortname = "ne1000"; } |
| 26 | 27 | private: |
| 27 | 28 | required_device<dp8390d_device> m_dp8390; |
| 29 | UINT8 m_irq; |
| 28 | 30 | UINT8 m_board_ram[8*1024]; |
| 29 | 31 | UINT8 m_prom[16]; |
| 30 | 32 | }; |
trunk/src/mess/machine/ne2000.c
| r21774 | r21775 | |
| 38 | 38 | |
| 39 | 39 | void ne2000_device::device_reset() { |
| 40 | 40 | memcpy(m_prom, m_dp8390->get_mac(), 6); |
| 41 | m_irq = ioport("CONFIG")->read() & 3; |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | READ16_MEMBER(ne2000_device::ne2000_port_r) { |
| r21774 | r21775 | |
| 89 | 90 | } |
| 90 | 91 | |
| 91 | 92 | WRITE_LINE_MEMBER(ne2000_device::ne2000_irq_w) { |
| 92 | | m_isa->irq3_w(state); |
| 93 | switch(m_irq) { |
| 94 | case 0: |
| 95 | m_isa->irq2_w(state); |
| 96 | break; |
| 97 | case 1: |
| 98 | m_isa->irq3_w(state); |
| 99 | break; |
| 100 | case 2: |
| 101 | m_isa->irq4_w(state); |
| 102 | break; |
| 103 | case 3: |
| 104 | m_isa->irq5_w(state); |
| 105 | break; |
| 106 | } |
| 93 | 107 | } |
| 94 | 108 | |
| 95 | 109 | READ8_MEMBER(ne2000_device::ne2000_mem_read) { |
| r21774 | r21775 | |
| 108 | 122 | } |
| 109 | 123 | m_board_ram[offset - (16*1024)] = data; |
| 110 | 124 | } |
| 125 | |
| 126 | static INPUT_PORTS_START( ne2000 ) |
| 127 | PORT_START("CONFIG") |
| 128 | PORT_CONFNAME(0x03, 0x01, "NE2000 IRQ jumper (W12-15)") |
| 129 | PORT_CONFSETTING( 0x00, "IRQ2") |
| 130 | PORT_CONFSETTING( 0x01, "IRQ3") |
| 131 | PORT_CONFSETTING( 0x02, "IRQ4") |
| 132 | PORT_CONFSETTING( 0x03, "IRQ5") |
| 133 | //PORT_CONFNAME(0x30, 0x00, "NE2000 IO port jumper (W9-10)") |
| 134 | //PORT_CONFSETTING( 0x00, "300") |
| 135 | //PORT_CONFSETTING( 0x00, "320") |
| 136 | //PORT_CONFSETTING( 0x00, "340") |
| 137 | //PORT_CONFSETTING( 0x00, "360") |
| 138 | INPUT_PORTS_END |
| 139 | |
| 140 | ioport_constructor ne2000_device::device_input_ports() const |
| 141 | { |
| 142 | return INPUT_PORTS_NAME(ne2000); |
| 143 | } |
trunk/src/mess/machine/ne2000.h
| r21774 | r21775 | |
| 11 | 11 | public: |
| 12 | 12 | ne2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 13 | 13 | virtual machine_config_constructor device_mconfig_additions() const; |
| 14 | virtual ioport_constructor device_input_ports() const; |
| 14 | 15 | |
| 15 | 16 | void ne2000_irq_w(int state); |
| 16 | 17 | DECLARE_READ8_MEMBER(ne2000_mem_read); |
| r21774 | r21775 | |
| 23 | 24 | virtual void device_config_complete() { m_shortname = "ne2000"; } |
| 24 | 25 | private: |
| 25 | 26 | required_device<dp8390d_device> m_dp8390; |
| 27 | UINT8 m_irq; |
| 26 | 28 | UINT8 m_board_ram[16*1024]; |
| 27 | 29 | UINT8 m_prom[16]; |
| 28 | 30 | }; |