Search
lxdream.org :: lxdream/src/pvr2/pvr2.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2.c
changeset 653:3202ff01d48e
prev586:2a3ba82cf243
next669:ab344e42bca9
author nkeynes
date Fri Mar 28 12:32:25 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Merge lxdream-render branch (643:670) to trunk
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2.c Tue Jan 15 20:50:23 2008 +0000
1.2 +++ b/src/pvr2/pvr2.c Fri Mar 28 12:32:25 2008 +0000
1.3 @@ -203,12 +203,17 @@
1.4 }
1.5
1.6 render_buffer_t buffer = pvr2_frame_buffer_to_render_buffer(frame);
1.7 - assert( buffer != NULL );
1.8 - fread( &buffer->rowstride, sizeof(buffer->rowstride), 1, f );
1.9 - fread( &buffer->colour_format, sizeof(buffer->colour_format), 1, f );
1.10 - fread( &buffer->address, sizeof(buffer->address), 1, f );
1.11 - fread( &buffer->scale, sizeof(buffer->scale), 1, f );
1.12 - fread( &buffer->flushed, sizeof(buffer->flushed), 1, f );
1.13 + if( buffer != NULL ) {
1.14 + fread( &buffer->rowstride, sizeof(buffer->rowstride), 1, f );
1.15 + fread( &buffer->colour_format, sizeof(buffer->colour_format), 1, f );
1.16 + fread( &buffer->address, sizeof(buffer->address), 1, f );
1.17 + fread( &buffer->scale, sizeof(buffer->scale), 1, f );
1.18 + fread( &buffer->flushed, sizeof(buffer->flushed), 1, f );
1.19 + } else {
1.20 + fseek( f, sizeof(buffer->rowstride)+sizeof(buffer->colour_format)+
1.21 + sizeof(buffer->address)+sizeof(buffer->scale)+
1.22 + sizeof(buffer->flushed), SEEK_CUR );
1.23 + }
1.24 return buffer;
1.25 }
1.26
1.27 @@ -258,9 +263,7 @@
1.28 }
1.29
1.30 for( i=0; i<count; i++ ) {
1.31 - if( pvr2_load_render_buffer( f ) == NULL ) {
1.32 - return FALSE;
1.33 - }
1.34 + pvr2_load_render_buffer( f );
1.35 }
1.36 return TRUE;
1.37 }
1.38 @@ -454,9 +457,10 @@
1.39 g_free( pvr2_state.save_next_render_filename );
1.40 pvr2_state.save_next_render_filename = NULL;
1.41 }
1.42 + pvr2_scene_read();
1.43 render_buffer_t buffer = pvr2_next_render_buffer();
1.44 if( buffer != NULL ) {
1.45 - pvr2_render_scene( buffer );
1.46 + pvr2_scene_render( buffer );
1.47 }
1.48 asic_event( EVENT_PVR_RENDER_DONE );
1.49 break;
1.50 @@ -581,7 +585,9 @@
1.51 case RENDER_PALETTE:
1.52 MMIO_WRITE( PVR2, reg, val&0x00000003 );
1.53 break;
1.54 -
1.55 + case RENDER_ALPHA_REF:
1.56 + MMIO_WRITE( PVR2, reg, val&0x000000FF );
1.57 + break;
1.58 /********** CRTC registers *************/
1.59 case DISP_HBORDER:
1.60 case DISP_VBORDER:
1.61 @@ -677,9 +683,6 @@
1.62 case PVRUNK5:
1.63 MMIO_WRITE( PVR2, reg, val&0x0000FFFF );
1.64 break;
1.65 - case PVRUNK6:
1.66 - MMIO_WRITE( PVR2, reg, val&0x000000FF );
1.67 - break;
1.68 case PVRUNK7:
1.69 MMIO_WRITE( PVR2, reg, val&0x00000001 );
1.70 break;
1.71 @@ -940,9 +943,9 @@
1.72 render_addr = (render_addr & 0x00FFFFFF) + PVR2_RAM_BASE;
1.73 }
1.74
1.75 - int width, height;
1.76 + int width = pvr2_scene_buffer_width();
1.77 + int height = pvr2_scene_buffer_height();
1.78 int colour_format = pvr2_render_colour_format[render_mode&0x07];
1.79 - pvr2_render_getsize( &width, &height );
1.80
1.81 result = pvr2_alloc_render_buffer( render_addr, width, height );
1.82 /* Setup the buffer */
.