trunk/src/mame/drivers/vd.c
| r18511 | r18512 | |
| 1 | 1 | /************************************************************************************** |
| 2 | 2 | |
| 3 | | Pinball |
| 4 | | Videodens |
| 3 | Pinball |
| 4 | Videodens |
| 5 | 5 | |
| 6 | PinMAME used as reference (unable to find any info at all on the net). |
| 7 | |
| 8 | Nothing in this driver is confirmed except where noted. |
| 9 | |
| 6 | 10 | ***************************************************************************************/ |
| 7 | 11 | |
| 8 | 12 | |
| 9 | | #include "emu.h" |
| 13 | #include "machine/genpin.h" |
| 10 | 14 | #include "cpu/z80/z80.h" |
| 15 | #include "sound/ay8910.h" |
| 16 | #include "vd.lh" |
| 11 | 17 | |
| 12 | 18 | class vd_state : public driver_device |
| 13 | 19 | { |
| 14 | 20 | public: |
| 15 | 21 | vd_state(const machine_config &mconfig, device_type type, const char *tag) |
| 16 | 22 | : driver_device(mconfig, type, tag), |
| 17 | | m_maincpu(*this, "maincpu") |
| 23 | m_maincpu(*this, "maincpu") |
| 18 | 24 | { } |
| 19 | 25 | |
| 26 | DECLARE_READ8_MEMBER(dsw_r) { return 0; } |
| 27 | DECLARE_WRITE8_MEMBER(col_w); |
| 28 | DECLARE_WRITE8_MEMBER(disp_w); |
| 29 | DECLARE_WRITE8_MEMBER(lamp_w) { }; |
| 30 | DECLARE_WRITE8_MEMBER(sol_w) { }; |
| 31 | TIMER_DEVICE_CALLBACK_MEMBER(irq); |
| 20 | 32 | protected: |
| 21 | 33 | |
| 22 | 34 | // devices |
| r18511 | r18512 | |
| 24 | 36 | |
| 25 | 37 | // driver_device overrides |
| 26 | 38 | virtual void machine_reset(); |
| 27 | | public: |
| 28 | | DECLARE_DRIVER_INIT(vd); |
| 39 | private: |
| 40 | UINT8 m_t_c; |
| 41 | UINT8 segment[5]; |
| 29 | 42 | }; |
| 30 | 43 | |
| 31 | 44 | |
| 32 | 45 | static ADDRESS_MAP_START( vd_map, AS_PROGRAM, 8, vd_state ) |
| 33 | 46 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 34 | | AM_RANGE(0x6000, 0x67ff) AM_RAM |
| 47 | AM_RANGE(0x6000, 0x62ff) AM_RAM |
| 48 | AM_RANGE(0x6700, 0x67ff) AM_RAM |
| 35 | 49 | ADDRESS_MAP_END |
| 36 | 50 | |
| 37 | 51 | static ADDRESS_MAP_START( vd_io, AS_IO, 8, vd_state ) |
| 38 | 52 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 39 | | //AM_RANGE(0x00,0x05) AM_READ(sw_r) |
| 40 | | //AM_RANGE(0x20,0x27) AM_WRITE(lamp_w) |
| 41 | | //AM_RANGE(0x28,0x28) AM_WRITE(sol_w) |
| 42 | | //AM_RANGE(0x40,0x44) AM_WRITE(disp_w) |
| 43 | | //AM_RANGE(0x60,0x60) AM_WRITE(AY8910_control_port_0_w) |
| 44 | | //AM_RANGE(0x61,0x61) AM_READ(sw0_r) |
| 45 | | //AM_RANGE(0x62,0x62) AM_WRITE(AY8910_write_port_0_w) |
| 46 | | //AM_RANGE(0x80,0x80) AM_WRITE(AY8910_control_port_1_w) |
| 47 | | //AM_RANGE(0x82,0x82) AM_WRITE(AY8910_write_port_1_w) |
| 48 | | //AM_RANGE(0xa0,0xa0) AM_READ(AY8910_read_port_1_r) |
| 49 | | //AM_RANGE(0xc0,0xc0) AM_WRITE(col_w) |
| 53 | AM_RANGE(0x00,0x00) AM_READ_PORT("X0") |
| 54 | AM_RANGE(0x01,0x01) AM_READ_PORT("X1") |
| 55 | AM_RANGE(0x02,0x02) AM_READ_PORT("X2") |
| 56 | AM_RANGE(0x03,0x03) AM_READ_PORT("X3") |
| 57 | AM_RANGE(0x04,0x04) AM_READ_PORT("X4") |
| 58 | AM_RANGE(0x05,0x05) AM_READ_PORT("X5") |
| 59 | AM_RANGE(0x20,0x27) AM_WRITE(lamp_w) |
| 60 | AM_RANGE(0x28,0x28) AM_WRITE(sol_w) |
| 61 | AM_RANGE(0x40,0x44) AM_WRITE(disp_w) |
| 62 | AM_RANGE(0x60,0x60) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w) |
| 63 | AM_RANGE(0x61,0x61) AM_READ_PORT("DSW") //AM_READ(dsw_r) |
| 64 | AM_RANGE(0x62,0x62) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w) |
| 65 | AM_RANGE(0x80,0x80) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w) |
| 66 | AM_RANGE(0x82,0x82) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w) |
| 67 | AM_RANGE(0xa0,0xa0) AM_DEVREAD_LEGACY("ay2", ay8910_r) |
| 68 | AM_RANGE(0xc0,0xc0) AM_WRITE(col_w) |
| 50 | 69 | ADDRESS_MAP_END |
| 51 | 70 | |
| 52 | 71 | static INPUT_PORTS_START( vd ) |
| 72 | PORT_START("DSW") |
| 73 | PORT_DIPNAME( 0x0001, 0x0000, "Accounting #1") |
| 74 | PORT_DIPSETTING(0x0000, DEF_STR(Off)) |
| 75 | PORT_DIPSETTING(0x0001, DEF_STR(On)) |
| 76 | PORT_DIPNAME( 0x0002, 0x0000, "Accounting #2") |
| 77 | PORT_DIPSETTING(0x0000, DEF_STR(Off)) |
| 78 | PORT_DIPSETTING(0x0002, DEF_STR(On)) |
| 79 | PORT_DIPNAME( 0x0004, 0x0000, "Accounting #3") |
| 80 | PORT_DIPSETTING(0x0000, DEF_STR(Off)) |
| 81 | PORT_DIPSETTING(0x0004, DEF_STR(On)) |
| 82 | PORT_DIPNAME( 0x0018, 0x0000, "Credits per coin (chute #1/#2)") |
| 83 | PORT_DIPSETTING(0x0018, "0.5/3" ) |
| 84 | PORT_DIPSETTING(0x0000, "1/5" ) |
| 85 | PORT_DIPSETTING(0x0008, "1/6" ) |
| 86 | PORT_DIPSETTING(0x0010, "2/8" ) |
| 87 | PORT_DIPNAME( 0x0020, 0x0000, "S6") |
| 88 | PORT_DIPSETTING(0x0000, "0" ) |
| 89 | PORT_DIPSETTING(0x0020, "1" ) |
| 90 | PORT_DIPNAME( 0x0040, 0x0000, "Match feature") |
| 91 | PORT_DIPSETTING(0x0040, DEF_STR(Off)) |
| 92 | PORT_DIPSETTING(0x0000, DEF_STR(On)) |
| 93 | PORT_DIPNAME( 0x0080, 0x0000, "S8") |
| 94 | PORT_DIPSETTING(0x0000, "0" ) |
| 95 | PORT_DIPSETTING(0x0080, "1" ) |
| 96 | |
| 97 | PORT_START("X0") |
| 98 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_START1) |
| 99 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN1) |
| 100 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN2) |
| 101 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_TILT) |
| 102 | |
| 103 | PORT_START("X1") |
| 104 | PORT_START("X2") |
| 105 | PORT_START("X3") |
| 106 | PORT_START("X4") |
| 107 | PORT_START("X5") |
| 53 | 108 | INPUT_PORTS_END |
| 54 | 109 | |
| 55 | | void vd_state::machine_reset() |
| 110 | TIMER_DEVICE_CALLBACK_MEMBER( vd_state::irq ) |
| 56 | 111 | { |
| 112 | if (m_t_c > 40) |
| 113 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); |
| 114 | else |
| 115 | m_t_c++; |
| 57 | 116 | } |
| 58 | 117 | |
| 59 | | DRIVER_INIT_MEMBER(vd_state,vd) |
| 118 | WRITE8_MEMBER( vd_state::disp_w ) |
| 60 | 119 | { |
| 120 | segment[offset] = data; |
| 121 | if (!offset) |
| 122 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); |
| 61 | 123 | } |
| 62 | 124 | |
| 125 | WRITE8_MEMBER( vd_state::col_w ) |
| 126 | { |
| 127 | if (data != 0x3f) |
| 128 | { |
| 129 | data &= 7; |
| 130 | output_set_digit_value(data + 11, segment[0]); |
| 131 | output_set_digit_value(data + 21, segment[1]); |
| 132 | output_set_digit_value(data + 31, segment[2]); |
| 133 | output_set_digit_value(data + 41, segment[3]); |
| 134 | output_set_digit_value(data + 51, segment[4]); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void vd_state::machine_reset() |
| 139 | { |
| 140 | m_t_c = 0; |
| 141 | } |
| 142 | |
| 63 | 143 | static MACHINE_CONFIG_START( vd, vd_state ) |
| 64 | 144 | /* basic machine hardware */ |
| 65 | 145 | MCFG_CPU_ADD("maincpu", Z80, 4000000) |
| 66 | 146 | MCFG_CPU_PROGRAM_MAP(vd_map) |
| 67 | 147 | MCFG_CPU_IO_MAP(vd_io) |
| 148 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq", vd_state, irq, attotime::from_hz(484)) |
| 149 | |
| 150 | /* Sound */ |
| 151 | MCFG_FRAGMENT_ADD( genpin_audio ) |
| 152 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 153 | MCFG_SOUND_ADD("ay1", AY8910, 2000000) //? |
| 154 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33/3) |
| 155 | MCFG_SOUND_ADD("ay2", AY8910, 2000000) //? |
| 156 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33/3) |
| 157 | |
| 158 | /* Video */ |
| 159 | MCFG_DEFAULT_LAYOUT(layout_vd) |
| 68 | 160 | MACHINE_CONFIG_END |
| 69 | 161 | |
| 70 | 162 | /*------------------------------------------------------------------- |
| r18511 | r18512 | |
| 99 | 191 | ROM_END |
| 100 | 192 | #endif |
| 101 | 193 | |
| 102 | | GAME(1986, break86, 0, vd, vd, vd_state, vd, ROT0, "Videodens", "Break '86", GAME_IS_SKELETON_MECHANICAL) |
| 103 | | GAME(1986, papillon, 0, vd, vd, vd_state, vd, ROT0, "Videodens", "Papillon", GAME_IS_SKELETON_MECHANICAL) |
| 104 | | //GAME(19??, ator, 0, vd, vd, vd_state, vd, ROT0, "Videodens", "Ator", GAME_IS_SKELETON_MECHANICAL) |
| 194 | GAME(1986, break86, 0, vd, vd, driver_device, 0, ROT0, "Videodens", "Break '86", GAME_IS_SKELETON_MECHANICAL) |
| 195 | GAME(1986, papillon, 0, vd, vd, driver_device, 0, ROT0, "Videodens", "Papillon", GAME_IS_SKELETON_MECHANICAL) |
| 196 | //GAME(19??, ator, 0, vd, vd, driver_device, 0, ROT0, "Videodens", "Ator", GAME_IS_SKELETON_MECHANICAL) |