Debian Codegraph @

mednafen/settings.cpp

raw symbols SCIP
1 /* Mednafen - Multi-system Emulator
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18 #include "mednafen.h"
19 #include <errno.h>
20 #include <string.h>
21 #include <string>
22 #include "settings.h"
23
24 int setting_initial_scanline = 0;
25 int setting_last_scanline = 242;
26 int setting_pce_fast_nospritelimit = 0;
27 int setting_pce_fast_cddavolume = 100;
28 int setting_pce_fast_adpcmvolume = 100;
29 int setting_pce_fast_cdpsgvolume = 100;
30 uint32_t setting_pce_fast_cdspeed = 1;
31 uint32_t setting_pce_keepaspect = 1;
32
33 uint64 MDFN_GetSettingUI(const char *name)
34 {
35 if (!strcmp("pce_fast.cddavolume", name))
36 return setting_pce_fast_cddavolume;
37 if (!strcmp("pce_fast.adpcmvolume", name))
38 return setting_pce_fast_adpcmvolume;
39 if (!strcmp("pce_fast.cdpsgvolume", name))
40 return setting_pce_fast_cdpsgvolume;
41 if (!strcmp("pce_fast.cdspeed", name))
42 return setting_pce_fast_cdspeed;
43 if (!strcmp("pce_fast.ocmultiplier", name)) /* make configurable */
44 return 1;
45 if (!strcmp("pce_fast.slstart", name))
46 return setting_initial_scanline;
47 if (!strcmp("pce_fast.slend", name))
48 return setting_last_scanline;
49
50 fprintf(stderr, "unhandled setting UI: %s\n", name);
51 return 0;
52 }
53
54 int64 MDFN_GetSettingI(const char *name)
55 {
56 fprintf(stderr, "unhandled setting I: %s\n", name);
57 return 0;
58 }
59
60 double MDFN_GetSettingF(const char *name)
61 {
62 fprintf(stderr, "unhandled setting F: %s\n", name);
63 return 0;
64 }
65
66 bool MDFN_GetSettingB(const char *name)
67 {
68 if (!strcmp("cheats", name))
69 return 0;
70 /* LIBRETRO */
71 if (!strcmp("libretro.cd_load_into_ram", name))
72 return 0;
73 if (!strcmp("pce_fast.input.multitap", name))
74 return 1;
75 if (!strcmp("pce_fast.arcadecard", name))
76 return 1;
77 if (!strcmp("pce_fast.nospritelimit", name))
78 return setting_pce_fast_nospritelimit;
79 if (!strcmp("pce_fast.forcemono", name))
80 return 0;
81 if (!strcmp("pce_fast.disable_softreset", name))
82 return 0;
83 if (!strcmp("pce_fast.adpcmlp", name))
84 return 0;
85 if (!strcmp("pce_fast.correct_aspect", name))
86 return setting_pce_keepaspect;
87 /* CDROM */
88 if (!strcmp("cdrom.lec_eval", name))
89 return 1;
90 /* FILESYS */
91 if (!strcmp("filesys.untrusted_fip_check", name))
92 return 0;
93 if (!strcmp("filesys.disablesavegz", name))
94 return 1;
95 fprintf(stderr, "unhandled setting B: %s\n", name);
96 return 0;
97 }
98
99 extern std::string retro_base_directory;
100 extern std::string retro_base_name;
101
102 std::string MDFN_GetSettingS(const char *name)
103 {
104 if (!strcmp("pce_fast.cdbios", name))
105 return std::string("syscard3.pce");
106 /* FILESYS */
107 if (!strcmp("filesys.path_firmware", name))
108 return retro_base_directory;
109 if (!strcmp("filesys.path_palette", name))
110 return retro_base_directory;
111 if (!strcmp("filesys.path_sav", name))
112 return retro_base_directory;
113 if (!strcmp("filesys.path_state", name))
114 return retro_base_directory;
115 if (!strcmp("filesys.path_cheat", name))
116 return retro_base_directory;
117 if (!strcmp("filesys.fname_state", name))
118 return retro_base_name + std::string(".sav");
119 if (!strcmp("filesys.fname_sav", name))
120 return retro_base_name + std::string(".bsv");
121 fprintf(stderr, "unhandled setting S: %s\n", name);
122 return 0;
123 }
124
125 bool MDFNI_SetSetting(const char *name, const char *value, bool NetplayOverride)
126 {
127 return false;
128 }
129
130 bool MDFNI_SetSettingB(const char *name, bool value)
131 {
132 return false;
133 }
134
135 bool MDFNI_SetSettingUI(const char *name, uint64 value)
136 {
137 return false;
138 }
139
140 void MDFNI_DumpSettingsDef(const char *path)
141 {
142 }