1 // license:BSD-3-Clause
2 // copyright-holders:Zsolt Vasvari
3 /***************************************************************************
4 
5     Epos games
6 
7     driver by Zsolt Vasvari
8 
9 
10     Notes:
11 
12     - To walk in IGMO, hold down button 2.
13     - Super Glob seems like a later revision of The Glob, the most obvious
14       difference being an updated service mode.
15     - These games don't have cocktail mode.
16     - The CPU clock divisor 4 was derived using the timing loop used to split
17       the screen in the middle.  This loop takes roughly 24200 cycles, giving
18       2500 + (24200 - 2500) * 2 * 60 = 2754000 = 2.75MHz for the CPU speed,
19       assuming 60 fps and a 2500 cycle VBLANK period.
20       This also matches the IGMO schematic, as it is the /CLK signal, which is
21       derived from the 11MHz xtal by dividing it down by two 74LS193 chips, one
22       (U92) dividing the clock by 2, and another (U91) having 3 taps, further
23       dividing the already divided clock by 2 (/CLK), 4 (/PLOAD) and 8 (CLOCK).
24       The CLOCK signal drives the AY.
25     - I think theglob2 is earlier than theglob.  They only differ in one routine,
26       but it appears to be a bug fix.  Also, theglob3 appears to be even older.
27 
28     To Do:
29 
30     - Super Blob uses a busy loop during the color test to split the screen
31       between the two palettes.  This effect is not emulated, but since both
32       halves of the palette are identical, this is not an issue.  See $039c.
33       The other games have a different color test, not using the busy loop.
34 
35     - dealer/beastf/revngr84: "PSG registers not OK" in service mode thru
36       sound menu, internal ay8910 not right?
37 
38 ***************************************************************************/
39 
40 #include "emu.h"
41 #include "includes/epos.h"
42 
43 #include "cpu/z80/z80.h"
44 #include "machine/i8255.h"
45 #include "machine/watchdog.h"
46 #include "machine/nvram.h"
47 #include "sound/ay8910.h"
48 #include "screen.h"
49 #include "speaker.h"
50 
51 
dealer_decrypt_rom(offs_t offset,uint8_t data)52 void epos_state::dealer_decrypt_rom(offs_t offset, uint8_t data)
53 {
54 	if (offset & 0x04)
55 		m_counter = (m_counter + 1) & 0x03;
56 	else
57 		m_counter = (m_counter - 1) & 0x03;
58 
59 	//logerror("PC %08x: ctr=%04x\n",m_maincpu->pc(), m_counter);
60 
61 	membank("bank1")->set_entry(m_counter);
62 
63 	// is the 2nd bank changed by the counter or it always uses the 1st key?
64 }
65 
66 
67 /*************************************
68  *
69  *  Main CPU memory handlers
70  *
71  *************************************/
72 
epos_map(address_map & map)73 void epos_state::epos_map(address_map &map)
74 {
75 	map(0x0000, 0x77ff).rom();
76 	map(0x7800, 0x7fff).ram();
77 	map(0x8000, 0xffff).ram().share("videoram");
78 }
79 
dealer_map(address_map & map)80 void epos_state::dealer_map(address_map &map)
81 {
82 	map(0x0000, 0x5fff).bankr("bank1");
83 	map(0x6000, 0x6fff).bankr("bank2");
84 	map(0x7000, 0x7fff).ram().share("nvram");
85 	map(0x8000, 0xffff).ram().share("videoram");
86 }
87 
88 
89 /*************************************
90  *
91  *  Main CPU port handlers
92  *
93  *************************************/
94 
epos_io_map(address_map & map)95 void epos_state::epos_io_map(address_map &map)
96 {
97 	map.global_mask(0xff);
98 	map(0x00, 0x00).portr("DSW").w("watchdog", FUNC(watchdog_timer_device::reset_w));
99 	map(0x01, 0x01).portr("SYSTEM").w(FUNC(epos_state::port_1_w));
100 	map(0x02, 0x02).portr("INPUTS").w("aysnd", FUNC(ay8910_device::data_w));
101 	map(0x03, 0x03).portr("UNK");
102 	map(0x06, 0x06).w("aysnd", FUNC(ay8910_device::address_w));
103 }
104 
dealer_io_map(address_map & map)105 void epos_state::dealer_io_map(address_map &map)
106 {
107 	map.global_mask(0xff);
108 	map(0x00, 0x0f).w(FUNC(epos_state::dealer_pal_w));
109 	map(0x10, 0x13).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
110 	map(0x20, 0x24).w(FUNC(epos_state::dealer_decrypt_rom));
111 	map(0x34, 0x34).w("aysnd", FUNC(ay8910_device::data_w));
112 	map(0x38, 0x38).r("aysnd", FUNC(ay8910_device::data_r));
113 	map(0x3c, 0x3c).w("aysnd", FUNC(ay8910_device::address_w));
114 	map(0x40, 0x40).w("watchdog", FUNC(watchdog_timer_device::reset_w));
115 }
116 
i8255_porta_r()117 uint8_t epos_state::i8255_porta_r()
118 {
119 	uint8_t data = 0xff;
120 
121 	if (!BIT(m_input_multiplex, 0))
122 		data &= m_inputs[0]->read();
123 
124 	if (!BIT(m_input_multiplex, 1))
125 		data &= m_inputs[1]->read();
126 
127 	return data;
128 }
129 
130 /*
131    ROMs U01-U03 are checked with the same code in a loop.
132    There's a separate ROM check for banked U04 at 30F3.
133    It looks like dealer/revenger uses ppi8255 to control bankswitching.
134 */
i8255_portc_w(uint8_t data)135 void epos_state::i8255_portc_w(uint8_t data)
136 {
137 	membank("bank2")->set_entry(data & 0x01);
138 	m_input_multiplex = (data >> 5) & 3;
139 }
140 
ay_porta_mpx_r()141 uint8_t epos_state::ay_porta_mpx_r()
142 {
143 	return (m_ay_porta_multiplex ? 0xFF : ioport("DSW")->read());
144 }
145 
flip_screen_w(uint8_t data)146 void epos_state::flip_screen_w(uint8_t data)
147 {
148 	flip_screen_set(BIT(data, 7));
149 	// bit 6: ay8910 port A/B multiplexer read
150 	m_ay_porta_multiplex = BIT(data, 6);
151 }
152 
153 
154 /*************************************
155  *
156  *  Port definitions
157  *
158  *************************************/
159 
160 /* I think the upper two bits of port 1 are used as a simple form of protection,
161    so that ROMs couldn't be simply swapped.  Each game checks these bits and halts
162    the processor if an unexpected value is read. */
163 
164 static INPUT_PORTS_START( megadon )
165 	// There are odd port mappings (old=new)
166 	// 02=10, 04=40, 08=02, 10=20, 20=04, 40=08
167 	PORT_START("DSW")
DEF_STR(Coinage)168 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
169 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
170 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
171 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
172 	PORT_DIPSETTING(    0x00, "3" )
173 	PORT_DIPSETTING(    0x10, "4" )
174 	PORT_DIPSETTING(    0x40, "5" )
175 	PORT_DIPSETTING(    0x50, "6" )
176 	PORT_DIPNAME( 0x02, 0x00, "Fuel Consumption" ) PORT_DIPLOCATION("SW1:4")
177 	PORT_DIPSETTING(    0x00, "Slow" )
178 	PORT_DIPSETTING(    0x02, "Fast" )
179 	PORT_DIPNAME( 0x20, 0x20, "Enemy Fire Rate" ) PORT_DIPLOCATION("SW1:5")
180 	PORT_DIPSETTING(    0x20, "Slow" )
181 	PORT_DIPSETTING(    0x00, "Fast" )
182 	PORT_DIPNAME( 0x04, 0x00, "Rotation" ) PORT_DIPLOCATION("SW1:6")
183 	PORT_DIPSETTING(    0x04, "Slow" )
184 	PORT_DIPSETTING(    0x00, "Fast" )
185 	PORT_DIPNAME( 0x08, 0x08, "ERG" ) PORT_DIPLOCATION("SW1:7")
186 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
187 	PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
188 	PORT_DIPNAME( 0x80, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW1:8")
189 	PORT_DIPSETTING(    0x00, "Arcade" )
190 	PORT_DIPSETTING(    0x80, "Contest" )
191 
192 	PORT_START("SYSTEM")
193 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
194 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
195 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
196 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
197 	PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW)
198 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
199 	PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_CUSTOM )   /* this has to be HI */
200 	PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_CUSTOM )   /* this has to be HI */
201 
202 	PORT_START("INPUTS")
203 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
204 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
205 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
206 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
207 	PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
208 
209 	PORT_START("UNK")
210 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
211 INPUT_PORTS_END
212 
213 
214 static INPUT_PORTS_START( suprglob )
215 	// There are odd port mappings (old=new)
216 	// 02=10, 04=40, 08=20, 10=02, 20=04, 40=08
217 	PORT_START("DSW")
218 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
219 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
220 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
221 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
222 	PORT_DIPSETTING(    0x00, "3" )
223 	PORT_DIPSETTING(    0x10, "4" )
224 	PORT_DIPSETTING(    0x40, "5" )
225 	PORT_DIPSETTING(    0x50, "6" )
226 	PORT_DIPNAME( 0x26, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6")
227 	PORT_DIPSETTING(    0x00, "1" )
228 	PORT_DIPSETTING(    0x02, "2" )
229 	PORT_DIPSETTING(    0x20, "3" )
230 	PORT_DIPSETTING(    0x22, "4" )
231 	PORT_DIPSETTING(    0x04, "5" )
232 	PORT_DIPSETTING(    0x06, "6" )
233 	PORT_DIPSETTING(    0x24, "7" )
234 	PORT_DIPSETTING(    0x26, "8" )
235 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7")
236 	PORT_DIPSETTING(    0x00, "10000 + Difficulty * 10000" )
237 	PORT_DIPSETTING(    0x08, "90000 + Difficulty * 10000" )
238 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
239 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
240 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
241 
242 	PORT_START("SYSTEM")
243 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
244 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
245 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
246 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
247 	PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW)
248 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
249 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM )   /* this has to be LO */
250 	PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_CUSTOM )   /* this has to be HI */
251 
252 	PORT_START("INPUTS")
253 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
254 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
255 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
256 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
257 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
258 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
259 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
260 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
261 
262 	PORT_START("UNK")
263 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
264 INPUT_PORTS_END
265 
266 
267 static INPUT_PORTS_START( igmo )
268 	// There are odd port mappings (old=new)
269 	// 02=10, 04=40, 08=20, 10=02, 20=04, 40=08
270 	PORT_START("DSW")
271 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
272 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
273 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
274 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
275 	PORT_DIPSETTING(    0x00, "3" )
276 	PORT_DIPSETTING(    0x10, "4" )
277 	PORT_DIPSETTING(    0x40, "5" )
278 	PORT_DIPSETTING(    0x50, "6" )
279 	PORT_DIPNAME( 0x22, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5")
280 	PORT_DIPSETTING(    0x00, "20000" )
281 	PORT_DIPSETTING(    0x02, "40000" )
282 	PORT_DIPSETTING(    0x20, "60000" )
283 	PORT_DIPSETTING(    0x22, "80000" )
284 	PORT_DIPNAME( 0x8c, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7,8")
285 	PORT_DIPSETTING(    0x00, "1" )
286 	PORT_DIPSETTING(    0x04, "2" )
287 	PORT_DIPSETTING(    0x08, "3" )
288 	PORT_DIPSETTING(    0x0c, "4" )
289 	PORT_DIPSETTING(    0x80, "5" )
290 	PORT_DIPSETTING(    0x84, "6" )
291 	PORT_DIPSETTING(    0x88, "7" )
292 	PORT_DIPSETTING(    0x8c, "8" )
293 
294 	PORT_START("SYSTEM")
295 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
296 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
297 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
298 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
299 	PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW)
300 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
301 	PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_CUSTOM )   /* this has to be HI */
302 	PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_CUSTOM )   /* this has to be HI */
303 
304 	PORT_START("INPUTS")
305 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
306 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
307 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
308 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
309 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
310 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
311 	PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
312 
313 	PORT_START("UNK")
314 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
315 INPUT_PORTS_END
316 
317 
318 static INPUT_PORTS_START( catapult )
319 	PORT_INCLUDE( igmo )
320 
321 	// There are odd port mappings (old=new)
322 	// 02=08, 04=20, 08=40, 10=02, 20=10, 40=04
323 	PORT_MODIFY("DSW")
324 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
325 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
326 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
327 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
328 	PORT_DIPSETTING(    0x00, "3" )
329 	PORT_DIPSETTING(    0x10, "4" )
330 	PORT_DIPSETTING(    0x40, "5" )
331 	PORT_DIPSETTING(    0x50, "6" )
332 	PORT_DIPNAME( 0x22, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
333 	PORT_DIPSETTING(    0x00, "1" )
334 	PORT_DIPSETTING(    0x02, "2" )
335 	PORT_DIPSETTING(    0x20, "3" )
336 	PORT_DIPSETTING(    0x22, "4" )
337 	PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:6,7")
338 	PORT_DIPSETTING(    0x00, "20000" )
339 	PORT_DIPSETTING(    0x04, "40000" )
340 	PORT_DIPSETTING(    0x08, "60000" )
341 	PORT_DIPSETTING(    0x0c, "80000" )
342 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
343 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
344 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
345 INPUT_PORTS_END
346 
347 
348 static INPUT_PORTS_START( eeekk )
349 	// There are odd port mappings (old=new)
350 	// 02=10, 04=40, 08=02, 10=20, 20=04, 40=08
351 	PORT_START("DSW")
352 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
353 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
354 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
355 	PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
356 	PORT_DIPSETTING(    0x00, "3" )
357 	PORT_DIPSETTING(    0x10, "4" )
358 	PORT_DIPSETTING(    0x40, "5" )
359 	PORT_DIPSETTING(    0x50, "6" )
360 	PORT_DIPNAME( 0x26, 0x06, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6")
361 	PORT_DIPSETTING(    0x00, "1 (Easy)" )
362 	PORT_DIPSETTING(    0x02, "2" )
363 	PORT_DIPSETTING(    0x20, "3" )
364 	PORT_DIPSETTING(    0x22, "4" )
365 	PORT_DIPSETTING(    0x04, "5" )
366 	PORT_DIPSETTING(    0x06, "6" )
367 	PORT_DIPSETTING(    0x24, "7" )
368 	PORT_DIPSETTING(    0x26, "8 (Hard)" )
369 	PORT_DIPNAME( 0x08, 0x08, "Extra Life Range" ) PORT_DIPLOCATION("SW1:7") // exact points value varies by 10000 for every level of difficulty chosen via the dips above
370 	PORT_DIPSETTING(    0x08, "100000 - 170000 points" )
371 	PORT_DIPSETTING(    0x00, "20000 - 90000 points" )
372 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
373 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
374 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
375 
376 	PORT_START("SYSTEM")
377 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
378 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
379 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_START1 )
380 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START2 )
381 	PORT_SERVICE_NO_TOGGLE(0x10, IP_ACTIVE_LOW)
382 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
383 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM )   /* this has to be LO */
384 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM )   /* this has to be LO */
385 
386 	PORT_START("INPUTS")
387 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
388 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
389 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
390 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 )
391 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
392 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
393 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
394 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
395 
396 	PORT_START("UNK")
397 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
398 INPUT_PORTS_END
399 
400 
401 static INPUT_PORTS_START( dealer )
402 	PORT_START("DSW")
403 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
404 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
405 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
406 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:2")
407 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
408 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
409 	PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" )
410 	PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" )
411 	PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" )
412 	PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" )
413 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7")
414 	PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
415 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
416 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8")
417 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
418 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
419 
420 	PORT_START("SYSTEM")
421 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
422 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
423 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
424 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
425 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )
426 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
427 	PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
428 	PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
429 
430 	PORT_START("INPUTS")
431 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
432 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )
433 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )
434 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )
435 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
436 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
437 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
438 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
439 
440 	PORT_START("INPUTS2")
441 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_CANCEL )
442 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME( "Draw" )
443 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_STAND )
444 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
445 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME( "Play" )
446 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
447 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
448 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )
449 INPUT_PORTS_END
450 
451 static INPUT_PORTS_START( beastf )
452 	PORT_INCLUDE( dealer )
453 
454 	PORT_MODIFY("INPUTS")
455 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
456 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
457 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
458 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
459 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
460 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
461 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
462 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
463 
464 	PORT_MODIFY("INPUTS2")
465 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
466 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
467 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
468 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
469 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
470 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
471 INPUT_PORTS_END
472 
473 
474 /*************************************
475  *
476  *  Machine drivers
477  *
478  *************************************/
479 
480 MACHINE_START_MEMBER(epos_state,epos)
481 {
482 	save_item(NAME(m_palette_bank));
483 	save_item(NAME(m_counter));
484 	save_item(NAME(m_input_multiplex));
485 	save_item(NAME(m_ay_porta_multiplex));
486 }
487 
machine_reset()488 void epos_state::machine_reset()
489 {
490 	m_palette_bank = 0;
491 	m_counter = 0;
492 	m_input_multiplex = 3;
493 	m_ay_porta_multiplex = 0;
494 }
495 
496 
MACHINE_START_MEMBER(epos_state,dealer)497 MACHINE_START_MEMBER(epos_state,dealer)
498 {
499 	uint8_t *ROM = memregion("maincpu")->base();
500 	membank("bank1")->configure_entries(0, 4, &ROM[0x0000], 0x10000);
501 	membank("bank2")->configure_entries(0, 2, &ROM[0x6000], 0x1000);
502 
503 	membank("bank1")->set_entry(0);
504 	membank("bank2")->set_entry(0);
505 
506 	MACHINE_START_CALL_MEMBER(epos);
507 }
508 
epos(machine_config & config)509 void epos_state::epos(machine_config &config) /* EPOS TRISTAR 8000 PCB */
510 {
511 	/* basic machine hardware */
512 	Z80(config, m_maincpu, XTAL(11'000'000)/4);    /* 2.75 MHz schematics confirm 11MHz XTAL (see notes) */
513 	m_maincpu->set_addrmap(AS_PROGRAM, &epos_state::epos_map);
514 	m_maincpu->set_addrmap(AS_IO, &epos_state::epos_io_map);
515 	m_maincpu->set_vblank_int("screen", FUNC(epos_state::irq0_line_hold));
516 
517 	WATCHDOG_TIMER(config, "watchdog");
518 
519 	/* video hardware */
520 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
521 	screen.set_refresh_hz(60);
522 	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
523 	screen.set_size(272, 241);
524 	screen.set_visarea(0, 271, 0, 235);
525 	screen.set_screen_update(FUNC(epos_state::screen_update));
526 
527 	PALETTE(config, m_palette, FUNC(epos_state::epos_palette), 32);
528 
529 	/* sound hardware */
530 	SPEAKER(config, "mono").front_center();
531 	AY8912(config, "aysnd", XTAL(11'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0); /*  0.6875 MHz, confirmed from schematics */
532 }
533 
534 
dealer(machine_config & config)535 void epos_state::dealer(machine_config &config) /* EPOS TRISTAR 9000 PCB */
536 {
537 	/* basic machine hardware */
538 	Z80(config, m_maincpu, XTAL(22'118'400)/8);    /* 2.7648 MHz (measured) */
539 	m_maincpu->set_addrmap(AS_PROGRAM, &epos_state::dealer_map);
540 	m_maincpu->set_addrmap(AS_IO, &epos_state::dealer_io_map);
541 	m_maincpu->set_vblank_int("screen", FUNC(epos_state::irq0_line_hold));
542 
543 	i8255_device &ppi(I8255A(config, "ppi8255"));
544 	ppi.in_pa_callback().set(FUNC(epos_state::i8255_porta_r));
545 	ppi.out_pc_callback().set(FUNC(epos_state::i8255_portc_w));
546 
547 	NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
548 
549 	MCFG_MACHINE_START_OVERRIDE(epos_state,dealer)
550 
551 	// RAM-based palette instead of prom
552 	PALETTE(config, m_palette, palette_device::BLACK, 32);
553 
554 	WATCHDOG_TIMER(config, "watchdog");
555 
556 	/* video hardware */
557 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
558 	screen.set_refresh_hz(60);
559 	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
560 	screen.set_size(272, 241);
561 	screen.set_visarea(0, 271, 0, 235);
562 	screen.set_screen_update(FUNC(epos_state::screen_update));
563 
564 	/* sound hardware */
565 	SPEAKER(config, "mono").front_center();
566 	ay8910_device &aysnd(AY8910(config, "aysnd", XTAL(22'118'400)/32)); /* 0.6912 MHz (measured) */
567 	aysnd.add_route(ALL_OUTPUTS, "mono", 1.0);
568 	aysnd.port_a_read_callback().set(FUNC(epos_state::ay_porta_mpx_r));
569 	// port a writes?
570 	aysnd.port_b_write_callback().set(FUNC(epos_state::flip_screen_w)); // flipscreen and ay port a multiplex control
571 }
572 
573 
574 /*************************************
575  *
576  *  ROM definitions
577  *
578  *************************************/
579 
580 // Tristar 8000 boards:
581 ROM_START( megadon )
582 	ROM_REGION( 0x10000, "maincpu", 0 )
CRC(af8fbe80)583 	ROM_LOAD( "2732u10b.bin",   0x0000, 0x1000, CRC(af8fbe80) SHA1(2d7857616462112fe17343a9357ee51d8f965a0f) )
584 	ROM_LOAD( "2732u09b.bin",   0x1000, 0x1000, CRC(097d1e73) SHA1(b6141155b2c63c33a367dd18fe53ff9f01b99380) )
585 	ROM_LOAD( "2732u08b.bin",   0x2000, 0x1000, CRC(526784da) SHA1(7d9f43dc6975a018bec95982029ce7ac9f675869) )
586 	ROM_LOAD( "2732u07b.bin",   0x3000, 0x1000, CRC(5b060910) SHA1(98a719bf0ffe8010437565de681aaefa647d9a6c) )
587 	ROM_LOAD( "2732u06b.bin",   0x4000, 0x1000, CRC(8ac8af6d) SHA1(53c123f0e9f0443737c39c01dbdb685189cffa92) )
588 	ROM_LOAD( "2732u05b.bin",   0x5000, 0x1000, CRC(052bb603) SHA1(eb74a9563f44cca50dc2c475e4a376ed14e4f56f) )
589 	ROM_LOAD( "2732u04b.bin",   0x6000, 0x1000, CRC(9b8b7e92) SHA1(051ad9a8ba51740a865e3c95a738658b30bbbe60) )
590 	ROM_LOAD( "2716u11b.bin",   0x7000, 0x0800, CRC(599b8b61) SHA1(e687c6f475a0fead3e47f05b1d1b3b29cf4a83a1) )
591 
592 	ROM_REGION( 0x0020, "proms", 0 )
593 	ROM_LOAD( "74s288.bin",     0x0000, 0x0020, CRC(c779ea99) SHA1(7702ae3684579950b36274ea91d4267c96faeeb8) )
594 ROM_END
595 
596 
597 ROM_START( catapult )
598 	ROM_REGION( 0x10000, "maincpu", 0 )
599 	ROM_LOAD( "co3223.u10",     0x0000, 0x1000, CRC(50abcfd2) SHA1(13ce04addc7bcaa1ec6659da26b1c13ed9dc28f9) )
600 	ROM_LOAD( "co3223.u09",     0x1000, 0x1000, CRC(fd5a9a1c) SHA1(512374e8450459537ba2cc41e7d0178052445316) )
601 	ROM_LOAD( "co3223.u08",     0x2000, 0x1000, BAD_DUMP CRC(4bfc36f3) SHA1(b916805eed40cfeff0c1b0cb3cdcbcc6e362a236)  ) /* BADADDR xxxx-xxxxxxx */
602 	ROM_LOAD( "co3223.u07",     0x3000, 0x1000, CRC(4113bb99) SHA1(3cebb874dae211d75082209e913d4afa4f621de1) )
603 	ROM_LOAD( "co3223.u06",     0x4000, 0x1000, CRC(966bb9f5) SHA1(1a217c6f7a88c58e0deae0290bc5ddd2789d18eb) )
604 	ROM_LOAD( "co3223.u05",     0x5000, 0x1000, CRC(65f9fb9a) SHA1(63b616a736d9e39a8f2f76889fd7c5fe4128a966) )
605 	ROM_LOAD( "co3223.u04",     0x6000, 0x1000, CRC(648453bc) SHA1(8e4538aedad4d32bd046aad474dbcc689ee8fe53) )
606 	ROM_LOAD( "co3223.u11",     0x7000, 0x0800, CRC(08fb8c28) SHA1(0b08cc2727a54e0ad7472234be0f637b46bc3253) )
607 
608 	ROM_REGION( 0x0020, "proms", 0 )
609 	ROM_LOAD( "co3223.u66",     0x0000, 0x0020, CRC(e7de76a7) SHA1(101ce85459a59c0d01ce3ea96480f1f8413a788e) )
610 ROM_END
611 
612 
613 ROM_START( suprglob )
614 	ROM_REGION( 0x10000, "maincpu", 0 )
615 	ROM_LOAD( "u10",            0x0000, 0x1000, CRC(c0141324) SHA1(a54bd71da233eb22f45da630693fddd5a0bcf25b) )
616 	ROM_LOAD( "u9",             0x1000, 0x1000, CRC(58be8128) SHA1(534f0a093b3ff577a2a5461498bc11ce14dc6d97) )
617 	ROM_LOAD( "u8",             0x2000, 0x1000, CRC(6d088c16) SHA1(0929ea1b58eab997b5d9c9642f8b47557a4045f1) )
618 	ROM_LOAD( "u7",             0x3000, 0x1000, CRC(b2768203) SHA1(9de52f4dbe6a46ea1b9b7f9cf70378211d372353) )
619 	ROM_LOAD( "u6",             0x4000, 0x1000, CRC(976c8f46) SHA1(120c76eff8c04ccb5ad945c4333e8c9de0cbc3af) )
620 	ROM_LOAD( "u5",             0x5000, 0x1000, CRC(340f5290) SHA1(2e5fa0c41d1626e5a435f2c55eec0bcdcb004223) )
621 	ROM_LOAD( "u4",             0x6000, 0x1000, CRC(173bd589) SHA1(25690a0c3cd0e017f8d220d8fbf2eaeb86f05fc5) )
622 	ROM_LOAD( "u11",            0x7000, 0x0800, CRC(d45b740d) SHA1(54c15f378b6d91ea1aba0a51921178bb15854079) )
623 
624 	ROM_REGION( 0x0020, "proms", 0 )
625 	ROM_LOAD( "82s123.u66",     0x0000, 0x0020, CRC(f4f6ddc5) SHA1(cab915acbefb5f451f538dd538bf9b3dd14bb1f5) )
626 ROM_END
627 
628 
629 ROM_START( theglob )
630 	ROM_REGION( 0x10000, "maincpu", 0 )
631 	ROM_LOAD( "globu10.bin",    0x0000, 0x1000, CRC(08fdb495) SHA1(739efa676b5a3df36a6061382aeb8c2d495ba23f) )
632 	ROM_LOAD( "globu9.bin",     0x1000, 0x1000, CRC(827cd56c) SHA1(3aedc1cefb463cf6b31befb33e50c832dc2e3941) )
633 	ROM_LOAD( "globu8.bin",     0x2000, 0x1000, CRC(d1219966) SHA1(571349f9c978fdcf826a0c66c3fb11a9e27b240a) )
634 	ROM_LOAD( "globu7.bin",     0x3000, 0x1000, CRC(b1649da7) SHA1(1509d48a72e545195e45d1170cdb113c6aecc8d9) )
635 	ROM_LOAD( "globu6.bin",     0x4000, 0x1000, CRC(b3457e67) SHA1(1347bdf085ad69879f9a9e7e4ed1ca4869e8e8cd) )
636 	ROM_LOAD( "globu5.bin",     0x5000, 0x1000, CRC(89d582cd) SHA1(f331c7a2fce606153992abb312c5406251a7fb3b) )
637 	ROM_LOAD( "globu4.bin",     0x6000, 0x1000, CRC(7ee9fdeb) SHA1(a8e0dd5d1cdcff132edc0eb182b66656ce244fa1) )
638 	ROM_LOAD( "globu11.bin",    0x7000, 0x0800, CRC(9e05dee3) SHA1(751799b23f0e664f59d3785b438ec3ae9f5bab2c) )
639 
640 	ROM_REGION( 0x0020, "proms", 0 )
641 	ROM_LOAD( "82s123.u66",     0x0000, 0x0020, CRC(f4f6ddc5) SHA1(cab915acbefb5f451f538dd538bf9b3dd14bb1f5) )
642 ROM_END
643 
644 
645 ROM_START( theglob2 )
646 	ROM_REGION( 0x10000, "maincpu", 0 )
647 	ROM_LOAD( "611293.u10",     0x0000, 0x1000, CRC(870af7ce) SHA1(f901619663313a72997f30ccecdeac8294fe200e) )
648 	ROM_LOAD( "611293.u9",      0x1000, 0x1000, CRC(a3679782) SHA1(fbc26ae98e2bf10272d61159b084d78a6f410374) )
649 	ROM_LOAD( "611293.u8",      0x2000, 0x1000, CRC(67499d1a) SHA1(dce7041df5ed1847e0ffc82672d09e00b16de3a9) )
650 	ROM_LOAD( "611293.u7",      0x3000, 0x1000, CRC(55e53aac) SHA1(20a428db287e8b7fb55cb9fe1a1ed0196481114c) )
651 	ROM_LOAD( "611293.u6",      0x4000, 0x1000, CRC(c64ad743) SHA1(572ff6acb9b2281581974646e96699d7d2388aff) )
652 	ROM_LOAD( "611293.u5",      0x5000, 0x1000, CRC(f93c3203) SHA1(8cb88b5202e99d206eccf7d25e168cf23acee19b) )
653 	ROM_LOAD( "611293.u4",      0x6000, 0x1000, CRC(ceea0018) SHA1(511430539429ef0e5368f7b605f2e680ca9038bc) )
654 	ROM_LOAD( "611293.u11",     0x7000, 0x0800, CRC(6ac83f9b) SHA1(b1e8482ec04107f0e595a714b7c0f70571aca6e5) )
655 
656 	ROM_REGION( 0x0020, "proms", 0 )
657 	ROM_LOAD( "82s123.u66",     0x0000, 0x0020, CRC(f4f6ddc5) SHA1(cab915acbefb5f451f538dd538bf9b3dd14bb1f5) )
658 ROM_END
659 
660 
661 ROM_START( theglob3 )
662 	ROM_REGION( 0x10000, "maincpu", 0 )
663 	ROM_LOAD( "theglob3.u10",   0x0000, 0x1000, CRC(969cfaf6) SHA1(b63226b8694640d6452bca12755780d1b52d1d3c) )
664 	ROM_LOAD( "theglob3.u9",    0x1000, 0x1000, CRC(8e6c010a) SHA1(ec9627742ce52eb29bbafc9d0555d16ac7146f2e) )
665 	ROM_LOAD( "theglob3.u8",    0x2000, 0x1000, CRC(1c1ca5c8) SHA1(6e5f9d7f9f016a72003433375c806c5f921ed423) )
666 	ROM_LOAD( "theglob3.u7",    0x3000, 0x1000, CRC(a54b9d22) SHA1(3db96d1f55642ecf1ebc76387cac76e8f9721919) )
667 	ROM_LOAD( "theglob3.u6",    0x4000, 0x1000, CRC(5a6f82a9) SHA1(ea92ad949373e8b1f06c65f243ceedad2fdcd934) )
668 	ROM_LOAD( "theglob3.u5",    0x5000, 0x1000, CRC(72f935db) SHA1(d7023cf5f16a77a42590a9c97c2690ac0e3d282a) )
669 	ROM_LOAD( "theglob3.u4",    0x6000, 0x1000, CRC(81db53ad) SHA1(a1e4aa8e08ca0f585b3638a3849a465977d44af0) )
670 	ROM_LOAD( "theglob3.u11",   0x7000, 0x0800, CRC(0e2e6359) SHA1(f231637ad4c997406989cf5a701d26c95e69171e) )
671 
672 	ROM_REGION( 0x0020, "proms", 0 )
673 	ROM_LOAD( "82s123.u66",     0x0000, 0x0020, CRC(f4f6ddc5) SHA1(cab915acbefb5f451f538dd538bf9b3dd14bb1f5) )
674 ROM_END
675 
676 
677 ROM_START( igmo )
678 	ROM_REGION( 0x10000, "maincpu", 0 )
679 	ROM_LOAD( "u10_igmo_i05134.u10", 0x0000, 0x1000, CRC(a9f691a4) SHA1(e3f2dc41bd8760fc52e99b7e9faa12c7cf51ffe0) )
680 	ROM_LOAD( "u9_igmo_i05134.u9",   0x1000, 0x1000, CRC(3c133c97) SHA1(002b5aff6b947b6a9cbabeed5be798c1ddf2bda1) )
681 	ROM_LOAD( "u8_igmo_i05134.u8",   0x2000, 0x1000, CRC(5692f8d8) SHA1(6ab50775dff49330a85fbfb2d4d4c3a2e54df3d1) )
682 	ROM_LOAD( "u7_igmo_i05134.u7",   0x3000, 0x1000, CRC(630ae2ed) SHA1(0c293b6192e703b16ed20c277c706ae90773f477) )
683 	ROM_LOAD( "u6_igmo_i05134.u6",   0x4000, 0x1000, CRC(d3f20e1d) SHA1(c0e0b542ac020adc085ec90c2462c6544098447e) )
684 	ROM_LOAD( "u5_igmo_i05134.u5",   0x5000, 0x1000, CRC(e26bb391) SHA1(ba0e44c02fbb36e18e0d779d46bb992e6aba6cf1) )
685 	ROM_LOAD( "u4_igmo_i05134.u4",   0x6000, 0x1000, CRC(762a4417) SHA1(7fed5221950e3e1ce41c0b4ded44597a242a0177) )
686 	ROM_LOAD( "u11_igmo_i05134.u11", 0x7000, 0x0800, CRC(8c675837) SHA1(2725729693960b53ea01ebffa0a81df2cd425890) )
687 
688 	ROM_REGION( 0x0020, "proms", 0 )
689 	ROM_LOAD( "82s123.u66",          0x0000, 0x0020, CRC(1ba03ffe) SHA1(f5692c06ae6d20c010430c8d08f5c60e78d36dc9) )
690 ROM_END
691 
692 
693 ROM_START( eeekk )
694 	ROM_REGION( 0x10000, "maincpu", 0 )
695 	ROM_LOAD( "u10_e12063.u10", 0x0000, 0x1000, CRC(edd05de2) SHA1(25dfa7ad2e29b1ca9ce9bb36bf1a573baabb4d5b) )
696 	ROM_LOAD( "u9_e12063.u9",   0x1000, 0x1000, CRC(6f57114a) SHA1(417b910a4343da026426b4cfd0a83b9142c87353) )
697 	ROM_LOAD( "u8_e12063.u8",   0x2000, 0x1000, CRC(bcb0ebbd) SHA1(a2a00dedee12d6006817021e98fb44b2339127a0) )
698 	ROM_LOAD( "u7_e12063.u7",   0x3000, 0x1000, CRC(a0df8f77) SHA1(ee2afed25ab32bf09b14e8638d03b6e2f8e6b337) )
699 	ROM_LOAD( "u6_e12063.u6",   0x4000, 0x1000, CRC(61953b0a) SHA1(67bcb4286e39cdda20684a4f580392468b08800e) )
700 	ROM_LOAD( "u5_e12063.u5",   0x5000, 0x1000, CRC(4c22c6d9) SHA1(94a8fc951994746f8ccfb77d80f8b98fde8a6f33) )
701 	ROM_LOAD( "u4_e12063.u4",   0x6000, 0x1000, CRC(3d341208) SHA1(bc4d2567df2779d97e718376c4bf682ba459c01e) )
702 	ROM_LOAD( "u11_e12063.u11", 0x7000, 0x0800, CRC(417faff0) SHA1(7965155ee32694ea9a10245db73d8beef229408c) )
703 
704 	ROM_REGION( 0x0020, "proms", 0 )
705 	ROM_LOAD( "74s288.u66",     0x0000, 0x0020, CRC(f2078c38) SHA1(7bfd49932a6fd8840514b7af93a64cedb248122d) )
706 ROM_END
707 
708 
709 // Tristar 9000 boards:
710 ROM_START( dealer )
711 	ROM_REGION( 0x40000, "maincpu", 0 )
712 	ROM_LOAD( "u1.bin",         0x0000, 0x2000, CRC(e06f3563) SHA1(0d58cd1f2e1ca89adb9c64d7dd520bb1f2d50f1a) )
713 	ROM_LOAD( "u2.bin",         0x2000, 0x2000, CRC(726bbbd6) SHA1(3538f3d655899c2a0f984c43fb7545ea4be1b231) )
714 	ROM_LOAD( "u3.bin",         0x4000, 0x2000, CRC(ab721455) SHA1(a477da0590e0431172baae972e765473e19dcbff) )
715 	ROM_LOAD( "u4.bin",         0x6000, 0x2000, CRC(ddb903e4) SHA1(4c06a2048b1c6989c363b110a17c33180025b9c8) )
716 
717 	ROM_REGION( 0x1000, "nvram", 0)
718 	ROM_LOAD( "dealer.nv", 0, 0x1000, CRC(a6f88459) SHA1(1deda2a71433c97fe3e5cb39defc285f4fa9c9b8) )
719 ROM_END
720 
721 /*
722 
723 Revenger 84 - EPOS
724 
725 EPOS TRISTAR 9000
726 +-------------------------------+
727 |                               |
728 |  DSW                          |
729 |             4116 4116         |
730 | 8910  Z80A  4116 4116         |
731 |             4116 4116         |
732 |  6116  BAT  4116 4116         |
733 |  6116       4116 4116         |
734 |  U4         4116 4116  74S189 |
735 |  U3         4116 4116  74S189 |
736 |  U2 PAL.U13 4116 4116         |
737 |  U1 PAL10L8 8255  DM74S288N   |
738 |                     22.1184MHz|
739 |                               |
740 |                      LM384N   |
741 |                        VOL    |
742 +--|28 pin Connector|-----------+
743 
744   CPU: Z80A        2.764800 MHz [22.1184MHz/8]
745 Sound: AY-3-8910   0.691200 MHz [22.1184MHz/32]
746  XTAL: 22.1184MHz
747   DSW: 8 position dipswitch bank
748   BAT: Battery (battery backed up RAM for high scores)
749   VOL: Volume Pot
750 
751 28 Pin non-JAMMA connector
752 
753  4 ROMs at U1 through U4 are 2764 type
754  BPROM at U60 is a DM74S288N
755  2 pals, U12 is a PAL10L8, U13 PAL type is unknown (markings scrubbed off)
756 
757 4116 RAS is = 2.764800 MHz [22.1184MHz/8]
758 4116 CAS is = 1.382400 MHz [22.1184MHz/16]
759 
760 */
761 
762 ROM_START( revngr84 )
763 	ROM_REGION( 0x40000, "maincpu", 0 )
764 	ROM_LOAD( "u_1__revenger__r06254__=c=_epos_corp.m5l2764k.u1",  0x0000, 0x2000, CRC(308f231f) SHA1(cf06695601bd0387e4fcb64d9b34143323e98b07) ) /* labeled as "U 1 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */
765 	ROM_LOAD( "u_2__revenger__r06254__=c=_epos_corp.m5l2764k.u2",  0x2000, 0x2000, CRC(e80bbfb4) SHA1(9302beaef8bbb7376b6a20e9ee5adbcf60d66dd8) ) /* labeled as "U 2 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */
766 	ROM_LOAD( "u_3__revenger__r06254__=c=_epos_corp.m5l2764k.u3",  0x4000, 0x2000, CRC(d9270929) SHA1(a95034b5387a40e02f04bdfa79e1d8e65dad30fe) ) /* labeled as "U 3 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */
767 	ROM_LOAD( "u_4__revenger__r06254__=c=_epos_corp.m5l2764k.u4",  0x6000, 0x2000, CRC(d6e6cfa8) SHA1(f10131bb2e9d088c7b6d6a5d5520073d78ad69cc) ) /* labeled as "U 4 // REVENGER // R06254 // (C) EPOS CORP" (hand written R06254 over R06124) */
768 
769 	ROM_REGION( 0x0020, "proms", 0 )
770 	ROM_LOAD( "dm74s288n.u60", 0x0000, 0x0020, CRC(be2b0641) SHA1(26982903b6d942af8e0a526412d8e01978d76420) ) // unknown purpose
771 
772 	ROM_REGION( 0x1000, "nvram", 0)
773 	ROM_LOAD( "revngr84.nv", 0, 0x1000, CRC(a4417770) SHA1(92eded82db0810e7818d2f52a0497032f390fcc1) )
774 ROM_END
775 
776 ROM_START( revenger )
777 	ROM_REGION( 0x40000, "maincpu", 0 )
778 	// these roms probably had the same "U x // REVENGER // R06124 // (C) EPOS CORP" printed labels as the newer set above, but without the hand-penned "25" in r06254 written over the printed "12" of r06124 as above
779 	ROM_LOAD( "r06124.u1",    0x0000, 0x2000, BAD_DUMP CRC(fad1a2a5) SHA1(a31052c91fe67e2e90441abc40b6483f921ecfe3) )
780 	ROM_LOAD( "r06124.u2",    0x2000, 0x2000, BAD_DUMP CRC(a8e0ee7b) SHA1(f6f78e8ce40eab07de461b364876c1eb4a78d96e) )
781 	ROM_LOAD( "r06124.u3",    0x4000, 0x2000, BAD_DUMP CRC(cca414a5) SHA1(1c9dd3ff63d57e9452e63083cdbd7f5d693bb686) )
782 	ROM_LOAD( "r06124.u4",    0x6000, 0x2000, BAD_DUMP CRC(0b81c303) SHA1(9022d18dec11312eb4bb471c22b563f5f897b4f7) )
783 
784 	ROM_REGION( 0x0020, "proms", 0 ) /* this PROM not included in this dump, but assumed to be the same as above set */
785 	ROM_LOAD( "dm74s288n.u60", 0x0000, 0x0020, CRC(be2b0641) SHA1(26982903b6d942af8e0a526412d8e01978d76420) ) // unknown purpose
786 
787 	ROM_REGION( 0x1000, "nvram", 0)
788 	ROM_LOAD( "revngr84.nv", 0, 0x1000, CRC(a4417770) SHA1(92eded82db0810e7818d2f52a0497032f390fcc1) )
789 ROM_END
790 
791 ROM_START( beastf )
792 	ROM_REGION( 0x40000, "maincpu", 0 )
793 	ROM_LOAD( "u_1__beastie__feastie__b09084.m5l2764k.u1",  0x0000, 0x2000, CRC(820d4019) SHA1(e953aaeeb626776dd86c521066b553d054ae4422) ) /* labeled as "U 1 // BEASTIE // FEASTIE // B09084" */
794 	ROM_LOAD( "u_2__beastie__feastie__b09084.m5l2764k.u2",  0x2000, 0x2000, CRC(967405d8) SHA1(dd763be909e6966521b01ee878df9cef865c3b30) ) /* labeled as "U 2 // BEASTIE // FEASTIE // B09084" */
795 	ROM_LOAD( "u_3__beastie__feastie__b09084.m5l2764k.u3",  0x4000, 0x2000, CRC(3edb5381) SHA1(14c236045e6df7a475c32222652860689d4f68ce) ) /* labeled as "U 3 // BEASTIE // FEASTIE // B09084" */
796 	ROM_LOAD( "u_4__beastie__feastie__b09084.m5l2764k.u4",  0x6000, 0x2000, CRC(c8cd9640) SHA1(72da881b903ead873cc3f4df27646d1ffdd63c1c) ) /* labeled as "U 4 // BEASTIE // FEASTIE // B09084" */
797 
798 	ROM_REGION( 0x1000, "nvram", 0)
799 	ROM_LOAD( "beastf.nv", 0, 0x1000, CRC(98017b09) SHA1(0e2b2071bb47fc179d5bc36ef9431a9d2727d36a) )
800 ROM_END
801 
802 void epos_state::init_dealer()
803 {
804 	uint8_t *rom = memregion("maincpu")->base();
805 
806 	/* Key 0 */
807 	for (int A = 0; A < 0x8000; A++)
808 		rom[A] = bitswap<8>(rom[A] ^ 0xbd, 2,6,4,0,5,7,1,3 );
809 
810 	/* Key 1 */
811 	for (int A = 0; A < 0x8000; A++)
812 		rom[A + 0x10000] = bitswap<8>(rom[A], 7,5,4,6,3,2,1,0 );
813 
814 	/* Key 2 */
815 	for (int A = 0; A < 0x8000; A++)
816 		rom[A + 0x20000] = bitswap<8>(rom[A] ^ 1, 7,6,5,4,3,0,2,1 );
817 
818 	/* Key 3 */
819 	for (int A = 0; A < 0x8000; A++)
820 		rom[A + 0x30000] = bitswap<8>(rom[A] ^ 1, 7,5,4,6,3,0,2,1 );
821 
822 	/*
823 	    there is not enough data to determine key 3.
824 	    the code in question is this:
825 
826 	    [this is the data as decrypted by Key 1]
827 	    2F58: 55 5C 79
828 	    2F5B: 55 F7 79
829 	    2F5E: 55 CD 79
830 
831 	    it must become
832 
833 	    2F58: 32 3e 78  ld (793e),a
834 	    2F5B: 32 xx 78  ld (79xx),a
835 	    2F5E: 32 xx 78  ld (79xx),a
836 
837 	    the obvious solution is a combination of key 1 and key 2.
838 	*/
839 }
840 
841 
842 /*************************************
843  *
844  *  Game drivers
845  *
846  *************************************/
847 
848 /* EPOS TRISTAR 8000 PCB based */
849 GAME( 1982, megadon,  0,        epos,   megadon,  epos_state, empty_init, ROT270, "Epos Corporation (Photar Industries license)", "Megadon", MACHINE_SUPPORTS_SAVE )
850 GAME( 1982, catapult, 0,        epos,   catapult, epos_state, empty_init, ROT270, "Epos Corporation", "Catapult",           MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* bad rom, hold f2 for test mode */
851 GAME( 1983, suprglob, 0,        epos,   suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "Super Glob",         MACHINE_SUPPORTS_SAVE )
852 GAME( 1983, theglob,  suprglob, epos,   suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob",           MACHINE_SUPPORTS_SAVE )
853 GAME( 1983, theglob2, suprglob, epos,   suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob (earlier)", MACHINE_SUPPORTS_SAVE )
854 GAME( 1983, theglob3, suprglob, epos,   suprglob, epos_state, empty_init, ROT270, "Epos Corporation", "The Glob (set 3)",   MACHINE_SUPPORTS_SAVE )
855 GAME( 1984, igmo,     0,        epos,   igmo,     epos_state, empty_init, ROT270, "Epos Corporation", "IGMO",               MACHINE_SUPPORTS_SAVE )
856 GAME( 1983, eeekk,    0,        epos,   eeekk,    epos_state, empty_init, ROT270, "Epos Corporation", "Eeekk!",             MACHINE_SUPPORTS_SAVE )
857 
858 /* EPOS TRISTAR 9000 PCB based */
859 GAME( 1984, dealer,   0,        dealer, dealer,   epos_state, init_dealer, ROT270, "Epos Corporation", "The Dealer",           MACHINE_SUPPORTS_SAVE )
860 GAME( 1984, revngr84, 0,        dealer, beastf,   epos_state, init_dealer, ROT270, "Epos Corporation", "Revenger '84 (newer)", MACHINE_SUPPORTS_SAVE )
861 GAME( 1984, revenger, revngr84, dealer, beastf,   epos_state, init_dealer, ROT270, "Epos Corporation", "Revenger '84 (older)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
862 GAME( 1984, beastf,   suprglob, dealer, beastf,   epos_state, init_dealer, ROT270, "Epos Corporation", "Beastie Feastie",      MACHINE_SUPPORTS_SAVE )
863