Previous 199869 Revisions Next

r19762 Monday 24th December, 2012 at 00:47:14 UTC by David Haywood
refactor the type1 dongle code a bit, to make any future additions easier (nw)
[src/mame/includes]decocass.h
[src/mame/machine]decocass.c

trunk/src/mame/machine/decocass.c
r19761r19762
2121   ((UINT32)(m6) << 18) | \
2222   ((UINT32)(m7) << 21)
2323
24#define MAP0(m) ((m)&7)
25#define MAP1(m) (((m)>>3)&7)
26#define MAP2(m) (((m)>>6)&7)
27#define MAP3(m) (((m)>>9)&7)
28#define MAP4(m) (((m)>>12)&7)
29#define MAP5(m) (((m)>>15)&7)
30#define MAP6(m) (((m)>>18)&7)
31#define MAP7(m) (((m)>>21)&7)
3224
25#define T1MAP(x, m) (((m)>>(x*3))&7)
3326
27
28
3429enum {
3530   TYPE3_SWAP_01,
3631   TYPE3_SWAP_12,
r19761r19762
238233}
239234#endif
240235
241/***************************************************************************
242 *
243 *  TYPE1 DONGLE (DE-0061)
244 *  - Terranian
245 *  - Super Astro Fighter
246 *  - Lock 'n Chase
247 *  - Pro Golf
248 *  - Lucky Poker
249 *  - Treasure Island
250 *
251 * Latch bits 2 and 6, pass bit 3, invert bit 2.
252 * Lookup PROM DE-0061 using bits 0, 1, 4, 5, and 7 as the
253 * address bits; take PROM data 0-4 as data bits 0, 1, 4, 5, and 7.
254 *
255 ***************************************************************************/
256236
257READ8_MEMBER(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r)
237READ8_MEMBER(decocass_state::decocass_type1_r)
258238{
239   if (!m_type1_map)
240      return 0x00;
241
259242   UINT8 data;
260243
261244   if (1 == (offset & 1))
r19761r19762
266249         data = 0xff;
267250
268251      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
269      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
252      LOG(4,("%10s 6502-PC: %04x decocass_type1_r(%02x): $%02x <- (%s %s)\n",
270253         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
271254         (data & 1) ? "OBF" : "-",
272255         (data & 2) ? "IBF" : "-"));
r19761r19762
297280
298281      save = data;   /* save the unmodifed data for the latch */
299282
300      promaddr =
301         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
302         (((data >> MAP1(m_type1_inmap)) & 1) << 1) |
303         (((data >> MAP4(m_type1_inmap)) & 1) << 2) |
304         (((data >> MAP5(m_type1_inmap)) & 1) << 3) |
305         (((data >> MAP7(m_type1_inmap)) & 1) << 4);
306      /* latch bits 2 and 6, pass bit 3, invert bit 2 */
307      data =
308         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
309         (((prom[promaddr] >> 1) & 1)            << MAP1(m_type1_outmap)) |
310         ((1 - ((m_latch1 >> MAP2(m_type1_inmap)) & 1)) << MAP2(m_type1_outmap)) |
311         (((data >> MAP3(m_type1_inmap)) & 1)         << MAP3(m_type1_outmap)) |
312         (((prom[promaddr] >> 2) & 1)            << MAP4(m_type1_outmap)) |
313         (((prom[promaddr] >> 3) & 1)            << MAP5(m_type1_outmap)) |
314         (((m_latch1 >> MAP6(m_type1_inmap)) & 1)      << MAP6(m_type1_outmap)) |
315         (((prom[promaddr] >> 4) & 1)            << MAP7(m_type1_outmap));
283      promaddr = 0;
284      int promshift = 0;
316285
317      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n",
286      for (int i=0;i<8;i++)
287      {
288         if (m_type1_map[i] == T1PROM) { promaddr |=   (((data >> T1MAP(i,m_type1_inmap)) & 1) << promshift); promshift++; }
289      }
290
291      if (promshift!=5)
292         printf("promshift != 5? (you specified more/less than 5 prom source bits)");
293
294      data = 0;
295      promshift = 0;
296
297      for (int i=0;i<8;i++)
298      {
299         if (m_type1_map[i] == T1PROM)      { data |= (((prom[promaddr] >> promshift) & 1)            << T1MAP(i,m_type1_outmap)); promshift++; }
300         if (m_type1_map[i] == T1LATCHINV) { data |= ((1 - ((m_latch1 >> T1MAP(i,m_type1_inmap)) & 1)) << T1MAP(i,m_type1_outmap)); }
301         if (m_type1_map[i] == T1LATCH)    { data |= (((m_latch1 >> T1MAP(i,m_type1_inmap)) & 1)      << T1MAP(i,m_type1_outmap)); }
302         if (m_type1_map[i] == T1DIRECT)   { data |= (((save >> T1MAP(i,m_type1_inmap)) & 1)         << T1MAP(i,m_type1_outmap)); }
303      }
304   
305      LOG(3,("%10s 6502-PC: %04x decocass_type1_r(%02x): $%02x\n",
318306         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
319307
320308      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
r19761r19762
322310   return data;
323311}
324312
313/***************************************************************************
314 *
315 *  TYPE1 DONGLE (DE-0061)
316 *  - Terranian
317 *  - Super Astro Fighter
318 *  - Lock 'n Chase
319 *  - Pro Golf
320 *  - Lucky Poker
321 *  - Treasure Island
322 *
323 * Latch bits 2 and 6, pass bit 3, invert bit 2.
324 * Lookup PROM DE-0061 using bits 0, 1, 4, 5, and 7 as the
325 * address bits; take PROM data 0-4 as data bits 0, 1, 4, 5, and 7.
326 *
327 ***************************************************************************/
325328
329static UINT8 type1_latch_26_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM, T1PROM,T1LATCH,T1PROM };
330
326331/***************************************************************************
327332 *
328333 *  TYPE1 DONGLE (DE-0061)
r19761r19762
333338 *
334339 ***************************************************************************/
335340
336READ8_MEMBER(decocass_state::decocass_type1_pass_136_r)
337{
338   UINT8 data;
341static UINT8 type1_pass_136_table[8] ={ T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1PROM,T1DIRECT,T1PROM };
339342
340   if (1 == (offset & 1))
341   {
342      if (0 == (offset & E5XX_MASK))
343         data = upi41_master_r(m_mcu, 1);
344      else
345         data = 0xff;
346
347      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
348      LOG(4,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n",
349         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
350         (data & 1) ? "OBF" : "-",
351         (data & 2) ? "IBF" : "-"));
352   }
353   else
354   {
355      offs_t promaddr;
356      UINT8 save;
357      UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
358
359      if (m_firsttime)
360      {
361         LOG(3,("prom data:\n"));
362         for (promaddr = 0; promaddr < 32; promaddr++)
363         {
364            if (promaddr % 8 == 0)
365               LOG(3,("  %02x:", promaddr));
366            LOG(3,(" %02x%s", prom[promaddr], (promaddr % 8) == 7 ? "\n" : ""));
367         }
368         m_firsttime = 0;
369         m_latch1 = 0;    /* reset latch (??) */
370      }
371
372      if (0 == (offset & E5XX_MASK))
373         data = upi41_master_r(m_mcu, 0);
374      else
375         data = 0xff;
376
377      save = data;   /* save the unmodifed data for the latch */
378
379      promaddr =
380         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
381         (((data >> MAP2(m_type1_inmap)) & 1) << 1) |
382         (((data >> MAP4(m_type1_inmap)) & 1) << 2) |
383         (((data >> MAP5(m_type1_inmap)) & 1) << 3) |
384         (((data >> MAP7(m_type1_inmap)) & 1) << 4);
385      /* latch bits 1 and 6, pass bit 3, invert bit 1 */
386      data =
387         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
388         (((data >> MAP1(m_type1_inmap)) & 1)         << MAP1(m_type1_outmap)) |
389         (((prom[promaddr] >> 1) & 1)            << MAP2(m_type1_outmap)) |
390         (((data >> MAP3(m_type1_inmap)) & 1)         << MAP3(m_type1_outmap)) |
391         (((prom[promaddr] >> 2) & 1)            << MAP4(m_type1_outmap)) |
392         (((prom[promaddr] >> 3) & 1)            << MAP5(m_type1_outmap)) |
393         (((data >> MAP6(m_type1_inmap)) & 1)          << MAP6(m_type1_outmap)) |
394         (((prom[promaddr] >> 4) & 1)            << MAP7(m_type1_outmap));
395
396      LOG(3,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n",
397         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
398
399      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
400   }
401   return data;
402}
403
404
405343/***************************************************************************
406344 *
407345 *  TYPE1 DONGLE (DE-0061)
r19761r19762
413351 *
414352 ***************************************************************************/
415353
416READ8_MEMBER(decocass_state::decocass_type1_latch_xab_pass_x54_r)
417{
418   UINT8 data;
354static UINT8 type1_latch_xab_pass_x54_table[8] = { T1PROM,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM,T1DIRECT,T1PROM };
419355
420   if (1 == (offset & 1))
421   {
422      if (0 == (offset & E5XX_MASK))
423         data = upi41_master_r(m_mcu, 1);
424      else
425         data = 0xff;
426
427      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
428      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
429         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
430         (data & 1) ? "OBF" : "-",
431         (data & 2) ? "IBF" : "-"));
432   }
433   else
434   {
435      offs_t promaddr;
436      UINT8 save;
437      UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
438
439      if (m_firsttime)
440      {
441         LOG(3,("prom data:\n"));
442         for (promaddr = 0; promaddr < 32; promaddr++)
443         {
444            if (promaddr % 8 == 0)
445               LOG(3,("  %02x:", promaddr));
446            LOG(3,(" %02x%s", prom[promaddr], (promaddr % 8) == 7 ? "\n" : ""));
447         }
448         m_firsttime = 0;
449         m_latch1 = 0;    /* reset latch (??) */
450      }
451
452      if (0 == (offset & E5XX_MASK))
453         data = upi41_master_r(m_mcu, 0);
454      else
455         data = 0xff;
456
457      save = data;   /* save the unmodifed data for the latch */
458
459      /* AB 10101011 */
460      promaddr =
461         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
462         (((data >> MAP1(m_type1_inmap)) & 1) << 1) |
463         (((data >> MAP3(m_type1_inmap)) & 1) << 2) |
464         (((data >> MAP5(m_type1_inmap)) & 1) << 3) |
465         (((data >> MAP7(m_type1_inmap)) & 1) << 4);
466      /* no latch, pass bit 0x54 */
467      data =
468         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
469         (((prom[promaddr] >> 1) & 1)            << MAP1(m_type1_outmap)) |
470         (((data >> MAP2(m_type1_inmap)) & 1)         << MAP2(m_type1_outmap)) |
471         (((prom[promaddr] >> 2) & 1)            << MAP3(m_type1_outmap)) |
472         (((data >> MAP4(m_type1_inmap)) & 1)         << MAP4(m_type1_outmap))  |
473         (((prom[promaddr] >> 3) & 1)            << MAP5(m_type1_outmap)) |
474         (((data >> MAP6(m_type1_inmap)) & 1)         << MAP6(m_type1_outmap)) |
475         (((prom[promaddr] >> 4) & 1)            << MAP7(m_type1_outmap));
476
477      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
478         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
479
480      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
481   }
482   return data;
483}
484
485
486356/***************************************************************************
487357 *
488358 *  TYPE1 DONGLE (DE-0061)
r19761r19762
494364 *
495365 ***************************************************************************/
496366
497READ8_MEMBER(decocass_state::decocass_type1_latch_27_pass_3_inv_2_r)
498{
499   UINT8 data;
367static UINT8 type1_latch_27_pass_3_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1DIRECT,T1PROM,T1PROM,T1PROM,T1LATCH };
500368
501   if (1 == (offset & 1))
502   {
503      if (0 == (offset & E5XX_MASK))
504         data = upi41_master_r(m_mcu, 1);
505      else
506         data = 0xff;
507
508      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
509      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
510         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
511         (data & 1) ? "OBF" : "-",
512         (data & 2) ? "IBF" : "-"));
513   }
514   else
515   {
516      offs_t promaddr;
517      UINT8 save;
518      UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
519
520      if (m_firsttime)
521      {
522         LOG(3,("prom data:\n"));
523         for (promaddr = 0; promaddr < 32; promaddr++)
524         {
525            if (promaddr % 8 == 0)
526               LOG(3,("  %02x:", promaddr));
527            LOG(3,(" %02x%s", prom[promaddr], (promaddr % 8) == 7 ? "\n" : ""));
528         }
529         m_firsttime = 0;
530         m_latch1 = 0;    /* reset latch (??) */
531      }
532
533      if (0 == (offset & E5XX_MASK))
534         data = upi41_master_r(m_mcu, 0);
535      else
536         data = 0xff;
537
538      save = data;   /* save the unmodifed data for the latch */
539
540      promaddr =
541         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
542         (((data >> MAP1(m_type1_inmap)) & 1) << 1) |
543         (((data >> MAP4(m_type1_inmap)) & 1) << 2) |
544         (((data >> MAP5(m_type1_inmap)) & 1) << 3) |
545         (((data >> MAP6(m_type1_inmap)) & 1) << 4);
546      /* latch bits 2 and 7, pass bit 3, invert bit 2 */
547      data =
548         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
549         (((prom[promaddr] >> 1) & 1)            << MAP1(m_type1_outmap)) |
550         ((1 - ((m_latch1 >> MAP2(m_type1_inmap)) & 1)) << MAP2(m_type1_outmap)) |
551         (((data >> MAP3(m_type1_inmap)) & 1)         << MAP3(m_type1_outmap)) |
552         (((prom[promaddr] >> 2) & 1)            << MAP4(m_type1_outmap)) |
553         (((prom[promaddr] >> 3) & 1)            << MAP5(m_type1_outmap)) |
554         (((prom[promaddr] >> 4) & 1)            << MAP6(m_type1_outmap)) |
555         (((m_latch1 >> MAP7(m_type1_inmap)) & 1)      << MAP7(m_type1_outmap));
556
557      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
558         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
559
560      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
561   }
562   return data;
563}
564
565369/***************************************************************************
566370 *
567371 *  TYPE1 DONGLE (DE-0061)
r19761r19762
573377 *
574378 ***************************************************************************/
575379
576READ8_MEMBER(decocass_state::decocass_type1_latch_26_pass_5_inv_2_r)
577{
578   UINT8 data;
380static UINT8 type1_latch_26_pass_5_inv_2_table[8] = { T1PROM,T1PROM,T1LATCHINV,T1PROM,T1PROM,T1DIRECT,T1LATCH,T1PROM };
579381
580   if (1 == (offset & 1))
581   {
582      if (0 == (offset & E5XX_MASK))
583         data = upi41_master_r(m_mcu, 1);
584      else
585         data = 0xff;
586
587      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
588      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n",
589         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
590         (data & 1) ? "OBF" : "-",
591         (data & 2) ? "IBF" : "-"));
592   }
593   else
594   {
595      offs_t promaddr;
596      UINT8 save;
597      UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
598
599      if (m_firsttime)
600      {
601         LOG(3,("prom data:\n"));
602         for (promaddr = 0; promaddr < 32; promaddr++)
603         {
604            if (promaddr % 8 == 0)
605               LOG(3,("  %02x:", promaddr));
606            LOG(3,(" %02x%s", prom[promaddr], (promaddr % 8) == 7 ? "\n" : ""));
607         }
608         m_firsttime = 0;
609         m_latch1 = 0;    /* reset latch (??) */
610      }
611
612      if (0 == (offset & E5XX_MASK))
613         data = upi41_master_r(m_mcu, 0);
614      else
615         data = 0xff;
616
617      save = data;   /* save the unmodifed data for the latch */
618
619      promaddr =
620         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
621         (((data >> MAP1(m_type1_inmap)) & 1) << 1) |
622         (((data >> MAP3(m_type1_inmap)) & 1) << 2) |
623         (((data >> MAP4(m_type1_inmap)) & 1) << 3) |
624         (((data >> MAP7(m_type1_inmap)) & 1) << 4);
625      /* latch bits 2 and 6, pass bit 5, invert bit 2 */
626      data =
627         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
628         (((prom[promaddr] >> 1) & 1)            << MAP1(m_type1_outmap)) |
629         ((1 - ((m_latch1 >> MAP2(m_type1_inmap)) & 1)) << MAP2(m_type1_outmap)) |
630         (((prom[promaddr] >> 2) & 1)            << MAP3(m_type1_outmap)) |
631         (((prom[promaddr] >> 3) & 1)            << MAP4(m_type1_outmap)) |
632         (((data >> MAP5(m_type1_inmap)) & 1)         << MAP5(m_type1_outmap)) |
633         (((m_latch1 >> MAP6(m_type1_inmap)) & 1)         << MAP6(m_type1_outmap)) |
634         (((prom[promaddr] >> 4) & 1)            << MAP7(m_type1_outmap));
635
636      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n",
637         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
638
639      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
640   }
641   return data;
642}
643
644
645
646382/***************************************************************************
647383 *
648384 *  TYPE1 DONGLE (DE-0061)
r19761r19762
654390 *
655391 ***************************************************************************/
656392
657READ8_MEMBER(decocass_state::decocass_type1_latch_16_pass_3_inv_1_r)
658{
659   UINT8 data;
393static UINT8 type1_latch_16_pass_3_inv_1_table[8] = { T1PROM,T1LATCHINV,T1PROM,T1DIRECT,T1PROM,T1PROM,T1LATCH,T1PROM };
660394
661   if (1 == (offset & 1))
662   {
663      if (0 == (offset & E5XX_MASK))
664         data = upi41_master_r(m_mcu, 1);
665      else
666         data = 0xff;
667
668      data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
669      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n",
670         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data,
671         (data & 1) ? "OBF" : "-",
672         (data & 2) ? "IBF" : "-"));
673   }
674   else
675   {
676      offs_t promaddr;
677      UINT8 save;
678      UINT8 *prom = space.machine().root_device().memregion("dongle")->base();
679
680      if (m_firsttime)
681      {
682         LOG(3,("prom data:\n"));
683         for (promaddr = 0; promaddr < 32; promaddr++)
684         {
685            if (promaddr % 8 == 0)
686               LOG(3,("  %02x:", promaddr));
687            LOG(3,(" %02x%s", prom[promaddr], (promaddr % 8) == 7 ? "\n" : ""));
688         }
689         m_firsttime = 0;
690         m_latch1 = 0;    /* reset latch (??) */
691      }
692
693      if (0 == (offset & E5XX_MASK))
694         data = upi41_master_r(m_mcu, 0);
695      else
696         data = 0xff;
697
698      save = data;   /* save the unmodifed data for the latch */
699
700      promaddr =
701         (((data >> MAP0(m_type1_inmap)) & 1) << 0) |
702         (((data >> MAP2(m_type1_inmap)) & 1) << 1) |
703         (((data >> MAP4(m_type1_inmap)) & 1) << 2) |
704         (((data >> MAP5(m_type1_inmap)) & 1) << 3) |
705         (((data >> MAP7(m_type1_inmap)) & 1) << 4);
706      /* latch bits 1 and 6, pass bit 3, invert bit 1 */
707      data =
708         (((prom[promaddr] >> 0) & 1)            << MAP0(m_type1_outmap)) |
709         ((1 - ((m_latch1 >> MAP1(m_type1_inmap)) & 1)) << MAP1(m_type1_outmap)) |
710         (((prom[promaddr] >> 1) & 1)            << MAP2(m_type1_outmap)) |
711         (((data >> MAP3(m_type1_inmap)) & 1)         << MAP3(m_type1_outmap)) |
712         (((prom[promaddr] >> 2) & 1)            << MAP4(m_type1_outmap)) |
713         (((prom[promaddr] >> 3) & 1)            << MAP5(m_type1_outmap)) |
714         (((m_latch1 >> MAP6(m_type1_inmap)) & 1)      << MAP6(m_type1_outmap)) |
715         (((prom[promaddr] >> 4) & 1)            << MAP7(m_type1_outmap));
716
717      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n",
718         space.machine().time().as_string(6), space.device().safe_pcbase(), offset, data));
719
720      m_latch1 = save;      /* latch the data for the next A0 == 0 read */
721   }
722   return data;
723}
724
725
726
727
728395/***************************************************************************
729396 *
730397 *  TYPE2 DONGLE (CS82-007)
r19761r19762
14511118{
14521119   decocass_state::machine_reset();
14531120   LOG(0,("dongle type #1 (DE-0061)\n"));
1454   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_pass_136_r),this);
1121   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1122   m_type1_map = type1_pass_136_table;
14551123}
14561124
14571125MACHINE_RESET_MEMBER(decocass_state,chwy)
14581126{
14591127   decocass_state::machine_reset();
14601128   LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
1461   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_27_pass_3_inv_2_r),this);
1129   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1130   m_type1_map = type1_latch_27_pass_3_inv_2_table;
14621131}
14631132
14641133MACHINE_RESET_MEMBER(decocass_state,cdsteljn)
14651134{
14661135   decocass_state::machine_reset();
14671136   LOG(0,("dongle type #1 (A-0061)\n"));
1468   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_27_pass_3_inv_2_r),this);
1137   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1138   m_type1_map = type1_latch_27_pass_3_inv_2_table;
14691139}
14701140
14711141MACHINE_RESET_MEMBER(decocass_state,cterrani)
14721142{
14731143   decocass_state::machine_reset();
14741144   LOG(0,("dongle type #1 (DE-0061 straight)\n"));
1475   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1145   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1146   m_type1_map = type1_latch_26_pass_3_inv_2_table;
14761147   m_type1_inmap = MAKE_MAP(0,1,2,3,4,5,6,7);
14771148   m_type1_outmap = MAKE_MAP(0,1,2,3,4,5,6,7);
14781149}
r19761r19762
14811152{
14821153   decocass_state::machine_reset();
14831154   LOG(0,("dongle type #1 (DE-0061)\n"));
1484   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_16_pass_3_inv_1_r),this);
1155   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1156   m_type1_map = type1_latch_16_pass_3_inv_1_table;
14851157}
14861158
14871159MACHINE_RESET_MEMBER(decocass_state,csuperas)
14881160{
14891161   decocass_state::machine_reset();
14901162   LOG(0,("dongle type #1 (DE-0061 flip 4-5)\n"));
1491   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1163   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1164   m_type1_map = type1_latch_26_pass_3_inv_2_table;
14921165   m_type1_inmap = MAKE_MAP(0,1,2,3,5,4,6,7);
14931166   m_type1_outmap = MAKE_MAP(0,1,2,3,5,4,6,7);
14941167}
r19761r19762
14971170{
14981171   decocass_state::machine_reset();
14991172   LOG(0,("dongle type #1 (DE-0061)\n"));
1500   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_xab_pass_x54_r),this);
1501//   m_type1_inmap = MAKE_MAP(0,1,2,3,5,4,6,7);
1502//   m_type1_outmap = MAKE_MAP(0,1,2,3,5,4,6,7);
1173   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1174   m_type1_map = type1_latch_xab_pass_x54_table;
15031175}
15041176
15051177MACHINE_RESET_MEMBER(decocass_state,clocknch)
15061178{
15071179   decocass_state::machine_reset();
15081180   LOG(0,("dongle type #1 (DE-0061 flip 2-3)\n"));
1509   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1181   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1182   m_type1_map = type1_latch_26_pass_3_inv_2_table;
15101183   m_type1_inmap = MAKE_MAP(0,1,3,2,4,5,6,7);
15111184   m_type1_outmap = MAKE_MAP(0,1,3,2,4,5,6,7);
15121185}
r19761r19762
15151188{
15161189   decocass_state::machine_reset();
15171190   LOG(0,("dongle type #1 (DE-0061 flip 0-1)\n"));
1518   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1191   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1192   m_type1_map = type1_latch_26_pass_3_inv_2_table;
15191193   m_type1_inmap = MAKE_MAP(1,0,2,3,4,5,6,7);
15201194   m_type1_outmap = MAKE_MAP(1,0,2,3,4,5,6,7);
15211195}
r19761r19762
15241198{
15251199   decocass_state::machine_reset();
15261200   LOG(0,("dongle type #1 (A-0061 flip 0-1)\n"));
1527   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1201   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1202   m_type1_map = type1_latch_26_pass_3_inv_2_table;
15281203   m_type1_inmap = MAKE_MAP(1,0,2,3,4,5,6,7);
15291204   m_type1_outmap = MAKE_MAP(1,0,2,3,4,5,6,7);
15301205}
r19761r19762
15331208{
15341209   decocass_state::machine_reset();
15351210   LOG(0,("dongle type #1 (DE-0061 flip 1-3)\n"));
1536   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1211   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1212   m_type1_map = type1_latch_26_pass_3_inv_2_table;
15371213   m_type1_inmap = MAKE_MAP(0,3,2,1,4,5,6,7);
15381214   m_type1_outmap = MAKE_MAP(0,3,2,1,4,5,6,7);
15391215}
r19761r19762
15421218{
15431219   decocass_state::machine_reset();
15441220   LOG(0,("dongle type #1 (DE-0061 flip 0-2)\n"));
1545   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_3_inv_2_r),this);
1221   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1222   m_type1_map = type1_latch_26_pass_3_inv_2_table;
15461223   m_type1_inmap = MAKE_MAP(2,1,0,3,4,5,6,7);
15471224   m_type1_outmap = MAKE_MAP(2,1,0,3,4,5,6,7);
15481225}
r19761r19762
15511228{
15521229   decocass_state::machine_reset();
15531230   LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
1554   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_latch_26_pass_5_inv_2_r),this);
1231   m_dongle_r = read8_delegate(FUNC(decocass_state::decocass_type1_r),this);
1232   m_type1_map = type1_latch_26_pass_5_inv_2_table;
15551233}
15561234
15571235MACHINE_RESET_MEMBER(decocass_state,cdiscon1)
trunk/src/mame/includes/decocass.h
r19761r19762
77
88#include "machine/decocass_tape.h"
99
10#define T1PROM 1
11#define T1DIRECT 2
12#define T1LATCH 4
13#define T1LATCHINV 8
14
1015class decocass_state : public driver_device
1116{
1217public:
r19761r19762
2227        m_colorram(*this, "colorram"),
2328        m_tileram(*this, "tileram"),
2429        m_objectram(*this, "objectram"),
25        m_paletteram(*this, "paletteram") { }
30        m_paletteram(*this, "paletteram")
31   {
32      m_type1_map = 0;
33   }
2634
2735   /* devices */
2836   required_device<cpu_device> m_maincpu;
r19761r19762
226234   DECLARE_WRITE8_MEMBER(cdsteljn_mux_w);
227235   TIMER_DEVICE_CALLBACK_MEMBER(decocass_audio_nmi_gen);
228236private:
229   DECLARE_READ8_MEMBER(decocass_type1_latch_26_pass_3_inv_2_r);
230   DECLARE_READ8_MEMBER(decocass_type1_pass_136_r);
231   DECLARE_READ8_MEMBER(decocass_type1_latch_27_pass_3_inv_2_r);
232   DECLARE_READ8_MEMBER(decocass_type1_latch_26_pass_5_inv_2_r);
233   DECLARE_READ8_MEMBER(decocass_type1_latch_16_pass_3_inv_1_r);
234   DECLARE_READ8_MEMBER(decocass_type1_latch_xab_pass_x54_r);
237   DECLARE_READ8_MEMBER(decocass_type1_r);
235238   DECLARE_READ8_MEMBER(decocass_type2_r);
236239   DECLARE_WRITE8_MEMBER(decocass_type2_w);
237240   DECLARE_READ8_MEMBER(decocass_type3_r);
r19761r19762
242245   DECLARE_WRITE8_MEMBER(decocass_type5_w);
243246   DECLARE_READ8_MEMBER(decocass_nodong_r);
244247
248   UINT8* m_type1_map;
249
245250   void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect);
246251   void draw_center(bitmap_ind16 &bitmap, const rectangle &cliprect);
247252   void mark_bg_tile_dirty(offs_t offset);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team