diff --git a/MiSTer.ini b/MiSTer.ini index 0a85fd1..b0c9b67 100644 --- a/MiSTer.ini +++ b/MiSTer.ini @@ -8,6 +8,8 @@ hdmi_audio_96k=0 ; set to 1 for 96khz/16bit HDMI audio (48khz/16bit otherw keyrah_mode=0x18d80002 ; VIDPID of keyrah for special code translation (0x23418037 for Arduino Micro) volumectl=0 ; enable audio volume control by multimedia keys vscale_integer=0 ; set to 1 to use only integer vertical scaling +vscale_border=0 ; set vertical border for TVs cutting the upper/bottom parts of screen (1-99) + ; vscale_integer and vscale_border are mutually exclusive! ;bootscreen=0 ; uncomment to disable boot screen of some cores like Minimig. ;mouse_throttle=10 ; 1-100 mouse speed divisor. Useful for very sensitive mouses diff --git a/cfg.cpp b/cfg.cpp index e846e3e..cb4fee7 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -41,6 +41,7 @@ const ini_var_t ini_vars[] = { { "BOOTSCREEN", (void*)(&(cfg.bootscreen)), UINT8, 0, 1, 1 }, { "VOLUMECTL", (void*)(&(cfg.volumectl)), UINT8, 0, 1, 1 }, { "VSCALE_INTEGER", (void*)(&(cfg.vscale_integer)), UINT8, 0, 1, 1 }, + { "VSCALE_BORDER", (void*)(&(cfg.vscale_border)), UINT8, 0, 100, 1 }, }; // mist ini config diff --git a/cfg.h b/cfg.h index 597e473..e62e2b4 100644 --- a/cfg.h +++ b/cfg.h @@ -30,6 +30,7 @@ typedef struct { uint8_t bootscreen; uint8_t volumectl; uint8_t vscale_integer; + uint8_t vscale_border; char video_conf[1024]; } cfg_t; diff --git a/user_io.cpp b/user_io.cpp index f3c66fd..35f7a89 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -3055,7 +3055,15 @@ static uint32_t show_video_info(int force) Info(str, cfg.video_info * 1000); } - if (cfg.vscale_integer && height && (height <= vitems[5])) + if (cfg.vscale_border && height && (height <= vitems[5])) + { + uint32_t border = cfg.vscale_border * 2; + if ((border + 100) > vitems[5]) border = vitems[5] - 100; + height = vitems[5] - border; + printf("Set vertical scaling to : %d\n", height); + spi_uio_cmd16(UIO_SETHEIGHT, height); + } + else if (cfg.vscale_integer && height && (height <= vitems[5])) { uint32_t mag = vitems[5] / height; height *= mag;