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