60832742be2e662bfd076624abbf9e20e115724c
[pcsx_rearmed.git] / frontend / libretro_core_options.h
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
34 extern "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
53 struct 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
110 struct 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."
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    },
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    },
438    {
439       "pcsx_rearmed_screen_centering",
440       "(GPU) Screen centering",
441       NULL,
442       "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 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.",
443       NULL,
444       "video",
445       {
446          { "auto", "Auto" },
447          { "game", "Game-controlled" },
448          { "manual", "Manual" },
449          { NULL, NULL },
450       },
451       "auto",
452    },
453 #define V(x) { #x, NULL }
454    {
455       "pcsx_rearmed_screen_centering_x",
456       "(GPU) Manual screen centering X",
457       NULL,
458       "X offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
459       NULL,
460       "video",
461       {
462          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),
463          { NULL, NULL },
464       },
465       "0",
466    },
467    {
468       "pcsx_rearmed_screen_centering_y",
469       "(GPU) Manual screen centering Y",
470       NULL,
471       "Y offset of the frame buffer. Only effective when 'Screen centering' is set to 'Manual'.",
472       NULL,
473       "video",
474       {
475          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),
476          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),
477          { NULL, NULL },
478       },
479       "0",
480    },
481 #undef V
482 #ifdef GPU_NEON
483    {
484       "pcsx_rearmed_neon_interlace_enable_v2",
485       "(GPU) Show Interlaced Video",
486       "Show Interlaced Video",
487       "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.",
488       NULL,
489       "gpu_neon",
490       {
491          { "auto", NULL },
492          { "disabled", NULL },
493          { "enabled",  NULL },
494          { NULL, NULL },
495       },
496       "auto",
497    },
498    {
499       "pcsx_rearmed_neon_enhancement_enable",
500       "(GPU) Enhanced Resolution",
501       "Enhanced Resolution",
502       "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.",
503       NULL,
504       "gpu_neon",
505       {
506          { "disabled", NULL },
507          { "enabled",  NULL },
508          { NULL, NULL },
509       },
510       "disabled",
511    },
512    {
513       "pcsx_rearmed_neon_enhancement_no_main",
514       "(GPU) Enhanced Resolution Speed Hack",
515       "Enhanced Resolution Speed Hack",
516       "Improves performance when 'Enhanced Resolution' is enabled, but reduces compatibility and may cause rendering errors.",
517       NULL,
518       "gpu_neon",
519       {
520          { "disabled", NULL },
521          { "enabled",  NULL },
522          { NULL, NULL },
523       },
524       "disabled",
525    },
526 #endif /* GPU_NEON */
527 #ifdef GPU_PEOPS
528    {
529       "pcsx_rearmed_show_gpu_peops_settings",
530       "Show Advanced P.E.Op.S. GPU Settings",
531       NULL,
532       "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.",
533       NULL,
534       NULL,
535       {
536          { "disabled", NULL },
537          { "enabled",  NULL },
538          { NULL, NULL },
539       },
540       "disabled",
541    },
542    {
543       "pcsx_rearmed_gpu_peops_odd_even_bit",
544       "(GPU) Odd/Even Bit Hack",
545       "Odd/Even Bit Hack",
546       "A hack fix used to correct lock-ups that may occur in games such as Chrono Cross. Disable unless required.",
547       NULL,
548       "gpu_peops",
549       {
550          { "disabled", NULL },
551          { "enabled",  NULL },
552          { NULL, NULL },
553       },
554       "disabled",
555    },
556    {
557       "pcsx_rearmed_gpu_peops_expand_screen_width",
558       "(GPU) Expand Screen Width",
559       "Expand Screen Width",
560       "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.",
561       NULL,
562       "gpu_peops",
563       {
564          { "disabled", NULL },
565          { "enabled",  NULL },
566          { NULL, NULL },
567       },
568       "disabled",
569    },
570    {
571       "pcsx_rearmed_gpu_peops_ignore_brightness",
572       "(GPU) Ignore Brightness Color",
573       "Ignore Brightness Color",
574       "A hack fix used to repair black screens in Lunar Silver Star Story Complete when entering a house or a menu. Disable unless required.",
575       NULL,
576       "gpu_peops",
577       {
578          { "disabled", NULL },
579          { "enabled",  NULL },
580          { NULL, NULL },
581       },
582       "disabled",
583    },
584    {
585       "pcsx_rearmed_gpu_peops_disable_coord_check",
586       "(GPU) Disable Coordinate Check",
587       "Disable Coordinate Check",
588       "Legacy compatibility mode. May improve games that fail to run correctly on newer GPU hardware. Disable unless required.",
589       NULL,
590       "gpu_peops",
591       {
592          { "disabled", NULL },
593          { "enabled",  NULL },
594          { NULL, NULL },
595       },
596       "disabled",
597    },
598    {
599       "pcsx_rearmed_gpu_peops_lazy_screen_update",
600       "(GPU) Lazy Screen Update",
601       "Lazy Screen Update",
602       "A partial fix to prevent text box flickering in Dragon Warrior VII. May also improve Pandemonium 2. Disable unless required.",
603       NULL,
604       "gpu_peops",
605       {
606          { "disabled", NULL },
607          { "enabled",  NULL },
608          { NULL, NULL },
609       },
610       "disabled",
611    },
612    {
613       "pcsx_rearmed_gpu_peops_repeated_triangles",
614       "(GPU) Repeat Flat Tex Triangles",
615       "Repeat Flat Tex Triangles",
616       "A hack fix used to correct rendering errors in Star Wars: Dark Forces. Disable unless required.",
617       NULL,
618       "gpu_peops",
619       {
620          { "disabled", NULL },
621          { "enabled",  NULL },
622          { NULL, NULL },
623       },
624       "disabled",
625    },
626    {
627       "pcsx_rearmed_gpu_peops_quads_with_triangles",
628       "(GPU) Draw Tex-Quads as Triangles",
629       "Draw Tex-Quads as Triangles",
630       "Corrects graphical distortions that may occur when games utilize Gouraud Shading, at the expense of reduced texture quality. Disable unless required.",
631       NULL,
632       "gpu_peops",
633       {
634          { "disabled", NULL },
635          { "enabled",  NULL },
636          { NULL, NULL },
637       },
638       "disabled",
639    },
640    {
641       "pcsx_rearmed_gpu_peops_fake_busy_state",
642       "(GPU) Fake 'GPU Busy' States",
643       "Fake 'GPU Busy' States",
644       "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.",
645       NULL,
646       "gpu_peops",
647       {
648          { "disabled", NULL },
649          { "enabled",  NULL },
650          { NULL, NULL },
651       },
652       "disabled",
653    },
654 #endif /* GPU_PEOPS */
655 #ifdef GPU_UNAI
656    {
657       "pcsx_rearmed_show_gpu_unai_settings",
658       "Show Advanced UNAI GPU Settings",
659       NULL,
660       "Show low-level configuration options for the UNAI GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
661       NULL,
662       NULL,
663       {
664          { "disabled", NULL },
665          { "enabled",  NULL },
666          { NULL, NULL},
667       },
668       "disabled",
669    },
670    {
671       "pcsx_rearmed_gpu_unai_blending",
672       "(GPU) Texture Blending",
673       "Texture Blending",
674       "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.",
675       NULL,
676       "gpu_unai",
677       {
678          { "disabled", NULL },
679          { "enabled",  NULL },
680          { NULL, NULL},
681       },
682       "enabled",
683    },
684    {
685       "pcsx_rearmed_gpu_unai_lighting",
686       "(GPU) Lighting Effects",
687       "Lighting Effects",
688       "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.).",
689       NULL,
690       "gpu_unai",
691       {
692          { "disabled", NULL },
693          { "enabled",  NULL },
694          { NULL, NULL},
695       },
696       "enabled",
697    },
698    {
699       "pcsx_rearmed_gpu_unai_fast_lighting",
700       "(GPU) Fast Lighting",
701       "Fast Lighting",
702       "Improves performance when 'Lighting Effects' are enabled, but may cause moderate/severe rendering errors.",
703       NULL,
704       "gpu_unai",
705       {
706          { "disabled", NULL },
707          { "enabled",  NULL },
708          { NULL, NULL},
709       },
710       "disabled",
711    },
712    {
713       "pcsx_rearmed_gpu_unai_scale_hires",
714       "(GPU) Hi-Res Downscaling",
715       "Hi-Res Downscaling",
716       "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.",
717       NULL,
718       "gpu_unai",
719       {
720          { "disabled", NULL },
721          { "enabled",  NULL },
722          { NULL, NULL},
723       },
724 #ifdef _MIYOO
725       "enabled",
726 #else
727       "disabled",
728 #endif
729    },
730 #endif /* GPU_UNAI */
731    {
732       "pcsx_rearmed_spu_reverb",
733       "Audio Reverb Effects",
734       "Reverb Effects",
735       "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.",
736       NULL,
737       "audio",
738       {
739          { "disabled", NULL },
740          { "enabled",  NULL },
741          { NULL, NULL },
742       },
743 #ifdef HAVE_PRE_ARMV7
744       "disabled",
745 #else
746       "enabled",
747 #endif
748    },
749    {
750       "pcsx_rearmed_spu_interpolation",
751       "Sound Interpolation",
752       NULL,
753       "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.",
754       NULL,
755       "audio",
756       {
757          { "simple",   "Simple" },
758          { "gaussian", "Gaussian" },
759          { "cubic",    "Cubic" },
760          { "off",      "disabled" },
761          { NULL, NULL },
762       },
763 #ifdef HAVE_PRE_ARMV7
764       "off",
765 #else
766       "simple",
767 #endif
768    },
769    {
770       "pcsx_rearmed_nocdaudio",
771       "CD Audio",
772       NULL,
773       "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.",
774       NULL,
775       "audio",
776       {
777          { "disabled", NULL },
778          { "enabled",  NULL },
779          { NULL, NULL },
780       },
781       "enabled",
782    },
783    {
784       "pcsx_rearmed_noxadecoding",
785       "XA Decoding",
786       NULL,
787       "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.",
788       NULL,
789       "audio",
790       {
791          { "disabled", NULL },
792          { "enabled",  NULL },
793          { NULL, NULL },
794       },
795       "enabled",
796    },
797 #if P_HAVE_PTHREAD
798    {
799       "pcsx_rearmed_spu_thread",
800       "Threaded SPU",
801       NULL,
802       "Emulates the PSX SPU on another CPU thread. May cause audio glitches in some games.",
803       NULL,
804       "audio",
805       {
806          { "disabled", NULL },
807          { "enabled",  NULL },
808          { NULL, NULL },
809       },
810       "disabled",
811    },
812 #endif // P_HAVE_PTHREAD
813    {
814       "pcsx_rearmed_show_input_settings",
815       "Show Input Settings",
816       NULL,
817       "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.",
818       NULL,
819       NULL,
820       {
821          { "disabled", NULL },
822          { "enabled",  NULL },
823          { NULL, NULL },
824       },
825       "disabled",
826    },
827    {
828       "pcsx_rearmed_analog_axis_modifier",
829       "Analog Axis Bounds",
830       NULL,
831       "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.",
832       NULL,
833       "input",
834       {
835          { "circle", "Circle" },
836          { "square", "Square" },
837          { NULL, NULL },
838       },
839       "circle",
840    },
841    {
842       "pcsx_rearmed_vibration",
843       "Rumble Effects",
844       NULL,
845       "Enable haptic feedback when using a rumble-equipped gamepad with input device set to 'dualshock'.",
846       NULL,
847       "input",
848       {
849          { "disabled", NULL },
850          { "enabled",  NULL },
851          { NULL, NULL },
852       },
853       "enabled",
854    },
855    {
856       "pcsx_rearmed_multitap",
857       "Multitap Mode",
858       NULL,
859       "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.",
860       NULL,
861       "input",
862       {
863          { "disabled",      NULL },
864          { "port 1",        "Port 1" },
865          { "port 2",        "Port 2" },
866          { "ports 1 and 2", "Ports 1 and 2" },
867          { NULL, NULL },
868       },
869       "disabled",
870    },
871    {
872       "pcsx_rearmed_negcon_deadzone",
873       "NegCon Twist Deadzone",
874       NULL,
875       "Set the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
876       NULL,
877       "input",
878       {
879          { "0",  "0%" },
880          { "3",  "3%" },
881          { "5",  "5%" },
882          { "7",  "7%" },
883          { "10", "10%" },
884          { "13", "13%" },
885          { "15", "15%" },
886          { "17", "17%" },
887          { "20", "20%" },
888          { "23", "23%" },
889          { "25", "25%" },
890          { "27", "27%" },
891          { "30", "30%" },
892          { NULL, NULL },
893       },
894       "0",
895    },
896    {
897       "pcsx_rearmed_negcon_response",
898       "NegCon Twist Response",
899       NULL,
900       "Specify the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
901       NULL,
902       "input",
903       {
904          { "linear",    "Linear" },
905          { "quadratic", "Quadratic" },
906          { "cubic",     "Cubic" },
907          { NULL, NULL },
908       },
909       "linear",
910    },
911    {
912       "pcsx_rearmed_input_sensitivity",
913       "Mouse Sensitivity",
914       NULL,
915       "Adjust responsiveness of emulated 'mouse' input devices.",
916       NULL,
917       "input",
918       {
919          { "0.05", NULL },
920          { "0.10", NULL },
921          { "0.15", NULL },
922          { "0.20", NULL },
923          { "0.25", NULL },
924          { "0.30", NULL },
925          { "0.35", NULL },
926          { "0.40", NULL },
927          { "0.45", NULL },
928          { "0.50", NULL },
929          { "0.55", NULL },
930          { "0.60", NULL },
931          { "0.65", NULL },
932          { "0.70", NULL },
933          { "0.75", NULL },
934          { "0.80", NULL },
935          { "0.85", NULL },
936          { "0.90", NULL },
937          { "0.95", NULL },
938          { "1.00", NULL },
939          { "1.05", NULL },
940          { "1.10", NULL },
941          { "1.15", NULL },
942          { "1.20", NULL },
943          { "1.25", NULL },
944          { "1.30", NULL },
945          { "1.35", NULL },
946          { "1.40", NULL },
947          { "1.45", NULL },
948          { "1.50", NULL },
949          { "1.55", NULL },
950          { "1.60", NULL },
951          { "1.65", NULL },
952          { "1.70", NULL },
953          { "1.75", NULL },
954          { "1.80", NULL },
955          { "1.85", NULL },
956          { "1.90", NULL },
957          { "1.95", NULL },
958          { "2.00", NULL },
959       },
960       "1.00",
961    },
962    {
963       "pcsx_rearmed_crosshair1",
964       "Player 1 Lightgun Crosshair",
965       NULL,
966       "Toggle player 1's crosshair for the Guncon or Konami Gun",
967       NULL,
968       "input",
969       {
970          { "disabled", NULL },
971          { "blue",  NULL },
972          { "green",  NULL },
973          { "red",  NULL },
974          { "white",  NULL },
975          { NULL, NULL },
976       },
977       "disabled",
978    },
979    {
980       "pcsx_rearmed_crosshair2",
981       "Player 2 Lightgun Crosshair",
982       NULL,
983       "Toggle player 2's crosshair for the Guncon or Konami Gun",
984       NULL,
985       "input",
986       {
987          { "disabled", NULL },
988          { "blue",  NULL },
989          { "green",  NULL },
990          { "red",  NULL },
991          { "white",  NULL },
992          { NULL, NULL },
993       },
994       "disabled",
995    },
996    {
997       "pcsx_rearmed_konamigunadjustx",
998       "Konami Gun X Axis Offset",
999       NULL,
1000       "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.",
1001       NULL,
1002       "input",
1003       {
1004          { "-40", NULL },
1005          { "-39", NULL },
1006          { "-38", NULL },
1007          { "-37", NULL },
1008          { "-36", NULL },
1009          { "-35", NULL },
1010          { "-34", NULL },
1011          { "-33", NULL },
1012          { "-32", NULL },
1013          { "-31", NULL },
1014          { "-30", NULL },
1015          { "-29", NULL },
1016          { "-28", NULL },
1017          { "-27", NULL },
1018          { "-26", NULL },
1019          { "-25", NULL },
1020          { "-24", NULL },
1021          { "-23", NULL },
1022          { "-22", NULL },
1023          { "-21", NULL },
1024          { "-20", NULL },
1025          { "-19", NULL },
1026          { "-18", NULL },
1027          { "-17", NULL },
1028          { "-16", NULL },
1029          { "-15", NULL },
1030          { "-14", NULL },
1031          { "-13", NULL },
1032          { "-12", NULL },
1033          { "-11", NULL },
1034          { "-10", NULL },
1035          { "-9",  NULL },
1036          { "-8",  NULL },
1037          { "-7",  NULL },
1038          { "-6",  NULL },
1039          { "-5",  NULL },
1040          { "-4",  NULL },
1041          { "-3",  NULL },
1042          { "-2",  NULL },
1043          { "-1",  NULL },
1044          { "0",   NULL },
1045          { "1",   NULL },
1046          { "2",   NULL },
1047          { "3",   NULL },
1048          { "4",   NULL },
1049          { "5",   NULL },
1050          { "6",   NULL },
1051          { "7",   NULL },
1052          { "8",   NULL },
1053          { "9",   NULL },
1054          { "10",  NULL },
1055          { "11",  NULL },
1056          { "12",  NULL },
1057          { "13",  NULL },
1058          { "14",  NULL },
1059          { "15",  NULL },
1060          { "16",  NULL },
1061          { "17",  NULL },
1062          { "18",  NULL },
1063          { "19",  NULL },
1064          { "20",  NULL },
1065          { "21",  NULL },
1066          { "22",  NULL },
1067          { "23",  NULL },
1068          { "24",  NULL },
1069          { "25",  NULL },
1070          { "26",  NULL },
1071          { "27",  NULL },
1072          { "28",  NULL },
1073          { "29",  NULL },
1074          { "30",  NULL },
1075          { "31",  NULL },
1076          { "32",  NULL },
1077          { "33",  NULL },
1078          { "34",  NULL },
1079          { "35",  NULL },
1080          { "36",  NULL },
1081          { "37",  NULL },
1082          { "38",  NULL },
1083          { "39",  NULL },
1084          { "40",  NULL },
1085          { NULL, NULL },
1086       },
1087       "0",
1088    },
1089    {
1090       "pcsx_rearmed_konamigunadjusty",
1091       "Konami Gun Y Axis Offset",
1092       NULL,
1093       "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.",
1094       NULL,
1095       "input",
1096       {
1097          { "-40", NULL },
1098          { "-39", NULL },
1099          { "-38", NULL },
1100          { "-37", NULL },
1101          { "-36", NULL },
1102          { "-35", NULL },
1103          { "-34", NULL },
1104          { "-33", NULL },
1105          { "-32", NULL },
1106          { "-31", NULL },
1107          { "-30", NULL },
1108          { "-29", NULL },
1109          { "-28", NULL },
1110          { "-27", NULL },
1111          { "-26", NULL },
1112          { "-25", NULL },
1113          { "-24", NULL },
1114          { "-23", NULL },
1115          { "-22", NULL },
1116          { "-21", NULL },
1117          { "-20", NULL },
1118          { "-19", NULL },
1119          { "-18", NULL },
1120          { "-17", NULL },
1121          { "-16", NULL },
1122          { "-15", NULL },
1123          { "-14", NULL },
1124          { "-13", NULL },
1125          { "-12", NULL },
1126          { "-11", NULL },
1127          { "-10", NULL },
1128          { "-9",  NULL },
1129          { "-8",  NULL },
1130          { "-7",  NULL },
1131          { "-6",  NULL },
1132          { "-5",  NULL },
1133          { "-4",  NULL },
1134          { "-3",  NULL },
1135          { "-2",  NULL },
1136          { "-1",  NULL },
1137          { "0",   NULL },
1138          { "1",   NULL },
1139          { "2",   NULL },
1140          { "3",   NULL },
1141          { "4",   NULL },
1142          { "5",   NULL },
1143          { "6",   NULL },
1144          { "7",   NULL },
1145          { "8",   NULL },
1146          { "9",   NULL },
1147          { "10",  NULL },
1148          { "11",  NULL },
1149          { "12",  NULL },
1150          { "13",  NULL },
1151          { "14",  NULL },
1152          { "15",  NULL },
1153          { "16",  NULL },
1154          { "17",  NULL },
1155          { "18",  NULL },
1156          { "19",  NULL },
1157          { "20",  NULL },
1158          { "21",  NULL },
1159          { "22",  NULL },
1160          { "23",  NULL },
1161          { "24",  NULL },
1162          { "25",  NULL },
1163          { "26",  NULL },
1164          { "27",  NULL },
1165          { "28",  NULL },
1166          { "29",  NULL },
1167          { "30",  NULL },
1168          { "31",  NULL },
1169          { "32",  NULL },
1170          { "33",  NULL },
1171          { "34",  NULL },
1172          { "35",  NULL },
1173          { "36",  NULL },
1174          { "37",  NULL },
1175          { "38",  NULL },
1176          { "39",  NULL },
1177          { "40",  NULL },
1178          { NULL, NULL },
1179       },
1180       "0",
1181    },
1182    {
1183       "pcsx_rearmed_gunconadjustx",
1184       "Guncon X Axis Offset",
1185       NULL,
1186       "Apply an X axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1187       NULL,
1188       "input",
1189       {
1190          { "-40", NULL },
1191          { "-39", NULL },
1192          { "-38", NULL },
1193          { "-37", NULL },
1194          { "-36", NULL },
1195          { "-35", NULL },
1196          { "-34", NULL },
1197          { "-33", NULL },
1198          { "-32", NULL },
1199          { "-31", NULL },
1200          { "-30", NULL },
1201          { "-29", NULL },
1202          { "-28", NULL },
1203          { "-27", NULL },
1204          { "-26", NULL },
1205          { "-25", NULL },
1206          { "-24", NULL },
1207          { "-23", NULL },
1208          { "-22", NULL },
1209          { "-21", NULL },
1210          { "-20", NULL },
1211          { "-19", NULL },
1212          { "-18", NULL },
1213          { "-17", NULL },
1214          { "-16", NULL },
1215          { "-15", NULL },
1216          { "-14", NULL },
1217          { "-13", NULL },
1218          { "-12", NULL },
1219          { "-11", NULL },
1220          { "-10", NULL },
1221          { "-9",  NULL },
1222          { "-8",  NULL },
1223          { "-7",  NULL },
1224          { "-6",  NULL },
1225          { "-5",  NULL },
1226          { "-4",  NULL },
1227          { "-3",  NULL },
1228          { "-2",  NULL },
1229          { "-1",  NULL },
1230          { "0",   NULL },
1231          { "1",   NULL },
1232          { "2",   NULL },
1233          { "3",   NULL },
1234          { "4",   NULL },
1235          { "5",   NULL },
1236          { "6",   NULL },
1237          { "7",   NULL },
1238          { "8",   NULL },
1239          { "9",   NULL },
1240          { "10",  NULL },
1241          { "11",  NULL },
1242          { "12",  NULL },
1243          { "13",  NULL },
1244          { "14",  NULL },
1245          { "15",  NULL },
1246          { "16",  NULL },
1247          { "17",  NULL },
1248          { "18",  NULL },
1249          { "19",  NULL },
1250          { "20",  NULL },
1251          { "21",  NULL },
1252          { "22",  NULL },
1253          { "23",  NULL },
1254          { "24",  NULL },
1255          { "25",  NULL },
1256          { "26",  NULL },
1257          { "27",  NULL },
1258          { "28",  NULL },
1259          { "29",  NULL },
1260          { "30",  NULL },
1261          { "31",  NULL },
1262          { "32",  NULL },
1263          { "33",  NULL },
1264          { "34",  NULL },
1265          { "35",  NULL },
1266          { "36",  NULL },
1267          { "37",  NULL },
1268          { "38",  NULL },
1269          { "39",  NULL },
1270          { "40",  NULL },
1271          { NULL, NULL },
1272       },
1273       "0",
1274    },
1275    {
1276       "pcsx_rearmed_gunconadjusty",
1277       "Guncon Y Axis Offset",
1278       NULL,
1279       "Apply a Y axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
1280       NULL,
1281       "input",
1282       {
1283          { "-40", NULL },
1284          { "-39", NULL },
1285          { "-38", NULL },
1286          { "-37", NULL },
1287          { "-36", NULL },
1288          { "-35", NULL },
1289          { "-34", NULL },
1290          { "-33", NULL },
1291          { "-32", NULL },
1292          { "-31", NULL },
1293          { "-30", NULL },
1294          { "-29", NULL },
1295          { "-28", NULL },
1296          { "-27", NULL },
1297          { "-26", NULL },
1298          { "-25", NULL },
1299          { "-24", NULL },
1300          { "-23", NULL },
1301          { "-22", NULL },
1302          { "-21", NULL },
1303          { "-20", NULL },
1304          { "-19", NULL },
1305          { "-18", NULL },
1306          { "-17", NULL },
1307          { "-16", NULL },
1308          { "-15", NULL },
1309          { "-14", NULL },
1310          { "-13", NULL },
1311          { "-12", NULL },
1312          { "-11", NULL },
1313          { "-10", NULL },
1314          { "-9",  NULL },
1315          { "-8",  NULL },
1316          { "-7",  NULL },
1317          { "-6",  NULL },
1318          { "-5",  NULL },
1319          { "-4",  NULL },
1320          { "-3",  NULL },
1321          { "-2",  NULL },
1322          { "-1",  NULL },
1323          { "0",   NULL },
1324          { "1",   NULL },
1325          { "2",   NULL },
1326          { "3",   NULL },
1327          { "4",   NULL },
1328          { "5",   NULL },
1329          { "6",   NULL },
1330          { "7",   NULL },
1331          { "8",   NULL },
1332          { "9",   NULL },
1333          { "10",  NULL },
1334          { "11",  NULL },
1335          { "12",  NULL },
1336          { "13",  NULL },
1337          { "14",  NULL },
1338          { "15",  NULL },
1339          { "16",  NULL },
1340          { "17",  NULL },
1341          { "18",  NULL },
1342          { "19",  NULL },
1343          { "20",  NULL },
1344          { "21",  NULL },
1345          { "22",  NULL },
1346          { "23",  NULL },
1347          { "24",  NULL },
1348          { "25",  NULL },
1349          { "26",  NULL },
1350          { "27",  NULL },
1351          { "28",  NULL },
1352          { "29",  NULL },
1353          { "30",  NULL },
1354          { "31",  NULL },
1355          { "32",  NULL },
1356          { "33",  NULL },
1357          { "34",  NULL },
1358          { "35",  NULL },
1359          { "36",  NULL },
1360          { "37",  NULL },
1361          { "38",  NULL },
1362          { "39",  NULL },
1363          { "40",  NULL },
1364          { NULL, NULL },
1365       },
1366       "0",
1367    },
1368    {
1369       "pcsx_rearmed_gunconadjustratiox",
1370       "Guncon X Axis Response",
1371       NULL,
1372       "Adjust relative magnitude of horizontal light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1373       NULL,
1374       "input",
1375       {
1376          { "0.75", NULL },
1377          { "0.76", NULL },
1378          { "0.77", NULL },
1379          { "0.78", NULL },
1380          { "0.79", NULL },
1381          { "0.80", NULL },
1382          { "0.81", NULL },
1383          { "0.82", NULL },
1384          { "0.83", NULL },
1385          { "0.84", NULL },
1386          { "0.85", NULL },
1387          { "0.86", NULL },
1388          { "0.87", NULL },
1389          { "0.88", NULL },
1390          { "0.89", NULL },
1391          { "0.90", NULL },
1392          { "0.91", NULL },
1393          { "0.92", NULL },
1394          { "0.93", NULL },
1395          { "0.94", NULL },
1396          { "0.95", NULL },
1397          { "0.96", NULL },
1398          { "0.97", NULL },
1399          { "0.98", NULL },
1400          { "0.99", NULL },
1401          { "1.00", NULL },
1402          { "1.01", NULL },
1403          { "1.02", NULL },
1404          { "1.03", NULL },
1405          { "1.04", NULL },
1406          { "1.05", NULL },
1407          { "1.06", NULL },
1408          { "1.07", NULL },
1409          { "1.08", NULL },
1410          { "1.09", NULL },
1411          { "1.10", NULL },
1412          { "1.11", NULL },
1413          { "1.12", NULL },
1414          { "1.13", NULL },
1415          { "1.14", NULL },
1416          { "1.15", NULL },
1417          { "1.16", NULL },
1418          { "1.17", NULL },
1419          { "1.18", NULL },
1420          { "1.19", NULL },
1421          { "1.20", NULL },
1422          { "1.21", NULL },
1423          { "1.22", NULL },
1424          { "1.23", NULL },
1425          { "1.24", NULL },
1426          { "1.25", NULL },
1427          { NULL, NULL },
1428       },
1429       "1.00",
1430    },
1431    {
1432       "pcsx_rearmed_gunconadjustratioy",
1433       "Guncon Y Axis Response",
1434       NULL,
1435       "Adjust relative magnitude of vertical light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1436       NULL,
1437       "input",
1438       {
1439          { "0.75", NULL },
1440          { "0.76", NULL },
1441          { "0.77", NULL },
1442          { "0.78", NULL },
1443          { "0.79", NULL },
1444          { "0.80", NULL },
1445          { "0.81", NULL },
1446          { "0.82", NULL },
1447          { "0.83", NULL },
1448          { "0.84", NULL },
1449          { "0.85", NULL },
1450          { "0.86", NULL },
1451          { "0.87", NULL },
1452          { "0.88", NULL },
1453          { "0.89", NULL },
1454          { "0.90", NULL },
1455          { "0.91", NULL },
1456          { "0.92", NULL },
1457          { "0.93", NULL },
1458          { "0.94", NULL },
1459          { "0.95", NULL },
1460          { "0.96", NULL },
1461          { "0.97", NULL },
1462          { "0.98", NULL },
1463          { "0.99", NULL },
1464          { "1.00", NULL },
1465          { "1.01", NULL },
1466          { "1.02", NULL },
1467          { "1.03", NULL },
1468          { "1.04", NULL },
1469          { "1.05", NULL },
1470          { "1.06", NULL },
1471          { "1.07", NULL },
1472          { "1.08", NULL },
1473          { "1.09", NULL },
1474          { "1.10", NULL },
1475          { "1.11", NULL },
1476          { "1.12", NULL },
1477          { "1.13", NULL },
1478          { "1.14", NULL },
1479          { "1.15", NULL },
1480          { "1.16", NULL },
1481          { "1.17", NULL },
1482          { "1.18", NULL },
1483          { "1.19", NULL },
1484          { "1.20", NULL },
1485          { "1.21", NULL },
1486          { "1.22", NULL },
1487          { "1.23", NULL },
1488          { "1.24", NULL },
1489          { "1.25", NULL },
1490          { NULL, NULL },
1491       },
1492       "1.00",
1493    },
1494    {
1495       "pcsx_rearmed_icache_emulation",
1496       "Instruction Cache Emulation",
1497       NULL,
1498       "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]",
1499       NULL,
1500       "compat_hack",
1501       {
1502          { "enabled",  NULL },
1503          { "disabled", NULL },
1504          { NULL, NULL },
1505       },
1506       "enabled",
1507    },
1508    {
1509       "pcsx_rearmed_exception_emulation",
1510       "Exception and Breakpoint Emulation",
1511       NULL,
1512       "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]",
1513       NULL,
1514       "compat_hack",
1515       {
1516          { "disabled", NULL },
1517          { "enabled",  NULL },
1518          { NULL, NULL },
1519       },
1520       "disabled",
1521    },
1522 #if !defined(DRC_DISABLE) && !defined(LIGHTREC)
1523    {
1524       "pcsx_rearmed_nocompathacks",
1525       "Disable Automatic Compatibility Hacks",
1526       NULL,
1527       "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.",
1528       NULL,
1529       "compat_hack",
1530       {
1531          { "disabled", NULL },
1532          { "enabled",  NULL },
1533          { NULL, NULL },
1534       },
1535       "disabled",
1536    },
1537    {
1538       "pcsx_rearmed_nosmccheck",
1539       "(Speed Hack) Disable SMC Checks",
1540       "Disable SMC Checks",
1541       "Will cause crashes when loading, and lead to memory card failure.",
1542       NULL,
1543       "speed_hack",
1544       {
1545          { "disabled", NULL },
1546          { "enabled",  NULL },
1547          { NULL, NULL },
1548       },
1549       "disabled",
1550    },
1551    {
1552       "pcsx_rearmed_gteregsunneeded",
1553       "(Speed Hack) Assume GTE Registers Unneeded",
1554       "Assume GTE Registers Unneeded",
1555       "May cause rendering errors.",
1556       NULL,
1557       "speed_hack",
1558       {
1559          { "disabled", NULL },
1560          { "enabled",  NULL },
1561          { NULL, NULL },
1562       },
1563       "disabled",
1564    },
1565    {
1566       "pcsx_rearmed_nogteflags",
1567       "(Speed Hack) Disable GTE Flags",
1568       "Disable GTE Flags",
1569       "Will cause rendering errors.",
1570       NULL,
1571       "speed_hack",
1572       {
1573          { "disabled", NULL },
1574          { "enabled",  NULL },
1575          { NULL, NULL },
1576       },
1577       "disabled",
1578    },
1579    {
1580       "pcsx_rearmed_nostalls",
1581       "(Speed Hack) Disable CPU/GTE Stalls",
1582       "Disable CPU/GTE Stalls",
1583       "Will cause some games to run too quickly.",
1584       NULL,
1585       "speed_hack",
1586       {
1587          { "disabled", NULL },
1588          { "enabled",  NULL },
1589          { NULL, NULL },
1590       },
1591       "disabled",
1592    },
1593 #endif /* !DRC_DISABLE && !LIGHTREC */
1594    { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
1595 };
1596
1597 struct retro_core_options_v2 options_us = {
1598    option_cats_us,
1599    option_defs_us
1600 };
1601
1602 /*
1603  ********************************
1604  * Language Mapping
1605  ********************************
1606 */
1607
1608 #ifndef HAVE_NO_LANGEXTRA
1609 struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
1610    &options_us, /* RETRO_LANGUAGE_ENGLISH */
1611    NULL,        /* RETRO_LANGUAGE_JAPANESE */
1612    NULL,        /* RETRO_LANGUAGE_FRENCH */
1613    NULL,        /* RETRO_LANGUAGE_SPANISH */
1614    NULL,        /* RETRO_LANGUAGE_GERMAN */
1615    NULL,        /* RETRO_LANGUAGE_ITALIAN */
1616    NULL,        /* RETRO_LANGUAGE_DUTCH */
1617    NULL,        /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1618    NULL,        /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1619    NULL,        /* RETRO_LANGUAGE_RUSSIAN */
1620    NULL,        /* RETRO_LANGUAGE_KOREAN */
1621    NULL,        /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1622    NULL,        /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1623    NULL,        /* RETRO_LANGUAGE_ESPERANTO */
1624    NULL,        /* RETRO_LANGUAGE_POLISH */
1625    NULL,        /* RETRO_LANGUAGE_VIETNAMESE */
1626    NULL,        /* RETRO_LANGUAGE_ARABIC */
1627    NULL,        /* RETRO_LANGUAGE_GREEK */
1628    &options_tr, /* RETRO_LANGUAGE_TURKISH */
1629 };
1630 #endif
1631
1632 /*
1633  ********************************
1634  * Functions
1635  ********************************
1636 */
1637
1638 /* Handles configuration/setting of core options.
1639  * Should be called as early as possible - ideally inside
1640  * retro_set_environment(), and no later than retro_load_game()
1641  * > We place the function body in the header to avoid the
1642  *   necessity of adding more .c files (i.e. want this to
1643  *   be as painless as possible for core devs)
1644  */
1645
1646 static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
1647       bool *categories_supported)
1648 {
1649    unsigned version  = 0;
1650 #ifndef HAVE_NO_LANGEXTRA
1651    unsigned language = 0;
1652 #endif
1653
1654    if (!environ_cb || !categories_supported)
1655       return;
1656
1657    *categories_supported = false;
1658
1659    if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
1660       version = 0;
1661
1662    if (version >= 2)
1663    {
1664 #ifndef HAVE_NO_LANGEXTRA
1665       struct retro_core_options_v2_intl core_options_intl;
1666
1667       core_options_intl.us    = &options_us;
1668       core_options_intl.local = NULL;
1669
1670       if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1671           (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1672          core_options_intl.local = options_intl[language];
1673
1674       *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
1675             &core_options_intl);
1676 #else
1677       *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
1678             &options_us);
1679 #endif
1680    }
1681    else
1682    {
1683       size_t i, j;
1684       size_t option_index              = 0;
1685       size_t num_options               = 0;
1686       struct retro_core_option_definition
1687             *option_v1_defs_us         = NULL;
1688 #ifndef HAVE_NO_LANGEXTRA
1689       size_t num_options_intl          = 0;
1690       struct retro_core_option_v2_definition
1691             *option_defs_intl          = NULL;
1692       struct retro_core_option_definition
1693             *option_v1_defs_intl       = NULL;
1694       struct retro_core_options_intl
1695             core_options_v1_intl;
1696 #endif
1697       struct retro_variable *variables = NULL;
1698       char **values_buf                = NULL;
1699
1700       /* Determine total number of options */
1701       while (true)
1702       {
1703          if (option_defs_us[num_options].key)
1704             num_options++;
1705          else
1706             break;
1707       }
1708
1709       if (version >= 1)
1710       {
1711          /* Allocate US array */
1712          option_v1_defs_us = (struct retro_core_option_definition *)
1713                calloc(num_options + 1, sizeof(struct retro_core_option_definition));
1714
1715          /* Copy parameters from option_defs_us array */
1716          for (i = 0; i < num_options; i++)
1717          {
1718             struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
1719             struct retro_core_option_value *option_values         = option_def_us->values;
1720             struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
1721             struct retro_core_option_value *option_v1_values      = option_v1_def_us->values;
1722
1723             option_v1_def_us->key           = option_def_us->key;
1724             option_v1_def_us->desc          = option_def_us->desc;
1725             option_v1_def_us->info          = option_def_us->info;
1726             option_v1_def_us->default_value = option_def_us->default_value;
1727
1728             /* Values must be copied individually... */
1729             while (option_values->value)
1730             {
1731                option_v1_values->value = option_values->value;
1732                option_v1_values->label = option_values->label;
1733
1734                option_values++;
1735                option_v1_values++;
1736             }
1737          }
1738
1739 #ifndef HAVE_NO_LANGEXTRA
1740          if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1741              (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
1742              options_intl[language])
1743             option_defs_intl = options_intl[language]->definitions;
1744
1745          if (option_defs_intl)
1746          {
1747             /* Determine number of intl options */
1748             while (true)
1749             {
1750                if (option_defs_intl[num_options_intl].key)
1751                   num_options_intl++;
1752                else
1753                   break;
1754             }
1755
1756             /* Allocate intl array */
1757             option_v1_defs_intl = (struct retro_core_option_definition *)
1758                   calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
1759
1760             /* Copy parameters from option_defs_intl array */
1761             for (i = 0; i < num_options_intl; i++)
1762             {
1763                struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
1764                struct retro_core_option_value *option_values           = option_def_intl->values;
1765                struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
1766                struct retro_core_option_value *option_v1_values        = option_v1_def_intl->values;
1767
1768                option_v1_def_intl->key           = option_def_intl->key;
1769                option_v1_def_intl->desc          = option_def_intl->desc;
1770                option_v1_def_intl->info          = option_def_intl->info;
1771                option_v1_def_intl->default_value = option_def_intl->default_value;
1772
1773                /* Values must be copied individually... */
1774                while (option_values->value)
1775                {
1776                   option_v1_values->value = option_values->value;
1777                   option_v1_values->label = option_values->label;
1778
1779                   option_values++;
1780                   option_v1_values++;
1781                }
1782             }
1783          }
1784
1785          core_options_v1_intl.us    = option_v1_defs_us;
1786          core_options_v1_intl.local = option_v1_defs_intl;
1787
1788          environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
1789 #else
1790          environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
1791 #endif
1792       }
1793       else
1794       {
1795          /* Allocate arrays */
1796          variables  = (struct retro_variable *)calloc(num_options + 1,
1797                sizeof(struct retro_variable));
1798          values_buf = (char **)calloc(num_options, sizeof(char *));
1799
1800          if (!variables || !values_buf)
1801             goto error;
1802
1803          /* Copy parameters from option_defs_us array */
1804          for (i = 0; i < num_options; i++)
1805          {
1806             const char *key                        = option_defs_us[i].key;
1807             const char *desc                       = option_defs_us[i].desc;
1808             const char *default_value              = option_defs_us[i].default_value;
1809             struct retro_core_option_value *values = option_defs_us[i].values;
1810             size_t buf_len                         = 3;
1811             size_t default_index                   = 0;
1812
1813             values_buf[i] = NULL;
1814
1815             /* Skip options that are irrelevant when using the
1816              * old style core options interface */
1817             if ((strcmp(key, "pcsx_rearmed_show_input_settings") == 0) ||
1818                 (strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0) ||
1819                 (strcmp(key, "pcsx_rearmed_show_gpu_unai_settings") == 0))
1820                continue;
1821
1822             if (desc)
1823             {
1824                size_t num_values = 0;
1825
1826                /* Determine number of values */
1827                while (true)
1828                {
1829                   if (values[num_values].value)
1830                   {
1831                      /* Check if this is the default value */
1832                      if (default_value)
1833                         if (strcmp(values[num_values].value, default_value) == 0)
1834                            default_index = num_values;
1835
1836                      buf_len += strlen(values[num_values].value);
1837                      num_values++;
1838                   }
1839                   else
1840                      break;
1841                }
1842
1843                /* Build values string */
1844                if (num_values > 0)
1845                {
1846                   buf_len += num_values - 1;
1847                   buf_len += strlen(desc);
1848
1849                   values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1850                   if (!values_buf[i])
1851                      goto error;
1852
1853                   strcpy(values_buf[i], desc);
1854                   strcat(values_buf[i], "; ");
1855
1856                   /* Default value goes first */
1857                   strcat(values_buf[i], values[default_index].value);
1858
1859                   /* Add remaining values */
1860                   for (j = 0; j < num_values; j++)
1861                   {
1862                      if (j != default_index)
1863                      {
1864                         strcat(values_buf[i], "|");
1865                         strcat(values_buf[i], values[j].value);
1866                      }
1867                   }
1868                }
1869             }
1870
1871             variables[option_index].key   = key;
1872             variables[option_index].value = values_buf[i];
1873             option_index++;
1874          }
1875
1876          /* Set variables */
1877          environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1878       }
1879
1880 error:
1881       /* Clean up */
1882
1883       if (option_v1_defs_us)
1884       {
1885          free(option_v1_defs_us);
1886          option_v1_defs_us = NULL;
1887       }
1888
1889 #ifndef HAVE_NO_LANGEXTRA
1890       if (option_v1_defs_intl)
1891       {
1892          free(option_v1_defs_intl);
1893          option_v1_defs_intl = NULL;
1894       }
1895 #endif
1896
1897       if (values_buf)
1898       {
1899          for (i = 0; i < num_options; i++)
1900          {
1901             if (values_buf[i])
1902             {
1903                free(values_buf[i]);
1904                values_buf[i] = NULL;
1905             }
1906          }
1907
1908          free(values_buf);
1909          values_buf = NULL;
1910       }
1911
1912       if (variables)
1913       {
1914          free(variables);
1915          variables = NULL;
1916       }
1917    }
1918 }
1919
1920 #ifdef __cplusplus
1921 }
1922 #endif
1923
1924 #endif