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 uint32_t setting_vb_lcolor=0xFF0000;
25 uint32_t setting_vb_rcolor=0x000000;
26 uint32_t setting_vb_anaglyph_preset=0;
27
28 bool MDFN_SaveSettings(const char *path)
29 {
30 return(1);
31 }
32
33 uint64 MDFN_GetSettingUI(const char *name)
34 {
35 if (!strcmp("vb.anaglyph.lcolor", name))
36 {
37 fprintf(stderr, "Setting UI: %s=%x\n", name, setting_vb_lcolor);
38 return setting_vb_lcolor;
39 }
40 if (!strcmp("vb.anaglyph.rcolor", name))
41 return setting_vb_rcolor;
42
43 fprintf(stderr, "unhandled setting UI: %s\n", name);
44 return 0;
45 }
46
47 int64 MDFN_GetSettingI(const char *name)
48 {
49 if (!strcmp("vb.anaglyph.preset", name))
50 return setting_vb_anaglyph_preset;
51 fprintf(stderr, "unhandled setting I: %s\n", name);
52 return 0;
53 }
54
55 double MDFN_GetSettingF(const char *name)
56 {
57 fprintf(stderr, "unhandled setting F: %s\n", name);
58 return 0;
59 }
60
61 bool MDFN_GetSettingB(const char *name)
62 {
63 if (!strcmp("cheats", name))
64 return 0;
65 /* LIBRETRO */
66 if (!strcmp("libretro.cd_load_into_ram", name))
67 return 0;
68 if (!strcmp("vb.instant_display_hack", name))
69 return 1;
70 if (!strcmp("vb.allow_draw_skip", name))
71 return 1;
72 /* CDROM */
73 if (!strcmp("cdrom.lec_eval", name))
74 return 1;
75 /* FILESYS */
76 if (!strcmp("filesys.untrusted_fip_check", name))
77 return 0;
78 if (!strcmp("filesys.disablesavegz", name))
79 return 1;
80 fprintf(stderr, "unhandled setting B: %s\n", name);
81 return 0;
82 }
83
84 extern std::string retro_base_directory;
85 extern std::string retro_base_name;
86
87 std::string MDFN_GetSettingS(const char *name)
88 {
89 /* FILESYS */
90 if (!strcmp("filesys.path_firmware", name))
91 return retro_base_directory;
92 if (!strcmp("filesys.path_palette", name))
93 return retro_base_directory;
94 if (!strcmp("filesys.path_sav", name))
95 return retro_base_directory;
96 if (!strcmp("filesys.path_state", name))
97 return retro_base_directory;
98 if (!strcmp("filesys.path_cheat", name))
99 return retro_base_directory;
100 if (!strcmp("filesys.fname_state", name))
101 return retro_base_name + std::string(".sav");
102 if (!strcmp("filesys.fname_sav", name))
103 return retro_base_name + std::string(".bsv");
104 fprintf(stderr, "unhandled setting S: %s\n", name);
105 return 0;
106 }
107
108 bool MDFNI_SetSetting(const char *name, const char *value, bool NetplayOverride)
109 {
110 return false;
111 }
112
113 bool MDFNI_SetSettingB(const char *name, bool value)
114 {
115 return false;
116 }
117
118 bool MDFNI_SetSettingUI(const char *name, uint64 value)
119 {
120 return false;
121 }
122
123 void MDFNI_DumpSettingsDef(const char *path)
124 {
125 }