Previous 199869 Revisions Next

r21191 Tuesday 19th February, 2013 at 20:05:13 UTC by Angelo Salese
Added inputs
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21190r21191
337337   DECLARE_READ16_MEMBER(h1_soundram2_r);
338338   DECLARE_WRITE16_MEMBER(h1_soundram_w);
339339   DECLARE_WRITE16_MEMBER(h1_soundram2_w);
340   DECLARE_READ8_MEMBER(analog_mux_r);
341   DECLARE_WRITE8_MEMBER(analog_mux_w);
342   UINT8 an_mux_data;
340343   DECLARE_WRITE_LINE_MEMBER(scsp_to_main_irq);
341344   DECLARE_DRIVER_INIT(coolridr);
342345   virtual void machine_start();
r21190r21191
903906   COMBINE_DATA(&m_soundram2[offset]);
904907}
905908
909READ8_MEMBER( coolridr_state::analog_mux_r )
910{
911   static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
912   UINT8 adc_data = ioport(adcnames[an_mux_data])->read_safe(0);
913   an_mux_data++;
914   an_mux_data &= 0x7;
915   return adc_data;
916}
917
918WRITE8_MEMBER( coolridr_state::analog_mux_w )
919{
920   an_mux_data = data;
921}
922
906923static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state )
907924   AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_SHARE("share2")
908925
r21190r21191
928945   AM_RANGE(0x0610000c, 0x0610000f) AM_READ_PORT("IN6")
929946   AM_RANGE(0x06100010, 0x06100013) AM_READ_PORT("IN2") AM_WRITENOP
930947   AM_RANGE(0x06100014, 0x06100017) AM_READ_PORT("IN3")
931   AM_RANGE(0x0610001c, 0x0610001f) AM_READ_PORT("IN4") AM_WRITENOP
932   AM_RANGE(0x06200000, 0x06200fff) AM_RAM //check this!
948   AM_RANGE(0x0610001c, 0x0610001f) AM_READWRITE8(analog_mux_r,analog_mux_w,0x000000ff) //AM_WRITENOP
949   AM_RANGE(0x06200000, 0x06200fff) AM_RAM //network related?
933950   AM_RANGE(0x07fff000, 0x07ffffff) AM_RAM
934951   AM_RANGE(0x20000000, 0x2001ffff) AM_ROM AM_SHARE("share2")
935952
r21190r21191
10481065   PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED )
10491066
10501067   PORT_START("IN1")
1051   PORT_DIPNAME( 0x00000001, 0x00000001, "IN1-0" )
1052   PORT_DIPSETTING(    0x00000001, DEF_STR( Off ) )
1053   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1054   PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Unknown ) )
1055   PORT_DIPSETTING(    0x00000002, DEF_STR( Off ) )
1056   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1057   PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Unknown ) )
1058   PORT_DIPSETTING(    0x00000004, DEF_STR( Off ) )
1059   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1060   PORT_DIPNAME( 0x00000008, 0x00000008, DEF_STR( Unknown ) )
1061   PORT_DIPSETTING(    0x00000008, DEF_STR( Off ) )
1062   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1063   PORT_DIPNAME( 0x00000010, 0x00000010, DEF_STR( Unknown ) )
1064   PORT_DIPSETTING(    0x00000010, DEF_STR( Off ) )
1065   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1066   PORT_DIPNAME( 0x00000020, 0x00000020, DEF_STR( Unknown ) )
1067   PORT_DIPSETTING(    0x00000020, DEF_STR( Off ) )
1068   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1069   PORT_DIPNAME( 0x00000040, 0x00000040, DEF_STR( Unknown ) )
1070   PORT_DIPSETTING(    0x00000040, DEF_STR( Off ) )
1071   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1072   PORT_DIPNAME( 0x00000080, 0x00000080, DEF_STR( Unknown ) )
1073   PORT_DIPSETTING(    0x00000080, DEF_STR( Off ) )
1074   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1075   /* Service port*/
1076   PORT_BIT(0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
1077   PORT_BIT(0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
1068   PORT_BIT( 0x00000003, IP_ACTIVE_LOW, IPT_UNUSED )
1069   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Music <<")
1070   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Music >>")
1071   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Shift Up")
1072   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 Shift Down")
1073   PORT_BIT( 0x000000c0, IP_ACTIVE_LOW, IPT_UNUSED )
1074   PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNUSED )
1075   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("P1 Coin")
1076   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("P2 Coin")
10781077   PORT_SERVICE_NO_TOGGLE( 0x00040000, IP_ACTIVE_LOW )
1079   PORT_BIT(0x00080000, IP_ACTIVE_LOW, IPT_SERVICE1 )
1080   PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_START1 )
1081   PORT_BIT(0x00200000, IP_ACTIVE_LOW, IPT_START2 )
1082   PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
1083   PORT_BIT(0x00800000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8)
1084   PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED )
1078   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("P1 Service Switch")
1079   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start")
1080   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start")
1081   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("P2 Service Switch")
1082   PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
1083   PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNUSED )
10851084
10861085   PORT_START("IN2")
10871086   PORT_DIPNAME( 0x00000001, 0x00000001, "IN2-0" )
r21190r21191
12611260   PORT_DIPNAME( 0x00000080, 0x00000080, DEF_STR( Unknown ) )
12621261   PORT_DIPSETTING(    0x00000080, DEF_STR( Off ) )
12631262   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1264   PORT_DIPNAME( 0x00010000, 0x00010000, "IN5-1" )
1265   PORT_DIPSETTING(    0x00010000, DEF_STR( Off ) )
1266   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1267   PORT_DIPNAME( 0x00020000, 0x00020000, DEF_STR( Unknown ) )
1268   PORT_DIPSETTING(    0x00020000, DEF_STR( Off ) )
1269   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1270   PORT_DIPNAME( 0x00040000, 0x00040000, DEF_STR( Unknown ) )
1271   PORT_DIPSETTING(    0x00040000, DEF_STR( Off ) )
1272   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1273   PORT_DIPNAME( 0x00080000, 0x00080000, DEF_STR( Unknown ) )
1274   PORT_DIPSETTING(    0x00080000, DEF_STR( Off ) )
1275   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1276   PORT_DIPNAME( 0x00100000, 0x00100000, DEF_STR( Unknown ) )
1277   PORT_DIPSETTING(    0x00100000, DEF_STR( Off ) )
1278   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1279   PORT_DIPNAME( 0x00200000, 0x00200000, DEF_STR( Unknown ) )
1280   PORT_DIPSETTING(    0x00200000, DEF_STR( Off ) )
1281   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1282   PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Unknown ) )
1283   PORT_DIPSETTING(    0x00400000, DEF_STR( Off ) )
1284   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1285   PORT_DIPNAME( 0x00800000, 0x00800000, DEF_STR( Unknown ) )
1286   PORT_DIPSETTING(    0x00800000, DEF_STR( Off ) )
1287   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
1263   PORT_BIT( 0x00030000, IP_ACTIVE_LOW, IPT_UNUSED )
1264   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Music <<")
1265   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Music >>")
1266   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Shift Up")
1267   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Shift Down")
1268   PORT_BIT( 0x00c00000, IP_ACTIVE_LOW, IPT_UNUSED )
12881269   PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED )
12891270
12901271   PORT_START("IN6")
r21190r21191
13371318   PORT_DIPSETTING(    0x00800000, DEF_STR( Off ) )
13381319   PORT_DIPSETTING(    0x00000000, DEF_STR( On ) )
13391320   PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED )
1321
1322   PORT_START("AN0")
1323   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1) PORT_NAME("P1 Handle Bar")
1324
1325   PORT_START("AN1")
1326   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(1) PORT_REVERSE PORT_NAME("P1 Throttle")
1327
1328   PORT_START("AN2")
1329   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(1) PORT_REVERSE PORT_NAME("P1 Brake")
1330
1331   PORT_START("AN3")
1332   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1333
1334   PORT_START("AN4")
1335   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2) PORT_NAME("P2 Handle Bar")
1336
1337   PORT_START("AN5")
1338   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(2) PORT_REVERSE PORT_NAME("P2 Throttle")
1339
1340   PORT_START("AN6")
1341   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(50) PORT_KEYDELTA(25) PORT_PLAYER(2) PORT_REVERSE PORT_NAME("P2 Brake")
1342
1343   PORT_START("AN7")
1344   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
13401345INPUT_PORTS_END
13411346
13421347

Previous 199869 Revisions Next


© 1997-2024 The MAME Team