1 // FinalBurn Neo Namco System NB-1 driver module
2 // Based on MAME driver by Phil Stroffolino
3
4 #include "tiles_generic.h"
5 #include "m68000_intf.h"
6 #include "m377_intf.h"
7 #include "c352.h"
8 #include "c169.h"
9 #include "burn_pal.h"
10 #include "burn_gun.h"
11 #include "bitswap.h"
12
13 static UINT8 *AllMem;
14 static UINT8 *RamEnd;
15 static UINT8 *MemEnd;
16 static UINT8 *Drv68KROM;
17 static UINT8 *DrvMCUROM;
18 static UINT8 *DrvMCUData;
19 static UINT8 *DrvGfxROM[6];
20 static UINT8 *DrvSndROM;
21 static UINT8 *DrvNVRAM;
22 static UINT8 *AllRam;
23 static UINT8 *Drv68KRAM;
24 static UINT8 *DrvExtRAM;
25 static UINT8 *DrvShareRAM;
26 static UINT8 *DrvSprRAM;
27 static UINT8 *DrvSprRAM2;
28 static UINT8 *DrvSprRAM3;
29 static UINT8 *DrvC123RAM;
30 static UINT8 *DrvC123Ctrl;
31 static UINT8 *DrvSprBank;
32 static UINT8 *DrvRozBank;
33 static UINT8 *DrvTileBank;
34 static UINT8 *DrvRozRAM;
35 static UINT8 *DrvUnkRegs;
36 static UINT8 *DrvRozCtrl;
37 static UINT8 *DrvPalRAMR;
38 static UINT8 *DrvPalRAMG;
39 static UINT8 *DrvPalRAMB;
40 static UINT16 *DrvPalRegs;
41
42 static UINT32 *DrvPalette;
43 static UINT8 DrvRecalc;
44
45 static UINT8 *SpritePrio;
46 static UINT16 *SpriteBitmap;
47
48 static INT32 *roz_dirty_tile; // 0x10000
49 static UINT16 *roz_bitmap; // (256 * 8) * (256 * 8)
50
51 static INT32 min_y, min_x, max_x, max_y;
52 static void (*c123_tile_callback)(INT32 *tile, INT32 *mask) = NULL;
53 static INT32 (*c355_tile_callback)(INT32 tile) = NULL;
54 static void (*roz_tile_callback)(INT32 *tile, INT32 *mask_tile, INT32 which) = NULL;
55
56 static INT32 mcu_halted;
57 static UINT16 port6_data;
58 static UINT32 (*cuskey_callback)(UINT32) = NULL;
59 static INT32 pos_irq_level;
60 static INT32 unk_irq_level;
61 static INT32 vbl_irq_level;
62
63 static UINT16 *c355_obj_position;
64
65 static UINT8 DrvJoy1[16];
66 static UINT8 DrvJoy2[16];
67 static UINT8 DrvJoy3[16];
68 static UINT8 DrvJoy4[16];
69 static UINT8 DrvJoy5[16];
70 static UINT8 DrvDips[1];
71 static UINT8 DrvInputs[5];
72 static UINT8 DrvReset;
73 static INT16 Analog[4];
74
75 static INT32 has_gun = 0;
76
77 static ButtonToggle service;
78
79 static INT32 nExtraCycles[2];
80
81 static UINT16 last_rand;
82 static INT32 timer60hz = 0;
83
84 static struct BurnInputInfo Namconb1InputList[] = {
85 {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p1 coin" },
86 {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" },
87 {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" },
88 {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" },
89 {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" },
90 {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" },
91 {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" },
92 {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 2" },
93 {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 3" },
94
95 {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p2 coin" },
96 {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" },
97 {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" },
98 {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" },
99 {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" },
100 {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" },
101 {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" },
102 {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 2" },
103 {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 3" },
104
105 {"P3 Coin", BIT_DIGITAL, DrvJoy5 + 3, "p3 coin" },
106 {"P3 Start", BIT_DIGITAL, DrvJoy3 + 7, "p3 start" },
107 {"P3 Up", BIT_DIGITAL, DrvJoy3 + 3, "p3 up" },
108 {"P3 Down", BIT_DIGITAL, DrvJoy3 + 2, "p3 down" },
109 {"P3 Left", BIT_DIGITAL, DrvJoy3 + 1, "p3 left" },
110 {"P3 Right", BIT_DIGITAL, DrvJoy3 + 0, "p3 right" },
111 {"P3 Button 1", BIT_DIGITAL, DrvJoy3 + 4, "p3 fire 1" },
112 {"P3 Button 2", BIT_DIGITAL, DrvJoy3 + 5, "p3 fire 2" },
113 {"P3 Button 3", BIT_DIGITAL, DrvJoy3 + 6, "p3 fire 3" },
114
115 {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 2, "p4 coin" },
116 {"P4 Start", BIT_DIGITAL, DrvJoy4 + 7, "p4 start" },
117 {"P4 Up", BIT_DIGITAL, DrvJoy4 + 3, "p4 up" },
118 {"P4 Down", BIT_DIGITAL, DrvJoy4 + 2, "p4 down" },
119 {"P4 Left", BIT_DIGITAL, DrvJoy4 + 1, "p4 left" },
120 {"P4 Right", BIT_DIGITAL, DrvJoy4 + 0, "p4 right" },
121 {"P4 Button 1", BIT_DIGITAL, DrvJoy4 + 4, "p4 fire 1" },
122 {"P4 Button 2", BIT_DIGITAL, DrvJoy4 + 5, "p4 fire 2" },
123 {"P4 Button 3", BIT_DIGITAL, DrvJoy4 + 6, "p4 fire 3" },
124
125 {"Reset", BIT_DIGITAL, &DrvReset, "reset" },
126 {"Service Mode", BIT_DIGITAL, DrvJoy5 + 1, "diag" },
127 {"Service", BIT_DIGITAL, DrvJoy5 + 7, "service" },
128 {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" },
129 };
130
131 STDINPUTINFO(Namconb1)
132
133 #define A(a, b, c, d) {a, b, (UINT8*)(c), d}
134 static struct BurnInputInfo GunbuletInputList[] = {
135 {"P1 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p1 coin" },
136 {"P1 Start", BIT_DIGITAL, DrvJoy1 + 7, "p1 start" },
137 {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 1" },
138 A("P1 Gun X", BIT_ANALOG_REL, &Analog[0], "mouse x-axis" ),
139 A("P1 Gun Y", BIT_ANALOG_REL, &Analog[1], "mouse y-axis" ),
140
141 {"P2 Coin", BIT_DIGITAL, DrvJoy5 + 4, "p2 coin" },
142 {"P2 Start", BIT_DIGITAL, DrvJoy2 + 7, "p2 start" },
143 {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 1" },
144 A("P2 Gun X", BIT_ANALOG_REL, &Analog[2], "p2 x-axis" ),
145 A("P2 Gun Y", BIT_ANALOG_REL, &Analog[3], "p2 y-axis" ),
146
147 {"Reset", BIT_DIGITAL, &DrvReset, "reset" },
148 {"Service Mode", BIT_DIGITAL, DrvJoy5 + 1, "diag" },
149 {"Service", BIT_DIGITAL, DrvJoy5 + 7, "service" },
150 {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" },
151 };
152 #undef A
153 STDINPUTINFO(Gunbulet)
154
155 static struct BurnDIPInfo GunbuletDIPList[]=
156 {
157 DIP_OFFSET(0x0d)
158 {0x00, 0xff, 0xff, 0x41, NULL },
159
160 {0 , 0xfe, 0 , 2, "Freeze Screen" },
161 {0x00, 0x01, 0x01, 0x01, "Off" },
162 {0x00, 0x01, 0x01, 0x00, "On" },
163
164 {0 , 0xfe, 0 , 2, "Test switch" },
165 {0x00, 0x01, 0x40, 0x40, "Off" },
166 {0x00, 0x01, 0x40, 0x00, "On" },
167 };
168
169 STDDIPINFO(Gunbulet)
170
171 static struct BurnDIPInfo Namconb1DIPList[]=
172 {
173 DIP_OFFSET(0x27)
174 {0x00, 0xff, 0xff, 0x41, NULL },
175
176 {0 , 0xfe, 0 , 2, "Freeze Screen" },
177 {0x00, 0x01, 0x01, 0x01, "Off" },
178 {0x00, 0x01, 0x01, 0x00, "On" },
179
180 {0 , 0xfe, 0 , 2, "Test switch" },
181 {0x00, 0x01, 0x40, 0x40, "Off" },
182 {0x00, 0x01, 0x40, 0x00, "On" },
183 };
184
STDDIPINFO(Namconb1)185 STDDIPINFO(Namconb1)
186
187 static void cpureg_write(UINT8 offset, UINT8 data)
188 {
189 switch (offset)
190 {
191 case 0x01:
192 SekSetIRQLine(pos_irq_level, CPU_IRQSTATUS_NONE);
193 pos_irq_level = data & 0x0f;
194 break;
195
196 case 0x02:
197 SekSetIRQLine(unk_irq_level, CPU_IRQSTATUS_NONE);
198 unk_irq_level = data & 0x0f;
199 break;
200
201 case 0x04:
202 SekSetIRQLine(vbl_irq_level, CPU_IRQSTATUS_NONE);
203 vbl_irq_level = data & 0x0f;
204 break;
205
206 case 0x06:
207 SekSetIRQLine(pos_irq_level, CPU_IRQSTATUS_NONE);
208 break;
209
210 case 0x07:
211 SekSetIRQLine(unk_irq_level, CPU_IRQSTATUS_NONE);
212 break;
213
214 case 0x09:
215 SekSetIRQLine(vbl_irq_level, CPU_IRQSTATUS_NONE);
216 break;
217
218 case 0x16: break; // nop
219
220 case 0x18:
221 if (data & 1)
222 {
223 mcu_halted = 0;
224 M377Reset();
225 }
226 else
227 mcu_halted = 1;
228
229 break;
230 }
231 }
232
b2_cpureg_write(UINT8 offset,UINT8 data)233 static void b2_cpureg_write(UINT8 offset, UINT8 data)
234 {
235 switch (offset)
236 {
237 case 0x00:
238 SekSetIRQLine(vbl_irq_level, CPU_IRQSTATUS_NONE);
239 vbl_irq_level = data & 0x0f;
240 break;
241
242 case 0x01:
243 SekSetIRQLine(unk_irq_level, CPU_IRQSTATUS_NONE);
244 unk_irq_level = data & 0x0f;
245 break;
246
247 case 0x02:
248 SekSetIRQLine(pos_irq_level, CPU_IRQSTATUS_NONE);
249 pos_irq_level = data & 0x0f;
250 break;
251
252 case 0x04:
253 SekSetIRQLine(vbl_irq_level, CPU_IRQSTATUS_NONE);
254 break;
255
256 case 0x05:
257 SekSetIRQLine(unk_irq_level, CPU_IRQSTATUS_NONE);
258 break;
259
260 case 0x06:
261 SekSetIRQLine(pos_irq_level, CPU_IRQSTATUS_NONE);
262 break;
263
264 case 0x14: break; // WATCHDOG?
265
266 case 0x16:
267 if (data & 1)
268 {
269 mcu_halted = 0;
270 M377Reset();
271 }
272 else
273 {
274 mcu_halted = 1;
275 }
276
277 break;
278 }
279 }
280
namco_c116_read(UINT16 offset)281 static UINT8 namco_c116_read(UINT16 offset)
282 {
283 UINT8 *RAM;
284
285 offset &= 0x7fff;
286
287 switch (offset & 0x1800)
288 {
289 case 0x0000:
290 RAM = DrvPalRAMR;
291 break;
292
293 case 0x0800:
294 RAM = DrvPalRAMG;
295 break;
296
297 case 0x1000:
298 RAM = DrvPalRAMB;
299 break;
300
301 default: // case 0x1800 (internal registers)
302 {
303 INT32 reg = (offset & 0xf) >> 1;
304 if (~offset & 1)
305 return DrvPalRegs[reg] & 0xff;
306 else
307 return DrvPalRegs[reg] >> 8;
308 }
309 }
310
311 return RAM[((offset & 0x6000) >> 2) | (offset & 0x7ff)];
312 }
313
namco_c116_write(UINT16 offset,UINT8 data)314 static void namco_c116_write(UINT16 offset, UINT8 data)
315 {
316 UINT8 *RAM;
317
318 offset &= 0x7fff;
319
320 switch (offset & 0x1800)
321 {
322 case 0x0000:
323 RAM = DrvPalRAMR;
324 break;
325
326 case 0x0800:
327 RAM = DrvPalRAMG;
328 break;
329
330 case 0x1000:
331 RAM = DrvPalRAMB;
332 break;
333
334 default: // case 0x1800 (internal registers)
335 {
336 INT32 reg = (offset & 0xf) >> 1;
337 if (~offset & 1)
338 DrvPalRegs[reg] = (DrvPalRegs[reg] & 0xff00) | data;
339 else
340 DrvPalRegs[reg] = (DrvPalRegs[reg] & 0x00ff) | (data << 8);
341 return;
342 }
343 }
344
345 INT32 color = ((offset & 0x6000) >> 2) | (offset & 0x7ff);
346 RAM[color] = data;
347
348 DrvPalette[color] = BurnHighCol(DrvPalRAMR[color], DrvPalRAMG[color], DrvPalRAMB[color], 0);
349 }
350
TotalReCarl()351 static void TotalReCarl()
352 {
353 for (INT32 color = 0; color < 0x2000; color++) {
354 DrvPalette[color] = BurnHighCol(DrvPalRAMR[color], DrvPalRAMG[color], DrvPalRAMB[color], 0);
355 }
356 }
357
sync_mcu()358 static inline void sync_mcu()
359 {
360 INT32 cycles = (((INT64)SekTotalCycles() * (16128000 / 2)) / 24192000) - M377TotalCycles(); // mcu is clocked at 2/3 speed of main
361 if (cycles > 0) {
362 if (mcu_halted) {
363 M377Idle(cycles);
364 } else {
365 M377Run(cycles);
366 }
367 }
368 }
369
namconb1_main_write_long(UINT32 address,UINT32 data)370 static void __fastcall namconb1_main_write_long(UINT32 address, UINT32 data)
371 {
372 if ((address & 0xfffffc) == 0x1e4000) {
373 // srand write (nop)
374 return;
375 }
376
377 if ((address & 0xffffe0) == 0x400000) {
378 return;
379 }
380
381 if ((address & 0xffffe0) == 0x6e0000) {
382 // custom key writes (nop)
383 return;
384 }
385
386 if ((address & 0xff8000) == 0x700000) {
387 data = (data << 16) | (data >> 16);
388
389 namco_c116_write((address & 0x7ffc) + 0, data >> 0);
390 namco_c116_write((address & 0x7ffc) + 1, data >> 8);
391 namco_c116_write((address & 0x7ffc) + 2, data >> 16);
392 namco_c116_write((address & 0x7ffc) + 3, data >> 24);
393 return;
394 }
395 }
396
namconb1_main_write_word(UINT32 address,UINT16 data)397 static void __fastcall namconb1_main_write_word(UINT32 address, UINT16 data)
398 {
399 if ((address & 0xfffffc) == 0x1e4000) {
400 // srand write (nop)
401 return;
402 }
403
404 if ((address & 0xffffe0) == 0x400000) {
405 cpureg_write((address & 0x1e) + 0, data >> 0);
406 cpureg_write((address & 0x1e) + 1, data >> 8);
407 return;
408 }
409
410 if ((address & 0xffffe0) == 0x6e0000) {
411 // custom key writes (nop)
412 // 6e0002 - nebulas ray
413 return;
414 }
415
416 if ((address & 0xff8000) == 0x700000) {
417 namco_c116_write((address & 0x7ffe) + 0, data >> 0);
418 namco_c116_write((address & 0x7ffe) + 1, data >> 8);
419 return;
420 }
421 }
422
namconb1_main_write_byte(UINT32 address,UINT8 data)423 static void __fastcall namconb1_main_write_byte(UINT32 address, UINT8 data)
424 {
425 if ((address & 0xfffffc) == 0x1e4000) {
426 // srand write (nop)
427 return;
428 }
429
430 if ((address & 0xffffe0) == 0x400000) {
431 cpureg_write((address & 0x1f) + 0, data);
432 return;
433 }
434
435 if ((address & 0xffffe0) == 0x6e0000) {
436 // custom key writes (nop)
437 return;
438 }
439
440 if ((address & 0xff8000) == 0x700000) {
441 namco_c116_write((address & 0x7fff) ^ 0, data);
442 return;
443 }
444 }
445
namconb1_main_read_long(UINT32 address)446 static UINT32 __fastcall namconb1_main_read_long(UINT32 address)
447 {
448 if ((address & 0xfffffc) == 0x1e4000) {
449 return BurnRandom() | (BurnRandom() << 16);
450 }
451
452 if ((address & 0xffffe0) == 0x400000) {
453 return 0xffffffff;
454 }
455
456 if ((address & 0xffffe0) == 0x6e0000) {
457 if (cuskey_callback) {
458 return cuskey_callback((address / 4) & 7);
459 }
460 return 0;
461 }
462
463 if ((address & 0xff8000) == 0x700000) {
464 return namco_c116_read((address & 0x7ffc) + 0) | (namco_c116_read((address & 0x7ffc) + 1) << 8) | (namco_c116_read((address & 0x7ffc) + 2) << 16) | (namco_c116_read((address & 0x7ffc) + 3) << 24);
465 }
466
467 if ((address & 0xffffe0) == 0x100000) {
468 address = (address & 0x1f) / 4;
469 UINT8 gun = 0;
470 switch (address & ~1) {
471 case 0: gun = (UINT8)(0x0f + BurnGunReturnY(1) * 224 / 255); break;
472 case 2: gun = (UINT8)(0x26 + BurnGunReturnX(1) * 288 / 314); break;
473 case 4: gun = (UINT8)(0x0f + BurnGunReturnY(0) * 224 / 255); break;
474 case 6: gun = (UINT8)(0x26 + BurnGunReturnX(0) * 288 / 314); break;
475 }
476 return (gun << 24) & 0xff000000;
477 }
478
479 return 0xff;
480 }
481
namconb1_main_read_word(UINT32 address)482 static UINT16 __fastcall namconb1_main_read_word(UINT32 address)
483 {
484 if ((address & 0xfffffc) == 0x1e4000) {
485 return BurnRandom();
486 }
487
488 if ((address & 0xffffe0) == 0x400000) {
489 return 0xffff;
490 }
491
492 if ((address & 0xffffe0) == 0x6e0000) {
493 if (cuskey_callback) {
494 return cuskey_callback((address / 4) & 7) >> ((~address & 2) * 8);
495 }
496 return 0;
497 }
498
499 if ((address & 0xff8000) == 0x700000) {
500 return namco_c116_read((address & 0x7ffe) + 0) | (namco_c116_read((address & 0x7ffe) + 1) << 8);
501 }
502
503 return SekReadLong(address & ~3) >> ((~address & 2) * 8);
504 }
505
namconb1_main_read_byte(UINT32 address)506 static UINT8 __fastcall namconb1_main_read_byte(UINT32 address)
507 {
508 if ((address & 0xffffe0) == 0x400000) {
509 return 0xff; // cpureg
510 }
511
512 if ((address & 0xff8000) == 0x700000) {
513 return namco_c116_read((address & 0x7fff) ^ 0);
514 }
515
516 return SekReadLong(address & ~3) >> ((~address & 3) * 8);
517 }
518
namconb2_main_write_long(UINT32 address,UINT32 data)519 static void __fastcall namconb2_main_write_long(UINT32 address, UINT32 data)
520 {
521 if ((address & 0xfffffc) == 0x1e4000) {
522 // srand write (nop)
523 return;
524 }
525
526 if ((address & 0xff8000) == 0x800000) {
527 data = (data << 16) | (data >> 16);
528
529 namco_c116_write((address & 0x7ffc) + 0, data >> 0);
530 namco_c116_write((address & 0x7ffc) + 1, data >> 8);
531 namco_c116_write((address & 0x7ffc) + 2, data >> 16);
532 namco_c116_write((address & 0x7ffc) + 3, data >> 24);
533 return;
534 }
535
536 if ((address & 0xffffe0) == 0xc00000) {
537 // custom key writes (nop)
538 return;
539 }
540
541 if ((address & 0xffffe0) == 0xf00000) {
542 return;
543 }
544 }
545
namconb2_main_write_word(UINT32 address,UINT16 data)546 static void __fastcall namconb2_main_write_word(UINT32 address, UINT16 data)
547 {
548 if ((address & 0xffffe0) == 0xc00000) {
549 // custom key writes (nop)
550 // C00002 - OUTFOXIES
551 return;
552 }
553
554 if ((address & 0xfffffc) == 0x1e4000) {
555 // srand write (nop)
556 return;
557 }
558
559 if ((address & 0xff8000) == 0x800000) {
560 namco_c116_write((address & 0x7ffe) + 0, data >> 0);
561 namco_c116_write((address & 0x7ffe) + 1, data >> 8);
562 return;
563 }
564
565 if ((address & 0xffffe0) == 0xf00000) {
566 return;
567 }
568 }
569
namconb2_main_write_byte(UINT32 address,UINT8 data)570 static void __fastcall namconb2_main_write_byte(UINT32 address, UINT8 data)
571 {
572 if ((address & 0xfffffc) == 0x1e4000) {
573 // srand write (nop)
574 return;
575 }
576
577 if ((address & 0xff8000) == 0x800000) {
578 namco_c116_write((address & 0x7fff) ^ 0, data);
579 return;
580 }
581
582 if ((address & 0xffffe0) == 0xc00000) {
583 // custom key writes (nop)
584 return;
585 }
586
587 if ((address & 0xffffe0) == 0xf00000) {
588 b2_cpureg_write((address & 0x1f) + 0, data);
589 return;
590 }
591 }
592
namconb2_main_read_long(UINT32 address)593 static UINT32 __fastcall namconb2_main_read_long(UINT32 address)
594 {
595 if ((address & 0xfffffc) == 0x1e4000) {
596 return BurnRandom();
597 }
598
599 if ((address & 0xff8000) == 0x800000) {
600 return namco_c116_read((address & 0x7ffc) + 0) | (namco_c116_read((address & 0x7ffc) + 1) << 8) | (namco_c116_read((address & 0x7ffc) + 2) << 16) | (namco_c116_read((address & 0x7ffc) + 3) << 24);
601 }
602
603 if ((address & 0xffffe0) == 0xc00000) {
604 if (cuskey_callback) {
605 return cuskey_callback((address / 4) & 7);
606 }
607 return 0;
608 }
609
610 if ((address & 0xffffe0) == 0xf00000) {
611 return 0xffffffff;
612 }
613
614 return 0;
615 }
616
namconb2_main_read_word(UINT32 address)617 static UINT16 __fastcall namconb2_main_read_word(UINT32 address)
618 {
619 if ((address & 0xfffffc) == 0x1e4000) {
620 return BurnRandom();
621 }
622
623 if ((address & 0xff8000) == 0x800000) {
624 return namco_c116_read((address & 0x7ffe) + 0) | (namco_c116_read((address & 0x7ffe) + 1) << 8);
625 }
626
627 if ((address & 0xffffe0) == 0xc00000) {
628 if (cuskey_callback) {
629 return cuskey_callback((address / 4) & 7) >> ((~address & 2) * 8);
630 }
631 return 0;
632 }
633
634 if ((address & 0xffffe0) == 0xf00000) {
635 return 0xffff;
636 }
637
638 return 0;
639 }
640
namconb2_main_read_byte(UINT32 address)641 static UINT8 __fastcall namconb2_main_read_byte(UINT32 address)
642 {
643 if ((address & 0xff8000) == 0x800000) {
644 return namco_c116_read((address & 0x7fff) ^ 0);
645 }
646
647 if ((address & 0xffffe0) == 0xf00000) {
648 return 0xff; // cpureg
649 }
650
651 return 0;
652 }
653
mcu_write_byte(UINT32 address,UINT8 data)654 static void mcu_write_byte(UINT32 address, UINT8 data)
655 {
656 if (address >= 0x4000 && address <= 0xbfff) {
657 address -= 0x4000;
658 if ((address == 0x6000) && (data & 0x80)) {
659 M377RunEnd();
660 }
661 DrvShareRAM[address] = data & 0xff;
662 return;
663 }
664
665 if ((address & 0xfff000) == 0x2000) {
666 c352_write((address & 0xfff) / 2, data);
667 return;
668 }
669 }
670
mcu_write_word(UINT32 address,UINT16 data)671 static void mcu_write_word(UINT32 address, UINT16 data)
672 {
673 if (address >= 0x4000 && address <= 0xbfff) {
674 address -= 0x4000;
675 if ((address == 0x6000) && (data & 0x80)) {
676 M377RunEnd();
677 }
678
679 DrvShareRAM[address + 0] = (data >> 0) & 0xff;
680 DrvShareRAM[address + 1] = (data >> 8) & 0xff;
681 return;
682 }
683
684 if ((address & 0xfff000) == 0x2000) {
685 c352_write((address & 0xfff) / 2, data);
686 return;
687 }
688 }
689
mcu_read_byte(UINT32 address)690 static UINT8 mcu_read_byte(UINT32 address)
691 {
692 if (address >= 0x4000 && address <= 0xbfff) {
693 address -= 0x4000;
694
695 return DrvShareRAM[address];
696 }
697
698 if ((address & 0xfff000) == 0x2000) {
699 return c352_read((address & 0xfff) / 2);
700 }
701
702 return 0xff;
703 }
704
mcu_read_word(UINT32 address)705 static UINT16 mcu_read_word(UINT32 address)
706 {
707 if (address >= 0x4000 && address <= 0xbfff) {
708 address -= 0x4000;
709
710 return (DrvShareRAM[address + 0] & 0xff) | ((DrvShareRAM[address + 1] << 8) & 0xff00);
711 }
712 if ((address & 0xfff000) == 0x2000) {
713 return c352_read((address & 0xfff) / 2);
714 }
715
716 return 0xffff;
717 }
718
mcu_write_port(UINT32 address,UINT8 data)719 static void mcu_write_port(UINT32 address, UINT8 data)
720 {
721 switch (address)
722 {
723 case M37710_PORT6:
724 port6_data = data;
725 return;
726 }
727 }
728
mcu_read_port(UINT32 address)729 static UINT8 mcu_read_port(UINT32 address)
730 {
731 if (address >= 0x10 && address <= 0x1f) {
732 const UINT8 scramble[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 };
733
734 return (DrvInputs[2] & scramble[(address & 0x0f) >> 1]) ? 0xff : 0x00;
735 }
736
737 switch (address)
738 {
739 case M37710_PORT6:
740 return port6_data;
741
742 case M37710_PORT7:
743 switch (port6_data & 0xf0) {
744 case 0x00: return DrvInputs[3];
745 case 0x20: return (DrvDips[0] & 0x41) | (DrvInputs[4] & 0xbe);
746 case 0x40: return DrvInputs[0];
747 case 0x60: return DrvInputs[1];
748 }
749 return 0xff;
750 }
751
752 return 0x00;
753 }
754
ResetRozDirty()755 static void ResetRozDirty()
756 {
757 memset(roz_dirty_tile, 0xff, 256 * 256 * sizeof(INT32));
758 }
759
DrvDoReset(INT32 clear_mem)760 static INT32 DrvDoReset(INT32 clear_mem)
761 {
762 if (clear_mem) {
763 memset (AllRam, 0, RamEnd - AllRam);
764 }
765
766 SekOpen(0);
767 SekReset();
768 SekClose();
769
770 M377Open(0);
771 M377Reset();
772 M377Close();
773
774 c352_reset();
775
776 pos_irq_level = 0;
777 unk_irq_level = 0;
778 vbl_irq_level = 0;
779 port6_data = 0;
780 mcu_halted = 0;
781
782 timer60hz = 16128000 / 2 / 60.340909;
783
784 nExtraCycles[0] = nExtraCycles[1] = 0;
785
786 ResetRozDirty();
787
788 return 0;
789 }
790
MemIndex()791 static INT32 MemIndex()
792 {
793 UINT8 *Next; Next = AllMem;
794
795 Drv68KROM = Next; Next += 0x200000;
796 DrvMCUROM = Next; Next += 0x004000;
797 DrvMCUData = Next; Next += 0x080000;
798
799 DrvGfxROM[0] = Next; Next += 0x2000000; // sprite 32x32
800 DrvGfxROM[1] = Next; Next += 0x1000000;
801 DrvGfxROM[2] = Next; Next += 0x1000000;
802 DrvGfxROM[3] = Next; Next += 0x2000000; // sprite 16x16
803 DrvGfxROM[4] = Next; Next += 0x1000000; // roz
804 DrvGfxROM[5] = Next; Next += 0x1000000; // roz mask
805
806 DrvSndROM = Next; Next += 0x1000000;
807
808 DrvNVRAM = Next; Next += 0x000800;
809
810 DrvPalette = (UINT32*)Next; Next += 0x2001 * sizeof(UINT32);
811
812 AllRam = Next;
813
814 Drv68KRAM = Next; Next += 0x010000;
815 DrvExtRAM = Next; Next += 0x100000 - 0x8000;
816 DrvShareRAM = Next; Next += 0x008000;
817 DrvUnkRegs = Next; Next += 0x000400;
818
819 DrvSprRAM = Next; Next += 0x020000;
820 DrvSprRAM2 = Next; Next += 0x020000;
821 DrvSprRAM3 = Next; Next += 0x020000;
822 DrvC123RAM = Next; Next += 0x010000;
823 DrvC123Ctrl = Next; Next += 0x000400;
824 DrvSprBank = Next; Next += 0x000400;
825 DrvRozBank = Next; Next += 0x000400;
826 DrvTileBank = Next; Next += 0x000400;
827
828 DrvRozRAM = Next; Next += 0x020000;
829 DrvRozCtrl = Next; Next += 0x000400;
830
831 DrvPalRAMR = Next; Next += 0x002000;
832 DrvPalRAMG = Next; Next += 0x002000;
833 DrvPalRAMB = Next; Next += 0x002000;
834 DrvPalRegs = (UINT16*)Next; Next += 0x000008 * sizeof(UINT16);
835
836 c355_obj_position = (UINT16*)Next; Next += 0x000400;
837
838 RamEnd = Next;
839
840 SpritePrio = Next; Next += 512 * 512;
841 SpriteBitmap = (UINT16*)Next; Next += 512 * 512 * sizeof(UINT32);
842 roz_dirty_tile = (INT32*)Next; Next += 256 * 256 * sizeof(INT32);
843 roz_bitmap = (UINT16*)Next; Next += ((256 * 16) * (256 * 16) * sizeof(UINT16));
844
845 MemEnd = Next;
846
847 return 0;
848 }
849
DrvGfxDecode()850 static INT32 DrvGfxDecode()
851 {
852 INT32 Plane[8] = { STEP8(0,1) };
853 INT32 XOffs[16] = { STEP16(0,8) };
854 INT32 YOffs[16] = { STEP16(0,128) };
855
856 UINT8 *tmp = (UINT8*)BurnMalloc(0x1400000);
857 if (tmp == NULL) {
858 return 1;
859 }
860
861 memcpy (tmp, DrvGfxROM[0], 0x1400000);
862
863 GfxDecode(0x14000, 8, 16, 16, Plane, XOffs, YOffs, 0x800, tmp, DrvGfxROM[3]);
864
865 BurnFree(tmp);
866
867 for (INT32 i = 0; i < 0x1400000; i++) { // MAKE 16X16->32X32
868 DrvGfxROM[0][i] = DrvGfxROM[3][(i & 0xfffe0f) | ((i & 0x100) >> 4) | ((i & 0xf0) << 1)];
869 }
870
871 return 0;
872 }
873
DrvLoadRoms(bool bLoad)874 static INT32 DrvLoadRoms(bool bLoad)
875 {
876 char* pRomName;
877 struct BurnRomInfo ri;
878 UINT8 *pLoad[4] = { Drv68KROM, DrvMCUROM, DrvMCUData, Drv68KROM + 0x100000 };
879 UINT8 *gLoad[6] = { DrvGfxROM[0], DrvGfxROM[1], DrvGfxROM[2], DrvGfxROM[3], DrvGfxROM[4], DrvGfxROM[5] };
880 UINT8 *sLoad[1] = { DrvSndROM };
881
882 for (INT32 i = 0; !BurnDrvGetRomName(&pRomName, i, 0); i++) {
883 BurnDrvGetRomInfo(&ri, i);
884
885 if ((ri.nType & BRF_PRG) && (ri.nType & 0xf) == 1) {
886 if (bLoad) {
887 if (BurnLoadRomExt(pLoad[(ri.nType & 0xf) - 1] + 0x000002, i+0, 4, LD_GROUP(2) | LD_BYTESWAP)) return 1;
888 if (BurnLoadRomExt(pLoad[(ri.nType & 0xf) - 1] + 0x000000, i+1, 4, LD_GROUP(2) | LD_BYTESWAP)) return 1;
889 }
890 pLoad[(ri.nType & 0xf) - 1] += ri.nLen * 2;
891 i++;
892 continue;
893 }
894
895 if ((ri.nType & BRF_GRA) && (ri.nType & 0xf) == 1) {
896 if (bLoad) {
897 if (BurnLoadRomExt(gLoad[(ri.nType & 0xf) - 1] + 0x0000000, i+0, 4, LD_GROUP(2))) return 1;
898 if (BurnLoadRomExt(gLoad[(ri.nType & 0xf) - 1] + 0x0000002, i+1, 4, LD_GROUP(2))) return 1;
899 }
900 gLoad[(ri.nType & 0xf) - 1] += ri.nLen * 2;
901 i++;
902 continue;
903 }
904
905 if ((ri.nType & BRF_SND) && (ri.nType & 0xf) == 1) {
906 if (bLoad) {
907 if (BurnLoadRom(sLoad[(ri.nType & 0xf) - 1], i, 1)) return 1;
908 }
909 sLoad[(ri.nType & 0xf) - 1] += ri.nLen;
910 continue;
911 }
912
913 if ((ri.nType & BRF_PRG) && (ri.nType & 0xf) > 1) {
914 if (bLoad) {
915 if (BurnLoadRom(pLoad[(ri.nType & 0xf) - 1], i, 1)) return 1;
916 }
917 pLoad[(ri.nType & 0xf) - 1] += ri.nLen;
918 continue;
919 }
920
921 if ((ri.nType & BRF_PRG) && (ri.nType & 0xf) == 0) { // nvram!
922 if (bLoad) {
923 bprintf(0, _T("Loaded NVRAM from romset..\n"));
924 if (BurnLoadRom(DrvNVRAM, i, 1)) return 1;
925 BurnByteswap(DrvNVRAM, 0x800);
926 }
927 continue;
928 }
929
930 if ((ri.nType & BRF_GRA) && (ri.nType & 0xf) > 1) {
931 if (bLoad) {
932 if (BurnLoadRom(gLoad[(ri.nType & 0xf) - 1], i, 1)) return 1;
933 }
934 gLoad[(ri.nType & 0xf) - 1] += ri.nLen;
935 continue;
936 }
937 }
938
939 if (bLoad) DrvGfxDecode();
940
941 return 0;
942 }
943
common_mcu_init()944 static void common_mcu_init()
945 {
946 M377Init(0, M37702);
947 M377Open(0);
948 M377MapMemory(DrvShareRAM, 0x004000, 0x00bfff, MAP_ROM);
949 M377MapMemory(DrvMCUROM, 0x00c000, 0x00ffff, MAP_ROM);
950 M377MapMemory(DrvMCUData, 0x200000, 0x27ffff, MAP_ROM);
951 M377SetWritePortHandler(mcu_write_port);
952 M377SetReadPortHandler(mcu_read_port);
953 M377SetWriteByteHandler(mcu_write_byte);
954 M377SetWriteWordHandler(mcu_write_word);
955 M377SetReadByteHandler(mcu_read_byte);
956 M377SetReadWordHandler(mcu_read_word);
957 M377Close();
958
959 c352_init(48384000 / 2, 288, DrvSndROM, 0x1000000, 0);
960 c352_set_sync(M377TotalCycles, (16128000 / 2));
961 }
962
outfxies_sprite_bank_callback(INT32 tile)963 static INT32 outfxies_sprite_bank_callback(INT32 tile)
964 {
965 INT32 bank = DrvSprBank[8 + (((tile >> 11) & 7) ^ 1)] & 0x5f;
966 bank = (bank & 0x19) | ((bank & 2) << 1) | ((bank & 0x44) >> 1);
967 return (tile & 0x7ff) | (bank << 11);
968 }
969
outfxies_tile_bank_callback(INT32 * tile,INT32 * mask)970 static void outfxies_tile_bank_callback(INT32 *tile, INT32 *mask)
971 {
972 *mask = *tile; // not swapped
973 *tile = (*tile & 0xfebf) | ((*tile & 0x100) >> 2) | ((*tile & 0x40) << 2);
974 }
975
outfxies_roz_tile_callback(INT32 * tile,INT32 * mask_tile,INT32 which)976 static void outfxies_roz_tile_callback(INT32 *tile, INT32 *mask_tile, INT32 which)
977 {
978 INT32 bank = DrvRozBank[((which * 8) + (*tile >> 11)) ^ 1];
979 INT32 code = (*tile & 0x7ff) | (bank << 11);
980 *mask_tile = code;
981 *tile = (code & 0x7ffaf) | ((code & 0x40) >> 2) | ((code & 0x10) << 2);
982 }
983
machbrkr_sprite_bank_callback(INT32 tile)984 static INT32 machbrkr_sprite_bank_callback(INT32 tile)
985 {
986 INT32 bank = DrvSprBank[8 + (((tile >> 11) & 7) ^ 1)];
987 bank = (bank & 0x1f) | ((bank & 0x40) >> 1);
988 return (tile & 0x7ff) | (bank << 11);
989 }
990
machbrkr_tile_bank_callback(INT32 * tile,INT32 * mask)991 static void machbrkr_tile_bank_callback(INT32 *tile, INT32 *mask)
992 {
993 INT32 bank = DrvTileBank[((*tile >> 13) + 8) ^ 1];
994 *mask = (*tile & 0x1fff) | (bank << 13);
995 *tile = *mask;
996 }
997
machbrkr_roz_tile_callback(INT32 * tile,INT32 * mask_tile,INT32 which)998 static void machbrkr_roz_tile_callback(INT32 *tile, INT32 *mask_tile, INT32 which)
999 {
1000 INT32 bank = DrvRozBank[((which * 8) + (*tile >> 11)) ^ 1];
1001 INT32 code = (*tile & 0x7ff) | (bank << 11);
1002 *mask_tile = code;
1003 *tile = code;
1004 }
1005
b1_sprite_bank_callback(INT32 tile)1006 static INT32 b1_sprite_bank_callback(INT32 tile)
1007 {
1008 UINT16 *sprbank = (UINT16*)DrvSprBank;
1009
1010 return (tile & 0x7ff) | (sprbank[(tile >> 11) & 7] << 11);
1011 }
1012
b1_tile_bank_callback(INT32 * tile,INT32 * mask)1013 static void b1_tile_bank_callback(INT32 *tile, INT32 *mask)
1014 {
1015 *mask = *tile;
1016 }
1017
b1_common_init()1018 static INT32 b1_common_init()
1019 {
1020 BurnAllocMemIndex();
1021
1022 if (DrvLoadRoms(true)) return 1;
1023
1024 SekInit(0, 0x68ec020);
1025 SekOpen(0);
1026 SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM);
1027 SekMapMemory(Drv68KRAM, 0x1c0000, 0x1cffff, MAP_RAM);
1028 SekMapMemory(DrvShareRAM, 0x200000, 0x207fff, MAP_RAM);
1029 SekMapMemory(DrvExtRAM, 0x208000, 0x2fffff, MAP_RAM);
1030 SekMapMemory(DrvNVRAM, 0x580000, 0x5807ff, MAP_RAM); // parallel eeprom
1031 SekMapMemory(DrvSprRAM, 0x600000, 0x61ffff, MAP_RAM);
1032 SekMapMemory((UINT8*)c355_obj_position, 0x620000, 0x6203ff, MAP_RAM); // 0-7 (rest is due to page size!)
1033 SekMapMemory(DrvC123RAM, 0x640000, 0x64ffff, MAP_RAM);
1034 SekMapMemory(DrvC123Ctrl, 0x660000, 0x6603ff, MAP_RAM); // 0-3f (rest is due to page size!)
1035 SekMapMemory(DrvSprBank, 0x680000, 0x6803ff, MAP_RAM); // 0-f (rest is due to page size!)
1036 SekSetWriteLongHandler(0, namconb1_main_write_long);
1037 SekSetWriteWordHandler(0, namconb1_main_write_word);
1038 SekSetWriteByteHandler(0, namconb1_main_write_byte);
1039 SekSetReadLongHandler(0, namconb1_main_read_long);
1040 SekSetReadWordHandler(0, namconb1_main_read_word);
1041 SekSetReadByteHandler(0, namconb1_main_read_byte);
1042 SekClose();
1043
1044 common_mcu_init();
1045
1046 GenericTilesInit();
1047
1048 c355_tile_callback = b1_sprite_bank_callback;
1049 c123_tile_callback = b1_tile_bank_callback;
1050
1051 DrvDoReset(1);
1052
1053 return 0;
1054 }
1055
b2_common_init()1056 static INT32 b2_common_init()
1057 {
1058 BurnAllocMemIndex();
1059
1060 if (DrvLoadRoms(true)) return 1;
1061
1062 SekInit(0, 0x68ec020);
1063 SekOpen(0);
1064 SekMapMemory(Drv68KROM, 0x000000, 0x0fffff, MAP_ROM);
1065 SekMapMemory(Drv68KRAM, 0x1c0000, 0x1cffff, MAP_RAM);
1066 SekMapMemory(DrvShareRAM, 0x200000, 0x207fff, MAP_RAM);
1067 SekMapMemory(DrvExtRAM, 0x208000, 0x2fffff, MAP_RAM);
1068 SekMapMemory(Drv68KROM + 0x100000, 0x400000, 0x4fffff, MAP_ROM);
1069 SekMapMemory(DrvSprRAM, 0x600000, 0x61ffff, MAP_RAM);
1070 SekMapMemory((UINT8*)c355_obj_position, 0x620000, 0x6203ff, MAP_RAM); // 0-7 (rest is due to page size!)
1071 SekMapMemory(DrvUnkRegs, 0x640000, 0x6403ff, MAP_RAM); // 0-f (rest is due to page size!)
1072 SekMapMemory(DrvC123RAM, 0x680000, 0x68ffff, MAP_RAM);
1073 SekMapMemory(DrvC123Ctrl, 0x6c0000, 0x6c03ff, MAP_RAM); // 0-3f (rest is due to page size!)
1074 SekMapMemory(DrvRozRAM, 0x700000, 0x71ffff, MAP_RAM);
1075 SekMapMemory(DrvRozCtrl, 0x740000, 0x7403ff, MAP_RAM); // 0-1f (rest is due to page size!)
1076 SekMapMemory(DrvSprBank, 0x900000, 0x9003ff, MAP_RAM); // 0-f (rest is due to page size!) - sprite bank is 8-f!!!
1077 SekMapMemory(DrvTileBank, 0x940000, 0x9403ff, MAP_RAM); // 0-f (rest is due to page size!)
1078 SekMapMemory(DrvRozBank, 0x980000, 0x9803ff, MAP_RAM); // 0-f (rest is due to page size!)
1079 SekMapMemory(DrvNVRAM, 0xa00000, 0xa007ff, MAP_RAM); // parallel eeprom
1080 SekSetWriteLongHandler(0, namconb2_main_write_long);
1081 SekSetWriteWordHandler(0, namconb2_main_write_word);
1082 SekSetWriteByteHandler(0, namconb2_main_write_byte);
1083 SekSetReadLongHandler(0, namconb2_main_read_long);
1084 SekSetReadWordHandler(0, namconb2_main_read_word);
1085 SekSetReadByteHandler(0, namconb2_main_read_byte);
1086 SekClose();
1087
1088 common_mcu_init();
1089
1090 GenericTilesInit();
1091 c169_roz_init(DrvRozRAM, DrvRozCtrl, roz_bitmap);
1092
1093 DrvDoReset(1);
1094
1095 return 0;
1096 }
1097
guaranteed_rand()1098 static UINT16 guaranteed_rand()
1099 {
1100 INT32 trand;
1101
1102 do { trand = BurnRandom() & 0xffff; } while (trand == last_rand);
1103 last_rand = trand;
1104
1105 return trand;
1106 }
1107
nebulray_cuskey_callback(UINT32 offset)1108 static UINT32 nebulray_cuskey_callback(UINT32 offset)
1109 {
1110 switch (offset)
1111 {
1112 case 1: return 0x016e;
1113 case 3: return guaranteed_rand();
1114 }
1115
1116 return 0;
1117 }
1118
NebulrayInit()1119 static INT32 NebulrayInit()
1120 {
1121 cuskey_callback = nebulray_cuskey_callback;
1122
1123 return b1_common_init();
1124 }
1125
PtblankInit()1126 static INT32 PtblankInit()
1127 {
1128 has_gun = 1;
1129 BurnGunInit(2, true);
1130
1131 // no protection key
1132
1133 return b1_common_init();
1134 }
1135
gslgr94u_cuskey_callback(UINT32 offset)1136 static UINT32 gslgr94u_cuskey_callback(UINT32 offset)
1137 {
1138 switch (offset)
1139 {
1140 case 0: return 0x0167;
1141 case 1: return guaranteed_rand() << 16;
1142 }
1143
1144 return 0;
1145 }
1146
gslgr94j_cuskey_callback(UINT32 offset)1147 static UINT32 gslgr94j_cuskey_callback(UINT32 offset)
1148 {
1149 switch (offset)
1150 {
1151 case 1: return 0;
1152 case 3: return (0x0171 << 16) | guaranteed_rand();
1153 }
1154
1155 return 0;
1156 }
1157
sws95_cuskey_callback(UINT32 offset)1158 static UINT32 sws95_cuskey_callback(UINT32 offset)
1159 {
1160 switch (offset)
1161 {
1162 case 0: return 0x0189;
1163 case 1: return guaranteed_rand() << 16;
1164 }
1165
1166 return 0;
1167 }
1168
sws96_cuskey_callback(UINT32 offset)1169 static UINT32 sws96_cuskey_callback(UINT32 offset)
1170 {
1171 switch (offset)
1172 {
1173 case 0: return 0x01aa << 16;
1174 case 4: return guaranteed_rand() << 16;
1175 }
1176
1177 return 0;
1178 }
1179
sws97_cuskey_callback(UINT32 offset)1180 static UINT32 sws97_cuskey_callback(UINT32 offset)
1181 {
1182 switch (offset)
1183 {
1184 case 2: return 0x1b2 << 16;
1185 case 5: return guaranteed_rand() << 16;
1186 }
1187
1188 return 0;
1189 }
1190
vshoot_cuskey_callback(UINT32 offset)1191 static UINT32 vshoot_cuskey_callback(UINT32 offset)
1192 {
1193 switch (offset)
1194 {
1195 case 2: return guaranteed_rand() << 16;
1196 case 3: return 0x0170 << 16;
1197 }
1198
1199 return 0;
1200 }
1201
B1SportsInit(UINT32 (* cuskey)(UINT32))1202 static INT32 B1SportsInit(UINT32 (*cuskey)(UINT32))
1203 {
1204 cuskey_callback = cuskey;
1205
1206 return b1_common_init();
1207 }
1208
VshootInit()1209 static INT32 VshootInit()
1210 {
1211 cuskey_callback = vshoot_cuskey_callback;
1212
1213 return b1_common_init();
1214 }
1215
outfxies_cuskey_callback(UINT32 offset)1216 static UINT32 outfxies_cuskey_callback(UINT32 offset)
1217 {
1218 switch (offset)
1219 {
1220 case 0: return 0x0186;
1221 case 1: return guaranteed_rand() << 16;
1222 }
1223
1224 return 0;
1225 }
1226
OutfxiesInit()1227 static INT32 OutfxiesInit()
1228 {
1229 cuskey_callback = outfxies_cuskey_callback;
1230 c355_tile_callback = outfxies_sprite_bank_callback;
1231 c123_tile_callback = outfxies_tile_bank_callback;
1232 roz_tile_callback = outfxies_roz_tile_callback;
1233
1234 return b2_common_init();
1235 }
1236
OutfxiesjaInit()1237 static INT32 OutfxiesjaInit()
1238 {
1239 cuskey_callback = outfxies_cuskey_callback;
1240 c355_tile_callback = machbrkr_sprite_bank_callback;
1241 c123_tile_callback = machbrkr_tile_bank_callback;
1242 roz_tile_callback = machbrkr_roz_tile_callback;
1243
1244 INT32 rc = b2_common_init();
1245 if (!rc) { // shuffle soundrom (c352)
1246 UINT8 *tmp = (UINT8*)BurnMalloc(0x1000000);
1247 memcpy(tmp, DrvSndROM, 0x400000);
1248
1249 memcpy(DrvSndROM + 0x000000, tmp + 0x000000, 0x200000);
1250 memcpy(DrvSndROM + 0x400000, tmp + 0x000000, 0x200000);
1251 memcpy(DrvSndROM + 0x800000, tmp + 0x200000, 0x200000);
1252 memcpy(DrvSndROM + 0xc00000, tmp + 0x200000, 0x200000);
1253
1254 BurnFree(tmp);
1255 }
1256
1257 return rc;
1258 }
1259
MachbrkrInit()1260 static INT32 MachbrkrInit()
1261 {
1262 cuskey_callback = NULL;
1263 c355_tile_callback = machbrkr_sprite_bank_callback;
1264 c123_tile_callback = machbrkr_tile_bank_callback;
1265 roz_tile_callback = machbrkr_roz_tile_callback;
1266
1267 INT32 rc = b2_common_init();
1268 if (!rc) { // shuffle soundrom (c352)
1269 UINT8 *tmp = (UINT8*)BurnMalloc(0x1000000);
1270 memcpy(tmp, DrvSndROM, 0x400000);
1271
1272 memcpy(DrvSndROM + 0x000000, tmp + 0x000000, 0x200000);
1273 memcpy(DrvSndROM + 0x400000, tmp + 0x000000, 0x200000);
1274 memcpy(DrvSndROM + 0x800000, tmp + 0x200000, 0x200000);
1275 memcpy(DrvSndROM + 0xc00000, tmp + 0x200000, 0x200000);
1276
1277 BurnFree(tmp);
1278 }
1279
1280 return rc;
1281 }
1282
DrvExit()1283 static INT32 DrvExit()
1284 {
1285 GenericTilesExit();
1286
1287 SekExit();
1288 M377Exit();
1289 c352_exit();
1290
1291 BurnFreeMemIndex();
1292
1293 cuskey_callback = NULL;
1294 c123_tile_callback = NULL;
1295 c355_tile_callback = NULL;
1296 roz_tile_callback = NULL;
1297
1298 if (has_gun) {
1299 BurnGunExit();
1300 }
1301
1302 has_gun = 0;
1303
1304 return 0;
1305 }
1306
get_palette_register(INT32 reg)1307 static inline UINT16 get_palette_register(INT32 reg)
1308 {
1309 return DrvPalRegs[reg];
1310 }
1311
1312 #define restore_XY_clip(); \
1313 min_x = oldmin_x; \
1314 max_x = oldmax_x; \
1315 min_y = oldmin_y; \
1316 max_y = oldmax_y;
1317
adjust_clip()1318 static inline void adjust_clip()
1319 {
1320 if (min_x >= nScreenWidth) min_x = nScreenWidth-1;
1321 if (min_x < 2) min_x = 0; // weird. outfoxies, mach breakers clips the first column?
1322 if (max_x >= nScreenWidth) max_x = nScreenWidth-1;
1323 if (max_x < 0) max_x = 0;
1324 if (min_y >= nScreenHeight) min_y = nScreenHeight-1;
1325 if (min_y < 0) min_y = 0;
1326 if (max_y >= nScreenHeight) max_y = nScreenHeight-1;
1327 if (max_y < 0) max_y = 0;
1328 }
1329
apply_clip()1330 static void apply_clip()
1331 {
1332 min_x = get_palette_register(0) - 0x4a;
1333 max_x = get_palette_register(1) - 0x4a - 1;
1334 min_y = get_palette_register(2) - 0x21;
1335 max_y = get_palette_register(3) - 0x21 - 1;
1336
1337 adjust_clip();
1338 //bprintf (0, _T("Clip: %d, %d, %d, %d\n"), min_x, max_x, min_y, max_y);
1339
1340 GenericTilesSetClip(min_x, max_x, min_y, max_y);
1341 }
1342
draw_layer_with_masking_by_line(INT32 layer,INT32 color,INT32 line,INT32 priority)1343 static void draw_layer_with_masking_by_line(INT32 layer, INT32 color, INT32 line, INT32 priority)
1344 {
1345 if (line < min_y || line > max_y) return;
1346
1347 if (layer >= 6) return;
1348
1349 if ((nSpriteEnable & (1<<layer)) == 0) return;
1350
1351 INT32 x_offset_table[6] = { 44+4, 44+2, 44+1, 44+0, 0, 0 };
1352 INT32 offset[6] = { 0, 0x2000, 0x4000, 0x6000, 0x8010, 0x8810 };
1353
1354 UINT16 *ctrl = (UINT16*)DrvC123Ctrl;
1355 UINT16 *ram = (UINT16*)(DrvC123RAM + offset[layer]);
1356
1357 // layer dis-enable
1358 if (ctrl[0x10 + layer] & (1<<3)) return;
1359
1360 INT32 sizex = (layer < 4) ? 64 : 36;
1361 INT32 sizey = (layer < 4) ? 64 : 28;
1362
1363 INT32 sizex_full = sizex * 8;
1364 INT32 sizey_full = sizey * 8;
1365
1366 INT32 flipscreen = (BURN_ENDIAN_SWAP_INT16(ctrl[1]) & 0x8000) ? 0xffff : 0;
1367
1368 INT32 x_offset = x_offset_table[layer];
1369 INT32 y_offset = (layer < 4) ? 24 : 0;
1370
1371 INT32 scrollx = ((BURN_ENDIAN_SWAP_INT16(ctrl[1 + layer * 4]) + x_offset) ^ flipscreen) % sizex_full;
1372 INT32 scrolly = ((BURN_ENDIAN_SWAP_INT16(ctrl[3 + layer * 4]) + y_offset) ^ flipscreen) % sizey_full;
1373
1374 if (flipscreen) {
1375 scrolly += 256 + 16;
1376 scrollx += 256;
1377
1378 scrollx %= sizex_full;
1379 scrolly %= sizey_full;
1380 }
1381
1382 if (layer >= 4) {
1383 scrollx = scrolly = 0;
1384 }
1385
1386 color = ((color & 7) * 256) + 0x1000;
1387
1388 INT32 sy = (scrolly + line) % sizey_full;
1389
1390 UINT16 *dst = pTransDraw + (line * nScreenWidth);
1391 UINT8 *pri = pPrioDraw + (line * nScreenWidth);
1392
1393 for (INT32 x = 0; x < nScreenWidth + 7; x+=8)
1394 {
1395 INT32 sx = (scrollx + x) % sizex_full;
1396
1397 INT32 offs = (sx / 8) + ((sy / 8) * sizex);
1398
1399 INT32 code = BURN_ENDIAN_SWAP_INT16(ram[offs]), mask_code = 0;
1400 c123_tile_callback(&code, &mask_code);
1401
1402 UINT8 *gfx = DrvGfxROM[1] + (code * 8 * 8);
1403 UINT8 *msk = DrvGfxROM[2] + (mask_code * 8);
1404
1405 gfx += (sy & 7) * 8;
1406 msk += (sy & 7);
1407
1408 INT32 zx = x - (sx & 7);
1409
1410 for (INT32 xx = 0; xx < 8; xx++, zx++)
1411 {
1412 if (zx < min_x || zx > max_x) continue;
1413
1414 if (*msk & (0x80 >> xx))
1415 {
1416 dst[zx] = gfx[xx] + color;
1417 pri[zx] = (priority & 0x1000) ? ((priority * 2) & 0xff) : (priority & 0xff);
1418 }
1419 }
1420 }
1421 }
1422
draw_layer_line(INT32 line,INT32 pri)1423 static void draw_layer_line(INT32 line, INT32 pri)
1424 {
1425 UINT16 *ctrl = (UINT16*)DrvC123Ctrl;
1426
1427 for (INT32 i = 0; i < 6; i++)
1428 {
1429 if((BURN_ENDIAN_SWAP_INT16(ctrl[0x10+i]) & 0xf) == (pri & 0xf))
1430 {
1431 INT32 layer_color = BURN_ENDIAN_SWAP_INT16(ctrl[0x18 + i]);
1432 if (nSpriteEnable & (1 << i)) draw_layer_with_masking_by_line(i, layer_color, line, pri);
1433 }
1434 }
1435 }
1436
zdrawgfxzoom(UINT8 * gfx,INT32 tile_size,UINT32 code,UINT32 color,INT32 flipx,INT32 flipy,INT32 sx,INT32 sy,INT32 scalex,INT32 scaley,INT32 priority,INT32 is_c355)1437 static void zdrawgfxzoom(UINT8 *gfx, INT32 tile_size, UINT32 code, UINT32 color, INT32 flipx, INT32 flipy, INT32 sx, INT32 sy, INT32 scalex, INT32 scaley, INT32 priority, INT32 is_c355)
1438 {
1439 if (!scalex || !scaley) return;
1440
1441 if (!max_x && !max_y) return; //nothing to draw (zdrawgfxzoom draws a 1x1 pixel at 0,0 if max_x and max_y are 0)
1442
1443 const UINT8 *source_base = gfx + (code * tile_size * tile_size);
1444 INT32 sprite_screen_height = (scaley*tile_size+0x8000)>>16;
1445 INT32 sprite_screen_width = (scalex*tile_size+0x8000)>>16;
1446 if (sprite_screen_width && sprite_screen_height)
1447 {
1448 INT32 dx = (tile_size<<16)/sprite_screen_width;
1449 INT32 dy = (tile_size<<16)/sprite_screen_height;
1450
1451 INT32 ex = sx+sprite_screen_width;
1452 INT32 ey = sy+sprite_screen_height;
1453
1454 INT32 x_index_base;
1455 INT32 y_index;
1456
1457 if( flipx )
1458 {
1459 x_index_base = (sprite_screen_width-1)*dx;
1460 dx = -dx;
1461 }
1462 else
1463 {
1464 x_index_base = 0;
1465 }
1466
1467 if( flipy )
1468 {
1469 y_index = (sprite_screen_height-1)*dy;
1470 dy = -dy;
1471 }
1472 else
1473 {
1474 y_index = 0;
1475 }
1476
1477 if( sx < min_x)
1478 { // clip left
1479 INT32 pixels = min_x-sx;
1480 sx += pixels;
1481 x_index_base += pixels*dx;
1482 }
1483 if( sy < min_y )
1484 { // clip top
1485 INT32 pixels = min_y-sy;
1486 sy += pixels;
1487 y_index += pixels*dy;
1488 }
1489 if( ex > max_x+1 )
1490 { // clip right
1491 INT32 pixels = ex-max_x-1;
1492 ex -= pixels;
1493 }
1494 if( ey > max_y+1 )
1495 { // clip bottom
1496 INT32 pixels = ey-max_y-1;
1497 ey -= pixels;
1498 }
1499
1500 if (!(ex > sx)) return;
1501
1502 for (INT32 y = sy; y < ey; y++)
1503 {
1504 const UINT8 *source = source_base + (y_index>>16) * tile_size;
1505 UINT16 *dest = SpriteBitmap + y * nScreenWidth;
1506 UINT8 *pri2 = SpritePrio + y * nScreenWidth;
1507 INT32 x, x_index = x_index_base;
1508
1509 for (x = sx; x < ex; x++)
1510 {
1511 INT32 c = source[x_index>>16];
1512 if (c != 0xff)
1513 {
1514 dest[x] = c | color;
1515
1516 pri2[x] = priority;
1517 }
1518 x_index += dx;
1519 }
1520 y_index += dy;
1521 }
1522 }
1523 }
1524
c355_obj_draw_sprite(const UINT16 * pSource,INT32 zpos)1525 static void c355_obj_draw_sprite(const UINT16 *pSource, INT32 zpos)
1526 {
1527 UINT16 *spriteram16 = (UINT16*)DrvSprRAM3;
1528 const UINT16 *spriteformat16 = &spriteram16[0x4000/2];
1529 const UINT16 *spritetile16 = &spriteram16[0x8000/2];
1530
1531 UINT16 palette = BURN_ENDIAN_SWAP_INT16(pSource[6]);
1532
1533 INT32 pri = (palette >> 4) & 0xf;
1534
1535 UINT16 linkno = BURN_ENDIAN_SWAP_INT16(pSource[0]);
1536 UINT16 offset = BURN_ENDIAN_SWAP_INT16(pSource[1]);
1537 INT32 hpos = BURN_ENDIAN_SWAP_INT16(pSource[2]);
1538 INT32 vpos = BURN_ENDIAN_SWAP_INT16(pSource[3]);
1539 UINT16 hsize = BURN_ENDIAN_SWAP_INT16(pSource[4]);
1540 UINT16 vsize = BURN_ENDIAN_SWAP_INT16(pSource[5]);
1541
1542 if (linkno*4>=0x4000/2) return;
1543
1544 INT32 xscroll = (INT16)c355_obj_position[1];
1545 INT32 yscroll = (INT16)c355_obj_position[0];
1546 xscroll &= 0x1ff; if( xscroll & 0x100 ) xscroll |= ~0x1ff;
1547 yscroll &= 0x1ff; if( yscroll & 0x100 ) yscroll |= ~0x1ff;
1548 xscroll += 0x26;
1549 yscroll += 0x19;
1550
1551 hpos -= xscroll;
1552 vpos -= yscroll;
1553 const UINT16 *pWinAttr = &spriteram16[0x2400/2+((palette>>8)&0xf)*4];
1554
1555 INT32 oldmin_x = min_x;
1556 INT32 oldmax_x = max_x;
1557 INT32 oldmin_y = min_y;
1558 INT32 oldmax_y = max_y;
1559 min_x = BURN_ENDIAN_SWAP_INT16(pWinAttr[0]) - xscroll;
1560 max_x = BURN_ENDIAN_SWAP_INT16(pWinAttr[1]) - xscroll - 1; // -dink (machbrkr clipping player attract pic)
1561 min_y = BURN_ENDIAN_SWAP_INT16(pWinAttr[2]) - yscroll;
1562 max_y = BURN_ENDIAN_SWAP_INT16(pWinAttr[3]) - yscroll;
1563 adjust_clip(); // make sane
1564
1565 if (min_x < oldmin_x) min_x = oldmin_x;
1566 if (max_x > oldmax_x) max_x = oldmax_x;
1567 if (min_y < oldmin_y) min_y = oldmin_y;
1568 if (max_y > oldmax_y) max_y = oldmax_y;
1569
1570 hpos&=0x7ff; if( hpos&0x400 ) hpos |= ~0x7ff; /* sign extend */
1571 vpos&=0x7ff; if( vpos&0x400 ) vpos |= ~0x7ff; /* sign extend */
1572
1573 INT32 tile_index = BURN_ENDIAN_SWAP_INT16(spriteformat16[linkno*4+0]);
1574 INT32 format = BURN_ENDIAN_SWAP_INT16(spriteformat16[linkno*4+1]);
1575 INT32 dx = BURN_ENDIAN_SWAP_INT16(spriteformat16[linkno*4+2]);
1576 INT32 dy = BURN_ENDIAN_SWAP_INT16(spriteformat16[linkno*4+3]);
1577 INT32 num_cols = (format>>4)&0xf;
1578 INT32 num_rows = (format)&0xf;
1579
1580 if( num_cols == 0 ) num_cols = 0x10;
1581 INT32 flipx = (hsize&0x8000)?1:0;
1582 hsize &= 0x3ff;
1583 if( hsize == 0 ) { restore_XY_clip(); return; }
1584 UINT32 zoomx = (hsize<<16)/(num_cols*16);
1585 dx = (dx*zoomx+0x8000)>>16;
1586 if( flipx )
1587 {
1588 hpos += dx;
1589 }
1590 else
1591 {
1592 hpos -= dx;
1593 }
1594
1595 if( num_rows == 0 ) num_rows = 0x10;
1596 INT32 flipy = (vsize&0x8000)?1:0;
1597 vsize &= 0x3ff;
1598 if( vsize == 0 ) { restore_XY_clip(); return; }
1599 UINT32 zoomy = (vsize<<16)/(num_rows*16);
1600 dy = (dy*zoomy+0x8000)>>16;
1601 if( flipy )
1602 {
1603 vpos += dy;
1604 }
1605 else
1606 {
1607 vpos -= dy;
1608 }
1609
1610 INT32 color = palette&0xf;
1611
1612 UINT32 source_height_remaining = num_rows*16;
1613 UINT32 screen_height_remaining = vsize;
1614 INT32 sy = vpos;
1615 for(INT32 row=0; row<num_rows; row++)
1616 {
1617 INT32 tile_screen_height = 16*screen_height_remaining/source_height_remaining;
1618 zoomy = (screen_height_remaining<<16)/source_height_remaining;
1619 if( flipy )
1620 {
1621 sy -= tile_screen_height;
1622 }
1623 UINT32 source_width_remaining = num_cols*16;
1624 UINT32 screen_width_remaining = hsize;
1625 INT32 sx = hpos;
1626 for(INT32 col=0; col<num_cols; col++)
1627 {
1628 INT32 tile_screen_width = 16*screen_width_remaining/source_width_remaining;
1629 zoomx = (screen_width_remaining<<16)/source_width_remaining;
1630 if( flipx )
1631 {
1632 sx -= tile_screen_width;
1633 }
1634 INT32 tile = BURN_ENDIAN_SWAP_INT16(spritetile16[tile_index++]);
1635
1636 if( (tile&0x8000)==0 )
1637 {
1638 INT32 size = 0;
1639
1640 tile = c355_tile_callback(tile);
1641
1642 zdrawgfxzoom( size ? DrvGfxROM[0] : DrvGfxROM[3], size ? 32 : 16, tile + offset, color * 256, flipx,flipy, sx, sy, zoomx, zoomy, pri, 1);
1643 }
1644
1645 if( !flipx )
1646 {
1647 sx += tile_screen_width;
1648 }
1649 screen_width_remaining -= tile_screen_width;
1650 source_width_remaining -= 16;
1651 }
1652 if( !flipy )
1653 {
1654 sy += tile_screen_height;
1655 }
1656 screen_height_remaining -= tile_screen_height;
1657 source_height_remaining -= 16;
1658 }
1659
1660 restore_XY_clip();
1661 }
1662
c355_obj_draw_list(const UINT16 * pSpriteList16,const UINT16 * pSpriteTable)1663 static void c355_obj_draw_list(const UINT16 *pSpriteList16, const UINT16 *pSpriteTable)
1664 {
1665 for (INT32 i = 0; i < 256; i++)
1666 {
1667 UINT16 which = BURN_ENDIAN_SWAP_INT16(pSpriteList16[i]);
1668 c355_obj_draw_sprite(&pSpriteTable[(which & 0xff) * 8], i);
1669 if (which & 0x100) break;
1670 }
1671 }
1672
c355_predraw_sprites()1673 static void c355_predraw_sprites()
1674 {
1675 UINT16 *m_c355_obj_ram = (UINT16*)DrvSprRAM3;
1676
1677 memset(SpritePrio, 0, nScreenWidth * nScreenHeight);
1678 memset(SpriteBitmap, 0xff, nScreenWidth * nScreenHeight * sizeof(UINT32));
1679
1680 c355_obj_draw_list(&m_c355_obj_ram[0x02000/2], &m_c355_obj_ram[0x00000/2]);
1681 c355_obj_draw_list(&m_c355_obj_ram[0x14000/2], &m_c355_obj_ram[0x10000/2]);
1682 }
1683
c355_draw_sprite_line(INT32 line,INT32 priority)1684 static void c355_draw_sprite_line(INT32 line, INT32 priority)
1685 {
1686 if (line < min_y || line > max_y) return;
1687
1688 UINT16 *src = SpriteBitmap + line * nScreenWidth;
1689 UINT16 *dest = pTransDraw + line * nScreenWidth;
1690 UINT8 *pri = SpritePrio + line * nScreenWidth;
1691
1692 for (INT32 x = 0; x < nScreenWidth; x++) {
1693 if (x < min_x || x > max_x) continue;
1694
1695 if (pri[x] == priority && src[x] != 0xffff) {
1696 if ((src[x] & 0xff) != 0xff) {
1697 if (src[x] == 0xffe) { // apply palette offset (shadow palette)
1698 dest[x] |= 0x800; // gslgr94u, sws97, j-league prefer 0x800 (was 0x2000) -dink
1699 } else {
1700 dest[x] = src[x];
1701 }
1702 }
1703 }
1704 }
1705 }
1706
predraw_c169_roz_bitmap()1707 static void predraw_c169_roz_bitmap()
1708 {
1709 UINT16 *ram = (UINT16*)DrvRozRAM;
1710
1711 for (INT32 offs = 0; offs < 256 * 256; offs++)
1712 {
1713 INT32 sx = (offs & 0xff);
1714 INT32 sy = (offs / 0x100);
1715
1716 INT32 ofst;
1717 if (sx >= 128) {
1718 ofst = (sx & 0x7f) + ((sy + 0x100) * 0x80);
1719 } else {
1720 ofst = sx + (sy * 0x80);
1721 }
1722
1723 INT32 code = BURN_ENDIAN_SWAP_INT16(ram[ofst]) & 0x3fff;
1724 INT32 code_mask = code;
1725 roz_tile_callback(&code, &code_mask, 0); // iq_132
1726
1727 if (code == BURN_ENDIAN_SWAP_INT16(roz_dirty_tile[ofst])) {
1728 continue;
1729 }
1730 roz_dirty_tile[ofst] = code;
1731
1732 sx *= 16;
1733 sy *= 16;
1734
1735 UINT8 *gfx = DrvGfxROM[4] + (code * 0x100);
1736 UINT8 *msk = DrvGfxROM[5] + (code_mask * 0x020);
1737
1738 UINT16 *dst = roz_bitmap + (sy * (256 * 16)) + sx;
1739
1740 for (INT32 y = 0; y < 16; y++, gfx+=16,msk+=2)
1741 {
1742 for (INT32 x = 0; x < 16; x++)
1743 {
1744 if (msk[x/8] & (0x80 >> (x & 7)))
1745 {
1746 dst[x] = BURN_ENDIAN_SWAP_INT16(gfx[x]) + 0x1800;
1747 } else {
1748 dst[x] = BURN_ENDIAN_SWAP_INT16(0x8000);
1749 }
1750 }
1751
1752 dst += (256 * 16);
1753 }
1754 }
1755 }
1756
DrvDrawBegin()1757 static void DrvDrawBegin()
1758 {
1759 if (DrvRecalc) {
1760 TotalReCarl();
1761 DrvRecalc = 0;
1762 }
1763
1764 if (roz_tile_callback) predraw_c169_roz_bitmap();
1765
1766 apply_clip();
1767
1768 BurnTransferClear(0x2000);
1769
1770 if (nBurnLayer & 1) c355_predraw_sprites();
1771 }
1772
DrvDrawLine(INT32 line)1773 static void DrvDrawLine(INT32 line)
1774 {
1775 if (roz_tile_callback) {
1776 for (INT32 pri = 0; pri < 16; pri++)
1777 {
1778 if (nBurnLayer & 2) c169_roz_draw(pri, line);
1779 if ((pri & 1) == 0) draw_layer_line(line, pri / 2);
1780 if (nBurnLayer & 1) c355_draw_sprite_line(line, pri);
1781 }
1782 } else {
1783 for (INT32 pri = 0; pri < 8; pri++)
1784 {
1785 draw_layer_line(line, pri);
1786 if (nBurnLayer & 1) c355_draw_sprite_line(line, pri);
1787 }
1788 }
1789 }
1790
DrvDrawEnd()1791 static void DrvDrawEnd()
1792 {
1793 BurnTransferCopy(DrvPalette);
1794
1795 if (has_gun) BurnGunDrawTargets();
1796 }
1797
DrvDraw()1798 static INT32 DrvDraw()
1799 {
1800 DrvDrawBegin();
1801
1802 for (INT32 i = 0; i < nScreenHeight; i++) {
1803 DrvDrawLine(i);
1804 }
1805
1806 DrvDrawEnd();
1807
1808 return 0;
1809 }
1810
cancel_opposing(UINT8 * inp)1811 static void cancel_opposing(UINT8 *inp)
1812 {
1813 if ((*inp & 0x03) == 0x00) *inp |= 0x03;
1814 if ((*inp & 0x0c) == 0x00) *inp |= 0x0c;
1815 }
1816
DrvFrame()1817 static INT32 DrvFrame()
1818 {
1819 if (DrvReset) {
1820 DrvDoReset(1);
1821 }
1822
1823 SekNewFrame();
1824 M377NewFrame();
1825
1826 {
1827 service.Toggle(DrvJoy5[1]); // toggle-check service mode
1828
1829 memset (DrvInputs, 0xff, sizeof(DrvInputs));
1830
1831 for (INT32 i = 0; i < 8; i++) {
1832 DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
1833 DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
1834 DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
1835 DrvInputs[3] ^= (DrvJoy4[i] & 1) << i;
1836 DrvInputs[4] ^= (DrvJoy5[i] & 1) << i;
1837 }
1838
1839 if (has_gun) {
1840 BurnGunMakeInputs(0, Analog[0], Analog[1]);
1841 BurnGunMakeInputs(1, Analog[2], Analog[3]);
1842 } else {
1843 cancel_opposing(&DrvInputs[0]);
1844 cancel_opposing(&DrvInputs[1]);
1845 cancel_opposing(&DrvInputs[2]);
1846 cancel_opposing(&DrvInputs[3]);
1847 }
1848 }
1849
1850 INT32 mult = 4;
1851 INT32 nInterleave = 264 * mult;
1852 INT32 nCyclesTotal[2] = { (INT32)(24192000 / 59.659091), (INT32)(16128000 / 2 / 59.659091) };
1853 INT32 nCyclesDone[2] = { nExtraCycles[0], nExtraCycles[1] };
1854
1855 SekOpen(0);
1856 M377Open(0);
1857 M377Idle(nExtraCycles[1]); // since we use CPU_RUN_SYNCINT
1858
1859 if (pBurnDraw) {
1860 DrvDrawBegin();
1861 }
1862
1863 for (INT32 i = 0; i < nInterleave; i++)
1864 {
1865 CPU_RUN(0, Sek);
1866
1867 INT32 cyc_then = M377TotalCycles();
1868
1869 if (mcu_halted == 0) {
1870 CPU_RUN_SYNCINT(1, M377);
1871 } else {
1872 CPU_IDLE_SYNCINT(1, M377);
1873 }
1874
1875 timer60hz -= M377TotalCycles() - cyc_then;
1876 if (timer60hz < 0) {
1877 timer60hz += 16128000 / 2 / 60.340909; // 60.00 + (60.00 - 59.659091) -dink
1878 M377SetIRQLine(M37710_LINE_IRQ0, CPU_IRQSTATUS_HOLD);
1879 M377SetIRQLine(M37710_LINE_IRQ2, CPU_IRQSTATUS_HOLD);
1880 }
1881
1882 if (((i&(mult-1))==0) && i/mult == (get_palette_register(5) - 32) && pos_irq_level) {
1883 SekSetIRQLine(pos_irq_level, CPU_IRQSTATUS_ACK);
1884 }
1885
1886 if (pBurnDraw && ((i&(mult-1))==1) && i/mult < nScreenHeight) {
1887 DrvDrawLine(i/mult);
1888 }
1889
1890 if (i == 224*mult) {
1891 // 2-frame sprite buffer
1892 memcpy(DrvSprRAM3, DrvSprRAM2, 0x20000);
1893 memcpy(DrvSprRAM2, DrvSprRAM, 0x20000);
1894
1895 if (vbl_irq_level) SekSetIRQLine(vbl_irq_level, CPU_IRQSTATUS_ACK);
1896
1897 if (pBurnDraw) {
1898 DrvDrawEnd();
1899 }
1900 }
1901 }
1902
1903 if (pBurnSoundOut) {
1904 c352_update(pBurnSoundOut, nBurnSoundLen);
1905 }
1906
1907 nExtraCycles[0] = nCyclesDone[0] - nCyclesTotal[0];
1908 nExtraCycles[1] = M377TotalCycles() - nCyclesTotal[1];
1909
1910 M377Close();
1911 SekClose();
1912
1913 return 0;
1914 }
1915
DrvScan(INT32 nAction,INT32 * pnMin)1916 static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
1917 {
1918 struct BurnArea ba;
1919
1920 if (pnMin) {
1921 *pnMin = 0x029702;
1922 }
1923 if (nAction & ACB_MEMORY_RAM) {
1924 memset(&ba, 0, sizeof(ba));
1925 ba.Data = AllRam;
1926 ba.nLen = RamEnd - AllRam;
1927 ba.szName = "All Ram";
1928 BurnAcb(&ba);
1929 }
1930
1931 if (nAction & ACB_NVRAM) {
1932 memset(&ba, 0, sizeof(ba));
1933 ba.Data = DrvNVRAM;
1934 ba.nLen = 0x00800;
1935 ba.szName = "NV RAM";
1936 BurnAcb(&ba);
1937 }
1938
1939 if (nAction & ACB_DRIVER_DATA) {
1940 SekScan(nAction);
1941 M377Scan(nAction);
1942
1943 c352_scan(nAction, pnMin);
1944
1945 SCAN_VAR(mcu_halted);
1946 SCAN_VAR(port6_data);
1947 SCAN_VAR(pos_irq_level);
1948 SCAN_VAR(unk_irq_level);
1949 SCAN_VAR(vbl_irq_level);
1950
1951 SCAN_VAR(timer60hz);
1952
1953 SCAN_VAR(last_rand);
1954
1955 service.Scan();
1956 if (has_gun) BurnGunScan();
1957
1958 BurnRandomScan(nAction);
1959
1960 SCAN_VAR(nExtraCycles);
1961 }
1962
1963 if (nAction & ACB_WRITE && ~nAction & ACB_RUNAHEAD) {
1964 ResetRozDirty();
1965 }
1966
1967 return 0;
1968 }
1969
1970 static struct BurnRomInfo emptyRomDesc[] = { { "", 0, 0, 0 }, }; // for bios handling
1971
1972 static struct BurnRomInfo namcoc75RomDesc[] = {
1973 { "c75.bin", 0x004000, 0x42f539a5, 2 | BRF_BIOS | BRF_PRG }, // C75 Internal ROM
1974 };
1975
1976 STD_ROM_PICK(namcoc75)
STD_ROM_FN(namcoc75)1977 STD_ROM_FN(namcoc75)
1978
1979 static INT32 namcoc75Init() {
1980 return 1;
1981 }
1982
1983 struct BurnDriver BurnDrvnamcoc75 = {
1984 "namcoc75", NULL, NULL, NULL, "1994",
1985 "Namco C75 (M37702) (Bios)\0", "BIOS only", "Namco", "NB-1 / NB-2",
1986 NULL, NULL, NULL, NULL,
1987 BDF_BOARDROM, 0, HARDWARE_MISC_POST90S, GBF_BIOS, 0,
1988 NULL, namcoc75RomInfo, namcoc75RomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
1989 namcoc75Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
1990 224, 288, 3, 4
1991 };
1992
1993
1994 // Nebulas Ray (World, NR2)
1995
1996 static struct BurnRomInfo nebulrayRomDesc[] = {
1997 { "nr2_mprl.15b", 0x080000, 0x0431b6d4, 1 | BRF_PRG | BRF_ESS }, // 0 68K Code
1998 { "nr2_mpru.13b", 0x080000, 0x049b97cb, 1 | BRF_PRG | BRF_ESS }, // 1
1999
2000 { "nr1-spr0", 0x020000, 0x1cc2b44b, 3 | BRF_PRG | BRF_ESS }, // 2 C75 Data
2001
2002 { "nr1-voi0", 0x200000, 0x332d5e26, 1 | BRF_SND }, // 3 C352 Samples
2003
2004 { "nr1obj0l", 0x200000, 0x0e99ef46, 1 | BRF_GRA }, // 4 C355 Sprite Data
2005 { "nr1obj0u", 0x200000, 0xfb82a881, 1 | BRF_GRA }, // 5
2006 { "nr1obj1l", 0x200000, 0xf7a898f0, 1 | BRF_GRA }, // 6
2007 { "nr1obj1u", 0x200000, 0x49d9dbd7, 1 | BRF_GRA }, // 7
2008 { "nr1obj2l", 0x200000, 0xb39871d1, 1 | BRF_GRA }, // 8
2009 { "nr1obj2u", 0x200000, 0x8c8205b1, 1 | BRF_GRA }, // 9
2010 { "nr1obj3l", 0x200000, 0xc90d13ae, 1 | BRF_GRA }, // 10
2011 { "nr1obj3u", 0x200000, 0xd5918c9e, 1 | BRF_GRA }, // 11
2012
2013 { "nr1-chr0", 0x100000, 0x8d5b54ea, 2 | BRF_GRA }, // 12 C123 Tiles
2014 { "nr1-chr1", 0x100000, 0xcd21630c, 2 | BRF_GRA }, // 13
2015 { "nr1-chr2", 0x100000, 0x70a11023, 2 | BRF_GRA }, // 14
2016 { "nr1-chr3", 0x100000, 0x8f4b1d51, 2 | BRF_GRA }, // 15
2017
2018 { "nr1-sha0", 0x080000, 0xca667e13, 3 | BRF_GRA }, // 16 C123 Tile Mask
2019
2020 { "c366.bin", 0x000020, 0x8c96f31d, 0 | BRF_OPT }, // 17 Unknown PROM
2021 };
2022
2023 STDROMPICKEXT(nebulray, nebulray, namcoc75)
2024 STD_ROM_FN(nebulray)
2025
2026 struct BurnDriver BurnDrvNebulray = {
2027 "nebulray", NULL, "namcoc75", NULL, "1994",
2028 "Nebulas Ray (World, NR2)\0", NULL, "Namco", "NB-1 / NB-2",
2029 NULL, NULL, NULL, NULL,
2030 BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2031 NULL, nebulrayRomInfo, nebulrayRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2032 NebulrayInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2033 224, 288, 3, 4
2034 };
2035
2036
2037 // Nebulas Ray (Japan, NR1)
2038
2039 static struct BurnRomInfo nebulrayjRomDesc[] = {
2040 { "nr1_mprl.15b", 0x080000, 0xfae5f62c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2041 { "nr1_mpru.13b", 0x080000, 0x42ef71f9, 1 | BRF_PRG | BRF_ESS }, // 1
2042
2043 { "nr1-spr0", 0x020000, 0x1cc2b44b, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2044
2045 { "nr1-voi0", 0x200000, 0x332d5e26, 1 | BRF_SND }, // 3 c352
2046
2047 { "nr1obj0l", 0x200000, 0x0e99ef46, 1 | BRF_GRA }, // 4 c355spr
2048 { "nr1obj0u", 0x200000, 0xfb82a881, 1 | BRF_GRA }, // 5
2049 { "nr1obj1l", 0x200000, 0xf7a898f0, 1 | BRF_GRA }, // 6
2050 { "nr1obj1u", 0x200000, 0x49d9dbd7, 1 | BRF_GRA }, // 7
2051 { "nr1obj2l", 0x200000, 0xb39871d1, 1 | BRF_GRA }, // 8
2052 { "nr1obj2u", 0x200000, 0x8c8205b1, 1 | BRF_GRA }, // 9
2053 { "nr1obj3l", 0x200000, 0xc90d13ae, 1 | BRF_GRA }, // 10
2054 { "nr1obj3u", 0x200000, 0xd5918c9e, 1 | BRF_GRA }, // 11
2055
2056 { "nr1-chr0", 0x100000, 0x8d5b54ea, 2 | BRF_GRA }, // 12 c123tmap
2057 { "nr1-chr1", 0x100000, 0xcd21630c, 2 | BRF_GRA }, // 13
2058 { "nr1-chr2", 0x100000, 0x70a11023, 2 | BRF_GRA }, // 14
2059 { "nr1-chr3", 0x100000, 0x8f4b1d51, 2 | BRF_GRA }, // 15
2060
2061 { "nr1-sha0", 0x080000, 0xca667e13, 3 | BRF_GRA }, // 16 c123tmap:mask
2062
2063 { "c366.bin", 0x000020, 0x8c96f31d, 0 | BRF_OPT }, // 17 Unknown PROM
2064 };
2065
2066 STDROMPICKEXT(nebulrayj, nebulrayj, namcoc75)
2067 STD_ROM_FN(nebulrayj)
2068
2069 struct BurnDriver BurnDrvNebulrayj = {
2070 "nebulrayj", "nebulray", "namcoc75", NULL, "1994",
2071 "Nebulas Ray (Japan, NR1)\0", NULL, "Namco", "NB-1 / NB-2",
2072 NULL, NULL, NULL, NULL,
2073 BDF_GAME_WORKING | BDF_ORIENTATION_VERTICAL | BDF_ORIENTATION_FLIPPED | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_VERSHOOT, 0,
2074 NULL, nebulrayjRomInfo, nebulrayjRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2075 NebulrayInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2076 224, 288, 3, 4
2077 };
2078
2079
2080 // Point Blank (World, GN2 Rev B, set 1)
2081
2082 static struct BurnRomInfo ptblankRomDesc[] = {
2083 { "gn2_mprlb.15b", 0x080000, 0xfe2d9425, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2084 { "gn2_mprub.13b", 0x080000, 0x3bf4985a, 1 | BRF_PRG | BRF_ESS }, // 1
2085
2086 { "gn1-spr0.5b", 0x080000, 0x71773811, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2087
2088 { "gn1-voi0.5j", 0x200000, 0x05477eb7, 1 | BRF_SND }, // 3 c352
2089
2090 { "gn1obj0l.ic1", 0x200000, 0x06722dc8, 1 | BRF_GRA }, // 4 c355spr
2091 { "gn1obj0u.ic2", 0x200000, 0xfcefc909, 1 | BRF_GRA }, // 5
2092 { "gn1obj1l.ic3", 0x200000, 0x48468df7, 1 | BRF_GRA }, // 6
2093 { "gn1obj1u.ic4", 0x200000, 0x3109a071, 1 | BRF_GRA }, // 7
2094
2095 { "gn1-chr0.8j", 0x100000, 0xa5c61246, 2 | BRF_GRA }, // 8 c123tmap
2096 { "gn1-chr1.9j", 0x100000, 0xc8c59772, 2 | BRF_GRA }, // 9
2097 { "gn1-chr2.10j", 0x100000, 0xdc96d999, 2 | BRF_GRA }, // 10
2098 { "gn1-chr3.11j", 0x100000, 0x4352c308, 2 | BRF_GRA }, // 11
2099
2100 { "gn1-sha0.5m", 0x080000, 0x86d4ff85, 3 | BRF_GRA }, // 12 c123tmap:mask
2101
2102 { "eeprom", 0x000800, 0x95760d0f, 0 | BRF_PRG | BRF_ESS }, // 13 eeprom
2103 };
2104
2105 STDROMPICKEXT(ptblank, ptblank, namcoc75)
2106 STD_ROM_FN(ptblank)
2107
2108 struct BurnDriver BurnDrvPtblank = {
2109 "ptblank", NULL, "namcoc75", NULL, "1994",
2110 "Point Blank (World, GN2 Rev B, set 1)\0", NULL, "Namco", "NB-1 / NB-2",
2111 NULL, NULL, NULL, NULL,
2112 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0,
2113 NULL, ptblankRomInfo, ptblankRomName, NULL, NULL, NULL, NULL, GunbuletInputInfo, GunbuletDIPInfo,
2114 PtblankInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2115 288, 224, 4, 3
2116 };
2117
2118
2119 // Point Blank (World, GN2 Rev B, set 2)
2120
2121 static struct BurnRomInfo ptblankaRomDesc[] = {
2122 { "nr3_spr0.15b", 0x080000, 0xfe2d9425, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2123 { "nr2_spr0.13b", 0x080000, 0x3bf4985a, 1 | BRF_PRG | BRF_ESS }, // 1
2124
2125 { "nr1_spr0.5b", 0x080000, 0xa0bde3fb, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2126
2127 { "nr4_spr0.5j", 0x200000, 0x05477eb7, 1 | BRF_SND }, // 3 c352
2128
2129 { "gn1obj0l.ic1", 0x200000, 0x06722dc8, 1 | BRF_GRA }, // 4 c355spr
2130 { "gn1obj0u.ic2", 0x200000, 0xfcefc909, 1 | BRF_GRA }, // 5
2131 { "gn1obj1l.ic3", 0x200000, 0x48468df7, 1 | BRF_GRA }, // 6
2132 { "gn1obj1u.ic4", 0x200000, 0x3109a071, 1 | BRF_GRA }, // 7
2133
2134 { "nr5_spr0.8j", 0x100000, 0xa5c61246, 2 | BRF_GRA }, // 8 c123tmap
2135 { "nr6_spr0.9j", 0x100000, 0xc8c59772, 2 | BRF_GRA }, // 9
2136 { "nr7_spr0.10j", 0x100000, 0xdc96d999, 2 | BRF_GRA }, // 10
2137 { "nr8_spr0.11j", 0x100000, 0x4352c308, 2 | BRF_GRA }, // 11
2138
2139 { "nr9_spr0.5m", 0x080000, 0x86d4ff85, 3 | BRF_GRA }, // 12 c123tmap:mask
2140
2141 { "eeprom", 0x000800, 0x95760d0f, 0 | BRF_PRG | BRF_ESS }, // 13 eeprom
2142 };
2143
2144 STDROMPICKEXT(ptblanka, ptblanka, namcoc75)
2145 STD_ROM_FN(ptblanka)
2146
2147 struct BurnDriver BurnDrvPtblanka = {
2148 "ptblanka", "ptblank", "namcoc75", NULL, "1994",
2149 "Point Blank (World, GN2 Rev B, set 2)\0", NULL, "Namco", "NB-1 / NB-2",
2150 NULL, NULL, NULL, NULL,
2151 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0,
2152 NULL, ptblankaRomInfo, ptblankaRomName, NULL, NULL, NULL, NULL, GunbuletInputInfo, GunbuletDIPInfo,
2153 PtblankInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2154 288, 224, 4, 3
2155 };
2156
2157
2158 // Gun Bullet (World, GN3 Rev B)
2159
2160 static struct BurnRomInfo gunbuletwRomDesc[] = {
2161 { "gn3_mprlb.15b", 0x080000, 0x9260fce5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2162 { "gn3_mprub.13b", 0x080000, 0x6c1ac697, 1 | BRF_PRG | BRF_ESS }, // 1
2163
2164 { "gn1-spr0.5b", 0x080000, 0x71773811, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2165
2166 { "gn1-voi0.5j", 0x200000, 0x05477eb7, 1 | BRF_SND }, // 3 c352
2167
2168 { "gn1obj0l.ic1", 0x200000, 0x06722dc8, 1 | BRF_GRA }, // 4 c355spr
2169 { "gn1obj0u.ic2", 0x200000, 0xfcefc909, 1 | BRF_GRA }, // 5
2170 { "gn1obj1l.ic3", 0x200000, 0x48468df7, 1 | BRF_GRA }, // 6
2171 { "gn1obj1u.ic4", 0x200000, 0x3109a071, 1 | BRF_GRA }, // 7
2172
2173 { "gn1-chr0.8j", 0x100000, 0xa5c61246, 2 | BRF_GRA }, // 8 c123tmap
2174 { "gn1-chr1.9j", 0x100000, 0xc8c59772, 2 | BRF_GRA }, // 9
2175 { "gn1-chr2.10j", 0x100000, 0xdc96d999, 2 | BRF_GRA }, // 10
2176 { "gn1-chr3.11j", 0x100000, 0x4352c308, 2 | BRF_GRA }, // 11
2177
2178 { "gn1-sha0.5m", 0x080000, 0x86d4ff85, 3 | BRF_GRA }, // 12 c123tmap:mask
2179
2180 { "eeprom", 0x000800, 0x95760d0f, 0 | BRF_PRG | BRF_ESS }, // 13 eeprom
2181 };
2182
2183 STDROMPICKEXT(gunbuletw, gunbuletw, namcoc75)
2184 STD_ROM_FN(gunbuletw)
2185
2186 struct BurnDriver BurnDrvGunbuletw = {
2187 "gunbuletw", "ptblank", "namcoc75", NULL, "1994",
2188 "Gun Bullet (World, GN3 Rev B)\0", NULL, "Namco", "NB-1 / NB-2",
2189 NULL, NULL, NULL, NULL,
2190 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0,
2191 NULL, gunbuletwRomInfo, gunbuletwRomName, NULL, NULL, NULL, NULL, GunbuletInputInfo, GunbuletDIPInfo,
2192 PtblankInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2193 288, 224, 4, 3
2194 };
2195
2196
2197 // Gun Bullet (Japan, GN1)
2198
2199 static struct BurnRomInfo gunbuletjRomDesc[] = {
2200 { "gn1_mprl.15b", 0x080000, 0xf99e309e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2201 { "gn1_mpru.13b", 0x080000, 0x72a4db07, 1 | BRF_PRG | BRF_ESS }, // 1
2202
2203 { "gn1_spr0.5b", 0x020000, 0x6836ba38, 2 | BRF_PRG | BRF_ESS }, // 2 c75data
2204
2205 { "gn1-voi0.5j", 0x200000, 0x05477eb7, 1 | BRF_SND }, // 3 c352
2206
2207 { "gn1obj0l.ic1", 0x200000, 0x06722dc8, 1 | BRF_GRA }, // 4 c355spr
2208 { "gn1obj0u.ic2", 0x200000, 0xfcefc909, 1 | BRF_GRA }, // 5
2209 { "gn1obj1l.ic3", 0x200000, 0x48468df7, 1 | BRF_GRA }, // 6
2210 { "gn1obj1u.ic4", 0x200000, 0x3109a071, 1 | BRF_GRA }, // 7
2211
2212 { "gn1-chr0.8j", 0x100000, 0xa5c61246, 2 | BRF_GRA }, // 8 c123tmap
2213 { "gn1-chr1.9j", 0x100000, 0xc8c59772, 2 | BRF_GRA }, // 9
2214 { "gn1-chr2.10j", 0x100000, 0xdc96d999, 2 | BRF_GRA }, // 10
2215 { "gn1-chr3.11j", 0x100000, 0x4352c308, 2 | BRF_GRA }, // 11
2216
2217 { "gn1-sha0.5m", 0x080000, 0x86d4ff85, 3 | BRF_GRA }, // 12 c123tmap:mask
2218
2219 { "eeprom", 0x000800, 0x95760d0f, 0 | BRF_PRG | BRF_ESS }, // 13 eeprom
2220 };
2221
2222 STDROMPICKEXT(gunbuletj, gunbuletj, namcoc75)
2223 STD_ROM_FN(gunbuletj)
2224
2225 struct BurnDriver BurnDrvGunbuletj = {
2226 "gunbuletj", "ptblank", "namcoc75", NULL, "1994",
2227 "Gun Bullet (Japan, GN1)\0", NULL, "Namco", "NB-1 / NB-2",
2228 NULL, NULL, NULL, NULL,
2229 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SHOOT, 0,
2230 NULL, gunbuletjRomInfo, gunbuletjRomName, NULL, NULL, NULL, NULL, GunbuletInputInfo, GunbuletDIPInfo,
2231 PtblankInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2232 288, 224, 4, 3
2233 };
2234
2235
2236 // Great Sluggers (Japan)
2237
2238 static struct BurnRomInfo gslugrsjRomDesc[] = {
2239 { "gs1mprl.15b", 0x080000, 0x1e6c3626, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2240 { "gs1mpru.13b", 0x080000, 0xef355179, 1 | BRF_PRG | BRF_ESS }, // 1
2241
2242 { "gs1spr0.5b", 0x080000, 0x561ea20f, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2243
2244 { "gs1voi-0.5j", 0x200000, 0x6f8262aa, 1 | BRF_SND }, // 3 c352
2245
2246 { "gs1obj-0.ic1", 0x200000, 0x9a55238f, 1 | BRF_GRA }, // 4 c355spr
2247 { "gs1obj-1.ic2", 0x200000, 0x31c66f76, 1 | BRF_GRA }, // 5
2248
2249 { "gs1chr-0.8j", 0x100000, 0xe7ced86a, 2 | BRF_GRA }, // 6 c123tmap
2250 { "gs1chr-1.9j", 0x100000, 0x1fe46749, 2 | BRF_GRA }, // 7
2251 { "gs1chr-2.10j", 0x100000, 0xf53afa20, 2 | BRF_GRA }, // 8
2252 { "gs1chr-3.11j", 0x100000, 0xb149d7da, 2 | BRF_GRA }, // 9
2253
2254 { "gs1sha-0.5m", 0x080000, 0x8a2832fe, 3 | BRF_GRA }, // 10 c123tmap:mask
2255 };
2256
STDROMPICKEXT(gslugrsj,gslugrsj,namcoc75)2257 STDROMPICKEXT(gslugrsj, gslugrsj, namcoc75)
2258 STD_ROM_FN(gslugrsj)
2259
2260 static INT32 GslugrsjInit()
2261 {
2262 return B1SportsInit(gslgr94u_cuskey_callback);
2263 }
2264
2265 struct BurnDriver BurnDrvGslugrsj = {
2266 "gslugrsj", NULL, "namcoc75", NULL, "1993",
2267 "Great Sluggers (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2268 NULL, NULL, NULL, NULL,
2269 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2270 NULL, gslugrsjRomInfo, gslugrsjRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2271 GslugrsjInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2272 288, 224, 4, 3
2273 };
2274
2275
2276 // Great Sluggers '94
2277
2278 static struct BurnRomInfo gslgr94uRomDesc[] = {
2279 { "gse2mprl.15b", 0x080000, 0xa514349c, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2280 { "gse2mpru.13b", 0x080000, 0xb6afd238, 1 | BRF_PRG | BRF_ESS }, // 1
2281
2282 { "gse2spr0.bin", 0x020000, 0x17e87cfc, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2283
2284 { "gse-voi0.bin", 0x200000, 0xd3480574, 1 | BRF_SND }, // 3 c352
2285
2286 { "gseobj0l.bin", 0x200000, 0x531520ca, 1 | BRF_GRA }, // 4 c355spr
2287 { "gseobj0u.bin", 0x200000, 0xfcc1283c, 1 | BRF_GRA }, // 5
2288
2289 { "gse-chr0.bin", 0x100000, 0x9314085d, 2 | BRF_GRA }, // 6 c123tmap
2290 { "gse-chr1.bin", 0x100000, 0xc128a887, 2 | BRF_GRA }, // 7
2291 { "gse-chr2.bin", 0x100000, 0x48f0a311, 2 | BRF_GRA }, // 8
2292 { "gse-chr3.bin", 0x100000, 0xadbd1f88, 2 | BRF_GRA }, // 9
2293
2294 { "gse-sha0.bin", 0x080000, 0x6b2beabb, 3 | BRF_GRA }, // 10 c123tmap:mask
2295 };
2296
STDROMPICKEXT(gslgr94u,gslgr94u,namcoc75)2297 STDROMPICKEXT(gslgr94u, gslgr94u, namcoc75)
2298 STD_ROM_FN(gslgr94u)
2299
2300 static INT32 Gslgr94uInit()
2301 {
2302 return B1SportsInit(gslgr94u_cuskey_callback);
2303 }
2304
2305 struct BurnDriver BurnDrvGslgr94u = {
2306 "gslgr94u", NULL, "namcoc75", NULL, "1994",
2307 "Great Sluggers '94\0", NULL, "Namco", "NB-1 / NB-2",
2308 NULL, NULL, NULL, NULL,
2309 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2310 NULL, gslgr94uRomInfo, gslgr94uRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2311 Gslgr94uInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2312 288, 224, 4, 3
2313 };
2314
2315
2316 // Great Sluggers '94 (Japan)
2317
2318 static struct BurnRomInfo gslgr94jRomDesc[] = {
2319 { "gs41mprl.15b", 0x080000, 0x5759bdb5, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2320 { "gs41mpru.13b", 0x080000, 0x78bde1e7, 1 | BRF_PRG | BRF_ESS }, // 1
2321
2322 { "gs41spr0.5b", 0x080000, 0x3e2b6d55, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2323
2324 { "gs4voi0.5j", 0x200000, 0xc3053a90, 1 | BRF_SND }, // 3 c352
2325
2326 { "gs4obj0l.bin", 0x200000, 0x3b499da0, 1 | BRF_GRA }, // 4 c355spr
2327 { "gs4obj0u.bin", 0x200000, 0x80016b50, 1 | BRF_GRA }, // 5
2328 { "gs4obj1l.bin", 0x200000, 0x1f4847a7, 1 | BRF_GRA }, // 6
2329 { "gs4obj1u.bin", 0x200000, 0x49bc48cd, 1 | BRF_GRA }, // 7
2330
2331 { "gs4chr0.8j", 0x100000, 0x8c6c682e, 2 | BRF_GRA }, // 8 c123tmap
2332 { "gs4chr1.9j", 0x100000, 0x523989f7, 2 | BRF_GRA }, // 9
2333 { "gs4chr2.10j", 0x100000, 0x37569559, 2 | BRF_GRA }, // 10
2334 { "gs4chr3.11j", 0x100000, 0x73ca58f6, 2 | BRF_GRA }, // 11
2335
2336 { "gs4sha0.5m", 0x080000, 0x40e7e6a5, 3 | BRF_GRA }, // 12 c123tmap:mask
2337 };
2338
STDROMPICKEXT(gslgr94j,gslgr94j,namcoc75)2339 STDROMPICKEXT(gslgr94j, gslgr94j, namcoc75)
2340 STD_ROM_FN(gslgr94j)
2341
2342 static INT32 Gslgr94jInit()
2343 {
2344 return B1SportsInit(gslgr94j_cuskey_callback);
2345 }
2346
2347 struct BurnDriver BurnDrvGslgr94j = {
2348 "gslgr94j", "gslgr94u", "namcoc75", NULL, "1994",
2349 "Great Sluggers '94 (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2350 NULL, NULL, NULL, NULL,
2351 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2352 NULL, gslgr94jRomInfo, gslgr94jRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2353 Gslgr94jInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2354 288, 224, 4, 3
2355 };
2356
2357
2358 // Super World Stadium '95 (Japan)
2359
2360 static struct BurnRomInfo sws95RomDesc[] = {
2361 { "ss51mprl.bin", 0x080000, 0xc9e0107d, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2362 { "ss51mpru.bin", 0x080000, 0x0d93d261, 1 | BRF_PRG | BRF_ESS }, // 1
2363
2364 { "ss51spr0.bin", 0x080000, 0x71cb12f5, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2365
2366 { "ss51voi0.bin", 0x200000, 0x2740ec72, 1 | BRF_SND }, // 3 c352
2367
2368 { "ss51ob0l.bin", 0x200000, 0xe0395694, 1 | BRF_GRA }, // 4 c355spr
2369 { "ss51ob0u.bin", 0x200000, 0xb0745ca0, 1 | BRF_GRA }, // 5
2370
2371 { "ss51chr0.bin", 0x100000, 0x86dd3280, 2 | BRF_GRA }, // 6 c123tmap
2372 { "ss51chr1.bin", 0x100000, 0x2ba0fb9e, 2 | BRF_GRA }, // 7
2373 { "ss51chr2.bin", 0x100000, 0xca0e6c1a, 2 | BRF_GRA }, // 8
2374 { "ss51chr3.bin", 0x100000, 0x73ca58f6, 2 | BRF_GRA }, // 9
2375
2376 { "ss51sha0.bin", 0x080000, 0x3bf4d081, 3 | BRF_GRA }, // 10 c123tmap:mask
2377 };
2378
STDROMPICKEXT(sws95,sws95,namcoc75)2379 STDROMPICKEXT(sws95, sws95, namcoc75)
2380 STD_ROM_FN(sws95)
2381
2382 static INT32 Sws95Init()
2383 {
2384 return B1SportsInit(sws95_cuskey_callback);
2385 }
2386
2387 struct BurnDriver BurnDrvSws95 = {
2388 "sws95", NULL, "namcoc75", NULL, "1995",
2389 "Super World Stadium '95 (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2390 NULL, NULL, NULL, NULL,
2391 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2392 NULL, sws95RomInfo, sws95RomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2393 Sws95Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2394 288, 224, 4, 3
2395 };
2396
2397
2398 // Super World Stadium '96 (Japan)
2399
2400 static struct BurnRomInfo sws96RomDesc[] = {
2401 { "ss61mprl.bin", 0x080000, 0x06f55e73, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2402 { "ss61mpru.bin", 0x080000, 0x0abdbb83, 1 | BRF_PRG | BRF_ESS }, // 1
2403
2404 { "ss61spr0.bin", 0x080000, 0x71cb12f5, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2405
2406 { "ss61voi0.bin", 0x200000, 0x2740ec72, 1 | BRF_SND }, // 3 c352
2407
2408 { "ss61ob0l.bin", 0x200000, 0x579b19d4, 1 | BRF_GRA }, // 4 c355spr
2409 { "ss61ob0u.bin", 0x200000, 0xa69bbd9e, 1 | BRF_GRA }, // 5
2410
2411 { "ss61chr0.bin", 0x100000, 0x9d2ae07b, 2 | BRF_GRA }, // 6 c123tmap
2412 { "ss61chr1.bin", 0x100000, 0x4dc75da6, 2 | BRF_GRA }, // 7
2413 { "ss61chr2.bin", 0x100000, 0x1240704b, 2 | BRF_GRA }, // 8
2414 { "ss61chr3.bin", 0x100000, 0x066581d4, 2 | BRF_GRA }, // 9
2415
2416 { "ss61sha0.bin", 0x080000, 0xfceaa19c, 3 | BRF_GRA }, // 10 c123tmap:mask
2417 };
2418
STDROMPICKEXT(sws96,sws96,namcoc75)2419 STDROMPICKEXT(sws96, sws96, namcoc75)
2420 STD_ROM_FN(sws96)
2421
2422 static INT32 Sws96Init()
2423 {
2424 return B1SportsInit(sws96_cuskey_callback);
2425 }
2426
2427 struct BurnDriver BurnDrvSws96 = {
2428 "sws96", NULL, "namcoc75", NULL, "1996",
2429 "Super World Stadium '96 (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2430 NULL, NULL, NULL, NULL,
2431 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2432 NULL, sws96RomInfo, sws96RomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2433 Sws96Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2434 288, 224, 4, 3
2435 };
2436
2437
2438 // Super World Stadium '97 (Japan)
2439
2440 static struct BurnRomInfo sws97RomDesc[] = {
2441 { "ss71mprl.bin", 0x080000, 0xbd60b50e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2442 { "ss71mpru.bin", 0x080000, 0x3444f5a8, 1 | BRF_PRG | BRF_ESS }, // 1
2443
2444 { "ss71spr0.bin", 0x080000, 0x71cb12f5, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2445
2446 { "ss71voi0.bin", 0x200000, 0x2740ec72, 1 | BRF_SND }, // 3 c352
2447
2448 { "ss71ob0l.bin", 0x200000, 0x9559ad44, 1 | BRF_GRA }, // 4 c355spr
2449 { "ss71ob0u.bin", 0x200000, 0x4df4a722, 1 | BRF_GRA }, // 5
2450
2451 { "ss71chr0.bin", 0x100000, 0xbd606356, 2 | BRF_GRA }, // 6 c123tmap
2452 { "ss71chr1.bin", 0x100000, 0x4dc75da6, 2 | BRF_GRA }, // 7
2453 { "ss71chr2.bin", 0x100000, 0x1240704b, 2 | BRF_GRA }, // 8
2454 { "ss71chr3.bin", 0x100000, 0x066581d4, 2 | BRF_GRA }, // 9
2455
2456 { "ss71sha0.bin", 0x080000, 0xbe8c2758, 3 | BRF_GRA }, // 10 c123tmap:mask
2457 };
2458
STDROMPICKEXT(sws97,sws97,namcoc75)2459 STDROMPICKEXT(sws97, sws97, namcoc75)
2460 STD_ROM_FN(sws97)
2461
2462 static INT32 Sws97Init()
2463 {
2464 return B1SportsInit(sws97_cuskey_callback);
2465 }
2466
2467 struct BurnDriver BurnDrvSws97 = {
2468 "sws97", NULL, "namcoc75", NULL, "1997",
2469 "Super World Stadium '97 (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2470 NULL, NULL, NULL, NULL,
2471 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2472 NULL, sws97RomInfo, sws97RomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2473 Sws97Init, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2474 288, 224, 4, 3
2475 };
2476
2477
2478 // J-League Soccer V-Shoot (Japan)
2479
2480 static struct BurnRomInfo vshootRomDesc[] = {
2481 { "vsj1mprl.15b", 0x080000, 0x83a60d92, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2482 { "vsj1mpru.13b", 0x080000, 0xc63eb92d, 1 | BRF_PRG | BRF_ESS }, // 1
2483
2484 { "vsj1spr0.5b", 0x080000, 0xb0c71aa6, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2485
2486 { "vsjvoi-0.5j", 0x200000, 0x0528c9ed, 1 | BRF_SND }, // 3 c352
2487
2488 { "vsjobj0l.ic1", 0x200000, 0xe134faa7, 1 | BRF_GRA }, // 4 c355spr
2489 { "vsjobj0u.ic2", 0x200000, 0x974d0714, 1 | BRF_GRA }, // 5
2490 { "vsjobj1l.ic3", 0x200000, 0xba46f967, 1 | BRF_GRA }, // 6
2491 { "vsjobj1u.ic4", 0x200000, 0x09da7e9c, 1 | BRF_GRA }, // 7
2492
2493 { "vsjchr-0.8j", 0x100000, 0x2af8ba7c, 2 | BRF_GRA }, // 8 c123tmap
2494 { "vsjchr-1.9j", 0x100000, 0xb789d53e, 2 | BRF_GRA }, // 9
2495 { "vsjchr-2.10j", 0x100000, 0x7ef80758, 2 | BRF_GRA }, // 10
2496 { "vsjchr-3.11j", 0x100000, 0x73ca58f6, 2 | BRF_GRA }, // 11
2497
2498 { "vsjsha-0.5m", 0x080000, 0x78335ea4, 3 | BRF_GRA }, // 12 c123tmap:mask
2499 };
2500
2501 STDROMPICKEXT(vshoot, vshoot, namcoc75)
2502 STD_ROM_FN(vshoot)
2503
2504 struct BurnDriver BurnDrvVshoot = {
2505 "vshoot", NULL, "namcoc75", NULL, "1994",
2506 "J-League Soccer V-Shoot (Japan)\0", NULL, "Namco", "NB-1 / NB-2",
2507 NULL, NULL, NULL, NULL,
2508 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_SPORTSFOOTBALL, 0,
2509 NULL, vshootRomInfo, vshootRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2510 VshootInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2511 288, 224, 4, 3
2512 };
2513
2514
2515 // The Outfoxies (World, OU2)
2516
2517 static struct BurnRomInfo outfxiesRomDesc[] = {
2518 { "ou2_mprl.11c", 0x080000, 0xf414a32e, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2519 { "ou2_mpru.11d", 0x080000, 0xab5083fb, 1 | BRF_PRG | BRF_ESS }, // 1
2520
2521 { "ou1spr0.5b", 0x080000, 0x60cee566, 3 | BRF_PRG | BRF_ESS }, // 2 sndcpu
2522
2523 { "ou1voi0.6n", 0x200000, 0x2d8fb271, 1 | BRF_SND }, // 3 c352
2524
2525 { "ou1shas.12s", 0x200000, 0x9bcb0397, 3 | BRF_GRA }, // 4 c123tmap:mask
2526
2527 { "ou1shar.18s", 0x200000, 0xfbb48194, 6 | BRF_GRA }, // 5 c169roz:mask
2528
2529 { "ou1obj0l.4c", 0x200000, 0x1b4f7184, 1 | BRF_GRA }, // 6 c355spr
2530 { "ou1obj0u.8c", 0x200000, 0xd0a69794, 1 | BRF_GRA }, // 7
2531 { "ou1obj1l.4b", 0x200000, 0x48a93e84, 1 | BRF_GRA }, // 8
2532 { "ou1obj1u.8b", 0x200000, 0x999de386, 1 | BRF_GRA }, // 9
2533 { "ou1obj2l.4a", 0x200000, 0x30386cd0, 1 | BRF_GRA }, // 10
2534 { "ou1obj2u.8a", 0x200000, 0xccada5f8, 1 | BRF_GRA }, // 11
2535 { "ou1obj3l.6c", 0x200000, 0x5f41b44e, 1 | BRF_GRA }, // 12
2536 { "ou1obj3u.9c", 0x200000, 0xbc852c8e, 1 | BRF_GRA }, // 13
2537 { "ou1obj4l.6b", 0x200000, 0x99a5f9d7, 1 | BRF_GRA }, // 14
2538 { "ou1obj4u.9b", 0x200000, 0x70ecaabb, 1 | BRF_GRA }, // 15
2539
2540 { "ou1-rot0.3d", 0x200000, 0xa50c67c8, 5 | BRF_GRA }, // 16 c169roz
2541 { "ou1-rot1.3c", 0x200000, 0x14866780, 5 | BRF_GRA }, // 17
2542 { "ou1-rot2.3b", 0x200000, 0x55ccf3af, 5 | BRF_GRA }, // 18
2543
2544 { "ou1-scr0.1d", 0x200000, 0xb3b3f2e9, 2 | BRF_GRA }, // 19 c123tmap
2545
2546 { "ou1dat0.20a", 0x080000, 0x1a49aead, 4 | BRF_PRG | BRF_ESS }, // 20 data
2547 { "ou1dat1.20b", 0x080000, 0x63bb119d, 4 | BRF_PRG | BRF_ESS }, // 21
2548 };
2549
2550 STDROMPICKEXT(outfxies, outfxies, namcoc75)
2551 STD_ROM_FN(outfxies)
2552
2553 struct BurnDriver BurnDrvOutfxies = {
2554 "outfxies", NULL, "namcoc75", NULL, "1994",
2555 "The Outfoxies (World, OU2)\0", NULL, "Namco", "NB-1 / NB-2",
2556 NULL, NULL, NULL, NULL,
2557 BDF_GAME_WORKING, 2, HARDWARE_MISC_POST90S, GBF_RUNGUN, 0,
2558 NULL, outfxiesRomInfo, outfxiesRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2559 OutfxiesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2560 288, 224, 4, 3
2561 };
2562
2563
2564 // The Outfoxies (Japan, OU1)
2565
2566 static struct BurnRomInfo outfxiesjRomDesc[] = {
2567 { "ou1_mprl.11c", 0x080000, 0xd3b9e530, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2568 { "ou1_mpru.11d", 0x080000, 0xd98308fb, 1 | BRF_PRG | BRF_ESS }, // 1
2569
2570 { "ou1spr0.5b", 0x080000, 0x60cee566, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2571
2572 { "ou1voi0.6n", 0x200000, 0x2d8fb271, 1 | BRF_SND }, // 3 c352
2573
2574 { "ou1shas.12s", 0x200000, 0x9bcb0397, 3 | BRF_GRA }, // 4 c123tmap:mask
2575
2576 { "ou1shar.18s", 0x200000, 0xfbb48194, 6 | BRF_GRA }, // 5 c169roz:mask
2577
2578 { "ou1obj0l.4c", 0x200000, 0x1b4f7184, 1 | BRF_GRA }, // 6 c355spr
2579 { "ou1obj0u.8c", 0x200000, 0xd0a69794, 1 | BRF_GRA }, // 7
2580 { "ou1obj1l.4b", 0x200000, 0x48a93e84, 1 | BRF_GRA }, // 8
2581 { "ou1obj1u.8b", 0x200000, 0x999de386, 1 | BRF_GRA }, // 9
2582 { "ou1obj2l.4a", 0x200000, 0x30386cd0, 1 | BRF_GRA }, // 10
2583 { "ou1obj2u.8a", 0x200000, 0xccada5f8, 1 | BRF_GRA }, // 11
2584 { "ou1obj3l.6c", 0x200000, 0x5f41b44e, 1 | BRF_GRA }, // 12
2585 { "ou1obj3u.9c", 0x200000, 0xbc852c8e, 1 | BRF_GRA }, // 13
2586 { "ou1obj4l.6b", 0x200000, 0x99a5f9d7, 1 | BRF_GRA }, // 14
2587 { "ou1obj4u.9b", 0x200000, 0x70ecaabb, 1 | BRF_GRA }, // 15
2588
2589 { "ou1-rot0.3d", 0x200000, 0xa50c67c8, 5 | BRF_GRA }, // 16 c169roz
2590 { "ou1-rot1.3c", 0x200000, 0x14866780, 5 | BRF_GRA }, // 17
2591 { "ou1-rot2.3b", 0x200000, 0x55ccf3af, 5 | BRF_GRA }, // 18
2592
2593 { "ou1-scr0.1d", 0x200000, 0xb3b3f2e9, 2 | BRF_GRA }, // 19 c123tmap
2594
2595 { "ou1dat0.20a", 0x080000, 0x1a49aead, 4 | BRF_PRG | BRF_ESS }, // 20 data
2596 { "ou1dat1.20b", 0x080000, 0x63bb119d, 4 | BRF_PRG | BRF_ESS }, // 21
2597 };
2598
2599 STDROMPICKEXT(outfxiesj, outfxiesj, namcoc75)
2600 STD_ROM_FN(outfxiesj)
2601
2602 struct BurnDriver BurnDrvOutfxiesj = {
2603 "outfxiesj", "outfxies", "namcoc75", NULL, "1994",
2604 "The Outfoxies (Japan, OU1)\0", NULL, "Namco", "NB-1 / NB-2",
2605 NULL, NULL, NULL, NULL,
2606 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RUNGUN, 0,
2607 NULL, outfxiesjRomInfo, outfxiesjRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2608 OutfxiesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2609 288, 224, 4, 3
2610 };
2611
2612
2613 // The Outfoxies (Japan, OU1, alternate GFX ROMs)
2614 // this set uses different "c355spr", "c169roz" and "c123tmap" region ROMs. The rest of the ROMs is identical. It was found on 2 different PCB sets.
2615
2616 static struct BurnRomInfo outfxiesjaRomDesc[] = {
2617 { "ou1_mprl.11c", 0x080000, 0xd3b9e530, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2618 { "ou1_mpru.11d", 0x080000, 0xd98308fb, 1 | BRF_PRG | BRF_ESS }, // 1
2619
2620 { "ou1spr0.5b", 0x080000, 0x60cee566, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2621
2622 { "ou1voi0.6n", 0x200000, 0x2d8fb271, 1 | BRF_SND }, // 3 c352
2623
2624 { "ou1shas.12s", 0x200000, 0x9bcb0397, 3 | BRF_GRA }, // 4 c123tmap:mask
2625
2626 { "ou1shar.18s", 0x200000, 0xfbb48194, 6 | BRF_GRA }, // 5 c169roz:mask
2627
2628 { "ou1obj0l.4c", 0x200000, 0xecf135e4, 1 | BRF_GRA }, // 6 c355spr
2629 { "ou1obj0u.8c", 0x200000, 0x229fe774, 1 | BRF_GRA }, // 7
2630 { "ou1obj1l.4b", 0x200000, 0x0b9d060e, 1 | BRF_GRA }, // 8
2631 { "ou1obj1u.8b", 0x200000, 0x34a0feca, 1 | BRF_GRA }, // 9
2632 { "ou1obj2l.4a", 0x200000, 0x128119c4, 1 | BRF_GRA }, // 10
2633 { "ou1obj2u.8a", 0x200000, 0xce74c385, 1 | BRF_GRA }, // 11
2634 { "ou1obj3l.6c", 0x200000, 0x39d9aa54, 1 | BRF_GRA }, // 12
2635 { "ou1obj3u.9c", 0x200000, 0x022f4a73, 1 | BRF_GRA }, // 13
2636 { "ou1obj4l.6b", 0x200000, 0xb26fbb92, 1 | BRF_GRA }, // 14
2637 { "ou1obj4u.9b", 0x200000, 0xad99607d, 1 | BRF_GRA }, // 15
2638
2639 { "ou1-rot0.3d", 0x200000, 0x30511ffb, 5 | BRF_GRA }, // 16 c169roz
2640 { "ou1-rot1.3c", 0x200000, 0xf4b61c22, 5 | BRF_GRA }, // 17
2641 { "ou1-rot2.3b", 0x200000, 0xd48b29d8, 5 | BRF_GRA }, // 18
2642
2643 { "ou1-scr0.1d", 0x200000, 0x692b63f8, 2 | BRF_GRA }, // 19 c123tmap
2644
2645 { "ou1dat0.20a", 0x080000, 0x1a49aead, 4 | BRF_PRG | BRF_ESS }, // 20 data
2646 { "ou1dat1.20b", 0x080000, 0x63bb119d, 4 | BRF_PRG | BRF_ESS }, // 21
2647 };
2648
2649 STDROMPICKEXT(outfxiesja, outfxiesja, namcoc75)
2650 STD_ROM_FN(outfxiesja)
2651
2652 struct BurnDriver BurnDrvOutfxiesja = {
2653 "outfxiesja", "outfxies", "namcoc75", NULL, "1994",
2654 "The Outfoxies (Japan, OU1, alternate GFX ROMs)\0", NULL, "Namco", "NB-1 / NB-2",
2655 NULL, NULL, NULL, NULL,
2656 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RUNGUN, 0,
2657 NULL, outfxiesjaRomInfo, outfxiesjaRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2658 OutfxiesjaInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2659 288, 224, 4, 3
2660 };
2661
2662
2663 // The Outfoxies (Korea?)
2664
2665 static struct BurnRomInfo outfxiesaRomDesc[] = {
2666 { "mprl.11c", 0x080000, 0x22cd638d, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2667 { "mpru.11d", 0x080000, 0xa50f1cf9, 1 | BRF_PRG | BRF_ESS }, // 1
2668
2669 { "ou1spr0.5b", 0x080000, 0x60cee566, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2670
2671 { "ou1voi0.6n", 0x200000, 0x2d8fb271, 1 | BRF_SND }, // 3 c352
2672
2673 { "ou1shas.12s", 0x200000, 0x9bcb0397, 3 | BRF_GRA }, // 4 c123tmap:mask
2674
2675 { "ou1shar.18s", 0x200000, 0xfbb48194, 6 | BRF_GRA }, // 5 c169roz:mask
2676
2677 { "ou1obj0l.4c", 0x200000, 0x1b4f7184, 1 | BRF_GRA }, // 6 c355spr
2678 { "ou1obj0u.8c", 0x200000, 0xd0a69794, 1 | BRF_GRA }, // 7
2679 { "ou1obj1l.4b", 0x200000, 0x48a93e84, 1 | BRF_GRA }, // 8
2680 { "ou1obj1u.8b", 0x200000, 0x999de386, 1 | BRF_GRA }, // 9
2681 { "ou1obj2l.4a", 0x200000, 0x30386cd0, 1 | BRF_GRA }, // 10
2682 { "ou1obj2u.8a", 0x200000, 0xccada5f8, 1 | BRF_GRA }, // 11
2683 { "ou1obj3l.6c", 0x200000, 0x5f41b44e, 1 | BRF_GRA }, // 12
2684 { "ou1obj3u.9c", 0x200000, 0xbc852c8e, 1 | BRF_GRA }, // 13
2685 { "ou1obj4l.6b", 0x200000, 0x99a5f9d7, 1 | BRF_GRA }, // 14
2686 { "ou1obj4u.9b", 0x200000, 0x70ecaabb, 1 | BRF_GRA }, // 15
2687
2688 { "ou1-rot0.3d", 0x200000, 0xa50c67c8, 5 | BRF_GRA }, // 16 c169roz
2689 { "ou1-rot1.3c", 0x200000, 0x14866780, 5 | BRF_GRA }, // 17
2690 { "ou1-rot2.3b", 0x200000, 0x55ccf3af, 5 | BRF_GRA }, // 18
2691
2692 { "ou1-scr0.1d", 0x200000, 0xb3b3f2e9, 2 | BRF_GRA }, // 19 c123tmap
2693
2694 { "ou1dat0.20a", 0x080000, 0x1a49aead, 4 | BRF_PRG | BRF_ESS }, // 20 data
2695 { "ou1dat1.20b", 0x080000, 0x63bb119d, 4 | BRF_PRG | BRF_ESS }, // 21
2696 };
2697
2698 STDROMPICKEXT(outfxiesa, outfxiesa, namcoc75)
2699 STD_ROM_FN(outfxiesa)
2700
2701 struct BurnDriver BurnDrvOutfxiesa = {
2702 "outfxiesa", "outfxies", "namcoc75", NULL, "1994",
2703 "The Outfoxies (Korea?)\0", NULL, "Namco", "NB-1 / NB-2",
2704 NULL, NULL, NULL, NULL,
2705 BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_POST90S, GBF_RUNGUN, 0,
2706 NULL, outfxiesaRomInfo, outfxiesaRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2707 OutfxiesInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2708 288, 224, 4, 3
2709 };
2710
2711
2712 // Mach Breakers (World, MB2)
2713
2714 static struct BurnRomInfo machbrkrRomDesc[] = {
2715 { "mb2_mprl.11c", 0x080000, 0x81e2c566, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2716 { "mb2_mpru.11d", 0x080000, 0xe8ccec89, 1 | BRF_PRG | BRF_ESS }, // 1
2717
2718 { "mb1_spr0.5b", 0x080000, 0xd10f6272, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2719
2720 { "mb1_voi0.6n", 0x200000, 0xd363ca3b, 1 | BRF_SND }, // 3 c352
2721 { "mb1_voi1.6p", 0x200000, 0x7e1c2603, 1 | BRF_SND }, // 4
2722
2723 { "mb1_shas.12s", 0x100000, 0xc51c614b, 3 | BRF_GRA }, // 5 c123tmap:mask
2724
2725 { "mb1_shar.18s", 0x080000, 0xd9329b10, 6 | BRF_GRA }, // 6 c169roz:mask
2726
2727 { "mb1obj0l.4c", 0x200000, 0x056e6b1c, 1 | BRF_GRA }, // 7 c355spr
2728 { "mb1obj0u.8c", 0x200000, 0xe19b1714, 1 | BRF_GRA }, // 8
2729 { "mb1obj1l.4b", 0x200000, 0xaf69f7f1, 1 | BRF_GRA }, // 9
2730 { "mb1obj1u.8b", 0x200000, 0xe8ff9082, 1 | BRF_GRA }, // 10
2731 { "mb1obj2l.4a", 0x200000, 0x3a5c7379, 1 | BRF_GRA }, // 11
2732 { "mb1obj2u.8a", 0x200000, 0xb59cf5e0, 1 | BRF_GRA }, // 12
2733 { "mb1obj3l.6c", 0x200000, 0x9a765d58, 1 | BRF_GRA }, // 13
2734 { "mb1obj3u.9c", 0x200000, 0x5329c693, 1 | BRF_GRA }, // 14
2735 { "mb1obj4l.6b", 0x200000, 0xa650b05e, 1 | BRF_GRA }, // 15
2736 { "mb1obj4u.9b", 0x200000, 0x6d0c37e9, 1 | BRF_GRA }, // 16
2737
2738 { "mb1_rot0.3d", 0x200000, 0xbc353630, 5 | BRF_GRA }, // 17 c169roz
2739 { "mb1_rot1.3c", 0x200000, 0xcf7688cb, 5 | BRF_GRA }, // 18
2740
2741 { "mb1_scr0.1d", 0x200000, 0xc678d5f3, 2 | BRF_GRA }, // 19 c123tmap
2742 { "mb1_scr1.1c", 0x200000, 0xfb2b1939, 2 | BRF_GRA }, // 20
2743 { "mb1_scr2.1b", 0x200000, 0x0e6097a5, 2 | BRF_GRA }, // 21
2744
2745 { "mb1_dat0.20a", 0x080000, 0xfb2e3cd1, 4 | BRF_PRG | BRF_ESS }, // 22 data
2746 };
2747
2748 STDROMPICKEXT(machbrkr, machbrkr, namcoc75)
2749 STD_ROM_FN(machbrkr)
2750
2751 struct BurnDriver BurnDrvMachbrkr = {
2752 "machbrkr", NULL, "namcoc75", NULL, "1995",
2753 "Mach Breakers (World, MB2)\0", NULL, "Namco", "NB-1 / NB-2",
2754 NULL, NULL, NULL, NULL,
2755 BDF_GAME_WORKING, 4, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2756 NULL, machbrkrRomInfo, machbrkrRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2757 MachbrkrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2758 288, 224, 4, 3
2759 };
2760
2761
2762 // Mach Breakers - Numan Athletics 2 (Japan, MB1)
2763
2764 static struct BurnRomInfo machbrkrjRomDesc[] = {
2765 { "mb1_mprl.11c", 0x080000, 0x86cf0644, 1 | BRF_PRG | BRF_ESS }, // 0 maincpu
2766 { "mb1_mpru.11d", 0x080000, 0xfb1ff916, 1 | BRF_PRG | BRF_ESS }, // 1
2767
2768 { "mb1_spr0.5b", 0x080000, 0xd10f6272, 3 | BRF_PRG | BRF_ESS }, // 2 c75data
2769
2770 { "mb1_voi0.6n", 0x200000, 0xd363ca3b, 1 | BRF_SND }, // 3 c352
2771 { "mb1_voi1.6p", 0x200000, 0x7e1c2603, 1 | BRF_SND }, // 4
2772
2773 { "mb1_shas.12s", 0x100000, 0xc51c614b, 3 | BRF_GRA }, // 5 c123tmap:mask
2774
2775 { "mb1_shar.18s", 0x080000, 0xd9329b10, 6 | BRF_GRA }, // 6 c169roz:mask
2776
2777 { "mb1obj0l.4c", 0x200000, 0x056e6b1c, 1 | BRF_GRA }, // 7 c355spr
2778 { "mb1obj0u.8c", 0x200000, 0xe19b1714, 1 | BRF_GRA }, // 8
2779 { "mb1obj1l.4b", 0x200000, 0xaf69f7f1, 1 | BRF_GRA }, // 9
2780 { "mb1obj1u.8b", 0x200000, 0xe8ff9082, 1 | BRF_GRA }, // 10
2781 { "mb1obj2l.4a", 0x200000, 0x3a5c7379, 1 | BRF_GRA }, // 11
2782 { "mb1obj2u.8a", 0x200000, 0xb59cf5e0, 1 | BRF_GRA }, // 12
2783 { "mb1obj3l.6c", 0x200000, 0x9a765d58, 1 | BRF_GRA }, // 13
2784 { "mb1obj3u.9c", 0x200000, 0x5329c693, 1 | BRF_GRA }, // 14
2785 { "mb1obj4l.6b", 0x200000, 0xa650b05e, 1 | BRF_GRA }, // 15
2786 { "mb1obj4u.9b", 0x200000, 0x6d0c37e9, 1 | BRF_GRA }, // 16
2787
2788 { "mb1_rot0.3d", 0x200000, 0xbc353630, 5 | BRF_GRA }, // 17 c169roz
2789 { "mb1_rot1.3c", 0x200000, 0xcf7688cb, 5 | BRF_GRA }, // 18
2790
2791 { "mb1_scr0.1d", 0x200000, 0xc678d5f3, 2 | BRF_GRA }, // 19 c123tmap
2792 { "mb1_scr1.1c", 0x200000, 0xfb2b1939, 2 | BRF_GRA }, // 20
2793 { "mb1_scr2.1b", 0x200000, 0x0e6097a5, 2 | BRF_GRA }, // 21
2794
2795 { "mb1_dat0.20a", 0x080000, 0xfb2e3cd1, 4 | BRF_PRG | BRF_ESS }, // 22 data
2796 };
2797
2798 STDROMPICKEXT(machbrkrj, machbrkrj, namcoc75)
2799 STD_ROM_FN(machbrkrj)
2800
2801 struct BurnDriver BurnDrvMachbrkrj = {
2802 "machbrkrj", "machbrkr", "namcoc75", NULL, "1995",
2803 "Mach Breakers - Numan Athletics 2 (Japan, MB1)\0", NULL, "Namco", "NB-1 / NB-2",
2804 NULL, NULL, NULL, NULL,
2805 BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_MISC_POST90S, GBF_SPORTSMISC, 0,
2806 NULL, machbrkrjRomInfo, machbrkrjRomName, NULL, NULL, NULL, NULL, Namconb1InputInfo, Namconb1DIPInfo,
2807 MachbrkrInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x2000,
2808 288, 224, 4, 3
2809 };
2810