[hatari-devel] User selectable threshold for window zooming

Eero Tamminen eerot at users.berlios.de
Thu Jan 28 23:25:52 CET 2010


Hi,

On Thursday 28 January 2010, Thomas Huth wrote:
> Eero Tamminen <eerot at users.berlios.de> wrote:
> > I notice an curious thing.  When the "double low rez" option
> > is enabled, it zooms the beginning demo part in horizontal
> > direction, but not in vertical, which makes it look pretty bad.
>
> <obiwan-mode>Use the source, Luke!</obiwan-mode>
>
> Add some printf's to HostScreen_setWindowSize() and you'll see what
> might go wrong.

:-)

How the code works is clear:
                /* Ugly: 400x300 threshold is currently hard-coded. */
                /* Should rather be selectable by the user! */
                if (width && width <= 400)
                {
                        nScreenZoomX = (800/width);
                        width *= nScreenZoomX;
                }
                if (height && height <= 300)
                {
                        nScreenZoomY = (550/height);
                        height *= nScreenZoomY;
                }

Except for the ST-medrez case in screen.c, I was just wondering why one
would want to zoom vertical and horizontal directions by different
amounts?   Does it make sense for Falcon?


Attached is a patch that makes the desired target window resolution
selectable from the configuration file.  If resolution would still fit to
that size when doubled, it will be doubled in both directions.


The code adapts also rest of the Hatari code to use the new configuration 
variables, but I noticed something strange in the original screen.c code:
-------
	else    /* else use 640x400, also for med-rez */
	{
		Width = 640;
		Height = 400;
	}
...
	/* Adjust width/height for overscan borders, if mono or VDI we have no 
overscan */
	if (ConfigureParams.Screen.bAllowOverscan && !bUseHighRes)
	{
		int nZoom = ((Width == 640) ? 2 : 1);
		/* Add in overscan borders (if 640x200 bitmap is double on Y) */
		Width += (nBorderPixelsLeft+nBorderPixelsRight) * nZoom;
		Height += (nBorderPixelsTop+nBorderPixelsBottom) * nZoom;
	}
...
	else if (STRes == ST_MEDIUM_RES && !bUseVDIRes)
	{
		nScreenZoomX = 1;
		nScreenZoomY = 2;
	}
---------

I understand why med-rez is special-cased to be zoomed only in vertical
direction, but why this then doubles border size both in horizontal and
vertical direction?


	- Eero
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winsize.diff
Type: text/x-diff
Size: 13800 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20100129/9c5edf72/attachment.diff>


More information about the hatari-devel mailing list