initial fce ultra 0.81 import
[fceu.git] / drivers / win / config.c
1 /* FCE Ultra - NES/Famicom Emulator
2  *
3  * Copyright notice for this file:
4  *  Copyright (C) 2002 Ben Parnell
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 /****************************************************************/
22 /*                      FCE Ultra                               */
23 /*                                                              */
24 /*      This file contains code to interface to the standard    */
25 /*      FCE Ultra configuration file saving/loading code.       */
26 /*                                                              */
27 /****************************************************************/
28 #include "../common/config.h"
29
30 static CFGSTRUCT fceuconfig[]={
31
32         ACS(rfiles[0]),
33         ACS(rfiles[1]),
34         ACS(rfiles[2]),
35         ACS(rfiles[3]),
36         ACS(rfiles[4]),
37         ACS(rfiles[5]),
38         ACS(rfiles[6]),
39         ACS(rfiles[7]),
40         ACS(rfiles[8]),
41         ACS(rfiles[9]),
42
43         AC(ntsccol),AC(ntsctint),AC(ntschue),
44
45         AC(soundsleep),
46         NAC("palyo",palyo),
47         NAC("genie",genie),
48         NAC("fs",fullscreen),
49         NAC("vgamode",vmod),
50         NAC("sound",soundo),
51
52         ACS(gfsdir),
53
54         NACS("odcheats",DOvers[0]),
55         NACS("odmisc",DOvers[1]),
56         NACS("odnonvol",DOvers[2]),
57         NACS("odstates",DOvers[3]),
58         NACS("odsnaps",DOvers[4]),
59         NACS("odbase",DOvers[5]),
60
61         NAC("winsizemul",winsizemul),
62
63         AC(soundrate),
64         AC(soundbuftime),
65         AC(soundoptions),
66         AC(soundvolume),
67
68         NAC("eoptions",eoptions),
69         NACA("cpalette",cpalette),
70
71         ACA(joy),
72         ACA(joyA),ACA(joyB),ACA(joySelect),ACA(joyStart),
73
74         AC(joyOptions),
75         ACA(joyUp),ACA(joyDown),ACA(joyLeft),ACA(joyRight),
76
77         NACA("InputType",UsrInputType),
78         NAC("keyben",keybEnable),
79
80         NACA("keybm0",keyBMap[0]),
81         NACA("keybm1",keyBMap[1]),
82         NACA("keybm2",keyBMap[2]),
83         NACA("keybm3",keyBMap[3]),
84         NACA("ppasc0",powerpadsc[0]),
85         NACA("ppasc1",powerpadsc[1]),
86
87         NAC("ppaside",powerpadside),
88         NAC("vmcx",vmodes[0].x),
89         NAC("vmcy",vmodes[0].y),
90         NAC("vmcb",vmodes[0].bpp),
91         NAC("vmcf",vmodes[0].flags),
92         NAC("vmcxs",vmodes[0].xscale),
93         NAC("vmcys",vmodes[0].yscale),
94
95         NAC("srendline",srendlinen),
96         NAC("erendline",erendlinen),
97         NAC("srendlinep",srendlinep),
98         NAC("erendlinep",erendlinep),
99
100         AC(UsrInputTypeFC),
101         AC(winsync),
102         AC(fssync),
103         AC(NoFourScore),
104         ACA(fkbmap),
105         ENDCFGSTRUCT
106 };
107
108 static void SaveConfig(char *filename)
109 {
110         DriverInterface(DES_GETNTSCTINT,&ntsctint);
111         DriverInterface(DES_GETNTSCHUE,&ntschue);
112         SaveFCEUConfig(filename,fceuconfig);
113 }
114
115 static void LoadConfig(char *filename)
116 {
117         DriverInterface(DES_GETNTSCTINT,&ntsctint);
118         DriverInterface(DES_GETNTSCHUE,&ntschue);
119         LoadFCEUConfig(filename,fceuconfig);
120         DriverInterface(DES_NTSCCOL,&ntsccol);
121         DriverInterface(DES_SETNTSCTINT,&ntsctint);
122         DriverInterface(DES_SETNTSCHUE,&ntschue);
123
124         palyo&=1;
125         FCEUI_SetVidSystem(palyo);
126         genie&=1;
127         FCEUI_SetGameGenie(genie);
128         fullscreen&=1;
129         soundo&=1;
130         FCEUI_SetSoundVolume(soundvolume);
131 }
132