filename | src/pvr2/render.c |
changeset | 191:df4441cf3128 |
prev | 189:615b70cfd729 |
next | 219:dfd3292143f2 |
author | nkeynes |
date | Wed Aug 02 06:24:08 2006 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Add more register masks (in line with test case) Rename renderer registers for consistency |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/render.c Wed Aug 02 04:06:45 2006 +00001.2 +++ b/src/pvr2/render.c Wed Aug 02 06:24:08 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: render.c,v 1.11 2006-08-02 04:06:45 nkeynes Exp $1.6 + * $Id: render.c,v 1.12 2006-08-02 06:24:08 nkeynes Exp $1.7 *1.8 * PVR2 Renderer support. This part is primarily1.9 *1.10 @@ -235,7 +235,7 @@1.11 if( bg->colour1 != bg->colour2 || bg->colour2 != bg->colour3 ) {1.12 WARN( "Multiple background colours specified. Confused" );1.13 fprintf( stderr, "bgplane mode: %08X PBUF: %08X\n", mode,1.14 - MMIO_READ( PVR2, OBJBASE ) );1.15 + MMIO_READ( PVR2, RENDER_POLYBASE ) );1.16 fwrite_dump( poly, 80, stderr );1.17 }1.18 float x1 = MIN3( bg->x1, bg->x2, bg->x3 );1.19 @@ -267,9 +267,9 @@1.20 void pvr2_render_scene( )1.21 {1.22 struct tile_descriptor *tile_desc =1.23 - (struct tile_descriptor *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, TILEBASE ));1.24 + (struct tile_descriptor *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, RENDER_TILEBASE ));1.26 - uint32_t render_addr = MMIO_READ( PVR2, RENDADDR1 );1.27 + uint32_t render_addr = MMIO_READ( PVR2, RENDER_ADDR1 );1.28 gboolean render_to_tex;1.29 if( render_addr & 0x01000000 ) {1.30 render_addr = (render_addr & 0x00FFFFFF) + PVR2_RAM_BASE_INT;1.31 @@ -284,25 +284,25 @@1.32 render_to_tex = FALSE;1.33 }1.35 - float bgplanez = MMIO_READF( PVR2, BGPLANEZ );1.36 - uint32_t render_mode = MMIO_READ( PVR2, RENDMODE );1.37 + float bgplanez = MMIO_READF( PVR2, RENDER_FARCLIP );1.38 + uint32_t render_mode = MMIO_READ( PVR2, RENDER_MODE );1.39 int width = 640; /* FIXME - get this from the tile buffer */1.40 int height = 480;1.41 int colour_format = pvr2_render_colour_format[render_mode&0x07];1.42 pvr2_render_prepare_context( render_addr, width, height, colour_format,1.43 bgplanez, render_to_tex );1.45 - int clip_x = MMIO_READ( PVR2, HCLIP ) & 0x03FF;1.46 - int clip_y = MMIO_READ( PVR2, VCLIP ) & 0x03FF;1.47 - int clip_width = ((MMIO_READ( PVR2, HCLIP ) >> 16) & 0x03FF) - clip_x + 1;1.48 - int clip_height= ((MMIO_READ( PVR2, VCLIP ) >> 16) & 0x03FF) - clip_y + 1;1.49 + int clip_x = MMIO_READ( PVR2, RENDER_HCLIP ) & 0x03FF;1.50 + int clip_y = MMIO_READ( PVR2, RENDER_VCLIP ) & 0x03FF;1.51 + int clip_width = ((MMIO_READ( PVR2, RENDER_HCLIP ) >> 16) & 0x03FF) - clip_x + 1;1.52 + int clip_height= ((MMIO_READ( PVR2, RENDER_VCLIP ) >> 16) & 0x03FF) - clip_y + 1;1.54 /* Fog setup goes here */1.56 /* Render the background plane */1.57 - uint32_t bgplane_mode = MMIO_READ(PVR2, BGPLANE);1.58 + uint32_t bgplane_mode = MMIO_READ(PVR2, RENDER_BGPLANE);1.59 uint32_t *display_list =1.60 - (uint32_t *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, OBJBASE ));1.61 + (uint32_t *)mem_get_region(PVR2_RAM_BASE + MMIO_READ( PVR2, RENDER_POLYBASE ));1.63 uint32_t *bgplane = display_list + (((bgplane_mode & 0x00FFFFFF)) >> 3) ;1.64 pvr2_render_draw_backplane( bgplane_mode, bgplane );
.