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 * - 2.0: Add support for core options v2 interface
20 * - 1.3: Move translations to libretro_core_options_intl.h
21 * - libretro_core_options_intl.h includes BOM and utf-8
22 * fix for MSVC 2010-2013
23 * - Added HAVE_NO_LANGEXTRA flag to disable translations
24 * on platforms/compilers without BOM support
25 * - 1.2: Use core options v1 interface when
26 * RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
27 * (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
28 * - 1.1: Support generation of core options v0 retro_core_option_value
29 * arrays containing options with a single value
38 ********************************
39 * Core Option Definitions
40 ********************************
43 /* RETRO_LANGUAGE_ENGLISH */
46 * - All other languages must include the same keys and values
47 * - Will be used as a fallback in the event that frontend language
49 * - Will be used as a fallback for any missing entries in
50 * frontend language definition
53 struct retro_core_option_v2_category option_cats_us[] = {
57 "Configure base hardware parameters: region, BIOS selection, memory cards, etc."
62 "Configure base display parameters."
68 "Configure low-level settings of the NEON GPU plugin."
74 "GPU Plugin (Advanced)",
75 "Configure low-level settings of the P.E.Op.S. GPU plugin."
81 "GPU Plugin (Advanced)",
82 "Configure low-level settings of the UNAI GPU plugin."
88 "Configure sound emulation: reverb, interpolation, CD audio decoding."
93 "Configure input devices: analog response, haptic feedback, Multitaps, light guns, etc."
97 "Compatibility Fixes",
98 "Configure settings/workarounds required for correct operation of specific games."
102 "Speed Hacks (Advanced)",
103 "Configure hacks that may improve performance at the expense of decreased accuracy/stability."
105 { NULL, NULL, NULL },
108 struct retro_core_option_v2_definition option_defs_us[] = {
110 "pcsx_rearmed_region",
113 "Specify which region the system is from. 'NTSC' is 60 Hz while 'PAL' is 50 Hz. 'Auto' will detect the region of the currently loaded content. Games may run faster or slower than normal if the incorrect region is selected.",
128 "Specify which BIOS to use. 'Auto' will attempt to load a real bios file from the frontend 'system' directory, falling back to high level emulation if unavailable. 'HLE' forces high level BIOS emulation. It is recommended to use an official bios file for better compatibility.",
139 "pcsx_rearmed_show_bios_bootlogo",
140 "Show BIOS Boot Logo",
142 "When using an official BIOS file, specify whether to show the PlayStation logo upon starting or resetting content. Warning: Enabling the boot logo may reduce game compatibility.",
146 { "disabled", NULL },
153 "pcsx_rearmed_memcard2",
154 "Enable Second Memory Card (Shared)",
156 "Emulate a second memory card in slot 2. This will be shared by all games.",
160 { "disabled", NULL },
168 "pcsx_rearmed_async_cd",
169 "CD Access Method (Restart)",
171 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage. 'Pre-Cache (CHD)' loads disk image into memory for faster access (CHD files only).",
175 { "sync", "Synchronous" },
176 { "async", "Asynchronous" },
177 { "precache", "Pre-Cache (CHD)" },
184 #define V(x) { #x, NULL }
186 "pcsx_rearmed_phys_cd_readahead",
187 "Physical CD read-ahead",
189 "(Hardware CD-ROM only) Reads the specified amount of sectors ahead of time to try to avoid later stalls. 333000 will try to read the complete disk (requires an additional 750MB of RAM).",
193 V(0), V(1), V(2), V(3), V(4), V(5), V(6), V(7),
194 V(8), V(9), V(10), V(11), V(12), V(13), V(14), V(15),
195 V(16), V(32), V(64), V(128), V(256), V(512), V(1024), V(333000),
205 "Dynamic Recompiler",
207 "Dynamically recompile PSX CPU instructions to native instructions. Much faster than using an interpreter, but may be less accurate on some platforms.",
211 { "disabled", NULL },
219 "pcsx_rearmed_psxclock",
220 "PSX CPU Clock Speed",
222 "Overclock or under-clock the PSX CPU. Try adjusting this if the game is too slow, too fast or hangs."
223 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
305 #if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
312 "pcsx_rearmed_dithering",
315 "Enable emulation of the dithering technique used by the PSX to smooth out color banding artifacts. Increases performance requirements.",
319 { "disabled", NULL },
323 #if defined HAVE_LIBNX || defined _3DS
329 #ifdef THREAD_RENDERING
331 "pcsx_rearmed_gpu_thread_rendering",
332 "Threaded Rendering",
334 "When enabled, runs GPU commands in a secondary thread. 'Synchronous' improves performance while maintaining proper frame pacing. 'Asynchronous' improves performance even further, but may cause dropped frames and increased latency. Produces best results with games that run natively at less than 60 frames per second.",
338 { "disabled", NULL },
339 { "sync", "Synchronous" },
340 { "async", "Asynchronous" },
347 "pcsx_rearmed_frameskip_type",
350 "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.",
354 { "disabled", NULL },
356 { "auto_threshold", "Auto (Threshold)" },
357 { "fixed_interval", "Fixed Interval" },
363 "pcsx_rearmed_frameskip_threshold",
364 "Frameskip Threshold (%)",
366 "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.",
391 "pcsx_rearmed_frameskip_interval",
392 "Frameskip Interval",
394 "Specify the maximum number of frames that can be skipped before a new frame is rendered.",
413 "pcsx_rearmed_display_internal_fps",
414 "Display Internal FPS",
416 "Show the internal frame rate at which the emulated PlayStation system is rendering content. Note: Requires on-screen notifications to be enabled in the libretro frontend.",
420 { "disabled", NULL },
427 "pcsx_rearmed_fractional_framerate",
428 "Use fractional frame rate",
430 "Instead of the exact 50 or 60 (maximum) fps for PAL/NTSC the real console runs closer to something like 49.75 and 59.81fps (varies slightly between hw versions). PCSX-ReARMed uses the former \"round\" framerates to better match modern displays, however that may cause audio/video desync in games like DDR and Spyro 2 (intro). With this option you can try to use fractional framerates.",
435 { "disabled", NULL },
442 "pcsx_rearmed_gpu_slow_llists",
443 "(GPU) Slow linked list processing",
445 "Slower but more accurate GPU linked list processing. Needed by only a few games like Vampire Hunter D. Should be autodetected in most cases.",
450 { "disabled", NULL },
457 "pcsx_rearmed_show_overscan",
458 "(GPU) Show horizontal overscan",
460 "The PSX can display graphics way into the horizontal borders, even if most screens would crop it. This option tries to display all such graphics. Note that this may result in unusual resolutions that your device might not handle well. The 'Hack' option is intended for the widescreen hacks.",
464 { "disabled", NULL },
472 "pcsx_rearmed_screen_centering",
473 "(GPU) Screen centering",
475 "The PSX has a feature allowing it to shift the image position on screen. Some (mostly PAL) games used this feature in a strange way making the image miscentered and causing uneven borders to appear. With 'Auto' the emulator tries to correct this miscentering automatically. 'Game-controlled' uses the settings supplied by the game. 'Manual' allows to override those values with the settings below.",
480 { "game", "Game-controlled" },
481 { "borderless", "Borderless" },
482 { "manual", "Manual" },
487 #define V(x) { #x, NULL }
489 "pcsx_rearmed_screen_centering_x",
490 "(GPU) Manual screen centering X",
492 "X offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
496 V(-16), V(-14), V(-12), V(-10), V(-8), V(-6), V(-4), V(-2), V(0), V(2), V(4), V(6), V(8), V(10), V(12), V(14), V(16),
502 "pcsx_rearmed_screen_centering_y",
503 "(GPU) Manual screen centering Y",
505 "Y offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
509 V(-16), V(-15), V(-14), V(-13), V(-12), V(-11), V(-10), V(-9), V(-8), V(-7), V(-6), V(-5), V(-4), V(-3), V(-2), V(-1),
510 V(0), V(1), V(2), V(3), V(4), V(5), V(6), V(7), V(8), V(9), V(10), V(11), V(12), V(13), V(14), V(15), V(16),
518 "pcsx_rearmed_neon_interlace_enable_v2",
519 "(GPU) Show Interlaced Video",
520 "Show Interlaced Video",
521 "When enabled, games that run in high resolution video modes (480i, 512i) will produced interlaced video output. While this displays correctly on CRT televisions, it will produce artifacts on modern displays. When disabled, all video is output in progressive format. Note: there are games that will glitch is this is off.",
526 { "disabled", NULL },
533 "pcsx_rearmed_neon_enhancement_enable",
534 "(GPU) Enhanced Resolution",
535 "Enhanced Resolution",
536 "Render games that do not already run in high resolution video modes (480i, 512i) at twice the native internal resolution. Improves the fidelity of 3D models at the expense of increased performance requirements. 2D elements are generally unaffected by this setting.",
540 { "disabled", NULL },
547 "pcsx_rearmed_neon_enhancement_no_main",
548 "(GPU) Enhanced Resolution Speed Hack",
549 "Enhanced Resolution Speed Hack",
550 "('Enhanced Resolution' Hack) Improves performance but reduces compatibility and may cause rendering errors.",
554 { "disabled", NULL },
561 "pcsx_rearmed_neon_enhancement_tex_adj",
562 "(GPU) Enhanced Resolution Texture Adjustment",
563 "Enhanced Resolution Texture Adjustment",
564 "('Enhanced Resolution' Hack) Attempts to solve some texturing issues in some games, but causes new ones in others.",
568 { "disabled", NULL },
574 #endif /* GPU_NEON */
577 "pcsx_rearmed_show_gpu_peops_settings",
578 "Show Advanced P.E.Op.S. GPU Settings",
580 "Show low-level configuration options for the P.E.Op.S. GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
584 { "disabled", NULL },
591 "pcsx_rearmed_gpu_peops_odd_even_bit",
592 "(GPU) Odd/Even Bit Hack",
594 "A hack fix used to correct lock-ups that may occur in games such as Chrono Cross. Disable unless required.",
598 { "disabled", NULL },
605 "pcsx_rearmed_gpu_peops_expand_screen_width",
606 "(GPU) Expand Screen Width",
607 "Expand Screen Width",
608 "Intended for use only with Capcom 2D fighting games. Enlarges the display area at the right side of the screen to show all background elements without cut-off. May cause rendering errors.",
612 { "disabled", NULL },
619 "pcsx_rearmed_gpu_peops_ignore_brightness",
620 "(GPU) Ignore Brightness Color",
621 "Ignore Brightness Color",
622 "A hack fix used to repair black screens in Lunar Silver Star Story Complete when entering a house or a menu. Disable unless required.",
626 { "disabled", NULL },
633 "pcsx_rearmed_gpu_peops_disable_coord_check",
634 "(GPU) Disable Coordinate Check",
635 "Disable Coordinate Check",
636 "Legacy compatibility mode. May improve games that fail to run correctly on newer GPU hardware. Disable unless required.",
640 { "disabled", NULL },
647 "pcsx_rearmed_gpu_peops_lazy_screen_update",
648 "(GPU) Lazy Screen Update",
649 "Lazy Screen Update",
650 "A partial fix to prevent text box flickering in Dragon Warrior VII. May also improve Pandemonium 2. Disable unless required.",
654 { "disabled", NULL },
661 "pcsx_rearmed_gpu_peops_repeated_triangles",
662 "(GPU) Repeat Flat Tex Triangles",
663 "Repeat Flat Tex Triangles",
664 "A hack fix used to correct rendering errors in Star Wars: Dark Forces. Disable unless required.",
668 { "disabled", NULL },
675 "pcsx_rearmed_gpu_peops_quads_with_triangles",
676 "(GPU) Draw Tex-Quads as Triangles",
677 "Draw Tex-Quads as Triangles",
678 "Corrects graphical distortions that may occur when games utilize Gouraud Shading, at the expense of reduced texture quality. Disable unless required.",
682 { "disabled", NULL },
689 "pcsx_rearmed_gpu_peops_fake_busy_state",
690 "(GPU) Fake 'GPU Busy' States",
691 "Fake 'GPU Busy' States",
692 "Emulate the 'GPU is busy' (drawing primitives) status flag of the original hardware instead of assuming the GPU is always ready for commands. May improve compatibility at the expense of reduced performance. Disable unless required.",
696 { "disabled", NULL },
702 #endif /* GPU_PEOPS */
705 "pcsx_rearmed_show_gpu_unai_settings",
706 "Show Advanced UNAI GPU Settings",
708 "Show low-level configuration options for the UNAI GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
712 { "disabled", NULL },
719 "pcsx_rearmed_gpu_unai_blending",
720 "(GPU) Texture Blending",
722 "Enable alpha-based (and additive) texture blending. Required for various rendering effects, including transparency (e.g. water, shadows). Can be disabled to improve performance at the expense of severe display errors/inaccuracies.",
726 { "disabled", NULL },
733 "pcsx_rearmed_gpu_unai_lighting",
734 "(GPU) Lighting Effects",
736 "Enable simulated lighting effects (via vertex coloring combined with texture mapping). Required by almost all 3D games. Can be disabled to improve performance at the expense of severe display errors/inaccuracies (missing shadows, flat textures, etc.).",
740 { "disabled", NULL },
747 "pcsx_rearmed_gpu_unai_fast_lighting",
748 "(GPU) Fast Lighting",
750 "Improves performance when 'Lighting Effects' are enabled, but may cause moderate/severe rendering errors.",
754 { "disabled", NULL },
761 "pcsx_rearmed_gpu_unai_scale_hires",
762 "(GPU) Hi-Res Downscaling",
763 "Hi-Res Downscaling",
764 "When enabled, games that run in high resolution video modes (480i, 512i) will be downscaled to 320x240. Can improve performance, and is recommended on devices with native 240p display resolutions.",
768 { "disabled", NULL },
778 #endif /* GPU_UNAI */
780 "pcsx_rearmed_spu_reverb",
781 "Audio Reverb Effects",
783 "Enable emulation of the reverb feature provided by the PSX SPU. Can be disabled to improve performance at the expense of reduced audio quality/authenticity.",
787 { "disabled", NULL },
791 #ifdef HAVE_PRE_ARMV7
798 "pcsx_rearmed_spu_interpolation",
799 "Sound Interpolation",
801 "Enable emulation of the in-built audio interpolation provided by the PSX SPU. 'Gaussian' sounds closest to original hardware. 'Simple' improves performance but reduces quality. 'Cubic' has the highest performance requirements but produces increased clarity. Can be disabled entirely for maximum performance, at the expense of greatly reduced audio quality.",
805 { "simple", "Simple" },
806 { "gaussian", "Gaussian" },
807 { "cubic", "Cubic" },
808 { "off", "disabled" },
811 #ifdef HAVE_PRE_ARMV7
818 "pcsx_rearmed_nocdaudio",
821 "Enable playback of CD (CD-DA) audio tracks. Can be disabled to improve performance in games that include CD audio, at the expense of missing music.",
825 { "disabled", NULL },
832 "pcsx_rearmed_noxadecoding",
835 "Enable playback of XA (eXtended Architecture ADPCM) audio tracks. Can be disabled to improve performance in games that include XA audio, at the expense of missing music.",
839 { "disabled", NULL },
847 "pcsx_rearmed_spu_thread",
850 "Emulates the PSX SPU on another CPU thread. May cause audio glitches in some games.",
854 { "disabled", NULL },
860 #endif // P_HAVE_PTHREAD
862 "pcsx_rearmed_show_input_settings",
863 "Show Input Settings",
865 "Show configuration options for all input devices: analog response, Multitaps, light guns, etc. Quick Menu may need to be toggled for this setting to take effect.",
869 { "disabled", NULL },
876 "pcsx_rearmed_analog_axis_modifier",
877 "Analog Axis Bounds",
879 "Specify range limits for the left and right analog sticks when input device is set to 'analog' or 'dualshock'. 'Square' bounds improve input response when using controllers with highly circular ranges that are unable to fully saturate the X and Y axes at 45 degree deflections.",
883 { "circle", "Circle" },
884 { "square", "Square" },
890 "pcsx_rearmed_vibration",
893 "Enable haptic feedback when using a rumble-equipped gamepad with input device set to 'dualshock'.",
897 { "disabled", NULL },
904 "pcsx_rearmed_analog_combo",
905 "DualShock Analog Mode Toggle Key Combo",
907 "When the input device type is DualShock, this option allows the emulated DualShock to be toggled between DIGITAL and ANALOG mode like original hardware. You can select the button combination for this.",
911 { "disabled", NULL },
912 { "l1+r1+select", "L1 + R1 + Select" },
913 { "l1+r1+start", "L1 + R1 + Start" },
914 { "l1+r1+l3", "L1 + R1 + L3" },
915 { "l1+r1+r3", "L1 + R1 + R3" },
916 { "l3+r3", "L3 + R3" },
922 "pcsx_rearmed_multitap",
925 "Connect a virtual PSX Multitap peripheral to either controller 'Port 1' or controller 'Port 2' for 5 player simultaneous input, or to both 'Ports 1 and 2' for 8 player input. Mutlitap usage requires compatible games.",
929 { "disabled", NULL },
930 { "port 1", "Port 1" },
931 { "port 2", "Port 2" },
932 { "ports 1 and 2", "Ports 1 and 2" },
938 "pcsx_rearmed_negcon_deadzone",
939 "NegCon Twist Deadzone",
941 "Set the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
963 "pcsx_rearmed_negcon_response",
964 "NegCon Twist Response",
966 "Specify the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
970 { "linear", "Linear" },
971 { "quadratic", "Quadratic" },
972 { "cubic", "Cubic" },
978 "pcsx_rearmed_input_sensitivity",
981 "Adjust responsiveness of emulated 'mouse' input devices.",
1029 "pcsx_rearmed_crosshair1",
1030 "Player 1 Lightgun Crosshair",
1032 "Toggle player 1's crosshair for the Guncon or Konami Gun",
1036 { "disabled", NULL },
1046 "pcsx_rearmed_crosshair2",
1047 "Player 2 Lightgun Crosshair",
1049 "Toggle player 2's crosshair for the Guncon or Konami Gun",
1053 { "disabled", NULL },
1063 "pcsx_rearmed_konamigunadjustx",
1064 "Konami Gun X Axis Offset",
1066 "Apply an X axis offset to light gun input when emulating a Konami Gun (Hyper Blaster / Justifier) device. Can be used to correct aiming misalignments.",
1156 "pcsx_rearmed_konamigunadjusty",
1157 "Konami Gun Y Axis Offset",
1159 "Apply a Y axis offset to light gun input when emulating a Konami Gun (Hyper Blaster / Justifier) device. Can be used to correct aiming misalignments.",
1249 "pcsx_rearmed_gunconadjustx",
1250 "Guncon X Axis Offset",
1252 "Apply an X axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1342 "pcsx_rearmed_gunconadjusty",
1343 "Guncon Y Axis Offset",
1345 "Apply a Y axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1435 "pcsx_rearmed_gunconadjustratiox",
1436 "Guncon X Axis Response",
1438 "Adjust relative magnitude of horizontal light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1498 "pcsx_rearmed_gunconadjustratioy",
1499 "Guncon Y Axis Response",
1501 "Adjust relative magnitude of vertical light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1561 "pcsx_rearmed_icache_emulation",
1562 "Instruction Cache Emulation",
1564 "Enable emulation of the PSX CPU instruction cache. Improves accuracy at the expense of increased performance overheads. Required for Formula One 2001, Formula One Arcade and Formula One 99. [Interpreter only; partial on lightrec and ARM dynarecs]",
1568 { "enabled", NULL },
1569 { "disabled", NULL },
1575 "pcsx_rearmed_exception_emulation",
1576 "Exception and Breakpoint Emulation",
1578 "Enable emulation of some almost never used PSX's debug features. This causes a performance hit, is not useful for games and is intended for PSX homebrew and romhack developers only. Only enable if you know what you are doing. [Interpreter only]",
1582 { "disabled", NULL },
1583 { "enabled", NULL },
1589 "pcsx_rearmed_cd_turbo",
1592 "This makes the emulated CD-ROM extremely fast and can reduce loading times in some cases. Warning: many games were not programmed to handle such a speed. The game (or even the emulator) MAY CRASH at ANY TIME if this is enabled.",
1596 { "disabled", NULL },
1597 { "enabled", NULL },
1602 #if !defined(DRC_DISABLE) && !defined(LIGHTREC)
1604 "pcsx_rearmed_nocompathacks",
1605 "Disable Automatic Compatibility Hacks",
1607 "By default, PCSX-ReARMed will apply auxiliary compatibility hacks automatically, based on the currently loaded content. This behaviour is required for correct operation, but may be disabled if desired.",
1611 { "disabled", NULL },
1612 { "enabled", NULL },
1618 "pcsx_rearmed_nosmccheck",
1619 "(Speed Hack) Disable SMC Checks",
1620 "Disable SMC Checks",
1621 "Will cause crashes when loading, and lead to memory card failure.",
1625 { "disabled", NULL },
1626 { "enabled", NULL },
1632 "pcsx_rearmed_gteregsunneeded",
1633 "(Speed Hack) Assume GTE Registers Unneeded",
1634 "Assume GTE Registers Unneeded",
1635 "May cause rendering errors.",
1639 { "disabled", NULL },
1640 { "enabled", NULL },
1646 "pcsx_rearmed_nogteflags",
1647 "(Speed Hack) Disable GTE Flags",
1648 "Disable GTE Flags",
1649 "Will cause rendering errors.",
1653 { "disabled", NULL },
1654 { "enabled", NULL },
1659 #endif /* !DRC_DISABLE && !LIGHTREC */
1661 "pcsx_rearmed_nostalls",
1662 "Disable CPU/GTE Stalls",
1664 "Will cause some games to run too quickly. Should be disabled in almost all cases."
1665 #if defined(LIGHTREC)
1666 " Interpreter only."
1672 { "disabled", NULL },
1673 { "enabled", NULL },
1678 { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
1681 struct retro_core_options_v2 options_us = {
1687 ********************************
1689 ********************************
1692 #ifndef HAVE_NO_LANGEXTRA
1693 struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
1694 &options_us, /* RETRO_LANGUAGE_ENGLISH */
1695 NULL, /* RETRO_LANGUAGE_JAPANESE */
1696 NULL, /* RETRO_LANGUAGE_FRENCH */
1697 NULL, /* RETRO_LANGUAGE_SPANISH */
1698 NULL, /* RETRO_LANGUAGE_GERMAN */
1699 NULL, /* RETRO_LANGUAGE_ITALIAN */
1700 NULL, /* RETRO_LANGUAGE_DUTCH */
1701 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1702 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1703 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1704 NULL, /* RETRO_LANGUAGE_KOREAN */
1705 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1706 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1707 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1708 NULL, /* RETRO_LANGUAGE_POLISH */
1709 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1710 NULL, /* RETRO_LANGUAGE_ARABIC */
1711 NULL, /* RETRO_LANGUAGE_GREEK */
1712 &options_tr, /* RETRO_LANGUAGE_TURKISH */
1717 ********************************
1719 ********************************
1722 /* Handles configuration/setting of core options.
1723 * Should be called as early as possible - ideally inside
1724 * retro_set_environment(), and no later than retro_load_game()
1725 * > We place the function body in the header to avoid the
1726 * necessity of adding more .c files (i.e. want this to
1727 * be as painless as possible for core devs)
1730 static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
1731 bool *categories_supported)
1733 unsigned version = 0;
1734 #ifndef HAVE_NO_LANGEXTRA
1735 unsigned language = 0;
1738 if (!environ_cb || !categories_supported)
1741 *categories_supported = false;
1743 if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
1748 #ifndef HAVE_NO_LANGEXTRA
1749 struct retro_core_options_v2_intl core_options_intl;
1751 core_options_intl.us = &options_us;
1752 core_options_intl.local = NULL;
1754 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1755 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1756 core_options_intl.local = options_intl[language];
1758 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
1759 &core_options_intl);
1761 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
1768 size_t option_index = 0;
1769 size_t num_options = 0;
1770 struct retro_core_option_definition
1771 *option_v1_defs_us = NULL;
1772 #ifndef HAVE_NO_LANGEXTRA
1773 size_t num_options_intl = 0;
1774 struct retro_core_option_v2_definition
1775 *option_defs_intl = NULL;
1776 struct retro_core_option_definition
1777 *option_v1_defs_intl = NULL;
1778 struct retro_core_options_intl
1779 core_options_v1_intl;
1781 struct retro_variable *variables = NULL;
1782 char **values_buf = NULL;
1784 /* Determine total number of options */
1787 if (option_defs_us[num_options].key)
1795 /* Allocate US array */
1796 option_v1_defs_us = (struct retro_core_option_definition *)
1797 calloc(num_options + 1, sizeof(struct retro_core_option_definition));
1799 /* Copy parameters from option_defs_us array */
1800 for (i = 0; i < num_options; i++)
1802 struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
1803 struct retro_core_option_value *option_values = option_def_us->values;
1804 struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
1805 struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
1807 option_v1_def_us->key = option_def_us->key;
1808 option_v1_def_us->desc = option_def_us->desc;
1809 option_v1_def_us->info = option_def_us->info;
1810 option_v1_def_us->default_value = option_def_us->default_value;
1812 /* Values must be copied individually... */
1813 while (option_values->value)
1815 option_v1_values->value = option_values->value;
1816 option_v1_values->label = option_values->label;
1823 #ifndef HAVE_NO_LANGEXTRA
1824 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1825 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
1826 options_intl[language])
1827 option_defs_intl = options_intl[language]->definitions;
1829 if (option_defs_intl)
1831 /* Determine number of intl options */
1834 if (option_defs_intl[num_options_intl].key)
1840 /* Allocate intl array */
1841 option_v1_defs_intl = (struct retro_core_option_definition *)
1842 calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
1844 /* Copy parameters from option_defs_intl array */
1845 for (i = 0; i < num_options_intl; i++)
1847 struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
1848 struct retro_core_option_value *option_values = option_def_intl->values;
1849 struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
1850 struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
1852 option_v1_def_intl->key = option_def_intl->key;
1853 option_v1_def_intl->desc = option_def_intl->desc;
1854 option_v1_def_intl->info = option_def_intl->info;
1855 option_v1_def_intl->default_value = option_def_intl->default_value;
1857 /* Values must be copied individually... */
1858 while (option_values->value)
1860 option_v1_values->value = option_values->value;
1861 option_v1_values->label = option_values->label;
1869 core_options_v1_intl.us = option_v1_defs_us;
1870 core_options_v1_intl.local = option_v1_defs_intl;
1872 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
1874 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
1879 /* Allocate arrays */
1880 variables = (struct retro_variable *)calloc(num_options + 1,
1881 sizeof(struct retro_variable));
1882 values_buf = (char **)calloc(num_options, sizeof(char *));
1884 if (!variables || !values_buf)
1887 /* Copy parameters from option_defs_us array */
1888 for (i = 0; i < num_options; i++)
1890 const char *key = option_defs_us[i].key;
1891 const char *desc = option_defs_us[i].desc;
1892 const char *default_value = option_defs_us[i].default_value;
1893 struct retro_core_option_value *values = option_defs_us[i].values;
1895 size_t default_index = 0;
1897 values_buf[i] = NULL;
1899 /* Skip options that are irrelevant when using the
1900 * old style core options interface */
1901 if ((strcmp(key, "pcsx_rearmed_show_input_settings") == 0) ||
1902 (strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0) ||
1903 (strcmp(key, "pcsx_rearmed_show_gpu_unai_settings") == 0))
1908 size_t num_values = 0;
1910 /* Determine number of values */
1913 if (values[num_values].value)
1915 /* Check if this is the default value */
1917 if (strcmp(values[num_values].value, default_value) == 0)
1918 default_index = num_values;
1920 buf_len += strlen(values[num_values].value);
1927 /* Build values string */
1930 buf_len += num_values - 1;
1931 buf_len += strlen(desc);
1933 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1937 strcpy(values_buf[i], desc);
1938 strcat(values_buf[i], "; ");
1940 /* Default value goes first */
1941 strcat(values_buf[i], values[default_index].value);
1943 /* Add remaining values */
1944 for (j = 0; j < num_values; j++)
1946 if (j != default_index)
1948 strcat(values_buf[i], "|");
1949 strcat(values_buf[i], values[j].value);
1955 variables[option_index].key = key;
1956 variables[option_index].value = values_buf[i];
1961 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1967 if (option_v1_defs_us)
1969 free(option_v1_defs_us);
1970 option_v1_defs_us = NULL;
1973 #ifndef HAVE_NO_LANGEXTRA
1974 if (option_v1_defs_intl)
1976 free(option_v1_defs_intl);
1977 option_v1_defs_intl = NULL;
1983 for (i = 0; i < num_options; i++)
1987 free(values_buf[i]);
1988 values_buf[i] = NULL;