Previous 15994 Revisions Next

r15189 Wednesday 16th May, 2012 at 03:33:21 UTC by R. Belmont
68681: timers start immediately; only counters wait for the start command. Makes ESQ-1 boot and SQ-1 get past the STOP instruction. (nw)
[src/emu/machine]68681.c

src/emu/machine/68681.c
r15188r15189
562562                  duart68681->duart_timer->adjust(rate, 0, rate);
563563               }
564564               break;
565            case 0x06: /* Timer, CLK/1 */
566               {
567                  attotime rate = attotime::from_hz(2*device->clock()/(2*16*duart68681->CTR.w.l));
568                  duart68681->duart_timer->adjust(rate, 0, rate);
569               }
570               break;
571            case 0x07: /* Timer, CLK/16 */
572               {
573                  //double hz;
574                  //attotime rate = attotime::from_hz(duart68681->clock) * (16*duart68681->CTR.w.l);
575                  attotime rate = attotime::from_hz(2*device->clock()/(2*16*16*duart68681->CTR.w.l));
576                  //hz = ATTOSECONDS_TO_HZ(rate.attoseconds);
577
578                  // workaround for maygay1b locking up MAME
579                  if ((2*device->clock()/(2*16*16*duart68681->CTR.w.l)) == 0)
580                  {
581                     rate = attotime::from_hz(1);
582                  }
583
584                  duart68681->duart_timer->adjust(rate, 0, rate);
585               }
586               break;
587565         }
588566         break;
589567      case 0x0f: /* Stop counter command */
r15188r15189
631609            case 0: case 1: case 2: case 4: case 5: // TODO: handle these cases!
632610            logerror( "68681 (%s): Unhandled timer/counter mode %d\n", device->tag(), (data >> 4) & 0x07);
633611            break;
634            case 3: case 6: case 7:
612         case 3:
635613            break;
614            case 0x06: /* Timer, CLK/1 */       // Timer modes start without reading address 0xe, as per the Freescale 68681 manual
615                {
616                    attotime rate = attotime::from_hz(2*device->clock()/(2*16*duart68681->CTR.w.l));
617                    duart68681->duart_timer->adjust(rate, 0, rate);
618                }
619                break;
620            case 0x07: /* Timer, CLK/16 */
621                {
622                    //double hz;
623                    //attotime rate = attotime::from_hz(duart68681->clock) * (16*duart68681->CTR.w.l);
624                    attotime rate = attotime::from_hz(2*device->clock()/(2*16*16*duart68681->CTR.w.l));
625                    //hz = ATTOSECONDS_TO_HZ(rate.attoseconds);
626
627                    // workaround for maygay1b locking up MAME
628                    if ((2*device->clock()/(2*16*16*duart68681->CTR.w.l)) == 0)
629                    {
630                        rate = attotime::from_hz(1);
631                    }
632
633                    duart68681->duart_timer->adjust(rate, 0, rate);
634                }
635                break;
636636         }
637637         duart68681_write_CSR(duart68681, 0, duart68681->channel[0].CSR, data);
638638         duart68681_write_CSR(duart68681, 1, duart68681->channel[1].CSR, data);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team