Re: [hatari-devel] Falcon upper and lower borders added

[ Thread Index | Date Index | More Archives ]


On tiistai 21 helmikuu 2012, Laurent Sallafranque wrote:
> I've just committed a patch for VIDEL upper and lower borders.

Please take the borders setting (ConfigureParams.Screen.bAllowOverscan)
into account like the ST emulation does and don't show borders unless
so requested by the user.

> It seems to work well, I've tested all Falcon resolutions, and few demos.

Could you optize it a bit?

                                for (h = 0; h < vh_clip; h++) {
                                        Uint16 *fvram_column = fvram_line;
                                        Uint8 *hvram_column = hvram_line;
                                        int w;

                                        /* Render the upper border */
                                        if (h < videl.upperBorderSize) {
                                                for (w = 0; w < vw_clip; 
w++) {
                                                        *hvram_column++ = 
                                        /* Render the graphical area */
                                        else if (h < videl.upperBorderSize + 
videl.YSize) {
                                        /* Render the bottom border */
                                        else {
                                                for (w = 0; w < vw_clip; 
w++) {
                                                        *hvram_column++ = 

                                        hvram_line += scrpitch;


There's no point in calling constantly HostScreen_getPaletteColor(0) to
get the same color again, instead of simply memset()ing what's needed.

And instead of having ifs for bordersize, you could just have three
separate loops for top border, middle part and bottom border.  Or even
just one memset for the borders, something like this:
		videl.upperBorderSize * srcpitch * sizeof(*hvram_line));
	hvram_line += videl.upperBorderSize * srcpitch;

> It works for both new and old cpu.
> If someone could try it also with TT emulation, as the rendering
> routines are the same.
> (I can't start hatari in TT mode, both old and new CPU). I use TOS 3.06
> fr. Maybe I should erase the desktop.ini file ? (I haven't tested).

Problem seems to be due to your changes.  Before those TOS 3.06
boots up fine, after those, it doesn't.

If you go back to version without them:
	hg update b75097826a3c

And try again, TT emulation works...

This check for drawing the middle part is bogus:
	(h < (videl.upperBorderSize + videl.YSize)

You cannot check some videl struct values for that because
TT screen update calls the videl.c screen conversions routines
directly with correct screen size:
        /* Yes, we are abusing the Videl routines for rendering the TT 
modes! */
        if (!HostScreen_renderBegin())
                return false;
        if (nScreenZoomX * nScreenZoomY != 1)
                VIDEL_ConvertScreenZoom(width, height, bpp, width * bpp / 
                VIDEL_ConvertScreenNoZoom(width, height, bpp, width * bpp / 

> I'll upload soon the Falcon left/right borders too.

	- Eero

Mail converted by MHonArc 2.6.19+