From 19f93bb27da0970007018b4ae9c1e22fe8a6e400 Mon Sep 17 00:00:00 2001 From: joseph Date: Tue, 27 Dec 2016 22:55:02 -0600 Subject: [PATCH] Add missing 8bpp paletted texture conversions --- src/hw/pvr/pixel_convert.h | 2 ++ src/hw/pvr/tr.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/hw/pvr/pixel_convert.h b/src/hw/pvr/pixel_convert.h index daa8c315..2c34fc56 100644 --- a/src/hw/pvr/pixel_convert.h +++ b/src/hw/pvr/pixel_convert.h @@ -285,6 +285,8 @@ define_convert_pal4(RGB565, RGB565); define_convert_pal4(ARGB4444, RGBA4444); define_convert_pal4(ARGB8888, RGBA8888); +define_convert_pal8(ARGB1555, RGBA5551); +define_convert_pal8(RGB565, RGB565); define_convert_pal8(ARGB4444, RGBA4444); define_convert_pal8(ARGB8888, RGBA8888); diff --git a/src/hw/pvr/tr.c b/src/hw/pvr/tr.c index 3087f011..ff2de769 100644 --- a/src/hw/pvr/tr.c +++ b/src/hw/pvr/tr.c @@ -280,6 +280,20 @@ static texture_handle_t tr_demand_texture(struct tr *tr, CHECK(!compressed); output = converted; switch (ctx->pal_pxl_format) { + case TA_PAL_ARGB1555: + pixel_fmt = PXL_RGBA5551; + convert_pal8_ARGB1555_RGBA5551(input, (uint16_t *)converted, + (const uint32_t *)palette, width, + height); + break; + + case TA_PAL_RGB565: + pixel_fmt = PXL_RGB565; + convert_pal8_RGB565_RGB565(input, (uint16_t *)converted, + (const uint32_t *)palette, width, + height); + break; + case TA_PAL_ARGB4444: pixel_fmt = PXL_RGBA4444; convert_pal8_ARGB4444_RGBA4444(input, (uint16_t *)converted,