diff --git a/cfg.cpp b/cfg.cpp index 8e29c50..cca7424 100644 --- a/cfg.cpp +++ b/cfg.cpp @@ -55,6 +55,7 @@ const ini_var_t ini_vars[] = { { "FB_SIZE", (void*)(&(cfg.fb_size)), UINT8, 1, 4, 1 }, { "FB_TERMINAL", (void*)(&(cfg.fb_terminal)), UINT8, 0, 1, 1 }, { "OSD_TIMEOUT", (void*)(&(cfg.osd_timeout)), INT16, 5, 3600, 1 }, + { "DIRECT_VIDEO", (void*)(&(cfg.direct_video)), UINT8, 0, 1, 1 }, }; // mist ini config diff --git a/cfg.h b/cfg.h index 679fafd..18af5e1 100644 --- a/cfg.h +++ b/cfg.h @@ -24,6 +24,7 @@ typedef struct { uint8_t hdmi_audio_96k; uint8_t dvi; uint8_t hdmi_limited; + uint8_t direct_video; uint8_t video_info; uint8_t vsync_adjust; uint8_t kbd_nomouse; diff --git a/menu.cpp b/menu.cpp index 8c046ec..2d76305 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1652,7 +1652,7 @@ void HandleUI(void) OsdWrite(n++, s, menusub == 3); } - if (video_get_scaler_flt() >= 0) + if (video_get_scaler_flt() >= 0 && !cfg.direct_video) { OsdWrite(n++); menumask |= 0x60; diff --git a/user_io.cpp b/user_io.cpp index 09bc3fc..ab68ecb 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -1632,6 +1632,7 @@ void user_io_send_buttons(char force) if (cfg.hdmi_audio_96k) map |= CONF_AUDIO_96K; if (cfg.dvi) map |= CONF_DVI; if (cfg.hdmi_limited) map |= CONF_HDMI_LIMITED; + if (cfg.direct_video) map |= CONF_DIRECT_VIDEO; if ((map != key_map) || force) { diff --git a/user_io.h b/user_io.h index 03aed34..84a3956 100644 --- a/user_io.h +++ b/user_io.h @@ -119,16 +119,17 @@ #define KBD_LED_FLAG_MASK 0xC0 #define KBD_LED_FLAG_STATUS 0x40 -#define BUTTON1 0b0000000001 -#define BUTTON2 0b0000000010 -#define CONF_VGA_SCALER 0b0000000100 -#define CONF_CSYNC 0b0000001000 -#define CONF_FORCED_SCANDOUBLER 0b0000010000 -#define CONF_YPBPR 0b0000100000 -#define CONF_AUDIO_96K 0b0001000000 -#define CONF_DVI 0b0010000000 -#define CONF_HDMI_LIMITED 0b0100000000 -#define CONF_VGA_SOG 0b1000000000 +#define BUTTON1 0b00000000001 +#define BUTTON2 0b00000000010 +#define CONF_VGA_SCALER 0b00000000100 +#define CONF_CSYNC 0b00000001000 +#define CONF_FORCED_SCANDOUBLER 0b00000010000 +#define CONF_YPBPR 0b00000100000 +#define CONF_AUDIO_96K 0b00001000000 +#define CONF_DVI 0b00010000000 +#define CONF_HDMI_LIMITED 0b00100000000 +#define CONF_VGA_SOG 0b01000000000 +#define CONF_DIRECT_VIDEO 0b10000000000 // core type value should be unlikely to be returned by broken cores #define CORE_TYPE_UNKNOWN 0x55 diff --git a/video.cpp b/video.cpp index b4d9483..28f00e9 100644 --- a/video.cpp +++ b/video.cpp @@ -433,6 +433,11 @@ static void fb_init() void video_mode_load() { fb_init(); + if (cfg.direct_video && cfg.vsync_adjust) + { + printf("Disabling vsync_adjust because of enabled direct video.\n"); + cfg.vsync_adjust = 0; + } vmode_def = store_custom_video_mode(cfg.video_conf, &v_def); vmode_pal = store_custom_video_mode(cfg.video_conf_pal, &v_pal); vmode_ntsc = store_custom_video_mode(cfg.video_conf_ntsc, &v_ntsc);