summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mjkjidai.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mjkjidai.c')
-rw-r--r--src/mame/drivers/mjkjidai.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 32e04bf9920..21d3f170a8e 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -104,19 +104,20 @@ static int keyb,nvram_init_count;
static READ8_HANDLER( keyboard_r )
{
int res = 0x3f,i;
+ static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" };
-// logerror("%04x: keyboard_r\n",activecpu_get_pc());
+// logerror("%04x: keyboard_r\n", activecpu_get_pc());
- for (i = 0;i < 12;i++)
+ for (i = 0; i < 12; i++)
{
if (~keyb & (1 << i))
{
- res = input_port_read_indexed(machine, 4+i) & 0x3f;
+ res = input_port_read(machine, keynames[i]) & 0x3f;
break;
}
}
- res |= (input_port_read_indexed(machine, 3) & 0xc0);
+ res |= (input_port_read(machine, "IN3") & 0xc0);
if (nvram_init_count)
{
@@ -176,9 +177,9 @@ static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ(keyboard_r)
AM_RANGE(0x01, 0x01) AM_READ(SMH_NOP) // ???
- AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
- AM_RANGE(0x11, 0x11) AM_READ(input_port_0_r)
- AM_RANGE(0x12, 0x12) AM_READ(input_port_1_r)
+ AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
+ AM_RANGE(0x11, 0x11) AM_READ_PORT("IN0")
+ AM_RANGE(0x12, 0x12) AM_READ_PORT("IN1")
ADDRESS_MAP_END
static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
@@ -193,7 +194,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( mjkjidai )
- PORT_START
+ PORT_START_TAG("IN0")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -217,7 +218,7 @@ static INPUT_PORTS_START( mjkjidai )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_START
+ PORT_START_TAG("IN1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -243,7 +244,7 @@ static INPUT_PORTS_START( mjkjidai )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_START
+ PORT_START_TAG("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
@@ -255,56 +256,56 @@ static INPUT_PORTS_START( mjkjidai )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
- PORT_START
+ PORT_START_TAG("IN3")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT ) // reinitialize NVRAM and reset the game
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
/* player 2 inputs (same as player 1) */
- PORT_START
+ PORT_START_TAG("KEY0")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY1")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY2")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY3")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY4")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY5")
PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY7")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY8")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY9")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY10")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START
+ PORT_START_TAG("KEY11")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C )