1919cfg_t cfg;
2020static FILE *orig_stdout = NULL ;
2121static FILE *dev_null = NULL ;
22+ static FILE *debug_file = NULL ;
2223
2324typedef enum
2425{
@@ -52,6 +53,12 @@ static const ini_var_t ini_vars[] =
5253 { " HDMI_AUDIO_96K" , (void *)(&(cfg.hdmi_audio_96k )), UINT8 , 0 , 1 },
5354 { " DVI_MODE" , (void *)(&(cfg.dvi_mode )), UINT8 , 0 , 1 },
5455 { " HDMI_LIMITED" , (void *)(&(cfg.hdmi_limited )), UINT8 , 0 , 2 },
56+ { " HDMI_CEC" , (void *)(&(cfg.hdmi_cec )), UINT8 , 0 , 1 },
57+ { " HDMI_CEC_SLEEP" , (void *)(&(cfg.hdmi_cec_sleep )), UINT8 , 0 , 1 },
58+ { " HDMI_CEC_WAKE" , (void *)(&(cfg.hdmi_cec_wake )), UINT8 , 0 , 1 },
59+ { " HDMI_CEC_INPUT_MODE" , (void *)(&(cfg.hdmi_cec_input_mode )), UINT8 , 0 , 1 },
60+ { " HDMI_CEC_POWER_ON" , (void *)(&(cfg.hdmi_cec_power_on )), UINT8 , 0 , 1 },
61+ { " HDMI_CEC_CLOCK" , (void *)(&(cfg.hdmi_cec_clock )), FLOAT , 0 , 100 },
5562 { " KBD_NOMOUSE" , (void *)(&(cfg.kbd_nomouse )), UINT8 , 0 , 1 },
5663 { " MOUSE_THROTTLE" , (void *)(&(cfg.mouse_throttle )), UINT8 , 1 , 100 },
5764 { " BOOTSCREEN" , (void *)(&(cfg.bootscreen )), UINT8 , 0 , 1 },
@@ -108,7 +115,6 @@ static const ini_var_t ini_vars[] =
108115 { " VRR_MODE" , (void *)(&(cfg.vrr_mode )), UINT8 , 0 , 4 },
109116 { " VRR_VESA_FRAMERATE" , (void *)(&(cfg.vrr_vesa_framerate )), UINT8 , 0 , 255 },
110117 { " VIDEO_OFF" , (void *)(&(cfg.video_off )), INT16 , 0 , 3600 },
111- { " VIDEO_OFF_HDMI" , (void *)(&(cfg.video_off_hdmi )), UINT8 , 0 , 1 },
112118 { " VIDEO_OFF_LOGO" , (void *)(&(cfg.video_off_logo )), UINT8 , 0 , 1 },
113119 { " PLAYER_1_CONTROLLER" , (void *)(&(cfg.player_controller [0 ])), STRINGARR , sizeof (cfg.player_controller [0 ]) / sizeof (cfg.player_controller [0 ][0 ]), sizeof (cfg.player_controller [0 ][0 ]) },
114120 { " PLAYER_2_CONTROLLER" , (void *)(&(cfg.player_controller [1 ])), STRINGARR , sizeof (cfg.player_controller [0 ]) / sizeof (cfg.player_controller [0 ][0 ]), sizeof (cfg.player_controller [0 ][0 ]) },
@@ -130,7 +136,7 @@ static const ini_var_t ini_vars[] =
130136 { " CONTROLLER_UNIQUE_MAPPING" , (void *)(cfg.controller_unique_mapping ), UINT32ARR , 0 , 0xFFFFFFFF },
131137 { " OSD_LOCK" , (void *)(&(cfg.osd_lock )), STRING , 0 , sizeof (cfg.osd_lock ) - 1 },
132138 { " OSD_LOCK_TIME" , (void *)(&(cfg.osd_lock_time )), UINT16 , 0 , 60 },
133- { " DEBUG" , (void *)(&(cfg.debug )), UINT8 , 0 , 1 },
139+ { " DEBUG" , (void *)(&(cfg.debug )), UINT8 , 0 , 2 },
134140 { " LOOKAHEAD" , (void *)(&(cfg.lookahead )), UINT8 , 0 , 1 },
135141 { " MAIN" , (void *)(&(cfg.main )), STRING , 0 , sizeof (cfg.main ) - 1 },
136142 { " VFILTER_INTERLACE_DEFAULT" , (void *)(&(cfg.vfilter_interlace_default )), STRING , 0 , sizeof (cfg.vfilter_interlace_default ) - 1 },
@@ -139,6 +145,7 @@ static const ini_var_t ini_vars[] =
139145 { " SCREENSHOT_IMAGE_FORMAT" , (void *)(&(cfg.screenshot_image_format )), STRING , 0 , sizeof (cfg.screenshot_image_format ) - 1 },
140146 { " XBE2_SHIFT" , (void *)(&(cfg.xbe2_shift )), UINT16 , 0 , 0x22F },
141147 { " SPD_QUIRK" , (void *)(&(cfg.spd_quirk )), UINT8 , 0 , 3 },
148+ { " HDMI_OFF" , (void *)(&(cfg.hdmi_off )), UINT16 , 0 , 1440 },
142149};
143150
144151static const int nvars = (int )(sizeof (ini_vars) / sizeof (ini_var_t ));
@@ -427,7 +434,12 @@ static void ini_parse_var(char* buf)
427434 ini_parse_numeric (var, &buf[i], var->var );
428435 if (!strcasecmp (var->name , " DEBUG" ))
429436 {
430- stdout = cfg.debug ? orig_stdout : dev_null;
437+ if (cfg.debug == 2 && !debug_file)
438+ {
439+ debug_file = fopen (" /tmp/debug.txt" , " w" );
440+ setvbuf (debug_file, NULL , _IONBF, 0 );
441+ }
442+ stdout = (cfg.debug == 2 ) ? debug_file : cfg.debug ? orig_stdout : dev_null;
431443 }
432444 break ;
433445 }
@@ -589,13 +601,13 @@ void cfg_parse()
589601 cfg.wheel_force = 50 ;
590602 cfg.dvi_mode = 2 ;
591603 cfg.lookahead = 1 ;
592- cfg.hdr = 0 ;
604+ cfg.hdmi_cec_input_mode = 1 ;
605+ cfg.hdmi_cec_power_on = 1 ;
593606 cfg.hdr_max_nits = 1000 ;
594607 cfg.hdr_avg_nits = 250 ;
595608 cfg.video_brightness = 50 ;
596609 cfg.video_contrast = 50 ;
597610 cfg.video_saturation = 100 ;
598- cfg.video_hue = 0 ;
599611 strcpy (cfg.video_gain_offset , " 1, 0, 1, 0, 1, 0" );
600612 strcpy (cfg.main , " MiSTer" );
601613 has_video_sections = false ;
0 commit comments