Previous 199869 Revisions Next

r21775 Saturday 9th March, 2013 at 22:08:38 UTC by Carl
(mess) ne1000, ne2000: Let's pick an IRQ (nw)
[src/mess/machine]ne1000.c ne1000.h ne2000.c ne2000.h

trunk/src/mess/machine/ne1000.c
r21774r21775
3838
3939void ne1000_device::device_reset() {
4040   memcpy(m_prom, m_dp8390->get_mac(), 6);
41   m_irq = ioport("CONFIG")->read() & 3;
4142}
4243
4344READ8_MEMBER(ne1000_device::ne1000_port_r) {
r21774r21775
7980}
8081
8182WRITE_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   }
8397}
8498
8599READ8_MEMBER(ne1000_device::ne1000_mem_read) {
r21774r21775
98112   }
99113   m_board_ram[offset - (8*1024)] = data;
100114}
115
116static 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")
128INPUT_PORTS_END
129
130ioport_constructor ne1000_device::device_input_ports() const
131{
132   return INPUT_PORTS_NAME(ne1000);
133}
134
trunk/src/mess/machine/ne1000.h
r21774r21775
1313public:
1414   ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1515   virtual machine_config_constructor device_mconfig_additions() const;
16   virtual ioport_constructor device_input_ports() const;
1617
1718   void ne1000_irq_w(int state);
1819   DECLARE_READ8_MEMBER(ne1000_mem_read);
r21774r21775
2526   virtual void device_config_complete() { m_shortname = "ne1000"; }
2627private:
2728   required_device<dp8390d_device> m_dp8390;
29   UINT8 m_irq;
2830   UINT8 m_board_ram[8*1024];
2931   UINT8 m_prom[16];
3032};
trunk/src/mess/machine/ne2000.c
r21774r21775
3838
3939void ne2000_device::device_reset() {
4040   memcpy(m_prom, m_dp8390->get_mac(), 6);
41   m_irq = ioport("CONFIG")->read() & 3;
4142}
4243
4344READ16_MEMBER(ne2000_device::ne2000_port_r) {
r21774r21775
8990}
9091
9192WRITE_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   }
93107}
94108
95109READ8_MEMBER(ne2000_device::ne2000_mem_read) {
r21774r21775
108122   }
109123   m_board_ram[offset - (16*1024)] = data;
110124}
125
126static 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")
138INPUT_PORTS_END
139
140ioport_constructor ne2000_device::device_input_ports() const
141{
142   return INPUT_PORTS_NAME(ne2000);
143}
trunk/src/mess/machine/ne2000.h
r21774r21775
1111public:
1212   ne2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1313   virtual machine_config_constructor device_mconfig_additions() const;
14   virtual ioport_constructor device_input_ports() const;
1415
1516   void ne2000_irq_w(int state);
1617   DECLARE_READ8_MEMBER(ne2000_mem_read);
r21774r21775
2324   virtual void device_config_complete() { m_shortname = "ne2000"; }
2425private:
2526   required_device<dp8390d_device> m_dp8390;
27   UINT8 m_irq;
2628   UINT8 m_board_ram[16*1024];
2729   UINT8 m_prom[16];
2830};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team