1 // FinalBurn Neo Hyperstone-based game driver module
2 // Based on MAME driver by Angelo Salese, David Haywood, Pierpaolo Prazzoli, Tomasz Slanina
3 
4 // mrkickera	- not working
5 // yorijori		- unemulated
6 
7 #include "tiles_generic.h"
8 #include "e132xs_intf.h"
9 #include "burn_ym2151.h"
10 #include "msm6295.h"
11 #include "qs1000.h"
12 #include "eeprom.h"
13 #include "burn_pal.h"
14 
15 static UINT8 *AllMem;
16 static UINT8 *AllRam;
17 static UINT8 *RamEnd;
18 static UINT8 *MemEnd;
19 static UINT8 *DrvMainROM;
20 static UINT8 *DrvQSROM;
21 static UINT8 *DrvGfxROM;
22 static UINT8 *DrvSndROM[2];
23 static UINT8 *DrvEEPROM;
24 static UINT8 *DrvMainRAM;
25 static UINT8 *DrvTileRAM;
26 static UINT8 *DrvNVRAM;
27 
28 static UINT8 DrvRecalc;
29 
30 static INT32 soundlatch;
31 static INT32 flipscreen;
32 static INT32 okibank;
33 static INT32 nvram_bank;
34 static INT32 protection_index;
35 static INT32 protection_which;
36 
37 static INT32 sound_type = 0; // ym2151+msm6295, 1 = ym2151 + 2x msm6295, 2 = qs1000 Samples
38 static INT32 graphics_size = 0;
39 static INT32 sound_size[2] = { 0, 0 };
40 static INT32 palette_bit = 0; // (shift palette control word in ram)
41 static INT32 cpu_clock = 50000000;
42 static INT32 protection_data[2];
43 
44 static UINT32 speedhack_address = ~0;
45 static UINT32 speedhack_pc = 0;
46 static void (*speedhack_callback)(UINT32);
47 
48 static UINT8 DrvJoy1[32];
49 static UINT8 DrvJoy2[32];
50 static UINT8 DrvJoy3[32];
51 static UINT32 DrvInputs[3];
52 static UINT8 DrvReset;
53 
54 static INT32 is_boongga = 0;
55 
56 static INT16 DrvPaddle; // butt-smacking paddle (..not the usual DrvPaddle)
57 static UINT8 PaddleVal;
58 
59 static struct BurnInputInfo CommonInputList[] = {
60 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy2 + 0,	"p1 coin"	},
61 	{"P1 Start",		BIT_DIGITAL,	DrvJoy2 + 6,	"p1 start"	},
62 	{"P1 Up",			BIT_DIGITAL,	DrvJoy1 + 0,	"p1 up"		},
63 	{"P1 Down",			BIT_DIGITAL,	DrvJoy1 + 1,	"p1 down"	},
64 	{"P1 Left",			BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
65 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
66 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p1 fire 1"	},
67 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p1 fire 2"	},
68 	{"P1 Button 3",		BIT_DIGITAL,	DrvJoy1 + 6,	"p1 fire 3"	},
69 	{"P1 Button 4",		BIT_DIGITAL,	DrvJoy1 + 7,	"p1 fire 4"	},
70 
71 	{"P2 Coin",			BIT_DIGITAL,	DrvJoy2 + 2,	"p2 coin"	},
72 	{"P2 Start",		BIT_DIGITAL,	DrvJoy2 + 7,	"p2 start"	},
73 	{"P2 Up",			BIT_DIGITAL,	DrvJoy1 + 8,	"p2 up"		},
74 	{"P2 Down",			BIT_DIGITAL,	DrvJoy1 + 9,	"p2 down"	},
75 	{"P2 Left",			BIT_DIGITAL,	DrvJoy1 + 10,	"p2 left"	},
76 	{"P2 Right",		BIT_DIGITAL,	DrvJoy1 + 11,	"p2 right"	},
77 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy1 + 12,	"p2 fire 1"	},
78 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy1 + 13,	"p2 fire 2"	},
79 	{"P2 Button 3",		BIT_DIGITAL,	DrvJoy1 + 14,	"p2 fire 3"	},
80 	{"P2 Button 4",		BIT_DIGITAL,	DrvJoy1 + 15,	"p2 fire 4"	},
81 
82 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
83 	{"Service 1",		BIT_DIGITAL,	DrvJoy2 + 1,	"service"	},
84 	{"Service 2",		BIT_DIGITAL,	DrvJoy2 + 3,	"service"	},
85 	{"Service Mode",	BIT_DIGITAL,	DrvJoy2 + 4,	"diag"		},
86 };
87 
88 STDINPUTINFO(Common)
89 
90 static struct BurnInputInfo AohInputList[] = {
91 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy2 + 16,	"p1 coin"	},
92 	{"P1 Start",		BIT_DIGITAL,	DrvJoy2 + 17,	"p1 start"	},
93 	{"P1 Up",			BIT_DIGITAL,	DrvJoy1 + 16,	"p1 up"		},
94 	{"P1 Down",			BIT_DIGITAL,	DrvJoy1 + 17,	"p1 down"	},
95 	{"P1 Left",			BIT_DIGITAL,	DrvJoy1 + 18,	"p1 left"	},
96 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 19,	"p1 right"	},
97 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 20,	"p1 fire 1"	},
98 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 21,	"p1 fire 2"	},
99 	{"P1 Button 3",		BIT_DIGITAL,	DrvJoy1 + 22,	"p1 fire 3"	},
100 	{"P1 Button 4",		BIT_DIGITAL,	DrvJoy1 + 23,	"p1 fire 4"	},
101 
102 	{"P2 Coin",			BIT_DIGITAL,	DrvJoy2 + 0,	"p2 coin"	},
103 	{"P2 Start",		BIT_DIGITAL,	DrvJoy2 + 1,	"p2 start"	},
104 	{"P2 Up",			BIT_DIGITAL,	DrvJoy1 + 0,	"p2 up"		},
105 	{"P2 Down",			BIT_DIGITAL,	DrvJoy1 + 1,	"p2 down"	},
106 	{"P2 Left",			BIT_DIGITAL,	DrvJoy1 + 2,	"p2 left"	},
107 	{"P2 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p2 right"	},
108 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy1 + 4,	"p2 fire 1"	},
109 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy1 + 5,	"p2 fire 2"	},
110 	{"P2 Button 3",		BIT_DIGITAL,	DrvJoy1 + 6,	"p2 fire 3"	},
111 	{"P2 Button 4",		BIT_DIGITAL,	DrvJoy1 + 7,	"p2 fire 4"	},
112 
113 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
114 	{"Service",			BIT_DIGITAL,	DrvJoy2 + 5,	"service"	},
115 	{"Service Mode",	BIT_DIGITAL,	DrvJoy2 + 20,	"diag"		},
116 };
117 
118 STDINPUTINFO(Aoh)
119 
120 static struct BurnInputInfo FinalgdrInputList[] = {
121 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy2 + 16,	"p1 coin"	},
122 	{"P1 Start",		BIT_DIGITAL,	DrvJoy1 + 23,	"p1 start"	},
123 	{"P1 Up",			BIT_DIGITAL,	DrvJoy1 + 16,	"p1 up"		},
124 	{"P1 Down",			BIT_DIGITAL,	DrvJoy1 + 17,	"p1 down"	},
125 	{"P1 Left",			BIT_DIGITAL,	DrvJoy1 + 18,	"p1 left"	},
126 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 19,	"p1 right"	},
127 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy1 + 20,	"p1 fire 1"	},
128 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy1 + 21,	"p1 fire 2"	},
129 	{"P1 Button 3",		BIT_DIGITAL,	DrvJoy1 + 22,	"p1 fire 3"	},
130 
131 	{"P2 Coin",			BIT_DIGITAL,	DrvJoy2 + 17,	"p2 coin"	},
132 	{"P2 Start",		BIT_DIGITAL,	DrvJoy1 + 31,	"p2 start"	},
133 	{"P2 Up",			BIT_DIGITAL,	DrvJoy1 + 24,	"p2 up"		},
134 	{"P2 Down",			BIT_DIGITAL,	DrvJoy1 + 25,	"p2 down"	},
135 	{"P2 Left",			BIT_DIGITAL,	DrvJoy1 + 26,	"p2 left"	},
136 	{"P2 Right",		BIT_DIGITAL,	DrvJoy1 + 27,	"p2 right"	},
137 	{"P2 Button 1",		BIT_DIGITAL,	DrvJoy1 + 28,	"p2 fire 1"	},
138 	{"P2 Button 2",		BIT_DIGITAL,	DrvJoy1 + 29,	"p2 fire 2"	},
139 	{"P2 Button 3",		BIT_DIGITAL,	DrvJoy1 + 30,	"p2 fire 3"	},
140 
141 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
142 	{"Service",			BIT_DIGITAL,	DrvJoy2 + 22,	"service"	},
143 	{"Service Mode",	BIT_DIGITAL,	DrvJoy2 + 23,	"diag"		},
144 };
145 
146 STDINPUTINFO(Finalgdr)
147 
148 #define A(a, b, c, d) {a, b, (UINT8*)(c), d}
149 static struct BurnInputInfo BoonggabInputList[] = {
150 	{"P1 Coin",			BIT_DIGITAL,	DrvJoy2 + 0,	"p1 coin"	},
151 	{"P1 Start",		BIT_DIGITAL,	DrvJoy1 + 0,	"p1 start"	},
152 	{"P1 Left",			BIT_DIGITAL,	DrvJoy1 + 2,	"p1 left"	},
153 	{"P1 Right",		BIT_DIGITAL,	DrvJoy1 + 3,	"p1 right"	},
154 	A("P1 Paddle",		BIT_ANALOG_REL, &DrvPaddle,		"p1 z-axis"),
155 	{"P1 Button 1",		BIT_DIGITAL,	DrvJoy3 + 0,	"p1 fire 1"	},
156 	{"P1 Button 2",		BIT_DIGITAL,	DrvJoy3 + 1,	"p1 fire 2"	},
157 	{"P1 Button 3",		BIT_DIGITAL,	DrvJoy3 + 2,	"p1 fire 3"	},
158 	{"P1 Button 4",		BIT_DIGITAL,	DrvJoy3 + 3,	"p1 fire 4"	},
159 	{"P1 Button 5",		BIT_DIGITAL,	DrvJoy3 + 4,	"p1 fire 5"	},
160 	{"P1 Button 6",		BIT_DIGITAL,	DrvJoy3 + 5,	"p1 fire 6"	},
161 	{"P1 Button 7",		BIT_DIGITAL,	DrvJoy3 + 6,	"p1 fire 7"	},
162 
163 	{"Reset",			BIT_DIGITAL,	&DrvReset,		"reset"		},
164 	{"Service 1",		BIT_DIGITAL,	DrvJoy2 + 1,	"service"	},
165 	{"Service 2",		BIT_DIGITAL,	DrvJoy2 + 3,	"service"	},
166 	{"Service Mode",	BIT_DIGITAL,	DrvJoy2 + 4,	"diag"		},
167 };
168 #undef A
STDINPUTINFO(Boonggab)169 STDINPUTINFO(Boonggab)
170 
171 static void vamphalf_io_write(UINT32 address, UINT32 data)
172 {
173 	switch (address)
174 	{
175 		case 0x0c0:
176 			MSM6295Write(0, data & 0xff);
177 		return;
178 
179 		case 0x140:
180 		case 0x144:
181 			BurnYM2151Write((address / 4) & 1, data & 0xff);
182 		return;
183 
184 		case 0x240:
185 			flipscreen = data & 0x80;
186 		return;
187 
188 		case 0x608:
189 			EEPROMWriteBit(data & 0x01);
190 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
191 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE );
192 		return;
193 	}
194 }
195 
vamphalf_io_read(UINT32 address)196 static UINT32 vamphalf_io_read(UINT32 address)
197 {
198 	switch (address)
199 	{
200 		case 0x0c0:
201 			return MSM6295Read(0);
202 
203 		case 0x144:
204 			return BurnYM2151Read();
205 
206 		case 0x1c0:
207 			return EEPROMRead();
208 
209 		case 0x600:
210 			return DrvInputs[1];
211 
212 		case 0x604:
213 			return DrvInputs[0];
214 	}
215 
216 	return 0;
217 }
218 
set_okibank(INT32 data)219 static void set_okibank(INT32 data)
220 {
221 	okibank = data & ((sound_size[0] / 0x20000) - 1);
222 
223 	MSM6295SetBank(0, DrvSndROM[0] + (okibank * 0x20000), 0x20000, 0x3ffff);
224 }
225 
coolmini_io_write(UINT32 address,UINT32 data)226 static void coolmini_io_write(UINT32 address, UINT32 data)
227 {
228 	switch (address)
229 	{
230 		case 0x000: // mrkicker
231 			set_okibank(data);
232 		return;
233 
234 		case 0x200:
235 			flipscreen = data & 1;
236 		return;
237 
238 		case 0x308:
239 			EEPROMWriteBit(data & 0x01);
240 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
241 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE );
242 		return;
243 
244 		case 0x4c0:
245 			MSM6295Write(0, data & 0xff);
246 		return;
247 
248 		case 0x540:
249 		case 0x544:
250 			BurnYM2151Write((address / 4) & 1, data & 0xff);
251 		return;
252 	}
253 }
254 
coolmini_io_read(UINT32 address)255 static UINT32 coolmini_io_read(UINT32 address)
256 {
257 	switch (address)
258 	{
259 		case 0x300:
260 			return DrvInputs[1];
261 
262 		case 0x304:
263 			return DrvInputs[0];
264 
265 		case 0x0c0: // nop
266 			return 0;
267 
268 		case 0x4c0:
269 			return MSM6295Read(0);
270 
271 		case 0x544:
272 			return BurnYM2151Read();
273 
274 		case 0x1c0:
275 			return 0; // nop
276 
277 		case 0x7c0:
278 			return EEPROMRead();
279 	}
280 
281 	return 0;
282 }
283 
jmpbreak_io_write(UINT32 address,UINT32 data)284 static void jmpbreak_io_write(UINT32 address, UINT32 data)
285 {
286 	switch (address)
287 	{
288 		case 0x0c0: // nop
289 		case 0x100:
290 
291 		case 0x440:
292 			MSM6295Write(0, data & 0xff);
293 		return;
294 
295 		case 0x280:
296 			EEPROMWriteBit(data & 0x01);
297 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
298 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
299 		return;
300 
301 		case 0x680:
302 		case 0x684:
303 			BurnYM2151Write((address / 2) & 1, data & 0xff);
304 		return;
305 
306 		case 0x240:
307 			flipscreen = address & 2;
308 		return;
309 
310 		case 0x608:
311 		return; // nop
312 	}
313 }
314 
jmpbreak_io_read(UINT32 address)315 static UINT32 jmpbreak_io_read(UINT32 address)
316 {
317 	switch (address)
318 	{
319 		case 0x0c0: // nop
320 			return 0;
321 
322 		case 0x240:
323 			return DrvInputs[0];
324 
325 		case 0x2c0:
326 			return EEPROMRead();
327 
328 		case 0x440:
329 			return MSM6295Read(0);
330 
331 		case 0x540:
332 			return DrvInputs[1];
333 
334 		case 0x684:
335 			return BurnYM2151Read();
336 	}
337 
338 	return 0;
339 }
340 
suplup_io_write(UINT32 address,UINT32 data)341 static void suplup_io_write(UINT32 address, UINT32 data)
342 {
343 	switch (address)
344 	{
345 		case 0x020:
346 			EEPROMWriteBit(data & 0x01);
347 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
348 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
349 		return;
350 
351 		case 0x080:
352 			MSM6295Write(0, data & 0xff);
353 		return;
354 
355 		case 0x0c0:
356 		case 0x0c4:
357 			BurnYM2151Write((address / 2) & 1, data & 0xff);
358 		return;
359 
360 		case 0x240:
361 			flipscreen = address & 2;
362 		return;
363 	}
364 }
365 
suplup_io_read(UINT32 address)366 static UINT32 suplup_io_read(UINT32 address)
367 {
368 	switch (address)
369 	{
370 		case 0x040:
371 			return DrvInputs[0];
372 
373 		case 0x060:
374 			return DrvInputs[1];
375 
376 		case 0x080:
377 			return MSM6295Read(0);
378 
379 		case 0x0c4:
380 			return BurnYM2151Read();
381 
382 		case 0x100:
383 			return EEPROMRead();
384 	}
385 
386 	return 0;
387 }
388 
mrdig_io_write(UINT32 address,UINT32 data)389 static void mrdig_io_write(UINT32 address, UINT32 data)
390 {
391 	switch (address)
392 	{
393 		case 0x080:
394 			MSM6295Write(0, data & 0xff);
395 		return;
396 
397 		case 0x0c0:
398 		case 0x0c4:
399 			BurnYM2151Write((address / 2) & 1, data & 0xff);
400 		return;
401 
402 		case 0x3c0:
403 			EEPROMWriteBit(data & 0x01);
404 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
405 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
406 		return;
407 	}
408 }
409 
mrdig_io_read(UINT32 address)410 static UINT32 mrdig_io_read(UINT32 address)
411 {
412 	switch (address)
413 	{
414 		case 0x500:
415 			return DrvInputs[0];
416 
417 		case 0x280:
418 			return DrvInputs[1];
419 
420 		case 0x080:
421 			return MSM6295Read(0);
422 
423 		case 0x0c4:
424 			return BurnYM2151Read();
425 
426 		case 0x180:
427 			return EEPROMRead();
428 	}
429 
430 	return 0;
431 }
432 
worldadv_io_write(UINT32 address,UINT32 data)433 static void worldadv_io_write(UINT32 address, UINT32 data)
434 {
435 	switch (address)
436 	{
437 		case 0x180:
438 			EEPROMWriteBit(data & 0x01);
439 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
440 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
441 		return;
442 
443 		case 0x640:
444 			MSM6295Write(0, data & 0xff);
445 		return;
446 
447 		case 0x700:
448 		case 0x704:
449 			BurnYM2151Write((address / 2) & 1, data & 0xff);
450 		return;
451 	}
452 }
453 
worldadv_io_read(UINT32 address)454 static UINT32 worldadv_io_read(UINT32 address)
455 {
456 	switch (address)
457 	{
458 		case 0x280:
459 			return DrvInputs[0];
460 
461 		case 0x340:
462 			return DrvInputs[1];
463 
464 		case 0x640:
465 			return MSM6295Read(0);
466 
467 		case 0x704:
468 			return BurnYM2151Read();
469 
470 		case 0x780:
471 			return EEPROMRead();
472 	}
473 
474 	return 0;
475 }
476 
boonggab_io_write(UINT32 address,UINT32 data)477 static void boonggab_io_write(UINT32 address, UINT32 data)
478 {
479 	switch (address)
480 	{
481 		case 0x300:
482 			flipscreen = data & 1;
483 		return;
484 
485 		case 0x408:
486 			EEPROMWriteBit(data & 0x01);
487 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
488 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
489 		return;
490 
491 		case 0x410:
492 			// prize
493 		return;
494 
495 		case 0x414:
496 		case 0x418:
497 			// lamps
498 		return;
499 
500 		case 0x600:
501 			set_okibank(data);
502 		return;
503 
504 		case 0x700:
505 			MSM6295Write(0, data & 0xff);
506 		return;
507 
508 		case 0x740:
509 		case 0x744:
510 			BurnYM2151Write((address / 2) & 1, data & 0xff);
511 		return;
512 	}
513 }
514 
boonggab_io_read(UINT32 address)515 static UINT32 boonggab_io_read(UINT32 address)
516 {
517 	switch (address)
518 	{
519 		case 0x0c0:
520 			return EEPROMRead();
521 
522 		case 0x400:
523 			return DrvInputs[1];
524 
525 		case 0x404:
526 			return DrvInputs[0];
527 
528 		case 0x700:
529 			return MSM6295Read(0);
530 
531 		case 0x740:
532 		case 0x744:
533 			return BurnYM2151Read();
534 	}
535 
536 	return 0xffffffff;
537 }
538 
DrvMCUSync()539 static inline void DrvMCUSync()
540 {
541 	INT32 todo = ((double)E132XSTotalCycles() * (24000000/12) / cpu_clock) - mcs51TotalCycles();
542 
543 	if (todo > 0) mcs51Run(todo);
544 }
545 
misncrft_io_write(UINT32 address,UINT32 data)546 static void misncrft_io_write(UINT32 address, UINT32 data)
547 {
548 	switch (address)
549 	{
550 		case 0x100:
551 			flipscreen = data & 1;
552 		return;
553 
554 		case 0x3c0:
555 			EEPROMWriteBit(data & 0x01);
556 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
557 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE );
558 		return;
559 
560 		case 0x400:
561 			DrvMCUSync();
562 			soundlatch = data;
563 			qs1000_set_irq(1);
564 		return;
565 	}
566 }
567 
misncrft_io_read(UINT32 address)568 static UINT32 misncrft_io_read(UINT32 address)
569 {
570 	switch (address)
571 	{
572 		case 0x200:
573 			return DrvInputs[0];
574 
575 		case 0x240:
576 			return DrvInputs[1];
577 
578 		case 0x580:
579 			return EEPROMRead();
580 	}
581 
582 	return 0;
583 }
584 
aoh_io_write(UINT32 address,UINT32 data)585 static void aoh_io_write(UINT32 address, UINT32 data)
586 {
587 	switch (address)
588 	{
589 		case 0x480:
590 			EEPROMWriteBit(data & 0x01);
591 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
592 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
593 		return;
594 
595 		case 0x620:
596 			MSM6295Write(0, (data >> 8) & 0xff);
597 		return;
598 
599 		case 0x660:
600 			MSM6295Write(1, (data >> 8) & 0xff);
601 		return;
602 
603 		case 0x640:
604 		case 0x644:
605 			BurnYM2151Write((address / 4) & 1, (data >> 8) & 0xff);
606 		return;
607 
608 		case 0x680:
609 			set_okibank(data);
610 		return;
611 	}
612 }
613 
aoh_io_read(UINT32 address)614 static UINT32 aoh_io_read(UINT32 address)
615 {
616 	switch (address)
617 	{
618 		case 0x620:
619 			return MSM6295Read(0) << 8;
620 
621 		case 0x660:
622 			return MSM6295Read(1) << 8;
623 
624 		case 0x640:
625 		case 0x644:
626 			return BurnYM2151Read() << 8;
627 	}
628 
629 	return 0;
630 }
631 
wyvernwg_io_write(UINT32 address,UINT32 data)632 static void wyvernwg_io_write(UINT32 address, UINT32 data)
633 {
634 	switch (address)
635 	{
636 		case 0x1800:
637 			protection_which = data & 1;
638 			protection_index = 8;
639 		return;
640 
641 		case 0x2000:
642 			flipscreen = data & 1;
643 		return;
644 
645 		case 0x5400:
646 			DrvMCUSync();
647 			soundlatch = data & 0xff;
648 			qs1000_set_irq(1);
649 		return;
650 
651 		case 0x7000:
652 			EEPROMWriteBit(data & 0x01);
653 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
654 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
655 		return;
656 	}
657 }
658 
wyvernwg_io_read(UINT32 address)659 static UINT32 wyvernwg_io_read(UINT32 address)
660 {
661 	switch (address)
662 	{
663 		case 0x1800:
664 		{
665 			protection_index--;
666 			return (protection_data[protection_which] >> protection_index) & 1;
667 		}
668 
669 		case 0x2800:
670 			return DrvInputs[0];
671 
672 		case 0x3000:
673 			return DrvInputs[1];
674 
675 		case 0x7c00:
676 			return EEPROMRead();
677 	}
678 
679 	return 0;
680 }
681 
mrkickera_io_write(UINT32 address,UINT32 data)682 static void mrkickera_io_write(UINT32 address, UINT32 data)
683 {
684 	switch (address)
685 	{
686 		case 0x4000:
687 			EEPROMWriteBit(data & 0x04000);
688 			EEPROMSetCSLine((~data & 0x01000) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
689 			EEPROMSetClockLine((data & 0x02000) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
690 		return;
691 
692 		case 0x4040:
693 			protection_which = (data == 0x41c6 || data == 0x446b) ? 0 : 1;
694 			protection_index = 8;
695 		return;
696 
697 		case 0x40a0:
698 			set_okibank(data);
699 		return;
700 
701 		case 0x7000:
702 		case 0x7004:
703 			BurnYM2151Write((address / 4) & 1, (data >> 8) & 0xff);
704 		return;
705 
706 		case 0x7400:
707 			MSM6295Write(0, (data >> 8) & 0xff);
708 		return;
709 	}
710 }
711 
mrkickera_io_read(UINT32 address)712 static UINT32 mrkickera_io_read(UINT32 address)
713 {
714 	switch (address)
715 	{
716 		case 0x2400:
717 			return EEPROMRead();
718 
719 		case 0x6400:
720 		{
721 			protection_index--;
722 			return ((protection_data[protection_which] >> protection_index) & 1) ? 0x80008000 : 0;
723 		}
724 
725 		case 0x7000:
726 		case 0x7004:
727 		{
728 			UINT32 ret = BurnYM2151Read();
729 			return ret | (ret << 8) | (ret << 16) | (ret << 24);
730 		}
731 		case 0x7400:
732 		{
733 			UINT32 ret = MSM6295Read(0);
734 			return ret | (ret << 8) | (ret << 16) | (ret << 24);
735 		}
736 
737 		case 0x7800:
738 			return DrvInputs[0];
739 
740 		case 0x7c00:
741 			return DrvInputs[1];
742 	}
743 
744 	return 0;
745 }
746 
finalgdr_io_write(UINT32 address,UINT32 data)747 static void finalgdr_io_write(UINT32 address, UINT32 data)
748 {
749 	if ((address & 0x7e00) == 0x2c00) {
750 		DrvNVRAM[((address / 4) & 0x7f) + (nvram_bank * 0x80)] = data >> 24;
751 		return;
752 	}
753 
754 	switch (address)
755 	{
756 		case 0x2800:
757 			nvram_bank = (data >> 24);
758 		return;
759 
760 		case 0x3000:
761 		case 0x3004:
762 			BurnYM2151Write((address / 4) & 1, (data >> 8) & 0xff);
763 		return;
764 
765 		case 0x3400:
766 			MSM6295Write(0, (data >> 8) & 0xff);
767 		return;
768 
769 		case 0x6000:
770 			EEPROMWriteBit(data & 0x01);
771 			EEPROMSetCSLine((~data & 0x04) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
772 			EEPROMSetClockLine((data & 0x02) ? EEPROM_ASSERT_LINE : EEPROM_CLEAR_LINE);
773 		return;
774 
775 		case 0x6040:
776 			protection_which = (data == 0x41c6 || data == 0x446b) ? 0 : 1;
777 			protection_index = 8;
778 		return;
779 
780 		case 0x6060:
781 			// prize?
782 		return;
783 
784 		case 0x60a0:
785 			set_okibank(data);
786 		return;
787 	}
788 }
789 
finalgdr_io_read(UINT32 address)790 static UINT32 finalgdr_io_read(UINT32 address)
791 {
792 	if ((address & 0x7e00) == 0x2c00) {
793 		return DrvNVRAM[((address / 4) & 0x7f) + (nvram_bank * 0x80)] << 24;
794 	}
795 
796 	switch (address)
797 	{
798 		case 0x2400:
799 		{
800 			protection_index--;
801 			return ((protection_data[protection_which] >> protection_index) & 1) ? 0x80008000 : 0;
802 		}
803 
804 		case 0x3000:
805 		case 0x3004:
806 			return BurnYM2151Read() << 8;
807 
808 		case 0x3400:
809 			return MSM6295Read(0) << 8;
810 
811 		case 0x3800:
812 			return DrvInputs[0];
813 
814 		case 0x3c00:
815 			return DrvInputs[1];
816 
817 		case 0x4400:
818 			return EEPROMRead();
819 	}
820 
821 	return 0;
822 }
823 
do_speedhack(UINT32 address)824 static inline void do_speedhack(UINT32 address)
825 {
826 	if (address == speedhack_address) {
827 		if (E132XSGetPC(0) == speedhack_pc) {
828 			if (E132XSInterruptActive()) {
829 				E132XSRunEndBurnAllCycles();
830 			} else {
831 				E132XSBurnCycles(50);
832 			}
833 		}
834 	}
835 }
836 
common_read_long(UINT32 address)837 static UINT32 common_read_long(UINT32 address)
838 {
839 	if (address < 0x400000) {
840 		speedhack_callback(address);
841 		UINT32 ret = *((UINT32*)(DrvMainRAM + address));
842 		return BURN_ENDIAN_SWAP_INT32((ret << 16) | (ret >> 16));
843 	}
844 
845 	switch (address)	// aoh
846 	{
847 		case 0x80210000:
848 		{
849 			UINT32 ret = DrvInputs[1] & ~0x10;
850 			if (EEPROMRead()) ret |= 0x10;
851 			return ret;
852 		}
853 
854 		case 0x80220000:
855 			return DrvInputs[0];
856 	}
857 
858 	return 0;
859 }
860 
common_read_word(UINT32 address)861 static UINT16 common_read_word(UINT32 address)
862 {
863 	if (address < 0x400000) {
864 		speedhack_callback(address);
865 		return BURN_ENDIAN_SWAP_INT16(*((UINT16*)(DrvMainRAM + address)));
866 	}
867 
868 	switch (address & ~3)	// aoh
869 	{
870 		case 0x80210000:
871 		{
872 			UINT32 ret = DrvInputs[1] & ~0x10;
873 			if (EEPROMRead()) ret |= 0x10;
874 			if (~address & 2) return ret >> 16; // ?
875 			return ret;
876 		}
877 
878 		case 0x80220000:
879 		{
880 			UINT32 ret = DrvInputs[0];
881 			if (~address & 2) return ret >> 16;
882 			return ret;
883 		}
884 
885 	}
886 
887 	return 0;
888 }
889 
common_read_byte(UINT32 address)890 static UINT8 common_read_byte(UINT32 address)
891 {
892 	if (address < 0x400000) {
893 		speedhack_callback(address);
894 		return DrvMainRAM[address^1];
895 	}
896 
897 	return 0;
898 }
899 
qs1000_p1_read()900 static UINT8 qs1000_p1_read()
901 {
902 	return soundlatch & 0xff;
903 }
904 
qs1000_p3_write(UINT8 data)905 static void qs1000_p3_write(UINT8 data)
906 {
907 	if (~data & 0x20) qs1000_set_irq(0);
908 
909 	qs1000_set_bankedrom(DrvQSROM + (data & 7) * 0x7f00);
910 }
911 
DrvDoReset()912 static INT32 DrvDoReset()
913 {
914 	memset (AllRam, 0, RamEnd - AllRam);
915 
916 	E132XSOpen(0);
917 	E132XSReset();
918 	E132XSClose();
919 
920 	switch (sound_type)
921 	{
922 		case 0: // ym2151 + 1x msm
923 		case 1: // ym2151 + 2x msm
924 			MSM6295Reset();
925 			BurnYM2151Reset();
926 			set_okibank(1); // default to first for non-banked games
927 		break;
928 
929 		case 2: // qs1000
930 			qs1000_reset();
931 		break;
932 	}
933 
934 	EEPROMReset();
935 	if (EEPROMAvailable() == 0) {
936 		EEPROMFill(DrvEEPROM, 0, 0x80);
937 	}
938 
939 	soundlatch = 0;
940 	flipscreen = 0;
941 
942 	protection_index = 8;
943 	protection_which = 0;
944 	nvram_bank = 1;
945 
946 	return 0;
947 }
948 
MemIndex()949 static INT32 MemIndex()
950 {
951 	UINT8 *Next; Next = AllMem;
952 
953 	DrvMainROM		= Next; Next += 0x400000;
954 
955 	DrvQSROM		= Next; Next += 0x080000;
956 
957 	DrvGfxROM		= Next; Next += graphics_size;
958 
959 	DrvSndROM[0]	= Next; Next += sound_size[0];
960 	DrvSndROM[1]	= Next; Next += sound_size[1];
961 
962 	BurnPalette		= (UINT32*)Next; Next += 0x8000 * sizeof(UINT32);
963 
964 	DrvNVRAM		= Next; Next += 0x0000080;
965 	DrvEEPROM		= Next; Next += 0x0008000;
966 
967 	AllRam			= Next;
968 
969 	DrvMainRAM		= Next; Next += 0x4000000;
970 	BurnPalRAM		= Next; Next += 0x0100000;
971 	DrvTileRAM		= Next; Next += 0x0400000;
972 
973 	RamEnd			= Next;
974 
975 	MemEnd			= Next;
976 
977 	return 0;
978 }
979 
DrvLoadRoms(bool bLoad)980 static INT32 DrvLoadRoms(bool bLoad)
981 {
982 	char* pRomName;
983 	struct BurnRomInfo ri;
984 	UINT8 *gLoad = DrvGfxROM;
985 	UINT8 *qLoad = DrvQSROM;
986 	UINT8 *sLoad[2] = { DrvSndROM[0], DrvSndROM[1] };
987 
988 	for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++)
989 	{
990 		BurnDrvGetRomInfo(&ri, i);
991 
992 		if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 1) {
993 			if (bLoad) {
994 				memmove (DrvMainROM, DrvMainROM + ri.nLen, 0x400000 - ri.nLen);
995 				if (BurnLoadRom(DrvMainROM + 0x400000 - ri.nLen, i, 1)) return 1;
996 			}
997 			continue;
998 		}
999 
1000 		if ((ri.nType & BRF_GRA) && (ri.nType & 0x0f) == 2) {
1001 			if (bLoad) {
1002 				if (BurnLoadRomExt(gLoad + 0, i + 0, 4, LD_GROUP(2))) return 1;
1003 				if (BurnLoadRomExt(gLoad + 2, i + 1, 4, LD_GROUP(2))) return 1;
1004 			}
1005 			gLoad += ri.nLen * 2;
1006 			i++;
1007 			continue;
1008 		}
1009 
1010 		if ((ri.nType & BRF_SND) && ((ri.nType & 0x0f) == 3 || (ri.nType & 0x0f) == 6)) {
1011 			if (bLoad) {
1012 				if (BurnLoadRom(sLoad[0], i, 1)) return 1;
1013 			}
1014 			sLoad[0] += ((ri.nType & 0x0f) == 6) ? 0x200000 : ri.nLen;
1015 			continue;
1016 		}
1017 
1018 		if ((ri.nType & BRF_SND) && (ri.nType & 0x0f) == 4) {
1019 			if (bLoad) {
1020 				if (BurnLoadRom(sLoad[1], i, 1)) return 1;
1021 			}
1022 			sLoad[1] += ri.nLen;
1023 			continue;
1024 		}
1025 
1026 		if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 8) {
1027 			if (bLoad) {
1028 				if (BurnLoadRom(qLoad, i, 1)) return 1;
1029 			}
1030 			qLoad += ri.nLen;
1031 			continue;
1032 		}
1033 
1034 		if ((ri.nType & BRF_PRG) && (ri.nType & 0x0f) == 9) {
1035 			if (bLoad) {
1036 				if (BurnLoadRom(DrvEEPROM, i, 1)) return 1;
1037 			}
1038 			continue;
1039 		}
1040 	}
1041 
1042 	if (!bLoad) {
1043 		graphics_size = gLoad - DrvGfxROM;
1044 		sound_size[0] = sLoad[0] - DrvSndROM[0];
1045 		sound_size[1] = sLoad[1] - DrvSndROM[1];
1046 	} else {
1047 		INT32 qlen = qLoad - DrvQSROM;
1048 		if (qlen > 0) {
1049 			for (INT32 i = qlen; i < 0x80000; i+=qlen, qLoad += qlen) {
1050 				memcpy (qLoad, DrvQSROM, qlen);
1051 			}
1052 		}
1053 	}
1054 
1055 	return 0;
1056 }
1057 
sound_type_0_init()1058 static void sound_type_0_init()
1059 {
1060 	BurnYM2151Init(3500000);
1061 	BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 0.45, BURN_SND_ROUTE_LEFT);
1062 	BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 0.45, BURN_SND_ROUTE_RIGHT);
1063 
1064 	MSM6295Init(0, 1750000 / MSM6295_PIN7_HIGH, 1);
1065 	MSM6295SetBank(0, DrvSndROM[0], 0x00000, 0x3ffff);
1066 	MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
1067 
1068 	sound_type = 0;
1069 }
1070 
sound_type_1_init()1071 static void sound_type_1_init() // aoh
1072 {
1073 	BurnYM2151Init(3579545);
1074 	BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT);
1075 	BurnYM2151SetRoute(BURN_SND_YM2151_YM2151_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT);
1076 
1077 	MSM6295Init(0, 1000000 / MSM6295_PIN7_HIGH, 1);
1078 	MSM6295Init(1, 4000000 / MSM6295_PIN7_HIGH, 1);
1079 	MSM6295SetBank(0, DrvSndROM[0], 0x00000, 0x3ffff);
1080 	MSM6295SetBank(1, DrvSndROM[1], 0x00000, 0x3ffff);
1081 	MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
1082 	MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH);
1083 
1084 	sound_type = 1;
1085 }
1086 
sound_type_2_init()1087 static void sound_type_2_init()
1088 {
1089 	qs1000_init(DrvQSROM, DrvSndROM[0], sound_size[0]);
1090 	qs1000_set_write_handler(3, qs1000_p3_write);
1091 	qs1000_set_read_handler(1, qs1000_p1_read);
1092 	qs1000_set_volume(4.00);
1093 	sound_type = 2;
1094 }
1095 
CommonInit(INT32 cputype,void (* io_write)(UINT32,UINT32),UINT32 (* io_read)(UINT32),void (* sound_init)(),INT32 palbit,INT32 gfx_size_override)1096 static INT32 CommonInit(INT32 cputype, void (*io_write)(UINT32,UINT32), UINT32 (*io_read)(UINT32), void (*sound_init)(), INT32 palbit, INT32 gfx_size_override)
1097 {
1098 	DrvLoadRoms(false);
1099 
1100 	if (gfx_size_override > 0) graphics_size = gfx_size_override;
1101 
1102 	BurnAllocMemIndex();
1103 
1104 	if (DrvLoadRoms(true)) return 1;
1105 
1106 	if (sound_init != sound_type_1_init) { // not aoh
1107 		BurnByteswap(DrvMainROM, 0x400000);
1108 		speedhack_callback = do_speedhack;
1109 	}
1110 
1111 	E132XSInit(0, cputype, cpu_clock);
1112 	E132XSOpen(0);
1113 	E132XSMapMemory(DrvMainRAM,			0x00000000, 0x003fffff, MAP_RAM); // 2x for AOH
1114 	E132XSMapMemory(DrvTileRAM,			0x40000000, 0x4003ffff, MAP_RAM);
1115 	E132XSMapMemory(BurnPalRAM,			0x80000000, 0x8000ffff, MAP_RAM);
1116 	E132XSMapMemory(DrvMainROM,			0xffc00000, 0xffffffff, MAP_ROM); // variable-sized!
1117 	E132XSSetReadLongHandler(common_read_long);
1118 	E132XSSetReadWordHandler(common_read_word);
1119 	E132XSSetReadByteHandler(common_read_byte);
1120 	E132XSSetIOWriteHandler(io_write);
1121 	E132XSSetIOReadHandler(io_read);
1122 
1123 	if (speedhack_pc != 0)
1124 	{
1125 		E132XSMapMemory(NULL,			speedhack_address & ~0xfff, speedhack_address | 0xfff, MAP_READ);
1126 	}
1127 
1128 	E132XSClose();
1129 
1130 	EEPROMInit(&eeprom_interface_93C46);
1131 	EEPROMIgnoreErrMessage(1);
1132 
1133 	sound_init();
1134 
1135 	GenericTilesInit();
1136 	GenericTilemapSetGfx(0, DrvGfxROM, 8, 16, 16, graphics_size, 0, 0x7f);
1137 
1138 	palette_bit = palbit;
1139 
1140 	DrvDoReset();
1141 
1142 	return 0;
1143 }
1144 
DrvExit()1145 static INT32 DrvExit()
1146 {
1147 	GenericTilesExit();
1148 
1149 	switch (sound_type)
1150 	{
1151 		case 0:
1152 		case 1:
1153 			BurnYM2151Exit();
1154 			MSM6295Exit();
1155 		break;
1156 
1157 		case 2:
1158 			qs1000_exit();
1159 		break;
1160 	}
1161 
1162 	E132XSExit();
1163 	EEPROMExit();
1164 
1165 	BurnFreeMemIndex();
1166 
1167 	MSM6295ROM = NULL;
1168 	speedhack_address = ~0;
1169 	speedhack_pc = 0;
1170 	cpu_clock = 50000000;
1171 
1172 	is_boongga = 0;
1173 
1174 	return 0;
1175 }
1176 
draw_sprites()1177 static void draw_sprites()
1178 {
1179 	UINT16 *ram = (UINT16*)DrvTileRAM;
1180 
1181 	for (INT32 y = (16 & ~15); y <= ((256 - 1) | 15); y += 16)
1182 	{
1183 		GenericTilesSetClip(-1, -1, y-16, y+15+1-16); // +1 ?
1184 
1185 		INT32 block = (flipscreen ? (y / 16) : (16 - (y / 16))) * 0x800;
1186 
1187 		for (INT32 cnt = 0; cnt < 0x800; cnt += 8)
1188 		{
1189 			INT32 offs = (block + cnt) / 2;
1190 
1191 			if (BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x0100) continue;
1192 
1193 			INT32 code  = BURN_ENDIAN_SWAP_INT16(ram[offs+1]) | ((BURN_ENDIAN_SWAP_INT16(ram[offs+2]) & 0x100) << 8);
1194 			INT32 color = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) >> palette_bit;
1195 			INT32 sx    = BURN_ENDIAN_SWAP_INT16(ram[offs+3]) & 0x01ff;
1196 			INT32 sy 	= 256 - (BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x00ff);
1197 			INT32 flipx = BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x8000;
1198 			INT32 flipy = BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x4000;
1199 
1200 			if (flipscreen)
1201 			{
1202 				flipx = !flipx;
1203 				flipy = !flipy;
1204 				sx = 366 - sx;
1205 				sy = 256 - sy;
1206 			}
1207 
1208 			DrawGfxMaskTile(0, 0, code, sx - 31, sy-16, flipx, flipy, color, 0);
1209 		}
1210 	}
1211 }
1212 
aoh_draw_sprites()1213 static void aoh_draw_sprites()
1214 {
1215 	UINT16 *ram = (UINT16*)DrvTileRAM;
1216 
1217 	for (INT32 y = (16 & ~15); y <= ((240 - 1) | 15); y += 16)
1218 	{
1219 		GenericTilesSetClip(-1, -1, y-16, y+15+1-16); // +1 ?
1220 
1221 		INT32 block = (flipscreen ? (y / 16) : (16 - (y / 16))) * 0x800;
1222 
1223 		for (INT32 cnt = 0; cnt < 0x800; cnt += 8)
1224 		{
1225 			INT32 offs = (block + cnt) / 2;
1226 
1227 			INT32 code  = BURN_ENDIAN_SWAP_INT16(ram[offs+1]) | ((BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x300) << 8);
1228 			INT32 color = BURN_ENDIAN_SWAP_INT16(ram[offs+2]) >> palette_bit;
1229 			INT32 sx    = BURN_ENDIAN_SWAP_INT16(ram[offs+3]) & 0x01ff;
1230 			INT32 sy 	= 256 - (BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x00ff);
1231 			INT32 flipx = BURN_ENDIAN_SWAP_INT16(ram[offs]) & 0x0400;
1232 			INT32 flipy = 0;
1233 
1234 			if (flipscreen)
1235 			{
1236 				flipx = !flipx;
1237 				flipy = !flipy;
1238 				sx = 366 - sx;
1239 				sy = 256 - sy;
1240 			}
1241 
1242 			DrawGfxMaskTile(0, 0, code, sx - 64, sy-16, flipx, flipy, color, 0);
1243 		}
1244 	}
1245 }
1246 
DrvDraw()1247 static INT32 DrvDraw()
1248 {
1249 	if (DrvRecalc) {
1250 		BurnPaletteUpdate_xRRRRRGGGGGBBBBB();
1251 		DrvRecalc = 1; // force update
1252 	}
1253 
1254 	BurnTransferClear();
1255 
1256 	draw_sprites();
1257 
1258 	BurnTransferCopy(BurnPalette);
1259 
1260 	return 0;
1261 }
1262 
AohDraw()1263 static INT32 AohDraw()
1264 {
1265 	if (DrvRecalc) {
1266 		BurnPaletteUpdate_xRRRRRGGGGGBBBBB();
1267 		DrvRecalc = 1; // force update
1268 	}
1269 
1270 	BurnTransferClear();
1271 
1272 	aoh_draw_sprites();
1273 
1274 	BurnTransferCopy(BurnPalette);
1275 
1276 	return 0;
1277 }
1278 
DrvFrame()1279 static INT32 DrvFrame()
1280 {
1281 	if (DrvReset) {
1282 		DrvDoReset();
1283 	}
1284 
1285 	{
1286 		memset (DrvInputs, 0xff, sizeof(DrvInputs));
1287 
1288 		DrvInputs[2] = 0x00;
1289 
1290 		for (INT32 i = 0; i < 32; i++) {
1291 			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
1292 			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
1293 			if (DrvJoy3[i]) DrvInputs[2] = i+1; // 1 - 7
1294 		}
1295 
1296 		if (is_boongga) {
1297 			PaddleVal = ProcessAnalog(DrvPaddle, 0, INPUT_DEADZONE | INPUT_LINEAR, 0, 8);
1298 			if (PaddleVal == 0) {
1299 				PaddleVal = DrvInputs[2]; // maybe digital?
1300 			}
1301 			PaddleVal = 7 - PaddleVal;
1302 			DrvInputs[0] &= ~0x3f00;
1303 			DrvInputs[0] |= ((PaddleVal << 3) & 0x3f) << 8;
1304 		}
1305 	}
1306 
1307 	E132XSNewFrame();
1308 	if (sound_type == 2) mcs51NewFrame();
1309 
1310 	INT32 nSegment;
1311 	INT32 nInterleave = 10;
1312 	INT32 nSoundBufferPos = 0;
1313 	INT32 nCyclesTotal[2] = { cpu_clock / 59, 24000000 / 12 / 59 };
1314 	INT32 nCyclesDone[2] = { 0, 0 };
1315 
1316 	E132XSOpen(0);
1317 	if (sound_type == 2) mcs51Open(0);
1318 
1319 	for (INT32 i = 0; i < nInterleave; i++)
1320 	{
1321 		CPU_RUN(0, E132XS);
1322 
1323 		switch (sound_type)
1324 		{
1325 			case 0:
1326 			case 1:
1327 				if (pBurnSoundOut) {
1328 					nSegment = nBurnSoundLen / nInterleave;
1329 					BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment);
1330 					nSoundBufferPos += nSegment;
1331 				}
1332 			break;
1333 
1334 			case 2:
1335 				CPU_RUN_SYNCINT(1, mcs51); // syncs to mcs51TotalCycles
1336 			break;
1337 		}
1338 	}
1339 
1340 	E132XSSetIRQLine(1, CPU_IRQSTATUS_HOLD);
1341 
1342 	if (pBurnSoundOut)
1343 	{
1344 		switch (sound_type)
1345 		{
1346 			case 0:
1347 			case 1:
1348 				nSegment = nBurnSoundLen - nSoundBufferPos;
1349 				if (nSegment > 0) {
1350 					BurnYM2151Render(pBurnSoundOut + (nSoundBufferPos << 1), nSegment);
1351 				}
1352 				MSM6295Render(pBurnSoundOut, nBurnSoundLen);
1353 			break;
1354 
1355 			case 2:
1356 				if (pBurnSoundOut) {
1357 					qs1000_update(pBurnSoundOut, nBurnSoundLen);
1358 				}
1359 			break;
1360 		}
1361 	}
1362 
1363 	if (sound_type == 2) mcs51Close();
1364 	E132XSClose();
1365 
1366 	if (pBurnDraw) {
1367 		BurnDrvRedraw();
1368 	}
1369 
1370 	return 0;
1371 }
1372 
DrvScan(INT32 nAction,INT32 * pnMin)1373 static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
1374 {
1375 	struct BurnArea ba;
1376 
1377 	if (pnMin != NULL) {
1378 		*pnMin = 0x029698;
1379 	}
1380 
1381 	if (nAction & ACB_MEMORY_RAM) {
1382 		memset(&ba, 0, sizeof(ba));
1383 		ba.Data	  = AllRam;
1384 		ba.nLen	  = RamEnd-AllRam;
1385 		ba.szName = "All Ram";
1386 		BurnAcb(&ba);
1387 	}
1388 
1389 	if (nAction & ACB_DRIVER_DATA) {
1390 		E132XSScan(nAction);
1391 
1392 		switch (sound_type)
1393 		{
1394 			case 0:
1395 			case 1:
1396 				BurnYM2151Scan(nAction, pnMin);
1397 				MSM6295Scan(nAction, pnMin);
1398 				SCAN_VAR(okibank);
1399 			break;
1400 
1401 			case 2:
1402 				qs1000_scan(nAction, pnMin);
1403 			break;
1404 		}
1405 		SCAN_VAR(soundlatch);
1406 		SCAN_VAR(flipscreen);
1407 		SCAN_VAR(okibank);
1408 		SCAN_VAR(nvram_bank);
1409 		SCAN_VAR(protection_index);
1410 		SCAN_VAR(protection_which);
1411 	}
1412 
1413 	if (nAction & ACB_WRITE) {
1414 		switch (sound_type)
1415 		{
1416 			case 0:
1417 				set_okibank(okibank);
1418 			break;
1419 		}
1420 	}
1421 
1422 	if (nAction & ACB_NVRAM)
1423 	{
1424 		EEPROMScan(nAction, pnMin);
1425 	}
1426 
1427 	return 0;
1428 }
1429 
1430 
1431 // Cool Minigame Collection
1432 
1433 static struct BurnRomInfo coolminiRomDesc[] = {
1434 	{ "cm-rom1",				0x080000, 0x9688fa98, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1435 	{ "cm-rom2",				0x080000, 0x9d588fef, 1 | BRF_PRG | BRF_ESS }, //  1
1436 
1437 	{ "roml00",					0x200000, 0x4b141f31, 2 | BRF_GRA },           //  2 Sprites
1438 	{ "romu00",					0x200000, 0x9b2fb12a, 2 | BRF_GRA },           //  3
1439 	{ "roml01",					0x200000, 0x1e3a04bb, 2 | BRF_GRA },           //  4
1440 	{ "romu01",					0x200000, 0x06dd1a6c, 2 | BRF_GRA },           //  5
1441 	{ "roml02",					0x200000, 0x1e8c12cb, 2 | BRF_GRA },           //  6
1442 	{ "romu02",					0x200000, 0x4551d4fc, 2 | BRF_GRA },           //  7
1443 	{ "roml03",					0x200000, 0x231650bf, 2 | BRF_GRA },           //  8
1444 	{ "romu03",					0x200000, 0x273d5654, 2 | BRF_GRA },           //  9
1445 
1446 	{ "cm-vrom1",				0x040000, 0xfcc28081, 3 | BRF_SND },           // 10 Samples
1447 };
1448 
1449 STD_ROM_PICK(coolmini)
STD_ROM_FN(coolmini)1450 STD_ROM_FN(coolmini)
1451 
1452 static INT32 CoolminiInit()
1453 {
1454 	speedhack_address = 0xd2df8;
1455 	speedhack_pc = 0x75f88;
1456 
1457 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0);
1458 }
1459 
1460 struct BurnDriver BurnDrvCoolmini = {
1461 	"coolmini", NULL, NULL, NULL, "1999",
1462 	"Cool Minigame Collection\0", NULL, "SemiCom", "Miscellaneous",
1463 	NULL, NULL, NULL, NULL,
1464 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0,
1465 	NULL, coolminiRomInfo, coolminiRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1466 	CoolminiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1467 	320, 236, 4, 3
1468 };
1469 
1470 
1471 // Cool Minigame Collection (Italy)
1472 
1473 static struct BurnRomInfo coolminiiRomDesc[] = {
1474 	{ "cm-rom1.040",			0x080000, 0xaa94bb86, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1475 	{ "cm-rom2.040",			0x080000, 0xbe7d02c8, 1 | BRF_PRG | BRF_ESS }, //  1
1476 
1477 	{ "roml00",					0x200000, 0x4b141f31, 2 | BRF_GRA },           //  2 Sprites
1478 	{ "romu00",					0x200000, 0x9b2fb12a, 2 | BRF_GRA },           //  3
1479 	{ "roml01",					0x200000, 0x1e3a04bb, 2 | BRF_GRA },           //  4
1480 	{ "romu01",					0x200000, 0x06dd1a6c, 2 | BRF_GRA },           //  5
1481 	{ "roml02",					0x200000, 0x1e8c12cb, 2 | BRF_GRA },           //  6
1482 	{ "romu02",					0x200000, 0x4551d4fc, 2 | BRF_GRA },           //  7
1483 	{ "roml03.l03",				0x200000, 0x30a7fe2f, 2 | BRF_GRA },           //  8
1484 	{ "romu03.u03",				0x200000, 0xeb7c943d, 2 | BRF_GRA },           //  9
1485 
1486 	{ "cm-vrom1",				0x040000, 0xfcc28081, 3 | BRF_SND },           // 10 Samples
1487 };
1488 
1489 STD_ROM_PICK(coolminii)
STD_ROM_FN(coolminii)1490 STD_ROM_FN(coolminii)
1491 
1492 static INT32 CoolminiiInit()
1493 {
1494 	speedhack_address = 0xd30a8;
1495 	speedhack_pc = 0x76024;
1496 
1497 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0);
1498 }
1499 
1500 struct BurnDriver BurnDrvCoolminii = {
1501 	"coolminii", "coolmini", NULL, NULL, "1999",
1502 	"Cool Minigame Collection (Italy)\0", NULL, "SemiCom", "Miscellaneous",
1503 	NULL, NULL, NULL, NULL,
1504 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MINIGAMES, 0,
1505 	NULL, coolminiiRomInfo, coolminiiRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1506 	CoolminiiInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1507 	320, 236, 4, 3
1508 };
1509 
1510 
1511 // Jumping Break (set 1)
1512 /* Released February 1999 */
1513 
1514 static struct BurnRomInfo jmpbreakRomDesc[] = {
1515 	{ "rom1.bin",				0x080000, 0x7e237f7d, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1516 	{ "rom2.bin",				0x080000, 0xc722f7be, 1 | BRF_PRG | BRF_ESS }, //  1
1517 
1518 	{ "roml00.bin",				0x200000, 0x4b99190a, 2 | BRF_GRA },           //  2 Sprites
1519 	{ "romu00.bin",				0x200000, 0xe93762f8, 2 | BRF_GRA },           //  3
1520 	{ "roml01.bin",				0x200000, 0x6796a104, 2 | BRF_GRA },           //  4
1521 	{ "romu01.bin",				0x200000, 0x0cc907c8, 2 | BRF_GRA },           //  5
1522 
1523 	{ "vrom1.bin",				0x040000, 0x1b6e3671, 3 | BRF_SND },           //  6 Samples
1524 };
1525 
1526 STD_ROM_PICK(jmpbreak)
STD_ROM_FN(jmpbreak)1527 STD_ROM_FN(jmpbreak)
1528 
1529 static INT32 JmpbreakInit()
1530 {
1531 	speedhack_address = 0x906f4;
1532 	speedhack_pc = 0x984a;
1533 
1534 	return CommonInit(TYPE_E116T, jmpbreak_io_write, jmpbreak_io_read, sound_type_0_init, 0, 0);
1535 }
1536 
1537 struct BurnDriver BurnDrvJmpbreak = {
1538 	"jmpbreak", NULL, NULL, NULL, "1999",
1539 	"Jumping Break (set 1)\0", NULL, "F2 System", "Miscellaneous",
1540 	NULL, NULL, NULL, NULL,
1541 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0,
1542 	NULL, jmpbreakRomInfo, jmpbreakRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1543 	JmpbreakInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1544 	320, 236, 4, 3
1545 };
1546 
1547 
1548 // Jumping Break (set 2)
1549 // PCB has a New Impeuropex sticker, so sold in the Italian market. There also an hand-written IMP 28.04.99
1550 
1551 static struct BurnRomInfo jmpbreakaRomDesc[] = {
1552 	{ "2.rom1",					0x080000, 0x553af133, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1553 	{ "3.rom2",					0x080000, 0xbd0a5eed, 1 | BRF_PRG | BRF_ESS }, //  1
1554 
1555 	{ "roml00.bin",				0x200000, 0x4b99190a, 2 | BRF_GRA },           //  2 Sprites
1556 	{ "romu00.bin",				0x200000, 0xe93762f8, 2 | BRF_GRA },           //  3
1557 	{ "roml01.bin",				0x200000, 0x6796a104, 2 | BRF_GRA },           //  4
1558 	{ "romu01.bin",				0x200000, 0x0cc907c8, 2 | BRF_GRA },           //  5
1559 
1560 	{ "1.vrom1",				0x040000, 0x1b6e3671, 3 | BRF_SND },           //  6 Samples
1561 
1562 	{ "palce22v10h.gal1",		0x0002dd, 0x0ff86470, 0 | BRF_OPT },		   //  7 PLDs
1563 };
1564 
1565 STD_ROM_PICK(jmpbreaka)
STD_ROM_FN(jmpbreaka)1566 STD_ROM_FN(jmpbreaka)
1567 
1568 static INT32 JmpbreakaInit()
1569 {
1570 	speedhack_address = 0xe1dfc;
1571 	speedhack_pc = 0x909ac;
1572 
1573 	return CommonInit(TYPE_E116T, jmpbreak_io_write, jmpbreak_io_read, sound_type_0_init, 0, 0);
1574 }
1575 
1576 struct BurnDriver BurnDrvJmpbreaka = {
1577 	"jmpbreaka", "jmpbreak", NULL, NULL, "1999",
1578 	"Jumping Break (set 2)\0", NULL, "F2 System", "Miscellaneous",
1579 	NULL, NULL, NULL, NULL,
1580 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0,
1581 	NULL, jmpbreakaRomInfo, jmpbreakaRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1582 	JmpbreakaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1583 	320, 236, 4, 3
1584 };
1585 
1586 
1587 // Poosho Poosho
1588 
1589 static struct BurnRomInfo pooshoRomDesc[] = {
1590 	{ "rom1.bin",				0x080000, 0x2072c120, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1591 	{ "rom2.bin",				0x080000, 0x80e70d7a, 1 | BRF_PRG | BRF_ESS }, //  1
1592 
1593 	{ "roml00.bin",				0x200000, 0x9efb0673, 2 | BRF_GRA },           //  2 Sprites
1594 	{ "romu00.bin",				0x200000, 0xfe1d6a02, 2 | BRF_GRA },           //  3
1595 	{ "roml01.bin",				0x200000, 0x05e81ca0, 2 | BRF_GRA },           //  4
1596 	{ "romu01.bin",				0x200000, 0xfd2d02c7, 2 | BRF_GRA },           //  5
1597 
1598 	{ "vrom1.bin",				0x040000, 0x1b6e3671, 3 | BRF_SND },           //  6 Samples
1599 
1600 	{ "gal1.bin",				0x0002e5, 0x90352c93, 0 | BRF_OPT },           //  7 PLDs
1601 };
1602 
1603 STD_ROM_PICK(poosho)
STD_ROM_FN(poosho)1604 STD_ROM_FN(poosho)
1605 
1606 static INT32 PooshoInit()
1607 {
1608 	speedhack_address = 0xc8b58;
1609 	speedhack_pc = 0xa8c78;
1610 
1611 	return CommonInit(TYPE_E116T, jmpbreak_io_write, jmpbreak_io_read, sound_type_0_init, 0, 0);
1612 }
1613 
1614 struct BurnDriver BurnDrvPoosho = {
1615 	"poosho", NULL, NULL, NULL, "1999",
1616 	"Poosho Poosho\0", NULL, "F2 System", "Miscellaneous",
1617 	NULL, NULL, NULL, NULL,
1618 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_BREAKOUT, 0,
1619 	NULL, pooshoRomInfo, pooshoRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1620 	PooshoInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1621 	320, 236, 4, 3
1622 };
1623 
1624 
1625 // New Cross Pang
1626 
1627 static struct BurnRomInfo newxpangRomDesc[] = {
1628 	{ "rom2.bin",				0x080000, 0x6d69c799, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1629 
1630 	{ "roml00.bin",				0x200000, 0x4f8253d3, 2 | BRF_GRA },           //  1 Sprites
1631 	{ "romu00.bin",				0x200000, 0x0ac8f8e4, 2 | BRF_GRA },           //  2
1632 	{ "roml01.bin",				0x200000, 0x66e6e05e, 2 | BRF_GRA },           //  3
1633 	{ "romu01.bin",				0x200000, 0x73907b33, 2 | BRF_GRA },           //  4
1634 
1635 	{ "vrom1.bin",				0x040000, 0x0f339d68, 3 | BRF_SND },           //  5 Samples
1636 };
1637 
1638 STD_ROM_PICK(newxpang)
STD_ROM_FN(newxpang)1639 STD_ROM_FN(newxpang)
1640 
1641 static INT32 NewxpangInit()
1642 {
1643 	speedhack_address = 0x61218;
1644 	speedhack_pc = 0x8b8e;
1645 
1646 	return CommonInit(TYPE_E116T, mrdig_io_write, mrdig_io_read, sound_type_0_init, 0, 0);
1647 }
1648 
1649 struct BurnDriver BurnDrvNewxpang = {
1650 	"newxpang", NULL, NULL, NULL, "1999",
1651 	"New Cross Pang\0", NULL, "F2 System", "Miscellaneous",
1652 	NULL, NULL, NULL, NULL,
1653 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1654 	NULL, newxpangRomInfo, newxpangRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1655 	NewxpangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1656 	320, 236, 4, 3
1657 };
1658 
1659 
1660 // World Adventure
1661 
1662 static struct BurnRomInfo worldadvRomDesc[] = {
1663 	{ "rom1.bin",				0x080000, 0x1855c235, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1664 	{ "rom2.bin",				0x080000, 0x671ddbb0, 1 | BRF_PRG | BRF_ESS }, //  1
1665 
1666 	{ "roml00.bin",				0x200000, 0xfe422890, 2 | BRF_GRA },           //  2 Sprites
1667 	{ "romu00.bin",				0x200000, 0xdd1066f5, 2 | BRF_GRA },           //  3
1668 	{ "roml01.bin",				0x200000, 0x9ab76649, 2 | BRF_GRA },           //  4
1669 	{ "romu01.bin",				0x200000, 0x62132228, 2 | BRF_GRA },           //  5
1670 
1671 	{ "vrom1.bin",				0x040000, 0xc87cce3b, 3 | BRF_SND },           //  6 Samples
1672 };
1673 
1674 STD_ROM_PICK(worldadv)
STD_ROM_FN(worldadv)1675 STD_ROM_FN(worldadv)
1676 
1677 static INT32 WorldadvInit()
1678 {
1679 	speedhack_address = 0xc5e78;
1680 	speedhack_pc = 0x93ae;
1681 
1682 	return CommonInit(TYPE_E116T, worldadv_io_write, worldadv_io_read, sound_type_0_init, 0, 0);
1683 }
1684 
1685 struct BurnDriver BurnDrvWorldadv = {
1686 	"worldadv", NULL, NULL, NULL, "1999",
1687 	"World Adventure\0", NULL, "Logic / F2 System", "Miscellaneous",
1688 	NULL, NULL, NULL, NULL,
1689 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAHJONG, 0,
1690 	NULL, worldadvRomInfo, worldadvRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1691 	WorldadvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1692 	320, 236, 4, 3
1693 };
1694 
1695 
1696 // Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)
1697 
1698 static struct BurnRomInfo suplupRomDesc[] = {
1699 	{ "suplup-rom1.bin",		0x080000, 0x61fb2dbe, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1700 	{ "suplup-rom2.bin",		0x080000, 0x0c176c57, 1 | BRF_PRG | BRF_ESS }, //  1
1701 
1702 	{ "suplup-roml00.bin",		0x200000, 0x7848e183, 2 | BRF_GRA },           //  2 Sprites
1703 	{ "suplup-romu00.bin",		0x200000, 0x13e3ab7f, 2 | BRF_GRA },           //  3
1704 	{ "suplup-roml01.bin",		0x200000, 0x15769f55, 2 | BRF_GRA },           //  4
1705 	{ "suplup-romu01.bin",		0x200000, 0x6687bc6f, 2 | BRF_GRA },           //  5
1706 
1707 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1708 
1709 	{ "eeprom-suplup.bin",		0x000080, 0xe60c9883, 9 | BRF_PRG | BRF_ESS }, //  7 Default EEPROM
1710 };
1711 
1712 STD_ROM_PICK(suplup)
STD_ROM_FN(suplup)1713 STD_ROM_FN(suplup)
1714 
1715 static INT32 SuplupInit()
1716 {
1717 	speedhack_address = 0x11605c;
1718 	speedhack_pc = 0xaf184;
1719 
1720 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1721 }
1722 
1723 struct BurnDriver BurnDrvSuplup = {
1724 	"suplup", NULL, NULL, NULL, "1999",
1725 	"Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)\0", NULL, "Omega System", "Miscellaneous",
1726 	NULL, NULL, NULL, NULL,
1727 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1728 	NULL, suplupRomInfo, suplupRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1729 	SuplupInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1730 	320, 236, 4, 3
1731 };
1732 
1733 
1734 // Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)
1735 
1736 static struct BurnRomInfo luplupRomDesc[] = {
1737 	{ "luplup-rom1.v30",		0x080000, 0x9ea67f87, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1738 	{ "luplup-rom2.v30",		0x080000, 0x99840155, 1 | BRF_PRG | BRF_ESS }, //  1
1739 
1740 	{ "luplup-roml00",			0x200000, 0x08b2aa75, 2 | BRF_GRA },           //  2 Sprites
1741 	{ "luplup-romu00",			0x200000, 0xb57f4ca5, 2 | BRF_GRA },           //  3
1742 	{ "luplup30-roml01",		0x200000, 0x40e85f94, 2 | BRF_GRA },           //  4
1743 	{ "luplup30-romu01",		0x200000, 0xf2645b78, 2 | BRF_GRA },           //  5
1744 
1745 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1746 
1747 	{ "gal22v10b.gal1",			0x0002e5, 0x00000000, 0 | BRF_NODUMP | BRF_OPT },           //  7 PLDs
1748 };
1749 
1750 STD_ROM_PICK(luplup)
STD_ROM_FN(luplup)1751 STD_ROM_FN(luplup)
1752 
1753 static INT32 LuplupInit()
1754 {
1755 	speedhack_address = 0x115e84;
1756 	speedhack_pc = 0xaefac;
1757 
1758 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1759 }
1760 
1761 struct BurnDriver BurnDrvLuplup = {
1762 	"luplup", "suplup", NULL, NULL, "1999",
1763 	"Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)\0", NULL, "Omega System", "Miscellaneous",
1764 	NULL, NULL, NULL, NULL,
1765 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1766 	NULL, luplupRomInfo, luplupRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1767 	LuplupInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1768 	320, 236, 4, 3
1769 };
1770 
1771 
1772 // Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 2.9 / 990108)
1773 
1774 static struct BurnRomInfo luplup29RomDesc[] = {
1775 	{ "luplup-rom1.v29",		0x080000, 0x36a8b8c1, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1776 	{ "luplup-rom2.v29",		0x080000, 0x50dac70f, 1 | BRF_PRG | BRF_ESS }, //  1
1777 
1778 	{ "luplup-roml00",			0x200000, 0x08b2aa75, 2 | BRF_GRA },           //  2 Sprites
1779 	{ "luplup-romu00",			0x200000, 0xb57f4ca5, 2 | BRF_GRA },           //  3
1780 	{ "luplup-roml01",			0x200000, 0x41c7ca8c, 2 | BRF_GRA },           //  4
1781 	{ "luplup-romu01",			0x200000, 0x16746158, 2 | BRF_GRA },           //  5
1782 
1783 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1784 };
1785 
1786 STD_ROM_PICK(luplup29)
STD_ROM_FN(luplup29)1787 STD_ROM_FN(luplup29)
1788 
1789 static INT32 Luplup29Init()
1790 {
1791 	speedhack_address = 0x113f08;
1792 	speedhack_pc = 0xae6c0;
1793 
1794 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1795 }
1796 
1797 struct BurnDriver BurnDrvLuplup29 = {
1798 	"luplup29", "suplup", NULL, NULL, "1999",
1799 	"Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 2.9 / 990108)\0", NULL, "Omega System", "Miscellaneous",
1800 	NULL, NULL, NULL, NULL,
1801 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1802 	NULL, luplup29RomInfo, luplup29RomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1803 	Luplup29Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1804 	320, 236, 4, 3
1805 };
1806 
1807 
1808 // Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 1.05 / 981214)
1809 
1810 static struct BurnRomInfo luplup10RomDesc[] = {
1811 	{ "p0_rom1.rom1",			0x080000, 0xa2684e3c, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1812 	{ "p1_rom2.rom2",			0x080000, 0x1043ce44, 1 | BRF_PRG | BRF_ESS }, //  1
1813 
1814 	{ "roml00.roml00",			0x200000, 0xe2eeb61e, 2 | BRF_GRA },           //  2 Sprites
1815 	{ "romu00.romu00",			0x200000, 0x9ee855b9, 2 | BRF_GRA },           //  3
1816 	{ "roml01.roml01",			0x200000, 0x7182864c, 2 | BRF_GRA },           //  4
1817 	{ "romu01.romu01",			0x200000, 0x44f76640, 2 | BRF_GRA },           //  5
1818 
1819 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1820 
1821 	{ "gal22v10b.gal1",			0x0002e5, 0x776c5137, 0 | BRF_OPT },           //  7 PLDs
1822 };
1823 
1824 STD_ROM_PICK(luplup10)
STD_ROM_FN(luplup10)1825 STD_ROM_FN(luplup10)
1826 
1827 static INT32 Luplup10Init()
1828 {
1829 	speedhack_address = 0x113b78;
1830 	speedhack_pc = 0xb1128;
1831 
1832 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1833 }
1834 
1835 struct BurnDriver BurnDrvLuplup10 = {
1836 	"luplup10", "suplup", NULL, NULL, "1999",
1837 	"Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 1.05 / 981214)\0", NULL, "Omega System (Adko license)", "Miscellaneous",
1838 	NULL, NULL, NULL, NULL,
1839 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1840 	NULL, luplup10RomInfo, luplup10RomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1841 	Luplup10Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1842 	320, 236, 4, 3
1843 };
1844 
1845 
1846 // Puzzle Bang Bang (Korea, version 2.9 / 990108)
1847 
1848 static struct BurnRomInfo puzlbangRomDesc[] = {
1849 	{ "pbb-rom1.v29",			0x080000, 0xeb829586, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1850 	{ "pbb-rom2.v29",			0x080000, 0xfb84c793, 1 | BRF_PRG | BRF_ESS }, //  1
1851 
1852 	{ "luplup-roml00",			0x200000, 0x08b2aa75, 2 | BRF_GRA },           //  2 Sprites
1853 	{ "luplup-romu00",			0x200000, 0xb57f4ca5, 2 | BRF_GRA },           //  3
1854 	{ "luplup-roml01",			0x200000, 0x41c7ca8c, 2 | BRF_GRA },           //  4
1855 	{ "luplup-romu01",			0x200000, 0x16746158, 2 | BRF_GRA },           //  5
1856 
1857 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1858 };
1859 
1860 STD_ROM_PICK(puzlbang)
STD_ROM_FN(puzlbang)1861 STD_ROM_FN(puzlbang)
1862 
1863 static INT32 PuzlbangInit()
1864 {
1865 	speedhack_address = 0x113f14;
1866 	speedhack_pc = 0xae6cc;
1867 
1868 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1869 }
1870 
1871 struct BurnDriver BurnDrvPuzlbang = {
1872 	"puzlbang", "suplup", NULL, NULL, "1999",
1873 	"Puzzle Bang Bang (Korea, version 2.9 / 990108)\0", NULL, "Omega System", "Miscellaneous",
1874 	NULL, NULL, NULL, NULL,
1875 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1876 	NULL, puzlbangRomInfo, puzlbangRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1877 	PuzlbangInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1878 	320, 236, 4, 3
1879 };
1880 
1881 
1882 // Puzzle Bang Bang (Korea, version 2.8 / 990106)
1883 
1884 static struct BurnRomInfo puzlbangaRomDesc[] = {
1885 	{ "pbb-rom1.v28",			0x080000, 0xfd21c5ff, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1886 	{ "pbb-rom2.v28",			0x080000, 0x490ecaeb, 1 | BRF_PRG | BRF_ESS }, //  1
1887 
1888 	{ "luplup-roml00",			0x200000, 0x08b2aa75, 2 | BRF_GRA },           //  2 Sprites
1889 	{ "luplup-romu00",			0x200000, 0xb57f4ca5, 2 | BRF_GRA },           //  3
1890 	{ "luplup-roml01",			0x200000, 0x41c7ca8c, 2 | BRF_GRA },           //  4
1891 	{ "luplup-romu01",			0x200000, 0x16746158, 2 | BRF_GRA },           //  5
1892 
1893 	{ "vrom1.bin",				0x040000, 0x34a56987, 3 | BRF_SND },           //  6 Samples
1894 };
1895 
1896 STD_ROM_PICK(puzlbanga)
STD_ROM_FN(puzlbanga)1897 STD_ROM_FN(puzlbanga)
1898 
1899 static INT32 PuzlbangaInit()
1900 {
1901 	speedhack_address = 0x113ecc;
1902 	speedhack_pc = 0xae6cc;
1903 
1904 	return CommonInit(TYPE_E116T, suplup_io_write, suplup_io_read, sound_type_0_init, 8, 0);
1905 }
1906 
1907 struct BurnDriver BurnDrvPuzlbanga = {
1908 	"puzlbanga", "suplup", NULL, NULL, "1999",
1909 	"Puzzle Bang Bang (Korea, version 2.8 / 990106)\0", NULL, "Omega System", "Miscellaneous",
1910 	NULL, NULL, NULL, NULL,
1911 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
1912 	NULL, puzlbangaRomInfo, puzlbangaRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1913 	PuzlbangaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1914 	320, 236, 4, 3
1915 };
1916 
1917 
1918 // Vamf x1/2 (Europe, version 1.1.0908)
1919 
1920 static struct BurnRomInfo vamphalfRomDesc[] = {
1921 	{ "prg.rom1",				0x080000, 0x9b1fc6c5, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1922 
1923 	{ "eur.roml00",				0x200000, 0xbdee9a46, 2 | BRF_GRA },           //  1 Sprites
1924 	{ "eur.romu00",				0x200000, 0xfa79e8ea, 2 | BRF_GRA },           //  2
1925 	{ "eur.roml01",				0x200000, 0xa7995b06, 2 | BRF_GRA },           //  3
1926 	{ "eur.romu01",				0x200000, 0xe269f5fe, 2 | BRF_GRA },           //  4
1927 
1928 	{ "snd.vrom1",				0x040000, 0xee9e371e, 3 | BRF_SND },           //  5 Samples
1929 };
1930 
1931 STD_ROM_PICK(vamphalf)
STD_ROM_FN(vamphalf)1932 STD_ROM_FN(vamphalf)
1933 
1934 static INT32 VamphalfInit()
1935 {
1936 	speedhack_address = 0x4a7b8;
1937 	speedhack_pc = 0x82ec;
1938 
1939 	return CommonInit(TYPE_E116T, vamphalf_io_write, vamphalf_io_read, sound_type_0_init, 0, 0);
1940 }
1941 
1942 struct BurnDriver BurnDrvVamphalf = {
1943 	"vamphalf", NULL, NULL, NULL, "1999",
1944 	"Vamf x1/2 (Europe, version 1.1.0908)\0", NULL, "Danbi / F2 System", "Miscellaneous",
1945 	NULL, NULL, NULL, NULL,
1946 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0,
1947 	NULL, vamphalfRomInfo, vamphalfRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1948 	VamphalfInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1949 	320, 236, 4, 3
1950 };
1951 
1952 
1953 // Vamf x1/2 (Europe, version 1.0.0903)
1954 
1955 static struct BurnRomInfo vamphalfr1RomDesc[] = {
1956 	{ "ws1-01201.rom1",			0x080000, 0xafa75c19, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1957 
1958 	{ "elc.roml01",				0x400000, 0x19df4056, 2 | BRF_GRA },           //  1 Sprites
1959 	{ "evi.romu01",				0x400000, 0xf9803923, 2 | BRF_GRA },           //  2
1960 
1961 	{ "ws1-01202.vrom1",		0x040000, 0xee9e371e, 3 | BRF_SND },           //  3 Samples
1962 };
1963 
1964 STD_ROM_PICK(vamphalfr1)
STD_ROM_FN(vamphalfr1)1965 STD_ROM_FN(vamphalfr1)
1966 
1967 static INT32 Vamphalfr1Init()
1968 {
1969 	speedhack_address = 0x4a468;
1970 	speedhack_pc = 0x82ec;
1971 
1972 	return CommonInit(TYPE_E116T, vamphalf_io_write, vamphalf_io_read, sound_type_0_init, 0, 0);
1973 }
1974 
1975 struct BurnDriver BurnDrvVamphalfr1 = {
1976 	"vamphalfr1", "vamphalf", NULL, NULL, "1999",
1977 	"Vamf x1/2 (Europe, version 1.0.0903)\0", NULL, "Danbi / F2 System", "Miscellaneous",
1978 	NULL, NULL, NULL, NULL,
1979 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0,
1980 	NULL, vamphalfr1RomInfo, vamphalfr1RomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
1981 	Vamphalfr1Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
1982 	320, 236, 4, 3
1983 };
1984 
1985 
1986 // Vamp x1/2 (Korea, version 1.1.0908)
1987 
1988 static struct BurnRomInfo vamphalfkRomDesc[] = {
1989 	{ "prom1",					0x080000, 0xf05e8e96, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
1990 
1991 	{ "roml00",					0x200000, 0xcc075484, 2 | BRF_GRA },           //  1 Sprites
1992 	{ "romu00",					0x200000, 0x711c8e20, 2 | BRF_GRA },           //  2
1993 	{ "roml01",					0x200000, 0x626c9925, 2 | BRF_GRA },           //  3
1994 	{ "romu01",					0x200000, 0xd5be3363, 2 | BRF_GRA },           //  4
1995 
1996 	{ "snd.vrom1",				0x040000, 0xee9e371e, 3 | BRF_SND },           //  5 Samples
1997 };
1998 
1999 STD_ROM_PICK(vamphalfk)
STD_ROM_FN(vamphalfk)2000 STD_ROM_FN(vamphalfk)
2001 
2002 static INT32 VamphalfkInit()
2003 {
2004 	speedhack_address = 0x4a648;
2005 	speedhack_pc = 0x82ec;
2006 
2007 	return CommonInit(TYPE_E116T, vamphalf_io_write, vamphalf_io_read, sound_type_0_init, 0, 0);
2008 }
2009 
2010 struct BurnDriver BurnDrvVamphalfk = {
2011 	"vamphalfk", "vamphalf", NULL, NULL, "1999",
2012 	"Vamp x1/2 (Korea, version 1.1.0908)\0", NULL, "Danbi / F2 System", "Miscellaneous",
2013 	NULL, NULL, NULL, NULL,
2014 	BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0,
2015 	NULL, vamphalfkRomInfo, vamphalfkRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2016 	VamphalfkInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2017 	320, 236, 4, 3
2018 };
2019 
2020 
2021 // Date Quiz Go Go Episode 2
2022 
2023 static struct BurnRomInfo dquizgo2RomDesc[] = {
2024 	{ "rom1",					0x080000, 0x81eef038, 1 | BRF_PRG | BRF_ESS }, //  0 EX116T Code
2025 	{ "rom2",					0x080000, 0xe8789d8a, 1 | BRF_PRG | BRF_ESS }, //  1
2026 
2027 	{ "roml00",					0x200000, 0xde811dd7, 2 | BRF_GRA },           //  2 Sprites
2028 	{ "romu00",					0x200000, 0x2bdbfc6b, 2 | BRF_GRA },           //  3
2029 	{ "roml01",					0x200000, 0xf574a2a3, 2 | BRF_GRA },           //  4
2030 	{ "romu01",					0x200000, 0xd05cf02f, 2 | BRF_GRA },           //  5
2031 	{ "roml02",					0x200000, 0x43ca2cff, 2 | BRF_GRA },           //  6
2032 	{ "romu02",					0x200000, 0xb8218222, 2 | BRF_GRA },           //  7
2033 
2034 	{ "vrom1",					0x040000, 0x24d5b55f, 3 | BRF_SND },           //  8 Samples
2035 };
2036 
2037 STD_ROM_PICK(dquizgo2)
STD_ROM_FN(dquizgo2)2038 STD_ROM_FN(dquizgo2)
2039 
2040 static INT32 Dquizgo2Init()
2041 {
2042 	speedhack_address = 0xcdde8;
2043 	speedhack_pc = 0xaa630;
2044 
2045 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0xc00000);
2046 }
2047 
2048 struct BurnDriver BurnDrvDquizgo2 = {
2049 	"dquizgo2", NULL, NULL, NULL, "2000",
2050 	"Date Quiz Go Go Episode 2\0", NULL, "SemiCom", "Miscellaneous",
2051 	NULL, NULL, NULL, NULL,
2052 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_QUIZ, 0,
2053 	NULL, dquizgo2RomInfo, dquizgo2RomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2054 	Dquizgo2Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2055 	320, 236, 4, 3
2056 };
2057 
2058 
2059 // Mission Craft (version 2.7)
2060 
2061 static struct BurnRomInfo misncrftRomDesc[] = {
2062 	{ "prg-rom2.bin",			0x080000, 0x04d22da6, 1 | BRF_PRG | BRF_ESS }, //  0 GMS30C2116 Code
2063 
2064 	{ "snd-rom2.us1",			0x020000, 0x8821e5b9, 8 | BRF_PRG | BRF_ESS }, //  1 QS1000 Code
2065 
2066 	{ "roml00",					0x200000, 0x748c5ae5, 2 | BRF_GRA },           //  2 Sprites
2067 	{ "romh00",					0x200000, 0xf34ae697, 2 | BRF_GRA },           //  3
2068 	{ "roml01",					0x200000, 0xe37ece7b, 2 | BRF_GRA },           //  4
2069 	{ "romh01",					0x200000, 0x71fe4bc3, 2 | BRF_GRA },           //  5
2070 
2071 	{ "snd-rom1.u15",			0x080000, 0xfb381da9, 6 | BRF_SND },           //  6 qs1000
2072 	{ "qs1001a.u17",			0x080000, 0xd13c6407, 6 | BRF_SND },           //  7
2073 
2074 	{ "93c46-eeprom-misncrft",	0x000080, 0x83c813eb, 9 | BRF_PRG | BRF_ESS }, //  8 Default EEPROM
2075 };
2076 
2077 STD_ROM_PICK(misncrft)
STD_ROM_FN(misncrft)2078 STD_ROM_FN(misncrft)
2079 
2080 static INT32 MisncrftInit()
2081 {
2082 	speedhack_address = 0x741e8;
2083 	speedhack_pc = 0xff5a;
2084 
2085 	INT32 rc = CommonInit(TYPE_GMS30C2116, misncrft_io_write, misncrft_io_read, sound_type_2_init, 0, 0);
2086 	if (!rc) {
2087 		qs1000_set_volume(1.00);
2088 	}
2089 	return rc;
2090 }
2091 
2092 struct BurnDriver BurnDrvMisncrft = {
2093 	"misncrft", NULL, NULL, NULL, "2000",
2094 	"Mission Craft (version 2.7)\0", NULL, "Sun", "Miscellaneous",
2095 	NULL, NULL, NULL, NULL,
2096 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0,
2097 	NULL, misncrftRomInfo, misncrftRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2098 	MisncrftInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2099 	236, 320, 3, 4
2100 };
2101 
2102 
2103 // Mission Craft (version 2.4)
2104 
2105 static struct BurnRomInfo misncrftaRomDesc[] = {
2106 	{ "prg-rom2.bin",			0x080000, 0x059ae8c1, 1 | BRF_PRG | BRF_ESS }, //  0 GMS30C2116 Code
2107 
2108 	{ "snd-rom2.us1",			0x020000, 0x8821e5b9, 8 | BRF_PRG | BRF_ESS }, //  1 QS1000 Code
2109 
2110 	{ "roml00",					0x200000, 0x748c5ae5, 2 | BRF_GRA },           //  2 Sprites
2111 	{ "romh00",					0x200000, 0xf34ae697, 2 | BRF_GRA },           //  3
2112 	{ "roml01",					0x200000, 0xe37ece7b, 2 | BRF_GRA },           //  4
2113 	{ "romh01",					0x200000, 0x71fe4bc3, 2 | BRF_GRA },           //  5
2114 
2115 	{ "snd-rom1.u15",			0x080000, 0xfb381da9, 6 | BRF_SND },           //  6 qs1000
2116 	{ "qs1001a.u17",			0x080000, 0xd13c6407, 6 | BRF_SND },           //  7
2117 
2118 	{ "93c46-eeprom-misncrfta",	0x000080, 0x9ad27077, 9 | BRF_PRG | BRF_ESS }, //  8 Default EEPROM
2119 };
2120 
2121 STD_ROM_PICK(misncrfta)
STD_ROM_FN(misncrfta)2122 STD_ROM_FN(misncrfta)
2123 
2124 static INT32 MisncrftaInit()
2125 {
2126 	speedhack_address = 0x72e2c;
2127 	speedhack_pc = 0xecd6;
2128 
2129 	INT32 rc = CommonInit(TYPE_GMS30C2116, misncrft_io_write, misncrft_io_read, sound_type_2_init, 0, 0);
2130 	if (!rc) {
2131 		qs1000_set_volume(2.00);
2132 	}
2133 	return rc;
2134 }
2135 
2136 struct BurnDriver BurnDrvMisncrfta = {
2137 	"misncrfta", "misncrft", NULL, NULL, "2000",
2138 	"Mission Craft (version 2.4)\0", NULL, "Sun", "Miscellaneous",
2139 	NULL, NULL, NULL, NULL,
2140 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0,
2141 	NULL, misncrftaRomInfo, misncrftaRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2142 	MisncrftaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2143 	236, 320, 3, 4
2144 };
2145 
2146 
2147 // Mr. Dig
2148 
2149 static struct BurnRomInfo mrdigRomDesc[] = {
2150 	{ "rom1.bin",				0x080000, 0x5b960320, 1 | BRF_PRG | BRF_ESS }, //  0 GMS30C2116 Code
2151 	{ "rom2.bin",				0x080000, 0x75d48b64, 1 | BRF_PRG | BRF_ESS }, //  1
2152 
2153 	{ "roml00.bin",				0x200000, 0xf6b161ea, 2 | BRF_GRA },           //  2 Sprites
2154 	{ "romh00.bin",				0x200000, 0x5477efed, 2 | BRF_GRA },           //  3
2155 
2156 	{ "vrom1.bin",				0x040000, 0x5fd9e1c6, 3 | BRF_SND },           //  4 Samples
2157 };
2158 
2159 STD_ROM_PICK(mrdig)
STD_ROM_FN(mrdig)2160 STD_ROM_FN(mrdig)
2161 
2162 static INT32 MrdigInit()
2163 {
2164 	speedhack_address = 0x0e0768;
2165 	speedhack_pc = 0xae38;
2166 
2167 	return CommonInit(TYPE_GMS30C2116, mrdig_io_write, mrdig_io_read, sound_type_0_init, 0, 0x800000);
2168 }
2169 
2170 struct BurnDriver BurnDrvMrdig = {
2171 	"mrdig", NULL, NULL, NULL, "2000",
2172 	"Mr. Dig\0", NULL, "Sun", "Miscellaneous",
2173 	NULL, NULL, NULL, NULL,
2174 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PUZZLE, 0,
2175 	NULL, mrdigRomInfo, mrdigRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2176 	MrdigInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2177 	320, 236, 4, 3
2178 };
2179 
2180 
2181 // Diet Family
2182 
2183 static struct BurnRomInfo dtfamilyRomDesc[] = {
2184 	{ "rom1",					0x080000, 0x738636d2, 1 | BRF_PRG | BRF_ESS }, //  0 E116T Code
2185 	{ "rom2",					0x080000, 0x0953f5e4, 1 | BRF_PRG | BRF_ESS }, //  1
2186 
2187 	{ "roml00",					0x200000, 0x7e2a7520, 2 | BRF_GRA },           //  2 Sprites
2188 	{ "romu00",					0x200000, 0xc170755f, 2 | BRF_GRA },           //  3
2189 	{ "roml01",					0x200000, 0x3d487ffe, 2 | BRF_GRA },           //  4
2190 	{ "romu01",					0x200000, 0x716efedb, 2 | BRF_GRA },           //  5
2191 	{ "roml02",					0x200000, 0xc3dd3c96, 2 | BRF_GRA },           //  6
2192 	{ "romu02",					0x200000, 0x80830961, 2 | BRF_GRA },           //  7
2193 
2194 	{ "vrom1",					0x080000, 0x4aacaef3, 3 | BRF_SND },           //  8 Samples
2195 };
2196 
2197 STD_ROM_PICK(dtfamily)
STD_ROM_FN(dtfamily)2198 STD_ROM_FN(dtfamily)
2199 
2200 static INT32 DtfamilyInit()
2201 {
2202 	speedhack_address = 0xcc2a8;
2203 	speedhack_pc = 0x12fa6;
2204 
2205 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0xc00000);
2206 }
2207 
2208 struct BurnDriver BurnDrvDtfamily = {
2209 	"dtfamily", NULL, NULL, NULL, "2001",
2210 	"Diet Family\0", NULL, "SemiCom", "Miscellaneous",
2211 	NULL, NULL, NULL, NULL,
2212 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2213 	NULL, dtfamilyRomInfo, dtfamilyRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2214 	DtfamilyInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2215 	320, 236, 4, 3
2216 };
2217 
2218 
2219 // Final Godori (Korea, version 2.20.5915)
2220 
2221 static struct BurnRomInfo finalgdrRomDesc[] = {
2222 	{ "rom1",					0x080000, 0x45815931, 1 | BRF_PRG | BRF_ESS }, //  0 E132T Code
2223 
2224 	{ "roml00",					0x200000, 0x8334459d, 2 | BRF_GRA },           //  1 Sprites
2225 	{ "romh00",					0x200000, 0xf28578a5, 2 | BRF_GRA },           //  2
2226 
2227 	{ "u7",						0x080000, 0x080f61f8, 3 | BRF_SND },           //  3 Samples
2228 };
2229 
2230 STD_ROM_PICK(finalgdr)
STD_ROM_FN(finalgdr)2231 STD_ROM_FN(finalgdr)
2232 
2233 static INT32 FinalgdrInit()
2234 {
2235 	speedhack_address = 0x5e870;
2236 	speedhack_pc = 0x1c20c;
2237 
2238 	protection_data[0] = 2;
2239 	protection_data[1] = 3;
2240 
2241 	return CommonInit(TYPE_E132T, finalgdr_io_write, finalgdr_io_read, sound_type_0_init, 0, 0x800000);
2242 }
2243 
2244 struct BurnDriver BurnDrvFinalgdr = {
2245 	"finalgdr", NULL, NULL, NULL, "2001",
2246 	"Final Godori (Korea, version 2.20.5915)\0", NULL, "SemiCom", "Miscellaneous",
2247 	NULL, NULL, NULL, NULL,
2248 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAHJONG, 0,
2249 	NULL, finalgdrRomInfo, finalgdrRomName, NULL, NULL, NULL, NULL, FinalgdrInputInfo, NULL,
2250 	FinalgdrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2251 	320, 236, 4, 3
2252 };
2253 
2254 
2255 // Mr. Kicker (F-E1-16-010 PCB)
2256 
2257 static struct BurnRomInfo mrkickerRomDesc[] = {
2258 	{ "3-semicom.rom2",			0x080000, 0x3f7fa08b, 1 | BRF_PRG | BRF_ESS }, //  0 E116T Code
2259 
2260 	{ "roml00",					0x200000, 0xc677aac3, 2 | BRF_GRA },           //  1 Sprites
2261 	{ "romh00",					0x200000, 0xb6337d4a, 2 | BRF_GRA },           //  2
2262 
2263 	{ "11-semicom.vrom1",		0x080000, 0xe8141fcd, 3 | BRF_SND },           //  3 Samples
2264 };
2265 
2266 STD_ROM_PICK(mrkicker)
STD_ROM_FN(mrkicker)2267 STD_ROM_FN(mrkicker)
2268 
2269 static INT32 MrkickerInit()
2270 {
2271 	speedhack_address = 0x63fc0;
2272 	speedhack_pc = 0x41ec6;
2273 
2274 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0x800000);
2275 }
2276 
2277 struct BurnDriver BurnDrvMrkicker = {
2278 	"mrkicker", NULL, NULL, NULL, "2001",
2279 	"Mr. Kicker (F-E1-16-010 PCB)\0", NULL, "SemiCom", "Miscellaneous",
2280 	NULL, NULL, NULL, NULL,
2281 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0,
2282 	NULL, mrkickerRomInfo, mrkickerRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2283 	MrkickerInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2284 	320, 236, 4, 3
2285 };
2286 
2287 
2288 // Mr. Kicker (SEMICOM-003b PCB)
2289 
2290 static struct BurnRomInfo mrkickeraRomDesc[] = {
2291 	{ "2-semicom.rom1",			0x080000, 0xd3da29ca, 1 | BRF_PRG | BRF_ESS }, //  0 E132T Code
2292 
2293 	{ "roml00",					0x200000, 0xc677aac3, 2 | BRF_GRA },           //  1 Sprites
2294 	{ "romh00",					0x200000, 0xb6337d4a, 2 | BRF_GRA },           //  2
2295 
2296 	{ "at27c040.u7",			0x080000, 0xe8141fcd, 3 | BRF_SND },           //  3 Samples
2297 
2298 	{ "eeprom-mrkicker.bin",	0x000080, 0x87afb8f7, 9 | BRF_PRG | BRF_ESS }, //  4 Default EEPROM
2299 };
2300 
2301 STD_ROM_PICK(mrkickera)
STD_ROM_FN(mrkickera)2302 STD_ROM_FN(mrkickera)
2303 
2304 static INT32 MrkickeraInit()
2305 {
2306 	speedhack_address = 0x701a0;
2307 	speedhack_pc = 0x46a30;
2308 
2309 	protection_data[0] = 2;
2310 	protection_data[1] = 3;
2311 
2312 	return CommonInit(TYPE_E132T, mrkickera_io_write, mrkickera_io_read, sound_type_0_init, 0, 0x800000);
2313 }
2314 
2315 struct BurnDriverD BurnDrvMrkickera = {
2316 	"mrkickera", "mrkicker", NULL, NULL, "2001",
2317 	"Mr. Kicker (SEMICOM-003b PCB)\0", NULL, "SemiCom", "Miscellaneous",
2318 	NULL, NULL, NULL, NULL,
2319 	BDF_GAME_NOT_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_MAZE, 0,
2320 	NULL, mrkickeraRomInfo, mrkickeraRomName, NULL, NULL, NULL, NULL, FinalgdrInputInfo, NULL,
2321 	MrkickeraInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2322 	320, 236, 4, 3
2323 };
2324 
2325 
2326 // Toy Land Adventure
2327 
2328 static struct BurnRomInfo toylandRomDesc[] = {
2329 	{ "rom2.bin",				0x080000, 0xe3455002, 1 | BRF_PRG | BRF_ESS }, //  0 E116T Code
2330 
2331 	{ "roml00.bin",				0x200000, 0x06f5673d, 2 | BRF_GRA },           //  1 Sprites
2332 	{ "romu00.bin",				0x200000, 0x8c3db0e4, 2 | BRF_GRA },           //  2
2333 	{ "roml01.bin",				0x200000, 0x076a84e1, 2 | BRF_GRA },           //  3
2334 	{ "romu01.bin",				0x200000, 0x1bc33d01, 2 | BRF_GRA },           //  4
2335 
2336 	{ "vrom1.bin",				0x040000, 0xd7e6fc5d, 3 | BRF_SND },           //  5 Samples
2337 
2338 	{ "epr1.ic3",				0x000080, 0x812f3d87, 9 | BRF_PRG | BRF_ESS }, //  6 Default EEPROM
2339 };
2340 
2341 STD_ROM_PICK(toyland)
STD_ROM_FN(toyland)2342 STD_ROM_FN(toyland)
2343 
2344 static INT32 ToylandInit()
2345 {
2346 	speedhack_address = 0x780d8;
2347 	speedhack_pc = 0x130c2;
2348 
2349 	return CommonInit(TYPE_E116T, coolmini_io_write, coolmini_io_read, sound_type_0_init, 0, 0);
2350 }
2351 
2352 struct BurnDriver BurnDrvToyland = {
2353 	"toyland", NULL, NULL, NULL, "2001",
2354 	"Toy Land Adventure\0", NULL, "SemiCom", "Miscellaneous",
2355 	NULL, NULL, NULL, NULL,
2356 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_PLATFORM, 0,
2357 	NULL, toylandRomInfo, toylandRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2358 	ToylandInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2359 	320, 236, 4, 3
2360 };
2361 
2362 
2363 // Wivern Wings
2364 
2365 static struct BurnRomInfo wivernwgRomDesc[] = {
2366 	{ "rom1",					0x080000, 0x83eb9a36, 1 | BRF_PRG | BRF_ESS }, //  0 E132T Code
2367 	{ "rom2",					0x080000, 0x5d657055, 1 | BRF_PRG | BRF_ESS }, //  1
2368 
2369 	{ "u7",						0x020000, 0x00a3f705, 8 | BRF_PRG | BRF_ESS }, //  2 QS1000 Code
2370 
2371 	{ "roml00",					0x200000, 0xfb3541b6, 2 | BRF_GRA },           //  3 Sprites
2372 	{ "romh00",					0x200000, 0x516aca48, 2 | BRF_GRA },           //  4
2373 	{ "roml01",					0x200000, 0x1c764f95, 2 | BRF_GRA },           //  5
2374 	{ "romh01",					0x200000, 0xfee42c63, 2 | BRF_GRA },           //  6
2375 	{ "roml02",					0x200000, 0xfc846707, 2 | BRF_GRA },           //  7
2376 	{ "romh02",					0x200000, 0x86141c7d, 2 | BRF_GRA },           //  8
2377 	{ "l03",					0x200000, 0x85aa8db8, 2 | BRF_GRA },           //  9
2378 	{ "h03",					0x200000, 0xade8af9f, 2 | BRF_GRA },           // 10
2379 
2380 	{ "romsnd.u15a",			0x200000, 0xfc89eedc, 6 | BRF_SND },           // 11 QS1000 Samples
2381 	{ "qs1001a",				0x080000, 0xd13c6407, 6 | BRF_SND },           // 12
2382 };
2383 
2384 STD_ROM_PICK(wivernwg)
STD_ROM_FN(wivernwg)2385 STD_ROM_FN(wivernwg)
2386 
2387 static INT32 WivernwgInit()
2388 {
2389 	speedhack_address = 0xb4cc4;
2390 	speedhack_pc = 0x10766;
2391 
2392 	protection_data[0] = 2;
2393 	protection_data[1] = 1;
2394 
2395 	return CommonInit(TYPE_E132T, wyvernwg_io_write, wyvernwg_io_read, sound_type_2_init, 0, 0);
2396 }
2397 
2398 struct BurnDriver BurnDrvWivernwg = {
2399 	"wivernwg", NULL, NULL, NULL, "2001",
2400 	"Wivern Wings\0", NULL, "SemiCom", "Miscellaneous",
2401 	NULL, NULL, NULL, NULL,
2402 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2403 	NULL, wivernwgRomInfo, wivernwgRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2404 	WivernwgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2405 	236, 320, 3, 4
2406 };
2407 
2408 
2409 // Wyvern Wings (set 1)
2410 
2411 static struct BurnRomInfo wyvernwgRomDesc[] = {
2412 	{ "rom1.bin",				0x080000, 0x66bf3a5c, 1 | BRF_PRG | BRF_ESS }, //  0 E132T Code
2413 	{ "rom2.bin",				0x080000, 0xfd9b5911, 1 | BRF_PRG | BRF_ESS }, //  1
2414 
2415 	{ "u7",						0x020000, 0x00a3f705, 8 | BRF_PRG | BRF_ESS }, //  2 QS1000 Code
2416 
2417 	{ "roml00",					0x200000, 0xfb3541b6, 2 | BRF_GRA },           //  3 Sprites
2418 	{ "romh00",					0x200000, 0x516aca48, 2 | BRF_GRA },           //  4
2419 	{ "roml01",					0x200000, 0x1c764f95, 2 | BRF_GRA },           //  5
2420 	{ "romh01",					0x200000, 0xfee42c63, 2 | BRF_GRA },           //  6
2421 	{ "roml02",					0x200000, 0xfc846707, 2 | BRF_GRA },           //  7
2422 	{ "romh02",					0x200000, 0x86141c7d, 2 | BRF_GRA },           //  8
2423 	{ "roml03",					0x200000, 0xb10bf37c, 2 | BRF_GRA },           //  9
2424 	{ "romh03",					0x200000, 0xe01c2a92, 2 | BRF_GRA },           // 10
2425 
2426 	{ "romsnd.u15a",			0x200000, 0xfc89eedc, 6 | BRF_SND },           // 11 QS1000 Samples
2427 	{ "qs1001a",				0x080000, 0xd13c6407, 6 | BRF_SND },           // 12
2428 };
2429 
2430 STD_ROM_PICK(wyvernwg)
STD_ROM_FN(wyvernwg)2431 STD_ROM_FN(wyvernwg)
2432 
2433 static INT32 WyvernwgInit()
2434 {
2435 	speedhack_address = 0xb56f4;
2436 	speedhack_pc = 0x10766;
2437 
2438 	protection_data[0] = 2;
2439 	protection_data[1] = 1;
2440 
2441 	return CommonInit(TYPE_E132T, wyvernwg_io_write, wyvernwg_io_read, sound_type_2_init, 0, 0);
2442 }
2443 
2444 struct BurnDriver BurnDrvWyvernwg = {
2445 	"wyvernwg", "wivernwg", NULL, NULL, "2001",
2446 	"Wyvern Wings (set 1)\0", NULL, "SemiCom (Game Vision license)", "Miscellaneous",
2447 	NULL, NULL, NULL, NULL,
2448 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2449 	NULL, wyvernwgRomInfo, wyvernwgRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2450 	WyvernwgInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2451 	236, 320, 3, 4
2452 };
2453 
2454 
2455 // Wyvern Wings (set 2)
2456 
2457 static struct BurnRomInfo wyvernwgaRomDesc[] = {
2458 	{ "rom1.rom",				0x080000, 0x586881fd, 1 | BRF_PRG | BRF_ESS }, //  0 E132T Code
2459 	{ "rom2.rom",				0x080000, 0x938049ec, 1 | BRF_PRG | BRF_ESS }, //  1
2460 
2461 	{ "u7",						0x020000, 0x00a3f705, 8 | BRF_PRG | BRF_ESS }, //  2 QS1000 Code
2462 
2463 	{ "roml00",					0x200000, 0xfb3541b6, 2 | BRF_GRA },           //  3 Sprites
2464 	{ "romh00",					0x200000, 0x516aca48, 2 | BRF_GRA },           //  4
2465 	{ "roml01",					0x200000, 0x1c764f95, 2 | BRF_GRA },           //  5
2466 	{ "romh01",					0x200000, 0xfee42c63, 2 | BRF_GRA },           //  6
2467 	{ "roml02",					0x200000, 0xfc846707, 2 | BRF_GRA },           //  7
2468 	{ "romh02",					0x200000, 0x86141c7d, 2 | BRF_GRA },           //  8
2469 	{ "roml03",					0x200000, 0xb10bf37c, 2 | BRF_GRA },           //  9
2470 	{ "romh03",					0x200000, 0xe01c2a92, 2 | BRF_GRA },           // 10
2471 
2472 	{ "romsnd.u15a",			0x200000, 0xfc89eedc, 6 | BRF_SND },           // 11 QS1000 Samples
2473 	{ "qs1001a",				0x080000, 0xd13c6407, 6 | BRF_SND },           // 12
2474 };
2475 
2476 STD_ROM_PICK(wyvernwga)
STD_ROM_FN(wyvernwga)2477 STD_ROM_FN(wyvernwga)
2478 
2479 static INT32 WyvernwgaInit()
2480 {
2481 	speedhack_address = 0xb74f0;
2482 	speedhack_pc = 0x10766;
2483 
2484 	protection_data[0] = 2;
2485 	protection_data[1] = 1;
2486 
2487 	return CommonInit(TYPE_E132T, wyvernwg_io_write, wyvernwg_io_read, sound_type_2_init, 0, 0);
2488 }
2489 
2490 struct BurnDriver BurnDrvWyvernwga = {
2491 	"wyvernwga", "wivernwg", NULL, NULL, "2001",
2492 	"Wyvern Wings (set 2)\0", NULL, "SemiCom (Game Vision license)", "Miscellaneous",
2493 	NULL, NULL, NULL, NULL,
2494 	BDF_GAME_WORKING | BDF_CLONE | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2495 	NULL, wyvernwgaRomInfo, wyvernwgaRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2496 	WyvernwgaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2497 	236, 320, 3, 4
2498 };
2499 
2500 
2501 // Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)
2502 
2503 static struct BurnRomInfo aohRomDesc[] = {
2504 	{ "rom1",					0x200000, 0x2e55ff55, 1 | BRF_PRG | BRF_ESS }, //  0 E132XN Code
2505 	{ "rom2",					0x200000, 0x50f8a409, 1 | BRF_PRG | BRF_ESS }, //  1
2506 
2507 	// swapped from mame
2508 	{ "g09",					0x800000, 0xc359febb, 2 | BRF_GRA },           //  2 Sprites
2509 	{ "g05",					0x800000, 0x64c8f493, 2 | BRF_GRA },           //  3
2510 	{ "g10",					0x800000, 0x08217573, 2 | BRF_GRA },           //  4
2511 	{ "g06",					0x800000, 0xffbc9fe5, 2 | BRF_GRA },           //  5
2512 	{ "g11",					0x800000, 0x5f0461b8, 2 | BRF_GRA },           //  6
2513 	{ "g07",					0x800000, 0x5cb3c86a, 2 | BRF_GRA },           //  7
2514 	{ "g12",					0x800000, 0xe437b35f, 2 | BRF_GRA },           //  8
2515 	{ "g08",					0x800000, 0x1fd08aa0, 2 | BRF_GRA },           //  9
2516 
2517 	// swapped from MAME!
2518 	{ "rom4",					0x080000, 0xbba47755, 3 | BRF_SND },           // 11 OKI #0 Samples
2519 
2520 	{ "rom3",					0x040000, 0xdb8cb455, 4 | BRF_SND },           // 10 OKI #1 Samples
2521 };
2522 
2523 STD_ROM_PICK(aoh)
STD_ROM_FN(aoh)2524 STD_ROM_FN(aoh)
2525 
2526 static void aoh_speedhack_callback(UINT32 address)
2527 {
2528 	if (address == speedhack_address) {
2529 		if (E132XSGetPC(0) == 0xb994 || E132XSGetPC(0) == 0xba40) {
2530 			E132XSBurnCycles(500);
2531 		}
2532 	}
2533 }
2534 
AohInit()2535 static INT32 AohInit()
2536 {
2537 	cpu_clock = 80000000;
2538 	speedhack_address = 0x28a09c;
2539 	speedhack_pc = 0xb994; // & ba40
2540 	speedhack_callback = aoh_speedhack_callback;
2541 
2542 	return CommonInit(TYPE_E132XN, aoh_io_write, aoh_io_read, sound_type_1_init, 0, 0);
2543 }
2544 
2545 struct BurnDriver BurnDrvAoh = {
2546 	"aoh", NULL, NULL, NULL, "2001",
2547 	"Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)\0", NULL, "Unico", "Miscellaneous",
2548 	NULL, NULL, NULL, NULL,
2549 	BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SCRFIGHT, 0,
2550 	NULL, aohRomInfo, aohRomName, NULL, NULL, NULL, NULL, AohInputInfo, NULL,
2551 	AohInit, DrvExit, DrvFrame, AohDraw, DrvScan, &DrvRecalc, 0x8000,
2552 	384, 224, 4, 3
2553 };
2554 
2555 
2556 // Boong-Ga Boong-Ga (Spank'em!)
2557 
2558 static struct BurnRomInfo boonggabRomDesc[] = {
2559 	{ "1.rom1",					0x080000, 0x50522da1, 1 | BRF_PRG | BRF_ESS }, //  0 E116T Code
2560 	{ "2.rom0",					0x080000, 0x3395541b, 1 | BRF_PRG | BRF_ESS }, //  1
2561 
2562 	{ "boong-ga.roml00",		0x200000, 0x18be5f92, 2 | BRF_GRA },           //  2 Sprites
2563 	{ "boong-ga.romu00",		0x200000, 0x0158ba9e, 2 | BRF_GRA },           //  3
2564 	{ "boong-ga.roml05",		0x200000, 0x76d60553, 2 | BRF_GRA },           //  4
2565 	{ "boong-ga.romu05",		0x200000, 0x35ee8fb5, 2 | BRF_GRA },           //  5
2566 	{ "boong-ga.roml01",		0x200000, 0x636e9d5d, 2 | BRF_GRA },           //  6
2567 	{ "boong-ga.romu01",		0x200000, 0xb8dcf6b7, 2 | BRF_GRA },           //  7
2568 	{ "boong-ga.roml06",		0x200000, 0x8dc521b7, 2 | BRF_GRA },           //  8
2569 	{ "boong-ga.romu06",		0x200000, 0xf6b83270, 2 | BRF_GRA },           //  9
2570 	{ "boong-ga.roml02",		0x200000, 0xd0661c69, 2 | BRF_GRA },           // 10
2571 	{ "boong-ga.romu02",		0x200000, 0xeac01eb8, 2 | BRF_GRA },           // 11
2572 	{ "boong-ga.roml07",		0x200000, 0x3301813a, 2 | BRF_GRA },           // 12
2573 	{ "boong-ga.romu07",		0x200000, 0x3f1c3682, 2 | BRF_GRA },           // 13
2574 	{ "boong-ga.roml03",		0x200000, 0x4d4260b3, 2 | BRF_GRA },           // 14
2575 	{ "boong-ga.romu03",		0x200000, 0x4ba00032, 2 | BRF_GRA },           // 15
2576 
2577 	{ "3.vrom1",				0x080000, 0x0696bfcb, 3 | BRF_SND },           // 16 Samples
2578 	{ "4.vrom2",				0x080000, 0x305c2b16, 3 | BRF_SND },           // 17
2579 };
2580 
2581 STD_ROM_PICK(boonggab)
STD_ROM_FN(boonggab)2582 STD_ROM_FN(boonggab)
2583 
2584 static INT32 BoonggabInit()
2585 {
2586 	speedhack_address = 0xf1b74;
2587 	speedhack_pc = 0x131a6;
2588 	is_boongga = 1;
2589 
2590 	return CommonInit(TYPE_E116T, boonggab_io_write, boonggab_io_read, sound_type_0_init, 0, 0x2000000);
2591 }
2592 
2593 struct BurnDriver BurnDrvBoonggab = {
2594 	"boonggab", NULL, NULL, NULL, "2001",
2595 	"Boong-Ga Boong-Ga (Spank'em!)\0", NULL, "Taff System", "Miscellaneous",
2596 	NULL, NULL, NULL, NULL,
2597 	BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0,
2598 	NULL, boonggabRomInfo, boonggabRomName, NULL, NULL, NULL, NULL, BoonggabInputInfo, NULL,
2599 	BoonggabInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2600 	236, 320, 3, 4
2601 };
2602 
2603 
2604 // Yori Jori Kuk Kuk
2605 
2606 static struct BurnRomInfo yorijoriRomDesc[] = {
2607 	{ "prg1",					0x200000, 0x0e04eb40, 1 | BRF_PRG | BRF_ESS }, //  0 maincpu
2608 
2609 	{ "snd5",					0x020000, 0x79067367, 8 | BRF_PRG | BRF_ESS }, //  1 QS1000 Code
2610 
2611 	{ "roml00",					0x200000, 0x9299ce36, 3 | BRF_GRA },           //  2 Sprites
2612 	{ "romh00",					0x200000, 0x16584ff2, 3 | BRF_GRA },           //  3
2613 	{ "roml01",					0x200000, 0xb5d1892f, 3 | BRF_GRA },           //  4
2614 	{ "romh01",					0x200000, 0xfe0485ef, 3 | BRF_GRA },           //  5
2615 
2616 	{ "snd2",					0x200000, 0x8d9a8795, 6 | BRF_SND },           //  6 QS1000 Samples
2617 	{ "qs1001a.snd3",			0x080000, 0xd13c6407, 6 | BRF_SND },           //  7
2618 };
2619 
2620 STD_ROM_PICK(yorijori)
STD_ROM_FN(yorijori)2621 STD_ROM_FN(yorijori)
2622 
2623 static INT32 YorijoriInit()
2624 {
2625 	return 0; // game not working!
2626 }
2627 
2628 struct BurnDriverD BurnDrvYorijori = {
2629 	"yorijori", NULL, NULL, NULL, "199?",
2630 	"Yori Jori Kuk Kuk\0", NULL, "Golden Bell Entertainment", "Miscellaneous",
2631 	NULL, NULL, NULL, NULL,
2632 	BDF_GAME_NOT_WORKING, 2, HARDWARE_MISC_POST90S, GBF_MISC, 0,
2633 	NULL, yorijoriRomInfo, yorijoriRomName, NULL, NULL, NULL, NULL, CommonInputInfo, NULL,
2634 	YorijoriInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x8000,
2635 	320, 236, 4, 3
2636 };
2637 
2638