Previous 199869 Revisions Next

r20971 Tuesday 12th February, 2013 at 02:34:17 UTC by Ville Linde
video/jaguar.c: Fixed PIT functionality (fixes Tempest 2000 controls). (nw)
[src/mame/video]jaguar.c

trunk/src/mame/video/jaguar.c
r20970r20971
617617         case PIT1:
618618            if (m_gpu_regs[PIT0] && m_gpu_regs[PIT0] != 0xffff) //FIXME: avoid too much small timers for now
619619            {
620               sample_period = attotime::from_nsec(((m_gpu->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+m_gpu_regs[PIT0])) / (1+m_gpu_regs[PIT1]));
620               sample_period = attotime::from_ticks((1+m_gpu_regs[PIT0]) * (1+m_gpu_regs[PIT1]), JAGUAR_CLOCK);
621621               timer_set(sample_period, TID_PIT);
622622            }
623623            break;
r20970r20971
723723         break;
724724
725725      case TID_PIT:
726         m_cpu_irq_state |= 4;
727         update_cpu_irq();
726         if (m_gpu_regs[INT1] & 0x8)
727         {
728            m_cpu_irq_state |= 8;
729            update_cpu_irq();
730         }
728731         if (m_gpu_regs[PIT0] != 0)
729732         {
730            attotime sample_period = attotime::from_nsec(((m_gpu->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+m_gpu_regs[PIT0])) / (1+m_gpu_regs[PIT1]));
733            attotime sample_period = attotime::from_ticks((1+m_gpu_regs[PIT0]) * (1+m_gpu_regs[PIT1]), JAGUAR_CLOCK);
731734            timer_set(sample_period, TID_PIT);
732735         }
733736         break;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team