filename | src/pvr2/pvr2.c |
changeset | 85:71e239d20c5d |
prev | 65:9f124c245fc6 |
next | 94:8d80d9c7cc7d |
author | nkeynes |
date | Sun Jan 22 22:38:51 2006 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Fix colour mode definitions Add PVR2 palette region Fix ta end-of-command when it's not in the same buffer |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/pvr2.c Tue Jan 03 12:21:45 2006 +00001.2 +++ b/src/pvr2/pvr2.c Sun Jan 22 22:38:51 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: pvr2.c,v 1.12 2006-01-03 12:21:45 nkeynes Exp $1.6 + * $Id: pvr2.c,v 1.13 2006-01-22 22:38:51 nkeynes Exp $1.7 *1.8 * PVR2 (Video) MMIO and supporting functions.1.9 *1.10 @@ -39,6 +39,7 @@1.11 void pvr2_init( void )1.12 {1.13 register_io_region( &mmio_region_PVR2 );1.14 + register_io_region( &mmio_region_PVR2PAL );1.15 register_io_region( &mmio_region_PVR2TA );1.16 video_base = mem_get_region_by_name( MEM_REGION_VIDEO );1.17 }1.18 @@ -146,6 +147,8 @@1.19 }1.20 }1.22 +MMIO_REGION_DEFFNS( PVR2PAL )1.23 +1.24 void pvr2_set_base_address( uint32_t base )1.25 {1.26 mmio_region_PVR2_write( DISPADDR1, base );1.27 @@ -184,18 +187,19 @@1.28 DEBUG( "Direct write to TA %08X", val );1.29 }1.31 +unsigned int pvr2_last_poly_type = 0;1.32 +1.33 void pvr2ta_write( char *buf, uint32_t length )1.34 {1.35 int i;1.36 struct tacmd *cmd_list = (struct tacmd *)buf;1.37 int count = length >> 5;1.38 - unsigned int lasttype = 0;1.39 for( i=0; i<count; i++ ){1.40 unsigned int type = (cmd_list[i].command >> 24) & 0xFF;1.41 DEBUG( "PVR2 cmd: %08X %08X %08X", cmd_list[i].command, cmd_list[i].param1, cmd_list[i].param2 );1.42 if( type == 0 ) {1.43 /* End of list */1.44 - switch( lasttype ) {1.45 + switch( pvr2_last_poly_type ) {1.46 case 0x80: /* Opaque polys */1.47 asic_event( EVENT_PVR_OPAQUE_DONE );1.48 break;1.49 @@ -212,8 +216,9 @@1.50 asic_event( EVENT_PVR_PUNCHOUT_DONE );1.51 break;1.52 }1.53 - } else {1.54 - lasttype = type;1.55 + pvr2_last_poly_type = 0;1.56 + } else if( type >= 0x80 && type <= 0x84 ) {1.57 + pvr2_last_poly_type = type;1.58 }1.59 }1.60 }
.