mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
Switch all the pre-WPC Williams pinballs to using io port arrays for their switch matrix, which gets rid of runtime lookups and fixes MAME crashes if a value with more than one bit set is written to the column select. [Lord Nightmare]
This commit is contained in:
parent
d8676338be
commit
8f6dff4521
@ -14,6 +14,7 @@ ToDo:
|
||||
|
||||
Known keys necessary to get games to start (so the proper number of balls are detected):
|
||||
- Road Kings: press 'Up' (the direction key) and Q, and press "1" after inserting 1 or more credits.
|
||||
- High Speed: press D (ball trough center), F (ball trough lower right) and Enter (Ball Shooter) after inserting 1 or more credits.
|
||||
|
||||
*****************************************************************************************/
|
||||
|
||||
@ -58,10 +59,7 @@ void s11_state::s11_bg_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s11 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -71,7 +69,7 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -81,7 +79,7 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -91,7 +89,7 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -101,7 +99,7 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -111,7 +109,7 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -121,10 +119,10 @@ static INPUT_PORTS_START( s11 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
@ -286,14 +284,22 @@ void s11_state::pia2c_pb_w(uint8_t data)
|
||||
|
||||
uint8_t s11_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ~ioport(kbdrow)->read();
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
//retval &= ioport("OPTOS")->read(); // optos should be read here as well, and are always active even if no column is selected
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s11_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 2N3904 NPN transistors Q42-Q49, each of which drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
void s11_state::pia34_pa_w(uint8_t data)
|
||||
|
@ -62,10 +62,7 @@ void s11a_state::s11a_bg_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s11a )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -75,7 +72,7 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -85,7 +82,7 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -95,7 +92,7 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -105,7 +102,7 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -115,7 +112,7 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -125,10 +122,10 @@ static INPUT_PORTS_START( s11a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
|
@ -67,10 +67,7 @@ void s11b_state::s11b_bg_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s11b )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -80,7 +77,7 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -90,7 +87,7 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -100,7 +97,7 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -110,7 +107,7 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -120,10 +117,10 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -133,7 +130,7 @@ static INPUT_PORTS_START( s11b )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
|
@ -47,10 +47,7 @@ void s11c_state::s11c_bg_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s11c )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -60,7 +57,7 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -70,7 +67,7 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -80,7 +77,7 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -90,7 +87,7 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -100,10 +97,10 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -113,7 +110,7 @@ static INPUT_PORTS_START( s11c )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_pias(*this, "pias")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s3a(machine_config &config);
|
||||
@ -101,7 +102,7 @@ private:
|
||||
uint8_t m_t_c;
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
bool m_chimes;
|
||||
virtual void machine_start() override { m_digits.resolve(); }
|
||||
@ -113,6 +114,7 @@ private:
|
||||
required_device<pia6821_device> m_pia30;
|
||||
optional_device<pia6821_device> m_pias;
|
||||
output_finder<32> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s3_state::s3_main_map(address_map &map)
|
||||
@ -135,10 +137,7 @@ void s3_state::s3_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s3 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_TILT ) // 3 touches before it tilts
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START )
|
||||
@ -148,7 +147,7 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -158,7 +157,7 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -168,7 +167,7 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA) // 1 touch tilt
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -178,7 +177,7 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -188,7 +187,7 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -198,10 +197,10 @@ static INPUT_PORTS_START( s3 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("SND")
|
||||
@ -412,14 +411,21 @@ void s3_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s3_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read();
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s3_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 7406 quad open collector inverters at IC17 and IC18, each inverter drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s3_state::sound_r()
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_pias(*this, "pias")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s4(machine_config &config);
|
||||
@ -95,7 +96,7 @@ private:
|
||||
uint8_t m_t_c;
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
bool m_chimes;
|
||||
virtual void machine_start() override { m_digits.resolve(); }
|
||||
@ -107,6 +108,7 @@ private:
|
||||
required_device<pia6821_device> m_pia30;
|
||||
optional_device<pia6821_device> m_pias;
|
||||
output_finder<32> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s4_state::s4_main_map(address_map &map)
|
||||
@ -130,10 +132,7 @@ void s4_state::s4_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s4 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -143,7 +142,7 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -153,7 +152,7 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -163,7 +162,7 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -173,7 +172,7 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -183,7 +182,7 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -193,10 +192,10 @@ static INPUT_PORTS_START( s4 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("SND")
|
||||
@ -407,14 +406,21 @@ void s4_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s4_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s4_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 7406 quad open collector inverters at IC17 and IC18, each inverter drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s4_state::sound_r()
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s6(machine_config &config);
|
||||
@ -109,7 +110,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
emu_timer* m_irq_timer;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -124,6 +125,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<61> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s6_state::s6_main_map(address_map &map)
|
||||
@ -147,10 +149,7 @@ void s6_state::s6_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s6 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -160,7 +159,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -170,7 +169,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -180,7 +179,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -190,7 +189,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -200,7 +199,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -210,7 +209,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RSHIFT)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SPACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_END)
|
||||
@ -220,7 +219,7 @@ static INPUT_PORTS_START( s6 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_PGUP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_PGDN)
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
@ -346,14 +345,21 @@ void s6_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s6_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s6_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 7406 quad open collector inverters at IC17 and IC18, each inverter drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s6_state::sound_r()
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s6a(machine_config &config);
|
||||
@ -102,7 +103,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
emu_timer* m_irq_timer;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -117,6 +118,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<32> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s6a_state::s6a_main_map(address_map &map)
|
||||
@ -139,10 +141,7 @@ void s6a_state::s6a_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s6a )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -152,7 +151,7 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -162,7 +161,7 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -172,7 +171,7 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -182,7 +181,7 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -192,7 +191,7 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -202,10 +201,10 @@ static INPUT_PORTS_START( s6a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("SND")
|
||||
@ -329,14 +328,21 @@ void s6a_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s6a_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s6a_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 7406 quad open collector inverters at IC17 and IC18, each inverter drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s6a_state::sound_r()
|
||||
|
@ -29,6 +29,8 @@ Note that T is also a tilt, but it may take 3 hits to activate it.
|
||||
A number of games are multiball therefore they either cannot start or the outhole
|
||||
is ineffective/unknown. All games can coin up.
|
||||
|
||||
Note: fpwr2_l2 can be started by holding down D (left ball ramp) and F (ball shooter trough) when pressing start.
|
||||
|
||||
|
||||
Game Outhole Tilt Notes
|
||||
----------------------------------------------------------------------------------
|
||||
@ -84,6 +86,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s7(machine_config &config);
|
||||
@ -127,7 +130,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
uint8_t m_nvram[0x100];
|
||||
bool m_data_ok;
|
||||
bool m_memprotect;
|
||||
@ -145,6 +148,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<61> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s7_state::s7_main_map(address_map &map)
|
||||
@ -170,20 +174,18 @@ void s7_state::s7_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s7 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) // pendulum tilt
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) // 2-player start
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START ) // 1-player start
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT ) // slam tilt
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) // slam tilt
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) // high score reset
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -193,7 +195,7 @@ static INPUT_PORTS_START( s7 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -203,7 +205,7 @@ static INPUT_PORTS_START( s7 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -213,7 +215,7 @@ static INPUT_PORTS_START( s7 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -223,7 +225,7 @@ static INPUT_PORTS_START( s7 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -233,14 +235,14 @@ static INPUT_PORTS_START( s7 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RSHIFT)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SPACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LALT)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LSHIFT)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("SND")
|
||||
@ -350,14 +352,21 @@ uint8_t s7_state::dips_r()
|
||||
|
||||
uint8_t s7_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff; // comes in through inverter buffers
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s7_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 7406 quad open collector inverters at IC17 and IC18, each inverter drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s7_state::nvram_r(offs_t offset)
|
||||
|
@ -69,6 +69,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s8(machine_config &config);
|
||||
@ -103,7 +104,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
emu_timer* m_irq_timer;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -117,6 +118,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<61> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s8_state::s8_main_map(address_map &map)
|
||||
@ -139,10 +141,7 @@ void s8_state::s8_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s8 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -152,12 +151,12 @@ static INPUT_PORTS_START( s8 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F)
|
||||
PORT_BIT( 0xf6, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -167,21 +166,21 @@ static INPUT_PORTS_START( s8 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
@ -254,14 +253,22 @@ void s8_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s8_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
//retval &= ioport("OPTOS")->read(); // optos should be read here as well, and are always active even if no column is selected
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s8_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 2N3904 NPN transistors Q7-Q14, each of which drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s8_state::sound_r()
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s8a(machine_config &config);
|
||||
@ -79,7 +80,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
emu_timer* m_irq_timer;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -93,6 +94,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<61> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s8a_state::s8a_main_map(address_map &map)
|
||||
@ -115,10 +117,7 @@ void s8a_state::s8a_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s8a )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -128,7 +127,7 @@ static INPUT_PORTS_START( s8a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -138,22 +137,22 @@ static INPUT_PORTS_START( s8a )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
@ -226,14 +225,22 @@ void s8a_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s8a_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
//retval &= ioport("OPTOS")->read(); // optos should be read here as well, and are always active even if no column is selected
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s8a_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 2N3904 NPN transistors Q7-Q14, each of which drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s8a_state::sound_r()
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
, m_pia28(*this, "pia28")
|
||||
, m_pia30(*this, "pia30")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s9(machine_config &config);
|
||||
@ -90,7 +91,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
bool m_data_ok;
|
||||
emu_timer* m_irq_timer;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
@ -105,6 +106,7 @@ private:
|
||||
required_device<pia6821_device> m_pia28;
|
||||
required_device<pia6821_device> m_pia30;
|
||||
output_finder<61> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
};
|
||||
|
||||
void s9_state::s9_main_map(address_map &map)
|
||||
@ -127,10 +129,7 @@ void s9_state::s9_audio_map(address_map &map)
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( s9 )
|
||||
PORT_START("X0")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("X1")
|
||||
PORT_START("SW.0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
|
||||
@ -140,7 +139,7 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
|
||||
|
||||
PORT_START("X2")
|
||||
PORT_START("SW.1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
|
||||
@ -150,7 +149,7 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
|
||||
|
||||
PORT_START("X4")
|
||||
PORT_START("SW.2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
|
||||
@ -160,7 +159,7 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
|
||||
|
||||
PORT_START("X8")
|
||||
PORT_START("SW.3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
|
||||
@ -170,7 +169,7 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
|
||||
|
||||
PORT_START("X10")
|
||||
PORT_START("SW.4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
|
||||
@ -180,7 +179,7 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
|
||||
|
||||
PORT_START("X20")
|
||||
PORT_START("SW.5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
|
||||
@ -190,14 +189,14 @@ static INPUT_PORTS_START( s9 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
|
||||
|
||||
PORT_START("X40")
|
||||
PORT_START("SW.6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RSHIFT)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SPACE)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LALT)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LSHIFT)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("X80")
|
||||
PORT_START("SW.7")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DIAGS")
|
||||
@ -260,14 +259,22 @@ void s9_state::dig1_w(uint8_t data)
|
||||
|
||||
uint8_t s9_state::switch_r()
|
||||
{
|
||||
char kbdrow[8];
|
||||
sprintf(kbdrow,"X%X",m_kbdrow);
|
||||
return ioport(kbdrow)->read() ^ 0xff;
|
||||
char retval = 0xff;
|
||||
// scan all 8 input columns, since multiple can be selected at once
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (m_switch_col & (1<<i))
|
||||
retval &= m_swarray[i]->read();
|
||||
}
|
||||
//retval &= ioport("OPTOS")->read(); // optos should be read here as well, and are always active even if no column is selected
|
||||
return ~retval;
|
||||
}
|
||||
|
||||
void s9_state::switch_w(uint8_t data)
|
||||
{
|
||||
m_kbdrow = data;
|
||||
// this drives the pulldown 2N3904 NPN transistors Q7-Q14, each of which drives one column of the switch matrix low
|
||||
// it is possible for multiple columns to be enabled at once, this is handled in switch_r above.
|
||||
m_switch_col = data;
|
||||
}
|
||||
|
||||
uint8_t s9_state::sound_r()
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
, m_ym(*this, "ym2151")
|
||||
, m_bg(*this, "bgm")
|
||||
, m_digits(*this, "digit%u", 0U)
|
||||
, m_swarray(*this, "SW.%u", 0U)
|
||||
{ }
|
||||
|
||||
void s11(machine_config &config);
|
||||
@ -111,6 +112,7 @@ protected:
|
||||
optional_device<ym2151_device> m_ym;
|
||||
optional_device<s11c_bg_device> m_bg;
|
||||
output_finder<63> m_digits;
|
||||
required_ioport_array<8> m_swarray;
|
||||
|
||||
// getters/setters
|
||||
uint8_t get_strobe() { return m_strobe; }
|
||||
@ -131,7 +133,7 @@ private:
|
||||
|
||||
uint8_t m_sound_data;
|
||||
uint8_t m_strobe;
|
||||
uint8_t m_kbdrow;
|
||||
uint8_t m_switch_col;
|
||||
uint8_t m_diag;
|
||||
uint32_t m_segment1;
|
||||
uint32_t m_segment2;
|
||||
|
Loading…
Reference in New Issue
Block a user