Improved irq routines inside video/dc.c

This commit is contained in:
Angelo Salese 2010-04-30 15:46:12 +00:00
parent c3dd192008
commit 315559a406
2 changed files with 41 additions and 27 deletions

View File

@ -1382,7 +1382,7 @@ WRITE64_HANDLER( dc_g2_ctrl_w )
case SB_E2ST: case SB_E2ST:
case SB_DDST: case SB_DDST:
if(dat & 1) if(dat & 1)
printf("Warning: enabled G2 Debug / External DMA %02x (reg=%08x)\n",reg); printf("Warning: enabled G2 Debug / External DMA %08x\n",reg);
break; break;
case SB_ADSUSP: case SB_ADSUSP:

View File

@ -1271,6 +1271,7 @@ WRITE64_HANDLER( pvr_ta_w )
visarea.min_y = 0; visarea.min_y = 0;
visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1; visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1;
video_screen_configure(space->machine->primary_screen, spg_hbstart, spg_vbstart, &visarea, video_screen_get_frame_period(space->machine->primary_screen).attoseconds ); video_screen_configure(space->machine->primary_screen, spg_hbstart, spg_vbstart, &visarea, video_screen_get_frame_period(space->machine->primary_screen).attoseconds );
} }
break; break;
@ -1281,10 +1282,39 @@ WRITE64_HANDLER( pvr_ta_w )
mame_printf_verbose("PVRTA: [%08x=%x] write %" I64FMT "x to %x (reg %x %x), mask %" I64FMT "x\n", 0x5f8000+reg*4, dat, data>>shift, offset, reg, (reg*4)+0x8000, mem_mask); mame_printf_verbose("PVRTA: [%08x=%x] write %" I64FMT "x to %x (reg %x %x), mask %" I64FMT "x\n", 0x5f8000+reg*4, dat, data>>shift, offset, reg, (reg*4)+0x8000, mem_mask);
#endif #endif
} }
static TIMER_CALLBACK( transfer_opaque_list_irq )
{
dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPLST;
dc_update_interrupt_status(machine);
}
static TIMER_CALLBACK( transfer_opaque_modifier_volume_list_irq )
{
dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPMV;
dc_update_interrupt_status(machine);
}
static TIMER_CALLBACK( transfer_translucent_list_irq )
{
dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRLST;
dc_update_interrupt_status(machine);
}
static TIMER_CALLBACK( transfer_translucent_modifier_volume_list_irq )
{
dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRMV;
dc_update_interrupt_status(machine);
}
static TIMER_CALLBACK( transfer_punch_through_list_irq )
{
dc_sysctrl_regs[SB_ISTNRM] |= (1 << 21);
dc_update_interrupt_status(machine);
}
static void process_ta_fifo(running_machine* machine) static void process_ta_fifo(running_machine* machine)
{ {
UINT32 a;
/* first byte in the buffer is the Parameter Control Word /* first byte in the buffer is the Parameter Control Word
pppp pppp gggg gggg oooo oooo oooo oooo pppp pppp gggg gggg oooo oooo oooo oooo
@ -1365,28 +1395,16 @@ static void process_ta_fifo(running_machine* machine)
#if DEBUG_PVRDLIST #if DEBUG_PVRDLIST
mame_printf_verbose("Para Type 0 End of List\n"); mame_printf_verbose("Para Type 0 End of List\n");
#endif #endif
a=0; // 6-10 0-3 /* Process transfer FIFO done irqs here */
/* FIXME: timing of these */
switch (state_ta.tafifo_listtype) switch (state_ta.tafifo_listtype)
{ {
case 0: case 0: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_opaque_list_irq); break;
a = 1 << 7; case 1: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_opaque_modifier_volume_list_irq); break;
break; case 2: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_translucent_list_irq); break;
case 1: case 3: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_translucent_modifier_volume_list_irq); break;
a = 1 << 8; case 4: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_punch_through_list_irq); break;
break;
case 2:
a = 1 << 9;
break;
case 3:
a = 1 << 10;
break;
case 4:
a = 1 << 21;
break;
} }
dc_sysctrl_regs[SB_ISTNRM] |= a;
dc_update_interrupt_status(machine);
state_ta.tafifo_listtype= -1; // no list being received state_ta.tafifo_listtype= -1; // no list being received
state_ta.listtype_used |= (2+8); state_ta.listtype_used |= (2+8);
} }
@ -2422,11 +2440,7 @@ static void pvr_build_parameterconfig(void)
static TIMER_CALLBACK(vbout) static TIMER_CALLBACK(vbout)
{ {
UINT32 a; dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt
//printf("vbout\n");
a=dc_sysctrl_regs[SB_ISTNRM] | IST_VBL_OUT;
dc_sysctrl_regs[SB_ISTNRM] = a; // V Blank-out interrupt
dc_update_interrupt_status(machine); dc_update_interrupt_status(machine);
scanline = 0; scanline = 0;