Previous 15994 Revisions Next

r8815 Friday 20th August, 2010 at 13:59:43 UTC by Angelo Salese
[JAGUAR]: Added PIT irq, needed to let Pitfall to enter into gameplay
[src/mame/video]jaguar.c

src/mame/video/jaguar.c
r8814r8815
673673   return gpu_regs[offset];
674674}
675675
676#if 0
676/*
677FIXME: this should be 1, but then MAME performance will be s*** with this (i.e. it drops the performance from 400% to 6% on an i5 machine).
678But the PIT irq is definitely needed by some games (for example Pitfall refuses to enter into gameplay without this enabled).
679*/
680#define PIT_MULT_DBG_HACK 64
681
677682static TIMER_CALLBACK( jaguar_pit )
678683{
679684   attotime sample_period;
r8814r8815
682687
683688   if (gpu_regs[PIT0])
684689   {
685      sample_period = ATTOTIME_IN_NSEC(machine->device("gpu")->unscaled_clock() / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
686//      timer_set(machine, sample_period, NULL, 0, jaguar_pit);
690      sample_period = ATTOTIME_IN_NSEC(((machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
691      timer_set(machine, sample_period, NULL, 0, jaguar_pit);
687692   }
688693}
689#endif
690694
695
691696WRITE16_HANDLER( jaguar_tom_regs_w )
692697{
693698   UINT32 reg_store = gpu_regs[offset];
694//  attotime sample_period;
699   attotime sample_period;
695700   if (offset < GPU_REGS)
696701   {
697702      COMBINE_DATA(&gpu_regs[offset]);
r8814r8815
705710            break;
706711         case PIT0:
707712         case PIT1:
708            if(gpu_regs[PIT0] && reg_store != gpu_regs[offset])
709               printf("Warning: PIT irq used\n");
710            break;
711#if 0
712         case PIT1:
713713            if (gpu_regs[PIT0])
714714            {
715               sample_period = ATTOTIME_IN_NSEC(space->machine->device("gpu")->unscaled_clock() / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1]));
715               sample_period = ATTOTIME_IN_NSEC(((space->machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
716               //printf("%08x %08x",gpu_regs[PIT0]+1,gpu_regs[PIT1]+1);
716717               timer_set(space->machine, sample_period, NULL, 0, jaguar_pit);
717718            }
718719            break;
719#endif
720
720721         case INT1:
721722            cpu_irq_state &= ~(gpu_regs[INT1] >> 8);
722723            update_cpu_irq(space->machine);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team