Skip to content

Commit

Permalink
Add cocktail to asteroid deluxe (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneyt944 committed Jan 28, 2024
1 parent c7bcc47 commit 25f3e82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/drivers/asteroid.c
Expand Up @@ -539,6 +539,22 @@ INPUT_PORTS_START( astdelux )
PORT_DIPSETTING ( 0xa0, "1 each 4" )
PORT_DIPSETTING ( 0xc0, "1 each 2" )
PORT_DIPSETTING ( 0xe0, "None" )

PORT_START /* fake IN4 - inverter circuit */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) )

PORT_START /* IN5 - asteroid_cocktail_port0 */
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2)
PORT_BIT( 0xe7, IP_ACTIVE_HIGH, IPT_UNUSED )

PORT_START /* IN6 - asteroid_cocktail_port1 */
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_PLAYER2)
INPUT_PORTS_END


Expand Down Expand Up @@ -884,6 +900,8 @@ static DRIVER_INIT( asterock )

static DRIVER_INIT( astdelux )
{
asteroid_install_inv = true;

OVERLAY_START( astdelux_overlay )
OVERLAY_RECT( 0.0, 0.0, 1.0, 1.0, MAKE_ARGB(0x04,0x88,0xff,0xff) )
OVERLAY_END
Expand Down
8 changes: 8 additions & 0 deletions src/machine/asteroid_machine.c
Expand Up @@ -196,6 +196,14 @@ WRITE_HANDLER( astdelux_bank_switch_w )
RAM[0x300 + i] = temp;
}
}

if (asteroid_install_inv)
{
/* player selection is bit 0x80 */
optional_io_active = (readinputport(asteroid_cocktail_switch) && (data & 0x80))?1:0;
avg_set_flip_x( optional_io_active );
avg_set_flip_y( optional_io_active );
}
}


Expand Down

0 comments on commit 25f3e82

Please sign in to comment.