Search
lxdream.org :: lxdream/src/pvr2/pvr2mem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2mem.c
changeset 827:d333f4248727
prev796:a2dc83592467
next834:7682ceeb9309
author nkeynes
date Sun Aug 24 02:57:15 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Adjust the hclip when the horizontal scaler is active
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2mem.c Wed Jul 30 22:50:44 2008 +0000
1.2 +++ b/src/pvr2/pvr2mem.c Sun Aug 24 02:57:15 2008 +0000
1.3 @@ -56,7 +56,7 @@
1.4 unsigned char *dest = mem_get_region(destaddr);
1.5 memcpy( dest, src, count );
1.6 }
1.7 - }
1.8 + }
1.9 }
1.10
1.11 void pvr2_vram64_write( sh4addr_t destaddr, unsigned char *src, uint32_t length )
1.12 @@ -77,7 +77,7 @@
1.13
1.14 banks[0] = ((uint32_t *)(video_base + ((destaddr & 0x007FFFF8) >>1)));
1.15 banks[1] = banks[0] + 0x100000;
1.16 - if( bank_flag )
1.17 + if( bank_flag )
1.18 banks[0]++;
1.19
1.20 /* Handle non-aligned start of source */
1.21 @@ -103,7 +103,7 @@
1.22 while( length-- > 0 ) {
1.23 *dest++ = *src++;
1.24 }
1.25 - }
1.26 + }
1.27 }
1.28
1.29 /**
1.30 @@ -111,7 +111,7 @@
1.31 * The destaddr must be 32-bit aligned, and both line_bytes and line_stride_bytes
1.32 * must be multiples of 4.
1.33 */
1.34 -void pvr2_vram64_write_stride( sh4addr_t destaddr, unsigned char *src, uint32_t line_bytes,
1.35 +void pvr2_vram64_write_stride( sh4addr_t destaddr, unsigned char *src, uint32_t line_bytes,
1.36 uint32_t line_stride_bytes, uint32_t line_count )
1.37 {
1.38 int bank_flag = (destaddr & 0x04) >> 2;
1.39 @@ -133,7 +133,7 @@
1.40
1.41 banks[0] = (uint32_t *)(video_base + (destaddr >>1));
1.42 banks[1] = banks[0] + 0x100000;
1.43 - if( bank_flag )
1.44 + if( bank_flag )
1.45 banks[0]++;
1.46
1.47 dwsrc = (uint32_t *)src;
1.48 @@ -148,7 +148,7 @@
1.49 banks[bank_flag]++;
1.50 bank_flag = !bank_flag;
1.51 }
1.52 - }
1.53 + }
1.54 }
1.55
1.56 /**
1.57 @@ -200,7 +200,7 @@
1.58 banks[bank_flag]++;
1.59 bank_flag = !bank_flag;
1.60 }
1.61 - }
1.62 + }
1.63 }
1.64
1.65
1.66 @@ -296,7 +296,7 @@
1.67 }
1.68
1.69 /**
1.70 - * Read an image from 64-bit vram stored as twiddled 4-bit pixels. The
1.71 + * Read an image from 64-bit vram stored as twiddled 4-bit pixels. The
1.72 * image is written out to the destination in detwiddled form.
1.73 * @param dest destination buffer, which must be at least width*height/2 in length
1.74 * @param srcaddr source address in vram
1.75 @@ -335,11 +335,11 @@
1.76 *wdest = *banks[0];
1.77 } else {
1.78 pvr2_vram64_detwiddle_4( wdest, banks, offset_flag, 0, 0, width, stride );
1.79 - }
1.80 + }
1.81 }
1.82
1.83 /**
1.84 - * Read an image from 64-bit vram stored as twiddled 8-bit pixels. The
1.85 + * Read an image from 64-bit vram stored as twiddled 8-bit pixels. The
1.86 * image is written out to the destination in detwiddled form.
1.87 * @param dest destination buffer, which must be at least width*height in length
1.88 * @param srcaddr source address in vram
1.89 @@ -377,11 +377,11 @@
1.90 *wdest = *banks[0];
1.91 } else {
1.92 pvr2_vram64_detwiddle_8( wdest, banks, offset_flag, 0, 0, width, width );
1.93 - }
1.94 + }
1.95 }
1.96
1.97 /**
1.98 - * Read an image from 64-bit vram stored as twiddled 16-bit pixels. The
1.99 + * Read an image from 64-bit vram stored as twiddled 16-bit pixels. The
1.100 * image is written out to the destination in detwiddled form.
1.101 * @param dest destination buffer, which must be at least width*height*2 in length
1.102 * @param srcaddr source address in vram (must be 16-bit aligned)
1.103 @@ -419,7 +419,7 @@
1.104 *wdest = *banks[0];
1.105 } else {
1.106 pvr2_vram64_detwiddle_16( wdest, banks, offset_flag, 0, 0, width, width );
1.107 - }
1.108 + }
1.109 }
1.110
1.111 void pvr2_vram_write_invert( sh4addr_t destaddr, unsigned char *src, uint32_t length, uint32_t line_length,
1.112 @@ -500,7 +500,7 @@
1.113 fclose(f);
1.114 }
1.115
1.116 -void pvr2_vram64_dump( sh4addr_t addr, uint32_t length, FILE *f )
1.117 +void pvr2_vram64_dump( sh4addr_t addr, uint32_t length, FILE *f )
1.118 {
1.119 unsigned char tmp[length];
1.120 pvr2_vram64_read( tmp, addr, length );
1.121 @@ -513,9 +513,11 @@
1.122 * Flush the indicated render buffer back to PVR. Caller is responsible for
1.123 * tracking whether there is actually anything in the buffer.
1.124 *
1.125 + * FIXME: Handle horizontal scaler
1.126 + *
1.127 * @param buffer A render buffer indicating the address to store to, and the
1.128 * format the data needs to be in.
1.129 - * @param backBuffer TRUE to flush the back buffer, FALSE for
1.130 + * @param backBuffer TRUE to flush the back buffer, FALSE for
1.131 * the front buffer.
1.132 */
1.133 void pvr2_render_buffer_copy_to_sh4( render_buffer_t buffer )
.