Search
lxdream.org :: lxdream/src/pvr2/tacore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/tacore.c
changeset 215:f432833e8303
prev206:f5de539c0fcb
next305:1191085c5988
author nkeynes
date Fri Aug 18 12:43:24 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Implement pvr banking strategy wrt the polygon buffers
file annotate diff log raw
1.1 --- a/src/pvr2/tacore.c Sun Aug 06 07:47:26 2006 +0000
1.2 +++ b/src/pvr2/tacore.c Fri Aug 18 12:43:24 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: tacore.c,v 1.8 2006-08-06 07:47:26 nkeynes Exp $
1.6 + * $Id: tacore.c,v 1.9 2006-08-18 12:43:24 nkeynes Exp $
1.7 *
1.8 * PVR2 Tile Accelerator implementation
1.9 *
1.10 @@ -133,6 +133,7 @@
1.11 int tilelist_dir; /* Growth direction of the tilelist, 0 = up, 1 = down */
1.12 uint32_t tilelist_size; /* Size of the tilelist segments */
1.13 uint32_t tilelist_start; /* Initial address of the tilelist */
1.14 + int polybuf_start; /* Initial bank address of the polygon buffer (ie &0x00F00000) */
1.15 int current_vertex_type;
1.16 gboolean accept_vertexes;
1.17 int vertex_count; /* index of last start-vertex seen, or -1 if no vertexes
1.18 @@ -219,6 +220,7 @@
1.19 }
1.20 MMIO_WRITE( PVR2, TA_LISTPOS, plistpos );
1.21 ta_status.tilelist_start = plistpos;
1.22 + ta_status.polybuf_start = MMIO_READ( PVR2, TA_POLYBASE ) & 0x00F00000;
1.23 }
1.24
1.25 static uint32_t parse_float_colour( float a, float r, float g, float b ) {
1.26 @@ -349,7 +351,9 @@
1.27 // ta_status.state = STATE_ERROR;
1.28 break;
1.29 }
1.30 - *target++ = *data++;
1.31 + if( posn < PVR2_RAM_SIZE ) {
1.32 + *target++ = *data++;
1.33 + }
1.34 posn += 4;
1.35 }
1.36
1.37 @@ -581,7 +585,8 @@
1.38 }
1.39
1.40 /* Ok, we're good to go - write out the polygon first */
1.41 - uint32_t tile_entry = MMIO_READ( PVR2, TA_POLYPOS ) >> 2 | ta_status.poly_pointer;
1.42 + uint32_t tile_entry = (MMIO_READ( PVR2, TA_POLYPOS ) - ta_status.polybuf_start) >> 2 |
1.43 + ta_status.poly_pointer;
1.44
1.45 int status = ta_write_polygon_buffer( poly_context, ta_status.poly_context_size );
1.46 if( status == 0 ) {
.