diff options
author | pixel <pixel> | 2004-12-21 16:02:11 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-12-21 16:02:11 +0000 |
commit | d5022a82eb21beb49034b94f84c5d6f466562d5e (patch) | |
tree | d6e90756feb8b896c7f9ed546726e93c1f8f8ab3 /PcsxSrc/Linux/Config.c | |
parent | 2f6ab3ff3c8696b872bce292ffffbd8179c0506a (diff) |
Removing PCSX from PSX-Bundle (I now have true cvs access on sourceforge! Yay!)
Diffstat (limited to 'PcsxSrc/Linux/Config.c')
-rw-r--r-- | PcsxSrc/Linux/Config.c | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/PcsxSrc/Linux/Config.c b/PcsxSrc/Linux/Config.c deleted file mode 100644 index feecefa..0000000 --- a/PcsxSrc/Linux/Config.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Pcsx - Pc Psx Emulator - * Copyright (C) 1999-2002 Pcsx Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <unistd.h> - -#include "Linux.h" - -#define GetValue(name, var) \ - tmp = strstr(data, name); \ - if (tmp != NULL) { \ - tmp+=strlen(name); \ - while ((*tmp == ' ') || (*tmp == '=')) tmp++; \ - if (*tmp != '\n') sscanf(tmp, "%s", var); \ - } - -#define GetValuel(name, var) \ - tmp = strstr(data, name); \ - if (tmp != NULL) { \ - tmp+=strlen(name); \ - while ((*tmp == ' ') || (*tmp == '=')) tmp++; \ - if (*tmp != '\n') sscanf(tmp, "%lx", &var); \ - } - -#define SetValue(name, var) \ - fprintf (f,"%s = %s\n", name, var); - -#define SetValuel(name, var) \ - fprintf (f,"%s = %lx\n", name, var); - -int LoadConfig(PcsxConfig *Conf) { - struct stat buf; - FILE *f; - int size; - char *data,*tmp; - - if (stat(cfgfile, &buf) == -1) return -1; - size = buf.st_size; - - f = fopen(cfgfile,"r"); - if (f == NULL) return -1; - - data = (char*)malloc(size); - if (data == NULL) return -1; - - fread(data, 1, size, f); - fclose(f); - - GetValue("Bios", Config.Bios); - GetValue("Gpu", Config.Gpu); - GetValue("Spu", Config.Spu); - GetValue("Cdr", Config.Cdr); - GetValue("Pad1", Config.Pad1); - GetValue("Pad2", Config.Pad2); - GetValue("Mcd1", Config.Mcd1); - GetValue("Mcd2", Config.Mcd2); - GetValue("PluginsDir", Config.PluginsDir); - GetValue("BiosDir", Config.BiosDir); - GetValuel("Xa", Config.Xa); - GetValuel("Sio", Config.Sio); - GetValuel("Mdec", Config.Mdec); - GetValuel("PsxAuto", Config.PsxAuto); - GetValuel("PsxType", Config.PsxType); - GetValuel("Cdda", Config.Cdda); - GetValuel("Cpu", Config.Cpu); - GetValuel("Log", Config.Log); - GetValuel("PsxOut", Config.PsxOut); - GetValuel("SpuIrq", Config.SpuIrq); - GetValuel("CdTiming",Config.CdTiming); - - free(data); - - return 0; -} - -///////////////////////////////////////////////////////// - -void SaveConfig() { - FILE *f; - - f = fopen(cfgfile,"w"); - if (f == NULL) return; - - SetValue("Bios", Config.Bios); - SetValue("Gpu", Config.Gpu); - SetValue("Spu", Config.Spu); - SetValue("Cdr", Config.Cdr); - SetValue("Pad1", Config.Pad1); - SetValue("Pad2", Config.Pad2); - SetValue("Mcd1", Config.Mcd1); - SetValue("Mcd2", Config.Mcd2); - SetValue("PluginsDir", Config.PluginsDir); - SetValue("BiosDir", Config.BiosDir); - SetValuel("Xa", Config.Xa); - SetValuel("Sio", Config.Sio); - SetValuel("Mdec", Config.Mdec); - SetValuel("PsxAuto", Config.PsxAuto); - SetValuel("PsxType", Config.PsxType); - SetValuel("Cdda", Config.Cdda); - SetValuel("Cpu", Config.Cpu); - SetValuel("Log", Config.Log); - SetValuel("PsxOut", Config.PsxOut); - SetValuel("SpuIrq", Config.SpuIrq); - SetValuel("CdTiming",Config.CdTiming); - - fclose(f); - - return; -} |