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 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(s)",
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 "pcsx_rearmed_show_bios_bootlogo",
424 "Show Bios Bootlogo",
425 "When enabled, shows the playstation logo when starting or resetting. (Breaks some games).",
427 { "disabled", NULL },
434 "pcsx_rearmed_spu_reverb",
436 "Enables or disables audio reverb effect.",
438 { "disabled", NULL },
445 "pcsx_rearmed_spu_interpolation",
446 "Sound: Interpolation",
450 { "gaussian", NULL },
458 "pcsx_rearmed_idiablofix",
462 { "disabled", NULL },
469 "pcsx_rearmed_pe2_fix",
470 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
473 { "disabled", NULL },
480 "pcsx_rearmed_inuyasha_fix",
481 "InuYasha Sengoku Battle Fix",
484 { "disabled", NULL },
491 /* ADVANCED OPTIONS */
493 "pcsx_rearmed_noxadecoding",
497 { "disabled", NULL },
504 "pcsx_rearmed_nocdaudio",
508 { "disabled", NULL },
517 "pcsx_rearmed_nosmccheck",
518 "(Speed Hack) Disable SMC Checks",
519 "Will cause crashes when loading, break memcards.",
521 { "disabled", NULL },
528 "pcsx_rearmed_gteregsunneeded",
529 "(Speed Hack) Assume GTE Regs Unneeded",
530 "May cause graphical glitches.",
532 { "disabled", NULL },
539 "pcsx_rearmed_nogteflags",
540 "(Speed Hack) Disable GTE Flags",
541 "Will cause graphical glitches.",
543 { "disabled", NULL },
549 #endif /* DRC_DISABLE */
551 { NULL, NULL, NULL, { NULL, NULL }, NULL },
554 /* RETRO_LANGUAGE_JAPANESE */
556 /* RETRO_LANGUAGE_FRENCH */
558 /* RETRO_LANGUAGE_SPANISH */
560 /* RETRO_LANGUAGE_GERMAN */
562 /* RETRO_LANGUAGE_ITALIAN */
564 /* RETRO_LANGUAGE_DUTCH */
566 /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
568 /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
570 /* RETRO_LANGUAGE_RUSSIAN */
572 /* RETRO_LANGUAGE_KOREAN */
574 /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
576 /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
578 /* RETRO_LANGUAGE_ESPERANTO */
580 /* RETRO_LANGUAGE_POLISH */
582 /* RETRO_LANGUAGE_VIETNAMESE */
584 /* RETRO_LANGUAGE_ARABIC */
586 /* RETRO_LANGUAGE_GREEK */
588 /* RETRO_LANGUAGE_TURKISH */
591 ********************************
593 ********************************
596 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
597 option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
598 NULL, /* RETRO_LANGUAGE_JAPANESE */
599 NULL, /* RETRO_LANGUAGE_FRENCH */
600 NULL, /* RETRO_LANGUAGE_SPANISH */
601 NULL, /* RETRO_LANGUAGE_GERMAN */
602 NULL, /* RETRO_LANGUAGE_ITALIAN */
603 NULL, /* RETRO_LANGUAGE_DUTCH */
604 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
605 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
606 NULL, /* RETRO_LANGUAGE_RUSSIAN */
607 NULL, /* RETRO_LANGUAGE_KOREAN */
608 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
609 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
610 NULL, /* RETRO_LANGUAGE_ESPERANTO */
611 NULL, /* RETRO_LANGUAGE_POLISH */
612 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
613 NULL, /* RETRO_LANGUAGE_ARABIC */
614 NULL, /* RETRO_LANGUAGE_GREEK */
615 NULL, /* RETRO_LANGUAGE_TURKISH */
619 ********************************
621 ********************************
624 /* Handles configuration/setting of core options.
625 * Should only be called inside retro_set_environment().
626 * > We place the function body in the header to avoid the
627 * necessity of adding more .c files (i.e. want this to
628 * be as painless as possible for core devs)
631 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
633 unsigned version = 0;
638 if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version == 1))
640 struct retro_core_options_intl core_options_intl;
641 unsigned language = 0;
643 core_options_intl.us = option_defs_us;
644 core_options_intl.local = NULL;
646 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
647 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
648 core_options_intl.local = option_defs_intl[language];
650 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
655 size_t option_index = 0;
656 size_t num_options = 0;
657 struct retro_variable *variables = NULL;
658 char **values_buf = NULL;
660 /* Determine number of options
661 * > Note: We are going to skip a number of irrelevant
662 * core options when building the retro_variable array,
663 * but we'll allocate space for all of them. The difference
664 * in resource usage is negligible, and this allows us to
665 * keep the code 'cleaner' */
668 if (option_defs_us[num_options].key)
674 /* Allocate arrays */
675 variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
676 values_buf = (char **)calloc(num_options, sizeof(char *));
678 if (!variables || !values_buf)
681 /* Copy parameters from option_defs_us array */
682 for (i = 0; i < num_options; i++)
684 const char *key = option_defs_us[i].key;
685 const char *desc = option_defs_us[i].desc;
686 const char *default_value = option_defs_us[i].default_value;
687 struct retro_core_option_value *values = option_defs_us[i].values;
689 size_t default_index = 0;
691 values_buf[i] = NULL;
693 /* Skip options that are irrelevant when using the
694 * old style core options interface */
695 if ((strcmp(key, "fceumm_advance_sound_options") == 0))
700 size_t num_values = 0;
702 /* Determine number of values */
705 if (values[num_values].value)
707 /* Check if this is the default value */
709 if (strcmp(values[num_values].value, default_value) == 0)
710 default_index = num_values;
712 buf_len += strlen(values[num_values].value);
719 /* Build values string */
724 buf_len += num_values - 1;
725 buf_len += strlen(desc);
727 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
731 strcpy(values_buf[i], desc);
732 strcat(values_buf[i], "; ");
734 /* Default value goes first */
735 strcat(values_buf[i], values[default_index].value);
737 /* Add remaining values */
738 for (j = 0; j < num_values; j++)
740 if (j != default_index)
742 strcat(values_buf[i], "|");
743 strcat(values_buf[i], values[j].value);
749 variables[option_index].key = key;
750 variables[option_index].value = values_buf[i];
755 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
762 for (i = 0; i < num_options; i++)
767 values_buf[i] = NULL;