Search
lxdream.org :: lxdream/src/pvr2/tacore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/tacore.c
changeset 198:627220aa0e3b
prev194:7fcecbcd5f01
next199:4433d9c1638c
author nkeynes
date Sun Aug 06 03:36:51 2006 +0000 (17 years ago)
permissions -rw-r--r--
last change Add tile clip parsing
file annotate diff log raw
1.1 --- a/src/pvr2/tacore.c Sat Aug 05 00:02:41 2006 +0000
1.2 +++ b/src/pvr2/tacore.c Sun Aug 06 03:36:51 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: tacore.c,v 1.3 2006-08-05 00:02:41 nkeynes Exp $
1.6 + * $Id: tacore.c,v 1.4 2006-08-06 03:36:51 nkeynes Exp $
1.7 *
1.8 * PVR2 Tile Accelerator implementation
1.9 *
1.10 @@ -133,6 +133,7 @@
1.11 uint32_t current_tile_matrix; /* Memory location of the first tile for the current list. */
1.12 uint32_t current_tile_size; /* Size of the tile matrix space in 32-bit words (0/8/16/32)*/
1.13 uint32_t intensity1, intensity2;
1.14 + struct tile_bounds clip;
1.15 /**
1.16 * Current working object
1.17 */
1.18 @@ -185,10 +186,14 @@
1.19 ta_status.max_vertex = 3;
1.20 ta_status.last_triangle_bounds.x1 = -1;
1.21 ta_status.accept_vertexes = TRUE;
1.22 -
1.23 + ta_status.clip.x1 = 0;
1.24 + ta_status.clip.y1 = 0;
1.25 +
1.26 uint32_t size = MMIO_READ( PVR2, TA_TILESIZE );
1.27 ta_status.width = (size & 0xFFFF) + 1;
1.28 ta_status.height = (size >> 16) + 1;
1.29 + ta_status.clip.x2 = ta_status.width-1;
1.30 + ta_status.clip.y2 = ta_status.height-1;
1.31 uint32_t control = MMIO_READ( PVR2, TA_TILECFG );
1.32 ta_status.tilelist_dir = (control >> 20) & 0x01;
1.33 ta_status.tilelist_size = tilematrix_sizes[ (control & 0x03) ];
1.34 @@ -987,7 +992,16 @@
1.35 case TA_CMD_END_LIST:
1.36 ta_end_list();
1.37 break;
1.38 - case TA_CMD_CLIP: /* TODO */
1.39 + case TA_CMD_CLIP:
1.40 + if( ta_status.state == STATE_IN_POLYGON ) {
1.41 + asic_event( EVENT_PVR_BAD_INPUT );
1.42 + asic_event( EVENT_TA_ERROR );
1.43 + /* Enter stuffed up mode */
1.44 + }
1.45 + ta_status.clip.x1 = data[4].i & 0x3F;
1.46 + ta_status.clip.y1 = data[5].i & 0x0F;
1.47 + ta_status.clip.x2 = data[6].i & 0x3F;
1.48 + ta_status.clip.y2 = data[7].i & 0x0F;
1.49 break;
1.50 case TA_CMD_POLYGON_CONTEXT:
1.51 if( ta_status.state == STATE_IDLE ) {
.