summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/gauntlet.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-08-14 05:17:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-08-14 05:17:39 +0000
commit3b76b8e25ec2ad0947c8e9e26a6ffd092a4f99ac (patch)
tree27fb3f405e03b4a5aa2c50ca4bb8282dd8c93737 /src/mame/drivers/gauntlet.c
parent15893eeed0ae869cd2f31a38946ff1318349751d (diff)
From: Fabio Priuli [mailto:doge.fabio@gmail.com]
Subject: some more input clean-ups Hi, attached please find a few patches against u4. These diffs improve input ports for drivers starting with F->L. In particular: they add AM_READ_PORT whenever suitable, they make inputs fully 32bit where needed, they remove indexed input read handlers from INITs, they replace many read handlers with appropriate CUSTOM_INPUTs. Additional improvements: * added dip switches and locations to go2000 (even if they were partially documented in the source) * fixed artmagic protection (it used a wrong tag, which probably I added somewhere in 0.125uX); even if I haven't experienced any problems due to the bug since the regression now it's fixed More details on the patches: * u4_clean01 -> u4_clean07: these are standard changes like the one I submitted previously (no custom inputs involved) * u4_custom01 -> u4_custom04: here there are also changes involving custom inputs (they mainly deal with eeprom reads, but a few were a bit more interesting); I separated these from the other ones in case you want to check them more in detail * itech8.diff: this patch improves ports & their handling in itech8.c. In particular, it replaces the 'special' handlers with a single custom input and I would like a confirmation that it was the right choice in this case. Patches are independent one from the other and should apply with no problems. Let me know if this is not the case. Regards, Fabio
Diffstat (limited to 'src/mame/drivers/gauntlet.c')
-rw-r--r--src/mame/drivers/gauntlet.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index db1a1f3943a..caa9b33eb03 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -193,7 +193,7 @@ static MACHINE_RESET( gauntlet )
static READ16_HANDLER( port4_r )
{
- int temp = input_port_read(machine, "IN4");
+ int temp = input_port_read(machine, "803008");
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
return temp;
@@ -237,7 +237,7 @@ static READ8_HANDLER( switch_6502_r )
if (atarigen_cpu_to_sound_ready) temp ^= 0x80;
if (atarigen_sound_to_cpu_ready) temp ^= 0x40;
if (tms5220_ready_r()) temp ^= 0x20;
- if (!(input_port_read(machine, "IN4") & 0x0008)) temp ^= 0x10;
+ if (!(input_port_read(machine, "803008") & 0x0008)) temp ^= 0x10;
return temp;
}
@@ -321,10 +321,10 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
/* MBUS */
AM_RANGE(0x800000, 0x801fff) AM_MIRROR(0x2fc000) AM_RAM
AM_RANGE(0x802000, 0x802fff) AM_MIRROR(0x2fc000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
- AM_RANGE(0x803000, 0x803001) AM_MIRROR(0x2fcef0) AM_READ(input_port_0_word_r)
- AM_RANGE(0x803002, 0x803003) AM_MIRROR(0x2fcef0) AM_READ(input_port_1_word_r)
- AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ(input_port_2_word_r)
- AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ(input_port_3_word_r)
+ AM_RANGE(0x803000, 0x803001) AM_MIRROR(0x2fcef0) AM_READ_PORT("803000")
+ AM_RANGE(0x803002, 0x803003) AM_MIRROR(0x2fcef0) AM_READ_PORT("803002")
+ AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004")
+ AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006")
AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ(port4_r)
AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_READ(atarigen_sound_r)
AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w)
@@ -358,7 +358,7 @@ static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x2000) AM_RAM
AM_RANGE(0x1000, 0x100f) AM_MIRROR(0x27c0) AM_WRITE(atarigen_6502_sound_w)
AM_RANGE(0x1010, 0x101f) AM_MIRROR(0x27c0) AM_READ(atarigen_6502_sound_r)
- AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READWRITE(input_port_5_r, mixer_w)
+ AM_RANGE(0x1020, 0x102f) AM_MIRROR(0x27c0) AM_READ_PORT("COIN") AM_WRITE(mixer_w)
AM_RANGE(0x1030, 0x103f) AM_MIRROR(0x27c0) AM_READWRITE(switch_6502_r, sound_ctl_w)
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x27c0) AM_READWRITE(pokey1_r, pokey1_w)
AM_RANGE(0x1810, 0x1810) AM_MIRROR(0x27ce) AM_WRITE(ym2151_register_port_0_w)
@@ -377,7 +377,7 @@ ADDRESS_MAP_END
*************************************/
static INPUT_PORTS_START( gauntlet )
- PORT_START("IN0") /* 803000 */
+ PORT_START("803000")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -387,7 +387,7 @@ static INPUT_PORTS_START( gauntlet )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN1") /* 803002 */
+ PORT_START("803002")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -397,7 +397,7 @@ static INPUT_PORTS_START( gauntlet )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN2") /* 803004 */
+ PORT_START("803004")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -407,7 +407,7 @@ static INPUT_PORTS_START( gauntlet )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN3") /* 803006 */
+ PORT_START("803006")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -417,14 +417,14 @@ static INPUT_PORTS_START( gauntlet )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN4") /* 803008 */
+ PORT_START("803008")
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_VBLANK )
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START("IN5") /* 1020 (sound) */
+ PORT_START("COIN") /* 1020 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -434,7 +434,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( vindctr2 )
- PORT_START("IN0") /* 803000 */
+ PORT_START("803000")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
@@ -445,7 +445,7 @@ static INPUT_PORTS_START( vindctr2 )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN1") /* 803002 */
+ PORT_START("803002")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
@@ -456,22 +456,22 @@ static INPUT_PORTS_START( vindctr2 )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN2") /* 803004 */
+ PORT_START("803004")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN3") /* 803006 */
+ PORT_START("803006")
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("IN4") /* 803008 */
+ PORT_START("803008")
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_VBLANK )
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START("IN5") /* 1020 (sound) */
+ PORT_START("COIN") /* 1020 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )