Aleck 64: Implemented player 2 inputs [Angelo Salese]

This commit is contained in:
Angelo Salese 2009-12-08 18:30:10 +00:00
parent 81c2b67b66
commit bc26ce3ce5
2 changed files with 314 additions and 170 deletions

View File

@ -175,13 +175,9 @@ Notes:
static READ32_HANDLER( aleck_dips_r )
{
if (offset == 0)
{
return (input_port_read(space->machine, "IN0")); /* mtetrisc has regular inputs here */
}
else if (offset == 1)
{
return (input_port_read(space->machine, "IN1"));
}
return 0;
}
@ -236,6 +232,128 @@ static INPUT_PORTS_START( aleck64 )
PORT_START("P1_ANALOG_Y")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
PORT_START("P2")
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // Button A
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) // Button B
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) // Button Z
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START2 ) // Start
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) // Joypad Up
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) // Joypad Down
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // Joypad Left
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // Joypad Right
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) // Pan Left
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) // Pan Right
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) // C Button Up
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(2) // C Button Down
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(2) // C Button Left
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(2) // C Button Right
PORT_START("P2_ANALOG_X")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
PORT_START("P2_ANALOG_Y")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
PORT_START("IN0")
PORT_DIPNAME( 0x80000000, 0x80000000, "DIPSW1 #8" )
PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x40000000, 0x40000000, "DIPSW1 #7" )
PORT_DIPSETTING( 0x40000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x20000000, 0x20000000, "DIPSW1 #6" )
PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x10000000, 0x10000000, "DIPSW1 #5" )
PORT_DIPSETTING( 0x10000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x08000000, 0x08000000, "DIPSW1 #4" )
PORT_DIPSETTING( 0x08000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x04000000, 0x04000000, "DIPSW1 #3" )
PORT_DIPSETTING( 0x04000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x02000000, 0x02000000, "DIPSW1 #2" )
PORT_DIPSETTING( 0x02000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x01000000, 0x01000000, "DIPSW1 #1" )
PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00800000, 0x00800000, "Test Mode" )
PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00400000, 0x00400000, "DIPSW2 #7" )
PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00200000, 0x00200000, "DIPSW2 #6" )
PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00100000, 0x00100000, "DIPSW2 #5" )
PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00080000, 0x00080000, "DIPSW2 #4" )
PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00040000, 0x00040000, "DIPSW2 #3" )
PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00020000, 0x00020000, "DIPSW2 #2" )
PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00010000, 0x00010000, "DIPSW2 #1" )
PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_BIT(0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
PORT_BIT( 0xff00ffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
INPUT_PORTS_END
static INPUT_PORTS_START( 11beat )
PORT_START("P1_ANALOG_X")
PORT_START("P1_ANALOG_Y")
PORT_START("P2_ANALOG_X")
PORT_START("P2_ANALOG_Y")
PORT_START("P1")
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // Button A
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // Button B
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // Button Z
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START1 ) // Start
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) // Joypad Up
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) // Joypad Down
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) // Joypad Left
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) // Joypad Right
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // Pan Left
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) // Pan Right
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Up
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Down
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Left
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) // C Button Right
PORT_START("P2")
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // Button A
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) // Button B
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // Button Z
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START2 ) // Start
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) // Joypad Up
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) // Joypad Down
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // Joypad Left
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // Joypad Right
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) // Pan Left
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) // Pan Right (Button C here)
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Up
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Down
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) // C Button Left
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) // C Button Right (Button D here)
PORT_START("IN0")
PORT_DIPNAME( 0x80000000, 0x80000000, "DIPSW1 #8" )
PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) )
@ -300,6 +418,9 @@ static INPUT_PORTS_START( mtetrisc )
PORT_START("P1")
PORT_START("P1_ANALOG_X")
PORT_START("P1_ANALOG_Y")
PORT_START("P2")
PORT_START("P2_ANALOG_X")
PORT_START("P2_ANALOG_Y")
PORT_START("IN0")
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
@ -326,7 +447,6 @@ static INPUT_PORTS_START( mtetrisc )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
INPUT_PORTS_END
static INPUT_PORTS_START( starsldr )
@ -353,6 +473,30 @@ static INPUT_PORTS_START( starsldr )
PORT_START("P1_ANALOG_Y")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
PORT_START("P2")
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // Button A
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // Button B
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_START1 ) // Start
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) // Joypad Up
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) // Joypad Down
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) // Joypad Left
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) // Joypad Right
PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) // Button C
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) // Button D
PORT_START("P2_ANALOG_X")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
PORT_START("P2_ANALOG_Y")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0xff,0x00) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
PORT_START("IN0")
PORT_DIPNAME( 0x80000000, 0x00000000, DEF_STR(Joystick) ) // DIPSW1 #8
PORT_DIPSETTING( 0x00000000, DEF_STR(Joystick) )
@ -687,7 +831,7 @@ ROM_END
GAME( 1998, aleck64, 0, aleck64, aleck64, aleck64, ROT0, "Nintendo/Seta", "Aleck64 PIF BIOS", GAME_IS_BIOS_ROOT)
// games
GAME( 1998, 11beat, aleck64, aleck64, aleck64, aleck64, ROT0, "Hudson", "Eleven Beat", GAME_NOT_WORKING|GAME_NO_SOUND )
GAME( 1998, 11beat, aleck64, aleck64, 11beat, aleck64, ROT0, "Hudson", "Eleven Beat", GAME_NOT_WORKING|GAME_NO_SOUND )
GAME( 1998, mtetrisc, aleck64, aleck64, mtetrisc, aleck64, ROT0, "Capcom", "Magical Tetris Challenge (981009 Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 1998, starsldr, aleck64, aleck64, starsldr, aleck64, ROT0, "Hudson/Seta", "Star Soldier: Vanishing Earth", GAME_IMPERFECT_GRAPHICS )
GAME( 1998, vivdolls, aleck64, aleck64, aleck64, aleck64, ROT0, "Visco", "Vivid Dolls", GAME_IMPERFECT_GRAPHICS )

View File

@ -1580,8 +1580,8 @@ static int pif_channel_handle_command(running_machine *machine, int channel, int
{
UINT16 buttons = 0;
INT8 x = 0, y = 0;
/* add here tags for P2, P3 and P4 when implemented */
static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y" };
/* add here tags for P3 and P4 when implemented */
static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y", "P2", "P2_ANALOG_X", "P2_ANALOG_Y" };
if (slength != 1 || rlength != 4)
{
@ -1590,7 +1590,8 @@ static int pif_channel_handle_command(running_machine *machine, int channel, int
switch (channel)
{
case 0:
case 0: //p1 inputs
case 1: //p2 inputs
{
buttons = input_port_read(machine, portnames[(channel*3) + 0]);
x = input_port_read(machine, portnames[(channel*3) + 1]) - 128;
@ -1602,7 +1603,6 @@ static int pif_channel_handle_command(running_machine *machine, int channel, int
rdata[3] = (UINT8)(y);
return 0;
}
case 1:
case 2:
case 3:
{