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_vibration",
272 "Enables vibration feedback for controllers that supports vibration features.",
274 { "disabled", NULL },
281 "pcsx_rearmed_gunconadjustx",
283 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
342 "pcsx_rearmed_gunconadjusty",
344 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
403 "pcsx_rearmed_gunconadjustratiox",
404 "Guncon Adjust Ratio X",
405 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
464 "pcsx_rearmed_gunconadjustratioy",
465 "Guncon Adjust Ratio Y",
466 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
525 "pcsx_rearmed_dithering",
527 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
529 { "disabled", NULL },
539 "Dynamic Recompiler",
540 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
542 { "disabled", NULL },
549 "pcsx_rearmed_psxclock",
551 #ifdef HAVE_PRE_ARMV7
552 "Overclock or underclock the PSX clock. Default is 50",
554 "Overclock or underclock the PSX clock. Default is 57",
630 #ifdef HAVE_PRE_ARMV7
636 #endif /* DRC_DISABLE */
640 "pcsx_rearmed_neon_interlace_enable",
641 "Enable Interlacing Mode",
642 "Enables fake scanlines effect.",
644 { "disabled", NULL },
651 "pcsx_rearmed_neon_enhancement_enable",
652 "Enhanced Resolution (Slow)",
653 "Renders in double resolution at the cost of lower performance.",
655 { "disabled", NULL },
662 "pcsx_rearmed_neon_enhancement_no_main",
663 "Enhanced Resolution (Speed Hack)",
664 "Speed hack for Enhanced resolution option (glitches some games).",
666 { "disabled", NULL },
672 #endif /* __ARM_NEON__ */
675 "pcsx_rearmed_duping_enable",
677 "A speedup, redraws/reuses the last frame if there was no new data.",
679 { "disabled", NULL },
686 "pcsx_rearmed_display_internal_fps",
687 "Display Internal FPS",
688 "Shows an on-screen frames per second counter when enabled.",
690 { "disabled", NULL },
697 /* GPU PEOPS OPTIONS */
700 "pcsx_rearmed_show_gpu_peops_settings",
701 "Advanced GPU P.E.Op.S. Settings",
702 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
704 { "disabled", NULL },
711 "pcsx_rearmed_gpu_peops_odd_even_bit",
712 "(GPU) Odd/Even Bit Hack",
713 "Needed for Chrono Cross.",
715 { "disabled", NULL },
722 "pcsx_rearmed_gpu_peops_expand_screen_width",
723 "(GPU) Expand Screen Width",
724 "Capcom fighting games",
726 { "disabled", NULL },
733 "pcsx_rearmed_gpu_peops_ignore_brightness",
734 "(GPU) Ignore Brightness Color",
735 "Black screens in Lunar Silver Star Story games",
737 { "disabled", NULL },
744 "pcsx_rearmed_gpu_peops_disable_coord_check",
745 "(GPU) Disable Coordinate Check",
746 "Compatibility mode",
748 { "disabled", NULL },
755 "pcsx_rearmed_gpu_peops_lazy_screen_update",
756 "(GPU) Lazy Screen Update",
759 { "disabled", NULL },
766 "pcsx_rearmed_gpu_peops_old_frame_skip",
767 "(GPU) Old Frame Skipping",
768 "Skip every second frame",
770 { "disabled", NULL },
777 "pcsx_rearmed_gpu_peops_repeated_triangles",
778 "(GPU) Repeated Flat Tex Triangles",
779 "Needed by Star Wars: Dark Forces",
781 { "disabled", NULL },
788 "pcsx_rearmed_gpu_peops_quads_with_triangles",
789 "(GPU) Draw Quads with Triangles",
790 "Better g-colors, worse textures",
792 { "disabled", NULL },
799 "pcsx_rearmed_gpu_peops_fake_busy_state",
800 "(GPU) Fake 'Gpu Busy' States",
801 "Toggle busy flags after drawing",
803 { "disabled", NULL },
811 /* GPU UNAI Advanced Options */
814 "pcsx_rearmed_show_gpu_unai_settings",
815 "Advance GPU UNAI/PCSX4All Settings",
816 "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.",
818 { "disabled", NULL },
825 "pcsx_rearmed_gpu_unai_blending",
826 "(GPU) Enable Blending",
829 { "disabled", NULL },
836 "pcsx_rearmed_gpu_unai_lighting",
837 "(GPU) Enable Lighting",
840 { "disabled", NULL },
847 "pcsx_rearmed_gpu_unai_fast_lighting",
848 "(GPU) Enable Fast Lighting",
851 { "disabled", NULL },
858 "pcsx_rearmed_gpu_unai_ilace_force",
859 "(GPU) Enable Forced Interlace",
862 { "disabled", NULL },
869 "pcsx_rearmed_gpu_unai_pixel_skip",
870 "(GPU) Enable Pixel Skip",
873 { "disabled", NULL },
879 #endif /* GPU UNAI Advanced Settings */
882 "pcsx_rearmed_show_bios_bootlogo",
883 "Show Bios Bootlogo",
884 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
886 { "disabled", NULL },
893 "pcsx_rearmed_spu_reverb",
895 "Enables or disables audio reverb effect.",
897 { "disabled", NULL },
904 "pcsx_rearmed_spu_interpolation",
905 "Sound Interpolation",
908 { "simple", "Simple" },
909 { "gaussian", "Gaussian" },
910 { "cubic", "Cubic" },
911 { "off", "disabled" },
917 "pcsx_rearmed_idiablofix",
921 { "disabled", NULL },
928 "pcsx_rearmed_pe2_fix",
929 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
932 { "disabled", NULL },
939 "pcsx_rearmed_inuyasha_fix",
940 "InuYasha Sengoku Battle Fix",
943 { "disabled", NULL },
950 /* ADVANCED OPTIONS */
952 "pcsx_rearmed_noxadecoding",
956 { "disabled", NULL },
963 "pcsx_rearmed_nocdaudio",
967 { "disabled", NULL },
976 "pcsx_rearmed_nosmccheck",
977 "(Speed Hack) Disable SMC Checks",
978 "Will cause crashes when loading, break memcards.",
980 { "disabled", NULL },
987 "pcsx_rearmed_gteregsunneeded",
988 "(Speed Hack) Assume GTE Regs Unneeded",
989 "May cause graphical glitches.",
991 { "disabled", NULL },
998 "pcsx_rearmed_nogteflags",
999 "(Speed Hack) Disable GTE Flags",
1000 "Will cause graphical glitches.",
1002 { "disabled", NULL },
1003 { "enabled", NULL },
1008 #endif /* DRC_DISABLE */
1010 { NULL, NULL, NULL, {{0}}, NULL },
1014 ********************************
1016 ********************************
1019 #ifndef HAVE_NO_LANGEXTRA
1020 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1021 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1022 NULL, /* RETRO_LANGUAGE_JAPANESE */
1023 NULL, /* RETRO_LANGUAGE_FRENCH */
1024 NULL, /* RETRO_LANGUAGE_SPANISH */
1025 NULL, /* RETRO_LANGUAGE_GERMAN */
1026 NULL, /* RETRO_LANGUAGE_ITALIAN */
1027 NULL, /* RETRO_LANGUAGE_DUTCH */
1028 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1029 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1030 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1031 NULL, /* RETRO_LANGUAGE_KOREAN */
1032 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1033 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1034 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1035 NULL, /* RETRO_LANGUAGE_POLISH */
1036 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1037 NULL, /* RETRO_LANGUAGE_ARABIC */
1038 NULL, /* RETRO_LANGUAGE_GREEK */
1039 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1044 ********************************
1046 ********************************
1049 /* Handles configuration/setting of core options.
1050 * Should be called as early as possible - ideally inside
1051 * retro_set_environment(), and no later than retro_load_game()
1052 * > We place the function body in the header to avoid the
1053 * necessity of adding more .c files (i.e. want this to
1054 * be as painless as possible for core devs)
1057 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1059 unsigned version = 0;
1064 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1066 #ifndef HAVE_NO_LANGEXTRA
1067 struct retro_core_options_intl core_options_intl;
1068 unsigned language = 0;
1070 core_options_intl.us = option_defs_us;
1071 core_options_intl.local = NULL;
1073 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1074 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1075 core_options_intl.local = option_defs_intl[language];
1077 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1079 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1085 size_t option_index = 0;
1086 size_t num_options = 0;
1087 struct retro_variable *variables = NULL;
1088 char **values_buf = NULL;
1090 /* Determine number of options
1091 * > Note: We are going to skip a number of irrelevant
1092 * core options when building the retro_variable array,
1093 * but we'll allocate space for all of them. The difference
1094 * in resource usage is negligible, and this allows us to
1095 * keep the code 'cleaner' */
1098 if (option_defs_us[num_options].key)
1104 /* Allocate arrays */
1105 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1106 values_buf = (char **)calloc(num_options, sizeof(char *));
1108 if (!variables || !values_buf)
1111 /* Copy parameters from option_defs_us array */
1112 for (i = 0; i < num_options; i++)
1114 const char *key = option_defs_us[i].key;
1115 const char *desc = option_defs_us[i].desc;
1116 const char *default_value = option_defs_us[i].default_value;
1117 struct retro_core_option_value *values = option_defs_us[i].values;
1119 size_t default_index = 0;
1121 values_buf[i] = NULL;
1123 /* Skip options that are irrelevant when using the
1124 * old style core options interface */
1125 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1130 size_t num_values = 0;
1132 /* Determine number of values */
1135 if (values[num_values].value)
1137 /* Check if this is the default value */
1139 if (strcmp(values[num_values].value, default_value) == 0)
1140 default_index = num_values;
1142 buf_len += strlen(values[num_values].value);
1149 /* Build values string */
1154 buf_len += num_values - 1;
1155 buf_len += strlen(desc);
1157 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1161 strcpy(values_buf[i], desc);
1162 strcat(values_buf[i], "; ");
1164 /* Default value goes first */
1165 strcat(values_buf[i], values[default_index].value);
1167 /* Add remaining values */
1168 for (j = 0; j < num_values; j++)
1170 if (j != default_index)
1172 strcat(values_buf[i], "|");
1173 strcat(values_buf[i], values[j].value);
1179 variables[option_index].key = key;
1180 variables[option_index].value = values_buf[i];
1185 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1192 for (i = 0; i < num_options; i++)
1196 free(values_buf[i]);
1197 values_buf[i] = NULL;