summaryrefslogtreecommitdiff
path: root/gui/Config.c
diff options
context:
space:
mode:
authorStelios Tsampas <loathingkernel@gmail.com>2017-07-16 21:49:12 +0300
committerStelios Tsampas <loathingkernel@gmail.com>2017-07-16 21:49:12 +0300
commit9f2574f34ef6f010e50b17c7dc1acf18e00a2a34 (patch)
treebac8e09be68602d9ef62bddd7e7cb9e2577f8eb3 /gui/Config.c
parent8f19dd4bc9e8189b3aa28040b2a7ee3fcd977f35 (diff)
downloadpcsxr-9f2574f34ef6f010e50b17c7dc1acf18e00a2a34.tar.gz
* Move data and pixmaps folders inside gui folder to reflect codeplex branch.
* Enable overclock feature in config file.
Diffstat (limited to 'gui/Config.c')
-rw-r--r--[-rwxr-xr-x]gui/Config.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gui/Config.c b/gui/Config.c
index 4988757d..16c29c9a 100755..100644
--- 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);