Merge pull request #415 from negativeExponent/core_option_cleanup
[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: 1.3
17  ********************************
18  *
19  * - 1.3: Move translations to libretro_core_options_intl.h
20  *        - libretro_core_options_intl.h includes BOM and utf-8
21  *          fix for MSVC 2010-2013
22  *        - Added HAVE_NO_LANGEXTRA flag to disable translations
23  *          on platforms/compilers without BOM support
24  * - 1.2: Use core options v1 interface when
25  *        RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
26  *        (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
27  * - 1.1: Support generation of core options v0 retro_core_option_value
28  *        arrays containing options with a single value
29  * - 1.0: First commit
30 */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /*
37  ********************************
38  * Core Option Definitions
39  ********************************
40 */
41
42 /* RETRO_LANGUAGE_ENGLISH */
43
44 /* Default language:
45  * - All other languages must include the same keys and values
46  * - Will be used as a fallback in the event that frontend language
47  *   is not available
48  * - Will be used as a fallback for any missing entries in
49  *   frontend language definition
50  */
51
52 struct retro_core_option_definition option_defs_us[] = {
53    {
54       "pcsx_rearmed_frameskip",
55       "Frameskip",
56       "Choose how much frames should be skipped to improve performance at the expense of visual smoothness.",
57       {
58          { "0", NULL },
59          { "1", NULL },
60          { "2", NULL },
61          { "3", NULL },
62          { NULL, NULL },
63       },
64       "0",
65    },
66    {
67       "pcsx_rearmed_bios",
68       "Use BIOS",
69       "Allows you to use real bios file (if available) or emulated bios (HLE). Its recommended to use official bios file for better compatibility.",
70       {
71          { "auto", "auto" },
72          { "HLE",  "hle" },
73          { NULL, NULL },
74       },
75       "auto",
76    },
77    {
78       "pcsx_rearmed_region",
79       "Region",
80       "Choose what region the system is from. 60 Hz for NTSC, 50 Hz for PAL.",
81       {
82          { "auto", "auto" },
83          { "NTSC", "ntsc" },
84          { "PAL",  "pal" },
85          { NULL, NULL },
86       },
87       "auto",
88    },
89    {
90       "pcsx_rearmed_memcard2",
91       "Enable Second Memory Card (Shared)",
92       "Enabled the memory card slot 2. This memory card is shared amongst all games.",
93       {
94          { "disabled", NULL },
95          { "enabled",  NULL },
96          { NULL, NULL },
97       },
98       "disabled",
99    },
100    {
101       "pcsx_rearmed_pad1type",
102       "Pad 1 Type",
103       "Pad type for player 1",
104       {
105          { "standard",  NULL },
106          { "analog",    NULL },
107          { "dualshock", NULL },
108          { "negcon",    NULL },
109          { "guncon",    NULL },
110          { "none",      NULL },
111          { NULL, NULL },
112       },
113       "standard",
114    },
115    {
116       "pcsx_rearmed_pad2type",
117       "Pad 2 Type",
118       "Pad type for player 2",
119       {
120          { "standard",  NULL },
121          { "analog",    NULL },
122          { "dualshock", NULL },
123          { "negcon",    NULL },
124          { "guncon",    NULL },
125          { "none",      NULL },
126          { NULL, NULL },
127       },
128       "standard",
129    },
130    {
131       "pcsx_rearmed_pad3type",
132       "Pad 3 Type",
133       "Pad type for player 3",
134       {
135          { "standard",  NULL },
136          { "analog",    NULL },
137          { "dualshock", NULL },
138          { "negcon",    NULL },
139          { "guncon",    NULL },
140          { "none",      NULL },
141          { NULL, NULL },
142       },
143       "none",
144    },
145    {
146       "pcsx_rearmed_pad4type",
147       "Pad 4 Type",
148       "Pad type for player 4",
149       {
150          { "standard",  NULL },
151          { "analog",    NULL },
152          { "dualshock", NULL },
153          { "negcon",    NULL },
154          { "guncon",    NULL },
155          { "none",      NULL },
156          { NULL, NULL },
157       },
158       "none",
159    },
160    {
161       "pcsx_rearmed_pad5type",
162       "Pad 5 Type",
163       "Pad type for player 5",
164       {
165          { "standard",  NULL },
166          { "analog",    NULL },
167          { "dualshock", NULL },
168          { "negcon",    NULL },
169          { "guncon",    NULL },
170          { "none",      NULL },
171          { NULL, NULL },
172       },
173       "none",
174    },{
175       "pcsx_rearmed_pad6type",
176       "Pad 6 Type",
177       "Pad type for player 6",
178       {
179          { "standard",  NULL },
180          { "analog",    NULL },
181          { "dualshock", NULL },
182          { "negcon",    NULL },
183          { "guncon",    NULL },
184          { "none",      NULL },
185          { NULL, NULL },
186       },
187       "none",
188    },{
189       "pcsx_rearmed_pad7type",
190       "Pad 7 Type",
191       "Pad type for player 7",
192       {
193          { "standard",  NULL },
194          { "analog",    NULL },
195          { "dualshock", NULL },
196          { "negcon",    NULL },
197          { "guncon",    NULL },
198          { "none",      NULL },
199          { NULL, NULL },
200       },
201       "none",
202    },{
203       "pcsx_rearmed_pad8type",
204       "Pad 8 Type",
205       "Pad type for player 8",
206       {
207          { "standard",  NULL },
208          { "analog",    NULL },
209          { "dualshock", NULL },
210          { "negcon",    NULL },
211          { "guncon",    NULL },
212          { "none",      NULL },
213          { NULL, NULL },
214       },
215       "none",
216    },
217    {
218       "pcsx_rearmed_multitap1",
219       "Multitap 1",
220       "Enables/Disables multitap on port 1, allowing upto 5 players in games that permit it.",
221       {
222          { "auto",     NULL },
223          { "disabled", NULL },
224          { "enabled",  NULL },
225          { NULL, NULL },
226       },
227       "auto",
228    },
229    {
230       "pcsx_rearmed_multitap2",
231       "Multitap 2",
232       "Enables/Disables multitap on port 2, allowing up to 8 players in games that permit it. Multitap 1 has to be enabled for this to work.",
233       {
234          { "auto",     NULL },
235          { "disabled", NULL },
236          { "enabled",  NULL },
237          { NULL, NULL },
238       },
239       "auto",
240    },
241    {
242       "pcsx_rearmed_negcon_deadzone",
243       "NegCon Twist Deadzone (Percent)",
244       "Sets the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
245       {
246          { "0",  NULL },
247          { "5",  NULL },
248          { "10", NULL },
249          { "15", NULL },
250          { "20", NULL },
251          { "25", NULL },
252          { "30", NULL },
253          { NULL, NULL },
254       },
255       "0",
256    },
257    {
258       "pcsx_rearmed_negcon_response",
259       "NegCon Twist Response",
260       "Specifies the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
261       {
262          { "linear",    NULL },
263          { "quadratic", NULL },
264          { "cubic",     NULL },
265          { NULL, NULL },
266       },
267       "linear",
268    },
269    {
270       "pcsx_rearmed_analog_axis_modifier",
271       "Analog axis bounds.",
272       "Range bounds for analog axis. Square bounds help controllers with highly circular ranges that are unable to fully saturate the x and y axis at 45degree deflections.",
273       {
274          { "circle", NULL },
275          { "square", NULL },
276          { NULL, NULL },
277       },
278       "circle",
279    },
280    {
281       "pcsx_rearmed_vibration",
282       "Enable Vibration",
283       "Enables vibration feedback for controllers that supports vibration features.",
284       {
285          { "disabled", NULL },
286          { "enabled",  NULL },
287          { NULL, NULL },
288       },
289       "enabled",
290    },
291    {
292       "pcsx_rearmed_gunconadjustx",
293       "Guncon Adjust X",
294       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
295       {
296          { "0", NULL },
297          { "-25", NULL },
298          { "-24", NULL },
299          { "-23", NULL },
300          { "-22", NULL },
301          { "-21", NULL },
302          { "-20", NULL },
303          { "-19", NULL },
304          { "-18", NULL },
305          { "-17", NULL },
306          { "-16", NULL },
307          { "-15", NULL },
308          { "-14", NULL },
309          { "-13", NULL },
310          { "-12", NULL },
311          { "-11", NULL },
312          { "-10", NULL },
313          { "-09", NULL },
314          { "-08", NULL },
315          { "-07", NULL },
316          { "-06", NULL },
317          { "-05", NULL },
318          { "-04", NULL },
319          { "-03", NULL },
320          { "-02", NULL },
321          { "-01", NULL },
322          { "00", NULL },
323          { "01", NULL },
324          { "02", NULL },
325          { "03", NULL },
326          { "04", NULL },
327          { "05", NULL },
328          { "06", NULL },
329          { "07", NULL },
330          { "08", NULL },
331          { "09", NULL },
332          { "10", NULL },
333          { "11", NULL },
334          { "12", NULL },
335          { "13", NULL },
336          { "14", NULL },
337          { "15", NULL },
338          { "16", NULL },
339          { "17", NULL },
340          { "18", NULL },
341          { "19", NULL },
342          { "20", NULL },
343          { "21", NULL },
344          { "22", NULL },
345          { "23", NULL },
346          { "24", NULL },
347          { "25", NULL },
348          { NULL, NULL },
349       },
350       "0",
351    },
352    {
353       "pcsx_rearmed_gunconadjusty",
354       "Guncon Adjust Y",
355       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
356       {
357          { "0", NULL },
358          { "-25", NULL },
359          { "-24", NULL },
360          { "-23", NULL },
361          { "-22", NULL },
362          { "-21", NULL },
363          { "-20", NULL },
364          { "-19", NULL },
365          { "-18", NULL },
366          { "-17", NULL },
367          { "-16", NULL },
368          { "-15", NULL },
369          { "-14", NULL },
370          { "-13", NULL },
371          { "-12", NULL },
372          { "-11", NULL },
373          { "-10", NULL },
374          { "-09", NULL },
375          { "-08", NULL },
376          { "-07", NULL },
377          { "-06", NULL },
378          { "-05", NULL },
379          { "-04", NULL },
380          { "-03", NULL },
381          { "-02", NULL },
382          { "-01", NULL },
383          { "00", NULL },
384          { "01", NULL },
385          { "02", NULL },
386          { "03", NULL },
387          { "04", NULL },
388          { "05", NULL },
389          { "06", NULL },
390          { "07", NULL },
391          { "08", NULL },
392          { "09", NULL },
393          { "10", NULL },
394          { "11", NULL },
395          { "12", NULL },
396          { "13", NULL },
397          { "14", NULL },
398          { "15", NULL },
399          { "16", NULL },
400          { "17", NULL },
401          { "18", NULL },
402          { "19", NULL },
403          { "20", NULL },
404          { "21", NULL },
405          { "22", NULL },
406          { "23", NULL },
407          { "24", NULL },
408          { "25", NULL },
409          { NULL, NULL },
410       },
411       "0",
412    },
413    {
414       "pcsx_rearmed_gunconadjustratiox",
415       "Guncon Adjust Ratio X",
416       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
417       {
418          { "1", NULL },
419          { "0.75", NULL },
420          { "0.76", NULL },
421          { "0.77", NULL },
422          { "0.78", NULL },
423          { "0.79", NULL },
424          { "0.80", NULL },
425          { "0.81", NULL },
426          { "0.82", NULL },
427          { "0.83", NULL },
428          { "0.84", NULL },
429          { "0.85", NULL },
430          { "0.86", NULL },
431          { "0.87", NULL },
432          { "0.88", NULL },
433          { "0.89", NULL },
434          { "0.90", NULL },
435          { "0.91", NULL },
436          { "0.92", NULL },
437          { "0.93", NULL },
438          { "0.94", NULL },
439          { "0.95", NULL },
440          { "0.96", NULL },
441          { "0.97", NULL },
442          { "0.98", NULL },
443          { "0.99", NULL },
444          { "1.00", NULL },
445          { "1.01", NULL },
446          { "1.02", NULL },
447          { "1.03", NULL },
448          { "1.04", NULL },
449          { "1.05", NULL },
450          { "1.06", NULL },
451          { "1.07", NULL },
452          { "1.08", NULL },
453          { "1.09", NULL },
454          { "1.10", NULL },
455          { "1.11", NULL },
456          { "1.12", NULL },
457          { "1.13", NULL },
458          { "1.14", NULL },
459          { "1.15", NULL },
460          { "1.16", NULL },
461          { "1.17", NULL },
462          { "1.18", NULL },
463          { "1.19", NULL },
464          { "1.20", NULL },
465          { "1.21", NULL },
466          { "1.22", NULL },
467          { "1.23", NULL },
468          { "1.24", NULL },
469          { "1.25", NULL },
470          { NULL, NULL },
471       },
472       "1",
473    },
474    {
475       "pcsx_rearmed_gunconadjustratioy",
476       "Guncon Adjust Ratio Y",
477       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
478       {
479          { "1", NULL },
480          { "0.75", NULL },
481          { "0.76", NULL },
482          { "0.77", NULL },
483          { "0.78", NULL },
484          { "0.79", NULL },
485          { "0.80", NULL },
486          { "0.81", NULL },
487          { "0.82", NULL },
488          { "0.83", NULL },
489          { "0.84", NULL },
490          { "0.85", NULL },
491          { "0.86", NULL },
492          { "0.87", NULL },
493          { "0.88", NULL },
494          { "0.89", NULL },
495          { "0.90", NULL },
496          { "0.91", NULL },
497          { "0.92", NULL },
498          { "0.93", NULL },
499          { "0.94", NULL },
500          { "0.95", NULL },
501          { "0.96", NULL },
502          { "0.97", NULL },
503          { "0.98", NULL },
504          { "0.99", NULL },
505          { "1.00", NULL },
506          { "1.01", NULL },
507          { "1.02", NULL },
508          { "1.03", NULL },
509          { "1.04", NULL },
510          { "1.05", NULL },
511          { "1.06", NULL },
512          { "1.07", NULL },
513          { "1.08", NULL },
514          { "1.09", NULL },
515          { "1.10", NULL },
516          { "1.11", NULL },
517          { "1.12", NULL },
518          { "1.13", NULL },
519          { "1.14", NULL },
520          { "1.15", NULL },
521          { "1.16", NULL },
522          { "1.17", NULL },
523          { "1.18", NULL },
524          { "1.19", NULL },
525          { "1.20", NULL },
526          { "1.21", NULL },
527          { "1.22", NULL },
528          { "1.23", NULL },
529          { "1.24", NULL },
530          { "1.25", NULL },
531          { NULL, NULL },
532       },
533       "1",
534    },
535    {
536       "pcsx_rearmed_dithering",
537       "Enable Dithering",
538       "If Off, disables the dithering pattern the PSX applies to combat color banding.",
539       {
540          { "disabled", NULL },
541          { "enabled",  NULL },
542          { NULL, NULL },
543       },
544 #if defined HAVE_LIBNX || defined _3DS
545           "disabled",
546 #else
547       "enabled",
548 #endif
549    },
550
551 #if defined(LIGHTREC) || defined(NEW_DYNAREC)
552    {
553       "pcsx_rearmed_drc",
554       "Dynamic Recompiler",
555       "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
556       {
557          { "disabled", NULL },
558          { "enabled",  NULL },
559          { NULL, NULL },
560       },
561       "enabled",
562    },
563 #endif /* LIGHTREC || NEW_DYNAREC */
564
565 #ifdef NEW_DYNAREC
566    {
567       "pcsx_rearmed_psxclock",
568       "PSX CPU Clock",
569 #ifdef HAVE_PRE_ARMV7
570       "Overclock or underclock the PSX clock. Default is 50",
571 #else
572       "Overclock or underclock the PSX clock. Default is 57",
573 #endif
574       {
575          { "30",  NULL },
576          { "31",  NULL },
577          { "32",  NULL },
578          { "33",  NULL },
579          { "34",  NULL },
580          { "35",  NULL },
581          { "36",  NULL },
582          { "37",  NULL },
583          { "38",  NULL },
584          { "39",  NULL },
585          { "40",  NULL },
586          { "41",  NULL },
587          { "42",  NULL },
588          { "43",  NULL },
589          { "44",  NULL },
590          { "45",  NULL },
591          { "46",  NULL },
592          { "47",  NULL },
593          { "48",  NULL },
594          { "49",  NULL },
595          { "50",  NULL },
596          { "51",  NULL },
597          { "52",  NULL },
598          { "53",  NULL },
599          { "54",  NULL },
600          { "55",  NULL },
601          { "56",  NULL },
602          { "57",  NULL },
603          { "58",  NULL },
604          { "59",  NULL },
605          { "60",  NULL },
606          { "61",  NULL },
607          { "62",  NULL },
608          { "63",  NULL },
609          { "64",  NULL },
610          { "65",  NULL },
611          { "66",  NULL },
612          { "67",  NULL },
613          { "68",  NULL },
614          { "69",  NULL },
615          { "70",  NULL },
616          { "71",  NULL },
617          { "72",  NULL },
618          { "73",  NULL },
619          { "74",  NULL },
620          { "75",  NULL },
621          { "76",  NULL },
622          { "77",  NULL },
623          { "78",  NULL },
624          { "79",  NULL },
625          { "80",  NULL },
626          { "81",  NULL },
627          { "82",  NULL },
628          { "83",  NULL },
629          { "84",  NULL },
630          { "85",  NULL },
631          { "86",  NULL },
632          { "87",  NULL },
633          { "88",  NULL },
634          { "89",  NULL },
635          { "90",  NULL },
636          { "91",  NULL },
637          { "92",  NULL },
638          { "93",  NULL },
639          { "94",  NULL },
640          { "95",  NULL },
641          { "96",  NULL },
642          { "97",  NULL },
643          { "98",  NULL },
644          { "99",  NULL },
645          { "100", NULL },
646          { NULL, NULL },
647       },
648 #ifdef HAVE_PRE_ARMV7
649       "50",
650 #else
651       "57",
652 #endif
653    },
654 #endif /* NEW_DYNAREC */
655
656 #ifdef GPU_NEON
657    {
658       "pcsx_rearmed_neon_interlace_enable",
659       "Enable Interlacing Mode",
660       "Enables fake scanlines effect.",
661       {
662          { "disabled", NULL },
663          { "enabled",  NULL },
664          { NULL, NULL },
665       },
666       "disabled",
667    },
668    {
669       "pcsx_rearmed_neon_enhancement_enable",
670       "Enhanced Resolution (Slow)",
671       "Renders in double resolution at the cost of lower performance.",
672       {
673          { "disabled", NULL },
674          { "enabled",  NULL },
675          { NULL, NULL },
676       },
677       "disabled",
678    },
679    {
680       "pcsx_rearmed_neon_enhancement_no_main",
681       "Enhanced Resolution (Speed Hack)",
682       "Speed hack for Enhanced resolution option (glitches some games).",
683       {
684          { "disabled", NULL },
685          { "enabled",  NULL },
686          { NULL, NULL },
687       },
688       "disabled",
689    },
690 #endif /* GPU_NEON */
691
692    {
693       "pcsx_rearmed_duping_enable",
694       "Frame Duping",
695       "A speedup, redraws/reuses the last frame if there was no new data.",
696       {
697          { "disabled", NULL },
698          { "enabled",  NULL },
699          { NULL, NULL },
700       },
701       "enabled",
702    },
703    {
704       "pcsx_rearmed_display_internal_fps",
705       "Display Internal FPS",
706       "Shows an on-screen frames per second counter when enabled.",
707       {
708          { "disabled", NULL },
709          { "enabled",  NULL },
710          { NULL, NULL },
711       },
712       "disabled",
713    },
714
715    /* GPU PEOPS OPTIONS */
716 #ifdef GPU_PEOPS
717    {
718       "pcsx_rearmed_show_gpu_peops_settings",
719       "Advanced GPU P.E.Op.S. Settings",
720       "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
721       {
722          { "disabled", NULL },
723          { "enabled",  NULL },
724          { NULL, NULL },
725       },
726       "disabled",
727    },
728    {
729       "pcsx_rearmed_gpu_peops_odd_even_bit",
730       "(GPU) Odd/Even Bit Hack",
731       "Needed for Chrono Cross.",
732       {
733          { "disabled", NULL },
734          { "enabled",  NULL },
735          { NULL, NULL },
736       },
737       "disabled",
738    },
739    {
740       "pcsx_rearmed_gpu_peops_expand_screen_width",
741       "(GPU) Expand Screen Width",
742       "Capcom fighting games",
743       {
744          { "disabled", NULL },
745          { "enabled",  NULL },
746          { NULL, NULL },
747       },
748       "disabled",
749    },
750    {
751       "pcsx_rearmed_gpu_peops_ignore_brightness",
752       "(GPU) Ignore Brightness Color",
753       "Black screens in Lunar Silver Star Story games",
754       {
755          { "disabled", NULL },
756          { "enabled",  NULL },
757          { NULL, NULL },
758       },
759       "disabled",
760    },
761    {
762       "pcsx_rearmed_gpu_peops_disable_coord_check",
763       "(GPU) Disable Coordinate Check",
764       "Compatibility mode",
765       {
766          { "disabled", NULL },
767          { "enabled",  NULL },
768          { NULL, NULL },
769       },
770       "disabled",
771    },
772    {
773       "pcsx_rearmed_gpu_peops_lazy_screen_update",
774       "(GPU) Lazy Screen Update",
775       "Pandemonium 2",
776       {
777          { "disabled", NULL },
778          { "enabled",  NULL },
779          { NULL, NULL },
780       },
781       "disabled",
782    },
783    {
784       "pcsx_rearmed_gpu_peops_old_frame_skip",
785       "(GPU) Old Frame Skipping",
786       "Skip every second frame",
787       {
788          { "disabled", NULL },
789          { "enabled",  NULL },
790          { NULL, NULL },
791       },
792       "enabled",
793    },
794    {
795       "pcsx_rearmed_gpu_peops_repeated_triangles",
796       "(GPU) Repeated Flat Tex Triangles",
797       "Needed by Star Wars: Dark Forces",
798       {
799          { "disabled", NULL },
800          { "enabled",  NULL },
801          { NULL, NULL },
802       },
803       "disabled",
804    },
805    {
806       "pcsx_rearmed_gpu_peops_quads_with_triangles",
807       "(GPU) Draw Quads with Triangles",
808       "Better g-colors, worse textures",
809       {
810          { "disabled", NULL },
811          { "enabled",  NULL },
812          { NULL, NULL },
813       },
814       "disabled",
815    },
816    {
817       "pcsx_rearmed_gpu_peops_fake_busy_state",
818       "(GPU) Fake 'Gpu Busy' States",
819       "Toggle busy flags after drawing",
820       {
821          { "disabled", NULL },
822          { "enabled",  NULL },
823          { NULL, NULL },
824       },
825       "disabled",
826    },
827 #endif
828
829     /* GPU UNAI Advanced Options */
830 #ifdef GPU_UNAI
831    {
832       "pcsx_rearmed_show_gpu_unai_settings",
833       "Advance GPU UNAI/PCSX4All Settings",
834       "Shows or hides advanced gpu settings. A core restart might be needed for settings to take effect. NOTE: Quick Menu must be toggled for this setting to take effect.",
835       {
836          { "disabled", NULL },
837          { "enabled",  NULL },
838          { NULL, NULL},
839       },
840       "disabled",
841    },
842    {
843       "pcsx_rearmed_gpu_unai_blending",
844       "(GPU) Enable Blending",
845       NULL,
846       {
847          { "disabled", NULL },
848          { "enabled",  NULL },
849          { NULL, NULL},
850       },
851       "enabled",
852    },
853    {
854       "pcsx_rearmed_gpu_unai_lighting",
855       "(GPU) Enable Lighting",
856       NULL,
857       {
858          { "disabled", NULL },
859          { "enabled",  NULL },
860          { NULL, NULL},
861       },
862       "enabled",
863    },
864    {
865       "pcsx_rearmed_gpu_unai_fast_lighting",
866       "(GPU) Enable Fast Lighting",
867       NULL,
868       {
869          { "disabled", NULL },
870          { "enabled",  NULL },
871          { NULL, NULL},
872       },
873       "enabled",
874    },
875    {
876       "pcsx_rearmed_gpu_unai_ilace_force",
877       "(GPU) Enable Forced Interlace",
878       NULL,
879       {
880          { "disabled", NULL },
881          { "enabled",  NULL },
882          { NULL, NULL},
883       },
884       "disabled",
885    },
886    {
887       "pcsx_rearmed_gpu_unai_pixel_skip",
888       "(GPU) Enable Pixel Skip",
889       NULL,
890       {
891          { "disabled", NULL },
892          { "enabled",  NULL },
893          { NULL, NULL},
894       },
895       "disabled",
896    },
897 #endif /* GPU UNAI Advanced Settings */
898
899    {
900       "pcsx_rearmed_show_bios_bootlogo",
901       "Show Bios Bootlogo",
902       "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
903       {
904          { "disabled", NULL },
905          { "enabled",  NULL },
906          { NULL, NULL },
907       },
908       "disabled",
909    },
910    {
911       "pcsx_rearmed_spu_reverb",
912       "Sound Reverb",
913       "Enables or disables audio reverb effect.",
914       {
915          { "disabled", NULL },
916          { "enabled",  NULL },
917          { NULL, NULL },
918       },
919       "enabled",
920    },
921    {
922       "pcsx_rearmed_spu_interpolation",
923       "Sound Interpolation",
924       NULL,
925       {
926          { "simple",   "Simple" },
927          { "gaussian", "Gaussian" },
928          { "cubic",    "Cubic" },
929          { "off",      "disabled" },
930          { NULL, NULL },
931       },
932       "simple",
933    },
934    {
935       "pcsx_rearmed_idiablofix",
936       "Diablo Music Fix",
937       NULL,
938       {
939          { "disabled", NULL },
940          { "enabled",  NULL },
941          { NULL, NULL },
942       },
943       "disabled",
944    },
945    {
946       "pcsx_rearmed_pe2_fix",
947       "Parasite Eve 2/Vandal Hearts 1/2 Fix",
948       NULL,
949       {
950          { "disabled", NULL },
951          { "enabled",  NULL },
952          { NULL, NULL },
953       },
954       "disabled",
955    },
956    {
957       "pcsx_rearmed_inuyasha_fix",
958       "InuYasha Sengoku Battle Fix",
959       NULL,
960       {
961          { "disabled", NULL },
962          { "enabled",  NULL },
963          { NULL, NULL },
964       },
965       "disabled",
966    },
967 #ifndef _WIN32
968    {
969       "pcsx_rearmed_async_cd",
970       "CD Access Method (Restart)",
971       "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage.",
972       {
973          { "sync", "Synchronous" },
974          { "async",  "Asynchronous" },
975          { NULL, NULL},
976       },
977       "sync",
978    },
979 #endif
980    /* ADVANCED OPTIONS */
981    {
982       "pcsx_rearmed_noxadecoding",
983       "XA Decoding",
984       NULL,
985       {
986          { "disabled", NULL },
987          { "enabled",  NULL },
988          { NULL, NULL },
989       },
990       "enabled",
991    },
992    {
993       "pcsx_rearmed_nocdaudio",
994       "CD Audio",
995       NULL,
996       {
997          { "disabled", NULL },
998          { "enabled",  NULL },
999          { NULL, NULL },
1000       },
1001       "enabled",
1002    },
1003    {
1004       "pcsx_rearmed_spuirq",
1005       "SPU IRQ Always Enabled",
1006       "Compatibility tweak, should be left to off in most cases.",
1007       {
1008          { "disabled", NULL },
1009          { "enabled",  NULL },
1010          { NULL, NULL },
1011       },
1012       "disabled",
1013    },
1014
1015 #ifdef NEW_DYNAREC
1016    {
1017       "pcsx_rearmed_nosmccheck",
1018       "(Speed Hack) Disable SMC Checks",
1019       "Will cause crashes when loading, break memcards.",
1020       {
1021          { "disabled", NULL },
1022          { "enabled",  NULL },
1023          { NULL, NULL },
1024       },
1025       "disabled",
1026    },
1027    {
1028       "pcsx_rearmed_gteregsunneeded",
1029       "(Speed Hack) Assume GTE Regs Unneeded",
1030       "May cause graphical glitches.",
1031       {
1032          { "disabled", NULL },
1033          { "enabled",  NULL },
1034          { NULL, NULL },
1035       },
1036       "disabled",
1037    },
1038    {
1039       "pcsx_rearmed_nogteflags",
1040       "(Speed Hack) Disable GTE Flags",
1041       "Will cause graphical glitches.",
1042       {
1043          { "disabled", NULL },
1044          { "enabled",  NULL },
1045          { NULL, NULL },
1046       },
1047       "disabled",
1048    },
1049 #endif /* NEW_DYNAREC */
1050
1051    { NULL, NULL, NULL, {{0}}, NULL },
1052 };
1053
1054 /*
1055  ********************************
1056  * Language Mapping
1057  ********************************
1058 */
1059
1060 #ifndef HAVE_NO_LANGEXTRA
1061 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1062    option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1063    NULL,           /* RETRO_LANGUAGE_JAPANESE */
1064    NULL,           /* RETRO_LANGUAGE_FRENCH */
1065    NULL,           /* RETRO_LANGUAGE_SPANISH */
1066    NULL,           /* RETRO_LANGUAGE_GERMAN */
1067    NULL,           /* RETRO_LANGUAGE_ITALIAN */
1068    NULL,           /* RETRO_LANGUAGE_DUTCH */
1069    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1070    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1071    NULL,           /* RETRO_LANGUAGE_RUSSIAN */
1072    NULL,           /* RETRO_LANGUAGE_KOREAN */
1073    NULL,           /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1074    NULL,           /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1075    NULL,           /* RETRO_LANGUAGE_ESPERANTO */
1076    NULL,           /* RETRO_LANGUAGE_POLISH */
1077    NULL,           /* RETRO_LANGUAGE_VIETNAMESE */
1078    NULL,           /* RETRO_LANGUAGE_ARABIC */
1079    NULL,           /* RETRO_LANGUAGE_GREEK */
1080    option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1081 };
1082 #endif
1083
1084 /*
1085  ********************************
1086  * Functions
1087  ********************************
1088 */
1089
1090 /* Handles configuration/setting of core options.
1091  * Should be called as early as possible - ideally inside
1092  * retro_set_environment(), and no later than retro_load_game()
1093  * > We place the function body in the header to avoid the
1094  *   necessity of adding more .c files (i.e. want this to
1095  *   be as painless as possible for core devs)
1096  */
1097
1098 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1099 {
1100    unsigned version = 0;
1101
1102    if (!environ_cb)
1103       return;
1104
1105    if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1106    {
1107 #ifndef HAVE_NO_LANGEXTRA
1108       struct retro_core_options_intl core_options_intl;
1109       unsigned language = 0;
1110
1111       core_options_intl.us    = option_defs_us;
1112       core_options_intl.local = NULL;
1113
1114       if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1115           (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1116          core_options_intl.local = option_defs_intl[language];
1117
1118       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1119 #else
1120       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1121 #endif
1122    }
1123    else
1124    {
1125       size_t i;
1126       size_t option_index              = 0;
1127       size_t num_options               = 0;
1128       struct retro_variable *variables = NULL;
1129       char **values_buf                = NULL;
1130
1131       /* Determine number of options
1132        * > Note: We are going to skip a number of irrelevant
1133        *   core options when building the retro_variable array,
1134        *   but we'll allocate space for all of them. The difference
1135        *   in resource usage is negligible, and this allows us to
1136        *   keep the code 'cleaner' */
1137       while (true)
1138       {
1139          if (option_defs_us[num_options].key)
1140             num_options++;
1141          else
1142             break;
1143       }
1144
1145       /* Allocate arrays */
1146       variables  = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1147       values_buf = (char **)calloc(num_options, sizeof(char *));
1148
1149       if (!variables || !values_buf)
1150          goto error;
1151
1152       /* Copy parameters from option_defs_us array */
1153       for (i = 0; i < num_options; i++)
1154       {
1155          const char *key                        = option_defs_us[i].key;
1156          const char *desc                       = option_defs_us[i].desc;
1157          const char *default_value              = option_defs_us[i].default_value;
1158          struct retro_core_option_value *values = option_defs_us[i].values;
1159          size_t buf_len                         = 3;
1160          size_t default_index                   = 0;
1161
1162          values_buf[i] = NULL;
1163
1164          /* Skip options that are irrelevant when using the
1165           * old style core options interface */
1166          if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1167             continue;
1168
1169          if (desc)
1170          {
1171             size_t num_values = 0;
1172
1173             /* Determine number of values */
1174             while (true)
1175             {
1176                if (values[num_values].value)
1177                {
1178                   /* Check if this is the default value */
1179                   if (default_value)
1180                      if (strcmp(values[num_values].value, default_value) == 0)
1181                         default_index = num_values;
1182
1183                   buf_len += strlen(values[num_values].value);
1184                   num_values++;
1185                }
1186                else
1187                   break;
1188             }
1189
1190             /* Build values string */
1191             if (num_values > 0)
1192             {
1193                size_t j;
1194
1195                buf_len += num_values - 1;
1196                buf_len += strlen(desc);
1197
1198                values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1199                if (!values_buf[i])
1200                   goto error;
1201
1202                strcpy(values_buf[i], desc);
1203                strcat(values_buf[i], "; ");
1204
1205                /* Default value goes first */
1206                strcat(values_buf[i], values[default_index].value);
1207
1208                /* Add remaining values */
1209                for (j = 0; j < num_values; j++)
1210                {
1211                   if (j != default_index)
1212                   {
1213                      strcat(values_buf[i], "|");
1214                      strcat(values_buf[i], values[j].value);
1215                   }
1216                }
1217             }
1218          }
1219
1220          variables[option_index].key   = key;
1221          variables[option_index].value = values_buf[i];
1222          option_index++;
1223       }
1224
1225       /* Set variables */
1226       environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1227
1228 error:
1229
1230       /* Clean up */
1231       if (values_buf)
1232       {
1233          for (i = 0; i < num_options; i++)
1234          {
1235             if (values_buf[i])
1236             {
1237                free(values_buf[i]);
1238                values_buf[i] = NULL;
1239             }
1240          }
1241
1242          free(values_buf);
1243          values_buf = NULL;
1244       }
1245
1246       if (variables)
1247       {
1248          free(variables);
1249          variables = NULL;
1250       }
1251    }
1252 }
1253
1254 #ifdef __cplusplus
1255 }
1256 #endif
1257
1258 #endif