mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Add two-in-one version of LS157 (nw)
This commit is contained in:
parent
45cb658cab
commit
58d12011f5
@ -20,22 +20,24 @@
|
||||
// 74LS157 DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(LS157, ls157_device, "74ls157", "74LS157 Quad 2-to-1 Multiplexer")
|
||||
DEFINE_DEVICE_TYPE(LS157, ls157_device, "ls157", "74LS157 Quad 2-to-1 Multiplexer")
|
||||
DEFINE_DEVICE_TYPE(LS157_X2, ls157_x2_device, "ls157_x2", "74LS157 Quad 2-to-1 Multiplexer (x2)")
|
||||
|
||||
//-------------------------------------------------
|
||||
// ls157_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ls157_device::ls157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ls157_device(mconfig, LS157, tag, owner, clock)
|
||||
: ls157_device(mconfig, LS157, tag, owner, clock, 0x0f)
|
||||
{
|
||||
}
|
||||
|
||||
ls157_device::ls157_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
|
||||
ls157_device::ls157_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 mask)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, m_a_in_cb(*this)
|
||||
, m_b_in_cb(*this)
|
||||
, m_out_cb(*this)
|
||||
, m_data_mask(mask)
|
||||
{
|
||||
m_a = 0;
|
||||
m_b = 0;
|
||||
@ -44,6 +46,16 @@ ls157_device::ls157_device(const machine_config &mconfig, device_type type, cons
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// ls157_x2_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ls157_x2_device::ls157_x2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ls157_device(mconfig, LS157_X2, tag, owner, clock, 0xff)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - perform device-specific
|
||||
// startup
|
||||
@ -79,7 +91,7 @@ WRITE8_MEMBER(ls157_device::a_w)
|
||||
|
||||
void ls157_device::a_w(u8 data)
|
||||
{
|
||||
m_a = data & 0xf;
|
||||
m_a = data & m_data_mask;
|
||||
update_output();
|
||||
}
|
||||
|
||||
@ -95,7 +107,7 @@ WRITE8_MEMBER(ls157_device::b_w)
|
||||
|
||||
void ls157_device::b_w(u8 data)
|
||||
{
|
||||
m_b = data & 0xf;
|
||||
m_b = data & m_data_mask;
|
||||
update_output();
|
||||
}
|
||||
|
||||
@ -112,6 +124,7 @@ WRITE8_MEMBER(ls157_device::ab_w)
|
||||
|
||||
void ls157_device::ab_w(u8 data)
|
||||
{
|
||||
assert(m_data_mask == 0x0f);
|
||||
m_a = data >> 4;
|
||||
m_b = data & 0xf;
|
||||
update_output();
|
||||
@ -130,6 +143,7 @@ WRITE8_MEMBER(ls157_device::ba_w)
|
||||
|
||||
void ls157_device::ba_w(u8 data)
|
||||
{
|
||||
assert(m_data_mask == 0x0f);
|
||||
m_b = data >> 4;
|
||||
m_a = data & 0xf;
|
||||
update_output();
|
||||
@ -148,6 +162,7 @@ WRITE8_MEMBER(ls157_device::interleave_w)
|
||||
|
||||
void ls157_device::interleave_w(u8 data)
|
||||
{
|
||||
assert(m_data_mask == 0x0f);
|
||||
m_b = bitswap<4>(data, 7, 5, 3, 1);
|
||||
m_a = bitswap<4>(data, 6, 4, 2, 0);
|
||||
update_output();
|
||||
@ -251,9 +266,9 @@ void ls157_device::update_output()
|
||||
if (!m_strobe && !m_out_cb.isnull())
|
||||
{
|
||||
if (m_select)
|
||||
m_out_cb(m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & 0xf));
|
||||
m_out_cb(m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & m_data_mask));
|
||||
else
|
||||
m_out_cb(m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & 0xf));
|
||||
m_out_cb(m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & m_data_mask));
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,9 +282,9 @@ READ8_MEMBER(ls157_device::output_r)
|
||||
if (m_strobe)
|
||||
return 0;
|
||||
else if (m_select)
|
||||
return m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & 0xf);
|
||||
return m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & m_data_mask);
|
||||
else
|
||||
return m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & 0xf);
|
||||
return m_a_in_cb.isnull() ? m_a : (m_a_in_cb() & m_data_mask);
|
||||
}
|
||||
|
||||
|
||||
@ -277,10 +292,10 @@ READ8_MEMBER(ls157_device::output_r)
|
||||
// 74HC157 DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(HC157, hc157_device, "74hc157", "74HC157 Quad 2-to-1 Multiplexer")
|
||||
DEFINE_DEVICE_TYPE(HC157, hc157_device, "hc157", "74HC157 Quad 2-to-1 Multiplexer")
|
||||
|
||||
hc157_device::hc157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ls157_device(mconfig, HC157, tag, owner, clock)
|
||||
: ls157_device(mconfig, HC157, tag, owner, clock, 0x0f)
|
||||
{
|
||||
}
|
||||
|
||||
@ -289,9 +304,9 @@ hc157_device::hc157_device(const machine_config &mconfig, const char *tag, devic
|
||||
// 74HCT157 DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(HCT157, hct157_device, "74hct157", "74HCT157 Quad 2-to-1 Multiplexer")
|
||||
DEFINE_DEVICE_TYPE(HCT157, hct157_device, "hct157", "74HCT157 Quad 2-to-1 Multiplexer")
|
||||
|
||||
hct157_device::hct157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: ls157_device(mconfig, HCT157, tag, owner, clock)
|
||||
: ls157_device(mconfig, HCT157, tag, owner, clock, 0x0f)
|
||||
{
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public:
|
||||
DECLARE_READ8_MEMBER(output_r);
|
||||
|
||||
protected:
|
||||
ls157_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
ls157_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 mask);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
@ -97,10 +97,11 @@ private:
|
||||
void write_b_bit(int bit, bool state);
|
||||
void update_output();
|
||||
|
||||
// callbacks
|
||||
// callbacks & configuration
|
||||
devcb_read8 m_a_in_cb;
|
||||
devcb_read8 m_b_in_cb;
|
||||
devcb_write8 m_out_cb;
|
||||
u8 m_data_mask;
|
||||
|
||||
// internal state
|
||||
u8 m_a;
|
||||
@ -109,6 +110,17 @@ private:
|
||||
bool m_strobe;
|
||||
};
|
||||
|
||||
// ======================> ls157_x2_device
|
||||
|
||||
class ls157_x2_device : public ls157_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
ls157_x2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
};
|
||||
|
||||
// ======================> hc157_device
|
||||
|
||||
class hc157_device : public ls157_device
|
||||
{
|
||||
public:
|
||||
@ -116,6 +128,8 @@ public:
|
||||
hc157_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
};
|
||||
|
||||
// ======================> hct157_device
|
||||
|
||||
class hct157_device : public ls157_device
|
||||
{
|
||||
public:
|
||||
@ -128,9 +142,10 @@ public:
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(LS157, ls157_device)
|
||||
DECLARE_DEVICE_TYPE(HC157, hc157_device)
|
||||
DECLARE_DEVICE_TYPE(HCT157, hct157_device)
|
||||
// device type definitions
|
||||
DECLARE_DEVICE_TYPE(LS157, ls157_device)
|
||||
DECLARE_DEVICE_TYPE(LS157_X2, ls157_x2_device)
|
||||
DECLARE_DEVICE_TYPE(HC157, hc157_device)
|
||||
DECLARE_DEVICE_TYPE(HCT157, hct157_device)
|
||||
|
||||
#endif // MAME_MACHINE_74157_H
|
||||
|
@ -1723,30 +1723,20 @@ static MACHINE_CONFIG_START( plotting )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_13_33056MHz/4) /* verified on pcb */
|
||||
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("dswmuxl", ls157_device, output_r)) MCFG_DEVCB_MASK(0x0f)
|
||||
MCFG_DEVCB_CHAIN_INPUT(DEVREAD8("dswmuxh", ls157_device, output_r)) MCFG_DEVCB_RSHIFT(-4) MCFG_DEVCB_MASK(0xf0)
|
||||
MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("inmuxl", ls157_device, output_r)) MCFG_DEVCB_MASK(0x0f)
|
||||
MCFG_DEVCB_CHAIN_INPUT(DEVREAD8("inmuxh", ls157_device, output_r)) MCFG_DEVCB_RSHIFT(-4) MCFG_DEVCB_MASK(0xf0)
|
||||
MCFG_AY8910_PORT_A_READ_CB(DEVREAD8("dswmux", ls157_x2_device, output_r))
|
||||
MCFG_AY8910_PORT_B_READ_CB(DEVREAD8("inmux", ls157_x2_device, output_r))
|
||||
MCFG_SOUND_ROUTE(0, "mono", 0.20)
|
||||
MCFG_SOUND_ROUTE(1, "mono", 0.20)
|
||||
MCFG_SOUND_ROUTE(2, "mono", 0.20)
|
||||
MCFG_SOUND_ROUTE(3, "mono", 0.80)
|
||||
|
||||
MCFG_DEVICE_ADD("dswmuxl", LS157, 0)
|
||||
MCFG_DEVICE_ADD("dswmux", LS157_X2, 0)
|
||||
MCFG_74157_A_IN_CB(IOPORT("DSWA"))
|
||||
MCFG_74157_B_IN_CB(IOPORT("DSWB"))
|
||||
|
||||
MCFG_DEVICE_ADD("dswmuxh", LS157, 0)
|
||||
MCFG_74157_A_IN_CB(IOPORT("DSWA")) MCFG_DEVCB_RSHIFT(4)
|
||||
MCFG_74157_B_IN_CB(IOPORT("DSWB")) MCFG_DEVCB_RSHIFT(4)
|
||||
|
||||
MCFG_DEVICE_ADD("inmuxl", LS157, 0)
|
||||
MCFG_DEVICE_ADD("inmux", LS157_X2, 0)
|
||||
MCFG_74157_A_IN_CB(IOPORT("IN0"))
|
||||
MCFG_74157_B_IN_CB(IOPORT("IN1"))
|
||||
|
||||
MCFG_DEVICE_ADD("inmuxh", LS157, 0)
|
||||
MCFG_74157_A_IN_CB(IOPORT("IN0")) MCFG_DEVCB_RSHIFT(4)
|
||||
MCFG_74157_B_IN_CB(IOPORT("IN1")) MCFG_DEVCB_RSHIFT(4)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1794,10 +1784,8 @@ static MACHINE_CONFIG_DERIVED( palamed, plotting )
|
||||
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
|
||||
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
|
||||
|
||||
MCFG_DEVICE_REMOVE("dswmuxl")
|
||||
MCFG_DEVICE_REMOVE("dswmuxh")
|
||||
MCFG_DEVICE_REMOVE("inmuxl")
|
||||
MCFG_DEVICE_REMOVE("inmuxh")
|
||||
MCFG_DEVICE_REMOVE("dswmux")
|
||||
MCFG_DEVICE_REMOVE("inmux")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -1816,10 +1804,8 @@ static MACHINE_CONFIG_DERIVED( cachat, plotting )
|
||||
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA"))
|
||||
MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB"))
|
||||
|
||||
MCFG_DEVICE_REMOVE("dswmuxl")
|
||||
MCFG_DEVICE_REMOVE("dswmuxh")
|
||||
MCFG_DEVICE_REMOVE("inmuxl")
|
||||
MCFG_DEVICE_REMOVE("inmuxh")
|
||||
MCFG_DEVICE_REMOVE("dswmux")
|
||||
MCFG_DEVICE_REMOVE("inmux")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_START( evilston )
|
||||
|
@ -503,6 +503,7 @@ Reference video: https://www.youtube.com/watch?v=R5OeC6Wc_yI
|
||||
#include "emu.h"
|
||||
#include "includes/williams.h"
|
||||
|
||||
#include "machine/74157.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/volt_reg.h"
|
||||
@ -924,13 +925,14 @@ INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( joust )
|
||||
PORT_START("IN0")
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1")
|
||||
// 0x0f muxed from INP1/INP2
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
// 0xc0 muxed from INP1A/INP2A
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
// 0x03 muxed from INP1A/INP2A
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Auto Up / Manual Down") PORT_TOGGLE PORT_CODE(KEYCODE_F1)
|
||||
@ -942,17 +944,23 @@ static INPUT_PORTS_START( joust )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("INP2") /* muxed into IN0 */
|
||||
PORT_START("INP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("INP1") /* muxed into IN0 */
|
||||
PORT_START("INP1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("INP2A")
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("INP1A")
|
||||
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -983,12 +991,13 @@ INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( splat )
|
||||
PORT_START("IN0")
|
||||
// 0x0f muxed from INP1/INP2
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1")
|
||||
// 0xc0 muxed from INP1A/INP2A
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2A\0INP1A")
|
||||
// 0x03 muxed from INP1A/INP2A
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("IN2")
|
||||
@ -1000,34 +1009,29 @@ static INPUT_PORTS_START( splat )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
|
||||
|
||||
PORT_START("INP2") /* muxed into IN0 */
|
||||
PORT_START("INP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
|
||||
PORT_START("INP1") /* muxed into IN0 */
|
||||
PORT_START("INP1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
|
||||
PORT_START("INP2A") /* muxed into IN1 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
|
||||
PORT_START("INP1A") /* muxed into IN1 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_START("INP2A")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
|
||||
PORT_START("INP1A")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -1200,12 +1204,14 @@ INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( alienar )
|
||||
PORT_START("IN0")
|
||||
// 0x0f muxed from INP1/INP2
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1")
|
||||
// 0xc0 muxed from INP1A/INP2A
|
||||
|
||||
PORT_START("IN1")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
// 0x03 muxed from INP1A/INP2A
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_START("IN2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Auto Up / Manual Down") PORT_TOGGLE PORT_CODE(KEYCODE_F1)
|
||||
@ -1217,25 +1223,25 @@ static INPUT_PORTS_START( alienar )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("INP2") /* muxed into IN0 */
|
||||
PORT_START("INP2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("INP1") /* muxed into IN0 */
|
||||
PORT_START("INP1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("INP2A")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("INP1A")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -1521,7 +1527,21 @@ static MACHINE_CONFIG_DERIVED( williams_muxed, williams )
|
||||
|
||||
/* pia */
|
||||
MCFG_DEVICE_MODIFY("pia_0")
|
||||
MCFG_PIA_CB2_HANDLER(WRITELINE(williams_state, williams_port_select_w))
|
||||
MCFG_PIA_READPA_HANDLER(IOPORT("IN0")) MCFG_DEVCB_MASK(0x30)
|
||||
MCFG_DEVCB_CHAIN_INPUT(DEVREAD8("mux_0", ls157_device, output_r)) MCFG_DEVCB_MASK(0x0f)
|
||||
MCFG_DEVCB_CHAIN_INPUT(DEVREAD8("mux_1", ls157_device, output_r)) MCFG_DEVCB_RSHIFT(-6) MCFG_DEVCB_MASK(0xc0)
|
||||
MCFG_PIA_READPB_HANDLER(IOPORT("IN1")) MCFG_DEVCB_MASK(0xfc)
|
||||
MCFG_DEVCB_CHAIN_INPUT(DEVREAD8("mux_1", ls157_device, output_r)) MCFG_DEVCB_RSHIFT(2) MCFG_DEVCB_MASK(0x03)
|
||||
MCFG_PIA_CB2_HANDLER(DEVWRITELINE("mux_0", ls157_device, select_w))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("mux_1", ls157_device, select_w))
|
||||
|
||||
MCFG_DEVICE_ADD("mux_0", LS157, 0) // IC3 on interface board (actually LS257 with OC tied low)
|
||||
MCFG_74157_A_IN_CB(IOPORT("INP2"))
|
||||
MCFG_74157_B_IN_CB(IOPORT("INP1"))
|
||||
|
||||
MCFG_DEVICE_ADD("mux_1", LS157, 0) // IC4 on interface board (actually LS257 with OC tied low)
|
||||
MCFG_74157_A_IN_CB(IOPORT("INP2A"))
|
||||
MCFG_74157_B_IN_CB(IOPORT("INP1A"))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ public:
|
||||
taitol_1cpu_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: taitol_state(mconfig, type, tag)
|
||||
, m_ymsnd(*this, "ymsnd")
|
||||
, m_mux(*this, {"dswmuxl", "dswmuxh", "inmuxl", "inmuxh"})
|
||||
, m_mux(*this, {"dswmux", "inmux"})
|
||||
{
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ protected:
|
||||
virtual void taito_machine_reset() override;
|
||||
|
||||
required_device<ym2203_device> m_ymsnd;
|
||||
optional_device_array<ls157_device, 4> m_mux;
|
||||
optional_device_array<ls157_x2_device, 2> m_mux;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user