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 },
128 "pcsx_rearmed_pad2type",
130 "Pad type for player 2",
132 { "standard", NULL },
134 { "dualshock", NULL },
144 "pcsx_rearmed_pad3type",
146 "Pad type for player 3",
148 { "standard", NULL },
150 { "dualshock", NULL },
160 "pcsx_rearmed_pad4type",
162 "Pad type for player 4",
164 { "standard", NULL },
166 { "dualshock", NULL },
176 "pcsx_rearmed_pad5type",
178 "Pad type for player 5",
180 { "standard", NULL },
182 { "dualshock", NULL },
191 "pcsx_rearmed_pad6type",
193 "Pad type for player 6",
195 { "standard", NULL },
197 { "dualshock", NULL },
206 "pcsx_rearmed_pad7type",
208 "Pad type for player 7",
210 { "standard", NULL },
212 { "dualshock", NULL },
221 "pcsx_rearmed_pad8type",
223 "Pad type for player 8",
225 { "standard", NULL },
227 { "dualshock", NULL },
237 "pcsx_rearmed_multitap1",
239 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
242 { "disabled", NULL },
249 "pcsx_rearmed_multitap2",
251 "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.",
254 { "disabled", NULL },
261 "pcsx_rearmed_negcon_deadzone",
262 "NegCon Twist Deadzone (Percent)",
263 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
277 "pcsx_rearmed_negcon_response",
278 "NegCon Twist Response",
279 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
282 { "quadratic", NULL },
289 "pcsx_rearmed_analog_axis_modifier",
290 "Analog axis bounds.",
291 "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.",
300 "pcsx_rearmed_vibration",
302 "Enables vibration feedback for controllers that supports vibration features.",
304 { "disabled", NULL },
311 "pcsx_rearmed_gunconadjustx",
313 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
372 "pcsx_rearmed_gunconadjusty",
374 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
433 "pcsx_rearmed_gunconadjustratiox",
434 "Guncon Adjust Ratio X",
435 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
494 "pcsx_rearmed_gunconadjustratioy",
495 "Guncon Adjust Ratio Y",
496 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
555 "pcsx_rearmed_dithering",
557 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
559 { "disabled", NULL },
563 #if defined HAVE_LIBNX || defined _3DS
570 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
573 "Dynamic Recompiler",
574 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
576 { "disabled", NULL },
582 #endif /* LIGHTREC || NEW_DYNAREC */
586 "pcsx_rearmed_psxclock",
588 #ifdef HAVE_PRE_ARMV7
589 "Overclock or underclock the PSX clock. Default is 50",
591 "Overclock or underclock the PSX clock. Default is 57",
667 #ifdef HAVE_PRE_ARMV7
673 #endif /* NEW_DYNAREC */
677 "pcsx_rearmed_neon_interlace_enable",
678 "Enable Interlacing Mode",
679 "Enables fake scanlines effect.",
681 { "disabled", NULL },
688 "pcsx_rearmed_neon_enhancement_enable",
689 "Enhanced Resolution (Slow)",
690 "Renders in double resolution at the cost of lower performance.",
692 { "disabled", NULL },
699 "pcsx_rearmed_neon_enhancement_no_main",
700 "Enhanced Resolution (Speed Hack)",
701 "Speed hack for Enhanced resolution option (glitches some games).",
703 { "disabled", NULL },
709 #endif /* GPU_NEON */
712 "pcsx_rearmed_duping_enable",
714 "A speedup, redraws/reuses the last frame if there was no new data.",
716 { "disabled", NULL },
723 "pcsx_rearmed_display_internal_fps",
724 "Display Internal FPS",
725 "Shows an on-screen frames per second counter when enabled.",
727 { "disabled", NULL },
734 /* GPU PEOPS OPTIONS */
737 "pcsx_rearmed_show_gpu_peops_settings",
738 "Advanced GPU P.E.Op.S. Settings",
739 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
741 { "disabled", NULL },
748 "pcsx_rearmed_gpu_peops_odd_even_bit",
749 "(GPU) Odd/Even Bit Hack",
750 "Needed for Chrono Cross.",
752 { "disabled", NULL },
759 "pcsx_rearmed_gpu_peops_expand_screen_width",
760 "(GPU) Expand Screen Width",
761 "Capcom fighting games",
763 { "disabled", NULL },
770 "pcsx_rearmed_gpu_peops_ignore_brightness",
771 "(GPU) Ignore Brightness Color",
772 "Black screens in Lunar Silver Star Story games",
774 { "disabled", NULL },
781 "pcsx_rearmed_gpu_peops_disable_coord_check",
782 "(GPU) Disable Coordinate Check",
783 "Compatibility mode",
785 { "disabled", NULL },
792 "pcsx_rearmed_gpu_peops_lazy_screen_update",
793 "(GPU) Lazy Screen Update",
796 { "disabled", NULL },
803 "pcsx_rearmed_gpu_peops_old_frame_skip",
804 "(GPU) Old Frame Skipping",
805 "Skip every second frame",
807 { "disabled", NULL },
814 "pcsx_rearmed_gpu_peops_repeated_triangles",
815 "(GPU) Repeated Flat Tex Triangles",
816 "Needed by Star Wars: Dark Forces",
818 { "disabled", NULL },
825 "pcsx_rearmed_gpu_peops_quads_with_triangles",
826 "(GPU) Draw Quads with Triangles",
827 "Better g-colors, worse textures",
829 { "disabled", NULL },
836 "pcsx_rearmed_gpu_peops_fake_busy_state",
837 "(GPU) Fake 'Gpu Busy' States",
838 "Toggle busy flags after drawing",
840 { "disabled", NULL },
848 /* GPU UNAI Advanced Options */
851 "pcsx_rearmed_show_gpu_unai_settings",
852 "Advance GPU UNAI/PCSX4All Settings",
853 "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.",
855 { "disabled", NULL },
862 "pcsx_rearmed_gpu_unai_blending",
863 "(GPU) Enable Blending",
866 { "disabled", NULL },
873 "pcsx_rearmed_gpu_unai_lighting",
874 "(GPU) Enable Lighting",
877 { "disabled", NULL },
884 "pcsx_rearmed_gpu_unai_fast_lighting",
885 "(GPU) Enable Fast Lighting",
888 { "disabled", NULL },
895 "pcsx_rearmed_gpu_unai_ilace_force",
896 "(GPU) Enable Forced Interlace",
899 { "disabled", NULL },
906 "pcsx_rearmed_gpu_unai_pixel_skip",
907 "(GPU) Enable Pixel Skip",
910 { "disabled", NULL },
916 #endif /* GPU UNAI Advanced Settings */
919 "pcsx_rearmed_show_bios_bootlogo",
920 "Show Bios Bootlogo",
921 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
923 { "disabled", NULL },
930 "pcsx_rearmed_spu_reverb",
932 "Enables or disables audio reverb effect.",
934 { "disabled", NULL },
941 "pcsx_rearmed_spu_interpolation",
942 "Sound Interpolation",
945 { "simple", "Simple" },
946 { "gaussian", "Gaussian" },
947 { "cubic", "Cubic" },
948 { "off", "disabled" },
954 "pcsx_rearmed_idiablofix",
958 { "disabled", NULL },
965 "pcsx_rearmed_pe2_fix",
966 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
969 { "disabled", NULL },
976 "pcsx_rearmed_inuyasha_fix",
977 "InuYasha Sengoku Battle Fix",
980 { "disabled", NULL },
988 "pcsx_rearmed_async_cd",
989 "CD Access Method (Restart)",
990 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
992 { "sync", "Synchronous" },
993 { "async", "Asynchronous" },
999 /* ADVANCED OPTIONS */
1001 "pcsx_rearmed_noxadecoding",
1005 { "disabled", NULL },
1006 { "enabled", NULL },
1012 "pcsx_rearmed_nocdaudio",
1016 { "disabled", NULL },
1017 { "enabled", NULL },
1023 "pcsx_rearmed_spuirq",
1024 "SPU IRQ Always Enabled",
1025 "Compatibility tweak, should be left to off in most cases.",
1027 { "disabled", NULL },
1028 { "enabled", NULL },
1036 "pcsx_rearmed_nosmccheck",
1037 "(Speed Hack) Disable SMC Checks",
1038 "Will cause crashes when loading, break memcards.",
1040 { "disabled", NULL },
1041 { "enabled", NULL },
1047 "pcsx_rearmed_gteregsunneeded",
1048 "(Speed Hack) Assume GTE Regs Unneeded",
1049 "May cause graphical glitches.",
1051 { "disabled", NULL },
1052 { "enabled", NULL },
1058 "pcsx_rearmed_nogteflags",
1059 "(Speed Hack) Disable GTE Flags",
1060 "Will cause graphical glitches.",
1062 { "disabled", NULL },
1063 { "enabled", NULL },
1068 #endif /* NEW_DYNAREC */
1070 { NULL, NULL, NULL, {{0}}, NULL },
1074 ********************************
1076 ********************************
1079 #ifndef HAVE_NO_LANGEXTRA
1080 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1081 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1082 NULL, /* RETRO_LANGUAGE_JAPANESE */
1083 NULL, /* RETRO_LANGUAGE_FRENCH */
1084 NULL, /* RETRO_LANGUAGE_SPANISH */
1085 NULL, /* RETRO_LANGUAGE_GERMAN */
1086 NULL, /* RETRO_LANGUAGE_ITALIAN */
1087 NULL, /* RETRO_LANGUAGE_DUTCH */
1088 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1089 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1090 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1091 NULL, /* RETRO_LANGUAGE_KOREAN */
1092 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1093 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1094 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1095 NULL, /* RETRO_LANGUAGE_POLISH */
1096 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1097 NULL, /* RETRO_LANGUAGE_ARABIC */
1098 NULL, /* RETRO_LANGUAGE_GREEK */
1099 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1104 ********************************
1106 ********************************
1109 /* Handles configuration/setting of core options.
1110 * Should be called as early as possible - ideally inside
1111 * retro_set_environment(), and no later than retro_load_game()
1112 * > We place the function body in the header to avoid the
1113 * necessity of adding more .c files (i.e. want this to
1114 * be as painless as possible for core devs)
1117 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1119 unsigned version = 0;
1124 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1126 #ifndef HAVE_NO_LANGEXTRA
1127 struct retro_core_options_intl core_options_intl;
1128 unsigned language = 0;
1130 core_options_intl.us = option_defs_us;
1131 core_options_intl.local = NULL;
1133 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1134 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1135 core_options_intl.local = option_defs_intl[language];
1137 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1139 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1145 size_t option_index = 0;
1146 size_t num_options = 0;
1147 struct retro_variable *variables = NULL;
1148 char **values_buf = NULL;
1150 /* Determine number of options
1151 * > Note: We are going to skip a number of irrelevant
1152 * core options when building the retro_variable array,
1153 * but we'll allocate space for all of them. The difference
1154 * in resource usage is negligible, and this allows us to
1155 * keep the code 'cleaner' */
1158 if (option_defs_us[num_options].key)
1164 /* Allocate arrays */
1165 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1166 values_buf = (char **)calloc(num_options, sizeof(char *));
1168 if (!variables || !values_buf)
1171 /* Copy parameters from option_defs_us array */
1172 for (i = 0; i < num_options; i++)
1174 const char *key = option_defs_us[i].key;
1175 const char *desc = option_defs_us[i].desc;
1176 const char *default_value = option_defs_us[i].default_value;
1177 struct retro_core_option_value *values = option_defs_us[i].values;
1179 size_t default_index = 0;
1181 values_buf[i] = NULL;
1183 /* Skip options that are irrelevant when using the
1184 * old style core options interface */
1185 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1190 size_t num_values = 0;
1192 /* Determine number of values */
1195 if (values[num_values].value)
1197 /* Check if this is the default value */
1199 if (strcmp(values[num_values].value, default_value) == 0)
1200 default_index = num_values;
1202 buf_len += strlen(values[num_values].value);
1209 /* Build values string */
1214 buf_len += num_values - 1;
1215 buf_len += strlen(desc);
1217 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1221 strcpy(values_buf[i], desc);
1222 strcat(values_buf[i], "; ");
1224 /* Default value goes first */
1225 strcat(values_buf[i], values[default_index].value);
1227 /* Add remaining values */
1228 for (j = 0; j < num_values; j++)
1230 if (j != default_index)
1232 strcat(values_buf[i], "|");
1233 strcat(values_buf[i], values[j].value);
1239 variables[option_index].key = key;
1240 variables[option_index].value = values_buf[i];
1245 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1252 for (i = 0; i < num_options; i++)
1256 free(values_buf[i]);
1257 values_buf[i] = NULL;