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