Search
lxdream.org :: lxdream/src/pvr2/rendsort.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendsort.c
changeset 934:3acd3b3ee6d1
prev893:8eae02de411a
next1066:ddffe9d2b332
author nkeynes
date Fri Dec 26 14:25:23 2008 +0000 (13 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Change RAM regions to use static arrays rather than mmap regions, for a 2-3% performance gain.
General mem cleanups, including some save state fixes that break states again.
file annotate diff log raw
1.1 --- a/src/pvr2/rendsort.c Fri Oct 24 03:47:30 2008 +0000
1.2 +++ b/src/pvr2/rendsort.c Fri Dec 26 14:25:23 2008 +0000
1.3 @@ -41,14 +41,14 @@
1.4 * pvr memory address.
1.5 */
1.6 static int sort_count_triangles( pvraddr_t tile_entry ) {
1.7 - uint32_t *tile_list = (uint32_t *)(video_base+tile_entry);
1.8 + uint32_t *tile_list = (uint32_t *)(pvr2_main_ram+tile_entry);
1.9 int count = 0;
1.10 while(1) {
1.11 uint32_t entry = *tile_list++;
1.12 if( entry >> 28 == 0x0F ) {
1.13 break;
1.14 } else if( entry >> 28 == 0x0E ) {
1.15 - tile_list = (uint32_t *)(video_base+(entry&0x007FFFFF));
1.16 + tile_list = (uint32_t *)(pvr2_main_ram+(entry&0x007FFFFF));
1.17 } else if( entry >> 29 == 0x04 ) { /* Triangle array */
1.18 count += ((entry >> 25) & 0x0F)+1;
1.19 } else if( entry >> 29 == 0x05 ) { /* Quad array */
1.20 @@ -100,7 +100,7 @@
1.21 */
1.22 int sort_extract_triangles( pvraddr_t tile_entry, struct sort_triangle *triangles )
1.23 {
1.24 - uint32_t *tile_list = (uint32_t *)(video_base+tile_entry);
1.25 + uint32_t *tile_list = (uint32_t *)(pvr2_main_ram+tile_entry);
1.26 int strip_count;
1.27 struct polygon_struct *poly;
1.28 int count = 0, i;
1.29 @@ -111,7 +111,7 @@
1.30 case 0x0F:
1.31 return count; // End-of-list
1.32 case 0x0E:
1.33 - tile_list = (uint32_t *)(video_base + (entry&0x007FFFFF));
1.34 + tile_list = (uint32_t *)(pvr2_main_ram + (entry&0x007FFFFF));
1.35 break;
1.36 case 0x08: case 0x09: case 0x0A: case 0x0B:
1.37 strip_count = ((entry >> 25) & 0x0F)+1;
.