Skip to content

Commit

Permalink
Fix inputs for tempest fully working (#1668)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahoneyt944 committed Jan 18, 2024
1 parent b61da75 commit 32fa606
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/drivers/tempest.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,19 @@ static READ_HANDLER( tempest_IN0_r )

static READ_HANDLER( input_port_1_bit_r )
{
return ((readinputport(1)+tempest_knob_r()) & (1 << offset)) ? 0 : 228;
if (offset < 4)
return (tempest_knob_r() & (1 << offset)) ? 0 : 228;

return (readinputport(1) & (1 << offset)) ? 0 : 228;
}


static READ_HANDLER( input_port_2_bit_r )
{
return ((readinputport(2)+tempest_buttons_r()) & (1 << offset)) ? 0 : 228;
if (offset == 3 || offset == 4)
return (tempest_buttons_r() & (1 << offset)) ? 0 : 228;

return (readinputport(2) & (1 << offset)) ? 0 : 228;
}


Expand Down Expand Up @@ -326,14 +332,14 @@ INPUT_PORTS_START( tempest )

PORT_START /* IN1/DSW0 */
/* This is the Tempest spinner input. It only uses 4 bits. */
PORT_BIT(0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_SPECIAL )
/* The next one is reponsible for cocktail mode.
* According to the documentation, this is not a switch, although
* it may have been planned to put it on the Math Box PCB, D/E2 )
*/
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x10, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
Expand Down

0 comments on commit 32fa606

Please sign in to comment.