1 /****************************************************************************
2  *  config.c
3  *
4  *  Genesis Plus GX configuration file support
5  *
6  *  Copyright Eke-Eke (2007-2017)
7  *
8  *  Redistribution and use of this code or any derivative works are permitted
9  *  provided that the following conditions are met:
10  *
11  *   - Redistributions may not be sold, nor may they be used in a commercial
12  *     product or activity.
13  *
14  *   - Redistributions that are modified from the original source must include the
15  *     complete source code, including the source code for all components used by a
16  *     binary built from the modified sources. However, as a special exception, the
17  *     source code distributed need not include anything that is normally distributed
18  *     (in either source or binary form) with the major components (compiler, kernel,
19  *     and so on) of the operating system on which the executable runs, unless that
20  *     component itself accompanies the executable.
21  *
22  *   - Redistributions must reproduce the above copyright notice, this list of
23  *     conditions and the following disclaimer in the documentation and/or other
24  *     materials provided with the distribution.
25  *
26  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  *  POSSIBILITY OF SUCH DAMAGE.
37  *
38  ****************************************************************************************/
39 
40 #ifndef _CONFIG_H_
41 #define _CONFIG_H_
42 
43 #define CONFIG_VERSION "GENPLUS-GX 1.7.5"
44 
45 /****************************************************************************
46  * Config Option
47  *
48  ****************************************************************************/
49 typedef struct
50 {
51   char version[16];
52   uint8 hq_fm;
53   uint8 filter;
54   uint8 hq_psg;
55   uint8 ym2612;
56   uint8 ym2413;
57   uint8 mono;
58   int16 psg_preamp;
59   int16 fm_preamp;
60   int16 low_freq;
61   int16 high_freq;
62   int16 lg;
63   int16 mg;
64   int16 hg;
65   uint32 lp_range;
66   uint8 system;
67   uint8 region_detect;
68   uint8 master_clock;
69   uint8 vdp_mode;
70   uint8 force_dtack;
71   uint8 addr_error;
72   uint8 bios;
73   uint8 lock_on;
74   uint8 hot_swap;
75   uint8 invert_mouse;
76   uint8 gun_cursor[2];
77   uint8 overscan;
78   uint8 gg_extra;
79   uint8 lcd;
80   uint8 ntsc;
81   uint8 vsync;
82   uint8 render;
83   uint8 tv_mode;
84   uint8 bilinear;
85   uint8 vfilter;
86   uint8 aspect;
87   int16 xshift;
88   int16 yshift;
89   int16 xscale;
90   int16 yscale;
91 #ifdef HW_RVL
92   uint8 trap;
93   float gamma;
94 #else
95   uint8 v_prog;
96 #endif
97   t_input_config input[MAX_INPUTS];
98   uint16 pad_keymap[4][MAX_KEYS+1];
99 #ifdef HW_RVL
100   uint32 wpad_keymap[4*3+1][MAX_KEYS];
101   uint8 autosleep;
102   int32 calx;
103   int32 caly;
104 #endif
105   uint8 autoload;
106   uint8 autocheat;
107   uint8 s_auto;
108   uint8 s_default;
109   uint8 s_device;
110   uint8 l_device;
111   uint8 bg_overlay;
112   uint8 cd_leds;
113   uint8 fps;
114   int16 screen_w;
115   float bgm_volume;
116   float sfx_volume;
117   char lastdir[FILETYPE_MAX][TYPE_RECENT][MAXPATHLEN];
118   float ntsc_sharpness;
119   float ntsc_resolution;
120   float ntsc_artifacts;
121   float ntsc_fringing;
122   float ntsc_bleed;
123   char sys_rom[12][256];
124 } t_config;
125 
126 extern t_config config;
127 
128 extern void config_save(void);
129 extern void config_default(void);
130 
131 
132 #endif /* _CONFIG_H_ */
133 
134