src/mame/video/jaguar.c
| r8814 | r8815 | |
| 673 | 673 | return gpu_regs[offset]; |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | | #if 0 |
| 676 | /* |
| 677 | FIXME: 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). |
| 678 | But 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 | |
| 677 | 682 | static TIMER_CALLBACK( jaguar_pit ) |
| 678 | 683 | { |
| 679 | 684 | attotime sample_period; |
| r8814 | r8815 | |
| 682 | 687 | |
| 683 | 688 | if (gpu_regs[PIT0]) |
| 684 | 689 | { |
| 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); |
| 687 | 692 | } |
| 688 | 693 | } |
| 689 | | #endif |
| 690 | 694 | |
| 695 | |
| 691 | 696 | WRITE16_HANDLER( jaguar_tom_regs_w ) |
| 692 | 697 | { |
| 693 | 698 | UINT32 reg_store = gpu_regs[offset]; |
| 694 | | // attotime sample_period; |
| 699 | attotime sample_period; |
| 695 | 700 | if (offset < GPU_REGS) |
| 696 | 701 | { |
| 697 | 702 | COMBINE_DATA(&gpu_regs[offset]); |
| r8814 | r8815 | |
| 705 | 710 | break; |
| 706 | 711 | case PIT0: |
| 707 | 712 | 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: |
| 713 | 713 | if (gpu_regs[PIT0]) |
| 714 | 714 | { |
| 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); |
| 716 | 717 | timer_set(space->machine, sample_period, NULL, 0, jaguar_pit); |
| 717 | 718 | } |
| 718 | 719 | break; |
| 719 | | #endif |
| 720 | |
| 720 | 721 | case INT1: |
| 721 | 722 | cpu_irq_state &= ~(gpu_regs[INT1] >> 8); |
| 722 | 723 | update_cpu_irq(space->machine); |