summaryrefslogtreecommitdiff
path: root/gui/Config.c
diff options
context:
space:
mode:
authoriCatButler <i.am.catbutler@gmail.com>2018-03-13 17:25:13 +0000
committerGitHub <noreply@github.com>2018-03-13 17:25:13 +0000
commit768332417644451d38ce1a737465656c7cc75de3 (patch)
treee6ca381effb72ccc4161d40f224b817a6631bc03 /gui/Config.c
parent15fe3782c1375634b7a9bd9bbbadfd75e7b06fed (diff)
parent2d0b10f982e0b835f4b27be26b138703907a4219 (diff)
downloadpcsxr-768332417644451d38ce1a737465656c7cc75de3.tar.gz
Merge pull request #6 from loathingKernel/fix-linux-build
Fix compilation on Linux and add the new setting to the UI
Diffstat (limited to 'gui/Config.c')
-rw-r--r--[-rwxr-xr-x]gui/Config.c51
1 files changed, 42 insertions, 9 deletions
diff --git a/gui/Config.c b/gui/Config.c
index 25e2e54b..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;
@@ -142,10 +155,20 @@ int LoadConfig(PcsxConfig *Conf) {
Config.VSyncWA = GetValueb(data, "VSyncWA");
Config.NoMemcard = GetValueb(data, "NoMemcard");
Config.Widescreen = GetValueb(data, "Widescreen");
+ Config.PerGameMcd = GetValueb(data, "PerGameMcd");
+ Config.MemHack = GetValuel(data, "MemHack");
+ Config.OverClock = GetValueb(data, "OverClock");
Config.Cpu = GetValuel(data, "Cpu");
Config.PsxType = GetValuel(data, "PsxType");
- Config.RewindCount = GetValuel(data, "RewindCount");
+ Config.PsxClock = GetValuef(data, "PsxClock");
+
+ Config.PGXP_GTE = GetValueb(data, "PGXP_GTE");
+ Config.PGXP_Cache = GetValueb(data, "PGXP_Cache");
+ Config.PGXP_Texture = GetValueb(data, "PGXP_Texture");
+ Config.PGXP_Mode = GetValuel(data, "PGXP_Mode");
+
+ Config.RewindCount = GetValuel(data, "RewindCount");
Config.RewindInterval = GetValuel(data, "RewindInterval");
Config.AltSpeed1 = GetValuel(data, "AltSpeed1");
@@ -191,7 +214,7 @@ void SaveConfig() {
SetValueb("SioIrq", Config.SioIrq);
SetValueb("Mdec", Config.Mdec);
SetValueb("PsxAuto", Config.PsxAuto);
- SetValuel("Cdda", Config.Cdda);
+ SetValuel("Cdda", (long)Config.Cdda);
SetValueb("SlowBoot",Config.SlowBoot);
SetValueb("Dbg", Config.Debug);
SetValueb("PsxOut", Config.PsxOut);
@@ -200,16 +223,26 @@ void SaveConfig() {
SetValueb("VSyncWA", Config.VSyncWA);
SetValueb("NoMemcard", Config.NoMemcard);
SetValueb("Widescreen", Config.Widescreen);
+ SetValueb("PerGameMcd", Config.PerGameMcd);
+ SetValuel("MemHack", (long)Config.MemHack);
+ SetValueb("OverClock", Config.OverClock);
+
+ SetValuel("Cpu", (long)Config.Cpu);
+ SetValuel("PsxType", (long)Config.PsxType);
+ SetValuef("PsxClock", Config.PsxClock);
+
+ SetValueb("PGXP_GTE", Config.PGXP_GTE);
+ SetValueb("PGXP_Cache", Config.PGXP_Cache);
+ SetValueb("PGXP_Texture", Config.PGXP_Texture);
+ SetValuel("PGXP_Mode", (long)Config.PGXP_Mode);
- SetValuel("Cpu", Config.Cpu);
- SetValuel("PsxType", Config.PsxType);
- SetValuel("RewindCount", Config.RewindCount);
- SetValuel("RewindInterval", Config.RewindInterval);
+ SetValuel("RewindCount", (long)Config.RewindCount);
+ SetValuel("RewindInterval", (long)Config.RewindInterval);
- SetValuel("AltSpeed1", Config.AltSpeed1);
- SetValuel("AltSpeed2", Config.AltSpeed2);
+ SetValuel("AltSpeed1", (long)Config.AltSpeed1);
+ SetValuel("AltSpeed2", (long)Config.AltSpeed2);
- SetValuel("HackFix", Config.HackFix);
+ SetValuel("HackFix", (long)Config.HackFix);
fclose(f);
}