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_type",
56 "Skip frames to avoid audio buffer under-run (crackling). Improves performance at the expense of visual smoothness. 'Auto' skips frames when advised by the frontend. 'Auto (Threshold)' utilises the 'Frameskip Threshold (%)' setting. 'Fixed Interval' utilises the 'Frameskip Interval' setting.",
60 { "auto_threshold", "Auto (Threshold)" },
61 { "fixed_interval", "Fixed Interval" },
67 "pcsx_rearmed_frameskip_threshold",
68 "Frameskip Threshold (%)",
69 "When 'Frameskip' is set to 'Auto (Threshold)', specifies the audio buffer occupancy threshold (percentage) below which frames will be skipped. Higher values reduce the risk of crackling by causing frames to be dropped more frequently.",
92 "pcsx_rearmed_frameskip",
94 "Specifies the maximum number of frames that can be skipped before a new frame is rendered.",
113 "Allows you to use real bios file (if available) or emulated bios (HLE). Its recommended to use official bios file for better compatibility.",
122 "pcsx_rearmed_region",
124 "Choose what region the system is from. 60 Hz for NTSC, 50 Hz for PAL.",
134 "pcsx_rearmed_memcard2",
135 "Enable Second Memory Card (Shared)",
136 "Enabled the memory card slot 2. This memory card is shared amongst all games.",
138 { "disabled", NULL },
145 "pcsx_rearmed_show_other_input_settings",
146 "Show other input settings",
147 "Shows or hides other inputs settings like multitaps, player 3-8 ports, analog fine-tunings, etc.",
149 { "disabled", NULL },
156 "pcsx_rearmed_input_sensitivity",
157 "Emulated Mouse Sensitivity",
158 "Adjust responsiveness when using mouse controller (Default 1.0).",
204 "pcsx_rearmed_multitap",
205 "Multitap Mode (Restart)",
206 "Sets the playstation multitap peripheral to either controller port 1 or controller port 2 to support of upto 5 players simultaneously, or on both for upto 8 players simultaneously. Option depends on games that has support for multitap feature. Leave option on disabled if not such compatible games to avoid any input-related problems.",
208 { "disabled", NULL },
211 { "ports 1 and 2", NULL },
217 "pcsx_rearmed_negcon_deadzone",
218 "NegCon Twist Deadzone (Percent)",
219 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
233 "pcsx_rearmed_negcon_response",
234 "NegCon Twist Response",
235 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
238 { "quadratic", NULL },
245 "pcsx_rearmed_analog_axis_modifier",
246 "Analog axis bounds.",
247 "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.",
256 "pcsx_rearmed_vibration",
258 "Enables vibration feedback for controllers that supports vibration features.",
260 { "disabled", NULL },
267 "pcsx_rearmed_gunconadjustx",
269 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
328 "pcsx_rearmed_gunconadjusty",
330 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
389 "pcsx_rearmed_gunconadjustratiox",
390 "Guncon Adjust Ratio X",
391 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
450 "pcsx_rearmed_gunconadjustratioy",
451 "Guncon Adjust Ratio Y",
452 "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
511 "pcsx_rearmed_dithering",
513 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
515 { "disabled", NULL },
519 #if defined HAVE_LIBNX || defined _3DS
529 "Dynamic Recompiler",
530 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
532 { "disabled", NULL },
540 #if !defined(DRC_DISABLE) && !defined(LIGHTREC)
542 "pcsx_rearmed_psxclock",
544 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
545 "Overclock or underclock the PSX clock. Default is 50",
547 "Overclock or underclock the PSX clock. Default is 57",
623 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
629 #endif /* !DRC_DISABLE && !LIGHTREC */
633 "pcsx_rearmed_neon_interlace_enable",
634 "Enable Interlacing Mode",
635 "Enables fake scanlines effect.",
637 { "disabled", NULL },
644 "pcsx_rearmed_neon_enhancement_enable",
645 "Enhanced Resolution (Slow)",
646 "Renders in double resolution at the cost of lower performance.",
648 { "disabled", NULL },
655 "pcsx_rearmed_neon_enhancement_no_main",
656 "Enhanced Resolution (Speed Hack)",
657 "Speed hack for Enhanced resolution option (glitches some games).",
659 { "disabled", NULL },
665 #endif /* GPU_NEON */
668 "pcsx_rearmed_duping_enable",
670 "A speedup, redraws/reuses the last frame if there was no new data.",
672 { "disabled", NULL },
679 "pcsx_rearmed_display_internal_fps",
680 "Display Internal FPS",
681 "Shows an on-screen frames per second counter when enabled.",
683 { "disabled", NULL },
690 /* GPU PEOPS OPTIONS */
693 "pcsx_rearmed_show_gpu_peops_settings",
694 "Advanced GPU P.E.Op.S. Settings",
695 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
697 { "disabled", NULL },
704 "pcsx_rearmed_gpu_peops_odd_even_bit",
705 "(GPU) Odd/Even Bit Hack",
706 "Needed for Chrono Cross.",
708 { "disabled", NULL },
715 "pcsx_rearmed_gpu_peops_expand_screen_width",
716 "(GPU) Expand Screen Width",
717 "Capcom fighting games",
719 { "disabled", NULL },
726 "pcsx_rearmed_gpu_peops_ignore_brightness",
727 "(GPU) Ignore Brightness Color",
728 "Black screens in Lunar Silver Star Story games",
730 { "disabled", NULL },
737 "pcsx_rearmed_gpu_peops_disable_coord_check",
738 "(GPU) Disable Coordinate Check",
739 "Compatibility mode",
741 { "disabled", NULL },
748 "pcsx_rearmed_gpu_peops_lazy_screen_update",
749 "(GPU) Lazy Screen Update",
752 { "disabled", NULL },
759 "pcsx_rearmed_gpu_peops_old_frame_skip",
760 "(GPU) Old Frame Skipping",
761 "Skip every second frame",
763 { "disabled", NULL },
770 "pcsx_rearmed_gpu_peops_repeated_triangles",
771 "(GPU) Repeated Flat Tex Triangles",
772 "Needed by Star Wars: Dark Forces",
774 { "disabled", NULL },
781 "pcsx_rearmed_gpu_peops_quads_with_triangles",
782 "(GPU) Draw Quads with Triangles",
783 "Better g-colors, worse textures",
785 { "disabled", NULL },
792 "pcsx_rearmed_gpu_peops_fake_busy_state",
793 "(GPU) Fake 'Gpu Busy' States",
794 "Toggle busy flags after drawing",
796 { "disabled", NULL },
804 /* GPU UNAI Advanced Options */
807 "pcsx_rearmed_show_gpu_unai_settings",
808 "Advance GPU UNAI/PCSX4All Settings",
809 "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.",
811 { "disabled", NULL },
818 "pcsx_rearmed_gpu_unai_blending",
819 "(GPU) Enable Blending",
822 { "disabled", NULL },
829 "pcsx_rearmed_gpu_unai_lighting",
830 "(GPU) Enable Lighting",
833 { "disabled", NULL },
840 "pcsx_rearmed_gpu_unai_fast_lighting",
841 "(GPU) Enable Fast Lighting",
844 { "disabled", NULL },
851 "pcsx_rearmed_gpu_unai_ilace_force",
852 "(GPU) Enable Forced Interlace",
855 { "disabled", NULL },
862 "pcsx_rearmed_gpu_unai_pixel_skip",
863 "(GPU) Enable Pixel Skip",
866 { "disabled", NULL },
873 "pcsx_rearmed_gpu_unai_scale_hires",
874 "(GPU) Enable Hi-Res Downscaling",
875 "When enabled, will scale hi-res modes to 320x240, skipping unrendered pixels.",
877 { "disabled", NULL },
887 #endif /* GPU UNAI Advanced Settings */
888 #ifdef THREAD_RENDERING
890 "pcsx_rearmed_gpu_thread_rendering",
891 "Threaded Rendering",
892 "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.",
894 { "disabled", NULL },
904 "pcsx_rearmed_show_bios_bootlogo",
905 "Show Bios Bootlogo",
906 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
908 { "disabled", NULL },
915 "pcsx_rearmed_spu_reverb",
917 "Enables or disables audio reverb effect.",
919 { "disabled", NULL },
926 "pcsx_rearmed_spu_interpolation",
927 "Sound Interpolation",
930 { "simple", "Simple" },
931 { "gaussian", "Gaussian" },
932 { "cubic", "Cubic" },
933 { "off", "disabled" },
939 "pcsx_rearmed_pe2_fix",
940 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
943 { "disabled", NULL },
950 "pcsx_rearmed_icache_emulation",
951 "Instruction Cache emulation",
952 "Enables or disables instruction cache emulation. Slower, but more accurate. Fails to run Spyro 2 PAL. This allows you to run F1 2001, Formula One Arcade, F1 99 and other games that may need instruction cache emulation. Interpreter only and partial on lightrec, does nothing on the ARMv7 backend.",
954 { "disabled", NULL },
961 "pcsx_rearmed_inuyasha_fix",
962 "InuYasha Sengoku Battle Fix",
965 { "disabled", NULL },
973 "pcsx_rearmed_async_cd",
974 "CD Access Method (Restart)",
975 "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).",
977 { "sync", "Synchronous" },
978 { "async", "Asynchronous" },
979 { "precache", "Precache" },
985 /* ADVANCED OPTIONS */
987 "pcsx_rearmed_noxadecoding",
991 { "disabled", NULL },
998 "pcsx_rearmed_nocdaudio",
1002 { "disabled", NULL },
1003 { "enabled", NULL },
1009 "pcsx_rearmed_spuirq",
1010 "SPU IRQ Always Enabled",
1011 "Compatibility tweak, should be left to off in most cases.",
1013 { "disabled", NULL },
1014 { "enabled", NULL },
1020 #if !defined(DRC_DISABLE) && !defined(LIGHTREC)
1022 "pcsx_rearmed_nosmccheck",
1023 "(Speed Hack) Disable SMC Checks",
1024 "Will cause crashes when loading, break memcards.",
1026 { "disabled", NULL },
1027 { "enabled", NULL },
1033 "pcsx_rearmed_gteregsunneeded",
1034 "(Speed Hack) Assume GTE Regs Unneeded",
1035 "May cause graphical glitches.",
1037 { "disabled", NULL },
1038 { "enabled", NULL },
1044 "pcsx_rearmed_nogteflags",
1045 "(Speed Hack) Disable GTE Flags",
1046 "Will cause graphical glitches.",
1048 { "disabled", NULL },
1049 { "enabled", NULL },
1055 "pcsx_rearmed_nostalls",
1056 "Disable CPU/GTE stalls",
1057 "Will cause some games to run too fast.",
1059 { "disabled", NULL },
1060 { "enabled", NULL },
1066 "pcsx_rearmed_nocompathacks",
1067 "Disable compat hacks",
1068 "Disables game-specific compatibility hacks.",
1070 { "disabled", NULL },
1071 { "enabled", NULL },
1076 #endif /* !DRC_DISABLE && !LIGHTREC */
1078 { NULL, NULL, NULL, {{0}}, NULL },
1082 ********************************
1084 ********************************
1087 #ifndef HAVE_NO_LANGEXTRA
1088 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1089 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1090 NULL, /* RETRO_LANGUAGE_JAPANESE */
1091 NULL, /* RETRO_LANGUAGE_FRENCH */
1092 NULL, /* RETRO_LANGUAGE_SPANISH */
1093 NULL, /* RETRO_LANGUAGE_GERMAN */
1094 NULL, /* RETRO_LANGUAGE_ITALIAN */
1095 NULL, /* RETRO_LANGUAGE_DUTCH */
1096 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1097 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1098 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1099 NULL, /* RETRO_LANGUAGE_KOREAN */
1100 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1101 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1102 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1103 NULL, /* RETRO_LANGUAGE_POLISH */
1104 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1105 NULL, /* RETRO_LANGUAGE_ARABIC */
1106 NULL, /* RETRO_LANGUAGE_GREEK */
1107 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1112 ********************************
1114 ********************************
1117 /* Handles configuration/setting of core options.
1118 * Should be called as early as possible - ideally inside
1119 * retro_set_environment(), and no later than retro_load_game()
1120 * > We place the function body in the header to avoid the
1121 * necessity of adding more .c files (i.e. want this to
1122 * be as painless as possible for core devs)
1125 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1127 unsigned version = 0;
1132 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1134 #ifndef HAVE_NO_LANGEXTRA
1135 struct retro_core_options_intl core_options_intl;
1136 unsigned language = 0;
1138 core_options_intl.us = option_defs_us;
1139 core_options_intl.local = NULL;
1141 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1142 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1143 core_options_intl.local = option_defs_intl[language];
1145 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1147 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1153 size_t option_index = 0;
1154 size_t num_options = 0;
1155 struct retro_variable *variables = NULL;
1156 char **values_buf = NULL;
1158 /* Determine number of options
1159 * > Note: We are going to skip a number of irrelevant
1160 * core options when building the retro_variable array,
1161 * but we'll allocate space for all of them. The difference
1162 * in resource usage is negligible, and this allows us to
1163 * keep the code 'cleaner' */
1166 if (option_defs_us[num_options].key)
1172 /* Allocate arrays */
1173 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1174 values_buf = (char **)calloc(num_options, sizeof(char *));
1176 if (!variables || !values_buf)
1179 /* Copy parameters from option_defs_us array */
1180 for (i = 0; i < num_options; i++)
1182 const char *key = option_defs_us[i].key;
1183 const char *desc = option_defs_us[i].desc;
1184 const char *default_value = option_defs_us[i].default_value;
1185 struct retro_core_option_value *values = option_defs_us[i].values;
1187 size_t default_index = 0;
1189 values_buf[i] = NULL;
1191 /* Skip options that are irrelevant when using the
1192 * old style core options interface */
1193 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1198 size_t num_values = 0;
1200 /* Determine number of values */
1203 if (values[num_values].value)
1205 /* Check if this is the default value */
1207 if (strcmp(values[num_values].value, default_value) == 0)
1208 default_index = num_values;
1210 buf_len += strlen(values[num_values].value);
1217 /* Build values string */
1222 buf_len += num_values - 1;
1223 buf_len += strlen(desc);
1225 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1229 strcpy(values_buf[i], desc);
1230 strcat(values_buf[i], "; ");
1232 /* Default value goes first */
1233 strcat(values_buf[i], values[default_index].value);
1235 /* Add remaining values */
1236 for (j = 0; j < num_values; j++)
1238 if (j != default_index)
1240 strcat(values_buf[i], "|");
1241 strcat(values_buf[i], values[j].value);
1247 variables[option_index].key = key;
1248 variables[option_index].value = values_buf[i];
1253 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1260 for (i = 0; i < num_options; i++)
1264 free(values_buf[i]);
1265 values_buf[i] = NULL;