/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/PadNull/Windows/Config.cpp
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/PadNull/Windows/Config.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 415 - (show annotations) (download)
Sun Feb 27 08:25:06 2011 UTC (8 years, 10 months ago) by william
File size: 1886 byte(s)
fix issues from upstream merge of r4239-r4370
1 /* PadNull
2 * Copyright (C) 2004-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16 #include <stdlib.h>
17
18 #include "../Pad.h"
19
20 extern HINSTANCE hInst;
21 void SaveConfig()
22 {
23
24 Config *Conf1 = &conf;
25 char *szTemp;
26 char szIniFile[256], szValue[256];
27
28 GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
29 szTemp = strrchr(szIniFile, '\\');
30
31 if(!szTemp) return;
32 strcpy(szTemp, "\\inis\\fwnull.ini");
33 sprintf(szValue,"%u",Conf1->Log);
34 WritePrivateProfileString("Interface", "Logging",szValue,szIniFile);
35
36 }
37
38 void LoadConfig() {
39 FILE *fp;
40
41
42 Config *Conf1 = &conf;
43 char *szTemp;
44 char szIniFile[256], szValue[256];
45
46 GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
47 szTemp = strrchr(szIniFile, '\\');
48
49 if(!szTemp) return ;
50 strcpy(szTemp, "\\inis\\fwnull.ini");
51 fp=fopen("inis\\fwnull.ini","rt");//check if firewirenull.ini really exists
52 if (!fp)
53 {
54 CreateDirectory("inis",NULL);
55 memset(&conf, 0, sizeof(conf));
56 conf.Log = 0;//default value
57 SaveConfig();//save and return
58 return ;
59 }
60 fclose(fp);
61 GetPrivateProfileString("Interface", "Logging", NULL, szValue, 20, szIniFile);
62 Conf1->Log = strtoul(szValue, NULL, 10);
63 return ;
64
65 }
66

  ViewVC Help
Powered by ViewVC 1.1.22