Previous 15994 Revisions Next

r5252 Thursday 16th July, 2009 at 11:42:06 UTC by Nathan Woods
Updated to MAME 0.132u5 core
[docs]messnew.txt
[src/emu]crsshair.c devintrf.c emu.mak emuopts.c emuopts.h fileio.h uimenu.c video.c
[src/emu/cpu/arm7]arm7.c arm7.h arm7core.c arm7core.h
[src/emu/machine]i8255a.c* i8255a.h* idectrl.c idectrl.h laserdsc.h ldcore.c ldpr8210.c ldv1000.c ldvp931.c
[src/lib/util]bitmap.c bitmap.h corefile.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]snk6502.c*
[src/mame/drivers]39in1.c blockout.c cb2001.c cliffhgr.c cmmb.c* cubocd32.c darkhors.c deco_ld.c* djmain.c galdrvr.c goldnpkr.c gottlieb.c jangou.c kaneko16.c ksys573.c legionna.c namcos2.c namcos22.c naomi.c ojankohs.c overdriv.c quakeat.c scobra.c scramble.c seta.c sg1000a.c snk6502.c* stfight.c taitogn.c tecmo.c tehkanwc.c tetrisp2.c timetrv.c* tmmjprd.c toypop.c viper.c
[src/mame/includes]snk6502.h*
[src/mame/machine]kaneko16.c namcos2.c
[src/mame/video]snk6502.c*
[src/mess]mess.mak
[src/osd/winui]mui_opts.c
[src/tools]split.c* tools.mak

src/mame/audio/snk6502.c
r0r5252
1/* from Andrew Scott (ascott@utkux.utcc.utk.edu) */
2
3/*
4  updated by BUT
5  - corrected music tempo (not confirmed Satan of Saturn and clone)
6  - adjusted music freq (except Satan of Saturn and clone)
7  - adjusted music waveform
8  - support playing flag for music channel 0
9  - support HD38880 speech by samples
10*/
11
12
13#include "driver.h"
14#include "streams.h"
15#include "sound/sn76477.h"
16#include "sound/samples.h"
17#include "snk6502.h"
18#include "sound/discrete.h"
19
20
21#ifndef M_LN2
22#define M_LN2      0.69314718055994530942
23#endif
24
25#define TONE_VOLUME   50
26#define CHANNELS   3
27
28#define SAMPLE_RATE   (48000)
29#define FRAC_BITS   16
30#define FRAC_ONE   (1 << FRAC_BITS)
31#define FRAC_MASK   (FRAC_ONE - 1)
32
33typedef struct tone
34{
35   int   mute;
36   int   offset;
37   int   base;
38   int   mask;
39   INT32   sample_rate;
40   INT32   sample_step;
41   INT32   sample_cur;
42   INT16   form[16];
43} TONE;
44
45static TONE tone_channels[CHANNELS];
46static INT32 tone_clock_expire;
47static INT32 tone_clock;
48static sound_stream * tone_stream;
49
50static int Sound0StopOnRollover;
51static UINT8 LastPort1;
52
53
54static const char *const sasuke_sample_names[] =
55{
56   "*sasuke",
57
58   // SN76477 and discrete
59   "hit.wav",
60   "boss_start.wav",
61   "shot.wav",
62   "boss_attack.wav",
63
64   0
65};
66
67const samples_interface sasuke_samples_interface =
68{
69   4,   /* 4 channels */
70   sasuke_sample_names
71};
72
73static const char *const vanguard_sample_names[] =
74{
75   "*vanguard",
76
77   // SN76477 and discrete
78   "fire.wav",
79   "explsion.wav",
80
81   // HD38880 speech
82   "vg_voi-0.wav",
83   "vg_voi-1.wav",
84   "vg_voi-2.wav",
85   "vg_voi-3.wav",
86   "vg_voi-4.wav",
87   "vg_voi-5.wav",
88   "vg_voi-6.wav",
89   "vg_voi-7.wav",
90   "vg_voi-8.wav",
91   "vg_voi-9.wav",
92   "vg_voi-a.wav",
93   "vg_voi-b.wav",
94   "vg_voi-c.wav",
95   "vg_voi-d.wav",
96   "vg_voi-e.wav",
97   "vg_voi-f.wav",
98
99   0
100};
101
102const samples_interface vanguard_samples_interface =
103{
104   3,   /* 3 channel */
105   vanguard_sample_names
106};
107
108static const char *const fantasy_sample_names[] =
109{
110   "*fantasy",
111
112   // HD38880 speech
113   "ft_voi-0.wav",
114   "ft_voi-1.wav",
115   "ft_voi-2.wav",
116   "ft_voi-3.wav",
117   "ft_voi-4.wav",
118   "ft_voi-5.wav",
119   "ft_voi-6.wav",
120   "ft_voi-7.wav",
121   "ft_voi-8.wav",
122   "ft_voi-9.wav",
123   "ft_voi-a.wav",
124   "ft_voi-b.wav",
125
126   0
127};
128
129const samples_interface fantasy_samples_interface =
130{
131   1,   /* 1 channel */
132   fantasy_sample_names
133};
134
135
136const sn76477_interface sasuke_sn76477_intf_1 =
137{
138   RES_K(470),      /*  4  noise_res     */
139   RES_K(150),      /*  5  filter_res    */
140   CAP_P(4700),   /*  6  filter_cap    */
141   RES_K(22),      /*  7  decay_res     */
142   CAP_U(10),      /*  8  attack_decay_cap  */
143   RES_K(10),      /* 10  attack_res    */
144   RES_K(100),      /* 11  amplitude_res     */
145   RES_K(47),      /* 12  feedback_res      */
146   0 /* NC */,      /* 16  vco_voltage   */
147   0 /* NC */,      /* 17  vco_cap       */
148   0 /* NC */,      /* 18  vco_res       */
149   0 /* NC */,      /* 19  pitch_voltage     */
150   RES_K(10),      /* 20  slf_res       */
151   0 /* NC */,      /* 21  slf_cap       */
152   CAP_U(2.2),      /* 23  oneshot_cap   */
153   RES_K(100),      /* 24  oneshot_res   */
154   0,             /* 22  vco                    */
155   0,             /* 26  mixer A           */
156   1,             /* 25  mixer B           */
157   0,             /* 27  mixer C           */
158   1,             /* 1   envelope 1        */
159   0,             /* 28  envelope 2        */
160   1             /* 9   enable (variable)      */
161
162   // ic48     GND: 2,22,26,27,28  +5V: 1,15,25
163};
164
165const sn76477_interface sasuke_sn76477_intf_2 =
166{
167   RES_K(340),      /*  4  noise_res     */
168   RES_K(47),      /*  5  filter_res    */
169   CAP_P(100),      /*  6  filter_cap    */
170   RES_K(470),      /*  7  decay_res     */
171   CAP_U(4.7),      /*  8  attack_decay_cap  */
172   RES_K(10),      /* 10  attack_res    */
173   RES_K(100),      /* 11  amplitude_res     */
174   RES_K(47),      /* 12  feedback_res      */
175   0 /* NC */,      /* 16  vco_voltage   */
176   CAP_P(220),      /* 17  vco_cap       */
177   RES_K(1000),   /* 18  vco_res       */
178   0 /* NC */,      /* 19  pitch_voltage     */
179   RES_K(220),      /* 20  slf_res       */
180   0 /* NC */,      /* 21  slf_cap       */
181   CAP_U(22),      /* 23  oneshot_cap   */
182   RES_K(47),      /* 24  oneshot_res   */
183   1,             /* 22  vco                    */
184   0,             /* 26  mixer A           */
185   1,             /* 25  mixer B           */
186   0,             /* 27  mixer C           */
187   1,             /* 1   envelope 1        */
188   1,             /* 28  envelope 2        */
189   1             /* 9   enable (variable)      */
190
191   // ic51     GND: 2,26,27        +5V: 1,15,22,25,28
192};
193
194const sn76477_interface sasuke_sn76477_intf_3 =
195{
196   RES_K(330),      /*  4  noise_res     */
197   RES_K(47),      /*  5  filter_res    */
198   CAP_P(100),      /*  6  filter_cap    */
199   RES_K(1),      /*  7  decay_res     */
200   0 /* NC */,      /*  8  attack_decay_cap  */
201   RES_K(1),      /* 10  attack_res    */
202   RES_K(100),      /* 11  amplitude_res     */
203   RES_K(47),      /* 12  feedback_res      */
204   0 /* NC */,      /* 16  vco_voltage   */
205   CAP_P(1000),   /* 17  vco_cap       */
206   RES_K(1000),   /* 18  vco_res       */
207   0 /* NC */,      /* 19  pitch_voltage     */
208   RES_K(10),      /* 20  slf_res       */
209   CAP_U(1),      /* 21  slf_cap       */
210   CAP_U(2.2),      /* 23  oneshot_cap   */
211   RES_K(150),      /* 24  oneshot_res   */
212   0,             /* 22  vco                    */
213   1,             /* 26  mixer A           */
214   1,             /* 25  mixer B           */
215   0,             /* 27  mixer C           */
216   1,             /* 1   envelope 1        */
217   0,             /* 28  envelope 2        */
218   1             /* 9   enable (variable)      */
219
220   // ic52     GND: 2,22,27,28     +5V: 1,15,25,26
221};
222
223const sn76477_interface satansat_sn76477_intf =
224{
225   RES_K(470),      /*  4  noise_res     */
226   RES_M(1.5),      /*  5  filter_res    */
227   CAP_P(220),      /*  6  filter_cap    */
228   0,            /*  7  decay_res     */
229   0,            /*  8  attack_decay_cap  */
230   0,            /* 10  attack_res    */
231   RES_K(47),      /* 11  amplitude_res     */
232   RES_K(47),      /* 12  feedback_res      */
233   0,            /* 16  vco_voltage   */
234   0,            /* 17  vco_cap       */
235   0,            /* 18  vco_res       */
236   0,            /* 19  pitch_voltage     */
237   0,            /* 20  slf_res       */
238   0,            /* 21  slf_cap       */
239   0,            /* 23  oneshot_cap   */
240   0,            /* 24  oneshot_res   */
241   0,             /* 22  vco                    */
242   0,             /* 26  mixer A           */
243   1,             /* 25  mixer B           */
244   0,             /* 27  mixer C           */
245   1,             /* 1   envelope 1        */
246   1,             /* 28  envelope 2        */
247   1             /* 9   enable (variable)      */
248
249   // ???      GND: 2,26,27        +5V: 15,25
250};
251
252const sn76477_interface vanguard_sn76477_intf_1 =
253{
254   RES_K(470),      /*  4  noise_res     */
255   RES_M(1.5),      /*  5  filter_res    */
256   CAP_P(220),      /*  6  filter_cap    */
257   0,            /*  7  decay_res     */
258   0,            /*  8  attack_decay_cap  */
259   0,            /* 10  attack_res    */
260   RES_K(47),      /* 11  amplitude_res     */
261   RES_K(4.7),      /* 12  feedback_res      */
262   0,            /* 16  vco_voltage   */
263   0,            /* 17  vco_cap       */
264   0,            /* 18  vco_res       */
265   0,            /* 19  pitch_voltage     */
266   0,            /* 20  slf_res       */
267   0,            /* 21  slf_cap       */
268   0,            /* 23  oneshot_cap   */
269   0,            /* 24  oneshot_res   */
270   0,             /* 22  vco                    */
271   0,            /* 26  mixer A           */
272   1,            /* 25  mixer B           */
273   0,            /* 27  mixer C           */
274   1,            /* 1   envelope 1        */
275   1,            /* 28  envelope 2        */
276   1             /* 9   enable (variable)      */
277
278   // SHOT A   GND: 2,9,26,27  +5V: 15,25
279};
280
281const sn76477_interface vanguard_sn76477_intf_2 =
282{
283   RES_K(10),      /*  4  noise_res     */
284   RES_K(30),      /*  5  filter_res    */
285   0,            /*  6  filter_cap    */
286   0,            /*  7  decay_res     */
287   0,            /*  8  attack_decay_cap  */
288   0,            /* 10  attack_res    */
289   RES_K(47),      /* 11  amplitude_res     */
290   RES_K(4.7),      /* 12  feedback_res      */
291   0,            /* 16  vco_voltage   */
292   0,            /* 17  vco_cap       */
293   0,            /* 18  vco_res       */
294   0,            /* 19  pitch_voltage     */
295   0,            /* 20  slf_res       */
296   0,            /* 21  slf_cap       */
297   0,            /* 23  oneshot_cap   */
298   0,            /* 24  oneshot_res   */
299   0,             /* 22  vco                    */
300   0,            /* 26  mixer A           */
301   1,            /* 25  mixer B           */
302   0,            /* 27  mixer C           */
303   0,            /* 1   envelope 1        */
304   1,            /* 28  envelope 2        */
305   1             /* 9   enable (variable)      */
306
307   // SHOT B   GND: 1,2,26,27  +5V: 15,25,28
308};
309
310const sn76477_interface fantasy_sn76477_intf =
311{
312   RES_K(470),      /*  4  noise_res     */
313   RES_M(1.5),      /*  5  filter_res    */
314   CAP_P(220),      /*  6  filter_cap    */
315   0,            /*  7  decay_res     */
316   0,            /*  8  attack_decay_cap  */
317   0,            /* 10  attack_res    */
318   RES_K(470),      /* 11  amplitude_res     */
319   RES_K(4.7),      /* 12  feedback_res      */
320   0,            /* 16  vco_voltage   */
321   0,            /* 17  vco_cap       */
322   0,            /* 18  vco_res       */
323   0,            /* 19  pitch_voltage     */
324   0,            /* 20  slf_res       */
325   0,            /* 21  slf_cap       */
326   0,            /* 23  oneshot_cap   */
327   0,            /* 24  oneshot_res   */
328   0,             /* 22  vco                    */
329   0,             /* 26  mixer A           */
330   1,             /* 25  mixer B           */
331   0,             /* 27  mixer C           */
332   /* schematic does not show pin 1 grounded, but it must be. */
333   /* otherwise it is using the VCO for the envelope, but the VCO is not hooked up */
334   0,             /* 1   envelope 1        */
335   1,             /* 28  envelope 2        */
336   0             /* 9   enable (variable)      */
337
338   // BOMB     GND:    2,9,26,27       +5V: 15,25
339};
340
341
342/************************************************************************
343 * fantasy Sound System Analog emulation
344 * July 2008, D. Renaud
345 ************************************************************************/
346
347static const discrete_op_amp_filt_info fantasy_filter =
348{
349   RES_K(10.5), 0, RES_K(33), 0, RES_K(470), CAP_U(.01), CAP_U(.01), 0, 0, 12, -12
350};
351
352#define FANTASY_BOMB_EN            NODE_01
353#define FANTASY_NOISE_STREAM_IN      NODE_02
354#define FANTASY_NOISE_LOGIC         NODE_03
355
356DISCRETE_SOUND_START( fantasy )
357
358   DISCRETE_INPUT_LOGIC (FANTASY_BOMB_EN)
359   DISCRETE_INPUT_STREAM(FANTASY_NOISE_STREAM_IN, 0)
360
361   /* This is not the perfect way to discharge, but it is good enough for now */
362   /* it does not take into acount that there is no discharge when noise is low */
363   DISCRETE_RCDISC2(NODE_10, FANTASY_BOMB_EN, 0, RES_K(10) + RES_K(33), DEFAULT_TTL_V_LOGIC_1 - 0.5, RES_K(1), CAP_U(1))
364   DISCRETE_CLAMP(FANTASY_NOISE_LOGIC, 1, FANTASY_NOISE_STREAM_IN, 0, 1, 0)
365   DISCRETE_SWITCH(NODE_11, 1, FANTASY_NOISE_LOGIC, 0, NODE_10)
366
367   DISCRETE_OP_AMP_FILTER(NODE_20, 1, NODE_11, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &fantasy_filter)
368   DISCRETE_RCFILTER(NODE_21, 1, NODE_20, RES_K(22), CAP_U(.01))
369   DISCRETE_RCFILTER(NODE_22, 1, NODE_21, RES_K(22) +  RES_K(22), CAP_P(2200))
370   DISCRETE_RCFILTER(NODE_23, 1, NODE_22, RES_K(22) + RES_K(22) +  RES_K(22), CAP_U(.001))
371
372   DISCRETE_OUTPUT(NODE_23, 32760.0/12)
373DISCRETE_SOUND_END
374
375
376INLINE void validate_tone_channel(running_machine *machine, int channel)
377{
378   if (!tone_channels[channel].mute)
379   {
380      UINT8 *ROM = memory_region(machine, "snk6502");
381      UINT8 romdata = ROM[tone_channels[channel].base + tone_channels[channel].offset];
382
383      if (romdata != 0xff)
384         tone_channels[channel].sample_step = tone_channels[channel].sample_rate / (256 - romdata);
385      else
386         tone_channels[channel].sample_step = 0;
387   }
388}
389
390static STREAM_UPDATE( snk6502_tone_update )
391{
392   stream_sample_t *buffer = outputs[0];
393   int i;
394
395   for (i = 0; i < CHANNELS; i++)
396      validate_tone_channel(device->machine, i);
397
398   while (samples-- > 0)
399   {
400      INT32 data = 0;
401
402      for (i = 0; i < CHANNELS; i++)
403      {
404         TONE *voice = &tone_channels[i];
405         INT16 *form = voice->form;
406
407         if (!voice->mute && voice->sample_step)
408         {
409            int cur_pos = voice->sample_cur + voice->sample_step;
410            int prev = form[(voice->sample_cur >> FRAC_BITS) & 15];
411            int cur = form[(cur_pos >> FRAC_BITS) & 15];
412
413            /* interpolate */
414            data += ((INT32)prev * (FRAC_ONE - (cur_pos & FRAC_MASK))
415                    + (INT32)cur * (cur_pos & FRAC_MASK)) >> FRAC_BITS;
416
417            voice->sample_cur = cur_pos;
418         }
419      }
420
421      *buffer++ = data;
422
423      tone_clock += FRAC_ONE;
424      if (tone_clock >= tone_clock_expire)
425      {
426         for (i = 0; i < CHANNELS; i++)
427         {
428            tone_channels[i].offset++;
429            tone_channels[i].offset &= tone_channels[i].mask;
430
431            validate_tone_channel(device->machine, i);
432         }
433
434         if (tone_channels[0].offset == 0 && Sound0StopOnRollover)
435            tone_channels[0].mute = 1;
436
437         tone_clock -= tone_clock_expire;
438      }
439
440   }
441}
442
443
444static void sasuke_build_waveform(int mask)
445{
446   int bit0, bit1, bit2, bit3;
447   int base;
448   int i;
449
450   mask &= 7;
451
452   //logerror("0: wave form = %d\n", mask);
453   bit0 = bit1 = bit3 = 0;
454   bit2 = 1;
455
456   if (mask & 1)
457      bit0 = 1;
458   if (mask & 2)
459      bit1 = 1;
460   if (mask & 4)
461      bit3 = 1;
462
463   base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
464
465   for (i = 0; i < 16; i++)
466   {
467      int data = 0;
468
469      if (i & 1)
470         data += bit0;
471      if (i & 2)
472         data += bit1;
473      if (i & 4)
474         data += bit2;
475      if (i & 8)
476         data += bit3;
477
478      //logerror(" %3d\n", data);
479      tone_channels[0].form[i] = data - base;
480   }
481
482   for (i = 0; i < 16; i++)
483      tone_channels[0].form[i] *= 65535 / 16;
484}
485
486static void satansat_build_waveform(int mask)
487{
488   int bit0, bit1, bit2, bit3;
489   int base;
490   int i;
491
492   mask &= 7;
493
494   //logerror("1: wave form = %d\n", mask);
495   bit0 = bit1 = bit2 = 1;
496   bit3 = 0;
497
498   if (mask & 1)
499      bit3 = 1;
500
501   base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
502
503   for (i = 0; i < 16; i++)
504   {
505      int data = 0;
506
507      if (i & 1)
508         data += bit0;
509      if (i & 2)
510         data += bit1;
511      if (i & 4)
512         data += bit2;
513      if (i & 8)
514         data += bit3;
515
516      //logerror(" %3d\n", data);
517      tone_channels[1].form[i] = data - base;
518   }
519
520   for (i = 0; i < 16; i++)
521      tone_channels[1].form[i] *= 65535 / 16;
522}
523
524static void build_waveform(int channel, int mask)
525{
526   int bit0, bit1, bit2, bit3;
527   int base;
528   int i;
529
530   mask &= 15;
531
532   //logerror("%d: wave form = %d\n", channel, mask);
533   bit0 = bit1 = bit2 = bit3 = 0;
534
535   // bit 3
536   if (mask & (1 | 2))
537      bit3 = 8;
538   else if (mask & 4)
539      bit3 = 4;
540   else if (mask & 8)
541      bit3 = 2;
542
543   // bit 2
544   if (mask & 4)
545      bit2 = 8;
546   else if (mask & (2 | 8))
547      bit2 = 4;
548
549   // bit 1
550   if (mask & 8)
551      bit1 = 8;
552   else if (mask & 4)
553      bit1 = 4;
554   else if (mask & 2)
555      bit1 = 2;
556
557   // bit 0
558   bit0 = bit1 / 2;
559
560   if (bit0 + bit1 + bit2 + bit3 < 16)
561   {
562      bit0 *= 2;
563      bit1 *= 2;
564      bit2 *= 2;
565      bit3 *= 2;
566   }
567
568   base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
569
570   for (i = 0; i < 16; i++)
571   {
572      /* special channel for fantasy */
573      if (channel == 2)
574      {
575         tone_channels[channel].form[i] = (i & 8) ? 7 : -8;
576      }
577      else
578      {
579         int data = 0;
580
581         if (i & 1)
582            data += bit0;
583         if (i & 2)
584            data += bit1;
585         if (i & 4)
586            data += bit2;
587         if (i & 8)
588            data += bit3;
589
590         //logerror(" %3d\n", data);
591         tone_channels[channel].form[i] = data - base;
592      }
593   }
594
595   for (i = 0; i < 16; i++)
596      tone_channels[channel].form[i] *= 65535 / 160;
597}
598
599void snk6502_set_music_freq(int freq)
600{
601   int i;
602
603   for (i = 0; i < CHANNELS; i++)
604   {
605      tone_channels[i].mute = 1;
606      tone_channels[i].offset = 0;
607      tone_channels[i].base = i * 0x800;
608      tone_channels[i].mask = 0xff;
609      tone_channels[i].sample_step = 0;
610      tone_channels[i].sample_cur = 0;
611      tone_channels[i].sample_rate = (double)(freq * 8) / SAMPLE_RATE * FRAC_ONE;
612
613      build_waveform(i, 1);
614   }
615}
616
617void snk6502_set_music_clock(double clock_time)
618{
619   tone_clock_expire = clock_time * SAMPLE_RATE * FRAC_ONE;
620   tone_clock = 0;
621}
622
623static DEVICE_START( snk6502_sound )
624{
625   // adjusted
626   snk6502_set_music_freq(43000);
627
628   // 38.99 Hz update (according to schematic)
629   snk6502_set_music_clock(M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));
630
631   tone_stream = stream_create(device, 0, 1, SAMPLE_RATE, NULL, snk6502_tone_update);
632}
633
634DEVICE_GET_INFO( snk6502_sound )
635{
636   switch (state)
637   {
638      /* --- the following bits of info are returned as pointers to data or functions --- */
639      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(snk6502_sound);   break;
640
641      /* --- the following bits of info are returned as NULL-terminated strings --- */
642      case DEVINFO_STR_NAME:                     strcpy(info->s, "snk6502 Custom");            break;
643      case DEVINFO_STR_SOURCE_FILE:                  strcpy(info->s, __FILE__);                  break;
644   }
645}
646
647int snk6502_music0_playing(void)
648{
649   return tone_channels[0].mute;
650}
651
652
653WRITE8_HANDLER( sasuke_sound_w )
654{
655   const device_config *samples = devtag_get_device(space->machine, "samples");
656   switch (offset)
657   {
658   case 0:
659      /*
660            bit description
661
662            0   hit (ic52)
663            1   boss start (ic51)
664            2   shot
665            3   boss attack (ic48?)
666            4   ??
667            5
668            6
669            7   reset counter
670        */
671
672      if ((~data & 0x01) && (LastPort1 & 0x01))
673         sample_start(samples, 0, 0, 0);
674      if ((~data & 0x02) && (LastPort1 & 0x02))
675         sample_start(samples, 1, 1, 0);
676      if ((~data & 0x04) && (LastPort1 & 0x04))
677         sample_start(samples, 2, 2, 0);
678      if ((~data & 0x08) && (LastPort1 & 0x08))
679         sample_start(samples, 3, 3, 0);
680
681      if ((data & 0x80) && (~LastPort1 & 0x80))
682      {
683         tone_channels[0].offset = 0;
684         tone_channels[0].mute = 0;
685      }
686
687      if ((~data & 0x80) && (LastPort1 & 0x80))
688         tone_channels[0].mute = 1;
689
690      LastPort1 = data;
691      break;
692
693   case 1:
694      /*
695            bit description
696
697            0
698            1   wave form
699            2   wave form
700            3   wave form
701            4   MUSIC A8
702            5   MUSIC A9
703            6   MUSIC A10
704            7
705        */
706
707      /* select tune in ROM based on sound command byte */
708      tone_channels[0].base = 0x0000 + ((data & 0x70) << 4);
709      tone_channels[0].mask = 0xff;
710
711      Sound0StopOnRollover = 1;
712
713      /* bit 1-3 sound0 waveform control */
714      sasuke_build_waveform((data & 0x0e) >> 1);
715      break;
716   }
717}
718
719WRITE8_HANDLER( satansat_sound_w )
720{
721   const device_config *samples = devtag_get_device(space->machine, "samples");
722   switch (offset)
723   {
724   case 0:
725      /*
726            bit description
727
728        */
729
730      /* bit 0 = analog sound trigger */
731
732      /* bit 1 = to 76477 */
733
734      /* bit 2 = analog sound trigger */
735      if (data & 0x04 && !(LastPort1 & 0x04))
736         sample_start(samples, 0, 1, 0);
737
738      if (data & 0x08)
739      {
740         tone_channels[0].mute = 1;
741         tone_channels[0].offset = 0;
742      }
743
744      /* bit 4-6 sound0 waveform control */
745      sasuke_build_waveform((data & 0x70) >> 4);
746
747      /* bit 7 sound1 waveform control */
748      satansat_build_waveform((data & 0x80) >> 7);
749
750      LastPort1 = data;
751      break;
752   case 1:
753      /*
754            bit description
755
756        */
757
758      /* select tune in ROM based on sound command byte */
759      tone_channels[0].base = 0x0000 + ((data & 0x0e) << 7);
760      tone_channels[0].mask = 0xff;
761      tone_channels[1].base = 0x0800 + ((data & 0x60) << 4);
762      tone_channels[1].mask = 0x1ff;
763
764      Sound0StopOnRollover = 1;
765
766      if (data & 0x01)
767         tone_channels[0].mute = 0;
768
769      if (data & 0x10)
770         tone_channels[1].mute = 0;
771      else
772      {
773         tone_channels[1].mute = 1;
774         tone_channels[1].offset = 0;
775      }
776
777      /* bit 7 = ? */
778      break;
779   }
780}
781
782WRITE8_HANDLER( vanguard_sound_w )
783{
784   const device_config *samples = devtag_get_device(space->machine, "samples");
785   switch (offset)
786   {
787   case 0:
788      /*
789            bit description
790
791            0   MUSIC A10
792            1   MUSIC A9
793            2   MUSIC A8
794            3   LS05 PORT 1
795            4   LS04 PORT 2
796            5   SHOT A
797            6   SHOT B
798            7   BOMB
799        */
800
801      /* select musical tune in ROM based on sound command byte */
802      tone_channels[0].base = ((data & 0x07) << 8);
803      tone_channels[0].mask = 0xff;
804
805      Sound0StopOnRollover = 1;
806
807      /* play noise samples requested by sound command byte */
808      /* SHOT A */
809      if (data & 0x20 && !(LastPort1 & 0x20))
810         sample_start(samples, 1, 0, 0);
811      else if (!(data & 0x20) && LastPort1 & 0x20)
812         sample_stop(samples, 1);
813
814      /* BOMB */
815      if (data & 0x80 && !(LastPort1 & 0x80))
816         sample_start(samples, 2, 1, 0);
817
818      if (data & 0x08)
819      {
820         tone_channels[0].mute = 1;
821         tone_channels[0].offset = 0;
822      }
823
824      if (data & 0x10)
825      {
826         tone_channels[0].mute = 0;
827      }
828
829      /* SHOT B */
830      sn76477_enable_w(devtag_get_device(space->machine, "sn76477.2"), (data & 0x40) ? 0 : 1);
831
832      LastPort1 = data;
833      break;
834   case 1:
835      /*
836            bit description
837
838            0   MUSIC A10
839            1   MUSIC A9
840            2   MUSIC A8
841            3   LS04 PORT 3
842            4   EXTP A (HD38880 external pitch control A)
843            5   EXTP B (HD38880 external pitch control B)
844            6
845            7
846        */
847
848      /* select tune in ROM based on sound command byte */
849      tone_channels[1].base = 0x0800 + ((data & 0x07) << 8);
850      tone_channels[1].mask = 0xff;
851
852      if (data & 0x08)
853         tone_channels[1].mute = 0;
854      else
855      {
856         tone_channels[1].mute = 1;
857         tone_channels[1].offset = 0;
858      }
859      break;
860   case 2:
861      /*
862            bit description
863
864            0   AS 1    (sound0 waveform)
865            1   AS 2    (sound0 waveform)
866            2   AS 4    (sound0 waveform)
867            3   AS 3    (sound0 waveform)
868            4   AS 5    (sound1 waveform)
869            5   AS 6    (sound1 waveform)
870            6   AS 7    (sound1 waveform)
871            7   AS 8    (sound1 waveform)
872        */
873
874      build_waveform(0, (data & 0x3) | ((data & 4) << 1) | ((data & 8) >> 1));
875      build_waveform(1, data >> 4);
876   }
877}
878
879WRITE8_HANDLER( fantasy_sound_w )
880{
881   switch (offset)
882   {
883   case 0:
884      /*
885            bit description
886
887            0   MUSIC A10
888            1   MUSIC A9
889            2   MUSIC A8
890            3   LS04 PART 1
891            4   LS04 PART 2
892            5
893            6
894            7   BOMB
895        */
896
897      /* select musical tune in ROM based on sound command byte */
898      tone_channels[0].base = 0x0000 + ((data & 0x07) << 8);
899      tone_channels[0].mask = 0xff;
900
901      Sound0StopOnRollover = 0;
902
903      if (data & 0x08)
904         tone_channels[0].mute = 0;
905      else
906      {
907         tone_channels[0].offset = tone_channels[0].base;
908         tone_channels[0].mute = 1;
909      }
910
911      if (data & 0x10)
912         tone_channels[2].mute = 0;
913      else
914      {
915         tone_channels[2].offset = 0;
916         tone_channels[2].mute = 1;
917      }
918
919      /* BOMB */
920      discrete_sound_w(devtag_get_device(space->machine, "discrete"), FANTASY_BOMB_EN, data & 0x80);
921
922      LastPort1 = data;
923      break;
924   case 1:
925      /*
926            bit description
927
928            0   MUSIC A10
929            1   MUSIC A9
930            2   MUSIC A8
931            3   LS04 PART 3
932            4   EXT PA (HD38880 external pitch control A)
933            5   EXT PB (HD38880 external pitch control B)
934            6
935            7
936        */
937
938      /* select tune in ROM based on sound command byte */
939      tone_channels[1].base = 0x0800 + ((data & 0x07) << 8);
940      tone_channels[1].mask = 0xff;
941
942      if (data & 0x08)
943         tone_channels[1].mute = 0;
944      else
945      {
946         tone_channels[1].mute = 1;
947         tone_channels[1].offset = 0;
948      }
949      break;
950   case 2:
951      /*
952            bit description
953
954            0   AS 1    (sound0 waveform)
955            1   AS 3    (sound0 waveform)
956            2   AS 2    (sound0 waveform)
957            3   AS 4    (sound0 waveform)
958            4   AS 5    (sound1 waveform)
959            5   AS 6    (sound1 waveform)
960            6   AS 7    (sound1 waveform)
961            7   AS 8    (sound1 waveform)
962        */
963
964      build_waveform(0, (data & 0x9) | ((data & 2) << 1) | ((data & 4) >> 1));
965      build_waveform(1, data >> 4);
966      break;
967   case 3:
968      /*
969            bit description
970
971            0   BC 1
972            1   BC 2
973            2   BC 3
974            3   MUSIC A10
975            4   MUSIC A9
976            5   MUSIC A8
977            6
978            7   INV
979        */
980
981      /* select tune in ROM based on sound command byte */
982      tone_channels[2].base = 0x1000 + ((data & 0x70) << 4);
983      tone_channels[2].mask = 0xff;
984
985      snk6502_flipscreen_w(space, 0, data);
986      break;
987   }
988}
989
990
991/*
992  Hitachi HD38880 speech synthesizer chip
993
994    I heard that this chip uses PARCOR coefficients but I don't know ROM data format.
995    How do I generate samples?
996*/
997
998
999/* HD38880 command */
1000#define   HD38880_ADSET   2
1001#define   HD38880_READ   3
1002#define   HD38880_INT1   4
1003#define   HD38880_INT2   6
1004#define   HD38880_SYSPD   8
1005#define   HD38880_STOP   10
1006#define   HD38880_CONDT   11
1007#define   HD38880_START   12
1008#define   HD38880_SSTART   14
1009
1010/* HD38880 control bits */
1011#define HD38880_CTP   0x10
1012#define HD38880_CMV   0x20
1013#define HD68880_SYBS   0x0f
1014
1015static int   hd38880_cmd;
1016static UINT32   hd38880_addr;
1017static int   hd38880_data_bytes;
1018static double   hd38880_speed;
1019
1020
1021static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 *table, int start)
1022{
1023   /*
1024        bit description
1025        0   SYBS1
1026        1   SYBS2
1027        2   SYBS3
1028        3   SYBS4
1029        4   CTP
1030        5   CMV
1031        6
1032        7
1033    */
1034
1035   if ((data & HD38880_CTP) && (data & HD38880_CMV))
1036   {
1037      const device_config *samples = devtag_get_device(machine, "samples");
1038      data &= HD68880_SYBS;
1039
1040      switch (hd38880_cmd)
1041      {
1042      case 0:
1043         switch (data)
1044         {
1045         case HD38880_START:
1046            logerror("speech: START\n");
1047
1048            if (hd38880_data_bytes == 5 && !sample_playing(samples, 0))
1049            {
1050               int i;
1051
1052               for (i = 0; i < 16; i++)
1053               {
1054                  if (table[i] && table[i] == hd38880_addr)
1055                  {
1056                     const device_config *samples = devtag_get_device(machine, "samples");
1057                     sample_start(samples, 0, start + i, 0);
1058                     break;
1059                  }
1060               }
1061            }
1062            break;
1063
1064         case HD38880_SSTART:
1065            logerror("speech: SSTART\n");
1066            break;
1067
1068         case HD38880_STOP:
1069            sample_stop(samples, 0);
1070            logerror("speech: STOP\n");
1071            break;
1072
1073         case HD38880_SYSPD:
1074            hd38880_cmd = data;
1075            break;
1076
1077         case HD38880_CONDT:
1078            logerror("speech: CONDT\n");
1079            break;
1080
1081         case HD38880_ADSET:
1082            hd38880_cmd = data;
1083            hd38880_addr = 0;
1084            hd38880_data_bytes = 0;
1085            break;
1086
1087         case HD38880_READ:
1088            logerror("speech: READ\n");
1089            break;
1090
1091         case HD38880_INT1:
1092            hd38880_cmd = data;
1093            break;
1094
1095         case HD38880_INT2:
1096            hd38880_cmd = data;
1097            break;
1098
1099         case 0:
1100            // ignore it
1101            break;
1102
1103         default:
1104            logerror("speech: unknown command: 0x%x\n", data);
1105         }
1106         break;
1107
1108      case HD38880_INT1:
1109         logerror("speech: INT1: 0x%x\n", data);
1110
1111         if (data & 8)
1112            logerror("speech:   triangular waveform\n");
1113         else
1114            logerror("speech:   impulse waveform\n");
1115
1116         logerror("speech:   %sable losing effect of vocal tract\n", data & 4 ? "en" : "dis");
1117
1118         if ((data & 2) && (data & 8))
1119            logerror("speech:   use external pitch control\n");
1120
1121         hd38880_cmd = 0;
1122         break;
1123
1124      case HD38880_INT2:
1125         logerror("speech: INT2: 0x%x\n", data);
1126
1127         logerror("speech:   %d bits / frame\n", data & 8 ? 48 : 96);
1128         logerror("speech:   %d ms / frame\n", data & 4 ? 20 : 10);
1129         logerror("speech:   %sable repeat\n", data & 2 ? "en" : "dis");
1130         logerror("speech:   %d operations\n", ((data & 8) == 0) || (data & 1) ? 10 : 8);
1131
1132         hd38880_cmd = 0;
1133         break;
1134
1135      case HD38880_SYSPD:
1136         hd38880_speed = ((double)(data + 1)) / 10.0;
1137         logerror("speech: SYSPD: %1.1f\n", hd38880_speed);
1138         hd38880_cmd = 0;
1139         break;
1140
1141      case HD38880_ADSET:
1142         hd38880_addr |= (data << (hd38880_data_bytes++ * 4));
1143         if (hd38880_data_bytes == 5)
1144         {
1145            logerror("speech: ADSET: 0x%05x\n", hd38880_addr);
1146            hd38880_cmd = 0;
1147         }
1148         break;
1149      }
1150   }
1151}
1152
1153
1154/*
1155 vanguard/fantasy speech
1156
1157 ROM data format (INT2 = 0xf):
1158  48 bits / frame
1159  20 ms / frame
1160  enable repeat
1161  10 operations
1162*/
1163
1164WRITE8_HANDLER( vanguard_speech_w )
1165{
1166   static const UINT16 vanguard_table[16] =
1167   {
1168      0x04000,
1169      0x04325,
1170      0x044a2,
1171      0x045b7,
1172      0x046ee,
1173      0x04838,
1174      0x04984,
1175      0x04b01,
1176      0x04c38,
1177      0x04de6,
1178      0x04f43,
1179      0x05048,
1180      0x05160,
1181      0x05289,
1182      0x0539e,
1183      0x054ce
1184   };
1185
1186   snk6502_speech_w(space->machine, data, vanguard_table, 2);
1187}
1188
1189WRITE8_HANDLER( fantasy_speech_w )
1190{
1191   static const UINT16 fantasy_table[16] =
1192   {
1193      0x04000,
1194      0x04297,
1195      0x044b6,
1196      0x04682,
1197      0x04927,
1198      0x04be0,
1199      0x04cc2,
1200      0x04e36,
1201      0x05000,
1202      0x05163,
1203      0x052c9,
1204      0x053fd,
1205      0,
1206      0,
1207      0,
1208      0
1209   };
1210
1211   snk6502_speech_w(space->machine, data, fantasy_table, 0);
1212}
src/mame/machine/namcos2.c
r5251r5252
310310      switch(offset)
311311      {
312312      case 1: return 0xBD;
313      case 7: return 0xBD;
313      // case 7: return 0xBD;
314314      }
315315      break;
316316
r5251r5252
520520   case 0x1d0000:
521521      if( bWrite )
522522      {
523         cpu_set_input_line(altcpu, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE);
524      }      cpu_set_input_line(space->cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE);
523         // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
524         // cpu_set_input_line(altcpu, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE);
525      }
526      cpu_set_input_line(space->cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE);
525527      break;
526528
527529   case 0x1d2000:
r5251r5252
531533   case 0x1d4000:
532534      if( bWrite )
533535      {
534         cpu_set_input_line(altcpu, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE);
536         // mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
537         // cpu_set_input_line(altcpu, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE);
535538      }
536539      cpu_set_input_line(space->cpu, pC148Reg[NAMCOS2_C148_2], CLEAR_LINE);
537540      break;
src/mame/machine/kaneko16.c
r5251r5252
361361         // execute the command:
362362
363363         kaneko16_mcu_ram[param1 / 2] = ~input_port_read(machine, "DSW1");   // DSW
364         kaneko16_mcu_ram[param2 / 2] = 0xffff;            // ? -1 / anything else
364         kaneko16_mcu_ram[param2 / 2] = 0x0000;// 0xffff;                // ? -1 / anything else (changes coinage..)
365365
366366         // param 4?
367367         kaneko16_mcu_ram[param5 / 2] = calc3_mcu_crc;            // MCU Rom Checksum!
src/mame/mamedriv.c
r5251r5252
274274   DRIVER( sfx )      /* (c) 1983 Nichibutsu */
275275   DRIVER( skelagon )   /* (c) 1983 Nichibutsu USA */
276276   DRIVER( monsterz )   /* (c) 1982 Nihon (Arcade TV Game List - P.102, Left, 20 from top) */
277   DRIVER( mimonscr )   /* Universal Video Games */
278   DRIVER( mimonkey )   /* bootleg */
279   DRIVER( mimonsco )   /* bootleg */
277   DRIVER( mimonscr )   /* (c) 1982 Universal Video Games (US Copyright Office info - http://cocatalog.loc.gov)*/
278   DRIVER( mimonkey )   /* (c) 1982 bootleg */
279   DRIVER( mimonsco )   /* (c) 1982 bootleg */
280280   DRIVER( scobra )   /* GX316 (c) 1981 Konami */
281281   DRIVER( scobras )   /* GX316 (c) 1981 Stern */
282282   DRIVER( scobrase )   /* GX316 (c) 1981 Stern */
r5251r5252
29952995   DRIVER( chaoshej )   /* 1998.10 Chaos Heat (V2.08J) */
29962996   DRIVER( raycris )   /* 1998.12 Ray Crisis (V2.03J) */
29972997   DRIVER( otenamih )   /* 1999.02 Otenami Haiken (Success) */
2998   DRIVER( otenamhf )   /* 2005.04 Otenami Haiken Final (V2.07JC) */
29982999   DRIVER( spuzbobj )   /* 1999.03 Super Puzzle Bobble (Japan) */
29993000   DRIVER( spuzbobl )   /* 1999.?? Super Puzzle Bobble (V2.05O) */
30003001   DRIVER( gobyrc )   /* 1999.?? Go By RC (V2.03O) */
r5251r5252
32263227   DRIVER( bmiidx8 )
32273228
32283229   /* Konami Viper games */
3229   DRIVER( kviper )   /* 1999 */
3230   DRIVER( ppp2nd )   /* 2001 */
3231   DRIVER( boxingm )   /* 2001 */
3232   DRIVER( code1d )   /* 2000 */
3233   DRIVER( code1db )   /* 2000 */
3234   DRIVER( gticlub2 )   /* 2001 */
3235   DRIVER( jpark3 )   /* 2001 */
3236   DRIVER( mocapglf )   /* 2001 */
3237   DRIVER( mocapb )   /* 2001 */
3238   DRIVER( mocapbj )   /* 2001 */
3239   DRIVER( p911 )      /* 2001 */
3240   DRIVER( p911uc )   /* 2001 */
3241   DRIVER( p911e )      /* 2001 */
3242   DRIVER( p911j )      /* 2001 */
3243   DRIVER( p9112 )      /* 2001 */
3244   DRIVER( popn9 )      /* 2003 */
3245   DRIVER( sscopex )   /* 2001 */
3246   DRIVER( sogeki )   /* 2001 */
3247   DRIVER( thrild2 )   /* 2001 */
3248   DRIVER( thrild2a )   /* 2001 */
3249   DRIVER( tsurugi )   /* 2001 */
3250   DRIVER( tsurugij )   /* 2001 */
3251   DRIVER( wcombat )   /* 2002 */
3252   DRIVER( wcombak )   /* 2002 */
3253   DRIVER( wcombaj )   /* 2002 */
3254   DRIVER( xtrial )   /* 2002 */
3255   DRIVER( mfightc )   /* 2002 */
3256   DRIVER( mfightcc )   /* 2002 */
3230   DRIVER( kviper )      /* 1999 */
3231   DRIVER( ppp2nd )      /* 2001 */
3232   DRIVER( boxingm )      /* 2001 */
3233   DRIVER( code1d )      /* 2000 */
3234   DRIVER( code1db )      /* 2000 */
3235   DRIVER( gticlub2 )      /* 2001 */
3236   DRIVER( gticlub2ea )   /* 2001 */
3237   DRIVER( jpark3 )      /* 2001 */
3238   DRIVER( mocapglf )      /* 2001 */
3239   DRIVER( mocapb )      /* 2001 */
3240   DRIVER( mocapbj )      /* 2001 */
3241   DRIVER( p911 )         /* 2001 */
3242   DRIVER( p911uc )      /* 2001 */
3243   DRIVER( p911kc )      /* 2001 */
3244   DRIVER( p911e )         /* 2001 */
3245   DRIVER( p911j )         /* 2001 */
3246   DRIVER( p9112 )         /* 2001 */
3247   DRIVER( popn9 )         /* 2003 */
3248   DRIVER( sscopex )      /* 2001 */
3249   DRIVER( sogeki )      /* 2001 */
3250   DRIVER( thrild2 )      /* 2001 */
3251   DRIVER( thrild2a )      /* 2001 */
3252   DRIVER( thrild2c )      /* 2001 */
3253   DRIVER( tsurugi )      /* 2001 */
3254   DRIVER( tsurugij )      /* 2001 */
3255   DRIVER( wcombat )      /* 2002 */
3256   DRIVER( wcombatk )      /* 2002 */
3257   DRIVER( wcombatj )      /* 2002 */
3258   DRIVER( xtrial )      /* 2002 */
3259   DRIVER( mfightc )      /* 2002 */
3260   DRIVER( mfightcc )      /* 2002 */
32573261
32583262   /* Mitchell games */
32593263   DRIVER( mgakuen )   /* (c) 1988 Yuga */
r5251r5252
35143518   DRIVER( sblazerp )  /* (c) 1983 */
35153519   DRIVER( cobraseg )  /* (c) ???? */
35163520   DRIVER( gpworld )   /* (c) 1984 */
3521   DRIVER( timetrv )   /* (c) 1991.10 Virtual Image Productions */
35173522
35183523   /* Sega SG1000 based games */
35193524   DRIVER( chboxing )   /* (c) 1984 */
r5251r5252
39183923   DRIVER( spidman )   /* 1991.?? Spiderman (World) */
39193924   DRIVER( spidmanu )   /* 1991.09 Spiderman (US) */
39203925                  /* 1991.09 Spiderman (Japan) */
3921                  /* 1991.10 Hologram Time Traveler (Japan) */
39223926   DRIVER( f1en )      /* 1991.?? F-1 Exhaust Note (World) */
39233927                  /* 1992.01 F-1 Exhaust Note (US) */
39243928                  /* 1991.11 F-1 Exhaust Note (Japan) */
r5251r5252
44284432                  /* 2003.07 Yonin Uchi Mahjong MJ Network Taisen ver. NEW */
44294433   DRIVER( psyvar2 )   /* 2003.11 Psyvariar 2 */
44304434   DRIVER( puyofev   )   /* 2003.11 Puyopuyo Fever */
4435   DRIVER( shootpl )   /* 2003.xx Shootout Pool / Shootout Pool Prize */
44314436   DRIVER( tetkiwam )   /* 2004.06 Tetris Kiwamemichi (Arcade TV Game List - P.88, Right, 11 from bottom) */
44324437   DRIVER( cfield )   /* 2004.06 Chaos Field */
44334438   DRIVER( trizeal )   /* 2004.09 Trizeal */
r5251r5252
45244529   /* Atomiswave (Dreamcast-based) games */
45254530   DRIVER( awbios )
45264531                  /* 2002.12 Maximum Speed */
4527   DRIVER( sprtshot )         /* 2002.12 Sports Shooting USA */
4532   DRIVER( sprtshot )   /* 2002.12 Sports Shooting USA */
45284533                  /* 2003.03 Guilty Gear X ver.1.5 */
45294534   DRIVER( demofist )   /* 2003.06 Demolish Fist */
45304535                  /* 2003.08 Dolphin Blue */
45314536                  /* 2003.12 Guilty Gear Isuka */
45324537                  /* 2003.12 Sangoku Senki Shichisei Tensei (IGS) */
45334538                  /* 2004.03 The Rumble Fish */
4534   DRIVER( rangrmsn )         /* 2004.03 Ranger Mission */
4539   DRIVER( rangrmsn )   /* 2004.03 Ranger Mission */
45354540                  /* 2004.06 Salary Man Kintarou Net Select */
45364541                  /* 2004.07 The King of Fighters Neo Wave */
45374542                  /* 2004.09 Extreme Hunting */
r5251r5252
47184723                  /* UX8 1985.01 Tokyo Mie Shinryoujo Part 2 */
47194724                  /* UX9 1985.05 Geinoujin Shikaku Shiken */
47204725
4726   /* Data East LD games */
4727   DRIVER( cobra )      /* (c) 1984 */
4728   DRIVER( rblaster )   /* (c) 1985 */
4729
47214730   /* other Data East games */
47224731   DRIVER( madalien )   /* (c) 1980 */
47234732   DRIVER( madalina )   /* (c) 1980 */
r5251r5252
56985707   DRIVER( qwak )       /* (proto)          (c) 1982 */
56995708   DRIVER( runaway )   /* (proto)          (c) 1982 */
57005709   DRIVER( bullsdrt )   /* (c) 1985 Shinkai */
5710   DRIVER( cmmb162 )
57015711
57025712   /* misc Atari games */
57035713   DRIVER( tunhunt )   /* 136000           (c) 1979 */
r5251r5252
88978907   DRIVER( witchcda )   /* 1991, Unknown */
88988908   DRIVER( witchcdb )   /* 1991, Unknown */
88998909   DRIVER( witchcdc )   /* 1991, Unknown */
8910   DRIVER( witchcdd )   /* 1991, Unknown */
89008911   DRIVER( sloco93 )   /* 1993, Unknown */
89018912   DRIVER( sloco93a )   /* 1993, Unknown */
89028913   DRIVER( maverik )   /* 198?, Unknown */
r5251r5252
91199130
91209131   /* Dyna */
91219132   DRIVER( cb2001 )   /* (c) 2001 Dyna Electronics */
9133   DRIVER( scherrym )   /* (c) 2001? Dyna Electronics */
9134
91229135   DRIVER( ncb3 )      /* (c) 199? Dyna Electronics */
91239136   DRIVER( cb3a )      /* (c) 199? Dyna Electronics */
91249137   DRIVER( cb3 )      /* (c) 199? Dyna Electronics */
src/mame/includes/snk6502.h
r0r5252
1/*************************************************************************
2
3    rokola hardware
4
5*************************************************************************/
6
7#include "sound/discrete.h"
8#include "sound/samples.h"
9#include "sound/sn76477.h"
10
11
12/*----------- defined in audio/snk6502.c -----------*/
13
14extern const samples_interface sasuke_samples_interface;
15extern const samples_interface vanguard_samples_interface;
16extern const samples_interface fantasy_samples_interface;
17extern const sn76477_interface sasuke_sn76477_intf_1;
18extern const sn76477_interface sasuke_sn76477_intf_2;
19extern const sn76477_interface sasuke_sn76477_intf_3;
20extern const sn76477_interface satansat_sn76477_intf;
21extern const sn76477_interface vanguard_sn76477_intf_1;
22extern const sn76477_interface vanguard_sn76477_intf_2;
23extern const sn76477_interface fantasy_sn76477_intf;
24
25extern WRITE8_HANDLER( sasuke_sound_w );
26extern WRITE8_HANDLER( satansat_sound_w );
27extern WRITE8_HANDLER( vanguard_sound_w );
28extern WRITE8_HANDLER( vanguard_speech_w );
29extern WRITE8_HANDLER( fantasy_sound_w );
30extern WRITE8_HANDLER( fantasy_speech_w );
31
32DEVICE_GET_INFO( snk6502_sound );
33#define SOUND_snk6502 DEVICE_GET_INFO_NAME(snk6502_sound)
34
35void snk6502_set_music_clock(double clock_time);
36void snk6502_set_music_freq(int freq);
37int snk6502_music0_playing(void);
38
39DISCRETE_SOUND_EXTERN( fantasy );
40
41
42/*----------- defined in video/snk6502.c -----------*/
43
44extern UINT8 *snk6502_videoram2;
45extern UINT8 *snk6502_charram;
46
47WRITE8_HANDLER( snk6502_videoram_w );
48WRITE8_HANDLER( snk6502_videoram2_w );
49WRITE8_HANDLER( snk6502_colorram_w );
50WRITE8_HANDLER( snk6502_charram_w );
51WRITE8_HANDLER( snk6502_flipscreen_w );
52WRITE8_HANDLER( snk6502_scrollx_w );
53WRITE8_HANDLER( snk6502_scrolly_w );
54
55PALETTE_INIT( snk6502 );
56VIDEO_START( snk6502 );
57VIDEO_UPDATE( snk6502 );
58
59WRITE8_HANDLER( satansat_b002_w );
60WRITE8_HANDLER( satansat_backcolor_w );
61
62PALETTE_INIT( satansat );
63VIDEO_START( satansat );
64
src/mame/mame.mak
r5251r5252
400400   $(DRIVERS)/centiped.o $(VIDEO)/centiped.o \
401401   $(DRIVERS)/cloak.o $(VIDEO)/cloak.o \
402402   $(DRIVERS)/cloud9.o $(VIDEO)/cloud9.o \
403   $(DRIVERS)/cmmb.o \
403404   $(DRIVERS)/cojag.o $(AUDIO)/jaguar.o $(VIDEO)/jaguar.o \
404405   $(DRIVERS)/copsnrob.o $(MACHINE)/copsnrob.o $(VIDEO)/copsnrob.o \
405406   $(DRIVERS)/cyberbal.o $(AUDIO)/cyberbal.o $(VIDEO)/cyberbal.o \
r5251r5252
555556   $(DRIVERS)/dblewing.o \
556557   $(DRIVERS)/dec0.o $(MACHINE)/dec0.o $(VIDEO)/dec0.o \
557558   $(DRIVERS)/dec8.o $(VIDEO)/dec8.o \
559   $(DRIVERS)/deco_ld.o \
558560   $(DRIVERS)/deco_mlc.o $(VIDEO)/deco_mlc.o \
559561   $(DRIVERS)/deco156.o $(MACHINE)/deco156.o \
560562   $(DRIVERS)/deco32.o $(VIDEO)/deco32.o \
r5251r5252
11381140   $(DRIVERS)/suprloco.o $(VIDEO)/suprloco.o \
11391141   $(DRIVERS)/system1.o $(VIDEO)/system1.o \
11401142   $(DRIVERS)/system16.o $(MACHINE)/system16.o $(VIDEO)/system16.o $(VIDEO)/sys16spr.o \
1143   $(DRIVERS)/timetrv.o \
11411144   $(DRIVERS)/topshoot.o \
11421145   $(DRIVERS)/turbo.o $(AUDIO)/turbo.o $(VIDEO)/turbo.o \
11431146   $(DRIVERS)/vicdual.o $(AUDIO)/vicdual.o $(VIDEO)/vicdual.o \
r5251r5252
12131216   $(DRIVERS)/mainsnk.o $(VIDEO)/mainsnk.o \
12141217   $(DRIVERS)/munchmo.o $(VIDEO)/munchmo.o \
12151218   $(DRIVERS)/prehisle.o $(VIDEO)/prehisle.o \
1216   $(DRIVERS)/rockola.o $(AUDIO)/rockola.o $(VIDEO)/rockola.o \
1219   $(DRIVERS)/snk6502.o $(AUDIO)/snk6502.o $(VIDEO)/snk6502.o \
12171220   $(DRIVERS)/snk.o $(VIDEO)/snk.o \
12181221   $(DRIVERS)/snk68.o $(VIDEO)/snk68.o \
12191222
src/mame/video/snk6502.c
r0r5252
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
9#include "driver.h"
10#include "includes/snk6502.h"
11
12
13UINT8 *snk6502_videoram2;
14UINT8 *snk6502_charram;
15
16static int charbank;
17static int backcolor;
18
19static tilemap *bg_tilemap;
20static tilemap *fg_tilemap;
21
22static rgb_t palette[64];
23
24#define TOTAL_COLORS(m,gfxn) ((m)->gfx[gfxn]->total_colors * (m)->gfx[gfxn]->color_granularity)
25#define COLOR(m,gfxn,offs) ((m)->config->gfxdecodeinfo[gfxn].color_codes_start + offs)
26
27
28
29/***************************************************************************
30
31  Convert the color PROMs into a more useable format.
32
33  Zarzon has a different PROM layout from the others.
34
35***************************************************************************/
36PALETTE_INIT( snk6502 )
37{
38   int i;
39
40   for (i = 0; i < machine->config->total_colors; i++)
41   {
42      int bit0, bit1, bit2, r, g, b;
43
44      /* red component */
45
46        bit0 = (*color_prom >> 0) & 0x01;
47        bit1 = (*color_prom >> 1) & 0x01;
48        bit2 = (*color_prom >> 2) & 0x01;
49
50      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
51
52      /* green component */
53
54        bit0 = (*color_prom >> 3) & 0x01;
55        bit1 = (*color_prom >> 4) & 0x01;
56        bit2 = (*color_prom >> 5) & 0x01;
57
58      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
59
60      /* blue component */
61
62      bit0 = 0;
63        bit1 = (*color_prom >> 6) & 0x01;
64        bit2 = (*color_prom >> 7) & 0x01;
65
66      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
67
68      palette[i] = MAKE_RGB(r, g, b);
69
70      color_prom++;
71   }
72
73   backcolor = 0;   /* background color can be changed by the game */
74
75   for (i = 0; i < TOTAL_COLORS(machine,0); i++)
76      palette_set_color(machine, COLOR(machine, 0, i), palette[i]);
77
78   for (i = 0; i < TOTAL_COLORS(machine,1); i++)
79   {
80      if (i % 4 == 0)
81         palette_set_color(machine, COLOR(machine, 1, i), palette[4 * backcolor + 0x20]);
82      else
83         palette_set_color(machine, COLOR(machine, 1, i), palette[i + 0x20]);
84   }
85}
86
87WRITE8_HANDLER( snk6502_videoram_w )
88{
89   videoram[offset] = data;
90   tilemap_mark_tile_dirty(bg_tilemap, offset);
91}
92
93WRITE8_HANDLER( snk6502_videoram2_w )
94{
95   snk6502_videoram2[offset] = data;
96   tilemap_mark_tile_dirty(fg_tilemap, offset);
97}
98
99WRITE8_HANDLER( snk6502_colorram_w )
100{
101   colorram[offset] = data;
102   tilemap_mark_tile_dirty(bg_tilemap, offset);
103   tilemap_mark_tile_dirty(fg_tilemap, offset);
104}
105
106WRITE8_HANDLER( snk6502_charram_w )
107{
108   if (snk6502_charram[offset] != data)
109   {
110      snk6502_charram[offset] = data;
111      gfx_element_mark_dirty(space->machine->gfx[0], (offset/8) % 256);
112   }
113}
114
115
116WRITE8_HANDLER( snk6502_flipscreen_w )
117{
118   int bank;
119
120   /* bits 0-2 select background color */
121
122   if (backcolor != (data & 7))
123   {
124      int i;
125
126      backcolor = data & 7;
127
128      for (i = 0;i < 32;i += 4)
129         palette_set_color(space->machine, COLOR(space->machine, 1, i), palette[4 * backcolor + 0x20]);
130   }
131
132   /* bit 3 selects char bank */
133
134   bank = (~data & 0x08) >> 3;
135
136   if (charbank != bank)
137   {
138      charbank = bank;
139      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
140   }
141
142   /* bit 7 flips screen */
143
144   if (flip_screen_get(space->machine) != (data & 0x80))
145   {
146      flip_screen_set(space->machine, data & 0x80);
147      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
148   }
149}
150
151WRITE8_HANDLER( snk6502_scrollx_w )
152{
153   tilemap_set_scrollx(bg_tilemap, 0, data);
154}
155
156WRITE8_HANDLER( snk6502_scrolly_w )
157{
158   tilemap_set_scrolly(bg_tilemap, 0, data);
159}
160
161
162static TILE_GET_INFO( get_bg_tile_info )
163{
164   int code = videoram[tile_index] + 256 * charbank;
165   int color = (colorram[tile_index] & 0x38) >> 3;
166
167   SET_TILE_INFO(1, code, color, 0);
168}
169
170static TILE_GET_INFO( get_fg_tile_info )
171{
172   int code = snk6502_videoram2[tile_index];
173   int color = colorram[tile_index] & 0x07;
174
175   SET_TILE_INFO(0, code, color, 0);
176}
177
178VIDEO_START( snk6502 )
179{
180   bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
181   fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
182
183   tilemap_set_transparent_pen(fg_tilemap, 0);
184
185   gfx_element_set_source(machine->gfx[0], snk6502_charram);
186}
187
188VIDEO_UPDATE( snk6502 )
189{
190   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
191   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
192   return 0;
193}
194
195/* Satan of Saturn */
196
197PALETTE_INIT( satansat )
198{
199   int i;
200
201   for (i = 0; i < machine->config->total_colors; i++)
202   {
203      int bit0, bit1, bit2, r, g, b;
204
205      /* red component */
206
207        bit0 = (*color_prom >> 0) & 0x01;
208        bit1 = (*color_prom >> 1) & 0x01;
209        bit2 = (*color_prom >> 2) & 0x01;
210
211      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
212
213      /* green component */
214
215        bit0 = (*color_prom >> 3) & 0x01;
216        bit1 = (*color_prom >> 4) & 0x01;
217        bit2 = (*color_prom >> 5) & 0x01;
218
219      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
220
221      /* blue component */
222
223      bit0 = 0;
224        bit1 = (*color_prom >> 6) & 0x01;
225        bit2 = (*color_prom >> 7) & 0x01;
226
227      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
228
229      palette[i] = MAKE_RGB(r, g, b);
230
231      color_prom++;
232   }
233
234   backcolor = 0;   /* background color can be changed by the game */
235
236   for (i = 0; i < TOTAL_COLORS(machine,0); i++)
237      palette_set_color(machine, COLOR(machine, 0, i), palette[4 * (i % 4) + (i / 4)]);
238
239   for (i = 0; i < TOTAL_COLORS(machine,1); i++)
240   {
241      if (i % 4 == 0)
242         palette_set_color(machine, COLOR(machine, 1, i), palette[backcolor + 0x10]);
243      else
244         palette_set_color(machine, COLOR(machine, 1, i), palette[4 * (i % 4) + (i / 4) + 0x10]);
245   }
246}
247
248WRITE8_HANDLER( satansat_b002_w )
249{
250   /* bit 0 flips screen */
251
252   if (flip_screen_get(space->machine) != (data & 0x01))
253   {
254      flip_screen_set(space->machine, data & 0x01);
255      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
256   }
257
258   /* bit 1 enables interrups */
259   /* it controls only IRQs, not NMIs. Here I am affecting both, which */
260   /* is wrong. */
261
262   interrupt_enable_w(space,0,data & 0x02);
263
264   /* other bits unused */
265}
266
267WRITE8_HANDLER( satansat_backcolor_w )
268{
269   /* bits 0-1 select background color. Other bits unused. */
270
271   if (backcolor != (data & 0x03))
272   {
273      int i;
274
275      backcolor = data & 0x03;
276
277      for (i = 0; i < 16; i += 4)
278         palette_set_color(space->machine, COLOR(space->machine, 1, i), palette[backcolor + 0x10]);
279   }
280}
281
282static TILE_GET_INFO( satansat_get_bg_tile_info )
283{
284   int code = videoram[tile_index];
285   int color = (colorram[tile_index] & 0x0c) >> 2;
286
287   SET_TILE_INFO(1, code, color, 0);
288}
289
290static TILE_GET_INFO( satansat_get_fg_tile_info )
291{
292   int code = snk6502_videoram2[tile_index];
293   int color = colorram[tile_index] & 0x03;
294
295   SET_TILE_INFO(0, code, color, 0);
296}
297
298VIDEO_START( satansat )
299{
300   bg_tilemap = tilemap_create(machine, satansat_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
301   fg_tilemap = tilemap_create(machine, satansat_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
302
303   tilemap_set_transparent_pen(fg_tilemap, 0);
304
305   gfx_element_set_source(machine->gfx[0], snk6502_charram);
306}
src/mame/drivers/kaneko16.c
r5251r5252
229229{
230230   MACHINE_RESET_CALL(kaneko16);
231231
232   kaneko16_sprite_xoffs = 0xa00;
233
234   kaneko16_sprite_yoffs = 0x200;
235
236
237   kaneko16_priority.sprite[0] = 2;   // below all
238   kaneko16_priority.sprite[1] = 3;   // above tile[0], below the others
239   kaneko16_priority.sprite[2] = 5;   // above all
240   kaneko16_priority.sprite[3] = 7;   // ""
241   kaneko16_priority.VIEW2_2_pri = 0;
242
232243   calc3_mcu_init();
233244}
234245
r5251r5252
14961507   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
14971508   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
14981509   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1499   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1500   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
1510   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1 )
1511   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
15011512
15021513   PORT_START("P2")      /* b80002.w */
15031514   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r5251r5252
15061517   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
15071518   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
15081519   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1509   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1510   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
1520   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
1521   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 )
15111522
15121523   PORT_START("SYSTEM")   /* b80004.w */
15131524   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
15141525   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
1515   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1516   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1517   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1518   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1526   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1527   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1528   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1529   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
15191530   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1520   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )   // ? tested
1531   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
15211532
15221533   PORT_START("UNK")      /* ? - b80006.w */
15231534   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
r5251r5252
19811992      case 1:  cpu_set_input_line(device, 3, HOLD_LINE); break;
19821993
19831994      // the code for this interupt is provided by the MCU..
1984      //case 0:  cpu_set_input_line(device, 4, HOLD_LINE); break;
1985      case 0:
1986      {
1987         // hack, clear this ram address to get into test mode (interrupt would clear it)
1988         if (kaneko16_mainram[0x2dfe/2]==0xff00)
1989         {
1990            kaneko16_mainram[0x2dfe/2]=0x0000;
1991         }
1995      case 0:  cpu_set_input_line(device, 4, HOLD_LINE); break;
1996      /*case 0:
1997        {
1998            // hack, clear this ram address to get into test mode (interrupt would clear it)
1999            if (kaneko16_mainram[0x2dfe/2]==0xff00)
2000            {
2001                kaneko16_mainram[0x2dfe/2]=0x0000;
2002            }
19922003
1993      }
2004        }*/
19942005   }
19952006}
19962007
r5251r5252
20092020   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
20102021   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
20112022   MDRV_SCREEN_SIZE(320, 240)
2012   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
2023   MDRV_SCREEN_VISIBLE_AREA(40, 296-1, 0, 240-1)
20132024
20142025   MDRV_GFXDECODE(1x4bit_1x4bit)
20152026   MDRV_PALETTE_LENGTH(2048)
r5251r5252
31903201    ROM_REGION( 0x020000, "cpu1", 0 )         /* MCU Code */
31913202   ROM_LOAD( "fb040a.u33",  0x000000, 0x020000, CRC(4b62c4d9) SHA1(35c943dde70438a411714070e42a84366db5ef83) )
31923203
3193   ROM_REGION( 0x600000, "gfx1", 0 )   /* Sprites */
3204   ROM_REGION( 0x1000000, "gfx1", 0 )   /* Sprites */ /* not sure these are all correct size */
31943205   ROM_LOAD( "fb020a.u1",  0x000000, 0x080000, CRC(da1b7373) SHA1(89510901848f1798fb76dd82d1cd9ac97c41521d) )
31953206   ROM_LOAD( "fb022a.u5",  0x080000, 0x080000, CRC(60aa1282) SHA1(4648816016e00df3256226ba5134f6e5bb429909) )
31963207   ROM_LOAD( "fb020b.u2",  0x100000, 0x100000, CRC(276b9d7b) SHA1(7a154f65b4737f2b6ac8effa3352711079f571dc) )
r5251r5252
37923803         {
37933804            // shogwarr does this with 'mode' as 0x08, which probably has some special meaning
37943805            //printf("CALC3: requested 0 length table!\n");
3806            // -- seems to be 'reset stack' to default for the protection table writes
37953807         }
37963808
37973809         if (inline_table_size)
r5251r5252
37993811            for (i=0;i<length;i++)
38003812            {
38013813               UINT8 dat = rom[offset+i];
3802               dat -= rom[inline_table_base + (i%inline_table_size)];
3814               UINT8 inlinet = rom[inline_table_base + (i%inline_table_size)];
3815               //printf("%02x, ",inlinet);
3816               dat -= inlinet;
3817
3818               if (tabnum==0x40) // fjbuster / shogun warriors japanese character select (what enables this extra?)
3819               {
3820                  // note the original, table is an odd number of words, so we can't just check if i is odd / even because the additional overlay
3821                  // is relative to the start of the original table, and has a size of 0x11 (17) bytes which loop.
3822                  if (((i%inline_table_size)&1)==0)
3823                  {
3824                     // thie gets mapped over half the inline table?!..  (inline length is 0x22, this changes odd bytes)
3825                     // what specifies the additional overlay here?
3826                     UINT8 extra[0x11] = { 0x14,0xf0,0xf8,0xd2,0xbe,0xfc,0xac,0x86,0x64,0x08,0x0c,0x74,0xd6,0x6a,0x24,0x12,0x1a };
3827                     dat -= extra[(i%inline_table_size)>>1];
3828
3829                  }
3830
3831
3832               }
3833
38033834               dstram[(dstoffset+i)^1] = dat;
38043835            }
38053836         }
r5251r5252
38163847
38173848            for (i=0;i<length;i++)
38183849            {
3850
3851
38193852               UINT8 dat = rom[offset+i];
3820               dat -= table[i&0x3f];
3853
3854
3855               if (tabnum==0x80) // shogwarr table 80 (irq code)
3856               {
3857
3858               unsigned char extracted80[686+2] = {
3859                  0x00, 0x00,
3860                  0xE7, 0x48, 0xFE, 0xFF, 0x39, 0x4A, 0x10, 0x00, 0xFE, 0x2D, 0x00, 0x67,
3861                  0x64, 0x02, 0x39, 0x4A, 0x10, 0x00, 0x26, 0x2E, 0x00, 0x66, 0x54, 0x02,
3862                  0x3C, 0x10, 0x4D, 0x00, 0x39, 0x4A, 0x10, 0x00, 0x10, 0x2E, 0x04, 0x67,
3863                  0xC0, 0x08, 0x07, 0x00, 0xC0, 0x13, 0x90, 0x00, 0x00, 0x00, 0xF9, 0x43,
3864                  0x58, 0x00, 0x00, 0x00, 0xF9, 0x41, 0x10, 0x00, 0x00, 0x18, 0xD8, 0x22,
3865                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3866                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3867                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3868                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3869                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3870                  0xD8, 0x22, 0xF9, 0x43, 0x38, 0x00, 0x00, 0x00, 0x3C, 0x30, 0x0F, 0x00,
3871                  0x79, 0x20, 0x10, 0x00, 0xA2, 0x62, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3872                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3873                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3874                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3875                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3876                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3877                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3878                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3879                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3880                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3881                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3882                  0xD8, 0x22, 0xC8, 0x51, 0x7E, 0xFF, 0x39, 0x4A, 0x10, 0x00, 0x27, 0x2E,
3883                  0x00, 0x66, 0x64, 0x00, 0xF9, 0x45, 0x10, 0x00, 0x40, 0x32, 0xF9, 0x41,
3884                  0x80, 0x00, 0x00, 0x00, 0xDA, 0x30, 0xDA, 0x30, 0xDA, 0x30, 0xDA, 0x30,
3885                  0xF9, 0x41, 0x90, 0x00, 0x14, 0x00, 0x39, 0x30, 0x10, 0x00, 0x38, 0x32,
3886                  0x40, 0x02, 0xC0, 0xFF, 0x40, 0x44, 0xC0, 0x30, 0x39, 0x30, 0x10, 0x00,
3887                  0x3A, 0x32, 0x40, 0x02, 0xC0, 0xFF, 0x40, 0x44, 0x79, 0xD0, 0x10, 0x00,
3888                  0x1E, 0x2E, 0xC0, 0x30, 0x39, 0x30, 0x10, 0x00, 0x3C, 0x32, 0x40, 0x02,
3889                  0xC0, 0xFF, 0x40, 0x44, 0xC0, 0x30, 0x39, 0x30, 0x10, 0x00, 0x3E, 0x32,
3890                  0x40, 0x02, 0xC0, 0xFF, 0x40, 0x44, 0x79, 0xD0, 0x10, 0x00, 0x1E, 0x2E,
3891                  0xC0, 0x30, 0x00, 0x60, 0x9A, 0x00, 0xF9, 0x41, 0x80, 0x00, 0x00, 0x00,
3892                  0x39, 0x30, 0x10, 0x00, 0x40, 0x32, 0x40, 0x31, 0x02, 0x00, 0x40, 0x31,
3893                  0x06, 0x00, 0xF9, 0x41, 0x90, 0x00, 0x1C, 0x00, 0x39, 0x30, 0x10, 0x00,
3894                  0x34, 0x32, 0x48, 0xED, 0x40, 0x44, 0xC0, 0x30, 0x39, 0x30, 0x10, 0x00,
3895                  0x30, 0x32, 0x40, 0x06, 0x20, 0x00, 0x48, 0xED, 0x40, 0x44, 0x79, 0xD0,
3896                  0x10, 0x00, 0x1E, 0x2E, 0xC0, 0x30, 0xF9, 0x41, 0x10, 0x00, 0x28, 0x2E,
3897                  0xE8, 0x45, 0x00, 0x02, 0x79, 0x22, 0x10, 0x00, 0x22, 0x2E, 0xE9, 0x47,
3898                  0x00, 0x10, 0x3C, 0x30, 0x07, 0x00, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22,
3899                  0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22,
3900                  0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22,
3901                  0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22,
3902                  0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22,
3903                  0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xD8, 0x22, 0xDA, 0x26, 0xC8, 0x51,
3904                  0xBE, 0xFF, 0xF9, 0x43, 0x58, 0x00, 0x80, 0x00, 0xF9, 0x41, 0x10, 0x00,
3905                  0x80, 0x18, 0x3C, 0x30, 0x1B, 0x00, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3906                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3907                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3908                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3909                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22,
3910                  0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xD8, 0x22, 0xC8, 0x51,
3911                  0xBE, 0xFF, 0xD8, 0x22, 0xD8, 0x22, 0x39, 0x42, 0x10, 0x00, 0xFE, 0x2D,
3912                  0xF9, 0x41, 0x10, 0x00, 0x6C, 0x67, 0x07, 0x70, 0x10, 0x0C, 0x03, 0x00,
3913                  0x00, 0x66, 0x0E, 0x00, 0x68, 0x53, 0x0E, 0x00, 0x00, 0x66, 0x06, 0x00,
3914                  0xBC, 0x10, 0x04, 0x00, 0xE8, 0x41, 0x12, 0x00, 0xC8, 0x51, 0xE6, 0xFF,
3915                  0xC0, 0x33, 0x2C, 0x00, 0x00, 0x00, 0x3C, 0x30, 0x14, 0x00, 0xC8, 0x51,
3916                  0xFE, 0xFF, 0xC0, 0x33, 0x2D, 0x00, 0x00, 0x00, 0xDF, 0x4C, 0xFF, 0x7F,
3917                  0x73, 0x4E
3918               };
3919
3920                  if ((i&1)==0)
3921                  {
3922                     dat -= table[i&0x3f];
3923                     dat = BITSWAP8(dat,2,1,0,7,6,5,4,3);
3924                     // we can decode this byte... but compare it to the extract table for verification
3925                     if (extracted80[i^1] != dat) printf("error %02x %02x %02x\n", i, extracted80[i^1],dat);
3926                  }
3927                  else
3928                  {
3929                     // I don't understand how to decode this byte :-(
3930                     dat = extracted80[i^1];
3931
3932
3933
3934
3935
3936                  //  dat = BITSWAP8(dat,4,3,2,1,0,7,6,5);
3937                  //  dat -= table[i&0x3f];
3938                  }
3939               }
3940               else if (tabnum==0x41) // shogwarr table 41  -- note fjbuster uses table 40, which looks like (almost) the same data but with better encryption...
3941               {
3942                  // simple shifts...
3943                  dat -= table[i&0x3f];
3944
3945                  if ((i&1)==1) dat = BITSWAP8(dat,0,7,6,5,4,3,2,1);
3946                  else dat = BITSWAP8(dat,6,5,4,3,2,1,0,7);
3947               }
3948               else
3949               {
3950                  dat -= table[i&0x3f];
3951               }
3952
3953
38213954               dstram[(dstoffset+i)^1] = dat;
38223955            }
38233956         }
r5251r5252
39464079GAME( 1992, shogware, shogwarr, shogwarr, shogwarr, calc3,   ROT0,  "Kaneko", "Shogun Warriors (Euro)",  GAME_NOT_WORKING )
39474080GAME( 1992, fjbuster, shogwarr, shogwarr, shogwarr, calc3,   ROT0,  "Kaneko", "Fujiyama Buster (Japan)", GAME_NOT_WORKING )
39484081GAME( 1992, brapboys, 0,        shogwarr, shogwarr, calc3,          ROT0,  "Kaneko", "B.Rap Boys (World)",      GAME_NOT_WORKING )
3949GAME( 1992, brapboyj, brapboys, shogwarr, shogwarr, calc3,          ROT0,  "Kaneko", "B.Rap Boys (Japan)",      GAME_NOT_WORKING )
4082GAME( 1992, brapboyj, brapboys, shogwarr, shogwarr, calc3,          ROT0,  "Kaneko", "B.Rap Boys Special (Japan)",      GAME_NOT_WORKING )
src/mame/drivers/viper.c
r5251r5252
2626    G?C09         2002    Mahjong Fight Club
2727    G?C22         2002    World Combat (USA/Japan/Korea) / Warzaid (Europe)
2828
29Note:
30Everything but p911uc might be a bad dump.
31
3229*/
3330
3431#include "driver.h"
r5251r5252
686683ROM_END
687684
688685/* Viper games with Compact Flash card */
689ROM_START(boxingm)
686ROM_START(boxingm) //*
690687   VIPER_BIOS
691688
692689   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
693   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(c24e29fc) SHA1(efb6ecaf25cbdf9d8dfcafa85e38a195fa5ff6c4))
690   ROM_LOAD("a45jaa_nvram.u39", 0x00000, 0x2000, CRC(c24e29fc) SHA1(efb6ecaf25cbdf9d8dfcafa85e38a195fa5ff6c4))
694691
695692   DISK_REGION( "ide" )
696   DISK_IMAGE( "a45jaa02", 0, SHA1(3aaf9bc713c9ea8922d8f8acfeab5b4bdf058f41) )
693   DISK_IMAGE( "a45a02", 0, SHA1(9af2481f53de705ae48fad08d8dd26553667c2d0) )
697694ROM_END
698695
699ROM_START(code1d)
696ROM_START(code1d) //*
700697   VIPER_BIOS
701698
702699   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
700   ROM_LOAD("nvram.u39", 0x00000, 0x2000, NO_DUMP )
703701
704702   DISK_REGION( "ide" )
705   DISK_IMAGE( "gk922d02", 0, SHA1(99b199e061621ecdd48ca125250c52656c814f38) )
703   DISK_IMAGE( "922d02", 0, SHA1(01f35e324c9e8567da0f51b3e68fff1562c32116) )
706704ROM_END
707705
708ROM_START(code1db)
706ROM_START(code1db) //*
709707   VIPER_BIOS
710708
711709   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
710   ROM_LOAD("nvram.u39", 0x00000, 0x2000, NO_DUMP )
712711
713712   DISK_REGION( "ide" )
714   DISK_IMAGE( "gk922b02", 0, SHA1(d1ecbfe3c76ba482638982879c96874537b89995) )
713   DISK_IMAGE( "922b02", 0, SHA1(4d288b5dcfab3678af662783e7083a358eee99ce) )
715714ROM_END
716715
717ROM_START(gticlub2)
716ROM_START(gticlub2) //*
718717   VIPER_BIOS
719718
720719   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
721   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d0604e84) SHA1(18d1183f1331af3e655a56692eb7ab877b4bc239))
720   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d0604e84) SHA1(18d1183f1331af3e655a56692eb7ab877b4bc239)) //old dump, probably has non-default settings.
721   ROM_LOAD("941jab_nvram.u39", 0x00000, 0x2000, CRC(6c4a852f) SHA1(2753dda42cdd81af22dc6780678f1ddeb3c62013))
722722
723723   DISK_REGION( "ide" )
724   DISK_IMAGE( "gm941b02", 0, SHA1(5f7e023d2ed0df5fa6876ac086864ffd69e9aa5a) )
724   DISK_IMAGE( "941b02", 0, SHA1(943bc9b1ea7273a8382b94c8a75010dfe296df14) )
725725ROM_END
726726
727ROM_START(jpark3)
727ROM_START(gticlub2ea) //*
728728   VIPER_BIOS
729729
730730   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
731   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(55d1681d) SHA1(26868cf0d14f23f06b81f2df0b4186924439bb43))
731   ROM_LOAD("941eaa_nvram.u39", 0x00000, 0x2000, CRC(5ee7004d) SHA1(92e0ce01049308f459985d466fbfcfac82f34a47))
732732
733733   DISK_REGION( "ide" )
734   DISK_IMAGE( "b41c02", 0, SHA1(ad7c42b06b9a75c2d28a2368387fe55fbec36a70) )
734   DISK_IMAGE( "941a02", 0, NO_DUMP )
735735ROM_END
736736
737ROM_START(mocapglf)
737ROM_START(jpark3) //*
738738   VIPER_BIOS
739739
740740   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
741   ROM_LOAD("b41ebc_nvram.u39", 0x00000, 0x2000, CRC(55d1681d) SHA1(26868cf0d14f23f06b81f2df0b4186924439bb43))
741742
742743   DISK_REGION( "ide" )
743   DISK_IMAGE( "b33a02", 0, SHA1(6c52cd8d52a5282c1650ee5aac088b293915d32c) )
744   DISK_IMAGE( "b41c02", 0, SHA1(fb6b0b43a6f818041d644bcd711f6a727348d3aa) )
744745ROM_END
745746
746ROM_START(mocapb)
747/* This CF card has sticker B33A02 */
748ROM_START(mocapglf) //*
747749   VIPER_BIOS
748750
749751   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
750   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(14b9fe68) SHA1(3c59e6df1bb46bc1835c13fd182b1bb092c08759))
752   ROM_LOAD("b33uaa_nvram.u39", 0x00000, 0x1ff8, BAD_DUMP CRC(0f0ba988) SHA1(5618c03b21fc2ba14b2e159cee3aab7f53c2c34d)) //data looks plain bad (compared to the other games)
751753
752754   DISK_REGION( "ide" )
753   DISK_IMAGE( "a29b02", 0, SHA1(017d2fb91dbef4ade0e3a02ee046b18e3d741f23) )
755   DISK_IMAGE( "b33a02", 0, SHA1(819d8fac5d2411542c1b989105cffe38a5545fc2) )
754756ROM_END
755757
756ROM_START(mocapbj)
758ROM_START(mocapb) //*
757759   VIPER_BIOS
758760
759761   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
760   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(2f7cdf27) SHA1(0b69d8728be12909e235268268a312982f81d46a))
762   ROM_LOAD("a29aaa_nvram.u39", 0x000000, 0x2000, CRC(14b9fe68) SHA1(3c59e6df1bb46bc1835c13fd182b1bb092c08759)) //supposed to be aab version?
761763
762764   DISK_REGION( "ide" )
763   DISK_IMAGE( "a29a02", 0, SHA1(900899cd0e5adc1fe28382b22f25a3ee447e7986) )
765   DISK_IMAGE( "a29b02", 0, SHA1(f0c04310caf2cca804fde20805eb30a44c5a6796) ) //missing bootloader
764766ROM_END
765767
766ROM_START(p911)
768ROM_START(mocapbj) //*
767769   VIPER_BIOS
768770
769771   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
770   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(cca056ca) SHA1(de1a00d84c1311d48bbe6d24f5b36e22ecf5e85a))
772   ROM_LOAD("a29jaa_nvram.u39", 0x000000, 0x2000, CRC(2f7cdf27) SHA1(0b69d8728be12909e235268268a312982f81d46a))
771773
772774   DISK_REGION( "ide" )
773   DISK_IMAGE( "a00aad02", 0, SHA1(c9b92bd53e62cc83c30db32d6cf329273af4ca8d) )
775   DISK_IMAGE( "a29a02", 0, SHA1(00afad399737652b3e17257c70a19f62e37f3c97) )
774776ROM_END
775777
776ROM_START(p911uc)
778ROM_START(p911) //*
777779   VIPER_BIOS
778780
779781   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
782   ROM_LOAD("a00uad_nvram.u39", 0x000000, 0x2000, CRC(cca056ca) SHA1(de1a00d84c1311d48bbe6d24f5b36e22ecf5e85a))
780783
781784   DISK_REGION( "ide" )
782   DISK_IMAGE( "a00aac02", 0, SHA1(b268789416dbf8886118a634b911f0ee254970de) )
785   DISK_IMAGE( "a00d02", 0, SHA1(6acb8dc41920e7025b87034a3a62b185ef0109d9) )
783786ROM_END
784787
785ROM_START(p911e)
788ROM_START(p911uc) //*
786789   VIPER_BIOS
787790
788791   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
792   ROM_LOAD("a00uac_nvram.u39", 0x000000, 0x2000,  NO_DUMP )
789793
790794   DISK_REGION( "ide" )
791   DISK_IMAGE( "a00eaa02", 0, SHA1(9763c4c05da9dae0b9abe3ee979773443102dd19) )
795   DISK_IMAGE( "a00c02", 0, SHA1(b268789416dbf8886118a634b911f0ee254970de) )
792796ROM_END
793797
794ROM_START(p911j)
798ROM_START(p911kc) //*
795799   VIPER_BIOS
796800
797801   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
798   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(9ecf70dc) SHA1(4769a99b0cc28563e219860b8d480f32d1e21f60))
802   ROM_LOAD("a00kac_nvram.u39", 0x000000, 0x2000, CRC(8ddc921c) SHA1(901538da237679fc74966a301278b36d1335671f) )
799803
800804   DISK_REGION( "ide" )
801   DISK_IMAGE( "a00jac02", 0, SHA1(24ba15af85342eb30951e9aa74049a1127f30d7d) )
805   DISK_IMAGE( "a00kac02", 0, SHA1(b268789416dbf8886118a634b911f0ee254970de) )
802806ROM_END
803807
804ROM_START(p9112)
808ROM_START(p911e) //*
805809   VIPER_BIOS
806810
807811   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
812   ROM_LOAD("a00eaa_nvram.u39", 0x000000, 0x2000,  NO_DUMP )
808813
809814   DISK_REGION( "ide" )
810   DISK_IMAGE( "b11a02", 0, SHA1(412dfdf065fa2bf59256a1ec84c7c130a0182069) )
815   DISK_IMAGE( "a00a02", 0, SHA1(81565a2dce2e2b0a7927078a784354948af1f87c) )
811816ROM_END
812817
813ROM_START(popn9)
818ROM_START(p911j) //*
814819   VIPER_BIOS
815820
816821   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
822   ROM_LOAD("a00jaa_nvram.u39", 0x000000, 0x2000, CRC(9ecf70dc) SHA1(4769a99b0cc28563e219860b8d480f32d1e21f60))
817823
818824   DISK_REGION( "ide" )
819   DISK_IMAGE( "c00jab", 0, SHA1(3763aaded9b45388a664edd84a3f7f8ff4101be4) )
825   DISK_IMAGE( "a00c02", 0, SHA1(d962d3a8ea84c380767d0fe336296911c289c224) )
820826ROM_END
821827
828ROM_START(p9112) //*
829   VIPER_BIOS
830
831   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
832   ROM_LOAD("nvram.u39", 0x000000, 0x2000, NO_DUMP )
833
834   DISK_REGION( "ide" )
835   DISK_IMAGE( "b11a02", 0, SHA1(57665664321b78c1913d01f0d2c0b8d3efd42e04) )
836ROM_END
837
838ROM_START(popn9) //Note: this is actually a Konami Pyson HW! (PlayStation 2-based) move out of here.
839   VIPER_BIOS
840
841   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
842   ROM_LOAD("nvram.u39", 0x000000, 0x2000, NO_DUMP )
843
844   DISK_REGION( "ide" )
845   DISK_IMAGE( "c00jab", 0, BAD_DUMP SHA1(3763aaded9b45388a664edd84a3f7f8ff4101be4) )
846ROM_END
847
822848ROM_START(sscopex)
823849   VIPER_BIOS
824850
825851   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
826   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(7b0e1ac8) SHA1(1ea549964539e27f87370e9986bfa44eeed037cd))
852   ROM_LOAD("a13uaa_nvram.u39", 0x000000, 0x2000, CRC(7b0e1ac8) SHA1(1ea549964539e27f87370e9986bfa44eeed037cd))
827853
828854   DISK_REGION( "ide" )
829   DISK_IMAGE( "gka13c02", 0, SHA1(53ae5cd4ff38581816502b0fe7d0fcf1b6364a93) )
855   DISK_IMAGE( "a13c02", 0, SHA1(d740784fa51a3f43695ea95e23f92ef05f43284a) )
830856ROM_END
831857
832ROM_START(sogeki)
858//TODO: sscopexb + many nvram clone versions.
859
860ROM_START(sogeki) //*
833861   VIPER_BIOS
834862
835863   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
836864   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(2f325c55) SHA1(0bc44f40f981a815c8ce64eae95ae55db510c565))
837865
838866   DISK_REGION( "ide" )
839   DISK_IMAGE( "a13b02", 0, SHA1(d518111819cde7f78de8d4702a04f93871da4f8d) )
867   DISK_IMAGE( "a13b02", 0, SHA1(c25a61b76d365794c2da4a9e7de88a5519e944ec) )
840868ROM_END
841869
842ROM_START(thrild2)
870ROM_START(thrild2) //*
843871   VIPER_BIOS
844872
845873   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
846   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d5de9b8e) SHA1(768bcd46a6ad20948f60f5e0ecd2f7b9c2901061))
874   ROM_LOAD("a41ebb_nvram.u39", 0x00000, 0x2000, CRC(22f59ac0) SHA1(e14ea2ba95b72edf0a3331ab82c192760bfdbce3))
875//  a41eba_nvram == a41ebb_nvram
847876
848877   DISK_REGION( "ide" )
849   DISK_IMAGE( "gma41b02", 0, SHA1(03b59d2662b8e37228450acb075b46e96191681e) )
878   DISK_IMAGE( "a41b02", 0, SHA1(0426f4bb9001cf457f44e2c22e3d7575b8049aa3) )
850879ROM_END
851880
852ROM_START(thrild2a)
881ROM_START(thrild2a) //*
853882   VIPER_BIOS
854883
855884   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
856   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(3b7b0969) SHA1(3f11b6420ad3e3ee6f807e1ae14908bdc6e86d8f))
885   ROM_LOAD("a41aaa_nvram.u39", 0x00000, 0x2000, CRC(d5de9b8e) SHA1(768bcd46a6ad20948f60f5e0ecd2f7b9c2901061))
857886
858887   DISK_REGION( "ide" )
859   DISK_IMAGE( "gma41a02", 0, SHA1(6c7d31bddd79c61785aea8bbbd5170885a1002d8) )
888   DISK_IMAGE( "a41a02", 0, SHA1(bbb71e23bddfa07dfa30b6565a35befd82b055b8) )
860889ROM_END
861890
862ROM_START(tsurugi)
891/* This CF card has sticker 941EAA02 */
892ROM_START(thrild2c) //*
863893   VIPER_BIOS
864894
865895   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
866   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(c123342c) SHA1(55416767608fe0311a362854a16b214b04435a31))
896   ROM_LOAD("941eaa_nvram.u39", 0x00000, 0x2000, NO_DUMP )
867897
868898   DISK_REGION( "ide" )
869   DISK_IMAGE( "a30eab02", 0, SHA1(b6b3dbcf52ea5da54ccc5e14c08174eef4d02c30) )
899   DISK_IMAGE( "a41c02", 0, SHA1(ab3020e8709768c0fd2467573e92b679a05944e5) )
870900ROM_END
871901
872ROM_START(tsurugij)
902ROM_START(tsurugi) //*
873903   VIPER_BIOS
874904
875905   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
906   ROM_LOAD("a30eab_nvram.u39", 0x00000, 0x2000, CRC(c123342c) SHA1(55416767608fe0311a362854a16b214b04435a31))
876907
877908   DISK_REGION( "ide" )
878   DISK_IMAGE( "a30jac02", 0, SHA1(62a6d8572fa65c62c70e41ade51aac4269da2081) )
909   DISK_IMAGE( "a30b02", 0, SHA1(d2be83b7323c365ba445de7697c3fb8eb83d0212) )
879910ROM_END
880911
881ROM_START(wcombat)
912ROM_START(tsurugij) //*
882913   VIPER_BIOS
883914
884915   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
916   ROM_LOAD("a30jac_nvram.u39", 0x00000, 0x2000, NO_DUMP )
917
918   DISK_REGION( "ide" )
919   DISK_IMAGE( "a30c02", 0, SHA1(533b5669b00884a800df9ba29651777a76559862) )
920ROM_END
921
922/* This CF card has sticker C22D02 */
923ROM_START(wcombat) //*
924   VIPER_BIOS
925
926   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
885927   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(4f8b5858) SHA1(68066241c6f9db7f45e55b3c5da101987f4ce53c))
886928
887929   DISK_REGION( "ide" )
888   DISK_IMAGE( "c22d02", 0, SHA1(85d2a8b5ec4cfd932190486cad991f0c180ca6b3) )
930   DISK_IMAGE( "c22d02", 0, BAD_DUMP SHA1(85d2a8b5ec4cfd932190486cad991f0c180ca6b3) )
889931ROM_END
890932
891ROM_START(wcombak)
933ROM_START(wcombatk) //*
892934   VIPER_BIOS
893935
894936   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
895937   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(ebd4d645) SHA1(2fa7e2c6b113214f3eb1900c8ceef4d5fcf0bb76))
896938
897939   DISK_REGION( "ide" )
898   DISK_IMAGE( "c22c02", 0, SHA1(8bd1dfbf926ad5b28fa7dafd7e31c475325ec569) )
940   DISK_IMAGE( "c22c02", 0, BAD_DUMP SHA1(8bd1dfbf926ad5b28fa7dafd7e31c475325ec569) )
899941ROM_END
900942
901ROM_START(wcombaj)
943ROM_START(wcombatj) //*
902944   VIPER_BIOS
903945
904946   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
905947   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(bd8a6640) SHA1(2d409197ef3fb07d984d27fa943f29c7a711d715))
906948
907949   DISK_REGION( "ide" )
908   DISK_IMAGE( "c22a02", 0, SHA1(b607fb2ddfd0bd552b7a736cea4ac1aa3ea021bd) )
950   DISK_IMAGE( "c22a02", 0, BAD_DUMP SHA1(b607fb2ddfd0bd552b7a736cea4ac1aa3ea021bd) )
909951ROM_END
910952
911ROM_START(xtrial)
953ROM_START(xtrial) //*
912954   VIPER_BIOS
913955
914956   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
915   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(33708a93) SHA1(715968e3c9c15edf628fa6ac655dc0864e336c6c))
957   ROM_LOAD("b4xjab_nvram.u39", 0x00000, 0x2000, CRC(33708a93) SHA1(715968e3c9c15edf628fa6ac655dc0864e336c6c))
916958
917959   DISK_REGION( "ide" )
918   DISK_IMAGE( "b4xb02", 0, SHA1(27be96c5ea534d51b2e6d052e98c30e5848e572c) )
960   DISK_IMAGE( "b4xb02", 0, SHA1(d8d54f3f16b762bf0187fe29b2f8696015c0a940) )
919961ROM_END
920962
921963/* Viper Satellite Terminal games */
r5251r5252
9651007CF card and NVRAM are swapped....
9661008*/
9671009
968ROM_START(mfightc)
1010/* This CF card has sticker C09JAD04 */
1011ROM_START(mfightc) //*
9691012   VIPER_BIOS
9701013
9711014   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
972   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(9fb551a5) SHA1(a33d185e186d404c3bf62277d7e34e5ad0000b09))
1015   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(9fb551a5) SHA1(a33d185e186d404c3bf62277d7e34e5ad0000b09)) //likely non-default settings
1016   ROM_LOAD("c09jad_nvram.u39", 0x00000, 0x2000, CRC(33e960b7) SHA1(a9a249e68c89b18d4685f1859fe35dc21df18e14))
9731017
9741018   DISK_REGION( "ide" )
975   DISK_IMAGE( "c09jad04", 0, SHA1(d81930829619bb95fa718c591be1ecb4a54d2af5) )
1019   DISK_IMAGE( "c09d04", 0, SHA1(7395b7a33e953f65827aea44461e49f8388464fb) )
9761020ROM_END
9771021
978ROM_START(mfightcc)
1022/* This CF card has sticker C09JAC04 */
1023ROM_START(mfightcc) //*
9791024   VIPER_BIOS
9801025
9811026   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
1027   ROM_LOAD("c09jac_nvram.u39", 0x00000, 0x2000, NO_DUMP )
9821028
9831029   DISK_REGION( "ide" )
984   DISK_IMAGE( "c09jac04", 0, SHA1(9c6177b9f38a23ee0d1614622bd9e576fd8a446f) )
1030   DISK_IMAGE( "c09c04", 0, SHA1(bf5f7447d74399d34edd4eb6dfcca7f6fc2154f2) )
9851031ROM_END
9861032
9871033/*****************************************************************************/
r5251r5252
9891035/* Viper BIOS */
9901036GAME(1999, kviper,   0,       viper, 0, viper,    ROT0, "Konami", "Konami Viper BIOS", GAME_IS_BIOS_ROOT)
9911037
992GAME(2001, ppp2nd,   kviper,  viper, 0, viper,    ROT0,  "Konami", "ParaParaParadise 2nd Mix", GAME_NOT_WORKING|GAME_NO_SOUND)
1038GAME(2001, ppp2nd,    kviper,  viper, 0, viper,    ROT0,  "Konami", "ParaParaParadise 2nd Mix", GAME_NOT_WORKING|GAME_NO_SOUND)
9931039
994GAME(2001, boxingm,  kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Boxing Mania", GAME_NOT_WORKING|GAME_NO_SOUND)
995GAME(2000, code1d,   kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Code One Dispatch", GAME_NOT_WORKING|GAME_NO_SOUND)
996GAME(2000, code1db,  code1d,  viper, 0, vipercf,  ROT0,  "Konami", "Code One Dispatch (ver B)", GAME_NOT_WORKING|GAME_NO_SOUND)
997GAME(2001, gticlub2, kviper,  viper, 0, vipercf,  ROT0,  "Konami", "GTI Club 2", GAME_NOT_WORKING|GAME_NO_SOUND)
998GAME(2001, jpark3,   kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Jurassic Park 3", GAME_NOT_WORKING|GAME_NO_SOUND)
999GAME(2001, mocapglf, kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Mocap Golf", GAME_NOT_WORKING|GAME_NO_SOUND)
1000GAME(2001, mocapb,   kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Mocap Boxing (ver AAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1001GAME(2001, mocapbj,  mocapb,  viper, 0, vipercf,  ROT0,  "Konami", "Mocap Boxing (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1002GAME(2001, p911,     kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Police 911", GAME_NOT_WORKING|GAME_NO_SOUND)
1003GAME(2001, p911uc,   p911,    viper, 0, vipercf,  ROT0,  "Konami", "Police 911 (ver UAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1004GAME(2001, p911e,    p911,    viper, 0, vipercf,  ROT0,  "Konami", "Police 24/7 (ver EAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1005GAME(2001, p911j,    p911,    viper, 0, vipercf,  ROT0,  "Konami", "Keisatsukan Shinjuku 24ji (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1006GAME(2001, p9112,    kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Police 911 2", GAME_NOT_WORKING|GAME_NO_SOUND)
1007GAME(2003, popn9,    kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Pop'n Music 9", GAME_NOT_WORKING|GAME_NO_SOUND)
1008GAME(2001, sscopex,  kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Silent Scope EX (ver UAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1009GAME(2001, sogeki,   sscopex, viper, 0, vipercf,  ROT0,  "Konami", "Sogeki (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1010GAME(2001, thrild2,  kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Thrill Drive 2", GAME_NOT_WORKING|GAME_NO_SOUND)
1011GAME(2001, thrild2a, thrild2, viper, 0, vipercf,  ROT0,  "Konami", "Thrill Drive 2 (ver A)", GAME_NOT_WORKING|GAME_NO_SOUND)
1012GAME(2001, tsurugi,  kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Tsurugi (ver EAB)", GAME_NOT_WORKING|GAME_NO_SOUND)
1013GAME(2001, tsurugij, tsurugi, viper, 0, vipercf,  ROT0,  "Konami", "Tsurugi (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1014GAME(2002, wcombat,  kviper,  viper, 0, vipercf,  ROT0,  "Konami", "World Combat", GAME_NOT_WORKING|GAME_NO_SOUND)
1015GAME(2002, wcombak,  wcombat, viper, 0, vipercf,  ROT0,  "Konami", "World Combat (ver KBC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1016GAME(2002, wcombaj,  wcombat, viper, 0, vipercf,  ROT0,  "Konami", "World Combat (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1017GAME(2002, xtrial,   kviper,  viper, 0, vipercf,  ROT0,  "Konami", "Xtrial Racing", GAME_NOT_WORKING|GAME_NO_SOUND)
1040GAME(2001, boxingm,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Boxing Mania (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1041GAME(2000, code1d,    kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Code One Dispatch (ver D)", GAME_NOT_WORKING|GAME_NO_SOUND)
1042GAME(2000, code1db,   code1d,    viper, 0, vipercf,  ROT0,  "Konami", "Code One Dispatch (ver B)", GAME_NOT_WORKING|GAME_NO_SOUND)
1043GAME(2001, gticlub2,  kviper,    viper, 0, vipercf,  ROT0,  "Konami", "GTI Club 2 (ver JAB)", GAME_NOT_WORKING|GAME_NO_SOUND)
1044GAME(2001, gticlub2ea,gticlub2,  viper, 0, vipercf,  ROT0,  "Konami", "GTI Club 2 (ver EAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1045GAME(2001, jpark3,    kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Jurassic Park 3 (ver EBC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1046GAME(2001, mocapglf,  kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Mocap Golf (ver UAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1047GAME(2001, mocapb,    kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Mocap Boxing (ver AAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1048GAME(2001, mocapbj,   mocapb,    viper, 0, vipercf,  ROT0,  "Konami", "Mocap Boxing (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1049GAME(2001, p911,      kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Police 911 (ver UAD)", GAME_NOT_WORKING|GAME_NO_SOUND)
1050GAME(2001, p911uc,    p911,      viper, 0, vipercf,  ROT0,  "Konami", "Police 911 (ver UAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1051GAME(2001, p911kc,    p911,      viper, 0, vipercf,  ROT0,  "Konami", "Police 911 (ver KAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1052GAME(2001, p911e,     p911,      viper, 0, vipercf,  ROT0,  "Konami", "Police 24/7 (ver EAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1053GAME(2001, p911j,     p911,      viper, 0, vipercf,  ROT0,  "Konami", "Keisatsukan Shinjuku 24ji (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1054GAME(2001, p9112,     kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Police 911 2 (ver A)", GAME_NOT_WORKING|GAME_NO_SOUND)
1055GAME(2003, popn9,     kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Pop'n Music 9 (ver JAB)", GAME_NOT_WORKING|GAME_NO_SOUND)
1056GAME(2001, sscopex,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Silent Scope EX (ver UAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1057GAME(2001, sogeki,    sscopex,   viper, 0, vipercf,  ROT0,  "Konami", "Sogeki (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1058GAME(2001, thrild2,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Thrill Drive 2 (ver EBB)", GAME_NOT_WORKING|GAME_NO_SOUND)
1059GAME(2001, thrild2a,  thrild2,   viper, 0, vipercf,  ROT0,  "Konami", "Thrill Drive 2 (ver AAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1060GAME(2001, thrild2c,  thrild2,   viper, 0, vipercf,  ROT0,  "Konami", "Thrill Drive 2 (ver EAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1061GAME(2001, tsurugi,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Tsurugi (ver EAB)", GAME_NOT_WORKING|GAME_NO_SOUND)
1062GAME(2001, tsurugij,  tsurugi,   viper, 0, vipercf,  ROT0,  "Konami", "Tsurugi (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1063GAME(2002, wcombat,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "World Combat (ver UAA?)", GAME_NOT_WORKING|GAME_NO_SOUND)
1064GAME(2002, wcombatk,  wcombat,   viper, 0, vipercf,  ROT0,  "Konami", "World Combat (ver KBC)", GAME_NOT_WORKING|GAME_NO_SOUND)
1065GAME(2002, wcombatj,  wcombat,   viper, 0, vipercf,  ROT0,  "Konami", "World Combat (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND)
1066GAME(2002, xtrial,    kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Xtrial Racing (ver JAB)", GAME_NOT_WORKING|GAME_NO_SOUND)
10181067
1019GAME(2002, mfightc,  kviper, viper,  0, vipercf,  ROT0,  "Konami", "Mahjong Fight Club (ver D)", GAME_NOT_WORKING|GAME_NO_SOUND)
1020GAME(2002, mfightcc, mfightc, viper, 0, vipercf,  ROT0,  "Konami", "Mahjong Fight Club (ver C)", GAME_NOT_WORKING|GAME_NO_SOUND)
1068GAME(2002, mfightc,   kviper,    viper, 0, vipercf,  ROT0,  "Konami", "Mahjong Fight Club (ver JAD)", GAME_NOT_WORKING|GAME_NO_SOUND)
1069GAME(2002, mfightcc,  mfightc,   viper, 0, vipercf,  ROT0,  "Konami", "Mahjong Fight Club (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND)
src/mame/drivers/scramble.c
r5251r5252
19571957GAME( 1983, hunchbks, hunchbak, hunchbks, hunchbks, scramble_ppi, ROT90, "Century Electronics", "Hunchback (Scramble hardware)", GAME_SUPPORTS_SAVE )
19581958GAME( 1984, hncholms, huncholy, hncholms, hncholms, scramble_ppi, ROT90, "Century Electronics", "Hunchback Olympic (Scramble hardware)", GAME_SUPPORTS_SAVE )
19591959GAME( 1983, cavelon,  0,        cavelon,  cavelon,  cavelon,      ROT90, "Jetsoft", "Cavelon", GAME_SUPPORTS_SAVE )
1960GAME( 198?, mimonscr, mimonkey, mimonscr, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
1960GAME( 1982, mimonscr, mimonkey, mimonscr, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
19611961GAME( 1983, ad2083,   0,        ad2083,   ad2083,   ad2083,       ROT90, "Midcoin", "A. D. 2083", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
1962GAME( 1981, turpins,  turtles,  turpins,  turpins,  0,            ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
1962GAME( 1981, turpins,  turtles,  turpins,  turpins,  0,            ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
19631963
src/mame/drivers/tehkanwc.c
r5251r5252
849849   ROM_LOAD( "e12.bin",   0x00000, 0x4000, CRC(a9e274f8) SHA1(02b46e1b149a856f0be74a23faaeb792935b66c7) )   /* fg tiles */
850850
851851   ROM_REGION( 0x10000, "gfx2", 0 )
852   ROM_LOAD( "e7.bin",    0x00000, 0x8000, CRC(055a5264) SHA1(fe294ba57c2c858952e2fab0be1b8859730846cb) )   /* sprites */
852   ROM_LOAD( "e8.bin",    0x00000, 0x8000, CRC(055a5264) SHA1(fe294ba57c2c858952e2fab0be1b8859730846cb) )   /* sprites */
853853   ROM_LOAD( "e7.bin",    0x08000, 0x8000, CRC(59faebe7) SHA1(85dad90928369601e039467d575750539410fcf6) )
854854
855855   ROM_REGION( 0x10000, "gfx3", 0 )
src/mame/drivers/jangou.c
r5251r5252
10031003
10041004ROM_START( fruitbun )
10051005   ROM_REGION( 0x10000, "cpu0", 0 )
1006   ROM_LOAD( "04.bin", 0x00000, 0x02000, CRC(480cb9bf) SHA1(f5e960cd8eaaa85336797fb5d895fa40f1fc4767) )
1007   ROM_LOAD( "05.bin", 0x02000, 0x02000, CRC(817add97) SHA1(ee5e1b193c22dfd36ac7836ff6bc14e783cb0e86) )
1006   ROM_LOAD( "04.8l", 0x00000, 0x02000, CRC(480cb9bf) SHA1(f5e960cd8eaaa85336797fb5d895fa40f1fc4767) )
1007   ROM_LOAD( "05.8k", 0x02000, 0x02000, CRC(817add97) SHA1(ee5e1b193c22dfd36ac7836ff6bc14e783cb0e86) )
10081008
10091009   /* same non-sense like Country Girl... */
10101010   ROM_REGION( 0x1000, "user1", 0 )
10111011   // 06.bin              = galx.1h               Galaxian Part X (moonaln hack)
1012   ROM_LOAD( "06.bin", 0x00000, 0x0800, CRC(e8810654) SHA1(b6924c7ad765c32714e6abd5bb56b2732edd5855) )
1012   ROM_LOAD( "06.8j", 0x00000, 0x0800, CRC(e8810654) SHA1(b6924c7ad765c32714e6abd5bb56b2732edd5855) )
10131013   // 07.bin              = rp9.6h                97.705078%
10141014   // (a gfx rom from an undumped (later? licensed to Nichibutsu?) River Patrol set, it shows the body of the Orca logo if you replace it in rpatrol)
1015   ROM_LOAD( "07.bin", 0x00800, 0x0800, CRC(3717fa41) SHA1(373e5ef6bef3407da084508c48522c7058568188) )
1015   ROM_LOAD( "07.8h", 0x00800, 0x0800, CRC(3717fa41) SHA1(373e5ef6bef3407da084508c48522c7058568188) )
10161016
10171017   ROM_REGION( 0x10000, "gfx", 0 )
1018   ROM_LOAD( "01.bin", 0x00000, 0x02000, CRC(5ce7f40c) SHA1(ec1998f218a30a1e19ce20b71f170425b4330ea5) )
1019   ROM_LOAD( "02.bin", 0x02000, 0x02000, CRC(4ca0e465) SHA1(72af3f9e0534ba9a94854513250f6fa82d790549) )
1020   ROM_LOAD( "03.bin", 0x04000, 0x02000, CRC(8a8f6abd) SHA1(143607c423bfe337e6feed7cd4cc8be5e09fbd5e) )
1018   ROM_LOAD( "01.5m", 0x00000, 0x02000, CRC(5ce7f40c) SHA1(ec1998f218a30a1e19ce20b71f170425b4330ea5) )
1019   ROM_LOAD( "02.5l", 0x02000, 0x02000, CRC(4ca0e465) SHA1(72af3f9e0534ba9a94854513250f6fa82d790549) )
1020   ROM_LOAD( "03.5k", 0x04000, 0x02000, CRC(8a8f6abd) SHA1(143607c423bfe337e6feed7cd4cc8be5e09fbd5e) )
10211021
10221022   ROM_REGION( 0x20, "proms", 0 )
1023   ROM_LOAD( "fruitbun_prom.bin", 0x00, 0x20, BAD_DUMP CRC(dc54dc52) SHA1(db91a7ae05eb6b6e4b42f91dfe20ac0da6680b46) ) //taken from country girl
1023   ROM_LOAD( "tbp18s30n.4f", 0x00, 0x20, CRC(dc54dc52) SHA1(db91a7ae05eb6b6e4b42f91dfe20ac0da6680b46) ) //verified on real hardware
10241024ROM_END
10251025
10261026ROM_START( luckygrl )
r5251r5252
11111111    Hana Royal
11121112    Hana Puter
11131113    Royal Card
1114    Fruits Bunny (clone of Country Girl)
11151114*/
src/mame/drivers/cmmb.c
r0r5252
1/***************************************************************************
2
3Multipede (c) 1980-2 Infogrames / 199x CosmoDog
4
5preliminary driver by Angelo Salese
6
7TODO:
8- program banking;
9- finish video emulation;
10- inputs;
11- sound;
12
13============================================================================
14
15Centipede, Millipede, Missile Command, Let's Go Bowling.
16Team Play
17
18Multipede 1.00 PCB by CosmoDog
19
20Flash ROM AT29C020
21
22Cypress CY39100V208B
23CPU WDC 658C02-8P-14
24CY37128-P100
25CYC1399
26
27
28***************************************************************************/
29
30#include "driver.h"
31#include "cpu/m6502/m6502.h"
32
33VIDEO_START( cmmb )
34{
35
36}
37
38VIDEO_UPDATE( cmmb )
39{
40   const gfx_element *gfx = screen->machine->gfx[0];
41   int count = 0x00000;
42
43   int y,x;
44
45
46   for (y=0;y<32;y++)
47   {
48      for (x=0;x<32;x++)
49      {
50         int tile = videoram[count] & 0x3f;
51         int colour = (videoram[count] & 0xc0)>>6;
52         drawgfx_opaque(bitmap,cliprect,gfx,tile,colour,0,0,x*8,y*8);
53
54         count++;
55      }
56   }
57
58   return 0;
59}
60
61static READ8_HANDLER( cmmb_charram_r )
62{
63   UINT8 *GFX = memory_region(space->machine, "gfx");
64
65   return GFX[offset];
66}
67
68static WRITE8_HANDLER( cmmb_charram_w )
69{
70   UINT8 *GFX = memory_region(space->machine, "gfx");
71
72   GFX[offset] = data;
73
74   offset&=0xfff;
75
76   /* dirty char */
77   gfx_element_mark_dirty(space->machine->gfx[0], offset >> 4);
78    gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
79}
80
81
82static WRITE8_HANDLER( cmmb_paletteram_w )
83{
84    /* RGB output is inverted */
85    paletteram_RRRGGGBB_w(space,offset,~data);
86}
87
88static READ8_HANDLER( cmmb_input_r )
89{
90   printf("%02x R\n",offset);
91   switch(offset)
92   {
93      case 0x00: return input_port_read(space->machine, "IN2");
94      case 0x03: return 4; //eeprom?
95      case 0x0e: return input_port_read(space->machine, "IN0");
96      case 0x0f: return input_port_read(space->machine, "IN1");
97   }
98
99   return 0xff;
100}
101
102static UINT8 irq_mask;
103
104/*
105    {
106        UINT8 *ROM = memory_region(space->machine, "maincpu");
107        UINT32 bankaddress;
108
109        bankaddress = 0x10000 + (0x10000 * (data & 0x03));
110        memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
111    }
112*/
113
114static WRITE8_HANDLER( cmmb_output_w )
115{
116   printf("%02x -> [%02x] W\n",data,offset);
117   switch(offset)
118   {
119      case 0x01:
120         {
121            UINT8 *ROM = memory_region(space->machine, "maincpu");
122            UINT32 bankaddress;
123
124            bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
125            memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
126         }
127         break;
128      case 0x03:
129         irq_mask = data & 0x80;
130         break;
131      case 0x07:
132         break;
133   }
134}
135
136static READ8_HANDLER( kludge_r )
137{
138   return mame_rand(space->machine);
139}
140
141/* overlap empty addresses */
142static ADDRESS_MAP_START( cmmb_map, ADDRESS_SPACE_PROGRAM, 8 )
143   AM_RANGE(0x0000, 0x01ff) AM_RAM /* zero page address */
144//  AM_RANGE(0x13c0, 0x13ff) AM_RAM //spriteram
145   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&videoram)
146   AM_RANGE(0x2480, 0x249f) AM_RAM_WRITE(cmmb_paletteram_w) AM_BASE(&paletteram)
147   AM_RANGE(0x4000, 0x400f) AM_READWRITE(cmmb_input_r,cmmb_output_w) //i/o
148   AM_RANGE(0x4900, 0x4900) AM_READ(kludge_r)
149   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
150   AM_RANGE(0xa000, 0xafff) AM_RAM
151   AM_RANGE(0xb000, 0xbfff) AM_READWRITE(cmmb_charram_r,cmmb_charram_w)
152   AM_RANGE(0xc000, 0xc00f) AM_READWRITE(cmmb_input_r,cmmb_output_w) //i/o
153   AM_RANGE(0x8000, 0xffff) AM_ROM
154ADDRESS_MAP_END
155
156
157static INPUT_PORTS_START( cmmb )
158   PORT_START("IN0")
159   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
160   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
161   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
162   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
163   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
165   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
166   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
168   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
169   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
170   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
171   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
172   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
173   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
174   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
175   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
176   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
177   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
178   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
179   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
180   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
181   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
182   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
183   PORT_START("IN1")
184   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
185   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
186   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
187   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
188   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
189   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
190   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
191   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
192   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
193   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
194   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
195   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
196   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
197   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
198   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
199   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
200   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
201   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
202   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
203   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
204   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
205   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
206   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_START("IN2")
209   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
210   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
212   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
213   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
215   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
216   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
217   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
218   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
219   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
220   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
221   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
222   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
223   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
225   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
226   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
227   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
228   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
230   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
231   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
232   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
233INPUT_PORTS_END
234
235static const gfx_layout charlayout =
236{
237   8,8,
238   RGN_FRAC(1,1),
239   2,
240   { 1, 0 },
241   { 6, 4, 2, 0, 14, 12, 10, 8 },
242   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
243   8*16
244};
245
246static const gfx_layout spritelayout =
247{
248   8,16,
249   RGN_FRAC(1,1),
250   2,
251   { 1, 0 },
252   { 6, 4, 2, 0, 14, 12, 10, 8 },
253   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16,9*16,10*16,11*16,12*16,13*16,14*16,15*16 },
254   8*32
255};
256
257
258static GFXDECODE_START( cmmb )
259   GFXDECODE_ENTRY( "gfx", 0, charlayout,     0x00, 4 )
260   GFXDECODE_ENTRY( "gfx", 0, spritelayout,   0x10, 4 )
261GFXDECODE_END
262
263static INTERRUPT_GEN( cmmb_irq )
264{
265   //if(input_code_pressed_once(KEYCODE_Z))
266   //  cpu_set_input_line(device, 0, HOLD_LINE);
267}
268
269static MACHINE_RESET( cmmb )
270{
271}
272
273static MACHINE_DRIVER_START( cmmb )
274
275   /* basic machine hardware */
276   MDRV_CPU_ADD("maincpu",M65C02,8000000/2) // unknown clock
277   MDRV_CPU_PROGRAM_MAP(cmmb_map)
278   MDRV_CPU_VBLANK_INT("screen",cmmb_irq)
279
280   /* video hardware */
281   MDRV_SCREEN_ADD("screen", RASTER)
282   MDRV_SCREEN_REFRESH_RATE(60)
283   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // unknown
284   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
285   MDRV_SCREEN_SIZE(32*8, 32*8)
286   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
287   MDRV_GFXDECODE(cmmb)
288   MDRV_PALETTE_LENGTH(512)
289
290   MDRV_VIDEO_START(cmmb)
291   MDRV_VIDEO_UPDATE(cmmb)
292
293   MDRV_MACHINE_RESET(cmmb)
294
295   /* sound hardware */
296//  MDRV_SPEAKER_STANDARD_MONO("mono")
297//  MDRV_SOUND_ADD("ay", AY8910, 8000000/4)
298//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
299MACHINE_DRIVER_END
300
301/***************************************************************************
302
303  Game driver(s)
304
305***************************************************************************/
306
307ROM_START( cmmb162 )
308   ROM_REGION( 0x50000, "maincpu", 0 )
309   ROM_LOAD( "cmmb162.bin",   0x10000, 0x40000, CRC(71a5a75d) SHA1(0ad7b97580082cda98cb1e8aab8efcf491d0ed25) )
310   ROM_COPY( "maincpu",       0x18000, 0x08000, 0x08000 )
311
312   ROM_REGION( 0x1000, "gfx", ROMREGION_ERASE00 )
313ROM_END
314
315GAME( 199?, cmmb162,  0,       cmmb,  cmmb,  0, ROT270, "Infogrames / Cosmodog", "Multipede (V1.00)", GAME_NO_SOUND|GAME_NOT_WORKING )
src/mame/drivers/seta.c
r5251r5252
116116  the current area is right for it)
117117- crazyfgt: emulate protection & tickets, fix graphics glitches, find correct clocks,
118118  level 2 interrupt should probably be triggered by the 3812 but sound tends to die that way.
119- jjsquawk: Nuts don't fall from the trees shaken by white animal.
120  Player's shot sound is missing (not requested to X1-010?).
121  Many sounds are wrong since MAME 0.62.
122  i.e.
123  all scene: when you beat enemies or yellow walking eggs
124  stage 1: weasels throw eggs, white animals (shaking trees) are damaged, rabbit jump
125  stage 2: when BOX-MEN gets angry
119126
120127***************************************************************************/
121128
r5251r5252
39283935   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal )  )
39293936   PORT_DIPSETTING(      0x0400, DEF_STR( Hard )    )
39303937   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
3931   PORT_DIPNAME( 0x3000, 0x3000, "Energy" ) PORT_DIPLOCATION("SW1:5,6")
3932   PORT_DIPSETTING(      0x2000, "2" )
3938   PORT_DIPNAME( 0x3000, 0x2000, "Energy" ) PORT_DIPLOCATION("SW1:5,6")
3939   PORT_DIPSETTING(      0x2000, "2" )   // factory default
39333940   PORT_DIPSETTING(      0x3000, "3" )
39343941   PORT_DIPSETTING(      0x1000, "4" )
39353942   PORT_DIPSETTING(      0x0000, "5" )
39363943   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
3937   PORT_DIPSETTING(      0x8000, "20K, Every 100K" )
3938   PORT_DIPSETTING(      0xc000, "50K, Every 200K" )
3944   PORT_DIPSETTING(      0x8000, "20K, Every 100K" )   //                          TYPO on manual "20000 200000"
3945   PORT_DIPSETTING(      0xc000, "50K, Every 200K" )   // manufacturer setting //  TYPO on manual "50000 100000"
39393946   PORT_DIPSETTING(      0x4000, "70K, 200K Only" )
39403947   PORT_DIPSETTING(      0x0000, "100K Only" )
39413948INPUT_PORTS_END
r5251r5252
95529559GAME( 1992, zingzip,  0,        zingzip,  zingzip,  0,        ROT270, "Allumer + Tecmo",        "Zing Zing Zip", 0 )
95539560GAME( 1993, atehate,  0,        atehate,  atehate,  0,        ROT0,   "Athena",                 "Athena no Hatena ?", 0 )
95549561GAME( 1993, daioh,    0,        daioh,    daioh,    0,        ROT270, "Athena",                 "Daioh", 0 )
9555GAME( 1993, jjsquawk, 0,        jjsquawk, jjsquawk, 0,        ROT0,   "Athena / Able",          "J. J. Squawkers", 0 )
9556GAME( 1993, jjsquawb, jjsquawk, jjsquawb, jjsquawk, 0,        ROT0,   "bootleg",                "J. J. Squawkers (bootleg)", 0 )
9562GAME( 1993, jjsquawk, 0,        jjsquawk, jjsquawk, 0,        ROT0,   "Athena / Able",          "J. J. Squawkers", GAME_IMPERFECT_SOUND )
9563GAME( 1993, jjsquawb, jjsquawk, jjsquawb, jjsquawk, 0,        ROT0,   "bootleg",                "J. J. Squawkers (bootleg)", GAME_IMPERFECT_SOUND )
95579564GAME( 1993, kamenrid, 0,        kamenrid, kamenrid, 0,        ROT0,   "Toei / Banpresto",       "Masked Riders Club Battle Race", 0 )
95589565GAME( 1993, madshark, 0,        madshark, madshark, 0,        ROT270, "Allumer",                "Mad Shark", 0 )
95599566GAME( 1993, msgundam, 0,        msgundam, msgundam, 0,        ROT0,   "Banpresto",              "Mobile Suit Gundam", 0 )
src/mame/drivers/naomi.c
r5251r5252
30853085/*
30863086
30873087SYSTEMID: NAOMI
3088JAP: SHOOTOUT POOL
3089USA: SHOOTOUT POOL
3090EXP: SHOOTOUT POOL PRIZE
3091
3092*/
3093
3094ROM_START( shootpl )
3095   ROM_REGION( 0x200000, "maincpu", 0)
3096   NAOMI_BIOS
3097
3098   ROM_REGION( 0x2800000, "user1", ROMREGION_ERASEFF)
3099   ROM_LOAD("epr-a-24065.rom0.ic11",0x0000000, 0x0400000, CRC(622a9ba0) SHA1(2f4963b8447ecda78fea0107497c2811f075c07a) )
3100   ROM_RELOAD( 0x400000, 0x400000)
3101   ROM_LOAD32_WORD("opr-24060.rom1.ic17s", 0x0800000, 0x0800000, CRC(7f3d868c) SHA1(dc352981371c5479a69756bb1cbbbca43252216d) )
3102   ROM_LOAD32_WORD("opr-24061.rom2.ic18",  0x0800002, 0x0800000, CRC(e934267c) SHA1(fdbe2b80e309aa8d9fefd2634aef20153735019d) )
3103   ROM_LOAD32_WORD("opr-24062.rom3.ic19s", 0x1800000, 0x0800000, CRC(26e32af4) SHA1(49412a04198175240ef9adb4b7afb8a628eb127d) )
3104   ROM_LOAD32_WORD("opr-24063.rom4.ic20",  0x1800002, 0x0800000, CRC(683fdcff) SHA1(890816ef1b3e604e16289998cf66e221ef75a0fe) )
3105ROM_END
3106
3107/*
3108
3109SYSTEMID: NAOMI
30883110JAP: SPAWN JAPAN
30893111USA: SPAWN USA
30903112EXP: SPAWN EURO
r5251r5252
36013623/* 0041C */ GAME( 2000, slasho,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
36023624/* 0044C */ GAME( 2001, csmash,   naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
36033625/* 0044C */ GAME( 2001, csmasho,  csmash,   naomi,    naomi,    naomi, ROT0, "Sega",            "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
3626/* 0128C */ GAME( 2001, shootpl,  naomi,    naomi,    naomi,    naomi, ROT0, "Sega",            "Shootout Pool (JPN, USA, KOR, AUS) / Shootout Pool Prize (EXP)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
36043627
36053628/* 841-xxxxx ("Licensed by Sega" games)*/
36063629/* 0001C */ GAME( 1999, pstone,   naomi,    naomi,    naomi,    naomi,    ROT0, "Capcom",          "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
src/mame/drivers/galdrvr.c
r5251r5252
52255225//GAME( 1983, hunchbks, hunchbak, theend  /*hunchbks*/, hunchbks, scramble_ppi, ROT90, "Century Electronics", "Hunchback (Scramble hardware)", GAME_SUPPORTS_SAVE )
52265226//GAME( 1984, hncholms, huncholy, theend  /*hncholms*/, hncholms, scramble_ppi, ROT90, "Century Electronics", "Hunchback Olympic (Scramble hardware)", GAME_SUPPORTS_SAVE )
52275227//GAME( 1983, cavelon,  0,        theend  /*cavelon*/,  cavelon,  cavelon,      ROT90, "Jetsoft", "Cavelon", GAME_SUPPORTS_SAVE )
5228//GAME( 198?, mimonscr, mimonkey, theend  /*mimonscr*/, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
5228//GAME( 1982, mimonscr, mimonkey, theend  /*mimonscr*/, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
52295229//GAME( 1983, ad2083,   0,        theend  /*ad2083*/,   ad2083,   ad2083,       ROT90, "Midcoin", "A. D. 2083", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
52305230//GAME( 1981, turpins,  turtles,  turtles,  turpins,  0,              ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
52315231
r5251r5252
52425242//GAME( 1981, hustler,  0,        scobra/*hustler*/,  hustler,  hustler,      ROT90,  "Konami", "Video Hustler", GAME_SUPPORTS_SAVE )
52435243//GAME( 1981, billiard, hustler,  scobra/*hustler*/,  hustler,  billiard,     ROT90,  "bootleg", "The Billiards", GAME_SUPPORTS_SAVE )
52445244//GAME( 1981, hustlerb, hustler,  scobra/*hustlerb*/, hustler,  scramble_ppi, ROT90,  "bootleg", "Video Hustler (bootleg)", GAME_SUPPORTS_SAVE )
5245//GAME( 198?, mimonkey, 0,      scobra/*mimonkey*/, mimonkey,   mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
5246//GAME( 198?, mimonsco, mimonkey, scobra/*mimonkey*/, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
5245//GAME( 1982, mimonkey, 0,        scobra/*mimonkey*/, mimonkey, mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
5246//GAME( 1982, mimonsco, mimonkey, scobra/*mimonkey*/, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
52475247
52485248/* currently in dambustr.c and should be moved here */
52495249//GAME( 1981, dambustr, 0,        dambustr, dambustr, dambustr, ROT90, "South West Research", "Dambusters (US)", 0 )
src/mame/drivers/snk6502.c
r0r5252
1/***************************************************************************
2
3    Sasuke vs. Commander
4    SNK
5
6    driver by ?
7
8    Games supported:
9        * Sasuke vs. Commander
10        * Satan of Saturn          [2 sets]
11        * Zarzon (clone of 'satansat')
12        * Vanguard                 [3 sets]
13        * Fantasy                  [3 sets]       G-202
14        * Pioneer Balloon                         G-204
15        * Nibbler                  [4 sets]       G-208
16
17    DIP locations verified from manual for:
18        * Zarzon    (Satan of Saturn uses the same code, so I guess locations are the same)
19        * Vanguard
20        * Nibbler
21
22****************************************************************************
23
24Vanguard memory map (preliminary)
25
260000-03ff RAM
270400-07ff Video RAM 1
280800-0bff Video RAM 2
290c00-0fff Color RAM (3 bits for video RAM 1 and 3 bits for video RAM 2)
301000-1fff Character generator RAM
314000-bfff ROM
32
33read:
343104      IN0
353105      IN1
363106      DSW
373107      IN2
38
39write
403100      Sound Port 0
413101      Sound Port 1
423103      bit 7 = flip screen
433200      y scroll register
443300      x scroll register
45
46****************************************************************************
47
48Fantasy and Nibbler memory map (preliminary)
49
500000-03ff RAM
510400-07ff Video RAM 1
520800-0bff Video RAM 2
530c00-0fff Color RAM (3 bits for video RAM 1 and 3 bits for video RAM 2)
541000-1fff Character generator RAM
553000-bfff ROM
56
57read:
582104      IN0
592105      IN1
602106      DSW
612107      IN2
62
63write
642000-2001 To the HD46505S video controller
652100      Sound Port 0
662101      Sound Port 1
672103      bit 7 = flip screen
68          bit 4-6 = music 2
69          bit 3 = char bank selector
70          bit 0-2 = background color
712200      y scroll register
722300      x scroll register
73
74Interrupts: VBlank causes an IRQ. Coin insertion causes a NMI.
75
76****************************************************************************
77
78Pioneer Balloon memory map (preliminary)
79
800000-03ff RAM          IC13 cpu
810400-07ff Video RAM 1  IC67 video
820800-0bff Video RAM 2  ???? video
830c00-0fff Color RAM    IC68 (3 bits for VRAM 1 and 3 bits for VRAM 2)
841000-1fff RAM          ???? Character generator
853000-3fff ROM 4/5      IC12
864000-4fff ROM 1        IC07
875000-5fff ROM 2        IC08
886000-6fff ROM 3        IC09
897000-7fff ROM 4        IC10
908000-8fff ROM 5        IC14
919000-9fff ROM 6        IC15
92
93read:
94b104      IN0
95b105      IN1
96b106      DSW
97b107      IN2
98
99write
100b000      Sound Port 0
101b001      Sound Port 1
102b100      ????
103b103      bit 7 = flip screen
104          bit 4-6 = music 2
105          bit 3 = char bank selector
106          bit 0-2 = background color
107b106      ????
108b200      y scroll register
109b300      x scroll register
110
111Interrupts: VBlank causes an IRQ. Coin insertion causes a NMI.
112
113****************************************************************************
114
115Stephh's notes (based on the games M6502 code and some tests) :
116
1171a) 'vanguard'
118
119  - There are 5 different coinage settings according to the game code
120    which are based on DSW bits 1 to 3 :
121
122      bit 3   bit 2   bit 1    effect
123       OFF     OFF     OFF      1C_1C
124       OFF     OFF     ON       2C_1C   (manual tells this is the default setting)
125       OFF     ON      OFF      1C_3C
126       ON      OFF     OFF      1C_2C
127       ON      ON      OFF      1C_6C
128
129    The 3 other combinaisons give 1C_1C
130  - From the manual, it says that DSW bit 6 determines the cost of a game :
131      * bit 6 = 0 : "25c / game"
132      * bit 6 = 1 : "50c / game"
133    When you look at the game code, it appears to be some of "Bonus Coinage" :
134      * bit 6 = 0 : you get an additional credit each time you insert 1 coin
135      * bit 6 = 1 : you get an additional credit each time you insert 2 coins
136  - So, instead of having something like this :
137        PORT_DIPNAME( 0x0e, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!3,!4")
138        PORT_DIPSETTING(    0x02, "25c= 1C/1C 2C/3C 50c= 2C/2C" )
139        PORT_DIPSETTING(    0x00, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
140        PORT_DIPSETTING(    0x08, "25c= 1C/3C 50c= 1C/2C 2C/5C" )
141        PORT_DIPSETTING(    0x04, "25c= 1C/4C 50c= 1C/3C 2C/7C" )
142        PORT_DIPSETTING(    0x0c, "25c= 1C/7C 50c= 1C/6C 2C/13C" )
143        duplicate settings - untested in game code
144        PORT_DIPSETTING(    0x06, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
145        PORT_DIPSETTING(    0x0a, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
146        PORT_DIPSETTING(    0x0e, "25c= 1C/2C 50c= 1C/1C 2C/3C" )
147        ...
148        PORT_DIPNAME( 0x40, 0x00, "Game Cost" ) PORT_DIPLOCATION("SW1:!7")
149        PORT_DIPSETTING(    0x00, "25c / game" )
150        PORT_DIPSETTING(    0x40, "50c / game" )
151    or using conditional Dip Switches, I've coded this the way I did.
152  - You can always continue, provided you're on the 1st pattern.
153    The continue text is in English !
154  - 10 letters when you enter your initials
155
1561b) 'vangrdce'
157
158  - Code for coinage is the same as for 'vanguard'.
159  - You can always continue, provided you're on the 1st pattern.
160    The continue text is in English !
161  - 3 letters when you enter your initials
162
1631c) 'vanguarj'
164
165  - Code for coinage is the same as for 'vanguard'.
166  - You can always continue, provided you're on the 1st pattern.
167    The continue text is in Japanese !
168  - 10 letters when you enter your initials
169
1702a) 'fantasy'
171
172  - Code for coinage is the same as for 'vanguard'.
173  - You can always continue, provided you're on the 1st pattern.
174    Note that the continue text is in German !
175  - 3 letters when you enter your initials
176  - I can't tell if it's an ingame bug or not, but there's a mix
177    between "COIN" and "CREDIT" ("COCR" is displayed)
178
1792b) 'fantasyu'
180
181  - Code for coinage is the same as for 'vanguard'.
182  - This version seems easier than 'fantasy', especially on level 2
183    where you have a sword and an easier maze.
184  - Code has been added to test DSW bit 7 to allow or not a continue play.
185    Note that the continue play is only available on the 1st pattern.
186  - 3 letters when you enter your initials
187  - "Fantasy" is written with different "font" and color
188  - "CREDIT" is displayed instead of "COIN"
189
1902b) 'fantasyj'
191
192  - Code for coinage is the same as for 'vanguard'.
193  - This version seems easier than 'fantasy', especially on level 2
194    where you have a sword and an easier maze.
195  - Code has been added to test DSW bit 7 to allow or not a continue play.
196    Note that the continue play is only available on the 1st pattern.
197    Also note that the continue text is still in English !
198  - 3 letters when you enter your initials
199  - "COIN" is correctly displayed.
200
2013)  'pballoon'
202
203  - Code for coinage is the same as for 'vanguard'.
204  - The "Language" Dip Switch only has an effect at the end of the pattern
205    when it displays "LAND HERE" or what I suppose to be same in Japanese.
206  - 3 letters when you enter your initials
207  - "CREDIT" is displayed
208
2094a) 'nibbler'
210
211  - "Lives settings" : 3, 4, 5 or 6 (table at 0x4edf)
212  - Bonus life every 4 levels
213  - Simplified instructions
214  - DSW bit 2 determines what happens when the snake touches a corner (code at 0x3c91) :
215      * bit 2 = 0 : pause for 13 frames
216      * bit 2 = 1 : no pause
217
2184b) 'nibblera'
219
220  - "Lives settings" : 3, 4, 5 or 6 (table at 0x5bf0)
221  - Bonus life every 4 levels
222  - Detailed instructions
223  - DSW bit 2 is no more tested when the snake touches a corner (code at 0x3b3c);
224    this means that the snake ALWAYS pauses for 13 frames.
225    However, there is extra code where it is tested to determine difficulty
226    (code at 0x31b4 and 0x32f5 - tables at 0x3391 and 0x33b2)
227
2284c) 'nibblerb'
229
230  - code based on 'nibblera'
231  - "Lives settings" : 2, 3, 4 or 5 (table at 0x5be7)
232  - Bonus life every 4 levels
233  - Detailed instructions
234  - The snake ALWAYS pauses for 13 frames (code at 0x3b38) when it touches a corner
235    and DSW bit 2 determines difficulty as in 'nibblera'
236    (code at 0x31b0 and 0x32f1 - tables at 0x338d and 0x33ae)
237
2384d) 'nibblero'
239
240  - code is the same as 'nibblerb' (same routines, same code and tables addresses)
241  - "Lives settings" : 2, 3, 4 or 5 (table at 0x5be7)
242  - Bonus life every 8 levels
243  - Detailed instructions
244  - The snake ALWAYS pauses for 13 frames (code at 0x3b38) when it touches a corner
245    and DSW bit 2 determines difficulty as in 'nibblera'
246    (code at 0x31b0 and 0x32f1 - tables at 0x338d and 0x33ae)
247  - The game is harder than 'nibblerb' because the tables at 0x338d and 0x33ae
248    have higher values; so the snake goes faster and grows longer.
249
250***************************************************************************/
251
252/*
253
254    TODO:
255
256    - sasuke/satansat/vanguard discrete sound
257    - vanguard/fantasy speech (hd38880/hd38882 emulation)
258    - music freq (Satan of Saturn and clone)
259    - correct music waveform/volume control
260    - correct ROM names
261    - fantasy is German? (the continue text is in German)
262
263*/
264
265#include "driver.h"
266#include "deprecat.h"
267#include "cpu/m6502/m6502.h"
268#include "video/mc6845.h"
269#include "sound/sn76477.h"
270#include "sound/samples.h"
271#include "snk6502.h"
272
273
274#define MASTER_CLOCK   XTAL_11_289MHz
275
276/* Change to 1 to allow fake debug buttons */
277#define NIBBLER_HACK   0
278
279
280#ifndef M_LN2
281#define M_LN2      0.69314718055994530942
282#endif
283
284
285/* binary counter (1.4MHz update) */
286static UINT8 sasuke_counter;
287static emu_timer *sasuke_timer;
288
289static TIMER_CALLBACK( sasuke_update_counter )
290{
291   sasuke_counter += 0x10;
292}
293
294static void sasuke_start_counter(running_machine *machine)
295{
296   sasuke_counter = 0;
297
298   sasuke_timer = timer_alloc(machine, sasuke_update_counter, NULL);
299   timer_adjust_periodic(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(MASTER_CLOCK / 8));   // 1.4 MHz
300}
301
302
303/*************************************
304 *
305 *  Custom input ports
306 *
307 *************************************/
308
309static CUSTOM_INPUT( snk6502_music0_r )
310{
311   return (snk6502_music0_playing() ? 0x01 : 0x00);
312}
313
314static CUSTOM_INPUT( sasuke_count_r )
315{
316   return (sasuke_counter >> 4);
317}
318
319
320/*************************************
321 *
322 *  Memory maps
323 *
324 *************************************/
325
326static ADDRESS_MAP_START( sasuke_map, ADDRESS_SPACE_PROGRAM, 8 )
327   AM_RANGE(0x0000, 0x03ff) AM_RAM
328   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(snk6502_videoram2_w) AM_BASE(&snk6502_videoram2)
329   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(snk6502_videoram_w) AM_BASE(&videoram)
330   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(snk6502_colorram_w) AM_BASE(&colorram)
331   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(snk6502_charram_w) AM_BASE(&snk6502_charram)
332   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("crtc", mc6845_address_w)
333   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("crtc", mc6845_register_w)
334   AM_RANGE(0x4000, 0x8fff) AM_ROM
335   AM_RANGE(0xb000, 0xb001) AM_WRITE(sasuke_sound_w)
336   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
337   AM_RANGE(0xb003, 0xb003) AM_WRITE(satansat_backcolor_w)
338   AM_RANGE(0xb004, 0xb004) AM_READ_PORT("IN0")
339   AM_RANGE(0xb005, 0xb005) AM_READ_PORT("IN1")
340   AM_RANGE(0xb006, 0xb006) AM_READ_PORT("DSW")
341   AM_RANGE(0xb007, 0xb007) AM_READ_PORT("IN2")
342   AM_RANGE(0xf800, 0xffff) AM_ROM
343ADDRESS_MAP_END
344
345static ADDRESS_MAP_START( satansat_map, ADDRESS_SPACE_PROGRAM, 8 )
346   AM_RANGE(0x0000, 0x03ff) AM_RAM
347   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(snk6502_videoram2_w) AM_BASE(&snk6502_videoram2)
348   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(snk6502_videoram_w) AM_BASE(&videoram)
349   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(snk6502_colorram_w) AM_BASE(&colorram)
350   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(snk6502_charram_w) AM_BASE(&snk6502_charram)
351   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("crtc", mc6845_address_w)
352   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("crtc", mc6845_register_w)
353   AM_RANGE(0x4000, 0x97ff) AM_ROM
354   AM_RANGE(0xb000, 0xb001) AM_WRITE(satansat_sound_w)
355   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
356   AM_RANGE(0xb003, 0xb003) AM_WRITE(satansat_backcolor_w)
357   AM_RANGE(0xb004, 0xb004) AM_READ_PORT("IN0")
358   AM_RANGE(0xb005, 0xb005) AM_READ_PORT("IN1")
359   AM_RANGE(0xb006, 0xb006) AM_READ_PORT("DSW")
360   AM_RANGE(0xb007, 0xb007) AM_READ_PORT("IN2")
361   AM_RANGE(0xf800, 0xffff) AM_ROM
362ADDRESS_MAP_END
363
364static ADDRESS_MAP_START( vanguard_map, ADDRESS_SPACE_PROGRAM, 8 )
365   AM_RANGE(0x0000, 0x03ff) AM_RAM
366   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(snk6502_videoram2_w) AM_BASE(&snk6502_videoram2)
367   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(snk6502_videoram_w) AM_BASE(&videoram)
368   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(snk6502_colorram_w) AM_BASE(&colorram)
369   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(snk6502_charram_w) AM_BASE(&snk6502_charram)
370   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("crtc", mc6845_address_w)
371   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("crtc", mc6845_register_w)
372   AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w)
373   AM_RANGE(0x3103, 0x3103) AM_WRITE(snk6502_flipscreen_w)
374   AM_RANGE(0x3104, 0x3104) AM_READ_PORT("IN0")
375   AM_RANGE(0x3105, 0x3105) AM_READ_PORT("IN1")
376   AM_RANGE(0x3106, 0x3106) AM_READ_PORT("DSW")
377   AM_RANGE(0x3107, 0x3107) AM_READ_PORT("IN2")
378   AM_RANGE(0x3200, 0x3200) AM_WRITE(snk6502_scrollx_w)
379   AM_RANGE(0x3300, 0x3300) AM_WRITE(snk6502_scrolly_w)
380   AM_RANGE(0x3400, 0x3400) AM_WRITE(vanguard_speech_w)   // speech
381   AM_RANGE(0x4000, 0xbfff) AM_ROM
382   AM_RANGE(0xf000, 0xffff) AM_ROM   /* for the reset / interrupt vectors */
383ADDRESS_MAP_END
384
385static ADDRESS_MAP_START( fantasy_map, ADDRESS_SPACE_PROGRAM, 8 )
386   AM_RANGE(0x0000, 0x03ff) AM_RAM
387   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(snk6502_videoram2_w) AM_BASE(&snk6502_videoram2)
388   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(snk6502_videoram_w) AM_BASE(&videoram)
389   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(snk6502_colorram_w) AM_BASE(&colorram)
390   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(snk6502_charram_w) AM_BASE(&snk6502_charram)
391   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("crtc", mc6845_address_w)
392   AM_RANGE(0x2001, 0x2001) AM_DEVWRITE("crtc", mc6845_register_w)
393   AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w)
394   AM_RANGE(0x2104, 0x2104) AM_READ_PORT("IN0")
395   AM_RANGE(0x2105, 0x2105) AM_READ_PORT("IN1")
396   AM_RANGE(0x2106, 0x2106) AM_READ_PORT("DSW")
397   AM_RANGE(0x2107, 0x2107) AM_READ_PORT("IN2")
398   AM_RANGE(0x2200, 0x2200) AM_WRITE(snk6502_scrollx_w)
399   AM_RANGE(0x2300, 0x2300) AM_WRITE(snk6502_scrolly_w)
400   AM_RANGE(0x2400, 0x2400) AM_WRITE(fantasy_speech_w)   // speech
401   AM_RANGE(0x3000, 0xbfff) AM_ROM
402   AM_RANGE(0xf000, 0xffff) AM_ROM
403ADDRESS_MAP_END
404
405static ADDRESS_MAP_START( pballoon_map, ADDRESS_SPACE_PROGRAM, 8 )
406   AM_RANGE(0x0000, 0x03ff) AM_RAM
407   AM_RANGE(0x0400, 0x07ff) AM_RAM_WRITE(snk6502_videoram2_w) AM_BASE(&snk6502_videoram2)
408   AM_RANGE(0x0800, 0x0bff) AM_RAM_WRITE(snk6502_videoram_w) AM_BASE(&videoram)
409   AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(snk6502_colorram_w) AM_BASE(&colorram)
410   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(snk6502_charram_w) AM_BASE(&snk6502_charram)
411   AM_RANGE(0x3000, 0x9fff) AM_ROM
412   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("crtc", mc6845_address_w)
413   AM_RANGE(0xb001, 0xb001) AM_DEVWRITE("crtc", mc6845_register_w)
414   AM_RANGE(0xb100, 0xb103) AM_WRITE(fantasy_sound_w)
415   AM_RANGE(0xb104, 0xb104) AM_READ_PORT("IN0")
416   AM_RANGE(0xb105, 0xb105) AM_READ_PORT("IN1")
417   AM_RANGE(0xb106, 0xb106) AM_READ_PORT("DSW")
418   AM_RANGE(0xb107, 0xb107) AM_READ_PORT("IN2")
419   AM_RANGE(0xb200, 0xb200) AM_WRITE(snk6502_scrollx_w)
420   AM_RANGE(0xb300, 0xb300) AM_WRITE(snk6502_scrolly_w)
421   AM_RANGE(0xf000, 0xffff) AM_ROM
422ADDRESS_MAP_END
423
424
425/*************************************
426 *
427 *  Port definitions
428 *
429 *************************************/
430
431static INPUT_PORTS_START( snk6502_generic_joy8way )
432   PORT_START("IN0")
433   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
434   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
435   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
436   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
437   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_8WAY
438   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_8WAY
439   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
440   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
441
442   PORT_START("IN1")
443   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
444   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
445   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
446   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
447   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
448   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
449   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
450   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
451
452   PORT_START("IN2")
453   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
455   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
456   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
457   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
458   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
459   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
460   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
461
462   PORT_START("DSW")
463   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1")
464   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
465   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
466   PORT_DIPNAME( 0x0e, 0x02, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!3,!4")
467   PORT_DIPSETTING (   0x02, DEF_STR( 2C_1C ) )
468   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
469   PORT_DIPSETTING (   0x08, DEF_STR( 1C_2C ) )
470   PORT_DIPSETTING (   0x04, DEF_STR( 1C_3C ) )
471   PORT_DIPSETTING (   0x0c, DEF_STR( 1C_6C ) )
472/*  PORT_DIPSETTING (   0x06, DEF_STR( 1C_1C ) ) */
473/*  PORT_DIPSETTING (   0x0a, DEF_STR( 1C_1C ) ) */
474/*  PORT_DIPSETTING (   0x0e, DEF_STR( 1C_1C ) ) */
475   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!5,!6")
476   PORT_DIPSETTING(    0x00, "3" )
477   PORT_DIPSETTING(    0x10, "4" )
478   PORT_DIPSETTING(    0x20, "5" )
479/*  PORT_DIPSETTING(    0x30, "3" ) */
480   PORT_DIPNAME( 0x40, 0x00, "Coinage Bonus" ) PORT_DIPLOCATION("SW1:!7")      /* see notes */
481   PORT_DIPSETTING (   0x40, DEF_STR( 2C_1C ) )
482   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
483   PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_HIGH, "SW1:!8" )
484INPUT_PORTS_END
485
486static INPUT_PORTS_START( satansat )
487   PORT_START("IN0")
488   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
489   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
490   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
491   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
492   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
493   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
494   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
495   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
496
497   PORT_START("IN1")
498   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
499   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
500   PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
501   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk6502_music0_r, NULL)     /* music0 playing */
502
503   PORT_START("IN2")
504   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
505   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNKNOWN )                                         /* NC */
506   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sasuke_count_r, NULL)       /* connected to a binary counter */
507
508   PORT_START("DSW")
509   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!1")
510   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
511   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
512   PORT_DIPNAME( 0x0a, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2,!4")
513   PORT_DIPSETTING (   0x08, DEF_STR( 2C_1C ) )
514   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
515   PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
516/*  PORT_DIPSETTING (   0x0a, DEF_STR( 2C_1C ) ) */
517   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:!3")
518   PORT_DIPSETTING (   0x04, "5000" )
519   PORT_DIPSETTING (   0x00, "10000" )
520   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!5,!6") /* manual says 4 is the default value */
521   PORT_DIPSETTING (   0x00, "3" )
522   PORT_DIPSETTING (   0x10, "4" )
523   PORT_DIPSETTING (   0x20, "5" )
524/*  PORT_DIPSETTING(    0x30, "3" ) */
525   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_HIGH, "SW1:!7" )
526   PORT_DIPNAME( 0x80, 0x00, "RAM Test" ) PORT_DIPLOCATION("SW1:!8") /* unused according to manual */
527   PORT_DIPSETTING (   0x00, DEF_STR( Off ) )
528   PORT_DIPSETTING (   0x80, DEF_STR( On ) )
529INPUT_PORTS_END
530
531/* Derived from 'satansat'. Might not reflect the actual hardware. Dip Swicthes verified from game code though. */
532static INPUT_PORTS_START( sasuke )
533   PORT_INCLUDE(satansat)
534
535   PORT_MODIFY("IN0")
536   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START1 )
537   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
538
539   PORT_MODIFY("IN1")
540   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
541   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
542
543   PORT_MODIFY("DSW")
544   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!2")
545   PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )
546   PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
547   PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_HIGH, "SW1:!4" )
548INPUT_PORTS_END
549
550static INPUT_PORTS_START( vanguard )
551   PORT_INCLUDE(snk6502_generic_joy8way)
552
553   PORT_MODIFY("IN0")
554   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )                /* fire down */
555   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 )                /* fire up */
556   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )                /* fire right */
557   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )                /* fire left */
558
559   PORT_MODIFY("IN1")
560   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL  /* fire down */
561   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_COCKTAIL  /* fire up */
562   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL  /* fire right */
563   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL  /* fire left */
564
565   PORT_MODIFY("IN2")
566   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk6502_music0_r, NULL)     /* music0 playing */
567INPUT_PORTS_END
568
569static INPUT_PORTS_START( fantasy )
570   PORT_INCLUDE(snk6502_generic_joy8way)
571INPUT_PORTS_END
572
573static INPUT_PORTS_START( fantasyu )
574   PORT_INCLUDE(fantasy)
575
576   PORT_MODIFY("DSW")
577   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:!8")
578   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
579   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )              /* 1st pattern only */
580INPUT_PORTS_END
581
582static INPUT_PORTS_START( pballoon )
583   PORT_INCLUDE(snk6502_generic_joy8way)
584
585   PORT_MODIFY("IN0")
586   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
587
588   PORT_MODIFY("IN1")
589   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
590
591   PORT_MODIFY("DSW")
592   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:!8")  /* code at 0x6c83 */
593   PORT_DIPSETTING(    0x80, DEF_STR( English ) )
594   PORT_DIPSETTING(    0x00, DEF_STR( Japanese ) )
595INPUT_PORTS_END
596
597static INPUT_PORTS_START( nibbler )
598   PORT_INCLUDE(snk6502_generic_joy8way)
599
600   /* There are no buttons on a real "Nibbler" cabinet, but I guess that the game was tested
601       with a "Vanguard" cabinet so they have been mapped with debug features. */
602#if NIBBLER_HACK
603   PORT_MODIFY("IN0")
604   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 0") PORT_CODE(KEYCODE_Z) // slow down
605   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 1") PORT_CODE(KEYCODE_X)
606   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 2") PORT_CODE(KEYCODE_C)
607   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 3") PORT_CODE(KEYCODE_V)
608
609   PORT_MODIFY("IN1")
610   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 4") PORT_CODE(KEYCODE_B) // pause
611   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 5") PORT_CODE(KEYCODE_N) // unpause
612   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 6") PORT_CODE(KEYCODE_M) // end game
613   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Debug 7") PORT_CODE(KEYCODE_K)
614#endif
615
616   PORT_MODIFY("DSW")
617   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2")
618   PORT_DIPSETTING(    0x00, "3" )
619   PORT_DIPSETTING(    0x01, "4" )
620   PORT_DIPSETTING(    0x02, "5" )
621   PORT_DIPSETTING(    0x03, "6" )
622   PORT_DIPNAME( 0x04, 0x00, "Pause at Corners" ) PORT_DIPLOCATION("SW1:!3")
623   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:!4")
626   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
627   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
628   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW1:!5")
629   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
630   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
631   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:!6")
632   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
633   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
634   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!7,!8")
635   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
636   PORT_DIPSETTING(    0xc0, "2 Coins/1 Credit 4/3" )
637   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
638   PORT_DIPSETTING(    0x80, "1 Coin/1 Credit 2/3" )
639INPUT_PORTS_END
640
641static INPUT_PORTS_START( nibblera )
642   PORT_INCLUDE(nibbler)
643
644   PORT_MODIFY("DSW")
645   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!3")
646   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
647   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
648INPUT_PORTS_END
649
650static INPUT_PORTS_START( nibblerb )
651   PORT_INCLUDE(nibblera)
652
653   PORT_MODIFY("DSW")
654   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:!1,!2")
655   PORT_DIPSETTING(    0x00, "2" )
656   PORT_DIPSETTING(    0x01, "3" )
657   PORT_DIPSETTING(    0x02, "4" )
658   PORT_DIPSETTING(    0x03, "5" )
659INPUT_PORTS_END
660
661
662/*************************************
663 *
664 *  Graphics layouts
665 *
666 *************************************/
667
668static const gfx_layout swapcharlayout =
669{
670   8,8,    /* 8*8 characters */
671   256,   /* 256 characters */
672   2,      /* 2 bits per pixel */
673   { 256*8*8, 0 }, /* the two bitplanes are separated */
674   { 0, 1, 2, 3, 4, 5, 6, 7 },
675   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
676   8*8     /* every char takes 8 consecutive bytes */
677};
678
679static const gfx_layout charlayout =
680{
681   8,8,    /* 8*8 characters */
682   RGN_FRAC(1,2),
683   2,      /* 2 bits per pixel */
684   { 0, RGN_FRAC(1,2) }, /* the two bitplanes are separated */
685   { 0, 1, 2, 3, 4, 5, 6, 7 },
686   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
687   8*8     /* every char takes 8 consecutive bytes */
688};
689
690static const gfx_layout charlayout_memory =
691{
692   8,8,    /* 8*8 characters */
693   256,   /* 256 characters */
694   2,      /* 2 bits per pixel */
695   { 0, 256*8*8 }, /* the two bitplanes are separated */
696   { 0, 1, 2, 3, 4, 5, 6, 7 },
697   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
698   8*8     /* every char takes 8 consecutive bytes */
699};
700
701
702static GFXDECODE_START( sasuke )
703   GFXDECODE_ENTRY( NULL,           0x1000, swapcharlayout,      0, 4 )   /* the game dynamically modifies this */
704   GFXDECODE_ENTRY( "gfx1", 0x0000, swapcharlayout,    4*4, 4 )
705GFXDECODE_END
706
707static GFXDECODE_START( satansat )
708   GFXDECODE_ENTRY( NULL,           0x1000, charlayout_memory,   0, 4 )   /* the game dynamically modifies this */
709   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout,        4*4, 4 )
710GFXDECODE_END
711
712static GFXDECODE_START( vanguard )
713   GFXDECODE_ENTRY( NULL,           0x1000, charlayout_memory,   0, 8 )   /* the game dynamically modifies this */
714   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout,        8*4, 8 )
715GFXDECODE_END
716
717
718/*************************************
719 *
720 *  Interrupt Generators
721 *
722 *************************************/
723
724static INTERRUPT_GEN( satansat_interrupt )
725{
726   if (cpu_getiloops(device) != 0)
727   {
728      UINT8 val = input_port_read(device->machine, "IN2");
729
730      coin_counter_w(0, val & 1);
731
732      /* user asks to insert coin: generate a NMI interrupt. */
733      if (val & 0x01)
734         cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
735   }
736   else
737      cpu_set_input_line(device, M6502_IRQ_LINE, HOLD_LINE);   /* one IRQ per frame */
738}
739
740static INTERRUPT_GEN( snk6502_interrupt )
741{
742   if (cpu_getiloops(device) != 0)
743   {
744      UINT8 val = input_port_read(device->machine, "IN2");
745
746      coin_counter_w(0, val & 1);
747      coin_counter_w(1, val & 2);
748
749      /* user asks to insert coin: generate a NMI interrupt. */
750      if (val & 0x03)
751         cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
752   }
753   else
754      cpu_set_input_line(device, M6502_IRQ_LINE, HOLD_LINE);   /* one IRQ per frame */
755}
756
757
758/*************************************
759 *
760 *  6845 CRTC interface
761 *
762 *************************************/
763
764static const mc6845_interface mc6845_intf =
765{
766   "screen",   /* screen we are acting on */
767   8,         /* number of pixels per video memory address */
768   NULL,      /* before pixel update callback */
769   NULL,      /* row update callback */
770   NULL,      /* after pixel update callback */
771   DEVCB_NULL,   /* callback for display state changes */
772   DEVCB_NULL,   /* callback for cursor state changes */
773   DEVCB_NULL,   /* HSYNC callback */
774   DEVCB_NULL,   /* VSYNC callback */
775   NULL      /* update address callback */
776};
777
778
779/*************************************
780 *
781 *  Machine initialisation
782 *
783 *************************************/
784
785static MACHINE_RESET( sasuke )
786{
787   //snk6502_set_music_clock(M_LN2 * (RES_K(1) + RES_K(10) * 2) * CAP_U(1));
788   // adjusted
789   snk6502_set_music_clock(1 / 72.1);
790
791   // adjusted
792   snk6502_set_music_freq(38000);
793
794   sasuke_start_counter(machine);
795}
796
797static MACHINE_RESET( satansat )
798{
799   // same as sasuke
800   snk6502_set_music_freq(38000);
801
802   sasuke_start_counter(machine);
803}
804
805static MACHINE_RESET( vanguard )
806{
807   // 41.6 Hz update (measured)
808   snk6502_set_music_clock(1 / 41.6);
809}
810
811static MACHINE_RESET( pballoon )
812{
813   // 40.3 Hz update (measured)
814   snk6502_set_music_clock(1 / 40.3);
815}
816
817
818/*************************************
819 *
820 *  Machine drivers
821 *
822 *************************************/
823
824static MACHINE_DRIVER_START( sasuke )
825   // basic machine hardware
826   MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 16) // 700 kHz
827   MDRV_CPU_PROGRAM_MAP(sasuke_map)
828   MDRV_CPU_VBLANK_INT_HACK(satansat_interrupt, 2)
829
830   MDRV_MACHINE_RESET(sasuke)
831
832   // video hardware
833
834   MDRV_SCREEN_ADD("screen", RASTER)
835   MDRV_SCREEN_REFRESH_RATE((MASTER_CLOCK / 16) / (45 * 32 * 8))
836   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
837   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
838   MDRV_SCREEN_SIZE(32*8, 32*8)
839   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
840
841   MDRV_GFXDECODE(sasuke)
842   MDRV_PALETTE_LENGTH(32)
843
844   MDRV_PALETTE_INIT(satansat)
845   MDRV_VIDEO_START(satansat)
846   MDRV_VIDEO_UPDATE(snk6502)
847
848   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
849
850   // sound hardware
851   MDRV_SPEAKER_STANDARD_MONO("mono")
852
853   MDRV_SOUND_ADD("snk6502", snk6502, 0)
854   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
855
856   MDRV_SOUND_ADD("samples", SAMPLES, 0)
857   MDRV_SOUND_CONFIG(sasuke_samples_interface)
858   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
859
860   MDRV_SOUND_ADD("sn76477.1", SN76477, 0)
861   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_1)
862   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
863
864   MDRV_SOUND_ADD("sn76477.2", SN76477, 0)
865   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_2)
866   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
867
868   MDRV_SOUND_ADD("sn76477.3", SN76477, 0)
869   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_3)
870   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
871MACHINE_DRIVER_END
872
873static MACHINE_DRIVER_START( satansat )
874   // basic machine hardware
875   MDRV_IMPORT_FROM(sasuke)
876   MDRV_CPU_MODIFY("maincpu")
877   MDRV_CPU_PROGRAM_MAP(satansat_map)
878
879   MDRV_MACHINE_RESET(satansat)
880
881   // video hardware
882   MDRV_GFXDECODE(satansat)
883
884   // sound hardware
885   MDRV_SOUND_REPLACE("samples", SAMPLES, 0)
886   MDRV_SOUND_CONFIG(vanguard_samples_interface)
887   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
888
889   MDRV_SOUND_REPLACE("sn76477.1", SN76477, 0)
890   MDRV_SOUND_CONFIG(satansat_sn76477_intf)
891   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
892
893   MDRV_DEVICE_REMOVE("sn76477.2")
894   MDRV_DEVICE_REMOVE("sn76477.3")
895MACHINE_DRIVER_END
896
897static MACHINE_DRIVER_START( vanguard )
898   // basic machine hardware
899   //MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 8)   // 1.4 MHz
900   MDRV_CPU_ADD("maincpu", M6502, 930000)      // adjusted
901   MDRV_CPU_PROGRAM_MAP(vanguard_map)
902   MDRV_CPU_VBLANK_INT_HACK(snk6502_interrupt, 2)
903
904   MDRV_MACHINE_RESET(vanguard)
905
906   // video hardware
907
908   MDRV_SCREEN_ADD("screen", RASTER)
909   MDRV_SCREEN_REFRESH_RATE((MASTER_CLOCK / 16) / (45 * 32 * 8))
910   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
911   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
912   MDRV_SCREEN_SIZE(32*8, 32*8)
913   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
914
915   MDRV_GFXDECODE(vanguard)
916   MDRV_PALETTE_LENGTH(64)
917
918   MDRV_PALETTE_INIT(snk6502)
919   MDRV_VIDEO_START(snk6502)
920   MDRV_VIDEO_UPDATE(snk6502)
921
922   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
923
924   // sound hardware
925   MDRV_SPEAKER_STANDARD_MONO("mono")
926
927   MDRV_SOUND_ADD("snk6502", snk6502, 0)
928   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
929
930   MDRV_SOUND_ADD("samples", SAMPLES, 0)
931   MDRV_SOUND_CONFIG(vanguard_samples_interface)
932   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
933
934   MDRV_SOUND_ADD("sn76477.1", SN76477, 0)
935   MDRV_SOUND_CONFIG(vanguard_sn76477_intf_1)
936   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
937
938   MDRV_SOUND_ADD("sn76477.2", SN76477, 0)
939   MDRV_SOUND_CONFIG(vanguard_sn76477_intf_2)
940   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
941MACHINE_DRIVER_END
942
943static MACHINE_DRIVER_START( fantasy )
944   // basic machine hardware
945   MDRV_IMPORT_FROM(vanguard)
946   MDRV_CPU_MODIFY("maincpu")
947   MDRV_CPU_PROGRAM_MAP(fantasy_map)
948
949   // sound hardware
950   MDRV_SOUND_REPLACE("samples", SAMPLES, 0)
951   MDRV_SOUND_CONFIG(fantasy_samples_interface)
952   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
953
954   MDRV_SOUND_REPLACE("sn76477.1", SN76477, 0)
955   MDRV_SOUND_CONFIG(fantasy_sn76477_intf)
956   MDRV_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
957
958   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
959   MDRV_SOUND_CONFIG_DISCRETE(fantasy)
960   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
961
962   MDRV_DEVICE_REMOVE("sn76477.2")
963MACHINE_DRIVER_END
964
965static MACHINE_DRIVER_START( nibbler )
966   // basic machine hardware
967   MDRV_IMPORT_FROM(fantasy)
968
969   // sound hardware
970   MDRV_DEVICE_REMOVE("samples")
971MACHINE_DRIVER_END
972
973static MACHINE_DRIVER_START( pballoon )
974   // basic machine hardware
975   MDRV_IMPORT_FROM(nibbler)
976   MDRV_CPU_MODIFY("maincpu")
977   MDRV_CPU_PROGRAM_MAP(pballoon_map)
978
979   MDRV_MACHINE_RESET(pballoon)
980
981   // video hardware
982   MDRV_SCREEN_MODIFY("screen")
983   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
984MACHINE_DRIVER_END
985
986
987/*************************************
988 *
989 *  ROM definitions
990 *
991 *************************************/
992
993ROM_START( sasuke )
994   ROM_REGION( 0x10000, "maincpu", 0 )
995   ROM_LOAD( "sc1",          0x4000, 0x0800, CRC(34cbbe03) SHA1(3d643e11370e61dde0c42c7761a856c5cf53d621) )
996   ROM_LOAD( "sc2",          0x4800, 0x0800, CRC(38cc14f0) SHA1(d60df67f2a32c131e8957e225b79618d6262463d) )
997   ROM_LOAD( "sc3",          0x5000, 0x0800, CRC(54c41285) SHA1(5618c2ac745bbde96bfda7f01f7aee7e2b643d7e) )
998   ROM_LOAD( "sc4",          0x5800, 0x0800, CRC(23edafcf) SHA1(bda3bcb506f6e23f422aafd7ca9b95bfb4d1d8e1) )
999   ROM_LOAD( "sc5",          0x6000, 0x0800, CRC(ca410e4f) SHA1(0d09422d01b4359853c173a4cb18c9b5fbc7fe7c) )
1000   ROM_LOAD( "sc6",          0x6800, 0x0800, CRC(80406afb) SHA1(2c4a34a7450fa7258c5e6ead9b1fd6c6b973f081) )
1001   ROM_LOAD( "sc7",          0x7000, 0x0800, CRC(04d0f104) SHA1(73ed501f70d2a9e8994f8392f617450eafef39b3) )
1002   ROM_LOAD( "sc8",          0x7800, 0x0800, CRC(0219104b) SHA1(fd5c43304d59bc34e9ae6ef7576d75cf319d823e) )
1003   ROM_RELOAD(               0xf800, 0x0800 ) /* for the reset/interrupt vectors */
1004   ROM_LOAD( "sc9",          0x8000, 0x0800, CRC(d6ff889a) SHA1(1eea0366205dd0d9bffb5d093f259edc1d51cbe0) )
1005   ROM_LOAD( "sc10",         0x8800, 0x0800, CRC(19df6b9a) SHA1(95e904251c39dcef227a4c125fc573e958ee78b7) )
1006
1007   ROM_REGION( 0x1000, "gfx1", 0 )
1008   ROM_LOAD( "mcs_c",        0x0000, 0x0800, CRC(aff9743d) SHA1(a968a193ca551d92f79e09d1761dd2ccebc76eee) )
1009   ROM_LOAD( "mcs_d",        0x0800, 0x0800, CRC(9c805120) SHA1(74b83daa3ce3c9f7d96ad872b9134edd6f1bcb8a) )
1010
1011   ROM_REGION( 0x0020, "proms", 0 )
1012   ROM_LOAD( "sasuke.clr",   0x0000, 0x0020, CRC(b70f34c1) SHA1(890cfbb25e14112713ba7900b9cd56554a8bc1ec) )
1013
1014   ROM_REGION( 0x1000, "snk6502", 0 )  /* sound data for Vanguard-style audio section */
1015   ROM_LOAD( "sc11",         0x0000, 0x0800, CRC(24a0e121) SHA1(e3cde355309de6678026d595955297258f069946) )
1016ROM_END
1017
1018ROM_START( satansat )
1019   ROM_REGION( 0x10000, "maincpu", 0 )
1020   ROM_LOAD( "ss1",          0x4000, 0x0800, CRC(549dd13a) SHA1(06b55d0b1da84bef30857faa398aabfd04365eb6) )
1021   ROM_LOAD( "ss2",          0x4800, 0x0800, CRC(04972fa8) SHA1(89833a7c893168acd5599ca7ad4b33a8f3df40c5) )
1022   ROM_LOAD( "ss3",          0x5000, 0x0800, CRC(9caf9057) SHA1(26d439678e5e4d375ffac60126f45de599575bfd) )
1023   ROM_LOAD( "ss4",          0x5800, 0x0800, CRC(e1bdcfe1) SHA1(c99457c18fae8de79bbbe6bc0471fdc83f1e9b19) )
1024   ROM_LOAD( "ss5",          0x6000, 0x0800, CRC(d454de19) SHA1(ae8abb8a9d999d11ba6ad341bf635ae822d5746f) )
1025   ROM_LOAD( "ss6",          0x6800, 0x0800, CRC(7fbd5d30) SHA1(be0554ade440bf255131466ee8bd2905d3f446a8) )
1026   ROM_LOAD( "zarz128.15",   0x7000, 0x0800, CRC(93ea2df9) SHA1(4f7d076deef1e14b568b06974194861d3789ab5c) )
1027   ROM_LOAD( "zarz129.16",   0x7800, 0x0800, CRC(e67ec873) SHA1(14158914f07cabe61abc400c371d742ceb61d165) )
1028   ROM_RELOAD(               0xf800, 0x0800 ) /* for the reset/interrupt vectors */
1029   ROM_LOAD( "zarz130.22",   0x8000, 0x0800, CRC(22c44650) SHA1(063915cde86aece8860db1df15497cde669e73bd) )
1030   ROM_LOAD( "ss10",         0x8800, 0x0800, CRC(8f1b313a) SHA1(0c7832505a1287533d9b2d7f2d54000b3b44e40d) )
1031   ROM_LOAD( "ss11",         0x9000, 0x0800, CRC(e74f98e0) SHA1(89a93de6105195e0e5d255bfa240538ded155fb9) )
1032
1033   ROM_REGION( 0x1000, "gfx1", 0 )
1034   ROM_LOAD( "zarz135.73",   0x0000, 0x0800, CRC(e837c62b) SHA1(97552b1e413a3934f4dc5a6fc9fc1fa8ba7a2e7e) )
1035   ROM_LOAD( "zarz136.75",   0x0800, 0x0800, CRC(83f61623) SHA1(4cb28f85f32d13bfa364c376ea3e30fd451b5884) )
1036
1037   ROM_REGION( 0x0020, "proms", 0 )
1038   ROM_LOAD( "zarz138.03",   0x0000, 0x0020, CRC(5dd6933a) SHA1(417d827d9e47b6db01fecc2164e5ef332d4cd70e) )
1039
1040   ROM_REGION( 0x1000, "snk6502", 0 )  /* sound data for Vanguard-style audio section */
1041   ROM_LOAD( "ss12",         0x0000, 0x0800, CRC(dee01f24) SHA1(92c8545226a31412239dad4aa2715b51264ad22e) )
1042   ROM_LOAD( "zarz134.54",   0x0800, 0x0800, CRC(580934d2) SHA1(c1c7eba56bca2a0ea6a68c0245b071a3308f92bd) )
1043ROM_END
1044
1045ROM_START( satansaa )
1046   ROM_REGION( 0x10000, "maincpu", 0 )
1047   ROM_LOAD( "ic7.bin",   0x4000, 0x0800, CRC(549dd13a) SHA1(06b55d0b1da84bef30857faa398aabfd04365eb6) )
1048   ROM_LOAD( "ic8.bin",   0x4800, 0x0800, CRC(04972fa8) SHA1(89833a7c893168acd5599ca7ad4b33a8f3df40c5) )
1049   ROM_LOAD( "ic9.bin",   0x5000, 0x0800, CRC(9caf9057) SHA1(26d439678e5e4d375ffac60126f45de599575bfd) )
1050   ROM_LOAD( "ic10.bin",  0x5800, 0x0800, CRC(e1bdcfe1) SHA1(c99457c18fae8de79bbbe6bc0471fdc83f1e9b19) )
1051   ROM_LOAD( "ic13.bin",  0x6000, 0x0800, CRC(d454de19) SHA1(ae8abb8a9d999d11ba6ad341bf635ae822d5746f) )
1052   ROM_LOAD( "ic14.bin",  0x6800, 0x0800, CRC(7fbd5d30) SHA1(be0554ade440bf255131466ee8bd2905d3f446a8) )
1053   ROM_LOAD( "ic15.bin",  0x7000, 0x0800, CRC(93ea2df9) SHA1(4f7d076deef1e14b568b06974194861d3789ab5c) )
1054   ROM_LOAD( "ic16.bin",  0x7800, 0x0800, CRC(9ec5fe09) SHA1(ab50373b330f21f7f64657e088ba6968a3176be4) ) // different
1055   ROM_RELOAD(            0xf800, 0x0800 ) /* for the reset/interrupt vectors */
1056   ROM_LOAD( "ic22.bin",  0x8000, 0x0800, CRC(21092f1f) SHA1(dd8be669cd7a51ec84e020d0a7fa50708155d084) ) // different
1057   ROM_LOAD( "ic23.bin",   0x8800, 0x0800, CRC(8f1b313a) SHA1(0c7832505a1287533d9b2d7f2d54000b3b44e40d) )
1058   ROM_LOAD( "ic24.bin",   0x9000, 0x0800, CRC(e74f98e0) SHA1(89a93de6105195e0e5d255bfa240538ded155fb9) )
1059
1060   ROM_REGION( 0x1000, "gfx1", 0 )
1061   ROM_LOAD( "ic73.bin",   0x0000, 0x0800, CRC(e837c62b) SHA1(97552b1e413a3934f4dc5a6fc9fc1fa8ba7a2e7e) )
1062   ROM_LOAD( "ic75.bin",   0x0800, 0x0800, CRC(83f61623) SHA1(4cb28f85f32d13bfa364c376ea3e30fd451b5884) )
1063
1064   ROM_REGION( 0x0020, "proms", 0 )
1065   ROM_LOAD( "zarz138.03",   0x0000, 0x0020, CRC(5dd6933a) SHA1(417d827d9e47b6db01fecc2164e5ef332d4cd70e) )
1066
1067   ROM_REGION( 0x1000, "snk6502", 0 )  /* sound data for Vanguard-style audio section */
1068   ROM_LOAD( "ic53.bin",   0x0000, 0x0800, CRC(8cb95a6b) SHA1(41d3986f1c2876a914b0087127ae99e9a2b41564) ) // different
1069   ROM_LOAD( "ic54.bin",   0x0800, 0x0800, CRC(580934d2) SHA1(c1c7eba56bca2a0ea6a68c0245b071a3308f92bd) )
1070ROM_END
1071
1072ROM_START( zarzon )
1073   ROM_REGION( 0x10000, "maincpu", 0 )
1074   ROM_LOAD( "zarz122.07",   0x4000, 0x0800, CRC(bdfa67e2) SHA1(0de06cf53ee21b8f14b933b61e6dc706338746c4) )
1075   ROM_LOAD( "zarz123.08",   0x4800, 0x0800, CRC(d034e61e) SHA1(dc802c3d7a9f7e473e323e3272fca406dab6d55d) )
1076   ROM_LOAD( "zarz124.09",   0x5000, 0x0800, CRC(296397ea) SHA1(3a1ad7f3c4453bb20768b3e3ce04cd76873aa0ee) )
1077   ROM_LOAD( "zarz125.10",   0x5800, 0x0800, CRC(26dc5e66) SHA1(07f47f3497bb85640e5e6a89ad7d6579108347fe) )
1078   ROM_LOAD( "zarz126.13",   0x6000, 0x0800, CRC(cee18d7f) SHA1(5a7e60b6be06b3038f2eb81e76fc54cb65d4877b) )
1079   ROM_LOAD( "zarz127.14",   0x6800, 0x0800, CRC(bbd2cc0d) SHA1(1128020b7c0f38f5ff2cc2da0fd2df5ebead4681) )
1080   ROM_LOAD( "zarz128.15",   0x7000, 0x0800, CRC(93ea2df9) SHA1(4f7d076deef1e14b568b06974194861d3789ab5c) )
1081   ROM_LOAD( "zarz129.16",   0x7800, 0x0800, CRC(e67ec873) SHA1(14158914f07cabe61abc400c371d742ceb61d165) )
1082   ROM_RELOAD(               0xf800, 0x0800 ) /* for the reset/interrupt vectors */
1083   ROM_LOAD( "zarz130.22",   0x8000, 0x0800, CRC(22c44650) SHA1(063915cde86aece8860db1df15497cde669e73bd) )
1084   ROM_LOAD( "zarz131.23",   0x8800, 0x0800, CRC(7be20678) SHA1(872de953df1f9f1725e14fdfd227ad872a813af8) )
1085   ROM_LOAD( "zarz132.24",   0x9000, 0x0800, CRC(72b2cb76) SHA1(d7a95c908fe2227e2a0820a8e9713b1709c9e5af) )
1086
1087   ROM_REGION( 0x1000, "gfx1", 0 )
1088   ROM_LOAD( "zarz135.73",   0x0000, 0x0800, CRC(e837c62b) SHA1(97552b1e413a3934f4dc5a6fc9fc1fa8ba7a2e7e) )
1089   ROM_LOAD( "zarz136.75",   0x0800, 0x0800, CRC(83f61623) SHA1(4cb28f85f32d13bfa364c376ea3e30fd451b5884) )
1090
1091   ROM_REGION( 0x0020, "proms", 0 )
1092   ROM_LOAD( "zarz138.03",   0x0000, 0x0020, CRC(5dd6933a) SHA1(417d827d9e47b6db01fecc2164e5ef332d4cd70e) )
1093
1094   ROM_REGION( 0x1000, "snk6502", 0 )  /* sound data for Vanguard-style audio section */
1095   ROM_LOAD( "zarz133.53",   0x0000, 0x0800, CRC(b253cf78) SHA1(56a73b22ed2866222c407a3e9b51b8e0c92cf2aa) )
1096   ROM_LOAD( "zarz134.54",   0x0800, 0x0800, CRC(580934d2) SHA1(c1c7eba56bca2a0ea6a68c0245b071a3308f92bd) )
1097ROM_END
1098
1099ROM_START( vanguard )
1100   ROM_REGION( 0x10000, "maincpu", 0 )
1101   ROM_LOAD( "sk4_ic07.bin", 0x4000, 0x1000, CRC(6a29e354) SHA1(ff953962ebc14a28cfc96f8e269cb1e1c188ed8a) )
1102   ROM_LOAD( "sk4_ic08.bin", 0x5000, 0x1000, CRC(302bba54) SHA1(1944f229481328a0635fafda65054106f42a532a) )
1103   ROM_LOAD( "sk4_ic09.bin", 0x6000, 0x1000, CRC(424755f6) SHA1(b4762b40c7ed70d4b90319a1a30983a41a096afb) )
1104   ROM_LOAD( "sk4_ic10.bin", 0x7000, 0x1000, CRC(54603274) SHA1(31571a560dbe300417b3ed5b114fa1d9ef742da9) )
1105   ROM_LOAD( "sk4_ic13.bin", 0x8000, 0x1000, CRC(fde157d0) SHA1(3f705fb6a410004f4f86283694e3694e49701af6) )
1106   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1107   ROM_LOAD( "sk4_ic14.bin", 0x9000, 0x1000, CRC(0d5b47d0) SHA1(922621c23f33fe756cb6baa12e5465c4e64f2dda) )
1108   ROM_LOAD( "sk4_ic15.bin", 0xa000, 0x1000, CRC(8549b8f8) SHA1(375bc6f7e15564d5cf7e00c44e2651793c56d6ca) )
1109   ROM_LOAD( "sk4_ic16.bin", 0xb000, 0x1000, CRC(062e0be2) SHA1(45aaf315a62f37460e32d3ba99caaacf4c994810) )
1110
1111   ROM_REGION( 0x1000, "gfx1", 0 )
1112   ROM_LOAD( "sk5_ic50.bin", 0x0000, 0x0800, CRC(e7d4315b) SHA1(b99e4ea07292a0eabaa6098037c92a5678627cec) )
1113   ROM_LOAD( "sk5_ic51.bin", 0x0800, 0x0800, CRC(96e87858) SHA1(4e9ccb055919c8acf5837e062857647d5363af60) )
1114
1115   ROM_REGION( 0x0040, "proms", 0 )
1116   ROM_LOAD( "sk5_ic7.bin",  0x0000, 0x0020, CRC(ad782a73) SHA1(ddf44f74a20f10ed976c434a885857dade1f86d7) ) /* foreground colors */
1117   ROM_LOAD( "sk5_ic6.bin",  0x0020, 0x0020, CRC(7dc9d450) SHA1(9b2d1dfb3270a562d14bd54bfb3405a9095becc0) ) /* background colors */
1118
1119   ROM_REGION( 0x1000, "snk6502", 0 )   /* sound ROMs */
1120   ROM_LOAD( "sk4_ic51.bin", 0x0000, 0x0800, CRC(d2a64006) SHA1(3f20b59ce1954f65535cd5603ca9271586428e35) )  /* sound ROM 1 */
1121   ROM_LOAD( "sk4_ic52.bin", 0x0800, 0x0800, CRC(cc4a0b6f) SHA1(251b24d60083d516c4ba686d75b41e04d10f7198) )  /* sound ROM 2 */
1122
1123   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1124   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1125   ROM_LOAD( "sk6_ic07.bin", 0x4000, 0x0800, CRC(2b7cbae9) SHA1(3d44a0232d7c94d8170cc06e90cc30bd57c99202) )
1126   ROM_LOAD( "sk6_ic08.bin", 0x4800, 0x0800, CRC(3b7e9d7c) SHA1(d9033188068b2aaa1502c89cf09f955eded8fa7a) )
1127   ROM_LOAD( "sk6_ic11.bin", 0x5000, 0x0800, CRC(c36df041) SHA1(8b51934229b961180d1edb99be3a4d337d37f66f) )
1128ROM_END
1129
1130ROM_START( vangrdce )
1131   ROM_REGION( 0x10000, "maincpu", 0 )
1132   ROM_LOAD( "sk4_ic07.bin", 0x4000, 0x1000, CRC(6a29e354) SHA1(ff953962ebc14a28cfc96f8e269cb1e1c188ed8a) )
1133   ROM_LOAD( "sk4_ic08.bin", 0x5000, 0x1000, CRC(302bba54) SHA1(1944f229481328a0635fafda65054106f42a532a) )
1134   ROM_LOAD( "sk4_ic09.bin", 0x6000, 0x1000, CRC(424755f6) SHA1(b4762b40c7ed70d4b90319a1a30983a41a096afb) )
1135   ROM_LOAD( "4",            0x7000, 0x1000, CRC(770f9714) SHA1(4af37fc24e464681a8da6b184be0df32a4078f4f) )
1136   ROM_LOAD( "5",            0x8000, 0x1000, CRC(3445cba6) SHA1(6afe6dad79b53df58b53ef9c5d24bb4d91fa5e8e) )
1137   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1138   ROM_LOAD( "sk4_ic14.bin", 0x9000, 0x1000, CRC(0d5b47d0) SHA1(922621c23f33fe756cb6baa12e5465c4e64f2dda) )
1139   ROM_LOAD( "sk4_ic15.bin", 0xa000, 0x1000, CRC(8549b8f8) SHA1(375bc6f7e15564d5cf7e00c44e2651793c56d6ca) )
1140   ROM_LOAD( "8",            0xb000, 0x1000, CRC(4b825bc8) SHA1(3fa32d9677e2cc3a1ebf52c0b9eed7dbf11201e9) )
1141
1142   ROM_REGION( 0x1000, "gfx1", 0 )
1143   ROM_LOAD( "sk5_ic50.bin", 0x0000, 0x0800, CRC(e7d4315b) SHA1(b99e4ea07292a0eabaa6098037c92a5678627cec) )
1144   ROM_LOAD( "sk5_ic51.bin", 0x0800, 0x0800, CRC(96e87858) SHA1(4e9ccb055919c8acf5837e062857647d5363af60) )
1145
1146   ROM_REGION( 0x0040, "proms", 0 )
1147   ROM_LOAD( "sk5_ic7.bin",  0x0000, 0x0020, CRC(ad782a73) SHA1(ddf44f74a20f10ed976c434a885857dade1f86d7) ) /* foreground colors */
1148   ROM_LOAD( "sk5_ic6.bin",  0x0020, 0x0020, CRC(7dc9d450) SHA1(9b2d1dfb3270a562d14bd54bfb3405a9095becc0) ) /* background colors */
1149
1150   ROM_REGION( 0x1000, "snk6502", 0 )   /* sound ROMs */
1151   ROM_LOAD( "sk4_ic51.bin", 0x0000, 0x0800, CRC(d2a64006) SHA1(3f20b59ce1954f65535cd5603ca9271586428e35) )  /* confirmed, 6/21/05 */
1152   ROM_LOAD( "sk4_ic52.bin", 0x0800, 0x0800, CRC(cc4a0b6f) SHA1(251b24d60083d516c4ba686d75b41e04d10f7198) )  /* confirmed, 6/21/05 */
1153
1154   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1155   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1156   ROM_LOAD( "sk6_ic07.bin", 0x4000, 0x0800, CRC(2b7cbae9) SHA1(3d44a0232d7c94d8170cc06e90cc30bd57c99202) )
1157   ROM_LOAD( "sk6_ic08.bin", 0x4800, 0x0800, CRC(3b7e9d7c) SHA1(d9033188068b2aaa1502c89cf09f955eded8fa7a) )
1158   ROM_LOAD( "sk6_ic11.bin", 0x5000, 0x0800, CRC(c36df041) SHA1(8b51934229b961180d1edb99be3a4d337d37f66f) )
1159ROM_END
1160
1161ROM_START( vanguarj )
1162   ROM_REGION( 0x10000, "maincpu", 0 )
1163   ROM_LOAD( "sk4_ic07.bin", 0x4000, 0x1000, CRC(6a29e354) SHA1(ff953962ebc14a28cfc96f8e269cb1e1c188ed8a) )
1164   ROM_LOAD( "sk4_ic08.bin", 0x5000, 0x1000, CRC(302bba54) SHA1(1944f229481328a0635fafda65054106f42a532a) )
1165   ROM_LOAD( "sk4_ic09.bin", 0x6000, 0x1000, CRC(424755f6) SHA1(b4762b40c7ed70d4b90319a1a30983a41a096afb) )
1166   ROM_LOAD( "vgj4ic10.bin", 0x7000, 0x1000, CRC(0a91a5d1) SHA1(bef435e431e31179eb22a4c18ca1dedf6a4a0ab0) )
1167   ROM_LOAD( "vgj5ic13.bin", 0x8000, 0x1000, CRC(06601a40) SHA1(d1efcf75edf3892fe59d63e524f4880ffce67965) )
1168   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1169   ROM_LOAD( "sk4_ic14.bin", 0x9000, 0x1000, CRC(0d5b47d0) SHA1(922621c23f33fe756cb6baa12e5465c4e64f2dda) )
1170   ROM_LOAD( "sk4_ic15.bin", 0xa000, 0x1000, CRC(8549b8f8) SHA1(375bc6f7e15564d5cf7e00c44e2651793c56d6ca) )
1171   ROM_LOAD( "sk4_ic16.bin", 0xb000, 0x1000, CRC(062e0be2) SHA1(45aaf315a62f37460e32d3ba99caaacf4c994810) )
1172
1173   ROM_REGION( 0x1000, "gfx1", 0 )
1174   ROM_LOAD( "sk5_ic50.bin", 0x0000, 0x0800, CRC(e7d4315b) SHA1(b99e4ea07292a0eabaa6098037c92a5678627cec) )
1175   ROM_LOAD( "sk5_ic51.bin", 0x0800, 0x0800, CRC(96e87858) SHA1(4e9ccb055919c8acf5837e062857647d5363af60) )
1176
1177   ROM_REGION( 0x0040, "proms", 0 )
1178   ROM_LOAD( "sk5_ic7.bin",  0x0000, 0x0020, CRC(ad782a73) SHA1(ddf44f74a20f10ed976c434a885857dade1f86d7) ) /* foreground colors */
1179   ROM_LOAD( "sk5_ic6.bin",  0x0020, 0x0020, CRC(7dc9d450) SHA1(9b2d1dfb3270a562d14bd54bfb3405a9095becc0) ) /* background colors */
1180
1181   ROM_REGION( 0x1000, "snk6502", 0 )   /* sound ROMs */
1182   ROM_LOAD( "sk4_ic51.bin", 0x0000, 0x0800, CRC(d2a64006) SHA1(3f20b59ce1954f65535cd5603ca9271586428e35) )  /* sound ROM 1 */
1183   ROM_LOAD( "sk4_ic52.bin", 0x0800, 0x0800, CRC(cc4a0b6f) SHA1(251b24d60083d516c4ba686d75b41e04d10f7198) )  /* sound ROM 2 */
1184
1185   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1186   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1187   ROM_LOAD( "sk6_ic07.bin", 0x4000, 0x0800, CRC(2b7cbae9) SHA1(3d44a0232d7c94d8170cc06e90cc30bd57c99202) )
1188   ROM_LOAD( "sk6_ic08.bin", 0x4800, 0x0800, CRC(3b7e9d7c) SHA1(d9033188068b2aaa1502c89cf09f955eded8fa7a) )
1189   ROM_LOAD( "sk6_ic11.bin", 0x5000, 0x0800, CRC(c36df041) SHA1(8b51934229b961180d1edb99be3a4d337d37f66f) )
1190ROM_END
1191
1192ROM_START( fantasyu )
1193   ROM_REGION( 0x10000, "maincpu", 0 )
1194   ROM_LOAD( "ic12.cpu",     0x3000, 0x1000, CRC(22cb2249) SHA1(6c43e3fa9638b6d2e069199968923e470bd5d18b) )
1195   ROM_LOAD( "ic07.cpu",     0x4000, 0x1000, CRC(0e2880b6) SHA1(666d6942864eb7a90178b3b6e2b0eb23aa3c967f) )
1196   ROM_LOAD( "ic08.cpu",     0x5000, 0x1000, CRC(4c331317) SHA1(800850f4e8bcfbbade54eb9e47a53941f8798641) )
1197   ROM_LOAD( "ic09.cpu",     0x6000, 0x1000, CRC(6ac1dbfc) SHA1(b9c7bf8d3b085db0b53646b5639c09f9ced2b1fe) )
1198   ROM_LOAD( "ic10.cpu",     0x7000, 0x1000, CRC(c796a406) SHA1(1b7f5f307a81b481a3e7791128a01d4c1a20c4bf) )
1199   ROM_LOAD( "ic14.cpu",     0x8000, 0x1000, CRC(6f1f0698) SHA1(05bd114dcd08c990d897518a8ea7965bc82279bf) )
1200   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1201   ROM_LOAD( "ic15.cpu",     0x9000, 0x1000, CRC(5534d57e) SHA1(e564a3325766423b47de18d6adb61760cbbf88be) )
1202   ROM_LOAD( "ic16.cpu",     0xa000, 0x1000, CRC(6c2aeb6e) SHA1(fd0b913a663bf2a5f45fc3d342d7575a9c7dae46) )
1203   ROM_LOAD( "ic17.cpu",     0xb000, 0x1000, CRC(f6aa5de1) SHA1(ca53cf66cc6cdb21a60760102f35a5b0745ce09b) )
1204
1205   ROM_REGION( 0x2000, "gfx1", 0 )
1206   ROM_LOAD( "fs10ic50.bin", 0x0000, 0x1000, CRC(86a801c3) SHA1(c040b5807c25823072f7e8ceab57b95d4bed89fe) )
1207   ROM_LOAD( "fs11ic51.bin", 0x1000, 0x1000, CRC(9dfff71c) SHA1(7a7c017170f2ea903a730a4e5ab69db379a4fc61) )
1208
1209   ROM_REGION( 0x0040, "proms", 0 )
1210   ROM_LOAD( "fantasy.ic7",  0x0000, 0x0020, CRC(361a5e99) SHA1(b9777ce658549c03971bd476482d5cc0be27d3a9) ) /* foreground colors */
1211   ROM_LOAD( "fantasy.ic6",  0x0020, 0x0020, CRC(33d974f7) SHA1(a6f6a531dec3f454b477bfdda8e213e9cad42748) ) /* background colors */
1212
1213   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1214   ROM_LOAD( "fs_b_51.bin",  0x0000, 0x0800, CRC(48094ec5) SHA1(7d6118133bc1eb8ebc5d8a95d10ef842daffef89) )
1215   ROM_LOAD( "fs_a_52.bin",  0x0800, 0x0800, CRC(1d0316e8) SHA1(6a3ab289b5fefef8663514bd1d5817c70fe58882) )
1216   ROM_LOAD( "fs_c_53.bin",  0x1000, 0x0800, CRC(49fd4ae8) SHA1(96ff1267c0ffab1e8a0769fa869516e2546ab640) )
1217
1218   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1219   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1220   ROM_LOAD( "fs_d_7.bin",   0x4000, 0x0800, CRC(a7ef4cc6) SHA1(8df71cb18fcfe9a2f592f83bc01cf2314ae30e32) )
1221   ROM_LOAD( "fs_e_8.bin",   0x4800, 0x0800, CRC(19b8fb3e) SHA1(271c76f68866c28bc6755238a71970d5f7c81ecb) )
1222   ROM_LOAD( "fs_f_11.bin",  0x5000, 0x0800, CRC(3a352e1f) SHA1(af880ce3daed0877d454421bd08c86ff71f6bf72) )
1223ROM_END
1224
1225ROM_START( fantasy )
1226   ROM_REGION( 0x10000, "maincpu", 0 )
1227   ROM_LOAD( "5.12",         0x3000, 0x1000, CRC(0968ab50) SHA1(f09d03a171349895c5cb69e684901be63d272b32) )
1228   ROM_LOAD( "1.7",          0x4000, 0x1000, CRC(de83000e) SHA1(ede1dda46406b4d340f1efea3bc85b2227af9e1d) )
1229   ROM_LOAD( "2.8",          0x5000, 0x1000, CRC(90499b5a) SHA1(81a9d93a5655d2ff9504036bc764d8bb81e1470d) )
1230   ROM_LOAD( "3.9",          0x6000, 0x1000, CRC(6fbffeb6) SHA1(b36aeaf095da4957103c8921957ff4be658eddf5) )
1231   ROM_LOAD( "4.10",         0x7000, 0x1000, CRC(02e85884) SHA1(71fa6eb375fc417f92c049ec5118818b9ad48468) )
1232   ROM_LOAD( "ic14.cpu",     0x8000, 0x1000, CRC(6f1f0698) SHA1(05bd114dcd08c990d897518a8ea7965bc82279bf) )
1233   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1234   ROM_LOAD( "ic15.cpu",     0x9000, 0x1000, CRC(5534d57e) SHA1(e564a3325766423b47de18d6adb61760cbbf88be) )
1235   ROM_LOAD( "8.16",         0xa000, 0x1000, CRC(371129fe) SHA1(c21759222aebcc9ea1292e367a41ac43a4dd3554) )
1236   ROM_LOAD( "9.17",         0xb000, 0x1000, CRC(56a7c8b8) SHA1(6c417644851c7b4b5291d9c5b2c808ff4a1ad048) )
1237
1238   ROM_REGION( 0x2000, "gfx1", 0 )
1239   ROM_LOAD( "fs10ic50.bin", 0x0000, 0x1000, CRC(86a801c3) SHA1(c040b5807c25823072f7e8ceab57b95d4bed89fe) )
1240   ROM_LOAD( "fs11ic51.bin", 0x1000, 0x1000, CRC(9dfff71c) SHA1(7a7c017170f2ea903a730a4e5ab69db379a4fc61) )
1241
1242   ROM_REGION( 0x0040, "proms", 0 )
1243   ROM_LOAD( "fantasy.ic7",  0x0000, 0x0020, CRC(361a5e99) SHA1(b9777ce658549c03971bd476482d5cc0be27d3a9) ) /* foreground colors */
1244   ROM_LOAD( "fantasy.ic6",  0x0020, 0x0020, CRC(33d974f7) SHA1(a6f6a531dec3f454b477bfdda8e213e9cad42748) ) /* background colors */
1245
1246   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1247   ROM_LOAD( "fs_b_51.bin",  0x0000, 0x0800, CRC(48094ec5) SHA1(7d6118133bc1eb8ebc5d8a95d10ef842daffef89) )
1248   ROM_LOAD( "fs_a_52.bin",  0x0800, 0x0800, CRC(1d0316e8) SHA1(6a3ab289b5fefef8663514bd1d5817c70fe58882) )
1249   ROM_LOAD( "fs_c_53.bin",  0x1000, 0x0800, CRC(49fd4ae8) SHA1(96ff1267c0ffab1e8a0769fa869516e2546ab640) )
1250
1251   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1252   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1253   ROM_LOAD( "fs_d_7.bin",   0x4000, 0x0800, CRC(a7ef4cc6) SHA1(8df71cb18fcfe9a2f592f83bc01cf2314ae30e32) )
1254   ROM_LOAD( "fs_e_8.bin",   0x4800, 0x0800, CRC(19b8fb3e) SHA1(271c76f68866c28bc6755238a71970d5f7c81ecb) )
1255   ROM_LOAD( "fs_f_11.bin",  0x5000, 0x0800, CRC(3a352e1f) SHA1(af880ce3daed0877d454421bd08c86ff71f6bf72) )
1256ROM_END
1257
1258ROM_START( fantasyj )
1259   ROM_REGION( 0x10000, "maincpu", 0 )
1260   ROM_LOAD( "fs5jic12.bin", 0x3000, 0x1000, CRC(dd1eac89) SHA1(d63078d4666e3c6db0c9b3f8b45ef81606ed5a4f) )
1261   ROM_LOAD( "fs1jic7.bin",  0x4000, 0x1000, CRC(7b8115ae) SHA1(6274f937c57ab9cbb7c6283022b81f70dad7c232) )
1262   ROM_LOAD( "fs2jic8.bin",  0x5000, 0x1000, CRC(61531dd1) SHA1(f3bc405bafc8ced6c6fce93ad2ad20ff6aa603e8) )
1263   ROM_LOAD( "fs3jic9.bin",  0x6000, 0x1000, CRC(36a12617) SHA1(dd74abb4cbaeb1a56ee466043997187ebe933612) )
1264   ROM_LOAD( "fs4jic10.bin", 0x7000, 0x1000, CRC(dbf7c347) SHA1(1bb3f924a7e1ec74ef68e237a0f68d62ce78532c) )
1265   ROM_LOAD( "fs6jic14.bin", 0x8000, 0x1000, CRC(bf59a33a) SHA1(bdbdd03199758069b904fdf0455193682c4d457f) )
1266   ROM_RELOAD(               0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1267   ROM_LOAD( "fs7jic15.bin", 0x9000, 0x1000, CRC(cc18428e) SHA1(c7c0a031434cf9ce3c450b0c5dc2b154b08d19cf) )
1268   ROM_LOAD( "fs8jic16.bin", 0xa000, 0x1000, CRC(ae5bf727) SHA1(3c5eaaba3971f57a5687945a614dd0d6c9e007d6) )
1269   ROM_LOAD( "fs9jic17.bin", 0xb000, 0x1000, CRC(fa6903e2) SHA1(a5b9b7309ecaaeaba76e45610d5ab80415ecbdd0) )
1270
1271   ROM_REGION( 0x2000, "gfx1", 0 )
1272   ROM_LOAD( "fs10ic50.bin", 0x0000, 0x1000, CRC(86a801c3) SHA1(c040b5807c25823072f7e8ceab57b95d4bed89fe) )
1273   ROM_LOAD( "fs11ic51.bin", 0x1000, 0x1000, CRC(9dfff71c) SHA1(7a7c017170f2ea903a730a4e5ab69db379a4fc61) )
1274
1275   ROM_REGION( 0x0040, "proms", 0 )
1276   ROM_LOAD( "prom-8.bpr",   0x0000, 0x0020, CRC(1aa9285a) SHA1(d503aa76ca0cf032c7b1c962abc59677c41a2c62) ) /* foreground colors */
1277   ROM_LOAD( "prom-7.bpr",   0x0020, 0x0020, CRC(7a6f7dc3) SHA1(e15d898275d1cd205cc2d28f7dd9df653594039e) ) /* background colors */
1278
1279   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1280   ROM_LOAD( "fs_b_51.bin",  0x0000, 0x0800, CRC(48094ec5) SHA1(7d6118133bc1eb8ebc5d8a95d10ef842daffef89) )
1281   ROM_LOAD( "fs_a_52.bin",  0x0800, 0x0800, CRC(1d0316e8) SHA1(6a3ab289b5fefef8663514bd1d5817c70fe58882) )
1282   ROM_LOAD( "fs_c_53.bin",  0x1000, 0x0800, CRC(49fd4ae8) SHA1(96ff1267c0ffab1e8a0769fa869516e2546ab640) )
1283
1284   ROM_REGION( 0x5800, "speech", 0 )   /* space for the speech ROMs (not supported) */
1285   //ROM_LOAD( "hd38882.bin",  0x0000, 0x4000, NO_DUMP )   /* HD38882 internal ROM */
1286   ROM_LOAD( "fs_d_7.bin",   0x4000, 0x0800, CRC(a7ef4cc6) SHA1(8df71cb18fcfe9a2f592f83bc01cf2314ae30e32) )
1287   ROM_LOAD( "fs_e_8.bin",   0x4800, 0x0800, CRC(19b8fb3e) SHA1(271c76f68866c28bc6755238a71970d5f7c81ecb) )
1288   ROM_LOAD( "fs_f_11.bin",  0x5000, 0x0800, CRC(3a352e1f) SHA1(af880ce3daed0877d454421bd08c86ff71f6bf72) )
1289ROM_END
1290
1291ROM_START( pballoon )
1292   ROM_REGION( 0x10000, "maincpu", 0 )
1293   ROM_LOAD( "sk7_ic12.bin", 0x3000, 0x1000, CRC(dfe2ae05) SHA1(21c98bef9d4d5fcb65ce5e9b20cde2259840459e) )
1294   ROM_LOAD( "sk7_ic07.bin", 0x4000, 0x1000, CRC(736e67df) SHA1(a58d9561f62d396ca90b0f69afe6240d809b10bb) )
1295   ROM_LOAD( "sk7_ic08.bin", 0x5000, 0x1000, CRC(7a2032b2) SHA1(79570943468d647cda67d94b20eac1b2d9eb371f) )
1296   ROM_LOAD( "sk7_ic09.bin", 0x6000, 0x1000, CRC(2d63cf3a) SHA1(8934af617229db445f9fd10e4028e1f8df4cfeb1) )
1297   ROM_LOAD( "sk7_ic10.bin", 0x7000, 0x1000, CRC(7b88cbd4) SHA1(1be3c484bd08c747f38389114c157e84319c48be) )
1298   ROM_LOAD( "sk7_ic14.bin", 0x8000, 0x1000, CRC(6a8817a5) SHA1(4cf8eda68d21b1fad0f12eedaeb88b256bba44da) )
1299   ROM_RELOAD(               0xf000, 0x1000 )  /* for the reset and interrupt vectors */
1300   ROM_LOAD( "sk7_ic15.bin", 0x9000, 0x1000, CRC(1f78d814) SHA1(7e618971f1bbf8859284531e94989c43c3285b4a) )
1301
1302   ROM_REGION( 0x2000, "gfx1", 0 )
1303   ROM_LOAD( "sk8_ic50.bin", 0x0000, 0x1000, CRC(560df07f) SHA1(e57945de829d22d39390a649eddaf78c989af679) )
1304   ROM_LOAD( "sk8_ic51.bin", 0x1000, 0x1000, CRC(d415de51) SHA1(257cf939efec8adee87baf827315c69fde90da4c) )
1305
1306   ROM_REGION( 0x0040, "proms", 0 )
1307   ROM_LOAD( "sk8_ic7.bin",  0x0000, 0x0020, CRC(ef6c82a0) SHA1(95b522d6389f25bf5fa2fca5f3f826ef43b2885b) ) /* foreground colors */
1308   ROM_LOAD( "sk8_ic6.bin",  0x0020, 0x0020, CRC(eabc6a00) SHA1(942af5e22e49e578c6a24651476e3b60d40e2076) ) /* background colors */
1309
1310   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1311   ROM_LOAD( "sk7_ic51.bin", 0x0000, 0x0800, CRC(0345f8b7) SHA1(c00992dc7222cc53d9fdff4ab47a7abdf90c5116) )
1312   ROM_LOAD( "sk7_ic52.bin", 0x0800, 0x0800, CRC(5d6d68ea) SHA1(d3e03720eff5c85c1c2fb1d4bf960f45a99dc86a) )
1313   ROM_LOAD( "sk7_ic53.bin", 0x1000, 0x0800, CRC(a4c505cd) SHA1(47eea7e7ffa3dc8b35dc050ac1a1d77d6a5c4ece) )
1314ROM_END
1315
1316ROM_START( nibbler )
1317   ROM_REGION( 0x10000, "maincpu", 0 )
1318   ROM_LOAD( "g-0960-52.ic12", 0x3000, 0x1000, CRC(ac6a802b) SHA1(ac1072e30994f13097663dc24d9d1dc35a95d874) )
1319   ROM_LOAD( "g-0960-48.ic7",  0x4000, 0x1000, CRC(35971364) SHA1(6430c7be9e5f47d3f1f2cc157d949246e4085e8b) )
1320   ROM_LOAD( "g-0960-49.ic8",  0x5000, 0x1000, CRC(6b33b806) SHA1(29444e45bf5a6ab1d86e0aa19dc6c1bc64ba633f) )
1321   ROM_LOAD( "g-0960-50.ic9",  0x6000, 0x1000, CRC(91a4f98d) SHA1(678c7e8c91a7fdba8dc2faff4192eb0964abdb3f) )
1322   ROM_LOAD( "g-0960-51.ic10", 0x7000, 0x1000, CRC(a151d934) SHA1(6681bdcd84cf62b40b2430ff530cb3c9aa36656c) )
1323   ROM_LOAD( "g-0960-53.ic14", 0x8000, 0x1000, CRC(063f05cc) SHA1(039ac1b007cb817ae0902484ca611ae7076930d6) )
1324   ROM_RELOAD(                 0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1325   ROM_LOAD( "g-0960-54.ic15", 0x9000, 0x1000, CRC(7205fb8d) SHA1(bc341bc11a383aa8b8dd7b2be851907a3ec56f8b) )
1326   ROM_LOAD( "g-0960-55.ic16", 0xa000, 0x1000, CRC(4bb39815) SHA1(1755c28d7d300524ab839aedcc744254544e9c19) )
1327   ROM_LOAD( "g-0960-56.ic17", 0xb000, 0x1000, CRC(ed680f19) SHA1(b44203585f32ebe2a3bf0597eac7c0faa7e81a92) )
1328
1329   ROM_REGION( 0x2000, "gfx1", 0 )
1330   ROM_LOAD( "g-0960-57.ic50", 0x0000, 0x1000, CRC(01d4d0c2) SHA1(5a8026210a872351ce4e39e27f6479d3ca0689e2) )
1331   ROM_LOAD( "g-0960-58.ic51", 0x1000, 0x1000, CRC(feff7faf) SHA1(50005502578a4ea9b9c8f36998670b787d2d0b20) )
1332
1333   ROM_REGION( 0x0040, "proms", 0 )
1334   ROM_LOAD( "g-0708-05.ic7",  0x0000, 0x0020, CRC(a5709ff3) SHA1(fbd07b756235f2d03aea3d777ca741ade54be200) ) /* foreground colors */
1335   ROM_LOAD( "g-0708-04.ic6",  0x0020, 0x0020, CRC(dacd592d) SHA1(c7709c680e2764885a40bc256d07dffc9e827cd6) ) /* background colors */
1336
1337   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1338   ROM_LOAD( "g-0959-43.ic51", 0x0000, 0x0800, CRC(0345f8b7) SHA1(c00992dc7222cc53d9fdff4ab47a7abdf90c5116) )
1339   ROM_LOAD( "g-0959-44.ic52", 0x0800, 0x0800, CRC(87d67dee) SHA1(bd292eab3671cb953279f3136a450deac3818367) )
1340   ROM_LOAD( "g-0959-45.ic53", 0x1000, 0x0800, CRC(33189917) SHA1(01a1b1693db0172609780daeb60430fa0c8bcec2) )
1341ROM_END
1342
1343ROM_START( nibblera )
1344   ROM_REGION( 0x10000, "maincpu", 0 )
1345   ROM_LOAD( "ic12",           0x3000, 0x1000, CRC(6dfa1be5) SHA1(bb265702a2f74cb7d5ba27081f9fb2fe01dd95a5) )
1346   ROM_LOAD( "ic7",            0x4000, 0x1000, CRC(808e1a03) SHA1(a747a16ee0c8cb803b72ac84e80f791b2bf1813a) )
1347   ROM_LOAD( "ic8",            0x5000, 0x1000, CRC(1571d4a2) SHA1(42cbaa262c2265d904fd5844c0d3c63d3beb67a8) )
1348   ROM_LOAD( "ic9",            0x6000, 0x1000, CRC(a599df10) SHA1(68ee8b5199ec24409fcbb40c887a1eec44c68dcf) )
1349   ROM_LOAD( "ic10",           0x7000, 0x1000, CRC(a6b5abe5) SHA1(a0f228dac801a54dfa1947d6b2f6b4e3d005e0b2) )
1350   ROM_LOAD( "ic14",           0x8000, 0x1000, CRC(9f537185) SHA1(619df63f4df38014dc229f614043f867e6a5aa51) )
1351   ROM_RELOAD(                 0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1352   ROM_LOAD( "g-0960-54.ic15", 0x9000, 0x1000, CRC(7205fb8d) SHA1(bc341bc11a383aa8b8dd7b2be851907a3ec56f8b) )
1353   ROM_LOAD( "g-0960-55.ic16", 0xa000, 0x1000, CRC(4bb39815) SHA1(1755c28d7d300524ab839aedcc744254544e9c19) )
1354   ROM_LOAD( "g-0960-56.ic17", 0xb000, 0x1000, CRC(ed680f19) SHA1(b44203585f32ebe2a3bf0597eac7c0faa7e81a92) )
1355
1356   ROM_REGION( 0x2000, "gfx1", 0 )
1357   ROM_LOAD( "g-0960-57.ic50", 0x0000, 0x1000, CRC(01d4d0c2) SHA1(5a8026210a872351ce4e39e27f6479d3ca0689e2) )
1358   ROM_LOAD( "g-0960-58.ic51", 0x1000, 0x1000, CRC(feff7faf) SHA1(50005502578a4ea9b9c8f36998670b787d2d0b20) )
1359
1360   ROM_REGION( 0x0040, "proms", 0 )
1361   ROM_LOAD( "g-0708-05.ic7",  0x0000, 0x0020, CRC(a5709ff3) SHA1(fbd07b756235f2d03aea3d777ca741ade54be200) ) /* foreground colors */
1362   ROM_LOAD( "g-0708-04.ic6",  0x0020, 0x0020, CRC(dacd592d) SHA1(c7709c680e2764885a40bc256d07dffc9e827cd6) ) /* background colors */
1363
1364   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1365   ROM_LOAD( "g-0959-43.ic51", 0x0000, 0x0800, CRC(0345f8b7) SHA1(c00992dc7222cc53d9fdff4ab47a7abdf90c5116) )
1366   ROM_LOAD( "g-0959-44.ic52", 0x0800, 0x0800, CRC(87d67dee) SHA1(bd292eab3671cb953279f3136a450deac3818367) )
1367   ROM_LOAD( "g-0959-45.ic53", 0x1000, 0x0800, CRC(33189917) SHA1(01a1b1693db0172609780daeb60430fa0c8bcec2) )
1368ROM_END
1369
1370ROM_START( nibblerb )
1371   ROM_REGION( 0x10000, "maincpu", 0 )
1372   ROM_LOAD( "50-144.012",     0x3000, 0x1000, CRC(68af8f4b) SHA1(be6ddd3a9abb05563c927b1ec54dbaab44b65492) )
1373   ROM_LOAD( "50-140.007",     0x4000, 0x1000, CRC(c18b3009) SHA1(c3703d0300f5f1546417ecdc27ab747d9c7eb267) )
1374   ROM_LOAD( "50-141.008",     0x5000, 0x1000, CRC(b50fd79c) SHA1(cd9847bf8d570ca9411d1bbcbccb3c94220349f9) )
1375   ROM_LOAD( "ic9",            0x6000, 0x1000, CRC(a599df10) SHA1(68ee8b5199ec24409fcbb40c887a1eec44c68dcf) ) // 50-142.009
1376   ROM_LOAD( "ic10",           0x7000, 0x1000, CRC(a6b5abe5) SHA1(a0f228dac801a54dfa1947d6b2f6b4e3d005e0b2) ) // 50-143.010
1377   ROM_LOAD( "50-145.014",     0x8000, 0x1000, CRC(29ea246a) SHA1(bf1afbddbea5ab7e93e5ac69c6445749dd65ed3b) )
1378   ROM_RELOAD(                 0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1379   ROM_LOAD( "g-0960-54.ic15", 0x9000, 0x1000, CRC(7205fb8d) SHA1(bc341bc11a383aa8b8dd7b2be851907a3ec56f8b) ) // 50-146.015
1380   ROM_LOAD( "g-0960-55.ic16", 0xa000, 0x1000, CRC(4bb39815) SHA1(1755c28d7d300524ab839aedcc744254544e9c19) ) // 50-147.016
1381   ROM_LOAD( "g-0960-56.ic17", 0xb000, 0x1000, CRC(ed680f19) SHA1(b44203585f32ebe2a3bf0597eac7c0faa7e81a92) ) // 50-148.017
1382
1383   ROM_REGION( 0x2000, "gfx1", 0 )
1384   ROM_LOAD( "g-0960-57.ic50", 0x0000, 0x1000, CRC(01d4d0c2) SHA1(5a8026210a872351ce4e39e27f6479d3ca0689e2) ) // 50-150.051
1385   ROM_LOAD( "g-0960-58.ic51", 0x1000, 0x1000, CRC(feff7faf) SHA1(50005502578a4ea9b9c8f36998670b787d2d0b20) ) // 50-149.050
1386
1387   ROM_REGION( 0x0040, "proms", 0 )
1388   ROM_LOAD( "g-0708-05.ic7",  0x0000, 0x0020, CRC(a5709ff3) SHA1(fbd07b756235f2d03aea3d777ca741ade54be200) ) /* foreground colors */
1389   ROM_LOAD( "g-0708-04.ic6",  0x0020, 0x0020, CRC(dacd592d) SHA1(c7709c680e2764885a40bc256d07dffc9e827cd6) ) /* background colors */
1390
1391   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1392   ROM_LOAD( "g-0959-43.ic51", 0x0000, 0x0800, CRC(0345f8b7) SHA1(c00992dc7222cc53d9fdff4ab47a7abdf90c5116) ) // not in this set / board according to readme but it seems to be needed?!
1393   ROM_LOAD( "g-0959-44.ic52", 0x0800, 0x0800, CRC(87d67dee) SHA1(bd292eab3671cb953279f3136a450deac3818367) ) // 50-152.052
1394   ROM_LOAD( "g-0959-45.ic53", 0x1000, 0x0800, CRC(33189917) SHA1(01a1b1693db0172609780daeb60430fa0c8bcec2) ) // 50-151.053
1395ROM_END
1396
1397ROM_START( nibblero )
1398   ROM_REGION( 0x10000, "maincpu", 0 )
1399   ROM_LOAD( "50-144g.012",    0x3000, 0x1000, CRC(1093f525) SHA1(6a63372300765acdbac1d2e30fd73af7773de80f) )
1400   ROM_LOAD( "50-140g.007",    0x4000, 0x1000, CRC(848651dd) SHA1(a5aafbcca42baca8d0d5d28546733aefc778ba99) )
1401   ROM_LOAD( "50-141.008",     0x5000, 0x1000, CRC(b50fd79c) SHA1(cd9847bf8d570ca9411d1bbcbccb3c94220349f9) )
1402   ROM_LOAD( "ic9",            0x6000, 0x1000, CRC(a599df10) SHA1(68ee8b5199ec24409fcbb40c887a1eec44c68dcf) )
1403   ROM_LOAD( "ic10",           0x7000, 0x1000, CRC(a6b5abe5) SHA1(a0f228dac801a54dfa1947d6b2f6b4e3d005e0b2) )
1404   ROM_LOAD( "50-145.014",     0x8000, 0x1000, CRC(29ea246a) SHA1(bf1afbddbea5ab7e93e5ac69c6445749dd65ed3b) )
1405   ROM_RELOAD(                 0xf000, 0x1000 )   /* for the reset and interrupt vectors */
1406   ROM_LOAD( "g-0960-54.ic15", 0x9000, 0x1000, CRC(7205fb8d) SHA1(bc341bc11a383aa8b8dd7b2be851907a3ec56f8b) )
1407   ROM_LOAD( "g-0960-55.ic16", 0xa000, 0x1000, CRC(4bb39815) SHA1(1755c28d7d300524ab839aedcc744254544e9c19) )
1408   ROM_LOAD( "g-0960-56.ic17", 0xb000, 0x1000, CRC(ed680f19) SHA1(b44203585f32ebe2a3bf0597eac7c0faa7e81a92) )
1409
1410   ROM_REGION( 0x2000, "gfx1", 0 )
1411   ROM_LOAD( "g-0960-57.ic50", 0x0000, 0x1000, CRC(01d4d0c2) SHA1(5a8026210a872351ce4e39e27f6479d3ca0689e2) )
1412   ROM_LOAD( "g-0960-58.ic51", 0x1000, 0x1000, CRC(feff7faf) SHA1(50005502578a4ea9b9c8f36998670b787d2d0b20) )
1413
1414   ROM_REGION( 0x0040, "proms", 0 )
1415   ROM_LOAD( "g-0708-05.ic7",  0x0000, 0x0020, CRC(a5709ff3) SHA1(fbd07b756235f2d03aea3d777ca741ade54be200) ) /* foreground colors */
1416   ROM_LOAD( "g-0708-04.ic6",  0x0020, 0x0020, CRC(dacd592d) SHA1(c7709c680e2764885a40bc256d07dffc9e827cd6) ) /* background colors */
1417
1418   ROM_REGION( 0x1800, "snk6502", 0 )   /* sound ROMs */
1419   ROM_LOAD( "g-0959-43.ic51", 0x0000, 0x0800, CRC(0345f8b7) SHA1(c00992dc7222cc53d9fdff4ab47a7abdf90c5116) )
1420   ROM_LOAD( "g-0959-44.ic52", 0x0800, 0x0800, CRC(87d67dee) SHA1(bd292eab3671cb953279f3136a450deac3818367) )
1421   ROM_LOAD( "g-0959-45.ic53", 0x1000, 0x0800, CRC(33189917) SHA1(01a1b1693db0172609780daeb60430fa0c8bcec2) )
1422ROM_END
1423
1424
1425/*************************************
1426 *
1427 *  Game drivers
1428 *
1429 *************************************/
1430
1431GAME( 1980, sasuke,   0,        sasuke,   sasuke,   0, ROT90, "SNK", "Sasuke vs. Commander", 0 )
1432GAME( 1981, satansat, 0,        satansat, satansat, 0, ROT90, "SNK", "Satan of Saturn (set 1)", GAME_IMPERFECT_SOUND )
1433GAME( 1981, satansaa, satansat, satansat, satansat, 0, ROT90, "SNK", "Satan of Saturn (set 2)", GAME_IMPERFECT_SOUND )
1434GAME( 1981, zarzon,   satansat, satansat, satansat, 0, ROT90, "[SNK] (Taito America license)", "Zarzon", GAME_IMPERFECT_SOUND )
1435GAME( 1981, vanguard, 0,        vanguard, vanguard, 0, ROT90, "SNK", "Vanguard (SNK)", 0 )
1436GAME( 1981, vangrdce, vanguard, vanguard, vanguard, 0, ROT90, "SNK (Centuri license)", "Vanguard (Centuri)", 0 )
1437GAME( 1981, vanguarj, vanguard, vanguard, vanguard, 0, ROT90, "SNK", "Vanguard (Japan)", 0 )
1438GAME( 1981, fantasy,  0,        fantasy,  fantasy,  0, ROT90, "SNK", "Fantasy (World)", 0 )
1439GAME( 1981, fantasyu, fantasy,  fantasy,  fantasyu, 0, ROT90, "[SNK] (Rock-Ola license)", "Fantasy (US)", 0 )
1440GAME( 1981, fantasyj, fantasy,  fantasy,  fantasyu, 0, ROT90, "SNK", "Fantasy (Japan)", 0 )
1441GAME( 1982, pballoon, 0,        pballoon, pballoon, 0, ROT90, "SNK", "Pioneer Balloon", 0 )
1442GAME( 1982, nibbler,  0,        nibbler,  nibbler,  0, ROT90, "Rock-Ola", "Nibbler (set 1)", 0 )
1443GAME( 1982, nibblera, nibbler,  nibbler,  nibblera, 0, ROT90, "Rock-Ola", "Nibbler (set 2)", 0 )
1444GAME( 1982, nibblerb, nibbler,  nibbler,  nibblerb, 0, ROT90, "Rock-Ola", "Nibbler (set 3)", 0 )
1445GAME( 1983, nibblero, nibbler,  nibbler,  nibblerb, 0, ROT90, "Olympia",  "Nibbler (Olympia)", 0 )
src/mame/drivers/legionna.c
r5251r5252
21232123GAME( 1992, cupsoca,  cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Seibu Cup Soccer (set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
21242124GAME( 1992, cupsocs,  cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Seibu Cup Soccer :Selection: (set 1)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
21252125GAME( 1992, cupsocs2, cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Seibu Cup Soccer :Selection: (set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2126GAME( 1992, cupsocsb, cupsoc,   cupsocbl, cupsoc,   cupsoc,   ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
2126GAME( 1992, cupsocsb, cupsoc,   cupsocbl, cupsoc,   cupsoc,   ROT0, "bootleg", "Seibu Cup Soccer :Selection: (bootleg)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
21272127GAME( 1992, olysoc92, cupsoc,   cupsoc,   cupsoc,   0,        ROT0, "Seibu", "Olympic Soccer '92", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/toypop.c
r5251r5252
352352   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
353353
354354   PORT_START("DSW1")   /* 56XX #1 pins 22-29 */
355   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
355   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:8,7")
356356   PORT_DIPSETTING(    0x02, "1" )
357357   PORT_DIPSETTING(    0x00, "2" )
358358   PORT_DIPSETTING(    0x03, "3" )
359359   PORT_DIPSETTING(    0x01, "5" )
360   // TODO: bonus scores are different for 5 lives
361   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Bonus_Life ) )
362   PORT_DIPSETTING(    0x04, "40k 120k and every 120k" )
363   PORT_DIPSETTING(    0x1c, "40k 120k 200k 400k..." )
364   PORT_DIPSETTING(    0x10, "40k 120k 200k" )
365   PORT_DIPSETTING(    0x0c, "40k 140k 250k 400k..." )
366   PORT_DIPSETTING(    0x18, "40k 150k and every 150k" )
367   PORT_DIPSETTING(    0x14, "50k 150k 300k 500k..." )
368   PORT_DIPSETTING(    0x08, "50k 150k 300k" )
360   // bonus scores for common
361   PORT_DIPSETTING(    0x1c, "40k 120k 200k 400k 600k 1m" )
362   PORT_DIPSETTING(    0x0c, "40k 140k 250k 400k 700k 1m" )
363   // bonus scores for 1, 2 or 3 lives
364   PORT_DIPSETTING(    0x14, "50k 150k 300k 500k 700k 1m" ) PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
365   PORT_DIPSETTING(    0x04, "40k 120k and every 120k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
366   PORT_DIPSETTING(    0x18, "40k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
367   PORT_DIPSETTING(    0x08, "50k 150k 300k" )              PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
368   PORT_DIPSETTING(    0x10, "40k 120k 200k" )              PORT_CONDITION("DSW1", 0x03, PORTCOND_NOTEQUALS, 0x01)
369   // bonus scores for 5 lives
370   PORT_DIPSETTING(    0x14, "40k 120k" )                   PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
371   PORT_DIPSETTING(    0x04, "50k 150k" )                   PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
372   PORT_DIPSETTING(    0x18, "50k 150k and every 150k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
373   PORT_DIPSETTING(    0x08, "60k 200k and every 200k" )    PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
374   PORT_DIPSETTING(    0x10, "50k" )                        PORT_CONDITION("DSW1", 0x03, PORTCOND_EQUALS, 0x01)
375   // bonus scores for common
369376   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
370   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
377   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2,1")
371378   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
372379   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
373380   PORT_DIPSETTING(    0x00, DEF_STR( 3C_2C ) )
r5251r5252
378385   PORT_DIPSETTING(    0x20, DEF_STR( 1C_6C ) )
379386
380387   PORT_START("DSW2")   /* 56XX #1 pins 30-33 and 38-41 */
381   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
388   PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SWB:8")
382389   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
383390   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
384   PORT_DIPNAME( 0x02, 0x02, "Rack Test" )
391   PORT_DIPNAME( 0x02, 0x02, "Rack Test" ) PORT_DIPLOCATION("SWB:7")
385392   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
386393   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
387   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
394   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:6")
388395   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
389396   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
390   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )
397   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWB:5,4")
391398   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
392399   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
393400   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
394401   PORT_DIPSETTING(    0x10, DEF_STR( 1C_7C ) )
395   PORT_DIPNAME( 0x20, 0x20, "Practice" )
402   PORT_DIPNAME( 0x20, 0x20, "Practice" ) PORT_DIPLOCATION("SWB:3")
396403   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
397404   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
398   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
405   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:2,1")
399406   PORT_DIPSETTING(    0xc0, "A" )
400407   PORT_DIPSETTING(    0x40, "B" )
401408   PORT_DIPSETTING(    0x80, "C" )
r5251r5252
442449   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
443450
444451   PORT_START("DSW1")   /* 56XX #1 pins 22-29 */
445   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
452   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:8,7")
446453   PORT_DIPSETTING(    0x02, "1" )
447454   PORT_DIPSETTING(    0x01, "2" )
448455   PORT_DIPSETTING(    0x03, "3" )
449456   PORT_DIPSETTING(    0x00, "5" )
450   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
457   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:6,5")
451458   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
452459   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
453460   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
454461   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
455   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
462   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:4,3")
456463   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
457464   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
458465   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
459466   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
460   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) )
467   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWA:2")
461468   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
462469   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
463   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
470   PORT_SERVICE_DIPLOC( 0x80, 0x80, "SWA:1" )
464471
465472   PORT_START("DSW2")   /* 56XX #1 pins 30-33 and 38-41 */
466   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
473   PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SWB:8")
467474   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
468475   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
469   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Level_Select ) )
476   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SWB:7")
470477   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
471478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
472   PORT_DIPNAME( 0x04, 0x04, "2 Players Game" )
479   PORT_DIPNAME( 0x04, 0x04, "2 Players Game" ) PORT_DIPLOCATION("SWB:6")
473480   PORT_DIPSETTING(    0x00, "1 Credit" )
474481   PORT_DIPSETTING(    0x04, "2 Credits" )
475482   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
476483   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
477484   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
478   PORT_DIPNAME( 0x10, 0x10, "Entering" )   // ???
485   PORT_DIPNAME( 0x10, 0x10, "Entering" ) PORT_DIPLOCATION("SWB:4")   // buy in
479486   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
480487   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
481   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
488   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:3,2")
482489   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
483490   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
484491   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
485492   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
486   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Bonus_Life ) )
493   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:1")
487494   PORT_DIPSETTING(    0x80, "Every 15000 points" )
488495   PORT_DIPSETTING(    0x00, "Every 20000 points" )
489496
src/mame/drivers/djmain.c
r5251r5252
17321732   ROM_LOAD16_BYTE( "993jaa10.27d", 0x100001, 0x80000, CRC(9D113A2D) SHA1(eee94a5f7015c49aa630b8df0c8e9d137d238811) )
17331733
17341734   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1735   DISK_IMAGE( "993jaa11.chd", 0, NO_DUMP )
1735   DISK_IMAGE( "993jaa11", 0, NO_DUMP )
17361736   // this image has not been verified
1737   //  DISK_IMAGE( "993jaa11.chd", 0, MD5(e26eb62d7cf3357585f5066da6063143) )  /* ver 1.00 JA */
1737   //  DISK_IMAGE( "993jaa11", 0, MD5(e26eb62d7cf3357585f5066da6063143) )  /* ver 1.00 JA */
17381738
17391739   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
17401740ROM_END
r5251r5252
18741874   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
18751875   DISK_IMAGE( "b07jaa11", 0, SHA1(e4925494f0a801abb4d3aa6524c379eb445d8dff) )   /* ver 1.00 JA */
18761876   // this image has not been verified
1877   //DISK_IMAGE( "b07jab11.chd", 0, MD5(0e9440787ca69567792095085e2a3619) )    /* ver 1.00 JA */
1877   //DISK_IMAGE( "b07jab11", 0, MD5(0e9440787ca69567792095085e2a3619) )    /* ver 1.00 JA */
18781878
18791879   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
18801880ROM_END
r5251r5252
19471947   ROM_LOAD16_BYTE( "803jaa10.27d", 0x100001, 0x80000, CRC(535A61A3) SHA1(b24c57601a7e3a349473af69114703133a46806d) )
19481948
19491949   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1950   DISK_IMAGE( "803jaa11.chd", 0, MD5(54a8ac87857d81740621c622e27736d7) )   /* ver 1.00 JA */
1950   DISK_IMAGE( "803jaa11", 0, MD5(54a8ac87857d81740621c622e27736d7) )   /* ver 1.00 JA */
19511951
19521952   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
19531953ROM_END
r5251r5252
19701970   ROM_LOAD16_BYTE( "831jaa10.27d", 0x100001, 0x80000, CRC(85173CB6) SHA1(bc4d86bf4654a9a0a58e624f77090854950f3993) )
19711971
19721972   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1973   DISK_IMAGE( "831jaa11.chd", 0, NO_DUMP )
1973   DISK_IMAGE( "831jaa11", 0, NO_DUMP )
19741974
19751975   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
19761976ROM_END
r5251r5252
19931993   ROM_LOAD16_BYTE( "980jaa10.27d", 0x100001, 0x80000, CRC(7776B87E) SHA1(662b7cd7cb4fb8f8bab240ef543bf9a593e23a03) )
19941994
19951995   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1996   DISK_IMAGE( "980jaa11.chd", 0, MD5(6e5cc17a6bc75cac0256192cc700215c) )   /* ver 1.00 JA */
1996   DISK_IMAGE( "980jaa11", 0, MD5(6e5cc17a6bc75cac0256192cc700215c) )   /* ver 1.00 JA */
19971997
19981998   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
19991999ROM_END
r5251r5252
20162016   ROM_LOAD16_BYTE( "970jba10.27d", 0x100001, 0x80000, CRC(EDC4A245) SHA1(30bbd7bf0299a064119c535abb9be69d725aa130) )
20172017
20182018   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
2019   DISK_IMAGE( "970jba11.chd", 0, MD5(1616905838fdb2b521d53499c6c2a7a4) )   /* ver 1.00 JA */
2019   DISK_IMAGE( "970jba11", 0, MD5(1616905838fdb2b521d53499c6c2a7a4) )   /* ver 1.00 JA */
20202020
20212021   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
20222022ROM_END
src/mame/drivers/gottlieb.c
r5251r5252
454454
455455static TIMER_CALLBACK( laserdisc_philips_callback )
456456{
457   int newcode = laserdisc_get_field_code(laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18);
457   int newcode = laserdisc_get_field_code(laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE);
458458
459459   /* the PR8210 sends line 17/18 data on each frame; the laserdisc interface
460460       board receives notification and latches the most recent frame number */
r5251r5252
468468
469469   /* toggle to the next one */
470470   param = (param == 17) ? 18 : 17;
471   timer_adjust_oneshot(laserdisc_philips_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
471   timer_adjust_oneshot(laserdisc_philips_timer, video_screen_get_time_until_pos(machine->primary_screen, param * 2, 0), param);
472472}
473473
474474
r5251r5252
24262426   ROM_LOAD( "bh06",   0xc000, 0x2000, CRC(ab6c7cf1) SHA1(3625f2e00a333552036bff99af25edeac5915d78) )
24272427
24282428   DISK_REGION( "laserdisc" )
2429   DISK_IMAGE_READONLY( "cobracom", 0, NO_DUMP )
2429   DISK_IMAGE_READONLY( "cobracom", 0, SHA1(8390498294aca97a5d1769032e7b115d1a42f5d3) )
24302430ROM_END
24312431
24322432
r5251r5252
26052605/* games using rev 2 sound board */
26062606GAME( 1983, screwloo, 0,        screwloo,  screwloo, screwloo, ROT0,   "Mylstar", "Screw Loose (prototype)", 0 )
26072607GAME( 1983, mach3,    0,        g2laser,   mach3,    romtiles, ROT0,   "Mylstar", "M.A.C.H. 3", 0 )
2608GAME( 1984, cobram3,  0,        g2laser,   mach3,    romtiles, ROT0,   "Data East","Cobra Command (M.A.C.H. 3 hardware)", GAME_NOT_WORKING )
2608GAME( 1984, cobram3,  0,        g2laser,   mach3,    romtiles, ROT0,   "Data East","Cobra Command (M.A.C.H. 3 hardware)", 0 )
26092609GAME( 1984, usvsthem, 0,        g2laser,   usvsthem, romtiles, ROT0,   "Mylstar", "Us vs. Them", 0 )
26102610GAME( 1984, 3stooges, 0,        gottlieb2, 3stooges, stooges,  ROT0,   "Mylstar", "The Three Stooges In Brides Is Brides", 0 )
26112611GAME( 1984, vidvince, 0,        gottlieb2, vidvince, vidvince, ROT0,   "Mylstar", "Video Vince and the Game Factory (prototype)", GAME_IMPERFECT_GRAPHICS ) // sprite wrapping issues
src/mame/drivers/goldnpkr.c
r5251r5252
24372437*/
24382438ROM_END
24392439
2440
2441
24402442ROM_START( pmpoker )
24412443   ROM_REGION( 0x10000, "maincpu", 0 )
24422444   ROM_LOAD( "2-5.bin",   0x5000, 0x1000, CRC(3446a643) SHA1(e67854e3322e238c17fed4e05282922028b5b5ea) )
r5251r5252
27202722   ROM_LOAD( "82s129.9c",      0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */
27212723ROM_END
27222724
2725ROM_START( witchcdd )
2726   ROM_REGION( 0x10000, "maincpu", 0 )
2727   ROM_LOAD( "12a.bin",   0x0000, 0x8000, CRC(a5c1186a) SHA1(b6c662bf489fbcccc3063ce55c957e630ba96ccb) )
2728
2729   ROM_REGION( 0x6000, "gfx1", 0 )
2730   ROM_FILL(            0x0000, 0x4000, 0 ) /* filling the R-G bitplanes */
2731   ROM_LOAD( "ce-3-tvg.bin",   0x4000, 0x2000, CRC(54b51497) SHA1(8c3a74377fde8c7c5a6b277a9c1e717e6bdd98f8) )    /* text layer */
2732
2733   ROM_REGION( 0x6000, "gfx2", 0 )
2734   ROM_LOAD( "ce-1-tvg.bin",   0x0000, 0x2000, CRC(10b34856) SHA1(52e4cc81b36b4c807b1d4471c0f7bea66108d3fd) )    /* cards deck gfx, bitplane1 */
2735   ROM_LOAD( "ce-2-tvg.bin",   0x2000, 0x2000, CRC(5fc965ef) SHA1(d9ecd7e9b4915750400e76ca604bec8152df1fe4) )    /* cards deck gfx, bitplane2 */
2736   ROM_COPY( "gfx1",   0x4800, 0x4000, 0x0800 )    /* cards deck gfx, bitplane3. found in the 2nd quarter of the text layer rom */
2737
2738   ROM_REGION( 0x0100, "proms", 0 )
2739   ROM_LOAD( "tbp24s10n.7d",      0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) )
2740ROM_END
2741
27232742ROM_START( sloco93 )
27242743   ROM_REGION( 0x10000, "maincpu", 0 )
27252744   ROM_LOAD( "locoloco.128",   0x4000, 0x4000, CRC(f626a770) SHA1(afbd33b3f65b8a781c716a3d6e5447aa817d856c) )
r5251r5252
32663285GAME(  1991, witchcda, witchcrd, witchcrd, witchcda, 0,        ROT0,   "Unknown",                   "Witch Card (spanish, witch game, set 1)", 0 )
32673286GAME(  1991, witchcdb, witchcrd, witchcrd, witchcda, 0,        ROT0,   "Unknown",                   "Witch Card (spanish, witch game, set 2)", 0 )
32683287GAME(  1991, witchcdc, witchcrd, witchcrd, witchcdc, 0,        ROT0,   "Unknown",                   "Witch Card (english, no witch game)",     0 )
3288GAME(  1991, witchcdd, witchcrd, witchcrd, witchcrd, 0,        ROT0,   "Unknown",                   "Witch Card (german?)",                    0 )
32693289GAME(  1993, sloco93,  0,        witchcrd, sloco93,  0,        ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 1)",          0 )
32703290GAME(  1993, sloco93a, sloco93,  witchcrd, sloco93,  0,        ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 2)",          0 )
32713291GAME(  198?, maverik,  0,        witchcrd, bsuerte,  0,        ROT0,   "Unknown",                   "Maverik",                                 0 )
src/mame/drivers/39in1.c
r5251r5252
6565}
6666
6767static MACHINE_DRIVER_START( 39in1 )
68   MDRV_CPU_ADD("maincpu", ARM7, 200000000)   // actually Xscale PXA255, but ARM7 is a compatible subset
68   MDRV_CPU_ADD("maincpu", ARM9, 200000000)   // actually Xscale PXA255, but ARM9 is a compatible subset
6969   MDRV_CPU_PROGRAM_MAP(39in1_map)
7070
7171   MDRV_PALETTE_LENGTH(32768)
src/mame/drivers/quakeat.c
r5251r5252
2727Logical size    2,1163,248,864
2828
2929
30The "backup" directory on hard disk was created by me.
30The "backup" directory on hard disk was created by the dumper.
3131
3232
33 -- Hardware info found in the following press release:
34http://www.quantum3d.com/press/HTMLarchive/4-20-98.html
35
36QUANTUM3D'S HEAVY METAL SYSTEM - HM233G
37NLX form factor system that is based on the Intel 440LX chipset
38233MHz Intel Pentium II processor with 512KB of L2 cache
3932MB of SDRAM
40Microsoft Windows 95 OSR2.5
41shock-mounted 3.1GB Ultra DMA-33 hard drive
4212-24x CD-ROM drive
431.44 MB floppy drive
4416-bit per sample 3D audio
45PCI-based 2D/VGA
46built-in 10/100 Ethernet
47Obsidian2 90-4440 AGP Voodoo2-based realtime 3D graphics accelerator
48Quantum3D's GCI (Game Control Interface) - a unique, low-cost subsystem
49    designed to interface coin-op and industrial input/output control devices to a PC
50
3351*/
3452
3553#include "driver.h"
src/mame/drivers/cliffhgr.c
r5251r5252
9494
9595static WRITE8_HANDLER( cliff_test_led_w )
9696{
97   set_led_status( 0, offset ^ 1 );
97   set_led_status(0, offset ^ 1);
9898}
9999
100100static WRITE8_HANDLER( cliff_port_bank_w )
101101{
102102   /* writing 0x0f clears the LS174 flip flop */
103   if ( data == 0x0f )
103   if (data == 0x0f)
104104      port_bank = 0;
105105   else
106106      port_bank = data & 0x0f; /* only D3-D0 are connected */
r5251r5252
110110{
111111   static const char *const banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
112112
113   if ( port_bank < 7 )
114   {
113   if (port_bank < 7)
115114      return input_port_read(space->machine,  banknames[port_bank]);
116   }
117115
118116   /* output is pulled up for non-mapped ports */
119117   return 0xff;
r5251r5252
121119
122120static READ8_HANDLER( cliff_phillips_code_r )
123121{
124   if ( laserdisc != NULL )
125   {
126      return ( phillips_code >> (8*offset) ) & 0xff;
127   }
122   if (laserdisc != NULL)
123      return (phillips_code >> (8 * offset)) & 0xff;
128124
129125   return 0x00;
130126}
131127
128static WRITE8_HANDLER( cliff_phillips_clear_w )
129{
130   /* reset serial to parallel converters */
131}
132
132133static WRITE8_HANDLER( cliff_coin_counter_w )
133134{
134135   coin_counter_w(0, (data & 0x40) ? 1 : 0 );
r5251r5252
145146static WRITE8_DEVICE_HANDLER( cliff_sound_overlay_w )
146147{
147148   int sound = data & 3;
148   int overlay = ( data & 0x10 ) ? 1 : 0;
149   int overlay = (data & 0x10) ? 1 : 0;
149150
150151   /* configure pen 0 and 1 as transparent in the renderer and use it as the compositing color */
151152   if (overlay)
r5251r5252
160161   }
161162
162163   /* audio */
163   discrete_sound_w(device, CLIFF_ENABLE_SND_1, sound&1);
164   discrete_sound_w(device, CLIFF_ENABLE_SND_2, (sound>>1)&1);
164   discrete_sound_w(device, CLIFF_ENABLE_SND_1, sound & 1);
165   discrete_sound_w(device, CLIFF_ENABLE_SND_2, (sound >> 1) & 1);
165166}
166167
167168static WRITE8_HANDLER( cliff_ldwire_w )
168169{
169   laserdisc_line_w(laserdisc,LASERDISC_LINE_CONTROL,(data&1) ? ASSERT_LINE : CLEAR_LINE );
170   laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
170171}
171172
172173
r5251r5252
185186   switch (param)
186187   {
187188      case 17:
188         phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE17);
189         phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE17, TRUE);
189190         param = 18;
190191         break;
191192
192193      case 18:
193         phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE18);
194         phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE18, TRUE);
194195         param = 17;
195196         break;
196197   }
197198
198199   /* if we have a valid code, trigger an IRQ */
199   if ( phillips_code & 0x800000 )
200   if (phillips_code & 0x800000)
201   {
202      printf("%2d:code = %06X\n", param, phillips_code);
200203      cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
204   }
201205
202   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
206   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, param * 2, 0), param);
203207}
204208
205static void vdp_interrupt (running_machine *machine, int state)
209static void vdp_interrupt(running_machine *machine, int state)
206210{
207   cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE );
211   cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
208212}
209213
210214
r5251r5252
239243   AM_RANGE(0x53, 0x53) AM_READ(cliff_irq_ack_r)
240244   AM_RANGE(0x54, 0x54) AM_WRITE(TMS9928A_register_w)
241245   AM_RANGE(0x55, 0x55) AM_READ(TMS9928A_register_r)
242   AM_RANGE(0x57, 0x57) AM_WRITENOP /* clears the serial->parallel chips of the Phillips code reader. */
246   AM_RANGE(0x57, 0x57) AM_WRITE(cliff_phillips_clear_w)
243247   AM_RANGE(0x60, 0x60) AM_WRITE(cliff_port_bank_w)
244248   AM_RANGE(0x62, 0x62) AM_READ(cliff_port_r)
245249   AM_RANGE(0x64, 0x64) AM_WRITENOP /* unused in schematics, may be used as timing delay for IR interface */
246250   AM_RANGE(0x66, 0x66) AM_WRITE(cliff_ldwire_w)
247251   AM_RANGE(0x68, 0x68) AM_WRITE(cliff_coin_counter_w)
248   AM_RANGE(0x6A, 0x6A) AM_WRITENOP /* /LAMP0 (Infrared?) */
249   AM_RANGE(0x6E, 0x6F) AM_WRITE(cliff_test_led_w)
252   AM_RANGE(0x6a, 0x6a) AM_WRITENOP /* /LAMP0 (Infrared?) */
253   AM_RANGE(0x6e, 0x6f) AM_WRITE(cliff_test_led_w)
250254ADDRESS_MAP_END
251255
252256
r5251r5252
732736   ROM_LOAD( "cliff_u5.bin",   0x8000, 0x2000, CRC(5922e710) SHA1(10637baba4d16dc333aeb0ab88ee251f44e1a115) )
733737
734738   DISK_REGION( "laserdisc" )
735   DISK_IMAGE_READONLY( "cliffhgr", 0, NO_DUMP )
739   DISK_IMAGE_READONLY( "cliffhgr", 0, SHA1(4442995c824d7891a2a19c607bb3301d696fbdc8) )
736740ROM_END
737741
738742ROM_START( cliffhga )
r5251r5252
779783 *
780784 *************************************/
781785
782GAME( 1983, cliffhgr, 0, cliffhgr, cliffhgr, cliff, ROT0, "Stern Electronics", "Cliff Hanger", GAME_NO_SOUND | GAME_NOT_WORKING)
783GAME( 1983, cliffhga, 0, cliffhgr, cliffhga, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", GAME_NO_SOUND | GAME_NOT_WORKING)
784GAME( 1983, goaltogo, 0, cliffhgr, goaltogo, cliff, ROT0, "Stern Electronics", "Goal To Go", GAME_NO_SOUND | GAME_NOT_WORKING)
786GAME( 1983, cliffhgr, 0, cliffhgr, cliffhgr, cliff, ROT0, "Stern Electronics", "Cliff Hanger", 0)
787GAME( 1983, cliffhga, 0, cliffhgr, cliffhga, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", 0)
788GAME( 1983, goaltogo, 0, cliffhgr, goaltogo, cliff, ROT0, "Stern Electronics", "Goal To Go", GAME_NOT_WORKING)
src/mame/drivers/timetrv.c
r0r5252
1/*************************************************************************************************
2
3(Hologram) Time Traveler (c) 1991 Virtual Image Productions / Sega
4
5preliminary driver by Angelo Salese
6
7TODO:
8- unemulated Pioneer LDV-4200 and Sony LDP-1450 players, needs a dump of the BIOSes and proper
9  hook-up;
10
11==================================================================================================
12
13Time Traveler ROM image
14
15warren@dragons-lair-project.com
166/25/01
17
18
19ROM is a 27C020 (256kbit x 8 = 256 KB)
20ROM sticker says 6/18/91
21
22CPU is an Intel 80188
23
24*************************************************************************************************/
25
26#include "driver.h"
27#include "cpu/i86/i86.h"
28
29static UINT8 *led_vram_lo,*led_vram_hi;
30
31VIDEO_START( timetrv )
32{
33
34}
35
36VIDEO_UPDATE( timetrv )
37{
38   popmessage("%s%s",led_vram_lo,led_vram_hi);
39   return 0;
40}
41
42static READ8_HANDLER( test1_r )
43{
44   return input_port_read(space->machine, "IN0");//mame_rand(space->machine);
45}
46
47static READ8_HANDLER( test2_r )
48{
49   /*bit 7,eeprom read bit*/
50   return (input_port_read(space->machine, "IN1") & 0x7f);//mame_rand(space->machine);
51}
52
53
54static READ8_HANDLER( in_r )
55{
56   return 0xff;
57}
58
59static READ8_HANDLER( ld_r )
60{
61   return mame_rand(space->machine);
62}
63
64static ADDRESS_MAP_START( timetrv_map, ADDRESS_SPACE_PROGRAM, 8 )
65   AM_RANGE(0x00000, 0x0ffff) AM_RAM //irq vectors + work ram
66   AM_RANGE(0x10000, 0x107ff) AM_RAM
67   AM_RANGE(0xc0000, 0xfffff) AM_ROM
68ADDRESS_MAP_END
69
70static ADDRESS_MAP_START( timetrv_io, ADDRESS_SPACE_IO, 8 )
71   AM_RANGE(0x0122, 0x0123) AM_WRITENOP //eeprom write bits
72   AM_RANGE(0x1000, 0x1000) AM_READ(test1_r) //inputs
73   AM_RANGE(0x1001, 0x1001) AM_READ(test2_r) //eeprom read bit + inputs
74
75   AM_RANGE(0x1080, 0x1082) AM_READ(in_r) //dsw
76   AM_RANGE(0x1100, 0x1105) AM_WRITENOP //laserdisc write area
77   AM_RANGE(0x1100, 0x1105) AM_READ(ld_r) //5 -> laserdisc read status
78   AM_RANGE(0x1180, 0x1187) AM_RAM AM_BASE(&led_vram_lo)//led string,part 1
79   AM_RANGE(0x1200, 0x1207) AM_RAM AM_BASE(&led_vram_hi)//led string,part 2
80   AM_RANGE(0xff80, 0xffff) AM_RAM //am80188-em-like cpu internal regs?
81ADDRESS_MAP_END
82
83
84static INPUT_PORTS_START( timetrv )
85    PORT_START("IN0")
86   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
87   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
88   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
89   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
90   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
91   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
92   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
93   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
94
95    PORT_START("IN1")
96   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
97   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
98   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
99   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
100   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
101   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
102   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
103   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
104   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
105   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
106   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
107   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
109    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
110    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
111    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
112   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Service_Mode ) )
113   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
114   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
115   // 0x80 eeprom read bit
116INPUT_PORTS_END
117
118static INTERRUPT_GEN( vblank_irq )
119{
120   cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x20/4); //vblank bit flag clear
121}
122
123static INTERRUPT_GEN( ld_irq )
124{
125   cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x48/4); //ld irq
126}
127
128static MACHINE_DRIVER_START( timetrv )
129
130   /* basic machine hardware */
131   MDRV_CPU_ADD("maincpu",I80188,20000000) //???
132   MDRV_CPU_PROGRAM_MAP(timetrv_map)
133   MDRV_CPU_IO_MAP(timetrv_io)
134   MDRV_CPU_VBLANK_INT("screen",vblank_irq)
135   MDRV_CPU_PERIODIC_INT(ld_irq,60) //remove from here
136
137   /* video hardware */
138   MDRV_SCREEN_ADD("screen", RASTER)
139   MDRV_SCREEN_REFRESH_RATE(60)
140   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
141   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
142   MDRV_SCREEN_SIZE(512, 512)
143   MDRV_SCREEN_VISIBLE_AREA(0*8, 512-1, 0*8, 512-1)
144   MDRV_PALETTE_LENGTH(512)
145
146   MDRV_VIDEO_START(timetrv)
147   MDRV_VIDEO_UPDATE(timetrv)
148
149   /* sound hardware */
150MACHINE_DRIVER_END
151
152/***************************************************************************
153
154  Game driver(s)
155
156***************************************************************************/
157
158ROM_START( timetrv )
159   ROM_REGION( 0x100000, "maincpu", 0 )
160   ROM_LOAD( "tt061891.bin",   0xc0000, 0x40000, CRC(a3d44219) SHA1(7c5003b6d3df1e472db45abd725e7d3d43f0dfb4) )
161
162   DISK_REGION( "laserdisc" )
163   DISK_IMAGE_READONLY( "timetrv", 0, NO_DUMP )
164ROM_END
165
166GAME( 1991, timetrv,  0,       timetrv,  timetrv,  0, ROT0, "Virtual Image Productions (Sega license)", "Time Traveller", GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/tmmjprd.c
r5251r5252
6666   COMBINE_DATA(&tmmjprd_tilemap_ram[3][offset]);
6767}
6868
69static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xoffs )
69static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int screen)
7070{
7171   int xpos,ypos,tileno,xflip,yflip, colr;
7272   const gfx_element *gfx = machine->gfx[0];
73//  int todraw = (tmmjprd_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
73   int xoffs;
74   //  int todraw = (tmmjprd_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
7475
75
7676//  UINT32 *source = (tmmjprd_spriteram+ (todraw*2))-2;
7777//  UINT32 *finish = tmmjprd_spriteram;
7878
7979   UINT32 *source = tmmjprd_spriteram+(0xc000/4)-2;
8080   UINT32 *finish = tmmjprd_spriteram;
81   xoffs = (screen & 1)*320;
8182
82
83   while( source>finish )
83   for(;source>finish;source-=2)
8484   {
85      if(screen != (source[0]&0x2000)>>13) continue; //screen flag
86      if(!(source[0]&0x80000000)) continue; //disable flag
8587
86      xpos = (source[0]&0x00000fff);
87      ypos = (source[0]&0x0fff0000)>>16;
88      /* Note: sprite-sprite priorities works as back-to-top but abs x/y calcs works as top-to-back */
89      if(source[0]&0x40000000)
90      {
91         xpos = (source[0]&0x00000fff);
92         ypos = (source[0]&0x0fff0000)>>16;
93         if(xpos&0x800)xpos-=0x1000;
94         if(ypos&0x800)ypos-=0x1000;
95      }
96      else
97      {
98         UINT32 *calc_abs;
99         UINT8 calc_abs_helper;
100         int abs_x = 0,abs_y = 0;
88101
89      xflip = (source[0]&0x00008000)>>15;
90      yflip = (source[0]&0x00004000)>>14;
91      colr = (source[1]&0x0ff00000)>>15;
102         calc_abs = source-2;
92103
104         /* TODO: wrong sprite positioning for the right screen */
105         calc_abs_helper = 0;
106         while(calc_abs > finish || calc_abs_helper == 0) //sanity check
107         {
108            if(calc_abs[0] & 0x40000000)
109            {
110               abs_x = (calc_abs[0]&0x00000fff);
111               abs_y = (calc_abs[0]&0x0fff0000)>>16;
93112
113               if(abs_x & 0x800) abs_x-=0x1000;
114               if(abs_y & 0x800) abs_y-=0x1000;
115
116               calc_abs_helper = 1;
117            }
118            calc_abs-=2;
119         }
120
121         xpos = (source[0]&0x00000fff);
122         ypos = (source[0]&0x0fff0000)>>16;
123
124         if(xpos&0x800)xpos-=0x1000;
125         if(ypos&0x800)ypos-=0x1000;
126         xpos+=abs_x;
127         ypos+=abs_y;
128         xpos&=0x7ff;
129         ypos&=0x7ff;
130      }
131
132      xflip =  (source[0]&0x00008000)>>15;
133      yflip =  (source[0]&0x00004000)>>14;
94134      tileno = (source[1]&0x0003ffff);
135      colr =   (source[1]&0x0ff00000)>>20;
95136
96137      // the tiles in this are 8bpp, it can probably do the funky sub-tile addressing for them too tho..
97138      tileno >>=1;
98139
99      colr =   (source[1]&0x0ff00000)>>20;
100
101      if(xpos&0x800)xpos-=0x1000;
102
103140      // 255 for 8bpp
104141      drawgfx_transpen(bitmap,cliprect,gfx,tileno,colr,!xflip,yflip,(xpos-xoffs)-8,(ypos)-8,255);
105
106      source-=2;
107142   }
108143}
109144
r5251r5252
238273   if (screen == left_screen)
239274   {
240275      ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, tmmjprd_tilemap_ram[3], tmmjprd_tilemap_regs[3], gfxroms );
241      draw_sprites(screen->machine,bitmap,cliprect, 320);
276      draw_sprites(screen->machine,bitmap,cliprect, 1);
242277      ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, tmmjprd_tilemap_ram[2], tmmjprd_tilemap_regs[2], gfxroms );
243278   }
244279   if (screen == right_screen)
src/mame/drivers/tecmo.c
r5251r5252
116116   }
117117}
118118
119/* the 8-bit dipswitches are split across addresses */
120static READ8_HANDLER( tecmo_dswa_l_r )
121{
122   UINT8 port = input_port_read(space->machine, "DSWA");
123   port &= 0x0f;
124   return port;
125}
119126
127static READ8_HANDLER( tecmo_dswa_h_r )
128{
129   UINT8 port = input_port_read(space->machine, "DSWA");
130   port &= 0xf0;
131   return port>>4;
132}
120133
134static READ8_HANDLER( tecmo_dswb_l_r )
135{
136   UINT8 port = input_port_read(space->machine, "DSWB");
137   port &= 0x0f;
138   return port;
139}
140
141static READ8_HANDLER( tecmo_dswb_h_r )
142{
143   UINT8 port = input_port_read(space->machine, "DSWB");
144   port &= 0xf0;
145   return port>>4;
146}
147
148
121149static ADDRESS_MAP_START( rygar_map, ADDRESS_SPACE_PROGRAM, 8 )
122150   AM_RANGE(0x0000, 0xbfff) AM_ROM
123151   AM_RANGE(0xc000, 0xcfff) AM_RAM
r5251r5252
133161   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("BUTTONS2")
134162   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("SYS_0")
135163   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("SYS_1")
136   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("DSWA_0")
137   AM_RANGE(0xf807, 0xf807) AM_READ_PORT("DSWA_1")
138   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("DSWB_0")
139   AM_RANGE(0xf809, 0xf809) AM_READ_PORT("DSWB_1")
164   AM_RANGE(0xf806, 0xf806) AM_READ( tecmo_dswa_l_r )
165   AM_RANGE(0xf807, 0xf807) AM_READ( tecmo_dswa_h_r )
166   AM_RANGE(0xf808, 0xf808) AM_READ( tecmo_dswb_l_r )
167   AM_RANGE(0xf809, 0xf809) AM_READ( tecmo_dswb_h_r )
140168   AM_RANGE(0xf80f, 0xf80f) AM_READ_PORT("SYS_2")
141169   AM_RANGE(0xf800, 0xf802) AM_WRITE(tecmo_fgscroll_w)
142170   AM_RANGE(0xf803, 0xf805) AM_WRITE(tecmo_bgscroll_w)
r5251r5252
161189   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("BUTTONS2")
162190   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("SYS_0")
163191   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("SYS_1")
164   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("DSWA_0")
165   AM_RANGE(0xf807, 0xf807) AM_READ_PORT("DSWA_1")
166   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("DSWB_0")
167   AM_RANGE(0xf809, 0xf809) AM_READ_PORT("DSWB_1")
192   AM_RANGE(0xf806, 0xf806) AM_READ( tecmo_dswa_l_r )
193   AM_RANGE(0xf807, 0xf807) AM_READ( tecmo_dswa_h_r )
194   AM_RANGE(0xf808, 0xf808) AM_READ( tecmo_dswb_l_r )
195   AM_RANGE(0xf809, 0xf809) AM_READ( tecmo_dswb_h_r )
168196   AM_RANGE(0xf80f, 0xf80f) AM_READ_PORT("SYS_2")
169197   AM_RANGE(0xf800, 0xf802) AM_WRITE(tecmo_fgscroll_w)
170198   AM_RANGE(0xf803, 0xf805) AM_WRITE(tecmo_bgscroll_w)
r5251r5252
189217   AM_RANGE(0xf803, 0xf803) AM_READ_PORT("BUTTONS2")
190218   AM_RANGE(0xf804, 0xf804) AM_READ_PORT("SYS_0")
191219   AM_RANGE(0xf805, 0xf805) AM_READ_PORT("SYS_1")
192   AM_RANGE(0xf806, 0xf806) AM_READ_PORT("DSWA_0")
193   AM_RANGE(0xf807, 0xf807) AM_READ_PORT("DSWA_1")
194   AM_RANGE(0xf808, 0xf808) AM_READ_PORT("DSWB_0")
195   AM_RANGE(0xf809, 0xf809) AM_READ_PORT("DSWB_1")
220   AM_RANGE(0xf806, 0xf806) AM_READ( tecmo_dswa_l_r )
221   AM_RANGE(0xf807, 0xf807) AM_READ( tecmo_dswa_h_r )
222   AM_RANGE(0xf808, 0xf808) AM_READ( tecmo_dswb_l_r )
223   AM_RANGE(0xf809, 0xf809) AM_READ( tecmo_dswb_h_r )
196224   AM_RANGE(0xf80f, 0xf80f) AM_READ_PORT("SYS_2")
197225   AM_RANGE(0xf800, 0xf802) AM_WRITE(tecmo_fgscroll_w)
198226   AM_RANGE(0xf803, 0xf805) AM_WRITE(tecmo_bgscroll_w)
r5251r5252
264292   PORT_START("SYS_2")      /* unused? */
265293   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
266294
267   PORT_START("DSWA_0")
295   PORT_START("DSWA")
268296   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
269297   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
270298   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r5251r5252
275303   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
276304   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
277305   PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
278
279   PORT_START("DSWA_1")
280   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
281   PORT_DIPSETTING(    0x03, "2" )
306   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
307   PORT_DIPSETTING(    0x30, "2" )
282308   PORT_DIPSETTING(    0x00, "3" )
283   PORT_DIPSETTING(    0x01, "4" )
284   PORT_DIPSETTING(    0x02, "5" )
285   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )
286   PORT_DIPSETTING(    0x04, DEF_STR( Upright ) )
309   PORT_DIPSETTING(    0x10, "4" )
310   PORT_DIPSETTING(    0x20, "5" )
311   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
312   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
287313   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
288   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) /* Listed as "Unused" in the manual */
314   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) /* Listed as "Unused" in the manual */
289315   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
290   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
316   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
291317
292   PORT_START("DSWB_0")
318   PORT_START("DSWB")
293319   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
294320   PORT_DIPSETTING(    0x00, "50000 200000 500000" )
295321   PORT_DIPSETTING(    0x01, "100000 300000 600000" )
r5251r5252
301327   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) /* Listed as "Unused" in the manual */
302328   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
303329   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
304
305   PORT_START("DSWB_1")
306   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
330   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) )
307331   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
308   PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
309   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
310   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
311   PORT_DIPNAME( 0x04, 0x00, "2P Can Start Anytime" )
332   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
333   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
334   PORT_DIPSETTING(    0x30, DEF_STR( Hardest ) )
335   PORT_DIPNAME( 0x40, 0x00, "2P Can Start Anytime" )
312336   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
313   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
314   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) )
337   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
338   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )
315339   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
316   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
340   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
317341INPUT_PORTS_END
318342
319343static INPUT_PORTS_START( gemini )
r5251r5252
353377   PORT_START("SYS_2")      /* unused? */
354378   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
355379
356   PORT_START("DSWA_0")
380   PORT_START("DSWA")
357381   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) )
358382   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
359383   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r5251r5252
366390   PORT_DIPNAME( 0x08, 0x00, "Final Round Continuation" )
367391   PORT_DIPSETTING(    0x00, "Round 6" )
368392   PORT_DIPSETTING(    0x08, "Round 7" )
369
370   PORT_START("DSWA_1")
371   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_B ) )
372   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
393   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coin_B ) )
394   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
373395   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
374   PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
375   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
376   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
377   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
378   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
379   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
380   PORT_DIPNAME( 0x08, 0x00, "Buy in During Final Round" )
396   PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
397   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
398   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
399   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
400   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
401   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
402   PORT_DIPNAME( 0x80, 0x00, "Buy in During Final Round" )
381403   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
382   PORT_DIPSETTING(    0x08, DEF_STR( Yes ) )
404   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
383405
384   PORT_START("DSWB_0")
406   PORT_START("DSWB")
385407   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
386408   PORT_DIPSETTING(    0x03, "2" )
387409   PORT_DIPSETTING(    0x00, "3" )
r5251r5252
392414   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
393415   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
394416   PORT_DIPSETTING(    0x0c, DEF_STR( Hardest ) )
417   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Bonus_Life ) )
418   PORT_DIPSETTING(    0x00, "50000 200000" )
419   PORT_DIPSETTING(    0x10, "50000 300000" )
420   PORT_DIPSETTING(    0x20, "100000 500000" )
421   PORT_DIPSETTING(    0x30, "50000" )
422   PORT_DIPSETTING(    0x40, "100000" )
423   PORT_DIPSETTING(    0x50, "200000" )
424   PORT_DIPSETTING(    0x60, "300000" )
425   PORT_DIPSETTING(    0x70, DEF_STR( None ) )
426   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
427   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
428   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
429INPUT_PORTS_END
395430
396   PORT_START("DSWB_1")
431
432static INPUT_PORTS_START( backfirt )
433   PORT_START("JOY1")
434   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
435   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
436   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
437   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
438
439   PORT_START("BUTTONS1")
440   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 )
441   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 )
442   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
443   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
444
445   PORT_START("JOY2")
446   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
447   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
448   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
449   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
450
451   PORT_START("BUTTONS2")
452   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
453   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
454   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
455   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
456
457   PORT_START("SYS_0")      /* unused? */
458   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
459
460   PORT_START("SYS_1")
461   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START2 )
462   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
463   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
464   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
465
466   PORT_START("SYS_2")      /* unused? */
467   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
468
469   PORT_START("DSWA")
470   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
471   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
472   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
473   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
474   PORT_DIPSETTING(    0x03, DEF_STR( 1C_6C ) ) // limit of 9?
475   PORT_DIPNAME( 0x0C, 0x00, DEF_STR( Coin_B ) )
476   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
477   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
478   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
479   PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
480   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
481    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
482    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
483    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
484    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
485    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
486    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
487    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
488    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
489    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
490    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
491    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
492
493   PORT_START("DSWB")
397494   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
398   PORT_DIPSETTING(    0x00, "50000 200000" )
399   PORT_DIPSETTING(    0x01, "50000 300000" )
400   PORT_DIPSETTING(    0x02, "100000 500000" )
401   PORT_DIPSETTING(    0x03, "50000" )
402   PORT_DIPSETTING(    0x04, "100000" )
403   PORT_DIPSETTING(    0x05, "200000" )
404   PORT_DIPSETTING(    0x06, "300000" )
495   PORT_DIPSETTING(    0x00, "50000 200000 500000" )
496   PORT_DIPSETTING(    0x01, "100000 300000 800000" )
497   PORT_DIPSETTING(    0x02, "50000 200000" )
498   PORT_DIPSETTING(    0x03, "100000 300000" )
499   PORT_DIPSETTING(    0x04, "50000" )
500   PORT_DIPSETTING(    0x05, "100000" )
501   PORT_DIPSETTING(    0x06, "200000" )
405502   PORT_DIPSETTING(    0x07, DEF_STR( None ) )
406   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
407   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
408   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
503   PORT_DIPNAME( 0x38, 0x00, DEF_STR( Difficulty ) )
504   PORT_DIPSETTING(    0x00, "0" )
505   PORT_DIPSETTING(    0x08, "1" )
506   PORT_DIPSETTING(    0x10, "2" )
507   PORT_DIPSETTING(    0x18, "3" )
508   PORT_DIPSETTING(    0x20, "4" )
509   PORT_DIPSETTING(    0x28, "5" )
510   PORT_DIPSETTING(    0x30, "6" )
511   PORT_DIPSETTING(    0x38, "7" )
512    PORT_DIPNAME( 0x40, 0x40, "Continue" )
513    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
514    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
515    PORT_DIPNAME( 0x80, 0x00, "Invulnerability" )
516    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
517    PORT_DIPSETTING(    0x80, DEF_STR( On ) )
409518INPUT_PORTS_END
410519
520
411521static INPUT_PORTS_START( silkworm )
412522   PORT_START("JOY1")
413523   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
r5251r5252
445555   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
446556   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
447557
448   PORT_START("DSWA_0")
558   PORT_START("DSWA")
449559   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
450560   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
451561   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r5251r5252
456566   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
457567   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
458568   PORT_DIPSETTING(    0x0C, DEF_STR( 1C_3C ) )
459
460   PORT_START("DSWA_1")
461   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
462   PORT_DIPSETTING(    0x03, "2" )
569   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
570   PORT_DIPSETTING(    0x30, "2" )
463571   PORT_DIPSETTING(    0x00, "3" )
464   PORT_DIPSETTING(    0x01, "4" )
465   PORT_DIPSETTING(    0x02, "5" )
466   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )   /* unused? */
572   PORT_DIPSETTING(    0x10, "4" )
573   PORT_DIPSETTING(    0x20, "5" )
574   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* unused? */
467575   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
468   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
469   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
576   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
577   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
470578   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
471   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
579   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
472580
473   PORT_START("DSWB_0")
581   PORT_START("DSWB")
474582   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Bonus_Life ) )
475583   PORT_DIPSETTING(    0x00, "50000 200000 500000" )
476584   PORT_DIPSETTING(    0x01, "100000 300000 800000" )
r5251r5252
483591   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )   /* unused? */
484592   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
485593   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
486
487   PORT_START("DSWB_1")
488   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Difficulty ) )
594   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Difficulty ) )
595   PORT_DIPSETTING(    0x60, "0" )
596   PORT_DIPSETTING(    0x70, "0" )
489597   PORT_DIPSETTING(    0x00, "0" )
490   PORT_DIPSETTING(    0x01, "1" )
491   PORT_DIPSETTING(    0x02, "2" )
492   PORT_DIPSETTING(    0x03, "3" )
493   PORT_DIPSETTING(    0x04, "4" )
494   PORT_DIPSETTING(    0x05, "5" )
495   /* 0x06 and 0x07 are the same as 0x00 */
496   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) )
497   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
598   PORT_DIPSETTING(    0x10, "1" )
599   PORT_DIPSETTING(    0x20, "2" )
600   PORT_DIPSETTING(    0x30, "3" )
601   PORT_DIPSETTING(    0x40, "4" )
602   PORT_DIPSETTING(    0x50, "5" )
603   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
604   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
498605   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
499606INPUT_PORTS_END
500607
r5251r5252
627734   MDRV_CPU_PROGRAM_MAP(silkworm_map)
628735MACHINE_DRIVER_END
629736
737static MACHINE_DRIVER_START( backfirt )
630738
739   /* basic machine hardware */
740   MDRV_CPU_ADD("maincpu", Z80, XTAL_24MHz/4)
741   MDRV_CPU_PROGRAM_MAP(rygar_map)
742   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
631743
744   MDRV_CPU_ADD("soundcpu", Z80, XTAL_8MHz/2)
745   MDRV_CPU_PROGRAM_MAP(rygar_sound_map)
746
747   /* video hardware */
748   MDRV_SCREEN_ADD("screen", RASTER)
749   MDRV_SCREEN_REFRESH_RATE(60)
750   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)   /* frames per second, vblank duration */)
751   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
752   MDRV_SCREEN_SIZE(32*8, 32*8)
753   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
754
755   MDRV_GFXDECODE(tecmo)
756   MDRV_PALETTE_LENGTH(1024)
757
758   MDRV_VIDEO_START(tecmo)
759   MDRV_VIDEO_UPDATE(tecmo)
760
761   MDRV_MACHINE_RESET( rygar )
762
763   /* sound hardware */
764   MDRV_SPEAKER_STANDARD_MONO("mono")
765
766   MDRV_SOUND_ADD("ym", YM3812, XTAL_4MHz) /* verified on pcb */
767   MDRV_SOUND_CONFIG(ym3812_config)
768   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
769
770   /* no MSM on this PCB */
771
772MACHINE_DRIVER_END
773
632774/***************************************************************************
633775
634776  Game driver(s)
r5251r5252
838980   ROM_LOAD( "silkworm.1",   0x0000, 0x8000, CRC(5b553644) SHA1(5d39d2251094c17f7b732b4861401b3516fce9b1) )
839981ROM_END
840982
983/*
984
985main cpu Z80A
986sound cpu Z80A* see note
987sound ic ym3812 + 3014
988Osc 8Mhz and 24Mhz
989
990*Note:The sound cpu was protected inside a epoxy block fit on a 40 pin socket in reverse of cpu board (solder side).By dissolving resin the small sub pcb contains Z80A (identified by pins),76c28 (6116),a 74ls00 and 74ls138.
991
992ROMs    B4,B5 main program
993B2 sound program
994B3 character gfx
995B6 to B9 object gfx
996B10 to B13 foreground gfx
997B14 to B17 background gfx
998All eprom/rom are 27256,27512
999
1000RAMs:
1001-ram (cpu board):
10026264 main/work
10036116 (sub pcb*),6116, 2114 x3 sound
10046116 character
1005-ram (video board):
10066116 scroll
10076116 foreground
10086116 background
10094164 x20 object/sprites
1010
1011*/
1012
1013ROM_START( backfirt )
1014   ROM_REGION( 0x20000, "maincpu", 0 )
1015   ROM_LOAD( "b5-e3.bin",           0x00000, 0x10000, CRC(0ab3bd4d) SHA1(2653d099c894304d3f9c2b2de9a7fed67be7b6dc) )   /* c000-ffff is not used */
1016   ROM_LOAD( "b4-f3.bin",   0x10000, 0x10000, CRC(150b6949) SHA1(31870a2f471b71d79a4daa0b5baca0d941de12e4) )   /* banked at f000-f7ff */
1017
1018   ROM_REGION( 0x20000, "soundcpu", 0 )
1019   ROM_LOAD( "b2-e10.bin",           0x0000, 0x8000, CRC(9b2ac54f) SHA1(7c10e00235dc2668dee5c97ea5c6dc7722f35f03) )
1020
1021   ROM_REGION( 0x08000, "gfx1", 0 )
1022   ROM_LOAD( "b3-c10.bin",   0x00000, 0x08000, CRC(08ce729f) SHA1(8e426251b20edfb10f0837b3106b4f333bc114a4) )   /* characters */
1023
1024   ROM_REGION( 0x40000, "gfx2", 0 )
1025   ROM_LOAD( "b6-c2.bin",   0x00000, 0x10000, CRC(c8c25e45) SHA1(d771d5e7d2d8082680f73b778ef2d88f2e9b8591) )   /* sprites */
1026   ROM_LOAD( "b7-d2.bin",   0x10000, 0x10000, CRC(25fb6a57) SHA1(7f411af7417fa901d65194c348ecec58c61b7cf7) )   /* sprites */
1027   ROM_LOAD( "b8-e2.bin",   0x20000, 0x10000, CRC(6bccac4e) SHA1(e042d049761affe4d3d0eac3c7a24f428643a9cf) )   /* sprites */
1028   ROM_LOAD( "b9-h2.bin",   0x30000, 0x10000, CRC(566a99b8) SHA1(a78825f0a85235399e66906cffafda98445a89a2) )   /* sprites */
1029
1030   ROM_REGION( 0x40000, "gfx3", 0 )
1031   ROM_LOAD( "b13-p1.bin",  0x00000, 0x10000, CRC(8c7138bb) SHA1(0cfd69fa77d5b546f7dad80537d8d2497ae758bc) )   /* tiles #1 */
1032   ROM_LOAD( "b12-p2.bin",  0x10000, 0x10000, CRC(6c03c476) SHA1(79ad800a2f4ba6d44ba5a31210cbd8566bb357b6) )   /* tiles #1 */
1033   ROM_LOAD( "b11-p2.bin",  0x20000, 0x10000, CRC(0bc84b4b) SHA1(599041108d09fd61aab2b0aeac0e07715887476c) )   /* tiles #1 */
1034   ROM_LOAD( "b10-p3.bin",  0x30000, 0x10000, CRC(ec149ec3) SHA1(7817dc2659fe4ba3bb810df278378d51d97065b3) )   /* tiles #1 */
1035
1036   ROM_REGION( 0x40000, "gfx4", 0 )
1037   ROM_LOAD( "b17-s1.bin",  0x00000, 0x10000, CRC(409df64b) SHA1(cada970bf9cc8f6522e7a71e00fe873568852873) )   /* tiles #2 */
1038   ROM_LOAD( "b16-s2.bin",  0x10000, 0x10000, CRC(6e4052c9) SHA1(e2e3d7221b75cb044449a25a076a93c3def1f11b) )   /* tiles #2 */
1039   ROM_LOAD( "b15-s2.bin",  0x20000, 0x10000, CRC(2b6cc20e) SHA1(4815819288753400935836cc1b0b69f4c4b43ddc) )   /* tiles #2 */
1040   ROM_LOAD( "b14-s3.bin",  0x30000, 0x08000, CRC(4d29637a) SHA1(28e85925138256b8ce5a1c4a5df5b219b1b6b197) )   /* tiles #2 */ // half size is correct, rom type 27256
1041ROM_END
1042
8411043ROM_START( gemini )
8421044   ROM_REGION( 0x20000, "maincpu", 0 )
8431045   ROM_LOAD( "gw04-5s.rom",  0x00000, 0x10000, CRC(ff9de855) SHA1(34167af8456a081f68b338f10d4319ce1e703fd4) )   /* c000-ffff is not used */
r5251r5252
8811083static DRIVER_INIT( silkworm ) { tecmo_video_type = 1; }
8821084static DRIVER_INIT( gemini )   { tecmo_video_type = 2; }
8831085
1086static DRIVER_INIT( backfirt )
1087{
1088   tecmo_video_type = 2;
8841089
1090   /* no MSM */
1091   memory_install_write8_handler(cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xc000, 0, 0, SMH_NOP);
1092   memory_install_write8_handler(cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_PROGRAM), 0xd000, 0xd000, 0, 0, SMH_NOP);
1093   memory_install_write8_handler(cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xe000, 0, 0, SMH_NOP);
8851094
1095
1096}
1097
1098
1099
1100
8861101GAME( 1986, rygar,    0,        rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 1)", 0 )
8871102GAME( 1986, rygar2,   rygar,    rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 2)", 0 )
8881103GAME( 1986, rygar3,   rygar,    rygar,    rygar,    rygar,    ROT0,  "Tecmo", "Rygar (US set 3 Old Version)", 0 )
r5251r5252
8901105GAME( 1987, gemini,   0,        gemini,   gemini,   gemini,   ROT90, "Tecmo", "Gemini Wing", 0 )
8911106GAME( 1988, silkworm, 0,        silkworm, silkworm, silkworm, ROT0,  "Tecmo", "Silk Worm (set 1)", 0 )
8921107GAME( 1988, silkwrm2, silkworm, silkworm, silkworm, silkworm, ROT0,  "Tecmo", "Silk Worm (set 2)", 0 )
1108GAME( 1988, backfirt, 0,        gemini,   backfirt, backfirt, ROT0,  "Tecmo", "Back Fire (Tecmo, bootleg)", 0 )
src/mame/drivers/scobra.c
r5251r5252
13631363GAME( 1981, hustler,  0,        hustler,  hustler,  hustler,      ROT90,  "Konami", "Video Hustler", GAME_SUPPORTS_SAVE )
13641364GAME( 1981, billiard, hustler,  hustler,  hustler,  billiard,     ROT90,  "bootleg", "The Billiards", GAME_SUPPORTS_SAVE )
13651365GAME( 1981, hustlerb, hustler,  hustlerb, hustler,  scramble_ppi, ROT90,  "bootleg", "Video Hustler (bootleg)", GAME_SUPPORTS_SAVE )
1366GAME( 198?, mimonkey, 0,      mimonkey, mimonkey,   mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
1367GAME( 198?, mimonsco, mimonkey, mimonkey, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
1366GAME( 1982, mimonkey, 0,   mimonkey, mimonkey, mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
1367GAME( 1982, mimonsco, mimonkey, mimonkey, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
13681368
src/mame/drivers/cb2001.c
r5251r5252
137137}
138138
139139static ADDRESS_MAP_START( cb2001_map, ADDRESS_SPACE_PROGRAM, 16 )
140   AM_RANGE(0x00000, 0xdffff) AM_RAM
141   AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0)
140   AM_RANGE(0x00000, 0xbffff) AM_RAM
141   AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("boot_prg",0)
142142ADDRESS_MAP_END
143143
144144static ADDRESS_MAP_START( cb2001_io, ADDRESS_SPACE_IO, 16 )
r5251r5252
204204
205205
206206ROM_START( cb2001 )
207   ROM_REGION( 0x020000, "boot_prg", 0 )
208   ROM_LOAD16_WORD( "c01111.11f", 0x000000, 0x20000, CRC(ec6269f1) SHA1(f2428562a10e30192f2c95053f5ce448302e7cf5) )
207   ROM_REGION( 0x040000, "boot_prg", 0 )
208   ROM_LOAD16_WORD( "c01111.11f", 0x020000, 0x20000, CRC(ec6269f1) SHA1(f2428562a10e30192f2c95053f5ce448302e7cf5) )
209209
210   ROM_REGION( 0x080000, "gfx", 0 ) // not tiles, blitter based, or mem mapped?
210   ROM_REGION( 0x080000, "gfx", 0 )
211211   ROM_LOAD( "c0111.12a", 0x000000, 0x80000, CRC(342b760e) SHA1(bc168bec384ccacd73543f604e3ab5b2b8f4f441) )
212212
213213   ROM_REGION( 0x200, "user1", 0 ) // ?
r5251r5252
216216   ROM_LOAD( "am27s29.11b", 0x000, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) )
217217ROM_END
218218
219ROM_START( scherrym )
220   ROM_REGION( 0x040000, "boot_prg", 0 )
221   ROM_LOAD16_WORD( "f11.bin", 0x000000, 0x40000, CRC(8967f58d) SHA1(eb01a16b7d108f5fbe5de8f611b4f77869aedbf1) )
222
223   ROM_REGION( 0x080000, "gfx", 0 )
224   ROM_LOAD( "12a.bin", 0x000000, 0x80000,NO_DUMP ) // missing on PCB
225
226   // assumed to be the same
227   ROM_REGION( 0x200, "user1", 0 ) // ?
228   ROM_LOAD( "am27s29.9b", 0x000, 0x200, CRC(6c90f6a2) SHA1(f3f592954000d189ded0ed8c6c4444ace0b616a4) )
229   ROM_REGION( 0x200, "user2", 0 ) // ?
230   ROM_LOAD( "am27s29.11b", 0x000, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) )
231ROM_END
232
219233GAME( 2001, cb2001,    0,      cb2001,      cb2001,   0, ROT0,  "Dyna", "Cherry Bonus 2001", GAME_NOT_WORKING|GAME_NO_SOUND )
234GAME( 2001, scherrym,  0,      cb2001,      cb2001,   0, ROT0,  "Dyna", "Super Cherry Master", GAME_NOT_WORKING|GAME_NO_SOUND ) // 2001 version? (we have bootlegs running on z80 hw of a 1996 version)
235
src/mame/drivers/tetrisp2.c
r5251r5252
13251325
13261326***************************************************************************/
13271327
1328ROM_START( tetrisp2 ) /* Unknown version */
1328ROM_START( tetrisp2 ) /* Version 2.8 */
13291329   ROM_REGION( 0x100000, "maincpu", 0 )      /* 68000 Code */
1330   ROM_LOAD16_BYTE( "t2p_04.rom", 0x000000, 0x080000, CRC(e67f9c51) SHA1(d8b2937699d648267b163c7c3f591426877f3701) )
1331   ROM_LOAD16_BYTE( "t2p_01.rom", 0x000001, 0x080000, CRC(5020a4ed) SHA1(9c0f02fe3700761771ac026a2e375144e86e5eb7) )
1330   ROM_LOAD16_BYTE( "tet2_4_ver2.8.ic65", 0x000000, 0x080000, CRC(e67f9c51) SHA1(d8b2937699d648267b163c7c3f591426877f3701) )
1331   ROM_LOAD16_BYTE( "tet2_1_ver2.8.ic59", 0x000001, 0x080000, CRC(5020a4ed) SHA1(9c0f02fe3700761771ac026a2e375144e86e5eb7) )
13321332
13331333   ROM_REGION( 0x800000, "gfx1", 0 )   /* 8x8x8 (Sprites) */
13341334   ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
r5251r5252
13451345   ROM_LOAD( "96019-04.6",  0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) )
13461346
13471347   ROM_REGION( 0x080000, "gfx4", 0 )   /* 8x8x8 (Foreground) */
1348   ROM_LOAD( "tetp2-10.bin", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
1348   ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
13491349
13501350   ROM_REGION( 0x400000, "ymz", 0 )   /* Samples */
13511351   ROM_LOAD( "96019-07.7", 0x000000, 0x400000, CRC(a8a61954) SHA1(86c3db10b348ba1f44ff696877b8b20845fa53de) )
r5251r5252
13531353
13541354ROM_START( tetrisp2j ) /* Version 2.2 */
13551355   ROM_REGION( 0x100000, "maincpu", 0 )      /* 68000 Code */
1356   ROM_LOAD16_BYTE( "tet2-4v2.2", 0x000000, 0x080000, CRC(5bfa32c8) SHA1(55fb2872695fcfbad13f5c0723302e72da69e44a) )
1357   ROM_LOAD16_BYTE( "tet2-1v2.2", 0x000001, 0x080000, CRC(919116d0) SHA1(3e1c0fd4c9175b2900a4717fbb9e8b591c5f534d) )
1356   ROM_LOAD16_BYTE( "tet2_4_ver2.2.ic65", 0x000000, 0x080000, CRC(5bfa32c8) SHA1(55fb2872695fcfbad13f5c0723302e72da69e44a) )
1357   ROM_LOAD16_BYTE( "tet2_1_ver2.2.ic59", 0x000001, 0x080000, CRC(919116d0) SHA1(3e1c0fd4c9175b2900a4717fbb9e8b591c5f534d) )
13581358
13591359   ROM_REGION( 0x800000, "gfx1", 0 )   /* 8x8x8 (Sprites) */
13601360   ROM_LOAD32_WORD( "96019-01.9", 0x000000, 0x400000, CRC(06f7dc64) SHA1(722c51b707b9854c0293afdff18b27ec7cae6719) )
r5251r5252
13671367   ROM_LOAD( "96019-04.6",  0x000000, 0x100000, CRC(b849dec9) SHA1(fa7ac00fbe587a74c3fb8c74a0f91f7afeb8682f) )
13681368
13691369   ROM_REGION( 0x080000, "gfx4", 0 )   /* 8x8x8 (Foreground) */
1370   ROM_LOAD( "tetp2-10.bin", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
1370   ROM_LOAD( "tetp2-10.ic27", 0x000000, 0x080000, CRC(34dd1bad) SHA1(9bdf1dde11f82839676400de5dd7acb06ea8cdb2) )   // 11111xxxxxxxxxxxxxx = 0xFF
13711371
13721372   ROM_REGION( 0x400000, "ymz", 0 )   /* Samples */
13731373   ROM_LOAD( "96019-07.7", 0x000000, 0x400000, CRC(a8a61954) SHA1(86c3db10b348ba1f44ff696877b8b20845fa53de) )
src/mame/drivers/namcos22.c
r5251r5252
44144414   ROM_REGION16_LE( 0x080000, "user4", 0 ) /* MCU BIOS */
44154415   ROM_LOAD( "ts1data.8k", 0, 0x080000, CRC(e68aa973) SHA1(663e80d249be5d5841139d98a9d72e2396851272) )
44164416
4417   ROM_REGION( 0xe00000, "sprite", 0 ) /* 32x32x8bpp sprite tiles */
4418   ROM_LOAD( "ts1scg0.12f",0x200000, 0x200000,CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) )
4419   ROM_LOAD( "ts1scg1.10f",0x400000, 0x200000,CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) )
4420   ROM_LOAD( "ts1scg2.8f", 0x600000, 0x200000,CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) )
4421   ROM_LOAD( "ts1scg3.7f", 0x800000, 0x200000,CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) )
4422   ROM_LOAD( "ts1scg4.5f", 0xa00000, 0x200000,CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) )
4423   ROM_LOAD( "ts1scg5.3f", 0xc00000, 0x200000,CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) )
4417   ROM_REGION( 0xc00000, "sprite", 0 ) /* 32x32x8bpp sprite tiles */
4418   ROM_LOAD( "ts1scg0.12f",0x200000*0, 0x200000,CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) )
4419   ROM_LOAD( "ts1scg1.10f",0x200000*1, 0x200000,CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) )
4420   ROM_LOAD( "ts1scg2.8f", 0x200000*2, 0x200000,CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) )
4421   ROM_LOAD( "ts1scg3.7f", 0x200000*3, 0x200000,CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) )
4422   ROM_LOAD( "ts1scg4.5f", 0x200000*4, 0x200000,CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) )
4423   ROM_LOAD( "ts1scg5.3f", 0x200000*5, 0x200000,CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) )
44244424
44254425   ROM_REGION( 0x200000*8, "textile", 0) /* 16x16x8bpp texture tiles */
44264426   ROM_LOAD( "ts1cg0.8d",   0x200000*0x0, 0x200000,CRC(de07b22c) SHA1(f4d07b8840ec8be625eff634bce619e960c334a5) )
r5251r5252
46114611        ROM_LOAD( "aj1ptru2.15f", 0x500000, 0x080000, CRC(91ffbb77) SHA1(fbfe7d32ef22037f7190d1b8263b5e8c55f2d892) )
46124612        ROM_LOAD( "aj1ptru3.14f", 0x580000, 0x080000, CRC(d83d8d42) SHA1(e1561ce4538b01db92b7e645ad008cd1a2ddaf8a) )
46134613
4614   ROM_REGION( 0xa00000, "c352", 0 ) /* sound samples */
4614   ROM_REGION( 0x1000000, "c352", 0 ) /* sound samples */
46154615        ROM_LOAD( "aj1wavea.2l",  0x000000, 0x400000, CRC(8c72ea59) SHA1(3ae8dbd8baae08f1daab2b218932ba9d9451231d) )
4616        ROM_LOAD( "aj1waveb.1l",  0x400000, 0x400000, CRC(ab5a457f) SHA1(c34531fd574eb0c3e78fc31a9af8658df3446adc) )
4616        ROM_LOAD( "aj1waveb.1l",  0x800000, 0x400000, CRC(ab5a457f) SHA1(c34531fd574eb0c3e78fc31a9af8658df3446adc) )
46174617ROM_END
46184618
46194619/*******************************************************************/
src/mame/drivers/cubocd32.c
r5251r5252
11761176
11771177static void cndypuzl_input_hack(running_machine *machine)
11781178{
1179   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1179   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
11801180   {
11811181//      amiga_chip_ram_w(0x051c02, 0x0000);
11821182
1183      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1183      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
11841184      amiga_chip_ram_w(r_A5 - 0x7ebe, 0x0000);
11851185   }
11861186}
r5251r5252
11931193
11941194static void haremchl_input_hack(running_machine *machine)
11951195{
1196   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1196   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
11971197   {
11981198//      amiga_chip_ram_w8(0x002907, 0x00);
11991199
1200      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1200      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12011201      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7f00 + 2));
12021202      amiga_chip_ram_w8(r_A2 + 0x1f, 0x00);
12031203   }
r5251r5252
12111211
12121212static void lsrquiz_input_hack(running_machine *machine)
12131213{
1214   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1214   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
12151215   {
12161216//      amiga_chip_ram_w8(0x001e1b, 0x00);
12171217
1218      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1218      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12191219      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fe0 + 2));
12201220      amiga_chip_ram_w8(r_A2 + 0x13, 0x00);
12211221   }
r5251r5252
12301230/* The hack isn't working if you exit the test mode with P1 button 2 ! */
12311231static void lsrquiz2_input_hack(running_machine *machine)
12321232{
1233   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1233   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
12341234   {
12351235//      amiga_chip_ram_w8(0x046107, 0x00);
12361236
1237      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1237      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12381238      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fdc + 2));
12391239      amiga_chip_ram_w8(r_A2 + 0x17, 0x00);
12401240   }
r5251r5252
12481248
12491249static void lasstixx_input_hack(running_machine *machine)
12501250{
1251   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1251   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
12521252   {
12531253//      amiga_chip_ram_w8(0x00281c, 0x00);
12541254
1255      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1255      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12561256      UINT32 r_A2 = (amiga_chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (amiga_chip_ram_r(r_A5 - 0x7fa2 + 2));
12571257      amiga_chip_ram_w8(r_A2 + 0x24, 0x00);
12581258   }
r5251r5252
12661266
12671267static void mgnumber_input_hack(running_machine *machine)
12681268{
1269   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1269   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
12701270   {
12711271//      amiga_chip_ram_w(0x04bfa0, 0x0000);
12721272
1273      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1273      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12741274      amiga_chip_ram_w(r_A5 - 0x7ed8, 0x0000);
12751275   }
12761276}
r5251r5252
12831283
12841284static void mgprem11_input_hack(running_machine *machine)
12851285{
1286   if(cpu_get_pc(machine->cpu[0]) < amiga_chip_ram_size)
1286   if(cpu_get_pc(cputag_get_cpu(machine,"maincpu")) < amiga_chip_ram_size)
12871287   {
12881288//      amiga_chip_ram_w8(0x044f7e, 0x00);
12891289
1290      UINT32 r_A5 = cpu_get_reg(machine->cpu[0], M68K_A5);
1290      UINT32 r_A5 = cpu_get_reg(cputag_get_cpu(machine,"maincpu"), M68K_A5);
12911291      amiga_chip_ram_w8(r_A5 - 0x7eca, 0x00);
12921292   }
12931293}
src/mame/drivers/ojankohs.c
r5251r5252
117117
118118   /* generate an NMI if we're out of data */
119119   if (!ojankohs_vclk_left)
120      cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
120      cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
121121}
122122
123123static WRITE8_HANDLER( ojankoc_ctrl_w )
src/mame/drivers/deco_ld.c
r0r5252
1/***************************************************************************
2
3Bega's Battle (c) 1983 Data East Corporation
4
5preliminary driver by Angelo Salese
6
7TODO:
8- laserdisc hook-ups;
9- video emulation is bare bones;
10- i/os
11
12***************************************************************************/
13
14#include "driver.h"
15#include "cpu/m6502/m6502.h"
16#include "sound/ay8910.h"
17#include "machine/laserdsc.h"
18
19static UINT8 vram_bank;
20static const device_config *laserdisc;
21static UINT8 laserdisc_data;
22
23static VIDEO_UPDATE( rblaster )
24{
25   const gfx_element *gfx = screen->machine->gfx[0];
26   int count = 0x0000;
27
28   int y,x;
29
30   for (y=0;y<32;y++)
31   {
32      for (x=0;x<32;x++)
33      {
34         int tile = videoram[count];
35         int colour = (vram_bank & 0x7);
36         drawgfx_opaque(bitmap,cliprect,gfx,tile,colour,0,0,x*8,y*8);
37
38         count++;
39      }
40   }
41
42   return 0;
43}
44
45#if 0
46static WRITE8_HANDLER( rblaster_sound_w )
47{
48    soundlatch_w(space,0,data);
49    cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE);
50}
51#endif
52
53static WRITE8_HANDLER( rblaster_vram_bank_w )
54{
55   vram_bank = data;
56}
57
58static READ8_HANDLER( laserdisc_r )
59{
60   UINT8 result = laserdisc_data_r(laserdisc);
61   mame_printf_debug("laserdisc_r = %02X\n", result);
62   return result;
63}
64
65
66static WRITE8_HANDLER( laserdisc_w )
67{
68   laserdisc_data = data;
69}
70
71static READ8_HANDLER( test_r )
72{
73   return mame_rand(space->machine);
74}
75
76static ADDRESS_MAP_START( cobra_map, ADDRESS_SPACE_PROGRAM, 8 )
77   AM_RANGE(0x0000, 0x0fff) AM_RAM
78   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN1")
79   AM_RANGE(0x1001, 0x1001) AM_READ(test_r)//_PORT("IN2")
80   AM_RANGE(0x1002, 0x1002) AM_READ(test_r)//_PORT("IN3")
81   AM_RANGE(0x1003, 0x1003) AM_READ(test_r)//AM_READ_PORT("IN0")
82//  AM_RANGE(0x1004, 0x1004) AM_READ(test_r)//_PORT("IN4")
83//  AM_RANGE(0x1005, 0x1005) AM_READ(test_r)//_PORT("IN5")
84   AM_RANGE(0x1004, 0x1004) AM_WRITE(rblaster_vram_bank_w) //might be 1001
85   AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
86   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
87   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram)
88   AM_RANGE(0x2000, 0x2fff) AM_RAM
89   AM_RANGE(0x3000, 0x37ff) AM_RAM //vram attr?
90   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE(&videoram)
91   AM_RANGE(0x4000, 0xffff) AM_ROM
92ADDRESS_MAP_END
93
94
95static ADDRESS_MAP_START( rblaster_map, ADDRESS_SPACE_PROGRAM, 8 )
96   AM_RANGE(0x0000, 0x0fff) AM_RAM
97//  AM_RANGE(0x1000, 0x1007) AM_NOP
98   AM_RANGE(0x1001, 0x1001) AM_WRITENOP //???
99   AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN0")
100   AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
101   AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
102   AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
103   AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE(&paletteram)
104   AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE(&videoram)
105   AM_RANGE(0x3000, 0x3fff) AM_RAM
106   AM_RANGE(0xc000, 0xffff) AM_ROM
107ADDRESS_MAP_END
108
109/* sound arrangement is pratically identical to Zero Target. */
110static int nmimask;
111
112//static WRITE8_HANDLER( nmimask_w ) { nmimask = data & 0x80; }
113
114static INTERRUPT_GEN ( sound_interrupt ) { if (!nmimask) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); }
115
116
117static ADDRESS_MAP_START( rblaster_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
118   AM_RANGE(0x0000, 0x01ff) AM_RAM
119   AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_data_w)
120   AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_address_w)
121   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_data_w)
122   AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_address_w)
123   AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
124   AM_RANGE(0xe000, 0xffff) AM_ROM
125ADDRESS_MAP_END
126
127static INPUT_PORTS_START( cobra )
128   PORT_START("IN0")
129   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
130   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
131   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
132   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
133   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
135   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
136   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
137   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
138   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
139   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
140   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
141   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
143   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
144   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
145   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
146   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
147   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
148   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
149   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
150   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
151
152   PORT_START("IN1")
153   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
154   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
155   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
156   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
157   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
158   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
159   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
160   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
161   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
162   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
163   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
164   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
165   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
166   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
168   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
169   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
170   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
171   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
172   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
173   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
174   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
175   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
176   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
177
178   PORT_START("IN2")
179   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
180   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
181   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
182   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
183   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
184   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
185   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
186   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
187   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
188   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
189   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
190   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
191   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
192   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
194   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
195   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
197   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
198   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
199   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
200   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
201   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
203
204   PORT_START("IN3")
205   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
206   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
207   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
208   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
209   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
210   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
211   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
212   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
213   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
214   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
215   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
216   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
217   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
218   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
219   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
220   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
222   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
223   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
226   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
229
230   PORT_START("IN4")
231   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
232   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
233   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
234   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
235   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
236   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
237   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
238   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
239   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
240   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
242   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
243   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
245   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
246   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
249   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
252   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
255
256   PORT_START("IN5")
257   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
258   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
259   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
260   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
261   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
262   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
263   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
264   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
265   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
266   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
267   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
268   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
269   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
270   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
271   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
272   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
273   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
274   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
275   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
277   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
278   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
280   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
281INPUT_PORTS_END
282
283static INPUT_PORTS_START( rblaster )
284   PORT_START("IN0")
285   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
286   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
287   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
288   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
289   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
290   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
291   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
292   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
293   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
294   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
295   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
296   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
297   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
299   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
300   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
301   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
302   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
303   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
305   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
306   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
307
308   PORT_START("IN1")
309   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
310   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
311   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
312   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
313   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
314   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
315   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
316   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
317   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
318   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
319   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
320   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
321   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
323   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
324   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
325   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
326   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
327   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
330   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
332   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
333
334   PORT_START("IN2")
335   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
336   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
337   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
338   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
339   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
340   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
341   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
342   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
343   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
344   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
345   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
346   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
347   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
348   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
349   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
350   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
351   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
352   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
353   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
355   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
356   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
357   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
358   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
359INPUT_PORTS_END
360
361static const gfx_layout charlayout =
362{
363   8,8,
364   RGN_FRAC(1,3),
365   3,
366   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) },
367   { 7, 6, 5, 4, 3, 2, 1, 0 },
368   { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
369   8*8
370};
371
372static GFXDECODE_START( rblaster )
373   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 8 )
374GFXDECODE_END
375
376static MACHINE_START( rblaster )
377{
378   laserdisc = devtag_get_device(machine, "laserdisc");
379}
380
381static MACHINE_DRIVER_START( rblaster )
382
383   /* basic machine hardware */
384   MDRV_CPU_ADD("maincpu",M6502,8000000/2)
385   MDRV_CPU_PROGRAM_MAP(rblaster_map)
386//  MDRV_CPU_VBLANK_INT("screen",irq0_line_hold)
387   MDRV_CPU_VBLANK_INT("screen",nmi_line_pulse)
388
389   MDRV_CPU_ADD("audiocpu",M6502,8000000/2)
390   MDRV_CPU_PROGRAM_MAP(rblaster_sound_map)
391//  MDRV_CPU_VBLANK_INT("screen",irq0_line_hold) //test
392   MDRV_CPU_PERIODIC_INT(sound_interrupt, 640)
393
394   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "screen", "ldsound") //Sony LDP-1000A, is it truly compatible with the Pioneer?
395   MDRV_LASERDISC_OVERLAY(rblaster, 256, 256, BITMAP_FORMAT_INDEXED16)
396
397   /* video hardware */
398   MDRV_LASERDISC_SCREEN_ADD_NTSC("screen", BITMAP_FORMAT_INDEXED16)
399   MDRV_GFXDECODE(rblaster)
400   MDRV_PALETTE_LENGTH(512)
401   MDRV_MACHINE_START(rblaster)
402
403   /* sound hardware */
404   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
405   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
406   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
407
408   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
409   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
410
411   MDRV_SOUND_ADD("ldsound", LASERDISC, 0)
412   MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
413   MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
414MACHINE_DRIVER_END
415
416static MACHINE_DRIVER_START( cobra )
417   MDRV_IMPORT_FROM( rblaster )
418   MDRV_CPU_MODIFY("maincpu")
419   MDRV_CPU_PROGRAM_MAP(cobra_map)
420
421   MDRV_DEVICE_REMOVE("audiocpu")
422MACHINE_DRIVER_END
423
424/***************************************************************************
425
426  Game driver(s)
427
428***************************************************************************/
429
430ROM_START( rblaster )
431   ROM_REGION( 0x10000, "maincpu", 0 )
432   ROM_LOAD( "01.bin",   0xc000, 0x2000, CRC(e4733c49) SHA1(357f46a80273f8a365d16cddf5e2caaeeacaf4ad) )
433   ROM_LOAD( "00.bin",   0xe000, 0x2000, CRC(084d6ae2) SHA1(f49eb2d53bad5af88a12535ba628c9decce690ff) )
434
435   ROM_REGION( 0x10000, "audiocpu", 0 )
436   ROM_LOAD( "02.bin",   0xe000, 0x2000, CRC(6c20335d) SHA1(b28e80f112553af8e3fba9ebbfc10d1f56396ac1) )
437
438   ROM_REGION( 0xc000, "gfx1", 0 )
439   ROM_LOAD( "03.bin",   0x0000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) )
440   ROM_LOAD( "06.bin",   0x2000, 0x2000, CRC(d1ff5ffb) SHA1(29df207e225e3b0477d5566d256198310d6ae526) )
441   ROM_LOAD( "04.bin",   0x4000, 0x2000, CRC(da2c84d9) SHA1(3452b0e2a45fa771e226c3a3668afbf3ceb0ec11) )
442   ROM_LOAD( "07.bin",   0x6000, 0x2000, CRC(da2c84d9) SHA1(3452b0e2a45fa771e226c3a3668afbf3ceb0ec11) )
443   ROM_LOAD( "05.bin",   0x8000, 0x2000, CRC(4608b516) SHA1(44af4be84a0b807ea0813ce86376a4b6fd927e5a) )
444   ROM_LOAD( "08.bin",   0xa000, 0x2000, CRC(4608b516) SHA1(44af4be84a0b807ea0813ce86376a4b6fd927e5a) )
445
446   DISK_REGION( "laserdisc" )
447   DISK_IMAGE_READONLY( "rblaster", 0, NO_DUMP )
448ROM_END
449
450ROM_START( cobra )
451   ROM_REGION( 0x10000, "maincpu", 0 )
452   ROM_LOAD( "au03-2",   0x8000, 0x2000, CRC(8f0a8fba) SHA1(8e11d2bd665a5ca6b3bb11aa2b707458c1534327) )
453   ROM_LOAD( "au02-2",   0xa000, 0x2000, CRC(7db11acf) SHA1(1eebae0741f5735bc8966f3c31a9c07dac2e3916) )
454   ROM_LOAD( "au01-2",   0xc000, 0x2000, CRC(523dd8f6) SHA1(47bd4c9b2272e9a710e6e97f2505075df68101ed) )
455   ROM_LOAD( "au00-2",   0xe000, 0x2000, CRC(6c0f1f16) SHA1(ed05d3eaa24e84b1dfb4e1eb5f69b23e4a1494ba) )
456   ROM_COPY( "maincpu",  0x8000, 0x4000, 0x4000 )
457
458   ROM_REGION( 0xc000, "gfx1", 0 )
459   ROM_LOAD( "au0a",   0x0000, 0x2000, CRC(6aaedcf3) SHA1(52dc913eecf8a159784d500217cffd7a6d8eb45c) )
460   ROM_LOAD( "au0b",   0x4000, 0x2000, CRC(92247877) SHA1(f9bb0c20212ab13caabfb5beb9b6afc807bc9555) )
461   ROM_LOAD( "au0c",   0x8000, 0x2000, CRC(d00a2762) SHA1(84d4329b39b9fd30682b7efa5cb2744934c5ee5c) )
462
463   ROM_LOAD( "au07",   0x2000, 0x2000, CRC(d4bf12a5) SHA1(e172f69ae02ac2670b70af0cfcf3887dd99c2761) )
464   ROM_LOAD( "au08",   0x6000, 0x2000, CRC(63158274) SHA1(c728e8ba0a11ea67cf508877ad74a3aab9ef26fc) )
465   ROM_LOAD( "au09",   0xa000, 0x2000, CRC(74e93394) SHA1(7a1470cf2008b1bef8d950939b758707297b3655) )
466
467   DISK_REGION( "laserdisc" )
468   DISK_IMAGE_READONLY( "cobra", 0, SHA1(8390498294aca97a5d1769032e7b115d1a42f5d3) )
469ROM_END
470
471// Bega's Battle
472GAME( 1984, cobra,  0,       cobra,  cobra,  0, ROT0, "Data East", "Cobra Command (Data East LD)", GAME_NOT_WORKING )
473// Thunder Storm (Cobra Command Japanese version)
474GAME( 1985, rblaster,  0,    rblaster,  rblaster,  0, ROT0, "Data East", "Road Blaster (Data East LD)", GAME_NOT_WORKING )
src/mame/drivers/sg1000a.c
r5251r5252
115115#include "cpu/z80/z80.h"
116116#include "sound/sn76496.h"
117117#include "video/tms9928a.h"
118#include "machine/8255ppi.h"
118#include "machine/i8255a.h"
119119#include "machine/segacrpt.h"
120120
121121/*************************************
r5251r5252
135135   AM_RANGE(0x7f, 0x7f) AM_DEVWRITE("sn", sn76496_w)
136136   AM_RANGE(0xbe, 0xbe) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
137137   AM_RANGE(0xbf, 0xbf) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
138   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255", ppi8255_r, ppi8255_w)
138   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w)
139139ADDRESS_MAP_END
140140
141141/*************************************
r5251r5252
247247   coin_counter_w(0, data & 0x01);
248248}
249249
250static const ppi8255_interface ppi8255_intf =
250static I8255A_INTERFACE( ppi8255_intf )
251251{
252252   DEVCB_INPUT_PORT("P1"),
253253   DEVCB_INPUT_PORT("P2"),
r5251r5252
270270   MDRV_CPU_IO_MAP(io_map)
271271   MDRV_CPU_VBLANK_INT("screen", sg1000a_interrupt)
272272
273   MDRV_PPI8255_ADD( "ppi8255", ppi8255_intf )
273   MDRV_I8255A_ADD( "ppi8255", ppi8255_intf )
274274
275275   /* video hardware */
276276   MDRV_IMPORT_FROM(tms9928a)
src/mame/drivers/blockout.c
r5251r5252
5858   AM_RANGE(0x180000, 0x1bffff) AM_RAM_WRITE(blockout_videoram_w) AM_BASE(&blockout_videoram)
5959   AM_RANGE(0x1d4000, 0x1dffff) AM_RAM   /* work RAM */
6060   AM_RANGE(0x1f4000, 0x1fffff) AM_RAM   /* work RAM */
61   AM_RANGE(0x200000, 0x207fff) AM_WRITEONLY AM_BASE(&blockout_frontvideoram)
61   AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&blockout_frontvideoram)
6262   AM_RANGE(0x208000, 0x21ffff) AM_RAM   /* ??? */
6363   AM_RANGE(0x280002, 0x280003) AM_WRITE(blockout_frontcolor_w)
6464   AM_RANGE(0x280200, 0x2805ff) AM_RAM_WRITE(blockout_paletteram_w) AM_BASE(&paletteram16)
src/mame/drivers/namcos2.c
r5251r5252
48854885GAME( 1990, kyukaido, kyukaidk, default,  kyukaidk, kyukaidk, ROT0,   "Namco", "Kyuukai Douchuuki (Japan old version)", 0 )
48864886GAME( 1990, dsaber,   0,        default3, default,  dsaber,   ROT90,  "Namco", "Dragon Saber", 0 )
48874887GAME( 1990, dsaberj,  dsaber,   default3, default,  dsaberj,  ROT90,  "Namco", "Dragon Saber (Japan)", 0 )
4888GAMEL(1990, finalap2, 0,        finallap, finallap, finalap2, ROT0,   "Namco", "Final Lap 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4889GAMEL(1990, finalp2j, finalap2, finallap, finallap, finalap2, ROT0,   "Namco", "Final Lap 2 (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4888GAMEL(1990, finalap2, 0,        finallap, finallap, finalap2, ROT0,   "Namco", "Final Lap 2", GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4889GAMEL(1990, finalp2j, finalap2, finallap, finallap, finalap2, ROT0,   "Namco", "Final Lap 2 (Japan)", GAME_IMPERFECT_GRAPHICS, layout_finallap  )
48904890GAME( 1990, gollygho, 0,        gollygho, gollygho, gollygho, ROT180, "Namco", "Golly! Ghost!", 0 )
48914891GAME( 1990, rthun2,   0,        default3, default,  rthun2,   ROT0,   "Namco", "Rolling Thunder 2", 0 )
48924892GAME( 1990, rthun2j,  rthun2,   default3, default,  rthun2j,  ROT0,   "Namco", "Rolling Thunder 2 (Japan)", 0 )
r5251r5252
48974897GAME( 1991, cosmogng, 0,        default,  default,  cosmogng, ROT90,  "Namco", "Cosmo Gang the Video (US)", 0 )
48984898GAME( 1991, cosmognj, cosmogng, default,  default,  cosmogng, ROT90,  "Namco", "Cosmo Gang the Video (Japan)", 0 )
48994899GAME( 1992, bubbletr, 0,        gollygho, bubbletr, bubbletr, ROT180, "Namco", "Bubble Trouble (Japan)",GAME_NOT_WORKING )
4900GAMEL(1992, finalap3, 0,        finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (World)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4901GAMEL(1992, finalp3j, finalap3, finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4900GAMEL(1992, finalap3, 0,        finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (World)", GAME_IMPERFECT_GRAPHICS, layout_finallap  )
4901GAMEL(1992, finalp3j, finalap3, finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (Japan)", GAME_IMPERFECT_GRAPHICS, layout_finallap  )
49024902GAME( 1992, luckywld, 0,        luckywld, luckywld, luckywld, ROT0,   "Namco", "Lucky & Wild", 0 )
49034903GAME( 1992, lckywldj, luckywld, luckywld, luckywld, luckywld, ROT0,   "Namco", "Lucky & Wild (Japan)", 0 )
49044904GAME( 1992, suzuka8h, 0,        luckywld, suzuka,   suzuka8h, ROT0,   "Namco", "Suzuka 8 Hours (World)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/ksys573.c
r5251r5252
2929  Konami, 1998-2001
3030
3131  This system uses Konami PSX-based hardware with an ATAPI CDROM drive.
32  There is a slot for a security cart (cart is installed in CN14) and also a PCMCIA card slot,
33  which is unused. The main board and CDROM drive are housed in a black metal box.
32  Gun Mania (and probably Gun Mania Zone Plus) has no CDROM drive.
33  There is a slot for a security cart (cart is installed in CN14) and also a PCMCIA card slot.
34  The main board and CDROM drive are housed in a black metal box. Gun Mania doesn't have that box.
3435  The games can be swapped by exchanging the CDROM disc and the security cart, whereby the main-board
3536  FlashROMs are re-programmed after a small wait. On subsequent power-ups, there is a check to test if the
3637  contents of the FlashROMs matches the CDROM, then the game boots up immediately.
3738
39  PCMCIA card slot is used by Dance Dance Revolution (2ndMIX link ver. and later),
40  GUITARFREAKS (2ndMIX link ver. and later), drummania (7thMIX and later), and Gun Mania.
41  DDR and GF: 32M flash card is used to store edit data (players can edit data by PlayStation
42  console, and send data to arcade machine via PS memory card).
43  DM and GF: network PCB unit (for e-AMUSEMENT) is connected via PCMCIA slot.
44  GM: unknown (program data is stored in flash card?)
45
3846  The games that run on this system include...
3947
4048  Game                                         Year       Hardware Code     CD Code
4149  ---------------------------------------------------------------------------------
42  *Anime Champ                                  2000.12
43  Bass Angler                                   1998.03    GE765 JA          765 JA A02
44  Bass Angler 2                                 1998.07    GC865 JA          865 JA A02
45  *DAM-DDR Dance Dance Revolution for DAM       1999.11
46  *DAM-DDR Dance Dance Revolution for DAM 2nd   2000.07
47  Dance Dance Revolution                        1998.09    GC845 JA          845 JA(missing)/UA A01 / 845 JA A02
48  Dance Dance Revolution Internet Ranking ver.  1998.11    GC845 JB          845 JB A01 / 845 JA/UA A02
49  Dance Dance Revolution 2ndMIX                 1999.01    GC895 JA          895 JA A02
50  Dance Dance Revolution 2ndMIX LINK version    1999.04    GE885 JA          885 JA A02
51  DDR 2ndMIX with bmIIDX CLUB ver.              1999.05    GN896 JA          896 JA A01
52  DDR 2ndMIX AND bmIIDX substream CLUB ver. 2   1999.05    GE984 JA          984 JA A01
53  Dance Dance Revolution Solo BASS MIX          1999.08    GQ894 JA          894 JA A02
54  Dance Dance Revolution 3rdMIX                 1999.10    GN887 AA/JA/KA    887 AA/JA/KA A02
55  Dance Dance Revolution Solo 2000              1999.12    GC905 AA/JA       905 AA/JA A02
56  Dance Dance Revolution 3rdMIX PLUS            2000.06    GCA22 JA          A22 JA A02
57  Dance Dance Revolution 4thMIX                 2000.08    GCA34 JA          A34 JA A02
58  *Dance Dance Revolution Kids                  2000.12
59  Dance Dance Revolution 5thMIX                 2001.03    GCA27 JA          A27 JA A02
60  DDRMAX Dance Dance Revolution 6thMIX          2001.10    GCB19 JA          B19 JA A02
61  DDRMAX2 Dance Dance Revolution 7thMIX         2002.03    GCB20 JA          B20 JA A02
62  Dance Dance Revolution EXTREME                2002.12    GCC36 JA          C36 JA A02
63  Dance Maniax                                  2000.06    GE874 JA          874 JA A(needs redump)
64  Dance Maniax 2ndMIX                           2000.12    GCA39 JA          A39 JA A02
65  *Dance Maniax 2ndMIX APPEND J PARADISE        2001.04
66  Dancing Stage                                 1999.08    GN845 EA          845 EA(needs redump)
67  Dancing Stage Euro Mix                        2000       GE936 EA          936 EA A(needs redump)
68  Dancing Stage Euro Mix 2                      2000       G*C23 EA          C23 EA A02
69  Dancing Stage featuring Disney's Rave         2000.11    GCA37 JA          A37 JA A02
70  Dancing Stage featuring DREAMS COME TRUE      1999.12    GC910 JA          910 JA/JC A02
71  Dancing Stage featuring TRUE KiSS DESTiNATiON 1999.07    G*884 JA          884 JA A02
72  Dark Horse Legend                             1998.03    GX706 JA          706 JA A02
73  drummania                                     1999.07    GQ881 JA          881 JA D01 / 881 JA A02(missing, audio CD)
74  drummania 2ndMIX                              2000.03    GE912 JA          912 JA B02
75  drummania 3rdMIX                              2000.09    GCA23 JA          A23 JA A02
76  drummania 4thMIX                              2001.03    GEA25 JA          A25 JA A02
77  drummania 5thMIX                              2001.09    GCB05 JA          B05 JA A02
78  drummania 6thMIX                              2002.02    GCB16 JA          B16 JA A02
79  drummania 7thMIX                              2002.08    GCC07 JA          C07 JA A02
80  drummania 7thMIX power-up ver.                2002.08    GEC07 JB          C07 JC A02
81  drummania 8thMIX                              2003.04    GCC38 JA          C38 JA A02
82  drummania 9thMIX                              2003.10    GCD09 JA          D09 JA A02
83  *drummania 10thMIX                            2004.04
84  *Fighting Mania                               2000
85  Fisherman's Bait                              1998.06    GE765 UA          765 UA B02
86  Fisherman's Bait 2                            1998       GC865 UA          865 UA B02
87  Fisherman's Bait Marlin Challenge             1999       GX889             889 AA/EA/JA/UA(needs redump)
88  GUITARFREAKS                                  1999.02    GQ886 EA/JA/UA    886 ** C02
89  GUITARFREAKS 2ndMIX                           1999.07    GQ883 JA          929 JB B02(needs redump)
90  *GUITARFREAKS 2ndMIX Link ver.                1999.09
91  GUITARFREAKS 3rdMIX                           2000.04    GE949 JA          949 JA C01 / 949 JA C02
92  GUITARFREAKS 4thMIX                           2000.08    GEA24 JA          A24 JA A02
93  GUITARFREAKS 5thMIX                           2001.03    GCA26 JA          A26 JA A02
94  GUITARFREAKS 6thMIX                           2001.09    GCB06 JA          B06 JA A02
95  GUITARFREAKS 7thMIX                           2002.02    GCB17 JA          B17 JA A02
96  GUITARFREAKS 8thMIX                           2002.08    GCC08 JA          C08 JA A02
97  GUITARFREAKS 8thMIX power-up ver.             2002.11    GEC08 JB          C08 JB A02
98  GUITARFREAKS 9thMIX                           2003.04    GCC39 JA          C39 JA A02
99  GUITARFREAKS 10thMIX                          2003.10    GCD10 JA          D10 JA A02
100  *GUITARFREAKS 11thMIX                         2004.04
101  *Gun Mania                                    2000.07
102  *Gun Mania Zone Plus                          2000.10
103  *Gachaga Champ                                1999.01
104  Hyper Bishi Bashi Champ                       1998.07    GC908 JA          908    A02
105  Jikkyou Powerful Pro Yakyuu EX                1998.04    GX802 JA          802 JA B02
106  *Jikkyou Powerful Pro Yakyuu EX 98            1998.08
107  *Kick & Kick                                  2001
108  Konami 80's Arcade Gallery                    1998.11    GC826 JA          826 JA A01
109  Konami 80's AC Special                        1998       GC826 UA          826 UA A01
110  *Mambo a GoGo                                 2001.06
111  Punchmania Hokuto no Ken                      2000.03                      918 JA B02
112  Punchmania Hokuto no Ken 2                    2000.12                      A09 JA A02
113  Salary Man Champ                              2001.02    GCA18 JA          A18 JA(needs redump)
114  *Step Champ                                   1999.12
50P *Anime Champ                                  2000.12
51P Bass Angler                                   1998.03    GE765 JA          765 JA A02
52P Bass Angler 2                                 1998.07    GC865 JA          865 JA A02
53P *DAM-DDR Dance Dance Revolution for DAM       1999.11
54P *DAM-DDR Dance Dance Revolution for DAM 2nd   2000.07
55A Dance Dance Revolution                        1998.09    GC845 JA          845 JA(missing)/UA A01 / 845 JA A02
56A Dance Dance Revolution Internet Ranking ver.  1998.11    GC845 JB          845 JB A01 / 845 JA/UA A02
57A Dance Dance Revolution 2ndMIX                 1999.01    GC895 JA          895 JA A02
58A Dance Dance Revolution 2ndMIX LINK version    1999.04    GE885 JA          885 JA A02
59A DDR 2ndMIX with bmIIDX CLUB ver.              1999.05    GN896 JA          896 JA A01
60A DDR 2ndMIX AND bmIIDX substream CLUB ver. 2   1999.05    GE984 JA          984 JA A01
61D Dance Dance Revolution Solo BASS MIX          1999.08    GQ894 JA          894 JA A02
62D Dance Dance Revolution 3rdMIX                 1999.10    GN887 AA/JA/KA    887 AA/JA/KA A02
63D Dance Dance Revolution Solo 2000              1999.12    GC905 AA/JA       905 AA/JA A02
64D Dance Dance Revolution 3rdMIX PLUS            2000.06    GCA22 JA          A22 JA A02
65D Dance Dance Revolution 4thMIX                 2000.08    GCA33 JA          A33 JA A02
66D Dance Dance Revolution 4thMIX PLUS            2000.12    GCA34 JA          A34 JA A02
67? *Dance Dance Revolution Kids                  2000.12
68D Dance Dance Revolution 5thMIX                 2001.03    GCA27 JA          A27 JA A02
69D DDRMAX Dance Dance Revolution 6thMIX          2001.10    GCB19 JA          B19 JA A02
70D DDRMAX2 Dance Dance Revolution 7thMIX         2002.03    GCB20 JA          B20 JA A02
71D Dance Dance Revolution EXTREME                2002.12    GCC36 JA          C36 JA A02
72D Dance Maniax                                  2000.06    GE874 JA          874 JA A(needs redump)
73D Dance Maniax 2ndMIX                           2000.12    GCA39 JA          A39 JA A02
74D *Dance Maniax 2ndMIX APPEND J PARADISE        2001.04
75A Dancing Stage                                 1999.08    GN845 EA          845 EA(needs redump)
76D Dancing Stage Euro Mix                        2000       GE936 EA          936 EA A(needs redump)
77D Dancing Stage Euro Mix 2                      2000       G*C23 EA          C23 EA A02
78D Dancing Stage featuring Disney's Rave         2000.11    GCA37 JA          A37 JA A02
79D Dancing Stage featuring DREAMS COME TRUE      1999.12    GC910 JA          910 JA/JC A02
80A Dancing Stage featuring TRUE KiSS DESTiNATiON 1999.07    G*884 JA          884 JA A02
81P Dark Horse Legend                             1998.03    GX706 JA          706 JA A02
82A drummania                                     1999.07    GQ881 JA          881 JA D01 / 881 JA A02(missing, audio CD)
83D drummania 2ndMIX                              2000.03    GE912 JA          912 JA B02
84D drummania 3rdMIX                              2000.09    GCA23 JA          A23 JA A02
85D drummania 4thMIX                              2001.03    GEA25 JA          A25 JA A02
86D drummania 5thMIX                              2001.09    GCB05 JA          B05 JA A02
87D drummania 6thMIX                              2002.02    GCB16 JA          B16 JA A02
88N drummania 7thMIX                              2002.08    GCC07 JA          C07 JA A02
89N drummania 7thMIX power-up ver.                2002.08    GEC07 JB          C07 JC A02
90N drummania 8thMIX                              2003.04    GCC38 JA          C38 JA A02
91N drummania 9thMIX                              2003.10    GCD09 JA          D09 JA A02
92N *drummania 10thMIX                            2004.04
93? *Fighting Mania                               2000
94P Fisherman's Bait                              1998.06    GE765 UA          765 UA B02
95P Fisherman's Bait 2                            1998       GC865 UA          865 UA B02
96P Fisherman's Bait Marlin Challenge             1999       GX889             889 AA/EA/JA/UA(needs redump)
97A GUITARFREAKS                                  1999.02    GQ886 EA/JA/UA    886 ** C02
98A GUITARFREAKS 2ndMIX                           1999.07    GQ883 JA          929 JB B02(needs redump)
99A *GUITARFREAKS 2ndMIX Link ver.                1999.09
100D GUITARFREAKS 3rdMIX                           2000.04    GE949 JA          949 JA C01 / 949 JA C02
101D GUITARFREAKS 4thMIX                           2000.08    GEA24 JA          A24 JA A02
102D GUITARFREAKS 5thMIX                           2001.03    GCA26 JA          A26 JA A02
103D GUITARFREAKS 6thMIX                           2001.09    GCB06 JA          B06 JA A02
104D GUITARFREAKS 7thMIX                           2002.02    GCB17 JA          B17 JA A02
105N GUITARFREAKS 8thMIX                           2002.08    GCC08 JA          C08 JA A02
106N GUITARFREAKS 8thMIX power-up ver.             2002.11    GEC08 JB          C08 JB A02
107N GUITARFREAKS 9thMIX                           2003.04    GCC39 JA          C39 JA A02
108N GUITARFREAKS 10thMIX                          2003.10    GCD10 JA          D10 JA A02
109N *GUITARFREAKS 11thMIX                         2004.04
110G *Gun Mania                                    2000.07    G?906 JA          (no CD)
111? *Gun Mania Zone Plus                          2000.10
112P *Gachaga Champ                                1999.01
113P Hyper Bishi Bashi Champ                       1998.07    GC908 JA          908    A02
114P Jikkyou Powerful Pro Yakyuu EX                1998.04    GX802 JA          802 JA B02
115P *Jikkyou Powerful Pro Yakyuu EX 98            1998.08
116? *Kick & Kick                                  2001
117P Konami 80's Arcade Gallery                    1998.11    GC826 JA          826 JA A01
118P Konami 80's AC Special                        1998       GC826 UA          826 UA A01
119D *Mambo a GoGo                                 2001.06
120D Punchmania Hokuto no Ken                      2000.03                      918 JA B02
121D Punchmania Hokuto no Ken 2                    2000.12                      A09 JA A02
122P Salary Man Champ                              2001.02    GCA18 JA          A18 JA(needs redump)
123P *Step Champ                                   1999.12
115124
125P: plain System573
126A: uses ext. analog I/O board
127D: uses ext. digital sound and I/O board
128N: uses network PCB unit + ext. digital sound and I/O board
129G: gun mania only, drives air soft gun (this game uses real BB bullet)
130
116131  Note:
117132       Not all games listed above are confirmed to run on System 573.
118133       * - denotes not dumped yet. If you can help with the remaining undumped System 573 games,
src/mame/drivers/overdriv.c
r5251r5252
163163   if (ACCESSING_BITS_0_7)
164164   {
165165      /* bit 0 probably enables the second 68000 */
166      cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
166      cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
167167
168168      /* bit 1 is clear during service mode - function unknown */
169169
r5251r5252
211211
212212static WRITE16_HANDLER( overdriv_cpuB_irq5_w )
213213{
214   cputag_set_input_line(space->machine, "audiocpu", 5, HOLD_LINE);
214   cputag_set_input_line(space->machine, "sub", 5, HOLD_LINE);
215215}
216216
217217static WRITE16_HANDLER( overdriv_cpuB_irq6_w )
218218{
219   cputag_set_input_line(space->machine, "audiocpu", 6, HOLD_LINE);
219   cputag_set_input_line(space->machine, "sub", 6, HOLD_LINE);
220220}
221221
222222
src/mame/drivers/taitogn.c
r5251r5252
403403         locked &= ~(1 << pos);
404404      else
405405         locked |= 1 << pos;
406      if (!locked) {
407         ide_set_gnet_readlock (devtag_get_device(space->machine, "card"), 0);
408      }
406409   }
407410}
408411
r5251r5252
552555{
553556   COMBINE_DATA(&control3);
554557
558   /* Not card reset */
559   #if 0
555560   // card reset, maybe
556561   if(control3 & 2) {
557562      devtag_reset(space->machine, "card");
558563      locked = 0x1ff;
559564   }
565   #endif
560566}
561567
562568static READ32_HANDLER(gn_1fb70000_r)
r5251r5252
824830   control = 0;
825831   psx_machine_init(machine);
826832   devtag_reset(machine, "card");
833   ide_set_gnet_readlock (devtag_get_device(machine, "card"), 1);
827834}
828835
829836static ADDRESS_MAP_START( zn_map, ADDRESS_SPACE_PROGRAM, 32 )
r5251r5252
10321039INPUT_PORTS_END
10331040
10341041
1035//    ROM_LOAD( "flashv2.u30",    0x000000, 0x200000, CRC(f624ebf8) SHA1(be84ef1b083f819f3ab13c983c52bca97bb908ef) )
1042//
10361043
1044#define ROM_LOAD16_WORD_BIOS(bios,name,offset,length,hash) \
1045      ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_BIOS(bios+1)) /* Note '+1' */
1046
10371047#define TAITOGNET_BIOS \
10381048   ROM_REGION32_LE( 0x080000, "mainbios", 0 ) \
10391049   ROM_LOAD( "coh-3002t.353", 0x000000, 0x080000, CRC(03967fa7) SHA1(0e17fec2286e4e25deb23d40e41ce0986f373d49) ) \
1040\
10411050   ROM_REGION16_LE( 0x200000, "subbios", 0 ) \
1042    ROM_LOAD( "flash.u30",     0x000000, 0x200000, CRC(c48c8236) SHA1(c6dad60266ce2ff635696bc0d91903c543273559) ) \
1051   ROM_SYSTEM_BIOS( 0, "v1",   "G-NET Bios v1" ) \
1052       ROM_LOAD16_WORD_BIOS(0, "flash.u30", 0x000000, 0x200000, CRC(c48c8236) SHA1(c6dad60266ce2ff635696bc0d91903c543273559) ) \
1053   ROM_SYSTEM_BIOS( 1, "v2",   "G-NET Bios v2" ) \
1054       ROM_LOAD16_WORD_BIOS(1, "flashv2.u30", 0x000000, 0x200000, CRC(CAE462D3) SHA1(f1b10846a8423d9fe021191c5876190857c3d2a4) ) \
10431055   ROM_REGION32_LE( 0x80000,  "soundcpu", 0) \
10441056   ROM_FILL( 0, 0x80000, 0xff) \
10451057   ROM_REGION32_LE( 0x600000, "samples", 0) \
r5251r5252
11841196   DISK_IMAGE( "zokuoten", 0, SHA1(5ce13db00518f96af64935176c71ec68d2a51938))
11851197ROM_END
11861198
1199ROM_START(otenamhf)
1200   TAITOGNET_BIOS
1201   ROM_DEFAULT_BIOS( "v2" )
11871202
1203   DISK_REGION( "card" )
1204   DISK_IMAGE( "otenamhf", 0, SHA1(5b15c33bf401e5546d78e905f538513d6ffcf562))
1205ROM_END
11881206
11891207
11901208
1209
11911210/* Takumi */
11921211
11931212ROM_START(nightrai)
r5251r5252
12561275GAME( 2003, kollon,   taitogn,  coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Kollon (V2.04J)", 0 )
12571276
12581277GAME( 1999, otenamih, taitogn, coh3002t, coh3002t, coh3002t, ROT0,   "Success", "Otenami Haiken (V2.04J)", 0 )
1278GAME( 2005, otenamhf, taitogn, coh3002t, coh3002t, coh3002t, ROT0,   "Success/Warashi", "Otenami Haiken Final (V2.07JC)", 0 )
12591279GAME( 2000, psyvaria, taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Success", "Psyvariar -Medium Unit- (V2.04J)", 0 )
12601280GAME( 2000, psyvarrv, taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Success", "Psyvariar -Revision- (V2.04J)", 0 )
12611281GAME( 2000, zokuoten, taitogn, coh3002t, coh3002t, coh3002t, ROT0,   "Success", "Zoku Otenamihaiken (V2.03J)", 0 )
src/mame/drivers/darkhors.c
r5251r5252
595595   GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0, 0x10000/64 )   // color codes should be doubled
596596GFXDECODE_END
597597
598// wrong
599static const gfx_layout layout_16x16x8_jclub2 =
600{
601   16,16,
602   RGN_FRAC(1,1),
603   8,
604   { 0,1,2,3,4,5,6,7 },
605   { 0,8,16,24,32,40,48,56,64,72,80,88,96, 104, 112, 120},
606   { 0*128,1*128,2*128,3*128,4*128,5*128,6*128,7*128,8*128,9*128,10*128,11*128,12*128,13*128,14*128,15*128 },
607   16*128
608};
609
610static GFXDECODE_START( jclub2 )
611   GFXDECODE_ENTRY( "maincpu", 0, layout_16x16x8_jclub2, 0, 0x10000/64 )   // color codes should be doubled
612GFXDECODE_END
613
614
598615/***************************************************************************
599616
600617
r5251r5252
667684   MDRV_SCREEN_SIZE(0x190, 0x100)
668685   MDRV_SCREEN_VISIBLE_AREA(0, 0x190-1, 8, 0x100-8-1)
669686
670   MDRV_GFXDECODE(darkhors)
687   MDRV_GFXDECODE(jclub2)
671688   MDRV_PALETTE_LENGTH(0x10000)
672689
673690   MDRV_VIDEO_START(jclub2)
r5251r5252
719736   MDRV_SCREEN_SIZE(0x190, 0x100)
720737   MDRV_SCREEN_VISIBLE_AREA(0, 0x190-1, 8, 0x100-8-1)
721738
722   MDRV_GFXDECODE(darkhors)
739   MDRV_GFXDECODE(jclub2)
723740   MDRV_PALETTE_LENGTH(0x10000)
724741
725742   MDRV_VIDEO_START(jclub2)
r5251r5252
766783ROM_END
767784
768785/*
769These Jockey Club II sets make no sense, they just seem to consist of multiple program revisions, no graphics, no sound
770786
787Jockey Club II Original sets
788
789 -- unlike the bootleg these appear to have the graphics compressed in the main program roms.  (CPS3 / SRMP6 -like)  (I think CPS3 is a SETA design)
790 -- the older hardware uses an st-0016 for sound (see st0016.c)
791 -- the program can be upgraded by placing a ROM in the socket next to the main program ROM.
792
793 */
794
795
796
797 /*
771798Jockey Club II by SETA 1996
772799
773800PCB E79-001 rev 01a (Newer)
r5251r5252
799826Provided to you by Belgium Dump Team Gerald (COY) on 18/01/2007.
800827*/
801828
829
830// ToDo: check for other similarities with CPS3 hardware, there are more than a few things which look the same.
831
802832// this contains mutliple sets, although splitting them as listed above makes no sense.. especially not the 'subcpu' roms
803833ROM_START( jclub2 )
804   ROM_REGION( 0x200000, "maincpu", 0 )   // 68EC020 code
834   ROM_REGION( 0x200000, "maincpu", 0 )   // 68EC020 code  + compressed GFX
805835   // main program (similar to main program of bootleg
806836   ROM_LOAD16_WORD_SWAP( "m88-01b.u38",0x00000, 0x200000, CRC(f1054c69) SHA1(be6d92653f0d3cc0a36a2ff0798043f4a95439bc) )
807837   ROM_LOAD16_WORD_SWAP( "m88-01a.u38",0x00000, 0x200000, CRC(c1243e1c) SHA1(2a5857738b8950daf77ddaa8304b765f809f8241) ) // alt revision?
808838   ROM_LOAD16_WORD_SWAP( "m88-01.u38", 0x00000, 0x200000, CRC(84476b68) SHA1(1014d23d3cebbfa9aa3bfb90505529989a8eedfa) ) // alt revision?
809839
810   ROM_REGION( 0x200000, "subcpu", 0 )   // 68EC020 code
811   // what are these? they're valid 68020 / 68000 code, but too small to be main program roms??  sound program??
840   ROM_REGION( 0x200000, "patch", 0 )   // 68EC020 code
841   // it appears that the operator could place a ROM in the socket next to the main CPU rom to update the main program rom by
842   // overriding the initial 0x80000 bytes of the program rom.
812843   ROM_LOAD16_WORD_SWAP( "m88-03d.u39",0x00000, 0x080000, CRC(723dd22b) SHA1(0ca622e0dd315f29e72dd9b82fb419d306ec5df8) )
813844   ROM_LOAD16_WORD_SWAP( "z201x.u39",0x00000, 0x080000, CRC(1fb79c16) SHA1(c8914f7dfc17c412f6ca756f8eb6d6a35e3b6214) )
814845
815   ROM_REGION( 0x400000, "gfx1", ROMREGION_ERASEFF )
816   ROM_LOAD( "gfx", 0x00000, 0x400000, NO_DUMP )
817
818846   ROM_REGION( 0x100000, "oki", 0 )   // Samples? (not oki probably one of the ST-xx customs, no idea if the dump is good)
819847   // data distribution would indicate this is a sound rom
820848   ROM_LOAD( "m88-02.u6", 0x00000, 0x100000, CRC(0dd3436a) SHA1(809d3b7a26d36f71da04036fd8ab5d0c5089392a) )
r5251r5252
858886
859887// this contains mutliple sets
860888ROM_START( jclub2o )
861   ROM_REGION( 0x200000, "maincpu", 0 )   // 68EC020 code
862   // main program (similar to main program of bootleg
889   ROM_REGION( 0x200000, "maincpu", 0 )   // 68EC020 code + compressed gfx
863890   ROM_LOAD16_WORD_SWAP( "sx006a-01.106",0x00000, 0x200000, CRC(55e249bc) SHA1(ed0f066ed17f047760b712cbbfba1a62d4b452ba) )
864891   ROM_LOAD16_WORD_SWAP( "sx006b-01.u26",0x00000, 0x200000, CRC(f730dded) SHA1(efb966dcb98440a072d4825ef2788c85acdfd103) )  // alt revision?
865892
866   ROM_REGION( 0x200000, "subcpu", 0 )   // 68EC020 code
867   // what are these? they're valid 68020 / 68000 code, but too small to be main program roms??  sound program?? overlay patch??
893   ROM_REGION( 0x200000, "patch", 0 )   // 68EC020 code
894   // it appears that the operator could place a ROM in the socket next to the main CPU rom to update the main program rom by
895   // overriding the initial 0x80000 bytes of the program rom.
868896   ROM_LOAD16_WORD_SWAP( "jc2-110x.u27",0x00000, 0x080000, CRC(03aa6882) SHA1(e0343bc77a19994ddafa614891663b40e1476332) )
869897   ROM_LOAD16_WORD_SWAP( "jc2-112x.u27",0x00000, 0x080000, CRC(e1ab93bd) SHA1(78b618b3f7819bd5351ebf949f328fec7795cec9) ) // alt revision?
870898
871   ROM_REGION( 0x400000, "gfx1", ROMREGION_ERASEFF )
872   ROM_LOAD( "gfx", 0x00000, 0x400000, NO_DUMP )
873
874899   ROM_REGION( 0x90000, "st0016", 0 ) // z80 core (used for sound?)
875900   ROM_LOAD( "sx006-04.u87", 0x10000, 0x80000, CRC(a87adedd) SHA1(1cd5af2d03738fff2230b46241659179467c828c) )
876901   ROM_COPY( "st0016",  0x10000, 0x00000, 0x08000 )
src/mame/drivers/stfight.c
r5251r5252
339339   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
340340
341341   PORT_START("COIN")   /* COIN MECH */
342   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
343   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
342   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
343   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
344344INPUT_PORTS_END
345345
346346
src/tools/tools.mak
r5251r5252
3131   regrep$(EXE) \
3232   srcclean$(EXE) \
3333   src2html$(EXE) \
34   split$(EXE) \
3435
3536
3637
r5251r5252
136137src2html$(EXE): $(SRC2HTMLOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT)
137138   @echo Linking $@...
138139   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
140
141
142
143#-------------------------------------------------
144# split
145#-------------------------------------------------
146
147SPLITOBJS = \
148   $(TOOLSOBJ)/split.o \
149
150split$(EXE): $(SPLITOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT)
151   @echo Linking $@...
152   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
src/tools/split.c
r0r5252
1/***************************************************************************
2
3    split.c
4
5    Simple file splitter/joiner with hashes.
6
7    Copyright Aaron Giles. Released under the MAME license.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#include <stdio.h>
13#include <stdlib.h>
14#include <string.h>
15#include <ctype.h>
16#include "astring.h"
17#include "corefile.h"
18#include "sha1.h"
19
20#define DEFAULT_SPLIT_SIZE      100
21#define MAX_PARTS            1000
22
23
24
25/***************************************************************************
26    CORE IMPLEMENTATION
27***************************************************************************/
28
29
30/*-------------------------------------------------
31    compute_hash_as_string - compute an SHA1
32    hash over a buffer and return a string
33-------------------------------------------------*/
34
35static void compute_hash_as_string(astring *buffer, void *data, UINT32 length)
36{
37   char expanded[SHA1_DIGEST_SIZE * 2];
38   UINT8 sha1digest[SHA1_DIGEST_SIZE];
39   struct sha1_ctx sha1;
40   int ch;
41
42   // compute the SHA1
43   sha1_init(&sha1);
44   sha1_update(&sha1, length, data);
45   sha1_final(&sha1);
46   sha1_digest(&sha1, sizeof(sha1digest), sha1digest);
47
48   // expand the digest to a string
49   for (ch = 0; ch < SHA1_DIGEST_SIZE; ch++)
50   {
51      expanded[ch * 2 + 0] = "0123456789ABCDEF"[sha1digest[ch] >> 4];
52      expanded[ch * 2 + 1] = "0123456789ABCDEF"[sha1digest[ch] & 15];
53   }
54
55   // copy it to the buffer
56   astring_cpych(buffer, expanded, sizeof(expanded));
57}
58
59
60/*-------------------------------------------------
61    split_file - split a file into multiple parts
62-------------------------------------------------*/
63
64static int split_file(const char *filename, const char *basename, UINT32 splitsize)
65{
66   astring *outfilename = astring_alloc(), *basefilename = astring_alloc(), *splitfilename = astring_alloc();
67   core_file *outfile = NULL, *infile = NULL, *splitfile = NULL;
68   astring *computedhash = astring_alloc();
69   void *splitbuffer = NULL;
70   int index, partnum;
71   UINT64 totallength;
72   UINT32 totalparts;
73   file_error filerr;
74   int error = 1;
75
76   // convert split size to MB
77   if (splitsize > 500)
78   {
79      fprintf(stderr, "Fatal error: maximum split size is 500MB (even that is way huge!)\n");
80      goto cleanup;
81   }
82   splitsize *= 1024 * 1024;
83
84   // open the file for read
85   filerr = core_fopen(filename, OPEN_FLAG_READ, &infile);
86   if (filerr != FILERR_NONE)
87   {
88      fprintf(stderr, "Fatal error: unable to open file '%s'\n", filename);
89      goto cleanup;
90   }
91
92   // get the total length
93   totallength = core_fsize(infile);
94   if (totallength < splitsize)
95   {
96      fprintf(stderr, "Fatal error: file is smaller than the split size\n");
97      goto cleanup;
98   }
99   if ((UINT64)splitsize * MAX_PARTS < totallength)
100   {
101      fprintf(stderr, "Fatal error: too many splits (maximum is %d)\n", MAX_PARTS);
102      goto cleanup;
103   }
104   totalparts = totallength / splitsize;
105
106   // allocate a buffer for reading
107   splitbuffer = malloc(splitsize);
108   if (splitbuffer == NULL)
109   {
110      fprintf(stderr, "Fatal error: unable to allocate memory for the split\n");
111      goto cleanup;
112   }
113
114   // find the base name of the file
115   astring_cpyc(basefilename, basename);
116   index = astring_rchr(basefilename, 0, PATH_SEPARATOR[0]);
117   if (index != -1)
118      astring_del(basefilename, 0, index + 1);
119
120   // compute the split filename
121   astring_cpyc(splitfilename, basename);
122   astring_catc(splitfilename, ".split");
123
124   // create the split file
125   filerr = core_fopen(astring_c(splitfilename), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_NO_BOM, &splitfile);
126   if (filerr != FILERR_NONE)
127   {
128      fprintf(stderr, "Fatal error: unable to create split file '%s'\n", astring_c(splitfilename));
129      goto cleanup;
130   }
131
132   // write the basics out
133   core_fprintf(splitfile, "splitfile=%s\n", astring_c(basefilename));
134   core_fprintf(splitfile, "splitsize=%d\n", splitsize);
135
136   printf("Split file is '%s'\n", astring_c(splitfilename));
137   printf("Splitting file %s into chunks of %dMB...\n", astring_c(basefilename), splitsize / (1024 * 1024));
138
139   // now iterate until done
140   for (partnum = 0; partnum < 1000; partnum++)
141   {
142      UINT32 actual, length;
143
144      printf("Reading part %d...", partnum);
145
146      // read as much as we can from the file
147      length = core_fread(infile, splitbuffer, splitsize);
148      if (length == 0)
149         break;
150
151      // hash what we have
152      compute_hash_as_string(computedhash, splitbuffer, length);
153
154      // write that info to the split file
155      core_fprintf(splitfile, "hash=%s file=%s.%03d\n", astring_c(computedhash), astring_c(basefilename), partnum);
156
157      // compute the full filename for this guy
158      astring_printf(outfilename, "%s.%03d", basename, partnum);
159
160      // create it
161      filerr = core_fopen(astring_c(outfilename), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
162      if (filerr != FILERR_NONE)
163      {
164         printf("\n");
165         fprintf(stderr, "Fatal error: unable to create output file '%s'\n", astring_c(outfilename));
166         goto cleanup;
167      }
168
169      printf(" writing %s.%03d...", astring_c(basefilename), partnum);
170
171      // write the data
172      actual = core_fwrite(outfile, splitbuffer, length);
173      if (actual != length)
174      {
175         printf("\n");
176         fprintf(stderr, "Fatal error: Error writing output file (out of space?)\n");
177         goto cleanup;
178      }
179      core_fclose(outfile);
180      outfile = NULL;
181
182      printf(" done\n");
183
184      // stop if this is the end
185      if (length < splitsize)
186         break;
187   }
188   printf("File split successfully\n");
189
190   // if we get here, clear the errors
191   error = 0;
192
193cleanup:
194   if (splitfile != NULL)
195   {
196      core_fclose(splitfile);
197      if (error != 0)
198         remove(astring_c(splitfilename));
199   }
200   if (infile != NULL)
201      core_fclose(infile);
202   if (outfile != NULL)
203   {
204      core_fclose(outfile);
205      if (error != 0)
206         remove(astring_c(outfilename));
207   }
208   if (splitbuffer != NULL)
209      free(splitbuffer);
210   astring_free(splitfilename);
211   astring_free(basefilename);
212   astring_free(outfilename);
213   astring_free(computedhash);
214   return error;
215}
216
217
218/*-------------------------------------------------
219    join_file - rejoin a file from its split
220    parts
221-------------------------------------------------*/
222
223static int join_file(const char *filename, const char *outname, int write_output)
224{
225   astring *expectedhash = astring_alloc(), *computedhash = astring_alloc();
226   astring *outfilename = astring_alloc(), *infilename = astring_alloc();
227   astring *basepath = astring_alloc();
228   core_file *outfile = NULL, *infile = NULL, *splitfile = NULL;
229   void *splitbuffer = NULL;
230   file_error filerr;
231   UINT32 splitsize;
232   char buffer[256];
233   int error = 1;
234   int index;
235
236   // open the file for read
237   filerr = core_fopen(filename, OPEN_FLAG_READ, &splitfile);
238   if (filerr != FILERR_NONE)
239   {
240      fprintf(stderr, "Fatal error: unable to open file '%s'\n", filename);
241      goto cleanup;
242   }
243
244   // read the first line and verify this is a split file
245   if (!core_fgets(buffer, sizeof(buffer), splitfile) || strncmp(buffer, "splitfile=", 10) != 0)
246   {
247      fprintf(stderr, "Fatal error: corrupt or incomplete split file at line:\n%s\n", buffer);
248      goto cleanup;
249   }
250   astring_trimspace(astring_cpyc(outfilename, buffer + 10));
251
252   // compute the base path
253   astring_cpyc(basepath, filename);
254   index = astring_rchr(basepath, 0, PATH_SEPARATOR[0]);
255   if (index != -1)
256      astring_del(basepath, index + 1, -1);
257   else
258      astring_reset(basepath);
259
260   // override the output filename if specified, otherwise prepend the path
261   if (outname != NULL)
262      astring_cpyc(outfilename, outname);
263   else
264      astring_ins(outfilename, 0, basepath);
265
266   // read the split size
267   if (!core_fgets(buffer, sizeof(buffer), splitfile) || sscanf(buffer, "splitsize=%d", &splitsize) != 1)
268   {
269      fprintf(stderr, "Fatal error: corrupt or incomplete split file at line:\n%s\n", buffer);
270      goto cleanup;
271   }
272
273   // attempt to open the new file
274   if (write_output)
275   {
276      // don't overwrite the original!
277      filerr = core_fopen(astring_c(outfilename), OPEN_FLAG_READ, &outfile);
278      if (filerr == FILERR_NONE)
279      {
280         core_fclose(outfile);
281         outfile = NULL;
282         fprintf(stderr, "Fatal error: output file '%s' already exists\n", astring_c(outfilename));
283         goto cleanup;
284      }
285
286      // open the output for write
287      filerr = core_fopen(astring_c(outfilename), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, &outfile);
288      if (filerr != FILERR_NONE)
289      {
290         fprintf(stderr, "Fatal error: unable to create file '%s'\n", astring_c(outfilename));
291         goto cleanup;
292      }
293   }
294
295   printf("%s file '%s'...\n", write_output ? "Joining" : "Verifying", astring_c(outfilename));
296
297   // now iterate through each file
298   while (core_fgets(buffer, sizeof(buffer), splitfile))
299   {
300      UINT32 length, actual;
301
302      // make sure the hash and filename are in the right place
303      if (strncmp(buffer, "hash=", 5) != 0 || strncmp(buffer + 5 + SHA1_DIGEST_SIZE * 2, " file=", 6) != 0)
304      {
305         fprintf(stderr, "Fatal error: corrupt or incomplete split file at line:\n%s\n", buffer);
306         goto cleanup;
307      }
308      astring_cpych(expectedhash, buffer + 5, SHA1_DIGEST_SIZE * 2);
309      astring_trimspace(astring_cpyc(infilename, buffer + 5 + SHA1_DIGEST_SIZE * 2 + 6));
310
311      printf("  Reading file '%s'...", astring_c(infilename));
312
313      // read the file's contents
314      astring_ins(infilename, 0, basepath);
315      filerr = core_fload(astring_c(infilename), &splitbuffer, &length);
316      if (filerr != FILERR_NONE)
317      {
318         printf("\n");
319         fprintf(stderr, "Fatal error: unable to load file '%s'\n", astring_c(infilename));
320         goto cleanup;
321      }
322
323      // hash the contents
324      compute_hash_as_string(computedhash, splitbuffer, length);
325
326      // compare
327      if (astring_cmp(computedhash, expectedhash) != 0)
328      {
329         printf("\n");
330         fprintf(stderr, "Fatal error: file '%s' has incorrect hash\n  Expected: %s\n  Computed: %s\n", astring_c(infilename), astring_c(expectedhash), astring_c(computedhash));
331         goto cleanup;
332      }
333
334      // append to the file
335      if (write_output)
336      {
337         printf(" writing...");
338
339         actual = core_fwrite(outfile, splitbuffer, length);
340         if (actual != length)
341         {
342            printf("\n");
343            fprintf(stderr, "Fatal error: Error writing output file (out of space?)\n");
344            goto cleanup;
345         }
346
347         printf(" done\n");
348      }
349      else
350         printf(" verified\n");
351
352      // release allocated memory
353      free(splitbuffer);
354      splitbuffer = NULL;
355   }
356   if (write_output)
357      printf("File re-created successfully\n");
358   else
359      printf("File verified successfully\n");
360
361   // if we get here, clear the errors
362   error = 0;
363
364cleanup:
365   if (splitfile != NULL)
366      core_fclose(splitfile);
367   if (infile != NULL)
368      core_fclose(infile);
369   if (outfile != NULL)
370   {
371      core_fclose(outfile);
372      if (error != 0)
373         remove(astring_c(outfilename));
374   }
375   if (splitbuffer != NULL)
376      free(splitbuffer);
377   astring_free(outfilename);
378   astring_free(infilename);
379   astring_free(basepath);
380   astring_free(expectedhash);
381   astring_free(computedhash);
382   return error;
383}
384
385
386/*-------------------------------------------------
387    main - primary entry point
388-------------------------------------------------*/
389
390int main(int argc, char *argv[])
391{
392   int result;
393
394   /* skip if no command */
395   if (argc < 2)
396      goto usage;
397
398   /* split command */
399   if (stricmp(argv[1], "-split") == 0)
400   {
401      if (argc != 4 && argc != 5)
402         goto usage;
403      result = split_file(argv[2], argv[3], (argc < 5) ? DEFAULT_SPLIT_SIZE : atoi(argv[4]));
404   }
405
406   /* join command */
407   else if (stricmp(argv[1], "-join") == 0)
408   {
409      if (argc != 3 && argc != 4)
410         goto usage;
411      result = join_file(argv[2], (argc >= 4) ? argv[3] : NULL, TRUE);
412   }
413
414   /* verify command */
415   else if (stricmp(argv[1], "-verify") == 0)
416   {
417      if (argc != 3)
418         goto usage;
419      result = join_file(argv[2], NULL, FALSE);
420   }
421   else
422      goto usage;
423
424   return 0;
425
426usage:
427   fprintf(stderr,
428      "Usage:\n"
429      "  split -split <bigfile> <basename> [<size>] -- split file into parts\n"
430      "  split -join <splitfile> [<outputfile>] -- join file parts into original file\n"
431      "  split -verify <splitfile> -- verify a split file\n"
432      "\n"
433      "Where:\n"
434      "  <bigfile> is the large file you wish to split\n"
435      "  <basename> is the base path and name to assign to the split files\n"
436      "  <size> is the optional split size, in MB (100MB is the default)\n"
437      "  <splitfile> is the name of the <basename>.split generated with -split\n"
438      "  <outputfile> is the name of the file to output (defaults to original name)\n"
439   );
440   return 0;
441}
src/osd/winui/mui_opts.c
r5251r5252
13901390
13911391const char* GetCrosshairDir(void)
13921392{
1393   return options_get_string(global, OPTION_CRSSHAIRPATH);
1393   return options_get_string(global, OPTION_CROSSHAIRPATH);
13941394}
13951395
13961396void SetCrosshairDir(const char* paths)
13971397{
1398   options_set_string(global, OPTION_CRSSHAIRPATH, paths, OPTION_PRIORITY_CMDLINE);
1398   options_set_string(global, OPTION_CROSSHAIRPATH, paths, OPTION_PRIORITY_CMDLINE);
13991399}
14001400
14011401const char* GetFlyerDir(void)
src/emu/cpu/arm7/arm7core.c
r5251r5252
117117
118118/* Static Vars */
119119// Note: for multi-cpu implementation, this approach won't work w/o modification
120write32_space_func arm7_coproc_do_callback;    // holder for the co processor Data Operations Callback func.
121read32_space_func arm7_coproc_rt_r_callback;   // holder for the co processor Register Transfer Read Callback func.
122write32_space_func arm7_coproc_rt_w_callback;  // holder for the co processor Register Transfer Write Callback Callback func.
120write32_device_func arm7_coproc_do_callback;    // holder for the co processor Data Operations Callback func.
121read32_device_func arm7_coproc_rt_r_callback;   // holder for the co processor Register Transfer Read Callback func.
122write32_device_func arm7_coproc_rt_w_callback;  // holder for the co processor Register Transfer Write Callback Callback func.
123123// holder for the co processor Data Transfer Read & Write Callback funcs
124124void (*arm7_coproc_dt_r_callback)(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
125125void (*arm7_coproc_dt_w_callback)(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
r5251r5252
674674{
675675    // This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core
676676    if (arm7_coproc_do_callback)
677        arm7_coproc_do_callback(cpustate->program, insn, 0, 0);    // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
677        arm7_coproc_do_callback(cpustate->device, insn, 0, 0);    // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation
678678    else
679679        LOG(("%08x: Co-Processor Data Operation executed, but no callback defined!\n", R15));
680680}
r5251r5252
690690    {
691691        if (arm7_coproc_rt_r_callback)
692692        {
693            UINT32 res = arm7_coproc_rt_r_callback(cpustate->program, insn, 0);   // RT Read handler must parse opcode & return appropriate result
693            UINT32 res = arm7_coproc_rt_r_callback(cpustate->device, insn, 0);   // RT Read handler must parse opcode & return appropriate result
694694            SET_REGISTER(cpustate, (insn >> 12) & 0xf, res);
695695        }
696696        else
r5251r5252
700700    else
701701    {
702702        if (arm7_coproc_rt_r_callback)
703            arm7_coproc_rt_w_callback(cpustate->program, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
703            arm7_coproc_rt_w_callback(cpustate->device, insn, GET_REGISTER(cpustate, (insn >> 12) & 0xf), 0);
704704        else
705705            LOG(("%08x: Co-Processor Register Transfer executed, but no RT Write callback defined!\n", R15));
706706    }
src/emu/cpu/arm7/arm7core.h
r5251r5252
9090    kNumRegisters
9191};
9292
93/* Coprocessor-related macros */
94#define COPRO_TLB_BASE           cpustate->tlbBase
95#define COPRO_TLB_BASE_MASK                 0xffffc000
96#define COPRO_TLB_VADDR_FLTI_MASK           0xfff00000
97#define COPRO_TLB_VADDR_FLTI_MASK_SHIFT     18
98#define COPRO_TLB_VADDR_CSLTI_MASK          0x000ff000
99#define COPRO_TLB_VADDR_CSLTI_MASK_SHIFT    10
100#define COPRO_TLB_VADDR_FSLTI_MASK          0x000ffc00
101#define COPRO_TLB_VADDR_FSLTI_MASK_SHIFT    8
102#define COPRO_TLB_CFLD_ADDR_MASK            0xfffffc00
103#define COPRO_TLB_CFLD_ADDR_MASK_SHIFT      10
104#define COPRO_TLB_SECTION_PAGE_MASK         0xfff00000
105#define COPRO_TLB_LARGE_PAGE_MASK           0xffff0000
106#define COPRO_TLB_SMALL_PAGE_MASK           0xfffff000
107#define COPRO_TLB_TINY_PAGE_MASK            0xfffffc00
108#define COPRO_TLB_UNMAPPED                  0
109#define COPRO_TLB_LARGE_PAGE                1
110#define COPRO_TLB_SMALL_PAGE                2
111#define COPRO_TLB_TINY_PAGE                 3
112#define COPRO_TLB_COARSE_TABLE              1
113#define COPRO_TLB_SECTION_TABLE             2
114#define COPRO_TLB_FINE_TABLE                3
115
116#define COPRO_CTRL            cpustate->control
117#define COPRO_CTRL_MMU_EN                   0x00000001
118#define COPRO_CTRL_ADDRFAULT_EN             0x00000002
119#define COPRO_CTRL_DCACHE_EN                0x00000004
120#define COPRO_CTRL_WRITEBUF_EN              0x00000008
121#define COPRO_CTRL_ENDIAN                   0x00000080
122#define COPRO_CTRL_SYSTEM                   0x00000100
123#define COPRO_CTRL_ROM                      0x00000200
124#define COPRO_CTRL_ICACHE_EN                0x00001000
125#define COPRO_CTRL_INTVEC_ADJUST            0x00002000
126#define COPRO_CTRL_ADDRFAULT_EN_SHIFT       1
127#define COPRO_CTRL_DCACHE_EN_SHIFT          2
128#define COPRO_CTRL_WRITEBUF_EN_SHIFT        3
129#define COPRO_CTRL_ENDIAN_SHIFT             7
130#define COPRO_CTRL_SYSTEM_SHIFT             8
131#define COPRO_CTRL_ROM_SHIFT                9
132#define COPRO_CTRL_ICACHE_EN_SHIFT          12
133#define COPRO_CTRL_INTVEC_ADJUST_SHIFT      13
134#define COPRO_CTRL_LITTLE_ENDIAN            0
135#define COPRO_CTRL_BIG_ENDIAN               1
136#define COPRO_CTRL_INTVEC_0                 0
137#define COPRO_CTRL_INTVEC_F                 1
138#define COPRO_CTRL_MASK                     0x0000338f
139
140/* Coprocessor Registers */
141#define ARM7COPRO_REGS \
142    UINT32 control; \
143    UINT32 tlbBase;
144
145enum
146{
147   eARM_ARCHFLAGS_T   = 1,      // Thumb present
148   eARM_ARCHFLAGS_E   = 2,      // extended DSP operations present (only for v5+)
149   eARM_ARCHFLAGS_J   = 4,      // "Jazelle" (direct execution of Java bytecode)
150   eARM_ARCHFLAGS_MMU   = 8,      // has on-board MMU (traditional ARM style like the SA1110)
151};
152
93153#define ARM7CORE_REGS                   \
94154    UINT32 sArmRegister[kNumRegisters]; \
95155    UINT8 pendingIrq;                   \
r5251r5252
107167/* CPU state struct */
108168typedef struct
109169{
110    ARM7CORE_REGS               // these must be included in your cpu specific register implementation
170   ARM7CORE_REGS         // these must be included in your cpu specific register implementation
171   ARM7COPRO_REGS
172
173   UINT8 archRev;         // ARM architecture revision (3, 4, and 5 are valid)
174   UINT8 archFlags;      // architecture flags
175
111176} arm_state;
112177
113178/****************************************************************************************************
r5251r5252
278343#define INSN_RD_SHIFT               12
279344#define INSN_COND_SHIFT             28
280345
346#define INSN_COPRO_N        ((UINT32) 0x00100000u)
347#define INSN_COPRO_CREG     ((UINT32) 0x000f0000u)
348#define INSN_COPRO_AREG     ((UINT32) 0x0000f000u)
349#define INSN_COPRO_OP2      ((UINT32) 0x000000e0u)
350#define INSN_COPRO_OP3      ((UINT32) 0x0000000fu)
351#define INSN_COPRO_N_SHIFT          20
352#define INSN_COPRO_CREG_SHIFT       16
353#define INSN_COPRO_AREG_SHIFT       12
354#define INSN_COPRO_OP2_SHIFT        5
355
281356#define THUMB_INSN_TYPE     ((UINT16)0xf000)
282357#define THUMB_COND_TYPE     ((UINT16)0x0f00)
283358#define THUMB_GROUP4_TYPE   ((UINT16)0x0c00)
r5251r5252
403478#define SET_REGISTER(state, reg, val)  SetRegister(state, reg, val)
404479#define ARM7_CHECKIRQ           arm7_check_irq_state(cpustate)
405480
406extern write32_space_func arm7_coproc_do_callback;
407extern read32_space_func arm7_coproc_rt_r_callback;
408extern write32_space_func arm7_coproc_rt_w_callback;
409extern void (*arm7_coproc_dt_r_callback)(arm_state *cpustate, UINT32 insn, UINT32* prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
410extern void (*arm7_coproc_dt_w_callback)(arm_state *cpustate, UINT32 insn, UINT32* prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
481extern write32_device_func arm7_coproc_do_callback;
482extern read32_device_func arm7_coproc_rt_r_callback;
483extern write32_device_func arm7_coproc_rt_w_callback;
484extern void arm7_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
485extern void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
411486
412487extern UINT32 arm7_disasm(char *pBuf, UINT32 pc, UINT32 opcode);
413488extern UINT32 thumb_disasm(char *pBuf, UINT32 pc, UINT16 opcode);
src/emu/cpu/arm7/arm7.c
r5251r5252
11/*****************************************************************************
22 *
33 *   arm7.c
4 *   Portable ARM7TDMI CPU Emulator
4 *   Portable CPU Emulator for 32-bit ARM v3/4/5/6
55 *
66 *   Copyright Steve Ellenoff, all rights reserved.
7 *   Thumb, DSP, and MMU support and many bugfixes by R. Belmont and Ryan Holtz.
78 *
89 *   - This source code is released as freeware for non-commercial purposes.
910 *   - You are free to use and redistribute this code in modified or
r5251r5252
2021 *  This work is based on:
2122 *  #1) 'Atmel Corporation ARM7TDMI (Thumb) Datasheet - January 1999'
2223 *  #2) Arm 2/3/6 emulator By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino (MAME CORE 0.76)
23 *  #3) Thumb support by Ryan Holtz
2424 *
2525 *****************************************************************************/
2626
r5251r5252
4141/* Example for showing how Co-Proc functions work */
4242#define TEST_COPROC_FUNCS 1
4343
44/* prototypes */
45#if TEST_COPROC_FUNCS
46static WRITE32_HANDLER(test_do_callback);
47static READ32_HANDLER(test_rt_r_callback);
48static WRITE32_HANDLER(test_rt_w_callback);
49static void test_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
50static void test_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
51#endif
44/* prototypes of coprocessor functions */
45static WRITE32_DEVICE_HANDLER(arm7_do_callback);
46static READ32_DEVICE_HANDLER(arm7_rt_r_callback);
47static WRITE32_DEVICE_HANDLER(arm7_rt_w_callback);
48void arm7_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr));
49void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data));
5250
5351/* Macros that can be re-defined for custom cpu implementations - The core expects these to be defined */
5452/* In this case, we are using the default arm7 handlers (supplied by the core)
r5251r5252
9290   cpustate->device = device;
9391   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
9492
95#if TEST_COPROC_FUNCS
96   // setup co-proc callbacks example
97   arm7_coproc_do_callback = test_do_callback;
98   arm7_coproc_rt_r_callback = test_rt_r_callback;
99   arm7_coproc_rt_w_callback = test_rt_w_callback;
100   arm7_coproc_dt_r_callback = test_dt_r_callback;
101   arm7_coproc_dt_w_callback = test_dt_w_callback;
102#endif
93   // setup co-proc callbacks
94   arm7_coproc_do_callback = arm7_do_callback;
95   arm7_coproc_rt_r_callback = arm7_rt_r_callback;
96   arm7_coproc_rt_w_callback = arm7_rt_w_callback;
97   arm7_coproc_dt_r_callback = arm7_dt_r_callback;
98   arm7_coproc_dt_w_callback = arm7_dt_w_callback;
10399}
104100
105101static CPU_RESET( arm7 )
106102{
103   arm_state *cpustate = device->token;
104
107105   // must call core reset
108106   arm7_core_reset(device);
107
108   cpustate->archRev = 4;   // ARMv4
109   cpustate->archFlags = eARM_ARCHFLAGS_T;   // has Thumb
109110}
110111
112static CPU_RESET( arm9 )
113{
114   arm_state *cpustate = device->token;
115
116   // must call core reset
117   cpustate->archRev = 5;   // ARMv5
118   cpustate->archFlags = eARM_ARCHFLAGS_T;   // has Thumb
119
120   arm7_core_reset(device);
121}
122
111123static CPU_EXIT( arm7 )
112124{
113125   /* nothing to do here */
r5251r5252
324336        /* --- the following bits of info are returned as NULL-terminated strings --- */
325337        case DEVINFO_STR_NAME:                  strcpy(info->s, "ARM7");                        break;
326338        case DEVINFO_STR_FAMILY:           strcpy(info->s, "Acorn Risc Machine");          break;
327        case DEVINFO_STR_VERSION:          strcpy(info->s, "1.3");                         break;
339        case DEVINFO_STR_VERSION:          strcpy(info->s, "2.0");                         break;
328340        case DEVINFO_STR_SOURCE_FILE:             strcpy(info->s, __FILE__);                      break;
329341        case DEVINFO_STR_CREDITS:          strcpy(info->s, "Copyright Steve Ellenoff, sellenoff@hotmail.com"); break;
330342
r5251r5252
391403    }
392404}
393405
394/* TEST COPROC CALLBACK HANDLERS - Used for example on how to implement only */
395#if TEST_COPROC_FUNCS
406CPU_GET_INFO( arm9 )
407{
408    switch (state)
409    {
410        case CPUINFO_FCT_RESET:                 info->reset = CPU_RESET_NAME(arm9);                       break;
411        case DEVINFO_STR_NAME:             strcpy(info->s, "ARM9");                        break;
412   default:   CPU_GET_INFO_CALL(arm7);
413      break;
414    }
415}
396416
397static WRITE32_HANDLER(test_do_callback)
417/* ARM system coprocessor support */
418
419#define LOG(x) logerror x
420
421static WRITE32_DEVICE_HANDLER( arm7_do_callback )
398422{
399    LOG(("test_do_callback opcode=%x, =%x\n", offset, data));
400423}
401static READ32_HANDLER(test_rt_r_callback)
424
425static READ32_DEVICE_HANDLER( arm7_rt_r_callback )
402426{
403    UINT32 data=0;
404    LOG(("test_rt_r_callback opcode=%x\n", offset));
427    arm_state *cpustate = device->token;
428    UINT32 opcode = offset;
429    UINT8 cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT;
430    UINT8 op2 =  ( opcode & INSN_COPRO_OP2 )  >> INSN_COPRO_OP2_SHIFT;
431    UINT8 op3 =    opcode & INSN_COPRO_OP3;
432    UINT32 data = 0;
433
434    switch( cReg )
435    {
436        case 4:
437        case 7:
438        case 8:
439        case 9:
440        case 10:
441        case 11:
442        case 12:
443            // RESERVED
444            LOG( ( "arm7_rt_r_callback CR%d, RESERVED\n", cReg ) );
445            break;
446        case 0:             // ID
447       switch (cpustate->archRev)
448       {
449          case 3:   // ARM6 32-bit
450         data = 0x41;
451         break;
452
453      case 4: // ARM7/SA11xx
454         data = 0x41 | (1 << 23) | (7 << 12);
455         break;
456
457      case 5:   // ARM9/10/XScale
458         data = 0x41 | (9 << 12);
459         if (cpustate->archFlags & eARM_ARCHFLAGS_T)
460         {
461            if (cpustate->archFlags & eARM_ARCHFLAGS_E)
462            {
463               if (cpustate->archFlags & eARM_ARCHFLAGS_J)
464               {
465                  data |= (6<<16);   // v5TEJ
466               }
467               else
468               {
469                  data |= (5<<16);   // v5TE
470               }
471            }
472            else
473            {
474               data |= (4<<16);   // v5T
475            }
476         }
477         break;
478
479      case 6:   // ARM11
480         data = 0x41 | (10<< 12) | (7<<16);   // v6
481         break;
482       }
483            LOG( ( "arm7_rt_r_callback, ID\n" ) );
484            break;
485        case 1:             // Control
486            LOG( ( "arm7_rt_r_callback, Control\n" ) );
487            data = COPRO_CTRL;
488            break;
489        case 2:             // Translation Table Base
490            LOG( ( "arm7_rt_r_callback, TLB Base\n" ) );
491            data = COPRO_TLB_BASE;
492            break;
493        case 3:             // Domain Access Control
494            LOG( ( "arm7_rt_r_callback, Domain Access Control\n" ) );
495            break;
496        case 5:             // Fault Status
497            LOG( ( "arm7_rt_r_callback, Fault Status\n" ) );
498            break;
499        case 6:             // Fault Address
500            LOG( ( "arm7_rt_r_callback, Fault Address\n" ) );
501            break;
502        case 13:            // Read Process ID (PID)
503            LOG( ( "arm7_rt_r_callback, Read PID\n" ) );
504            break;
505        case 14:            // Read Breakpoint
506            LOG( ( "arm7_rt_r_callback, Read Breakpoint\n" ) );
507            break;
508        case 15:            // Test, Clock, Idle
509            LOG( ( "arm7_rt_r_callback, Test / Clock / Idle \n" ) );
510            break;
511    }
512
513    op2 = 0;
514    op3 = 0;
515
405516    return data;
406517}
407static WRITE32_HANDLER(test_rt_w_callback)
518
519static WRITE32_DEVICE_HANDLER( arm7_rt_w_callback )
408520{
409    LOG(("test_rt_w_callback opcode=%x, data from ARM7 register=%x\n", offset, data));
521    arm_state *cpustate = device->token;
522    UINT32 opcode = offset;
523    UINT8 cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT;
524    UINT8 op2 =  ( opcode & INSN_COPRO_OP2 )  >> INSN_COPRO_OP2_SHIFT;
525    UINT8 op3 =    opcode & INSN_COPRO_OP3;
526
527    switch( cReg )
528    {
529        case 0:
530        case 4:
531        case 10:
532        case 11:
533        case 12:
534            // RESERVED
535            LOG( ( "arm7_rt_w_callback CR%d, RESERVED = %08x\n", cReg, data) );
536            break;
537        case 1:             // Control
538            LOG( ( "arm7_rt_w_callback Control = %08x (%d) (%d)\n", data, op2, op3 ) );
539            LOG( ( "    MMU:%d, Address Fault:%d, Data Cache:%d, Write Buffer:%d\n",
540                   data & COPRO_CTRL_MMU_EN, ( data & COPRO_CTRL_ADDRFAULT_EN ) >> COPRO_CTRL_ADDRFAULT_EN_SHIFT,
541                   ( data & COPRO_CTRL_DCACHE_EN ) >> COPRO_CTRL_DCACHE_EN_SHIFT,
542                   ( data & COPRO_CTRL_WRITEBUF_EN ) >> COPRO_CTRL_WRITEBUF_EN_SHIFT ) );
543            LOG( ( "    Endianness:%d, System:%d, ROM:%d, Instruction Cache:%d\n",
544                   ( data & COPRO_CTRL_ENDIAN ) >> COPRO_CTRL_ENDIAN_SHIFT,
545                   ( data & COPRO_CTRL_SYSTEM ) >> COPRO_CTRL_SYSTEM_SHIFT,
546                   ( data & COPRO_CTRL_ROM ) >> COPRO_CTRL_ROM_SHIFT,
547                   ( data & COPRO_CTRL_ICACHE_EN ) >> COPRO_CTRL_ICACHE_EN_SHIFT ) );
548            LOG( ( "    Int Vector Adjust:%d\n", ( data & COPRO_CTRL_INTVEC_ADJUST ) >> COPRO_CTRL_INTVEC_ADJUST_SHIFT ) );
549            COPRO_CTRL = data & COPRO_CTRL_MASK;
550            if( COPRO_CTRL & COPRO_CTRL_MMU_EN )
551            {
552//                change_pc(arm7_tlb_translate(R15));
553            }
554            break;
555        case 2:             // Translation Table Base
556            LOG( ( "arm7_rt_w_callback TLB Base = %08x (%d) (%d)\n", data, op2, op3 ) );
557            COPRO_TLB_BASE = data;
558            break;
559        case 3:             // Domain Access Control
560            LOG( ( "arm7_rt_w_callback Domain Access Control = %08x (%d) (%d)\n", data, op2, op3 ) );
561            break;
562        case 5:             // Fault Status
563            LOG( ( "arm7_rt_w_callback Fault Status = %08x (%d) (%d)\n", data, op2, op3 ) );
564            break;
565        case 6:             // Fault Address
566            LOG( ( "arm7_rt_w_callback Fault Address = %08x (%d) (%d)\n", data, op2, op3 ) );
567            break;
568        case 7:             // Cache Operations
569            LOG( ( "arm7_rt_w_callback Cache Ops = %08x (%d) (%d)\n", data, op2, op3 ) );
570            break;
571        case 8:             // TLB Operations
572            LOG( ( "arm7_rt_w_callback TLB Ops = %08x (%d) (%d)\n", data, op2, op3 ) );
573            break;
574        case 9:             // Read Buffer Operations
575            LOG( ( "arm7_rt_w_callback Read Buffer Ops = %08x (%d) (%d)\n", data, op2, op3 ) );
576            break;
577        case 13:            // Write Process ID (PID)
578            LOG( ( "arm7_rt_w_callback Write PID = %08x (%d) (%d)\n", data, op2, op3 ) );
579            break;
580        case 14:            // Write Breakpoint
581            LOG( ( "arm7_rt_w_callback Write Breakpoint = %08x (%d) (%d)\n", data, op2, op3 ) );
582            break;
583        case 15:            // Test, Clock, Idle
584            LOG( ( "arm7_rt_w_callback Test / Clock / Idle = %08x (%d) (%d)\n", data, op2, op3 ) );
585            break;
586    }
587    op2 = 0;
588    op3 = 0;
410589}
411static void test_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr))
590
591void arm7_dt_r_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *cpustate, UINT32 addr))
412592{
413    LOG(("test_dt_r_callback: insn = %x\n", insn));
414593}
415static void test_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data))
594
595void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *cpustate, UINT32 addr, UINT32 data))
416596{
417    LOG(("test_dt_w_callback: opcode = %x\n", insn));
418597}
419#endif
598
src/emu/cpu/arm7/arm7.h
r5251r5252
4141extern CPU_GET_INFO( arm7 );
4242#define CPU_ARM7 CPU_GET_INFO_NAME( arm7 )
4343
44extern CPU_GET_INFO( arm9 );
45#define CPU_ARM9 CPU_GET_INFO_NAME( arm9 )
46
4447#endif /* __ARM7_H__ */
src/emu/emuopts.c
r5251r5252
4343   { "inipath",                     ".;ini",     0,                 "path to ini files" },
4444   { "fontpath",                    ".",         0,                 "path to font files" },
4545   { "cheatpath",                   "cheat",     0,                 "path to cheat files" },
46   { "crsshairpath",                "crsshair", 0,                 "path to crosshair files" },
46   { "crosshairpath",               "crosshair", 0,                 "path to crosshair files" },
4747
4848   /* output directory options */
4949   { NULL,                          NULL,        OPTION_HEADER,     "CORE OUTPUT DIRECTORY OPTIONS" },
r5251r5252
6868   { "snapname",                    "%g/%i",     0,                 "override of the default snapshot/movie naming; %g == gamename, %i == index" },
6969   { "snapsize",                    "auto",      0,                 "specify snapshot/movie resolution (<width>x<height>) or 'auto' to use minimal size " },
7070   { "snapview",                    "internal",  0,                 "specify snapshot/movie view or 'internal' to use internal pixel-aspect views" },
71   { "burnin",                      "0",         OPTION_BOOLEAN,    "create burn-in snapshots for each screen" },
7172
7273   /* performance options */
7374   { NULL,                          NULL,        OPTION_HEADER,     "CORE PERFORMANCE OPTIONS" },
src/emu/emuopts.h
r5251r5252
4545#define OPTION_INIPATH            "inipath"
4646#define OPTION_FONTPATH            "fontpath"
4747#define OPTION_CHEATPATH         "cheatpath"
48#define OPTION_CRSSHAIRPATH         "crsshairpath"
48#define OPTION_CROSSHAIRPATH      "crosshairpath"
4949
5050/* core directory options */
5151#define OPTION_CFG_DIRECTORY      "cfg_directory"
r5251r5252
6868#define OPTION_SNAPNAME            "snapname"
6969#define OPTION_SNAPSIZE            "snapsize"
7070#define OPTION_SNAPVIEW            "snapview"
71#define OPTION_BURNIN            "burnin"
7172
7273/* core performance options */
7374#define OPTION_AUTOFRAMESKIP      "autoframeskip"
src/emu/uimenu.c
r5251r5252
32213221         /* search for crosshair graphics */
32223222
32233223         /* open a path to the crosshairs */
3224         path = mame_openpath(mame_options(), OPTION_CRSSHAIRPATH);
3224         path = mame_openpath(mame_options(), OPTION_CROSSHAIRPATH);
32253225         if (path != NULL)
32263226         {
32273227            const osd_directory_entry *dir;
src/emu/video.c
r5251r5252
5959   /* textures and bitmaps */
6060   render_texture *      texture[2];            /* 2x textures for the screen bitmap */
6161   bitmap_t *            bitmap[2];            /* 2x bitmaps for rendering */
62   bitmap_t *            burnin;               /* burn-in bitmap */
6263   UINT8               curbitmap;            /* current bitmap index */
6364   UINT8               curtexture;            /* current texture index */
6465   INT32               texture_format;         /* texture format of bitmap for this screen */
r5251r5252
203204static void video_mng_record_frame(running_machine *machine);
204205static void video_avi_record_frame(running_machine *machine);
205206
207/* burn-in generation */
208static void video_update_burnin(running_machine *machine);
209static void video_finalize_burnin(const device_config *screen);
210
206211/* software rendering */
207212static void rgb888_draw_primitives(const render_primitive *primlist, void *dstdata, UINT32 width, UINT32 height, UINT32 pitch);
208213
r5251r5252
11971202   if (screen->machine->config->video_attributes & VIDEO_UPDATE_SCANLINE)
11981203      timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(screen, 0, 0), 0);
11991204
1205   /* create burn-in bitmap */
1206   if (options_get_int(mame_options(), OPTION_BURNIN) > 0)
1207   {
1208      int width, height;
1209      if (sscanf(options_get_string(mame_options(), OPTION_SNAPSIZE), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
1210         width = height = 300;
1211      state->burnin = bitmap_alloc(width, height, BITMAP_FORMAT_INDEXED64);
1212      if (state->burnin == NULL)
1213         fatalerror("Error allocating burn-in bitmap for screen at (%dx%d)\n", width, height);
1214      bitmap_fill(state->burnin, NULL, 0);
1215   }
1216
12001217   state_save_register_device_item(screen, 0, state->width);
12011218   state_save_register_device_item(screen, 0, state->height);
12021219   state_save_register_device_item(screen, 0, state->visarea.min_x);
r5251r5252
12481265      bitmap_free(state->bitmap[0]);
12491266   if (state->bitmap[1] != NULL)
12501267      bitmap_free(state->bitmap[1]);
1268   if (state->burnin != NULL)
1269   {
1270      video_finalize_burnin(screen);
1271      bitmap_free(state->burnin);
1272   }
12511273}
12521274
12531275
r5251r5252
15231545      state->changed = FALSE;
15241546   }
15251547
1526   /* update our movie recording state */
1548   /* update our movie recording and burn-in state */
15271549   if (!mame_is_paused(machine))
15281550   {
15291551      video_mng_record_frame(machine);
15301552      video_avi_record_frame(machine);
1553      video_update_burnin(machine);
15311554   }
15321555
15331556   /* draw any crosshairs */
r5251r5252
25872610
25882611
25892612/***************************************************************************
2613    BURN-IN GENERATION
2614***************************************************************************/
2615
2616/*-------------------------------------------------
2617    video_update_burnin - update the burnin bitmap
2618    for all screens
2619-------------------------------------------------*/
2620
2621#undef rand
2622static void video_update_burnin(running_machine *machine)
2623{
2624   const device_config *screen;
2625
2626   /* iterate over screens and update the burnin for the ones that care */
2627   for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
2628   {
2629      screen_state *state = get_safe_token(screen);
2630      if (state->burnin != NULL)
2631      {
2632         bitmap_t *srcbitmap = state->bitmap[state->curtexture];
2633         int srcwidth = srcbitmap->width;
2634         int srcheight = srcbitmap->height;
2635         int dstwidth = state->burnin->width;
2636         int dstheight = state->burnin->height;
2637         int xstep = (srcwidth << 16) / dstwidth;
2638         int ystep = (srcheight << 16) / dstheight;
2639         int xstart = ((UINT32)rand() % 32767) * xstep / 32767;
2640         int ystart = ((UINT32)rand() % 32767) * ystep / 32767;
2641         int srcx, srcy;
2642         int x, y;
2643
2644         /* iterate over rows in the destination */
2645         for (y = 0, srcy = ystart; y < dstheight; y++, srcy += ystep)
2646         {
2647            UINT64 *dst = BITMAP_ADDR64(state->burnin, y, 0);
2648
2649            /* handle the 16-bit palettized case */
2650            if (srcbitmap->format == BITMAP_FORMAT_INDEXED16)
2651            {
2652               const UINT16 *src = BITMAP_ADDR16(srcbitmap, srcy >> 16, 0);
2653               const rgb_t *palette = palette_entry_list_adjusted(machine->palette);
2654               for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
2655               {
2656                  rgb_t pixel = palette[src[srcx >> 16]];
2657                  dst[x] += RGB_GREEN(pixel) + RGB_RED(pixel) + RGB_BLUE(pixel);
2658               }
2659            }
2660
2661            /* handle the 15-bit RGB case */
2662            else if (srcbitmap->format == BITMAP_FORMAT_RGB15)
2663            {
2664               const UINT16 *src = BITMAP_ADDR16(srcbitmap, srcy >> 16, 0);
2665               for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
2666               {
2667                  rgb15_t pixel = src[srcx >> 16];
2668                  dst[x] += ((pixel >> 10) & 0x1f) + ((pixel >> 5) & 0x1f) + ((pixel >> 0) & 0x1f);
2669               }
2670            }
2671
2672            /* handle the 32-bit RGB case */
2673            else if (srcbitmap->format == BITMAP_FORMAT_RGB32)
2674            {
2675               const UINT32 *src = BITMAP_ADDR32(srcbitmap, srcy >> 16, 0);
2676               for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
2677               {
2678                  rgb_t pixel = src[srcx >> 16];
2679                  dst[x] += RGB_GREEN(pixel) + RGB_RED(pixel) + RGB_BLUE(pixel);
2680               }
2681            }
2682         }
2683      }
2684   }
2685}
2686
2687
2688/*-------------------------------------------------
2689    video_finalize_burnin - finalize the burnin
2690    bitmaps for all screens
2691-------------------------------------------------*/
2692
2693static void video_finalize_burnin(const device_config *screen)
2694{
2695   screen_state *state = get_safe_token(screen);
2696   if (state->burnin != NULL)
2697   {
2698      astring *fname = astring_alloc();
2699      rectangle scaledvis;
2700      bitmap_t *finalmap;
2701      UINT64 minval = ~(UINT64)0;
2702      UINT64 maxval = 0;
2703      file_error filerr;
2704      mame_file *file;
2705      int x, y;
2706
2707      /* compute the scaled visible region */
2708      scaledvis.min_x = state->visarea.min_x * state->burnin->width / state->width;
2709      scaledvis.max_x = state->visarea.max_x * state->burnin->width / state->width;
2710      scaledvis.min_y = state->visarea.min_y * state->burnin->height / state->height;
2711      scaledvis.max_y = state->visarea.max_y * state->burnin->height / state->height;
2712
2713      /* wrap a bitmap around the subregion we care about */
2714      finalmap = bitmap_alloc(scaledvis.max_x + 1 - scaledvis.min_x,
2715                              scaledvis.max_y + 1 - scaledvis.min_y,
2716                              BITMAP_FORMAT_ARGB32);
2717
2718      /* find the maximum value */
2719      for (y = 0; y < finalmap->height; y++)
2720      {
2721         UINT64 *src = BITMAP_ADDR64(state->burnin, y, 0);
2722         for (x = 0; x < finalmap->width; x++)
2723         {
2724            minval = MIN(minval, src[x]);
2725            maxval = MAX(maxval, src[x]);
2726         }
2727      }
2728
2729      /* now normalize and convert to RGB */
2730      for (y = 0; y < finalmap->height; y++)
2731      {
2732         UINT64 *src = BITMAP_ADDR64(state->burnin, y, 0);
2733         UINT32 *dst = BITMAP_ADDR32(finalmap, y, 0);
2734         for (x = 0; x < finalmap->width; x++)
2735         {
2736            int brightness = (UINT64)(maxval - src[x]) * 255 / (maxval - minval);
2737            dst[x] = MAKE_ARGB(0xff, brightness, brightness, brightness);
2738         }
2739      }
2740
2741      /* write the final PNG */
2742
2743      /* compute the name and create the file */
2744      astring_printf(fname, "%s" PATH_SEPARATOR "burnin-%s.png", screen->machine->basename, screen->tag);
2745      filerr = mame_fopen(SEARCHPATH_SCREENSHOT, astring_c(fname), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
2746      if (filerr == FILERR_NONE)
2747      {
2748         png_info pnginfo = { 0 };
2749         png_error pngerr;
2750         char text[256];
2751
2752         /* add two text entries describing the image */
2753         sprintf(text, APPNAME " %s", build_version);
2754         png_add_text(&pnginfo, "Software", text);
2755         sprintf(text, "%s %s", screen->machine->gamedrv->manufacturer, screen->machine->gamedrv->description);
2756         png_add_text(&pnginfo, "System", text);
2757
2758         /* now do the actual work */
2759         pngerr = png_write_bitmap(mame_core_file(file), &pnginfo, finalmap, 0, NULL);
2760
2761         /* free any data allocated */
2762         png_free(&pnginfo);
2763         mame_fclose(file);
2764      }
2765      astring_free(fname);
2766      bitmap_free(finalmap);
2767   }
2768}
2769
2770
2771
2772/***************************************************************************
25902773    CONFIGURATION HELPERS
25912774***************************************************************************/
25922775
src/emu/emu.mak
r5251r5252
136136   $(EMUMACHINE)/f3853.o \
137137   $(EMUMACHINE)/generic.o \
138138   $(EMUMACHINE)/i8243.o \
139   $(EMUMACHINE)/i8255a.o \
139140   $(EMUMACHINE)/i2cmem.o \
140141   $(EMUMACHINE)/i2cmemdev.o \
141142    $(EMUMACHINE)/idectrl.o \
src/emu/devintrf.c
r5251r5252
125125
126126   /* populate device configuration */
127127   device->clock = clock;
128   memset(device->address_map, 0, sizeof(device->address_map));
128   memset((void *)device->address_map, 0, sizeof(device->address_map));
129129   if ((device->clock & 0xff000000) == 0xff000000)
130130   {
131131      assert(device->owner != NULL);
r5251r5252
141141   device->tokenbytes = 0;
142142   device->region = NULL;
143143   device->regionbytes = 0;
144   memset(device->space, 0, sizeof(device->space));
144   memset((void *)device->space, 0, sizeof(device->space));
145145   device->execute = NULL;
146146
147147   /* append the tag */
src/emu/machine/idectrl.c
r5251r5252
8383#define IDE_COMMAND_IDLE_IMMEDIATE      0xe1
8484#define IDE_COMMAND_TAITO_GNET_UNLOCK_1 0xfe
8585#define IDE_COMMAND_TAITO_GNET_UNLOCK_2 0xfc
86#define IDE_COMMAND_TAITO_GNET_UNLOCK_3 0x0f
8687
8788#define IDE_ERROR_NONE               0x00
8889#define IDE_ERROR_DEFAULT            0x01
r5251r5252
157158   UINT8         user_password_enable;
158159   const UINT8 *   master_password;
159160   const UINT8 *   user_password;
161
162   UINT8         gnetreadlock;
160163};
161164
162165
r5251r5252
273276   return ide->features;
274277}
275278
279void ide_set_gnet_readlock(const device_config *device, const UINT8 onoff)
280{
281   ide_state *ide = get_safe_token(device);
282   ide->gnetreadlock = onoff;
283}
276284
277285void ide_set_master_password(const device_config *device, const UINT8 *password)
278286{
r5251r5252
713721{
714722   int lba = lba_address(ide), count = 0;
715723
724   /* GNET readlock check */
725   if (ide->gnetreadlock) {
726      ide->status &= ~IDE_STATUS_ERROR;
727      ide->status &= ~IDE_STATUS_BUSY;
728      return;
729   }
716730   /* now do the read */
717731   if (ide->disk)
718732      count = hard_disk_read(ide->disk, lba, ide->buffer);
r5251r5252
9871001
9881002static void handle_command(ide_state *ide, UINT8 command)
9891003{
1004   UINT8 key[5];
1005
9901006   /* implicitly clear interrupts here */
9911007   clear_interrupt(ide);
9921008
r5251r5252
11911207         signal_interrupt(ide);
11921208         break;
11931209
1210      case IDE_COMMAND_TAITO_GNET_UNLOCK_3:
1211         LOGPRINT(("IDE GNET Unlock 3\n"));
1212
1213         /* key check */
1214         chd_get_metadata (ide->handle, HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0);
1215         if ((ide->precomp_offset == key[0]) && (ide->sector_count == key[1]) && (ide->cur_sector == key[2]) && (ide->cur_cylinder == (((UINT16)key[4]<<8)|key[3])))
1216         {
1217            ide->gnetreadlock= 0;
1218         }
1219
1220         /* update flags */
1221         ide->status |= IDE_STATUS_DRIVE_READY;
1222         ide->status &= ~IDE_STATUS_ERROR;
1223         signal_interrupt(ide);
1224         break;
1225
11941226      default:
11951227         LOGPRINT(("IDE unknown command (%02X)\n", command));
11961228         debugger_break(ide->device->machine);
r5251r5252
14091441                  ide->status &= ~IDE_STATUS_BUFFER_READY;
14101442                  if (bad)
14111443                     ide->status |= IDE_STATUS_ERROR;
1412                  else
1444                  else {
14131445                     ide->status &= ~IDE_STATUS_ERROR;
1446                     ide->gnetreadlock= 0;
1447                  }
14141448               }
14151449               else
14161450                  continue_write(ide);
r5251r5252
18421876
18431877   state_save_register_device_item(device, 0, ide->master_password_enable);
18441878   state_save_register_device_item(device, 0, ide->user_password_enable);
1879
1880   state_save_register_device_item(device, 0, ide->gnetreadlock);
18451881}
18461882
18471883
r5251r5252
18731909   ide->status = IDE_STATUS_DRIVE_READY | IDE_STATUS_SEEK_COMPLETE;
18741910   ide->error = IDE_ERROR_DEFAULT;
18751911   ide->buffer_offset = 0;
1912   ide->gnetreadlock = 0;
18761913   ide->master_password_enable = (ide->master_password != NULL);
18771914   ide->user_password_enable = (ide->user_password != NULL);
18781915   clear_interrupt(ide);
src/emu/machine/idectrl.h
r5251r5252
6060void ide_set_master_password(const device_config *device, const UINT8 *password);
6161void ide_set_user_password(const device_config *device, const UINT8 *password);
6262
63void ide_set_gnet_readlock(const device_config *device, const UINT8 onoff);
64
6365int ide_bus_r(const device_config *config, int select, int offset);
6466void ide_bus_w(const device_config *config, int select, int offset, int data);
6567
src/emu/machine/ldpr8210.c
r5251r5252
5454
5555/* serial timing, mostly from the service manual, derived from the XTAL */
5656#define SERIAL_CLOCK               XTAL_455kHz
57#define SERIAL_0_BIT_TIME            ATTOTIME_IN_HZ(SERIAL_CLOCK / 512)
58#define SERIAL_1_BIT_TIME            ATTOTIME_IN_HZ(SERIAL_CLOCK / 1024)
59#define SERIAL_MIDPOINT_TIME         ATTOTIME_IN_HZ(SERIAL_CLOCK / 600)
60#define SERIAL_MAX_WORD_TIME         ATTOTIME_IN_HZ(SERIAL_CLOCK / 11520)
61#define SERIAL_REJECT_DUPLICATE_TIME   ATTOTIME_IN_HZ(SERIAL_CLOCK / 11520 / 4)
57#define SERIAL_0_BIT_TIME            ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 512)
58#define SERIAL_1_BIT_TIME            ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 1024)
59#define SERIAL_MIDPOINT_TIME         ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 600)
60#define SERIAL_MAX_BIT_TIME            ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 4096)
61#define SERIAL_MAX_WORD_TIME         ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 11520)
62#define SERIAL_REJECT_DUPLICATE_TIME   ATTOTIME_IN_HZ((double)SERIAL_CLOCK / 11520 / 4)
6263
6364
6465
r5251r5252
450451   if (prev != ASSERT_LINE && data == ASSERT_LINE)
451452   {
452453      attotime curtime = timer_get_time(ld->device->machine);
453      attotime delta;
454      attotime delta, overalldelta;
454455      int longpulse;
455456
457      /* get the time difference from the last assert */
458      /* and update our internal command time */
459      delta = attotime_sub(curtime, player->lastbittime);
460      player->lastbittime = curtime;
461
456462      /* if we timed out since the first bit, reset the accumulator */
457      delta = attotime_sub(curtime, player->firstbittime);
458      if (attotime_compare(delta, SERIAL_MAX_WORD_TIME) > 0)
463      overalldelta = attotime_sub(curtime, player->firstbittime);
464      if (attotime_compare(overalldelta, SERIAL_MAX_WORD_TIME) > 0 || attotime_compare(delta, SERIAL_MAX_BIT_TIME) > 0)
459465      {
460466         player->firstbittime = curtime;
461467         player->accumulator = 0x5555;
r5251r5252
463469            printf("Reset accumulator\n");
464470      }
465471
466      /* get the time difference from the last assert */
467      /* and update our internal command time */
468      delta = attotime_sub(curtime, player->lastbittime);
469      player->lastbittime = curtime;
470
471472      /* 0 bit delta is 1.05 msec, 1 bit delta is 2.11 msec */
472473      longpulse = (attotime_compare(delta, SERIAL_MIDPOINT_TIME) < 0) ? 0 : 1;
473474      player->accumulator = (player->accumulator << 1) | longpulse;
r5251r5252
501502
502503         /* log the command and wait for a keypress */
503504         if (LOG_SERIAL)
504         {
505505            printf("--- Command = %02X\n", player->pia.porta >> 3);
506            while (input_code_pressed(KEYCODE_ENTER)) ;
507            while (!input_code_pressed(KEYCODE_ENTER)) ;
508         }
509506
510507         /* reset the first bit time so that the accumulator clears on the next write */
511508         player->firstbittime = attotime_sub(curtime, SERIAL_MAX_WORD_TIME);
r5251r5252
539536   ldplayer_data *player = ld->player;
540537   UINT8 focus_on = !(player->port1 & 0x08);
541538   UINT8 laser_on = !(player->port2 & 0x01);
542   UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16);
543   UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718);
539   UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16, FALSE);
540   UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718, FALSE);
544541
545542   /* logging */
546543   if (LOG_VBLANK_VBI)
src/emu/machine/ldvp931.c
r5251r5252
329329
330330   /* fetch the code and compute the DATIC latched value */
331331   if (line >= LASERDISC_CODE_LINE16 && line <= LASERDISC_CODE_LINE18)
332      code = laserdisc_get_field_code(ld->device, line);
332      code = laserdisc_get_field_code(ld->device, line, FALSE);
333333
334334   /* at the start of each line, signal an interrupt and use a timer to turn it off */
335335   if (which == 0)
src/emu/machine/laserdsc.h
r5251r5252
154154int laserdisc_get_video(const device_config *device, bitmap_t **bitmap);
155155
156156/* return the raw philips or white flag codes */
157UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code);
157UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched);
158158
159159
160160
src/emu/machine/ldcore.c
r5251r5252
474474    information read from the disc
475475-------------------------------------------------*/
476476
477UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code)
477UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched)
478478{
479479   laserdisc_state *ld = get_safe_token(device);
480480   ldcore_data *ldcore = ld->core;
481481   int field = ldcore->fieldnum;
482482
483   /* return nothing if the video is off (external devices can't sense) */
484   if (zero_if_squelched && ldcore->videosquelch)
485      return 0;
486
483487   switch (code)
484488   {
485489      case LASERDISC_CODE_WHITE_FLAG:
r5251r5252
818822   if (ldcore->vbidata != NULL)
819823      vbi_metadata_unpack(&vbidata, NULL, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
820824
825   /* if we're in the lead-in area, force the VBI data to be standard lead-in */
826   if (tracknum - 1 < VIRTUAL_LEAD_IN_TRACKS)
827   {
828      vbidata.line16 = 0;
829      vbidata.line17 = vbidata.line18 = vbidata.line1718 = VBI_CODE_LEADIN;
830   }
831//printf("track %5d.%d: %06X %06X %06X\n", tracknum, fieldnum, vbidata.line16, vbidata.line17, vbidata.line18);
832
821833   /* if we're about to read the first field in a frame, advance */
822834   frame = &ldcore->frame[ldcore->videoindex];
823835   if ((vbidata.line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
r5251r5252
865877   if (ldcore->vbidata != NULL)
866878      vbi_metadata_unpack(&ldcore->metadata[fieldnum], &vbiframe, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
867879
880   /* if we're in the lead-in area, force the VBI data to be standard lead-in */
881   if (tracknum - 1 < VIRTUAL_LEAD_IN_TRACKS)
882   {
883      ldcore->metadata[fieldnum].line16 = 0;
884      ldcore->metadata[fieldnum].line17 = ldcore->metadata[fieldnum].line18 = ldcore->metadata[fieldnum].line1718 = VBI_CODE_LEADIN;
885   }
886
868887   /* configure the codec and then read */
869888   ldcore->readresult = CHDERR_FILE_NOT_FOUND;
870889   if (ldcore->disc != NULL && !ldcore->videosquelch)
src/emu/machine/i8255a.c
r0r5252
1/**********************************************************************
2
3    Intel 8255A Programmable Peripheral Interface emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "driver.h"
11#include "i8255a.h"
12
13/***************************************************************************
14    PARAMETERS
15***************************************************************************/
16
17#define LOG 0
18
19enum
20{
21   PORT_A = 0,
22   PORT_B,
23   PORT_C,
24   CONTROL
25};
26
27enum
28{
29   GROUP_A = 0,
30   GROUP_B
31};
32
33enum
34{
35   MODE_0 = 0,
36   MODE_1,
37   MODE_2
38};
39
40enum
41{
42   MODE_OUTPUT = 0,
43   MODE_INPUT,
44};
45
46#define I8255A_CONTROL_PORT_C_LOWER_INPUT   0x01
47#define I8255A_CONTROL_PORT_B_INPUT         0x02
48#define I8255A_CONTROL_GROUP_B_MODE_1      0x04
49#define I8255A_CONTROL_PORT_C_UPPER_INPUT   0x08
50#define I8255A_CONTROL_PORT_A_INPUT         0x10
51#define I8255A_CONTROL_GROUP_A_MODE_MASK   0x60
52#define I8255A_CONTROL_MODE_SET            0x80
53
54/***************************************************************************
55    TYPE DEFINITIONS
56***************************************************************************/
57
58typedef struct _i8255a_t i8255a_t;
59struct _i8255a_t
60{
61   devcb_resolved_read8      in_port_func[3];
62   devcb_resolved_write8      out_port_func[3];
63
64   UINT8 control;            /* mode control word */
65   UINT8 output[3];         /* output latch */
66   UINT8 input[3];            /* input latch */
67
68   int ibf[2];               /* input buffer full flag */
69   int obf[2];               /* output buffer full flag, negative logic */
70   int inte[2];            /* interrupt enable */
71   int inte1;               /* interrupt enable */
72   int inte2;               /* interrupt enable */
73   int intr[2];            /* interrupt */
74};
75
76/***************************************************************************
77    INLINE FUNCTIONS
78***************************************************************************/
79
80INLINE i8255a_t *get_safe_token(const device_config *device)
81{
82   assert(device != NULL);
83   assert(device->token != NULL);
84
85   return (i8255a_t *)device->token;
86}
87
88INLINE const i8255a_interface *get_interface(const device_config *device)
89{
90   assert(device != NULL);
91   assert((device->type == I8255A));
92   return (const i8255a_interface *) device->static_config;
93}
94
95INLINE int group_mode(i8255a_t *i8255a, int group)
96{
97   int mode = 0;
98
99   switch (group)
100   {
101   case GROUP_A:
102      switch ((i8255a->control & I8255A_CONTROL_GROUP_A_MODE_MASK) >> 5)
103      {
104      case 0: mode = MODE_0; break;
105      case 1: mode = MODE_1; break;
106      case 2: case 3: mode = MODE_2; break;
107      }
108      break;
109
110   case GROUP_B:
111      mode = i8255a->control & I8255A_CONTROL_GROUP_B_MODE_1 ? MODE_1 : MODE_0;
112      break;
113   }
114
115   return mode;
116}
117
118INLINE int port_mode(i8255a_t *i8255a, int port)
119{
120   int mode = 0;
121
122   switch (port)
123   {
124   case PORT_A: mode = i8255a->control & I8255A_CONTROL_PORT_A_INPUT ? MODE_INPUT : MODE_OUTPUT; break;
125   case PORT_B: mode = i8255a->control & I8255A_CONTROL_PORT_B_INPUT ? MODE_INPUT : MODE_OUTPUT; break;
126   }
127
128   return mode;
129}
130
131INLINE int port_c_lower_mode(i8255a_t *i8255a)
132{
133   return i8255a->control & I8255A_CONTROL_PORT_C_LOWER_INPUT ? MODE_INPUT : MODE_OUTPUT;
134}
135
136INLINE int port_c_upper_mode(i8255a_t *i8255a)
137{
138   return i8255a->control & I8255A_CONTROL_PORT_C_UPPER_INPUT ? MODE_INPUT : MODE_OUTPUT;
139}
140
141/***************************************************************************
142    IMPLEMENTATION
143***************************************************************************/
144
145static void output_pc(i8255a_t *i8255a)
146{
147   UINT8 data = 0;
148   UINT8 mask = 0;
149
150   /* PC upper */
151   switch (group_mode(i8255a, GROUP_A))
152   {
153   case MODE_0:
154      if (port_c_upper_mode(i8255a) == MODE_OUTPUT)
155      {
156         mask |= 0xf0;
157      }
158      break;
159
160   case MODE_1:
161      data |= i8255a->intr[PORT_A] ? 0x08 : 0x00;
162
163      if (port_mode(i8255a, PORT_A) == MODE_OUTPUT)
164      {
165         data |= i8255a->obf[PORT_A] ? 0x80 : 0x00;
166         mask |= 0x30;
167      }
168      else
169      {
170         data |= i8255a->ibf[PORT_A] ? 0x20 : 0x00;
171         mask |= 0xc0;
172      }
173      break;
174
175   case MODE_2:
176      data |= i8255a->intr[PORT_A] ? 0x08 : 0x00;
177      data |= i8255a->ibf[PORT_A] ? 0x20 : 0x00;
178      data |= i8255a->obf[PORT_A] ? 0x80 : 0x00;
179      break;
180   }
181
182   /* PC lower */
183   switch (group_mode(i8255a, GROUP_B))
184   {
185   case MODE_0:
186      if (port_c_lower_mode(i8255a) == MODE_OUTPUT)
187      {
188         mask |= 0x0f;
189      }
190      break;
191
192   case MODE_1:
193      data |= i8255a->intr[PORT_B] ? 0x01 : 0x00;
194
195      if (port_mode(i8255a, PORT_B) == MODE_OUTPUT)
196      {
197         data |= i8255a->obf[PORT_B] ? 0x02 : 0x00;
198      }
199      else
200      {
201         data |= i8255a->ibf[PORT_B] ? 0x02 : 0x00;
202      }
203   }
204
205   data |= i8255a->output[PORT_C] & mask;
206
207   devcb_call_write8(&i8255a->out_port_func[PORT_C], 0, data);
208}
209
210static void check_interrupt(i8255a_t *i8255a, int port)
211{
212   switch (group_mode(i8255a, port))
213   {
214   case MODE_1:
215      switch (port_mode(i8255a, port))
216      {
217      case MODE_INPUT:
218         if (i8255a->inte[port] && i8255a->ibf[port])
219         {
220            if (LOG) logerror("8255A Port %c INTR: 1\n", 'A' + port);
221
222            i8255a->intr[port] = 1;
223         }
224         break;
225
226      case MODE_OUTPUT:
227         if (i8255a->inte[port] && i8255a->obf[port])
228         {
229            if (LOG) logerror("8255A Port %c INTR: 1\n", 'A' + port);
230
231            i8255a->intr[port] = 1;
232         }
233         break;
234      }
235      break;
236
237   case MODE_2:
238      if ((i8255a->inte1 && i8255a->obf[port]) || (i8255a->inte2 && i8255a->ibf[port]))
239      {
240         if (LOG) logerror("8255A Port %c INTR: 1\n", 'A' + port);
241
242         i8255a->intr[port] = 1;
243      }
244      break;
245   }
246
247   output_pc(i8255a);
248}
249
250static void set_ibf(i8255a_t *i8255a, int port, int state)
251{
252   if (LOG) logerror("8255A Port %c IBF: %u\n", 'A' + port, state);
253
254   i8255a->ibf[port] = state;
255
256   check_interrupt(i8255a, port);
257}
258
259static void set_obf(i8255a_t *i8255a, int port, int state)
260{
261   if (LOG) logerror("8255A Port %c OBF: %u\n", 'A' + port, state);
262
263   i8255a->obf[port] = state;
264
265   check_interrupt(i8255a, port);
266}
267
268static void set_inte(i8255a_t *i8255a, int port, int state)
269{
270   if (LOG) logerror("8255A Port %c INTE: %u\n", 'A' + port, state);
271
272   i8255a->inte[port] = state;
273
274   check_interrupt(i8255a, port);
275}
276
277static void set_inte1(i8255a_t *i8255a, int state)
278{
279   if (LOG) logerror("8255A Port A INTE1: %u\n", state);
280
281   i8255a->inte1 = state;
282
283   check_interrupt(i8255a, PORT_A);
284}
285
286static void set_inte2(i8255a_t *i8255a, int state)
287{
288   if (LOG) logerror("8255A Port A INTE2: %u\n", state);
289
290   i8255a->inte2 = state;
291
292   check_interrupt(i8255a, PORT_A);
293}
294
295static void set_intr(i8255a_t *i8255a, int port, int state)
296{
297   if (LOG) logerror("8255A Port %c INTR: %u\n", 'A' + port, state);
298
299   i8255a->intr[port] = state;
300
301   output_pc(i8255a);
302}
303
304static UINT8 read_mode0(i8255a_t *i8255a, int port)
305{
306   UINT8 data = 0;
307
308   if (port_mode(i8255a, port) == MODE_OUTPUT)
309   {
310      /* read data from output latch */
311      data = i8255a->output[port];
312   }
313   else
314   {
315      /* read data from port */
316      data = devcb_call_read8(&i8255a->in_port_func[port], 0);
317   }
318
319   return data;
320}
321
322static UINT8 read_mode1(i8255a_t *i8255a, int port)
323{
324   UINT8 data = 0;
325
326   if (port_mode(i8255a, port) == MODE_OUTPUT)
327   {
328      /* read data from output latch */
329      data = i8255a->output[port];
330   }
331   else
332   {
333      /* read data from input latch */
334      data = i8255a->input[port];
335
336      /* clear input buffer full flag */
337      set_ibf(i8255a, port, 0);
338
339      /* clear interrupt */
340      set_intr(i8255a, port, 0);
341   }
342
343   return data;
344}
345
346static UINT8 read_mode2(i8255a_t *i8255a)
347{
348   UINT8 data = 0;
349
350   /* read data from input latch */
351   data = i8255a->input[PORT_A];
352
353   /* clear input buffer full flag */
354   set_ibf(i8255a, PORT_A, 0);
355
356   /* clear interrupt */
357   set_intr(i8255a, PORT_A, 0);
358
359   return data;
360}
361
362static UINT8 read_pc(i8255a_t *i8255a)
363{
364   UINT8 data = 0;
365   UINT8 mask = 0;
366
367   /* PC upper */
368   switch (group_mode(i8255a, GROUP_A))
369   {
370   case MODE_0:
371      if (port_c_upper_mode(i8255a) == MODE_OUTPUT)
372      {
373         /* read data from output latch */
374         data |= i8255a->output[PORT_C] & 0xf0;
375      }
376      else
377      {
378         /* read data from port */
379         mask |= 0xf0;
380      }
381      break;
382
383   case MODE_1:
384      data |= i8255a->intr[PORT_A] ? 0x08 : 0x00;
385
386      if (port_mode(i8255a, PORT_A) == MODE_OUTPUT)
387      {
388         data |= i8255a->obf[PORT_A] ? 0x80 : 0x00;
389         data |= i8255a->inte[PORT_A] ? 0x40 : 0x00;
390         mask |= 0x30;
391      }
392      else
393      {
394         data |= i8255a->ibf[PORT_A] ? 0x20 : 0x00;
395         data |= i8255a->inte[PORT_A] ? 0x10 : 0x00;
396         mask |= 0xc0;
397      }
398      break;
399
400   case MODE_2:
401      data |= i8255a->intr[PORT_A] ? 0x08 : 0x00;
402      data |= i8255a->inte2 ? 0x10 : 0x00;
403      data |= i8255a->ibf[PORT_A] ? 0x20 : 0x00;
404      data |= i8255a->inte1 ? 0x40 : 0x00;
405      data |= i8255a->obf[PORT_A] ? 0x80 : 0x00;
406      break;
407   }
408
409   /* PC lower */
410   switch (group_mode(i8255a, GROUP_B))
411   {
412   case MODE_0:
413      if (port_c_lower_mode(i8255a) == MODE_OUTPUT)
414      {
415         /* read data from output latch */
416         data |= i8255a->output[PORT_C] & 0x0f;
417      }
418      else
419      {
420         /* read data from port */
421         mask |= 0x0f;
422      }
423      break;
424
425   case MODE_1:
426      data |= i8255a->inte[PORT_B] ? 0x04 : 0x00;
427      data |= i8255a->intr[PORT_B] ? 0x01 : 0x00;
428
429      if (port_mode(i8255a, PORT_B) == MODE_OUTPUT)
430      {
431         data |= i8255a->obf[PORT_B] ? 0x02 : 0x00;
432      }
433      else
434      {
435         data |= i8255a->ibf[PORT_B] ? 0x02 : 0x00;
436      }
437   }
438
439   if (mask)
440   {
441      /* read data from port */
442      data |= devcb_call_read8(&i8255a->in_port_func[PORT_C], 0) & mask;
443   }
444
445   return data;
446}
447
448READ8_DEVICE_HANDLER( i8255a_r )
449{
450   i8255a_t *i8255a = get_safe_token(device);
451
452   UINT8 data = 0;
453
454   switch (offset & 0x03)
455   {
456   case PORT_A:
457      switch (group_mode(i8255a, GROUP_A))
458      {
459      case MODE_0: data = read_mode0(i8255a, PORT_A); break;
460      case MODE_1: data = read_mode1(i8255a, PORT_A); break;
461      case MODE_2: data = read_mode2(i8255a); break;
462      }
463      if (LOG) logerror("8255A '%s' Port A Read: %02x\n", device->tag, data);
464      break;
465
466   case PORT_B:
467      switch (group_mode(i8255a, GROUP_B))
468      {
469      case MODE_0: data = read_mode0(i8255a, PORT_B); break;
470      case MODE_1: data = read_mode1(i8255a, PORT_B); break;
471      }
472      if (LOG) logerror("8255A '%s' Port B Read: %02x\n", device->tag, data);
473      break;
474
475   case PORT_C:
476      data = read_pc(i8255a);
477      //if (LOG) logerror("8255A '%s' Port C Read: %02x\n", device->tag, data);
478      break;
479
480   case CONTROL:
481      data = i8255a->control;
482      if (LOG) logerror("8255A '%s' Mode Control Word Read: %02x\n", device->tag, data);
483      break;
484   }
485
486   return data;
487}
488
489static void write_mode0(i8255a_t *i8255a, int port, UINT8 data)
490{
491   if (port_mode(i8255a, port) == MODE_OUTPUT)
492   {
493      /* latch output data */
494      i8255a->output[port] = data;
495
496      /* write data to port */
497      devcb_call_write8(&i8255a->out_port_func[port], 0, data);
498   }
499}
500
501static void write_mode1(i8255a_t *i8255a, int port, UINT8 data)
502{
503   if (port_mode(i8255a, port) == MODE_OUTPUT)
504   {
505      /* latch output data */
506      i8255a->output[port] = data;
507
508      /* write data to port */
509      devcb_call_write8(&i8255a->out_port_func[port], 0, data);
510
511      /* set output buffer full flag */
512      set_obf(i8255a, port, 0);
513
514      /* clear interrupt */
515      set_intr(i8255a, port, 0);
516   }
517}
518
519static void write_mode2(i8255a_t *i8255a, UINT8 data)
520{
521   /* latch output data */
522   i8255a->output[PORT_A] = data;
523
524   /* write data to port */
525   devcb_call_write8(&i8255a->out_port_func[PORT_A], 0, data);
526
527   /* set output buffer full flag */
528   set_obf(i8255a, PORT_A, 0);
529
530   /* clear interrupt */
531   set_intr(i8255a, PORT_A, 0);
532}
533
534static void write_pc(i8255a_t *i8255a, UINT8 data)
535{
536   int changed = 0;
537
538   if (group_mode(i8255a, GROUP_A) == MODE_0)
539   {
540      /* PC upper */
541      if (port_c_upper_mode(i8255a) == MODE_OUTPUT)
542      {
543         i8255a->output[PORT_C] = (data & 0xf0) | (i8255a->output[PORT_C] & 0x0f);
544         changed = 1;
545      }
546
547      /* PC lower */
548      if (port_c_lower_mode(i8255a) == MODE_OUTPUT)
549      {
550         i8255a->output[PORT_C] = (i8255a->output[PORT_C] & 0xf0) | (data & 0x0f);
551         changed = 1;
552      }
553   }
554
555   if (changed)
556   {
557      output_pc(i8255a);
558   }
559}
560
561static void set_mode(const device_config *device, UINT8 data)
562{
563   i8255a_t *i8255a = get_safe_token(device);
564
565   i8255a->control = data;
566
567   /* group A */
568   i8255a->output[PORT_A] = 0;
569   i8255a->input[PORT_A] = 0;
570   i8255a->ibf[PORT_A] = 0;
571   i8255a->obf[PORT_A] = 1;
572   i8255a->inte[PORT_A] = 0;
573   i8255a->inte1 = 0;
574   i8255a->inte2 = 0;
575
576   if (LOG) logerror("8255A '%s' Group A Mode: %u\n", device->tag, group_mode(i8255a, GROUP_A));
577   if (LOG) logerror("8255A '%s' Port A Mode: %s\n", device->tag, (port_mode(i8255a, PORT_A) == MODE_OUTPUT) ? "output" : "input");
578   if (LOG) logerror("8255A '%s' Port C Upper Mode: %s\n", device->tag, (port_c_upper_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
579   if (LOG) logerror("8255A '%s' Group B Mode: %u\n", device->tag, group_mode(i8255a, GROUP_B));
580   if (LOG) logerror("8255A '%s' Port B Mode: %s\n", device->tag, (port_mode(i8255a, PORT_B) == MODE_OUTPUT) ? "output" : "input");
581   if (LOG) logerror("8255A '%s' Port C Lower Mode: %s\n", device->tag, (port_c_lower_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
582
583   /* group B */
584   i8255a->output[PORT_B] = 0;
585   i8255a->input[PORT_B] = 0;
586   i8255a->ibf[PORT_B] = 0;
587   i8255a->obf[PORT_B] = 1;
588   i8255a->inte[PORT_B] = 0;
589
590   i8255a->output[PORT_C] = 0;
591   i8255a->input[PORT_C] = 0;
592
593   output_pc(i8255a);
594}
595
596static void set_pc_bit(const device_config *device, int bit, int state)
597{
598   i8255a_t *i8255a = get_safe_token(device);
599
600   /* set output latch bit */
601   i8255a->output[PORT_C] &= ~(1 << bit);
602   i8255a->output[PORT_C] |= state << bit;
603
604   switch (group_mode(i8255a, GROUP_A))
605   {
606   case MODE_1:
607      if (port_mode(i8255a, PORT_A) == MODE_OUTPUT)
608      {
609         switch (bit)
610         {
611         case 3: set_intr(i8255a, PORT_A, state); break;
612         case 6: set_inte(i8255a, PORT_A, state); break;
613         case 7: set_obf(i8255a, PORT_A, state); break;
614         }
615      }
616      else
617      {
618         switch (bit)
619         {
620         case 3: set_intr(i8255a, PORT_A, state); break;
621         case 4: set_inte(i8255a, PORT_A, state); break;
622         case 5: set_ibf(i8255a, PORT_A, state); break;
623         }
624      }
625      break;
626
627   case MODE_2:
628      switch (bit)
629      {
630      case 3: set_intr(i8255a, PORT_A, state); break;
631      case 4: set_inte2(i8255a, state); break;
632      case 5: set_ibf(i8255a, PORT_A, state); break;
633      case 6: set_inte1(i8255a, state); break;
634      case 7: set_obf(i8255a, PORT_A, state); break;
635      }
636      break;
637   }
638
639   if (group_mode(i8255a, GROUP_B) == MODE_1)
640   {
641      switch (bit)
642      {
643      case 0: set_intr(i8255a, PORT_B, state); break;
644      case 1:
645         if (port_mode(i8255a, PORT_B) == MODE_OUTPUT)
646            set_obf(i8255a, PORT_B, state);
647         else
648            set_ibf(i8255a, PORT_B, state);
649         break;
650      case 2: set_inte(i8255a, PORT_B, state); break;
651      }
652   }
653
654   output_pc(i8255a);
655}
656
657WRITE8_DEVICE_HANDLER( i8255a_w )
658{
659   i8255a_t *i8255a = get_safe_token(device);
660
661   switch (offset & 0x03)
662   {
663   case PORT_A:
664      if (LOG) logerror("8255A '%s' Port A Write: %02x\n", device->tag, data);
665
666      switch (group_mode(i8255a, GROUP_A))
667      {
668      case MODE_0: write_mode0(i8255a, PORT_A, data); break;
669      case MODE_1: write_mode1(i8255a, PORT_A, data); break;
670      case MODE_2: write_mode2(i8255a, data); break;
671      }
672      break;
673
674   case PORT_B:
675      if (LOG) logerror("8255A '%s' Port B Write: %02x\n", device->tag, data);
676
677      switch (group_mode(i8255a, GROUP_B))
678      {
679      case MODE_0: write_mode0(i8255a, PORT_B, data); break;
680      case MODE_1: write_mode1(i8255a, PORT_B, data); break;
681      }
682      break;
683
684   case PORT_C:
685      if (LOG) logerror("8255A '%s' Port C Write: %02x\n", device->tag, data);
686
687      write_pc(i8255a, data);
688      break;
689
690   case CONTROL:
691      if (data & I8255A_CONTROL_MODE_SET)
692      {
693         if (LOG) logerror("8255A '%s' Mode Control Word: %02x\n", device->tag, data);
694
695         set_mode(device, data);
696      }
697      else
698      {
699         int bit = (data >> 1) & 0x07;
700         int state = BIT(data, 0);
701
702         if (LOG) logerror("8255A '%s' %s Bit %u\n", device->tag, state ? "Set" : "Reset", bit);
703
704         set_pc_bit(device, bit, state);
705      }
706      break;
707   }
708}
709
710READ8_DEVICE_HANDLER( i8255a_pa_r )
711{
712   i8255a_t *i8255a = get_safe_token(device);
713
714   return i8255a->output[PORT_A];
715}
716
717READ8_DEVICE_HANDLER( i8255a_pb_r )
718{
719   i8255a_t *i8255a = get_safe_token(device);
720
721   return i8255a->output[PORT_B];
722}
723
724WRITE_LINE_DEVICE_HANDLER( i8255a_pc2_w )
725{
726   i8255a_t *i8255a = get_safe_token(device);
727
728   if (group_mode(i8255a, GROUP_B) == 1)
729   {
730      if (port_mode(i8255a, PORT_B) == MODE_OUTPUT)
731      {
732         /* port B acknowledge */
733         if (!i8255a->obf[PORT_B] && !state)
734         {
735            if (LOG) logerror("8255A '%s' Port B Acknowledge\n", device->tag);
736
737            /* clear output buffer flag */
738            set_obf(i8255a, PORT_B, 1);
739         }
740      }
741      else
742      {
743         /* port B strobe */
744         if (!i8255a->ibf[PORT_B] && !state)
745         {
746            if (LOG) logerror("8255A '%s' Port B Strobe\n", device->tag);
747
748            /* read port into latch */
749            i8255a->input[PORT_B] = devcb_call_read8(&i8255a->in_port_func[PORT_B], 0);
750
751            /* set input buffer flag */
752            set_ibf(i8255a, PORT_B, 1);
753         }
754      }
755   }
756}
757
758WRITE_LINE_DEVICE_HANDLER( i8255a_pc4_w )
759{
760   i8255a_t *i8255a = get_safe_token(device);
761
762   if ((group_mode(i8255a, GROUP_A) == 2) || ((group_mode(i8255a, GROUP_A) == 1) && (port_mode(i8255a, PORT_A) == MODE_INPUT)))
763   {
764      /* port A strobe */
765      if (!i8255a->ibf[PORT_A] && !state)
766      {
767         if (LOG) logerror("8255A '%s' Port A Strobe\n", device->tag);
768
769         /* read port into latch */
770         i8255a->input[PORT_A] = devcb_call_read8(&i8255a->in_port_func[PORT_A], 0);
771
772         /* set input buffer flag */
773         set_ibf(i8255a, PORT_A, 1);
774      }
775   }
776}
777
778WRITE_LINE_DEVICE_HANDLER( i8255a_pc6_w )
779{
780   i8255a_t *i8255a = get_safe_token(device);
781
782   if ((group_mode(i8255a, GROUP_A) == 2) || ((group_mode(i8255a, GROUP_A) == 1) && (port_mode(i8255a, PORT_A) == MODE_OUTPUT)))
783   {
784      /* port A acknowledge */
785      if (!i8255a->obf[PORT_A] && !state)
786      {
787         if (LOG) logerror("8255A '%s' Port A Acknowledge\n", device->tag);
788
789         /* clear output buffer flag */
790         set_obf(i8255a, PORT_A, 1);
791      }
792   }
793}
794
795/*-------------------------------------------------
796    DEVICE_START( i8255a )
797-------------------------------------------------*/
798
799static DEVICE_START( i8255a )
800{
801   i8255a_t *i8255a = get_safe_token(device);
802   const i8255a_interface *intf = get_interface(device);
803
804   /* resolve callbacks */
805   devcb_resolve_read8(&i8255a->in_port_func[PORT_A], &intf->in_pa_func, device);
806   devcb_resolve_read8(&i8255a->in_port_func[PORT_B], &intf->in_pb_func, device);
807   devcb_resolve_read8(&i8255a->in_port_func[PORT_C], &intf->in_pc_func, device);
808   devcb_resolve_write8(&i8255a->out_port_func[PORT_A], &intf->out_pa_func, device);
809   devcb_resolve_write8(&i8255a->out_port_func[PORT_B], &intf->out_pb_func, device);
810   devcb_resolve_write8(&i8255a->out_port_func[PORT_C], &intf->out_pc_func, device);
811
812   /* register for state saving */
813   state_save_register_device_item(device, 0, i8255a->control);
814   state_save_register_device_item_array(device, 0, i8255a->output);
815   state_save_register_device_item_array(device, 0, i8255a->input);
816   state_save_register_device_item_array(device, 0, i8255a->ibf);
817   state_save_register_device_item_array(device, 0, i8255a->obf);
818   state_save_register_device_item_array(device, 0, i8255a->inte);
819   state_save_register_device_item(device, 0, i8255a->inte1);
820   state_save_register_device_item(device, 0, i8255a->inte2);
821   state_save_register_device_item_array(device, 0, i8255a->intr);
822}
823
824/*-------------------------------------------------
825    DEVICE_RESET( i8255a )
826-------------------------------------------------*/
827
828static DEVICE_RESET( i8255a )
829{
830   i8255a_w(device, CONTROL, 0x9b);
831}
832
833/*-------------------------------------------------
834    DEVICE_GET_INFO( i8255a )
835-------------------------------------------------*/
836
837DEVICE_GET_INFO( i8255a )
838{
839   switch (state)
840   {
841      /* --- the following bits of info are returned as 64-bit signed integers --- */
842      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(i8255a_t);               break;
843      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
844      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
845
846      /* --- the following bits of info are returned as pointers to data or functions --- */
847      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(i8255a);   break;
848      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
849      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(i8255a);   break;
850
851      /* --- the following bits of info are returned as NULL-terminated strings --- */
852      case DEVINFO_STR_NAME:                     strcpy(info->s, "Intel 8255A");            break;
853      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Intel 8080");            break;
854      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
855      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
856      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright MESS Team");      break;
857   }
858}
src/emu/machine/i8255a.h
r0r5252
1/**********************************************************************
2
3    Intel 8255A Programmable Peripheral Interface emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                   PA3   1 |*    \_/     | 40  PA4
11                   PA2   2 |             | 39  PA5
12                   PA1   3 |             | 38  PA6
13                   PA0   4 |             | 37  PA7
14                   _RD   5 |             | 36  WR
15                   _CS   6 |             | 35  RESET
16                   GND   7 |             | 34  D0
17                    A1   8 |             | 33  D1
18                    A0   9 |             | 32  D2
19                   PC7  10 |    8255A    | 31  D3
20                   PC6  11 |             | 30  D4
21                   PC5  12 |             | 29  D5
22                   PC4  13 |             | 28  D6
23                   PC0  14 |             | 27  D7
24                   PC1  15 |             | 26  Vcc
25                   PC2  16 |             | 25  PB7
26                   PC3  17 |             | 24  PB6
27                   PB0  18 |             | 23  PB5
28                   PB1  19 |             | 22  PB4
29                   PB2  20 |_____________| 21  PB3
30
31**********************************************************************/
32
33#ifndef __I8255A__
34#define __I8255A__
35
36#include "devcb.h"
37
38/***************************************************************************
39    MACROS / CONSTANTS
40***************************************************************************/
41
42#define I8255A      DEVICE_GET_INFO_NAME(i8255a)
43
44#define MDRV_I8255A_ADD(_tag, _intrf) \
45   MDRV_DEVICE_ADD(_tag, I8255A, 0) \
46   MDRV_DEVICE_CONFIG(_intrf)
47
48#define I8255A_INTERFACE(name) \
49   const i8255a_interface (name)=
50
51/***************************************************************************
52    TYPE DEFINITIONS
53***************************************************************************/
54
55typedef struct _i8255a_interface i8255a_interface;
56struct _i8255a_interface
57{
58   devcb_read8         in_pa_func;
59   devcb_read8         in_pb_func;
60   devcb_read8         in_pc_func;
61
62   devcb_write8      out_pa_func;
63   devcb_write8      out_pb_func;
64   devcb_write8      out_pc_func;
65};
66
67/***************************************************************************
68    PROTOTYPES
69***************************************************************************/
70
71/* device interface */
72DEVICE_GET_INFO( i8255a );
73
74/* register access */
75READ8_DEVICE_HANDLER( i8255a_r );
76WRITE8_DEVICE_HANDLER( i8255a_w );
77
78/* port access */
79READ8_DEVICE_HANDLER( i8255a_pa_r );
80READ8_DEVICE_HANDLER( i8255a_pb_r );
81
82/* handshaking signals */
83WRITE_LINE_DEVICE_HANDLER( i8255a_pc2_w );
84WRITE_LINE_DEVICE_HANDLER( i8255a_pc4_w );
85WRITE_LINE_DEVICE_HANDLER( i8255a_pc6_w );
86
87#endif
src/emu/machine/ldv1000.c
r5251r5252
354354   UINT32 lines[3];
355355
356356   /* appears to return data in reverse order */
357   lines[0] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718);
358   lines[1] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE17);
359   lines[2] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16);
357   lines[0] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718, FALSE);
358   lines[1] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE17, FALSE);
359   lines[2] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16, FALSE);
360360
361361   /* fill in the details */
362362   memset(player->vbi, 0, sizeof(player->vbi));
src/emu/crsshair.c
r5251r5252
160160   {
161161      /* look for user specified file */
162162      sprintf(filename, "%s.png", global.name[player]);
163      global.bitmap[player] = render_load_png(OPTION_CRSSHAIRPATH, NULL, filename, NULL, NULL);
163      global.bitmap[player] = render_load_png(OPTION_CROSSHAIRPATH, NULL, filename, NULL, NULL);
164164   }
165165   else
166166   {
167167      /* look for default cross?.png in crsshair\game dir */
168168      sprintf(filename, "cross%d.png", player + 1);
169      global.bitmap[player] = render_load_png(OPTION_CRSSHAIRPATH, machine->gamedrv->name, filename, NULL, NULL);
169      global.bitmap[player] = render_load_png(OPTION_CROSSHAIRPATH, machine->gamedrv->name, filename, NULL, NULL);
170170
171171      /* look for default cross?.png in crsshair dir */
172172      if (global.bitmap[player] == NULL)
173         global.bitmap[player] = render_load_png(OPTION_CRSSHAIRPATH, NULL, filename, NULL, NULL);
173         global.bitmap[player] = render_load_png(OPTION_CROSSHAIRPATH, NULL, filename, NULL, NULL);
174174   }
175175
176176   /* if that didn't work, use the built-in one */
src/emu/fileio.h
r5251r5252
2727***************************************************************************/
2828
2929/* search paths */
30#define SEARCHPATH_RAW         NULL
31#define SEARCHPATH_LANGUAGE      NULL
32#define SEARCHPATH_DEBUGLOG      NULL
30#define SEARCHPATH_RAW             NULL
31#define SEARCHPATH_LANGUAGE        NULL
32#define SEARCHPATH_DEBUGLOG        NULL
3333
34#define SEARCHPATH_ROM         OPTION_ROMPATH
34#define SEARCHPATH_ROM             OPTION_ROMPATH
3535#ifdef MESS
36#define SEARCHPATH_IMAGE      NULL
37#define SEARCHPATH_HASH         OPTION_HASHPATH
36#define SEARCHPATH_IMAGE           NULL
37#define SEARCHPATH_HASH            OPTION_HASHPATH
3838#else
39#define SEARCHPATH_IMAGE      OPTION_ROMPATH
40#define SEARCHPATH_HASH         NULL
39#define SEARCHPATH_IMAGE           OPTION_ROMPATH
40#define SEARCHPATH_HASH            NULL
4141#endif
42#define SEARCHPATH_SAMPLE      OPTION_SAMPLEPATH
43#define SEARCHPATH_ARTWORK      OPTION_ARTPATH
44#define SEARCHPATH_CTRLR      OPTION_CTRLRPATH
45#define SEARCHPATH_INI         OPTION_INIPATH
46#define SEARCHPATH_FONT         OPTION_FONTPATH
47#define SEARCHPATH_CHEAT      OPTION_CHEATPATH
48#define SEARCHPATH_CRSSHAIRPATH   OPTION_CRSSHAIRPATH
42#define SEARCHPATH_SAMPLE          OPTION_SAMPLEPATH
43#define SEARCHPATH_ARTWORK         OPTION_ARTPATH
44#define SEARCHPATH_CTRLR           OPTION_CTRLRPATH
45#define SEARCHPATH_INI             OPTION_INIPATH
46#define SEARCHPATH_FONT            OPTION_FONTPATH
47#define SEARCHPATH_CHEAT           OPTION_CHEATPATH
48#define SEARCHPATH_CROSSHAIRPATH   OPTION_CROSSHAIRPATH
4949
50#define SEARCHPATH_IMAGE_DIFF   OPTION_DIFF_DIRECTORY
51#define SEARCHPATH_NVRAM      OPTION_NVRAM_DIRECTORY
52#define SEARCHPATH_CONFIG      OPTION_CFG_DIRECTORY
53#define SEARCHPATH_INPUTLOG      OPTION_INPUT_DIRECTORY
54#define SEARCHPATH_STATE      OPTION_STATE_DIRECTORY
55#define SEARCHPATH_MEMCARD      OPTION_MEMCARD_DIRECTORY
56#define SEARCHPATH_SCREENSHOT   OPTION_SNAPSHOT_DIRECTORY
57#define SEARCHPATH_MOVIE      OPTION_SNAPSHOT_DIRECTORY
58#define SEARCHPATH_COMMENT      OPTION_COMMENT_DIRECTORY
50#define SEARCHPATH_IMAGE_DIFF      OPTION_DIFF_DIRECTORY
51#define SEARCHPATH_NVRAM           OPTION_NVRAM_DIRECTORY
52#define SEARCHPATH_CONFIG          OPTION_CFG_DIRECTORY
53#define SEARCHPATH_INPUTLOG        OPTION_INPUT_DIRECTORY
54#define SEARCHPATH_STATE           OPTION_STATE_DIRECTORY
55#define SEARCHPATH_MEMCARD         OPTION_MEMCARD_DIRECTORY
56#define SEARCHPATH_SCREENSHOT      OPTION_SNAPSHOT_DIRECTORY
57#define SEARCHPATH_MOVIE           OPTION_SNAPSHOT_DIRECTORY
58#define SEARCHPATH_COMMENT         OPTION_COMMENT_DIRECTORY
5959
6060
6161
src/lib/util/bitmap.c
r5251r5252
243243            }
244244         }
245245         break;
246
247      case 64:
248         /* 64bpp can use memset if the bytes are equal */
249         if ((UINT8)(color >> 8) == (UINT8)color && (UINT16)(color >> 16) == (UINT16)color)
250         {
251            for (y = fill.min_y; y <= fill.max_y; y++)
252               memset(BITMAP_ADDR64(dest, y, fill.min_x), (UINT8)color, (fill.max_x + 1 - fill.min_x) * 4);
253         }
254         else
255         {
256            UINT64 *destrow, *destrow0;
257
258            /* Fill the first line the hard way */
259            destrow  = BITMAP_ADDR64(dest, fill.min_y, 0);
260            for (x = fill.min_x; x <= fill.max_x; x++)
261               destrow[x] = (UINT64)color;
262
263            /* For the other lines, just copy the first one */
264            destrow0 = BITMAP_ADDR64(dest, fill.min_y, fill.min_x);
265            for (y = fill.min_y + 1; y <= fill.max_y; y++)
266            {
267               destrow = BITMAP_ADDR64(dest, y, fill.min_x);
268               memcpy(destrow, destrow0, (fill.max_x + 1 - fill.min_x) * 4);
269            }
270         }
271         break;
246272   }
247273}
248274
r5251r5252
275301      case BITMAP_FORMAT_ARGB32:
276302         return 32;
277303
304      case BITMAP_FORMAT_INDEXED64:
305         return 64;
306
278307      default:
279308         break;
280309   }
src/lib/util/bitmap.h
r5251r5252
2929   BITMAP_FORMAT_INDEXED8,         /* 8bpp indexed */
3030   BITMAP_FORMAT_INDEXED16,      /* 16bpp indexed */
3131   BITMAP_FORMAT_INDEXED32,      /* 32bpp indexed */
32   BITMAP_FORMAT_INDEXED64,      /* 64bpp indexed */
3233   BITMAP_FORMAT_RGB15,         /* 15bpp 5-5-5 RGB */
3334   BITMAP_FORMAT_RGB32,         /* 32bpp 8-8-8 RGB */
3435   BITMAP_FORMAT_ARGB32,         /* 32bpp 8-8-8-8 ARGB */
r5251r5252
7778#define BITMAP_ADDR8(bitmap, y, x)   BITMAP_ADDR(bitmap, UINT8, y, x)
7879#define BITMAP_ADDR16(bitmap, y, x)   BITMAP_ADDR(bitmap, UINT16, y, x)
7980#define BITMAP_ADDR32(bitmap, y, x)   BITMAP_ADDR(bitmap, UINT32, y, x)
81#define BITMAP_ADDR64(bitmap, y, x)   BITMAP_ADDR(bitmap, UINT64, y, x)
8082
8183
8284
src/lib/util/corefile.c
r5251r5252
724724      free(*data);
725725      return FILERR_FAILURE;
726726   }
727
728   /* close the file and return data */
729   core_fclose(file);
727730   return FILERR_NONE;
728731}
729732
src/mess/mess.mak
r5251r5252
275275   $(MESSOBJ)/drc.a \
276276   $(MESSOBJ)/eaca.a \
277277   $(MESSOBJ)/einis.a \
278   $(MESSOBJ)/elektor.a \
278279   $(MESSOBJ)/elektrka.a \
279   $(MESSOBJ)/elektor.a \
280280   $(MESSOBJ)/entex.a \
281281   $(MESSOBJ)/epoch.a \
282282   $(MESSOBJ)/epson.a \
docs/messnew.txt
r5251r5252
111111
112112Source Changes:
113113----------------
114- The core is based on MAME 0.132u4.  This incorporates all features of the
114- The core is based on MAME 0.132u5.  This incorporates all features of the
115115  update to this core.  [MAME team]
116116
117117- Added support for passing around 'deleted address mark' information

Previous 15994 Revisions Next


© 1998-2018 The MESS Team