Previous 199869 Revisions Next

r32317 Tuesday 23rd September, 2014 at 17:34:47 UTC by hap
ioport array for outrun and sega-yboard
[src/mame/drivers]namcos22.c namcos23.c segaorun.c segaybd.c taitojc.c
[src/mame/includes]namcos22.h segaorun.h segaybd.h taitojc.h
[src/mame/layout]outrun.lay pdrift.lay

trunk/src/mame/includes/segaybd.h
r32316r32317
2121   // construction/destruction
2222   segaybd_state(const machine_config &mconfig, device_type type, const char *tag)
2323      : sega_16bit_common_base(mconfig, type, tag),
24         m_maincpu(*this, "maincpu"),
25         m_subx(*this, "subx"),
26         m_suby(*this, "suby"),
27         m_soundcpu(*this, "soundcpu"),
28         m_linkcpu(*this, "linkcpu"),
29         m_bsprites(*this, "bsprites"),
30         m_ysprites(*this, "ysprites"),
31         m_segaic16vid(*this, "segaic16vid"),
32         m_pdrift_bank(0),
33         m_scanline_timer(NULL),
34         m_irq2_scanline(0),
35         m_timer_irq_state(0),
36         m_vblank_irq_state(0),
37         m_tmp_bitmap(512, 512)
24      m_maincpu(*this, "maincpu"),
25      m_subx(*this, "subx"),
26      m_suby(*this, "suby"),
27      m_soundcpu(*this, "soundcpu"),
28      m_linkcpu(*this, "linkcpu"),
29      m_bsprites(*this, "bsprites"),
30      m_ysprites(*this, "ysprites"),
31      m_segaic16vid(*this, "segaic16vid"),
32      m_in_ports(*this, "IN"),
33      m_adc_ports(*this, "ADC"),
34      m_pdrift_bank(0),
35      m_scanline_timer(NULL),
36      m_irq2_scanline(0),
37      m_timer_irq_state(0),
38      m_vblank_irq_state(0),
39      m_tmp_bitmap(512, 512)
3840   {
3941      memset(m_analog_data, 0, sizeof(m_analog_data));
4042      memset(m_misc_io_data, 0, sizeof(m_misc_io_data));
r32316r32317
110112   required_device<sega_yboard_sprite_device> m_ysprites;
111113   required_device<segaic16_video_device> m_segaic16vid;
112114
115   // input ports
116   required_ioport_array<8> m_in_ports;
117   optional_ioport_array<6> m_adc_ports;
118
113119   // configuration
114120   output_delegate m_output_cb1;
115121   output_delegate m_output_cb2;
trunk/src/mame/includes/taitojc.h
r32316r32317
5353      m_gfxdecode(*this, "gfxdecode"),
5454      m_screen(*this, "screen"),
5555      m_palette(*this, "palette"),
56      m_analog_inp(*this, "AN")
56      m_analog_ports(*this, "AN")
5757   {
5858      m_mcu_output = 0;
5959      m_speed_meter = 0;
r32316r32317
7676   required_device<gfxdecode_device> m_gfxdecode;
7777   required_device<screen_device> m_screen;
7878   required_device<palette_device> m_palette;
79   optional_ioport_array<8> m_analog_inp;
79   optional_ioport_array<8> m_analog_ports;
8080
8181   taitojc_renderer *m_renderer;
8282
trunk/src/mame/includes/segaorun.h
r32316r32317
3535      m_segaic16road(*this, "segaic16road"),
3636      m_bankmotor_timer(*this, "bankmotor"),
3737      m_workram(*this, "workram"),
38      m_in_ports(*this, "IN"),
39      m_adc_ports(*this, "ADC"),
3840      m_custom_map(NULL),
3941      m_shangon_video(false),
4042      m_scanline_timer(NULL),
r32316r32317
125127   // memory
126128   required_shared_ptr<UINT16> m_workram;
127129
130   // input ports
131   required_ioport_array<4> m_in_ports;
132   optional_ioport_array<8> m_adc_ports;
133
128134   // configuration
129135   read16_delegate     m_custom_io_r;
130136   write16_delegate    m_custom_io_w;
trunk/src/mame/includes/namcos22.h
r32316r32317
200200      m_gfxdecode(*this, "gfxdecode"),
201201      m_screen(*this, "screen"),
202202      m_palette(*this, "palette"),
203      m_adc_inp(*this, "ADC")
203      m_adc_ports(*this, "ADC")
204204   { }
205205
206206   required_device<cpu_device> m_maincpu;
r32316r32317
229229   required_device<gfxdecode_device> m_gfxdecode;
230230   required_device<screen_device> m_screen;
231231   required_device<palette_device> m_palette;
232   optional_ioport_array<8> m_adc_inp;
232   optional_ioport_array<8> m_adc_ports;
233233
234234
235235   UINT8 m_syscontrol[0x20];
trunk/src/mame/layout/outrun.lay
r32316r32317
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
5454      </screen>
55      <bezel element="shifter" inputtag="SERVICE" inputmask="0x10">
55      <bezel element="shifter" inputtag="IN.0" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
5858      </bezel>
r32316r32317
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
6363      </screen>
64      <bezel element="shifter" inputtag="SERVICE" inputmask="0x10">
64      <bezel element="shifter" inputtag="IN.0" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
6767      </bezel>
trunk/src/mame/layout/pdrift.lay
r32316r32317
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
5454      </screen>
55      <bezel element="shifter" inputtag="GENERAL" inputmask="0x20">
55      <bezel element="shifter" inputtag="IN.1" inputmask="0x20">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
5858      </bezel>
r32316r32317
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
6363      </screen>
64      <bezel element="shifter" inputtag="GENERAL" inputmask="0x20">
64      <bezel element="shifter" inputtag="IN.1" inputmask="0x20">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
6767      </bezel>
trunk/src/mame/drivers/segaybd.c
r32316r32317
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
r32316r32317
120119
121120READ16_MEMBER( segaybd_state::io_chip_r )
122121{
123   static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
124122   offset &= 0x1f/2;
125123
126124   switch (offset)
r32316r32317
139137            return m_misc_io_data[offset];
140138
141139         // otherwise, return an input port
142         return ioport(portnames[offset])->read();
140         return m_in_ports[offset]->read();
143141
144142      // 'SEGA' protection
145143      case 0x10/2:
r32316r32317
818816//**************************************************************************
819817
820818static INPUT_PORTS_START( yboard_generic )
821   PORT_START("P1")
819   PORT_START("IN.0")
822820   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
823821
824   PORT_START("GENERAL")
822   PORT_START("IN.1")
825823   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    // afterburner (gloc)
826824   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
827825   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r32316r32317
831829   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
832830   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
833831
834   PORT_START("PORTC")
832   PORT_START("IN.2")
835833   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
836834
837   PORT_START("PORTD")
835   PORT_START("IN.3")
838836   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
839837
840   PORT_START("PORTE")
838   PORT_START("IN.4")
841839   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
842840
843   PORT_START("DSW")
841   PORT_START("IN.5")
844842   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SWB:1" )
845843   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SWB:2" )
846844   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SWB:3" )
r32316r32317
850848   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:7" )
851849   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWB:8" )
852850
853   PORT_START("COINAGE")
851   PORT_START("IN.6")
854852   SEGA_COINAGE_LOC(SWA)
855853
856   PORT_START("PORTH")
854   PORT_START("IN.7")
857855   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
858856INPUT_PORTS_END
859857
r32316r32317
866864static INPUT_PORTS_START( gforce2 )
867865   PORT_INCLUDE( yboard_generic )
868866
869   PORT_MODIFY("GENERAL")
867   PORT_MODIFY("IN.1")
870868   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Shoot")
871869   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile")
872870
873   PORT_MODIFY("DSW")
871   PORT_MODIFY("IN.5")
874872   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
875873   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
876874   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r32316r32317
893891   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
894892   PORT_DIPSETTING(    0x00, "City" )
895893
896   PORT_START("ADC0")  // stick X
894   PORT_START("ADC.0")  // stick X
897895   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
898896
899   PORT_START("ADC1")  // stick Y
897   PORT_START("ADC.1")  // stick Y
900898   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
901899
902   PORT_START("ADC2")  // throttle
900   PORT_START("ADC.2")  // throttle
903901   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
904902INPUT_PORTS_END
905903
r32316r32317
907905static INPUT_PORTS_START( gloc )
908906   PORT_INCLUDE( yboard_generic )
909907
910   PORT_MODIFY("GENERAL")
908   PORT_MODIFY("IN.1")
911909   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("After Burner")
912910   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Vulcan")
913911   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile")
914912
915   PORT_MODIFY("DSW")
913   PORT_MODIFY("IN.5")
916914   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:1,2")
917915   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
918916   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
r32316r32317
935933   PORT_DIPSETTING(    0x80, "3 to Start, 2 to Continue" )
936934   PORT_DIPSETTING(    0x00, "4 to Start, 3 to Continue" )
937935
938   PORT_START("ADC3")  // stick Y
936   PORT_START("ADC.3")  // stick Y
939937   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x40,0xc0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
940938
941   PORT_START("ADC4")  // throttle
939   PORT_START("ADC.4")  // throttle
942940   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
943941
944   PORT_START("ADC5")  // stick X
942   PORT_START("ADC.5")  // stick X
945943   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
946944INPUT_PORTS_END
947945
r32316r32317
949947static INPUT_PORTS_START( glocr360 )
950948   PORT_INCLUDE( yboard_generic )
951949
952   PORT_MODIFY("GENERAL")
950   PORT_MODIFY("IN.1")
953951   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("After Burner")
954952   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Vulcan")
955953   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile")
956954
957   PORT_MODIFY("DSW")
955   PORT_MODIFY("IN.5")
958956   PORT_DIPNAME( 0x03, 0x03, "Game Type" ) PORT_DIPLOCATION("SWB:1,2")
959957   PORT_DIPSETTING(    0x02, "Fighting Only" )
960958   PORT_DIPSETTING(    0x03, "Fight/Experience" )
r32316r32317
984982//  PORT_DIPSETTING(    0x50, "1" )
985983//  PORT_DIPSETTING(    0x60, "1" )
986984
987   PORT_MODIFY("COINAGE")
985   PORT_MODIFY("IN.6")
988986   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
989987//  PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
990988//  PORT_DIPSETTING(    0x05, DEF_STR( 1C_1C ) )
r32316r32317
10201018   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
10211019   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
10221020
1023   PORT_START("ADC0")  // moving pitch
1021   PORT_START("ADC.0")  // moving pitch
10241022   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2)
10251023
1026   PORT_START("ADC2")  // moving roll
1024   PORT_START("ADC.2")  // moving roll
10271025   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(3)
10281026
1029   PORT_START("ADC3")  // stick Y
1027   PORT_START("ADC.3")  // stick Y
10301028   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
10311029
1032   PORT_START("ADC5")  // stick X
1030   PORT_START("ADC.5")  // stick X
10331031   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
10341032INPUT_PORTS_END
10351033
r32316r32317
10371035static INPUT_PORTS_START( pdrift )
10381036   PORT_INCLUDE( yboard_generic )
10391037
1040   PORT_MODIFY("GENERAL")
1038   PORT_MODIFY("IN.1")
10411039   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Shift") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE
10421040
1043   PORT_MODIFY("DSW")
1041   PORT_MODIFY("IN.5")
10441042   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
10451043   PORT_DIPSETTING(    0x03, "Moving" )
10461044   PORT_DIPSETTING(    0x02, "Upright/Sit Down" )
r32316r32317
10631061   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
10641062   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
10651063
1066   PORT_START("ADC3")  // brake
1064   PORT_START("ADC.3")  // brake
10671065   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
10681066
1069   PORT_START("ADC4")  // gas pedal
1067   PORT_START("ADC.4")  // gas pedal
10701068   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
10711069
1072   PORT_START("ADC5")  // steering
1070   PORT_START("ADC.5")  // steering
10731071   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
10741072INPUT_PORTS_END
10751073
r32316r32317
10771075static INPUT_PORTS_START( pdrifte )
10781076   PORT_INCLUDE( pdrift )
10791077
1080   PORT_MODIFY("DSW")
1078   PORT_MODIFY("IN.5")
10811079   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
10821080   PORT_DIPSETTING(    0x03, "Moving" )
10831081   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
r32316r32317
11041102static INPUT_PORTS_START( pdriftj )
11051103   PORT_INCLUDE( pdrift )
11061104
1107   PORT_MODIFY("DSW")
1105   PORT_MODIFY("IN.5")
11081106   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
11091107   PORT_DIPSETTING(    0x03, "Moving" )
11101108   PORT_DIPSETTING(    0x02, "Upright/Sit Down" )
r32316r32317
11311129static INPUT_PORTS_START( pdriftl )
11321130   PORT_INCLUDE( pdrift )
11331131
1134   PORT_MODIFY("DSW")
1132   PORT_MODIFY("IN.5")
11351133   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SWB:4" )
11361134   PORT_DIPNAME( 0x10, 0x00, "Ground Level Tilts" ) PORT_DIPLOCATION("SWB:5")
11371135   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
r32316r32317
11461144   PORT_DIPSETTING(    0x20, "6" )
11471145   PORT_DIPSETTING(    0x00, "7 - Hardest" )
11481146
1149   PORT_MODIFY("COINAGE")
1147   PORT_MODIFY("IN.6")
11501148   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
11511149   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
11521150   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
r32316r32317
12131211static INPUT_PORTS_START( rchase )
12141212   PORT_INCLUDE( yboard_generic )
12151213
1216   PORT_MODIFY("GENERAL")
1214   PORT_MODIFY("IN.1")
12171215   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
12181216   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
12191217   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
r32316r32317
12231221   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
12241222   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
12251223
1226   PORT_MODIFY("COINAGE")
1224   PORT_MODIFY("IN.6")
12271225   PORT_DIPNAME( 0x03, 0x03, "Coin to Credit" ) PORT_DIPLOCATION("SWA:1,2")
12281226   PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
12291227   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
r32316r32317
12471245   PORT_DIPSETTING(    0x20, "7 gives +1" )
12481246   PORT_DIPSETTING(    0x00, "Error" )
12491247
1250   PORT_MODIFY("DSW")
1248   PORT_MODIFY("IN.5")
12511249   PORT_DIPNAME( 0x03, 0x03, "Credits" ) PORT_DIPLOCATION("SWB:1,2")
12521250   PORT_DIPSETTING(    0x03, "1 to Start, 1 to Continue" )
12531251   PORT_DIPSETTING(    0x02, "2 to Start, 1 to Continue" )
r32316r32317
12681266   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12691267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
12701268
1271   PORT_START("ADC0")
1269   PORT_START("ADC.0")
12721270   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
12731271
1274   PORT_START("ADC1")
1272   PORT_START("ADC.1")
12751273   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
12761274
1277   PORT_START("ADC2")
1275   PORT_START("ADC.2")
12781276   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
12791277
1280   PORT_START("ADC3")
1278   PORT_START("ADC.3")
12811279   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
12821280INPUT_PORTS_END
12831281
r32316r32317
12851283static INPUT_PORTS_START( strkfgtr )
12861284   PORT_INCLUDE( gloc )
12871285
1288   PORT_MODIFY("DSW")
1286   PORT_MODIFY("IN.5")
12891287   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:1,2")
12901288   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
12911289   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
trunk/src/mame/drivers/namcos22.c
r32316r32317
27962796
27972797READ8_MEMBER(namcos22_state::namcos22s_mcu_adc_r)
27982798{
2799   UINT16 adc = m_adc_inp[offset >> 1 & 7]->read_safe(0) << 2;
2799   UINT16 adc = m_adc_ports[offset >> 1 & 7]->read_safe(0) << 2;
28002800   return (offset & 1) ? adc >> 8 : adc;
28012801}
28022802
trunk/src/mame/drivers/namcos23.c
r32316r32317
13771377      m_screen(*this, "screen"),
13781378      m_palette(*this, "palette"),
13791379      m_generic_paletteram_32(*this, "paletteram"),
1380      m_adc_inp(*this, "ADC")
1380      m_adc_ports(*this, "ADC")
13811381   { }
13821382
13831383   required_device<mips3_device> m_maincpu;
r32316r32317
14021402   required_device<screen_device> m_screen;
14031403   required_device<palette_device> m_palette;
14041404   required_shared_ptr<UINT32> m_generic_paletteram_32;
1405   optional_ioport_array<4> m_adc_inp;
1405   optional_ioport_array<4> m_adc_ports;
14061406
14071407   c404_t m_c404;
14081408   c361_t m_c361;
r32316r32317
29622962
29632963READ16_MEMBER(namcos23_state::iob_analog_r)
29642964{
2965   return m_adc_inp[offset & 3]->read_safe(0);
2965   return m_adc_ports[offset & 3]->read_safe(0);
29662966}
29672967
29682968
trunk/src/mame/drivers/taitojc.c
r32316r32317
738738
739739READ8_MEMBER(taitojc_state::hc11_analog_r)
740740{
741   return m_analog_inp[offset]->read_safe(0);
741   return m_analog_ports[offset]->read_safe(0);
742742}
743743
744744
trunk/src/mame/drivers/segaorun.c
r32316r32317
688688         return m_i8255->read(space, offset & 3);
689689
690690      case 0x10/2:
691      {
692         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
693         return ioport(sysports[offset & 3])->read();
694      }
691         return m_in_ports[offset & 3]->read();
695692
696693      case 0x30/2:
697      {
698         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
699         return ioport(ports[m_adc_select])->read_safe(0x0010);
700      }
694         return m_adc_ports[m_adc_select]->read_safe(0x0010);
701695
702696      case 0x60/2:
703697         return watchdog_reset_r(space, 0);
r32316r32317
776770      case 0x1002/2:
777771      case 0x1004/2:
778772      case 0x1006/2:
779      {
780         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
781         return ioport(sysports[offset & 3])->read();
782      }
773         return m_in_ports[offset & 3]->read();
783774
784775      case 0x3020/2:
785      {
786         static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
787         return ioport(ports[m_adc_select])->read_safe(0x0010);
788      }
776         return m_adc_ports[m_adc_select]->read_safe(0x0010);
789777
790778      default:
791779         break;
r32316r32317
947935
948936
949937static INPUT_PORTS_START( outrun_generic )
950   PORT_START("SERVICE")
938   PORT_START("IN.0")
951939   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
952940   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
953941   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
r32316r32317
957945   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
958946   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
959947
960   PORT_START("UNKNOWN")
948   PORT_START("IN.1")
961949   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
962950
963   PORT_START("COINAGE")
951   PORT_START("IN.2")
964952   SEGA_COINAGE_LOC(SWA)
965953
966   PORT_START("DSW")
954   PORT_START("IN.3")
967955   PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SWB:1" )
968956   PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SWB:2" )
969957   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SWB:3")
r32316r32317
981969   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
982970   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
983971
984   PORT_START("ADC0")  // steering
972   PORT_START("ADC.0")  // steering
985973   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
986974
987   PORT_START("ADC1")  // gas pedal
975   PORT_START("ADC.1")  // gas pedal
988976   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
989977
990   PORT_START("ADC2")  // brake
978   PORT_START("ADC.2")  // brake
991979   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
992980
993   PORT_START("ADC3")
981   PORT_START("ADC.3")
994982   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segaorun_state, bankmotor_pos_r, NULL)
995983INPUT_PORTS_END
996984
r32316r32317
1003991static INPUT_PORTS_START( outrun )
1004992   PORT_INCLUDE( outrun_generic )
1005993
1006   PORT_MODIFY("DSW")
994   PORT_MODIFY("IN.3")
1007995   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
1008996   PORT_DIPSETTING(    0x03, "Moving" )
1009997   PORT_DIPSETTING(    0x02, "Up Cockpit" )
r32316r32317
10151003static INPUT_PORTS_START( outrundx )
10161004   PORT_INCLUDE( outrun_generic )
10171005
1018   PORT_MODIFY("DSW")
1006   PORT_MODIFY("IN.3")
10191007   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1")
10201008   PORT_DIPSETTING(    0x00, "Not Moving" )
10211009   PORT_DIPSETTING(    0x01, "Moving" )
r32316r32317
10321020static INPUT_PORTS_START( toutrun )
10331021   PORT_INCLUDE( outrun_generic )
10341022
1035   PORT_MODIFY("SERVICE")
1023   PORT_MODIFY("IN.0")
10361024   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Turbo")
10371025
1038   PORT_MODIFY("DSW")
1026   PORT_MODIFY("IN.3")
10391027   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
10401028   PORT_DIPSETTING(    0x03, "Moving" )
10411029   PORT_DIPSETTING(    0x02, "Cockpit Conversion" )
r32316r32317
10581046static INPUT_PORTS_START( toutrunm )
10591047   PORT_INCLUDE( toutrun )
10601048
1061   PORT_MODIFY("DSW")
1049   PORT_MODIFY("IN.3")
10621050   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
10631051   PORT_DIPSETTING(    0x03, "Moving" )
10641052//  PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )
r32316r32317
10751063static INPUT_PORTS_START( toutrunc )
10761064   PORT_INCLUDE( toutrun )
10771065
1078   PORT_MODIFY("DSW")
1066   PORT_MODIFY("IN.3")
10791067   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2")
10801068//  PORT_DIPSETTING(    0x03, DEF_STR( Unused ) )
10811069//  PORT_DIPSETTING(    0x02, DEF_STR( Unused ) )
r32316r32317
10901078static INPUT_PORTS_START( shangon )
10911079   PORT_INCLUDE( outrun_generic )
10921080
1093   PORT_MODIFY("SERVICE")
1081   PORT_MODIFY("IN.0")
10941082   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
10951083
1096   PORT_MODIFY("UNKNOWN")
1084   PORT_MODIFY("IN.1")
10971085   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
10981086   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
10991087   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
r32316r32317
11031091   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
11041092   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
11051093
1106   PORT_MODIFY("DSW")
1094   PORT_MODIFY("IN.3")
11071095   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
11081096   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
11091097   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r32316r32317
11211109   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:7" )
11221110   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWB:8" )
11231111
1124   PORT_MODIFY("ADC0") // steering
1112   PORT_MODIFY("ADC.0") // steering
11251113   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
11261114
1127   PORT_MODIFY("ADC3")
1115   PORT_MODIFY("ADC.3")
11281116   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
11291117INPUT_PORTS_END
11301118

Previous 199869 Revisions Next


© 1997-2024 The MAME Team