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_pad1type",
103 "Pad type for player 1",
105 { "standard", NULL },
107 { "dualshock", NULL },
116 "pcsx_rearmed_pad2type",
118 "Pad type for player 2",
120 { "standard", NULL },
122 { "dualshock", NULL },
131 "pcsx_rearmed_pad3type",
133 "Pad type for player 3",
135 { "standard", NULL },
137 { "dualshock", NULL },
146 "pcsx_rearmed_pad4type",
148 "Pad type for player 4",
150 { "standard", NULL },
152 { "dualshock", NULL },
161 "pcsx_rearmed_pad5type",
163 "Pad type for player 5",
165 { "standard", NULL },
167 { "dualshock", NULL },
175 "pcsx_rearmed_pad6type",
177 "Pad type for player 6",
179 { "standard", NULL },
181 { "dualshock", NULL },
189 "pcsx_rearmed_pad7type",
191 "Pad type for player 7",
193 { "standard", NULL },
195 { "dualshock", NULL },
203 "pcsx_rearmed_pad8type",
205 "Pad type for player 8",
207 { "standard", NULL },
209 { "dualshock", NULL },
218 "pcsx_rearmed_multitap1",
220 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
223 { "disabled", NULL },
230 "pcsx_rearmed_multitap2",
232 "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.",
235 { "disabled", NULL },
242 "pcsx_rearmed_negcon_deadzone",
243 "NegCon Twist Deadzone (Percent)",
244 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
258 "pcsx_rearmed_negcon_response",
259 "NegCon Twist Response",
260 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
263 { "quadratic", NULL },
270 "pcsx_rearmed_analog_axis_modifier",
271 "Analog axis bounds.",
272 "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.",
281 "pcsx_rearmed_vibration",
283 "Enables vibration feedback for controllers that supports vibration features.",
285 { "disabled", NULL },
292 "pcsx_rearmed_gunconadjustx",
294 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
353 "pcsx_rearmed_gunconadjusty",
355 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
414 "pcsx_rearmed_gunconadjustratiox",
415 "Guncon Adjust Ratio X",
416 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
475 "pcsx_rearmed_gunconadjustratioy",
476 "Guncon Adjust Ratio Y",
477 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
536 "pcsx_rearmed_dithering",
538 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
540 { "disabled", NULL },
544 #if defined HAVE_LIBNX || defined _3DS
551 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
554 "Dynamic Recompiler",
555 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
557 { "disabled", NULL },
563 #endif /* LIGHTREC || NEW_DYNAREC */
567 "pcsx_rearmed_psxclock",
569 #ifdef HAVE_PRE_ARMV7
570 "Overclock or underclock the PSX clock. Default is 50",
572 "Overclock or underclock the PSX clock. Default is 57",
648 #ifdef HAVE_PRE_ARMV7
654 #endif /* NEW_DYNAREC */
658 "pcsx_rearmed_neon_interlace_enable",
659 "Enable Interlacing Mode",
660 "Enables fake scanlines effect.",
662 { "disabled", NULL },
669 "pcsx_rearmed_neon_enhancement_enable",
670 "Enhanced Resolution (Slow)",
671 "Renders in double resolution at the cost of lower performance.",
673 { "disabled", NULL },
680 "pcsx_rearmed_neon_enhancement_no_main",
681 "Enhanced Resolution (Speed Hack)",
682 "Speed hack for Enhanced resolution option (glitches some games).",
684 { "disabled", NULL },
690 #endif /* GPU_NEON */
693 "pcsx_rearmed_duping_enable",
695 "A speedup, redraws/reuses the last frame if there was no new data.",
697 { "disabled", NULL },
704 "pcsx_rearmed_display_internal_fps",
705 "Display Internal FPS",
706 "Shows an on-screen frames per second counter when enabled.",
708 { "disabled", NULL },
715 /* GPU PEOPS OPTIONS */
718 "pcsx_rearmed_show_gpu_peops_settings",
719 "Advanced GPU P.E.Op.S. Settings",
720 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
722 { "disabled", NULL },
729 "pcsx_rearmed_gpu_peops_odd_even_bit",
730 "(GPU) Odd/Even Bit Hack",
731 "Needed for Chrono Cross.",
733 { "disabled", NULL },
740 "pcsx_rearmed_gpu_peops_expand_screen_width",
741 "(GPU) Expand Screen Width",
742 "Capcom fighting games",
744 { "disabled", NULL },
751 "pcsx_rearmed_gpu_peops_ignore_brightness",
752 "(GPU) Ignore Brightness Color",
753 "Black screens in Lunar Silver Star Story games",
755 { "disabled", NULL },
762 "pcsx_rearmed_gpu_peops_disable_coord_check",
763 "(GPU) Disable Coordinate Check",
764 "Compatibility mode",
766 { "disabled", NULL },
773 "pcsx_rearmed_gpu_peops_lazy_screen_update",
774 "(GPU) Lazy Screen Update",
777 { "disabled", NULL },
784 "pcsx_rearmed_gpu_peops_old_frame_skip",
785 "(GPU) Old Frame Skipping",
786 "Skip every second frame",
788 { "disabled", NULL },
795 "pcsx_rearmed_gpu_peops_repeated_triangles",
796 "(GPU) Repeated Flat Tex Triangles",
797 "Needed by Star Wars: Dark Forces",
799 { "disabled", NULL },
806 "pcsx_rearmed_gpu_peops_quads_with_triangles",
807 "(GPU) Draw Quads with Triangles",
808 "Better g-colors, worse textures",
810 { "disabled", NULL },
817 "pcsx_rearmed_gpu_peops_fake_busy_state",
818 "(GPU) Fake 'Gpu Busy' States",
819 "Toggle busy flags after drawing",
821 { "disabled", NULL },
829 /* GPU UNAI Advanced Options */
832 "pcsx_rearmed_show_gpu_unai_settings",
833 "Advance GPU UNAI/PCSX4All Settings",
834 "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.",
836 { "disabled", NULL },
843 "pcsx_rearmed_gpu_unai_blending",
844 "(GPU) Enable Blending",
847 { "disabled", NULL },
854 "pcsx_rearmed_gpu_unai_lighting",
855 "(GPU) Enable Lighting",
858 { "disabled", NULL },
865 "pcsx_rearmed_gpu_unai_fast_lighting",
866 "(GPU) Enable Fast Lighting",
869 { "disabled", NULL },
876 "pcsx_rearmed_gpu_unai_ilace_force",
877 "(GPU) Enable Forced Interlace",
880 { "disabled", NULL },
887 "pcsx_rearmed_gpu_unai_pixel_skip",
888 "(GPU) Enable Pixel Skip",
891 { "disabled", NULL },
897 #endif /* GPU UNAI Advanced Settings */
900 "pcsx_rearmed_show_bios_bootlogo",
901 "Show Bios Bootlogo",
902 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
904 { "disabled", NULL },
911 "pcsx_rearmed_spu_reverb",
913 "Enables or disables audio reverb effect.",
915 { "disabled", NULL },
922 "pcsx_rearmed_spu_interpolation",
923 "Sound Interpolation",
926 { "simple", "Simple" },
927 { "gaussian", "Gaussian" },
928 { "cubic", "Cubic" },
929 { "off", "disabled" },
935 "pcsx_rearmed_idiablofix",
939 { "disabled", NULL },
946 "pcsx_rearmed_pe2_fix",
947 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
950 { "disabled", NULL },
957 "pcsx_rearmed_inuyasha_fix",
958 "InuYasha Sengoku Battle Fix",
961 { "disabled", NULL },
969 "pcsx_rearmed_async_cd",
970 "CD Access Method (Restart)",
971 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
973 { "sync", "Synchronous" },
974 { "async", "Asynchronous" },
980 /* ADVANCED OPTIONS */
982 "pcsx_rearmed_noxadecoding",
986 { "disabled", NULL },
993 "pcsx_rearmed_nocdaudio",
997 { "disabled", NULL },
1004 "pcsx_rearmed_spuirq",
1005 "SPU IRQ Always Enabled",
1006 "Compatibility tweak, should be left to off in most cases.",
1008 { "disabled", NULL },
1009 { "enabled", NULL },
1017 "pcsx_rearmed_nosmccheck",
1018 "(Speed Hack) Disable SMC Checks",
1019 "Will cause crashes when loading, break memcards.",
1021 { "disabled", NULL },
1022 { "enabled", NULL },
1028 "pcsx_rearmed_gteregsunneeded",
1029 "(Speed Hack) Assume GTE Regs Unneeded",
1030 "May cause graphical glitches.",
1032 { "disabled", NULL },
1033 { "enabled", NULL },
1039 "pcsx_rearmed_nogteflags",
1040 "(Speed Hack) Disable GTE Flags",
1041 "Will cause graphical glitches.",
1043 { "disabled", NULL },
1044 { "enabled", NULL },
1049 #endif /* NEW_DYNAREC */
1051 { NULL, NULL, NULL, {{0}}, NULL },
1055 ********************************
1057 ********************************
1060 #ifndef HAVE_NO_LANGEXTRA
1061 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1062 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1063 NULL, /* RETRO_LANGUAGE_JAPANESE */
1064 NULL, /* RETRO_LANGUAGE_FRENCH */
1065 NULL, /* RETRO_LANGUAGE_SPANISH */
1066 NULL, /* RETRO_LANGUAGE_GERMAN */
1067 NULL, /* RETRO_LANGUAGE_ITALIAN */
1068 NULL, /* RETRO_LANGUAGE_DUTCH */
1069 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1070 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1071 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1072 NULL, /* RETRO_LANGUAGE_KOREAN */
1073 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1074 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1075 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1076 NULL, /* RETRO_LANGUAGE_POLISH */
1077 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1078 NULL, /* RETRO_LANGUAGE_ARABIC */
1079 NULL, /* RETRO_LANGUAGE_GREEK */
1080 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1085 ********************************
1087 ********************************
1090 /* Handles configuration/setting of core options.
1091 * Should be called as early as possible - ideally inside
1092 * retro_set_environment(), and no later than retro_load_game()
1093 * > We place the function body in the header to avoid the
1094 * necessity of adding more .c files (i.e. want this to
1095 * be as painless as possible for core devs)
1098 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1100 unsigned version = 0;
1105 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1107 #ifndef HAVE_NO_LANGEXTRA
1108 struct retro_core_options_intl core_options_intl;
1109 unsigned language = 0;
1111 core_options_intl.us = option_defs_us;
1112 core_options_intl.local = NULL;
1114 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1115 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1116 core_options_intl.local = option_defs_intl[language];
1118 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1120 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1126 size_t option_index = 0;
1127 size_t num_options = 0;
1128 struct retro_variable *variables = NULL;
1129 char **values_buf = NULL;
1131 /* Determine number of options
1132 * > Note: We are going to skip a number of irrelevant
1133 * core options when building the retro_variable array,
1134 * but we'll allocate space for all of them. The difference
1135 * in resource usage is negligible, and this allows us to
1136 * keep the code 'cleaner' */
1139 if (option_defs_us[num_options].key)
1145 /* Allocate arrays */
1146 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1147 values_buf = (char **)calloc(num_options, sizeof(char *));
1149 if (!variables || !values_buf)
1152 /* Copy parameters from option_defs_us array */
1153 for (i = 0; i < num_options; i++)
1155 const char *key = option_defs_us[i].key;
1156 const char *desc = option_defs_us[i].desc;
1157 const char *default_value = option_defs_us[i].default_value;
1158 struct retro_core_option_value *values = option_defs_us[i].values;
1160 size_t default_index = 0;
1162 values_buf[i] = NULL;
1164 /* Skip options that are irrelevant when using the
1165 * old style core options interface */
1166 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1171 size_t num_values = 0;
1173 /* Determine number of values */
1176 if (values[num_values].value)
1178 /* Check if this is the default value */
1180 if (strcmp(values[num_values].value, default_value) == 0)
1181 default_index = num_values;
1183 buf_len += strlen(values[num_values].value);
1190 /* Build values string */
1195 buf_len += num_values - 1;
1196 buf_len += strlen(desc);
1198 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1202 strcpy(values_buf[i], desc);
1203 strcat(values_buf[i], "; ");
1205 /* Default value goes first */
1206 strcat(values_buf[i], values[default_index].value);
1208 /* Add remaining values */
1209 for (j = 0; j < num_values; j++)
1211 if (j != default_index)
1213 strcat(values_buf[i], "|");
1214 strcat(values_buf[i], values[j].value);
1220 variables[option_index].key = key;
1221 variables[option_index].value = values_buf[i];
1226 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1233 for (i = 0; i < num_options; i++)
1237 free(values_buf[i]);
1238 values_buf[i] = NULL;