--- hatari/src/falcon/videl.c 2019/04/09 08:47:21 1.1.1.4 +++ hatari/src/falcon/videl.c 2019/04/09 08:48:46 1.1.1.5 @@ -40,7 +40,9 @@ const char VIDEL_fileid[] = "Hatari vide #define HW 0xff8200 #define VIDEL_COLOR_REGS_BEGIN 0xff9800 - +/* TODO: put these to some struct so that it's easier to see + * they're VIDEL global + */ static int width, height, bpp, since_last_change; static bool hostColorsSync; @@ -152,6 +154,60 @@ static int VIDEL_getScreenHeight(void) return yres; } +#if 0 +/* this is easier & more robustly done in hostscreen.c just by + * comparing requested screen width & height to each other. + */ +static void VIDEL_getMonitorScale(int *sx, int *sy) +{ + /* Videl video mode register bits and resulting desktop resolution: + * + * quarter, half, interlace, double: pixels: -> zoom: + * rgb: + * 0 0 0 0 320x200 -> 2 x 2 + * 0 0 1 0 320x400 -> 2 x 1 + * 0 1 0 0 640x200 -> 1 x 2 ! + * 0 1 1 0 640x400 -> 1 x 1 + * vga: + * 0 0 0 1 (just double ?) + * 0 0 1 1 (double & interlace ???) + * 0 1 0 0 320x480 -> 2 x 1 ! + * 0 1 0 1 320x240 -> 2 x 2 + * 0 1 1 1 (double + interlace ???) + * 1 0 0 0 640x480 -> 1 x 1 + * 1 0 0 1 640x240 -> 1 x 2 + */ + int vmode = handleReadW(HW + 0xc2); + + /* half pixel seems to have opposite meaning on + * VGA and RGB monitor, so they need to handled separately + */ + if (handleRead(0xFF8006) & FALCON_MONITOR_VGA) { + if (vmode & 0x08) { // quarter pixel + *sx = 1; + } else { + *sx = 2; + } + if (vmode & 0x01) { // double line + *sy = 2; + } else { + *sy = 1; + } + } else { + if (vmode & 0x04) { // half pixel + *sx = 1; + } else { + *sx = 2; + } + if (vmode & 0x02) { // interlace used only on RGB? + *sy = 1; + } else { + *sy = 2; + } + } +} +#endif + /** map the correct colortable into the correct pixel format */ @@ -238,7 +294,7 @@ bool VIDEL_renderScreen(void) if (!HostScreen_renderBegin()) return false; - if (ConfigureParams.Screen.bZoomLowRes) { + if (nScreenZoomX * nScreenZoomY != 1) { VIDEL_renderScreenZoom(); } else { VIDEL_renderScreenNoZoom();