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 },
166 #if 0 // ndef _WIN32 // currently disabled, see USE_READ_THREAD in libpcsxcore/cdriso.c
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. The value has to be lower than 100 because of some slowdowns (cache misses, hw access penalties, etc.) that are not emulated. 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_screen_centering",
458 "(GPU) Screen centering",
460 "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.",
465 { "game", "Game-controlled" },
466 { "borderless", "Borderless" },
467 { "manual", "Manual" },
472 #define V(x) { #x, NULL }
474 "pcsx_rearmed_screen_centering_x",
475 "(GPU) Manual screen centering X",
477 "X offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
481 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),
487 "pcsx_rearmed_screen_centering_y",
488 "(GPU) Manual screen centering Y",
490 "Y offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
494 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),
495 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),
503 "pcsx_rearmed_neon_interlace_enable_v2",
504 "(GPU) Show Interlaced Video",
505 "Show Interlaced Video",
506 "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.",
511 { "disabled", NULL },
518 "pcsx_rearmed_neon_enhancement_enable",
519 "(GPU) Enhanced Resolution",
520 "Enhanced Resolution",
521 "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.",
525 { "disabled", NULL },
532 "pcsx_rearmed_neon_enhancement_no_main",
533 "(GPU) Enhanced Resolution Speed Hack",
534 "Enhanced Resolution Speed Hack",
535 "('Enhanced Resolution' Hack) Improves performance but reduces compatibility and may cause rendering errors.",
539 { "disabled", NULL },
546 "pcsx_rearmed_neon_enhancement_tex_adj",
547 "(GPU) Enhanced Resolution Texture Adjustment",
548 "Enhanced Resolution Texture Adjustment",
549 "('Enhanced Resolution' Hack) Attempts to solve some texturing issues in some games, but causes new ones in others.",
553 { "disabled", NULL },
559 #endif /* GPU_NEON */
562 "pcsx_rearmed_show_gpu_peops_settings",
563 "Show Advanced P.E.Op.S. GPU Settings",
565 "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.",
569 { "disabled", NULL },
576 "pcsx_rearmed_gpu_peops_odd_even_bit",
577 "(GPU) Odd/Even Bit Hack",
579 "A hack fix used to correct lock-ups that may occur in games such as Chrono Cross. Disable unless required.",
583 { "disabled", NULL },
590 "pcsx_rearmed_gpu_peops_expand_screen_width",
591 "(GPU) Expand Screen Width",
592 "Expand Screen Width",
593 "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.",
597 { "disabled", NULL },
604 "pcsx_rearmed_gpu_peops_ignore_brightness",
605 "(GPU) Ignore Brightness Color",
606 "Ignore Brightness Color",
607 "A hack fix used to repair black screens in Lunar Silver Star Story Complete when entering a house or a menu. Disable unless required.",
611 { "disabled", NULL },
618 "pcsx_rearmed_gpu_peops_disable_coord_check",
619 "(GPU) Disable Coordinate Check",
620 "Disable Coordinate Check",
621 "Legacy compatibility mode. May improve games that fail to run correctly on newer GPU hardware. Disable unless required.",
625 { "disabled", NULL },
632 "pcsx_rearmed_gpu_peops_lazy_screen_update",
633 "(GPU) Lazy Screen Update",
634 "Lazy Screen Update",
635 "A partial fix to prevent text box flickering in Dragon Warrior VII. May also improve Pandemonium 2. Disable unless required.",
639 { "disabled", NULL },
646 "pcsx_rearmed_gpu_peops_repeated_triangles",
647 "(GPU) Repeat Flat Tex Triangles",
648 "Repeat Flat Tex Triangles",
649 "A hack fix used to correct rendering errors in Star Wars: Dark Forces. Disable unless required.",
653 { "disabled", NULL },
660 "pcsx_rearmed_gpu_peops_quads_with_triangles",
661 "(GPU) Draw Tex-Quads as Triangles",
662 "Draw Tex-Quads as Triangles",
663 "Corrects graphical distortions that may occur when games utilize Gouraud Shading, at the expense of reduced texture quality. Disable unless required.",
667 { "disabled", NULL },
674 "pcsx_rearmed_gpu_peops_fake_busy_state",
675 "(GPU) Fake 'GPU Busy' States",
676 "Fake 'GPU Busy' States",
677 "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.",
681 { "disabled", NULL },
687 #endif /* GPU_PEOPS */
690 "pcsx_rearmed_show_gpu_unai_settings",
691 "Show Advanced UNAI GPU Settings",
693 "Show low-level configuration options for the UNAI GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
697 { "disabled", NULL },
704 "pcsx_rearmed_gpu_unai_blending",
705 "(GPU) Texture Blending",
707 "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.",
711 { "disabled", NULL },
718 "pcsx_rearmed_gpu_unai_lighting",
719 "(GPU) Lighting Effects",
721 "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.).",
725 { "disabled", NULL },
732 "pcsx_rearmed_gpu_unai_fast_lighting",
733 "(GPU) Fast Lighting",
735 "Improves performance when 'Lighting Effects' are enabled, but may cause moderate/severe rendering errors.",
739 { "disabled", NULL },
746 "pcsx_rearmed_gpu_unai_scale_hires",
747 "(GPU) Hi-Res Downscaling",
748 "Hi-Res Downscaling",
749 "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.",
753 { "disabled", NULL },
763 #endif /* GPU_UNAI */
765 "pcsx_rearmed_spu_reverb",
766 "Audio Reverb Effects",
768 "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.",
772 { "disabled", NULL },
776 #ifdef HAVE_PRE_ARMV7
783 "pcsx_rearmed_spu_interpolation",
784 "Sound Interpolation",
786 "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.",
790 { "simple", "Simple" },
791 { "gaussian", "Gaussian" },
792 { "cubic", "Cubic" },
793 { "off", "disabled" },
796 #ifdef HAVE_PRE_ARMV7
803 "pcsx_rearmed_nocdaudio",
806 "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.",
810 { "disabled", NULL },
817 "pcsx_rearmed_noxadecoding",
820 "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.",
824 { "disabled", NULL },
832 "pcsx_rearmed_spu_thread",
835 "Emulates the PSX SPU on another CPU thread. May cause audio glitches in some games.",
839 { "disabled", NULL },
845 #endif // P_HAVE_PTHREAD
847 "pcsx_rearmed_show_input_settings",
848 "Show Input Settings",
850 "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.",
854 { "disabled", NULL },
861 "pcsx_rearmed_analog_axis_modifier",
862 "Analog Axis Bounds",
864 "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.",
868 { "circle", "Circle" },
869 { "square", "Square" },
875 "pcsx_rearmed_vibration",
878 "Enable haptic feedback when using a rumble-equipped gamepad with input device set to 'dualshock'.",
882 { "disabled", NULL },
889 "pcsx_rearmed_analog_combo",
890 "DualShock Analog Mode Toggle Key Combo",
892 "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.",
896 { "disabled", NULL },
897 { "l1+r1+select", "L1 + R1 + Select" },
898 { "l1+r1+start", "L1 + R1 + Start" },
899 { "l1+r1+l3", "L1 + R1 + L3" },
900 { "l1+r1+r3", "L1 + R1 + R3" },
901 { "l3+r3", "L3 + R3" },
907 "pcsx_rearmed_multitap",
910 "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.",
914 { "disabled", NULL },
915 { "port 1", "Port 1" },
916 { "port 2", "Port 2" },
917 { "ports 1 and 2", "Ports 1 and 2" },
923 "pcsx_rearmed_negcon_deadzone",
924 "NegCon Twist Deadzone",
926 "Set the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
948 "pcsx_rearmed_negcon_response",
949 "NegCon Twist Response",
951 "Specify the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
955 { "linear", "Linear" },
956 { "quadratic", "Quadratic" },
957 { "cubic", "Cubic" },
963 "pcsx_rearmed_input_sensitivity",
966 "Adjust responsiveness of emulated 'mouse' input devices.",
1014 "pcsx_rearmed_crosshair1",
1015 "Player 1 Lightgun Crosshair",
1017 "Toggle player 1's crosshair for the Guncon or Konami Gun",
1021 { "disabled", NULL },
1031 "pcsx_rearmed_crosshair2",
1032 "Player 2 Lightgun Crosshair",
1034 "Toggle player 2's crosshair for the Guncon or Konami Gun",
1038 { "disabled", NULL },
1048 "pcsx_rearmed_konamigunadjustx",
1049 "Konami Gun X Axis Offset",
1051 "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.",
1141 "pcsx_rearmed_konamigunadjusty",
1142 "Konami Gun Y Axis Offset",
1144 "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.",
1234 "pcsx_rearmed_gunconadjustx",
1235 "Guncon X Axis Offset",
1237 "Apply an X axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1327 "pcsx_rearmed_gunconadjusty",
1328 "Guncon Y Axis Offset",
1330 "Apply a Y axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1420 "pcsx_rearmed_gunconadjustratiox",
1421 "Guncon X Axis Response",
1423 "Adjust relative magnitude of horizontal light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1483 "pcsx_rearmed_gunconadjustratioy",
1484 "Guncon Y Axis Response",
1486 "Adjust relative magnitude of vertical light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1546 "pcsx_rearmed_icache_emulation",
1547 "Instruction Cache Emulation",
1549 "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]",
1553 { "enabled", NULL },
1554 { "disabled", NULL },
1560 "pcsx_rearmed_exception_emulation",
1561 "Exception and Breakpoint Emulation",
1563 "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]",
1567 { "disabled", NULL },
1568 { "enabled", NULL },
1574 "pcsx_rearmed_cd_turbo",
1577 "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.",
1581 { "disabled", NULL },
1582 { "enabled", NULL },
1587 #if !defined(DRC_DISABLE) && !defined(LIGHTREC)
1589 "pcsx_rearmed_nocompathacks",
1590 "Disable Automatic Compatibility Hacks",
1592 "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.",
1596 { "disabled", NULL },
1597 { "enabled", NULL },
1603 "pcsx_rearmed_nosmccheck",
1604 "(Speed Hack) Disable SMC Checks",
1605 "Disable SMC Checks",
1606 "Will cause crashes when loading, and lead to memory card failure.",
1610 { "disabled", NULL },
1611 { "enabled", NULL },
1617 "pcsx_rearmed_gteregsunneeded",
1618 "(Speed Hack) Assume GTE Registers Unneeded",
1619 "Assume GTE Registers Unneeded",
1620 "May cause rendering errors.",
1624 { "disabled", NULL },
1625 { "enabled", NULL },
1631 "pcsx_rearmed_nogteflags",
1632 "(Speed Hack) Disable GTE Flags",
1633 "Disable GTE Flags",
1634 "Will cause rendering errors.",
1638 { "disabled", NULL },
1639 { "enabled", NULL },
1644 #endif /* !DRC_DISABLE && !LIGHTREC */
1646 "pcsx_rearmed_nostalls",
1647 "Disable CPU/GTE Stalls",
1649 "Will cause some games to run too quickly. Should be disabled in almost all cases."
1650 #if defined(LIGHTREC)
1651 " Interpreter only."
1657 { "disabled", NULL },
1658 { "enabled", NULL },
1663 { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
1666 struct retro_core_options_v2 options_us = {
1672 ********************************
1674 ********************************
1677 #ifndef HAVE_NO_LANGEXTRA
1678 struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
1679 &options_us, /* RETRO_LANGUAGE_ENGLISH */
1680 NULL, /* RETRO_LANGUAGE_JAPANESE */
1681 NULL, /* RETRO_LANGUAGE_FRENCH */
1682 NULL, /* RETRO_LANGUAGE_SPANISH */
1683 NULL, /* RETRO_LANGUAGE_GERMAN */
1684 NULL, /* RETRO_LANGUAGE_ITALIAN */
1685 NULL, /* RETRO_LANGUAGE_DUTCH */
1686 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1687 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1688 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1689 NULL, /* RETRO_LANGUAGE_KOREAN */
1690 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1691 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1692 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1693 NULL, /* RETRO_LANGUAGE_POLISH */
1694 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1695 NULL, /* RETRO_LANGUAGE_ARABIC */
1696 NULL, /* RETRO_LANGUAGE_GREEK */
1697 &options_tr, /* RETRO_LANGUAGE_TURKISH */
1702 ********************************
1704 ********************************
1707 /* Handles configuration/setting of core options.
1708 * Should be called as early as possible - ideally inside
1709 * retro_set_environment(), and no later than retro_load_game()
1710 * > We place the function body in the header to avoid the
1711 * necessity of adding more .c files (i.e. want this to
1712 * be as painless as possible for core devs)
1715 static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
1716 bool *categories_supported)
1718 unsigned version = 0;
1719 #ifndef HAVE_NO_LANGEXTRA
1720 unsigned language = 0;
1723 if (!environ_cb || !categories_supported)
1726 *categories_supported = false;
1728 if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
1733 #ifndef HAVE_NO_LANGEXTRA
1734 struct retro_core_options_v2_intl core_options_intl;
1736 core_options_intl.us = &options_us;
1737 core_options_intl.local = NULL;
1739 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1740 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1741 core_options_intl.local = options_intl[language];
1743 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
1744 &core_options_intl);
1746 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
1753 size_t option_index = 0;
1754 size_t num_options = 0;
1755 struct retro_core_option_definition
1756 *option_v1_defs_us = NULL;
1757 #ifndef HAVE_NO_LANGEXTRA
1758 size_t num_options_intl = 0;
1759 struct retro_core_option_v2_definition
1760 *option_defs_intl = NULL;
1761 struct retro_core_option_definition
1762 *option_v1_defs_intl = NULL;
1763 struct retro_core_options_intl
1764 core_options_v1_intl;
1766 struct retro_variable *variables = NULL;
1767 char **values_buf = NULL;
1769 /* Determine total number of options */
1772 if (option_defs_us[num_options].key)
1780 /* Allocate US array */
1781 option_v1_defs_us = (struct retro_core_option_definition *)
1782 calloc(num_options + 1, sizeof(struct retro_core_option_definition));
1784 /* Copy parameters from option_defs_us array */
1785 for (i = 0; i < num_options; i++)
1787 struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
1788 struct retro_core_option_value *option_values = option_def_us->values;
1789 struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
1790 struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
1792 option_v1_def_us->key = option_def_us->key;
1793 option_v1_def_us->desc = option_def_us->desc;
1794 option_v1_def_us->info = option_def_us->info;
1795 option_v1_def_us->default_value = option_def_us->default_value;
1797 /* Values must be copied individually... */
1798 while (option_values->value)
1800 option_v1_values->value = option_values->value;
1801 option_v1_values->label = option_values->label;
1808 #ifndef HAVE_NO_LANGEXTRA
1809 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1810 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
1811 options_intl[language])
1812 option_defs_intl = options_intl[language]->definitions;
1814 if (option_defs_intl)
1816 /* Determine number of intl options */
1819 if (option_defs_intl[num_options_intl].key)
1825 /* Allocate intl array */
1826 option_v1_defs_intl = (struct retro_core_option_definition *)
1827 calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
1829 /* Copy parameters from option_defs_intl array */
1830 for (i = 0; i < num_options_intl; i++)
1832 struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
1833 struct retro_core_option_value *option_values = option_def_intl->values;
1834 struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
1835 struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
1837 option_v1_def_intl->key = option_def_intl->key;
1838 option_v1_def_intl->desc = option_def_intl->desc;
1839 option_v1_def_intl->info = option_def_intl->info;
1840 option_v1_def_intl->default_value = option_def_intl->default_value;
1842 /* Values must be copied individually... */
1843 while (option_values->value)
1845 option_v1_values->value = option_values->value;
1846 option_v1_values->label = option_values->label;
1854 core_options_v1_intl.us = option_v1_defs_us;
1855 core_options_v1_intl.local = option_v1_defs_intl;
1857 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
1859 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
1864 /* Allocate arrays */
1865 variables = (struct retro_variable *)calloc(num_options + 1,
1866 sizeof(struct retro_variable));
1867 values_buf = (char **)calloc(num_options, sizeof(char *));
1869 if (!variables || !values_buf)
1872 /* Copy parameters from option_defs_us array */
1873 for (i = 0; i < num_options; i++)
1875 const char *key = option_defs_us[i].key;
1876 const char *desc = option_defs_us[i].desc;
1877 const char *default_value = option_defs_us[i].default_value;
1878 struct retro_core_option_value *values = option_defs_us[i].values;
1880 size_t default_index = 0;
1882 values_buf[i] = NULL;
1884 /* Skip options that are irrelevant when using the
1885 * old style core options interface */
1886 if ((strcmp(key, "pcsx_rearmed_show_input_settings") == 0) ||
1887 (strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0) ||
1888 (strcmp(key, "pcsx_rearmed_show_gpu_unai_settings") == 0))
1893 size_t num_values = 0;
1895 /* Determine number of values */
1898 if (values[num_values].value)
1900 /* Check if this is the default value */
1902 if (strcmp(values[num_values].value, default_value) == 0)
1903 default_index = num_values;
1905 buf_len += strlen(values[num_values].value);
1912 /* Build values string */
1915 buf_len += num_values - 1;
1916 buf_len += strlen(desc);
1918 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1922 strcpy(values_buf[i], desc);
1923 strcat(values_buf[i], "; ");
1925 /* Default value goes first */
1926 strcat(values_buf[i], values[default_index].value);
1928 /* Add remaining values */
1929 for (j = 0; j < num_values; j++)
1931 if (j != default_index)
1933 strcat(values_buf[i], "|");
1934 strcat(values_buf[i], values[j].value);
1940 variables[option_index].key = key;
1941 variables[option_index].value = values_buf[i];
1946 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1952 if (option_v1_defs_us)
1954 free(option_v1_defs_us);
1955 option_v1_defs_us = NULL;
1958 #ifndef HAVE_NO_LANGEXTRA
1959 if (option_v1_defs_intl)
1961 free(option_v1_defs_intl);
1962 option_v1_defs_intl = NULL;
1968 for (i = 0; i < num_options; i++)
1972 free(values_buf[i]);
1973 values_buf[i] = NULL;