trunk/src/mame/drivers/g627.c
| r31489 | r31490 | |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | |
| 3 | | Pinball |
| 3 | PINBALL |
| 4 | 4 | Midway A084-91313-G627 |
| 5 | 5 | A080-91313-G627 |
| 6 | 6 | A082-91320-C000 |
| r31489 | r31490 | |
| 48 | 48 | { |
| 49 | 49 | public: |
| 50 | 50 | g627_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | | : genpin_class(mconfig, type, tag), |
| 52 | | m_maincpu(*this, "maincpu") |
| 51 | : genpin_class(mconfig, type, tag) |
| 52 | , m_maincpu(*this, "maincpu") |
| 53 | 53 | { } |
| 54 | 54 | |
| 55 | DECLARE_DRIVER_INIT(v115); |
| 56 | DECLARE_DRIVER_INIT(v117); |
| 55 | 57 | DECLARE_READ8_MEMBER(porta_r); |
| 56 | 58 | DECLARE_READ8_MEMBER(portb_r); |
| 57 | 59 | DECLARE_WRITE8_MEMBER(portc_w); |
| 58 | 60 | DECLARE_WRITE8_MEMBER(disp_w); |
| 59 | 61 | DECLARE_WRITE8_MEMBER(lamp_w); |
| 60 | | |
| 61 | | protected: |
| 62 | | |
| 63 | | // devices |
| 64 | | required_device<cpu_device> m_maincpu; |
| 65 | | |
| 66 | 62 | private: |
| 67 | 63 | UINT8 m_seg[6]; |
| 68 | 64 | UINT8 m_portc; |
| 69 | 65 | UINT8 m_motor; |
| 66 | bool m_type; |
| 67 | required_device<cpu_device> m_maincpu; |
| 70 | 68 | }; |
| 71 | 69 | |
| 72 | 70 | |
| r31489 | r31490 | |
| 165 | 163 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test 8") PORT_CODE(KEYCODE_STOP) |
| 166 | 164 | INPUT_PORTS_END |
| 167 | 165 | |
| 166 | DRIVER_INIT_MEMBER( g627_state, v115 ) |
| 167 | { |
| 168 | m_type = 0; |
| 169 | } |
| 168 | 170 | |
| 171 | DRIVER_INIT_MEMBER( g627_state, v117 ) |
| 172 | { |
| 173 | m_type = 1; |
| 174 | } |
| 175 | |
| 169 | 176 | // inputs |
| 170 | 177 | READ8_MEMBER( g627_state::porta_r ) |
| 171 | 178 | { |
| r31489 | r31490 | |
| 197 | 204 | WRITE8_MEMBER( g627_state::portc_w ) |
| 198 | 205 | { |
| 199 | 206 | m_portc = data; |
| 200 | | if (data < 6) |
| 207 | if ((m_type) && (data < 6)) |
| 201 | 208 | { |
| 202 | 209 | output_set_digit_value(data, m_seg[0]); |
| 203 | 210 | output_set_digit_value(10 + data, m_seg[1]); |
| r31489 | r31490 | |
| 205 | 212 | output_set_digit_value(30 + data, m_seg[3]); |
| 206 | 213 | output_set_digit_value(50 + data, m_seg[5]); |
| 207 | 214 | } |
| 215 | else |
| 216 | if ((!m_type) && (data)) |
| 217 | { |
| 218 | data--; |
| 219 | |
| 220 | output_set_digit_value(data, m_seg[0]); |
| 221 | output_set_digit_value(10 + data, m_seg[1]); |
| 222 | output_set_digit_value(20 + data, m_seg[2]); |
| 223 | output_set_digit_value(30 + data, m_seg[3]); |
| 224 | output_set_digit_value(50 + data, m_seg[5]); |
| 225 | } |
| 208 | 226 | } |
| 209 | 227 | |
| 210 | 228 | // save segments until we can write the digits |
| r31489 | r31490 | |
| 313 | 331 | ROM_LOAD("v101-c.bin", 0x1000, 0x0800, CRC(c7e85638) SHA1(b59805d8b558ab8f5ea5b4b9261e862afca4b9d3)) |
| 314 | 332 | ROM_END |
| 315 | 333 | |
| 316 | | GAME(1978, rotation, 0, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.17)", GAME_MECHANICAL ) |
| 317 | | GAME(1978, rota_115, rotation, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.15)", GAME_MECHANICAL ) |
| 318 | | GAME(1978, rota_101, rotation, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.01)", GAME_MECHANICAL ) |
| 334 | GAME(1978, rotation, 0, g627, g627, g627_state, v117, ROT0, "Midway", "Rotation VIII (v. 1.17)", GAME_MECHANICAL ) |
| 335 | GAME(1978, rota_115, rotation, g627, g627, g627_state, v115, ROT0, "Midway", "Rotation VIII (v. 1.15)", GAME_MECHANICAL ) |
| 336 | GAME(1978, rota_101, rotation, g627, g627, g627_state, v115, ROT0, "Midway", "Rotation VIII (v. 1.01)", GAME_MECHANICAL ) |