1 /****************************************************************************
2 
3 	Super Chase  						(c) 1992 Taito
4 
5 	Driver by Bryan McPhail & David Graves.
6 
7 	Board Info:
8 
9 		CPU board:
10 		68000
11 		68020
12 		TC0570SPC (Taito custom)
13 		TC0470LIN (Taito custom)
14 		TC0510NIO (Taito custom)
15 		TC0480SCP (Taito custom)
16 		TC0650FDA (Taito custom)
17 		ADC0809CCN
18 
19 		X2=26.686MHz
20 		X1=40MHz
21 		X3=32MHz
22 
23 		Sound board:
24 		68000
25 		68681
26 		MB8421 (x2)
27 		MB87078
28 		Ensoniq 5510
29 		Ensoniq 5505
30 
31 	(Acknowledgments and thanks to Richard Bush and the Raine team
32 	for their preliminary Super Chase driver.)
33 
34 ***************************************************************************/
35 
36 #include "driver.h"
37 #include "cpu/m68000/m68000.h"
38 #include "vidhrdw/generic.h"
39 #include "vidhrdw/taitoic.h"
40 #include "sndhrdw/taitosnd.h"
41 #include "machine/eeprom.h"
42 
43 VIDEO_START( superchs );
44 VIDEO_UPDATE( superchs );
45 
46 static UINT16 coin_word;
47 static data32_t *superchs_ram;
48 static data32_t *shared_ram;
49 extern data32_t *f3_shared_ram;
50 
51 static int steer=0;
52 
53 /* from sndhrdw/taito_f3.c */
54 READ16_HANDLER(f3_68000_share_r);
55 WRITE16_HANDLER(f3_68000_share_w);
56 READ16_HANDLER(f3_68681_r);
57 WRITE16_HANDLER(f3_68681_w);
58 READ16_HANDLER(es5510_dsp_r);
59 WRITE16_HANDLER(es5510_dsp_w);
60 WRITE16_HANDLER(f3_volume_w);
61 WRITE16_HANDLER(f3_es5505_bank_w);
62 void f3_68681_reset(void);
63 extern WRITE16_HANDLER( es5505_bank_w ); /* drivers/f3 */
64 
65 /*********************************************************************/
66 
READ16_HANDLER(shared_ram_r)67 static READ16_HANDLER( shared_ram_r )
68 {
69 	if ((offset&1)==0) return (shared_ram[offset/2]&0xffff0000)>>16;
70 	return (shared_ram[offset/2]&0x0000ffff);
71 }
72 
WRITE16_HANDLER(shared_ram_w)73 static WRITE16_HANDLER( shared_ram_w )
74 {
75 	if ((offset&1)==0) {
76 		if (ACCESSING_MSB)
77 			shared_ram[offset/2]=(shared_ram[offset/2]&0x00ffffff)|((data&0xff00)<<16);
78 		if (ACCESSING_LSB)
79 			shared_ram[offset/2]=(shared_ram[offset/2]&0xff00ffff)|((data&0x00ff)<<16);
80 	} else {
81 		if (ACCESSING_MSB)
82 			shared_ram[offset/2]=(shared_ram[offset/2]&0xffff00ff)|((data&0xff00)<< 0);
83 		if (ACCESSING_LSB)
84 			shared_ram[offset/2]=(shared_ram[offset/2]&0xffffff00)|((data&0x00ff)<< 0);
85 	}
86 }
87 
WRITE32_HANDLER(cpua_ctrl_w)88 static WRITE32_HANDLER( cpua_ctrl_w )
89 {
90 	/*
91 	CPUA writes 0x00, 22, 72, f2 in that order.
92 	f2 seems to be the standard in-game value.
93 	..x...x.
94 	.xxx..x.
95 	xxxx..x.
96 	is there an irq enable in the top nibble?
97 	*/
98 
99 	if (ACCESSING_MSB)
100 	{
101 		cpu_set_reset_line(2,(data &0x200) ? CLEAR_LINE : ASSERT_LINE);
102 		if (data&0x8000) cpu_set_irq_line(0,3,HOLD_LINE); /* Guess */
103 	}
104 
105 	if (ACCESSING_LSB32)
106 	{
107 		/* Lamp control bits of some sort in the lsb */
108 	}
109 }
110 
WRITE32_HANDLER(superchs_palette_w)111 static WRITE32_HANDLER( superchs_palette_w )
112 {
113 	int a,r,g,b;
114 	COMBINE_DATA(&paletteram32[offset]);
115 
116 	a = paletteram32[offset];
117 	r = (a &0xff0000) >> 16;
118 	g = (a &0xff00) >> 8;
119 	b = (a &0xff);
120 
121 	palette_set_color(offset,r,g,b);
122 }
123 
READ32_HANDLER(superchs_input_r)124 static READ32_HANDLER( superchs_input_r )
125 {
126 	switch (offset)
127 	{
128 		case 0x00:
129 			return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) |
130 				  (EEPROM_read_bit() << 7);
131 
132 		case 0x01:
133 			return coin_word<<16;
134  	}
135 
136 	return 0xffffffff;
137 }
138 
WRITE32_HANDLER(superchs_input_w)139 static WRITE32_HANDLER( superchs_input_w )
140 {
141 
142 	#if 0
143 	{
144 	char t[64];
145 	static data32_t mem[2];
146 	COMBINE_DATA(&mem[offset]);
147 	sprintf(t,"%08x %08x",mem[0],mem[1]);
148 	/*usrintf_showmessage(t);*/
149 	}
150 	#endif
151 
152 	switch (offset)
153 	{
154 		case 0x00:
155 		{
156 			if (ACCESSING_MSB32)	/* $300000 is watchdog */
157 			{
158 				watchdog_reset_w(0,data >> 24);
159 			}
160 
161 			if (ACCESSING_LSB32)
162 			{
163 				EEPROM_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
164 				EEPROM_write_bit(data & 0x40);
165 				EEPROM_set_cs_line((data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
166 				return;
167 			}
168 
169 			return;
170 		}
171 
172 		/* there are 'vibration' control bits somewhere! */
173 
174 		case 0x01:
175 		{
176 			if (ACCESSING_MSB32)
177 			{
178 				coin_lockout_w(0,~data & 0x01000000);
179 				coin_lockout_w(1,~data & 0x02000000);
180 				coin_counter_w(0, data & 0x04000000);
181 				coin_counter_w(1, data & 0x08000000);
182 				coin_word=(data >> 16) &0xffff;
183 			}
184 		}
185 	}
186 }
187 
READ32_HANDLER(superchs_stick_r)188 static READ32_HANDLER( superchs_stick_r )
189 {
190 	int fake = input_port_6_word_r(0,0);
191 	int accel;
192 
193 	if (!(fake &0x10))	/* Analogue steer (the real control method) */
194 	{
195 		steer = input_port_2_word_r(0,0);
196 	}
197 	else	/* Digital steer, with smoothing - speed depends on how often stick_r is called */
198 	{
199 		int delta;
200 		int goal = 0x80;
201 		if (fake &0x04) goal = 0xff;		/* pressing left */
202 		if (fake &0x08) goal = 0x0;		/* pressing right */
203 
204 		if (steer!=goal)
205 		{
206 			delta = goal - steer;
207 			if (steer < goal)
208 			{
209 				if (delta >2) delta = 2;
210 			}
211 			else
212 			{
213 				if (delta < (-2)) delta = -2;
214 			}
215 			steer += delta;
216 		}
217 	}
218 
219 	/* Accelerator is an analogue input but the game treats it as digital (on/off) */
220 	if (input_port_6_word_r(0,0) & 0x1)	/* pressing B1 */
221 		accel = 0x0;
222 	else
223 		accel = 0xff;
224 
225 	/* Todo: Verify brake - and figure out other input */
226 	return (steer << 24) | (accel << 16) | (input_port_4_word_r(0,0) << 8) | input_port_5_word_r(0,0);
227 }
228 
WRITE32_HANDLER(superchs_stick_w)229 static WRITE32_HANDLER( superchs_stick_w )
230 {
231 	/* This is guess work - the interrupts are in groups of 4, with each writing to a
232 		different byte in this long word before the RTE.  I assume all but the last
233 		(top) byte cause an IRQ with the final one being an ACK.  (Total guess but it works). */
234 	if (mem_mask!=0x00ffffff)
235 		cpu_set_irq_line(0,3,HOLD_LINE);
236 }
237 
238 /***********************************************************
239 			 MEMORY STRUCTURES
240 ***********************************************************/
241 
MEMORY_READ32_START(superchs_readmem)242 static MEMORY_READ32_START( superchs_readmem )
243 	{ 0x000000, 0x0fffff, MRA32_ROM },
244 	{ 0x100000, 0x11ffff, MRA32_RAM },	/* main CPUA ram */
245 	{ 0x140000, 0x141fff, MRA32_RAM },	/* Sprite ram */
246 	{ 0x180000, 0x18ffff, TC0480SCP_long_r },
247 	{ 0x1b0000, 0x1b002f, TC0480SCP_ctrl_long_r },
248 	{ 0x200000, 0x20ffff, MRA32_RAM },	/* Shared ram */
249 	{ 0x280000, 0x287fff, MRA32_RAM },	/* Palette ram */
250 	{ 0x2c0000, 0x2c07ff, MRA32_RAM },	/* Sound shared ram */
251 	{ 0x300000, 0x300007, superchs_input_r },
252 	{ 0x340000, 0x340003, superchs_stick_r },	/* stick coord read */
253 MEMORY_END
254 
255 static MEMORY_WRITE32_START( superchs_writemem )
256 	{ 0x000000, 0x0fffff, MWA32_ROM },
257 	{ 0x100000, 0x11ffff, MWA32_RAM, &superchs_ram },
258 	{ 0x140000, 0x141fff, MWA32_RAM, &spriteram32, &spriteram_size },
259 	{ 0x180000, 0x18ffff, TC0480SCP_long_w },
260 	{ 0x1b0000, 0x1b002f, TC0480SCP_ctrl_long_w },
261 	{ 0x200000, 0x20ffff, MWA32_RAM, &shared_ram },
262 	{ 0x240000, 0x240003, cpua_ctrl_w },
263 	{ 0x280000, 0x287fff, superchs_palette_w, &paletteram32 },
264 	{ 0x2c0000, 0x2c07ff, MWA32_RAM, &f3_shared_ram },
265 	{ 0x300000, 0x300007, superchs_input_w },	/* eerom etc. */
266 	{ 0x340000, 0x340003, superchs_stick_w },	/* stick int request */
267 MEMORY_END
268 
269 static MEMORY_READ16_START( superchs_cpub_readmem )
270 	{ 0x000000, 0x03ffff, MRA16_ROM },
271 	{ 0x200000, 0x20ffff, MRA16_RAM },	/* local ram */
272 	{ 0x800000, 0x80ffff, shared_ram_r },
273 	{ 0xa00000, 0xa001ff, MRA16_RAM },
274 MEMORY_END
275 
276 static MEMORY_WRITE16_START( superchs_cpub_writemem )
277 	{ 0x000000, 0x03ffff, MWA16_ROM },
278 	{ 0x200000, 0x20ffff, MWA16_RAM },
279 	{ 0x600000, 0x60ffff, TC0480SCP_word_w }, /* Only written upon errors */
280 	{ 0x800000, 0x80ffff, shared_ram_w },
281 	{ 0xa00000, 0xa001ff, MWA16_RAM },	/* Extra road control?? */
282 MEMORY_END
283 
284 /******************************************************************************/
285 
286 static MEMORY_READ16_START( sound_readmem )
287 	{ 0x000000, 0x03ffff, MRA16_RAM },
288 	{ 0x140000, 0x140fff, f3_68000_share_r },
289 	{ 0x200000, 0x20001f, ES5505_data_0_r },
290 	{ 0x260000, 0x2601ff, es5510_dsp_r },
291 	{ 0x280000, 0x28001f, f3_68681_r },
292 	{ 0xc00000, 0xcfffff, MRA16_BANK1 },
293 	{ 0xff8000, 0xffffff, MRA16_RAM },
294 MEMORY_END
295 
296 static MEMORY_WRITE16_START( sound_writemem )
297 	{ 0x000000, 0x03ffff, MWA16_RAM },
298 	{ 0x140000, 0x140fff, f3_68000_share_w },
299 	{ 0x200000, 0x20001f, ES5505_data_0_w },
300 	{ 0x260000, 0x2601ff, es5510_dsp_w },
301 	{ 0x280000, 0x28001f, f3_68681_w },
302 	{ 0x300000, 0x30003f, f3_es5505_bank_w },
303 	{ 0x340000, 0x340003, f3_volume_w }, /* 8 channel volume control */
304 	{ 0xc00000, 0xcfffff, MWA16_ROM },
305 	{ 0xff8000, 0xffffff, MWA16_RAM },
306 MEMORY_END
307 
308 /***********************************************************/
309 
310 INPUT_PORTS_START( superchs )
311 	PORT_START      /* IN0 */
312 	PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
313 	PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
314 	PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
315 	PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1 )	/* Freeze input */
316 	PORT_BITX(0x0010, IP_ACTIVE_LOW,  IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
317 	PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_SERVICE1 )
318 	PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_COIN2 )
319 	PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_COIN1 )
320 	PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN )
321 	PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
322 	PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
323 	PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
324 	PORT_BIT( 0x1000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
325 	PORT_BIT( 0x2000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
326 	PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
327 	PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
328 
329 	PORT_START      /* IN1 */
330 	PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_UNKNOWN )
331 	PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
332 	PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
333 	PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN )
334 	PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_UNKNOWN )
335 	PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN )
336 	PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN )
337 	PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )	/* reserved for EEROM */
338 	PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON5 | IPF_PLAYER1 )	/* seat center (cockpit only) */
339 	PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN )
340 	PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_UNKNOWN )
341 	PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_UNKNOWN )
342 	PORT_BITX(0x1000, IP_ACTIVE_LOW,  IPT_BUTTON3, "Nitro", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
343 	PORT_BITX(0x2000, IP_ACTIVE_LOW,  IPT_BUTTON4, "Gear Shift", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
344 	PORT_BITX(0x4000, IP_ACTIVE_LOW,  IPT_BUTTON2, "Brake", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
345 	PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_START1 )
346 
347 	PORT_START	/* IN 2, steering wheel */
348 	PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_REVERSE | IPF_PLAYER1, 25, 15, 0, 0xff )
349 
350 	PORT_START	/* IN 3, accel [effectively also brake for the upright] */
351 	PORT_ANALOG( 0xff, 0x00, IPT_AD_STICK_Y | IPF_PLAYER1, 20, 10, 0, 0xff)
352 
353 	PORT_START	/* IN 4, sound volume */
354 	PORT_ANALOG( 0xff, 0x00, IPT_AD_STICK_X | IPF_REVERSE | IPF_PLAYER2, 20, 10, 0, 0xff)
355 
356 	PORT_START	/* IN 5, unknown */
357 	PORT_ANALOG( 0xff, 0x00, IPT_AD_STICK_Y | IPF_PLAYER2, 20, 10, 0, 0xff)
358 
359 	PORT_START	/* IN 6, inputs and DSW all fake */
360 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
361 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_PLAYER1 )
362 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER1 )
363 	PORT_DIPNAME( 0x10, 0x00, "Steering type" )
364 	PORT_DIPSETTING(    0x10, "Digital" )
365 	PORT_DIPSETTING(    0x00, "Analogue" )
366 INPUT_PORTS_END
367 
368 /***********************************************************
369 				GFX DECODING
370 **********************************************************/
371 
372 static struct GfxLayout tile16x16_layout =
373 {
374 	16,16,	/* 16*16 sprites */
375 	RGN_FRAC(1,1),
376 	4,	/* 4 bits per pixel */
377 	{ 0, 8, 16, 24 },
378 	{ 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 },
379 	{ 0*64, 1*64,  2*64,  3*64,  4*64,  5*64,  6*64,  7*64,
380 	  8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
381 	64*16	/* every sprite takes 128 consecutive bytes */
382 };
383 
384 static struct GfxLayout charlayout =
385 {
386 	16,16,    /* 16*16 characters */
387 	RGN_FRAC(1,1),
388 	4,        /* 4 bits per pixel */
389 	{ 0, 1, 2, 3 },
390 	{ 1*4, 0*4, 5*4, 4*4, 3*4, 2*4, 7*4, 6*4, 9*4, 8*4, 13*4, 12*4, 11*4, 10*4, 15*4, 14*4 },
391 	{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
392 	128*8     /* every sprite takes 128 consecutive bytes */
393 };
394 
395 static struct GfxDecodeInfo superchs_gfxdecodeinfo[] =
396 {
397 	{ REGION_GFX2, 0x0, &tile16x16_layout,  0, 512 },
398 	{ REGION_GFX1, 0x0, &charlayout,        0, 512 },
399 	{ -1 } /* end of array */
400 };
401 
402 
403 /***********************************************************
404 			     MACHINE DRIVERS
405 ***********************************************************/
406 
MACHINE_INIT(superchs)407 static MACHINE_INIT( superchs )
408 {
409 	/* Sound cpu program loads to 0xc00000 so we use a bank */
410 	data16_t *RAM = (data16_t *)memory_region(REGION_CPU2);
411 	cpu_setbank(1,&RAM[0x80000]);
412 
413 	RAM[0]=RAM[0x80000]; /* Stack and Reset vectors */
414 	RAM[1]=RAM[0x80001];
415 	RAM[2]=RAM[0x80002];
416 	RAM[3]=RAM[0x80003];
417 
418 	f3_68681_reset();
419 }
420 
421 static struct ES5505interface es5505_interface =
422 {
423 	1,					/* total number of chips */
424 	{ 13343000 },		/* freq - 26.686MHz/2??  May be 16MHz but Nancy sounds too high-pitched */
425 	{ REGION_SOUND1 },	/* Bank 0: Unused by F3 games? */
426 	{ REGION_SOUND1 },	/* Bank 1: All games seem to use this */
427 	{ YM3012_VOL(100,MIXER_PAN_LEFT,100,MIXER_PAN_RIGHT) },		/* master volume */
428 	{ 0 }				/* irq callback */
429 };
430 
431 static struct EEPROM_interface superchs_eeprom_interface =
432 {
433 	6,				/* address bits */
434 	16,				/* data bits */
435 	"0110",			/* read command */
436 	"0101",			/* write command */
437 	"0111",			/* erase command */
438 	"0100000000",	/* unlock command */
439 	"0100110000",	/* lock command */
440 };
441 
442 static data8_t default_eeprom[128]={
443 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
444 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x53,0x00,0x2e,0x00,0x43,0x00,0x00,
445 	0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x01,
446 	0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,
447 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
448 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
449 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x80,0xff,0xff,0xff,0xff,
450 	0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff
451 };
452 
NVRAM_HANDLER(superchs)453 static NVRAM_HANDLER( superchs )
454 {
455 	if (read_or_write)
456 		EEPROM_save(file);
457 	else
458 	{
459 		EEPROM_init(&superchs_eeprom_interface);
460 
461 		if (file)
462 			EEPROM_load(file);
463 		else
464 			EEPROM_set_data(default_eeprom,128);  /* Default the wheel setup values */
465 	}
466 }
467 
468 static MACHINE_DRIVER_START( superchs )
469 
470 	/* basic machine hardware */
471 	MDRV_CPU_ADD(M68EC020, 16000000)	/* 16 MHz */
MDRV_CPU_MEMORY(superchs_readmem,superchs_writemem)472 	MDRV_CPU_MEMORY(superchs_readmem,superchs_writemem)
473 	MDRV_CPU_VBLANK_INT(irq2_line_hold,1)/* VBL */
474 
475 	MDRV_CPU_ADD(M68000, 16000000)
476 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* 16 MHz */
477 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
478 
479 	MDRV_CPU_ADD(M68000, 16000000)	/* 16 MHz */
480 	MDRV_CPU_MEMORY(superchs_cpub_readmem,superchs_cpub_writemem)
481 	MDRV_CPU_VBLANK_INT(irq4_line_hold,1)/* VBL */
482 
483 	MDRV_FRAMES_PER_SECOND(60)
484 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
485 	MDRV_INTERLEAVE(8)	/* CPU slices - Need to interleave Cpu's 1 & 3 */
486 
487 	MDRV_MACHINE_INIT(superchs)
488 	MDRV_NVRAM_HANDLER(superchs)
489 
490 	/* video hardware */
491 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_NEEDS_6BITS_PER_GUN)
492 	MDRV_SCREEN_SIZE(40*8, 32*8)
493 	MDRV_VISIBLE_AREA(0, 40*8-1, 2*8, 32*8-1)
494 	MDRV_GFXDECODE(superchs_gfxdecodeinfo)
495 	MDRV_PALETTE_LENGTH(8192)
496 
497 	MDRV_VIDEO_START(superchs)
498 	MDRV_VIDEO_UPDATE(superchs)
499 
500 	/* sound hardware */
501 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
502 	MDRV_SOUND_ADD(ES5505, es5505_interface)
503 MACHINE_DRIVER_END
504 
505 /***************************************************************************/
506 
507 ROM_START( superchs )
508 	ROM_REGION( 0x100000, REGION_CPU1, 0 )	/* 1024K for 68020 code (CPU A) */
509 	ROM_LOAD32_BYTE( "d46-35.27", 0x00000, 0x40000, CRC(1575c9a7) SHA1(e3441d6018ed3315c62c5e5c4534d8712b025ae2) )
510 	ROM_LOAD32_BYTE( "d46-34.25", 0x00001, 0x40000, CRC(c72a4d2b) SHA1(6ef64de15e52007406ce3255071a1f856e0e8b49) )
511 	ROM_LOAD32_BYTE( "d46-33.23", 0x00002, 0x40000, CRC(3094bcd0) SHA1(b6779b81a3ebec440a9359868dc43fc3a631ee11) )
512 	ROM_LOAD32_BYTE( "d46-31.21", 0x00003, 0x40000, CRC(38b983a3) SHA1(c4859cecc2f3506b7090c462cecd3e4eaabe85aa) )
513 
514 	ROM_REGION( 0x140000, REGION_CPU2, 0 )	/* Sound cpu */
515 	ROM_LOAD16_BYTE( "d46-37.8up", 0x100000, 0x20000, CRC(60b51b91) SHA1(0d0b017808e0a3bdabe8ef5a726bbe16428db06b) )
516 	ROM_LOAD16_BYTE( "d46-36.7lo", 0x100001, 0x20000, CRC(8f7aa276) SHA1(b3e330e33099d3cbf4cdc43063119b041e9eea3a) )
517 
518 	ROM_REGION( 0x40000, REGION_CPU3, 0 )	/* 256K for 68000 code (CPU B) */
519 	ROM_LOAD16_BYTE( "d46-24.127", 0x00000, 0x20000, CRC(a006baa1) SHA1(e691ddab6cb79444bd6c3fc870e0dff3051d8cf9) )
520 	ROM_LOAD16_BYTE( "d46-23.112", 0x00001, 0x20000, CRC(9a69dbd0) SHA1(13eca492f1db834c599656750864e7003514f3d4) )
521 
522 	ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE )
523 	ROM_LOAD16_BYTE( "d46-05.87", 0x00000, 0x100000, CRC(150d0e4c) SHA1(9240b32900be733b8f44868ed5d64f5f1aaadb47) )	/* SCR 16x16 tiles */
524 	ROM_LOAD16_BYTE( "d46-06.88", 0x00001, 0x100000, CRC(321308be) SHA1(17e724cce39b1331650c1f08d693d057dcd43a3f) )
525 
526 	ROM_REGION( 0x800000, REGION_GFX2, ROMREGION_DISPOSE )
527 	ROM_LOAD32_BYTE( "d46-01.64", 0x000003, 0x200000, CRC(5c2ae92d) SHA1(bee2caed4729a27fa0569d952d6d12170c2aa2a8) )	/* OBJ 16x16 tiles: each rom has 1 bitplane */
528 	ROM_LOAD32_BYTE( "d46-02.65", 0x000002, 0x200000, CRC(a83ca82e) SHA1(03759be87a8d62c0044e8a44e90c47308e32d3e5) )
529 	ROM_LOAD32_BYTE( "d46-03.66", 0x000001, 0x200000, CRC(e0e9cbfd) SHA1(b7deb2c58320af9d1b4273ad2758ce927d2e279c) )
530 	ROM_LOAD32_BYTE( "d46-04.67", 0x000000, 0x200000, CRC(832769a9) SHA1(136ead19edeee90b5be91a6e2f434193dc670fd8) )
531 
532 	ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
533 	ROM_LOAD16_WORD( "d46-07.34", 0x00000, 0x80000, CRC(c3b8b093) SHA1(f34364248ca7fdaaa1a0f8f6f795f9b4bc935fb9) )	/* STY, used to create big sprites on the fly */
534 
535 	ROM_REGION16_BE( 0x1000000, REGION_SOUND1 , ROMREGION_SOUNDONLY | ROMREGION_ERASE00 )
536 	ROM_LOAD16_BYTE( "d46-10.2", 0xc00000, 0x200000, CRC(306256be) SHA1(e6e5d4a4c0b98470f2aff2e94624dd19af73ec5d) )
537 	ROM_LOAD16_BYTE( "d46-12.4", 0x000000, 0x200000, CRC(a24a53a8) SHA1(5d5fb87a94ceabda89360064d7d9b6d23c4c606b) )
538 	ROM_RELOAD     (             0x400000, 0x200000 )
539 	ROM_LOAD16_BYTE( "d46-11.5", 0x800000, 0x200000, CRC(d4ea0f56) SHA1(dc8d2ed3c11d0b6f9ebdfde805188884320235e6) )
540 ROM_END
541 
542 static READ32_HANDLER( main_cycle_r )
543 {
544 	if (activecpu_get_pc()==0x702)
545 		cpu_spinuntil_int();
546 
547 	return superchs_ram[0];
548 }
549 
READ16_HANDLER(sub_cycle_r)550 static READ16_HANDLER( sub_cycle_r )
551 {
552 	if (activecpu_get_pc()==0x454)
553 		cpu_spinuntil_int();
554 
555 	return superchs_ram[2]&0xffff;
556 }
557 
DRIVER_INIT(superchs)558 static DRIVER_INIT( superchs )
559 {
560 	/* Speedup handlers */
561 	install_mem_read32_handler(0, 0x100000, 0x100003, main_cycle_r);
562 	install_mem_read16_handler(2, 0x80000a, 0x80000b, sub_cycle_r);
563 }
564 
565 GAME( 1992, superchs, 0, superchs, superchs, superchs, ROT0, "Taito America Corporation", "Super Chase - Criminal Termination (US)" )
566