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 },
115 "pcsx_rearmed_pad2type",
117 "Pad type for player 2",
119 { "standard", NULL },
121 { "dualshock", NULL },
129 "pcsx_rearmed_pad3type",
131 "Pad type for player 3",
133 { "standard", NULL },
135 { "dualshock", NULL },
143 "pcsx_rearmed_pad4type",
145 "Pad type for player 4",
147 { "standard", NULL },
149 { "dualshock", NULL },
157 "pcsx_rearmed_pad5type",
159 "Pad type for player 5",
161 { "standard", NULL },
163 { "dualshock", NULL },
170 "pcsx_rearmed_pad6type",
172 "Pad type for player 6",
174 { "standard", NULL },
176 { "dualshock", NULL },
183 "pcsx_rearmed_pad7type",
185 "Pad type for player 7",
187 { "standard", NULL },
189 { "dualshock", NULL },
196 "pcsx_rearmed_pad8type",
198 "Pad type for player 8",
200 { "standard", NULL },
202 { "dualshock", NULL },
210 "pcsx_rearmed_multitap1",
212 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
215 { "disabled", NULL },
222 "pcsx_rearmed_multitap2",
224 "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.",
227 { "disabled", NULL },
234 "pcsx_rearmed_negcon_deadzone",
235 "NegCon Twist Deadzone (Percent)",
236 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
250 "pcsx_rearmed_negcon_response",
251 "NegCon Twist Response",
252 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
255 { "quadratic", NULL },
262 "pcsx_rearmed_vibration",
264 "Enables vibration feedback for controllers that supports vibration features.",
266 { "disabled", NULL },
273 "pcsx_rearmed_dithering",
275 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
277 { "disabled", NULL },
291 "Dynamic Recompiler",
292 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
294 { "disabled", NULL },
301 "pcsx_rearmed_psxclock",
303 #ifdef HAVE_PRE_ARMV7
304 "Overclock or underclock the PSX clock. Default is 50",
306 "Overclock or underclock the PSX clock. Default is 57",
382 #ifdef HAVE_PRE_ARMV7
388 #endif /* DRC_DISABLE */
392 "pcsx_rearmed_neon_interlace_enable",
393 "Enable Interlacing Mode",
394 "Enables fake scanlines effect.",
396 { "disabled", NULL },
403 "pcsx_rearmed_neon_enhancement_enable",
404 "Enhanced Resolution (Slow)",
405 "Renders in double resolution at the cost of lower performance.",
407 { "disabled", NULL },
414 "pcsx_rearmed_neon_enhancement_no_main",
415 "Enhanced Resolution (Speed Hack)",
416 "Speed hack for Enhanced resolution option (glitches some games).",
418 { "disabled", NULL },
424 #endif /* __ARM_NEON__ */
427 "pcsx_rearmed_duping_enable",
429 "A speedup, redraws/reuses the last frame if there was no new data.",
431 { "disabled", NULL },
438 "pcsx_rearmed_display_internal_fps",
439 "Display Internal FPS",
440 "Shows an on-screen frames per second counter when enabled.",
442 { "disabled", NULL },
449 /* GPU PEOPS OPTIONS */
452 "pcsx_rearmed_show_gpu_peops_settings",
453 "Advanced GPU P.E.Op.S. Settings",
454 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
456 { "disabled", NULL },
463 "pcsx_rearmed_gpu_peops_odd_even_bit",
464 "(GPU) Odd/Even Bit Hack",
465 "Needed for Chrono Cross.",
467 { "disabled", NULL },
474 "pcsx_rearmed_gpu_peops_expand_screen_width",
475 "(GPU) Expand Screen Width",
476 "Capcom fighting games",
478 { "disabled", NULL },
485 "pcsx_rearmed_gpu_peops_ignore_brightness",
486 "(GPU) Ignore Brightness Color",
487 "Black screens in Lunar Silver Star Story games",
489 { "disabled", NULL },
496 "pcsx_rearmed_gpu_peops_disable_coord_check",
497 "(GPU) Disable Coordinate Check",
498 "Compatibility mode",
500 { "disabled", NULL },
507 "pcsx_rearmed_gpu_peops_lazy_screen_update",
508 "(GPU) Lazy Screen Update",
511 { "disabled", NULL },
518 "pcsx_rearmed_gpu_peops_old_frame_skip",
519 "(GPU) Old Frame Skipping",
520 "Skip every second frame",
522 { "disabled", NULL },
529 "pcsx_rearmed_gpu_peops_repeated_triangles",
530 "(GPU) Repeated Flat Tex Triangles",
531 "Needed by Star Wars: Dark Forces",
533 { "disabled", NULL },
540 "pcsx_rearmed_gpu_peops_quads_with_triangles",
541 "(GPU) Draw Quads with Triangles",
542 "Better g-colors, worse textures",
544 { "disabled", NULL },
551 "pcsx_rearmed_gpu_peops_fake_busy_state",
552 "(GPU) Fake 'Gpu Busy' States",
553 "Toggle busy flags after drawing",
555 { "disabled", NULL },
563 /* GPU UNAI Advanced Options */
566 "pcsx_rearmed_show_gpu_unai_settings",
567 "Advance GPU UNAI/PCSX4All Settings",
568 "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.",
570 { "disabled", NULL },
577 "pcsx_rearmed_gpu_unai_blending",
578 "(GPU) Enable Blending",
581 { "disabled", NULL },
588 "pcsx_rearmed_gpu_unai_lighting",
589 "(GPU) Enable Lighting",
592 { "disabled", NULL },
599 "pcsx_rearmed_gpu_unai_fast_lighting",
600 "(GPU) Enable Fast Lighting",
603 { "disabled", NULL },
610 "pcsx_rearmed_gpu_unai_ilace_force",
611 "(GPU) Enable Forced Interlace",
614 { "disabled", NULL },
621 "pcsx_rearmed_gpu_unai_pixel_skip",
622 "(GPU) Enable Pixel Skip",
625 { "disabled", NULL },
631 #endif /* GPU UNAI Advanced Settings */
634 "pcsx_rearmed_show_bios_bootlogo",
635 "Show Bios Bootlogo",
636 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
638 { "disabled", NULL },
645 "pcsx_rearmed_spu_reverb",
647 "Enables or disables audio reverb effect.",
649 { "disabled", NULL },
656 "pcsx_rearmed_spu_interpolation",
657 "Sound Interpolation",
660 { "simple", "Simple" },
661 { "gaussian", "Gaussian" },
662 { "cubic", "Cubic" },
663 { "off", "disabled" },
669 "pcsx_rearmed_idiablofix",
673 { "disabled", NULL },
680 "pcsx_rearmed_pe2_fix",
681 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
684 { "disabled", NULL },
691 "pcsx_rearmed_inuyasha_fix",
692 "InuYasha Sengoku Battle Fix",
695 { "disabled", NULL },
702 /* ADVANCED OPTIONS */
704 "pcsx_rearmed_noxadecoding",
708 { "disabled", NULL },
715 "pcsx_rearmed_nocdaudio",
719 { "disabled", NULL },
728 "pcsx_rearmed_nosmccheck",
729 "(Speed Hack) Disable SMC Checks",
730 "Will cause crashes when loading, break memcards.",
732 { "disabled", NULL },
739 "pcsx_rearmed_gteregsunneeded",
740 "(Speed Hack) Assume GTE Regs Unneeded",
741 "May cause graphical glitches.",
743 { "disabled", NULL },
750 "pcsx_rearmed_nogteflags",
751 "(Speed Hack) Disable GTE Flags",
752 "Will cause graphical glitches.",
754 { "disabled", NULL },
760 #endif /* DRC_DISABLE */
762 { NULL, NULL, NULL, {{0}}, NULL },
766 ********************************
768 ********************************
771 #ifndef HAVE_NO_LANGEXTRA
772 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
773 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
774 NULL, /* RETRO_LANGUAGE_JAPANESE */
775 NULL, /* RETRO_LANGUAGE_FRENCH */
776 NULL, /* RETRO_LANGUAGE_SPANISH */
777 NULL, /* RETRO_LANGUAGE_GERMAN */
778 NULL, /* RETRO_LANGUAGE_ITALIAN */
779 NULL, /* RETRO_LANGUAGE_DUTCH */
780 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
781 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
782 NULL, /* RETRO_LANGUAGE_RUSSIAN */
783 NULL, /* RETRO_LANGUAGE_KOREAN */
784 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
785 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
786 NULL, /* RETRO_LANGUAGE_ESPERANTO */
787 NULL, /* RETRO_LANGUAGE_POLISH */
788 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
789 NULL, /* RETRO_LANGUAGE_ARABIC */
790 NULL, /* RETRO_LANGUAGE_GREEK */
791 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
796 ********************************
798 ********************************
801 /* Handles configuration/setting of core options.
802 * Should be called as early as possible - ideally inside
803 * retro_set_environment(), and no later than retro_load_game()
804 * > We place the function body in the header to avoid the
805 * necessity of adding more .c files (i.e. want this to
806 * be as painless as possible for core devs)
809 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
811 unsigned version = 0;
816 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
818 #ifndef HAVE_NO_LANGEXTRA
819 struct retro_core_options_intl core_options_intl;
820 unsigned language = 0;
822 core_options_intl.us = option_defs_us;
823 core_options_intl.local = NULL;
825 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
826 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
827 core_options_intl.local = option_defs_intl[language];
829 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
831 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
837 size_t option_index = 0;
838 size_t num_options = 0;
839 struct retro_variable *variables = NULL;
840 char **values_buf = NULL;
842 /* Determine number of options
843 * > Note: We are going to skip a number of irrelevant
844 * core options when building the retro_variable array,
845 * but we'll allocate space for all of them. The difference
846 * in resource usage is negligible, and this allows us to
847 * keep the code 'cleaner' */
850 if (option_defs_us[num_options].key)
856 /* Allocate arrays */
857 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
858 values_buf = (char **)calloc(num_options, sizeof(char *));
860 if (!variables || !values_buf)
863 /* Copy parameters from option_defs_us array */
864 for (i = 0; i < num_options; i++)
866 const char *key = option_defs_us[i].key;
867 const char *desc = option_defs_us[i].desc;
868 const char *default_value = option_defs_us[i].default_value;
869 struct retro_core_option_value *values = option_defs_us[i].values;
871 size_t default_index = 0;
873 values_buf[i] = NULL;
875 /* Skip options that are irrelevant when using the
876 * old style core options interface */
877 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
882 size_t num_values = 0;
884 /* Determine number of values */
887 if (values[num_values].value)
889 /* Check if this is the default value */
891 if (strcmp(values[num_values].value, default_value) == 0)
892 default_index = num_values;
894 buf_len += strlen(values[num_values].value);
901 /* Build values string */
906 buf_len += num_values - 1;
907 buf_len += strlen(desc);
909 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
913 strcpy(values_buf[i], desc);
914 strcat(values_buf[i], "; ");
916 /* Default value goes first */
917 strcat(values_buf[i], values[default_index].value);
919 /* Add remaining values */
920 for (j = 0; j < num_values; j++)
922 if (j != default_index)
924 strcat(values_buf[i], "|");
925 strcat(values_buf[i], values[j].value);
931 variables[option_index].key = key;
932 variables[option_index].value = values_buf[i];
937 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
944 for (i = 0; i < num_options; i++)
949 values_buf[i] = NULL;