1 /*
2 	Sega System16 Hardware
3 	major cleanup in progress - still a lot to do!
4 
5 	see vidhrdw/system16.c for more information
6 
7 Changes:
8 
9 04/28/04  Charles MacDonald
10 - Added MSM5205 sample playback to tturfbl.
11 
12 03/17/04
13 - Added correctly dumped ROM set for eswat to replace the old one. Game is encrypted and unplayable.
14 - Moved Ace Attacker here from System 18 driver. Game is encrypted and unplayable.
15 - Added sound support for tturf, tturfu, tturfbl (no samples), fpointbl, fpointbj
16 - Fixed toryumon RAM test
17 - Cleaned up timscannr, toryumon drivers
18 03/11/04
19 - Cleaned up riotcity, aurail, altbeast, bayroute drivers
20 - Added missing coin control to sys16_coinctrl_w
21 - Removed 'extra' RAM in some drivers and replaced with sys16_tilebank_w
22 
23 To do:
24 - tturf and tturfu have some invalid data written to the UPD7759. I think this causes the 'pop' sound when level 1 starts.
25 - tturfbl has some serious problems with tilemap scrolling
26 - bayroute has a bad sprite in the door of the level 1 boss
27 - altbeast writes to mirrored sprite RAM at $441000
28 - tturfu has bad single sprite frame when main character walks
29 - dduxbl has some 'stuck' sprites
30 
31 Notes:
32 - toryumon RAM test accesses mirrored work RAM. Maybe there's a better way to support this than using AM_MASK.
33 - I separated the fpoint and fpointbl,fpointbj machine drivers as the latter two have different sound hardware,
34   but the original does not. I think this creates a dependancy where fpointbl.zip needs flpoint.001 from fpointbj.zip,
35   as fpointbl uses fpoint ROMs (it's parent), it's own, and the sound ROM from fpointbj.
36   So add fpoint.001 to fpointbl.zip for it to work.
37   I made fpointbl the parent of fpointbj so it would use the proper memory map for the sound hardware.
38 */
39 
40 /***************************************************************************/
41 /*
42   ASTORMBL
43           3. In the ending, the 3 heroes are floating into a half bubble. (see picture).
44           Also colour problems during ending as well.
45           4. In the later Shooting gallery stage (like inside the car shop and the factory (mission 3)),
46 		  there is some garbage graphics (sprite of death monsters that appear where they should not)
47 
48 	working:
49 		Alex Kidd
50 		Alien Storm (bootleg)
51 		Alien Syndrome
52 		Altered Beast (Ver 1)
53 		Altered Beast (Ver 2)	(No Sound)
54 		Atomic Point			(No Sound)
55 		Aurail					(Speech quality sounds poor)
56 		Aurail (317-0168)
57 		Bay Route
58 		Body Slam
59 	    Dump Matsumoto (Japan, Body Slam)
60 		Dynamite Dux (bootleg)
61 		Enduro Racer (bootleg)
62 		Enduro Racer (custom bootleg)
63 		E-Swat (bootleg)
64 		Fantasy Zone (Old Ver.)
65 		Fantasy Zone (New Ver.)
66 		Flash Point  (bootleg)
67 		Golden Axe (Ver 1)
68 		Golden Axe (Ver 2)
69 		Hang-on
70 		Heavyweight Champ: some minor graphics glitches
71 		Major League: No game over.
72 		Moonwalker (bootleg): Music Speed varies
73 		Outrun (set 1)
74 		Outrun (set 2)
75 		Outrun (custom bootleg)
76 		Passing Shot (bootleg)
77 		Passing Shot (4 player bootleg)
78 		Quartet: Glitch on highscore list
79 		Quartet (Japan): Glitch on highscore list
80 		Quartet 2: Glitch on highscore list
81 		Riot City
82 		SDI
83 		Shadow Dancer
84 		Shadow Dancer (Japan)
85 		Shinobi
86 		Shinobi (Sys16A Bootleg?)
87 		Space Harrier
88 		Super Hangon (bootleg)
89 		Tetris (bootleg)
90 		Time Scanner
91 		Toryumon
92 		Tough Turf (Japan)			(No Sound)
93 		Tough Turf (US)				(No Sound)
94 		Tough Turf (bootleg)	(No Speech Roms)
95 		Wonderboy 3 - Monster Lair
96 		Wonderboy 3 - Monster Lair (bootleg)
97 		Wrestle War
98 
99 	not really working:
100 		Shadow Dancer (bootleg)
101 
102 	protected:
103 		Alex Kidd (jpn?)
104 		Alien Syndrome
105 		Alien Syndrome
106 		Alien Syndrome (Japan)
107 		Alien Storm
108 		Alien Storm (2 Player)
109 		Bay Route (317-0116)
110 		Bay Route (protected bootleg 1)
111 		Bay Route (protected bootleg 2)
112 		Enduro Racer
113 		E-Swat
114 		Flash Point
115 		Golden Axe (Ver 1 317-0121 Japan)
116 		Golden Axe (Ver 2 317-0110)
117 		Golden Axe (Ver 2 317-0122)
118 		Golden Axe (protected bootleg)
119 		Jyuohki (Japan, altered beast)
120 		Moonwalker (317-0158)
121 		Moonwalker (317-0159)
122 		Passing Shot (317-0080)
123 		Shinobi (Sys16B 317-0049)
124 		Shinobi (Sys16A 317-0050)
125 		SDI (Japan, old version)
126 		Super Hangon
127 		Tetris (Type A)
128 		Tetris (Type B 317-0092)
129 		Wonderboy 3 - Monster Lair (317-0089)
130 
131 	protected (No driver):
132 		Ace Attacker
133 		Action Fighter
134 		Bloxeed
135 		Clutch Hitter
136 		Cotton (Japan)
137 		Cotton
138 		DD Crew
139 		Dunk Shot
140 		Excite League
141 		Laser Ghost
142 		MVP
143 		Ryukyu
144 		Super Leagu
145 		Turbo Outrun
146 		Turbo Outrun (Set 2)
147 */
148 
149 #include "driver.h"
150 #include "vidhrdw/generic.h"
151 #include "cpu/z80/z80.h"
152 #include "cpu/i8039/i8039.h"
153 #include "system16.h"
154 
155 /***************************************************************************/
156 
157 // 7751 emulation
158 WRITE_HANDLER( sys16_7751_audio_8255_w );
159  READ_HANDLER( sys16_7751_audio_8255_r );
160  READ_HANDLER( sys16_7751_sh_rom_r );
161  READ_HANDLER( sys16_7751_sh_t1_r );
162  READ_HANDLER( sys16_7751_sh_command_r );
163 WRITE_HANDLER( sys16_7751_sh_dac_w );
164 WRITE_HANDLER( sys16_7751_sh_busy_w );
165 WRITE_HANDLER( sys16_7751_sh_offset_a0_a3_w );
166 WRITE_HANDLER( sys16_7751_sh_offset_a4_a7_w );
167 WRITE_HANDLER( sys16_7751_sh_offset_a8_a11_w );
168 WRITE_HANDLER( sys16_7751_sh_rom_select_w );
169 
170 /***************************************************************************/
171 
172 int sys16_wwfix=0, sys16_alienfix=0; //*
173 
174 static data16_t coinctrl;
175 
WRITE16_HANDLER(sys16_3d_coinctrl_w)176 static WRITE16_HANDLER( sys16_3d_coinctrl_w )
177 {
178 	if( ACCESSING_LSB ){
179 		coinctrl = data&0xff;
180 		sys16_refreshenable = coinctrl & 0x10;
181 		coin_counter_w(0,coinctrl & 0x01);
182 		/* bit 6 is also used (0 in fantzone) */
183 
184 		/* Hang-On, Super Hang-On, Space Harrier, Enduro Racer */
185 		set_led_status(0,coinctrl & 0x04);
186 
187 		/* Space Harrier */
188 		set_led_status(1,coinctrl & 0x08);
189 	}
190 }
191 
INTERRUPT_GEN(sys16_interrupt)192 static INTERRUPT_GEN( sys16_interrupt )
193 {
194 	if(sys16_custom_irq) sys16_custom_irq();
195 	cpu_set_irq_line(0, 4, HOLD_LINE); /* Interrupt vector 4, used by VBlank */
196 }
197 
198 
199 
200 /***************************************************************************/
201 /*
202 	Tough Turf (Datsu bootleg) sound emulation
203 
204 	Memory map
205 
206 	0000-7fff : ROM (fixed, tt014d68 0000-7fff)
207 	8000-bfff : ROM (banked)
208 	e000      : Bank control
209 	e800      : Sound command latch
210 	f000      : MSM5205 sample data buffer
211 	f800-ffff : Work RAM
212 
213 	Interrupts
214 
215 	IRQ = Read sound command from $E800
216 	NMI = Copy data from fixed/banked ROM to $F000
217 
218 	Bank control values
219 
220 	00 = tt014d68 8000-bfff
221 	01 = tt014d68 c000-ffff
222 	02 = tt0246ff 0000-3fff
223 	03 = tt0246ff 4000-7fff
224 	04 = tt0246ff 8000-bfff
225 
226 	The sample sound codes in the sound test are OK, but in-game sample playback is bad.
227 	There seems to be more data in the high bits of the ROM bank control word which may be related.
228 */
229 
230 static int sample_buffer = 0;
231 static int sample_select = 0;
232 
WRITE_HANDLER(tturfbl_msm5205_data_w)233 static WRITE_HANDLER( tturfbl_msm5205_data_w )
234 {
235 	sample_buffer = data;
236 }
237 
tturfbl_msm5205_callback(int data)238 static void tturfbl_msm5205_callback(int data)
239 {
240 	MSM5205_data_w(0, (sample_buffer >> 4) & 0x0F);
241 	sample_buffer <<= 4;
242 	sample_select ^= 1;
243 	if(sample_select == 0)
244 		cpu_set_nmi_line(1, PULSE_LINE);
245 }
246 
247 static struct MSM5205interface tturfbl_msm5205_interface =
248 {
249 	1,
250 	220000, /* 220KHz */
251 	{ tturfbl_msm5205_callback },
252 	{ MSM5205_S48_4B},
253 	{ 80 }
254 };
255 
256 
257 UINT8 *tturfbl_soundbank_ptr = NULL;		/* Pointer to currently selected portion of ROM */
258 
READ_HANDLER(tturfbl_soundbank_r)259 static READ_HANDLER( tturfbl_soundbank_r )
260 {
261 	if(tturfbl_soundbank_ptr) return tturfbl_soundbank_ptr[offset & 0x3fff];
262 	return 0x80;
263 }
264 
WRITE_HANDLER(tturfbl_soundbank_w)265 static WRITE_HANDLER( tturfbl_soundbank_w )
266 {
267 	UINT8 *mem = memory_region(REGION_CPU2);
268 
269 	switch(data)
270 	{
271 		case 0:
272 			tturfbl_soundbank_ptr = &mem[0x18000]; /* tt014d68 8000-bfff */
273 			break;
274 		case 1:
275 			tturfbl_soundbank_ptr = &mem[0x1C000]; /* tt014d68 c000-ffff */
276 			break;
277 		case 2:
278 			tturfbl_soundbank_ptr = &mem[0x20000]; /* tt0246ff 0000-3fff */
279 			break;
280 		case 3:
281 			tturfbl_soundbank_ptr = &mem[0x24000]; /* tt0246ff 4000-7fff */
282 			break;
283 		case 4:
284 			tturfbl_soundbank_ptr = &mem[0x28000]; /* tt0246ff 8000-bfff */
285 			break;
286 		case 8:
287 			tturfbl_soundbank_ptr = mem;
288 			break;
289 		default:
290 			tturfbl_soundbank_ptr = NULL;
291 			log_cb(RETRO_LOG_DEBUG, LOGPRE "Invalid bank setting %02X (%04X)\n", data, activecpu_get_pc());
292 			break;
293 	}
294 }
295 
MEMORY_READ_START(tturfbl_sound_readmem)296 static MEMORY_READ_START( tturfbl_sound_readmem )
297     { 0x0000, 0x7fff, MRA_ROM },
298 	{ 0x8000, 0xbfff, tturfbl_soundbank_r },
299 	{ 0xe800, 0xe800, soundlatch_r },
300 	{ 0xf800, 0xffff, MRA_RAM },
301 MEMORY_END
302 
303 static MEMORY_WRITE_START( tturfbl_sound_writemem )
304     { 0x0000, 0x7fff, MWA_ROM },
305 	{ 0x8000, 0xbfff, MWA_NOP },/* ROM bank */
306 	{ 0xe000, 0xe000, tturfbl_soundbank_w },
307 	{ 0xf000, 0xf000, tturfbl_msm5205_data_w },
308 	{ 0xf800, 0xffff, MWA_RAM },
309 MEMORY_END
310 
311 static PORT_READ_START( tturfbl_sound_readport )
312     { 0x01, 0x01, YM2151_status_port_0_r },
313 	{ 0x80, 0x80, MRA_NOP },
314 PORT_END
315 
316 static PORT_WRITE_START( tturfbl_sound_writeport )
317     { 0x00, 0x00, YM2151_register_port_0_w },
318 	{ 0x01, 0x01, YM2151_data_port_0_w },
319 	{ 0x40, 0x40, MWA_NOP },
320 	{ 0x80, 0x80, MWA_NOP },
321 PORT_END
322 
323 /*******************************************************************************/
324 
325 static MEMORY_READ_START( sound_readmem )
326     { 0x0000, 0x7fff, MRA_ROM },
327 	{ 0xe800, 0xe800, soundlatch_r },
328 	{ 0xf800, 0xffff, MRA_RAM },
329 MEMORY_END
330 
331 static MEMORY_WRITE_START( sound_writemem )
332     { 0x0000, 0x7fff, MWA_ROM },
333 	{ 0xf800, 0xffff, MWA_RAM },
334 MEMORY_END
335 
336 static PORT_READ_START( sound_readport )
337     { 0x01, 0x01, YM2151_status_port_0_r },
338 	{ 0xc0, 0xc0, soundlatch_r },
339 PORT_END
340 
341 static PORT_WRITE_START( sound_writeport )
342     { 0x00, 0x00, YM2151_register_port_0_w },
343 	{ 0x01, 0x01, YM2151_data_port_0_w },
344 PORT_END
345 
346 // 7751 Sound
347 static MEMORY_READ_START( sound_readmem_7751 )
348     { 0x0000, 0x7fff, MRA_ROM },
349 	{ 0xe800, 0xe800, soundlatch_r },
350 	{ 0xf800, 0xffff, MRA_RAM },
351 MEMORY_END
352 
353 static PORT_READ_START( sound_readport_7751 )
354     { 0x01, 0x01, YM2151_status_port_0_r },
355 //  { 0x0e, 0x0e, sys16_7751_audio_8255_r },
356 	{ 0xc0, 0xc0, soundlatch_r },
357 PORT_END
358 
359 static PORT_WRITE_START( sound_writeport_7751 )
360     { 0x00, 0x00, YM2151_register_port_0_w },
361 	{ 0x01, 0x01, YM2151_data_port_0_w },
362 	{ 0x80, 0x80, sys16_7751_audio_8255_w },
363 PORT_END
364 
365 static MEMORY_READ_START( readmem_7751 )
366     { 0x0000, 0x03ff, MRA_ROM },
367 MEMORY_END
368 
369 static MEMORY_WRITE_START( writemem_7751 )
370     { 0x0000, 0x03ff, MWA_ROM },
371 MEMORY_END
372 
373 static PORT_READ_START( readport_7751 )
374     { I8039_t1, I8039_t1, sys16_7751_sh_t1_r },
375 	{ I8039_p2, I8039_p2, sys16_7751_sh_command_r },
376 	{ I8039_bus, I8039_bus, sys16_7751_sh_rom_r },
377 PORT_END
378 
379 static PORT_WRITE_START( writeport_7751 )
380     { I8039_p1, I8039_p1, sys16_7751_sh_dac_w },
381 	{ I8039_p2, I8039_p2, sys16_7751_sh_busy_w },
382 	{ I8039_p4, I8039_p4, sys16_7751_sh_offset_a0_a3_w },
383 	{ I8039_p5, I8039_p5, sys16_7751_sh_offset_a4_a7_w },
384 	{ I8039_p6, I8039_p6, sys16_7751_sh_offset_a8_a11_w },
385 	{ I8039_p7, I8039_p7, sys16_7751_sh_rom_select_w },
386 PORT_END
387 
388 // 7759
389 static MEMORY_READ_START( sound_readmem_7759 )
390     { 0x0000, 0x7fff, MRA_ROM },
391 	{ 0x8000, 0xdfff, MRA_BANK1 },
392 	{ 0xe800, 0xe800, soundlatch_r },
393 	{ 0xf800, 0xffff, MRA_RAM },
394 MEMORY_END
395 
396 
397 static WRITE_HANDLER( UPD7759_bank_w ) //*
398 {
399 	int offs, size = memory_region_length(REGION_CPU2) - 0x10000;
400 
401 	UPD7759_reset_w(0, data & 0x40);
402 	if (sys16_alienfix && (data&0x30)==0x20) data-=2;
403 	offs = 0x10000 + (data * 0x4000) % size;
404 	cpu_setbank(1, memory_region(REGION_CPU2) + offs);
405 }
406 
407 
PORT_WRITE_START(sound_writeport_7759)408 static PORT_WRITE_START( sound_writeport_7759 )
409     { 0x00, 0x00, YM2151_register_port_0_w },
410 	{ 0x01, 0x01, YM2151_data_port_0_w },
411 	{ 0x40, 0x40, UPD7759_bank_w },
412 	{ 0x80, 0x80, UPD7759_0_port_w },
413 PORT_END
414 
415 
416 static WRITE16_HANDLER( sound_command_w ){
417 	if( ACCESSING_LSB ){
418 		soundlatch_w( 0,data&0xff );
419 		cpu_set_irq_line( 1, 0, HOLD_LINE );
420 	}
421 }
422 
WRITE16_HANDLER(sound_command_nmi_w)423 static WRITE16_HANDLER( sound_command_nmi_w ){
424 	if( ACCESSING_LSB ){
425 		soundlatch_w( 0,data&0xff );
426 		cpu_set_nmi_line(1, PULSE_LINE);
427 	}
428 }
429 
430 //static data16_t coinctrl;
431 
READ16_HANDLER(sys16_coinctrl_r)432 static READ16_HANDLER( sys16_coinctrl_r ){
433 	return coinctrl;
434 }
435 
WRITE16_HANDLER(sys16_coinctrl_w)436 static WRITE16_HANDLER( sys16_coinctrl_w )
437 {
438 	if( ACCESSING_LSB ){
439 		coinctrl = data&0xff;
440 		sys16_refreshenable = coinctrl & 0x20;
441 		set_led_status(1,coinctrl & 0x08);
442 		set_led_status(0,coinctrl & 0x04);
443 		coin_counter_w(1,coinctrl & 0x02);
444 		coin_counter_w(0,coinctrl & 0x01);
445 		/* bit 6 is also used (1 most of the time; 0 in dduxbl, sdi, wb3;
446 		   tturf has it normally 1 but 0 after coin insertion) */
447 		/* eswat sets bit 4 */
448 	}
449 }
450 
451 /***************************************************************************/
452 
453 static MACHINE_DRIVER_START( system16 )
454 
455 	/* basic machine hardware */
456 	MDRV_CPU_ADD_TAG("main", M68000, 10000000)
457 	MDRV_CPU_VBLANK_INT(sys16_interrupt,1)
458 
459 	MDRV_CPU_ADD_TAG("sound", Z80, 4000000)
MDRV_CPU_FLAGS(CPU_AUDIO_CPU)460 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
461     MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
462 	MDRV_CPU_PORTS(sound_readport,sound_writeport)
463 
464 	MDRV_FRAMES_PER_SECOND(60)
465 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
466 
467 	/* video hardware */
468 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
469 	MDRV_SCREEN_SIZE(40*8, 28*8)
470 	MDRV_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
471 	MDRV_GFXDECODE(sys16_gfxdecodeinfo)
472 	MDRV_PALETTE_LENGTH(2048*ShadowColorsMultiplier)
473 
474 	MDRV_VIDEO_START(system16)
475 	MDRV_VIDEO_UPDATE(system16)
476 
477 	/* sound hardware */
478 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
479 	MDRV_SOUND_ADD_TAG("2151", YM2151, sys16_ym2151_interface)
480 MACHINE_DRIVER_END
481 
482 
483 static MACHINE_DRIVER_START( system16_7759 )
484 
485 	/* basic machine hardware */
486 	MDRV_IMPORT_FROM(system16)
487 
488 	MDRV_CPU_MODIFY("sound")
489     MDRV_CPU_MEMORY(sound_readmem_7759,sound_writemem)
490 	MDRV_CPU_PORTS(sound_readport,sound_writeport_7759)
491 
492 	/* sound hardware */
493 	MDRV_SOUND_ADD_TAG("7759", UPD7759, sys16_upd7759_interface)
494 MACHINE_DRIVER_END
495 
496 
497 static MACHINE_DRIVER_START( system16_7751 )
498 
499 	/* basic machine hardware */
500 	MDRV_IMPORT_FROM(system16)
501 
502 	MDRV_CPU_MODIFY("sound")
503 	MDRV_CPU_MEMORY(sound_readmem_7751,sound_writemem)
504 	MDRV_CPU_PORTS(sound_readport_7751,sound_writeport_7751)
505 
506 	MDRV_CPU_ADD(N7751, 6000000/15)
507 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
508 	MDRV_CPU_MEMORY(readmem_7751,writemem_7751)
509 	MDRV_CPU_PORTS(readport_7751,writeport_7751)
510 
511 	/* sound hardware */
512 	MDRV_SOUND_ADD(DAC, sys16_7751_dac_interface)
513 MACHINE_DRIVER_END
514 
515 /***************************************************************************/
516 
517 static WRITE16_HANDLER( sys16_tilebank_w )
518 {
519 	if(ACCESSING_LSB)
520 	{
521 		switch(offset & 1)
522 		{
523 			case 0:
524 				sys16_tile_bank0 = data & 0x0F;
525 				break;
526 			case 1:
527 				sys16_tile_bank1 = data & 0x0F;
528 				break;
529 		}
530 	}
531 }
532 
set_tile_bank(int data)533 static void set_tile_bank( int data ){
534 	sys16_tile_bank1 = data&0xf;
535 	sys16_tile_bank0 = (data>>4)&0xf;
536 }
537 
538 #if 0
539 static void set_tile_bank18( int data ){
540 	sys16_tile_bank0 = data&0xf;
541 	sys16_tile_bank1 = (data>>4)&0xf;
542 }
543 #endif
544 
set_fg_page(int data)545 static void set_fg_page( int data ){
546 	sys16_fg_page[0] = data>>12;
547 	sys16_fg_page[1] = (data>>8)&0xf;
548 	sys16_fg_page[2] = (data>>4)&0xf;
549 	sys16_fg_page[3] = data&0xf;
550 }
551 
set_bg_page(int data)552 static void set_bg_page( int data ){
553 	sys16_bg_page[0] = data>>12;
554 	sys16_bg_page[1] = (data>>8)&0xf;
555 	sys16_bg_page[2] = (data>>4)&0xf;
556 	sys16_bg_page[3] = data&0xf;
557 }
558 
set_fg_page1(int data)559 static void set_fg_page1( int data ){
560 	sys16_fg_page[1] = data>>12;
561 	sys16_fg_page[0] = (data>>8)&0xf;
562 	sys16_fg_page[3] = (data>>4)&0xf;
563 	sys16_fg_page[2] = data&0xf;
564 }
565 
set_bg_page1(int data)566 static void set_bg_page1( int data ){
567 	sys16_bg_page[1] = data>>12;
568 	sys16_bg_page[0] = (data>>8)&0xf;
569 	sys16_bg_page[3] = (data>>4)&0xf;
570 	sys16_bg_page[2] = data&0xf;
571 }
572 
573 #if 0
574 static void set_fg2_page( int data ){
575 	sys16_fg2_page[0] = data>>12;
576 	sys16_fg2_page[1] = (data>>8)&0xf;
577 	sys16_fg2_page[2] = (data>>4)&0xf;
578 	sys16_fg2_page[3] = data&0xf;
579 }
580 
581 static void set_bg2_page( int data ){
582 	sys16_bg2_page[0] = data>>12;
583 	sys16_bg2_page[1] = (data>>8)&0xf;
584 	sys16_bg2_page[2] = (data>>4)&0xf;
585 	sys16_bg2_page[3] = data&0xf;
586 }
587 #endif
588 
589 /***************************************************************************/
590 // sys16A
591 ROM_START( alexkidd )
592 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
CRC(bdf49eca)593 	ROM_LOAD16_BYTE( "epr10429.42", 0x000000, 0x10000, CRC(bdf49eca) SHA1(899bc2d346544e4a33de51b60e02ebf7ee82cea8) )
594 	ROM_LOAD16_BYTE( "epr10427.26", 0x000001, 0x10000, CRC(f6e3dd29) SHA1(bb94ebc062bb7c6c13b68579053b9cbe8b92417c) )
595 	ROM_LOAD16_BYTE( "epr10430.43", 0x020000, 0x10000, CRC(89e3439f) SHA1(7c751bb477584842d93fda6686b03e289140bd62) )
596 	ROM_LOAD16_BYTE( "epr10428.25", 0x020001, 0x10000, CRC(dbed3210) SHA1(1e2d22935a633641ff88967d67ec673ee25cbf55) )
597 
598 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
599 	ROM_LOAD( "10431.95", 0x00000, 0x08000, CRC(a7962c39) SHA1(c816fc5d9f21b2ba32b9841e64b634bce7ea78c8) )
600 	ROM_LOAD( "10432.94", 0x08000, 0x08000, CRC(db8cd24e) SHA1(656d98844ad9ccaa68e3f501137dddd0a27d999d) )
601 	ROM_LOAD( "10433.93", 0x10000, 0x08000, CRC(e163c8c2) SHA1(ac54c5ecedca5b1a2c550de32687ca57c4d3a411) )
602 
603 	ROM_REGION( 0x040000, REGION_GFX2, 0 ) /* sprites */
604 	ROM_LOAD16_BYTE( "10437.10", 0x000001, 0x8000, CRC(522f7618) SHA1(9a6bc857dfef1dd1b7bffa034523c1c4cd8b3f4c) )
605 	ROM_LOAD16_BYTE( "10441.11", 0x000000, 0x8000, CRC(74e3a35c) SHA1(26b980a0a3aee94ac38e0e0c7d305bb35a60d1c4) )
606 	ROM_LOAD16_BYTE( "10438.17", 0x010001, 0x8000, CRC(738a6362) SHA1(a3c5f10c263cb216d275875f6333484a1cca281b) )
607 	ROM_LOAD16_BYTE( "10442.18", 0x010000, 0x8000, CRC(86cb9c14) SHA1(42bd0ed985de61ff183eed0192257966caa01594) )
608 	ROM_LOAD16_BYTE( "10439.23", 0x020001, 0x8000, CRC(b391aca7) SHA1(ca9d80b67e5365f709f90a5342b5e3aa7c7126e1) )
609 	ROM_LOAD16_BYTE( "10443.24", 0x020000, 0x8000, CRC(95d32635) SHA1(788af2af1ae783128bcdc8cd44d17cd2f1542231) )
610 	ROM_LOAD16_BYTE( "10440.29", 0x030001, 0x8000, CRC(23939508) SHA1(68450a18fc7e35f5b0155632aa68cffd251be38c) )
611 	ROM_LOAD16_BYTE( "10444.30", 0x030000, 0x8000, CRC(82115823) SHA1(e4103003cda949bebe57815115a5028f4fe8e7d7) )
612 
613 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
614 	ROM_LOAD( "10434.12", 0x0000, 0x8000, CRC(77141cce) SHA1(6c5e83527f7e11a5ff5cc4fa75d55618a55e1a58) )
615 
616 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
617 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
618 
619 	ROM_REGION( 0x10000, REGION_SOUND1, 0 ) /* 7751 sound data (not used yet) */
620 	ROM_LOAD( "10435.1", 0x0000, 0x8000, CRC(ad89f6e3) SHA1(812a132142065b0fe13b5f0ac534b6d8830ba102) )
621 	ROM_LOAD( "10436.2", 0x8000, 0x8000, CRC(96c76613) SHA1(fe3e4e649fd2cb2453eec0c92015bd54b3b9a1b5) )
622 ROM_END
623 
624 ROM_START( alexkida )
625 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
626 	ROM_LOAD16_BYTE( "10447.43", 0x000000, 0x10000, CRC(29e87f71) SHA1(af980e55c02b3de1121c144fee23af74d24042ac) )
627 	ROM_LOAD16_BYTE( "10445.26", 0x000001, 0x10000, CRC(25ce5b6f) SHA1(dfec64df7e8d145d30740808bc94bdbbe667c4e8) )
628 	ROM_LOAD16_BYTE( "10448.42", 0x020000, 0x10000, CRC(05baedb5) SHA1(fc15989bf3d850170e4e018d74f18553f0268576) )
629 	ROM_LOAD16_BYTE( "10446.25", 0x020001, 0x10000, CRC(cd61d23c) SHA1(c235c4fef28556e9f2d07e815ad213c308e85598) )
630 
631 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
632 	ROM_LOAD( "10431.95", 0x00000, 0x08000, CRC(a7962c39) SHA1(c816fc5d9f21b2ba32b9841e64b634bce7ea78c8) )
633 	ROM_LOAD( "10432.94", 0x08000, 0x08000, CRC(db8cd24e) SHA1(656d98844ad9ccaa68e3f501137dddd0a27d999d) )
634 	ROM_LOAD( "10433.93", 0x10000, 0x08000, CRC(e163c8c2) SHA1(ac54c5ecedca5b1a2c550de32687ca57c4d3a411) )
635 
636 	ROM_REGION( 0x040000, REGION_GFX2, 0 ) /* sprites */
637 	ROM_LOAD16_BYTE( "10437.10", 0x000001, 0x8000, CRC(522f7618) SHA1(9a6bc857dfef1dd1b7bffa034523c1c4cd8b3f4c) )
638 	ROM_LOAD16_BYTE( "10441.11", 0x000000, 0x8000, CRC(74e3a35c) SHA1(26b980a0a3aee94ac38e0e0c7d305bb35a60d1c4) )
639 	ROM_LOAD16_BYTE( "10438.17", 0x010001, 0x8000, CRC(738a6362) SHA1(a3c5f10c263cb216d275875f6333484a1cca281b) )
640 	ROM_LOAD16_BYTE( "10442.18", 0x010000, 0x8000, CRC(86cb9c14) SHA1(42bd0ed985de61ff183eed0192257966caa01594) )
641 	ROM_LOAD16_BYTE( "10439.23", 0x020001, 0x8000, CRC(b391aca7) SHA1(ca9d80b67e5365f709f90a5342b5e3aa7c7126e1) )
642 	ROM_LOAD16_BYTE( "10443.24", 0x020000, 0x8000, CRC(95d32635) SHA1(788af2af1ae783128bcdc8cd44d17cd2f1542231) )
643 	ROM_LOAD16_BYTE( "10440.29", 0x030001, 0x8000, CRC(23939508) SHA1(68450a18fc7e35f5b0155632aa68cffd251be38c) )
644 	ROM_LOAD16_BYTE( "10444.30", 0x030000, 0x8000, CRC(82115823) SHA1(e4103003cda949bebe57815115a5028f4fe8e7d7) )
645 
646 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
647 	ROM_LOAD( "10434.12", 0x0000, 0x8000, CRC(77141cce) SHA1(6c5e83527f7e11a5ff5cc4fa75d55618a55e1a58) )
648 
649 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
650 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
651 
652 	ROM_REGION( 0x10000, REGION_SOUND1, 0 ) /* 7751 sound data */
653 	ROM_LOAD( "10435.1", 0x0000, 0x8000, CRC(ad89f6e3) SHA1(812a132142065b0fe13b5f0ac534b6d8830ba102) )
654 	ROM_LOAD( "10436.2", 0x8000, 0x8000, CRC(96c76613) SHA1(fe3e4e649fd2cb2453eec0c92015bd54b3b9a1b5) )
655 ROM_END
656 
657 /***************************************************************************/
658 
659 static READ16_HANDLER( alexkidd_skip_r ){
660 	if (activecpu_get_pc()==0x242c) {cpu_spinuntil_int(); return 0xffff;}
661 	return sys16_workingram[0x3108/2];
662 }
663 
MEMORY_READ16_START(alexkidd_readmem)664 static MEMORY_READ16_START( alexkidd_readmem )
665     { 0x000000, 0x03ffff, MRA16_ROM },
666 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
667 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
668 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
669 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
670 	{ 0xc40002, 0xc40005, MRA16_NOP },		//??
671 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
672 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
673 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
674 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
675 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
676 	{ 0xc60000, 0xc60001, MRA16_NOP },
677 	{ 0xfff108, 0xfff109, alexkidd_skip_r },
678 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
679 MEMORY_END
680 
681 static MEMORY_WRITE16_START( alexkidd_writemem )
682     { 0x000000, 0x03ffff, MWA16_ROM },
683 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
684 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
685 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
686 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
687 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
688 	{ 0xc40002, 0xc40005, MWA16_NOP },		//??
689 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
690 MEMORY_END
691 
692 /***************************************************************************/
693 
694 static void alexkidd_update_proc( void ){
695 	set_bg_page1( sys16_textram[0x74e] );
696 	set_fg_page1( sys16_textram[0x74f] );
697 	sys16_fg_scrollx = sys16_textram[0x7fc] & 0x01ff;
698 	sys16_bg_scrollx = sys16_textram[0x7fd] & 0x01ff;
699 	sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
700 	sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
701 }
702 
MACHINE_INIT(alexkidd)703 static MACHINE_INIT( alexkidd ){
704 	sys16_textmode=1;
705 	sys16_spritesystem = sys16_sprite_quartet2;
706 	sys16_sprxoffset = -0xbc;
707 	sys16_fgxoffset = sys16_bgxoffset = 7;
708 	sys16_bg_priority_mode=1;
709 
710 	sys16_update_proc = alexkidd_update_proc;
711 }
712 
DRIVER_INIT(alexkidd)713 static DRIVER_INIT( alexkidd )
714 {
715 	machine_init_sys16_onetime();
716 }
717 /***************************************************************************/
718 
INPUT_PORTS_START(alexkidd)719 INPUT_PORTS_START( alexkidd )
720 	SYS16_JOY1_SWAPPEDBUTTONS
721 	SYS16_JOY2_SWAPPEDBUTTONS
722 	SYS16_SERVICE
723 	SYS16_COINAGE
724 
725 PORT_START	/* DSW1 */
726 	PORT_DIPNAME( 0x01, 0x00, "Continues" )
727 	PORT_DIPSETTING(    0x01, "Only before level 5" )
728 	PORT_DIPSETTING(    0x00, "Unlimited" )
729 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
730 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
731 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
732 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
733 	PORT_DIPSETTING(    0x0c, "3" )
734 	PORT_DIPSETTING(    0x08, "4" )
735 	PORT_DIPSETTING(    0x04, "5" )
736 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "240", IP_KEY_NONE, IP_JOY_NONE )
737 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
738 	PORT_DIPSETTING(    0x20, "10000" )
739 	PORT_DIPSETTING(    0x30, "20000" )
740 	PORT_DIPSETTING(    0x10, "40000" )
741 	PORT_DIPSETTING(    0x00, "None" )
742 	PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust" )
743 	PORT_DIPSETTING(    0x80, "70" )
744 	PORT_DIPSETTING(    0xc0, "60" )
745 	PORT_DIPSETTING(    0x40, "50" )
746 	PORT_DIPSETTING(    0x00, "40" )
747 
748 INPUT_PORTS_END
749 
750 /***************************************************************************/
751 
752 static MACHINE_DRIVER_START( alexkidd )
753 
754 	/* basic machine hardware */
755 	MDRV_IMPORT_FROM(system16_7751)
756 	MDRV_CPU_MODIFY("main")
757 	MDRV_CPU_MEMORY(alexkidd_readmem,alexkidd_writemem)
758 
759 	MDRV_MACHINE_INIT(alexkidd)
760 MACHINE_DRIVER_END
761 
762 /***************************************************************************/
763 // sys16B
764 ROM_START( aliensyn )
765 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
766 	ROM_LOAD16_BYTE( "11083.a4", 0x00000, 0x8000, CRC(cb2ad9b3) SHA1(66284b4e1071b3cb4b36960a2dba8949325f9e86) )
767 	ROM_LOAD16_BYTE( "11080.a1", 0x00001, 0x8000, CRC(fe7378d9) SHA1(acfee79e5fe9fdf95926562c02599e96e96f76b5) )
768 	ROM_LOAD16_BYTE( "11084.a5", 0x10000, 0x8000, CRC(2e1ec7b1) SHA1(666a9e402d7d02d74c0a2468853a3843b161c1a2) )
769 	ROM_LOAD16_BYTE( "11081.a2", 0x10001, 0x8000, CRC(1308ee63) SHA1(36a4c8cf3a310398e264c57c7c6f53c05dbc0108) )
770 	ROM_LOAD16_BYTE( "11085.a6", 0x20000, 0x8000, CRC(cff78f39) SHA1(78431ce6c03232150a8db15499da9371977b570b) )
771 	ROM_LOAD16_BYTE( "11082.a3", 0x20001, 0x8000, CRC(9cdc2a14) SHA1(c06693f45675e31d591703c27bb3f6ec02fc1215) )
772 
773 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
774 	ROM_LOAD( "10702.b9",  0x00000, 0x10000, CRC(393bc813) SHA1(672782c8fb2a6e454b27e073acc26130cacf3e50) )
775 	ROM_LOAD( "10703.b10", 0x10000, 0x10000, CRC(6b6dd9f5) SHA1(964409c6630caa13caf7d644d0c6fb071860b61b) )
776 	ROM_LOAD( "10704.b11", 0x20000, 0x10000, CRC(911e7ebc) SHA1(f03d3d3a09d19f7b705f9cb29f73140a3073463f) )
777 
778 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
779 	ROM_LOAD16_BYTE( "10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
780 	ROM_LOAD16_BYTE( "10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
781 	ROM_LOAD16_BYTE( "10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
782 	ROM_LOAD16_BYTE( "10714.b6", 0x20000, 0x10000, CRC(91bf42fb) SHA1(4b9d3e97768323dee01e92378adafecb26bcc094) )
783 	ROM_LOAD16_BYTE( "10711.b3", 0x40001, 0x10000, CRC(29166ef6) SHA1(99a7cfd7d811537c821412a320beadb5a9c09af3) )
784 	ROM_LOAD16_BYTE( "10715.b7", 0x40000, 0x10000, CRC(a7c57384) SHA1(46f8efa691d7bbb0a18119c0ff12cff7c0d129e1) )
785 	ROM_LOAD16_BYTE( "10712.b4", 0x60001, 0x10000, CRC(876ad019) SHA1(39973ddb5a5746e0e094c759447bff1130c72c84) )
786 	ROM_LOAD16_BYTE( "10716.b8", 0x60000, 0x10000, CRC(40ba1d48) SHA1(e2d4d2689bb9b9bdc85e7f72a6665e5fd4c583aa) )
787 
788 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
789 	ROM_LOAD( "10723.a7", 0x00000, 0x8000, CRC(99953526) SHA1(4a980370923fd5d3dc9e25d42a032c9e78c7ff47) )
790 	ROM_LOAD( "10724.a8", 0x10000, 0x8000, CRC(f971a817) SHA1(502c95638e4fd5f87e5fc837cb44b39a5d62f4e4) )
791 	ROM_LOAD( "10726.a10",0x18000, 0x8000, CRC(d50b7736) SHA1(b1f8e3b0cf2ffee5382098100cfabe21b383cd51) ) //*
792 	ROM_LOAD( "10725.a9", 0x20000, 0x8000, CRC(6a50e08f) SHA1(d34b2ccadb8b07d5ad99cab5c5b5b79642c65574) )
793 ROM_END
794 
795 // sys16A - use a different sound chip?
796 ROM_START( aliensya )
797 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code. I guessing the order a bit here */
798 	ROM_LOAD16_BYTE( "10808", 0x00000, 0x8000, CRC(e669929f) SHA1(b5ab41d6f31f0369f8c5f5eb6fc08e8c23312b96) )
799 	ROM_LOAD16_BYTE( "10806", 0x00001, 0x8000, CRC(9f7f8fdd) SHA1(819e9c491b7d23deaef646d37319c38e75827d68) )
800 	ROM_LOAD16_BYTE( "10809", 0x10000, 0x8000, CRC(9a424919) SHA1(a7be5d9bed329099df10ff5a0104cb832485bd0a) )
801 	ROM_LOAD16_BYTE( "10807", 0x10001, 0x8000, CRC(3d2c3530) SHA1(567ed45c84b1d3d92371c4ad33fdb28f68cf29a3) )
802 	ROM_LOAD16_BYTE( "10701", 0x20000, 0x8000, CRC(92171751) SHA1(69a282c01db7224f32386a6db25309e09e29a112) )
803 	ROM_LOAD16_BYTE( "10698", 0x20001, 0x8000, CRC(c1e4fdc0) SHA1(65817a9336f7887d2bf14485bdff8352c960d2ab) )
804 
805 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
806 	ROM_LOAD( "10739", 0x00000, 0x10000, CRC(a29ec207) SHA1(c469d2689a7bdc2a59dfff56ce13d34e9fbac263) )
807 	ROM_LOAD( "10740", 0x10000, 0x10000, CRC(47f93015) SHA1(68247a6bffd1d4d1c450148dd46214d01ce1c668) )
808 	ROM_LOAD( "10741", 0x20000, 0x10000, CRC(4970739c) SHA1(5bdf4222209ec46e0015bfc0f90578dd9b30bdd1) )
809 
810 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
811 	ROM_LOAD16_BYTE( "10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
812 	ROM_LOAD16_BYTE( "10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
813 	ROM_LOAD16_BYTE( "10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
814 	ROM_LOAD16_BYTE( "10714.b6", 0x20000, 0x10000, CRC(91bf42fb) SHA1(4b9d3e97768323dee01e92378adafecb26bcc094) )
815 	ROM_LOAD16_BYTE( "10711.b3", 0x40001, 0x10000, CRC(29166ef6) SHA1(99a7cfd7d811537c821412a320beadb5a9c09af3) )
816 	ROM_LOAD16_BYTE( "10715.b7", 0x40000, 0x10000, CRC(a7c57384) SHA1(46f8efa691d7bbb0a18119c0ff12cff7c0d129e1) )
817 	ROM_LOAD16_BYTE( "10712.b4", 0x60001, 0x10000, CRC(876ad019) SHA1(39973ddb5a5746e0e094c759447bff1130c72c84) )
818 	ROM_LOAD16_BYTE( "10716.b8", 0x60000, 0x10000, CRC(40ba1d48) SHA1(e2d4d2689bb9b9bdc85e7f72a6665e5fd4c583aa) )
819 
820 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
821 	ROM_LOAD( "10705", 0x00000, 0x8000, CRC(777b749e) SHA1(086b03100064a98228f95db7962b2671121c46ea) )
822 	ROM_LOAD( "10706", 0x10000, 0x8000, CRC(aa114acc) SHA1(81a2b3586ae90bc7fc55b82478ffe182ac49983e) )
823 	ROM_LOAD( "10707", 0x18000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
824 	ROM_LOAD( "10708", 0x20000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
825 ROM_END
826 
827 ROM_START( aliensyj )
828 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* Custom 68000 code . I guessing the order a bit here */
829 // custom cpu 317-0033
830 	ROM_LOAD16_BYTE( "epr10699.43", 0x00000, 0x8000, CRC(3fd38d17) SHA1(538c1246121051a1af9ba2a4259eb1fe7e4952e1) )
831 	ROM_LOAD16_BYTE( "epr10696.26", 0x00001, 0x8000, CRC(d734f19f) SHA1(4a08c35084f7a9364ba0f058b9a9ffc30c8b5a78) )
832 	ROM_LOAD16_BYTE( "epr10700.42", 0x10000, 0x8000, CRC(3b04b252) SHA1(0e40e89e8feb7c98ee1da1c3fb3fe1d317c66842) )
833 	ROM_LOAD16_BYTE( "epr10697.25", 0x10001, 0x8000, CRC(f2bc123d) SHA1(7848529342495289e2d4f865767f3649cd85993b) )
834 	ROM_LOAD16_BYTE( "10701", 0x20000, 0x8000, CRC(92171751) SHA1(69a282c01db7224f32386a6db25309e09e29a112) )
835 	ROM_LOAD16_BYTE( "10698", 0x20001, 0x8000, CRC(c1e4fdc0) SHA1(65817a9336f7887d2bf14485bdff8352c960d2ab) )
836 
837 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
838 	ROM_LOAD( "10739", 0x00000, 0x10000, CRC(a29ec207) SHA1(c469d2689a7bdc2a59dfff56ce13d34e9fbac263) )
839 	ROM_LOAD( "10740", 0x10000, 0x10000, CRC(47f93015) SHA1(68247a6bffd1d4d1c450148dd46214d01ce1c668) )
840 	ROM_LOAD( "10741", 0x20000, 0x10000, CRC(4970739c) SHA1(5bdf4222209ec46e0015bfc0f90578dd9b30bdd1) )
841 
842 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
843 	ROM_LOAD16_BYTE( "10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
844 	ROM_LOAD16_BYTE( "10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
845 	ROM_LOAD16_BYTE( "10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
846 	ROM_LOAD16_BYTE( "10714.b6", 0x20000, 0x10000, CRC(91bf42fb) SHA1(4b9d3e97768323dee01e92378adafecb26bcc094) )
847 	ROM_LOAD16_BYTE( "10711.b3", 0x40001, 0x10000, CRC(29166ef6) SHA1(99a7cfd7d811537c821412a320beadb5a9c09af3) )
848 	ROM_LOAD16_BYTE( "10715.b7", 0x40000, 0x10000, CRC(a7c57384) SHA1(46f8efa691d7bbb0a18119c0ff12cff7c0d129e1) )
849 	ROM_LOAD16_BYTE( "10712.b4", 0x60001, 0x10000, CRC(876ad019) SHA1(39973ddb5a5746e0e094c759447bff1130c72c84) )
850 	ROM_LOAD16_BYTE( "10716.b8", 0x60000, 0x10000, CRC(40ba1d48) SHA1(e2d4d2689bb9b9bdc85e7f72a6665e5fd4c583aa) )
851 
852 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
853 	ROM_LOAD( "10705", 0x00000, 0x8000, CRC(777b749e) SHA1(086b03100064a98228f95db7962b2671121c46ea) )
854 	ROM_LOAD( "10706", 0x10000, 0x8000, CRC(aa114acc) SHA1(81a2b3586ae90bc7fc55b82478ffe182ac49983e) )
855 	ROM_LOAD( "10707", 0x18000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
856 	ROM_LOAD( "10708", 0x20000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
857 ROM_END
858 
859 
860 ROM_START( aliensyb )
861 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
862 	ROM_LOAD16_BYTE( "as_typeb.a4", 0x00000, 0x8000, CRC(17bf5304) SHA1(f6318c6c4a606d21ba43354229b60a51d8a3baa6) )
863 	ROM_LOAD16_BYTE( "as_typeb.a1", 0x00001, 0x8000, CRC(4cd134df) SHA1(541377bd6eba280d7f0367694032891989762485) )
864 	ROM_LOAD16_BYTE( "as_typeb.a5", 0x10000, 0x8000, CRC(c8b791b0) SHA1(7a83a6781ed5b43583d86d4ee5fb3120a650874b) )
865 	ROM_LOAD16_BYTE( "as_typeb.a2", 0x10001, 0x8000, CRC(bdcf4a30) SHA1(e11264999f15cef7c35b6569407bb3dd8e2dd236) )
866 	ROM_LOAD16_BYTE( "as_typeb.a6", 0x20000, 0x8000, CRC(1d0790aa) SHA1(c141b12aa7e4f86b96eabeb3f827ee26ddacde34) )
867 	ROM_LOAD16_BYTE( "as_typeb.a3", 0x20001, 0x8000, CRC(1e7586b7) SHA1(be4c2c03119aee1b8f26f3dd79c99ce431a43b28) )
868 
869 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
870 	ROM_LOAD( "10702.b9",  0x00000, 0x10000, CRC(393bc813) SHA1(672782c8fb2a6e454b27e073acc26130cacf3e50) )
871 	ROM_LOAD( "10703.b10", 0x10000, 0x10000, CRC(6b6dd9f5) SHA1(964409c6630caa13caf7d644d0c6fb071860b61b) )
872 	ROM_LOAD( "10704.b11", 0x20000, 0x10000, CRC(911e7ebc) SHA1(f03d3d3a09d19f7b705f9cb29f73140a3073463f) )
873 
874 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
875 	ROM_LOAD16_BYTE( "10709.b1", 0x00001, 0x10000, CRC(addf0a90) SHA1(a92c9531f1817763773471ce63f566b9e88360a0) )
876 	ROM_LOAD16_BYTE( "10713.b5", 0x00000, 0x10000, CRC(ececde3a) SHA1(9c12d4665179bf433c42f5ddc8a043ad592aa90e) )
877 	ROM_LOAD16_BYTE( "10710.b2", 0x20001, 0x10000, CRC(992369eb) SHA1(c6796acf6807e9ba4c3d241903653f91adf4764e) )
878 	ROM_LOAD16_BYTE( "10714.b6", 0x20000, 0x10000, CRC(91bf42fb) SHA1(4b9d3e97768323dee01e92378adafecb26bcc094) )
879 	ROM_LOAD16_BYTE( "10711.b3", 0x40001, 0x10000, CRC(29166ef6) SHA1(99a7cfd7d811537c821412a320beadb5a9c09af3) )
880 	ROM_LOAD16_BYTE( "10715.b7", 0x40000, 0x10000, CRC(a7c57384) SHA1(46f8efa691d7bbb0a18119c0ff12cff7c0d129e1) )
881 	ROM_LOAD16_BYTE( "10712.b4", 0x60001, 0x10000, CRC(876ad019) SHA1(39973ddb5a5746e0e094c759447bff1130c72c84) )
882 	ROM_LOAD16_BYTE( "10716.b8", 0x60000, 0x10000, CRC(40ba1d48) SHA1(e2d4d2689bb9b9bdc85e7f72a6665e5fd4c583aa) )
883 
884 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
885 	ROM_LOAD( "10723.a7", 0x0000, 0x8000, CRC(99953526) SHA1(4a980370923fd5d3dc9e25d42a032c9e78c7ff47) )
886 	ROM_LOAD( "10724.a8", 0x10000, 0x8000, CRC(f971a817) SHA1(502c95638e4fd5f87e5fc837cb44b39a5d62f4e4) )
887 	ROM_LOAD( "10725.a9", 0x18000, 0x8000, CRC(6a50e08f) SHA1(d34b2ccadb8b07d5ad99cab5c5b5b79642c65574) )
888 	ROM_LOAD( "10726.a10",0x20000, 0x8000, CRC(d50b7736) SHA1(b1f8e3b0cf2ffee5382098100cfabe21b383cd51) )
889 ROM_END
890 
891 /***************************************************************************/
892 
893 static MEMORY_READ16_START( aliensyn_readmem )
894     { 0x000000, 0x02ffff, MRA16_ROM },
895 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
896 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
897 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
898 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
899 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
900 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
901 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
902 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
903 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
904 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
905 MEMORY_END
906 
907 static MEMORY_WRITE16_START( aliensyn_writemem )
908     { 0x000000, 0x02ffff, MWA16_ROM },
909 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
910 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
911 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
912 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
913 	{ 0xc00006, 0xc00007, sound_command_w },
914 	{ 0xc00020, 0xc0003f, MWA16_NOP }, // config regs
915 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
916 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
917 MEMORY_END
918 
919 /***************************************************************************/
920 
921 static void aliensyn_update_proc( void ){
922 	set_fg_page( sys16_textram[0x740] );
923 	set_bg_page( sys16_textram[0x741] );
924 	sys16_fg_scrolly = sys16_textram[0x748];
925 	sys16_bg_scrolly = sys16_textram[0x749];
926 	sys16_fg_scrollx = sys16_textram[0x74c];
927 	sys16_bg_scrollx = sys16_textram[0x74d];
928 }
929 
MACHINE_INIT(aliensyn)930 static MACHINE_INIT( aliensyn ){
931 	static int bank[16] = {
932 		0,0,0,0,
933 		0,0,0,3,
934 		0,0,0,2,
935 		0,1,0,0
936 	};
937 	sys16_obj_bank = bank;
938 
939 	sys16_bg_priority_mode=1;
940 	sys16_fg_priority_mode=1;
941 
942 	sys16_update_proc = aliensyn_update_proc;
943 
944 	sys16_alienfix = 1; //*
945 }
946 
DRIVER_INIT(aliensyn)947 static DRIVER_INIT( aliensyn )
948 {
949 	machine_init_sys16_onetime();
950 	sys16_bg1_trans=1;
951 }
952 
953 /***************************************************************************/
954 
INPUT_PORTS_START(aliensyn)955 INPUT_PORTS_START( aliensyn )
956 	SYS16_JOY1
957 	SYS16_JOY2
958 	SYS16_SERVICE
959 	SYS16_COINAGE
960 
961 PORT_START	/* DSW1 */
962 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
963 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
964 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
965 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
966 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
967 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
968 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
969 	PORT_DIPSETTING(    0x08, "2" )
970 	PORT_DIPSETTING(    0x0c, "3" )
971 	PORT_DIPSETTING(    0x04, "4" )
972 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "127", IP_KEY_NONE, IP_JOY_NONE )
973 	PORT_DIPNAME( 0x30, 0x30, "Timer" )
974 	PORT_DIPSETTING(    0x00, "120" )
975 	PORT_DIPSETTING(    0x10, "130" )
976 	PORT_DIPSETTING(    0x20, "140" )
977 	PORT_DIPSETTING(    0x30, "150" )
978 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
979 	PORT_DIPSETTING(    0x80, "Easy" )
980 	PORT_DIPSETTING(    0xc0, "Normal" )
981 	PORT_DIPSETTING(    0x40, "Hard" )
982 	PORT_DIPSETTING(    0x00, "Hardest" )
983 INPUT_PORTS_END
984 
985 /****************************************************************************/
986 
987 static MACHINE_DRIVER_START( aliensyn )
988 
989 	/* basic machine hardware */
990 	MDRV_IMPORT_FROM(system16_7759)
991 	MDRV_CPU_MODIFY("main")
992 	MDRV_CPU_MEMORY(aliensyn_readmem,aliensyn_writemem)
993 
994 	MDRV_MACHINE_INIT(aliensyn)
995 MACHINE_DRIVER_END
996 
997 /***************************************************************************/
998 // sys16B
999 ROM_START( altbeast )
1000 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
1001 	ROM_LOAD16_BYTE( "11705", 0x000000, 0x20000, CRC(57dc5c7a) SHA1(a5cc9b10a00778f5163fc915b956fa5d0d7a37ce) )
1002 	ROM_LOAD16_BYTE( "11704", 0x000001, 0x20000, CRC(33bbcf07) SHA1(534e5426580dbf72509dceb762b8b99766d3a739) )
1003 
1004 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1005 	ROM_LOAD( "11674", 0x00000, 0x20000, CRC(a57a66d5) SHA1(5103583d48997abad12a0c5fee26431c486ced52) )
1006 	ROM_LOAD( "11675", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
1007 	ROM_LOAD( "11676", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
1008 
1009 	ROM_REGION( 0x100000, REGION_GFX2, 0 ) /* sprites */
1010 	ROM_LOAD16_BYTE( "epr11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
1011 	ROM_LOAD16_BYTE( "epr11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
1012 	ROM_LOAD16_BYTE( "epr11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
1013 	ROM_LOAD16_BYTE( "epr11682.b6", 0x40000, 0x20000, CRC(e3f77c5e) SHA1(6b3cb7918ab0c7c97a51cc5ea19ced3374ff3914) )
1014 	ROM_LOAD16_BYTE( "epr11679.b3", 0x80001, 0x20000, CRC(14dcc245) SHA1(1ca1b6e0f2b7bedad2a8ab70f52da8c54d40d3cf) )
1015 	ROM_LOAD16_BYTE( "epr11683.b7", 0x80000, 0x20000, CRC(f9a60f06) SHA1(0cffcfdb02733feaa869198b7e668c58b47c321a) )
1016 	ROM_LOAD16_BYTE( "epr11680.b4", 0xc0001, 0x20000, CRC(f43dcdec) SHA1(2941500cf33afca487f19f2329033d5d17aad826) )
1017 	ROM_LOAD16_BYTE( "epr11684.b8", 0xc0000, 0x20000, CRC(b20c0edb) SHA1(6c8694d05e3adac37c9015037ab800233371db36) )
1018 
1019 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1020 	ROM_LOAD( "11671",		 0x00000, 0x08000, CRC(2b71343b) SHA1(8a657f787de2b9d5161ed2c109642a148348af09) )
1021 	ROM_LOAD( "opr11672",    0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
1022 	ROM_LOAD( "opr11673",    0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
1023 ROM_END
1024 
1025 ROM_START( jyuohki )
1026 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* Custom 68000 code. */
1027 // custom cpu 317-0065
1028 	ROM_LOAD16_BYTE( "epr11670.a7", 0x000000, 0x20000, CRC(b748eb07) SHA1(f3663831610bcb358340f14c2c96833dd7591bfb) )
1029 	ROM_LOAD16_BYTE( "epr11669.a5", 0x000001, 0x20000, CRC(005ecd11) SHA1(c392195955cf727752f03db92414701cc2bf1f4a) )
1030 
1031 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1032 	ROM_LOAD( "11674", 0x00000, 0x20000, CRC(a57a66d5) SHA1(5103583d48997abad12a0c5fee26431c486ced52) )
1033 	ROM_LOAD( "11675", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
1034 	ROM_LOAD( "11676", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
1035 
1036 	ROM_REGION( 0x100000, REGION_GFX2, 0 ) /* sprites */
1037 	ROM_LOAD16_BYTE( "epr11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
1038 	ROM_LOAD16_BYTE( "epr11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
1039 	ROM_LOAD16_BYTE( "epr11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
1040 	ROM_LOAD16_BYTE( "epr11682.b6", 0x40000, 0x20000, CRC(e3f77c5e) SHA1(6b3cb7918ab0c7c97a51cc5ea19ced3374ff3914) )
1041 	ROM_LOAD16_BYTE( "epr11679.b3", 0x80001, 0x20000, CRC(14dcc245) SHA1(1ca1b6e0f2b7bedad2a8ab70f52da8c54d40d3cf) )
1042 	ROM_LOAD16_BYTE( "epr11683.b7", 0x80000, 0x20000, CRC(f9a60f06) SHA1(0cffcfdb02733feaa869198b7e668c58b47c321a) )
1043 	ROM_LOAD16_BYTE( "epr11680.b4", 0xc0001, 0x20000, CRC(f43dcdec) SHA1(2941500cf33afca487f19f2329033d5d17aad826) )
1044 	ROM_LOAD16_BYTE( "epr11684.b8", 0xc0000, 0x20000, CRC(b20c0edb) SHA1(6c8694d05e3adac37c9015037ab800233371db36) )
1045 
1046 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1047 	ROM_LOAD( "11671",		 0x00000, 0x08000, CRC(2b71343b) SHA1(8a657f787de2b9d5161ed2c109642a148348af09) )
1048 	ROM_LOAD( "opr11672",    0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
1049 	ROM_LOAD( "opr11673",    0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
1050 ROM_END
1051 
1052 // sys16B
1053 ROM_START( altbeas2 )
1054 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
1055 	ROM_LOAD16_BYTE( "epr11740", 0x000000, 0x20000, CRC(ce227542) SHA1(54adcc1246943360bb68498e971809a0d4f9fe0c) )
1056 	ROM_LOAD16_BYTE( "epr11739", 0x000001, 0x20000, CRC(e466eb65) SHA1(c9bb57818eb81a43abdf2ad2a79a0bd45c25d208) )
1057 
1058 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1059 	ROM_LOAD( "11674", 0x00000, 0x20000, CRC(a57a66d5) SHA1(5103583d48997abad12a0c5fee26431c486ced52) )
1060 	ROM_LOAD( "11675", 0x20000, 0x20000, CRC(2ef2f144) SHA1(38d22d609db2d9b6067b5d12f6499436de4605cb) )
1061 	ROM_LOAD( "11676", 0x40000, 0x20000, CRC(0c04acac) SHA1(87fe2a0dd9913f9550e9b4cbc7e7465b61640e07) )
1062 
1063 	ROM_REGION( 0x100000, REGION_GFX2, 0 ) /* sprites */
1064 	ROM_LOAD16_BYTE( "epr11677.b1", 0x00001, 0x20000, CRC(a01425cd) SHA1(72be5ec29e476601f9bf6aaedef9b73cedeb42f0) )
1065 	ROM_LOAD16_BYTE( "epr11681.b5", 0x00000, 0x20000, CRC(d9e03363) SHA1(995a7c6a8f0c61468b57a3bb407461a2a3ae8adc) )
1066 	ROM_LOAD16_BYTE( "epr11678.b2", 0x40001, 0x20000, CRC(17a9fc53) SHA1(85a9a605742ae5aab86db37189b9ee4d54c70e56) )
1067 	ROM_LOAD16_BYTE( "epr11682.b6", 0x40000, 0x20000, CRC(e3f77c5e) SHA1(6b3cb7918ab0c7c97a51cc5ea19ced3374ff3914) )
1068 	ROM_LOAD16_BYTE( "epr11679.b3", 0x80001, 0x20000, CRC(14dcc245) SHA1(1ca1b6e0f2b7bedad2a8ab70f52da8c54d40d3cf) )
1069 	ROM_LOAD16_BYTE( "epr11683.b7", 0x80000, 0x20000, CRC(f9a60f06) SHA1(0cffcfdb02733feaa869198b7e668c58b47c321a) )
1070 	ROM_LOAD16_BYTE( "epr11680.b4", 0xc0001, 0x20000, CRC(f43dcdec) SHA1(2941500cf33afca487f19f2329033d5d17aad826) )
1071 	ROM_LOAD16_BYTE( "epr11684.b8", 0xc0000, 0x20000, CRC(b20c0edb) SHA1(6c8694d05e3adac37c9015037ab800233371db36) )
1072 
1073 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1074 	ROM_LOAD( "opr11686",	 0x00000, 0x08000, CRC(828a45b3) SHA1(df921701b411afac1b6716b6798a1bffc2180133) )	// ???
1075 	ROM_LOAD( "opr11672",    0x10000, 0x20000, CRC(bbd7f460) SHA1(bbc5c2219cb3a827d84062b19affd9780da2a3cf) )
1076 	ROM_LOAD( "opr11673",    0x30000, 0x20000, CRC(400c4a36) SHA1(de4bdfa91734410e0a7f6a16bf8336db172f458a) )
1077 ROM_END
1078 
1079 /***************************************************************************/
1080 
1081 static READ16_HANDLER( altbeast_skip_r )
1082 {
1083 	if (activecpu_get_pc()==0x3994) {cpu_spinuntil_int(); return 1<<8;}
1084 	return sys16_workingram[0x301c/2];
1085 }
1086 
1087 // ??? What is this, input test shows 4 bits to each player, but what does it do?
READ16_HANDLER(altbeast_io_r)1088 static READ16_HANDLER( altbeast_io_r )
1089 {
1090 	return 0xff;
1091 }
1092 
MEMORY_READ16_START(altbeast_readmem)1093 static MEMORY_READ16_START( altbeast_readmem )
1094     { 0x000000, 0x03ffff, MRA16_ROM },
1095 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
1096 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
1097 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
1098 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
1099 	{ 0xc40000, 0xc40001, MRA16_NOP }, // write-only register, game does bclr #6, $C40001
1100 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
1101 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
1102 	{ 0xc41004, 0xc41005, altbeast_io_r },
1103 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
1104 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
1105 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
1106 	{ 0xfff01c, 0xfff01d, altbeast_skip_r },
1107 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
1108 MEMORY_END
1109 
1110 static MEMORY_WRITE16_START( altbeast_writemem )
1111     { 0x000000, 0x03ffff, MWA16_ROM },
1112 	{ 0x3f0000, 0x3fffff, sys16_tilebank_w },
1113 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
1114 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
1115 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
1116 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
1117 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
1118 	{ 0xc43000, 0xc43fff, MWA16_NOP },
1119 	{ 0xfe0006, 0xfe0007, sound_command_w },
1120 	{ 0xfe0020, 0xfe003f, MWA16_NOP }, // config regs
1121 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
1122 MEMORY_END
1123 
1124 /***************************************************************************/
1125 
1126 static void altbeast_update_proc( void ){
1127 	set_fg_page( sys16_textram[0x740] );
1128 	set_bg_page( sys16_textram[0x741] );
1129 	sys16_fg_scrolly = sys16_textram[0x748];
1130 	sys16_bg_scrolly = sys16_textram[0x749];
1131 	sys16_fg_scrollx = sys16_textram[0x74c];
1132 	sys16_bg_scrollx = sys16_textram[0x74d];
1133 }
1134 
MACHINE_INIT(altbeast)1135 static MACHINE_INIT( altbeast ){
1136 	sys16_update_proc = altbeast_update_proc;
1137 }
1138 
MACHINE_INIT(altbeas2)1139 static MACHINE_INIT( altbeas2 ){
1140 	static int bank[16] = {
1141 		0x00,0x00,
1142 		0x01,0x00,
1143 		0x02,0x00,
1144 		0x03,0x00,
1145 		0x04,0x00,
1146 		0x05,0x00,
1147 		0x06,0x00,
1148 		0x07,0x00
1149 	};
1150 	sys16_obj_bank = bank;
1151 	sys16_update_proc = altbeast_update_proc;
1152 }
1153 
DRIVER_INIT(altbeast)1154 static DRIVER_INIT( altbeast )
1155 {
1156 	machine_init_sys16_onetime();
1157 }
1158 
1159 /***************************************************************************/
1160 
INPUT_PORTS_START(altbeast)1161 INPUT_PORTS_START( altbeast )
1162 	SYS16_JOY1
1163 	SYS16_JOY2
1164 	SYS16_SERVICE
1165 	SYS16_COINAGE
1166 
1167 PORT_START	/* DSW1 */
1168 	PORT_DIPNAME( 0x01, 0x01, "Credits needed" )
1169 	PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
1170 	PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
1171 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1172 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1173 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1174 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1175 	PORT_DIPSETTING(    0x08, "2" )
1176 	PORT_DIPSETTING(    0x0c, "3" )
1177 	PORT_DIPSETTING(    0x04, "4" )
1178 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "240", IP_KEY_NONE, IP_JOY_NONE )
1179 	PORT_DIPNAME( 0x30, 0x30, "Energy Meter" )
1180 	PORT_DIPSETTING(    0x20, "2" )
1181 	PORT_DIPSETTING(    0x30, "3" )
1182 	PORT_DIPSETTING(    0x10, "4" )
1183 	PORT_DIPSETTING(    0x00, "5" )
1184 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
1185 	PORT_DIPSETTING(    0x80, "Easy" )
1186 	PORT_DIPSETTING(    0xc0, "Normal" )
1187 	PORT_DIPSETTING(    0x40, "Hard" )
1188 	PORT_DIPSETTING(    0x00, "Hardest" )
1189 INPUT_PORTS_END
1190 
1191 /***************************************************************************/
1192 
1193 static MACHINE_DRIVER_START( altbeast )
1194 
1195 	/* basic machine hardware */
1196 	MDRV_IMPORT_FROM(system16_7759)
1197 	MDRV_CPU_MODIFY("main")
1198 	MDRV_CPU_MEMORY(altbeast_readmem,altbeast_writemem)
1199 
1200 	MDRV_MACHINE_INIT(altbeast)
1201 MACHINE_DRIVER_END
1202 
1203 
1204 static MACHINE_DRIVER_START( altbeas2 )
1205 
1206 	/* basic machine hardware */
1207 	MDRV_IMPORT_FROM(system16_7759)
1208 	MDRV_CPU_MODIFY("main")
1209 	MDRV_CPU_MEMORY(altbeast_readmem,altbeast_writemem)
1210 
1211 	MDRV_MACHINE_INIT(altbeas2)
1212 MACHINE_DRIVER_END
1213 
1214 /***************************************************************************/
1215 // sys16B
1216 ROM_START( atomicp )
1217 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
1218 	ROM_LOAD16_BYTE( "ap-t2.bin", 0x000000, 0x10000, CRC(97421047) SHA1(18d61260470da7a0bef532f81df567a613c0d821) )
1219 	ROM_LOAD16_BYTE( "ap-t1.bin", 0x000001, 0x10000, CRC(5c65fe56) SHA1(aaf3b6f932c090b839817140c105f13c7d6b4ae2) )
1220 
1221 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1222 	ROM_LOAD( "ap-t4.bin",  0x00000, 0x8000, CRC(332e58f4) SHA1(cf5aeb6c14018cbd8f222a0ecf85ccf467f294a8) )
1223 	ROM_LOAD( "ap-t3.bin",  0x08000, 0x8000, CRC(dddc122c) SHA1(3411eae360ccd615636fb85e9738affc33c2c0ad) )
1224 	ROM_LOAD( "ap-t5.bin",  0x10000, 0x8000, CRC(ef5ecd6b) SHA1(07edc8ea4c0a5ad421df7f97e7a62a5e12a8dbd0) )
1225 
1226 	ROM_REGION( 0x1, REGION_GFX2, 0 ) /* sprites */
1227 ROM_END
1228 
1229 /***************************************************************************/
1230 
1231 #if 0
1232 static READ16_HANDLER( atomicp_skip_r ){
1233 	if (activecpu_get_pc()==0x7fc) {cpu_spinuntil_int(); return 0xffff;}
1234 	return sys16_workingram[0x0902/2];
1235 }
1236 //	AM_RANGE(0xffc902, 0xffc903) AM_READ(atomicp_skip_r)
1237 #endif
1238 
1239 
1240 static MEMORY_READ16_START( atomicp_readmem )
1241     { 0x000000, 0x01ffff, MRA16_ROM },
1242 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
1243 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
1244 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
1245 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
1246 	{ 0xc41000, 0xc41001, input_port_0_word_r }, // player1
1247 	{ 0xc41002, 0xc41003, input_port_1_word_r }, // player2
1248 	{ 0xc41004, 0xc41005, input_port_3_word_r }, // dip1
1249 	{ 0xc41006, 0xc41007, input_port_4_word_r }, // dip2
1250 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
1251 MEMORY_END
1252 
1253 static MEMORY_WRITE16_START( atomicp_writemem )
1254     { 0x000000, 0x01ffff, MWA16_ROM },
1255 	{ 0x080000, 0x080003, MWA16_NOP }, // looks like sound chip, but isn't YM2413 data
1256 	{ 0x3f0000, 0x3fffff, sys16_tilebank_w },
1257 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
1258 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
1259 	{ 0x440000, 0x44ffff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
1260 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
1261 	{ 0x123406, 0x123407, MWA16_NOP }, // ?
1262 	{ 0xc40000, 0xc40001, MWA16_NOP },// ?
1263 	{ 0xfe0020, 0xfe003f, MWA16_NOP }, // config regs
1264 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
1265 MEMORY_END
1266 
1267 /***************************************************************************/
1268 
1269 static void atomicp_update_proc( void ){
1270 	set_fg_page( sys16_textram[0x740] );
1271 	set_bg_page( sys16_textram[0x741] );
1272 	sys16_fg_scrolly = sys16_textram[0x748];
1273 	sys16_bg_scrolly = sys16_textram[0x749];
1274 	sys16_fg_scrollx = sys16_textram[0x74c];
1275 	sys16_bg_scrollx = sys16_textram[0x74d];
1276 }
1277 
MACHINE_INIT(atomicp)1278 static MACHINE_INIT( atomicp ){
1279 	sys16_update_proc = atomicp_update_proc;
1280 }
1281 
DRIVER_INIT(atomicp)1282 static DRIVER_INIT( atomicp )
1283 {
1284 	machine_init_sys16_onetime();
1285 }
1286 
1287 /***************************************************************************/
1288 
INPUT_PORTS_START(atomicp)1289 INPUT_PORTS_START( atomicp )
1290 
1291 PORT_START
1292 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
1293 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
1294 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
1295 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
1296 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1297 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1298 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
1299 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
1300 
1301 PORT_START
1302 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
1303 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
1304 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
1305 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
1306 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
1307 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
1308 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1309 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1310 
1311 PORT_START	// dummy
1312 
1313 PORT_START	// dip1
1314 	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) )
1315 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1316 	PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
1317 	PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
1318 	PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
1319 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
1320 	PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
1321 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_4C ) )
1322 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_5C ) )
1323 
1324 	PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_A ) )
1325 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
1326 	PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1327 	PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
1328 	PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
1329 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
1330 	PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
1331 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
1332 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_5C ) )
1333 
1334 	PORT_DIPNAME( 0xC0, 0xC0, DEF_STR( Lives ) )
1335 	PORT_DIPSETTING(    0xC0, "1" )
1336 	PORT_DIPSETTING(    0x80, "2" )
1337 	PORT_DIPSETTING(    0x40, "3" )
1338 	PORT_DIPSETTING(    0x00, "5" )
1339 
1340 PORT_START  //dip2
1341 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1342 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1343 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1344 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1345 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1346 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1347 	PORT_DIPNAME( 0x04, 0x04, "Instructions" )
1348 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1349 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1350 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1351 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1352 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1353 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1354 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1355 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1356 	PORT_DIPNAME( 0x20, 0x20, "Continuation" )
1357 	PORT_DIPSETTING(    0x20, "Continue" )
1358 	PORT_DIPSETTING(    0x00, "No Continue" )
1359 	PORT_DIPNAME( 0x40, 0x00, "Level Select" )
1360 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1361 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1362 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
1363 INPUT_PORTS_END
1364 
1365 /***************************************************************************/
1366 static INTERRUPT_GEN( ap_interrupt )
1367 {
1368 	int intleft=cpu_getiloops();
1369 	if(intleft!=0) cpu_set_irq_line(0, 2, HOLD_LINE);
1370 	else cpu_set_irq_line(0, 4, HOLD_LINE);
1371 }
1372 
1373 
1374 static MACHINE_DRIVER_START( atomicp )
1375 
1376 	/* basic machine hardware */
MDRV_IMPORT_FROM(system16)1377 	MDRV_IMPORT_FROM(system16)
1378 	MDRV_CPU_MODIFY("main")
1379     MDRV_CPU_MEMORY(atomicp_readmem,atomicp_writemem)
1380 	MDRV_CPU_VBLANK_INT(ap_interrupt,2)
1381 
1382 	MDRV_CPU_REMOVE("sound")
1383 
1384 	MDRV_MACHINE_INIT(atomicp)
1385 
1386 	/* sound hardware */
1387 	MDRV_SOUND_ATTRIBUTES(0)
1388 	MDRV_SOUND_REPLACE("2151", YM2413, sys16_ym2413_interface)
1389 MACHINE_DRIVER_END
1390 
1391 
1392 /***************************************************************************
1393 
1394    Aurail
1395 
1396 ***************************************************************************/
1397 // sys16B
1398 ROM_START( aurail )
1399 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1400 	ROM_LOAD16_BYTE( "13577", 0x000000, 0x20000, CRC(6701b686) SHA1(ce1e99a516b34241bfe2fbe42d105970ad6e6ddb) )
1401 	ROM_LOAD16_BYTE( "13576", 0x000001, 0x20000, CRC(1e428d94) SHA1(53c0c2d946822157974c8505fd301f8001fc3401) )
1402 	/* empty 0x40000 - 0x80000 */
1403 	ROM_LOAD16_BYTE( "13447", 0x080000, 0x20000, CRC(70a52167) SHA1(51512d4ee1e63902375b197cf04170744b099d88) )
1404 	ROM_LOAD16_BYTE( "13445", 0x080001, 0x20000, CRC(28dfc3dd) SHA1(b1d6d3e31a48062a91cc9b7b6ff68bfde0a3ea1c) )
1405 
1406 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1407 	ROM_LOAD( "aurail.a14", 0x00000, 0x20000, CRC(0fc4a7a8) SHA1(b46b22a6b0ead19551e67abfb3304c52b02b8d29) ) /* plane 1 */
1408 	ROM_LOAD( "aurail.b14", 0x20000, 0x20000, CRC(e08135e0) SHA1(cd748f4a8f67f562174fa9c6edb966c77b488e75) )
1409 	ROM_LOAD( "aurail.a15", 0x40000, 0x20000, CRC(1c49852f) SHA1(d08d6991c203400f685fada2445a22a7eceeee04) ) /* plane 2 */
1410 	ROM_LOAD( "aurail.b15", 0x60000, 0x20000, CRC(e14c6684) SHA1(f9b0d45e01a6df2b3875b493db9fa41bf37d79f0) )
1411 	ROM_LOAD( "aurail.a16", 0x80000, 0x20000, CRC(047bde5e) SHA1(e759baedcbb637a6c14af461b8a492554cadc9e4) ) /* plane 3 */
1412 	ROM_LOAD( "aurail.b16", 0xa0000, 0x20000, CRC(6309fec4) SHA1(f90c9679bade3cfbaa7949e412410c29d5bfa4d3) )
1413 
1414 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
1415 	ROM_LOAD16_BYTE( "aurail.b1",  0x000001, 0x020000, CRC(5fa0a9f8) SHA1(d9d67cc006a608d48e37aa89359f1a9403172b00) )
1416 	ROM_LOAD16_BYTE( "aurail.b5",  0x000000, 0x020000, CRC(0d1b54da) SHA1(c7a6393f9e13adabe93b7a86aa7845c5f4d188f1) )
1417 	ROM_LOAD16_BYTE( "aurail.b2",  0x040001, 0x020000, CRC(5f6b33b1) SHA1(5d397bdaa2c7a9ce82cc9134bfeb78418dc613b0) )
1418 	ROM_LOAD16_BYTE( "aurail.b6",  0x040000, 0x020000, CRC(bad340c3) SHA1(e04ef028e44054d34831d3617c5a6348823cfebd) )
1419 	ROM_LOAD16_BYTE( "aurail.b3",  0x080001, 0x020000, CRC(4e80520b) SHA1(8147793ee0023ac18f633d756ecc53aef1980e95) )
1420 	ROM_LOAD16_BYTE( "aurail.b7",  0x080000, 0x020000, CRC(7e9165ac) SHA1(32114095f96fb0ae385c9bf31dd97a99ef182aaa) )
1421 	ROM_LOAD16_BYTE( "aurail.b4",  0x0c0001, 0x020000, CRC(5733c428) SHA1(865203ebee9d98e67324c46915d8835d0289ee0c) )
1422 	ROM_LOAD16_BYTE( "aurail.b8",  0x0c0000, 0x020000, CRC(66b8f9b3) SHA1(4bf003a9bed40673d88df51a314eb6bd10f0d039) )
1423 	ROM_LOAD16_BYTE( "aurail.a1",  0x100001, 0x020000, CRC(4f370b2b) SHA1(66beb4264d569520d80f8915e1c1fddbf61efb21) )
1424 	ROM_LOAD16_BYTE( "aurail.b10", 0x100000, 0x020000, CRC(f76014bf) SHA1(b44f0b6fb9dee927d81c62282aa946d8c35766ca) )
1425 	ROM_LOAD16_BYTE( "aurail.a2",  0x140001, 0x020000, CRC(37cf9cb4) SHA1(f51cee874ad8a824462d2475a23e7016ef64c6b4) )
1426 	ROM_LOAD16_BYTE( "aurail.b11", 0x140000, 0x020000, CRC(1061e7da) SHA1(bad3560f1ed6a5a79f4ecf85d3843b24ecf22d19) )
1427 	ROM_LOAD16_BYTE( "aurail.a3",  0x180001, 0x020000, CRC(049698ef) SHA1(dca1a78f0156cfac9acbfb6e47eb3897b579d2ec) )
1428 	ROM_LOAD16_BYTE( "aurail.b12", 0x180000, 0x020000, CRC(7dbcfbf1) SHA1(0b7be1de57f83b1213805489c6ebfc0f1e5fb4b0) )
1429 	ROM_LOAD16_BYTE( "aurail.a4",  0x1c0001, 0x020000, CRC(77a8989e) SHA1(0ad0877a9814fb7c2fb79062a50b1f9ce9420768) )
1430 	ROM_LOAD16_BYTE( "aurail.b13", 0x1c0000, 0x020000, CRC(551df422) SHA1(cf4cd2b66335853c7c6cce949e79c05e93a39666) )
1431 
1432 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1433 	ROM_LOAD( "13448",      0x0000, 0x8000, CRC(b5183fb9) SHA1(c8372b57fa486256d49dc5851d6b17c92de593fb) )
1434 	ROM_LOAD( "aurail.a12", 0x10000,0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
1435 	ROM_RELOAD(             0x30000,0x20000 )
1436 ROM_END
1437 
1438 ROM_START( auraila )
1439 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1440 // custom cpu 317-0168
1441 	ROM_LOAD16_BYTE( "epr13469.a7", 0x000000, 0x20000, CRC(c628b69d) SHA1(839cefe5ab1c58fb3e6af8cba245194d5d672223) )
1442 	ROM_LOAD16_BYTE( "epr13468.a5", 0x000001, 0x20000, CRC(ce092218) SHA1(c93450234bc37060bc4b8bca34ea69154d99be6c) )
1443 	/* 0x40000 - 0x80000 is empty, I will place decrypted opcodes here */
1444 	ROM_LOAD16_BYTE( "13447", 0x080000, 0x20000, CRC(70a52167) SHA1(51512d4ee1e63902375b197cf04170744b099d88) )
1445 	ROM_LOAD16_BYTE( "13445", 0x080001, 0x20000, CRC(28dfc3dd) SHA1(b1d6d3e31a48062a91cc9b7b6ff68bfde0a3ea1c) )
1446 
1447 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1448 	ROM_LOAD( "aurail.a14", 0x00000, 0x20000, CRC(0fc4a7a8) SHA1(b46b22a6b0ead19551e67abfb3304c52b02b8d29) ) /* plane 1 */
1449 	ROM_LOAD( "aurail.b14", 0x20000, 0x20000, CRC(e08135e0) SHA1(cd748f4a8f67f562174fa9c6edb966c77b488e75) )
1450 	ROM_LOAD( "aurail.a15", 0x40000, 0x20000, CRC(1c49852f) SHA1(d08d6991c203400f685fada2445a22a7eceeee04) ) /* plane 2 */
1451 	ROM_LOAD( "aurail.b15", 0x60000, 0x20000, CRC(e14c6684) SHA1(f9b0d45e01a6df2b3875b493db9fa41bf37d79f0) )
1452 	ROM_LOAD( "aurail.a16", 0x80000, 0x20000, CRC(047bde5e) SHA1(e759baedcbb637a6c14af461b8a492554cadc9e4) ) /* plane 3 */
1453 	ROM_LOAD( "aurail.b16", 0xa0000, 0x20000, CRC(6309fec4) SHA1(f90c9679bade3cfbaa7949e412410c29d5bfa4d3) )
1454 
1455 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
1456 	ROM_LOAD16_BYTE( "aurail.b1",  0x000001, 0x020000, CRC(5fa0a9f8) SHA1(d9d67cc006a608d48e37aa89359f1a9403172b00) )
1457 	ROM_LOAD16_BYTE( "aurail.b5",  0x000000, 0x020000, CRC(0d1b54da) SHA1(c7a6393f9e13adabe93b7a86aa7845c5f4d188f1) )
1458 	ROM_LOAD16_BYTE( "aurail.b2",  0x040001, 0x020000, CRC(5f6b33b1) SHA1(5d397bdaa2c7a9ce82cc9134bfeb78418dc613b0) )
1459 	ROM_LOAD16_BYTE( "aurail.b6",  0x040000, 0x020000, CRC(bad340c3) SHA1(e04ef028e44054d34831d3617c5a6348823cfebd) )
1460 	ROM_LOAD16_BYTE( "aurail.b3",  0x080001, 0x020000, CRC(4e80520b) SHA1(8147793ee0023ac18f633d756ecc53aef1980e95) )
1461 	ROM_LOAD16_BYTE( "aurail.b7",  0x080000, 0x020000, CRC(7e9165ac) SHA1(32114095f96fb0ae385c9bf31dd97a99ef182aaa) )
1462 	ROM_LOAD16_BYTE( "aurail.b4",  0x0c0001, 0x020000, CRC(5733c428) SHA1(865203ebee9d98e67324c46915d8835d0289ee0c) )
1463 	ROM_LOAD16_BYTE( "aurail.b8",  0x0c0000, 0x020000, CRC(66b8f9b3) SHA1(4bf003a9bed40673d88df51a314eb6bd10f0d039) )
1464 	ROM_LOAD16_BYTE( "aurail.a1",  0x100001, 0x020000, CRC(4f370b2b) SHA1(66beb4264d569520d80f8915e1c1fddbf61efb21) )
1465 	ROM_LOAD16_BYTE( "aurail.b10", 0x100000, 0x020000, CRC(f76014bf) SHA1(b44f0b6fb9dee927d81c62282aa946d8c35766ca) )
1466 	ROM_LOAD16_BYTE( "aurail.a2",  0x140001, 0x020000, CRC(37cf9cb4) SHA1(f51cee874ad8a824462d2475a23e7016ef64c6b4) )
1467 	ROM_LOAD16_BYTE( "aurail.b11", 0x140000, 0x020000, CRC(1061e7da) SHA1(bad3560f1ed6a5a79f4ecf85d3843b24ecf22d19) )
1468 	ROM_LOAD16_BYTE( "aurail.a3",  0x180001, 0x020000, CRC(049698ef) SHA1(dca1a78f0156cfac9acbfb6e47eb3897b579d2ec) )
1469 	ROM_LOAD16_BYTE( "aurail.b12", 0x180000, 0x020000, CRC(7dbcfbf1) SHA1(0b7be1de57f83b1213805489c6ebfc0f1e5fb4b0) )
1470 	ROM_LOAD16_BYTE( "aurail.a4",  0x1c0001, 0x020000, CRC(77a8989e) SHA1(0ad0877a9814fb7c2fb79062a50b1f9ce9420768) )
1471 	ROM_LOAD16_BYTE( "aurail.b13", 0x1c0000, 0x020000, CRC(551df422) SHA1(cf4cd2b66335853c7c6cce949e79c05e93a39666) )
1472 
1473 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1474 	ROM_LOAD( "13448",      0x0000, 0x8000, CRC(b5183fb9) SHA1(c8372b57fa486256d49dc5851d6b17c92de593fb) )
1475 	ROM_LOAD( "aurail.a12", 0x10000,0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
1476 	ROM_RELOAD(             0x30000,0x20000 )
1477 ROM_END
1478 
1479 /***************************************************************************/
1480 
1481 static READ16_HANDLER( aurail_skip_r )
1482 {
1483 	if (activecpu_get_pc()==0xe4e) {cpu_spinuntil_int(); return 0;}
1484 	return sys16_workingram[0x274e/2];
1485 }
1486 
MEMORY_READ16_START(aurail_readmem)1487 static MEMORY_READ16_START( aurail_readmem )
1488     { 0x000000, 0x0bffff, MRA16_ROM },
1489 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
1490 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
1491 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
1492 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
1493 	{ 0xc41002, 0xc41003, input_port_0_word_r },// player1
1494 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
1495 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
1496 	{ 0xc42002, 0xc42003, input_port_3_word_r },// dip1
1497 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
1498 	{ 0xffe74e, 0xffe74f, aurail_skip_r },
1499 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
1500 MEMORY_END
1501 
1502 static MEMORY_WRITE16_START( aurail_writemem )
1503     { 0x000000, 0x0bffff, MWA16_ROM },
1504 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
1505 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
1506 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
1507 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
1508 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
1509 	{ 0xfc0000, 0xfcffff, sys16_tilebank_w },
1510 	{ 0xfe0006, 0xfe0007, sound_command_w },
1511 	{ 0xfe0020, 0xfe003f, MWA16_NOP }, // config regs
1512 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
1513 MEMORY_END
1514 
1515 /***************************************************************************/
1516 
1517 static void aurail_update_proc (void){
1518 	sys16_fg_scrollx = sys16_textram[0x0e98/2];
1519 	sys16_bg_scrollx = sys16_textram[0x0e9a/2];
1520 	sys16_fg_scrolly = sys16_textram[0x0e90/2];
1521 	sys16_bg_scrolly = sys16_textram[0x0e92/2];
1522 
1523 	set_fg_page( sys16_textram[0x0e80/2] );
1524 	set_bg_page( sys16_textram[0x0e82/2] );
1525 }
1526 
MACHINE_INIT(aurail)1527 static MACHINE_INIT( aurail ){
1528   	sys16_spritesystem = sys16_sprite_shinobi;
1529 	sys16_bg_priority_mode=1;
1530 	sys16_update_proc = aurail_update_proc;
1531 }
1532 
DRIVER_INIT(aurail)1533 static DRIVER_INIT( aurail )
1534 {
1535 	machine_init_sys16_onetime();
1536 }
1537 
DRIVER_INIT(auraila)1538 static DRIVER_INIT( auraila )
1539 {
1540 	data16_t *rom = (data16_t *)memory_region(REGION_CPU1);
1541 	int diff = 0x40000;	/* place decrypted opcodes in a empty hole */
1542 
1543 	init_aurail();
1544 
1545 	memory_set_opcode_base(0,rom+diff/2);
1546 
1547 	memcpy(rom+diff/2,rom,0x40000);
1548 
1549 	aurail_decode_data(rom,rom,0x10000);
1550 	aurail_decode_opcode1(rom+diff/2,rom+diff/2,0x10000);
1551 	aurail_decode_opcode2(rom+(diff+0x10000)/2,rom+(diff+0x10000)/2,0x10000);
1552 }
1553 
1554 /***************************************************************************/
1555 
INPUT_PORTS_START(aurail)1556 INPUT_PORTS_START( aurail )
1557 	SYS16_JOY1
1558 	SYS16_JOY2
1559 	SYS16_SERVICE
1560 	SYS16_COINAGE
1561 
1562 PORT_START	/* DSW1 */
1563 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
1564 	PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
1565 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1566 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1567 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1568 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1569 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1570 	PORT_DIPSETTING(    0x00, "2" )
1571 	PORT_DIPSETTING(    0x0c, "3" )
1572 	PORT_DIPSETTING(    0x08, "4" )
1573 	PORT_DIPSETTING(    0x04, "5" )
1574 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )
1575 	PORT_DIPSETTING(    0x10, "Normal" )
1576 	PORT_DIPSETTING(    0x00, "Hard" )
1577 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Difficulty ) )
1578 	PORT_DIPSETTING(    0x20, "Normal" )
1579 	PORT_DIPSETTING(    0x00, "Hard" )
1580 	PORT_DIPNAME( 0x40, 0x40, "Controller select" )
1581 	PORT_DIPSETTING(    0x40, "1 Player side" )
1582 	PORT_DIPSETTING(    0x00, "2 Players side" )
1583 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1584 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1585 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1586 INPUT_PORTS_END
1587 
1588 /***************************************************************************/
1589 
1590 static MACHINE_DRIVER_START( aurail )
1591 
1592 	/* basic machine hardware */
1593 	MDRV_IMPORT_FROM(system16_7759)
1594 	MDRV_CPU_MODIFY("main")
1595 	MDRV_CPU_MEMORY(aurail_readmem,aurail_writemem)
1596 
1597 	MDRV_MACHINE_INIT(aurail)
1598 MACHINE_DRIVER_END
1599 
1600 /***************************************************************************/
1601 // sys16B
1602 ROM_START( bayroute )
1603 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1604 	ROM_LOAD16_BYTE( "br.4a", 0x000000, 0x10000, CRC(91c6424b) SHA1(79a968ade7690d5944ee815e19586cb82c3aa562) )
1605 	ROM_LOAD16_BYTE( "br.1a", 0x000001, 0x10000, CRC(76954bf3) SHA1(bd617c6ddaf1e7760479b17205388c201fb67662) )
1606 	/* empty 0x20000-0x80000*/
1607 	ROM_LOAD16_BYTE( "br.5a", 0x080000, 0x10000, CRC(9d6fd183) SHA1(5ae78d33c0e929886d84a25c0fbd62ab45dcbff4) )
1608 	ROM_LOAD16_BYTE( "br.2a", 0x080001, 0x10000, CRC(5ca1e3d2) SHA1(51ce67ed0a0054f9c9c4ac56c5775716c44d74b1) )
1609 	ROM_LOAD16_BYTE( "br.6a", 0x0a0000, 0x10000, CRC(ed97ad4c) SHA1(6c7d671c3046f1adb486f053acdd2be0c981c68b) )
1610 	ROM_LOAD16_BYTE( "br.3a", 0x0a0001, 0x10000, CRC(0d362905) SHA1(04cb35aa44cc1d9ead44c5a7b4f838efec453c85) )
1611 
1612 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1613 	ROM_LOAD( "opr12462.a14", 0x00000, 0x10000, CRC(a19943b5) SHA1(95cd95223ea76677227b807a7c4eff120e690d37) )
1614 	ROM_LOAD( "opr12463.a15", 0x10000, 0x10000, CRC(62f8200d) SHA1(a5a0035249f339396b33f8a908d393777e8951c4) )
1615 	ROM_LOAD( "opr12464.a16", 0x20000, 0x10000, CRC(c8c59703) SHA1(3a4f45b88990d27c55ddfde5fc93496954868200) )
1616 
1617 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
1618 	ROM_LOAD16_BYTE( "br_obj0o.1b", 0x00001, 0x10000, CRC(098a5e82) SHA1(c5922f418773bc3629071e584457839d67a370e9) )
1619 	ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
1620 	ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
1621 	ROM_LOAD16_BYTE( "br_obj1e.6b", 0x20000, 0x10000, CRC(d3123315) SHA1(16a87caed1cabb080d4f35935910b38797344ca5) )
1622 	ROM_LOAD16_BYTE( "br_obj2o.3b", 0x40001, 0x10000, CRC(84efac1f) SHA1(41c43d70dc7ae7e361d6fa12c5790ea7ebf13ca8) )
1623 	ROM_LOAD16_BYTE( "br_obj2e.7b", 0x40000, 0x10000, CRC(b73b12cb) SHA1(e8265ae90aabf1ee0522dbc6541a0f82fec97c7a) )
1624 	ROM_LOAD16_BYTE( "br_obj3o.4b", 0x60001, 0x10000, CRC(a2e238ac) SHA1(c854774c0ffd1ccf6e46591a8fa3c80a4630e007) )
1625 	ROM_LOAD16_BYTE( "br.8b",		  0x60000, 0x10000, CRC(d8de78ff) SHA1(110661ab8008543b47629722b98d0470f73a48c5) )
1626 
1627 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1628 	ROM_LOAD( "epr12459.a10", 0x00000, 0x08000, CRC(3e1d29d0) SHA1(fe3d985983e5132e8a26a02a3f2d8d420cbf1a49) )
1629 	ROM_LOAD( "mpr12460.a11", 0x10000, 0x20000, CRC(0bae570d) SHA1(05fa4a3405666342ab66e696a7344cca97569f19) )
1630 	ROM_LOAD( "mpr12461.a12", 0x30000, 0x20000, CRC(b03b8b46) SHA1(b0283ac377d464f3d9374a992192ec6c515a3c2f) )
1631 ROM_END
1632 
1633 ROM_START( bayrouta )
1634 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1635 // custom cpu 317-0116
1636 	ROM_LOAD16_BYTE( "epr12517.a7", 0x000000, 0x20000, CRC(436728a9) SHA1(0f6753493ad2c1776880862b462f10ef936a9ee5) )
1637 	ROM_LOAD16_BYTE( "epr12516.a5", 0x000001, 0x20000, CRC(4ff0353f) SHA1(f5960f9e80e42d0a3f82d6670b1f2e39b51ffcef) )
1638 	/* empty 0x40000-0x80000*/
1639 	ROM_LOAD16_BYTE( "epr12458.a8", 0x080000, 0x20000, CRC(e7c7476a) SHA1(7b724d76bdc1978ddf78489edfda14533905a360) )
1640 	ROM_LOAD16_BYTE( "epr12456.a6", 0x080001, 0x20000, CRC(25dc2eaf) SHA1(dda300840b9a90bcce7be16ff1904a7a0456c396) )
1641 
1642 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1643 	ROM_LOAD( "opr12462.a14", 0x00000, 0x10000, CRC(a19943b5) SHA1(95cd95223ea76677227b807a7c4eff120e690d37) )
1644 	ROM_LOAD( "opr12463.a15", 0x10000, 0x10000, CRC(62f8200d) SHA1(a5a0035249f339396b33f8a908d393777e8951c4) )
1645 	ROM_LOAD( "opr12464.a16", 0x20000, 0x10000, CRC(c8c59703) SHA1(3a4f45b88990d27c55ddfde5fc93496954868200) )
1646 
1647 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
1648 	ROM_LOAD16_BYTE( "mpr12465.b1", 0x00001, 0x20000, CRC(11d61b45) SHA1(01678e07ffcafb8c161b52763f2183dc281c7578) )
1649 	ROM_LOAD16_BYTE( "mpr12467.b5", 0x00000, 0x20000, CRC(c3b4e4c0) SHA1(2d8dbea5278b3fac03c7ad8749f931d36cc8f341) )
1650 	ROM_LOAD16_BYTE( "mpr12466.b2", 0x40001, 0x20000, CRC(a57f236f) SHA1(c83219cdfcee10a4fdffcbf410808f161a2b1aef) )
1651 	ROM_LOAD16_BYTE( "mpr12468.b6", 0x40000, 0x20000, CRC(d89c77de) SHA1(0e903bf57a7515291dda7e11bdef982a1417043a) )
1652 
1653 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1654 	ROM_LOAD( "epr12459.a10", 0x00000, 0x08000, CRC(3e1d29d0) SHA1(fe3d985983e5132e8a26a02a3f2d8d420cbf1a49) )
1655 	ROM_LOAD( "mpr12460.a11", 0x10000, 0x20000, CRC(0bae570d) SHA1(05fa4a3405666342ab66e696a7344cca97569f19) )
1656 	ROM_LOAD( "mpr12461.a12", 0x30000, 0x20000, CRC(b03b8b46) SHA1(b0283ac377d464f3d9374a992192ec6c515a3c2f) )
1657 ROM_END
1658 
1659 ROM_START( bayrtbl1 )
1660 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1661 	ROM_LOAD16_BYTE( "b4.bin", 0x000000, 0x10000, CRC(eb6646ae) SHA1(073bc0a3868e70785f44e497a949cd9e3b591a33) )
1662 	ROM_LOAD16_BYTE( "b2.bin", 0x000001, 0x10000, CRC(ecd9cd0e) SHA1(177c38ca02c4e87d6adcae77ce4e9237938d23a9) )
1663 	/* empty 0x20000-0x80000*/
1664 	ROM_LOAD16_BYTE( "br.5a",  0x080000, 0x10000, CRC(9d6fd183) SHA1(5ae78d33c0e929886d84a25c0fbd62ab45dcbff4) )
1665 	ROM_LOAD16_BYTE( "br.2a",  0x080001, 0x10000, CRC(5ca1e3d2) SHA1(51ce67ed0a0054f9c9c4ac56c5775716c44d74b1) )
1666 	ROM_LOAD16_BYTE( "b8.bin", 0x0a0000, 0x10000, CRC(e7ca0331) SHA1(b255939576a84f4d266f31a7fde818e04ff35b24) )
1667 	ROM_LOAD16_BYTE( "b6.bin", 0x0a0001, 0x10000, CRC(2bc748a6) SHA1(9ab760377fde24cecb703726ee3e59ee23d60a3a) )
1668 
1669 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1670 	ROM_LOAD( "bs16.bin", 0x00000, 0x10000, CRC(a8a5b310) SHA1(8883e1ed48a3e0f7b4c36d83579f93e84e28568c) )
1671 	ROM_LOAD( "bs14.bin", 0x10000, 0x10000, CRC(6bc4d0a8) SHA1(90b9a61c7a140291d72554857ce26d54ebf03fc2) )
1672 	ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
1673 
1674 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
1675 	ROM_LOAD16_BYTE( "br_obj0o.1b", 0x00001, 0x10000, CRC(098a5e82) SHA1(c5922f418773bc3629071e584457839d67a370e9) )
1676 	ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
1677 	ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
1678 	ROM_LOAD16_BYTE( "br_obj1e.6b", 0x20000, 0x10000, CRC(d3123315) SHA1(16a87caed1cabb080d4f35935910b38797344ca5) )
1679 	ROM_LOAD16_BYTE( "br_obj2o.3b", 0x40001, 0x10000, CRC(84efac1f) SHA1(41c43d70dc7ae7e361d6fa12c5790ea7ebf13ca8) )
1680 	ROM_LOAD16_BYTE( "br_obj2e.7b", 0x40000, 0x10000, CRC(b73b12cb) SHA1(e8265ae90aabf1ee0522dbc6541a0f82fec97c7a) )
1681 	ROM_LOAD16_BYTE( "br_obj3o.4b", 0x60001, 0x10000, CRC(a2e238ac) SHA1(c854774c0ffd1ccf6e46591a8fa3c80a4630e007) )
1682 	ROM_LOAD16_BYTE( "bs7.bin",     0x60000, 0x10000, CRC(0c91abcc) SHA1(d25608f3cbacd1bd169f1a2247f007ac8bc8dda0) )
1683 
1684 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1685 	ROM_LOAD( "epr12459.a10", 0x00000, 0x08000, CRC(3e1d29d0) SHA1(fe3d985983e5132e8a26a02a3f2d8d420cbf1a49) )
1686 	ROM_LOAD( "mpr12460.a11", 0x10000, 0x20000, CRC(0bae570d) SHA1(05fa4a3405666342ab66e696a7344cca97569f19) )
1687 	ROM_LOAD( "mpr12461.a12", 0x30000, 0x20000, CRC(b03b8b46) SHA1(b0283ac377d464f3d9374a992192ec6c515a3c2f) )
1688 ROM_END
1689 
1690 ROM_START( bayrtbl2 )
1691 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
1692 	ROM_LOAD16_BYTE( "br_04", 0x000000, 0x10000, CRC(2e33ebfc) SHA1(f6b5a4bd28d302abd6b1e5a9ec6f2a8b57ff213e) )
1693 	ROM_LOAD16_BYTE( "br_06", 0x000001, 0x10000, CRC(3db42313) SHA1(e1c874ebf83e1a458cefaa038fbe89a9804ca30d) )
1694 	/* empty 0x20000-0x80000*/
1695 	ROM_LOAD16_BYTE( "br_03", 0x080000, 0x20000, CRC(285d256b) SHA1(73eac0131d14f0d7fe2a06cb2e0e57dcf4779cf9) )
1696 	ROM_LOAD16_BYTE( "br_05", 0x080001, 0x20000, CRC(552e6384) SHA1(2770b0c9d961671576e09ada2ebd7bb486f24547) )
1697 
1698 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1699 	ROM_LOAD( "br_15",    0x00000, 0x10000, CRC(050079a9) SHA1(4b356eddec2f500fb0dcc20af6b7aed2f9ef0c02) )
1700 	ROM_LOAD( "br_16",    0x10000, 0x10000, CRC(fc371928) SHA1(b36866c95bdc440aae999a90ecf3bbaed11d4351) )
1701 	ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
1702 
1703 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
1704 	ROM_LOAD16_BYTE( "br_11",       0x00001, 0x10000, CRC(65232905) SHA1(cb195a0ce8bff9d1d3e31678060b3aaccfefcd2d) )
1705 	ROM_LOAD16_BYTE( "br_obj0e.5b", 0x00000, 0x10000, CRC(85238af9) SHA1(39989a8d9b60c6d55272b5e2c213341a563dd993) )
1706 	ROM_LOAD16_BYTE( "br_obj1o.2b", 0x20001, 0x10000, CRC(cc641da1) SHA1(28f8a6502702cb9e2cc7f3e98f6c5d201f462fa3) )
1707 	ROM_LOAD16_BYTE( "br_obj1e.6b", 0x20000, 0x10000, CRC(d3123315) SHA1(16a87caed1cabb080d4f35935910b38797344ca5) )
1708 	ROM_LOAD16_BYTE( "br_obj2o.3b", 0x40001, 0x10000, CRC(84efac1f) SHA1(41c43d70dc7ae7e361d6fa12c5790ea7ebf13ca8) )
1709 	ROM_LOAD16_BYTE( "br_09",       0x40000, 0x10000, CRC(05e9b840) SHA1(7cc1c9ac7b85f1e1bdb68215b5e83eae3ee5ba2a) )
1710 	ROM_LOAD16_BYTE( "br_14",       0x60001, 0x10000, CRC(4c4a177b) SHA1(a9dfd7e56b0a21a0f7750d8ec4631901ad182609) )
1711 	ROM_LOAD16_BYTE( "bs7.bin",     0x60000, 0x10000, CRC(0c91abcc) SHA1(d25608f3cbacd1bd169f1a2247f007ac8bc8dda0) )
1712 
1713 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
1714 	ROM_LOAD( "br_01", 0x00000, 0x10000, CRC(b87156ec) SHA1(bdfef2ab5a4d3cac4077c92ce1ef4604b4c11cf8) )
1715 	ROM_LOAD( "br_02", 0x10000, 0x10000, CRC(ef63991b) SHA1(4221741780f88c80b3213ddca949bee7d4c1469a) )
1716 ROM_END
1717 
1718 /***************************************************************************/
1719 
1720 static MEMORY_READ16_START( bayroute_readmem )
1721     { 0x000000, 0x0bffff, MRA16_ROM },
1722 	{ 0x500000, 0x503fff, SYS16_MRA16_WORKINGRAM },
1723 	{ 0x600000, 0x600fff, SYS16_MRA16_SPRITERAM },
1724 	{ 0x700000, 0x70ffff, SYS16_MRA16_TILERAM },
1725 	{ 0x710000, 0x710fff, SYS16_MRA16_TEXTRAM },
1726 	{ 0x800000, 0x800fff, SYS16_MRA16_PALETTERAM },
1727 	{ 0x901002, 0x901003, input_port_0_word_r }, // player1
1728 	{ 0x901006, 0x901007, input_port_1_word_r }, // player2
1729 	{ 0x901000, 0x901001, input_port_2_word_r }, // service
1730 	{ 0x902002, 0x902003, input_port_3_word_r }, // dip1
1731 	{ 0x902000, 0x902001, input_port_4_word_r }, // dip2
1732 MEMORY_END
1733 
1734 static MEMORY_WRITE16_START( bayroute_writemem )
1735     { 0x000000, 0x0bffff, MWA16_ROM },
1736 	{ 0x100000, 0x100003, MWA16_NOP }, // tilebank control?
1737 	{ 0x500000, 0x503fff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
1738 	{ 0x600000, 0x600fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
1739 	{ 0x700000, 0x70ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
1740 	{ 0x710000, 0x710fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
1741 	{ 0x800000, 0x800fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
1742 	{ 0x900000, 0x900001, sys16_coinctrl_w },
1743 	{ 0xff0006, 0xff0007, sound_command_w },
1744 	{ 0xff0020, 0xff003f, MWA16_NOP },// config regs
1745 MEMORY_END
1746 
1747 /***************************************************************************/
1748 
1749 static void bayroute_update_proc( void ){
1750 	set_fg_page( sys16_textram[0x740] );
1751 	set_bg_page( sys16_textram[0x741] );
1752 	sys16_fg_scrolly = sys16_textram[0x748];
1753 	sys16_bg_scrolly = sys16_textram[0x749];
1754 	sys16_fg_scrollx = sys16_textram[0x74c];
1755 	sys16_bg_scrollx = sys16_textram[0x74d];
1756 }
1757 
MACHINE_INIT(bayroute)1758 static MACHINE_INIT( bayroute ){
1759 	static int bank[16] = {
1760 		0,0,0,0,
1761 		0,0,0,3,
1762 		0,0,0,2,
1763 		0,1,0,0
1764 	};
1765 	sys16_obj_bank = bank;
1766 	sys16_update_proc = bayroute_update_proc;
1767 	sys16_spritesystem = sys16_sprite_shinobi;
1768 }
1769 
DRIVER_INIT(bayroute)1770 static DRIVER_INIT( bayroute ){
1771 	machine_init_sys16_onetime();
1772 }
1773 
DRIVER_INIT(bayrouta)1774 static DRIVER_INIT( bayrouta ){
1775 	machine_init_sys16_onetime();
1776 }
1777 
DRIVER_INIT(bayrtbl1)1778 static DRIVER_INIT( bayrtbl1 ){
1779 	int i;
1780 	machine_init_sys16_onetime();
1781 	/* invert the graphics bits on the tiles */
1782 	for (i = 0; i < 0x30000; i++)
1783 		memory_region(REGION_GFX1)[i] ^= 0xff;
1784 }
1785 /***************************************************************************/
1786 
INPUT_PORTS_START(bayroute)1787 INPUT_PORTS_START( bayroute )
1788 	SYS16_JOY1
1789 	SYS16_JOY2
1790 	SYS16_SERVICE
1791 	SYS16_COINAGE
1792 
1793 PORT_START
1794 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1795 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1796 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1797 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1798 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1799 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1800 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
1801 	PORT_DIPSETTING(    0x04, "1" )
1802 	PORT_DIPSETTING(    0x0c, "3" )
1803 	PORT_DIPSETTING(    0x08, "5" )
1804 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Unlimited", IP_KEY_NONE, IP_JOY_NONE )
1805 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
1806 	PORT_DIPSETTING(    0x30, "10000" )
1807 	PORT_DIPSETTING(    0x20, "15000" )
1808 	PORT_DIPSETTING(    0x10, "20000" )
1809 	PORT_DIPSETTING(    0x00, "None" )
1810 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) )
1811 	PORT_DIPSETTING(    0xc0, "A" )
1812 	PORT_DIPSETTING(    0x80, "B" )
1813 	PORT_DIPSETTING(    0x40, "C" )
1814 	PORT_DIPSETTING(    0x00, "D" )
1815 
1816 INPUT_PORTS_END
1817 
1818 /***************************************************************************/
1819 
1820 static MACHINE_DRIVER_START( bayroute )
1821 
1822 	/* basic machine hardware */
1823 	MDRV_IMPORT_FROM(system16_7759)
1824 	MDRV_CPU_MODIFY("main")
1825 	MDRV_CPU_MEMORY(bayroute_readmem,bayroute_writemem)
1826 
1827 	MDRV_MACHINE_INIT(bayroute)
1828 MACHINE_DRIVER_END
1829 
1830 /***************************************************************************
1831 
1832    Body Slam
1833 
1834 ***************************************************************************/
1835 // pre16
1836 ROM_START( bodyslam )
1837 	ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 68000 code */
1838 	ROM_LOAD16_BYTE( "epr10066.b9", 0x000000, 0x8000, CRC(6cd53290) SHA1(68ef83ad99a26a507d9bc4cd715462169f4ac41f) )
1839 	ROM_LOAD16_BYTE( "epr10063.b6", 0x000001, 0x8000, CRC(dd849a16) SHA1(b8cb9f2685a739698a3ed18f76617fd4ac9cb424) )
1840 	ROM_LOAD16_BYTE( "epr10067.b10",0x010000, 0x8000, CRC(db22a5ce) SHA1(95c37d4913fa31d5edf02661681bc83deec731d9) )
1841 	ROM_LOAD16_BYTE( "epr10064.b7", 0x010001, 0x8000, CRC(53d6b7e0) SHA1(00bfa1487479629f60e1cc1b98ced47e4cb07964) )
1842 	ROM_LOAD16_BYTE( "epr10068.b11",0x020000, 0x8000, CRC(15ccc665) SHA1(b088a9bcb1499854794b2dbf4c689f3ae3ce2808) )
1843 	ROM_LOAD16_BYTE( "epr10065.b8", 0x020001, 0x8000, CRC(0e5fa314) SHA1(44e36fde102ba6aef2c3b4374ddc21690f2fe527) )
1844 
1845 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1846 	ROM_LOAD( "epr10321.c9",  0x00000, 0x8000, CRC(cd3e7cba) SHA1(4d3cfc7346c6e63e2221193601f949162d0e4f90) ) /* plane 1 */
1847 	ROM_LOAD( "epr10322.c10", 0x08000, 0x8000, CRC(b53d3217) SHA1(baebf20925e9f8ab6660f041a24721716d5b7d92) ) /* plane 2 */
1848 	ROM_LOAD( "epr10323.c11", 0x10000, 0x8000, CRC(915a3e61) SHA1(6504a8b26b7b4880971cd69ac2c8aae30dcfa18c) ) /* plane 3 */
1849 
1850 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites */
1851 	ROM_LOAD16_BYTE( "epr10012.c5",  0x00001, 0x08000, CRC(990824e8) SHA1(bd45f75d07cb4e17583c2d76050e5f819f4b7efe) )
1852 	ROM_LOAD16_BYTE( "epr10016.b2",  0x00000, 0x08000, CRC(af5dc72f) SHA1(97bbb76940c702e642d8222dda71447b8f60b616) )
1853 	ROM_LOAD16_BYTE( "epr10013.c6",  0x10001, 0x08000, CRC(9a0919c5) SHA1(e39e60c1e834b3b46bf2ef1c5952841bebe66ade) )
1854 	ROM_LOAD16_BYTE( "epr10017.b3",  0x10000, 0x08000, CRC(62aafd95) SHA1(e1e3a95fd11cabf81f44ac2dd3f951d3094725e6) )
1855 	ROM_LOAD16_BYTE( "epr10027.c7",  0x20001, 0x08000, CRC(3f1c57c7) SHA1(1336da8dc167a323f09534a2f62ae6f9c62290e4) )
1856 	ROM_LOAD16_BYTE( "epr10028.b4",  0x20000, 0x08000, CRC(80d4946d) SHA1(d4c96a18ef6c2ac6bd9d153d8862a3af894642e8) )
1857 	ROM_LOAD16_BYTE( "epr10015.c8",  0x30001, 0x08000, CRC(582d3b6a) SHA1(4f1d0060682e3fc1147082286e00e6a296a95da2) )
1858 	ROM_LOAD16_BYTE( "epr10019.b5",  0x30000, 0x08000, CRC(e020c38b) SHA1(d13d38a64f2afa7df3cbccef2fe505a4421b73ad) )
1859 
1860 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
1861 	ROM_LOAD( "epr10026.b1", 0x00000, 0x8000, CRC(123b69b8) SHA1(c0614a8c822991e257f7218908247df278056de8) )
1862 
1863 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
1864 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
1865 
1866 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
1867 	ROM_LOAD( "epr10029.c1", 0x00000, 0x8000, CRC(7e4aca83) SHA1(703486b96d493941ee87267e8363220a851f008e) )
1868 	ROM_LOAD( "epr10030.c2", 0x08000, 0x8000, CRC(dcc1df0b) SHA1(a82a557fa48f4b3e1ab38f61b84d749cd417e80f) )
1869 	ROM_LOAD( "epr10031.c3", 0x10000, 0x8000, CRC(ea3c4472) SHA1(ad8eac2d3d14fd6aba713f4d624861c17aabf757) )
1870 	ROM_LOAD( "epr10032.c4", 0x18000, 0x8000, CRC(0aabebce) SHA1(fab12df8f4eab270be491c6c025d832c338e1e83) )
1871 
1872 ROM_END
1873 
1874 ROM_START( dumpmtmt )
1875 	ROM_REGION( 0x30000, REGION_CPU1, 0 ) /* 68000 code */
1876 	ROM_LOAD16_BYTE( "7704a.bin", 0x000000, 0x8000, CRC(96de6c7b) SHA1(f23edf86c5044c151a8502957af7ca0de420d55e) )
1877 	ROM_LOAD16_BYTE( "7701a.bin", 0x000001, 0x8000, CRC(786d1009) SHA1(c56ebd169c2792cde610a7130cffdc0363fca871) )
1878 	ROM_LOAD16_BYTE( "7705a.bin", 0x010000, 0x8000, CRC(fc584391) SHA1(27238408fba2dda67f29094a6700b634b6fdaa58) )
1879 	ROM_LOAD16_BYTE( "7702a.bin", 0x010001, 0x8000, CRC(2241a8fd) SHA1(d968ab57aa228dbb7ae6f17d7bf22991291e75ae) )
1880 	ROM_LOAD16_BYTE( "7706a.bin", 0x020000, 0x8000, CRC(6bbcc9d0) SHA1(e8e0b85867f11eec6b280f3ad9e2746d3d97ab28) )
1881 	ROM_LOAD16_BYTE( "7703a.bin", 0x020001, 0x8000, CRC(fcb0cd40) SHA1(999e107fe08fcb52729ddebc7714a85c47e748b1) )
1882 
1883 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1884 	ROM_LOAD( "7707a.bin",  0x00000, 0x8000, CRC(45318738) SHA1(6885347321aec8c4829a71e4518d1742f939ea9c) ) /* plane 1 */
1885 	ROM_LOAD( "7708a.bin",  0x08000, 0x8000, CRC(411be9a4) SHA1(808a9c941d353f34c3491ca2cde984e73cc7a87d) ) /* plane 2 */
1886 	ROM_LOAD( "7709a.bin",  0x10000, 0x8000, CRC(74ceb5a8) SHA1(93ed6bb4a3c820f3a7ee5e9b2c2ce35d2bed8529) ) /* plane 3 */
1887 
1888 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites */
1889 	ROM_LOAD16_BYTE( "7715.bin",  	0x000001, 0x08000, CRC(bf47e040) SHA1(5aa1b9adaa2095844c10993402a0597bb5768efb) )
1890 	ROM_LOAD16_BYTE( "7719.bin",  	0x000000, 0x08000, CRC(fa5c5d6c) SHA1(6cac5d3fd705d1365348d57a18bbeb1eb9e412b8) )
1891 	ROM_LOAD16_BYTE( "epr10013.c6",	0x010001, 0x08000, CRC(9a0919c5) SHA1(e39e60c1e834b3b46bf2ef1c5952841bebe66ade) )	/* 7716 */
1892 	ROM_LOAD16_BYTE( "epr10017.b3",	0x010000, 0x08000, CRC(62aafd95) SHA1(e1e3a95fd11cabf81f44ac2dd3f951d3094725e6) )	/* 7720 */
1893 	ROM_LOAD16_BYTE( "7717.bin",  	0x020001, 0x08000, CRC(fa64c86d) SHA1(ada722dd6efbf466a719ee1fe34a36ce1ea20184) )
1894 	ROM_LOAD16_BYTE( "7721.bin",  	0x020000, 0x08000, CRC(62a9143e) SHA1(28f0dc0329163f0a6505dd34a24a843b35118c5e) )
1895 	ROM_LOAD16_BYTE( "epr10015.c8",	0x030001, 0x08000, CRC(582d3b6a) SHA1(4f1d0060682e3fc1147082286e00e6a296a95da2) )	/* 7718 */
1896 	ROM_LOAD16_BYTE( "epr10019.b5",	0x030000, 0x08000, CRC(e020c38b) SHA1(d13d38a64f2afa7df3cbccef2fe505a4421b73ad) )	/* 7722 */
1897 
1898 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
1899 	ROM_LOAD( "7710a.bin", 0x00000, 0x8000, CRC(a19b8ba8) SHA1(21b628d4ecbe38a6d96a39ca4252ff1cb728343f) )
1900 
1901 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
1902 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
1903 
1904 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
1905 	ROM_LOAD( "7711.bin", 0x00000, 0x8000, CRC(efa9aabd) SHA1(b0928313b98159b95f3a6784c6279924774b9253) )
1906 	ROM_LOAD( "7712.bin", 0x08000, 0x8000, CRC(7bcd85cf) SHA1(9acba6998327e1074d7311a9b6d06da9baf69aa0) )
1907 	ROM_LOAD( "7713.bin", 0x10000, 0x8000, CRC(33f292e7) SHA1(4358cd3922a0dcbf109d2d697c7b8c4e090c3d52) )
1908 	ROM_LOAD( "7714.bin", 0x18000, 0x8000, CRC(8fd48c47) SHA1(1cba63a9e7e0b477683b7758d124f4949558ba7a) )
1909 
1910 ROM_END
1911 
1912 /***************************************************************************/
1913 
1914 static MEMORY_READ16_START( bodyslam_readmem )
1915     { 0x000000, 0x02ffff, MRA16_ROM },
1916 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
1917 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
1918 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
1919 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
1920 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
1921 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
1922 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
1923 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
1924 	{ 0xc42002, 0xc42003, input_port_4_word_r },// dip2
1925 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
1926 MEMORY_END
1927 
1928 static MEMORY_WRITE16_START( bodyslam_writemem )
1929     { 0x000000, 0x02ffff, MWA16_ROM },
1930 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
1931 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
1932 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
1933 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
1934 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
1935 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
1936 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
1937 MEMORY_END
1938 
1939 /***************************************************************************/
1940 
1941 static void bodyslam_update_proc (void){
1942 	sys16_fg_scrollx = sys16_textram[0x0ffa/2] & 0x01ff;
1943 	sys16_bg_scrollx = sys16_textram[0x0ff8/2] & 0x01ff;
1944 	sys16_fg_scrolly = sys16_textram[0x0f26/2] & 0x00ff;
1945 	sys16_bg_scrolly = sys16_textram[0x0f24/2] & 0x01ff;
1946 
1947 	set_fg_page1( sys16_textram[0x0e9e/2] );
1948 	set_bg_page1( sys16_textram[0x0e9c/2] );
1949 }
1950 
MACHINE_INIT(bodyslam)1951 static MACHINE_INIT( bodyslam ){
1952 	sys16_textmode=1;
1953 	sys16_spritesystem = sys16_sprite_quartet2;
1954 	sys16_sprxoffset = -0xbc;
1955 	sys16_fgxoffset = sys16_bgxoffset = 7;
1956 	sys16_bg_priority_mode = 2;
1957 	sys16_bg_priority_value=0x0e00;
1958 
1959 	sys16_textlayer_lo_min=0;
1960 	sys16_textlayer_lo_max=0x1f;
1961 	sys16_textlayer_hi_min=0x20;
1962 	sys16_textlayer_hi_max=0xff;
1963 
1964 	sys16_update_proc = bodyslam_update_proc;
1965 }
1966 
1967 // I have no idea if this is needed, but I cannot find any code for the countdown
1968 // timer in the code and this seems to work ok.
bodyslam_irq_timer(void)1969 static void bodyslam_irq_timer(void)
1970 {
1971 	int flag=(*(UINT16 *)(&sys16_workingram[0x200/2]))>>8;
1972 	int tick=(*(UINT16 *)(&sys16_workingram[0x200/2]))&0xff;
1973 	int sec=(*(UINT16 *)(&sys16_workingram[0x202/2]))>>8;
1974 	int min=(*(UINT16 *)(&sys16_workingram[0x202/2]))&0xff;
1975 
1976 	if(tick == 0 && sec == 0 && min == 0)
1977 		flag=1;
1978 	else
1979 	{
1980 		if(tick==0)
1981 		{
1982 			tick=0x40;	// The game initialise this to 0x40
1983 			if(sec==0)
1984 			{
1985 				sec=0x59;
1986 				if(min==0)
1987 				{
1988 					flag=1;
1989 					tick=sec=min=0;
1990 				}
1991 				else
1992 					min--;
1993 			}
1994 			else
1995 			{
1996 				if((sec&0xf)==0)
1997 				{
1998 					sec-=0x10;
1999 					sec|=9;
2000 				}
2001 				else
2002 					sec--;
2003 
2004 			}
2005 		}
2006 		else
2007 			tick--;
2008 	}
2009 	sys16_workingram[0x200/2] = (flag<<8)+tick;
2010 	sys16_workingram[0x202/2] = (sec<<8)+min;
2011 }
2012 
DRIVER_INIT(bodyslam)2013 static DRIVER_INIT( bodyslam ){
2014 	machine_init_sys16_onetime();
2015 	sys16_bg1_trans=1;
2016 	sys16_custom_irq=bodyslam_irq_timer;
2017 }
2018 
2019 /***************************************************************************/
2020 
INPUT_PORTS_START(bodyslam)2021 INPUT_PORTS_START( bodyslam )
2022 	SYS16_JOY1
2023 	SYS16_JOY2
2024 	SYS16_SERVICE
2025 	SYS16_COINAGE
2026 
2027 PORT_START	/* DSW1 */
2028 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
2029 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2030 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2031 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2032 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2033 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2034 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
2035 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2036 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2037 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
2038 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2039 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2040 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2041 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2042 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2043 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2044 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2045 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2046 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2047 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2048 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2049 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2050 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2051 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2052 
2053 INPUT_PORTS_END
2054 
2055 /***************************************************************************/
2056 
2057 static MACHINE_DRIVER_START( bodyslam )
2058 
2059 	/* basic machine hardware */
2060 	MDRV_IMPORT_FROM(system16_7751)
2061 	MDRV_CPU_MODIFY("main")
2062 	MDRV_CPU_MEMORY(bodyslam_readmem,bodyslam_writemem)
2063 
2064 	MDRV_MACHINE_INIT(bodyslam)
2065 MACHINE_DRIVER_END
2066 
2067 /***************************************************************************/
2068 // sys16B
2069 ROM_START( dduxbl )
2070 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
2071 	ROM_LOAD16_BYTE( "dduxb03.bin", 0x000000, 0x20000, CRC(e7526012) SHA1(a1798008bfa1ce9b87dc330f3817b1978052fcfd) )
2072 	ROM_LOAD16_BYTE( "dduxb05.bin", 0x000001, 0x20000, CRC(459d1237) SHA1(55e9c0dc341c919d58cc789203642c397d7ac65e) )
2073 	/* empty 0x40000 - 0x80000 */
2074 	ROM_LOAD16_BYTE( "dduxb02.bin", 0x080000, 0x20000, CRC(d8ed3132) SHA1(a9d5ad8f79fb635cc234a99fad398688a5f15926) )
2075 	ROM_LOAD16_BYTE( "dduxb04.bin", 0x080001, 0x20000, CRC(30c6cb92) SHA1(2e17c74eeb37c9731fc2e365cc0114f7383c0106) )
2076 
2077 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2078 	ROM_LOAD( "dduxb14.bin", 0x00000, 0x10000, CRC(664bd135) SHA1(674b06e01c2c8f5b8057dd24d470330c3f140473) )
2079 	ROM_LOAD( "dduxb15.bin", 0x10000, 0x10000, CRC(ce0d2b30) SHA1(e60521c46f1650c9bdc76f2ceb91a6d61aaa0a09) )
2080 	ROM_LOAD( "dduxb16.bin", 0x20000, 0x10000, CRC(6de95434) SHA1(7bed2a0261cf6c2fbb3756633f05f0bb2173977c) )
2081 
2082 	ROM_REGION( 0xa0000, REGION_GFX2, 0 ) //* sprites */
2083 	ROM_LOAD16_BYTE( "dduxb10.bin", 0x00001, 0x010000, CRC(0be3aee5) SHA1(48fc779b7398abbb82cd0d0d28705ece75b3c4e3) )
2084 	ROM_RELOAD( 0x20001, 0x010000 )
2085 	ROM_LOAD16_BYTE( "dduxb06.bin", 0x00000, 0x010000, CRC(b0079e99) SHA1(9bb4d3fa804a3d05a6e06b45a1280d7064e96ac6) )
2086 	ROM_RELOAD( 0x20000, 0x010000 )
2087 	ROM_LOAD16_BYTE( "dduxb11.bin", 0x40001, 0x010000, CRC(cfb2af18) SHA1(1ad18f933a7b797f0364d1f4a6c8549351b4c9a6) )
2088 	ROM_LOAD16_BYTE( "dduxb07.bin", 0x40000, 0x010000, CRC(0217369c) SHA1(b6ec2fa1279a27a602d79e1073c54193745ea816) )
2089 	ROM_LOAD16_BYTE( "dduxb12.bin", 0x60001, 0x010000, CRC(28ce9b15) SHA1(1640df9c8f21893c0647ad2f4210c714a06e6f37) )
2090 	ROM_LOAD16_BYTE( "dduxb08.bin", 0x60000, 0x010000, CRC(8844f336) SHA1(18c1baaad3bcc658d4a6d03de8c97378b5284e88) )
2091 	ROM_LOAD16_BYTE( "dduxb13.bin", 0x80001, 0x010000, CRC(efe57759) SHA1(69b8969b20ab9480df2735bd2bcd527069196bd7) )
2092 	ROM_LOAD16_BYTE( "dduxb09.bin", 0x80000, 0x010000, CRC(6b64f665) SHA1(df07fcf2bbec6fa78f89b95272762aebd6f3ec0e) )
2093 
2094 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2095 	ROM_LOAD( "dduxb01.bin", 0x0000, 0x8000, CRC(0dbef0d7) SHA1(8b9afb2fcb946cec467b1e691c267194b503f841) )
2096 ROM_END
2097 
2098 /***************************************************************************/
2099 static READ16_HANDLER( dduxbl_skip_r ){
2100 	if (activecpu_get_pc()==0x502) {cpu_spinuntil_int(); return 0xffff;}
2101 	return sys16_workingram[0x36e0/2];
2102 }
2103 
MEMORY_READ16_START(dduxbl_readmem)2104 static MEMORY_READ16_START( dduxbl_readmem )
2105     { 0x000000, 0x0bffff, MRA16_ROM },
2106 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
2107 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
2108 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
2109 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
2110 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
2111 	{ 0xc41004, 0xc41005, input_port_1_word_r }, // player2
2112 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
2113 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
2114 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
2115 	{ 0xfff6e0, 0xfff6e1, dduxbl_skip_r },
2116 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
2117 MEMORY_END
2118 
2119 static MEMORY_WRITE16_START( dduxbl_writemem )
2120     { 0x000000, 0x0bffff, MWA16_ROM },
2121 	{ 0x3f0000, 0x3fffff, sys16_tilebank_w },
2122 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
2123 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
2124 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
2125 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
2126 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
2127 	{ 0xc40006, 0xc40007, sound_command_w },
2128 	{ 0xc46000, 0xc4603f, SYS16_MWA16_EXTRAM2, &sys16_extraram2 },
2129 	{ 0xfe0020, 0xfe003f, MWA16_NOP }, // config regs
2130 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
2131 MEMORY_END
2132 
2133 /***************************************************************************/
2134 
2135 static void dduxbl_update_proc( void ){
2136 	sys16_fg_scrollx = (sys16_extraram2[0x0018/2] ^ 0xffff) & 0x01ff;
2137 	sys16_bg_scrollx = (sys16_extraram2[0x0008/2] ^ 0xffff) & 0x01ff;
2138 	sys16_fg_scrolly = sys16_extraram2[0x0010/2] & 0x00ff;
2139 	sys16_bg_scrolly = sys16_extraram2[0x0000/2];
2140 
2141 	{
2142 		unsigned char lu = sys16_extraram2[0x0020/2] & 0xff;
2143 		unsigned char ru = sys16_extraram2[0x0022/2] & 0xff;
2144 		unsigned char ld = sys16_extraram2[0x0024/2] & 0xff;
2145 		unsigned char rd = sys16_extraram2[0x0026/2] & 0xff;
2146 
2147 		if (lu==4 && ld==4 && ru==5 && rd==5)
2148 		{ // fix a bug in chicago round (un-tested in MAME)
2149 			int vs=(*(UINT16 *)(&sys16_workingram[0x36ec]));
2150 			sys16_bg_scrolly = vs & 0xff;
2151 			sys16_fg_scrolly = vs & 0xff;
2152 			if (vs >= 0x100)
2153 			{
2154 				lu=0x26; ru=0x37;
2155 				ld=0x04; rd=0x15;
2156 			} else {
2157 				ld=0x26; rd=0x37;
2158 				lu=0x04; ru=0x15;
2159 			}
2160 		}
2161 		sys16_fg_page[0] = ld&0xf;
2162 		sys16_fg_page[1] = rd&0xf;
2163 		sys16_fg_page[2] = lu&0xf;
2164 		sys16_fg_page[3] = ru&0xf;
2165 
2166 		sys16_bg_page[0] = ld>>4;
2167 		sys16_bg_page[1] = rd>>4;
2168 		sys16_bg_page[2] = lu>>4;
2169 		sys16_bg_page[3] = ru>>4;
2170 	}
2171 }
2172 
MACHINE_INIT(dduxbl)2173 static MACHINE_INIT( dduxbl ){
2174 	static int bank[16] = { //*
2175 		0,0,0,0,
2176 		0,0,0,4,
2177 		0,0,0,3,
2178 		0,2,0,0
2179 	};
2180 	sys16_obj_bank = bank;
2181 
2182 	sys16_patch_code( 0x1eb2e, 0x01 );
2183 	sys16_patch_code( 0x1eb2f, 0x01 );
2184 	sys16_patch_code( 0x1eb3c, 0x00 );
2185 	sys16_patch_code( 0x1eb3d, 0x00 );
2186 	sys16_patch_code( 0x23132, 0x01 );
2187 	sys16_patch_code( 0x23133, 0x01 );
2188 	sys16_patch_code( 0x23140, 0x00 );
2189 	sys16_patch_code( 0x23141, 0x00 );
2190 	sys16_patch_code( 0x24a9a, 0x01 );
2191 	sys16_patch_code( 0x24a9b, 0x01 );
2192 	sys16_patch_code( 0x24aa8, 0x00 );
2193 	sys16_patch_code( 0x24aa9, 0x00 );
2194 
2195 	sys16_update_proc = dduxbl_update_proc;
2196 	sys16_sprxoffset = -0x48;
2197 }
2198 
DRIVER_INIT(dduxbl)2199 static DRIVER_INIT( dduxbl )
2200 {
2201 	int i;
2202 
2203 	machine_init_sys16_onetime();
2204 
2205 	/* invert the graphics bits on the tiles */
2206 	for (i = 0; i < 0x30000; i++)
2207 		memory_region(REGION_GFX1)[i] ^= 0xff;
2208 }
2209 /***************************************************************************/
2210 
INPUT_PORTS_START(dduxbl)2211 INPUT_PORTS_START( dduxbl )
2212 	SYS16_JOY1
2213 	SYS16_JOY2
2214 	SYS16_SERVICE
2215 	SYS16_COINAGE
2216 
2217 PORT_START	/* DSW1 */
2218 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
2219 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2220 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2221 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
2222 	PORT_DIPSETTING(    0x04, "Easy" )
2223 	PORT_DIPSETTING(    0x06, "Normal" )
2224 	PORT_DIPSETTING(    0x02, "Hard" )
2225 	PORT_DIPSETTING(    0x00, "Hardest" )
2226 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
2227 	PORT_DIPSETTING(    0x10, "2" )
2228 	PORT_DIPSETTING(    0x18, "3" )
2229 	PORT_DIPSETTING(    0x08, "4" )
2230 	PORT_DIPSETTING(    0x00, "5" )
2231 	PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) )
2232 	PORT_DIPSETTING(    0x40, "150000" )
2233 	PORT_DIPSETTING(    0x60, "200000" )
2234 	PORT_DIPSETTING(    0x20, "300000" )
2235 	PORT_DIPSETTING(    0x00, "400000" )
2236 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
2237 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2238 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2239 
2240 INPUT_PORTS_END
2241 
2242 /***************************************************************************/
2243 
2244 static MACHINE_DRIVER_START( dduxbl )
2245 
2246 	/* basic machine hardware */
2247 	MDRV_IMPORT_FROM(system16)
2248 	MDRV_CPU_MODIFY("main")
2249 	MDRV_CPU_MEMORY(dduxbl_readmem,dduxbl_writemem)
2250 
2251 	MDRV_MACHINE_INIT(dduxbl)
2252 MACHINE_DRIVER_END
2253 
2254 /***************************************************************************/
2255 // sys16B
2256 
2257 ROM_START( eswat )
2258 	ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* 68000 code - custom CPU 317-0192 */
2259 	ROM_LOAD16_BYTE( "rom-e.bin", 0x000000, 0x40000, CRC(43ca72aa) SHA1(4c6c536f0ef50570992116b50ca816bbc7d42801) )
2260 	ROM_LOAD16_BYTE( "rom-o.bin", 0x000001, 0x40000, CRC(5f018967) SHA1(753cd39bdb51126591b5814d54bb57ed1f77cf22) )
2261 
2262 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2263 	ROM_LOAD( "scr-0.bin", 0x00000, 0x20000, CRC(12f898db) SHA1(f5848a52d75d6204c6b9687fa9146aaec2d56097) )
2264 	ROM_LOAD( "scr-1.bin", 0x20000, 0x20000, CRC(339746d0) SHA1(084a567d5b747c2fc085c5033f56407d6b46faef) )
2265 	ROM_LOAD( "scr-2.bin", 0x40000, 0x20000, CRC(33cf7a55) SHA1(405ed634c393f42544c1fe39c9cfd372f08c3fac) )
2266 
2267 	ROM_REGION( 0xc0000, REGION_GFX2, 0 ) /* sprites */
2268 	ROM_LOAD16_BYTE( "obj0-o.bin", 0x000001, 0x20000, CRC(2ff5cb9e) SHA1(2468a928515640e1bdd651aaadcbc918661c3312) )
2269 	ROM_LOAD16_BYTE( "obj0-e.bin", 0x000000, 0x20000, CRC(10a27526) SHA1(8299d4888d5d7530d864d7e33f264efe66272b44) )
2270 	ROM_LOAD16_BYTE( "obj1-o.bin", 0x040001, 0x20000, CRC(01b2e832) SHA1(6b7aa350498c54a9fac54fee1e65fcada4284fd6) )
2271 	ROM_LOAD16_BYTE( "obj1-e.bin", 0x040000, 0x20000, CRC(ba3ba6fd) SHA1(799e9899630d417fc508af22e04c7c2526a88ee1) )
2272 	ROM_LOAD16_BYTE( "obj2-o.bin", 0x060001, 0x20000, CRC(d12ef57a) SHA1(e0d6d350ce20d84f12df3ab777b9aaa40b906339) )
2273 	ROM_LOAD16_BYTE( "obj2-e.bin", 0x060000, 0x20000, CRC(54b51ca4) SHA1(2f477885500ac4c0875ae956d574334332e225b6) )
2274 
2275 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
2276 	ROM_LOAD( "s-prog.bin",  0x00000, 0x08000, CRC(7efecf23) SHA1(2b87af7cfaab5942a3f7b38c987fcba01d3475ab) )
2277 	ROM_LOAD( "sound-0.bin",0x10000, 0x20000, CRC(f451705e) SHA1(2b3d1b3ffbc6ba2285c4141e6fd3447252a31c8b) )
2278 ROM_END
2279 
2280 ROM_START( eswatbl )
2281 	ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* 68000 code */
2282 	ROM_LOAD16_BYTE( "eswat_c.rom", 0x000000, 0x10000, CRC(1028cc81) SHA1(24b4cd182419a44f3d6afa1c4273353024eb278f) )
2283 	ROM_LOAD16_BYTE( "eswat_f.rom", 0x000001, 0x10000, CRC(f7b2d388) SHA1(8131ba8f4fa01751b9993c3c6c218c9bd3adb328) )
2284 	ROM_LOAD16_BYTE( "eswat_b.rom", 0x020000, 0x10000, CRC(87c6b1b5) SHA1(a9f29e29a9c0e3daf272dce263a5fd7866642c77) )
2285 	ROM_LOAD16_BYTE( "eswat_e.rom", 0x020001, 0x10000, CRC(937ddf9a) SHA1(9fc73f93e9c4221a4dc778593edc02cb405b2f78) )
2286 	ROM_LOAD16_BYTE( "eswat_a.rom", 0x040000, 0x08000, CRC(2af4fc62) SHA1(f7b1539a5ab9560bd49dfecf44699abccfb649be) )
2287 	ROM_LOAD16_BYTE( "eswat_d.rom", 0x040001, 0x08000, CRC(b4751e19) SHA1(57c9687dc864c163d13dbb89057cd42684a199cd) )
2288 
2289 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2290 	ROM_LOAD( "ic19.bin", 0x00000, 0x40000, CRC(375a5ec4) SHA1(42b9116bdc0e0a5b1dd667ac1856b4c2252829ba) )
2291 	ROM_LOAD( "ic20.bin", 0x40000, 0x40000, CRC(3b8c757e) SHA1(0b66e8446d059a12e47e2a6fe8f0a333245bb95c) )
2292 	ROM_LOAD( "ic21.bin", 0x80000, 0x40000, CRC(3efca25c) SHA1(0d866bf53a16b52719f73081e933f4db27d72ece) )
2293 
2294 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
2295 	ROM_LOAD16_BYTE( "ic9.bin",  0x000001, 0x040000, CRC(0d1530bf) SHA1(bb8626cd98761c1c20cee117d00315c85621ba6a) )
2296 	ROM_LOAD16_BYTE( "ic12.bin", 0x000000, 0x040000, CRC(18ff0799) SHA1(5417223378aef16ee2b4f438d1f8f11a23fe7265) )
2297 	ROM_LOAD16_BYTE( "ic10.bin", 0x080001, 0x040000, CRC(32069246) SHA1(4913009bc72bf4f8b171b14fe06457f5784cab15) )
2298 	ROM_LOAD16_BYTE( "ic13.bin", 0x080000, 0x040000, CRC(a3dfe436) SHA1(640ccc552114d403f35d441574d2f3e4f1d4a8f9) )
2299 	ROM_LOAD16_BYTE( "ic11.bin", 0x100001, 0x040000, CRC(f6b096e0) SHA1(695ad1adbdc29f4d614645867e16de038cf92709) )
2300 	ROM_LOAD16_BYTE( "ic14.bin", 0x100000, 0x040000, CRC(6773fef6) SHA1(91e646ea447be02254d060daf255d26afe0cc79e) )
2301 
2302 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
2303 	ROM_LOAD( "ic8.bin", 0x0000, 0x8000, CRC(7efecf23) SHA1(2b87af7cfaab5942a3f7b38c987fcba01d3475ab) )
2304 	ROM_LOAD( "ic6.bin", 0x10000, 0x40000, CRC(254347c2) SHA1(bf2d83a69a5be375c7e42e9f7d6e65c1095a354c) )
2305 ROM_END
2306 /***************************************************************************/
2307 
2308 static READ16_HANDLER( eswatbl_skip_r ){
2309 	if (activecpu_get_pc()==0x65c) {cpu_spinuntil_int(); return 0xffff;}
2310 	return sys16_workingram[0x0454/2];
2311 }
2312 
MEMORY_READ16_START(eswat_readmem)2313 static MEMORY_READ16_START( eswat_readmem )
2314     { 0x000000, 0x07ffff, MRA16_ROM },
2315 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
2316 	{ 0x410000, 0x418fff, SYS16_MRA16_TEXTRAM }, //*
2317 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
2318 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
2319 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
2320 	{ 0xc41006, 0xc41007, input_port_1_word_r },// player2
2321 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
2322 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
2323 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
2324 	{ 0xffc454, 0xffc455, eswatbl_skip_r },
2325 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
2326 MEMORY_END
2327 
2328 static int eswat_tilebank0;
2329 
WRITE16_HANDLER(eswat_tilebank0_w)2330 static WRITE16_HANDLER( eswat_tilebank0_w ){
2331 	if( ACCESSING_LSB ){
2332 		eswat_tilebank0 = data&0xff;
2333 	}
2334 }
2335 
MEMORY_WRITE16_START(eswat_writemem)2336 static MEMORY_WRITE16_START( eswat_writemem )
2337     { 0x000000, 0x07ffff, MWA16_ROM },
2338 	{ 0x3e2000, 0x3e2001, eswat_tilebank0_w },
2339 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
2340 	{ 0x410000, 0x418fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
2341 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
2342 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
2343 	{ 0xc42006, 0xc42007, sound_command_w },
2344 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
2345 	{ 0xc80000, 0xc80001, MWA16_NOP },
2346 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
2347 MEMORY_END
2348 
2349 /***************************************************************************/
2350 
2351 static void eswat_update_proc( void ){
2352 	sys16_fg_scrollx = sys16_textram[0x8008/2] ^ 0xffff;
2353 	sys16_bg_scrollx = sys16_textram[0x8018/2] ^ 0xffff;
2354 	sys16_fg_scrolly = sys16_textram[0x8000/2];
2355 	sys16_bg_scrolly = sys16_textram[0x8010/2];
2356 
2357 	set_fg_page( sys16_textram[0x8020/2] );
2358 	set_bg_page( sys16_textram[0x8028/2] );
2359 
2360 	sys16_tile_bank1 = (sys16_textram[0x8030/2])&0xf;
2361 	sys16_tile_bank0 = eswat_tilebank0;
2362 }
2363 
MACHINE_INIT(eswat)2364 static MACHINE_INIT( eswat ){
2365 	static int bank[] = {
2366 		0,1,	4,5,
2367 		8,9,	12,13,
2368 		2,3,	6,7,
2369 		10,11,	14,15
2370 	};
2371 	sys16_obj_bank = bank;
2372 	sys16_sprxoffset = -0x23c;
2373 
2374 	sys16_patch_code( 0x3897, 0x11 );
2375 
2376 	sys16_update_proc = eswat_update_proc;
2377 }
2378 
DRIVER_INIT(eswat)2379 static DRIVER_INIT( eswat ){
2380 	machine_init_sys16_onetime();
2381 	sys16_rowscroll_scroll=0x8000;
2382 	sys18_splittab_fg_x=&sys16_textram[0x0f80];
2383 }
2384 
2385 /***************************************************************************/
2386 
INPUT_PORTS_START(eswat)2387 INPUT_PORTS_START( eswat )
2388 	SYS16_JOY1
2389 	SYS16_JOY2
2390 	SYS16_SERVICE
2391 	SYS16_COINAGE
2392 
2393 PORT_START	/* DSW1 */
2394 	PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
2395 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2396 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2397 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2398 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2399 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2400 	PORT_DIPNAME( 0x04, 0x04, "Display Flip" )
2401 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2402 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2403 	PORT_DIPNAME( 0x08, 0x08, "Time" )
2404 	PORT_DIPSETTING(    0x08, "Normal" )
2405 	PORT_DIPSETTING(    0x00, "Hard" )
2406 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2407 	PORT_DIPSETTING(    0x20, "Easy" )
2408 	PORT_DIPSETTING(    0x30, "Normal" )
2409 	PORT_DIPSETTING(    0x10, "Hard" )
2410 	PORT_DIPSETTING(    0x00, "Hardest" )
2411 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
2412 	PORT_DIPSETTING(    0x00, "1" )
2413 	PORT_DIPSETTING(    0x40, "2" )
2414 	PORT_DIPSETTING(    0xc0, "3" )
2415 	PORT_DIPSETTING(    0x80, "4" )
2416 INPUT_PORTS_END
2417 
2418 /***************************************************************************/
2419 
2420 static MACHINE_DRIVER_START( eswat )
2421 
2422 	/* basic machine hardware */
2423 	MDRV_IMPORT_FROM(system16_7759)
2424 	MDRV_CPU_MODIFY("main")
2425 	MDRV_CPU_MEMORY(eswat_readmem,eswat_writemem)
2426 
2427 	MDRV_MACHINE_INIT(eswat)
2428 MACHINE_DRIVER_END
2429 
2430 /***************************************************************************/
2431 // sys16A
2432 ROM_START( fantzono )
2433 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
2434 	ROM_LOAD16_BYTE( "7385.43", 0x000000, 0x8000, CRC(5cb64450) SHA1(5831405359975dd7d8c6614b20fd9b18a5d6410d) )
2435 	ROM_LOAD16_BYTE( "7382.26", 0x000001, 0x8000, CRC(3fda7416) SHA1(91f34cc8afb4ad8bc783c31d25781a1359c44cfe) )
2436 	ROM_LOAD16_BYTE( "7386.42", 0x010000, 0x8000, CRC(15810ace) SHA1(e61a258ab6601d359f6ad1f37a2b2801bf777d26) )
2437 	ROM_LOAD16_BYTE( "7383.25", 0x010001, 0x8000, CRC(a001e10a) SHA1(04ebb012b10817db36997d0ee877104d512decf8) )
2438 	ROM_LOAD16_BYTE( "7387.41", 0x020000, 0x8000, CRC(0acd335d) SHA1(f39566a2069eefa7682c57c6521ea7a328738d06) )
2439 	ROM_LOAD16_BYTE( "7384.24", 0x020001, 0x8000, CRC(fd909341) SHA1(2f1e01eb7d7b330c9c0dd98e5f8ed4973f0e93fb) )
2440 
2441 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2442 	ROM_LOAD( "7388.95", 0x00000, 0x08000, CRC(8eb02f6b) SHA1(80511b944b57541669010bd5a0ca52bc98eabd62) )
2443 	ROM_LOAD( "7389.94", 0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
2444 	ROM_LOAD( "7390.93", 0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
2445 
2446 	ROM_REGION( 0x30000, REGION_GFX2, 0 ) /* sprites */
2447 	ROM_LOAD16_BYTE( "7392.10", 0x00001, 0x8000, CRC(5bb7c8b6) SHA1(eaa0ed63ac4f66ee285757e842bdd7b005292600) )
2448 	ROM_LOAD16_BYTE( "7396.11", 0x00000, 0x8000, CRC(74ae4b57) SHA1(1f24b1faea765994b85f0e7ac8e944c8da22103f) )
2449 	ROM_LOAD16_BYTE( "7393.17", 0x10001, 0x8000, CRC(14fc7e82) SHA1(ca7caca989a3577dd30ad4f66b0fcce712a454ef) )
2450 	ROM_LOAD16_BYTE( "7397.18", 0x10000, 0x8000, CRC(e05a1e25) SHA1(9691d9f0763b7483ee6912437902f22ab4b78a05) )
2451 	ROM_LOAD16_BYTE( "7394.23", 0x20001, 0x8000, CRC(531ca13f) SHA1(19e68bc515f6021e1145cff4f3f0e083839ee8f3) )
2452 	ROM_LOAD16_BYTE( "7398.24", 0x20000, 0x8000, CRC(68807b49) SHA1(0a189da8cdd2090e76d6d06c55b478abce60542d) )
2453 
2454 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2455 	ROM_LOAD( "7535.12", 0x0000, 0x8000, CRC(0cb2126a) SHA1(42b18a81bed58ef59eaad929007eef89ad273dbb) )
2456 ROM_END
2457 
2458 ROM_START( fantzone )
2459 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
2460 	ROM_LOAD16_BYTE( "epr7385a.43", 0x000000, 0x8000, CRC(4091af42) SHA1(1d4fdd32db9f75e5ccaab5766a50249ad71a60af) )
2461 	ROM_LOAD16_BYTE( "epr7382a.26", 0x000001, 0x8000, CRC(77d67bfd) SHA1(886ce4c2d779cedd81f85737ef55fce3c94baa18) )
2462 	ROM_LOAD16_BYTE( "epr7386a.42", 0x010000, 0x8000, CRC(b0a67cd0) SHA1(2e2bf2b7306fc567f7d13f89977543b368c19027) )
2463 	ROM_LOAD16_BYTE( "epr7383a.25", 0x010001, 0x8000, CRC(5f79b2a9) SHA1(de3125bbd0a126fc5a67ba3134cd3f4608ebdfce) )
2464 	ROM_LOAD16_BYTE( "7387.41", 0x020000, 0x8000, CRC(0acd335d) SHA1(f39566a2069eefa7682c57c6521ea7a328738d06) )
2465 	ROM_LOAD16_BYTE( "7384.24", 0x020001, 0x8000, CRC(fd909341) SHA1(2f1e01eb7d7b330c9c0dd98e5f8ed4973f0e93fb) )
2466 
2467 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2468 	ROM_LOAD( "7388.95", 0x00000, 0x08000, CRC(8eb02f6b) SHA1(80511b944b57541669010bd5a0ca52bc98eabd62) )
2469 	ROM_LOAD( "7389.94", 0x08000, 0x08000, CRC(2f4f71b8) SHA1(ceb39e95cd43904b8e4f89c7227491e139fb3ca6) )
2470 	ROM_LOAD( "7390.93", 0x10000, 0x08000, CRC(d90609c6) SHA1(4232f6ecb21f242c0c8d81e06b88bc742668609f) )
2471 
2472 	ROM_REGION( 0x30000, REGION_GFX2, 0 ) /* sprites */
2473 	ROM_LOAD16_BYTE( "7392.10", 0x00001, 0x8000, CRC(5bb7c8b6) SHA1(eaa0ed63ac4f66ee285757e842bdd7b005292600) )
2474 	ROM_LOAD16_BYTE( "7396.11", 0x00000, 0x8000, CRC(74ae4b57) SHA1(1f24b1faea765994b85f0e7ac8e944c8da22103f) )
2475 	ROM_LOAD16_BYTE( "7393.17", 0x10001, 0x8000, CRC(14fc7e82) SHA1(ca7caca989a3577dd30ad4f66b0fcce712a454ef) )
2476 	ROM_LOAD16_BYTE( "7397.18", 0x10000, 0x8000, CRC(e05a1e25) SHA1(9691d9f0763b7483ee6912437902f22ab4b78a05) )
2477 	ROM_LOAD16_BYTE( "7394.23", 0x20001, 0x8000, CRC(531ca13f) SHA1(19e68bc515f6021e1145cff4f3f0e083839ee8f3) )
2478 	ROM_LOAD16_BYTE( "7398.24", 0x20000, 0x8000, CRC(68807b49) SHA1(0a189da8cdd2090e76d6d06c55b478abce60542d) )
2479 
2480 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2481 	ROM_LOAD( "epr7535a.12", 0x0000, 0x8000, CRC(bc1374fa) SHA1(ed2c87ae024dc251e175239f1bccc728fc096548) )
2482 ROM_END
2483 
2484 
2485 /***************************************************************************/
2486 
2487 static READ16_HANDLER( fantzone_skip_r ){
2488 	if (activecpu_get_pc()==0x91b2) {cpu_spinuntil_int(); return 0xffff;}
2489 	return sys16_workingram[0x022a/2];
2490 }
2491 
MEMORY_READ16_START(fantzono_readmem)2492 static MEMORY_READ16_START( fantzono_readmem )
2493     { 0x000000, 0x02ffff, MRA16_ROM },
2494 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
2495 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
2496 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
2497 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
2498 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
2499 	{ 0xc41006, 0xc41007, input_port_1_word_r },// player2
2500 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
2501 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
2502 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
2503 	{ 0xc40000, 0xc40003, SYS16_MRA16_EXTRAM2 },
2504 	{ 0xffc22a, 0xffc22b, fantzone_skip_r },
2505 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
2506 MEMORY_END
2507 
2508 static MEMORY_WRITE16_START( fantzono_writemem )
2509     { 0x000000, 0x02ffff, MWA16_ROM },
2510 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
2511 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
2512 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
2513 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
2514 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
2515 	{ 0xc40000, 0xc40003, SYS16_MWA16_EXTRAM2, &sys16_extraram2 },
2516 	{ 0xc60000, 0xc60003, MWA16_NOP },
2517 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
2518 MEMORY_END
2519 
2520 static MEMORY_READ16_START( fantzone_readmem )
2521     { 0x000000, 0x02ffff, MRA16_ROM },
2522 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
2523 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
2524 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
2525 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
2526 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
2527 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
2528 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
2529 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
2530 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
2531 	{ 0xffc22a, 0xffc22b, fantzone_skip_r },
2532 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
2533 MEMORY_END
2534 
2535 static MEMORY_WRITE16_START( fantzone_writemem )
2536     { 0x000000, 0x02ffff, MWA16_ROM },
2537 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
2538 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
2539 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
2540 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
2541 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
2542 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
2543 	{ 0xc60000, 0xc60003, MWA16_NOP },
2544 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
2545 MEMORY_END
2546 
2547 /***************************************************************************/
2548 
2549 static void fantzone_update_proc( void ){
2550 	set_bg_page1( sys16_textram[0x74e] );
2551 	set_fg_page1( sys16_textram[0x74f] );
2552 	sys16_fg_scrollx = sys16_textram[0x7fc] & 0x01ff;
2553 	sys16_bg_scrollx = sys16_textram[0x7fd] & 0x01ff;
2554 	sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
2555 	sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
2556 }
2557 
MACHINE_INIT(fantzono)2558 static MACHINE_INIT( fantzono ){
2559 	sys16_textmode=1;
2560 	sys16_spritesystem = sys16_sprite_fantzone;
2561 	sys16_sprxoffset = -0xbe;
2562 //	sys16_fgxoffset = sys16_bgxoffset = 8;
2563 	sys16_fg_priority_mode=3;				// fixes end of game priority
2564 	sys16_fg_priority_value=0xd000;
2565 
2566 	sys16_patch_code( 0x20e7, 0x16 );
2567 	sys16_patch_code( 0x30ef, 0x16 );
2568 
2569 	// solving Fantasy Zone scrolling bug
2570 	sys16_patch_code(0x308f,0x00);
2571 
2572 	// invincible
2573 /*	sys16_patch_code(0x224e,0x4e);
2574 	sys16_patch_code(0x224f,0x71);
2575 	sys16_patch_code(0x2250,0x4e);
2576 	sys16_patch_code(0x2251,0x71);
2577 
2578 	sys16_patch_code(0x2666,0x4e);
2579 	sys16_patch_code(0x2667,0x71);
2580 	sys16_patch_code(0x2668,0x4e);
2581 	sys16_patch_code(0x2669,0x71);
2582 
2583 	sys16_patch_code(0x25c0,0x4e);
2584 	sys16_patch_code(0x25c1,0x71);
2585 	sys16_patch_code(0x25c2,0x4e);
2586 	sys16_patch_code(0x25c3,0x71);
2587 */
2588 
2589 	sys16_update_proc = fantzone_update_proc;
2590 }
2591 
MACHINE_INIT(fantzone)2592 static MACHINE_INIT( fantzone ){
2593 	sys16_textmode=1;
2594 	sys16_spritesystem = sys16_sprite_fantzone;
2595 	sys16_sprxoffset = -0xbe;
2596 	sys16_fg_priority_mode=3;				// fixes end of game priority
2597 	sys16_fg_priority_value=0xd000;
2598 
2599 	sys16_patch_code( 0x2135, 0x16 );
2600 	sys16_patch_code( 0x3649, 0x16 );
2601 
2602 	// hack? solving Fantasy Zone scrolling bug
2603 	sys16_patch_code(0x35e9,0x00);
2604 
2605 	sys16_update_proc = fantzone_update_proc;
2606 }
2607 
DRIVER_INIT(fantzone)2608 static DRIVER_INIT( fantzone )
2609 {
2610 	machine_init_sys16_onetime();
2611 }
2612 /***************************************************************************/
2613 
INPUT_PORTS_START(fantzone)2614 INPUT_PORTS_START( fantzone )
2615 	SYS16_JOY1
2616 	SYS16_JOY2
2617 	SYS16_SERVICE
2618 	SYS16_COINAGE
2619 
2620 PORT_START	/* DSW1 */
2621 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
2622 	PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
2623 	PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
2624 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2625 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2626 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2627 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
2628 	PORT_DIPSETTING(    0x08, "2" )
2629 	PORT_DIPSETTING(    0x0c, "3" )
2630 	PORT_DIPSETTING(    0x04, "4" )
2631 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "240", IP_KEY_NONE, IP_JOY_NONE )
2632 	PORT_DIPNAME( 0x30, 0x30, "Extra Ship Cost" )
2633 	PORT_DIPSETTING(    0x30, "5000" )
2634 	PORT_DIPSETTING(    0x20, "10000" )
2635 	PORT_DIPSETTING(    0x10, "15000" )
2636 	PORT_DIPSETTING(    0x00, "20000" )
2637 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
2638 	PORT_DIPSETTING(    0x80, "Easy" )
2639 	PORT_DIPSETTING(    0xc0, "Normal" )
2640 	PORT_DIPSETTING(    0x40, "Hard" )
2641 	PORT_DIPSETTING(    0x00, "Hardest" )
2642 
2643 INPUT_PORTS_END
2644 
2645 /***************************************************************************/
2646 
2647 static MACHINE_DRIVER_START( fantzono )
2648 
2649 	/* basic machine hardware */
2650 	MDRV_IMPORT_FROM(system16)
2651 	MDRV_CPU_MODIFY("main")
2652 	MDRV_CPU_MEMORY(fantzono_readmem,fantzono_writemem)
2653 
2654 	MDRV_MACHINE_INIT(fantzono)
2655 MACHINE_DRIVER_END
2656 
2657 
2658 static MACHINE_DRIVER_START( fantzone )
2659 
2660 	/* basic machine hardware */
2661 	MDRV_IMPORT_FROM(system16)
2662 	MDRV_CPU_MODIFY("main")
2663 	MDRV_CPU_MEMORY(fantzone_readmem,fantzone_writemem)
2664 
2665 	MDRV_MACHINE_INIT(fantzone)
2666 MACHINE_DRIVER_END
2667 
2668 /***************************************************************************/
2669 // sys16B
2670 ROM_START( fpoint )
2671 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
2672 	ROM_LOAD16_BYTE( "12591b.bin", 0x000000, 0x10000, CRC(248b3e1b) SHA1(b473c2a057a61896596ac4761e875d72c4f91529) )
2673 	ROM_LOAD16_BYTE( "12590b.bin", 0x000001, 0x10000, CRC(75256e3d) SHA1(87a7d9952f29e49958c135906ac2fd19bdc29b67) )
2674 
2675 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2676 	ROM_LOAD( "12595.bin", 0x00000, 0x10000, CRC(5b18d60b) SHA1(8e9c81635dcefa52d1cf53c2937ae560191b5202) )
2677 	ROM_LOAD( "12594.bin", 0x10000, 0x10000, CRC(8bfc4815) SHA1(08d28b65e5024c592a9a289b270774ef5c553cbf) )
2678 	ROM_LOAD( "12593.bin", 0x20000, 0x10000, CRC(cc0582d8) SHA1(92c7d125a6dcb9c5e6e7bd92a5bf3008385ed487) )
2679 
2680 	ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* sprites */
2681 	ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x10000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2682 	ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x10000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
2683 
2684 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2685 	ROM_LOAD( "12592.bin", 0x0000, 0x8000, CRC(9a8c11bb) SHA1(399f8e9bdd7aaa4d25817fa9cd4bbf413e5baebe) )
2686 ROM_END
2687 
2688 ROM_START( fpointbl )
2689 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
2690 	ROM_LOAD16_BYTE( "flpoint.003", 0x000000, 0x10000, CRC(4d6df514) SHA1(168aa1629ab7152ba1984605155406b236954a2c) )
2691 	ROM_LOAD16_BYTE( "flpoint.002", 0x000001, 0x10000, CRC(4dff2ee8) SHA1(bd157d8c168d45e7490a05d5e1e901d9bdda9599) )
2692 
2693 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2694 	ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2695 	ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2696 	ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
2697 
2698 	ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* sprites */
2699 	ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2700 	ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
2701 
2702 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2703 	ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )	// bootleg rom doesn't work, but should be correct!
2704 ROM_END
2705 
2706 
2707 
2708 ROM_START( fpointbj )
2709 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
2710 	ROM_LOAD16_BYTE( "boot2.003", 0x000000, 0x10000, CRC(6c00d1b0) SHA1(fd0c47b8ca010a64d3ef91980f93854ebc98fbda) )
2711 	ROM_LOAD16_BYTE( "boot2.002", 0x000001, 0x10000, CRC(c1fcd704) SHA1(697bef464e53fb9891ed15ee2d6210107b693b20) )
2712 
2713 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2714 	ROM_LOAD( "flpoint.006", 0x00000, 0x10000, CRC(c539727d) SHA1(56674effe1d273128dddd2ff9e02974ec10f3fff) )
2715 	ROM_LOAD( "flpoint.005", 0x10000, 0x10000, CRC(82c0b8b0) SHA1(e1e2e721cb8ad53df33065582dc90edeba9c3cab) )
2716 	ROM_LOAD( "flpoint.004", 0x20000, 0x10000, CRC(522426ae) SHA1(90fd0a19b30a8a61dc4cfa66a64115596333dcc6) )
2717 
2718 	ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* sprites */
2719 	ROM_LOAD16_BYTE( "12596.bin", 0x00001, 0x010000, CRC(4a4041f3) SHA1(4c52b30223d8aa80ccdbb196098cb17e64ad6583) )
2720 	ROM_LOAD16_BYTE( "12597.bin", 0x00000, 0x010000, CRC(6961e676) SHA1(7639d2da086b57a9a8d6100fdacf40d97d7c4772) )
2721 
2722 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
2723 	ROM_LOAD( "flpoint.001", 0x0000, 0x8000, CRC(c5b8e0fe) SHA1(6cf8c67151d8604326fc6dbf976c0635b452a844) )	// bootleg rom doesn't work, but should be correct!
2724 
2725 	/* stuff below isn't used but loaded because it was on the board .. */
2726 	ROM_REGION( 0x0120, REGION_PROMS, 0 )
2727 	ROM_LOAD( "82s129.1",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
2728 	ROM_LOAD( "82s123.2",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
2729 
2730 	ROM_REGION( 0x800, REGION_USER1, 0 )
2731 	ROM_LOAD( "d2716.rom",  0x0000, 0x0800, CRC(d7fd8ac4) SHA1(87e5f1c24350adab129ad79a1f68af402580f8f0) )
2732 ROM_END
2733 
2734 /***************************************************************************/
2735 
2736 static READ16_HANDLER( fp_io_service_dummy_r ){
2737 	int data = readinputport( 2 ) & 0xff;
2738 	return (data << 8) + data;
2739 }
2740 
MEMORY_READ16_START(fpoint_readmem)2741 static MEMORY_READ16_START( fpoint_readmem )
2742     { 0x000000, 0x01ffff, MRA16_ROM },
2743 	{ 0x02002e, 0x020049, fp_io_service_dummy_r },
2744 	{ 0x601002, 0x601003, input_port_0_word_r }, // player1
2745 	{ 0x601004, 0x601005, input_port_1_word_r }, // player2
2746 	{ 0x601000, 0x601001, input_port_2_word_r }, // service
2747 	{ 0x600000, 0x600001, input_port_4_word_r }, // dip2
2748 	{ 0x600002, 0x600003, input_port_3_word_r }, // dip1
2749 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
2750 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
2751 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
2752 	{ 0x44302a, 0x44304d, fp_io_service_dummy_r },
2753 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
2754 	{ 0xfe003e, 0xfe003f, fp_io_service_dummy_r },
2755 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
2756 MEMORY_END
2757 
2758 static MEMORY_WRITE16_START( fpoint_writemem )
2759     { 0x000000, 0x01ffff, MWA16_ROM },
2760 	{ 0x600006, 0x600007, sound_command_w },
2761 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
2762 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
2763 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
2764 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
2765 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
2766 MEMORY_END
2767 
2768 /***************************************************************************/
2769 
2770 static void fpoint_update_proc( void ){
2771 	set_fg_page( sys16_textram[0x740] );
2772 	set_bg_page( sys16_textram[0x741] );
2773 	sys16_fg_scrolly = sys16_textram[0x748];
2774 	sys16_bg_scrolly = sys16_textram[0x749];
2775 	sys16_fg_scrollx = sys16_textram[0x74c];
2776 	sys16_bg_scrollx = sys16_textram[0x74d];
2777 }
2778 
MACHINE_INIT(fpoint)2779 static MACHINE_INIT( fpoint ){
2780 
2781 	sys16_patch_code( 0x454, 0x33 );
2782 	sys16_patch_code( 0x455, 0xf8 );
2783 	sys16_patch_code( 0x456, 0xe0 );
2784 	sys16_patch_code( 0x457, 0xe2 );
2785 	sys16_patch_code( 0x8ce8, 0x16 );
2786 	sys16_patch_code( 0x8ce9, 0x66 );
2787 	sys16_patch_code( 0x17687, 0x00 );
2788 	sys16_patch_code( 0x7bed, 0x04 );
2789 
2790 	sys16_patch_code( 0x7ea8, 0x61 );
2791 	sys16_patch_code( 0x7ea9, 0x00 );
2792 	sys16_patch_code( 0x7eaa, 0x84 );
2793 	sys16_patch_code( 0x7eab, 0x16 );
2794 	sys16_patch_code( 0x2c0, 0xe7 );
2795 	sys16_patch_code( 0x2c1, 0x48 );
2796 	sys16_patch_code( 0x2c2, 0xe7 );
2797 	sys16_patch_code( 0x2c3, 0x49 );
2798 	sys16_patch_code( 0x2c4, 0x04 );
2799 	sys16_patch_code( 0x2c5, 0x40 );
2800 	sys16_patch_code( 0x2c6, 0x00 );
2801 	sys16_patch_code( 0x2c7, 0x10 );
2802 	sys16_patch_code( 0x2c8, 0x4e );
2803 	sys16_patch_code( 0x2c9, 0x75 );
2804 
2805 	sys16_update_proc = fpoint_update_proc;
2806 }
2807 
DRIVER_INIT(fpoint)2808 static DRIVER_INIT( fpoint ){
2809 	machine_init_sys16_onetime();
2810 }
2811 
DRIVER_INIT(fpointbl)2812 static DRIVER_INIT( fpointbl ){
2813 	int i;
2814 
2815 	machine_init_sys16_onetime();
2816 
2817 	/* invert the graphics bits on the tiles */
2818 	for (i = 0; i < 0x30000; i++)
2819 		memory_region(REGION_GFX1)[i] ^= 0xff;
2820 }
2821 /***************************************************************************/
2822 
INPUT_PORTS_START(fpoint)2823 INPUT_PORTS_START( fpoint )
2824 PORT_START
2825 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
2826 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
2827 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
2828 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2829 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
2830 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
2831 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
2832 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
2833 
2834 PORT_START
2835 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
2836 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
2837 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
2838 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2839 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
2840 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
2841 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
2842 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
2843 
2844 	SYS16_SERVICE
2845 	SYS16_COINAGE
2846 
2847 PORT_START	/* DSW1 */
2848 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
2849 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2850 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2851 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2852 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2853 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2854 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
2855 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2856 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2857 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
2858 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2859 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2860 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2861 	PORT_DIPSETTING(    0x20, "Easy" )
2862 	PORT_DIPSETTING(    0x30, "Normal" )
2863 	PORT_DIPSETTING(    0x10, "Hard" )
2864 	PORT_DIPSETTING(    0x00, "Hardest" )
2865 	PORT_DIPNAME( 0x40, 0x40, "Clear round allowed" ) /* Use button 3 */
2866 	PORT_DIPSETTING(    0x00, "1" )
2867 	PORT_DIPSETTING(    0x40, "2" )
2868 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2869 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2870 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2871 
2872 INPUT_PORTS_END
2873 
2874 INPUT_PORTS_START( fpointbj )
2875 	PORT_START
2876 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
2877 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
2878 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
2879 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2880 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
2881 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
2882 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
2883 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
2884 
2885 	PORT_START
2886 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
2887 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
2888 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
2889 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2890 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
2891 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
2892 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
2893 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
2894 
2895 	SYS16_SERVICE
2896 	SYS16_COINAGE
2897 
2898 	PORT_START	/* DSW1 */
2899 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* not used according to manual */
2900 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2901 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2902 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2903 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2904 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2905 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* not used according to manual */
2906 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2907 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2908 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* not used according to manual */
2909 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2910 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2911 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
2912 	PORT_DIPSETTING(    0x20, "Easy" )
2913 	PORT_DIPSETTING(    0x30, "Normal" )
2914 	PORT_DIPSETTING(    0x10, "Hard" )
2915 	PORT_DIPSETTING(    0x00, "Hardest" )
2916 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) /* not used according to manual */
2917 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2918 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2919 	PORT_DIPNAME( 0x80, 0x80, "2 Cell Move Mode" )
2920 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2921 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2922 
2923 INPUT_PORTS_END
2924 
2925 /***************************************************************************/
2926 
2927 static MACHINE_DRIVER_START( fpoint )
2928 
2929 	/* basic machine hardware */
2930 	MDRV_IMPORT_FROM(system16)
2931 	MDRV_CPU_MODIFY("main")
2932 	MDRV_CPU_MEMORY(fpoint_readmem,fpoint_writemem)
2933 
2934 	MDRV_MACHINE_INIT(fpoint)
2935 MACHINE_DRIVER_END
2936 
2937 /*
2938 	Flash Point (Datsu bootlegs = fpointbl, fpointbj)
2939 	Has sound latch at $E000 instead of I/O ports $C0-FF
2940 */
2941 static MEMORY_READ_START( fpointbl_sound_readmem )
2942     { 0x0000, 0x7fff, MRA_ROM },
2943 	{ 0xe000, 0xe000, soundlatch_r },
2944 	{ 0xf800, 0xffff, MRA_RAM },
2945 MEMORY_END
2946 
2947 static MACHINE_DRIVER_START( fpointbl )
2948 
2949 	/* basic machine hardware */
2950 	MDRV_IMPORT_FROM(system16)
2951 	MDRV_CPU_MODIFY("main")
2952 	MDRV_CPU_MEMORY(fpoint_readmem,fpoint_writemem)
2953 
2954 	MDRV_CPU_MODIFY("sound")
2955 	MDRV_CPU_MEMORY(fpointbl_sound_readmem,sound_writemem)
2956 
2957 	MDRV_MACHINE_INIT(fpoint)
2958 MACHINE_DRIVER_END
2959 
2960 /***************************************************************************/
2961 // sys16B
2962 ROM_START( goldnaxe )
2963 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
2964 	ROM_LOAD16_BYTE( "epr12523.a7", 0x00000, 0x20000, CRC(8e6128d7) SHA1(b8de216f4ca08815ca98d39a773024d191d21b4d) )
2965 	ROM_LOAD16_BYTE( "epr12522.a5", 0x00001, 0x20000, CRC(b6c35160) SHA1(88015d0a486f56911360362c96a82f36a13de886) )
2966 	/* empty 0x40000 - 0x80000 */
2967 	ROM_LOAD16_BYTE( "epr12521.a8", 0x80000, 0x20000, CRC(5001d713) SHA1(68cf3f48d6e440e5b800503a211adda02107d956) )
2968 	ROM_LOAD16_BYTE( "epr12519.a6", 0x80001, 0x20000, CRC(4438ca8e) SHA1(0af53d64f06abf41f4c46540d28d5f008a4835a3) )
2969 
2970 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2971 	ROM_LOAD( "epr12385", 0x00000, 0x20000, CRC(b8a4e7e0) SHA1(9b36f50209d45a835ded53eb045f63c649b02fc9) )
2972 	ROM_LOAD( "epr12386", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
2973 	ROM_LOAD( "epr12387", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
2974 
2975 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
2976 	ROM_LOAD16_BYTE( "mpr12378.b1", 0x000001, 0x40000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
2977 	ROM_LOAD16_BYTE( "mpr12379.b4", 0x000000, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
2978 	ROM_LOAD16_BYTE( "mpr12380.b2", 0x080001, 0x40000, CRC(bb2c0853) SHA1(3f3b546d078f22d787c93ee74d9ad3a6e84383ac) )
2979 	ROM_LOAD16_BYTE( "mpr12381.b5", 0x080000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
2980 	ROM_LOAD16_BYTE( "mpr12382.b3", 0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
2981 	ROM_LOAD16_BYTE( "mpr12383.b6", 0x100000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
2982 
2983 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
2984 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
2985 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
2986 ROM_END
2987 
2988 ROM_START( goldnaxj )
2989 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
2990 // Custom cpu 317-0121
2991 	ROM_LOAD16_BYTE( "epr12540.a7", 0x00000, 0x20000, CRC(0c7ccc6d) SHA1(25bc29eee731befc665472c2c1998cac8447cc21) )
2992 	ROM_LOAD16_BYTE( "epr12539.a5", 0x00001, 0x20000, CRC(1f24f7d0) SHA1(a09cdf394c03069707f7ed400b8fbdc13674fa74) )
2993 	/* emtpy 0x40000 - 0x80000 */
2994 	ROM_LOAD16_BYTE( "epr12521.a8", 0x80000, 0x20000, CRC(5001d713) SHA1(68cf3f48d6e440e5b800503a211adda02107d956) )
2995 	ROM_LOAD16_BYTE( "epr12519.a6", 0x80001, 0x20000, CRC(4438ca8e) SHA1(0af53d64f06abf41f4c46540d28d5f008a4835a3) )
2996 
2997 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2998 	ROM_LOAD( "epr12385", 0x00000, 0x20000, CRC(b8a4e7e0) SHA1(9b36f50209d45a835ded53eb045f63c649b02fc9) )
2999 	ROM_LOAD( "epr12386", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
3000 	ROM_LOAD( "epr12387", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
3001 
3002 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
3003 	ROM_LOAD16_BYTE( "mpr12378.b1", 0x000001, 0x40000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
3004 	ROM_LOAD16_BYTE( "mpr12379.b4", 0x000000, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
3005 	ROM_LOAD16_BYTE( "mpr12380.b2", 0x080001, 0x40000, CRC(bb2c0853) SHA1(3f3b546d078f22d787c93ee74d9ad3a6e84383ac) )
3006 	ROM_LOAD16_BYTE( "mpr12381.b5", 0x080000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
3007 	ROM_LOAD16_BYTE( "mpr12382.b3", 0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
3008 	ROM_LOAD16_BYTE( "mpr12383.b6", 0x100000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
3009 
3010 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3011 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
3012 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
3013 ROM_END
3014 
3015 ROM_START( goldnabl )
3016 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
3017 // protected code
3018 	ROM_LOAD16_BYTE( "ga6.a22", 0x00000, 0x10000, CRC(f95b459f) SHA1(dadf66d63454ed62fefa521d4fed249d28c63778) )
3019 	ROM_LOAD16_BYTE( "ga4.a20", 0x00001, 0x10000, CRC(83eabdf5) SHA1(1effef966f513fbdec2026d535658e17ef7dea51) )
3020 	ROM_LOAD16_BYTE( "ga11.a27",0x20000, 0x10000, CRC(f4ef9349) SHA1(3ffa335e74ffbc10f80387268da659643c566897) )
3021 	ROM_LOAD16_BYTE( "ga8.a24", 0x20001, 0x10000, CRC(37a65839) SHA1(6e8055d91b840afd8526041d3752c0a55eaebe0c) )
3022 	/* emtpy 0x40000 - 0x80000 */
3023 	ROM_LOAD16_BYTE( "epr12521.a8", 0x80000, 0x20000, CRC(5001d713) SHA1(68cf3f48d6e440e5b800503a211adda02107d956) )
3024 	ROM_LOAD16_BYTE( "epr12519.a6", 0x80001, 0x20000, CRC(4438ca8e) SHA1(0af53d64f06abf41f4c46540d28d5f008a4835a3) )
3025 
3026 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3027 	ROM_LOAD( "ga33.b16", 0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
3028 	ROM_LOAD( "ga32.b15", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
3029 	ROM_LOAD( "ga31.b14", 0x20000, 0x10000, CRC(f8b6ae4f) SHA1(55132c98955107e4b247992f7917a6ce588460a7) )
3030 	ROM_LOAD( "ga30.b13", 0x30000, 0x10000, CRC(e29baf4f) SHA1(3761cb2217599fe3f2f860f9395930b96ec52f47) )
3031 	ROM_LOAD( "ga29.b12", 0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
3032 	ROM_LOAD( "ga28.b11", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
3033 
3034 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
3035 	/* wrong! */
3036 	ROM_LOAD16_BYTE( "ga34.b17", 		0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) )
3037 	ROM_LOAD16_BYTE( "ga35.b18", 		0x010000, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) )
3038 	ROM_LOAD16_BYTE( "ga23.a14", 		0x020001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) )
3039 	ROM_LOAD16_BYTE( "ga18.a9",  		0x030000, 0x10000, CRC(de346006) SHA1(65aa489373b6d2cccbb024f13fc190a7cae86274) )
3040 	ROM_LOAD16_BYTE( "mpr12379.b4", 	0x040001, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
3041 	ROM_LOAD16_BYTE( "ga36.b19", 		0x080000, 0x10000, CRC(101d2fff) SHA1(1de1390c5f55f192491053c8aac31be3389aab2b) )
3042 	ROM_LOAD16_BYTE( "ga37.b20", 		0x090001, 0x10000, CRC(677e64a6) SHA1(e3d0d31097017c6cb1a7f41292783f18ce13b41c) )
3043 	ROM_LOAD16_BYTE( "ga19.a10", 		0x0a0000, 0x10000, CRC(11794d05) SHA1(eef52d7a644dbcc5f983222f163445a725286a32) )
3044 	ROM_LOAD16_BYTE( "ga20.a11", 		0x0b0001, 0x10000, CRC(ad1c1c90) SHA1(155f17593cfab1a117bb755b1edd0c473d455f91) )
3045 	ROM_LOAD16_BYTE( "mpr12381.b5",	0x0c0000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
3046 	ROM_LOAD16_BYTE( "mpr12382.b3",	0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
3047 	ROM_LOAD16_BYTE( "mpr12383.b6",	0x140000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
3048 
3049 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3050 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
3051 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
3052 ROM_END
3053 
3054 
3055 /***************************************************************************/
3056 
3057 static READ16_HANDLER( goldnaxe_skip_r ){
3058 	if (activecpu_get_pc()==0x3cb0) {cpu_spinuntil_int(); return 0xffff;}
3059 	return sys16_workingram[0x2c1c/2];
3060 }
3061 
READ16_HANDLER(ga_io_players_r)3062 static READ16_HANDLER( ga_io_players_r ) {
3063 	return (readinputport(0) << 8) | readinputport(1);
3064 }
READ16_HANDLER(ga_io_service_r)3065 static READ16_HANDLER( ga_io_service_r ){
3066 	return (input_port_2_word_r(0,0) << 8) | (sys16_workingram[0x2c96/2] & 0x00ff);
3067 }
3068 
MEMORY_READ16_START(goldnaxe_readmem)3069 static MEMORY_READ16_START( goldnaxe_readmem )
3070     { 0x000000, 0x0bffff, MRA16_ROM },
3071 	{ 0x100000, 0x10ffff, SYS16_MRA16_TILERAM },
3072 	{ 0x110000, 0x110fff, SYS16_MRA16_TEXTRAM },
3073 	{ 0x140000, 0x140fff, SYS16_MRA16_PALETTERAM },
3074 	{ 0x1f0000, 0x1f0003, SYS16_MRA16_EXTRAM },
3075 	{ 0x200000, 0x200fff, SYS16_MRA16_SPRITERAM },
3076 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
3077 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
3078 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
3079 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
3080 	{ 0xc42000, 0xc42001, input_port_4_word_r },// dip2
3081 	{ 0xffecd0, 0xffecd1, ga_io_players_r },
3082 	{ 0xffec96, 0xffec97, ga_io_service_r },
3083 	{ 0xffec1c, 0xffec1d, goldnaxe_skip_r },
3084 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
3085 MEMORY_END
3086 
3087 static WRITE16_HANDLER( ga_sound_command_w ){
3088 	COMBINE_DATA( &sys16_workingram[(0xecfc-0xc000)/2] );
3089 	if( ACCESSING_MSB ){
3090 		soundlatch_w( 0,data>>8 );
3091 		cpu_set_irq_line( 1, 0, HOLD_LINE );
3092 	}
3093 }
3094 
WRITE16_HANDLER(goldnaxe_prot_w)3095 static WRITE16_HANDLER( goldnaxe_prot_w ){
3096 	sys16_workingram[(0xecd8 - 0xc000)/2] = 0x048c;
3097 	sys16_workingram[(0xecda - 0xc000)/2] = 0x159d;
3098 	sys16_workingram[(0xecdc - 0xc000)/2] = 0x26ae;
3099 	sys16_workingram[(0xecde - 0xc000)/2] = 0x37bf;
3100 	COMBINE_DATA( &sys16_workingram[(0xec1c-0xc000)/2] );
3101 }
3102 
MEMORY_WRITE16_START(goldnaxe_writemem)3103 static MEMORY_WRITE16_START( goldnaxe_writemem )
3104     { 0x000000, 0x0bffff, MWA16_ROM },
3105 	{ 0x100000, 0x10ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
3106 	{ 0x110000, 0x110fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
3107 	{ 0x140000, 0x140fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
3108 	{ 0x1f0000, 0x1f0003, SYS16_MWA16_EXTRAM, &sys16_extraram },
3109 	{ 0x200000, 0x200fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
3110 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
3111 	{ 0xc43000, 0xc43001, MWA16_NOP }, // ?
3112 //	{ 0xfe0006, 0xfe0007, MWA16_NOP }, I think this is the real sound out
3113 	{ 0xffec1c, 0xffec1d, goldnaxe_prot_w },// how does this really work?
3114 	{ 0xffecfc, 0xffecfd, ga_sound_command_w },// probably just a buffer
3115 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram }, /* fails SCRATCH RAM test because of hacks */
3116 //	{ 0xfffc00, 0xffffff, MWA16_NOP }, /* 0x400 bytes; battery backed up */
3117 MEMORY_END
3118 
3119 /***************************************************************************/
3120 
3121 static void goldnaxe_update_proc( void ){
3122 	set_fg_page( sys16_textram[0x740] );
3123 	set_bg_page( sys16_textram[0x741] );
3124 	sys16_fg_scrolly = sys16_textram[0x748];
3125 	sys16_bg_scrolly = sys16_textram[0x749];
3126 	sys16_fg_scrollx = sys16_textram[0x74c];
3127 	sys16_bg_scrollx = sys16_textram[0x74d];
3128 
3129 	set_tile_bank( sys16_workingram[0x2c94/2] );
3130 }
3131 
MACHINE_INIT(goldnaxe)3132 static MACHINE_INIT( goldnaxe ){
3133 	static int bank[16] = {
3134 		0,1,4,5,
3135 		8,9,0,0,
3136 		2,3,6,7,
3137 		10,11,0,0
3138 	};
3139 	sys16_obj_bank = bank;
3140 
3141 // protection patch; no longer needed
3142 //	sys16_patch_code( 0x3CB2, 0x60 );
3143 //	sys16_patch_code( 0x3CB3, 0x1e );
3144 
3145 	sys16_sprxoffset = -0xb8;
3146 	sys16_update_proc = goldnaxe_update_proc;
3147 }
3148 
DRIVER_INIT(goldnaxe)3149 static DRIVER_INIT( goldnaxe ){
3150 	machine_init_sys16_onetime();
3151 }
3152 
DRIVER_INIT(goldnabl)3153 static DRIVER_INIT( goldnabl ){
3154 	int i;
3155 
3156 	machine_init_sys16_onetime();
3157 
3158 	/* invert the graphics bits on the tiles */
3159 	for (i = 0; i < 0x60000; i++)
3160 		memory_region(REGION_GFX1)[i] ^= 0xff;
3161 }
3162 
3163 /***************************************************************************/
3164 
INPUT_PORTS_START(goldnaxe)3165 INPUT_PORTS_START( goldnaxe )
3166 	SYS16_JOY1
3167 	SYS16_JOY2
3168 	SYS16_SERVICE
3169 	SYS16_COINAGE
3170 
3171 PORT_START	/* DSW1 */
3172 	PORT_DIPNAME( 0x01, 0x01, "Credits needed" )
3173 	PORT_DIPSETTING(    0x01, "1 to start, 1 to continue" )
3174 	PORT_DIPSETTING(    0x00, "2 to start, 1 to continue" )
3175 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
3176 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3177 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3178 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
3179 	PORT_DIPSETTING(    0x08, "1" )
3180 	PORT_DIPSETTING(    0x0c, "2" )
3181 	PORT_DIPSETTING(    0x04, "3" )
3182 	PORT_DIPSETTING(    0x00, "5" )
3183 	PORT_DIPNAME( 0x30, 0x30, "Energy Meter" )
3184 	PORT_DIPSETTING(    0x20, "2" )
3185 	PORT_DIPSETTING(    0x30, "3" )
3186 	PORT_DIPSETTING(    0x10, "4" )
3187 	PORT_DIPSETTING(    0x00, "5" )
3188 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
3189 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3190 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3191 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3192 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3193 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3194 INPUT_PORTS_END
3195 
3196 /***************************************************************************/
3197 
3198 static MACHINE_DRIVER_START( goldnaxe )
3199 
3200 	/* basic machine hardware */
3201 	MDRV_IMPORT_FROM(system16_7759)
3202 	MDRV_CPU_MODIFY("main")
3203 	MDRV_CPU_MEMORY(goldnaxe_readmem,goldnaxe_writemem)
3204 
3205 	MDRV_MACHINE_INIT(goldnaxe)
3206 MACHINE_DRIVER_END
3207 
3208 /***************************************************************************/
3209 // sys16B
3210 ROM_START( goldnaxa )
3211 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
3212 	ROM_LOAD16_BYTE( "epr12545.a2", 0x00000, 0x40000, CRC(a97c4e4d) SHA1(41cda15ae56185725233db669d9f8c4a8c1eb1c3) )
3213 	ROM_LOAD16_BYTE( "epr12544.a1", 0x00001, 0x40000, CRC(5e38f668) SHA1(3b15a9a30adde6e852c439c8e6e45875b66252cb) )
3214 
3215 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3216 	ROM_LOAD( "epr12385", 0x00000, 0x20000, CRC(b8a4e7e0) SHA1(9b36f50209d45a835ded53eb045f63c649b02fc9) )
3217 	ROM_LOAD( "epr12386", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
3218 	ROM_LOAD( "epr12387", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
3219 
3220 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
3221 	ROM_LOAD16_BYTE( "mpr12378.b1", 0x000001, 0x40000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
3222 	ROM_LOAD16_BYTE( "mpr12379.b4", 0x000000, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
3223 	ROM_LOAD16_BYTE( "mpr12380.b2", 0x080001, 0x40000, CRC(bb2c0853) SHA1(3f3b546d078f22d787c93ee74d9ad3a6e84383ac) )
3224 	ROM_LOAD16_BYTE( "mpr12381.b5", 0x080000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
3225 	ROM_LOAD16_BYTE( "mpr12382.b3", 0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
3226 	ROM_LOAD16_BYTE( "mpr12383.b6", 0x100000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
3227 
3228 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3229 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
3230 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
3231 ROM_END
3232 
3233 ROM_START( goldnaxb )
3234 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
3235 // Custom 68000 ver 317-0110
3236 	ROM_LOAD16_BYTE( "epr12389.a2", 0x00000, 0x40000, CRC(35d5fa77) SHA1(b16b312eb1c91c412fee61002599812e30e321ee) )
3237 	ROM_LOAD16_BYTE( "epr12388.a1", 0x00001, 0x40000, CRC(72952a93) SHA1(b31888429ad81388a96333dc0b2c7e2223134834) )
3238 
3239 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3240 	ROM_LOAD( "epr12385", 0x00000, 0x20000, CRC(b8a4e7e0) SHA1(9b36f50209d45a835ded53eb045f63c649b02fc9) )
3241 	ROM_LOAD( "epr12386", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
3242 	ROM_LOAD( "epr12387", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
3243 
3244 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
3245 	ROM_LOAD16_BYTE( "mpr12378.b1", 0x000001, 0x40000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
3246 	ROM_LOAD16_BYTE( "mpr12379.b4", 0x000000, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
3247 	ROM_LOAD16_BYTE( "mpr12380.b2", 0x080001, 0x40000, CRC(bb2c0853) SHA1(3f3b546d078f22d787c93ee74d9ad3a6e84383ac) )
3248 	ROM_LOAD16_BYTE( "mpr12381.b5", 0x080000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
3249 	ROM_LOAD16_BYTE( "mpr12382.b3", 0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
3250 	ROM_LOAD16_BYTE( "mpr12383.b6", 0x100000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
3251 
3252 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3253 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
3254 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
3255 ROM_END
3256 
3257 ROM_START( goldnaxc )
3258 	ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
3259 // Custom 68000 ver 317-0122
3260 	ROM_LOAD16_BYTE( "epr12543.a2", 0x00000, 0x40000, CRC(b0df9ca4) SHA1(240f3c2998f969569d992f796e006f5ea4434e55) )
3261 	ROM_LOAD16_BYTE( "epr12542.a1", 0x00001, 0x40000, CRC(b7994d3c) SHA1(87570f23826922fca465c69df6b892c59f14e103) )
3262 
3263 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3264 	ROM_LOAD( "epr12385", 0x00000, 0x20000, CRC(b8a4e7e0) SHA1(9b36f50209d45a835ded53eb045f63c649b02fc9) )
3265 	ROM_LOAD( "epr12386", 0x20000, 0x20000, CRC(25d7d779) SHA1(2de14a76a5176d5abc7e7f7f723146c620927610) )
3266 	ROM_LOAD( "epr12387", 0x40000, 0x20000, CRC(c7fcadf3) SHA1(5f0fd600a75a02749935af21e1e0d2c714c6417e) )
3267 
3268 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
3269 	ROM_LOAD16_BYTE( "mpr12378.b1", 0x000001, 0x40000, CRC(119e5a82) SHA1(261ed2bc4ebac7142e2ecca9f03c91242e792a98) )
3270 	ROM_LOAD16_BYTE( "mpr12379.b4", 0x000000, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
3271 	ROM_LOAD16_BYTE( "mpr12380.b2", 0x080001, 0x40000, CRC(bb2c0853) SHA1(3f3b546d078f22d787c93ee74d9ad3a6e84383ac) )
3272 	ROM_LOAD16_BYTE( "mpr12381.b5", 0x080000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
3273 	ROM_LOAD16_BYTE( "mpr12382.b3", 0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
3274 	ROM_LOAD16_BYTE( "mpr12383.b6", 0x100000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
3275 
3276 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3277 	ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
3278 	ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
3279 ROM_END
3280 
3281 
3282 /***************************************************************************/
3283 
3284 static READ16_HANDLER( goldnaxa_skip_r ){
3285 	if (activecpu_get_pc()==0x3ca0) {cpu_spinuntil_int(); return 0xffff;}
3286 	return sys16_workingram[0x2c1c/2];
3287 }
3288 
3289 // This version has somekind of hardware comparitor for collision detection,
3290 // and a hardware multiplier.
3291 static data16_t ga_hardware_collision_data[5];
WRITE16_HANDLER(ga_hardware_collision_w)3292 static WRITE16_HANDLER( ga_hardware_collision_w )
3293 {
3294 	static int bit=1;
3295 //TBA
3296 //	COMBINE_DATA( &ga_hardware_collision_data );
3297 	if( offset==4/2 ){
3298 		if( ga_hardware_collision_data[2] <= ga_hardware_collision_data[0] &&
3299 			ga_hardware_collision_data[2] >= ga_hardware_collision_data[1])
3300 		{
3301 			ga_hardware_collision_data[4] |=bit;
3302 		}
3303 		bit=bit<<1;
3304 	}
3305 	else if( offset==8/2 ) bit=1;
3306 }
3307 
READ16_HANDLER(ga_hardware_collision_r)3308 static READ16_HANDLER( ga_hardware_collision_r ){
3309 	return ga_hardware_collision_data[4];
3310 }
3311 
3312 static int ga_hardware_multiplier_data[4];
WRITE16_HANDLER(ga_hardware_multiplier_w)3313 static WRITE16_HANDLER( ga_hardware_multiplier_w ){
3314 //TBA
3315 //	COMBINE_DATA( &ga_hardware_multiplier_data );
3316 }
3317 
READ16_HANDLER(ga_hardware_multiplier_r)3318 static READ16_HANDLER( ga_hardware_multiplier_r ){
3319 	if(offset==6/2)
3320 		return ga_hardware_multiplier_data[0] * ga_hardware_multiplier_data[1];
3321 	else
3322 		return ga_hardware_multiplier_data[offset];
3323 }
3324 
MEMORY_READ16_START(goldnaxa_readmem)3325 static MEMORY_READ16_START( goldnaxa_readmem )
3326     { 0x000000, 0x07ffff, MRA16_ROM },
3327 	{ 0x100000, 0x10ffff, SYS16_MRA16_TILERAM },
3328 	{ 0x110000, 0x110fff, SYS16_MRA16_TEXTRAM },
3329 	{ 0x140000, 0x140fff, SYS16_MRA16_PALETTERAM },
3330 	{ 0x1e0008, 0x1e0009, ga_hardware_collision_r },
3331 	{ 0x1f0000, 0x1f0007, ga_hardware_multiplier_r },
3332 	{ 0x1f1008, 0x1f1009, ga_hardware_collision_r },
3333 	{ 0x1f2000, 0x1f2003, SYS16_MRA16_EXTRAM },
3334 	{ 0x200000, 0x200fff, SYS16_MRA16_SPRITERAM },
3335 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
3336 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
3337 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
3338 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
3339 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
3340 	{ 0xffecd0, 0xffecd1, ga_io_players_r },
3341 	{ 0xffec96, 0xffec97, ga_io_service_r },
3342 	{ 0xffec1c, 0xffec1d, goldnaxa_skip_r },
3343 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
3344 MEMORY_END
3345 
3346 static MEMORY_WRITE16_START( goldnaxa_writemem )
3347     { 0x000000, 0x07ffff, MWA16_ROM },
3348 	{ 0x100000, 0x10ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
3349 	{ 0x110000, 0x110fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
3350 	{ 0x140000, 0x140fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
3351 	{ 0x1e0000, 0x1e0009, ga_hardware_collision_w },
3352 	{ 0x1f0000, 0x1f0003, ga_hardware_multiplier_w },
3353 	{ 0x1f1000, 0x1f1009, ga_hardware_collision_w },
3354 	{ 0x1f2000, 0x1f2003, SYS16_MWA16_EXTRAM, &sys16_extraram },
3355 	{ 0x200000, 0x200fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
3356 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
3357 	{ 0xffecfc, 0xffecfd, ga_sound_command_w },
3358 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
3359 MEMORY_END
3360 
3361 /***************************************************************************/
3362 
3363 static void goldnaxa_update_proc( void ){
3364 	set_fg_page( sys16_textram[0x740] );
3365 	set_bg_page( sys16_textram[0x741] );
3366 	sys16_fg_scrolly = sys16_textram[0x748];
3367 	sys16_bg_scrolly = sys16_textram[0x749];
3368 	sys16_fg_scrollx = sys16_textram[0x74c];
3369 	sys16_bg_scrollx = sys16_textram[0x74d];
3370 
3371 	set_tile_bank( sys16_workingram[0x2c94/2] );
3372 }
3373 
MACHINE_INIT(goldnaxa)3374 static MACHINE_INIT( goldnaxa ){
3375 	static int bank[16] = {
3376 		0,1,4,5,
3377 		8,9,0,0,
3378 		2,3,6,7,
3379 		10,11,0,0
3380 	};
3381 	sys16_obj_bank = bank;
3382 	//?
3383 	sys16_patch_code( 0x3CA2, 0x60 );
3384 	sys16_patch_code( 0x3CA3, 0x1e );
3385 	sys16_sprxoffset = -0xb8;
3386 	sys16_update_proc = goldnaxa_update_proc;
3387 }
3388 
3389 /***************************************************************************/
3390 
3391 static MACHINE_DRIVER_START( goldnaxa )
3392 
3393 	/* basic machine hardware */
3394 	MDRV_IMPORT_FROM(system16_7759)
3395 	MDRV_CPU_MODIFY("main")
3396 	MDRV_CPU_MEMORY(goldnaxa_readmem,goldnaxa_writemem)
3397 
3398 	MDRV_MACHINE_INIT(goldnaxa)
3399 MACHINE_DRIVER_END
3400 
3401 /***************************************************************************/
3402 // sys16B
3403 ROM_START( hwchamp )
3404 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
3405 	ROM_LOAD16_BYTE( "rom0-e.bin", 0x000000, 0x20000, CRC(e5abfed7) SHA1(1f875dbaf8665c1dbfe336470580361b18a8ed4e) )
3406 	ROM_LOAD16_BYTE( "rom0-o.bin", 0x000001, 0x20000, CRC(25180124) SHA1(77b414f8cd88270713c57bddadec5d8dca490e86) )
3407 
3408 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3409 	ROM_LOAD( "scr01.bin", 0x00000, 0x20000, CRC(fc586a86) SHA1(2c26ef3ab94089940add3be9952804a6e62f5113) )
3410 	ROM_LOAD( "scr11.bin", 0x20000, 0x20000, CRC(aeaaa9d8) SHA1(6b7e5320f515c1c35445d3320b3edaef911191e1) )
3411 	ROM_LOAD( "scr02.bin", 0x40000, 0x20000, CRC(7715a742) SHA1(e6040ff0e9c68f3f502e5f6d7e7ca04b14059752) )
3412 	ROM_LOAD( "scr12.bin", 0x60000, 0x20000, CRC(63a82afa) SHA1(a02bbb6dd84cdf7cdab8e738c6927f5b1e3fcad5) )
3413 	ROM_LOAD( "scr03.bin", 0x80000, 0x20000, CRC(f30cd5fd) SHA1(df6118ca4b724c37b11e18d9f2ea18e9591ae7aa) )
3414 	ROM_LOAD( "scr13.bin", 0xA0000, 0x20000, CRC(5b8494a8) SHA1(9e3f09f4037a007b6a188dd81ec8f9c635e87650) )
3415 
3416 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) //* sprites */
3417 	ROM_LOAD16_BYTE( "obj0-o.bin", 0x000001, 0x010000, CRC(fc098a13) SHA1(b4a6e00d4765265bad170dabf0b2a4a58e063b16) )
3418 	ROM_CONTINUE( 0x040001, 0x10000 )
3419 	ROM_RELOAD  ( 0x020001, 0x10000 )
3420 	ROM_CONTINUE( 0x060001, 0x10000 )
3421 	ROM_LOAD16_BYTE( "obj0-e.bin", 0x000000, 0x010000, CRC(5db934a8) SHA1(ba7cc93025af71ad2674b1376b61afbb7ae910ff) )
3422 	ROM_CONTINUE( 0x040000, 0x10000 )
3423 	ROM_RELOAD  ( 0x020000, 0x10000 )
3424 	ROM_CONTINUE( 0x060000, 0x10000 )
3425 	ROM_LOAD16_BYTE( "obj1-o.bin", 0x080001, 0x010000, CRC(1f27ee74) SHA1(a60d50a4f501623187c067a3c17bff49151ca3b2) )
3426 	ROM_CONTINUE( 0x0c0001, 0x10000 )
3427 	ROM_RELOAD  ( 0x0a0001, 0x10000 )
3428 	ROM_CONTINUE( 0x0e0001, 0x10000 )
3429 	ROM_LOAD16_BYTE( "obj1-e.bin", 0x080000, 0x010000, CRC(8a6a5cf1) SHA1(28b22aa326682ef3b54891dda7aa9a432da12a4d) )
3430 	ROM_CONTINUE( 0x0c0000, 0x10000 )
3431 	ROM_RELOAD  ( 0x0a0000, 0x10000 )
3432 	ROM_CONTINUE( 0x0e0000, 0x10000 )
3433 	ROM_LOAD16_BYTE( "obj2-o.bin", 0x100001, 0x010000, CRC(c0b2ba82) SHA1(30349c86a99bbe3dfb423027ad534a9333e27679) )
3434 	ROM_CONTINUE( 0x140001, 0x10000 )
3435 	ROM_RELOAD  ( 0x120001, 0x10000 )
3436 	ROM_CONTINUE( 0x160001, 0x10000 )
3437 	ROM_LOAD16_BYTE( "obj2-e.bin", 0x100000, 0x010000, CRC(d6c7917b) SHA1(8b313a5634c14f4c90bfa9f9616d600283f72768) )
3438 	ROM_CONTINUE( 0x140000, 0x10000 )
3439 	ROM_RELOAD  ( 0x120000, 0x10000 )
3440 	ROM_CONTINUE( 0x160000, 0x10000 )
3441 	ROM_LOAD16_BYTE( "obj3-o.bin", 0x180001, 0x010000, CRC(52fa3a49) SHA1(c2331af630d86a111cdaf21556d9df23d1471f53) )
3442 	ROM_CONTINUE( 0x1c0001, 0x10000 )
3443 	ROM_RELOAD  ( 0x1a0001, 0x10000 )
3444 	ROM_CONTINUE( 0x1e0001, 0x10000 )
3445 	ROM_LOAD16_BYTE( "obj3-e.bin", 0x180000, 0x010000, CRC(57e8f9d2) SHA1(1804677820d05a421120660f91e3a5f1df1e6a8d) )
3446 	ROM_CONTINUE( 0x1c0000, 0x10000 )
3447 	ROM_RELOAD  ( 0x1a0000, 0x10000 )
3448 	ROM_CONTINUE( 0x1e0000, 0x10000 )
3449 
3450 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
3451 	ROM_LOAD( "s-prog.bin", 0x0000, 0x8000, CRC(96a12d9d) SHA1(f4ba70c3b5d80a1b6a187c940b922d5182d5ab12) )
3452 
3453 	ROM_LOAD( "speech0.bin", 0x10000, 0x20000, CRC(4191c03d) SHA1(40809fb80527980015d3b5c4ca7cf159bc09cf5a) )
3454 	ROM_LOAD( "speech1.bin", 0x30000, 0x20000, CRC(a4d53f7b) SHA1(71123a8ecfa093897c6f2bb7312e6c755be14521) )
3455 ROM_END
3456 
3457 /***************************************************************************/
3458 
3459 static int hwc_handles_shifts[3];
3460 
WRITE16_HANDLER(hwc_io_handles_w)3461 static WRITE16_HANDLER( hwc_io_handles_w ){
3462 	hwc_handles_shifts[offset]=7;
3463 }
3464 
READ16_HANDLER(hwc_io_handles_r)3465 static READ16_HANDLER( hwc_io_handles_r ){
3466 	static int dodge_toggle=0;
3467 	int data=0,ret;
3468 	if(offset==0){
3469 		// monitor
3470 		data=input_port_0_r( offset );
3471 		if(input_port_1_r( offset ) & 4){
3472 			if(dodge_toggle) data=0x38; else data=0x60;
3473 		}
3474 		if(input_port_1_r( offset ) & 8){
3475 			if(dodge_toggle) data=0xc8; else data=0xa0;
3476 		}
3477 		if(input_port_1_r( offset ) & 0x10){
3478 			if(dodge_toggle) data=0xff; else data=0xe0;
3479 		}
3480 		if(input_port_1_r( offset ) & 0x20){
3481 			if(dodge_toggle) data=0x0; else data=0x20;
3482 		}
3483 		if( hwc_handles_shifts[offset]==0) dodge_toggle^=1;
3484 	}
3485 	else if(offset==1){
3486 		// left handle
3487 		if(input_port_1_r( offset ) & 1) data=0xff;
3488 	}
3489 	else {
3490 		// right handle
3491 		if(input_port_1_r( offset ) & 2) data=0xff;
3492 	}
3493 
3494 	ret = data>>hwc_handles_shifts[offset];
3495 	hwc_handles_shifts[offset]--;
3496 	return ret;
3497 }
3498 
WRITE16_HANDLER(hwc_ctrl1_w)3499 static WRITE16_HANDLER( hwc_ctrl1_w ){
3500 	if( ACCESSING_LSB ){
3501 		sys16_refreshenable = data & 0x20;
3502 		coin_counter_w(0,data & 0x01);
3503 		set_led_status(0,data & 0x04);
3504 		/* bit 6 is also used (always 1?) */
3505 	}
3506 }
3507 
WRITE16_HANDLER(hwc_ctrl2_w)3508 static WRITE16_HANDLER( hwc_ctrl2_w ){
3509 	if( ACCESSING_LSB ){
3510 		/* bit 4 is GONG */
3511 //		if (data & 0x10) usrintf_showmessage("GONG");
3512 		/* are the following really lamps? */
3513 //		set_led_status(1,data & 0x20);
3514 //		set_led_status(2,data & 0x40);
3515 //		set_led_status(3,data & 0x80);
3516 	}
3517 }
3518 
MEMORY_READ16_START(hwchamp_readmem)3519 static MEMORY_READ16_START( hwchamp_readmem )
3520     { 0x000000, 0x03ffff, MRA16_ROM },
3521 	{ 0x3f0000, 0x3fffff, SYS16_MRA16_EXTRAM },
3522 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
3523 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
3524 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
3525 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
3526 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
3527 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
3528 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
3529 	{ 0xc43020, 0xc43025, hwc_io_handles_r },
3530 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
3531 MEMORY_END
3532 
3533 static MEMORY_WRITE16_START( hwchamp_writemem )
3534     { 0x000000, 0x03ffff, MWA16_ROM },
3535 	{ 0x3f0000, 0x3fffff, SYS16_MWA16_EXTRAM, &sys16_extraram },
3536 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
3537 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
3538 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
3539 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
3540 	{ 0xc40000, 0xc40001, hwc_ctrl1_w },
3541 	{ 0xc43020, 0xc43025, hwc_io_handles_w },
3542 	{ 0xc43034, 0xc43035, hwc_ctrl2_w },
3543 	{ 0xfe0006, 0xfe0007, sound_command_w },
3544 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
3545 MEMORY_END
3546 
3547 /***************************************************************************/
3548 
3549 static void hwchamp_update_proc( void ){
3550 	set_fg_page( sys16_textram[0x740] );
3551 	set_bg_page( sys16_textram[0x741] );
3552 	sys16_fg_scrolly = sys16_textram[0x748];
3553 	sys16_bg_scrolly = sys16_textram[0x749];
3554 	sys16_fg_scrollx = sys16_textram[0x74c];
3555 	sys16_bg_scrollx = sys16_textram[0x74d];
3556 
3557 	sys16_tile_bank0 = sys16_extraram[0]&0xf;
3558 	sys16_tile_bank1 = sys16_extraram[1]&0xf;
3559 }
3560 
MACHINE_INIT(hwchamp)3561 static MACHINE_INIT( hwchamp ){
3562 	sys16_update_proc = hwchamp_update_proc;
3563 	sys16_wwfix = 1; //*
3564 }
3565 
DRIVER_INIT(hwchamp)3566 static DRIVER_INIT( hwchamp )
3567 {
3568 	machine_init_sys16_onetime();
3569 }
3570 /***************************************************************************/
3571 
INPUT_PORTS_START(hwchamp)3572 INPUT_PORTS_START( hwchamp )
3573 
3574 PORT_START	/* Monitor */
3575 	PORT_ANALOG( 0xff, 0x80, IPT_PADDLE  , 70, 4, 0x0, 0xff )
3576 
3577 PORT_START	/* Handles (Fake) */
3578 	PORT_BITX(0x01, 0, IPT_BUTTON1, IP_NAME_DEFAULT, KEYCODE_F, IP_JOY_NONE ) // right hit
3579 	PORT_BITX(0x02, 0, IPT_BUTTON2, IP_NAME_DEFAULT, KEYCODE_D, IP_JOY_NONE ) // left hit
3580 	PORT_BITX(0x04, 0, IPT_BUTTON3, IP_NAME_DEFAULT, KEYCODE_B, IP_JOY_NONE ) // right dodge
3581 	PORT_BITX(0x08, 0, IPT_BUTTON4, IP_NAME_DEFAULT, KEYCODE_Z, IP_JOY_NONE ) // left dodge
3582 	PORT_BITX(0x10, 0, IPT_BUTTON5, IP_NAME_DEFAULT, KEYCODE_V, IP_JOY_NONE ) // right sway
3583 	PORT_BITX(0x20, 0, IPT_BUTTON6, IP_NAME_DEFAULT, KEYCODE_X, IP_JOY_NONE ) // left swat
3584 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3585 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3586 
3587 	SYS16_SERVICE
3588 	SYS16_COINAGE
3589 
3590 PORT_START	/* DSW1 */
3591 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )	// Not Used
3592 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3593 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3594 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
3595 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3596 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3597 	PORT_DIPNAME( 0x04, 0x00, "Start Level Select" )
3598 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3599 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3600 	PORT_DIPNAME( 0x08, 0x08, "Continue Mode" )
3601 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3602 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3603 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
3604 	PORT_DIPSETTING(    0x20, "Easy" )
3605 	PORT_DIPSETTING(    0x30, "Normal" )
3606 	PORT_DIPSETTING(    0x10, "Hard" )
3607 	PORT_DIPSETTING(    0x00, "Hardest" )
3608 	PORT_DIPNAME( 0xc0, 0xc0, "Time Adjust"  )
3609 	PORT_DIPSETTING(    0x80, "Easy" )
3610 	PORT_DIPSETTING(    0xc0, "Normal" )
3611 	PORT_DIPSETTING(    0x40, "Hard" )
3612 	PORT_DIPSETTING(    0x00, "Hardest" )
3613 
3614 INPUT_PORTS_END
3615 
3616 /***************************************************************************/
3617 
3618 static MACHINE_DRIVER_START( hwchamp )
3619 
3620 	/* basic machine hardware */
3621 	MDRV_IMPORT_FROM(system16_7759)
3622 	MDRV_CPU_MODIFY("main")
3623 	MDRV_CPU_MEMORY(hwchamp_readmem,hwchamp_writemem)
3624 
3625 	MDRV_MACHINE_INIT(hwchamp)
3626 MACHINE_DRIVER_END
3627 
3628 /***************************************************************************/
3629 // pre16
3630 ROM_START( mjleague )
3631 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
3632 	ROM_LOAD16_BYTE( "epr-7404.09b", 0x000000, 0x8000, CRC(ec1655b5) SHA1(5c1df364fa9733daa4478c5f88298089e4963c33) )
3633 	ROM_LOAD16_BYTE( "epr-7401.06b", 0x000001, 0x8000, CRC(2befa5e0) SHA1(0a1681a4c7d62a5754ba6f3845436b4d08324246) )
3634 	ROM_LOAD16_BYTE( "epr-7405.10b", 0x010000, 0x8000, CRC(7a4f4e38) SHA1(65a22097dd933e83f326bd64b3863915897780a6) )
3635 	ROM_LOAD16_BYTE( "epr-7402.07b", 0x010001, 0x8000, CRC(b7bef762) SHA1(214450e0b094f99ef38dec2a3e5cbdb0b30e917d) )
3636 	ROM_LOAD16_BYTE( "epra7406.11b", 0x020000, 0x8000, CRC(bb743639) SHA1(5d99638a79f02ce14374d3b1f3d9fbfc5c13c6e1) )
3637 	ROM_LOAD16_BYTE( "epra7403.08b", 0x020001, 0x8000, CRC(d86250cf) SHA1(fb5dabb7b9b9fe0bbe93e28c60311c7b3256107a) )	// Fails memory test. Bad rom?
3638 
3639 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3640 	ROM_LOAD( "epr-7051.09a", 0x00000, 0x08000, CRC(10ca255a) SHA1(ccf58ffcac2f7fbdbfbdf32601a1b97f359cbd91) )
3641 	ROM_LOAD( "epr-7052.10a", 0x08000, 0x08000, CRC(2550db0e) SHA1(28f8d68f43d26f12793fe295c205cc86adc4e96a) )
3642 	ROM_LOAD( "epr-7053.11a", 0x10000, 0x08000, CRC(5bfea038) SHA1(01dc6e14cc7bba9f7930e68573c441fa2841f49a) )
3643 
3644 	ROM_REGION( 0x50000, REGION_GFX2, 0 ) /* sprites */
3645 	ROM_LOAD16_BYTE( "epr-7055.05a", 0x000001, 0x8000, CRC(1fb860bd) SHA1(4a4155d0352dfae9e402a2b2f1558ef17b1303b4) )
3646 	ROM_LOAD16_BYTE( "epr-7059.02b", 0x000000, 0x8000, CRC(3d14091d) SHA1(36208415b2012b6e948fefa15b0f7041748066be) )
3647 	ROM_LOAD16_BYTE( "epr-7056.06a", 0x010001, 0x8000, CRC(b35dd968) SHA1(e306b5e38acf583d7b2089302622ad25ae5564b0) )
3648 	ROM_LOAD16_BYTE( "epr-7060.03b", 0x010000, 0x8000, CRC(61bb3757) SHA1(5c87cf23be22b84e3dae746527ca057d870d6397) )
3649 	ROM_LOAD16_BYTE( "epr-7057.07a", 0x020001, 0x8000, CRC(3e5a2b6f) SHA1(d3dbafb4acb916e02c978a156008bd75ba122fb7) )
3650 	ROM_LOAD16_BYTE( "epr-7061.04b", 0x020000, 0x8000, CRC(c808dad5) SHA1(9b65acc8dc23b16e56327298188d1a6ab48b2b5d) )
3651 	ROM_LOAD16_BYTE( "epr-7058.08a", 0x030001, 0x8000, CRC(b543675f) SHA1(35ffc9295a8849a18fabe156fdbc9801ea2179cd) )
3652 	ROM_LOAD16_BYTE( "epr-7062.05b", 0x030000, 0x8000, CRC(9168eb47) SHA1(daaa7836e627a0679e65373d8f20a9383ba4c905) )
3653 //	ROM_LOAD16_BYTE( "epr-7055.05a", 0x040001, 0x8000, CRC(1fb860bd) SHA1(4a4155d0352dfae9e402a2b2f1558ef17b1303b4) ) loaded twice??
3654 //	ROM_LOAD16_BYTE( "epr-7059.02b", 0x040000, 0x8000, CRC(3d14091d) SHA1(36208415b2012b6e948fefa15b0f7041748066be) ) loaded twice??
3655 
3656 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
3657 	ROM_LOAD( "eprc7054.01b", 0x00000, 0x8000, CRC(4443b744) SHA1(73359a6e9d62b382dee47fea31b9e17eb26a0321) )
3658 
3659 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
3660 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
3661 
3662 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
3663 	ROM_LOAD( "epr-7063.01a", 0x00000, 0x8000, CRC(45d8908a) SHA1(e61f81f953c1a744ded36fed3b55774e4747af29) )
3664 	ROM_LOAD( "epr-7065.02a", 0x08000, 0x8000, CRC(8c8f8cff) SHA1(fca5a916a8b25800ee5e8771e2ced0ed9bd737f4) )
3665 	ROM_LOAD( "epr-7064.03a", 0x10000, 0x8000, CRC(159f6636) SHA1(66fa3f3e95a6ef3d3ff4ded09c05ab1131d9fbbb) )
3666 	ROM_LOAD( "epr-7066.04a", 0x18000, 0x8000, CRC(f5cfa91f) SHA1(c85d68cbcd03fe1436bed12235c033610acc11ee) )
3667 ROM_END
3668 
3669 /***************************************************************************/
3670 
3671 static READ16_HANDLER( mjl_io_player1_r ){
3672 	data16_t data=input_port_0_r( offset ) & 0x80;
3673 
3674 	if( sys16_extraram2[2/2] & 0x4 )
3675 		data|=(input_port_5_r( offset ) & 0x3f) << 1;
3676 	else
3677 		data|=(input_port_6_r( offset ) & 0x3f) << 1;
3678 
3679 	return data;
3680 }
3681 
READ16_HANDLER(mjl_io_service_r)3682 static READ16_HANDLER( mjl_io_service_r ){
3683 	data16_t data=input_port_2_r( offset ) & 0x3f;
3684 
3685 	if(sys16_extraram2[2/2] & 0x4){
3686 		data|=(input_port_5_r( offset ) & 0x40);
3687 		data|=(input_port_7_r( offset ) & 0x40) << 1;
3688 	}
3689 	else {
3690 		data|=(input_port_6_r( offset ) & 0x40);
3691 		data|=(input_port_8_r( offset ) & 0x40) << 1;
3692 	}
3693 
3694 	return data;
3695 }
3696 
READ16_HANDLER(mjl_io_player2_r)3697 static READ16_HANDLER( mjl_io_player2_r )
3698 {
3699 	data16_t data=input_port_1_r( offset ) & 0x80;
3700 	if(sys16_extraram2[2/2] & 0x4)
3701 		data|=(input_port_7_r( offset ) & 0x3f) << 1;
3702 	else
3703 		data|=(input_port_8_r( offset ) & 0x3f) << 1;
3704 	return data;
3705 }
3706 
READ16_HANDLER(mjl_io_bat_r)3707 static READ16_HANDLER( mjl_io_bat_r )
3708 {
3709 	int data1=input_port_0_r( offset );
3710 	int data2=input_port_1_r( offset );
3711 	int ret=0;
3712 
3713 	// Hitting has 8 values, but for easy of playing, I've only added 3
3714 
3715 	if(data1 &1) ret=0x00;
3716 	else if(data1 &2) ret=0x03;
3717 	else if(data1 &4) ret=0x07;
3718 	else ret=0x0f;
3719 
3720 	if(data2 &1) ret|=0x00;
3721 	else if(data2 &2) ret|=0x30;
3722 	else if(data2 &4) ret|=0x70;
3723 	else ret|=0xf0;
3724 
3725 	return ret;
3726 }
3727 
MEMORY_READ16_START(mjleague_readmem)3728 static MEMORY_READ16_START( mjleague_readmem )
3729     { 0x000000, 0x02ffff, MRA16_ROM },
3730 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
3731 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
3732 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
3733 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
3734 
3735 	{ 0xc40002, 0xc40003, sys16_coinctrl_r },
3736 	{ 0xc41000, 0xc41001, mjl_io_service_r },
3737 	{ 0xc41002, 0xc41003, mjl_io_player1_r },
3738 	{ 0xc41006, 0xc41007, mjl_io_player2_r },
3739 	{ 0xc41004, 0xc41005, mjl_io_bat_r },
3740 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
3741 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
3742 	{ 0xc60000, 0xc60001, MRA16_NOP }, /* What is this? Watchdog? */
3743 
3744 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
3745 MEMORY_END
3746 
3747 static MEMORY_WRITE16_START( mjleague_writemem )
3748     { 0x000000, 0x02ffff, MWA16_ROM },
3749 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
3750 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
3751 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
3752 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
3753 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
3754 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
3755 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
3756 MEMORY_END
3757 
3758 /***************************************************************************/
3759 
3760 static void mjleague_update_proc( void ){
3761 	set_bg_page1( sys16_textram[0x746] );
3762 	set_fg_page1( sys16_textram[0x747] );
3763 
3764 	sys16_fg_scrollx = sys16_textram[0x7fc] & 0x01ff;
3765 	sys16_bg_scrollx = sys16_textram[0x7fd] & 0x01ff;
3766 	sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
3767 	sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
3768 }
3769 
MACHINE_INIT(mjleague)3770 static MACHINE_INIT( mjleague ){
3771 	sys16_textmode=1;
3772 	sys16_spritesystem = sys16_sprite_quartet2;
3773 	sys16_sprxoffset = -0xbd;
3774 	sys16_fgxoffset = sys16_bgxoffset = 7;
3775 
3776 	// remove memory test because it fails.
3777 	sys16_patch_code( 0xBD42, 0x66 );
3778 
3779 	sys16_update_proc = mjleague_update_proc;
3780 }
3781 
DRIVER_INIT(mjleague)3782 static DRIVER_INIT( mjleague )
3783 {
3784 	machine_init_sys16_onetime();
3785 }
3786 
3787 /***************************************************************************/
3788 
INPUT_PORTS_START(mjleague)3789 INPUT_PORTS_START( mjleague )
3790 
3791 PORT_START /* player 1 button fake */
3792 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
3793 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
3794 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 )
3795 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 )
3796 
3797 PORT_START /* player 1 button fake */
3798 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
3799 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
3800 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
3801 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER2 )
3802 
3803 PORT_START  /* Service */
3804 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3805 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3806 	PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
3807 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
3808 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3809 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
3810 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3811 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3812 
3813 	SYS16_COINAGE
3814 
3815 PORT_START	/* DSW1 */
3816 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
3817 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
3818 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
3819 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
3820 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3821 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3822 	PORT_DIPNAME( 0x0c, 0x00, "Starting Points" )
3823 	PORT_DIPSETTING(    0x0c, "2000" )
3824 	PORT_DIPSETTING(    0x08, "3000" )
3825 	PORT_DIPSETTING(    0x04, "5000" )
3826 	PORT_DIPSETTING(    0x00, "10000" )
3827 	PORT_DIPNAME( 0x10, 0x10, "Team Select" )
3828 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3829 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3830 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )	//??? something to do with cocktail mode?
3831 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3832 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3833 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
3834 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3835 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3836 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3837 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3838 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3839 
3840 PORT_START	/* IN5 */
3841 	PORT_ANALOG( 0x7f, 0x40, IPT_TRACKBALL_Y, 70, 30, 0, 127 )
3842 
3843 PORT_START	/* IN6 */
3844 	PORT_ANALOG( 0x7f, 0x40, IPT_TRACKBALL_X /*| IPF_REVERSE*/, 50, 30, 0, 127 )
3845 
3846 PORT_START	/* IN7 */
3847 	PORT_ANALOG( 0x7f, 0x40, IPT_TRACKBALL_Y | IPF_PLAYER2, 70, 30, 0, 127 )
3848 
3849 PORT_START	/* IN8 */
3850 	PORT_ANALOG( 0x7f, 0x40, IPT_TRACKBALL_X | IPF_PLAYER2 | IPF_REVERSE, 50, 30, 0, 127 )
3851 
3852 INPUT_PORTS_END
3853 
3854 /***************************************************************************/
3855 
3856 static MACHINE_DRIVER_START( mjleague )
3857 
3858 	/* basic machine hardware */
3859 	MDRV_IMPORT_FROM(system16_7751)
3860 	MDRV_CPU_MODIFY("main")
3861 	MDRV_CPU_MEMORY(mjleague_readmem,mjleague_writemem)
3862 
3863 	MDRV_MACHINE_INIT(mjleague)
3864 MACHINE_DRIVER_END
3865 
3866 /***************************************************************************/
3867 // sys16B
3868 ROM_START( passsht )
3869 	ROM_REGION( 0x20000, REGION_CPU1, 0 ) /* 68000 code */
3870 	ROM_LOAD16_BYTE( "epr11871.a4", 0x000000, 0x10000, CRC(0f9ccea5) SHA1(515a2721a35332df0303f4b9616122194b5c7170) )
3871 	ROM_LOAD16_BYTE( "epr11870.a1", 0x000001, 0x10000, CRC(df43ebcf) SHA1(3ca11a25819e1e8d5162f7b36cccc928d8efe150) )
3872 
3873 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3874 	ROM_LOAD( "opr11854.b9",  0x00000, 0x10000, CRC(d31c0b6c) SHA1(610d04988da70c30300cc5614817eda9d2204f39) )
3875 	ROM_LOAD( "opr11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
3876 	ROM_LOAD( "opr11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
3877 
3878 	ROM_REGION( 0x60000, REGION_GFX2, 0 ) /* sprites */
3879 	ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
3880 	ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
3881 	ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
3882 	ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
3883 	ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
3884 	ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
3885 
3886 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3887 	ROM_LOAD( "epr11857.a7",  0x00000, 0x08000, CRC(789edc06) SHA1(8c89c94e503513c287807d187de78a7fbd75a7cf) )
3888 	ROM_LOAD( "epr11858.a8",  0x10000, 0x08000, CRC(08ab0018) SHA1(0685f80a7d403208c9cfffea3f2035324f3924fe) )
3889 	ROM_LOAD( "epr11859.a9",  0x18000, 0x08000, CRC(8673e01b) SHA1(e79183ab30e683fdf61ced2e9dbe010567c324cb) )
3890 	ROM_LOAD( "epr11860.a10", 0x20000, 0x08000, CRC(10263746) SHA1(1f981fb185c6a9795208ecdcfba36cf892a99ed5) )
3891 	ROM_LOAD( "epr11861.a11", 0x28000, 0x08000, CRC(38b54a71) SHA1(68ec4ef5b115844214ff2213be1ce6678904fbd2) )
3892 ROM_END
3893 
3894 ROM_START( passht4b )
3895 	ROM_REGION( 0x20000, REGION_CPU1, 0 ) /* 68000 code */
3896 	ROM_LOAD16_BYTE( "pas4p.3", 0x000000, 0x10000, CRC(2d8bc946) SHA1(35d3e529d4815543d9876fd0545c3d686467abaa) )
3897 	ROM_LOAD16_BYTE( "pas4p.4", 0x000001, 0x10000, CRC(e759e831) SHA1(dd5727dc28010cb988e4951723171171eb645ce8) )
3898 
3899 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3900 	ROM_LOAD( "pas4p.11", 0x00000, 0x10000, CRC(da20fbc9) SHA1(21dc8143f4d1cebae4f86e83495fa84e5293ba48) )
3901 	ROM_LOAD( "pas4p.12", 0x10000, 0x10000, CRC(bebb9211) SHA1(4f56048f6f70b63f74a4c0d64456213d36ce5b26) )
3902 	ROM_LOAD( "pas4p.13", 0x20000, 0x10000, CRC(e37506c3) SHA1(e6fbf15d58f321a3d052fefbe5a1901e4a1734ae) )
3903 
3904 	ROM_REGION( 0x60000, REGION_GFX2, 0 ) /* sprites */
3905 	ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
3906 	ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
3907 	ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
3908 	ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
3909 	ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
3910 	ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
3911 
3912 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
3913 	ROM_LOAD( "pas4p.1",  0x00000, 0x08000, CRC(e60fb017) SHA1(21298036eab55c74427f1c2e3a9623d41bca4849) )
3914 	ROM_LOAD( "pas4p.2",  0x10000, 0x10000, CRC(092e016e) SHA1(713638749efa9dce19c547b84308236110bc85fe) )
3915 ROM_END
3916 
3917 ROM_START( passshtb )
3918 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
3919 	ROM_LOAD16_BYTE( "pass3_2p.bin", 0x000000, 0x10000, CRC(26bb9299) SHA1(11bacf86dfdd8bcfbfb61f0ebc59890325c48adc) )
3920 	ROM_LOAD16_BYTE( "pass4_2p.bin", 0x000001, 0x10000, CRC(06ac6d5d) SHA1(2dd71a8a956404326797de8beed7bca016c9919e) )
3921 
3922 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
3923 	ROM_LOAD( "opr11854.b9",  0x00000, 0x10000, CRC(d31c0b6c) SHA1(610d04988da70c30300cc5614817eda9d2204f39) )
3924 	ROM_LOAD( "opr11855.b10", 0x10000, 0x10000, CRC(b78762b4) SHA1(d594ef846bd7fed8da91a89906b39c1a2867a1fe) )
3925 	ROM_LOAD( "opr11856.b11", 0x20000, 0x10000, CRC(ea49f666) SHA1(36ccd32cdcbb7fcc300628bb59c220ec3c324d82) )
3926 
3927 	ROM_REGION( 0x60000, REGION_GFX2, 0 ) /* sprites */
3928 	ROM_LOAD16_BYTE( "opr11862.b1",  0x00001, 0x10000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
3929 	ROM_LOAD16_BYTE( "opr11865.b5",  0x00000, 0x10000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
3930 	ROM_LOAD16_BYTE( "opr11863.b2",  0x20001, 0x10000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
3931 	ROM_LOAD16_BYTE( "opr11866.b6",  0x20000, 0x10000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
3932 	ROM_LOAD16_BYTE( "opr11864.b3",  0x40001, 0x10000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
3933 	ROM_LOAD16_BYTE( "opr11867.b7",  0x40000, 0x10000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
3934 
3935 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
3936 	ROM_LOAD( "epr11857.a7",  0x00000, 0x08000, CRC(789edc06) SHA1(8c89c94e503513c287807d187de78a7fbd75a7cf) )
3937 	ROM_LOAD( "epr11858.a8",  0x10000, 0x08000, CRC(08ab0018) SHA1(0685f80a7d403208c9cfffea3f2035324f3924fe) )
3938 	ROM_LOAD( "epr11859.a9",  0x18000, 0x08000, CRC(8673e01b) SHA1(e79183ab30e683fdf61ced2e9dbe010567c324cb) )
3939 	ROM_LOAD( "epr11860.a10", 0x20000, 0x08000, CRC(10263746) SHA1(1f981fb185c6a9795208ecdcfba36cf892a99ed5) )
3940 	ROM_LOAD( "epr11861.a11", 0x28000, 0x08000, CRC(38b54a71) SHA1(68ec4ef5b115844214ff2213be1ce6678904fbd2) )
3941 ROM_END
3942 /***************************************************************************/
3943 
3944 static MEMORY_READ16_START( passsht_readmem )
3945     { 0x000000, 0x01ffff, MRA16_ROM },
3946 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
3947 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
3948 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
3949 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
3950 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
3951 	{ 0xc41004, 0xc41005, input_port_1_word_r }, // player2
3952 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
3953 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
3954 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
3955 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
3956 MEMORY_END
3957 
3958 static MEMORY_WRITE16_START( passsht_writemem )
3959     { 0x000000, 0x01ffff, MWA16_ROM },
3960 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
3961 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
3962 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
3963 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
3964 	{ 0xc42006, 0xc42007, sound_command_w },
3965 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
3966 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
3967 MEMORY_END
3968 
3969 static int passht4b_io1_val;
3970 static int passht4b_io2_val;
3971 static int passht4b_io3_val;
3972 
READ16_HANDLER(passht4b_service_r)3973 static READ16_HANDLER( passht4b_service_r ){
3974 	data16_t val=input_port_2_word_r(offset,0);
3975 	if(!(readinputport(0) & 0x40)) val&=0xef;
3976 	if(!(readinputport(1) & 0x40)) val&=0xdf;
3977 	if(!(readinputport(5) & 0x40)) val&=0xbf;
3978 	if(!(readinputport(6) & 0x40)) val&=0x7f;
3979 
3980 	passht4b_io3_val=(readinputport(0)<<4) | (readinputport(5)&0xf);
3981 	passht4b_io2_val=(readinputport(1)<<4) | (readinputport(6)&0xf);
3982 
3983 	passht4b_io1_val=0xff;
3984 
3985 	// player 1 buttons
3986 	if(!(readinputport(0) & 0x10)) passht4b_io1_val &=0xfe;
3987 	if(!(readinputport(0) & 0x20)) passht4b_io1_val &=0xfd;
3988 	if(!(readinputport(0) & 0x80)) passht4b_io1_val &=0xfc;
3989 
3990 	// player 2 buttons
3991 	if(!(readinputport(1) & 0x10)) passht4b_io1_val &=0xfb;
3992 	if(!(readinputport(1) & 0x20)) passht4b_io1_val &=0xf7;
3993 	if(!(readinputport(1) & 0x80)) passht4b_io1_val &=0xf3;
3994 
3995 	// player 3 buttons
3996 	if(!(readinputport(5) & 0x10)) passht4b_io1_val &=0xef;
3997 	if(!(readinputport(5) & 0x20)) passht4b_io1_val &=0xdf;
3998 	if(!(readinputport(5) & 0x80)) passht4b_io1_val &=0xcf;
3999 
4000 	// player 4 buttons
4001 	if(!(readinputport(6) & 0x10)) passht4b_io1_val &=0xbf;
4002 	if(!(readinputport(6) & 0x20)) passht4b_io1_val &=0x7f;
4003 	if(!(readinputport(6) & 0x80)) passht4b_io1_val &=0x3f;
4004 
4005 	return val;
4006 }
4007 
READ16_HANDLER(passht4b_io1_r)4008 static READ16_HANDLER( passht4b_io1_r ) {	return passht4b_io1_val;}
READ16_HANDLER(passht4b_io2_r)4009 static READ16_HANDLER( passht4b_io2_r ) {	return passht4b_io2_val;}
READ16_HANDLER(passht4b_io3_r)4010 static READ16_HANDLER( passht4b_io3_r ) {	return passht4b_io3_val;}
4011 
MEMORY_READ16_START(passht4b_readmem)4012 static MEMORY_READ16_START( passht4b_readmem )
4013     { 0x000000, 0x01ffff, MRA16_ROM },
4014 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
4015 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
4016 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
4017 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
4018 	{ 0xc41000, 0xc41001, passht4b_service_r },
4019 	{ 0xc41002, 0xc41003, passht4b_io1_r },
4020 	{ 0xc41004, 0xc41005, passht4b_io2_r },
4021 	{ 0xc41006, 0xc41007, passht4b_io3_r },
4022 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
4023 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
4024 	{ 0xc43000, 0xc43001, input_port_0_word_r },// player1		// test mode only
4025 	{ 0xc43002, 0xc43003, input_port_1_word_r }, // player2
4026 	{ 0xc43004, 0xc43005, input_port_5_word_r }, // player3
4027 	{ 0xc43006, 0xc43007, input_port_6_word_r }, // player4
4028 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
4029 MEMORY_END
4030 
4031 static MEMORY_WRITE16_START( passht4b_writemem )
4032     { 0x000000, 0x01ffff, MWA16_ROM },
4033 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
4034 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
4035 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
4036 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
4037 	{ 0xc42006, 0xc42007, sound_command_w },
4038 	{ 0xc4600a, 0xc4600b, sys16_coinctrl_w },	/* coin counter doesn't work */
4039 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
4040 MEMORY_END
4041 
4042 /***************************************************************************/
4043 
4044 static void passsht_update_proc( void ){
4045 	sys16_fg_scrollx = sys16_workingram[0x34be/2];
4046 	sys16_bg_scrollx = sys16_workingram[0x34c2/2];
4047 	sys16_fg_scrolly = sys16_workingram[0x34bc/2];
4048 	sys16_bg_scrolly = sys16_workingram[0x34c0/2];
4049 
4050 	set_fg_page( sys16_textram[0x0ff6/2] );
4051 	set_bg_page( sys16_textram[0x0ff4/2] );
4052 }
4053 
passht4b_update_proc(void)4054 static void passht4b_update_proc( void ){
4055 	sys16_fg_scrollx = sys16_workingram[0x34ce/2];
4056 	sys16_bg_scrollx = sys16_workingram[0x34d2/2];
4057 	sys16_fg_scrolly = sys16_workingram[0x34cc/2];
4058 	sys16_bg_scrolly = sys16_workingram[0x34d0/2];
4059 
4060 	set_fg_page( sys16_textram[0x0ff6/2] );
4061 	set_bg_page( sys16_textram[0x0ff4/2] );
4062 }
4063 
MACHINE_INIT(passsht)4064 static MACHINE_INIT( passsht ){
4065 	sys16_sprxoffset = -0x48;
4066 	sys16_spritesystem = sys16_sprite_passshot;
4067 
4068 	// fix name entry
4069 	sys16_patch_code( 0x13a8,0xc0);
4070 
4071 	sys16_update_proc = passsht_update_proc;
4072 }
4073 
MACHINE_INIT(passht4b)4074 static MACHINE_INIT( passht4b ){
4075 	sys16_sprxoffset = -0xb8;
4076 	sys16_spritesystem = sys16_sprite_passshot;
4077 
4078 	// fix name entry
4079 	sys16_patch_code( 0x138a,0xc0);
4080 
4081 	sys16_update_proc = passht4b_update_proc;
4082 }
4083 
DRIVER_INIT(passsht)4084 static DRIVER_INIT( passsht )
4085 {
4086 	machine_init_sys16_onetime();
4087 }
4088 
DRIVER_INIT(passht4b)4089 static DRIVER_INIT( passht4b ){
4090 	int i;
4091 
4092 	machine_init_sys16_onetime();
4093 
4094 	/* invert the graphics bits on the tiles */
4095 	for (i = 0; i < 0x30000; i++)
4096 		memory_region(REGION_GFX1)[i] ^= 0xff;
4097 }
4098 
4099 /***************************************************************************/
4100 
INPUT_PORTS_START(passsht)4101 INPUT_PORTS_START( passsht )
4102 PORT_START /* joy 1 */
4103 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
4104 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
4105 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
4106 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
4107 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
4108 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
4109 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
4110 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
4111 
4112 PORT_START /* joy 2 */
4113 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
4114 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
4115 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
4116 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_COCKTAIL )
4117 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
4118 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
4119 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
4120 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
4121 
4122 	SYS16_SERVICE
4123 	SYS16_COINAGE
4124 
4125 PORT_START	/* DSW1 */
4126 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
4127 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4128 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4129 	PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" )
4130 	PORT_DIPSETTING(    0x06, "2000" )
4131 	PORT_DIPSETTING(    0x0a, "3000" )
4132 	PORT_DIPSETTING(    0x0c, "4000" )
4133 	PORT_DIPSETTING(    0x0e, "5000" )
4134 	PORT_DIPSETTING(    0x08, "6000" )
4135 	PORT_DIPSETTING(    0x04, "7000" )
4136 	PORT_DIPSETTING(    0x02, "8000" )
4137 	PORT_DIPSETTING(    0x00, "9000" )
4138 	PORT_DIPNAME( 0x30, 0x30, "Point Table" )
4139 	PORT_DIPSETTING(    0x20, "Easy" )
4140 	PORT_DIPSETTING(    0x30, "Normal" )
4141 	PORT_DIPSETTING(    0x10, "Hard" )
4142 	PORT_DIPSETTING(    0x00, "Hardest" )
4143 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
4144 	PORT_DIPSETTING(    0x80, "Easy" )
4145 	PORT_DIPSETTING(    0xc0, "Normal" )
4146 	PORT_DIPSETTING(    0x40, "Hard" )
4147 	PORT_DIPSETTING(    0x00, "Hardest" )
4148 INPUT_PORTS_END
4149 
4150 INPUT_PORTS_START( passht4b )
4151 PORT_START /* joy 1 */
4152 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
4153 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
4154 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
4155 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
4156 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
4157 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
4158 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
4159 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )
4160 
4161 PORT_START /* joy 2 */
4162 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
4163 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
4164 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
4165 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
4166 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
4167 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
4168 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
4169 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_COCKTAIL )
4170 
4171 PORT_START /* service */
4172 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
4173 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
4174 	PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
4175 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
4176 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
4177 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
4178 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
4179 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
4180 
4181 	SYS16_COINAGE
4182 
4183 PORT_START	/* DSW1 */
4184 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
4185 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4186 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4187 	PORT_DIPNAME( 0x0e, 0x0e, "Initial Point" )
4188 	PORT_DIPSETTING(    0x06, "2000" )
4189 	PORT_DIPSETTING(    0x0a, "3000" )
4190 	PORT_DIPSETTING(    0x0c, "4000" )
4191 	PORT_DIPSETTING(    0x0e, "5000" )
4192 	PORT_DIPSETTING(    0x08, "6000" )
4193 	PORT_DIPSETTING(    0x04, "7000" )
4194 	PORT_DIPSETTING(    0x02, "8000" )
4195 	PORT_DIPSETTING(    0x00, "9000" )
4196 	PORT_DIPNAME( 0x30, 0x30, "Point Table" )
4197 	PORT_DIPSETTING(    0x20, "Easy" )
4198 	PORT_DIPSETTING(    0x30, "Normal" )
4199 	PORT_DIPSETTING(    0x10, "Hard" )
4200 	PORT_DIPSETTING(    0x00, "Hardest" )
4201 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
4202 	PORT_DIPSETTING(    0x80, "Easy" )
4203 	PORT_DIPSETTING(    0xc0, "Normal" )
4204 	PORT_DIPSETTING(    0x40, "Hard" )
4205 	PORT_DIPSETTING(    0x00, "Hardest" )
4206 
4207 PORT_START /* joy 3 */
4208 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
4209 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER3 )
4210 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
4211 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER3 )
4212 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
4213 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
4214 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER3 )
4215 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER3 )
4216 
4217 PORT_START /* joy 4 */
4218 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER4 )
4219 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER4 )
4220 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER4 )
4221 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER4 )
4222 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER4 )
4223 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
4224 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4 )
4225 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER4 )
4226 
4227 INPUT_PORTS_END
4228 
4229 /***************************************************************************/
4230 
4231 static MACHINE_DRIVER_START( passsht )
4232 
4233 	/* basic machine hardware */
4234 	MDRV_IMPORT_FROM(system16_7759)
4235 	MDRV_CPU_MODIFY("main")
4236 	MDRV_CPU_MEMORY(passsht_readmem,passsht_writemem)
4237 
4238 	MDRV_MACHINE_INIT(passsht)
4239 MACHINE_DRIVER_END
4240 
4241 
4242 static MACHINE_DRIVER_START( passht4b )
4243 
4244 	/* basic machine hardware */
4245 	MDRV_IMPORT_FROM(system16_7759)
4246 	MDRV_CPU_MODIFY("main")
4247 	MDRV_CPU_MEMORY(passht4b_readmem,passht4b_writemem)
4248 
4249 	MDRV_MACHINE_INIT(passht4b)
4250 MACHINE_DRIVER_END
4251 
4252 /***************************************************************************/
4253 // pre16
4254 ROM_START( quartet )
4255 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4256 	ROM_LOAD16_BYTE( "epr7458a.9b",  0x000000, 0x8000, CRC(42e7b23e) SHA1(9df3b1b915723f9a927ef03d80ae7983a8c91a21) )
4257 	ROM_LOAD16_BYTE( "epr7455a.6b",  0x000001, 0x8000, CRC(01631ab2) SHA1(2d613d23fe79072f850ccc9020830dea54312b23) )
4258 	ROM_LOAD16_BYTE( "epr7459a.10b", 0x010000, 0x8000, CRC(6b540637) SHA1(4b2e9ba06b80f8fb502310ab770805f8c6a47567) )
4259 	ROM_LOAD16_BYTE( "epr7456a.7b",  0x010001, 0x8000, CRC(31ca583e) SHA1(8ade8f7e42ae3e171b138410374e4c090fdc4ecb) )
4260 	ROM_LOAD16_BYTE( "epr7460.11b",  0x020000, 0x8000, CRC(a444ea13) SHA1(884ed22d606e3bd30d8401fe1750687e54674e82) )
4261 	ROM_LOAD16_BYTE( "epr7457.8b",   0x020001, 0x8000, CRC(3b282c23) SHA1(95de41a97f50f6169887c6d9724d5c42a41bb264) )
4262 
4263 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4264 	ROM_LOAD( "epr7461.9c",  0x00000, 0x08000, CRC(f6af07f2) SHA1(546fabbda936d61a90d2395d033fd4d6bb0bc38a) )
4265 	ROM_LOAD( "epr7462.10c", 0x08000, 0x08000, CRC(7914af28) SHA1(4bf59fe4a0b0aa5d4cc0b6f9375ffab3c96e8a2b) )
4266 	ROM_LOAD( "epr7463.11c", 0x10000, 0x08000, CRC(827c5603) SHA1(8db3bd6eae5aeeb229e017471049ef5347974df5) )
4267 
4268 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites  - the same as quartet 2 */
4269 	ROM_LOAD16_BYTE( "epr7465.5c",  0x000001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
4270 	ROM_LOAD16_BYTE( "epr-7469.2b", 0x000000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
4271 	ROM_LOAD16_BYTE( "epr7466.6c",  0x010001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
4272 	ROM_LOAD16_BYTE( "epr-7470.3b", 0x010000, 0x8000, CRC(16fc67b1) SHA1(788fe2878c5c9faea43c2f166f32c22ee51c7d09) )
4273 	ROM_LOAD16_BYTE( "epr7467.7c",  0x020001, 0x8000, CRC(0af68de2) SHA1(81163baf3f0e45bac950a6d9c24b3a886db1509c) )
4274 	ROM_LOAD16_BYTE( "epr-7471.4b", 0x020000, 0x8000, CRC(13fad5ac) SHA1(75b480083fbb14cbef969126989bf9b2235fd31e) )
4275 	ROM_LOAD16_BYTE( "epr7468.8c",  0x030001, 0x8000, CRC(ddfd40c0) SHA1(6c12ad668cd0c82e7d7d46bfbdcee8b9d46ebd09) )
4276 	ROM_LOAD16_BYTE( "epr-7472.5b", 0x030000, 0x8000, CRC(8e2762ec) SHA1(872e19a6aab81d7a2472367d0e31dc1295da7182) )
4277 
4278 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4279 	ROM_LOAD( "epr-7464.1b", 0x0000, 0x8000, CRC(9f291306) SHA1(96a09542a863ccf2ded43e2df6f913722b3f97b1) )
4280 
4281 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
4282 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
4283 
4284 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
4285 	ROM_LOAD( "epr7473.1c", 0x00000, 0x8000, CRC(06ec75fa) SHA1(5f14bc887449122700c46ad22c0379a1682e0bdb) )
4286 	ROM_LOAD( "epr7475.2c", 0x08000, 0x8000, CRC(7abd1206) SHA1(54d52dc0b9c245cd2df647e714310a71b803cbcf) )
4287 	ROM_LOAD( "epr7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
4288 	ROM_LOAD( "epr7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
4289 ROM_END
4290 
4291 ROM_START( quartetj )
4292 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4293 	ROM_LOAD16_BYTE( "epr-7458.43",  0x000000, 0x8000, CRC(0096499f) SHA1(dcf8e33513ce7c6660ea546c8e1c574fde629a22) )
4294 	ROM_LOAD16_BYTE( "epr-7455.26",  0x000001, 0x8000, CRC(da934390) SHA1(d40eb65b6a36a4c1ebeadb76e47a61bd8b2e4b89) )
4295 	ROM_LOAD16_BYTE( "epr-7459.42",  0x010000, 0x8000, CRC(d130cf61) SHA1(3a065f5c296b10b97c78d49aa285ae7afb16e881) )
4296 	ROM_LOAD16_BYTE( "epr-7456.25",  0x010001, 0x8000, CRC(7847149f) SHA1(fc8ad669f2bc426cb7af78d92ea147cbd1e181af) )
4297 	ROM_LOAD16_BYTE( "epr7460.11b",  0x020000, 0x8000, CRC(a444ea13) SHA1(884ed22d606e3bd30d8401fe1750687e54674e82) )
4298 	ROM_LOAD16_BYTE( "epr7457.8b",   0x020001, 0x8000, CRC(3b282c23) SHA1(95de41a97f50f6169887c6d9724d5c42a41bb264) )
4299 
4300 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4301 	ROM_LOAD( "epr7461.9c",  0x00000, 0x08000, CRC(f6af07f2) SHA1(546fabbda936d61a90d2395d033fd4d6bb0bc38a) )
4302 	ROM_LOAD( "epr7462.10c", 0x08000, 0x08000, CRC(7914af28) SHA1(4bf59fe4a0b0aa5d4cc0b6f9375ffab3c96e8a2b) )
4303 	ROM_LOAD( "epr7463.11c", 0x10000, 0x08000, CRC(827c5603) SHA1(8db3bd6eae5aeeb229e017471049ef5347974df5) )
4304 
4305 	ROM_REGION( 0x040000, REGION_GFX2, 0 ) /* sprites  - the same as quartet 2 */
4306 	ROM_LOAD16_BYTE( "epr7465.5c",  0x000001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
4307 	ROM_LOAD16_BYTE( "epr-7469.2b", 0x000000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
4308 	ROM_LOAD16_BYTE( "epr7466.6c",  0x010001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
4309 	ROM_LOAD16_BYTE( "epr-7470.3b", 0x010000, 0x8000, CRC(16fc67b1) SHA1(788fe2878c5c9faea43c2f166f32c22ee51c7d09) )
4310 	ROM_LOAD16_BYTE( "epr7467.7c",  0x020001, 0x8000, CRC(0af68de2) SHA1(81163baf3f0e45bac950a6d9c24b3a886db1509c) )
4311 	ROM_LOAD16_BYTE( "epr-7471.4b", 0x020000, 0x8000, CRC(13fad5ac) SHA1(75b480083fbb14cbef969126989bf9b2235fd31e) )
4312 	ROM_LOAD16_BYTE( "epr7468.8c",  0x030001, 0x8000, CRC(ddfd40c0) SHA1(6c12ad668cd0c82e7d7d46bfbdcee8b9d46ebd09) )
4313 	ROM_LOAD16_BYTE( "epr-7472.5b", 0x030000, 0x8000, CRC(8e2762ec) SHA1(872e19a6aab81d7a2472367d0e31dc1295da7182) )
4314 
4315 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4316 	ROM_LOAD( "epr-7464.1b", 0x0000, 0x8000, CRC(9f291306) SHA1(96a09542a863ccf2ded43e2df6f913722b3f97b1) )
4317 
4318 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
4319 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
4320 
4321 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
4322 	ROM_LOAD( "epr7473.1c", 0x00000, 0x8000, CRC(06ec75fa) SHA1(5f14bc887449122700c46ad22c0379a1682e0bdb) )
4323 	ROM_LOAD( "epr7475.2c", 0x08000, 0x8000, CRC(7abd1206) SHA1(54d52dc0b9c245cd2df647e714310a71b803cbcf) )
4324 	ROM_LOAD( "epr7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
4325 	ROM_LOAD( "epr7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
4326 ROM_END
4327 
4328 
4329 /***************************************************************************/
4330 
4331 #if 0
4332 static READ16_HANDLER( quartet_skip_r ){
4333 	if (activecpu_get_pc()==0x89b2) {cpu_spinuntil_int(); return 0xffff;}
4334 	return sys16_workingram[0x0800/2];
4335 }
4336 #endif
4337 
4338 static MEMORY_READ16_START( quartet_readmem )
4339     { 0x000000, 0x02ffff, MRA16_ROM },
4340 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
4341 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
4342 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
4343 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
4344 	{ 0xc40002, 0xc40003, sys16_coinctrl_r },
4345 	{ 0xc41000, 0xc41001, input_port_0_word_r },// p1
4346 	{ 0xc41002, 0xc41003, input_port_1_word_r }, // p2
4347 	{ 0xc41004, 0xc41005, input_port_2_word_r }, // p3
4348 	{ 0xc41006, 0xc41007, input_port_3_word_r }, // p4
4349 	{ 0xc42000, 0xc42001, input_port_3_word_r },// dip1
4350 	{ 0xc42002, 0xc42003, input_port_5_word_r }, // dip2
4351 //	{ 0xffc800, 0xffc801, quartet_skip_r },
4352 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
4353 MEMORY_END
4354 
4355 static MEMORY_WRITE16_START( quartet_writemem )
4356     { 0x000000, 0x02ffff, MWA16_ROM },
4357 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
4358 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
4359 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
4360 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
4361 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
4362 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
4363 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
4364 MEMORY_END
4365 
4366 /***************************************************************************/
4367 
4368 static void quartet_update_proc( void ){
4369 	sys16_fg_scrollx = sys16_workingram[0x0d14/2] & 0x01ff;
4370 	sys16_bg_scrollx = sys16_workingram[0x0d18/2] & 0x01ff;
4371 	sys16_fg_scrolly = sys16_textram[0x0f24/2] & 0x00ff;
4372 	sys16_bg_scrolly = sys16_textram[0x0f26/2] & 0x01ff;
4373 
4374 //	if(((*(UINT16 *)(&sys16_extraram[4])) & 0xff) == 1)
4375 //		\=1;
4376 //	else
4377 		sys16_quartet_title_kludge=0;
4378 
4379 	set_fg_page1( sys16_workingram[0x0d1c/2] );
4380 	set_bg_page1( sys16_workingram[0x0d1e/2] );
4381 }
4382 
MACHINE_INIT(quartet)4383 static MACHINE_INIT( quartet ){
4384 	sys16_textmode=1;
4385 	sys16_spritesystem = sys16_sprite_quartet2;
4386 	sys16_sprxoffset = -0xbc;
4387 	sys16_fgxoffset = sys16_bgxoffset = 7;
4388 
4389 	sys16_update_proc = quartet_update_proc;
4390 }
4391 
DRIVER_INIT(quartet)4392 static DRIVER_INIT( quartet )
4393 {
4394 	machine_init_sys16_onetime();
4395 }
4396 /***************************************************************************/
4397 
INPUT_PORTS_START(quartet)4398 INPUT_PORTS_START( quartet )
4399 	// Player 1
4400 	PORT_START
4401 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY  )
4402 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP  | IPF_8WAY  )
4403 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
4404 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
4405 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
4406 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
4407 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
4408 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
4409 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* player 1 coin 2 really */
4410 	// Player 2
4411 	PORT_START
4412 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY  | IPF_PLAYER2 )
4413 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP  | IPF_8WAY  | IPF_PLAYER2 )
4414 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2)
4415 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2)
4416 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2)
4417 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
4418 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2)
4419 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
4420 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* player 2 coin 2 really */
4421 	// Player 3
4422 	PORT_START
4423 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3  )
4424 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP  | IPF_8WAY  | IPF_PLAYER3 )
4425 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
4426 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER3 )
4427 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
4428 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )
4429 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
4430 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
4431 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* player 3 coin 2 really */
4432 	// Player 4
4433 	PORT_START
4434 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY  | IPF_PLAYER4 )
4435 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP  | IPF_8WAY  | IPF_PLAYER4 )
4436 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER4)
4437 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER4)
4438 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4)
4439 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START4 )
4440 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4)
4441 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4 )
4442 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* player 4 coin 2 really */
4443 
4444 	SYS16_COINAGE
4445 
4446 	PORT_START	/* DSW1 */
4447 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
4448 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4449 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4450 	PORT_DIPNAME( 0x06, 0x00, "Credit Power" )
4451 	PORT_DIPSETTING(    0x04, "500" )
4452 	PORT_DIPSETTING(    0x06, "1000" )
4453 	PORT_DIPSETTING(    0x02, "2000" )
4454 	PORT_DIPSETTING(    0x00, "9000" )
4455 	PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) )
4456 	PORT_DIPSETTING(    0x10, "Easy" )
4457 	PORT_DIPSETTING(    0x18, "Normal" )
4458 	PORT_DIPSETTING(    0x08, "Hard" )
4459 	PORT_DIPSETTING(    0x00, "Hardest" )
4460 	PORT_DIPNAME( 0x20, 0x20, "Coin During Game" )
4461 	PORT_DIPSETTING(    0x20, "Power" )
4462 	PORT_DIPSETTING(    0x00, "Credit" )
4463 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
4464 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4465 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4466 	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
4467 INPUT_PORTS_END
4468 
4469 /***************************************************************************/
4470 
4471 static MACHINE_DRIVER_START( quartet )
4472 
4473 	/* basic machine hardware */
4474 	MDRV_IMPORT_FROM(system16_7751)
4475 	MDRV_CPU_MODIFY("main")
4476 	MDRV_CPU_MEMORY(quartet_readmem,quartet_writemem)
4477 
4478 	MDRV_MACHINE_INIT(quartet)
4479 MACHINE_DRIVER_END
4480 
4481 /***************************************************************************/
4482 // pre16
4483 ROM_START( quartet2 )
4484 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4485 	ROM_LOAD16_BYTE( "quartet2.b9",  0x000000, 0x8000, CRC(67177cd8) SHA1(c4ea001dfbeeb29a09d597fb50d71f54e4e9572a) )
4486 	ROM_LOAD16_BYTE( "quartet2.b6",  0x000001, 0x8000, CRC(50f50b08) SHA1(646c0d545150b95e5d8d47bf63360f7326add08f) )
4487 	ROM_LOAD16_BYTE( "quartet2.b10", 0x010000, 0x8000, CRC(4273c3b7) SHA1(4cae221678a6d2b7806487becd4ba09b520f9fa0) )
4488 	ROM_LOAD16_BYTE( "quartet2.b7",  0x010001, 0x8000, CRC(0aa337bb) SHA1(f31f8f294fccd866eadebfafee067bfae44b3184) )
4489 	ROM_LOAD16_BYTE( "quartet2.b11", 0x020000, 0x8000, CRC(3a6a375d) SHA1(8ebea6b7f1208438b47e887b46cb569725c4042a) )
4490 	ROM_LOAD16_BYTE( "quartet2.b8",  0x020001, 0x8000, CRC(d87b2ca2) SHA1(58adf0900e41036b1b78a931ab94b30ce601909d) )
4491 
4492 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4493 	ROM_LOAD( "quartet2.c9",  0x00000, 0x08000, CRC(547a6058) SHA1(5248e974c8d12183c996b1fc8fda09e8a4bf0d2d) )
4494 	ROM_LOAD( "quartet2.c10", 0x08000, 0x08000, CRC(77ec901d) SHA1(b5961895473c16a8f4a111185cce48b05ab66885) )
4495 	ROM_LOAD( "quartet2.c11", 0x10000, 0x08000, CRC(7e348cce) SHA1(82bba65280faaf3280208c85caef48ec8baeade8) )
4496 
4497 	ROM_REGION( 0x040000, REGION_GFX2, 0 ) /* sprites */
4498 	ROM_LOAD16_BYTE( "epr7465.5c",  0x000001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
4499 	ROM_LOAD16_BYTE( "epr-7469.2b", 0x000000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
4500 	ROM_LOAD16_BYTE( "epr7466.6c",  0x010001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
4501 	ROM_LOAD16_BYTE( "epr-7470.3b", 0x010000, 0x8000, CRC(16fc67b1) SHA1(788fe2878c5c9faea43c2f166f32c22ee51c7d09) )
4502 	ROM_LOAD16_BYTE( "epr7467.7c",  0x020001, 0x8000, CRC(0af68de2) SHA1(81163baf3f0e45bac950a6d9c24b3a886db1509c) )
4503 	ROM_LOAD16_BYTE( "epr-7471.4b", 0x020000, 0x8000, CRC(13fad5ac) SHA1(75b480083fbb14cbef969126989bf9b2235fd31e) )
4504 	ROM_LOAD16_BYTE( "epr7468.8c",  0x030001, 0x8000, CRC(ddfd40c0) SHA1(6c12ad668cd0c82e7d7d46bfbdcee8b9d46ebd09) )
4505 	ROM_LOAD16_BYTE( "epr-7472.5b", 0x030000, 0x8000, CRC(8e2762ec) SHA1(872e19a6aab81d7a2472367d0e31dc1295da7182) )
4506 
4507 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4508 	ROM_LOAD( "epr-7464.1b", 0x0000, 0x8000, CRC(9f291306) SHA1(96a09542a863ccf2ded43e2df6f913722b3f97b1) )
4509 
4510 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
4511 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
4512 
4513 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
4514 	ROM_LOAD( "epr7473.1c", 0x00000, 0x8000, CRC(06ec75fa) SHA1(5f14bc887449122700c46ad22c0379a1682e0bdb) )
4515 	ROM_LOAD( "epr7475.2c", 0x08000, 0x8000, CRC(7abd1206) SHA1(54d52dc0b9c245cd2df647e714310a71b803cbcf) )
4516 	ROM_LOAD( "epr7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
4517 	ROM_LOAD( "epr7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
4518 ROM_END
4519 
4520 ROM_START( quartt2j )
4521 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4522 	ROM_LOAD16_BYTE( "epr-7728.43",  0x000000, 0x8000, CRC(56a8c88e) SHA1(33eaca5272f3588058952ca0b1fa298b89418e81) )
4523 	ROM_LOAD16_BYTE( "epr-7725.26",  0x000001, 0x8000, CRC(ee15fcc9) SHA1(70d9755145245537f6aeb0d39abeda7811749b8c) )
4524 	ROM_LOAD16_BYTE( "epr-7729.42",  0x010000, 0x8000, CRC(bc242123) SHA1(8e58dd89b70ba06d12437010a7375464647262f5) )
4525 	ROM_LOAD16_BYTE( "epr-7726.25",  0x010001, 0x8000, CRC(9d1c48e7) SHA1(e11a358895c7809cdf7241ff9317c2b162e4040e) )
4526 	ROM_LOAD16_BYTE( "quartet2.b11", 0x020000, 0x8000, CRC(3a6a375d) SHA1(8ebea6b7f1208438b47e887b46cb569725c4042a) )
4527 	ROM_LOAD16_BYTE( "quartet2.b8",  0x020001, 0x8000, CRC(d87b2ca2) SHA1(58adf0900e41036b1b78a931ab94b30ce601909d) )
4528 
4529 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4530 	ROM_LOAD( "quartet2.c9",  0x00000, 0x08000, CRC(547a6058) SHA1(5248e974c8d12183c996b1fc8fda09e8a4bf0d2d) )
4531 	ROM_LOAD( "quartet2.c10", 0x08000, 0x08000, CRC(77ec901d) SHA1(b5961895473c16a8f4a111185cce48b05ab66885) )
4532 	ROM_LOAD( "quartet2.c11", 0x10000, 0x08000, CRC(7e348cce) SHA1(82bba65280faaf3280208c85caef48ec8baeade8) )
4533 
4534 	ROM_REGION( 0x040000, REGION_GFX2, 0 ) /* sprites */
4535 	ROM_LOAD16_BYTE( "epr7465.5c",  0x000001, 0x8000, CRC(8a1ab7d7) SHA1(a2f317538c70a1603b65d795223407cbaaf88524) )
4536 	ROM_LOAD16_BYTE( "epr-7469.2b", 0x000000, 0x8000, CRC(cb65ae4f) SHA1(3ee7b3b4cce113a6f394e8dfd317cdb6ffae64f7) )
4537 	ROM_LOAD16_BYTE( "epr7466.6c",  0x010001, 0x8000, CRC(b2d3f4f3) SHA1(65e654fde10bee4cb5eee8234d0babb78fe41cfb) )
4538 	ROM_LOAD16_BYTE( "epr-7470.3b", 0x010000, 0x8000, CRC(16fc67b1) SHA1(788fe2878c5c9faea43c2f166f32c22ee51c7d09) )
4539 	ROM_LOAD16_BYTE( "epr7467.7c",  0x020001, 0x8000, CRC(0af68de2) SHA1(81163baf3f0e45bac950a6d9c24b3a886db1509c) )
4540 	ROM_LOAD16_BYTE( "epr-7471.4b", 0x020000, 0x8000, CRC(13fad5ac) SHA1(75b480083fbb14cbef969126989bf9b2235fd31e) )
4541 	ROM_LOAD16_BYTE( "epr7468.8c",  0x030001, 0x8000, CRC(ddfd40c0) SHA1(6c12ad668cd0c82e7d7d46bfbdcee8b9d46ebd09) )
4542 	ROM_LOAD16_BYTE( "epr-7472.5b", 0x030000, 0x8000, CRC(8e2762ec) SHA1(872e19a6aab81d7a2472367d0e31dc1295da7182) )
4543 
4544 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4545 	ROM_LOAD( "epr-7464.1b", 0x0000, 0x8000, CRC(9f291306) SHA1(96a09542a863ccf2ded43e2df6f913722b3f97b1) )
4546 
4547 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
4548 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
4549 
4550 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
4551 	ROM_LOAD( "epr7473.1c", 0x00000, 0x8000, CRC(06ec75fa) SHA1(5f14bc887449122700c46ad22c0379a1682e0bdb) )
4552 	ROM_LOAD( "epr7475.2c", 0x08000, 0x8000, CRC(7abd1206) SHA1(54d52dc0b9c245cd2df647e714310a71b803cbcf) )
4553 	ROM_LOAD( "epr7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
4554 	ROM_LOAD( "epr7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
4555 ROM_END
4556 
4557 /***************************************************************************/
4558 
4559 #if 0
4560 static READ16_HANDLER( quartet2_skip_r ){
4561 	if (activecpu_get_pc()==0x8f6c) {cpu_spinuntil_int(); return 0xffff;}
4562 	return sys16_workingram[0x0800/2];
4563 }
4564 #endif
4565 
4566 static MEMORY_READ16_START( quartet2_readmem )
4567     { 0x000000, 0x02ffff, MRA16_ROM },
4568 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
4569 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
4570 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
4571 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
4572 	{ 0xc40002, 0xc40003, sys16_coinctrl_r },
4573 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
4574 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
4575 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
4576 	{ 0xc42000, 0xc42001, input_port_3_word_r },// dip1
4577 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
4578 //	{ 0xffc800, 0xffc801, quartet2_skip_r },
4579 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
4580 MEMORY_END
4581 
4582 static MEMORY_WRITE16_START( quartet2_writemem )
4583     { 0x000000, 0x02ffff, MWA16_ROM },
4584 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
4585 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
4586 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
4587 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
4588 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
4589 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
4590 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
4591 MEMORY_END
4592 
4593 /***************************************************************************/
4594 
4595 static void quartet2_update_proc( void ){
4596 	sys16_fg_scrollx = sys16_workingram[0x0d14/2] & 0x01ff;
4597 	sys16_bg_scrollx = sys16_workingram[0x0d18/2] & 0x01ff;
4598 	sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
4599 	sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
4600 
4601 //let's fix this properly
4602 //	if(((*(UINT16 *)(&sys16_extraram[4])) & 0xff) == 1)
4603 //		sys16_quartet_title_kludge=1;
4604 //	else
4605 		sys16_quartet_title_kludge=0;
4606 
4607 	set_fg_page1( sys16_workingram[0x0d1c/2] );
4608 	set_bg_page1( sys16_workingram[0x0d1e/2] );
4609 }
4610 
MACHINE_INIT(quartet2)4611 static MACHINE_INIT( quartet2 ){
4612 	sys16_textmode=1;
4613 	sys16_spritesystem = sys16_sprite_quartet2;
4614 	sys16_sprxoffset = -0xbc;
4615 	sys16_fgxoffset = sys16_bgxoffset = 7;
4616 
4617 	sys16_update_proc = quartet2_update_proc;
4618 }
4619 
DRIVER_INIT(quartet2)4620 static DRIVER_INIT( quartet2 ){
4621 	machine_init_sys16_onetime();
4622 }
4623 /***************************************************************************/
4624 
INPUT_PORTS_START(quartet2)4625 INPUT_PORTS_START( quartet2 )
4626 	SYS16_JOY1_SWAPPEDBUTTONS
4627 	SYS16_JOY2_SWAPPEDBUTTONS
4628 	SYS16_SERVICE
4629 	SYS16_COINAGE
4630 
4631 PORT_START	/* DSW1 */
4632 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
4633 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4634 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4635 	PORT_DIPNAME( 0x06, 0x00, "Credit Power" )
4636 	PORT_DIPSETTING(    0x04, "500" )
4637 	PORT_DIPSETTING(    0x06, "1000" )
4638 	PORT_DIPSETTING(    0x02, "2000" )
4639 	PORT_DIPSETTING(    0x00, "9000" )
4640 	PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) )
4641 	PORT_DIPSETTING(    0x10, "Easy" )
4642 	PORT_DIPSETTING(    0x18, "Normal" )
4643 	PORT_DIPSETTING(    0x08, "Hard" )
4644 	PORT_DIPSETTING(    0x00, "Hardest" )
4645 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
4646 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4647 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4648 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
4649 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4650 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4651 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
4652 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4653 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4654 
4655 INPUT_PORTS_END
4656 
4657 /***************************************************************************/
4658 
4659 static MACHINE_DRIVER_START( quartet2 )
4660 
4661 	/* basic machine hardware */
4662 	MDRV_IMPORT_FROM(system16_7751)
4663 	MDRV_CPU_MODIFY("main")
4664 	MDRV_CPU_MEMORY(quartet2_readmem,quartet2_writemem)
4665 
4666 	MDRV_MACHINE_INIT(quartet2)
4667 MACHINE_DRIVER_END
4668 
4669 /***************************************************************************
4670 
4671    Riot City
4672 
4673 ***************************************************************************/
4674 // sys16B
4675 ROM_START( riotcity )
4676 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
4677 	ROM_LOAD16_BYTE( "epr14612.bin", 0x000000, 0x20000, CRC(a1b331ec) SHA1(49136ffed35ecc9e5e9a6ea7acbe534e6ccc9dd8) )
4678 	ROM_LOAD16_BYTE( "epr14610.bin", 0x000001, 0x20000, CRC(cd4f2c50) SHA1(c7a7e95901c664a72195c202b50a159db8d5981d) )
4679 	/* empty 0x40000 - 0x80000 */
4680 	ROM_LOAD16_BYTE( "epr14613.bin", 0x080000, 0x20000, CRC(0659df4c) SHA1(a24005ce354113732306c318de373c818400a9c8) )
4681 	ROM_LOAD16_BYTE( "epr14611.bin", 0x080001, 0x20000, CRC(d9e6f80b) SHA1(5ac56b3685bb121a4f07be3d81209807436e76ec) )
4682 
4683 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4684 	ROM_LOAD( "epr14616.bin", 0x00000, 0x20000, CRC(46d30368) SHA1(a791ef0e881345b6be0b28f32af17127edb5b590) ) /* plane 1 */
4685 	ROM_LOAD( "epr14625.bin", 0x20000, 0x20000, CRC(abfb80fe) SHA1(5f0d61d55f27e8f776b573e3193164c4d70ec12b) )
4686 	ROM_LOAD( "epr14617.bin", 0x40000, 0x20000, CRC(884e40f9) SHA1(f7eeae57544e7d95139588137605986732937d38) ) /* plane 2 */
4687 	ROM_LOAD( "epr14626.bin", 0x60000, 0x20000, CRC(4ef55846) SHA1(2f23474e7d1d8880dc251ada55c5fca2fc19256a) )
4688 	ROM_LOAD( "epr14618.bin", 0x80000, 0x20000, CRC(00eb260e) SHA1(f293180fb9a053c98022ef086bf4002563752f61) ) /* plane 3 */
4689 	ROM_LOAD( "epr14627.bin", 0xa0000, 0x20000, CRC(961e5f82) SHA1(dc88b511dff6cdebf96fe8bf388bf76098296b0f) )
4690 
4691 	ROM_REGION( 0x180000, REGION_GFX2, 0 ) /* sprites */
4692 	ROM_LOAD16_BYTE( "epr14619.bin",  0x000001, 0x040000, CRC(6f2b5ef7) SHA1(a0186fcc5b12c31b65b84355f88bcb10b1434135) )
4693 	ROM_LOAD16_BYTE( "epr14622.bin",  0x000000, 0x040000, CRC(7ca7e40d) SHA1(57d26cc1b530cb867b2a4779bb5108ac457b2154) )
4694 	ROM_LOAD16_BYTE( "epr14620.bin",  0x080001, 0x040000, CRC(66183333) SHA1(44bb9d57cd0308c0d7b6a10ba9bd95763ceea775) )
4695 	ROM_LOAD16_BYTE( "epr14623.bin",  0x080000, 0x040000, CRC(98630049) SHA1(216ae0b4a59f306b51bd50dfcbf831c3186a4d2a) )
4696 	ROM_LOAD16_BYTE( "epr14621.bin",  0x100001, 0x040000, CRC(c0f2820e) SHA1(ae433f6c5065ed495f5f57f50d6abe5ff98b041e) )
4697 	ROM_LOAD16_BYTE( "epr14624.bin",  0x100000, 0x040000, CRC(d1a68448) SHA1(7591f0476e899a11042d9b7e93f99b64de48b0ef) )
4698 
4699 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
4700 	ROM_LOAD( "epr14614.bin", 0x00000, 0x10000, CRC(c65cc69a) SHA1(28a75dd2085b8e1447fe4e6af210a54a6666fcb1) )
4701 	ROM_LOAD( "epr14615.bin", 0x10000, 0x20000, CRC(46653db1) SHA1(7a43d8742ee451d93bb5f1b0f4f261b274c3f0ef) )
4702 ROM_END
4703 
4704 /***************************************************************************/
4705 
4706 static READ16_HANDLER( riotcity_skip_r ){
4707 	if (activecpu_get_pc()==0x3ce) {cpu_spinuntil_int(); return 0;}
4708 	return sys16_workingram[0x2cde/2];
4709 }
4710 
MEMORY_READ16_START(riotcity_readmem)4711 static MEMORY_READ16_START( riotcity_readmem )
4712     { 0x000000, 0x0bffff, MRA16_ROM },
4713 	{ 0xf40000, 0xf40fff, SYS16_MRA16_SPRITERAM },
4714 	{ 0xf60000, 0xf60fff, SYS16_MRA16_PALETTERAM },
4715 	{ 0xf81002, 0xf81003, input_port_0_word_r }, // player1
4716 	{ 0xf81006, 0xf81007, input_port_1_word_r }, // player2
4717 	{ 0xf81000, 0xf81001, input_port_2_word_r }, // service
4718 	{ 0xf82002, 0xf82003, input_port_3_word_r }, // dip1
4719 	{ 0xf82000, 0xf82001, input_port_4_word_r }, // dip2
4720 	{ 0xfa0000, 0xfaffff, SYS16_MRA16_TILERAM },
4721 	{ 0xfb0000, 0xfb0fff, SYS16_MRA16_TEXTRAM },
4722 	{ 0xffecde, 0xffecdf, riotcity_skip_r },
4723 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
4724 MEMORY_END
4725 
4726 static MEMORY_WRITE16_START( riotcity_writemem )
4727     { 0x000000, 0x0bffff, MWA16_ROM },
4728 	{ 0xf00006, 0xf00007, sound_command_w },
4729 	{ 0xf00020, 0xf0003f, MWA16_NOP }, // config regs
4730 	{ 0xf20000, 0xf2ffff, sys16_tilebank_w },
4731 	{ 0xf40000, 0xf40fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
4732 	{ 0xf60000, 0xf60fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
4733 	{ 0xf80000, 0xf80001, sys16_coinctrl_w },
4734 	{ 0xfa0000, 0xfaffff, SYS16_MWA16_TILERAM, &sys16_tileram },
4735 	{ 0xfb0000, 0xfb0fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
4736 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
4737 MEMORY_END
4738 
4739 /***************************************************************************/
4740 
4741 static void riotcity_update_proc (void)
4742 {
4743 	sys16_fg_scrollx = sys16_textram[0x0e98/2];
4744 	sys16_bg_scrollx = sys16_textram[0x0e9a/2];
4745 	sys16_fg_scrolly = sys16_textram[0x0e90/2];
4746 	sys16_bg_scrolly = sys16_textram[0x0e92/2];
4747 
4748 	set_fg_page( sys16_textram[0x0e80/2] );
4749 	set_bg_page( sys16_textram[0x0e82/2] );
4750 }
4751 
MACHINE_INIT(riotcity)4752 static MACHINE_INIT( riotcity ){
4753 	static int bank[16] = {
4754 		0x0,0x1,0x4,0x5,
4755 		0x8,0x9,0x0,0x0,
4756 		0x2,0x3,0x6,0x7,
4757 		0xa,0xb,0x0,0x0
4758 	};
4759 	sys16_obj_bank = bank;
4760 	sys16_spritesystem = sys16_sprite_shinobi;
4761 	sys16_bg_priority_mode=1;
4762 
4763 	sys16_update_proc = riotcity_update_proc;
4764 }
4765 
DRIVER_INIT(riotcity)4766 static DRIVER_INIT( riotcity )
4767 {
4768 	machine_init_sys16_onetime();
4769 }
4770 
4771 /***************************************************************************/
4772 
INPUT_PORTS_START(riotcity)4773 INPUT_PORTS_START( riotcity )
4774 	SYS16_JOY1
4775 	SYS16_JOY2
4776 	SYS16_SERVICE
4777 	SYS16_COINAGE
4778 
4779 PORT_START	/* DSW1 */
4780 	PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
4781 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4782 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4783 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
4784 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4785 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4786 	PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ) )
4787 	PORT_DIPSETTING(    0x00, "1" )
4788 	PORT_DIPSETTING(    0x0c, "2" )
4789 	PORT_DIPSETTING(    0x08, "3" )
4790 	PORT_DIPSETTING(    0x04, "4" )
4791 	PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
4792 	PORT_DIPSETTING(    0x20, "Easy" )
4793 	PORT_DIPSETTING(    0x30, "Normal" )
4794 	PORT_DIPSETTING(    0x10, "Hard" )
4795 	PORT_DIPSETTING(    0x00, "Hardest" )
4796 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ) )
4797 	PORT_DIPSETTING(    0x40, "Normal" )
4798 	PORT_DIPSETTING(    0x00, "Hard" )
4799 	PORT_DIPNAME( 0x80, 0x80, "Attack Button to Start" )
4800 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4801 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4802 INPUT_PORTS_END
4803 
4804 /***************************************************************************/
4805 
4806 static MACHINE_DRIVER_START( riotcity )
4807 
4808 	/* basic machine hardware */
4809 	MDRV_IMPORT_FROM(system16_7759)
4810 	MDRV_CPU_MODIFY("main")
4811 	MDRV_CPU_MEMORY(riotcity_readmem,riotcity_writemem)
4812 
4813 	MDRV_MACHINE_INIT(riotcity)
4814 MACHINE_DRIVER_END
4815 
4816 /***************************************************************************/
4817 
4818 // sys16B
4819 ROM_START( sdi )
4820 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4821 	ROM_LOAD16_BYTE( "a4.rom", 0x000000, 0x8000, CRC(f2c41dd6) SHA1(7fdbf819e42c7af0efe3976ffd919ee142efe1bc) )
4822 	ROM_LOAD16_BYTE( "a1.rom", 0x000001, 0x8000, CRC(a9f816ef) SHA1(5ccab14b088d2249f83ff5e80591eccb4afb6e20) )
4823 	ROM_LOAD16_BYTE( "a5.rom", 0x010000, 0x8000, CRC(7952e27e) SHA1(caead75724a6744fc6fc7fbbc9894932a7a22eed) )
4824 	ROM_LOAD16_BYTE( "a2.rom", 0x010001, 0x8000, CRC(369af326) SHA1(d6517c38f3a386e8f23b058fe8fa0607918ba215) )
4825 	ROM_LOAD16_BYTE( "a6.rom", 0x020000, 0x8000, CRC(8ee2c287) SHA1(8ed98334dab51c2eab8e1ff0724abc1f819dc8c2) )
4826 	ROM_LOAD16_BYTE( "a3.rom", 0x020001, 0x8000, CRC(193e4231) SHA1(14fecfab010641b83e5b24d0e8003bc0de35e1c8) )
4827 
4828 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4829 	ROM_LOAD( "b9.rom",  0x00000, 0x10000, CRC(182b6301) SHA1(bb6f1174f82611c801d2b4b7d3596bf71619e8a1) )
4830 	ROM_LOAD( "b10.rom", 0x10000, 0x10000, CRC(8f7129a2) SHA1(094a4065597d8d51fb2232546df1de9043fea731) )
4831 	ROM_LOAD( "b11.rom", 0x20000, 0x10000, CRC(4409411f) SHA1(84fd7128e8440d96b0384ae3c391a59bd37ecf9d) )
4832 
4833 	ROM_REGION( 0x60000, REGION_GFX2, 0 ) /* sprites */
4834 	ROM_LOAD16_BYTE( "b1.rom", 0x00001, 0x010000, CRC(30e2c50a) SHA1(1fb9e69d4cb97fdcb0f98c2a7ede246aaa4ac382) )
4835 	ROM_LOAD16_BYTE( "b5.rom", 0x00000, 0x010000, CRC(794e3e8b) SHA1(91ca1cb9aabf99adc8426feed4494a992afb8c4a) )
4836 	ROM_LOAD16_BYTE( "b2.rom", 0x20001, 0x010000, CRC(6a8b3fd0) SHA1(a122d3cb0b3263714f026e57d85b0dbf6cb110d7) )
4837 	ROM_LOAD16_BYTE( "b6.rom", 0x20000, 0x010000, CRC(602da5d5) SHA1(d32cdde7d86c4561e7bfa547d7d7995ce9a43c24) )
4838 	ROM_LOAD16_BYTE( "b3.rom", 0x40001, 0x010000, CRC(b9de3aeb) SHA1(2f7a55a8377e831338a884f8962d6ab2757e8c9b) )
4839 	ROM_LOAD16_BYTE( "b7.rom", 0x40000, 0x010000, CRC(0a73a057) SHA1(7f31124c67541a245e069e5b6aac59935d99a9a9) )
4840 
4841 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4842 	ROM_LOAD( "a7.rom", 0x0000, 0x8000, CRC(793f9f7f) SHA1(9e4fde376db9e99a83eb2fc734c6721c122ba9af) )
4843 ROM_END
4844 
4845 // sys16A
4846 ROM_START( sdioj )
4847 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
4848 // Custom cpu 317-0027
4849 	ROM_LOAD16_BYTE( "epr10970.43", 0x000000, 0x8000, CRC(b8fa4a2c) SHA1(06b448bbee0a2b2809d9af7a2a22c5847343c079) )
4850 	ROM_LOAD16_BYTE( "epr10968.26", 0x000001, 0x8000, CRC(a3f97793) SHA1(0f924fae0d13b3387a0e5171482f6d413432ddb3) )
4851 	ROM_LOAD16_BYTE( "epr10971.42", 0x010000, 0x8000, CRC(c44a0328) SHA1(3736bb83e728bb0e15ea58bc2a6c2fe66a1a4885) )
4852 	ROM_LOAD16_BYTE( "epr10969.25", 0x010001, 0x8000, CRC(455d15bd) SHA1(be679ecb1687b0675614ad27973c20808ad53797) )
4853 	ROM_LOAD16_BYTE( "epr10755.41", 0x020000, 0x8000, CRC(405e3969) SHA1(6d8c3bd06d35c971f7db005dffa2e83cae1378f8) )
4854 	ROM_LOAD16_BYTE( "epr10752.24", 0x020001, 0x8000, CRC(77453740) SHA1(9032463e5e14c3c610c31e2eb6e2c962df9adf46) )
4855 
4856 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
4857 	ROM_LOAD( "epr10756.95", 0x00000, 0x10000, CRC(44d8a506) SHA1(363d49dcb65ac0093f3ed3b259b1bc45f0291e9d) )
4858 	ROM_LOAD( "epr10757.94", 0x10000, 0x10000, CRC(497e1740) SHA1(95b166a9db46a27087e417c1b2cbb76bee2e64a7) )
4859 	ROM_LOAD( "epr10758.93", 0x20000, 0x10000, CRC(61d61486) SHA1(d48ff87216947b78903cd98a10436babdf8b75a0) )
4860 
4861 	ROM_REGION( 0x60000, REGION_GFX2, 0 ) /* sprites */
4862 	ROM_LOAD16_BYTE( "b1.rom", 0x00001, 0x10000, CRC(30e2c50a) SHA1(1fb9e69d4cb97fdcb0f98c2a7ede246aaa4ac382) )
4863 	ROM_LOAD16_BYTE( "b5.rom", 0x00000, 0x10000, CRC(794e3e8b) SHA1(91ca1cb9aabf99adc8426feed4494a992afb8c4a) )
4864 	ROM_LOAD16_BYTE( "b2.rom", 0x20001, 0x10000, CRC(6a8b3fd0) SHA1(a122d3cb0b3263714f026e57d85b0dbf6cb110d7) )
4865 	ROM_LOAD16_BYTE( "b6.rom", 0x20000, 0x10000, CRC(602da5d5) SHA1(d32cdde7d86c4561e7bfa547d7d7995ce9a43c24) )
4866 	ROM_LOAD16_BYTE( "b3.rom", 0x40001, 0x10000, CRC(b9de3aeb) SHA1(2f7a55a8377e831338a884f8962d6ab2757e8c9b) )
4867 	ROM_LOAD16_BYTE( "b7.rom", 0x40000, 0x10000, CRC(0a73a057) SHA1(7f31124c67541a245e069e5b6aac59935d99a9a9) )
4868 
4869 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
4870 	ROM_LOAD( "epr10759.12", 0x0000, 0x8000, CRC(d7f9649f) SHA1(ce4abe7dd7e33da048569d7817063345fab75ea7) )
4871 ROM_END
4872 
4873 
4874 /***************************************************************************/
4875 
4876 static READ16_HANDLER( io_p1mousex_r ){ return 0xff-input_port_5_r( offset ); }
READ16_HANDLER(io_p1mousey_r)4877 static READ16_HANDLER( io_p1mousey_r ){ return input_port_6_r( offset ); }
4878 
READ16_HANDLER(io_p2mousex_r)4879 static READ16_HANDLER( io_p2mousex_r ){ return input_port_7_r( offset ); }
READ16_HANDLER(io_p2mousey_r)4880 static READ16_HANDLER( io_p2mousey_r ){ return input_port_8_r( offset ); }
4881 
READ16_HANDLER(sdi_skip_r)4882 static READ16_HANDLER( sdi_skip_r ){
4883 	if (activecpu_get_pc()==0x5326) {cpu_spinuntil_int(); return 0xffff;}
4884 	return sys16_workingram[0x0400/2];
4885 }
4886 
MEMORY_READ16_START(sdi_readmem)4887 static MEMORY_READ16_START( sdi_readmem )
4888     { 0x000000, 0x02ffff, MRA16_ROM },
4889 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
4890 	{ 0x410000, 0x411fff, SYS16_MRA16_TEXTRAM }, //*
4891 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
4892 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
4893 	{ 0xc41004, 0xc41005, input_port_0_word_r },// player1
4894 	{ 0xc41002, 0xc41003, input_port_1_word_r }, // player2
4895 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
4896 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
4897 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
4898 	{ 0xc42004, 0xc42005, input_port_4_word_r }, // dip2
4899 	{ 0xc43000, 0xc43001, io_p1mousex_r },
4900 	{ 0xc43004, 0xc43005, io_p1mousey_r },
4901 	{ 0xc43008, 0xc43009, io_p2mousex_r },
4902 	{ 0xc4300c, 0xc4300d, io_p2mousey_r },
4903 //	{ 0xc42000, 0xc42001, MRA16_NOP }, /* What is this? */
4904 	{ 0xc60000, 0xc60001, MRA16_NOP }, /* What is this? */
4905 	{ 0xffc400, 0xffc401, sdi_skip_r },
4906 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
4907 MEMORY_END
4908 
4909 static MEMORY_WRITE16_START( sdi_writemem )
4910     { 0x000000, 0x02ffff, MWA16_ROM },
4911 	{ 0x123406, 0x123407, sound_command_w },
4912 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
4913 	{ 0x410000, 0x411fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
4914 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
4915 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
4916 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
4917 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
4918 MEMORY_END
4919 
4920 /***************************************************************************/
4921 
4922 static void sdi_update_proc( void ){
4923 	set_fg_page( sys16_textram[0x740] );
4924 	set_bg_page( sys16_textram[0x741] );
4925 	sys16_fg_scrolly = sys16_textram[0x748];
4926 	sys16_bg_scrolly = sys16_textram[0x749];
4927 	sys16_fg_scrollx = sys16_textram[0x74c];
4928 	sys16_bg_scrollx = sys16_textram[0x74d];
4929 }
4930 
MACHINE_INIT(sdi)4931 static MACHINE_INIT( sdi ){
4932 	static int bank[16] = {
4933 		0,0,0,0,
4934 		0,0,0,3,
4935 		0,0,0,2,
4936 		0,1,0,0
4937 	};
4938 	sys16_obj_bank = bank;
4939 
4940 	sys16_patch_code( 0x102f2, 0x00 );
4941 	sys16_patch_code( 0x102f3, 0x02 );
4942 
4943 	sys16_update_proc = sdi_update_proc;
4944 }
4945 
DRIVER_INIT(sdi)4946 static DRIVER_INIT( sdi ){
4947 	machine_init_sys16_onetime();
4948 	sys18_splittab_bg_x=&sys16_textram[0x0fc0];
4949 	sys16_rowscroll_scroll=0xff00;
4950 }
4951 
4952 /***************************************************************************/
4953 
INPUT_PORTS_START(sdi)4954 INPUT_PORTS_START( sdi )
4955 PORT_START	/* DSW1 */
4956 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY )
4957 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY )
4958 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY )
4959 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY )
4960 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN  | IPF_8WAY | IPF_PLAYER2)
4961 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP    | IPF_8WAY | IPF_PLAYER2)
4962 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_8WAY | IPF_PLAYER2)
4963 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT  | IPF_8WAY | IPF_PLAYER2)
4964 
4965 	SYS16_JOY2
4966 
4967 PORT_START /* Service */
4968 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
4969 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
4970 	PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
4971 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
4972 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
4973 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
4974 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
4975 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2)
4976 
4977 	SYS16_COINAGE
4978 
4979 PORT_START	/* DSW1 */
4980 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
4981 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4982 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4983 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
4984 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4985 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4986 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
4987 	PORT_DIPSETTING(    0x08, "2" )
4988 	PORT_DIPSETTING(    0x0c, "3" )
4989 	PORT_DIPSETTING(    0x04, "4" )
4990 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "240?", IP_KEY_NONE, IP_JOY_NONE )
4991 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
4992 	PORT_DIPSETTING(    0x20, "Easy" )
4993 	PORT_DIPSETTING(    0x30, "Normal" )
4994 	PORT_DIPSETTING(    0x10, "Hard" )
4995 	PORT_DIPSETTING(    0x00, "Hardest" )
4996 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) )
4997 	PORT_DIPSETTING(    0x80, "Every 50000" )
4998 	PORT_DIPSETTING(    0xc0, "50000" )
4999 	PORT_DIPSETTING(    0x40, "100000" )
5000 	PORT_DIPSETTING(    0x00, "None" )
5001 
5002 	PORT_START				/* fake analog X */
5003 	PORT_ANALOG( 0xff, 0x80, IPT_TRACKBALL_X, 75, 1, 0, 255 )
5004 
5005 	PORT_START				/* fake analog Y */
5006 	PORT_ANALOG( 0xff, 0x80, IPT_TRACKBALL_Y, 75, 1, 0, 255 )
5007 
5008 	PORT_START				/* fake analog X */
5009 	PORT_ANALOG( 0xff, 0x80, IPT_TRACKBALL_X | IPF_PLAYER2 , 75, 1, 0, 255 )
5010 
5011 	PORT_START				/* fake analog Y */
5012 	PORT_ANALOG( 0xff, 0x80, IPT_TRACKBALL_Y | IPF_PLAYER2, 75, 1, 0, 255 )
5013 
5014 INPUT_PORTS_END
5015 
5016 /***************************************************************************/
5017 
5018 static MACHINE_DRIVER_START( sdi )
5019 
5020 	/* basic machine hardware */
5021 	MDRV_IMPORT_FROM(system16)
5022 	MDRV_CPU_MODIFY("main")
5023 	MDRV_CPU_MEMORY(sdi_readmem,sdi_writemem)
5024 
5025 	MDRV_MACHINE_INIT(sdi)
5026 MACHINE_DRIVER_END
5027 
5028 /***************************************************************************/
5029 
5030 
5031 /***************************************************************************/
5032 // sys16B
5033 ROM_START( shinobi )
5034 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
5035 	ROM_LOAD16_BYTE( "shinobi.a4", 0x00000, 0x10000, CRC(b930399d) SHA1(955ff2948e1990463631b0bc5c7f5275384236cc) )
5036 	ROM_LOAD16_BYTE( "shinobi.a1", 0x00001, 0x10000, CRC(343f4c46) SHA1(2cf5d00462ad85ae9a2e16d59171c8ab85e10f49) )
5037 	ROM_LOAD16_BYTE( "epr11283",   0x20000, 0x10000, CRC(9d46e707) SHA1(37ab25b3b37365c9f45837bfb6ec80652691dd4c) )
5038 	ROM_LOAD16_BYTE( "epr11281",   0x20001, 0x10000, CRC(7961d07e) SHA1(38cbdab35f901532c0ad99ad0083513abd2ff182) )
5039 
5040 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5041 	ROM_LOAD( "shinobi.b9",  0x00000, 0x10000, CRC(5f62e163) SHA1(03f008745a1af84142ada647acf3601049f43ad5) )
5042 	ROM_LOAD( "shinobi.b10", 0x10000, 0x10000, CRC(75f8fbc9) SHA1(29072edcd583af60ec66b4c8bb82b179a3751edf) )
5043 	ROM_LOAD( "shinobi.b11", 0x20000, 0x10000, CRC(06508bb9) SHA1(57c9036123ec8e35d0275ab6eaff25a16aa203d4) )
5044 
5045 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
5046 	ROM_LOAD16_BYTE( "epr11290.10", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
5047 	ROM_LOAD16_BYTE( "epr11294.11", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
5048 	ROM_LOAD16_BYTE( "epr11291.17", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
5049 	ROM_LOAD16_BYTE( "epr11295.18", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
5050 	ROM_LOAD16_BYTE( "epr11292.23", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
5051 	ROM_LOAD16_BYTE( "epr11296.24", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
5052 	ROM_LOAD16_BYTE( "epr11293.29", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
5053 	ROM_LOAD16_BYTE( "epr11297.30", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
5054 
5055 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
5056 	ROM_LOAD( "shinobi.a7", 0x00000, 0x8000, CRC(2457a7cf) SHA1(ddfac640e442537acb015de8bb088659f5a217ee) )
5057 	ROM_LOAD( "shinobi.a8", 0x10000, 0x8000, CRC(c8df8460) SHA1(0aeb41a493df155edb5f600f53ec43b798927dff) )
5058 	ROM_LOAD( "shinobi.a9", 0x18000, 0x8000, CRC(e5a4cf30) SHA1(d1982da7a550c11ab2253f5d64ac6ab847da0a04) )
5059 ROM_END
5060 
5061 ROM_START( shinobib )
5062 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
5063 // Custom cpu 317-0049
5064 	ROM_LOAD16_BYTE( "epr11282", 0x00000, 0x10000, CRC(5f2e5524) SHA1(9e5fcabb95abbe6c8178e82f4971abdbc92bff73) )
5065 	ROM_LOAD16_BYTE( "epr11280", 0x00001, 0x10000, CRC(bdfe5c38) SHA1(65f537e38b74c66576d57c770d182dc13302cca6) )
5066 	ROM_LOAD16_BYTE( "epr11283", 0x20000, 0x10000, CRC(9d46e707) SHA1(37ab25b3b37365c9f45837bfb6ec80652691dd4c) )
5067 	ROM_LOAD16_BYTE( "epr11281", 0x20001, 0x10000, CRC(7961d07e) SHA1(38cbdab35f901532c0ad99ad0083513abd2ff182) )
5068 
5069 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5070 	ROM_LOAD( "shinobi.b9",  0x00000, 0x10000, CRC(5f62e163) SHA1(03f008745a1af84142ada647acf3601049f43ad5) )
5071 	ROM_LOAD( "shinobi.b10", 0x10000, 0x10000, CRC(75f8fbc9) SHA1(29072edcd583af60ec66b4c8bb82b179a3751edf) )
5072 	ROM_LOAD( "shinobi.b11", 0x20000, 0x10000, CRC(06508bb9) SHA1(57c9036123ec8e35d0275ab6eaff25a16aa203d4) )
5073 
5074 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
5075 	ROM_LOAD16_BYTE( "epr11290.10", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
5076 	ROM_LOAD16_BYTE( "epr11294.11", 0x10000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
5077 	ROM_LOAD16_BYTE( "epr11291.17", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
5078 	ROM_LOAD16_BYTE( "epr11295.18", 0x30000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
5079 	ROM_LOAD16_BYTE( "epr11292.23", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
5080 	ROM_LOAD16_BYTE( "epr11296.24", 0x50000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
5081 	ROM_LOAD16_BYTE( "epr11293.29", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
5082 	ROM_LOAD16_BYTE( "epr11297.30", 0x70000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
5083 
5084 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
5085 	ROM_LOAD( "shinobi.a7", 0x00000, 0x8000, CRC(2457a7cf) SHA1(ddfac640e442537acb015de8bb088659f5a217ee) )
5086 	ROM_LOAD( "shinobi.a8", 0x10000, 0x8000, CRC(c8df8460) SHA1(0aeb41a493df155edb5f600f53ec43b798927dff) )
5087 	ROM_LOAD( "shinobi.a9", 0x18000, 0x8000, CRC(e5a4cf30) SHA1(d1982da7a550c11ab2253f5d64ac6ab847da0a04) )
5088 
5089 ROM_END
5090 
5091 /***************************************************************************/
5092 
5093 static READ16_HANDLER( shinobi_skip_r ){
5094 	if (activecpu_get_pc()==0x32e0) {cpu_spinuntil_int(); return 1<<8;}
5095 	return sys16_workingram[0x301c/2];
5096 }
5097 
MEMORY_READ16_START(shinobi_readmem)5098 static MEMORY_READ16_START( shinobi_readmem )
5099     { 0x000000, 0x03ffff, MRA16_ROM },
5100 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5101 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5102 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5103 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5104 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
5105 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
5106 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
5107 	{ 0xc42002, 0xc42003, input_port_3_word_r },// dip1
5108 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
5109 	{ 0xc43000, 0xc43001, MRA16_NOP },
5110 	{ 0xfff01c, 0xfff01d, shinobi_skip_r },
5111 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5112 MEMORY_END
5113 
5114 static MEMORY_WRITE16_START( shinobi_writemem )
5115     { 0x000000, 0x03ffff, MWA16_ROM },
5116 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5117 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5118 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5119 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5120 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
5121 	{ 0xc43000, 0xc43001, MWA16_NOP },
5122 	{ 0xfe0006, 0xfe0007, sound_command_w },
5123 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5124 MEMORY_END
5125 
5126 /***************************************************************************/
5127 
5128 static void shinobi_update_proc( void ){
5129 	set_fg_page( sys16_textram[0x740] );
5130 	set_bg_page( sys16_textram[0x741] );
5131 	sys16_fg_scrolly = sys16_textram[0x748];
5132 	sys16_bg_scrolly = sys16_textram[0x749];
5133 	sys16_fg_scrollx = sys16_textram[0x74c];
5134 	sys16_bg_scrollx = sys16_textram[0x74d];
5135 }
5136 
MACHINE_INIT(shinobi)5137 static MACHINE_INIT( shinobi ){
5138 	static int bank[16] = {
5139 		0,0,0,0,
5140 		0,0,0,3,
5141 		0,0,0,2,
5142 		0,1,0,0
5143 	};
5144 	sys16_obj_bank = bank;
5145 	sys16_update_proc = shinobi_update_proc;
5146 }
5147 
DRIVER_INIT(shinobi)5148 static DRIVER_INIT( shinobi )
5149 {
5150 	machine_init_sys16_onetime();
5151 }
5152 
5153 /***************************************************************************/
5154 
INPUT_PORTS_START(shinobi)5155 INPUT_PORTS_START( shinobi )
5156 	SYS16_JOY1
5157 	SYS16_JOY2
5158 	SYS16_SERVICE
5159 	SYS16_COINAGE
5160 
5161 PORT_START
5162 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
5163 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
5164 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
5165 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
5166 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5167 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5168 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
5169 	PORT_DIPSETTING(    0x08, "2" )
5170 	PORT_DIPSETTING(    0x0c, "3" )
5171 	PORT_DIPSETTING(    0x04, "5" )
5172 	PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "240", IP_KEY_NONE, IP_JOY_NONE )
5173 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
5174 	PORT_DIPSETTING(    0x20, "Easy" )
5175 	PORT_DIPSETTING(    0x30, "Normal" )
5176 	PORT_DIPSETTING(    0x10, "Hard" )
5177 	PORT_DIPSETTING(    0x00, "Hardest" )
5178 	PORT_DIPNAME( 0x40, 0x40, "Enemy's Bullet Speed" )
5179 	PORT_DIPSETTING(    0x40, "Slow" )
5180 	PORT_DIPSETTING(    0x00, "Fast" )
5181 	PORT_DIPNAME( 0x80, 0x80, "Language" )
5182 	PORT_DIPSETTING(    0x80, "Japanese" )
5183 	PORT_DIPSETTING(    0x00, "English" )
5184 
5185 INPUT_PORTS_END
5186 
5187 /***************************************************************************/
5188 
5189 static MACHINE_DRIVER_START( shinobi )
5190 
5191 	/* basic machine hardware */
5192 	MDRV_IMPORT_FROM(system16_7759)
5193 	MDRV_CPU_MODIFY("main")
5194 	MDRV_CPU_MEMORY(shinobi_readmem,shinobi_writemem)
5195 
5196 	MDRV_MACHINE_INIT(shinobi)
5197 MACHINE_DRIVER_END
5198 
5199 /***************************************************************************/
5200 // sys16A
5201 ROM_START( shinobia )
5202 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
5203 // custom cpu 317-0050
5204 	ROM_LOAD16_BYTE( "epr11262.42", 0x000000, 0x10000, CRC(d4b8df12) SHA1(64bfa2dd8a3d99728d9eeb114887272d9590d0b8) )
5205 	ROM_LOAD16_BYTE( "epr11260.27", 0x000001, 0x10000, CRC(2835c95d) SHA1(b5b42af265d3a16183e02d58b053ec2894072679) )
5206 	ROM_LOAD16_BYTE( "epr11263.43", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
5207 	ROM_LOAD16_BYTE( "epr11261.25", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
5208 
5209 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5210 	ROM_LOAD( "epr11264.95", 0x00000, 0x10000, CRC(46627e7d) SHA1(66bb5b22a2100e7b9df303007a837bc2d52cf7ba) )
5211 	ROM_LOAD( "epr11265.94", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
5212 	ROM_LOAD( "epr11266.93", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
5213 
5214 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
5215 	ROM_LOAD16_BYTE( "epr11290.10", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
5216 	ROM_LOAD16_BYTE( "epr11294.11", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
5217 	ROM_LOAD16_BYTE( "epr11291.17", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
5218 	ROM_LOAD16_BYTE( "epr11295.18", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
5219 	ROM_LOAD16_BYTE( "epr11292.23", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
5220 	ROM_LOAD16_BYTE( "epr11296.24", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
5221 	ROM_LOAD16_BYTE( "epr11293.29", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
5222 	ROM_LOAD16_BYTE( "epr11297.30", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
5223 
5224 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
5225 	ROM_LOAD( "epr11267.12", 0x0000, 0x8000, CRC(dd50b745) SHA1(52e1977569d3713ad864d607170c9a61cd059a65) )
5226 
5227 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
5228 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
5229 
5230 	ROM_REGION( 0x08000, REGION_SOUND1, 0 ) /* 7751 sound data */
5231 	ROM_LOAD( "epr11268.1", 0x0000, 0x8000, CRC(6d7966da) SHA1(90f55a99f784c21d7c135e630f4e8b1d4d043d66) )
5232 ROM_END
5233 
5234 
5235 ROM_START( shinobl )
5236 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
5237 // Star Bootleg
5238 	ROM_LOAD16_BYTE( "b3",          0x000000, 0x10000, CRC(38e59646) SHA1(6a13015a93260ab99811b95950bb122eade01c27) )
5239 	ROM_LOAD16_BYTE( "b1",          0x000001, 0x10000, CRC(8529d192) SHA1(202b912d20a2d82abe055b4a5e8c509ab7d69ff8) )
5240 	ROM_LOAD16_BYTE( "epr11263.43", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
5241 	ROM_LOAD16_BYTE( "epr11261.25", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
5242 
5243 // Beta Bootleg
5244 //	ROM_LOAD16_BYTE( "4",           0x000000, 0x10000, CRC(c178a39c) )
5245 //	ROM_LOAD16_BYTE( "2",           0x000001, 0x10000, CRC(5ad8ebf2) )
5246 //	ROM_LOAD16_BYTE( "epr11263.43", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
5247 //	ROM_LOAD16_BYTE( "epr11261.25", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
5248 
5249 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5250 	ROM_LOAD( "epr11264.95", 0x00000, 0x10000, CRC(46627e7d) SHA1(66bb5b22a2100e7b9df303007a837bc2d52cf7ba) )
5251 	ROM_LOAD( "epr11265.94", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
5252 	ROM_LOAD( "epr11266.93", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
5253 
5254 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
5255 	ROM_LOAD16_BYTE( "epr11290.10", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
5256 	ROM_LOAD16_BYTE( "epr11294.11", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
5257 	ROM_LOAD16_BYTE( "epr11291.17", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
5258 	ROM_LOAD16_BYTE( "epr11295.18", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
5259 	ROM_LOAD16_BYTE( "epr11292.23", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
5260 	ROM_LOAD16_BYTE( "epr11296.24", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
5261 	ROM_LOAD16_BYTE( "epr11293.29", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
5262 //	ROM_LOAD16_BYTE( "epr11297.30", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
5263 	ROM_LOAD16_BYTE( "b17",         0x60000, 0x10000, CRC(0315cf42) SHA1(2d129171aece883cb9c2805f894b3867ec98332b) )	// Beta bootleg uses the rom above.
5264 
5265 	ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
5266 	ROM_LOAD( "epr11267.12", 0x0000, 0x8000, CRC(dd50b745) SHA1(52e1977569d3713ad864d607170c9a61cd059a65) )
5267 
5268 	ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
5269 	ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
5270 
5271 	ROM_REGION( 0x08000, REGION_SOUND1, 0 ) /* 7751 sound data */
5272 	ROM_LOAD( "epr11268.1", 0x0000, 0x8000, CRC(6d7966da) SHA1(90f55a99f784c21d7c135e630f4e8b1d4d043d66) )
5273 ROM_END
5274 
5275 /***************************************************************************/
5276 
5277 static MEMORY_READ16_START( shinobl_readmem )
5278     { 0x000000, 0x03ffff, MRA16_ROM },
5279 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5280 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5281 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5282 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5283 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
5284 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
5285 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
5286 	{ 0xc42000, 0xc42001, input_port_3_word_r }, // dip1
5287 	{ 0xc42002, 0xc42003, input_port_4_word_r }, // dip2
5288 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5289 MEMORY_END
5290 
5291 static MEMORY_WRITE16_START( shinobl_writemem )
5292     { 0x000000, 0x03ffff, MWA16_ROM },
5293 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5294 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5295 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5296 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5297 	{ 0xc40000, 0xc40001, sound_command_nmi_w },
5298 	{ 0xc40002, 0xc40003, sys16_3d_coinctrl_w },
5299 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5300 MEMORY_END
5301 
5302 /***************************************************************************/
5303 
5304 static void shinobl_update_proc( void ){
5305 	set_bg_page( sys16_textram[0x74e] );
5306 	set_fg_page( sys16_textram[0x74f] );
5307 	sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
5308 	sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
5309 	sys16_fg_scrollx = sys16_textram[0x7fc] & 0x01ff;
5310 	sys16_bg_scrollx = sys16_textram[0x7fd] & 0x01ff;
5311 }
5312 
MACHINE_INIT(shinobl)5313 static MACHINE_INIT( shinobl ){
5314 	static int bank[] = {
5315 		0,2,4,6,
5316 		1,3,5,7
5317 	};
5318 	sys16_obj_bank = bank;
5319 	sys16_textmode=1;
5320 	sys16_spritesystem = sys16_sprite_quartet2;
5321 	sys16_sprxoffset = -0xbc;
5322 	sys16_fgxoffset = sys16_bgxoffset = 7;
5323 	sys16_tilebank_switch=0x2000;
5324 
5325 	sys16_update_proc = shinobl_update_proc;
5326 }
5327 
5328 
5329 
5330 /***************************************************************************/
5331 
5332 static MACHINE_DRIVER_START( shinobl )
5333 
5334 	/* basic machine hardware */
MDRV_IMPORT_FROM(system16_7751)5335 	MDRV_IMPORT_FROM(system16_7751)
5336 	MDRV_CPU_MODIFY("main")
5337 	MDRV_CPU_MEMORY(shinobl_readmem,shinobl_writemem)
5338 
5339 	MDRV_MACHINE_INIT(shinobl)
5340 MACHINE_DRIVER_END
5341 
5342 /***************************************************************************/
5343 
5344 static MEMORY_READ16_START( sonicbom_readmem )
5345     { 0x000000, 0x03ffff, MRA16_ROM },
5346 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5347 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5348 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5349 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5350 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
5351 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
5352 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
5353 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
5354 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
5355 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5356 MEMORY_END
5357 
5358 static MEMORY_WRITE16_START( sonicbom_writemem )
5359     { 0x000000, 0x03ffff, MWA16_ROM },
5360 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5361 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5362 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5363 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5364 	{ 0x123406, 0x123407, sound_command_w }, // sonicbom
5365 	{ 0xfe0006, 0xfe0007, sound_command_w }, // tetris
5366 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5367 MEMORY_END
5368 
5369 static void sonicbom_update_proc( void )
5370 {
5371 	sys16_fg_scrolly = sys16_textram[0x748];
5372 	sys16_bg_scrolly = sys16_textram[0x749];
5373 	sys16_fg_scrollx = sys16_textram[0x74c];
5374 	sys16_bg_scrollx = sys16_textram[0x74d];
5375 
5376 	set_fg_page( sys16_textram[0xe80/2] );
5377 	set_bg_page( sys16_textram[0xe82/2] );
5378 }
5379 
MACHINE_INIT(sonicbom)5380 static MACHINE_INIT( sonicbom )
5381 {
5382 //	fd1094_machine_init(); using the decrypted version
5383 //	sys16_sprxoffset = -0x40;
5384 	sys16_update_proc = sonicbom_update_proc;
5385 }
5386 
DRIVER_INIT(sonicbom)5387 static DRIVER_INIT( sonicbom )
5388 {
5389 	machine_init_sys16_onetime();
5390 
5391 	//fd1094_driver_init(0x0053); using the decrypted version
5392 }
5393 
5394 
INPUT_PORTS_START(sonicbom)5395 INPUT_PORTS_START( sonicbom )
5396 	SYS16_JOY1
5397 	SYS16_JOY2
5398 	SYS16_SERVICE
5399 	SYS16_COINAGE
5400 
5401 	PORT_START
5402 	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
5403 	PORT_DIPSETTING(    0x06, "Easy" )
5404 	PORT_DIPSETTING(    0x07, "Normal" )
5405 	PORT_DIPSETTING(    0x05, "Hard 1" )
5406 	PORT_DIPSETTING(    0x04, "Hard 2" )
5407 	PORT_DIPSETTING(    0x03, "Hard 3" )
5408 	PORT_DIPSETTING(    0x02, "Hard 4" )
5409 	PORT_DIPSETTING(    0x01, "Hard 5" )
5410 	PORT_DIPSETTING(    0x00, "Hardest" )
5411 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Lives ) )
5412 	PORT_DIPSETTING(    0x10, "2" )
5413 	PORT_DIPSETTING(    0x18, "3" )
5414 	PORT_DIPSETTING(    0x08, "4" )
5415 	PORT_DIPSETTING(    0x00, "5" )
5416 	PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) )
5417 	PORT_DIPSETTING(    0x40, "30000" )
5418 	PORT_DIPSETTING(    0x60, "40000" )
5419 	PORT_DIPSETTING(    0x20, "50000" )
5420 	PORT_DIPSETTING(    0x00, "60000" )
5421 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
5422 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
5423 	PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
5424 INPUT_PORTS_END
5425 
5426 static MACHINE_DRIVER_START( sonicbom )
5427 
5428 	/* basic machine hardware */
5429 	MDRV_IMPORT_FROM(system16_7759)
5430 	MDRV_CPU_MODIFY("main")
5431 	MDRV_CPU_MEMORY(sonicbom_readmem,sonicbom_writemem)
5432 
5433 	MDRV_MACHINE_INIT(sonicbom)
5434 MACHINE_DRIVER_END
5435 
5436 /***************************************************************************/
5437 
5438 ROM_START( sonicbom )
5439 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
5440     ROM_LOAD16_BYTE( "bootleg_epr-11342.a4",  0x000000, 0x10000, CRC(089158ef) SHA1(25c2685a39a0341dcb59f55dd0b5c7a7b8ee70d4) )
5441 	ROM_LOAD16_BYTE( "bootleg_epr-11340.a1",  0x000001, 0x10000, CRC(253cbd27) SHA1(72dd84ce85fe651747477153b0bbaa870d3166f8) )
5442 	ROM_LOAD16_BYTE( "epr11343.a5",  0x020000, 0x10000, CRC(edfeb7d4) SHA1(0f703e028f9ca9f3c4f5563f3c65ec9b938074a5) )
5443 	ROM_LOAD16_BYTE( "epr11341.a2",  0x020001, 0x10000, CRC(0338f771) SHA1(a1a2928eb3f9826733bad54bbf17f622d9307285) )
5444 
5445 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5446 	ROM_LOAD( "opr11344.b9",  0x00000, 0x10000, CRC(59a9f940) SHA1(b1c13cfa9609a22cbe047ee39681ccf8d0b3cf9c) )
5447 	ROM_LOAD( "opr11345.b10", 0x10000, 0x10000, CRC(b44c068b) SHA1(05e875dc418aef12fc48d1df44f680249f6952de) )
5448 	ROM_LOAD( "opr11346.b11", 0x20000, 0x10000, CRC(e5ada66c) SHA1(7e8e34ea909848d0d1b1fcccf628bf9ec169ae9b) )
5449 
5450 	ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_ERASE00 ) /* sprites */
5451 	ROM_LOAD16_BYTE( "opr11352.b3", 0x60001, 0x010000, CRC(047fa4b0) SHA1(d6c6f920a71db7734000cb64f3001145c4e05c6e) ) // |
5452 	ROM_LOAD16_BYTE( "opr11356.b7", 0x60000, 0x010000, CRC(aea3c39d) SHA1(2a4f01463b3f29c8d6858c3e99ef70ac548598b4) ) //  \Guns on desert floor (2nd attract level)
5453 	ROM_LOAD16_BYTE( "opr11351.b2", 0xa0001, 0x010000, CRC(63b1f1ca) SHA1(1f19a3af099d4a6ad196968b0a3c17a11384e474) ) // |
5454 	ROM_LOAD16_BYTE( "opr11355.b6", 0xa0000, 0x010000, CRC(fe0fa332) SHA1(15ea820f87399e35b798969d3800614701a61161) ) //  \Turrets on buildings (1st attract level)
5455 	ROM_LOAD16_BYTE( "opr11350.b1", 0xc0001, 0x010000, CRC(525ba1df) SHA1(e35487c8bf4009a767e54258d9a55056d13ba02a) ) // |
5456 	ROM_LOAD16_BYTE( "opr11354.b5", 0xc0000, 0x010000, CRC(793fa3ac) SHA1(14d5a71667b4745d5b556cc15334dd9bff8de93f) ) //  \Title Logo, Player Ship
5457 	ROM_LOAD16_BYTE( "opr11353.b4", 0xe0001, 0x010000, CRC(4e0791f8) SHA1(3278bfd478a2fdbcf2d641268c9ca4ccd5a5bd2f) ) // |
5458 	ROM_LOAD16_BYTE( "opr11357.b8", 0xe0000, 0x010000, CRC(a7c5ea41) SHA1(405e6ebd2cff22179de70fd31fae5ff967fbaf63) ) //  \Player Bullets etc.
5459 
5460 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
5461 	ROM_LOAD( "epr11347.a7", 0x00000, 0x8000, CRC(b41f0ced) SHA1(946b58c0f5b4541fac93add065916319302fe5e0) )
5462 	ROM_LOAD( "epr11348.a8", 0x10000, 0x8000, CRC(89924588) SHA1(9b97da0f562c5faaf12e0f3f8943cdb4fe7a9d24) )
5463 	ROM_LOAD( "epr11349.a9", 0x20000, 0x8000, CRC(8e4b6204) SHA1(ec0a2812b4726b5ff236f2fbb63fd2dd13cf4935) )
5464 ROM_END
5465 
5466 // sys16A custom
5467 ROM_START( tetris )
5468 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
5469 	ROM_LOAD16_BYTE( "epr12201.rom", 0x000000, 0x8000, CRC(338e9b51) SHA1(f56a1124c963d4ad72a806b26f9aa906aaa37d2b) )
5470 	ROM_LOAD16_BYTE( "epr12200.rom", 0x000001, 0x8000, CRC(fb058779) SHA1(0045985ea943ebc7e44bd95127c5e5212c2821e8) )
5471 
5472 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5473 	ROM_LOAD( "epr12202.rom", 0x00000, 0x10000, CRC(2f7da741) SHA1(51a685673b4a57a13818eca65d122230f20bd9a0) )
5474 	ROM_LOAD( "epr12203.rom", 0x10000, 0x10000, CRC(a6e58ec5) SHA1(5a6c43c989768270e0ab61cfaa5ef86d4607fe20) )
5475 	ROM_LOAD( "epr12204.rom", 0x20000, 0x10000, CRC(0ae98e23) SHA1(f067b81b85f9e03a6373c7c53ff52d5395b8a985) )
5476 
5477 	ROM_REGION( 0x10000, REGION_GFX2, 0 ) /* sprites */
5478 	ROM_LOAD16_BYTE( "epr12169.rom", 0x0001, 0x8000, CRC(dacc6165) SHA1(87b1a7643e3630ff73b2b117752496e1ea5da23d) )
5479 	ROM_LOAD16_BYTE( "epr12170.rom", 0x0000, 0x8000, CRC(87354e42) SHA1(e7fd55aee59b51d82cb9b619fbb815ad6839560c) )
5480 
5481 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
5482 	ROM_LOAD( "epr12205.rom", 0x0000, 0x8000, CRC(6695dc99) SHA1(08123aa24c302bc9243329384bd9c2545a4d50c3) )
5483 ROM_END
5484 
5485 // sys16B
5486 ROM_START( tetrisbl )
5487 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
5488 	ROM_LOAD16_BYTE( "rom2.bin", 0x000000, 0x10000, CRC(4d165c38) SHA1(04706b1977ae18bd09bafaf8ea65f8e5f32e04b8) )
5489 	ROM_LOAD16_BYTE( "rom1.bin", 0x000001, 0x10000, CRC(1e912131) SHA1(8f53504ac08942ee340489d84eab825e654d0a2c) )
5490 
5491 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5492 	ROM_LOAD( "scr01.rom", 0x00000, 0x10000, CRC(62640221) SHA1(c311d3847a981d0e1609f9b3d80481565d32d78c) )
5493 	ROM_LOAD( "scr02.rom", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
5494 	ROM_LOAD( "scr03.rom", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
5495 
5496 	ROM_REGION( 0x020000, REGION_GFX2, 0 ) /* sprites */
5497 	ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
5498 	ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
5499 
5500 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
5501 	ROM_LOAD( "s-prog.rom", 0x0000, 0x8000, CRC(bd9ba01b) SHA1(fafa7dc36cc057a50ae4cdf7a35f3594292336f4) )
5502 ROM_END
5503 
5504 // sys16B
5505 ROM_START( tetrisa )
5506 	ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
5507 // Custom Cpu 317-0092
5508 	ROM_LOAD16_BYTE( "tetris.a7", 0x000000, 0x10000, CRC(9ce15ac9) SHA1(0fdbd3ca37e4c0efa7c66415714bfc10637ced6c) )
5509 	ROM_LOAD16_BYTE( "tetris.a5", 0x000001, 0x10000, CRC(98d590ca) SHA1(4d18409c0b5734d0adcea5646d13f65b687dd05d) )
5510 
5511 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5512 	ROM_LOAD( "scr01.rom", 0x00000, 0x10000, CRC(62640221) SHA1(c311d3847a981d0e1609f9b3d80481565d32d78c) )
5513 	ROM_LOAD( "scr02.rom", 0x10000, 0x10000, CRC(9abd183b) SHA1(621b017cb34973f9227be383e26b5cd41aea9422) )
5514 	ROM_LOAD( "scr03.rom", 0x20000, 0x10000, CRC(2495fd4e) SHA1(2db94ead9223a67238a97e724668076fc43e5534) )
5515 
5516 	ROM_REGION( 0x020000, REGION_GFX2, 0 ) /* sprites */
5517 	ROM_LOAD16_BYTE( "obj0-o.rom", 0x00001, 0x10000, CRC(2fb38880) SHA1(0e1b601bbda78d1887951c1f7e752531c281bc83) )
5518 	ROM_LOAD16_BYTE( "obj0-e.rom", 0x00000, 0x10000, CRC(d6a02cba) SHA1(d80000f92e754e89c6ca7b7273feab448fc9a061) )
5519 
5520 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
5521 	ROM_LOAD( "s-prog.rom", 0x0000, 0x8000, CRC(bd9ba01b) SHA1(fafa7dc36cc057a50ae4cdf7a35f3594292336f4) )
5522 ROM_END
5523 
5524 /***************************************************************************/
5525 
5526 static MEMORY_READ16_START( tetris_readmem )
5527     { 0x000000, 0x01ffff, MRA16_ROM },
5528 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5529 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5530 	{ 0x418000, 0x41803f, SYS16_MRA16_EXTRAM2 },
5531 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5532 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5533 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
5534 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
5535 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
5536 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
5537 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
5538 	{ 0xc80000, 0xc80001, MRA16_NOP },
5539 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5540 MEMORY_END
5541 
5542 static MEMORY_WRITE16_START( tetris_writemem )
5543     { 0x000000, 0x01ffff, MWA16_ROM },
5544 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5545 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5546 	{ 0x418000, 0x41803f, SYS16_MWA16_EXTRAM2, &sys16_extraram2 },
5547 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5548 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5549 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
5550 	{ 0xc42006, 0xc42007, sound_command_w },
5551 	{ 0xc43034, 0xc43035, MWA16_NOP },
5552 	{ 0xc80000, 0xc80001, MWA16_NOP },
5553 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5554 MEMORY_END
5555 
5556 /***************************************************************************/
5557 
5558 static void tetris_update_proc( void ){
5559 	sys16_fg_scrolly = sys16_textram[0x748];
5560 	sys16_bg_scrolly = sys16_textram[0x749];
5561 	sys16_fg_scrollx = sys16_textram[0x74c];
5562 	sys16_bg_scrollx = sys16_textram[0x74d];
5563 
5564 	set_fg_page( sys16_extraram2[0x38/2] );
5565 	set_bg_page( sys16_extraram2[0x28/2] );
5566 }
5567 
MACHINE_INIT(tetris)5568 static MACHINE_INIT( tetris ){
5569 	sys16_patch_code( 0xba6, 0x4e );
5570 	sys16_patch_code( 0xba7, 0x71 );
5571 
5572 	sys16_sprxoffset = -0x40;
5573 	sys16_update_proc = tetris_update_proc;
5574 }
5575 
DRIVER_INIT(tetris)5576 static DRIVER_INIT( tetris )
5577 {
5578 	machine_init_sys16_onetime();
5579 }
5580 
DRIVER_INIT(tetrisbl)5581 static DRIVER_INIT( tetrisbl )
5582 {
5583 	machine_init_sys16_onetime();
5584 }
5585 /***************************************************************************/
5586 
INPUT_PORTS_START(tetris)5587 INPUT_PORTS_START( tetris )
5588 	SYS16_JOY1
5589 	SYS16_JOY2
5590 	SYS16_SERVICE
5591 	SYS16_COINAGE /* unconfirmed */
5592 
5593 PORT_START	/* DSW1 */
5594 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
5595 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5596 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5597 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
5598 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5599 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5600 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) )	// from the code it looks like some kind of difficulty
5601 	PORT_DIPSETTING(    0x0c, "A" )					// level, but all 4 levels points to the same place
5602 	PORT_DIPSETTING(    0x08, "B" )					// so it doesn't actually change anything!!
5603 	PORT_DIPSETTING(    0x04, "C" )
5604 	PORT_DIPSETTING(    0x00, "D" )
5605 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
5606 	PORT_DIPSETTING(    0x20, "Easy" )
5607 	PORT_DIPSETTING(    0x30, "Normal" )
5608 	PORT_DIPSETTING(    0x10, "Hard" )
5609 	PORT_DIPSETTING(    0x00, "Hardest" )
5610 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
5611 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5612 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5613 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
5614 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5615 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5616 INPUT_PORTS_END
5617 
5618 /***************************************************************************/
5619 
5620 static MACHINE_DRIVER_START( tetris )
5621 
5622 	/* basic machine hardware */
5623 	MDRV_IMPORT_FROM(system16)
5624 	MDRV_CPU_MODIFY("main")
5625 	MDRV_CPU_MEMORY(tetris_readmem,tetris_writemem)
5626 
5627 	MDRV_MACHINE_INIT(tetris)
5628 MACHINE_DRIVER_END
5629 
5630 /***************************************************************************/
5631 // sys16B
5632 ROM_START( timscanr )
5633 	ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
5634 	ROM_LOAD16_BYTE( "ts10853.bin", 0x00000, 0x8000, CRC(24d7c5fb) SHA1(b1796e77cf968f9bdae7a47c5c02b93aaec10ade) )
5635 	ROM_LOAD16_BYTE( "ts10850.bin", 0x00001, 0x8000, CRC(f1575732) SHA1(d0c8fc42171c436cc1cd55a33295bd019a474d47) )
5636 	ROM_LOAD16_BYTE( "ts10854.bin", 0x10000, 0x8000, CRC(82d0b237) SHA1(c1defda4785014ccd7164f49f53f77e36fcb3a8d) )
5637 	ROM_LOAD16_BYTE( "ts10851.bin", 0x10001, 0x8000, CRC(f5ce271b) SHA1(8b4f1178c87e657d8d5805d908100f0d5fb030da) )
5638 	ROM_LOAD16_BYTE( "ts10855.bin", 0x20000, 0x8000, CRC(63e95a53) SHA1(60c42bbb1c316deb493a237990a7938551f8bc2e) )
5639 	ROM_LOAD16_BYTE( "ts10852.bin", 0x20001, 0x8000, CRC(7cd1382b) SHA1(6263cc863cbf0ef66a7ba8cc1c98212917d7c131) )
5640 
5641 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5642 	ROM_LOAD( "timscanr.b9",  0x00000, 0x8000, CRC(07dccc37) SHA1(544cc6a3b3ef64727ecf5098b84ade2dd5330614) )
5643 	ROM_LOAD( "timscanr.b10", 0x08000, 0x8000, CRC(84fb9a3a) SHA1(efde54cc9582f68e58cae05f717a4fc8f620c0fc) )
5644 	ROM_LOAD( "timscanr.b11", 0x10000, 0x8000, CRC(c8694bc0) SHA1(e48fc349ef454ded86141937f70b006e64da6b6b) )
5645 
5646 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites */
5647 	ROM_LOAD16_BYTE( "ts10548.bin", 0x00001, 0x8000, CRC(aa150735) SHA1(b6e6ff9229c641e196fc7a0a2cf7aa362f554676) )
5648 	ROM_LOAD16_BYTE( "ts10552.bin", 0x00000, 0x8000, CRC(6fcbb9f7) SHA1(0a0fab930477d8b79e500263bbc80d3bf73778f8) )
5649 	ROM_LOAD16_BYTE( "ts10549.bin", 0x10001, 0x8000, CRC(2f59f067) SHA1(1fb64cce2f98ddcb5ecb662e63ea636a8da08bcd) )
5650 	ROM_LOAD16_BYTE( "ts10553.bin", 0x10000, 0x8000, CRC(8a220a9f) SHA1(c17547d85721fa19e5f445b5be30b3fbf5e8cc6e) )
5651 	ROM_LOAD16_BYTE( "ts10550.bin", 0x20001, 0x8000, CRC(f05069ff) SHA1(bd95761036c2fad8ddf4e169d899b173822ee4b0) )
5652 	ROM_LOAD16_BYTE( "ts10554.bin", 0x20000, 0x8000, CRC(dc64f809) SHA1(ea85eefa98ec55e9e872940821a959ff4eb1bd1c) )
5653 	ROM_LOAD16_BYTE( "ts10551.bin", 0x30001, 0x8000, CRC(435d811f) SHA1(b28eb09620113cd7578387c4d96029f2acb8ec06) )
5654 	ROM_LOAD16_BYTE( "ts10555.bin", 0x30000, 0x8000, CRC(2143c471) SHA1(d413aa216349ddf773a39d2826c3a940b4149229) )
5655 
5656 	ROM_REGION( 0x18000, REGION_CPU2, 0 ) /* sound CPU */
5657 	ROM_LOAD( "ts10562.bin", 0x0000, 0x8000, CRC(3f5028bf) SHA1(02081569a5f4dc64771e97651a9902a98d54a952) )
5658 	ROM_LOAD( "ts10563.bin", 0x10000, 0x8000, CRC(9db7eddf) SHA1(8b9a27442a623bee6b9b5b06275226734d132e17) )
5659 ROM_END
5660 
5661 /***************************************************************************/
5662 
5663 static READ16_HANDLER( timscanr_skip_r ){
5664 	if (activecpu_get_pc()==0x1044c) {cpu_spinuntil_int(); return 0;}
5665 	return sys16_workingram[0x000c/2];
5666 }
5667 
MEMORY_READ16_START(timscanr_readmem)5668 static MEMORY_READ16_START( timscanr_readmem )
5669     { 0x000000, 0x02ffff, MRA16_ROM },
5670 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5671 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5672 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5673 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5674 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
5675 	{ 0xc41006, 0xc41007, input_port_1_word_r },// player2
5676 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
5677 	{ 0xc42002, 0xc42003, input_port_3_word_r },// dip1
5678 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
5679 	{ 0xc41004, 0xc41005, input_port_5_word_r }, // dip3
5680 	{ 0xffc00c, 0xffc00d, timscanr_skip_r },
5681 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5682 MEMORY_END
5683 
5684 static MEMORY_WRITE16_START( timscanr_writemem )
5685     { 0x000000, 0x02ffff, MWA16_ROM },
5686 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5687 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5688 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5689 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5690 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
5691 	{ 0xfe0006, 0xfe0007, sound_command_w },
5692 	{ 0xfe0020, 0xfe003f, MWA16_NOP },
5693 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5694 MEMORY_END
5695 
5696 /***************************************************************************/
5697 
5698 static void timscanr_update_proc( void ){
5699 	set_fg_page( sys16_textram[0x740] );
5700 	set_bg_page( sys16_textram[0x741] );
5701 	sys16_fg_scrolly = sys16_textram[0x748];
5702 	sys16_bg_scrolly = sys16_textram[0x749];
5703 	sys16_fg_scrollx = sys16_textram[0x74c];
5704 	sys16_bg_scrollx = sys16_textram[0x74d];
5705 }
5706 
MACHINE_INIT(timscanr)5707 static MACHINE_INIT( timscanr ){
5708 	static int bank[16] = {
5709 		0,0,0,0,
5710 		0,0,0,3,
5711 		0,0,0,2,
5712 		0,1,0,0
5713 	};
5714 	sys16_obj_bank = bank;
5715 
5716 	sys16_textmode=1;
5717 	sys16_update_proc = timscanr_update_proc;
5718 	sys16_wwfix = -1; //*
5719 }
5720 
DRIVER_INIT(timscanr)5721 static DRIVER_INIT( timscanr ){
5722 	machine_init_sys16_onetime();
5723 }
5724 /***************************************************************************/
5725 
INPUT_PORTS_START(timscanr)5726 INPUT_PORTS_START( timscanr )
5727 	SYS16_JOY1
5728 	SYS16_JOY2
5729 	SYS16_SERVICE
5730 	SYS16_COINAGE
5731 
5732 PORT_START	/* DSW2 */
5733 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )		//??
5734 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
5735 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
5736 	PORT_DIPNAME( 0x1e, 0x14, "Bonus" )
5737 	PORT_DIPSETTING(    0x16, "Replay 1000000/2000000" )
5738 	PORT_DIPSETTING(    0x14, "Replay 1200000/2500000" )
5739 	PORT_DIPSETTING(    0x12, "Replay 1500000/3000000" )
5740 	PORT_DIPSETTING(    0x10, "Replay 2000000/4000000" )
5741 	PORT_DIPSETTING(    0x1c, "Replay 1000000" )
5742 	PORT_DIPSETTING(    0x1e, "Replay 1200000" )
5743 	PORT_DIPSETTING(    0x1a, "Replay 1500000" )
5744 	PORT_DIPSETTING(    0x18, "Replay 1800000" )
5745 	PORT_DIPSETTING(    0x0e, "ExtraBall 100000" )
5746 	PORT_DIPSETTING(    0x0c, "ExtraBall 200000" )
5747 	PORT_DIPSETTING(    0x0a, "ExtraBall 300000" )
5748 	PORT_DIPSETTING(    0x08, "ExtraBall 400000" )
5749 	PORT_DIPSETTING(    0x06, "ExtraBall 500000" )
5750 	PORT_DIPSETTING(    0x04, "ExtraBall 600000" )
5751 	PORT_DIPSETTING(    0x02, "ExtraBall 700000" )
5752 	PORT_DIPSETTING(    0x00, "None" )
5753 
5754 	PORT_DIPNAME( 0x20, 0x20, "Match" )
5755 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
5756 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
5757 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
5758 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5759 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5760 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
5761 	PORT_DIPSETTING(    0x80, "3" )
5762 	PORT_DIPSETTING(    0x00, "5" )
5763 
5764 PORT_START	/* DSW3 */
5765 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )		//??
5766 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5767 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5768 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
5769 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5770 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5771 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) )
5772 	PORT_DIPSETTING(    0x04, "1" )
5773 	PORT_DIPSETTING(    0x0c, "2" )
5774 	PORT_DIPSETTING(    0x08, "3" )
5775 	PORT_DIPSETTING(    0x00, "None" )
5776 	PORT_DIPNAME( 0x10, 0x10, "Allow Continue" )
5777 	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
5778 	PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
5779 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
5780 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5781 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5782 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
5783 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5784 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5785 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
5786 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5787 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5788 
5789 INPUT_PORTS_END
5790 
5791 /***************************************************************************/
5792 
5793 static MACHINE_DRIVER_START( timscanr )
5794 
5795 	/* basic machine hardware */
5796 	MDRV_IMPORT_FROM(system16_7759)
5797 	MDRV_CPU_MODIFY("main")
5798 	MDRV_CPU_MEMORY(timscanr_readmem,timscanr_writemem)
5799 
5800 	MDRV_MACHINE_INIT(timscanr)
5801 MACHINE_DRIVER_END
5802 
5803 /***************************************************************************/
5804 
5805 // sys16B
5806 ROM_START( toryumon )
5807 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
5808 	ROM_LOAD16_BYTE( "17689",  0x00000, 0x20000, CRC(4f0dee19) SHA1(efb5bf29e27029e9ea3fdd57ad7af54b4e1e9a97) )
5809 	ROM_LOAD16_BYTE( "17688",  0x00001, 0x20000, CRC(717d81c7) SHA1(293cd9859a2a3aad89c47fdad2ca6aa48e9f74cb) )
5810 
5811 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5812 	ROM_LOAD( "17700", 0x00000, 0x40000, CRC(8f288b37) SHA1(f0c1bb60ace8078566b51ab91fc35d2981c9f32c) )
5813 	ROM_LOAD( "17701", 0x40000, 0x40000, CRC(6dfb025b) SHA1(502c16f650596a791fae1834f9bce6f3aa25c45f) )
5814 	ROM_LOAD( "17702", 0x80000, 0x40000, CRC(ae0b7eab) SHA1(403ca2b50913a744e2c5e1cd0d59c69df5464836) )
5815 
5816 	ROM_REGION( 0x100000, REGION_GFX2, 0 ) /* sprites */
5817 	ROM_LOAD16_BYTE( "17692", 0x00001, 0x20000, CRC(543c4327) SHA1(9f40163aaf165f5e4f5aefd8ce083d5f72ded125) )
5818 	ROM_LOAD16_BYTE( "17695", 0x00000, 0x20000, CRC(ee60f244) SHA1(21b912e12f6a56ea6b9e5e0be117b447d1ecda43) )
5819 	ROM_LOAD16_BYTE( "17693", 0x40001, 0x20000, CRC(4a350b3e) SHA1(70181bf713106475cdf684f86d593ee323ded2ca) )
5820 	ROM_LOAD16_BYTE( "17696", 0x40000, 0x20000, CRC(6edb54f1) SHA1(8188d76db16bcf2f6bbfd0d61499e0d0a128bb27) )
5821 	ROM_LOAD16_BYTE( "17694", 0x80001, 0x20000, CRC(b296d71d) SHA1(28f55fa451c4856f6fd6d4d9b16b4c3ef963ee5b) )
5822 	ROM_LOAD16_BYTE( "17697", 0x80000, 0x20000, CRC(6ccb7b28) SHA1(7a82230b575bfabb150141183d3c37c44a0d41ad) )
5823 	ROM_LOAD16_BYTE( "17698", 0xc0001, 0x20000, CRC(cd4dfb82) SHA1(def5847a94cd7da96f5434b62b22925fbb8da151) )
5824 	ROM_LOAD16_BYTE( "17699", 0xc0000, 0x20000, CRC(2694ecce) SHA1(85d7ab89d4fd0aa0ca942485f94c5737deaa8eff) )
5825 
5826 
5827 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
5828 	ROM_LOAD( "17691", 0x00000,  0x08000, CRC(14205388) SHA1(0b580d4ef52eab2d71541d44fbd32676b2277aa1) )
5829 	ROM_LOAD( "17690", 0x10000,  0x40000, CRC(4f9ba4e4) SHA1(450d821ef12dbb24cf85ac10c77e9b31c03112b1) )
5830 ROM_END
5831 
5832 /***************************************************************************/
5833 
5834 static MEMORY_READ16_START( toryumon_readmem )
5835     { 0x000000, 0x03ffff, MRA16_ROM },
5836 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
5837 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
5838 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
5839 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
5840 	{ 0xe41002, 0xe41003, input_port_0_word_r }, // player1
5841 	{ 0xe41004, 0xe41005, MRA16_NOP },
5842 	{ 0xe41006, 0xe41007, input_port_1_word_r }, // player2
5843 	{ 0xe41000, 0xe41001, input_port_2_word_r }, // service
5844 	{ 0xe42002, 0xe42003, input_port_3_word_r }, // dip1
5845 	{ 0xe42000, 0xe42001, input_port_4_word_r }, // dip2
5846 	{ 0xff0000, 0xffffff, SYS16_MRA16_WORKINGRAM },
5847 MEMORY_END
5848 
5849 static MEMORY_WRITE16_START( toryumon_writemem )
5850     { 0x000000, 0x03ffff, MWA16_ROM },
5851 	{ 0x3e2000, 0x3e2003, sys16_tilebank_w },
5852 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
5853 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
5854 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
5855 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
5856 	{ 0xe40000, 0xe40001, sys16_coinctrl_w },
5857 	{ 0xe43000, 0xe43fff, MWA16_NOP },
5858 	{ 0xfe0006, 0xfe0007, sound_command_w },
5859 	{ 0xfe0020, 0xfe003f, MWA16_NOP }, // config regs
5860 	{ 0xff0000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
5861 MEMORY_END
5862 
5863 /***************************************************************************/
5864 
5865 static void toryumon_update_proc( void ){
5866 	set_fg_page( sys16_textram[0x740] );
5867 	set_bg_page( sys16_textram[0x741] );
5868 	sys16_fg_scrolly = sys16_textram[0x748];
5869 	sys16_bg_scrolly = sys16_textram[0x749];
5870 	sys16_fg_scrollx = sys16_textram[0x74c];
5871 	sys16_bg_scrollx = sys16_textram[0x74d];
5872 }
5873 
MACHINE_INIT(toryumon)5874 static MACHINE_INIT( toryumon ){
5875 	sys16_update_proc = toryumon_update_proc;
5876 }
5877 
DRIVER_INIT(toryumon)5878 static DRIVER_INIT( toryumon )
5879 {
5880 	machine_init_sys16_onetime();
5881 }
5882 /***************************************************************************/
5883 
INPUT_PORTS_START(toryumon)5884 INPUT_PORTS_START( toryumon )
5885 	SYS16_JOY1
5886 	SYS16_JOY2
5887 	SYS16_SERVICE
5888 	SYS16_COINAGE
5889 
5890 PORT_START	/* DSW1 */
5891 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
5892 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5893 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5894 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
5895 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5896 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5897 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
5898 	PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
5899 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5900 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
5901 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5902 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5903 	PORT_DIPNAME( 0x10, 0x10, "VS-Mode Battle" )
5904 	PORT_DIPSETTING(    0x10, "1" )
5905 	PORT_DIPSETTING(    0x00, "3" )
5906 	PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Difficulty ) )
5907 	PORT_DIPSETTING(    0xc0, "Easy" )
5908 	PORT_DIPSETTING(    0xe0, "Normal" )
5909 	PORT_DIPSETTING(    0xa0, "Hard" )
5910 	PORT_DIPSETTING(    0x80, "Hard+1" )
5911 	PORT_DIPSETTING(    0x60, "Hard+2" )
5912 	PORT_DIPSETTING(    0x40, "Hard+3" )
5913 	PORT_DIPSETTING(    0x20, "Hard+4" )
5914 	PORT_DIPSETTING(    0x00, "Hard+5" )
5915 INPUT_PORTS_END
5916 
5917 /***************************************************************************/
5918 
5919 static MACHINE_DRIVER_START( toryumon )
5920 
5921 	/* basic machine hardware */
5922 	MDRV_IMPORT_FROM(system16_7759)
5923 	MDRV_CPU_MODIFY("main")
5924 	MDRV_CPU_MEMORY(toryumon_readmem,toryumon_writemem)
5925 
5926 	MDRV_MACHINE_INIT(toryumon)
5927 MACHINE_DRIVER_END
5928 
5929 /***************************************************************************/
5930 
5931 // sys16B
5932 ROM_START( tturf )
5933 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
5934 	ROM_LOAD16_BYTE( "12327.7a",  0x00000, 0x20000, CRC(0376c593) SHA1(3057828b16ee3b7cbb57a76047eecf74d1d8b465) )
5935 	ROM_LOAD16_BYTE( "12326.5a",  0x00001, 0x20000, CRC(f998862b) SHA1(69902ab0162eb42e1d6a9792651a5d41cb77477d) )
5936 
5937 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5938 	ROM_LOAD( "12268.14a", 0x00000, 0x10000, CRC(e0dac07f) SHA1(c7f6de42eb93a8f34afdc300628735b5f40a34c2) )
5939 	ROM_LOAD( "12269.15a", 0x10000, 0x10000, CRC(457a8790) SHA1(b701e1a1745cefb31083c8a3daa3b23181f89576) )
5940 	ROM_LOAD( "12270.16a", 0x20000, 0x10000, CRC(69fc025b) SHA1(20be1242de27f1b997d43890051cc5d5ac8a127a) )
5941 
5942 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
5943 	ROM_LOAD16_BYTE( "12279.1b", 0x00001, 0x10000, CRC(7a169fb1) SHA1(1ec6da0d2cfcf727e61f61c847fd8b975b64f944) )
5944 	ROM_LOAD16_BYTE( "12283.5b", 0x00000, 0x10000, CRC(ae0fa085) SHA1(ae9af92d4dd0c8a0f064d24e647522b588fbd7f7) )
5945 	ROM_LOAD16_BYTE( "12278.2b", 0x20001, 0x10000, CRC(961d06b7) SHA1(b1a9dea63785bfa2c0e7b931387b91dfcd27d79b) )
5946 	ROM_LOAD16_BYTE( "12282.6b", 0x20000, 0x10000, CRC(e8671ee1) SHA1(a3732938c370f1936d867aae9c3d1e9bbfb57ede) )
5947 	ROM_LOAD16_BYTE( "12277.3b", 0x40001, 0x10000, CRC(f16b6ba2) SHA1(00cc04c7b5aad82d51d2d252e1e57bcdc5e2c9e3) )
5948 	ROM_LOAD16_BYTE( "12281.7b", 0x40000, 0x10000, CRC(1ef1077f) SHA1(8ce6fd7d32a20b93b3f91aaa43fe22720da7236f) )
5949 	ROM_LOAD16_BYTE( "12276.4b", 0x60001, 0x10000, CRC(838bd71f) SHA1(82d9d127438f5e1906b1cf40bf3b4727f2ee5685) )
5950 	ROM_LOAD16_BYTE( "12280.8b", 0x60000, 0x10000, CRC(639a57cb) SHA1(84fd8b96758d38f9e1ba1a3c2cf8099ec0452784) )
5951 
5952 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
5953 	ROM_LOAD( "12328.10a", 0x0000, 0x8000, NO_DUMP )
5954 	ROM_LOAD( "12329.11a", 0x10000, 0x10000, CRC(ed9a686d) SHA1(da433033d501ee871429ee676b3972b14179df9f) )		// speech
5955 	ROM_LOAD( "12330.12a", 0x20000, 0x10000, CRC(fb762bca) SHA1(ff9191c5ec38c711ebb7c2ad043f62b6d7e2203c) )
5956 
5957 ROM_END
5958 
5959 // sys16B
5960 ROM_START( tturfu )
5961 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
5962 	ROM_LOAD16_BYTE( "epr12266.bin",  0x00000, 0x10000, CRC(f549def8) SHA1(9e913509d46274bd192455321904ec9884b5f629) )
5963 	ROM_LOAD16_BYTE( "epr12264.bin",  0x00001, 0x10000, CRC(f7cdb289) SHA1(9c386cf33a96a977c623c2f243db38fda2c41ba4) )
5964 	ROM_LOAD16_BYTE( "epr12267.bin",  0x20000, 0x10000, CRC(3c3ce191) SHA1(036ece2be585a85e05c047fe4a1ab3b6814c3490) )
5965 	ROM_LOAD16_BYTE( "epr12265.bin",  0x20001, 0x10000, CRC(8cdadd9a) SHA1(a17852f0eb8f63a82ff44cbeb100da72fe5890e0) )
5966 
5967 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
5968 	ROM_LOAD( "12268.14a", 0x00000, 0x10000, CRC(e0dac07f) SHA1(c7f6de42eb93a8f34afdc300628735b5f40a34c2) )
5969 	ROM_LOAD( "12269.15a", 0x10000, 0x10000, CRC(457a8790) SHA1(b701e1a1745cefb31083c8a3daa3b23181f89576) )
5970 	ROM_LOAD( "12270.16a", 0x20000, 0x10000, CRC(69fc025b) SHA1(20be1242de27f1b997d43890051cc5d5ac8a127a) )
5971 
5972 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
5973 	ROM_LOAD16_BYTE( "12279.1b", 0x00001, 0x10000, CRC(7a169fb1) SHA1(1ec6da0d2cfcf727e61f61c847fd8b975b64f944) )
5974 	ROM_LOAD16_BYTE( "12283.5b", 0x00000, 0x10000, CRC(ae0fa085) SHA1(ae9af92d4dd0c8a0f064d24e647522b588fbd7f7) )
5975 	ROM_LOAD16_BYTE( "12278.2b", 0x20001, 0x10000, CRC(961d06b7) SHA1(b1a9dea63785bfa2c0e7b931387b91dfcd27d79b) )
5976 	ROM_LOAD16_BYTE( "12282.6b", 0x20000, 0x10000, CRC(e8671ee1) SHA1(a3732938c370f1936d867aae9c3d1e9bbfb57ede) )
5977 	ROM_LOAD16_BYTE( "12277.3b", 0x40001, 0x10000, CRC(f16b6ba2) SHA1(00cc04c7b5aad82d51d2d252e1e57bcdc5e2c9e3) )
5978 	ROM_LOAD16_BYTE( "12281.7b", 0x40000, 0x10000, CRC(1ef1077f) SHA1(8ce6fd7d32a20b93b3f91aaa43fe22720da7236f) )
5979 	ROM_LOAD16_BYTE( "12276.4b", 0x60001, 0x10000, CRC(838bd71f) SHA1(82d9d127438f5e1906b1cf40bf3b4727f2ee5685) )
5980 	ROM_LOAD16_BYTE( "12280.8b", 0x60000, 0x10000, CRC(639a57cb) SHA1(84fd8b96758d38f9e1ba1a3c2cf8099ec0452784) )
5981 
5982 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
5983 	ROM_LOAD( "epr12271.bin", 0x00000,  0x8000, CRC(99671e52) SHA1(ab21b7e7a449c8081b5db1fdb579071e31b6852c) )
5984 	ROM_LOAD( "epr12272.bin", 0x10000, 0x8000, CRC(7cf7e69f) SHA1(62c9f75db8e2b4ece517167ba5c0712bac5f1d95) )
5985 	ROM_LOAD( "epr12273.bin", 0x18000, 0x8000, CRC(28f0bb8b) SHA1(d99aff57d213b10ac10c37ceff2f125875816488) )
5986 	ROM_LOAD( "epr12274.bin", 0x20000, 0x8000, CRC(8207f0c4) SHA1(169914861a52fa731a305e1ee2d230aa0d0d97fe) )
5987 	ROM_LOAD( "epr12275.bin", 0x28000, 0x8000, CRC(182f3c3d) SHA1(1482fe08a05a721e315b1a3aa5bef4dddc72e26e) )
5988 
5989 ROM_END
5990 
5991 /***************************************************************************/
5992 static READ16_HANDLER( tt_io_player1_r ){ return input_port_0_r( offset ) << 8; }
READ16_HANDLER(tt_io_player2_r)5993 static READ16_HANDLER( tt_io_player2_r ){ return input_port_1_r( offset ) << 8; }
READ16_HANDLER(tt_io_service_r)5994 static READ16_HANDLER( tt_io_service_r ){ return input_port_2_r( offset ) << 8; }
5995 
MEMORY_READ16_START(tturf_readmem)5996 static MEMORY_READ16_START( tturf_readmem )
5997     { 0x000000, 0x03ffff, MRA16_ROM },
5998 	{ 0x2001e6, 0x2001e7, tt_io_service_r },
5999 	{ 0x2001e8, 0x2001e9, tt_io_player1_r },
6000 	{ 0x2001ea, 0x2001eb, tt_io_player2_r },
6001 	{ 0x200000, 0x203fff, SYS16_MRA16_EXTRAM },
6002 	{ 0x300000, 0x300fff, SYS16_MRA16_SPRITERAM },
6003 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
6004 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
6005 	{ 0x500000, 0x500fff, SYS16_MRA16_PALETTERAM },
6006 	{ 0x602002, 0x602003, input_port_3_word_r }, // dip1
6007 	{ 0x602000, 0x602001, input_port_4_word_r }, // dip2
6008 MEMORY_END
6009 
6010 static MEMORY_WRITE16_START( tturf_writemem )
6011     { 0x000000, 0x03ffff, MWA16_ROM },
6012 	{ 0x200000, 0x203fff, SYS16_MWA16_EXTRAM, &sys16_extraram },
6013 	{ 0x300000, 0x300fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
6014 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
6015 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
6016 	{ 0x500000, 0x500fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
6017 	{ 0x600000, 0x600001, sys16_coinctrl_w },
6018 	{ 0xff0020, 0xff003f, MWA16_NOP }, // config regs
6019 MEMORY_END
6020 
6021 /***************************************************************************/
6022 
6023 /*
6024 	This game has a MCU which does the following:
6025 	- Get Z80 sound command out of work RAM and write to Z80 sound command register
6026 	- Read input ports and store to work RAM
6027 
6028 	The routine which stores the sound code in RAM looks like this:
6029 
6030 	; D0 = sound command
6031 	movem.l    d0-d1/a0, -(a7)
6032 	lea        $2001d6, a0         ; base of 16-byte circular buffer
6033 	move.w     $2001d4, d1         ; get buffer index
6034 	move.b     d0, (a0, d1.w)      ; write sound command to buffer
6035 	addq.w     #1, d1              ; next buffer index
6036 	andi.w     #$000f, d1          ; wrap buffer index
6037 	move.w     d1, $2001d4         ; save buffer index
6038 	addq.w     #1, $2001d2         ; bump 'sound code written' flag
6039 	movem.l    (a7)+, d0-d1/a0
6040 	rts
6041 
6042 	Most likely the MCU reads $2001D2 and copies the sound byte from $2001D6+$2001D4 to the sound command register.
6043 	In tturfbl, a JSR is inserted over the first LEA instruction to a subroutine which copies D0 to the sound command
6044 	register at $600007, and restores a0 to $2001D6 before returning.
6045 
6046 	If the circular buffer is to prioritize sound requests, then this effect is lost in tturfbl. If it's just to
6047 	be tricky, tturfbl handles it correctly.
6048 */
6049 
6050 static WRITE16_HANDLER( tturfu_mcu_sound_trigger_w )
6051 {
6052 	COMBINE_DATA(&sys16_extraram[offset]);
6053 
6054 	if(activecpu_get_pc() == 0x100E)
6055 	{
6056 		int code;
6057 
6058 		if(ACCESSING_LSB)
6059 			code = (data >> 0) & 0xFF;
6060 		else
6061 			code = (data >> 8) & 0xFF;
6062 
6063 		soundlatch_w(0, code);
6064 		cpu_set_irq_line(1, 0, HOLD_LINE);
6065 	}
6066 }
WRITE16_HANDLER(tturf_mcu_sound_trigger_w)6067 static WRITE16_HANDLER( tturf_mcu_sound_trigger_w )
6068 {
6069 	COMBINE_DATA(&sys16_extraram[offset]);
6070 
6071 	if(activecpu_get_pc() == 0x104c)
6072 	{
6073 		int code;
6074 
6075 		if(ACCESSING_LSB)
6076 			code = (data >> 0) & 0xFF;
6077 		else
6078 			code = (data >> 8) & 0xFF;
6079 
6080 		soundlatch_w(0, code);
6081 		cpu_set_irq_line(1, 0, HOLD_LINE);
6082 	}
6083 }
6084 
6085 
tturf_update_proc(void)6086 static void tturf_update_proc( void ){
6087 	set_fg_page( sys16_textram[0x740] );
6088 	set_bg_page( sys16_textram[0x741] );
6089 	sys16_fg_scrolly = sys16_textram[0x748];
6090 	sys16_bg_scrolly = sys16_textram[0x749];
6091 	sys16_fg_scrollx = sys16_textram[0x74c];
6092 	sys16_bg_scrollx = sys16_textram[0x74d];
6093 }
6094 
MACHINE_INIT(tturf)6095 static MACHINE_INIT( tturf ){
6096 	static int bank[16] = { 0,0,1,0,2,0,3,0 };
6097 	sys16_obj_bank = bank;
6098 	sys16_update_proc = tturf_update_proc;
6099 
6100 	install_mem_write16_handler(0, 0x2001d6, 0x2001e5, tturf_mcu_sound_trigger_w );
6101 
6102 }
6103 
MACHINE_INIT(tturfu)6104 static MACHINE_INIT( tturfu ){
6105 	static int bank[16] = {
6106 		0,0,0,0,
6107 		0,0,0,0,
6108 		0,0,0,1,
6109 		0,2,3,0
6110 	};
6111 	sys16_obj_bank = bank;
6112 	sys16_update_proc = tturf_update_proc;
6113 	install_mem_write16_handler(0, 0x2001d6, 0x2001e5, tturfu_mcu_sound_trigger_w );
6114 }
6115 
DRIVER_INIT(tturf)6116 static DRIVER_INIT( tturf ){
6117 	machine_init_sys16_onetime();
6118 }
6119 /***************************************************************************/
6120 
INPUT_PORTS_START(tturf)6121 INPUT_PORTS_START( tturf )
6122 	SYS16_JOY1
6123 	SYS16_JOY2
6124 	SYS16_SERVICE
6125 	SYS16_COINAGE
6126 
6127 PORT_START	/* DSW1 */
6128 	PORT_DIPNAME( 0x03, 0x00, "Continues" )
6129 	PORT_DIPSETTING(    0x00, "None" )
6130 	PORT_DIPSETTING(    0x01, "3" )
6131 	PORT_DIPSETTING(    0x02, "Unlimited" )
6132 	PORT_DIPSETTING(    0x03, "Unlimited" )
6133 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
6134 	PORT_DIPSETTING(    0x08, "Easy" )
6135 	PORT_DIPSETTING(    0x0c, "Normal" )
6136 	PORT_DIPSETTING(    0x04, "Hard" )
6137 	PORT_DIPSETTING(    0x00, "Hardest" )
6138 	PORT_DIPNAME( 0x30, 0x20, "Starting Energy" )
6139 	PORT_DIPSETTING(    0x00, "3" )
6140 	PORT_DIPSETTING(    0x10, "4" )
6141 	PORT_DIPSETTING(    0x20, "6" )
6142 	PORT_DIPSETTING(    0x30, "8" )
6143 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
6144 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6145 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6146 	PORT_DIPNAME( 0x80, 0x00, "Bonus Energy" )
6147 	PORT_DIPSETTING(    0x80, "1" )
6148 	PORT_DIPSETTING(    0x00, "2" )
6149 INPUT_PORTS_END
6150 
6151 /***************************************************************************/
6152 
6153 static MACHINE_DRIVER_START( tturf )
6154 
6155 	/* basic machine hardware */
6156 	MDRV_IMPORT_FROM(system16_7759)
6157 	MDRV_CPU_MODIFY("main")
6158 	MDRV_CPU_MEMORY(tturf_readmem,tturf_writemem)
6159 
6160 	MDRV_MACHINE_INIT(tturf)
6161 MACHINE_DRIVER_END
6162 
6163 
6164 static MACHINE_DRIVER_START( tturfu )
6165 
6166 	/* basic machine hardware */
6167 	MDRV_IMPORT_FROM(tturf)
6168 	MDRV_MACHINE_INIT(tturfu)
6169 MACHINE_DRIVER_END
6170 
6171 /***************************************************************************/
6172 // sys16B
6173 ROM_START( tturfbl )
6174 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
6175 	ROM_LOAD16_BYTE( "tt042197.rom", 0x00000, 0x10000, CRC(deee5af1) SHA1(0caba775021dc7e28ac6b7af8eac4f49d3102c83) )
6176 	ROM_LOAD16_BYTE( "tt06c794.rom", 0x00001, 0x10000, CRC(90e6a95a) SHA1(014a0ae5cebcba9cc99e6ccde4ad5d938fab915c) )
6177 	ROM_LOAD16_BYTE( "tt030be3.rom", 0x20000, 0x10000, CRC(100264a2) SHA1(d1ea4bf93f5472901ce95200f546ce9b58936aea) )
6178 	ROM_LOAD16_BYTE( "tt05ef8a.rom", 0x20001, 0x10000, CRC(f787a948) SHA1(512b8cb2f5e9795171951e02c07cae957db41334) )
6179 
6180 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6181 	ROM_LOAD( "tt1574b3.rom", 0x00000, 0x10000, CRC(e9e630da) SHA1(e8471dedbb25475e4814d78b56f579fe9110461e) )
6182 	ROM_LOAD( "tt16cf44.rom", 0x10000, 0x10000, CRC(4c467735) SHA1(8338b6605cbe2e076da0b3e3a47630409a79f002) )
6183 	ROM_LOAD( "tt17d59e.rom", 0x20000, 0x10000, CRC(60c0f2fe) SHA1(3fea4ed757d47628f59ff940e40cb86b3b5b443b) )
6184 
6185 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
6186 	ROM_LOAD16_BYTE( "12279.1b", 0x00001, 0x10000, CRC(7a169fb1) SHA1(1ec6da0d2cfcf727e61f61c847fd8b975b64f944) )
6187 	ROM_LOAD16_BYTE( "12283.5b", 0x00000, 0x10000, CRC(ae0fa085) SHA1(ae9af92d4dd0c8a0f064d24e647522b588fbd7f7) )
6188 	ROM_LOAD16_BYTE( "12278.2b", 0x20001, 0x10000, CRC(961d06b7) SHA1(b1a9dea63785bfa2c0e7b931387b91dfcd27d79b) )
6189 	ROM_LOAD16_BYTE( "12282.6b", 0x20000, 0x10000, CRC(e8671ee1) SHA1(a3732938c370f1936d867aae9c3d1e9bbfb57ede) )
6190 	ROM_LOAD16_BYTE( "12277.3b", 0x40001, 0x10000, CRC(f16b6ba2) SHA1(00cc04c7b5aad82d51d2d252e1e57bcdc5e2c9e3) )
6191 	ROM_LOAD16_BYTE( "12281.7b", 0x40000, 0x10000, CRC(1ef1077f) SHA1(8ce6fd7d32a20b93b3f91aaa43fe22720da7236f) )
6192 	ROM_LOAD16_BYTE( "12276.4b", 0x60001, 0x10000, CRC(838bd71f) SHA1(82d9d127438f5e1906b1cf40bf3b4727f2ee5685) )
6193 	ROM_LOAD16_BYTE( "12280.8b", 0x60000, 0x10000, CRC(639a57cb) SHA1(84fd8b96758d38f9e1ba1a3c2cf8099ec0452784) )
6194 
6195 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
6196 	ROM_LOAD( "tt014d68.rom", 0x10000, 0x10000, CRC(d4aab1d9) SHA1(94885896d59da1ecabe2377a194fcf61eaae3765) )
6197 	ROM_LOAD( "tt0246ff.rom", 0x20000, 0x10000, CRC(bb4bba8f) SHA1(b182a7e1d0425e93c2c1b93472aafd30a6af6907) )
6198 ROM_END
6199 
6200 /***************************************************************************/
6201 
6202 static MEMORY_READ16_START( tturfbl_readmem )
6203     { 0x000000, 0x03ffff, MRA16_ROM },
6204 	{ 0x2001e6, 0x2001e7, tt_io_service_r },
6205 	{ 0x2001e8, 0x2001e9, tt_io_player1_r },
6206 	{ 0x2001ea, 0x2001eb, tt_io_player2_r },
6207 	{ 0x200000, 0x203fff, SYS16_MRA16_EXTRAM },
6208 	{ 0x300000, 0x300fff, SYS16_MRA16_SPRITERAM },
6209 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
6210 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
6211 	{ 0x500000, 0x500fff, SYS16_MRA16_PALETTERAM },
6212 	{ 0x600002, 0x600003, input_port_3_word_r }, // dip1
6213 	{ 0x600000, 0x600001, input_port_4_word_r }, // dip2
6214 	{ 0x601002, 0x601003, input_port_0_word_r }, // player1
6215 	{ 0x601004, 0x601005, input_port_1_word_r }, // player2
6216 	{ 0x601000, 0x601001, input_port_2_word_r }, // service
6217 	{ 0x602002, 0x602003, input_port_3_word_r }, // dip1
6218 	{ 0x602000, 0x602001, input_port_4_word_r }, // dip2
6219 	{ 0xc46000, 0xc4601f, SYS16_MRA16_EXTRAM3 },
6220 MEMORY_END
6221 
6222 static MEMORY_WRITE16_START( tturfbl_writemem )
6223     { 0x000000, 0x03ffff, MWA16_ROM },
6224 	{ 0x200000, 0x203fff, SYS16_MWA16_EXTRAM, &sys16_extraram },
6225 	{ 0x300000, 0x300fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
6226 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
6227 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
6228 	{ 0x500000, 0x500fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
6229 	{ 0x600000, 0x600001, sys16_coinctrl_w },
6230 	{ 0x600006, 0x600007, sound_command_w },
6231 	{ 0xc44000, 0xc44001, MWA16_NOP },
6232 	{ 0xc46000, 0xc4601f, SYS16_MWA16_EXTRAM3, &sys16_extraram3 },
6233 	{ 0xff0020, 0xff003f, MWA16_NOP }, // config regs
6234 MEMORY_END
6235 
6236 /***************************************************************************/
6237 
6238 static void tturfbl_update_proc( void ){
6239 	sys16_fg_scrollx = sys16_textram[0x74c] & 0x01ff;
6240 	sys16_bg_scrollx = sys16_textram[0x74d/2] & 0x01ff;
6241 	sys16_fg_scrolly = sys16_textram[0x748];
6242 	sys16_bg_scrolly = sys16_textram[0x749];
6243 
6244 
6245 	{
6246 		int data1,data2;
6247 
6248 		data1 = sys16_textram[0x740];
6249 		data2 = sys16_textram[0x741];
6250 
6251 		sys16_fg_page[3] = data1>>12;
6252 		sys16_bg_page[3] = (data1>>8)&0xf;
6253 		sys16_fg_page[1] = (data1>>4)&0xf;
6254 		sys16_bg_page[1] = data1&0xf;
6255 
6256 		sys16_fg_page[2] = data2>>12;
6257 		sys16_bg_page[2] = (data2>>8)&0xf;
6258 		sys16_fg_page[0] = (data2>>4)&0xf;
6259 		sys16_bg_page[0] = data2&0xf;
6260 	}
6261 }
6262 
MACHINE_INIT(tturfbl)6263 static MACHINE_INIT( tturfbl ){
6264 	static int bank[16] = {
6265 		0,0,0,0,
6266 		0,0,0,3,
6267 		0,0,0,2,
6268 		0,1,0,0
6269 	};
6270 	sys16_obj_bank = bank;
6271 	sys16_sprxoffset = -0x48;
6272 
6273 	sys16_update_proc = tturfbl_update_proc;
6274 }
6275 
DRIVER_INIT(tturfbl)6276 static DRIVER_INIT( tturfbl )
6277 {
6278 	UINT8 *mem;
6279 	int i;
6280 
6281 	machine_init_sys16_onetime();
6282 
6283 	/* invert the graphics bits on the tiles */
6284 	for (i = 0; i < 0x30000; i++)
6285 		memory_region(REGION_GFX1)[i] ^= 0xff;
6286 
6287 	mem = memory_region(REGION_CPU2);
6288 	memcpy(mem, mem+0x10000, 0x8000);
6289 
6290 }
6291 /***************************************************************************/
6292 // sound ??
6293 static MACHINE_DRIVER_START( tturfbl )
6294 
6295 	/* basic machine hardware */
MDRV_IMPORT_FROM(system16_7759)6296 	MDRV_IMPORT_FROM(system16_7759)
6297 	MDRV_CPU_MODIFY("main")
6298 	MDRV_CPU_MEMORY(tturfbl_readmem,tturfbl_writemem)
6299 
6300 	MDRV_CPU_MODIFY("sound")
6301 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
6302 	MDRV_CPU_MEMORY(tturfbl_sound_readmem,tturfbl_sound_writemem)
6303 	MDRV_CPU_PORTS(tturfbl_sound_readport,tturfbl_sound_writeport)
6304 
6305 	MDRV_SOUND_REMOVE("7759")
6306 	MDRV_SOUND_ADD_TAG("5205", MSM5205, tturfbl_msm5205_interface)
6307 
6308 	MDRV_MACHINE_INIT(tturfbl)
6309 MACHINE_DRIVER_END
6310 
6311 
6312 /***************************************************************************/
6313 // sys16B
6314 ROM_START( wb3 )
6315 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
6316 	ROM_LOAD16_BYTE( "epr12259.a7", 0x000000, 0x20000, CRC(54927c7e) SHA1(09a4c25b40aba2056c79b5c2e6e8cb7e6c05bc16) )
6317 	ROM_LOAD16_BYTE( "epr12258.a5", 0x000001, 0x20000, CRC(01f5898c) SHA1(2422b4199ce5b63482f7fa1c790c90fc70a2b872) )
6318 
6319 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6320 	ROM_LOAD( "epr12124.a14", 0x00000, 0x10000, CRC(dacefb6f) SHA1(789a5a99ad9419aee9da5397bcea34452ea8b4b3) )
6321 	ROM_LOAD( "epr12125.a15", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
6322 	ROM_LOAD( "epr12126.a16", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
6323 
6324 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
6325 	ROM_LOAD16_BYTE( "epr12093.b4", 0x00001, 0x010000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
6326 	ROM_LOAD16_BYTE( "epr12097.b8", 0x00000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
6327 	ROM_LOAD16_BYTE( "epr12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
6328 	ROM_LOAD16_BYTE( "epr12095.b6", 0x20000, 0x010000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
6329 	ROM_LOAD16_BYTE( "epr12090.b1", 0x40001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
6330 	ROM_LOAD16_BYTE( "epr12094.b5", 0x40000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
6331 	ROM_LOAD16_BYTE( "epr12092.b3", 0x60001, 0x010000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
6332 	ROM_LOAD16_BYTE( "epr12096.b7", 0x60000, 0x010000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
6333 
6334 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
6335 	ROM_LOAD( "epr12127.a10", 0x0000, 0x8000, CRC(0bb901bb) SHA1(c81b198df8e3b0ec568032c76addf0d1a1711194) )
6336 ROM_END
6337 
6338 ROM_START( wb3a )
6339 	ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
6340 // Custom CPU 317-0089
6341 	ROM_LOAD16_BYTE( "epr12137.a7", 0x000000, 0x20000, CRC(6f81238e) SHA1(b578165c1624f8a112e9eea098fb4551cc38faa1) )
6342 	ROM_LOAD16_BYTE( "epr12136.a5", 0x000001, 0x20000, CRC(4cf05003) SHA1(bd4c64c327e53143aa94062f91946eda0a7146c2) )
6343 
6344 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6345 	ROM_LOAD( "epr12124.a14", 0x00000, 0x10000, CRC(dacefb6f) SHA1(789a5a99ad9419aee9da5397bcea34452ea8b4b3) )
6346 	ROM_LOAD( "epr12125.a15", 0x10000, 0x10000, CRC(9fc36df7) SHA1(b39ccc687489e9781181197505fc78aa5cf7ea55) )
6347 	ROM_LOAD( "epr12126.a16", 0x20000, 0x10000, CRC(a693fd94) SHA1(38e5446f41b6793a8e4134fdd92b02b86e3589f7) )
6348 
6349 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
6350 	ROM_LOAD16_BYTE( "epr12093.b4", 0x00001, 0x010000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
6351 	ROM_LOAD16_BYTE( "epr12097.b8", 0x00000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
6352 	ROM_LOAD16_BYTE( "epr12091.b2", 0x20001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
6353 	ROM_LOAD16_BYTE( "epr12095.b6", 0x20000, 0x010000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
6354 	ROM_LOAD16_BYTE( "epr12090.b1", 0x40001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
6355 	ROM_LOAD16_BYTE( "epr12094.b5", 0x40000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
6356 	ROM_LOAD16_BYTE( "epr12092.b3", 0x60001, 0x010000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
6357 	ROM_LOAD16_BYTE( "epr12096.b7", 0x60000, 0x010000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
6358 
6359 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
6360 	ROM_LOAD( "epr12127.a10", 0x0000, 0x8000, CRC(0bb901bb) SHA1(c81b198df8e3b0ec568032c76addf0d1a1711194) )
6361 ROM_END
6362 
6363 /***************************************************************************/
6364 
6365 static MEMORY_READ16_START( wb3_readmem )
6366     { 0x000000, 0x03ffff, MRA16_ROM },
6367 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
6368 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
6369 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
6370 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
6371 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
6372 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
6373 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
6374 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
6375 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
6376 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
6377 MEMORY_END
6378 
6379 static WRITE16_HANDLER( wb3_sound_command_w ){
6380 	if( ACCESSING_MSB ) sound_command_w(offset,data>>8,0xff00); //*
6381 }
6382 
MEMORY_WRITE16_START(wb3_writemem)6383 static MEMORY_WRITE16_START( wb3_writemem )
6384     { 0x000000, 0x03ffff, MWA16_ROM },
6385 	{ 0x3f0000, 0x3fffff, sys16_tilebank_w },
6386 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
6387 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
6388 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
6389 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
6390 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
6391 	{ 0xffc008, 0xffc009, wb3_sound_command_w },
6392 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
6393 MEMORY_END
6394 
6395 /***************************************************************************/
6396 
6397 static void wb3_update_proc( void ){
6398 	set_fg_page( sys16_textram[0x740] );
6399 	set_bg_page( sys16_textram[0x741] );
6400 	sys16_fg_scrolly = sys16_textram[0x748];
6401 	sys16_bg_scrolly = sys16_textram[0x749];
6402 	sys16_fg_scrollx = sys16_textram[0x74c];
6403 	sys16_bg_scrollx = sys16_textram[0x74d];
6404 }
6405 
MACHINE_INIT(wb3)6406 static MACHINE_INIT( wb3 ){
6407 	static int bank[16] = {
6408 		2,0,
6409 		1,0,
6410 		3,0,
6411 		0,3,
6412 		0,0,
6413 		0,2,
6414 		0,1,
6415 		0,0
6416 	};
6417 	sys16_obj_bank = bank;
6418 	sys16_update_proc = wb3_update_proc;
6419 }
6420 
DRIVER_INIT(wb3)6421 static DRIVER_INIT( wb3 ){
6422 	machine_init_sys16_onetime();
6423 }
6424 
6425 /***************************************************************************/
6426 
INPUT_PORTS_START(wb3)6427 INPUT_PORTS_START( wb3 )
6428 	SYS16_JOY1
6429 	SYS16_JOY2
6430 	SYS16_SERVICE
6431 	SYS16_COINAGE
6432 
6433 PORT_START	/* DSW1 */
6434 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
6435 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
6436 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6437 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
6438 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6439 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6440 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
6441 	PORT_DIPSETTING(    0x00, "2" )
6442 	PORT_DIPSETTING(    0x0c, "3" )
6443 	PORT_DIPSETTING(    0x08, "4" )
6444 	PORT_DIPSETTING(    0x04, "5" )
6445 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )		//??
6446 	PORT_DIPSETTING(    0x10, "5000/10000/18000/30000" )
6447 	PORT_DIPSETTING(    0x00, "5000/15000/30000" )
6448 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
6449 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6450 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6451 	PORT_DIPNAME( 0x40, 0x40, "Allow Round Select" )
6452 	PORT_DIPSETTING(    0x40, DEF_STR( No ) )
6453 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )			// no collision though
6454 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
6455 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6456 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6457 INPUT_PORTS_END
6458 
6459 /***************************************************************************/
6460 
6461 static MACHINE_DRIVER_START( wb3 )
6462 
6463 	/* basic machine hardware */
6464 	MDRV_IMPORT_FROM(system16)
6465 	MDRV_CPU_MODIFY("main")
6466 	MDRV_CPU_MEMORY(wb3_readmem,wb3_writemem)
6467 
6468 	MDRV_MACHINE_INIT(wb3)
6469 MACHINE_DRIVER_END
6470 
6471 /***************************************************************************/
6472 // sys16B
6473 ROM_START( wb3bl )
6474 	ROM_REGION( 0x040000, REGION_CPU1, 0 ) /* 68000 code */
6475 	ROM_LOAD16_BYTE( "wb3_03", 0x000000, 0x10000, CRC(0019ab3b) SHA1(89d49a437690fa6e0c35bb9f1450042f89504714) )
6476 	ROM_LOAD16_BYTE( "wb3_05", 0x000001, 0x10000, CRC(196e17ee) SHA1(71e4345b2c3d1612a3d424c9310fad1e23c8a9f7) )
6477 	ROM_LOAD16_BYTE( "wb3_02", 0x020000, 0x10000, CRC(c87350cb) SHA1(55a8cb68d70b6060dd9a55e281e216ce3917ea5b) )
6478 	ROM_LOAD16_BYTE( "wb3_04", 0x020001, 0x10000, CRC(565d5035) SHA1(e28a132f1a4ce9466945e231c54502178748af98) )
6479 
6480 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6481 	ROM_LOAD( "wb3_14", 0x00000, 0x10000, CRC(d3f20bca) SHA1(0a87f709f8e2a913473512ede408e2cbc535443f) )
6482 	ROM_LOAD( "wb3_15", 0x10000, 0x10000, CRC(96ff9d52) SHA1(791a9da4860e0d42fba98f80a3c6725ad8c73e33) )
6483 	ROM_LOAD( "wb3_16", 0x20000, 0x10000, CRC(afaf0d31) SHA1(d4309329a0a543250788146b63b27ff058c02fc3) )
6484 
6485 	ROM_REGION( 0x080000, REGION_GFX2, 0 ) /* sprites */
6486 	ROM_LOAD16_BYTE( "epr12093.b4", 0x000001, 0x010000, CRC(4891e7bb) SHA1(1be04fcabe9bfa8cf746263a5bcca67902a021a0) )
6487 	ROM_LOAD16_BYTE( "epr12097.b8", 0x000000, 0x010000, CRC(e645902c) SHA1(497cfcf6c25cc2e042e16dbcb1963d2223def15a) )
6488 	ROM_LOAD16_BYTE( "epr12091.b2", 0x020001, 0x010000, CRC(8409a243) SHA1(bcbb9510a6499d8147543d6befa5a49f4ac055d9) )
6489 	ROM_LOAD16_BYTE( "epr12095.b6", 0x020000, 0x010000, CRC(e774ec2c) SHA1(a4aa15ec7be5539a740ad02ff720458018dbc536) )
6490 	ROM_LOAD16_BYTE( "epr12090.b1", 0x040001, 0x010000, CRC(aeeecfca) SHA1(496124b170a725ad863c741d4e021ab947511e4c) )
6491 	ROM_LOAD16_BYTE( "epr12094.b5", 0x040000, 0x010000, CRC(615e4927) SHA1(d23f164973afa770714e284a77ddf10f18cc596b) )
6492 	ROM_LOAD16_BYTE( "epr12092.b3", 0x060001, 0x010000, CRC(5c2f0d90) SHA1(e0fbc0f841e4607ad232931368b16e81440a75c4) )
6493 	ROM_LOAD16_BYTE( "epr12096.b7", 0x060000, 0x010000, CRC(0cd59d6e) SHA1(caf754a461feffafcfe7bfc6e89da76c4db257c5) )
6494 
6495 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
6496 	ROM_LOAD( "epr12127.a10", 0x0000, 0x8000, CRC(0bb901bb) SHA1(c81b198df8e3b0ec568032c76addf0d1a1711194) )
6497 ROM_END
6498 
6499 /***************************************************************************/
6500 
6501 static MEMORY_READ16_START( wb3bl_readmem )
6502     { 0x000000, 0x03ffff, MRA16_ROM },
6503 	{ 0x400000, 0x40ffff, SYS16_MRA16_TILERAM },
6504 	{ 0x410000, 0x410fff, SYS16_MRA16_TEXTRAM },
6505 	{ 0x440000, 0x440fff, SYS16_MRA16_SPRITERAM },
6506 	{ 0x840000, 0x840fff, SYS16_MRA16_PALETTERAM },
6507 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
6508 	{ 0xc41004, 0xc41005, input_port_1_word_r }, // player2
6509 	{ 0xc41000, 0xc41001, input_port_2_word_r }, // service
6510 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
6511 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
6512 	{ 0xc46000, 0xc4601f, SYS16_MRA16_EXTRAM3 },
6513 	{ 0xff0000, 0xffffff, SYS16_MRA16_WORKINGRAM },
6514 MEMORY_END
6515 
6516 static MEMORY_WRITE16_START( wb3bl_writemem )
6517     { 0x000000, 0x03ffff, MWA16_ROM },
6518 	{ 0x3f0000, 0x3fffff, sys16_tilebank_w },
6519 	{ 0x400000, 0x40ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
6520 	{ 0x410000, 0x410fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
6521 	{ 0x440000, 0x440fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
6522 	{ 0x840000, 0x840fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
6523 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
6524 	{ 0xc42006, 0xc42007, sound_command_w },
6525 	{ 0xc44000, 0xc44001, MWA16_NOP },
6526 	{ 0xc46000, 0xc4601f, SYS16_MWA16_EXTRAM3, &sys16_extraram3 },
6527 	{ 0xff0000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
6528 MEMORY_END
6529 
6530 /***************************************************************************/
6531 
6532 static void wb3bl_update_proc( void ){
6533 
6534 	sys16_fg_scrollx = sys16_workingram[0xc030/2];
6535 	sys16_bg_scrollx = sys16_workingram[0xc038/2];
6536 	sys16_fg_scrolly = sys16_workingram[0xc032/2];
6537 	sys16_bg_scrolly = sys16_workingram[0xc03c/2];
6538 
6539 	set_fg_page( sys16_textram[0x0ff6/2] );
6540 	set_bg_page( sys16_textram[0x0ff4/2] );
6541 }
6542 
MACHINE_INIT(wb3bl)6543 static MACHINE_INIT( wb3bl ){
6544 	static int bank[16] = {
6545 		2,0,
6546 		1,0,
6547 		3,0,
6548 		0,3,
6549 		0,0,
6550 		0,2,
6551 		0,1,
6552 		0,0
6553 	};
6554 	sys16_obj_bank = bank;
6555 #if 1
6556 	sys16_patch_code( 0x17058, 0x4e );
6557 	sys16_patch_code( 0x17059, 0xb9 );
6558 	sys16_patch_code( 0x1705a, 0x00 );
6559 	sys16_patch_code( 0x1705b, 0x00 );
6560 	sys16_patch_code( 0x1705c, 0x09 );
6561 	sys16_patch_code( 0x1705d, 0xdc );
6562 	sys16_patch_code( 0x1705e, 0x4e );
6563 	sys16_patch_code( 0x1705f, 0xf9 );
6564 	sys16_patch_code( 0x17060, 0x00 );
6565 	sys16_patch_code( 0x17061, 0x01 );
6566 	sys16_patch_code( 0x17062, 0x70 );
6567 	sys16_patch_code( 0x17063, 0xe0 );
6568 	sys16_patch_code( 0x1a3a, 0x31 );
6569 	sys16_patch_code( 0x1a3b, 0x7c );
6570 	sys16_patch_code( 0x1a3c, 0x80 );
6571 	sys16_patch_code( 0x1a3d, 0x00 );
6572 	sys16_patch_code( 0x23df8, 0x14 );
6573 	sys16_patch_code( 0x23df9, 0x41 );
6574 	sys16_patch_code( 0x23dfa, 0x10 );
6575 	sys16_patch_code( 0x23dfd, 0x14 );
6576 	sys16_patch_code( 0x23dff, 0x1c );
6577 #endif
6578 	sys16_update_proc = wb3bl_update_proc;
6579 }
6580 
DRIVER_INIT(wb3bl)6581 static DRIVER_INIT( wb3bl )
6582 {
6583 	int i;
6584 
6585 	machine_init_sys16_onetime();
6586 
6587 	/* invert the graphics bits on the tiles */
6588 	for (i = 0; i < 0x30000; i++)
6589 		memory_region(REGION_GFX1)[i] ^= 0xff;
6590 }
6591 
6592 /***************************************************************************/
6593 
6594 static MACHINE_DRIVER_START( wb3bl )
6595 
6596 	/* basic machine hardware */
MDRV_IMPORT_FROM(system16)6597 	MDRV_IMPORT_FROM(system16)
6598 	MDRV_CPU_MODIFY("main")
6599 	MDRV_CPU_MEMORY(wb3bl_readmem,wb3bl_writemem)
6600 
6601 	MDRV_MACHINE_INIT(wb3bl)
6602 MACHINE_DRIVER_END
6603 
6604 /***************************************************************************/
6605 // sys16B
6606 ROM_START( wrestwar )
6607 	ROM_REGION( 0xc0000, REGION_CPU1, 0 ) /* 68000 code */
6608 	ROM_LOAD16_BYTE( "ww.a7", 0x00000, 0x20000, CRC(eeaba126) SHA1(ca1f630ff0cfc301205d2b8226d7614eadc117b7) )
6609 	ROM_LOAD16_BYTE( "ww.a5", 0x00001, 0x20000, CRC(6714600a) SHA1(8b04347f39bb8a8bc52b1bbfa367d42ea7c61bc9) )
6610 	/* empty 0x40000 - 0x80000 */
6611 	ROM_LOAD16_BYTE( "ww.a8", 0x80000, 0x20000, CRC(b77ba665) SHA1(b6a01ca857b5127ebb763f18cd4123185a7765a6) )
6612 	ROM_LOAD16_BYTE( "ww.a6", 0x80001, 0x20000, CRC(ddf075cb) SHA1(5d887f0d5786fa62757c593d937bba6f150c1b12) )
6613 
6614 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6615 	ROM_LOAD( "ww.a14", 0x00000, 0x20000, CRC(6a821ab9) SHA1(e69f7e534835d4c820746ffc3ad76c3b7bb9b02e) )
6616 	ROM_LOAD( "ww.a15", 0x20000, 0x20000, CRC(2b1a0751) SHA1(8cb1027ef3728f5bdfdb5e2df0f0421f743cdc0a) )
6617 	ROM_LOAD( "ww.a16", 0x40000, 0x20000, CRC(f6e190fe) SHA1(4c8b334fb22c449d8d00c8f49f5eccbe008e244f) )
6618 
6619 	ROM_REGION( 0x300000, REGION_GFX2, 0 ) //* sprites */
6620 	ROM_LOAD16_BYTE( "ww.b1",  0x000001, 0x10000, CRC(ffa7d368) SHA1(e5663ef1cbe8ab27be0919a3cd78d9a7747bbac6) )
6621 	ROM_CONTINUE( 0x040001, 0x10000 )
6622 	ROM_RELOAD  ( 0x020001, 0x10000 )
6623 	ROM_CONTINUE( 0x060001, 0x10000 )
6624 	ROM_LOAD16_BYTE( "ww.b5",  0x000000, 0x10000, CRC(8d7794c1) SHA1(ace87970cfa02ab8200173622633d0d70ef7aa9e) )
6625 	ROM_CONTINUE( 0x040000, 0x10000 )
6626 	ROM_RELOAD  ( 0x020000, 0x10000 )
6627 	ROM_CONTINUE( 0x060000, 0x10000 )
6628 	ROM_LOAD16_BYTE( "ww.b2",  0x080001, 0x10000, CRC(0ed343f2) SHA1(951bd616e63c5fe0aa3f387c9c12153b4f29675f) )
6629 	ROM_CONTINUE( 0x0c0001, 0x10000 )
6630 	ROM_RELOAD  ( 0x0a0001, 0x10000 )
6631 	ROM_CONTINUE( 0x0e0001, 0x10000 )
6632 	ROM_LOAD16_BYTE( "ww.b6",  0x080000, 0x10000, CRC(99458d58) SHA1(87020267610c5784e066bb4e3551852d27b4cf61) )
6633 	ROM_CONTINUE( 0x0c0000, 0x10000 )
6634 	ROM_RELOAD  ( 0x0a0000, 0x10000 )
6635 	ROM_CONTINUE( 0x0e0000, 0x10000 )
6636 	ROM_LOAD16_BYTE( "ww.b3",  0x100001, 0x10000, CRC(3087104d) SHA1(9ad0ea2b580820443c576cbb95d57467e32ea7b5) )
6637 	ROM_CONTINUE( 0x140001, 0x10000 )
6638 	ROM_RELOAD  ( 0x120001, 0x10000 )
6639 	ROM_CONTINUE( 0x160001, 0x10000 )
6640 	ROM_LOAD16_BYTE( "ww.b7",  0x100000, 0x10000, CRC(abcf9bed) SHA1(4f755cfd0304e877b798c31de50e15995f8c4edf) )
6641 	ROM_CONTINUE( 0x140000, 0x10000 )
6642 	ROM_RELOAD  ( 0x120000, 0x10000 )
6643 	ROM_CONTINUE( 0x160000, 0x10000 )
6644 	ROM_LOAD16_BYTE( "ww.b4",  0x180001, 0x10000, CRC(41b6068b) SHA1(c1f1f51c4e0f4320cef7821bccac5b0c9e915d9b) )
6645 	ROM_CONTINUE( 0x1c0001, 0x10000 )
6646 	ROM_RELOAD  ( 0x1a0001, 0x10000 )
6647 	ROM_CONTINUE( 0x1e0001, 0x10000 )
6648 	ROM_LOAD16_BYTE( "ww.b8",  0x180000, 0x10000, CRC(97eac164) SHA1(2bb62e6d8b2d662e9b31aa8d238a51af7c7905e8) )
6649 	ROM_CONTINUE( 0x1c0000, 0x10000 )
6650 	ROM_RELOAD  ( 0x1a0000, 0x10000 )
6651 	ROM_CONTINUE( 0x1e0000, 0x10000 )
6652 	ROM_LOAD16_BYTE( "ww.a1",  0x200001, 0x10000, CRC(260311c5) SHA1(6b52b671252aef992c0546468c44b722bdb6a649) )
6653 	ROM_CONTINUE( 0x240001, 0x10000 )
6654 	ROM_RELOAD  ( 0x220001, 0x10000 )
6655 	ROM_CONTINUE( 0x260001, 0x10000 )
6656 	ROM_LOAD16_BYTE( "ww.b10", 0x200000, 0x10000, CRC(35a4b1b1) SHA1(c3b8ba708f9f2822e48e52ea74d7e96f08182ac4) )
6657 	ROM_CONTINUE( 0x240000, 0x10000 )
6658 	ROM_RELOAD  ( 0x220000, 0x10000 )
6659 	ROM_CONTINUE( 0x260000, 0x10000 )
6660 	ROM_LOAD16_BYTE( "ww.a2",  0x280001, 0x10000, CRC(12e38a5c) SHA1(05558a370b4e8100d2fa5e700a5ab76771ff7729) )
6661 	ROM_RELOAD  ( 0x2a0001, 0x10000 )
6662 	ROM_LOAD16_BYTE( "ww.b11", 0x280000, 0x10000, CRC(fa06fd24) SHA1(20a578b82a75fe96a230c91645108fdc8b5bae21) )
6663 	ROM_RELOAD  ( 0x2a0000, 0x10000 )
6664 
6665 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
6666 	ROM_LOAD( "ww.a10", 0x00000, 0x08000, CRC(c3609607) SHA1(2e0acb775c60851bf0b2037b91b07ead061d5862) )
6667 	ROM_LOAD( "ww.a11", 0x10000, 0x20000, CRC(fb9a7f29) SHA1(7ba79c18ab4e586be2deccd78e4479d55eb75a7e) )
6668 	ROM_LOAD( "ww.a12", 0x30000, 0x20000, CRC(d6617b19) SHA1(aa36d257eaa52c8c871a39aaa2f29c203525dbaf) )
6669 ROM_END
6670 
6671 /***************************************************************************/
6672 
6673 static READ16_HANDLER( ww_io_service_r ){
6674 	return input_port_2_word_r(offset,0) | (sys16_workingram[0x2082/2] & 0xff00);
6675 }
6676 
MEMORY_READ16_START(wrestwar_readmem)6677 static MEMORY_READ16_START( wrestwar_readmem )
6678     { 0x000000, 0x0bffff, MRA16_ROM },
6679 	{ 0x100000, 0x10ffff, SYS16_MRA16_TILERAM },
6680 	{ 0x110000, 0x111fff, SYS16_MRA16_TEXTRAM }, //*
6681 	{ 0x200000, 0x200fff, SYS16_MRA16_SPRITERAM },
6682 	{ 0x300000, 0x300fff, SYS16_MRA16_PALETTERAM },
6683 	{ 0x400000, 0x400003, SYS16_MRA16_EXTRAM },
6684 	{ 0xc41002, 0xc41003, input_port_0_word_r }, // player1
6685 	{ 0xc41006, 0xc41007, input_port_1_word_r }, // player2
6686 	{ 0xc42002, 0xc42003, input_port_3_word_r }, // dip1
6687 	{ 0xc42000, 0xc42001, input_port_4_word_r }, // dip2
6688 	{ 0xffe082, 0xffe083, ww_io_service_r },
6689 	{ 0xffc000, 0xffffff, SYS16_MRA16_WORKINGRAM },
6690 MEMORY_END
6691 
6692 static MEMORY_WRITE16_START( wrestwar_writemem )
6693     { 0x000000, 0x0bffff, MWA16_ROM },
6694 	{ 0x100000, 0x10ffff, SYS16_MWA16_TILERAM, &sys16_tileram },
6695 	{ 0x110000, 0x111fff, SYS16_MWA16_TEXTRAM, &sys16_textram },
6696 	{ 0x200000, 0x200fff, SYS16_MWA16_SPRITERAM, &sys16_spriteram },
6697 	{ 0x300000, 0x300fff, SYS16_MWA16_PALETTERAM, &paletteram16 },
6698 	{ 0x400000, 0x400003, SYS16_MWA16_EXTRAM, &sys16_extraram },
6699 	{ 0xc40000, 0xc40001, sys16_coinctrl_w },
6700 	{ 0xc43034, 0xc43035, MWA16_NOP },
6701 	{ 0xffe08e, 0xffe08f, sound_command_w },
6702 	{ 0xffc000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
6703 MEMORY_END
6704 
6705 /***************************************************************************/
6706 
6707 static void wrestwar_update_proc( void ){
6708 	set_fg_page( sys16_textram[0x740] );
6709 	set_bg_page( sys16_textram[0x741] );
6710 	sys16_fg_scrolly = sys16_textram[0x748];
6711 	sys16_bg_scrolly = sys16_textram[0x749];
6712 	sys16_fg_scrollx = sys16_textram[0x74c];
6713 	sys16_bg_scrollx = sys16_textram[0x74d];
6714 
6715 	set_tile_bank( sys16_extraram[1] );
6716 }
6717 
MACHINE_INIT(wrestwar)6718 static MACHINE_INIT( wrestwar ){
6719 	sys16_bg_priority_mode=2;
6720 	sys16_bg_priority_value=0x0a00;
6721 	sys16_update_proc = wrestwar_update_proc;
6722 	sys16_wwfix = 1; //*
6723 }
6724 
DRIVER_INIT(wrestwar)6725 static DRIVER_INIT( wrestwar ){
6726 	machine_init_sys16_onetime();
6727 	sys16_bg1_trans=1;
6728 	sys16_MaxShadowColors=16;
6729 	sys18_splittab_bg_y=&sys16_textram[0x0f40];
6730 	sys18_splittab_fg_y=&sys16_textram[0x0f00];
6731 	sys16_rowscroll_scroll=0x8000;
6732 }
6733 /***************************************************************************/
6734 
INPUT_PORTS_START(wrestwar)6735 INPUT_PORTS_START( wrestwar )
6736 	SYS16_JOY1
6737 	SYS16_JOY2
6738 	SYS16_SERVICE
6739 	SYS16_COINAGE
6740 
6741 PORT_START	/* DSW1 */
6742 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
6743 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
6744 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6745 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
6746 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6747 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6748 	PORT_DIPNAME( 0x0c, 0x0c, "Round Time" )
6749 	PORT_DIPSETTING(    0x00, "100" )
6750 	PORT_DIPSETTING(    0x0c, "110" )
6751 	PORT_DIPSETTING(    0x08, "120" )
6752 	PORT_DIPSETTING(    0x04, "130" )
6753 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
6754 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6755 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6756 	PORT_DIPNAME( 0x20, 0x20, "Continuation" )
6757 	PORT_DIPSETTING(    0x20, "Continue" )
6758 	PORT_DIPSETTING(    0x00, "No Continue" )
6759 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
6760 	PORT_DIPSETTING(    0x80, "Easy" )
6761 	PORT_DIPSETTING(    0xc0, "Normal" )
6762 	PORT_DIPSETTING(    0x40, "Hard" )
6763 	PORT_DIPSETTING(    0x00, "Hardest" )
6764 
6765 INPUT_PORTS_END
6766 
6767 /***************************************************************************/
6768 
6769 static MACHINE_DRIVER_START( wrestwar )
6770 
6771 	/* basic machine hardware */
6772 	MDRV_IMPORT_FROM(system16_7759)
6773 	MDRV_CPU_MODIFY("main")
6774 	MDRV_CPU_MEMORY(wrestwar_readmem,wrestwar_writemem)
6775 
6776 	MDRV_MACHINE_INIT(wrestwar)
6777 MACHINE_DRIVER_END
6778 
6779 /*****************************************************************************/
6780 
6781 
6782 /*****************************************************************************/
6783 /* Dummy drivers for games that don't have a working clone and are protected */
6784 /*****************************************************************************/
6785 
6786 static MEMORY_READ16_START( sys16_dummy_readmem )
6787     { 0x000000, 0x0fffff, MRA16_ROM },
6788 	{ 0xff0000, 0xffffff, SYS16_MRA16_WORKINGRAM },
6789 MEMORY_END
6790 
6791 static MEMORY_WRITE16_START( sys16_dummy_writemem )
6792     { 0x000000, 0x0fffff, MWA16_ROM },
6793 	{ 0xff0000, 0xffffff, SYS16_MWA16_WORKINGRAM, &sys16_workingram },
6794 MEMORY_END
6795 
6796 static MACHINE_INIT( sys16_dummy ){
6797 }
6798 
DRIVER_INIT(s16dummy)6799 static DRIVER_INIT( s16dummy )
6800 {
6801 	machine_init_sys16_onetime();
6802 }
6803 
6804 INPUT_PORTS_START( s16dummy )
6805 INPUT_PORTS_END
6806 
6807 static MACHINE_DRIVER_START( s16dummy )
6808 
6809 	/* basic machine hardware */
6810 	MDRV_IMPORT_FROM(system16)
6811 	MDRV_CPU_MODIFY("main")
6812 	MDRV_CPU_MEMORY(sys16_dummy_readmem,sys16_dummy_writemem)
6813 
6814 	MDRV_MACHINE_INIT(sys16_dummy)
6815 MACHINE_DRIVER_END
6816 
6817 /*****************************************************************************/
6818 // Cotton
6819 
6820 ROM_START( cotton )
6821 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
6822 // custom cpu 317-?????
6823 	ROM_LOAD16_BYTE( "epr13858.a7", 0x000000, 0x20000, CRC(276f42fe) SHA1(47d2f910f6f101628cb0c660e5fd12c0e331bd99) )
6824 	ROM_LOAD16_BYTE( "epr13856.a5", 0x000001, 0x20000, CRC(14e6b5e7) SHA1(708c69cddd1c60e729a74f539d40e67b2a6d9d6f) )
6825 	ROM_LOAD16_BYTE( "epr13859.a8", 0x040000, 0x20000, CRC(4703ef9d) SHA1(8b03a71736a599c337ad5d95cbc812ea38b0cc43) )
6826 	ROM_LOAD16_BYTE( "epr13857.a6", 0x040001, 0x20000, CRC(de37e527) SHA1(124ce7c7eef1199c89735556cebf71255573a155) )
6827 
6828 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6829 	ROM_LOAD( "scr01.rom", 0x00000, 0x20000, CRC(a47354b6) SHA1(ce52813b245f1d491a134d4bd5ab074e71d20129) )
6830 	ROM_LOAD( "scr11.rom", 0x20000, 0x20000, CRC(d38424b5) SHA1(884ca190936aee2d2cac86491d4d0cdf4a45efe5) )
6831 	ROM_LOAD( "scr02.rom", 0x40000, 0x20000, CRC(8c990026) SHA1(07b4510936376c171f3b31d87ac6154361eb0cbc) )
6832 	ROM_LOAD( "scr12.rom", 0x60000, 0x20000, CRC(21c15b8a) SHA1(690d92420ec5465885e0f4870419992961420e33) )
6833 	ROM_LOAD( "scr03.rom", 0x80000, 0x20000, CRC(d2b175bf) SHA1(897b7c794d0e7229ea5e9a682f64266a947a818f) )
6834 	ROM_LOAD( "scr13.rom", 0xa0000, 0x20000, CRC(b9d62531) SHA1(e8c5e7b93339c00f75a3b66ce18f7838255577be) )
6835 
6836 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
6837 	ROM_LOAD16_BYTE( "obj0-e.rom", 0x000001, 0x20000, CRC(ab4b3468) SHA1(3071654a295152d609d2c2c1d4153b5ba3f174d5) )
6838 	ROM_LOAD16_BYTE( "obj0-o.rom", 0x000000, 0x20000, CRC(7024f404) SHA1(4b2f9cdfdd97218797a3e386106e53f713b8650d) )
6839 	ROM_LOAD16_BYTE( "obj1-e.rom", 0x040001, 0x20000, CRC(69b41ac3) SHA1(4c5a85e5a5ca9f8260557d4e97eb091dd857d63a) )
6840 	ROM_LOAD16_BYTE( "obj1-o.rom", 0x040000, 0x20000, CRC(6169bba4) SHA1(a24a418ee7cd0c1109870a2e7a91e430671897ed) )
6841 	ROM_LOAD16_BYTE( "obj2-e.rom", 0x080001, 0x20000, CRC(0801cf02) SHA1(3007bbbce2f327f4700e78e2b8672f4482189cd7) )
6842 	ROM_LOAD16_BYTE( "obj2-o.rom", 0x080000, 0x20000, CRC(b014f02d) SHA1(46f5ed0b44cee03a6aec9ec57b506bb15bf35e47) )
6843 	ROM_LOAD16_BYTE( "obj3-e.rom", 0x0c0001, 0x20000, CRC(f066f315) SHA1(bbeb24daaded994240d0cdb5cec2e662b677cb75) )
6844 	ROM_LOAD16_BYTE( "obj3-o.rom", 0x0c0000, 0x20000, CRC(e62a7cd6) SHA1(1e6d06345f7b6cef2e887d9b9cd45e0155140c5e) )
6845 	ROM_LOAD16_BYTE( "obj4-e.rom", 0x100001, 0x20000, CRC(1bd145f3) SHA1(4744ffe9fbda453785345b46eb61b56730048f42) )
6846 	ROM_LOAD16_BYTE( "obj4-o.rom", 0x100000, 0x20000, CRC(943aba8b) SHA1(d0dd1665a8d9495a92ae4e35d6b15b966e8d43cd) )
6847 	ROM_LOAD16_BYTE( "obj5-e.rom", 0x140001, 0x20000, CRC(4fd59bff) SHA1(2b4630e49b60593d668fe34d8faf712ac6928c14) )
6848 	ROM_LOAD16_BYTE( "obj5-o.rom", 0x140000, 0x20000, CRC(7ea93200) SHA1(8e2d8cd48a12306772653f25bddc99ad0597a698) )
6849 	ROM_LOAD16_BYTE( "obj6-e.rom", 0x180001, 0x20000, CRC(6a66868d) SHA1(60961a8b1f193d0b08c1906f4a79123fa0db443a) )
6850 	ROM_LOAD16_BYTE( "obj6-o.rom", 0x180000, 0x20000, CRC(1c942190) SHA1(514fac5cc7362e9e3168c84975c8fe0e34bb4471) )
6851 	ROM_LOAD16_BYTE( "obj7-e.rom", 0x1c0001, 0x20000, CRC(1c5ffad8) SHA1(13e5886ceece564cc71ba7f43a26d2b1782ccfc8) )
6852 	ROM_LOAD16_BYTE( "obj7-o.rom", 0x1c0000, 0x20000, CRC(856f3ee2) SHA1(72346d887ff9738ebe93acb2e3f8cd80d494621e) )
6853 
6854 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
6855 	ROM_LOAD( "s-prog.rom",	 0x00000, 0x08000, CRC(6a57b027) SHA1(8f9de548df203605bb4ab9eececf09739b55adf1) )
6856 	ROM_LOAD( "speech0.rom", 0x10000, 0x20000, CRC(4d21153f) SHA1(173ddd9633f255c39ca508c37d0562e374704e7b) )
6857 ROM_END
6858 
6859 
6860 ROM_START( cottona )
6861 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
6862 // custom cpu 317-0181a
6863 	ROM_LOAD16_BYTE( "ep13921a.a7", 0x000000, 0x20000, CRC(f047a037) SHA1(e4a9eeb1f2cf6b5ee3b2fcf74be917ffd3e6ca0e) )
6864 	ROM_LOAD16_BYTE( "ep13919a.a5", 0x000001, 0x20000, CRC(651108b1) SHA1(1ab32085ca1a8cb3d464059b0abb10253decd423) )
6865 	ROM_LOAD16_BYTE( "ep13922a.a8", 0x040000, 0x20000, CRC(1ca248c5) SHA1(f7df2ccf54a3f1f09334c3b3df3dcd2ec33f99d1) )
6866 	ROM_LOAD16_BYTE( "ep13920a.a6", 0x040001, 0x20000, CRC(fa3610f9) SHA1(6127496bf7cd47d4343291fc2e11673d77ccc550) )
6867 
6868 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6869 	ROM_LOAD( "scr01.rom", 0x00000, 0x20000, CRC(a47354b6) SHA1(ce52813b245f1d491a134d4bd5ab074e71d20129) )
6870 	ROM_LOAD( "scr11.rom", 0x20000, 0x20000, CRC(d38424b5) SHA1(884ca190936aee2d2cac86491d4d0cdf4a45efe5) )
6871 	ROM_LOAD( "scr02.rom", 0x40000, 0x20000, CRC(8c990026) SHA1(07b4510936376c171f3b31d87ac6154361eb0cbc) )
6872 	ROM_LOAD( "scr12.rom", 0x60000, 0x20000, CRC(21c15b8a) SHA1(690d92420ec5465885e0f4870419992961420e33) )
6873 	ROM_LOAD( "scr03.rom", 0x80000, 0x20000, CRC(d2b175bf) SHA1(897b7c794d0e7229ea5e9a682f64266a947a818f) )
6874 	ROM_LOAD( "scr13.rom", 0xa0000, 0x20000, CRC(b9d62531) SHA1(e8c5e7b93339c00f75a3b66ce18f7838255577be) )
6875 
6876 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
6877 	ROM_LOAD16_BYTE( "obj0-e.rom", 0x000001, 0x20000, CRC(ab4b3468) SHA1(3071654a295152d609d2c2c1d4153b5ba3f174d5) )
6878 	ROM_LOAD16_BYTE( "obj0-o.rom", 0x000000, 0x20000, CRC(7024f404) SHA1(4b2f9cdfdd97218797a3e386106e53f713b8650d) )
6879 	ROM_LOAD16_BYTE( "obj1-e.rom", 0x040001, 0x20000, CRC(69b41ac3) SHA1(4c5a85e5a5ca9f8260557d4e97eb091dd857d63a) )
6880 	ROM_LOAD16_BYTE( "obj1-o.rom", 0x040000, 0x20000, CRC(6169bba4) SHA1(a24a418ee7cd0c1109870a2e7a91e430671897ed) )
6881 	ROM_LOAD16_BYTE( "obj2-e.rom", 0x080001, 0x20000, CRC(0801cf02) SHA1(3007bbbce2f327f4700e78e2b8672f4482189cd7) )
6882 	ROM_LOAD16_BYTE( "obj2-o.rom", 0x080000, 0x20000, CRC(b014f02d) SHA1(46f5ed0b44cee03a6aec9ec57b506bb15bf35e47) )
6883 	ROM_LOAD16_BYTE( "obj3-e.rom", 0x0c0001, 0x20000, CRC(f066f315) SHA1(bbeb24daaded994240d0cdb5cec2e662b677cb75) )
6884 	ROM_LOAD16_BYTE( "obj3-o.rom", 0x0c0000, 0x20000, CRC(e62a7cd6) SHA1(1e6d06345f7b6cef2e887d9b9cd45e0155140c5e) )
6885 	ROM_LOAD16_BYTE( "obj4-e.rom", 0x100001, 0x20000, CRC(1bd145f3) SHA1(4744ffe9fbda453785345b46eb61b56730048f42) )
6886 	ROM_LOAD16_BYTE( "obj4-o.rom", 0x100000, 0x20000, CRC(943aba8b) SHA1(d0dd1665a8d9495a92ae4e35d6b15b966e8d43cd) )
6887 	ROM_LOAD16_BYTE( "obj5-e.rom", 0x140001, 0x20000, CRC(4fd59bff) SHA1(2b4630e49b60593d668fe34d8faf712ac6928c14) )
6888 	ROM_LOAD16_BYTE( "obj5-o.rom", 0x140000, 0x20000, CRC(7ea93200) SHA1(8e2d8cd48a12306772653f25bddc99ad0597a698) )
6889 	ROM_LOAD16_BYTE( "obj6-e.rom", 0x180001, 0x20000, CRC(6a66868d) SHA1(60961a8b1f193d0b08c1906f4a79123fa0db443a) )
6890 	ROM_LOAD16_BYTE( "obj6-o.rom", 0x180000, 0x20000, CRC(1c942190) SHA1(514fac5cc7362e9e3168c84975c8fe0e34bb4471) )
6891 	ROM_LOAD16_BYTE( "obj7-e.rom", 0x1c0001, 0x20000, CRC(1c5ffad8) SHA1(13e5886ceece564cc71ba7f43a26d2b1782ccfc8) )
6892 	ROM_LOAD16_BYTE( "obj7-o.rom", 0x1c0000, 0x20000, CRC(856f3ee2) SHA1(72346d887ff9738ebe93acb2e3f8cd80d494621e) )
6893 
6894 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
6895 	ROM_LOAD( "s-prog.rom",	 0x00000, 0x08000, CRC(6a57b027) SHA1(8f9de548df203605bb4ab9eececf09739b55adf1) )
6896 	ROM_LOAD( "speech0.rom", 0x10000, 0x20000, CRC(4d21153f) SHA1(173ddd9633f255c39ca508c37d0562e374704e7b) )
6897 ROM_END
6898 
6899 
6900 /*****************************************************************************/
6901 // Dunk Shot
6902 
6903 ROM_START( dunkshot )
6904 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
6905 	ROM_LOAD16_BYTE( "10468.bin", 0x000000, 0x8000, CRC(e2d5f97a) SHA1(bf7b4a029580633fee65be89d5c9c83ff76a8484) )
6906 	ROM_LOAD16_BYTE( "10467.bin", 0x000001, 0x8000, CRC(29774114) SHA1(3a88739213afd4ef7807ddbd3acdfddeb9636fd3) )
6907 	ROM_LOAD16_BYTE( "10470.bin", 0x010000, 0x8000, CRC(8c60761f) SHA1(aba009f482df7023b460ab20e50225ab5f6dff6d) )
6908 	ROM_LOAD16_BYTE( "10469.bin", 0x010001, 0x8000, CRC(aa442b81) SHA1(24f455bc59147ccd948fd89e2048a118b5591d84) )
6909 	ROM_LOAD16_BYTE( "10472.bin", 0x020000, 0x8000, CRC(206027a6) SHA1(2b7d4754639d7023bc00f5e0fe9de4d2a971e487) )
6910 	ROM_LOAD16_BYTE( "10471.bin", 0x020001, 0x8000, CRC(22777314) SHA1(fbc35505a94c8d4bdb44ee058e9e2e9e9b377c5c) )
6911 
6912 	ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6913 	ROM_LOAD( "10485.bin", 0x00000, 0x8000, CRC(f16dda29) SHA1(88f3aa5e6f827e124c5bba0978a6ccfde8cb6fe7) )
6914 	ROM_LOAD( "10486.bin", 0x08000, 0x8000, CRC(311d973c) SHA1(c4765917ba788ed45a801499f3d873a86c418eb8) )
6915 	ROM_LOAD( "10487.bin", 0x10000, 0x8000, CRC(a8fb179f) SHA1(8a748d537b3d327c41d6dac17342de9be068e53b) )
6916 
6917 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites */
6918 	ROM_LOAD16_BYTE( "10481.bin", 0x00001, 0x8000, CRC(feb04bc9) SHA1(233dc8e3b887a88ac114723d58a909a58f0ae771) )
6919 	ROM_LOAD16_BYTE( "10477.bin", 0x00000, 0x8000, CRC(f9d3b2cb) SHA1(b530fe16882c718122bfd1de098f39e54993de28) )
6920 	ROM_LOAD16_BYTE( "10482.bin", 0x10001, 0x8000, CRC(5bc07618) SHA1(f4c88f81b407d467f958181770ea4fd32aab3daf) )
6921 	ROM_LOAD16_BYTE( "10478.bin", 0x10000, 0x8000, CRC(5b5c5c92) SHA1(1c6f1cafa0788678c80ade11560f4a8d8bb7272a) )
6922 	ROM_LOAD16_BYTE( "10483.bin", 0x20001, 0x8000, CRC(7cab4f9e) SHA1(2310a9fe604f78d74d84bea301c95e6f0e6a6085) )
6923 	ROM_LOAD16_BYTE( "10479.bin", 0x20000, 0x8000, CRC(e84190a0) SHA1(23a8799adf81e1884a8c6b4c55397b8bca2f1850) )
6924 	ROM_LOAD16_BYTE( "10484.bin", 0x30001, 0x8000, CRC(bcb5fcc9) SHA1(eb8d557c908e6265f96a5a7e832e19776a9e576c) )
6925 	ROM_LOAD16_BYTE( "10480.bin", 0x30000, 0x8000, CRC(5dffd9dd) SHA1(256b24613c952d89dbb9971c9091d5a8a7f363b0) )
6926 
6927 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) //* sound CPU */
6928 	ROM_LOAD( "10473.bin",	 0x00000, 0x08000, CRC(7f1f5a27) SHA1(7ff91b95c883b395ab4ff5e440d78e553a09e623) )
6929 	ROM_LOAD( "10474.bin",   0x10000, 0x08000, CRC(419a656e) SHA1(aa734ae835761badeb069f99acc5fded2a19b3a3) )
6930 	ROM_LOAD( "10475.bin",   0x18000, 0x08000, CRC(17d55e85) SHA1(0c414bafecbfaa82679cc155f15f5255c186358d) )
6931 	ROM_LOAD( "10476.bin",   0x20000, 0x08000, CRC(a6be0956) SHA1(fc4d6e25e0b46679f94fddbb1850fb0b02f8d84b) )
6932 ROM_END
6933 
6934 /*****************************************************************************/
6935 // MVP
6936 
6937 ROM_START( mvp )
6938 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
6939 	ROM_LOAD16_BYTE( "13000.rom", 0x000000, 0x40000, CRC(2e0e21ec) SHA1(3b72da0746fb0ece4311d6e935bc6b9ece3549ec) )
6940 	ROM_LOAD16_BYTE( "12999.rom", 0x000001, 0x40000, CRC(fd213d28) SHA1(5324ee402a2f28a6c152905493da0052d4976b29) )
6941 
6942 	ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6943 	ROM_LOAD( "13011.rom", 0x00000, 0x40000, CRC(1cb871fc) SHA1(d20a46e538d57b25d78faa7deb9c11519b4111d3) )
6944 	ROM_LOAD( "13012.rom", 0x40000, 0x40000, CRC(b75e6821) SHA1(a2b049995755d79a136a4b4b0dc78d902c5b9eed) )
6945 	ROM_LOAD( "13013.rom", 0x80000, 0x40000, CRC(f1944a3c) SHA1(db59cadb435c26f3a957bd4996a083fa30c8bbd0) )
6946 
6947 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
6948 	ROM_LOAD16_BYTE( "13010.rom", 0x000001, 0x40000, CRC(df37c567) SHA1(05c959e379a3e20fe5e70912410e3bae4db13905) )
6949 	ROM_LOAD16_BYTE( "13009.rom", 0x000000, 0x40000, CRC(126d2e37) SHA1(91317d3bcc4f918a8607cc0c383181c3641ebccf) )
6950 	ROM_LOAD16_BYTE( "13006.rom", 0x080001, 0x40000, CRC(2e9afd2f) SHA1(7fe0929e70e061878065fab2d26309066d14c038) )
6951 	ROM_LOAD16_BYTE( "13003.rom", 0x080000, 0x40000, CRC(21424151) SHA1(156e15eee9ff7122c30a42bfec0b307073b7a375) )
6952 	ROM_LOAD16_BYTE( "13007.rom", 0x100001, 0x40000, CRC(55c8605b) SHA1(6c81e5f9bcd61f6e67c87ea5b25a8fe1ee50f14d) )
6953 	ROM_LOAD16_BYTE( "13004.rom", 0x100000, 0x40000, CRC(0aa09dd3) SHA1(0cd58d29efa714e52c494ee1ec8a0e90c0a03e3c) )
6954 	ROM_LOAD16_BYTE( "13008.rom", 0x180001, 0x40000, CRC(b3d46dfc) SHA1(27a5c58d5fd974fbbb12b535a49aa7fb3f7d3f6a) )
6955 	ROM_LOAD16_BYTE( "13005.rom", 0x180000, 0x40000, CRC(c899c810) SHA1(a251cfd8f99f2c2f98585cc9ba1d86f08b2eca51) )
6956 
6957 	ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* sound CPU */
6958 	ROM_LOAD( "13002.rom",	 0x00000, 0x08000, CRC(1b6e1515) SHA1(1816d48dcb1bfd819a2cfa55fb51e1ca04ad4feb) )
6959 	ROM_LOAD( "13001.rom",   0x10000, 0x40000, CRC(e8cace8c) SHA1(5f47b935d927f2aa5f7a5f6dc52f5380baebe1bb) )
6960 ROM_END
6961 
6962 /*****************************************************************************/
6963 // Excite League
6964 
6965 ROM_START( exctleag )
6966 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
6967 	ROM_LOAD16_BYTE( "epr11937.a02",0x00000,0x10000, CRC(4ebda367) SHA1(ab4db50eb0d2e10a3b4b7fc0f4bdc82412379809) )
6968 	ROM_LOAD16_BYTE( "epr11936.a01",0x00001,0x10000, CRC(0863de60) SHA1(540a5cae2623bce296c07603239f737a782e3b0b) )
6969 	ROM_LOAD16_BYTE( "epr11939.a04",0x20000,0x10000, CRC(117dd98f) SHA1(0234c2cf3421849854bec3711ab64f50f12cc5dd) )
6970 	ROM_LOAD16_BYTE( "epr11938.a03",0x20001,0x10000, CRC(07c08d47) SHA1(47d3445cfa2514918206cd29a203837a9f434b42) )
6971 	ROM_LOAD16_BYTE( "epr11941.a06",0x40000,0x10000, CRC(4df2d451) SHA1(644541b20e034a0149117874021c158bd3759e35) )
6972 	ROM_LOAD16_BYTE( "epr11940.a05",0x40001,0x10000, CRC(dec83274) SHA1(85919bcd372fbfb9f06c34897b4d28d08ef3c9d1) )
6973 
6974 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
6975 	ROM_LOAD( "epr11942.b09",0x00000,0x10000, CRC(eb70e827) SHA1(0617b4411a90087c277354c3653fe994bc4fc580) )
6976 	ROM_LOAD( "epr11943.b10",0x10000,0x10000, CRC(d97c8982) SHA1(3e604af1771caba3aa213796c4a0812a5e352580) )
6977 	ROM_LOAD( "epr11944.b11",0x20000,0x10000, CRC(a75cae80) SHA1(17c148a33b09b5403e68f5d96e506545c2ced206) )
6978 
6979 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
6980 	ROM_LOAD16_BYTE( "epr11950.b01",0x00001,0x10000, CRC(af497849) SHA1(c5fdca8d3b1d83e3d377a49ecdc0fc53714afc09) )
6981 	ROM_LOAD16_BYTE( "epr11951.b02",0x00000,0x10000, CRC(c04fa974) SHA1(b1a4fb8522126113d7857d559f169f09c5f51a13) )
6982 	ROM_LOAD16_BYTE( "epr11952.b03",0x20001,0x10000, CRC(e64a9761) SHA1(e16b3a30165710abc11ab0f358cb7ef875cc672c) )
6983 	ROM_LOAD16_BYTE( "epr11953.b04",0x20000,0x10000, CRC(4cae3999) SHA1(22089e43a5e2e4fe672015366154e24ad38d3c19) )
6984 	ROM_LOAD16_BYTE( "epr11954.b05",0x40001,0x10000, CRC(5fa2106c) SHA1(2f2620fa52d07667dff4720fea32a6615d99e522) )
6985 	ROM_LOAD16_BYTE( "epr11955.b06",0x40000,0x10000, CRC(86a0c368) SHA1(ab8d6ab5c571121bf9c5d40727b1ef385a033845) )
6986 	ROM_LOAD16_BYTE( "epr11956.b07",0x60001,0x10000, CRC(aff5c2fa) SHA1(1ec76193f2abf3547fa610761147436548beccbc) )
6987 	ROM_LOAD16_BYTE( "epr11957.b08",0x60000,0x10000, CRC(218f835b) SHA1(bfef3ec45665a5921c095da34701528d4d4e0e3a) )
6988 
6989 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
6990 	ROM_LOAD( "epr11945.a07",0x00000,0x8000, CRC(c2a83012) SHA1(b3de8af803497438aa3e110a9c608ac290f7d1e8) )
6991 	ROM_LOAD( "epr11140.a08",0x10000,0x8000, CRC(b297371b) SHA1(4e787aa9ee2aeab4da30237644421df407b684a5) )
6992 	ROM_LOAD( "epr11141.a09",0x18000,0x8000, CRC(19756aa6) SHA1(81597e17b848f6a41f5fb117296e7508297815e4) )
6993 	ROM_LOAD( "epr11142.a10",0x20000,0x8000, CRC(25d26c66) SHA1(2485afb859f84a9cc90b2091e9ae4eef263f42b3) )
6994 	ROM_LOAD( "epr11143.a11",0x28000,0x8000, CRC(848b7b77) SHA1(8903a39f8f0ffb4ce32117d33282876196516c30) )
6995 
6996 ROM_END
6997 
6998 
6999 
7000 /*****************************************************************************/
7001 // Super League
7002 
7003 ROM_START( suprleag )
7004 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
7005 	ROM_LOAD16_BYTE( "epr11131.a02",0x00000,0x10000, CRC(9b78c2cc) SHA1(9a453dd999120590c52b17f8ff2b49fd2fde0b35) )
7006 	ROM_LOAD16_BYTE( "epr11130.a01",0x00001,0x10000, CRC(e2451676) SHA1(d2f71d9fca933e63e2bd5ee48217801ab0cb049c) )
7007 	ROM_LOAD16_BYTE( "epr11133.a04",0x20000,0x10000, CRC(eed72f37) SHA1(80b68abdb90a63b30754dd031e85b1020dcc0cc4) )
7008 	ROM_LOAD16_BYTE( "epr11132.a03",0x20001,0x10000, CRC(ff199325) SHA1(2ece15b6b79ec3f948f7bec623e1df281cf89382) )
7009 	ROM_LOAD16_BYTE( "epr11135.a06",0x40000,0x10000, CRC(3735e0e1) SHA1(ae2910099909245993ee29e5a03a5591f20962c7) )
7010 	ROM_LOAD16_BYTE( "epr11134.a05",0x40001,0x10000, CRC(ccd857f5) SHA1(2566bb458bdd365db403e8229ecdad79e23076a1) )
7011 
7012 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
7013 	ROM_LOAD( "epr11136.b09",0x00000,0x10000, CRC(c3860ce4) SHA1(af7618f3b5a0e8d6374877c7815ba69fff218a45) )
7014 	ROM_LOAD( "epr11137.b10",0x10000,0x10000, CRC(92d96187) SHA1(45138795992b9842d5b0c86a96b300445bf12060) )
7015 	ROM_LOAD( "epr11138.b11",0x20000,0x10000, CRC(c01dc773) SHA1(b27da906186e1272cdd6f8d5e5a979f6623255ac) )
7016 
7017 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
7018 	ROM_LOAD16_BYTE( "epr11144.b01",0x00001,0x10000, CRC(b31de51c) SHA1(011a79a37d32ab4545187e28e61f27aa0601f686) )
7019 	ROM_LOAD16_BYTE( "epr11145.b02",0x00000,0x10000, CRC(4223d2c3) SHA1(310d5c411eeaf69fe0dc9350e6bfe6dfe950b373) )
7020 	ROM_LOAD16_BYTE( "epr11146.b03",0x20001,0x10000, CRC(bf0359b6) SHA1(6cd5e6b685e53f062d5b04888f225c808aab3c4c) )
7021 	ROM_LOAD16_BYTE( "epr11147.b04",0x20000,0x10000, CRC(3e592772) SHA1(b0fe2c680871dcdbe655c0b1b98bcf8118fb3a50) )
7022 	ROM_LOAD16_BYTE( "epr11148.b05",0x40001,0x10000, CRC(126e1309) SHA1(7386ac5ac57325d8f661caf8cab0b19a42c0309d) )
7023 	ROM_LOAD16_BYTE( "epr11149.b06",0x40000,0x10000, CRC(694d3765) SHA1(4aa8590648d5b8eb5db489edefb1326ecd01ea2c) )
7024 	ROM_LOAD16_BYTE( "epr11150.b07",0x60001,0x10000, CRC(9fc0aded) SHA1(7ad9e8fe79a0a07c748b0c20ad46c0e00de8a23a) )
7025 	ROM_LOAD16_BYTE( "epr11151.b08",0x60000,0x10000, CRC(9de95169) SHA1(1a2801ecd9dece3dae7ceab3b793d5005caa4614) )
7026 
7027 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
7028 	ROM_LOAD( "epr11139.a07",0x00000,0x08000, CRC(9cbd99da) SHA1(55960b68b23a4f89ec810e1d31f22ba60cda0cfe) )
7029 	ROM_LOAD( "epr11140.a08",0x10000,0x08000, CRC(b297371b) SHA1(4e787aa9ee2aeab4da30237644421df407b684a5) )
7030 	ROM_LOAD( "epr11141.a09",0x18000,0x08000, CRC(19756aa6) SHA1(81597e17b848f6a41f5fb117296e7508297815e4) )
7031 	ROM_LOAD( "epr11142.a10",0x20000,0x08000, CRC(25d26c66) SHA1(2485afb859f84a9cc90b2091e9ae4eef263f42b3) )
7032 	ROM_LOAD( "epr11143.a11",0x28000,0x08000, CRC(848b7b77) SHA1(8903a39f8f0ffb4ce32117d33282876196516c30) )
7033 
7034 ROM_END
7035 
7036 /*****************************************************************************/
7037 // Action Fighter
7038 
7039 ROM_START( afighter )
7040 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
7041 // cpu 317-0018
7042 	ROM_LOAD16_BYTE( "10348",0x00000,0x08000, CRC(e51e3012) SHA1(bb5522aacb55b5f04aa4cb7a642e202f0ddd7c84) )
7043 	ROM_LOAD16_BYTE( "10349",0x00001,0x08000, CRC(4b434c37) SHA1(5f3afbdb9cdb0762e56b702a195274f30193b472) )
7044 	ROM_LOAD16_BYTE( "10350",0x20000,0x08000, CRC(f2cd6b3f) SHA1(380f75b8c1696b388179641866cd1d23f78664e7) )
7045 	ROM_LOAD16_BYTE( "10351",0x20001,0x08000, CRC(ede21d8d) SHA1(b3e3944d706c606fd01e00d9511f020ce9aec9f0) )
7046 	ROM_LOAD16_BYTE( "10352",0x40000,0x08000, CRC(f8abb143) SHA1(97e78291c15bdf95fd35adca6b9e002480137b12) )
7047 	ROM_LOAD16_BYTE( "10353",0x40001,0x08000, CRC(5a757dc9) SHA1(b0540844c8a09195f5d12312f8e27c334641d7b8) )
7048 
7049 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
7050 	ROM_LOAD( "10281",0x00000,0x10000, CRC(30e92cda) SHA1(36293a2a8a22dca5350571f19f3d5d04e1b27458) )
7051 	ROM_LOAD( "10282",0x10000,0x10000, CRC(b67b8910) SHA1(f3f029a3e6547114cec28e5cf8fda65ef434c353) )
7052 	ROM_LOAD( "10283",0x20000,0x10000, CRC(e7dbfd2d) SHA1(91bae3fbc4a3c612dc507eecfa8de1c2e1e7afee) )
7053 
7054 	ROM_REGION( 0x40000, REGION_GFX2, 0 ) /* sprites */
7055 	ROM_LOAD16_BYTE( "10285",0x00001,0x08000, CRC(98aa3d04) SHA1(1d26d17a72e55281e3444fee9c5af69ffb9e3c69) )
7056 	ROM_LOAD16_BYTE( "10286",0x00000,0x08000, CRC(8da050cf) SHA1(c28e8968dbd9c110672581f4486f70d5f45df7f5) )
7057 	ROM_LOAD16_BYTE( "10287",0x10001,0x08000, CRC(7989b74a) SHA1(a87acafe82b37a11d8f8b1f2ee4c9b2e1bb8161c) )
7058 	ROM_LOAD16_BYTE( "10288",0x10000,0x08000, CRC(d3ce551a) SHA1(0ff2170d9ef89058273025dd8d5e1021094adef1) )
7059 	ROM_LOAD16_BYTE( "10289",0x20001,0x08000, CRC(c59d1b98) SHA1(e232f2519234981c0e4ffecdd25c48083d9f93a8) )
7060 	ROM_LOAD16_BYTE( "10290",0x20000,0x08000, CRC(39354223) SHA1(d8a73d3f7fc2d83d23bb7434f43bc8804f35cc16) )
7061 	ROM_LOAD16_BYTE( "10291",0x30001,0x08000, CRC(6e4b245c) SHA1(1f8cecf7ea2d2dfa5ce18d7ee34b0da2cc40221e) )
7062 	ROM_LOAD16_BYTE( "10292",0x30000,0x08000, CRC(cef289a3) SHA1(7ab817b6348c168f79be325fb3cc2cca14ee0f8e) )
7063 
7064 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* sound CPU */
7065 	ROM_LOAD( "10284",0x00000,0x8000, CRC(8ff09116) SHA1(8b99b6d2499897cfbd037a7e7cf5bc53bce8a63a) )
7066 
7067 ROM_END
7068 
7069 /*****************************************************************************/
7070 // Ryukyu
7071 
7072 ROM_START( ryukyu )
7073 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
7074 // cpu 317-5023
7075 	ROM_LOAD16_BYTE( "13347",0x00000,0x10000, CRC(398031fa) SHA1(5c118c85b7af1a83726b95bbeb85cb5020254f57) )
7076 	ROM_LOAD16_BYTE( "13348",0x00001,0x10000, CRC(5f0e0c86) SHA1(f8f5912a190d0755cc5158e2e43cceb825f95b4f) )
7077 
7078 	ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
7079 	ROM_LOAD( "13351",0x00000,0x20000, CRC(a68a4e6d) SHA1(ee3e317c7184b41af5dd383d41f7be3eebff0d04) )
7080 	ROM_LOAD( "13352",0x20000,0x20000, CRC(5e5531e4) SHA1(e8e16b35f7985e6cdd77353ca5235db518914744) )
7081 	ROM_LOAD( "13353",0x40000,0x20000, CRC(6d23dfd8) SHA1(21266340290b9854cee0b62fc107cc2981519a80) )
7082 
7083 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
7084 	ROM_LOAD16_BYTE( "13354",0x00001,0x20000, CRC(f07aad99) SHA1(71759525a5b7fe76d112cec93984f0f89cadbc00) )
7085 	ROM_LOAD16_BYTE( "13355",0x00000,0x20000, CRC(67890019) SHA1(165c6a32f305273396ec0e9499e00329caadc484) )
7086 	ROM_LOAD16_BYTE( "13356",0x40001,0x20000, CRC(5498290b) SHA1(b3115b636d8cb6ecac22d5264b7961e3b807cf04) )
7087 	ROM_LOAD16_BYTE( "13357",0x40000,0x20000, CRC(f9e7cf03) SHA1(2258111499c79443faf84fb0495007016282bb3c) )
7088 
7089 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
7090 	ROM_LOAD( "13349",0x00000,0x08000, CRC(b83183f8) SHA1(9d6127f51c04a16bb2637dc9992b843b94613c2b) )
7091 	ROM_LOAD( "13350",0x10000,0x20000, CRC(3c59a658) SHA1(2cef13ee9e666bb850fe6c6e6954d7b75df665a9) )
7092 ROM_END
7093 
7094 /***************************************************************************/
7095 
7096 // Ace Attacker
7097 ROM_START( aceattac )
7098 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
7099 	ROM_LOAD16_BYTE( "11491.4a", 0x000000, 0x10000, CRC(77b820f1) SHA1(c33183c94c5029e2c4d6444f37404da66aacecc4) )
7100 	ROM_LOAD16_BYTE( "11489.1a", 0x000001, 0x10000, CRC(bbe623c5) SHA1(6d047699c7b6df7ebb7a3c9bee032e2536eed84c) )
7101 	ROM_LOAD16_BYTE( "11492.5a", 0x020000, 0x10000, CRC(d8bd3139) SHA1(54915d4e8a616e0e54135ca34daf4357b8bfa068) )
7102 	ROM_LOAD16_BYTE( "11490.2a", 0x020001, 0x10000, CRC(38cb3a41) SHA1(1d74cc69907cdff2d85e965b80bf3f551465257e) )
7103 
7104 	ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
7105 	ROM_LOAD( "11493.9b",  0x00000, 0x10000, CRC(654485d9) SHA1(b431270564c4e33fd70c8c85af1fcbff8b59ba49) )
7106 	ROM_LOAD( "11494.10b", 0x10000, 0x10000, CRC(b67971ab) SHA1(95cb6927baf425bcc290832ea9741b19852c7a1b) )
7107 	ROM_LOAD( "11495.11b", 0x20000, 0x10000, CRC(b687ab61) SHA1(b08130a9d777c918972895136b1bf520d7117114) )
7108 
7109 	ROM_REGION( 0x80000, REGION_GFX2, 0 ) /* sprites */
7110 	ROM_LOAD16_BYTE( "11501.1b", 0x00001, 0x10000, CRC(09179ead) SHA1(3e6bf04e1e9ea867d087a47ff04ad0a064a8e299) )
7111 	ROM_LOAD16_BYTE( "11502.2b", 0x00000, 0x10000, CRC(a3ee36b8) SHA1(bc946ad67b8ad09d947465ab73160885a4a57be5) )
7112 	ROM_LOAD16_BYTE( "11503.3b", 0x20001, 0x10000, CRC(344c0692) SHA1(3125701f6bb91d8f64515e214b571e169c30a444) )
7113 	ROM_LOAD16_BYTE( "11504.4b", 0x20000, 0x10000, CRC(7cae7920) SHA1(9f00e01d7cc86a0bf4f84e78a56b7efbb97c5591) )
7114 	ROM_LOAD16_BYTE( "11505.5b", 0x40001, 0x10000, CRC(b67f1ecf) SHA1(3a26cdf91e5a1a11c1a8857e713a9e00cc1bfce0) )
7115 	ROM_LOAD16_BYTE( "11506.6b", 0x40000, 0x10000, CRC(b0104def) SHA1(c81a66ec3a600c1d4c5d058caef15936c59b2574) )
7116 	ROM_LOAD16_BYTE( "11507.7b", 0x60001, 0x10000, CRC(a2af710a) SHA1(1c8b75b72797146c2eb788511f8cb1b367fc3e0d) )
7117 	ROM_LOAD16_BYTE( "11508.8b", 0x60000, 0x10000, CRC(5cbb833c) SHA1(dc7041b6a4fa75d050bfc2176d0f9e242b55a0b8) )
7118 
7119 	ROM_REGION( 0x30000, REGION_CPU2, 0 ) /* sound CPU */
7120 	ROM_LOAD( "11496.7a",	 0x00000, 0x08000, CRC(82cb40a9) SHA1(daf2233438331ba6e6ff8bda4015e92d23e616c5) )
7121 	ROM_LOAD( "11497.8a",    0x10000, 0x08000, CRC(b04f62cc) SHA1(29b468e5a565dc14e00c371913663eca66ccb44d) )
7122 	ROM_LOAD( "11498.9a",    0x18000, 0x08000, CRC(97baf52b) SHA1(97800014250b0099c7e53d597b0ef02ae14e6dba) )
7123 	ROM_LOAD( "11499.10a",   0x20000, 0x08000, CRC(ea332866) SHA1(eba0b422b39f7f3f81af1059043a87d944c4aff7) )
7124 	ROM_LOAD( "11500.11a",   0x28000, 0x08000, CRC(2ddf1c31) SHA1(77b20edbbd801072b20d9dc5e8fa2f468e53d79e) )
7125 ROM_END
7126 
7127 
7128 
7129 /* pre-System16 */
7130 /*          rom       parent    machine   inp       init */
7131 /* Alien Syndrome */
7132 GAME( 1985, mjleague, 0,        mjleague, mjleague, mjleague, ROT270, "Sega",    "Major League" )
7133 GAME( 1986, bodyslam, 0,        bodyslam, bodyslam, bodyslam, ROT0,   "Sega",    "Body Slam" )
7134 GAME( 1986, dumpmtmt, bodyslam, bodyslam, bodyslam, bodyslam, ROT0,   "Sega",    "Dump Matsumoto (Japan)" )
7135 GAMEX( 1986, quartet,  0,        quartet,  quartet,  quartet,  ROT0,   "Sega",    "Quartet (Rev A, 8751 315-5194)", GAME_UNEMULATED_PROTECTION )
7136 GAMEX( 1986, quartetj, quartet,  quartet,  quartet,  quartet,  ROT0,   "Sega",    "Quartet (8751 315-5194)", GAME_UNEMULATED_PROTECTION )
7137 GAMEX( 1986, quartet2, quartet,  quartet2, quartet2, quartet2, ROT0,   "Sega",    "Quartet 2 (8751 317-0010)", GAME_UNEMULATED_PROTECTION )
7138 GAME( 1986, quartt2j, quartet,  quartet2, quartet2, quartet2, ROT0,   "Sega",    "Quartet 2 (unprotected)" )
7139 
7140 /* System16A */
7141 /*          rom       parent    machine   inp       init */
7142 GAMEX(19??, afighter, 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega",     "Action Fighter", GAME_NOT_WORKING )
7143 GAMEX(1986, alexkidd, 0,        alexkidd, alexkidd, alexkidd, ROT0,   "Sega",    "Alex Kidd: The Lost Stars (set 1)", GAME_NOT_WORKING )
7144 GAME( 1986, alexkida, alexkidd, alexkidd, alexkidd, alexkidd, ROT0,   "Sega",    "Alex Kidd: The Lost Stars (set 2)" )
7145 GAME( 1986, fantzone, 0,        fantzone, fantzone, fantzone, ROT0,   "Sega",    "Fantasy Zone (Japan New Ver.)" )
7146 GAME( 1986, fantzono, fantzone, fantzono, fantzone, fantzone, ROT0,   "Sega",    "Fantasy Zone (Old Ver.)" )
7147 GAMEX(19??, ryukyu  , 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega",    "Ryukyu", GAME_NOT_WORKING )
7148 GAME( 1987, shinobi,  0,        shinobi,  shinobi,  shinobi,  ROT0,   "Sega",    "Shinobi (set 1)" )
7149 GAMEX(1987, shinobib, shinobi,  shinobi,  shinobi,  shinobi,  ROT0,   "Sega",    "Shinobi (set 3)", GAME_NOT_WORKING )
7150 GAMEX(1987, shinobia, shinobi,  shinobl,  shinobi,  shinobi,  ROT0,   "Sega",    "Shinobi (set 2)", GAME_NOT_WORKING )
7151 GAME( 1987, shinobl,  shinobi,  shinobl,  shinobi,  shinobi,  ROT0,   "bootleg", "Shinobi (bootleg)" )
7152 GAME( 1987, sdi,      0,        sdi,      sdi,      sdi,      ROT0,   "Sega",    "SDI - Strategic Defense Initiative" )
7153 GAMEX(1987, sdioj,    sdi,      sdi,      sdi,      sdi,      ROT0,   "Sega",    "SDI - Strategic Defense Initiative (Japan)", GAME_NOT_WORKING )
7154 GAMEX(1988, tetris,   0,        tetris,   tetris,   tetris,   ROT0,   "Sega",    "Tetris (Sega Set 1)", GAME_NOT_WORKING )
7155 GAME( 1988, tetrisbl, tetris,   tetris,   tetris,   tetrisbl, ROT0,   "bootleg", "Tetris (Sega bootleg)" )
7156 GAMEX(1988, tetrisa,  tetris,   tetris,   tetris,   tetrisbl, ROT0,   "Sega",    "Tetris (Sega Set 2)", GAME_NOT_WORKING )
7157 
7158 /* System16B */
7159 /*          rom       parent    machine   inp       init */
7160 GAMEX(19??, aceattac, 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Ace Attacker", GAME_NOT_WORKING )
7161 GAMEX(1990, atomicp,  0,        atomicp,  atomicp,  atomicp,  ROT0,   "Philko",  "Atomic Point", GAME_NO_SOUND )
7162 GAME( 1987, aliensyn, 0,        aliensyn, aliensyn, aliensyn, ROT0,   "Sega",    "Alien Syndrome (set 1)" )
7163 GAMEX(1987, aliensya, aliensyn, aliensyn, aliensyn, aliensyn, ROT0,   "Sega",    "Alien Syndrome (set 2)", GAME_NOT_WORKING )
7164 GAMEX(1987, aliensyj, aliensyn, aliensyn, aliensyn, aliensyn, ROT0,   "Sega",    "Alien Syndrome (Japan)", GAME_NOT_WORKING )
7165 GAMEX(1987, aliensyb, aliensyn, aliensyn, aliensyn, aliensyn, ROT0,   "Sega",    "Alien Syndrome (set 3)", GAME_NOT_WORKING )
7166 GAME( 1988, altbeast, 0,        altbeast, altbeast, altbeast, ROT0,   "Sega",    "Altered Beast (Version 1)" )
7167 GAMEX(1988, altbeas2, altbeast, altbeas2, altbeast, altbeast, ROT0,   "Sega",    "Altered Beast (Version 2)", GAME_NO_SOUND )
7168 GAMEX(1988, jyuohki,  altbeast, altbeast, altbeast, altbeast, ROT0,   "Sega",    "Jyuohki (Japan)",           GAME_NOT_WORKING )
7169 GAME( 1990, aurail,   0,        aurail,   aurail,   aurail,   ROT0,   "Sega / Westone", "Aurail (set 1)" )
7170 GAME( 1990, auraila,  aurail,   aurail,   aurail,   auraila,  ROT0,   "Sega / Westone", "Aurail (set 2)" )
7171 GAME( 1989, bayroute, 0,        bayroute, bayroute, bayroute, ROT0,   "Sunsoft / Sega", "Bay Route (set 1)" )
7172 GAMEX(1989, bayrouta, bayroute, bayroute, bayroute, bayrouta, ROT0,   "Sunsoft / Sega", "Bay Route (set 2)", GAME_NOT_WORKING )
7173 GAMEX(1989, bayrtbl1, bayroute, bayroute, bayroute, bayrtbl1, ROT0,   "bootleg", "Bay Route (bootleg set 1)", GAME_NOT_WORKING )
7174 GAMEX(1989, bayrtbl2, bayroute, bayroute, bayroute, bayrtbl1, ROT0,   "bootleg", "Bay Route (bootleg set 2)", GAME_NOT_WORKING )
7175 /* Bullet */
7176 /* Charon */
7177 GAMEX(19??, cotton,   0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Cotton (Japan)", GAME_NOT_WORKING )
7178 GAMEX(19??, cottona,  cotton,   s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Cotton", GAME_NOT_WORKING )
7179 GAMEX(19??, dunkshot, 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Dunk Shot", GAME_NOT_WORKING )
7180 GAME( 1989, dduxbl,   0,        dduxbl,   dduxbl,   dduxbl,   ROT0,   "bootleg", "Dynamite Dux (bootleg)" )
7181 GAMEX(1989, eswat,    0,        eswat,    eswat,    eswat,    ROT0,   "Sega",    "E-Swat - Cyber Police", GAME_NOT_WORKING )
7182 GAME( 1989, eswatbl,  eswat,    eswat,    eswat,    eswat,    ROT0,   "bootleg", "E-Swat - Cyber Police (bootleg)" )
7183 GAMEX(19??, exctleag, 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Excite League", GAME_NOT_WORKING )
7184 
7185 GAMEX(1989, fpoint,   0,        fpoint,   fpoint,   fpoint,   ROT0,   "Sega",    "Flash Point", GAME_NOT_WORKING )
7186 GAME( 1989, fpointbl, fpoint,   fpointbl, fpoint,   fpointbl, ROT0,   "bootleg", "Flash Point (World, bootleg)" )
7187 GAME( 1989, fpointbj, fpoint,   fpointbl, fpointbj, fpointbl, ROT0,   "bootleg", "Flash Point (Japan, bootleg)" )
7188 
7189 GAME( 1989, goldnaxe, 0,        goldnaxe, goldnaxe, goldnaxe, ROT0,   "Sega",    "Golden Axe (Version 1)" )
7190 GAMEX(1989, goldnaxj, goldnaxe, goldnaxe, goldnaxe, goldnaxe, ROT0,   "Sega",    "Golden Axe (Version 1, Japan)", GAME_NOT_WORKING )
7191 GAMEX(1989, goldnabl, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING )
7192 GAME( 1989, goldnaxa, goldnaxe, goldnaxa, goldnaxe, goldnaxe, ROT0,   "Sega",    "Golden Axe (set 6, US) (8751 317-123A)" )
7193 GAMEX(1989, goldnaxb, goldnaxe, goldnaxa, goldnaxe, goldnaxe, ROT0,   "Sega",    "Golden Axe (Version 2 317-0110)", GAME_NOT_WORKING )
7194 GAMEX(1989, goldnaxc, goldnaxe, goldnaxa, goldnaxe, goldnaxe, ROT0,   "Sega",    "Golden Axe (Version 2 317-0122)", GAME_NOT_WORKING )
7195 GAME( 1987, hwchamp,  0,        hwchamp,  hwchamp,  hwchamp,  ROT0,   "Sega",    "Heavyweight Champ" )
7196 GAMEX(19??, mvp,      0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega",    "MVP", GAME_NOT_WORKING )
7197 GAMEX(1988, passsht,  0,        passsht,  passsht,  passsht,  ROT270, "Sega",    "Passing Shot (2 Players)", GAME_NOT_WORKING )
7198 GAME( 1988, passshtb, passsht,  passsht,  passsht,  passsht,  ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)" )
7199 GAMEX(1988, passht4b, passsht,  passht4b, passht4b, passht4b, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NO_SOUND )
7200 GAME( 1991, riotcity, 0,        riotcity, riotcity, riotcity, ROT0,   "Sega / Westone", "Riot City" )
7201 /* Ryukyu */
7202 /* Shinobi */
7203 GAME( 1987, sonicbom, 0,        sonicbom, sonicbom, sonicbom, ROT270, "Sega",    "Sonic Boom" )
7204 /* SDI */
7205 /* Sukeban Jansi Ryuko */
7206 GAMEX(19??, suprleag, 0,        s16dummy, s16dummy, s16dummy, ROT0,   "Sega", "Super League", GAME_NOT_WORKING )
7207 /* Tetris */
7208 GAME( 1987, timscanr, 0,        timscanr, timscanr, timscanr, ROT270, "Sega",    "Time Scanner" )
7209 GAME (1994, toryumon, 0,        toryumon, toryumon, toryumon, ROT0,   "Sega",    "Toryumon" )
7210 GAME (1989, tturf,    0,        tturf,    tturf,    tturf,    ROT0,   "Sega / Sunsoft", "Tough Turf (Japan)")
7211 GAME (1989, tturfu,   tturf,    tturfu,   tturf,    tturf,    ROT0,   "Sega / Sunsoft", "Tough Turf (US)")
7212 GAMEX(1989, tturfbl,  tturf,    tturfbl,  tturf,    tturfbl,  ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND)
7213 GAME( 1988, wb3,      0,        wb3,      wb3,      wb3,      ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 1)" ) //*
7214 GAMEX(1988, wb3a,     wb3,      wb3,      wb3,      wb3,      ROT0,   "Sega / Westone", "Wonder Boy III - Monster Lair (set 2)", GAME_NOT_WORKING )
7215 GAME( 1988, wb3bl,    wb3,      wb3bl,    wb3,      wb3bl,    ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)" )
7216 GAME( 1989, wrestwar, 0,        wrestwar, wrestwar, wrestwar, ROT270, "Sega",    "Wrestle War" )
7217