Search
lxdream.org :: lxdream :: r324:340f0b0b7af3
lxdream 0.9.1
released Jun 29
Download Now
changeset324:340f0b0b7af3
parent323:067583c1a704
child325:5717ae5d4746
authornkeynes
dateThu Jan 25 10:12:54 2007 +0000 (12 years ago)
Fix 16-bit palette offsets
src/pvr2/texcache.c
1.1 --- a/src/pvr2/texcache.c Thu Jan 25 08:21:56 2007 +0000
1.2 +++ b/src/pvr2/texcache.c Thu Jan 25 10:12:54 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: texcache.c,v 1.20 2007-01-25 08:16:02 nkeynes Exp $
1.6 + * $Id: texcache.c,v 1.21 2007-01-25 10:12:54 nkeynes Exp $
1.7 *
1.8 * Texture cache. Responsible for maintaining a working set of OpenGL
1.9 * textures.
1.10 @@ -404,7 +404,7 @@
1.11 if( tex_format == PVR2_TEX_FORMAT_IDX8 ) {
1.12 int inputlength = mip_bytes >> bpp_shift;
1.13 int bank = (mode >> 25) &0x03;
1.14 - uint32_t *palette = (uint32_t *)(mmio_region_PVR2PAL.mem + (bank * (256 << bpp_shift)));
1.15 + uint32_t *palette = ((uint32_t *)mmio_region_PVR2PAL.mem) + (bank<<8);
1.16 char tmp[inputlength];
1.17 pvr2_vram64_read_twiddled_8( tmp, texture_addr, mip_width, mip_height );
1.18 if( bpp_shift == 2 ) {
1.19 @@ -415,7 +415,7 @@
1.20 } else if( tex_format == PVR2_TEX_FORMAT_IDX4 ) {
1.21 int inputlength = (mip_width * mip_height) >> 1;
1.22 int bank = (mode >>21 ) & 0x3F;
1.23 - uint32_t *palette = (uint32_t *)(mmio_region_PVR2PAL.mem + (bank * (16 << bpp_shift)));
1.24 + uint32_t *palette = ((uint32_t *)mmio_region_PVR2PAL.mem) + (bank<<4);
1.25 char tmp[inputlength];
1.26 pvr2_vram64_read_twiddled_4( tmp, texture_addr, mip_width, mip_height );
1.27 if( bpp_shift == 2 ) {
.