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_pad1type",
114 "Pad type for player 1",
116 { "standard", NULL },
118 { "dualshock", NULL },
127 "pcsx_rearmed_pad2type",
129 "Pad type for player 2",
131 { "standard", NULL },
133 { "dualshock", NULL },
142 "pcsx_rearmed_pad3type",
144 "Pad type for player 3",
146 { "standard", NULL },
148 { "dualshock", NULL },
157 "pcsx_rearmed_pad4type",
159 "Pad type for player 4",
161 { "standard", NULL },
163 { "dualshock", NULL },
172 "pcsx_rearmed_pad5type",
174 "Pad type for player 5",
176 { "standard", NULL },
178 { "dualshock", NULL },
186 "pcsx_rearmed_pad6type",
188 "Pad type for player 6",
190 { "standard", NULL },
192 { "dualshock", NULL },
200 "pcsx_rearmed_pad7type",
202 "Pad type for player 7",
204 { "standard", NULL },
206 { "dualshock", NULL },
214 "pcsx_rearmed_pad8type",
216 "Pad type for player 8",
218 { "standard", NULL },
220 { "dualshock", NULL },
229 "pcsx_rearmed_multitap1",
231 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
234 { "disabled", NULL },
241 "pcsx_rearmed_multitap2",
243 "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.",
246 { "disabled", NULL },
253 "pcsx_rearmed_negcon_deadzone",
254 "NegCon Twist Deadzone (Percent)",
255 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
269 "pcsx_rearmed_negcon_response",
270 "NegCon Twist Response",
271 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
274 { "quadratic", NULL },
281 "pcsx_rearmed_analog_axis_modifier",
282 "Analog axis bounds.",
283 "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.",
292 "pcsx_rearmed_vibration",
294 "Enables vibration feedback for controllers that supports vibration features.",
296 { "disabled", NULL },
303 "pcsx_rearmed_gunconadjustx",
305 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
364 "pcsx_rearmed_gunconadjusty",
366 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
425 "pcsx_rearmed_gunconadjustratiox",
426 "Guncon Adjust Ratio X",
427 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
486 "pcsx_rearmed_gunconadjustratioy",
487 "Guncon Adjust Ratio Y",
488 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
547 "pcsx_rearmed_dithering",
549 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
551 { "disabled", NULL },
555 #if defined HAVE_LIBNX || defined _3DS
562 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
565 "Dynamic Recompiler",
566 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
568 { "disabled", NULL },
574 #endif /* LIGHTREC || NEW_DYNAREC */
578 "pcsx_rearmed_psxclock",
580 #ifdef HAVE_PRE_ARMV7
581 "Overclock or underclock the PSX clock. Default is 50",
583 "Overclock or underclock the PSX clock. Default is 57",
659 #ifdef HAVE_PRE_ARMV7
665 #endif /* NEW_DYNAREC */
669 "pcsx_rearmed_neon_interlace_enable",
670 "Enable Interlacing Mode",
671 "Enables fake scanlines effect.",
673 { "disabled", NULL },
680 "pcsx_rearmed_neon_enhancement_enable",
681 "Enhanced Resolution (Slow)",
682 "Renders in double resolution at the cost of lower performance.",
684 { "disabled", NULL },
691 "pcsx_rearmed_neon_enhancement_no_main",
692 "Enhanced Resolution (Speed Hack)",
693 "Speed hack for Enhanced resolution option (glitches some games).",
695 { "disabled", NULL },
701 #endif /* GPU_NEON */
704 "pcsx_rearmed_duping_enable",
706 "A speedup, redraws/reuses the last frame if there was no new data.",
708 { "disabled", NULL },
715 "pcsx_rearmed_display_internal_fps",
716 "Display Internal FPS",
717 "Shows an on-screen frames per second counter when enabled.",
719 { "disabled", NULL },
726 /* GPU PEOPS OPTIONS */
729 "pcsx_rearmed_show_gpu_peops_settings",
730 "Advanced GPU P.E.Op.S. Settings",
731 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
733 { "disabled", NULL },
740 "pcsx_rearmed_gpu_peops_odd_even_bit",
741 "(GPU) Odd/Even Bit Hack",
742 "Needed for Chrono Cross.",
744 { "disabled", NULL },
751 "pcsx_rearmed_gpu_peops_expand_screen_width",
752 "(GPU) Expand Screen Width",
753 "Capcom fighting games",
755 { "disabled", NULL },
762 "pcsx_rearmed_gpu_peops_ignore_brightness",
763 "(GPU) Ignore Brightness Color",
764 "Black screens in Lunar Silver Star Story games",
766 { "disabled", NULL },
773 "pcsx_rearmed_gpu_peops_disable_coord_check",
774 "(GPU) Disable Coordinate Check",
775 "Compatibility mode",
777 { "disabled", NULL },
784 "pcsx_rearmed_gpu_peops_lazy_screen_update",
785 "(GPU) Lazy Screen Update",
788 { "disabled", NULL },
795 "pcsx_rearmed_gpu_peops_old_frame_skip",
796 "(GPU) Old Frame Skipping",
797 "Skip every second frame",
799 { "disabled", NULL },
806 "pcsx_rearmed_gpu_peops_repeated_triangles",
807 "(GPU) Repeated Flat Tex Triangles",
808 "Needed by Star Wars: Dark Forces",
810 { "disabled", NULL },
817 "pcsx_rearmed_gpu_peops_quads_with_triangles",
818 "(GPU) Draw Quads with Triangles",
819 "Better g-colors, worse textures",
821 { "disabled", NULL },
828 "pcsx_rearmed_gpu_peops_fake_busy_state",
829 "(GPU) Fake 'Gpu Busy' States",
830 "Toggle busy flags after drawing",
832 { "disabled", NULL },
840 /* GPU UNAI Advanced Options */
843 "pcsx_rearmed_show_gpu_unai_settings",
844 "Advance GPU UNAI/PCSX4All Settings",
845 "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.",
847 { "disabled", NULL },
854 "pcsx_rearmed_gpu_unai_blending",
855 "(GPU) Enable Blending",
858 { "disabled", NULL },
865 "pcsx_rearmed_gpu_unai_lighting",
866 "(GPU) Enable Lighting",
869 { "disabled", NULL },
876 "pcsx_rearmed_gpu_unai_fast_lighting",
877 "(GPU) Enable Fast Lighting",
880 { "disabled", NULL },
887 "pcsx_rearmed_gpu_unai_ilace_force",
888 "(GPU) Enable Forced Interlace",
891 { "disabled", NULL },
898 "pcsx_rearmed_gpu_unai_pixel_skip",
899 "(GPU) Enable Pixel Skip",
902 { "disabled", NULL },
908 #endif /* GPU UNAI Advanced Settings */
911 "pcsx_rearmed_show_bios_bootlogo",
912 "Show Bios Bootlogo",
913 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
915 { "disabled", NULL },
922 "pcsx_rearmed_spu_reverb",
924 "Enables or disables audio reverb effect.",
926 { "disabled", NULL },
933 "pcsx_rearmed_spu_interpolation",
934 "Sound Interpolation",
937 { "simple", "Simple" },
938 { "gaussian", "Gaussian" },
939 { "cubic", "Cubic" },
940 { "off", "disabled" },
946 "pcsx_rearmed_idiablofix",
950 { "disabled", NULL },
957 "pcsx_rearmed_pe2_fix",
958 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
961 { "disabled", NULL },
968 "pcsx_rearmed_inuyasha_fix",
969 "InuYasha Sengoku Battle Fix",
972 { "disabled", NULL },
980 "pcsx_rearmed_async_cd",
981 "CD Access Method (Restart)",
982 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
984 { "sync", "Synchronous" },
985 { "async", "Asynchronous" },
991 /* ADVANCED OPTIONS */
993 "pcsx_rearmed_noxadecoding",
997 { "disabled", NULL },
1004 "pcsx_rearmed_nocdaudio",
1008 { "disabled", NULL },
1009 { "enabled", NULL },
1015 "pcsx_rearmed_spuirq",
1016 "SPU IRQ Always Enabled",
1017 "Compatibility tweak, should be left to off in most cases.",
1019 { "disabled", NULL },
1020 { "enabled", NULL },
1028 "pcsx_rearmed_nosmccheck",
1029 "(Speed Hack) Disable SMC Checks",
1030 "Will cause crashes when loading, break memcards.",
1032 { "disabled", NULL },
1033 { "enabled", NULL },
1039 "pcsx_rearmed_gteregsunneeded",
1040 "(Speed Hack) Assume GTE Regs Unneeded",
1041 "May cause graphical glitches.",
1043 { "disabled", NULL },
1044 { "enabled", NULL },
1050 "pcsx_rearmed_nogteflags",
1051 "(Speed Hack) Disable GTE Flags",
1052 "Will cause graphical glitches.",
1054 { "disabled", NULL },
1055 { "enabled", NULL },
1060 #endif /* NEW_DYNAREC */
1062 { NULL, NULL, NULL, {{0}}, NULL },
1066 ********************************
1068 ********************************
1071 #ifndef HAVE_NO_LANGEXTRA
1072 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1073 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1074 NULL, /* RETRO_LANGUAGE_JAPANESE */
1075 NULL, /* RETRO_LANGUAGE_FRENCH */
1076 NULL, /* RETRO_LANGUAGE_SPANISH */
1077 NULL, /* RETRO_LANGUAGE_GERMAN */
1078 NULL, /* RETRO_LANGUAGE_ITALIAN */
1079 NULL, /* RETRO_LANGUAGE_DUTCH */
1080 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1081 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1082 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1083 NULL, /* RETRO_LANGUAGE_KOREAN */
1084 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1085 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1086 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1087 NULL, /* RETRO_LANGUAGE_POLISH */
1088 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1089 NULL, /* RETRO_LANGUAGE_ARABIC */
1090 NULL, /* RETRO_LANGUAGE_GREEK */
1091 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1096 ********************************
1098 ********************************
1101 /* Handles configuration/setting of core options.
1102 * Should be called as early as possible - ideally inside
1103 * retro_set_environment(), and no later than retro_load_game()
1104 * > We place the function body in the header to avoid the
1105 * necessity of adding more .c files (i.e. want this to
1106 * be as painless as possible for core devs)
1109 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1111 unsigned version = 0;
1116 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1118 #ifndef HAVE_NO_LANGEXTRA
1119 struct retro_core_options_intl core_options_intl;
1120 unsigned language = 0;
1122 core_options_intl.us = option_defs_us;
1123 core_options_intl.local = NULL;
1125 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1126 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1127 core_options_intl.local = option_defs_intl[language];
1129 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1131 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1137 size_t option_index = 0;
1138 size_t num_options = 0;
1139 struct retro_variable *variables = NULL;
1140 char **values_buf = NULL;
1142 /* Determine number of options
1143 * > Note: We are going to skip a number of irrelevant
1144 * core options when building the retro_variable array,
1145 * but we'll allocate space for all of them. The difference
1146 * in resource usage is negligible, and this allows us to
1147 * keep the code 'cleaner' */
1150 if (option_defs_us[num_options].key)
1156 /* Allocate arrays */
1157 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1158 values_buf = (char **)calloc(num_options, sizeof(char *));
1160 if (!variables || !values_buf)
1163 /* Copy parameters from option_defs_us array */
1164 for (i = 0; i < num_options; i++)
1166 const char *key = option_defs_us[i].key;
1167 const char *desc = option_defs_us[i].desc;
1168 const char *default_value = option_defs_us[i].default_value;
1169 struct retro_core_option_value *values = option_defs_us[i].values;
1171 size_t default_index = 0;
1173 values_buf[i] = NULL;
1175 /* Skip options that are irrelevant when using the
1176 * old style core options interface */
1177 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1182 size_t num_values = 0;
1184 /* Determine number of values */
1187 if (values[num_values].value)
1189 /* Check if this is the default value */
1191 if (strcmp(values[num_values].value, default_value) == 0)
1192 default_index = num_values;
1194 buf_len += strlen(values[num_values].value);
1201 /* Build values string */
1206 buf_len += num_values - 1;
1207 buf_len += strlen(desc);
1209 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1213 strcpy(values_buf[i], desc);
1214 strcat(values_buf[i], "; ");
1216 /* Default value goes first */
1217 strcat(values_buf[i], values[default_index].value);
1219 /* Add remaining values */
1220 for (j = 0; j < num_values; j++)
1222 if (j != default_index)
1224 strcat(values_buf[i], "|");
1225 strcat(values_buf[i], values[j].value);
1231 variables[option_index].key = key;
1232 variables[option_index].value = values_buf[i];
1237 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1244 for (i = 0; i < num_options; i++)
1248 free(values_buf[i]);
1249 values_buf[i] = NULL;