Support compiling without pthreads
[pcsx_rearmed.git] / frontend / libretro_core_options.h
CommitLineData
7a8d521f 1#ifndef LIBRETRO_CORE_OPTIONS_H__
2#define LIBRETRO_CORE_OPTIONS_H__
3
4#include <stdlib.h>
5#include <string.h>
6
7#include <libretro.h>
8#include <retro_inline.h>
9
10#ifndef HAVE_NO_LANGEXTRA
11#include "libretro_core_options_intl.h"
12#endif
13
14/*
15 ********************************
16 * VERSION: 2.0
17 ********************************
18 *
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
30 * - 1.0: First commit
31*/
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*
38 ********************************
39 * Core Option Definitions
40 ********************************
41*/
42
43/* RETRO_LANGUAGE_ENGLISH */
44
45/* Default language:
46 * - All other languages must include the same keys and values
47 * - Will be used as a fallback in the event that frontend language
48 * is not available
49 * - Will be used as a fallback for any missing entries in
50 * frontend language definition
51 */
52
53struct retro_core_option_v2_category option_cats_us[] = {
54 {
55 "system",
56 "System",
57 "Configure base hardware parameters: region, BIOS selection, memory cards, etc."
58 },
59 {
60 "video",
61 "Video",
62 "Configure base display parameters."
63 },
64#ifdef GPU_NEON
65 {
66 "gpu_neon",
67 "GPU Plugin",
68 "Configure low-level settings of the NEON GPU plugin."
69 },
70#endif
71#ifdef GPU_PEOPS
72 {
73 "gpu_peops",
74 "GPU Plugin (Advanced)",
75 "Configure low-level settings of the P.E.Op.S. GPU plugin."
76 },
77#endif
78#ifdef GPU_UNAI
79 {
80 "gpu_unai",
81 "GPU Plugin (Advanced)",
82 "Configure low-level settings of the UNAI GPU plugin."
83 },
84#endif
85 {
86 "audio",
87 "Audio",
88 "Configure sound emulation: reverb, interpolation, CD audio decoding."
89 },
90 {
91 "input",
92 "Input",
93 "Configure input devices: analog response, haptic feedback, Multitaps, light guns, etc."
94 },
95 {
96 "compat_hack",
97 "Compatibility Fixes",
98 "Configure settings/workarounds required for correct operation of specific games."
99 },
100#if !defined(DRC_DISABLE) && !defined(LIGHTREC)
101 {
102 "speed_hack",
103 "Speed Hacks (Advanced)",
104 "Configure hacks that may improve performance at the expense of decreased accuracy/stability."
105 },
106#endif
107 { NULL, NULL, NULL },
108};
109
110struct retro_core_option_v2_definition option_defs_us[] = {
111 {
112 "pcsx_rearmed_region",
113 "Region",
114 NULL,
115 "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.",
116 NULL,
117 "system",
118 {
119 { "auto", "Auto" },
120 { "NTSC", NULL },
121 { "PAL", NULL },
122 { NULL, NULL },
123 },
124 "auto",
125 },
126 {
127 "pcsx_rearmed_bios",
128 "BIOS Selection",
129 NULL,
130 "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.",
131 NULL,
132 "system",
133 {
134 { "auto", "Auto" },
135 { "HLE", NULL },
136 { NULL, NULL },
137 },
138 "auto",
139 },
140 {
141 "pcsx_rearmed_show_bios_bootlogo",
142 "Show BIOS Boot Logo",
143 NULL,
144 "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.",
145 NULL,
146 "system",
147 {
148 { "disabled", NULL },
149 { "enabled", NULL },
150 { NULL, NULL },
151 },
152 "disabled",
153 },
154 {
155 "pcsx_rearmed_memcard2",
156 "Enable Second Memory Card (Shared)",
157 NULL,
158 "Emulate a second memory card in slot 2. This will be shared by all games.",
159 NULL,
160 "system",
161 {
162 { "disabled", NULL },
163 { "enabled", NULL },
164 { NULL, NULL },
165 },
166 "disabled",
167 },
168#ifndef _WIN32
169 {
170 "pcsx_rearmed_async_cd",
171 "CD Access Method (Restart)",
172 NULL,
173 "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).",
174 NULL,
175 "system",
176 {
177 { "sync", "Synchronous" },
178 { "async", "Asynchronous" },
179 { "precache", "Pre-Cache (CHD)" },
180 { NULL, NULL},
181 },
182 "sync",
183 },
184#endif
185#ifndef DRC_DISABLE
186 {
187 "pcsx_rearmed_drc",
188 "Dynamic Recompiler",
189 NULL,
190 "Dynamically recompile PSX CPU instructions to native instructions. Much faster than using an interpreter, but may be less accurate on some platforms.",
191 NULL,
192 "system",
193 {
194 { "disabled", NULL },
195 { "enabled", NULL },
196 { NULL, NULL },
197 },
198 "enabled",
199 },
200#endif
201 {
202 "pcsx_rearmed_psxclock",
203 "PSX CPU Clock Speed",
204 NULL,
205 "Overclock or under-clock the PSX CPU. Try adjusting this if the game is too slow, too fast or hangs."
7a8d521f 206#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
207 " Default is 50."
208#else
209 " Default is 57."
210#endif
211 ,
212 NULL,
213 "system",
214 {
215 { "30", NULL },
216 { "31", NULL },
217 { "32", NULL },
218 { "33", NULL },
219 { "34", NULL },
220 { "35", NULL },
221 { "36", NULL },
222 { "37", NULL },
223 { "38", NULL },
224 { "39", NULL },
225 { "40", NULL },
226 { "41", NULL },
227 { "42", NULL },
228 { "43", NULL },
229 { "44", NULL },
230 { "45", NULL },
231 { "46", NULL },
232 { "47", NULL },
233 { "48", NULL },
234 { "49", NULL },
235 { "50", NULL },
236 { "51", NULL },
237 { "52", NULL },
238 { "53", NULL },
239 { "54", NULL },
240 { "55", NULL },
241 { "56", NULL },
242 { "57", NULL },
243 { "58", NULL },
244 { "59", NULL },
245 { "60", NULL },
246 { "61", NULL },
247 { "62", NULL },
248 { "63", NULL },
249 { "64", NULL },
250 { "65", NULL },
251 { "66", NULL },
252 { "67", NULL },
253 { "68", NULL },
254 { "69", NULL },
255 { "70", NULL },
256 { "71", NULL },
257 { "72", NULL },
258 { "73", NULL },
259 { "74", NULL },
260 { "75", NULL },
261 { "76", NULL },
262 { "77", NULL },
263 { "78", NULL },
264 { "79", NULL },
265 { "80", NULL },
266 { "81", NULL },
267 { "82", NULL },
268 { "83", NULL },
269 { "84", NULL },
270 { "85", NULL },
271 { "86", NULL },
272 { "87", NULL },
273 { "88", NULL },
274 { "89", NULL },
275 { "90", NULL },
276 { "91", NULL },
277 { "92", NULL },
278 { "93", NULL },
279 { "94", NULL },
280 { "95", NULL },
281 { "96", NULL },
282 { "97", NULL },
283 { "98", NULL },
284 { "99", NULL },
285 { "100", NULL },
286 { NULL, NULL },
287 },
288#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
289 "50",
290#else
291 "57",
292#endif
293 },
294 {
295 "pcsx_rearmed_dithering",
296 "Dithering Pattern",
297 NULL,
298 "Enable emulation of the dithering technique used by the PSX to smooth out color banding artifacts. Increases performance requirements.",
299 NULL,
300 "video",
301 {
302 { "disabled", NULL },
303 { "enabled", NULL },
304 { NULL, NULL },
305 },
306#if defined HAVE_LIBNX || defined _3DS
307 "disabled",
308#else
309 "enabled",
310#endif
311 },
312 {
313 "pcsx_rearmed_duping_enable",
314 "Frame Duping (Speedup)",
315 NULL,
316 "When enabled and supported by the libretro frontend, provides a small performance increase by directing the frontend to repeat the previous frame if the core has nothing new to display.",
317 NULL,
318 "video",
319 {
320 { "disabled", NULL },
321 { "enabled", NULL },
322 { NULL, NULL },
323 },
324 "enabled",
325 },
326#ifdef THREAD_RENDERING
327 {
328 "pcsx_rearmed_gpu_thread_rendering",
329 "Threaded Rendering",
330 NULL,
331 "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.",
332 NULL,
333 "video",
334 {
335 { "disabled", NULL },
336 { "sync", "Synchronous" },
337 { "async", "Asynchronous" },
338 { NULL, NULL},
339 },
340 "disabled",
341 },
342#endif
343 {
344 "pcsx_rearmed_frameskip_type",
345 "Frameskip",
346 NULL,
347 "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.",
348 NULL,
349 "video",
350 {
351 { "disabled", NULL },
352 { "auto", "Auto" },
353 { "auto_threshold", "Auto (Threshold)" },
354 { "fixed_interval", "Fixed Interval" },
355 { NULL, NULL },
356 },
357 "disabled"
358 },
359 {
360 "pcsx_rearmed_frameskip_threshold",
361 "Frameskip Threshold (%)",
362 NULL,
363 "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.",
364 NULL,
365 "video",
366 {
367 { "15", NULL },
368 { "18", NULL },
369 { "21", NULL },
370 { "24", NULL },
371 { "27", NULL },
372 { "30", NULL },
373 { "33", NULL },
374 { "36", NULL },
375 { "39", NULL },
376 { "42", NULL },
377 { "45", NULL },
378 { "48", NULL },
379 { "51", NULL },
380 { "54", NULL },
381 { "57", NULL },
382 { "60", NULL },
383 { NULL, NULL },
384 },
385 "33"
386 },
387 {
388 "pcsx_rearmed_frameskip_interval",
389 "Frameskip Interval",
390 NULL,
391 "Specify the maximum number of frames that can be skipped before a new frame is rendered.",
392 NULL,
393 "video",
394 {
395 { "1", NULL },
396 { "2", NULL },
397 { "3", NULL },
398 { "4", NULL },
399 { "5", NULL },
400 { "6", NULL },
401 { "7", NULL },
402 { "8", NULL },
403 { "9", NULL },
404 { "10", NULL },
405 { NULL, NULL },
406 },
407 "3"
408 },
409 {
410 "pcsx_rearmed_display_internal_fps",
411 "Display Internal FPS",
412 NULL,
413 "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.",
414 NULL,
415 "video",
416 {
417 { "disabled", NULL },
418 { "enabled", NULL },
419 { NULL, NULL },
420 },
421 "disabled",
422 },
8c84ba5f 423 {
424 "pcsx_rearmed_gpu_slow_llists",
425 "(GPU) Slow linked list processing",
426 NULL,
427 "Slower but more accurate GPU linked list processing. Needed by only a few games like Vampire Hunter D. Should be autodetected in most cases.",
428 NULL,
429 "video",
430 {
431 { "auto", NULL },
432 { "disabled", NULL },
433 { "enabled", NULL },
434 { NULL, NULL },
435 },
436 "auto",
437 },
7a8d521f 438#ifdef GPU_NEON
439 {
fdcde643 440 "pcsx_rearmed_neon_interlace_enable_v2",
7a8d521f 441 "(GPU) Show Interlaced Video",
442 "Show Interlaced Video",
fdcde643 443 "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.",
7a8d521f 444 NULL,
445 "gpu_neon",
446 {
fdcde643 447 { "auto", NULL },
7a8d521f 448 { "disabled", NULL },
449 { "enabled", NULL },
450 { NULL, NULL },
451 },
fdcde643 452 "auto",
7a8d521f 453 },
454 {
455 "pcsx_rearmed_neon_enhancement_enable",
6777e331 456 "(GPU) Enhanced Resolution",
457 "Enhanced Resolution",
7a8d521f 458 "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.",
459 NULL,
460 "gpu_neon",
461 {
462 { "disabled", NULL },
463 { "enabled", NULL },
464 { NULL, NULL },
465 },
466 "disabled",
467 },
468 {
469 "pcsx_rearmed_neon_enhancement_no_main",
470 "(GPU) Enhanced Resolution Speed Hack",
471 "Enhanced Resolution Speed Hack",
6777e331 472 "Improves performance when 'Enhanced Resolution' is enabled, but reduces compatibility and may cause rendering errors.",
7a8d521f 473 NULL,
474 "gpu_neon",
475 {
476 { "disabled", NULL },
477 { "enabled", NULL },
478 { NULL, NULL },
479 },
480 "disabled",
481 },
482#endif /* GPU_NEON */
483#ifdef GPU_PEOPS
484 {
485 "pcsx_rearmed_show_gpu_peops_settings",
486 "Show Advanced P.E.Op.S. GPU Settings",
487 NULL,
488 "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.",
489 NULL,
490 NULL,
491 {
492 { "disabled", NULL },
493 { "enabled", NULL },
494 { NULL, NULL },
495 },
496 "disabled",
497 },
498 {
499 "pcsx_rearmed_gpu_peops_odd_even_bit",
500 "(GPU) Odd/Even Bit Hack",
501 "Odd/Even Bit Hack",
502 "A hack fix used to correct lock-ups that may occur in games such as Chrono Cross. Disable unless required.",
503 NULL,
504 "gpu_peops",
505 {
506 { "disabled", NULL },
507 { "enabled", NULL },
508 { NULL, NULL },
509 },
510 "disabled",
511 },
512 {
513 "pcsx_rearmed_gpu_peops_expand_screen_width",
514 "(GPU) Expand Screen Width",
515 "Expand Screen Width",
516 "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.",
517 NULL,
518 "gpu_peops",
519 {
520 { "disabled", NULL },
521 { "enabled", NULL },
522 { NULL, NULL },
523 },
524 "disabled",
525 },
526 {
527 "pcsx_rearmed_gpu_peops_ignore_brightness",
528 "(GPU) Ignore Brightness Color",
529 "Ignore Brightness Color",
530 "A hack fix used to repair black screens in Lunar Silver Star Story Complete when entering a house or a menu. Disable unless required.",
531 NULL,
532 "gpu_peops",
533 {
534 { "disabled", NULL },
535 { "enabled", NULL },
536 { NULL, NULL },
537 },
538 "disabled",
539 },
540 {
541 "pcsx_rearmed_gpu_peops_disable_coord_check",
542 "(GPU) Disable Coordinate Check",
543 "Disable Coordinate Check",
544 "Legacy compatibility mode. May improve games that fail to run correctly on newer GPU hardware. Disable unless required.",
545 NULL,
546 "gpu_peops",
547 {
548 { "disabled", NULL },
549 { "enabled", NULL },
550 { NULL, NULL },
551 },
552 "disabled",
553 },
554 {
555 "pcsx_rearmed_gpu_peops_lazy_screen_update",
556 "(GPU) Lazy Screen Update",
557 "Lazy Screen Update",
558 "A partial fix to prevent text box flickering in Dragon Warrior VII. May also improve Pandemonium 2. Disable unless required.",
559 NULL,
560 "gpu_peops",
561 {
562 { "disabled", NULL },
563 { "enabled", NULL },
564 { NULL, NULL },
565 },
566 "disabled",
567 },
568 {
569 "pcsx_rearmed_gpu_peops_repeated_triangles",
570 "(GPU) Repeat Flat Tex Triangles",
571 "Repeat Flat Tex Triangles",
572 "A hack fix used to correct rendering errors in Star Wars: Dark Forces. Disable unless required.",
573 NULL,
574 "gpu_peops",
575 {
576 { "disabled", NULL },
577 { "enabled", NULL },
578 { NULL, NULL },
579 },
580 "disabled",
581 },
582 {
583 "pcsx_rearmed_gpu_peops_quads_with_triangles",
584 "(GPU) Draw Tex-Quads as Triangles",
585 "Draw Tex-Quads as Triangles",
586 "Corrects graphical distortions that may occur when games utilize Gouraud Shading, at the expense of reduced texture quality. Disable unless required.",
587 NULL,
588 "gpu_peops",
589 {
590 { "disabled", NULL },
591 { "enabled", NULL },
592 { NULL, NULL },
593 },
594 "disabled",
595 },
596 {
597 "pcsx_rearmed_gpu_peops_fake_busy_state",
598 "(GPU) Fake 'GPU Busy' States",
599 "Fake 'GPU Busy' States",
600 "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.",
601 NULL,
602 "gpu_peops",
603 {
604 { "disabled", NULL },
605 { "enabled", NULL },
606 { NULL, NULL },
607 },
608 "disabled",
609 },
610#endif /* GPU_PEOPS */
611#ifdef GPU_UNAI
612 {
613 "pcsx_rearmed_show_gpu_unai_settings",
614 "Show Advanced UNAI GPU Settings",
615 NULL,
616 "Show low-level configuration options for the UNAI GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
617 NULL,
618 NULL,
619 {
620 { "disabled", NULL },
621 { "enabled", NULL },
622 { NULL, NULL},
623 },
624 "disabled",
625 },
626 {
627 "pcsx_rearmed_gpu_unai_blending",
628 "(GPU) Texture Blending",
629 "Texture Blending",
630 "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.",
631 NULL,
632 "gpu_unai",
633 {
634 { "disabled", NULL },
635 { "enabled", NULL },
636 { NULL, NULL},
637 },
638 "enabled",
639 },
640 {
641 "pcsx_rearmed_gpu_unai_lighting",
642 "(GPU) Lighting Effects",
643 "Lighting Effects",
644 "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.).",
645 NULL,
646 "gpu_unai",
647 {
648 { "disabled", NULL },
649 { "enabled", NULL },
650 { NULL, NULL},
651 },
652 "enabled",
653 },
654 {
655 "pcsx_rearmed_gpu_unai_fast_lighting",
656 "(GPU) Fast Lighting",
657 "Fast Lighting",
658 "Improves performance when 'Lighting Effects' are enabled, but may cause moderate/severe rendering errors.",
659 NULL,
660 "gpu_unai",
661 {
662 { "disabled", NULL },
663 { "enabled", NULL },
664 { NULL, NULL},
665 },
666 "disabled",
667 },
668 {
669 "pcsx_rearmed_gpu_unai_scale_hires",
670 "(GPU) Hi-Res Downscaling",
671 "Hi-Res Downscaling",
672 "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.",
673 NULL,
674 "gpu_unai",
675 {
676 { "disabled", NULL },
677 { "enabled", NULL },
678 { NULL, NULL},
679 },
680#ifdef _MIYOO
681 "enabled",
682#else
683 "disabled",
684#endif
685 },
686#endif /* GPU_UNAI */
687 {
688 "pcsx_rearmed_spu_reverb",
689 "Audio Reverb Effects",
690 "Reverb Effects",
691 "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.",
692 NULL,
693 "audio",
694 {
695 { "disabled", NULL },
696 { "enabled", NULL },
697 { NULL, NULL },
698 },
699#ifdef HAVE_PRE_ARMV7
700 "disabled",
701#else
702 "enabled",
703#endif
704 },
705 {
706 "pcsx_rearmed_spu_interpolation",
707 "Sound Interpolation",
708 NULL,
709 "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.",
710 NULL,
711 "audio",
712 {
713 { "simple", "Simple" },
714 { "gaussian", "Gaussian" },
715 { "cubic", "Cubic" },
716 { "off", "disabled" },
717 { NULL, NULL },
718 },
719#ifdef HAVE_PRE_ARMV7
720 "off",
721#else
722 "simple",
723#endif
724 },
725 {
726 "pcsx_rearmed_nocdaudio",
727 "CD Audio",
728 NULL,
729 "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.",
730 NULL,
731 "audio",
732 {
733 { "disabled", NULL },
734 { "enabled", NULL },
735 { NULL, NULL },
736 },
737 "enabled",
738 },
739 {
740 "pcsx_rearmed_noxadecoding",
741 "XA Decoding",
742 NULL,
743 "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.",
744 NULL,
745 "audio",
746 {
747 { "disabled", NULL },
748 { "enabled", NULL },
749 { NULL, NULL },
750 },
751 "enabled",
752 },
f28d12a7 753#if HAVE_PTHREAD
16809ab9 754 {
755 "pcsx_rearmed_spu_thread",
756 "Threaded SPU",
757 NULL,
758 "Emulates the PSX SPU on another CPU thread. May cause audio glitches in some games.",
759 NULL,
760 "audio",
761 {
762 { "disabled", NULL },
763 { "enabled", NULL },
764 { NULL, NULL },
765 },
766 "disabled",
767 },
f28d12a7 768#endif // HAVE_PTHREAD
7a8d521f 769 {
770 "pcsx_rearmed_show_input_settings",
771 "Show Input Settings",
772 NULL,
773 "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.",
774 NULL,
775 NULL,
776 {
777 { "disabled", NULL },
778 { "enabled", NULL },
779 { NULL, NULL },
780 },
781 "disabled",
782 },
783 {
784 "pcsx_rearmed_analog_axis_modifier",
785 "Analog Axis Bounds",
786 NULL,
787 "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.",
788 NULL,
789 "input",
790 {
791 { "circle", "Circle" },
792 { "square", "Square" },
793 { NULL, NULL },
794 },
795 "circle",
796 },
797 {
798 "pcsx_rearmed_vibration",
799 "Rumble Effects",
800 NULL,
801 "Enable haptic feedback when using a rumble-equipped gamepad with input device set to 'dualshock'.",
802 NULL,
803 "input",
804 {
805 { "disabled", NULL },
806 { "enabled", NULL },
807 { NULL, NULL },
808 },
809 "enabled",
810 },
811 {
812 "pcsx_rearmed_multitap",
813 "Multitap Mode (Restart)",
814 NULL,
815 "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. To avoid input defects, option should be disabled when running games that have no support for Multitap features.",
816 NULL,
817 "input",
818 {
819 { "disabled", NULL },
820 { "port 1", "Port 1" },
821 { "port 2", "Port 2" },
822 { "ports 1 and 2", "Ports 1 and 2" },
823 { NULL, NULL },
824 },
825 "disabled",
826 },
827 {
828 "pcsx_rearmed_negcon_deadzone",
829 "NegCon Twist Deadzone",
830 NULL,
831 "Set the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
832 NULL,
833 "input",
834 {
835 { "0", "0%" },
836 { "3", "3%" },
837 { "5", "5%" },
838 { "7", "7%" },
839 { "10", "10%" },
840 { "13", "13%" },
841 { "15", "15%" },
842 { "17", "17%" },
843 { "20", "20%" },
844 { "23", "23%" },
845 { "25", "25%" },
846 { "27", "27%" },
847 { "30", "30%" },
848 { NULL, NULL },
849 },
850 "0",
851 },
852 {
853 "pcsx_rearmed_negcon_response",
854 "NegCon Twist Response",
855 NULL,
856 "Specify the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
857 NULL,
858 "input",
859 {
860 { "linear", "Linear" },
861 { "quadratic", "Quadratic" },
862 { "cubic", "Cubic" },
863 { NULL, NULL },
864 },
865 "linear",
866 },
867 {
868 "pcsx_rearmed_input_sensitivity",
869 "Mouse Sensitivity",
870 NULL,
871 "Adjust responsiveness of emulated 'mouse' input devices.",
872 NULL,
873 "input",
874 {
875 { "0.05", NULL },
876 { "0.10", NULL },
877 { "0.15", NULL },
878 { "0.20", NULL },
879 { "0.25", NULL },
880 { "0.30", NULL },
881 { "0.35", NULL },
882 { "0.40", NULL },
883 { "0.45", NULL },
884 { "0.50", NULL },
885 { "0.55", NULL },
886 { "0.60", NULL },
887 { "0.65", NULL },
888 { "0.70", NULL },
889 { "0.75", NULL },
890 { "0.80", NULL },
891 { "0.85", NULL },
892 { "0.90", NULL },
893 { "0.95", NULL },
894 { "1.00", NULL },
895 { "1.05", NULL },
896 { "1.10", NULL },
897 { "1.15", NULL },
898 { "1.20", NULL },
899 { "1.25", NULL },
900 { "1.30", NULL },
901 { "1.35", NULL },
902 { "1.40", NULL },
903 { "1.45", NULL },
904 { "1.50", NULL },
905 { "1.55", NULL },
906 { "1.60", NULL },
907 { "1.65", NULL },
908 { "1.70", NULL },
909 { "1.75", NULL },
910 { "1.80", NULL },
911 { "1.85", NULL },
912 { "1.90", NULL },
913 { "1.95", NULL },
914 { "2.00", NULL },
915 },
916 "1.00",
917 },
918 {
919 "pcsx_rearmed_gunconadjustx",
920 "Guncon X Axis Offset",
921 NULL,
922 "Apply an X axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
923 NULL,
924 "input",
925 {
926 { "-25", NULL },
927 { "-24", NULL },
928 { "-23", NULL },
929 { "-22", NULL },
930 { "-21", NULL },
931 { "-20", NULL },
932 { "-19", NULL },
933 { "-18", NULL },
934 { "-17", NULL },
935 { "-16", NULL },
936 { "-15", NULL },
937 { "-14", NULL },
938 { "-13", NULL },
939 { "-12", NULL },
940 { "-11", NULL },
941 { "-10", NULL },
942 { "-9", NULL },
943 { "-8", NULL },
944 { "-7", NULL },
945 { "-6", NULL },
946 { "-5", NULL },
947 { "-4", NULL },
948 { "-3", NULL },
949 { "-2", NULL },
950 { "-1", NULL },
951 { "0", NULL },
952 { "1", NULL },
953 { "2", NULL },
954 { "3", NULL },
955 { "4", NULL },
956 { "5", NULL },
957 { "6", NULL },
958 { "7", NULL },
959 { "8", NULL },
960 { "9", NULL },
961 { "10", NULL },
962 { "11", NULL },
963 { "12", NULL },
964 { "13", NULL },
965 { "14", NULL },
966 { "15", NULL },
967 { "16", NULL },
968 { "17", NULL },
969 { "18", NULL },
970 { "19", NULL },
971 { "20", NULL },
972 { "21", NULL },
973 { "22", NULL },
974 { "23", NULL },
975 { "24", NULL },
976 { "25", NULL },
977 { NULL, NULL },
978 },
979 "0",
980 },
981 {
982 "pcsx_rearmed_gunconadjusty",
983 "Guncon Y Axis Offset",
984 NULL,
985 "Apply a Y axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
986 NULL,
987 "input",
988 {
989 { "-25", NULL },
990 { "-24", NULL },
991 { "-23", NULL },
992 { "-22", NULL },
993 { "-21", NULL },
994 { "-20", NULL },
995 { "-19", NULL },
996 { "-18", NULL },
997 { "-17", NULL },
998 { "-16", NULL },
999 { "-15", NULL },
1000 { "-14", NULL },
1001 { "-13", NULL },
1002 { "-12", NULL },
1003 { "-11", NULL },
1004 { "-10", NULL },
1005 { "-9", NULL },
1006 { "-8", NULL },
1007 { "-7", NULL },
1008 { "-6", NULL },
1009 { "-5", NULL },
1010 { "-4", NULL },
1011 { "-3", NULL },
1012 { "-2", NULL },
1013 { "-1", NULL },
1014 { "0", NULL },
1015 { "1", NULL },
1016 { "2", NULL },
1017 { "3", NULL },
1018 { "4", NULL },
1019 { "5", NULL },
1020 { "6", NULL },
1021 { "7", NULL },
1022 { "8", NULL },
1023 { "9", NULL },
1024 { "10", NULL },
1025 { "11", NULL },
1026 { "12", NULL },
1027 { "13", NULL },
1028 { "14", NULL },
1029 { "15", NULL },
1030 { "16", NULL },
1031 { "17", NULL },
1032 { "18", NULL },
1033 { "19", NULL },
1034 { "20", NULL },
1035 { "21", NULL },
1036 { "22", NULL },
1037 { "23", NULL },
1038 { "24", NULL },
1039 { "25", NULL },
1040 { NULL, NULL },
1041 },
1042 "0",
1043 },
1044 {
1045 "pcsx_rearmed_gunconadjustratiox",
1046 "Guncon X Axis Response",
1047 NULL,
1048 "Adjust relative magnitude of horizontal light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1049 NULL,
1050 "input",
1051 {
1052 { "0.75", NULL },
1053 { "0.76", NULL },
1054 { "0.77", NULL },
1055 { "0.78", NULL },
1056 { "0.79", NULL },
1057 { "0.80", NULL },
1058 { "0.81", NULL },
1059 { "0.82", NULL },
1060 { "0.83", NULL },
1061 { "0.84", NULL },
1062 { "0.85", NULL },
1063 { "0.86", NULL },
1064 { "0.87", NULL },
1065 { "0.88", NULL },
1066 { "0.89", NULL },
1067 { "0.90", NULL },
1068 { "0.91", NULL },
1069 { "0.92", NULL },
1070 { "0.93", NULL },
1071 { "0.94", NULL },
1072 { "0.95", NULL },
1073 { "0.96", NULL },
1074 { "0.97", NULL },
1075 { "0.98", NULL },
1076 { "0.99", NULL },
1077 { "1.00", NULL },
1078 { "1.01", NULL },
1079 { "1.02", NULL },
1080 { "1.03", NULL },
1081 { "1.04", NULL },
1082 { "1.05", NULL },
1083 { "1.06", NULL },
1084 { "1.07", NULL },
1085 { "1.08", NULL },
1086 { "1.09", NULL },
1087 { "1.10", NULL },
1088 { "1.11", NULL },
1089 { "1.12", NULL },
1090 { "1.13", NULL },
1091 { "1.14", NULL },
1092 { "1.15", NULL },
1093 { "1.16", NULL },
1094 { "1.17", NULL },
1095 { "1.18", NULL },
1096 { "1.19", NULL },
1097 { "1.20", NULL },
1098 { "1.21", NULL },
1099 { "1.22", NULL },
1100 { "1.23", NULL },
1101 { "1.24", NULL },
1102 { "1.25", NULL },
1103 { NULL, NULL },
1104 },
1105 "1.00",
1106 },
1107 {
1108 "pcsx_rearmed_gunconadjustratioy",
1109 "Guncon Y Axis Response",
1110 NULL,
1111 "Adjust relative magnitude of vertical light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1112 NULL,
1113 "input",
1114 {
1115 { "0.75", NULL },
1116 { "0.76", NULL },
1117 { "0.77", NULL },
1118 { "0.78", NULL },
1119 { "0.79", NULL },
1120 { "0.80", NULL },
1121 { "0.81", NULL },
1122 { "0.82", NULL },
1123 { "0.83", NULL },
1124 { "0.84", NULL },
1125 { "0.85", NULL },
1126 { "0.86", NULL },
1127 { "0.87", NULL },
1128 { "0.88", NULL },
1129 { "0.89", NULL },
1130 { "0.90", NULL },
1131 { "0.91", NULL },
1132 { "0.92", NULL },
1133 { "0.93", NULL },
1134 { "0.94", NULL },
1135 { "0.95", NULL },
1136 { "0.96", NULL },
1137 { "0.97", NULL },
1138 { "0.98", NULL },
1139 { "0.99", NULL },
1140 { "1.00", NULL },
1141 { "1.01", NULL },
1142 { "1.02", NULL },
1143 { "1.03", NULL },
1144 { "1.04", NULL },
1145 { "1.05", NULL },
1146 { "1.06", NULL },
1147 { "1.07", NULL },
1148 { "1.08", NULL },
1149 { "1.09", NULL },
1150 { "1.10", NULL },
1151 { "1.11", NULL },
1152 { "1.12", NULL },
1153 { "1.13", NULL },
1154 { "1.14", NULL },
1155 { "1.15", NULL },
1156 { "1.16", NULL },
1157 { "1.17", NULL },
1158 { "1.18", NULL },
1159 { "1.19", NULL },
1160 { "1.20", NULL },
1161 { "1.21", NULL },
1162 { "1.22", NULL },
1163 { "1.23", NULL },
1164 { "1.24", NULL },
1165 { "1.25", NULL },
1166 { NULL, NULL },
1167 },
1168 "1.00",
1169 },
1170 {
1171 "pcsx_rearmed_icache_emulation",
1172 "Instruction Cache Emulation",
1173 NULL,
bc7c5acb 1174 "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]",
1175 NULL,
1176 "compat_hack",
1177 {
1178 { "enabled", NULL },
1179 { "disabled", NULL },
1180 { NULL, NULL },
1181 },
1182 "enabled",
1183 },
1184 {
1185 "pcsx_rearmed_exception_emulation",
1186 "Exception and Breakpoint Emulation",
1187 NULL,
1188 "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]",
7a8d521f 1189 NULL,
1190 "compat_hack",
1191 {
1192 { "disabled", NULL },
1193 { "enabled", NULL },
1194 { NULL, NULL },
1195 },
1196 "disabled",
1197 },
1198#if !defined(DRC_DISABLE) && !defined(LIGHTREC)
1199 {
1200 "pcsx_rearmed_nocompathacks",
1201 "Disable Automatic Compatibility Hacks",
1202 NULL,
1203 "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.",
1204 NULL,
1205 "compat_hack",
1206 {
1207 { "disabled", NULL },
1208 { "enabled", NULL },
1209 { NULL, NULL },
1210 },
1211 "disabled",
1212 },
1213 {
1214 "pcsx_rearmed_nosmccheck",
1215 "(Speed Hack) Disable SMC Checks",
1216 "Disable SMC Checks",
1217 "Will cause crashes when loading, and lead to memory card failure.",
1218 NULL,
1219 "speed_hack",
1220 {
1221 { "disabled", NULL },
1222 { "enabled", NULL },
1223 { NULL, NULL },
1224 },
1225 "disabled",
1226 },
1227 {
1228 "pcsx_rearmed_gteregsunneeded",
1229 "(Speed Hack) Assume GTE Registers Unneeded",
1230 "Assume GTE Registers Unneeded",
1231 "May cause rendering errors.",
1232 NULL,
1233 "speed_hack",
1234 {
1235 { "disabled", NULL },
1236 { "enabled", NULL },
1237 { NULL, NULL },
1238 },
1239 "disabled",
1240 },
1241 {
1242 "pcsx_rearmed_nogteflags",
1243 "(Speed Hack) Disable GTE Flags",
1244 "Disable GTE Flags",
1245 "Will cause rendering errors.",
1246 NULL,
1247 "speed_hack",
1248 {
1249 { "disabled", NULL },
1250 { "enabled", NULL },
1251 { NULL, NULL },
1252 },
1253 "disabled",
1254 },
1255 {
1256 "pcsx_rearmed_nostalls",
1257 "(Speed Hack) Disable CPU/GTE Stalls",
1258 "Disable CPU/GTE Stalls",
1259 "Will cause some games to run too quickly.",
1260 NULL,
1261 "speed_hack",
1262 {
1263 { "disabled", NULL },
1264 { "enabled", NULL },
1265 { NULL, NULL },
1266 },
1267 "disabled",
1268 },
1269#endif /* !DRC_DISABLE && !LIGHTREC */
1270 { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
1271};
1272
1273struct retro_core_options_v2 options_us = {
1274 option_cats_us,
1275 option_defs_us
1276};
1277
1278/*
1279 ********************************
1280 * Language Mapping
1281 ********************************
1282*/
1283
1284#ifndef HAVE_NO_LANGEXTRA
1285struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
1286 &options_us, /* RETRO_LANGUAGE_ENGLISH */
1287 NULL, /* RETRO_LANGUAGE_JAPANESE */
1288 NULL, /* RETRO_LANGUAGE_FRENCH */
1289 NULL, /* RETRO_LANGUAGE_SPANISH */
1290 NULL, /* RETRO_LANGUAGE_GERMAN */
1291 NULL, /* RETRO_LANGUAGE_ITALIAN */
1292 NULL, /* RETRO_LANGUAGE_DUTCH */
1293 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1294 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1295 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1296 NULL, /* RETRO_LANGUAGE_KOREAN */
1297 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1298 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1299 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1300 NULL, /* RETRO_LANGUAGE_POLISH */
1301 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1302 NULL, /* RETRO_LANGUAGE_ARABIC */
1303 NULL, /* RETRO_LANGUAGE_GREEK */
1304 &options_tr, /* RETRO_LANGUAGE_TURKISH */
1305};
1306#endif
1307
1308/*
1309 ********************************
1310 * Functions
1311 ********************************
1312*/
1313
1314/* Handles configuration/setting of core options.
1315 * Should be called as early as possible - ideally inside
1316 * retro_set_environment(), and no later than retro_load_game()
1317 * > We place the function body in the header to avoid the
1318 * necessity of adding more .c files (i.e. want this to
1319 * be as painless as possible for core devs)
1320 */
1321
1322static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
1323 bool *categories_supported)
1324{
1325 unsigned version = 0;
1326#ifndef HAVE_NO_LANGEXTRA
1327 unsigned language = 0;
1328#endif
1329
1330 if (!environ_cb || !categories_supported)
1331 return;
1332
1333 *categories_supported = false;
1334
1335 if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
1336 version = 0;
1337
1338 if (version >= 2)
1339 {
1340#ifndef HAVE_NO_LANGEXTRA
1341 struct retro_core_options_v2_intl core_options_intl;
1342
1343 core_options_intl.us = &options_us;
1344 core_options_intl.local = NULL;
1345
1346 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1347 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1348 core_options_intl.local = options_intl[language];
1349
1350 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
1351 &core_options_intl);
1352#else
1353 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
1354 &options_us);
1355#endif
1356 }
1357 else
1358 {
1359 size_t i, j;
1360 size_t option_index = 0;
1361 size_t num_options = 0;
1362 struct retro_core_option_definition
1363 *option_v1_defs_us = NULL;
1364#ifndef HAVE_NO_LANGEXTRA
1365 size_t num_options_intl = 0;
1366 struct retro_core_option_v2_definition
1367 *option_defs_intl = NULL;
1368 struct retro_core_option_definition
1369 *option_v1_defs_intl = NULL;
1370 struct retro_core_options_intl
1371 core_options_v1_intl;
1372#endif
1373 struct retro_variable *variables = NULL;
1374 char **values_buf = NULL;
1375
1376 /* Determine total number of options */
1377 while (true)
1378 {
1379 if (option_defs_us[num_options].key)
1380 num_options++;
1381 else
1382 break;
1383 }
1384
1385 if (version >= 1)
1386 {
1387 /* Allocate US array */
1388 option_v1_defs_us = (struct retro_core_option_definition *)
1389 calloc(num_options + 1, sizeof(struct retro_core_option_definition));
1390
1391 /* Copy parameters from option_defs_us array */
1392 for (i = 0; i < num_options; i++)
1393 {
1394 struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
1395 struct retro_core_option_value *option_values = option_def_us->values;
1396 struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
1397 struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
1398
1399 option_v1_def_us->key = option_def_us->key;
1400 option_v1_def_us->desc = option_def_us->desc;
1401 option_v1_def_us->info = option_def_us->info;
1402 option_v1_def_us->default_value = option_def_us->default_value;
1403
1404 /* Values must be copied individually... */
1405 while (option_values->value)
1406 {
1407 option_v1_values->value = option_values->value;
1408 option_v1_values->label = option_values->label;
1409
1410 option_values++;
1411 option_v1_values++;
1412 }
1413 }
1414
1415#ifndef HAVE_NO_LANGEXTRA
1416 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1417 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
1418 options_intl[language])
1419 option_defs_intl = options_intl[language]->definitions;
1420
1421 if (option_defs_intl)
1422 {
1423 /* Determine number of intl options */
1424 while (true)
1425 {
1426 if (option_defs_intl[num_options_intl].key)
1427 num_options_intl++;
1428 else
1429 break;
1430 }
1431
1432 /* Allocate intl array */
1433 option_v1_defs_intl = (struct retro_core_option_definition *)
1434 calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
1435
1436 /* Copy parameters from option_defs_intl array */
1437 for (i = 0; i < num_options_intl; i++)
1438 {
1439 struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
1440 struct retro_core_option_value *option_values = option_def_intl->values;
1441 struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
1442 struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
1443
1444 option_v1_def_intl->key = option_def_intl->key;
1445 option_v1_def_intl->desc = option_def_intl->desc;
1446 option_v1_def_intl->info = option_def_intl->info;
1447 option_v1_def_intl->default_value = option_def_intl->default_value;
1448
1449 /* Values must be copied individually... */
1450 while (option_values->value)
1451 {
1452 option_v1_values->value = option_values->value;
1453 option_v1_values->label = option_values->label;
1454
1455 option_values++;
1456 option_v1_values++;
1457 }
1458 }
1459 }
1460
1461 core_options_v1_intl.us = option_v1_defs_us;
1462 core_options_v1_intl.local = option_v1_defs_intl;
1463
1464 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
1465#else
1466 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
1467#endif
1468 }
1469 else
1470 {
1471 /* Allocate arrays */
1472 variables = (struct retro_variable *)calloc(num_options + 1,
1473 sizeof(struct retro_variable));
1474 values_buf = (char **)calloc(num_options, sizeof(char *));
1475
1476 if (!variables || !values_buf)
1477 goto error;
1478
1479 /* Copy parameters from option_defs_us array */
1480 for (i = 0; i < num_options; i++)
1481 {
1482 const char *key = option_defs_us[i].key;
1483 const char *desc = option_defs_us[i].desc;
1484 const char *default_value = option_defs_us[i].default_value;
1485 struct retro_core_option_value *values = option_defs_us[i].values;
1486 size_t buf_len = 3;
1487 size_t default_index = 0;
1488
1489 values_buf[i] = NULL;
1490
1491 /* Skip options that are irrelevant when using the
1492 * old style core options interface */
1493 if ((strcmp(key, "pcsx_rearmed_show_input_settings") == 0) ||
1494 (strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0) ||
1495 (strcmp(key, "pcsx_rearmed_show_gpu_unai_settings") == 0))
1496 continue;
1497
1498 if (desc)
1499 {
1500 size_t num_values = 0;
1501
1502 /* Determine number of values */
1503 while (true)
1504 {
1505 if (values[num_values].value)
1506 {
1507 /* Check if this is the default value */
1508 if (default_value)
1509 if (strcmp(values[num_values].value, default_value) == 0)
1510 default_index = num_values;
1511
1512 buf_len += strlen(values[num_values].value);
1513 num_values++;
1514 }
1515 else
1516 break;
1517 }
1518
1519 /* Build values string */
1520 if (num_values > 0)
1521 {
1522 buf_len += num_values - 1;
1523 buf_len += strlen(desc);
1524
1525 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1526 if (!values_buf[i])
1527 goto error;
1528
1529 strcpy(values_buf[i], desc);
1530 strcat(values_buf[i], "; ");
1531
1532 /* Default value goes first */
1533 strcat(values_buf[i], values[default_index].value);
1534
1535 /* Add remaining values */
1536 for (j = 0; j < num_values; j++)
1537 {
1538 if (j != default_index)
1539 {
1540 strcat(values_buf[i], "|");
1541 strcat(values_buf[i], values[j].value);
1542 }
1543 }
1544 }
1545 }
1546
1547 variables[option_index].key = key;
1548 variables[option_index].value = values_buf[i];
1549 option_index++;
1550 }
1551
1552 /* Set variables */
1553 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1554 }
1555
1556error:
1557 /* Clean up */
1558
1559 if (option_v1_defs_us)
1560 {
1561 free(option_v1_defs_us);
1562 option_v1_defs_us = NULL;
1563 }
1564
1565#ifndef HAVE_NO_LANGEXTRA
1566 if (option_v1_defs_intl)
1567 {
1568 free(option_v1_defs_intl);
1569 option_v1_defs_intl = NULL;
1570 }
1571#endif
1572
1573 if (values_buf)
1574 {
1575 for (i = 0; i < num_options; i++)
1576 {
1577 if (values_buf[i])
1578 {
1579 free(values_buf[i]);
1580 values_buf[i] = NULL;
1581 }
1582 }
1583
1584 free(values_buf);
1585 values_buf = NULL;
1586 }
1587
1588 if (variables)
1589 {
1590 free(variables);
1591 variables = NULL;
1592 }
1593 }
1594}
1595
1596#ifdef __cplusplus
1597}
1598#endif
1599
1600#endif