1.1 --- a/src/pvr2/pvr2.c Thu Jan 11 06:50:11 2007 +0000
1.2 +++ b/src/pvr2/pvr2.c Thu Jan 11 12:14:57 2007 +0000
1.5 - * $Id: pvr2.c,v 1.36 2007-01-11 06:50:11 nkeynes Exp $
1.6 + * $Id: pvr2.c,v 1.37 2007-01-11 12:14:57 nkeynes Exp $
1.8 * PVR2 (Video) Core module implementation and MMIO registers.
1.11 static int pvr2_load_state( FILE *f );
1.12 static void pvr2_update_raster_posn( uint32_t nanosecs );
1.13 static void pvr2_schedule_line_event( int eventid, int line );
1.14 -static void pvr2_schedule_scanline_event( int eventid, int line );
1.15 +static void pvr2_schedule_scanline_event( int eventid, int line, int minimum_lines );
1.16 uint32_t pvr2_get_sync_status();
1.18 void pvr2_display_frame( void );
1.20 asic_event( eventid );
1.21 pvr2_update_raster_posn(sh4r.slice_cycle);
1.22 if( eventid == EVENT_SCANLINE1 ) {
1.23 - pvr2_schedule_scanline_event( eventid, pvr2_state.irq_vpos1 );
1.24 + pvr2_schedule_scanline_event( eventid, pvr2_state.irq_vpos1, 1 );
1.26 - pvr2_schedule_scanline_event( eventid, pvr2_state.irq_vpos2 );
1.27 + pvr2_schedule_scanline_event( eventid, pvr2_state.irq_vpos2, 1 );
1.32 pvr2_state.irq_vpos1 = (val >> 16);
1.33 pvr2_state.irq_vpos2 = val & 0x03FF;
1.34 pvr2_update_raster_posn(sh4r.slice_cycle);
1.35 - pvr2_schedule_scanline_event( EVENT_SCANLINE1, pvr2_state.irq_vpos1 );
1.36 - pvr2_schedule_scanline_event( EVENT_SCANLINE2, pvr2_state.irq_vpos2 );
1.37 + pvr2_schedule_scanline_event( EVENT_SCANLINE1, pvr2_state.irq_vpos1, 0 );
1.38 + pvr2_schedule_scanline_event( EVENT_SCANLINE2, pvr2_state.irq_vpos2, 0 );
1.39 MMIO_WRITE( PVR2, reg, val );
1.41 case RENDER_NEARCLIP:
1.43 pvr2_state.retrace_end_line = 0x2A;
1.44 pvr2_state.retrace_start_line = pvr2_state.total_lines - 6;
1.45 pvr2_schedule_line_event( EVENT_RETRACE, 0 );
1.46 - pvr2_schedule_scanline_event( EVENT_SCANLINE1, pvr2_state.irq_vpos1 );
1.47 - pvr2_schedule_scanline_event( EVENT_SCANLINE2, pvr2_state.irq_vpos2 );
1.48 + pvr2_schedule_scanline_event( EVENT_SCANLINE1, pvr2_state.irq_vpos1, 0 );
1.49 + pvr2_schedule_scanline_event( EVENT_SCANLINE2, pvr2_state.irq_vpos2, 0 );
1.52 MMIO_WRITE( PVR2, reg, val&0x000003FF );
1.54 * The raster position should be updated before calling this
1.57 -static void pvr2_schedule_scanline_event( int eventid, int line )
1.58 +static void pvr2_schedule_scanline_event( int eventid, int line, int minimum_lines )
1.60 uint32_t field = pvr2_state.odd_even_field;
1.61 if( line <= pvr2_state.line_count && pvr2_state.interlaced ) {
1.62 @@ -586,7 +586,23 @@
1.66 - pvr2_schedule_line_event( eventid, line );
1.68 + if( line < pvr2_state.total_lines ) {
1.71 + if( line <= pvr2_state.line_count ) {
1.72 + lines = (pvr2_state.total_lines - pvr2_state.line_count + line);
1.74 + lines = (line - pvr2_state.line_count);
1.76 + if( lines <= minimum_lines ) {
1.77 + lines += pvr2_state.total_lines;
1.79 + time = (lines * pvr2_state.line_time_ns) - pvr2_state.line_remainder;
1.80 + event_schedule( eventid, time );
1.82 + event_cancel( eventid );
1.86 MMIO_REGION_READ_FN( PVR2, reg )