1 // FB Alpha Traverse USA driver module
2 // Based on MAME driver by Lee Taylor (with thanks to John Clegg and Tomasz Slanina)
3 
4 #include "tiles_generic.h"
5 #include "z80_intf.h"
6 #include "irem_sound.h"
7 #include "bitswap.h"
8 
9 static UINT8 *AllMem;
10 static UINT8 *MemEnd;
11 static UINT8 *AllRam;
12 static UINT8 *RamEnd;
13 static UINT8 *DrvZ80ROM;
14 static UINT8 *DrvSndROM;
15 static UINT8 *DrvGfxROM0;
16 static UINT8 *DrvGfxROM1;
17 static UINT8 *DrvTransTable[2];
18 static UINT8 *DrvColPROM;
19 static UINT8 *DrvVidRAM;
20 static UINT8 *DrvZ80RAM;
21 static UINT8 *DrvSprRAM;
22 
23 static UINT32 *DrvPalette;
24 static UINT8 DrvRecalc;
25 
26 static UINT8 flipscreen;
27 static UINT16 scrollx;
28 
29 static UINT32 YFlipping = 0; // shtrider has a weird screen layout
30 
31 static UINT8 DrvJoy1[8];
32 static UINT8 DrvJoy2[8];
33 static UINT8 DrvJoy3[8];
34 static UINT8 DrvInputs[5];
35 static UINT8 DrvReset;
36 
37 static struct BurnInputInfo TravrusaInputList[] = {
38 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy1 + 3,	"p1 coin"	},
39 	{"P1 Start",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 start"	},
40 	{"P1 Left",			BIT_DIGITAL,	DrvJoy2 + 1,	"p1 left"	},
41 	{"P1 Right",		BIT_DIGITAL,	DrvJoy2 + 0,	"p1 right"	},
42 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy2 + 5,	"p1 fire 1"	},
43 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy2 + 7,	"p1 fire 2"	},
44 
45 	{"P2 Coin",			BIT_DIGITAL,	DrvJoy3 + 4,	"p2 coin"	},
46 	{"P2 Start",		BIT_DIGITAL,	DrvJoy1 + 1,	"p2 start"	},
47 	{"P2 Left",			BIT_DIGITAL,	DrvJoy3 + 1,	"p2 left"	},
48 	{"P2 Right",		BIT_DIGITAL,	DrvJoy3 + 0,	"p2 right"	},
49 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy3 + 5,	"p2 fire 1"	},
50 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy3 + 7,	"p2 fire 2"	},
51 
52 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
53 	{"Dip A",			BIT_DIPSWITCH,	DrvInputs + 3,	"dip"		},
54 	{"Dip B",			BIT_DIPSWITCH,	DrvInputs + 4,	"dip"		},
55 };
56 
57 STDINPUTINFO(Travrusa)
58 
59 static struct BurnInputInfo ShtriderInputList[] = {
60 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy1 + 3,	"p1 coin"	},
61 	{"P1 Start",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 start"	},
62 	{"P1 Left",			BIT_DIGITAL,	DrvJoy2 + 1,	"p1 left"	},
63 	{"P1 Right",		BIT_DIGITAL,	DrvJoy2 + 0,	"p1 right"	},
64 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy2 + 5,	"p1 fire 1"	},
65 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy2 + 7,	"p1 fire 2"	},
66 
67 	{"P2 Coin",			BIT_DIGITAL,	DrvJoy1 + 7,	"p2 coin"	},
68 	{"P2 Start",		BIT_DIGITAL,	DrvJoy1 + 1,	"p2 start"	},
69 	{"P2 Left",			BIT_DIGITAL,	DrvJoy3 + 2,	"p2 left"	},
70 	{"P2 Right",		BIT_DIGITAL,	DrvJoy3 + 3,	"p2 right"	},
71 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 fire 1"	},
72 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 fire 2"	},
73 
74 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
75 	{"Dip A",			BIT_DIPSWITCH,	DrvInputs + 3,	"dip"		},
76 	{"Dip B",			BIT_DIPSWITCH,	DrvInputs + 4,	"dip"		},
77 };
78 
79 STDINPUTINFO(Shtrider)
80 
81 static struct BurnDIPInfo TravrusaDIPList[]=
82 {
83 	{0x0d, 0xff, 0xff, 0xf7, NULL							},
84 	{0x0e, 0xff, 0xff, 0xfd, NULL							},
85 
86 	{0   , 0xfe, 0   ,    4, "Fuel Reduced on Collision"	},
87 	{0x0d, 0x01, 0x03, 0x03, "Low"							},
88 	{0x0d, 0x01, 0x03, 0x02, "Med"							},
89 	{0x0d, 0x01, 0x03, 0x01, "Hi"							},
90 	{0x0d, 0x01, 0x03, 0x00, "Max"							},
91 
92 	{0   , 0xfe, 0   ,    2, "Fuel Consumption"				},
93 	{0x0d, 0x01, 0x04, 0x04, "Low"							},
94 	{0x0d, 0x01, 0x04, 0x00, "Hi"							},
95 
96 	{0   , 0xfe, 0   ,    2, "Allow Continue"				},
97 	{0x0d, 0x01, 0x08, 0x08, "No"							},
98 	{0x0d, 0x01, 0x08, 0x00, "Yes"							},
99 
100 	{0   , 0xfe, 0   ,    32, "Coinage"						},
101 	{0x0d, 0x01, 0xf0, 0x80, "Not Used"						},
102 	{0x0d, 0x01, 0xf0, 0x90, "Not Used"						},
103 	{0x0d, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits"			},
104 	{0x0d, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits"			},
105 	{0x0d, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits"			},
106 	{0x0d, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits"			},
107 	{0x0d, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits"			},
108 	{0x0d, 0x01, 0xf0, 0xf0, "1 Coin  1 Credits"			},
109 	{0x0d, 0x01, 0xf0, 0x70, "1 Coin  2 Credits"			},
110 	{0x0d, 0x01, 0xf0, 0x60, "1 Coin  3 Credits"			},
111 	{0x0d, 0x01, 0xf0, 0x50, "1 Coin  4 Credits"			},
112 	{0x0d, 0x01, 0xf0, 0x40, "1 Coin  5 Credits"			},
113 	{0x0d, 0x01, 0xf0, 0x30, "1 Coin  6 Credits"			},
114 	{0x0d, 0x01, 0xf0, 0x20, "1 Coin  7 Credits"			},
115 	{0x0d, 0x01, 0xf0, 0x10, "Not Used"						},
116 	{0x0d, 0x01, 0xf0, 0x00, "Free Play"					},
117 	{0x0d, 0x01, 0xf0, 0x80, "Free Play"					},
118 	{0x0d, 0x01, 0xf0, 0x90, "A 3C 1C / B 1C 3C"			},
119 	{0x0d, 0x01, 0xf0, 0xa0, "A 2C 1C / B 1C 3C"			},
120 	{0x0d, 0x01, 0xf0, 0xb0, "A 1C 1C / B 1C 3C"			},
121 	{0x0d, 0x01, 0xf0, 0xc0, "Free Play"					},
122 	{0x0d, 0x01, 0xf0, 0xd0, "A 3C 1C / B 1C 2C"			},
123 	{0x0d, 0x01, 0xf0, 0xe0, "A 2C 1C / B 1C 2C"			},
124 	{0x0d, 0x01, 0xf0, 0xf0, "A 1C 1C / B 1C 2C"			},
125 	{0x0d, 0x01, 0xf0, 0x70, "A 1C 1C / B 1C 5C"			},
126 	{0x0d, 0x01, 0xf0, 0x60, "A 2C 1C / B 1C 5C"			},
127 	{0x0d, 0x01, 0xf0, 0x50, "A 3C 1C / B 1C 5C"			},
128 	{0x0d, 0x01, 0xf0, 0x40, "Free Play"					},
129 	{0x0d, 0x01, 0xf0, 0x30, "A 1C 1C / B 1C 6C"			},
130 	{0x0d, 0x01, 0xf0, 0x20, "A 2C 1C / B 1C 6C"			},
131 	{0x0d, 0x01, 0xf0, 0x10, "A 3C 1C / B 1C 6C"			},
132 	{0x0d, 0x01, 0xf0, 0x00, "Free Play"					},
133 
134 	{0   , 0xfe, 0   ,    2, "Flip Screen"					},
135 	{0x0e, 0x01, 0x01, 0x01, "Off"							},
136 	{0x0e, 0x01, 0x01, 0x00, "On"							},
137 
138 	{0   , 0xfe, 0   ,    2, "Cabinet"						},
139 	{0x0e, 0x01, 0x02, 0x00, "Upright"						},
140 	{0x0e, 0x01, 0x02, 0x02, "Cocktail"						},
141 
142 	{0   , 0xfe, 0   ,    2, "Coin Mode"					},
143 	{0x0e, 0x01, 0x04, 0x04, "Mode 1"						},
144 	{0x0e, 0x01, 0x04, 0x00, "Mode 2"						},
145 
146 	{0   , 0xfe, 0   ,    2, "Speed Type"					},
147 	{0x0e, 0x01, 0x08, 0x08, "M/H"							},
148 	{0x0e, 0x01, 0x08, 0x00, "Km/H"							},
149 
150 	{0   , 0xfe, 0   ,    2, "Stop Mode (Cheat)"			},
151 	{0x0e, 0x01, 0x10, 0x10, "Off"							},
152 	{0x0e, 0x01, 0x10, 0x00, "On"							},
153 
154 	{0   , 0xfe, 0   ,    2, "Title"						},
155 	{0x0e, 0x01, 0x20, 0x20, "Traverse USA"					},
156 	{0x0e, 0x01, 0x20, 0x00, "Zippy Race"					},
157 
158 	{0   , 0xfe, 0   ,    2, "Invulnerability (Cheat)"		},
159 	{0x0e, 0x01, 0x40, 0x40, "Off"							},
160 	{0x0e, 0x01, 0x40, 0x00, "On"							},
161 
162 	{0   , 0xfe, 0   ,    2, "Service Mode"					},
163 	{0x0e, 0x01, 0x80, 0x80, "Off"							},
164 	{0x0e, 0x01, 0x80, 0x00, "On"							},
165 };
166 
167 STDDIPINFO(Travrusa)
168 
169 static struct BurnDIPInfo ShtriderDIPList[]=
170 {
171 	{0x0d, 0xff, 0xff, 0xff, NULL							},
172 	{0x0e, 0xff, 0xff, 0xff, NULL							},
173 
174 	{0   , 0xfe, 0   ,    8, "Coin A"						},
175 	{0x0d, 0x01, 0x07, 0x00, "5 Coins 1 Credits"			},
176 	{0x0d, 0x01, 0x07, 0x04, "4 Coins 1 Credits"			},
177 	{0x0d, 0x01, 0x07, 0x02, "3 Coins 1 Credits"			},
178 	{0x0d, 0x01, 0x07, 0x06, "2 Coins 1 Credits"			},
179 	{0x0d, 0x01, 0x07, 0x07, "1 Coin  1 Credits"			},
180 	{0x0d, 0x01, 0x07, 0x03, "1 Coin  2 Credits"			},
181 	{0x0d, 0x01, 0x07, 0x05, "1 Coin  3 Credits"			},
182 	{0x0d, 0x01, 0x07, 0x01, "1 Coin  5 Credits"			},
183 
184 	{0   , 0xfe, 0   ,    4, "Coin B"						},
185 	{0x0d, 0x01, 0x18, 0x00, "3 Coins 1 Credits"			},
186 	{0x0d, 0x01, 0x18, 0x10, "2 Coins 1 Credits"			},
187 	{0x0d, 0x01, 0x18, 0x18, "1 Coin  1 Credits"			},
188 	{0x0d, 0x01, 0x18, 0x08, "1 Coin  2 Credits"			},
189 
190 	{0   , 0xfe, 0   ,    2, "Flip Screen"					},
191 	{0x0e, 0x01, 0x01, 0x01, "Off"							},
192 	{0x0e, 0x01, 0x01, 0x00, "On"							},
193 
194 	{0   , 0xfe, 0   ,    2, "Speed Display"				},
195 	{0x0e, 0x01, 0x02, 0x02, "km/h"							},
196 	{0x0e, 0x01, 0x02, 0x00, "mph"							},
197 
198 	{0   , 0xfe, 0   ,    2, "Cabinet"						},
199 	{0x0e, 0x01, 0x08, 0x08, "Upright"						},
200 	{0x0e, 0x01, 0x08, 0x00, "Cocktail"						},
201 };
202 
STDDIPINFO(Shtrider)203 STDDIPINFO(Shtrider)
204 
205 static void __fastcall travrusa_main_write(UINT16 address, UINT8 data)
206 {
207 	switch (address)
208 	{
209 		case 0x9000:
210 			scrollx = (scrollx & 0x0100) | data;
211 		return;
212 
213 		case 0xa000:
214 			scrollx = (scrollx & 0x00ff) | ((data << 8) & 0x100);
215 		return;
216 
217 		case 0xd000:
218 			IremSoundWrite(data);
219 		return;
220 
221 		case 0xd001:
222 			flipscreen = (data & 1) ^ ((DrvInputs[4] & 1) ^ 1);
223 		return;
224 	}
225 }
226 
travrusa_main_read(UINT16 address)227 static UINT8 __fastcall travrusa_main_read(UINT16 address)
228 {
229 	switch (address)
230 	{
231 		case 0xd000:
232 		case 0xd001:
233 		case 0xd002:
234 		case 0xd003:
235 		case 0xd004:
236 			return DrvInputs[address & 7];
237 	}
238 
239 	return 0;
240 }
241 
travrusa_main_read_port(UINT16 port)242 static UINT8 __fastcall travrusa_main_read_port(UINT16 port)
243 {
244 	switch (port & 0xff)
245 	{
246 		case 0x11:
247 			return 0x88; // shtriderb
248 	}
249 
250 	return 0;
251 }
252 
DrvDoReset()253 static INT32 DrvDoReset()
254 {
255 	memset (AllRam, 0, RamEnd - AllRam);
256 
257 	ZetOpen(0);
258 	ZetReset();
259 	ZetClose();
260 
261 	IremSoundReset();
262 
263 	flipscreen = 0;
264 
265 	return 0;
266 }
267 
MemIndex()268 static INT32 MemIndex()
269 {
270 	UINT8 *Next; Next = AllMem;
271 
272 	DrvZ80ROM			= Next; Next += 0x008000;
273 	DrvSndROM			= Next; Next += 0x010000;
274 
275 	DrvGfxROM0			= Next; Next += 0x010000;
276 	DrvGfxROM1			= Next; Next += 0x010000;
277 
278 	DrvTransTable[0]	= Next; Next += 0x000100;
279 	DrvTransTable[1]	= Next; Next += 0x000080;
280 
281 	DrvPalette			= (UINT32*)Next; Next += 0x0100 * sizeof(UINT32);
282 
283 	DrvColPROM			= Next; Next += 0x000400;
284 
285 	AllRam				= Next;
286 
287 	DrvZ80RAM			= Next; Next += 0x001000;
288 	DrvVidRAM			= Next; Next += 0x001000;
289 	DrvSprRAM			= Next; Next += 0x000200;
290 
291 	RamEnd				= Next;
292 
293 	MemEnd				= Next;
294 
295 	return 0;
296 }
297 
DrvGfxDecode(INT32 type)298 static INT32 DrvGfxDecode(INT32 type)
299 {
300 	INT32 Plane[3]   = { (0x2000*2*8), (0x2000*1*8), (0x2000*0*8) };
301 	INT32 XOffs0[16] = { STEP8(0,1), STEP8(16*8,1) };
302 	INT32 YOffs0[16] = { STEP16(0,8) };
303 	INT32 XOffs1[16] = { STEP8(0,1), STEP8(8*8,1) };
304 	INT32 YOffs1[16] = { STEP8(0,8), STEP8(16*8,8) };
305 
306 	INT32 *Xptr = (type) ? XOffs1 : XOffs0;
307 	INT32 *Yptr = (type) ? YOffs1 : YOffs0;
308 
309 	UINT8 *tmp = (UINT8*)BurnMalloc(0x6000);
310 	if (tmp == NULL) {
311 		return 1;
312 	}
313 
314 	memcpy (tmp, DrvGfxROM0, 0x6000);
315 
316 	GfxDecode(0x0400, 3, 8, 8, Plane, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0);
317 
318 	memcpy (tmp, DrvGfxROM1, 0x6000);
319 
320 	GfxDecode(0x0100, 3, 16, 16, Plane, Xptr, Yptr, 0x100, tmp, DrvGfxROM1);
321 
322 	BurnFree(tmp);
323 
324 	return 0;
325 }
326 
shtrider_palette_decode()327 static void shtrider_palette_decode()
328 {
329 	for (INT32 i = 0; i < 0x80; i++) {
330 		DrvColPROM[i] <<= 4;
331 		DrvColPROM[i] |= DrvColPROM[i+0x100];
332 	}
333 }
334 
motoraceDecode()335 static void motoraceDecode()
336 {
337 	UINT8 *tmp = (UINT8*)BurnMalloc(0x2000);
338 
339 	memcpy (tmp, DrvZ80ROM, 0x2000);
340 
341 	for (INT32 A = 0; A < 0x2000; A++)
342 	{
343 		INT32 j = BITSWAP16(A,15,14,13,9,7,5,3,1,12,10,8,6,4,2,0,11);
344 		DrvZ80ROM[j] = BITSWAP08(tmp[A],2,7,4,1,6,3,0,5);
345 	}
346 
347 	BurnFree(tmp);
348 }
349 
shtrideraDecode()350 static void shtrideraDecode()
351 {
352 	for (INT32 A = 0; A < 0x2000; A++)
353 	{
354 		DrvZ80ROM[A] = BITSWAP08(DrvZ80ROM[A],7,5,6,3,4,2,1,0);
355 	}
356 }
357 
build_transtables()358 static void build_transtables()
359 {
360 	for (INT32 i = 0; i < 0x80; i++) {
361 		DrvTransTable[0][i] = 1; // opaque
362 		DrvTransTable[1][i] = (0xc0 >> (i & 7)) & 1;
363 		DrvTransTable[0][i+0x80] = DrvColPROM[0x80+(DrvColPROM[0x200+i]&0xf)] ? 1 : 0;
364 	}
365 }
366 
tilemap_callback(layer0)367 static tilemap_callback( layer0 )
368 {
369 	INT32 attr = DrvVidRAM[offs * 2 + 1];
370 	INT32 code = DrvVidRAM[offs * 2 + 0] | ((attr << 2) & 0x300);
371 
372 	INT32 color = attr & 0xf;
373 
374 	TILE_SET_INFO(0, code, color, TILE_FLIPXY((attr & 0x30) >> 4));
375 	sTile->category = (color == 0xf) ? 1 : 0;
376 }
377 
DrvInit(void (* pRomCallback)(),INT32 soundromsmall,INT32 gfxtype)378 static INT32 DrvInit(void (*pRomCallback)(), INT32 soundromsmall, INT32 gfxtype)
379 {
380 	AllMem = NULL;
381 	MemIndex();
382 	INT32 nLen = MemEnd - (UINT8 *)0;
383 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
384 	memset(AllMem, 0, nLen);
385 	MemIndex();
386 
387 	{
388 		if (BurnLoadRom(DrvZ80ROM  + 0x0000,  0, 1)) return 1;
389 		if (BurnLoadRom(DrvZ80ROM  + 0x2000,  1, 1)) return 1;
390 		if (BurnLoadRom(DrvZ80ROM  + 0x4000,  2, 1)) return 1;
391 		if (BurnLoadRom(DrvZ80ROM  + 0x6000,  3, 1)) return 1;
392 
393 		if (BurnLoadRom(DrvSndROM  + (soundromsmall ? 0x7000 : 0x6000),  4, 1)) return 1;
394 
395 		if (BurnLoadRom(DrvGfxROM0 + 0x0000,  5, 1)) return 1;
396 		if (BurnLoadRom(DrvGfxROM0 + 0x2000,  6, 1)) return 1;
397 		if (BurnLoadRom(DrvGfxROM0 + 0x4000,  7, 1)) return 1;
398 
399 		if (BurnLoadRom(DrvGfxROM1 + 0x0000,  8, 1)) return 1;
400 		if (BurnLoadRom(DrvGfxROM1 + 0x2000,  9, 1)) return 1;
401 		if (BurnLoadRom(DrvGfxROM1 + 0x4000, 10, 1)) return 1;
402 
403 		if (BurnLoadRom(DrvColPROM + 0x0000, 11, 1)) return 1;
404 
405 		if (gfxtype) {
406 			if (BurnLoadRom(DrvColPROM + 0x0100, 12, 1)) return 1;
407 			if (BurnLoadRom(DrvColPROM + 0x0080, 13, 1)) return 1;
408 			if (BurnLoadRom(DrvColPROM + 0x0200, 14, 1)) return 1;
409 
410 			shtrider_palette_decode();
411 		} else {
412 			if (BurnLoadRom(DrvColPROM + 0x0080, 12, 1)) return 1;
413 			if (BurnLoadRom(DrvColPROM + 0x0200, 13, 1)) return 1;
414 		}
415 
416 		if (pRomCallback) {
417 			pRomCallback();
418 		}
419 
420 		DrvGfxDecode(gfxtype);
421 		build_transtables();
422 	}
423 
424 	ZetInit(0);
425 	ZetOpen(0);
426 	ZetMapMemory(DrvZ80ROM,		0x0000, 0x7fff, MAP_ROM);
427 	ZetMapMemory(DrvVidRAM,		0x8000, 0x8fff, MAP_RAM);
428 	ZetMapMemory(DrvSprRAM,		0xc800, 0xc9ff, MAP_WRITE);
429 	ZetMapMemory(DrvZ80RAM,		0xe000, 0xefff, MAP_RAM);
430 	ZetSetWriteHandler(travrusa_main_write);
431 	ZetSetReadHandler(travrusa_main_read);
432 	ZetSetInHandler(travrusa_main_read_port);
433 	ZetClose();
434 
435 	IremSoundInit(DrvSndROM, 0, 4000000);
436 
437 	GenericTilesInit();
438 	GenericTilemapInit(0, TILEMAP_SCAN_ROWS, layer0_map_callback, 8, 8, 64, 32);
439 	GenericTilemapSetGfx(0, DrvGfxROM0, 3, 8, 8, 0x10000, 0, 0xf);
440 	GenericTilemapSetScrollRows(0, 4);
441 	GenericTilemapSetScrollRow(0, 3, 0);
442 	GenericTilemapSetOffsets(0, -8, 0);
443 	GenericTilemapSetTransSplit(0, 0, 0xff, 0x00);
444 	GenericTilemapSetTransSplit(0, 1, 0x3f, 0xc0);
445 	if (YFlipping) GenericTilemapSetFlip(TMAP_GLOBAL, TMAP_FLIPY);
446 	DrvDoReset();
447 
448 	return 0;
449 }
450 
travrusaInit()451 static INT32 travrusaInit() { return DrvInit(NULL, 1, 0); }
motoraceInit()452 static INT32 motoraceInit() { return DrvInit(motoraceDecode, 1, 0); }
shtriderInit()453 static INT32 shtriderInit() { YFlipping = 1; return DrvInit(NULL, 0, 1); }
shtrideraInit()454 static INT32 shtrideraInit() { YFlipping = 1; return DrvInit(shtrideraDecode, 0, 1); }
shtriderbInit()455 static INT32 shtriderbInit() { YFlipping = 1; return DrvInit(NULL, 0, 0); }
456 
DrvExit()457 static INT32 DrvExit()
458 {
459 	GenericTilesExit();
460 
461 	ZetExit();
462 
463 	IremSoundExit();
464 
465 	BurnFree(AllMem);
466 
467 	YFlipping = 0;
468 
469 	return 0;
470 }
471 
DrvPaletteInit()472 static void DrvPaletteInit()
473 {
474 	UINT32 tmp[0x10];
475 	UINT8 *color_prom = DrvColPROM;
476 
477 	for (INT32 i = 0; i < 0x90; i++)
478 	{
479 		INT32 bit0 = 0;
480 		INT32 bit1 = (color_prom[i] >> 6) & 0x01;
481 		INT32 bit2 = (color_prom[i] >> 7) & 0x01;
482 		INT32 r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
483 
484 		bit0 = (color_prom[i] >> 3) & 0x01;
485 		bit1 = (color_prom[i] >> 4) & 0x01;
486 		bit2 = (color_prom[i] >> 5) & 0x01;
487 		INT32 g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
488 
489 		bit0 = (color_prom[i] >> 0) & 0x01;
490 		bit1 = (color_prom[i] >> 1) & 0x01;
491 		bit2 = (color_prom[i] >> 2) & 0x01;
492 		INT32 b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
493 
494 		if (i < 0x80)
495 			DrvPalette[i] = BurnHighCol(r,g,b,0);
496 		else
497 			tmp[i-0x80] = BurnHighCol(r,g,b,0);
498 	}
499 
500 	for (INT32 i = 0x80; i < 0x100; i++)
501 	{
502 		DrvPalette[i] = tmp[DrvColPROM[i + 0x180] & 0x0f];
503 	}
504 }
505 
draw_sprites()506 static void draw_sprites()
507 {
508 	if (YFlipping) {
509 		GenericTilesSetClip(0, 240, 64, 256); // shtrider
510 	} else {
511 		GenericTilesSetClip(0, 240,  0, 192); // everything else
512 	}
513 
514 	for (INT32 offs = 0x200 - 4; offs >= 0; offs -= 4)
515 	{
516 		int sx = ((DrvSprRAM[offs + 3] + 8) & 0xff) - 16;
517 		int sy = 240 - DrvSprRAM[offs];
518 		int code = DrvSprRAM[offs + 2];
519 		int attr = DrvSprRAM[offs + 1];
520 		int flipx = attr & 0x40;
521 		int flipy = attr & 0x80;
522 		int color = attr & 0x0f;
523 
524 		if (YFlipping) {
525 			sy = 240 - sy;
526 			flipy = !flipy;
527 		}
528 
529 		RenderTileTranstab(pTransDraw, DrvGfxROM1, code, (color<<3)+0x80, 0, sx, sy, flipx, flipy, 16, 16, DrvTransTable[0]);
530 	}
531 
532 	GenericTilesClearClip();
533 }
534 
DrvDraw()535 static INT32 DrvDraw()
536 {
537 	if (DrvRecalc) {
538 		DrvPaletteInit();
539 		DrvRecalc = 0;
540 	}
541 
542 	BurnTransferClear();
543 
544 	for (INT32 i = 0; i < 3; i++) {
545 		GenericTilemapSetScrollRow(0, i, scrollx);
546 	}
547 
548 	BurnTransferClear();
549 
550 	if (nBurnLayer & 1) GenericTilemapDraw(0, pTransDraw, TMAP_DRAWLAYER1);
551 
552 	if (nSpriteEnable & 1) draw_sprites();
553 
554 	if (nBurnLayer & 2) GenericTilemapDraw(0, pTransDraw, TMAP_DRAWLAYER0);
555 
556 	BurnTransferCopy(DrvPalette);
557 
558 	return 0;
559 }
560 
DrvFrame()561 static INT32 DrvFrame()
562 {
563 	if (DrvReset) {
564 		DrvDoReset();
565 	}
566 
567 	M6803NewFrame();
568 	ZetNewFrame();
569 
570 	{
571 		memset (DrvInputs, 0xff, 3); // dips 3,4!
572 
573 		for (INT32 i = 0; i < 8; i++) {
574 			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
575 			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
576 			DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
577 		}
578 	}
579 
580 	INT32 nInterleave = MSM5205CalcInterleave(0, 3579545);
581 	INT32 nCyclesTotal[2] = { 4000000 / 60, 3579545 / 60 };
582 	INT32 nCyclesDone[2] = { 0, 0 };
583 
584 	ZetOpen(0);
585 	M6803Open(0);
586 
587 	for (INT32 i = 0; i < nInterleave; i++)
588 	{
589 		switch (i) {
590 			case  0: ZetSetIRQLine(0, CPU_IRQSTATUS_ACK); break;
591 			case 14: ZetSetIRQLine(0, CPU_IRQSTATUS_NONE); break;
592 		}
593 
594 		CPU_RUN(0, Zet);
595 
596 		CPU_RUN(1, M6803);
597 		MSM5205Update(); // adpcm update samples
598 	}
599 
600 	if (pBurnSoundOut) {
601 		AY8910Render(pBurnSoundOut, nBurnSoundLen);
602 		MSM5205Render(0, pBurnSoundOut, nBurnSoundLen);
603 	}
604 
605 	ZetClose();
606 	M6803Close();
607 
608 	if (pBurnDraw) {
609 		DrvDraw();
610 	}
611 
612 	return 0;
613 }
614 
DrvScan(INT32 nAction,INT32 * pnMin)615 static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
616 {
617 	struct BurnArea ba;
618 
619 	if (pnMin) {
620 		*pnMin = 0x029702;
621 	}
622 
623 	if (nAction & ACB_VOLATILE) {
624 		memset(&ba, 0, sizeof(ba));
625 
626 		ba.Data	  = AllRam;
627 		ba.nLen	  = RamEnd - AllRam;
628 		ba.szName = "All Ram";
629 		BurnAcb(&ba);
630 
631 		ZetScan(nAction);
632 		IremSoundScan(nAction, pnMin);
633 
634 		SCAN_VAR(flipscreen);
635 		SCAN_VAR(scrollx);
636 	}
637 
638 	return 0;
639 }
640 
641 
642 // Traverse USA / Zippy Race
643 
644 static struct BurnRomInfo travrusaRomDesc[] = {
645 	{ "zr1-0.m3",		0x2000, 0xbe066c0a, 1 | BRF_PRG | BRF_ESS }, //  0 Z80 Code
646 	{ "zr1-5.l3",		0x2000, 0x145d6b34, 1 | BRF_PRG | BRF_ESS }, //  1
647 	{ "zr1-6a.k3",		0x2000, 0xe1b51383, 1 | BRF_PRG | BRF_ESS }, //  2
648 	{ "zr1-7.j3",		0x2000, 0x85cd1a51, 1 | BRF_PRG | BRF_ESS }, //  3
649 
650 	{ "mr10.1a",		0x1000, 0xa02ad8a0, 2 | BRF_GRA },           //  4 M6803 Code
651 
652 	{ "zippyrac.001",	0x2000, 0xaa8994dd, 3 | BRF_GRA },           //  5 Background tiles
653 	{ "mr8.3c",			0x2000, 0x3a046dd1, 3 | BRF_GRA },           //  6
654 	{ "mr9.3a",			0x2000, 0x1cc3d3f4, 3 | BRF_GRA },           //  7
655 
656 	{ "zr1-8.n3",		0x2000, 0x3e2c7a6b, 4 | BRF_GRA },           //  8 Sprite tiles
657 	{ "zr1-9.l3",		0x2000, 0x13be6a14, 4 | BRF_GRA },           //  9
658 	{ "zr1-10.k3",		0x2000, 0x6fcc9fdb, 4 | BRF_GRA },           // 10
659 
660 	{ "mmi6349.ij",		0x0200, 0xc9724350, 5 | BRF_GRA },           // 11 Color data
661 	{ "tbp18s.2",		0x0020, 0xa1130007, 5 | BRF_GRA },           // 12
662 	{ "tbp24s10.3",		0x0100, 0x76062638, 5 | BRF_GRA },           // 13
663 };
664 
665 STD_ROM_PICK(travrusa)
666 STD_ROM_FN(travrusa)
667 
668 struct BurnDriver BurnDrvTravrusa = {
669 	"travrusa", NULL, NULL, NULL, "1983",
670 	"Traverse USA / Zippy Race\0", NULL, "Irem", "Miscellaneous",
671 	NULL, NULL, NULL, NULL,
672 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
673 	NULL, travrusaRomInfo, travrusaRomName, NULL, NULL, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo,
674 	travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
675 	256, 240, 3, 4
676 };
677 
678 
679 // Traverse USA (bootleg)
680 
681 static struct BurnRomInfo travrusabRomDesc[] = {
682 	{ "at4.m3",			0x2000, 0x704ce6e4, 1 | BRF_PRG | BRF_ESS }, //  0 Z80 Code
683 	{ "at5.l3",			0x2000, 0x686cb0e6, 1 | BRF_PRG | BRF_ESS }, //  1
684 	{ "at6.k3",			0x2000, 0xbaf87d80, 1 | BRF_PRG | BRF_ESS }, //  2
685 	{ "at7.h3",			0x2000, 0x48091ebe, 1 | BRF_PRG | BRF_ESS }, //  3
686 
687 	{ "11.a1",			0x1000, 0xd2c0bc33, 2 | BRF_GRA },           //  4 M6803 Code
688 
689 	{ "zippyrac.001",	0x2000, 0xaa8994dd, 3 | BRF_GRA },           //  5 Background tiles
690 	{ "mr8.3c",			0x2000, 0x3a046dd1, 3 | BRF_GRA },           //  6
691 	{ "mr9.3a",			0x2000, 0x1cc3d3f4, 3 | BRF_GRA },           //  7
692 
693 	{ "8.n3",			0x2000, 0x00c0f46b, 4 | BRF_GRA },           //  8 Sprite tiles
694 	{ "9.m3",			0x2000, 0x73ade73b, 4 | BRF_GRA },           //  9
695 	{ "10.k3",			0x2000, 0xfcfeaa69, 4 | BRF_GRA },           // 10
696 
697 	{ "mmi6349.ij",		0x0200, 0xc9724350, 5 | BRF_GRA },           // 11 Color data
698 	{ "tbp18s.2",		0x0020, 0xa1130007, 5 | BRF_GRA },           // 12
699 	{ "tbp24s10.3",		0x0100, 0x76062638, 5 | BRF_GRA },           // 13
700 };
701 
702 STD_ROM_PICK(travrusab)
703 STD_ROM_FN(travrusab)
704 
705 struct BurnDriver BurnDrvTravrusab = {
706 	"travrusab", "travrusa", NULL, NULL, "1983",
707 	"Traverse USA (bootleg)\0", NULL, "bootleg (I.P.)", "Miscellaneous",
708 	NULL, NULL, NULL, NULL,
709 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
710 	NULL, travrusabRomInfo, travrusabRomName, NULL, NULL, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo,
711 	travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
712 	256, 240, 3, 4
713 };
714 
715 
716 // MotoRace USA
717 
718 static struct BurnRomInfo motoraceRomDesc[] = {
719 	{ "mr.cpu",			0x2000, 0x89030b0c, 1 | BRF_PRG | BRF_ESS }, //  0 Z80 Code
720 	{ "mr1.3l",			0x2000, 0x0904ed58, 1 | BRF_PRG | BRF_ESS }, //  1
721 	{ "mr2.3k",			0x2000, 0x8a2374ec, 1 | BRF_PRG | BRF_ESS }, //  2
722 	{ "mr3.3j",			0x2000, 0x2f04c341, 1 | BRF_PRG | BRF_ESS }, //  3
723 
724 	{ "mr10.1a",		0x1000, 0xa02ad8a0, 2 | BRF_GRA },           //  4 M6803 Code
725 
726 	{ "mr7.3e",			0x2000, 0x492a60be, 3 | BRF_GRA },           //  5 Background tiles
727 	{ "mr8.3c",			0x2000, 0x3a046dd1, 3 | BRF_GRA },           //  6
728 	{ "mr9.3a",			0x2000, 0x1cc3d3f4, 3 | BRF_GRA },           //  7
729 
730 	{ "mr4.3n",			0x2000, 0x5cf1a0d6, 4 | BRF_GRA },           //  8 Sprite tiles
731 	{ "mr5.3m",			0x2000, 0xf75f2aad, 4 | BRF_GRA },           //  9
732 	{ "mr6.3k",			0x2000, 0x518889a0, 4 | BRF_GRA },           // 10
733 
734 	{ "mmi6349.ij",		0x0200, 0xc9724350, 5 | BRF_GRA },           // 11 Color data
735 	{ "tbp18s.2",		0x0020, 0xa1130007, 5 | BRF_GRA },           // 12
736 	{ "tbp24s10.3",		0x0100, 0x76062638, 5 | BRF_GRA },           // 13
737 };
738 
739 STD_ROM_PICK(motorace)
740 STD_ROM_FN(motorace)
741 
742 struct BurnDriver BurnDrvMotorace = {
743 	"motorace", "travrusa", NULL, NULL, "1983",
744 	"MotoRace USA\0", NULL, "Irem (Williams license)", "Miscellaneous",
745 	NULL, NULL, NULL, NULL,
746 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
747 	NULL, motoraceRomInfo, motoraceRomName, NULL, NULL, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo,
748 	motoraceInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
749 	256, 240, 3, 4
750 };
751 
752 
753 // MotoTour / Zippy Race (Tecfri license)
754 
755 static struct BurnRomInfo mototourRomDesc[] = {
756 	{ "mt1-4.m3",		0x2000, 0xfe643567, 1 | BRF_PRG | BRF_ESS }, //  0  Z80 Code
757 	{ "mt1-5.l3",		0x2000, 0x38d9d0f5, 1 | BRF_PRG | BRF_ESS }, //  1
758 	{ "mt1-6.k3",		0x2000, 0xefd325f2, 1 | BRF_PRG | BRF_ESS }, //  2
759 	{ "mt1-7.j3",		0x2000, 0xab8a3a33, 1 | BRF_PRG | BRF_ESS }, //  3
760 
761 	{ "snd.a1",			0x1000, 0xa02ad8a0, 2 | BRF_GRA },           //  4 M6803 Code
762 
763 	{ "mt1-1.e3",		0x2000, 0xaa8994dd, 3 | BRF_GRA },           //  5 Background tiles
764 	{ "mt1-2.c3",		0x2000, 0x3a046dd1, 3 | BRF_GRA },           //  6
765 	{ "mt1-3.a3",		0x2000, 0x1cc3d3f4, 3 | BRF_GRA },           //  7
766 
767 	{ "mt1-8..n3",		0x2000, 0x600a57f5, 4 | BRF_GRA },           //  8 Sprite tiles
768 	{ "mt1-9..m3",		0x2000, 0x6f9f2a4e, 4 | BRF_GRA },           //  9
769 	{ "mt1-10..k3",		0x2000, 0xd958def5, 4 | BRF_GRA },           // 10
770 
771 	{ "mmi6349.k2",		0x0200, 0xc9724350, 5 | BRF_GRA },           // 11 Color data
772 	{ "prom1.f1",		0x0020, 0xa1130007, 5 | BRF_GRA },           // 12
773 	{ "prom2.h2",		0x0100, 0x76062638, 5 | BRF_GRA },           // 13
774 };
775 
776 STD_ROM_PICK(mototour)
777 STD_ROM_FN(mototour)
778 
779 struct BurnDriver BurnDrvMototour = {
780 	"mototour", "travrusa", NULL, NULL, "1983",
781 	"MotoTour / Zippy Race (Tecfri license)\0", NULL, "Irem (Tecfri license)", "Miscellaneous",
782 	NULL, NULL, NULL, NULL,
783 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
784 	NULL, mototourRomInfo, mototourRomName, NULL, NULL, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo,
785 	travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
786 	256, 240, 3, 4
787 };
788 
789 
790 // MotoTour / Zippy Race (Assa version of Tecfri license)
791 
792 static struct BurnRomInfo mototouraRomDesc[] = {
793 	{ "a-00288_assa_m5_mp1.m3",		0x2000, 0xfe643567, 1 | BRF_PRG | BRF_ESS }, //  0  Z80 Code
794 	{ "a-00288_assa_m5_mp2.l3",		0x2000, 0x38d9d0f5, 1 | BRF_PRG | BRF_ESS }, //  1
795 	{ "a-00288_assa_m5_mp3.k3",		0x2000, 0xefd325f2, 1 | BRF_PRG | BRF_ESS }, //  2
796 	{ "a-00288_assa_m5_mp4.j3",		0x2000, 0x5a69a393, 1 | BRF_PRG | BRF_ESS }, //  3
797 
798 	{ "snd.a1",						0x1000, 0xd1385740, 2 | BRF_GRA },           //  4 M6803 Code
799 
800 	{ "a-00288_assa_m5_mf1.e3",		0x2000, 0x65cb269a, 3 | BRF_GRA },           //  5 Background tiles
801 	{ "a-00288_assa_m5_mf2.c3",		0x2000, 0x3a046dd1, 3 | BRF_GRA },           //  6
802 	{ "a-00288_assa_m5_mf3.a3",		0x2000, 0x1cc3d3f4, 3 | BRF_GRA },           //  7
803 
804 	{ "a-00288_assa_m5_mm8.n3",		0x2000, 0x600a57f5, 4 | BRF_GRA },           //  8 Sprite tiles
805 	{ "a-00288_assa_m5_mm9.m3",		0x2000, 0x6f9f2a4e, 4 | BRF_GRA },           //  9
806 	{ "a-00288_assa_m5_mm10.k3",	0x2000, 0xd958def5, 4 | BRF_GRA },           // 10
807 
808 	{ "mmi6349.k2",					0x0200, 0xc9724350, 5 | BRF_GRA },           // 11 Color data
809 	{ "prom1.f1",					0x0020, 0xa1130007, 5 | BRF_GRA },           // 12
810 	{ "prom2.h2",					0x0100, 0x76062638, 5 | BRF_GRA },           // 13
811 };
812 
813 STD_ROM_PICK(mototoura)
814 STD_ROM_FN(mototoura)
815 
816 struct BurnDriver BurnDrvMototoura = {
817 	"mototoura", "travrusa", NULL, NULL, "1983",
818 	"MotoTour / Zippy Race (Assa version of Tecfri license)\0", NULL, "Irem (Tecfri license / Assa)", "Miscellaneous",
819 	NULL, NULL, NULL, NULL,
820 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
821 	NULL, mototouraRomInfo, mototouraRomName, NULL, NULL, NULL, NULL, TravrusaInputInfo, TravrusaDIPInfo,
822 	travrusaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
823 	256, 240, 3, 4
824 };
825 
826 
827 // Shot Rider
828 
829 static struct BurnRomInfo shtriderRomDesc[] = {
830 	{ "sr01a.bin",		0x2000, 0xde76d537, 1 | BRF_PRG | BRF_ESS }, //  0  Z80 Code
831 	{ "sr02a.bin",		0x2000, 0xcd1e1bfc, 1 | BRF_PRG | BRF_ESS }, //  1
832 	{ "sr03a.bin",		0x2000, 0x3ade11b9, 1 | BRF_PRG | BRF_ESS }, //  2
833 	{ "sr04a.bin",		0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, //  3
834 
835 	{ "sr11a.bin",		0x2000, 0xa8396b76, 2 | BRF_GRA },           //  4 M6803 Code
836 
837 	{ "sr05a.bin",		0x2000, 0x34449f79, 3 | BRF_GRA },           //  5 Background tiles
838 	{ "sr06a.bin",		0x2000, 0xde43653d, 3 | BRF_GRA },           //  6
839 	{ "sr07a.bin",		0x2000, 0x3445b81c, 3 | BRF_GRA },           //  7
840 
841 	{ "sr08a.bin",		0x2000, 0x4072b096, 4 | BRF_GRA },           //  8 Sprite tiles
842 	{ "sr09a.bin",		0x2000, 0xfd4cc7e6, 4 | BRF_GRA },           //  9
843 	{ "sr10b.bin",		0x2000, 0x0a117925, 4 | BRF_GRA },           // 10
844 
845 	{ "1.bpr",			0x0100, 0xe9e258e5, 5 | BRF_GRA },           // 11 Color data
846 	{ "2.bpr",			0x0100, 0x6cf4591c, 5 | BRF_GRA },           // 12
847 	{ "4.bpr",			0x0020, 0xee97c581, 5 | BRF_GRA },           // 13
848 	{ "3.bpr",			0x0100, 0x5db47092, 5 | BRF_GRA },           // 14
849 };
850 
851 STD_ROM_PICK(shtrider)
852 STD_ROM_FN(shtrider)
853 
854 struct BurnDriver BurnDrvShtrider = {
855 	"shtrider", NULL, NULL, NULL, "1985",
856 	"Shot Rider\0", NULL, "Seibu Kaihatsu", "Miscellaneous",
857 	NULL, NULL, NULL, NULL,
858 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
859 	NULL, shtriderRomInfo, shtriderRomName, NULL, NULL, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo,
860 	shtriderInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
861 	256, 240, 3, 4
862 };
863 
864 
865 // Shot Rider (Sigma license)
866 
867 static struct BurnRomInfo shtrideraRomDesc[] = {
868 	{ "1.bin",			0x2000, 0xeb51315c, 1 | BRF_PRG | BRF_ESS }, //  0  Z80 Code
869 	{ "2.bin",			0x2000, 0x97675d19, 1 | BRF_PRG | BRF_ESS }, //  1
870 	{ "3.bin",			0x2000, 0x78d051cd, 1 | BRF_PRG | BRF_ESS }, //  2
871 	{ "4.bin",			0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, //  3
872 
873 	{ "11.bin",			0x2000, 0xa8396b76, 2 | BRF_GRA },           //  4 M6803 Code
874 
875 	{ "5.bin",			0x2000, 0x34449f79, 3 | BRF_GRA },           //  5 Background tiles
876 	{ "6.bin",			0x2000, 0xde43653d, 3 | BRF_GRA },           //  6
877 	{ "7.bin",			0x2000, 0x3445b81c, 3 | BRF_GRA },           //  7
878 
879 	{ "8.bin",			0x2000, 0x4072b096, 4 | BRF_GRA },           //  8 Sprite tiles
880 	{ "9.bin",			0x2000, 0xfd4cc7e6, 4 | BRF_GRA },           //  9
881 	{ "10.bin",			0x2000, 0x0a117925, 4 | BRF_GRA },           // 10
882 
883 	{ "1.bpr",			0x0100, 0xe9e258e5, 5 | BRF_GRA },           // 11 Color data
884 	{ "2.bpr",			0x0100, 0x6cf4591c, 5 | BRF_GRA },           // 12
885 	{ "4.bpr",			0x0020, 0xee97c581, 5 | BRF_GRA },           // 13
886 	{ "3.bpr",			0x0100, 0x5db47092, 5 | BRF_GRA },           // 14
887 };
888 
889 STD_ROM_PICK(shtridera)
890 STD_ROM_FN(shtridera)
891 
892 struct BurnDriver BurnDrvShtridera = {
893 	"shtridera", "shtrider", NULL, NULL, "1984",
894 	"Shot Rider (Sigma license)\0", NULL, "Seibu Kaihatsu (Sigma license)", "Miscellaneous",
895 	NULL, NULL, NULL, NULL,
896 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
897 	NULL, shtrideraRomInfo, shtrideraRomName, NULL, NULL, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo,
898 	shtrideraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
899 	256, 240, 3, 4
900 };
901 
902 
903 // Shot Rider (bootleg)
904 
905 static struct BurnRomInfo shtriderbRomDesc[] = {
906 	{ "sr1.20.m3",		0x2000, 0x8bca38d7, 1 | BRF_PRG | BRF_ESS }, //  0 Z80 Code
907 	{ "sr2.21.l3",		0x2000, 0x56d4a66a, 1 | BRF_PRG | BRF_ESS }, //  1
908 	{ "sr3.22.k3",		0x2000, 0x44cab4cc, 1 | BRF_PRG | BRF_ESS }, //  2
909 	{ "sr4.23.h3",		0x2000, 0x02b96eaa, 1 | BRF_PRG | BRF_ESS }, //  3
910 
911 	{ "sr11.7.a1",		0x2000, 0xa8396b76, 2 | BRF_GRA },           //  4 M6803 Code
912 
913 	{ "sr5.f3",			0x2000, 0x34449f79, 3 | BRF_GRA },           //  5 Background tiles
914 	{ "sr6.c3",			0x2000, 0xde43653d, 3 | BRF_GRA },           //  6
915 	{ "sr7.a3",			0x2000, 0x3445b81c, 3 | BRF_GRA },           //  7
916 
917 	{ "sr8.17.n3",		0x2000, 0x4072b096, 4 | BRF_GRA },           //  8 Sprite tiles
918 	{ "sr9.18.m3",		0x2000, 0xfd4cc7e6, 4 | BRF_GRA },           //  9
919 	{ "sr10.19.k3",		0x2000, 0x0a117925, 4 | BRF_GRA },           // 10
920 
921 	{ "6349-2.k2",		0x0200, 0x854487a7, 5 | BRF_GRA },           // 11 Color data
922 	{ "prom1.6.f1",		0x0020, 0xee97c581, 5 | BRF_GRA },           // 12
923 	{ "prom2.12.h2",	0x0100, 0x5db47092, 5 | BRF_GRA },           // 13
924 };
925 
926 STD_ROM_PICK(shtriderb)
927 STD_ROM_FN(shtriderb)
928 
929 struct BurnDriver BurnDrvShtriderb = {
930 	"shtriderb", "shtrider", NULL, NULL, "1985",
931 	"Shot Rider (bootleg)\0", "Graphics issues", "bootleg", "Miscellaneous",
932 	NULL, NULL, NULL, NULL,
933 	BDF_GAME_NOT_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_PRE90S, GBF_RACING, 0,
934 	NULL, shtriderbRomInfo, shtriderbRomName, NULL, NULL, NULL, NULL, ShtriderInputInfo, ShtriderDIPInfo,
935 	shtriderbInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x100,
936 	256, 240, 3, 4
937 };
938