summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/hh_ucom4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/hh_ucom4.c')
-rw-r--r--src/mess/drivers/hh_ucom4.c99
1 files changed, 74 insertions, 25 deletions
diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c
index 4215721dd52..19059d222d0 100644
--- a/src/mess/drivers/hh_ucom4.c
+++ b/src/mess/drivers/hh_ucom4.c
@@ -86,6 +86,10 @@ public:
void tmtennis_set_clock();
DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch);
DECLARE_MACHINE_RESET(tmtennis);
+
+ DECLARE_WRITE8_MEMBER(tmpacman_grid_w);
+ DECLARE_WRITE8_MEMBER(tmpacman_plate_w);
+ DECLARE_WRITE8_MEMBER(tmpacman_port_e_w);
DECLARE_READ8_MEMBER(alnchase_input_r);
DECLARE_WRITE8_MEMBER(alnchase_display_w);
@@ -232,7 +236,7 @@ UINT8 hh_ucom4_state::read_inputs(int columns)
WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w)
{
- // port C/D: vfd matrix grid
+ // ports C,D: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
@@ -241,7 +245,7 @@ WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w)
WRITE8_MEMBER(hh_ucom4_state::edracula_plate_w)
{
- // port E/F/G/H/I01: vfd matrix plate
+ // ports E-H,I01: vfd matrix plate
int shift = (offset - NEC_UCOM4_PORTE) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
@@ -258,13 +262,13 @@ WRITE8_MEMBER(hh_ucom4_state::edracula_port_i_w)
static INPUT_PORTS_START( edracula )
- PORT_START("IN.0")
+ PORT_START("IN.0") // port A
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START("IN.1")
+ PORT_START("IN.1") // port B
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
@@ -321,22 +325,22 @@ MACHINE_CONFIG_END
READ8_MEMBER(hh_ucom4_state::tmtennis_input_r)
{
- // port A/B: buttons
+ // ports A,B: buttons
return ~read_inputs(2) >> (offset*4);
}
-WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w)
+WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w)
{
- // E0/E1: input mux
- // E2: speaker out
- // E3: N/C
- m_inp_mux = data & 3;
- m_speaker->level_w(data >> 2 & 1);
+ // ports G-I: vfd matrix grid
+ int shift = (offset - NEC_UCOM4_PORTG) * 4;
+ m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
+
+ display_matrix(12, 12, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::tmtennis_plate_w)
{
- // port C/D/F: vfd matrix plate
+ // ports C-F: vfd matrix plate
if (offset == NEC_UCOM4_PORTF) offset--;
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
@@ -344,17 +348,16 @@ WRITE8_MEMBER(hh_ucom4_state::tmtennis_plate_w)
display_matrix(12, 12, m_plate, m_grid);
}
-WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w)
+WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w)
{
- // port G/H/I: vfd matrix grid
- int shift = (offset - NEC_UCOM4_PORTG) * 4;
- m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
-
- display_matrix(12, 12, m_plate, m_grid);
+ // E0,E1: input mux
+ // E2: speaker out
+ // E3: N/C
+ m_inp_mux = data & 3;
+ m_speaker->level_w(data >> 2 & 1);
}
-
/* Pro-Tennis physical button layout and labels is like this:
[SERVE] [1] [2] [3] [3] [2] [1] [SERVE]
@@ -456,7 +459,45 @@ MACHINE_CONFIG_END
***************************************************************************/
+WRITE8_MEMBER(hh_ucom4_state::tmpacman_grid_w)
+{
+ // ports C,D: vfd matrix grid
+ int shift = (offset - NEC_UCOM4_PORTC) * 4;
+ m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
+
+ display_matrix(19, 8, m_plate, m_grid);
+}
+
+WRITE8_MEMBER(hh_ucom4_state::tmpacman_plate_w)
+{
+ // ports E-I: vfd matrix plate
+ int shift = (offset - NEC_UCOM4_PORTE) * 4;
+ m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
+
+ display_matrix(19, 8, m_plate, m_grid);
+}
+
+WRITE8_MEMBER(hh_ucom4_state::tmpacman_port_e_w)
+{
+ // E1: speaker out
+ m_speaker->level_w(data >> 1 & 1);
+
+ tmpacman_plate_w(space, offset, data);
+}
+
+
static INPUT_PORTS_START( tmpacman )
+ PORT_START("IN.0") // port A
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 4 separate directional buttons, hence 16way
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY
+
+ PORT_START("IN.1") // port B
+ PORT_CONFNAME( 0x00, 0x00, DEF_STR( Difficulty ) )
+ PORT_CONFSETTING( 0x00, "Amateur" )
+ PORT_CONFSETTING( 0x01, "Professional" )
+ PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
@@ -464,7 +505,17 @@ static MACHINE_CONFIG_START( tmpacman, hh_ucom4_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_430kHz)
+ MCFG_UCOM4_READ_A_CB(IOPORT("IN.0"))
+ MCFG_UCOM4_READ_B_CB(IOPORT("IN.1"))
+ MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, tmpacman_grid_w))
+ MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, tmpacman_grid_w))
+ MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, tmpacman_port_e_w))
+ MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
+ MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
+ MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
+ MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_tmpacman)
/* no video! */
@@ -495,8 +546,6 @@ MACHINE_CONFIG_END
***************************************************************************/
-
-
READ8_MEMBER(hh_ucom4_state::alnchase_input_r)
{
// port A: buttons
@@ -507,7 +556,7 @@ WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w)
{
if (offset <= NEC_UCOM4_PORTE)
{
- // C/D/E0: vfd matrix grid
+ // ports C,D,E0: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
@@ -518,7 +567,7 @@ WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w)
if (offset >= NEC_UCOM4_PORTE)
{
- // E23/F/G/H/I: vfd matrix plate
+ // ports F-I,E23: vfd matrix plate
int shift = (offset - NEC_UCOM4_PORTE) * 4;
m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2;
}
@@ -528,10 +577,10 @@ WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w)
WRITE8_MEMBER(hh_ucom4_state::alnchase_port_e_w)
{
- alnchase_display_w(space, offset, data);
-
// E1: speaker out
m_speaker->level_w(data >> 1 & 1);
+
+ alnchase_display_w(space, offset, data);
}
/* physical button layout and labels is like this: