1 // FB Alpha Twin Cobra driver module
2 // Based on MAME driver by Quench
3 
4 #include "tiles_generic.h"
5 #include "m68000_intf.h"
6 #include "tms32010.h"
7 #include "z80_intf.h"
8 #include "burn_ym3812.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 *DrvMCUROM;
16 static UINT8 *DrvZ80ROM;
17 static UINT8 *DrvGfxROM0;
18 static UINT8 *DrvGfxROM1;
19 static UINT8 *DrvGfxROM2;
20 static UINT8 *DrvGfxROM3;
21 static UINT8 *DrvSprRAM;
22 static UINT8 *Drv68KRAM;
23 static UINT8 *DrvMCURAM;
24 static UINT8 *DrvPalRAM;
25 static UINT8 *DrvShareRAM;
26 static UINT8 *DrvBgRAM;
27 static UINT8 *DrvFgRAM;
28 static UINT8 *DrvTxRAM;
29 static UINT8 *DrvSprBuf;
30 
31 static UINT16 *pTempDraw;
32 
33 static UINT32 *DrvPalette;
34 static UINT8 DrvRecalc;
35 
36 static UINT8 DrvJoy1[8];
37 static UINT8 DrvJoy2[8];
38 static UINT8 DrvJoy3[8];
39 static UINT8 DrvJoy4[8];
40 static UINT8 DrvDips[3];
41 static UINT8 DrvReset;
42 static UINT8 DrvInputs[4];
43 
44 static UINT16 scrollx[4];
45 static UINT16 scrolly[4];
46 static UINT16 vidramoffs[4];
47 static INT32 vblank;
48 
49 static UINT16 golfwar = 0;
50 
51 static INT32 m68k_halt = 0;
52 static INT32 irq_enable;
53 static INT32 flipscreen;
54 static INT32 bgrambank;
55 static INT32 fgrombank;
56 static INT32 displayenable;
57 static INT32 fsharkbt_8741;
58 
59 static UINT32 main_ram_seg;
60 static UINT16 dsp_addr_w;
61 static INT32 dsp_execute;
62 static INT32 dsp_BIO;
63 static INT32 dsp_on;
64 
65 static struct BurnInputInfo TwincobrInputList[] = {
66 	{"P1 Coin",		BIT_DIGITAL,	DrvJoy3 + 3,	"p1 coin"	},
67 	{"P1 Start",		BIT_DIGITAL,	DrvJoy3 + 5,	"p1 start"	},
68 	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
69 	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
70 	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
71 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
72 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
73 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
74 
75 	{"P2 Coin",		BIT_DIGITAL,	DrvJoy3 + 4,	"p2 coin"	},
76 	{"P2 Start",		BIT_DIGITAL,	DrvJoy3 + 6,	"p2 start"	},
77 	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 up"		},
78 	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 down"	},
79 	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 left"	},
80 	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 right"	},
81 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
82 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 2"	},
83 
84 	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
85 	{"Service",		BIT_DIGITAL,	DrvJoy3 + 0,	"service"	},
86 	{"Tilt",		BIT_DIGITAL,	DrvJoy3 + 1,	"tilt"		},
87 	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
88 	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
89 };
90 
91 STDINPUTINFO(Twincobr)
92 
93 static struct BurnInputInfo FsharkInputList[] = {
94 	{"P1 Coin",		BIT_DIGITAL,	DrvJoy4 + 3,	"p1 coin"	},
95 	{"P1 Start",		BIT_DIGITAL,	DrvJoy4 + 5,	"p1 start"	},
96 	{"P1 Up",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
97 	{"P1 Down",		BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
98 	{"P1 Left",		BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
99 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
100 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
101 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
102 
103 	{"P2 Coin",		BIT_DIGITAL,	DrvJoy4 + 4,	"p2 coin"	},
104 	{"P2 Start",		BIT_DIGITAL,	DrvJoy4 + 6,	"p2 start"	},
105 	{"P2 Up",		BIT_DIGITAL,	DrvJoy2 + 0,	"p2 up"		},
106 	{"P2 Down",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 down"	},
107 	{"P2 Left",		BIT_DIGITAL,	DrvJoy2 + 2,	"p2 left"	},
108 	{"P2 Right",		BIT_DIGITAL,	DrvJoy2 + 3,	"p2 right"	},
109 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy2 + 4,	"p2 fire 1"	},
110 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy2 + 5,	"p2 fire 2"	},
111 
112 	{"Reset",		BIT_DIGITAL,	&DrvReset,	"reset"		},
113 	{"Service",		BIT_DIGITAL,	DrvJoy4 + 0,	"service"	},
114 	{"Tilt",		BIT_DIGITAL,	DrvJoy4 + 1,	"tilt"		},
115 	{"Dip A",		BIT_DIPSWITCH,	DrvDips + 0,	"dip"		},
116 	{"Dip B",		BIT_DIPSWITCH,	DrvDips + 1,	"dip"		},
117 };
118 
119 STDINPUTINFO(Fshark)
120 
121 static struct BurnDIPInfo TwincobrDIPList[]=
122 {
123 	{0x13, 0xff, 0xff, 0x00, NULL			},
124 	{0x14, 0xff, 0xff, 0x00, NULL			},
125 
126 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
127 	{0x13, 0x01, 0x02, 0x00, "Off"			},
128 	{0x13, 0x01, 0x02, 0x02, "On"			},
129 
130 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
131 	{0x13, 0x01, 0x04, 0x00, "Off"			},
132 	{0x13, 0x01, 0x04, 0x04, "On"			},
133 
134 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
135 	{0x13, 0x01, 0x08, 0x08, "Off"			},
136 	{0x13, 0x01, 0x08, 0x00, "On"			},
137 
138 	{0   , 0xfe, 0   ,    4, "Coin A"		},
139 	{0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits"	},
140 	{0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits"	},
141 	{0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits"	},
142 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
143 
144 	{0   , 0xfe, 0   ,    4, "Coin B"		},
145 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
146 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
147 	{0x13, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
148 	{0x13, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
149 
150 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
151 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
152 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
153 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
154 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
155 
156 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
157 	{0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+"	},
158 	{0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+"	},
159 	{0x14, 0x01, 0x0c, 0x08, "50k Only"		},
160 	{0x14, 0x01, 0x0c, 0x0c, "100k Only"		},
161 
162 	{0   , 0xfe, 0   ,    4, "Lives"		},
163 	{0x14, 0x01, 0x30, 0x30, "2"			},
164 	{0x14, 0x01, 0x30, 0x00, "3"			},
165 	{0x14, 0x01, 0x30, 0x20, "4"			},
166 	{0x14, 0x01, 0x30, 0x10, "5"			},
167 
168 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
169 	{0x14, 0x01, 0x40, 0x00, "Off"			},
170 	{0x14, 0x01, 0x40, 0x40, "On"			},
171 };
172 
173 STDDIPINFO(Twincobr)
174 
175 static struct BurnDIPInfo TwincobruDIPList[]=
176 {
177 	{0x13, 0xff, 0xff, 0x00, NULL			},
178 	{0x14, 0xff, 0xff, 0x00, NULL			},
179 
180 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
181 	{0x13, 0x01, 0x02, 0x00, "Off"			},
182 	{0x13, 0x01, 0x02, 0x02, "On"			},
183 
184 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
185 	{0x13, 0x01, 0x04, 0x00, "Off"			},
186 	{0x13, 0x01, 0x04, 0x04, "On"			},
187 
188 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
189 	{0x13, 0x01, 0x08, 0x08, "Off"			},
190 	{0x13, 0x01, 0x08, 0x00, "On"			},
191 
192 	{0   , 0xfe, 0   ,    4, "Coin A"		},
193 	{0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits"	},
194 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
195 	{0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits"	},
196 	{0x13, 0x01, 0x30, 0x10, "1 Coin  2 Credits"	},
197 
198 	{0   , 0xfe, 0   ,    4, "Coin B"		},
199 	{0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits"	},
200 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  1 Credits"	},
201 	{0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits"	},
202 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  2 Credits"	},
203 
204 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
205 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
206 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
207 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
208 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
209 
210 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
211 	{0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+"	},
212 	{0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+"	},
213 	{0x14, 0x01, 0x0c, 0x08, "50k Only"		},
214 	{0x14, 0x01, 0x0c, 0x0c, "100k Only"		},
215 
216 	{0   , 0xfe, 0   ,    4, "Lives"		},
217 	{0x14, 0x01, 0x30, 0x30, "2"			},
218 	{0x14, 0x01, 0x30, 0x00, "3"			},
219 	{0x14, 0x01, 0x30, 0x20, "4"			},
220 	{0x14, 0x01, 0x30, 0x10, "5"			},
221 
222 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
223 	{0x14, 0x01, 0x40, 0x00, "Off"			},
224 	{0x14, 0x01, 0x40, 0x40, "On"			},
225 };
226 
227 STDDIPINFO(Twincobru)
228 
229 
230 static struct BurnDIPInfo KtigerDIPList[]=
231 {
232 	{0x13, 0xff, 0xff, 0x01, NULL			},
233 	{0x14, 0xff, 0xff, 0x80, NULL			},
234 
235 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
236 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
237 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
238 
239 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
240 	{0x13, 0x01, 0x02, 0x00, "Off"			},
241 	{0x13, 0x01, 0x02, 0x02, "On"			},
242 
243 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
244 	{0x13, 0x01, 0x04, 0x00, "Off"			},
245 	{0x13, 0x01, 0x04, 0x04, "On"			},
246 
247 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
248 	{0x13, 0x01, 0x08, 0x08, "Off"			},
249 	{0x13, 0x01, 0x08, 0x00, "On"			},
250 
251 	{0   , 0xfe, 0   ,    4, "Coin A"		},
252 	{0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits"	},
253 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
254 	{0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits"	},
255 	{0x13, 0x01, 0x30, 0x10, "1 Coin  2 Credits"	},
256 
257 	{0   , 0xfe, 0   ,    4, "Coin B"		},
258 	{0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits"	},
259 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  1 Credits"	},
260 	{0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits"	},
261 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  2 Credits"	},
262 
263 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
264 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
265 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
266 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
267 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
268 
269 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
270 	{0x14, 0x01, 0x0c, 0x04, "50k 200k 150k+"	},
271 	{0x14, 0x01, 0x0c, 0x00, "70k 270k 200k+"	},
272 	{0x14, 0x01, 0x0c, 0x08, "100k Only"		},
273 	{0x14, 0x01, 0x0c, 0x0c, "None"			},
274 
275 	{0   , 0xfe, 0   ,    4, "Lives"		},
276 	{0x14, 0x01, 0x30, 0x30, "2"			},
277 	{0x14, 0x01, 0x30, 0x00, "3"			},
278 	{0x14, 0x01, 0x30, 0x20, "4"			},
279 	{0x14, 0x01, 0x30, 0x10, "5"			},
280 
281 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
282 	{0x14, 0x01, 0x40, 0x00, "Off"			},
283 	{0x14, 0x01, 0x40, 0x40, "On"			},
284 
285 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
286 	{0x14, 0x01, 0x80, 0x00, "No"			},
287 	{0x14, 0x01, 0x80, 0x80, "Yes"			},
288 };
289 
290 STDDIPINFO(Ktiger)
291 
292 
293 static struct BurnDIPInfo FsharkDIPList[]=
294 {
295 	{0x13, 0xff, 0xff, 0x01, NULL			},
296 	{0x14, 0xff, 0xff, 0x80, NULL			},
297 
298 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
299 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
300 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
301 
302 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
303 	{0x13, 0x01, 0x02, 0x00, "Off"			},
304 	{0x13, 0x01, 0x02, 0x02, "On"			},
305 
306 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
307 	{0x13, 0x01, 0x04, 0x00, "Off"			},
308 	{0x13, 0x01, 0x04, 0x04, "On"			},
309 
310 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
311 	{0x13, 0x01, 0x08, 0x08, "Off"			},
312 	{0x13, 0x01, 0x08, 0x00, "On"			},
313 
314 	{0   , 0xfe, 0   ,    4, "Coin A"		},
315 	{0x13, 0x01, 0x30, 0x30, "4 Coins 1 Credits"	},
316 	{0x13, 0x01, 0x30, 0x20, "3 Coins 1 Credits"	},
317 	{0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits"	},
318 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
319 
320 	{0   , 0xfe, 0   ,    4, "Coin B"		},
321 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  2 Credits"	},
322 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  3 Credits"	},
323 	{0x13, 0x01, 0xc0, 0x80, "1 Coin  4 Credits"	},
324 	{0x13, 0x01, 0xc0, 0xc0, "1 Coin  6 Credits"	},
325 
326 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
327 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
328 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
329 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
330 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
331 
332 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
333 	{0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+"	},
334 	{0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+"	},
335 	{0x14, 0x01, 0x0c, 0x08, "50k Only"		},
336 	{0x14, 0x01, 0x0c, 0x0c, "100k Only"		},
337 
338 	{0   , 0xfe, 0   ,    4, "Lives"		},
339 	{0x14, 0x01, 0x30, 0x20, "1"			},
340 	{0x14, 0x01, 0x30, 0x30, "2"			},
341 	{0x14, 0x01, 0x30, 0x00, "3"			},
342 	{0x14, 0x01, 0x30, 0x10, "5"			},
343 
344 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
345 	{0x14, 0x01, 0x40, 0x00, "Off"			},
346 	{0x14, 0x01, 0x40, 0x40, "On"			},
347 
348 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
349 	{0x14, 0x01, 0x80, 0x00, "No"			},
350 	{0x14, 0x01, 0x80, 0x80, "Yes"			},
351 };
352 
353 STDDIPINFO(Fshark)
354 
355 static struct BurnDIPInfo SkysharkDIPList[]=
356 {
357 	{0x13, 0xff, 0xff, 0x01, NULL			},
358 	{0x14, 0xff, 0xff, 0x80, NULL			},
359 
360 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
361 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
362 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
363 
364 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
365 	{0x13, 0x01, 0x02, 0x00, "Off"			},
366 	{0x13, 0x01, 0x02, 0x02, "On"			},
367 
368 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
369 	{0x13, 0x01, 0x04, 0x00, "Off"			},
370 	{0x13, 0x01, 0x04, 0x04, "On"			},
371 
372 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
373 	{0x13, 0x01, 0x08, 0x08, "Off"			},
374 	{0x13, 0x01, 0x08, 0x00, "On"			},
375 
376 	{0   , 0xfe, 0   ,    3, "Coin A"		},
377 	{0x13, 0x01, 0x30, 0x10, "2 Coins 1 Credits"	},
378 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
379 	{0x13, 0x01, 0x30, 0x20, "1 Coin  2 Credits"	},
380 
381 	{0   , 0xfe, 0   ,    3, "Coin B"		},
382 	{0x13, 0x01, 0xc0, 0x40, "2 Coins 1 Credits"	},
383 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  1 Credits"	},
384 	{0x13, 0x01, 0xc0, 0x80, "1 Coin  2 Credits"	},
385 
386 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
387 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
388 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
389 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
390 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
391 
392 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
393 	{0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+"	},
394 	{0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+"	},
395 	{0x14, 0x01, 0x0c, 0x08, "50k Only"		},
396 	{0x14, 0x01, 0x0c, 0x0c, "100k Only"		},
397 
398 	{0   , 0xfe, 0   ,    4, "Lives"		},
399 	{0x14, 0x01, 0x30, 0x20, "1"			},
400 	{0x14, 0x01, 0x30, 0x30, "2"			},
401 	{0x14, 0x01, 0x30, 0x00, "3"			},
402 	{0x14, 0x01, 0x30, 0x10, "5"			},
403 
404 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
405 	{0x14, 0x01, 0x40, 0x00, "Off"			},
406 	{0x14, 0x01, 0x40, 0x40, "On"			},
407 
408 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
409 	{0x14, 0x01, 0x80, 0x00, "No"			},
410 	{0x14, 0x01, 0x80, 0x80, "Yes"			},
411 };
412 
413 STDDIPINFO(Skyshark)
414 
415 
416 static struct BurnDIPInfo HishouzaDIPList[]=
417 {
418 	{0x13, 0xff, 0xff, 0x01, NULL			},
419 	{0x14, 0xff, 0xff, 0x00, NULL			},
420 
421 	{0   , 0xfe, 0   ,    2, "Cabinet"		},
422 	{0x13, 0x01, 0x01, 0x01, "Upright"		},
423 	{0x13, 0x01, 0x01, 0x00, "Cocktail"		},
424 
425 	{0   , 0xfe, 0   ,    2, "Flip Screen"		},
426 	{0x13, 0x01, 0x02, 0x00, "Off"			},
427 	{0x13, 0x01, 0x02, 0x02, "On"			},
428 
429 	{0   , 0xfe, 0   ,    2, "Service Mode"		},
430 	{0x13, 0x01, 0x04, 0x00, "Off"			},
431 	{0x13, 0x01, 0x04, 0x04, "On"			},
432 
433 	{0   , 0xfe, 0   ,    2, "Demo Sounds"		},
434 	{0x13, 0x01, 0x08, 0x08, "Off"			},
435 	{0x13, 0x01, 0x08, 0x00, "On"			},
436 
437 	{0   , 0xfe, 0   ,    4, "Coin A"		},
438 	{0x13, 0x01, 0x30, 0x20, "2 Coins 1 Credits"	},
439 	{0x13, 0x01, 0x30, 0x00, "1 Coin  1 Credits"	},
440 	{0x13, 0x01, 0x30, 0x30, "2 Coins 3 Credits"	},
441 	{0x13, 0x01, 0x30, 0x10, "1 Coin  2 Credits"	},
442 
443 	{0   , 0xfe, 0   ,    4, "Coin B"		},
444 	{0x13, 0x01, 0xc0, 0x80, "2 Coins 1 Credits"	},
445 	{0x13, 0x01, 0xc0, 0x00, "1 Coin  1 Credits"	},
446 	{0x13, 0x01, 0xc0, 0xc0, "2 Coins 3 Credits"	},
447 	{0x13, 0x01, 0xc0, 0x40, "1 Coin  2 Credits"	},
448 
449 	{0   , 0xfe, 0   ,    4, "Difficulty"		},
450 	{0x14, 0x01, 0x03, 0x01, "Easy"			},
451 	{0x14, 0x01, 0x03, 0x00, "Normal"		},
452 	{0x14, 0x01, 0x03, 0x02, "Hard"			},
453 	{0x14, 0x01, 0x03, 0x03, "Very Hard"		},
454 
455 	{0   , 0xfe, 0   ,    4, "Bonus Life"		},
456 	{0x14, 0x01, 0x0c, 0x00, "50k 200k 150k+"	},
457 	{0x14, 0x01, 0x0c, 0x04, "70k 270k 200k+"	},
458 	{0x14, 0x01, 0x0c, 0x08, "50k Only"		},
459 	{0x14, 0x01, 0x0c, 0x0c, "100k Only"		},
460 
461 	{0   , 0xfe, 0   ,    4, "Lives"		},
462 	{0x14, 0x01, 0x30, 0x20, "1"			},
463 	{0x14, 0x01, 0x30, 0x30, "2"			},
464 	{0x14, 0x01, 0x30, 0x00, "3"			},
465 	{0x14, 0x01, 0x30, 0x10, "5"			},
466 
467 	{0   , 0xfe, 0   ,    2, "Dip Switch Display"	},
468 	{0x14, 0x01, 0x40, 0x00, "Off"			},
469 	{0x14, 0x01, 0x40, 0x40, "On"			},
470 
471 	{0   , 0xfe, 0   ,    2, "Allow Continue"	},
472 	{0x14, 0x01, 0x80, 0x00, "No"			},
473 	{0x14, 0x01, 0x80, 0x80, "Yes"			},
474 };
475 
STDDIPINFO(Hishouza)476 STDDIPINFO(Hishouza)
477 
478 static void palette_write(INT32 offset)
479 {
480 	offset &= 0xffe;
481 
482 	INT32 p = *((UINT16*)(DrvPalRAM + offset));
483 
484 	INT32 r = (p >>  0) & 0x1f;
485 	INT32 g = (p >>  5) & 0x1f;
486 	INT32 b = (p >> 10) & 0x1f;
487 
488 	r = (r << 3) | (r >> 2);
489 	g = (g << 3) | (g >> 2);
490 	b = (b << 3) | (b >> 2);
491 
492 	DrvPalette[offset/2] = BurnHighCol(r,g,b,0);
493 }
494 
twincobr_dsp(INT32 enable)495 static void twincobr_dsp(INT32 enable)
496 {
497 	enable ^= 1;
498 	dsp_on = enable;
499 
500 	if (enable)
501 	{
502 		tms32010_set_irq_line(0, CPU_IRQSTATUS_ACK); /* TMS32010 INT */
503 		m68k_halt = 1;
504 		SekRunEnd();
505 	}
506 	else
507 	{
508 		tms32010_set_irq_line(0, CPU_IRQSTATUS_NONE); /* TMS32010 INT */
509 	}
510 }
511 
control_write(UINT16 data)512 static void control_write(UINT16 data)
513 {
514 	switch (data)
515 	{
516 		case 0x0004:
517 		case 0x0005:
518 			irq_enable = data & 1;
519 		break;
520 
521 		case 0x0006:
522 		case 0x0007:
523 			flipscreen = data & 1;
524 		break;
525 
526 		case 0x0008:
527 		case 0x0009:
528 			bgrambank = ((data & 1) << 13);
529 		break;
530 
531 		case 0x000a:
532 		case 0x000b:
533 			fgrombank = ((data & 1) << 12);
534 		break;
535 
536 		case 0x000c:
537 		case 0x000d:
538 			twincobr_dsp(data & 1);
539 		break;
540 
541 		case 0x000e:
542 		case 0x000f:
543 			displayenable = data & 1;
544 		break;
545 	}
546 }
547 
twincobr_main_write_word(UINT32 address,UINT16 data)548 static void __fastcall twincobr_main_write_word(UINT32 address, UINT16 data)
549 {
550 	if ((address & 0xfff000) == 0x07a000) {
551 		DrvShareRAM[(address / 2) & 0x7ff] = data & 0xff;
552 		return;
553 	}
554 
555 	if ((address & 0xfff000) == 0x050000) {
556 		*((UINT16*)(DrvPalRAM + (address & 0xffe))) = data;
557 		palette_write(address);
558 		return;
559 	}
560 
561 	switch (address)
562 	{
563 		case 0x060000:
564 			// mc6845 address_w
565 		return;
566 
567 		case 0x060002:
568 			// mc6845 register_w
569 		return;
570 
571 		case 0x070000:
572 			scrollx[0] = data;
573 		return;
574 
575 		case 0x070002:
576 			scrolly[0] = data;
577 		return;
578 
579 		case 0x070004:
580 			vidramoffs[0] = data<<1;
581 		return;
582 
583 		case 0x072000:
584 			scrollx[1] = data;
585 		return;
586 
587 		case 0x072002:
588 			scrolly[1] = data;
589 		return;
590 
591 		case 0x072004:
592 			vidramoffs[1] = data<<1;
593 		return;
594 
595 		case 0x074000:
596 			scrollx[2] = data;
597 		return;
598 
599 		case 0x074002:
600 			scrolly[2] = data;
601 		return;
602 
603 		case 0x074004:
604 			vidramoffs[2] = data<<1;
605 		return;
606 
607 		case 0x076000:
608 		case 0x076002:	// exscroll (not used)
609 		return;
610 
611 		case 0x07800a:
612 			if (data < 2) twincobr_dsp(data);
613 		return;
614 
615 		case 0x07800c:
616 			control_write(data & 0xff);
617 		return;
618 
619 		case 0x07e000:
620 			*((UINT16*)(DrvTxRAM + (vidramoffs[0] & 0x0ffe))) = data;
621 		return;
622 
623 		case 0x07e002:
624 			*((UINT16*)(DrvBgRAM + (vidramoffs[1] & 0x1ffe) + bgrambank)) = data;
625 		return;
626 
627 		case 0x07e004:
628 			*((UINT16*)(DrvFgRAM + (vidramoffs[2] & 0x1ffe))) = data;
629 		return;
630 	}
631 }
632 
twincobr_main_write_byte(UINT32 address,UINT8 data)633 static void __fastcall twincobr_main_write_byte(UINT32 address, UINT8 data)
634 {
635 	if ((address & 0xfff000) == 0x050000) {
636 		DrvPalRAM[(address & 0xfff)^1] = data;
637 		palette_write(address);
638 		return;
639 	}
640 
641 	bprintf (0, _T("MWB %5.5x, %2.2x\n"), address, data);
642 }
643 
twincobr_main_read_word(UINT32 address)644 static UINT16 __fastcall twincobr_main_read_word(UINT32 address)
645 {
646 	if ((address & 0xfff000) == 0x07a000) {
647 		return DrvShareRAM[(address / 2) & 0x7ff] & 0xff;
648 	}
649 
650 	switch (address)
651 	{
652 		case 0x07e000:
653 			return *((UINT16*)(DrvTxRAM + (vidramoffs[0] & 0x0ffe)));
654 
655 		case 0x07e002:
656 			return *((UINT16*)(DrvBgRAM + (vidramoffs[1] & 0x1ffe) + bgrambank));
657 
658 		case 0x07e004:
659 			return *((UINT16*)(DrvFgRAM + (vidramoffs[2] & 0x1ffe)));
660 
661 		case 0x078000:
662 			return DrvDips[0];
663 
664 		case 0x078002:
665 			return DrvDips[1];
666 
667 		case 0x078004:
668 			return DrvInputs[0];
669 
670 		case 0x078006:
671 			return DrvInputs[1];
672 
673 		case 0x078008:
674 			return ((DrvInputs[3] & 0x7f) | (vblank ? 0x80 : 0)) ^ golfwar;
675 	}
676 
677 	return 0;
678 }
679 
twincobr_main_read_byte(UINT32 address)680 static UINT8 __fastcall twincobr_main_read_byte(UINT32 address)
681 {
682 	if ((address & 0xfff000) == 0x07a000) {
683 		return DrvShareRAM[(address / 2) & 0x7ff] & 0xff;
684 	}
685 
686 	switch (address)
687 	{
688 		case 0x078001:
689 			return DrvDips[0];
690 
691 		case 0x078003:
692 			return DrvDips[1];
693 
694 		case 0x078009:
695 			return ((vblank ? 0x80 : 0) | (DrvInputs[3] & 0x7f)) ^ golfwar;
696 	}
697 
698 	bprintf (0, _T("MRB %5.5x\n"), address);
699 
700 	return 0;
701 }
702 
twincobr_sound_write_port(UINT16 port,UINT8 data)703 static void __fastcall twincobr_sound_write_port(UINT16 port, UINT8 data)
704 {
705 	switch (port & 0xff)
706 	{
707 		case 0x00:
708 		case 0x01:
709 			BurnYM3812Write(0, port & 1, data);
710 		return;
711 
712 		case 0x20:
713 			if (data < 2) twincobr_dsp(data);
714 		return;
715 	}
716 }
717 
twincobr_sound_read_port(UINT16 port)718 static UINT8 __fastcall twincobr_sound_read_port(UINT16 port)
719 {
720 	switch (port & 0xff)
721 	{
722 		case 0x00:
723 		case 0x01:
724 			return BurnYM3812Read(0, port & 1);
725 
726 		case 0x10:
727 			return DrvInputs[2];
728 
729 		case 0x40:
730 			return DrvDips[0];
731 
732 		case 0x50:
733 			return DrvDips[1];
734 	}
735 
736 	return 0;
737 }
738 
twincobr_dsp_addrsel_w(UINT16 data)739 static void twincobr_dsp_addrsel_w(UINT16 data)
740 {
741 	main_ram_seg = ((data & 0xe000) << 3);
742 	dsp_addr_w   = ((data & 0x1fff) << 1);
743 }
744 
twincobr_dsp_r()745 static UINT16 twincobr_dsp_r()
746 {
747 	switch (main_ram_seg)
748 	{
749 		case 0x30000:
750 		case 0x40000:
751 		case 0x50000:
752 			return SekReadWord(main_ram_seg + dsp_addr_w);
753 	}
754 
755 	return 0;
756 }
757 
twincobr_dsp_w(UINT16 data)758 static void twincobr_dsp_w(UINT16 data)
759 {
760 	dsp_execute = 0;
761 
762 	switch (main_ram_seg)
763 	{
764 		case 0x30000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1;
765 		case 0x40000:
766 		case 0x50000:
767 			SekWriteWord(main_ram_seg + dsp_addr_w, data);
768 		break;
769 	}
770 }
771 
twincobr_dsp_bio_w(UINT16 data)772 static void twincobr_dsp_bio_w(UINT16 data)
773 {
774 	if (data & 0x8000) {
775 		dsp_BIO = 0;
776 	}
777 
778 	if (data == 0) {
779 		if (dsp_execute) {
780 			m68k_halt = 0;
781 			dsp_execute = 0;
782 			tms32010RunEnd();
783 		}
784 
785 		dsp_BIO = 1;
786 	}
787 }
788 
twincobr_BIO_r()789 static UINT8 twincobr_BIO_r()
790 {
791 	return dsp_BIO;
792 }
793 
dsp_write(INT32 port,UINT16 data)794 static void dsp_write(INT32 port, UINT16 data)
795 {
796 	switch (port)
797 	{
798 		case 0x00: twincobr_dsp_addrsel_w(data); return;
799 		case 0x01: twincobr_dsp_w(data); return;
800 		case 0x02: return; // bootleg
801 		case 0x03: twincobr_dsp_bio_w(data); return;
802 	}
803 }
804 
dsp_read(INT32 port)805 static UINT16 dsp_read(INT32 port)
806 {
807 	switch (port)
808 	{
809 		case 0x01: return twincobr_dsp_r();
810 		case 0x02: fsharkbt_8741 += 1; return (fsharkbt_8741 & 1);
811 		case 0x10: return twincobr_BIO_r();
812 	}
813 
814 	return 0;
815 }
816 
DrvFMIRQHandler(INT32,INT32 nStatus)817 static void DrvFMIRQHandler(INT32, INT32 nStatus)
818 {
819 	ZetSetIRQLine(0, (nStatus) ? CPU_IRQSTATUS_ACK : CPU_IRQSTATUS_NONE);
820 }
821 
DrvSynchroniseStream(INT32 nSoundRate)822 static INT32 DrvSynchroniseStream(INT32 nSoundRate)
823 {
824 	return (INT64)(double)ZetTotalCycles() * nSoundRate / 3500000;
825 }
826 
DrvDoReset()827 static INT32 DrvDoReset()
828 {
829 	memset (AllRam, 0, RamEnd - AllRam);
830 
831 	SekOpen(0);
832 	SekReset();
833 	SekClose();
834 
835 	ZetOpen(0);
836 	ZetReset();
837 	BurnYM3812Reset();
838 	ZetClose();
839 
840 	tms32010_reset();
841 
842 	irq_enable = 0;
843 	flipscreen = 0;
844 	bgrambank = 0;
845 	fgrombank = 0;
846 	displayenable = 0;
847 
848 	main_ram_seg = 0;
849 	dsp_addr_w = 0;
850 	dsp_execute = 0;
851 	dsp_BIO = 0;
852 	dsp_on = 0;
853 
854 	fsharkbt_8741 = -1;
855 
856 	return 0;
857 }
858 
MemIndex()859 static INT32 MemIndex()
860 {
861 	UINT8 *Next; Next = AllMem;
862 
863 	Drv68KROM		= Next; Next += 0x040000;
864 	DrvMCUROM		= Next; Next += 0x004000;
865 	DrvZ80ROM		= Next; Next += 0x008000;
866 
867 	DrvGfxROM0		= Next; Next += 0x020000;
868 	DrvGfxROM1		= Next; Next += 0x080000;
869 	DrvGfxROM2		= Next; Next += 0x040000;
870 	DrvGfxROM3		= Next; Next += 0x080000;
871 
872 	DrvPalette		= (UINT32*)Next; Next += 0x0700 * sizeof(UINT32);
873 
874 	pTempDraw		= (UINT16*)Next; Next += nScreenWidth * nScreenHeight * sizeof(UINT16);
875 
876 	AllRam			= Next;
877 
878 	DrvSprBuf		= Next; Next += 0x001000;
879 	DrvSprRAM		= Next; Next += 0x001000;
880 	Drv68KRAM		= Next; Next += 0x010000;
881 	DrvMCURAM		= Next; Next += 0x010000;
882 	DrvPalRAM		= Next; Next += 0x000e00;
883 	DrvShareRAM		= Next; Next += 0x000800;
884 
885 	DrvBgRAM		= Next; Next += 0x004000;
886 	DrvFgRAM		= Next; Next += 0x002000;
887 	DrvTxRAM		= Next; Next += 0x001000;
888 
889 	RamEnd			= Next;
890 
891 	MemEnd			= Next;
892 
893 	return 0;
894 }
895 
DrvGfxDecode()896 static INT32 DrvGfxDecode()
897 {
898 	INT32 Plane0[3] = { (0x4000*8*0), (0x4000*8*1), (0x4000*8*2) };
899 	INT32 Plane1[4] = { (0x8000*8*0), (0x8000*8*1), (0x8000*8*2), (0x8000*8*3) };
900 	INT32 Plane2[4] = { (0x10000*8*0), (0x10000*8*1), (0x10000*8*2), (0x10000*8*3) };
901 	INT32 XOffs[16] = { STEP16(0,1) };
902 	INT32 YOffs[8] = { STEP8(0,8) };
903 	INT32 YOffs1[16] = { STEP16(0,16) };
904 
905 	UINT8 *tmp = (UINT8*)BurnMalloc(0x40000);
906 	if (tmp == NULL) {
907 		return 1;
908 	}
909 
910 	memcpy (tmp, DrvGfxROM0, 0xc000);
911 
912 	GfxDecode(0x0800, 3, 8, 8, Plane0, XOffs, YOffs, 0x040, tmp, DrvGfxROM0);
913 
914 	memcpy (tmp, DrvGfxROM1, 0x40000);
915 
916 	GfxDecode(0x2000, 4, 8, 8, Plane2, XOffs, YOffs, 0x040, tmp, DrvGfxROM1);
917 
918 	memcpy (tmp, DrvGfxROM2, 0x20000);
919 
920 	GfxDecode(0x1000, 4, 8, 8, Plane1, XOffs, YOffs, 0x040, tmp, DrvGfxROM2);
921 
922 	memcpy (tmp, DrvGfxROM3, 0x40000);
923 
924 	GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs, YOffs1, 0x100, tmp, DrvGfxROM3);
925 
926 	BurnFree(tmp);
927 
928 	return 0;
929 }
930 
LoadNibbles(UINT8 * dst,INT32 idx,INT32 len)931 static INT32 LoadNibbles(UINT8 *dst, INT32 idx, INT32 len)
932 {
933 	UINT8 *tmp = (UINT8*)BurnMalloc(len*2);
934 
935 	if (BurnLoadRom(dst + 0, idx + 1, 2)) return 1;
936 	if (BurnLoadRom(dst + 1, idx + 3, 2)) return 1;
937 	if (BurnLoadRom(tmp + 0, idx + 0, 2)) return 1;
938 	if (BurnLoadRom(tmp + 1, idx + 2, 2)) return 1;
939 
940 	for (INT32 i = 0; i < len * 2; i++) {
941 		dst[i] = (dst[i] & 0xf) | (tmp[i] << 4);
942 	}
943 
944 	BurnFree(tmp);
945 
946 	return 0;
947 }
948 
DrvInit(INT32 game_select)949 static INT32 DrvInit(INT32 game_select)
950 {
951 	GenericTilesInit();
952 
953 	AllMem = NULL;
954 	MemIndex();
955 	INT32 nLen = MemEnd - (UINT8 *)0;
956 	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
957 	memset(AllMem, 0, nLen);
958 	MemIndex();
959 
960 	if (game_select == 0) // Twin Cobra
961 	{
962 		if (BurnLoadRom(Drv68KROM  + 0x00001,  0, 2)) return 1;
963 		if (BurnLoadRom(Drv68KROM  + 0x00000,  1, 2)) return 1;
964 		if (BurnLoadRom(Drv68KROM  + 0x20001,  2, 2)) return 1;
965 		if (BurnLoadRom(Drv68KROM  + 0x20000,  3, 2)) return 1;
966 
967 		if (BurnLoadRom(DrvZ80ROM  + 0x00000,  4, 1)) return 1;
968 
969 		if (BurnLoadRom(DrvMCUROM  + 0x00001,  5, 2)) return 1;
970 		if (BurnLoadRom(DrvMCUROM  + 0x00000,  6, 2)) return 1;
971 
972 		if (BurnLoadRom(DrvGfxROM0 + 0x00000,  7, 1)) return 1;
973 		if (BurnLoadRom(DrvGfxROM0 + 0x04000,  8, 1)) return 1;
974 		if (BurnLoadRom(DrvGfxROM0 + 0x08000,  9, 1)) return 1;
975 
976 		if (BurnLoadRom(DrvGfxROM1 + 0x00000, 10, 1)) return 1;
977 		if (BurnLoadRom(DrvGfxROM1 + 0x10000, 11, 1)) return 1;
978 		if (BurnLoadRom(DrvGfxROM1 + 0x20000, 12, 1)) return 1;
979 		if (BurnLoadRom(DrvGfxROM1 + 0x30000, 13, 1)) return 1;
980 
981 		if (BurnLoadRom(DrvGfxROM2 + 0x00000, 14, 1)) return 1;
982 		if (BurnLoadRom(DrvGfxROM2 + 0x08000, 15, 1)) return 1;
983 		if (BurnLoadRom(DrvGfxROM2 + 0x10000, 16, 1)) return 1;
984 		if (BurnLoadRom(DrvGfxROM2 + 0x18000, 17, 1)) return 1;
985 
986 		if (BurnLoadRom(DrvGfxROM3 + 0x00000, 18, 1)) return 1;
987 		if (BurnLoadRom(DrvGfxROM3 + 0x10000, 19, 1)) return 1;
988 		if (BurnLoadRom(DrvGfxROM3 + 0x20000, 20, 1)) return 1;
989 		if (BurnLoadRom(DrvGfxROM3 + 0x30000, 21, 1)) return 1;
990 	}
991 	else if (game_select == 1) // Flying Shark
992 	{
993 		if (BurnLoadRom(Drv68KROM  + 0x00001,  0, 2)) return 1;
994 		if (BurnLoadRom(Drv68KROM  + 0x00000,  1, 2)) return 1;
995 
996 		if (BurnLoadRom(DrvZ80ROM  + 0x00000,  2, 1)) return 1;
997 
998 		if (LoadNibbles(DrvMCUROM  + 0x00000,  3, 0x0400)) return 1;
999 		if (LoadNibbles(DrvMCUROM  + 0x00800,  7, 0x0400)) return 1;
1000 
1001 		if (BurnLoadRom(DrvGfxROM0 + 0x00000, 11, 1)) return 1;
1002 		if (BurnLoadRom(DrvGfxROM0 + 0x04000, 12, 1)) return 1;
1003 		if (BurnLoadRom(DrvGfxROM0 + 0x08000, 13, 1)) return 1;
1004 
1005 		if (BurnLoadRom(DrvGfxROM1 + 0x00000, 14, 1)) return 1;
1006 		if (BurnLoadRom(DrvGfxROM1 + 0x10000, 15, 1)) return 1;
1007 		if (BurnLoadRom(DrvGfxROM1 + 0x20000, 16, 1)) return 1;
1008 		if (BurnLoadRom(DrvGfxROM1 + 0x30000, 17, 1)) return 1;
1009 
1010 		if (BurnLoadRom(DrvGfxROM2 + 0x00000, 18, 1)) return 1;
1011 		if (BurnLoadRom(DrvGfxROM2 + 0x08000, 19, 1)) return 1;
1012 		if (BurnLoadRom(DrvGfxROM2 + 0x10000, 20, 1)) return 1;
1013 		if (BurnLoadRom(DrvGfxROM2 + 0x18000, 21, 1)) return 1;
1014 
1015 		if (BurnLoadRom(DrvGfxROM3 + 0x00000, 22, 1)) return 1;
1016 		if (BurnLoadRom(DrvGfxROM3 + 0x10000, 23, 1)) return 1;
1017 		if (BurnLoadRom(DrvGfxROM3 + 0x20000, 24, 1)) return 1;
1018 		if (BurnLoadRom(DrvGfxROM3 + 0x30000, 25, 1)) return 1;
1019 	}
1020 	else if (game_select == 2 || game_select == 3) // gulfwar2
1021 	{
1022 		if (BurnLoadRom(Drv68KROM  + 0x00001,  0, 2)) return 1;
1023 		if (BurnLoadRom(Drv68KROM  + 0x00000,  1, 2)) return 1;
1024 
1025 		if (BurnLoadRom(DrvZ80ROM  + 0x00000,  2, 1)) return 1;
1026 
1027 		if (BurnLoadRom(DrvMCUROM  + 0x00001,  3, 2)) return 1;
1028 		if (BurnLoadRom(DrvMCUROM  + 0x00000,  4, 2)) return 1;
1029 
1030 		if (BurnLoadRom(DrvGfxROM0 + 0x00000,  5, 1)) return 1;
1031 		if (BurnLoadRom(DrvGfxROM0 + 0x04000,  6, 1)) return 1;
1032 		if (BurnLoadRom(DrvGfxROM0 + 0x08000,  7, 1)) return 1;
1033 
1034 		if (BurnLoadRom(DrvGfxROM1 + 0x00000,  8, 1)) return 1;
1035 		if (BurnLoadRom(DrvGfxROM1 + 0x10000,  9, 1)) return 1;
1036 		if (BurnLoadRom(DrvGfxROM1 + 0x20000, 10, 1)) return 1;
1037 		if (BurnLoadRom(DrvGfxROM1 + 0x30000, 11, 1)) return 1;
1038 
1039 		if (BurnLoadRom(DrvGfxROM2 + 0x00000, 12, 1)) return 1;
1040 		if (BurnLoadRom(DrvGfxROM2 + 0x08000, 13, 1)) return 1;
1041 		if (BurnLoadRom(DrvGfxROM2 + 0x10000, 14, 1)) return 1;
1042 		if (BurnLoadRom(DrvGfxROM2 + 0x18000, 15, 1)) return 1;
1043 
1044 		if (BurnLoadRom(DrvGfxROM3 + 0x00000, 16, 1)) return 1;
1045 		if (BurnLoadRom(DrvGfxROM3 + 0x10000, 17, 1)) return 1;
1046 		if (BurnLoadRom(DrvGfxROM3 + 0x20000, 18, 1)) return 1;
1047 		if (BurnLoadRom(DrvGfxROM3 + 0x30000, 19, 1)) return 1;
1048 
1049 		golfwar = (game_select == 2) ? 0xff : 0;
1050 	}
1051 
1052 	DrvGfxDecode();
1053 
1054 	BurnSetRefreshRate(54.877858);
1055 
1056 	SekInit(0, 0x68000);
1057 	SekOpen(0);
1058 	SekMapMemory(Drv68KROM,		0x000000, 0x02ffff, MAP_ROM);
1059 	SekMapMemory(Drv68KRAM,		0x030000, 0x033fff, MAP_RAM);
1060 	SekMapMemory(DrvSprRAM,		0x040000, 0x040fff, MAP_RAM);
1061 	SekMapMemory(DrvPalRAM,		0x050000, 0x050dff, MAP_ROM);
1062 //	SekMapMemory(DrvShareRAM,	0x07a000, 0x07afff, MAP_RAM);
1063 	SekSetWriteWordHandler(0,	twincobr_main_write_word);
1064 	SekSetWriteByteHandler(0,	twincobr_main_write_byte);
1065 	SekSetReadWordHandler(0,	twincobr_main_read_word);
1066 	SekSetReadByteHandler(0,	twincobr_main_read_byte);
1067 	SekClose();
1068 
1069 	ZetInit(0);
1070 	ZetOpen(0);
1071 	ZetMapMemory(DrvZ80ROM,		0x0000, 0x7fff, MAP_ROM);
1072 	ZetMapMemory(DrvShareRAM,	0x8000, 0x87ff, MAP_RAM);
1073 	ZetSetOutHandler(twincobr_sound_write_port);
1074 	ZetSetInHandler(twincobr_sound_read_port);
1075 	ZetClose();
1076 
1077 	tms32010_init();
1078 	tms32010_set_write_port_handler(dsp_write);
1079 	tms32010_set_read_port_handler(dsp_read);
1080 	tms32010_ram = (UINT16*)DrvMCURAM;
1081 	tms32010_rom = (UINT16*)DrvMCUROM;
1082 
1083 	BurnYM3812Init(1, 3500000, &DrvFMIRQHandler, &DrvSynchroniseStream, 0);
1084 	BurnTimerAttachYM3812(&ZetConfig, 3500000);
1085 	BurnYM3812SetRoute(0, BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);
1086 
1087 	DrvDoReset();
1088 
1089 	return 0;
1090 }
1091 
DrvExit()1092 static INT32 DrvExit()
1093 {
1094 	GenericTilesExit();
1095 
1096 	BurnYM3812Exit();
1097 
1098 	ZetExit();
1099 	SekExit();
1100 	tms32010_exit();
1101 
1102 	BurnFree (AllMem);
1103 
1104 	golfwar = 0;
1105 
1106 	return 0;
1107 }
1108 
DrvPaletteUpdate()1109 static void DrvPaletteUpdate()
1110 {
1111 	for (INT32 i = 0; i < 0xe00; i+=2) {
1112 		INT32 p = *((UINT16*)(DrvPalRAM + i));
1113 
1114 		INT32 r = (p >>  0) & 0x1f;
1115 		INT32 g = (p >>  5) & 0x1f;
1116 		INT32 b = (p >> 10) & 0x1f;
1117 
1118 		r = (r << 3) | (r >> 2);
1119 		g = (g << 3) | (g >> 2);
1120 		b = (b << 3) | (b >> 2);
1121 
1122 		DrvPalette[i/2] = BurnHighCol(r,g,b,0);
1123 	}
1124 }
1125 
draw_layer(INT32 layer,INT32 rambank,INT32 rombank)1126 static void draw_layer(INT32 layer, INT32 rambank, INT32 rombank)
1127 {
1128 	UINT16 *ram[3] = { (UINT16*)DrvTxRAM, (UINT16*)DrvBgRAM, (UINT16*)DrvFgRAM };
1129 	UINT8 *gfx[3] = { DrvGfxROM0, DrvGfxROM2, DrvGfxROM1 };
1130 	INT32 colbank[3] = { 0x600, 0x400, 0x500 };
1131 	INT32 colshift[3] = { 11, 12, 12 };
1132 	INT32 depth = colshift[layer] - 8;
1133 
1134 	INT32 transp = (layer & 1) ? 0xff : 0;
1135 
1136 	INT32 height = (layer ? 64 : 32) * 8;
1137 
1138 	INT32 xscroll = (scrollx[layer] + 55 ) & 0x1ff;
1139 	INT32 yscroll = (scrolly[layer] + 30) & (height - 1);
1140 
1141 	for (INT32 offs = 0; offs < 64 * (height/8); offs++)
1142 	{
1143 		INT32 sx = (offs & 0x3f) * 8;
1144 		INT32 sy = (offs / 0x40) * 8;
1145 
1146 		sx -= xscroll;
1147 		if (sx < -7) sx += 512;
1148 		sy -= yscroll;
1149 		if (sy < -7) sy += height;
1150 
1151 		INT32 attr  = ram[layer][offs + (rambank/2)];
1152 		INT32 color = attr >> colshift[layer];
1153 		INT32 code  = (attr & ((1 << colshift[layer])-1)) + rombank;
1154 
1155 		Render8x8Tile_Mask_Clip(pTransDraw, code, sx, sy, color, depth, transp, colbank[layer], gfx[layer]);
1156 	}
1157 }
1158 
predraw_sprites()1159 static void predraw_sprites()
1160 {
1161 	UINT16 *ram = (UINT16*)DrvSprBuf;
1162 
1163 	INT32 xoffs = 31;
1164 	INT32 xoffs_flipped = 14;
1165 
1166 	memset (pTempDraw, 0, nScreenWidth * nScreenHeight * sizeof(short));
1167 
1168 	for (INT32 offs = 0; offs < 0x1000/2; offs += 4)
1169 	{
1170 		INT32 attr = ram[offs + 1];
1171 		INT32 prio = (attr >> 10) & 3;
1172 		if (prio == 0) continue;
1173 
1174 		INT32 sy = ram[offs + 3] >> 7;
1175 
1176 		if (sy != 0x0100)
1177 		{
1178 			INT32 code  = ram[offs] & 0x7ff;
1179 			INT32 color = (attr & 0x3f) | ((attr >> 4) & 0xc0);
1180 
1181 			INT32 sx    = ram[offs + 2] >> 7;
1182 			INT32 flipx = attr & 0x100;
1183 			if (flipx) sx -= xoffs_flipped;
1184 
1185 			INT32 flipy = attr & 0x200;
1186 
1187 			sx -= xoffs;
1188 			sy -= 16;
1189 
1190 			if (flipx) {
1191 				if (flipy) {
1192 					Render16x16Tile_Mask_FlipXY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3);
1193 				} else {
1194 					Render16x16Tile_Mask_FlipX_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3);
1195 				}
1196 			} else {
1197 				if (flipy) {
1198 					Render16x16Tile_Mask_FlipY_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3);
1199 				} else {
1200 					Render16x16Tile_Mask_Clip(pTempDraw, code, sx, sy, color, 4, 0, 0, DrvGfxROM3);
1201 				}
1202 			}
1203 		}
1204 	}
1205 }
1206 
draw_sprites(INT32 priority)1207 static void draw_sprites(INT32 priority)
1208 {
1209 	priority <<= 10;
1210 
1211 	for (INT32 y = 0;y < nScreenHeight; y++)
1212 	{
1213 		UINT16* src = pTempDraw + y * nScreenWidth;
1214 		UINT16* dst = pTransDraw + y * nScreenWidth;
1215 
1216 		for (INT32 x = 0;x < nScreenWidth; x++)
1217 		{
1218 			UINT16 pix = src[x];
1219 
1220 			if (pix & 0xf)
1221 			{
1222 				if ((pix & 0xc00) == priority)
1223 				{
1224 					dst[x] = pix & 0x3ff;
1225 				}
1226 			}
1227 		}
1228 	}
1229 }
1230 
DrvDraw()1231 static INT32 DrvDraw()
1232 {
1233 	if (DrvRecalc) {
1234 		DrvPaletteUpdate();
1235 		DrvRecalc = 0;
1236 	}
1237 
1238 	BurnTransferClear();
1239 
1240 	if (displayenable)
1241 	{
1242 		predraw_sprites();
1243 
1244 		if (nBurnLayer & 1) draw_layer(1, bgrambank, 0);
1245 		if (nSpriteEnable & 1) draw_sprites(1);
1246 		if (nBurnLayer & 2) draw_layer(2, 0, fgrombank);
1247 		if (nSpriteEnable & 2) draw_sprites(2);
1248 		if (nBurnLayer & 4) draw_layer(0, 0, 0);
1249 		if (nSpriteEnable & 4) draw_sprites(3);
1250 	}
1251 
1252 	BurnTransferCopy(DrvPalette);
1253 
1254 	return 0;
1255 }
1256 
DrvFrame()1257 static INT32 DrvFrame()
1258 {
1259 	if (DrvReset) {
1260 		DrvDoReset();
1261 	}
1262 
1263 	SekNewFrame();
1264 	ZetNewFrame();
1265 
1266 	{
1267 		memset (DrvInputs, 0, 4);
1268 
1269 		for (INT32 i = 0; i < 8; i++) {
1270 			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
1271 			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
1272 			DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
1273 			DrvInputs[3] ^= (DrvJoy4[i] & 1) << i;
1274 		}
1275 	}
1276 
1277 	INT32 nInterleave = 286;
1278 	INT32 nCyclesTotal[3] = { (INT32)(double)(7000000 / 54.877858), (INT32)(double)(3500000 / 54.877858), (INT32)(double)(14000000 / 54.877858) };
1279 	INT32 nCyclesDone[3] = { 0, 0, 0 };
1280 
1281 	SekOpen(0);
1282 	ZetOpen(0);
1283 
1284 	vblank = 0;
1285 
1286 	for (INT32 i = 0; i < nInterleave; i++)
1287 	{
1288 		INT32 nSegment = nCyclesTotal[0] / nInterleave;
1289 
1290 		if (m68k_halt) {
1291 			nCyclesDone[0] += nSegment;
1292 			SekIdle(nSegment);
1293 		} else {
1294 			nCyclesDone[0] += SekRun(nSegment);
1295 
1296 			if (i == 240 && irq_enable) {
1297 				irq_enable = 0;
1298 				SekSetIRQLine(4, CPU_IRQSTATUS_AUTO);
1299 			}
1300 		}
1301 
1302 		if (dsp_on) tms32010_execute(nCyclesTotal[2] / nInterleave);
1303 
1304 		BurnTimerUpdateYM3812((i + 1) * (nCyclesTotal[1] / nInterleave));
1305 
1306 		if (i == 240) {
1307 			if (pBurnDraw) {
1308 				DrvDraw();
1309 			}
1310 			vblank = 1;
1311 		}
1312 	}
1313 
1314 	BurnTimerEndFrameYM3812(nCyclesTotal[1]);
1315 
1316 	if (pBurnSoundOut) {
1317 		BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);
1318 	}
1319 
1320 	ZetClose();
1321 	SekClose();
1322 
1323 	memcpy (DrvSprBuf, DrvSprRAM, 0x1000);
1324 
1325 	return 0;
1326 }
1327 
DrvScan(INT32 nAction,INT32 * pnMin)1328 static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
1329 {
1330 	struct BurnArea ba;
1331 
1332 	if (pnMin != NULL) {
1333 		*pnMin = 0x029719;
1334 	}
1335 
1336 	if (nAction & ACB_MEMORY_RAM)
1337 	{
1338 		memset(&ba, 0, sizeof(ba));
1339 		ba.Data		= AllRam;
1340 		ba.nLen		= RamEnd - AllRam;
1341 		ba.szName	= "RAM";
1342 		BurnAcb(&ba);
1343 	}
1344 
1345 	if (nAction & ACB_DRIVER_DATA)
1346 	{
1347 		SekScan(nAction);
1348 		ZetScan(nAction);
1349 		tms32010_scan(nAction);
1350 
1351 		BurnYM3812Scan(nAction, pnMin);
1352 
1353 		SCAN_VAR(m68k_halt);
1354 		SCAN_VAR(irq_enable);
1355 		SCAN_VAR(flipscreen);
1356 		SCAN_VAR(bgrambank);
1357 		SCAN_VAR(fgrombank);
1358 		SCAN_VAR(displayenable);
1359 		SCAN_VAR(main_ram_seg);
1360 		SCAN_VAR(dsp_addr_w);
1361 		SCAN_VAR(dsp_execute);
1362 		SCAN_VAR(dsp_BIO);
1363 		SCAN_VAR(dsp_on);
1364 		SCAN_VAR(scrollx);
1365 		SCAN_VAR(scrolly);
1366 		SCAN_VAR(vidramoffs);
1367 
1368 		SCAN_VAR(fsharkbt_8741);
1369 	}
1370 
1371 	return 0;
1372 }
1373 
1374 
1375 // Twin Cobra (World)
1376 
1377 static struct BurnRomInfo twincobrRomDesc[] = {
1378 	{ "b30_01.7j",		0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1379 	{ "b30_03.7h",		0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, //  1
1380 	{ "b30_26_ii.8j",	0x08000, 0x3a646618, 1 | BRF_PRG | BRF_ESS }, //  2
1381 	{ "b30_27_ii.8h",	0x08000, 0xd7d1e317, 1 | BRF_PRG | BRF_ESS }, //  3
1382 
1383 	{ "b30_05_ii.4f",	0x08000, 0xe37b3c44, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 code
1384 
1385 	{ "dsp_22.bin",		0x00800, 0x79389a71, 3 | BRF_PRG | BRF_ESS }, //  5 TMS32010 code
1386 	{ "dsp_21.bin",		0x00800, 0x2d135376, 3 | BRF_PRG | BRF_ESS }, //  6
1387 
1388 	{ "b30_08.8c",		0x04000, 0x0a254133, 4 | BRF_GRA },           //  7 Text characters
1389 	{ "b30_07.10b",		0x04000, 0xe9e2d4b1, 4 | BRF_GRA },           //  8
1390 	{ "b30_06.8b",		0x04000, 0xa599d845, 4 | BRF_GRA },           //  9
1391 
1392 	{ "b30_16.20b",		0x10000, 0x15b3991d, 5 | BRF_GRA },           // 10 Background tiles
1393 	{ "b30_15.18b",		0x10000, 0xd9e2e55d, 5 | BRF_GRA },           // 11
1394 	{ "b30_13.18c",		0x10000, 0x13daeac8, 5 | BRF_GRA },           // 12
1395 	{ "b30_14.20c",		0x10000, 0x8cc79357, 5 | BRF_GRA },           // 13
1396 
1397 	{ "b30_12.16c",		0x08000, 0xb5d48389, 6 | BRF_GRA },           // 14 Foreground tiles
1398 	{ "b30_11.14c",		0x08000, 0x97f20fdc, 6 | BRF_GRA },           // 15
1399 	{ "b30_10.12c",		0x08000, 0x170c01db, 6 | BRF_GRA },           // 16
1400 	{ "b30_09.10c",		0x08000, 0x44f5accd, 6 | BRF_GRA },           // 17
1401 
1402 	{ "b30_20.12d",		0x10000, 0xcb4092b8, 7 | BRF_GRA },           // 18 Sprites
1403 	{ "b30_19.14d",		0x10000, 0x9cb8675e, 7 | BRF_GRA },           // 19
1404 	{ "b30_18.15d",		0x10000, 0x806fb374, 7 | BRF_GRA },           // 20
1405 	{ "b30_17.16d",		0x10000, 0x4264bff8, 7 | BRF_GRA },           // 21
1406 
1407 	{ "82s129.d3",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 22 Proms (not used)
1408 	{ "82s129.d4",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 23
1409 	{ "82s123.d2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 24
1410 	{ "82s123.e18",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 25
1411 	{ "82s123.b24",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 26
1412 };
1413 
1414 STD_ROM_PICK(twincobr)
STD_ROM_FN(twincobr)1415 STD_ROM_FN(twincobr)
1416 
1417 static INT32 twincobrInit()
1418 {
1419 	return DrvInit(0);
1420 }
1421 
1422 struct BurnDriver BurnDrvTwincobr = {
1423 	"twincobr", NULL, NULL, NULL, "1987",
1424 	"Twin Cobra (World)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous",
1425 	NULL, NULL, NULL, NULL,
1426 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1427 	NULL, twincobrRomInfo, twincobrRomName, NULL, NULL, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo,
1428 	twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1429 	240, 320, 3, 4
1430 };
1431 
1432 
1433 // Twin Cobra (US)
1434 
1435 static struct BurnRomInfo twincobruRomDesc[] = {
1436 	{ "b30_01.7j",		0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1437 	{ "b30_03.7h",		0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, //  1
1438 	{ "b30_26_i.8j",	0x08000, 0xbdd00ba4, 1 | BRF_PRG | BRF_ESS }, //  2
1439 	{ "b30_27_i.8h",	0x08000, 0xed600907, 1 | BRF_PRG | BRF_ESS }, //  3
1440 
1441 	{ "b30_05.4f",		0x08000, 0x1a8f1e10, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 code
1442 
1443 	{ "dsp_22.bin",		0x00800, 0x79389a71, 3 | BRF_PRG | BRF_ESS }, //  5 TMS32010 code
1444 	{ "dsp_21.bin",		0x00800, 0x2d135376, 3 | BRF_PRG | BRF_ESS }, //  6
1445 
1446 	{ "b30_08.8c",		0x04000, 0x0a254133, 4 | BRF_GRA },           //  7 Text characters
1447 	{ "b30_07.10b",		0x04000, 0xe9e2d4b1, 4 | BRF_GRA },           //  8
1448 	{ "b30_06.8b",		0x04000, 0xa599d845, 4 | BRF_GRA },           //  9
1449 
1450 	{ "b30_16.20b",		0x10000, 0x15b3991d, 5 | BRF_GRA },           // 10 Background tiles
1451 	{ "b30_15.18b",		0x10000, 0xd9e2e55d, 5 | BRF_GRA },           // 11
1452 	{ "b30_13.18c",		0x10000, 0x13daeac8, 5 | BRF_GRA },           // 12
1453 	{ "b30_14.20c",		0x10000, 0x8cc79357, 5 | BRF_GRA },           // 13
1454 
1455 	{ "b30_12.16c",		0x08000, 0xb5d48389, 6 | BRF_GRA },           // 14 Foreground tiles
1456 	{ "b30_11.14c",		0x08000, 0x97f20fdc, 6 | BRF_GRA },           // 15
1457 	{ "b30_10.12c",		0x08000, 0x170c01db, 6 | BRF_GRA },           // 16
1458 	{ "b30_09.10c",		0x08000, 0x44f5accd, 6 | BRF_GRA },           // 17
1459 
1460 	{ "b30_20.12d",		0x10000, 0xcb4092b8, 7 | BRF_GRA },           // 18 Sprites
1461 	{ "b30_19.14d",		0x10000, 0x9cb8675e, 7 | BRF_GRA },           // 19
1462 	{ "b30_18.15d",		0x10000, 0x806fb374, 7 | BRF_GRA },           // 20
1463 	{ "b30_17.16d",		0x10000, 0x4264bff8, 7 | BRF_GRA },           // 21
1464 
1465 	{ "82s129.d3",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 22 Proms (not used)
1466 	{ "82s129.d4",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 23
1467 	{ "82s123.d2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 24
1468 	{ "82s123.e18",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 25
1469 	{ "82s123.b24",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 26
1470 };
1471 
1472 STD_ROM_PICK(twincobru)
1473 STD_ROM_FN(twincobru)
1474 
1475 struct BurnDriver BurnDrvTwincobru = {
1476 	"twincobru", "twincobr", NULL, NULL, "1987",
1477 	"Twin Cobra (US)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous",
1478 	NULL, NULL, NULL, NULL,
1479 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1480 	NULL, twincobruRomInfo, twincobruRomName, NULL, NULL, NULL, NULL, TwincobrInputInfo, TwincobruDIPInfo,
1481 	twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1482 	240, 320, 3, 4
1483 };
1484 
1485 
1486 // Kyukyoku Tiger (Japan)
1487 
1488 static struct BurnRomInfo ktigerRomDesc[] = {
1489 	{ "b30_01.7j",		0x10000, 0x07f64d13, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1490 	{ "b30_03.7h",		0x10000, 0x41be6978, 1 | BRF_PRG | BRF_ESS }, //  1
1491 	{ "b30_02.8j",		0x08000, 0x1d63e9c4, 1 | BRF_PRG | BRF_ESS }, //  2
1492 	{ "b30_04.8h",		0x08000, 0x03957a30, 1 | BRF_PRG | BRF_ESS }, //  3
1493 
1494 	{ "b30_05.4f",		0x08000, 0x1a8f1e10, 2 | BRF_PRG | BRF_ESS }, //  4 Z80 code
1495 
1496 	{ "dsp-22",			0x00800, 0x8a1d48d9, 3 | BRF_PRG | BRF_ESS }, //  5 TMS32010 code
1497 	{ "dsp-21",			0x00800, 0x33d99bc2, 3 | BRF_PRG | BRF_ESS }, //  6
1498 
1499 	{ "b30_08.8c",		0x04000, 0x0a254133, 4 | BRF_GRA },           //  7 Text characters
1500 	{ "b30_07.10b",		0x04000, 0xe9e2d4b1, 4 | BRF_GRA },           //  8
1501 	{ "b30_06.8b",		0x04000, 0xa599d845, 4 | BRF_GRA },           //  9
1502 
1503 	{ "b30_16.20b",		0x10000, 0x15b3991d, 5 | BRF_GRA },           // 10 Background tiles
1504 	{ "b30_15.18b",		0x10000, 0xd9e2e55d, 5 | BRF_GRA },           // 11
1505 	{ "b30_13.18c",		0x10000, 0x13daeac8, 5 | BRF_GRA },           // 12
1506 	{ "b30_14.20c",		0x10000, 0x8cc79357, 5 | BRF_GRA },           // 13
1507 
1508 	{ "b30_12.16c",		0x08000, 0xb5d48389, 6 | BRF_GRA },           // 14 Foreground tiles
1509 	{ "b30_11.14c",		0x08000, 0x97f20fdc, 6 | BRF_GRA },           // 15
1510 	{ "b30_10.12c",		0x08000, 0x170c01db, 6 | BRF_GRA },           // 16
1511 	{ "b30_09.10c",		0x08000, 0x44f5accd, 6 | BRF_GRA },           // 17
1512 
1513 	{ "b30_20.12d",		0x10000, 0xcb4092b8, 7 | BRF_GRA },           // 18 Sprites
1514 	{ "b30_19.14d",		0x10000, 0x9cb8675e, 7 | BRF_GRA },           // 19
1515 	{ "b30_18.15d",		0x10000, 0x806fb374, 7 | BRF_GRA },           // 20
1516 	{ "b30_17.16d",		0x10000, 0x4264bff8, 7 | BRF_GRA },           // 21
1517 
1518 	{ "82s129.d3",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 22 Proms (not used)
1519 	{ "82s129.d4",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 23
1520 	{ "82s123.d2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 24
1521 	{ "82s123.e18",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 25
1522 	{ "82s123.b24",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 26
1523 };
1524 
1525 STD_ROM_PICK(ktiger)
1526 STD_ROM_FN(ktiger)
1527 
1528 struct BurnDriver BurnDrvKtiger = {
1529 	"ktiger", "twincobr", NULL, NULL, "1987",
1530 	"Kyukyoku Tiger (Japan)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous",
1531 	NULL, NULL, NULL, NULL,
1532 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1533 	NULL, ktigerRomInfo, ktigerRomName, NULL, NULL, NULL, NULL, TwincobrInputInfo, KtigerDIPInfo,
1534 	twincobrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1535 	240, 320, 3, 4
1536 };
1537 
1538 
1539 // Flying Shark (World)
1540 
1541 static struct BurnRomInfo fsharkRomDesc[] = {
1542 	{ "b02_18-1.m8",	0x10000, 0x04739e02, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1543 	{ "b02_17-1.p8",	0x10000, 0xfd6ef7a8, 1 | BRF_PRG | BRF_ESS }, //  1
1544 
1545 	{ "b02_16.l5",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1546 
1547 	{ "82s137-1.mcu",	0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1548 	{ "82s137-2.mcu",	0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, //  4
1549 	{ "82s137-3.mcu",	0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, //  5
1550 	{ "82s137-4.mcu",	0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, //  6
1551 	{ "82s137-5.mcu",	0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, //  7
1552 	{ "82s137-6.mcu",	0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, //  8
1553 	{ "82s137-7.mcu",	0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, //  9
1554 	{ "82s137-8.mcu",	0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10
1555 
1556 	{ "b02_07-1.h11",	0x04000, 0xe669f80e, 4 | BRF_GRA },           // 11 Text characters
1557 	{ "b02_06-1.h10",	0x04000, 0x5e53ae47, 4 | BRF_GRA },           // 12
1558 	{ "b02_05-1.h8",	0x04000, 0xa8b05bd0, 4 | BRF_GRA },           // 13
1559 
1560 	{ "b02_12.h20",		0x08000, 0x733b9997, 5 | BRF_GRA },           // 14 Background tiles
1561 	{ "b02_15.h24",		0x08000, 0x8b70ef32, 5 | BRF_GRA },           // 15
1562 	{ "b02_14.h23",		0x08000, 0xf711ba7d, 5 | BRF_GRA },           // 16
1563 	{ "b02_13.h21",		0x08000, 0x62532cd3, 5 | BRF_GRA },           // 17
1564 
1565 	{ "b02_08.h13",		0x08000, 0xef0cf49c, 6 | BRF_GRA },           // 18 Foreground tiles
1566 	{ "b02_11.h18",		0x08000, 0xf5799422, 6 | BRF_GRA },           // 19
1567 	{ "b02_10.h16",		0x08000, 0x4bd099ff, 6 | BRF_GRA },           // 20
1568 	{ "b02_09.h15",		0x08000, 0x230f1582, 6 | BRF_GRA },           // 21
1569 
1570 	{ "b02_01.d15",		0x10000, 0x2234b424, 7 | BRF_GRA },           // 22 Sprites
1571 	{ "b02_02.d16",		0x10000, 0x30d4c9a8, 7 | BRF_GRA },           // 23
1572 	{ "b02_03.d17",		0x10000, 0x64f3d88f, 7 | BRF_GRA },           // 24
1573 	{ "b02_04.d20",		0x10000, 0x3b23a9fc, 7 | BRF_GRA },           // 25
1574 
1575 	{ "b02-20.b4",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 26 Proms (not used)
1576 	{ "b02-21.b5",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 27
1577 	{ "b02-19.b2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 28
1578 	{ "b02-22.c21",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 29
1579 	{ "b02-23.f28",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 30
1580 };
1581 
1582 STD_ROM_PICK(fshark)
STD_ROM_FN(fshark)1583 STD_ROM_FN(fshark)
1584 
1585 static INT32 fsharkInit()
1586 {
1587 	return DrvInit(1);
1588 }
1589 
1590 struct BurnDriver BurnDrvFshark = {
1591 	"fshark", NULL, NULL, NULL, "1987",
1592 	"Flying Shark (World)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous",
1593 	NULL, NULL, NULL, NULL,
1594 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1595 	NULL, fsharkRomInfo, fsharkRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, FsharkDIPInfo,
1596 	fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1597 	240, 320, 3, 4
1598 };
1599 
1600 
1601 // Sky Shark (US, set 1)
1602 
1603 static struct BurnRomInfo skysharkRomDesc[] = {
1604 	{ "b02_18-2.m8",	0x10000, 0x888e90f3, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1605 	{ "b02_17-2.p8",	0x10000, 0x066d67be, 1 | BRF_PRG | BRF_ESS }, //  1
1606 
1607 	{ "b02_16.l5",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1608 
1609 	{ "82s137-1.mcu",	0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1610 	{ "82s137-2.mcu",	0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, //  4
1611 	{ "82s137-3.mcu",	0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, //  5
1612 	{ "82s137-4.mcu",	0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, //  6
1613 	{ "82s137-5.mcu",	0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, //  7
1614 	{ "82s137-6.mcu",	0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, //  8
1615 	{ "82s137-7.mcu",	0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, //  9
1616 	{ "82s137-8.mcu",	0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10
1617 
1618 	{ "b02_7-2.h11",	0x04000, 0xaf48c4e6, 4 | BRF_GRA },           // 11 Text characters
1619 	{ "b02_6-2.h10",	0x04000, 0x9a29a862, 4 | BRF_GRA },           // 12
1620 	{ "b02_5-2.h8",		0x04000, 0xfb7cad55, 4 | BRF_GRA },           // 13
1621 
1622 	{ "b02_12.h20",		0x08000, 0x733b9997, 5 | BRF_GRA },           // 14 Background tiles
1623 	{ "b02_15.h24",		0x08000, 0x8b70ef32, 5 | BRF_GRA },           // 15
1624 	{ "b02_14.h23",		0x08000, 0xf711ba7d, 5 | BRF_GRA },           // 16
1625 	{ "b02_13.h21",		0x08000, 0x62532cd3, 5 | BRF_GRA },           // 17
1626 
1627 	{ "b02_08.h13",		0x08000, 0xef0cf49c, 6 | BRF_GRA },           // 18 Foreground tiles
1628 	{ "b02_11.h18",		0x08000, 0xf5799422, 6 | BRF_GRA },           // 19
1629 	{ "b02_10.h16",		0x08000, 0x4bd099ff, 6 | BRF_GRA },           // 20
1630 	{ "b02_09.h15",		0x08000, 0x230f1582, 6 | BRF_GRA },           // 21
1631 
1632 	{ "b02_01.d15",		0x10000, 0x2234b424, 7 | BRF_GRA },           // 22 Sprites
1633 	{ "b02_02.d16",		0x10000, 0x30d4c9a8, 7 | BRF_GRA },           // 23
1634 	{ "b02_03.d17",		0x10000, 0x64f3d88f, 7 | BRF_GRA },           // 24
1635 	{ "b02_04.d20",		0x10000, 0x3b23a9fc, 7 | BRF_GRA },           // 25
1636 
1637 	{ "b02-20.b4",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 26 Proms (not used)
1638 	{ "b02-21.b5",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 27
1639 	{ "b02-19.b2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 28
1640 	{ "b02-22.c21",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 29
1641 	{ "b02-23.f28",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 30
1642 };
1643 
1644 STD_ROM_PICK(skyshark)
1645 STD_ROM_FN(skyshark)
1646 
1647 struct BurnDriver BurnDrvSkyshark = {
1648 	"skyshark", "fshark", NULL, NULL, "1987",
1649 	"Sky Shark (US, set 1)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous",
1650 	NULL, NULL, NULL, NULL,
1651 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1652 	NULL, skysharkRomInfo, skysharkRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo,
1653 	fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1654 	240, 320, 3, 4
1655 };
1656 
1657 
1658 // Sky Shark (US, set 2)
1659 
1660 static struct BurnRomInfo skysharkaRomDesc[] = {
1661 	{ "b02_18-2.m8",	0x10000, 0x341deaac, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1662 	{ "b02_17-2.p8",	0x10000, 0xec3b5a2c, 1 | BRF_PRG | BRF_ESS }, //  1
1663 
1664 	{ "b02_16.l5",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1665 
1666 	{ "82s137-1.mcu",	0x00400, 0xcc5b3f53, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1667 	{ "82s137-2.mcu",	0x00400, 0x47351d55, 3 | BRF_PRG | BRF_ESS }, //  4
1668 	{ "82s137-3.mcu",	0x00400, 0x70b537b9, 3 | BRF_PRG | BRF_ESS }, //  5
1669 	{ "82s137-4.mcu",	0x00400, 0x6edb2de8, 3 | BRF_PRG | BRF_ESS }, //  6
1670 	{ "82s137-5.mcu",	0x00400, 0xf35b978a, 3 | BRF_PRG | BRF_ESS }, //  7
1671 	{ "82s137-6.mcu",	0x00400, 0x0459e51b, 3 | BRF_PRG | BRF_ESS }, //  8
1672 	{ "82s137-7.mcu",	0x00400, 0xcbf3184b, 3 | BRF_PRG | BRF_ESS }, //  9
1673 	{ "82s137-8.mcu",	0x00400, 0x8246a05c, 3 | BRF_PRG | BRF_ESS }, // 10
1674 
1675 	{ "b02_7-2.h11",	0x04000, 0xaf48c4e6, 4 | BRF_GRA },           // 11 Text characters
1676 	{ "b02_6-2.h10",	0x04000, 0x9a29a862, 4 | BRF_GRA },           // 12
1677 	{ "b02_5-2.h8",		0x04000, 0xfb7cad55, 4 | BRF_GRA },           // 13
1678 
1679 	{ "b02_12.h20",		0x08000, 0x733b9997, 5 | BRF_GRA },           // 14 Background tiles
1680 	{ "b02_15.h24",		0x08000, 0x8b70ef32, 5 | BRF_GRA },           // 15
1681 	{ "b02_14.h23",		0x08000, 0xf711ba7d, 5 | BRF_GRA },           // 16
1682 	{ "b02_13.h21",		0x08000, 0x62532cd3, 5 | BRF_GRA },           // 17
1683 
1684 	{ "b02_08.h13",		0x08000, 0xef0cf49c, 6 | BRF_GRA },           // 18 Foreground tiles
1685 	{ "b02_11.h18",		0x08000, 0xf5799422, 6 | BRF_GRA },           // 19
1686 	{ "b02_10.h16",		0x08000, 0x4bd099ff, 6 | BRF_GRA },           // 20
1687 	{ "b02_09.h15",		0x08000, 0x230f1582, 6 | BRF_GRA },           // 21
1688 
1689 	{ "b02_01.d15",		0x10000, 0x2234b424, 7 | BRF_GRA },           // 22 Sprites
1690 	{ "b02_02.d16",		0x10000, 0x30d4c9a8, 7 | BRF_GRA },           // 23
1691 	{ "b02_03.d17",		0x10000, 0x64f3d88f, 7 | BRF_GRA },           // 24
1692 	{ "b02_04.d20",		0x10000, 0x3b23a9fc, 7 | BRF_GRA },           // 25
1693 
1694 	{ "b02-20.b4",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 26 Proms (not used)
1695 	{ "b02-21.b5",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 27
1696 	{ "b02-19.b2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 28
1697 	{ "b02-22.c21",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 29
1698 	{ "b02-23.f28",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 30
1699 };
1700 
1701 STD_ROM_PICK(skysharka)
1702 STD_ROM_FN(skysharka)
1703 
1704 struct BurnDriver BurnDrvSkysharka = {
1705 	"skysharka", "fshark", NULL, NULL, "1987",
1706 	"Sky Shark (US, set 2)\0", NULL, "Toaplan / Taito America Corporation (Romstar license)", "Miscellaneous",
1707 	NULL, NULL, NULL, NULL,
1708 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1709 	NULL, skysharkaRomInfo, skysharkaRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo,
1710 	fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1711 	240, 320, 3, 4
1712 };
1713 
1714 
1715 // Hishou Zame (Japan)
1716 
1717 static struct BurnRomInfo hishouzaRomDesc[] = {
1718 	{ "b02_18.m8",		0x10000, 0x4444bb94, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1719 	{ "b02_17.p8",		0x10000, 0xcdac7228, 1 | BRF_PRG | BRF_ESS }, //  1
1720 
1721 	{ "b02_16.l5",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1722 
1723 	{ "dsp-a1.bpr",		0x00400, 0x45d4d1b1, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1724 	{ "dsp-a2.bpr",		0x00400, 0xedd227fa, 3 | BRF_PRG | BRF_ESS }, //  4
1725 	{ "dsp-a3.bpr",		0x00400, 0xdf88e79b, 3 | BRF_PRG | BRF_ESS }, //  5
1726 	{ "dsp-a4.bpr",		0x00400, 0xa2094a7f, 3 | BRF_PRG | BRF_ESS }, //  6
1727 	{ "dsp-b5.bpr",		0x00400, 0x85ca5d47, 3 | BRF_PRG | BRF_ESS }, //  7
1728 	{ "dsp-b6.bpr",		0x00400, 0x81816b2c, 3 | BRF_PRG | BRF_ESS }, //  8
1729 	{ "dsp-b7.bpr",		0x00400, 0xe87540cd, 3 | BRF_PRG | BRF_ESS }, //  9
1730 	{ "dsp-b8.bpr",		0x00400, 0xd3c16c5c, 3 | BRF_PRG | BRF_ESS }, // 10
1731 
1732 	{ "b02-07.h11",		0x04000, 0xc13a775e, 4 | BRF_GRA },           // 11 Text characters
1733 	{ "b02-06.h10",		0x04000, 0xad5f1371, 4 | BRF_GRA },           // 12
1734 	{ "b02-05.h8",		0x04000, 0x85a7bff6, 4 | BRF_GRA },           // 13
1735 
1736 	{ "b02_12.h20",		0x08000, 0x733b9997, 5 | BRF_GRA },           // 14 Background tiles
1737 	{ "b02_15.h24",		0x08000, 0x8b70ef32, 5 | BRF_GRA },           // 15
1738 	{ "b02_14.h23",		0x08000, 0xf711ba7d, 5 | BRF_GRA },           // 16
1739 	{ "b02_13.h21",		0x08000, 0x62532cd3, 5 | BRF_GRA },           // 17
1740 
1741 	{ "b02_08.h13",		0x08000, 0xef0cf49c, 6 | BRF_GRA },           // 18 Foreground tiles
1742 	{ "b02_11.h18",		0x08000, 0xf5799422, 6 | BRF_GRA },           // 19
1743 	{ "b02_10.h16",		0x08000, 0x4bd099ff, 6 | BRF_GRA },           // 20
1744 	{ "b02_09.h15",		0x08000, 0x230f1582, 6 | BRF_GRA },           // 21
1745 
1746 	{ "b02_01.d15",		0x10000, 0x2234b424, 7 | BRF_GRA },           // 22 Sprites
1747 	{ "b02_02.d16",		0x10000, 0x30d4c9a8, 7 | BRF_GRA },           // 23
1748 	{ "b02_03.d17",		0x10000, 0x64f3d88f, 7 | BRF_GRA },           // 24
1749 	{ "b02_04.d20",		0x10000, 0x3b23a9fc, 7 | BRF_GRA },           // 25
1750 
1751 	{ "b02-20.b4",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 26 Proms (not used)
1752 	{ "b02-21.b5",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 27
1753 	{ "b02-19.b2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 28
1754 	{ "b02-22.c21",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 29
1755 	{ "b02-23.f28",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 30
1756 };
1757 
1758 STD_ROM_PICK(hishouza)
1759 STD_ROM_FN(hishouza)
1760 
1761 struct BurnDriver BurnDrvHishouza = {
1762 	"hishouza", "fshark", NULL, NULL, "1987",
1763 	"Hishou Zame (Japan)\0", NULL, "Toaplan / Taito Corporation", "Miscellaneous",
1764 	NULL, NULL, NULL, NULL,
1765 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1766 	NULL, hishouzaRomInfo, hishouzaRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, HishouzaDIPInfo,
1767 	fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1768 	240, 320, 3, 4
1769 };
1770 
1771 
1772 // Flying Shark (bootleg with 8741)
1773 
1774 static struct BurnRomInfo fsharkbtRomDesc[] = {
1775 	{ "r18",		0x10000, 0xef30f563, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1776 	{ "r17",		0x10000, 0x0e18d25f, 1 | BRF_PRG | BRF_ESS }, //  1
1777 
1778 	{ "b02_16.l5",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1779 
1780 	{ "mcu-1.bpr",		0x00400, 0x45d4d1b1, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1781 	{ "mcu-2.bpr",		0x00400, 0x651336d1, 3 | BRF_PRG | BRF_ESS }, //  4
1782 	{ "mcu-3.bpr",		0x00400, 0xdf88e79b, 3 | BRF_PRG | BRF_ESS }, //  5
1783 	{ "mcu-4.bpr",		0x00400, 0xa2094a7f, 3 | BRF_PRG | BRF_ESS }, //  6
1784 	{ "mcu-5.bpr",		0x00400, 0xf97a58da, 3 | BRF_PRG | BRF_ESS }, //  7
1785 	{ "mcu-6.bpr",		0x00400, 0xffcc422d, 3 | BRF_PRG | BRF_ESS }, //  8
1786 	{ "mcu-7.bpr",		0x00400, 0x0cd30d49, 3 | BRF_PRG | BRF_ESS }, //  9
1787 	{ "mcu-8.bpr",		0x00400, 0x3379bbff, 3 | BRF_PRG | BRF_ESS }, // 10
1788 
1789 	{ "b02_07-1.h11",	0x04000, 0xe669f80e, 4 | BRF_GRA },           // 11 Text characters
1790 	{ "b02_06-1.h10",	0x04000, 0x5e53ae47, 4 | BRF_GRA },           // 12
1791 	{ "b02_05-1.h8",	0x04000, 0xa8b05bd0, 4 | BRF_GRA },           // 13
1792 
1793 	{ "b02_12.h20",		0x08000, 0x733b9997, 5 | BRF_GRA },           // 14 Background tiles
1794 	{ "b02_15.h24",		0x08000, 0x8b70ef32, 5 | BRF_GRA },           // 15
1795 	{ "b02_14.h23",		0x08000, 0xf711ba7d, 5 | BRF_GRA },           // 16
1796 	{ "b02_13.h21",		0x08000, 0x62532cd3, 5 | BRF_GRA },           // 17
1797 
1798 	{ "b02_08.h13",		0x08000, 0xef0cf49c, 6 | BRF_GRA },           // 18 Foreground tiles
1799 	{ "b02_11.h18",		0x08000, 0xf5799422, 6 | BRF_GRA },           // 19
1800 	{ "b02_10.h16",		0x08000, 0x4bd099ff, 6 | BRF_GRA },           // 20
1801 	{ "b02_09.h15",		0x08000, 0x230f1582, 6 | BRF_GRA },           // 21
1802 
1803 	{ "b02_01.d15",		0x10000, 0x2234b424, 7 | BRF_GRA },           // 22 Sprites
1804 	{ "b02_02.d16",		0x10000, 0x30d4c9a8, 7 | BRF_GRA },           // 23
1805 	{ "b02_03.d17",		0x10000, 0x64f3d88f, 7 | BRF_GRA },           // 24
1806 	{ "b02_04.d20",		0x10000, 0x3b23a9fc, 7 | BRF_GRA },           // 25
1807 
1808 	{ "clr2.bpr",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 26 Proms (not used)
1809 	{ "clr1.bpr",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 27
1810 	{ "clr3.bpr",		0x00100, 0x016fe2f7, 0 | BRF_OPT },           // 28
1811 
1812 	{ "fsb_8741.mcu",	0x00400, 0x00000000, 9 | BRF_NODUMP | BRF_OPT},// 29 MCU
1813 };
1814 
1815 STD_ROM_PICK(fsharkbt)
1816 STD_ROM_FN(fsharkbt)
1817 
1818 struct BurnDriver BurnDrvFsharkbt = {
1819 	"fsharkbt", "fshark", NULL, NULL, "1987",
1820 	"Flying Shark (bootleg with 8741)\0", NULL, "bootleg", "Miscellaneous",
1821 	NULL, NULL, NULL, NULL,
1822 	BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1823 	NULL, fsharkbtRomInfo, fsharkbtRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, SkysharkDIPInfo,
1824 	fsharkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1825 	240, 320, 3, 4
1826 };
1827 
1828 
1829 // Flyin' Shark (bootleg of Hishou Zame)
1830 
1831 static struct BurnRomInfo fnsharkRomDesc[] = {
1832 	{ "h.ic226",		0x10000, 0xea4bcb43, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1833 	{ "g.ic202",		0x10000, 0xd1f39ed2, 1 | BRF_PRG | BRF_ESS }, //  1
1834 
1835 	{ "f.ic170",		0x08000, 0xcdd1a153, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1836 
1837 	{ "82s191_r.bin",	0x00800, 0x5b96ae3f, 7 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1838 	{ "82s191_l.bin",	0x00800, 0xd5dfc8dd, 7 | BRF_PRG | BRF_ESS }, //  4
1839 
1840 	{ "7.ic119",		0x04000, 0xa0f8890d, 3 | BRF_GRA },           //  5 Text characters
1841 	{ "6.ic120",		0x04000, 0xc5bfca95, 3 | BRF_GRA },           //  6
1842 	{ "5.ic121",		0x04000, 0xb8c370bc, 3 | BRF_GRA },           //  7
1843 
1844 	{ "b.ic114",		0x08000, 0x733b9997, 4 | BRF_GRA },           //  8 Background tiles
1845 	{ "e.ic111",		0x08000, 0x8b70ef32, 4 | BRF_GRA },           //  9
1846 	{ "d.ic112",		0x08000, 0xf711ba7d, 4 | BRF_GRA },           // 10
1847 	{ "c.ic113",		0x08000, 0x62532cd3, 4 | BRF_GRA },           // 11
1848 
1849 	{ "8.ic118",		0x08000, 0xef0cf49c, 5 | BRF_GRA },           // 12 Foreground tiles
1850 	{ "a.ic115",		0x08000, 0xf5799422, 5 | BRF_GRA },           // 13
1851 	{ "10.ic116",		0x08000, 0x4bd099ff, 5 | BRF_GRA },           // 14
1852 	{ "9.ic117",		0x08000, 0x230f1582, 5 | BRF_GRA },           // 15
1853 
1854 	{ "1.ic54",		0x10000, 0x2234b424, 6 | BRF_GRA },           // 16 Sprites
1855 	{ "2.ic53",		0x10000, 0x30d4c9a8, 6 | BRF_GRA },           // 17
1856 	{ "3.ic52",		0x10000, 0x64f3d88f, 6 | BRF_GRA },           // 18
1857 	{ "4.ic51",		0x10000, 0x3b23a9fc, 6 | BRF_GRA },           // 19
1858 
1859 	{ "82s129.ic41",	0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 20 Proms (not used)
1860 	{ "82s129.ic40",	0x00100, 0xa50cef09, 0 | BRF_OPT },           // 21
1861 	{ "82s123.ic42",	0x00020, 0xf72482db, 0 | BRF_OPT },           // 22
1862 	{ "82s123.ic50",	0x00020, 0xbc88cced, 0 | BRF_OPT },           // 23
1863 	{ "82s123.ic99",	0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 24
1864 };
1865 
1866 STD_ROM_PICK(fnshark)
STD_ROM_FN(fnshark)1867 STD_ROM_FN(fnshark)
1868 
1869 static INT32 bootInit()
1870 {
1871 	return DrvInit(3);
1872 }
1873 
1874 struct BurnDriver BurnDrvFnshark = {
1875 	"fnshark", "fshark", NULL, NULL, "1987",
1876 	"Flyin' Shark (bootleg of Hishou Zame)\0", NULL, "bootleg", "Miscellaneous",
1877 	NULL, NULL, NULL, NULL,
1878 	BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1879 	NULL, fnsharkRomInfo, fnsharkRomName, NULL, NULL, NULL, NULL, FsharkInputInfo, HishouzaDIPInfo,
1880 	bootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1881 	240, 320, 3, 4
1882 };
1883 
1884 
1885 // Gulf War II (set 1)
1886 
1887 static struct BurnRomInfo gulfwar2RomDesc[] = {
1888 	{ "08-u119.bin",	0x20000, 0x41ebf9c0, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1889 	{ "07-u92.bin",		0x20000, 0xb73e6b25, 1 | BRF_PRG | BRF_ESS }, //  1
1890 
1891 	{ "06-u51.bin",		0x08000, 0x75504f95, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1892 
1893 	{ "02-u1.rom",		0x02000, 0xabefe4ca, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1894 	{ "01-u2.rom",		0x02000, 0x01399b65, 3 | BRF_PRG | BRF_ESS }, //  4
1895 
1896 	{ "03-u9.bin",		0x04000, 0x1b7934b3, 4 | BRF_GRA },           //  5 Text characters
1897 	{ "04-u10.bin",		0x04000, 0x6f7bfb58, 4 | BRF_GRA },           //  6
1898 	{ "05-u11.bin",		0x04000, 0x31814724, 4 | BRF_GRA },           //  7
1899 
1900 	{ "16-u202.bin",	0x10000, 0xd815d175, 5 | BRF_GRA },           //  8 Background tiles
1901 	{ "13-u199.bin",	0x10000, 0xd949b0d9, 5 | BRF_GRA },           //  9
1902 	{ "14-u200.bin",	0x10000, 0xc109a6ac, 5 | BRF_GRA },           // 10
1903 	{ "15-u201.bin",	0x10000, 0xad21f2ab, 5 | BRF_GRA },           // 11
1904 
1905 	{ "09-u195.bin",	0x08000, 0xb7be3a6d, 6 | BRF_GRA },           // 12 Foreground tiles
1906 	{ "12-u198.bin",	0x08000, 0xfd7032a6, 6 | BRF_GRA },           // 13
1907 	{ "11-u197.bin",	0x08000, 0x7b721ed3, 6 | BRF_GRA },           // 14
1908 	{ "10-u196.rom",	0x08000, 0x160f38ab, 6 | BRF_GRA },           // 15
1909 
1910 	{ "20-u262.bin",	0x10000, 0x10665ca0, 7 | BRF_GRA },           // 16 Sprites
1911 	{ "19-u261.bin",	0x10000, 0xcfa6d417, 7 | BRF_GRA },           // 17
1912 	{ "18-u260.bin",	0x10000, 0x2e6a0c49, 7 | BRF_GRA },           // 18
1913 	{ "17-u259.bin",	0x10000, 0x66c1b0e6, 7 | BRF_GRA },           // 19
1914 
1915 	{ "82s129.d3",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 20 Proms (not used)
1916 	{ "82s129.d4",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 21
1917 	{ "82s123.d2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 22
1918 	{ "82s123.e18",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 23
1919 	{ "82s123.b24",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 24
1920 };
1921 
1922 STD_ROM_PICK(gulfwar2)
STD_ROM_FN(gulfwar2)1923 STD_ROM_FN(gulfwar2)
1924 
1925 static INT32 gulfwar2Init()
1926 {
1927 	return DrvInit(2);
1928 }
1929 
1930 struct BurnDriver BurnDrvGulfwar2 = {
1931 	"gulfwar2", NULL, NULL, NULL, "1991",
1932 	"Gulf War II (set 1)\0", NULL, "Comad", "Miscellaneous",
1933 	NULL, NULL, NULL, NULL,
1934 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1935 	NULL, gulfwar2RomInfo, gulfwar2RomName, NULL, NULL, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo,
1936 	gulfwar2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x700,
1937 	240, 320, 3, 4
1938 };
1939 
1940 
1941 // Gulf War II (set 2)
1942 
1943 static struct BurnRomInfo gulfwar2aRomDesc[] = {
1944 	{ "gw2_28.u119",	0x20000, 0xb9118660, 1 | BRF_PRG | BRF_ESS }, //  0 68k code
1945 	{ "gw2_27.u92",		0x20000, 0x3494f1aa, 1 | BRF_PRG | BRF_ESS }, //  1
1946 
1947 	{ "06-u51.bin",		0x08000, 0x75504f95, 2 | BRF_PRG | BRF_ESS }, //  2 Z80 code
1948 
1949 	{ "gw2_22.udsp1",	0x01000, 0x3a97b0db, 3 | BRF_PRG | BRF_ESS }, //  3 TMS32010 code
1950 	{ "gw2_21.udsp2",	0x01000, 0x87a473af, 3 | BRF_PRG | BRF_ESS }, //  4
1951 
1952 	{ "gw2_23.u9",		0x08000, 0xa2aee4c8, 4 | BRF_GRA },           //  5 Text characters
1953 	{ "gw2_24.u10",		0x08000, 0xfb3f71cd, 4 | BRF_GRA },           //  6
1954 	{ "gw2_25.u11",		0x08000, 0x90eeb0a0, 4 | BRF_GRA },           //  7
1955 
1956 	{ "16-u202.bin",	0x10000, 0xd815d175, 5 | BRF_GRA },           //  8 Background tiles
1957 	{ "13-u199.bin",	0x10000, 0xd949b0d9, 5 | BRF_GRA },           //  9
1958 	{ "14-u200.bin",	0x10000, 0xc109a6ac, 5 | BRF_GRA },           // 10
1959 	{ "15-u201.bin",	0x10000, 0xad21f2ab, 5 | BRF_GRA },           // 11
1960 
1961 	{ "09-u195.bin",	0x08000, 0xb7be3a6d, 6 | BRF_GRA },           // 12 Foreground tiles
1962 	{ "12-u198.bin",	0x08000, 0xfd7032a6, 6 | BRF_GRA },           // 13
1963 	{ "11-u197.bin",	0x08000, 0x7b721ed3, 6 | BRF_GRA },           // 14
1964 	{ "10-u196.rom",	0x08000, 0x160f38ab, 6 | BRF_GRA },           // 15
1965 
1966 	{ "20-u262.bin",	0x10000, 0x10665ca0, 7 | BRF_GRA },           // 16 Sprites
1967 	{ "19-u261.bin",	0x10000, 0xcfa6d417, 7 | BRF_GRA },           // 17
1968 	{ "18-u260.bin",	0x10000, 0x2e6a0c49, 7 | BRF_GRA },           // 18
1969 	{ "17-u259.bin",	0x10000, 0x66c1b0e6, 7 | BRF_GRA },           // 19
1970 
1971 	{ "82s129.d3",		0x00100, 0x24e7d62f, 0 | BRF_OPT },           // 20 Proms (not used)
1972 	{ "82s129.d4",		0x00100, 0xa50cef09, 0 | BRF_OPT },           // 21
1973 	{ "82s123.d2",		0x00020, 0xf72482db, 0 | BRF_OPT },           // 22
1974 	{ "82s123.e18",		0x00020, 0xbc88cced, 0 | BRF_OPT },           // 23
1975 	{ "82s123.b24",		0x00020, 0x4fb5df2a, 0 | BRF_OPT },           // 24
1976 };
1977 
1978 STD_ROM_PICK(gulfwar2a)
1979 STD_ROM_FN(gulfwar2a)
1980 
1981 struct BurnDriver BurnDrvGulfwar2a = {
1982 	"gulfwar2a", "gulfwar2", NULL, NULL, "1991",
1983 	"Gulf War II (set 2)\0", NULL, "Comad", "Miscellaneous",
1984 	NULL, NULL, NULL, NULL,
1985 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_TOAPLAN_MISC, GBF_VERSHOOT, 0,
1986 	NULL, gulfwar2aRomInfo, gulfwar2aRomName, NULL, NULL, NULL, NULL, TwincobrInputInfo, TwincobrDIPInfo,
1987 	gulfwar2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x700,
1988 	240, 320, 3, 4
1989 };
1990