1 #ifndef LIBRETRO_CORE_OPTIONS_H__
2 #define LIBRETRO_CORE_OPTIONS_H__
8 #include <retro_inline.h>
10 #ifndef HAVE_NO_LANGEXTRA
11 #include "libretro_core_options_intl.h"
15 ********************************
17 ********************************
19 * - 1.3: Move translations to libretro_core_options_intl.h
20 * - libretro_core_options_intl.h includes BOM and utf-8
21 * fix for MSVC 2010-2013
22 * - Added HAVE_NO_LANGEXTRA flag to disable translations
23 * on platforms/compilers without BOM support
24 * - 1.2: Use core options v1 interface when
25 * RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
26 * (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
27 * - 1.1: Support generation of core options v0 retro_core_option_value
28 * arrays containing options with a single value
37 ********************************
38 * Core Option Definitions
39 ********************************
42 /* RETRO_LANGUAGE_ENGLISH */
45 * - All other languages must include the same keys and values
46 * - Will be used as a fallback in the event that frontend language
48 * - Will be used as a fallback for any missing entries in
49 * frontend language definition
52 struct retro_core_option_definition option_defs_us[] = {
54 "pcsx_rearmed_frameskip",
56 "Choose how much frames should be skipped to improve performance at the expense of visual smoothness.",
69 "Allows you to use real bios file (if available) or emulated bios (HLE). Its recommended to use official bios file for better compatibility.",
78 "pcsx_rearmed_region",
80 "Choose what region the system is from. 60 Hz for NTSC, 50 Hz for PAL.",
90 "pcsx_rearmed_memcard2",
91 "Enable Second Memory Card (Shared)",
92 "Enabled the memory card slot 2. This memory card is shared amongst all games.",
101 "pcsx_rearmed_show_other_input_settings",
102 "Show other input settings",
103 "Shows or hides other inputs settings like multitaps, player 3-8 ports, analog fine-tunings, etc.",
105 { "disabled", NULL },
112 "pcsx_rearmed_input_sensitivity",
113 "Emulated Mouse Sensitivity",
114 "Adjust responsiveness when using mouse controller (Default 1.0).",
160 "pcsx_rearmed_pad1type",
162 "Pad type for player 1",
164 { "standard", NULL },
166 { "dualshock", NULL },
176 "pcsx_rearmed_pad2type",
178 "Pad type for player 2",
180 { "standard", NULL },
182 { "dualshock", NULL },
192 "pcsx_rearmed_pad3type",
194 "Pad type for player 3",
196 { "standard", NULL },
198 { "dualshock", NULL },
208 "pcsx_rearmed_pad4type",
210 "Pad type for player 4",
212 { "standard", NULL },
214 { "dualshock", NULL },
224 "pcsx_rearmed_pad5type",
226 "Pad type for player 5",
228 { "standard", NULL },
230 { "dualshock", NULL },
239 "pcsx_rearmed_pad6type",
241 "Pad type for player 6",
243 { "standard", NULL },
245 { "dualshock", NULL },
254 "pcsx_rearmed_pad7type",
256 "Pad type for player 7",
258 { "standard", NULL },
260 { "dualshock", NULL },
269 "pcsx_rearmed_pad8type",
271 "Pad type for player 8",
273 { "standard", NULL },
275 { "dualshock", NULL },
285 "pcsx_rearmed_multitap1",
287 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
290 { "disabled", NULL },
297 "pcsx_rearmed_multitap2",
299 "Enables/Disables multitap on port 2, allowing up to 8 players in games that permit it. Multitap 1 has to be enabled for this to work.",
302 { "disabled", NULL },
309 "pcsx_rearmed_negcon_deadzone",
310 "NegCon Twist Deadzone (Percent)",
311 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
325 "pcsx_rearmed_negcon_response",
326 "NegCon Twist Response",
327 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
330 { "quadratic", NULL },
337 "pcsx_rearmed_analog_axis_modifier",
338 "Analog axis bounds.",
339 "Range bounds for analog axis. Square bounds help controllers with highly circular ranges that are unable to fully saturate the x and y axis at 45degree deflections.",
348 "pcsx_rearmed_vibration",
350 "Enables vibration feedback for controllers that supports vibration features.",
352 { "disabled", NULL },
359 "pcsx_rearmed_gunconadjustx",
361 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
420 "pcsx_rearmed_gunconadjusty",
422 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
481 "pcsx_rearmed_gunconadjustratiox",
482 "Guncon Adjust Ratio X",
483 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
542 "pcsx_rearmed_gunconadjustratioy",
543 "Guncon Adjust Ratio Y",
544 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
603 "pcsx_rearmed_dithering",
605 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
607 { "disabled", NULL },
611 #if defined HAVE_LIBNX || defined _3DS
618 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
621 "Dynamic Recompiler",
622 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
624 { "disabled", NULL },
630 #endif /* LIGHTREC || NEW_DYNAREC */
634 "pcsx_rearmed_psxclock",
636 #ifdef HAVE_PRE_ARMV7
637 "Overclock or underclock the PSX clock. Default is 50",
639 "Overclock or underclock the PSX clock. Default is 57",
715 #ifdef HAVE_PRE_ARMV7
721 #endif /* NEW_DYNAREC */
725 "pcsx_rearmed_neon_interlace_enable",
726 "Enable Interlacing Mode",
727 "Enables fake scanlines effect.",
729 { "disabled", NULL },
736 "pcsx_rearmed_neon_enhancement_enable",
737 "Enhanced Resolution (Slow)",
738 "Renders in double resolution at the cost of lower performance.",
740 { "disabled", NULL },
747 "pcsx_rearmed_neon_enhancement_no_main",
748 "Enhanced Resolution (Speed Hack)",
749 "Speed hack for Enhanced resolution option (glitches some games).",
751 { "disabled", NULL },
757 #endif /* GPU_NEON */
760 "pcsx_rearmed_duping_enable",
762 "A speedup, redraws/reuses the last frame if there was no new data.",
764 { "disabled", NULL },
771 "pcsx_rearmed_display_internal_fps",
772 "Display Internal FPS",
773 "Shows an on-screen frames per second counter when enabled.",
775 { "disabled", NULL },
782 /* GPU PEOPS OPTIONS */
785 "pcsx_rearmed_show_gpu_peops_settings",
786 "Advanced GPU P.E.Op.S. Settings",
787 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
789 { "disabled", NULL },
796 "pcsx_rearmed_gpu_peops_odd_even_bit",
797 "(GPU) Odd/Even Bit Hack",
798 "Needed for Chrono Cross.",
800 { "disabled", NULL },
807 "pcsx_rearmed_gpu_peops_expand_screen_width",
808 "(GPU) Expand Screen Width",
809 "Capcom fighting games",
811 { "disabled", NULL },
818 "pcsx_rearmed_gpu_peops_ignore_brightness",
819 "(GPU) Ignore Brightness Color",
820 "Black screens in Lunar Silver Star Story games",
822 { "disabled", NULL },
829 "pcsx_rearmed_gpu_peops_disable_coord_check",
830 "(GPU) Disable Coordinate Check",
831 "Compatibility mode",
833 { "disabled", NULL },
840 "pcsx_rearmed_gpu_peops_lazy_screen_update",
841 "(GPU) Lazy Screen Update",
844 { "disabled", NULL },
851 "pcsx_rearmed_gpu_peops_old_frame_skip",
852 "(GPU) Old Frame Skipping",
853 "Skip every second frame",
855 { "disabled", NULL },
862 "pcsx_rearmed_gpu_peops_repeated_triangles",
863 "(GPU) Repeated Flat Tex Triangles",
864 "Needed by Star Wars: Dark Forces",
866 { "disabled", NULL },
873 "pcsx_rearmed_gpu_peops_quads_with_triangles",
874 "(GPU) Draw Quads with Triangles",
875 "Better g-colors, worse textures",
877 { "disabled", NULL },
884 "pcsx_rearmed_gpu_peops_fake_busy_state",
885 "(GPU) Fake 'Gpu Busy' States",
886 "Toggle busy flags after drawing",
888 { "disabled", NULL },
896 /* GPU UNAI Advanced Options */
899 "pcsx_rearmed_show_gpu_unai_settings",
900 "Advance GPU UNAI/PCSX4All Settings",
901 "Shows or hides advanced gpu settings. A core restart might be needed for settings to take effect. NOTE: Quick Menu must be toggled for this setting to take effect.",
903 { "disabled", NULL },
910 "pcsx_rearmed_gpu_unai_blending",
911 "(GPU) Enable Blending",
914 { "disabled", NULL },
921 "pcsx_rearmed_gpu_unai_lighting",
922 "(GPU) Enable Lighting",
925 { "disabled", NULL },
932 "pcsx_rearmed_gpu_unai_fast_lighting",
933 "(GPU) Enable Fast Lighting",
936 { "disabled", NULL },
943 "pcsx_rearmed_gpu_unai_ilace_force",
944 "(GPU) Enable Forced Interlace",
947 { "disabled", NULL },
954 "pcsx_rearmed_gpu_unai_pixel_skip",
955 "(GPU) Enable Pixel Skip",
958 { "disabled", NULL },
964 #endif /* GPU UNAI Advanced Settings */
967 "pcsx_rearmed_show_bios_bootlogo",
968 "Show Bios Bootlogo",
969 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
971 { "disabled", NULL },
978 "pcsx_rearmed_spu_reverb",
980 "Enables or disables audio reverb effect.",
982 { "disabled", NULL },
989 "pcsx_rearmed_spu_interpolation",
990 "Sound Interpolation",
993 { "simple", "Simple" },
994 { "gaussian", "Gaussian" },
995 { "cubic", "Cubic" },
996 { "off", "disabled" },
1002 "pcsx_rearmed_idiablofix",
1006 { "disabled", NULL },
1007 { "enabled", NULL },
1013 "pcsx_rearmed_pe2_fix",
1014 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
1017 { "disabled", NULL },
1018 { "enabled", NULL },
1024 "pcsx_rearmed_inuyasha_fix",
1025 "InuYasha Sengoku Battle Fix",
1028 { "disabled", NULL },
1029 { "enabled", NULL },
1036 "pcsx_rearmed_async_cd",
1037 "CD Access Method (Restart)",
1038 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
1040 { "sync", "Synchronous" },
1041 { "async", "Asynchronous" },
1047 /* ADVANCED OPTIONS */
1049 "pcsx_rearmed_noxadecoding",
1053 { "disabled", NULL },
1054 { "enabled", NULL },
1060 "pcsx_rearmed_nocdaudio",
1064 { "disabled", NULL },
1065 { "enabled", NULL },
1071 "pcsx_rearmed_spuirq",
1072 "SPU IRQ Always Enabled",
1073 "Compatibility tweak, should be left to off in most cases.",
1075 { "disabled", NULL },
1076 { "enabled", NULL },
1084 "pcsx_rearmed_nosmccheck",
1085 "(Speed Hack) Disable SMC Checks",
1086 "Will cause crashes when loading, break memcards.",
1088 { "disabled", NULL },
1089 { "enabled", NULL },
1095 "pcsx_rearmed_gteregsunneeded",
1096 "(Speed Hack) Assume GTE Regs Unneeded",
1097 "May cause graphical glitches.",
1099 { "disabled", NULL },
1100 { "enabled", NULL },
1106 "pcsx_rearmed_nogteflags",
1107 "(Speed Hack) Disable GTE Flags",
1108 "Will cause graphical glitches.",
1110 { "disabled", NULL },
1111 { "enabled", NULL },
1116 #endif /* NEW_DYNAREC */
1118 { NULL, NULL, NULL, {{0}}, NULL },
1122 ********************************
1124 ********************************
1127 #ifndef HAVE_NO_LANGEXTRA
1128 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1129 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1130 NULL, /* RETRO_LANGUAGE_JAPANESE */
1131 NULL, /* RETRO_LANGUAGE_FRENCH */
1132 NULL, /* RETRO_LANGUAGE_SPANISH */
1133 NULL, /* RETRO_LANGUAGE_GERMAN */
1134 NULL, /* RETRO_LANGUAGE_ITALIAN */
1135 NULL, /* RETRO_LANGUAGE_DUTCH */
1136 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1137 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1138 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1139 NULL, /* RETRO_LANGUAGE_KOREAN */
1140 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1141 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1142 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1143 NULL, /* RETRO_LANGUAGE_POLISH */
1144 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1145 NULL, /* RETRO_LANGUAGE_ARABIC */
1146 NULL, /* RETRO_LANGUAGE_GREEK */
1147 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1152 ********************************
1154 ********************************
1157 /* Handles configuration/setting of core options.
1158 * Should be called as early as possible - ideally inside
1159 * retro_set_environment(), and no later than retro_load_game()
1160 * > We place the function body in the header to avoid the
1161 * necessity of adding more .c files (i.e. want this to
1162 * be as painless as possible for core devs)
1165 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1167 unsigned version = 0;
1172 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1174 #ifndef HAVE_NO_LANGEXTRA
1175 struct retro_core_options_intl core_options_intl;
1176 unsigned language = 0;
1178 core_options_intl.us = option_defs_us;
1179 core_options_intl.local = NULL;
1181 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1182 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1183 core_options_intl.local = option_defs_intl[language];
1185 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1187 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1193 size_t option_index = 0;
1194 size_t num_options = 0;
1195 struct retro_variable *variables = NULL;
1196 char **values_buf = NULL;
1198 /* Determine number of options
1199 * > Note: We are going to skip a number of irrelevant
1200 * core options when building the retro_variable array,
1201 * but we'll allocate space for all of them. The difference
1202 * in resource usage is negligible, and this allows us to
1203 * keep the code 'cleaner' */
1206 if (option_defs_us[num_options].key)
1212 /* Allocate arrays */
1213 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1214 values_buf = (char **)calloc(num_options, sizeof(char *));
1216 if (!variables || !values_buf)
1219 /* Copy parameters from option_defs_us array */
1220 for (i = 0; i < num_options; i++)
1222 const char *key = option_defs_us[i].key;
1223 const char *desc = option_defs_us[i].desc;
1224 const char *default_value = option_defs_us[i].default_value;
1225 struct retro_core_option_value *values = option_defs_us[i].values;
1227 size_t default_index = 0;
1229 values_buf[i] = NULL;
1231 /* Skip options that are irrelevant when using the
1232 * old style core options interface */
1233 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1238 size_t num_values = 0;
1240 /* Determine number of values */
1243 if (values[num_values].value)
1245 /* Check if this is the default value */
1247 if (strcmp(values[num_values].value, default_value) == 0)
1248 default_index = num_values;
1250 buf_len += strlen(values[num_values].value);
1257 /* Build values string */
1262 buf_len += num_values - 1;
1263 buf_len += strlen(desc);
1265 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1269 strcpy(values_buf[i], desc);
1270 strcat(values_buf[i], "; ");
1272 /* Default value goes first */
1273 strcat(values_buf[i], values[default_index].value);
1275 /* Add remaining values */
1276 for (j = 0; j < num_values; j++)
1278 if (j != default_index)
1280 strcat(values_buf[i], "|");
1281 strcat(values_buf[i], values[j].value);
1287 variables[option_index].key = key;
1288 variables[option_index].value = values_buf[i];
1293 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1300 for (i = 0; i < num_options; i++)
1304 free(values_buf[i]);
1305 values_buf[i] = NULL;