From 9f2574f34ef6f010e50b17c7dc1acf18e00a2a34 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Sun, 16 Jul 2017 21:49:12 +0300 Subject: * Move data and pixmaps folders inside gui folder to reflect codeplex branch. * Enable overclock feature in config file. --- gui/Config.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) mode change 100755 => 100644 gui/Config.c (limited to 'gui/Config.c') diff --git a/gui/Config.c b/gui/Config.c old mode 100755 new mode 100644 index 4988757d..16c29c9a --- a/gui/Config.c +++ b/gui/Config.c @@ -62,6 +62,16 @@ static boolean GetValueb(char *src, char *name) { return FALSE; } +static long GetValuef(char *src, char *name) { + char *tmp = strstr(src, name); + if (tmp != NULL) { + tmp += strlen(name); + while ((*tmp == ' ') || (*tmp == '=')) tmp++; + if (*tmp != '\n') return atof(tmp); + } + return 0.0f; +} + #define SetValue(name, var) \ fprintf(f, "%s = %s\n", name, var); @@ -71,6 +81,9 @@ static boolean GetValueb(char *src, char *name) { #define SetValueb(name, var) \ fprintf(f, "%s = %d\n", name, (var) ? 1 : 0); +#define SetValuef(name, var) \ + fprintf(f, "%s = %f\n", name, var); + int LoadConfig(PcsxConfig *Conf) { struct stat buf; FILE *f; @@ -148,7 +161,7 @@ int LoadConfig(PcsxConfig *Conf) { Config.Cpu = GetValuel(data, "Cpu"); Config.PsxType = GetValuel(data, "PsxType"); - //GetValue(data, "PsxClock", &(Config.PsxClock)); + Config.PsxClock = GetValuef(data, "PsxClock"); Config.PGXP_GTE = GetValueb(data, "PGXP_GTE"); Config.PGXP_Cache = GetValueb(data, "PGXP_Cache"); @@ -216,7 +229,7 @@ void SaveConfig() { SetValuel("Cpu", (long)Config.Cpu); SetValuel("PsxType", (long)Config.PsxType); - //SetValue("PsxClock", Config.PsxClock); + SetValuef("PsxClock", Config.PsxClock); SetValueb("PGXP_GTE", Config.PGXP_GTE); SetValueb("PGXP_Cache", Config.PGXP_Cache); -- cgit v1.2.3