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_multitap1",
161 "Multitap 1 (Restart)",
162 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
164 { "automatic", NULL },
165 { "disabled", NULL },
172 "pcsx_rearmed_multitap2",
173 "Multitap 2 (Restart)",
174 "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.",
176 { "automatic", NULL },
177 { "disabled", NULL },
184 "pcsx_rearmed_negcon_deadzone",
185 "NegCon Twist Deadzone (Percent)",
186 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
200 "pcsx_rearmed_negcon_response",
201 "NegCon Twist Response",
202 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
205 { "quadratic", NULL },
212 "pcsx_rearmed_analog_axis_modifier",
213 "Analog axis bounds.",
214 "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.",
223 "pcsx_rearmed_vibration",
225 "Enables vibration feedback for controllers that supports vibration features.",
227 { "disabled", NULL },
234 "pcsx_rearmed_gunconadjustx",
236 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
295 "pcsx_rearmed_gunconadjusty",
297 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
356 "pcsx_rearmed_gunconadjustratiox",
357 "Guncon Adjust Ratio X",
358 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
417 "pcsx_rearmed_gunconadjustratioy",
418 "Guncon Adjust Ratio Y",
419 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
478 "pcsx_rearmed_dithering",
480 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
482 { "disabled", NULL },
486 #if defined HAVE_LIBNX || defined _3DS
493 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
496 "Dynamic Recompiler",
497 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
499 { "disabled", NULL },
505 #endif /* LIGHTREC || NEW_DYNAREC */
509 "pcsx_rearmed_psxclock",
511 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
512 "Overclock or underclock the PSX clock. Default is 50",
514 "Overclock or underclock the PSX clock. Default is 57",
590 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
596 #endif /* NEW_DYNAREC */
600 "pcsx_rearmed_neon_interlace_enable",
601 "Enable Interlacing Mode",
602 "Enables fake scanlines effect.",
604 { "disabled", NULL },
611 "pcsx_rearmed_neon_enhancement_enable",
612 "Enhanced Resolution (Slow)",
613 "Renders in double resolution at the cost of lower performance.",
615 { "disabled", NULL },
622 "pcsx_rearmed_neon_enhancement_no_main",
623 "Enhanced Resolution (Speed Hack)",
624 "Speed hack for Enhanced resolution option (glitches some games).",
626 { "disabled", NULL },
632 #endif /* GPU_NEON */
635 "pcsx_rearmed_duping_enable",
637 "A speedup, redraws/reuses the last frame if there was no new data.",
639 { "disabled", NULL },
646 "pcsx_rearmed_display_internal_fps",
647 "Display Internal FPS",
648 "Shows an on-screen frames per second counter when enabled.",
650 { "disabled", NULL },
657 /* GPU PEOPS OPTIONS */
660 "pcsx_rearmed_show_gpu_peops_settings",
661 "Advanced GPU P.E.Op.S. Settings",
662 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
664 { "disabled", NULL },
671 "pcsx_rearmed_gpu_peops_odd_even_bit",
672 "(GPU) Odd/Even Bit Hack",
673 "Needed for Chrono Cross.",
675 { "disabled", NULL },
682 "pcsx_rearmed_gpu_peops_expand_screen_width",
683 "(GPU) Expand Screen Width",
684 "Capcom fighting games",
686 { "disabled", NULL },
693 "pcsx_rearmed_gpu_peops_ignore_brightness",
694 "(GPU) Ignore Brightness Color",
695 "Black screens in Lunar Silver Star Story games",
697 { "disabled", NULL },
704 "pcsx_rearmed_gpu_peops_disable_coord_check",
705 "(GPU) Disable Coordinate Check",
706 "Compatibility mode",
708 { "disabled", NULL },
715 "pcsx_rearmed_gpu_peops_lazy_screen_update",
716 "(GPU) Lazy Screen Update",
719 { "disabled", NULL },
726 "pcsx_rearmed_gpu_peops_old_frame_skip",
727 "(GPU) Old Frame Skipping",
728 "Skip every second frame",
730 { "disabled", NULL },
737 "pcsx_rearmed_gpu_peops_repeated_triangles",
738 "(GPU) Repeated Flat Tex Triangles",
739 "Needed by Star Wars: Dark Forces",
741 { "disabled", NULL },
748 "pcsx_rearmed_gpu_peops_quads_with_triangles",
749 "(GPU) Draw Quads with Triangles",
750 "Better g-colors, worse textures",
752 { "disabled", NULL },
759 "pcsx_rearmed_gpu_peops_fake_busy_state",
760 "(GPU) Fake 'Gpu Busy' States",
761 "Toggle busy flags after drawing",
763 { "disabled", NULL },
771 /* GPU UNAI Advanced Options */
774 "pcsx_rearmed_show_gpu_unai_settings",
775 "Advance GPU UNAI/PCSX4All Settings",
776 "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.",
778 { "disabled", NULL },
785 "pcsx_rearmed_gpu_unai_blending",
786 "(GPU) Enable Blending",
789 { "disabled", NULL },
796 "pcsx_rearmed_gpu_unai_lighting",
797 "(GPU) Enable Lighting",
800 { "disabled", NULL },
807 "pcsx_rearmed_gpu_unai_fast_lighting",
808 "(GPU) Enable Fast Lighting",
811 { "disabled", NULL },
818 "pcsx_rearmed_gpu_unai_ilace_force",
819 "(GPU) Enable Forced Interlace",
822 { "disabled", NULL },
829 "pcsx_rearmed_gpu_unai_pixel_skip",
830 "(GPU) Enable Pixel Skip",
833 { "disabled", NULL },
840 "pcsx_rearmed_gpu_unai_scale_hires",
841 "(GPU) Enable Hi-Res Downscaling",
842 "When enabled, will scale hi-res modes to 320x240, skipping unrendered pixels.",
844 { "disabled", NULL },
850 #endif /* GPU UNAI Advanced Settings */
851 #ifdef THREAD_RENDERING
853 "pcsx_rearmed_gpu_thread_rendering",
854 "Threaded Rendering",
855 "When enabled, runs GPU commands in a thread. Sync waits for drawing to finish before vsync. Async will not wait unless there's another frame behind it.",
857 { "disabled", NULL },
867 "pcsx_rearmed_show_bios_bootlogo",
868 "Show Bios Bootlogo",
869 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
871 { "disabled", NULL },
878 "pcsx_rearmed_spu_reverb",
880 "Enables or disables audio reverb effect.",
882 { "disabled", NULL },
889 "pcsx_rearmed_spu_interpolation",
890 "Sound Interpolation",
893 { "simple", "Simple" },
894 { "gaussian", "Gaussian" },
895 { "cubic", "Cubic" },
896 { "off", "disabled" },
902 "pcsx_rearmed_idiablofix",
906 { "disabled", NULL },
913 "pcsx_rearmed_pe2_fix",
914 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
917 { "disabled", NULL },
924 "pcsx_rearmed_inuyasha_fix",
925 "InuYasha Sengoku Battle Fix",
928 { "disabled", NULL },
936 "pcsx_rearmed_async_cd",
937 "CD Access Method (Restart)",
938 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage. 'Precache' loads disk image into memory for faster access (CHD only).",
940 { "sync", "Synchronous" },
941 { "async", "Asynchronous" },
942 { "precache", "Precache" },
948 /* ADVANCED OPTIONS */
950 "pcsx_rearmed_noxadecoding",
954 { "disabled", NULL },
961 "pcsx_rearmed_nocdaudio",
965 { "disabled", NULL },
972 "pcsx_rearmed_spuirq",
973 "SPU IRQ Always Enabled",
974 "Compatibility tweak, should be left to off in most cases.",
976 { "disabled", NULL },
985 "pcsx_rearmed_nosmccheck",
986 "(Speed Hack) Disable SMC Checks",
987 "Will cause crashes when loading, break memcards.",
989 { "disabled", NULL },
996 "pcsx_rearmed_gteregsunneeded",
997 "(Speed Hack) Assume GTE Regs Unneeded",
998 "May cause graphical glitches.",
1000 { "disabled", NULL },
1001 { "enabled", NULL },
1007 "pcsx_rearmed_nogteflags",
1008 "(Speed Hack) Disable GTE Flags",
1009 "Will cause graphical glitches.",
1011 { "disabled", NULL },
1012 { "enabled", NULL },
1017 #endif /* NEW_DYNAREC */
1019 { NULL, NULL, NULL, {{0}}, NULL },
1023 ********************************
1025 ********************************
1028 #ifndef HAVE_NO_LANGEXTRA
1029 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1030 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1031 NULL, /* RETRO_LANGUAGE_JAPANESE */
1032 NULL, /* RETRO_LANGUAGE_FRENCH */
1033 NULL, /* RETRO_LANGUAGE_SPANISH */
1034 NULL, /* RETRO_LANGUAGE_GERMAN */
1035 NULL, /* RETRO_LANGUAGE_ITALIAN */
1036 NULL, /* RETRO_LANGUAGE_DUTCH */
1037 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1038 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1039 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1040 NULL, /* RETRO_LANGUAGE_KOREAN */
1041 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1042 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1043 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1044 NULL, /* RETRO_LANGUAGE_POLISH */
1045 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1046 NULL, /* RETRO_LANGUAGE_ARABIC */
1047 NULL, /* RETRO_LANGUAGE_GREEK */
1048 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1053 ********************************
1055 ********************************
1058 /* Handles configuration/setting of core options.
1059 * Should be called as early as possible - ideally inside
1060 * retro_set_environment(), and no later than retro_load_game()
1061 * > We place the function body in the header to avoid the
1062 * necessity of adding more .c files (i.e. want this to
1063 * be as painless as possible for core devs)
1066 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1068 unsigned version = 0;
1073 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1075 #ifndef HAVE_NO_LANGEXTRA
1076 struct retro_core_options_intl core_options_intl;
1077 unsigned language = 0;
1079 core_options_intl.us = option_defs_us;
1080 core_options_intl.local = NULL;
1082 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1083 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1084 core_options_intl.local = option_defs_intl[language];
1086 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1088 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1094 size_t option_index = 0;
1095 size_t num_options = 0;
1096 struct retro_variable *variables = NULL;
1097 char **values_buf = NULL;
1099 /* Determine number of options
1100 * > Note: We are going to skip a number of irrelevant
1101 * core options when building the retro_variable array,
1102 * but we'll allocate space for all of them. The difference
1103 * in resource usage is negligible, and this allows us to
1104 * keep the code 'cleaner' */
1107 if (option_defs_us[num_options].key)
1113 /* Allocate arrays */
1114 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1115 values_buf = (char **)calloc(num_options, sizeof(char *));
1117 if (!variables || !values_buf)
1120 /* Copy parameters from option_defs_us array */
1121 for (i = 0; i < num_options; i++)
1123 const char *key = option_defs_us[i].key;
1124 const char *desc = option_defs_us[i].desc;
1125 const char *default_value = option_defs_us[i].default_value;
1126 struct retro_core_option_value *values = option_defs_us[i].values;
1128 size_t default_index = 0;
1130 values_buf[i] = NULL;
1132 /* Skip options that are irrelevant when using the
1133 * old style core options interface */
1134 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1139 size_t num_values = 0;
1141 /* Determine number of values */
1144 if (values[num_values].value)
1146 /* Check if this is the default value */
1148 if (strcmp(values[num_values].value, default_value) == 0)
1149 default_index = num_values;
1151 buf_len += strlen(values[num_values].value);
1158 /* Build values string */
1163 buf_len += num_values - 1;
1164 buf_len += strlen(desc);
1166 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1170 strcpy(values_buf[i], desc);
1171 strcat(values_buf[i], "; ");
1173 /* Default value goes first */
1174 strcat(values_buf[i], values[default_index].value);
1176 /* Add remaining values */
1177 for (j = 0; j < num_values; j++)
1179 if (j != default_index)
1181 strcat(values_buf[i], "|");
1182 strcat(values_buf[i], values[j].value);
1188 variables[option_index].key = key;
1189 variables[option_index].value = values_buf[i];
1194 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1201 for (i = 0; i < num_options; i++)
1205 free(values_buf[i]);
1206 values_buf[i] = NULL;