Previous 199869 Revisions Next

r20477 Friday 25th January, 2013 at 22:18:59 UTC by Wilbert Pol
(MESS) kb_msnat.c: Reduce tagmap lookups (nw)
[src/mess/machine]kb_msnat.c kb_msnat.h

trunk/src/mess/machine/kb_msnat.c
r20476r20477
226226ROM_END
227227
228228
229pc_kbd_microsoft_natural_device::pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
230   device_t(mconfig, PC_KBD_MICROSOFT_NATURAL, "Microsoft Natural Keyboard", tag, owner, clock ),
231   device_pc_kbd_interface(mconfig, *this),
232   m_cpu(*this, "ms_natrl_cpu")
229pc_kbd_microsoft_natural_device::pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
230   : device_t(mconfig, PC_KBD_MICROSOFT_NATURAL, "Microsoft Natural Keyboard", tag, owner, clock )
231   , device_pc_kbd_interface(mconfig, *this)
232   , m_cpu(*this, "ms_natrl_cpu")
233   , m_p2_0(*this, "P2.0")
234   , m_p2_1(*this, "P2.1")
235   , m_p2_2(*this, "P2.2")
236   , m_p2_3(*this, "P2.3")
237   , m_p2_4(*this, "P2.4")
238   , m_p2_5(*this, "P2.5")
239   , m_p2_6(*this, "P2.6")
240   , m_p2_7(*this, "P2.7")
241   , m_p1_0(*this, "P1.0")
242   , m_p1_1(*this, "P1.1")
243   , m_p1_2(*this, "P1.2")
244   , m_p1_3(*this, "P1.3")
245   , m_p1_4(*this, "P1.4")
246   , m_p1_5(*this, "P1.5")
247   , m_p1_6(*this, "P1.6")
248   , m_p1_7(*this, "P1.7")
233249{
234250   m_shortname = "ms_natural";
235251}
r20476r20477
305321
306322   if ( ! ( m_p2 & 0x01 ) )
307323   {
308      data &= ioport( "P2.0" )->read();
324      data &= m_p2_0->read();
309325   }
310326
311327   if ( ! ( m_p2 & 0x02 ) )
312328   {
313      data &= ioport( "P2.1" )->read();
329      data &= m_p2_1->read();
314330   }
315331
316332   if ( ! ( m_p2 & 0x04 ) )
317333   {
318      data &= ioport( "P2.2" )->read();
334      data &= m_p2_2->read();
319335   }
320336
321337   if ( ! ( m_p2 & 0x08 ) )
322338   {
323      data &= ioport( "P2.3" )->read();
339      data &= m_p2_3->read();
324340   }
325341
326342   if ( ! ( m_p2 & 0x10 ) )
327343   {
328      data &= ioport( "P2.4" )->read();
344      data &= m_p2_4->read();
329345   }
330346
331347   if ( ! ( m_p2 & 0x20 ) )
332348   {
333      data &= ioport( "P2.5" )->read();
349      data &= m_p2_5->read();
334350   }
335351
336352   if ( ! ( m_p2 & 0x40 ) )
337353   {
338      data &= ioport( "P2.6" )->read();
354      data &= m_p2_6->read();
339355   }
340356
341357   if ( ! ( m_p2 & 0x80 ) )
342358   {
343      data &= ioport( "P2.7" )->read();
359      data &= m_p2_7->read();
344360   }
345361
346362   if ( ! ( m_p1 & 0x01 ) )
347363   {
348      data &= ioport( "P1.0" )->read();
364      data &= m_p1_0->read();
349365   }
350366
351367   if ( ! ( m_p1 & 0x02 ) )
352368   {
353      data &= ioport( "P1.1" )->read();
369      data &= m_p1_1->read();
354370   }
355371
356372   if ( ! ( m_p1 & 0x04 ) )
357373   {
358      data &= ioport( "P1.2" )->read();
374      data &= m_p1_2->read();
359375   }
360376
361377   if ( ! ( m_p1 & 0x08 ) )
362378   {
363      data &= ioport( "P1.3" )->read();
379      data &= m_p1_3->read();
364380   }
365381
366382   if ( ! ( m_p1 & 0x10 ) )
367383   {
368      data &= ioport( "P1.4" )->read();
384      data &= m_p1_4->read();
369385   }
370386
371387   if ( ! ( m_p1 & 0x20 ) )
372388   {
373      data &= ioport( "P1.5" )->read();
389      data &= m_p1_5->read();
374390   }
375391
376392   if ( ! ( m_p1 & 0x40 ) )
377393   {
378      data &= ioport( "P1.6" )->read();
394      data &= m_p1_6->read();
379395   }
380396
381397   if ( ! ( m_p1 & 0x80 ) )
382398   {
383      data &= ioport( "P1.7" )->read();
399      data &= m_p1_7->read();
384400   }
385401
386402   return data;
trunk/src/mess/machine/kb_msnat.h
r20476r20477
3939   DECLARE_WRITE8_MEMBER(p3_write);
4040
4141protected:
42   required_ioport m_p2_0;
43   required_ioport m_p2_1;
44   required_ioport m_p2_2;
45   required_ioport m_p2_3;
46   required_ioport m_p2_4;
47   required_ioport m_p2_5;
48   required_ioport m_p2_6;
49   required_ioport m_p2_7;
50   required_ioport m_p1_0;
51   required_ioport m_p1_1;
52   required_ioport m_p1_2;
53   required_ioport m_p1_3;
54   required_ioport m_p1_4;   
55   required_ioport m_p1_5;
56   required_ioport m_p1_6;
57   required_ioport m_p1_7;
58
4259   // device-level overrides
4360   virtual void device_start();
4461   virtual void device_reset();

Previous 199869 Revisions Next


© 1997-2024 The MAME Team