1 // FB Alpha Toaplan driver module
2 // Based on MAME driver by Darren Olafson, Quench, and Stephane Humbert
3 
4 #include "tiles_generic.h"
5 #include "m68000_intf.h"
6 #include "z80_intf.h"
7 #include "burn_ym3812.h"
8 #include "tms32010.h"
9 
10 static UINT8 *AllMem;
11 static UINT8 *MemEnd;
12 static UINT8 *AllRam;
13 static UINT8 *RamEnd;
14 static UINT8 *Drv68KROM;
15 static UINT8 *DrvZ80ROM;
16 static UINT8 *DrvMCUROM;
17 static UINT8 *DrvGfxROM0;
18 static UINT8 *DrvGfxROM1;
19 static UINT8 *DrvPalRAM;
20 static UINT8 *DrvVidRAM;
21 static UINT8 *DrvShareRAM;
22 static UINT8 *DrvSprRAM;
23 static UINT8 *DrvSprSizeRAM;
24 static UINT8 *DrvSprBuf;
25 static UINT8 *DrvSprSizeBuf;
26 static UINT8 *Drv68KRAM;
27 static UINT8 *DrvZ80RAM;
28 static UINT8 *DrvMCURAM;
29 static UINT8 *DrvTransTable;
30 
31 static UINT16 *scroll;
32 
33 static UINT16 *pTempDraw;
34 
35 static UINT32 *DrvPalette;
36 static UINT8 DrvRecalc;
37 
38 static UINT16 sprite_flipscreen;
39 static UINT8 flipscreen;
40 static UINT8 interrupt_enable;
41 static UINT16 tiles_offsets_x;
42 static UINT16 tiles_offsets_y;
43 static UINT16 tileram_offs;
44 static UINT16 spriteram_offset;
45 static UINT8 soundlatch;
46 static UINT8 mcu_command;
47 
48 static INT32 m68k_halt;
49 static UINT32 main_ram_seg;
50 static UINT16 dsp_addr_w;
51 static INT32 dsp_execute;
52 static INT32 dsp_BIO;
53 static INT32 dsp_on;
54 
55 static INT32 tile_mask;
56 static INT32 sprite_mask;
57 static INT32 mainrom_size;
58 static INT32 sprite_y_adjust;
59 static INT32 vertical_lines;
60 static INT32 samesame = 0;
61 static INT32 vblank;
62 static INT32 has_dsp = 0;
63 
64 static UINT8 DrvJoy1[8];
65 static UINT8 DrvJoy2[8];
66 static UINT8 DrvJoy3[8];
67 static UINT8 DrvDips[4];
68 static UINT8 DrvInputs[3];
69 static UINT8 DrvReset;
70 
71 static struct BurnInputInfo Drv2bInputList[] = {
72 	{"P1 Coin",		BIT_DIGITAL,	DrvJoy3 + 3,	"p1 coin"	},
73 	{"P1 Start",		BIT_DIGITAL,	DrvJoy3 + 5,	"p1 start"	},
74 	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
75 	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
76 	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
77 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
78 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
79 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
80 
81 	{"P2 Coin",		BIT_DIGITAL,	DrvJoy3 + 4,	"p2 coin"	},
82 	{"P2 Start",		BIT_DIGITAL,	DrvJoy3 + 6,	"p2 start"	},
83 	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 up"		},
84 	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 down"	},
85 	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 left"	},
86 	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 right"	},
87 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
88 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 1"	},
89 
90 	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
91 	{"Service",		BIT_DIGITAL,	DrvJoy3 + 0,	"service"	},
92 	{"Test SW",		BIT_DIGITAL,	DrvJoy3 + 2,	"diag"		},
93 	{"Tilt",		BIT_DIGITAL,	DrvJoy3 + 1,	"tilt"		},
94 	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
95 	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
96 	{"Dip C",		BIT_DIPSWITCH,	DrvDips + 2,	"dip"		},
97 };
98 
99 STDINPUTINFO(Drv2b)
100 
101 static struct BurnInputInfo Drv3bInputList[] = {
102 	{"P1 Coin",		BIT_DIGITAL,	DrvJoy3 + 3,	"p1 coin"	},
103 	{"P1 Start",		BIT_DIGITAL,	DrvJoy3 + 5,	"p1 start"	},
104 	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
105 	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
106 	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
107 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
108 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
109 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
110 	{"P1 Button 3",		BIT_DIGITAL,	DrvJoy1 + 6,	"p1 fire 3"	},
111 
112 	{"P2 Coin",		BIT_DIGITAL,	DrvJoy3 + 4,	"p2 coin"	},
113 	{"P2 Start",		BIT_DIGITAL,	DrvJoy3 + 6,	"p2 start"	},
114 	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 up"		},
115 	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 down"	},
116 	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 left"	},
117 	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 right"	},
118 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
119 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 2"	},
120 	{"P2 Button 3",		BIT_DIGITAL,	DrvJoy2 + 6,	"p2 fire 3"	},
121 
122 	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
123 	{"Service",		BIT_DIGITAL,	DrvJoy3 + 0,	"service"	},
124 	{"Test SW",		BIT_DIGITAL,	DrvJoy3 + 2,	"diag"		},
125 	{"Tilt",		BIT_DIGITAL,	DrvJoy3 + 1,	"tilt"		},
126 	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
127 	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
128 	{"Dip C",		BIT_DIPSWITCH,	DrvDips + 2,	"dip"		},
129 };
130 
131 STDINPUTINFO(Drv3b)
132 
133 static struct BurnInputInfo FiresharkInputList[] = {
134 	{"P1 Coin",		BIT_DIGITAL,	DrvJoy3 + 3,	"p1 coin"	},
135 	{"P1 Start",		BIT_DIGITAL,	DrvJoy3 + 5,	"p1 start"	},
136 	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
137 	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
138 	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
139 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
140 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
141 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
142 
143 	{"P2 Coin",		BIT_DIGITAL,	DrvJoy3 + 4,	"p2 coin"	},
144 	{"P2 Start",		BIT_DIGITAL,	DrvJoy3 + 6,	"p2 start"	},
145 	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 up"		},
146 	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 down"	},
147 	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 left"	},
148 	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 right"	},
149 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
150 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 2"	},
151 
152 	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
153 	{"Service",		BIT_DIGITAL,	DrvJoy3 + 0,	"service"	},
154 	{"Tilt",		BIT_DIGITAL,	DrvJoy3 + 1,	"tilt"		},
155 	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
156 	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
157 	{"Dip C",		BIT_DIPSWITCH,	DrvDips + 2,	"dip"		},
158 };
159 
160 STDINPUTINFO(Fireshark)
161 
162 static struct BurnDIPInfo RallybikDIPList[]=
163 {
164 	{0x14, 0xff, 0xff, 0x01, NULL			},
165 	{0x15, 0xff, 0xff, 0x20, NULL			},
166 	{0x16, 0xff, 0xff, 0x00, NULL			},
167 
168 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
169 	{0x14, 0x01, 0x01, 0x01, "Upright"		},
170 	{0x14, 0x01, 0x01, 0x00, "Cocktail"		},
171 
172 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
173 	{0x14, 0x01, 0x02, 0x00, "Off"			},
174 	{0x14, 0x01, 0x02, 0x02, "On"			},
175 
176 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
177 	{0x14, 0x01, 0x04, 0x00, "Off"			},
178 	{0x14, 0x01, 0x04, 0x04, "On"			},
179 
180 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
181 	{0x14, 0x01, 0x08, 0x08, "Off"			},
182 	{0x14, 0x01, 0x08, 0x00, "On"			},
183 
184 	{0   , 0xfe, 0   ,    4, "Coin A"			},
185 	{0x14, 0x01, 0x30, 0x00, "1 Coin  1 Credit"		},  // a/b ok.
186 	{0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit"		},
187 	{0x14, 0x01, 0x30, 0x20, "3 Coins 1 Credit"		},
188 	{0x14, 0x01, 0x30, 0x30, "4 Coins 1 Credit"		},
189 
190 	{0   , 0xfe, 0   ,    4, "Coin B"			},
191 	{0x14, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"		},
192 	{0x14, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"		},
193 	{0x14, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"		},
194 	{0x14, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"		},
195 
196 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
197 	{0x15, 0x01, 0x03, 0x01, "Easy"			},
198 	{0x15, 0x01, 0x03, 0x00, "Normal"		},
199 	{0x15, 0x01, 0x03, 0x02, "Hard"			},
200 	{0x15, 0x01, 0x03, 0x03, "Very Hard"		},
201 
202 	{0   , 0xfe, 0   ,    4, "Territory/Copyright"		},
203 	{0x15, 0x01, 0x30, 0x20, "World/Taito Corp Japan"	},
204 	{0x15, 0x01, 0x30, 0x10, "USA/Taito America"		},
205 	{0x15, 0x01, 0x30, 0x00, "Japan/Taito Corp"		},
206 	{0x15, 0x01, 0x30, 0x30, "USA/Taito America (Romstar)"	},
207 
208 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
209 	{0x15, 0x01, 0x40, 0x00, "Off"			},
210 	{0x15, 0x01, 0x40, 0x40, "On"			},
211 
212 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
213 	{0x15, 0x01, 0x80, 0x80, "No"			},
214 	{0x15, 0x01, 0x80, 0x00, "Yes"			},
215 };
216 
217 STDDIPINFO(Rallybik)
218 
219 static struct BurnDIPInfo TruxtonDIPList[]=
220 {
221 	{0x14, 0xff, 0xff, 0x01, NULL			},
222 	{0x15, 0xff, 0xff, 0x00, NULL			},
223 	{0x16, 0xff, 0xff, 0xf2, NULL			},
224 
225 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
226 	{0x14, 0x01, 0x01, 0x01, "Upright"		},
227 	{0x14, 0x01, 0x01, 0x00, "Cocktail"		},
228 
229 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
230 	{0x14, 0x01, 0x02, 0x00, "Off"			},
231 	{0x14, 0x01, 0x02, 0x02, "On"			},
232 
233 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
234 	{0x14, 0x01, 0x04, 0x00, "Off"			},
235 	{0x14, 0x01, 0x04, 0x04, "On"			},
236 
237 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
238 	{0x14, 0x01, 0x08, 0x08, "Off"			},
239 	{0x14, 0x01, 0x08, 0x00, "On"			},
240 
241 	{0   , 0xfe, 0   ,    4, "Coin A"		},
242 	{0x14, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	},  // ok a/b
243 	{0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit"	},
244 	{0x14, 0x01, 0x30, 0x20, "3 Coins 1 Credit"	},
245 	{0x14, 0x01, 0x30, 0x30, "4 Coins 1 Credit"	},
246 
247 	{0   , 0xfe, 0   ,    4, "Coin B"		},
248 	{0x14, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
249 	{0x14, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
250 	{0x14, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
251 	{0x14, 0x01, 0xc0, 0xc0, "1 Coins 6 Credits"	},
252 
253 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
254 	{0x15, 0x01, 0x03, 0x01, "Easy"			},
255 	{0x15, 0x01, 0x03, 0x00, "Normal"		},
256 	{0x15, 0x01, 0x03, 0x02, "Hard"			},
257 	{0x15, 0x01, 0x03, 0x03, "Very Hard"		},
258 
259 	{0   , 0xfe, 0   ,	  4, "Extend bonus"},
260 	{0x15, 0x01, 0x03, 0x04, "50k 200k 150k+"	},
261 	{0x15, 0x01, 0x03, 0x00, "70k 270k 200k+"	},
262 	{0x15, 0x01, 0x03, 0x08, "100k Only"		},
263 	{0x15, 0x01, 0x03, 0x0c, "None"			},
264 
265 	{0   , 0xfe, 0   ,    4, "Lives"		},
266 	{0x15, 0x01, 0x30, 0x30, "2"			},
267 	{0x15, 0x01, 0x30, 0x00, "3"			},
268 	{0x15, 0x01, 0x30, 0x20, "4"			},
269 	{0x15, 0x01, 0x30, 0x10, "5"			},
270 
271 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
272 	{0x15, 0x01, 0x40, 0x00, "Off"			},
273 	{0x15, 0x01, 0x40, 0x40, "On"			},
274 
275 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
276 	{0x15, 0x01, 0x80, 0x80, "No"			},
277 	{0x15, 0x01, 0x80, 0x00, "Yes"			},
278 
279 	{0   , 0xfe, 0   ,    5, "Region"		},
280     {0x16, 0x01, 0x07, 0x00, "Japan/Taito Corp"},
281     {0x16, 0x01, 0x07, 0x01, "US/Romstar"},
282     {0x16, 0x01, 0x07, 0x02, "World/Taito Corp"},
283     {0x16, 0x01, 0x07, 0x04, "US/Taito America"},
284 	{0x16, 0x01, 0x07, 0x06, "World/Taito America"},
285 };
286 
287 STDDIPINFO(Truxton)
288 
289 static struct BurnDIPInfo HellfireDIPList[]=
290 {
291 	{0x14, 0xff, 0xff, 0x00, NULL			},
292 	{0x15, 0xff, 0xff, 0x00, NULL			},
293 	{0x16, 0xff, 0xff, 0xf2, NULL			},
294 
295 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
296 	{0x14, 0x01, 0x02, 0x00, "Off"			},
297 	{0x14, 0x01, 0x02, 0x02, "On"			},
298 
299 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
300 	{0x14, 0x01, 0x04, 0x00, "Off"			},
301 	{0x14, 0x01, 0x04, 0x04, "On"			},
302 
303 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
304 	{0x14, 0x01, 0x08, 0x08, "Off"			},
305 	{0x14, 0x01, 0x08, 0x00, "On"			},
306 
307 	{0   , 0xfe, 0   ,    4, "Coin A"		},
308 	{0x14, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	}, // ok a,b
309 	{0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit"	},
310 	{0x14, 0x01, 0x30, 0x20, "3 Coins 1 Credit"	},
311 	{0x14, 0x01, 0x30, 0x30, "4 Coins 1 Credit"	},
312 
313 	{0   , 0xfe, 0   ,    4, "Coin B"		},
314 	{0x14, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
315 	{0x14, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
316 	{0x14, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
317 	{0x14, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
318 
319 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
320 	{0x15, 0x01, 0x03, 0x01, "Easy"			},
321 	{0x15, 0x01, 0x03, 0x00, "Normal"		},
322 	{0x15, 0x01, 0x03, 0x02, "Hard"			},
323 	{0x15, 0x01, 0x03, 0x03, "Very Hard"		},
324 
325 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
326 	{0x15, 0x01, 0x03, 0x00, "70k 270k 200k+"	},
327 	{0x15, 0x01, 0x03, 0x04, "100k 350k 250k+"	},
328 	{0x15, 0x01, 0x03, 0x08, "100k Only"		},
329 	{0x15, 0x01, 0x03, 0x0c, "200k Only"		},
330 
331 	{0   , 0xfe, 0   ,    4, "Lives"		},
332 	{0x15, 0x01, 0x30, 0x30, "2"			},
333 	{0x15, 0x01, 0x30, 0x00, "3"			},
334 	{0x15, 0x01, 0x30, 0x20, "4"			},
335 	{0x15, 0x01, 0x30, 0x10, "5"			},
336 
337 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
338 	{0x15, 0x01, 0x40, 0x00, "Off"			},
339 	{0x15, 0x01, 0x40, 0x40, "On"			},
340 
341 	{0   , 0xfe, 0   ,    3, "Region"		},
342 	{0x16, 0x01, 0x03, 0x02, "Europe"		},
343 	{0x16, 0x01, 0x03, 0x01, "USA"			},
344 	{0x16, 0x01, 0x03, 0x00, "Japan"		},
345 };
346 
347 STDDIPINFO(Hellfire)
348 
349 static struct BurnDIPInfo Hellfire1DIPList[] = {
350 	{0x14, 0xff, 0xff, 0x01, NULL			},
351 	{0x15, 0xff, 0xff, 0x00, NULL			},
352 
353 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
354 	{0x14, 0x01, 0x01, 0x01, "Upright"		},
355 	{0x14, 0x01, 0x01, 0x00, "Cocktail"		},
356 
357 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
358 	{0x15, 0x01, 0x40, 0x00, "Off"			},
359 	{0x15, 0x01, 0x40, 0x40, "On"			},
360 };
361 
362 STDDIPINFOEXT(Hellfire1, Hellfire,  Hellfire1)
363 
364 static struct BurnDIPInfo Hellfire2aDIPList[] = {
365 	{0x14, 0xff, 0xff, 0x01, NULL			},
366 	{0x15, 0xff, 0xff, 0x00, NULL			},
367 
368 	{0   , 0xfe, 0   ,    2, "Dip switch display"	},
369 	{0x15, 0x01, 0x40, 0x00, "Off"			},
370 	{0x15, 0x01, 0x40, 0x40, "On"			},
371 };
372 
373 STDDIPINFOEXT(Hellfire2a, Hellfire,  Hellfire2a)
374 
375 static struct BurnDIPInfo Hellfire1aDIPList[] = {
376 	{0x14, 0xff, 0xff, 0x01, NULL			},
377 	{0x15, 0xff, 0xff, 0x00, NULL			},
378 
379 	{0   , 0xfe, 0   ,    2, "Dip switch display"	},
380 	{0x15, 0x01, 0x40, 0x00, "Off"			},
381 	{0x15, 0x01, 0x40, 0x40, "On"			},
382 
383 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
384 	{0x15, 0x01, 0x80, 0x00, "Off"			},
385 	{0x15, 0x01, 0x80, 0x80, "On"			},
386 };
387 
388 STDDIPINFOEXT(Hellfire1a, Hellfire,  Hellfire1a)
389 
390 static struct BurnDIPInfo ZerowingDIPList[]=
391 {
392 	{0x14, 0xff, 0xff, 0x01, NULL			},
393 	{0x15, 0xff, 0xff, 0x00, NULL			},
394 	{0x16, 0xff, 0xff, 0xf3, NULL			},
395 
396 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
397 	{0x14, 0x01, 0x01, 0x01, "Upright"		},
398 	{0x14, 0x01, 0x01, 0x00, "Cocktail"		},
399 
400 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
401 	{0x14, 0x01, 0x02, 0x00, "Off"			},
402 	{0x14, 0x01, 0x02, 0x02, "On"			},
403 
404 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
405 	{0x14, 0x01, 0x04, 0x00, "Off"			},
406 	{0x14, 0x01, 0x04, 0x04, "On"			},
407 
408 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
409 	{0x14, 0x01, 0x08, 0x08, "Off"			},
410 	{0x14, 0x01, 0x08, 0x00, "On"			},
411 
412 	{0   , 0xfe, 0   ,    4, "Coin A"		},
413 	{0x14, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	},  // ok a,b
414 	{0x14, 0x01, 0x30, 0x10, "1 Coins 2 Credits"	},
415 	{0x14, 0x01, 0x30, 0x20, "2 Coins 1 Credit"	},
416 	{0x14, 0x01, 0x30, 0x30, "2 Coins 3 Credits"	},
417 
418 	{0   , 0xfe, 0   ,    3, "Coin B"		},
419 	{0x14, 0x01, 0xc0, 0x00, "1 Coin  1 Credit"	},
420 	{0x14, 0x01, 0xc0, 0x40, "1 Coin  2 Credits"	},
421 	{0x14, 0x01, 0xc0, 0x80, "2 Coins 1 Credit"	},
422 
423 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
424 	{0x15, 0x01, 0x03, 0x01, "Easy"			},
425 	{0x15, 0x01, 0x03, 0x00, "Normal"		},
426 	{0x15, 0x01, 0x03, 0x02, "Hard"			},
427 	{0x15, 0x01, 0x03, 0x03, "Very Hard"		},
428 
429 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
430 	{0x15, 0x01, 0x03, 0x00, "200k 700k 500k+"	},
431 	{0x15, 0x01, 0x03, 0x04, "500k 1500k 1000k+"	},
432 	{0x15, 0x01, 0x03, 0x08, "500k Only"		},
433 	{0x15, 0x01, 0x03, 0x0c, "None"			},
434 
435 	{0   , 0xfe, 0   ,    4, "Lives"		},
436 	{0x15, 0x01, 0x30, 0x30, "2"			},
437 	{0x15, 0x01, 0x30, 0x00, "3"			},
438 	{0x15, 0x01, 0x30, 0x20, "4"			},
439 	{0x15, 0x01, 0x30, 0x10, "5"			},
440 
441 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
442 	{0x15, 0x01, 0x40, 0x00, "Off"			},
443 	{0x15, 0x01, 0x40, 0x40, "On"			},
444 
445 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
446 	{0x15, 0x01, 0x80, 0x80, "No"			},
447 	{0x15, 0x01, 0x80, 0x00, "Yes"			},
448 
449 	{0   , 0xfe, 0   ,    3, "Region"		},
450 	{0x16, 0x01, 0x03, 0x03, "Europe"		},
451 	{0x16, 0x01, 0x03, 0x01, "USA"			},
452 	{0x16, 0x01, 0x03, 0x00, "Japan"		},
453 };
454 
455 STDDIPINFO(Zerowing)
456 
457 static struct BurnDIPInfo Zerowing2DIPList[] = {
458 	{0x14, 0xff, 0xff, 0x00, NULL			},
459 	{0x15, 0xff, 0xff, 0x00, NULL			},
460 	{0x16, 0xff, 0xff, 0x00, NULL			},
461 
462 	{0   , 0xfe, 0   ,    2, "Unused"		},
463 	{0x14, 0x01, 0x01, 0x01, "On"			},
464 	{0x14, 0x01, 0x01, 0x00, "Off"			},
465 
466 	{0   , 0xfe, 0   ,    2, "Unused"		},
467 	{0x15, 0x01, 0x80, 0x00, "Off"			},
468 	{0x15, 0x01, 0x80, 0x80, "On"			},
469 
470 	{0   , 0xfe, 0   ,    2, "Region"		},
471 	{0x16, 0x01, 0x03, 0x02, "Europe"		},
472 	{0x16, 0x01, 0x03, 0x00, "USA"			},
473 };
474 
475 STDDIPINFOEXT(Zerowing2, Zerowing,  Zerowing2)
476 
477 static struct BurnDIPInfo VimanaDIPList[]=
478 {
479 	{0x14, 0xff, 0xff, 0x01, NULL			},
480 	{0x15, 0xff, 0xff, 0x00, NULL			},
481 	{0x16, 0xff, 0xff, 0x02, NULL			},
482 
483 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
484 	{0x14, 0x01, 0x01, 0x01, "Upright"		},
485 	{0x14, 0x01, 0x01, 0x00, "Cocktail"		},
486 
487 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
488 	{0x14, 0x01, 0x02, 0x00, "Off"			},
489 	{0x14, 0x01, 0x02, 0x02, "On"			},
490 
491 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
492 	{0x14, 0x01, 0x04, 0x00, "Off"			},
493 	{0x14, 0x01, 0x04, 0x04, "On"			},
494 
495 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
496 	{0x14, 0x01, 0x08, 0x08, "Off"			},
497 	{0x14, 0x01, 0x08, 0x00, "On"			},
498 
499 	{0   , 0xfe, 0   ,    4, "Coin A"		},
500 	{0x14, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	},
501 	{0x14, 0x01, 0x30, 0x10, "2 Coins 1 Credit"	},
502 	{0x14, 0x01, 0x30, 0x20, "3 Coins 1 Credit"	},
503 	{0x14, 0x01, 0x30, 0x30, "4 Coins 1 Credit"	},  // a/b good.
504 
505 	{0   , 0xfe, 0   ,    4, "Coin B"		},
506 	{0x14, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
507 	{0x14, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
508 	{0x14, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
509 	{0x14, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
510 
511 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
512 	{0x15, 0x01, 0x03, 0x01, "Easy"			},
513 	{0x15, 0x01, 0x03, 0x00, "Normal"		},
514 	{0x15, 0x01, 0x03, 0x02, "Hard"			},
515 	{0x15, 0x01, 0x03, 0x03, "Very Hard"		},
516 
517 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
518 	{0x15, 0x01, 0x03, 0x00, "70k 270k 200k+"	},
519 	{0x15, 0x01, 0x03, 0x04, "100k 350k 250k+"	},
520 	{0x15, 0x01, 0x03, 0x08, "100k Only"		},
521 	{0x15, 0x01, 0x03, 0x0c, "200k Only"		},
522 
523 	{0   , 0xfe, 0   ,    4, "Lives"		},
524 	{0x15, 0x01, 0x30, 0x30, "2"			},
525 	{0x15, 0x01, 0x30, 0x00, "3"			},
526 	{0x15, 0x01, 0x30, 0x20, "4"			},
527 	{0x15, 0x01, 0x30, 0x10, "5"			},
528 
529 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
530 	{0x15, 0x01, 0x40, 0x00, "Off"			},
531 	{0x15, 0x01, 0x40, 0x40, "On"			},
532 
533 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
534 	{0x15, 0x01, 0x80, 0x80, "No"			},
535 	{0x15, 0x01, 0x80, 0x00, "Yes"			},
536 
537 	{0   , 0xfe, 0   ,    8, "Region"		},
538 	{0x16, 0x01, 0x0f, 0x02, "Europe"		},
539 	{0x16, 0x01, 0x0f, 0x01, "USA"			},
540 	{0x16, 0x01, 0x0f, 0x07, "USA (Romstar license)"},
541 	{0x16, 0x01, 0x0f, 0x04, "Korea"		},
542 	{0x16, 0x01, 0x0f, 0x03, "Hong Kong"		},
543 	{0x16, 0x01, 0x0f, 0x08, "Hong Kong (Honest Trading license)"	},
544 	{0x16, 0x01, 0x0f, 0x05, "Taiwan"		},
545 	{0x16, 0x01, 0x0f, 0x06, "Taiwan (Spacy license)"},
546 };
547 
548 STDDIPINFO(Vimana)
549 
550 static struct BurnDIPInfo VimananDIPList[] = {
551 	{0x16, 0xff, 0xff, 0x02, NULL			},
552 
553 	{0   , 0xfe, 0   ,    8, "Region"		},
554 	{0x16, 0x01, 0x0f, 0x02, "Europe (Nova Apparate license)" },
555 	{0x16, 0x01, 0x0f, 0x01, "USA"			},
556 	{0x16, 0x01, 0x0f, 0x07, "USA (Romstar license)"},
557 	{0x16, 0x01, 0x0f, 0x04, "Korea"		},
558 	{0x16, 0x01, 0x0f, 0x03, "Hong Kong"		},
559 	{0x16, 0x01, 0x0f, 0x08, "Hong Kong (Honest Trading license)" },
560 	{0x16, 0x01, 0x0f, 0x05, "Taiwan"		},
561 	{0x16, 0x01, 0x0f, 0x06, "Taiwan (Spacy license)"},
562 };
563 
564 STDDIPINFOEXT(Vimanan, Vimana,  Vimanan)
565 
566 static struct BurnDIPInfo VimanajDIPList[] = {
567 	{0x16, 0xff, 0xff, 0x00, NULL			},
568 
569 	{0   , 0xfe, 0   ,    8, "Region"		},
570 	{0x16, 0x01, 0x0f, 0x00, "Japan (distributed by Tecmo)" },
571 };
572 
573 STDDIPINFOEXT(Vimanaj, Vimana,  Vimanaj)
574 
575 static struct BurnDIPInfo DemonwldDIPList[]=
576 {
577 	{0x16, 0xff, 0xff, 0x00, NULL			},
578 	{0x17, 0xff, 0xff, 0x00, NULL			},
579 	{0x18, 0xff, 0xff, 0x01, NULL			},
580 
581 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
582 	{0x16, 0x01, 0x02, 0x00, "Off"			},
583 	{0x16, 0x01, 0x02, 0x02, "On"			},
584 
585 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
586 	{0x16, 0x01, 0x04, 0x00, "Off"			},
587 	{0x16, 0x01, 0x04, 0x04, "On"			},
588 
589 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
590 	{0x16, 0x01, 0x08, 0x08, "Off"			},
591 	{0x16, 0x01, 0x08, 0x00, "On"			},
592 
593 	{0   , 0xfe, 0   ,    4, "Coin A"		},
594 	{0x16, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	},     // ok a,b
595 	{0x16, 0x01, 0x30, 0x10, "1 Coin  2 Credits"	},
596 	{0x16, 0x01, 0x30, 0x20, "2 Coins 1 Credit"	},
597 	{0x16, 0x01, 0x30, 0x30, "2 Coins 3 Credits"	},
598 
599 	{0   , 0xfe, 0   ,    4, "Coin B"		},
600 	{0x16, 0x01, 0xc0, 0x00, "1 Coin  1 Credit"	},
601 	{0x16, 0x01, 0xc0, 0x40, "1 Coin  2 Credits"	},
602 	{0x16, 0x01, 0xc0, 0x80, "2 Coins 1 Credit"	},
603 	{0x16, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits"	},
604 
605 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
606 	{0x17, 0x01, 0x03, 0x01, "Easy"			},
607 	{0x17, 0x01, 0x03, 0x00, "Medium"		},
608 	{0x17, 0x01, 0x03, 0x02, "Hard"			},
609 	{0x17, 0x01, 0x03, 0x03, "Hardest"		},
610 
611 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
612 	{0x17, 0x01, 0x0c, 0x00, "30K, every 100K"	},
613 	{0x17, 0x01, 0x0c, 0x04, "50K and 100K"		},
614 	{0x17, 0x01, 0x0c, 0x08, "100K only"		},
615 	{0x17, 0x01, 0x0c, 0x0c, "None"			},
616 
617 	{0   , 0xfe, 0   ,    4, "Lives"		},
618 	{0x17, 0x01, 0x30, 0x30, "1"			},
619 	{0x17, 0x01, 0x30, 0x20, "2"			},
620 	{0x17, 0x01, 0x30, 0x00, "3"			},
621 	{0x17, 0x01, 0x30, 0x10, "5"			},
622 
623 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
624 	{0x17, 0x01, 0x40, 0x00, "Off"			},
625 	{0x17, 0x01, 0x40, 0x40, "On"			},
626 
627 	{0   , 0xfe, 0   ,    2, "Territory/Copyright"	},
628 	{0x18, 0x01, 0x01, 0x01, "Toaplan"		},
629 	{0x18, 0x01, 0x01, 0x00, "Japan/Taito Corp"	},
630 };
631 
632 STDDIPINFO(Demonwld)
633 
634 static struct BurnDIPInfo Demonwld1DIPList[] = {
635 	{0x18, 0xff, 0xff, 0x02, NULL			},
636 
637 	{0   , 0xfe, 0   ,    4, "Territory/Copyright"	},
638 	{0x18, 0x01, 0x03, 0x02, "World/Taito Japan"	},
639 	{0x18, 0x01, 0x03, 0x03, "US/Toaplan"		},
640 	{0x18, 0x01, 0x03, 0x01, "US/Taito America"	},
641 	{0x18, 0x01, 0x03, 0x00, "Japan/Taito Corp"	},
642 };
643 
644 STDDIPINFOEXT(Demonwld1, Demonwld, Demonwld1)
645 
646 static struct BurnDIPInfo OutzoneDIPList[]=
647 {
648 	{0x16, 0xff, 0xff, 0x00, NULL			},
649 	{0x17, 0xff, 0xff, 0x00, NULL			},
650 	{0x18, 0xff, 0xff, 0x02, NULL			},
651 
652 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
653 	{0x16, 0x01, 0x02, 0x00, "Off"			},
654 	{0x16, 0x01, 0x02, 0x02, "On"			},
655 
656 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
657 	{0x16, 0x01, 0x04, 0x00, "Off"			},
658 	{0x16, 0x01, 0x04, 0x04, "On"			},
659 
660 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
661 	{0x16, 0x01, 0x08, 0x08, "Off"			},
662 	{0x16, 0x01, 0x08, 0x00, "On"			},
663 
664 	{0   , 0xfe, 0   ,    4, "Coin A"		},
665 	{0x16, 0x01, 0x30, 0x00, "1 Coin  1 Credit"	},
666 	{0x16, 0x01, 0x30, 0x10, "2 Coins 1 Credit"	},   // ok a,b
667 	{0x16, 0x01, 0x30, 0x20, "3 Coins 1 Credit"	},
668 	{0x16, 0x01, 0x30, 0x30, "4 Coins 1 Credit"	},
669 
670 	{0   , 0xfe, 0   ,    4, "Coin B"		},
671 	{0x16, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
672 	{0x16, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
673 	{0x16, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
674 	{0x16, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
675 
676 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
677 	{0x17, 0x01, 0x03, 0x01, "Easy"			},
678 	{0x17, 0x01, 0x03, 0x00, "Normal"		},
679 	{0x17, 0x01, 0x03, 0x02, "Hard"			},
680 	{0x17, 0x01, 0x03, 0x03, "Very Hard"		},
681 
682 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
683 	{0x17, 0x01, 0x0c, 0x00, "Every 300k"		},
684 	{0x17, 0x01, 0x0c, 0x04, "200k and 500k"	},
685 	{0x17, 0x01, 0x0c, 0x08, "300k Only"		},
686 	{0x17, 0x01, 0x0c, 0x0c, "None"			},
687 
688 	{0   , 0xfe, 0   ,    4, "Lives"		},
689 	{0x17, 0x01, 0x30, 0x30, "1"			},
690 	{0x17, 0x01, 0x30, 0x20, "2"			},
691 	{0x17, 0x01, 0x30, 0x00, "3"			},
692 	{0x17, 0x01, 0x30, 0x10, "5"			},
693 
694 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
695 	{0x17, 0x01, 0x40, 0x00, "Off"			},
696 	{0x17, 0x01, 0x40, 0x40, "On"			},
697 
698 	{0   , 0xfe, 0   ,    0, "Region"		},
699 	{0x18, 0x01, 0x0f, 0x00, "Japan"		},
700 	{0x18, 0x01, 0x0f, 0x01, "USA"			},
701 	{0x18, 0x01, 0x0f, 0x02, "Europe"		},
702 	{0x18, 0x01, 0x0f, 0x03, "Hong Kong"		},
703 	{0x18, 0x01, 0x0f, 0x04, "Korea"		},
704 	{0x18, 0x01, 0x0f, 0x05, "Taiwan"		},
705 	{0x18, 0x01, 0x0f, 0x06, "Taiwan (Spacy Co., Ltd.)"	},
706 	{0x18, 0x01, 0x0f, 0x07, "USA (Romstar, Inc.)"		},
707 	{0x18, 0x01, 0x0f, 0x08, "Hong Kong & China (Honest Trading Co.)"	},
708 };
709 
710 STDDIPINFO(Outzone)
711 
712 static struct BurnDIPInfo OutzoneaDIPList[] = {
713 	{0x18, 0xff, 0xff, 0x02, NULL			},
714 
715 	{0   , 0xfe, 0   ,    4, "Territory/Copyright"	},
716 	{0x18, 0x01, 0x03, 0x02, "World/Taito Japan"	},
717 	{0x18, 0x01, 0x03, 0x03, "US/Toaplan"		},
718 	{0x18, 0x01, 0x03, 0x01, "US/Taito America"	},
719 	{0x18, 0x01, 0x03, 0x00, "Japan/Taito Corp"	},
720 };
721 
722 STDDIPINFOEXT(Outzonea, Outzone, Outzonea)
723 
724 static struct BurnDIPInfo OutzonecDIPList[] = {
725 	{0x18, 0xff, 0xff, 0x02, NULL			},
726 
727 	{0   , 0xfe, 0   ,    0, "Region"		},
728 	{0x18, 0x01, 0x07, 0x00, "Japan"		},
729 	{0x18, 0x01, 0x07, 0x01, "USA"			},
730 	{0x18, 0x01, 0x07, 0x02, "Europe"		},
731 	{0x18, 0x01, 0x07, 0x03, "Hong Kong"		},
732 	{0x18, 0x01, 0x07, 0x04, "Korea"		},
733 	{0x18, 0x01, 0x07, 0x05, "Taiwan"		},
734 	{0x18, 0x01, 0x07, 0x06, "World"		},
735 };
736 
737 STDDIPINFOEXT(Outzonec, Outzone, Outzonec)
738 
739 static struct BurnDIPInfo FireshrkDIPList[]=
740 {
741 	{0x13, 0xff, 0xff, 0x01, NULL			},
742 	{0x14, 0xff, 0xff, 0x00, NULL			},
743 	{0x15, 0xff, 0xff, 0x02, NULL			},
744 
745 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
746 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
747 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
748 
749 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
750 	{0x13, 0x01, 0x02, 0x00, "Off"			},
751 	{0x13, 0x01, 0x02, 0x02, "On"			},
752 
753 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
754 	{0x13, 0x01, 0x08, 0x08, "Off"			},
755 	{0x13, 0x01, 0x08, 0x00, "On"			},
756 
757 	{0   , 0xfe, 0   ,    4, "Coin A"		},
758 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},  // good a,b
759 	{0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits"	},
760 	{0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits"	},
761 	{0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits"	},
762 
763 	{0   , 0xfe, 0   ,    4, "Coin B"		},
764 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
765 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
766 	{0x13, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
767 	{0x13, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
768 
769 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
770 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
771 	{0x14, 0x01, 0x03, 0x00, "Medium"		},
772 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
773 	{0x14, 0x01, 0x03, 0x03, "Hardest"		},
774 
775 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
776 	{0x14, 0x01, 0x0c, 0x04, "50K, every 150K"	},
777 	{0x14, 0x01, 0x0c, 0x00, "70K, every 200K"	},
778 	{0x14, 0x01, 0x0c, 0x08, "100K"			},
779 	{0x14, 0x01, 0x0c, 0x0c, "None"			},
780 
781 	{0   , 0xfe, 0   ,    4, "Lives"		},
782 	{0x14, 0x01, 0x30, 0x30, "2"			},
783 	{0x14, 0x01, 0x30, 0x00, "3"			},
784 	{0x14, 0x01, 0x30, 0x20, "4"			},
785 	{0x14, 0x01, 0x30, 0x10, "5"			},
786 
787 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
788 	{0x14, 0x01, 0x40, 0x00, "Off"			},
789 	{0x14, 0x01, 0x40, 0x40, "On"			},
790 
791 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
792 	{0x14, 0x01, 0x80, 0x80, "No"			},
793 	{0x14, 0x01, 0x80, 0x00, "Yes"			},
794 
795 	{0   , 0xfe, 0   ,    3, "Region"		},
796 	{0x15, 0x01, 0x07, 0x02, "Europe"		},
797 	{0x15, 0x01, 0x07, 0x04, "USA"			},
798 	{0x15, 0x01, 0x07, 0x00, "USA (Romstar)"	},
799 };
800 
801 STDDIPINFO(Fireshrk)
802 
803 static struct BurnDIPInfo FireshrkaDIPList[] = {
804 	{0x15, 0xff, 0xff, 0x03, NULL			},
805 
806 	{0   , 0xfe, 0   ,    2, "Region"		},
807 	{0x15, 0x01, 0x07, 0x03, "Europe"		},
808 	{0x15, 0x01, 0x07, 0x00, "USA"			},
809 };
810 
811 STDDIPINFOEXT(Fireshrka, Fireshrk, Fireshrka)
812 
813 static struct BurnDIPInfo SamesameDIPList[] = {
814 	{0x13, 0xff, 0xff, 0x01, NULL			},
815 	{0x14, 0xff, 0xff, 0x00, NULL			},
816 	{0x15, 0xff, 0xff, 0x00, NULL			},
817 
818 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
819 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
820 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
821 
822 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
823 	{0x13, 0x01, 0x02, 0x00, "Off"			},
824 	{0x13, 0x01, 0x02, 0x02, "On"			},
825 
826 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
827 	{0x13, 0x01, 0x08, 0x08, "Off"			},
828 	{0x13, 0x01, 0x08, 0x00, "On"			},
829 
830 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
831 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
832 	{0x14, 0x01, 0x03, 0x00, "Medium"		},
833 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
834 	{0x14, 0x01, 0x03, 0x03, "Hardest"		},
835 
836 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
837 	{0x14, 0x01, 0x0c, 0x04, "50K, every 150K"	},
838 	{0x14, 0x01, 0x0c, 0x00, "70K, every 200K"	},
839 	{0x14, 0x01, 0x0c, 0x08, "100K"			},
840 	{0x14, 0x01, 0x0c, 0x0c, "None"			},
841 
842 	{0   , 0xfe, 0   ,    4, "Lives"		},
843 	{0x14, 0x01, 0x30, 0x30, "2"			},
844 	{0x14, 0x01, 0x30, 0x00, "3"			},
845 	{0x14, 0x01, 0x30, 0x20, "4"			},
846 	{0x14, 0x01, 0x30, 0x10, "5"			},
847 
848 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
849 	{0x14, 0x01, 0x40, 0x00, "Off"			},
850 	{0x14, 0x01, 0x40, 0x40, "On"			},
851 
852 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
853 	{0x14, 0x01, 0x80, 0x80, "No"			},
854 	{0x14, 0x01, 0x80, 0x00, "Yes"			},
855 };
856 
857 STDDIPINFO(Samesame)
858 
859 static struct BurnDIPInfo Samesame2DIPList[]=
860 {
861 	{0x13, 0xff, 0xff, 0x00, NULL			},
862 	{0x14, 0xff, 0xff, 0x00, NULL			},
863 	{0x15, 0xff, 0xff, 0x00, NULL			},
864 
865 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
866 	{0x13, 0x01, 0x02, 0x00, "Off"			},
867 	{0x13, 0x01, 0x02, 0x02, "On"			},
868 
869 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
870 	{0x13, 0x01, 0x08, 0x08, "Off"			},
871 	{0x13, 0x01, 0x08, 0x00, "On"			},
872 
873 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
874 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
875 	{0x14, 0x01, 0x03, 0x00, "Medium"		},
876 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
877 	{0x14, 0x01, 0x03, 0x03, "Hardest"		},
878 
879 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
880 	{0x14, 0x01, 0x0c, 0x04, "50K, every 150K"	},
881 	{0x14, 0x01, 0x0c, 0x00, "70K, every 200K"	},
882 	{0x14, 0x01, 0x0c, 0x08, "100K"			},
883 	{0x14, 0x01, 0x0c, 0x0c, "None"			},
884 
885 	{0   , 0xfe, 0   ,    4, "Lives"		},
886 	{0x14, 0x01, 0x30, 0x30, "2"			},
887 	{0x14, 0x01, 0x30, 0x00, "3"			},
888 	{0x14, 0x01, 0x30, 0x20, "4"			},
889 	{0x14, 0x01, 0x30, 0x10, "5"			},
890 
891 	{0   , 0xfe, 0   ,    2, "Invulnerability"	},
892 	{0x14, 0x01, 0x40, 0x00, "Off"			},
893 	{0x14, 0x01, 0x40, 0x40, "On"			},
894 
895 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
896 	{0x14, 0x01, 0x80, 0x80, "No"			},
897 	{0x14, 0x01, 0x80, 0x00, "Yes"			},
898 
899 	{0   , 0xfe, 0   ,    2, "Show Territory Notice"},
900 	{0x15, 0x01, 0x01, 0x01, "No"			},
901 	{0x15, 0x01, 0x01, 0x00, "Yes"			},
902 };
903 
STDDIPINFO(Samesame2)904 STDDIPINFO(Samesame2)
905 
906 static void __fastcall rallybik_main_write_word(UINT32 address, UINT16 data)
907 {
908 	switch (address)
909 	{
910 		case 0x1c8000:
911 			if (data == 0) {
912 				ZetReset();
913 				BurnYM3812Reset();
914 			}
915 		return;
916 	}
917 
918 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address, data);
919 }
920 
truxton_main_write_word(UINT32 address,UINT16 data)921 static void __fastcall truxton_main_write_word(UINT32 address, UINT16 data)
922 {
923 	switch (address)
924 	{
925 		case 0x1d0000:
926 			if (data == 0) {
927 				ZetReset();
928 				BurnYM3812Reset();
929 			}
930 		return;
931 	}
932 
933 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address, data);
934 }
935 
hellfire_main_write_word(UINT32 address,UINT16 data)936 static void __fastcall hellfire_main_write_word(UINT32 address, UINT16 data)
937 {
938 	switch (address)
939 	{
940 		case 0x180000:
941 			tiles_offsets_x = data;
942 		return;
943 
944 		case 0x180002:
945 			tiles_offsets_y = data;
946 		return;
947 
948 		case 0x180006:
949 			sprite_flipscreen = data & 0x8000;
950 		return;
951 
952 		case 0x180008:
953 			if (data == 0) {
954 				ZetReset();
955 				BurnYM3812Reset();
956 			}
957 		return;
958 	}
959 
960 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address, data);
961 }
962 
demonwld_dsp(INT32 enable)963 static void demonwld_dsp(INT32 enable)
964 {
965 	enable ^= 1;
966 	dsp_on = enable;
967 
968 	if (enable)
969 	{
970 		tms32010_set_irq_line(0, CPU_IRQSTATUS_ACK);
971 		m68k_halt = 1;
972 		SekRunEnd();
973 	}
974 	else
975 	{
976 		tms32010_set_irq_line(0, CPU_IRQSTATUS_NONE);
977 		tms32010RunEnd();
978 	}
979 }
980 
demonwld_main_write_word(UINT32 address,UINT16 data)981 static void __fastcall demonwld_main_write_word(UINT32 address, UINT16 data)
982 {
983 	switch (address)
984 	{
985 		case 0xe00000:
986 			tiles_offsets_x = data;
987 		return;
988 
989 		case 0xe00002:
990 			tiles_offsets_y = data;
991 		return;
992 
993 		case 0xe00006:
994 			sprite_flipscreen = data & 0x8000;
995 		return;
996 
997 		case 0xe00008:
998 			if (data == 0) {
999 				ZetReset();
1000 				BurnYM3812Reset();
1001 			}
1002 		return;
1003 
1004 		case 0xe0000a:
1005 			if (data < 2) demonwld_dsp(data & 1);
1006 		return;
1007 	}
1008 }
1009 
samesame_main_read_word(UINT32 address)1010 static UINT16 __fastcall samesame_main_read_word(UINT32 address)
1011 {
1012 	switch (address)
1013 	{
1014 		case 0x140000:
1015 			return DrvInputs[0];
1016 
1017 		case 0x140002:
1018 			return DrvInputs[1];
1019 
1020 		case 0x140004:
1021 			return DrvDips[0];
1022 
1023 		case 0x140006:
1024 			return DrvDips[1];
1025 
1026 		case 0x140008:
1027 			return (DrvInputs[2] & 0x7f) | (vblank ? 0x80 : 0);
1028 
1029 		case 0x14000a:
1030 			return DrvDips[2] | 0x80;
1031 
1032 		case 0x14000e:
1033 			return 0; // mcu read?
1034 	}
1035 
1036 	bprintf (0, _T("MRW: %5.5x\n"), address);
1037 
1038 	return 0;
1039 }
1040 
samesame_main_read_byte(UINT32 address)1041 static UINT8 __fastcall samesame_main_read_byte(UINT32 address)
1042 {
1043 	switch (address)
1044 	{
1045 		case 0x140005:
1046 			return DrvDips[0];
1047 
1048 		case 0x140007:
1049 			return DrvDips[1];
1050 
1051 		case 0x140009:
1052 			return (DrvInputs[2] & 0x7f) | (vblank ? 0x80 : 0);
1053 
1054 		case 0x14000b:
1055 			return DrvDips[2] | 0x80;
1056 	}
1057 
1058 	bprintf (0, _T("RB: %5.5x\n"), address);
1059 
1060 	return 0;
1061 }
1062 
samesame_main_write_word(UINT32 address,UINT16 data)1063 static void __fastcall samesame_main_write_word(UINT32 address, UINT16 data)
1064 {
1065 	switch (address)
1066 	{
1067 		case 0x14000c:
1068 			// coin counter / lockout
1069 		return;
1070 
1071 		case 0x14000e:
1072 			soundlatch = data;
1073 			mcu_command = 1;
1074 		return;
1075 	}
1076 
1077 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address,data);
1078 }
1079 
toaplan1_main_read_word(UINT32 address)1080 static UINT16 __fastcall toaplan1_main_read_word(UINT32 address)
1081 {
1082 	bprintf (0, _T("MRW: %5.5x\n"), address);
1083 
1084 	return 0;
1085 }
1086 
toaplan1_main_read_byte(UINT32 address)1087 static UINT8 __fastcall toaplan1_main_read_byte(UINT32 address)
1088 {
1089 	bprintf (0, _T("MRB: %5.5x\n"), address);
1090 
1091 	return 0;
1092 }
1093 
toaplan1_main_write_word(UINT32 address,UINT16 data)1094 static void __fastcall toaplan1_main_write_word(UINT32 address, UINT16 data)
1095 {
1096 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address, data);
1097 }
1098 
toaplan1_main_write_byte(UINT32 address,UINT8 data)1099 static void __fastcall toaplan1_main_write_byte(UINT32 address, UINT8 data)
1100 {
1101 	bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data);
1102 }
1103 
toaplan1_miscctrl2_write_word(UINT32 address,UINT16 data)1104 static void __fastcall toaplan1_miscctrl2_write_word(UINT32 address, UINT16 data)
1105 {
1106 	switch (address & 0x0006)
1107 	{
1108 		case 0x0000:
1109 			tiles_offsets_x = data;
1110 		return;
1111 
1112 		case 0x0002:
1113 			tiles_offsets_y = data;
1114 		return;
1115 
1116 		case 0x0006:
1117 			sprite_flipscreen = data & 0x8000;
1118 		return;
1119 	}
1120 }
1121 
toaplan1_miscctrl2_write_byte(UINT32 address,UINT8 data)1122 static void __fastcall toaplan1_miscctrl2_write_byte(UINT32 address, UINT8 data)
1123 {
1124 	bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data);
1125 }
1126 
toaplan1_miscctrl_read_word(UINT32 address)1127 static UINT16 __fastcall toaplan1_miscctrl_read_word(UINT32 address)
1128 {
1129 	switch (address & 0x03fe)
1130 	{
1131 		case 0x0000:
1132 			return (vblank ? 0x01 : 0);
1133 	}
1134 
1135 	return 0;
1136 }
1137 
toaplan1_miscctrl_read_byte(UINT32 address)1138 static UINT8 __fastcall toaplan1_miscctrl_read_byte(UINT32 address)
1139 {
1140 	switch (address & 0x03ff)
1141 	{
1142 		case 0x0001:
1143 			return (vblank ? 0x01 : 0);
1144 	}
1145 
1146 	return 0;
1147 }
1148 
toaplan1_miscctrl_write_word(UINT32 address,UINT16 data)1149 static void __fastcall toaplan1_miscctrl_write_word(UINT32 address, UINT16 data)
1150 {
1151 	switch (address & 0x000e)
1152 	{
1153 		case 0x0000:
1154 			// video frame related?
1155 		return;
1156 
1157 		case 0x0002:
1158 			interrupt_enable = data & 0xff;
1159 		return;
1160 
1161 		case 0x0008: // controls refresh rate, screen dimensions
1162 		case 0x000a:
1163 		case 0x000c:
1164 		case 0x000e:
1165 		//	bprintf (0, _T("BCU CONTROL: %5.5x, %4.4x\n"), address, data);
1166 		return;
1167 	}
1168 
1169 	bprintf (0, _T("MWW: %5.5x, %4.4x\n"), address, data);
1170 }
1171 
toaplan1_miscctrl_write_byte(UINT32 address,UINT8 data)1172 static void __fastcall toaplan1_miscctrl_write_byte(UINT32 address, UINT8 data)
1173 {
1174 	switch (address & 0x000f)
1175 	{
1176 		case 0x0001:
1177 			// video frame related?
1178 		return;
1179 	}
1180 
1181 	bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data);
1182 }
1183 
toaplan1_tilemap_read_word(UINT32 address)1184 static UINT16 __fastcall toaplan1_tilemap_read_word(UINT32 address)
1185 {
1186 	switch (address & 0x001e)
1187 	{
1188 		case 0x0002:
1189 			return tileram_offs;
1190 
1191 		case 0x0004:
1192 		{
1193 			UINT16 ret = *((UINT16*)(DrvVidRAM + ((tileram_offs & 0x3fff) * 4)));
1194 
1195 			// rallybik (doesn't seem to affect other games)
1196 			ret |= ((ret & 0xf000) >> 4);
1197 			ret |= ((ret & 0x0030) << 2);
1198 
1199 			return ret;
1200 		}
1201 
1202 		case 0x0006:
1203 			return *((UINT16*)(DrvVidRAM + ((tileram_offs & 0x3fff) * 4) + (address & 2)));
1204 
1205 		case 0x0010:
1206 		case 0x0012:
1207 		case 0x0014:
1208 		case 0x0016:
1209 		case 0x0018:
1210 		case 0x001a:
1211 		case 0x001c:
1212 		case 0x001e:
1213 			return scroll[(address / 2) & 7];
1214 	}
1215 
1216 	return 0;
1217 }
1218 
toaplan1_tilemap_read_byte(UINT32 address)1219 static UINT8 __fastcall toaplan1_tilemap_read_byte(UINT32 address)
1220 {
1221 	bprintf (0, _T("MRB: %5.5x\n"), address);
1222 	return 0;
1223 }
1224 
toaplan1_tilemap_write_word(UINT32 address,UINT16 data)1225 static void __fastcall toaplan1_tilemap_write_word(UINT32 address, UINT16 data)
1226 {
1227 	switch (address & 0x001e)
1228 	{
1229 		case 0x0000:
1230 			flipscreen = data & 0x01;
1231 		return;
1232 
1233 		case 0x0002:
1234 			tileram_offs = data;
1235 		return;
1236 
1237 		case 0x0004:
1238 		case 0x0006:
1239 			*((UINT16*)(DrvVidRAM + ((tileram_offs & 0x3fff) * 4) + (address & 2))) = data;
1240 		return;
1241 
1242 		case 0x0010:
1243 		case 0x0012:
1244 		case 0x0014:
1245 		case 0x0016:
1246 		case 0x0018:
1247 		case 0x001a:
1248 		case 0x001c:
1249 		case 0x001e:
1250 			scroll[(address / 2) & 7] = data;
1251 		return;
1252 	}
1253 }
1254 
toaplan1_tilemap_write_byte(UINT32 address,UINT8 data)1255 static void __fastcall toaplan1_tilemap_write_byte(UINT32 address, UINT8 data)
1256 {
1257 	bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data);
1258 }
1259 
toaplan1_spriteram_read_word(UINT32 address)1260 static UINT16 __fastcall toaplan1_spriteram_read_word(UINT32 address)
1261 {
1262 	switch (address & 0x0006)
1263 	{
1264 		case 0x0002:
1265 			return spriteram_offset;
1266 
1267 		case 0x0004:
1268 		{
1269 			UINT16 *spriteram = (UINT16*)DrvSprRAM;
1270 			UINT16 ret = spriteram[spriteram_offset & 0x7ff];
1271 			spriteram_offset++;
1272 			return ret;
1273 		}
1274 
1275 		case 0x0006:
1276 		{
1277 			UINT16 *spritesizeram = (UINT16*)DrvSprSizeRAM;
1278 			UINT16 ret = spritesizeram[spriteram_offset & 0x3f];
1279 			spriteram_offset++;
1280 			return ret;
1281 		}
1282 	}
1283 
1284 	return 0;
1285 }
1286 
toaplan1_spriteram_read_byte(UINT32 address)1287 static UINT8 __fastcall toaplan1_spriteram_read_byte(UINT32 address)
1288 {
1289 	switch (address & 0x0007)
1290 	{
1291 		case 0x0001:
1292 			return (vblank ? 0x01 : 0);
1293 	}
1294 
1295 	bprintf (0, _T("MRB: %5.5x\n"), address);
1296 
1297 	return 0;
1298 }
1299 
toaplan1_spriteram_write_word(UINT32 address,UINT16 data)1300 static void __fastcall toaplan1_spriteram_write_word(UINT32 address, UINT16 data)
1301 {
1302 	switch (address & 0x0006)
1303 	{
1304 		case 0x0002:
1305 			spriteram_offset = data;
1306 		return;
1307 
1308 		case 0x0004:
1309 		{
1310 			UINT16 *spriteram = (UINT16*)DrvSprRAM;
1311 			spriteram[spriteram_offset & 0x7ff] = data;
1312 			spriteram_offset++;
1313 		}
1314 		return;
1315 
1316 		case 0x0006:
1317 		{
1318 			UINT16 *spritesizeram = (UINT16*)DrvSprSizeRAM;
1319 			spritesizeram[spriteram_offset & 0x3f] = data;
1320 			spriteram_offset++;
1321 		}
1322 		return;
1323 	}
1324 }
1325 
toaplan1_spriteram_write_byte(UINT32 address,UINT8 data)1326 static void __fastcall toaplan1_spriteram_write_byte(UINT32 address, UINT8 data)
1327 {
1328 	bprintf (0, _T("MWB: %5.5x, %2.2x\n"), address, data);
1329 }
1330 
update_palette(INT32 offset)1331 static inline void update_palette(INT32 offset)
1332 {
1333 	UINT16 p = *((UINT16*)(DrvPalRAM + offset * 2));
1334 
1335 	UINT8 r = (p >>  0) & 0x1f;
1336 	UINT8 g = (p >>  5) & 0x1f;
1337 	UINT8 b = (p >> 10) & 0x1f;
1338 
1339 	r = (r << 3) | (r >> 2);
1340 	g = (g << 3) | (g >> 2);
1341 	b = (b << 3) | (b >> 2);
1342 
1343 	DrvPalette[offset] = BurnHighCol(r,g,b,0);
1344 }
1345 
toaplan1_palette_write_word(UINT32 address,UINT16 data)1346 static void __fastcall toaplan1_palette_write_word(UINT32 address, UINT16 data)
1347 {
1348 	UINT16 *p = (UINT16*)DrvPalRAM;
1349 	INT32 offset = ((address & 0x7ff) / 2) + ((address & 0x2000) >> 3);
1350 	p[offset] = data;
1351 	update_palette(offset);
1352 }
1353 
toaplan1_palette_write_byte(UINT32 address,UINT8 data)1354 static void __fastcall toaplan1_palette_write_byte(UINT32 address, UINT8 data)
1355 {
1356 	INT32 offset = (address & 0x7ff) + ((address & 0x2000) >> 2);
1357 	DrvPalRAM[offset] = data;
1358 	update_palette(offset/2);
1359 }
1360 
toaplan1_shareram_write_word(UINT32 address,UINT16 data)1361 static void __fastcall toaplan1_shareram_write_word(UINT32 address, UINT16 data)
1362 {
1363 	DrvShareRAM[(address / 2) & 0x7ff] = data;
1364 }
1365 
toaplan1_shareram_write_byte(UINT32 address,UINT8 data)1366 static void __fastcall toaplan1_shareram_write_byte(UINT32 address, UINT8 data)
1367 {
1368 	DrvShareRAM[(address / 2) & 0x7ff] = data;
1369 }
1370 
toaplan1_shareram_read_word(UINT32 address)1371 static UINT16 __fastcall toaplan1_shareram_read_word(UINT32 address)
1372 {
1373 	return DrvShareRAM[(address / 2) & 0x7ff];
1374 }
1375 
toaplan1_shareram_read_byte(UINT32 address)1376 static UINT8 __fastcall toaplan1_shareram_read_byte(UINT32 address)
1377 {
1378 	return DrvShareRAM[(address / 2) & 0x7ff];
1379 }
1380 
demonwld_dsp_w(UINT16 data)1381 static void demonwld_dsp_w(UINT16 data)
1382 {
1383 	dsp_execute = 0;
1384 
1385 	if (main_ram_seg == 0xc00000)
1386 	{
1387 		if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1;
1388 
1389 		SekWriteWord(main_ram_seg + dsp_addr_w, data);
1390 	}
1391 }
1392 
demonwld_dsp_bio_w(UINT16 data)1393 static void demonwld_dsp_bio_w(UINT16 data)
1394 {
1395 	if (data & 0x8000)
1396 	{
1397 		dsp_BIO = 0;
1398 	}
1399 
1400 	if (data == 0)
1401 	{
1402 		if (dsp_execute)
1403 		{
1404 			m68k_halt = 0;
1405 			dsp_execute = 0;
1406 		}
1407 
1408 		dsp_BIO = 1;
1409 	}
1410 }
1411 
dsp_write(INT32 port,UINT16 data)1412 static void dsp_write(INT32 port, UINT16 data)
1413 {
1414 	switch (port)
1415 	{
1416 		case 0x00:
1417 			main_ram_seg = ((data & 0xe000) << 9);
1418 			dsp_addr_w   = ((data & 0x1fff) << 1);
1419 		return;
1420 
1421 		case 0x01: demonwld_dsp_w(data); return;
1422 		case 0x03: demonwld_dsp_bio_w(data); return;
1423 	}
1424 }
1425 
dsp_read(INT32 port)1426 static UINT16 dsp_read(INT32 port)
1427 {
1428 	switch (port)
1429 	{
1430 		case 0x01: return SekReadWord(main_ram_seg + dsp_addr_w);
1431 		case 0x10: return dsp_BIO;
1432 	}
1433 
1434 	return 0;
1435 }
1436 
rallybik_sound_write_port(UINT16 port,UINT8 data)1437 static void __fastcall rallybik_sound_write_port(UINT16 port, UINT8 data)
1438 {
1439 	switch (port & 0xff)
1440 	{
1441 		case 0x30:
1442 			// coin counter / lockout
1443 		return;
1444 
1445 		case 0x60:
1446 		case 0x61:
1447 			BurnYM3812Write(0, port & 1, data);
1448 		return;
1449 	}
1450 }
1451 
rallybik_sound_read_port(UINT16 port)1452 static UINT8 __fastcall rallybik_sound_read_port(UINT16 port)
1453 {
1454 	switch (port & 0xff)
1455 	{
1456 		case 0x00:
1457 		case 0x10:
1458 		case 0x20:
1459 			return DrvInputs[(port >> 4) & 3];
1460 
1461 		case 0x40:
1462 		case 0x50:
1463 			return DrvDips[(port >> 4) & 1];
1464 
1465 		case 0x60:
1466 			return BurnYM3812Read(0, 0);
1467 
1468 		case 0x70: // truxton
1469 			return DrvDips[2];
1470 	}
1471 
1472 	return 0;
1473 }
1474 
hellfire_sound_write_port(UINT16 port,UINT8 data)1475 static void __fastcall hellfire_sound_write_port(UINT16 port, UINT8 data)
1476 {
1477 	switch (port & 0xff)
1478 	{
1479 		case 0x30:
1480 			// coin counter / lockout
1481 		return;
1482 
1483 		case 0x70:
1484 		case 0x71:
1485 			BurnYM3812Write(0, port & 1, data);
1486 		return;
1487 	}
1488 }
1489 
hellfire_sound_read_port(UINT16 port)1490 static UINT8 __fastcall hellfire_sound_read_port(UINT16 port)
1491 {
1492 	switch (port & 0xff)
1493 	{
1494 		case 0x00:
1495 		case 0x10:
1496 			return DrvDips[(port >> 4) & 1];
1497 
1498 		case 0x20:
1499 			return DrvDips[2];
1500 
1501 		case 0x40:
1502 		case 0x50:
1503 		case 0x60:
1504 			return DrvInputs[(port >> 4) & 3];
1505 
1506 		case 0x70:
1507 			return BurnYM3812Read(0, 0);
1508 	}
1509 
1510 	return 0;
1511 }
1512 
zerowing_sound_write_port(UINT16 port,UINT8 data)1513 static void __fastcall zerowing_sound_write_port(UINT16 port, UINT8 data)
1514 {
1515 	switch (port & 0xff)
1516 	{
1517 		case 0xa0:
1518 			// coin counter / lockout
1519 		return;
1520 
1521 		case 0xa8:
1522 		case 0xa9:
1523 			BurnYM3812Write(0, port & 1, data);
1524 		return;
1525 	}
1526 }
1527 
zerowing_sound_read_port(UINT16 port)1528 static UINT8 __fastcall zerowing_sound_read_port(UINT16 port)
1529 {
1530 	switch (port & 0xff)
1531 	{
1532 		case 0x00:
1533 		case 0x08:
1534 			return DrvInputs[(port >> 3) & 1];
1535 
1536 		case 0x20:
1537 		case 0x28:
1538 			return DrvDips[(port >> 3) & 1];
1539 
1540 		case 0x80:
1541 			return DrvInputs[2];
1542 
1543 		case 0x88:
1544 			return DrvDips[2];
1545 
1546 		case 0xa8:
1547 			return BurnYM3812Read(0, 0);
1548 	}
1549 
1550 	return 0;
1551 }
1552 
outzone_sound_write_port(UINT16 port,UINT8 data)1553 static void __fastcall outzone_sound_write_port(UINT16 port, UINT8 data)
1554 {
1555 	switch (port & 0xff)
1556 	{
1557 		case 0x00:
1558 		case 0x01:
1559 			BurnYM3812Write(0, port & 1, data);
1560 		return;
1561 
1562 		case 0x04:
1563 			// coin counter / lockout
1564 		return;
1565 	}
1566 }
1567 
outzone_sound_read_port(UINT16 port)1568 static UINT8 __fastcall outzone_sound_read_port(UINT16 port)
1569 {
1570 	switch (port & 0xff)
1571 	{
1572 		case 0x00:
1573 			return BurnYM3812Read(0, 0);
1574 
1575 		case 0x08:
1576 		case 0x0c:
1577 			return DrvDips[(port >> 2) & 1];
1578 
1579 		case 0x10:
1580 			return DrvInputs[2];
1581 
1582 		case 0x14:
1583 		case 0x18:
1584 			return DrvInputs[(port >> 3) & 1];
1585 
1586 		case 0x1c:
1587 			return DrvDips[2];
1588 	}
1589 
1590 	return 0;
1591 }
1592 
vimana_sound_write_port(UINT16 port,UINT8 data)1593 static void __fastcall vimana_sound_write_port(UINT16 port, UINT8 data)
1594 {
1595 	switch (port & 0xff)
1596 	{
1597 		case 0x84:
1598 			// coin counter / lockout
1599 		return;
1600 
1601 		case 0x87:
1602 		case 0x8f:
1603 			BurnYM3812Write(0, (port >> 3) & 1, data);
1604 		return;
1605 	}
1606 }
1607 
vimana_sound_read_port(UINT16 port)1608 static UINT8 __fastcall vimana_sound_read_port(UINT16 port)
1609 {
1610 	switch (port & 0xff)
1611 	{
1612 		case 0x87:
1613 			return BurnYM3812Read(0, 0);
1614 
1615 		case 0x60:
1616 			return DrvDips[1] ^ 0xff;
1617 
1618 		case 0x66:
1619 			return DrvDips[2] ^ 0xff;
1620 
1621 		case 0x82:
1622 			return DrvDips[0];
1623 
1624 		case 0x83:
1625 			return DrvInputs[2];
1626 
1627 		case 0x80:
1628 		case 0x81:
1629 			return DrvInputs[port & 1];
1630 	}
1631 
1632 	return 0;
1633 }
1634 
samesame_sound_write_port(UINT16 port,UINT8 data)1635 static void __fastcall samesame_sound_write_port(UINT16 port, UINT8 data)
1636 {
1637 	switch (port & 0xff)
1638 	{
1639 		case 0x80:
1640 		case 0x81:
1641 			BurnYM3812Write(0, port & 1, data);
1642 		return;
1643 
1644 		case 0xb0:
1645 			soundlatch = data;
1646 			mcu_command = 0;
1647 		return;
1648 	}
1649 }
1650 
samesame_sound_read_port(UINT16 port)1651 static UINT8 __fastcall samesame_sound_read_port(UINT16 port)
1652 {
1653 	switch (port & 0xff)
1654 	{
1655 		case 0x63:
1656 			return mcu_command ? 0xff : 0;
1657 
1658 		case 0x80:
1659 		case 0x81:
1660 			return BurnYM3812Read(0, port & 1);
1661 
1662 		case 0xa0:
1663 			return soundlatch;
1664 	}
1665 
1666 	return 0;
1667 }
1668 
demonwld_sound_write_port(UINT16 port,UINT8 data)1669 static void __fastcall demonwld_sound_write_port(UINT16 port, UINT8 data)
1670 {
1671 	switch (port & 0xff)
1672 	{
1673 		case 0x00:
1674 		case 0x01:
1675 			BurnYM3812Write(0, port & 1, data);
1676 		return;
1677 
1678 		case 0x40:
1679 			// coin counter / lockout
1680 		return;
1681 	}
1682 }
1683 
demonwld_sound_read_port(UINT16 port)1684 static UINT8 __fastcall demonwld_sound_read_port(UINT16 port)
1685 {
1686 	switch (port & 0xff)
1687 	{
1688 		case 0x00:
1689 		case 0x01:
1690 			return BurnYM3812Read(0, port & 1);
1691 
1692 		case 0x20:
1693 			return DrvDips[2];
1694 
1695 		case 0x60:
1696 			return DrvInputs[2];
1697 
1698 		case 0x80:
1699 			return DrvInputs[0];
1700 
1701 		case 0xa0:
1702 			return DrvDips[1];
1703 
1704 		case 0xc0:
1705 			return DrvInputs[1];
1706 
1707 		case 0xe0:
1708 			return DrvDips[0];
1709 	}
1710 
1711 	return 0;
1712 }
1713 
1714 #define tilemap_cb(layer)					\
1715 	UINT16 *ram = (UINT16*)(DrvVidRAM + (layer*0x4000));	\
1716 	UINT16 attr = ram[offs * 2 + 0];			\
1717 	UINT16 code = ram[offs * 2 + 1];			\
1718 	UINT8 color = attr & 0x3f;				\
1719 	INT32 flags = (code & 0x8000) ? TILE_SKIP : 0;		\
1720 	if (DrvTransTable[code]) flags |= TILE_SKIP;		\
1721 	flags |= TILE_GROUP(attr >> 12);			\
1722 	TILE_SET_INFO(0, code, color, flags)
1723 
tilemap_callback(layer0)1724 static tilemap_callback( layer0 )
1725 {
1726 	tilemap_cb(0);
1727 }
1728 
tilemap_callback(layer1)1729 static tilemap_callback( layer1 )
1730 {
1731 	tilemap_cb(1);
1732 }
1733 
tilemap_callback(layer2)1734 static tilemap_callback( layer2 )
1735 {
1736 	tilemap_cb(2);
1737 }
1738 
tilemap_callback(layer3)1739 static tilemap_callback( layer3 )
1740 {
1741 	tilemap_cb(3);
1742 }
1743 
toaplan1SynchroniseStream(INT32 nSoundRate)1744 inline static INT32 toaplan1SynchroniseStream(INT32 nSoundRate)
1745 {
1746 	return (INT64)(ZetTotalCycles() * nSoundRate / 3500000);
1747 }
1748 
toaplan1YM3812IrqHandler(INT32,INT32 nStatus)1749 static void toaplan1YM3812IrqHandler(INT32, INT32 nStatus)
1750 {
1751 	ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE);
1752 }
1753 
DrvDoReset()1754 static INT32 DrvDoReset()
1755 {
1756 	memset (AllRam, 0, RamEnd - AllRam);
1757 
1758 	SekOpen(0);
1759 	SekReset();
1760 	SekClose();
1761 
1762 	ZetOpen(0);
1763 	ZetReset();
1764 	BurnYM3812Reset();
1765 	ZetClose();
1766 
1767 	HiscoreReset();
1768 
1769 	m68k_halt = 0;
1770 
1771 	if (has_dsp)
1772 	{
1773 		tms32010_reset();
1774 
1775 		main_ram_seg = 0;
1776 		dsp_addr_w = 0;
1777 		dsp_execute = 0;
1778 		dsp_BIO = 0;
1779 		dsp_on = 0;
1780 	}
1781 
1782 	flipscreen = 0;
1783 	sprite_flipscreen = 0;
1784 	interrupt_enable = 0;
1785 	tiles_offsets_x = 0;
1786 	tiles_offsets_y = 0;
1787 	tileram_offs = 0;
1788 	spriteram_offset = 0;
1789 	soundlatch = 0;
1790 	mcu_command = 0;
1791 
1792 	return 0;
1793 }
1794 
MemIndex()1795 static INT32 MemIndex()
1796 {
1797 	UINT8 *Next; Next = AllMem;
1798 
1799 	Drv68KROM	= Next; Next += 0x080000;
1800 	DrvZ80ROM	= Next; Next += 0x008000;
1801 
1802 	DrvMCUROM	= Next; Next += 0x001000;
1803 
1804 	DrvGfxROM0	= Next; Next += 0x200000;
1805 	DrvGfxROM1	= Next; Next += 0x200000;
1806 
1807 	DrvTransTable	= Next; Next += 0x200000 / 0x40;
1808 
1809 	DrvPalette	= (UINT32*)Next; Next += 0x0800 * sizeof(UINT32);
1810 
1811 	pTempDraw	= (UINT16*)Next; Next += 512 * 512 * sizeof(short);
1812 
1813 	AllRam		= Next;
1814 
1815 	Drv68KRAM	= Next; Next += 0x008000;
1816 	DrvPalRAM	= Next; Next += 0x001000;
1817 	DrvVidRAM	= Next; Next += 0x010000;
1818 	DrvShareRAM	= Next; Next += 0x000800;
1819 	DrvSprRAM	= Next; Next += 0x001000;
1820 	DrvSprBuf	= Next; Next += 0x001000;
1821 	DrvSprSizeRAM	= Next; Next += 0x000080;
1822 	DrvSprSizeBuf	= Next; Next += 0x000080;
1823 	DrvZ80RAM	= Next; Next += 0x000200;
1824 	DrvMCURAM	= Next; Next += 0x000400;
1825 
1826 	scroll		= (UINT16*)Next; Next += 8 * sizeof(INT16);
1827 
1828 	RamEnd		= Next;
1829 
1830 	MemEnd		= Next;
1831 
1832 	return 0;
1833 }
1834 
DrvGfxDecode(UINT8 * src,INT32 len,INT32 type)1835 static void DrvGfxDecode(UINT8 *src, INT32 len, INT32 type)
1836 {
1837 	INT32 Plane0[4] = { (len/2)*8+8, (len/2)*8+0, 8, 0 };
1838 	INT32 Plane1[4] = { STEP4(0, ((len/4)*8)) };
1839 	INT32 XOffs[16] = { STEP16(0,1) };
1840 	INT32 YOffs[16] = { STEP16(0,16) };
1841 
1842 	UINT8 *tmp = (UINT8*)BurnMalloc(len);
1843 
1844 	memcpy (tmp, src, len);
1845 
1846 	if (type == 0)
1847 	{
1848 		GfxDecode(((len*8)/4)/(8*8), 4, 8, 8, Plane0, XOffs, YOffs, 0x080, tmp, src);
1849 	}
1850 	else if (type == 1)
1851 	{
1852 		GfxDecode(((len*8)/4)/(16*16), 4, 16, 16, Plane1, XOffs, YOffs, 0x100, tmp, src);
1853 	}
1854 
1855 	BurnFree (tmp);
1856 }
1857 
LoadRoms()1858 static INT32 LoadRoms()
1859 {
1860 	char* pRomName;
1861 	struct BurnRomInfo ri;
1862 	UINT8 *pLoad = Drv68KROM;
1863 	UINT8 *zLoad = DrvZ80ROM;
1864 	UINT8 *gLoad = DrvGfxROM0;
1865 	UINT8 *sLoad = DrvGfxROM1;
1866 	INT32 sprite_type = 0;
1867 
1868 	for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++)
1869 	{
1870 		BurnDrvGetRomInfo(&ri, i);
1871 
1872 		if ((ri.nType & 0xf) == 1) {
1873 			if (BurnLoadRom(pLoad + 1, i+0, 2)) return 1;
1874 			if (BurnLoadRom(pLoad + 0, i+1, 2)) return 1;
1875 			pLoad += 0x40000; i++;
1876 			continue;
1877 		}
1878 
1879 		if ((ri.nType & 0xf) == 2) {
1880 			if (BurnLoadRom(zLoad, i, 1)) return 1;
1881 			zLoad += ri.nLen;
1882 			continue;
1883 		}
1884 
1885 		if ((ri.nType & 0xf) == 3) {
1886 			if (BurnLoadRom(gLoad + 0, i+0, 2)) return 1;
1887 			if (BurnLoadRom(gLoad + 1, i+1, 2)) return 1;
1888 			gLoad += ri.nLen * 2; i++;
1889 			continue;
1890 		}
1891 
1892 		if ((ri.nType & 0xf) == 4) {
1893 			if (BurnLoadRom(gLoad, i, 1)) return 1;
1894 			gLoad += ri.nLen;
1895 			continue;
1896 		}
1897 
1898 		if ((ri.nType & 0xf) == 5) {
1899 			if (BurnLoadRom(sLoad + 0, i+0, 2)) return 1;
1900 			if (BurnLoadRom(sLoad + 1, i+1, 2)) return 1;
1901 			sLoad += ri.nLen * 2; i++;
1902 			continue;
1903 		}
1904 
1905 		if ((ri.nType & 0xf) == 6 || (ri.nType & 0xf) == 8) {
1906 			if (BurnLoadRom(sLoad, i, 1)) return 1;
1907 			sLoad += ri.nLen;
1908 			sprite_type = ((ri.nType & 0xf) == 6) ? 1 : 0; // rallybik / vimana
1909 			continue;
1910 		}
1911 
1912 		if ((ri.nType & 0xf) == 7) {
1913 			if (BurnLoadRom(DrvMCUROM + 0, i+0, 2)) return 1;
1914 			if (BurnLoadRom(DrvMCUROM + 1, i+1, 2)) return 1;
1915 			i++;
1916 			continue;
1917 		}
1918 	}
1919 
1920 	mainrom_size = (pLoad - Drv68KROM);
1921 
1922 	tile_mask = gLoad - DrvGfxROM0;
1923 	sprite_mask = sLoad - DrvGfxROM1;
1924 
1925 	DrvGfxDecode(DrvGfxROM0, tile_mask, 0);
1926 	DrvGfxDecode(DrvGfxROM1, sprite_mask, sprite_type);
1927 
1928 	tile_mask *= 2;
1929 	sprite_mask = ((sprite_mask * 2) / (sprite_type ? 0x100 : 0x40)) - 1;
1930 
1931 	{
1932 		for (INT32 i = 0; i < tile_mask; i+=0x40)
1933 		{
1934 			DrvTransTable[i/0x40] = 1;
1935 
1936 			for (INT32 j = 0; j < 0x40; j++)
1937 			{
1938 				if (DrvGfxROM0[i+j]) {
1939 					DrvTransTable[i/0x40] = 0;
1940 					break;
1941 				}
1942 			}
1943 		}
1944 	}
1945 
1946 	return 0;
1947 }
1948 
configure_68k_map(UINT32 mainram,UINT32 palette,UINT32 share,UINT32 sprite,UINT32 tilemap,UINT32 misc,UINT32 misc2)1949 static void configure_68k_map(UINT32 mainram, UINT32 palette, UINT32 share, UINT32 sprite, UINT32 tilemap, UINT32 misc, UINT32 misc2)
1950 {
1951 	SekInit(0, 0x68000);
1952 	SekOpen(0);
1953 	SekMapMemory(Drv68KROM,			0x000000, mainrom_size-1, MAP_ROM);
1954 	SekMapMemory(Drv68KRAM,			mainram,  mainram+0x7fff, MAP_RAM); // some only have 4000
1955 	SekSetWriteWordHandler(0,		toaplan1_main_write_word);
1956 	SekSetWriteByteHandler(0,		toaplan1_main_write_byte);
1957 	SekSetReadWordHandler(0,		toaplan1_main_read_word);
1958 	SekSetReadByteHandler(0,		toaplan1_main_read_byte);
1959 
1960 	if (palette != (UINT32)~0)
1961 	{
1962 		SekMapMemory(DrvPalRAM,			palette + 0x0000, palette + 0x07ff, MAP_RAM);
1963 		SekMapMemory(DrvPalRAM + 0x800,		palette + 0x2000, palette + 0x27ff, MAP_RAM);
1964 
1965 		SekMapHandler(1,			palette, palette + 0x27ff, MAP_WRITE);
1966 		SekSetWriteWordHandler(1,		toaplan1_palette_write_word);
1967 		SekSetWriteByteHandler(1,		toaplan1_palette_write_byte);
1968 	}
1969 
1970 	if (share != (UINT32)~0)
1971 	{
1972 		SekMapHandler(2,			share, share + 0xfff, MAP_RAM);
1973 		SekSetWriteWordHandler(2,		toaplan1_shareram_write_word);
1974 		SekSetWriteByteHandler(2,		toaplan1_shareram_write_byte);
1975 		SekSetReadWordHandler(2,		toaplan1_shareram_read_word);
1976 		SekSetReadByteHandler(2,		toaplan1_shareram_read_byte);
1977 	}
1978 
1979 	if (sprite != (UINT32)~0)
1980 	{
1981 		SekMapHandler(3,			sprite, sprite + 0x007, MAP_RAM);
1982 		SekSetWriteWordHandler(3,		toaplan1_spriteram_write_word);
1983 		SekSetWriteByteHandler(3,		toaplan1_spriteram_write_byte);
1984 		SekSetReadWordHandler(3,		toaplan1_spriteram_read_word);
1985 		SekSetReadByteHandler(3,		toaplan1_spriteram_read_byte);
1986 	}
1987 
1988 	if (tilemap != (UINT32)~0)
1989 	{
1990 		SekMapHandler(4,			tilemap, tilemap + 0x01f, MAP_RAM);
1991 		SekSetWriteWordHandler(4,		toaplan1_tilemap_write_word);
1992 		SekSetWriteByteHandler(4,		toaplan1_tilemap_write_byte);
1993 		SekSetReadWordHandler(4,		toaplan1_tilemap_read_word);
1994 		SekSetReadByteHandler(4,		toaplan1_tilemap_read_byte);
1995 	}
1996 
1997 	if (misc != (UINT32)~0)
1998 	{
1999 		SekMapHandler(5,			misc, misc + 0x00f, MAP_RAM);
2000 		SekSetWriteWordHandler(5,		toaplan1_miscctrl_write_word);
2001 		SekSetWriteByteHandler(5,		toaplan1_miscctrl_write_byte);
2002 		SekSetReadWordHandler(5,		toaplan1_miscctrl_read_word);
2003 		SekSetReadByteHandler(5,		toaplan1_miscctrl_read_byte);
2004 	}
2005 
2006 	if (misc != (UINT32)~0)
2007 	{
2008 		SekMapHandler(6,			misc2, misc2 + 0x007, MAP_WRITE);
2009 		SekSetWriteWordHandler(6,		toaplan1_miscctrl2_write_word);
2010 		SekSetWriteByteHandler(6,		toaplan1_miscctrl2_write_byte);
2011 	}
2012 
2013 	SekClose();
2014 }
2015 
common_sound_init(void (__fastcall * write_port)(UINT16,UINT8),UINT8 (__fastcall * read_port)(UINT16))2016 static void common_sound_init(void (__fastcall *write_port)(UINT16, UINT8), UINT8 (__fastcall *read_port)(UINT16))
2017 {
2018 	ZetInit(0);
2019 	ZetOpen(0);
2020 	ZetMapMemory(DrvZ80ROM,			0x0000, 0x7fff, MAP_ROM);
2021 	ZetMapMemory(DrvShareRAM,		0x8000, 0x87ff, MAP_RAM);
2022 	ZetMapMemory(DrvZ80RAM,			0xfe00, 0xffff, MAP_RAM); // for z180 games
2023 	ZetSetOutHandler(write_port);
2024 	ZetSetInHandler(read_port);
2025 	ZetClose();
2026 
2027 	BurnYM3812Init(1, 3500000, &toaplan1YM3812IrqHandler, toaplan1SynchroniseStream, 0);
2028 	BurnTimerAttachYM3812(&ZetConfig, 3500000);
2029 	BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);
2030 }
2031 
configure_graphics(INT32 xoffs,INT32 yoffs,INT32 adjust_sprite_y)2032 static void configure_graphics(INT32 xoffs, INT32 yoffs, INT32 adjust_sprite_y)
2033 {
2034 	GenericTilesInit();
2035 	GenericTilemapInit(0, TILEMAP_SCAN_ROWS, layer0_map_callback, 8, 8, 64, 64);
2036 	GenericTilemapInit(1, TILEMAP_SCAN_ROWS, layer1_map_callback, 8, 8, 64, 64);
2037 	GenericTilemapInit(2, TILEMAP_SCAN_ROWS, layer2_map_callback, 8, 8, 64, 64);
2038 	GenericTilemapInit(3, TILEMAP_SCAN_ROWS, layer3_map_callback, 8, 8, 64, 64);
2039 	GenericTilemapSetGfx(0, DrvGfxROM0, 4, 8, 8, tile_mask, 0, 0x3f);
2040 	GenericTilemapSetTransparent(0, 0);
2041 	GenericTilemapSetTransparent(1, 0);
2042 	GenericTilemapSetTransparent(2, 0);
2043 	GenericTilemapSetTransparent(3, 0);
2044 	GenericTilemapSetOffsets(0, -(xoffs+6), -(256+1+yoffs));
2045 	GenericTilemapSetOffsets(1, -(xoffs+4), -(256+1+yoffs));
2046 	GenericTilemapSetOffsets(2, -(xoffs+2), -(256+1+yoffs));
2047 	GenericTilemapSetOffsets(3, -(xoffs+0), -(256+1+yoffs));
2048 
2049 	sprite_y_adjust = adjust_sprite_y;
2050 }
2051 
RallybikInit()2052 static INT32 RallybikInit()
2053 {
2054 	vertical_lines = 282;
2055 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2056 
2057 	AllMem = NULL;
2058 	MemIndex();
2059 	INT32 nLen = MemEnd - (UINT8 *)0;
2060 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2061 	memset(AllMem, 0, nLen);
2062 	MemIndex();
2063 
2064 	if (LoadRoms()) return 1;
2065 
2066 	configure_68k_map(0x080000, 0x144000, 0x180000, ~0, 0x100000, 0x140000, 0x1c0000);
2067 
2068 	SekOpen(0);
2069 	SekMapMemory(DrvSprRAM,		0x0c0000, 0x0c0fff, MAP_RAM);
2070 	SekSetWriteWordHandler(0,	rallybik_main_write_word);
2071 	SekClose();
2072 
2073 	common_sound_init(rallybik_sound_write_port, rallybik_sound_read_port);
2074 
2075 	configure_graphics(13, 16, 0);
2076 
2077 	DrvDoReset();
2078 
2079 	return 0;
2080 }
2081 
TruxtonInit()2082 static INT32 TruxtonInit()
2083 {
2084 	vertical_lines = 270;
2085 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2086 
2087 	AllMem = NULL;
2088 	MemIndex();
2089 	INT32 nLen = MemEnd - (UINT8 *)0;
2090 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2091 	memset(AllMem, 0, nLen);
2092 	MemIndex();
2093 
2094 	if (LoadRoms()) return 1;
2095 
2096 	configure_68k_map(0x080000, 0x144000, 0x180000, 0x0c0000, 0x100000, 0x140000, 0x1c0000);
2097 
2098 	SekOpen(0);
2099 	SekSetWriteWordHandler(0,	truxton_main_write_word);
2100 	SekClose();
2101 
2102 	common_sound_init(rallybik_sound_write_port, rallybik_sound_read_port);
2103 
2104 	configure_graphics(495, 0, 0);
2105 
2106 	DrvDoReset();
2107 
2108 	return 0;
2109 }
2110 
HellfireInit()2111 static INT32 HellfireInit()
2112 {
2113 	vertical_lines = 270;
2114 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2115 
2116 	AllMem = NULL;
2117 	MemIndex();
2118 	INT32 nLen = MemEnd - (UINT8 *)0;
2119 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2120 	memset(AllMem, 0, nLen);
2121 	MemIndex();
2122 
2123 	if (LoadRoms()) return 1;
2124 
2125 	configure_68k_map(0x040000, 0x084000, 0x0c0000, 0x140000, 0x100000, 0x080000, ~0);
2126 
2127 	SekOpen(0);
2128 	SekSetWriteWordHandler(0,	hellfire_main_write_word);
2129 	SekClose();
2130 
2131 	common_sound_init(hellfire_sound_write_port, hellfire_sound_read_port);
2132 
2133 	configure_graphics(495, 16, 16);
2134 
2135 	DrvDoReset();
2136 
2137 	return 0;
2138 }
2139 
ZerowingInit()2140 static INT32 ZerowingInit()
2141 {
2142 	vertical_lines = 270;
2143 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2144 
2145 	AllMem = NULL;
2146 	MemIndex();
2147 	INT32 nLen = MemEnd - (UINT8 *)0;
2148 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2149 	memset(AllMem, 0, nLen);
2150 	MemIndex();
2151 
2152 	if (LoadRoms()) return 1;
2153 
2154 	configure_68k_map(0x080000, 0x404000, 0x440000, 0x4c0000, 0x480000, 0x400000, 0x0c0000);
2155 
2156 	common_sound_init(zerowing_sound_write_port, zerowing_sound_read_port);
2157 
2158 	configure_graphics(495, 16, 16);
2159 
2160 	DrvDoReset();
2161 
2162 	return 0;
2163 }
2164 
OutzoneInit()2165 static INT32 OutzoneInit()
2166 {
2167 	vertical_lines = 282;
2168 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2169 
2170 	AllMem = NULL;
2171 	MemIndex();
2172 	INT32 nLen = MemEnd - (UINT8 *)0;
2173 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2174 	memset(AllMem, 0, nLen);
2175 	MemIndex();
2176 
2177 	if (LoadRoms()) return 1;
2178 
2179 	configure_68k_map(0x240000, 0x304000, 0x140000, 0x100000, 0x200000, 0x300000, 0x340000);
2180 
2181 	common_sound_init(outzone_sound_write_port, outzone_sound_read_port);
2182 
2183 	configure_graphics(495, 0, 0);
2184 
2185 	DrvDoReset();
2186 
2187 	return 0;
2188 }
2189 
OutzonecvInit()2190 static INT32 OutzonecvInit()
2191 {
2192 	vertical_lines = 270;
2193 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2194 
2195 	AllMem = NULL;
2196 	MemIndex();
2197 	INT32 nLen = MemEnd - (UINT8 *)0;
2198 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2199 	memset(AllMem, 0, nLen);
2200 	MemIndex();
2201 
2202 	if (LoadRoms()) return 1;
2203 
2204 	configure_68k_map(0x080000, 0x404000, 0x440000, 0x4c0000, 0x480000,0x400000, 0x0c0000);
2205 
2206 	common_sound_init(zerowing_sound_write_port, zerowing_sound_read_port);
2207 
2208 	configure_graphics(495, 0, 0);
2209 
2210 	DrvDoReset();
2211 
2212 	return 0;
2213 }
2214 
VimanaInit()2215 static INT32 VimanaInit()
2216 {
2217 	vertical_lines = 270;
2218 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2219 
2220 	AllMem = NULL;
2221 	MemIndex();
2222 	INT32 nLen = MemEnd - (UINT8 *)0;
2223 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2224 	memset(AllMem, 0, nLen);
2225 	MemIndex();
2226 
2227 	if (LoadRoms()) return 1;
2228 
2229 	configure_68k_map(0x480000, 0x404000, 0x440000, 0x0c0000, 0x4c0000, 0x400000, 0x080000);
2230 
2231 	// z180 cpu!
2232 	common_sound_init(vimana_sound_write_port, vimana_sound_read_port);
2233 
2234 	configure_graphics(495, 0, 0);
2235 
2236 	DrvDoReset();
2237 
2238 	return 0;
2239 }
2240 
SamesameInit()2241 static INT32 SamesameInit()
2242 {
2243 	samesame = 1;
2244 	vertical_lines = 270;
2245 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2246 
2247 	AllMem = NULL;
2248 	MemIndex();
2249 	INT32 nLen = MemEnd - (UINT8 *)0;
2250 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2251 	memset(AllMem, 0, nLen);
2252 	MemIndex();
2253 
2254 	if (LoadRoms()) return 1;
2255 
2256 	configure_68k_map(0x0c0000, 0x104000, ~0, 0x1c0000, 0x180000, 0x100000, 0x080000);
2257 
2258 	SekOpen(0);
2259 	SekSetWriteWordHandler(0,		samesame_main_write_word);
2260 	SekSetReadWordHandler(0,		samesame_main_read_word);
2261 	SekSetReadByteHandler(0,		samesame_main_read_byte);
2262 	SekClose();
2263 
2264 	// z180 cpu!
2265 	common_sound_init(samesame_sound_write_port, samesame_sound_read_port);
2266 
2267 	configure_graphics(495, 0, 0);
2268 
2269 	DrvDoReset();
2270 
2271 	return 0;
2272 }
2273 
DemonwldInit()2274 static INT32 DemonwldInit()
2275 {
2276 	vertical_lines = 282;
2277 	BurnSetRefreshRate(((28000000.0 / 4.0) / (450.0 * vertical_lines)));
2278 
2279 	AllMem = NULL;
2280 	MemIndex();
2281 	INT32 nLen = MemEnd - (UINT8 *)0;
2282 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
2283 	memset(AllMem, 0, nLen);
2284 	MemIndex();
2285 
2286 	if (LoadRoms()) return 1;
2287 
2288 	configure_68k_map(0xc00000, 0x404000, 0x600000, 0xa00000, 0x800000, 0x400000, ~0);
2289 
2290 	SekOpen(0);
2291 	SekSetWriteWordHandler(0,		demonwld_main_write_word);
2292 	SekClose();
2293 
2294 	{
2295 		has_dsp = 1;
2296 		tms32010_init();
2297 		tms32010_set_write_port_handler(dsp_write);
2298 		tms32010_set_read_port_handler(dsp_read);
2299 		tms32010_ram = (UINT16*)DrvMCURAM;
2300 		tms32010_rom = (UINT16*)DrvMCUROM;
2301 	}
2302 
2303 	common_sound_init(demonwld_sound_write_port, demonwld_sound_read_port);
2304 
2305 	configure_graphics(495, 16, 16);
2306 
2307 	DrvDoReset();
2308 
2309 	return 0;
2310 }
2311 
DrvExit()2312 static INT32 DrvExit()
2313 {
2314 	GenericTilesExit();
2315 
2316 	BurnYM3812Exit();
2317 
2318 	SekExit();
2319 	ZetExit();
2320 
2321 	if (has_dsp) {
2322 		tms32010_exit();
2323 	}
2324 
2325 	BurnFree (AllMem);
2326 
2327 	has_dsp = 0;
2328 	samesame = 0;
2329 
2330 	return 0;
2331 }
2332 
DrvPaletteUpdate()2333 static void DrvPaletteUpdate()
2334 {
2335 	UINT16 *p = (UINT16*)DrvPalRAM;
2336 
2337 	for (INT32 i = 0; i < BurnDrvGetPaletteEntries(); i++)
2338 	{
2339 		UINT8 r = (p[i] >>  0) & 0x1f;
2340 		UINT8 g = (p[i] >>  5) & 0x1f;
2341 		UINT8 b = (p[i] >> 10) & 0x1f;
2342 
2343 		r = (r << 3) | (r >> 2);
2344 		g = (g << 3) | (g >> 2);
2345 		b = (b << 3) | (b >> 2);
2346 
2347 		DrvPalette[i] = BurnHighCol(r,g,b,0);
2348 	}
2349 }
2350 
rallybik_draw_sprites()2351 static void rallybik_draw_sprites()
2352 {
2353 	INT32 xoffs = 35;
2354 	INT32 xoffs_flipped = 15;
2355 
2356 	UINT16 *spriteram = (UINT16*)DrvSprBuf;
2357 
2358 	for (INT32 offs = (0x1000/2)-4; offs >= 0; offs -= 4)
2359 	{
2360 		UINT16 attr = spriteram[offs + 1];
2361 		UINT16 priority = (attr & 0x0c00)>>8;
2362 		if (!priority) continue;
2363 
2364 		INT32 sy = spriteram[offs + 3] >> 7;
2365 
2366 		if (sy != 0x0100)
2367 		{
2368 			UINT16 code  = spriteram[offs] & 0x7ff;
2369 			UINT16 color = ((attr & 0x3f) << 4) | 0x400;
2370 			INT32  sx    = spriteram[offs + 2] >> 7;
2371 			INT32 flipx  = attr & 0x100;
2372 			INT32 flipy  = attr & 0x200;
2373 
2374 			if (flipx) sx -= xoffs_flipped;
2375 
2376 			{
2377 				sx -= xoffs;
2378 				sy -= 16;
2379 
2380 				if (sy < -15 || sx < -15 || sx >= nScreenWidth || sy >= nScreenHeight) continue;
2381 
2382 				UINT8 *gfx = DrvGfxROM1 + (code * 0x100);
2383 
2384 				INT32 flip = (flipx ? 0x0f : 0) | (flipy ? 0xf0 : 0);
2385 
2386 				UINT16 *dst = pTransDraw + (sy * nScreenWidth) + sx;
2387 				UINT8  *pri = pPrioDraw + (sy * nScreenWidth) + sx;
2388 
2389 				for (INT32 y = 0; y < 16; y++, dst += nScreenWidth, pri += nScreenWidth)
2390 				{
2391 					if ((sy + y) < 0 || (sy + y) >= nScreenHeight) continue;
2392 
2393 					for (INT32 x = 0; x < 16; x++)
2394 					{
2395 						if ((sx + x) < 0 || (sx + x) >= nScreenWidth) continue;
2396 
2397 						INT32 pxl = gfx[((y * 16) + x) ^ flip];
2398 
2399 						if (pxl) {
2400 							if (pri[x] <= priority) {
2401 								dst[x] = pxl + color;
2402 								pri[x] = 0xff;
2403 							}
2404 						}
2405 					}
2406 				}
2407 			}
2408 		}
2409 	}
2410 }
2411 
RallybikDraw()2412 static INT32 RallybikDraw()
2413 {
2414 	if (DrvRecalc) {
2415 		DrvPaletteUpdate();
2416 		DrvRecalc = 0;
2417 	}
2418 
2419 	for (INT32 i = 0; i < 4; i++) {
2420 		GenericTilemapSetScrollX(i, (scroll[0+i*2] >> 7) - tiles_offsets_x);
2421 		GenericTilemapSetScrollY(i, (scroll[1+i*2] >> 7) - tiles_offsets_y);
2422 	}
2423 
2424 	BurnTransferClear();
2425 
2426 	if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, TMAP_FORCEOPAQUE);
2427 
2428 	for (INT32 priority = 1; priority < 16; priority++)
2429 	{
2430 		if (nBurnLayer & 1) GenericTilemapDraw(3, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2431 		if (nBurnLayer & 2) GenericTilemapDraw(2, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2432 		if (nBurnLayer & 4) GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2433 		if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2434 	}
2435 
2436 	rallybik_draw_sprites();
2437 
2438 	BurnTransferCopy(DrvPalette);
2439 
2440 	return 0;
2441 }
2442 
toaplan1_draw_sprite_custom(UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy,INT32 priority)2443 static void toaplan1_draw_sprite_custom(UINT32 code, UINT32 color, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy, INT32 priority)
2444 {
2445 	sy -= sprite_y_adjust;
2446 
2447 	INT32 pal_base = 0x400 + (color & 0x3f) * 0x10;
2448 	UINT8 *source_base = DrvGfxROM1 + (code * 0x40);
2449 	UINT8 *priority_bitmap = pPrioDraw;
2450 
2451 	int sprite_screen_height = ((1<<16)*8+0x8000)>>16;
2452 	int sprite_screen_width = ((1<<16)*8+0x8000)>>16;
2453 
2454 	if (sprite_screen_width && sprite_screen_height)
2455 	{
2456 		int dx = (8<<16)/sprite_screen_width;
2457 		int dy = (8<<16)/sprite_screen_height;
2458 
2459 		int ex = sx+sprite_screen_width;
2460 		int ey = sy+sprite_screen_height;
2461 
2462 		int x_index_base;
2463 		int y_index;
2464 
2465 		if( flipx )
2466 		{
2467 			x_index_base = (sprite_screen_width-1)*dx;
2468 			dx = -dx;
2469 		}
2470 		else
2471 		{
2472 			x_index_base = 0;
2473 		}
2474 
2475 		if( flipy )
2476 		{
2477 			y_index = (sprite_screen_height-1)*dy;
2478 			dy = -dy;
2479 		}
2480 		else
2481 		{
2482 			y_index = 0;
2483 		}
2484 
2485 		if( sx < 0/*clip.min_x*/)
2486 		{
2487 			int pixels = 0-sx; //clip.min_x-sx;
2488 			sx += pixels;
2489 			x_index_base += pixels*dx;
2490 		}
2491 
2492 		if( sy < 0/*clip.min_y*/)
2493 		{
2494 			int pixels = 0-sy; //clip.min_y-sy;
2495 			sy += pixels;
2496 			y_index += pixels*dy;
2497 		}
2498 
2499 		if( ex > nScreenWidth/*clip.max_x+1*/)
2500 		{
2501 			int pixels = ex-nScreenWidth; //clip.max_x-1;
2502 			ex -= pixels;
2503 		}
2504 
2505 		if( ey > nScreenHeight/*clip.max_y+1*/)
2506 		{
2507 			int pixels = ey-nScreenHeight; //clip.max_y-1;
2508 			ey -= pixels;
2509 		}
2510 
2511 		if( ex>sx )
2512 		{
2513 			for(INT32 y=sy; y<ey; y++ )
2514 			{
2515 				const UINT8 *source = source_base + (y_index>>16) * 8;
2516 				UINT16 *dest = pTransDraw + (y * nScreenWidth);
2517 				uint8_t *pri = priority_bitmap + (y * nScreenWidth);
2518 
2519 				int x_index = x_index_base;
2520 				for(INT32 x=sx; x<ex; x++ )
2521 				{
2522 					int c = source[x_index>>16];
2523 					if( c != 0 )
2524 					{
2525 						if (pri[x] < priority)
2526 							dest[x] = pal_base+c;
2527 						pri[x] = 0xff; // mark it "already drawn"
2528 					}
2529 					x_index += dx;
2530 				}
2531 
2532 				y_index += dy;
2533 			}
2534 		}
2535 	}
2536 }
2537 
draw_sprites()2538 static void draw_sprites()
2539 {
2540 	UINT16 *source = (UINT16*)DrvSprBuf;
2541 	UINT16 *size   = (UINT16*)DrvSprSizeBuf;
2542 	INT32 fcu_flipscreen = sprite_flipscreen;
2543 
2544 	for (INT32 offs = 0x1000/2 - 4; offs >= 0; offs -= 4)
2545 	{
2546 		if (!(source[offs] & 0x8000))
2547 		{
2548 			INT32 sx, sy;
2549 
2550 			INT32 attrib = source[offs+1];
2551 			INT32 priority = (attrib & 0xf000) >> 12;
2552 
2553 			INT32 sprite = source[offs] & 0x7fff;
2554 			INT32 color = attrib & 0x3f;
2555 
2556 			INT32 sizeram_ptr = (attrib >> 6) & 0x3f;
2557 			INT32 sprite_sizex = ( size[sizeram_ptr]       & 0x0f) * 8;
2558 			INT32 sprite_sizey = ((size[sizeram_ptr] >> 4) & 0x0f) * 8;
2559 
2560 			INT32 sx_base = (source[offs + 2] >> 7) & 0x1ff;
2561 			INT32 sy_base = (source[offs + 3] >> 7) & 0x1ff;
2562 
2563 			if (sx_base >= 0x180) sx_base -= 0x200;
2564 			if (sy_base >= 0x180) sy_base -= 0x200;
2565 
2566 			if (fcu_flipscreen)
2567 			{
2568 				sx_base = 320 - (sx_base + 8);
2569 				sy_base = 240 - (sy_base + 8);
2570 			//	sy_base += ((visarea.max_y + 1) - 240) * 2;    // Horizontal games are offset so adjust by +0x20
2571 			}
2572 
2573 			for (INT32 dim_y = 0; dim_y < sprite_sizey; dim_y += 8)
2574 			{
2575 				if (fcu_flipscreen) sy = sy_base - dim_y;
2576 				else                sy = sy_base + dim_y;
2577 
2578 				for (INT32 dim_x = 0; dim_x < sprite_sizex; dim_x += 8)
2579 				{
2580 					if (fcu_flipscreen) sx = sx_base - dim_x;
2581 					else                sx = sx_base + dim_x;
2582 
2583 					toaplan1_draw_sprite_custom(sprite & sprite_mask,color, fcu_flipscreen,fcu_flipscreen, sx,sy, priority);
2584 
2585 					sprite++ ;
2586 				}
2587 			}
2588 		}
2589 	}
2590 }
2591 
DrvDraw()2592 static INT32 DrvDraw()
2593 {
2594 	if (DrvRecalc) {
2595 		DrvPaletteUpdate();
2596 		DrvRecalc = 0;
2597 	}
2598 
2599 	for (INT32 i = 0; i < 4; i++) {
2600 		GenericTilemapSetScrollX(i, (scroll[0+i*2] >> 7) - tiles_offsets_x);
2601 		GenericTilemapSetScrollY(i, (scroll[1+i*2] >> 7) - tiles_offsets_y);
2602 	}
2603 
2604 	BurnTransferClear();
2605 
2606 	if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, TMAP_FORCEOPAQUE);
2607 
2608 	for (INT32 priority = 1; priority < 16; priority++)
2609 	{
2610 		if (nBurnLayer & 1) GenericTilemapDraw(3, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2611 		if (nBurnLayer & 2) GenericTilemapDraw(2, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2612 		if (nBurnLayer & 4) GenericTilemapDraw(1, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2613 		if (nBurnLayer & 8) GenericTilemapDraw(0, pTransDraw, TMAP_SET_GROUP(priority)|priority);
2614 	}
2615 
2616 	draw_sprites();
2617 
2618 	BurnTransferCopy(DrvPalette);
2619 
2620 	return 0;
2621 }
2622 
DrvFrame()2623 static INT32 DrvFrame()
2624 {
2625 	if (DrvReset) {
2626 		DrvDoReset();
2627 	}
2628 
2629 	SekNewFrame();
2630 	ZetNewFrame();
2631 
2632 	{
2633 		DrvInputs[0] = DrvInputs[1] = DrvInputs[2] = 0;
2634 
2635 		for (INT32 i = 0; i < 8; i++) {
2636 			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
2637 			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
2638 			DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
2639 		}
2640 	}
2641 
2642 	INT32 nInterleave = vertical_lines;
2643 	INT32 nCyclesTotal[3] = { (10000000 * 100) / nBurnFPS, (3500000 * 100) / nBurnFPS, (14000000 * 100) / nBurnFPS };
2644 	INT32 nCyclesDone[3] = { 0, 0, 0 };
2645 	INT32 nVBlankLine = 240 + sprite_y_adjust;
2646 
2647 	SekOpen(0);
2648 	ZetOpen(0);
2649 
2650 	vblank = 0;
2651 
2652 	for (INT32 i = 0; i < nInterleave; i++)
2653 	{
2654 		if (m68k_halt) {
2655 			SekIdle(nCyclesTotal[0] / nInterleave);
2656 			nCyclesDone[0] += nCyclesTotal[0] / nInterleave;
2657 		} else {
2658 			nCyclesDone[0] += SekRun(((i + 1) * nCyclesTotal[0] / nInterleave) - nCyclesDone[0]);
2659 		}
2660 
2661 		if (i == nVBlankLine) {
2662 			vblank = 1;
2663 			if (interrupt_enable) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO);
2664 
2665 			if (pBurnDraw) {
2666 				BurnDrvRedraw();
2667 			}
2668 
2669 			memcpy (DrvSprBuf , DrvSprRAM , 0x1000);
2670 			memcpy (DrvSprSizeBuf , DrvSprSizeRAM , 0x80);
2671 		}
2672 
2673 		if (samesame && i == nVBlankLine + 2) {
2674 			SekSetIRQLine(2, CPU_IRQSTATUS_AUTO);
2675 		}
2676 
2677 		BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave));
2678 
2679 		if (has_dsp && dsp_on) tms32010_execute(nCyclesTotal[2] / nInterleave);
2680 	}
2681 
2682 	BurnTimerEndFrameYM3812(nCyclesTotal[1]);
2683 
2684 	if (pBurnSoundOut) {
2685 		BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);
2686 	}
2687 
2688 	ZetClose();
2689 	SekClose();
2690 
2691 	return 0;
2692 }
2693 
DrvScan(INT32 nAction,INT32 * pnMin)2694 static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
2695 {
2696 	struct BurnArea ba;
2697 
2698 	if (pnMin) {
2699 		*pnMin = 0x029698;
2700 	}
2701 
2702 	if (nAction & ACB_VOLATILE) {
2703 		memset(&ba, 0, sizeof(ba));
2704 
2705 		ba.Data	  = AllRam;
2706 		ba.nLen	  = RamEnd - AllRam;
2707 		ba.szName = "All Ram";
2708 		BurnAcb(&ba);
2709 
2710 		SekScan(nAction);
2711 		ZetScan(nAction);
2712 
2713 		BurnYM3812Scan(nAction, pnMin);
2714 
2715 		SCAN_VAR(flipscreen);
2716 		SCAN_VAR(interrupt_enable);
2717 		SCAN_VAR(tiles_offsets_x);
2718 		SCAN_VAR(tiles_offsets_y);
2719 		SCAN_VAR(tileram_offs);
2720 		SCAN_VAR(spriteram_offset);
2721 		SCAN_VAR(sprite_flipscreen);
2722 		SCAN_VAR(soundlatch);
2723 		SCAN_VAR(mcu_command);
2724 
2725 		if (has_dsp) {
2726 			tms32010_scan(nAction);
2727 
2728 			SCAN_VAR(m68k_halt);
2729 			SCAN_VAR(main_ram_seg);
2730 			SCAN_VAR(dsp_addr_w);
2731 			SCAN_VAR(dsp_execute);
2732 			SCAN_VAR(dsp_BIO);
2733 			SCAN_VAR(dsp_on);
2734 		}
2735 	}
2736 
2737 	return 0;
2738 }
2739 
2740 
2741 // Rally Bike / Dash Yarou
2742 
2743 static struct BurnRomInfo rallybikRomDesc[] = {
2744 	{ "b45-02.rom",			0x08000, 0x383386d7, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2745 	{ "b45-01.rom",			0x08000, 0x7602f6a7, 1 | BRF_PRG | BRF_ESS }, //  1
2746 	{ "b45-04.rom",			0x20000, 0xe9b005b1, 1 | BRF_PRG | BRF_ESS }, //  2
2747 	{ "b45-03.rom",			0x20000, 0x555344ce, 1 | BRF_PRG | BRF_ESS }, //  3
2748 
2749 	{ "b45-05.rom",			0x04000, 0x10814601, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 Code
2750 
2751 	{ "b45-09.bin",			0x20000, 0x1dc7b010, 3 | BRF_GRA },           //  5 Layer Tiles
2752 	{ "b45-08.bin",			0x20000, 0xfab661ba, 3 | BRF_GRA },           //  6
2753 	{ "b45-07.bin",			0x20000, 0xcd3748b4, 3 | BRF_GRA },           //  7
2754 	{ "b45-06.bin",			0x20000, 0x144b085c, 3 | BRF_GRA },           //  8
2755 
2756 	{ "b45-11.rom",			0x10000, 0x0d56e8bb, 6 | BRF_GRA },           //  9 Sprites
2757 	{ "b45-10.rom",			0x10000, 0xdbb7c57e, 6 | BRF_GRA },           // 10
2758 	{ "b45-12.rom",			0x10000, 0xcf5aae4e, 6 | BRF_GRA },           // 11
2759 	{ "b45-13.rom",			0x10000, 0x1683b07c, 6 | BRF_GRA },           // 12
2760 
2761 	{ "b45-15.bpr",			0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 13 PROMs
2762 	{ "b45-16.bpr",			0x00100, 0xa50cef09, 0 | BRF_OPT },           // 14
2763 	{ "b45-14.bpr",			0x00020, 0xf72482db, 0 | BRF_OPT },           // 15
2764 	{ "b45-17.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 16
2765 };
2766 
2767 STD_ROM_PICK(rallybik)
2768 STD_ROM_FN(rallybik)
2769 
2770 struct BurnDriver BurnDrvRallybik = {
2771 	"rallybik", NULL, NULL, NULL, "1988",
2772 	"Rally Bike / Dash Yarou\0", NULL, "Toaplan / Taito Corporation", "Toaplan BCU-2 / FCU-2 based",
2773 	L"Rally Bike\0\u30C0\u30C3\u30B7\u30E5\uC91E\u90CE\0", NULL, NULL, NULL,
2774 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RACING, 0,
2775 	NULL, rallybikRomInfo, rallybikRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, RallybikDIPInfo,
2776 	RallybikInit, DrvExit, DrvFrame, RallybikDraw, DrvScan, &DrvRecalc, 0x800,
2777 	240, 320, 3, 4
2778 };
2779 
2780 
2781 // Truxton / Tatsujin
2782 
2783 static struct BurnRomInfo truxtonRomDesc[] = {
2784 	{ "b65_11.bin",			0x20000, 0x1a62379a, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2785 	{ "b65_10.bin",			0x20000, 0xaff5195d, 1 | BRF_PRG | BRF_ESS }, //  1
2786 
2787 	{ "b65_09.bin",			0x04000, 0x1bdd4ddc, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
2788 
2789 	{ "b65_08.bin",			0x20000, 0xd2315b37, 3 | BRF_GRA },           //  3 Layer Tiles
2790 	{ "b65_07.bin",			0x20000, 0xfb83252a, 3 | BRF_GRA },           //  4
2791 	{ "b65_06.bin",			0x20000, 0x36cedcbe, 3 | BRF_GRA },           //  5
2792 	{ "b65_05.bin",			0x20000, 0x81cd95f1, 3 | BRF_GRA },           //  6
2793 
2794 	{ "b65_04.bin",			0x20000, 0x8c6ff461, 5 | BRF_GRA },           //  7 Sprites
2795 	{ "b65_03.bin",			0x20000, 0x58b1350b, 5 | BRF_GRA },           //  8
2796 	{ "b65_02.bin",			0x20000, 0x1dd55161, 5 | BRF_GRA },           //  9
2797 	{ "b65_01.bin",			0x20000, 0xe974937f, 5 | BRF_GRA },           // 10
2798 
2799 	{ "b65_12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 11 PROMs
2800 	{ "b65_13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 12
2801 };
2802 
2803 STD_ROM_PICK(truxton)
2804 STD_ROM_FN(truxton)
2805 
2806 struct BurnDriver BurnDrvTruxton = {
2807 	"truxton", NULL, NULL, NULL, "1988",
2808 	"Truxton / Tatsujin\0", NULL, "Toaplan / Taito Corporation", "Toaplan BCU-2 / FCU-2 based",
2809 	NULL, NULL, NULL, NULL,
2810 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2811 	NULL, truxtonRomInfo, truxtonRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, TruxtonDIPInfo,
2812 	TruxtonInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2813 	240, 320, 3, 4
2814 };
2815 
2816 
2817 // Hellfire (2P set)
2818 
2819 static struct BurnRomInfo hellfireRomDesc[] = {
2820 	{ "b90_14.0",			0x20000, 0x101df9f5, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2821 	{ "b90_15.1",			0x20000, 0xe67fd452, 1 | BRF_PRG | BRF_ESS }, //  1
2822 
2823 	{ "b90_03.2",			0x08000, 0x4058fa67, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
2824 
2825 	{ "b90_04.3",			0x20000, 0xea6150fc, 3 | BRF_GRA },           //  3 Layer Tiles
2826 	{ "b90_05.4",			0x20000, 0xbb52c507, 3 | BRF_GRA },           //  4
2827 	{ "b90_06.5",			0x20000, 0xcf5b0252, 3 | BRF_GRA },           //  5
2828 	{ "b90_07.6",			0x20000, 0xb98af263, 3 | BRF_GRA },           //  6
2829 
2830 	{ "b90_11.10",			0x20000, 0xc33e543c, 5 | BRF_GRA },           //  7 Sprites
2831 	{ "b90_10.9",			0x20000, 0x35fd1092, 5 | BRF_GRA },           //  8
2832 	{ "b90_09.8",			0x20000, 0xcf01009e, 5 | BRF_GRA },           //  9
2833 	{ "b90_08.7",			0x20000, 0x3404a5e3, 5 | BRF_GRA },           // 10
2834 
2835 	{ "13.3w",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 11 PROMs
2836 	{ "12.6b",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 12
2837 };
2838 
2839 STD_ROM_PICK(hellfire)
2840 STD_ROM_FN(hellfire)
2841 
2842 struct BurnDriver BurnDrvHellfire = {
2843 	"hellfire", NULL, NULL, NULL, "1989",
2844 	"Hellfire (2P set)\0", NULL, "Toaplan (Taito license)", "Toaplan BCU-2 / FCU-2 based",
2845 	NULL, NULL, NULL, NULL,
2846 	BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2847 	NULL, hellfireRomInfo, hellfireRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, HellfireDIPInfo,
2848 	HellfireInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2849 	320, 240, 4, 3
2850 };
2851 
2852 
2853 // Hellfire (1P set)
2854 
2855 static struct BurnRomInfo hellfire1RomDesc[] = {
2856 	{ "b90_01.10m",			0x20000, 0x034966d3, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2857 	{ "b90_02.9m",			0x20000, 0x06dd24c7, 1 | BRF_PRG | BRF_ESS }, //  1
2858 
2859 	{ "b90_03.2",			0x08000, 0x4058fa67, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
2860 
2861 	{ "b90_04.3",			0x20000, 0xea6150fc, 3 | BRF_GRA },           //  3 Layer Tiles
2862 	{ "b90_05.4",			0x20000, 0xbb52c507, 3 | BRF_GRA },           //  4
2863 	{ "b90_06.5",			0x20000, 0xcf5b0252, 3 | BRF_GRA },           //  5
2864 	{ "b90_07.6",			0x20000, 0xb98af263, 3 | BRF_GRA },           //  6
2865 
2866 	{ "b90_11.10",			0x20000, 0xc33e543c, 5 | BRF_GRA },           //  7 Sprites
2867 	{ "b90_10.9",			0x20000, 0x35fd1092, 5 | BRF_GRA },           //  8
2868 	{ "b90_09.8",			0x20000, 0xcf01009e, 5 | BRF_GRA },           //  9
2869 	{ "b90_08.7",			0x20000, 0x3404a5e3, 5 | BRF_GRA },           // 10
2870 
2871 	{ "13.3w",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 11 PROMs
2872 	{ "12.6b",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 12
2873 };
2874 
2875 STD_ROM_PICK(hellfire1)
2876 STD_ROM_FN(hellfire1)
2877 
2878 struct BurnDriver BurnDrvHellfire1 = {
2879 	"hellfire1", "hellfire", NULL, NULL, "1989",
2880 	"Hellfire (1P set)\0", NULL, "Toaplan (Taito license)", "Toaplan BCU-2 / FCU-2 based",
2881 	NULL, NULL, NULL, NULL,
2882 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2883 	NULL, hellfire1RomInfo, hellfire1RomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, Hellfire1DIPInfo,
2884 	HellfireInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2885 	320, 240, 4, 3
2886 };
2887 
2888 
2889 // Hellfire (2P set, older)
2890 
2891 static struct BurnRomInfo hellfire2aRomDesc[] = {
2892 	{ "b90_01.0",			0x20000, 0xc94acf53, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2893 	{ "b90_02.1",			0x20000, 0xd17f03c3, 1 | BRF_PRG | BRF_ESS }, //  1
2894 
2895 	{ "b90_03.2",			0x08000, 0x4058fa67, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
2896 
2897 	{ "b90_04.3",			0x20000, 0xea6150fc, 3 | BRF_GRA },           //  3 Layer Tiles
2898 	{ "b90_05.4",			0x20000, 0xbb52c507, 3 | BRF_GRA },           //  4
2899 	{ "b90_06.5",			0x20000, 0xcf5b0252, 3 | BRF_GRA },           //  5
2900 	{ "b90_07.6",			0x20000, 0xb98af263, 3 | BRF_GRA },           //  6
2901 
2902 	{ "b90_11.10",			0x20000, 0xc33e543c, 5 | BRF_GRA },           //  7 Sprites
2903 	{ "b90_10.9",			0x20000, 0x35fd1092, 5 | BRF_GRA },           //  8
2904 	{ "b90_09.8",			0x20000, 0xcf01009e, 5 | BRF_GRA },           //  9
2905 	{ "b90_08.7",			0x20000, 0x3404a5e3, 5 | BRF_GRA },           // 10
2906 
2907 	{ "13.3w",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 11 PROMs
2908 	{ "12.6b",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 12
2909 };
2910 
2911 STD_ROM_PICK(hellfire2a)
2912 STD_ROM_FN(hellfire2a)
2913 
2914 struct BurnDriver BurnDrvHellfire2a = {
2915 	"hellfire2a", "hellfire", NULL, NULL, "1989",
2916 	"Hellfire (2P set, older)\0", NULL, "Toaplan (Taito license)", "Toaplan BCU-2 / FCU-2 based",
2917 	NULL, NULL, NULL, NULL,
2918 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2919 	NULL, hellfire2aRomInfo, hellfire2aRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, Hellfire2aDIPInfo,
2920 	HellfireInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2921 	320, 240, 4, 3
2922 };
2923 
2924 
2925 // Hellfire (1P set, older)
2926 
2927 static struct BurnRomInfo hellfire1aRomDesc[] = {
2928 	{ "b90_14x.0",			0x20000, 0xa3141ea5, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2929 	{ "b90_15x.1",			0x20000, 0xe864daf4, 1 | BRF_PRG | BRF_ESS }, //  1
2930 
2931 	{ "b90_03x.2",			0x08000, 0xf58c368f, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
2932 
2933 	{ "b90_04.3",			0x20000, 0xea6150fc, 3 | BRF_GRA },           //  3 Layer Tiles
2934 	{ "b90_05.4",			0x20000, 0xbb52c507, 3 | BRF_GRA },           //  4
2935 	{ "b90_06.5",			0x20000, 0xcf5b0252, 3 | BRF_GRA },           //  5
2936 	{ "b90_07.6",			0x20000, 0xb98af263, 3 | BRF_GRA },           //  6
2937 
2938 	{ "b90_11.10",			0x20000, 0xc33e543c, 5 | BRF_GRA },           //  7 Sprites
2939 	{ "b90_10.9",			0x20000, 0x35fd1092, 5 | BRF_GRA },           //  8
2940 	{ "b90_09.8",			0x20000, 0xcf01009e, 5 | BRF_GRA },           //  9
2941 	{ "b90_08.7",			0x20000, 0x3404a5e3, 5 | BRF_GRA },           // 10
2942 
2943 	{ "13.3w",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 11 PROMs
2944 	{ "12.6b",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 12
2945 };
2946 
2947 STD_ROM_PICK(hellfire1a)
2948 STD_ROM_FN(hellfire1a)
2949 
2950 struct BurnDriver BurnDrvHellfire1a = {
2951 	"hellfire1a", "hellfire", NULL, NULL, "1989",
2952 	"Hellfire (1P set, older)\0", NULL, "Toaplan (Taito license)", "Toaplan BCU-2 / FCU-2 based",
2953 	NULL, NULL, NULL, NULL,
2954 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2955 	NULL, hellfire1aRomInfo, hellfire1aRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, Hellfire1aDIPInfo,
2956 	HellfireInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2957 	320, 240, 4, 3
2958 };
2959 
2960 
2961 // Zero Wing (2P set)
2962 
2963 static struct BurnRomInfo zerowingRomDesc[] = {
2964 	{ "o15-11ii.bin",		0x08000, 0xe697ecb9, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
2965 	{ "o15-12ii.bin",		0x08000, 0xb29ee3ad, 1 | BRF_PRG | BRF_ESS }, //  1
2966 	{ "o15-09.rom",			0x20000, 0x13764e95, 1 | BRF_PRG | BRF_ESS }, //  2
2967 	{ "o15-10.rom",			0x20000, 0x351ba71a, 1 | BRF_PRG | BRF_ESS }, //  3
2968 
2969 	{ "o15-13.rom",			0x08000, 0xe7b72383, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 Code
2970 
2971 	{ "o15-05.rom",			0x20000, 0x4e5dd246, 3 | BRF_GRA },           //  5 Layer Tiles
2972 	{ "o15-06.rom",			0x20000, 0xc8c6d428, 3 | BRF_GRA },           //  6
2973 	{ "o15-07.rom",			0x20000, 0xefc40e99, 3 | BRF_GRA },           //  7
2974 	{ "o15-08.rom",			0x20000, 0x1b019eab, 3 | BRF_GRA },           //  8
2975 
2976 	{ "o15-03.rom",			0x20000, 0x7f245fd3, 5 | BRF_GRA },           //  9 Sprites
2977 	{ "o15-04.rom",			0x20000, 0x0b1a1289, 5 | BRF_GRA },           // 10
2978 	{ "o15-01.rom",			0x20000, 0x70570e43, 5 | BRF_GRA },           // 11
2979 	{ "o15-02.rom",			0x20000, 0x724b487f, 5 | BRF_GRA },           // 12
2980 
2981 	{ "tp015_14.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
2982 	{ "tp015_15.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
2983 };
2984 
2985 STD_ROM_PICK(zerowing)
2986 STD_ROM_FN(zerowing)
2987 
2988 struct BurnDriver BurnDrvZerowing = {
2989 	"zerowing", NULL, NULL, NULL, "1989",
2990 	"Zero Wing (2P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
2991 	NULL, NULL, NULL, NULL,
2992 	BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
2993 	NULL, zerowingRomInfo, zerowingRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, Zerowing2DIPInfo,
2994 	ZerowingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
2995 	320, 240, 4, 3
2996 };
2997 
2998 
2999 // Zero Wing (1P set)
3000 
3001 static struct BurnRomInfo zerowing1RomDesc[] = {
3002 	{ "o15-11.rom",			0x08000, 0x6ff2b9a0, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3003 	{ "o15-12.rom",			0x08000, 0x9773e60b, 1 | BRF_PRG | BRF_ESS }, //  1
3004 	{ "o15-09.rom",			0x20000, 0x13764e95, 1 | BRF_PRG | BRF_ESS }, //  2
3005 	{ "o15-10.rom",			0x20000, 0x351ba71a, 1 | BRF_PRG | BRF_ESS }, //  3
3006 
3007 	{ "o15-13.rom",			0x08000, 0xe7b72383, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 Code
3008 
3009 	{ "o15-05.rom",			0x20000, 0x4e5dd246, 3 | BRF_GRA },           //  5 Layer Tiles
3010 	{ "o15-06.rom",			0x20000, 0xc8c6d428, 3 | BRF_GRA },           //  6
3011 	{ "o15-07.rom",			0x20000, 0xefc40e99, 3 | BRF_GRA },           //  7
3012 	{ "o15-08.rom",			0x20000, 0x1b019eab, 3 | BRF_GRA },           //  8
3013 
3014 	{ "o15-03.rom",			0x20000, 0x7f245fd3, 5 | BRF_GRA },           //  9 Sprites
3015 	{ "o15-04.rom",			0x20000, 0x0b1a1289, 5 | BRF_GRA },           // 10
3016 	{ "o15-01.rom",			0x20000, 0x70570e43, 5 | BRF_GRA },           // 11
3017 	{ "o15-02.rom",			0x20000, 0x724b487f, 5 | BRF_GRA },           // 12
3018 
3019 	{ "tp015_14.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3020 	{ "tp015_15.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3021 };
3022 
3023 STD_ROM_PICK(zerowing1)
3024 STD_ROM_FN(zerowing1)
3025 
3026 struct BurnDriver BurnDrvZerowing1 = {
3027 	"zerowing1", "zerowing", NULL, NULL, "1989",
3028 	"Zero Wing (1P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3029 	NULL, NULL, NULL, NULL,
3030 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3031 	NULL, zerowing1RomInfo, zerowing1RomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, ZerowingDIPInfo,
3032 	ZerowingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3033 	320, 240, 4, 3
3034 };
3035 
3036 
3037 // Zero Wing (2P set, Williams license)
3038 
3039 static struct BurnRomInfo zerowingwRomDesc[] = {
3040 	{ "o15-11iiw.bin",		0x08000, 0x38b0bb5b, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3041 	{ "o15-12iiw.bin",		0x08000, 0x74c91e6f, 1 | BRF_PRG | BRF_ESS }, //  1
3042 	{ "o15-09.rom",			0x20000, 0x13764e95, 1 | BRF_PRG | BRF_ESS }, //  2
3043 	{ "o15-10.rom",			0x20000, 0x351ba71a, 1 | BRF_PRG | BRF_ESS }, //  3
3044 
3045 	{ "o15-13.rom",			0x08000, 0xe7b72383, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 Code
3046 
3047 	{ "o15-05.rom",			0x20000, 0x4e5dd246, 3 | BRF_GRA },           //  5 Layer Tiles
3048 	{ "o15-06.rom",			0x20000, 0xc8c6d428, 3 | BRF_GRA },           //  6
3049 	{ "o15-07.rom",			0x20000, 0xefc40e99, 3 | BRF_GRA },           //  7
3050 	{ "o15-08.rom",			0x20000, 0x1b019eab, 3 | BRF_GRA },           //  8
3051 
3052 	{ "o15-03.rom",			0x20000, 0x7f245fd3, 5 | BRF_GRA },           //  9 Sprites
3053 	{ "o15-04.rom",			0x20000, 0x0b1a1289, 5 | BRF_GRA },           // 10
3054 	{ "o15-01.rom",			0x20000, 0x70570e43, 5 | BRF_GRA },           // 11
3055 	{ "o15-02.rom",			0x20000, 0x724b487f, 5 | BRF_GRA },           // 12
3056 
3057 	{ "tp015_14.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3058 	{ "tp015_15.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3059 };
3060 
3061 STD_ROM_PICK(zerowingw)
3062 STD_ROM_FN(zerowingw)
3063 
3064 struct BurnDriver BurnDrvZerowingw = {
3065 	"zerowingw", "zerowing", NULL, NULL, "1989",
3066 	"Zero Wing (2P set, Williams license)\0", NULL, "Toaplan (Williams license)", "Toaplan BCU-2 / FCU-2 based",
3067 	NULL, NULL, NULL, NULL,
3068 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3069 	NULL, zerowingwRomInfo, zerowingwRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, Zerowing2DIPInfo,
3070 	ZerowingInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3071 	320, 240, 4, 3
3072 };
3073 
3074 
3075 // Demon's World / Horror Story (set 1)
3076 
3077 static struct BurnRomInfo demonwldRomDesc[] = {
3078 	{ "o16-10.v2",			0x20000, 0xca8194f3, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3079 	{ "o16-09.v2",			0x20000, 0x7baea7ba, 1 | BRF_PRG | BRF_ESS }, //  1
3080 
3081 	{ "rom11.v2",			0x08000, 0xdbe08c85, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3082 
3083 	{ "dsp_21.bin",			0x00800, 0x2d135376, 7 | BRF_PRG | BRF_ESS }, //  3 DSP Code
3084 	{ "dsp_22.bin",			0x00800, 0x79389a71, 7 | BRF_PRG | BRF_ESS }, //  4
3085 
3086 	{ "rom05",			0x20000, 0x6506c982, 3 | BRF_GRA },           //  5 Layer Tiles
3087 	{ "rom07",			0x20000, 0xa3a0d993, 3 | BRF_GRA },           //  6
3088 	{ "rom06",			0x20000, 0x4fc5e5f3, 3 | BRF_GRA },           //  7
3089 	{ "rom08",			0x20000, 0xeb53ab09, 3 | BRF_GRA },           //  8
3090 
3091 	{ "rom01",			0x20000, 0x1b3724e9, 5 | BRF_GRA },           //  9 Sprites
3092 	{ "rom02",			0x20000, 0x7b20a44d, 5 | BRF_GRA },           // 10
3093 	{ "rom03",			0x20000, 0x2cacdcd0, 5 | BRF_GRA },           // 11
3094 	{ "rom04",			0x20000, 0x76fd3201, 5 | BRF_GRA },           // 12
3095 
3096 	{ "prom12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3097 	{ "prom13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3098 };
3099 
3100 STD_ROM_PICK(demonwld)
3101 STD_ROM_FN(demonwld)
3102 
3103 struct BurnDriver BurnDrvDemonwld = {
3104 	"demonwld", NULL, NULL, NULL, "1990",
3105 	"Demon's World / Horror Story (set 1)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3106 	L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 1)\0", NULL, NULL, NULL,
3107 	BDF_GAME_WORKING | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3108 	NULL, demonwldRomInfo, demonwldRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, DemonwldDIPInfo,
3109 	DemonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3110 	320, 240, 4, 3
3111 };
3112 
3113 
3114 // Demon's World / Horror Story (set 2)
3115 
3116 static struct BurnRomInfo demonwld1RomDesc[] = {
3117 	{ "o16n-10.bin",		0x20000, 0xfc38aeaa, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3118 	{ "o16n-09.bin",		0x20000, 0x74f66643, 1 | BRF_PRG | BRF_ESS }, //  1
3119 
3120 	{ "o16-11.bin",			0x08000, 0xdbe08c85, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3121 
3122 	{ "dsp_21.bin",			0x00800, 0x2d135376, 7 | BRF_PRG | BRF_ESS }, //  3 DSP Code
3123 	{ "dsp_22.bin",			0x00800, 0x79389a71, 7 | BRF_PRG | BRF_ESS }, //  4
3124 
3125 	{ "rom05",			0x20000, 0x6506c982, 3 | BRF_GRA },           //  5 Layer Tiles
3126 	{ "rom07",			0x20000, 0xa3a0d993, 3 | BRF_GRA },           //  6
3127 	{ "rom06",			0x20000, 0x4fc5e5f3, 3 | BRF_GRA },           //  7
3128 	{ "rom08",			0x20000, 0xeb53ab09, 3 | BRF_GRA },           //  8
3129 
3130 	{ "rom01",			0x20000, 0x1b3724e9, 5 | BRF_GRA },           //  9 Sprites
3131 	{ "rom02",			0x20000, 0x7b20a44d, 5 | BRF_GRA },           // 10
3132 	{ "rom03",			0x20000, 0x2cacdcd0, 5 | BRF_GRA },           // 11
3133 	{ "rom04",			0x20000, 0x76fd3201, 5 | BRF_GRA },           // 12
3134 
3135 	{ "prom12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3136 	{ "prom13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3137 };
3138 
3139 STD_ROM_PICK(demonwld1)
3140 STD_ROM_FN(demonwld1)
3141 
3142 struct BurnDriver BurnDrvDemonwld1 = {
3143 	"demonwld1", "demonwld", NULL, NULL, "1989",
3144 	"Demon's World / Horror Story (set 2)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3145 	L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 2)\0", NULL, NULL, NULL,
3146 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3147 	NULL, demonwld1RomInfo, demonwld1RomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, DemonwldDIPInfo,
3148 	DemonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3149 	320, 240, 4, 3
3150 };
3151 
3152 
3153 // Demon's World / Horror Story (set 3)
3154 
3155 static struct BurnRomInfo demonwld2RomDesc[] = {
3156 	{ "o16-10.rom",			0x20000, 0x036ee46c, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3157 	{ "o16-09.rom",			0x20000, 0xbed746e3, 1 | BRF_PRG | BRF_ESS }, //  1
3158 
3159 	{ "rom11",			0x08000, 0x397eca1b, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3160 
3161 	{ "dsp_21.bin",			0x00800, 0x2d135376, 7 | BRF_PRG | BRF_ESS }, //  3 DSP Code
3162 	{ "dsp_22.bin",			0x00800, 0x79389a71, 7 | BRF_PRG | BRF_ESS }, //  4
3163 
3164 	{ "rom05",			0x20000, 0x6506c982, 3 | BRF_GRA },           //  5 Layer Tiles
3165 	{ "rom07",			0x20000, 0xa3a0d993, 3 | BRF_GRA },           //  6
3166 	{ "rom06",			0x20000, 0x4fc5e5f3, 3 | BRF_GRA },           //  7
3167 	{ "rom08",			0x20000, 0xeb53ab09, 3 | BRF_GRA },           //  8
3168 
3169 	{ "rom01",			0x20000, 0x1b3724e9, 5 | BRF_GRA },           //  9 Sprites
3170 	{ "rom02",			0x20000, 0x7b20a44d, 5 | BRF_GRA },           // 10
3171 	{ "rom03",			0x20000, 0x2cacdcd0, 5 | BRF_GRA },           // 11
3172 	{ "rom04",			0x20000, 0x76fd3201, 5 | BRF_GRA },           // 12
3173 
3174 	{ "prom12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3175 	{ "prom13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3176 };
3177 
3178 STD_ROM_PICK(demonwld2)
3179 STD_ROM_FN(demonwld2)
3180 
3181 struct BurnDriver BurnDrvDemonwld2 = {
3182 	"demonwld2", "demonwld", NULL, NULL, "1989",
3183 	"Demon's World / Horror Story (set 3)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3184 	L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 3)\0", NULL, NULL, NULL,
3185 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3186 	NULL, demonwld2RomInfo, demonwld2RomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, Demonwld1DIPInfo,
3187 	DemonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3188 	320, 240, 4, 3
3189 };
3190 
3191 
3192 // Demon's World / Horror Story (set 4)
3193 
3194 static struct BurnRomInfo demonwld3RomDesc[] = {
3195 	{ "o16-10-2.bin",		0x20000, 0x84ee5218, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3196 	{ "o16-09-2.bin",		0x20000, 0xcf474cb2, 1 | BRF_PRG | BRF_ESS }, //  1
3197 
3198 	{ "rom11",			0x08000, 0x397eca1b, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3199 
3200 	{ "dsp_21.bin",			0x00800, 0x2d135376, 7 | BRF_PRG | BRF_ESS }, //  3 DSP Code
3201 	{ "dsp_22.bin",			0x00800, 0x79389a71, 7 | BRF_PRG | BRF_ESS }, //  4
3202 
3203 	{ "rom05",			0x20000, 0x6506c982, 3 | BRF_GRA },           //  5 Layer Tiles
3204 	{ "rom07",			0x20000, 0xa3a0d993, 3 | BRF_GRA },           //  6
3205 	{ "rom06",			0x20000, 0x4fc5e5f3, 3 | BRF_GRA },           //  7
3206 	{ "rom08",			0x20000, 0xeb53ab09, 3 | BRF_GRA },           //  8
3207 
3208 	{ "rom01",			0x20000, 0x1b3724e9, 5 | BRF_GRA },           //  9 Sprites
3209 	{ "rom02",			0x20000, 0x7b20a44d, 5 | BRF_GRA },           // 10
3210 	{ "rom03",			0x20000, 0x2cacdcd0, 5 | BRF_GRA },           // 11
3211 	{ "rom04",			0x20000, 0x76fd3201, 5 | BRF_GRA },           // 12
3212 
3213 	{ "prom12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3214 	{ "prom13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3215 };
3216 
3217 STD_ROM_PICK(demonwld3)
3218 STD_ROM_FN(demonwld3)
3219 
3220 struct BurnDriver BurnDrvDemonwld3 = {
3221 	"demonwld3", "demonwld", NULL, NULL, "1989",
3222 	"Demon's World / Horror Story (set 4)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3223 	L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 4)\0", NULL, NULL, NULL,
3224 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3225 	NULL, demonwld3RomInfo, demonwld3RomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, Demonwld1DIPInfo,
3226 	DemonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3227 	320, 240, 4, 3
3228 };
3229 
3230 
3231 // Demon's World / Horror Story (set 5)
3232 
3233 static struct BurnRomInfo demonwld4RomDesc[] = {
3234 	{ "o16-10.bin",			0x20000, 0x6f7468e0, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3235 	{ "o16-09.bin",			0x20000, 0xa572f5f7, 1 | BRF_PRG | BRF_ESS }, //  1
3236 
3237 	{ "rom11",			0x08000, 0x397eca1b, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3238 
3239 	{ "dsp_21.bin",			0x00800, 0x2d135376, 7 | BRF_PRG | BRF_ESS }, //  3 DSP Code
3240 	{ "dsp_22.bin",			0x00800, 0x79389a71, 7 | BRF_PRG | BRF_ESS }, //  4
3241 
3242 	{ "rom05",			0x20000, 0x6506c982, 3 | BRF_GRA },           //  5 Layer Tiles
3243 	{ "rom07",			0x20000, 0xa3a0d993, 3 | BRF_GRA },           //  6
3244 	{ "rom06",			0x20000, 0x4fc5e5f3, 3 | BRF_GRA },           //  7
3245 	{ "rom08",			0x20000, 0xeb53ab09, 3 | BRF_GRA },           //  8
3246 
3247 	{ "rom01",			0x20000, 0x1b3724e9, 5 | BRF_GRA },           //  9 Sprites
3248 	{ "rom02",			0x20000, 0x7b20a44d, 5 | BRF_GRA },           // 10
3249 	{ "rom03",			0x20000, 0x2cacdcd0, 5 | BRF_GRA },           // 11
3250 	{ "rom04",			0x20000, 0x76fd3201, 5 | BRF_GRA },           // 12
3251 
3252 	{ "prom12.bpr",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3253 	{ "prom13.bpr",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3254 };
3255 
3256 STD_ROM_PICK(demonwld4)
3257 STD_ROM_FN(demonwld4)
3258 
3259 struct BurnDriver BurnDrvDemonwld4 = {
3260 	"demonwld4", "demonwld", NULL, NULL, "1989",
3261 	"Demon's World / Horror Story (set 5)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3262 	L"Demon's World\0\u30DB\u30E9\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC (set 5)\0", NULL, NULL, NULL,
3263 	BDF_GAME_WORKING | BDF_CLONE | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3264 	NULL, demonwld4RomInfo, demonwld4RomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, Demonwld1DIPInfo,
3265 	DemonwldInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3266 	320, 240, 4, 3
3267 };
3268 
3269 
3270 // Same! Same! Same! (1P set)
3271 
3272 static struct BurnRomInfo samesameRomDesc[] = {
3273 	{ "o17_09.8j",			0x08000, 0x3f69e437, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3274 	{ "o17_10.8l",			0x08000, 0x4e723e0a, 1 | BRF_PRG | BRF_ESS }, //  1
3275 	{ "o17_11.7j",			0x20000, 0xbe07d101, 1 | BRF_PRG | BRF_ESS }, //  2
3276 	{ "o17_12.7l",			0x20000, 0xef698811, 1 | BRF_PRG | BRF_ESS }, //  3
3277 
3278 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3279 
3280 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3281 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3282 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3283 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3284 
3285 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3286 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3287 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3288 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3289 
3290 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3291 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3292 };
3293 
3294 STD_ROM_PICK(samesame)
3295 STD_ROM_FN(samesame)
3296 
3297 struct BurnDriver BurnDrvSamesame = {
3298 	"samesame", "fireshrk", NULL, NULL, "1989",
3299 	"Same! Same! Same! (1P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3300 	L"\u9BAB!\u9BAB!\u9BAB!\0Same! Same! Same! (1P set)\0", NULL, NULL, NULL,
3301 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3302 	NULL, samesameRomInfo, samesameRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, SamesameDIPInfo,
3303 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3304 	240, 320, 3, 4
3305 };
3306 
3307 
3308 // Same! Same! Same! (2P set)
3309 
3310 static struct BurnRomInfo samesame2RomDesc[] = {
3311 	{ "o17_09x.8j",			0x08000, 0x3472e03e, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3312 	{ "o17_10x.8l",			0x08000, 0xa3ac49b5, 1 | BRF_PRG | BRF_ESS }, //  1
3313 	{ "o17_11ii.7j",		0x20000, 0x6beac378, 1 | BRF_PRG | BRF_ESS }, //  2
3314 	{ "o17_12ii.7l",		0x20000, 0x6adb6eb5, 1 | BRF_PRG | BRF_ESS }, //  3
3315 
3316 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3317 
3318 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3319 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3320 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3321 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3322 
3323 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3324 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3325 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3326 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3327 
3328 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3329 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3330 };
3331 
3332 STD_ROM_PICK(samesame2)
3333 STD_ROM_FN(samesame2)
3334 
3335 struct BurnDriver BurnDrvSamesame2 = {
3336 	"samesame2", "fireshrk", NULL, NULL, "1989",
3337 	"Same! Same! Same! (2P set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3338 	L"\u9BAB!\u9BAB!\u9BAB!\0Same! Same! Same!\0", NULL, NULL, NULL,
3339 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3340 	NULL, samesame2RomInfo, samesame2RomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, Samesame2DIPInfo,
3341 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3342 	240, 320, 3, 4
3343 };
3344 
3345 
3346 // Same! Same! Same! (1P set, NEW VER! hack)
3347 
3348 static struct BurnRomInfo samesamenhRomDesc[] = {
3349 	{ "o17_09_nv.8j",		0x08000, 0xf60af2f9, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3350 	{ "o17_10_nv.8l",		0x08000, 0x023bcb95, 1 | BRF_PRG | BRF_ESS }, //  1
3351 	{ "o17_11.7j",			0x20000, 0xbe07d101, 1 | BRF_PRG | BRF_ESS }, //  2
3352 	{ "o17_12.7l",			0x20000, 0xef698811, 1 | BRF_PRG | BRF_ESS }, //  3
3353 
3354 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3355 
3356 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3357 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3358 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3359 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3360 
3361 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3362 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3363 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3364 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3365 
3366 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3367 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3368 };
3369 
3370 STD_ROM_PICK(samesamenh)
3371 STD_ROM_FN(samesamenh)
3372 
3373 struct BurnDriver BurnDrvSamesamenh = {
3374 	"samesamenh", "fireshrk", NULL, NULL, "2015",
3375 	"Same! Same! Same! (1P set, NEW VER! hack)\0", NULL, "hack (trap15)", "Toaplan BCU-2 / FCU-2 based",
3376 	NULL, NULL, NULL, NULL,
3377 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3378 	NULL, samesamenhRomInfo, samesamenhRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, SamesameDIPInfo,
3379 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3380 	240, 320, 3, 4
3381 };
3382 
3383 
3384 // Fire Shark
3385 
3386 static struct BurnRomInfo fireshrkRomDesc[] = {
3387 	{ "09.8j",			0x08000, 0xf0c70e6f, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3388 	{ "10.8l",			0x08000, 0x9d253d77, 1 | BRF_PRG | BRF_ESS }, //  1
3389 	{ "o17_11ii.7j",		0x20000, 0x6beac378, 1 | BRF_PRG | BRF_ESS }, //  2
3390 	{ "o17_12ii.7l",		0x20000, 0x6adb6eb5, 1 | BRF_PRG | BRF_ESS }, //  3
3391 
3392 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3393 
3394 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3395 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3396 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3397 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3398 
3399 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3400 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3401 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3402 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3403 
3404 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3405 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3406 };
3407 
3408 STD_ROM_PICK(fireshrk)
3409 STD_ROM_FN(fireshrk)
3410 
3411 struct BurnDriver BurnDrvFireshrk = {
3412 	"fireshrk", NULL, NULL, NULL, "1990",
3413 	"Fire Shark\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3414 	NULL, NULL, NULL, NULL,
3415 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3416 	NULL, fireshrkRomInfo, fireshrkRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, FireshrkDIPInfo,
3417 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3418 	240, 320, 3, 4
3419 };
3420 
3421 
3422 // Fire Shark (earlier)
3423 
3424 static struct BurnRomInfo fireshrkaRomDesc[] = {
3425 	{ "o17_09ii.8j",		0x08000, 0xb60541ee, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3426 	{ "o17_10ii.8l",		0x08000, 0x96f5045e, 1 | BRF_PRG | BRF_ESS }, //  1
3427 	{ "o17_11ii.7j",		0x20000, 0x6beac378, 1 | BRF_PRG | BRF_ESS }, //  2
3428 	{ "o17_12ii.7l",		0x20000, 0x6adb6eb5, 1 | BRF_PRG | BRF_ESS }, //  3
3429 
3430 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3431 
3432 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3433 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3434 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3435 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3436 
3437 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3438 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3439 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3440 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3441 
3442 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3443 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3444 };
3445 
3446 STD_ROM_PICK(fireshrka)
3447 STD_ROM_FN(fireshrka)
3448 
3449 struct BurnDriver BurnDrvFireshrka = {
3450 	"fireshrka", "fireshrk", NULL, NULL, "1989",
3451 	"Fire Shark (earlier)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3452 	NULL, NULL, NULL, NULL,
3453 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3454 	NULL, fireshrkaRomInfo, fireshrkaRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, FireshrkaDIPInfo,
3455 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3456 	240, 320, 3, 4
3457 };
3458 
3459 
3460 // Fire Shark (Korea, set 1, easier)
3461 
3462 static struct BurnRomInfo fireshrkdRomDesc[] = {
3463 	{ "o17_09dyn.8j",		0x10000, 0xe25eee27, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3464 	{ "o17_10dyn.8l",		0x10000, 0xc4c58cf6, 1 | BRF_PRG | BRF_ESS }, //  1
3465 	{ "o17_11ii.7j",		0x20000, 0x6beac378, 1 | BRF_PRG | BRF_ESS }, //  2
3466 	{ "o17_12ii.7l",		0x20000, 0x6adb6eb5, 1 | BRF_PRG | BRF_ESS }, //  3
3467 
3468 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3469 
3470 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3471 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3472 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3473 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3474 
3475 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3476 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3477 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3478 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3479 
3480 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3481 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3482 };
3483 
3484 STD_ROM_PICK(fireshrkd)
3485 STD_ROM_FN(fireshrkd)
3486 
3487 struct BurnDriver BurnDrvFireshrkd = {
3488 	"fireshrkd", "fireshrk", NULL, NULL, "1990",
3489 	"Fire Shark (Korea, set 1, easier)\0", NULL, "Toaplan (Dooyong license)", "Toaplan BCU-2 / FCU-2 based",
3490 	NULL, NULL, NULL, NULL,
3491 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3492 	NULL, fireshrkdRomInfo, fireshrkdRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, Samesame2DIPInfo,
3493 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3494 	240, 320, 3, 4
3495 };
3496 
3497 
3498 // Fire Shark (Korea, set 2, harder)
3499 
3500 static struct BurnRomInfo fireshrkdhRomDesc[] = {
3501 	{ "o17_09dyh.8j",		0x10000, 0x7b4c14dd, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3502 	{ "o17_10dyh.8l",		0x10000, 0xa3f159f9, 1 | BRF_PRG | BRF_ESS }, //  1
3503 	{ "o17_11ii.7j",		0x20000, 0x6beac378, 1 | BRF_PRG | BRF_ESS }, //  2
3504 	{ "o17_12ii.7l",		0x20000, 0x6adb6eb5, 1 | BRF_PRG | BRF_ESS }, //  3
3505 
3506 	{ "hd647180.017",		0x08000, 0x43523032, 2 | BRF_PRG | BRF_ESS }, //  4 Z180 Code
3507 
3508 	{ "o17_05.12j",			0x20000, 0x565315f8, 3 | BRF_GRA },           //  5 Layer Tiles
3509 	{ "o17_06.13j",			0x20000, 0x95262d4c, 3 | BRF_GRA },           //  6
3510 	{ "o17_07.12l",			0x20000, 0x4c4b735c, 3 | BRF_GRA },           //  7
3511 	{ "o17_08.13l",			0x20000, 0x95c6586c, 3 | BRF_GRA },           //  8
3512 
3513 	{ "o17_01.1d",			0x20000, 0xea12e491, 5 | BRF_GRA },           //  9 Sprites
3514 	{ "o17_02.3d",			0x20000, 0x32a13a9f, 5 | BRF_GRA },           // 10
3515 	{ "o17_03.5d",			0x20000, 0x68723dc9, 5 | BRF_GRA },           // 11
3516 	{ "o17_04.7d",			0x20000, 0xfe0ecb13, 5 | BRF_GRA },           // 12
3517 
3518 	{ "prom14.25b",			0x00020, 0xbc88cced, 0 | BRF_OPT },           // 13 PROMs
3519 	{ "prom15.20c",			0x00020, 0xa1e17492, 0 | BRF_OPT },           // 14
3520 };
3521 
3522 STD_ROM_PICK(fireshrkdh)
3523 STD_ROM_FN(fireshrkdh)
3524 
3525 struct BurnDriver BurnDrvFireshrkdh = {
3526 	"fireshrkdh", "fireshrk", NULL, NULL, "1990",
3527 	"Fire Shark (Korea, set 2, harder)\0", NULL, "Toaplan (Dooyong license)", "Toaplan BCU-2 / FCU-2 based",
3528 	NULL, NULL, NULL, NULL,
3529 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3530 	NULL, fireshrkdhRomInfo, fireshrkdhRomName, NULL, NULL, NULL, NULL, FiresharkInputInfo, Samesame2DIPInfo,
3531 	SamesameInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3532 	240, 320, 3, 4
3533 };
3534 
3535 
3536 // Out Zone
3537 
3538 static struct BurnRomInfo outzoneRomDesc[] = {
3539 	{ "tp_018_08.bin",		0x20000, 0x127a38d7, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3540 	{ "tp_018_07.bin",		0x20000, 0x9704db16, 1 | BRF_PRG | BRF_ESS }, //  1
3541 
3542 	{ "tp_018_09.bin",		0x08000, 0x73d8e235, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3543 
3544 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3545 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3546 
3547 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3548 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3549 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3550 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3551 
3552 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3553 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3554 };
3555 
3556 STD_ROM_PICK(outzone)
3557 STD_ROM_FN(outzone)
3558 
3559 struct BurnDriver BurnDrvOutzone = {
3560 	"outzone", NULL, NULL, NULL, "1990",
3561 	"Out Zone\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3562 	NULL, NULL, NULL, NULL,
3563 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3564 	NULL, outzoneRomInfo, outzoneRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzoneDIPInfo,
3565 	OutzoneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3566 	240, 320, 3, 4
3567 };
3568 
3569 
3570 // Out Zone (harder)
3571 
3572 static struct BurnRomInfo outzonehRomDesc[] = {
3573 	{ "tp_018_07h.bin",		0x20000, 0x0c2ac02d, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3574 	{ "tp_018_08h.bin",		0x20000, 0xca7e48aa, 1 | BRF_PRG | BRF_ESS }, //  1
3575 
3576 	{ "tp_018_09.bin",		0x08000, 0x73d8e235, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3577 
3578 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3579 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3580 
3581 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3582 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3583 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3584 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3585 
3586 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3587 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3588 };
3589 
3590 STD_ROM_PICK(outzoneh)
3591 STD_ROM_FN(outzoneh)
3592 
3593 struct BurnDriver BurnDrvOutzoneh = {
3594 	"outzoneh", "outzone", NULL, NULL, "1990",
3595 	"Out Zone (harder)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3596 	NULL, NULL, NULL, NULL,
3597 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3598 	NULL, outzonehRomInfo, outzonehRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzoneDIPInfo,
3599 	OutzoneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3600 	240, 320, 3, 4
3601 };
3602 
3603 
3604 // Out Zone (old set)
3605 
3606 static struct BurnRomInfo outzoneaRomDesc[] = {
3607 	{ "18.bin",			0x20000, 0x31a171bb, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3608 	{ "19.bin",			0x20000, 0x804ecfd1, 1 | BRF_PRG | BRF_ESS }, //  1
3609 
3610 	{ "tp_018_09.bin",		0x08000, 0x73d8e235, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3611 
3612 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3613 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3614 
3615 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3616 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3617 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3618 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3619 
3620 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3621 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3622 };
3623 
3624 STD_ROM_PICK(outzonea)
3625 STD_ROM_FN(outzonea)
3626 
3627 struct BurnDriver BurnDrvOutzonea = {
3628 	"outzonea", "outzone", NULL, NULL, "1990",
3629 	"Out Zone (old set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3630 	NULL, NULL, NULL, NULL,
3631 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3632 	NULL, outzoneaRomInfo, outzoneaRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzoneaDIPInfo,
3633 	OutzoneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3634 	240, 320, 3, 4
3635 };
3636 
3637 
3638 // Out Zone (older set)
3639 
3640 static struct BurnRomInfo outzonebRomDesc[] = {
3641 	{ "tp07.bin",			0x20000, 0xa85a1d48, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3642 	{ "tp08.bin",			0x20000, 0xd8cc44af, 1 | BRF_PRG | BRF_ESS }, //  1
3643 
3644 	{ "tp09.bin",			0x08000, 0xdd56041f, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3645 
3646 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3647 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3648 
3649 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3650 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3651 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3652 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3653 
3654 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3655 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3656 };
3657 
3658 STD_ROM_PICK(outzoneb)
3659 STD_ROM_FN(outzoneb)
3660 
3661 struct BurnDriver BurnDrvOutzoneb = {
3662 	"outzoneb", "outzone", NULL, NULL, "1990",
3663 	"Out Zone (older set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3664 	NULL, NULL, NULL, NULL,
3665 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3666 	NULL, outzonebRomInfo, outzonebRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzoneaDIPInfo,
3667 	OutzoneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3668 	240, 320, 3, 4
3669 };
3670 
3671 
3672 // Out Zone (oldest set)
3673 
3674 static struct BurnRomInfo outzonecRomDesc[] = {
3675 	{ "rom7.bin",			0x20000, 0x936e25d8, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3676 	{ "rom8.bin",			0x20000, 0xd19b3ecf, 1 | BRF_PRG | BRF_ESS }, //  1
3677 
3678 	{ "tp_018_09.bin",		0x08000, 0x73d8e235, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3679 
3680 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3681 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3682 
3683 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3684 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3685 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3686 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3687 
3688 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3689 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3690 };
3691 
3692 STD_ROM_PICK(outzonec)
3693 STD_ROM_FN(outzonec)
3694 
3695 struct BurnDriver BurnDrvOutzonec = {
3696 	"outzonec", "outzone", NULL, NULL, "1990",
3697 	"Out Zone (oldest set)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3698 	NULL, NULL, NULL, NULL,
3699 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3700 	NULL, outzonecRomInfo, outzonecRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzonecDIPInfo,
3701 	OutzoneInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3702 	240, 320, 3, 4
3703 };
3704 
3705 
3706 // Out Zone (Zero Wing TP-015 PCB conversion)
3707 
3708 static struct BurnRomInfo outzonecvRomDesc[] = {
3709 	{ "tp_018_07+.bin",		0x20000, 0x8768d843, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3710 	{ "tp_018_08+.bin",		0x20000, 0xaf238f71, 1 | BRF_PRG | BRF_ESS }, //  1
3711 
3712 	{ "tp_018_09+.bin",		0x08000, 0xb7201606, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 Code
3713 
3714 	{ "tp-018_rom5.bin",	0x80000, 0xc64ec7b6, 4 | BRF_GRA },           //  3 Layer Tiles
3715 	{ "tp-018_rom6.bin",	0x80000, 0x64b6c5ac, 4 | BRF_GRA },           //  4
3716 
3717 	{ "tp-018_rom2.bin",	0x20000, 0x6bb72d16, 5 | BRF_GRA },           //  5 Sprites
3718 	{ "tp-018_rom1.bin",	0x20000, 0x0934782d, 5 | BRF_GRA },           //  6
3719 	{ "tp-018_rom3.bin",	0x20000, 0xec903c07, 5 | BRF_GRA },           //  7
3720 	{ "tp-018_rom4.bin",	0x20000, 0x50cbf1a8, 5 | BRF_GRA },           //  8
3721 
3722 	{ "tp018_10.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3723 	{ "tp018_11.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3724 };
3725 
3726 STD_ROM_PICK(outzonecv)
3727 STD_ROM_FN(outzonecv)
3728 
3729 struct BurnDriver BurnDrvOutzonecv = {
3730 	"outzonecv", "outzone", NULL, NULL, "1990",
3731 	"Out Zone (Zero Wing TP-015 PCB conversion)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3732 	NULL, NULL, NULL, NULL,
3733 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_RUNGUN, 0,
3734 	NULL, outzonecvRomInfo, outzonecvRomName, NULL, NULL, NULL, NULL, Drv3bInputInfo, OutzoneDIPInfo,
3735 	OutzonecvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3736 	240, 320, 3, 4
3737 };
3738 
3739 
3740 // Vimana (World, set 1)
3741 
3742 static struct BurnRomInfo vimanaRomDesc[] = {
3743 	{ "tp019-7a.bin",		0x20000, 0x5a4bf73e, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3744 	{ "tp019-8a.bin",		0x20000, 0x03ba27e8, 1 | BRF_PRG | BRF_ESS }, //  1
3745 
3746 	{ "hd647180.019",		0x08000, 0x41a97ebe, 2 | BRF_PRG | BRF_ESS }, //  2 Z180 Code
3747 
3748 	{ "vim6.bin",			0x20000, 0x2886878d, 3 | BRF_GRA },           //  3 Layer Tiles
3749 	{ "vim5.bin",			0x20000, 0x61a63d7a, 3 | BRF_GRA },           //  4
3750 	{ "vim4.bin",			0x20000, 0xb0515768, 3 | BRF_GRA },           //  5
3751 	{ "vim3.bin",			0x20000, 0x0b539131, 3 | BRF_GRA },           //  6
3752 
3753 	{ "vim1.bin",			0x80000, 0xcdde26cd, 8 | BRF_GRA },           //  7 Sprites
3754 	{ "vim2.bin",			0x80000, 0x1dbfc118, 8 | BRF_GRA },           //  8
3755 
3756 	{ "tp019-09.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3757 	{ "tp019-10.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3758 };
3759 
3760 STD_ROM_PICK(vimana)
3761 STD_ROM_FN(vimana)
3762 
3763 struct BurnDriver BurnDrvVimana = {
3764 	"vimana", NULL, NULL, NULL, "1991",
3765 	"Vimana (World, set 1)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3766 	NULL, NULL, NULL, NULL,
3767 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3768 	NULL, vimanaRomInfo, vimanaRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, VimanaDIPInfo,
3769 	VimanaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3770 	240, 320, 3, 4
3771 };
3772 
3773 
3774 // Vimana (World, set 2)
3775 
3776 static struct BurnRomInfo vimananRomDesc[] = {
3777 	{ "tp019-07.rom",		0x20000, 0x78888ff2, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3778 	{ "tp019-08.rom",		0x20000, 0x6cd2dc3c, 1 | BRF_PRG | BRF_ESS }, //  1
3779 
3780 	{ "hd647180.019",		0x08000, 0x41a97ebe, 2 | BRF_PRG | BRF_ESS }, //  2 Z180 Code
3781 
3782 	{ "vim6.bin",			0x20000, 0x2886878d, 3 | BRF_GRA },           //  3 Layer Tiles
3783 	{ "vim5.bin",			0x20000, 0x61a63d7a, 3 | BRF_GRA },           //  4
3784 	{ "vim4.bin",			0x20000, 0xb0515768, 3 | BRF_GRA },           //  5
3785 	{ "vim3.bin",			0x20000, 0x0b539131, 3 | BRF_GRA },           //  6
3786 
3787 	{ "vim1.bin",			0x80000, 0xcdde26cd, 8 | BRF_GRA },           //  7 Sprites
3788 	{ "vim2.bin",			0x80000, 0x1dbfc118, 8 | BRF_GRA },           //  8
3789 
3790 	{ "tp019-09.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3791 	{ "tp019-10.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3792 };
3793 
3794 STD_ROM_PICK(vimanan)
3795 STD_ROM_FN(vimanan)
3796 
3797 struct BurnDriver BurnDrvVimanan = {
3798 	"vimanan", "vimana", NULL, NULL, "1991",
3799 	"Vimana (World, set 2)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3800 	NULL, NULL, NULL, NULL,
3801 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3802 	NULL, vimananRomInfo, vimananRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, VimananDIPInfo,
3803 	VimanaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3804 	240, 320, 3, 4
3805 };
3806 
3807 
3808 // Vimana (Japan)
3809 
3810 static struct BurnRomInfo vimanajRomDesc[] = {
3811 	{ "vim07.bin",			0x20000, 0x1efaea84, 1 | BRF_PRG | BRF_ESS }, //  0 68k Code
3812 	{ "vim08.bin",			0x20000, 0xe45b7def, 1 | BRF_PRG | BRF_ESS }, //  1
3813 
3814 	{ "hd647180.019",		0x08000, 0x41a97ebe, 2 | BRF_PRG | BRF_ESS }, //  2 Z180 Code
3815 
3816 	{ "vim6.bin",			0x20000, 0x2886878d, 3 | BRF_GRA },           //  3 Layer Tiles
3817 	{ "vim5.bin",			0x20000, 0x61a63d7a, 3 | BRF_GRA },           //  4
3818 	{ "vim4.bin",			0x20000, 0xb0515768, 3 | BRF_GRA },           //  5
3819 	{ "vim3.bin",			0x20000, 0x0b539131, 3 | BRF_GRA },           //  6
3820 
3821 	{ "vim1.bin",			0x80000, 0xcdde26cd, 8 | BRF_GRA },           //  7 Sprites
3822 	{ "vim2.bin",			0x80000, 0x1dbfc118, 8 | BRF_GRA },           //  8
3823 
3824 	{ "tp019-09.bpr",		0x00020, 0xbc88cced, 0 | BRF_OPT },           //  9 PROMs
3825 	{ "tp019-10.bpr",		0x00020, 0xa1e17492, 0 | BRF_OPT },           // 10
3826 };
3827 
3828 STD_ROM_PICK(vimanaj)
3829 STD_ROM_FN(vimanaj)
3830 
3831 struct BurnDriver BurnDrvVimanaj = {
3832 	"vimanaj", "vimana", NULL, NULL, "1991",
3833 	"Vimana (Japan)\0", NULL, "Toaplan", "Toaplan BCU-2 / FCU-2 based",
3834 	NULL, NULL, NULL, NULL,
3835 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_HISCORE_SUPPORTED, 2, HARDWARE_TOAPLAN_RAIZING, GBF_VERSHOOT, 0,
3836 	NULL, vimanajRomInfo, vimanajRomName, NULL, NULL, NULL, NULL, Drv2bInputInfo, VimanajDIPInfo,
3837 	VimanaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x800,
3838 	240, 320, 3, 4
3839 };
3840