diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h index 2ee8f2f7a96..38750c0dd6a 100644 --- a/src/emu/cpu/hmcs40/hmcs40.h +++ b/src/emu/cpu/hmcs40/hmcs40.h @@ -27,6 +27,74 @@ hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb); +enum +{ + HMCS40_PORT_R0X = 0, + HMCS40_PORT_R1X, + HMCS40_PORT_R2X, + HMCS40_PORT_R3X, + HMCS40_PORT_R4X, + HMCS40_PORT_R5X, + HMCS40_PORT_R6X, + HMCS40_PORT_R7X +}; + + +// pinout reference + +/* + _________________ + D3 1 |* | 42 D2 + D4 2 | | 41 D1 + D5 3 | | 40 D0 + D6 4 | | 39 R33 + D7 5 | | 38 R32 + D8 6 | | 37 R31 + D9 7 | | 36 R30 + D10 8 | | 35 R23 ....................................... + D11 9 | | 34 R22 : + D12 10 | HD38750 | 33 R21 : + D13 11 | HD38800 | 32 R20 : + D14 12 | | 31 INT1 : + D15 13 | | 30 INT0 : _________________ + Vdisp 14 | | 29 R13 : D4 1 |* | 64 D3 + RESET 15 | | 28 R12 : D5 2 | | 63 D2 + Vbb 16 | | 27 R11 : D6 3 | | 62 D1 + Vdd 17 | | 26 R10 : D7 4 | | 61 D0 + OSC 18 | | 25 R03 : D8 5 | | 60 R63 + 19 | | 24 R02 : D9 6 | | 59 R62 + /TEST 20 | | 23 R01 : 7 | | 58 + Vss 21 |_________________| 22 R00 : 8 | | 57 + 9 | | 56 + D10 10 | | 55 R61 + D8 D7 D6 D5 D4 D3 D2 D1 D0 D11 11 | | 54 R60 + 5 4 3 2 1 54 53 52 51 50 D12 12 | | 53 R33 + __________________________________ D13 13 | | 52 R32 + / | D14 14 | | 51 R31 + D9 6 | | 49 R63 D15 15 | | 50 R30 + D10 7 | | 48 R62 R40 16 | | 49 R23 + D11 8 | | 47 R61 R41 17 | | 48 R22 + D12 9 | | 46 R60 R42 18 | | 47 R21 + D13 10 | | 45 R33 R43 19 | | 46 R20 + D14 11 | | 44 R32 R50 20 | | 45 INT1 + D15 12 | | 43 R31 R51 21 | | 44 INT0 + R40 13 | HD38820 | 42 R30 R52 22 | HD38820 | 43 R13 + R41 14 | (FP-54 pkg) | 41 R23 R53 23 | (DP-64S pkg) | 42 R12 + R42 15 | | 40 R22 Vdisp 24 | | 41 + R43 16 | | 39 R21 25 | | 40 + R50 17 | | 38 R20 RESET 26 | | 39 + R51 18 | | 37 INT1 Vbb 27 | | 38 R11 + R52 19 | | 36 INT0 Vdd 28 | | 37 R10 + R53 20 | | 35 R13 OSC 29 | | 36 R03 + Vdisp 21 | | 34 R12 30 | | 35 R02 + RESET 22 | | 33 R11 /TEST 31 | | 34 R01 + |__________________________________| Vss 32 |_________________| 33 R00 + + 23 24 25 26 27 28 29 30 31 32 + Vbb | OSC | Vss R00 | R02 | R10 + Vdd /TEST R01 R03 +*/ + class hmcs40_cpu_device : public cpu_device { diff --git a/src/emu/cpu/ucom4/ucom4.h b/src/emu/cpu/ucom4/ucom4.h index c215b2336f2..8e872e41c8f 100644 --- a/src/emu/cpu/ucom4/ucom4.h +++ b/src/emu/cpu/ucom4/ucom4.h @@ -59,6 +59,36 @@ enum }; +// pinout reference + +/* + _______ _______ + CL1 1 |* \_/ | 42 CL0 + PC0 2 | | 41 Vgg + PC1 3 | | 40 PB3 + PC2 4 | | 39 PB2 + PC3 5 | | 38 PB1 + /INT 6 | | 37 PB0 + RESET 7 | | 36 PA3 + PD0 8 | | 35 PA2 + PD1 9 | uPD552 | 34 PA1 + PD2 10 | uPD553 | 33 PA0 + PD3 11 | uPD650* | 32 PI2 + PE0 12 | | 31 PI1 + PE1 13 | | 30 PI0 + PE2 14 | | 29 PH3 + PE3 15 | | 28 PH2 + PF0 16 | | 27 PH1 + PF1 17 | | 26 PH0 + PF2 18 | | 25 PG3 + PF3 19 | | 24 PG2 + TEST 20 | | 23 PG1 + Vss 21 |_________________| 22 PG0 + + *: pin 21 is Vcc, pin 41 is Vss + +*/ + class ucom4_cpu_device : public cpu_device { diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 68b84e28596..7a0f93156aa 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -95,6 +95,11 @@ public: DECLARE_WRITE8_MEMBER(alnattck_plate_w); DECLARE_READ16_MEMBER(alnattck_d_r); DECLARE_WRITE16_MEMBER(alnattck_d_w); + + void egalaxn2_display(); + DECLARE_READ8_MEMBER(egalaxn2_input_r); + DECLARE_WRITE8_MEMBER(egalaxn2_plate_w); + DECLARE_WRITE16_MEMBER(egalaxn2_grid_w); }; @@ -566,7 +571,71 @@ MACHINE_CONFIG_END ***************************************************************************/ +void hh_hmcs40_state::egalaxn2_display() +{ + UINT32 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); + UINT32 plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8); + + display_matrix(24, 15, plate, grid); +} + +WRITE16_MEMBER(hh_hmcs40_state::egalaxn2_grid_w) +{ + // D0: speaker out + m_speaker->level_w(data & 1); + + // D1-D4: input mux + m_inp_mux = data >> 1 & 0xf; + + // D1-D15: vfd matrix grid + m_grid = data >> 1; + egalaxn2_display(); +} + +WRITE8_MEMBER(hh_hmcs40_state::egalaxn2_plate_w) +{ + // R10-R63: vfd matrix plate + int shift = (offset - HMCS40_PORT_R1X) * 4; + m_plate = (m_plate & ~(0xf << shift)) | (data << shift); + + egalaxn2_display(); +} + +READ8_MEMBER(hh_hmcs40_state::egalaxn2_input_r) +{ + // R0x: multiplexed inputs + return read_inputs(4); +} + + static INPUT_PORTS_START( egalaxn2 ) + PORT_START("IN.0") // D1 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // " + + PORT_START("IN.1") // D2 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_16WAY // separate directional buttons, hence 16way + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_16WAY // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_16WAY // " + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_16WAY // " + + PORT_START("IN.2") // D3 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // D4 port R0x + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_CONFNAME( 0x02, 0x02, "Skill" ) + PORT_CONFSETTING( 0x02, "1" ) + PORT_CONFSETTING( 0x00, "2" ) + PORT_CONFNAME( 0x0c, 0x00, "Players" ) + PORT_CONFSETTING( 0x08, "0 (Demo)" ) + PORT_CONFSETTING( 0x00, "1" ) + PORT_CONFSETTING( 0x04, "2" ) INPUT_PORTS_END @@ -574,8 +643,16 @@ static MACHINE_CONFIG_START( egalaxn2, hh_hmcs40_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", HD38820, 400000) // approximation - RC osc. + MCFG_HMCS40_READ_R_CB(0, READ8(hh_hmcs40_state, egalaxn2_input_r)) + MCFG_HMCS40_WRITE_R_CB(1, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(2, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(3, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(4, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(5, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_R_CB(6, WRITE8(hh_hmcs40_state, egalaxn2_plate_w)) + MCFG_HMCS40_WRITE_D_CB(WRITE16(hh_hmcs40_state, egalaxn2_grid_w)) -// MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_hmcs40_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_hh_hmcs40_test) /* no video! */ diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index 61af487386e..4eaa029fffc 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -850,10 +850,10 @@ WRITE8_MEMBER(hh_ucom4_state::tmpacman_plate_w) 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_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 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( 0x01, 0x00, DEF_STR( Difficulty ) ) @@ -967,9 +967,9 @@ static INPUT_PORTS_START( alnchase ) PORT_START("IN.1") // D0 port A PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_START("IN.2") // port B PORT_CONFNAME( 0x01, 0x01, "Players" )