vsync_adjust=2 for low latency mode.

This commit is contained in:
sorgelig
2018-12-26 22:12:10 +08:00
parent b6e1b127ca
commit 33921e306f
3 changed files with 5 additions and 4 deletions

View File

@@ -45,7 +45,8 @@ video_mode=0
; set to 1-10 (seconds) to display video info on startup/change
video_info=0
; set to 1 for automatic HDMI VSync rate adjust to match original VSync.
; Set to 1 for automatic HDMI VSync rate adjust to match original VSync.
; Set to 2 for low latency mode (single buffer).
; This option makes video butter smooth like on original emulated system.
; Adjusting is done by changing pixel clock. Not every display supports variable pixel clock.
; For proper adjusting and to reduce possible out of range pixel clock, use 60Hz HDMI video

View File

@@ -33,7 +33,7 @@ const ini_var_t ini_vars[] = {
{ "KEY_MENU_AS_RGUI", (void*)(&(cfg.key_menu_as_rgui)), UINT8, 0, 1, 1 },
{ "VIDEO_MODE", (void*)(cfg.video_conf), STRING, 0, sizeof(cfg.video_conf)-1, 1 },
{ "VIDEO_INFO", (void*)(&(cfg.video_info)), UINT8, 0, 10, 1 },
{ "VSYNC_ADJUST", (void*)(&(cfg.vsync_adjust)), UINT8, 0, 1, 1 },
{ "VSYNC_ADJUST", (void*)(&(cfg.vsync_adjust)), UINT8, 0, 2, 1 },
{ "HDMI_AUDIO_96K", (void*)(&(cfg.hdmi_audio_96k)), UINT8, 0, 1, 1 },
{ "DVI_MODE", (void*)(&(cfg.dvi)), UINT8, 0, 1, 1 },
{ "KBD_NOMOUSE", (void*)(&(cfg.kbd_nomouse)), UINT8, 0, 1, 1 },

View File

@@ -2810,7 +2810,7 @@ static void setVideo()
for (int i = 9; i < 21; i++)
{
printf("0x%X, ", vitems[i]);
if (i & 1) spi_w(vitems[i]);
if (i & 1) spi_w(vitems[i] | ((i==9 && cfg.vsync_adjust==2) ? 0x8000 : 0));
else
{
spi_w(vitems[i]);
@@ -2904,7 +2904,7 @@ void parse_video_mode()
static int adjust_video_mode(uint32_t vtime)
{
printf("Adjust VSync.\n");
printf("Adjust VSync(%d).\n", cfg.vsync_adjust);
double Fpix = 100 * (vitems[1] + vitems[2] + vitems[3] + vitems[4]) * (vitems[5] + vitems[6] + vitems[7] + vitems[8]);
Fpix /= vtime;