1 #ifndef LIBRETRO_CORE_OPTIONS_H__
2 #define LIBRETRO_CORE_OPTIONS_H__
8 #include <retro_inline.h>
15 ********************************
16 * Core Option Definitions
17 ********************************
20 /* RETRO_LANGUAGE_ENGLISH */
23 * - All other languages must include the same keys and values
24 * - Will be used as a fallback in the event that frontend language
26 * - Will be used as a fallback for any missing entries in
27 * frontend language definition
31 #define PSX_CLOCK_DEFAULT "50"
32 #define PSX_CLOCK_LABEL "Overclock or underclock the PSX clock. Default is 50"
34 #define PSX_CLOCK_DEFAULT "57"
35 #define PSX_CLOCK_LABEL "Overclock or underclock the PSX clock. Default is 57"
38 struct retro_core_option_definition option_defs_us[] = {
40 "pcsx_rearmed_frameskip",
42 "Choose how much frames should be skipped to improve performance at the expense of visual smoothness.",
55 "Allows you to use real bios file (if available) or emulated bios (HLE). Its recommended to use official bios file for better compatibility.",
64 "pcsx_rearmed_region",
66 "Choose what region the system is from. 60 Hz for NTSC, 50 Hz for PAL.",
76 "pcsx_rearmed_memcard2",
77 "Enable Second Memory Card (Shared)",
78 "Enabled the memory card slot 2. This memory card is shared amongs all games.",
87 "pcsx_rearmed_pad1type",
89 "Pad type for player 1",
93 { "dualshock", NULL },
101 "pcsx_rearmed_pad2type",
103 "Pad type for player 2",
105 { "standard", NULL },
107 { "dualshock", NULL },
115 "pcsx_rearmed_pad3type",
117 "Pad type for player 3",
119 { "standard", NULL },
121 { "dualshock", NULL },
129 "pcsx_rearmed_pad4type",
131 "Pad type for player 4",
133 { "standard", NULL },
135 { "dualshock", NULL },
143 "pcsx_rearmed_pad5type",
145 "Pad type for player 5",
147 { "standard", NULL },
149 { "dualshock", NULL },
156 "pcsx_rearmed_pad6type",
158 "Pad type for player 6",
160 { "standard", NULL },
162 { "dualshock", NULL },
169 "pcsx_rearmed_pad7type",
171 "Pad type for player 7",
173 { "standard", NULL },
175 { "dualshock", NULL },
182 "pcsx_rearmed_pad8type",
184 "Pad type for player 8",
186 { "standard", NULL },
188 { "dualshock", NULL },
196 "pcsx_rearmed_multitap1",
198 "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
201 { "disabled", NULL },
208 "pcsx_rearmed_multitap2",
210 "Enables/Disables multitap on port 2, allowing upto 8 players in games that permit it. Multitap 1 has to be enabled for this to work.",
213 { "disabled", NULL },
220 "pcsx_rearmed_negcon_deadzone",
221 "NegCon Twist Deadzone (Percent)",
222 "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
236 "pcsx_rearmed_negcon_response",
237 "NegCon Twist Response",
238 "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
241 { "quadratic", NULL },
248 "pcsx_rearmed_vibration",
250 "Enables vibration feedback for controllers that supports vibration features.",
252 { "disabled", NULL },
259 "pcsx_rearmed_dithering",
261 "If Off, disables the dithering pattern the PSX applies to combat color banding.",
263 { "disabled", NULL },
273 "Dynamic Recompiler",
274 "Enables core to use dynamic recompiler or interpreter (slower) cpu instructions.",
276 { "disabled", NULL },
283 "pcsx_rearmed_psxclock",
362 #endif /* DRC_DISABLE */
366 "pcsx_rearmed_neon_interlace_enable",
367 "Enable Interlacing Mode",
368 "Enables fake scanlines effect.",
370 { "disabled", NULL },
377 "pcsx_rearmed_neon_enhancement_enable",
378 "Enhanced Resolution (Slow)",
379 "Renders in double resolution at the cost of lower performance",
381 { "disabled", NULL },
388 "pcsx_rearmed_neon_enhancement_no_main",
389 "Enhanced Resolution (Speed Hack)",
390 "Speed hack for Enhanced resolution option (glitches some games).",
392 { "disabled", NULL },
398 #endif /* __ARM_NEON__ */
401 "pcsx_rearmed_duping_enable",
403 "A speedup, redraws/reuses the last frame if there was no new data.",
405 { "disabled", NULL },
412 "pcsx_rearmed_display_internal_fps",
413 "Display Internal FPS",
414 "Shows an on-screen frames per second counter when enabled.",
416 { "disabled", NULL },
423 /* GPU PEOPS OPTIONS */
426 "pcsx_rearmed_show_gpu_peops_settings",
427 "Show Advance GPU Settings",
428 "Enable or disable various gpu fixes. A core restart might be needed for settings to take effect. NOTE: Quick Menu must be toggled for this setting to take effect.",
430 { "disabled", NULL },
437 "pcsx_rearmed_gpu_peops_fix_0",
438 "(GPU) Odd/Even Bit Hack",
439 "Needed for Chrono Cross.",
441 { "disabled", NULL },
448 "pcsx_rearmed_gpu_peops_fix_1",
449 "(GPU) Expand Screen Width",
450 "Capcom fighting games",
452 { "disabled", NULL },
459 "pcsx_rearmed_gpu_peops_fix_2",
460 "(GPU) Ignore Brightness Color",
461 "Black screens in Lunar",
463 { "disabled", NULL },
470 "pcsx_rearmed_gpu_peops_fix_3",
471 "(GPU) Disable Coordinate Check",
472 "Compatibility mode",
474 { "disabled", NULL },
481 "pcsx_rearmed_gpu_peops_fix_6",
482 "(GPU) Lazy Screen Update",
485 { "disabled", NULL },
492 "pcsx_rearmed_gpu_peops_fix_7",
493 "(GPU) Old Frame Skipping",
494 "Skip every second frame",
496 { "disabled", NULL },
503 "pcsx_rearmed_gpu_peops_fix_8",
504 "(GPU) Repeated Flat Tex Triangles",
505 "Needed by Dark Forces",
507 { "disabled", NULL },
514 "pcsx_rearmed_gpu_peops_fix_9",
515 "(GPU) Draw Quads with Triangles",
516 "Better g-colors, worse textures",
518 { "disabled", NULL },
525 "pcsx_rearmed_gpu_peops_fix_10",
526 "(GPU) Fake 'Gpu Busy' States",
527 "Toggle busy flags after drawing",
529 { "disabled", NULL },
538 "pcsx_rearmed_show_bios_bootlogo",
539 "Show Bios Bootlogo",
540 "When enabled, shows the playstation logo when starting or resetting. (Breaks some games).",
542 { "disabled", NULL },
549 "pcsx_rearmed_spu_reverb",
551 "Enables or disables audio reverb effect.",
553 { "disabled", NULL },
560 "pcsx_rearmed_spu_interpolation",
561 "Sound Interpolation",
565 { "gaussian", NULL },
573 "pcsx_rearmed_idiablofix",
577 { "disabled", NULL },
584 "pcsx_rearmed_pe2_fix",
585 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
588 { "disabled", NULL },
595 "pcsx_rearmed_inuyasha_fix",
596 "InuYasha Sengoku Battle Fix",
599 { "disabled", NULL },
606 /* ADVANCED OPTIONS */
608 "pcsx_rearmed_noxadecoding",
612 { "disabled", NULL },
619 "pcsx_rearmed_nocdaudio",
623 { "disabled", NULL },
632 "pcsx_rearmed_nosmccheck",
633 "(Speed Hack) Disable SMC Checks",
634 "Will cause crashes when loading, break memcards.",
636 { "disabled", NULL },
643 "pcsx_rearmed_gteregsunneeded",
644 "(Speed Hack) Assume GTE Regs Unneeded",
645 "May cause graphical glitches.",
647 { "disabled", NULL },
654 "pcsx_rearmed_nogteflags",
655 "(Speed Hack) Disable GTE Flags",
656 "Will cause graphical glitches.",
658 { "disabled", NULL },
664 #endif /* DRC_DISABLE */
666 { NULL, NULL, NULL, { NULL, NULL }, NULL },
669 /* RETRO_LANGUAGE_JAPANESE */
671 /* RETRO_LANGUAGE_FRENCH */
673 /* RETRO_LANGUAGE_SPANISH */
675 /* RETRO_LANGUAGE_GERMAN */
677 /* RETRO_LANGUAGE_ITALIAN */
679 /* RETRO_LANGUAGE_DUTCH */
681 /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
683 /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
685 /* RETRO_LANGUAGE_RUSSIAN */
687 /* RETRO_LANGUAGE_KOREAN */
689 /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
691 /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
693 /* RETRO_LANGUAGE_ESPERANTO */
695 /* RETRO_LANGUAGE_POLISH */
697 /* RETRO_LANGUAGE_VIETNAMESE */
699 /* RETRO_LANGUAGE_ARABIC */
701 /* RETRO_LANGUAGE_GREEK */
703 /* RETRO_LANGUAGE_TURKISH */
706 ********************************
708 ********************************
711 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
712 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
713 NULL, /* RETRO_LANGUAGE_JAPANESE */
714 NULL, /* RETRO_LANGUAGE_FRENCH */
715 NULL, /* RETRO_LANGUAGE_SPANISH */
716 NULL, /* RETRO_LANGUAGE_GERMAN */
717 NULL, /* RETRO_LANGUAGE_ITALIAN */
718 NULL, /* RETRO_LANGUAGE_DUTCH */
719 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
720 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
721 NULL, /* RETRO_LANGUAGE_RUSSIAN */
722 NULL, /* RETRO_LANGUAGE_KOREAN */
723 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
724 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
725 NULL, /* RETRO_LANGUAGE_ESPERANTO */
726 NULL, /* RETRO_LANGUAGE_POLISH */
727 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
728 NULL, /* RETRO_LANGUAGE_ARABIC */
729 NULL, /* RETRO_LANGUAGE_GREEK */
730 NULL, /* RETRO_LANGUAGE_TURKISH */
734 ********************************
736 ********************************
739 /* Handles configuration/setting of core options.
740 * Should only be called inside retro_set_environment().
741 * > We place the function body in the header to avoid the
742 * necessity of adding more .c files (i.e. want this to
743 * be as painless as possible for core devs)
746 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
748 unsigned version = 0;
753 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version == 1))
755 struct retro_core_options_intl core_options_intl;
756 unsigned language = 0;
758 core_options_intl.us = option_defs_us;
759 core_options_intl.local = NULL;
761 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
762 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
763 core_options_intl.local = option_defs_intl[language];
765 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
770 size_t option_index = 0;
771 size_t num_options = 0;
772 struct retro_variable *variables = NULL;
773 char **values_buf = NULL;
775 /* Determine number of options
776 * > Note: We are going to skip a number of irrelevant
777 * core options when building the retro_variable array,
778 * but we'll allocate space for all of them. The difference
779 * in resource usage is negligible, and this allows us to
780 * keep the code 'cleaner' */
783 if (option_defs_us[num_options].key)
789 /* Allocate arrays */
790 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
791 values_buf = (char **)calloc(num_options, sizeof(char *));
793 if (!variables || !values_buf)
796 /* Copy parameters from option_defs_us array */
797 for (i = 0; i < num_options; i++)
799 const char *key = option_defs_us[i].key;
800 const char *desc = option_defs_us[i].desc;
801 const char *default_value = option_defs_us[i].default_value;
802 struct retro_core_option_value *values = option_defs_us[i].values;
804 size_t default_index = 0;
806 values_buf[i] = NULL;
808 /* Skip options that are irrelevant when using the
809 * old style core options interface */
810 if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
815 size_t num_values = 0;
817 /* Determine number of values */
820 if (values[num_values].value)
822 /* Check if this is the default value */
824 if (strcmp(values[num_values].value, default_value) == 0)
825 default_index = num_values;
827 buf_len += strlen(values[num_values].value);
834 /* Build values string */
839 buf_len += num_values - 1;
840 buf_len += strlen(desc);
842 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
846 strcpy(values_buf[i], desc);
847 strcat(values_buf[i], "; ");
849 /* Default value goes first */
850 strcat(values_buf[i], values[default_index].value);
852 /* Add remaining values */
853 for (j = 0; j < num_values; j++)
855 if (j != default_index)
857 strcat(values_buf[i], "|");
858 strcat(values_buf[i], values[j].value);
864 variables[option_index].key = key;
865 variables[option_index].value = values_buf[i];
870 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
877 for (i = 0; i < num_options; i++)
882 values_buf[i] = NULL;