trunk/src/mess/drivers/alnchase.c
| r244640 | r244641 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:hap |
| 3 | | /*************************************************************************** |
| 4 | | |
| 5 | | Tomy Alien Chase (manufactured in Japan) |
| 6 | | * boards are labeled TN-16 |
| 7 | | * NEC uCOM-43 MCU, labeled D553C 258 |
| 8 | | * red/green VFD display with color overlay, 2-sided* |
| 9 | | |
| 10 | | *Player one views the VFD from the front (grid+filament side) while the |
| 11 | | opposite player views it from the back side (through the conductive traces), |
| 12 | | basically a mirror-image. |
| 13 | | |
| 14 | | This is a space-themed tabletop VFD electronic game. To start, simply |
| 15 | | press [UP]. Hold a joystick direction to move around. |
| 16 | | |
| 17 | | NOTE!: MESS external artwork is required to be able to play |
| 18 | | |
| 19 | | |
| 20 | | TODO: |
| 21 | | - display should go off when sound is played, needs decay simulation? |
| 22 | | |
| 23 | | ***************************************************************************/ |
| 24 | | |
| 25 | | #include "emu.h" |
| 26 | | #include "cpu/ucom4/ucom4.h" |
| 27 | | #include "sound/speaker.h" |
| 28 | | |
| 29 | | #include "alnchase.lh" // this is a test layout, external artwork is necessary |
| 30 | | |
| 31 | | |
| 32 | | class alnchase_state : public driver_device |
| 33 | | { |
| 34 | | public: |
| 35 | | alnchase_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | | : driver_device(mconfig, type, tag), |
| 37 | | m_maincpu(*this, "maincpu"), |
| 38 | | m_button_matrix(*this, "IN"), |
| 39 | | m_speaker(*this, "speaker") |
| 40 | | { } |
| 41 | | |
| 42 | | required_device<cpu_device> m_maincpu; |
| 43 | | required_ioport_array<2> m_button_matrix; |
| 44 | | required_device<speaker_sound_device> m_speaker; |
| 45 | | |
| 46 | | UINT8 m_input_mux; |
| 47 | | UINT32 m_plate; |
| 48 | | UINT16 m_grid; |
| 49 | | |
| 50 | | DECLARE_READ8_MEMBER(input_r); |
| 51 | | DECLARE_WRITE8_MEMBER(display_w); |
| 52 | | DECLARE_WRITE8_MEMBER(port_e_w); |
| 53 | | |
| 54 | | UINT32 m_vfd_state[0x10]; |
| 55 | | void update_vfd(); |
| 56 | | |
| 57 | | virtual void machine_start(); |
| 58 | | }; |
| 59 | | |
| 60 | | |
| 61 | | |
| 62 | | /*************************************************************************** |
| 63 | | |
| 64 | | Display |
| 65 | | |
| 66 | | ***************************************************************************/ |
| 67 | | |
| 68 | | void alnchase_state::update_vfd() |
| 69 | | { |
| 70 | | for (int i = 0; i < 9; i++) |
| 71 | | if (m_grid & (1 << i) && m_vfd_state[i] != m_plate) |
| 72 | | { |
| 73 | | // on difference, send to output |
| 74 | | for (int j = 0; j < 17; j++) |
| 75 | | output_set_lamp_value(i*100 + j, m_plate >> j & 1); |
| 76 | | |
| 77 | | m_vfd_state[i] = m_plate; |
| 78 | | } |
| 79 | | } |
| 80 | | |
| 81 | | |
| 82 | | |
| 83 | | /*************************************************************************** |
| 84 | | |
| 85 | | I/O |
| 86 | | |
| 87 | | ***************************************************************************/ |
| 88 | | |
| 89 | | READ8_MEMBER(alnchase_state::input_r) |
| 90 | | { |
| 91 | | UINT8 inp = 0; |
| 92 | | |
| 93 | | // read selected button rows |
| 94 | | for (int i = 0; i < 2; i++) |
| 95 | | if (m_input_mux >> i & 1) |
| 96 | | inp |= m_button_matrix[i]->read(); |
| 97 | | |
| 98 | | return inp; |
| 99 | | } |
| 100 | | |
| 101 | | WRITE8_MEMBER(alnchase_state::display_w) |
| 102 | | { |
| 103 | | int shift; |
| 104 | | |
| 105 | | if (offset <= NEC_UCOM4_PORTE) |
| 106 | | { |
| 107 | | // C/D/E0: vfd matrix grid |
| 108 | | shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 109 | | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 110 | | |
| 111 | | // C0(grid 0): input enable PL1 |
| 112 | | // D0(grid 4): input enable PL2 |
| 113 | | m_input_mux = (m_grid & 1) | (m_grid >> 3 & 2); |
| 114 | | } |
| 115 | | |
| 116 | | if (offset >= NEC_UCOM4_PORTE) |
| 117 | | { |
| 118 | | // E23/F/G/H/I: vfd matrix plate |
| 119 | | shift = (offset - NEC_UCOM4_PORTE) * 4; |
| 120 | | m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2; |
| 121 | | } |
| 122 | | |
| 123 | | update_vfd(); |
| 124 | | } |
| 125 | | |
| 126 | | WRITE8_MEMBER(alnchase_state::port_e_w) |
| 127 | | { |
| 128 | | display_w(space, offset, data); |
| 129 | | |
| 130 | | // E1: speaker out |
| 131 | | m_speaker->level_w(data >> 1 & 1); |
| 132 | | } |
| 133 | | |
| 134 | | |
| 135 | | |
| 136 | | /*************************************************************************** |
| 137 | | |
| 138 | | Inputs |
| 139 | | |
| 140 | | ***************************************************************************/ |
| 141 | | |
| 142 | | /* physical button layout and labels is like this: |
| 143 | | |
| 144 | | POWER SOUND LEVEL PLAYER |
| 145 | | ON ON PRO TWO START |
| 146 | | o o | | |
| 147 | | | | | | [joystick] |
| 148 | | | | o o |
| 149 | | OFF OFF AMA ONE GAME 0,1,2,3 |
| 150 | | |
| 151 | | 1 PLAYER SIDE |
| 152 | | |
| 153 | | other player side only has a joystick |
| 154 | | */ |
| 155 | | |
| 156 | | static INPUT_PORTS_START( alnchase ) |
| 157 | | PORT_START("IN.0") // C0 port A |
| 158 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) |
| 159 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 160 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) |
| 161 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) |
| 162 | | |
| 163 | | PORT_START("IN.1") // D0 port A |
| 164 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right |
| 165 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " |
| 166 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 167 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 168 | | |
| 169 | | PORT_START("SW") // port B |
| 170 | | PORT_CONFNAME( 0x01, 0x01, "Players" ) |
| 171 | | PORT_CONFSETTING( 0x01, "1" ) |
| 172 | | PORT_CONFSETTING( 0x00, "2" ) |
| 173 | | PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) ) |
| 174 | | PORT_CONFSETTING( 0x00, "Amateur" ) |
| 175 | | PORT_CONFSETTING( 0x02, "Professional" ) |
| 176 | | PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 177 | | INPUT_PORTS_END |
| 178 | | |
| 179 | | |
| 180 | | |
| 181 | | /*************************************************************************** |
| 182 | | |
| 183 | | Machine Config |
| 184 | | |
| 185 | | ***************************************************************************/ |
| 186 | | |
| 187 | | void alnchase_state::machine_start() |
| 188 | | { |
| 189 | | // zerofill |
| 190 | | memset(m_vfd_state, 0, sizeof(m_vfd_state)); |
| 191 | | m_input_mux = 0; |
| 192 | | m_plate = 0; |
| 193 | | m_grid = 0; |
| 194 | | |
| 195 | | // register for savestates |
| 196 | | save_item(NAME(m_vfd_state)); |
| 197 | | save_item(NAME(m_input_mux)); |
| 198 | | save_item(NAME(m_plate)); |
| 199 | | save_item(NAME(m_grid)); |
| 200 | | } |
| 201 | | |
| 202 | | |
| 203 | | static MACHINE_CONFIG_START( alnchase, alnchase_state ) |
| 204 | | |
| 205 | | /* basic machine hardware */ |
| 206 | | MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) |
| 207 | | MCFG_UCOM4_READ_A_CB(READ8(alnchase_state, input_r)) |
| 208 | | MCFG_UCOM4_READ_B_CB(IOPORT("SW")) |
| 209 | | MCFG_UCOM4_WRITE_C_CB(WRITE8(alnchase_state, display_w)) |
| 210 | | MCFG_UCOM4_WRITE_D_CB(WRITE8(alnchase_state, display_w)) |
| 211 | | MCFG_UCOM4_WRITE_E_CB(WRITE8(alnchase_state, port_e_w)) |
| 212 | | MCFG_UCOM4_WRITE_F_CB(WRITE8(alnchase_state, display_w)) |
| 213 | | MCFG_UCOM4_WRITE_G_CB(WRITE8(alnchase_state, display_w)) |
| 214 | | MCFG_UCOM4_WRITE_H_CB(WRITE8(alnchase_state, display_w)) |
| 215 | | MCFG_UCOM4_WRITE_I_CB(WRITE8(alnchase_state, display_w)) |
| 216 | | |
| 217 | | MCFG_DEFAULT_LAYOUT(layout_alnchase) |
| 218 | | |
| 219 | | /* no video! */ |
| 220 | | |
| 221 | | /* sound hardware */ |
| 222 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 223 | | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 224 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 225 | | MACHINE_CONFIG_END |
| 226 | | |
| 227 | | |
| 228 | | |
| 229 | | /*************************************************************************** |
| 230 | | |
| 231 | | Game driver(s) |
| 232 | | |
| 233 | | ***************************************************************************/ |
| 234 | | |
| 235 | | ROM_START( alnchase ) |
| 236 | | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 237 | | ROM_LOAD( "d553c-258", 0x0000, 0x0800, CRC(c5284ff5) SHA1(6a20aaacc9748f0e0335958f3cea482e36153704) ) |
| 238 | | ROM_END |
| 239 | | |
| 240 | | |
| 241 | | CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
trunk/src/mess/drivers/edracula.c
| r244640 | r244641 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:hap |
| 3 | | /*************************************************************************** |
| 4 | | |
| 5 | | Epoch Dracula (manufactured in Japan) |
| 6 | | * NEC uCOM-43 MCU, labeled D553C 206 |
| 7 | | * cyan/red/green VFD display NEC FIP8BM20T |
| 8 | | |
| 9 | | known releases: |
| 10 | | - Japan: Dracula House, yellow case |
| 11 | | - USA: Dracula, red case |
| 12 | | - Other: Dracula, yellow case, published by Hales |
| 13 | | |
| 14 | | NOTE!: MESS external artwork is required to be able to play |
| 15 | | |
| 16 | | |
| 17 | | TODO: |
| 18 | | - display should go off when sound is played, needs decay simulation? |
| 19 | | |
| 20 | | ***************************************************************************/ |
| 21 | | |
| 22 | | #include "emu.h" |
| 23 | | #include "cpu/ucom4/ucom4.h" |
| 24 | | #include "sound/speaker.h" |
| 25 | | |
| 26 | | #include "edracula.lh" // this is a test layout, external artwork is necessary |
| 27 | | |
| 28 | | |
| 29 | | class edracula_state : public driver_device |
| 30 | | { |
| 31 | | public: |
| 32 | | edracula_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | | : driver_device(mconfig, type, tag), |
| 34 | | m_maincpu(*this, "maincpu"), |
| 35 | | m_speaker(*this, "speaker") |
| 36 | | { } |
| 37 | | |
| 38 | | required_device<cpu_device> m_maincpu; |
| 39 | | required_device<speaker_sound_device> m_speaker; |
| 40 | | |
| 41 | | UINT32 m_plate; |
| 42 | | UINT16 m_grid; |
| 43 | | |
| 44 | | DECLARE_WRITE8_MEMBER(grid_w); |
| 45 | | DECLARE_WRITE8_MEMBER(plate_w); |
| 46 | | DECLARE_WRITE8_MEMBER(port_i_w); |
| 47 | | |
| 48 | | UINT32 m_vfd_state[0x10]; |
| 49 | | void update_vfd(); |
| 50 | | |
| 51 | | virtual void machine_start(); |
| 52 | | }; |
| 53 | | |
| 54 | | |
| 55 | | |
| 56 | | /*************************************************************************** |
| 57 | | |
| 58 | | Display |
| 59 | | |
| 60 | | ***************************************************************************/ |
| 61 | | |
| 62 | | void edracula_state::update_vfd() |
| 63 | | { |
| 64 | | for (int i = 0; i < 8; i++) |
| 65 | | if (m_grid & (1 << i) && m_vfd_state[i] != m_plate) |
| 66 | | { |
| 67 | | // on difference, send to output |
| 68 | | for (int j = 0; j < 18; j++) |
| 69 | | output_set_lamp_value(i*100 + j, m_plate >> j & 1); |
| 70 | | |
| 71 | | m_vfd_state[i] = m_plate; |
| 72 | | } |
| 73 | | } |
| 74 | | |
| 75 | | |
| 76 | | |
| 77 | | /*************************************************************************** |
| 78 | | |
| 79 | | I/O |
| 80 | | |
| 81 | | ***************************************************************************/ |
| 82 | | |
| 83 | | WRITE8_MEMBER(edracula_state::grid_w) |
| 84 | | { |
| 85 | | // port C/D: vfd matrix grid |
| 86 | | int shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 87 | | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 88 | | |
| 89 | | update_vfd(); |
| 90 | | } |
| 91 | | |
| 92 | | WRITE8_MEMBER(edracula_state::plate_w) |
| 93 | | { |
| 94 | | // port E/F/G/H/I01: vfd matrix plate |
| 95 | | int shift = (offset - NEC_UCOM4_PORTE) * 4; |
| 96 | | m_plate = (m_plate & ~(0xf << shift)) | (data << shift); |
| 97 | | |
| 98 | | update_vfd(); |
| 99 | | } |
| 100 | | |
| 101 | | WRITE8_MEMBER(edracula_state::port_i_w) |
| 102 | | { |
| 103 | | plate_w(space, offset, data & 3); |
| 104 | | |
| 105 | | // I2: speaker out |
| 106 | | m_speaker->level_w(data >> 2 & 1); |
| 107 | | } |
| 108 | | |
| 109 | | |
| 110 | | |
| 111 | | /*************************************************************************** |
| 112 | | |
| 113 | | Inputs |
| 114 | | |
| 115 | | ***************************************************************************/ |
| 116 | | |
| 117 | | static INPUT_PORTS_START( edracula ) |
| 118 | | PORT_START("IN0") |
| 119 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) |
| 120 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START ) |
| 121 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 122 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 123 | | |
| 124 | | PORT_START("IN1") |
| 125 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) |
| 126 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) |
| 127 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) |
| 128 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 129 | | INPUT_PORTS_END |
| 130 | | |
| 131 | | |
| 132 | | |
| 133 | | /*************************************************************************** |
| 134 | | |
| 135 | | Machine Config |
| 136 | | |
| 137 | | ***************************************************************************/ |
| 138 | | |
| 139 | | void edracula_state::machine_start() |
| 140 | | { |
| 141 | | // zerofill |
| 142 | | memset(m_vfd_state, 0, sizeof(m_vfd_state)); |
| 143 | | m_plate = 0; |
| 144 | | m_grid = 0; |
| 145 | | |
| 146 | | // register for savestates |
| 147 | | save_item(NAME(m_vfd_state)); |
| 148 | | save_item(NAME(m_plate)); |
| 149 | | save_item(NAME(m_grid)); |
| 150 | | } |
| 151 | | |
| 152 | | |
| 153 | | static MACHINE_CONFIG_START( edracula, edracula_state ) |
| 154 | | |
| 155 | | /* basic machine hardware */ |
| 156 | | MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) |
| 157 | | MCFG_UCOM4_READ_A_CB(IOPORT("IN0")) |
| 158 | | MCFG_UCOM4_READ_B_CB(IOPORT("IN1")) |
| 159 | | MCFG_UCOM4_WRITE_C_CB(WRITE8(edracula_state, grid_w)) |
| 160 | | MCFG_UCOM4_WRITE_D_CB(WRITE8(edracula_state, grid_w)) |
| 161 | | MCFG_UCOM4_WRITE_E_CB(WRITE8(edracula_state, plate_w)) |
| 162 | | MCFG_UCOM4_WRITE_F_CB(WRITE8(edracula_state, plate_w)) |
| 163 | | MCFG_UCOM4_WRITE_G_CB(WRITE8(edracula_state, plate_w)) |
| 164 | | MCFG_UCOM4_WRITE_H_CB(WRITE8(edracula_state, plate_w)) |
| 165 | | MCFG_UCOM4_WRITE_I_CB(WRITE8(edracula_state, port_i_w)) |
| 166 | | |
| 167 | | MCFG_DEFAULT_LAYOUT(layout_edracula) |
| 168 | | |
| 169 | | /* no video! */ |
| 170 | | |
| 171 | | /* sound hardware */ |
| 172 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 173 | | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 174 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 175 | | MACHINE_CONFIG_END |
| 176 | | |
| 177 | | |
| 178 | | |
| 179 | | /*************************************************************************** |
| 180 | | |
| 181 | | Game driver(s) |
| 182 | | |
| 183 | | ***************************************************************************/ |
| 184 | | |
| 185 | | ROM_START( edracula ) |
| 186 | | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 187 | | ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) ) |
| 188 | | ROM_END |
| 189 | | |
| 190 | | |
| 191 | | CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
trunk/src/mess/drivers/hh_ucom4.c
| r244640 | r244641 | |
| 4 | 4 | |
| 5 | 5 | NEC uCOM4 MCU handhelds |
| 6 | 6 | |
| 7 | NOTE!: MESS external artwork is required for most of the games |
| 7 | 8 | |
| 9 | |
| 10 | serial device etc |
| 11 | ------------------------------------------ |
| 12 | @048 uPD552 1980, Tomy Tennis |
| 13 | *085 uPD650 1980, Roland TR-808 |
| 14 | 102 uPD553 1981, Bandai Block Out |
| 15 | *128 uPD650 1982, Roland TR-606 |
| 16 | 133 uPD650 1982, Roland TB-303 |
| 17 | @160 uPD553 1982, Tomy Pac Man |
| 18 | @206 uPD553 1982, Epoch Dracula |
| 19 | @258 uPD553 1984, Tomy Alien Chase |
| 20 | |
| 21 | (* denotes not yet emulated by MESS, @ denotes it's in this driver) |
| 22 | |
| 8 | 23 | ***************************************************************************/ |
| 9 | 24 | |
| 10 | 25 | #include "emu.h" |
| 11 | 26 | #include "cpu/ucom4/ucom4.h" |
| 12 | 27 | #include "sound/speaker.h" |
| 13 | 28 | |
| 29 | // test-layouts for vfd games |
| 30 | #include "alnchase.lh" |
| 31 | #include "edracula.lh" |
| 14 | 32 | #include "tmpacman.lh" |
| 33 | #include "tmtennis.lh" |
| 15 | 34 | |
| 16 | 35 | |
| 17 | 36 | class hh_ucom4_state : public driver_device |
| r244640 | r244641 | |
| 35 | 54 | // misc common |
| 36 | 55 | UINT16 m_inp_mux; |
| 37 | 56 | |
| 57 | UINT8 read_inputs(int columns); |
| 58 | |
| 38 | 59 | virtual void machine_start(); |
| 39 | 60 | virtual void machine_reset(); |
| 40 | 61 | |
| r244640 | r244641 | |
| 53 | 74 | |
| 54 | 75 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 55 | 76 | void display_update(); |
| 77 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); |
| 56 | 78 | |
| 57 | 79 | // game-specific handlers |
| 80 | DECLARE_WRITE8_MEMBER(edracula_grid_w); |
| 81 | DECLARE_WRITE8_MEMBER(edracula_plate_w); |
| 82 | DECLARE_WRITE8_MEMBER(edracula_port_i_w); |
| 58 | 83 | |
| 84 | DECLARE_READ8_MEMBER(tmtennis_input_r); |
| 85 | DECLARE_WRITE8_MEMBER(tmtennis_grid_w); |
| 86 | DECLARE_WRITE8_MEMBER(tmtennis_plate_w); |
| 87 | DECLARE_WRITE8_MEMBER(tmtennis_port_e_w); |
| 88 | void tmtennis_set_clock(); |
| 89 | DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch); |
| 90 | DECLARE_MACHINE_RESET(tmtennis); |
| 91 | |
| 92 | DECLARE_READ8_MEMBER(alnchase_input_r); |
| 93 | DECLARE_WRITE8_MEMBER(alnchase_display_w); |
| 94 | DECLARE_WRITE8_MEMBER(alnchase_port_e_w); |
| 59 | 95 | }; |
| 60 | 96 | |
| 61 | 97 | |
| r244640 | r244641 | |
| 162 | 198 | display_update(); |
| 163 | 199 | } |
| 164 | 200 | |
| 201 | void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) |
| 202 | { |
| 203 | m_display_maxx = maxx; |
| 204 | m_display_maxy = maxy; |
| 165 | 205 | |
| 206 | // update current state |
| 207 | for (int y = 0; y < maxy; y++) |
| 208 | m_display_state[y] = (sety >> y & 1) ? setx : 0; |
| 209 | |
| 210 | display_update(); |
| 211 | } |
| 166 | 212 | |
| 213 | |
| 214 | UINT8 hh_ucom4_state::read_inputs(int columns) |
| 215 | { |
| 216 | UINT8 ret = 0; |
| 217 | |
| 218 | // read selected input rows |
| 219 | for (int i = 0; i < columns; i++) |
| 220 | if (m_inp_mux >> i & 1) |
| 221 | ret |= m_inp_matrix[i]->read(); |
| 222 | |
| 223 | return ret; |
| 224 | } |
| 225 | |
| 226 | |
| 167 | 227 | /*************************************************************************** |
| 168 | 228 | |
| 169 | 229 | Minidrivers (I/O, Inputs, Machine Config) |
| r244640 | r244641 | |
| 172 | 232 | |
| 173 | 233 | /*************************************************************************** |
| 174 | 234 | |
| 175 | | Tomytronic Pac-Man (manufactured in Japan) |
| 235 | Epoch Dracula (manufactured in Japan) |
| 236 | * PCB label 96121 |
| 237 | * NEC uCOM-43 MCU, labeled D553C 206 |
| 238 | * cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel) |
| 239 | |
| 240 | known releases: |
| 241 | - Japan: Dracula House, yellow case |
| 242 | - USA: Dracula, red case |
| 243 | - Other: Dracula, yellow case, published by Hales |
| 244 | |
| 245 | |
| 246 | |
| 247 | ***************************************************************************/ |
| 248 | |
| 249 | WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w) |
| 250 | { |
| 251 | // port C/D: vfd matrix grid |
| 252 | int shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 253 | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 254 | |
| 255 | display_matrix(18, 8, m_plate, m_grid); |
| 256 | } |
| 257 | |
| 258 | WRITE8_MEMBER(hh_ucom4_state::edracula_plate_w) |
| 259 | { |
| 260 | // port E/F/G/H/I01: vfd matrix plate |
| 261 | int shift = (offset - NEC_UCOM4_PORTE) * 4; |
| 262 | m_plate = (m_plate & ~(0xf << shift)) | (data << shift); |
| 263 | |
| 264 | display_matrix(18, 8, m_plate, m_grid); |
| 265 | } |
| 266 | |
| 267 | WRITE8_MEMBER(hh_ucom4_state::edracula_port_i_w) |
| 268 | { |
| 269 | edracula_plate_w(space, offset, data & 3); |
| 270 | |
| 271 | // I2: speaker out |
| 272 | m_speaker->level_w(data >> 2 & 1); |
| 273 | } |
| 274 | |
| 275 | |
| 276 | static INPUT_PORTS_START( edracula ) |
| 277 | PORT_START("IN.0") |
| 278 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT ) |
| 279 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START ) |
| 280 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 281 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 282 | |
| 283 | PORT_START("IN.1") |
| 284 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) |
| 285 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) |
| 286 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) |
| 287 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 288 | INPUT_PORTS_END |
| 289 | |
| 290 | |
| 291 | static MACHINE_CONFIG_START( edracula, hh_ucom4_state ) |
| 292 | |
| 293 | /* basic machine hardware */ |
| 294 | MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) |
| 295 | MCFG_UCOM4_READ_A_CB(IOPORT("IN.0")) |
| 296 | MCFG_UCOM4_READ_B_CB(IOPORT("IN.1")) |
| 297 | MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, edracula_grid_w)) |
| 298 | MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, edracula_grid_w)) |
| 299 | MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, edracula_plate_w)) |
| 300 | MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, edracula_plate_w)) |
| 301 | MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, edracula_plate_w)) |
| 302 | MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, edracula_plate_w)) |
| 303 | MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, edracula_port_i_w)) |
| 304 | |
| 305 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1)) |
| 306 | MCFG_DEFAULT_LAYOUT(layout_edracula) |
| 307 | |
| 308 | /* no video! */ |
| 309 | |
| 310 | /* sound hardware */ |
| 311 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 312 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 313 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 314 | MACHINE_CONFIG_END |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | /*************************************************************************** |
| 320 | |
| 321 | Tomy(tronic) Tennis (manufactured in Japan) |
| 322 | * board labeled TOMY TN-04 TENNIS |
| 323 | * NEC uCOM-44 MCU, labeled D552C 048 |
| 324 | * VFD display NEC FIP11AM15T |
| 325 | |
| 326 | The initial release of this game was in 1979, known as Pro-Tennis, |
| 327 | it has a D553 instead of D552, with just a little over 50% ROM used. |
| 328 | |
| 329 | This is an early VFD simple electronic tennis game. Player 1 is on the right |
| 330 | side, player 2 or CPU on the left. Each player has six possible positions |
| 331 | where to hit the ball. A backdrop behind the VFD shows a tennis court. |
| 332 | |
| 333 | |
| 334 | ***************************************************************************/ |
| 335 | |
| 336 | |
| 337 | READ8_MEMBER(hh_ucom4_state::tmtennis_input_r) |
| 338 | { |
| 339 | // port A/B: buttons |
| 340 | return ~read_inputs(2) >> (offset*4); |
| 341 | } |
| 342 | |
| 343 | WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w) |
| 344 | { |
| 345 | // E0/E1: input mux |
| 346 | // E2: speaker out |
| 347 | // E3: N/C |
| 348 | m_inp_mux = data & 3; |
| 349 | m_speaker->level_w(data >> 2 & 1); |
| 350 | } |
| 351 | |
| 352 | WRITE8_MEMBER(hh_ucom4_state::tmtennis_plate_w) |
| 353 | { |
| 354 | // port C/D/F: vfd matrix plate |
| 355 | if (offset == NEC_UCOM4_PORTF) offset--; |
| 356 | int shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 357 | m_plate = (m_plate & ~(0xf << shift)) | (data << shift); |
| 358 | |
| 359 | display_matrix(12, 12, m_plate, m_grid); |
| 360 | } |
| 361 | |
| 362 | WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w) |
| 363 | { |
| 364 | // port G/H/I: vfd matrix grid |
| 365 | int shift = (offset - NEC_UCOM4_PORTG) * 4; |
| 366 | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 367 | |
| 368 | display_matrix(12, 12, m_plate, m_grid); |
| 369 | } |
| 370 | |
| 371 | |
| 372 | |
| 373 | /* Pro-Tennis physical button layout and labels is like this: |
| 374 | |
| 375 | [SERVE] [1] [2] [3] [3] [2] [1] [SERVE] |
| 376 | [4] [5] [6] [6] [5] [4] |
| 377 | |
| 378 | PRACTICE<--PRO1-->PRO2 1PLAYER<--OFF-->2PLAYER |
| 379 | */ |
| 380 | |
| 381 | static INPUT_PORTS_START( tmtennis ) |
| 382 | PORT_START("IN.0") // E0 port A/B |
| 383 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Serve") |
| 384 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Serve") |
| 385 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| 386 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) |
| 387 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) |
| 388 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) |
| 389 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) |
| 390 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) |
| 391 | |
| 392 | PORT_START("IN.1") // E1 port A/B |
| 393 | PORT_CONFNAME( 0x101, 0x100, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_ucom4_state, tmtennis_difficulty_switch, NULL) |
| 394 | PORT_CONFSETTING( 0x001, "Practice" ) |
| 395 | PORT_CONFSETTING( 0x100, "Pro 1" ) // -> tmtennis_difficulty_switch |
| 396 | PORT_CONFSETTING( 0x000, "Pro 2" ) |
| 397 | PORT_CONFNAME( 0x02, 0x00, "Players" ) |
| 398 | PORT_CONFSETTING( 0x00, "1" ) |
| 399 | PORT_CONFSETTING( 0x02, "2" ) |
| 400 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 401 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 402 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 403 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) |
| 404 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 405 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) |
| 406 | INPUT_PORTS_END |
| 407 | |
| 408 | void hh_ucom4_state::tmtennis_set_clock() |
| 409 | { |
| 410 | // MCU clock is from an LC circuit oscillating by default at ~360kHz, |
| 411 | // but on PRO1, the difficulty switch puts a capacitor across the LC circuit |
| 412 | // to slow it down to ~260kHz. |
| 413 | m_maincpu->set_unscaled_clock(m_inp_matrix[1]->read() & 0x100 ? 260000 : 360000); |
| 414 | } |
| 415 | |
| 416 | INPUT_CHANGED_MEMBER(hh_ucom4_state::tmtennis_difficulty_switch) |
| 417 | { |
| 418 | tmtennis_set_clock(); |
| 419 | } |
| 420 | |
| 421 | MACHINE_RESET_MEMBER(hh_ucom4_state, tmtennis) |
| 422 | { |
| 423 | machine_reset(); // common |
| 424 | tmtennis_set_clock(); |
| 425 | } |
| 426 | |
| 427 | |
| 428 | static MACHINE_CONFIG_START( tmtennis, hh_ucom4_state ) |
| 429 | |
| 430 | /* basic machine hardware */ |
| 431 | MCFG_CPU_ADD("maincpu", NEC_D552, 360000) // see tmtennis_set_clock |
| 432 | MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, tmtennis_input_r)) |
| 433 | MCFG_UCOM4_READ_B_CB(READ8(hh_ucom4_state, tmtennis_input_r)) |
| 434 | MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w)) |
| 435 | MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w)) |
| 436 | MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, tmtennis_port_e_w)) |
| 437 | MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w)) |
| 438 | MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w)) |
| 439 | MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w)) |
| 440 | MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w)) |
| 441 | |
| 442 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1)) |
| 443 | MCFG_DEFAULT_LAYOUT(layout_tmtennis) |
| 444 | |
| 445 | MCFG_MACHINE_RESET_OVERRIDE(hh_ucom4_state, tmtennis) |
| 446 | |
| 447 | /* no video! */ |
| 448 | |
| 449 | /* sound hardware */ |
| 450 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 451 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 452 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 453 | MACHINE_CONFIG_END |
| 454 | |
| 455 | /*************************************************************************** |
| 456 | |
| 457 | Tomy(tronic) Pac-Man (manufactured in Japan) |
| 176 | 458 | * boards are labeled TN-08 2E108E01 |
| 177 | 459 | * NEC uCOM-43 MCU, labeled D553C 160 |
| 178 | 460 | * cyan/red/green VFD display NEC FIP8AM18T |
| r244640 | r244641 | |
| 207 | 489 | |
| 208 | 490 | |
| 209 | 491 | |
| 492 | /*************************************************************************** |
| 210 | 493 | |
| 494 | Tomy Alien Chase (manufactured in Japan) |
| 495 | * boards are labeled TN-16 2E121B01 |
| 496 | * NEC uCOM-43 MCU, labeled D553C 258 |
| 497 | * red/green VFD display NEC FIP9AM24T with color overlay, 2-sided* |
| 211 | 498 | |
| 499 | *Player one views the VFD from the front (grid+filament side) while the |
| 500 | opposite player views it from the back side (through the conductive traces), |
| 501 | basically a mirror-image. |
| 212 | 502 | |
| 503 | This is a space-themed tabletop VFD electronic game. To start, simply |
| 504 | press [UP]. Hold a joystick direction to move around. |
| 213 | 505 | |
| 506 | ***************************************************************************/ |
| 507 | |
| 508 | |
| 509 | |
| 510 | READ8_MEMBER(hh_ucom4_state::alnchase_input_r) |
| 511 | { |
| 512 | // port A: buttons |
| 513 | return read_inputs(2); |
| 514 | } |
| 515 | |
| 516 | WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w) |
| 517 | { |
| 518 | if (offset <= NEC_UCOM4_PORTE) |
| 519 | { |
| 520 | // C/D/E0: vfd matrix grid |
| 521 | int shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 522 | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 523 | |
| 524 | // C0(grid 0): input enable PL1 |
| 525 | // D0(grid 4): input enable PL2 |
| 526 | m_inp_mux = (m_grid & 1) | (m_grid >> 3 & 2); |
| 527 | } |
| 528 | |
| 529 | if (offset >= NEC_UCOM4_PORTE) |
| 530 | { |
| 531 | // E23/F/G/H/I: vfd matrix plate |
| 532 | int shift = (offset - NEC_UCOM4_PORTE) * 4; |
| 533 | m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2; |
| 534 | } |
| 535 | |
| 536 | display_matrix(17, 9, m_plate, m_grid); |
| 537 | } |
| 538 | |
| 539 | WRITE8_MEMBER(hh_ucom4_state::alnchase_port_e_w) |
| 540 | { |
| 541 | alnchase_display_w(space, offset, data); |
| 542 | |
| 543 | // E1: speaker out |
| 544 | m_speaker->level_w(data >> 1 & 1); |
| 545 | } |
| 546 | |
| 547 | /* physical button layout and labels is like this: |
| 548 | |
| 549 | POWER SOUND LEVEL PLAYER |
| 550 | ON ON PRO TWO START |
| 551 | o o | | |
| 552 | | | | | [joystick] |
| 553 | | | o o |
| 554 | OFF OFF AMA ONE GAME 0,1,2,3 |
| 555 | |
| 556 | 1 PLAYER SIDE |
| 557 | |
| 558 | other player side only has a joystick |
| 559 | */ |
| 560 | |
| 561 | static INPUT_PORTS_START( alnchase ) |
| 562 | PORT_START("IN.0") // C0 port A |
| 563 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) |
| 564 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) |
| 565 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) |
| 566 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) |
| 567 | |
| 568 | PORT_START("IN.1") // D0 port A |
| 569 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right |
| 570 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // " |
| 571 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 572 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 573 | |
| 574 | PORT_START("IN.2") // port B |
| 575 | PORT_CONFNAME( 0x01, 0x01, "Players" ) |
| 576 | PORT_CONFSETTING( 0x01, "1" ) |
| 577 | PORT_CONFSETTING( 0x00, "2" ) |
| 578 | PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) ) |
| 579 | PORT_CONFSETTING( 0x00, "Amateur" ) |
| 580 | PORT_CONFSETTING( 0x02, "Professional" ) |
| 581 | PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 582 | INPUT_PORTS_END |
| 583 | |
| 584 | static MACHINE_CONFIG_START( alnchase, hh_ucom4_state ) |
| 585 | |
| 586 | /* basic machine hardware */ |
| 587 | MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) |
| 588 | MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, alnchase_input_r)) |
| 589 | MCFG_UCOM4_READ_B_CB(IOPORT("IN.2")) |
| 590 | MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 591 | MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 592 | MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, alnchase_port_e_w)) |
| 593 | MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 594 | MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 595 | MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 596 | MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, alnchase_display_w)) |
| 597 | |
| 598 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1)) |
| 599 | MCFG_DEFAULT_LAYOUT(layout_alnchase) |
| 600 | |
| 601 | /* no video! */ |
| 602 | |
| 603 | /* sound hardware */ |
| 604 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 605 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 606 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 607 | MACHINE_CONFIG_END |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 214 | 613 | /*************************************************************************** |
| 215 | 614 | |
| 216 | 615 | Game driver(s) |
| 217 | 616 | |
| 218 | 617 | ***************************************************************************/ |
| 219 | 618 | |
| 619 | ROM_START( edracula ) |
| 620 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 621 | ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) ) |
| 622 | ROM_END |
| 623 | |
| 624 | |
| 625 | ROM_START( tmtennis ) |
| 626 | ROM_REGION( 0x0400, "maincpu", 0 ) |
| 627 | ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) ) |
| 628 | ROM_END |
| 629 | |
| 630 | |
| 631 | |
| 220 | 632 | ROM_START( tmpacman ) |
| 221 | 633 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 222 | 634 | ROM_LOAD( "d553c-160", 0x0000, 0x0800, CRC(b21a8af7) SHA1(e3122be1873ce76a4067386bf250802776f0c2f9) ) |
| 223 | 635 | ROM_END |
| 224 | 636 | |
| 225 | 637 | |
| 226 | | CONS( 1981, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) |
| 638 | ROM_START( alnchase ) |
| 639 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 640 | ROM_LOAD( "d553c-258", 0x0000, 0x0800, CRC(c5284ff5) SHA1(6a20aaacc9748f0e0335958f3cea482e36153704) ) |
| 641 | ROM_END |
| 642 | |
| 643 | |
| 644 | |
| 645 | CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 646 | |
| 647 | CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 648 | CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING ) |
| 649 | CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
trunk/src/mess/drivers/tmtennis.c
| r244640 | r244641 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:hap |
| 3 | | /*************************************************************************** |
| 4 | | |
| 5 | | Tomy Tennis (manufactured in Japan) |
| 6 | | * board labeled TOMY TN-04 TENNIS |
| 7 | | * NEC uCOM-44 MCU, labeled D552C 048 |
| 8 | | * VFD display NEC FIP11AM15T (FIP=fluorescent indicator panel) |
| 9 | | |
| 10 | | The initial release of this game was in 1979, known as Pro-Tennis, |
| 11 | | it is unknown if the hardware and/or ROM contents differ. |
| 12 | | |
| 13 | | This is an early VFD simple electronic tennis game. Player 1 is on the right |
| 14 | | side, player 2 or CPU on the left. Each player has six possible positions |
| 15 | | where to hit the ball. A backdrop behind the VFD shows a tennis court. |
| 16 | | |
| 17 | | NOTE!: MESS external artwork is required to be able to play |
| 18 | | |
| 19 | | |
| 20 | | TODO: |
| 21 | | - display should go off when sound is played, needs decay simulation? |
| 22 | | |
| 23 | | ***************************************************************************/ |
| 24 | | |
| 25 | | #include "emu.h" |
| 26 | | #include "cpu/ucom4/ucom4.h" |
| 27 | | #include "sound/speaker.h" |
| 28 | | |
| 29 | | #include "tmtennis.lh" // this is a test layout, external artwork is necessary |
| 30 | | |
| 31 | | |
| 32 | | class tmtennis_state : public driver_device |
| 33 | | { |
| 34 | | public: |
| 35 | | tmtennis_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | | : driver_device(mconfig, type, tag), |
| 37 | | m_maincpu(*this, "maincpu"), |
| 38 | | m_button_matrix(*this, "IN"), |
| 39 | | m_speaker(*this, "speaker") |
| 40 | | { } |
| 41 | | |
| 42 | | required_device<cpu_device> m_maincpu; |
| 43 | | required_ioport_array<2> m_button_matrix; |
| 44 | | required_device<speaker_sound_device> m_speaker; |
| 45 | | |
| 46 | | UINT8 m_input_mux; |
| 47 | | UINT16 m_plate; |
| 48 | | UINT16 m_grid; |
| 49 | | |
| 50 | | DECLARE_READ8_MEMBER(input_r); |
| 51 | | DECLARE_WRITE8_MEMBER(port_e_w); |
| 52 | | DECLARE_WRITE8_MEMBER(plate_w); |
| 53 | | DECLARE_WRITE8_MEMBER(grid_w); |
| 54 | | |
| 55 | | DECLARE_INPUT_CHANGED_MEMBER(difficulty_switch); |
| 56 | | void update_clock(); |
| 57 | | |
| 58 | | UINT16 m_vfd_state[0x10]; |
| 59 | | void update_vfd(); |
| 60 | | |
| 61 | | virtual void machine_reset(); |
| 62 | | virtual void machine_start(); |
| 63 | | }; |
| 64 | | |
| 65 | | // master clock is from an LC circuit oscillating by default at 360kHz, but... |
| 66 | | #define MASTER_CLOCK (360000) |
| 67 | | |
| 68 | | void tmtennis_state::update_clock() |
| 69 | | { |
| 70 | | // ...on PRO1, the difficulty switch puts a capacitor across the LC circuit |
| 71 | | // to slow it down to approx. 260kHz (28%) |
| 72 | | m_maincpu->set_clock_scale(m_button_matrix[1]->read() & 0x100 ? 0.72 : 1); |
| 73 | | } |
| 74 | | |
| 75 | | |
| 76 | | |
| 77 | | /*************************************************************************** |
| 78 | | |
| 79 | | Display |
| 80 | | |
| 81 | | ***************************************************************************/ |
| 82 | | |
| 83 | | void tmtennis_state::update_vfd() |
| 84 | | { |
| 85 | | for (int i = 0; i < 12; i++) |
| 86 | | if (m_grid & (1 << i) && m_vfd_state[i] != m_plate) |
| 87 | | { |
| 88 | | // on difference, send to output |
| 89 | | for (int j = 0; j < 12; j++) |
| 90 | | output_set_lamp_value(i*100 + j, m_plate >> j & 1); |
| 91 | | |
| 92 | | m_vfd_state[i] = m_plate; |
| 93 | | } |
| 94 | | } |
| 95 | | |
| 96 | | |
| 97 | | |
| 98 | | /*************************************************************************** |
| 99 | | |
| 100 | | I/O |
| 101 | | |
| 102 | | ***************************************************************************/ |
| 103 | | |
| 104 | | READ8_MEMBER(tmtennis_state::input_r) |
| 105 | | { |
| 106 | | // port A/B: buttons |
| 107 | | UINT8 inp = 0xff; |
| 108 | | |
| 109 | | // read selected button rows |
| 110 | | for (int i = 0; i < 2; i++) |
| 111 | | if (m_input_mux >> i & 1) |
| 112 | | inp &= m_button_matrix[i]->read(); |
| 113 | | |
| 114 | | return inp >> (offset*4); |
| 115 | | } |
| 116 | | |
| 117 | | WRITE8_MEMBER(tmtennis_state::port_e_w) |
| 118 | | { |
| 119 | | // E0/E1: input mux |
| 120 | | // E2: speaker out |
| 121 | | // E3: N/C |
| 122 | | m_input_mux = data & 3; |
| 123 | | m_speaker->level_w(data >> 2 & 1); |
| 124 | | } |
| 125 | | |
| 126 | | WRITE8_MEMBER(tmtennis_state::plate_w) |
| 127 | | { |
| 128 | | // port C/D/F: vfd matrix plate |
| 129 | | if (offset == NEC_UCOM4_PORTF) offset--; |
| 130 | | int shift = (offset - NEC_UCOM4_PORTC) * 4; |
| 131 | | m_plate = (m_plate & ~(0xf << shift)) | (data << shift); |
| 132 | | |
| 133 | | update_vfd(); |
| 134 | | } |
| 135 | | |
| 136 | | WRITE8_MEMBER(tmtennis_state::grid_w) |
| 137 | | { |
| 138 | | // port G/H/I: vfd matrix grid |
| 139 | | int shift = (offset - NEC_UCOM4_PORTG) * 4; |
| 140 | | m_grid = (m_grid & ~(0xf << shift)) | (data << shift); |
| 141 | | |
| 142 | | update_vfd(); |
| 143 | | } |
| 144 | | |
| 145 | | |
| 146 | | |
| 147 | | /*************************************************************************** |
| 148 | | |
| 149 | | Inputs |
| 150 | | |
| 151 | | ***************************************************************************/ |
| 152 | | |
| 153 | | INPUT_CHANGED_MEMBER(tmtennis_state::difficulty_switch) |
| 154 | | { |
| 155 | | update_clock(); |
| 156 | | } |
| 157 | | |
| 158 | | /* Pro-Tennis physical button layout and labels is like this: |
| 159 | | |
| 160 | | [SERVE] [1] [2] [3] [3] [2] [1] [SERVE] |
| 161 | | [4] [5] [6] [6] [5] [4] |
| 162 | | |
| 163 | | PRACTICE<--PRO1-->PRO2 1PLAYER<--OFF-->2PLAYER |
| 164 | | */ |
| 165 | | |
| 166 | | static INPUT_PORTS_START( tmtennis ) |
| 167 | | PORT_START("IN.0") // E0 port A/B |
| 168 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Serve") |
| 169 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Serve") |
| 170 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 171 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) |
| 172 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 173 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) |
| 174 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 175 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) |
| 176 | | |
| 177 | | PORT_START("IN.1") // E1 port A/B |
| 178 | | PORT_CONFNAME( 0x101, 0x101, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, tmtennis_state, difficulty_switch, NULL) |
| 179 | | PORT_CONFSETTING( 0x000, "Practice" ) |
| 180 | | PORT_CONFSETTING( 0x101, "Pro 1" ) // -> difficulty_switch |
| 181 | | PORT_CONFSETTING( 0x001, "Pro 2" ) |
| 182 | | PORT_CONFNAME( 0x02, 0x02, "Players" ) |
| 183 | | PORT_CONFSETTING( 0x02, "1" ) |
| 184 | | PORT_CONFSETTING( 0x00, "2" ) |
| 185 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 186 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) |
| 187 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 188 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) |
| 189 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 190 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) |
| 191 | | INPUT_PORTS_END |
| 192 | | |
| 193 | | |
| 194 | | |
| 195 | | /*************************************************************************** |
| 196 | | |
| 197 | | Machine Config |
| 198 | | |
| 199 | | ***************************************************************************/ |
| 200 | | |
| 201 | | void tmtennis_state::machine_reset() |
| 202 | | { |
| 203 | | update_clock(); |
| 204 | | } |
| 205 | | |
| 206 | | void tmtennis_state::machine_start() |
| 207 | | { |
| 208 | | // zerofill |
| 209 | | memset(m_vfd_state, 0, sizeof(m_vfd_state)); |
| 210 | | m_input_mux = 0; |
| 211 | | m_plate = 0; |
| 212 | | m_grid = 0; |
| 213 | | |
| 214 | | // register for savestates |
| 215 | | save_item(NAME(m_vfd_state)); |
| 216 | | save_item(NAME(m_input_mux)); |
| 217 | | save_item(NAME(m_plate)); |
| 218 | | save_item(NAME(m_grid)); |
| 219 | | } |
| 220 | | |
| 221 | | |
| 222 | | static MACHINE_CONFIG_START( tmtennis, tmtennis_state ) |
| 223 | | |
| 224 | | /* basic machine hardware */ |
| 225 | | MCFG_CPU_ADD("maincpu", NEC_D552, MASTER_CLOCK) |
| 226 | | MCFG_UCOM4_READ_A_CB(READ8(tmtennis_state, input_r)) |
| 227 | | MCFG_UCOM4_READ_B_CB(READ8(tmtennis_state, input_r)) |
| 228 | | MCFG_UCOM4_WRITE_C_CB(WRITE8(tmtennis_state, plate_w)) |
| 229 | | MCFG_UCOM4_WRITE_D_CB(WRITE8(tmtennis_state, plate_w)) |
| 230 | | MCFG_UCOM4_WRITE_E_CB(WRITE8(tmtennis_state, port_e_w)) |
| 231 | | MCFG_UCOM4_WRITE_F_CB(WRITE8(tmtennis_state, plate_w)) |
| 232 | | MCFG_UCOM4_WRITE_G_CB(WRITE8(tmtennis_state, grid_w)) |
| 233 | | MCFG_UCOM4_WRITE_H_CB(WRITE8(tmtennis_state, grid_w)) |
| 234 | | MCFG_UCOM4_WRITE_I_CB(WRITE8(tmtennis_state, grid_w)) |
| 235 | | |
| 236 | | MCFG_DEFAULT_LAYOUT(layout_tmtennis) |
| 237 | | |
| 238 | | /* no video! */ |
| 239 | | |
| 240 | | /* sound hardware */ |
| 241 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 242 | | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 243 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 244 | | MACHINE_CONFIG_END |
| 245 | | |
| 246 | | |
| 247 | | |
| 248 | | /*************************************************************************** |
| 249 | | |
| 250 | | Game driver(s) |
| 251 | | |
| 252 | | ***************************************************************************/ |
| 253 | | |
| 254 | | ROM_START( tmtennis ) |
| 255 | | ROM_REGION( 0x0400, "maincpu", 0 ) |
| 256 | | ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) ) |
| 257 | | ROM_END |
| 258 | | |
| 259 | | |
| 260 | | CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |