Re: [hatari-devel] Hatari screen options (was: Hatari manual.html)

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


Hi,

On maanantai 24 helmikuu 2014, David Savinkoff wrote:
> I am now convinced that any modern Monitor can seamlessly
> display anything thrown at it (or should be able to do so).
>
> This means that Hatari only needs to be concerned with
> emulation, not scaling. Any video processing should be
> #ifdef so that it can can be removed when it becomes obsolete.

Attached patch will show you what kind of frame buffer Hatari
requests from SDL, and what SDL provides to Hatari.

(I think you'll find that you need to patch your SDL version to
get what you want.  And if that works fine, convince upstream
SDL maintainers to include that patch to future SDL releases.)


	- Eero
diff -r 9488d40040dc src/screen.c
--- a/src/screen.c	Sun Feb 23 17:40:23 2014 +0200
+++ b/src/screen.c	Mon Feb 24 21:18:48 2014 +0200
@@ -47,6 +47,13 @@
 #include "falcon/videl.h"
 #include "falcon/hostscreen.h"
 
+#define DEBUG 1
+
+#if DEBUG
+# define DEBUGPRINT(x) printf x
+#else
+# define DEBUGPRINT(x)
+#endif
 
 /* extern for several purposes */
 SDL_Surface *sdlscrn = NULL;                /* The SDL screen surface */
@@ -411,8 +418,13 @@
 			int leftY = maxH - (Height + Statusbar_GetHeightForSize(Width, Height));
 
 			Screen_SetBorderPixels(leftX/nZoom, leftY/nZoom);
+			DEBUGPRINT(("resolution limit:\n\t%d x %d\nlimited resolution:\n\t", maxW, maxH));
+			DEBUGPRINT(("%d * (%d + %d + %d) x (%d + %d + %d)\n", nZoom,
+				    nBorderPixelsLeft, Width/nZoom, nBorderPixelsRight,
+				    nBorderPixelsTop, Height/nZoom, nBorderPixelsBottom));
 			Width += (nBorderPixelsRight + nBorderPixelsLeft)*nZoom;
 			Height += (nBorderPixelsTop + nBorderPixelsBottom)*nZoom;
+			DEBUGPRINT(("\t= %d x %d (+ statusbar)\n", Width, Height));
 		}
 	}
 	
@@ -470,9 +482,9 @@
 		}
 		
 		/* Set new video mode */
-		//fprintf(stderr,"Requesting video mode %i %i %i\n", Width, Height, BitCount);
+		DEBUGPRINT(("SDL screen request: %d x %d @ %d (%s)\n", Width, Height, BitCount, bInFullScreen?"fullscreen":"windowed"));
 		sdlscrn = SDL_SetVideoMode(Width, Height, BitCount, sdlVideoFlags);
-		//fprintf(stderr,"Got video mode %i %i %i\n", sdlscrn->w, sdlscrn->h, sdlscrn->format->BitsPerPixel);
+		DEBUGPRINT(("SDL screen granted: %d x %d @ %d\n", sdlscrn->w, sdlscrn->h, sdlscrn->format->BitsPerPixel));
 
 		/* By default ConfigureParams.Screen.nForceBpp and therefore
 		 * BitCount is zero which means "SDL color depth autodetection".


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