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 },
287 "Dynamic Recompiler",
288 "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
290 { "disabled", NULL },
297 "pcsx_rearmed_psxclock",
299 #ifdef HAVE_PRE_ARMV7
300 "Overclock or underclock the PSX clock. Default is 50",
302 "Overclock or underclock the PSX clock. Default is 57",
378 #ifdef HAVE_PRE_ARMV7
384 #endif /* DRC_DISABLE */
388 "pcsx_rearmed_neon_interlace_enable",
389 "Enable Interlacing Mode",
390 "Enables fake scanlines effect.",
392 { "disabled", NULL },
399 "pcsx_rearmed_neon_enhancement_enable",
400 "Enhanced Resolution (Slow)",
401 "Renders in double resolution at the cost of lower performance.",
403 { "disabled", NULL },
410 "pcsx_rearmed_neon_enhancement_no_main",
411 "Enhanced Resolution (Speed Hack)",
412 "Speed hack for Enhanced resolution option (glitches some games).",
414 { "disabled", NULL },
420 #endif /* __ARM_NEON__ */
423 "pcsx_rearmed_duping_enable",
425 "A speedup, redraws/reuses the last frame if there was no new data.",
427 { "disabled", NULL },
434 "pcsx_rearmed_display_internal_fps",
435 "Display Internal FPS",
436 "Shows an on-screen frames per second counter when enabled.",
438 { "disabled", NULL },
445 /* GPU PEOPS OPTIONS */
448 "pcsx_rearmed_show_gpu_peops_settings",
449 "Advanced GPU P.E.Op.S. Settings",
450 "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
452 { "disabled", NULL },
459 "pcsx_rearmed_gpu_peops_odd_even_bit",
460 "(GPU) Odd/Even Bit Hack",
461 "Needed for Chrono Cross.",
463 { "disabled", NULL },
470 "pcsx_rearmed_gpu_peops_expand_screen_width",
471 "(GPU) Expand Screen Width",
472 "Capcom fighting games",
474 { "disabled", NULL },
481 "pcsx_rearmed_gpu_peops_ignore_brightness",
482 "(GPU) Ignore Brightness Color",
483 "Black screens in Lunar Silver Star Story games",
485 { "disabled", NULL },
492 "pcsx_rearmed_gpu_peops_disable_coord_check",
493 "(GPU) Disable Coordinate Check",
494 "Compatibility mode",
496 { "disabled", NULL },
503 "pcsx_rearmed_gpu_peops_lazy_screen_update",
504 "(GPU) Lazy Screen Update",
507 { "disabled", NULL },
514 "pcsx_rearmed_gpu_peops_old_frame_skip",
515 "(GPU) Old Frame Skipping",
516 "Skip every second frame",
518 { "disabled", NULL },
525 "pcsx_rearmed_gpu_peops_repeated_triangles",
526 "(GPU) Repeated Flat Tex Triangles",
527 "Needed by Star Wars: Dark Forces",
529 { "disabled", NULL },
536 "pcsx_rearmed_gpu_peops_quads_with_triangles",
537 "(GPU) Draw Quads with Triangles",
538 "Better g-colors, worse textures",
540 { "disabled", NULL },
547 "pcsx_rearmed_gpu_peops_fake_busy_state",
548 "(GPU) Fake 'Gpu Busy' States",
549 "Toggle busy flags after drawing",
551 { "disabled", NULL },
559 /* GPU UNAI Advanced Options */
562 "pcsx_rearmed_show_gpu_unai_settings",
563 "Advance GPU UNAI/PCSX4All Settings",
564 "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.",
566 { "disabled", NULL },
573 "pcsx_rearmed_gpu_unai_blending",
574 "(GPU) Enable Blending",
577 { "disabled", NULL },
584 "pcsx_rearmed_gpu_unai_lighting",
585 "(GPU) Enable Lighting",
588 { "disabled", NULL },
595 "pcsx_rearmed_gpu_unai_fast_lighting",
596 "(GPU) Enable Fast Lighting",
599 { "disabled", NULL },
606 "pcsx_rearmed_gpu_unai_ilace_force",
607 "(GPU) Enable Forced Interlace",
610 { "disabled", NULL },
617 "pcsx_rearmed_gpu_unai_pixel_skip",
618 "(GPU) Enable Pixel Skip",
621 { "disabled", NULL },
627 #endif /* GPU UNAI Advanced Settings */
630 "pcsx_rearmed_show_bios_bootlogo",
631 "Show Bios Bootlogo",
632 "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
634 { "disabled", NULL },
641 "pcsx_rearmed_spu_reverb",
643 "Enables or disables audio reverb effect.",
645 { "disabled", NULL },
652 "pcsx_rearmed_spu_interpolation",
653 "Sound Interpolation",
656 { "simple", "Simple" },
657 { "gaussian", "Gaussian" },
658 { "cubic", "Cubic" },
659 { "off", "disabled" },
665 "pcsx_rearmed_idiablofix",
669 { "disabled", NULL },
676 "pcsx_rearmed_pe2_fix",
677 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
680 { "disabled", NULL },
687 "pcsx_rearmed_inuyasha_fix",
688 "InuYasha Sengoku Battle Fix",
691 { "disabled", NULL },
698 /* ADVANCED OPTIONS */
700 "pcsx_rearmed_noxadecoding",
704 { "disabled", NULL },
711 "pcsx_rearmed_nocdaudio",
715 { "disabled", NULL },
724 "pcsx_rearmed_nosmccheck",
725 "(Speed Hack) Disable SMC Checks",
726 "Will cause crashes when loading, break memcards.",
728 { "disabled", NULL },
735 "pcsx_rearmed_gteregsunneeded",
736 "(Speed Hack) Assume GTE Regs Unneeded",
737 "May cause graphical glitches.",
739 { "disabled", NULL },
746 "pcsx_rearmed_nogteflags",
747 "(Speed Hack) Disable GTE Flags",
748 "Will cause graphical glitches.",
750 { "disabled", NULL },
756 #endif /* DRC_DISABLE */
758 { NULL, NULL, NULL, {{0}}, NULL },
762 ********************************
764 ********************************
767 #ifndef HAVE_NO_LANGEXTRA
768 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
769 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
770 NULL, /* RETRO_LANGUAGE_JAPANESE */
771 NULL, /* RETRO_LANGUAGE_FRENCH */
772 NULL, /* RETRO_LANGUAGE_SPANISH */
773 NULL, /* RETRO_LANGUAGE_GERMAN */
774 NULL, /* RETRO_LANGUAGE_ITALIAN */
775 NULL, /* RETRO_LANGUAGE_DUTCH */
776 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
777 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
778 NULL, /* RETRO_LANGUAGE_RUSSIAN */
779 NULL, /* RETRO_LANGUAGE_KOREAN */
780 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
781 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
782 NULL, /* RETRO_LANGUAGE_ESPERANTO */
783 NULL, /* RETRO_LANGUAGE_POLISH */
784 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
785 NULL, /* RETRO_LANGUAGE_ARABIC */
786 NULL, /* RETRO_LANGUAGE_GREEK */
787 option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
792 ********************************
794 ********************************
797 /* Handles configuration/setting of core options.
798 * Should be called as early as possible - ideally inside
799 * retro_set_environment(), and no later than retro_load_game()
800 * > We place the function body in the header to avoid the
801 * necessity of adding more .c files (i.e. want this to
802 * be as painless as possible for core devs)
805 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
807 unsigned version = 0;
812 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
814 #ifndef HAVE_NO_LANGEXTRA
815 struct retro_core_options_intl core_options_intl;
816 unsigned language = 0;
818 core_options_intl.us = option_defs_us;
819 core_options_intl.local = NULL;
821 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
822 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
823 core_options_intl.local = option_defs_intl[language];
825 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
827 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
833 size_t option_index = 0;
834 size_t num_options = 0;
835 struct retro_variable *variables = NULL;
836 char **values_buf = NULL;
838 /* Determine number of options
839 * > Note: We are going to skip a number of irrelevant
840 * core options when building the retro_variable array,
841 * but we'll allocate space for all of them. The difference
842 * in resource usage is negligible, and this allows us to
843 * keep the code 'cleaner' */
846 if (option_defs_us[num_options].key)
852 /* Allocate arrays */
853 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
854 values_buf = (char **)calloc(num_options, sizeof(char *));
856 if (!variables || !values_buf)
859 /* Copy parameters from option_defs_us array */
860 for (i = 0; i < num_options; i++)
862 const char *key = option_defs_us[i].key;
863 const char *desc = option_defs_us[i].desc;
864 const char *default_value = option_defs_us[i].default_value;
865 struct retro_core_option_value *values = option_defs_us[i].values;
867 size_t default_index = 0;
869 values_buf[i] = NULL;
871 /* Skip options that are irrelevant when using the
872 * old style core options interface */
873 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
878 size_t num_values = 0;
880 /* Determine number of values */
883 if (values[num_values].value)
885 /* Check if this is the default value */
887 if (strcmp(values[num_values].value, default_value) == 0)
888 default_index = num_values;
890 buf_len += strlen(values[num_values].value);
897 /* Build values string */
902 buf_len += num_values - 1;
903 buf_len += strlen(desc);
905 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
909 strcpy(values_buf[i], desc);
910 strcat(values_buf[i], "; ");
912 /* Default value goes first */
913 strcat(values_buf[i], values[default_index].value);
915 /* Add remaining values */
916 for (j = 0; j < num_values; j++)
918 if (j != default_index)
920 strcat(values_buf[i], "|");
921 strcat(values_buf[i], values[j].value);
927 variables[option_index].key = key;
928 variables[option_index].value = values_buf[i];
933 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
940 for (i = 0; i < num_options; i++)
945 values_buf[i] = NULL;