1 /***************************************************************************
2 
3 Top Speed / Full Throttle    (c) Taito 1987
4 -------------------------
5 
6 David Graves
7 
8 Sources:		Rastan driver by Jarek Burczynski
9 			MAME Taito F2 & Z drivers
10 			Raine source - special thanks to Richard Bush
11 			  and the Raine Team.
12 
13 				*****
14 
15 Top Speed / Full Throttle is the forerunner of the Taito Z system on
16 which Taito's driving games were based from 1988-91. (You can spot some
17 similarities with Continental Circus, the first of the TaitoZ games.)
18 
19 The game hardware has 5 separate layers of graphics - four 64x64 tiled
20 scrolling background planes of 8x8 tiles (two of which are used for
21 drawing the road), and a sprite plane.
22 
23 Taito got round the limitations of the tilemap generator they were using
24 (which only supports two layers) by using a pair of them.
25 
26 [Trivia: Taito employed the same trick three years later, this time with
27 the TC0100SCN in "Thunderfox".]
28 
29 Top Speed's sprites are 16x8 tiles aggregated through a RAM sprite map
30 area into 128x128 big sprites. (The TaitoZ system also used a similar
31 sprite map system, but moved the sprite map from RAM to ROM.)
32 
33 Top Speed has twin 68K CPUs which communicate via $10000 bytes of
34 shared ram. The first 68000 handles screen, palette and sprites, and
35 the road. The second 68000 handles inputs/dips, and does data processing
36 in shared ram to relieve CPUA. There is also a Z80, which takes over
37 sound duties.
38 
39 
40 Dumper's info (topspedu)
41 -------------
42 
43 Main CPUs: Dual 68000
44 Sound: YM2151, OKI M5205
45 
46 Some of the custom Taito chips look like Rastan Hardware
47 
48 Comments: Note b14-06, and b14-07, are duplicated twice on this board
49 for some type of hardware graphics reasons. (DG: that's because of
50 the twin tilemap generator chips. Can someone confirm they are
51 PC080SN's please...?)
52 
53 There is a weird chip that is probably a Microcontroller made by Sharp.
54 Part number: b14-31 - Sharp LH763J-70
55 
56 
57 TODO Lists
58 ==========
59 
60 (Want to verify 68000 clocks)
61 
62 Accel and brake bits work differently depending on cab DSW
63 Mame cannot yet support this, so accel/brake are not hooked up
64 sensibly when upright cabinet is selected.
65 
66 The 8 level brake and accel inputs for the cockpit version
67 should be mapped to a pedal for analogue pedal control.
68 (Warlock did this but his changes need remerging.)
69 
70 Minor black glitches on the road: these are all on the right
71 hand edge of the tilemap making up the "left" half: this is
72 the upper of the two road tilemaps so any gunk will be visible.
73 
74 'Tearing' effect between the two road tilemaps is visible when
75 single-stepping. A sync issue?
76 
77 *Loads* of complaints from the Taito sound system in the log.
78 
79 CPUA (on all variants) could have a spin_until_int at $63a.
80 
81 Motor CPU: appears to be identical to one in ChaseHQ.
82 
83 DIPs
84 
85 
86 Raster line color control
87 -------------------------
88 
89 Used to make the road move. Each word controls one pixel row.
90 
91 0x800000 - 0x1ff  raster color control for one road tilemap
92 0x800200 - 0x3ff  raster color control for the other
93 
94 Road tile colors are (all?) in the range 0x100-103. Top road section
95 (tilemap at 0xa08000) uses 0x100 and 0x101. Bottom section
96 (tilemap at 0xb00000) uses 0x102 and 0x103. This would allow colors
97 on left and right side of road to be different. In practice it seems
98 Taito didn't take advantage of this.
99 
100 Each tilemap is usually all one color value. Every now and then (10s
101 or so) the value alternates. This seems to be determined by whether
102 the current section of road has white lines in the middle. (0x101/3
103 gives white lines.)
104 
105 The raster line color control area has groups of four values which
106 cascade down through it so the road colors cascade down the screen.
107 
108 There are three known groups (start is arbitrary; the cycles repeat ad
109 infinitum or until a different cycle starts; values given are from bottom
110 to top of screen):
111 
112 (i) White lines in center of road
113 
114 12	%10010
115 1f	%11111
116 00	%00000
117 0d	%01101
118 
119 (ii) No lines in center of road
120 
121 08	%01000
122 0c	%01100
123 1a	%11010
124 1e	%11110
125 
126 (iii) Under bridge or in tunnel [note almost identical to (i)]
127 
128 ffe0	%00000
129 ffed	%01101
130 fff2	%10010
131 ffef	%01111
132 
133 (iv) Unknown 4th group for tunnels in later parts of the game that have
134 no white lines, analogous to (ii) ?
135 
136 
137 Correlating with screenshots suggests that these bits refer to:
138 
139 x....  road body ?
140 .x...  lines in road center and inner edge
141 ..x..  lines at road outer edge
142 ...x.  outside road ?
143 ....x  ???
144 
145 
146 Actual gfx tiles used for the road only use colors 1-5. Palette offsets:
147 
148 (0 = transparency)
149 1 = lines in road center
150 2 = road edge (inner)
151 3 = road edge (outer)
152 4 = road body
153 5 = outside road
154 
155 Each palette block contains three possible sets of 5 colors. Entries 1-5
156 (standard), 6-10 (alternate), 11-15 (tunnels).
157 
158 In tunnels only 11-15 are used. Outside tunnels there is a choice between
159 the standard colors and the alternate colors. The road body could in theory
160 take a standard color while 'outside the road' took on an alternate. But
161 in practice the game is using a very limited choice of raster control words,
162 so we don't know.
163 
164 Need to test whether sections of the road with unknown raster control words
165 (tunnels late in the game without central white lines) are correct against
166 a real machine.
167 
168 Also are the 'prelines' shortly before white road lines appear correct?
169 
170 
171 
172 CHECK screen inits at $1692
173 
174 These suggest that rowscroll areas are all 0x1000 long and there are TWO
175 for each tilemap layer.
176 
177 256 rows => 256 words => 0x200 bytes. So probably the inits are far too long.
178 
179 Maybe the second area for each layer contains colscroll ?
180 
181 ***************************************************************************/
182 
183 #include "driver.h"
184 #include "state.h"
185 #include "cpu/m68000/m68000.h"
186 #include "vidhrdw/generic.h"
187 #include "vidhrdw/taitoic.h"
188 #include "sndhrdw/taitosnd.h"
189 
190 WRITE16_HANDLER( rainbow_spritectrl_w );
191 WRITE16_HANDLER( rastan_spriteflip_w );
192 
193 VIDEO_START( topspeed );
194 VIDEO_UPDATE( topspeed );
195 
196 WRITE_HANDLER( rastan_adpcm_trigger_w );
197 WRITE_HANDLER( rastan_c000_w );
198 WRITE_HANDLER( rastan_d000_w );
199 
200 static UINT16 cpua_ctrl = 0xff;
201 static int ioc220_port = 0;
202 
203 extern data16_t *topspeed_spritemap;
204 
205 static size_t sharedram_size;
206 static data16_t *sharedram;
207 
208 extern data16_t *topspeed_raster_ctrl;
209 
210 
READ16_HANDLER(sharedram_r)211 static READ16_HANDLER( sharedram_r )
212 {
213 	return sharedram[offset];
214 }
215 
WRITE16_HANDLER(sharedram_w)216 static WRITE16_HANDLER( sharedram_w )
217 {
218 	COMBINE_DATA(&sharedram[offset]);
219 }
220 
parse_control(void)221 static void parse_control(void)	/* assumes Z80 sandwiched between 68Ks */
222 {
223 	/* bit 0 enables cpu B */
224 	/* however this fails when recovering from a save state
225 	   if cpu B is disabled !! */
226 	cpu_set_reset_line(2,(cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE);
227 
228 }
229 
WRITE16_HANDLER(cpua_ctrl_w)230 static WRITE16_HANDLER( cpua_ctrl_w )
231 {
232 	if ((data &0xff00) && ((data &0xff) == 0))
233 		data = data >> 8;	/* for Wgp */
234 	cpua_ctrl = data;
235 
236 	parse_control();
237 
238 	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data);
239 }
240 
241 
242 /***********************************************************
243                         INTERRUPTS
244 ***********************************************************/
245 
246 /* 68000 A */
247 
topspeed_interrupt6(int x)248 void topspeed_interrupt6(int x)
249 {
250 	cpu_set_irq_line(0,6,HOLD_LINE);
251 }
252 
253 /* 68000 B */
254 
topspeed_cpub_interrupt6(int x)255 void topspeed_cpub_interrupt6(int x)
256 {
257 	cpu_set_irq_line(2,6,HOLD_LINE);	/* assumes Z80 sandwiched between the 68Ks */
258 }
259 
260 
INTERRUPT_GEN(topspeed_interrupt)261 static INTERRUPT_GEN( topspeed_interrupt )
262 {
263 	/* Unsure how many int6's per frame */
264 	timer_set(TIME_IN_CYCLES(200000-500,0),0, topspeed_interrupt6);
265 	cpu_set_irq_line(0, 5, HOLD_LINE);
266 }
267 
INTERRUPT_GEN(topspeed_cpub_interrupt)268 static INTERRUPT_GEN( topspeed_cpub_interrupt )
269 {
270 	/* Unsure how many int6's per frame */
271 	timer_set(TIME_IN_CYCLES(200000-500,0),0, topspeed_cpub_interrupt6);
272 	cpu_set_irq_line(2, 5, HOLD_LINE);
273 }
274 
275 
276 
277 /**********************************************************
278                        GAME INPUTS
279 **********************************************************/
280 
READ16_HANDLER(topspeed_input_bypass_r)281 static READ16_HANDLER( topspeed_input_bypass_r )
282 {
283 	UINT8 port = TC0220IOC_port_r(0);	/* read port number */
284 	int steer = 0;
285 	int analogue_steer = input_port_5_word_r(0,0);
286 	int fake = input_port_6_word_r(0,0);
287 
288 	if (!(fake &0x10))	/* Analogue steer (the real control method) */
289 	{
290 		steer = analogue_steer;
291 
292 	}
293 	else	/* Digital steer */
294 	{
295 		if (fake & 0x8)	/* pressing down */
296 			steer = 0xff40;
297 
298 		if (fake & 0x2)	/* pressing right */
299 			steer = 0x007f;
300 
301 		if (fake & 0x1)	/* pressing left */
302 			steer = 0xff80;
303 
304 		/* To allow hiscore input we must let you return to
305 		   continuous input type while you press up */
306 
307 		if (fake & 0x4)	/* pressing up */
308 			steer = analogue_steer;
309 	}
310 
311 	switch (port)
312 	{
313 		case 0x0c:
314 			return steer &0xff;
315 
316 		case 0x0d:
317 			return steer >> 8;
318 
319 		default:
320 			return TC0220IOC_portreg_r(offset);
321 	}
322 }
323 
324 
READ16_HANDLER(topspeed_motor_r)325 static READ16_HANDLER( topspeed_motor_r )
326 {
327 	switch (offset)
328 	{
329 		case 0x0:
330 			return (rand() &0xff);	/* motor status ?? */
331 
332 		case 0x101:
333 			return 0x55;	/* motor cpu status ? */
334 
335 		default:
336 log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU #0 PC %06x: warning - read from motor cpu %03x\n",activecpu_get_pc(),offset);
337 			return 0;
338 	}
339 }
340 
WRITE16_HANDLER(topspeed_motor_w)341 static WRITE16_HANDLER( topspeed_motor_w )
342 {
343 	/* Writes $900000-25 and $900200-219 */
344 
345 log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",activecpu_get_pc(),data,offset);
346 
347 }
348 
349 
350 /*****************************************************
351                         SOUND
352 *****************************************************/
353 
354 static int banknum = -1;
355 
reset_sound_region(void)356 static void reset_sound_region(void)
357 {
358 	cpu_setbank( 10, memory_region(REGION_CPU2) + (banknum * 0x4000) + 0x10000 );
359 }
360 
WRITE_HANDLER(sound_bankswitch_w)361 static WRITE_HANDLER( sound_bankswitch_w )	/* assumes Z80 sandwiched between 68Ks */
362 {
363 	banknum = (data - 1) & 7;
364 	reset_sound_region();
365 }
366 
367 
368 /***********************************************************
369                       MEMORY STRUCTURES
370 ***********************************************************/
371 
372 
MEMORY_READ16_START(topspeed_readmem)373 static MEMORY_READ16_START( topspeed_readmem )
374 	{ 0x000000, 0x0fffff, MRA16_ROM },
375 	{ 0x400000, 0x40ffff, sharedram_r },	/* all shared ??*/
376 	{ 0x500000, 0x503fff, paletteram16_word_r },
377 	{ 0x7e0000, 0x7e0001, MRA16_NOP },
378 	{ 0x7e0002, 0x7e0003, taitosound_comm16_lsb_r },
379 	{ 0x800000, 0x8003ff, MRA16_RAM },	/* raster line color control */
380 	{ 0x800400, 0x80ffff, MRA16_RAM },	/* unknown or unused */
381 	{ 0xa00000, 0xa0ffff, PC080SN_word_0_r },	/* tilemaps */
382 	{ 0xb00000, 0xb0ffff, PC080SN_word_1_r },	/* tilemaps */
383 	{ 0xd00000, 0xd00fff, MRA16_RAM },	/* sprite ram */
384 	{ 0xe00000, 0xe0ffff, MRA16_RAM },	/* sprite map */
385 MEMORY_END
386 
387 static MEMORY_WRITE16_START( topspeed_writemem )
388 	{ 0x000000, 0x0fffff, MWA16_ROM },
389 	{ 0x400000, 0x40ffff, sharedram_w, &sharedram, &sharedram_size },
390 	{ 0x500000, 0x503fff, paletteram16_xBBBBBGGGGGRRRRR_word_w, &paletteram16 },
391 	{ 0x600002, 0x600003, cpua_ctrl_w },
392 	{ 0x7e0000, 0x7e0001, taitosound_port16_lsb_w },
393 	{ 0x7e0002, 0x7e0003, taitosound_comm16_lsb_w },
394 	{ 0x800000, 0x8003ff, MWA16_RAM, &topspeed_raster_ctrl },
395 	{ 0x800400, 0x80ffff, MWA16_RAM },
396 	{ 0xa00000, 0xa0ffff, PC080SN_word_0_w },
397 	{ 0xa20000, 0xa20003, PC080SN_yscroll_word_0_w },
398 	{ 0xa40000, 0xa40003, PC080SN_xscroll_word_0_w },
399 	{ 0xa50000, 0xa50003, PC080SN_ctrl_word_0_w },
400 	{ 0xb00000, 0xb0ffff, PC080SN_word_1_w },
401 	{ 0xb20000, 0xb20003, PC080SN_yscroll_word_1_w },
402 	{ 0xb40000, 0xb40003, PC080SN_xscroll_word_1_w },
403 	{ 0xb50000, 0xb50003, PC080SN_ctrl_word_1_w },
404 	{ 0xd00000, 0xd00fff, MWA16_RAM, &spriteram16, &spriteram_size },
405 	{ 0xe00000, 0xe0ffff, MWA16_RAM, &topspeed_spritemap },
406 MEMORY_END
407 
408 static MEMORY_READ16_START( topspeed_cpub_readmem )
409 	{ 0x000000, 0x01ffff, MRA16_ROM },
410 	{ 0x400000, 0x40ffff, sharedram_r },
411 	{ 0x880000, 0x880001, topspeed_input_bypass_r },
412 	{ 0x880002, 0x880003, TC0220IOC_halfword_port_r },
413 	{ 0x900000, 0x9003ff, topspeed_motor_r },	/* motor CPU */
414 MEMORY_END
415 
416 static MEMORY_WRITE16_START( topspeed_cpub_writemem )
417 	{ 0x000000, 0x01ffff, MWA16_ROM },
418 	{ 0x400000, 0X40ffff, sharedram_w, &sharedram },
419 	{ 0x880000, 0x880001, TC0220IOC_halfword_portreg_w },
420 	{ 0x880002, 0x880003, TC0220IOC_halfword_port_w },
421 	{ 0x900000, 0x9003ff, topspeed_motor_w },	/* motor CPU */
422 MEMORY_END
423 
424 
425 /***************************************************************************/
426 
427 static MEMORY_READ_START( z80_readmem )
428 	{ 0x0000, 0x3fff, MRA_ROM },
429 	{ 0x4000, 0x7fff, MRA_BANK10 },
430 	{ 0x8000, 0x8fff, MRA_RAM },
431 	{ 0x9001, 0x9001, YM2151_status_port_0_r },
432 	{ 0x9002, 0x9100, MRA_RAM },
433 	{ 0xa001, 0xa001, taitosound_slave_comm_r },
434 MEMORY_END
435 
436 static MEMORY_WRITE_START( z80_writemem )
437 	{ 0x0000, 0x7fff, MWA_ROM },
438 	{ 0x8000, 0x8fff, MWA_RAM },
439 	{ 0x9000, 0x9000, YM2151_register_port_0_w },
440 	{ 0x9001, 0x9001, YM2151_data_port_0_w },
441 	{ 0xa000, 0xa000, taitosound_slave_port_w },
442 	{ 0xa001, 0xa001, taitosound_slave_comm_w },
443 	{ 0xb000, 0xb000, rastan_adpcm_trigger_w },
444 	{ 0xc000, 0xc000, rastan_c000_w },
445 	{ 0xd000, 0xd000, rastan_d000_w },
446 MEMORY_END
447 
448 
449 /***********************************************************
450                     INPUT PORTS, DIPs
451 ***********************************************************/
452 
453 #define TAITO_COINAGE_WORLD_8 \
454 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \
455 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) \
456 	PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
457 	PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
458 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
459 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) \
460 	PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) ) \
461 	PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) ) \
462 	PORT_DIPSETTING(    0x40, DEF_STR( 1C_4C ) ) \
463 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
464 
465 #define TAITO_COINAGE_JAPAN_8 \
466 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) \
467 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) \
468 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
469 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) \
470 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) ) \
471 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) \
472 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) \
473 	PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) ) \
474 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) ) \
475 	PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
476 
477 #define TAITO_COINAGE_US_8 \
478 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) \
479 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) ) \
480 	PORT_DIPSETTING(    0x10, DEF_STR( 3C_1C ) ) \
481 	PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) ) \
482 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) ) \
483 	PORT_DIPNAME( 0xc0, 0xc0, "Price to Continue" ) \
484 	PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) ) \
485 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) ) \
486 	PORT_DIPSETTING(    0x80, DEF_STR( 1C_1C ) ) \
487 	PORT_DIPSETTING(    0xc0, "Same as Start" )
488 
489 #define TAITO_DIFFICULTY_8 \
490 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) \
491 	PORT_DIPSETTING(    0x02, "Easy" ) \
492 	PORT_DIPSETTING(    0x03, "Medium" ) \
493 	PORT_DIPSETTING(    0x01, "Hard" ) \
494 	PORT_DIPSETTING(    0x00, "Hardest" )
495 
496 INPUT_PORTS_START( topspeed )
497 	PORT_START /* DSW A */
498 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )
499 	PORT_DIPSETTING(    0x03, "Deluxe Motorized Cockpit" )
500 	PORT_DIPSETTING(    0x02, "Upright (?)" )
501 	PORT_DIPSETTING(    0x01, "Upright (alt?)" )
502 	PORT_DIPSETTING(    0x00, "Standard Cockpit" )
503 	PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
504 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
505 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
506 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
507 	TAITO_COINAGE_WORLD_8
508 
509 	PORT_START /* DSW B */
510 	TAITO_DIFFICULTY_8
511 	PORT_DIPNAME( 0x0c, 0x0c, "Initial Time" )
512 	PORT_DIPSETTING(    0x00, "40 seconds" )
513 	PORT_DIPSETTING(    0x04, "50 seconds" )
514 	PORT_DIPSETTING(    0x0c, "60 seconds" )
515 	PORT_DIPSETTING(    0x08, "70 seconds" )
516 	PORT_DIPNAME( 0x30, 0x30, "Nitros" )
517 	PORT_DIPSETTING(    0x20, "2" )
518 	PORT_DIPSETTING(    0x30, "3" )
519 	PORT_DIPSETTING(    0x10, "4" )
520 	PORT_DIPSETTING(    0x00, "5" )
521 	PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
522 	PORT_DIPSETTING(    0x40, DEF_STR( No ) )
523 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
524 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
525 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
526 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
527 
528 	PORT_START      /* IN0 */
529 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
530 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
531 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
532 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
533 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 )
534 	/* Next bit is brake key (active low) for non-cockpit */
535 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1 )	/* 3 for brake [7 levels] */
536 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON8 | IPF_PLAYER1 )
537 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )	/* main brake key */
538 
539 	PORT_START      /* IN1 */
540 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_BUTTON3 | IPF_PLAYER1 )	/* nitro */
541 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
542 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
543 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
544 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER1 )	/* gear shift lo/hi */
545 	/* Next bit is accel key (active low/high, depends on cab DSW) for non-cockpit */
546 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER1 )	/* 3 for accel [7 levels] */
547 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 | IPF_PLAYER1 )
548 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )	/* main accel key */
549 
550 	PORT_START      /* IN2, unused */
551 
552 	/* Note that sensitivity is chosen to suit keyboard control (for
553 	   sound selection in test mode and hi score name entry). With
554 	   an analogue wheel, the user will need to adjust this. */
555 
556 	PORT_START	/* continuous steer */
557 	PORT_ANALOG( 0xffff, 0x00, IPT_AD_STICK_X | IPF_PLAYER1, 10, 2, 0xff7f, 0x80)
558 
559 	PORT_START      /* fake, allowing digital steer */
560 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
561 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
562 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
563 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
564 	PORT_DIPNAME( 0x10, 0x10, "Steering type" )
565 	PORT_DIPSETTING(    0x10, "Digital" )
566 	PORT_DIPSETTING(    0x00, "Analogue" )
567 INPUT_PORTS_END
568 
569 INPUT_PORTS_START( topspedu )
570 	PORT_START /* DSW A */
571 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )
572 	PORT_DIPSETTING(    0x03, "Deluxe Motorized Cockpit" )
573 	PORT_DIPSETTING(    0x02, "Upright (?)" )
574 	PORT_DIPSETTING(    0x01, "Upright (alt?)" )
575 	PORT_DIPSETTING(    0x00, "Standard Cockpit" )
576 	PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
577 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
578 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
579 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
580 	TAITO_COINAGE_WORLD_8
581 
582 	PORT_START /* DSW B */
583 	TAITO_DIFFICULTY_8
584 	PORT_DIPNAME( 0x0c, 0x0c, "Initial Time" )
585 	PORT_DIPSETTING(    0x00, "40 seconds" )
586 	PORT_DIPSETTING(    0x04, "50 seconds" )
587 	PORT_DIPSETTING(    0x0c, "60 seconds" )
588 	PORT_DIPSETTING(    0x08, "70 seconds" )
589 	PORT_DIPNAME( 0x30, 0x30, "Nitros" )
590 	PORT_DIPSETTING(    0x20, "2" )
591 	PORT_DIPSETTING(    0x30, "3" )
592 	PORT_DIPSETTING(    0x10, "4" )
593 	PORT_DIPSETTING(    0x00, "5" )
594 	PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
595 	PORT_DIPSETTING(    0x40, DEF_STR( No ) )
596 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
597 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
598 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
599 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
600 
601 	PORT_START      /* IN0 */
602 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
603 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
604 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
605 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
606 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 )
607 	/* Next bit is brake key (active low) for non-cockpit */
608 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1 )	/* 3 for brake [7 levels] */
609 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON8 | IPF_PLAYER1 )
610 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )	/* main brake key */
611 
612 	PORT_START      /* IN1 */
613 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_BUTTON3 | IPF_PLAYER1 )	/* nitro */
614 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
615 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
616 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
617 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER1 )	/* gear shift lo/hi */
618 	/* Next bit is accel key (active low/high, depends on cab DSW) for non-cockpit */
619 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER1 )	/* 3 for accel [7 levels] */
620 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 | IPF_PLAYER1 )
621 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )	/* main accel key */
622 
623 	PORT_START      /* IN2, unused */
624 
625 	/* Note that sensitivity is chosen to suit keyboard control (for
626 	   sound selection in test mode and hi score name entry). With
627 	   an analogue wheel, the user will need to adjust this. */
628 
629 	PORT_START	/* continuous steer */
630 	PORT_ANALOG( 0xffff, 0x00, IPT_AD_STICK_X | IPF_PLAYER1, 10, 2, 0xff7f, 0x80)
631 
632 	PORT_START      /* fake, allowing digital steer */
633 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
634 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
635 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
636 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
637 	PORT_DIPNAME( 0x10, 0x10, "Steering type" )
638 	PORT_DIPSETTING(    0x10, "Digital" )
639 	PORT_DIPSETTING(    0x00, "Analogue" )
640 INPUT_PORTS_END
641 
642 INPUT_PORTS_START( fullthrl )
643 	PORT_START /* DSW A */
644 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )
645 	PORT_DIPSETTING(    0x03, "Deluxe Motorized Cockpit" )
646 	PORT_DIPSETTING(    0x02, "Upright (?)" )
647 	PORT_DIPSETTING(    0x01, "Upright (alt?)" )
648 	PORT_DIPSETTING(    0x00, "Standard Cockpit" )
649 	PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
650 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
651 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
652 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
653 	TAITO_COINAGE_WORLD_8
654 
655 	PORT_START /* DSW B */
656 	TAITO_DIFFICULTY_8
657 	PORT_DIPNAME( 0x0c, 0x0c, "Initial Time" )
658 	PORT_DIPSETTING(    0x00, "40 seconds" )
659 	PORT_DIPSETTING(    0x04, "50 seconds" )
660 	PORT_DIPSETTING(    0x0c, "60 seconds" )
661 	PORT_DIPSETTING(    0x08, "70 seconds" )
662 	PORT_DIPNAME( 0x30, 0x30, "Nitros" )
663 	PORT_DIPSETTING(    0x20, "2" )
664 	PORT_DIPSETTING(    0x30, "3" )
665 	PORT_DIPSETTING(    0x10, "4" )
666 	PORT_DIPSETTING(    0x00, "5" )
667 	PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
668 	PORT_DIPSETTING(    0x40, DEF_STR( No ) )
669 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
670 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
671 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
672 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
673 
674 	PORT_START      /* IN0 */
675 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
676 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
677 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
678 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
679 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 )
680 	/* Next bit is brake key (active low) for non-cockpit */
681 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 | IPF_PLAYER1 )	/* 3 for brake [7 levels] */
682 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON8 | IPF_PLAYER1 )
683 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )	/* main brake key */
684 
685 	PORT_START      /* IN1 */
686 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_BUTTON3 | IPF_PLAYER1 )	/* nitro */
687 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
688 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
689 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
690 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 | IPF_PLAYER1 )	/* gear shift lo/hi */
691 	/* Next bit is accel key (active low/high, depends on cab DSW) for non-cockpit */
692 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 | IPF_PLAYER1 )	/* 3 for accel [7 levels] */
693 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 | IPF_PLAYER1 )
694 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )	/* main accel key */
695 
696 	PORT_START      /* IN2, unused */
697 
698 	/* Note that sensitivity is chosen to suit keyboard control (for
699 	   sound selection in test mode and hi score name entry). With
700 	   an analogue wheel, the user will need to adjust this. */
701 
702 	PORT_START	/* continuous steer */
703 	PORT_ANALOG( 0xffff, 0x00, IPT_AD_STICK_X | IPF_PLAYER1, 10, 2, 0xff7f, 0x80)
704 
705 	PORT_START      /* fake, allowing digital steer */
706 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
707 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
708 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
709 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
710 	PORT_DIPNAME( 0x10, 0x10, "Steering type" )
711 	PORT_DIPSETTING(    0x10, "Digital" )
712 	PORT_DIPSETTING(    0x00, "Analogue" )
713 INPUT_PORTS_END
714 
715 
716 /**************************************************************
717                         GFX DECODING
718 **************************************************************/
719 
720 static struct GfxLayout tile16x8_layout =
721 {
722 	16,8,	/* 16*8 sprites */
723 	RGN_FRAC(1,1),
724 	4,	/* 4 bits per pixel */
725 	{ 0, 8, 16, 24 },
726 	{ 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7 },
727 	{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 },
728 	64*8	/* every sprite takes 64 consecutive bytes */
729 };
730 
731 static struct GfxLayout charlayout =
732 {
733 	8,8,	/* 8*8 characters */
734 	RGN_FRAC(1,1),
735 	4,	/* 4 bits per pixel */
736 	{ 0, 1, 2, 3 },
737 	{ 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4 },
738 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
739 	32*8	/* every sprite takes 32 consecutive bytes */
740 };
741 
742 static struct GfxDecodeInfo topspeed_gfxdecodeinfo[] =
743 {
744 	{ REGION_GFX2, 0x0, &tile16x8_layout,  0, 256 },	/* sprite parts */
745 	{ REGION_GFX1, 0x0, &charlayout,  0, 256 },		/* sprites & playfield */
746 	/* Road Lines gfxdecodable ?*/
747 	{ -1 } /* end of array */
748 };
749 
750 
751 /**************************************************************
752                         YM2151 (SOUND)
753 **************************************************************/
754 
755 /* handler called by the YM2151 emulator when the internal timers cause an IRQ */
756 
irq_handler(int irq)757 static void irq_handler(int irq)	/* assumes Z80 sandwiched between 68Ks */
758 {
759 	cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
760 }
761 
762 static struct YM2151interface ym2151_interface =
763 {
764 	1,			/* 1 chip */
765 	4000000,	/* 4 MHz ? */
766 	{ YM3012_VOL(50,MIXER_PAN_CENTER,50,MIXER_PAN_CENTER) },
767 	{ irq_handler },
768 	{ sound_bankswitch_w }
769 };
770 
771 static struct ADPCMinterface adpcm_interface =
772 {
773 	1,			/* 1 chip */
774 	8000,       /* 8000Hz playback */
775 	REGION_SOUND1,	/* memory region */
776 	{ 60 }
777 };
778 
779 
780 /***********************************************************
781                      MACHINE DRIVERS
782 ***********************************************************/
783 
784 static MACHINE_DRIVER_START( topspeed )
785 
786 	/* basic machine hardware */
787 	MDRV_CPU_ADD(M68000, 12000000)	/* 12 MHz ??? */
MDRV_CPU_MEMORY(topspeed_readmem,topspeed_writemem)788 	MDRV_CPU_MEMORY(topspeed_readmem,topspeed_writemem)
789 	MDRV_CPU_VBLANK_INT(topspeed_interrupt,1)
790 
791 	MDRV_CPU_ADD(Z80,16000000/4)
792 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* 4 MHz ??? */
793 	MDRV_CPU_MEMORY(z80_readmem,z80_writemem)
794 
795 	MDRV_CPU_ADD(M68000, 12000000)	/* 12 MHz ??? */
796 	MDRV_CPU_MEMORY(topspeed_cpub_readmem,topspeed_cpub_writemem)
797 	MDRV_CPU_VBLANK_INT(topspeed_cpub_interrupt,1)
798 
799 	MDRV_FRAMES_PER_SECOND(60)
800 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
801 
802 	/* video hardware */
803 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
804 	MDRV_SCREEN_SIZE(40*8, 32*8)
805 	MDRV_VISIBLE_AREA(0*8, 40*8-1, 2*8, 32*8-1)
806 	MDRV_GFXDECODE(topspeed_gfxdecodeinfo)
807 	MDRV_PALETTE_LENGTH(8192)
808 
809 	MDRV_VIDEO_START(topspeed)
810 	MDRV_VIDEO_UPDATE(topspeed)
811 
812 	/* sound hardware */
813 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
814 	MDRV_SOUND_ADD(ADPCM, adpcm_interface)
815 MACHINE_DRIVER_END
816 
817 
818 
819 /***************************************************************************
820                                 DRIVERS
821 
822 Note: driver does NOT make use of the zoom sprite tables rom.
823 ***************************************************************************/
824 
825 ROM_START( topspeed )
826 	ROM_REGION( 0x100000, REGION_CPU1, 0 )	/* 128K for 68000 code (CPU A) */
827 	ROM_LOAD16_BYTE( "b14-67-1.11", 0x00000, 0x10000, CRC(23f17616) SHA1(653ab6537f2e5898a77060c82b776852ab1f2b51) )
828 	ROM_LOAD16_BYTE( "b14-68-1.9",  0x00001, 0x10000, CRC(835659d9) SHA1(e99967f795c3c6e14bad7a66315640ca5db43c72) )
829 	ROM_LOAD16_BYTE( "b14-54.24",   0x80000, 0x20000, CRC(172924d5) SHA1(4a963f2e816f4b1c5acc6d38e99a68d3baeee8c6) )	/* 4 data roms */
830 	ROM_LOAD16_BYTE( "b14-52.26",   0x80001, 0x20000, CRC(e1b5b2a1) SHA1(8e2b992dcd5dc2317594c0187a22767aa626edee) )
831 	ROM_LOAD16_BYTE( "b14-55.23",   0xc0000, 0x20000, CRC(a1f15499) SHA1(72f99108713773782fc72aae5a3f6e9e2a1e347c) )
832 	ROM_LOAD16_BYTE( "b14-53.25",   0xc0001, 0x20000, CRC(04a04f5f) SHA1(09c15c33967bb141cc504b70d01c154bedb7fa33) )
833 
834 	ROM_REGION( 0x20000, REGION_CPU3, 0 )	/* 128K for 68000 code (CPU B) */
835 	ROM_LOAD16_BYTE( "b14-69.80",   0x00000, 0x10000, CRC(d652e300) SHA1(b559bdb564d96da4c656dc7b2c88dae84c4861ae) )
836 	ROM_LOAD16_BYTE( "b14-70.81",   0x00001, 0x10000, CRC(b720592b) SHA1(13298b498a198dcc1a56e533d106545dd77e1bbc) )
837 
838 	ROM_REGION( 0x1c000, REGION_CPU2, 0 )	/* Z80 sound cpu */
839 	ROM_LOAD( "b14-25.67", 0x00000, 0x04000, CRC(9eab28ef) SHA1(9a90f2c1881f4664d6d6241f3bc57faeaf150ffc) )
840 	ROM_CONTINUE(          0x10000, 0x0c000 )	/* banked stuff */
841 
842 	ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
843 	ROM_LOAD16_BYTE( "b14-07.54",   0x00000, 0x20000, CRC(c6025fff) SHA1(439ed85b0160bfd6c06fd42990124a292b2e3c14) )	/* SCR tiles */
844 	ROM_LOAD16_BYTE( "b14-06.52",   0x00001, 0x20000, CRC(b4e2536e) SHA1(c1960ee25b37b1444ec99082521c4858edcf3484) )
845 
846 	ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
847 	ROMX_LOAD( "b14-48.16", 0x000003, 0x20000, CRC(30c7f265) SHA1(3e52e2aabf2c456d0b57d9414f99bd942bafc887) , ROM_SKIP(7) )	/* OBJ, bitplane 3 */
848 	ROMX_LOAD( "b14-49.12", 0x100003, 0x20000, CRC(32ba4265) SHA1(f468243d923726b7eff78d9bc55a3a092f211a24) , ROM_SKIP(7) )
849 	ROMX_LOAD( "b14-50.8",  0x000007, 0x20000, CRC(ec1ef311) SHA1(4cfa06aec9535f2044b763b071f73d23ca8ba354) , ROM_SKIP(7) )
850 	ROMX_LOAD( "b14-51.4",  0x100007, 0x20000, CRC(35041c5f) SHA1(71602267736396516366a8abf535db82acaa1c23) , ROM_SKIP(7) )
851 
852 	ROMX_LOAD( "b14-44.15", 0x000002, 0x20000, CRC(9f6c030e) SHA1(bb278fdcc29530685aa2e76da0712195f6ab0f5f) , ROM_SKIP(7) )	/* OBJ, bitplane 2 */
853 	ROMX_LOAD( "b14-45.11", 0x100002, 0x20000, CRC(63e4ce03) SHA1(92e3f45754676dd15691e48c0d37490c1a3ec328) , ROM_SKIP(7) )
854 	ROMX_LOAD( "b14-46.7",  0x000006, 0x20000, CRC(d489adf2) SHA1(9f77916594d5ed05b79d7e8d8f534eb39f65edae) , ROM_SKIP(7) )
855 	ROMX_LOAD( "b14-47.3",  0x100006, 0x20000, CRC(b3a1f75b) SHA1(050dd3313b5392d131c5a62c544260b83af0b8ab) , ROM_SKIP(7) )
856 
857 	ROMX_LOAD( "b14-40.14", 0x000001, 0x20000, CRC(fa2a3cb3) SHA1(1e102ae6e916fda046a154b89056a18b724d51a3) , ROM_SKIP(7) )	/* OBJ, bitplane 1 */
858 	ROMX_LOAD( "b14-41.10", 0x100001, 0x20000, CRC(09455a14) SHA1(dc703e1f9c4f16e330796e9945799e1038ce503b) , ROM_SKIP(7) )
859 	ROMX_LOAD( "b14-42.6",  0x000005, 0x20000, CRC(ab51f53c) SHA1(0ed9a2e607b0bd2b43b47e3ed29b00a8d8a09f25) , ROM_SKIP(7) )
860 	ROMX_LOAD( "b14-43.2",  0x100005, 0x20000, CRC(1e6d2b38) SHA1(453cd818a6cd8b238c72cc880c811227609767b8) , ROM_SKIP(7) )
861 
862 	ROMX_LOAD( "b14-36.13", 0x000000, 0x20000, CRC(20a7c1b8) SHA1(053c6b733a5c33b9259dfc754ce30a880905bb11) , ROM_SKIP(7) )	/* OBJ, bitplane 0 */
863 	ROMX_LOAD( "b14-37.9",  0x100000, 0x20000, CRC(801b703b) SHA1(dfbe276bd484815a7e69589eb56d54bc6e12e301) , ROM_SKIP(7) )
864 	ROMX_LOAD( "b14-38.5",  0x000004, 0x20000, CRC(de0c213e) SHA1(1313b2051e906d22edb55f4d45d3a424b31ca2a2) , ROM_SKIP(7) )
865 	ROMX_LOAD( "b14-39.1",  0x100004, 0x20000, CRC(798c28c5) SHA1(d2a8b9f84b3760f3800c5760ecee7ddcbafa6d6e) , ROM_SKIP(7) )
866 
867 	ROM_REGION( 0x10000, REGION_USER1, 0 )
868 	ROM_LOAD( "b14-30.88", 0x00000, 0x10000, CRC(dccb0c7f) SHA1(42f0af72f559133b74912a4478e1323062be4b77) )	/* zoom tables for zoom sprite h/w */
869 
870 /* One dump has this 0x10000 long, but just contains the same stuff repeated 8 times */ /**/
871 	ROM_REGION( 0x2000, REGION_USER2, 0 )
872 	ROM_LOAD( "b14-31.90",  0x0000,  0x2000,  CRC(5c6b013d) SHA1(6d02d4560076213b6fb6fe856143bb533090603e) )	/* microcontroller */
873 
874 	ROM_REGION( 0x20000, REGION_SOUND1, 0 )	/* ADPCM samples */
875 	ROM_LOAD( "b14-28.103",  0x00000, 0x10000, CRC(df11d0ae) SHA1(259e1e6cc7ab100bfdb60e3d7a6bb46acb6fe2ea) )
876 	ROM_LOAD( "b14-29.109",  0x10000, 0x10000, CRC(7ad983e7) SHA1(a3515caf93d6dab86de06ee52d6a13a456507dbe) )
877 ROM_END
878 
879 ROM_START( topspedu )
880 	ROM_REGION( 0x100000, REGION_CPU1, 0 )	/* 128K for 68000 code (CPU A) */
881 	ROM_LOAD16_BYTE     ( "b14-23", 0x00000, 0x10000, CRC(dd0307fd) SHA1(63218a707c78b3c785d1741dabdc511a76f12af1) )
882 	ROM_LOAD16_BYTE     ( "b14-24", 0x00001, 0x10000, CRC(acdf08d4) SHA1(506d48d27fc26684a3f884919665cf65a1b3062f) )
883 	ROM_LOAD16_WORD_SWAP( "b14-05", 0x80000, 0x80000, CRC(6557e9d8) SHA1(ff528b27fcaef5c181f5f3a56d6a41b935cf07e1) )	/* data rom */
884 
885 	ROM_REGION( 0x20000, REGION_CPU3, 0 )	/* 128K for 68000 code (CPU B) */
886 	ROM_LOAD16_BYTE( "b14-26", 0x00000, 0x10000, CRC(659dc872) SHA1(0a168122fe6324510c830e21a56eace9c8a2c189) )
887 	ROM_LOAD16_BYTE( "b14-56", 0x00001, 0x10000, CRC(d165cf1b) SHA1(bfbb8699c5671d3841d4057678ef4085c1927684) )
888 
889 	ROM_REGION( 0x1c000, REGION_CPU2, 0 )	/* Z80 sound cpu */
890 	ROM_LOAD( "b14-25.67", 0x00000, 0x04000, CRC(9eab28ef) SHA1(9a90f2c1881f4664d6d6241f3bc57faeaf150ffc) )
891 	ROM_CONTINUE(          0x10000, 0x0c000 )	/* banked stuff */
892 
893 	ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
894 	ROM_LOAD16_BYTE( "b14-07.54", 0x00000, 0x20000, CRC(c6025fff) SHA1(439ed85b0160bfd6c06fd42990124a292b2e3c14) )	/* SCR tiles */
895 	ROM_LOAD16_BYTE( "b14-06.52", 0x00001, 0x20000, CRC(b4e2536e) SHA1(c1960ee25b37b1444ec99082521c4858edcf3484) )
896 
897 	ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
898 	ROM_LOAD32_BYTE( "b14-01", 0x00000, 0x80000, CRC(84a56f37) SHA1(926bcae5bd75a4172de2a2078718b2940c5c1966) )	/* OBJ: each rom has 1 bitplane, forming 16x8 tiles */
899 	ROM_LOAD32_BYTE( "b14-02", 0x00001, 0x80000, CRC(6889186b) SHA1(3c38e281e8bf416a401c76ebb2d8ca95d09974b6) )
900 	ROM_LOAD32_BYTE( "b14-03", 0x00002, 0x80000, CRC(d1ed9e71) SHA1(26a6b2ca5bf6d70ad87f5c40c8e94ec542a2ec04) )
901 	ROM_LOAD32_BYTE( "b14-04", 0x00003, 0x80000, CRC(b63f0519) SHA1(e9a6b49effba0cae1ae3536a8584d3efa34ca8c3) )
902 
903 	ROM_REGION( 0x10000, REGION_USER1, 0 )
904 	ROM_LOAD( "b14-30.88", 0x00000, 0x10000, CRC(dccb0c7f) SHA1(42f0af72f559133b74912a4478e1323062be4b77) )	/* zoom tables for zoom sprite h/w */
905 
906 	ROM_REGION( 0x2000, REGION_USER2, 0 )
907 	ROM_LOAD( "b14-31.90", 0x0000,  0x2000,  CRC(5c6b013d) SHA1(6d02d4560076213b6fb6fe856143bb533090603e) )	/* microcontroller */
908 
909 	ROM_REGION( 0x20000, REGION_SOUND1, 0 )	/* ADPCM samples */
910 	ROM_LOAD( "b14-28.103", 0x00000, 0x10000, CRC(df11d0ae) SHA1(259e1e6cc7ab100bfdb60e3d7a6bb46acb6fe2ea) )
911 	ROM_LOAD( "b14-29.109", 0x10000, 0x10000, CRC(7ad983e7) SHA1(a3515caf93d6dab86de06ee52d6a13a456507dbe) )
912 ROM_END
913 
914 ROM_START( fullthrl )
915 	ROM_REGION( 0x100000, REGION_CPU1, 0 )	/* 128K for 68000 code (CPU A) */
916 	ROM_LOAD16_BYTE     ( "b14-67", 0x00000, 0x10000, CRC(284c943f) SHA1(e4720b138052d9cbf1290aeca8f9dd7fe2cffcc5) )	/* Later rev?*/
917 	ROM_LOAD16_BYTE     ( "b14-68", 0x00001, 0x10000, CRC(54cf6196) SHA1(0e86a7bf7d43526222160f4cd09f8d29fa9abdc4) )
918 	ROM_LOAD16_WORD_SWAP( "b14-05", 0x80000, 0x80000, CRC(6557e9d8) SHA1(ff528b27fcaef5c181f5f3a56d6a41b935cf07e1) )	/* data rom */
919 
920 	ROM_REGION( 0x20000, REGION_CPU3, 0 )	/* 128K for 68000 code (CPU B) */
921 	ROM_LOAD16_BYTE( "b14-69.80", 0x00000, 0x10000, CRC(d652e300) SHA1(b559bdb564d96da4c656dc7b2c88dae84c4861ae) )
922 	ROM_LOAD16_BYTE( "b14-71",    0x00001, 0x10000, CRC(f7081727) SHA1(f0ab6ce9975dd7a1fadd439fd3dfd2f1bf88796c) )
923 
924 	ROM_REGION( 0x1c000, REGION_CPU2, 0 )	/* Z80 sound cpu */
925 	ROM_LOAD( "b14-25.67", 0x00000, 0x04000, CRC(9eab28ef) SHA1(9a90f2c1881f4664d6d6241f3bc57faeaf150ffc) )
926 	ROM_CONTINUE(          0x10000, 0x0c000 )	/* banked stuff */
927 
928 	ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
929 	ROM_LOAD16_BYTE( "b14-07.54", 0x00000, 0x20000, CRC(c6025fff) SHA1(439ed85b0160bfd6c06fd42990124a292b2e3c14) )	/* SCR tiles */
930 	ROM_LOAD16_BYTE( "b14-06.52", 0x00001, 0x20000, CRC(b4e2536e) SHA1(c1960ee25b37b1444ec99082521c4858edcf3484) )
931 
932 	ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
933 	ROM_LOAD32_BYTE( "b14-01", 0x00000, 0x80000, CRC(84a56f37) SHA1(926bcae5bd75a4172de2a2078718b2940c5c1966) )	/* OBJ: each rom has 1 bitplane, forming 16x8 tiles */
934 	ROM_LOAD32_BYTE( "b14-02", 0x00001, 0x80000, CRC(6889186b) SHA1(3c38e281e8bf416a401c76ebb2d8ca95d09974b6) )
935 	ROM_LOAD32_BYTE( "b14-03", 0x00002, 0x80000, CRC(d1ed9e71) SHA1(26a6b2ca5bf6d70ad87f5c40c8e94ec542a2ec04) )
936 	ROM_LOAD32_BYTE( "b14-04", 0x00003, 0x80000, CRC(b63f0519) SHA1(e9a6b49effba0cae1ae3536a8584d3efa34ca8c3) )
937 
938 	ROM_REGION( 0x10000, REGION_USER1, 0 )
939 	ROM_LOAD( "b14-30.88", 0x00000, 0x10000, CRC(dccb0c7f) SHA1(42f0af72f559133b74912a4478e1323062be4b77) )	/* zoom tables for zoom sprite h/w */
940 
941 	ROM_REGION( 0x2000, REGION_USER2, 0 )
942 	ROM_LOAD( "b14-31.90", 0x0000,  0x2000,  CRC(5c6b013d) SHA1(6d02d4560076213b6fb6fe856143bb533090603e) )	/* microcontroller */
943 
944 	ROM_REGION( 0x20000, REGION_SOUND1, 0 )	/* ADPCM samples */
945 	ROM_LOAD( "b14-28.103", 0x00000, 0x10000, CRC(df11d0ae) SHA1(259e1e6cc7ab100bfdb60e3d7a6bb46acb6fe2ea) )
946 	ROM_LOAD( "b14-29.109", 0x10000, 0x10000, CRC(7ad983e7) SHA1(a3515caf93d6dab86de06ee52d6a13a456507dbe) )
947 ROM_END
948 
949 
950 DRIVER_INIT( topspeed )
951 {
952 /*	taitosnd_setz80_soundcpu( 2 );*/
953 
954 	cpua_ctrl = 0xff;
955 	state_save_register_UINT16("main1", 0, "control", &cpua_ctrl, 1);
956 	state_save_register_func_postload(parse_control);
957 
958 	state_save_register_int   ("main2", 0, "register", &ioc220_port);
959 
960 	state_save_register_int   ("sound1", 0, "sound region", &banknum);
961 	state_save_register_func_postload(reset_sound_region);
962 }
963 
964 
965 GAME( 1987, topspeed, 0,        topspeed, topspeed, topspeed, ROT0, "Taito Corporation Japan", "Top Speed (World)" )
966 GAME( 1987, topspedu, topspeed, topspeed, topspedu, topspeed, ROT0, "Taito America Corporation (Romstar license)", "Top Speed (US)" )
967 GAME( 1987, fullthrl, topspeed, topspeed, fullthrl, topspeed, ROT0, "Taito Corporation", "Full Throttle (Japan)" )
968