Merge pull request #369 from negativeExponent/switch
[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_vibration",
271       "Enable Vibration",
272       "Enables vibration feedback for controllers that supports vibration features.",
273       {
274          { "disabled", NULL },
275          { "enabled",  NULL },
276          { NULL, NULL },
277       },
278       "enabled",
279    },
280    {
281       "pcsx_rearmed_gunconadjustx",
282       "Guncon Adjust X",
283       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the x axis.",
284       {
285          { "0", NULL },
286          { "-25", NULL },
287          { "-24", NULL },
288          { "-23", NULL },
289          { "-22", NULL },
290          { "-21", NULL },
291          { "-20", NULL },
292          { "-19", NULL },
293          { "-18", NULL },
294          { "-17", NULL },
295          { "-16", NULL },
296          { "-15", NULL },
297          { "-14", NULL },
298          { "-13", NULL },
299          { "-12", NULL },
300          { "-11", NULL },
301          { "-10", NULL },
302          { "-09", NULL },
303          { "-08", NULL },
304          { "-07", NULL },
305          { "-06", NULL },
306          { "-05", NULL },
307          { "-04", NULL },
308          { "-03", NULL },
309          { "-02", NULL },
310          { "-01", NULL },
311          { "00", NULL },
312          { "01", NULL },
313          { "02", NULL },
314          { "03", NULL },
315          { "04", NULL },
316          { "05", NULL },
317          { "06", NULL },
318          { "07", NULL },
319          { "08", NULL },
320          { "09", NULL },
321          { "10", NULL },
322          { "11", NULL },
323          { "12", NULL },
324          { "13", NULL },
325          { "14", NULL },
326          { "15", NULL },
327          { "16", NULL },
328          { "17", NULL },
329          { "18", NULL },
330          { "19", NULL },
331          { "20", NULL },
332          { "21", NULL },
333          { "22", NULL },
334          { "23", NULL },
335          { "24", NULL },
336          { "25", NULL },
337          { NULL, NULL },
338       },
339       "0",
340    },
341    {
342       "pcsx_rearmed_gunconadjusty",
343       "Guncon Adjust Y",
344       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies an increment on the y axis.",
345       {
346          { "0", NULL },
347          { "-25", NULL },
348          { "-24", NULL },
349          { "-23", NULL },
350          { "-22", NULL },
351          { "-21", NULL },
352          { "-20", NULL },
353          { "-19", NULL },
354          { "-18", NULL },
355          { "-17", NULL },
356          { "-16", NULL },
357          { "-15", NULL },
358          { "-14", NULL },
359          { "-13", NULL },
360          { "-12", NULL },
361          { "-11", NULL },
362          { "-10", NULL },
363          { "-09", NULL },
364          { "-08", NULL },
365          { "-07", NULL },
366          { "-06", NULL },
367          { "-05", NULL },
368          { "-04", NULL },
369          { "-03", NULL },
370          { "-02", NULL },
371          { "-01", NULL },
372          { "00", NULL },
373          { "01", NULL },
374          { "02", NULL },
375          { "03", NULL },
376          { "04", NULL },
377          { "05", NULL },
378          { "06", NULL },
379          { "07", NULL },
380          { "08", NULL },
381          { "09", NULL },
382          { "10", NULL },
383          { "11", NULL },
384          { "12", NULL },
385          { "13", NULL },
386          { "14", NULL },
387          { "15", NULL },
388          { "16", NULL },
389          { "17", NULL },
390          { "18", NULL },
391          { "19", NULL },
392          { "20", NULL },
393          { "21", NULL },
394          { "22", NULL },
395          { "23", NULL },
396          { "24", NULL },
397          { "25", NULL },
398          { NULL, NULL },
399       },
400       "0",
401    },
402    {
403       "pcsx_rearmed_gunconadjustratiox",
404       "Guncon Adjust Ratio X",
405       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the x axis.",
406       {
407          { "1", NULL },
408          { "0.75", NULL },
409          { "0.76", NULL },
410          { "0.77", NULL },
411          { "0.78", NULL },
412          { "0.79", NULL },
413          { "0.80", NULL },
414          { "0.81", NULL },
415          { "0.82", NULL },
416          { "0.83", NULL },
417          { "0.84", NULL },
418          { "0.85", NULL },
419          { "0.86", NULL },
420          { "0.87", NULL },
421          { "0.88", NULL },
422          { "0.89", NULL },
423          { "0.90", NULL },
424          { "0.91", NULL },
425          { "0.92", NULL },
426          { "0.93", NULL },
427          { "0.94", NULL },
428          { "0.95", NULL },
429          { "0.96", NULL },
430          { "0.97", NULL },
431          { "0.98", NULL },
432          { "0.99", NULL },
433          { "1.00", NULL },
434          { "1.01", NULL },
435          { "1.02", NULL },
436          { "1.03", NULL },
437          { "1.04", NULL },
438          { "1.05", NULL },
439          { "1.06", NULL },
440          { "1.07", NULL },
441          { "1.08", NULL },
442          { "1.09", NULL },
443          { "1.10", NULL },
444          { "1.11", NULL },
445          { "1.12", NULL },
446          { "1.13", NULL },
447          { "1.14", NULL },
448          { "1.15", NULL },
449          { "1.16", NULL },
450          { "1.17", NULL },
451          { "1.18", NULL },
452          { "1.19", NULL },
453          { "1.20", NULL },
454          { "1.21", NULL },
455          { "1.22", NULL },
456          { "1.23", NULL },
457          { "1.24", NULL },
458          { "1.25", NULL },
459          { NULL, NULL },
460       },
461       "1",
462    },
463    {
464       "pcsx_rearmed_gunconadjustratioy",
465       "Guncon Adjust Ratio Y",
466       "When using Guncon mode, you can override aim in emulator if shots misaligned, this applies a ratio on the y axis.",
467       {
468          { "1", NULL },
469          { "0.75", NULL },
470          { "0.76", NULL },
471          { "0.77", NULL },
472          { "0.78", NULL },
473          { "0.79", NULL },
474          { "0.80", NULL },
475          { "0.81", NULL },
476          { "0.82", NULL },
477          { "0.83", NULL },
478          { "0.84", NULL },
479          { "0.85", NULL },
480          { "0.86", NULL },
481          { "0.87", NULL },
482          { "0.88", NULL },
483          { "0.89", NULL },
484          { "0.90", NULL },
485          { "0.91", NULL },
486          { "0.92", NULL },
487          { "0.93", NULL },
488          { "0.94", NULL },
489          { "0.95", NULL },
490          { "0.96", NULL },
491          { "0.97", NULL },
492          { "0.98", NULL },
493          { "0.99", NULL },
494          { "1.00", NULL },
495          { "1.01", NULL },
496          { "1.02", NULL },
497          { "1.03", NULL },
498          { "1.04", NULL },
499          { "1.05", NULL },
500          { "1.06", NULL },
501          { "1.07", NULL },
502          { "1.08", NULL },
503          { "1.09", NULL },
504          { "1.10", NULL },
505          { "1.11", NULL },
506          { "1.12", NULL },
507          { "1.13", NULL },
508          { "1.14", NULL },
509          { "1.15", NULL },
510          { "1.16", NULL },
511          { "1.17", NULL },
512          { "1.18", NULL },
513          { "1.19", NULL },
514          { "1.20", NULL },
515          { "1.21", NULL },
516          { "1.22", NULL },
517          { "1.23", NULL },
518          { "1.24", NULL },
519          { "1.25", NULL },
520          { NULL, NULL },
521       },
522       "1",
523    },
524    {
525       "pcsx_rearmed_dithering",
526       "Enable Dithering",
527       "If Off, disables the dithering pattern the PSX applies to combat color banding.",
528       {
529          { "disabled", NULL },
530          { "enabled",  NULL },
531          { NULL, NULL },
532       },
533 #ifdef HAVE_LIBNX
534           "disabled",
535 #else
536       "enabled",
537 #endif
538    },
539
540 #ifndef DRC_DISABLE
541    {
542       "pcsx_rearmed_drc",
543       "Dynamic Recompiler",
544       "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
545       {
546          { "disabled", NULL },
547          { "enabled",  NULL },
548          { NULL, NULL },
549       },
550       "enabled",
551    },
552    {
553       "pcsx_rearmed_psxclock",
554       "PSX CPU Clock",
555 #ifdef HAVE_PRE_ARMV7
556       "Overclock or underclock the PSX clock. Default is 50",
557 #else
558       "Overclock or underclock the PSX clock. Default is 57",
559 #endif
560       {
561          { "30",  NULL },
562          { "31",  NULL },
563          { "32",  NULL },
564          { "33",  NULL },
565          { "34",  NULL },
566          { "35",  NULL },
567          { "36",  NULL },
568          { "37",  NULL },
569          { "38",  NULL },
570          { "39",  NULL },
571          { "40",  NULL },
572          { "41",  NULL },
573          { "42",  NULL },
574          { "43",  NULL },
575          { "44",  NULL },
576          { "45",  NULL },
577          { "46",  NULL },
578          { "47",  NULL },
579          { "48",  NULL },
580          { "49",  NULL },
581          { "50",  NULL },
582          { "51",  NULL },
583          { "52",  NULL },
584          { "53",  NULL },
585          { "54",  NULL },
586          { "55",  NULL },
587          { "56",  NULL },
588          { "57",  NULL },
589          { "58",  NULL },
590          { "59",  NULL },
591          { "60",  NULL },
592          { "61",  NULL },
593          { "62",  NULL },
594          { "63",  NULL },
595          { "64",  NULL },
596          { "65",  NULL },
597          { "66",  NULL },
598          { "67",  NULL },
599          { "68",  NULL },
600          { "69",  NULL },
601          { "70",  NULL },
602          { "71",  NULL },
603          { "72",  NULL },
604          { "73",  NULL },
605          { "74",  NULL },
606          { "75",  NULL },
607          { "76",  NULL },
608          { "77",  NULL },
609          { "78",  NULL },
610          { "79",  NULL },
611          { "80",  NULL },
612          { "81",  NULL },
613          { "82",  NULL },
614          { "83",  NULL },
615          { "84",  NULL },
616          { "85",  NULL },
617          { "86",  NULL },
618          { "87",  NULL },
619          { "88",  NULL },
620          { "89",  NULL },
621          { "90",  NULL },
622          { "91",  NULL },
623          { "92",  NULL },
624          { "93",  NULL },
625          { "94",  NULL },
626          { "95",  NULL },
627          { "96",  NULL },
628          { "97",  NULL },
629          { "98",  NULL },
630          { "99",  NULL },
631          { "100", NULL },
632          { NULL, NULL },
633       },
634 #ifdef HAVE_PRE_ARMV7
635       "50",
636 #else
637       "57",
638 #endif
639    },
640 #endif /* DRC_DISABLE */
641
642 #ifdef __ARM_NEON__
643    {
644       "pcsx_rearmed_neon_interlace_enable",
645       "Enable Interlacing Mode",
646       "Enables fake scanlines effect.",
647       {
648          { "disabled", NULL },
649          { "enabled",  NULL },
650          { NULL, NULL },
651       },
652       "disabled",
653    },
654    {
655       "pcsx_rearmed_neon_enhancement_enable",
656       "Enhanced Resolution (Slow)",
657       "Renders in double resolution at the cost of lower performance.",
658       {
659          { "disabled", NULL },
660          { "enabled",  NULL },
661          { NULL, NULL },
662       },
663       "disabled",
664    },
665    {
666       "pcsx_rearmed_neon_enhancement_no_main",
667       "Enhanced Resolution (Speed Hack)",
668       "Speed hack for Enhanced resolution option (glitches some games).",
669       {
670          { "disabled", NULL },
671          { "enabled",  NULL },
672          { NULL, NULL },
673       },
674       "disabled",
675    },
676 #endif /* __ARM_NEON__ */
677
678    {
679       "pcsx_rearmed_duping_enable",
680       "Frame Duping",
681       "A speedup, redraws/reuses the last frame if there was no new data.",
682       {
683          { "disabled", NULL },
684          { "enabled",  NULL },
685          { NULL, NULL },
686       },
687       "enabled",
688    },
689    {
690       "pcsx_rearmed_display_internal_fps",
691       "Display Internal FPS",
692       "Shows an on-screen frames per second counter when enabled.",
693       {
694          { "disabled", NULL },
695          { "enabled",  NULL },
696          { NULL, NULL },
697       },
698       "disabled",
699    },
700
701    /* GPU PEOPS OPTIONS */
702 #ifdef GPU_PEOPS
703    {
704       "pcsx_rearmed_show_gpu_peops_settings",
705       "Advanced GPU P.E.Op.S. Settings",
706       "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
707       {
708          { "disabled", NULL },
709          { "enabled",  NULL },
710          { NULL, NULL },
711       },
712       "disabled",
713    },
714    {
715       "pcsx_rearmed_gpu_peops_odd_even_bit",
716       "(GPU) Odd/Even Bit Hack",
717       "Needed for Chrono Cross.",
718       {
719          { "disabled", NULL },
720          { "enabled",  NULL },
721          { NULL, NULL },
722       },
723       "disabled",
724    },
725    {
726       "pcsx_rearmed_gpu_peops_expand_screen_width",
727       "(GPU) Expand Screen Width",
728       "Capcom fighting games",
729       {
730          { "disabled", NULL },
731          { "enabled",  NULL },
732          { NULL, NULL },
733       },
734       "disabled",
735    },
736    {
737       "pcsx_rearmed_gpu_peops_ignore_brightness",
738       "(GPU) Ignore Brightness Color",
739       "Black screens in Lunar Silver Star Story games",
740       {
741          { "disabled", NULL },
742          { "enabled",  NULL },
743          { NULL, NULL },
744       },
745       "disabled",
746    },
747    {
748       "pcsx_rearmed_gpu_peops_disable_coord_check",
749       "(GPU) Disable Coordinate Check",
750       "Compatibility mode",
751       {
752          { "disabled", NULL },
753          { "enabled",  NULL },
754          { NULL, NULL },
755       },
756       "disabled",
757    },
758    {
759       "pcsx_rearmed_gpu_peops_lazy_screen_update",
760       "(GPU) Lazy Screen Update",
761       "Pandemonium 2",
762       {
763          { "disabled", NULL },
764          { "enabled",  NULL },
765          { NULL, NULL },
766       },
767       "disabled",
768    },
769    {
770       "pcsx_rearmed_gpu_peops_old_frame_skip",
771       "(GPU) Old Frame Skipping",
772       "Skip every second frame",
773       {
774          { "disabled", NULL },
775          { "enabled",  NULL },
776          { NULL, NULL },
777       },
778       "enabled",
779    },
780    {
781       "pcsx_rearmed_gpu_peops_repeated_triangles",
782       "(GPU) Repeated Flat Tex Triangles",
783       "Needed by Star Wars: Dark Forces",
784       {
785          { "disabled", NULL },
786          { "enabled",  NULL },
787          { NULL, NULL },
788       },
789       "disabled",
790    },
791    {
792       "pcsx_rearmed_gpu_peops_quads_with_triangles",
793       "(GPU) Draw Quads with Triangles",
794       "Better g-colors, worse textures",
795       {
796          { "disabled", NULL },
797          { "enabled",  NULL },
798          { NULL, NULL },
799       },
800       "disabled",
801    },
802    {
803       "pcsx_rearmed_gpu_peops_fake_busy_state",
804       "(GPU) Fake 'Gpu Busy' States",
805       "Toggle busy flags after drawing",
806       {
807          { "disabled", NULL },
808          { "enabled",  NULL },
809          { NULL, NULL },
810       },
811       "disabled",
812    },
813 #endif
814
815     /* GPU UNAI Advanced Options */
816 #ifdef GPU_UNAI
817    {
818       "pcsx_rearmed_show_gpu_unai_settings",
819       "Advance GPU UNAI/PCSX4All Settings",
820       "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.",
821       {
822          { "disabled", NULL },
823          { "enabled",  NULL },
824          { NULL, NULL},
825       },
826       "disabled",
827    },
828    {
829       "pcsx_rearmed_gpu_unai_blending",
830       "(GPU) Enable Blending",
831       NULL,
832       {
833          { "disabled", NULL },
834          { "enabled",  NULL },
835          { NULL, NULL},
836       },
837       "enabled",
838    },
839    {
840       "pcsx_rearmed_gpu_unai_lighting",
841       "(GPU) Enable Lighting",
842       NULL,
843       {
844          { "disabled", NULL },
845          { "enabled",  NULL },
846          { NULL, NULL},
847       },
848       "enabled",
849    },
850    {
851       "pcsx_rearmed_gpu_unai_fast_lighting",
852       "(GPU) Enable Fast Lighting",
853       NULL,
854       {
855          { "disabled", NULL },
856          { "enabled",  NULL },
857          { NULL, NULL},
858       },
859       "enabled",
860    },
861    {
862       "pcsx_rearmed_gpu_unai_ilace_force",
863       "(GPU) Enable Forced Interlace",
864       NULL,
865       {
866          { "disabled", NULL },
867          { "enabled",  NULL },
868          { NULL, NULL},
869       },
870       "disabled",
871    },
872    {
873       "pcsx_rearmed_gpu_unai_pixel_skip",
874       "(GPU) Enable Pixel Skip",
875       NULL,
876       {
877          { "disabled", NULL },
878          { "enabled",  NULL },
879          { NULL, NULL},
880       },
881       "disabled",
882    },
883 #endif /* GPU UNAI Advanced Settings */
884
885    {
886       "pcsx_rearmed_show_bios_bootlogo",
887       "Show Bios Bootlogo",
888       "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
889       {
890          { "disabled", NULL },
891          { "enabled",  NULL },
892          { NULL, NULL },
893       },
894       "disabled",
895    },
896    {
897       "pcsx_rearmed_spu_reverb",
898       "Sound Reverb",
899       "Enables or disables audio reverb effect.",
900       {
901          { "disabled", NULL },
902          { "enabled",  NULL },
903          { NULL, NULL },
904       },
905       "enabled",
906    },
907    {
908       "pcsx_rearmed_spu_interpolation",
909       "Sound Interpolation",
910       NULL,
911       {
912          { "simple",   "Simple" },
913          { "gaussian", "Gaussian" },
914          { "cubic",    "Cubic" },
915          { "off",      "disabled" },
916          { NULL, NULL },
917       },
918       "simple",
919    },
920    {
921       "pcsx_rearmed_idiablofix",
922       "Diablo Music Fix",
923       NULL,
924       {
925          { "disabled", NULL },
926          { "enabled",  NULL },
927          { NULL, NULL },
928       },
929       "disabled",
930    },
931    {
932       "pcsx_rearmed_pe2_fix",
933       "Parasite Eve 2/Vandal Hearts 1/2 Fix",
934       NULL,
935       {
936          { "disabled", NULL },
937          { "enabled",  NULL },
938          { NULL, NULL },
939       },
940       "disabled",
941    },
942    {
943       "pcsx_rearmed_inuyasha_fix",
944       "InuYasha Sengoku Battle Fix",
945       NULL,
946       {
947          { "disabled", NULL },
948          { "enabled",  NULL },
949          { NULL, NULL },
950       },
951       "disabled",
952    },
953
954    /* ADVANCED OPTIONS */
955    {
956       "pcsx_rearmed_noxadecoding",
957       "XA Decoding",
958       NULL,
959       {
960          { "disabled", NULL },
961          { "enabled",  NULL },
962          { NULL, NULL },
963       },
964       "enabled",
965    },
966    {
967       "pcsx_rearmed_nocdaudio",
968       "CD Audio",
969       NULL,
970       {
971          { "disabled", NULL },
972          { "enabled",  NULL },
973          { NULL, NULL },
974       },
975       "enabled",
976    },
977    {
978       "pcsx_rearmed_spuirq",
979       "SPU IRQ Always Enabled",
980       "Compatibility tweak, should be left to off in most cases.",
981       {
982          { "disabled", NULL },
983          { "enabled",  NULL },
984          { NULL, NULL },
985       },
986       "disabled",
987    },
988
989 #ifndef DRC_DISABLE
990    {
991       "pcsx_rearmed_nosmccheck",
992       "(Speed Hack) Disable SMC Checks",
993       "Will cause crashes when loading, break memcards.",
994       {
995          { "disabled", NULL },
996          { "enabled",  NULL },
997          { NULL, NULL },
998       },
999       "disabled",
1000    },
1001    {
1002       "pcsx_rearmed_gteregsunneeded",
1003       "(Speed Hack) Assume GTE Regs Unneeded",
1004       "May cause graphical glitches.",
1005       {
1006          { "disabled", NULL },
1007          { "enabled",  NULL },
1008          { NULL, NULL },
1009       },
1010       "disabled",
1011    },
1012    {
1013       "pcsx_rearmed_nogteflags",
1014       "(Speed Hack) Disable GTE Flags",
1015       "Will cause graphical glitches.",
1016       {
1017          { "disabled", NULL },
1018          { "enabled",  NULL },
1019          { NULL, NULL },
1020       },
1021       "disabled",
1022    },
1023 #endif /* DRC_DISABLE */
1024
1025    { NULL, NULL, NULL, {{0}}, NULL },
1026 };
1027
1028 /*
1029  ********************************
1030  * Language Mapping
1031  ********************************
1032 */
1033
1034 #ifndef HAVE_NO_LANGEXTRA
1035 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1036    option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1037    NULL,           /* RETRO_LANGUAGE_JAPANESE */
1038    NULL,           /* RETRO_LANGUAGE_FRENCH */
1039    NULL,           /* RETRO_LANGUAGE_SPANISH */
1040    NULL,           /* RETRO_LANGUAGE_GERMAN */
1041    NULL,           /* RETRO_LANGUAGE_ITALIAN */
1042    NULL,           /* RETRO_LANGUAGE_DUTCH */
1043    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1044    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1045    NULL,           /* RETRO_LANGUAGE_RUSSIAN */
1046    NULL,           /* RETRO_LANGUAGE_KOREAN */
1047    NULL,           /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1048    NULL,           /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1049    NULL,           /* RETRO_LANGUAGE_ESPERANTO */
1050    NULL,           /* RETRO_LANGUAGE_POLISH */
1051    NULL,           /* RETRO_LANGUAGE_VIETNAMESE */
1052    NULL,           /* RETRO_LANGUAGE_ARABIC */
1053    NULL,           /* RETRO_LANGUAGE_GREEK */
1054    option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1055 };
1056 #endif
1057
1058 /*
1059  ********************************
1060  * Functions
1061  ********************************
1062 */
1063
1064 /* Handles configuration/setting of core options.
1065  * Should be called as early as possible - ideally inside
1066  * retro_set_environment(), and no later than retro_load_game()
1067  * > We place the function body in the header to avoid the
1068  *   necessity of adding more .c files (i.e. want this to
1069  *   be as painless as possible for core devs)
1070  */
1071
1072 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1073 {
1074    unsigned version = 0;
1075
1076    if (!environ_cb)
1077       return;
1078
1079    if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1080    {
1081 #ifndef HAVE_NO_LANGEXTRA
1082       struct retro_core_options_intl core_options_intl;
1083       unsigned language = 0;
1084
1085       core_options_intl.us    = option_defs_us;
1086       core_options_intl.local = NULL;
1087
1088       if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1089           (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1090          core_options_intl.local = option_defs_intl[language];
1091
1092       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1093 #else
1094       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1095 #endif
1096    }
1097    else
1098    {
1099       size_t i;
1100       size_t option_index              = 0;
1101       size_t num_options               = 0;
1102       struct retro_variable *variables = NULL;
1103       char **values_buf                = NULL;
1104
1105       /* Determine number of options
1106        * > Note: We are going to skip a number of irrelevant
1107        *   core options when building the retro_variable array,
1108        *   but we'll allocate space for all of them. The difference
1109        *   in resource usage is negligible, and this allows us to
1110        *   keep the code 'cleaner' */
1111       while (true)
1112       {
1113          if (option_defs_us[num_options].key)
1114             num_options++;
1115          else
1116             break;
1117       }
1118
1119       /* Allocate arrays */
1120       variables  = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1121       values_buf = (char **)calloc(num_options, sizeof(char *));
1122
1123       if (!variables || !values_buf)
1124          goto error;
1125
1126       /* Copy parameters from option_defs_us array */
1127       for (i = 0; i < num_options; i++)
1128       {
1129          const char *key                        = option_defs_us[i].key;
1130          const char *desc                       = option_defs_us[i].desc;
1131          const char *default_value              = option_defs_us[i].default_value;
1132          struct retro_core_option_value *values = option_defs_us[i].values;
1133          size_t buf_len                         = 3;
1134          size_t default_index                   = 0;
1135
1136          values_buf[i] = NULL;
1137
1138          /* Skip options that are irrelevant when using the
1139           * old style core options interface */
1140          if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1141             continue;
1142
1143          if (desc)
1144          {
1145             size_t num_values = 0;
1146
1147             /* Determine number of values */
1148             while (true)
1149             {
1150                if (values[num_values].value)
1151                {
1152                   /* Check if this is the default value */
1153                   if (default_value)
1154                      if (strcmp(values[num_values].value, default_value) == 0)
1155                         default_index = num_values;
1156
1157                   buf_len += strlen(values[num_values].value);
1158                   num_values++;
1159                }
1160                else
1161                   break;
1162             }
1163
1164             /* Build values string */
1165             if (num_values > 0)
1166             {
1167                size_t j;
1168
1169                buf_len += num_values - 1;
1170                buf_len += strlen(desc);
1171
1172                values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1173                if (!values_buf[i])
1174                   goto error;
1175
1176                strcpy(values_buf[i], desc);
1177                strcat(values_buf[i], "; ");
1178
1179                /* Default value goes first */
1180                strcat(values_buf[i], values[default_index].value);
1181
1182                /* Add remaining values */
1183                for (j = 0; j < num_values; j++)
1184                {
1185                   if (j != default_index)
1186                   {
1187                      strcat(values_buf[i], "|");
1188                      strcat(values_buf[i], values[j].value);
1189                   }
1190                }
1191             }
1192          }
1193
1194          variables[option_index].key   = key;
1195          variables[option_index].value = values_buf[i];
1196          option_index++;
1197       }
1198
1199       /* Set variables */
1200       environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1201
1202 error:
1203
1204       /* Clean up */
1205       if (values_buf)
1206       {
1207          for (i = 0; i < num_options; i++)
1208          {
1209             if (values_buf[i])
1210             {
1211                free(values_buf[i]);
1212                values_buf[i] = NULL;
1213             }
1214          }
1215
1216          free(values_buf);
1217          values_buf = NULL;
1218       }
1219
1220       if (variables)
1221       {
1222          free(variables);
1223          variables = NULL;
1224       }
1225    }
1226 }
1227
1228 #ifdef __cplusplus
1229 }
1230 #endif
1231
1232 #endif