Experimental direct_video option in INI.

This commit is contained in:
sorgelig
2019-08-20 22:59:34 +08:00
parent 7059d589a6
commit 988355c470
6 changed files with 20 additions and 11 deletions

View File

@@ -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

1
cfg.h
View File

@@ -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;

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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);