Re: [hatari-devel] Less dark doubled TV-monitor mode for 32-bit output

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Sat, 2 Nov 2019 01:13:11 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> On 10/31/19 12:59 AM, Eero Tamminen wrote:
> > What do you think of the attached change for making
> > doubled TV-monitor mode less dark on 32-bit output?
> 
> Attached are two patches doing it the way I actually wanted to do it.
> 
> First patch simplifies screen conversion Y-doubling code by removing
> lot of repeated code from inner loops and adding a function for
> doing the same in outer conversion loop.
> 
> After that, halving doubled line intensity for TV-mode needs to
> be done only in single place (second patch).
> 
> Comments?

This code is likely not endianess safe:

+			/* duplicate line pixels get half the intensity of
+			 * above line's pixels R/G/B channels (A is skipped)
+			 */
+			*next++ = *line++ >> 1;
+			*next++ = *line++ >> 1;
+			*next++ = *line++ >> 1;
+			next++; line++;

You have to use the values from SDL_PixelFormat if you want to make it
run properly everywhere. And I think you could do it with 32-bit
arithmetics to speed things up, instead of doing it byte by byte.

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/