summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/laz_aftrshok.cpp
blob: 3e8bdb68ed9667c44cace34e486c9c2b9bd89083 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
// license:BSD-3-Clause
// copyright-holders:David Haywood
/*

After Shock by Laser Tron

redemption game

devices are 27c512

--------------------------

file Aftrshk.upd is the updated eprom for an update version.
The update version uses a small (appx 2" x 4" ) pcb to turn on
the playfield motor.  If you don't have this small pcb, then don't use
this .upd version software.  The small pcb is numbered

"pcb100067"
"Lazer Tron driver pcb V.02"

This "kit" will correct aproblem with the Allegro UCN5801A chip
on the main pcb.
full instructions available from Lazer-Tron aka Arcade Planet


a video of this in action can be seen at
https://www.youtube.com/watch?v=9DIhuOEVwf4

Spin to Win runs on the same hardware.

*/

#include "emu.h"
#include "cpu/mcs51/mcs51.h"
#include "sound/okim6295.h"
#include "speaker.h"


class aftrshok_state : public driver_device
{
public:
	aftrshok_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_oki(*this, "oki")
	{ }

	void aftrshok(machine_config &config);

private:
	void sound_data_w(u8 data);
	void mcu_p3_w(u8 data);

	void prog_map(address_map &map);
	void ext_map(address_map &map);

	virtual void machine_start() override;
	virtual void machine_reset() override;

	required_device<mcs51_cpu_device> m_maincpu;
	required_device<okim6295_device> m_oki;

	u8 m_sound_data;
};

static INPUT_PORTS_START( aftrshok )
	PORT_START("INPUTS1")
	PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)

	PORT_START("INPUTS2")
	PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
	PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)

	PORT_START("INPUTS3")
	PORT_DIPNAME(0x01, 0x01, "Coin Insertion Vibration Delay") PORT_DIPLOCATION("S2:1")
	PORT_DIPSETTING(0x00, "100 msec")
	PORT_DIPSETTING(0x01, "160 msec")
	PORT_DIPNAME(0x02, 0x02, DEF_STR(Unused)) PORT_DIPLOCATION("S2:2")
	PORT_DIPSETTING(0x02, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x04, 0x04, DEF_STR(Demo_Sounds)) PORT_DIPLOCATION("S2:3")
	PORT_DIPSETTING(0x00, DEF_STR(Off))
	PORT_DIPSETTING(0x04, DEF_STR(On))
	PORT_DIPNAME(0x08, 0x08, "Progressive Ticket Payout") PORT_DIPLOCATION("S2:4")
	PORT_DIPSETTING(0x08, "Manual")
	PORT_DIPSETTING(0x00, "Automatic")
	PORT_DIPNAME(0x10, 0x10, DEF_STR(Unused)) PORT_DIPLOCATION("S2:5")
	PORT_DIPSETTING(0x10, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x20, 0x20, "Ticket Payout Sound") PORT_DIPLOCATION("S2:6")
	PORT_DIPSETTING(0x00, "Short Bell at Start")
	PORT_DIPSETTING(0x20, "Continuous")
	PORT_DIPNAME(0x40, 0x40, "Payout Tickets") PORT_DIPLOCATION("S2:7")
	PORT_DIPSETTING(0x00, DEF_STR(Off))
	PORT_DIPSETTING(0x40, DEF_STR(On))
	PORT_DIPNAME(0x80, 0x80, DEF_STR(Unused)) PORT_DIPLOCATION("S2:8")
	PORT_DIPSETTING(0x80, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))

	PORT_START("INPUTS4")
	PORT_DIPNAME(0x01, 0x01, "Vibrator Motor Test") PORT_DIPLOCATION("S3:1")
	PORT_DIPSETTING(0x01, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x02, 0x02, "Pyramid Vibration Boost") PORT_DIPLOCATION("S3:2")
	PORT_DIPSETTING(0x02, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x04, 0x04, DEF_STR(Unused)) PORT_DIPLOCATION("S3:3")
	PORT_DIPSETTING(0x04, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x08, 0x08, DEF_STR(Unused)) PORT_DIPLOCATION("S3:4")
	PORT_DIPSETTING(0x08, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:1")
	PORT_DIPSETTING(0x10, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:2")
	PORT_DIPSETTING(0x20, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:3")
	PORT_DIPSETTING(0x40, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("S4:4")
	PORT_DIPSETTING(0x80, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))

	PORT_START("INPUTS5")
	PORT_DIPNAME(0x0f, 0x0f, "Playfield Vibration Level") PORT_DIPLOCATION("S5:1,2,3,4")
	PORT_DIPSETTING(0x0f, "1")
	PORT_DIPSETTING(0x0e, "2")
	PORT_DIPSETTING(0x0d, "3")
	PORT_DIPSETTING(0x0c, "4")
	PORT_DIPSETTING(0x0b, "5")
	PORT_DIPSETTING(0x0a, "6")
	PORT_DIPSETTING(0x09, "7")
	PORT_DIPSETTING(0x08, "8")
	PORT_DIPSETTING(0x07, "9")
	PORT_DIPSETTING(0x06, "10")
	PORT_DIPSETTING(0x05, "11")
	PORT_DIPSETTING(0x04, "12")
	PORT_DIPSETTING(0x03, "13")
	PORT_DIPSETTING(0x02, "14")
	PORT_DIPSETTING(0x01, "15")
	PORT_DIPSETTING(0x00, "16")
	PORT_DIPNAME(0x10, 0x10, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:1") // "Lazer-Tron Use Only"
	PORT_DIPSETTING(0x10, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x20, 0x20, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:2") // "Lazer-Tron Use Only"
	PORT_DIPSETTING(0x20, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x40, 0x40, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:3") // "Lazer-Tron Use Only"
	PORT_DIPSETTING(0x40, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
	PORT_DIPNAME(0x80, 0x80, DEF_STR(Unknown)) PORT_DIPLOCATION("S6:4") // "Lazer-Tron Use Only"
	PORT_DIPSETTING(0x80, DEF_STR(Off))
	PORT_DIPSETTING(0x00, DEF_STR(On))
INPUT_PORTS_END



void aftrshok_state::machine_start()
{
	save_item(NAME(m_sound_data));
}

void aftrshok_state::machine_reset()
{
	m_sound_data = 0;
}

void aftrshok_state::sound_data_w(u8 data)
{
	m_sound_data = data;
}

void aftrshok_state::mcu_p3_w(u8 data)
{
	if (!BIT(data, 1) && !BIT(data, 2))
		m_oki->write(m_sound_data);
}

void aftrshok_state::prog_map(address_map &map)
{
	map(0x0000, 0xffff).rom().region("maincpu", 0);
}

void aftrshok_state::ext_map(address_map &map)
{
	map(0x0700, 0x0700).nopw();
	map(0x0800, 0x0800).nopw();
	map(0x1000, 0x1000).w(FUNC(aftrshok_state::sound_data_w));
	map(0x1800, 0x1800).nopw();
	map(0x2000, 0x2000).nopw();
	map(0x2800, 0x2800).nopw();
	map(0x4000, 0x4000).portr("INPUTS1"); // 74HC541 buffer (U17)
	map(0x4800, 0x4800).portr("INPUTS2"); // 74HC541 buffer (U18)
	map(0x5000, 0x5000).portr("INPUTS3"); // 74HC541 buffer (U19)
	map(0x5800, 0x5800).portr("INPUTS4"); // 74HC541 buffer (U20)
	map(0x6000, 0x6000).portr("INPUTS5"); // 74HC541 buffer (U21)
	map(0x8000, 0x9fff).ram();
}


void aftrshok_state::aftrshok(machine_config &config)
{
	/* basic machine hardware */
	I8031(config, m_maincpu, 12_MHz_XTAL);
	m_maincpu->set_addrmap(AS_PROGRAM, &aftrshok_state::prog_map);
	m_maincpu->set_addrmap(AS_IO, &aftrshok_state::ext_map);
	m_maincpu->port_out_cb<3>().set(FUNC(aftrshok_state::mcu_p3_w));

	/* sound hardware */
	SPEAKER(config, "mono").front_center();

	OKIM6295(config, m_oki, 2.097152_MHz_XTAL, okim6295_device::PIN7_HIGH);
	m_oki->add_route(ALL_OUTPUTS, "mono", 1.0);
}



ROM_START( aftrshok )
	ROM_REGION( 0x10000, "maincpu", 0 )
	ROM_LOAD( "aftrshok.u3.upd", 0x00000, 0x10000, CRC(779fad60) SHA1(6be3b99cea95b5320c6d500616a703cdab126d9c) ) // see note at top of driver about this update

	ROM_REGION( 0xc0000, "oki", 0 )
	ROM_LOAD( "aftrshok.u27", 0x00000, 0x10000, CRC(2d0061ef) SHA1(cc674ea020ef9e6b3baecfdb72f9766fef89bed8) )
	ROM_LOAD( "aftrshok.u26", 0x10000, 0x10000, CRC(d2b55dc1) SHA1(2684bfc65628a550fcbaa6726b5dab488e7ede5a) )
	ROM_LOAD( "aftrshok.u25", 0x20000, 0x10000, CRC(d5d1c606) SHA1(ad72a00c211ee7f5bc0772d6f469d59047131095) )
ROM_END

ROM_START( aftrshoka )
	ROM_REGION( 0x10000, "maincpu", 0 )
	ROM_LOAD( "aftrshok.u3", 0x00000, 0x10000, CRC(841828b9) SHA1(51a88ce7466fcbc6d5192d738425ae1d37c1b88e) )

	ROM_REGION( 0xc0000, "oki", 0 )
	ROM_LOAD( "aftrshok.u27", 0x00000, 0x10000, CRC(2d0061ef) SHA1(cc674ea020ef9e6b3baecfdb72f9766fef89bed8) )
	ROM_LOAD( "aftrshok.u26", 0x10000, 0x10000, CRC(d2b55dc1) SHA1(2684bfc65628a550fcbaa6726b5dab488e7ede5a) )
	ROM_LOAD( "aftrshok.u25", 0x20000, 0x10000, CRC(d5d1c606) SHA1(ad72a00c211ee7f5bc0772d6f469d59047131095) )
ROM_END


GAME( 19??, aftrshok,  0,        aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-Tron", "Aftershock (Lazer-Tron, set 1)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )
GAME( 19??, aftrshoka, aftrshok, aftrshok, aftrshok, aftrshok_state, empty_init, ROT0, "Lazer-Tron", "Aftershock (Lazer-Tron, set 2)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL )