Commit da25128c authored by Libretro-Admin's avatar Libretro-Admin
Browse files
parent 6c059c78
......@@ -409,7 +409,7 @@ ifeq ($(STATIC_LINKING),1)
endif
ifeq ($(SINGLE_PREC_FLAGS),1)
CORE_DEFINES += -fsingle-precision-constant -fno-builtin-sqrtf
CORE_DEFINES += -fno-builtin-sqrtf
endif
ifeq ($(ARMV7A_FLAGS),1)
......
......@@ -790,3 +790,15 @@ union RegionArrayTile
};
u32 full;
};
enum PixelFormat
{
Pixel1555 = 0,
Pixel565 = 1,
Pixel4444 = 2,
PixelYUV = 3,
PixelBumpMap = 4,
PixelPal4 = 5,
PixelPal8 = 6,
PixelReserved = 7
};
......@@ -151,7 +151,7 @@ struct TextureCacheData
lock_block = 0;
/* Decode info from TSP/TCW into the texture struct */
tex = &format[tcw.PixelFmt==7?0:tcw.PixelFmt]; /* texture format table entry */
tex = &format[tcw.PixelFmt == PixelReserved ? Pixel1555 : tcw.PixelFmt]; /* texture format table entry */
sa_tex = (tcw.TexAddr<<3) & VRAM_MASK; /* texture start address */
sa = sa_tex; /* data texture start address (modified for MIPs, as needed) */
......@@ -185,14 +185,14 @@ struct TextureCacheData
/* Convert a PVR texture into OpenGL */
switch (tcw.PixelFmt)
{
case 0: /* ARGB1555 - value: 1 bit; RGB values: 5 bits each */
case 7: /* RESERVED1 - Regarded as 1555 */
case 1: /* 565 - R value: 5 bits; G value: 6 bits; B value: 5 bits */
case 2: /* 4444 - value: 4 bits; RGB values: 4 bits each */
case 3: /* YUV422 - 32 bits per 2 pixels; YUYV values: 8 bits each */
case 4: /* BUMPMAP - 16 bits/pixel; S value: 8 bits; R value: 8 bits */
case 5: /* 4BPP - Palette texture with 4 bits/pixel */
case 6: /* 8BPP - Palette texture with 8 bits/pixel */
case Pixel1555: /* ARGB1555 - value: 1 bit; RGB values: 5 bits each */
case PixelReserved: /* RESERVED1 - Regarded as 1555 */
case Pixel565: /* 565 - R value: 5 bits; G value: 6 bits; B value: 5 bits */
case Pixel4444: /* 4444 - value: 4 bits; RGB values: 4 bits each */
case PixelYUV: /* YUV422 - 32 bits per 2 pixels; YUYV values: 8 bits each */
case PixelBumpMap: /* BUMPMAP - 16 bits/pixel; S value: 8 bits; R value: 8 bits */
case PixelPal4: /* 4BPP - Palette texture with 4 bits/pixel */
case PixelPal8: /* 8BPP - Palette texture with 8 bits/pixel */
if (tcw.ScanOrder && (tex->PL || tex->PL32))
{
//Texture is stored 'planar' in memory, no deswizzle is needed
......@@ -631,7 +631,7 @@ const TCW TCWTextureCacheMask = { { TexAddr : 0x1FFFFF, Reserved : 0, StrideSel
TextureCacheData *getTextureCacheData(TSP tsp, TCW tcw) {
u64 key = tsp.full & TSPTextureCacheMask.full;
if (tcw.PixelFmt == 5 || tcw.PixelFmt == 6)
if (tcw.PixelFmt == PixelPal4 || tcw.PixelFmt == PixelPal8)
// Paletted textures have a palette selection that must be part of the key
key |= (u64)tcw.full << 32;
else
......
......@@ -148,7 +148,7 @@ struct TextureCacheData
lock_block = 0;
/* Decode info from TSP/TCW into the texture struct */
tex = &format[tcw.PixelFmt==7?0:tcw.PixelFmt]; /* texture format table entry */
tex = &format[tcw.PixelFmt == PixelReserved ? Pixel1555 : tcw.PixelFmt]; /* texture format table entry */
sa_tex = (tcw.TexAddr<<3) & VRAM_MASK; /* texture start address */
sa = sa_tex; /* data texture start address (modified for MIPs, as needed) */
......@@ -182,14 +182,14 @@ struct TextureCacheData
/* Convert a PVR texture into OpenGL */
switch (tcw.PixelFmt)
{
case 0: /* ARGB1555 - value: 1 bit; RGB values: 5 bits each */
case 7: /* RESERVED1 - Regarded as 1555 */
case 1: /* RGB565 - R value: 5 bits; G value: 6 bits; B value: 5 bits */
case 2: /* ARGB4444 - value: 4 bits; RGB values: 4 bits each */
case 3: /* YUV422 - 32 bits per 2 pixels; YUYV values: 8 bits each */
case 4: /* BUMPMAP - 16 bits/pixel; S value: 8 bits; R value: 8 bits */
case 5: /* 4BPP - Palette texture with 4 bits/pixel */
case 6: /* 8BPP - Palette texture with 8 bits/pixel */
case Pixel1555: /* ARGB1555 - value: 1 bit; RGB values: 5 bits each */
case PixelReserved: /* RESERVED1 - Regarded as 1555 */
case Pixel565: /* RGB565 - R value: 5 bits; G value: 6 bits; B value: 5 bits */
case Pixel4444: /* ARGB4444 - value: 4 bits; RGB values: 4 bits each */
case PixelYUV: /* YUV422 - 32 bits per 2 pixels; YUYV values: 8 bits each */
case PixelBumpMap: /* BUMPMAP - 16 bits/pixel; S value: 8 bits; R value: 8 bits */
case PixelPal4: /* 4BPP - Palette texture with 4 bits/pixel */
case PixelPal8: /* 8BPP - Palette texture with 8 bits/pixel */
if (tcw.ScanOrder && (tex->PL || tex->PL32))
{
//Texture is stored 'planar' in memory, no deswizzle is needed
......@@ -608,13 +608,13 @@ void ReadRTTBuffer(void)
switch (fb_packmode) {
case 0:
case 3:
tcw.PixelFmt = 0;
tcw.PixelFmt = Pixel1555;
break;
case 1:
tcw.PixelFmt = 1;
tcw.PixelFmt = Pixel565;
break;
case 2:
tcw.PixelFmt = 2;
tcw.PixelFmt = Pixel4444;
break;
}
TSP tsp = { 0 };
......@@ -651,7 +651,7 @@ const TCW TCWTextureCacheMask = { { TexAddr : 0x1FFFFF, Reserved : 0, StrideSel
TextureCacheData *getTextureCacheData(TSP tsp, TCW tcw) {
u64 key = tsp.full & TSPTextureCacheMask.full;
if (tcw.PixelFmt == 5 || tcw.PixelFmt == 6)
if (tcw.PixelFmt == PixelPal4 || tcw.PixelFmt == PixelPal8)
// Paletted textures have a palette selection that must be part of the key
key |= (u64)tcw.full << 32;
else
......
......@@ -517,6 +517,8 @@ struct settings_t
bool TranslucentPolygonDepthMask;
bool ModifierVolumes;
bool Clipping;
int TextureUpscale;
int MaxFilteredTextureSize;
} rend;
struct
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment