render.c: render_containers now always make their own copy of the emulation palette for paletted textures, whether or not there are custom brightness/contrast/gamma settings. Fixes -mt color issues in driftout, raphero, etc. without the additional complexity introduced in fde220f4a7 (which has been reverted) (nw)

This commit is contained in:
Alex W. Jackson 2015-02-23 14:51:32 -05:00
parent 9c92d07fb5
commit afa3796da8
8 changed files with 73 additions and 196 deletions

View File

@ -201,71 +201,6 @@ inline item_layer get_layer_and_blendmode(const layout_view &view, int index, in
return item_layer(layer);
}
//**************************************************************************
// render_texinfo
//**************************************************************************
render_texinfo &render_texinfo::operator=(const render_texinfo &src)
{
free_palette();
base = src.base;
rowpixels = src.rowpixels;
width = src.width;
height = src.height;
seqid = src.seqid;
osddata = src.osddata;
m_palette = src.m_palette;
if (m_palette != NULL)
{
m_palette->ref_count++;
}
return *this;
}
render_texinfo::render_texinfo(const render_texinfo &src)
{
base = src.base;
rowpixels = src.rowpixels;
width = src.width;
height = src.height;
seqid = src.seqid;
osddata = src.osddata;
m_palette = src.m_palette;
if (m_palette != NULL)
{
m_palette->ref_count++;
}
}
void render_texinfo::set_palette(const dynamic_array<rgb_t> *source)
{
free_palette();
if (source != NULL)
{
m_palette = global_alloc(render_palette_copy);
m_palette->palette.copyfrom(*source);
m_palette->ref_count = 1;
}
else
{
m_palette = NULL;
}
}
void render_texinfo::free_palette()
{
if (m_palette != NULL)
{
m_palette->ref_count--;
if (m_palette->ref_count == 0)
{
global_free(m_palette);
}
}
m_palette = NULL;
}
//**************************************************************************
// RENDER PRIMITIVE
//**************************************************************************
@ -277,32 +212,8 @@ void render_texinfo::free_palette()
void render_primitive::reset()
{
// public state
type = INVALID;
container = NULL;
bounds.x0 = 0;
bounds.y0 = 0;
bounds.x1 = 0;
bounds.y1 = 0;
color.a = 0;
color.r = 0;
color.g = 0;
color.b = 0;
flags = 0;
width = 0.0f;
texture.set_palette(NULL);
texture = render_texinfo();
texcoords.bl.u = 0.0f;
texcoords.bl.v = 0.0f;
texcoords.br.u = 0.0f;
texcoords.br.v = 0.0f;
texcoords.tl.u = 0.0f;
texcoords.tl.v = 0.0f;
texcoords.tr.u = 0.0f;
texcoords.tr.v = 0.0f;
// do not clear m_next!
// memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type));
memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type));
}
@ -556,8 +467,7 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
texinfo.rowpixels = m_bitmap->rowpixels();
texinfo.width = swidth;
texinfo.height = sheight;
// will be set later
texinfo.set_palette(NULL);
// palette will be set later
texinfo.seqid = ++m_curseq;
}
else
@ -611,8 +521,7 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
texinfo.rowpixels = scaled->bitmap->rowpixels();
texinfo.width = dwidth;
texinfo.height = dheight;
// will be set later
texinfo.set_palette(NULL);
// palette will be set later
texinfo.seqid = scaled->seqid;
}
}
@ -623,7 +532,7 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
// palette for a texture
//-------------------------------------------------
const dynamic_array<rgb_t> *render_texture::get_adjusted_palette(render_container &container)
const rgb_t *render_texture::get_adjusted_palette(render_container &container)
{
// override the palette with our adjusted palette
switch (m_format)
@ -633,11 +542,7 @@ const dynamic_array<rgb_t> *render_texture::get_adjusted_palette(render_containe
assert(m_bitmap->palette() != NULL);
// if no adjustment necessary, return the raw palette
if (!container.has_brightness_contrast_gamma_changes())
return m_bitmap->palette()->entry_list_adjusted_darray();
// otherwise, return our adjusted palette
// return our adjusted palette
return container.bcg_lookup_table(m_format, m_bitmap->palette());
case TEXFORMAT_RGB32:
@ -671,8 +576,7 @@ render_container::render_container(render_manager &manager, screen_device *scree
m_manager(manager),
m_screen(screen),
m_overlaybitmap(NULL),
m_overlaytexture(NULL),
m_bcglookup256(0x400)
m_overlaytexture(NULL)
{
// make sure it is empty
empty();
@ -685,7 +589,7 @@ render_container::render_container(render_manager &manager, screen_device *scree
m_user.m_brightness = manager.machine().options().brightness();
m_user.m_contrast = manager.machine().options().contrast();
m_user.m_gamma = manager.machine().options().gamma();
// can't allocate palette client yet since palette and screen devices aren't started yet
// palette client will be allocated later
}
recompute_lookups();
@ -812,7 +716,7 @@ float render_container::apply_brightness_contrast_gamma_fp(float value)
// given texture mode
//-------------------------------------------------
const dynamic_array<rgb_t> *render_container::bcg_lookup_table(int texformat, palette_t *palette)
const rgb_t *render_container::bcg_lookup_table(int texformat, palette_t *palette)
{
switch (texformat)
{
@ -820,18 +724,17 @@ const dynamic_array<rgb_t> *render_container::bcg_lookup_table(int texformat, pa
case TEXFORMAT_PALETTEA16:
if (m_palclient == NULL) // if adjusted palette hasn't been created yet, create it
{
assert(palette == m_screen->palette()->palette());
m_palclient.reset(global_alloc(palette_client(*palette)));
m_bcglookup.resize(palette->max_index());
recompute_lookups();
}
assert (palette == &m_palclient->palette());
return &m_bcglookup;
return m_bcglookup;
case TEXFORMAT_RGB32:
case TEXFORMAT_ARGB32:
case TEXFORMAT_YUY16:
return &m_bcglookup256;
return m_bcglookup256;
default:
return NULL;
@ -916,14 +819,19 @@ void render_container::recompute_lookups()
const rgb_t *adjusted_palette = palette.entry_list_adjusted();
int colors = palette.max_index();
for (int i = 0; i < colors; i++)
if (has_brightness_contrast_gamma_changes())
{
rgb_t newval = adjusted_palette[i];
m_bcglookup[i] = (newval & 0xff000000) |
for (int i = 0; i < colors; i++)
{
rgb_t newval = adjusted_palette[i];
m_bcglookup[i] = (newval & 0xff000000) |
m_bcglookup256[0x200 + newval.r()] |
m_bcglookup256[0x100 + newval.g()] |
m_bcglookup256[0x000 + newval.b()];
}
}
else
memcpy(&m_bcglookup[0], adjusted_palette, colors * sizeof(rgb_t));
}
}
@ -949,24 +857,29 @@ void render_container::update_palette()
palette_t &palette = m_palclient->palette();
const rgb_t *adjusted_palette = palette.entry_list_adjusted();
// loop over chunks of 32 entries, since we can quickly examine 32 at a time
for (UINT32 entry32 = mindirty / 32; entry32 <= maxdirty / 32; entry32++)
if (has_brightness_contrast_gamma_changes())
{
UINT32 dirtybits = dirty[entry32];
if (dirtybits != 0)
// loop over chunks of 32 entries, since we can quickly examine 32 at a time
for (UINT32 entry32 = mindirty / 32; entry32 <= maxdirty / 32; entry32++)
{
UINT32 dirtybits = dirty[entry32];
if (dirtybits != 0)
// this chunk of 32 has dirty entries; fix them up
for (UINT32 entry = 0; entry < 32; entry++)
if (dirtybits & (1 << entry))
{
UINT32 finalentry = entry32 * 32 + entry;
rgb_t newval = adjusted_palette[finalentry];
m_bcglookup[finalentry] = (newval & 0xff000000) |
// this chunk of 32 has dirty entries; fix them up
for (UINT32 entry = 0; entry < 32; entry++)
if (dirtybits & (1 << entry))
{
UINT32 finalentry = entry32 * 32 + entry;
rgb_t newval = adjusted_palette[finalentry];
m_bcglookup[finalentry] = (newval & 0xff000000) |
m_bcglookup256[0x200 + newval.r()] |
m_bcglookup256[0x100 + newval.g()] |
m_bcglookup256[0x000 + newval.b()];
}
}
}
}
else
memcpy(&m_bcglookup[mindirty], &adjusted_palette[mindirty], (maxdirty - mindirty + 1) * sizeof(rgb_t));
}
}
@ -1821,13 +1734,9 @@ void render_target::add_container_primitives(render_primitive_list &list, const
height = MIN(height, m_maxtexheight);
curitem->texture()->get_scaled(width, height, prim->texture, list);
// set the palette
#if 1
const dynamic_array<rgb_t> *adjusted_pal = curitem->texture()->get_adjusted_palette(container);
prim->texture.set_palette(adjusted_pal);
#else
prim->texture.palette = curitem->texture()->get_adjusted_palette(container);
#endif
// determine UV coordinates and apply clipping
prim->texcoords = oriented_texcoords[finalorient];

View File

@ -209,46 +209,15 @@ struct render_quad_texuv
// render_texinfo - texture information
struct render_palette_copy
struct render_texinfo
{
int ref_count;
dynamic_array<rgb_t> palette;
};
class render_texinfo
{
public:
render_texinfo()
: base(NULL), rowpixels(0), width(0), height(0),
seqid(0), osddata(0), m_palette(NULL)
{}
render_texinfo(const render_texinfo &src);
~render_texinfo()
{
free_palette();
}
render_texinfo &operator=(const render_texinfo &src);
void * base; // base of the data
UINT32 rowpixels; // pixels per row
UINT32 width; // width of the image
UINT32 height; // height of the image
UINT32 seqid; // sequence ID
UINT64 osddata; // aux data to pass to osd
const rgb_t * palette() const { return ((m_palette == NULL) ? NULL : &m_palette->palette[0]); }
void set_palette(const dynamic_array<rgb_t> *source);
private:
void free_palette();
render_palette_copy *m_palette; // palette for PALETTE16 textures, LUTs for RGB15/RGB32
const rgb_t * palette; // palette for PALETTE16 textures, bcg lookup table for RGB32/YUY16
};
@ -465,7 +434,7 @@ public:
private:
// internal helpers
void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist);
const dynamic_array<rgb_t> *get_adjusted_palette(render_container &container);
const rgb_t *get_adjusted_palette(render_container &container);
static const int MAX_TEXTURE_SCALES = 8;
@ -555,7 +524,7 @@ public:
bool has_brightness_contrast_gamma_changes() const { return (m_user.m_brightness != 1.0f || m_user.m_contrast != 1.0f || m_user.m_gamma != 1.0f); }
UINT8 apply_brightness_contrast_gamma(UINT8 value);
float apply_brightness_contrast_gamma_fp(float value);
const dynamic_array<rgb_t> *bcg_lookup_table(int texformat, palette_t *palette = NULL);
const rgb_t *bcg_lookup_table(int texformat, palette_t *palette = NULL);
private:
// an item describes a high level primitive that is added to a container
@ -606,8 +575,8 @@ private:
bitmap_argb32 * m_overlaybitmap; // overlay bitmap
render_texture * m_overlaytexture; // overlay texture
auto_pointer<palette_client> m_palclient; // client to the screen palette
dynamic_array<rgb_t> m_bcglookup; // full palette lookup with bcg adjustments
dynamic_array<rgb_t> m_bcglookup256; // lookup table for brightness/contrast/gamma
dynamic_array<rgb_t> m_bcglookup; // copy of screen palette with bcg adjustment
rgb_t m_bcglookup256[0x400]; // lookup table for brightness/contrast/gamma
};

View File

@ -130,7 +130,7 @@ private:
static inline UINT32 get_texel_palette16(const render_texinfo &texture, INT32 curu, INT32 curv)
{
const rgb_t *palbase = texture.palette();
const rgb_t *palbase = texture.palette;
if (_BilinearFilter)
{
INT32 u0 = curu >> 16;
@ -166,7 +166,7 @@ private:
static inline UINT32 get_texel_palette16a(const render_texinfo &texture, INT32 curu, INT32 curv)
{
const rgb_t *palbase = texture.palette();
const rgb_t *palbase = texture.palette;
if (_BilinearFilter)
{
INT32 u0 = curu >> 16;
@ -622,7 +622,7 @@ private:
INT32 endx = setup.endx;
// ensure all parameters are valid
assert(prim.texture.palette() != NULL);
assert(prim.texture.palette != NULL);
// fast case: no coloring, no alpha
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
@ -730,7 +730,7 @@ private:
INT32 endx = setup.endx;
// ensure all parameters are valid
assert(prim.texture.palette() != NULL);
assert(prim.texture.palette != NULL);
// fast case: no coloring, no alpha
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
@ -823,7 +823,7 @@ private:
INT32 endx = setup.endx;
// ensure all parameters are valid
assert(prim.texture.palette() != NULL);
assert(prim.texture.palette != NULL);
// fast case: no coloring, no alpha
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
@ -914,7 +914,7 @@ private:
static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@ -1084,7 +1084,7 @@ private:
static void draw_quad_rgb32(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@ -1254,7 +1254,7 @@ private:
static void draw_quad_rgb32_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@ -1392,7 +1392,7 @@ private:
static void draw_quad_argb32_alpha(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@ -1538,7 +1538,7 @@ private:
static void draw_quad_argb32_multiply(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@ -1657,7 +1657,7 @@ private:
static void draw_quad_argb32_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
const rgb_t *palbase = prim.texture.palette();
const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;

View File

@ -170,7 +170,6 @@ public:
// entry list getters
const rgb_t *entry_list_raw() const { return m_entry_color; }
const dynamic_array<rgb_t> *entry_list_adjusted_darray() const { return &m_adjusted_color; }
const rgb_t *entry_list_adjusted() const { return m_adjusted_color; }
const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; }

View File

@ -139,7 +139,7 @@ struct blit_texcopy : public blit_base
blit_texcopy() : blit_base(sizeof(_dest_type) / _len_div, false, false) { }
void texop(const texture_info *texture, const render_texinfo *texsource) const
{
ATTR_UNUSED const rgb_t *palbase = texsource->palette();
ATTR_UNUSED const rgb_t *palbase = texsource->palette;
int x, y;
/* loop over Y */
for (y = 0; y < texsource->height; y++) {
@ -166,7 +166,7 @@ struct blit_texrot : public blit_base
blit_texrot() : blit_base(sizeof(_dest_type), true, false) { }
void texop(const texture_info *texture, const render_texinfo *texsource) const
{
ATTR_UNUSED const rgb_t *palbase = texsource->palette();
ATTR_UNUSED const rgb_t *palbase = texsource->palette;
int x, y;
const quad_setup_data *setup = &texture->m_setup;
int dudx = setup->dudx;

View File

@ -874,7 +874,7 @@ texture_info::texture_info(SDL_Renderer *renderer, const render_texinfo &texsour
m_format = SDL_TEXFORMAT_ARGB32;
break;
case TEXFORMAT_RGB32:
m_format = texsource.palette() ? SDL_TEXFORMAT_RGB32_PALETTED : SDL_TEXFORMAT_RGB32;
m_format = texsource.palette ? SDL_TEXFORMAT_RGB32_PALETTED : SDL_TEXFORMAT_RGB32;
break;
case TEXFORMAT_PALETTE16:
m_format = SDL_TEXFORMAT_PALETTE16;
@ -883,7 +883,7 @@ texture_info::texture_info(SDL_Renderer *renderer, const render_texinfo &texsour
m_format = SDL_TEXFORMAT_PALETTE16A;
break;
case TEXFORMAT_YUY16:
m_format = texsource.palette() ? SDL_TEXFORMAT_YUY16_PALETTED : SDL_TEXFORMAT_YUY16;
m_format = texsource.palette ? SDL_TEXFORMAT_YUY16_PALETTED : SDL_TEXFORMAT_YUY16;
break;
default:

View File

@ -1816,7 +1816,7 @@ void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsour
if ( texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_EQUALS_DEST] &&
!texture_copy_properties[texture->format][SDL_TEXFORMAT_SRC_HAS_PALETTE] &&
texture->xprescale == 1 && texture->yprescale == 1 &&
!texture->borderpix && !texsource->palette() &&
!texture->borderpix && !texsource->palette &&
texsource->rowpixels <= m_texture_max_width )
{
texture->nocopy = TRUE;
@ -2263,7 +2263,7 @@ texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT
texture->format = SDL_TEXFORMAT_ARGB32;
break;
case TEXFORMAT_RGB32:
if (texsource->palette() != NULL)
if (texsource->palette != NULL)
texture->format = SDL_TEXFORMAT_RGB32_PALETTED;
else
texture->format = SDL_TEXFORMAT_RGB32;
@ -2275,7 +2275,7 @@ texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT
texture->format = SDL_TEXFORMAT_PALETTE16A;
break;
case TEXFORMAT_YUY16:
if (texsource->palette() != NULL)
if (texsource->palette != NULL)
texture->format = SDL_TEXFORMAT_YUY16_PALETTED;
else
texture->format = SDL_TEXFORMAT_YUY16;
@ -2717,23 +2717,23 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
switch (PRIMFLAG_GET_TEXFORMAT(flags))
{
case TEXFORMAT_PALETTE16:
copyline_palette16((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette(), texture->borderpix, texture->xprescale);
copyline_palette16((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale);
break;
case TEXFORMAT_PALETTEA16:
copyline_palettea16((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette(), texture->borderpix, texture->xprescale);
copyline_palettea16((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale);
break;
case TEXFORMAT_RGB32:
copyline_rgb32((UINT32 *)dst, (UINT32 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette(), texture->borderpix, texture->xprescale);
copyline_rgb32((UINT32 *)dst, (UINT32 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale);
break;
case TEXFORMAT_ARGB32:
copyline_argb32((UINT32 *)dst, (UINT32 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette(), texture->borderpix, texture->xprescale);
copyline_argb32((UINT32 *)dst, (UINT32 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale);
break;
case TEXFORMAT_YUY16:
copyline_yuy16_to_argb((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette(), texture->borderpix, texture->xprescale);
copyline_yuy16_to_argb((UINT32 *)dst, (UINT16 *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale);
break;
default:
@ -2806,7 +2806,7 @@ static int compare_texture_primitive(const texture_info *texture, const render_p
texture->texinfo.width == prim->texture.width &&
texture->texinfo.height == prim->texture.height &&
texture->texinfo.rowpixels == prim->texture.rowpixels &&
/* texture->texinfo.palette() == prim->texture.palette() && */
/* texture->texinfo.palette == prim->texture.palette && */
((texture->flags ^ prim->flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0)
return 1;
else

View File

@ -2544,28 +2544,28 @@ void texture_info::set_data(const render_texinfo *texsource, UINT32 flags)
switch (PRIMFLAG_GET_TEXFORMAT(flags))
{
case TEXFORMAT_PALETTE16:
copyline_palette16((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_palette16((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
break;
case TEXFORMAT_PALETTEA16:
copyline_palettea16((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_palettea16((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
break;
case TEXFORMAT_RGB32:
copyline_rgb32((UINT32 *)dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_rgb32((UINT32 *)dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
break;
case TEXFORMAT_ARGB32:
copyline_argb32((UINT32 *)dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_argb32((UINT32 *)dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
break;
case TEXFORMAT_YUY16:
if (m_texture_manager->get_yuv_format() == D3DFMT_YUY2)
copyline_yuy16_to_yuy2((UINT16 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_yuy16_to_yuy2((UINT16 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
else if (m_texture_manager->get_yuv_format() == D3DFMT_UYVY)
copyline_yuy16_to_uyvy((UINT16 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_yuy16_to_uyvy((UINT16 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
else
copyline_yuy16_to_argb((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette(), m_xborderpix);
copyline_yuy16_to_argb((UINT32 *)dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix);
break;
default: