Previous 199869 Revisions Next

r32267 Sunday 21st September, 2014 at 22:50:23 UTC by hap
ioport_array here too
[src/mame/drivers]namcos23.c

trunk/src/mame/drivers/namcos23.c
r32266r32267
13761376      m_p2(*this, "P2"),
13771377      m_screen(*this, "screen"),
13781378      m_palette(*this, "palette"),
1379      m_generic_paletteram_32(*this, "paletteram")
1379      m_generic_paletteram_32(*this, "paletteram"),
1380      m_adc_inp(*this, "ADC")
13801381   { }
13811382
13821383   required_device<mips3_device> m_maincpu;
r32266r32267
14011402   required_device<screen_device> m_screen;
14021403   required_device<palette_device> m_palette;
14031404   required_shared_ptr<UINT32> m_generic_paletteram_32;
1405   optional_ioport_array<4> m_adc_inp;
14041406
14051407   c404_t m_c404;
14061408   c361_t m_c361;
r32266r32267
29602962
29612963READ16_MEMBER(namcos23_state::iob_analog_r)
29622964{
2963   static const char *const portnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
2964   return ioport(portnames[offset >> 1 & 3])->read_safe(0);
2965   return m_adc_inp[offset & 3]->read_safe(0);
29652966}
29662967
29672968
r32266r32267
31063107   PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "DIP:1" ) PORT_NAME("User Service Mode")
31073108
31083109#if 0 // need to hook these up properly
3109   PORT_START("ADC0")
3110   PORT_START("ADC.0")
31103111   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC0") // rear r
3111   PORT_START("ADC1")
3112   PORT_START("ADC.1")
31123113   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC1") // rear l
3113   PORT_START("ADC2")
3114   PORT_START("ADC.2")
31143115   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC2") // front r
3115   PORT_START("ADC3")
3116   PORT_START("ADC.3")
31163117   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC3") // front l
31173118#endif
31183119INPUT_PORTS_END
r32266r32267
31263127   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
31273128
31283129#if 0 // need to hook these up properly
3129   PORT_START("ADC0")
3130   PORT_START("ADC.0")
31303131   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC0")
3131   PORT_START("ADC1")
3132   PORT_START("ADC.1")
31323133   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC1")
3133   PORT_START("ADC2")
3134   PORT_START("ADC.2")
31343135   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC2")
3135   PORT_START("ADC3")
3136   PORT_START("ADC.3")
31363137   PORT_BIT( 0xffff, 0x8000, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100) PORT_NAME("ADC3")
31373138#endif
31383139INPUT_PORTS_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team