~fitzsim/Main_MiSTer

7ab42bf375668e367b593d94ed05059bea13a7cd — Martin Donlon 2 years ago 3192baa
Initialize has_gamma in video_init (#675)

It was being initialize as a side effect of calling setGamma, but setGamma could early out if no gamma cfg was set already.
1 files changed, 4 insertions(+), 10 deletions(-)

M video.cpp
M video.cpp => video.cpp +4 -10
@@ 649,7 649,7 @@ static void loadScalerCfg()

static char active_gamma_cfg[1024] = { 0 };
static char gamma_cfg[1024] = { 0 };
static char has_gamma = 0;
static char has_gamma = 0; // set in video_init

static void setGamma()
{


@@ 660,15 660,7 @@ static void setGamma()
	fileTextReader reader = {};
	static char filename[1024];

	if (!spi_uio_cmd_cont(UIO_SET_GAMMA))
	{
		DisableIO();
		return;
	}

	has_gamma = 1;
	spi8(0);
	DisableIO();
	if (!has_gamma) return;

	snprintf(filename, sizeof(filename), GAMMA_DIR"/%s", gamma_cfg + 1);



@@ 2003,6 1995,8 @@ void video_init()
	hdmi_config_init();
	video_mode_load();

	has_gamma = spi_uio_cmd(UIO_SET_GAMMA);

	loadGammaCfg();
	loadScalerCfg();
	loadShadowMaskCfg();