Previous 199869 Revisions Next

r23865 Saturday 22nd June, 2013 at 20:06:02 UTC by Curt Coder
(MESS) ibm5160: Keyboard WIP. (nw)
[src/mess/machine]kb_pcxt83.c kb_pcxt83.h

trunk/src/mess/machine/kb_pcxt83.c
r23864r23865
6363//-------------------------------------------------
6464
6565static ADDRESS_MAP_START( ibm_pc_xt_83_keyboard_io, AS_IO, 8, ibm_pc_xt_83_keyboard_device )
66   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_WRITE(bus_w)
67   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(p1_r) AM_WRITENOP
66   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READNOP AM_WRITE(bus_w)
67   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(p1_w)
6868   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(p2_w)
69   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r)
6970   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(t1_r)
7071ADDRESS_MAP_END
7172
r23864r23865
7576//-------------------------------------------------
7677
7778static MACHINE_CONFIG_FRAGMENT( ibm_pc_xt_83_keyboard )
78   MCFG_CPU_ADD(I8048_TAG, I8048, MCS48_LC_CLOCK(IND_U(47), CAP_P(20)))
79   MCFG_CPU_ADD(I8048_TAG, I8048, 5247000)
7980   MCFG_CPU_IO_MAP(ibm_pc_xt_83_keyboard_io)
8081MACHINE_CONFIG_END
8182
r23864r23865
9697//-------------------------------------------------
9798
9899INPUT_PORTS_START( ibm_pc_xt_83_keyboard )
99   PORT_START("DR00")
100   PORT_START("P10")
100101   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
101102   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
102103   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
103104   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
105   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
106   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
107   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
108   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
104109
105   PORT_START("DR01")
110   PORT_START("P11")
106111   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
107112   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
108113   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
109114   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
115   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
116   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
117   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
118   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
110119
111   PORT_START("DR02")
120   PORT_START("P12")
112121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
113122   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
114123   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
115124   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
126   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
127   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
128   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
116129
117   PORT_START("DR03")
130   PORT_START("P13")
118131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
119132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
120133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
121134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
122139
123   PORT_START("DR04")
140   PORT_START("P14")
124141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
125142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
126143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
127144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
128149
129   PORT_START("DR05")
150   PORT_START("P15")
130151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
131152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
132153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
133154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
134159
135   PORT_START("DR06")
160   PORT_START("P16")
136161   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
137162   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
138163   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
139164   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
165   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
166   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
167   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
168   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
140169
141   PORT_START("DR07")
170   PORT_START("P17")
142171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
143172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
144173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
145174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
175   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
176   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
177   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
178   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
146179
147   PORT_START("DR08")
180   PORT_START("P23")
148181   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
149182   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
150183   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
151184   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
185   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
186   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
187   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
188   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
152189
153   PORT_START("DR09")
190   PORT_START("P24")
154191   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
155192   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
156193   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
157194   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
195   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
196   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
197   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
198   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
158199
159   PORT_START("DR10")
200   PORT_START("P25")
160201   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
161202   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
162203   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
163204   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
205   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
206   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
207   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
208   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
164209
165   PORT_START("DR11")
210   PORT_START("P26")
166211   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
167212   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
168213   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
169214   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
215   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
216   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
217   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
218   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
170219
171   PORT_START("DR12")
220   PORT_START("P27")
172221   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
173222   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
174223   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
175224   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
176
177   PORT_START("DR13")
178   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
179   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
180   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
181   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
182
183   PORT_START("DR14")
184   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
185   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
186   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
187   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
188
189   PORT_START("DR15")
190   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
191   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
192   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
193   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
194
195   PORT_START("DR16")
196   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
197   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
198   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
199   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
200
201   PORT_START("DR17")
202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
206
207   PORT_START("DR18")
208   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
209   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
210   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
211   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
212
213   PORT_START("DR19")
214   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
215   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
216   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
217   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
218
219   PORT_START("DR20")
220   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
221   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
222   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
223   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
224
225   PORT_START("DR21")
226   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
227   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
228   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
229   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
230
231   PORT_START("DR22")
232   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
233   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
234   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
235   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
236
237   PORT_START("DR23")
238   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
239   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
240   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
241   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
225   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
226   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
227   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
228   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
242229INPUT_PORTS_END
243230
244231
r23864r23865
262249//-------------------------------------------------
263250
264251ibm_pc_xt_83_keyboard_device::ibm_pc_xt_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
265   : device_t(mconfig, PC_KBD_IBM_PC_XT_83, "IBM PC/XT 5150/5160 Keyboard", tag, owner, clock, "kb_pcxt83", __FILE__),
252   : device_t(mconfig, PC_KBD_IBM_PC_XT_83, "IBM 1501100 Keyboard", tag, owner, clock, "kb_pcxt83", __FILE__),
266253     device_pc_kbd_interface(mconfig, *this),
267254     m_maincpu(*this, I8048_TAG),
268     m_dr00(*this, "DR00"),
269     m_dr01(*this, "DR01"),
270     m_dr02(*this, "DR02"),
271     m_dr03(*this, "DR03"),
272     m_dr04(*this, "DR04"),
273     m_dr05(*this, "DR05"),
274     m_dr06(*this, "DR06"),
275     m_dr07(*this, "DR07"),
276     m_dr08(*this, "DR08"),
277     m_dr09(*this, "DR09"),
278     m_dr10(*this, "DR10"),
279     m_dr11(*this, "DR11"),
280     m_dr12(*this, "DR12"),
281     m_dr13(*this, "DR13"),
282     m_dr14(*this, "DR14"),
283     m_dr15(*this, "DR15"),
284     m_dr16(*this, "DR16"),
285     m_dr17(*this, "DR17"),
286     m_dr18(*this, "DR18"),
287     m_dr19(*this, "DR19"),
288     m_dr20(*this, "DR20"),
289     m_dr21(*this, "DR21"),
290     m_dr22(*this, "DR22"),
291     m_dr23(*this, "DR23")
255     m_p10(*this, "P10"),
256     m_p11(*this, "P11"),
257     m_p12(*this, "P12"),
258     m_p13(*this, "P13"),
259     m_p14(*this, "P14"),
260     m_p15(*this, "P15"),
261     m_p16(*this, "P16"),
262     m_p17(*this, "P17"),
263     m_p23(*this, "P23"),
264     m_p24(*this, "P24"),
265     m_p25(*this, "P25"),
266     m_p26(*this, "P26"),
267     m_p27(*this, "P27"),
268     m_p1(0),
269     m_p2(0),
270     m_sense(0)
292271{
293272}
294273
r23864r23865
300279void ibm_pc_xt_83_keyboard_device::device_start()
301280{
302281   // state saving
303   save_item(NAME(m_cnt));
282   save_item(NAME(m_p1));
283   save_item(NAME(m_p2));
284   save_item(NAME(m_sense));
304285}
305286
306287
r23864r23865
324305   
325306       bit     description
326307   
327       0       CNT 1
328       1       CNT 2
329       2       CNT 4
330       3       CNT 8
331       4       CNT 16
332       5       CNT 32
333       6       CNT 64
334       7       
308       0       
309       1       
310       2       
311       3       
312       4       
313       5       CLOCK
314       6       DATA
315       7       IC4 G
335316   
336317   */
337318
338   m_cnt = data & 0x7f;
319   m_pc_kbdc->clock_write_from_kb(BIT(data, 5));
320   m_pc_kbdc->data_write_from_kb(BIT(data, 6));
321
322   if (BIT(data, 7))
323   {
324      m_sense = m_p2 & 0x07;
325   }
339326}
340327
341328
342329//-------------------------------------------------
343//  p1_r -
330//  p1_w -
344331//-------------------------------------------------
345332
346READ8_MEMBER( ibm_pc_xt_83_keyboard_device::p1_r )
333WRITE8_MEMBER( ibm_pc_xt_83_keyboard_device::p1_w )
347334{
348335   /*
349336   
350337       bit     description
351338   
352       0       -REQ IN
353       1       DATA IN
339       0       
340       1       
354341       2       
355342       3       
356343       4       
r23864r23865
359346       7       
360347   
361348   */
362   
363   UINT8 data = 0;
364349
365   data |= clock_signal();
366   data |= data_signal() << 1;
367
368   return data;
350   m_p1 = data;
369351}
370352
371353
r23864r23865
379361   
380362       bit     description
381363   
382       0       -MATRIX STROBE
383       1       CLOCK OUT
384       2       DATA OUT
364       0       SENSE 0
365       1       SENSE 1
366       2       SENSE 2
385367       3       
386368       4       
387369       5       
r23864r23865
390372   
391373   */
392374
393   m_pc_kbdc->clock_write_from_kb(BIT(data, 1));
394   m_pc_kbdc->data_write_from_kb(BIT(data, 2));
375   m_p2 = data;
395376}
396377
397378
398379//-------------------------------------------------
380//  t0_r -
381//-------------------------------------------------
382
383READ8_MEMBER( ibm_pc_xt_83_keyboard_device::t0_r )
384{
385   return data_signal();
386}
387
388
389//-------------------------------------------------
399390//  t1_r -
400391//-------------------------------------------------
401392
r23864r23865
403394{
404395   UINT8 data = 0xff;
405396
406   switch (m_cnt >> 2)
407   {
408   case  0: data = m_dr00->read(); break;
409   case  1: data = m_dr01->read(); break;
410   case  2: data = m_dr02->read(); break;
411   case  3: data = m_dr03->read(); break;
412   case  4: data = m_dr04->read(); break;
413   case  5: data = m_dr05->read(); break;
414   case  6: data = m_dr06->read(); break;
415   case  7: data = m_dr07->read(); break;
416   case  8: data = m_dr08->read(); break;
417   case  9: data = m_dr09->read(); break;
418   case 10: data = m_dr10->read(); break;
419   case 11: data = m_dr11->read(); break;
420   case 12: data = m_dr12->read(); break;
421   case 13: data = m_dr13->read(); break;
422   case 14: data = m_dr14->read(); break;
423   case 15: data = m_dr15->read(); break;
424   case 16: data = m_dr16->read(); break;
425   case 17: data = m_dr17->read(); break;
426   case 18: data = m_dr18->read(); break;
427   case 19: data = m_dr19->read(); break;
428   case 20: data = m_dr20->read(); break;
429   case 21: data = m_dr21->read(); break;
430   case 22: data = m_dr22->read(); break;
431   case 23: data = m_dr23->read(); break;
432   }
397   if (BIT(m_p1, 0)) data &= m_p10->read();
398   if (BIT(m_p1, 1)) data &= m_p11->read();
399   if (BIT(m_p1, 2)) data &= m_p12->read();
400   if (BIT(m_p1, 3)) data &= m_p13->read();
401   if (BIT(m_p1, 4)) data &= m_p14->read();
402   if (BIT(m_p1, 5)) data &= m_p15->read();
403   if (BIT(m_p1, 6)) data &= m_p16->read();
404   if (BIT(m_p1, 7)) data &= m_p17->read();
405   if (BIT(m_p2, 3)) data &= m_p23->read();
406   if (BIT(m_p2, 4)) data &= m_p24->read();
407   if (BIT(m_p2, 5)) data &= m_p25->read();
408   if (BIT(m_p2, 6)) data &= m_p26->read();
409   if (BIT(m_p2, 7)) data &= m_p27->read();
433410
434   int sense = m_cnt & 0x03;
435
436   return BIT(data, sense);
411   return BIT(data, m_sense);
437412}
trunk/src/mess/machine/kb_pcxt83.h
r23864r23865
3838   virtual ioport_constructor device_input_ports() const;
3939
4040   DECLARE_WRITE8_MEMBER( bus_w );
41   DECLARE_READ8_MEMBER( p1_r );
41   DECLARE_WRITE8_MEMBER( p1_w );
4242   DECLARE_WRITE8_MEMBER( p2_w );
43   DECLARE_READ8_MEMBER( t0_r );
4344   DECLARE_READ8_MEMBER( t1_r );
4445
4546protected:
r23864r23865
4849   virtual void device_reset();
4950
5051   // device_pc_kbd_interface overrides
51   virtual DECLARE_WRITE_LINE_MEMBER( clock_write ) { };
52   virtual DECLARE_WRITE_LINE_MEMBER( clock_write ) { m_maincpu->set_input_line(INPUT_LINE_IRQ0, !state); };
5253   virtual DECLARE_WRITE_LINE_MEMBER( data_write ) { };
5354
5455private:
5556   required_device<cpu_device> m_maincpu;
56   required_ioport m_dr00;
57   required_ioport m_dr01;
58   required_ioport m_dr02;
59   required_ioport m_dr03;
60   required_ioport m_dr04;
61   required_ioport m_dr05;
62   required_ioport m_dr06;
63   required_ioport m_dr07;
64   required_ioport m_dr08;
65   required_ioport m_dr09;
66   required_ioport m_dr10;
67   required_ioport m_dr11;
68   required_ioport m_dr12;
69   required_ioport m_dr13;
70   required_ioport m_dr14;
71   required_ioport m_dr15;
72   required_ioport m_dr16;
73   required_ioport m_dr17;
74   required_ioport m_dr18;
75   required_ioport m_dr19;
76   required_ioport m_dr20;
77   required_ioport m_dr21;
78   required_ioport m_dr22;
79   required_ioport m_dr23;
57   required_ioport m_p10;
58   required_ioport m_p11;
59   required_ioport m_p12;
60   required_ioport m_p13;
61   required_ioport m_p14;
62   required_ioport m_p15;
63   required_ioport m_p16;
64   required_ioport m_p17;
65   required_ioport m_p23;
66   required_ioport m_p24;
67   required_ioport m_p25;
68   required_ioport m_p26;
69   required_ioport m_p27;
8070
81   UINT8 m_cnt;
71   UINT8 m_p1;
72   UINT8 m_p2;
73   int m_sense;
8274};
8375
8476

Previous 199869 Revisions Next


© 1997-2024 The MAME Team