filename | src/asic.c |
changeset | 753:1fe39c3a9bbc |
prev | 736:a02d1475ccfd |
next | 833:1ea87e0221f8 |
author | nkeynes |
date | Mon Jul 21 00:08:34 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Add gettext.h and build sanely without libintl if it's not available Remove x86dasm's config.h & opintl.h (no longer needed and actually wrong) |
file | annotate | diff | log | raw |
1.1 --- a/src/asic.c Mon Jul 14 07:44:42 2008 +00001.2 +++ b/src/asic.c Mon Jul 21 00:08:34 2008 +00001.3 @@ -355,9 +355,42 @@1.4 sh4addr_t table_addr = MMIO_READ( ASIC, SORTDMATBL );1.5 sh4addr_t data_addr = MMIO_READ( ASIC, SORTDMADATA );1.6 int table_size = MMIO_READ( ASIC, SORTDMATSIZ );1.7 - int data_size = MMIO_READ( ASIC, SORTDMADSIZ );1.8 + int addr_shift = MMIO_READ( ASIC, SORTDMAASIZ ) ? 5 : 0;1.9 + int count = 1;1.11 - WARN( "Sort DMA not implemented" );1.12 + uint32_t *table32 = (uint32_t *)mem_get_region( table_addr );1.13 + uint16_t *table16 = (uint16_t *)table32;1.14 + uint32_t next = table_size ? (*table32++) : (uint32_t)(*table16++);1.15 + while(1) {1.16 + next &= 0x07FFFFFF;1.17 + if( next == 1 ) {1.18 + next = table_size ? (*table32++) : (uint32_t)(*table16++);1.19 + count++;1.20 + continue;1.21 + } else if( next == 2 ) {1.22 + asic_event( EVENT_SORT_DMA );1.23 + break;1.24 + }1.25 + uint32_t *data = (uint32_t *)mem_get_region(data_addr + (next<<addr_shift));1.26 + if( data == NULL ) {1.27 + break;1.28 + }1.29 +1.30 + uint32_t *poly = pvr2_ta_find_polygon_context(data, 128);1.31 + if( poly == NULL ) {1.32 + asic_event( EVENT_SORT_DMA_ERR );1.33 + break;1.34 + }1.35 + uint32_t size = poly[6] & 0xFF;1.36 + if( size == 0 ) {1.37 + size = 0x100;1.38 + }1.39 + next = poly[7];1.40 + pvr2_ta_write( (unsigned char *)data, size<<5 );1.41 + }1.42 +1.43 + MMIO_WRITE( ASIC, SORTDMACNT, count );1.44 + MMIO_WRITE( ASIC, SORTDMACTL, 0 );1.45 }1.47 void mmio_region_ASIC_write( uint32_t reg, uint32_t val )1.48 @@ -422,7 +455,7 @@1.49 case SORTDMATBL: case SORTDMADATA:1.50 MMIO_WRITE( ASIC, reg, (val & 0x0FFFFFE0) | 0x08000000 );1.51 break;1.52 - case SORTDMATSIZ: case SORTDMADSIZ:1.53 + case SORTDMATSIZ: case SORTDMAASIZ:1.54 MMIO_WRITE( ASIC, reg, (val & 1) );1.55 break;1.56 case SORTDMACTL:
.