Previous 199869 Revisions Next

r32342 Wednesday 24th September, 2014 at 05:17:48 UTC by Alex Jackson
Add friendly macros to initialize an ioport_array_finder with an array of port names. Update namcona1.c, segaorun.c and segaybd.c to use them. Remove runtime ioport tag lookups from a few other drivers (nw)
[src/emu]devfind.h
[src/mame/drivers]bladestl.c namcona1.c segaorun.c segaybd.c tatsumi.c zaccaria.c zaxxon.c
[src/mame/includes]bladestl.h namcona1.h segaorun.h segaybd.h tatsumi.h zaccaria.h zaxxon.h

trunk/src/mame/drivers/tatsumi.c
r32341r32342
180180   COMBINE_DATA(&m_bigfight_a60000[offset]);
181181}
182182
183READ16_MEMBER(tatsumi_state::cyclwarr_input_r)
184{
185   static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
186   return ioport(port[offset])->read();
187}
188
189READ16_MEMBER(tatsumi_state::cyclwarr_input2_r)
190{
191   static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
192   return ioport(port2[offset])->read();
193}
194
195183WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w)
196184{
197185   soundlatch_byte_w(space, 0, data >> 8);
r32341r32342
297285   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
298286
299287   AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
300   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
301   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
288   AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
289   AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
290   AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
291   AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
292   AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
293   AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
294   AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
295   AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
302296   AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
303297   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_SHARE("spriteram")
304298   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_SHARE("sprite_ctlram")
r32341r32342
317311   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
318312   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
319313
320   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
321   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
314   AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
315   AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
316   AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
317   AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
318   AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
319   AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
320   AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
321   AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
322322   AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
323
324323   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
325324   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
326325   AM_RANGE(0x0d0000, 0x0d3fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
r32341r32342
353352   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
354353
355354   AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
356   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
357   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
355   AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
356   AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
357   AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
358   AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
359   AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
360   AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
361   AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
362   AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
358363   AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
359364   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_SHARE("spriteram")
360365   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_SHARE("sprite_ctlram")
r32341r32342
371376   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
372377   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
373378
374   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
375   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
379   AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
380   AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
381   AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
382   AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
383   AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
384   AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
385   AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
386   AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
376387   AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
377
378388   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
379389   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
380390   AM_RANGE(0x0d0000, 0x0d3fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
r32341r32342
791801
792802/******************************************************************************/
793803
794static const gfx_layout roundup5_charlayout =
804static const gfx_layout spritelayout =
795805{
796   8,8,    /* 16*16 sprites */
797   RGN_FRAC(1,1),  /* 4096 sprites */
798   4,  /* 4 bits per pixel */
806   8,8,
807   RGN_FRAC(1,1),
808   4,
799809   { 0, 1, 2, 3 },
800810   { 8,12,0,4, 24,28, 16,20},
801811   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
802   32*8    /* every sprite takes 32 consecutive bytes */
812   32*8
803813};
804814
805static const gfx_layout cyclwarr_charlayout =
806{
807   8,8,
808   RGN_FRAC(1,3),
809   3,
810   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3)},
811   { 0, 1, 2, 3, 4, 5, 6, 7},
812   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
813   8*8
814};
815
816815static const gfx_layout roundup5_vramlayout =
817816{
818817   8,8,
r32341r32342
825824};
826825
827826static GFXDECODE_START( apache3 )
828   GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 1024, 128)
829   GFXDECODE_ENTRY( "gfx4", 0, cyclwarr_charlayout, 768, 16)
827   GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 1024, 128)
828   GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x3_planar, 768, 16)
830829GFXDECODE_END
831830
832831static GFXDECODE_START( roundup5 )
833   GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 1024, 256)
832   GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 1024, 256)
834833   GFXDECODE_ENTRY( NULL, 0, roundup5_vramlayout, 0, 16)
835834GFXDECODE_END
836835
837836static GFXDECODE_START( cyclwarr )
838   GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 8192, 512)
839   GFXDECODE_ENTRY( "gfx5", 0, cyclwarr_charlayout, 0, 512)
837   GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 8192, 512)
838   GFXDECODE_ENTRY( "gfx5", 0, gfx_8x8x3_planar, 0, 512)
840839GFXDECODE_END
841840
842841/******************************************************************************/
trunk/src/mame/drivers/zaccaria.c
r32341r32342
5353   switch (data & 0xf0)
5454   {
5555      case 0xe0:
56         m_dsw = 0;
56         m_dsw_sel = 0;
5757         break;
5858
5959      case 0xd0:
60         m_dsw = 1;
60         m_dsw_sel = 1;
6161         break;
6262
6363      case 0xb0:
64         m_dsw = 2;
64         m_dsw_sel = 2;
6565         break;
6666
6767      default:
r32341r32342
7272
7373READ8_MEMBER(zaccaria_state::zaccaria_dsw_r)
7474{
75   static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
76
77   return ioport(dswnames[m_dsw])->read();
75   return m_dsw_port[m_dsw_sel]->read();
7876}
7977
8078
r32341r32342
336334}
337335
338336static INPUT_PORTS_START( monymony )
339   PORT_START("IN0")
337   PORT_START("DSW.0")
340338   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW 5I:1,2")
341339   PORT_DIPSETTING(    0x00, "2" )
342340   PORT_DIPSETTING(    0x01, "3" )
r32341r32342
361359   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
362360   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
363361
364   PORT_START("DSW0")
362   PORT_START("DSW.1")
365363   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )       PORT_DIPLOCATION("SW 4I:1,2")
366364   PORT_DIPSETTING(    0x01, "200000" )
367365   PORT_DIPSETTING(    0x02, "300000" )
r32341r32342
384382   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
385383   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )                    PORT_DIPLOCATION("SW 4I:8")
386384
387   PORT_START("DSW1")
385   PORT_START("DSW.2")
388386   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_A ) )           PORT_DIPLOCATION("SW 3I:1,2")
389387   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
390388   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
r32341r32342
447445static INPUT_PORTS_START( jackrabt )
448446   PORT_INCLUDE( monymony )
449447
450   PORT_MODIFY("IN0")
448   PORT_MODIFY("DSW.0")
451449   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW 5I:4")
452450   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
453451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
454452
455   PORT_MODIFY("DSW0")
453   PORT_MODIFY("DSW.1")
456454   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )          PORT_DIPLOCATION("SW 4I:1")
457455   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
458456   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r32341r32342
477475INPUT_PORTS_END
478476
479477
480
481static const gfx_layout charlayout =
482{
483   8,8,
484   RGN_FRAC(1,3),
485   3,
486   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
487   { 0, 1, 2, 3, 4, 5, 6, 7 },
488   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
489   8*8
490};
491
492478static const gfx_layout spritelayout =
493479{
494480   16,16,
r32341r32342
503489};
504490
505491static GFXDECODE_START( zaccaria )
506   GFXDECODE_ENTRY( "gfx1", 0, charlayout,      0, 32 )
492   GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 )
507493   GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 32*8, 32 )
508494GFXDECODE_END
509495
trunk/src/mame/drivers/segaorun.c
r32341r32342
679679//  for Out Run
680680//-------------------------------------------------
681681
682IOPORT_ARRAY_MEMBER( segaorun_state::digital_ports ) { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
683
682684READ16_MEMBER( segaorun_state::outrun_custom_io_r )
683685{
684686   offset &= 0x7f/2;
r32341r32342
689691
690692      case 0x10/2:
691693      {
692         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
693         return ioport(sysports[offset & 3])->read();
694         return m_digital_ports[offset & 3]->read();
694695      }
695696
696697      case 0x30/2:
697698      {
698         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
699         return ioport(ports[m_adc_select])->read_safe(0x0010);
699         return m_adc_ports[m_adc_select]->read_safe(0x0010);
700700      }
701701
702702      case 0x60/2:
r32341r32342
777777      case 0x1004/2:
778778      case 0x1006/2:
779779      {
780         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
781         return ioport(sysports[offset & 3])->read();
780         return m_digital_ports[offset & 3]->read();
782781      }
783782
784783      case 0x3020/2:
785784      {
786         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
787         return ioport(ports[m_adc_select])->read_safe(0x0010);
785         return m_adc_ports[m_adc_select]->read_safe(0x0010);
788786      }
789787
790788      default:
r32341r32342
981979   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
982980   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
983981
984   PORT_START("ADC0")  // steering
982   PORT_START("ADC.0")  // steering
985983   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
986984
987   PORT_START("ADC1")  // gas pedal
985   PORT_START("ADC.1")  // gas pedal
988986   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
989987
990   PORT_START("ADC2")  // brake
988   PORT_START("ADC.2")  // brake
991989   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
992990
993   PORT_START("ADC3")
991   PORT_START("ADC.3")
994992   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segaorun_state, bankmotor_pos_r, NULL)
995993INPUT_PORTS_END
996994
r32341r32342
11211119   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:7" )
11221120   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWB:8" )
11231121
1124   PORT_MODIFY("ADC0") // steering
1122   PORT_MODIFY("ADC.0") // steering
11251123   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
11261124
1127   PORT_MODIFY("ADC3")
1125   PORT_MODIFY("ADC.3")
11281126   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
11291127INPUT_PORTS_END
11301128
trunk/src/mame/drivers/namcona1.c
r32341r32342
660660   m_mcu_port6 = data;
661661}
662662
663const char * const namcona1_state::ioport_tags[] = { "P4", "DSW", "P1", "P2" };
663IOPORT_ARRAY_MEMBER(namcona1_state::muxed_inputs) { "P4", "DSW", "P1", "P2" };
664664
665665READ8_MEMBER(namcona1_state::port7_r)
666666{
667667   if ((m_mcu_port6 & 0x80) == 0)
668      return m_ioport[m_mcu_port6 >> 5]->read();
668      return m_muxed_inputs[m_mcu_port6 >> 5]->read();
669669   else
670670      return 0xff;
671671}
trunk/src/mame/drivers/zaxxon.c
r32341r32342
347347
348348CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r)
349349{
350   static const char *const dialname[2] = { "DIAL0", "DIAL1" };
351350   int num = (FPTR)param;
352   int delta, res;
351   int res;
353352
354   delta = ioport(dialname[num])->read();
353   int delta = m_dials[num]->read();
355354
356355   if (delta < 0x80)
357356   {
r32341r32342
689688   PORT_START("SW00")
690689   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
691690
692   PORT_START("DIAL0")
691   PORT_START("DIAL.0")
693692   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(1)
694693
695694   PORT_START("SW01")
r32341r32342
704703   PORT_START("SW08")
705704   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)1)
706705
707   PORT_START("DIAL1")
706   PORT_START("DIAL.1")
708707   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(2)
709708
710709   PORT_START("SW0C")
r32341r32342
782781   PORT_MODIFY("SW00")
783782   PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
784783
785   PORT_START("DIAL0")
784   PORT_START("DIAL.0")
786785   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_RESET
787786
788787   PORT_MODIFY("SW01")
trunk/src/mame/drivers/bladestl.c
r32341r32342
5050 *  Memory handlers
5151 *
5252 *************************************/
53const char * const bladestl_state::trackball_tags[] =
54   { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P2_2" };
5553
5654READ8_MEMBER(bladestl_state::trackball_r)
5755{
r32341r32342
205203   PORT_START("P2")
206204   KONAMI8_B123_UNK(2)
207205
208   PORT_START("TRACKBALL_P1_1")
206   PORT_START("TRACKBALL.0")
209207   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(1)
210208
211   PORT_START("TRACKBALL_P1_2")
209   PORT_START("TRACKBALL.1")
212210   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(1)
213211
214   PORT_START("TRACKBALL_P2_1")
212   PORT_START("TRACKBALL.2")
215213   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(2)
216214
217   PORT_START("TRACKBALL_P2_2")
215   PORT_START("TRACKBALL.3")
218216   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
219217INPUT_PORTS_END
220218
r32341r32342
228226   PORT_MODIFY("P1")
229227   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:4" )    /* Listed as "Unused" */
230228
231   PORT_MODIFY("TRACKBALL_P2_1")
229   PORT_MODIFY("TRACKBALL.2")
232230   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
233231
234   PORT_MODIFY("TRACKBALL_P2_2")
232   PORT_MODIFY("TRACKBALL.3")
235233   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
236234INPUT_PORTS_END
237235
trunk/src/mame/drivers/segaybd.c
r32341r32342
108108
109109WRITE16_MEMBER( segaybd_state::analog_w )
110110{
111   static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
112111   int selected = ((offset & 3) == 3) ? (3 + (m_misc_io_data[0x08/2] & 3)) : (offset & 3);
113   m_analog_data[offset & 3] = ioport(ports[selected])->read_safe(0xff);
112   m_analog_data[offset & 3] = m_adc_ports[selected]->read_safe(0xff);
114113}
115114
116115
r32341r32342
118117//  io_chip_r - handle reads from the I/O chip
119118//-------------------------------------------------
120119
120IOPORT_ARRAY_MEMBER( segaybd_state::digital_ports )
121{ "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
122
121123READ16_MEMBER( segaybd_state::io_chip_r )
122124{
123   static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
124125   offset &= 0x1f/2;
125126
126127   switch (offset)
r32341r32342
139140            return m_misc_io_data[offset];
140141
141142         // otherwise, return an input port
142         return ioport(portnames[offset])->read();
143         return m_digital_ports[offset]->read();
143144
144145      // 'SEGA' protection
145146      case 0x10/2:
r32341r32342
893894   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
894895   PORT_DIPSETTING(    0x00, "City" )
895896
896   PORT_START("ADC0")  // stick X
897   PORT_START("ADC.0")  // stick X
897898   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
898899
899   PORT_START("ADC1")  // stick Y
900   PORT_START("ADC.1")  // stick Y
900901   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
901902
902   PORT_START("ADC2")  // throttle
903   PORT_START("ADC.2")  // throttle
903904   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
904905INPUT_PORTS_END
905906
r32341r32342
935936   PORT_DIPSETTING(    0x80, "3 to Start, 2 to Continue" )
936937   PORT_DIPSETTING(    0x00, "4 to Start, 3 to Continue" )
937938
938   PORT_START("ADC3")  // stick Y
939   PORT_START("ADC.3")  // stick Y
939940   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x40,0xc0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
940941
941   PORT_START("ADC4")  // throttle
942   PORT_START("ADC.4")  // throttle
942943   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
943944
944   PORT_START("ADC5")  // stick X
945   PORT_START("ADC.5")  // stick X
945946   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
946947INPUT_PORTS_END
947948
r32341r32342
10201021   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
10211022   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
10221023
1023   PORT_START("ADC0")  // moving pitch
1024   PORT_START("ADC.0")  // moving pitch
10241025   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2)
10251026
1026   PORT_START("ADC2")  // moving roll
1027   PORT_START("ADC.2")  // moving roll
10271028   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(3)
10281029
1029   PORT_START("ADC3")  // stick Y
1030   PORT_START("ADC.3")  // stick Y
10301031   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
10311032
1032   PORT_START("ADC5")  // stick X
1033   PORT_START("ADC.5")  // stick X
10331034   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
10341035INPUT_PORTS_END
10351036
r32341r32342
10631064   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
10641065   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
10651066
1066   PORT_START("ADC3")  // brake
1067   PORT_START("ADC.3")  // brake
10671068   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
10681069
1069   PORT_START("ADC4")  // gas pedal
1070   PORT_START("ADC.4")  // gas pedal
10701071   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
10711072
1072   PORT_START("ADC5")  // steering
1073   PORT_START("ADC.5")  // steering
10731074   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
10741075INPUT_PORTS_END
10751076
r32341r32342
12681269   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12691270   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12701271
1271   PORT_START("ADC0")
1272   PORT_START("ADC.0")
12721273   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
12731274
1274   PORT_START("ADC1")
1275   PORT_START("ADC.1")
12751276   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
12761277
1277   PORT_START("ADC2")
1278   PORT_START("ADC.2")
12781279   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
12791280
1280   PORT_START("ADC3")
1281   PORT_START("ADC.3")
12811282   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
12821283INPUT_PORTS_END
12831284
trunk/src/mame/includes/segaorun.h
r32341r32342
3434      m_segaic16vid(*this, "segaic16vid"),
3535      m_segaic16road(*this, "segaic16road"),
3636      m_bankmotor_timer(*this, "bankmotor"),
37      m_digital_ports(*this, digital_ports),
38      m_adc_ports(*this, "ADC"),
3739      m_workram(*this, "workram"),
3840      m_custom_map(NULL),
3941      m_shangon_video(false),
r32341r32342
122124   required_device<segaic16_road_device> m_segaic16road;
123125   optional_device<timer_device> m_bankmotor_timer;
124126
127   // input ports
128   DECLARE_IOPORT_ARRAY(digital_ports);
129   required_ioport_array<4> m_digital_ports;
130   optional_ioport_array<8> m_adc_ports;
131
125132   // memory
126133   required_shared_ptr<UINT16> m_workram;
127134
trunk/src/mame/includes/namcona1.h
r32341r32342
2525
2626class namcona1_state : public driver_device
2727{
28   static const char * const ioport_tags[];
2928public:
3029   namcona1_state(const machine_config &mconfig, device_type type, const char *tag)
3130      : driver_device(mconfig, type, tag),
r32341r32342
3534      m_screen(*this, "screen"),
3635      m_palette(*this, "palette"),
3736      m_c140(*this, "c140"),
38      m_ioport(*this, ioport_tags),
37      m_muxed_inputs(*this, muxed_inputs),
3938      m_io_p3(*this, "P3"),
4039      m_workram(*this,"workram"),
4140      m_vreg(*this,"vreg"),
r32341r32342
5251   required_device<screen_device> m_screen;
5352   required_device<palette_device> m_palette;
5453   required_device<c140_device> m_c140;
55   required_ioport_array<4> m_ioport;
54
55   DECLARE_IOPORT_ARRAY(muxed_inputs);
56   required_ioport_array<4> m_muxed_inputs;
5657   required_ioport          m_io_p3;
58
5759   required_shared_ptr<UINT16> m_workram;
5860   required_shared_ptr<UINT16> m_vreg;
5961   required_shared_ptr<UINT16> m_paletteram;
trunk/src/mame/includes/segaybd.h
r32341r32342
2929         m_bsprites(*this, "bsprites"),
3030         m_ysprites(*this, "ysprites"),
3131         m_segaic16vid(*this, "segaic16vid"),
32         m_digital_ports(*this, digital_ports),
33         m_adc_ports(*this, "ADC"),
3234         m_pdrift_bank(0),
3335         m_scanline_timer(NULL),
3436         m_irq2_scanline(0),
r32341r32342
110112   required_device<sega_yboard_sprite_device> m_ysprites;
111113   required_device<segaic16_video_device> m_segaic16vid;
112114
115   // input ports
116   DECLARE_IOPORT_ARRAY(digital_ports);
117   required_ioport_array<8> m_digital_ports;
118   optional_ioport_array<6> m_adc_ports;
119
113120   // configuration
114121   output_delegate m_output_cb1;
115122   output_delegate m_output_cb2;
trunk/src/mame/includes/zaxxon.h
r32341r32342
1010public:
1111   zaxxon_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_videoram(*this, "videoram"),
14      m_spriteram(*this, "spriteram"),
15      m_colorram(*this, "colorram"),
1613      m_maincpu(*this, "maincpu"),
1714      m_samples(*this, "samples"),
1815      m_gfxdecode(*this, "gfxdecode"),
19      m_palette(*this, "palette") { }
16      m_palette(*this, "palette"),
17      m_dials(*this, "DIAL"),
18      m_videoram(*this, "videoram"),
19      m_spriteram(*this, "spriteram"),
20      m_colorram(*this, "colorram") { }
2021
22   required_device<cpu_device> m_maincpu;
23   optional_device<samples_device> m_samples;
24   required_device<gfxdecode_device> m_gfxdecode;
25   required_device<palette_device> m_palette;
26
27   optional_ioport_array<2> m_dials;
28
2129   required_shared_ptr<UINT8> m_videoram;
2230   optional_shared_ptr<UINT8> m_spriteram;
2331   optional_shared_ptr<UINT8> m_colorram;
r32341r32342
8997   inline int find_minimum_x(UINT8 value, int flip);
9098   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask);
9199   void zaxxonj_decode(const char *cputag);
92   required_device<cpu_device> m_maincpu;
93   optional_device<samples_device> m_samples;
94   required_device<gfxdecode_device> m_gfxdecode;
95   required_device<palette_device> m_palette;
96100};
97101
98102
trunk/src/mame/includes/zaccaria.h
r32341r32342
1414      m_audio2(*this, "audio2"),
1515      m_dac2(*this, "dac2"),
1616      m_gfxdecode(*this, "gfxdecode"),
17      m_palette(*this, "palette")  { }
17      m_palette(*this, "palette"),
18      m_dsw_port(*this, "DSW") { }
1819
19   int m_dsw;
20   int m_dsw_sel;
2021   int m_active_8910;
2122   int m_port0a;
2223   int m_acs;
r32341r32342
6263   required_device<dac_device> m_dac2;
6364   required_device<gfxdecode_device> m_gfxdecode;
6465   required_device<palette_device> m_palette;
66   required_ioport_array<3> m_dsw_port;
6567};
trunk/src/mame/includes/tatsumi.h
r32341r32342
8181   DECLARE_WRITE16_MEMBER(bigfight_a20000_w);
8282   DECLARE_WRITE16_MEMBER(bigfight_a40000_w);
8383   DECLARE_WRITE16_MEMBER(bigfight_a60000_w);
84   DECLARE_READ16_MEMBER(cyclwarr_input_r);
85   DECLARE_READ16_MEMBER(cyclwarr_input2_r);
8684   DECLARE_WRITE16_MEMBER(cyclwarr_sound_w);
8785   DECLARE_READ16_MEMBER(apache3_bank_r);
8886   DECLARE_WRITE16_MEMBER(apache3_bank_w);
trunk/src/mame/includes/bladestl.h
r32341r32342
1111
1212class bladestl_state : public driver_device
1313{
14   static const char * const trackball_tags[];
1514public:
1615   bladestl_state(const machine_config &mconfig, device_type type, const char *tag)
1716      : driver_device(mconfig, type, tag),
r32341r32342
2524      m_filter2(*this, "filter2"),
2625      m_filter3(*this, "filter3"),
2726      m_gfxdecode(*this, "gfxdecode"),
28      m_trackball(*this, trackball_tags),
27      m_trackball(*this, "TRACKBALL"),
2928      m_rombank(*this, "rombank") { }
3029
3130   required_device<cpu_device> m_maincpu;
trunk/src/emu/devfind.h
r32341r32342
2020#define FINDER_DUMMY_TAG "finder_dummy_tag"
2121
2222//**************************************************************************
23//  IOPORT ARRAY MACROS
24//**************************************************************************
25
26// these macros can be used to initialize an ioport_array with
27// individual port names, instead of a base name + numeric suffix
28
29#define IOPORT_ARRAY_MEMBER(name) const char * const name[] =
30#define DECLARE_IOPORT_ARRAY(name) static const char * const name[]
31
32//**************************************************************************
2333//  TYPE DEFINITIONS
2434//**************************************************************************
2535

Previous 199869 Revisions Next


© 1997-2024 The MAME Team